From 35dc57fd6eed6d8d2ae269f7ef33e1636d92e8ee Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Tue, 19 Nov 2019 12:28:16 +0100 Subject: [PATCH] Built motion from commit (unavailable).|2.3.95 --- 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/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/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/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 +- 1045 files changed, 1045 insertions(+), 1045 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 210c771..1e593e1 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.3.95", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-11-19T11:09:06.278Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.3.95", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-11-19T11:22:35.966Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c72909c..0c3512b 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.3.95", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-11-19T11:09:06.278Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.3.95", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-11-19T11:22:35.966Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 601fc79..877d6b3 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 _0xeda8=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot','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]','TEXT','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot'];(function(_0x18dbdc,_0x2789e2){var _0x46f4a6=function(_0x2822ca){while(--_0x2822ca){_0x18dbdc['push'](_0x18dbdc['shift']());}};_0x46f4a6(++_0x2789e2);}(_0xeda8,0x104));var _0x8eda=function(_0x219933,_0x3dc254){_0x219933=_0x219933-0x0;var _0x33f4c8=_0xeda8[_0x219933];return _0x33f4c8;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x12899a){return this[_0x8eda('0x2')](_0x8eda('0x3'));}},'action':{'type':Sequelize[_0x8eda('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8eda('0x5'),_0x8eda('0x6'),_0x8eda('0x7'),_0x8eda('0x8'),_0x8eda('0x9'),_0x8eda('0xa'),_0x8eda('0xb')]],'msg':_0x8eda('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot'},'data1':{'type':Sequelize[_0x8eda('0x4')](0x1000),'comment':_0x8eda('0xd')},'data2':{'type':Sequelize[_0x8eda('0x4')](0x1000),'comment':_0x8eda('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x8eda('0x4')]},'data7':{'type':Sequelize[_0x8eda('0xf')]}}; \ No newline at end of file +var _0x038b=['integration','jscripty','urlForward','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','exports','VIRTUAL','action','contactManager'];(function(_0x27d85b,_0x4096a5){var _0x41ea0c=function(_0x52a013){while(--_0x52a013){_0x27d85b['push'](_0x27d85b['shift']());}};_0x41ea0c(++_0x4096a5);}(_0x038b,0x114));var _0xb038=function(_0x35c54f,_0x2219e7){_0x35c54f=_0x35c54f-0x0;var _0x34b701=_0x038b[_0x35c54f];return _0x34b701;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'get':function(_0x449fef){return this['getDataValue'](_0xb038('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xb038('0x3'),_0xb038('0x4'),'motionbar',_0xb038('0x5'),_0xb038('0x6'),'browser','bot']],'msg':_0xb038('0x7')}},'comment':_0xb038('0x7')},'data1':{'type':Sequelize[_0xb038('0x8')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xb038('0x9')},'data3':{'type':Sequelize[_0xb038('0x8')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0xb038('0x8')](0x1000)},'data6':{'type':Sequelize[_0xb038('0x8')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 25189b8..f0a674e 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 _0x95e0=['find','catch','params','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','body','Action'];(function(_0x3a3148,_0x33159c){var _0x118587=function(_0x29040e){while(--_0x29040e){_0x3a3148['push'](_0x3a3148['shift']());}};_0x118587(++_0x33159c);}(_0x95e0,0x10b));var _0x095e=function(_0x110134,_0x5bb465){_0x110134=_0x110134-0x0;var _0x99b8d2=_0x95e0[_0x110134];return _0x99b8d2;};'use strict';var pdf=require(_0x095e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x095e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x095e('0x2'));var rp=require(_0x095e('0x3'));var moment=require(_0x095e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x095e('0x5'));var util=require('util');var path=require(_0x095e('0x6'));var sox=require(_0x095e('0x7'));var csv=require(_0x095e('0x8'));var ejs=require(_0x095e('0x9'));var fs=require('fs');var _=require(_0x095e('0xa'));var squel=require(_0x095e('0xb'));var crypto=require(_0x095e('0xc'));var jsforce=require(_0x095e('0xd'));var deskjs=require(_0x095e('0xe'));var toCsv=require(_0x095e('0x8'));var querystring=require(_0x095e('0xf'));var Papa=require(_0x095e('0x10'));var authService=require(_0x095e('0x11'));var hardwareService=require(_0x095e('0x12'));var Redis=require(_0x095e('0x13'));var qs=require(_0x095e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x095e('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54f248,_0xe34958){_0xe34958=_0xe34958||0xcc;return function(_0xf635ad){if(_0xf635ad){return _0x54f248['sendStatus'](_0xe34958);}return _0x54f248[_0x095e('0x16')](_0xe34958)['end']();};}function respondWithResult(_0x1ea8bc,_0x126a4e){_0x126a4e=_0x126a4e||0xc8;return function(_0x48bcad){if(_0x48bcad){return _0x1ea8bc[_0x095e('0x16')](_0x126a4e)[_0x095e('0x17')](_0x48bcad);}};}function respondWithFilteredResult(_0x5acad9,_0x25a3f8){return function(_0x58188b){if(_0x58188b){var _0x2e55b2=_0x58188b[_0x095e('0x18')],_0x4bebdc=_0x25a3f8[_0x095e('0x19')],_0x1d3d9b=_0x25a3f8[_0x095e('0x19')]+_0x25a3f8[_0x095e('0x1a')],_0x4ee1e5;if(_0x1d3d9b>=_0x2e55b2){_0x1d3d9b=_0x2e55b2;_0x4ee1e5=0xc8;}else{_0x4ee1e5=0xce;}_0x5acad9[_0x095e('0x16')](_0x4ee1e5);return _0x5acad9[_0x095e('0x1b')]('Content-Range',_0x4bebdc+'-'+_0x1d3d9b+'/'+_0x2e55b2)[_0x095e('0x17')](_0x58188b);}return null;};}function patchUpdates(_0x2031a1){return function(_0x2cf683){try{jsonpatch[_0x095e('0x1c')](_0x2cf683,_0x2031a1,!![]);}catch(_0x21f62c){return BPromise[_0x095e('0x1d')](_0x21f62c);}return _0x2cf683[_0x095e('0x1e')]();};}function saveUpdates(_0x557b1a,_0x1f75a1){return function(_0x7a2d85){if(_0x7a2d85){return _0x7a2d85[_0x095e('0x1f')](_0x557b1a)['then'](function(_0x55dd4b){return _0x55dd4b;});}return null;};}function removeEntity(_0x121898,_0x3f4c4a){return function(_0x114adf){if(_0x114adf){return _0x114adf[_0x095e('0x20')]()[_0x095e('0x21')](function(){_0x121898[_0x095e('0x16')](0xcc)[_0x095e('0x22')]();});}};}function handleEntityNotFound(_0x27b5b6,_0x58008c){return function(_0x4e1056){if(!_0x4e1056){_0x27b5b6['sendStatus'](0x194);}return _0x4e1056;};}function handleError(_0x394460,_0x35777){_0x35777=_0x35777||0x1f4;return function(_0x9eb851){logger[_0x095e('0x23')](_0x9eb851[_0x095e('0x24')]);if(_0x9eb851[_0x095e('0x25')]){delete _0x9eb851[_0x095e('0x25')];}_0x394460['status'](_0x35777)[_0x095e('0x26')](_0x9eb851);};}exports[_0x095e('0x1f')]=function(_0x457f8a,_0x5eded0){if(_0x457f8a[_0x095e('0x27')]['id']){delete _0x457f8a[_0x095e('0x27')]['id'];}return db[_0x095e('0x28')][_0x095e('0x29')]({'where':{'id':_0x457f8a['params']['id']}})['then'](handleEntityNotFound(_0x5eded0,null))[_0x095e('0x21')](saveUpdates(_0x457f8a[_0x095e('0x27')],null))['then'](respondWithResult(_0x5eded0,null))[_0x095e('0x2a')](handleError(_0x5eded0,null));};exports['destroy']=function(_0x5513be,_0x1bcc91){return db[_0x095e('0x28')][_0x095e('0x29')]({'where':{'id':_0x5513be[_0x095e('0x2b')]['id']}})[_0x095e('0x21')](handleEntityNotFound(_0x1bcc91,null))['then'](removeEntity(_0x1bcc91,null))[_0x095e('0x2a')](handleError(_0x1bcc91,null));}; \ No newline at end of file +var _0x8d1d=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','status','send','body','find','params','catch','html-pdf'];(function(_0x1fad5f,_0x40606b){var _0x57fabd=function(_0x250559){while(--_0x250559){_0x1fad5f['push'](_0x1fad5f['shift']());}};_0x57fabd(++_0x40606b);}(_0x8d1d,0x7a));var _0xd8d1=function(_0x50b9f9,_0x9dc86e){_0x50b9f9=_0x50b9f9-0x0;var _0x41f658=_0x8d1d[_0x50b9f9];return _0x41f658;};'use strict';var pdf=require(_0xd8d1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd8d1('0x1'));var jsonpatch=require(_0xd8d1('0x2'));var rp=require(_0xd8d1('0x3'));var moment=require(_0xd8d1('0x4'));var BPromise=require(_0xd8d1('0x5'));var Mustache=require(_0xd8d1('0x6'));var util=require('util');var path=require(_0xd8d1('0x7'));var sox=require('sox');var csv=require(_0xd8d1('0x8'));var ejs=require(_0xd8d1('0x9'));var fs=require('fs');var _=require(_0xd8d1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd8d1('0x8'));var querystring=require('querystring');var Papa=require(_0xd8d1('0xb'));var authService=require('../../components/auth/service');var hardwareService=require(_0xd8d1('0xc'));var Redis=require(_0xd8d1('0xd'));var qs=require(_0xd8d1('0xe'));var logger=require(_0xd8d1('0xf'))(_0xd8d1('0x10'));var utils=require(_0xd8d1('0x11'));var config=require(_0xd8d1('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f876a,_0x1ea0b7){_0x1ea0b7=_0x1ea0b7||0xcc;return function(_0x2e5938){if(_0x2e5938){return _0x3f876a['sendStatus'](_0x1ea0b7);}return _0x3f876a['status'](_0x1ea0b7)[_0xd8d1('0x13')]();};}function respondWithResult(_0x24fcfd,_0x1e22be){_0x1e22be=_0x1e22be||0xc8;return function(_0x36eca5){if(_0x36eca5){return _0x24fcfd['status'](_0x1e22be)[_0xd8d1('0x14')](_0x36eca5);}};}function respondWithFilteredResult(_0x44b4a1,_0x36b180){return function(_0x5e7a29){if(_0x5e7a29){var _0x26edc4=_0x5e7a29[_0xd8d1('0x15')],_0x5e8f9e=_0x36b180[_0xd8d1('0x16')],_0x4acc23=_0x36b180[_0xd8d1('0x16')]+_0x36b180[_0xd8d1('0x17')],_0x194e3f;if(_0x4acc23>=_0x26edc4){_0x4acc23=_0x26edc4;_0x194e3f=0xc8;}else{_0x194e3f=0xce;}_0x44b4a1['status'](_0x194e3f);return _0x44b4a1[_0xd8d1('0x18')](_0xd8d1('0x19'),_0x5e8f9e+'-'+_0x4acc23+'/'+_0x26edc4)[_0xd8d1('0x14')](_0x5e7a29);}return null;};}function patchUpdates(_0x3bae6e){return function(_0x3c7425){try{jsonpatch[_0xd8d1('0x1a')](_0x3c7425,_0x3bae6e,!![]);}catch(_0x10b90b){return BPromise[_0xd8d1('0x1b')](_0x10b90b);}return _0x3c7425['save']();};}function saveUpdates(_0x5ac555,_0x5bf04a){return function(_0x4c34e8){if(_0x4c34e8){return _0x4c34e8[_0xd8d1('0x1c')](_0x5ac555)[_0xd8d1('0x1d')](function(_0x1b4d98){return _0x1b4d98;});}return null;};}function removeEntity(_0x318352,_0x1347e8){return function(_0x1d0b1c){if(_0x1d0b1c){return _0x1d0b1c[_0xd8d1('0x1e')]()[_0xd8d1('0x1d')](function(){_0x318352['status'](0xcc)[_0xd8d1('0x13')]();});}};}function handleEntityNotFound(_0x12e852,_0x5e3106){return function(_0x15eac1){if(!_0x15eac1){_0x12e852[_0xd8d1('0x1f')](0x194);}return _0x15eac1;};}function handleError(_0x16263a,_0x39e4c1){_0x39e4c1=_0x39e4c1||0x1f4;return function(_0x28fb36){logger[_0xd8d1('0x20')](_0x28fb36[_0xd8d1('0x21')]);if(_0x28fb36[_0xd8d1('0x22')]){delete _0x28fb36[_0xd8d1('0x22')];}_0x16263a[_0xd8d1('0x23')](_0x39e4c1)[_0xd8d1('0x24')](_0x28fb36);};}exports['update']=function(_0x3b3bbe,_0x376a4b){if(_0x3b3bbe[_0xd8d1('0x25')]['id']){delete _0x3b3bbe[_0xd8d1('0x25')]['id'];}return db['Action'][_0xd8d1('0x26')]({'where':{'id':_0x3b3bbe[_0xd8d1('0x27')]['id']}})[_0xd8d1('0x1d')](handleEntityNotFound(_0x376a4b,null))[_0xd8d1('0x1d')](saveUpdates(_0x3b3bbe['body'],null))[_0xd8d1('0x1d')](respondWithResult(_0x376a4b,null))['catch'](handleError(_0x376a4b,null));};exports[_0xd8d1('0x1e')]=function(_0x19cf23,_0x3a3839){return db['Action']['find']({'where':{'id':_0x19cf23[_0xd8d1('0x27')]['id']}})[_0xd8d1('0x1d')](handleEntityNotFound(_0x3a3839,null))[_0xd8d1('0x1d')](removeEntity(_0x3a3839,null))[_0xd8d1('0x28')](handleError(_0x3a3839,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 85d54ab..348652f 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 _0x4a6e=['../../config/logger','api','moment','bluebird','request-promise','./action.attributes','exports','define','lodash','util'];(function(_0x164e2e,_0x1a0428){var _0x13f566=function(_0x1393e4){while(--_0x1393e4){_0x164e2e['push'](_0x164e2e['shift']());}};_0x13f566(++_0x1a0428);}(_0x4a6e,0x94));var _0xe4a6=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x4a6e[_0x478414];return _0x5eb6b9;};'use strict';var _=require(_0xe4a6('0x0'));var util=require(_0xe4a6('0x1'));var logger=require(_0xe4a6('0x2'))(_0xe4a6('0x3'));var moment=require(_0xe4a6('0x4'));var BPromise=require(_0xe4a6('0x5'));var rp=require(_0xe4a6('0x6'));var attributes=require(_0xe4a6('0x7'));module[_0xe4a6('0x8')]=function(_0x55e973,_0x3d2c68){return _0x55e973[_0xe4a6('0x9')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe78=['Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','exports'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0xbe78,0x65));var _0x8be7=function(_0x181f81,_0x594c9c){_0x181f81=_0x181f81-0x0;var _0x25b0c6=_0xbe78[_0x181f81];return _0x25b0c6;};'use strict';var _=require(_0x8be7('0x0'));var util=require(_0x8be7('0x1'));var logger=require(_0x8be7('0x2'))(_0x8be7('0x3'));var moment=require(_0x8be7('0x4'));var BPromise=require(_0x8be7('0x5'));var rp=require('request-promise');var attributes=require('./action.attributes');module[_0x8be7('0x6')]=function(_0x36b1ae,_0x5b6bbd){return _0x36b1ae['define'](_0x8be7('0x7'),attributes,{'tableName':_0x8be7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index efdaaf4..b345cb0 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 _0xa566=['Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','request','info'];(function(_0x4119bf,_0x2e4b8e){var _0xcd3e8f=function(_0x567d5b){while(--_0x567d5b){_0x4119bf['push'](_0x4119bf['shift']());}};_0xcd3e8f(++_0x2e4b8e);}(_0xa566,0x1c1));var _0x6a56=function(_0x51db8a,_0x35d1da){_0x51db8a=_0x51db8a-0x0;var _0x500d4b=_0xa566[_0x51db8a];return _0x500d4b;};'use strict';var _=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var moment=require(_0x6a56('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a56('0x3'));var fs=require('fs');var Redis=require(_0x6a56('0x4'));var db=require(_0x6a56('0x5'))['db'];var utils=require(_0x6a56('0x6'));var logger=require('../../config/logger')(_0x6a56('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3712ee,_0x50ae34,_0x472c60){return new BPromise(function(_0x4947a9,_0x33240c){return client[_0x6a56('0x8')](_0x3712ee,_0x472c60)['then'](function(_0x2f49ab){logger[_0x6a56('0x9')](_0x6a56('0xa'),_0x50ae34,_0x6a56('0xb'));logger['debug'](_0x6a56('0xc'),_0x50ae34,_0x6a56('0xb'),JSON['stringify'](_0x2f49ab));if(_0x2f49ab['error']){if(_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xe')]===0x1f4){logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xf')]);return _0x33240c(_0x2f49ab[_0x6a56('0xd')]['message']);}logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xf')]);return _0x4947a9(_0x2f49ab[_0x6a56('0xd')]['message']);}else{logger[_0x6a56('0x9')](_0x6a56('0xa'),_0x50ae34,_0x6a56('0xb'));_0x4947a9(_0x2f49ab[_0x6a56('0x10')][_0x6a56('0xf')]);}})['catch'](function(_0x5e9895){logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x5e9895);_0x33240c(_0x5e9895);});});} \ No newline at end of file +var _0x33c5=['then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x33c5,0xe6));var _0x533c=function(_0x5c7883,_0x2d0e2e){_0x5c7883=_0x5c7883-0x0;var _0x2e4777=_0x33c5[_0x5c7883];return _0x2e4777;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var moment=require(_0x533c('0x1'));var BPromise=require('bluebird');var rs=require(_0x533c('0x2'));var fs=require('fs');var Redis=require(_0x533c('0x3'));var db=require(_0x533c('0x4'))['db'];var utils=require(_0x533c('0x5'));var logger=require(_0x533c('0x6'))('rpc');var config=require(_0x533c('0x7'));var jayson=require(_0x533c('0x8'));var client=jayson[_0x533c('0x9')][_0x533c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){return client[_0x533c('0xb')](_0x34ca89,_0x3a009b)[_0x533c('0xc')](function(_0x46536d){logger[_0x533c('0xd')](_0x533c('0xe'),_0x1699d5,_0x533c('0xf'));logger[_0x533c('0x10')]('Action,\x20%s,\x20%s,\x20%s',_0x1699d5,_0x533c('0xf'),JSON[_0x533c('0x11')](_0x46536d));if(_0x46536d[_0x533c('0x12')]){if(_0x46536d[_0x533c('0x12')][_0x533c('0x13')]===0x1f4){logger[_0x533c('0x12')]('Action,\x20%s,\x20%s',_0x1699d5,_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);return _0x2c297c(_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);}logger[_0x533c('0x12')](_0x533c('0xe'),_0x1699d5,_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);return _0x36d74e(_0x46536d['error'][_0x533c('0x14')]);}else{logger[_0x533c('0xd')](_0x533c('0xe'),_0x1699d5,_0x533c('0xf'));_0x36d74e(_0x46536d['result'][_0x533c('0x14')]);}})[_0x533c('0x15')](function(_0x41e22c){logger[_0x533c('0x12')](_0x533c('0xe'),_0x1699d5,_0x41e22c);_0x2c297c(_0x41e22c);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3f9d208..488f3e1 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 _0x983c=['put','/:id','isAuthenticated','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x5d687b,_0x23bebd){var _0xcf1011=function(_0xc6d486){while(--_0xc6d486){_0x5d687b['push'](_0x5d687b['shift']());}};_0xcf1011(++_0x23bebd);}(_0x983c,0xf3));var _0xc983=function(_0x19a7f6,_0x3abadc){_0x19a7f6=_0x19a7f6-0x0;var _0x5831b8=_0x983c[_0x19a7f6];return _0x5831b8;};'use strict';var multer=require(_0xc983('0x0'));var util=require(_0xc983('0x1'));var path=require(_0xc983('0x2'));var timeout=require(_0xc983('0x3'));var express=require(_0xc983('0x4'));var router=express['Router']();var auth=require(_0xc983('0x5'));var interaction=require(_0xc983('0x6'));var config=require(_0xc983('0x7'));var controller=require(_0xc983('0x8'));router[_0xc983('0x9')](_0xc983('0xa'),auth[_0xc983('0xb')](),controller['update']);router[_0xc983('0xc')](_0xc983('0xa'),auth[_0xc983('0xb')](),controller[_0xc983('0xd')]);module['exports']=router; \ No newline at end of file +var _0x74fd=['../../config/environment','./action.controller','put','update','delete','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x74fd,0x8f));var _0xd74f=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0x74fd[_0x30a31e];return _0x170879;};'use strict';var multer=require(_0xd74f('0x0'));var util=require('util');var path=require(_0xd74f('0x1'));var timeout=require(_0xd74f('0x2'));var express=require(_0xd74f('0x3'));var router=express[_0xd74f('0x4')]();var auth=require(_0xd74f('0x5'));var interaction=require(_0xd74f('0x6'));var config=require(_0xd74f('0x7'));var controller=require(_0xd74f('0x8'));router[_0xd74f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd74f('0xa')]);router[_0xd74f('0xb')]('/:id',auth[_0xd74f('0xc')](),controller[_0xd74f('0xd')]);module[_0xd74f('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index fe79a6d..2a84c5d 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 _0x16fc=['STRING','TEXT'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x16fc,0x1a8));var _0xc16f=function(_0x56cae6,_0xd096c3){_0x56cae6=_0x56cae6-0x0;var _0xdfd4c3=_0x16fc[_0x56cae6];return _0xdfd4c3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc16f('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xc16f('0x0')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xc16f('0x0')]},'conditions':{'type':Sequelize[_0xc16f('0x1')]},'joins':{'type':Sequelize[_0xc16f('0x1')]}}; \ No newline at end of file +var _0xba94=['sequelize','exports','STRING','TEXT'];(function(_0x201aa4,_0x3fbbd3){var _0x316139=function(_0x582fba){while(--_0x582fba){_0x201aa4['push'](_0x201aa4['shift']());}};_0x316139(++_0x3fbbd3);}(_0xba94,0x180));var _0x4ba9=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xba94[_0x42f009];return _0x22a1e0;};'use strict';var Sequelize=require(_0x4ba9('0x0'));module[_0x4ba9('0x1')]={'name':{'type':Sequelize[_0x4ba9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ba9('0x2')]},'table':{'type':Sequelize[_0x4ba9('0x2')]},'conditions':{'type':Sequelize[_0x4ba9('0x3')]},'joins':{'type':Sequelize[_0x4ba9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index de55e92..7b4456e 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 _0xfa28=['../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','CustomReports','destroy','error','stack','name','AnalyticCustomReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','length','include','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','table','MetricId','metric','function','replace','format','group','orderBy','alias','joins','parse','type','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','operator','AnalyticMetric','keyBy','DESC','QueryTypes','Sequelize','No\x20available\x20data','fullPath','%s-%s.%s','randomstring','output','csv','custom','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','../../files/reports','savename','from','countTable','COUNT(*)','run','runReport','COUNT(%s)','COUNT(DISTINCT\x20%s)','groupBy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x26c777,_0x33c292){var _0x4ef25a=function(_0x14e425){while(--_0x14e425){_0x26c777['push'](_0x26c777['shift']());}};_0x4ef25a(++_0x33c292);}(_0xfa28,0x1c6));var _0x8fa2=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xfa28[_0x13e741];return _0x3f8bb3;};'use strict';var pdf=require(_0x8fa2('0x0'));var emlformat=require(_0x8fa2('0x1'));var rimraf=require(_0x8fa2('0x2'));var zipdir=require(_0x8fa2('0x3'));var jsonpatch=require(_0x8fa2('0x4'));var rp=require(_0x8fa2('0x5'));var moment=require(_0x8fa2('0x6'));var BPromise=require(_0x8fa2('0x7'));var Mustache=require('mustache');var util=require(_0x8fa2('0x8'));var path=require(_0x8fa2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8fa2('0xa'));var crypto=require(_0x8fa2('0xb'));var jsforce=require(_0x8fa2('0xc'));var deskjs=require(_0x8fa2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8fa2('0xe'));var Papa=require(_0x8fa2('0xf'));var authService=require(_0x8fa2('0x10'));var hardwareService=require(_0x8fa2('0x11'));var Redis=require(_0x8fa2('0x12'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8fa2('0x13'));var utils=require(_0x8fa2('0x14'));var config=require(_0x8fa2('0x15'));var db=require(_0x8fa2('0x16'))['db'];function respondWithStatusCode(_0x24170a,_0x60a19a){_0x60a19a=_0x60a19a||0xcc;return function(_0x523730){if(_0x523730){return _0x24170a[_0x8fa2('0x17')](_0x60a19a);}return _0x24170a[_0x8fa2('0x18')](_0x60a19a)[_0x8fa2('0x19')]();};}function respondWithResult(_0x2ff0d8,_0x49de04){_0x49de04=_0x49de04||0xc8;return function(_0x37574c){if(_0x37574c){return _0x2ff0d8['status'](_0x49de04)[_0x8fa2('0x1a')](_0x37574c);}};}function respondWithFilteredResult(_0x15d207,_0x377d84){return function(_0x4d6332){if(_0x4d6332){var _0x2b3192=_0x4d6332[_0x8fa2('0x1b')],_0x2f9a3d=_0x377d84[_0x8fa2('0x1c')],_0x28457d=_0x377d84['offset']+_0x377d84[_0x8fa2('0x1d')],_0x1e7c4d;if(_0x28457d>=_0x2b3192){_0x28457d=_0x2b3192;_0x1e7c4d=0xc8;}else{_0x1e7c4d=0xce;}_0x15d207['status'](_0x1e7c4d);return _0x15d207[_0x8fa2('0x1e')](_0x8fa2('0x1f'),_0x2f9a3d+'-'+_0x28457d+'/'+_0x2b3192)[_0x8fa2('0x1a')](_0x4d6332);}return null;};}function patchUpdates(_0x375c17){return function(_0x5be2c1){try{jsonpatch['apply'](_0x5be2c1,_0x375c17,!![]);}catch(_0x52de4c){return BPromise[_0x8fa2('0x20')](_0x52de4c);}return _0x5be2c1[_0x8fa2('0x21')]();};}function saveUpdates(_0x440e45,_0x56624a){return function(_0x3c1263){if(_0x3c1263){return _0x3c1263[_0x8fa2('0x22')](_0x440e45)['then'](function(_0xb038cd){return _0xb038cd;});}return null;};}function removeEntity(_0xd3c700,_0x5b66ec){return function(_0x54d8d3){if(_0x54d8d3){return _0x54d8d3['destroy']()[_0x8fa2('0x23')](function(){var _0x265a56=_0x54d8d3[_0x8fa2('0x24')]({'plain':!![]});var _0x3e8a44=_0x8fa2('0x25');return db['UserProfileResource'][_0x8fa2('0x26')]({'where':{'type':_0x3e8a44,'resourceId':_0x265a56['id']}})[_0x8fa2('0x23')](function(){return _0x54d8d3;});})['then'](function(){_0xd3c700['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59bad4,_0x9fa89){return function(_0x2a9b83){if(!_0x2a9b83){_0x59bad4[_0x8fa2('0x17')](0x194);}return _0x2a9b83;};}function handleError(_0x5c2c08,_0x57d197){_0x57d197=_0x57d197||0x1f4;return function(_0x3aafaf){logger[_0x8fa2('0x27')](_0x3aafaf[_0x8fa2('0x28')]);if(_0x3aafaf[_0x8fa2('0x29')]){delete _0x3aafaf[_0x8fa2('0x29')];}_0x5c2c08[_0x8fa2('0x18')](_0x57d197)['send'](_0x3aafaf);};}exports['index']=function(_0x3b95e6,_0x3808e3){var _0x42baf8={},_0x28c18d={},_0x3ca12a={'count':0x0,'rows':[]};var _0x5ddd54=db[_0x8fa2('0x2a')][_0x8fa2('0x2b')];_0x28c18d[_0x8fa2('0x2c')]=_[_0x8fa2('0x2d')](_0x5ddd54);_0x28c18d['query']=_[_0x8fa2('0x2d')](_0x3b95e6[_0x8fa2('0x2e')]);_0x28c18d[_0x8fa2('0x2f')]=_[_0x8fa2('0x30')](_0x28c18d['model'],_0x28c18d[_0x8fa2('0x2e')]);_0x42baf8['attributes']=_['intersection'](_0x28c18d[_0x8fa2('0x2c')],qs[_0x8fa2('0x31')](_0x3b95e6[_0x8fa2('0x2e')][_0x8fa2('0x31')]));_0x42baf8[_0x8fa2('0x32')]=_0x42baf8[_0x8fa2('0x32')]['length']?_0x42baf8['attributes']:_0x28c18d[_0x8fa2('0x2c')];if(!_0x3b95e6[_0x8fa2('0x2e')]['hasOwnProperty'](_0x8fa2('0x33'))){_0x42baf8['limit']=qs[_0x8fa2('0x1d')](_0x3b95e6[_0x8fa2('0x2e')]['limit']);_0x42baf8['offset']=qs['offset'](_0x3b95e6[_0x8fa2('0x2e')][_0x8fa2('0x1c')]);}_0x42baf8[_0x8fa2('0x34')]=qs[_0x8fa2('0x35')](_0x3b95e6[_0x8fa2('0x2e')]['sort']);_0x42baf8[_0x8fa2('0x36')]=qs['filters'](_['pick'](_0x3b95e6[_0x8fa2('0x2e')],_0x28c18d[_0x8fa2('0x2f')]));if(_0x3b95e6[_0x8fa2('0x2e')][_0x8fa2('0x37')]){_0x42baf8['where']=_['merge'](_0x42baf8[_0x8fa2('0x36')],{'$or':_['map'](_0x5ddd54,function(_0x296a15){if(_0x296a15['type']['key']!==_0x8fa2('0x38')){var _0x564169={};_0x564169[_0x296a15[_0x8fa2('0x39')]]={'$like':'%'+_0x3b95e6[_0x8fa2('0x2e')]['filter']+'%'};return _0x564169;}})});}_0x42baf8=_['merge']({},_0x42baf8,_0x3b95e6[_0x8fa2('0x3a')]);var _0x5dc4b3={'where':_0x42baf8['where']};return db['AnalyticCustomReport'][_0x8fa2('0x1b')](_0x5dc4b3)[_0x8fa2('0x23')](function(_0x2e8489){_0x3ca12a[_0x8fa2('0x1b')]=_0x2e8489;if(_0x3b95e6[_0x8fa2('0x2e')][_0x8fa2('0x3b')]){_0x42baf8['include']=[{'all':!![]}];}return db[_0x8fa2('0x2a')][_0x8fa2('0x3c')](_0x42baf8);})[_0x8fa2('0x23')](function(_0x406f33){_0x3ca12a[_0x8fa2('0x3d')]=_0x406f33;return _0x3ca12a;})[_0x8fa2('0x23')](respondWithFilteredResult(_0x3808e3,_0x42baf8))[_0x8fa2('0x3e')](handleError(_0x3808e3,null));};exports['show']=function(_0x58aeb5,_0x1cd59f){var _0x1f2e93={'raw':![],'where':{'id':_0x58aeb5[_0x8fa2('0x3f')]['id']}},_0x4d35d3={};_0x4d35d3['model']=_[_0x8fa2('0x2d')](db[_0x8fa2('0x2a')]['rawAttributes']);_0x4d35d3['query']=_['keys'](_0x58aeb5[_0x8fa2('0x2e')]);_0x4d35d3['filters']=_['intersection'](_0x4d35d3[_0x8fa2('0x2c')],_0x4d35d3[_0x8fa2('0x2e')]);_0x1f2e93['attributes']=_[_0x8fa2('0x30')](_0x4d35d3[_0x8fa2('0x2c')],qs[_0x8fa2('0x31')](_0x58aeb5[_0x8fa2('0x2e')]['fields']));_0x1f2e93['attributes']=_0x1f2e93[_0x8fa2('0x32')][_0x8fa2('0x40')]?_0x1f2e93[_0x8fa2('0x32')]:_0x4d35d3['model'];if(_0x58aeb5[_0x8fa2('0x2e')][_0x8fa2('0x3b')]){_0x1f2e93[_0x8fa2('0x41')]=[{'all':!![]}];}_0x1f2e93=_[_0x8fa2('0x42')]({},_0x1f2e93,_0x58aeb5[_0x8fa2('0x3a')]);return db[_0x8fa2('0x2a')][_0x8fa2('0x43')](_0x1f2e93)[_0x8fa2('0x23')](handleEntityNotFound(_0x1cd59f,null))[_0x8fa2('0x23')](respondWithResult(_0x1cd59f,null))[_0x8fa2('0x3e')](handleError(_0x1cd59f,null));};exports[_0x8fa2('0x44')]=function(_0x56da91,_0x213aea){return db[_0x8fa2('0x2a')][_0x8fa2('0x44')](_0x56da91[_0x8fa2('0x45')],{})[_0x8fa2('0x23')](function(_0x50d43f){var _0x2ba42a=_0x56da91['user'][_0x8fa2('0x24')]({'plain':!![]});if(!_0x2ba42a)throw new Error(_0x8fa2('0x46'));if(_0x2ba42a[_0x8fa2('0x47')]==='user'){var _0x497152=_0x50d43f[_0x8fa2('0x24')]({'plain':!![]});var _0x182398=_0x8fa2('0x48');return db[_0x8fa2('0x49')][_0x8fa2('0x43')]({'where':{'name':_0x182398,'userProfileId':_0x2ba42a[_0x8fa2('0x4a')]},'raw':!![]})[_0x8fa2('0x23')](function(_0x2f2f20){if(_0x2f2f20&&_0x2f2f20['autoAssociation']===0x0){return db[_0x8fa2('0x4b')][_0x8fa2('0x44')]({'name':_0x497152[_0x8fa2('0x29')],'resourceId':_0x497152['id'],'type':_0x8fa2('0x25'),'sectionId':_0x2f2f20['id']},{})['then'](function(){return _0x50d43f;});}else{return _0x50d43f;}})[_0x8fa2('0x3e')](function(_0x10bf47){logger[_0x8fa2('0x27')](_0x8fa2('0x4c'),_0x10bf47);throw _0x10bf47;});}return _0x50d43f;})[_0x8fa2('0x23')](respondWithResult(_0x213aea,0xc9))['catch'](handleError(_0x213aea,null));};exports[_0x8fa2('0x22')]=function(_0x4d75b1,_0x25e2df){if(_0x4d75b1[_0x8fa2('0x45')]['id']){delete _0x4d75b1['body']['id'];}return db[_0x8fa2('0x2a')][_0x8fa2('0x43')]({'where':{'id':_0x4d75b1[_0x8fa2('0x3f')]['id']}})[_0x8fa2('0x23')](handleEntityNotFound(_0x25e2df,null))[_0x8fa2('0x23')](saveUpdates(_0x4d75b1[_0x8fa2('0x45')],null))[_0x8fa2('0x23')](respondWithResult(_0x25e2df,null))[_0x8fa2('0x3e')](handleError(_0x25e2df,null));};exports[_0x8fa2('0x26')]=function(_0x85d21,_0x2ec440){return db['AnalyticCustomReport'][_0x8fa2('0x43')]({'where':{'id':_0x85d21[_0x8fa2('0x3f')]['id']}})[_0x8fa2('0x23')](handleEntityNotFound(_0x2ec440,null))['then'](removeEntity(_0x2ec440,null))['catch'](handleError(_0x2ec440,null));};exports[_0x8fa2('0x4d')]=function(_0x57b9f0,_0x27c1ac){var _0x58e9e3=0xa;var _0x4ad6bc=[_0x8fa2('0x4e'),_0x8fa2('0x4f'),_0x8fa2('0x50'),_0x8fa2('0x51')];var _0x5e2d7c={'SUM':_0x8fa2('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8fa2('0x53'),'MIN':_0x8fa2('0x54'),'AVG':_0x8fa2('0x55'),'GROUP_CONCAT':_0x8fa2('0x56'),'GROUP_CONCAT ASC':_0x8fa2('0x57'),'GROUP_CONCAT DESC':_0x8fa2('0x58')};var _0x3d4521={'SEC_TO_TIME':_0x8fa2('0x59'),'DATE':_0x8fa2('0x5a'),'HOUR':_0x8fa2('0x5b'),'ROUND':_0x8fa2('0x5c'),'UNIX_TIMESTAMP':_0x8fa2('0x5d')};var _0x2c5fb0=function(_0x192983){return!_[_0x8fa2('0x5e')]([_0x8fa2('0x5f'),_0x8fa2('0x60'),_0x8fa2('0x61'),_0x8fa2('0x62')],_0x192983);};var _0x2b9888=function(_0x376a34){if(!_0x376a34||!_0x376a34[_0x8fa2('0x63')][_0x8fa2('0x40')]){return'';}for(var _0x109aa3='(',_0x21b87a=0x0;_0x21b87a<_0x376a34[_0x8fa2('0x63')][_0x8fa2('0x40')];_0x21b87a+=0x1){_0x21b87a>0x0&&(_0x109aa3+='\x20'+_0x376a34['operator']+'\x20');_0x109aa3+=_0x376a34['rules'][_0x21b87a]['group']?_0x2b9888(_0x376a34['rules'][_0x21b87a]['group']):_0x376a34[_0x8fa2('0x63')][_0x21b87a][_0x8fa2('0x39')]+'\x20'+_0x376a34[_0x8fa2('0x63')][_0x21b87a][_0x8fa2('0x64')]+(_0x2c5fb0(_0x376a34['rules'][_0x21b87a]['condition'])?'\x20'+_0x376a34[_0x8fa2('0x63')][_0x21b87a][_0x8fa2('0x65')]:'');}return _0x109aa3+')';};var _0x3c5ca4={'where':{'id':_0x57b9f0[_0x8fa2('0x3f')]['id']}},_0x3eddbf,_0x2b61f2,_0x4fe519,_0x372417,_0x30b933;_0x3c5ca4=_['merge']({},_0x3c5ca4,_0x57b9f0[_0x8fa2('0x3a')]);return db['AnalyticCustomReport'][_0x8fa2('0x43')](_0x3c5ca4)[_0x8fa2('0x23')](function(_0xe38cc3){if(_0xe38cc3){_0x3eddbf=_0xe38cc3;return _0xe38cc3[_0x8fa2('0x66')]();}return null;})[_0x8fa2('0x23')](function(_0x5b4fe2){if(_0x5b4fe2){if(!_0x5b4fe2[_0x8fa2('0x40')]){throw new db['Sequelize'][(_0x8fa2('0x67'))](_0x8fa2('0x68'),0x193);}_0x2b61f2=_0x5b4fe2;return db['AnalyticMetric'][_0x8fa2('0x3c')]({'raw':!![]});}return null;})[_0x8fa2('0x23')](function(_0x118a1a){if(_0x118a1a){_0x4fe519=_['keyBy'](_0x118a1a,'id');var _0x41eeab;var _0x5256b1=squel[_0x8fa2('0x69')]();_0x5256b1['from'](_0x3eddbf[_0x8fa2('0x6a')]);for(var _0x4b2055=0x0;_0x4b2055<_0x2b61f2[_0x8fa2('0x40')];_0x4b2055+=0x1){_0x41eeab=_0x2b61f2[_0x4b2055]['MetricId']?_0x4fe519[_0x2b61f2[_0x4b2055][_0x8fa2('0x6b')]][_0x8fa2('0x6c')]:_0x2b61f2[_0x4b2055][_0x8fa2('0x39')];_0x41eeab=_0x2b61f2[_0x4b2055][_0x8fa2('0x6d')]?_[_0x8fa2('0x6e')](_0x5e2d7c[_0x2b61f2[_0x4b2055]['function']],'%s',_0x41eeab):_0x41eeab;_0x41eeab=_0x2b61f2[_0x4b2055][_0x8fa2('0x6f')]?_[_0x8fa2('0x6e')](_0x3d4521[_0x2b61f2[_0x4b2055]['format']],'%s',_0x41eeab):_0x41eeab;if(_0x2b61f2[_0x4b2055]['groupBy']){_0x5256b1[_0x8fa2('0x70')](_0x41eeab);}_0x2b61f2[_0x4b2055][_0x8fa2('0x71')]&&_0x5256b1['order'](_0x41eeab,_0x2b61f2[_0x4b2055][_0x8fa2('0x71')]==='DESC'?![]:!![]);_0x5256b1[_0x8fa2('0x39')](_0x41eeab,_0x2b61f2[_0x4b2055][_0x8fa2('0x72')]||_0x41eeab);}if(_0x3eddbf[_0x8fa2('0x73')]){_0x3eddbf[_0x8fa2('0x73')]=JSON[_0x8fa2('0x74')](_0x3eddbf[_0x8fa2('0x73')]);for(var _0xda3ddf=0x0;_0xda3ddf<_0x3eddbf[_0x8fa2('0x73')]['length'];_0xda3ddf+=0x1){if(_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf]['type']&&_[_0x8fa2('0x5e')](_0x4ad6bc,_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf][_0x8fa2('0x75')])&&_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf]['parentKey']&&_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf][_0x8fa2('0x76')]&&_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf][_0x8fa2('0x77')]){_0x5256b1[_0x3eddbf['joins'][_0xda3ddf][_0x8fa2('0x75')]](_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf][_0x8fa2('0x76')],null,util['format'](_0x8fa2('0x78'),_0x3eddbf[_0x8fa2('0x6a')],_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf][_0x8fa2('0x79')],_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf][_0x8fa2('0x76')],_0x3eddbf[_0x8fa2('0x73')][_0xda3ddf][_0x8fa2('0x77')]));}}}if(_0x3eddbf['conditions']){_0x3eddbf[_0x8fa2('0x7a')]=JSON[_0x8fa2('0x74')](_0x3eddbf[_0x8fa2('0x7a')]);_0x5256b1['where'](_0x2b9888(_0x3eddbf[_0x8fa2('0x7a')]['group']));}_0x30b933=_0x5256b1[_0x8fa2('0x7b')]();_0x5256b1[_0x8fa2('0x1d')](_0x58e9e3);_0x5256b1['offset'](0x0);logger[_0x8fa2('0x7c')](_0x8fa2('0x7d'),_0x5256b1['toString']());return db[_0x8fa2('0x7e')]['query'](_0x5256b1[_0x8fa2('0x7f')](),{'type':db[_0x8fa2('0x7e')]['QueryTypes'][_0x8fa2('0x80')]});}})[_0x8fa2('0x23')](respondWithResult(_0x27c1ac,null))['catch'](handleError(_0x27c1ac,null));};function runReport(_0xf3eeb1,_0x1ef64c,_0x45960f){var _0xcda0a3=_0x1ef64c['name'];var _0x26b13f=0xa;var _0x1b2284=[_0x8fa2('0x4e'),'left_join',_0x8fa2('0x50'),_0x8fa2('0x51')];var _0x481b8f={'SUM':_0x8fa2('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8fa2('0x53'),'MIN':'MIN(%s)','AVG':_0x8fa2('0x55'),'GROUP_CONCAT':_0x8fa2('0x56'),'GROUP_CONCAT ASC':_0x8fa2('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x30c0c2={'SEC_TO_TIME':_0x8fa2('0x59'),'DATE':_0x8fa2('0x5a'),'HOUR':_0x8fa2('0x5b'),'ROUND':_0x8fa2('0x5c'),'UNIX_TIMESTAMP':_0x8fa2('0x5d')};var _0x108ec9=function(_0x36b6ae){return!_[_0x8fa2('0x5e')](['IS\x20NULL',_0x8fa2('0x60'),_0x8fa2('0x61'),_0x8fa2('0x62')],_0x36b6ae);};var _0x185a28=function(_0x55e207){if(!_0x55e207||!_0x55e207[_0x8fa2('0x63')][_0x8fa2('0x40')]){return'';}for(var _0x25eb36='(',_0x4151d7=0x0;_0x4151d7<_0x55e207[_0x8fa2('0x63')][_0x8fa2('0x40')];_0x4151d7+=0x1){_0x4151d7>0x0&&(_0x25eb36+='\x20'+_0x55e207[_0x8fa2('0x81')]+'\x20');_0x25eb36+=_0x55e207['rules'][_0x4151d7]['group']?_0x185a28(_0x55e207[_0x8fa2('0x63')][_0x4151d7]['group']):_0x55e207['rules'][_0x4151d7][_0x8fa2('0x39')]+'\x20'+_0x55e207[_0x8fa2('0x63')][_0x4151d7][_0x8fa2('0x64')]+(_0x108ec9(_0x55e207['rules'][_0x4151d7][_0x8fa2('0x64')])?'\x20'+_0x55e207[_0x8fa2('0x63')][_0x4151d7][_0x8fa2('0x65')]:'');}return _0x25eb36+')';};var _0x172c4d={'where':{'id':_0xf3eeb1['id']}},_0xeb27a,_0x1876c7,_0x477592,_0x2531d7,_0x20cc15;_0x172c4d=_[_0x8fa2('0x42')]({},_0x172c4d,_0x45960f);return db[_0x8fa2('0x2a')][_0x8fa2('0x43')](_0x172c4d)['then'](function(_0x3a4ec6){if(_0x3a4ec6){_0xeb27a=_0x3a4ec6;return _0x3a4ec6[_0x8fa2('0x66')]();}return null;})[_0x8fa2('0x23')](function(_0x5b9e9b){if(_0x5b9e9b){if(!_0x5b9e9b[_0x8fa2('0x40')]){throw new db['Sequelize']['ValidationErrorItem'](_0x8fa2('0x68'),0x193);}_0x1876c7=_0x5b9e9b;return db[_0x8fa2('0x82')][_0x8fa2('0x3c')]({'raw':!![]});}return null;})[_0x8fa2('0x23')](function(_0x4bedd4){if(_0x4bedd4){_0x477592=_[_0x8fa2('0x83')](_0x4bedd4,'id');var _0x147545;var _0x33358c=squel[_0x8fa2('0x69')]();_0x33358c['from'](_0xeb27a[_0x8fa2('0x6a')]);for(var _0x25038a=0x0;_0x25038a<_0x1876c7['length'];_0x25038a+=0x1){_0x147545=_0x1876c7[_0x25038a]['MetricId']?_0x477592[_0x1876c7[_0x25038a][_0x8fa2('0x6b')]][_0x8fa2('0x6c')]:_0x1876c7[_0x25038a][_0x8fa2('0x39')];_0x147545=_0x1876c7[_0x25038a][_0x8fa2('0x6d')]?_[_0x8fa2('0x6e')](_0x481b8f[_0x1876c7[_0x25038a][_0x8fa2('0x6d')]],'%s',_0x147545):_0x147545;_0x147545=_0x1876c7[_0x25038a]['format']?_[_0x8fa2('0x6e')](_0x30c0c2[_0x1876c7[_0x25038a]['format']],'%s',_0x147545):_0x147545;if(_0x1876c7[_0x25038a]['groupBy']){_0x33358c[_0x8fa2('0x70')](_0x147545);}_0x1876c7[_0x25038a][_0x8fa2('0x71')]&&_0x33358c['order'](_0x147545,_0x1876c7[_0x25038a]['orderBy']===_0x8fa2('0x84')?![]:!![]);_0x33358c['field'](_0x147545,_0x1876c7[_0x25038a][_0x8fa2('0x72')]||_0x147545);}if(_0xeb27a[_0x8fa2('0x73')]){_0xeb27a['joins']=JSON[_0x8fa2('0x74')](_0xeb27a[_0x8fa2('0x73')]);for(var _0x68a347=0x0;_0x68a347<_0xeb27a[_0x8fa2('0x73')][_0x8fa2('0x40')];_0x68a347+=0x1){if(_0xeb27a['joins'][_0x68a347][_0x8fa2('0x75')]&&_[_0x8fa2('0x5e')](_0x1b2284,_0xeb27a[_0x8fa2('0x73')][_0x68a347][_0x8fa2('0x75')])&&_0xeb27a[_0x8fa2('0x73')][_0x68a347][_0x8fa2('0x79')]&&_0xeb27a[_0x8fa2('0x73')][_0x68a347][_0x8fa2('0x76')]&&_0xeb27a[_0x8fa2('0x73')][_0x68a347][_0x8fa2('0x77')]){_0x33358c[_0xeb27a[_0x8fa2('0x73')][_0x68a347][_0x8fa2('0x75')]](_0xeb27a[_0x8fa2('0x73')][_0x68a347][_0x8fa2('0x76')],null,util[_0x8fa2('0x6f')](_0x8fa2('0x78'),_0xeb27a[_0x8fa2('0x6a')],_0xeb27a[_0x8fa2('0x73')][_0x68a347][_0x8fa2('0x79')],_0xeb27a[_0x8fa2('0x73')][_0x68a347][_0x8fa2('0x76')],_0xeb27a[_0x8fa2('0x73')][_0x68a347]['foreignKey']));}}}if(_0xeb27a['conditions']){_0xeb27a[_0x8fa2('0x7a')]=JSON[_0x8fa2('0x74')](_0xeb27a[_0x8fa2('0x7a')]);_0x33358c['where'](_0x185a28(_0xeb27a[_0x8fa2('0x7a')][_0x8fa2('0x70')]));}_0x20cc15=_0x33358c[_0x8fa2('0x7b')]();_0x33358c[_0x8fa2('0x1d')](_0x26b13f);_0x33358c[_0x8fa2('0x1c')](0x0);logger[_0x8fa2('0x7c')](_0x8fa2('0x7d'),_0x33358c[_0x8fa2('0x7f')]());return db['sequelize']['query'](_0x33358c['toString'](),{'type':db[_0x8fa2('0x7e')][_0x8fa2('0x85')]['SELECT']});}})[_0x8fa2('0x23')](function(_0x1dcbd7){if(!_0x1dcbd7[_0x8fa2('0x40')]){throw new db[(_0x8fa2('0x86'))][(_0x8fa2('0x67'))](_0x8fa2('0x87'),0xcc);}if(_0x1ef64c['output']==='web'){return null;}var _0x53f9c9=_[_0x8fa2('0x42')](_0x1ef64c,{'name':_0x1ef64c[_0x8fa2('0x88')]||_0x1ef64c[_0x8fa2('0x29')]||_0xeb27a['name'],'basename':_0xcda0a3,'savename':util[_0x8fa2('0x6f')](_0x8fa2('0x89'),_0x1ef64c[_0x8fa2('0x29')]||_0xeb27a[_0x8fa2('0x29')],require(_0x8fa2('0x8a'))['generate'](0x4),_0x1ef64c[_0x8fa2('0x8b')]||_0x8fa2('0x8c')),'reportId':_0xeb27a['id'],'reportType':_0x8fa2('0x8d')});return db['AnalyticExtractedReport'][_0x8fa2('0x44')](_0x53f9c9,{'raw':!![]});})['then'](function(_0x580485){if(_0xeb27a[_0x8fa2('0x6a')]==='cdr'){_0x20cc15[_0x8fa2('0x36')](_0xeb27a[_0x8fa2('0x6a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1ef64c['startDate'],_0x1ef64c['endDate']);}else{_0x20cc15[_0x8fa2('0x36')](_0xeb27a['table']+_0x8fa2('0x8e'),_0x1ef64c[_0x8fa2('0x8f')],_0x1ef64c[_0x8fa2('0x90')]);}if(_0x580485){logger['info'](_0x8fa2('0x91'),_0x20cc15[_0x8fa2('0x7f')]());require(_0x8fa2('0x92'))['fork'](path[_0x8fa2('0x4e')](__dirname,'../../components/export/',_0x580485[_0x8fa2('0x8b')]),[_0x580485['id'],_0x20cc15[_0x8fa2('0x7f')](),path[_0x8fa2('0x4e')](__dirname,_0x8fa2('0x93'),_0x580485[_0x8fa2('0x94')]),_0xcda0a3]);return _0x580485;}else{var _0x11798c=squel[_0x8fa2('0x69')]();_0x11798c[_0x8fa2('0x95')]('('+_0x20cc15[_0x8fa2('0x7f')]()+')',_0x8fa2('0x96'));_0x11798c[_0x8fa2('0x39')](_0x8fa2('0x97'),'count');_0x20cc15[_0x8fa2('0x1d')](_0x1ef64c[_0x8fa2('0x1d')]||_0x26b13f);_0x20cc15[_0x8fa2('0x1c')](_0x1ef64c[_0x8fa2('0x1c')]||0x0);return db[_0x8fa2('0x7e')][_0x8fa2('0x2e')](_0x11798c[_0x8fa2('0x7f')](),{'type':db['sequelize'][_0x8fa2('0x85')][_0x8fa2('0x80')]})[_0x8fa2('0x23')](function(_0x556dd9){if(!_0x556dd9[_0x8fa2('0x40')]){_0x2531d7=0x0;}else{_0x2531d7=_0x556dd9[0x0][_0x8fa2('0x1b')]||0x0;}return db['sequelize'][_0x8fa2('0x2e')](_0x20cc15[_0x8fa2('0x7f')](),{'type':db[_0x8fa2('0x7e')]['QueryTypes'][_0x8fa2('0x80')]});})[_0x8fa2('0x23')](function(_0x18c02c){return{'rows':_0x18c02c||[],'count':_0x2531d7};});}});}exports[_0x8fa2('0x98')]=function(_0x4a9840,_0xb8cd85){return runReport(_0x4a9840[_0x8fa2('0x3f')],_0x4a9840['query'],_0x4a9840[_0x8fa2('0x3a')])[_0x8fa2('0x23')](respondWithResult(_0xb8cd85,null))[_0x8fa2('0x3e')](handleError(_0xb8cd85,null));};exports[_0x8fa2('0x99')]=runReport;exports[_0x8fa2('0x2e')]=function(_0x3a1d1b,_0x388d77){var _0x31e48e=0xa;var _0x3cbe93=[_0x8fa2('0x4e'),_0x8fa2('0x4f'),_0x8fa2('0x50'),_0x8fa2('0x51')];var _0x3fb277={'SUM':_0x8fa2('0x52'),'COUNT':_0x8fa2('0x9a'),'COUNT DISTINCT':_0x8fa2('0x9b'),'MAX':'MAX(%s)','MIN':_0x8fa2('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8fa2('0x56'),'GROUP_CONCAT ASC':_0x8fa2('0x57'),'GROUP_CONCAT DESC':_0x8fa2('0x58')};var _0x35dd67={'SEC_TO_TIME':_0x8fa2('0x59'),'DATE':_0x8fa2('0x5a'),'HOUR':_0x8fa2('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8fa2('0x5d')};var _0x47df5c=function(_0x37d5e6){return!_['includes'](['IS\x20NULL',_0x8fa2('0x60'),_0x8fa2('0x61'),_0x8fa2('0x62')],_0x37d5e6);};var _0x330e5a=function(_0x16e551){if(!_0x16e551||!_0x16e551[_0x8fa2('0x63')][_0x8fa2('0x40')]){return'';}for(var _0x4864c4='(',_0x520a4d=0x0;_0x520a4d<_0x16e551[_0x8fa2('0x63')][_0x8fa2('0x40')];_0x520a4d+=0x1){_0x520a4d>0x0&&(_0x4864c4+='\x20'+_0x16e551['operator']+'\x20');_0x4864c4+=_0x16e551[_0x8fa2('0x63')][_0x520a4d]['group']?_0x330e5a(_0x16e551[_0x8fa2('0x63')][_0x520a4d][_0x8fa2('0x70')]):_0x16e551[_0x8fa2('0x63')][_0x520a4d][_0x8fa2('0x39')]+'\x20'+_0x16e551[_0x8fa2('0x63')][_0x520a4d][_0x8fa2('0x64')]+(_0x47df5c(_0x16e551[_0x8fa2('0x63')][_0x520a4d][_0x8fa2('0x64')])?'\x20'+_0x16e551[_0x8fa2('0x63')][_0x520a4d][_0x8fa2('0x65')]:'');}return _0x4864c4+')';};var _0xeda7ba={'where':{'id':_0x3a1d1b[_0x8fa2('0x3f')]['id']}},_0x1e1703,_0x2ab013,_0x166b29,_0xeab7a0,_0x153bef;_0xeda7ba=_['merge']({},_0xeda7ba,_0x3a1d1b[_0x8fa2('0x3a')]);return db[_0x8fa2('0x2a')][_0x8fa2('0x43')](_0xeda7ba)['then'](function(_0x30f467){if(_0x30f467){_0x1e1703=_0x30f467;return _0x30f467[_0x8fa2('0x66')]();}return null;})[_0x8fa2('0x23')](function(_0x32b9b6){if(_0x32b9b6){if(!_0x32b9b6[_0x8fa2('0x40')]){throw new db[(_0x8fa2('0x86'))][(_0x8fa2('0x67'))](_0x8fa2('0x68'),0x193);}_0x2ab013=_0x32b9b6;return db[_0x8fa2('0x82')][_0x8fa2('0x3c')]({'raw':!![]});}return null;})[_0x8fa2('0x23')](function(_0x26f702){if(_0x26f702){_0x166b29=_['keyBy'](_0x26f702,'id');var _0x1cf56d;var _0x30eb33=squel[_0x8fa2('0x69')]();_0x30eb33[_0x8fa2('0x95')](_0x1e1703['table']);for(var _0x6521e1=0x0;_0x6521e1<_0x2ab013[_0x8fa2('0x40')];_0x6521e1+=0x1){_0x1cf56d=_0x2ab013[_0x6521e1][_0x8fa2('0x6b')]?_0x166b29[_0x2ab013[_0x6521e1]['MetricId']][_0x8fa2('0x6c')]:_0x2ab013[_0x6521e1]['field'];_0x1cf56d=_0x2ab013[_0x6521e1][_0x8fa2('0x6d')]?_[_0x8fa2('0x6e')](_0x3fb277[_0x2ab013[_0x6521e1]['function']],'%s',_0x1cf56d):_0x1cf56d;_0x1cf56d=_0x2ab013[_0x6521e1][_0x8fa2('0x6f')]?_['replace'](_0x35dd67[_0x2ab013[_0x6521e1]['format']],'%s',_0x1cf56d):_0x1cf56d;if(_0x2ab013[_0x6521e1][_0x8fa2('0x9c')]){_0x30eb33[_0x8fa2('0x70')](_0x1cf56d);}_0x2ab013[_0x6521e1][_0x8fa2('0x71')]&&_0x30eb33[_0x8fa2('0x34')](_0x1cf56d,_0x2ab013[_0x6521e1]['orderBy']===_0x8fa2('0x84')?![]:!![]);_0x30eb33[_0x8fa2('0x39')](_0x1cf56d,_0x2ab013[_0x6521e1][_0x8fa2('0x72')]||_0x1cf56d);}if(_0x1e1703[_0x8fa2('0x73')]){_0x1e1703[_0x8fa2('0x73')]=JSON[_0x8fa2('0x74')](_0x1e1703['joins']);for(var _0x506727=0x0;_0x506727<_0x1e1703[_0x8fa2('0x73')][_0x8fa2('0x40')];_0x506727+=0x1){if(_0x1e1703[_0x8fa2('0x73')][_0x506727][_0x8fa2('0x75')]&&_[_0x8fa2('0x5e')](_0x3cbe93,_0x1e1703['joins'][_0x506727]['type'])&&_0x1e1703[_0x8fa2('0x73')][_0x506727][_0x8fa2('0x79')]&&_0x1e1703['joins'][_0x506727][_0x8fa2('0x76')]&&_0x1e1703[_0x8fa2('0x73')][_0x506727]['foreignKey']){_0x30eb33[_0x1e1703[_0x8fa2('0x73')][_0x506727][_0x8fa2('0x75')]](_0x1e1703['joins'][_0x506727][_0x8fa2('0x76')],null,util['format'](_0x8fa2('0x78'),_0x1e1703['table'],_0x1e1703[_0x8fa2('0x73')][_0x506727][_0x8fa2('0x79')],_0x1e1703['joins'][_0x506727][_0x8fa2('0x76')],_0x1e1703[_0x8fa2('0x73')][_0x506727][_0x8fa2('0x77')]));}}}if(_0x1e1703['conditions']){_0x1e1703['conditions']=JSON[_0x8fa2('0x74')](_0x1e1703['conditions']);_0x30eb33[_0x8fa2('0x36')](_0x330e5a(_0x1e1703[_0x8fa2('0x7a')][_0x8fa2('0x70')]));}_0x153bef=_0x30eb33[_0x8fa2('0x7b')]();_0x30eb33[_0x8fa2('0x1d')](_0x31e48e);_0x30eb33['offset'](0x0);logger[_0x8fa2('0x7c')](_0x8fa2('0x7d'),_0x30eb33[_0x8fa2('0x7f')]());return db[_0x8fa2('0x7e')][_0x8fa2('0x2e')](_0x30eb33['toString'](),{'type':db[_0x8fa2('0x7e')][_0x8fa2('0x85')]['SELECT']});}})[_0x8fa2('0x23')](function(){return{'sql':_0x153bef[_0x8fa2('0x7f')]()};})[_0x8fa2('0x23')](respondWithResult(_0x388d77,null))['catch'](handleError(_0x388d77,null));}; \ No newline at end of file +var _0x4fdc=['reject','save','update','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','name','send','index','AnalyticCustomReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','offset','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','catch','create','body','user','Reports','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','metric','order','alias','sequelize','SELECT','No\x20available\x20data','output','web','fullPath','randomstring','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','ROUND(%s)','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','end','json','count','limit','set','Content-Range'];(function(_0x22f75e,_0x4a9e06){var _0x1f6ab3=function(_0x1479d4){while(--_0x1479d4){_0x22f75e['push'](_0x22f75e['shift']());}};_0x1f6ab3(++_0x4a9e06);}(_0x4fdc,0x84));var _0xc4fd=function(_0x59aeec,_0x343511){_0x59aeec=_0x59aeec-0x0;var _0xf466cc=_0x4fdc[_0x59aeec];return _0xf466cc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc4fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4fd('0x1'));var jsonpatch=require(_0xc4fd('0x2'));var rp=require(_0xc4fd('0x3'));var moment=require('moment');var BPromise=require(_0xc4fd('0x4'));var Mustache=require(_0xc4fd('0x5'));var util=require(_0xc4fd('0x6'));var path=require(_0xc4fd('0x7'));var sox=require(_0xc4fd('0x8'));var csv=require(_0xc4fd('0x9'));var ejs=require(_0xc4fd('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc4fd('0xb'));var crypto=require(_0xc4fd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc4fd('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc4fd('0xe'));var authService=require(_0xc4fd('0xf'));var hardwareService=require(_0xc4fd('0x10'));var Redis=require(_0xc4fd('0x11'));var qs=require(_0xc4fd('0x12'));var logger=require(_0xc4fd('0x13'))(_0xc4fd('0x14'));var utils=require(_0xc4fd('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cf6af,_0x78ded1){_0x78ded1=_0x78ded1||0xcc;return function(_0x25fc9a){if(_0x25fc9a){return _0x2cf6af['sendStatus'](_0x78ded1);}return _0x2cf6af[_0xc4fd('0x16')](_0x78ded1)[_0xc4fd('0x17')]();};}function respondWithResult(_0x36576a,_0x963371){_0x963371=_0x963371||0xc8;return function(_0x4577a8){if(_0x4577a8){return _0x36576a[_0xc4fd('0x16')](_0x963371)[_0xc4fd('0x18')](_0x4577a8);}};}function respondWithFilteredResult(_0x4078ff,_0x4152d1){return function(_0x553121){if(_0x553121){var _0x75a44f=_0x553121[_0xc4fd('0x19')],_0x4c96e5=_0x4152d1['offset'],_0x5a248c=_0x4152d1['offset']+_0x4152d1[_0xc4fd('0x1a')],_0x41ea8a;if(_0x5a248c>=_0x75a44f){_0x5a248c=_0x75a44f;_0x41ea8a=0xc8;}else{_0x41ea8a=0xce;}_0x4078ff[_0xc4fd('0x16')](_0x41ea8a);return _0x4078ff[_0xc4fd('0x1b')](_0xc4fd('0x1c'),_0x4c96e5+'-'+_0x5a248c+'/'+_0x75a44f)[_0xc4fd('0x18')](_0x553121);}return null;};}function patchUpdates(_0x314206){return function(_0x3ee9db){try{jsonpatch['apply'](_0x3ee9db,_0x314206,!![]);}catch(_0x1e440f){return BPromise[_0xc4fd('0x1d')](_0x1e440f);}return _0x3ee9db[_0xc4fd('0x1e')]();};}function saveUpdates(_0x552b98,_0x5b8dcf){return function(_0x1a21ef){if(_0x1a21ef){return _0x1a21ef[_0xc4fd('0x1f')](_0x552b98)[_0xc4fd('0x20')](function(_0x3f6fe3){return _0x3f6fe3;});}return null;};}function removeEntity(_0xd4c72a,_0x213a32){return function(_0x5bcb6c){if(_0x5bcb6c){return _0x5bcb6c['destroy']()[_0xc4fd('0x20')](function(){var _0x3274d7=_0x5bcb6c[_0xc4fd('0x21')]({'plain':!![]});var _0x2eba79=_0xc4fd('0x22');return db[_0xc4fd('0x23')][_0xc4fd('0x24')]({'where':{'type':_0x2eba79,'resourceId':_0x3274d7['id']}})[_0xc4fd('0x20')](function(){return _0x5bcb6c;});})[_0xc4fd('0x20')](function(){_0xd4c72a['status'](0xcc)[_0xc4fd('0x17')]();});}};}function handleEntityNotFound(_0x18b1a8,_0x2ce202){return function(_0x2c8831){if(!_0x2c8831){_0x18b1a8[_0xc4fd('0x25')](0x194);}return _0x2c8831;};}function handleError(_0xb6052a,_0x331f1){_0x331f1=_0x331f1||0x1f4;return function(_0x15022d){logger[_0xc4fd('0x26')](_0x15022d['stack']);if(_0x15022d['name']){delete _0x15022d[_0xc4fd('0x27')];}_0xb6052a[_0xc4fd('0x16')](_0x331f1)[_0xc4fd('0x28')](_0x15022d);};}exports[_0xc4fd('0x29')]=function(_0x38ac21,_0x23435e){var _0x546a39={},_0x15d61b={},_0x1b65bd={'count':0x0,'rows':[]};var _0x6b5f5e=db[_0xc4fd('0x2a')][_0xc4fd('0x2b')];_0x15d61b[_0xc4fd('0x2c')]=_[_0xc4fd('0x2d')](_0x6b5f5e);_0x15d61b[_0xc4fd('0x2e')]=_['keys'](_0x38ac21['query']);_0x15d61b[_0xc4fd('0x2f')]=_[_0xc4fd('0x30')](_0x15d61b[_0xc4fd('0x2c')],_0x15d61b[_0xc4fd('0x2e')]);_0x546a39['attributes']=_[_0xc4fd('0x30')](_0x15d61b['model'],qs[_0xc4fd('0x31')](_0x38ac21[_0xc4fd('0x2e')]['fields']));_0x546a39[_0xc4fd('0x32')]=_0x546a39[_0xc4fd('0x32')][_0xc4fd('0x33')]?_0x546a39[_0xc4fd('0x32')]:_0x15d61b[_0xc4fd('0x2c')];if(!_0x38ac21[_0xc4fd('0x2e')]['hasOwnProperty'](_0xc4fd('0x34'))){_0x546a39[_0xc4fd('0x1a')]=qs[_0xc4fd('0x1a')](_0x38ac21[_0xc4fd('0x2e')][_0xc4fd('0x1a')]);_0x546a39[_0xc4fd('0x35')]=qs[_0xc4fd('0x35')](_0x38ac21['query'][_0xc4fd('0x35')]);}_0x546a39['order']=qs['sort'](_0x38ac21[_0xc4fd('0x2e')]['sort']);_0x546a39[_0xc4fd('0x36')]=qs[_0xc4fd('0x2f')](_[_0xc4fd('0x37')](_0x38ac21['query'],_0x15d61b[_0xc4fd('0x2f')]));if(_0x38ac21[_0xc4fd('0x2e')][_0xc4fd('0x38')]){_0x546a39[_0xc4fd('0x36')]=_['merge'](_0x546a39[_0xc4fd('0x36')],{'$or':_[_0xc4fd('0x39')](_0x6b5f5e,function(_0x49930){if(_0x49930[_0xc4fd('0x3a')]['key']!==_0xc4fd('0x3b')){var _0x31dd92={};_0x31dd92[_0x49930['field']]={'$like':'%'+_0x38ac21[_0xc4fd('0x2e')][_0xc4fd('0x38')]+'%'};return _0x31dd92;}})});}_0x546a39=_[_0xc4fd('0x3c')]({},_0x546a39,_0x38ac21[_0xc4fd('0x3d')]);var _0x5dfcee={'where':_0x546a39[_0xc4fd('0x36')]};return db[_0xc4fd('0x2a')]['count'](_0x5dfcee)[_0xc4fd('0x20')](function(_0x9f2741){_0x1b65bd[_0xc4fd('0x19')]=_0x9f2741;if(_0x38ac21['query'][_0xc4fd('0x3e')]){_0x546a39[_0xc4fd('0x3f')]=[{'all':!![]}];}return db[_0xc4fd('0x2a')][_0xc4fd('0x40')](_0x546a39);})['then'](function(_0x543045){_0x1b65bd[_0xc4fd('0x41')]=_0x543045;return _0x1b65bd;})[_0xc4fd('0x20')](respondWithFilteredResult(_0x23435e,_0x546a39))['catch'](handleError(_0x23435e,null));};exports[_0xc4fd('0x42')]=function(_0xf06c76,_0x27d740){var _0x26d72a={'raw':![],'where':{'id':_0xf06c76['params']['id']}},_0x14518d={};_0x14518d[_0xc4fd('0x2c')]=_['keys'](db['AnalyticCustomReport'][_0xc4fd('0x2b')]);_0x14518d[_0xc4fd('0x2e')]=_['keys'](_0xf06c76['query']);_0x14518d[_0xc4fd('0x2f')]=_[_0xc4fd('0x30')](_0x14518d[_0xc4fd('0x2c')],_0x14518d['query']);_0x26d72a['attributes']=_[_0xc4fd('0x30')](_0x14518d[_0xc4fd('0x2c')],qs[_0xc4fd('0x31')](_0xf06c76[_0xc4fd('0x2e')][_0xc4fd('0x31')]));_0x26d72a[_0xc4fd('0x32')]=_0x26d72a[_0xc4fd('0x32')][_0xc4fd('0x33')]?_0x26d72a[_0xc4fd('0x32')]:_0x14518d[_0xc4fd('0x2c')];if(_0xf06c76[_0xc4fd('0x2e')]['includeAll']){_0x26d72a[_0xc4fd('0x3f')]=[{'all':!![]}];}_0x26d72a=_[_0xc4fd('0x3c')]({},_0x26d72a,_0xf06c76[_0xc4fd('0x3d')]);return db[_0xc4fd('0x2a')]['find'](_0x26d72a)[_0xc4fd('0x20')](handleEntityNotFound(_0x27d740,null))[_0xc4fd('0x20')](respondWithResult(_0x27d740,null))[_0xc4fd('0x43')](handleError(_0x27d740,null));};exports[_0xc4fd('0x44')]=function(_0x44702d,_0x8d5518){return db[_0xc4fd('0x2a')][_0xc4fd('0x44')](_0x44702d[_0xc4fd('0x45')],{})[_0xc4fd('0x20')](function(_0x26a4d2){var _0x4c09dd=_0x44702d[_0xc4fd('0x46')][_0xc4fd('0x21')]({'plain':!![]});if(!_0x4c09dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c09dd['role']===_0xc4fd('0x46')){var _0xebdd81=_0x26a4d2[_0xc4fd('0x21')]({'plain':!![]});var _0x45474a=_0xc4fd('0x47');return db['UserProfileSection'][_0xc4fd('0x48')]({'where':{'name':_0x45474a,'userProfileId':_0x4c09dd[_0xc4fd('0x49')]},'raw':!![]})[_0xc4fd('0x20')](function(_0x3bfaac){if(_0x3bfaac&&_0x3bfaac[_0xc4fd('0x4a')]===0x0){return db[_0xc4fd('0x23')][_0xc4fd('0x44')]({'name':_0xebdd81['name'],'resourceId':_0xebdd81['id'],'type':_0xc4fd('0x22'),'sectionId':_0x3bfaac['id']},{})[_0xc4fd('0x20')](function(){return _0x26a4d2;});}else{return _0x26a4d2;}})['catch'](function(_0x498fd8){logger[_0xc4fd('0x26')](_0xc4fd('0x4b'),_0x498fd8);throw _0x498fd8;});}return _0x26a4d2;})[_0xc4fd('0x20')](respondWithResult(_0x8d5518,0xc9))[_0xc4fd('0x43')](handleError(_0x8d5518,null));};exports[_0xc4fd('0x1f')]=function(_0x3999d2,_0x4c5c90){if(_0x3999d2[_0xc4fd('0x45')]['id']){delete _0x3999d2[_0xc4fd('0x45')]['id'];}return db[_0xc4fd('0x2a')][_0xc4fd('0x48')]({'where':{'id':_0x3999d2[_0xc4fd('0x4c')]['id']}})[_0xc4fd('0x20')](handleEntityNotFound(_0x4c5c90,null))[_0xc4fd('0x20')](saveUpdates(_0x3999d2['body'],null))['then'](respondWithResult(_0x4c5c90,null))[_0xc4fd('0x43')](handleError(_0x4c5c90,null));};exports[_0xc4fd('0x24')]=function(_0x472fc6,_0x3a3f15){return db[_0xc4fd('0x2a')][_0xc4fd('0x48')]({'where':{'id':_0x472fc6[_0xc4fd('0x4c')]['id']}})[_0xc4fd('0x20')](handleEntityNotFound(_0x3a3f15,null))[_0xc4fd('0x20')](removeEntity(_0x3a3f15,null))['catch'](handleError(_0x3a3f15,null));};exports[_0xc4fd('0x4d')]=function(_0x4ad367,_0x31e52e){var _0x32e425=0xa;var _0x378198=[_0xc4fd('0x4e'),'left_join',_0xc4fd('0x4f'),'cross_join'];var _0x329749={'SUM':_0xc4fd('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc4fd('0x51'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc4fd('0x52'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc4fd('0x53')};var _0x5a76ec={'SEC_TO_TIME':_0xc4fd('0x54'),'DATE':'DATE(%s)','HOUR':_0xc4fd('0x55'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc4fd('0x56')};var _0x2a15fb=function(_0x2982e3){return!_[_0xc4fd('0x57')]([_0xc4fd('0x58'),_0xc4fd('0x59'),_0xc4fd('0x5a'),_0xc4fd('0x5b')],_0x2982e3);};var _0x581222=function(_0x1461e5){if(!_0x1461e5||!_0x1461e5[_0xc4fd('0x5c')][_0xc4fd('0x33')]){return'';}for(var _0x375ea2='(',_0x3c22cf=0x0;_0x3c22cf<_0x1461e5[_0xc4fd('0x5c')][_0xc4fd('0x33')];_0x3c22cf+=0x1){_0x3c22cf>0x0&&(_0x375ea2+='\x20'+_0x1461e5[_0xc4fd('0x5d')]+'\x20');_0x375ea2+=_0x1461e5['rules'][_0x3c22cf][_0xc4fd('0x5e')]?_0x581222(_0x1461e5['rules'][_0x3c22cf][_0xc4fd('0x5e')]):_0x1461e5[_0xc4fd('0x5c')][_0x3c22cf][_0xc4fd('0x5f')]+'\x20'+_0x1461e5[_0xc4fd('0x5c')][_0x3c22cf][_0xc4fd('0x60')]+(_0x2a15fb(_0x1461e5[_0xc4fd('0x5c')][_0x3c22cf][_0xc4fd('0x60')])?'\x20'+_0x1461e5[_0xc4fd('0x5c')][_0x3c22cf][_0xc4fd('0x61')]:'');}return _0x375ea2+')';};var _0x48db8b={'where':{'id':_0x4ad367[_0xc4fd('0x4c')]['id']}},_0x43d21c,_0x29306f,_0x4a168d,_0x8c9715,_0x342f8c;_0x48db8b=_['merge']({},_0x48db8b,_0x4ad367['options']);return db[_0xc4fd('0x2a')][_0xc4fd('0x48')](_0x48db8b)[_0xc4fd('0x20')](function(_0x1e94cc){if(_0x1e94cc){_0x43d21c=_0x1e94cc;return _0x1e94cc['getFields']();}return null;})[_0xc4fd('0x20')](function(_0x18819c){if(_0x18819c){if(!_0x18819c[_0xc4fd('0x33')]){throw new db[(_0xc4fd('0x62'))][(_0xc4fd('0x63'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x29306f=_0x18819c;return db[_0xc4fd('0x64')][_0xc4fd('0x40')]({'raw':!![]});}return null;})[_0xc4fd('0x20')](function(_0x27500e){if(_0x27500e){_0x4a168d=_[_0xc4fd('0x65')](_0x27500e,'id');var _0x332698;var _0x39e25d=squel[_0xc4fd('0x66')]();_0x39e25d[_0xc4fd('0x67')](_0x43d21c['table']);for(var _0x4afcaf=0x0;_0x4afcaf<_0x29306f[_0xc4fd('0x33')];_0x4afcaf+=0x1){_0x332698=_0x29306f[_0x4afcaf][_0xc4fd('0x68')]?_0x4a168d[_0x29306f[_0x4afcaf][_0xc4fd('0x68')]]['metric']:_0x29306f[_0x4afcaf][_0xc4fd('0x5f')];_0x332698=_0x29306f[_0x4afcaf][_0xc4fd('0x69')]?_[_0xc4fd('0x6a')](_0x329749[_0x29306f[_0x4afcaf][_0xc4fd('0x69')]],'%s',_0x332698):_0x332698;_0x332698=_0x29306f[_0x4afcaf][_0xc4fd('0x6b')]?_['replace'](_0x5a76ec[_0x29306f[_0x4afcaf]['format']],'%s',_0x332698):_0x332698;if(_0x29306f[_0x4afcaf][_0xc4fd('0x6c')]){_0x39e25d[_0xc4fd('0x5e')](_0x332698);}_0x29306f[_0x4afcaf]['orderBy']&&_0x39e25d['order'](_0x332698,_0x29306f[_0x4afcaf][_0xc4fd('0x6d')]===_0xc4fd('0x6e')?![]:!![]);_0x39e25d[_0xc4fd('0x5f')](_0x332698,_0x29306f[_0x4afcaf]['alias']||_0x332698);}if(_0x43d21c[_0xc4fd('0x6f')]){_0x43d21c[_0xc4fd('0x6f')]=JSON[_0xc4fd('0x70')](_0x43d21c[_0xc4fd('0x6f')]);for(var _0x2c6be7=0x0;_0x2c6be7<_0x43d21c['joins'][_0xc4fd('0x33')];_0x2c6be7+=0x1){if(_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7][_0xc4fd('0x3a')]&&_[_0xc4fd('0x57')](_0x378198,_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7][_0xc4fd('0x3a')])&&_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7][_0xc4fd('0x71')]&&_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7][_0xc4fd('0x72')]&&_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7][_0xc4fd('0x73')]){_0x39e25d[_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7][_0xc4fd('0x3a')]](_0x43d21c['joins'][_0x2c6be7]['foreignTable'],null,util[_0xc4fd('0x6b')](_0xc4fd('0x74'),_0x43d21c['table'],_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7][_0xc4fd('0x71')],_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7]['foreignTable'],_0x43d21c[_0xc4fd('0x6f')][_0x2c6be7][_0xc4fd('0x73')]));}}}if(_0x43d21c[_0xc4fd('0x75')]){_0x43d21c[_0xc4fd('0x75')]=JSON[_0xc4fd('0x70')](_0x43d21c[_0xc4fd('0x75')]);_0x39e25d[_0xc4fd('0x36')](_0x581222(_0x43d21c['conditions'][_0xc4fd('0x5e')]));}_0x342f8c=_0x39e25d[_0xc4fd('0x76')]();_0x39e25d[_0xc4fd('0x1a')](_0x32e425);_0x39e25d[_0xc4fd('0x35')](0x0);logger[_0xc4fd('0x77')](_0xc4fd('0x78'),_0x39e25d[_0xc4fd('0x79')]());return db['sequelize'][_0xc4fd('0x2e')](_0x39e25d[_0xc4fd('0x79')](),{'type':db['sequelize'][_0xc4fd('0x7a')]['SELECT']});}})['then'](respondWithResult(_0x31e52e,null))[_0xc4fd('0x43')](handleError(_0x31e52e,null));};function runReport(_0x4c9132,_0x31f41e,_0x9bdee4){var _0x378038=_0x31f41e[_0xc4fd('0x27')];var _0x4352e6=0xa;var _0x8f4e9a=['join',_0xc4fd('0x7b'),_0xc4fd('0x4f'),_0xc4fd('0x7c')];var _0x281c1c={'SUM':_0xc4fd('0x50'),'COUNT':_0xc4fd('0x7d'),'COUNT DISTINCT':_0xc4fd('0x7e'),'MAX':'MAX(%s)','MIN':_0xc4fd('0x7f'),'AVG':_0xc4fd('0x80'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc4fd('0x81'),'GROUP_CONCAT DESC':_0xc4fd('0x53')};var _0x22e8e5={'SEC_TO_TIME':_0xc4fd('0x54'),'DATE':_0xc4fd('0x82'),'HOUR':_0xc4fd('0x55'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc4fd('0x56')};var _0x2595b2=function(_0x2c0739){return!_[_0xc4fd('0x57')]([_0xc4fd('0x58'),_0xc4fd('0x59'),_0xc4fd('0x5a'),'IS\x20NOT\x20EMPTY'],_0x2c0739);};var _0x143f67=function(_0x190d8a){if(!_0x190d8a||!_0x190d8a[_0xc4fd('0x5c')][_0xc4fd('0x33')]){return'';}for(var _0x4841d3='(',_0x36470d=0x0;_0x36470d<_0x190d8a[_0xc4fd('0x5c')][_0xc4fd('0x33')];_0x36470d+=0x1){_0x36470d>0x0&&(_0x4841d3+='\x20'+_0x190d8a[_0xc4fd('0x5d')]+'\x20');_0x4841d3+=_0x190d8a[_0xc4fd('0x5c')][_0x36470d][_0xc4fd('0x5e')]?_0x143f67(_0x190d8a[_0xc4fd('0x5c')][_0x36470d][_0xc4fd('0x5e')]):_0x190d8a['rules'][_0x36470d][_0xc4fd('0x5f')]+'\x20'+_0x190d8a['rules'][_0x36470d]['condition']+(_0x2595b2(_0x190d8a[_0xc4fd('0x5c')][_0x36470d][_0xc4fd('0x60')])?'\x20'+_0x190d8a['rules'][_0x36470d][_0xc4fd('0x61')]:'');}return _0x4841d3+')';};var _0x2bd88f={'where':{'id':_0x4c9132['id']}},_0x3ca4fc,_0x324b2b,_0x95cd9,_0x4e0878,_0xd3d6a4;_0x2bd88f=_[_0xc4fd('0x3c')]({},_0x2bd88f,_0x9bdee4);return db[_0xc4fd('0x2a')][_0xc4fd('0x48')](_0x2bd88f)[_0xc4fd('0x20')](function(_0x4e236b){if(_0x4e236b){_0x3ca4fc=_0x4e236b;return _0x4e236b[_0xc4fd('0x83')]();}return null;})['then'](function(_0x15b058){if(_0x15b058){if(!_0x15b058['length']){throw new db[(_0xc4fd('0x62'))][(_0xc4fd('0x63'))](_0xc4fd('0x84'),0x193);}_0x324b2b=_0x15b058;return db['AnalyticMetric'][_0xc4fd('0x40')]({'raw':!![]});}return null;})['then'](function(_0x49ece3){if(_0x49ece3){_0x95cd9=_[_0xc4fd('0x65')](_0x49ece3,'id');var _0x3de138;var _0x3b4959=squel[_0xc4fd('0x66')]();_0x3b4959[_0xc4fd('0x67')](_0x3ca4fc[_0xc4fd('0x85')]);for(var _0x1c2510=0x0;_0x1c2510<_0x324b2b['length'];_0x1c2510+=0x1){_0x3de138=_0x324b2b[_0x1c2510]['MetricId']?_0x95cd9[_0x324b2b[_0x1c2510]['MetricId']][_0xc4fd('0x86')]:_0x324b2b[_0x1c2510]['field'];_0x3de138=_0x324b2b[_0x1c2510][_0xc4fd('0x69')]?_[_0xc4fd('0x6a')](_0x281c1c[_0x324b2b[_0x1c2510]['function']],'%s',_0x3de138):_0x3de138;_0x3de138=_0x324b2b[_0x1c2510][_0xc4fd('0x6b')]?_[_0xc4fd('0x6a')](_0x22e8e5[_0x324b2b[_0x1c2510]['format']],'%s',_0x3de138):_0x3de138;if(_0x324b2b[_0x1c2510][_0xc4fd('0x6c')]){_0x3b4959[_0xc4fd('0x5e')](_0x3de138);}_0x324b2b[_0x1c2510][_0xc4fd('0x6d')]&&_0x3b4959[_0xc4fd('0x87')](_0x3de138,_0x324b2b[_0x1c2510]['orderBy']===_0xc4fd('0x6e')?![]:!![]);_0x3b4959['field'](_0x3de138,_0x324b2b[_0x1c2510][_0xc4fd('0x88')]||_0x3de138);}if(_0x3ca4fc[_0xc4fd('0x6f')]){_0x3ca4fc['joins']=JSON[_0xc4fd('0x70')](_0x3ca4fc['joins']);for(var _0x3b450e=0x0;_0x3b450e<_0x3ca4fc[_0xc4fd('0x6f')][_0xc4fd('0x33')];_0x3b450e+=0x1){if(_0x3ca4fc['joins'][_0x3b450e][_0xc4fd('0x3a')]&&_[_0xc4fd('0x57')](_0x8f4e9a,_0x3ca4fc[_0xc4fd('0x6f')][_0x3b450e][_0xc4fd('0x3a')])&&_0x3ca4fc['joins'][_0x3b450e][_0xc4fd('0x71')]&&_0x3ca4fc[_0xc4fd('0x6f')][_0x3b450e][_0xc4fd('0x72')]&&_0x3ca4fc[_0xc4fd('0x6f')][_0x3b450e][_0xc4fd('0x73')]){_0x3b4959[_0x3ca4fc[_0xc4fd('0x6f')][_0x3b450e][_0xc4fd('0x3a')]](_0x3ca4fc['joins'][_0x3b450e][_0xc4fd('0x72')],null,util['format'](_0xc4fd('0x74'),_0x3ca4fc[_0xc4fd('0x85')],_0x3ca4fc[_0xc4fd('0x6f')][_0x3b450e][_0xc4fd('0x71')],_0x3ca4fc[_0xc4fd('0x6f')][_0x3b450e]['foreignTable'],_0x3ca4fc[_0xc4fd('0x6f')][_0x3b450e]['foreignKey']));}}}if(_0x3ca4fc['conditions']){_0x3ca4fc['conditions']=JSON[_0xc4fd('0x70')](_0x3ca4fc[_0xc4fd('0x75')]);_0x3b4959[_0xc4fd('0x36')](_0x143f67(_0x3ca4fc[_0xc4fd('0x75')]['group']));}_0xd3d6a4=_0x3b4959[_0xc4fd('0x76')]();_0x3b4959[_0xc4fd('0x1a')](_0x4352e6);_0x3b4959[_0xc4fd('0x35')](0x0);logger[_0xc4fd('0x77')](_0xc4fd('0x78'),_0x3b4959[_0xc4fd('0x79')]());return db[_0xc4fd('0x89')][_0xc4fd('0x2e')](_0x3b4959['toString'](),{'type':db['sequelize']['QueryTypes'][_0xc4fd('0x8a')]});}})[_0xc4fd('0x20')](function(_0x2e0972){if(!_0x2e0972[_0xc4fd('0x33')]){throw new db[(_0xc4fd('0x62'))]['ValidationErrorItem'](_0xc4fd('0x8b'),0xcc);}if(_0x31f41e[_0xc4fd('0x8c')]===_0xc4fd('0x8d')){return null;}var _0x13e21d=_[_0xc4fd('0x3c')](_0x31f41e,{'name':_0x31f41e[_0xc4fd('0x8e')]||_0x31f41e['name']||_0x3ca4fc[_0xc4fd('0x27')],'basename':_0x378038,'savename':util[_0xc4fd('0x6b')]('%s-%s.%s',_0x31f41e['name']||_0x3ca4fc[_0xc4fd('0x27')],require(_0xc4fd('0x8f'))['generate'](0x4),_0x31f41e[_0xc4fd('0x8c')]||_0xc4fd('0x90')),'reportId':_0x3ca4fc['id'],'reportType':_0xc4fd('0x91')});return db['AnalyticExtractedReport'][_0xc4fd('0x44')](_0x13e21d,{'raw':!![]});})[_0xc4fd('0x20')](function(_0x3dc0a2){if(_0x3ca4fc[_0xc4fd('0x85')]==='cdr'){_0xd3d6a4['where'](_0x3ca4fc[_0xc4fd('0x85')]+_0xc4fd('0x92'),_0x31f41e['startDate'],_0x31f41e[_0xc4fd('0x93')]);}else{_0xd3d6a4[_0xc4fd('0x36')](_0x3ca4fc['table']+_0xc4fd('0x94'),_0x31f41e[_0xc4fd('0x95')],_0x31f41e[_0xc4fd('0x93')]);}if(_0x3dc0a2){logger[_0xc4fd('0x96')](_0xc4fd('0x97'),_0xd3d6a4['toString']());require('child_process')[_0xc4fd('0x98')](path[_0xc4fd('0x4e')](__dirname,_0xc4fd('0x99'),_0x3dc0a2['output']),[_0x3dc0a2['id'],_0xd3d6a4['toString'](),path[_0xc4fd('0x4e')](__dirname,_0xc4fd('0x9a'),_0x3dc0a2[_0xc4fd('0x9b')]),_0x378038]);return _0x3dc0a2;}else{var _0x2e954f=squel[_0xc4fd('0x66')]();_0x2e954f['from']('('+_0xd3d6a4[_0xc4fd('0x79')]()+')',_0xc4fd('0x9c'));_0x2e954f['field'](_0xc4fd('0x9d'),_0xc4fd('0x19'));_0xd3d6a4[_0xc4fd('0x1a')](_0x31f41e[_0xc4fd('0x1a')]||_0x4352e6);_0xd3d6a4[_0xc4fd('0x35')](_0x31f41e[_0xc4fd('0x35')]||0x0);return db[_0xc4fd('0x89')][_0xc4fd('0x2e')](_0x2e954f['toString'](),{'type':db[_0xc4fd('0x89')][_0xc4fd('0x7a')][_0xc4fd('0x8a')]})[_0xc4fd('0x20')](function(_0x18001b){if(!_0x18001b[_0xc4fd('0x33')]){_0x4e0878=0x0;}else{_0x4e0878=_0x18001b[0x0][_0xc4fd('0x19')]||0x0;}return db['sequelize'][_0xc4fd('0x2e')](_0xd3d6a4['toString'](),{'type':db[_0xc4fd('0x89')][_0xc4fd('0x7a')][_0xc4fd('0x8a')]});})[_0xc4fd('0x20')](function(_0x473ee6){return{'rows':_0x473ee6||[],'count':_0x4e0878};});}});}exports[_0xc4fd('0x9e')]=function(_0x5b97f2,_0x2fdf03){return runReport(_0x5b97f2[_0xc4fd('0x4c')],_0x5b97f2[_0xc4fd('0x2e')],_0x5b97f2[_0xc4fd('0x3d')])[_0xc4fd('0x20')](respondWithResult(_0x2fdf03,null))[_0xc4fd('0x43')](handleError(_0x2fdf03,null));};exports[_0xc4fd('0x9f')]=runReport;exports[_0xc4fd('0x2e')]=function(_0xf1a127,_0x1d0cf2){var _0x36af57=0xa;var _0x2884c8=['join',_0xc4fd('0x7b'),_0xc4fd('0x4f'),_0xc4fd('0x7c')];var _0x436aa5={'SUM':_0xc4fd('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc4fd('0x51'),'MIN':_0xc4fd('0x7f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc4fd('0x81'),'GROUP_CONCAT DESC':_0xc4fd('0x53')};var _0x318318={'SEC_TO_TIME':_0xc4fd('0x54'),'DATE':_0xc4fd('0x82'),'HOUR':_0xc4fd('0x55'),'ROUND':_0xc4fd('0xa0'),'UNIX_TIMESTAMP':_0xc4fd('0x56')};var _0x59e361=function(_0x5c6b89){return!_[_0xc4fd('0x57')]([_0xc4fd('0x58'),_0xc4fd('0x59'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x5c6b89);};var _0x26f8b0=function(_0x11dcbb){if(!_0x11dcbb||!_0x11dcbb[_0xc4fd('0x5c')]['length']){return'';}for(var _0x19b97f='(',_0x2a657d=0x0;_0x2a657d<_0x11dcbb[_0xc4fd('0x5c')][_0xc4fd('0x33')];_0x2a657d+=0x1){_0x2a657d>0x0&&(_0x19b97f+='\x20'+_0x11dcbb[_0xc4fd('0x5d')]+'\x20');_0x19b97f+=_0x11dcbb[_0xc4fd('0x5c')][_0x2a657d][_0xc4fd('0x5e')]?_0x26f8b0(_0x11dcbb[_0xc4fd('0x5c')][_0x2a657d][_0xc4fd('0x5e')]):_0x11dcbb[_0xc4fd('0x5c')][_0x2a657d]['field']+'\x20'+_0x11dcbb[_0xc4fd('0x5c')][_0x2a657d]['condition']+(_0x59e361(_0x11dcbb['rules'][_0x2a657d]['condition'])?'\x20'+_0x11dcbb[_0xc4fd('0x5c')][_0x2a657d][_0xc4fd('0x61')]:'');}return _0x19b97f+')';};var _0xe609cc={'where':{'id':_0xf1a127['params']['id']}},_0x45db1f,_0x274064,_0x5b05f1,_0x391fbd,_0x449e42;_0xe609cc=_[_0xc4fd('0x3c')]({},_0xe609cc,_0xf1a127[_0xc4fd('0x3d')]);return db[_0xc4fd('0x2a')][_0xc4fd('0x48')](_0xe609cc)[_0xc4fd('0x20')](function(_0x6ffa13){if(_0x6ffa13){_0x45db1f=_0x6ffa13;return _0x6ffa13['getFields']();}return null;})[_0xc4fd('0x20')](function(_0x275833){if(_0x275833){if(!_0x275833[_0xc4fd('0x33')]){throw new db[(_0xc4fd('0x62'))][(_0xc4fd('0x63'))](_0xc4fd('0x84'),0x193);}_0x274064=_0x275833;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xc4fd('0x20')](function(_0x2a0c79){if(_0x2a0c79){_0x5b05f1=_[_0xc4fd('0x65')](_0x2a0c79,'id');var _0x3dd7ab;var _0x58de59=squel[_0xc4fd('0x66')]();_0x58de59[_0xc4fd('0x67')](_0x45db1f['table']);for(var _0x316bd4=0x0;_0x316bd4<_0x274064[_0xc4fd('0x33')];_0x316bd4+=0x1){_0x3dd7ab=_0x274064[_0x316bd4]['MetricId']?_0x5b05f1[_0x274064[_0x316bd4][_0xc4fd('0x68')]][_0xc4fd('0x86')]:_0x274064[_0x316bd4][_0xc4fd('0x5f')];_0x3dd7ab=_0x274064[_0x316bd4][_0xc4fd('0x69')]?_[_0xc4fd('0x6a')](_0x436aa5[_0x274064[_0x316bd4][_0xc4fd('0x69')]],'%s',_0x3dd7ab):_0x3dd7ab;_0x3dd7ab=_0x274064[_0x316bd4][_0xc4fd('0x6b')]?_[_0xc4fd('0x6a')](_0x318318[_0x274064[_0x316bd4][_0xc4fd('0x6b')]],'%s',_0x3dd7ab):_0x3dd7ab;if(_0x274064[_0x316bd4][_0xc4fd('0x6c')]){_0x58de59[_0xc4fd('0x5e')](_0x3dd7ab);}_0x274064[_0x316bd4]['orderBy']&&_0x58de59[_0xc4fd('0x87')](_0x3dd7ab,_0x274064[_0x316bd4][_0xc4fd('0x6d')]===_0xc4fd('0x6e')?![]:!![]);_0x58de59[_0xc4fd('0x5f')](_0x3dd7ab,_0x274064[_0x316bd4][_0xc4fd('0x88')]||_0x3dd7ab);}if(_0x45db1f[_0xc4fd('0x6f')]){_0x45db1f[_0xc4fd('0x6f')]=JSON[_0xc4fd('0x70')](_0x45db1f[_0xc4fd('0x6f')]);for(var _0x35c8bf=0x0;_0x35c8bf<_0x45db1f['joins'][_0xc4fd('0x33')];_0x35c8bf+=0x1){if(_0x45db1f[_0xc4fd('0x6f')][_0x35c8bf][_0xc4fd('0x3a')]&&_[_0xc4fd('0x57')](_0x2884c8,_0x45db1f['joins'][_0x35c8bf][_0xc4fd('0x3a')])&&_0x45db1f[_0xc4fd('0x6f')][_0x35c8bf]['parentKey']&&_0x45db1f[_0xc4fd('0x6f')][_0x35c8bf][_0xc4fd('0x72')]&&_0x45db1f[_0xc4fd('0x6f')][_0x35c8bf][_0xc4fd('0x73')]){_0x58de59[_0x45db1f['joins'][_0x35c8bf]['type']](_0x45db1f[_0xc4fd('0x6f')][_0x35c8bf][_0xc4fd('0x72')],null,util[_0xc4fd('0x6b')]('%s.%s\x20=\x20%s.%s',_0x45db1f[_0xc4fd('0x85')],_0x45db1f['joins'][_0x35c8bf]['parentKey'],_0x45db1f[_0xc4fd('0x6f')][_0x35c8bf][_0xc4fd('0x72')],_0x45db1f[_0xc4fd('0x6f')][_0x35c8bf]['foreignKey']));}}}if(_0x45db1f[_0xc4fd('0x75')]){_0x45db1f['conditions']=JSON[_0xc4fd('0x70')](_0x45db1f[_0xc4fd('0x75')]);_0x58de59[_0xc4fd('0x36')](_0x26f8b0(_0x45db1f[_0xc4fd('0x75')][_0xc4fd('0x5e')]));}_0x449e42=_0x58de59['clone']();_0x58de59[_0xc4fd('0x1a')](_0x36af57);_0x58de59[_0xc4fd('0x35')](0x0);logger['debug'](_0xc4fd('0x78'),_0x58de59[_0xc4fd('0x79')]());return db[_0xc4fd('0x89')][_0xc4fd('0x2e')](_0x58de59[_0xc4fd('0x79')](),{'type':db[_0xc4fd('0x89')]['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x449e42[_0xc4fd('0x79')]()};})['then'](respondWithResult(_0x1d0cf2,null))['catch'](handleError(_0x1d0cf2,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index f18a911..683521f 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 _0x932d=['request-promise','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','../../config/logger','moment','bluebird'];(function(_0xa6cacd,_0x26a294){var _0x540610=function(_0x5ab7a5){while(--_0x5ab7a5){_0xa6cacd['push'](_0xa6cacd['shift']());}};_0x540610(++_0x26a294);}(_0x932d,0x113));var _0xd932=function(_0x57790a,_0x2a94f8){_0x57790a=_0x57790a-0x0;var _0x5d3223=_0x932d[_0x57790a];return _0x5d3223;};'use strict';var _=require(_0xd932('0x0'));var util=require('util');var logger=require(_0xd932('0x1'))('api');var moment=require(_0xd932('0x2'));var BPromise=require(_0xd932('0x3'));var rp=require(_0xd932('0x4'));var attributes=require(_0xd932('0x5'));module[_0xd932('0x6')]=function(_0x319a02,_0x1e1f11){return _0x319a02[_0xd932('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0xd932('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedca=['./analyticCustomReport.attributes','exports','define','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xedca,0xd6));var _0xaedc=function(_0xb31841,_0x2bdb69){_0xb31841=_0xb31841-0x0;var _0x34daec=_0xedca[_0xb31841];return _0x34daec;};'use strict';var _=require('lodash');var util=require(_0xaedc('0x0'));var logger=require(_0xaedc('0x1'))(_0xaedc('0x2'));var moment=require(_0xaedc('0x3'));var BPromise=require(_0xaedc('0x4'));var rp=require(_0xaedc('0x5'));var attributes=require(_0xaedc('0x6'));module[_0xaedc('0x7')]=function(_0x2fc9a6,_0x3d88e8){return _0x2fc9a6[_0xaedc('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xaedc('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 66cf43e..7411c61 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 _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\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(_0x2bff68,_0x35f8f8){var _0x506c42=function(_0xa685b5){while(--_0xa685b5){_0x2bff68['push'](_0x2bff68['shift']());}};_0x506c42(++_0x35f8f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 _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(_0x3f0f46,_0x31852d){var _0x2e524c=function(_0x260f6a){while(--_0x260f6a){_0x3f0f46['push'](_0x3f0f46['shift']());}};_0x2e524c(++_0x31852d);}(_0xb10b,0x12a));var _0xbb10=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0xb10b[_0x237f8b];return _0x423f94;};'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 diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index ea0008c..60fb61c 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 _0x28f2=['update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put'];(function(_0x1afaec,_0x47ab02){var _0x2260b7=function(_0x169075){while(--_0x169075){_0x1afaec['push'](_0x1afaec['shift']());}};_0x2260b7(++_0x47ab02);}(_0x28f2,0x193));var _0x228f=function(_0x2d0375,_0x4016c7){_0x2d0375=_0x2d0375-0x0;var _0x15027e=_0x28f2[_0x2d0375];return _0x15027e;};'use strict';var multer=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var path=require(_0x228f('0x2'));var timeout=require(_0x228f('0x3'));var express=require(_0x228f('0x4'));var router=express['Router']();var auth=require(_0x228f('0x5'));var interaction=require(_0x228f('0x6'));var config=require(_0x228f('0x7'));var controller=require(_0x228f('0x8'));router[_0x228f('0x9')]('/',auth[_0x228f('0xa')](),controller[_0x228f('0xb')]);router['get'](_0x228f('0xc'),auth['isAuthenticated'](),controller[_0x228f('0xd')]);router[_0x228f('0x9')](_0x228f('0xe'),auth['isAuthenticated'](),controller[_0x228f('0xf')]);router['get'](_0x228f('0x10'),auth[_0x228f('0xa')](),controller['run']);router[_0x228f('0x9')](_0x228f('0x11'),auth[_0x228f('0xa')](),controller[_0x228f('0x12')]);router[_0x228f('0x13')]('/',auth['isAuthenticated'](),controller[_0x228f('0x14')]);router[_0x228f('0x15')](_0x228f('0xc'),auth[_0x228f('0xa')](),controller[_0x228f('0x16')]);router[_0x228f('0x17')](_0x228f('0xc'),auth[_0x228f('0xa')](),controller['destroy']);module[_0x228f('0x18')]=router; \ No newline at end of file +var _0x1c7c=['Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x454a29,_0x503ee4){var _0x5ea139=function(_0x382aa9){while(--_0x382aa9){_0x454a29['push'](_0x454a29['shift']());}};_0x5ea139(++_0x503ee4);}(_0x1c7c,0x164));var _0xc1c7=function(_0x42d488,_0x3033b7){_0x42d488=_0x42d488-0x0;var _0x5ee45b=_0x1c7c[_0x42d488];return _0x5ee45b;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1c7('0x5'));var config=require(_0xc1c7('0x6'));var controller=require(_0xc1c7('0x7'));router[_0xc1c7('0x8')]('/',auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xa')]);router[_0xc1c7('0x8')](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xc')]);router[_0xc1c7('0x8')](_0xc1c7('0xd'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xe')]);router[_0xc1c7('0x8')](_0xc1c7('0xf'),auth[_0xc1c7('0x9')](),controller['run']);router[_0xc1c7('0x8')](_0xc1c7('0x10'),auth['isAuthenticated'](),controller[_0xc1c7('0x11')]);router[_0xc1c7('0x12')]('/',auth[_0xc1c7('0x9')](),controller['create']);router[_0xc1c7('0x13')](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0x14')]);router[_0xc1c7('0x15')](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0x16')]);module[_0xc1c7('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 6371f3c..9c1e9c1 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 _0x151e=['TEXT','sequelize','STRING'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x151e,0x16c));var _0xe151=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0x151e[_0x330414];return _0x99dbff;};'use strict';var Sequelize=require(_0xe151('0x0'));module['exports']={'name':{'type':Sequelize[_0xe151('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe151('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xe151('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xe151('0x2')]}}; \ No newline at end of file +var _0x3a43=['sequelize','exports','STRING','TEXT'];(function(_0x390146,_0x3ecc58){var _0x54e331=function(_0x2677b6){while(--_0x2677b6){_0x390146['push'](_0x390146['shift']());}};_0x54e331(++_0x3ecc58);}(_0x3a43,0x1c8));var _0x33a4=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0x3a43[_0x1aed80];return _0x43961e;};'use strict';var Sequelize=require(_0x33a4('0x0'));module[_0x33a4('0x1')]={'name':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x33a4('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x33a4('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index ec4e46b..693d897 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 _0x52d0=['sequelize','SELECT','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','Sequelize','keyBy','orderBy','QueryTypes','No\x20available\x20data','output','%s-%s.%s','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','groupBy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','DefaultReports','destroy','error','stack','name','send','index','rawAttributes','model','keys','filters','intersection','fields','query','attributes','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','AnalyticDefaultReport','includeAll','findAll','catch','show','params','length','include','merge','options','find','create','body','user','get','role','Reports','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','order','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0x52d0,0xc2));var _0x052d=function(_0x38b71f,_0x3d0fc6){_0x38b71f=_0x38b71f-0x0;var _0xde7e35=_0x52d0[_0x38b71f];return _0xde7e35;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x052d('0x0'));var rimraf=require(_0x052d('0x1'));var zipdir=require(_0x052d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x052d('0x3'));var moment=require(_0x052d('0x4'));var BPromise=require(_0x052d('0x5'));var Mustache=require(_0x052d('0x6'));var util=require(_0x052d('0x7'));var path=require('path');var sox=require(_0x052d('0x8'));var csv=require(_0x052d('0x9'));var ejs=require(_0x052d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x052d('0xb'));var crypto=require(_0x052d('0xc'));var jsforce=require(_0x052d('0xd'));var deskjs=require(_0x052d('0xe'));var toCsv=require(_0x052d('0x9'));var querystring=require('querystring');var Papa=require(_0x052d('0xf'));var authService=require(_0x052d('0x10'));var hardwareService=require(_0x052d('0x11'));var Redis=require(_0x052d('0x12'));var qs=require(_0x052d('0x13'));var logger=require(_0x052d('0x14'))(_0x052d('0x15'));var utils=require(_0x052d('0x16'));var config=require(_0x052d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d530e,_0x1a179e){_0x1a179e=_0x1a179e||0xcc;return function(_0x1b6657){if(_0x1b6657){return _0x5d530e[_0x052d('0x18')](_0x1a179e);}return _0x5d530e['status'](_0x1a179e)[_0x052d('0x19')]();};}function respondWithResult(_0x3ff077,_0x1bef52){_0x1bef52=_0x1bef52||0xc8;return function(_0x19e65a){if(_0x19e65a){return _0x3ff077[_0x052d('0x1a')](_0x1bef52)[_0x052d('0x1b')](_0x19e65a);}};}function respondWithFilteredResult(_0x4f5acb,_0x4248dc){return function(_0x3171b9){if(_0x3171b9){var _0x2d80f6=_0x3171b9[_0x052d('0x1c')],_0x560848=_0x4248dc[_0x052d('0x1d')],_0x32390d=_0x4248dc['offset']+_0x4248dc[_0x052d('0x1e')],_0x973a93;if(_0x32390d>=_0x2d80f6){_0x32390d=_0x2d80f6;_0x973a93=0xc8;}else{_0x973a93=0xce;}_0x4f5acb[_0x052d('0x1a')](_0x973a93);return _0x4f5acb[_0x052d('0x1f')](_0x052d('0x20'),_0x560848+'-'+_0x32390d+'/'+_0x2d80f6)[_0x052d('0x1b')](_0x3171b9);}return null;};}function patchUpdates(_0x397ec1){return function(_0x325ef6){try{jsonpatch[_0x052d('0x21')](_0x325ef6,_0x397ec1,!![]);}catch(_0x50e4fe){return BPromise[_0x052d('0x22')](_0x50e4fe);}return _0x325ef6[_0x052d('0x23')]();};}function saveUpdates(_0x3be92f,_0x577caf){return function(_0x148d71){if(_0x148d71){return _0x148d71[_0x052d('0x24')](_0x3be92f)[_0x052d('0x25')](function(_0xd082f0){return _0xd082f0;});}return null;};}function removeEntity(_0x2cbf97,_0x2e5cc2){return function(_0x2042bd){if(_0x2042bd){return _0x2042bd['destroy']()[_0x052d('0x25')](function(){var _0x4407ec=_0x2042bd['get']({'plain':!![]});var _0xa26be2=_0x052d('0x26');return db['UserProfileResource'][_0x052d('0x27')]({'where':{'type':_0xa26be2,'resourceId':_0x4407ec['id']}})[_0x052d('0x25')](function(){return _0x2042bd;});})[_0x052d('0x25')](function(){_0x2cbf97[_0x052d('0x1a')](0xcc)[_0x052d('0x19')]();});}};}function handleEntityNotFound(_0x579da3,_0x3d5db4){return function(_0x5f4221){if(!_0x5f4221){_0x579da3[_0x052d('0x18')](0x194);}return _0x5f4221;};}function handleError(_0x1c618c,_0x4b364d){_0x4b364d=_0x4b364d||0x1f4;return function(_0x3c2e4f){logger[_0x052d('0x28')](_0x3c2e4f[_0x052d('0x29')]);if(_0x3c2e4f[_0x052d('0x2a')]){delete _0x3c2e4f[_0x052d('0x2a')];}_0x1c618c[_0x052d('0x1a')](_0x4b364d)[_0x052d('0x2b')](_0x3c2e4f);};}exports[_0x052d('0x2c')]=function(_0x3d48bb,_0x30dcd5){var _0x312448={},_0x4b4b25={},_0x2a3837={'count':0x0,'rows':[]};var _0x38b099=db['AnalyticDefaultReport'][_0x052d('0x2d')];_0x4b4b25[_0x052d('0x2e')]=_[_0x052d('0x2f')](_0x38b099);_0x4b4b25['query']=_[_0x052d('0x2f')](_0x3d48bb['query']);_0x4b4b25[_0x052d('0x30')]=_['intersection'](_0x4b4b25['model'],_0x4b4b25['query']);_0x312448['attributes']=_[_0x052d('0x31')](_0x4b4b25[_0x052d('0x2e')],qs[_0x052d('0x32')](_0x3d48bb[_0x052d('0x33')]['fields']));_0x312448[_0x052d('0x34')]=_0x312448[_0x052d('0x34')]['length']?_0x312448[_0x052d('0x34')]:_0x4b4b25[_0x052d('0x2e')];if(!_0x3d48bb[_0x052d('0x33')]['hasOwnProperty'](_0x052d('0x35'))){_0x312448[_0x052d('0x1e')]=qs[_0x052d('0x1e')](_0x3d48bb['query'][_0x052d('0x1e')]);_0x312448['offset']=qs[_0x052d('0x1d')](_0x3d48bb['query']['offset']);}_0x312448['order']=qs[_0x052d('0x36')](_0x3d48bb[_0x052d('0x33')][_0x052d('0x36')]);_0x312448[_0x052d('0x37')]=qs[_0x052d('0x30')](_[_0x052d('0x38')](_0x3d48bb['query'],_0x4b4b25['filters']));if(_0x3d48bb['query'][_0x052d('0x39')]){_0x312448[_0x052d('0x37')]=_['merge'](_0x312448['where'],{'$or':_[_0x052d('0x3a')](_0x38b099,function(_0x2041b5){if(_0x2041b5[_0x052d('0x3b')][_0x052d('0x3c')]!==_0x052d('0x3d')){var _0x31d6b9={};_0x31d6b9[_0x2041b5[_0x052d('0x3e')]]={'$like':'%'+_0x3d48bb[_0x052d('0x33')][_0x052d('0x39')]+'%'};return _0x31d6b9;}})});}_0x312448=_['merge']({},_0x312448,_0x3d48bb['options']);var _0x3d94c5={'where':_0x312448[_0x052d('0x37')]};return db[_0x052d('0x3f')][_0x052d('0x1c')](_0x3d94c5)[_0x052d('0x25')](function(_0xb1fb8d){_0x2a3837['count']=_0xb1fb8d;if(_0x3d48bb[_0x052d('0x33')][_0x052d('0x40')]){_0x312448['include']=[{'all':!![]}];}return db[_0x052d('0x3f')][_0x052d('0x41')](_0x312448);})['then'](function(_0x530cef){_0x2a3837['rows']=_0x530cef;return _0x2a3837;})['then'](respondWithFilteredResult(_0x30dcd5,_0x312448))[_0x052d('0x42')](handleError(_0x30dcd5,null));};exports[_0x052d('0x43')]=function(_0x5872ff,_0x461d36){var _0x30f458={'raw':!![],'where':{'id':_0x5872ff[_0x052d('0x44')]['id']}},_0x289ba6={};_0x289ba6[_0x052d('0x2e')]=_[_0x052d('0x2f')](db[_0x052d('0x3f')][_0x052d('0x2d')]);_0x289ba6['query']=_[_0x052d('0x2f')](_0x5872ff['query']);_0x289ba6[_0x052d('0x30')]=_['intersection'](_0x289ba6[_0x052d('0x2e')],_0x289ba6[_0x052d('0x33')]);_0x30f458[_0x052d('0x34')]=_['intersection'](_0x289ba6[_0x052d('0x2e')],qs[_0x052d('0x32')](_0x5872ff['query'][_0x052d('0x32')]));_0x30f458[_0x052d('0x34')]=_0x30f458[_0x052d('0x34')][_0x052d('0x45')]?_0x30f458[_0x052d('0x34')]:_0x289ba6[_0x052d('0x2e')];if(_0x5872ff[_0x052d('0x33')][_0x052d('0x40')]){_0x30f458[_0x052d('0x46')]=[{'all':!![]}];}_0x30f458=_[_0x052d('0x47')]({},_0x30f458,_0x5872ff[_0x052d('0x48')]);return db[_0x052d('0x3f')][_0x052d('0x49')](_0x30f458)[_0x052d('0x25')](handleEntityNotFound(_0x461d36,null))[_0x052d('0x25')](respondWithResult(_0x461d36,null))[_0x052d('0x42')](handleError(_0x461d36,null));};exports[_0x052d('0x4a')]=function(_0xec1043,_0x122794){return db['AnalyticDefaultReport'][_0x052d('0x4a')](_0xec1043[_0x052d('0x4b')],{})[_0x052d('0x25')](function(_0x5cdd29){var _0x5d9f5a=_0xec1043[_0x052d('0x4c')][_0x052d('0x4d')]({'plain':!![]});if(!_0x5d9f5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d9f5a[_0x052d('0x4e')]===_0x052d('0x4c')){var _0x84de76=_0x5cdd29[_0x052d('0x4d')]({'plain':!![]});var _0x5d5737=_0x052d('0x4f');return db[_0x052d('0x50')][_0x052d('0x49')]({'where':{'name':_0x5d5737,'userProfileId':_0x5d9f5a[_0x052d('0x51')]},'raw':!![]})[_0x052d('0x25')](function(_0x16e64e){if(_0x16e64e&&_0x16e64e['autoAssociation']===0x0){return db[_0x052d('0x52')][_0x052d('0x4a')]({'name':_0x84de76[_0x052d('0x2a')],'resourceId':_0x84de76['id'],'type':_0x052d('0x26'),'sectionId':_0x16e64e['id']},{})[_0x052d('0x25')](function(){return _0x5cdd29;});}else{return _0x5cdd29;}})[_0x052d('0x42')](function(_0x28f244){logger['error'](_0x052d('0x53'),_0x28f244);throw _0x28f244;});}return _0x5cdd29;})['then'](respondWithResult(_0x122794,0xc9))[_0x052d('0x42')](handleError(_0x122794,null));};exports['update']=function(_0x12bae3,_0x523ae6){if(_0x12bae3[_0x052d('0x4b')]['id']){delete _0x12bae3[_0x052d('0x4b')]['id'];}return db[_0x052d('0x3f')][_0x052d('0x49')]({'where':{'id':_0x12bae3[_0x052d('0x44')]['id']}})['then'](handleEntityNotFound(_0x523ae6,null))[_0x052d('0x25')](saveUpdates(_0x12bae3[_0x052d('0x4b')],null))[_0x052d('0x25')](respondWithResult(_0x523ae6,null))[_0x052d('0x42')](handleError(_0x523ae6,null));};exports[_0x052d('0x27')]=function(_0x5d7826,_0x5141d4){return db['AnalyticDefaultReport'][_0x052d('0x49')]({'where':{'id':_0x5d7826[_0x052d('0x44')]['id']}})[_0x052d('0x25')](handleEntityNotFound(_0x5141d4,null))['then'](removeEntity(_0x5141d4,null))[_0x052d('0x42')](handleError(_0x5141d4,null));};exports['preview']=function(_0x108228,_0x45c661){var _0x49bb10=0xa;var _0x264524=[_0x052d('0x54'),_0x052d('0x55'),_0x052d('0x56'),_0x052d('0x57')];var _0x8b578d={'SUM':_0x052d('0x58'),'COUNT':_0x052d('0x59'),'COUNT DISTINCT':_0x052d('0x5a'),'MAX':_0x052d('0x5b'),'MIN':_0x052d('0x5c'),'AVG':_0x052d('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x052d('0x5e'),'GROUP_CONCAT DESC':_0x052d('0x5f')};var _0x192211={'SEC_TO_TIME':_0x052d('0x60'),'DATE':_0x052d('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x442772=function(_0x6ca390){return!_['includes']([_0x052d('0x62'),_0x052d('0x63'),_0x052d('0x64'),_0x052d('0x65')],_0x6ca390);};var _0x5eae46=function(_0x257587){if(!_0x257587||!_0x257587[_0x052d('0x66')][_0x052d('0x45')]){return'';}for(var _0x241c17='(',_0x4b2ba1=0x0;_0x4b2ba1<_0x257587['rules'][_0x052d('0x45')];_0x4b2ba1+=0x1){_0x4b2ba1>0x0&&(_0x241c17+='\x20'+_0x257587[_0x052d('0x67')]+'\x20');_0x241c17+=_0x257587[_0x052d('0x66')][_0x4b2ba1][_0x052d('0x68')]?_0x5eae46(_0x257587[_0x052d('0x66')][_0x4b2ba1][_0x052d('0x68')]):_0x257587[_0x052d('0x66')][_0x4b2ba1]['field']+'\x20'+_0x257587[_0x052d('0x66')][_0x4b2ba1][_0x052d('0x69')]+(_0x442772(_0x257587[_0x052d('0x66')][_0x4b2ba1][_0x052d('0x69')])?'\x20'+_0x257587[_0x052d('0x66')][_0x4b2ba1][_0x052d('0x6a')]:'');}return _0x241c17+')';};var _0x25d914={'where':{'id':_0x108228['params']['id']}},_0x320fcd,_0x86ded9,_0x44d271,_0x5e3a4a,_0x15c6f6;_0x25d914=_[_0x052d('0x47')]({},_0x25d914,_0x108228[_0x052d('0x48')]);return db[_0x052d('0x3f')][_0x052d('0x49')](_0x25d914)['then'](function(_0x24ce41){if(_0x24ce41){_0x320fcd=_0x24ce41;return _0x24ce41[_0x052d('0x6b')]();}return null;})[_0x052d('0x25')](function(_0xd98e04){if(_0xd98e04){if(!_0xd98e04[_0x052d('0x45')]){throw new db['Sequelize'][(_0x052d('0x6c'))](_0x052d('0x6d'),0x193);}_0x86ded9=_0xd98e04;return db[_0x052d('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x052d('0x25')](function(_0x3fb95d){if(_0x3fb95d){_0x44d271=_['keyBy'](_0x3fb95d,'id');var _0x5ccef8;var _0x1dd58f=squel[_0x052d('0x6f')]();_0x1dd58f[_0x052d('0x70')](_0x320fcd[_0x052d('0x71')]);for(var _0x10c6e7=0x0;_0x10c6e7<_0x86ded9[_0x052d('0x45')];_0x10c6e7+=0x1){_0x5ccef8=_0x86ded9[_0x10c6e7][_0x052d('0x72')]?_0x44d271[_0x86ded9[_0x10c6e7][_0x052d('0x72')]][_0x052d('0x73')]:_0x86ded9[_0x10c6e7][_0x052d('0x3e')];_0x5ccef8=_0x86ded9[_0x10c6e7][_0x052d('0x74')]?_[_0x052d('0x75')](_0x8b578d[_0x86ded9[_0x10c6e7]['function']],'%s',_0x5ccef8):_0x5ccef8;_0x5ccef8=_0x86ded9[_0x10c6e7][_0x052d('0x76')]?_[_0x052d('0x75')](_0x192211[_0x86ded9[_0x10c6e7]['format']],'%s',_0x5ccef8):_0x5ccef8;if(_0x86ded9[_0x10c6e7]['groupBy']){_0x1dd58f[_0x052d('0x68')](_0x5ccef8);}_0x86ded9[_0x10c6e7]['orderBy']&&_0x1dd58f[_0x052d('0x77')](_0x5ccef8,_0x86ded9[_0x10c6e7]['orderBy']===_0x052d('0x78')?![]:!![]);_0x1dd58f[_0x052d('0x3e')](_0x5ccef8,_0x86ded9[_0x10c6e7][_0x052d('0x79')]||_0x5ccef8);}if(_0x320fcd['joins']){_0x320fcd[_0x052d('0x7a')]=JSON[_0x052d('0x7b')](_0x320fcd['joins']);for(var _0xd4fafc=0x0;_0xd4fafc<_0x320fcd[_0x052d('0x7a')][_0x052d('0x45')];_0xd4fafc+=0x1){if(_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x3b')]&&_[_0x052d('0x7c')](_0x264524,_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x3b')])&&_0x320fcd['joins'][_0xd4fafc][_0x052d('0x7d')]&&_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x7e')]&&_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x7f')]){_0x1dd58f[_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x3b')]](_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x7e')],null,util[_0x052d('0x76')](_0x052d('0x80'),_0x320fcd[_0x052d('0x71')],_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x7d')],_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x7e')],_0x320fcd[_0x052d('0x7a')][_0xd4fafc][_0x052d('0x7f')]));}}}if(_0x320fcd['conditions']){_0x320fcd[_0x052d('0x81')]=JSON['parse'](_0x320fcd[_0x052d('0x81')]);_0x1dd58f[_0x052d('0x37')](_0x5eae46(_0x320fcd['conditions']['group']));}_0x15c6f6=_0x1dd58f[_0x052d('0x82')]();_0x1dd58f[_0x052d('0x1e')](_0x49bb10);_0x1dd58f[_0x052d('0x1d')](0x0);logger[_0x052d('0x83')](_0x052d('0x84'),_0x1dd58f[_0x052d('0x85')]());return db[_0x052d('0x86')][_0x052d('0x33')](_0x1dd58f[_0x052d('0x85')](),{'type':db['sequelize']['QueryTypes'][_0x052d('0x87')]});}})['then'](respondWithResult(_0x45c661,null))[_0x052d('0x42')](handleError(_0x45c661,null));};function runReport(_0x1dce81,_0x2263f6,_0x4dd30c){var _0x172d0f=_0x2263f6[_0x052d('0x2a')];var _0x27ad5f=0xa;var _0x305471=[_0x052d('0x54'),_0x052d('0x55'),_0x052d('0x56'),_0x052d('0x57')];var _0x1572de={'SUM':_0x052d('0x58'),'COUNT':_0x052d('0x59'),'COUNT DISTINCT':_0x052d('0x5a'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x052d('0x5d'),'GROUP_CONCAT':_0x052d('0x88'),'GROUP_CONCAT ASC':_0x052d('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x46c080={'SEC_TO_TIME':_0x052d('0x60'),'DATE':_0x052d('0x61'),'HOUR':_0x052d('0x89'),'ROUND':_0x052d('0x8a'),'UNIX_TIMESTAMP':_0x052d('0x8b')};var _0x15129f=function(_0x493a9f){return!_[_0x052d('0x7c')]([_0x052d('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x052d('0x65')],_0x493a9f);};var _0x41c8f8=function(_0x4864a3){if(!_0x4864a3||!_0x4864a3[_0x052d('0x66')]['length']){return'';}for(var _0x8a868b='(',_0x16760c=0x0;_0x16760c<_0x4864a3['rules']['length'];_0x16760c+=0x1){_0x16760c>0x0&&(_0x8a868b+='\x20'+_0x4864a3[_0x052d('0x67')]+'\x20');_0x8a868b+=_0x4864a3['rules'][_0x16760c][_0x052d('0x68')]?_0x41c8f8(_0x4864a3[_0x052d('0x66')][_0x16760c][_0x052d('0x68')]):_0x4864a3[_0x052d('0x66')][_0x16760c][_0x052d('0x3e')]+'\x20'+_0x4864a3[_0x052d('0x66')][_0x16760c][_0x052d('0x69')]+(_0x15129f(_0x4864a3[_0x052d('0x66')][_0x16760c]['condition'])?'\x20'+_0x4864a3[_0x052d('0x66')][_0x16760c][_0x052d('0x6a')]:'');}return _0x8a868b+')';};var _0x553478={'where':{'id':_0x1dce81['id']}},_0x4b4044,_0x56103c,_0x5ee571,_0x135b85,_0x33d826;_0x553478=_[_0x052d('0x47')]({},_0x553478,_0x4dd30c);return db['AnalyticDefaultReport'][_0x052d('0x49')](_0x553478)['then'](function(_0x359443){if(_0x359443){_0x4b4044=_0x359443;return _0x359443['getFields']();}return null;})['then'](function(_0x2485e5){if(_0x2485e5){if(!_0x2485e5[_0x052d('0x45')]){throw new db[(_0x052d('0x8c'))][(_0x052d('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56103c=_0x2485e5;return db[_0x052d('0x6e')][_0x052d('0x41')]({'raw':!![]});}return null;})[_0x052d('0x25')](function(_0x5ece82){if(_0x5ece82){_0x5ee571=_[_0x052d('0x8d')](_0x5ece82,'id');var _0x34bad7;var _0x2c311b=squel[_0x052d('0x6f')]();_0x2c311b['from'](_0x4b4044[_0x052d('0x71')]);for(var _0x1cb444=0x0;_0x1cb444<_0x56103c[_0x052d('0x45')];_0x1cb444+=0x1){_0x34bad7=_0x56103c[_0x1cb444][_0x052d('0x72')]?_0x5ee571[_0x56103c[_0x1cb444][_0x052d('0x72')]][_0x052d('0x73')]:_0x56103c[_0x1cb444][_0x052d('0x3e')];_0x34bad7=_0x56103c[_0x1cb444]['function']?_[_0x052d('0x75')](_0x1572de[_0x56103c[_0x1cb444][_0x052d('0x74')]],'%s',_0x34bad7):_0x34bad7;_0x34bad7=_0x56103c[_0x1cb444]['format']?_[_0x052d('0x75')](_0x46c080[_0x56103c[_0x1cb444]['format']],'%s',_0x34bad7):_0x34bad7;if(_0x56103c[_0x1cb444]['groupBy']){_0x2c311b[_0x052d('0x68')](_0x34bad7);}_0x56103c[_0x1cb444]['orderBy']&&_0x2c311b[_0x052d('0x77')](_0x34bad7,_0x56103c[_0x1cb444][_0x052d('0x8e')]==='DESC'?![]:!![]);_0x2c311b['field'](_0x34bad7,_0x56103c[_0x1cb444][_0x052d('0x79')]||_0x34bad7);}if(_0x4b4044[_0x052d('0x7a')]){_0x4b4044[_0x052d('0x7a')]=JSON[_0x052d('0x7b')](_0x4b4044['joins']);for(var _0x35a12c=0x0;_0x35a12c<_0x4b4044[_0x052d('0x7a')][_0x052d('0x45')];_0x35a12c+=0x1){if(_0x4b4044[_0x052d('0x7a')][_0x35a12c][_0x052d('0x3b')]&&_['includes'](_0x305471,_0x4b4044[_0x052d('0x7a')][_0x35a12c][_0x052d('0x3b')])&&_0x4b4044[_0x052d('0x7a')][_0x35a12c][_0x052d('0x7d')]&&_0x4b4044[_0x052d('0x7a')][_0x35a12c][_0x052d('0x7e')]&&_0x4b4044[_0x052d('0x7a')][_0x35a12c]['foreignKey']){_0x2c311b[_0x4b4044[_0x052d('0x7a')][_0x35a12c][_0x052d('0x3b')]](_0x4b4044['joins'][_0x35a12c][_0x052d('0x7e')],null,util[_0x052d('0x76')](_0x052d('0x80'),_0x4b4044[_0x052d('0x71')],_0x4b4044[_0x052d('0x7a')][_0x35a12c][_0x052d('0x7d')],_0x4b4044[_0x052d('0x7a')][_0x35a12c][_0x052d('0x7e')],_0x4b4044[_0x052d('0x7a')][_0x35a12c]['foreignKey']));}}}if(_0x4b4044[_0x052d('0x81')]){_0x4b4044['conditions']=JSON['parse'](_0x4b4044[_0x052d('0x81')]);_0x2c311b[_0x052d('0x37')](_0x41c8f8(_0x4b4044[_0x052d('0x81')][_0x052d('0x68')]));}_0x33d826=_0x2c311b['clone']();_0x2c311b[_0x052d('0x1e')](_0x27ad5f);_0x2c311b[_0x052d('0x1d')](0x0);logger['debug']('Limited\x20Query:',_0x2c311b[_0x052d('0x85')]());return db[_0x052d('0x86')][_0x052d('0x33')](_0x2c311b['toString'](),{'type':db[_0x052d('0x86')][_0x052d('0x8f')][_0x052d('0x87')]});}})['then'](function(_0x5b57ce){if(!_0x5b57ce[_0x052d('0x45')]){throw new db['Sequelize'][(_0x052d('0x6c'))](_0x052d('0x90'),0xcc);}if(_0x2263f6[_0x052d('0x91')]==='web'){return null;}var _0x2928c0=_['merge'](_0x2263f6,{'name':_0x2263f6['fullPath']||_0x2263f6['name']||_0x4b4044[_0x052d('0x2a')],'basename':_0x172d0f,'savename':util[_0x052d('0x76')](_0x052d('0x92'),_0x2263f6['name']||_0x4b4044[_0x052d('0x2a')],require('randomstring')[_0x052d('0x93')](0x4),_0x2263f6[_0x052d('0x91')]||'csv'),'reportId':_0x4b4044['id'],'reportType':_0x052d('0x94')});return db['AnalyticExtractedReport'][_0x052d('0x4a')](_0x2928c0,{'raw':!![]});})[_0x052d('0x25')](function(_0x20b72){if(_0x4b4044['table']===_0x052d('0x95')){_0x33d826[_0x052d('0x37')](_0x4b4044[_0x052d('0x71')]+_0x052d('0x96'),_0x2263f6[_0x052d('0x97')],_0x2263f6['endDate']);}else{_0x33d826[_0x052d('0x37')](_0x4b4044['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2263f6[_0x052d('0x97')],_0x2263f6[_0x052d('0x98')]);}if(_0x20b72){logger[_0x052d('0x99')](_0x052d('0x9a'),_0x33d826[_0x052d('0x85')]());require(_0x052d('0x9b'))['fork'](path[_0x052d('0x54')](__dirname,_0x052d('0x9c'),_0x20b72[_0x052d('0x91')]),[_0x20b72['id'],_0x33d826['toString'](),path[_0x052d('0x54')](__dirname,_0x052d('0x9d'),_0x20b72[_0x052d('0x9e')]),_0x172d0f]);return _0x20b72;}else{var _0x4e7114=squel[_0x052d('0x6f')]();_0x4e7114[_0x052d('0x70')]('('+_0x33d826[_0x052d('0x85')]()+')',_0x052d('0x9f'));_0x4e7114[_0x052d('0x3e')](_0x052d('0xa0'),'count');_0x33d826[_0x052d('0x1e')](_0x2263f6[_0x052d('0x1e')]||_0x27ad5f);_0x33d826[_0x052d('0x1d')](_0x2263f6[_0x052d('0x1d')]||0x0);return db[_0x052d('0x86')][_0x052d('0x33')](_0x4e7114['toString'](),{'type':db['sequelize'][_0x052d('0x8f')][_0x052d('0x87')]})[_0x052d('0x25')](function(_0x4dc3e2){if(!_0x4dc3e2[_0x052d('0x45')]){_0x135b85=0x0;}else{_0x135b85=_0x4dc3e2[0x0]['count']||0x0;}return db['sequelize']['query'](_0x33d826['toString'](),{'type':db[_0x052d('0x86')]['QueryTypes'][_0x052d('0x87')]});})[_0x052d('0x25')](function(_0x29fa2b){return{'rows':_0x29fa2b||[],'count':_0x135b85};});}});}exports[_0x052d('0xa1')]=function(_0x3cf910,_0x3cdffc){return runReport(_0x3cf910[_0x052d('0x44')],_0x3cf910[_0x052d('0x33')],_0x3cf910[_0x052d('0x48')])[_0x052d('0x25')](respondWithResult(_0x3cdffc,null))[_0x052d('0x42')](handleError(_0x3cdffc,null));};exports[_0x052d('0xa2')]=runReport;exports['query']=function(_0x313f8e,_0x1be6ed){var _0x515a91=0xa;var _0x56e0aa=['join',_0x052d('0x55'),_0x052d('0x56'),_0x052d('0x57')];var _0x4ef9c3={'SUM':_0x052d('0x58'),'COUNT':_0x052d('0x59'),'COUNT DISTINCT':_0x052d('0x5a'),'MAX':_0x052d('0x5b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x052d('0x88'),'GROUP_CONCAT ASC':_0x052d('0x5e'),'GROUP_CONCAT DESC':_0x052d('0x5f')};var _0x522ddb={'SEC_TO_TIME':_0x052d('0x60'),'DATE':_0x052d('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3005f1=function(_0x3bc277){return!_[_0x052d('0x7c')]([_0x052d('0x62'),_0x052d('0x63'),'IS\x20EMPTY',_0x052d('0x65')],_0x3bc277);};var _0x2ef378=function(_0x26ccb8){if(!_0x26ccb8||!_0x26ccb8[_0x052d('0x66')][_0x052d('0x45')]){return'';}for(var _0x33c0d2='(',_0x43e40b=0x0;_0x43e40b<_0x26ccb8[_0x052d('0x66')][_0x052d('0x45')];_0x43e40b+=0x1){_0x43e40b>0x0&&(_0x33c0d2+='\x20'+_0x26ccb8[_0x052d('0x67')]+'\x20');_0x33c0d2+=_0x26ccb8['rules'][_0x43e40b][_0x052d('0x68')]?_0x2ef378(_0x26ccb8[_0x052d('0x66')][_0x43e40b][_0x052d('0x68')]):_0x26ccb8['rules'][_0x43e40b][_0x052d('0x3e')]+'\x20'+_0x26ccb8[_0x052d('0x66')][_0x43e40b][_0x052d('0x69')]+(_0x3005f1(_0x26ccb8[_0x052d('0x66')][_0x43e40b][_0x052d('0x69')])?'\x20'+_0x26ccb8['rules'][_0x43e40b]['value']:'');}return _0x33c0d2+')';};var _0x228d3f={'where':{'id':_0x313f8e[_0x052d('0x44')]['id']}},_0x60fc85,_0x212602,_0x5f5209,_0x18de97,_0x42c2a1;_0x228d3f=_[_0x052d('0x47')]({},_0x228d3f,_0x313f8e[_0x052d('0x48')]);return db['AnalyticDefaultReport'][_0x052d('0x49')](_0x228d3f)[_0x052d('0x25')](function(_0x3f4963){if(_0x3f4963){_0x60fc85=_0x3f4963;return _0x3f4963[_0x052d('0x6b')]();}return null;})['then'](function(_0xd758a0){if(_0xd758a0){if(!_0xd758a0[_0x052d('0x45')]){throw new db[(_0x052d('0x8c'))][(_0x052d('0x6c'))](_0x052d('0x6d'),0x193);}_0x212602=_0xd758a0;return db[_0x052d('0x6e')][_0x052d('0x41')]({'raw':!![]});}return null;})['then'](function(_0x10a593){if(_0x10a593){_0x5f5209=_[_0x052d('0x8d')](_0x10a593,'id');var _0x7685a5;var _0x97509b=squel[_0x052d('0x6f')]();_0x97509b[_0x052d('0x70')](_0x60fc85['table']);for(var _0x5490fd=0x0;_0x5490fd<_0x212602[_0x052d('0x45')];_0x5490fd+=0x1){_0x7685a5=_0x212602[_0x5490fd][_0x052d('0x72')]?_0x5f5209[_0x212602[_0x5490fd]['MetricId']][_0x052d('0x73')]:_0x212602[_0x5490fd][_0x052d('0x3e')];_0x7685a5=_0x212602[_0x5490fd][_0x052d('0x74')]?_[_0x052d('0x75')](_0x4ef9c3[_0x212602[_0x5490fd]['function']],'%s',_0x7685a5):_0x7685a5;_0x7685a5=_0x212602[_0x5490fd][_0x052d('0x76')]?_[_0x052d('0x75')](_0x522ddb[_0x212602[_0x5490fd]['format']],'%s',_0x7685a5):_0x7685a5;if(_0x212602[_0x5490fd][_0x052d('0xa3')]){_0x97509b[_0x052d('0x68')](_0x7685a5);}_0x212602[_0x5490fd]['orderBy']&&_0x97509b[_0x052d('0x77')](_0x7685a5,_0x212602[_0x5490fd][_0x052d('0x8e')]==='DESC'?![]:!![]);_0x97509b[_0x052d('0x3e')](_0x7685a5,_0x212602[_0x5490fd][_0x052d('0x79')]||_0x7685a5);}if(_0x60fc85['joins']){_0x60fc85[_0x052d('0x7a')]=JSON[_0x052d('0x7b')](_0x60fc85['joins']);for(var _0x4f03e1=0x0;_0x4f03e1<_0x60fc85['joins'][_0x052d('0x45')];_0x4f03e1+=0x1){if(_0x60fc85[_0x052d('0x7a')][_0x4f03e1][_0x052d('0x3b')]&&_['includes'](_0x56e0aa,_0x60fc85[_0x052d('0x7a')][_0x4f03e1][_0x052d('0x3b')])&&_0x60fc85['joins'][_0x4f03e1][_0x052d('0x7d')]&&_0x60fc85[_0x052d('0x7a')][_0x4f03e1][_0x052d('0x7e')]&&_0x60fc85[_0x052d('0x7a')][_0x4f03e1][_0x052d('0x7f')]){_0x97509b[_0x60fc85[_0x052d('0x7a')][_0x4f03e1][_0x052d('0x3b')]](_0x60fc85[_0x052d('0x7a')][_0x4f03e1][_0x052d('0x7e')],null,util[_0x052d('0x76')](_0x052d('0x80'),_0x60fc85[_0x052d('0x71')],_0x60fc85[_0x052d('0x7a')][_0x4f03e1][_0x052d('0x7d')],_0x60fc85['joins'][_0x4f03e1][_0x052d('0x7e')],_0x60fc85[_0x052d('0x7a')][_0x4f03e1]['foreignKey']));}}}if(_0x60fc85[_0x052d('0x81')]){_0x60fc85[_0x052d('0x81')]=JSON['parse'](_0x60fc85['conditions']);_0x97509b[_0x052d('0x37')](_0x2ef378(_0x60fc85[_0x052d('0x81')][_0x052d('0x68')]));}_0x42c2a1=_0x97509b[_0x052d('0x82')]();_0x97509b['limit'](_0x515a91);_0x97509b['offset'](0x0);logger['debug'](_0x052d('0x84'),_0x97509b[_0x052d('0x85')]());return db[_0x052d('0x86')][_0x052d('0x33')](_0x97509b['toString'](),{'type':db[_0x052d('0x86')][_0x052d('0x8f')][_0x052d('0x87')]});}})[_0x052d('0x25')](function(){return{'sql':_0x42c2a1['toString']()};})['then'](respondWithResult(_0x1be6ed,null))['catch'](handleError(_0x1be6ed,null));}; \ No newline at end of file +var _0xcd35=['hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','get','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20EMPTY','getFields','AnalyticMetric','from','No\x20available\x20data','web','fullPath','generate','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','run','runReport','AVG(%s)','operator','clone','debug','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2691a9,_0x2b2d43){var _0x173b53=function(_0x20e1a9){while(--_0x20e1a9){_0x2691a9['push'](_0x2691a9['shift']());}};_0x173b53(++_0x2b2d43);}(_0xcd35,0x1ac));var _0x5cd3=function(_0xe328ba,_0xc0c319){_0xe328ba=_0xe328ba-0x0;var _0xef5581=_0xcd35[_0xe328ba];return _0xef5581;};'use strict';var pdf=require(_0x5cd3('0x0'));var emlformat=require(_0x5cd3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5cd3('0x2'));var jsonpatch=require(_0x5cd3('0x3'));var rp=require(_0x5cd3('0x4'));var moment=require(_0x5cd3('0x5'));var BPromise=require(_0x5cd3('0x6'));var Mustache=require(_0x5cd3('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5cd3('0x8'));var ejs=require(_0x5cd3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5cd3('0xa'));var crypto=require(_0x5cd3('0xb'));var jsforce=require(_0x5cd3('0xc'));var deskjs=require(_0x5cd3('0xd'));var toCsv=require(_0x5cd3('0x8'));var querystring=require(_0x5cd3('0xe'));var Papa=require('papaparse');var authService=require(_0x5cd3('0xf'));var hardwareService=require(_0x5cd3('0x10'));var Redis=require(_0x5cd3('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5cd3('0x12'));var utils=require('../../config/utils');var config=require(_0x5cd3('0x13'));var db=require(_0x5cd3('0x14'))['db'];function respondWithStatusCode(_0x286031,_0x27c137){_0x27c137=_0x27c137||0xcc;return function(_0x5f2fc4){if(_0x5f2fc4){return _0x286031[_0x5cd3('0x15')](_0x27c137);}return _0x286031[_0x5cd3('0x16')](_0x27c137)[_0x5cd3('0x17')]();};}function respondWithResult(_0x1f783d,_0x4cb63a){_0x4cb63a=_0x4cb63a||0xc8;return function(_0x1fbc8d){if(_0x1fbc8d){return _0x1f783d[_0x5cd3('0x16')](_0x4cb63a)[_0x5cd3('0x18')](_0x1fbc8d);}};}function respondWithFilteredResult(_0xb6f164,_0x44421a){return function(_0x1b8e9a){if(_0x1b8e9a){var _0x56536=_0x1b8e9a[_0x5cd3('0x19')],_0xc97df5=_0x44421a[_0x5cd3('0x1a')],_0x798444=_0x44421a[_0x5cd3('0x1a')]+_0x44421a[_0x5cd3('0x1b')],_0xa0c654;if(_0x798444>=_0x56536){_0x798444=_0x56536;_0xa0c654=0xc8;}else{_0xa0c654=0xce;}_0xb6f164[_0x5cd3('0x16')](_0xa0c654);return _0xb6f164[_0x5cd3('0x1c')]('Content-Range',_0xc97df5+'-'+_0x798444+'/'+_0x56536)['json'](_0x1b8e9a);}return null;};}function patchUpdates(_0x1658aa){return function(_0x37b7e6){try{jsonpatch[_0x5cd3('0x1d')](_0x37b7e6,_0x1658aa,!![]);}catch(_0x10bb81){return BPromise[_0x5cd3('0x1e')](_0x10bb81);}return _0x37b7e6[_0x5cd3('0x1f')]();};}function saveUpdates(_0x20c050,_0x1a4342){return function(_0x494efd){if(_0x494efd){return _0x494efd[_0x5cd3('0x20')](_0x20c050)[_0x5cd3('0x21')](function(_0x3e8416){return _0x3e8416;});}return null;};}function removeEntity(_0x2d225e,_0x3237df){return function(_0x21a1f1){if(_0x21a1f1){return _0x21a1f1[_0x5cd3('0x22')]()[_0x5cd3('0x21')](function(){var _0x28e960=_0x21a1f1['get']({'plain':!![]});var _0x4da05a=_0x5cd3('0x23');return db[_0x5cd3('0x24')][_0x5cd3('0x22')]({'where':{'type':_0x4da05a,'resourceId':_0x28e960['id']}})[_0x5cd3('0x21')](function(){return _0x21a1f1;});})['then'](function(){_0x2d225e['status'](0xcc)[_0x5cd3('0x17')]();});}};}function handleEntityNotFound(_0x4c8897,_0x1a1093){return function(_0x87c732){if(!_0x87c732){_0x4c8897[_0x5cd3('0x15')](0x194);}return _0x87c732;};}function handleError(_0xc3e9aa,_0x510174){_0x510174=_0x510174||0x1f4;return function(_0x1ec01a){logger[_0x5cd3('0x25')](_0x1ec01a['stack']);if(_0x1ec01a['name']){delete _0x1ec01a[_0x5cd3('0x26')];}_0xc3e9aa[_0x5cd3('0x16')](_0x510174)['send'](_0x1ec01a);};}exports[_0x5cd3('0x27')]=function(_0x1fbcf9,_0xa8750e){var _0x2857c5={},_0x57cf1a={},_0x5cd43e={'count':0x0,'rows':[]};var _0x433248=db[_0x5cd3('0x28')]['rawAttributes'];_0x57cf1a[_0x5cd3('0x29')]=_['keys'](_0x433248);_0x57cf1a[_0x5cd3('0x2a')]=_[_0x5cd3('0x2b')](_0x1fbcf9[_0x5cd3('0x2a')]);_0x57cf1a[_0x5cd3('0x2c')]=_[_0x5cd3('0x2d')](_0x57cf1a['model'],_0x57cf1a[_0x5cd3('0x2a')]);_0x2857c5[_0x5cd3('0x2e')]=_[_0x5cd3('0x2d')](_0x57cf1a[_0x5cd3('0x29')],qs['fields'](_0x1fbcf9['query'][_0x5cd3('0x2f')]));_0x2857c5[_0x5cd3('0x2e')]=_0x2857c5[_0x5cd3('0x2e')][_0x5cd3('0x30')]?_0x2857c5[_0x5cd3('0x2e')]:_0x57cf1a[_0x5cd3('0x29')];if(!_0x1fbcf9['query'][_0x5cd3('0x31')](_0x5cd3('0x32'))){_0x2857c5['limit']=qs[_0x5cd3('0x1b')](_0x1fbcf9['query'][_0x5cd3('0x1b')]);_0x2857c5['offset']=qs[_0x5cd3('0x1a')](_0x1fbcf9[_0x5cd3('0x2a')][_0x5cd3('0x1a')]);}_0x2857c5[_0x5cd3('0x33')]=qs[_0x5cd3('0x34')](_0x1fbcf9[_0x5cd3('0x2a')][_0x5cd3('0x34')]);_0x2857c5[_0x5cd3('0x35')]=qs[_0x5cd3('0x2c')](_[_0x5cd3('0x36')](_0x1fbcf9['query'],_0x57cf1a[_0x5cd3('0x2c')]));if(_0x1fbcf9[_0x5cd3('0x2a')]['filter']){_0x2857c5[_0x5cd3('0x35')]=_[_0x5cd3('0x37')](_0x2857c5['where'],{'$or':_[_0x5cd3('0x38')](_0x433248,function(_0x4c61e6){if(_0x4c61e6[_0x5cd3('0x39')][_0x5cd3('0x3a')]!==_0x5cd3('0x3b')){var _0x1649d4={};_0x1649d4[_0x4c61e6[_0x5cd3('0x3c')]]={'$like':'%'+_0x1fbcf9['query'][_0x5cd3('0x3d')]+'%'};return _0x1649d4;}})});}_0x2857c5=_[_0x5cd3('0x37')]({},_0x2857c5,_0x1fbcf9[_0x5cd3('0x3e')]);var _0x390520={'where':_0x2857c5[_0x5cd3('0x35')]};return db[_0x5cd3('0x28')]['count'](_0x390520)[_0x5cd3('0x21')](function(_0x2015f0){_0x5cd43e[_0x5cd3('0x19')]=_0x2015f0;if(_0x1fbcf9[_0x5cd3('0x2a')]['includeAll']){_0x2857c5[_0x5cd3('0x3f')]=[{'all':!![]}];}return db[_0x5cd3('0x28')][_0x5cd3('0x40')](_0x2857c5);})[_0x5cd3('0x21')](function(_0xf63bae){_0x5cd43e[_0x5cd3('0x41')]=_0xf63bae;return _0x5cd43e;})['then'](respondWithFilteredResult(_0xa8750e,_0x2857c5))['catch'](handleError(_0xa8750e,null));};exports[_0x5cd3('0x42')]=function(_0x1a3e88,_0x1d3b3a){var _0x33ab98={'raw':!![],'where':{'id':_0x1a3e88[_0x5cd3('0x43')]['id']}},_0x119bf8={};_0x119bf8['model']=_[_0x5cd3('0x2b')](db[_0x5cd3('0x28')]['rawAttributes']);_0x119bf8[_0x5cd3('0x2a')]=_[_0x5cd3('0x2b')](_0x1a3e88['query']);_0x119bf8[_0x5cd3('0x2c')]=_[_0x5cd3('0x2d')](_0x119bf8[_0x5cd3('0x29')],_0x119bf8[_0x5cd3('0x2a')]);_0x33ab98[_0x5cd3('0x2e')]=_[_0x5cd3('0x2d')](_0x119bf8[_0x5cd3('0x29')],qs[_0x5cd3('0x2f')](_0x1a3e88[_0x5cd3('0x2a')][_0x5cd3('0x2f')]));_0x33ab98[_0x5cd3('0x2e')]=_0x33ab98['attributes']['length']?_0x33ab98[_0x5cd3('0x2e')]:_0x119bf8[_0x5cd3('0x29')];if(_0x1a3e88[_0x5cd3('0x2a')][_0x5cd3('0x44')]){_0x33ab98[_0x5cd3('0x3f')]=[{'all':!![]}];}_0x33ab98=_['merge']({},_0x33ab98,_0x1a3e88[_0x5cd3('0x3e')]);return db[_0x5cd3('0x28')][_0x5cd3('0x45')](_0x33ab98)['then'](handleEntityNotFound(_0x1d3b3a,null))['then'](respondWithResult(_0x1d3b3a,null))[_0x5cd3('0x46')](handleError(_0x1d3b3a,null));};exports[_0x5cd3('0x47')]=function(_0x474989,_0x3d8fad){return db[_0x5cd3('0x28')][_0x5cd3('0x47')](_0x474989[_0x5cd3('0x48')],{})[_0x5cd3('0x21')](function(_0x49ab0a){var _0x41edff=_0x474989[_0x5cd3('0x49')][_0x5cd3('0x4a')]({'plain':!![]});if(!_0x41edff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41edff[_0x5cd3('0x4b')]===_0x5cd3('0x49')){var _0x20afe5=_0x49ab0a[_0x5cd3('0x4a')]({'plain':!![]});var _0x26188f=_0x5cd3('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x26188f,'userProfileId':_0x41edff[_0x5cd3('0x4d')]},'raw':!![]})[_0x5cd3('0x21')](function(_0x286b88){if(_0x286b88&&_0x286b88[_0x5cd3('0x4e')]===0x0){return db[_0x5cd3('0x24')][_0x5cd3('0x47')]({'name':_0x20afe5[_0x5cd3('0x26')],'resourceId':_0x20afe5['id'],'type':_0x5cd3('0x23'),'sectionId':_0x286b88['id']},{})[_0x5cd3('0x21')](function(){return _0x49ab0a;});}else{return _0x49ab0a;}})['catch'](function(_0xb8f593){logger[_0x5cd3('0x25')](_0x5cd3('0x4f'),_0xb8f593);throw _0xb8f593;});}return _0x49ab0a;})[_0x5cd3('0x21')](respondWithResult(_0x3d8fad,0xc9))[_0x5cd3('0x46')](handleError(_0x3d8fad,null));};exports[_0x5cd3('0x20')]=function(_0x2c3d53,_0x18df1b){if(_0x2c3d53['body']['id']){delete _0x2c3d53['body']['id'];}return db[_0x5cd3('0x28')]['find']({'where':{'id':_0x2c3d53[_0x5cd3('0x43')]['id']}})[_0x5cd3('0x21')](handleEntityNotFound(_0x18df1b,null))[_0x5cd3('0x21')](saveUpdates(_0x2c3d53[_0x5cd3('0x48')],null))[_0x5cd3('0x21')](respondWithResult(_0x18df1b,null))['catch'](handleError(_0x18df1b,null));};exports['destroy']=function(_0x5a894b,_0x1afa80){return db[_0x5cd3('0x28')][_0x5cd3('0x45')]({'where':{'id':_0x5a894b[_0x5cd3('0x43')]['id']}})[_0x5cd3('0x21')](handleEntityNotFound(_0x1afa80,null))['then'](removeEntity(_0x1afa80,null))[_0x5cd3('0x46')](handleError(_0x1afa80,null));};exports[_0x5cd3('0x50')]=function(_0xe3d492,_0x3823aa){var _0x40f6fa=0xa;var _0x3158eb=[_0x5cd3('0x51'),'left_join',_0x5cd3('0x52'),_0x5cd3('0x53')];var _0x54e280={'SUM':'SUM(%s)','COUNT':_0x5cd3('0x54'),'COUNT DISTINCT':_0x5cd3('0x55'),'MAX':_0x5cd3('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5cd3('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x231618={'SEC_TO_TIME':_0x5cd3('0x58'),'DATE':_0x5cd3('0x59'),'HOUR':_0x5cd3('0x5a'),'ROUND':_0x5cd3('0x5b'),'UNIX_TIMESTAMP':_0x5cd3('0x5c')};var _0x4e2895=function(_0x40366e){return!_[_0x5cd3('0x5d')]([_0x5cd3('0x5e'),_0x5cd3('0x5f'),_0x5cd3('0x60'),'IS\x20NOT\x20EMPTY'],_0x40366e);};var _0x1f180d=function(_0x1b1173){if(!_0x1b1173||!_0x1b1173[_0x5cd3('0x61')][_0x5cd3('0x30')]){return'';}for(var _0x2cdaaa='(',_0x3d6a2d=0x0;_0x3d6a2d<_0x1b1173[_0x5cd3('0x61')]['length'];_0x3d6a2d+=0x1){_0x3d6a2d>0x0&&(_0x2cdaaa+='\x20'+_0x1b1173['operator']+'\x20');_0x2cdaaa+=_0x1b1173['rules'][_0x3d6a2d][_0x5cd3('0x62')]?_0x1f180d(_0x1b1173[_0x5cd3('0x61')][_0x3d6a2d]['group']):_0x1b1173[_0x5cd3('0x61')][_0x3d6a2d][_0x5cd3('0x3c')]+'\x20'+_0x1b1173[_0x5cd3('0x61')][_0x3d6a2d][_0x5cd3('0x63')]+(_0x4e2895(_0x1b1173[_0x5cd3('0x61')][_0x3d6a2d][_0x5cd3('0x63')])?'\x20'+_0x1b1173[_0x5cd3('0x61')][_0x3d6a2d][_0x5cd3('0x64')]:'');}return _0x2cdaaa+')';};var _0x18ab1a={'where':{'id':_0xe3d492[_0x5cd3('0x43')]['id']}},_0x4e7d0d,_0x1ef420,_0xa9ca82,_0x242646,_0x3f5388;_0x18ab1a=_[_0x5cd3('0x37')]({},_0x18ab1a,_0xe3d492[_0x5cd3('0x3e')]);return db[_0x5cd3('0x28')]['find'](_0x18ab1a)[_0x5cd3('0x21')](function(_0x3d950f){if(_0x3d950f){_0x4e7d0d=_0x3d950f;return _0x3d950f['getFields']();}return null;})[_0x5cd3('0x21')](function(_0x5bd63b){if(_0x5bd63b){if(!_0x5bd63b[_0x5cd3('0x30')]){throw new db[(_0x5cd3('0x65'))][(_0x5cd3('0x66'))](_0x5cd3('0x67'),0x193);}_0x1ef420=_0x5bd63b;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5cd3('0x21')](function(_0x5d8526){if(_0x5d8526){_0xa9ca82=_[_0x5cd3('0x68')](_0x5d8526,'id');var _0x5d06b7;var _0x557121=squel[_0x5cd3('0x69')]();_0x557121['from'](_0x4e7d0d[_0x5cd3('0x6a')]);for(var _0x31d780=0x0;_0x31d780<_0x1ef420[_0x5cd3('0x30')];_0x31d780+=0x1){_0x5d06b7=_0x1ef420[_0x31d780][_0x5cd3('0x6b')]?_0xa9ca82[_0x1ef420[_0x31d780][_0x5cd3('0x6b')]][_0x5cd3('0x6c')]:_0x1ef420[_0x31d780][_0x5cd3('0x3c')];_0x5d06b7=_0x1ef420[_0x31d780][_0x5cd3('0x6d')]?_[_0x5cd3('0x6e')](_0x54e280[_0x1ef420[_0x31d780][_0x5cd3('0x6d')]],'%s',_0x5d06b7):_0x5d06b7;_0x5d06b7=_0x1ef420[_0x31d780][_0x5cd3('0x6f')]?_[_0x5cd3('0x6e')](_0x231618[_0x1ef420[_0x31d780][_0x5cd3('0x6f')]],'%s',_0x5d06b7):_0x5d06b7;if(_0x1ef420[_0x31d780][_0x5cd3('0x70')]){_0x557121[_0x5cd3('0x62')](_0x5d06b7);}_0x1ef420[_0x31d780][_0x5cd3('0x71')]&&_0x557121[_0x5cd3('0x33')](_0x5d06b7,_0x1ef420[_0x31d780][_0x5cd3('0x71')]===_0x5cd3('0x72')?![]:!![]);_0x557121[_0x5cd3('0x3c')](_0x5d06b7,_0x1ef420[_0x31d780][_0x5cd3('0x73')]||_0x5d06b7);}if(_0x4e7d0d['joins']){_0x4e7d0d[_0x5cd3('0x74')]=JSON[_0x5cd3('0x75')](_0x4e7d0d['joins']);for(var _0x467ff1=0x0;_0x467ff1<_0x4e7d0d[_0x5cd3('0x74')][_0x5cd3('0x30')];_0x467ff1+=0x1){if(_0x4e7d0d[_0x5cd3('0x74')][_0x467ff1][_0x5cd3('0x39')]&&_[_0x5cd3('0x5d')](_0x3158eb,_0x4e7d0d[_0x5cd3('0x74')][_0x467ff1]['type'])&&_0x4e7d0d[_0x5cd3('0x74')][_0x467ff1][_0x5cd3('0x76')]&&_0x4e7d0d[_0x5cd3('0x74')][_0x467ff1][_0x5cd3('0x77')]&&_0x4e7d0d['joins'][_0x467ff1][_0x5cd3('0x78')]){_0x557121[_0x4e7d0d[_0x5cd3('0x74')][_0x467ff1][_0x5cd3('0x39')]](_0x4e7d0d['joins'][_0x467ff1][_0x5cd3('0x77')],null,util['format'](_0x5cd3('0x79'),_0x4e7d0d[_0x5cd3('0x6a')],_0x4e7d0d[_0x5cd3('0x74')][_0x467ff1]['parentKey'],_0x4e7d0d[_0x5cd3('0x74')][_0x467ff1]['foreignTable'],_0x4e7d0d[_0x5cd3('0x74')][_0x467ff1][_0x5cd3('0x78')]));}}}if(_0x4e7d0d[_0x5cd3('0x7a')]){_0x4e7d0d[_0x5cd3('0x7a')]=JSON[_0x5cd3('0x75')](_0x4e7d0d[_0x5cd3('0x7a')]);_0x557121['where'](_0x1f180d(_0x4e7d0d[_0x5cd3('0x7a')][_0x5cd3('0x62')]));}_0x3f5388=_0x557121['clone']();_0x557121[_0x5cd3('0x1b')](_0x40f6fa);_0x557121[_0x5cd3('0x1a')](0x0);logger['debug'](_0x5cd3('0x7b'),_0x557121[_0x5cd3('0x7c')]());return db[_0x5cd3('0x7d')][_0x5cd3('0x2a')](_0x557121['toString'](),{'type':db['sequelize'][_0x5cd3('0x7e')][_0x5cd3('0x7f')]});}})['then'](respondWithResult(_0x3823aa,null))[_0x5cd3('0x46')](handleError(_0x3823aa,null));};function runReport(_0x1f1857,_0x4295f1,_0x2026be){var _0x52f720=_0x4295f1['name'];var _0x3bb626=0xa;var _0x3b8d63=[_0x5cd3('0x51'),_0x5cd3('0x80'),_0x5cd3('0x52'),'cross_join'];var _0x388f07={'SUM':_0x5cd3('0x81'),'COUNT':_0x5cd3('0x54'),'COUNT DISTINCT':_0x5cd3('0x55'),'MAX':_0x5cd3('0x56'),'MIN':_0x5cd3('0x82'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5cd3('0x57'),'GROUP_CONCAT ASC':_0x5cd3('0x83'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5ead1b={'SEC_TO_TIME':_0x5cd3('0x58'),'DATE':_0x5cd3('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x5cd3('0x5b'),'UNIX_TIMESTAMP':_0x5cd3('0x5c')};var _0x7c8f44=function(_0x3c6b06){return!_[_0x5cd3('0x5d')]([_0x5cd3('0x5e'),_0x5cd3('0x5f'),_0x5cd3('0x60'),_0x5cd3('0x84')],_0x3c6b06);};var _0x392c75=function(_0x537b6a){if(!_0x537b6a||!_0x537b6a['rules']['length']){return'';}for(var _0x567a6e='(',_0x1a7fea=0x0;_0x1a7fea<_0x537b6a[_0x5cd3('0x61')]['length'];_0x1a7fea+=0x1){_0x1a7fea>0x0&&(_0x567a6e+='\x20'+_0x537b6a['operator']+'\x20');_0x567a6e+=_0x537b6a[_0x5cd3('0x61')][_0x1a7fea][_0x5cd3('0x62')]?_0x392c75(_0x537b6a[_0x5cd3('0x61')][_0x1a7fea][_0x5cd3('0x62')]):_0x537b6a['rules'][_0x1a7fea][_0x5cd3('0x3c')]+'\x20'+_0x537b6a[_0x5cd3('0x61')][_0x1a7fea][_0x5cd3('0x63')]+(_0x7c8f44(_0x537b6a[_0x5cd3('0x61')][_0x1a7fea][_0x5cd3('0x63')])?'\x20'+_0x537b6a[_0x5cd3('0x61')][_0x1a7fea][_0x5cd3('0x64')]:'');}return _0x567a6e+')';};var _0xe32c1={'where':{'id':_0x1f1857['id']}},_0x1fb727,_0x349784,_0x193f5a,_0xeb9bc1,_0x4a6f4d;_0xe32c1=_[_0x5cd3('0x37')]({},_0xe32c1,_0x2026be);return db[_0x5cd3('0x28')][_0x5cd3('0x45')](_0xe32c1)['then'](function(_0x487739){if(_0x487739){_0x1fb727=_0x487739;return _0x487739[_0x5cd3('0x85')]();}return null;})[_0x5cd3('0x21')](function(_0x4b1b5c){if(_0x4b1b5c){if(!_0x4b1b5c[_0x5cd3('0x30')]){throw new db['Sequelize'][(_0x5cd3('0x66'))](_0x5cd3('0x67'),0x193);}_0x349784=_0x4b1b5c;return db[_0x5cd3('0x86')][_0x5cd3('0x40')]({'raw':!![]});}return null;})[_0x5cd3('0x21')](function(_0x5a19cd){if(_0x5a19cd){_0x193f5a=_[_0x5cd3('0x68')](_0x5a19cd,'id');var _0x59d4c1;var _0x316731=squel['select']();_0x316731[_0x5cd3('0x87')](_0x1fb727[_0x5cd3('0x6a')]);for(var _0x390a4f=0x0;_0x390a4f<_0x349784[_0x5cd3('0x30')];_0x390a4f+=0x1){_0x59d4c1=_0x349784[_0x390a4f][_0x5cd3('0x6b')]?_0x193f5a[_0x349784[_0x390a4f][_0x5cd3('0x6b')]][_0x5cd3('0x6c')]:_0x349784[_0x390a4f][_0x5cd3('0x3c')];_0x59d4c1=_0x349784[_0x390a4f][_0x5cd3('0x6d')]?_[_0x5cd3('0x6e')](_0x388f07[_0x349784[_0x390a4f]['function']],'%s',_0x59d4c1):_0x59d4c1;_0x59d4c1=_0x349784[_0x390a4f]['format']?_['replace'](_0x5ead1b[_0x349784[_0x390a4f]['format']],'%s',_0x59d4c1):_0x59d4c1;if(_0x349784[_0x390a4f][_0x5cd3('0x70')]){_0x316731[_0x5cd3('0x62')](_0x59d4c1);}_0x349784[_0x390a4f][_0x5cd3('0x71')]&&_0x316731[_0x5cd3('0x33')](_0x59d4c1,_0x349784[_0x390a4f][_0x5cd3('0x71')]==='DESC'?![]:!![]);_0x316731[_0x5cd3('0x3c')](_0x59d4c1,_0x349784[_0x390a4f]['alias']||_0x59d4c1);}if(_0x1fb727[_0x5cd3('0x74')]){_0x1fb727['joins']=JSON[_0x5cd3('0x75')](_0x1fb727[_0x5cd3('0x74')]);for(var _0x4f5d00=0x0;_0x4f5d00<_0x1fb727[_0x5cd3('0x74')][_0x5cd3('0x30')];_0x4f5d00+=0x1){if(_0x1fb727[_0x5cd3('0x74')][_0x4f5d00][_0x5cd3('0x39')]&&_[_0x5cd3('0x5d')](_0x3b8d63,_0x1fb727['joins'][_0x4f5d00][_0x5cd3('0x39')])&&_0x1fb727['joins'][_0x4f5d00][_0x5cd3('0x76')]&&_0x1fb727[_0x5cd3('0x74')][_0x4f5d00][_0x5cd3('0x77')]&&_0x1fb727[_0x5cd3('0x74')][_0x4f5d00][_0x5cd3('0x78')]){_0x316731[_0x1fb727[_0x5cd3('0x74')][_0x4f5d00][_0x5cd3('0x39')]](_0x1fb727['joins'][_0x4f5d00][_0x5cd3('0x77')],null,util[_0x5cd3('0x6f')](_0x5cd3('0x79'),_0x1fb727['table'],_0x1fb727[_0x5cd3('0x74')][_0x4f5d00]['parentKey'],_0x1fb727[_0x5cd3('0x74')][_0x4f5d00][_0x5cd3('0x77')],_0x1fb727['joins'][_0x4f5d00][_0x5cd3('0x78')]));}}}if(_0x1fb727['conditions']){_0x1fb727[_0x5cd3('0x7a')]=JSON[_0x5cd3('0x75')](_0x1fb727['conditions']);_0x316731['where'](_0x392c75(_0x1fb727[_0x5cd3('0x7a')]['group']));}_0x4a6f4d=_0x316731['clone']();_0x316731['limit'](_0x3bb626);_0x316731[_0x5cd3('0x1a')](0x0);logger['debug'](_0x5cd3('0x7b'),_0x316731['toString']());return db[_0x5cd3('0x7d')]['query'](_0x316731[_0x5cd3('0x7c')](),{'type':db[_0x5cd3('0x7d')]['QueryTypes'][_0x5cd3('0x7f')]});}})[_0x5cd3('0x21')](function(_0x33cdc8){if(!_0x33cdc8[_0x5cd3('0x30')]){throw new db[(_0x5cd3('0x65'))][(_0x5cd3('0x66'))](_0x5cd3('0x88'),0xcc);}if(_0x4295f1['output']===_0x5cd3('0x89')){return null;}var _0x43d794=_['merge'](_0x4295f1,{'name':_0x4295f1[_0x5cd3('0x8a')]||_0x4295f1['name']||_0x1fb727[_0x5cd3('0x26')],'basename':_0x52f720,'savename':util[_0x5cd3('0x6f')]('%s-%s.%s',_0x4295f1[_0x5cd3('0x26')]||_0x1fb727[_0x5cd3('0x26')],require('randomstring')[_0x5cd3('0x8b')](0x4),_0x4295f1['output']||_0x5cd3('0x8c')),'reportId':_0x1fb727['id'],'reportType':_0x5cd3('0x8d')});return db[_0x5cd3('0x8e')][_0x5cd3('0x47')](_0x43d794,{'raw':!![]});})[_0x5cd3('0x21')](function(_0x309588){if(_0x1fb727[_0x5cd3('0x6a')]===_0x5cd3('0x8f')){_0x4a6f4d[_0x5cd3('0x35')](_0x1fb727['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4295f1[_0x5cd3('0x90')],_0x4295f1['endDate']);}else{_0x4a6f4d[_0x5cd3('0x35')](_0x1fb727[_0x5cd3('0x6a')]+_0x5cd3('0x91'),_0x4295f1[_0x5cd3('0x90')],_0x4295f1[_0x5cd3('0x92')]);}if(_0x309588){logger['info'](_0x5cd3('0x93'),_0x4a6f4d['toString']());require(_0x5cd3('0x94'))[_0x5cd3('0x95')](path[_0x5cd3('0x51')](__dirname,_0x5cd3('0x96'),_0x309588['output']),[_0x309588['id'],_0x4a6f4d[_0x5cd3('0x7c')](),path['join'](__dirname,'../../files/reports',_0x309588[_0x5cd3('0x97')]),_0x52f720]);return _0x309588;}else{var _0x262918=squel[_0x5cd3('0x69')]();_0x262918['from']('('+_0x4a6f4d[_0x5cd3('0x7c')]()+')','countTable');_0x262918[_0x5cd3('0x3c')](_0x5cd3('0x98'),_0x5cd3('0x19'));_0x4a6f4d[_0x5cd3('0x1b')](_0x4295f1[_0x5cd3('0x1b')]||_0x3bb626);_0x4a6f4d[_0x5cd3('0x1a')](_0x4295f1['offset']||0x0);return db[_0x5cd3('0x7d')][_0x5cd3('0x2a')](_0x262918[_0x5cd3('0x7c')](),{'type':db[_0x5cd3('0x7d')]['QueryTypes'][_0x5cd3('0x7f')]})[_0x5cd3('0x21')](function(_0x5397aa){if(!_0x5397aa[_0x5cd3('0x30')]){_0xeb9bc1=0x0;}else{_0xeb9bc1=_0x5397aa[0x0][_0x5cd3('0x19')]||0x0;}return db[_0x5cd3('0x7d')][_0x5cd3('0x2a')](_0x4a6f4d[_0x5cd3('0x7c')](),{'type':db[_0x5cd3('0x7d')]['QueryTypes'][_0x5cd3('0x7f')]});})[_0x5cd3('0x21')](function(_0x210a6b){return{'rows':_0x210a6b||[],'count':_0xeb9bc1};});}});}exports[_0x5cd3('0x99')]=function(_0x3a24bc,_0x56f210){return runReport(_0x3a24bc[_0x5cd3('0x43')],_0x3a24bc[_0x5cd3('0x2a')],_0x3a24bc['options'])[_0x5cd3('0x21')](respondWithResult(_0x56f210,null))[_0x5cd3('0x46')](handleError(_0x56f210,null));};exports[_0x5cd3('0x9a')]=runReport;exports[_0x5cd3('0x2a')]=function(_0x208890,_0x310061){var _0x5e4260=0xa;var _0x5bfe6d=[_0x5cd3('0x51'),_0x5cd3('0x80'),_0x5cd3('0x52'),_0x5cd3('0x53')];var _0x55040b={'SUM':'SUM(%s)','COUNT':_0x5cd3('0x54'),'COUNT DISTINCT':_0x5cd3('0x55'),'MAX':'MAX(%s)','MIN':_0x5cd3('0x82'),'AVG':_0x5cd3('0x9b'),'GROUP_CONCAT':_0x5cd3('0x57'),'GROUP_CONCAT ASC':_0x5cd3('0x83'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x200ae1={'SEC_TO_TIME':_0x5cd3('0x58'),'DATE':_0x5cd3('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x5cd3('0x5b'),'UNIX_TIMESTAMP':_0x5cd3('0x5c')};var _0x5a872a=function(_0x558d90){return!_[_0x5cd3('0x5d')]([_0x5cd3('0x5e'),'IS\x20NOT\x20NULL',_0x5cd3('0x60'),_0x5cd3('0x84')],_0x558d90);};var _0x6ff8d1=function(_0x3f969a){if(!_0x3f969a||!_0x3f969a['rules']['length']){return'';}for(var _0x1da888='(',_0x5ffe3c=0x0;_0x5ffe3c<_0x3f969a[_0x5cd3('0x61')][_0x5cd3('0x30')];_0x5ffe3c+=0x1){_0x5ffe3c>0x0&&(_0x1da888+='\x20'+_0x3f969a[_0x5cd3('0x9c')]+'\x20');_0x1da888+=_0x3f969a[_0x5cd3('0x61')][_0x5ffe3c][_0x5cd3('0x62')]?_0x6ff8d1(_0x3f969a['rules'][_0x5ffe3c]['group']):_0x3f969a['rules'][_0x5ffe3c][_0x5cd3('0x3c')]+'\x20'+_0x3f969a[_0x5cd3('0x61')][_0x5ffe3c]['condition']+(_0x5a872a(_0x3f969a[_0x5cd3('0x61')][_0x5ffe3c][_0x5cd3('0x63')])?'\x20'+_0x3f969a['rules'][_0x5ffe3c][_0x5cd3('0x64')]:'');}return _0x1da888+')';};var _0x33b158={'where':{'id':_0x208890[_0x5cd3('0x43')]['id']}},_0x97b8ec,_0x1fceb8,_0x2bc186,_0x40edf2,_0x2b7089;_0x33b158=_[_0x5cd3('0x37')]({},_0x33b158,_0x208890['options']);return db[_0x5cd3('0x28')][_0x5cd3('0x45')](_0x33b158)['then'](function(_0x850ac9){if(_0x850ac9){_0x97b8ec=_0x850ac9;return _0x850ac9['getFields']();}return null;})[_0x5cd3('0x21')](function(_0x50a19d){if(_0x50a19d){if(!_0x50a19d[_0x5cd3('0x30')]){throw new db[(_0x5cd3('0x65'))][(_0x5cd3('0x66'))](_0x5cd3('0x67'),0x193);}_0x1fceb8=_0x50a19d;return db[_0x5cd3('0x86')]['findAll']({'raw':!![]});}return null;})[_0x5cd3('0x21')](function(_0x55753f){if(_0x55753f){_0x2bc186=_[_0x5cd3('0x68')](_0x55753f,'id');var _0x48a943;var _0x59f0cd=squel[_0x5cd3('0x69')]();_0x59f0cd[_0x5cd3('0x87')](_0x97b8ec['table']);for(var _0x2cdb67=0x0;_0x2cdb67<_0x1fceb8[_0x5cd3('0x30')];_0x2cdb67+=0x1){_0x48a943=_0x1fceb8[_0x2cdb67]['MetricId']?_0x2bc186[_0x1fceb8[_0x2cdb67][_0x5cd3('0x6b')]][_0x5cd3('0x6c')]:_0x1fceb8[_0x2cdb67]['field'];_0x48a943=_0x1fceb8[_0x2cdb67][_0x5cd3('0x6d')]?_[_0x5cd3('0x6e')](_0x55040b[_0x1fceb8[_0x2cdb67][_0x5cd3('0x6d')]],'%s',_0x48a943):_0x48a943;_0x48a943=_0x1fceb8[_0x2cdb67][_0x5cd3('0x6f')]?_['replace'](_0x200ae1[_0x1fceb8[_0x2cdb67]['format']],'%s',_0x48a943):_0x48a943;if(_0x1fceb8[_0x2cdb67][_0x5cd3('0x70')]){_0x59f0cd[_0x5cd3('0x62')](_0x48a943);}_0x1fceb8[_0x2cdb67][_0x5cd3('0x71')]&&_0x59f0cd[_0x5cd3('0x33')](_0x48a943,_0x1fceb8[_0x2cdb67]['orderBy']===_0x5cd3('0x72')?![]:!![]);_0x59f0cd[_0x5cd3('0x3c')](_0x48a943,_0x1fceb8[_0x2cdb67][_0x5cd3('0x73')]||_0x48a943);}if(_0x97b8ec[_0x5cd3('0x74')]){_0x97b8ec[_0x5cd3('0x74')]=JSON['parse'](_0x97b8ec['joins']);for(var _0x24b10f=0x0;_0x24b10f<_0x97b8ec[_0x5cd3('0x74')]['length'];_0x24b10f+=0x1){if(_0x97b8ec[_0x5cd3('0x74')][_0x24b10f][_0x5cd3('0x39')]&&_[_0x5cd3('0x5d')](_0x5bfe6d,_0x97b8ec['joins'][_0x24b10f]['type'])&&_0x97b8ec[_0x5cd3('0x74')][_0x24b10f][_0x5cd3('0x76')]&&_0x97b8ec['joins'][_0x24b10f]['foreignTable']&&_0x97b8ec[_0x5cd3('0x74')][_0x24b10f][_0x5cd3('0x78')]){_0x59f0cd[_0x97b8ec[_0x5cd3('0x74')][_0x24b10f]['type']](_0x97b8ec[_0x5cd3('0x74')][_0x24b10f][_0x5cd3('0x77')],null,util[_0x5cd3('0x6f')](_0x5cd3('0x79'),_0x97b8ec['table'],_0x97b8ec[_0x5cd3('0x74')][_0x24b10f][_0x5cd3('0x76')],_0x97b8ec[_0x5cd3('0x74')][_0x24b10f][_0x5cd3('0x77')],_0x97b8ec[_0x5cd3('0x74')][_0x24b10f][_0x5cd3('0x78')]));}}}if(_0x97b8ec['conditions']){_0x97b8ec[_0x5cd3('0x7a')]=JSON[_0x5cd3('0x75')](_0x97b8ec[_0x5cd3('0x7a')]);_0x59f0cd['where'](_0x6ff8d1(_0x97b8ec['conditions'][_0x5cd3('0x62')]));}_0x2b7089=_0x59f0cd[_0x5cd3('0x9d')]();_0x59f0cd[_0x5cd3('0x1b')](_0x5e4260);_0x59f0cd[_0x5cd3('0x1a')](0x0);logger[_0x5cd3('0x9e')]('Limited\x20Query:',_0x59f0cd[_0x5cd3('0x7c')]());return db[_0x5cd3('0x7d')][_0x5cd3('0x2a')](_0x59f0cd[_0x5cd3('0x7c')](),{'type':db[_0x5cd3('0x7d')][_0x5cd3('0x7e')][_0x5cd3('0x7f')]});}})['then'](function(){return{'sql':_0x2b7089[_0x5cd3('0x7c')]()};})[_0x5cd3('0x21')](respondWithResult(_0x310061,null))[_0x5cd3('0x46')](handleError(_0x310061,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index bd9a95d..5045d7a 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 _0xa814=['analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x2d0d97,_0x2d9560){var _0xfb96e9=function(_0x52a340){while(--_0x52a340){_0x2d0d97['push'](_0x2d0d97['shift']());}};_0xfb96e9(++_0x2d9560);}(_0xa814,0x1a3));var _0x4a81=function(_0x20dc74,_0x309f67){_0x20dc74=_0x20dc74-0x0;var _0x31490a=_0xa814[_0x20dc74];return _0x31490a;};'use strict';var _=require(_0x4a81('0x0'));var util=require(_0x4a81('0x1'));var logger=require(_0x4a81('0x2'))(_0x4a81('0x3'));var moment=require(_0x4a81('0x4'));var BPromise=require(_0x4a81('0x5'));var rp=require(_0x4a81('0x6'));var attributes=require(_0x4a81('0x7'));module[_0x4a81('0x8')]=function(_0x18b87a,_0x5cd61b){return _0x18b87a['define'](_0x4a81('0x9'),attributes,{'tableName':_0x4a81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e55=['bluebird','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7e55,0x74));var _0x57e5=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x7e55[_0x4812e0];return _0x252e0f;};'use strict';var _=require('lodash');var util=require(_0x57e5('0x0'));var logger=require(_0x57e5('0x1'))(_0x57e5('0x2'));var moment=require(_0x57e5('0x3'));var BPromise=require(_0x57e5('0x4'));var rp=require('request-promise');var attributes=require(_0x57e5('0x5'));module[_0x57e5('0x6')]=function(_0x5e4cc8,_0x74628d){return _0x5e4cc8[_0x57e5('0x7')](_0x57e5('0x8'),attributes,{'tableName':_0x57e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index c601c5d..7481bfd 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(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3819d4,_0x37a30e){_0x3819d4=_0x3819d4-0x0;var _0x4cc81d=_0xf4eb[_0x3819d4];return _0x4cc81d;};'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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','util'];(function(_0x4bbcbb,_0xe1a735){var _0x53b773=function(_0xa8b5b2){while(--_0xa8b5b2){_0x4bbcbb['push'](_0x4bbcbb['shift']());}};_0x53b773(++_0xe1a735);}(_0xedd9,0xfc));var _0x9edd=function(_0x49c453,_0x1b4554){_0x49c453=_0x49c453-0x0;var _0x1c1900=_0xedd9[_0x49c453];return _0x1c1900;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 51f0bf2..7370a88 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 _0x8f96=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','run','query','post','create','put','update'];(function(_0x1780d4,_0x1406d6){var _0x46dcac=function(_0x151005){while(--_0x151005){_0x1780d4['push'](_0x1780d4['shift']());}};_0x46dcac(++_0x1406d6);}(_0x8f96,0x10b));var _0x68f9=function(_0x326526,_0x2e995b){_0x326526=_0x326526-0x0;var _0x2456c3=_0x8f96[_0x326526];return _0x2456c3;};'use strict';var multer=require(_0x68f9('0x0'));var util=require('util');var path=require(_0x68f9('0x1'));var timeout=require(_0x68f9('0x2'));var express=require(_0x68f9('0x3'));var router=express[_0x68f9('0x4')]();var auth=require(_0x68f9('0x5'));var interaction=require(_0x68f9('0x6'));var config=require(_0x68f9('0x7'));var controller=require(_0x68f9('0x8'));router[_0x68f9('0x9')]('/',auth[_0x68f9('0xa')](),controller[_0x68f9('0xb')]);router[_0x68f9('0x9')](_0x68f9('0xc'),auth[_0x68f9('0xa')](),controller[_0x68f9('0xd')]);router['get']('/:id/preview',auth[_0x68f9('0xa')](),controller[_0x68f9('0xe')]);router[_0x68f9('0x9')]('/:id/run',auth[_0x68f9('0xa')](),controller[_0x68f9('0xf')]);router['get']('/:id/query',auth[_0x68f9('0xa')](),controller[_0x68f9('0x10')]);router[_0x68f9('0x11')]('/',auth[_0x68f9('0xa')](),controller[_0x68f9('0x12')]);router[_0x68f9('0x13')](_0x68f9('0xc'),auth['isAuthenticated'](),controller[_0x68f9('0x14')]);router[_0x68f9('0x15')](_0x68f9('0xc'),auth['isAuthenticated'](),controller[_0x68f9('0x16')]);module[_0x68f9('0x17')]=router; \ No newline at end of file +var _0x0d77=['run','query','create','/:id','update','destroy','path','connect-timeout','express','Router','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','show','/:id/preview','/:id/run'];(function(_0x4be39b,_0x2f7138){var _0x176cbb=function(_0x5c7031){while(--_0x5c7031){_0x4be39b['push'](_0x4be39b['shift']());}};_0x176cbb(++_0x2f7138);}(_0x0d77,0xd2));var _0x70d7=function(_0x816945,_0x72dc9f){_0x816945=_0x816945-0x0;var _0x3080aa=_0x0d77[_0x816945];return _0x3080aa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x70d7('0x0'));var timeout=require(_0x70d7('0x1'));var express=require(_0x70d7('0x2'));var router=express[_0x70d7('0x3')]();var auth=require(_0x70d7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x70d7('0x5'));router[_0x70d7('0x6')]('/',auth[_0x70d7('0x7')](),controller['index']);router[_0x70d7('0x6')]('/:id',auth[_0x70d7('0x7')](),controller[_0x70d7('0x8')]);router['get'](_0x70d7('0x9'),auth[_0x70d7('0x7')](),controller['preview']);router['get'](_0x70d7('0xa'),auth[_0x70d7('0x7')](),controller[_0x70d7('0xb')]);router[_0x70d7('0x6')]('/:id/query',auth[_0x70d7('0x7')](),controller[_0x70d7('0xc')]);router['post']('/',auth[_0x70d7('0x7')](),controller[_0x70d7('0xd')]);router['put'](_0x70d7('0xe'),auth[_0x70d7('0x7')](),controller[_0x70d7('0xf')]);router['delete']('/:id',auth[_0x70d7('0x7')](),controller[_0x70d7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 5c07edb..1a49728 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 _0xaee2=['DATE','Loading','manual','INTEGER','UNSIGNED','moment','STRING','ENUM','csv','pdf','xlsx'];(function(_0x66ce8f,_0xaf29fc){var _0x128d6c=function(_0xb724e9){while(--_0xb724e9){_0x66ce8f['push'](_0x66ce8f['shift']());}};_0x128d6c(++_0xaf29fc);}(_0xaee2,0xe1));var _0x2aee=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xaee2[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2aee('0x0'));module['exports']={'name':{'type':Sequelize[_0x2aee('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x2aee('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x2aee('0x2')](_0x2aee('0x3'),_0x2aee('0x4'),_0x2aee('0x5')),'allowNull':![],'defaultValue':_0x2aee('0x3')},'savename':{'type':Sequelize[_0x2aee('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x2aee('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x2aee('0x7')},'type':{'type':Sequelize['ENUM'](_0x2aee('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x2aee('0x8')},'reportId':{'type':Sequelize[_0x2aee('0x9')](0xb)[_0x2aee('0xa')]},'reportType':{'type':Sequelize[_0x2aee('0x1')]}}; \ No newline at end of file +var _0x5fc7=['ENUM','csv','pdf','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fc7,0xce));var _0x75fc=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x5fc7[_0x16dbfd];return _0x382254;};'use strict';var Sequelize=require(_0x75fc('0x0'));var moment=require('moment');module[_0x75fc('0x1')]={'name':{'type':Sequelize[_0x75fc('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x75fc('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x75fc('0x3')](_0x75fc('0x4'),_0x75fc('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x75fc('0x4')},'savename':{'type':Sequelize[_0x75fc('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x75fc('0x6')]},'endDate':{'type':Sequelize[_0x75fc('0x6')]},'status':{'type':Sequelize[_0x75fc('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x75fc('0x3')](_0x75fc('0x7'),_0x75fc('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x75fc('0x9')](0xb)[_0x75fc('0xa')]},'reportType':{'type':Sequelize[_0x75fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c23e7d0..7d3126f 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 _0x8be7=['lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','where','merge','map','key','VIRTUAL','filter','count','includeAll','findAll','rows','catch','show','params','AnalyticExtractedReport','length','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','exists','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs'];(function(_0x503bf0,_0x22e46f){var _0x1f10dc=function(_0x57da13){while(--_0x57da13){_0x503bf0['push'](_0x503bf0['shift']());}};_0x1f10dc(++_0x22e46f);}(_0x8be7,0x111));var _0x78be=function(_0x4a3ee3,_0x304512){_0x4a3ee3=_0x4a3ee3-0x0;var _0x56d16d=_0x8be7[_0x4a3ee3];return _0x56d16d;};'use strict';var pdf=require(_0x78be('0x0'));var emlformat=require(_0x78be('0x1'));var rimraf=require(_0x78be('0x2'));var zipdir=require(_0x78be('0x3'));var jsonpatch=require(_0x78be('0x4'));var rp=require(_0x78be('0x5'));var moment=require(_0x78be('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x78be('0x7'));var util=require(_0x78be('0x8'));var path=require(_0x78be('0x9'));var sox=require('sox');var csv=require(_0x78be('0xa'));var ejs=require(_0x78be('0xb'));var fs=require('fs');var _=require(_0x78be('0xc'));var squel=require('squel');var crypto=require(_0x78be('0xd'));var jsforce=require(_0x78be('0xe'));var deskjs=require(_0x78be('0xf'));var toCsv=require('to-csv');var querystring=require(_0x78be('0x10'));var Papa=require('papaparse');var authService=require(_0x78be('0x11'));var hardwareService=require(_0x78be('0x12'));var Redis=require(_0x78be('0x13'));var qs=require(_0x78be('0x14'));var logger=require('../../config/logger')(_0x78be('0x15'));var utils=require(_0x78be('0x16'));var config=require(_0x78be('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1603ad,_0x190886){_0x190886=_0x190886||0xcc;return function(_0x1e7756){if(_0x1e7756){return _0x1603ad[_0x78be('0x18')](_0x190886);}return _0x1603ad[_0x78be('0x19')](_0x190886)['end']();};}function respondWithResult(_0x42e37e,_0x55da1d){_0x55da1d=_0x55da1d||0xc8;return function(_0x434b9b){if(_0x434b9b){return _0x42e37e[_0x78be('0x19')](_0x55da1d)[_0x78be('0x1a')](_0x434b9b);}};}function respondWithFilteredResult(_0x482f4c,_0x209caf){return function(_0x126131){if(_0x126131){var _0x3a8087=_0x126131['count'],_0x1f3dd0=_0x209caf[_0x78be('0x1b')],_0x57488f=_0x209caf['offset']+_0x209caf['limit'],_0x55621c;if(_0x57488f>=_0x3a8087){_0x57488f=_0x3a8087;_0x55621c=0xc8;}else{_0x55621c=0xce;}_0x482f4c[_0x78be('0x19')](_0x55621c);return _0x482f4c[_0x78be('0x1c')](_0x78be('0x1d'),_0x1f3dd0+'-'+_0x57488f+'/'+_0x3a8087)[_0x78be('0x1a')](_0x126131);}return null;};}function patchUpdates(_0x1c9ca0){return function(_0x23d1de){try{jsonpatch[_0x78be('0x1e')](_0x23d1de,_0x1c9ca0,!![]);}catch(_0x431d7c){return BPromise[_0x78be('0x1f')](_0x431d7c);}return _0x23d1de[_0x78be('0x20')]();};}function saveUpdates(_0x3bf533,_0x24fc70){return function(_0x2b4dcd){if(_0x2b4dcd){return _0x2b4dcd[_0x78be('0x21')](_0x3bf533)[_0x78be('0x22')](function(_0x2b1c90){return _0x2b1c90;});}return null;};}function removeEntity(_0x19d6c0,_0x5462c4){return function(_0x258f43){if(_0x258f43){return _0x258f43[_0x78be('0x23')]()[_0x78be('0x22')](function(){var _0x59b268=_0x258f43[_0x78be('0x24')]({'plain':!![]});var _0xe4deb0=_0x78be('0x25');return db[_0x78be('0x26')]['destroy']({'where':{'type':_0xe4deb0,'resourceId':_0x59b268['id']}})[_0x78be('0x22')](function(){return _0x258f43;});})['then'](function(){_0x19d6c0[_0x78be('0x19')](0xcc)[_0x78be('0x27')]();});}};}function handleEntityNotFound(_0x21e76c,_0x4ba1ec){return function(_0x38c3e9){if(!_0x38c3e9){_0x21e76c[_0x78be('0x18')](0x194);}return _0x38c3e9;};}function handleError(_0x3414b6,_0x327d40){_0x327d40=_0x327d40||0x1f4;return function(_0x11e32b){logger[_0x78be('0x28')](_0x11e32b[_0x78be('0x29')]);if(_0x11e32b[_0x78be('0x2a')]){delete _0x11e32b[_0x78be('0x2a')];}_0x3414b6[_0x78be('0x19')](_0x327d40)[_0x78be('0x2b')](_0x11e32b);};}exports[_0x78be('0x2c')]=function(_0x5548c1,_0x7f7f49){var _0x4c8b8d={},_0x135768={},_0xe485cd={'count':0x0,'rows':[]};var _0x415abb=db['AnalyticExtractedReport'][_0x78be('0x2d')];_0x135768[_0x78be('0x2e')]=_['keys'](_0x415abb);_0x135768['query']=_[_0x78be('0x2f')](_0x5548c1[_0x78be('0x30')]);_0x135768[_0x78be('0x31')]=_[_0x78be('0x32')](_0x135768[_0x78be('0x2e')],_0x135768['query']);_0x4c8b8d[_0x78be('0x33')]=_[_0x78be('0x32')](_0x135768[_0x78be('0x2e')],qs[_0x78be('0x34')](_0x5548c1[_0x78be('0x30')][_0x78be('0x34')]));_0x4c8b8d[_0x78be('0x33')]=_0x4c8b8d[_0x78be('0x33')]['length']?_0x4c8b8d['attributes']:_0x135768[_0x78be('0x2e')];if(!_0x5548c1[_0x78be('0x30')]['hasOwnProperty'](_0x78be('0x35'))){_0x4c8b8d['limit']=qs[_0x78be('0x36')](_0x5548c1[_0x78be('0x30')][_0x78be('0x36')]);_0x4c8b8d[_0x78be('0x1b')]=qs[_0x78be('0x1b')](_0x5548c1['query'][_0x78be('0x1b')]);}_0x4c8b8d[_0x78be('0x37')]=qs[_0x78be('0x38')](_0x5548c1[_0x78be('0x30')][_0x78be('0x38')]);_0x4c8b8d['where']=qs['filters'](_[_0x78be('0x39')](_0x5548c1[_0x78be('0x30')],_0x135768[_0x78be('0x31')]));if(_0x5548c1[_0x78be('0x30')]['filter']){_0x4c8b8d[_0x78be('0x3a')]=_[_0x78be('0x3b')](_0x4c8b8d[_0x78be('0x3a')],{'$or':_[_0x78be('0x3c')](_0x415abb,function(_0x5cc5c0){if(_0x5cc5c0['type'][_0x78be('0x3d')]!==_0x78be('0x3e')){var _0x4fcee8={};_0x4fcee8[_0x5cc5c0['field']]={'$like':'%'+_0x5548c1[_0x78be('0x30')][_0x78be('0x3f')]+'%'};return _0x4fcee8;}})});}_0x4c8b8d=_[_0x78be('0x3b')]({},_0x4c8b8d,_0x5548c1['options']);var _0xcad331={'where':_0x4c8b8d[_0x78be('0x3a')]};return db['AnalyticExtractedReport'][_0x78be('0x40')](_0xcad331)[_0x78be('0x22')](function(_0x59e945){_0xe485cd[_0x78be('0x40')]=_0x59e945;if(_0x5548c1[_0x78be('0x30')][_0x78be('0x41')]){_0x4c8b8d['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x78be('0x42')](_0x4c8b8d);})[_0x78be('0x22')](function(_0x4754e3){_0xe485cd[_0x78be('0x43')]=_0x4754e3;return _0xe485cd;})[_0x78be('0x22')](respondWithFilteredResult(_0x7f7f49,_0x4c8b8d))[_0x78be('0x44')](handleError(_0x7f7f49,null));};exports[_0x78be('0x45')]=function(_0xcd6baa,_0x17d9ad){var _0x7ba0ae={'raw':!![],'where':{'id':_0xcd6baa[_0x78be('0x46')]['id']}},_0x4ec7d6={};_0x4ec7d6[_0x78be('0x2e')]=_[_0x78be('0x2f')](db[_0x78be('0x47')][_0x78be('0x2d')]);_0x4ec7d6[_0x78be('0x30')]=_['keys'](_0xcd6baa[_0x78be('0x30')]);_0x4ec7d6['filters']=_[_0x78be('0x32')](_0x4ec7d6[_0x78be('0x2e')],_0x4ec7d6[_0x78be('0x30')]);_0x7ba0ae[_0x78be('0x33')]=_['intersection'](_0x4ec7d6['model'],qs[_0x78be('0x34')](_0xcd6baa['query'][_0x78be('0x34')]));_0x7ba0ae['attributes']=_0x7ba0ae[_0x78be('0x33')][_0x78be('0x48')]?_0x7ba0ae[_0x78be('0x33')]:_0x4ec7d6['model'];if(_0xcd6baa[_0x78be('0x30')][_0x78be('0x41')]){_0x7ba0ae['include']=[{'all':!![]}];}_0x7ba0ae=_[_0x78be('0x3b')]({},_0x7ba0ae,_0xcd6baa[_0x78be('0x49')]);return db[_0x78be('0x47')][_0x78be('0x4a')](_0x7ba0ae)[_0x78be('0x22')](handleEntityNotFound(_0x17d9ad,null))[_0x78be('0x22')](respondWithResult(_0x17d9ad,null))[_0x78be('0x44')](handleError(_0x17d9ad,null));};exports[_0x78be('0x4b')]=function(_0x59b515,_0x3ab581){return db[_0x78be('0x47')][_0x78be('0x4b')](_0x59b515[_0x78be('0x4c')],{})[_0x78be('0x22')](function(_0x55cf27){var _0x397ff7=_0x59b515[_0x78be('0x4d')][_0x78be('0x24')]({'plain':!![]});if(!_0x397ff7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x397ff7[_0x78be('0x4e')]==='user'){var _0x50536b=_0x55cf27[_0x78be('0x24')]({'plain':!![]});var _0x4ac12b=_0x78be('0x25');return db['UserProfileSection'][_0x78be('0x4a')]({'where':{'name':_0x4ac12b,'userProfileId':_0x397ff7[_0x78be('0x4f')]},'raw':!![]})['then'](function(_0x59547a){if(_0x59547a&&_0x59547a[_0x78be('0x50')]===0x0){return db['UserProfileResource'][_0x78be('0x4b')]({'name':_0x50536b[_0x78be('0x2a')],'resourceId':_0x50536b['id'],'type':_0x59547a[_0x78be('0x2a')],'sectionId':_0x59547a['id']},{})['then'](function(){return _0x55cf27;});}else{return _0x55cf27;}})[_0x78be('0x44')](function(_0x223536){logger[_0x78be('0x28')](_0x78be('0x51'),_0x223536);throw _0x223536;});}return _0x55cf27;})[_0x78be('0x22')](respondWithResult(_0x3ab581,0xc9))[_0x78be('0x44')](handleError(_0x3ab581,null));};exports[_0x78be('0x21')]=function(_0x11d7ac,_0x2f2c61){if(_0x11d7ac[_0x78be('0x4c')]['id']){delete _0x11d7ac[_0x78be('0x4c')]['id'];}return db[_0x78be('0x47')][_0x78be('0x4a')]({'where':{'id':_0x11d7ac[_0x78be('0x46')]['id']}})[_0x78be('0x22')](handleEntityNotFound(_0x2f2c61,null))[_0x78be('0x22')](saveUpdates(_0x11d7ac['body'],null))[_0x78be('0x22')](respondWithResult(_0x2f2c61,null))[_0x78be('0x44')](handleError(_0x2f2c61,null));};exports[_0x78be('0x23')]=function(_0x292a32,_0x5647f8){return db[_0x78be('0x47')][_0x78be('0x4a')]({'where':{'id':_0x292a32['params']['id']}})[_0x78be('0x22')](handleEntityNotFound(_0x5647f8,null))[_0x78be('0x22')](removeEntity(_0x5647f8,null))[_0x78be('0x44')](handleError(_0x5647f8,null));};exports[_0x78be('0x52')]=function(_0x1f1466,_0xa13e6b,_0x56523a){return db[_0x78be('0x47')][_0x78be('0x4a')]({'where':{'id':_0x1f1466[_0x78be('0x46')]['id']},'attributes':['name',_0x78be('0x53'),'savename',_0x78be('0x54')],'raw':!![]})[_0x78be('0x22')](handleEntityNotFound(_0xa13e6b,null))[_0x78be('0x22')](function(_0x2a2a60){if(_0x2a2a60){if(!fs[_0x78be('0x55')](path[_0x78be('0x56')](config[_0x78be('0x57')],_0x78be('0x58'),_0x2a2a60[_0x78be('0x59')]))){throw new db['Sequelize'][(_0x78be('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x1f1466[_0x78be('0x30')][_0x78be('0x5b')]){return _0xa13e6b['sendStatus'](0xc8);}return _0xa13e6b[_0x78be('0x52')](path[_0x78be('0x56')](config['root'],_0x78be('0x58'),_0x2a2a60[_0x78be('0x59')]),util[_0x78be('0x5c')](_0x78be('0x5d'),_0x2a2a60[_0x78be('0x53')]||_0x2a2a60[_0x78be('0x2a')],_0x2a2a60[_0x78be('0x54')][_0x78be('0x5e')]()));}})['catch'](handleError(_0xa13e6b,null));}; \ No newline at end of file +var _0xcef5=['ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','destroy','get','ExtractedReports','error','name','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','field','AnalyticExtractedReport','includeAll','findAll','rows','catch','show','params','intersection','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','root','Sequelize','ValidationError','exists','join','server/files/reports','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x147cb3,_0x560f5c){var _0x5abb5c=function(_0x592a85){while(--_0x592a85){_0x147cb3['push'](_0x147cb3['shift']());}};_0x5abb5c(++_0x560f5c);}(_0xcef5,0x179));var _0x5cef=function(_0x2318cb,_0x3c9f16){_0x2318cb=_0x2318cb-0x0;var _0x6440f5=_0xcef5[_0x2318cb];return _0x6440f5;};'use strict';var pdf=require(_0x5cef('0x0'));var emlformat=require(_0x5cef('0x1'));var rimraf=require(_0x5cef('0x2'));var zipdir=require(_0x5cef('0x3'));var jsonpatch=require(_0x5cef('0x4'));var rp=require(_0x5cef('0x5'));var moment=require('moment');var BPromise=require(_0x5cef('0x6'));var Mustache=require(_0x5cef('0x7'));var util=require(_0x5cef('0x8'));var path=require(_0x5cef('0x9'));var sox=require(_0x5cef('0xa'));var csv=require('to-csv');var ejs=require(_0x5cef('0xb'));var fs=require('fs');var _=require(_0x5cef('0xc'));var squel=require('squel');var crypto=require(_0x5cef('0xd'));var jsforce=require(_0x5cef('0xe'));var deskjs=require(_0x5cef('0xf'));var toCsv=require(_0x5cef('0x10'));var querystring=require(_0x5cef('0x11'));var Papa=require(_0x5cef('0x12'));var authService=require(_0x5cef('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5cef('0x14'));var qs=require(_0x5cef('0x15'));var logger=require(_0x5cef('0x16'))('api');var utils=require(_0x5cef('0x17'));var config=require(_0x5cef('0x18'));var db=require(_0x5cef('0x19'))['db'];function respondWithStatusCode(_0x1e6e69,_0x56abd3){_0x56abd3=_0x56abd3||0xcc;return function(_0x385cc8){if(_0x385cc8){return _0x1e6e69[_0x5cef('0x1a')](_0x56abd3);}return _0x1e6e69[_0x5cef('0x1b')](_0x56abd3)[_0x5cef('0x1c')]();};}function respondWithResult(_0x21bc6a,_0x4a987f){_0x4a987f=_0x4a987f||0xc8;return function(_0x146d11){if(_0x146d11){return _0x21bc6a[_0x5cef('0x1b')](_0x4a987f)[_0x5cef('0x1d')](_0x146d11);}};}function respondWithFilteredResult(_0x29ab61,_0x34b6ab){return function(_0x33988e){if(_0x33988e){var _0x2cba2d=_0x33988e[_0x5cef('0x1e')],_0xa8c13b=_0x34b6ab[_0x5cef('0x1f')],_0x2196bc=_0x34b6ab[_0x5cef('0x1f')]+_0x34b6ab['limit'],_0xbdd152;if(_0x2196bc>=_0x2cba2d){_0x2196bc=_0x2cba2d;_0xbdd152=0xc8;}else{_0xbdd152=0xce;}_0x29ab61['status'](_0xbdd152);return _0x29ab61[_0x5cef('0x20')]('Content-Range',_0xa8c13b+'-'+_0x2196bc+'/'+_0x2cba2d)[_0x5cef('0x1d')](_0x33988e);}return null;};}function patchUpdates(_0x3c3a8b){return function(_0x32b36d){try{jsonpatch[_0x5cef('0x21')](_0x32b36d,_0x3c3a8b,!![]);}catch(_0x56112e){return BPromise[_0x5cef('0x22')](_0x56112e);}return _0x32b36d[_0x5cef('0x23')]();};}function saveUpdates(_0x279b1c,_0x4850f4){return function(_0x4836a9){if(_0x4836a9){return _0x4836a9['update'](_0x279b1c)[_0x5cef('0x24')](function(_0x3115b1){return _0x3115b1;});}return null;};}function removeEntity(_0x53137f,_0x386e5e){return function(_0x535c5c){if(_0x535c5c){return _0x535c5c[_0x5cef('0x25')]()[_0x5cef('0x24')](function(){var _0x32b8ec=_0x535c5c[_0x5cef('0x26')]({'plain':!![]});var _0x3a1646=_0x5cef('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a1646,'resourceId':_0x32b8ec['id']}})[_0x5cef('0x24')](function(){return _0x535c5c;});})[_0x5cef('0x24')](function(){_0x53137f[_0x5cef('0x1b')](0xcc)[_0x5cef('0x1c')]();});}};}function handleEntityNotFound(_0x2369cf,_0x48ec2c){return function(_0x4ec969){if(!_0x4ec969){_0x2369cf[_0x5cef('0x1a')](0x194);}return _0x4ec969;};}function handleError(_0x184f3e,_0x41c460){_0x41c460=_0x41c460||0x1f4;return function(_0x5e13e3){logger[_0x5cef('0x28')](_0x5e13e3['stack']);if(_0x5e13e3['name']){delete _0x5e13e3[_0x5cef('0x29')];}_0x184f3e['status'](_0x41c460)[_0x5cef('0x2a')](_0x5e13e3);};}exports[_0x5cef('0x2b')]=function(_0x3c44dc,_0x7f0983){var _0xf91c99={},_0x2174db={},_0x50d77e={'count':0x0,'rows':[]};var _0x26799c=db['AnalyticExtractedReport'][_0x5cef('0x2c')];_0x2174db[_0x5cef('0x2d')]=_[_0x5cef('0x2e')](_0x26799c);_0x2174db[_0x5cef('0x2f')]=_[_0x5cef('0x2e')](_0x3c44dc['query']);_0x2174db[_0x5cef('0x30')]=_['intersection'](_0x2174db[_0x5cef('0x2d')],_0x2174db[_0x5cef('0x2f')]);_0xf91c99[_0x5cef('0x31')]=_['intersection'](_0x2174db[_0x5cef('0x2d')],qs[_0x5cef('0x32')](_0x3c44dc['query']['fields']));_0xf91c99['attributes']=_0xf91c99[_0x5cef('0x31')][_0x5cef('0x33')]?_0xf91c99[_0x5cef('0x31')]:_0x2174db[_0x5cef('0x2d')];if(!_0x3c44dc[_0x5cef('0x2f')][_0x5cef('0x34')](_0x5cef('0x35'))){_0xf91c99['limit']=qs[_0x5cef('0x36')](_0x3c44dc['query'][_0x5cef('0x36')]);_0xf91c99[_0x5cef('0x1f')]=qs[_0x5cef('0x1f')](_0x3c44dc[_0x5cef('0x2f')][_0x5cef('0x1f')]);}_0xf91c99[_0x5cef('0x37')]=qs[_0x5cef('0x38')](_0x3c44dc[_0x5cef('0x2f')][_0x5cef('0x38')]);_0xf91c99['where']=qs[_0x5cef('0x30')](_[_0x5cef('0x39')](_0x3c44dc[_0x5cef('0x2f')],_0x2174db[_0x5cef('0x30')]));if(_0x3c44dc[_0x5cef('0x2f')][_0x5cef('0x3a')]){_0xf91c99[_0x5cef('0x3b')]=_[_0x5cef('0x3c')](_0xf91c99[_0x5cef('0x3b')],{'$or':_[_0x5cef('0x3d')](_0x26799c,function(_0x5eff5b){if(_0x5eff5b[_0x5cef('0x3e')][_0x5cef('0x3f')]!=='VIRTUAL'){var _0xb587e={};_0xb587e[_0x5eff5b[_0x5cef('0x40')]]={'$like':'%'+_0x3c44dc[_0x5cef('0x2f')][_0x5cef('0x3a')]+'%'};return _0xb587e;}})});}_0xf91c99=_['merge']({},_0xf91c99,_0x3c44dc['options']);var _0x16ae96={'where':_0xf91c99[_0x5cef('0x3b')]};return db[_0x5cef('0x41')][_0x5cef('0x1e')](_0x16ae96)[_0x5cef('0x24')](function(_0x51a3e5){_0x50d77e['count']=_0x51a3e5;if(_0x3c44dc[_0x5cef('0x2f')][_0x5cef('0x42')]){_0xf91c99['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x5cef('0x43')](_0xf91c99);})[_0x5cef('0x24')](function(_0x51e242){_0x50d77e[_0x5cef('0x44')]=_0x51e242;return _0x50d77e;})[_0x5cef('0x24')](respondWithFilteredResult(_0x7f0983,_0xf91c99))[_0x5cef('0x45')](handleError(_0x7f0983,null));};exports[_0x5cef('0x46')]=function(_0x4e7a51,_0x5110b9){var _0x4c8013={'raw':!![],'where':{'id':_0x4e7a51[_0x5cef('0x47')]['id']}},_0x2538a1={};_0x2538a1[_0x5cef('0x2d')]=_[_0x5cef('0x2e')](db[_0x5cef('0x41')][_0x5cef('0x2c')]);_0x2538a1['query']=_[_0x5cef('0x2e')](_0x4e7a51['query']);_0x2538a1['filters']=_[_0x5cef('0x48')](_0x2538a1['model'],_0x2538a1[_0x5cef('0x2f')]);_0x4c8013['attributes']=_['intersection'](_0x2538a1['model'],qs[_0x5cef('0x32')](_0x4e7a51[_0x5cef('0x2f')][_0x5cef('0x32')]));_0x4c8013[_0x5cef('0x31')]=_0x4c8013[_0x5cef('0x31')]['length']?_0x4c8013['attributes']:_0x2538a1[_0x5cef('0x2d')];if(_0x4e7a51['query'][_0x5cef('0x42')]){_0x4c8013['include']=[{'all':!![]}];}_0x4c8013=_['merge']({},_0x4c8013,_0x4e7a51[_0x5cef('0x49')]);return db[_0x5cef('0x41')][_0x5cef('0x4a')](_0x4c8013)['then'](handleEntityNotFound(_0x5110b9,null))[_0x5cef('0x24')](respondWithResult(_0x5110b9,null))[_0x5cef('0x45')](handleError(_0x5110b9,null));};exports[_0x5cef('0x4b')]=function(_0x55a566,_0x2e62b3){return db[_0x5cef('0x41')][_0x5cef('0x4b')](_0x55a566[_0x5cef('0x4c')],{})[_0x5cef('0x24')](function(_0x1c4487){var _0x3bca11=_0x55a566['user'][_0x5cef('0x26')]({'plain':!![]});if(!_0x3bca11)throw new Error(_0x5cef('0x4d'));if(_0x3bca11[_0x5cef('0x4e')]==='user'){var _0x3667f8=_0x1c4487[_0x5cef('0x26')]({'plain':!![]});var _0x2c0bbe=_0x5cef('0x27');return db[_0x5cef('0x4f')][_0x5cef('0x4a')]({'where':{'name':_0x2c0bbe,'userProfileId':_0x3bca11['userProfileId']},'raw':!![]})[_0x5cef('0x24')](function(_0x2c1f68){if(_0x2c1f68&&_0x2c1f68[_0x5cef('0x50')]===0x0){return db[_0x5cef('0x51')][_0x5cef('0x4b')]({'name':_0x3667f8[_0x5cef('0x29')],'resourceId':_0x3667f8['id'],'type':_0x2c1f68['name'],'sectionId':_0x2c1f68['id']},{})[_0x5cef('0x24')](function(){return _0x1c4487;});}else{return _0x1c4487;}})[_0x5cef('0x45')](function(_0x17c64c){logger['error'](_0x5cef('0x52'),_0x17c64c);throw _0x17c64c;});}return _0x1c4487;})[_0x5cef('0x24')](respondWithResult(_0x2e62b3,0xc9))[_0x5cef('0x45')](handleError(_0x2e62b3,null));};exports[_0x5cef('0x53')]=function(_0x214919,_0x1a20f0){if(_0x214919[_0x5cef('0x4c')]['id']){delete _0x214919[_0x5cef('0x4c')]['id'];}return db[_0x5cef('0x41')][_0x5cef('0x4a')]({'where':{'id':_0x214919[_0x5cef('0x47')]['id']}})[_0x5cef('0x24')](handleEntityNotFound(_0x1a20f0,null))['then'](saveUpdates(_0x214919['body'],null))[_0x5cef('0x24')](respondWithResult(_0x1a20f0,null))[_0x5cef('0x45')](handleError(_0x1a20f0,null));};exports[_0x5cef('0x25')]=function(_0x109bd4,_0x2964b9){return db[_0x5cef('0x41')]['find']({'where':{'id':_0x109bd4[_0x5cef('0x47')]['id']}})['then'](handleEntityNotFound(_0x2964b9,null))[_0x5cef('0x24')](removeEntity(_0x2964b9,null))[_0x5cef('0x45')](handleError(_0x2964b9,null));};exports[_0x5cef('0x54')]=function(_0x4fe417,_0xec14e4,_0x48b9be){return db[_0x5cef('0x41')][_0x5cef('0x4a')]({'where':{'id':_0x4fe417[_0x5cef('0x47')]['id']},'attributes':[_0x5cef('0x29'),_0x5cef('0x55'),_0x5cef('0x56'),_0x5cef('0x57')],'raw':!![]})[_0x5cef('0x24')](handleEntityNotFound(_0xec14e4,null))[_0x5cef('0x24')](function(_0x4c88f5){if(_0x4c88f5){if(!fs['existsSync'](path['join'](config[_0x5cef('0x58')],'server/files/reports',_0x4c88f5['savename']))){throw new db[(_0x5cef('0x59'))][(_0x5cef('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4fe417[_0x5cef('0x2f')][_0x5cef('0x5b')]){return _0xec14e4['sendStatus'](0xc8);}return _0xec14e4[_0x5cef('0x54')](path[_0x5cef('0x5c')](config[_0x5cef('0x58')],_0x5cef('0x5d'),_0x4c88f5[_0x5cef('0x56')]),util[_0x5cef('0x5e')](_0x5cef('0x5f'),_0x4c88f5[_0x5cef('0x55')]||_0x4c88f5[_0x5cef('0x29')],_0x4c88f5[_0x5cef('0x57')][_0x5cef('0x60')]()));}})[_0x5cef('0x45')](handleError(_0xec14e4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f79ee61..7f27399 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 _0x90e0=['request-promise','./analyticExtractedReport.attributes','exports','util','../../config/logger','api','moment','bluebird'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x90e0,0xe3));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x090e('0x0'));var logger=require(_0x090e('0x1'))(_0x090e('0x2'));var moment=require(_0x090e('0x3'));var BPromise=require(_0x090e('0x4'));var rp=require(_0x090e('0x5'));var attributes=require(_0x090e('0x6'));module[_0x090e('0x7')]=function(_0x24bd63,_0x15c0ce){return _0x24bd63['define']('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c4d=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0xa3d9a7,_0x1cf219){_0xa3d9a7=_0xa3d9a7-0x0;var _0x48080a=_0x4c4d[_0xa3d9a7];return _0x48080a;};'use strict';var _=require(_0xd4c4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd4c4('0x1'));var rp=require('request-promise');var attributes=require(_0xd4c4('0x2'));module[_0xd4c4('0x3')]=function(_0x15c316,_0x1c3a01){return _0x15c316[_0xd4c4('0x4')](_0xd4c4('0x5'),attributes,{'tableName':'analytics_extracted_reports','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 050c437..c76b39d 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 _0x9e94=['info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x4772b3,_0x49a7fe){var _0x4d2e1c=function(_0x3dcd71){while(--_0x3dcd71){_0x4772b3['push'](_0x4772b3['shift']());}};_0x4d2e1c(++_0x49a7fe);}(_0x9e94,0xbd));var _0x49e9=function(_0x47c679,_0x2e9e9e){_0x47c679=_0x47c679-0x0;var _0x289b8e=_0x9e94[_0x47c679];return _0x289b8e;};'use strict';var _=require('lodash');var util=require(_0x49e9('0x0'));var moment=require(_0x49e9('0x1'));var BPromise=require(_0x49e9('0x2'));var rs=require(_0x49e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49e9('0x4'))['db'];var utils=require(_0x49e9('0x5'));var logger=require(_0x49e9('0x6'))('rpc');var config=require(_0x49e9('0x7'));var jayson=require(_0x49e9('0x8'));var client=jayson['client'][_0x49e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xefb0d1,_0x2c5b38,_0x5d67ed){return new BPromise(function(_0x1acb9d,_0x5237a5){return client[_0x49e9('0xa')](_0xefb0d1,_0x5d67ed)['then'](function(_0x56a55e){logger[_0x49e9('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2c5b38,_0x49e9('0xc'));logger[_0x49e9('0xd')](_0x49e9('0xe'),_0x2c5b38,_0x49e9('0xc'),JSON[_0x49e9('0xf')](_0x56a55e));if(_0x56a55e[_0x49e9('0x10')]){if(_0x56a55e[_0x49e9('0x10')]['code']===0x1f4){logger['error'](_0x49e9('0x11'),_0x2c5b38,_0x56a55e[_0x49e9('0x10')][_0x49e9('0x12')]);return _0x5237a5(_0x56a55e[_0x49e9('0x10')][_0x49e9('0x12')]);}logger[_0x49e9('0x10')](_0x49e9('0x11'),_0x2c5b38,_0x56a55e['error']['message']);return _0x1acb9d(_0x56a55e[_0x49e9('0x10')]['message']);}else{logger[_0x49e9('0xb')](_0x49e9('0x11'),_0x2c5b38,_0x49e9('0xc'));_0x1acb9d(_0x56a55e[_0x49e9('0x13')][_0x49e9('0x12')]);}})['catch'](function(_0x5bf843){logger['error'](_0x49e9('0x11'),_0x2c5b38,_0x5bf843);_0x5237a5(_0x5bf843);});});} \ No newline at end of file +var _0x615d=['jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x574090,_0x880ca6){var _0x4e60c8=function(_0x2f62fa){while(--_0x2f62fa){_0x574090['push'](_0x574090['shift']());}};_0x4e60c8(++_0x880ca6);}(_0x615d,0xde));var _0xd615=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x615d[_0xa2c0a3];return _0x52c618;};'use strict';var _=require(_0xd615('0x0'));var util=require(_0xd615('0x1'));var moment=require(_0xd615('0x2'));var BPromise=require(_0xd615('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd615('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd615('0x5'));var logger=require(_0xd615('0x6'))(_0xd615('0x7'));var config=require(_0xd615('0x8'));var jayson=require(_0xd615('0x9'));var client=jayson[_0xd615('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x362f50,_0x16424d,_0x2c037d){return new BPromise(function(_0x248c7d,_0x4aca5e){return client[_0xd615('0xb')](_0x362f50,_0x2c037d)[_0xd615('0xc')](function(_0x4175e3){logger[_0xd615('0xd')](_0xd615('0xe'),_0x16424d,_0xd615('0xf'));logger[_0xd615('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x16424d,_0xd615('0xf'),JSON[_0xd615('0x11')](_0x4175e3));if(_0x4175e3[_0xd615('0x12')]){if(_0x4175e3[_0xd615('0x12')]['code']===0x1f4){logger[_0xd615('0x12')](_0xd615('0xe'),_0x16424d,_0x4175e3[_0xd615('0x12')][_0xd615('0x13')]);return _0x4aca5e(_0x4175e3['error'][_0xd615('0x13')]);}logger['error'](_0xd615('0xe'),_0x16424d,_0x4175e3[_0xd615('0x12')]['message']);return _0x248c7d(_0x4175e3[_0xd615('0x12')][_0xd615('0x13')]);}else{logger[_0xd615('0xd')](_0xd615('0xe'),_0x16424d,'request\x20sent');_0x248c7d(_0x4175e3[_0xd615('0x14')]['message']);}})['catch'](function(_0x13785f){logger[_0xd615('0x12')](_0xd615('0xe'),_0x16424d,_0x13785f);_0x4aca5e(_0x13785f);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 70ac6b7..d8c4190 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 _0x6f05=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','update'];(function(_0x1391d8,_0x1db437){var _0x2fcb82=function(_0x24ae47){while(--_0x24ae47){_0x1391d8['push'](_0x1391d8['shift']());}};_0x2fcb82(++_0x1db437);}(_0x6f05,0x18e));var _0x56f0=function(_0x24fd9c,_0x1f99be){_0x24fd9c=_0x24fd9c-0x0;var _0x2ba8de=_0x6f05[_0x24fd9c];return _0x2ba8de;};'use strict';var multer=require('multer');var util=require(_0x56f0('0x0'));var path=require('path');var timeout=require(_0x56f0('0x1'));var express=require(_0x56f0('0x2'));var router=express[_0x56f0('0x3')]();var auth=require(_0x56f0('0x4'));var interaction=require(_0x56f0('0x5'));var config=require(_0x56f0('0x6'));var controller=require(_0x56f0('0x7'));router[_0x56f0('0x8')]('/',auth[_0x56f0('0x9')](),controller[_0x56f0('0xa')]);router[_0x56f0('0x8')](_0x56f0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x56f0('0x8')](_0x56f0('0xc'),auth['isAuthenticated'](),controller[_0x56f0('0xd')]);router['post']('/',auth[_0x56f0('0x9')](),controller[_0x56f0('0xe')]);router['put'](_0x56f0('0xb'),auth['isAuthenticated'](),controller[_0x56f0('0xf')]);router[_0x56f0('0x10')](_0x56f0('0xb'),auth[_0x56f0('0x9')](),controller['destroy']);module[_0x56f0('0x11')]=router; \ No newline at end of file +var _0x5d19=['put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','create'];(function(_0x268396,_0x864c1c){var _0x2d7b5d=function(_0x4a3a6a){while(--_0x4a3a6a){_0x268396['push'](_0x268396['shift']());}};_0x2d7b5d(++_0x864c1c);}(_0x5d19,0xdb));var _0x95d1=function(_0x2e78e9,_0x42957c){_0x2e78e9=_0x2e78e9-0x0;var _0x35aad4=_0x5d19[_0x2e78e9];return _0x35aad4;};'use strict';var multer=require(_0x95d1('0x0'));var util=require(_0x95d1('0x1'));var path=require('path');var timeout=require(_0x95d1('0x2'));var express=require(_0x95d1('0x3'));var router=express[_0x95d1('0x4')]();var auth=require(_0x95d1('0x5'));var interaction=require(_0x95d1('0x6'));var config=require(_0x95d1('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x95d1('0x8')]('/',auth[_0x95d1('0x9')](),controller[_0x95d1('0xa')]);router[_0x95d1('0x8')](_0x95d1('0xb'),auth[_0x95d1('0x9')](),controller['show']);router['get'](_0x95d1('0xc'),auth[_0x95d1('0x9')](),controller[_0x95d1('0xd')]);router['post']('/',auth[_0x95d1('0x9')](),controller[_0x95d1('0xe')]);router[_0x95d1('0xf')]('/:id',auth[_0x95d1('0x9')](),controller[_0x95d1('0x10')]);router['delete'](_0x95d1('0xb'),auth[_0x95d1('0x9')](),controller[_0x95d1('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 21cec2c..16ba5c4 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 _0x0a35=['STRING','BOOLEAN'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x0a35,0x18e));var _0x50a3=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0x0a35[_0x5c768b];return _0x335af8;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x50a3('0x0')]},'function':{'type':Sequelize[_0x50a3('0x0')]},'format':{'type':Sequelize[_0x50a3('0x0')]},'groupBy':{'type':Sequelize[_0x50a3('0x1')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x50a3('0x0')]},'custom':{'type':Sequelize[_0x50a3('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x4ec4=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x3a6128,_0x503f7b){var _0x3b17de=function(_0x42c806){while(--_0x42c806){_0x3a6128['push'](_0x3a6128['shift']());}};_0x3b17de(++_0x503f7b);}(_0x4ec4,0x98));var _0x44ec=function(_0x1e8396,_0x59abaa){_0x1e8396=_0x1e8396-0x0;var _0x35472c=_0x4ec4[_0x1e8396];return _0x35472c;};'use strict';var Sequelize=require(_0x44ec('0x0'));module['exports']={'field':{'type':Sequelize[_0x44ec('0x1')]},'alias':{'type':Sequelize[_0x44ec('0x2')]},'function':{'type':Sequelize[_0x44ec('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x44ec('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x44ec('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 9b76484..4d40817 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 _0x5fdb=['sort','where','pick','merge','map','type','key','field','filter','options','includeAll','findAll','rows','show','rawAttributes','length','include','create','body','bulkCreate','catch','update','params','destroy','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','reject','save','then','error','stack','name','send','index','AnalyticFieldReport','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x5fdb,0xff));var _0xb5fd=function(_0x59136d,_0x2d9879){_0x59136d=_0x59136d-0x0;var _0x15edd0=_0x5fdb[_0x59136d];return _0x15edd0;};'use strict';var pdf=require(_0xb5fd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb5fd('0x1'));var zipdir=require(_0xb5fd('0x2'));var jsonpatch=require(_0xb5fd('0x3'));var rp=require(_0xb5fd('0x4'));var moment=require(_0xb5fd('0x5'));var BPromise=require(_0xb5fd('0x6'));var Mustache=require(_0xb5fd('0x7'));var util=require('util');var path=require(_0xb5fd('0x8'));var sox=require('sox');var csv=require(_0xb5fd('0x9'));var ejs=require(_0xb5fd('0xa'));var fs=require('fs');var _=require(_0xb5fd('0xb'));var squel=require(_0xb5fd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb5fd('0x9'));var querystring=require(_0xb5fd('0xd'));var Papa=require(_0xb5fd('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xb5fd('0xf'));var Redis=require(_0xb5fd('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xb5fd('0x11'))(_0xb5fd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f3f6d,_0x2235fc){_0x2235fc=_0x2235fc||0xcc;return function(_0x3b3671){if(_0x3b3671){return _0x3f3f6d[_0xb5fd('0x13')](_0x2235fc);}return _0x3f3f6d[_0xb5fd('0x14')](_0x2235fc)[_0xb5fd('0x15')]();};}function respondWithResult(_0xa84543,_0x134d9d){_0x134d9d=_0x134d9d||0xc8;return function(_0x23297f){if(_0x23297f){return _0xa84543[_0xb5fd('0x14')](_0x134d9d)[_0xb5fd('0x16')](_0x23297f);}};}function respondWithFilteredResult(_0x203baf,_0x414806){return function(_0x2f91fc){if(_0x2f91fc){var _0x4b2595=_0x2f91fc[_0xb5fd('0x17')],_0x17d345=_0x414806[_0xb5fd('0x18')],_0x492bd5=_0x414806[_0xb5fd('0x18')]+_0x414806[_0xb5fd('0x19')],_0x2927bd;if(_0x492bd5>=_0x4b2595){_0x492bd5=_0x4b2595;_0x2927bd=0xc8;}else{_0x2927bd=0xce;}_0x203baf[_0xb5fd('0x14')](_0x2927bd);return _0x203baf['set']('Content-Range',_0x17d345+'-'+_0x492bd5+'/'+_0x4b2595)[_0xb5fd('0x16')](_0x2f91fc);}return null;};}function patchUpdates(_0x5cc1a6){return function(_0x191eb3){try{jsonpatch['apply'](_0x191eb3,_0x5cc1a6,!![]);}catch(_0x54aaa2){return BPromise[_0xb5fd('0x1a')](_0x54aaa2);}return _0x191eb3[_0xb5fd('0x1b')]();};}function saveUpdates(_0x2c9cf1,_0x4748c5){return function(_0x1615c9){if(_0x1615c9){return _0x1615c9['update'](_0x2c9cf1)['then'](function(_0x3edafe){return _0x3edafe;});}return null;};}function removeEntity(_0x100a62,_0x5237cd){return function(_0x36bf50){if(_0x36bf50){return _0x36bf50['destroy']()[_0xb5fd('0x1c')](function(){_0x100a62[_0xb5fd('0x14')](0xcc)[_0xb5fd('0x15')]();});}};}function handleEntityNotFound(_0x31da5e,_0x2ebe91){return function(_0x2c853a){if(!_0x2c853a){_0x31da5e[_0xb5fd('0x13')](0x194);}return _0x2c853a;};}function handleError(_0x5aad8b,_0x62bf34){_0x62bf34=_0x62bf34||0x1f4;return function(_0x406b19){logger[_0xb5fd('0x1d')](_0x406b19[_0xb5fd('0x1e')]);if(_0x406b19['name']){delete _0x406b19[_0xb5fd('0x1f')];}_0x5aad8b['status'](_0x62bf34)[_0xb5fd('0x20')](_0x406b19);};}exports[_0xb5fd('0x21')]=function(_0x3da66b,_0x15abb7){var _0x4d35d4={},_0x9be64c={},_0x4bc73b={'count':0x0,'rows':[]};var _0x30379b=db[_0xb5fd('0x22')]['rawAttributes'];_0x9be64c['model']=_[_0xb5fd('0x23')](_0x30379b);_0x9be64c['query']=_['keys'](_0x3da66b[_0xb5fd('0x24')]);_0x9be64c[_0xb5fd('0x25')]=_[_0xb5fd('0x26')](_0x9be64c[_0xb5fd('0x27')],_0x9be64c[_0xb5fd('0x24')]);_0x4d35d4[_0xb5fd('0x28')]=_[_0xb5fd('0x26')](_0x9be64c[_0xb5fd('0x27')],qs[_0xb5fd('0x29')](_0x3da66b[_0xb5fd('0x24')][_0xb5fd('0x29')]));_0x4d35d4[_0xb5fd('0x28')]=_0x4d35d4[_0xb5fd('0x28')]['length']?_0x4d35d4[_0xb5fd('0x28')]:_0x9be64c['model'];if(!_0x3da66b[_0xb5fd('0x24')][_0xb5fd('0x2a')](_0xb5fd('0x2b'))){_0x4d35d4['limit']=qs['limit'](_0x3da66b[_0xb5fd('0x24')][_0xb5fd('0x19')]);_0x4d35d4[_0xb5fd('0x18')]=qs[_0xb5fd('0x18')](_0x3da66b[_0xb5fd('0x24')][_0xb5fd('0x18')]);}_0x4d35d4[_0xb5fd('0x2c')]=qs[_0xb5fd('0x2d')](_0x3da66b['query'][_0xb5fd('0x2d')]);_0x4d35d4[_0xb5fd('0x2e')]=qs['filters'](_[_0xb5fd('0x2f')](_0x3da66b['query'],_0x9be64c[_0xb5fd('0x25')]));if(_0x3da66b[_0xb5fd('0x24')]['filter']){_0x4d35d4[_0xb5fd('0x2e')]=_[_0xb5fd('0x30')](_0x4d35d4['where'],{'$or':_[_0xb5fd('0x31')](_0x30379b,function(_0x52d807){if(_0x52d807[_0xb5fd('0x32')][_0xb5fd('0x33')]!=='VIRTUAL'){var _0x2bd480={};_0x2bd480[_0x52d807[_0xb5fd('0x34')]]={'$like':'%'+_0x3da66b[_0xb5fd('0x24')][_0xb5fd('0x35')]+'%'};return _0x2bd480;}})});}_0x4d35d4=_['merge']({},_0x4d35d4,_0x3da66b[_0xb5fd('0x36')]);var _0x2c698e={'where':_0x4d35d4[_0xb5fd('0x2e')]};return db[_0xb5fd('0x22')][_0xb5fd('0x17')](_0x2c698e)[_0xb5fd('0x1c')](function(_0x4cbc48){_0x4bc73b[_0xb5fd('0x17')]=_0x4cbc48;if(_0x3da66b['query'][_0xb5fd('0x37')]){_0x4d35d4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xb5fd('0x38')](_0x4d35d4);})['then'](function(_0x464bd1){_0x4bc73b[_0xb5fd('0x39')]=_0x464bd1;return _0x4bc73b;})[_0xb5fd('0x1c')](respondWithFilteredResult(_0x15abb7,_0x4d35d4))['catch'](handleError(_0x15abb7,null));};exports[_0xb5fd('0x3a')]=function(_0x33a17b,_0x86a8be){var _0x45aa33={'raw':![],'where':{'id':_0x33a17b['params']['id']}},_0x1a7ccc={};_0x1a7ccc[_0xb5fd('0x27')]=_['keys'](db[_0xb5fd('0x22')][_0xb5fd('0x3b')]);_0x1a7ccc['query']=_['keys'](_0x33a17b[_0xb5fd('0x24')]);_0x1a7ccc['filters']=_['intersection'](_0x1a7ccc['model'],_0x1a7ccc[_0xb5fd('0x24')]);_0x45aa33[_0xb5fd('0x28')]=_[_0xb5fd('0x26')](_0x1a7ccc[_0xb5fd('0x27')],qs['fields'](_0x33a17b[_0xb5fd('0x24')][_0xb5fd('0x29')]));_0x45aa33[_0xb5fd('0x28')]=_0x45aa33['attributes'][_0xb5fd('0x3c')]?_0x45aa33[_0xb5fd('0x28')]:_0x1a7ccc[_0xb5fd('0x27')];if(_0x33a17b[_0xb5fd('0x24')][_0xb5fd('0x37')]){_0x45aa33[_0xb5fd('0x3d')]=[{'all':!![]}];}_0x45aa33=_[_0xb5fd('0x30')]({},_0x45aa33,_0x33a17b[_0xb5fd('0x36')]);return db[_0xb5fd('0x22')]['find'](_0x45aa33)[_0xb5fd('0x1c')](handleEntityNotFound(_0x86a8be,null))[_0xb5fd('0x1c')](respondWithResult(_0x86a8be,null))['catch'](handleError(_0x86a8be,null));};exports[_0xb5fd('0x3e')]=function(_0x46a974,_0x4274e2){return db[_0xb5fd('0x22')][_0xb5fd('0x3e')](_0x46a974[_0xb5fd('0x3f')],{})[_0xb5fd('0x1c')](respondWithResult(_0x4274e2,0xc9))['catch'](handleError(_0x4274e2,null));};exports[_0xb5fd('0x40')]=function(_0xf5a9e3,_0x337413){return db[_0xb5fd('0x22')][_0xb5fd('0x40')](_0xf5a9e3['body'],{'raw':![],'individualHooks':!![]})[_0xb5fd('0x1c')](respondWithResult(_0x337413,0xc9))[_0xb5fd('0x41')](handleError(_0x337413,null));};exports[_0xb5fd('0x42')]=function(_0x1a2a5e,_0x1835ef){if(_0x1a2a5e[_0xb5fd('0x3f')]['id']){delete _0x1a2a5e[_0xb5fd('0x3f')]['id'];}return db[_0xb5fd('0x22')]['find']({'where':{'id':_0x1a2a5e[_0xb5fd('0x43')]['id']}})[_0xb5fd('0x1c')](handleEntityNotFound(_0x1835ef,null))[_0xb5fd('0x1c')](saveUpdates(_0x1a2a5e[_0xb5fd('0x3f')],null))['then'](respondWithResult(_0x1835ef,null))[_0xb5fd('0x41')](handleError(_0x1835ef,null));};exports[_0xb5fd('0x44')]=function(_0x1d6442,_0x45804b){return db[_0xb5fd('0x22')][_0xb5fd('0x45')]({'where':{'id':_0x1d6442[_0xb5fd('0x43')]['id']}})['then'](handleEntityNotFound(_0x45804b,null))['then'](removeEntity(_0x45804b,null))['catch'](handleError(_0x45804b,null));};exports[_0xb5fd('0x46')]=function(_0x1b4707,_0x4c66fc){return db[_0xb5fd('0x22')][_0xb5fd('0x44')]({'where':{'id':_0x1b4707[_0xb5fd('0x24')][_0xb5fd('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0xb5fd('0x1c')](respondWithResult(_0x4c66fc,0xcc))[_0xb5fd('0x41')](handleError(_0x4c66fc,null));};exports[_0xb5fd('0x48')]=function(_0x2de35f,_0x2dd55e,_0xe9dd50){return db[_0xb5fd('0x49')][_0xb5fd('0x4a')]({'where':{'id':_0x2de35f[_0xb5fd('0x43')]['id']}})[_0xb5fd('0x1c')](handleEntityNotFound(_0x2dd55e,null))[_0xb5fd('0x1c')](function(_0x3666fe){if(_0x3666fe){return db['sequelize']['transaction'](function(_0x320845){return db[_0xb5fd('0x22')]['destroy']({'where':{'CustomReportId':_0x2de35f[_0xb5fd('0x43')]['id']},'transaction':_0x320845})[_0xb5fd('0x1c')](function(_0x1e6e63){var _0x587994=_[_0xb5fd('0x31')](_0x2de35f['body'],function(_0xa5ef10){delete _0xa5ef10['id'];_0xa5ef10['CustomReportId']=_0x2de35f[_0xb5fd('0x43')]['id'];return _0xa5ef10;});return db[_0xb5fd('0x22')][_0xb5fd('0x40')](_0x587994,{'transaction':_0x320845});});})[_0xb5fd('0x1c')](function(){return db[_0xb5fd('0x22')]['findAll']({'where':{'CustomReportId':_0x2de35f[_0xb5fd('0x43')]['id']}});});}})[_0xb5fd('0x1c')](respondWithResult(_0x2dd55e,null))[_0xb5fd('0x41')](handleError(_0x2dd55e,null));}; \ No newline at end of file +var _0xb7a4=['filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','bulkCreate','bulkDestroy','AnalyticCustomReport','sequelize','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','AnalyticFieldReport','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','where','pick'];(function(_0x4d0a44,_0xedba34){var _0x14c336=function(_0x611d0d){while(--_0x611d0d){_0x4d0a44['push'](_0x4d0a44['shift']());}};_0x14c336(++_0xedba34);}(_0xb7a4,0x18f));var _0x4b7a=function(_0x54663a,_0x4e22e1){_0x54663a=_0x54663a-0x0;var _0x31cb21=_0xb7a4[_0x54663a];return _0x31cb21;};'use strict';var pdf=require(_0x4b7a('0x0'));var emlformat=require(_0x4b7a('0x1'));var rimraf=require(_0x4b7a('0x2'));var zipdir=require(_0x4b7a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4b7a('0x4'));var BPromise=require(_0x4b7a('0x5'));var Mustache=require('mustache');var util=require(_0x4b7a('0x6'));var path=require(_0x4b7a('0x7'));var sox=require(_0x4b7a('0x8'));var csv=require(_0x4b7a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4b7a('0xa'));var squel=require(_0x4b7a('0xb'));var crypto=require('crypto');var jsforce=require(_0x4b7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4b7a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x4b7a('0xd'));var hardwareService=require(_0x4b7a('0xe'));var Redis=require(_0x4b7a('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x4b7a('0x10'))(_0x4b7a('0x11'));var utils=require('../../config/utils');var config=require(_0x4b7a('0x12'));var db=require(_0x4b7a('0x13'))['db'];function respondWithStatusCode(_0x106b69,_0x41005d){_0x41005d=_0x41005d||0xcc;return function(_0x2e20bf){if(_0x2e20bf){return _0x106b69[_0x4b7a('0x14')](_0x41005d);}return _0x106b69['status'](_0x41005d)['end']();};}function respondWithResult(_0x3ad25e,_0xae0808){_0xae0808=_0xae0808||0xc8;return function(_0xa13f08){if(_0xa13f08){return _0x3ad25e[_0x4b7a('0x15')](_0xae0808)[_0x4b7a('0x16')](_0xa13f08);}};}function respondWithFilteredResult(_0x8ddbf4,_0x527991){return function(_0x39151e){if(_0x39151e){var _0x3f6604=_0x39151e[_0x4b7a('0x17')],_0x4c79d7=_0x527991['offset'],_0x13c974=_0x527991['offset']+_0x527991['limit'],_0x2f2c34;if(_0x13c974>=_0x3f6604){_0x13c974=_0x3f6604;_0x2f2c34=0xc8;}else{_0x2f2c34=0xce;}_0x8ddbf4[_0x4b7a('0x15')](_0x2f2c34);return _0x8ddbf4[_0x4b7a('0x18')](_0x4b7a('0x19'),_0x4c79d7+'-'+_0x13c974+'/'+_0x3f6604)['json'](_0x39151e);}return null;};}function patchUpdates(_0x29e7df){return function(_0x30ec0f){try{jsonpatch[_0x4b7a('0x1a')](_0x30ec0f,_0x29e7df,!![]);}catch(_0x23b42b){return BPromise['reject'](_0x23b42b);}return _0x30ec0f[_0x4b7a('0x1b')]();};}function saveUpdates(_0x5152a7,_0x36ac89){return function(_0x133249){if(_0x133249){return _0x133249[_0x4b7a('0x1c')](_0x5152a7)[_0x4b7a('0x1d')](function(_0x215dce){return _0x215dce;});}return null;};}function removeEntity(_0x2e32e3,_0x223b58){return function(_0x1831f0){if(_0x1831f0){return _0x1831f0[_0x4b7a('0x1e')]()[_0x4b7a('0x1d')](function(){_0x2e32e3[_0x4b7a('0x15')](0xcc)[_0x4b7a('0x1f')]();});}};}function handleEntityNotFound(_0x430937,_0x421288){return function(_0x4b42d6){if(!_0x4b42d6){_0x430937[_0x4b7a('0x14')](0x194);}return _0x4b42d6;};}function handleError(_0x5ca91b,_0x270f19){_0x270f19=_0x270f19||0x1f4;return function(_0x3fdcdf){logger['error'](_0x3fdcdf['stack']);if(_0x3fdcdf[_0x4b7a('0x20')]){delete _0x3fdcdf[_0x4b7a('0x20')];}_0x5ca91b[_0x4b7a('0x15')](_0x270f19)[_0x4b7a('0x21')](_0x3fdcdf);};}exports[_0x4b7a('0x22')]=function(_0x9c7706,_0x56b11f){var _0x27e512={},_0x1e4bcd={},_0x18c2ce={'count':0x0,'rows':[]};var _0x1aa8e2=db[_0x4b7a('0x23')]['rawAttributes'];_0x1e4bcd[_0x4b7a('0x24')]=_[_0x4b7a('0x25')](_0x1aa8e2);_0x1e4bcd[_0x4b7a('0x26')]=_['keys'](_0x9c7706[_0x4b7a('0x26')]);_0x1e4bcd[_0x4b7a('0x27')]=_[_0x4b7a('0x28')](_0x1e4bcd['model'],_0x1e4bcd[_0x4b7a('0x26')]);_0x27e512[_0x4b7a('0x29')]=_[_0x4b7a('0x28')](_0x1e4bcd[_0x4b7a('0x24')],qs[_0x4b7a('0x2a')](_0x9c7706[_0x4b7a('0x26')]['fields']));_0x27e512[_0x4b7a('0x29')]=_0x27e512[_0x4b7a('0x29')][_0x4b7a('0x2b')]?_0x27e512['attributes']:_0x1e4bcd[_0x4b7a('0x24')];if(!_0x9c7706[_0x4b7a('0x26')]['hasOwnProperty'](_0x4b7a('0x2c'))){_0x27e512[_0x4b7a('0x2d')]=qs[_0x4b7a('0x2d')](_0x9c7706[_0x4b7a('0x26')]['limit']);_0x27e512[_0x4b7a('0x2e')]=qs['offset'](_0x9c7706[_0x4b7a('0x26')][_0x4b7a('0x2e')]);}_0x27e512[_0x4b7a('0x2f')]=qs[_0x4b7a('0x30')](_0x9c7706[_0x4b7a('0x26')][_0x4b7a('0x30')]);_0x27e512[_0x4b7a('0x31')]=qs[_0x4b7a('0x27')](_[_0x4b7a('0x32')](_0x9c7706[_0x4b7a('0x26')],_0x1e4bcd[_0x4b7a('0x27')]));if(_0x9c7706['query'][_0x4b7a('0x33')]){_0x27e512['where']=_[_0x4b7a('0x34')](_0x27e512['where'],{'$or':_[_0x4b7a('0x35')](_0x1aa8e2,function(_0x3aee2c){if(_0x3aee2c[_0x4b7a('0x36')][_0x4b7a('0x37')]!==_0x4b7a('0x38')){var _0x34ace1={};_0x34ace1[_0x3aee2c[_0x4b7a('0x39')]]={'$like':'%'+_0x9c7706[_0x4b7a('0x26')][_0x4b7a('0x33')]+'%'};return _0x34ace1;}})});}_0x27e512=_['merge']({},_0x27e512,_0x9c7706[_0x4b7a('0x3a')]);var _0x3f5990={'where':_0x27e512['where']};return db[_0x4b7a('0x23')][_0x4b7a('0x17')](_0x3f5990)['then'](function(_0x58a359){_0x18c2ce[_0x4b7a('0x17')]=_0x58a359;if(_0x9c7706[_0x4b7a('0x26')][_0x4b7a('0x3b')]){_0x27e512[_0x4b7a('0x3c')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4b7a('0x3d')](_0x27e512);})[_0x4b7a('0x1d')](function(_0x2a72d9){_0x18c2ce[_0x4b7a('0x3e')]=_0x2a72d9;return _0x18c2ce;})[_0x4b7a('0x1d')](respondWithFilteredResult(_0x56b11f,_0x27e512))[_0x4b7a('0x3f')](handleError(_0x56b11f,null));};exports[_0x4b7a('0x40')]=function(_0xd53124,_0x114dc0){var _0x393659={'raw':![],'where':{'id':_0xd53124[_0x4b7a('0x41')]['id']}},_0x30701b={};_0x30701b[_0x4b7a('0x24')]=_[_0x4b7a('0x25')](db['AnalyticFieldReport'][_0x4b7a('0x42')]);_0x30701b[_0x4b7a('0x26')]=_['keys'](_0xd53124[_0x4b7a('0x26')]);_0x30701b[_0x4b7a('0x27')]=_[_0x4b7a('0x28')](_0x30701b[_0x4b7a('0x24')],_0x30701b['query']);_0x393659[_0x4b7a('0x29')]=_[_0x4b7a('0x28')](_0x30701b[_0x4b7a('0x24')],qs[_0x4b7a('0x2a')](_0xd53124[_0x4b7a('0x26')][_0x4b7a('0x2a')]));_0x393659[_0x4b7a('0x29')]=_0x393659[_0x4b7a('0x29')][_0x4b7a('0x2b')]?_0x393659['attributes']:_0x30701b['model'];if(_0xd53124[_0x4b7a('0x26')][_0x4b7a('0x3b')]){_0x393659[_0x4b7a('0x3c')]=[{'all':!![]}];}_0x393659=_[_0x4b7a('0x34')]({},_0x393659,_0xd53124[_0x4b7a('0x3a')]);return db['AnalyticFieldReport'][_0x4b7a('0x43')](_0x393659)['then'](handleEntityNotFound(_0x114dc0,null))[_0x4b7a('0x1d')](respondWithResult(_0x114dc0,null))['catch'](handleError(_0x114dc0,null));};exports[_0x4b7a('0x44')]=function(_0x480f50,_0x5de134){return db[_0x4b7a('0x23')][_0x4b7a('0x44')](_0x480f50[_0x4b7a('0x45')],{})[_0x4b7a('0x1d')](respondWithResult(_0x5de134,0xc9))[_0x4b7a('0x3f')](handleError(_0x5de134,null));};exports['bulkCreate']=function(_0x3ab8e0,_0x1a1373){return db[_0x4b7a('0x23')][_0x4b7a('0x46')](_0x3ab8e0[_0x4b7a('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1a1373,0xc9))[_0x4b7a('0x3f')](handleError(_0x1a1373,null));};exports['update']=function(_0x1ce9d9,_0x524a8a){if(_0x1ce9d9[_0x4b7a('0x45')]['id']){delete _0x1ce9d9[_0x4b7a('0x45')]['id'];}return db[_0x4b7a('0x23')][_0x4b7a('0x43')]({'where':{'id':_0x1ce9d9[_0x4b7a('0x41')]['id']}})[_0x4b7a('0x1d')](handleEntityNotFound(_0x524a8a,null))[_0x4b7a('0x1d')](saveUpdates(_0x1ce9d9[_0x4b7a('0x45')],null))[_0x4b7a('0x1d')](respondWithResult(_0x524a8a,null))[_0x4b7a('0x3f')](handleError(_0x524a8a,null));};exports['destroy']=function(_0x470762,_0x59cc4f){return db['AnalyticFieldReport'][_0x4b7a('0x43')]({'where':{'id':_0x470762[_0x4b7a('0x41')]['id']}})[_0x4b7a('0x1d')](handleEntityNotFound(_0x59cc4f,null))['then'](removeEntity(_0x59cc4f,null))['catch'](handleError(_0x59cc4f,null));};exports[_0x4b7a('0x47')]=function(_0x53bcd0,_0x53a04a){return db[_0x4b7a('0x23')][_0x4b7a('0x1e')]({'where':{'id':_0x53bcd0[_0x4b7a('0x26')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x4b7a('0x1d')](respondWithResult(_0x53a04a,0xcc))[_0x4b7a('0x3f')](handleError(_0x53a04a,null));};exports['addFields']=function(_0x4b3ee5,_0x383acf,_0x4b822e){return db[_0x4b7a('0x48')]['findOne']({'where':{'id':_0x4b3ee5[_0x4b7a('0x41')]['id']}})[_0x4b7a('0x1d')](handleEntityNotFound(_0x383acf,null))['then'](function(_0x53bcc7){if(_0x53bcc7){return db[_0x4b7a('0x49')]['transaction'](function(_0x5334b4){return db[_0x4b7a('0x23')][_0x4b7a('0x1e')]({'where':{'CustomReportId':_0x4b3ee5[_0x4b7a('0x41')]['id']},'transaction':_0x5334b4})['then'](function(_0x45dec9){var _0x3ea356=_[_0x4b7a('0x35')](_0x4b3ee5[_0x4b7a('0x45')],function(_0x596eb4){delete _0x596eb4['id'];_0x596eb4[_0x4b7a('0x4a')]=_0x4b3ee5[_0x4b7a('0x41')]['id'];return _0x596eb4;});return db[_0x4b7a('0x23')][_0x4b7a('0x46')](_0x3ea356,{'transaction':_0x5334b4});});})['then'](function(){return db[_0x4b7a('0x23')][_0x4b7a('0x3d')]({'where':{'CustomReportId':_0x4b3ee5['params']['id']}});});}})[_0x4b7a('0x1d')](respondWithResult(_0x383acf,null))[_0x4b7a('0x3f')](handleError(_0x383acf,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3a8d8ca..144439d 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 _0x34c4=['exports','define','analytics_report_fields','lodash','../../config/logger','moment','request-promise'];(function(_0x3c4a2d,_0x5dc29f){var _0x1b4763=function(_0x17b2f1){while(--_0x17b2f1){_0x3c4a2d['push'](_0x3c4a2d['shift']());}};_0x1b4763(++_0x5dc29f);}(_0x34c4,0x1ed));var _0x434c=function(_0xd5dccc,_0x33b922){_0xd5dccc=_0xd5dccc-0x0;var _0x4ea481=_0x34c4[_0xd5dccc];return _0x4ea481;};'use strict';var _=require(_0x434c('0x0'));var util=require('util');var logger=require(_0x434c('0x1'))('api');var moment=require(_0x434c('0x2'));var BPromise=require('bluebird');var rp=require(_0x434c('0x3'));var attributes=require('./analyticFieldReport.attributes');module[_0x434c('0x4')]=function(_0x10cff9,_0x1563ac){return _0x10cff9[_0x434c('0x5')]('AnalyticFieldReport',attributes,{'tableName':_0x434c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4924=['util','../../config/logger','api','moment','request-promise','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x2e3c3a,_0x5e25aa){var _0x182aba=function(_0x2ac287){while(--_0x2ac287){_0x2e3c3a['push'](_0x2e3c3a['shift']());}};_0x182aba(++_0x5e25aa);}(_0x4924,0xd7));var _0x4492=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0x4924[_0x4c06a3];return _0x7ff53c;};'use strict';var _=require(_0x4492('0x0'));var util=require(_0x4492('0x1'));var logger=require(_0x4492('0x2'))(_0x4492('0x3'));var moment=require(_0x4492('0x4'));var BPromise=require('bluebird');var rp=require(_0x4492('0x5'));var attributes=require(_0x4492('0x6'));module['exports']=function(_0x5ebcbb,_0x4cd17e){return _0x5ebcbb['define'](_0x4492('0x7'),attributes,{'tableName':_0x4492('0x8'),'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 150d770..08544af 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 _0x6dd1=['debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6dd1,0x111));var _0x16dd=function(_0x517a4d,_0x4170c2){_0x517a4d=_0x517a4d-0x0;var _0x76ae83=_0x6dd1[_0x517a4d];return _0x76ae83;};'use strict';var _=require(_0x16dd('0x0'));var util=require('util');var moment=require(_0x16dd('0x1'));var BPromise=require(_0x16dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16dd('0x3'));var db=require(_0x16dd('0x4'))['db'];var utils=require(_0x16dd('0x5'));var logger=require(_0x16dd('0x6'))(_0x16dd('0x7'));var config=require(_0x16dd('0x8'));var jayson=require(_0x16dd('0x9'));var client=jayson[_0x16dd('0xa')][_0x16dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f532c,_0x589f69,_0x5ad29a){return new BPromise(function(_0x490566,_0x41bca0){return client[_0x16dd('0xc')](_0x4f532c,_0x5ad29a)[_0x16dd('0xd')](function(_0x19595a){logger['info'](_0x16dd('0xe'),_0x589f69,'request\x20sent');logger[_0x16dd('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x589f69,'request\x20sent',JSON[_0x16dd('0x10')](_0x19595a));if(_0x19595a[_0x16dd('0x11')]){if(_0x19595a['error'][_0x16dd('0x12')]===0x1f4){logger[_0x16dd('0x11')](_0x16dd('0xe'),_0x589f69,_0x19595a['error'][_0x16dd('0x13')]);return _0x41bca0(_0x19595a[_0x16dd('0x11')][_0x16dd('0x13')]);}logger[_0x16dd('0x11')](_0x16dd('0xe'),_0x589f69,_0x19595a['error']['message']);return _0x490566(_0x19595a[_0x16dd('0x11')]['message']);}else{logger[_0x16dd('0x14')](_0x16dd('0xe'),_0x589f69,_0x16dd('0x15'));_0x490566(_0x19595a[_0x16dd('0x16')][_0x16dd('0x13')]);}})[_0x16dd('0x17')](function(_0x17a646){logger[_0x16dd('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x589f69,_0x17a646);_0x41bca0(_0x17a646);});});} \ No newline at end of file +var _0xc627=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3accdd,_0x4a1a0a){var _0x22df51=function(_0x451506){while(--_0x451506){_0x3accdd['push'](_0x3accdd['shift']());}};_0x22df51(++_0x4a1a0a);}(_0xc627,0x14a));var _0x7c62=function(_0x1200f5,_0x36cc9e){_0x1200f5=_0x1200f5-0x0;var _0x42849f=_0xc627[_0x1200f5];return _0x42849f;};'use strict';var _=require('lodash');var util=require(_0x7c62('0x0'));var moment=require(_0x7c62('0x1'));var BPromise=require(_0x7c62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c62('0x3'));var db=require(_0x7c62('0x4'))['db'];var utils=require(_0x7c62('0x5'));var logger=require(_0x7c62('0x6'))(_0x7c62('0x7'));var config=require(_0x7c62('0x8'));var jayson=require(_0x7c62('0x9'));var client=jayson[_0x7c62('0xa')][_0x7c62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43f964,_0x110f39,_0x29705f){return new BPromise(function(_0x58c31c,_0x56ed4b){return client[_0x7c62('0xc')](_0x43f964,_0x29705f)[_0x7c62('0xd')](function(_0x429820){logger[_0x7c62('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x110f39,'request\x20sent');logger['debug'](_0x7c62('0xf'),_0x110f39,'request\x20sent',JSON[_0x7c62('0x10')](_0x429820));if(_0x429820[_0x7c62('0x11')]){if(_0x429820[_0x7c62('0x11')][_0x7c62('0x12')]===0x1f4){logger[_0x7c62('0x11')](_0x7c62('0x13'),_0x110f39,_0x429820[_0x7c62('0x11')][_0x7c62('0x14')]);return _0x56ed4b(_0x429820[_0x7c62('0x11')][_0x7c62('0x14')]);}logger[_0x7c62('0x11')](_0x7c62('0x13'),_0x110f39,_0x429820[_0x7c62('0x11')][_0x7c62('0x14')]);return _0x58c31c(_0x429820[_0x7c62('0x11')]['message']);}else{logger[_0x7c62('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x110f39,_0x7c62('0x15'));_0x58c31c(_0x429820['result'][_0x7c62('0x14')]);}})[_0x7c62('0x16')](function(_0x434ca2){logger[_0x7c62('0x11')](_0x7c62('0x13'),_0x110f39,_0x434ca2);_0x56ed4b(_0x434ca2);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index d20ae08..1d7fd15 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 _0x57f8=['isAuthenticated','index','/:id','show','create','post','bulkCreate','addFields','put','update','delete','bulkDestroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get'];(function(_0x44cdd1,_0x154003){var _0x35a117=function(_0x1d7343){while(--_0x1d7343){_0x44cdd1['push'](_0x44cdd1['shift']());}};_0x35a117(++_0x154003);}(_0x57f8,0x198));var _0x857f=function(_0x555788,_0x207c93){_0x555788=_0x555788-0x0;var _0x2ec89b=_0x57f8[_0x555788];return _0x2ec89b;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var auth=require(_0x857f('0x5'));var interaction=require(_0x857f('0x6'));var config=require(_0x857f('0x7'));var controller=require(_0x857f('0x8'));router[_0x857f('0x9')]('/',auth[_0x857f('0xa')](),controller[_0x857f('0xb')]);router['get'](_0x857f('0xc'),auth[_0x857f('0xa')](),controller[_0x857f('0xd')]);router['post']('/',auth[_0x857f('0xa')](),controller[_0x857f('0xe')]);router[_0x857f('0xf')]('/create_many',auth[_0x857f('0xa')](),controller[_0x857f('0x10')]);router[_0x857f('0xf')]('/:id/create_many',auth[_0x857f('0xa')](),controller[_0x857f('0x11')]);router[_0x857f('0x12')](_0x857f('0xc'),auth[_0x857f('0xa')](),controller[_0x857f('0x13')]);router[_0x857f('0x14')]('/destroy_many',auth[_0x857f('0xa')](),controller[_0x857f('0x15')]);router[_0x857f('0x14')](_0x857f('0xc'),auth[_0x857f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb688=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields','/:id','update','delete','/destroy_many','bulkDestroy','destroy'];(function(_0x967e61,_0x46b27e){var _0x51f592=function(_0xa9c5e8){while(--_0xa9c5e8){_0x967e61['push'](_0x967e61['shift']());}};_0x51f592(++_0x46b27e);}(_0xb688,0xcf));var _0x8b68=function(_0x18ceb6,_0x138482){_0x18ceb6=_0x18ceb6-0x0;var _0x2282b3=_0xb688[_0x18ceb6];return _0x2282b3;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var auth=require(_0x8b68('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b68('0x6'));var controller=require(_0x8b68('0x7'));router[_0x8b68('0x8')]('/',auth[_0x8b68('0x9')](),controller['index']);router[_0x8b68('0x8')]('/:id',auth[_0x8b68('0x9')](),controller[_0x8b68('0xa')]);router[_0x8b68('0xb')]('/',auth[_0x8b68('0x9')](),controller[_0x8b68('0xc')]);router[_0x8b68('0xb')](_0x8b68('0xd'),auth[_0x8b68('0x9')](),controller[_0x8b68('0xe')]);router[_0x8b68('0xb')](_0x8b68('0xf'),auth[_0x8b68('0x9')](),controller[_0x8b68('0x10')]);router['put'](_0x8b68('0x11'),auth[_0x8b68('0x9')](),controller[_0x8b68('0x12')]);router[_0x8b68('0x13')](_0x8b68('0x14'),auth[_0x8b68('0x9')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x13')](_0x8b68('0x11'),auth['isAuthenticated'](),controller[_0x8b68('0x16')]);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 15f2308..63262f4 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 _0xdd54=['TEXT','exports','name','STRING'];(function(_0x7c9290,_0x5285a4){var _0x4a33fe=function(_0x3ecd99){while(--_0x3ecd99){_0x7c9290['push'](_0x7c9290['shift']());}};_0x4a33fe(++_0x5285a4);}(_0xdd54,0xc5));var _0x4dd5=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xdd54[_0x3bf925];return _0x2128a1;};'use strict';var Sequelize=require('sequelize');module[_0x4dd5('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4dd5('0x1')},'table':{'type':Sequelize[_0x4dd5('0x2')]},'metric':{'type':Sequelize[_0x4dd5('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2e60=['exports','STRING','name','TEXT','sequelize'];(function(_0x4e0072,_0x429586){var _0x304997=function(_0x36d133){while(--_0x36d133){_0x4e0072['push'](_0x4e0072['shift']());}};_0x304997(++_0x429586);}(_0x2e60,0x1b7));var _0x02e6=function(_0x4cbc5d,_0x3f552e){_0x4cbc5d=_0x4cbc5d-0x0;var _0x1d1f25=_0x2e60[_0x4cbc5d];return _0x1d1f25;};'use strict';var Sequelize=require(_0x02e6('0x0'));module[_0x02e6('0x1')]={'name':{'type':Sequelize[_0x02e6('0x2')],'allowNull':![],'unique':_0x02e6('0x3')},'table':{'type':Sequelize[_0x02e6('0x2')]},'metric':{'type':Sequelize[_0x02e6('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 9752381..9a0590b 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 _0xc05e=['apply','reject','save','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','index','AnalyticMetric','rawAttributes','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','rows','catch','show','params','model','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x193382,_0x445654){var _0xa089bf=function(_0x3bf147){while(--_0x3bf147){_0x193382['push'](_0x193382['shift']());}};_0xa089bf(++_0x445654);}(_0xc05e,0x16f));var _0xec05=function(_0x394bf5,_0x4dec80){_0x394bf5=_0x394bf5-0x0;var _0x54a038=_0xc05e[_0x394bf5];return _0x54a038;};'use strict';var pdf=require(_0xec05('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xec05('0x1'));var zipdir=require(_0xec05('0x2'));var jsonpatch=require(_0xec05('0x3'));var rp=require(_0xec05('0x4'));var moment=require('moment');var BPromise=require(_0xec05('0x5'));var Mustache=require(_0xec05('0x6'));var util=require(_0xec05('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xec05('0x8'));var ejs=require(_0xec05('0x9'));var fs=require('fs');var _=require(_0xec05('0xa'));var squel=require('squel');var crypto=require(_0xec05('0xb'));var jsforce=require(_0xec05('0xc'));var deskjs=require(_0xec05('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xec05('0xe'));var hardwareService=require(_0xec05('0xf'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xec05('0x10'))('api');var utils=require(_0xec05('0x11'));var config=require(_0xec05('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d0846,_0x29b5f6){_0x29b5f6=_0x29b5f6||0xcc;return function(_0x13073f){if(_0x13073f){return _0x3d0846[_0xec05('0x13')](_0x29b5f6);}return _0x3d0846[_0xec05('0x14')](_0x29b5f6)[_0xec05('0x15')]();};}function respondWithResult(_0x1640dd,_0x3d65d0){_0x3d65d0=_0x3d65d0||0xc8;return function(_0x440fac){if(_0x440fac){return _0x1640dd[_0xec05('0x14')](_0x3d65d0)[_0xec05('0x16')](_0x440fac);}};}function respondWithFilteredResult(_0x510c90,_0x5ca17f){return function(_0x58b6c0){if(_0x58b6c0){var _0x1a586d=_0x58b6c0[_0xec05('0x17')],_0x198253=_0x5ca17f[_0xec05('0x18')],_0x28a62d=_0x5ca17f[_0xec05('0x18')]+_0x5ca17f[_0xec05('0x19')],_0x56b586;if(_0x28a62d>=_0x1a586d){_0x28a62d=_0x1a586d;_0x56b586=0xc8;}else{_0x56b586=0xce;}_0x510c90[_0xec05('0x14')](_0x56b586);return _0x510c90[_0xec05('0x1a')](_0xec05('0x1b'),_0x198253+'-'+_0x28a62d+'/'+_0x1a586d)[_0xec05('0x16')](_0x58b6c0);}return null;};}function patchUpdates(_0x2c0035){return function(_0x57ccc6){try{jsonpatch[_0xec05('0x1c')](_0x57ccc6,_0x2c0035,!![]);}catch(_0x336753){return BPromise[_0xec05('0x1d')](_0x336753);}return _0x57ccc6[_0xec05('0x1e')]();};}function saveUpdates(_0x23dece,_0x49f650){return function(_0x19c132){if(_0x19c132){return _0x19c132['update'](_0x23dece)[_0xec05('0x1f')](function(_0x10558f){return _0x10558f;});}return null;};}function removeEntity(_0x155f41,_0x326f6c){return function(_0x5213a9){if(_0x5213a9){return _0x5213a9[_0xec05('0x20')]()['then'](function(){var _0x3bf4cf=_0x5213a9[_0xec05('0x21')]({'plain':!![]});var _0x5875b2=_0xec05('0x22');return db[_0xec05('0x23')][_0xec05('0x20')]({'where':{'type':_0x5875b2,'resourceId':_0x3bf4cf['id']}})[_0xec05('0x1f')](function(){return _0x5213a9;});})[_0xec05('0x1f')](function(){_0x155f41[_0xec05('0x14')](0xcc)[_0xec05('0x15')]();});}};}function handleEntityNotFound(_0x55d8e9,_0x3a1231){return function(_0x32e154){if(!_0x32e154){_0x55d8e9[_0xec05('0x13')](0x194);}return _0x32e154;};}function handleError(_0x4136f0,_0x1f0d48){_0x1f0d48=_0x1f0d48||0x1f4;return function(_0xa20af6){logger[_0xec05('0x24')](_0xa20af6[_0xec05('0x25')]);if(_0xa20af6[_0xec05('0x26')]){delete _0xa20af6[_0xec05('0x26')];}_0x4136f0['status'](_0x1f0d48)[_0xec05('0x27')](_0xa20af6);};}exports[_0xec05('0x28')]=function(_0x5b9c16,_0x588699){var _0x428f13={},_0x581477={},_0x1e7c29={'count':0x0,'rows':[]};var _0x58af76=db[_0xec05('0x29')][_0xec05('0x2a')];_0x581477['model']=_[_0xec05('0x2b')](_0x58af76);_0x581477[_0xec05('0x2c')]=_['keys'](_0x5b9c16['query']);_0x581477[_0xec05('0x2d')]=_[_0xec05('0x2e')](_0x581477['model'],_0x581477[_0xec05('0x2c')]);_0x428f13[_0xec05('0x2f')]=_[_0xec05('0x2e')](_0x581477['model'],qs[_0xec05('0x30')](_0x5b9c16[_0xec05('0x2c')][_0xec05('0x30')]));_0x428f13[_0xec05('0x2f')]=_0x428f13[_0xec05('0x2f')][_0xec05('0x31')]?_0x428f13['attributes']:_0x581477['model'];if(!_0x5b9c16[_0xec05('0x2c')]['hasOwnProperty'](_0xec05('0x32'))){_0x428f13[_0xec05('0x19')]=qs[_0xec05('0x19')](_0x5b9c16['query'][_0xec05('0x19')]);_0x428f13[_0xec05('0x18')]=qs[_0xec05('0x18')](_0x5b9c16['query']['offset']);}_0x428f13[_0xec05('0x33')]=qs['sort'](_0x5b9c16['query'][_0xec05('0x34')]);_0x428f13[_0xec05('0x35')]=qs[_0xec05('0x2d')](_[_0xec05('0x36')](_0x5b9c16[_0xec05('0x2c')],_0x581477[_0xec05('0x2d')]));if(_0x5b9c16[_0xec05('0x2c')][_0xec05('0x37')]){_0x428f13['where']=_['merge'](_0x428f13[_0xec05('0x35')],{'$or':_[_0xec05('0x38')](_0x58af76,function(_0x38441a){if(_0x38441a['type'][_0xec05('0x39')]!==_0xec05('0x3a')){var _0x2156d7={};_0x2156d7[_0x38441a[_0xec05('0x3b')]]={'$like':'%'+_0x5b9c16[_0xec05('0x2c')][_0xec05('0x37')]+'%'};return _0x2156d7;}})});}_0x428f13=_[_0xec05('0x3c')]({},_0x428f13,_0x5b9c16[_0xec05('0x3d')]);var _0x46fc99={'where':_0x428f13[_0xec05('0x35')]};return db[_0xec05('0x29')][_0xec05('0x17')](_0x46fc99)[_0xec05('0x1f')](function(_0x1a848d){_0x1e7c29[_0xec05('0x17')]=_0x1a848d;if(_0x5b9c16['query']['includeAll']){_0x428f13['include']=[{'all':!![]}];}return db[_0xec05('0x29')]['findAll'](_0x428f13);})['then'](function(_0x19fd59){_0x1e7c29[_0xec05('0x3e')]=_0x19fd59;return _0x1e7c29;})[_0xec05('0x1f')](respondWithFilteredResult(_0x588699,_0x428f13))[_0xec05('0x3f')](handleError(_0x588699,null));};exports[_0xec05('0x40')]=function(_0x268b7c,_0x314812){var _0x4519e8={'raw':!![],'where':{'id':_0x268b7c[_0xec05('0x41')]['id']}},_0xb55870={};_0xb55870[_0xec05('0x42')]=_['keys'](db['AnalyticMetric'][_0xec05('0x2a')]);_0xb55870['query']=_[_0xec05('0x2b')](_0x268b7c['query']);_0xb55870['filters']=_[_0xec05('0x2e')](_0xb55870[_0xec05('0x42')],_0xb55870['query']);_0x4519e8[_0xec05('0x2f')]=_[_0xec05('0x2e')](_0xb55870['model'],qs[_0xec05('0x30')](_0x268b7c[_0xec05('0x2c')][_0xec05('0x30')]));_0x4519e8[_0xec05('0x2f')]=_0x4519e8[_0xec05('0x2f')][_0xec05('0x31')]?_0x4519e8[_0xec05('0x2f')]:_0xb55870[_0xec05('0x42')];if(_0x268b7c[_0xec05('0x2c')][_0xec05('0x43')]){_0x4519e8[_0xec05('0x44')]=[{'all':!![]}];}_0x4519e8=_['merge']({},_0x4519e8,_0x268b7c[_0xec05('0x3d')]);return db[_0xec05('0x29')][_0xec05('0x45')](_0x4519e8)[_0xec05('0x1f')](handleEntityNotFound(_0x314812,null))[_0xec05('0x1f')](respondWithResult(_0x314812,null))[_0xec05('0x3f')](handleError(_0x314812,null));};exports[_0xec05('0x46')]=function(_0xfec07d,_0x357c12){return db[_0xec05('0x29')][_0xec05('0x46')](_0xfec07d[_0xec05('0x47')],{})[_0xec05('0x1f')](function(_0x2db6ac){var _0x445192=_0xfec07d[_0xec05('0x48')][_0xec05('0x21')]({'plain':!![]});if(!_0x445192)throw new Error(_0xec05('0x49'));if(_0x445192[_0xec05('0x4a')]===_0xec05('0x48')){var _0x4d0e9f=_0x2db6ac['get']({'plain':!![]});var _0x35dff4=_0xec05('0x22');return db[_0xec05('0x4b')][_0xec05('0x45')]({'where':{'name':_0x35dff4,'userProfileId':_0x445192[_0xec05('0x4c')]},'raw':!![]})[_0xec05('0x1f')](function(_0x3b85f5){if(_0x3b85f5&&_0x3b85f5[_0xec05('0x4d')]===0x0){return db['UserProfileResource'][_0xec05('0x46')]({'name':_0x4d0e9f[_0xec05('0x26')],'resourceId':_0x4d0e9f['id'],'type':_0x3b85f5[_0xec05('0x26')],'sectionId':_0x3b85f5['id']},{})[_0xec05('0x1f')](function(){return _0x2db6ac;});}else{return _0x2db6ac;}})[_0xec05('0x3f')](function(_0x5090e0){logger[_0xec05('0x24')](_0xec05('0x4e'),_0x5090e0);throw _0x5090e0;});}return _0x2db6ac;})['then'](respondWithResult(_0x357c12,0xc9))[_0xec05('0x3f')](handleError(_0x357c12,null));};exports['update']=function(_0x22997a,_0x164fda){if(_0x22997a['body']['id']){delete _0x22997a['body']['id'];}return db[_0xec05('0x29')][_0xec05('0x45')]({'where':{'id':_0x22997a[_0xec05('0x41')]['id']}})[_0xec05('0x1f')](handleEntityNotFound(_0x164fda,null))[_0xec05('0x1f')](saveUpdates(_0x22997a[_0xec05('0x47')],null))['then'](respondWithResult(_0x164fda,null))[_0xec05('0x3f')](handleError(_0x164fda,null));};exports[_0xec05('0x20')]=function(_0x3b3884,_0x2825c1){return db['AnalyticMetric'][_0xec05('0x45')]({'where':{'id':_0x3b3884['params']['id']}})[_0xec05('0x1f')](handleEntityNotFound(_0x2825c1,null))[_0xec05('0x1f')](removeEntity(_0x2825c1,null))[_0xec05('0x3f')](handleError(_0x2825c1,null));}; \ No newline at end of file +var _0xab46=['type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','destroy','get','UserProfileResource','end','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xab46,0x190));var _0x6ab4=function(_0x27ccb6,_0x103913){_0x27ccb6=_0x27ccb6-0x0;var _0x412043=_0xab46[_0x27ccb6];return _0x412043;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ab4('0x0'));var jsonpatch=require(_0x6ab4('0x1'));var rp=require('request-promise');var moment=require(_0x6ab4('0x2'));var BPromise=require(_0x6ab4('0x3'));var Mustache=require(_0x6ab4('0x4'));var util=require('util');var path=require(_0x6ab4('0x5'));var sox=require(_0x6ab4('0x6'));var csv=require(_0x6ab4('0x7'));var ejs=require(_0x6ab4('0x8'));var fs=require('fs');var _=require(_0x6ab4('0x9'));var squel=require(_0x6ab4('0xa'));var crypto=require('crypto');var jsforce=require(_0x6ab4('0xb'));var deskjs=require(_0x6ab4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x6ab4('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x6ab4('0xe'));var logger=require(_0x6ab4('0xf'))(_0x6ab4('0x10'));var utils=require(_0x6ab4('0x11'));var config=require(_0x6ab4('0x12'));var db=require(_0x6ab4('0x13'))['db'];function respondWithStatusCode(_0x2abc5a,_0x38d3dc){_0x38d3dc=_0x38d3dc||0xcc;return function(_0x3dea39){if(_0x3dea39){return _0x2abc5a[_0x6ab4('0x14')](_0x38d3dc);}return _0x2abc5a['status'](_0x38d3dc)['end']();};}function respondWithResult(_0xc770fe,_0x447a72){_0x447a72=_0x447a72||0xc8;return function(_0x1392a3){if(_0x1392a3){return _0xc770fe[_0x6ab4('0x15')](_0x447a72)[_0x6ab4('0x16')](_0x1392a3);}};}function respondWithFilteredResult(_0x4e3e94,_0x4145e8){return function(_0x210b4d){if(_0x210b4d){var _0x12c1ed=_0x210b4d[_0x6ab4('0x17')],_0x350b44=_0x4145e8[_0x6ab4('0x18')],_0x28f6f0=_0x4145e8[_0x6ab4('0x18')]+_0x4145e8[_0x6ab4('0x19')],_0x2a7ebc;if(_0x28f6f0>=_0x12c1ed){_0x28f6f0=_0x12c1ed;_0x2a7ebc=0xc8;}else{_0x2a7ebc=0xce;}_0x4e3e94[_0x6ab4('0x15')](_0x2a7ebc);return _0x4e3e94[_0x6ab4('0x1a')]('Content-Range',_0x350b44+'-'+_0x28f6f0+'/'+_0x12c1ed)[_0x6ab4('0x16')](_0x210b4d);}return null;};}function patchUpdates(_0x33ec18){return function(_0x42833a){try{jsonpatch[_0x6ab4('0x1b')](_0x42833a,_0x33ec18,!![]);}catch(_0x286ef6){return BPromise['reject'](_0x286ef6);}return _0x42833a[_0x6ab4('0x1c')]();};}function saveUpdates(_0x5816ec,_0x4c9c5a){return function(_0x114916){if(_0x114916){return _0x114916[_0x6ab4('0x1d')](_0x5816ec)[_0x6ab4('0x1e')](function(_0x2cf5ca){return _0x2cf5ca;});}return null;};}function removeEntity(_0x565d43,_0x496fb4){return function(_0xe9290b){if(_0xe9290b){return _0xe9290b[_0x6ab4('0x1f')]()['then'](function(){var _0x400ac0=_0xe9290b[_0x6ab4('0x20')]({'plain':!![]});var _0x258e8a='Metrics';return db[_0x6ab4('0x21')][_0x6ab4('0x1f')]({'where':{'type':_0x258e8a,'resourceId':_0x400ac0['id']}})[_0x6ab4('0x1e')](function(){return _0xe9290b;});})['then'](function(){_0x565d43[_0x6ab4('0x15')](0xcc)[_0x6ab4('0x22')]();});}};}function handleEntityNotFound(_0x2a57ff,_0x15f744){return function(_0x1e1de3){if(!_0x1e1de3){_0x2a57ff['sendStatus'](0x194);}return _0x1e1de3;};}function handleError(_0xa731a8,_0x97ef8){_0x97ef8=_0x97ef8||0x1f4;return function(_0x714f3a){logger['error'](_0x714f3a['stack']);if(_0x714f3a[_0x6ab4('0x23')]){delete _0x714f3a['name'];}_0xa731a8[_0x6ab4('0x15')](_0x97ef8)[_0x6ab4('0x24')](_0x714f3a);};}exports[_0x6ab4('0x25')]=function(_0x5db61a,_0x858102){var _0x1e4584={},_0x274653={},_0x43d361={'count':0x0,'rows':[]};var _0x2f2a3a=db[_0x6ab4('0x26')][_0x6ab4('0x27')];_0x274653[_0x6ab4('0x28')]=_[_0x6ab4('0x29')](_0x2f2a3a);_0x274653[_0x6ab4('0x2a')]=_['keys'](_0x5db61a[_0x6ab4('0x2a')]);_0x274653[_0x6ab4('0x2b')]=_[_0x6ab4('0x2c')](_0x274653[_0x6ab4('0x28')],_0x274653['query']);_0x1e4584[_0x6ab4('0x2d')]=_[_0x6ab4('0x2c')](_0x274653[_0x6ab4('0x28')],qs[_0x6ab4('0x2e')](_0x5db61a['query'][_0x6ab4('0x2e')]));_0x1e4584[_0x6ab4('0x2d')]=_0x1e4584['attributes'][_0x6ab4('0x2f')]?_0x1e4584[_0x6ab4('0x2d')]:_0x274653[_0x6ab4('0x28')];if(!_0x5db61a['query'][_0x6ab4('0x30')]('nolimit')){_0x1e4584[_0x6ab4('0x19')]=qs['limit'](_0x5db61a[_0x6ab4('0x2a')][_0x6ab4('0x19')]);_0x1e4584[_0x6ab4('0x18')]=qs[_0x6ab4('0x18')](_0x5db61a['query']['offset']);}_0x1e4584[_0x6ab4('0x31')]=qs[_0x6ab4('0x32')](_0x5db61a['query']['sort']);_0x1e4584[_0x6ab4('0x33')]=qs[_0x6ab4('0x2b')](_[_0x6ab4('0x34')](_0x5db61a[_0x6ab4('0x2a')],_0x274653[_0x6ab4('0x2b')]));if(_0x5db61a[_0x6ab4('0x2a')][_0x6ab4('0x35')]){_0x1e4584[_0x6ab4('0x33')]=_[_0x6ab4('0x36')](_0x1e4584[_0x6ab4('0x33')],{'$or':_[_0x6ab4('0x37')](_0x2f2a3a,function(_0x4420eb){if(_0x4420eb[_0x6ab4('0x38')][_0x6ab4('0x39')]!==_0x6ab4('0x3a')){var _0x2a8855={};_0x2a8855[_0x4420eb[_0x6ab4('0x3b')]]={'$like':'%'+_0x5db61a['query'][_0x6ab4('0x35')]+'%'};return _0x2a8855;}})});}_0x1e4584=_['merge']({},_0x1e4584,_0x5db61a[_0x6ab4('0x3c')]);var _0xfe4c86={'where':_0x1e4584['where']};return db[_0x6ab4('0x26')][_0x6ab4('0x17')](_0xfe4c86)[_0x6ab4('0x1e')](function(_0x3ca5df){_0x43d361[_0x6ab4('0x17')]=_0x3ca5df;if(_0x5db61a[_0x6ab4('0x2a')][_0x6ab4('0x3d')]){_0x1e4584[_0x6ab4('0x3e')]=[{'all':!![]}];}return db[_0x6ab4('0x26')][_0x6ab4('0x3f')](_0x1e4584);})['then'](function(_0x3a78de){_0x43d361['rows']=_0x3a78de;return _0x43d361;})[_0x6ab4('0x1e')](respondWithFilteredResult(_0x858102,_0x1e4584))['catch'](handleError(_0x858102,null));};exports[_0x6ab4('0x40')]=function(_0x53f878,_0x2686ae){var _0x3b3203={'raw':!![],'where':{'id':_0x53f878[_0x6ab4('0x41')]['id']}},_0x29e59d={};_0x29e59d[_0x6ab4('0x28')]=_[_0x6ab4('0x29')](db[_0x6ab4('0x26')][_0x6ab4('0x27')]);_0x29e59d[_0x6ab4('0x2a')]=_['keys'](_0x53f878[_0x6ab4('0x2a')]);_0x29e59d[_0x6ab4('0x2b')]=_['intersection'](_0x29e59d['model'],_0x29e59d[_0x6ab4('0x2a')]);_0x3b3203[_0x6ab4('0x2d')]=_[_0x6ab4('0x2c')](_0x29e59d[_0x6ab4('0x28')],qs[_0x6ab4('0x2e')](_0x53f878[_0x6ab4('0x2a')][_0x6ab4('0x2e')]));_0x3b3203[_0x6ab4('0x2d')]=_0x3b3203[_0x6ab4('0x2d')]['length']?_0x3b3203[_0x6ab4('0x2d')]:_0x29e59d[_0x6ab4('0x28')];if(_0x53f878[_0x6ab4('0x2a')][_0x6ab4('0x3d')]){_0x3b3203[_0x6ab4('0x3e')]=[{'all':!![]}];}_0x3b3203=_[_0x6ab4('0x36')]({},_0x3b3203,_0x53f878[_0x6ab4('0x3c')]);return db[_0x6ab4('0x26')][_0x6ab4('0x42')](_0x3b3203)[_0x6ab4('0x1e')](handleEntityNotFound(_0x2686ae,null))[_0x6ab4('0x1e')](respondWithResult(_0x2686ae,null))['catch'](handleError(_0x2686ae,null));};exports[_0x6ab4('0x43')]=function(_0x27a055,_0x1dac20){return db[_0x6ab4('0x26')]['create'](_0x27a055[_0x6ab4('0x44')],{})['then'](function(_0x1e53f1){var _0x13419d=_0x27a055[_0x6ab4('0x45')][_0x6ab4('0x20')]({'plain':!![]});if(!_0x13419d)throw new Error(_0x6ab4('0x46'));if(_0x13419d[_0x6ab4('0x47')]===_0x6ab4('0x45')){var _0x412f4b=_0x1e53f1[_0x6ab4('0x20')]({'plain':!![]});var _0x3c8434='Metrics';return db[_0x6ab4('0x48')][_0x6ab4('0x42')]({'where':{'name':_0x3c8434,'userProfileId':_0x13419d['userProfileId']},'raw':!![]})[_0x6ab4('0x1e')](function(_0x46cd4d){if(_0x46cd4d&&_0x46cd4d['autoAssociation']===0x0){return db['UserProfileResource'][_0x6ab4('0x43')]({'name':_0x412f4b[_0x6ab4('0x23')],'resourceId':_0x412f4b['id'],'type':_0x46cd4d[_0x6ab4('0x23')],'sectionId':_0x46cd4d['id']},{})[_0x6ab4('0x1e')](function(){return _0x1e53f1;});}else{return _0x1e53f1;}})['catch'](function(_0x20492d){logger[_0x6ab4('0x49')](_0x6ab4('0x4a'),_0x20492d);throw _0x20492d;});}return _0x1e53f1;})[_0x6ab4('0x1e')](respondWithResult(_0x1dac20,0xc9))[_0x6ab4('0x4b')](handleError(_0x1dac20,null));};exports[_0x6ab4('0x1d')]=function(_0x53d0f0,_0x4cf999){if(_0x53d0f0[_0x6ab4('0x44')]['id']){delete _0x53d0f0[_0x6ab4('0x44')]['id'];}return db['AnalyticMetric'][_0x6ab4('0x42')]({'where':{'id':_0x53d0f0[_0x6ab4('0x41')]['id']}})[_0x6ab4('0x1e')](handleEntityNotFound(_0x4cf999,null))[_0x6ab4('0x1e')](saveUpdates(_0x53d0f0[_0x6ab4('0x44')],null))[_0x6ab4('0x1e')](respondWithResult(_0x4cf999,null))[_0x6ab4('0x4b')](handleError(_0x4cf999,null));};exports[_0x6ab4('0x1f')]=function(_0x5d653a,_0x1125a0){return db['AnalyticMetric']['find']({'where':{'id':_0x5d653a[_0x6ab4('0x41')]['id']}})[_0x6ab4('0x1e')](handleEntityNotFound(_0x1125a0,null))[_0x6ab4('0x1e')](removeEntity(_0x1125a0,null))[_0x6ab4('0x4b')](handleError(_0x1125a0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index f21a317..6326f7c 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 _0x4151=['AnalyticMetric','util','api','moment','bluebird','request-promise','exports','define'];(function(_0x43ef10,_0x271ce4){var _0x2d31ae=function(_0x19b8c2){while(--_0x19b8c2){_0x43ef10['push'](_0x43ef10['shift']());}};_0x2d31ae(++_0x271ce4);}(_0x4151,0xd9));var _0x1415=function(_0x27a1a0,_0x32380c){_0x27a1a0=_0x27a1a0-0x0;var _0x38cf5c=_0x4151[_0x27a1a0];return _0x38cf5c;};'use strict';var _=require('lodash');var util=require(_0x1415('0x0'));var logger=require('../../config/logger')(_0x1415('0x1'));var moment=require(_0x1415('0x2'));var BPromise=require(_0x1415('0x3'));var rp=require(_0x1415('0x4'));var attributes=require('./analyticMetric.attributes');module[_0x1415('0x5')]=function(_0x3d8ea4,_0x59ca98){return _0x3d8ea4[_0x1415('0x6')](_0x1415('0x7'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b1e=['../../config/logger','api','moment','request-promise','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x1b1e,0x76));var _0xe1b1=function(_0x43b9f7,_0x32f5a7){_0x43b9f7=_0x43b9f7-0x0;var _0x102365=_0x1b1e[_0x43b9f7];return _0x102365;};'use strict';var _=require(_0xe1b1('0x0'));var util=require(_0xe1b1('0x1'));var logger=require(_0xe1b1('0x2'))(_0xe1b1('0x3'));var moment=require(_0xe1b1('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1b1('0x5'));var attributes=require(_0xe1b1('0x6'));module[_0xe1b1('0x7')]=function(_0x1cf967,_0x1437dc){return _0x1cf967[_0xe1b1('0x8')]('AnalyticMetric',attributes,{'tableName':_0xe1b1('0x9'),'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 6db66cb..e9e554d 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 _0x4711=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x540bc9,_0x3aebf4){var _0x415b7e=function(_0x3cd87e){while(--_0x3cd87e){_0x540bc9['push'](_0x540bc9['shift']());}};_0x415b7e(++_0x3aebf4);}(_0x4711,0x10c));var _0x1471=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4711[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1471('0x0'));var util=require(_0x1471('0x1'));var moment=require(_0x1471('0x2'));var BPromise=require(_0x1471('0x3'));var rs=require(_0x1471('0x4'));var fs=require('fs');var Redis=require(_0x1471('0x5'));var db=require(_0x1471('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1471('0x7'))('rpc');var config=require(_0x1471('0x8'));var jayson=require(_0x1471('0x9'));var client=jayson[_0x1471('0xa')][_0x1471('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1be347,_0x4d1a90,_0x1cf7db){return new BPromise(function(_0x853506,_0x319c27){return client[_0x1471('0xc')](_0x1be347,_0x1cf7db)[_0x1471('0xd')](function(_0x4ddede){logger['info'](_0x1471('0xe'),_0x4d1a90,_0x1471('0xf'));logger[_0x1471('0x10')](_0x1471('0x11'),_0x4d1a90,_0x1471('0xf'),JSON[_0x1471('0x12')](_0x4ddede));if(_0x4ddede[_0x1471('0x13')]){if(_0x4ddede[_0x1471('0x13')]['code']===0x1f4){logger[_0x1471('0x13')](_0x1471('0xe'),_0x4d1a90,_0x4ddede[_0x1471('0x13')][_0x1471('0x14')]);return _0x319c27(_0x4ddede[_0x1471('0x13')]['message']);}logger[_0x1471('0x13')](_0x1471('0xe'),_0x4d1a90,_0x4ddede[_0x1471('0x13')]['message']);return _0x853506(_0x4ddede[_0x1471('0x13')][_0x1471('0x14')]);}else{logger[_0x1471('0x15')](_0x1471('0xe'),_0x4d1a90,_0x1471('0xf'));_0x853506(_0x4ddede[_0x1471('0x16')][_0x1471('0x14')]);}})[_0x1471('0x17')](function(_0x11ea35){logger[_0x1471('0x13')](_0x1471('0xe'),_0x4d1a90,_0x11ea35);_0x319c27(_0x11ea35);});});} \ No newline at end of file +var _0x3c6d=['../../config/environment','client','http','then','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xfaac3c,_0x425397){var _0x3bc685=function(_0x87d44d){while(--_0x87d44d){_0xfaac3c['push'](_0xfaac3c['shift']());}};_0x3bc685(++_0x425397);}(_0x3c6d,0x199));var _0xd3c6=function(_0x36f8d8,_0x5cba49){_0x36f8d8=_0x36f8d8-0x0;var _0x4c93cd=_0x3c6d[_0x36f8d8];return _0x4c93cd;};'use strict';var _=require(_0xd3c6('0x0'));var util=require(_0xd3c6('0x1'));var moment=require(_0xd3c6('0x2'));var BPromise=require(_0xd3c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3c6('0x4'));var db=require(_0xd3c6('0x5'))['db'];var utils=require(_0xd3c6('0x6'));var logger=require(_0xd3c6('0x7'))(_0xd3c6('0x8'));var config=require(_0xd3c6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd3c6('0xa')][_0xd3c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x438b25,_0x303abf,_0x341f8a){return new BPromise(function(_0x15a1c9,_0x4c29bb){return client['request'](_0x438b25,_0x341f8a)[_0xd3c6('0xc')](function(_0x23afce){logger[_0xd3c6('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x303abf,_0xd3c6('0xe'));logger['debug'](_0xd3c6('0xf'),_0x303abf,'request\x20sent',JSON['stringify'](_0x23afce));if(_0x23afce[_0xd3c6('0x10')]){if(_0x23afce[_0xd3c6('0x10')][_0xd3c6('0x11')]===0x1f4){logger[_0xd3c6('0x10')](_0xd3c6('0x12'),_0x303abf,_0x23afce[_0xd3c6('0x10')][_0xd3c6('0x13')]);return _0x4c29bb(_0x23afce[_0xd3c6('0x10')][_0xd3c6('0x13')]);}logger[_0xd3c6('0x10')](_0xd3c6('0x12'),_0x303abf,_0x23afce['error'][_0xd3c6('0x13')]);return _0x15a1c9(_0x23afce[_0xd3c6('0x10')][_0xd3c6('0x13')]);}else{logger[_0xd3c6('0xd')](_0xd3c6('0x12'),_0x303abf,_0xd3c6('0xe'));_0x15a1c9(_0x23afce[_0xd3c6('0x14')][_0xd3c6('0x13')]);}})[_0xd3c6('0x15')](function(_0x14a5f1){logger[_0xd3c6('0x10')](_0xd3c6('0x12'),_0x303abf,_0x14a5f1);_0x4c29bb(_0x14a5f1);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 253be4d..b70e776 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 _0xc0d7=['/:id','show','create','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x51946f,_0x473c98){var _0x551273=function(_0x303cf4){while(--_0x303cf4){_0x51946f['push'](_0x51946f['shift']());}};_0x551273(++_0x473c98);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x32605d,_0x1018d1){_0x32605d=_0x32605d-0x0;var _0x2dc19c=_0xc0d7[_0x32605d];return _0x2dc19c;};'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 _0x4bd3=['isAuthenticated','index','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4bd3,0x174));var _0x34bd=function(_0x242c7d,_0x4bfaad){_0x242c7d=_0x242c7d-0x0;var _0x397bea=_0x4bd3[_0x242c7d];return _0x397bea;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x34bd('0x3'));var config=require(_0x34bd('0x4'));var controller=require(_0x34bd('0x5'));router['get']('/',auth[_0x34bd('0x6')](),controller[_0x34bd('0x7')]);router['get'](_0x34bd('0x8'),auth[_0x34bd('0x6')](),controller['show']);router[_0x34bd('0x9')]('/',auth[_0x34bd('0x6')](),controller[_0x34bd('0xa')]);router[_0x34bd('0xb')](_0x34bd('0x8'),auth[_0x34bd('0x6')](),controller['update']);router[_0x34bd('0xc')](_0x34bd('0x8'),auth[_0x34bd('0x6')](),controller[_0x34bd('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 5c84669..315b9d7 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 _0x88d4=['TEXT','sequelize','exports'];(function(_0x3b5a22,_0x2ad223){var _0x7e236a=function(_0x3084d0){while(--_0x3084d0){_0x3b5a22['push'](_0x3b5a22['shift']());}};_0x7e236a(++_0x2ad223);}(_0x88d4,0x1c3));var _0x488d=function(_0x1b1942,_0x458c19){_0x1b1942=_0x1b1942-0x0;var _0x471eb8=_0x88d4[_0x1b1942];return _0x471eb8;};'use strict';var Sequelize=require(_0x488d('0x0'));module[_0x488d('0x1')]={'tree':{'type':Sequelize[_0x488d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc5c1=['exports','TEXT'];(function(_0x4b10df,_0x32f4d7){var _0x1da949=function(_0x11fb02){while(--_0x11fb02){_0x4b10df['push'](_0x4b10df['shift']());}};_0x1da949(++_0x32f4d7);}(_0xc5c1,0x64));var _0x1c5c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc5c1[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x1c5c('0x0')]={'tree':{'type':Sequelize[_0x1c5c('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 5f1b97f..3770b3e 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 _0x98b8=['../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','save','then','destroy','sendStatus','error','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','AnalyticTreeReport','findAll','rows','catch','params','include','find','create','body','html-pdf','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api'];(function(_0x42f4db,_0x2bbcc4){var _0x1b38ee=function(_0x3cba9c){while(--_0x3cba9c){_0x42f4db['push'](_0x42f4db['shift']());}};_0x1b38ee(++_0x2bbcc4);}(_0x98b8,0x70));var _0x898b=function(_0x1098ec,_0x2afc61){_0x1098ec=_0x1098ec-0x0;var _0x35b0ca=_0x98b8[_0x1098ec];return _0x35b0ca;};'use strict';var pdf=require(_0x898b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x898b('0x1'));var moment=require(_0x898b('0x2'));var BPromise=require(_0x898b('0x3'));var Mustache=require(_0x898b('0x4'));var util=require('util');var path=require(_0x898b('0x5'));var sox=require('sox');var csv=require(_0x898b('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x898b('0x7'));var squel=require(_0x898b('0x8'));var crypto=require(_0x898b('0x9'));var jsforce=require(_0x898b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x898b('0x6'));var querystring=require(_0x898b('0xb'));var Papa=require(_0x898b('0xc'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x898b('0xd'));var qs=require(_0x898b('0xe'));var logger=require('../../config/logger')(_0x898b('0xf'));var utils=require(_0x898b('0x10'));var config=require(_0x898b('0x11'));var db=require(_0x898b('0x12'))['db'];function respondWithStatusCode(_0xdb0859,_0x14e2e6){_0x14e2e6=_0x14e2e6||0xcc;return function(_0xe038a4){if(_0xe038a4){return _0xdb0859['sendStatus'](_0x14e2e6);}return _0xdb0859[_0x898b('0x13')](_0x14e2e6)['end']();};}function respondWithResult(_0x40ec57,_0x105f91){_0x105f91=_0x105f91||0xc8;return function(_0x440218){if(_0x440218){return _0x40ec57['status'](_0x105f91)[_0x898b('0x14')](_0x440218);}};}function respondWithFilteredResult(_0x30e81e,_0x51177b){return function(_0x405e81){if(_0x405e81){var _0x34c614=_0x405e81[_0x898b('0x15')],_0xa6a61d=_0x51177b[_0x898b('0x16')],_0x17124b=_0x51177b[_0x898b('0x16')]+_0x51177b[_0x898b('0x17')],_0xc70235;if(_0x17124b>=_0x34c614){_0x17124b=_0x34c614;_0xc70235=0xc8;}else{_0xc70235=0xce;}_0x30e81e[_0x898b('0x13')](_0xc70235);return _0x30e81e['set'](_0x898b('0x18'),_0xa6a61d+'-'+_0x17124b+'/'+_0x34c614)[_0x898b('0x14')](_0x405e81);}return null;};}function patchUpdates(_0x5980bf){return function(_0x26cd1c){try{jsonpatch[_0x898b('0x19')](_0x26cd1c,_0x5980bf,!![]);}catch(_0x414381){return BPromise['reject'](_0x414381);}return _0x26cd1c[_0x898b('0x1a')]();};}function saveUpdates(_0x187d2e,_0x16da57){return function(_0x133311){if(_0x133311){return _0x133311['update'](_0x187d2e)[_0x898b('0x1b')](function(_0x57e298){return _0x57e298;});}return null;};}function removeEntity(_0x5c2630,_0x1c57b7){return function(_0x332060){if(_0x332060){return _0x332060[_0x898b('0x1c')]()[_0x898b('0x1b')](function(){_0x5c2630[_0x898b('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d7fc4,_0x5707bf){return function(_0xc2fb46){if(!_0xc2fb46){_0x2d7fc4[_0x898b('0x1d')](0x194);}return _0xc2fb46;};}function handleError(_0x4f64e6,_0x56cb7b){_0x56cb7b=_0x56cb7b||0x1f4;return function(_0x917dd9){logger[_0x898b('0x1e')](_0x917dd9['stack']);if(_0x917dd9[_0x898b('0x1f')]){delete _0x917dd9[_0x898b('0x1f')];}_0x4f64e6[_0x898b('0x13')](_0x56cb7b)[_0x898b('0x20')](_0x917dd9);};}exports[_0x898b('0x21')]=function(_0x2d0a1b,_0x50f84c){var _0x414814={},_0x1ad5b7={},_0x498ef5={'count':0x0,'rows':[]};var _0x16148c=db['AnalyticTreeReport'][_0x898b('0x22')];_0x1ad5b7[_0x898b('0x23')]=_[_0x898b('0x24')](_0x16148c);_0x1ad5b7[_0x898b('0x25')]=_[_0x898b('0x24')](_0x2d0a1b[_0x898b('0x25')]);_0x1ad5b7['filters']=_[_0x898b('0x26')](_0x1ad5b7['model'],_0x1ad5b7[_0x898b('0x25')]);_0x414814[_0x898b('0x27')]=_[_0x898b('0x26')](_0x1ad5b7[_0x898b('0x23')],qs[_0x898b('0x28')](_0x2d0a1b[_0x898b('0x25')][_0x898b('0x28')]));_0x414814[_0x898b('0x27')]=_0x414814[_0x898b('0x27')][_0x898b('0x29')]?_0x414814[_0x898b('0x27')]:_0x1ad5b7[_0x898b('0x23')];if(!_0x2d0a1b['query'][_0x898b('0x2a')](_0x898b('0x2b'))){_0x414814['limit']=qs[_0x898b('0x17')](_0x2d0a1b[_0x898b('0x25')][_0x898b('0x17')]);_0x414814[_0x898b('0x16')]=qs[_0x898b('0x16')](_0x2d0a1b[_0x898b('0x25')][_0x898b('0x16')]);}_0x414814[_0x898b('0x2c')]=qs['sort'](_0x2d0a1b[_0x898b('0x25')]['sort']);_0x414814[_0x898b('0x2d')]=qs[_0x898b('0x2e')](_[_0x898b('0x2f')](_0x2d0a1b[_0x898b('0x25')],_0x1ad5b7[_0x898b('0x2e')]));if(_0x2d0a1b[_0x898b('0x25')][_0x898b('0x30')]){_0x414814['where']=_[_0x898b('0x31')](_0x414814[_0x898b('0x2d')],{'$or':_[_0x898b('0x32')](_0x16148c,function(_0x357811){if(_0x357811[_0x898b('0x33')][_0x898b('0x34')]!==_0x898b('0x35')){var _0x29bdd3={};_0x29bdd3[_0x357811[_0x898b('0x36')]]={'$like':'%'+_0x2d0a1b[_0x898b('0x25')][_0x898b('0x30')]+'%'};return _0x29bdd3;}})});}_0x414814=_['merge']({},_0x414814,_0x2d0a1b['options']);var _0x3faf9c={'where':_0x414814[_0x898b('0x2d')]};return db[_0x898b('0x37')]['count'](_0x3faf9c)['then'](function(_0xdfda66){_0x498ef5[_0x898b('0x15')]=_0xdfda66;if(_0x2d0a1b['query']['includeAll']){_0x414814['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x898b('0x38')](_0x414814);})[_0x898b('0x1b')](function(_0x4dcc2c){_0x498ef5[_0x898b('0x39')]=_0x4dcc2c;return _0x498ef5;})['then'](respondWithFilteredResult(_0x50f84c,_0x414814))[_0x898b('0x3a')](handleError(_0x50f84c,null));};exports['show']=function(_0x1aa85c,_0x41fe59){var _0x14393b={'raw':!![],'where':{'id':_0x1aa85c[_0x898b('0x3b')]['id']}},_0x597590={};_0x597590[_0x898b('0x23')]=_['keys'](db[_0x898b('0x37')][_0x898b('0x22')]);_0x597590[_0x898b('0x25')]=_[_0x898b('0x24')](_0x1aa85c[_0x898b('0x25')]);_0x597590['filters']=_[_0x898b('0x26')](_0x597590[_0x898b('0x23')],_0x597590[_0x898b('0x25')]);_0x14393b['attributes']=_[_0x898b('0x26')](_0x597590[_0x898b('0x23')],qs[_0x898b('0x28')](_0x1aa85c['query'][_0x898b('0x28')]));_0x14393b[_0x898b('0x27')]=_0x14393b['attributes'][_0x898b('0x29')]?_0x14393b[_0x898b('0x27')]:_0x597590[_0x898b('0x23')];if(_0x1aa85c[_0x898b('0x25')]['includeAll']){_0x14393b[_0x898b('0x3c')]=[{'all':!![]}];}_0x14393b=_[_0x898b('0x31')]({},_0x14393b,_0x1aa85c['options']);return db[_0x898b('0x37')][_0x898b('0x3d')](_0x14393b)['then'](handleEntityNotFound(_0x41fe59,null))[_0x898b('0x1b')](respondWithResult(_0x41fe59,null))[_0x898b('0x3a')](handleError(_0x41fe59,null));};exports[_0x898b('0x3e')]=function(_0x5e64dd,_0x23b745){return db[_0x898b('0x37')][_0x898b('0x3e')](_0x5e64dd[_0x898b('0x3f')],{})[_0x898b('0x1b')](respondWithResult(_0x23b745,0xc9))['catch'](handleError(_0x23b745,null));};exports['update']=function(_0x52fdf8,_0x3d1ea8){if(_0x52fdf8['body']['id']){delete _0x52fdf8['body']['id'];}return db[_0x898b('0x37')][_0x898b('0x3d')]({'where':{'id':_0x52fdf8[_0x898b('0x3b')]['id']}})[_0x898b('0x1b')](handleEntityNotFound(_0x3d1ea8,null))[_0x898b('0x1b')](saveUpdates(_0x52fdf8[_0x898b('0x3f')],null))[_0x898b('0x1b')](respondWithResult(_0x3d1ea8,null))[_0x898b('0x3a')](handleError(_0x3d1ea8,null));};exports[_0x898b('0x1c')]=function(_0xf4e6f2,_0x3584b5){return db[_0x898b('0x37')][_0x898b('0x3d')]({'where':{'id':_0xf4e6f2['params']['id']}})[_0x898b('0x1b')](handleEntityNotFound(_0x3584b5,null))[_0x898b('0x1b')](removeEntity(_0x3584b5,null))[_0x898b('0x3a')](handleError(_0x3584b5,null));}; \ No newline at end of file +var _0x2bfa=['set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','map','type','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','show','find','create','body','catch','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit'];(function(_0x389d23,_0x3d4ef4){var _0x10431c=function(_0x126388){while(--_0x126388){_0x389d23['push'](_0x389d23['shift']());}};_0x10431c(++_0x3d4ef4);}(_0x2bfa,0x188));var _0xa2bf=function(_0x3add28,_0x191dd7){_0x3add28=_0x3add28-0x0;var _0xb8a9aa=_0x2bfa[_0x3add28];return _0xb8a9aa;};'use strict';var pdf=require(_0xa2bf('0x0'));var emlformat=require(_0xa2bf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa2bf('0x2'));var jsonpatch=require(_0xa2bf('0x3'));var rp=require(_0xa2bf('0x4'));var moment=require(_0xa2bf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa2bf('0x6'));var util=require(_0xa2bf('0x7'));var path=require(_0xa2bf('0x8'));var sox=require(_0xa2bf('0x9'));var csv=require(_0xa2bf('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa2bf('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa2bf('0xc'));var deskjs=require(_0xa2bf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa2bf('0xe'));var Papa=require('papaparse');var authService=require(_0xa2bf('0xf'));var hardwareService=require(_0xa2bf('0x10'));var Redis=require(_0xa2bf('0x11'));var qs=require(_0xa2bf('0x12'));var logger=require(_0xa2bf('0x13'))(_0xa2bf('0x14'));var utils=require('../../config/utils');var config=require(_0xa2bf('0x15'));var db=require(_0xa2bf('0x16'))['db'];function respondWithStatusCode(_0x202f45,_0x46b487){_0x46b487=_0x46b487||0xcc;return function(_0x32e9c2){if(_0x32e9c2){return _0x202f45['sendStatus'](_0x46b487);}return _0x202f45[_0xa2bf('0x17')](_0x46b487)[_0xa2bf('0x18')]();};}function respondWithResult(_0x9f30c5,_0x67a326){_0x67a326=_0x67a326||0xc8;return function(_0x8a92c0){if(_0x8a92c0){return _0x9f30c5[_0xa2bf('0x17')](_0x67a326)[_0xa2bf('0x19')](_0x8a92c0);}};}function respondWithFilteredResult(_0x7a5ed7,_0x4eb358){return function(_0x395eb7){if(_0x395eb7){var _0x1ae9a6=_0x395eb7['count'],_0x37845c=_0x4eb358[_0xa2bf('0x1a')],_0x14f4ba=_0x4eb358[_0xa2bf('0x1a')]+_0x4eb358[_0xa2bf('0x1b')],_0x2fd970;if(_0x14f4ba>=_0x1ae9a6){_0x14f4ba=_0x1ae9a6;_0x2fd970=0xc8;}else{_0x2fd970=0xce;}_0x7a5ed7[_0xa2bf('0x17')](_0x2fd970);return _0x7a5ed7[_0xa2bf('0x1c')](_0xa2bf('0x1d'),_0x37845c+'-'+_0x14f4ba+'/'+_0x1ae9a6)[_0xa2bf('0x19')](_0x395eb7);}return null;};}function patchUpdates(_0x18eacc){return function(_0x103047){try{jsonpatch['apply'](_0x103047,_0x18eacc,!![]);}catch(_0x1550b8){return BPromise[_0xa2bf('0x1e')](_0x1550b8);}return _0x103047[_0xa2bf('0x1f')]();};}function saveUpdates(_0xdf5fef,_0x2fced4){return function(_0x36fdca){if(_0x36fdca){return _0x36fdca[_0xa2bf('0x20')](_0xdf5fef)[_0xa2bf('0x21')](function(_0x283eb5){return _0x283eb5;});}return null;};}function removeEntity(_0x16f937,_0x5d13e8){return function(_0x467119){if(_0x467119){return _0x467119[_0xa2bf('0x22')]()[_0xa2bf('0x21')](function(){_0x16f937[_0xa2bf('0x17')](0xcc)[_0xa2bf('0x18')]();});}};}function handleEntityNotFound(_0x2195a6,_0x4ef81a){return function(_0x103cf4){if(!_0x103cf4){_0x2195a6[_0xa2bf('0x23')](0x194);}return _0x103cf4;};}function handleError(_0x5ea33b,_0x139f97){_0x139f97=_0x139f97||0x1f4;return function(_0x859c48){logger[_0xa2bf('0x24')](_0x859c48[_0xa2bf('0x25')]);if(_0x859c48[_0xa2bf('0x26')]){delete _0x859c48[_0xa2bf('0x26')];}_0x5ea33b[_0xa2bf('0x17')](_0x139f97)[_0xa2bf('0x27')](_0x859c48);};}exports[_0xa2bf('0x28')]=function(_0x42516b,_0x7acc5f){var _0xea4a46={},_0x59d2a1={},_0x19c849={'count':0x0,'rows':[]};var _0x52fed4=db['AnalyticTreeReport'][_0xa2bf('0x29')];_0x59d2a1[_0xa2bf('0x2a')]=_[_0xa2bf('0x2b')](_0x52fed4);_0x59d2a1[_0xa2bf('0x2c')]=_[_0xa2bf('0x2b')](_0x42516b[_0xa2bf('0x2c')]);_0x59d2a1[_0xa2bf('0x2d')]=_[_0xa2bf('0x2e')](_0x59d2a1['model'],_0x59d2a1['query']);_0xea4a46[_0xa2bf('0x2f')]=_[_0xa2bf('0x2e')](_0x59d2a1['model'],qs[_0xa2bf('0x30')](_0x42516b[_0xa2bf('0x2c')]['fields']));_0xea4a46[_0xa2bf('0x2f')]=_0xea4a46[_0xa2bf('0x2f')][_0xa2bf('0x31')]?_0xea4a46[_0xa2bf('0x2f')]:_0x59d2a1[_0xa2bf('0x2a')];if(!_0x42516b['query'][_0xa2bf('0x32')]('nolimit')){_0xea4a46[_0xa2bf('0x1b')]=qs['limit'](_0x42516b[_0xa2bf('0x2c')][_0xa2bf('0x1b')]);_0xea4a46[_0xa2bf('0x1a')]=qs['offset'](_0x42516b[_0xa2bf('0x2c')][_0xa2bf('0x1a')]);}_0xea4a46[_0xa2bf('0x33')]=qs[_0xa2bf('0x34')](_0x42516b[_0xa2bf('0x2c')]['sort']);_0xea4a46['where']=qs[_0xa2bf('0x2d')](_[_0xa2bf('0x35')](_0x42516b['query'],_0x59d2a1['filters']));if(_0x42516b[_0xa2bf('0x2c')]['filter']){_0xea4a46[_0xa2bf('0x36')]=_[_0xa2bf('0x37')](_0xea4a46['where'],{'$or':_[_0xa2bf('0x38')](_0x52fed4,function(_0x302b11){if(_0x302b11[_0xa2bf('0x39')]['key']!==_0xa2bf('0x3a')){var _0x54ba41={};_0x54ba41[_0x302b11['field']]={'$like':'%'+_0x42516b[_0xa2bf('0x2c')]['filter']+'%'};return _0x54ba41;}})});}_0xea4a46=_[_0xa2bf('0x37')]({},_0xea4a46,_0x42516b[_0xa2bf('0x3b')]);var _0x78eb50={'where':_0xea4a46['where']};return db[_0xa2bf('0x3c')]['count'](_0x78eb50)[_0xa2bf('0x21')](function(_0x113941){_0x19c849['count']=_0x113941;if(_0x42516b[_0xa2bf('0x2c')][_0xa2bf('0x3d')]){_0xea4a46[_0xa2bf('0x3e')]=[{'all':!![]}];}return db[_0xa2bf('0x3c')][_0xa2bf('0x3f')](_0xea4a46);})[_0xa2bf('0x21')](function(_0x534dc5){_0x19c849['rows']=_0x534dc5;return _0x19c849;})['then'](respondWithFilteredResult(_0x7acc5f,_0xea4a46))['catch'](handleError(_0x7acc5f,null));};exports[_0xa2bf('0x40')]=function(_0x3c070b,_0x455da0){var _0x23ec20={'raw':!![],'where':{'id':_0x3c070b['params']['id']}},_0x39e8b6={};_0x39e8b6[_0xa2bf('0x2a')]=_[_0xa2bf('0x2b')](db[_0xa2bf('0x3c')][_0xa2bf('0x29')]);_0x39e8b6[_0xa2bf('0x2c')]=_['keys'](_0x3c070b[_0xa2bf('0x2c')]);_0x39e8b6['filters']=_['intersection'](_0x39e8b6[_0xa2bf('0x2a')],_0x39e8b6['query']);_0x23ec20['attributes']=_[_0xa2bf('0x2e')](_0x39e8b6[_0xa2bf('0x2a')],qs[_0xa2bf('0x30')](_0x3c070b[_0xa2bf('0x2c')]['fields']));_0x23ec20[_0xa2bf('0x2f')]=_0x23ec20['attributes'][_0xa2bf('0x31')]?_0x23ec20['attributes']:_0x39e8b6['model'];if(_0x3c070b['query']['includeAll']){_0x23ec20[_0xa2bf('0x3e')]=[{'all':!![]}];}_0x23ec20=_[_0xa2bf('0x37')]({},_0x23ec20,_0x3c070b['options']);return db[_0xa2bf('0x3c')][_0xa2bf('0x41')](_0x23ec20)['then'](handleEntityNotFound(_0x455da0,null))[_0xa2bf('0x21')](respondWithResult(_0x455da0,null))['catch'](handleError(_0x455da0,null));};exports[_0xa2bf('0x42')]=function(_0x12d75e,_0x55f84a){return db[_0xa2bf('0x3c')]['create'](_0x12d75e[_0xa2bf('0x43')],{})[_0xa2bf('0x21')](respondWithResult(_0x55f84a,0xc9))[_0xa2bf('0x44')](handleError(_0x55f84a,null));};exports[_0xa2bf('0x20')]=function(_0x54ac06,_0x53cbf0){if(_0x54ac06[_0xa2bf('0x43')]['id']){delete _0x54ac06[_0xa2bf('0x43')]['id'];}return db[_0xa2bf('0x3c')][_0xa2bf('0x41')]({'where':{'id':_0x54ac06[_0xa2bf('0x45')]['id']}})[_0xa2bf('0x21')](handleEntityNotFound(_0x53cbf0,null))[_0xa2bf('0x21')](saveUpdates(_0x54ac06[_0xa2bf('0x43')],null))['then'](respondWithResult(_0x53cbf0,null))[_0xa2bf('0x44')](handleError(_0x53cbf0,null));};exports[_0xa2bf('0x22')]=function(_0x28783b,_0xe238e0){return db[_0xa2bf('0x3c')][_0xa2bf('0x41')]({'where':{'id':_0x28783b[_0xa2bf('0x45')]['id']}})[_0xa2bf('0x21')](handleEntityNotFound(_0xe238e0,null))[_0xa2bf('0x21')](removeEntity(_0xe238e0,null))[_0xa2bf('0x44')](handleError(_0xe238e0,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index c2bace7..595acfa 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 _0x9367=['lodash','util','../../config/logger','moment','request-promise','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9367,0x156));var _0x7936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9367[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7936('0x0'));var util=require(_0x7936('0x1'));var logger=require(_0x7936('0x2'))('api');var moment=require(_0x7936('0x3'));var BPromise=require('bluebird');var rp=require(_0x7936('0x4'));var attributes=require(_0x7936('0x5'));module['exports']=function(_0x407bbc,_0x131c92){return _0x407bbc[_0x7936('0x6')](_0x7936('0x7'),attributes,{'tableName':_0x7936('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d12=['bluebird','./analyticTreeReport.attributes','define','analytics_report_trees','lodash','util','moment'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x8d12,0x162));var _0x28d1=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x8d12[_0x37ded3];return _0x51e49e;};'use strict';var _=require(_0x28d1('0x0'));var util=require(_0x28d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x28d1('0x2'));var BPromise=require(_0x28d1('0x3'));var rp=require('request-promise');var attributes=require(_0x28d1('0x4'));module['exports']=function(_0xce0e23,_0x542388){return _0xce0e23[_0x28d1('0x5')]('AnalyticTreeReport',attributes,{'tableName':_0x28d1('0x6'),'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 f4c9852..327e5af 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 _0x1187=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2cd1e4,_0x23d906){var _0x167374=function(_0x496435){while(--_0x496435){_0x2cd1e4['push'](_0x2cd1e4['shift']());}};_0x167374(++_0x23d906);}(_0x1187,0x17c));var _0x7118=function(_0x49d221,_0x13dba8){_0x49d221=_0x49d221-0x0;var _0x37b800=_0x1187[_0x49d221];return _0x37b800;};'use strict';var _=require(_0x7118('0x0'));var util=require('util');var moment=require(_0x7118('0x1'));var BPromise=require('bluebird');var rs=require(_0x7118('0x2'));var fs=require('fs');var Redis=require(_0x7118('0x3'));var db=require(_0x7118('0x4'))['db'];var utils=require(_0x7118('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7118('0x6'));var jayson=require(_0x7118('0x7'));var client=jayson['client'][_0x7118('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x382dda,_0x54c4e6,_0x326667){return new BPromise(function(_0x3a6a8f,_0x305a0f){return client[_0x7118('0x9')](_0x382dda,_0x326667)[_0x7118('0xa')](function(_0x5a4c3f){logger[_0x7118('0xb')](_0x7118('0xc'),_0x54c4e6,'request\x20sent');logger[_0x7118('0xd')](_0x7118('0xe'),_0x54c4e6,_0x7118('0xf'),JSON['stringify'](_0x5a4c3f));if(_0x5a4c3f['error']){if(_0x5a4c3f[_0x7118('0x10')][_0x7118('0x11')]===0x1f4){logger['error'](_0x7118('0xc'),_0x54c4e6,_0x5a4c3f['error'][_0x7118('0x12')]);return _0x305a0f(_0x5a4c3f[_0x7118('0x10')][_0x7118('0x12')]);}logger['error'](_0x7118('0xc'),_0x54c4e6,_0x5a4c3f['error'][_0x7118('0x12')]);return _0x3a6a8f(_0x5a4c3f[_0x7118('0x10')][_0x7118('0x12')]);}else{logger[_0x7118('0xb')]('AnalyticTreeReport,\x20%s,\x20%s',_0x54c4e6,_0x7118('0xf'));_0x3a6a8f(_0x5a4c3f[_0x7118('0x13')][_0x7118('0x12')]);}})[_0x7118('0x14')](function(_0x4f603f){logger['error'](_0x7118('0xc'),_0x54c4e6,_0x4f603f);_0x305a0f(_0x4f603f);});});} \ No newline at end of file +var _0x7d16=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','ioredis'];(function(_0x5e4e04,_0x4d24f1){var _0x365828=function(_0x1d9e50){while(--_0x1d9e50){_0x5e4e04['push'](_0x5e4e04['shift']());}};_0x365828(++_0x4d24f1);}(_0x7d16,0xaf));var _0x67d1=function(_0x47857e,_0x3a427b){_0x47857e=_0x47857e-0x0;var _0xaee8d5=_0x7d16[_0x47857e];return _0xaee8d5;};'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(_0x67d1('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0x67d1('0x1'));var logger=require(_0x67d1('0x2'))(_0x67d1('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x67d1('0x4')][_0x67d1('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x10f7df,_0x37c62f,_0x2a382c){return new BPromise(function(_0x40ed31,_0x2599b6){return client[_0x67d1('0x6')](_0x10f7df,_0x2a382c)[_0x67d1('0x7')](function(_0x5ab171){logger[_0x67d1('0x8')](_0x67d1('0x9'),_0x37c62f,_0x67d1('0xa'));logger[_0x67d1('0xb')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x37c62f,_0x67d1('0xa'),JSON[_0x67d1('0xc')](_0x5ab171));if(_0x5ab171[_0x67d1('0xd')]){if(_0x5ab171['error']['code']===0x1f4){logger[_0x67d1('0xd')](_0x67d1('0x9'),_0x37c62f,_0x5ab171[_0x67d1('0xd')][_0x67d1('0xe')]);return _0x2599b6(_0x5ab171[_0x67d1('0xd')][_0x67d1('0xe')]);}logger[_0x67d1('0xd')](_0x67d1('0x9'),_0x37c62f,_0x5ab171[_0x67d1('0xd')][_0x67d1('0xe')]);return _0x40ed31(_0x5ab171[_0x67d1('0xd')][_0x67d1('0xe')]);}else{logger[_0x67d1('0x8')](_0x67d1('0x9'),_0x37c62f,'request\x20sent');_0x40ed31(_0x5ab171['result'][_0x67d1('0xe')]);}})[_0x67d1('0xf')](function(_0x1739fb){logger['error'](_0x67d1('0x9'),_0x37c62f,_0x1739fb);_0x2599b6(_0x1739fb);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 708d88d..c523888 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 _0x710d=['create','destroy','multer','path','express','Router','../../components/auth/service','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x28b902,_0x27ab41){var _0x3c5701=function(_0x53a3f4){while(--_0x53a3f4){_0x28b902['push'](_0x28b902['shift']());}};_0x3c5701(++_0x27ab41);}(_0x710d,0x1c2));var _0xd710=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0x710d[_0x7c0074];return _0x13e95b;};'use strict';var multer=require(_0xd710('0x0'));var util=require('util');var path=require(_0xd710('0x1'));var timeout=require('connect-timeout');var express=require(_0xd710('0x2'));var router=express[_0xd710('0x3')]();var auth=require(_0xd710('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd710('0x5'));router[_0xd710('0x6')]('/',auth['isAuthenticated'](),controller[_0xd710('0x7')]);router[_0xd710('0x6')](_0xd710('0x8'),auth[_0xd710('0x9')](),controller[_0xd710('0xa')]);router[_0xd710('0xb')]('/',auth[_0xd710('0x9')](),controller[_0xd710('0xc')]);router['put'](_0xd710('0x8'),auth[_0xd710('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd710('0xd')]);module['exports']=router; \ No newline at end of file +var _0x2015=['/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','show','post','put'];(function(_0x328b40,_0x370642){var _0x556a56=function(_0x467553){while(--_0x467553){_0x328b40['push'](_0x328b40['shift']());}};_0x556a56(++_0x370642);}(_0x2015,0x85));var _0x5201=function(_0x4c624a,_0x977539){_0x4c624a=_0x4c624a-0x0;var _0x155398=_0x2015[_0x4c624a];return _0x155398;};'use strict';var multer=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var path=require('path');var timeout=require(_0x5201('0x2'));var express=require('express');var router=express[_0x5201('0x3')]();var auth=require(_0x5201('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5201('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x5201('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5201('0x6')]('/:id',auth[_0x5201('0x7')](),controller[_0x5201('0x8')]);router[_0x5201('0x9')]('/',auth[_0x5201('0x7')](),controller['create']);router[_0x5201('0xa')](_0x5201('0xb'),auth['isAuthenticated'](),controller[_0x5201('0xc')]);router[_0x5201('0xd')](_0x5201('0xb'),auth[_0x5201('0x7')](),controller[_0x5201('0xe')]);module[_0x5201('0xf')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index a0d8afb..ce465a5 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 _0x0285=['exports','STRING','sequelize'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x0285,0x89));var _0x5028=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x0285[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0x5028('0x0'));module[_0x5028('0x1')]={'name':{'type':Sequelize[_0x5028('0x2')]},'basename':{'type':Sequelize[_0x5028('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2a0a=['STRING','sequelize'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x2a0a,0xc7));var _0xa2a0=function(_0xd910b9,_0x58b44f){_0xd910b9=_0xd910b9-0x0;var _0x911d94=_0x2a0a[_0xd910b9];return _0x911d94;};'use strict';var Sequelize=require(_0xa2a0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa2a0('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index eaa4b27..3161954 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 _0xf95f=['squel','to-csv','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','Attachment','rawAttributes','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','field','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','file','originalname','basename','filename','mimetype','download','root','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash'];(function(_0x2cecd1,_0x41529a){var _0x516586=function(_0x4cbe95){while(--_0x4cbe95){_0x2cecd1['push'](_0x2cecd1['shift']());}};_0x516586(++_0x41529a);}(_0xf95f,0xda));var _0xff95=function(_0x9102f8,_0x578620){_0x9102f8=_0x9102f8-0x0;var _0x356161=_0xf95f[_0x9102f8];return _0x356161;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xff95('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff95('0x1'));var jsonpatch=require(_0xff95('0x2'));var rp=require('request-promise');var moment=require(_0xff95('0x3'));var BPromise=require(_0xff95('0x4'));var Mustache=require(_0xff95('0x5'));var util=require(_0xff95('0x6'));var path=require(_0xff95('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff95('0x8'));var fs=require('fs');var _=require(_0xff95('0x9'));var squel=require(_0xff95('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff95('0xb'));var querystring=require(_0xff95('0xc'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xff95('0xd'));var Redis=require(_0xff95('0xe'));var qs=require(_0xff95('0xf'));var logger=require(_0xff95('0x10'))(_0xff95('0x11'));var utils=require('../../config/utils');var config=require(_0xff95('0x12'));var db=require(_0xff95('0x13'))['db'];function respondWithStatusCode(_0xace09e,_0x48be85){_0x48be85=_0x48be85||0xcc;return function(_0x1ece78){if(_0x1ece78){return _0xace09e[_0xff95('0x14')](_0x48be85);}return _0xace09e[_0xff95('0x15')](_0x48be85)[_0xff95('0x16')]();};}function respondWithResult(_0x56b2eb,_0x486cb3){_0x486cb3=_0x486cb3||0xc8;return function(_0x1a767e){if(_0x1a767e){return _0x56b2eb[_0xff95('0x15')](_0x486cb3)['json'](_0x1a767e);}};}function respondWithFilteredResult(_0x49bffa,_0xde6cec){return function(_0x28cff3){if(_0x28cff3){var _0x3b11a0=_0x28cff3[_0xff95('0x17')],_0x1501ba=_0xde6cec['offset'],_0x1e2c58=_0xde6cec[_0xff95('0x18')]+_0xde6cec[_0xff95('0x19')],_0x477041;if(_0x1e2c58>=_0x3b11a0){_0x1e2c58=_0x3b11a0;_0x477041=0xc8;}else{_0x477041=0xce;}_0x49bffa[_0xff95('0x15')](_0x477041);return _0x49bffa[_0xff95('0x1a')](_0xff95('0x1b'),_0x1501ba+'-'+_0x1e2c58+'/'+_0x3b11a0)[_0xff95('0x1c')](_0x28cff3);}return null;};}function patchUpdates(_0x329f37){return function(_0x31ec45){try{jsonpatch[_0xff95('0x1d')](_0x31ec45,_0x329f37,!![]);}catch(_0x4759d){return BPromise[_0xff95('0x1e')](_0x4759d);}return _0x31ec45[_0xff95('0x1f')]();};}function saveUpdates(_0x42650f,_0x3fba66){return function(_0x244b4d){if(_0x244b4d){return _0x244b4d[_0xff95('0x20')](_0x42650f)[_0xff95('0x21')](function(_0x3beef6){return _0x3beef6;});}return null;};}function removeEntity(_0x499f72,_0x4569b6){return function(_0x1d14e8){if(_0x1d14e8){return _0x1d14e8[_0xff95('0x22')]()[_0xff95('0x21')](function(){_0x499f72['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1061a1,_0x46c4a1){return function(_0x227d5a){if(!_0x227d5a){_0x1061a1[_0xff95('0x14')](0x194);}return _0x227d5a;};}function handleError(_0x66dd51,_0x510e78){_0x510e78=_0x510e78||0x1f4;return function(_0x264f2f){logger['error'](_0x264f2f[_0xff95('0x23')]);if(_0x264f2f[_0xff95('0x24')]){delete _0x264f2f[_0xff95('0x24')];}_0x66dd51[_0xff95('0x15')](_0x510e78)[_0xff95('0x25')](_0x264f2f);};}exports[_0xff95('0x26')]=function(_0x30e1dd,_0x45263b){var _0x44af82={},_0x2d2496={},_0x347513={'count':0x0,'rows':[]};var _0x395819=db[_0xff95('0x27')][_0xff95('0x28')];_0x2d2496[_0xff95('0x29')]=_['keys'](_0x395819);_0x2d2496['query']=_['keys'](_0x30e1dd['query']);_0x2d2496['filters']=_[_0xff95('0x2a')](_0x2d2496[_0xff95('0x29')],_0x2d2496[_0xff95('0x2b')]);_0x44af82[_0xff95('0x2c')]=_['intersection'](_0x2d2496[_0xff95('0x29')],qs[_0xff95('0x2d')](_0x30e1dd[_0xff95('0x2b')][_0xff95('0x2d')]));_0x44af82['attributes']=_0x44af82[_0xff95('0x2c')][_0xff95('0x2e')]?_0x44af82[_0xff95('0x2c')]:_0x2d2496[_0xff95('0x29')];if(!_0x30e1dd['query'][_0xff95('0x2f')](_0xff95('0x30'))){_0x44af82[_0xff95('0x19')]=qs[_0xff95('0x19')](_0x30e1dd['query']['limit']);_0x44af82[_0xff95('0x18')]=qs[_0xff95('0x18')](_0x30e1dd[_0xff95('0x2b')][_0xff95('0x18')]);}_0x44af82[_0xff95('0x31')]=qs['sort'](_0x30e1dd[_0xff95('0x2b')][_0xff95('0x32')]);_0x44af82[_0xff95('0x33')]=qs['filters'](_['pick'](_0x30e1dd[_0xff95('0x2b')],_0x2d2496[_0xff95('0x34')]));if(_0x30e1dd[_0xff95('0x2b')][_0xff95('0x35')]){_0x44af82[_0xff95('0x33')]=_[_0xff95('0x36')](_0x44af82[_0xff95('0x33')],{'$or':_[_0xff95('0x37')](_0x395819,function(_0x521ca7){if(_0x521ca7['type']['key']!=='VIRTUAL'){var _0xdfbf9d={};_0xdfbf9d[_0x521ca7[_0xff95('0x38')]]={'$like':'%'+_0x30e1dd['query'][_0xff95('0x35')]+'%'};return _0xdfbf9d;}})});}_0x44af82=_[_0xff95('0x36')]({},_0x44af82,_0x30e1dd[_0xff95('0x39')]);var _0x404b37={'where':_0x44af82[_0xff95('0x33')]};return db[_0xff95('0x27')][_0xff95('0x17')](_0x404b37)['then'](function(_0xbd1043){_0x347513[_0xff95('0x17')]=_0xbd1043;if(_0x30e1dd[_0xff95('0x2b')][_0xff95('0x3a')]){_0x44af82[_0xff95('0x3b')]=[{'all':!![]}];}return db[_0xff95('0x27')][_0xff95('0x3c')](_0x44af82);})[_0xff95('0x21')](function(_0x12a83b){_0x347513[_0xff95('0x3d')]=_0x12a83b;return _0x347513;})[_0xff95('0x21')](respondWithFilteredResult(_0x45263b,_0x44af82))[_0xff95('0x3e')](handleError(_0x45263b,null));};exports[_0xff95('0x3f')]=function(_0x43824a,_0x3e3807){var _0x4c443b={'raw':!![],'where':{'id':_0x43824a[_0xff95('0x40')]['id']}},_0x55dfc3={};_0x55dfc3[_0xff95('0x29')]=_['keys'](db[_0xff95('0x27')][_0xff95('0x28')]);_0x55dfc3['query']=_[_0xff95('0x41')](_0x43824a[_0xff95('0x2b')]);_0x55dfc3[_0xff95('0x34')]=_[_0xff95('0x2a')](_0x55dfc3[_0xff95('0x29')],_0x55dfc3['query']);_0x4c443b[_0xff95('0x2c')]=_[_0xff95('0x2a')](_0x55dfc3['model'],qs[_0xff95('0x2d')](_0x43824a[_0xff95('0x2b')][_0xff95('0x2d')]));_0x4c443b[_0xff95('0x2c')]=_0x4c443b[_0xff95('0x2c')]['length']?_0x4c443b['attributes']:_0x55dfc3['model'];if(_0x43824a[_0xff95('0x2b')]['includeAll']){_0x4c443b[_0xff95('0x3b')]=[{'all':!![]}];}_0x4c443b=_[_0xff95('0x36')]({},_0x4c443b,_0x43824a[_0xff95('0x39')]);return db[_0xff95('0x27')][_0xff95('0x42')](_0x4c443b)[_0xff95('0x21')](handleEntityNotFound(_0x3e3807,null))[_0xff95('0x21')](respondWithResult(_0x3e3807,null))[_0xff95('0x3e')](handleError(_0x3e3807,null));};exports['update']=function(_0x1038c6,_0x56ae35){if(_0x1038c6[_0xff95('0x43')]['id']){delete _0x1038c6['body']['id'];}return db[_0xff95('0x27')][_0xff95('0x42')]({'where':{'id':_0x1038c6[_0xff95('0x40')]['id']}})[_0xff95('0x21')](handleEntityNotFound(_0x56ae35,null))[_0xff95('0x21')](saveUpdates(_0x1038c6['body'],null))[_0xff95('0x21')](respondWithResult(_0x56ae35,null))[_0xff95('0x3e')](handleError(_0x56ae35,null));};exports[_0xff95('0x22')]=function(_0x58fa03,_0x16392d){return db['Attachment'][_0xff95('0x42')]({'where':{'id':_0x58fa03[_0xff95('0x40')]['id']}})[_0xff95('0x21')](handleEntityNotFound(_0x16392d,null))[_0xff95('0x21')](removeEntity(_0x16392d,null))['catch'](handleError(_0x16392d,null));};exports[_0xff95('0x44')]=function(_0x501c03,_0x3de896,_0x9bd2d8){_0x501c03[_0xff95('0x43')]['name']=_0x501c03[_0xff95('0x45')][_0xff95('0x46')];_0x501c03[_0xff95('0x43')][_0xff95('0x47')]=_0x501c03[_0xff95('0x45')][_0xff95('0x48')];_0x501c03['body']['type']=_0x501c03[_0xff95('0x45')][_0xff95('0x49')];return db[_0xff95('0x27')][_0xff95('0x44')](_0x501c03['body'])[_0xff95('0x21')](respondWithResult(_0x3de896,0xc9))[_0xff95('0x3e')](handleError(_0x3de896,null));};exports['download']=function(_0x21856b,_0x4adaa5,_0x4fa6ab){return db[_0xff95('0x27')]['findOne']({'where':{'id':_0x21856b[_0xff95('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4adaa5,null))[_0xff95('0x21')](function(_0x1a286c){if(_0x1a286c){return _0x4adaa5[_0xff95('0x4a')](path['join'](config[_0xff95('0x4b')],'server/files/attachments/',_0x1a286c[_0xff95('0x47')]));}})[_0xff95('0x3e')](handleError(_0x4adaa5,null));}; \ No newline at end of file +var _0x787a=['file','originalname','basename','filename','mimetype','findOne','download','join','root','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','json','apply','update','destroy','then','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','length','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','includeAll','include','findAll','rows','catch','show','params','Attachment','fields','find','body','create'];(function(_0x1669f0,_0x1f0b6e){var _0x239e7e=function(_0xcbb3df){while(--_0xcbb3df){_0x1669f0['push'](_0x1669f0['shift']());}};_0x239e7e(++_0x1f0b6e);}(_0x787a,0xed));var _0xa787=function(_0x38f017,_0x31c067){_0x38f017=_0x38f017-0x0;var _0x522e1e=_0x787a[_0x38f017];return _0x522e1e;};'use strict';var pdf=require(_0xa787('0x0'));var emlformat=require(_0xa787('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa787('0x2'));var jsonpatch=require(_0xa787('0x3'));var rp=require(_0xa787('0x4'));var moment=require(_0xa787('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa787('0x6'));var util=require('util');var path=require(_0xa787('0x7'));var sox=require(_0xa787('0x8'));var csv=require('to-csv');var ejs=require(_0xa787('0x9'));var fs=require('fs');var _=require(_0xa787('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa787('0xb'));var deskjs=require(_0xa787('0xc'));var toCsv=require(_0xa787('0xd'));var querystring=require(_0xa787('0xe'));var Papa=require(_0xa787('0xf'));var authService=require(_0xa787('0x10'));var hardwareService=require(_0xa787('0x11'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xa787('0x12'))(_0xa787('0x13'));var utils=require(_0xa787('0x14'));var config=require(_0xa787('0x15'));var db=require(_0xa787('0x16'))['db'];function respondWithStatusCode(_0x32d041,_0x5845cc){_0x5845cc=_0x5845cc||0xcc;return function(_0x11e410){if(_0x11e410){return _0x32d041[_0xa787('0x17')](_0x5845cc);}return _0x32d041[_0xa787('0x18')](_0x5845cc)[_0xa787('0x19')]();};}function respondWithResult(_0x37879f,_0x57dc3f){_0x57dc3f=_0x57dc3f||0xc8;return function(_0x4b960e){if(_0x4b960e){return _0x37879f[_0xa787('0x18')](_0x57dc3f)['json'](_0x4b960e);}};}function respondWithFilteredResult(_0x71179c,_0x508010){return function(_0x3bcf17){if(_0x3bcf17){var _0x328184=_0x3bcf17['count'],_0x44e8eb=_0x508010[_0xa787('0x1a')],_0x391df8=_0x508010[_0xa787('0x1a')]+_0x508010[_0xa787('0x1b')],_0x13a45c;if(_0x391df8>=_0x328184){_0x391df8=_0x328184;_0x13a45c=0xc8;}else{_0x13a45c=0xce;}_0x71179c[_0xa787('0x18')](_0x13a45c);return _0x71179c['set']('Content-Range',_0x44e8eb+'-'+_0x391df8+'/'+_0x328184)[_0xa787('0x1c')](_0x3bcf17);}return null;};}function patchUpdates(_0x359bc0){return function(_0x21f813){try{jsonpatch[_0xa787('0x1d')](_0x21f813,_0x359bc0,!![]);}catch(_0x3d8b11){return BPromise['reject'](_0x3d8b11);}return _0x21f813['save']();};}function saveUpdates(_0x9047c0,_0x172ebf){return function(_0x34e6b4){if(_0x34e6b4){return _0x34e6b4[_0xa787('0x1e')](_0x9047c0)['then'](function(_0x2c8041){return _0x2c8041;});}return null;};}function removeEntity(_0xc9c80c,_0x198752){return function(_0x1425d6){if(_0x1425d6){return _0x1425d6[_0xa787('0x1f')]()[_0xa787('0x20')](function(){_0xc9c80c[_0xa787('0x18')](0xcc)[_0xa787('0x19')]();});}};}function handleEntityNotFound(_0x1bd2f6,_0x2ce6c8){return function(_0x4579b6){if(!_0x4579b6){_0x1bd2f6[_0xa787('0x17')](0x194);}return _0x4579b6;};}function handleError(_0x30a490,_0x51dc96){_0x51dc96=_0x51dc96||0x1f4;return function(_0x4e03c1){logger[_0xa787('0x21')](_0x4e03c1[_0xa787('0x22')]);if(_0x4e03c1[_0xa787('0x23')]){delete _0x4e03c1[_0xa787('0x23')];}_0x30a490['status'](_0x51dc96)[_0xa787('0x24')](_0x4e03c1);};}exports['index']=function(_0x1f3e57,_0x379d50){var _0x32b8d7={},_0x29f9af={},_0x22b812={'count':0x0,'rows':[]};var _0x23dbde=db['Attachment'][_0xa787('0x25')];_0x29f9af[_0xa787('0x26')]=_[_0xa787('0x27')](_0x23dbde);_0x29f9af[_0xa787('0x28')]=_[_0xa787('0x27')](_0x1f3e57[_0xa787('0x28')]);_0x29f9af[_0xa787('0x29')]=_[_0xa787('0x2a')](_0x29f9af['model'],_0x29f9af[_0xa787('0x28')]);_0x32b8d7[_0xa787('0x2b')]=_[_0xa787('0x2a')](_0x29f9af[_0xa787('0x26')],qs['fields'](_0x1f3e57[_0xa787('0x28')]['fields']));_0x32b8d7[_0xa787('0x2b')]=_0x32b8d7[_0xa787('0x2b')][_0xa787('0x2c')]?_0x32b8d7[_0xa787('0x2b')]:_0x29f9af[_0xa787('0x26')];if(!_0x1f3e57[_0xa787('0x28')]['hasOwnProperty']('nolimit')){_0x32b8d7['limit']=qs[_0xa787('0x1b')](_0x1f3e57[_0xa787('0x28')][_0xa787('0x1b')]);_0x32b8d7['offset']=qs['offset'](_0x1f3e57['query']['offset']);}_0x32b8d7['order']=qs[_0xa787('0x2d')](_0x1f3e57[_0xa787('0x28')][_0xa787('0x2d')]);_0x32b8d7[_0xa787('0x2e')]=qs['filters'](_[_0xa787('0x2f')](_0x1f3e57[_0xa787('0x28')],_0x29f9af[_0xa787('0x29')]));if(_0x1f3e57[_0xa787('0x28')]['filter']){_0x32b8d7[_0xa787('0x2e')]=_[_0xa787('0x30')](_0x32b8d7[_0xa787('0x2e')],{'$or':_[_0xa787('0x31')](_0x23dbde,function(_0x54cc45){if(_0x54cc45[_0xa787('0x32')][_0xa787('0x33')]!==_0xa787('0x34')){var _0xaaef2f={};_0xaaef2f[_0x54cc45[_0xa787('0x35')]]={'$like':'%'+_0x1f3e57[_0xa787('0x28')][_0xa787('0x36')]+'%'};return _0xaaef2f;}})});}_0x32b8d7=_[_0xa787('0x30')]({},_0x32b8d7,_0x1f3e57['options']);var _0x1ebdff={'where':_0x32b8d7[_0xa787('0x2e')]};return db['Attachment']['count'](_0x1ebdff)['then'](function(_0x570b55){_0x22b812['count']=_0x570b55;if(_0x1f3e57[_0xa787('0x28')][_0xa787('0x37')]){_0x32b8d7[_0xa787('0x38')]=[{'all':!![]}];}return db['Attachment'][_0xa787('0x39')](_0x32b8d7);})[_0xa787('0x20')](function(_0x5ce6e0){_0x22b812[_0xa787('0x3a')]=_0x5ce6e0;return _0x22b812;})['then'](respondWithFilteredResult(_0x379d50,_0x32b8d7))[_0xa787('0x3b')](handleError(_0x379d50,null));};exports[_0xa787('0x3c')]=function(_0x2f5235,_0x4e391d){var _0x1b6ee3={'raw':!![],'where':{'id':_0x2f5235[_0xa787('0x3d')]['id']}},_0x39e7dc={};_0x39e7dc[_0xa787('0x26')]=_[_0xa787('0x27')](db[_0xa787('0x3e')]['rawAttributes']);_0x39e7dc[_0xa787('0x28')]=_['keys'](_0x2f5235[_0xa787('0x28')]);_0x39e7dc[_0xa787('0x29')]=_[_0xa787('0x2a')](_0x39e7dc[_0xa787('0x26')],_0x39e7dc[_0xa787('0x28')]);_0x1b6ee3[_0xa787('0x2b')]=_[_0xa787('0x2a')](_0x39e7dc['model'],qs['fields'](_0x2f5235[_0xa787('0x28')][_0xa787('0x3f')]));_0x1b6ee3[_0xa787('0x2b')]=_0x1b6ee3['attributes']['length']?_0x1b6ee3[_0xa787('0x2b')]:_0x39e7dc[_0xa787('0x26')];if(_0x2f5235[_0xa787('0x28')][_0xa787('0x37')]){_0x1b6ee3[_0xa787('0x38')]=[{'all':!![]}];}_0x1b6ee3=_[_0xa787('0x30')]({},_0x1b6ee3,_0x2f5235['options']);return db[_0xa787('0x3e')][_0xa787('0x40')](_0x1b6ee3)[_0xa787('0x20')](handleEntityNotFound(_0x4e391d,null))[_0xa787('0x20')](respondWithResult(_0x4e391d,null))[_0xa787('0x3b')](handleError(_0x4e391d,null));};exports['update']=function(_0x1e419f,_0x2fb8fc){if(_0x1e419f[_0xa787('0x41')]['id']){delete _0x1e419f[_0xa787('0x41')]['id'];}return db['Attachment'][_0xa787('0x40')]({'where':{'id':_0x1e419f[_0xa787('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2fb8fc,null))[_0xa787('0x20')](saveUpdates(_0x1e419f[_0xa787('0x41')],null))[_0xa787('0x20')](respondWithResult(_0x2fb8fc,null))[_0xa787('0x3b')](handleError(_0x2fb8fc,null));};exports[_0xa787('0x1f')]=function(_0x29bb02,_0x262ec5){return db['Attachment'][_0xa787('0x40')]({'where':{'id':_0x29bb02[_0xa787('0x3d')]['id']}})[_0xa787('0x20')](handleEntityNotFound(_0x262ec5,null))[_0xa787('0x20')](removeEntity(_0x262ec5,null))['catch'](handleError(_0x262ec5,null));};exports[_0xa787('0x42')]=function(_0x5e3ac1,_0x575e87,_0x2000fd){_0x5e3ac1[_0xa787('0x41')][_0xa787('0x23')]=_0x5e3ac1[_0xa787('0x43')][_0xa787('0x44')];_0x5e3ac1[_0xa787('0x41')][_0xa787('0x45')]=_0x5e3ac1['file'][_0xa787('0x46')];_0x5e3ac1[_0xa787('0x41')]['type']=_0x5e3ac1[_0xa787('0x43')][_0xa787('0x47')];return db[_0xa787('0x3e')][_0xa787('0x42')](_0x5e3ac1[_0xa787('0x41')])[_0xa787('0x20')](respondWithResult(_0x575e87,0xc9))[_0xa787('0x3b')](handleError(_0x575e87,null));};exports['download']=function(_0x4a748f,_0x4c8b9b,_0x2a3639){return db[_0xa787('0x3e')][_0xa787('0x48')]({'where':{'id':_0x4a748f[_0xa787('0x3d')]['id']},'raw':!![]})[_0xa787('0x20')](handleEntityNotFound(_0x4c8b9b,null))['then'](function(_0x38dc1d){if(_0x38dc1d){return _0x4c8b9b[_0xa787('0x49')](path[_0xa787('0x4a')](config[_0xa787('0x4b')],'server/files/attachments/',_0x38dc1d[_0xa787('0x45')]));}})[_0xa787('0x3b')](handleError(_0x4c8b9b,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index d5b109d..bce6f83 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 _0x7217=['lodash','../../config/logger','api','moment','bluebird','request-promise','define','Attachment','attachments'];(function(_0x58e28,_0x36cb83){var _0x41f75a=function(_0x272c6d){while(--_0x272c6d){_0x58e28['push'](_0x58e28['shift']());}};_0x41f75a(++_0x36cb83);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var attributes=require('./attachment.attributes');module['exports']=function(_0x472a96,_0xce17f9){return _0x472a96[_0x7721('0x6')](_0x7721('0x7'),attributes,{'tableName':_0x7721('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['moment','request-promise','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x591e0e,_0x47ec1e){var _0x149d2c=function(_0xfd08ed){while(--_0xfd08ed){_0x591e0e['push'](_0x591e0e['shift']());}};_0x149d2c(++_0x47ec1e);}(_0x008c,0x188));var _0xc008=function(_0xb87f20,_0x4ae8f5){_0xb87f20=_0xb87f20-0x0;var _0x5e02bb=_0x008c[_0xb87f20];return _0x5e02bb;};'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 attributes=require(_0xc008('0x6'));module[_0xc008('0x7')]=function(_0x163bd9,_0x1cbe76){return _0x163bd9[_0xc008('0x8')](_0xc008('0x9'),attributes,{'tableName':_0xc008('0xa'),'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 74de79a..f2e5055 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 _0xc496=['../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateAttachment','create','body','options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x591d95,_0x3df684){var _0x472982=function(_0x20942b){while(--_0x20942b){_0x591d95['push'](_0x591d95['shift']());}};_0x472982(++_0x3df684);}(_0xc496,0x170));var _0x6c49=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0xc496[_0x15dbca];return _0x326533;};'use strict';var _=require(_0x6c49('0x0'));var util=require(_0x6c49('0x1'));var moment=require(_0x6c49('0x2'));var BPromise=require(_0x6c49('0x3'));var rs=require(_0x6c49('0x4'));var fs=require('fs');var Redis=require(_0x6c49('0x5'));var db=require(_0x6c49('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c49('0x7'))(_0x6c49('0x8'));var config=require(_0x6c49('0x9'));var jayson=require(_0x6c49('0xa'));var client=jayson['client'][_0x6c49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b7124,_0x215be8,_0x304fac){return new BPromise(function(_0x8cca61,_0xdf4cc5){return client[_0x6c49('0xc')](_0x4b7124,_0x304fac)[_0x6c49('0xd')](function(_0x50fa5f){logger[_0x6c49('0xe')](_0x6c49('0xf'),_0x215be8,_0x6c49('0x10'));logger[_0x6c49('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x215be8,_0x6c49('0x10'),JSON['stringify'](_0x50fa5f));if(_0x50fa5f[_0x6c49('0x12')]){if(_0x50fa5f[_0x6c49('0x12')][_0x6c49('0x13')]===0x1f4){logger[_0x6c49('0x12')](_0x6c49('0xf'),_0x215be8,_0x50fa5f[_0x6c49('0x12')][_0x6c49('0x14')]);return _0xdf4cc5(_0x50fa5f[_0x6c49('0x12')][_0x6c49('0x14')]);}logger[_0x6c49('0x12')]('Attachment,\x20%s,\x20%s',_0x215be8,_0x50fa5f[_0x6c49('0x12')]['message']);return _0x8cca61(_0x50fa5f[_0x6c49('0x12')]['message']);}else{logger[_0x6c49('0xe')](_0x6c49('0xf'),_0x215be8,_0x6c49('0x10'));_0x8cca61(_0x50fa5f[_0x6c49('0x15')][_0x6c49('0x14')]);}})['catch'](function(_0x2af366){logger[_0x6c49('0x12')](_0x6c49('0xf'),_0x215be8,_0x2af366);_0xdf4cc5(_0x2af366);});});}exports[_0x6c49('0x16')]=function(_0x276ed8){var _0x5651c1=this;return new Promise(function(_0x5de542,_0x495284){return db['Attachment'][_0x6c49('0x17')](_0x276ed8[_0x6c49('0x18')],{'raw':_0x276ed8[_0x6c49('0x19')]?_0x276ed8[_0x6c49('0x19')][_0x6c49('0x1a')]===undefined?!![]:![]:!![]})[_0x6c49('0xd')](function(_0x452a5d){logger[_0x6c49('0xe')](_0x6c49('0x16'),_0x276ed8);logger['debug'](_0x6c49('0x16'),_0x276ed8,JSON[_0x6c49('0x1b')](_0x452a5d));_0x5de542(_0x452a5d);})[_0x6c49('0x1c')](function(_0x39d626){logger[_0x6c49('0x12')](_0x6c49('0x16'),_0x39d626[_0x6c49('0x14')],_0x276ed8);_0x495284(_0x5651c1[_0x6c49('0x12')](0x1f4,_0x39d626['message']));});});}; \ No newline at end of file +var _0xeef7=['rpc','../../config/environment','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','body','options','raw','CreateAttachment','lodash','util','bluebird','randomstring','../../config/logger'];(function(_0x5139bf,_0x47e57c){var _0x14da05=function(_0x50d9a0){while(--_0x50d9a0){_0x5139bf['push'](_0x5139bf['shift']());}};_0x14da05(++_0x47e57c);}(_0xeef7,0x7d));var _0x7eef=function(_0x2f1559,_0xcf043c){_0x2f1559=_0x2f1559-0x0;var _0x12908c=_0xeef7[_0x2f1559];return _0x12908c;};'use strict';var _=require(_0x7eef('0x0'));var util=require(_0x7eef('0x1'));var moment=require('moment');var BPromise=require(_0x7eef('0x2'));var rs=require(_0x7eef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7eef('0x4'))(_0x7eef('0x5'));var config=require(_0x7eef('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x378a20,_0x4261aa,_0x4283d3){return new BPromise(function(_0x51bca2,_0x3c3c2b){return client[_0x7eef('0x7')](_0x378a20,_0x4283d3)[_0x7eef('0x8')](function(_0x16c390){logger[_0x7eef('0x9')](_0x7eef('0xa'),_0x4261aa,_0x7eef('0xb'));logger[_0x7eef('0xc')](_0x7eef('0xd'),_0x4261aa,'request\x20sent',JSON[_0x7eef('0xe')](_0x16c390));if(_0x16c390[_0x7eef('0xf')]){if(_0x16c390[_0x7eef('0xf')][_0x7eef('0x10')]===0x1f4){logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x16c390[_0x7eef('0xf')]['message']);return _0x3c3c2b(_0x16c390[_0x7eef('0xf')][_0x7eef('0x11')]);}logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x16c390['error']['message']);return _0x51bca2(_0x16c390[_0x7eef('0xf')][_0x7eef('0x11')]);}else{logger[_0x7eef('0x9')](_0x7eef('0xa'),_0x4261aa,_0x7eef('0xb'));_0x51bca2(_0x16c390[_0x7eef('0x12')][_0x7eef('0x11')]);}})[_0x7eef('0x13')](function(_0x263c33){logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x263c33);_0x3c3c2b(_0x263c33);});});}exports['CreateAttachment']=function(_0x25fa10){var _0x111d87=this;return new Promise(function(_0x576cc1,_0x3c957b){return db[_0x7eef('0x14')][_0x7eef('0x15')](_0x25fa10[_0x7eef('0x16')],{'raw':_0x25fa10[_0x7eef('0x17')]?_0x25fa10[_0x7eef('0x17')][_0x7eef('0x18')]===undefined?!![]:![]:!![]})[_0x7eef('0x8')](function(_0x1f3fa9){logger[_0x7eef('0x9')](_0x7eef('0x19'),_0x25fa10);logger[_0x7eef('0xc')](_0x7eef('0x19'),_0x25fa10,JSON[_0x7eef('0xe')](_0x1f3fa9));_0x576cc1(_0x1f3fa9);})[_0x7eef('0x13')](function(_0x4512d7){logger[_0x7eef('0xf')](_0x7eef('0x19'),_0x4512d7['message'],_0x25fa10);_0x3c957b(_0x111d87[_0x7eef('0xf')](0x1f4,_0x4512d7['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 190d0ec..ad485ff 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 _0x292b=['../../config/environment','./attachment.controller','get','/:id','isAuthenticated','/:id/download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x313cc1,_0x1f3bec){var _0x4b9d60=function(_0x571815){while(--_0x571815){_0x313cc1['push'](_0x313cc1['shift']());}};_0x4b9d60(++_0x1f3bec);}(_0x292b,0x64));var _0xb292=function(_0x3c68ac,_0x38b406){_0x3c68ac=_0x3c68ac-0x0;var _0x35d849=_0x292b[_0x3c68ac];return _0x35d849;};'use strict';var multer=require(_0xb292('0x0'));var util=require(_0xb292('0x1'));var path=require(_0xb292('0x2'));var timeout=require(_0xb292('0x3'));var express=require(_0xb292('0x4'));var router=express[_0xb292('0x5')]();var auth=require(_0xb292('0x6'));var interaction=require(_0xb292('0x7'));var config=require(_0xb292('0x8'));var controller=require(_0xb292('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb292('0xa')](_0xb292('0xb'),auth[_0xb292('0xc')](),controller['show']);router[_0xb292('0xa')](_0xb292('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xb292('0xe')]({'destination':function(_0xa30857,_0x36be8a,_0x5b4b7a){_0x5b4b7a(null,path[_0xb292('0xf')](config[_0xb292('0x10')],_0xb292('0x11')));},'filename':function(_0x19a27d,_0x537d8b,_0x2587cf){_0x2587cf(null,util[_0xb292('0x12')](_0xb292('0x13'),Date[_0xb292('0x14')](),_0x537d8b['originalname'][_0xb292('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb292('0x16')]('/',upload['single']('file'),controller['create']);router[_0xb292('0x17')](_0xb292('0xb'),auth[_0xb292('0xc')](),controller[_0xb292('0x18')]);router[_0xb292('0x19')](_0xb292('0xb'),auth[_0xb292('0xc')](),controller['destroy']);module[_0xb292('0x1a')]=router; \ No newline at end of file +var _0xbc8b=['root','server/files/attachments/','%s-%s','now','originalname','single','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','diskStorage','join'];(function(_0x3a46a1,_0x4b6835){var _0x47772c=function(_0x335338){while(--_0x335338){_0x3a46a1['push'](_0x3a46a1['shift']());}};_0x47772c(++_0x4b6835);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xbc8b[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require(_0xbbc8('0x0'));var path=require('path');var timeout=require(_0xbbc8('0x1'));var express=require(_0xbbc8('0x2'));var router=express[_0xbbc8('0x3')]();var auth=require(_0xbbc8('0x4'));var interaction=require(_0xbbc8('0x5'));var config=require(_0xbbc8('0x6'));var controller=require('./attachment.controller');router[_0xbbc8('0x7')]('/',auth[_0xbbc8('0x8')](),controller[_0xbbc8('0x9')]);router[_0xbbc8('0x7')](_0xbbc8('0xa'),auth['isAuthenticated'](),controller[_0xbbc8('0xb')]);router[_0xbbc8('0x7')]('/:id/download',auth[_0xbbc8('0x8')](),controller[_0xbbc8('0xc')]);var upload=multer({'storage':multer[_0xbbc8('0xd')]({'destination':function(_0x468ee5,_0x2bbe15,_0x16ae40){_0x16ae40(null,path[_0xbbc8('0xe')](config[_0xbbc8('0xf')],_0xbbc8('0x10')));},'filename':function(_0x11ad4a,_0x3953df,_0x32c929){_0x32c929(null,util['format'](_0xbbc8('0x11'),Date[_0xbbc8('0x12')](),_0x3953df[_0xbbc8('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0xbbc8('0x14')]('file'),controller[_0xbbc8('0x15')]);router[_0xbbc8('0x16')](_0xbbc8('0xa'),auth[_0xbbc8('0x8')](),controller[_0xbbc8('0x17')]);router[_0xbbc8('0x18')](_0xbbc8('0xa'),auth[_0xbbc8('0x8')](),controller[_0xbbc8('0x19')]);module[_0xbbc8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index f6986c1..e396578 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 _0x8f6b=['../../config/environment','signToken','login','google','profile','callback','/login','clientID','clientSecret','secret','callbackURL','User','find','emails','value','admin','agent','Incorrect\x20username\x20and/or\x20password','lodash','passport','passport-google-oauth20','../../mysqldb'];(function(_0x3b3bea,_0x2aef1f){var _0x13a6a8=function(_0x47ee43){while(--_0x47ee43){_0x3b3bea['push'](_0x3b3bea['shift']());}};_0x13a6a8(++_0x2aef1f);}(_0x8f6b,0x146));var _0xb8f6=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8f6b[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xb8f6('0x0'));var passport=require(_0xb8f6('0x1'));var GoogleStrategy=require(_0xb8f6('0x2'))['Strategy'];var db=require(_0xb8f6('0x3'))['db'];var config=require(_0xb8f6('0x4'));var signToken=require('../../components/auth/service')[_0xb8f6('0x5')];exports[_0xb8f6('0x6')]=passport['authenticate'](_0xb8f6('0x7'),{'failureRedirect':'/login','scope':[_0xb8f6('0x8'),'email'],'session':![]});exports[_0xb8f6('0x9')]=passport['authenticate'](_0xb8f6('0x7'),{'failureRedirect':_0xb8f6('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0xb8f6('0x7')][_0xb8f6('0xb')]:'id','clientSecret':config[_0xb8f6('0x7')]?config[_0xb8f6('0x7')][_0xb8f6('0xc')]:_0xb8f6('0xd'),'callbackURL':config[_0xb8f6('0x7')]?config[_0xb8f6('0x7')][_0xb8f6('0xe')]:''},function(_0x2ef5c1,_0x4eb721,_0x3f4863,_0x51895e){db[_0xb8f6('0xf')][_0xb8f6('0x10')]({'where':{'email':_['map'](_0x3f4863[_0xb8f6('0x11')],_0xb8f6('0x12')),'role':{'$or':[_0xb8f6('0x13'),'user',_0xb8f6('0x14')]}}})['then'](function(_0x237dc3){if(_0x237dc3){return _0x51895e(null,_0x237dc3);}_0x51895e(_0xb8f6('0x15'));})['catch'](function(_0x48b20b){_0x51895e(_0x48b20b);});})); \ No newline at end of file +var _0x7b84=['passport','passport-google-oauth20','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','/login','profile','email','callback','use','clientID','callbackURL','find','map','emails','value','admin','then','Incorrect\x20username\x20and/or\x20password','catch','lodash'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7b84,0x167));var _0x47b8=function(_0x1c88f7,_0x351fb7){_0x1c88f7=_0x1c88f7-0x0;var _0x4fe90b=_0x7b84[_0x1c88f7];return _0x4fe90b;};'use strict';var _=require(_0x47b8('0x0'));var passport=require(_0x47b8('0x1'));var GoogleStrategy=require(_0x47b8('0x2'))['Strategy'];var db=require('../../mysqldb')['db'];var config=require(_0x47b8('0x3'));var signToken=require(_0x47b8('0x4'))[_0x47b8('0x5')];exports[_0x47b8('0x6')]=passport[_0x47b8('0x7')](_0x47b8('0x8'),{'failureRedirect':_0x47b8('0x9'),'scope':[_0x47b8('0xa'),_0x47b8('0xb')],'session':![]});exports[_0x47b8('0xc')]=passport[_0x47b8('0x7')](_0x47b8('0x8'),{'failureRedirect':_0x47b8('0x9'),'session':![]});passport[_0x47b8('0xd')](new GoogleStrategy({'clientID':config[_0x47b8('0x8')]?config[_0x47b8('0x8')][_0x47b8('0xe')]:'id','clientSecret':config[_0x47b8('0x8')]?config[_0x47b8('0x8')]['clientSecret']:'secret','callbackURL':config[_0x47b8('0x8')]?config[_0x47b8('0x8')][_0x47b8('0xf')]:''},function(_0x320fdf,_0x527ba8,_0x7805ce,_0x336db0){db['User'][_0x47b8('0x10')]({'where':{'email':_[_0x47b8('0x11')](_0x7805ce[_0x47b8('0x12')],_0x47b8('0x13')),'role':{'$or':[_0x47b8('0x14'),'user','agent']}}})[_0x47b8('0x15')](function(_0x536a6f){if(_0x536a6f){return _0x336db0(null,_0x536a6f);}_0x336db0(_0x47b8('0x16'));})[_0x47b8('0x17')](function(_0x105e29){_0x336db0(_0x105e29);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 2b27f8f..88b80b8 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 _0x4f3c=['../../components/auth/service','setTokenCookie','login','get','/callback','callback','exports','express','passport','Router','./authGoogle.controller'];(function(_0x567c0d,_0x4fd237){var _0x541ecd=function(_0x10fc77){while(--_0x10fc77){_0x567c0d['push'](_0x567c0d['shift']());}};_0x541ecd(++_0x4fd237);}(_0x4f3c,0x167));var _0xc4f3=function(_0xf33afd,_0x2363b6){_0xf33afd=_0xf33afd-0x0;var _0x5f432a=_0x4f3c[_0xf33afd];return _0x5f432a;};'use strict';var express=require(_0xc4f3('0x0'));var passport=require(_0xc4f3('0x1'));var router=express[_0xc4f3('0x2')]();var controller=require(_0xc4f3('0x3'));var setTokenCookie=require(_0xc4f3('0x4'))[_0xc4f3('0x5')];router['get']('/',controller[_0xc4f3('0x6')]);router[_0xc4f3('0x7')](_0xc4f3('0x8'),controller[_0xc4f3('0x9')],setTokenCookie);module[_0xc4f3('0xa')]=router; \ No newline at end of file +var _0xf24d=['../../components/auth/service','setTokenCookie','get','/callback','exports','express'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xf24d,0x89));var _0xdf24=function(_0x86da5d,_0x18d93e){_0x86da5d=_0x86da5d-0x0;var _0x4f6f71=_0xf24d[_0x86da5d];return _0x4f6f71;};'use strict';var express=require(_0xdf24('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var setTokenCookie=require(_0xdf24('0x1'))[_0xdf24('0x2')];router[_0xdf24('0x3')]('/',controller['login']);router['get'](_0xdf24('0x4'),controller['callback'],setTokenCookie);module[_0xdf24('0x5')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 76bf664..bcf2609 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 _0xb6fa=['service','host','port','secure','authentication','auth','user','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','format','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','save','Password\x20reset!','use','util','Strategy','lodash','../../config/logger','randomstring','../../mysqldb','../../components/auth/service','signToken','client','http','role','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','name','authenticate','MailAccount','email','Smtp'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xb6fa[_0x249e96];return _0x17444c;};'use strict';var util=require(_0xab6f('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xab6f('0x1')];var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0xab6f('0x2'));var logger=require(_0xab6f('0x3'))('api');var rs=require(_0xab6f('0x4'));var db=require(_0xab6f('0x5'))['db'];var signToken=require(_0xab6f('0x6'))[_0xab6f('0x7')];var client=jayson[_0xab6f('0x8')][_0xab6f('0x9')]({'port':0x232b});var getLicense=function(_0x16b84e){return new BPromise(function(_0x1b4da9,_0x46b0f6){var _0x85cb19=0x0;_0x16b84e[_0xab6f('0xa')]!==_0xab6f('0xb')&&_0x1b4da9(_0x16b84e);return db[_0xab6f('0xc')][_0xab6f('0xd')]({'where':{'role':_0xab6f('0xb'),'online':!![],'id':{'$ne':_0x16b84e['id']}}})[_0xab6f('0xe')](function(_0x4838a8){_0x85cb19=_0x4838a8;return require('../../config/license/util')[_0xab6f('0xf')]();})[_0xab6f('0xe')](function(_0x48c542){if(_0x48c542&&_0x48c542[_0xab6f('0x10')]&&_0x85cb19>=_0x48c542[_0xab6f('0x10')]){return _0x46b0f6({'message':_0xab6f('0x11')});}return _0x1b4da9(_0x16b84e);})[_0xab6f('0x12')](function(_0x139fcf){return _0x46b0f6(_0x139fcf);});});};function localAuthenticate(_0x245ac9,_0x45ee53,_0x5eac8b,_0x383c30){_0x245ac9[_0xab6f('0x13')]({'where':{'name':_0x45ee53,'role':{'$or':[_0xab6f('0x14'),'user',_0xab6f('0xb')]}}})['then'](function(_0x49d9f1){if(!_0x49d9f1||_0x49d9f1&&_0x49d9f1[_0xab6f('0x15')]!==_0x45ee53){return _0x383c30(null,![],{'message':'Incorrect\x20username\x20and/or\x20password'});}return getLicense(_0x49d9f1);})[_0xab6f('0xe')](function(_0x3653f0){_0x3653f0[_0xab6f('0x16')](_0x5eac8b,function(_0x59b934,_0x255021){if(_0x59b934){return _0x383c30(_0x59b934);}if(!_0x255021){return _0x383c30(null,![],{'message':'Incorrect\x20username\x20and/or\x20password'});}else{return _0x383c30(null,_0x3653f0);}});})[_0xab6f('0x12')](function(_0x439b73){_0x383c30(_0x439b73);});}function sendServiceMail(_0x3e616c){return db[_0xab6f('0x17')][_0xab6f('0x13')]({'where':{'service':!![]},'attributes':['id',_0xab6f('0x15'),_0xab6f('0x18')],'include':[{'model':db['MailServerOut'],'as':_0xab6f('0x19')}]})[_0xab6f('0xe')](function(_0x175426){if(!_0x175426){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x43eda0={'tls':{'rejectUnauthorized':![]}};if(_0x175426[_0xab6f('0x19')][_0xab6f('0x1a')]){_0x43eda0[_0xab6f('0x1a')]=_0x175426[_0xab6f('0x19')][_0xab6f('0x1a')];}else{_0x43eda0['host']=_0x175426['Smtp'][_0xab6f('0x1b')];_0x43eda0[_0xab6f('0x1c')]=_0x175426[_0xab6f('0x19')][_0xab6f('0x1c')];_0x43eda0[_0xab6f('0x1d')]=_0x175426[_0xab6f('0x19')][_0xab6f('0x1d')];}if(_0x175426['Smtp'][_0xab6f('0x1e')]){_0x43eda0[_0xab6f('0x1f')]={'user':_0x175426['Smtp'][_0xab6f('0x20')],'pass':_0x175426[_0xab6f('0x19')][_0xab6f('0x21')]};}var _0x2e10a7={'account':_0x43eda0,'message':_[_0xab6f('0x22')]({'from':util['format'](_0xab6f('0x23'),_0x175426[_0xab6f('0x15')],_0x175426['email']||_0x175426[_0xab6f('0x19')][_0xab6f('0x20')])},_0x3e616c)};return client[_0xab6f('0x24')](_0xab6f('0x25'),_0x2e10a7);})[_0xab6f('0xe')](function(_0x181bab){if(_0x181bab['error']){throw new Error(util[_0xab6f('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x181bab['error']['message']||JSON['stringify'](_0x181bab['error'])));}return!![];});}function handleError(_0x14af68,_0xd58fdf,_0x4110dd){return _0x14af68[_0xab6f('0x27')](_0xd58fdf||0x1f4)[_0xab6f('0x28')]({'message':_0x4110dd?_0x4110dd['message']||_0x4110dd:''});}exports[_0xab6f('0x29')]=function(_0x11a4d4,_0x86ed70,_0x26c62b){passport[_0xab6f('0x16')](_0xab6f('0x2a'),function(_0x140cac,_0x5b5966,_0x19b056){var _0xab5bb=_0x140cac||_0x19b056;if(_0xab5bb){return handleError(_0x86ed70,0x191,_0xab5bb);}if(!_0x5b5966){return handleError(_0x86ed70,0x194,{'message':_0xab6f('0x2b')});}var _0x5479db=signToken(_0x5b5966['id'],_0x5b5966[_0xab6f('0xa')]);_0x86ed70['json']({'id':_0x5b5966['id'],'token':_0x5479db,'statusCall':'','isAlreadyLogged':_0x5b5966[_0xab6f('0x2c')]});})(_0x11a4d4,_0x86ed70,_0x26c62b);};exports[_0xab6f('0x2d')]=function(_0x3b4e24,_0x37d187,_0x2e9eca){if(!_0x3b4e24[_0xab6f('0x2e')][_0xab6f('0x18')]){return handleError(_0x37d187,0x1f4,{'message':_0xab6f('0x2f')});}var _0x679c47=rs['generate']();_0x3b4e24[_0xab6f('0x2e')]['email']=_0x3b4e24['body'][_0xab6f('0x18')][_0xab6f('0x30')]()[_0xab6f('0x31')]();return db[_0xab6f('0xc')][_0xab6f('0x13')]({'where':{'email':_0x3b4e24[_0xab6f('0x2e')]['email']}})['then'](function(_0x5baf96){if(!_0x5baf96){throw new Error(_0xab6f('0x32'));}_0x5baf96[_0xab6f('0x33')]=_0x679c47;_0x5baf96[_0xab6f('0x34')]=Date[_0xab6f('0x35')]()+0x36ee80;return _0x5baf96['save']();})[_0xab6f('0xe')](function(){return sendServiceMail({'to':_0x3b4e24[_0xab6f('0x2e')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xab6f('0x36')+_0xab6f('0x37')+_0xab6f('0x38')+_0x3b4e24[_0xab6f('0x39')]['host']+'/reset/'+_0x679c47+'\x0a\x0a'+_0xab6f('0x3a')});})[_0xab6f('0xe')](function(){_0x37d187[_0xab6f('0x27')](0xc8)[_0xab6f('0x28')]({'message':_0xab6f('0x3b')});})[_0xab6f('0x12')](function(_0x4e835f){return handleError(_0x37d187,0x1f4,_0x4e835f);});};exports[_0xab6f('0x3c')]=function(_0xedcac4,_0x3be090,_0x435525){return db[_0xab6f('0xc')][_0xab6f('0x13')]({'where':{'resetPasswordToken':_0xedcac4[_0xab6f('0x3d')][_0xab6f('0x3e')],'resetPasswordExpires':{'$gt':Date[_0xab6f('0x35')]()}}})[_0xab6f('0xe')](function(_0x3df7f1){if(!_0x3df7f1){throw new Error(_0xab6f('0x3f'));}_0x3df7f1[_0xab6f('0x40')]=_0xedcac4[_0xab6f('0x2e')][_0xab6f('0x40')];_0x3df7f1[_0xab6f('0x33')]=null;_0x3df7f1['resetPasswordExpires']=null;return _0x3df7f1[_0xab6f('0x41')]();})[_0xab6f('0xe')](function(){_0x3be090[_0xab6f('0x27')](0xc8)[_0xab6f('0x28')]({'message':_0xab6f('0x42')});})['catch'](function(_0x4da669){return handleError(_0x3be090,0x1f4,_0x4da669);});};passport[_0xab6f('0x43')](new LocalStrategy({'usernameField':_0xab6f('0x15'),'passwordField':_0xab6f('0x40')},function(_0x1f7e4c,_0x3e3ef1,_0x4f84d7){return localAuthenticate(db[_0xab6f('0xc')],_0x1f7e4c,_0x3e3ef1,_0x4f84d7);})); \ No newline at end of file +var _0xb574=['then','getLicense','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','name','authenticate','Incorrect\x20username\x20and/or\x20password','MailAccount','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','format','\x22%s\x22\x20<%s>','user','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','save','Password\x20reset!','use','util','passport','Strategy','bluebird','lodash','../../config/logger','api','randomstring','../../mysqldb','client','role','agent','User','count'];(function(_0x42f3a5,_0x3a4470){var _0x1a7d74=function(_0x43cc36){while(--_0x43cc36){_0x42f3a5['push'](_0x42f3a5['shift']());}};_0x1a7d74(++_0x3a4470);}(_0xb574,0x106));var _0x4b57=function(_0x4fd996,_0x49de07){_0x4fd996=_0x4fd996-0x0;var _0x48e3ea=_0xb574[_0x4fd996];return _0x48e3ea;};'use strict';var util=require(_0x4b57('0x0'));var passport=require(_0x4b57('0x1'));var LocalStrategy=require('passport-local')[_0x4b57('0x2')];var BPromise=require(_0x4b57('0x3'));var jayson=require('jayson/promise');var _=require(_0x4b57('0x4'));var logger=require(_0x4b57('0x5'))(_0x4b57('0x6'));var rs=require(_0x4b57('0x7'));var db=require(_0x4b57('0x8'))['db'];var signToken=require('../../components/auth/service')['signToken'];var client=jayson[_0x4b57('0x9')]['http']({'port':0x232b});var getLicense=function(_0x585d86){return new BPromise(function(_0x4b2d65,_0x548ee8){var _0x291e54=0x0;_0x585d86[_0x4b57('0xa')]!==_0x4b57('0xb')&&_0x4b2d65(_0x585d86);return db[_0x4b57('0xc')][_0x4b57('0xd')]({'where':{'role':_0x4b57('0xb'),'online':!![],'id':{'$ne':_0x585d86['id']}}})[_0x4b57('0xe')](function(_0x43b108){_0x291e54=_0x43b108;return require('../../config/license/util')[_0x4b57('0xf')]();})[_0x4b57('0xe')](function(_0x274912){if(_0x274912&&_0x274912['agents']&&_0x291e54>=_0x274912['agents']){return _0x548ee8({'message':_0x4b57('0x10')});}return _0x4b2d65(_0x585d86);})[_0x4b57('0x11')](function(_0x43d066){return _0x548ee8(_0x43d066);});});};function localAuthenticate(_0xf8a6fc,_0x607276,_0x1ab6a8,_0x30f685){_0xf8a6fc[_0x4b57('0x12')]({'where':{'name':_0x607276,'role':{'$or':[_0x4b57('0x13'),'user','agent']}}})[_0x4b57('0xe')](function(_0x24f776){if(!_0x24f776||_0x24f776&&_0x24f776[_0x4b57('0x14')]!==_0x607276){return _0x30f685(null,![],{'message':'Incorrect\x20username\x20and/or\x20password'});}return getLicense(_0x24f776);})[_0x4b57('0xe')](function(_0x48bd13){_0x48bd13[_0x4b57('0x15')](_0x1ab6a8,function(_0x42aff4,_0x1b018c){if(_0x42aff4){return _0x30f685(_0x42aff4);}if(!_0x1b018c){return _0x30f685(null,![],{'message':_0x4b57('0x16')});}else{return _0x30f685(null,_0x48bd13);}});})[_0x4b57('0x11')](function(_0xfb71cc){_0x30f685(_0xfb71cc);});}function sendServiceMail(_0x4ede42){return db[_0x4b57('0x17')][_0x4b57('0x12')]({'where':{'service':!![]},'attributes':['id',_0x4b57('0x14'),_0x4b57('0x18')],'include':[{'model':db['MailServerOut'],'as':_0x4b57('0x19')}]})[_0x4b57('0xe')](function(_0xad9165){if(!_0xad9165){throw new Error(_0x4b57('0x1a'));}var _0xef1eae={'tls':{'rejectUnauthorized':![]}};if(_0xad9165[_0x4b57('0x19')]['service']){_0xef1eae[_0x4b57('0x1b')]=_0xad9165[_0x4b57('0x19')][_0x4b57('0x1b')];}else{_0xef1eae['host']=_0xad9165[_0x4b57('0x19')][_0x4b57('0x1c')];_0xef1eae[_0x4b57('0x1d')]=_0xad9165[_0x4b57('0x19')]['port'];_0xef1eae[_0x4b57('0x1e')]=_0xad9165[_0x4b57('0x19')]['secure'];}if(_0xad9165[_0x4b57('0x19')][_0x4b57('0x1f')]){_0xef1eae[_0x4b57('0x20')]={'user':_0xad9165[_0x4b57('0x19')]['user'],'pass':_0xad9165[_0x4b57('0x19')]['pass']};}var _0x131dab={'account':_0xef1eae,'message':_['merge']({'from':util[_0x4b57('0x21')](_0x4b57('0x22'),_0xad9165[_0x4b57('0x14')],_0xad9165[_0x4b57('0x18')]||_0xad9165[_0x4b57('0x19')][_0x4b57('0x23')])},_0x4ede42)};return client['request']('SendMail',_0x131dab);})[_0x4b57('0xe')](function(_0x4c58e4){if(_0x4c58e4[_0x4b57('0x24')]){throw new Error(util[_0x4b57('0x21')](_0x4b57('0x25'),_0x4c58e4[_0x4b57('0x24')][_0x4b57('0x26')]||JSON[_0x4b57('0x27')](_0x4c58e4['error'])));}return!![];});}function handleError(_0xab365c,_0x2e9922,_0x68be27){return _0xab365c[_0x4b57('0x28')](_0x2e9922||0x1f4)['send']({'message':_0x68be27?_0x68be27[_0x4b57('0x26')]||_0x68be27:''});}exports[_0x4b57('0x29')]=function(_0x4cc72a,_0xbfb420,_0xa5b5dc){passport[_0x4b57('0x15')](_0x4b57('0x2a'),function(_0x492de8,_0x5742a0,_0x5f03d9){var _0x23ff83=_0x492de8||_0x5f03d9;if(_0x23ff83){return handleError(_0xbfb420,0x191,_0x23ff83);}if(!_0x5742a0){return handleError(_0xbfb420,0x194,{'message':_0x4b57('0x2b')});}var _0xccc679=signToken(_0x5742a0['id'],_0x5742a0[_0x4b57('0xa')]);_0xbfb420[_0x4b57('0x2c')]({'id':_0x5742a0['id'],'token':_0xccc679,'statusCall':'','isAlreadyLogged':_0x5742a0['online']});})(_0x4cc72a,_0xbfb420,_0xa5b5dc);};exports[_0x4b57('0x2d')]=function(_0x3e77e0,_0x1fd3f7,_0x4d26e4){if(!_0x3e77e0[_0x4b57('0x2e')][_0x4b57('0x18')]){return handleError(_0x1fd3f7,0x1f4,{'message':_0x4b57('0x2f')});}var _0x5b9bfc=rs[_0x4b57('0x30')]();_0x3e77e0[_0x4b57('0x2e')]['email']=_0x3e77e0[_0x4b57('0x2e')][_0x4b57('0x18')][_0x4b57('0x31')]()[_0x4b57('0x32')]();return db[_0x4b57('0xc')][_0x4b57('0x12')]({'where':{'email':_0x3e77e0['body'][_0x4b57('0x18')]}})[_0x4b57('0xe')](function(_0xc2d4f5){if(!_0xc2d4f5){throw new Error(_0x4b57('0x33'));}_0xc2d4f5[_0x4b57('0x34')]=_0x5b9bfc;_0xc2d4f5[_0x4b57('0x35')]=Date[_0x4b57('0x36')]()+0x36ee80;return _0xc2d4f5['save']();})['then'](function(){return sendServiceMail({'to':_0x3e77e0[_0x4b57('0x2e')][_0x4b57('0x18')],'subject':_0x4b57('0x37'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x4b57('0x38')+_0x4b57('0x39')+_0x3e77e0[_0x4b57('0x3a')][_0x4b57('0x1c')]+'/reset/'+_0x5b9bfc+'\x0a\x0a'+_0x4b57('0x3b')});})[_0x4b57('0xe')](function(){_0x1fd3f7[_0x4b57('0x28')](0xc8)[_0x4b57('0x3c')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x5d624c){return handleError(_0x1fd3f7,0x1f4,_0x5d624c);});};exports[_0x4b57('0x3d')]=function(_0x3ab783,_0x188f24,_0x2e23d3){return db['User'][_0x4b57('0x12')]({'where':{'resetPasswordToken':_0x3ab783[_0x4b57('0x3e')][_0x4b57('0x3f')],'resetPasswordExpires':{'$gt':Date[_0x4b57('0x36')]()}}})[_0x4b57('0xe')](function(_0x453129){if(!_0x453129){throw new Error(_0x4b57('0x40'));}_0x453129[_0x4b57('0x41')]=_0x3ab783[_0x4b57('0x2e')]['password'];_0x453129[_0x4b57('0x34')]=null;_0x453129[_0x4b57('0x35')]=null;return _0x453129[_0x4b57('0x42')]();})['then'](function(){_0x188f24[_0x4b57('0x28')](0xc8)['send']({'message':_0x4b57('0x43')});})[_0x4b57('0x11')](function(_0x457273){return handleError(_0x188f24,0x1f4,_0x457273);});};passport[_0x4b57('0x44')](new LocalStrategy({'usernameField':_0x4b57('0x14'),'passwordField':_0x4b57('0x41')},function(_0x1c1c46,_0x1f20ff,_0x23f5f5){return localAuthenticate(db[_0x4b57('0xc')],_0x1c1c46,_0x1f20ff,_0x23f5f5);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 994fd4b..67db65d 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 _0xbe2a=['/forgot','forgot','/reset/:token','exports','express','./authLocal.controller','login'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe2a,0xf2));var _0xabe2=function(_0x43dcf9,_0x528619){_0x43dcf9=_0x43dcf9-0x0;var _0x57027e=_0xbe2a[_0x43dcf9];return _0x57027e;};'use strict';var express=require(_0xabe2('0x0'));var router=express['Router']();var controller=require(_0xabe2('0x1'));router['post']('/',controller[_0xabe2('0x2')]);router['post'](_0xabe2('0x3'),controller[_0xabe2('0x4')]);router['post'](_0xabe2('0x5'),controller['reset']);module[_0xabe2('0x6')]=router; \ No newline at end of file +var _0x73f1=['/forgot','forgot','post','/reset/:token','reset','exports','Router','./authLocal.controller'];(function(_0x278949,_0x3502cc){var _0x273699=function(_0x19114f){while(--_0x19114f){_0x278949['push'](_0x278949['shift']());}};_0x273699(++_0x3502cc);}(_0x73f1,0x1be));var _0x173f=function(_0x3d0d60,_0x12eb01){_0x3d0d60=_0x3d0d60-0x0;var _0x12a129=_0x73f1[_0x3d0d60];return _0x12a129;};'use strict';var express=require('express');var router=express[_0x173f('0x0')]();var controller=require(_0x173f('0x1'));router['post']('/',controller['login']);router['post'](_0x173f('0x2'),controller[_0x173f('0x3')]);router[_0x173f('0x4')](_0x173f('0x5'),controller[_0x173f('0x6')]);module[_0x173f('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 374c558..dd06be1 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 _0x7382=['exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7382,0x111));var _0x2738=function(_0x55cab9,_0x52d1e9){_0x55cab9=_0x55cab9-0x0;var _0x48b567=_0x7382[_0x55cab9];return _0x48b567;};'use strict';var Sequelize=require('sequelize');module[_0x2738('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x57fa=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57fa,0x127));var _0xa57f=function(_0x3e5237,_0x57234f){_0x3e5237=_0x3e5237-0x0;var _0x2501aa=_0x57fa[_0x3e5237];return _0x2501aa;};'use strict';var Sequelize=require(_0xa57f('0x0'));module[_0xa57f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xa57f('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xa57f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa57f('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 1dee583..68b42bd 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 _0x2868=['where','map','VIRTUAL','field','options','count','include','findAll','catch','show','rawAttributes','includeAll','merge','create','body','params','find','addConditions','Condition','ids','omit','getConditions','findOne','order','pick','filter','addActions','Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','Automation','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x105278,_0x774ed2){var _0x47b1f=function(_0xf8a100){while(--_0xf8a100){_0x105278['push'](_0x105278['shift']());}};_0x47b1f(++_0x774ed2);}(_0x2868,0x1bc));var _0x8286=function(_0x544144,_0xdf5230){_0x544144=_0x544144-0x0;var _0x5d88b6=_0x2868[_0x544144];return _0x5d88b6;};'use strict';var pdf=require(_0x8286('0x0'));var emlformat=require(_0x8286('0x1'));var rimraf=require(_0x8286('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8286('0x3'));var rp=require(_0x8286('0x4'));var moment=require(_0x8286('0x5'));var BPromise=require(_0x8286('0x6'));var Mustache=require(_0x8286('0x7'));var util=require(_0x8286('0x8'));var path=require(_0x8286('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8286('0xa'));var fs=require('fs');var _=require(_0x8286('0xb'));var squel=require(_0x8286('0xc'));var crypto=require(_0x8286('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8286('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8286('0xf'));var Papa=require(_0x8286('0x10'));var authService=require(_0x8286('0x11'));var hardwareService=require(_0x8286('0x12'));var Redis=require(_0x8286('0x13'));var qs=require(_0x8286('0x14'));var logger=require(_0x8286('0x15'))(_0x8286('0x16'));var utils=require(_0x8286('0x17'));var config=require(_0x8286('0x18'));var db=require(_0x8286('0x19'))['db'];function respondWithStatusCode(_0x5316bf,_0x44fa5b){_0x44fa5b=_0x44fa5b||0xcc;return function(_0x2d25fb){if(_0x2d25fb){return _0x5316bf['sendStatus'](_0x44fa5b);}return _0x5316bf[_0x8286('0x1a')](_0x44fa5b)[_0x8286('0x1b')]();};}function respondWithResult(_0x39bfcb,_0x518df6){_0x518df6=_0x518df6||0xc8;return function(_0x4e10dd){if(_0x4e10dd){return _0x39bfcb[_0x8286('0x1a')](_0x518df6)[_0x8286('0x1c')](_0x4e10dd);}};}function respondWithFilteredResult(_0x525e79,_0x463b54){return function(_0x2a4b0c){if(_0x2a4b0c){var _0x409662=_0x2a4b0c['count'],_0x1f2b7b=_0x463b54['offset'],_0x67317b=_0x463b54[_0x8286('0x1d')]+_0x463b54[_0x8286('0x1e')],_0x5b953f;if(_0x67317b>=_0x409662){_0x67317b=_0x409662;_0x5b953f=0xc8;}else{_0x5b953f=0xce;}_0x525e79[_0x8286('0x1a')](_0x5b953f);return _0x525e79[_0x8286('0x1f')]('Content-Range',_0x1f2b7b+'-'+_0x67317b+'/'+_0x409662)[_0x8286('0x1c')](_0x2a4b0c);}return null;};}function patchUpdates(_0x366c66){return function(_0x39d235){try{jsonpatch[_0x8286('0x20')](_0x39d235,_0x366c66,!![]);}catch(_0x7940d7){return BPromise[_0x8286('0x21')](_0x7940d7);}return _0x39d235[_0x8286('0x22')]();};}function saveUpdates(_0xdba3b3,_0x5d4668){return function(_0x4eebb9){if(_0x4eebb9){return _0x4eebb9[_0x8286('0x23')](_0xdba3b3)[_0x8286('0x24')](function(_0x3f617e){return _0x3f617e;});}return null;};}function removeEntity(_0x364c12,_0x1c9e38){return function(_0x3de49a){if(_0x3de49a){return _0x3de49a[_0x8286('0x25')]()[_0x8286('0x24')](function(){_0x364c12['status'](0xcc)[_0x8286('0x1b')]();});}};}function handleEntityNotFound(_0xae7343,_0x51b068){return function(_0x566473){if(!_0x566473){_0xae7343['sendStatus'](0x194);}return _0x566473;};}function handleError(_0x4d03ef,_0x283706){_0x283706=_0x283706||0x1f4;return function(_0x40a28d){logger[_0x8286('0x26')](_0x40a28d['stack']);if(_0x40a28d[_0x8286('0x27')]){delete _0x40a28d[_0x8286('0x27')];}_0x4d03ef['status'](_0x283706)[_0x8286('0x28')](_0x40a28d);};}exports[_0x8286('0x29')]=function(_0x5827ad,_0x464ba8){var _0x57de86={},_0x36ade1={},_0x75ba9b={'count':0x0,'rows':[]};var _0x209a4f=db[_0x8286('0x2a')]['rawAttributes'];_0x36ade1['model']=_[_0x8286('0x2b')](_0x209a4f);_0x36ade1[_0x8286('0x2c')]=_[_0x8286('0x2b')](_0x5827ad['query']);_0x36ade1[_0x8286('0x2d')]=_[_0x8286('0x2e')](_0x36ade1[_0x8286('0x2f')],_0x36ade1[_0x8286('0x2c')]);_0x57de86[_0x8286('0x30')]=_[_0x8286('0x2e')](_0x36ade1[_0x8286('0x2f')],qs[_0x8286('0x31')](_0x5827ad['query']['fields']));_0x57de86[_0x8286('0x30')]=_0x57de86[_0x8286('0x30')][_0x8286('0x32')]?_0x57de86[_0x8286('0x30')]:_0x36ade1[_0x8286('0x2f')];if(!_0x5827ad[_0x8286('0x2c')][_0x8286('0x33')](_0x8286('0x34'))){_0x57de86['limit']=qs[_0x8286('0x1e')](_0x5827ad['query'][_0x8286('0x1e')]);_0x57de86[_0x8286('0x1d')]=qs[_0x8286('0x1d')](_0x5827ad[_0x8286('0x2c')][_0x8286('0x1d')]);}_0x57de86['order']=qs[_0x8286('0x35')](_0x5827ad[_0x8286('0x2c')][_0x8286('0x35')]);_0x57de86[_0x8286('0x36')]=qs[_0x8286('0x2d')](_['pick'](_0x5827ad[_0x8286('0x2c')],_0x36ade1[_0x8286('0x2d')]));if(_0x5827ad['query']['filter']){_0x57de86[_0x8286('0x36')]=_['merge'](_0x57de86[_0x8286('0x36')],{'$or':_[_0x8286('0x37')](_0x209a4f,function(_0x14c33b){if(_0x14c33b['type']['key']!==_0x8286('0x38')){var _0xd7c468={};_0xd7c468[_0x14c33b[_0x8286('0x39')]]={'$like':'%'+_0x5827ad[_0x8286('0x2c')]['filter']+'%'};return _0xd7c468;}})});}_0x57de86=_['merge']({},_0x57de86,_0x5827ad[_0x8286('0x3a')]);var _0x2666c4={'where':_0x57de86[_0x8286('0x36')]};return db['Automation'][_0x8286('0x3b')](_0x2666c4)[_0x8286('0x24')](function(_0x580272){_0x75ba9b['count']=_0x580272;if(_0x5827ad[_0x8286('0x2c')]['includeAll']){_0x57de86[_0x8286('0x3c')]=[{'all':!![]}];}return db[_0x8286('0x2a')][_0x8286('0x3d')](_0x57de86);})[_0x8286('0x24')](function(_0x56964c){_0x75ba9b['rows']=_0x56964c;return _0x75ba9b;})[_0x8286('0x24')](respondWithFilteredResult(_0x464ba8,_0x57de86))[_0x8286('0x3e')](handleError(_0x464ba8,null));};exports[_0x8286('0x3f')]=function(_0x297908,_0x4162e5){var _0x32a798={'raw':![],'where':{'id':_0x297908['params']['id']}},_0x403a99={};_0x403a99[_0x8286('0x2f')]=_[_0x8286('0x2b')](db['Automation'][_0x8286('0x40')]);_0x403a99[_0x8286('0x2c')]=_['keys'](_0x297908[_0x8286('0x2c')]);_0x403a99[_0x8286('0x2d')]=_[_0x8286('0x2e')](_0x403a99['model'],_0x403a99[_0x8286('0x2c')]);_0x32a798[_0x8286('0x30')]=_['intersection'](_0x403a99[_0x8286('0x2f')],qs[_0x8286('0x31')](_0x297908[_0x8286('0x2c')][_0x8286('0x31')]));_0x32a798[_0x8286('0x30')]=_0x32a798['attributes'][_0x8286('0x32')]?_0x32a798[_0x8286('0x30')]:_0x403a99[_0x8286('0x2f')];if(_0x297908[_0x8286('0x2c')][_0x8286('0x41')]){_0x32a798[_0x8286('0x3c')]=[{'all':!![]}];}_0x32a798=_[_0x8286('0x42')]({},_0x32a798,_0x297908['options']);return db[_0x8286('0x2a')]['find'](_0x32a798)[_0x8286('0x24')](handleEntityNotFound(_0x4162e5,null))[_0x8286('0x24')](respondWithResult(_0x4162e5,null))[_0x8286('0x3e')](handleError(_0x4162e5,null));};exports['create']=function(_0x51a996,_0x1ed1a9){return db['Automation'][_0x8286('0x43')](_0x51a996['body'],{})[_0x8286('0x24')](respondWithResult(_0x1ed1a9,0xc9))[_0x8286('0x3e')](handleError(_0x1ed1a9,null));};exports[_0x8286('0x23')]=function(_0x5964ec,_0x58e537){if(_0x5964ec[_0x8286('0x44')]['id']){delete _0x5964ec[_0x8286('0x44')]['id'];}return db[_0x8286('0x2a')]['find']({'where':{'id':_0x5964ec[_0x8286('0x45')]['id']}})['then'](handleEntityNotFound(_0x58e537,null))[_0x8286('0x24')](saveUpdates(_0x5964ec[_0x8286('0x44')],null))[_0x8286('0x24')](respondWithResult(_0x58e537,null))[_0x8286('0x3e')](handleError(_0x58e537,null));};exports['destroy']=function(_0x542adb,_0x5e7f35){return db[_0x8286('0x2a')][_0x8286('0x46')]({'where':{'id':_0x542adb[_0x8286('0x45')]['id']}})[_0x8286('0x24')](handleEntityNotFound(_0x5e7f35,null))['then'](removeEntity(_0x5e7f35,null))['catch'](handleError(_0x5e7f35,null));};exports[_0x8286('0x47')]=function(_0x590829,_0x30a173,_0x2ec7a2){return db[_0x8286('0x48')][_0x8286('0x46')]({'where':{'id':_0x590829[_0x8286('0x45')]['id']}})[_0x8286('0x24')](handleEntityNotFound(_0x30a173,null))[_0x8286('0x24')](function(_0x13cde0){if(_0x13cde0){return _0x13cde0[_0x8286('0x47')](_0x590829['body'][_0x8286('0x49')],_[_0x8286('0x4a')](_0x590829[_0x8286('0x44')],[_0x8286('0x49'),'id'])||{});}})[_0x8286('0x24')](respondWithResult(_0x30a173,null))[_0x8286('0x3e')](handleError(_0x30a173,null));};exports[_0x8286('0x4b')]=function(_0x2af378,_0x3cc8e8,_0x52f8d3){var _0x34a066={};var _0x5bbf04={};var _0xedb912;var _0x2ca1f4;return db['Automation'][_0x8286('0x4c')]({'where':{'id':_0x2af378[_0x8286('0x45')]['id']}})[_0x8286('0x24')](handleEntityNotFound(_0x3cc8e8,null))[_0x8286('0x24')](function(_0x13141a){if(_0x13141a){_0xedb912=_0x13141a;_0x5bbf04[_0x8286('0x2f')]=_['keys'](db[_0x8286('0x48')][_0x8286('0x40')]);_0x5bbf04[_0x8286('0x2c')]=_['keys'](_0x2af378[_0x8286('0x2c')]);_0x5bbf04[_0x8286('0x2d')]=_[_0x8286('0x2e')](_0x5bbf04['model'],_0x5bbf04[_0x8286('0x2c')]);_0x34a066['attributes']=_['intersection'](_0x5bbf04[_0x8286('0x2f')],qs['fields'](_0x2af378[_0x8286('0x2c')][_0x8286('0x31')]));_0x34a066[_0x8286('0x30')]=_0x34a066[_0x8286('0x30')]['length']?_0x34a066[_0x8286('0x30')]:_0x5bbf04[_0x8286('0x2f')];_0x34a066[_0x8286('0x4d')]=qs['sort'](_0x2af378[_0x8286('0x2c')][_0x8286('0x35')]);_0x34a066[_0x8286('0x36')]=qs[_0x8286('0x2d')](_[_0x8286('0x4e')](_0x2af378['query'],_0x5bbf04[_0x8286('0x2d')]));if(_0x2af378[_0x8286('0x2c')][_0x8286('0x4f')]){_0x34a066[_0x8286('0x36')]=_[_0x8286('0x42')](_0x34a066[_0x8286('0x36')],{'$or':_['map'](_0x34a066[_0x8286('0x30')],function(_0x1536ad){var _0x24b84f={};_0x24b84f[_0x1536ad]={'$like':'%'+_0x2af378[_0x8286('0x2c')][_0x8286('0x4f')]+'%'};return _0x24b84f;})});}_0x34a066=_[_0x8286('0x42')]({},_0x34a066,_0x2af378['options']);return _0xedb912[_0x8286('0x4b')](_0x34a066);}})['then'](function(_0x2c7ed2){if(_0x2c7ed2){_0x2ca1f4=_0x2c7ed2[_0x8286('0x32')];if(!_0x2af378[_0x8286('0x2c')][_0x8286('0x33')](_0x8286('0x34'))){_0x34a066[_0x8286('0x1e')]=qs[_0x8286('0x1e')](_0x2af378[_0x8286('0x2c')][_0x8286('0x1e')]);_0x34a066['offset']=qs['offset'](_0x2af378[_0x8286('0x2c')]['offset']);}return _0xedb912['getConditions'](_0x34a066);}})[_0x8286('0x24')](function(_0x449407){if(_0x449407){return _0x449407?{'count':_0x2ca1f4,'rows':_0x449407}:null;}})[_0x8286('0x24')](respondWithResult(_0x3cc8e8,null))['catch'](handleError(_0x3cc8e8,null));};exports[_0x8286('0x50')]=function(_0x3b9224,_0x14b835,_0x29b78e){return db[_0x8286('0x51')][_0x8286('0x46')]({'where':{'id':_0x3b9224[_0x8286('0x45')]['id']}})['then'](handleEntityNotFound(_0x14b835,null))['then'](function(_0xd1b3d9){if(_0xd1b3d9){return _0xd1b3d9[_0x8286('0x50')](_0x3b9224['body']['ids'],_[_0x8286('0x4a')](_0x3b9224['body'],[_0x8286('0x49'),'id'])||{});}})[_0x8286('0x24')](respondWithResult(_0x14b835,null))[_0x8286('0x3e')](handleError(_0x14b835,null));};exports['getActions']=function(_0x4cd3f7,_0x2b3739,_0x163122){var _0x4f6166={};var _0x508ff9={};var _0x270d37;var _0x5ca52e;return db[_0x8286('0x2a')][_0x8286('0x4c')]({'where':{'id':_0x4cd3f7[_0x8286('0x45')]['id']}})[_0x8286('0x24')](handleEntityNotFound(_0x2b3739,null))[_0x8286('0x24')](function(_0x12e041){if(_0x12e041){_0x270d37=_0x12e041;_0x508ff9[_0x8286('0x2f')]=_['keys'](db[_0x8286('0x51')]['rawAttributes']);_0x508ff9[_0x8286('0x2c')]=_[_0x8286('0x2b')](_0x4cd3f7['query']);_0x508ff9[_0x8286('0x2d')]=_[_0x8286('0x2e')](_0x508ff9[_0x8286('0x2f')],_0x508ff9['query']);_0x4f6166['attributes']=_[_0x8286('0x2e')](_0x508ff9[_0x8286('0x2f')],qs[_0x8286('0x31')](_0x4cd3f7['query'][_0x8286('0x31')]));_0x4f6166['attributes']=_0x4f6166['attributes'][_0x8286('0x32')]?_0x4f6166[_0x8286('0x30')]:_0x508ff9['model'];_0x4f6166[_0x8286('0x4d')]=qs[_0x8286('0x35')](_0x4cd3f7[_0x8286('0x2c')][_0x8286('0x35')]);_0x4f6166[_0x8286('0x36')]=qs['filters'](_[_0x8286('0x4e')](_0x4cd3f7[_0x8286('0x2c')],_0x508ff9[_0x8286('0x2d')]));if(_0x4cd3f7[_0x8286('0x2c')]['filter']){_0x4f6166[_0x8286('0x36')]=_['merge'](_0x4f6166[_0x8286('0x36')],{'$or':_[_0x8286('0x37')](_0x4f6166[_0x8286('0x30')],function(_0x24cc8f){var _0x95c22={};_0x95c22[_0x24cc8f]={'$like':'%'+_0x4cd3f7[_0x8286('0x2c')][_0x8286('0x4f')]+'%'};return _0x95c22;})});}_0x4f6166=_[_0x8286('0x42')]({},_0x4f6166,_0x4cd3f7[_0x8286('0x3a')]);return _0x270d37[_0x8286('0x52')](_0x4f6166);}})[_0x8286('0x24')](function(_0x124838){if(_0x124838){_0x5ca52e=_0x124838['length'];if(!_0x4cd3f7[_0x8286('0x2c')][_0x8286('0x33')]('nolimit')){_0x4f6166[_0x8286('0x1e')]=qs[_0x8286('0x1e')](_0x4cd3f7[_0x8286('0x2c')]['limit']);_0x4f6166[_0x8286('0x1d')]=qs['offset'](_0x4cd3f7[_0x8286('0x2c')][_0x8286('0x1d')]);}return _0x270d37[_0x8286('0x52')](_0x4f6166);}})[_0x8286('0x24')](function(_0x4ca16f){if(_0x4ca16f){return _0x4ca16f?{'count':_0x5ca52e,'rows':_0x4ca16f}:null;}})[_0x8286('0x24')](respondWithResult(_0x2b3739,null))[_0x8286('0x3e')](handleError(_0x2b3739,null));}; \ No newline at end of file +var _0xcc74=['body','update','params','addConditions','ids','omit','map','getConditions','Action','addActions','getActions','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','end','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','name','index','Automation','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','find','create'];(function(_0x43c9b1,_0x5941f3){var _0x1e26d3=function(_0x404206){while(--_0x404206){_0x43c9b1['push'](_0x43c9b1['shift']());}};_0x1e26d3(++_0x5941f3);}(_0xcc74,0x158));var _0x4cc7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcc74[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0x4cc7('0x0'));var emlformat=require(_0x4cc7('0x1'));var rimraf=require(_0x4cc7('0x2'));var zipdir=require(_0x4cc7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4cc7('0x4'));var moment=require(_0x4cc7('0x5'));var BPromise=require(_0x4cc7('0x6'));var Mustache=require(_0x4cc7('0x7'));var util=require(_0x4cc7('0x8'));var path=require(_0x4cc7('0x9'));var sox=require(_0x4cc7('0xa'));var csv=require(_0x4cc7('0xb'));var ejs=require(_0x4cc7('0xc'));var fs=require('fs');var _=require(_0x4cc7('0xd'));var squel=require(_0x4cc7('0xe'));var crypto=require(_0x4cc7('0xf'));var jsforce=require(_0x4cc7('0x10'));var deskjs=require(_0x4cc7('0x11'));var toCsv=require(_0x4cc7('0xb'));var querystring=require(_0x4cc7('0x12'));var Papa=require(_0x4cc7('0x13'));var authService=require(_0x4cc7('0x14'));var hardwareService=require(_0x4cc7('0x15'));var Redis=require('ioredis');var qs=require(_0x4cc7('0x16'));var logger=require(_0x4cc7('0x17'))(_0x4cc7('0x18'));var utils=require(_0x4cc7('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x196612,_0x1c4b4f){_0x1c4b4f=_0x1c4b4f||0xcc;return function(_0x337d61){if(_0x337d61){return _0x196612['sendStatus'](_0x1c4b4f);}return _0x196612['status'](_0x1c4b4f)[_0x4cc7('0x1a')]();};}function respondWithResult(_0x47fece,_0x5abee7){_0x5abee7=_0x5abee7||0xc8;return function(_0x158c5a){if(_0x158c5a){return _0x47fece[_0x4cc7('0x1b')](_0x5abee7)[_0x4cc7('0x1c')](_0x158c5a);}};}function respondWithFilteredResult(_0x3e12fe,_0x2ded7e){return function(_0x486480){if(_0x486480){var _0x5c7f59=_0x486480['count'],_0x4d4030=_0x2ded7e[_0x4cc7('0x1d')],_0x1faedb=_0x2ded7e['offset']+_0x2ded7e[_0x4cc7('0x1e')],_0xfa6d5f;if(_0x1faedb>=_0x5c7f59){_0x1faedb=_0x5c7f59;_0xfa6d5f=0xc8;}else{_0xfa6d5f=0xce;}_0x3e12fe[_0x4cc7('0x1b')](_0xfa6d5f);return _0x3e12fe['set'](_0x4cc7('0x1f'),_0x4d4030+'-'+_0x1faedb+'/'+_0x5c7f59)['json'](_0x486480);}return null;};}function patchUpdates(_0x16c4b9){return function(_0x32119e){try{jsonpatch[_0x4cc7('0x20')](_0x32119e,_0x16c4b9,!![]);}catch(_0x4974fa){return BPromise[_0x4cc7('0x21')](_0x4974fa);}return _0x32119e[_0x4cc7('0x22')]();};}function saveUpdates(_0x30497a,_0x37a193){return function(_0x4bf219){if(_0x4bf219){return _0x4bf219['update'](_0x30497a)[_0x4cc7('0x23')](function(_0xab4dc5){return _0xab4dc5;});}return null;};}function removeEntity(_0x3871f4,_0x40747e){return function(_0x3949c9){if(_0x3949c9){return _0x3949c9[_0x4cc7('0x24')]()['then'](function(){_0x3871f4['status'](0xcc)[_0x4cc7('0x1a')]();});}};}function handleEntityNotFound(_0x59b997,_0x312024){return function(_0x350dd0){if(!_0x350dd0){_0x59b997[_0x4cc7('0x25')](0x194);}return _0x350dd0;};}function handleError(_0x51949f,_0x28058d){_0x28058d=_0x28058d||0x1f4;return function(_0x5a5b6b){logger['error'](_0x5a5b6b['stack']);if(_0x5a5b6b[_0x4cc7('0x26')]){delete _0x5a5b6b['name'];}_0x51949f['status'](_0x28058d)['send'](_0x5a5b6b);};}exports[_0x4cc7('0x27')]=function(_0x1b8c55,_0x1974e2){var _0x1bfde9={},_0x127f67={},_0x423140={'count':0x0,'rows':[]};var _0x77e81=db[_0x4cc7('0x28')][_0x4cc7('0x29')];_0x127f67['model']=_[_0x4cc7('0x2a')](_0x77e81);_0x127f67[_0x4cc7('0x2b')]=_[_0x4cc7('0x2a')](_0x1b8c55[_0x4cc7('0x2b')]);_0x127f67[_0x4cc7('0x2c')]=_[_0x4cc7('0x2d')](_0x127f67[_0x4cc7('0x2e')],_0x127f67[_0x4cc7('0x2b')]);_0x1bfde9['attributes']=_[_0x4cc7('0x2d')](_0x127f67[_0x4cc7('0x2e')],qs[_0x4cc7('0x2f')](_0x1b8c55['query']['fields']));_0x1bfde9['attributes']=_0x1bfde9[_0x4cc7('0x30')][_0x4cc7('0x31')]?_0x1bfde9[_0x4cc7('0x30')]:_0x127f67['model'];if(!_0x1b8c55[_0x4cc7('0x2b')][_0x4cc7('0x32')](_0x4cc7('0x33'))){_0x1bfde9[_0x4cc7('0x1e')]=qs[_0x4cc7('0x1e')](_0x1b8c55[_0x4cc7('0x2b')][_0x4cc7('0x1e')]);_0x1bfde9['offset']=qs[_0x4cc7('0x1d')](_0x1b8c55[_0x4cc7('0x2b')][_0x4cc7('0x1d')]);}_0x1bfde9[_0x4cc7('0x34')]=qs[_0x4cc7('0x35')](_0x1b8c55[_0x4cc7('0x2b')][_0x4cc7('0x35')]);_0x1bfde9['where']=qs[_0x4cc7('0x2c')](_[_0x4cc7('0x36')](_0x1b8c55['query'],_0x127f67[_0x4cc7('0x2c')]));if(_0x1b8c55[_0x4cc7('0x2b')][_0x4cc7('0x37')]){_0x1bfde9[_0x4cc7('0x38')]=_[_0x4cc7('0x39')](_0x1bfde9[_0x4cc7('0x38')],{'$or':_['map'](_0x77e81,function(_0x456848){if(_0x456848[_0x4cc7('0x3a')]['key']!==_0x4cc7('0x3b')){var _0x378cc8={};_0x378cc8[_0x456848[_0x4cc7('0x3c')]]={'$like':'%'+_0x1b8c55[_0x4cc7('0x2b')][_0x4cc7('0x37')]+'%'};return _0x378cc8;}})});}_0x1bfde9=_[_0x4cc7('0x39')]({},_0x1bfde9,_0x1b8c55[_0x4cc7('0x3d')]);var _0x3864b7={'where':_0x1bfde9['where']};return db[_0x4cc7('0x28')][_0x4cc7('0x3e')](_0x3864b7)[_0x4cc7('0x23')](function(_0x37e23e){_0x423140['count']=_0x37e23e;if(_0x1b8c55[_0x4cc7('0x2b')][_0x4cc7('0x3f')]){_0x1bfde9[_0x4cc7('0x40')]=[{'all':!![]}];}return db[_0x4cc7('0x28')][_0x4cc7('0x41')](_0x1bfde9);})['then'](function(_0x10d0ba){_0x423140[_0x4cc7('0x42')]=_0x10d0ba;return _0x423140;})[_0x4cc7('0x23')](respondWithFilteredResult(_0x1974e2,_0x1bfde9))[_0x4cc7('0x43')](handleError(_0x1974e2,null));};exports[_0x4cc7('0x44')]=function(_0x1506a0,_0x192bdf){var _0x6f59f4={'raw':![],'where':{'id':_0x1506a0['params']['id']}},_0x2b8e08={};_0x2b8e08[_0x4cc7('0x2e')]=_[_0x4cc7('0x2a')](db[_0x4cc7('0x28')][_0x4cc7('0x29')]);_0x2b8e08[_0x4cc7('0x2b')]=_[_0x4cc7('0x2a')](_0x1506a0[_0x4cc7('0x2b')]);_0x2b8e08[_0x4cc7('0x2c')]=_['intersection'](_0x2b8e08['model'],_0x2b8e08[_0x4cc7('0x2b')]);_0x6f59f4[_0x4cc7('0x30')]=_[_0x4cc7('0x2d')](_0x2b8e08[_0x4cc7('0x2e')],qs['fields'](_0x1506a0[_0x4cc7('0x2b')][_0x4cc7('0x2f')]));_0x6f59f4[_0x4cc7('0x30')]=_0x6f59f4[_0x4cc7('0x30')][_0x4cc7('0x31')]?_0x6f59f4['attributes']:_0x2b8e08[_0x4cc7('0x2e')];if(_0x1506a0[_0x4cc7('0x2b')][_0x4cc7('0x3f')]){_0x6f59f4['include']=[{'all':!![]}];}_0x6f59f4=_[_0x4cc7('0x39')]({},_0x6f59f4,_0x1506a0[_0x4cc7('0x3d')]);return db[_0x4cc7('0x28')][_0x4cc7('0x45')](_0x6f59f4)['then'](handleEntityNotFound(_0x192bdf,null))[_0x4cc7('0x23')](respondWithResult(_0x192bdf,null))[_0x4cc7('0x43')](handleError(_0x192bdf,null));};exports['create']=function(_0x4cf22d,_0x42b5da){return db[_0x4cc7('0x28')][_0x4cc7('0x46')](_0x4cf22d[_0x4cc7('0x47')],{})[_0x4cc7('0x23')](respondWithResult(_0x42b5da,0xc9))[_0x4cc7('0x43')](handleError(_0x42b5da,null));};exports[_0x4cc7('0x48')]=function(_0x21b160,_0x2bb4e7){if(_0x21b160[_0x4cc7('0x47')]['id']){delete _0x21b160[_0x4cc7('0x47')]['id'];}return db[_0x4cc7('0x28')]['find']({'where':{'id':_0x21b160['params']['id']}})[_0x4cc7('0x23')](handleEntityNotFound(_0x2bb4e7,null))[_0x4cc7('0x23')](saveUpdates(_0x21b160[_0x4cc7('0x47')],null))[_0x4cc7('0x23')](respondWithResult(_0x2bb4e7,null))[_0x4cc7('0x43')](handleError(_0x2bb4e7,null));};exports[_0x4cc7('0x24')]=function(_0xc5b5df,_0x3d3b5c){return db['Automation']['find']({'where':{'id':_0xc5b5df[_0x4cc7('0x49')]['id']}})[_0x4cc7('0x23')](handleEntityNotFound(_0x3d3b5c,null))[_0x4cc7('0x23')](removeEntity(_0x3d3b5c,null))[_0x4cc7('0x43')](handleError(_0x3d3b5c,null));};exports[_0x4cc7('0x4a')]=function(_0x2f99b3,_0x2c0457,_0x22b02d){return db['Condition'][_0x4cc7('0x45')]({'where':{'id':_0x2f99b3[_0x4cc7('0x49')]['id']}})[_0x4cc7('0x23')](handleEntityNotFound(_0x2c0457,null))[_0x4cc7('0x23')](function(_0x23551f){if(_0x23551f){return _0x23551f[_0x4cc7('0x4a')](_0x2f99b3['body'][_0x4cc7('0x4b')],_[_0x4cc7('0x4c')](_0x2f99b3[_0x4cc7('0x47')],[_0x4cc7('0x4b'),'id'])||{});}})[_0x4cc7('0x23')](respondWithResult(_0x2c0457,null))['catch'](handleError(_0x2c0457,null));};exports['getConditions']=function(_0x405c7d,_0x25c3e9,_0x20f203){var _0x459f7a={};var _0x3585fc={};var _0x56f2f2;var _0x2d02f6;return db['Automation']['findOne']({'where':{'id':_0x405c7d[_0x4cc7('0x49')]['id']}})[_0x4cc7('0x23')](handleEntityNotFound(_0x25c3e9,null))[_0x4cc7('0x23')](function(_0x41da3b){if(_0x41da3b){_0x56f2f2=_0x41da3b;_0x3585fc[_0x4cc7('0x2e')]=_[_0x4cc7('0x2a')](db['Condition']['rawAttributes']);_0x3585fc['query']=_['keys'](_0x405c7d['query']);_0x3585fc[_0x4cc7('0x2c')]=_['intersection'](_0x3585fc['model'],_0x3585fc[_0x4cc7('0x2b')]);_0x459f7a['attributes']=_[_0x4cc7('0x2d')](_0x3585fc['model'],qs[_0x4cc7('0x2f')](_0x405c7d['query']['fields']));_0x459f7a[_0x4cc7('0x30')]=_0x459f7a[_0x4cc7('0x30')][_0x4cc7('0x31')]?_0x459f7a[_0x4cc7('0x30')]:_0x3585fc[_0x4cc7('0x2e')];_0x459f7a['order']=qs[_0x4cc7('0x35')](_0x405c7d[_0x4cc7('0x2b')][_0x4cc7('0x35')]);_0x459f7a[_0x4cc7('0x38')]=qs[_0x4cc7('0x2c')](_['pick'](_0x405c7d['query'],_0x3585fc[_0x4cc7('0x2c')]));if(_0x405c7d['query'][_0x4cc7('0x37')]){_0x459f7a[_0x4cc7('0x38')]=_[_0x4cc7('0x39')](_0x459f7a['where'],{'$or':_[_0x4cc7('0x4d')](_0x459f7a[_0x4cc7('0x30')],function(_0x58a18a){var _0x46bd21={};_0x46bd21[_0x58a18a]={'$like':'%'+_0x405c7d[_0x4cc7('0x2b')][_0x4cc7('0x37')]+'%'};return _0x46bd21;})});}_0x459f7a=_[_0x4cc7('0x39')]({},_0x459f7a,_0x405c7d[_0x4cc7('0x3d')]);return _0x56f2f2[_0x4cc7('0x4e')](_0x459f7a);}})[_0x4cc7('0x23')](function(_0x18a421){if(_0x18a421){_0x2d02f6=_0x18a421[_0x4cc7('0x31')];if(!_0x405c7d[_0x4cc7('0x2b')][_0x4cc7('0x32')](_0x4cc7('0x33'))){_0x459f7a[_0x4cc7('0x1e')]=qs[_0x4cc7('0x1e')](_0x405c7d[_0x4cc7('0x2b')][_0x4cc7('0x1e')]);_0x459f7a[_0x4cc7('0x1d')]=qs['offset'](_0x405c7d[_0x4cc7('0x2b')][_0x4cc7('0x1d')]);}return _0x56f2f2['getConditions'](_0x459f7a);}})[_0x4cc7('0x23')](function(_0x3001c9){if(_0x3001c9){return _0x3001c9?{'count':_0x2d02f6,'rows':_0x3001c9}:null;}})['then'](respondWithResult(_0x25c3e9,null))['catch'](handleError(_0x25c3e9,null));};exports['addActions']=function(_0x1d8814,_0x47b1e4,_0x3965d5){return db[_0x4cc7('0x4f')][_0x4cc7('0x45')]({'where':{'id':_0x1d8814[_0x4cc7('0x49')]['id']}})[_0x4cc7('0x23')](handleEntityNotFound(_0x47b1e4,null))[_0x4cc7('0x23')](function(_0x4f22cc){if(_0x4f22cc){return _0x4f22cc[_0x4cc7('0x50')](_0x1d8814[_0x4cc7('0x47')][_0x4cc7('0x4b')],_[_0x4cc7('0x4c')](_0x1d8814[_0x4cc7('0x47')],['ids','id'])||{});}})[_0x4cc7('0x23')](respondWithResult(_0x47b1e4,null))['catch'](handleError(_0x47b1e4,null));};exports[_0x4cc7('0x51')]=function(_0x2a450a,_0x5daf0,_0x1d2354){var _0x22b7cf={};var _0x176597={};var _0x564dfc;var _0x598d6c;return db[_0x4cc7('0x28')][_0x4cc7('0x52')]({'where':{'id':_0x2a450a[_0x4cc7('0x49')]['id']}})[_0x4cc7('0x23')](handleEntityNotFound(_0x5daf0,null))[_0x4cc7('0x23')](function(_0x4148a0){if(_0x4148a0){_0x564dfc=_0x4148a0;_0x176597[_0x4cc7('0x2e')]=_[_0x4cc7('0x2a')](db['Action'][_0x4cc7('0x29')]);_0x176597[_0x4cc7('0x2b')]=_[_0x4cc7('0x2a')](_0x2a450a[_0x4cc7('0x2b')]);_0x176597[_0x4cc7('0x2c')]=_[_0x4cc7('0x2d')](_0x176597[_0x4cc7('0x2e')],_0x176597[_0x4cc7('0x2b')]);_0x22b7cf[_0x4cc7('0x30')]=_[_0x4cc7('0x2d')](_0x176597[_0x4cc7('0x2e')],qs['fields'](_0x2a450a[_0x4cc7('0x2b')][_0x4cc7('0x2f')]));_0x22b7cf[_0x4cc7('0x30')]=_0x22b7cf[_0x4cc7('0x30')][_0x4cc7('0x31')]?_0x22b7cf[_0x4cc7('0x30')]:_0x176597[_0x4cc7('0x2e')];_0x22b7cf[_0x4cc7('0x34')]=qs['sort'](_0x2a450a[_0x4cc7('0x2b')]['sort']);_0x22b7cf['where']=qs[_0x4cc7('0x2c')](_[_0x4cc7('0x36')](_0x2a450a[_0x4cc7('0x2b')],_0x176597['filters']));if(_0x2a450a[_0x4cc7('0x2b')][_0x4cc7('0x37')]){_0x22b7cf[_0x4cc7('0x38')]=_[_0x4cc7('0x39')](_0x22b7cf[_0x4cc7('0x38')],{'$or':_[_0x4cc7('0x4d')](_0x22b7cf[_0x4cc7('0x30')],function(_0x4638a7){var _0x5c1d24={};_0x5c1d24[_0x4638a7]={'$like':'%'+_0x2a450a[_0x4cc7('0x2b')][_0x4cc7('0x37')]+'%'};return _0x5c1d24;})});}_0x22b7cf=_['merge']({},_0x22b7cf,_0x2a450a[_0x4cc7('0x3d')]);return _0x564dfc[_0x4cc7('0x51')](_0x22b7cf);}})['then'](function(_0x5ebc42){if(_0x5ebc42){_0x598d6c=_0x5ebc42[_0x4cc7('0x31')];if(!_0x2a450a[_0x4cc7('0x2b')][_0x4cc7('0x32')](_0x4cc7('0x33'))){_0x22b7cf[_0x4cc7('0x1e')]=qs[_0x4cc7('0x1e')](_0x2a450a[_0x4cc7('0x2b')]['limit']);_0x22b7cf[_0x4cc7('0x1d')]=qs['offset'](_0x2a450a['query'][_0x4cc7('0x1d')]);}return _0x564dfc[_0x4cc7('0x51')](_0x22b7cf);}})[_0x4cc7('0x23')](function(_0x50a54c){if(_0x50a54c){return _0x50a54c?{'count':_0x598d6c,'rows':_0x50a54c}:null;}})[_0x4cc7('0x23')](respondWithResult(_0x5daf0,null))[_0x4cc7('0x43')](handleError(_0x5daf0,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 6c5e46a..377ca77 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 _0x9fc3=['../../config/logger','api','moment','bluebird','request-promise','./automation.attributes','exports','define','Automation','lodash'];(function(_0x531ec4,_0x203380){var _0x43fd6f=function(_0x350608){while(--_0x350608){_0x531ec4['push'](_0x531ec4['shift']());}};_0x43fd6f(++_0x203380);}(_0x9fc3,0x199));var _0x39fc=function(_0x4cc409,_0x49d302){_0x4cc409=_0x4cc409-0x0;var _0x5d72a1=_0x9fc3[_0x4cc409];return _0x5d72a1;};'use strict';var _=require(_0x39fc('0x0'));var util=require('util');var logger=require(_0x39fc('0x1'))(_0x39fc('0x2'));var moment=require(_0x39fc('0x3'));var BPromise=require(_0x39fc('0x4'));var rp=require(_0x39fc('0x5'));var attributes=require(_0x39fc('0x6'));module[_0x39fc('0x7')]=function(_0x547b14,_0x3a8ac7){return _0x547b14[_0x39fc('0x8')](_0x39fc('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6cd=['define','util','../../config/logger','api','moment','bluebird','request-promise','./automation.attributes','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa6cd,0x64));var _0xda6c=function(_0x1d33a2,_0x50aa75){_0x1d33a2=_0x1d33a2-0x0;var _0x1870ee=_0xa6cd[_0x1d33a2];return _0x1870ee;};'use strict';var _=require('lodash');var util=require(_0xda6c('0x0'));var logger=require(_0xda6c('0x1'))(_0xda6c('0x2'));var moment=require(_0xda6c('0x3'));var BPromise=require(_0xda6c('0x4'));var rp=require(_0xda6c('0x5'));var attributes=require(_0xda6c('0x6'));module[_0xda6c('0x7')]=function(_0x421f13,_0x1701b8){return _0x421f13[_0xda6c('0x8')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index e3a742c..915ef42 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 _0x8c97=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x547c89,_0x17d597){var _0x186d5a=function(_0x2cba70){while(--_0x2cba70){_0x547c89['push'](_0x547c89['shift']());}};_0x186d5a(++_0x17d597);}(_0x8c97,0x194));var _0x78c9=function(_0x1d32ea,_0x310a61){_0x1d32ea=_0x1d32ea-0x0;var _0x2a6176=_0x8c97[_0x1d32ea];return _0x2a6176;};'use strict';var _=require(_0x78c9('0x0'));var util=require(_0x78c9('0x1'));var moment=require(_0x78c9('0x2'));var BPromise=require(_0x78c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78c9('0x4'));var db=require(_0x78c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x78c9('0x6'))(_0x78c9('0x7'));var config=require(_0x78c9('0x8'));var jayson=require(_0x78c9('0x9'));var client=jayson[_0x78c9('0xa')][_0x78c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x211916,_0x20a61e,_0x266713){return new BPromise(function(_0x5cb610,_0x2e355a){return client[_0x78c9('0xc')](_0x211916,_0x266713)[_0x78c9('0xd')](function(_0x5b1e02){logger[_0x78c9('0xe')](_0x78c9('0xf'),_0x20a61e,_0x78c9('0x10'));logger[_0x78c9('0x11')](_0x78c9('0x12'),_0x20a61e,_0x78c9('0x10'),JSON[_0x78c9('0x13')](_0x5b1e02));if(_0x5b1e02['error']){if(_0x5b1e02[_0x78c9('0x14')][_0x78c9('0x15')]===0x1f4){logger[_0x78c9('0x14')]('Automation,\x20%s,\x20%s',_0x20a61e,_0x5b1e02[_0x78c9('0x14')]['message']);return _0x2e355a(_0x5b1e02['error'][_0x78c9('0x16')]);}logger[_0x78c9('0x14')]('Automation,\x20%s,\x20%s',_0x20a61e,_0x5b1e02['error'][_0x78c9('0x16')]);return _0x5cb610(_0x5b1e02[_0x78c9('0x14')][_0x78c9('0x16')]);}else{logger[_0x78c9('0xe')](_0x78c9('0xf'),_0x20a61e,_0x78c9('0x10'));_0x5cb610(_0x5b1e02['result'][_0x78c9('0x16')]);}})[_0x78c9('0x17')](function(_0x1ec89e){logger[_0x78c9('0x14')](_0x78c9('0xf'),_0x20a61e,_0x1ec89e);_0x2e355a(_0x1ec89e);});});} \ No newline at end of file +var _0x2eba=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2eba,0xc7));var _0xa2eb=function(_0x50d5fd,_0x5d6929){_0x50d5fd=_0x50d5fd-0x0;var _0xb3f946=_0x2eba[_0x50d5fd];return _0xb3f946;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var moment=require(_0xa2eb('0x1'));var BPromise=require(_0xa2eb('0x2'));var rs=require(_0xa2eb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa2eb('0x4'));var logger=require('../../config/logger')(_0xa2eb('0x5'));var config=require(_0xa2eb('0x6'));var jayson=require(_0xa2eb('0x7'));var client=jayson[_0xa2eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545db3,_0x56b33a,_0x4ed534){return new BPromise(function(_0x550a3c,_0x56408f){return client[_0xa2eb('0x9')](_0x545db3,_0x4ed534)[_0xa2eb('0xa')](function(_0x5480a1){logger['info'](_0xa2eb('0xb'),_0x56b33a,_0xa2eb('0xc'));logger[_0xa2eb('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x56b33a,_0xa2eb('0xc'),JSON[_0xa2eb('0xe')](_0x5480a1));if(_0x5480a1['error']){if(_0x5480a1[_0xa2eb('0xf')]['code']===0x1f4){logger[_0xa2eb('0xf')](_0xa2eb('0xb'),_0x56b33a,_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);return _0x56408f(_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);}logger['error'](_0xa2eb('0xb'),_0x56b33a,_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);return _0x550a3c(_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);}else{logger[_0xa2eb('0x11')](_0xa2eb('0xb'),_0x56b33a,_0xa2eb('0xc'));_0x550a3c(_0x5480a1[_0xa2eb('0x12')][_0xa2eb('0x10')]);}})[_0xa2eb('0x13')](function(_0x3a02d5){logger['error']('Automation,\x20%s,\x20%s',_0x56b33a,_0x3a02d5);_0x56408f(_0x3a02d5);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5feb95f..3cd2055 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 _0xe0ae=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','getConditions','getActions','post','create','/:id/conditions','addConditions','/:id/actions','addActions','update'];(function(_0x5bb1ad,_0x4641a4){var _0x3abbce=function(_0x223ed3){while(--_0x223ed3){_0x5bb1ad['push'](_0x5bb1ad['shift']());}};_0x3abbce(++_0x4641a4);}(_0xe0ae,0x1a1));var _0xee0a=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0xe0ae[_0x2300f2];return _0x6bd508;};'use strict';var multer=require(_0xee0a('0x0'));var util=require('util');var path=require(_0xee0a('0x1'));var timeout=require('connect-timeout');var express=require(_0xee0a('0x2'));var router=express[_0xee0a('0x3')]();var auth=require(_0xee0a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xee0a('0x5'));var controller=require('./automation.controller');router[_0xee0a('0x6')]('/',auth['isAuthenticated'](),controller[_0xee0a('0x7')]);router[_0xee0a('0x6')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller[_0xee0a('0xa')]);router[_0xee0a('0x6')]('/:id/conditions',auth[_0xee0a('0x9')](),controller[_0xee0a('0xb')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xee0a('0xc')]);router[_0xee0a('0xd')]('/',auth[_0xee0a('0x9')](),controller[_0xee0a('0xe')]);router[_0xee0a('0xd')](_0xee0a('0xf'),auth[_0xee0a('0x9')](),controller[_0xee0a('0x10')]);router[_0xee0a('0xd')](_0xee0a('0x11'),auth['isAuthenticated'](),controller[_0xee0a('0x12')]);router['put'](_0xee0a('0x8'),auth['isAuthenticated'](),controller[_0xee0a('0x13')]);router[_0xee0a('0x14')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller[_0xee0a('0x15')]);module[_0xee0a('0x16')]=router; \ No newline at end of file +var _0xd4ad=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/conditions','getConditions','/:id/actions','getActions','post','addActions','put','/:id','update','delete','destroy'];(function(_0xb027e2,_0x44fd80){var _0x426844=function(_0x137339){while(--_0x137339){_0xb027e2['push'](_0xb027e2['shift']());}};_0x426844(++_0x44fd80);}(_0xd4ad,0x1e4));var _0xdd4a=function(_0x52a19b,_0x2eaaf2){_0x52a19b=_0x52a19b-0x0;var _0x534426=_0xd4ad[_0x52a19b];return _0x534426;};'use strict';var multer=require(_0xdd4a('0x0'));var util=require(_0xdd4a('0x1'));var path=require(_0xdd4a('0x2'));var timeout=require(_0xdd4a('0x3'));var express=require(_0xdd4a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdd4a('0x5'));var config=require(_0xdd4a('0x6'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xdd4a('0x7')]('/:id',auth[_0xdd4a('0x8')](),controller['show']);router[_0xdd4a('0x7')](_0xdd4a('0x9'),auth[_0xdd4a('0x8')](),controller[_0xdd4a('0xa')]);router[_0xdd4a('0x7')](_0xdd4a('0xb'),auth['isAuthenticated'](),controller[_0xdd4a('0xc')]);router[_0xdd4a('0xd')]('/',auth[_0xdd4a('0x8')](),controller['create']);router['post'](_0xdd4a('0x9'),auth[_0xdd4a('0x8')](),controller['addConditions']);router[_0xdd4a('0xd')]('/:id/actions',auth[_0xdd4a('0x8')](),controller[_0xdd4a('0xe')]);router[_0xdd4a('0xf')](_0xdd4a('0x10'),auth[_0xdd4a('0x8')](),controller[_0xdd4a('0x11')]);router[_0xdd4a('0x12')]('/:id',auth[_0xdd4a('0x8')](),controller[_0xdd4a('0x13')]);module[_0xdd4a('0x14')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 7b92eb6..6daa5cd 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 _0x1ec8=['ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x9db795,_0x49b59e){var _0x38413a=function(_0x5d9580){while(--_0x5d9580){_0x9db795['push'](_0x9db795['shift']());}};_0x38413a(++_0x49b59e);}(_0x1ec8,0x1d4));var _0x81ec=function(_0x47bfb8,_0xd4b559){_0x47bfb8=_0x47bfb8-0x0;var _0x4f9f0d=_0x1ec8[_0x47bfb8];return _0x4f9f0d;};'use strict';var Sequelize=require(_0x81ec('0x0'));module[_0x81ec('0x1')]={'name':{'type':Sequelize[_0x81ec('0x2')],'unique':_0x81ec('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x81ec('0x4')),'allowNull':![],'defaultValue':_0x81ec('0x4')},'description':{'type':Sequelize[_0x81ec('0x2')]},'active':{'type':Sequelize[_0x81ec('0x5')],'defaultValue':0x0,'comment':_0x81ec('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x81ec('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x81ec('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x81ec('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x81ec('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x81ec('0x9')](0x3)[_0x81ec('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81ec('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x81ec('0x9')](0x3)[_0x81ec('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81ec('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x81ec('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81ec('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81ec('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x81ec('0x9')](0x5)[_0x81ec('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x81ec('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81ec('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x81ec('0x9')](0x3)[_0x81ec('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x81ec('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x81ec('0x2')],'defaultValue':_0x81ec('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x81ec('0x10')](_0x81ec('0x11'),'never',_0x81ec('0x12')),'defaultValue':_0x81ec('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x81ec('0x9')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x81ec('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x81ec('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x81ec('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x81ec('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x81ec('0x9')](0x9)[_0x81ec('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81ec('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x81ec('0x9')](0x9)[_0x81ec('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x81ec('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x81ec('0x9')](0x9)[_0x81ec('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x81ec('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x81ec('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x81ec('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x81ec('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x81ec('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81ec('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x81ec('0x10')](_0x81ec('0x1b'),_0x81ec('0x1c')),'defaultValue':_0x81ec('0x1b')},'dialPrefix':{'type':Sequelize[_0x81ec('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x81ec('0x9')](0x3)[_0x81ec('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81ec('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81ec('0x1e')}}; \ No newline at end of file +var _0x543d=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN'];(function(_0x5eefee,_0x8ed085){var _0x99f559=function(_0xc06bc5){while(--_0xc06bc5){_0x5eefee['push'](_0x5eefee['shift']());}};_0x99f559(++_0x8ed085);}(_0x543d,0x8f));var _0xd543=function(_0x511d17,_0x9ad3ba){_0x511d17=_0x511d17-0x0;var _0x4f42e3=_0x543d[_0x511d17];return _0x4f42e3;};'use strict';var Sequelize=require(_0xd543('0x0'));module[_0xd543('0x1')]={'name':{'type':Sequelize[_0xd543('0x2')],'unique':_0xd543('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd543('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xd543('0x5')},'description':{'type':Sequelize[_0xd543('0x2')]},'active':{'type':Sequelize[_0xd543('0x6')],'defaultValue':0x0,'comment':_0xd543('0x7')},'limitCalls':{'type':Sequelize[_0xd543('0x8')](0x4)[_0xd543('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd543('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd543('0x8')](0x3)[_0xd543('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd543('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd543('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd543('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd543('0x8')](0x5)[_0xd543('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd543('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xd543('0x8')](0x3)[_0xd543('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd543('0xe')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd543('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd543('0x8')](0x3)[_0xd543('0x9')],'defaultValue':0x3,'comment':_0xd543('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd543('0x8')](0x5)[_0xd543('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd543('0x11')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd543('0x8')](0x3)[_0xd543('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd543('0x12')},'dialTimezone':{'type':Sequelize[_0xd543('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd543('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xd543('0x4')](_0xd543('0x13'),_0xd543('0x14'),_0xd543('0x15')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd543('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd543('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd543('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xd543('0x8')](0x9)[_0xd543('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd543('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xd543('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd543('0x8')](0x9)[_0xd543('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd543('0x8')](0x9)[_0xd543('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd543('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd543('0x8')](0x9)[_0xd543('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd543('0x8')](0x5)[_0xd543('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd543('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd543('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd543('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xd543('0x1b'),_0xd543('0x1c')),'defaultValue':_0xd543('0x1b')},'dialPrefix':{'type':Sequelize[_0xd543('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd543('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd543('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xd543('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 093d879..86263e6 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 _0xb899=['getHoppers','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','findAll','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','into','push','removeLists','CmList','addBlackLists','spread','cm_hopper_black','sequelize','all','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','Campaign','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','filters','pick','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','show','params','create','body','user','role','UserProfileSection','autoAssociation','catch','error','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb899,0x136));var _0x9b89=function(_0x1eb8bc,_0x222d2b){_0x1eb8bc=_0x1eb8bc-0x0;var _0x1ea9ad=_0xb899[_0x1eb8bc];return _0x1ea9ad;};'use strict';var pdf=require(_0x9b89('0x0'));var emlformat=require(_0x9b89('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9b89('0x2'));var jsonpatch=require(_0x9b89('0x3'));var rp=require(_0x9b89('0x4'));var moment=require(_0x9b89('0x5'));var BPromise=require(_0x9b89('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9b89('0x7'));var sox=require(_0x9b89('0x8'));var csv=require(_0x9b89('0x9'));var ejs=require(_0x9b89('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9b89('0xb'));var crypto=require(_0x9b89('0xc'));var jsforce=require(_0x9b89('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9b89('0x9'));var querystring=require('querystring');var Papa=require(_0x9b89('0xe'));var authService=require(_0x9b89('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x9b89('0x10'));var logger=require(_0x9b89('0x11'))(_0x9b89('0x12'));var utils=require(_0x9b89('0x13'));var config=require(_0x9b89('0x14'));var db=require(_0x9b89('0x15'))['db'];function respondWithStatusCode(_0x18b1e4,_0x41dc1c){_0x41dc1c=_0x41dc1c||0xcc;return function(_0x2382a8){if(_0x2382a8){return _0x18b1e4[_0x9b89('0x16')](_0x41dc1c);}return _0x18b1e4[_0x9b89('0x17')](_0x41dc1c)['end']();};}function respondWithResult(_0x3c382f,_0x5db3f8){_0x5db3f8=_0x5db3f8||0xc8;return function(_0x332fe4){if(_0x332fe4){return _0x3c382f[_0x9b89('0x17')](_0x5db3f8)[_0x9b89('0x18')](_0x332fe4);}};}function respondWithFilteredResult(_0x580383,_0x477252){return function(_0x4c39d4){if(_0x4c39d4){var _0xa74340=_0x4c39d4[_0x9b89('0x19')],_0x36a0b1=_0x477252['offset'],_0x6d7bd2=_0x477252['offset']+_0x477252[_0x9b89('0x1a')],_0x126f54;if(_0x6d7bd2>=_0xa74340){_0x6d7bd2=_0xa74340;_0x126f54=0xc8;}else{_0x126f54=0xce;}_0x580383[_0x9b89('0x17')](_0x126f54);return _0x580383[_0x9b89('0x1b')](_0x9b89('0x1c'),_0x36a0b1+'-'+_0x6d7bd2+'/'+_0xa74340)[_0x9b89('0x18')](_0x4c39d4);}return null;};}function patchUpdates(_0x3c02fd){return function(_0xc4aa0d){try{jsonpatch['apply'](_0xc4aa0d,_0x3c02fd,!![]);}catch(_0x16447d){return BPromise[_0x9b89('0x1d')](_0x16447d);}return _0xc4aa0d[_0x9b89('0x1e')]();};}function saveUpdates(_0x4be97d,_0x114be4){return function(_0xd7468b){if(_0xd7468b){return _0xd7468b[_0x9b89('0x1f')](_0x4be97d)[_0x9b89('0x20')](function(_0x28b376){return _0x28b376;});}return null;};}function removeEntity(_0xde7fa7,_0x3f45ce){return function(_0xf9ace8){if(_0xf9ace8){return _0xf9ace8[_0x9b89('0x21')]()[_0x9b89('0x20')](function(){var _0x35d8dc=_0xf9ace8[_0x9b89('0x22')]({'plain':!![]});var _0x407cdf=_0x9b89('0x23');return db[_0x9b89('0x24')]['destroy']({'where':{'type':_0x407cdf,'resourceId':_0x35d8dc['id']}})['then'](function(){return _0xf9ace8;});})[_0x9b89('0x20')](function(){_0xde7fa7[_0x9b89('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f236,_0x46d110){return function(_0x8c92f5){if(!_0x8c92f5){_0x47f236[_0x9b89('0x16')](0x194);}return _0x8c92f5;};}function handleError(_0x39c4af,_0x3f5a81){_0x3f5a81=_0x3f5a81||0x1f4;return function(_0x3aaa96){logger['error'](_0x3aaa96[_0x9b89('0x25')]);if(_0x3aaa96[_0x9b89('0x26')]){delete _0x3aaa96[_0x9b89('0x26')];}_0x39c4af['status'](_0x3f5a81)[_0x9b89('0x27')](_0x3aaa96);};}exports[_0x9b89('0x28')]=function(_0x1752da,_0x3baa74){var _0x319901={},_0x281f85={},_0x1b0cd0={'count':0x0,'rows':[]};var _0xe6728b=db[_0x9b89('0x29')][_0x9b89('0x2a')];_0x281f85[_0x9b89('0x2b')]=_[_0x9b89('0x2c')](_0xe6728b);_0x281f85[_0x9b89('0x2d')]=_[_0x9b89('0x2c')](_0x1752da[_0x9b89('0x2d')]);_0x281f85['filters']=_[_0x9b89('0x2e')](_0x281f85[_0x9b89('0x2b')],_0x281f85['query']);_0x319901[_0x9b89('0x2f')]=_[_0x9b89('0x2e')](_0x281f85['model'],qs[_0x9b89('0x30')](_0x1752da[_0x9b89('0x2d')][_0x9b89('0x30')]));_0x319901[_0x9b89('0x2f')]=_0x319901[_0x9b89('0x2f')][_0x9b89('0x31')]?_0x319901[_0x9b89('0x2f')]:_0x281f85[_0x9b89('0x2b')];if(!_0x1752da[_0x9b89('0x2d')][_0x9b89('0x32')]('nolimit')){_0x319901[_0x9b89('0x1a')]=qs[_0x9b89('0x1a')](_0x1752da['query']['limit']);_0x319901['offset']=qs['offset'](_0x1752da[_0x9b89('0x2d')][_0x9b89('0x33')]);}_0x319901[_0x9b89('0x34')]=qs[_0x9b89('0x35')](_0x1752da[_0x9b89('0x2d')][_0x9b89('0x35')]);_0x319901['where']=qs[_0x9b89('0x36')](_[_0x9b89('0x37')](_0x1752da[_0x9b89('0x2d')],_0x281f85['filters']));if(_0x1752da[_0x9b89('0x2d')][_0x9b89('0x38')]){_0x319901['where']=_[_0x9b89('0x39')](_0x319901[_0x9b89('0x3a')],{'$or':_[_0x9b89('0x3b')](_0xe6728b,function(_0x5436d3){if(_0x5436d3[_0x9b89('0x3c')][_0x9b89('0x3d')]!==_0x9b89('0x3e')){var _0x60bd79={};_0x60bd79[_0x5436d3['field']]={'$like':'%'+_0x1752da['query']['filter']+'%'};return _0x60bd79;}})});}_0x319901=_[_0x9b89('0x39')]({},_0x319901,_0x1752da[_0x9b89('0x3f')]);var _0x4c99e8={'where':_0x319901['where']};return db[_0x9b89('0x29')][_0x9b89('0x19')](_0x4c99e8)[_0x9b89('0x20')](function(_0x1f78b6){_0x1b0cd0[_0x9b89('0x19')]=_0x1f78b6;if(_0x1752da['query'][_0x9b89('0x40')]){_0x319901[_0x9b89('0x41')]=[{'all':!![]}];}return db[_0x9b89('0x29')]['findAll'](_0x319901);})[_0x9b89('0x20')](function(_0x5f06f9){_0x1b0cd0[_0x9b89('0x42')]=_0x5f06f9;return _0x1b0cd0;})[_0x9b89('0x20')](respondWithFilteredResult(_0x3baa74,_0x319901))['catch'](handleError(_0x3baa74,null));};exports[_0x9b89('0x43')]=function(_0x5d61c8,_0x44792c){var _0x841739={'raw':![],'where':{'id':_0x5d61c8[_0x9b89('0x44')]['id']}},_0x266d72={};_0x266d72[_0x9b89('0x2b')]=_['keys'](db[_0x9b89('0x29')][_0x9b89('0x2a')]);_0x266d72['query']=_['keys'](_0x5d61c8['query']);_0x266d72['filters']=_[_0x9b89('0x2e')](_0x266d72[_0x9b89('0x2b')],_0x266d72['query']);_0x841739['attributes']=_['intersection'](_0x266d72[_0x9b89('0x2b')],qs[_0x9b89('0x30')](_0x5d61c8[_0x9b89('0x2d')][_0x9b89('0x30')]));_0x841739[_0x9b89('0x2f')]=_0x841739[_0x9b89('0x2f')][_0x9b89('0x31')]?_0x841739[_0x9b89('0x2f')]:_0x266d72[_0x9b89('0x2b')];if(_0x5d61c8[_0x9b89('0x2d')]['includeAll']){_0x841739['include']=[{'all':!![]}];}_0x841739=_[_0x9b89('0x39')]({},_0x841739,_0x5d61c8[_0x9b89('0x3f')]);return db['Campaign']['find'](_0x841739)[_0x9b89('0x20')](handleEntityNotFound(_0x44792c,null))['then'](respondWithResult(_0x44792c,null))['catch'](handleError(_0x44792c,null));};exports[_0x9b89('0x45')]=function(_0x1065ce,_0x390b23){return db['Campaign'][_0x9b89('0x45')](_0x1065ce[_0x9b89('0x46')],{})[_0x9b89('0x20')](function(_0x7c157){var _0x1b9bba=_0x1065ce[_0x9b89('0x47')][_0x9b89('0x22')]({'plain':!![]});if(!_0x1b9bba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b9bba[_0x9b89('0x48')]==='user'){var _0x372416=_0x7c157[_0x9b89('0x22')]({'plain':!![]});var _0x189f72='IvrCampaigns';return db[_0x9b89('0x49')]['find']({'where':{'name':_0x189f72,'userProfileId':_0x1b9bba['userProfileId']},'raw':!![]})[_0x9b89('0x20')](function(_0x3fce60){if(_0x3fce60&&_0x3fce60[_0x9b89('0x4a')]===0x0){return db[_0x9b89('0x24')]['create']({'name':_0x372416['name'],'resourceId':_0x372416['id'],'type':_0x3fce60[_0x9b89('0x26')],'sectionId':_0x3fce60['id']},{})['then'](function(){return _0x7c157;});}else{return _0x7c157;}})[_0x9b89('0x4b')](function(_0x328cde){logger[_0x9b89('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x328cde);throw _0x328cde;});}return _0x7c157;})[_0x9b89('0x20')](respondWithResult(_0x390b23,0xc9))[_0x9b89('0x4b')](handleError(_0x390b23,null));};exports[_0x9b89('0x4d')]=function(_0x204e6d,_0x5cb84a){var _0x1f2971={'raw':![],'where':{'id':_0x204e6d[_0x9b89('0x44')]['id']}},_0xb0c5b2={};_0xb0c5b2[_0x9b89('0x2b')]=_['keys'](db['Campaign'][_0x9b89('0x2a')]);_0x1f2971['attributes']=_['intersection'](_0xb0c5b2['model'],qs[_0x9b89('0x30')](_0x204e6d[_0x9b89('0x2d')][_0x9b89('0x30')]));_0x1f2971[_0x9b89('0x2f')]=_0x1f2971['attributes'][_0x9b89('0x31')]?_0x1f2971[_0x9b89('0x2f')]:_0xb0c5b2[_0x9b89('0x2b')];if(_0x204e6d[_0x9b89('0x2d')][_0x9b89('0x40')]){_0x1f2971[_0x9b89('0x41')]=[{'all':!![]}];}_0x1f2971=_[_0x9b89('0x39')]({},_0x1f2971,_0x204e6d[_0x9b89('0x3f')]);return db[_0x9b89('0x29')][_0x9b89('0x4e')](_0x1f2971)[_0x9b89('0x20')](handleEntityNotFound(_0x5cb84a,null))['then'](function(_0xee12f1){if(_0xee12f1){var _0x42a10f=_0xee12f1[_0x9b89('0x22')]({'plain':!![]});_0x42a10f=qs[_0x9b89('0x4f')](_0x42a10f,['id',_0x9b89('0x50'),_0x9b89('0x51')]);_0x204e6d[_0x9b89('0x46')]=_['omit'](_0x204e6d[_0x9b89('0x46')],['id',_0x9b89('0x50'),_0x9b89('0x51')]);return db[_0x9b89('0x29')][_0x9b89('0x45')](_[_0x9b89('0x39')](_0x42a10f,_0x204e6d[_0x9b89('0x46')]),{'include':_0x204e6d[_0x9b89('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x9b89('0x20')](function(_0x4a831d){var _0x3161e5=_0x204e6d[_0x9b89('0x47')]['get']({'plain':!![]});if(!_0x3161e5)throw new Error(_0x9b89('0x52'));if(_0x3161e5[_0x9b89('0x48')]===_0x9b89('0x47')){var _0x496ba7=_0x4a831d[_0x9b89('0x22')]({'plain':!![]});var _0x8d5df6='IvrCampaigns';return db['UserProfileSection'][_0x9b89('0x4e')]({'where':{'name':_0x8d5df6,'userProfileId':_0x3161e5['userProfileId']},'raw':!![]})[_0x9b89('0x20')](function(_0x2d3724){if(_0x2d3724&&_0x2d3724['autoAssociation']===0x0){return db[_0x9b89('0x24')][_0x9b89('0x45')]({'name':_0x496ba7[_0x9b89('0x26')],'resourceId':_0x496ba7['id'],'type':_0x2d3724['name'],'sectionId':_0x2d3724['id']},{})[_0x9b89('0x20')](function(){return _0x4a831d;});}else{return _0x4a831d;}})[_0x9b89('0x4b')](function(_0x1a4aff){logger[_0x9b89('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a4aff);throw _0x1a4aff;});}return _0x4a831d;});}})[_0x9b89('0x20')](respondWithResult(_0x5cb84a,0xc9))[_0x9b89('0x4b')](handleError(_0x5cb84a,null));};exports[_0x9b89('0x1f')]=function(_0x147224,_0x574588){if(_0x147224[_0x9b89('0x46')]['id']){delete _0x147224[_0x9b89('0x46')]['id'];}return db[_0x9b89('0x29')][_0x9b89('0x4e')]({'where':{'id':_0x147224[_0x9b89('0x44')]['id']}})['then'](handleEntityNotFound(_0x574588,null))['then'](saveUpdates(_0x147224[_0x9b89('0x46')],null))[_0x9b89('0x20')](respondWithResult(_0x574588,null))[_0x9b89('0x4b')](handleError(_0x574588,null));};exports[_0x9b89('0x21')]=function(_0x430a51,_0x37caff){return db[_0x9b89('0x29')][_0x9b89('0x4e')]({'where':{'id':_0x430a51[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x37caff,null))[_0x9b89('0x20')](removeEntity(_0x37caff,null))[_0x9b89('0x4b')](handleError(_0x37caff,null));};exports[_0x9b89('0x53')]=function(_0x21a7fa,_0x3c9e76,_0x461b24){var _0xaead3f={'raw':!![],'where':{}};var _0x470a99={};var _0x4a968b={'count':0x0,'rows':[]};return db[_0x9b89('0x29')]['findOne']({'where':{'id':_0x21a7fa[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x3c9e76,null))[_0x9b89('0x20')](function(_0x41ca33){if(_0x41ca33){_0x470a99[_0x9b89('0x2b')]=_['keys'](db[_0x9b89('0x54')][_0x9b89('0x2a')]);_0x470a99[_0x9b89('0x2d')]=_['keys'](_0x21a7fa['query']);_0x470a99['filters']=_[_0x9b89('0x2e')](_0x470a99[_0x9b89('0x2b')],_0x470a99[_0x9b89('0x2d')]);_0xaead3f[_0x9b89('0x2f')]=_['intersection'](_0x470a99[_0x9b89('0x2b')],qs[_0x9b89('0x30')](_0x21a7fa[_0x9b89('0x2d')]['fields']));_0xaead3f['attributes']=_0xaead3f[_0x9b89('0x2f')]['length']?_0xaead3f[_0x9b89('0x2f')]:_0x470a99[_0x9b89('0x2b')];if(!_0x21a7fa[_0x9b89('0x2d')][_0x9b89('0x32')](_0x9b89('0x55'))){_0xaead3f[_0x9b89('0x1a')]=qs[_0x9b89('0x1a')](_0x21a7fa[_0x9b89('0x2d')][_0x9b89('0x1a')]);_0xaead3f[_0x9b89('0x33')]=qs[_0x9b89('0x33')](_0x21a7fa['query'][_0x9b89('0x33')]);}_0xaead3f[_0x9b89('0x34')]=qs[_0x9b89('0x35')](_0x21a7fa['query']['sort']);_0xaead3f['where']=qs[_0x9b89('0x36')](_[_0x9b89('0x37')](_0x21a7fa[_0x9b89('0x2d')],_0x470a99[_0x9b89('0x36')]));_0xaead3f[_0x9b89('0x3a')][_0x9b89('0x56')]=_0x41ca33['id'];if(_0x21a7fa[_0x9b89('0x2d')][_0x9b89('0x38')]){_0xaead3f['where']=_[_0x9b89('0x39')](_0xaead3f[_0x9b89('0x3a')],{'$or':_['map'](_0xaead3f[_0x9b89('0x2f')],function(_0x52294a){var _0x168a25={};_0x168a25[_0x52294a]={'$like':'%'+_0x21a7fa[_0x9b89('0x2d')][_0x9b89('0x38')]+'%'};return _0x168a25;})});}_0xaead3f=_[_0x9b89('0x39')]({},_0xaead3f,_0x21a7fa[_0x9b89('0x3f')]);return db[_0x9b89('0x54')][_0x9b89('0x19')]({'where':_0xaead3f[_0x9b89('0x3a')]})[_0x9b89('0x20')](function(_0x870109){_0x4a968b['count']=_0x870109;if(_0x21a7fa['query'][_0x9b89('0x40')]){_0xaead3f[_0x9b89('0x41')]=[{'all':!![]}];}return db[_0x9b89('0x54')]['findAll'](_0xaead3f);})[_0x9b89('0x20')](function(_0x4b49b0){_0x4a968b['rows']=_0x4b49b0;return _0x4a968b;});}})[_0x9b89('0x20')](respondWithFilteredResult(_0x3c9e76,_0xaead3f))['catch'](handleError(_0x3c9e76,null));};exports[_0x9b89('0x57')]=function(_0x1f4f69,_0x45783f,_0x1ef0a9){var _0x415979={'raw':!![],'where':{}};var _0x58fe80={};var _0xdffa06={'count':0x0,'rows':[]};return db[_0x9b89('0x29')]['findOne']({'where':{'id':_0x1f4f69[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x45783f,null))[_0x9b89('0x20')](function(_0x217536){if(_0x217536){_0x58fe80[_0x9b89('0x2b')]=_[_0x9b89('0x2c')](db[_0x9b89('0x58')][_0x9b89('0x2a')]);_0x58fe80[_0x9b89('0x2d')]=_[_0x9b89('0x2c')](_0x1f4f69[_0x9b89('0x2d')]);_0x58fe80[_0x9b89('0x36')]=_[_0x9b89('0x2e')](_0x58fe80[_0x9b89('0x2b')],_0x58fe80[_0x9b89('0x2d')]);_0x415979[_0x9b89('0x2f')]=_['intersection'](_0x58fe80['model'],qs[_0x9b89('0x30')](_0x1f4f69['query'][_0x9b89('0x30')]));_0x415979['attributes']=_0x415979[_0x9b89('0x2f')][_0x9b89('0x31')]?_0x415979['attributes']:_0x58fe80[_0x9b89('0x2b')];if(!_0x1f4f69['query'][_0x9b89('0x32')]('nolimit')){_0x415979[_0x9b89('0x1a')]=qs[_0x9b89('0x1a')](_0x1f4f69['query'][_0x9b89('0x1a')]);_0x415979[_0x9b89('0x33')]=qs['offset'](_0x1f4f69[_0x9b89('0x2d')]['offset']);}_0x415979[_0x9b89('0x34')]=qs[_0x9b89('0x35')](_0x1f4f69[_0x9b89('0x2d')]['sort']);_0x415979[_0x9b89('0x3a')]=qs[_0x9b89('0x36')](_[_0x9b89('0x37')](_0x1f4f69['query'],_0x58fe80[_0x9b89('0x36')]));_0x415979[_0x9b89('0x3a')][_0x9b89('0x56')]=_0x217536['id'];if(_0x1f4f69[_0x9b89('0x2d')][_0x9b89('0x38')]){_0x415979[_0x9b89('0x3a')]=_[_0x9b89('0x39')](_0x415979[_0x9b89('0x3a')],{'$or':_['map'](_0x415979[_0x9b89('0x2f')],function(_0x1b6def){var _0x23980f={};_0x23980f[_0x1b6def]={'$like':'%'+_0x1f4f69['query'][_0x9b89('0x38')]+'%'};return _0x23980f;})});}_0x415979=_['merge']({},_0x415979,_0x1f4f69[_0x9b89('0x3f')]);return db[_0x9b89('0x58')][_0x9b89('0x19')]({'where':_0x415979[_0x9b89('0x3a')]})[_0x9b89('0x20')](function(_0x1c6d11){_0xdffa06['count']=_0x1c6d11;if(_0x1f4f69[_0x9b89('0x2d')]['includeAll']){_0x415979[_0x9b89('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9b89('0x59')](_0x415979);})[_0x9b89('0x20')](function(_0x8e3335){_0xdffa06[_0x9b89('0x42')]=_0x8e3335;return _0xdffa06;});}})[_0x9b89('0x20')](respondWithFilteredResult(_0x45783f,_0x415979))['catch'](handleError(_0x45783f,null));};exports[_0x9b89('0x5a')]=function(_0x334fde,_0x36f9ad,_0x586ca2){var _0x5d9dbb={'raw':!![],'where':{}};var _0x299600={};var _0x17fb35={'count':0x0,'rows':[]};return db[_0x9b89('0x29')][_0x9b89('0x5b')]({'where':{'id':_0x334fde[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x36f9ad,null))[_0x9b89('0x20')](function(_0x484745){if(_0x484745){_0x299600[_0x9b89('0x2b')]=_[_0x9b89('0x2c')](db[_0x9b89('0x5c')]['rawAttributes']);_0x299600[_0x9b89('0x2d')]=_['keys'](_0x334fde[_0x9b89('0x2d')]);_0x299600['filters']=_[_0x9b89('0x2e')](_0x299600['model'],_0x299600[_0x9b89('0x2d')]);_0x5d9dbb[_0x9b89('0x2f')]=_[_0x9b89('0x2e')](_0x299600[_0x9b89('0x2b')],qs[_0x9b89('0x30')](_0x334fde[_0x9b89('0x2d')]['fields']));_0x5d9dbb[_0x9b89('0x2f')]=_0x5d9dbb[_0x9b89('0x2f')][_0x9b89('0x31')]?_0x5d9dbb[_0x9b89('0x2f')]:_0x299600[_0x9b89('0x2b')];if(!_0x334fde['query']['hasOwnProperty'](_0x9b89('0x55'))){_0x5d9dbb[_0x9b89('0x1a')]=qs[_0x9b89('0x1a')](_0x334fde[_0x9b89('0x2d')][_0x9b89('0x1a')]);_0x5d9dbb['offset']=qs[_0x9b89('0x33')](_0x334fde[_0x9b89('0x2d')]['offset']);}_0x5d9dbb[_0x9b89('0x34')]=qs[_0x9b89('0x35')](_0x334fde[_0x9b89('0x2d')][_0x9b89('0x35')]);_0x5d9dbb[_0x9b89('0x3a')]=qs[_0x9b89('0x36')](_[_0x9b89('0x37')](_0x334fde[_0x9b89('0x2d')],_0x299600[_0x9b89('0x36')]));_0x5d9dbb[_0x9b89('0x3a')][_0x9b89('0x56')]=_0x484745['id'];if(_0x334fde[_0x9b89('0x2d')][_0x9b89('0x38')]){_0x5d9dbb['where']=_['merge'](_0x5d9dbb[_0x9b89('0x3a')],{'$or':_['map'](_0x5d9dbb[_0x9b89('0x2f')],function(_0x298565){var _0x558707={};_0x558707[_0x298565]={'$like':'%'+_0x334fde[_0x9b89('0x2d')][_0x9b89('0x38')]+'%'};return _0x558707;})});}_0x5d9dbb=_['merge']({},_0x5d9dbb,_0x334fde[_0x9b89('0x3f')]);return db[_0x9b89('0x5c')][_0x9b89('0x19')]({'where':_0x5d9dbb['where']})[_0x9b89('0x20')](function(_0xabc0d7){_0x17fb35[_0x9b89('0x19')]=_0xabc0d7;if(_0x334fde[_0x9b89('0x2d')][_0x9b89('0x40')]){_0x5d9dbb[_0x9b89('0x41')]=[{'all':!![]}];}return db[_0x9b89('0x5c')]['findAll'](_0x5d9dbb);})['then'](function(_0x5135f3){_0x17fb35[_0x9b89('0x42')]=_0x5135f3;return _0x17fb35;});}})['then'](respondWithFilteredResult(_0x36f9ad,_0x5d9dbb))['catch'](handleError(_0x36f9ad,null));};exports[_0x9b89('0x5d')]=function(_0xbac577,_0xa41030,_0x444a33){var _0x1d4ef2={'raw':!![],'where':{}};var _0x2f3c8c={};var _0x3f2a0b={'count':0x0,'rows':[]};return db['Campaign'][_0x9b89('0x5b')]({'where':{'id':_0xbac577[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0xa41030,null))['then'](function(_0x5bfd69){if(_0x5bfd69){_0x2f3c8c[_0x9b89('0x2b')]=_[_0x9b89('0x2c')](db[_0x9b89('0x5e')][_0x9b89('0x2a')]);_0x2f3c8c['query']=_[_0x9b89('0x2c')](_0xbac577[_0x9b89('0x2d')]);_0x2f3c8c[_0x9b89('0x36')]=_[_0x9b89('0x2e')](_0x2f3c8c[_0x9b89('0x2b')],_0x2f3c8c[_0x9b89('0x2d')]);_0x1d4ef2[_0x9b89('0x2f')]=_[_0x9b89('0x2e')](_0x2f3c8c['model'],qs['fields'](_0xbac577[_0x9b89('0x2d')][_0x9b89('0x30')]));_0x1d4ef2['attributes']=_0x1d4ef2['attributes'][_0x9b89('0x31')]?_0x1d4ef2['attributes']:_0x2f3c8c['model'];if(!_0xbac577[_0x9b89('0x2d')][_0x9b89('0x32')](_0x9b89('0x55'))){_0x1d4ef2[_0x9b89('0x1a')]=qs[_0x9b89('0x1a')](_0xbac577[_0x9b89('0x2d')][_0x9b89('0x1a')]);_0x1d4ef2[_0x9b89('0x33')]=qs[_0x9b89('0x33')](_0xbac577[_0x9b89('0x2d')][_0x9b89('0x33')]);}_0x1d4ef2[_0x9b89('0x34')]=qs[_0x9b89('0x35')](_0xbac577[_0x9b89('0x2d')][_0x9b89('0x35')]);_0x1d4ef2[_0x9b89('0x3a')]=qs[_0x9b89('0x36')](_['pick'](_0xbac577[_0x9b89('0x2d')],_0x2f3c8c[_0x9b89('0x36')]));_0x1d4ef2['where'][_0x9b89('0x56')]=_0x5bfd69['id'];if(_0xbac577['query'][_0x9b89('0x38')]){_0x1d4ef2[_0x9b89('0x3a')]=_[_0x9b89('0x39')](_0x1d4ef2[_0x9b89('0x3a')],{'$or':_[_0x9b89('0x3b')](_0x1d4ef2['attributes'],function(_0x16f79b){var _0xd6b600={};_0xd6b600[_0x16f79b]={'$like':'%'+_0xbac577[_0x9b89('0x2d')]['filter']+'%'};return _0xd6b600;})});}_0x1d4ef2=_[_0x9b89('0x39')]({},_0x1d4ef2,_0xbac577['options']);return db[_0x9b89('0x5e')]['count']({'where':_0x1d4ef2[_0x9b89('0x3a')]})[_0x9b89('0x20')](function(_0x436d16){_0x3f2a0b[_0x9b89('0x19')]=_0x436d16;if(_0xbac577[_0x9b89('0x2d')][_0x9b89('0x40')]){_0x1d4ef2['include']=[{'all':!![]}];}return db[_0x9b89('0x5e')]['findAll'](_0x1d4ef2);})[_0x9b89('0x20')](function(_0x39c428){_0x3f2a0b[_0x9b89('0x42')]=_0x39c428;return _0x3f2a0b;});}})[_0x9b89('0x20')](respondWithFilteredResult(_0xa41030,_0x1d4ef2))[_0x9b89('0x4b')](handleError(_0xa41030,null));};exports['getLists']=function(_0x312e22,_0x335a1a,_0x3e309d){var _0x1aea22={};var _0xdb6462={};var _0x2297d3;var _0x898c25;return db[_0x9b89('0x29')][_0x9b89('0x5b')]({'where':{'id':_0x312e22['params']['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x335a1a,null))[_0x9b89('0x20')](function(_0x5c60ff){if(_0x5c60ff){_0x2297d3=_0x5c60ff;_0xdb6462[_0x9b89('0x2b')]=_[_0x9b89('0x2c')](db['CmList'][_0x9b89('0x2a')]);_0xdb6462[_0x9b89('0x2d')]=_[_0x9b89('0x2c')](_0x312e22[_0x9b89('0x2d')]);_0xdb6462['filters']=_[_0x9b89('0x2e')](_0xdb6462[_0x9b89('0x2b')],_0xdb6462[_0x9b89('0x2d')]);_0x1aea22['attributes']=_[_0x9b89('0x2e')](_0xdb6462[_0x9b89('0x2b')],qs[_0x9b89('0x30')](_0x312e22[_0x9b89('0x2d')][_0x9b89('0x30')]));_0x1aea22[_0x9b89('0x2f')]=_0x1aea22['attributes']['length']?_0x1aea22[_0x9b89('0x2f')]:_0xdb6462[_0x9b89('0x2b')];_0x1aea22[_0x9b89('0x34')]=qs[_0x9b89('0x35')](_0x312e22[_0x9b89('0x2d')]['sort']);_0x1aea22['where']=qs[_0x9b89('0x36')](_['pick'](_0x312e22[_0x9b89('0x2d')],_0xdb6462['filters']));if(_0x312e22[_0x9b89('0x2d')][_0x9b89('0x38')]){_0x1aea22[_0x9b89('0x3a')]=_[_0x9b89('0x39')](_0x1aea22['where'],{'$or':_[_0x9b89('0x3b')](_0x1aea22[_0x9b89('0x2f')],function(_0x3ed9dc){var _0x400b04={};_0x400b04[_0x3ed9dc]={'$like':'%'+_0x312e22[_0x9b89('0x2d')][_0x9b89('0x38')]+'%'};return _0x400b04;})});}_0x1aea22=_[_0x9b89('0x39')]({},_0x1aea22,_0x312e22[_0x9b89('0x3f')]);return _0x2297d3[_0x9b89('0x5f')](_0x1aea22);}})[_0x9b89('0x20')](function(_0x1a1b03){if(_0x1a1b03){_0x898c25=_0x1a1b03['length'];if(!_0x312e22[_0x9b89('0x2d')][_0x9b89('0x32')](_0x9b89('0x55'))){_0x1aea22[_0x9b89('0x1a')]=qs[_0x9b89('0x1a')](_0x312e22[_0x9b89('0x2d')][_0x9b89('0x1a')]);_0x1aea22['offset']=qs['offset'](_0x312e22['query'][_0x9b89('0x33')]);}return _0x2297d3[_0x9b89('0x5f')](_0x1aea22);}})['then'](function(_0x379346){if(_0x379346){return _0x379346?{'count':_0x898c25,'rows':_0x379346}:null;}})['then'](respondWithResult(_0x335a1a,null))[_0x9b89('0x4b')](handleError(_0x335a1a,null));};exports[_0x9b89('0x60')]=function(_0x23936d,_0x4025ae,_0x285d0e){var _0x56d1f3,_0x34aa1d;return db['Campaign'][_0x9b89('0x4e')]({'where':{'id':_0x23936d[_0x9b89('0x44')]['id']}})['then'](handleEntityNotFound(_0x4025ae,null))['then'](function(_0xa7a0b3){if(_0xa7a0b3){_0x34aa1d=_0xa7a0b3;return _0xa7a0b3[_0x9b89('0x60')](_0x23936d[_0x9b89('0x46')]['ids'],_[_0x9b89('0x4f')](_0x23936d['body'],[_0x9b89('0x61'),'id'])||{});}return null;})['spread'](function(_0x2c711d){var _0x2a4653;_0x56d1f3=_0x2c711d||[];var _0x9e803e=[];if(_0x2c711d){for(var _0x1057e0=0x0;_0x1057e0<_0x2c711d[_0x9b89('0x31')];_0x1057e0+=0x1){var _0x51475f=_0x2c711d[_0x1057e0][_0x9b89('0x22')]({'plain':!![]});_0x34aa1d[_0x9b89('0x62')]=_0x23936d['body'][_0x9b89('0x62')]?_0x23936d['body']['dialCheckDuplicateType']:_0x34aa1d[_0x9b89('0x62')];switch(_0x34aa1d[_0x9b89('0x62')]){case'always':_0x2a4653=squel[_0x9b89('0x63')]()['into'](_0x9b89('0x64'))[_0x9b89('0x65')]([_0x9b89('0x66'),_0x9b89('0x67'),_0x9b89('0x68'),_0x9b89('0x69'),'CampaignId',_0x9b89('0x50'),'updatedAt'],squel['select']()[_0x9b89('0x6a')]('phone',_0x9b89('0x66'))['field'](_0x9b89('0x6b'),'scheduledAt')[_0x9b89('0x6a')]('id',_0x9b89('0x68'))['field'](_0x51475f[_0x9b89('0x6c')][_0x9b89('0x6d')](),_0x9b89('0x69'))[_0x9b89('0x6a')](_0x23936d['params']['id'][_0x9b89('0x6d')](),_0x9b89('0x56'))[_0x9b89('0x6a')](_0x9b89('0x6b'),_0x9b89('0x50'))[_0x9b89('0x6a')]('NOW()',_0x9b89('0x51'))[_0x9b89('0x6e')](_0x9b89('0x6f'))[_0x9b89('0x3a')](_0x9b89('0x70'))[_0x9b89('0x3a')](_0x9b89('0x71'),_0x51475f[_0x9b89('0x6c')][_0x9b89('0x6d')]())[_0x9b89('0x3a')](_0x9b89('0x72'))[_0x9b89('0x3a')](_0x9b89('0x73'),squel[_0x9b89('0x74')]()[_0x9b89('0x6a')](_0x9b89('0x75'))['from'](_0x9b89('0x76'))[_0x9b89('0x3a')]('CampaignId\x20=\x20?',_0x23936d[_0x9b89('0x44')]['id'][_0x9b89('0x6d')]()))[_0x9b89('0x3a')](_0x9b89('0x73'),squel[_0x9b89('0x74')]()[_0x9b89('0x6a')](_0x9b89('0x77'))[_0x9b89('0x6e')](_0x9b89('0x64'))[_0x9b89('0x3a')](_0x9b89('0x78'),_0x23936d[_0x9b89('0x44')]['id'][_0x9b89('0x6d')]())))[_0x9b89('0x6d')]();break;case'onlyIfOpen':_0x2a4653=squel['insert']()['into'](_0x9b89('0x64'))[_0x9b89('0x65')](['phone',_0x9b89('0x67'),'ContactId',_0x9b89('0x69'),_0x9b89('0x56'),_0x9b89('0x50'),_0x9b89('0x51')],squel[_0x9b89('0x74')]()[_0x9b89('0x6a')](_0x9b89('0x66'),_0x9b89('0x66'))[_0x9b89('0x6a')](_0x9b89('0x6b'),'scheduledAt')[_0x9b89('0x6a')]('id',_0x9b89('0x68'))[_0x9b89('0x6a')](_0x51475f['CmListId']['toString'](),_0x9b89('0x69'))[_0x9b89('0x6a')](_0x23936d['params']['id']['toString'](),_0x9b89('0x56'))[_0x9b89('0x6a')](_0x9b89('0x6b'),_0x9b89('0x50'))[_0x9b89('0x6a')](_0x9b89('0x6b'),_0x9b89('0x51'))[_0x9b89('0x6e')](_0x9b89('0x6f'))[_0x9b89('0x3a')](_0x9b89('0x70'))[_0x9b89('0x3a')](_0x9b89('0x71'),_0x51475f[_0x9b89('0x6c')][_0x9b89('0x6d')]())['where'](_0x9b89('0x72'))[_0x9b89('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x9b89('0x77'))['from'](_0x9b89('0x64'))[_0x9b89('0x3a')](_0x9b89('0x78'),_0x23936d[_0x9b89('0x44')]['id'][_0x9b89('0x6d')]())))[_0x9b89('0x6d')]();break;default:_0x2a4653=squel[_0x9b89('0x63')]()[_0x9b89('0x79')](_0x9b89('0x64'))['fromQuery']([_0x9b89('0x66'),_0x9b89('0x67'),_0x9b89('0x68'),'ListId','CampaignId',_0x9b89('0x50'),_0x9b89('0x51')],squel[_0x9b89('0x74')]()[_0x9b89('0x6a')]('phone',_0x9b89('0x66'))[_0x9b89('0x6a')]('NOW()',_0x9b89('0x67'))['field']('id',_0x9b89('0x68'))[_0x9b89('0x6a')](_0x51475f['CmListId']['toString'](),'ListId')[_0x9b89('0x6a')](_0x23936d[_0x9b89('0x44')]['id']['toString'](),_0x9b89('0x56'))['field'](_0x9b89('0x6b'),'createdAt')[_0x9b89('0x6a')](_0x9b89('0x6b'),_0x9b89('0x51'))['from'](_0x9b89('0x6f'))[_0x9b89('0x3a')](_0x9b89('0x70'))[_0x9b89('0x3a')](_0x9b89('0x71'),_0x51475f[_0x9b89('0x6c')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x9b89('0x6d')]();}_0x9e803e[_0x9b89('0x7a')](db['sequelize']['query'](_0x2a4653));}return BPromise['all'](_0x9e803e);}})[_0x9b89('0x20')](function(){return _0x56d1f3;})['then'](respondWithResult(_0x4025ae,null))[_0x9b89('0x4b')](handleError(_0x4025ae,null));};exports[_0x9b89('0x7b')]=function(_0x56139e,_0x1e05d4,_0x29270c){var _0x2dd5e4;return db[_0x9b89('0x29')]['find']({'where':{'id':_0x56139e['params']['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x1e05d4,null))['then'](function(_0x72e9a2){if(_0x72e9a2){return _0x72e9a2[_0x9b89('0x7b')](_0x56139e[_0x9b89('0x2d')][_0x9b89('0x61')]);}})['then'](function(_0x3ce034){if(_0x3ce034){_0x2dd5e4=_0x3ce034;return db[_0x9b89('0x54')][_0x9b89('0x21')]({'where':{'ListId':_0x56139e[_0x9b89('0x2d')]['ids'],'CampaignId':_0x56139e[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](function(){return _0x2dd5e4;});}})[_0x9b89('0x20')](respondWithStatusCode(_0x1e05d4,null))['catch'](handleError(_0x1e05d4,null));};exports['getBlackLists']=function(_0x343221,_0x300a80,_0x2efd9e){var _0x16410c={'raw':!![],'where':{}};var _0xf79263={};var _0x903c90={'count':0x0,'rows':[]};return db[_0x9b89('0x29')][_0x9b89('0x5b')]({'where':{'id':_0x343221[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x300a80,null))[_0x9b89('0x20')](function(_0xb425dc){if(_0xb425dc){_0xf79263[_0x9b89('0x2b')]=_[_0x9b89('0x2c')](db[_0x9b89('0x7c')][_0x9b89('0x2a')]);_0xf79263['query']=_[_0x9b89('0x2c')](_0x343221[_0x9b89('0x2d')]);_0xf79263[_0x9b89('0x36')]=_[_0x9b89('0x2e')](_0xf79263[_0x9b89('0x2b')],_0xf79263[_0x9b89('0x2d')]);_0x16410c[_0x9b89('0x2f')]=_[_0x9b89('0x2e')](_0xf79263[_0x9b89('0x2b')],qs[_0x9b89('0x30')](_0x343221['query'][_0x9b89('0x30')]));_0x16410c[_0x9b89('0x2f')]=_0x16410c['attributes'][_0x9b89('0x31')]?_0x16410c[_0x9b89('0x2f')]:_0xf79263[_0x9b89('0x2b')];if(!_0x343221[_0x9b89('0x2d')][_0x9b89('0x32')](_0x9b89('0x55'))){_0x16410c[_0x9b89('0x1a')]=qs[_0x9b89('0x1a')](_0x343221[_0x9b89('0x2d')]['limit']);_0x16410c[_0x9b89('0x33')]=qs['offset'](_0x343221['query'][_0x9b89('0x33')]);}_0x16410c[_0x9b89('0x34')]=qs[_0x9b89('0x35')](_0x343221[_0x9b89('0x2d')][_0x9b89('0x35')]);_0x16410c['where']=qs['filters'](_[_0x9b89('0x37')](_0x343221['query'],_0xf79263[_0x9b89('0x36')]));_0x16410c[_0x9b89('0x3a')]['CampaignId']=_0xb425dc['id'];if(_0x343221['query'][_0x9b89('0x38')]){_0x16410c[_0x9b89('0x3a')]=_[_0x9b89('0x39')](_0x16410c[_0x9b89('0x3a')],{'$or':_[_0x9b89('0x3b')](_0x16410c[_0x9b89('0x2f')],function(_0x46f24a){var _0x4c3100={};_0x4c3100[_0x46f24a]={'$like':'%'+_0x343221['query']['filter']+'%'};return _0x4c3100;})});}_0x16410c=_['merge']({},_0x16410c,_0x343221[_0x9b89('0x3f')]);return db[_0x9b89('0x7c')][_0x9b89('0x19')]({'where':_0x16410c['where']})[_0x9b89('0x20')](function(_0x4fb028){_0x903c90[_0x9b89('0x19')]=_0x4fb028;if(_0x343221[_0x9b89('0x2d')][_0x9b89('0x40')]){_0x16410c[_0x9b89('0x41')]=[{'all':!![]}];}return db[_0x9b89('0x7c')][_0x9b89('0x59')](_0x16410c);})['then'](function(_0x352710){_0x903c90[_0x9b89('0x42')]=_0x352710;return _0x903c90;});}})[_0x9b89('0x20')](respondWithFilteredResult(_0x300a80,_0x16410c))[_0x9b89('0x4b')](handleError(_0x300a80,null));};exports[_0x9b89('0x7d')]=function(_0x23ab66,_0x5b1563,_0x1e76f1){var _0x328db1,_0x18adcc;return db['Campaign'][_0x9b89('0x4e')]({'where':{'id':_0x23ab66[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x5b1563,null))[_0x9b89('0x20')](function(_0x2be13f){if(_0x2be13f){_0x18adcc=_0x2be13f;return _0x2be13f['addBlackLists'](_0x23ab66[_0x9b89('0x46')][_0x9b89('0x61')],_[_0x9b89('0x4f')](_0x23ab66[_0x9b89('0x46')],[_0x9b89('0x61'),'id'])||{});}return null;})[_0x9b89('0x7e')](function(_0x3b6c7c){var _0x507875;_0x328db1=_0x3b6c7c||[];var _0x8ed75a=[];if(_0x3b6c7c){for(var _0x208662=0x0;_0x208662<_0x3b6c7c[_0x9b89('0x31')];_0x208662+=0x1){var _0x3a492f=_0x3b6c7c[_0x208662][_0x9b89('0x22')]({'plain':!![]});_0x507875=squel['insert']()[_0x9b89('0x79')](_0x9b89('0x7f'))[_0x9b89('0x65')]([_0x9b89('0x66'),_0x9b89('0x68'),'ListId',_0x9b89('0x56'),_0x9b89('0x50'),_0x9b89('0x51')],squel[_0x9b89('0x74')]()['field'](_0x9b89('0x66'),_0x9b89('0x66'))[_0x9b89('0x6a')]('id',_0x9b89('0x68'))[_0x9b89('0x6a')](_0x3a492f[_0x9b89('0x6c')][_0x9b89('0x6d')](),_0x9b89('0x69'))[_0x9b89('0x6a')](_0x23ab66[_0x9b89('0x44')]['id'][_0x9b89('0x6d')](),'CampaignId')['field']('NOW()','createdAt')[_0x9b89('0x6a')](_0x9b89('0x6b'),_0x9b89('0x51'))[_0x9b89('0x6e')](_0x9b89('0x6f'))[_0x9b89('0x3a')](_0x9b89('0x70'))[_0x9b89('0x3a')](_0x9b89('0x71'),_0x3a492f[_0x9b89('0x6c')][_0x9b89('0x6d')]())[_0x9b89('0x3a')](_0x9b89('0x72')))[_0x9b89('0x6d')]();_0x8ed75a[_0x9b89('0x7a')](db[_0x9b89('0x80')][_0x9b89('0x2d')](_0x507875));}return BPromise[_0x9b89('0x81')](_0x8ed75a);}})['then'](function(){return _0x328db1;})[_0x9b89('0x20')](respondWithResult(_0x5b1563,null))[_0x9b89('0x4b')](handleError(_0x5b1563,null));};exports['removeBlackLists']=function(_0x47d5a1,_0x24ffd5,_0x1b8147){var _0x1c69ab;return db['Campaign'][_0x9b89('0x4e')]({'where':{'id':_0x47d5a1[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](handleEntityNotFound(_0x24ffd5,null))[_0x9b89('0x20')](function(_0x156c24){if(_0x156c24){return _0x156c24[_0x9b89('0x82')](_0x47d5a1[_0x9b89('0x2d')][_0x9b89('0x61')]);}})[_0x9b89('0x20')](function(_0x3f9c7c){if(_0x3f9c7c){_0x1c69ab=_0x3f9c7c;return db[_0x9b89('0x5e')][_0x9b89('0x21')]({'where':{'ListId':_0x47d5a1[_0x9b89('0x2d')]['ids'],'CampaignId':_0x47d5a1[_0x9b89('0x44')]['id']}})[_0x9b89('0x20')](function(){return _0x1c69ab;});}})[_0x9b89('0x20')](respondWithStatusCode(_0x24ffd5,null))[_0x9b89('0x4b')](handleError(_0x24ffd5,null));}; \ No newline at end of file +var _0x33e8=['destroy','error','stack','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','field','Campaign','include','findAll','rows','catch','show','params','length','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','userProfileId','autoAssociation','getHoppers','CampaignId','CmHopper','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ListId','select','phone','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','push','all','removeLists','getBlackLists','addBlackLists','omit','sequelize','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','get','UserProfileResource'];(function(_0x12b174,_0x1a46be){var _0x215bc4=function(_0x268294){while(--_0x268294){_0x12b174['push'](_0x12b174['shift']());}};_0x215bc4(++_0x1a46be);}(_0x33e8,0x1ed));var _0x833e=function(_0x1550ff,_0x3a8a79){_0x1550ff=_0x1550ff-0x0;var _0x2f4a3d=_0x33e8[_0x1550ff];return _0x2f4a3d;};'use strict';var pdf=require(_0x833e('0x0'));var emlformat=require(_0x833e('0x1'));var rimraf=require(_0x833e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x833e('0x3'));var rp=require(_0x833e('0x4'));var moment=require(_0x833e('0x5'));var BPromise=require(_0x833e('0x6'));var Mustache=require(_0x833e('0x7'));var util=require(_0x833e('0x8'));var path=require('path');var sox=require(_0x833e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x833e('0xa'));var squel=require(_0x833e('0xb'));var crypto=require(_0x833e('0xc'));var jsforce=require(_0x833e('0xd'));var deskjs=require(_0x833e('0xe'));var toCsv=require(_0x833e('0xf'));var querystring=require(_0x833e('0x10'));var Papa=require(_0x833e('0x11'));var authService=require(_0x833e('0x12'));var hardwareService=require(_0x833e('0x13'));var Redis=require('ioredis');var qs=require(_0x833e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x833e('0x15'));var config=require(_0x833e('0x16'));var db=require(_0x833e('0x17'))['db'];function respondWithStatusCode(_0x496311,_0x4aaaa1){_0x4aaaa1=_0x4aaaa1||0xcc;return function(_0x55c7c3){if(_0x55c7c3){return _0x496311[_0x833e('0x18')](_0x4aaaa1);}return _0x496311[_0x833e('0x19')](_0x4aaaa1)[_0x833e('0x1a')]();};}function respondWithResult(_0x116106,_0x3cf716){_0x3cf716=_0x3cf716||0xc8;return function(_0x180fdd){if(_0x180fdd){return _0x116106[_0x833e('0x19')](_0x3cf716)['json'](_0x180fdd);}};}function respondWithFilteredResult(_0x339bb2,_0x1dd4a6){return function(_0x58116c){if(_0x58116c){var _0x20b9b6=_0x58116c[_0x833e('0x1b')],_0x2dbc16=_0x1dd4a6[_0x833e('0x1c')],_0x2b1848=_0x1dd4a6[_0x833e('0x1c')]+_0x1dd4a6[_0x833e('0x1d')],_0x5610f8;if(_0x2b1848>=_0x20b9b6){_0x2b1848=_0x20b9b6;_0x5610f8=0xc8;}else{_0x5610f8=0xce;}_0x339bb2['status'](_0x5610f8);return _0x339bb2[_0x833e('0x1e')](_0x833e('0x1f'),_0x2dbc16+'-'+_0x2b1848+'/'+_0x20b9b6)[_0x833e('0x20')](_0x58116c);}return null;};}function patchUpdates(_0x26c362){return function(_0x38ee11){try{jsonpatch['apply'](_0x38ee11,_0x26c362,!![]);}catch(_0x5c5b3b){return BPromise[_0x833e('0x21')](_0x5c5b3b);}return _0x38ee11[_0x833e('0x22')]();};}function saveUpdates(_0xf34696,_0x10568a){return function(_0x110a85){if(_0x110a85){return _0x110a85[_0x833e('0x23')](_0xf34696)[_0x833e('0x24')](function(_0x8108dc){return _0x8108dc;});}return null;};}function removeEntity(_0x24f6e2,_0x48d56e){return function(_0xa86f82){if(_0xa86f82){return _0xa86f82['destroy']()['then'](function(){var _0x13afc5=_0xa86f82[_0x833e('0x25')]({'plain':!![]});var _0x1ea71b='IvrCampaigns';return db[_0x833e('0x26')][_0x833e('0x27')]({'where':{'type':_0x1ea71b,'resourceId':_0x13afc5['id']}})[_0x833e('0x24')](function(){return _0xa86f82;});})[_0x833e('0x24')](function(){_0x24f6e2[_0x833e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec058,_0xba402c){return function(_0x5bd0a5){if(!_0x5bd0a5){_0x4ec058[_0x833e('0x18')](0x194);}return _0x5bd0a5;};}function handleError(_0x304fb4,_0x40b19a){_0x40b19a=_0x40b19a||0x1f4;return function(_0x87b63e){logger[_0x833e('0x28')](_0x87b63e[_0x833e('0x29')]);if(_0x87b63e['name']){delete _0x87b63e[_0x833e('0x2a')];}_0x304fb4[_0x833e('0x19')](_0x40b19a)[_0x833e('0x2b')](_0x87b63e);};}exports['index']=function(_0x5169d2,_0x503364){var _0x4b93eb={},_0x3a3e74={},_0x171b80={'count':0x0,'rows':[]};var _0x344615=db['Campaign'][_0x833e('0x2c')];_0x3a3e74[_0x833e('0x2d')]=_[_0x833e('0x2e')](_0x344615);_0x3a3e74[_0x833e('0x2f')]=_[_0x833e('0x2e')](_0x5169d2[_0x833e('0x2f')]);_0x3a3e74['filters']=_[_0x833e('0x30')](_0x3a3e74[_0x833e('0x2d')],_0x3a3e74['query']);_0x4b93eb[_0x833e('0x31')]=_[_0x833e('0x30')](_0x3a3e74['model'],qs[_0x833e('0x32')](_0x5169d2[_0x833e('0x2f')][_0x833e('0x32')]));_0x4b93eb[_0x833e('0x31')]=_0x4b93eb[_0x833e('0x31')]['length']?_0x4b93eb[_0x833e('0x31')]:_0x3a3e74['model'];if(!_0x5169d2[_0x833e('0x2f')][_0x833e('0x33')](_0x833e('0x34'))){_0x4b93eb['limit']=qs['limit'](_0x5169d2['query'][_0x833e('0x1d')]);_0x4b93eb[_0x833e('0x1c')]=qs[_0x833e('0x1c')](_0x5169d2[_0x833e('0x2f')][_0x833e('0x1c')]);}_0x4b93eb[_0x833e('0x35')]=qs[_0x833e('0x36')](_0x5169d2[_0x833e('0x2f')]['sort']);_0x4b93eb['where']=qs[_0x833e('0x37')](_[_0x833e('0x38')](_0x5169d2[_0x833e('0x2f')],_0x3a3e74[_0x833e('0x37')]));if(_0x5169d2['query'][_0x833e('0x39')]){_0x4b93eb[_0x833e('0x3a')]=_[_0x833e('0x3b')](_0x4b93eb[_0x833e('0x3a')],{'$or':_[_0x833e('0x3c')](_0x344615,function(_0x54b2e4){if(_0x54b2e4['type'][_0x833e('0x3d')]!==_0x833e('0x3e')){var _0x5c96a5={};_0x5c96a5[_0x54b2e4[_0x833e('0x3f')]]={'$like':'%'+_0x5169d2[_0x833e('0x2f')]['filter']+'%'};return _0x5c96a5;}})});}_0x4b93eb=_[_0x833e('0x3b')]({},_0x4b93eb,_0x5169d2['options']);var _0x97bbae={'where':_0x4b93eb[_0x833e('0x3a')]};return db[_0x833e('0x40')][_0x833e('0x1b')](_0x97bbae)[_0x833e('0x24')](function(_0x4922dd){_0x171b80[_0x833e('0x1b')]=_0x4922dd;if(_0x5169d2[_0x833e('0x2f')]['includeAll']){_0x4b93eb[_0x833e('0x41')]=[{'all':!![]}];}return db[_0x833e('0x40')][_0x833e('0x42')](_0x4b93eb);})[_0x833e('0x24')](function(_0x4b1d2b){_0x171b80[_0x833e('0x43')]=_0x4b1d2b;return _0x171b80;})[_0x833e('0x24')](respondWithFilteredResult(_0x503364,_0x4b93eb))[_0x833e('0x44')](handleError(_0x503364,null));};exports[_0x833e('0x45')]=function(_0x34c64b,_0x516a68){var _0xf8dca={'raw':![],'where':{'id':_0x34c64b[_0x833e('0x46')]['id']}},_0x30cf7c={};_0x30cf7c[_0x833e('0x2d')]=_[_0x833e('0x2e')](db[_0x833e('0x40')][_0x833e('0x2c')]);_0x30cf7c[_0x833e('0x2f')]=_[_0x833e('0x2e')](_0x34c64b[_0x833e('0x2f')]);_0x30cf7c[_0x833e('0x37')]=_[_0x833e('0x30')](_0x30cf7c[_0x833e('0x2d')],_0x30cf7c[_0x833e('0x2f')]);_0xf8dca['attributes']=_[_0x833e('0x30')](_0x30cf7c[_0x833e('0x2d')],qs[_0x833e('0x32')](_0x34c64b[_0x833e('0x2f')][_0x833e('0x32')]));_0xf8dca['attributes']=_0xf8dca[_0x833e('0x31')][_0x833e('0x47')]?_0xf8dca[_0x833e('0x31')]:_0x30cf7c['model'];if(_0x34c64b[_0x833e('0x2f')][_0x833e('0x48')]){_0xf8dca[_0x833e('0x41')]=[{'all':!![]}];}_0xf8dca=_['merge']({},_0xf8dca,_0x34c64b[_0x833e('0x49')]);return db[_0x833e('0x40')]['find'](_0xf8dca)['then'](handleEntityNotFound(_0x516a68,null))[_0x833e('0x24')](respondWithResult(_0x516a68,null))['catch'](handleError(_0x516a68,null));};exports[_0x833e('0x4a')]=function(_0x3bedbc,_0x48881d){return db['Campaign'][_0x833e('0x4a')](_0x3bedbc['body'],{})['then'](function(_0xb64447){var _0x55e337=_0x3bedbc[_0x833e('0x4b')]['get']({'plain':!![]});if(!_0x55e337)throw new Error(_0x833e('0x4c'));if(_0x55e337['role']==='user'){var _0x1f9173=_0xb64447['get']({'plain':!![]});var _0x1694a6=_0x833e('0x4d');return db[_0x833e('0x4e')][_0x833e('0x4f')]({'where':{'name':_0x1694a6,'userProfileId':_0x55e337['userProfileId']},'raw':!![]})[_0x833e('0x24')](function(_0xad97d9){if(_0xad97d9&&_0xad97d9['autoAssociation']===0x0){return db['UserProfileResource'][_0x833e('0x4a')]({'name':_0x1f9173['name'],'resourceId':_0x1f9173['id'],'type':_0xad97d9[_0x833e('0x2a')],'sectionId':_0xad97d9['id']},{})['then'](function(){return _0xb64447;});}else{return _0xb64447;}})[_0x833e('0x44')](function(_0x1849eb){logger[_0x833e('0x28')](_0x833e('0x50'),_0x1849eb);throw _0x1849eb;});}return _0xb64447;})[_0x833e('0x24')](respondWithResult(_0x48881d,0xc9))['catch'](handleError(_0x48881d,null));};exports[_0x833e('0x51')]=function(_0x15196f,_0x4e1539){var _0x178f68={'raw':![],'where':{'id':_0x15196f[_0x833e('0x46')]['id']}},_0x12d1c8={};_0x12d1c8['model']=_[_0x833e('0x2e')](db[_0x833e('0x40')][_0x833e('0x2c')]);_0x178f68[_0x833e('0x31')]=_[_0x833e('0x30')](_0x12d1c8[_0x833e('0x2d')],qs[_0x833e('0x32')](_0x15196f['query']['fields']));_0x178f68[_0x833e('0x31')]=_0x178f68[_0x833e('0x31')][_0x833e('0x47')]?_0x178f68[_0x833e('0x31')]:_0x12d1c8[_0x833e('0x2d')];if(_0x15196f[_0x833e('0x2f')][_0x833e('0x48')]){_0x178f68[_0x833e('0x41')]=[{'all':!![]}];}_0x178f68=_[_0x833e('0x3b')]({},_0x178f68,_0x15196f['options']);return db['Campaign']['find'](_0x178f68)[_0x833e('0x24')](handleEntityNotFound(_0x4e1539,null))['then'](function(_0x3fb5f6){if(_0x3fb5f6){var _0x9d1922=_0x3fb5f6[_0x833e('0x25')]({'plain':!![]});_0x9d1922=qs['omit'](_0x9d1922,['id',_0x833e('0x52'),_0x833e('0x53')]);_0x15196f[_0x833e('0x54')]=_['omit'](_0x15196f[_0x833e('0x54')],['id',_0x833e('0x52'),'updatedAt']);return db[_0x833e('0x40')][_0x833e('0x4a')](_[_0x833e('0x3b')](_0x9d1922,_0x15196f['body']),{'include':_0x15196f[_0x833e('0x2f')][_0x833e('0x48')]?[{'all':!![]}]:undefined})[_0x833e('0x24')](function(_0x1c9d51){var _0x2dd682=_0x15196f[_0x833e('0x4b')]['get']({'plain':!![]});if(!_0x2dd682)throw new Error(_0x833e('0x4c'));if(_0x2dd682['role']===_0x833e('0x4b')){var _0x4ead95=_0x1c9d51[_0x833e('0x25')]({'plain':!![]});var _0x1545bf=_0x833e('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x1545bf,'userProfileId':_0x2dd682[_0x833e('0x55')]},'raw':!![]})[_0x833e('0x24')](function(_0x253fcb){if(_0x253fcb&&_0x253fcb[_0x833e('0x56')]===0x0){return db['UserProfileResource'][_0x833e('0x4a')]({'name':_0x4ead95[_0x833e('0x2a')],'resourceId':_0x4ead95['id'],'type':_0x253fcb['name'],'sectionId':_0x253fcb['id']},{})[_0x833e('0x24')](function(){return _0x1c9d51;});}else{return _0x1c9d51;}})[_0x833e('0x44')](function(_0x7a3996){logger[_0x833e('0x28')](_0x833e('0x50'),_0x7a3996);throw _0x7a3996;});}return _0x1c9d51;});}})['then'](respondWithResult(_0x4e1539,0xc9))['catch'](handleError(_0x4e1539,null));};exports['update']=function(_0x1f9adc,_0x15df85){if(_0x1f9adc[_0x833e('0x54')]['id']){delete _0x1f9adc['body']['id'];}return db[_0x833e('0x40')][_0x833e('0x4f')]({'where':{'id':_0x1f9adc[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0x15df85,null))[_0x833e('0x24')](saveUpdates(_0x1f9adc[_0x833e('0x54')],null))[_0x833e('0x24')](respondWithResult(_0x15df85,null))['catch'](handleError(_0x15df85,null));};exports['destroy']=function(_0x22c5f9,_0xf25ca2){return db[_0x833e('0x40')][_0x833e('0x4f')]({'where':{'id':_0x22c5f9[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0xf25ca2,null))[_0x833e('0x24')](removeEntity(_0xf25ca2,null))[_0x833e('0x44')](handleError(_0xf25ca2,null));};exports[_0x833e('0x57')]=function(_0x201598,_0x921027,_0xb0ade3){var _0x463fb3={'raw':!![],'where':{}};var _0x4aecb5={};var _0x51ba75={'count':0x0,'rows':[]};return db[_0x833e('0x40')]['findOne']({'where':{'id':_0x201598[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0x921027,null))[_0x833e('0x24')](function(_0x4dffc6){if(_0x4dffc6){_0x4aecb5['model']=_[_0x833e('0x2e')](db['CmHopper']['rawAttributes']);_0x4aecb5[_0x833e('0x2f')]=_[_0x833e('0x2e')](_0x201598[_0x833e('0x2f')]);_0x4aecb5[_0x833e('0x37')]=_[_0x833e('0x30')](_0x4aecb5[_0x833e('0x2d')],_0x4aecb5[_0x833e('0x2f')]);_0x463fb3[_0x833e('0x31')]=_[_0x833e('0x30')](_0x4aecb5[_0x833e('0x2d')],qs[_0x833e('0x32')](_0x201598[_0x833e('0x2f')][_0x833e('0x32')]));_0x463fb3[_0x833e('0x31')]=_0x463fb3[_0x833e('0x31')][_0x833e('0x47')]?_0x463fb3['attributes']:_0x4aecb5['model'];if(!_0x201598[_0x833e('0x2f')]['hasOwnProperty'](_0x833e('0x34'))){_0x463fb3[_0x833e('0x1d')]=qs[_0x833e('0x1d')](_0x201598[_0x833e('0x2f')][_0x833e('0x1d')]);_0x463fb3[_0x833e('0x1c')]=qs['offset'](_0x201598[_0x833e('0x2f')][_0x833e('0x1c')]);}_0x463fb3[_0x833e('0x35')]=qs['sort'](_0x201598['query']['sort']);_0x463fb3[_0x833e('0x3a')]=qs[_0x833e('0x37')](_[_0x833e('0x38')](_0x201598['query'],_0x4aecb5[_0x833e('0x37')]));_0x463fb3[_0x833e('0x3a')][_0x833e('0x58')]=_0x4dffc6['id'];if(_0x201598['query'][_0x833e('0x39')]){_0x463fb3[_0x833e('0x3a')]=_[_0x833e('0x3b')](_0x463fb3[_0x833e('0x3a')],{'$or':_[_0x833e('0x3c')](_0x463fb3['attributes'],function(_0x329314){var _0x23270a={};_0x23270a[_0x329314]={'$like':'%'+_0x201598[_0x833e('0x2f')]['filter']+'%'};return _0x23270a;})});}_0x463fb3=_[_0x833e('0x3b')]({},_0x463fb3,_0x201598[_0x833e('0x49')]);return db[_0x833e('0x59')][_0x833e('0x1b')]({'where':_0x463fb3[_0x833e('0x3a')]})['then'](function(_0x22455f){_0x51ba75[_0x833e('0x1b')]=_0x22455f;if(_0x201598[_0x833e('0x2f')]['includeAll']){_0x463fb3[_0x833e('0x41')]=[{'all':!![]}];}return db[_0x833e('0x59')][_0x833e('0x42')](_0x463fb3);})['then'](function(_0x231a2c){_0x51ba75['rows']=_0x231a2c;return _0x51ba75;});}})[_0x833e('0x24')](respondWithFilteredResult(_0x921027,_0x463fb3))[_0x833e('0x44')](handleError(_0x921027,null));};exports[_0x833e('0x5a')]=function(_0x3a3a9b,_0x3e8c52,_0x2b40ce){var _0x296514={'raw':!![],'where':{}};var _0x5133e2={};var _0x3d7909={'count':0x0,'rows':[]};return db[_0x833e('0x40')][_0x833e('0x5b')]({'where':{'id':_0x3a3a9b[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0x3e8c52,null))['then'](function(_0x45b64d){if(_0x45b64d){_0x5133e2['model']=_['keys'](db[_0x833e('0x5c')][_0x833e('0x2c')]);_0x5133e2['query']=_[_0x833e('0x2e')](_0x3a3a9b['query']);_0x5133e2[_0x833e('0x37')]=_[_0x833e('0x30')](_0x5133e2[_0x833e('0x2d')],_0x5133e2[_0x833e('0x2f')]);_0x296514[_0x833e('0x31')]=_[_0x833e('0x30')](_0x5133e2[_0x833e('0x2d')],qs['fields'](_0x3a3a9b[_0x833e('0x2f')]['fields']));_0x296514[_0x833e('0x31')]=_0x296514[_0x833e('0x31')][_0x833e('0x47')]?_0x296514[_0x833e('0x31')]:_0x5133e2['model'];if(!_0x3a3a9b['query'][_0x833e('0x33')](_0x833e('0x34'))){_0x296514['limit']=qs[_0x833e('0x1d')](_0x3a3a9b[_0x833e('0x2f')][_0x833e('0x1d')]);_0x296514[_0x833e('0x1c')]=qs['offset'](_0x3a3a9b[_0x833e('0x2f')][_0x833e('0x1c')]);}_0x296514[_0x833e('0x35')]=qs[_0x833e('0x36')](_0x3a3a9b[_0x833e('0x2f')][_0x833e('0x36')]);_0x296514[_0x833e('0x3a')]=qs[_0x833e('0x37')](_[_0x833e('0x38')](_0x3a3a9b[_0x833e('0x2f')],_0x5133e2[_0x833e('0x37')]));_0x296514[_0x833e('0x3a')][_0x833e('0x58')]=_0x45b64d['id'];if(_0x3a3a9b[_0x833e('0x2f')][_0x833e('0x39')]){_0x296514[_0x833e('0x3a')]=_[_0x833e('0x3b')](_0x296514[_0x833e('0x3a')],{'$or':_[_0x833e('0x3c')](_0x296514[_0x833e('0x31')],function(_0x2f6f1e){var _0x2c980f={};_0x2c980f[_0x2f6f1e]={'$like':'%'+_0x3a3a9b[_0x833e('0x2f')][_0x833e('0x39')]+'%'};return _0x2c980f;})});}_0x296514=_[_0x833e('0x3b')]({},_0x296514,_0x3a3a9b[_0x833e('0x49')]);return db[_0x833e('0x5c')][_0x833e('0x1b')]({'where':_0x296514[_0x833e('0x3a')]})[_0x833e('0x24')](function(_0x2c15dc){_0x3d7909['count']=_0x2c15dc;if(_0x3a3a9b[_0x833e('0x2f')][_0x833e('0x48')]){_0x296514['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x833e('0x42')](_0x296514);})[_0x833e('0x24')](function(_0x134c84){_0x3d7909['rows']=_0x134c84;return _0x3d7909;});}})[_0x833e('0x24')](respondWithFilteredResult(_0x3e8c52,_0x296514))[_0x833e('0x44')](handleError(_0x3e8c52,null));};exports[_0x833e('0x5d')]=function(_0x2e57e3,_0x1bafab,_0x5e8008){var _0x241c1e={'raw':!![],'where':{}};var _0x5f0f18={};var _0x56e7bc={'count':0x0,'rows':[]};return db[_0x833e('0x40')][_0x833e('0x5b')]({'where':{'id':_0x2e57e3['params']['id']}})[_0x833e('0x24')](handleEntityNotFound(_0x1bafab,null))[_0x833e('0x24')](function(_0x54bffc){if(_0x54bffc){_0x5f0f18[_0x833e('0x2d')]=_[_0x833e('0x2e')](db[_0x833e('0x5e')][_0x833e('0x2c')]);_0x5f0f18['query']=_[_0x833e('0x2e')](_0x2e57e3[_0x833e('0x2f')]);_0x5f0f18[_0x833e('0x37')]=_[_0x833e('0x30')](_0x5f0f18['model'],_0x5f0f18[_0x833e('0x2f')]);_0x241c1e[_0x833e('0x31')]=_['intersection'](_0x5f0f18[_0x833e('0x2d')],qs[_0x833e('0x32')](_0x2e57e3[_0x833e('0x2f')][_0x833e('0x32')]));_0x241c1e[_0x833e('0x31')]=_0x241c1e[_0x833e('0x31')][_0x833e('0x47')]?_0x241c1e[_0x833e('0x31')]:_0x5f0f18[_0x833e('0x2d')];if(!_0x2e57e3[_0x833e('0x2f')][_0x833e('0x33')](_0x833e('0x34'))){_0x241c1e[_0x833e('0x1d')]=qs['limit'](_0x2e57e3[_0x833e('0x2f')][_0x833e('0x1d')]);_0x241c1e[_0x833e('0x1c')]=qs[_0x833e('0x1c')](_0x2e57e3[_0x833e('0x2f')][_0x833e('0x1c')]);}_0x241c1e[_0x833e('0x35')]=qs['sort'](_0x2e57e3[_0x833e('0x2f')][_0x833e('0x36')]);_0x241c1e[_0x833e('0x3a')]=qs[_0x833e('0x37')](_[_0x833e('0x38')](_0x2e57e3[_0x833e('0x2f')],_0x5f0f18[_0x833e('0x37')]));_0x241c1e[_0x833e('0x3a')]['CampaignId']=_0x54bffc['id'];if(_0x2e57e3[_0x833e('0x2f')]['filter']){_0x241c1e['where']=_['merge'](_0x241c1e[_0x833e('0x3a')],{'$or':_[_0x833e('0x3c')](_0x241c1e[_0x833e('0x31')],function(_0xc4968e){var _0x44cff0={};_0x44cff0[_0xc4968e]={'$like':'%'+_0x2e57e3[_0x833e('0x2f')]['filter']+'%'};return _0x44cff0;})});}_0x241c1e=_['merge']({},_0x241c1e,_0x2e57e3[_0x833e('0x49')]);return db[_0x833e('0x5e')][_0x833e('0x1b')]({'where':_0x241c1e['where']})[_0x833e('0x24')](function(_0x4bf735){_0x56e7bc[_0x833e('0x1b')]=_0x4bf735;if(_0x2e57e3[_0x833e('0x2f')]['includeAll']){_0x241c1e[_0x833e('0x41')]=[{'all':!![]}];}return db[_0x833e('0x5e')][_0x833e('0x42')](_0x241c1e);})[_0x833e('0x24')](function(_0x40e127){_0x56e7bc[_0x833e('0x43')]=_0x40e127;return _0x56e7bc;});}})[_0x833e('0x24')](respondWithFilteredResult(_0x1bafab,_0x241c1e))[_0x833e('0x44')](handleError(_0x1bafab,null));};exports['getHopperBlacks']=function(_0x2928a6,_0xed638c,_0x34d2b9){var _0x9f8805={'raw':!![],'where':{}};var _0x122fb0={};var _0xc8aa75={'count':0x0,'rows':[]};return db[_0x833e('0x40')]['findOne']({'where':{'id':_0x2928a6[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0xed638c,null))[_0x833e('0x24')](function(_0x3d0ee4){if(_0x3d0ee4){_0x122fb0[_0x833e('0x2d')]=_['keys'](db[_0x833e('0x5f')][_0x833e('0x2c')]);_0x122fb0['query']=_['keys'](_0x2928a6[_0x833e('0x2f')]);_0x122fb0['filters']=_[_0x833e('0x30')](_0x122fb0[_0x833e('0x2d')],_0x122fb0[_0x833e('0x2f')]);_0x9f8805[_0x833e('0x31')]=_[_0x833e('0x30')](_0x122fb0[_0x833e('0x2d')],qs[_0x833e('0x32')](_0x2928a6[_0x833e('0x2f')][_0x833e('0x32')]));_0x9f8805[_0x833e('0x31')]=_0x9f8805[_0x833e('0x31')][_0x833e('0x47')]?_0x9f8805[_0x833e('0x31')]:_0x122fb0[_0x833e('0x2d')];if(!_0x2928a6[_0x833e('0x2f')]['hasOwnProperty'](_0x833e('0x34'))){_0x9f8805['limit']=qs[_0x833e('0x1d')](_0x2928a6[_0x833e('0x2f')][_0x833e('0x1d')]);_0x9f8805['offset']=qs[_0x833e('0x1c')](_0x2928a6[_0x833e('0x2f')][_0x833e('0x1c')]);}_0x9f8805[_0x833e('0x35')]=qs[_0x833e('0x36')](_0x2928a6['query']['sort']);_0x9f8805['where']=qs[_0x833e('0x37')](_[_0x833e('0x38')](_0x2928a6[_0x833e('0x2f')],_0x122fb0[_0x833e('0x37')]));_0x9f8805[_0x833e('0x3a')][_0x833e('0x58')]=_0x3d0ee4['id'];if(_0x2928a6[_0x833e('0x2f')][_0x833e('0x39')]){_0x9f8805['where']=_['merge'](_0x9f8805[_0x833e('0x3a')],{'$or':_[_0x833e('0x3c')](_0x9f8805[_0x833e('0x31')],function(_0x3aca74){var _0xed4494={};_0xed4494[_0x3aca74]={'$like':'%'+_0x2928a6[_0x833e('0x2f')]['filter']+'%'};return _0xed4494;})});}_0x9f8805=_[_0x833e('0x3b')]({},_0x9f8805,_0x2928a6[_0x833e('0x49')]);return db['CmHopperBlack'][_0x833e('0x1b')]({'where':_0x9f8805[_0x833e('0x3a')]})[_0x833e('0x24')](function(_0x4e4223){_0xc8aa75[_0x833e('0x1b')]=_0x4e4223;if(_0x2928a6[_0x833e('0x2f')][_0x833e('0x48')]){_0x9f8805[_0x833e('0x41')]=[{'all':!![]}];}return db[_0x833e('0x5f')][_0x833e('0x42')](_0x9f8805);})['then'](function(_0x4320c7){_0xc8aa75[_0x833e('0x43')]=_0x4320c7;return _0xc8aa75;});}})[_0x833e('0x24')](respondWithFilteredResult(_0xed638c,_0x9f8805))[_0x833e('0x44')](handleError(_0xed638c,null));};exports[_0x833e('0x60')]=function(_0x95a1eb,_0x68f0c7,_0x230c79){var _0x3e7764={};var _0x1ca08c={};var _0x4dc358;var _0x1f4bb8;return db[_0x833e('0x40')][_0x833e('0x5b')]({'where':{'id':_0x95a1eb[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0x68f0c7,null))[_0x833e('0x24')](function(_0x327505){if(_0x327505){_0x4dc358=_0x327505;_0x1ca08c[_0x833e('0x2d')]=_[_0x833e('0x2e')](db[_0x833e('0x61')][_0x833e('0x2c')]);_0x1ca08c[_0x833e('0x2f')]=_[_0x833e('0x2e')](_0x95a1eb[_0x833e('0x2f')]);_0x1ca08c[_0x833e('0x37')]=_[_0x833e('0x30')](_0x1ca08c['model'],_0x1ca08c[_0x833e('0x2f')]);_0x3e7764['attributes']=_[_0x833e('0x30')](_0x1ca08c[_0x833e('0x2d')],qs[_0x833e('0x32')](_0x95a1eb[_0x833e('0x2f')][_0x833e('0x32')]));_0x3e7764[_0x833e('0x31')]=_0x3e7764[_0x833e('0x31')][_0x833e('0x47')]?_0x3e7764['attributes']:_0x1ca08c['model'];_0x3e7764[_0x833e('0x35')]=qs[_0x833e('0x36')](_0x95a1eb['query']['sort']);_0x3e7764[_0x833e('0x3a')]=qs[_0x833e('0x37')](_[_0x833e('0x38')](_0x95a1eb[_0x833e('0x2f')],_0x1ca08c['filters']));if(_0x95a1eb[_0x833e('0x2f')][_0x833e('0x39')]){_0x3e7764[_0x833e('0x3a')]=_[_0x833e('0x3b')](_0x3e7764[_0x833e('0x3a')],{'$or':_['map'](_0x3e7764[_0x833e('0x31')],function(_0x490443){var _0x3d22f3={};_0x3d22f3[_0x490443]={'$like':'%'+_0x95a1eb[_0x833e('0x2f')][_0x833e('0x39')]+'%'};return _0x3d22f3;})});}_0x3e7764=_[_0x833e('0x3b')]({},_0x3e7764,_0x95a1eb[_0x833e('0x49')]);return _0x4dc358['getLists'](_0x3e7764);}})['then'](function(_0x274965){if(_0x274965){_0x1f4bb8=_0x274965[_0x833e('0x47')];if(!_0x95a1eb['query'][_0x833e('0x33')](_0x833e('0x34'))){_0x3e7764[_0x833e('0x1d')]=qs[_0x833e('0x1d')](_0x95a1eb[_0x833e('0x2f')]['limit']);_0x3e7764[_0x833e('0x1c')]=qs[_0x833e('0x1c')](_0x95a1eb['query'][_0x833e('0x1c')]);}return _0x4dc358['getLists'](_0x3e7764);}})[_0x833e('0x24')](function(_0x389d8e){if(_0x389d8e){return _0x389d8e?{'count':_0x1f4bb8,'rows':_0x389d8e}:null;}})[_0x833e('0x24')](respondWithResult(_0x68f0c7,null))[_0x833e('0x44')](handleError(_0x68f0c7,null));};exports[_0x833e('0x62')]=function(_0x24bd9c,_0x36b745,_0x40b4f2){var _0x32caa7,_0x3b9382;return db[_0x833e('0x40')]['find']({'where':{'id':_0x24bd9c[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0x36b745,null))[_0x833e('0x24')](function(_0x25e22e){if(_0x25e22e){_0x3b9382=_0x25e22e;return _0x25e22e[_0x833e('0x62')](_0x24bd9c[_0x833e('0x54')]['ids'],_['omit'](_0x24bd9c['body'],[_0x833e('0x63'),'id'])||{});}return null;})[_0x833e('0x64')](function(_0x3fb913){var _0x1f1e24;_0x32caa7=_0x3fb913||[];var _0x54e341=[];if(_0x3fb913){for(var _0x8f6c48=0x0;_0x8f6c48<_0x3fb913[_0x833e('0x47')];_0x8f6c48+=0x1){var _0x28f9a2=_0x3fb913[_0x8f6c48][_0x833e('0x25')]({'plain':!![]});_0x3b9382['dialCheckDuplicateType']=_0x24bd9c['body'][_0x833e('0x65')]?_0x24bd9c['body'][_0x833e('0x65')]:_0x3b9382[_0x833e('0x65')];switch(_0x3b9382[_0x833e('0x65')]){case _0x833e('0x66'):_0x1f1e24=squel[_0x833e('0x67')]()[_0x833e('0x68')]('cm_hopper')[_0x833e('0x69')](['phone',_0x833e('0x6a'),'ContactId',_0x833e('0x6b'),_0x833e('0x58'),_0x833e('0x52'),_0x833e('0x53')],squel[_0x833e('0x6c')]()[_0x833e('0x3f')](_0x833e('0x6d'),'phone')[_0x833e('0x3f')](_0x833e('0x6e'),'scheduledAt')[_0x833e('0x3f')]('id',_0x833e('0x6f'))[_0x833e('0x3f')](_0x28f9a2['CmListId'][_0x833e('0x70')](),'ListId')['field'](_0x24bd9c[_0x833e('0x46')]['id'][_0x833e('0x70')](),_0x833e('0x58'))[_0x833e('0x3f')](_0x833e('0x6e'),_0x833e('0x52'))['field'](_0x833e('0x6e'),_0x833e('0x53'))['from'](_0x833e('0x71'))[_0x833e('0x3a')](_0x833e('0x72'))[_0x833e('0x3a')](_0x833e('0x73'),_0x28f9a2[_0x833e('0x74')][_0x833e('0x70')]())['where'](_0x833e('0x75'))[_0x833e('0x3a')](_0x833e('0x76'),squel[_0x833e('0x6c')]()[_0x833e('0x3f')]('COALESCE(calleridnum,\x27\x27)')[_0x833e('0x77')](_0x833e('0x78'))[_0x833e('0x3a')](_0x833e('0x79'),_0x24bd9c['params']['id'][_0x833e('0x70')]()))['where'](_0x833e('0x76'),squel['select']()[_0x833e('0x3f')](_0x833e('0x7a'))['from'](_0x833e('0x7b'))[_0x833e('0x3a')]('CampaignId\x20=\x20?',_0x24bd9c[_0x833e('0x46')]['id']['toString']())))['toString']();break;case _0x833e('0x7c'):_0x1f1e24=squel[_0x833e('0x67')]()[_0x833e('0x68')]('cm_hopper')[_0x833e('0x69')](['phone','scheduledAt','ContactId','ListId','CampaignId',_0x833e('0x52'),_0x833e('0x53')],squel[_0x833e('0x6c')]()[_0x833e('0x3f')]('phone',_0x833e('0x6d'))['field'](_0x833e('0x6e'),_0x833e('0x6a'))[_0x833e('0x3f')]('id',_0x833e('0x6f'))[_0x833e('0x3f')](_0x28f9a2[_0x833e('0x74')][_0x833e('0x70')](),_0x833e('0x6b'))['field'](_0x24bd9c[_0x833e('0x46')]['id']['toString'](),_0x833e('0x58'))[_0x833e('0x3f')](_0x833e('0x6e'),'createdAt')[_0x833e('0x3f')]('NOW()','updatedAt')[_0x833e('0x77')]('cm_contacts')[_0x833e('0x3a')]('deletedAt\x20IS\x20NULL')[_0x833e('0x3a')](_0x833e('0x73'),_0x28f9a2[_0x833e('0x74')]['toString']())[_0x833e('0x3a')](_0x833e('0x75'))['where'](_0x833e('0x76'),squel[_0x833e('0x6c')]()[_0x833e('0x3f')](_0x833e('0x7a'))[_0x833e('0x77')]('cm_hopper')[_0x833e('0x3a')](_0x833e('0x79'),_0x24bd9c[_0x833e('0x46')]['id'][_0x833e('0x70')]())))[_0x833e('0x70')]();break;default:_0x1f1e24=squel[_0x833e('0x67')]()[_0x833e('0x68')](_0x833e('0x7b'))[_0x833e('0x69')]([_0x833e('0x6d'),'scheduledAt',_0x833e('0x6f'),_0x833e('0x6b'),'CampaignId',_0x833e('0x52'),'updatedAt'],squel[_0x833e('0x6c')]()[_0x833e('0x3f')]('phone','phone')['field'](_0x833e('0x6e'),'scheduledAt')[_0x833e('0x3f')]('id',_0x833e('0x6f'))['field'](_0x28f9a2[_0x833e('0x74')][_0x833e('0x70')](),'ListId')[_0x833e('0x3f')](_0x24bd9c[_0x833e('0x46')]['id'][_0x833e('0x70')](),_0x833e('0x58'))['field'](_0x833e('0x6e'),_0x833e('0x52'))[_0x833e('0x3f')](_0x833e('0x6e'),_0x833e('0x53'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x833e('0x3a')](_0x833e('0x73'),_0x28f9a2[_0x833e('0x74')]['toString']())['where'](_0x833e('0x75')))[_0x833e('0x70')]();}_0x54e341[_0x833e('0x7d')](db['sequelize']['query'](_0x1f1e24));}return BPromise[_0x833e('0x7e')](_0x54e341);}})[_0x833e('0x24')](function(){return _0x32caa7;})[_0x833e('0x24')](respondWithResult(_0x36b745,null))[_0x833e('0x44')](handleError(_0x36b745,null));};exports[_0x833e('0x7f')]=function(_0x526a6f,_0x4b1c74,_0x4e5637){var _0x1335c2;return db[_0x833e('0x40')]['find']({'where':{'id':_0x526a6f[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0x4b1c74,null))['then'](function(_0x5d5cef){if(_0x5d5cef){return _0x5d5cef[_0x833e('0x7f')](_0x526a6f[_0x833e('0x2f')][_0x833e('0x63')]);}})[_0x833e('0x24')](function(_0xbba2cd){if(_0xbba2cd){_0x1335c2=_0xbba2cd;return db[_0x833e('0x59')][_0x833e('0x27')]({'where':{'ListId':_0x526a6f[_0x833e('0x2f')]['ids'],'CampaignId':_0x526a6f['params']['id']}})[_0x833e('0x24')](function(){return _0x1335c2;});}})[_0x833e('0x24')](respondWithStatusCode(_0x4b1c74,null))[_0x833e('0x44')](handleError(_0x4b1c74,null));};exports[_0x833e('0x80')]=function(_0x5c01b9,_0x15c9de,_0x21c4ef){var _0x25a5a7={'raw':!![],'where':{}};var _0x12ff8c={};var _0x3bd06b={'count':0x0,'rows':[]};return db['Campaign'][_0x833e('0x5b')]({'where':{'id':_0x5c01b9[_0x833e('0x46')]['id']}})['then'](handleEntityNotFound(_0x15c9de,null))['then'](function(_0x35cdb0){if(_0x35cdb0){_0x12ff8c[_0x833e('0x2d')]=_[_0x833e('0x2e')](db['CmList'][_0x833e('0x2c')]);_0x12ff8c['query']=_['keys'](_0x5c01b9['query']);_0x12ff8c[_0x833e('0x37')]=_[_0x833e('0x30')](_0x12ff8c['model'],_0x12ff8c[_0x833e('0x2f')]);_0x25a5a7[_0x833e('0x31')]=_[_0x833e('0x30')](_0x12ff8c[_0x833e('0x2d')],qs['fields'](_0x5c01b9[_0x833e('0x2f')][_0x833e('0x32')]));_0x25a5a7[_0x833e('0x31')]=_0x25a5a7[_0x833e('0x31')][_0x833e('0x47')]?_0x25a5a7[_0x833e('0x31')]:_0x12ff8c[_0x833e('0x2d')];if(!_0x5c01b9['query'][_0x833e('0x33')](_0x833e('0x34'))){_0x25a5a7[_0x833e('0x1d')]=qs[_0x833e('0x1d')](_0x5c01b9[_0x833e('0x2f')][_0x833e('0x1d')]);_0x25a5a7[_0x833e('0x1c')]=qs[_0x833e('0x1c')](_0x5c01b9[_0x833e('0x2f')]['offset']);}_0x25a5a7[_0x833e('0x35')]=qs[_0x833e('0x36')](_0x5c01b9['query'][_0x833e('0x36')]);_0x25a5a7[_0x833e('0x3a')]=qs['filters'](_[_0x833e('0x38')](_0x5c01b9['query'],_0x12ff8c[_0x833e('0x37')]));_0x25a5a7[_0x833e('0x3a')][_0x833e('0x58')]=_0x35cdb0['id'];if(_0x5c01b9[_0x833e('0x2f')][_0x833e('0x39')]){_0x25a5a7[_0x833e('0x3a')]=_[_0x833e('0x3b')](_0x25a5a7[_0x833e('0x3a')],{'$or':_[_0x833e('0x3c')](_0x25a5a7[_0x833e('0x31')],function(_0x470957){var _0x4ddacf={};_0x4ddacf[_0x470957]={'$like':'%'+_0x5c01b9['query'][_0x833e('0x39')]+'%'};return _0x4ddacf;})});}_0x25a5a7=_['merge']({},_0x25a5a7,_0x5c01b9[_0x833e('0x49')]);return db[_0x833e('0x61')][_0x833e('0x1b')]({'where':_0x25a5a7[_0x833e('0x3a')]})[_0x833e('0x24')](function(_0x5a0430){_0x3bd06b[_0x833e('0x1b')]=_0x5a0430;if(_0x5c01b9['query'][_0x833e('0x48')]){_0x25a5a7[_0x833e('0x41')]=[{'all':!![]}];}return db[_0x833e('0x61')][_0x833e('0x42')](_0x25a5a7);})[_0x833e('0x24')](function(_0x102035){_0x3bd06b[_0x833e('0x43')]=_0x102035;return _0x3bd06b;});}})[_0x833e('0x24')](respondWithFilteredResult(_0x15c9de,_0x25a5a7))[_0x833e('0x44')](handleError(_0x15c9de,null));};exports[_0x833e('0x81')]=function(_0x876069,_0x119254,_0x320270){var _0x134ed9,_0x1d77ba;return db[_0x833e('0x40')][_0x833e('0x4f')]({'where':{'id':_0x876069[_0x833e('0x46')]['id']}})[_0x833e('0x24')](handleEntityNotFound(_0x119254,null))[_0x833e('0x24')](function(_0x325fe0){if(_0x325fe0){_0x1d77ba=_0x325fe0;return _0x325fe0['addBlackLists'](_0x876069[_0x833e('0x54')][_0x833e('0x63')],_[_0x833e('0x82')](_0x876069[_0x833e('0x54')],['ids','id'])||{});}return null;})[_0x833e('0x64')](function(_0x5e839d){var _0x4f902d;_0x134ed9=_0x5e839d||[];var _0x3f068f=[];if(_0x5e839d){for(var _0xca1400=0x0;_0xca1400<_0x5e839d[_0x833e('0x47')];_0xca1400+=0x1){var _0x1c1176=_0x5e839d[_0xca1400][_0x833e('0x25')]({'plain':!![]});_0x4f902d=squel[_0x833e('0x67')]()[_0x833e('0x68')]('cm_hopper_black')[_0x833e('0x69')](['phone',_0x833e('0x6f'),'ListId',_0x833e('0x58'),_0x833e('0x52'),_0x833e('0x53')],squel[_0x833e('0x6c')]()[_0x833e('0x3f')](_0x833e('0x6d'),_0x833e('0x6d'))[_0x833e('0x3f')]('id',_0x833e('0x6f'))[_0x833e('0x3f')](_0x1c1176[_0x833e('0x74')][_0x833e('0x70')](),_0x833e('0x6b'))[_0x833e('0x3f')](_0x876069[_0x833e('0x46')]['id'][_0x833e('0x70')](),_0x833e('0x58'))[_0x833e('0x3f')](_0x833e('0x6e'),_0x833e('0x52'))[_0x833e('0x3f')](_0x833e('0x6e'),_0x833e('0x53'))['from']('cm_contacts')['where'](_0x833e('0x72'))[_0x833e('0x3a')](_0x833e('0x73'),_0x1c1176[_0x833e('0x74')][_0x833e('0x70')]())[_0x833e('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x833e('0x70')]();_0x3f068f[_0x833e('0x7d')](db[_0x833e('0x83')]['query'](_0x4f902d));}return BPromise[_0x833e('0x7e')](_0x3f068f);}})[_0x833e('0x24')](function(){return _0x134ed9;})[_0x833e('0x24')](respondWithResult(_0x119254,null))[_0x833e('0x44')](handleError(_0x119254,null));};exports[_0x833e('0x84')]=function(_0x234104,_0x58e4b7,_0x2e6b73){var _0x1889d4;return db[_0x833e('0x40')]['find']({'where':{'id':_0x234104[_0x833e('0x46')]['id']}})['then'](handleEntityNotFound(_0x58e4b7,null))[_0x833e('0x24')](function(_0x309ed8){if(_0x309ed8){return _0x309ed8[_0x833e('0x84')](_0x234104[_0x833e('0x2f')][_0x833e('0x63')]);}})[_0x833e('0x24')](function(_0x2e0b22){if(_0x2e0b22){_0x1889d4=_0x2e0b22;return db[_0x833e('0x5f')][_0x833e('0x27')]({'where':{'ListId':_0x234104[_0x833e('0x2f')][_0x833e('0x63')],'CampaignId':_0x234104['params']['id']}})[_0x833e('0x24')](function(){return _0x1889d4;});}})[_0x833e('0x24')](respondWithStatusCode(_0x58e4b7,null))[_0x833e('0x44')](handleError(_0x58e4b7,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index d195e7a..ddedf3b 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 _0xf30d=['moment','bluebird','./campaign.attributes','exports','define','Campaign','lodash','util'];(function(_0x2104ad,_0x489c40){var _0x17b079=function(_0x58a79b){while(--_0x58a79b){_0x2104ad['push'](_0x2104ad['shift']());}};_0x17b079(++_0x489c40);}(_0xf30d,0xd6));var _0xdf30=function(_0x49ffa6,_0x9ba27){_0x49ffa6=_0x49ffa6-0x0;var _0x2ecf90=_0xf30d[_0x49ffa6];return _0x2ecf90;};'use strict';var _=require(_0xdf30('0x0'));var util=require(_0xdf30('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdf30('0x2'));var BPromise=require(_0xdf30('0x3'));var rp=require('request-promise');var attributes=require(_0xdf30('0x4'));module[_0xdf30('0x5')]=function(_0x521b17,_0x3f9e8c){return _0x521b17[_0xdf30('0x6')](_0xdf30('0x7'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8c9=['util','../../config/logger','api','moment','bluebird','request-promise','./campaign.attributes','exports','define','Campaign','campaigns','lodash'];(function(_0x247405,_0x390f4e){var _0x52404f=function(_0x272c5c){while(--_0x272c5c){_0x247405['push'](_0x247405['shift']());}};_0x52404f(++_0x390f4e);}(_0xe8c9,0x1c7));var _0x9e8c=function(_0x3c8006,_0x25b5e8){_0x3c8006=_0x3c8006-0x0;var _0x12b6e9=_0xe8c9[_0x3c8006];return _0x12b6e9;};'use strict';var _=require(_0x9e8c('0x0'));var util=require(_0x9e8c('0x1'));var logger=require(_0x9e8c('0x2'))(_0x9e8c('0x3'));var moment=require(_0x9e8c('0x4'));var BPromise=require(_0x9e8c('0x5'));var rp=require(_0x9e8c('0x6'));var attributes=require(_0x9e8c('0x7'));module[_0x9e8c('0x8')]=function(_0x2e7913,_0x15f1b6){return _0x2e7913[_0x9e8c('0x9')](_0x9e8c('0xa'),attributes,{'tableName':_0x9e8c('0xb'),'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 d10afed..d5855e5 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 _0xf8be=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','bluebird'];(function(_0x4361b0,_0x242cda){var _0x2cd624=function(_0x10bb1a){while(--_0x10bb1a){_0x4361b0['push'](_0x4361b0['shift']());}};_0x2cd624(++_0x242cda);}(_0xf8be,0x146));var _0xef8b=function(_0x401b7e,_0x11c4d3){_0x401b7e=_0x401b7e-0x0;var _0x9ad042=_0xf8be[_0x401b7e];return _0x9ad042;};'use strict';var _=require(_0xef8b('0x0'));var util=require(_0xef8b('0x1'));var moment=require(_0xef8b('0x2'));var BPromise=require(_0xef8b('0x3'));var rs=require(_0xef8b('0x4'));var fs=require('fs');var Redis=require(_0xef8b('0x5'));var db=require(_0xef8b('0x6'))['db'];var utils=require(_0xef8b('0x7'));var logger=require(_0xef8b('0x8'))(_0xef8b('0x9'));var config=require('../../config/environment');var jayson=require(_0xef8b('0xa'));var client=jayson['client'][_0xef8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3924c1,_0x537df9,_0x1ea0e8){return new BPromise(function(_0x195ad3,_0x1f85b9){return client[_0xef8b('0xc')](_0x3924c1,_0x1ea0e8)[_0xef8b('0xd')](function(_0xe049a8){logger[_0xef8b('0xe')](_0xef8b('0xf'),_0x537df9,_0xef8b('0x10'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x537df9,_0xef8b('0x10'),JSON[_0xef8b('0x11')](_0xe049a8));if(_0xe049a8['error']){if(_0xe049a8['error'][_0xef8b('0x12')]===0x1f4){logger[_0xef8b('0x13')]('Campaign,\x20%s,\x20%s',_0x537df9,_0xe049a8['error']['message']);return _0x1f85b9(_0xe049a8['error'][_0xef8b('0x14')]);}logger[_0xef8b('0x13')](_0xef8b('0xf'),_0x537df9,_0xe049a8['error'][_0xef8b('0x14')]);return _0x195ad3(_0xe049a8['error']['message']);}else{logger[_0xef8b('0xe')]('Campaign,\x20%s,\x20%s',_0x537df9,_0xef8b('0x10'));_0x195ad3(_0xe049a8['result'][_0xef8b('0x14')]);}})[_0xef8b('0x15')](function(_0x16728f){logger[_0xef8b('0x13')](_0xef8b('0xf'),_0x537df9,_0x16728f);_0x1f85b9(_0x16728f);});});}exports['GetCampaign']=function(_0xf421ce){var _0x4b1b78=this;return new Promise(function(_0x3ebdc2,_0x9040c9){return db[_0xef8b('0x16')][_0xef8b('0x17')]({'raw':_0xf421ce[_0xef8b('0x18')]?_0xf421ce[_0xef8b('0x18')][_0xef8b('0x19')]===undefined?!![]:![]:!![],'where':_0xf421ce['options']?_0xf421ce[_0xef8b('0x18')][_0xef8b('0x1a')]||null:null,'attributes':_0xf421ce[_0xef8b('0x18')]?_0xf421ce[_0xef8b('0x18')][_0xef8b('0x1b')]||null:null,'limit':_0xf421ce[_0xef8b('0x18')]?_0xf421ce['options'][_0xef8b('0x1c')]||null:null,'include':_0xf421ce[_0xef8b('0x18')]?_0xf421ce[_0xef8b('0x18')][_0xef8b('0x1d')]?_[_0xef8b('0x1e')](_0xf421ce[_0xef8b('0x18')][_0xef8b('0x1d')],function(_0x418989){return{'model':db[_0x418989[_0xef8b('0x1f')]],'as':_0x418989['as'],'attributes':_0x418989['attributes'],'include':_0x418989[_0xef8b('0x1d')]?_[_0xef8b('0x1e')](_0x418989[_0xef8b('0x1d')],function(_0x353766){return{'model':db[_0x353766['model']],'as':_0x353766['as'],'attributes':_0x353766['attributes'],'include':_0x353766[_0xef8b('0x1d')]?_[_0xef8b('0x1e')](_0x353766[_0xef8b('0x1d')],function(_0x353ea1){return{'model':db[_0x353ea1['model']],'as':_0x353ea1['as'],'attributes':_0x353ea1[_0xef8b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xef8b('0xd')](function(_0x18459b){logger[_0xef8b('0xe')](_0xef8b('0x20'),_0xf421ce);logger['debug']('GetCampaign',_0xf421ce,JSON[_0xef8b('0x11')](_0x18459b));_0x3ebdc2(_0x18459b);})['catch'](function(_0x240a02){logger[_0xef8b('0x13')](_0xef8b('0x20'),_0x240a02[_0xef8b('0x14')],_0xf421ce);_0x9040c9(_0x4b1b78[_0xef8b('0x13')](0x1f4,_0x240a02[_0xef8b('0x14')]));});});}; \ No newline at end of file +var _0xc969=['error','code','message','info','result','catch','GetCampaign','findAll','options','raw','where','limit','include','map','attributes','model','debug','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s'];(function(_0x3760fe,_0x2a58ee){var _0x5434a9=function(_0x4c0932){while(--_0x4c0932){_0x3760fe['push'](_0x3760fe['shift']());}};_0x5434a9(++_0x2a58ee);}(_0xc969,0x15c));var _0x9c96=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xc969[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x9c96('0x0'));var util=require(_0x9c96('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9c96('0x2'));var fs=require('fs');var Redis=require(_0x9c96('0x3'));var db=require(_0x9c96('0x4'))['db'];var utils=require(_0x9c96('0x5'));var logger=require(_0x9c96('0x6'))(_0x9c96('0x7'));var config=require(_0x9c96('0x8'));var jayson=require(_0x9c96('0x9'));var client=jayson['client'][_0x9c96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e1cfc,_0x1133ef,_0xc95cf8){return new BPromise(function(_0x5da657,_0x2e5a9b){return client['request'](_0x5e1cfc,_0xc95cf8)[_0x9c96('0xb')](function(_0x4cf60d){logger['info'](_0x9c96('0xc'),_0x1133ef,_0x9c96('0xd'));logger['debug'](_0x9c96('0xe'),_0x1133ef,_0x9c96('0xd'),JSON['stringify'](_0x4cf60d));if(_0x4cf60d[_0x9c96('0xf')]){if(_0x4cf60d[_0x9c96('0xf')][_0x9c96('0x10')]===0x1f4){logger[_0x9c96('0xf')]('Campaign,\x20%s,\x20%s',_0x1133ef,_0x4cf60d[_0x9c96('0xf')]['message']);return _0x2e5a9b(_0x4cf60d[_0x9c96('0xf')][_0x9c96('0x11')]);}logger[_0x9c96('0xf')]('Campaign,\x20%s,\x20%s',_0x1133ef,_0x4cf60d['error'][_0x9c96('0x11')]);return _0x5da657(_0x4cf60d[_0x9c96('0xf')][_0x9c96('0x11')]);}else{logger[_0x9c96('0x12')](_0x9c96('0xc'),_0x1133ef,'request\x20sent');_0x5da657(_0x4cf60d[_0x9c96('0x13')][_0x9c96('0x11')]);}})[_0x9c96('0x14')](function(_0x3578f3){logger[_0x9c96('0xf')]('Campaign,\x20%s,\x20%s',_0x1133ef,_0x3578f3);_0x2e5a9b(_0x3578f3);});});}exports[_0x9c96('0x15')]=function(_0x22df09){var _0x4416e4=this;return new Promise(function(_0x259216,_0x2334b4){return db['Campaign'][_0x9c96('0x16')]({'raw':_0x22df09[_0x9c96('0x17')]?_0x22df09[_0x9c96('0x17')][_0x9c96('0x18')]===undefined?!![]:![]:!![],'where':_0x22df09[_0x9c96('0x17')]?_0x22df09[_0x9c96('0x17')][_0x9c96('0x19')]||null:null,'attributes':_0x22df09[_0x9c96('0x17')]?_0x22df09[_0x9c96('0x17')]['attributes']||null:null,'limit':_0x22df09[_0x9c96('0x17')]?_0x22df09['options'][_0x9c96('0x1a')]||null:null,'include':_0x22df09[_0x9c96('0x17')]?_0x22df09[_0x9c96('0x17')][_0x9c96('0x1b')]?_[_0x9c96('0x1c')](_0x22df09[_0x9c96('0x17')]['include'],function(_0x3657b0){return{'model':db[_0x3657b0['model']],'as':_0x3657b0['as'],'attributes':_0x3657b0[_0x9c96('0x1d')],'include':_0x3657b0[_0x9c96('0x1b')]?_[_0x9c96('0x1c')](_0x3657b0['include'],function(_0x26ab92){return{'model':db[_0x26ab92[_0x9c96('0x1e')]],'as':_0x26ab92['as'],'attributes':_0x26ab92['attributes'],'include':_0x26ab92[_0x9c96('0x1b')]?_[_0x9c96('0x1c')](_0x26ab92['include'],function(_0x1564f0){return{'model':db[_0x1564f0[_0x9c96('0x1e')]],'as':_0x1564f0['as'],'attributes':_0x1564f0[_0x9c96('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9c96('0xb')](function(_0x19dafb){logger[_0x9c96('0x12')](_0x9c96('0x15'),_0x22df09);logger[_0x9c96('0x1f')]('GetCampaign',_0x22df09,JSON[_0x9c96('0x20')](_0x19dafb));_0x259216(_0x19dafb);})[_0x9c96('0x14')](function(_0x5658e3){logger[_0x9c96('0xf')](_0x9c96('0x15'),_0x5658e3[_0x9c96('0x11')],_0x22df09);_0x2334b4(_0x4416e4['error'](0x1f4,_0x5658e3['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 0417d97..b227a75 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 _0xadd7=['removeLists','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists','addBlackLists','put','update','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xadd7,0x1d0));var _0x7add=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xadd7[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x7add('0x0'));var util=require(_0x7add('0x1'));var path=require(_0x7add('0x2'));var timeout=require('connect-timeout');var express=require(_0x7add('0x3'));var router=express['Router']();var auth=require(_0x7add('0x4'));var interaction=require(_0x7add('0x5'));var config=require(_0x7add('0x6'));var controller=require(_0x7add('0x7'));router[_0x7add('0x8')]('/',auth['isAuthenticated'](),controller[_0x7add('0x9')]);router[_0x7add('0x8')](_0x7add('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7add('0x8')](_0x7add('0xb'),auth[_0x7add('0xc')](),controller[_0x7add('0xd')]);router[_0x7add('0x8')]('/:id/hopper_histories',auth[_0x7add('0xc')](),controller[_0x7add('0xe')]);router[_0x7add('0x8')](_0x7add('0xf'),auth['isAuthenticated'](),controller[_0x7add('0x10')]);router[_0x7add('0x8')](_0x7add('0x11'),auth[_0x7add('0xc')](),controller[_0x7add('0x12')]);router[_0x7add('0x8')](_0x7add('0x13'),auth['isAuthenticated'](),controller[_0x7add('0x14')]);router['get'](_0x7add('0x15'),auth[_0x7add('0xc')](),controller[_0x7add('0x16')]);router[_0x7add('0x17')]('/',auth[_0x7add('0xc')](),controller['create']);router['post']('/:id/clone',auth[_0x7add('0xc')](),controller[_0x7add('0x18')]);router[_0x7add('0x17')](_0x7add('0x13'),auth[_0x7add('0xc')](),controller[_0x7add('0x19')]);router['post'](_0x7add('0x15'),auth[_0x7add('0xc')](),controller[_0x7add('0x1a')]);router[_0x7add('0x1b')]('/:id',auth[_0x7add('0xc')](),controller[_0x7add('0x1c')]);router[_0x7add('0x1d')](_0x7add('0xa'),auth['isAuthenticated'](),controller[_0x7add('0x1e')]);router[_0x7add('0x1d')]('/:id/lists',auth[_0x7add('0xc')](),controller[_0x7add('0x1f')]);router[_0x7add('0x1d')](_0x7add('0x15'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x7add('0x20')]=router; \ No newline at end of file +var _0x04bd=['isAuthenticated','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addBlackLists','delete','destroy','removeBlackLists','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x546736,_0x57b82c){var _0x3a6199=function(_0x10cb0d){while(--_0x10cb0d){_0x546736['push'](_0x546736['shift']());}};_0x3a6199(++_0x57b82c);}(_0x04bd,0x184));var _0xd04b=function(_0x158fa4,_0x537964){_0x158fa4=_0x158fa4-0x0;var _0x3a5881=_0x04bd[_0x158fa4];return _0x3a5881;};'use strict';var multer=require(_0xd04b('0x0'));var util=require(_0xd04b('0x1'));var path=require(_0xd04b('0x2'));var timeout=require(_0xd04b('0x3'));var express=require('express');var router=express[_0xd04b('0x4')]();var auth=require(_0xd04b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd04b('0x6'));var controller=require(_0xd04b('0x7'));router[_0xd04b('0x8')]('/',auth['isAuthenticated'](),controller[_0xd04b('0x9')]);router[_0xd04b('0x8')](_0xd04b('0xa'),auth['isAuthenticated'](),controller[_0xd04b('0xb')]);router[_0xd04b('0x8')](_0xd04b('0xc'),auth['isAuthenticated'](),controller[_0xd04b('0xd')]);router[_0xd04b('0x8')](_0xd04b('0xe'),auth[_0xd04b('0xf')](),controller['getHopperHistories']);router[_0xd04b('0x8')](_0xd04b('0x10'),auth[_0xd04b('0xf')](),controller[_0xd04b('0x11')]);router['get'](_0xd04b('0x12'),auth[_0xd04b('0xf')](),controller[_0xd04b('0x13')]);router[_0xd04b('0x8')](_0xd04b('0x14'),auth[_0xd04b('0xf')](),controller[_0xd04b('0x15')]);router[_0xd04b('0x8')](_0xd04b('0x16'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xd04b('0x17')]('/',auth[_0xd04b('0xf')](),controller[_0xd04b('0x18')]);router[_0xd04b('0x17')](_0xd04b('0x19'),auth['isAuthenticated'](),controller[_0xd04b('0x1a')]);router['post'](_0xd04b('0x14'),auth[_0xd04b('0xf')](),controller['addLists']);router[_0xd04b('0x17')]('/:id/blacklists',auth[_0xd04b('0xf')](),controller[_0xd04b('0x1b')]);router['put']('/:id',auth[_0xd04b('0xf')](),controller['update']);router[_0xd04b('0x1c')](_0xd04b('0xa'),auth[_0xd04b('0xf')](),controller[_0xd04b('0x1d')]);router[_0xd04b('0x1c')](_0xd04b('0x14'),auth[_0xd04b('0xf')](),controller['removeLists']);router[_0xd04b('0x1c')](_0xd04b('0x16'),auth['isAuthenticated'](),controller[_0xd04b('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 5c5d1a0..b0c9cac 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 _0x7bf1=['TEXT','getDataValue','key','sequelize','STRING'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x7bf1,0x12f));var _0x17bf=function(_0x13a78b,_0x171395){_0x13a78b=_0x13a78b-0x0;var _0x3de69d=_0x7bf1[_0x13a78b];return _0x3de69d;};'use strict';var Sequelize=require(_0x17bf('0x0'));module['exports']={'key':{'type':Sequelize[_0x17bf('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x17bf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x17bf('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x17bf('0x3')](_0x17bf('0x4'));}}}; \ No newline at end of file +var _0xfb7d=['exports','TEXT','STRING','VIRTUAL','getDataValue','key'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfb7d,0x120));var _0xdfb7=function(_0x2a2a23,_0xb9e0d8){_0x2a2a23=_0x2a2a23-0x0;var _0x5e6cd9=_0xfb7d[_0x2a2a23];return _0x5e6cd9;};'use strict';var Sequelize=require('sequelize');module[_0xdfb7('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xdfb7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdfb7('0x2')]},'name':{'type':Sequelize[_0xdfb7('0x3')],'get':function(){return this[_0xdfb7('0x4')](_0xdfb7('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 3a08634..9611bcc 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 _0x3df2=['The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','CannedAnswer','count','includeAll','include','rows','catch','params','length','options','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId'];(function(_0x3ea49f,_0x42d1ad){var _0x41fedb=function(_0x22f831){while(--_0x22f831){_0x3ea49f['push'](_0x3ea49f['shift']());}};_0x41fedb(++_0x42d1ad);}(_0x3df2,0x1af));var _0x23df=function(_0x1197a2,_0x45ac1c){_0x1197a2=_0x1197a2-0x0;var _0x1e76b6=_0x3df2[_0x1197a2];return _0x1e76b6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x23df('0x0'));var rimraf=require(_0x23df('0x1'));var zipdir=require(_0x23df('0x2'));var jsonpatch=require(_0x23df('0x3'));var rp=require(_0x23df('0x4'));var moment=require(_0x23df('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x23df('0x6'));var util=require(_0x23df('0x7'));var path=require(_0x23df('0x8'));var sox=require(_0x23df('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x23df('0xa'));var squel=require(_0x23df('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x23df('0xc'));var toCsv=require(_0x23df('0xd'));var querystring=require(_0x23df('0xe'));var Papa=require(_0x23df('0xf'));var authService=require(_0x23df('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x23df('0x11'));var qs=require(_0x23df('0x12'));var logger=require(_0x23df('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x23df('0x14'));var db=require(_0x23df('0x15'))['db'];function respondWithStatusCode(_0x5ed5a4,_0x45586e){_0x45586e=_0x45586e||0xcc;return function(_0x168079){if(_0x168079){return _0x5ed5a4['sendStatus'](_0x45586e);}return _0x5ed5a4[_0x23df('0x16')](_0x45586e)[_0x23df('0x17')]();};}function respondWithResult(_0x509c0b,_0x4a47ef){_0x4a47ef=_0x4a47ef||0xc8;return function(_0x35b6f6){if(_0x35b6f6){return _0x509c0b[_0x23df('0x16')](_0x4a47ef)[_0x23df('0x18')](_0x35b6f6);}};}function respondWithFilteredResult(_0x33342e,_0x91f4ca){return function(_0x35b23f){if(_0x35b23f){var _0x4ca4a8=_0x35b23f['count'],_0x7b801a=_0x91f4ca[_0x23df('0x19')],_0x5793c7=_0x91f4ca[_0x23df('0x19')]+_0x91f4ca[_0x23df('0x1a')],_0x5da26e;if(_0x5793c7>=_0x4ca4a8){_0x5793c7=_0x4ca4a8;_0x5da26e=0xc8;}else{_0x5da26e=0xce;}_0x33342e[_0x23df('0x16')](_0x5da26e);return _0x33342e[_0x23df('0x1b')](_0x23df('0x1c'),_0x7b801a+'-'+_0x5793c7+'/'+_0x4ca4a8)[_0x23df('0x18')](_0x35b23f);}return null;};}function patchUpdates(_0x1336c0){return function(_0x18dafc){try{jsonpatch['apply'](_0x18dafc,_0x1336c0,!![]);}catch(_0x3d6643){return BPromise[_0x23df('0x1d')](_0x3d6643);}return _0x18dafc[_0x23df('0x1e')]();};}function saveUpdates(_0x1cbd5b,_0x417600){return function(_0x1c7b59){if(_0x1c7b59){return _0x1c7b59['update'](_0x1cbd5b)[_0x23df('0x1f')](function(_0x988e98){return _0x988e98;});}return null;};}function removeEntity(_0x32d578,_0x5a2682){return function(_0x563c02){if(_0x563c02){return _0x563c02[_0x23df('0x20')]()[_0x23df('0x1f')](function(){var _0x44830a=_0x563c02[_0x23df('0x21')]({'plain':!![]});var _0x48f932=_0x23df('0x22');return db[_0x23df('0x23')][_0x23df('0x20')]({'where':{'type':_0x48f932,'resourceId':_0x44830a['id']}})[_0x23df('0x1f')](function(){return _0x563c02;});})['then'](function(){_0x32d578[_0x23df('0x16')](0xcc)[_0x23df('0x17')]();});}};}function handleEntityNotFound(_0x451afd,_0x86760e){return function(_0x399439){if(!_0x399439){_0x451afd[_0x23df('0x24')](0x194);}return _0x399439;};}function handleError(_0x4d59bc,_0x5207c8){_0x5207c8=_0x5207c8||0x1f4;return function(_0x135cc2){logger[_0x23df('0x25')](_0x135cc2[_0x23df('0x26')]);if(_0x135cc2['name']){delete _0x135cc2[_0x23df('0x27')];}_0x4d59bc[_0x23df('0x16')](_0x5207c8)[_0x23df('0x28')](_0x135cc2);};}exports[_0x23df('0x29')]=function(_0x1ebd5b,_0xc87b69){var _0x478d1a={},_0x2d3a2a={},_0x3e6e00={'count':0x0,'rows':[]};var _0x5f7ef3=db['CannedAnswer'][_0x23df('0x2a')];_0x2d3a2a[_0x23df('0x2b')]=_[_0x23df('0x2c')](_0x5f7ef3);_0x2d3a2a[_0x23df('0x2d')]=_[_0x23df('0x2c')](_0x1ebd5b[_0x23df('0x2d')]);_0x2d3a2a[_0x23df('0x2e')]=_[_0x23df('0x2f')](_0x2d3a2a[_0x23df('0x2b')],_0x2d3a2a[_0x23df('0x2d')]);_0x478d1a['attributes']=_[_0x23df('0x2f')](_0x2d3a2a['model'],qs[_0x23df('0x30')](_0x1ebd5b['query']['fields']));_0x478d1a[_0x23df('0x31')]=_0x478d1a[_0x23df('0x31')]['length']?_0x478d1a[_0x23df('0x31')]:_0x2d3a2a[_0x23df('0x2b')];if(!_0x1ebd5b[_0x23df('0x2d')][_0x23df('0x32')](_0x23df('0x33'))){_0x478d1a[_0x23df('0x1a')]=qs[_0x23df('0x1a')](_0x1ebd5b[_0x23df('0x2d')][_0x23df('0x1a')]);_0x478d1a[_0x23df('0x19')]=qs[_0x23df('0x19')](_0x1ebd5b[_0x23df('0x2d')][_0x23df('0x19')]);}_0x478d1a[_0x23df('0x34')]=qs[_0x23df('0x35')](_0x1ebd5b[_0x23df('0x2d')]['sort']);_0x478d1a[_0x23df('0x36')]=qs[_0x23df('0x2e')](_[_0x23df('0x37')](_0x1ebd5b[_0x23df('0x2d')],_0x2d3a2a[_0x23df('0x2e')]));if(_0x1ebd5b['query'][_0x23df('0x38')]){_0x478d1a['where']=_[_0x23df('0x39')](_0x478d1a[_0x23df('0x36')],{'$or':_[_0x23df('0x3a')](_0x5f7ef3,function(_0x1009e5){if(_0x1009e5['type'][_0x23df('0x3b')]!==_0x23df('0x3c')){var _0x38dea4={};_0x38dea4[_0x1009e5[_0x23df('0x3d')]]={'$like':'%'+_0x1ebd5b[_0x23df('0x2d')][_0x23df('0x38')]+'%'};return _0x38dea4;}})});}_0x478d1a=_[_0x23df('0x39')]({},_0x478d1a,_0x1ebd5b['options']);var _0xf5a7a7={'where':_0x478d1a['where']};return db[_0x23df('0x3e')][_0x23df('0x3f')](_0xf5a7a7)[_0x23df('0x1f')](function(_0x4bbafa){_0x3e6e00[_0x23df('0x3f')]=_0x4bbafa;if(_0x1ebd5b['query'][_0x23df('0x40')]){_0x478d1a[_0x23df('0x41')]=[{'all':!![]}];}return db[_0x23df('0x3e')]['findAll'](_0x478d1a);})[_0x23df('0x1f')](function(_0x2d6702){_0x3e6e00[_0x23df('0x42')]=_0x2d6702;return _0x3e6e00;})[_0x23df('0x1f')](respondWithFilteredResult(_0xc87b69,_0x478d1a))[_0x23df('0x43')](handleError(_0xc87b69,null));};exports['show']=function(_0x35864c,_0x4dae3a){var _0x4d7105={'raw':!![],'where':{'id':_0x35864c[_0x23df('0x44')]['id']}},_0x47dd13={};_0x47dd13[_0x23df('0x2b')]=_[_0x23df('0x2c')](db[_0x23df('0x3e')][_0x23df('0x2a')]);_0x47dd13['query']=_[_0x23df('0x2c')](_0x35864c[_0x23df('0x2d')]);_0x47dd13[_0x23df('0x2e')]=_['intersection'](_0x47dd13['model'],_0x47dd13[_0x23df('0x2d')]);_0x4d7105[_0x23df('0x31')]=_[_0x23df('0x2f')](_0x47dd13[_0x23df('0x2b')],qs[_0x23df('0x30')](_0x35864c[_0x23df('0x2d')]['fields']));_0x4d7105['attributes']=_0x4d7105[_0x23df('0x31')][_0x23df('0x45')]?_0x4d7105[_0x23df('0x31')]:_0x47dd13[_0x23df('0x2b')];if(_0x35864c[_0x23df('0x2d')]['includeAll']){_0x4d7105[_0x23df('0x41')]=[{'all':!![]}];}_0x4d7105=_[_0x23df('0x39')]({},_0x4d7105,_0x35864c[_0x23df('0x46')]);return db[_0x23df('0x3e')]['find'](_0x4d7105)['then'](handleEntityNotFound(_0x4dae3a,null))[_0x23df('0x1f')](respondWithResult(_0x4dae3a,null))[_0x23df('0x43')](handleError(_0x4dae3a,null));};exports[_0x23df('0x47')]=function(_0x1e76f6,_0x2583b3){if(_0x1e76f6[_0x23df('0x48')]['id']){delete _0x1e76f6[_0x23df('0x48')]['id'];}return db[_0x23df('0x3e')][_0x23df('0x49')]({'where':{'id':_0x1e76f6['params']['id']}})['then'](handleEntityNotFound(_0x2583b3,null))[_0x23df('0x1f')](saveUpdates(_0x1e76f6[_0x23df('0x48')],null))['then'](respondWithResult(_0x2583b3,null))['catch'](handleError(_0x2583b3,null));};exports[_0x23df('0x20')]=function(_0x55ca96,_0x14c93a){return db[_0x23df('0x3e')][_0x23df('0x49')]({'where':{'id':_0x55ca96[_0x23df('0x44')]['id']}})[_0x23df('0x1f')](handleEntityNotFound(_0x14c93a,null))[_0x23df('0x1f')](removeEntity(_0x14c93a,null))[_0x23df('0x43')](handleError(_0x14c93a,null));};exports[_0x23df('0x4a')]=function(_0x401dd4,_0x274176){var _0x5a7835={'key':_0x401dd4[_0x23df('0x48')][_0x23df('0x3b')]};if(_0x401dd4[_0x23df('0x48')][_0x23df('0x4b')]){_0x5a7835['MailAccountId']=_0x401dd4[_0x23df('0x48')][_0x23df('0x4b')];}else if(_0x401dd4['body'][_0x23df('0x4c')]){_0x5a7835['SmsAccountId']=_0x401dd4[_0x23df('0x48')][_0x23df('0x4c')];}else if(_0x401dd4['body'][_0x23df('0x4d')]){_0x5a7835[_0x23df('0x4d')]=_0x401dd4['body'][_0x23df('0x4d')];}else if(_0x401dd4[_0x23df('0x48')][_0x23df('0x4e')]){_0x5a7835['ChatWebsiteId']=_0x401dd4[_0x23df('0x48')][_0x23df('0x4e')];}return db[_0x23df('0x3e')][_0x23df('0x49')]({'where':_0x5a7835})[_0x23df('0x1f')](function(_0x515c50){if(_0x515c50){throw new db['Sequelize']['ValidationError'](_0x23df('0x4f'));}return db[_0x23df('0x3e')][_0x23df('0x4a')](_0x401dd4[_0x23df('0x48')]);})['then'](function(_0x15c772){var _0x3e6d68=_0x401dd4[_0x23df('0x50')]['get']({'plain':!![]});if(!_0x3e6d68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e6d68[_0x23df('0x51')]===_0x23df('0x50')){var _0x2c7ed4=_0x15c772[_0x23df('0x21')]({'plain':!![]});return db[_0x23df('0x52')][_0x23df('0x49')]({'where':{'name':_0x23df('0x22'),'userProfileId':_0x3e6d68[_0x23df('0x53')]},'raw':!![]})['then'](function(_0x5197dd){if(_0x5197dd&&_0x5197dd['autoAssociation']===0x0){return db[_0x23df('0x23')]['create']({'name':_0x2c7ed4[_0x23df('0x27')],'resourceId':_0x2c7ed4['id'],'type':_0x5197dd[_0x23df('0x27')],'sectionId':_0x5197dd['id']},{})[_0x23df('0x1f')](function(){return _0x15c772;});}else{return _0x15c772;}})['catch'](function(_0x46e1a9){logger[_0x23df('0x25')](_0x23df('0x54'),_0x46e1a9);throw _0x46e1a9;});}return _0x15c772;})[_0x23df('0x1f')](respondWithResult(_0x274176,0xc9))[_0x23df('0x43')](handleError(_0x274176,null));}; \ No newline at end of file +var _0x8e9d=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','end','error','stack','name','send','index','CannedAnswer','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','show','params','options','body','find','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x44ae0f,_0x57de66){var _0x5b6909=function(_0x5b1c0f){while(--_0x5b1c0f){_0x44ae0f['push'](_0x44ae0f['shift']());}};_0x5b6909(++_0x57de66);}(_0x8e9d,0x1bc));var _0xd8e9=function(_0x2f950d,_0x2dc6fc){_0x2f950d=_0x2f950d-0x0;var _0x526c06=_0x8e9d[_0x2f950d];return _0x526c06;};'use strict';var pdf=require(_0xd8e9('0x0'));var emlformat=require(_0xd8e9('0x1'));var rimraf=require(_0xd8e9('0x2'));var zipdir=require(_0xd8e9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8e9('0x4'));var moment=require('moment');var BPromise=require(_0xd8e9('0x5'));var Mustache=require(_0xd8e9('0x6'));var util=require(_0xd8e9('0x7'));var path=require(_0xd8e9('0x8'));var sox=require(_0xd8e9('0x9'));var csv=require(_0xd8e9('0xa'));var ejs=require(_0xd8e9('0xb'));var fs=require('fs');var _=require(_0xd8e9('0xc'));var squel=require('squel');var crypto=require(_0xd8e9('0xd'));var jsforce=require(_0xd8e9('0xe'));var deskjs=require(_0xd8e9('0xf'));var toCsv=require(_0xd8e9('0xa'));var querystring=require(_0xd8e9('0x10'));var Papa=require(_0xd8e9('0x11'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xd8e9('0x12'));var qs=require(_0xd8e9('0x13'));var logger=require(_0xd8e9('0x14'))('api');var utils=require(_0xd8e9('0x15'));var config=require(_0xd8e9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41d9a3,_0x5d3b08){_0x5d3b08=_0x5d3b08||0xcc;return function(_0x17f63d){if(_0x17f63d){return _0x41d9a3[_0xd8e9('0x17')](_0x5d3b08);}return _0x41d9a3[_0xd8e9('0x18')](_0x5d3b08)['end']();};}function respondWithResult(_0x186892,_0x10c289){_0x10c289=_0x10c289||0xc8;return function(_0x585a8d){if(_0x585a8d){return _0x186892['status'](_0x10c289)[_0xd8e9('0x19')](_0x585a8d);}};}function respondWithFilteredResult(_0x1530e1,_0x3fa3f4){return function(_0x30c8c0){if(_0x30c8c0){var _0x5b4feb=_0x30c8c0[_0xd8e9('0x1a')],_0x58c2bb=_0x3fa3f4['offset'],_0x1527d5=_0x3fa3f4[_0xd8e9('0x1b')]+_0x3fa3f4[_0xd8e9('0x1c')],_0x5a33c9;if(_0x1527d5>=_0x5b4feb){_0x1527d5=_0x5b4feb;_0x5a33c9=0xc8;}else{_0x5a33c9=0xce;}_0x1530e1['status'](_0x5a33c9);return _0x1530e1[_0xd8e9('0x1d')](_0xd8e9('0x1e'),_0x58c2bb+'-'+_0x1527d5+'/'+_0x5b4feb)[_0xd8e9('0x19')](_0x30c8c0);}return null;};}function patchUpdates(_0x4f2d7e){return function(_0x2fe171){try{jsonpatch[_0xd8e9('0x1f')](_0x2fe171,_0x4f2d7e,!![]);}catch(_0x47a2c5){return BPromise[_0xd8e9('0x20')](_0x47a2c5);}return _0x2fe171[_0xd8e9('0x21')]();};}function saveUpdates(_0x356a66,_0x5a10a5){return function(_0x153d2e){if(_0x153d2e){return _0x153d2e[_0xd8e9('0x22')](_0x356a66)[_0xd8e9('0x23')](function(_0x523687){return _0x523687;});}return null;};}function removeEntity(_0x27b6c7,_0xc9859a){return function(_0x2056ff){if(_0x2056ff){return _0x2056ff['destroy']()[_0xd8e9('0x23')](function(){var _0x1c6099=_0x2056ff[_0xd8e9('0x24')]({'plain':!![]});var _0x38003f=_0xd8e9('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x38003f,'resourceId':_0x1c6099['id']}})[_0xd8e9('0x23')](function(){return _0x2056ff;});})[_0xd8e9('0x23')](function(){_0x27b6c7[_0xd8e9('0x18')](0xcc)[_0xd8e9('0x26')]();});}};}function handleEntityNotFound(_0x14cff2,_0x27f985){return function(_0xd69257){if(!_0xd69257){_0x14cff2[_0xd8e9('0x17')](0x194);}return _0xd69257;};}function handleError(_0x7ddaad,_0x2ac2c1){_0x2ac2c1=_0x2ac2c1||0x1f4;return function(_0x889114){logger[_0xd8e9('0x27')](_0x889114[_0xd8e9('0x28')]);if(_0x889114[_0xd8e9('0x29')]){delete _0x889114[_0xd8e9('0x29')];}_0x7ddaad['status'](_0x2ac2c1)[_0xd8e9('0x2a')](_0x889114);};}exports[_0xd8e9('0x2b')]=function(_0x3df902,_0x2f6e86){var _0x131099={},_0x37d024={},_0x29c534={'count':0x0,'rows':[]};var _0xaab913=db[_0xd8e9('0x2c')]['rawAttributes'];_0x37d024[_0xd8e9('0x2d')]=_[_0xd8e9('0x2e')](_0xaab913);_0x37d024[_0xd8e9('0x2f')]=_[_0xd8e9('0x2e')](_0x3df902['query']);_0x37d024[_0xd8e9('0x30')]=_[_0xd8e9('0x31')](_0x37d024[_0xd8e9('0x2d')],_0x37d024['query']);_0x131099[_0xd8e9('0x32')]=_[_0xd8e9('0x31')](_0x37d024['model'],qs[_0xd8e9('0x33')](_0x3df902[_0xd8e9('0x2f')][_0xd8e9('0x33')]));_0x131099[_0xd8e9('0x32')]=_0x131099[_0xd8e9('0x32')][_0xd8e9('0x34')]?_0x131099['attributes']:_0x37d024[_0xd8e9('0x2d')];if(!_0x3df902['query'][_0xd8e9('0x35')](_0xd8e9('0x36'))){_0x131099[_0xd8e9('0x1c')]=qs[_0xd8e9('0x1c')](_0x3df902[_0xd8e9('0x2f')]['limit']);_0x131099[_0xd8e9('0x1b')]=qs['offset'](_0x3df902[_0xd8e9('0x2f')]['offset']);}_0x131099[_0xd8e9('0x37')]=qs['sort'](_0x3df902['query'][_0xd8e9('0x38')]);_0x131099[_0xd8e9('0x39')]=qs[_0xd8e9('0x30')](_[_0xd8e9('0x3a')](_0x3df902[_0xd8e9('0x2f')],_0x37d024['filters']));if(_0x3df902[_0xd8e9('0x2f')][_0xd8e9('0x3b')]){_0x131099[_0xd8e9('0x39')]=_['merge'](_0x131099['where'],{'$or':_[_0xd8e9('0x3c')](_0xaab913,function(_0x47c851){if(_0x47c851[_0xd8e9('0x3d')][_0xd8e9('0x3e')]!==_0xd8e9('0x3f')){var _0x20c76b={};_0x20c76b[_0x47c851[_0xd8e9('0x40')]]={'$like':'%'+_0x3df902[_0xd8e9('0x2f')][_0xd8e9('0x3b')]+'%'};return _0x20c76b;}})});}_0x131099=_[_0xd8e9('0x41')]({},_0x131099,_0x3df902['options']);var _0x407a90={'where':_0x131099[_0xd8e9('0x39')]};return db[_0xd8e9('0x2c')][_0xd8e9('0x1a')](_0x407a90)[_0xd8e9('0x23')](function(_0x5eed48){_0x29c534[_0xd8e9('0x1a')]=_0x5eed48;if(_0x3df902[_0xd8e9('0x2f')][_0xd8e9('0x42')]){_0x131099[_0xd8e9('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd8e9('0x44')](_0x131099);})[_0xd8e9('0x23')](function(_0x595b22){_0x29c534[_0xd8e9('0x45')]=_0x595b22;return _0x29c534;})[_0xd8e9('0x23')](respondWithFilteredResult(_0x2f6e86,_0x131099))[_0xd8e9('0x46')](handleError(_0x2f6e86,null));};exports[_0xd8e9('0x47')]=function(_0x1ef242,_0x129421){var _0x1fc66f={'raw':!![],'where':{'id':_0x1ef242[_0xd8e9('0x48')]['id']}},_0x29269c={};_0x29269c[_0xd8e9('0x2d')]=_[_0xd8e9('0x2e')](db[_0xd8e9('0x2c')]['rawAttributes']);_0x29269c[_0xd8e9('0x2f')]=_[_0xd8e9('0x2e')](_0x1ef242[_0xd8e9('0x2f')]);_0x29269c[_0xd8e9('0x30')]=_[_0xd8e9('0x31')](_0x29269c[_0xd8e9('0x2d')],_0x29269c[_0xd8e9('0x2f')]);_0x1fc66f[_0xd8e9('0x32')]=_[_0xd8e9('0x31')](_0x29269c['model'],qs[_0xd8e9('0x33')](_0x1ef242['query'][_0xd8e9('0x33')]));_0x1fc66f[_0xd8e9('0x32')]=_0x1fc66f[_0xd8e9('0x32')]['length']?_0x1fc66f[_0xd8e9('0x32')]:_0x29269c['model'];if(_0x1ef242[_0xd8e9('0x2f')][_0xd8e9('0x42')]){_0x1fc66f[_0xd8e9('0x43')]=[{'all':!![]}];}_0x1fc66f=_[_0xd8e9('0x41')]({},_0x1fc66f,_0x1ef242[_0xd8e9('0x49')]);return db[_0xd8e9('0x2c')]['find'](_0x1fc66f)['then'](handleEntityNotFound(_0x129421,null))[_0xd8e9('0x23')](respondWithResult(_0x129421,null))[_0xd8e9('0x46')](handleError(_0x129421,null));};exports[_0xd8e9('0x22')]=function(_0x550c73,_0xd5bc5){if(_0x550c73['body']['id']){delete _0x550c73[_0xd8e9('0x4a')]['id'];}return db[_0xd8e9('0x2c')][_0xd8e9('0x4b')]({'where':{'id':_0x550c73[_0xd8e9('0x48')]['id']}})[_0xd8e9('0x23')](handleEntityNotFound(_0xd5bc5,null))['then'](saveUpdates(_0x550c73['body'],null))['then'](respondWithResult(_0xd5bc5,null))[_0xd8e9('0x46')](handleError(_0xd5bc5,null));};exports[_0xd8e9('0x4c')]=function(_0x3a51f0,_0x54f5c8){return db[_0xd8e9('0x2c')][_0xd8e9('0x4b')]({'where':{'id':_0x3a51f0['params']['id']}})[_0xd8e9('0x23')](handleEntityNotFound(_0x54f5c8,null))[_0xd8e9('0x23')](removeEntity(_0x54f5c8,null))[_0xd8e9('0x46')](handleError(_0x54f5c8,null));};exports[_0xd8e9('0x4d')]=function(_0x196ad7,_0x442c15){var _0x7fee9d={'key':_0x196ad7[_0xd8e9('0x4a')][_0xd8e9('0x3e')]};if(_0x196ad7[_0xd8e9('0x4a')][_0xd8e9('0x4e')]){_0x7fee9d['MailAccountId']=_0x196ad7[_0xd8e9('0x4a')][_0xd8e9('0x4e')];}else if(_0x196ad7[_0xd8e9('0x4a')][_0xd8e9('0x4f')]){_0x7fee9d['SmsAccountId']=_0x196ad7[_0xd8e9('0x4a')]['SmsAccountId'];}else if(_0x196ad7['body'][_0xd8e9('0x50')]){_0x7fee9d[_0xd8e9('0x50')]=_0x196ad7[_0xd8e9('0x4a')][_0xd8e9('0x50')];}else if(_0x196ad7[_0xd8e9('0x4a')][_0xd8e9('0x51')]){_0x7fee9d[_0xd8e9('0x51')]=_0x196ad7['body'][_0xd8e9('0x51')];}return db[_0xd8e9('0x2c')][_0xd8e9('0x4b')]({'where':_0x7fee9d})[_0xd8e9('0x23')](function(_0x1fc6d2){if(_0x1fc6d2){throw new db[(_0xd8e9('0x52'))][(_0xd8e9('0x53'))](_0xd8e9('0x54'));}return db[_0xd8e9('0x2c')][_0xd8e9('0x4d')](_0x196ad7[_0xd8e9('0x4a')]);})['then'](function(_0x4afaee){var _0x580c59=_0x196ad7[_0xd8e9('0x55')][_0xd8e9('0x24')]({'plain':!![]});if(!_0x580c59)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x580c59[_0xd8e9('0x56')]==='user'){var _0x34372e=_0x4afaee[_0xd8e9('0x24')]({'plain':!![]});return db[_0xd8e9('0x57')][_0xd8e9('0x4b')]({'where':{'name':_0xd8e9('0x25'),'userProfileId':_0x580c59[_0xd8e9('0x58')]},'raw':!![]})[_0xd8e9('0x23')](function(_0x45c0fd){if(_0x45c0fd&&_0x45c0fd[_0xd8e9('0x59')]===0x0){return db[_0xd8e9('0x5a')][_0xd8e9('0x4d')]({'name':_0x34372e[_0xd8e9('0x29')],'resourceId':_0x34372e['id'],'type':_0x45c0fd[_0xd8e9('0x29')],'sectionId':_0x45c0fd['id']},{})[_0xd8e9('0x23')](function(){return _0x4afaee;});}else{return _0x4afaee;}})[_0xd8e9('0x46')](function(_0x25ee09){logger['error'](_0xd8e9('0x5b'),_0x25ee09);throw _0x25ee09;});}return _0x4afaee;})['then'](respondWithResult(_0x442c15,0xc9))[_0xd8e9('0x46')](handleError(_0x442c15,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 045c56e..24aa246 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 _0x0f5e=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0f5e,0xb4));var _0xe0f5=function(_0x374c78,_0x3ad403){_0x374c78=_0x374c78-0x0;var _0x582efa=_0x0f5e[_0x374c78];return _0x582efa;};'use strict';var _=require('lodash');var util=require(_0xe0f5('0x0'));var logger=require(_0xe0f5('0x1'))(_0xe0f5('0x2'));var moment=require('moment');var BPromise=require(_0xe0f5('0x3'));var rp=require(_0xe0f5('0x4'));var attributes=require('./cannedAnswer.attributes');module[_0xe0f5('0x5')]=function(_0x87e684,_0x2eae73){return _0x87e684[_0xe0f5('0x6')](_0xe0f5('0x7'),attributes,{'tableName':_0xe0f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe0f5('0x9'),'collate':_0xe0f5('0xa')});}; \ No newline at end of file +var _0x4941=['../../config/logger','bluebird','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x29fa3d,_0x45d24f){var _0x5d4bbf=function(_0x5b89ef){while(--_0x5b89ef){_0x29fa3d['push'](_0x29fa3d['shift']());}};_0x5d4bbf(++_0x45d24f);}(_0x4941,0x1c0));var _0x1494=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x4941[_0x529f1c];return _0x4d57ab;};'use strict';var _=require(_0x1494('0x0'));var util=require(_0x1494('0x1'));var logger=require(_0x1494('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1494('0x3'));var rp=require('request-promise');var attributes=require(_0x1494('0x4'));module[_0x1494('0x5')]=function(_0x3ed0c1,_0x2ae1b8){return _0x3ed0c1['define'](_0x1494('0x6'),attributes,{'tableName':_0x1494('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1494('0x8'),'collate':_0x1494('0x9')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index f8d0b95..275bd0e 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 _0x5e8d=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment'];(function(_0x3d7166,_0x36075e){var _0x20a285=function(_0x1f71d6){while(--_0x1f71d6){_0x3d7166['push'](_0x3d7166['shift']());}};_0x20a285(++_0x36075e);}(_0x5e8d,0x1c9));var _0xd5e8=function(_0x22ddb1,_0x5f567c){_0x22ddb1=_0x22ddb1-0x0;var _0x31b637=_0x5e8d[_0x22ddb1];return _0x31b637;};'use strict';var _=require(_0xd5e8('0x0'));var util=require(_0xd5e8('0x1'));var moment=require(_0xd5e8('0x2'));var BPromise=require(_0xd5e8('0x3'));var rs=require(_0xd5e8('0x4'));var fs=require('fs');var Redis=require(_0xd5e8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5e8('0x6'));var logger=require(_0xd5e8('0x7'))(_0xd5e8('0x8'));var config=require(_0xd5e8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd5e8('0xa')][_0xd5e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d5a96,_0x54cb7c,_0x171509){return new BPromise(function(_0x281dab,_0x45ff70){return client[_0xd5e8('0xc')](_0x2d5a96,_0x171509)[_0xd5e8('0xd')](function(_0x17e338){logger[_0xd5e8('0xe')](_0xd5e8('0xf'),_0x54cb7c,'request\x20sent');logger[_0xd5e8('0x10')](_0xd5e8('0x11'),_0x54cb7c,'request\x20sent',JSON[_0xd5e8('0x12')](_0x17e338));if(_0x17e338['error']){if(_0x17e338[_0xd5e8('0x13')][_0xd5e8('0x14')]===0x1f4){logger[_0xd5e8('0x13')](_0xd5e8('0xf'),_0x54cb7c,_0x17e338[_0xd5e8('0x13')]['message']);return _0x45ff70(_0x17e338[_0xd5e8('0x13')][_0xd5e8('0x15')]);}logger['error'](_0xd5e8('0xf'),_0x54cb7c,_0x17e338[_0xd5e8('0x13')][_0xd5e8('0x15')]);return _0x281dab(_0x17e338[_0xd5e8('0x13')]['message']);}else{logger[_0xd5e8('0xe')](_0xd5e8('0xf'),_0x54cb7c,_0xd5e8('0x16'));_0x281dab(_0x17e338['result'][_0xd5e8('0x15')]);}})['catch'](function(_0x3f12c4){logger[_0xd5e8('0x13')](_0xd5e8('0xf'),_0x54cb7c,_0x3f12c4);_0x45ff70(_0x3f12c4);});});} \ No newline at end of file +var _0x098a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5c6c2b,_0x27d5a8){var _0x449af8=function(_0x413e58){while(--_0x413e58){_0x5c6c2b['push'](_0x5c6c2b['shift']());}};_0x449af8(++_0x27d5a8);}(_0x098a,0xab));var _0xa098=function(_0x41db2d,_0x44b304){_0x41db2d=_0x41db2d-0x0;var _0x5a9136=_0x098a[_0x41db2d];return _0x5a9136;};'use strict';var _=require(_0xa098('0x0'));var util=require(_0xa098('0x1'));var moment=require(_0xa098('0x2'));var BPromise=require(_0xa098('0x3'));var rs=require(_0xa098('0x4'));var fs=require('fs');var Redis=require(_0xa098('0x5'));var db=require(_0xa098('0x6'))['db'];var utils=require(_0xa098('0x7'));var logger=require(_0xa098('0x8'))(_0xa098('0x9'));var config=require(_0xa098('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa098('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13135b,_0x60c918,_0x45319e){return new BPromise(function(_0x1a2583,_0x15e2aa){return client[_0xa098('0xc')](_0x13135b,_0x45319e)[_0xa098('0xd')](function(_0x498f35){logger[_0xa098('0xe')](_0xa098('0xf'),_0x60c918,_0xa098('0x10'));logger[_0xa098('0x11')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x60c918,'request\x20sent',JSON[_0xa098('0x12')](_0x498f35));if(_0x498f35['error']){if(_0x498f35[_0xa098('0x13')]['code']===0x1f4){logger[_0xa098('0x13')](_0xa098('0xf'),_0x60c918,_0x498f35[_0xa098('0x13')][_0xa098('0x14')]);return _0x15e2aa(_0x498f35[_0xa098('0x13')]['message']);}logger['error'](_0xa098('0xf'),_0x60c918,_0x498f35[_0xa098('0x13')]['message']);return _0x1a2583(_0x498f35[_0xa098('0x13')][_0xa098('0x14')]);}else{logger['info'](_0xa098('0xf'),_0x60c918,_0xa098('0x10'));_0x1a2583(_0x498f35['result'][_0xa098('0x14')]);}})[_0xa098('0x15')](function(_0x1b9dec){logger['error'](_0xa098('0xf'),_0x60c918,_0x1b9dec);_0x15e2aa(_0x1b9dec);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index c55c74a..f8d098f 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 _0x6394=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x2232ff,_0x193749){var _0x1f6ef5=function(_0x325631){while(--_0x325631){_0x2232ff['push'](_0x2232ff['shift']());}};_0x1f6ef5(++_0x193749);}(_0x6394,0x177));var _0x4639=function(_0x1e2a33,_0x18a3bf){_0x1e2a33=_0x1e2a33-0x0;var _0x2c57c0=_0x6394[_0x1e2a33];return _0x2c57c0;};'use strict';var multer=require(_0x4639('0x0'));var util=require(_0x4639('0x1'));var path=require(_0x4639('0x2'));var timeout=require('connect-timeout');var express=require(_0x4639('0x3'));var router=express['Router']();var auth=require(_0x4639('0x4'));var interaction=require(_0x4639('0x5'));var config=require(_0x4639('0x6'));var controller=require(_0x4639('0x7'));router[_0x4639('0x8')]('/',auth[_0x4639('0x9')](),controller[_0x4639('0xa')]);router['get'](_0x4639('0xb'),auth[_0x4639('0x9')](),controller[_0x4639('0xc')]);router[_0x4639('0xd')]('/',auth[_0x4639('0x9')](),controller[_0x4639('0xe')]);router['put'](_0x4639('0xb'),auth[_0x4639('0x9')](),controller[_0x4639('0xf')]);router['delete'](_0x4639('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4639('0x10')]=router; \ No newline at end of file +var _0x3290=['put','update','delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show','create'];(function(_0x34efe2,_0x5a240b){var _0x3c051d=function(_0x397ed8){while(--_0x397ed8){_0x34efe2['push'](_0x34efe2['shift']());}};_0x3c051d(++_0x5a240b);}(_0x3290,0x17f));var _0x0329=function(_0x2cb6d3,_0x293327){_0x2cb6d3=_0x2cb6d3-0x0;var _0x143a68=_0x3290[_0x2cb6d3];return _0x143a68;};'use strict';var multer=require('multer');var util=require(_0x0329('0x0'));var path=require(_0x0329('0x1'));var timeout=require(_0x0329('0x2'));var express=require(_0x0329('0x3'));var router=express[_0x0329('0x4')]();var auth=require(_0x0329('0x5'));var interaction=require(_0x0329('0x6'));var config=require(_0x0329('0x7'));var controller=require(_0x0329('0x8'));router[_0x0329('0x9')]('/',auth[_0x0329('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0329('0xb')]);router['post']('/',auth[_0x0329('0xa')](),controller[_0x0329('0xc')]);router[_0x0329('0xd')]('/:id',auth[_0x0329('0xa')](),controller[_0x0329('0xe')]);router[_0x0329('0xf')](_0x0329('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x0329('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a52b014..706b5a2 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 _0x5c1d=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x5c1d,0xf2));var _0xd5c1=function(_0x97a492,_0x4773d5){_0x97a492=_0x97a492-0x0;var _0x1dc593=_0x5c1d[_0x97a492];return _0x1dc593;};'use strict';var Sequelize=require('sequelize');module[_0xd5c1('0x0')]={'calldate':{'type':Sequelize[_0xd5c1('0x1')],'allowNull':![],'defaultValue':_0xd5c1('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xd5c1('0x3')]},'dst':{'type':Sequelize[_0xd5c1('0x3')]},'dcontext':{'type':Sequelize[_0xd5c1('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xd5c1('0x3')]},'lastapp':{'type':Sequelize[_0xd5c1('0x3')]},'lastdata':{'type':Sequelize[_0xd5c1('0x3')]},'duration':{'type':Sequelize[_0xd5c1('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd5c1('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd5c1('0x3')]},'amaflags':{'type':Sequelize[_0xd5c1('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd5c1('0x3')]},'userfield':{'type':Sequelize[_0xd5c1('0x3')]},'uniqueid':{'type':Sequelize[_0xd5c1('0x3')]},'linkedid':{'type':Sequelize[_0xd5c1('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xd5c1('0x3')]},'type':{'type':Sequelize[_0xd5c1('0x3')]},'tag':{'type':Sequelize[_0xd5c1('0x3')]}}; \ No newline at end of file +var _0x9b32=['STRING','INTEGER','sequelize','exports'];(function(_0x5ec72b,_0x32c0aa){var _0x21472b=function(_0x51c7fa){while(--_0x51c7fa){_0x5ec72b['push'](_0x5ec72b['shift']());}};_0x21472b(++_0x32c0aa);}(_0x9b32,0xf2));var _0x29b3=function(_0x40593e,_0x2ba902){_0x40593e=_0x40593e-0x0;var _0x5b78a5=_0x9b32[_0x40593e];return _0x5b78a5;};'use strict';var Sequelize=require(_0x29b3('0x0'));module[_0x29b3('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x29b3('0x2')]},'dst':{'type':Sequelize[_0x29b3('0x2')]},'dcontext':{'type':Sequelize[_0x29b3('0x2')]},'channel':{'type':Sequelize[_0x29b3('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x29b3('0x2')]},'lastdata':{'type':Sequelize[_0x29b3('0x2')]},'duration':{'type':Sequelize[_0x29b3('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x29b3('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x29b3('0x2')]},'userfield':{'type':Sequelize[_0x29b3('0x2')]},'uniqueid':{'type':Sequelize[_0x29b3('0x2')]},'linkedid':{'type':Sequelize[_0x29b3('0x2')]},'sequence':{'type':Sequelize[_0x29b3('0x2')]},'peeraccount':{'type':Sequelize[_0x29b3('0x2')]},'type':{'type':Sequelize[_0x29b3('0x2')]},'tag':{'type':Sequelize[_0x29b3('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 25fa07f..5f0f79a 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 _0x94e0=['index','Cdr','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','field','options','findAll','rows','catch','show','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send'];(function(_0xf83492,_0x28c979){var _0x2eaf19=function(_0x5859f7){while(--_0x5859f7){_0xf83492['push'](_0xf83492['shift']());}};_0x2eaf19(++_0x28c979);}(_0x94e0,0x13c));var _0x094e=function(_0x192fcb,_0x2a6655){_0x192fcb=_0x192fcb-0x0;var _0x689383=_0x94e0[_0x192fcb];return _0x689383;};'use strict';var pdf=require(_0x094e('0x0'));var emlformat=require(_0x094e('0x1'));var rimraf=require(_0x094e('0x2'));var zipdir=require(_0x094e('0x3'));var jsonpatch=require(_0x094e('0x4'));var rp=require(_0x094e('0x5'));var moment=require(_0x094e('0x6'));var BPromise=require(_0x094e('0x7'));var Mustache=require('mustache');var util=require(_0x094e('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x094e('0x9'));var ejs=require(_0x094e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x094e('0xb'));var jsforce=require(_0x094e('0xc'));var deskjs=require(_0x094e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x094e('0xe'));var Papa=require(_0x094e('0xf'));var authService=require(_0x094e('0x10'));var hardwareService=require(_0x094e('0x11'));var Redis=require(_0x094e('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x094e('0x13'))(_0x094e('0x14'));var utils=require('../../config/utils');var config=require(_0x094e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262f3a,_0x1a6d8d){_0x1a6d8d=_0x1a6d8d||0xcc;return function(_0x289599){if(_0x289599){return _0x262f3a[_0x094e('0x16')](_0x1a6d8d);}return _0x262f3a[_0x094e('0x17')](_0x1a6d8d)[_0x094e('0x18')]();};}function respondWithResult(_0x2b4cd3,_0x3e1355){_0x3e1355=_0x3e1355||0xc8;return function(_0x12d95b){if(_0x12d95b){return _0x2b4cd3[_0x094e('0x17')](_0x3e1355)[_0x094e('0x19')](_0x12d95b);}};}function respondWithFilteredResult(_0x36d8c2,_0x53d310){return function(_0x4530d6){if(_0x4530d6){var _0x23e802=_0x4530d6[_0x094e('0x1a')],_0x2955d7=_0x53d310[_0x094e('0x1b')],_0xb3f8ed=_0x53d310[_0x094e('0x1b')]+_0x53d310[_0x094e('0x1c')],_0x259173;if(_0xb3f8ed>=_0x23e802){_0xb3f8ed=_0x23e802;_0x259173=0xc8;}else{_0x259173=0xce;}_0x36d8c2[_0x094e('0x17')](_0x259173);return _0x36d8c2[_0x094e('0x1d')](_0x094e('0x1e'),_0x2955d7+'-'+_0xb3f8ed+'/'+_0x23e802)[_0x094e('0x19')](_0x4530d6);}return null;};}function patchUpdates(_0x4db56e){return function(_0x3e329f){try{jsonpatch[_0x094e('0x1f')](_0x3e329f,_0x4db56e,!![]);}catch(_0x4adbfc){return BPromise[_0x094e('0x20')](_0x4adbfc);}return _0x3e329f[_0x094e('0x21')]();};}function saveUpdates(_0xc50516,_0x372773){return function(_0x4c20dc){if(_0x4c20dc){return _0x4c20dc[_0x094e('0x22')](_0xc50516)[_0x094e('0x23')](function(_0x44a150){return _0x44a150;});}return null;};}function removeEntity(_0x59fdf9,_0x428fd8){return function(_0x3ac989){if(_0x3ac989){return _0x3ac989[_0x094e('0x24')]()[_0x094e('0x23')](function(){_0x59fdf9[_0x094e('0x17')](0xcc)[_0x094e('0x18')]();});}};}function handleEntityNotFound(_0x147a42,_0x5e0c82){return function(_0x276fa3){if(!_0x276fa3){_0x147a42['sendStatus'](0x194);}return _0x276fa3;};}function handleError(_0x1b28c3,_0x509608){_0x509608=_0x509608||0x1f4;return function(_0x2ea5d8){logger['error'](_0x2ea5d8['stack']);if(_0x2ea5d8[_0x094e('0x25')]){delete _0x2ea5d8['name'];}_0x1b28c3[_0x094e('0x17')](_0x509608)[_0x094e('0x26')](_0x2ea5d8);};}exports[_0x094e('0x27')]=function(_0x1691c8,_0x3cce0b){var _0x3e3aef={},_0x1203d1={},_0xf0685={'count':0x0,'rows':[]};var _0x3e79b7=db[_0x094e('0x28')][_0x094e('0x29')];_0x1203d1[_0x094e('0x2a')]=_[_0x094e('0x2b')](_0x3e79b7);_0x1203d1['query']=_[_0x094e('0x2b')](_0x1691c8['query']);_0x1203d1[_0x094e('0x2c')]=_[_0x094e('0x2d')](_0x1203d1['model'],_0x1203d1[_0x094e('0x2e')]);_0x3e3aef[_0x094e('0x2f')]=_[_0x094e('0x2d')](_0x1203d1[_0x094e('0x2a')],qs['fields'](_0x1691c8['query'][_0x094e('0x30')]));_0x3e3aef['attributes']=_0x3e3aef['attributes'][_0x094e('0x31')]?_0x3e3aef['attributes']:_0x1203d1['model'];if(!_0x1691c8[_0x094e('0x2e')][_0x094e('0x32')](_0x094e('0x33'))){_0x3e3aef[_0x094e('0x1c')]=qs['limit'](_0x1691c8[_0x094e('0x2e')]['limit']);_0x3e3aef[_0x094e('0x1b')]=qs[_0x094e('0x1b')](_0x1691c8[_0x094e('0x2e')]['offset']);}_0x3e3aef['order']=qs[_0x094e('0x34')](_0x1691c8['query'][_0x094e('0x34')]);_0x3e3aef[_0x094e('0x35')]=qs['filters'](_['pick'](_0x1691c8[_0x094e('0x2e')],_0x1203d1['filters']));if(_0x1691c8[_0x094e('0x2e')][_0x094e('0x36')]){_0x3e3aef[_0x094e('0x35')]=_[_0x094e('0x37')](_0x3e3aef[_0x094e('0x35')],{'$or':_[_0x094e('0x38')](_0x3e79b7,function(_0x5cb985){if(_0x5cb985[_0x094e('0x39')][_0x094e('0x3a')]!=='VIRTUAL'){var _0x228c2c={};_0x228c2c[_0x5cb985[_0x094e('0x3b')]]={'$like':'%'+_0x1691c8['query'][_0x094e('0x36')]+'%'};return _0x228c2c;}})});}_0x3e3aef=_[_0x094e('0x37')]({},_0x3e3aef,_0x1691c8[_0x094e('0x3c')]);var _0x2ee833={'where':_0x3e3aef[_0x094e('0x35')]};return db[_0x094e('0x28')][_0x094e('0x1a')](_0x2ee833)[_0x094e('0x23')](function(_0x8c03d6){_0xf0685[_0x094e('0x1a')]=_0x8c03d6;if(_0x1691c8[_0x094e('0x2e')]['includeAll']){_0x3e3aef['include']=[{'all':!![]}];}return db['Cdr'][_0x094e('0x3d')](_0x3e3aef);})[_0x094e('0x23')](function(_0x127ba2){_0xf0685[_0x094e('0x3e')]=_0x127ba2;return _0xf0685;})['then'](respondWithFilteredResult(_0x3cce0b,_0x3e3aef))[_0x094e('0x3f')](handleError(_0x3cce0b,null));};exports[_0x094e('0x40')]=function(_0x5b2c21,_0x562be7){var _0x520f42={'raw':!![],'where':{'id':_0x5b2c21['params']['id']}},_0x17c4e2={};_0x17c4e2[_0x094e('0x2a')]=_[_0x094e('0x2b')](db['Cdr']['rawAttributes']);_0x17c4e2['query']=_['keys'](_0x5b2c21['query']);_0x17c4e2[_0x094e('0x2c')]=_[_0x094e('0x2d')](_0x17c4e2[_0x094e('0x2a')],_0x17c4e2[_0x094e('0x2e')]);_0x520f42[_0x094e('0x2f')]=_[_0x094e('0x2d')](_0x17c4e2[_0x094e('0x2a')],qs['fields'](_0x5b2c21[_0x094e('0x2e')]['fields']));_0x520f42['attributes']=_0x520f42[_0x094e('0x2f')][_0x094e('0x31')]?_0x520f42[_0x094e('0x2f')]:_0x17c4e2[_0x094e('0x2a')];if(_0x5b2c21[_0x094e('0x2e')]['includeAll']){_0x520f42[_0x094e('0x41')]=[{'all':!![]}];}_0x520f42=_[_0x094e('0x37')]({},_0x520f42,_0x5b2c21['options']);return db['Cdr'][_0x094e('0x42')](_0x520f42)['then'](handleEntityNotFound(_0x562be7,null))['then'](respondWithResult(_0x562be7,null))[_0x094e('0x3f')](handleError(_0x562be7,null));};exports[_0x094e('0x43')]=function(_0x4e3ebc,_0x2b70b2){return db[_0x094e('0x28')][_0x094e('0x43')](_0x4e3ebc[_0x094e('0x44')],{})[_0x094e('0x23')](respondWithResult(_0x2b70b2,0xc9))['catch'](handleError(_0x2b70b2,null));};exports[_0x094e('0x22')]=function(_0x10cee6,_0x334709){if(_0x10cee6['body']['id']){delete _0x10cee6[_0x094e('0x44')]['id'];}return db[_0x094e('0x28')][_0x094e('0x42')]({'where':{'id':_0x10cee6['params']['id']}})['then'](handleEntityNotFound(_0x334709,null))[_0x094e('0x23')](saveUpdates(_0x10cee6[_0x094e('0x44')],null))[_0x094e('0x23')](respondWithResult(_0x334709,null))[_0x094e('0x3f')](handleError(_0x334709,null));};exports['destroy']=function(_0x377fa5,_0x35ea3f){return db[_0x094e('0x28')][_0x094e('0x42')]({'where':{'id':_0x377fa5[_0x094e('0x45')]['id']}})[_0x094e('0x23')](handleEntityNotFound(_0x35ea3f,null))[_0x094e('0x23')](removeEntity(_0x35ea3f,null))[_0x094e('0x3f')](handleError(_0x35ea3f,null));};exports[_0x094e('0x46')]=function(_0xf8b6b2,_0x59538e){return db[_0x094e('0x28')]['describe']()[_0x094e('0x23')](respondWithResult(_0x59538e,null))['catch'](handleError(_0x59538e,null));}; \ No newline at end of file +var _0xde5d=['params','describe','html-pdf','rimraf','request-promise','moment','util','path','to-csv','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','Cdr','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','includeAll','create','body','find'];(function(_0x2c3ab2,_0x271dd5){var _0x295331=function(_0x34e8dd){while(--_0x34e8dd){_0x2c3ab2['push'](_0x2c3ab2['shift']());}};_0x295331(++_0x271dd5);}(_0xde5d,0x1e5));var _0xdde5=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xde5d[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0xdde5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdde5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdde5('0x2'));var moment=require(_0xdde5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdde5('0x4'));var path=require(_0xdde5('0x5'));var sox=require('sox');var csv=require(_0xdde5('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdde5('0x7'));var squel=require(_0xdde5('0x8'));var crypto=require(_0xdde5('0x9'));var jsforce=require(_0xdde5('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xdde5('0xb'));var hardwareService=require(_0xdde5('0xc'));var Redis=require(_0xdde5('0xd'));var qs=require(_0xdde5('0xe'));var logger=require(_0xdde5('0xf'))('api');var utils=require(_0xdde5('0x10'));var config=require('../../config/environment');var db=require(_0xdde5('0x11'))['db'];function respondWithStatusCode(_0x349de2,_0x11dbbd){_0x11dbbd=_0x11dbbd||0xcc;return function(_0x1a852c){if(_0x1a852c){return _0x349de2['sendStatus'](_0x11dbbd);}return _0x349de2[_0xdde5('0x12')](_0x11dbbd)[_0xdde5('0x13')]();};}function respondWithResult(_0x4680a4,_0x187d1d){_0x187d1d=_0x187d1d||0xc8;return function(_0x59983c){if(_0x59983c){return _0x4680a4['status'](_0x187d1d)[_0xdde5('0x14')](_0x59983c);}};}function respondWithFilteredResult(_0x2c03c7,_0x229585){return function(_0x2dcb05){if(_0x2dcb05){var _0x10f0b5=_0x2dcb05['count'],_0x3a6f9f=_0x229585[_0xdde5('0x15')],_0x106065=_0x229585[_0xdde5('0x15')]+_0x229585['limit'],_0x5a3fab;if(_0x106065>=_0x10f0b5){_0x106065=_0x10f0b5;_0x5a3fab=0xc8;}else{_0x5a3fab=0xce;}_0x2c03c7['status'](_0x5a3fab);return _0x2c03c7[_0xdde5('0x16')](_0xdde5('0x17'),_0x3a6f9f+'-'+_0x106065+'/'+_0x10f0b5)[_0xdde5('0x14')](_0x2dcb05);}return null;};}function patchUpdates(_0x44cdf7){return function(_0x4966e7){try{jsonpatch[_0xdde5('0x18')](_0x4966e7,_0x44cdf7,!![]);}catch(_0x27aab5){return BPromise[_0xdde5('0x19')](_0x27aab5);}return _0x4966e7[_0xdde5('0x1a')]();};}function saveUpdates(_0x2a20a1,_0x5766d5){return function(_0x58c729){if(_0x58c729){return _0x58c729[_0xdde5('0x1b')](_0x2a20a1)[_0xdde5('0x1c')](function(_0x8e4c23){return _0x8e4c23;});}return null;};}function removeEntity(_0x365a41,_0x110883){return function(_0xd41c27){if(_0xd41c27){return _0xd41c27[_0xdde5('0x1d')]()['then'](function(){_0x365a41[_0xdde5('0x12')](0xcc)[_0xdde5('0x13')]();});}};}function handleEntityNotFound(_0x13bd2d,_0x210c7a){return function(_0x4b9150){if(!_0x4b9150){_0x13bd2d[_0xdde5('0x1e')](0x194);}return _0x4b9150;};}function handleError(_0x89c9db,_0x293686){_0x293686=_0x293686||0x1f4;return function(_0x35b599){logger[_0xdde5('0x1f')](_0x35b599[_0xdde5('0x20')]);if(_0x35b599[_0xdde5('0x21')]){delete _0x35b599[_0xdde5('0x21')];}_0x89c9db['status'](_0x293686)['send'](_0x35b599);};}exports['index']=function(_0x22a4ae,_0x2fa3a4){var _0x4170ec={},_0x23c06b={},_0x19cee1={'count':0x0,'rows':[]};var _0x33fc4b=db[_0xdde5('0x22')][_0xdde5('0x23')];_0x23c06b['model']=_['keys'](_0x33fc4b);_0x23c06b[_0xdde5('0x24')]=_[_0xdde5('0x25')](_0x22a4ae[_0xdde5('0x24')]);_0x23c06b[_0xdde5('0x26')]=_[_0xdde5('0x27')](_0x23c06b[_0xdde5('0x28')],_0x23c06b['query']);_0x4170ec[_0xdde5('0x29')]=_[_0xdde5('0x27')](_0x23c06b['model'],qs[_0xdde5('0x2a')](_0x22a4ae[_0xdde5('0x24')][_0xdde5('0x2a')]));_0x4170ec['attributes']=_0x4170ec[_0xdde5('0x29')][_0xdde5('0x2b')]?_0x4170ec['attributes']:_0x23c06b['model'];if(!_0x22a4ae['query'][_0xdde5('0x2c')]('nolimit')){_0x4170ec['limit']=qs[_0xdde5('0x2d')](_0x22a4ae[_0xdde5('0x24')][_0xdde5('0x2d')]);_0x4170ec[_0xdde5('0x15')]=qs[_0xdde5('0x15')](_0x22a4ae[_0xdde5('0x24')][_0xdde5('0x15')]);}_0x4170ec[_0xdde5('0x2e')]=qs[_0xdde5('0x2f')](_0x22a4ae['query'][_0xdde5('0x2f')]);_0x4170ec['where']=qs[_0xdde5('0x26')](_[_0xdde5('0x30')](_0x22a4ae[_0xdde5('0x24')],_0x23c06b[_0xdde5('0x26')]));if(_0x22a4ae[_0xdde5('0x24')][_0xdde5('0x31')]){_0x4170ec[_0xdde5('0x32')]=_[_0xdde5('0x33')](_0x4170ec[_0xdde5('0x32')],{'$or':_['map'](_0x33fc4b,function(_0xa68e1a){if(_0xa68e1a[_0xdde5('0x34')][_0xdde5('0x35')]!==_0xdde5('0x36')){var _0x1deb97={};_0x1deb97[_0xa68e1a[_0xdde5('0x37')]]={'$like':'%'+_0x22a4ae[_0xdde5('0x24')]['filter']+'%'};return _0x1deb97;}})});}_0x4170ec=_['merge']({},_0x4170ec,_0x22a4ae[_0xdde5('0x38')]);var _0x17e027={'where':_0x4170ec[_0xdde5('0x32')]};return db[_0xdde5('0x22')][_0xdde5('0x39')](_0x17e027)[_0xdde5('0x1c')](function(_0x1902e1){_0x19cee1['count']=_0x1902e1;if(_0x22a4ae[_0xdde5('0x24')]['includeAll']){_0x4170ec[_0xdde5('0x3a')]=[{'all':!![]}];}return db[_0xdde5('0x22')][_0xdde5('0x3b')](_0x4170ec);})[_0xdde5('0x1c')](function(_0x222667){_0x19cee1[_0xdde5('0x3c')]=_0x222667;return _0x19cee1;})[_0xdde5('0x1c')](respondWithFilteredResult(_0x2fa3a4,_0x4170ec))[_0xdde5('0x3d')](handleError(_0x2fa3a4,null));};exports[_0xdde5('0x3e')]=function(_0x5178c2,_0x47fcf6){var _0x149f30={'raw':!![],'where':{'id':_0x5178c2['params']['id']}},_0x63fa74={};_0x63fa74[_0xdde5('0x28')]=_[_0xdde5('0x25')](db['Cdr'][_0xdde5('0x23')]);_0x63fa74[_0xdde5('0x24')]=_[_0xdde5('0x25')](_0x5178c2[_0xdde5('0x24')]);_0x63fa74[_0xdde5('0x26')]=_[_0xdde5('0x27')](_0x63fa74[_0xdde5('0x28')],_0x63fa74[_0xdde5('0x24')]);_0x149f30[_0xdde5('0x29')]=_[_0xdde5('0x27')](_0x63fa74[_0xdde5('0x28')],qs[_0xdde5('0x2a')](_0x5178c2[_0xdde5('0x24')]['fields']));_0x149f30[_0xdde5('0x29')]=_0x149f30[_0xdde5('0x29')][_0xdde5('0x2b')]?_0x149f30[_0xdde5('0x29')]:_0x63fa74[_0xdde5('0x28')];if(_0x5178c2[_0xdde5('0x24')][_0xdde5('0x3f')]){_0x149f30['include']=[{'all':!![]}];}_0x149f30=_[_0xdde5('0x33')]({},_0x149f30,_0x5178c2[_0xdde5('0x38')]);return db[_0xdde5('0x22')]['find'](_0x149f30)[_0xdde5('0x1c')](handleEntityNotFound(_0x47fcf6,null))[_0xdde5('0x1c')](respondWithResult(_0x47fcf6,null))['catch'](handleError(_0x47fcf6,null));};exports[_0xdde5('0x40')]=function(_0x5b2a5c,_0xb3f478){return db[_0xdde5('0x22')]['create'](_0x5b2a5c['body'],{})[_0xdde5('0x1c')](respondWithResult(_0xb3f478,0xc9))[_0xdde5('0x3d')](handleError(_0xb3f478,null));};exports['update']=function(_0x369f21,_0xd35380){if(_0x369f21[_0xdde5('0x41')]['id']){delete _0x369f21['body']['id'];}return db[_0xdde5('0x22')][_0xdde5('0x42')]({'where':{'id':_0x369f21[_0xdde5('0x43')]['id']}})[_0xdde5('0x1c')](handleEntityNotFound(_0xd35380,null))['then'](saveUpdates(_0x369f21[_0xdde5('0x41')],null))['then'](respondWithResult(_0xd35380,null))[_0xdde5('0x3d')](handleError(_0xd35380,null));};exports[_0xdde5('0x1d')]=function(_0x2451b1,_0x279dbe){return db['Cdr'][_0xdde5('0x42')]({'where':{'id':_0x2451b1['params']['id']}})['then'](handleEntityNotFound(_0x279dbe,null))['then'](removeEntity(_0x279dbe,null))['catch'](handleError(_0x279dbe,null));};exports[_0xdde5('0x44')]=function(_0x558c3b,_0x142845){return db['Cdr']['describe']()[_0xdde5('0x1c')](respondWithResult(_0x142845,null))[_0xdde5('0x3d')](handleError(_0x142845,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index a800b51..349a6f0 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 _0x5b61=['bluebird','request-promise','./cdr.attributes','exports','cdr','accountcode','calldate','disposition','src','uniqueid','util','../../config/logger','api','moment'];(function(_0x1feb73,_0x460e19){var _0x4b9d73=function(_0x5487ad){while(--_0x5487ad){_0x1feb73['push'](_0x1feb73['shift']());}};_0x4b9d73(++_0x460e19);}(_0x5b61,0xc0));var _0x15b6=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x5b61[_0x3aeb36];return _0xa2ef21;};'use strict';var _=require('lodash');var util=require(_0x15b6('0x0'));var logger=require(_0x15b6('0x1'))(_0x15b6('0x2'));var moment=require(_0x15b6('0x3'));var BPromise=require(_0x15b6('0x4'));var rp=require(_0x15b6('0x5'));var attributes=require(_0x15b6('0x6'));module[_0x15b6('0x7')]=function(_0x3d4766,_0x438827){return _0x3d4766['define']('Cdr',attributes,{'tableName':_0x15b6('0x8'),'paranoid':![],'indexes':[{'name':_0x15b6('0x9'),'fields':[_0x15b6('0x9')]},{'name':_0x15b6('0xa'),'fields':['calldate']},{'name':_0x15b6('0xb'),'fields':['disposition']},{'name':'dst','fields':['dst']},{'name':'src','fields':[_0x15b6('0xc')]},{'name':'uniqueid','fields':[_0x15b6('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1cd4=['disposition','dst','src','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','./cdr.attributes','exports','define','cdr','accountcode','calldate'];(function(_0x8fa4bc,_0x5cd2af){var _0x35b6a7=function(_0x357c25){while(--_0x357c25){_0x8fa4bc['push'](_0x8fa4bc['shift']());}};_0x35b6a7(++_0x5cd2af);}(_0x1cd4,0x84));var _0x41cd=function(_0x1f1df3,_0x1e69f3){_0x1f1df3=_0x1f1df3-0x0;var _0x3c5014=_0x1cd4[_0x1f1df3];return _0x3c5014;};'use strict';var _=require('lodash');var util=require(_0x41cd('0x0'));var logger=require(_0x41cd('0x1'))(_0x41cd('0x2'));var moment=require(_0x41cd('0x3'));var BPromise=require(_0x41cd('0x4'));var rp=require(_0x41cd('0x5'));var attributes=require(_0x41cd('0x6'));module[_0x41cd('0x7')]=function(_0x8bc05,_0x389b06){return _0x8bc05[_0x41cd('0x8')]('Cdr',attributes,{'tableName':_0x41cd('0x9'),'paranoid':![],'indexes':[{'name':_0x41cd('0xa'),'fields':[_0x41cd('0xa')]},{'name':'calldate','fields':[_0x41cd('0xb')]},{'name':_0x41cd('0xc'),'fields':['disposition']},{'name':_0x41cd('0xd'),'fields':[_0x41cd('0xd')]},{'name':_0x41cd('0xe'),'fields':[_0x41cd('0xe')]},{'name':_0x41cd('0xf'),'fields':[_0x41cd('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index f6c8af9..c1c2820 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 _0x9df2=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch'];(function(_0x52b3a1,_0xd9ad11){var _0x32a8ed=function(_0x3a2c79){while(--_0x3a2c79){_0x52b3a1['push'](_0x52b3a1['shift']());}};_0x32a8ed(++_0xd9ad11);}(_0x9df2,0x180));var _0x29df=function(_0x14179e,_0x5075e5){_0x14179e=_0x14179e-0x0;var _0x6bcd95=_0x9df2[_0x14179e];return _0x6bcd95;};'use strict';var _=require(_0x29df('0x0'));var util=require(_0x29df('0x1'));var moment=require(_0x29df('0x2'));var BPromise=require(_0x29df('0x3'));var rs=require(_0x29df('0x4'));var fs=require('fs');var Redis=require(_0x29df('0x5'));var db=require(_0x29df('0x6'))['db'];var utils=require(_0x29df('0x7'));var logger=require('../../config/logger')(_0x29df('0x8'));var config=require('../../config/environment');var jayson=require(_0x29df('0x9'));var client=jayson[_0x29df('0xa')][_0x29df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1997b0,_0x5111a9,_0x3aa2e0){return new BPromise(function(_0x8f8686,_0x57d09c){return client[_0x29df('0xc')](_0x1997b0,_0x3aa2e0)[_0x29df('0xd')](function(_0x2f1840){logger[_0x29df('0xe')]('Cdr,\x20%s,\x20%s',_0x5111a9,_0x29df('0xf'));logger['debug'](_0x29df('0x10'),_0x5111a9,_0x29df('0xf'),JSON[_0x29df('0x11')](_0x2f1840));if(_0x2f1840['error']){if(_0x2f1840[_0x29df('0x12')][_0x29df('0x13')]===0x1f4){logger[_0x29df('0x12')]('Cdr,\x20%s,\x20%s',_0x5111a9,_0x2f1840[_0x29df('0x12')][_0x29df('0x14')]);return _0x57d09c(_0x2f1840[_0x29df('0x12')][_0x29df('0x14')]);}logger[_0x29df('0x12')]('Cdr,\x20%s,\x20%s',_0x5111a9,_0x2f1840['error'][_0x29df('0x14')]);return _0x8f8686(_0x2f1840[_0x29df('0x12')][_0x29df('0x14')]);}else{logger['info'](_0x29df('0x15'),_0x5111a9,_0x29df('0xf'));_0x8f8686(_0x2f1840[_0x29df('0x16')][_0x29df('0x14')]);}})[_0x29df('0x17')](function(_0x27e48b){logger[_0x29df('0x12')](_0x29df('0x15'),_0x5111a9,_0x27e48b);_0x57d09c(_0x27e48b);});});} \ No newline at end of file +var _0x0948=['util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','lodash'];(function(_0x197ef2,_0x2e405d){var _0x3446cf=function(_0x15bfda){while(--_0x15bfda){_0x197ef2['push'](_0x197ef2['shift']());}};_0x3446cf(++_0x2e405d);}(_0x0948,0x17b));var _0x8094=function(_0x4851ff,_0x1c9a8d){_0x4851ff=_0x4851ff-0x0;var _0x26773b=_0x0948[_0x4851ff];return _0x26773b;};'use strict';var _=require(_0x8094('0x0'));var util=require(_0x8094('0x1'));var moment=require(_0x8094('0x2'));var BPromise=require('bluebird');var rs=require(_0x8094('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8094('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8094('0x5'))(_0x8094('0x6'));var config=require(_0x8094('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8094('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcbb617,_0x12d163,_0x10244b){return new BPromise(function(_0x2df412,_0x368ffe){return client[_0x8094('0x9')](_0xcbb617,_0x10244b)[_0x8094('0xa')](function(_0x2ffe0b){logger[_0x8094('0xb')]('Cdr,\x20%s,\x20%s',_0x12d163,_0x8094('0xc'));logger['debug'](_0x8094('0xd'),_0x12d163,_0x8094('0xc'),JSON[_0x8094('0xe')](_0x2ffe0b));if(_0x2ffe0b[_0x8094('0xf')]){if(_0x2ffe0b[_0x8094('0xf')][_0x8094('0x10')]===0x1f4){logger['error'](_0x8094('0x11'),_0x12d163,_0x2ffe0b[_0x8094('0xf')]['message']);return _0x368ffe(_0x2ffe0b['error']['message']);}logger[_0x8094('0xf')](_0x8094('0x11'),_0x12d163,_0x2ffe0b[_0x8094('0xf')][_0x8094('0x12')]);return _0x2df412(_0x2ffe0b[_0x8094('0xf')][_0x8094('0x12')]);}else{logger[_0x8094('0xb')](_0x8094('0x11'),_0x12d163,_0x8094('0xc'));_0x2df412(_0x2ffe0b[_0x8094('0x13')][_0x8094('0x12')]);}})['catch'](function(_0x5906b3){logger['error'](_0x8094('0x11'),_0x12d163,_0x5906b3);_0x368ffe(_0x5906b3);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 314c16f..b447e3c 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 _0x8838=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','show','post','create','put','update'];(function(_0x1f1e84,_0x2a0df7){var _0x1617e7=function(_0x160aa4){while(--_0x160aa4){_0x1f1e84['push'](_0x1f1e84['shift']());}};_0x1617e7(++_0x2a0df7);}(_0x8838,0xeb));var _0x8883=function(_0x469463,_0x4e0a30){_0x469463=_0x469463-0x0;var _0x41175b=_0x8838[_0x469463];return _0x41175b;};'use strict';var multer=require(_0x8883('0x0'));var util=require(_0x8883('0x1'));var path=require(_0x8883('0x2'));var timeout=require(_0x8883('0x3'));var express=require(_0x8883('0x4'));var router=express['Router']();var auth=require(_0x8883('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8883('0x6'));var controller=require(_0x8883('0x7'));router[_0x8883('0x8')]('/',auth['isAuthenticated'](),controller[_0x8883('0x9')]);router[_0x8883('0x8')]('/describe',auth[_0x8883('0xa')](),controller[_0x8883('0xb')]);router[_0x8883('0x8')]('/:id',auth[_0x8883('0xa')](),controller[_0x8883('0xc')]);router[_0x8883('0xd')]('/',auth['isAuthenticated'](),controller[_0x8883('0xe')]);router[_0x8883('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8883('0x10')]);router[_0x8883('0x11')](_0x8883('0x12'),auth['isAuthenticated'](),controller[_0x8883('0x13')]);module[_0x8883('0x14')]=router; \ No newline at end of file +var _0x67cb=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x19a562,_0x4b669f){var _0x3bd3f3=function(_0x482255){while(--_0x482255){_0x19a562['push'](_0x19a562['shift']());}};_0x3bd3f3(++_0x4b669f);}(_0x67cb,0x19e));var _0xb67c=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x67cb[_0xc8a931];return _0x28bd27;};'use strict';var multer=require(_0xb67c('0x0'));var util=require('util');var path=require(_0xb67c('0x1'));var timeout=require(_0xb67c('0x2'));var express=require(_0xb67c('0x3'));var router=express[_0xb67c('0x4')]();var auth=require(_0xb67c('0x5'));var interaction=require(_0xb67c('0x6'));var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0xb67c('0x7')]('/',auth[_0xb67c('0x8')](),controller[_0xb67c('0x9')]);router[_0xb67c('0x7')]('/describe',auth[_0xb67c('0x8')](),controller[_0xb67c('0xa')]);router[_0xb67c('0x7')](_0xb67c('0xb'),auth[_0xb67c('0x8')](),controller[_0xb67c('0xc')]);router[_0xb67c('0xd')]('/',auth[_0xb67c('0x8')](),controller[_0xb67c('0xe')]);router[_0xb67c('0xf')](_0xb67c('0xb'),auth[_0xb67c('0x8')](),controller['update']);router[_0xb67c('0x10')](_0xb67c('0xb'),auth[_0xb67c('0x8')](),controller[_0xb67c('0x11')]);module[_0xb67c('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 697c573..cdd6071 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 _0xd287=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x3f4bc1,_0x15ace5){var _0x46fcf6=function(_0x3a19c1){while(--_0x3a19c1){_0x3f4bc1['push'](_0x3f4bc1['shift']());}};_0x46fcf6(++_0x15ace5);}(_0xd287,0x97));var _0x7d28=function(_0x3eca16,_0x5d8100){_0x3eca16=_0x3eca16-0x0;var _0x47eb8d=_0xd287[_0x3eca16];return _0x47eb8d;};'use strict';var Sequelize=require(_0x7d28('0x0'));module[_0x7d28('0x1')]={'priority':{'type':Sequelize[_0x7d28('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7d28('0x3')]()},'description':{'type':Sequelize[_0x7d28('0x4')]},'interval':{'type':Sequelize[_0x7d28('0x4')],'defaultValue':_0x7d28('0x5')}}; \ No newline at end of file +var _0xf417=['STRING','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x24d475,_0x2385e8){var _0x117759=function(_0x3ee916){while(--_0x3ee916){_0x24d475['push'](_0x24d475['shift']());}};_0x117759(++_0x2385e8);}(_0xf417,0x8f));var _0x7f41=function(_0x20c2f4,_0x470117){_0x20c2f4=_0x20c2f4-0x0;var _0x2c4823=_0xf417[_0x20c2f4];return _0x2c4823;};'use strict';var Sequelize=require('sequelize');module[_0x7f41('0x0')]={'priority':{'type':Sequelize[_0x7f41('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7f41('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7f41('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7f41('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 28b2f79..c41a828 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 _0x9aa2=['reject','update','destroy','end','sendStatus','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','status','json','count','offset','Content-Range','apply'];(function(_0x2acc6e,_0x558f93){var _0x4f1f2b=function(_0x577641){while(--_0x577641){_0x2acc6e['push'](_0x2acc6e['shift']());}};_0x4f1f2b(++_0x558f93);}(_0x9aa2,0x194));var _0x29aa=function(_0x40eeb5,_0x50b494){_0x40eeb5=_0x40eeb5-0x0;var _0x3c9337=_0x9aa2[_0x40eeb5];return _0x3c9337;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29aa('0x0'));var rimraf=require(_0x29aa('0x1'));var zipdir=require(_0x29aa('0x2'));var jsonpatch=require(_0x29aa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x29aa('0x4'));var Mustache=require('mustache');var util=require(_0x29aa('0x5'));var path=require(_0x29aa('0x6'));var sox=require(_0x29aa('0x7'));var csv=require(_0x29aa('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x29aa('0x9'));var squel=require(_0x29aa('0xa'));var crypto=require(_0x29aa('0xb'));var jsforce=require(_0x29aa('0xc'));var deskjs=require(_0x29aa('0xd'));var toCsv=require(_0x29aa('0x8'));var querystring=require(_0x29aa('0xe'));var Papa=require(_0x29aa('0xf'));var authService=require(_0x29aa('0x10'));var hardwareService=require(_0x29aa('0x11'));var Redis=require(_0x29aa('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x29aa('0x13'))(_0x29aa('0x14'));var utils=require(_0x29aa('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2861be,_0x46a1dd){_0x46a1dd=_0x46a1dd||0xcc;return function(_0x3cb282){if(_0x3cb282){return _0x2861be['sendStatus'](_0x46a1dd);}return _0x2861be[_0x29aa('0x16')](_0x46a1dd)['end']();};}function respondWithResult(_0x5b4821,_0x34ab76){_0x34ab76=_0x34ab76||0xc8;return function(_0x17bb42){if(_0x17bb42){return _0x5b4821[_0x29aa('0x16')](_0x34ab76)[_0x29aa('0x17')](_0x17bb42);}};}function respondWithFilteredResult(_0x48eadd,_0x467d64){return function(_0x849cf4){if(_0x849cf4){var _0x641655=_0x849cf4[_0x29aa('0x18')],_0x20047f=_0x467d64[_0x29aa('0x19')],_0x2c4d4c=_0x467d64['offset']+_0x467d64['limit'],_0x38a838;if(_0x2c4d4c>=_0x641655){_0x2c4d4c=_0x641655;_0x38a838=0xc8;}else{_0x38a838=0xce;}_0x48eadd[_0x29aa('0x16')](_0x38a838);return _0x48eadd['set'](_0x29aa('0x1a'),_0x20047f+'-'+_0x2c4d4c+'/'+_0x641655)[_0x29aa('0x17')](_0x849cf4);}return null;};}function patchUpdates(_0x19e809){return function(_0x302f70){try{jsonpatch[_0x29aa('0x1b')](_0x302f70,_0x19e809,!![]);}catch(_0x1a4163){return BPromise[_0x29aa('0x1c')](_0x1a4163);}return _0x302f70['save']();};}function saveUpdates(_0x371473,_0x1f382e){return function(_0x510ac0){if(_0x510ac0){return _0x510ac0[_0x29aa('0x1d')](_0x371473)['then'](function(_0x41e244){return _0x41e244;});}return null;};}function removeEntity(_0x1b083c,_0x400f68){return function(_0x4137f7){if(_0x4137f7){return _0x4137f7[_0x29aa('0x1e')]()['then'](function(){_0x1b083c[_0x29aa('0x16')](0xcc)[_0x29aa('0x1f')]();});}};}function handleEntityNotFound(_0x58cc39,_0x116d74){return function(_0x4cd18b){if(!_0x4cd18b){_0x58cc39[_0x29aa('0x20')](0x194);}return _0x4cd18b;};}function handleError(_0x4dd8e7,_0x47fc8c){_0x47fc8c=_0x47fc8c||0x1f4;return function(_0x26f604){logger[_0x29aa('0x21')](_0x26f604[_0x29aa('0x22')]);if(_0x26f604['name']){delete _0x26f604[_0x29aa('0x23')];}_0x4dd8e7[_0x29aa('0x16')](_0x47fc8c)['send'](_0x26f604);};}exports[_0x29aa('0x24')]=function(_0x13f3cc,_0x131d56){var _0x49b88b={'raw':!![],'where':{'id':_0x13f3cc[_0x29aa('0x25')]['id']}},_0x2ba26e={};_0x2ba26e[_0x29aa('0x26')]=_['keys'](db[_0x29aa('0x27')][_0x29aa('0x28')]);_0x2ba26e[_0x29aa('0x29')]=_[_0x29aa('0x2a')](_0x13f3cc[_0x29aa('0x29')]);_0x2ba26e['filters']=_[_0x29aa('0x2b')](_0x2ba26e[_0x29aa('0x26')],_0x2ba26e[_0x29aa('0x29')]);_0x49b88b[_0x29aa('0x2c')]=_['intersection'](_0x2ba26e[_0x29aa('0x26')],qs[_0x29aa('0x2d')](_0x13f3cc[_0x29aa('0x29')]['fields']));_0x49b88b[_0x29aa('0x2c')]=_0x49b88b[_0x29aa('0x2c')][_0x29aa('0x2e')]?_0x49b88b[_0x29aa('0x2c')]:_0x2ba26e['model'];if(_0x13f3cc[_0x29aa('0x29')][_0x29aa('0x2f')]){_0x49b88b[_0x29aa('0x30')]=[{'all':!![]}];}_0x49b88b=_['merge']({},_0x49b88b,_0x13f3cc[_0x29aa('0x31')]);return db[_0x29aa('0x27')][_0x29aa('0x32')](_0x49b88b)['then'](handleEntityNotFound(_0x131d56,null))[_0x29aa('0x33')](respondWithResult(_0x131d56,null))[_0x29aa('0x34')](handleError(_0x131d56,null));};exports['update']=function(_0x3ddb95,_0x1a0a7e){if(_0x3ddb95[_0x29aa('0x35')]['id']){delete _0x3ddb95[_0x29aa('0x35')]['id'];}return db[_0x29aa('0x27')]['find']({'where':{'id':_0x3ddb95[_0x29aa('0x25')]['id']}})['then'](handleEntityNotFound(_0x1a0a7e,null))[_0x29aa('0x33')](saveUpdates(_0x3ddb95['body'],null))['then'](respondWithResult(_0x1a0a7e,null))['catch'](handleError(_0x1a0a7e,null));};exports[_0x29aa('0x1e')]=function(_0x1fad58,_0x64d7ee){return db['ChatApplication']['find']({'where':{'id':_0x1fad58[_0x29aa('0x25')]['id']}})['then'](handleEntityNotFound(_0x64d7ee,null))['then'](removeEntity(_0x64d7ee,null))[_0x29aa('0x34')](handleError(_0x64d7ee,null));}; \ No newline at end of file +var _0x1458=['json','count','offset','limit','set','apply','save','update','then','destroy','error','stack','name','params','ChatApplication','rawAttributes','query','keys','intersection','fields','attributes','length','model','find','catch','body','html-pdf','rimraf','fast-json-patch','mustache','util','path','ejs','squel','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x58f051,_0xd6b70a){var _0x4d8577=function(_0x3d86b5){while(--_0x3d86b5){_0x58f051['push'](_0x58f051['shift']());}};_0x4d8577(++_0xd6b70a);}(_0x1458,0x163));var _0x8145=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x1458[_0x59eefb];return _0x1a49e8;};'use strict';var pdf=require(_0x8145('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8145('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8145('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8145('0x3'));var util=require(_0x8145('0x4'));var path=require(_0x8145('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8145('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8145('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8145('0x8'));var querystring=require(_0x8145('0x9'));var Papa=require('papaparse');var authService=require(_0x8145('0xa'));var hardwareService=require(_0x8145('0xb'));var Redis=require(_0x8145('0xc'));var qs=require(_0x8145('0xd'));var logger=require(_0x8145('0xe'))(_0x8145('0xf'));var utils=require(_0x8145('0x10'));var config=require(_0x8145('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39d4d2,_0x2af53d){_0x2af53d=_0x2af53d||0xcc;return function(_0x5173a3){if(_0x5173a3){return _0x39d4d2[_0x8145('0x12')](_0x2af53d);}return _0x39d4d2[_0x8145('0x13')](_0x2af53d)[_0x8145('0x14')]();};}function respondWithResult(_0x647b78,_0x3bca8c){_0x3bca8c=_0x3bca8c||0xc8;return function(_0x52f22b){if(_0x52f22b){return _0x647b78['status'](_0x3bca8c)[_0x8145('0x15')](_0x52f22b);}};}function respondWithFilteredResult(_0x512bc5,_0x29d84c){return function(_0xa1d67e){if(_0xa1d67e){var _0x523777=_0xa1d67e[_0x8145('0x16')],_0x29d54b=_0x29d84c['offset'],_0x353d3e=_0x29d84c[_0x8145('0x17')]+_0x29d84c[_0x8145('0x18')],_0x16521a;if(_0x353d3e>=_0x523777){_0x353d3e=_0x523777;_0x16521a=0xc8;}else{_0x16521a=0xce;}_0x512bc5[_0x8145('0x13')](_0x16521a);return _0x512bc5[_0x8145('0x19')]('Content-Range',_0x29d54b+'-'+_0x353d3e+'/'+_0x523777)['json'](_0xa1d67e);}return null;};}function patchUpdates(_0x982892){return function(_0x56bca7){try{jsonpatch[_0x8145('0x1a')](_0x56bca7,_0x982892,!![]);}catch(_0xb6647c){return BPromise['reject'](_0xb6647c);}return _0x56bca7[_0x8145('0x1b')]();};}function saveUpdates(_0x51b462,_0x358c46){return function(_0xa09d15){if(_0xa09d15){return _0xa09d15[_0x8145('0x1c')](_0x51b462)[_0x8145('0x1d')](function(_0x3de61f){return _0x3de61f;});}return null;};}function removeEntity(_0x589b1d,_0x589169){return function(_0x48836a){if(_0x48836a){return _0x48836a[_0x8145('0x1e')]()[_0x8145('0x1d')](function(){_0x589b1d['status'](0xcc)[_0x8145('0x14')]();});}};}function handleEntityNotFound(_0x23e3cf,_0x4e3fef){return function(_0x5581e3){if(!_0x5581e3){_0x23e3cf[_0x8145('0x12')](0x194);}return _0x5581e3;};}function handleError(_0x395587,_0x1c772a){_0x1c772a=_0x1c772a||0x1f4;return function(_0x1eaafe){logger[_0x8145('0x1f')](_0x1eaafe[_0x8145('0x20')]);if(_0x1eaafe[_0x8145('0x21')]){delete _0x1eaafe[_0x8145('0x21')];}_0x395587[_0x8145('0x13')](_0x1c772a)['send'](_0x1eaafe);};}exports['show']=function(_0x4c75ed,_0x24bad8){var _0x484047={'raw':!![],'where':{'id':_0x4c75ed[_0x8145('0x22')]['id']}},_0x40b027={};_0x40b027['model']=_['keys'](db[_0x8145('0x23')][_0x8145('0x24')]);_0x40b027[_0x8145('0x25')]=_[_0x8145('0x26')](_0x4c75ed[_0x8145('0x25')]);_0x40b027['filters']=_[_0x8145('0x27')](_0x40b027['model'],_0x40b027[_0x8145('0x25')]);_0x484047['attributes']=_[_0x8145('0x27')](_0x40b027['model'],qs[_0x8145('0x28')](_0x4c75ed[_0x8145('0x25')][_0x8145('0x28')]));_0x484047['attributes']=_0x484047[_0x8145('0x29')][_0x8145('0x2a')]?_0x484047[_0x8145('0x29')]:_0x40b027[_0x8145('0x2b')];if(_0x4c75ed['query']['includeAll']){_0x484047['include']=[{'all':!![]}];}_0x484047=_['merge']({},_0x484047,_0x4c75ed['options']);return db[_0x8145('0x23')][_0x8145('0x2c')](_0x484047)['then'](handleEntityNotFound(_0x24bad8,null))[_0x8145('0x1d')](respondWithResult(_0x24bad8,null))[_0x8145('0x2d')](handleError(_0x24bad8,null));};exports[_0x8145('0x1c')]=function(_0x20172c,_0x270bd4){if(_0x20172c[_0x8145('0x2e')]['id']){delete _0x20172c['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x20172c[_0x8145('0x22')]['id']}})[_0x8145('0x1d')](handleEntityNotFound(_0x270bd4,null))[_0x8145('0x1d')](saveUpdates(_0x20172c[_0x8145('0x2e')],null))[_0x8145('0x1d')](respondWithResult(_0x270bd4,null))[_0x8145('0x2d')](handleError(_0x270bd4,null));};exports['destroy']=function(_0x581e75,_0x5a8fef){return db[_0x8145('0x23')][_0x8145('0x2c')]({'where':{'id':_0x581e75[_0x8145('0x22')]['id']}})[_0x8145('0x1d')](handleEntityNotFound(_0x5a8fef,null))['then'](removeEntity(_0x5a8fef,null))['catch'](handleError(_0x5a8fef,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index df307b5..b68e3d4 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 _0x86b6=['chat_applications','../../config/logger','api','moment','bluebird','exports','ChatApplication'];(function(_0x3267d1,_0x173963){var _0x5762ef=function(_0x1fb818){while(--_0x1fb818){_0x3267d1['push'](_0x3267d1['shift']());}};_0x5762ef(++_0x173963);}(_0x86b6,0x1dd));var _0x686b=function(_0x1c8abb,_0x4fe2f9){_0x1c8abb=_0x1c8abb-0x0;var _0x58eb71=_0x86b6[_0x1c8abb];return _0x58eb71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x686b('0x0'))(_0x686b('0x1'));var moment=require(_0x686b('0x2'));var BPromise=require(_0x686b('0x3'));var rp=require('request-promise');var attributes=require('./chatApplication.attributes');module[_0x686b('0x4')]=function(_0x9a15d2,_0x18fe33){return _0x9a15d2['define'](_0x686b('0x5'),attributes,{'tableName':_0x686b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bba=['define','chat_applications','lodash','../../config/logger','api','bluebird','request-promise','./chatApplication.attributes','exports'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x3bba,0x122));var _0xa3bb=function(_0x42d40d,_0x334a25){_0x42d40d=_0x42d40d-0x0;var _0x42d18c=_0x3bba[_0x42d40d];return _0x42d18c;};'use strict';var _=require(_0xa3bb('0x0'));var util=require('util');var logger=require(_0xa3bb('0x1'))(_0xa3bb('0x2'));var moment=require('moment');var BPromise=require(_0xa3bb('0x3'));var rp=require(_0xa3bb('0x4'));var attributes=require(_0xa3bb('0x5'));module[_0xa3bb('0x6')]=function(_0xe6530b,_0x415fd6){return _0xe6530b[_0xa3bb('0x7')]('ChatApplication',attributes,{'tableName':_0xa3bb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 048729d..79b84fc 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 _0x338b=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3aea4e,_0x3da357){var _0x2e9db0=function(_0x577203){while(--_0x577203){_0x3aea4e['push'](_0x3aea4e['shift']());}};_0x2e9db0(++_0x3da357);}(_0x338b,0xbc));var _0xb338=function(_0x2235db,_0x4a5c0b){_0x2235db=_0x2235db-0x0;var _0x160df0=_0x338b[_0x2235db];return _0x160df0;};'use strict';var _=require(_0xb338('0x0'));var util=require(_0xb338('0x1'));var moment=require(_0xb338('0x2'));var BPromise=require(_0xb338('0x3'));var rs=require(_0xb338('0x4'));var fs=require('fs');var Redis=require(_0xb338('0x5'));var db=require(_0xb338('0x6'))['db'];var utils=require(_0xb338('0x7'));var logger=require(_0xb338('0x8'))(_0xb338('0x9'));var config=require(_0xb338('0xa'));var jayson=require(_0xb338('0xb'));var client=jayson[_0xb338('0xc')][_0xb338('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5af1b6,_0x25532d,_0x58beb8){return new BPromise(function(_0x5bdc9,_0x466b62){return client[_0xb338('0xe')](_0x5af1b6,_0x58beb8)[_0xb338('0xf')](function(_0x247cd6){logger[_0xb338('0x10')](_0xb338('0x11'),_0x25532d,_0xb338('0x12'));logger[_0xb338('0x13')](_0xb338('0x14'),_0x25532d,_0xb338('0x12'),JSON['stringify'](_0x247cd6));if(_0x247cd6[_0xb338('0x15')]){if(_0x247cd6[_0xb338('0x15')][_0xb338('0x16')]===0x1f4){logger[_0xb338('0x15')](_0xb338('0x11'),_0x25532d,_0x247cd6[_0xb338('0x15')][_0xb338('0x17')]);return _0x466b62(_0x247cd6[_0xb338('0x15')]['message']);}logger[_0xb338('0x15')](_0xb338('0x11'),_0x25532d,_0x247cd6['error']['message']);return _0x5bdc9(_0x247cd6['error'][_0xb338('0x17')]);}else{logger[_0xb338('0x10')](_0xb338('0x11'),_0x25532d,'request\x20sent');_0x5bdc9(_0x247cd6['result'][_0xb338('0x17')]);}})[_0xb338('0x18')](function(_0x1bbd86){logger['error'](_0xb338('0x11'),_0x25532d,_0x1bbd86);_0x466b62(_0x1bbd86);});});} \ No newline at end of file +var _0xce79=['request\x20sent','stringify','error','ChatApplication,\x20%s,\x20%s','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xce79,0x182));var _0x9ce7=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0xce79[_0x158a58];return _0x4935d9;};'use strict';var _=require('lodash');var util=require(_0x9ce7('0x0'));var moment=require(_0x9ce7('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ce7('0x2'));var fs=require('fs');var Redis=require(_0x9ce7('0x3'));var db=require(_0x9ce7('0x4'))['db'];var utils=require(_0x9ce7('0x5'));var logger=require('../../config/logger')(_0x9ce7('0x6'));var config=require(_0x9ce7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9ce7('0x8')][_0x9ce7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x79036d,_0x8b26c6,_0x59c301){return new BPromise(function(_0x222f48,_0x4861d5){return client[_0x9ce7('0xa')](_0x79036d,_0x59c301)[_0x9ce7('0xb')](function(_0x298911){logger['info']('ChatApplication,\x20%s,\x20%s',_0x8b26c6,'request\x20sent');logger[_0x9ce7('0xc')](_0x9ce7('0xd'),_0x8b26c6,_0x9ce7('0xe'),JSON[_0x9ce7('0xf')](_0x298911));if(_0x298911[_0x9ce7('0x10')]){if(_0x298911[_0x9ce7('0x10')]['code']===0x1f4){logger['error'](_0x9ce7('0x11'),_0x8b26c6,_0x298911['error'][_0x9ce7('0x12')]);return _0x4861d5(_0x298911[_0x9ce7('0x10')]['message']);}logger[_0x9ce7('0x10')](_0x9ce7('0x11'),_0x8b26c6,_0x298911[_0x9ce7('0x10')][_0x9ce7('0x12')]);return _0x222f48(_0x298911[_0x9ce7('0x10')][_0x9ce7('0x12')]);}else{logger[_0x9ce7('0x13')](_0x9ce7('0x11'),_0x8b26c6,_0x9ce7('0xe'));_0x222f48(_0x298911['result'][_0x9ce7('0x12')]);}})['catch'](function(_0x178b13){logger[_0x9ce7('0x10')](_0x9ce7('0x11'),_0x8b26c6,_0x178b13);_0x4861d5(_0x178b13);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index ffa7cb8..81f058f 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 _0xf31d=['show','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0xf31d,0xf6));var _0xdf31=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xf31d[_0x5466ab];return _0x40751a;};'use strict';var multer=require('multer');var util=require(_0xdf31('0x0'));var path=require(_0xdf31('0x1'));var timeout=require(_0xdf31('0x2'));var express=require(_0xdf31('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdf31('0x4'));var config=require(_0xdf31('0x5'));var controller=require(_0xdf31('0x6'));router[_0xdf31('0x7')]('/:id',auth[_0xdf31('0x8')](),controller[_0xdf31('0x9')]);router['put']('/:id',auth[_0xdf31('0x8')](),controller[_0xdf31('0xa')]);router[_0xdf31('0xb')](_0xdf31('0xc'),auth[_0xdf31('0x8')](),controller[_0xdf31('0xd')]);module[_0xdf31('0xe')]=router; \ No newline at end of file +var _0x6480=['delete','destroy','multer','util','connect-timeout','Router','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x95fa9d,_0x1e3ed6){var _0x3140a2=function(_0x2f8f0f){while(--_0x2f8f0f){_0x95fa9d['push'](_0x95fa9d['shift']());}};_0x3140a2(++_0x1e3ed6);}(_0x6480,0x1e2));var _0x0648=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6480[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0648('0x0'));var util=require(_0x0648('0x1'));var path=require('path');var timeout=require(_0x0648('0x2'));var express=require('express');var router=express[_0x0648('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0648('0x4'));var config=require('../../config/environment');var controller=require(_0x0648('0x5'));router[_0x0648('0x6')](_0x0648('0x7'),auth[_0x0648('0x8')](),controller[_0x0648('0x9')]);router['put'](_0x0648('0x7'),auth[_0x0648('0x8')](),controller['update']);router[_0x0648('0xa')]('/:id',auth[_0x0648('0x8')](),controller[_0x0648('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 848ed9b..f217c7a 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 _0x1e84=['STRING','sequelize','exports'];(function(_0x3de867,_0x1f61b0){var _0x2a2c44=function(_0x8af4e8){while(--_0x8af4e8){_0x3de867['push'](_0x3de867['shift']());}};_0x2a2c44(++_0x1f61b0);}(_0x1e84,0xeb));var _0x41e8=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0x1e84[_0x43a6cd];return _0x5acb36;};'use strict';var Sequelize=require(_0x41e8('0x0'));module[_0x41e8('0x1')]={'name':{'type':Sequelize[_0x41e8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x41e8('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7c74=['BOOLEAN','sequelize','exports','STRING'];(function(_0x80d1cb,_0x27d5fa){var _0x5bed97=function(_0x3b074c){while(--_0x3b074c){_0x80d1cb['push'](_0x80d1cb['shift']());}};_0x5bed97(++_0x27d5fa);}(_0x7c74,0xcd));var _0x47c7=function(_0x390752,_0x42cad3){_0x390752=_0x390752-0x0;var _0x5eca55=_0x7c74[_0x390752];return _0x5eca55;};'use strict';var Sequelize=require(_0x47c7('0x0'));module[_0x47c7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x47c7('0x2')]},'write':{'type':Sequelize[_0x47c7('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 fb2394b..fa49f43 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 _0xd0d7=['client','http','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','sendStatus','json','offset','limit','status','set','Content-Range','save','destroy','end','stack','name','send','index','ChatGroup','rawAttributes','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','format','getMessages','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','jayson/promise'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xd0d7,0x126));var _0x7d0d=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0xd0d7[_0x421e36];return _0x20b3e3;};'use strict';var pdf=require(_0x7d0d('0x0'));var emlformat=require(_0x7d0d('0x1'));var rimraf=require(_0x7d0d('0x2'));var zipdir=require(_0x7d0d('0x3'));var jsonpatch=require(_0x7d0d('0x4'));var rp=require(_0x7d0d('0x5'));var moment=require(_0x7d0d('0x6'));var BPromise=require(_0x7d0d('0x7'));var Mustache=require('mustache');var util=require(_0x7d0d('0x8'));var path=require(_0x7d0d('0x9'));var sox=require(_0x7d0d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7d0d('0xb'));var crypto=require(_0x7d0d('0xc'));var jsforce=require(_0x7d0d('0xd'));var deskjs=require(_0x7d0d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7d0d('0xf'));var Papa=require(_0x7d0d('0x10'));var authService=require(_0x7d0d('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7d0d('0x12'));var qs=require(_0x7d0d('0x13'));var logger=require(_0x7d0d('0x14'))(_0x7d0d('0x15'));var utils=require(_0x7d0d('0x16'));var config=require('../../config/environment');var db=require(_0x7d0d('0x17'))['db'];config[_0x7d0d('0x18')]=_[_0x7d0d('0x19')](config['redis'],{'host':_0x7d0d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7d0d('0x1b'))[_0x7d0d('0x1c')](socket);var jayson=require(_0x7d0d('0x1d'));var client=jayson[_0x7d0d('0x1e')][_0x7d0d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x180cd9,_0x4a20ed,_0x2980cb,_0x42f2e8){return new BPromise(function(_0x3f8570,_0x2de9e9){var _0x29c280=_0x42f2e8||client;return _0x29c280['request'](_0x180cd9,_0x2980cb)[_0x7d0d('0x20')](function(_0x584c96){logger[_0x7d0d('0x21')]('ChatGroup,\x20%s,\x20%s',_0x4a20ed,'request\x20sent');logger[_0x7d0d('0x22')](_0x7d0d('0x23'),_0x4a20ed,_0x7d0d('0x24'),JSON[_0x7d0d('0x25')](_0x584c96));if(_0x584c96[_0x7d0d('0x26')]){if(_0x584c96[_0x7d0d('0x26')]['code']===0x1f4){logger[_0x7d0d('0x26')]('ChatGroup,\x20%s,\x20%s',_0x4a20ed,_0x584c96['error'][_0x7d0d('0x27')]);return _0x2de9e9(_0x584c96[_0x7d0d('0x26')][_0x7d0d('0x27')]);}logger['error'](_0x7d0d('0x28'),_0x4a20ed,_0x584c96[_0x7d0d('0x26')][_0x7d0d('0x27')]);return _0x3f8570(_0x584c96[_0x7d0d('0x26')][_0x7d0d('0x27')]);}else{logger[_0x7d0d('0x21')](_0x7d0d('0x28'),_0x4a20ed,'request\x20sent');_0x3f8570(_0x584c96[_0x7d0d('0x29')][_0x7d0d('0x27')]);}})['catch'](function(_0x1ce088){logger[_0x7d0d('0x26')](_0x7d0d('0x28'),_0x4a20ed,_0x1ce088);_0x2de9e9(_0x1ce088);});});}function respondWithStatusCode(_0x580888,_0x326348){_0x326348=_0x326348||0xcc;return function(_0x1c6ca9){if(_0x1c6ca9){return _0x580888[_0x7d0d('0x2a')](_0x326348);}return _0x580888['status'](_0x326348)['end']();};}function respondWithResult(_0x59829c,_0x370134){_0x370134=_0x370134||0xc8;return function(_0x59e865){if(_0x59e865){return _0x59829c['status'](_0x370134)[_0x7d0d('0x2b')](_0x59e865);}};}function respondWithFilteredResult(_0x281ba3,_0x2fa836){return function(_0x25d840){if(_0x25d840){var _0x7ef5fe=_0x25d840['count'],_0x2e8428=_0x2fa836[_0x7d0d('0x2c')],_0x347102=_0x2fa836['offset']+_0x2fa836[_0x7d0d('0x2d')],_0x3561ee;if(_0x347102>=_0x7ef5fe){_0x347102=_0x7ef5fe;_0x3561ee=0xc8;}else{_0x3561ee=0xce;}_0x281ba3[_0x7d0d('0x2e')](_0x3561ee);return _0x281ba3[_0x7d0d('0x2f')](_0x7d0d('0x30'),_0x2e8428+'-'+_0x347102+'/'+_0x7ef5fe)[_0x7d0d('0x2b')](_0x25d840);}return null;};}function patchUpdates(_0x5b9228){return function(_0x19a719){try{jsonpatch['apply'](_0x19a719,_0x5b9228,!![]);}catch(_0x2341a0){return BPromise['reject'](_0x2341a0);}return _0x19a719[_0x7d0d('0x31')]();};}function saveUpdates(_0x311853,_0x16735d){return function(_0x309492){if(_0x309492){return _0x309492['update'](_0x311853)[_0x7d0d('0x20')](function(_0x42c46f){return _0x42c46f;});}return null;};}function removeEntity(_0x9a201,_0x4891f5){return function(_0x37b3b){if(_0x37b3b){return _0x37b3b[_0x7d0d('0x32')]()[_0x7d0d('0x20')](function(){_0x9a201[_0x7d0d('0x2e')](0xcc)[_0x7d0d('0x33')]();});}};}function handleEntityNotFound(_0x1d1890,_0x20bee1){return function(_0x35427c){if(!_0x35427c){_0x1d1890[_0x7d0d('0x2a')](0x194);}return _0x35427c;};}function handleError(_0x23ee09,_0x45fcdf){_0x45fcdf=_0x45fcdf||0x1f4;return function(_0x5d4a16){logger[_0x7d0d('0x26')](_0x5d4a16[_0x7d0d('0x34')]);if(_0x5d4a16[_0x7d0d('0x35')]){delete _0x5d4a16['name'];}_0x23ee09[_0x7d0d('0x2e')](_0x45fcdf)[_0x7d0d('0x36')](_0x5d4a16);};}exports[_0x7d0d('0x37')]=function(_0x53516d,_0x160046){var _0x4cf9fa={},_0x830241={},_0x8acf63={'count':0x0,'rows':[]};var _0x561152=db[_0x7d0d('0x38')][_0x7d0d('0x39')];_0x830241[_0x7d0d('0x3a')]=_[_0x7d0d('0x3b')](_0x561152);_0x830241['query']=_[_0x7d0d('0x3b')](_0x53516d['query']);_0x830241[_0x7d0d('0x3c')]=_[_0x7d0d('0x3d')](_0x830241[_0x7d0d('0x3a')],_0x830241['query']);_0x4cf9fa[_0x7d0d('0x3e')]=_['intersection'](_0x830241[_0x7d0d('0x3a')],qs[_0x7d0d('0x3f')](_0x53516d[_0x7d0d('0x40')][_0x7d0d('0x3f')]));_0x4cf9fa['attributes']=_0x4cf9fa[_0x7d0d('0x3e')][_0x7d0d('0x41')]?_0x4cf9fa[_0x7d0d('0x3e')]:_0x830241['model'];if(!_0x53516d['query'][_0x7d0d('0x42')]('nolimit')){_0x4cf9fa[_0x7d0d('0x2d')]=qs[_0x7d0d('0x2d')](_0x53516d[_0x7d0d('0x40')][_0x7d0d('0x2d')]);_0x4cf9fa[_0x7d0d('0x2c')]=qs[_0x7d0d('0x2c')](_0x53516d['query'][_0x7d0d('0x2c')]);}_0x4cf9fa[_0x7d0d('0x43')]=qs[_0x7d0d('0x44')](_0x53516d[_0x7d0d('0x40')]['sort']);_0x4cf9fa[_0x7d0d('0x45')]=qs[_0x7d0d('0x3c')](_[_0x7d0d('0x46')](_0x53516d[_0x7d0d('0x40')],_0x830241[_0x7d0d('0x3c')]));if(_0x53516d[_0x7d0d('0x40')]['filter']){_0x4cf9fa[_0x7d0d('0x45')]=_[_0x7d0d('0x47')](_0x4cf9fa[_0x7d0d('0x45')],{'$or':_[_0x7d0d('0x48')](_0x561152,function(_0x24dc65){if(_0x24dc65['type'][_0x7d0d('0x49')]!==_0x7d0d('0x4a')){var _0x32b139={};_0x32b139[_0x24dc65[_0x7d0d('0x4b')]]={'$like':'%'+_0x53516d[_0x7d0d('0x40')][_0x7d0d('0x4c')]+'%'};return _0x32b139;}})});}_0x4cf9fa=_['merge']({},_0x4cf9fa,_0x53516d['options']);var _0x206789={'where':_0x4cf9fa[_0x7d0d('0x45')]};return db[_0x7d0d('0x38')][_0x7d0d('0x4d')](_0x206789)[_0x7d0d('0x20')](function(_0x149aa3){_0x8acf63['count']=_0x149aa3;if(_0x53516d['query'][_0x7d0d('0x4e')]){_0x4cf9fa[_0x7d0d('0x4f')]=[{'all':!![]}];}return db[_0x7d0d('0x38')][_0x7d0d('0x50')](_0x4cf9fa);})[_0x7d0d('0x20')](function(_0x3ca372){_0x8acf63[_0x7d0d('0x51')]=_0x3ca372;return _0x8acf63;})[_0x7d0d('0x20')](respondWithFilteredResult(_0x160046,_0x4cf9fa))[_0x7d0d('0x52')](handleError(_0x160046,null));};exports[_0x7d0d('0x53')]=function(_0x3783b6,_0x487c6c){var _0x2a7140={'raw':!![],'where':{'id':_0x3783b6[_0x7d0d('0x54')]['id']}},_0x353e81={};_0x353e81[_0x7d0d('0x3a')]=_[_0x7d0d('0x3b')](db['ChatGroup'][_0x7d0d('0x39')]);_0x353e81[_0x7d0d('0x40')]=_['keys'](_0x3783b6['query']);_0x353e81['filters']=_[_0x7d0d('0x3d')](_0x353e81[_0x7d0d('0x3a')],_0x353e81['query']);_0x2a7140['attributes']=_[_0x7d0d('0x3d')](_0x353e81[_0x7d0d('0x3a')],qs[_0x7d0d('0x3f')](_0x3783b6[_0x7d0d('0x40')]['fields']));_0x2a7140['attributes']=_0x2a7140['attributes'][_0x7d0d('0x41')]?_0x2a7140[_0x7d0d('0x3e')]:_0x353e81['model'];if(_0x3783b6[_0x7d0d('0x40')][_0x7d0d('0x4e')]){_0x2a7140[_0x7d0d('0x4f')]=[{'all':!![]}];}_0x2a7140=_['merge']({},_0x2a7140,_0x3783b6[_0x7d0d('0x55')]);return db['ChatGroup'][_0x7d0d('0x56')](_0x2a7140)['then'](handleEntityNotFound(_0x487c6c,null))[_0x7d0d('0x20')](respondWithResult(_0x487c6c,null))[_0x7d0d('0x52')](handleError(_0x487c6c,null));};exports[_0x7d0d('0x57')]=function(_0x166abc,_0x57ecfc){return db[_0x7d0d('0x38')][_0x7d0d('0x57')](_0x166abc[_0x7d0d('0x58')],{})[_0x7d0d('0x20')](respondWithResult(_0x57ecfc,0xc9))[_0x7d0d('0x52')](handleError(_0x57ecfc,null));};exports[_0x7d0d('0x59')]=function(_0x485ada,_0x3b3a5b){if(_0x485ada[_0x7d0d('0x58')]['id']){delete _0x485ada[_0x7d0d('0x58')]['id'];}return db['ChatGroup'][_0x7d0d('0x56')]({'where':{'id':_0x485ada[_0x7d0d('0x54')]['id']}})[_0x7d0d('0x20')](handleEntityNotFound(_0x3b3a5b,null))[_0x7d0d('0x20')](saveUpdates(_0x485ada[_0x7d0d('0x58')],null))[_0x7d0d('0x20')](respondWithResult(_0x3b3a5b,null))['catch'](handleError(_0x3b3a5b,null));};exports[_0x7d0d('0x32')]=function(_0x5e5dd5,_0x5732a8){return db[_0x7d0d('0x38')]['find']({'where':{'id':_0x5e5dd5['params']['id']}})[_0x7d0d('0x20')](handleEntityNotFound(_0x5732a8,null))[_0x7d0d('0x20')](removeEntity(_0x5732a8,null))[_0x7d0d('0x52')](handleError(_0x5732a8,null));};exports[_0x7d0d('0x5a')]=function(_0xdab545,_0x2cb472){return db[_0x7d0d('0x38')]['describe']()['then'](respondWithResult(_0x2cb472,null))[_0x7d0d('0x52')](handleError(_0x2cb472,null));};exports[_0x7d0d('0x5b')]=function(_0x149d2a,_0x37d3b6,_0x554072){return db[_0x7d0d('0x5c')][_0x7d0d('0x4d')]({'where':{'ChatGroupId':_0x149d2a[_0x7d0d('0x54')]['id'],'ToId':_0x149d2a[_0x7d0d('0x5d')]['id'],'read':![]}})[_0x7d0d('0x20')](function(_0xc01ab4){return{'id':_[_0x7d0d('0x5e')](_0x149d2a['params']['id']),'count':_0xc01ab4};})[_0x7d0d('0x20')](respondWithResult(_0x37d3b6,null))[_0x7d0d('0x52')](handleError(_0x37d3b6,null));};exports['addMembers']=function(_0x3da59e,_0x1d6184,_0x27babc){return db[_0x7d0d('0x38')][_0x7d0d('0x56')]({'where':{'id':_0x3da59e[_0x7d0d('0x54')]['id']}})['then'](handleEntityNotFound(_0x1d6184,null))[_0x7d0d('0x20')](function(_0xe24797){if(_0xe24797){return _0xe24797[_0x7d0d('0x5f')](_0x3da59e[_0x7d0d('0x58')][_0x7d0d('0x60')],_[_0x7d0d('0x61')](_0x3da59e[_0x7d0d('0x58')],[_0x7d0d('0x60'),'id'])||{});}})[_0x7d0d('0x20')](respondWithResult(_0x1d6184,null))[_0x7d0d('0x52')](handleError(_0x1d6184,null));};exports[_0x7d0d('0x62')]=function(_0x45ac93,_0x78efa0,_0x2678e8){var _0xb560d4={};var _0x22cf76={};var _0x283164;var _0x5d6a8a;return db['ChatGroup'][_0x7d0d('0x63')]({'where':{'id':_0x45ac93['params']['id']}})[_0x7d0d('0x20')](handleEntityNotFound(_0x78efa0,null))[_0x7d0d('0x20')](function(_0x3e017d){if(_0x3e017d){_0x283164=_0x3e017d;_0x22cf76[_0x7d0d('0x3a')]=_[_0x7d0d('0x3b')](db[_0x7d0d('0x64')][_0x7d0d('0x39')]);_0x22cf76[_0x7d0d('0x40')]=_[_0x7d0d('0x3b')](_0x45ac93[_0x7d0d('0x40')]);_0x22cf76['filters']=_['intersection'](_0x22cf76['model'],_0x22cf76[_0x7d0d('0x40')]);_0xb560d4['attributes']=_[_0x7d0d('0x3d')](_0x22cf76['model'],qs[_0x7d0d('0x3f')](_0x45ac93[_0x7d0d('0x40')]['fields']));_0xb560d4[_0x7d0d('0x3e')]=_0xb560d4[_0x7d0d('0x3e')][_0x7d0d('0x41')]?_0xb560d4[_0x7d0d('0x3e')]:_0x22cf76[_0x7d0d('0x3a')];_0xb560d4[_0x7d0d('0x43')]=qs[_0x7d0d('0x44')](_0x45ac93[_0x7d0d('0x40')][_0x7d0d('0x44')]);_0xb560d4[_0x7d0d('0x45')]=qs[_0x7d0d('0x3c')](_[_0x7d0d('0x46')](_0x45ac93[_0x7d0d('0x40')],_0x22cf76[_0x7d0d('0x3c')]));if(_0x45ac93['query'][_0x7d0d('0x4c')]){_0xb560d4['where']=_['merge'](_0xb560d4[_0x7d0d('0x45')],{'$or':_[_0x7d0d('0x48')](_0xb560d4[_0x7d0d('0x3e')],function(_0x58d1aa){var _0x594aba={};_0x594aba[_0x58d1aa]={'$like':'%'+_0x45ac93['query'][_0x7d0d('0x4c')]+'%'};return _0x594aba;})});}_0xb560d4=_[_0x7d0d('0x47')]({},_0xb560d4,_0x45ac93[_0x7d0d('0x55')]);return _0x283164[_0x7d0d('0x62')](_0xb560d4);}})[_0x7d0d('0x20')](function(_0x3da0e6){if(_0x3da0e6){_0x5d6a8a=_0x3da0e6[_0x7d0d('0x41')];if(!_0x45ac93[_0x7d0d('0x40')][_0x7d0d('0x42')]('nolimit')){_0xb560d4[_0x7d0d('0x2d')]=qs[_0x7d0d('0x2d')](_0x45ac93[_0x7d0d('0x40')]['limit']);_0xb560d4[_0x7d0d('0x2c')]=qs['offset'](_0x45ac93[_0x7d0d('0x40')]['offset']);}return _0x283164[_0x7d0d('0x62')](_0xb560d4);}})[_0x7d0d('0x20')](function(_0x50568b){if(_0x50568b){return _0x50568b?{'count':_0x5d6a8a,'rows':_0x50568b}:null;}})['then'](respondWithResult(_0x78efa0,null))[_0x7d0d('0x52')](handleError(_0x78efa0,null));};exports[_0x7d0d('0x65')]=function(_0x37f63e,_0x306dc7,_0x3b1cc8){var _0x2273a5;return db[_0x7d0d('0x38')]['find']({'where':{'id':_0x37f63e[_0x7d0d('0x54')]['id']}})[_0x7d0d('0x20')](handleEntityNotFound(_0x306dc7,null))[_0x7d0d('0x20')](function(_0x2acbdb){if(_0x2acbdb){return _0x2acbdb['removeMembers'](_0x37f63e[_0x7d0d('0x40')]['ids']);}})[_0x7d0d('0x20')](respondWithStatusCode(_0x306dc7,null))[_0x7d0d('0x52')](handleError(_0x306dc7,null));};exports[_0x7d0d('0x66')]=function(_0x2d5b6b,_0x2b3b4a,_0x29d5a3){if(_0x2d5b6b[_0x7d0d('0x58')]['id']){delete _0x2d5b6b['body']['id'];}return db[_0x7d0d('0x38')]['find']({'where':{'id':_0x2d5b6b[_0x7d0d('0x54')]['id']}})[_0x7d0d('0x20')](handleEntityNotFound(_0x2b3b4a,null))[_0x7d0d('0x20')](function(_0x4484ae){if(_0x4484ae){_0x2d5b6b[_0x7d0d('0x58')][_0x7d0d('0x67')]=_0x4484ae['id'];return db[_0x7d0d('0x5c')][_0x7d0d('0x57')](_0x2d5b6b[_0x7d0d('0x58')]);}})['then'](respondWithResult(_0x2b3b4a,null))[_0x7d0d('0x52')](handleError(_0x2b3b4a,null));};exports['getMessages']=function(_0x39f597,_0x28a33b,_0x40b77e){var _0x1a0f4c={};var _0x8d1e94={};var _0x478ef0;var _0x515025;return db['ChatGroup']['findOne']({'where':{'id':_0x39f597[_0x7d0d('0x54')]['id']}})['then'](handleEntityNotFound(_0x28a33b,null))[_0x7d0d('0x20')](function(_0x1f638a){if(_0x1f638a){_0x478ef0=_0x1f638a;_0x8d1e94['model']=_[_0x7d0d('0x3b')](db[_0x7d0d('0x5c')]['rawAttributes']);_0x8d1e94[_0x7d0d('0x40')]=_[_0x7d0d('0x3b')](_0x39f597[_0x7d0d('0x40')]);_0x8d1e94[_0x7d0d('0x3c')]=_[_0x7d0d('0x3d')](_0x8d1e94[_0x7d0d('0x3a')],_0x8d1e94[_0x7d0d('0x40')]);_0x1a0f4c[_0x7d0d('0x3e')]=_[_0x7d0d('0x3d')](_0x8d1e94['model'],qs[_0x7d0d('0x3f')](_0x39f597[_0x7d0d('0x40')]['fields']));_0x1a0f4c[_0x7d0d('0x3e')]=_0x1a0f4c[_0x7d0d('0x3e')]['length']?_0x1a0f4c[_0x7d0d('0x3e')]:_0x8d1e94[_0x7d0d('0x3a')];_0x1a0f4c[_0x7d0d('0x43')]=qs[_0x7d0d('0x44')](_0x39f597[_0x7d0d('0x40')]['sort']);_0x1a0f4c[_0x7d0d('0x45')]=qs['filters'](_[_0x7d0d('0x46')](_0x39f597[_0x7d0d('0x40')],_0x8d1e94[_0x7d0d('0x3c')]));if(_0x39f597[_0x7d0d('0x40')]['filter']){_0x1a0f4c[_0x7d0d('0x45')]=_[_0x7d0d('0x47')](_0x1a0f4c[_0x7d0d('0x45')],{'$or':_['map'](_0x1a0f4c['attributes'],function(_0x4c5cba){var _0x4e05fb={};_0x4e05fb[_0x4c5cba]={'$like':'%'+_0x39f597[_0x7d0d('0x40')][_0x7d0d('0x4c')]+'%'};return _0x4e05fb;})});}if(_0x39f597[_0x7d0d('0x40')][_0x7d0d('0x68')]){var _0x436238=_0x39f597[_0x7d0d('0x40')]['$gte']['split'](',');var _0x1e43c0={};_0x1e43c0[_0x436238[0x0]]={'$gte':moment(_0x436238[0x1])[_0x7d0d('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1a0f4c[_0x7d0d('0x45')]=_[_0x7d0d('0x47')](_0x1a0f4c[_0x7d0d('0x45')],_0x1e43c0);}_0x1a0f4c=_[_0x7d0d('0x47')]({},_0x1a0f4c,_0x39f597[_0x7d0d('0x55')]);return _0x478ef0[_0x7d0d('0x6a')](_0x1a0f4c);}})[_0x7d0d('0x20')](function(_0x19f4ff){if(_0x19f4ff){_0x515025=_0x19f4ff[_0x7d0d('0x41')];if(!_0x39f597[_0x7d0d('0x40')][_0x7d0d('0x42')](_0x7d0d('0x6b'))){_0x1a0f4c[_0x7d0d('0x2d')]=qs[_0x7d0d('0x2d')](_0x39f597['query'][_0x7d0d('0x2d')]);_0x1a0f4c['offset']=qs[_0x7d0d('0x2c')](_0x39f597[_0x7d0d('0x40')]['offset']);}return _0x478ef0['getMessages'](_0x1a0f4c);}})[_0x7d0d('0x20')](function(_0x347476){if(_0x347476){return _0x347476?{'count':_0x515025,'rows':_0x347476}:null;}})[_0x7d0d('0x20')](respondWithResult(_0x28a33b,null))['catch'](handleError(_0x28a33b,null));}; \ No newline at end of file +var _0x736f=['filter','merge','map','type','VIRTUAL','field','ChatGroup','count','includeAll','rows','show','params','rawAttributes','include','find','create','update','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','User','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','options','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','client','http','request','info','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','then','destroy','stack','name','send','index','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x736f,0xf6));var _0xf736=function(_0x4a0d07,_0x4b198a){_0x4a0d07=_0x4a0d07-0x0;var _0xfbce68=_0x736f[_0x4a0d07];return _0xfbce68;};'use strict';var pdf=require(_0xf736('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf736('0x1'));var jsonpatch=require(_0xf736('0x2'));var rp=require(_0xf736('0x3'));var moment=require(_0xf736('0x4'));var BPromise=require(_0xf736('0x5'));var Mustache=require(_0xf736('0x6'));var util=require(_0xf736('0x7'));var path=require(_0xf736('0x8'));var sox=require(_0xf736('0x9'));var csv=require('to-csv');var ejs=require(_0xf736('0xa'));var fs=require('fs');var _=require(_0xf736('0xb'));var squel=require(_0xf736('0xc'));var crypto=require(_0xf736('0xd'));var jsforce=require(_0xf736('0xe'));var deskjs=require(_0xf736('0xf'));var toCsv=require(_0xf736('0x10'));var querystring=require(_0xf736('0x11'));var Papa=require(_0xf736('0x12'));var authService=require(_0xf736('0x13'));var hardwareService=require(_0xf736('0x14'));var Redis=require(_0xf736('0x15'));var qs=require(_0xf736('0x16'));var logger=require('../../config/logger')(_0xf736('0x17'));var utils=require('../../config/utils');var config=require(_0xf736('0x18'));var db=require(_0xf736('0x19'))['db'];config[_0xf736('0x1a')]=_[_0xf736('0x1b')](config[_0xf736('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf736('0x1c'))(new Redis(config[_0xf736('0x1a')]));require(_0xf736('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf736('0x1e')][_0xf736('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x9a1021,_0x24f741,_0x538ece,_0xefcd30){return new BPromise(function(_0x6f567,_0x19e4fc){var _0x3b961b=_0xefcd30||client;return _0x3b961b[_0xf736('0x20')](_0x9a1021,_0x538ece)['then'](function(_0xb8d46d){logger[_0xf736('0x21')]('ChatGroup,\x20%s,\x20%s',_0x24f741,_0xf736('0x22'));logger[_0xf736('0x23')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x24f741,'request\x20sent',JSON[_0xf736('0x24')](_0xb8d46d));if(_0xb8d46d[_0xf736('0x25')]){if(_0xb8d46d['error'][_0xf736('0x26')]===0x1f4){logger[_0xf736('0x25')]('ChatGroup,\x20%s,\x20%s',_0x24f741,_0xb8d46d['error']['message']);return _0x19e4fc(_0xb8d46d[_0xf736('0x25')]['message']);}logger[_0xf736('0x25')](_0xf736('0x27'),_0x24f741,_0xb8d46d['error'][_0xf736('0x28')]);return _0x6f567(_0xb8d46d[_0xf736('0x25')][_0xf736('0x28')]);}else{logger['info'](_0xf736('0x27'),_0x24f741,'request\x20sent');_0x6f567(_0xb8d46d[_0xf736('0x29')]['message']);}})[_0xf736('0x2a')](function(_0x13e534){logger[_0xf736('0x25')](_0xf736('0x27'),_0x24f741,_0x13e534);_0x19e4fc(_0x13e534);});});}function respondWithStatusCode(_0x199adf,_0x386047){_0x386047=_0x386047||0xcc;return function(_0x3d2109){if(_0x3d2109){return _0x199adf[_0xf736('0x2b')](_0x386047);}return _0x199adf['status'](_0x386047)[_0xf736('0x2c')]();};}function respondWithResult(_0xf12bbf,_0x1cfee2){_0x1cfee2=_0x1cfee2||0xc8;return function(_0x1bb02a){if(_0x1bb02a){return _0xf12bbf[_0xf736('0x2d')](_0x1cfee2)[_0xf736('0x2e')](_0x1bb02a);}};}function respondWithFilteredResult(_0x9bcdb6,_0x4c6c48){return function(_0x251453){if(_0x251453){var _0x4546cc=_0x251453['count'],_0x56661b=_0x4c6c48[_0xf736('0x2f')],_0x3ea46e=_0x4c6c48['offset']+_0x4c6c48[_0xf736('0x30')],_0x5a5d1a;if(_0x3ea46e>=_0x4546cc){_0x3ea46e=_0x4546cc;_0x5a5d1a=0xc8;}else{_0x5a5d1a=0xce;}_0x9bcdb6[_0xf736('0x2d')](_0x5a5d1a);return _0x9bcdb6[_0xf736('0x31')](_0xf736('0x32'),_0x56661b+'-'+_0x3ea46e+'/'+_0x4546cc)[_0xf736('0x2e')](_0x251453);}return null;};}function patchUpdates(_0x555397){return function(_0x5c5557){try{jsonpatch['apply'](_0x5c5557,_0x555397,!![]);}catch(_0x17effd){return BPromise[_0xf736('0x33')](_0x17effd);}return _0x5c5557['save']();};}function saveUpdates(_0xad4cd1,_0x4fd74b){return function(_0x415076){if(_0x415076){return _0x415076['update'](_0xad4cd1)[_0xf736('0x34')](function(_0x58e39d){return _0x58e39d;});}return null;};}function removeEntity(_0x50187c,_0x41cc5a){return function(_0x19fa1a){if(_0x19fa1a){return _0x19fa1a[_0xf736('0x35')]()['then'](function(){_0x50187c['status'](0xcc)[_0xf736('0x2c')]();});}};}function handleEntityNotFound(_0x71901b,_0x3a1f2a){return function(_0x198dbc){if(!_0x198dbc){_0x71901b[_0xf736('0x2b')](0x194);}return _0x198dbc;};}function handleError(_0x2fefa6,_0x3df0f5){_0x3df0f5=_0x3df0f5||0x1f4;return function(_0x231ae0){logger['error'](_0x231ae0[_0xf736('0x36')]);if(_0x231ae0[_0xf736('0x37')]){delete _0x231ae0[_0xf736('0x37')];}_0x2fefa6[_0xf736('0x2d')](_0x3df0f5)[_0xf736('0x38')](_0x231ae0);};}exports[_0xf736('0x39')]=function(_0x514fbb,_0x428415){var _0x399226={},_0x4391a4={},_0x117c90={'count':0x0,'rows':[]};var _0x5d2ddb=db['ChatGroup']['rawAttributes'];_0x4391a4['model']=_[_0xf736('0x3a')](_0x5d2ddb);_0x4391a4[_0xf736('0x3b')]=_[_0xf736('0x3a')](_0x514fbb[_0xf736('0x3b')]);_0x4391a4[_0xf736('0x3c')]=_[_0xf736('0x3d')](_0x4391a4[_0xf736('0x3e')],_0x4391a4['query']);_0x399226[_0xf736('0x3f')]=_['intersection'](_0x4391a4[_0xf736('0x3e')],qs[_0xf736('0x40')](_0x514fbb[_0xf736('0x3b')][_0xf736('0x40')]));_0x399226['attributes']=_0x399226['attributes'][_0xf736('0x41')]?_0x399226['attributes']:_0x4391a4[_0xf736('0x3e')];if(!_0x514fbb['query'][_0xf736('0x42')](_0xf736('0x43'))){_0x399226[_0xf736('0x30')]=qs[_0xf736('0x30')](_0x514fbb[_0xf736('0x3b')]['limit']);_0x399226[_0xf736('0x2f')]=qs[_0xf736('0x2f')](_0x514fbb[_0xf736('0x3b')][_0xf736('0x2f')]);}_0x399226[_0xf736('0x44')]=qs[_0xf736('0x45')](_0x514fbb['query'][_0xf736('0x45')]);_0x399226[_0xf736('0x46')]=qs[_0xf736('0x3c')](_[_0xf736('0x47')](_0x514fbb[_0xf736('0x3b')],_0x4391a4['filters']));if(_0x514fbb[_0xf736('0x3b')][_0xf736('0x48')]){_0x399226[_0xf736('0x46')]=_[_0xf736('0x49')](_0x399226[_0xf736('0x46')],{'$or':_[_0xf736('0x4a')](_0x5d2ddb,function(_0x2c1ef9){if(_0x2c1ef9[_0xf736('0x4b')]['key']!==_0xf736('0x4c')){var _0x36213f={};_0x36213f[_0x2c1ef9[_0xf736('0x4d')]]={'$like':'%'+_0x514fbb[_0xf736('0x3b')]['filter']+'%'};return _0x36213f;}})});}_0x399226=_[_0xf736('0x49')]({},_0x399226,_0x514fbb['options']);var _0x258a98={'where':_0x399226['where']};return db[_0xf736('0x4e')][_0xf736('0x4f')](_0x258a98)[_0xf736('0x34')](function(_0x41e87d){_0x117c90[_0xf736('0x4f')]=_0x41e87d;if(_0x514fbb[_0xf736('0x3b')][_0xf736('0x50')]){_0x399226['include']=[{'all':!![]}];}return db[_0xf736('0x4e')]['findAll'](_0x399226);})['then'](function(_0x21ad7c){_0x117c90[_0xf736('0x51')]=_0x21ad7c;return _0x117c90;})['then'](respondWithFilteredResult(_0x428415,_0x399226))['catch'](handleError(_0x428415,null));};exports[_0xf736('0x52')]=function(_0x1a80ae,_0x119c77){var _0x51d398={'raw':!![],'where':{'id':_0x1a80ae[_0xf736('0x53')]['id']}},_0x591aed={};_0x591aed[_0xf736('0x3e')]=_[_0xf736('0x3a')](db['ChatGroup'][_0xf736('0x54')]);_0x591aed[_0xf736('0x3b')]=_['keys'](_0x1a80ae[_0xf736('0x3b')]);_0x591aed[_0xf736('0x3c')]=_[_0xf736('0x3d')](_0x591aed[_0xf736('0x3e')],_0x591aed['query']);_0x51d398[_0xf736('0x3f')]=_[_0xf736('0x3d')](_0x591aed['model'],qs['fields'](_0x1a80ae['query'][_0xf736('0x40')]));_0x51d398['attributes']=_0x51d398[_0xf736('0x3f')][_0xf736('0x41')]?_0x51d398['attributes']:_0x591aed['model'];if(_0x1a80ae['query'][_0xf736('0x50')]){_0x51d398[_0xf736('0x55')]=[{'all':!![]}];}_0x51d398=_[_0xf736('0x49')]({},_0x51d398,_0x1a80ae['options']);return db[_0xf736('0x4e')][_0xf736('0x56')](_0x51d398)[_0xf736('0x34')](handleEntityNotFound(_0x119c77,null))[_0xf736('0x34')](respondWithResult(_0x119c77,null))[_0xf736('0x2a')](handleError(_0x119c77,null));};exports[_0xf736('0x57')]=function(_0x83c0b6,_0x302577){return db[_0xf736('0x4e')]['create'](_0x83c0b6['body'],{})['then'](respondWithResult(_0x302577,0xc9))[_0xf736('0x2a')](handleError(_0x302577,null));};exports[_0xf736('0x58')]=function(_0x268fe6,_0x2e5745){if(_0x268fe6[_0xf736('0x59')]['id']){delete _0x268fe6['body']['id'];}return db[_0xf736('0x4e')][_0xf736('0x56')]({'where':{'id':_0x268fe6['params']['id']}})[_0xf736('0x34')](handleEntityNotFound(_0x2e5745,null))[_0xf736('0x34')](saveUpdates(_0x268fe6[_0xf736('0x59')],null))['then'](respondWithResult(_0x2e5745,null))[_0xf736('0x2a')](handleError(_0x2e5745,null));};exports['destroy']=function(_0x4a5160,_0x34570a){return db[_0xf736('0x4e')][_0xf736('0x56')]({'where':{'id':_0x4a5160[_0xf736('0x53')]['id']}})[_0xf736('0x34')](handleEntityNotFound(_0x34570a,null))[_0xf736('0x34')](removeEntity(_0x34570a,null))[_0xf736('0x2a')](handleError(_0x34570a,null));};exports[_0xf736('0x5a')]=function(_0x3b4227,_0x487779){return db[_0xf736('0x4e')][_0xf736('0x5a')]()[_0xf736('0x34')](respondWithResult(_0x487779,null))[_0xf736('0x2a')](handleError(_0x487779,null));};exports[_0xf736('0x5b')]=function(_0x503896,_0x200728,_0x2834fb){return db[_0xf736('0x5c')][_0xf736('0x4f')]({'where':{'ChatGroupId':_0x503896[_0xf736('0x53')]['id'],'ToId':_0x503896['user']['id'],'read':![]}})[_0xf736('0x34')](function(_0x4b50f5){return{'id':_[_0xf736('0x5d')](_0x503896[_0xf736('0x53')]['id']),'count':_0x4b50f5};})[_0xf736('0x34')](respondWithResult(_0x200728,null))[_0xf736('0x2a')](handleError(_0x200728,null));};exports[_0xf736('0x5e')]=function(_0x3490e5,_0x2ad553,_0x54c724){return db[_0xf736('0x4e')]['find']({'where':{'id':_0x3490e5[_0xf736('0x53')]['id']}})[_0xf736('0x34')](handleEntityNotFound(_0x2ad553,null))['then'](function(_0x43d0c1){if(_0x43d0c1){return _0x43d0c1[_0xf736('0x5e')](_0x3490e5['body'][_0xf736('0x5f')],_['omit'](_0x3490e5[_0xf736('0x59')],[_0xf736('0x5f'),'id'])||{});}})[_0xf736('0x34')](respondWithResult(_0x2ad553,null))[_0xf736('0x2a')](handleError(_0x2ad553,null));};exports['getMembers']=function(_0xd7a404,_0x4fe70c,_0x23e6e1){var _0x8bd3d={};var _0x510ccb={};var _0x492509;var _0x329506;return db[_0xf736('0x4e')]['findOne']({'where':{'id':_0xd7a404[_0xf736('0x53')]['id']}})['then'](handleEntityNotFound(_0x4fe70c,null))[_0xf736('0x34')](function(_0x434976){if(_0x434976){_0x492509=_0x434976;_0x510ccb[_0xf736('0x3e')]=_['keys'](db[_0xf736('0x60')][_0xf736('0x54')]);_0x510ccb[_0xf736('0x3b')]=_[_0xf736('0x3a')](_0xd7a404[_0xf736('0x3b')]);_0x510ccb[_0xf736('0x3c')]=_[_0xf736('0x3d')](_0x510ccb[_0xf736('0x3e')],_0x510ccb['query']);_0x8bd3d['attributes']=_[_0xf736('0x3d')](_0x510ccb['model'],qs[_0xf736('0x40')](_0xd7a404[_0xf736('0x3b')][_0xf736('0x40')]));_0x8bd3d['attributes']=_0x8bd3d[_0xf736('0x3f')][_0xf736('0x41')]?_0x8bd3d[_0xf736('0x3f')]:_0x510ccb[_0xf736('0x3e')];_0x8bd3d[_0xf736('0x44')]=qs[_0xf736('0x45')](_0xd7a404[_0xf736('0x3b')]['sort']);_0x8bd3d[_0xf736('0x46')]=qs[_0xf736('0x3c')](_[_0xf736('0x47')](_0xd7a404[_0xf736('0x3b')],_0x510ccb['filters']));if(_0xd7a404['query'][_0xf736('0x48')]){_0x8bd3d['where']=_[_0xf736('0x49')](_0x8bd3d[_0xf736('0x46')],{'$or':_[_0xf736('0x4a')](_0x8bd3d[_0xf736('0x3f')],function(_0x16bc4f){var _0x47130a={};_0x47130a[_0x16bc4f]={'$like':'%'+_0xd7a404[_0xf736('0x3b')][_0xf736('0x48')]+'%'};return _0x47130a;})});}_0x8bd3d=_[_0xf736('0x49')]({},_0x8bd3d,_0xd7a404['options']);return _0x492509[_0xf736('0x61')](_0x8bd3d);}})[_0xf736('0x34')](function(_0x52a229){if(_0x52a229){_0x329506=_0x52a229[_0xf736('0x41')];if(!_0xd7a404['query'][_0xf736('0x42')](_0xf736('0x43'))){_0x8bd3d[_0xf736('0x30')]=qs[_0xf736('0x30')](_0xd7a404[_0xf736('0x3b')]['limit']);_0x8bd3d[_0xf736('0x2f')]=qs['offset'](_0xd7a404['query'][_0xf736('0x2f')]);}return _0x492509[_0xf736('0x61')](_0x8bd3d);}})['then'](function(_0x430ae6){if(_0x430ae6){return _0x430ae6?{'count':_0x329506,'rows':_0x430ae6}:null;}})[_0xf736('0x34')](respondWithResult(_0x4fe70c,null))[_0xf736('0x2a')](handleError(_0x4fe70c,null));};exports[_0xf736('0x62')]=function(_0x3f3de5,_0x49aa32,_0x209884){var _0x47bbca;return db['ChatGroup'][_0xf736('0x56')]({'where':{'id':_0x3f3de5[_0xf736('0x53')]['id']}})[_0xf736('0x34')](handleEntityNotFound(_0x49aa32,null))[_0xf736('0x34')](function(_0xd5bc16){if(_0xd5bc16){return _0xd5bc16[_0xf736('0x62')](_0x3f3de5['query']['ids']);}})[_0xf736('0x34')](respondWithStatusCode(_0x49aa32,null))['catch'](handleError(_0x49aa32,null));};exports[_0xf736('0x63')]=function(_0x1cb2fe,_0x128c4c,_0x29d5f8){if(_0x1cb2fe[_0xf736('0x59')]['id']){delete _0x1cb2fe[_0xf736('0x59')]['id'];}return db[_0xf736('0x4e')]['find']({'where':{'id':_0x1cb2fe[_0xf736('0x53')]['id']}})['then'](handleEntityNotFound(_0x128c4c,null))[_0xf736('0x34')](function(_0x5ea115){if(_0x5ea115){_0x1cb2fe[_0xf736('0x59')][_0xf736('0x64')]=_0x5ea115['id'];return db[_0xf736('0x5c')][_0xf736('0x57')](_0x1cb2fe[_0xf736('0x59')]);}})['then'](respondWithResult(_0x128c4c,null))[_0xf736('0x2a')](handleError(_0x128c4c,null));};exports[_0xf736('0x65')]=function(_0x41aedc,_0x3fb33a,_0x3895d0){var _0x3d423b={};var _0x2f189c={};var _0x167586;var _0x31e2a4;return db[_0xf736('0x4e')][_0xf736('0x66')]({'where':{'id':_0x41aedc['params']['id']}})[_0xf736('0x34')](handleEntityNotFound(_0x3fb33a,null))[_0xf736('0x34')](function(_0x2fb6f2){if(_0x2fb6f2){_0x167586=_0x2fb6f2;_0x2f189c[_0xf736('0x3e')]=_[_0xf736('0x3a')](db['ChatInternalMessage'][_0xf736('0x54')]);_0x2f189c[_0xf736('0x3b')]=_['keys'](_0x41aedc[_0xf736('0x3b')]);_0x2f189c[_0xf736('0x3c')]=_[_0xf736('0x3d')](_0x2f189c['model'],_0x2f189c['query']);_0x3d423b[_0xf736('0x3f')]=_[_0xf736('0x3d')](_0x2f189c[_0xf736('0x3e')],qs[_0xf736('0x40')](_0x41aedc[_0xf736('0x3b')][_0xf736('0x40')]));_0x3d423b[_0xf736('0x3f')]=_0x3d423b[_0xf736('0x3f')][_0xf736('0x41')]?_0x3d423b[_0xf736('0x3f')]:_0x2f189c['model'];_0x3d423b[_0xf736('0x44')]=qs['sort'](_0x41aedc[_0xf736('0x3b')][_0xf736('0x45')]);_0x3d423b[_0xf736('0x46')]=qs[_0xf736('0x3c')](_['pick'](_0x41aedc[_0xf736('0x3b')],_0x2f189c[_0xf736('0x3c')]));if(_0x41aedc[_0xf736('0x3b')]['filter']){_0x3d423b[_0xf736('0x46')]=_[_0xf736('0x49')](_0x3d423b[_0xf736('0x46')],{'$or':_[_0xf736('0x4a')](_0x3d423b[_0xf736('0x3f')],function(_0x1b9f13){var _0x37322a={};_0x37322a[_0x1b9f13]={'$like':'%'+_0x41aedc[_0xf736('0x3b')][_0xf736('0x48')]+'%'};return _0x37322a;})});}if(_0x41aedc[_0xf736('0x3b')][_0xf736('0x67')]){var _0x1590a8=_0x41aedc[_0xf736('0x3b')][_0xf736('0x67')]['split'](',');var _0x277419={};_0x277419[_0x1590a8[0x0]]={'$gte':moment(_0x1590a8[0x1])['format'](_0xf736('0x68'))};_0x3d423b['where']=_[_0xf736('0x49')](_0x3d423b[_0xf736('0x46')],_0x277419);}_0x3d423b=_[_0xf736('0x49')]({},_0x3d423b,_0x41aedc[_0xf736('0x69')]);return _0x167586['getMessages'](_0x3d423b);}})['then'](function(_0x1898f3){if(_0x1898f3){_0x31e2a4=_0x1898f3[_0xf736('0x41')];if(!_0x41aedc[_0xf736('0x3b')][_0xf736('0x42')](_0xf736('0x43'))){_0x3d423b['limit']=qs['limit'](_0x41aedc[_0xf736('0x3b')]['limit']);_0x3d423b[_0xf736('0x2f')]=qs[_0xf736('0x2f')](_0x41aedc['query']['offset']);}return _0x167586[_0xf736('0x65')](_0x3d423b);}})[_0xf736('0x34')](function(_0x4dec2b){if(_0x4dec2b){return _0x4dec2b?{'count':_0x31e2a4,'rows':_0x4dec2b}:null;}})[_0xf736('0x34')](respondWithResult(_0x3fb33a,null))[_0xf736('0x2a')](handleError(_0x3fb33a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 9be7300..6a8cd69 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 _0x2c80=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x2c80,0x1cb));var _0x02c8=function(_0x19922e,_0x3d380d){_0x19922e=_0x19922e-0x0;var _0x1fe954=_0x2c80[_0x19922e];return _0x1fe954;};'use strict';var EventEmitter=require(_0x02c8('0x0'));var ChatGroup=require(_0x02c8('0x1'))['db'][_0x02c8('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x02c8('0x3')](0x0);var events={'afterCreate':_0x02c8('0x4'),'afterUpdate':_0x02c8('0x5'),'afterDestroy':_0x02c8('0x6')};function emitEvent(_0x599c07){return function(_0x5a86a5,_0x21ebda,_0x1f76ba){ChatGroupEvents[_0x02c8('0x7')](_0x599c07+':'+_0x5a86a5['id'],_0x5a86a5);ChatGroupEvents[_0x02c8('0x7')](_0x599c07,_0x5a86a5);_0x1f76ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x02c8('0x8')](e,emitEvent(event));}}module[_0x02c8('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xb8c8=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xb8c8,0xbd));var _0x8b8c=function(_0x415b2c,_0x3735b2){_0x415b2c=_0x415b2c-0x0;var _0x3ea55d=_0xb8c8[_0x415b2c];return _0x3ea55d;};'use strict';var EventEmitter=require(_0x8b8c('0x0'));var ChatGroup=require(_0x8b8c('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8b8c('0x2'),'afterUpdate':_0x8b8c('0x3'),'afterDestroy':_0x8b8c('0x4')};function emitEvent(_0x5ec4cc){return function(_0x49ccfd,_0x56d67a,_0x46d5d0){ChatGroupEvents[_0x8b8c('0x5')](_0x5ec4cc+':'+_0x49ccfd['id'],_0x49ccfd);ChatGroupEvents[_0x8b8c('0x5')](_0x5ec4cc,_0x49ccfd);_0x46d5d0(null);};}for(var e in events){if(events[_0x8b8c('0x6')](e)){var event=events[e];ChatGroup[_0x8b8c('0x7')](e,emitEvent(event));}}module[_0x8b8c('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index d751f9b..5df76e6 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 _0x9c1d=['util','../../config/logger','api','moment','bluebird','./chatGroup.attributes','define','chat_groups','lodash'];(function(_0x4bef2c,_0x24b163){var _0x451c0f=function(_0x60ec06){while(--_0x60ec06){_0x4bef2c['push'](_0x4bef2c['shift']());}};_0x451c0f(++_0x24b163);}(_0x9c1d,0x179));var _0xd9c1=function(_0x34d6cd,_0x4590ec){_0x34d6cd=_0x34d6cd-0x0;var _0x5824df=_0x9c1d[_0x34d6cd];return _0x5824df;};'use strict';var _=require(_0xd9c1('0x0'));var util=require(_0xd9c1('0x1'));var logger=require(_0xd9c1('0x2'))(_0xd9c1('0x3'));var moment=require(_0xd9c1('0x4'));var BPromise=require(_0xd9c1('0x5'));var rp=require('request-promise');var attributes=require(_0xd9c1('0x6'));module['exports']=function(_0x29eb40,_0x12cd6a){return _0x29eb40[_0xd9c1('0x7')]('ChatGroup',attributes,{'tableName':_0xd9c1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb077=['ChatGroup','chat_groups','lodash','api','bluebird','request-promise','./chatGroup.attributes','exports'];(function(_0x16a208,_0x52f1ad){var _0x1613e4=function(_0x1da8e2){while(--_0x1da8e2){_0x16a208['push'](_0x16a208['shift']());}};_0x1613e4(++_0x52f1ad);}(_0xb077,0x7a));var _0x7b07=function(_0x4265e1,_0x55d1b0){_0x4265e1=_0x4265e1-0x0;var _0x862f62=_0xb077[_0x4265e1];return _0x862f62;};'use strict';var _=require(_0x7b07('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7b07('0x1'));var moment=require('moment');var BPromise=require(_0x7b07('0x2'));var rp=require(_0x7b07('0x3'));var attributes=require(_0x7b07('0x4'));module[_0x7b07('0x5')]=function(_0x423957,_0x5df1bf){return _0x423957['define'](_0x7b07('0x6'),attributes,{'tableName':_0x7b07('0x7'),'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 b64ab0b..9af793b 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 _0x5fd1=['http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x258ba3,_0x2556d1){var _0x6f0e39=function(_0x935359){while(--_0x935359){_0x258ba3['push'](_0x258ba3['shift']());}};_0x6f0e39(++_0x2556d1);}(_0x5fd1,0x155));var _0x15fd=function(_0xfa05f9,_0x366925){_0xfa05f9=_0xfa05f9-0x0;var _0x4167c0=_0x5fd1[_0xfa05f9];return _0x4167c0;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./chatGroup.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('ChatGroup,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});} \ No newline at end of file +var _0xa41a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./chatGroup.socket','register','request','info','debug','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x434de9,_0x4b62cf){var _0x3f8456=function(_0x5932e0){while(--_0x5932e0){_0x434de9['push'](_0x434de9['shift']());}};_0x3f8456(++_0x4b62cf);}(_0xa41a,0x6b));var _0xaa41=function(_0x4ed7fc,_0x420bc2){_0x4ed7fc=_0x4ed7fc-0x0;var _0x24a9a2=_0xa41a[_0x4ed7fc];return _0x24a9a2;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaa41('0xc')],{'host':_0xaa41('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xc')]));require(_0xaa41('0xe'))[_0xaa41('0xf')](socket);function respondWithRpcPromise(_0x1cc344,_0x4263d6,_0x38d930){return new BPromise(function(_0x806f08,_0x423a19){return client[_0xaa41('0x10')](_0x1cc344,_0x38d930)['then'](function(_0x1d3aac){logger[_0xaa41('0x11')]('ChatGroup,\x20%s,\x20%s',_0x4263d6,'request\x20sent');logger[_0xaa41('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4263d6,_0xaa41('0x13'),JSON[_0xaa41('0x14')](_0x1d3aac));if(_0x1d3aac[_0xaa41('0x15')]){if(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x16')]===0x1f4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);return _0x423a19(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}logger[_0xaa41('0x15')](_0xaa41('0x17'),_0x4263d6,_0x1d3aac['error'][_0xaa41('0x18')]);return _0x806f08(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}else{logger[_0xaa41('0x11')](_0xaa41('0x17'),_0x4263d6,_0xaa41('0x13'));_0x806f08(_0x1d3aac[_0xaa41('0x19')][_0xaa41('0x18')]);}})[_0xaa41('0x1a')](function(_0x4fe1a4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x4fe1a4);_0x423a19(_0x4fe1a4);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 02ae4ed..79dafb6 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 _0xc91b=['save','remove','update','emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0xc91b,0x16f));var _0xbc91=function(_0x1ffb8e,_0x295305){_0x1ffb8e=_0x1ffb8e-0x0;var _0x2457f2=_0xc91b[_0x1ffb8e];return _0x2457f2;};'use strict';var ChatGroupEvents=require(_0xbc91('0x0'));var events=[_0xbc91('0x1'),_0xbc91('0x2'),_0xbc91('0x3')];function createListener(_0x2a5f39,_0xb4810d){return function(_0x1ac340){_0xb4810d[_0xbc91('0x4')](_0x2a5f39,_0x1ac340);};}function removeListener(_0x5e8e01,_0x38fe3a){return function(){ChatGroupEvents[_0xbc91('0x5')](_0x5e8e01,_0x38fe3a);};}exports['register']=function(_0x222ed7){for(var _0x1e295b=0x0,_0x535cb9=events[_0xbc91('0x6')];_0x1e295b<_0x535cb9;_0x1e295b++){var _0x43731a=events[_0x1e295b];var _0x36e15f=createListener(_0xbc91('0x7')+_0x43731a,_0x222ed7);ChatGroupEvents['on'](_0x43731a,_0x36e15f);}}; \ No newline at end of file +var _0xc817=['update','emit','removeListener','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x470862,_0x433211){var _0x2ebba1=function(_0x126b2d){while(--_0x126b2d){_0x470862['push'](_0x470862['shift']());}};_0x2ebba1(++_0x433211);}(_0xc817,0x75));var _0x7c81=function(_0x2a1890,_0x26e351){_0x2a1890=_0x2a1890-0x0;var _0x4f7b76=_0xc817[_0x2a1890];return _0x4f7b76;};'use strict';var ChatGroupEvents=require(_0x7c81('0x0'));var events=[_0x7c81('0x1'),_0x7c81('0x2'),_0x7c81('0x3')];function createListener(_0x53e1aa,_0x353095){return function(_0x2f41d3){_0x353095[_0x7c81('0x4')](_0x53e1aa,_0x2f41d3);};}function removeListener(_0x29448a,_0x298913){return function(){ChatGroupEvents[_0x7c81('0x5')](_0x29448a,_0x298913);};}exports['register']=function(_0x2113a0){for(var _0x225081=0x0,_0x5d0573=events[_0x7c81('0x6')];_0x225081<_0x5d0573;_0x225081++){var _0x21ddc2=events[_0x225081];var _0x5025de=createListener(_0x7c81('0x7')+_0x21ddc2,_0x2113a0);ChatGroupEvents['on'](_0x21ddc2,_0x5025de);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 7e3bea1..e128a89 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 _0xe159=['getMembers','/:id/messages','post','addMembers','addMessage','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/members'];(function(_0x26a3a4,_0x253d57){var _0x2dbc4a=function(_0x514962){while(--_0x514962){_0x26a3a4['push'](_0x26a3a4['shift']());}};_0x2dbc4a(++_0x253d57);}(_0xe159,0x176));var _0x9e15=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe159[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x9e15('0x0'));var util=require(_0x9e15('0x1'));var path=require(_0x9e15('0x2'));var timeout=require(_0x9e15('0x3'));var express=require(_0x9e15('0x4'));var router=express[_0x9e15('0x5')]();var auth=require(_0x9e15('0x6'));var interaction=require(_0x9e15('0x7'));var config=require(_0x9e15('0x8'));var controller=require(_0x9e15('0x9'));router[_0x9e15('0xa')]('/',auth[_0x9e15('0xb')](),controller[_0x9e15('0xc')]);router[_0x9e15('0xa')]('/describe',auth[_0x9e15('0xb')](),controller['describe']);router['get'](_0x9e15('0xd'),auth['isAuthenticated'](),controller[_0x9e15('0xe')]);router[_0x9e15('0xa')](_0x9e15('0xf'),auth[_0x9e15('0xb')](),controller[_0x9e15('0x10')]);router[_0x9e15('0xa')](_0x9e15('0x11'),auth[_0x9e15('0xb')](),controller[_0x9e15('0x12')]);router[_0x9e15('0xa')](_0x9e15('0x13'),auth[_0x9e15('0xb')](),controller['getMessages']);router[_0x9e15('0x14')]('/',auth[_0x9e15('0xb')](),controller['create']);router[_0x9e15('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0x9e15('0x15')]);router[_0x9e15('0x14')]('/:id/messages',auth[_0x9e15('0xb')](),controller[_0x9e15('0x16')]);router[_0x9e15('0x17')]('/:id',auth[_0x9e15('0xb')](),controller[_0x9e15('0x18')]);router[_0x9e15('0x19')](_0x9e15('0xd'),auth[_0x9e15('0xb')](),controller[_0x9e15('0x1a')]);router[_0x9e15('0x19')]('/:id/members',auth[_0x9e15('0xb')](),controller['removeMembers']);module[_0x9e15('0x1b')]=router; \ No newline at end of file +var _0x98fa=['Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','/:id/members','getMembers','getMessages','create','post','/:id/messages','addMessage','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x98fa,0x11a));var _0xa98f=function(_0x403af3,_0x358849){_0x403af3=_0x403af3-0x0;var _0x4b3b2f=_0x98fa[_0x403af3];return _0x4b3b2f;};'use strict';var multer=require(_0xa98f('0x0'));var util=require(_0xa98f('0x1'));var path=require(_0xa98f('0x2'));var timeout=require(_0xa98f('0x3'));var express=require('express');var router=express[_0xa98f('0x4')]();var auth=require(_0xa98f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa98f('0x6'));var controller=require(_0xa98f('0x7'));router[_0xa98f('0x8')]('/',auth[_0xa98f('0x9')](),controller[_0xa98f('0xa')]);router[_0xa98f('0x8')](_0xa98f('0xb'),auth[_0xa98f('0x9')](),controller[_0xa98f('0xc')]);router[_0xa98f('0x8')](_0xa98f('0xd'),auth['isAuthenticated'](),controller[_0xa98f('0xe')]);router['get'](_0xa98f('0xf'),auth[_0xa98f('0x9')](),controller['getUnread']);router[_0xa98f('0x8')](_0xa98f('0x10'),auth[_0xa98f('0x9')](),controller[_0xa98f('0x11')]);router[_0xa98f('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0xa98f('0x12')]);router['post']('/',auth[_0xa98f('0x9')](),controller[_0xa98f('0x13')]);router[_0xa98f('0x14')]('/:id/members',auth[_0xa98f('0x9')](),controller['addMembers']);router[_0xa98f('0x14')](_0xa98f('0x15'),auth['isAuthenticated'](),controller[_0xa98f('0x16')]);router['put'](_0xa98f('0xd'),auth[_0xa98f('0x9')](),controller[_0xa98f('0x17')]);router[_0xa98f('0x18')](_0xa98f('0xd'),auth[_0xa98f('0x9')](),controller[_0xa98f('0x19')]);router[_0xa98f('0x18')](_0xa98f('0x10'),auth[_0xa98f('0x9')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index b59b16c..1d4d8e9 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 _0x878f=['long','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x878f,0x173));var _0xf878=function(_0x2b966b,_0x23e116){_0x2b966b=_0x2b966b-0x0;var _0x336421=_0x878f[_0x2b966b];return _0x336421;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'closed':{'type':Sequelize[_0xf878('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf878('0x2')]},'ratingType':{'type':Sequelize[_0xf878('0x3')](_0xf878('0x4'),_0xf878('0x5')),'defaultValue':_0xf878('0x4')},'ratingMessage':{'type':Sequelize[_0xf878('0x6')]},'pathTranscript':{'type':Sequelize[_0xf878('0x6')]},'mailTranscript':{'type':Sequelize[_0xf878('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf878('0x8')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xf878('0x7')]},'browserVersion':{'type':Sequelize[_0xf878('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf878('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize[_0xf878('0x7')]},'formData':{'type':Sequelize[_0xf878('0x6')](_0xf878('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xf878('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf878('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf878('0x7')]}}; \ No newline at end of file +var _0xb62e=['BOOLEAN','INTEGER','star','thumb','TEXT','STRING','long','DATE','ENUM','out','sequelize','exports'];(function(_0x14bbb1,_0x90c4c4){var _0x4781e4=function(_0x384d68){while(--_0x384d68){_0x14bbb1['push'](_0x14bbb1['shift']());}};_0x4781e4(++_0x90c4c4);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'closed':{'type':Sequelize[_0xeb62('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb62('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xeb62('0x4'),_0xeb62('0x5')),'defaultValue':_0xeb62('0x4')},'ratingMessage':{'type':Sequelize[_0xeb62('0x6')]},'pathTranscript':{'type':Sequelize[_0xeb62('0x6')]},'mailTranscript':{'type':Sequelize[_0xeb62('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeb62('0x7')]},'note':{'type':Sequelize[_0xeb62('0x7')]},'browserName':{'type':Sequelize[_0xeb62('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xeb62('0x7')]},'osVersion':{'type':Sequelize[_0xeb62('0x7')]},'deviceModel':{'type':Sequelize[_0xeb62('0x7')]},'deviceVendor':{'type':Sequelize[_0xeb62('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize[_0xeb62('0x7')]},'formData':{'type':Sequelize[_0xeb62('0x6')](_0xeb62('0x8'))},'read1stAt':{'type':Sequelize[_0xeb62('0x9')]},'lastMsgAt':{'type':Sequelize[_0xeb62('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xeb62('0xa')]('in',_0xeb62('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb62('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a642487..79d62dd 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 _0x5e53=['port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','user','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','order','map','$gte','YYYY-MM-DD\x20HH:mm:ss','nolimit','pick','includeAgent','push','setTags','chatInteractionTags:save','removeTags','download','unix','files','tmp','server','firstName','Letter','1cm','mkdirSync','

Chat\x20Interaction:\x20#%d

','toString','
','','%s:\x20%s

','existsSync','createReadStream','createWriteStream','toFile','interaction-','.pdf','log','err','unlinkSync','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','./chatInteraction.socket','register','jayson/promise','http','client','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','merge','key','VIRTUAL','filter','options','include','tag','Tag','Tags','read','ChatMessage','Messages','createdAt','distinct','ChatInteraction','includeAll','Users','CmContact','Contact','User','Owner','fullname','internal','Account','color','ThroughTags','findAll','rows','show','params','length','find','create','body','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Sequelize','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','Attachment','attachmentDownload','findOne','Unauthorized','attachId','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ChatWebsite','ContactId','agentAlias','System','customer','%s%d','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service'];(function(_0x570571,_0x513c24){var _0x2882fe=function(_0x5c40fb){while(--_0x5c40fb){_0x570571['push'](_0x570571['shift']());}};_0x2882fe(++_0x513c24);}(_0x5e53,0xf5));var _0x35e5=function(_0x866770,_0x5217ec){_0x866770=_0x866770-0x0;var _0x3d9580=_0x5e53[_0x866770];return _0x3d9580;};'use strict';var pdf=require(_0x35e5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x35e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35e5('0x2'));var moment=require(_0x35e5('0x3'));var BPromise=require(_0x35e5('0x4'));var Mustache=require(_0x35e5('0x5'));var util=require(_0x35e5('0x6'));var path=require('path');var sox=require(_0x35e5('0x7'));var csv=require(_0x35e5('0x8'));var ejs=require(_0x35e5('0x9'));var fs=require('fs');var _=require(_0x35e5('0xa'));var squel=require(_0x35e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x35e5('0xc'));var deskjs=require(_0x35e5('0xd'));var toCsv=require(_0x35e5('0x8'));var querystring=require(_0x35e5('0xe'));var Papa=require(_0x35e5('0xf'));var authService=require(_0x35e5('0x10'));var hardwareService=require(_0x35e5('0x11'));var Redis=require('ioredis');var qs=require(_0x35e5('0x12'));var logger=require('../../config/logger')(_0x35e5('0x13'));var utils=require('../../config/utils');var config=require(_0x35e5('0x14'));var db=require(_0x35e5('0x15'))['db'];config[_0x35e5('0x16')]=_['defaults'](config[_0x35e5('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x35e5('0x17'))[_0x35e5('0x18')](socket);var jayson=require(_0x35e5('0x19'));var client=jayson['client'][_0x35e5('0x1a')]({'port':0x232b});var client9004=jayson[_0x35e5('0x1b')][_0x35e5('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x40d02f,_0x32e8d1,_0x5da14a,_0x2483aa){return new BPromise(function(_0x5c6248,_0x460ec5){var _0x3b8d13=_0x2483aa||client;return _0x3b8d13['request'](_0x40d02f,_0x5da14a)['then'](function(_0x35acbe){logger[_0x35e5('0x1c')](_0x35e5('0x1d'),_0x32e8d1,_0x35e5('0x1e'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x32e8d1,_0x35e5('0x1e'),JSON[_0x35e5('0x1f')](_0x35acbe));if(_0x35acbe[_0x35e5('0x20')]){if(_0x35acbe[_0x35e5('0x20')]['code']===0x1f4){logger[_0x35e5('0x20')](_0x35e5('0x1d'),_0x32e8d1,_0x35acbe[_0x35e5('0x20')][_0x35e5('0x21')]);return _0x460ec5(_0x35acbe[_0x35e5('0x20')][_0x35e5('0x21')]);}logger[_0x35e5('0x20')](_0x35e5('0x1d'),_0x32e8d1,_0x35acbe[_0x35e5('0x20')][_0x35e5('0x21')]);return _0x5c6248(_0x35acbe[_0x35e5('0x20')][_0x35e5('0x21')]);}else{logger[_0x35e5('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x32e8d1,_0x35e5('0x1e'));_0x5c6248(_0x35acbe[_0x35e5('0x22')][_0x35e5('0x21')]);}})[_0x35e5('0x23')](function(_0x512de6){logger['error'](_0x35e5('0x1d'),_0x32e8d1,_0x512de6);_0x460ec5(_0x512de6);});});}function respondWithStatusCode(_0x49455a,_0x4b4327){_0x4b4327=_0x4b4327||0xcc;return function(_0x1cea99){if(_0x1cea99){return _0x49455a['sendStatus'](_0x4b4327);}return _0x49455a[_0x35e5('0x24')](_0x4b4327)[_0x35e5('0x25')]();};}function respondWithResult(_0x680877,_0x309111){_0x309111=_0x309111||0xc8;return function(_0x24fb51){if(_0x24fb51){return _0x680877[_0x35e5('0x24')](_0x309111)[_0x35e5('0x26')](_0x24fb51);}};}function respondWithFilteredResult(_0x1eea68,_0x29dcad){return function(_0x4f7892){if(_0x4f7892){var _0x551502=_0x4f7892[_0x35e5('0x27')],_0x776169=_0x29dcad[_0x35e5('0x28')],_0x507f0a=_0x29dcad[_0x35e5('0x28')]+_0x29dcad[_0x35e5('0x29')],_0x35cb45;if(_0x507f0a>=_0x551502){_0x507f0a=_0x551502;_0x35cb45=0xc8;}else{_0x35cb45=0xce;}_0x1eea68['status'](_0x35cb45);return _0x1eea68[_0x35e5('0x2a')](_0x35e5('0x2b'),_0x776169+'-'+_0x507f0a+'/'+_0x551502)[_0x35e5('0x26')](_0x4f7892);}return null;};}function patchUpdates(_0x237ab9){return function(_0x3b2695){try{jsonpatch[_0x35e5('0x2c')](_0x3b2695,_0x237ab9,!![]);}catch(_0x519d0d){return BPromise[_0x35e5('0x2d')](_0x519d0d);}return _0x3b2695[_0x35e5('0x2e')]();};}function saveUpdates(_0x563c29,_0x16184e){return function(_0x22b599){if(_0x22b599){return _0x22b599[_0x35e5('0x2f')](_0x563c29)['then'](function(_0x1c5814){return _0x1c5814;});}return null;};}function removeEntity(_0x26fbb8,_0x22ea98){return function(_0x59a304){if(_0x59a304){return _0x59a304[_0x35e5('0x30')]()[_0x35e5('0x31')](function(){_0x26fbb8[_0x35e5('0x24')](0xcc)[_0x35e5('0x25')]();});}};}function handleEntityNotFound(_0x1f9078,_0x5b3fd0){return function(_0x5e5da9){if(!_0x5e5da9){_0x1f9078[_0x35e5('0x32')](0x194);}return _0x5e5da9;};}function handleError(_0x44c1ef,_0x182a1b){_0x182a1b=_0x182a1b||0x1f4;return function(_0x4484f4){logger['error'](_0x4484f4[_0x35e5('0x33')]);if(_0x4484f4[_0x35e5('0x34')]){delete _0x4484f4[_0x35e5('0x34')];}_0x44c1ef['status'](_0x182a1b)[_0x35e5('0x35')](_0x4484f4);};}exports[_0x35e5('0x36')]=function(_0x1c5708,_0x3d89a0){var _0x401eb0={},_0x7e129f={},_0x3ecc29={'count':0x0,'rows':[]};var _0x4ac231=db['ChatInteraction'][_0x35e5('0x37')];_0x7e129f[_0x35e5('0x38')]=_[_0x35e5('0x39')](_0x4ac231);_0x7e129f[_0x35e5('0x3a')]=_[_0x35e5('0x39')](_0x1c5708[_0x35e5('0x3a')]);_0x7e129f[_0x35e5('0x3b')]=_['intersection'](_0x7e129f[_0x35e5('0x38')],_0x7e129f[_0x35e5('0x3a')]);_0x401eb0[_0x35e5('0x3c')]=_[_0x35e5('0x3d')](_0x7e129f[_0x35e5('0x38')],qs['fields'](_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x3e')]));_0x401eb0[_0x35e5('0x3c')]=_0x401eb0[_0x35e5('0x3c')]['length']?_0x401eb0['attributes']:_0x7e129f[_0x35e5('0x38')];if(!_0x1c5708['query'][_0x35e5('0x3f')]('nolimit')){_0x401eb0['limit']=qs[_0x35e5('0x29')](_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x29')]);_0x401eb0[_0x35e5('0x28')]=qs['offset'](_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x28')]);}_0x401eb0['order']=qs[_0x35e5('0x40')](_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x40')]);_0x401eb0[_0x35e5('0x41')]=qs[_0x35e5('0x3b')](_['pick'](_0x1c5708[_0x35e5('0x3a')],_0x7e129f[_0x35e5('0x3b')]));if(_0x1c5708[_0x35e5('0x3a')]['filter']){_0x401eb0[_0x35e5('0x41')]=_[_0x35e5('0x42')](_0x401eb0[_0x35e5('0x41')],{'$or':_['map'](_0x4ac231,function(_0x2da501){if(_0x2da501['type'][_0x35e5('0x43')]!==_0x35e5('0x44')){var _0x87cf35={};_0x87cf35[_0x2da501['field']]={'$like':'%'+_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x45')]+'%'};return _0x87cf35;}})});}_0x401eb0=_[_0x35e5('0x42')]({},_0x401eb0,_0x1c5708[_0x35e5('0x46')]);var _0x3f1afa={'where':_0x401eb0['where']};_0x3f1afa[_0x35e5('0x47')]=[];if(_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x48')]){_0x3f1afa[_0x35e5('0x47')]['push']({'model':db[_0x35e5('0x49')],'as':_0x35e5('0x4a'),'attributes':['id'],'where':{'id':_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x48')]},'required':!![]});_0x3f1afa['distinct']=!![];}if(_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x4b')]){_0x3f1afa[_0x35e5('0x47')]['push']({'model':db[_0x35e5('0x4c')],'as':_0x35e5('0x4d'),'attributes':['id','direction',_0x35e5('0x4e'),'read'],'where':{'direction':'in','read':_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x4b')]||![]},'required':!![]});_0x3f1afa[_0x35e5('0x4f')]=!![];}return db[_0x35e5('0x50')][_0x35e5('0x27')](_0x3f1afa)['then'](function(_0x48cee0){_0x3ecc29['count']=_0x48cee0;if(_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x51')]){_0x401eb0['include']=[{'model':db['User'],'as':_0x35e5('0x52'),'required':![],'attributes':['id',_0x35e5('0x34'),'fullname']},{'model':db[_0x35e5('0x53')],'as':_0x35e5('0x54'),'required':![]},{'model':db[_0x35e5('0x55')],'as':_0x35e5('0x56'),'attributes':[_0x35e5('0x34'),_0x35e5('0x57'),_0x35e5('0x58')],'required':![]},{'model':db['ChatWebsite'],'as':_0x35e5('0x59'),'attributes':[_0x35e5('0x34'),'key'],'required':![]},{'model':db[_0x35e5('0x4c')],'as':_0x35e5('0x4d'),'attributes':['id','direction','createdAt',_0x35e5('0x4b')],'where':{'direction':'in','read':_0x1c5708['query'][_0x35e5('0x4b')]||![]},'required':_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x4b')]||![]},{'model':db[_0x35e5('0x49')],'as':_0x35e5('0x4a'),'attributes':['id',_0x35e5('0x34'),_0x35e5('0x5a')],'required':_0x1c5708[_0x35e5('0x3a')]['tag']?!![]:![]},{'model':db[_0x35e5('0x49')],'as':_0x35e5('0x5b'),'attributes':['id',_0x35e5('0x34'),_0x35e5('0x5a')],'through':_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x48')]?{'attributes':[],'where':{'TagId':_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x48')]||undefined}}:{},'required':_0x1c5708[_0x35e5('0x3a')][_0x35e5('0x48')]?!![]:![]}];}return db[_0x35e5('0x50')][_0x35e5('0x5c')](_0x401eb0);})[_0x35e5('0x31')](function(_0x4353fd){_0x3ecc29[_0x35e5('0x5d')]=_0x4353fd;return _0x3ecc29;})[_0x35e5('0x31')](respondWithFilteredResult(_0x3d89a0,_0x401eb0))['catch'](handleError(_0x3d89a0,null));};exports[_0x35e5('0x5e')]=function(_0xc225aa,_0x573930){var _0x40cf92={'raw':![],'where':{'id':_0xc225aa[_0x35e5('0x5f')]['id']}},_0x33c68f={};_0x33c68f[_0x35e5('0x38')]=_['keys'](db[_0x35e5('0x50')][_0x35e5('0x37')]);_0x33c68f[_0x35e5('0x3a')]=_['keys'](_0xc225aa[_0x35e5('0x3a')]);_0x33c68f[_0x35e5('0x3b')]=_['intersection'](_0x33c68f[_0x35e5('0x38')],_0x33c68f[_0x35e5('0x3a')]);_0x40cf92[_0x35e5('0x3c')]=_[_0x35e5('0x3d')](_0x33c68f[_0x35e5('0x38')],qs[_0x35e5('0x3e')](_0xc225aa[_0x35e5('0x3a')][_0x35e5('0x3e')]));_0x40cf92[_0x35e5('0x3c')]=_0x40cf92['attributes'][_0x35e5('0x60')]?_0x40cf92[_0x35e5('0x3c')]:_0x33c68f['model'];if(_0xc225aa[_0x35e5('0x3a')][_0x35e5('0x51')]){_0x40cf92[_0x35e5('0x47')]=[{'all':!![]}];}_0x40cf92=_[_0x35e5('0x42')]({},_0x40cf92,_0xc225aa[_0x35e5('0x46')]);return db[_0x35e5('0x50')][_0x35e5('0x61')](_0x40cf92)[_0x35e5('0x31')](handleEntityNotFound(_0x573930,null))[_0x35e5('0x31')](respondWithResult(_0x573930,null))[_0x35e5('0x23')](handleError(_0x573930,null));};exports['create']=function(_0x59936a,_0x9baca8){return db['ChatInteraction'][_0x35e5('0x62')](_0x59936a[_0x35e5('0x63')],{})['then'](respondWithResult(_0x9baca8,0xc9))[_0x35e5('0x23')](handleError(_0x9baca8,null));};exports['update']=function(_0x5acc81,_0x3182a9){if(_0x5acc81[_0x35e5('0x63')]['id']){delete _0x5acc81['body']['id'];}return db['ChatInteraction'][_0x35e5('0x61')]({'where':{'id':_0x5acc81['params']['id']}})[_0x35e5('0x31')](handleEntityNotFound(_0x3182a9,null))[_0x35e5('0x31')](saveUpdates(_0x5acc81['body'],null))[_0x35e5('0x31')](respondWithResult(_0x3182a9,null))['catch'](handleError(_0x3182a9,null));};exports['destroy']=function(_0x2f8023,_0x100c19){return db[_0x35e5('0x50')][_0x35e5('0x61')]({'where':{'id':_0x2f8023['params']['id']}})['then'](handleEntityNotFound(_0x100c19,null))[_0x35e5('0x31')](removeEntity(_0x100c19,null))[_0x35e5('0x23')](handleError(_0x100c19,null));};exports[_0x35e5('0x64')]=function(_0x505118,_0x14b725){return db[_0x35e5('0x50')][_0x35e5('0x64')]()['then'](respondWithResult(_0x14b725,null))['catch'](handleError(_0x14b725,null));};exports[_0x35e5('0x65')]=function(_0x2fb170,_0x507423){if(_0x2fb170['body']['id']){delete _0x2fb170[_0x35e5('0x63')]['id'];}return db['ChatInteraction'][_0x35e5('0x61')]({'where':{'id':_0x2fb170[_0x35e5('0x5f')]['id']}})[_0x35e5('0x31')](handleEntityNotFound(_0x507423,null))[_0x35e5('0x31')](saveUpdates(_0x2fb170['body'],null))[_0x35e5('0x31')](respondWithResult(_0x507423,null))[_0x35e5('0x23')](handleError(_0x507423,null));};exports[_0x35e5('0x66')]=function(_0x57eb5b,_0x4bf440,_0x4e789e){if(_0x57eb5b[_0x35e5('0x63')]['id']){delete _0x57eb5b['body']['id'];}return db[_0x35e5('0x50')][_0x35e5('0x61')]({'where':{'id':_0x57eb5b[_0x35e5('0x5f')]['id']}})[_0x35e5('0x31')](function(_0x2968c0){if(!_0x2968c0){logger[_0x35e5('0x20')](_0x35e5('0x67'),_0x35e5('0x66'),0x194,_0x35e5('0x68'));_0x4bf440['sendStatus'](0x194);}else{if(_0x2968c0[_0x35e5('0x69')]){throw new db[(_0x35e5('0x6a'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x2968c0;})['then'](function(_0x45a055){if(_0x45a055){return _0x45a055[_0x35e5('0x2f')]({'closed':_0x57eb5b['body'][_0x35e5('0x6b')],'disposition':_0x57eb5b[_0x35e5('0x63')]['disposition']})['then'](function(_0xca14a1){return _0xca14a1;});}})['then'](function(_0x265317){return respondWithRpcPromise(_0x35e5('0x6c'),_0x35e5('0x66'),_0x57eb5b['body'],client9004);})[_0x35e5('0x31')](respondWithResult(_0x4bf440,null))['catch'](handleError(_0x4bf440,null));};exports[_0x35e5('0x6d')]=function(_0x218b19,_0x109b7e,_0x4d1871){_0x218b19[_0x35e5('0x63')]['name']=_0x218b19[_0x35e5('0x6e')][_0x35e5('0x6f')];_0x218b19[_0x35e5('0x63')][_0x35e5('0x70')]=_0x218b19[_0x35e5('0x6e')][_0x35e5('0x71')];_0x218b19[_0x35e5('0x63')][_0x35e5('0x72')]=_0x218b19[_0x35e5('0x6e')]['mimetype'];return db[_0x35e5('0x73')][_0x35e5('0x62')](_0x218b19[_0x35e5('0x63')])['then'](respondWithResult(_0x109b7e,0xc9))[_0x35e5('0x23')](handleError(_0x109b7e,null));};exports[_0x35e5('0x74')]=function(_0x43e0ef,_0x43127,_0x292bb1){return db[_0x35e5('0x50')][_0x35e5('0x75')]({'where':{'id':_0x43e0ef[_0x35e5('0x5f')]['id']},'raw':!![]})[_0x35e5('0x31')](handleEntityNotFound(_0x43127,null))[_0x35e5('0x31')](function(_0x15bbae){if(_0x15bbae){if(_0x15bbae[_0x35e5('0x6b')]){return _0x43127[_0x35e5('0x24')](0x193)[_0x35e5('0x26')]({'status':0x193,'message':_0x35e5('0x76')});}return db[_0x35e5('0x73')]['findOne']({'where':{'id':_0x43e0ef['query'][_0x35e5('0x77')]},'raw':!![]})[_0x35e5('0x31')](handleEntityNotFound(_0x43127,null));}})[_0x35e5('0x31')](function(_0x26fe57){if(_0x26fe57){return _0x43127['download'](path[_0x35e5('0x78')](config[_0x35e5('0x79')],_0x35e5('0x7a'),_0x26fe57['basename']));}})[_0x35e5('0x23')](handleError(_0x43127,null));};exports['close']=function(_0x5ecdbf,_0x4427f2){var _0x407e42=null;var _0x1e3e4e=null;var _0x5b6f6b=null;var _0x15a189=null;if(_0x5ecdbf[_0x35e5('0x63')]['id']){delete _0x5ecdbf[_0x35e5('0x63')]['id'];}if(_0x5ecdbf[_0x35e5('0x63')][_0x35e5('0x7b')]){_0x15a189=path[_0x35e5('0x78')](config[_0x35e5('0x79')],_0x35e5('0x7c'),util[_0x35e5('0x7d')](_0x35e5('0x7e'),Date['now']()));_0x5ecdbf[_0x35e5('0x63')][_0x35e5('0x7f')]=_0x15a189;}return db[_0x35e5('0x50')][_0x35e5('0x61')]({'where':{'id':_0x5ecdbf[_0x35e5('0x5f')]['id']},'include':[{'model':db[_0x35e5('0x4c')],'as':_0x35e5('0x4d'),'include':[{'model':db[_0x35e5('0x55')],'as':_0x35e5('0x55')}]}]})[_0x35e5('0x31')](handleEntityNotFound(_0x4427f2,null))['then'](saveUpdates(_0x5ecdbf[_0x35e5('0x63')],null))[_0x35e5('0x31')](function(_0x2520ea){if(_0x2520ea){_0x407e42=_0x2520ea;return db[_0x35e5('0x80')]['find']({'where':{'id':_0x407e42['ChatWebsiteId']}});}})[_0x35e5('0x31')](function(_0x400215){if(_0x400215){_0x5b6f6b=_0x400215;return db['CmContact']['find']({'where':{'id':_0x407e42[_0x35e5('0x81')]}});}})[_0x35e5('0x31')](function(_0x57407b){if(_0x57407b){_0x1e3e4e=_0x57407b;if(_0x15a189){var _0x3fd4e9=null;for(var _0x4e0ce1=0x1;_0x4e0ce1<_0x407e42['Messages'][_0x35e5('0x60')];++_0x4e0ce1){_0x3fd4e9=_0x407e42[_0x35e5('0x4d')][_0x4e0ce1];var _0x363cad=_0x3fd4e9[_0x35e5('0x69')]?util[_0x35e5('0x7d')]('%s%d',_0x5b6f6b[_0x35e5('0x82')],_0x3fd4e9[_0x35e5('0x69')]):_0x35e5('0x83');var _0x3a1eff=_0x5ecdbf[_0x35e5('0x63')][_0x35e5('0x84')]||util[_0x35e5('0x7d')](_0x35e5('0x85'),'Visitor',_0x3fd4e9[_0x35e5('0x81')]);switch(_0x5b6f6b[_0x35e5('0x86')]){case _0x35e5('0x87'):_0x363cad=_0x3fd4e9[_0x35e5('0x69')]?util[_0x35e5('0x7d')](_0x35e5('0x85'),_0x5b6f6b[_0x35e5('0x82')],_0x3fd4e9[_0x35e5('0x69')]):_0x35e5('0x83');break;case _0x35e5('0x88'):_0x363cad=_0x3fd4e9[_0x35e5('0x69')]?_0x3fd4e9['User'][_0x35e5('0x89')]||_0x3fd4e9[_0x35e5('0x55')][_0x35e5('0x57')]:_0x35e5('0x83');break;case _0x35e5('0x8a'):_0x363cad=_0x3fd4e9[_0x35e5('0x69')]?_0x3fd4e9[_0x35e5('0x55')]['fullname']:_0x35e5('0x83');break;default:_0x363cad=_0x3fd4e9[_0x35e5('0x69')]?util['format']('%s%d',_0x5b6f6b[_0x35e5('0x82')],_0x3fd4e9[_0x35e5('0x69')]):'System';}var _0x6f37a3=util[_0x35e5('0x7d')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3fd4e9[_0x35e5('0x4e')])[_0x35e5('0x7d')](_0x35e5('0x8b')),_0x3fd4e9[_0x35e5('0x8c')]==='in'?_0x3a1eff:_0x363cad,_0x3fd4e9[_0x35e5('0x63')]);if(!_0x3fd4e9[_0x35e5('0x8d')]){fs[_0x35e5('0x8e')](_0x15a189,_0x6f37a3);}}return db[_0x35e5('0x8f')][_0x35e5('0x75')]({'where':{'service':!![]},'include':[{'model':db[_0x35e5('0x90')],'as':_0x35e5('0x91'),'raw':!![]}]});}}})[_0x35e5('0x31')](function(_0x568bc9){if(_0x568bc9&&_0x568bc9['Smtp']&&_0x5ecdbf['body']){var _0x1e5077={'tls':{'rejectUnauthorized':![]}};if(_0x568bc9[_0x35e5('0x91')][_0x35e5('0x92')]){_0x1e5077[_0x35e5('0x92')]=_0x568bc9[_0x35e5('0x91')][_0x35e5('0x92')];}else{_0x1e5077['host']=_0x568bc9[_0x35e5('0x91')]['host'];_0x1e5077['port']=_0x568bc9[_0x35e5('0x91')][_0x35e5('0x93')];_0x1e5077[_0x35e5('0x94')]=_0x568bc9[_0x35e5('0x91')][_0x35e5('0x94')];}if(_0x568bc9[_0x35e5('0x91')][_0x35e5('0x95')]){_0x1e5077[_0x35e5('0x96')]={'user':_0x568bc9[_0x35e5('0x91')]['user'],'pass':_0x568bc9['Smtp'][_0x35e5('0x97')]};}return respondWithRpcPromise('SendMail',_0x35e5('0x98'),{'account':_0x1e5077,'message':{'from':util[_0x35e5('0x7d')](_0x35e5('0x99'),_0x568bc9[_0x35e5('0x34')],_0x568bc9[_0x35e5('0x9a')]||_0x568bc9[_0x35e5('0x91')][_0x35e5('0x9b')]),'to':_0x5ecdbf[_0x35e5('0x63')][_0x35e5('0x7b')],'subject':_0x35e5('0x9c'),'text':util['format'](_0x35e5('0x9d'),_0x5ecdbf[_0x35e5('0x63')][_0x35e5('0x7b')]),'attachments':[{'path':_0x15a189}]}})[_0x35e5('0x31')](function(){return _0x407e42;})['catch'](function(_0x581b92){console[_0x35e5('0x20')](_0x581b92);});}else{return _0x407e42;}})[_0x35e5('0x31')](respondWithStatusCode(_0x4427f2,0xc8))[_0x35e5('0x23')](handleError(_0x4427f2,null));};exports[_0x35e5('0x9e')]=function(_0x105aa0,_0x58a32e,_0x4b3c32){return db[_0x35e5('0x4c')][_0x35e5('0x61')]({'where':{'id':_0x105aa0[_0x35e5('0x5f')]['id']}})['then'](handleEntityNotFound(_0x58a32e,null))['then'](function(_0x12a714){if(_0x12a714){return _0x12a714[_0x35e5('0x9e')](_0x105aa0[_0x35e5('0x63')][_0x35e5('0x9f')],_[_0x35e5('0xa0')](_0x105aa0[_0x35e5('0x63')],[_0x35e5('0x9f'),'id'])||{});}})['then'](respondWithResult(_0x58a32e,null))[_0x35e5('0x23')](handleError(_0x58a32e,null));};exports[_0x35e5('0xa1')]=function(_0x4ec5da,_0x420647,_0x4bedfc){var _0x18e55a={'raw':![],'where':{}};var _0x43c9e4={};var _0x31793b={'count':0x0,'rows':[]};return db[_0x35e5('0x50')][_0x35e5('0x75')]({'where':{'id':_0x4ec5da[_0x35e5('0x5f')]['id']}})['then'](handleEntityNotFound(_0x420647,null))[_0x35e5('0x31')](function(_0x424123){if(_0x424123){_0x43c9e4[_0x35e5('0x38')]=_[_0x35e5('0x39')](db[_0x35e5('0x4c')][_0x35e5('0x37')]);_0x43c9e4[_0x35e5('0x3a')]=_[_0x35e5('0x39')](_0x4ec5da[_0x35e5('0x3a')]);_0x43c9e4[_0x35e5('0x3b')]=_[_0x35e5('0x3d')](_0x43c9e4['model'],_0x43c9e4[_0x35e5('0x3a')]);_0x18e55a[_0x35e5('0x3c')]=_[_0x35e5('0x3d')](_0x43c9e4[_0x35e5('0x38')],qs[_0x35e5('0x3e')](_0x4ec5da[_0x35e5('0x3a')][_0x35e5('0x3e')]));_0x18e55a[_0x35e5('0x3c')]=_0x18e55a[_0x35e5('0x3c')][_0x35e5('0x60')]?_0x18e55a[_0x35e5('0x3c')]:_0x43c9e4[_0x35e5('0x38')];if(!_0x4ec5da[_0x35e5('0x3a')][_0x35e5('0x3f')]('nolimit')){_0x18e55a['limit']=qs['limit'](_0x4ec5da[_0x35e5('0x3a')]['limit']);_0x18e55a[_0x35e5('0x28')]=qs['offset'](_0x4ec5da[_0x35e5('0x3a')]['offset']);}_0x18e55a[_0x35e5('0xa2')]=qs[_0x35e5('0x40')](_0x4ec5da[_0x35e5('0x3a')]['sort']);_0x18e55a[_0x35e5('0x41')]=qs[_0x35e5('0x3b')](_['pick'](_0x4ec5da[_0x35e5('0x3a')],_0x43c9e4[_0x35e5('0x3b')]));_0x18e55a[_0x35e5('0x41')]['ChatInteractionId']=_0x424123['id'];if(_0x4ec5da[_0x35e5('0x3a')][_0x35e5('0x45')]){_0x18e55a[_0x35e5('0x41')]=_[_0x35e5('0x42')](_0x18e55a[_0x35e5('0x41')],{'$or':_[_0x35e5('0xa3')](_0x18e55a[_0x35e5('0x3c')],function(_0x2150e8){var _0x1b9970={};_0x1b9970[_0x2150e8]={'$like':'%'+_0x4ec5da['query'][_0x35e5('0x45')]+'%'};return _0x1b9970;})});}if(_0x4ec5da[_0x35e5('0x3a')]['$gte']){var _0x5dae5d=_0x4ec5da[_0x35e5('0x3a')][_0x35e5('0xa4')]['split'](',');var _0x8e60f7={};_0x8e60f7[_0x5dae5d[0x0]]={'$gte':moment(_0x5dae5d[0x1])[_0x35e5('0x7d')](_0x35e5('0xa5'))};_0x18e55a[_0x35e5('0x41')]=_['merge'](_0x18e55a[_0x35e5('0x41')],_0x8e60f7);}_0x18e55a=_[_0x35e5('0x42')]({},_0x18e55a,_0x4ec5da[_0x35e5('0x46')]);return db[_0x35e5('0x4c')]['count']({'where':_0x18e55a[_0x35e5('0x41')]})[_0x35e5('0x31')](function(_0x4c2e10){_0x31793b[_0x35e5('0x27')]=_0x4c2e10;if(_0x4ec5da['query'][_0x35e5('0x51')]){_0x18e55a[_0x35e5('0x47')]=[{'all':!![]}];}return db[_0x35e5('0x4c')]['findAll'](_0x18e55a);})[_0x35e5('0x31')](function(_0x2b0bab){_0x31793b[_0x35e5('0x5d')]=_0x2b0bab;return _0x31793b;});}})['then'](respondWithFilteredResult(_0x420647,_0x18e55a))['catch'](handleError(_0x420647,null));};exports['getMyMessages']=function(_0x1bc1b8,_0x1ae63d,_0x57bbe2){var _0x130144={'where':{}},_0xf7d178={},_0x82219e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x35e5('0x75')]({'where':{'id':_0x1bc1b8[_0x35e5('0x5f')]['id']}})[_0x35e5('0x31')](handleEntityNotFound(_0x1ae63d,null))[_0x35e5('0x31')](function(_0x31fbfa){if(_0x31fbfa){_0xf7d178[_0x35e5('0x38')]=_[_0x35e5('0x39')](db[_0x35e5('0x4c')][_0x35e5('0x37')]);_0xf7d178[_0x35e5('0x3a')]=_['keys'](_0x1bc1b8['query']);_0xf7d178['filters']=_[_0x35e5('0x3d')](_0xf7d178[_0x35e5('0x38')],_0xf7d178['query']);_0x130144['attributes']=_['intersection'](_0xf7d178[_0x35e5('0x38')],qs['fields'](_0x1bc1b8['query'][_0x35e5('0x3e')]));_0x130144[_0x35e5('0x3c')]=_0x130144[_0x35e5('0x3c')]['length']?_0x130144['attributes']:_0xf7d178['model'];if(!_0x1bc1b8[_0x35e5('0x3a')][_0x35e5('0x3f')](_0x35e5('0xa6'))){_0x130144[_0x35e5('0x29')]=qs[_0x35e5('0x29')](_0x1bc1b8[_0x35e5('0x3a')][_0x35e5('0x29')]);_0x130144[_0x35e5('0x28')]=qs[_0x35e5('0x28')](_0x1bc1b8['query'][_0x35e5('0x28')]);}_0x130144['order']=qs[_0x35e5('0x40')](_0x1bc1b8[_0x35e5('0x3a')][_0x35e5('0x40')]);_0x130144[_0x35e5('0x41')]=qs[_0x35e5('0x3b')](_[_0x35e5('0xa7')](_0x1bc1b8[_0x35e5('0x3a')],_0xf7d178[_0x35e5('0x3b')]));_0x130144[_0x35e5('0x41')]['ChatInteractionId']=_0x31fbfa['id'];if(_0x1bc1b8[_0x35e5('0x3a')][_0x35e5('0x45')]){_0x130144[_0x35e5('0x41')]=_[_0x35e5('0x42')](_0x130144[_0x35e5('0x41')],{'$or':_[_0x35e5('0xa3')](_0x130144['attributes'],function(_0x230235){var _0x3b8c71={};_0x3b8c71[_0x230235]={'$like':'%'+_0x1bc1b8[_0x35e5('0x3a')][_0x35e5('0x45')]+'%'};return _0x3b8c71;})});}_0x130144[_0x35e5('0x41')]['secret']=![];if(_0x1bc1b8[_0x35e5('0x3a')]['id']){_0x130144[_0x35e5('0x41')]['id']={'$gt':_0x1bc1b8[_0x35e5('0x3a')]['id']};}_0x130144=_[_0x35e5('0x42')]({},_0x130144,_0x1bc1b8['options']);return db[_0x35e5('0x4c')][_0x35e5('0x27')]({'where':_0x130144[_0x35e5('0x41')]})[_0x35e5('0x31')](function(_0x221675){_0x82219e[_0x35e5('0x27')]=_0x221675;_0x130144[_0x35e5('0x47')]=[];if(_0x1bc1b8[_0x35e5('0x3a')][_0x35e5('0xa8')]){_0x130144[_0x35e5('0x47')][_0x35e5('0xa9')]({'model':db[_0x35e5('0x55')],'as':_0x35e5('0x55'),'attributes':['id','fullname',_0x35e5('0x89')]});}if(_0x1bc1b8[_0x35e5('0x3a')][_0x35e5('0x51')]){_0x130144['include']=[{'all':!![]}];}return db[_0x35e5('0x4c')][_0x35e5('0x5c')](_0x130144);})['then'](function(_0x2e4dd8){_0x82219e[_0x35e5('0x5d')]=_0x2e4dd8;return _0x82219e;});}})[_0x35e5('0x31')](respondWithFilteredResult(_0x1ae63d,_0x130144))['catch'](handleError(_0x1ae63d,null));};exports['addTags']=function(_0x578e11,_0x31dff7,_0x3fcefa){return db[_0x35e5('0x50')][_0x35e5('0x61')]({'where':{'id':_0x578e11[_0x35e5('0x5f')]['id']}})['then'](handleEntityNotFound(_0x31dff7,null))[_0x35e5('0x31')](function(_0x2edced){if(_0x2edced){return _0x2edced[_0x35e5('0xaa')](_0x578e11[_0x35e5('0x63')][_0x35e5('0x9f')],_['omit'](_0x578e11[_0x35e5('0x63')],[_0x35e5('0x9f'),'id'])||{})['spread'](function(){return db[_0x35e5('0x49')]['findAll']({'attributes':['id',_0x35e5('0x34'),_0x35e5('0x5a')],'where':{'id':_0x578e11[_0x35e5('0x63')]['ids']}});})[_0x35e5('0x31')](function(_0x931c4e){socket['emit'](_0x35e5('0xab'),{'id':Number(_0x578e11[_0x35e5('0x5f')]['id']),'tags':_0x931c4e||[]});return{'id':Number(_0x578e11[_0x35e5('0x5f')]['id']),'tags':_0x931c4e||[]};});}})[_0x35e5('0x31')](respondWithResult(_0x31dff7,null))[_0x35e5('0x23')](handleError(_0x31dff7,null));};exports[_0x35e5('0xac')]=function(_0x4f8ab4,_0x262428,_0x11696b){var _0x53a53b;return db['ChatInteraction'][_0x35e5('0x61')]({'where':{'id':_0x4f8ab4[_0x35e5('0x5f')]['id']}})[_0x35e5('0x31')](handleEntityNotFound(_0x262428,null))['then'](function(_0x4cce8c){if(_0x4cce8c){return _0x4cce8c[_0x35e5('0xac')](_0x4f8ab4[_0x35e5('0x3a')][_0x35e5('0x9f')]);}})['then'](respondWithStatusCode(_0x262428,null))[_0x35e5('0x23')](handleError(_0x262428,null));};exports[_0x35e5('0xad')]=function(_0xf6c053,_0x50b4a8){var _0x401609=moment()[_0x35e5('0xae')]()['toString']();var _0x132010=path[_0x35e5('0x78')](config[_0x35e5('0x79')],'server',_0x35e5('0xaf'),_0x35e5('0xb0'));var _0x36a6dd=path[_0x35e5('0x78')](config[_0x35e5('0x79')],_0x35e5('0xb1'),_0x35e5('0xaf'),'attachments');var _0x4ba7df=path[_0x35e5('0x78')](_0x132010,_0x401609);var _0x1ec9ce=util[_0x35e5('0x7d')]('interaction-%s.zip',_0x401609);var _0x540231=path[_0x35e5('0x78')](_0x132010,_0x1ec9ce);var _0x1aa6ea=![];return db[_0x35e5('0x50')]['find']({'where':{'id':_0xf6c053[_0x35e5('0x5f')]['id']},'include':[{'model':db[_0x35e5('0x4c')],'as':_0x35e5('0x4d'),'attributes':['id',_0x35e5('0x63')],'include':[{'model':db[_0x35e5('0x55')],'as':_0x35e5('0x55'),'attributes':['id',_0x35e5('0x57')],'raw':!![]},{'model':db[_0x35e5('0x53')],'as':_0x35e5('0x54'),'attributes':['id',_0x35e5('0xb2')],'raw':!![]},{'model':db[_0x35e5('0x73')],'as':_0x35e5('0x73'),'raw':!![]}]}]})[_0x35e5('0x31')](handleEntityNotFound(_0x50b4a8,null))['then'](function(_0x574d2b){if(_0x574d2b){_0x1aa6ea=!![];var _0x50643a='';var _0x390d34={'format':_0x35e5('0xb3'),'border':_0x35e5('0xb4')};fs[_0x35e5('0xb5')](_0x4ba7df);_0x50643a+=util[_0x35e5('0x7d')](_0x35e5('0xb6'),_0x574d2b['id']);_0x50643a+=util[_0x35e5('0x7d')]('

Date:\x20%s

',moment()['format']('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')[_0x35e5('0xb7')]());_0x50643a+=_0x35e5('0xb8');for(var _0x4120ef=0x1;_0x4120ef<_0x574d2b[_0x35e5('0x4d')]['length'];_0x4120ef++){var _0x4ca892=_0x574d2b[_0x35e5('0x4d')][_0x4120ef];_0x50643a+=_0x35e5('0xb9');_0x50643a+=util['format'](_0x35e5('0xba'),_0x4ca892[_0x35e5('0x55')]?_0x4ca892[_0x35e5('0x55')]['fullname']:_0x4ca892['Contact'][_0x35e5('0xb2')],_0x4ca892[_0x35e5('0x63')]);_0x50643a+='';if(_0x4ca892[_0x35e5('0x73')]){var _0x288c50=_0x4ca892[_0x35e5('0x73')];var _0x981cae=path[_0x35e5('0x78')](_0x36a6dd,_0x288c50['basename']);if(fs[_0x35e5('0xbb')](_0x981cae)){fs[_0x35e5('0xbc')](_0x981cae)['pipe'](fs[_0x35e5('0xbd')](path[_0x35e5('0x78')](_0x4ba7df,_0x288c50[_0x35e5('0x70')])));}}}return new BPromise(function(_0x7bc216,_0x12ff18){pdf[_0x35e5('0x62')](_0x50643a,_0x390d34)[_0x35e5('0xbe')](path[_0x35e5('0x78')](_0x4ba7df,_0x35e5('0xbf')+_0x401609+_0x35e5('0xc0')),function(_0x2acc0f,_0x12e06c){if(_0x2acc0f)return _0x12ff18(_0x2acc0f);_0x7bc216(_0x12e06c);});});}})['then'](function(){if(_0x1aa6ea){return new BPromise(function(_0x242277,_0x3d0b8e){zipdir(_0x4ba7df,{'saveTo':_0x540231},function(_0x2de6e5,_0x1e1cde){if(_0x2de6e5)return _0x3d0b8e(_0x2de6e5);return _0x242277(_0x1e1cde);});});}})['then'](function(){if(_0x1aa6ea){return new BPromise(function(_0x56cae3,_0x14964f){rimraf(_0x4ba7df,function(_0x29b440){if(_0x29b440)_0x14964f(_0x29b440);return _0x56cae3();});});}})[_0x35e5('0x31')](function(){if(_0x1aa6ea){return _0x50b4a8[_0x35e5('0xad')](_0x540231,_0x1ec9ce,function(_0x121695){if(_0x121695){console[_0x35e5('0xc1')](_0x35e5('0xc2'),_0x121695);}else{fs[_0x35e5('0xc3')](_0x540231);}});}else{return _0x50b4a8[_0x35e5('0x32')](0xc8);}})[_0x35e5('0x23')](handleError(_0x50b4a8,null));}; \ No newline at end of file +var _0x9eee=['secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','SendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','order','pick','$gte','split','rows','ChatInteractionId','addTags','setTags','emit','chatInteractionTags:save','removeTags','files','tmp','server','attachments','interaction-%s.zip','firstName','Letter','mkdirSync','

Chat\x20Interaction:\x20#%d

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','toString','
','','%s:\x20%s

','','existsSync','createReadStream','pipe','createWriteStream','toFile','interaction-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatInteraction.socket','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','destroy','stack','name','send','index','ChatInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','VIRTUAL','field','tag','include','push','distinct','Messages','createdAt','read','includeAll','User','Users','fullname','CmContact','Contact','Owner','internal','ChatWebsite','Account','key','direction','Tag','Tags','ThroughTags','color','findAll','show','params','options','find','create','update','body','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','findOne','closed','Unauthorized','download','join','server/files/attachments/','close','root','format','transcript-%s.txt','now','pathTranscript','ChatMessage','%s%d','agentAlias','System','Visitor','ContactId','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0x9eee,0x108));var _0xe9ee=function(_0x575a65,_0x348496){_0x575a65=_0x575a65-0x0;var _0x760868=_0x9eee[_0x575a65];return _0x760868;};'use strict';var pdf=require(_0xe9ee('0x0'));var emlformat=require(_0xe9ee('0x1'));var rimraf=require(_0xe9ee('0x2'));var zipdir=require(_0xe9ee('0x3'));var jsonpatch=require(_0xe9ee('0x4'));var rp=require(_0xe9ee('0x5'));var moment=require(_0xe9ee('0x6'));var BPromise=require(_0xe9ee('0x7'));var Mustache=require(_0xe9ee('0x8'));var util=require('util');var path=require(_0xe9ee('0x9'));var sox=require(_0xe9ee('0xa'));var csv=require(_0xe9ee('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe9ee('0xc'));var crypto=require(_0xe9ee('0xd'));var jsforce=require(_0xe9ee('0xe'));var deskjs=require(_0xe9ee('0xf'));var toCsv=require(_0xe9ee('0xb'));var querystring=require(_0xe9ee('0x10'));var Papa=require(_0xe9ee('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0xe9ee('0x12'));var Redis=require(_0xe9ee('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xe9ee('0x14'));var utils=require(_0xe9ee('0x15'));var config=require(_0xe9ee('0x16'));var db=require(_0xe9ee('0x17'))['db'];config[_0xe9ee('0x18')]=_[_0xe9ee('0x19')](config[_0xe9ee('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9ee('0x18')]));require(_0xe9ee('0x1a'))['register'](socket);var jayson=require(_0xe9ee('0x1b'));var client=jayson['client'][_0xe9ee('0x1c')]({'port':0x232b});var client9004=jayson[_0xe9ee('0x1d')][_0xe9ee('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x34addd,_0x2a6775,_0x39ea94,_0x48b428){return new BPromise(function(_0x56c3a8,_0x51aee8){var _0x1459b6=_0x48b428||client;return _0x1459b6[_0xe9ee('0x1e')](_0x34addd,_0x39ea94)[_0xe9ee('0x1f')](function(_0x145864){logger[_0xe9ee('0x20')](_0xe9ee('0x21'),_0x2a6775,_0xe9ee('0x22'));logger[_0xe9ee('0x23')](_0xe9ee('0x24'),_0x2a6775,_0xe9ee('0x22'),JSON['stringify'](_0x145864));if(_0x145864['error']){if(_0x145864['error'][_0xe9ee('0x25')]===0x1f4){logger[_0xe9ee('0x26')](_0xe9ee('0x21'),_0x2a6775,_0x145864['error'][_0xe9ee('0x27')]);return _0x51aee8(_0x145864[_0xe9ee('0x26')]['message']);}logger[_0xe9ee('0x26')](_0xe9ee('0x21'),_0x2a6775,_0x145864[_0xe9ee('0x26')]['message']);return _0x56c3a8(_0x145864['error']['message']);}else{logger['info'](_0xe9ee('0x21'),_0x2a6775,_0xe9ee('0x22'));_0x56c3a8(_0x145864[_0xe9ee('0x28')]['message']);}})[_0xe9ee('0x29')](function(_0x89b0bc){logger[_0xe9ee('0x26')](_0xe9ee('0x21'),_0x2a6775,_0x89b0bc);_0x51aee8(_0x89b0bc);});});}function respondWithStatusCode(_0x4c12c2,_0x5814f5){_0x5814f5=_0x5814f5||0xcc;return function(_0x1c0e0e){if(_0x1c0e0e){return _0x4c12c2[_0xe9ee('0x2a')](_0x5814f5);}return _0x4c12c2[_0xe9ee('0x2b')](_0x5814f5)[_0xe9ee('0x2c')]();};}function respondWithResult(_0x3c1e66,_0x5cc875){_0x5cc875=_0x5cc875||0xc8;return function(_0x205889){if(_0x205889){return _0x3c1e66[_0xe9ee('0x2b')](_0x5cc875)[_0xe9ee('0x2d')](_0x205889);}};}function respondWithFilteredResult(_0x56b189,_0x31fd16){return function(_0x1e9231){if(_0x1e9231){var _0x46db70=_0x1e9231[_0xe9ee('0x2e')],_0x518acf=_0x31fd16['offset'],_0x36be4d=_0x31fd16[_0xe9ee('0x2f')]+_0x31fd16[_0xe9ee('0x30')],_0x5a07e1;if(_0x36be4d>=_0x46db70){_0x36be4d=_0x46db70;_0x5a07e1=0xc8;}else{_0x5a07e1=0xce;}_0x56b189[_0xe9ee('0x2b')](_0x5a07e1);return _0x56b189[_0xe9ee('0x31')]('Content-Range',_0x518acf+'-'+_0x36be4d+'/'+_0x46db70)[_0xe9ee('0x2d')](_0x1e9231);}return null;};}function patchUpdates(_0x97fe9d){return function(_0x1fcca2){try{jsonpatch['apply'](_0x1fcca2,_0x97fe9d,!![]);}catch(_0x50146a){return BPromise[_0xe9ee('0x32')](_0x50146a);}return _0x1fcca2[_0xe9ee('0x33')]();};}function saveUpdates(_0x2b9681,_0x291991){return function(_0x4192fe){if(_0x4192fe){return _0x4192fe['update'](_0x2b9681)[_0xe9ee('0x1f')](function(_0x16fb48){return _0x16fb48;});}return null;};}function removeEntity(_0x436cca,_0x5b094a){return function(_0x2e07c8){if(_0x2e07c8){return _0x2e07c8[_0xe9ee('0x34')]()[_0xe9ee('0x1f')](function(){_0x436cca[_0xe9ee('0x2b')](0xcc)[_0xe9ee('0x2c')]();});}};}function handleEntityNotFound(_0xa1377a,_0x44524e){return function(_0x629460){if(!_0x629460){_0xa1377a['sendStatus'](0x194);}return _0x629460;};}function handleError(_0x20890e,_0x7d1ded){_0x7d1ded=_0x7d1ded||0x1f4;return function(_0x1e09ec){logger[_0xe9ee('0x26')](_0x1e09ec[_0xe9ee('0x35')]);if(_0x1e09ec[_0xe9ee('0x36')]){delete _0x1e09ec[_0xe9ee('0x36')];}_0x20890e['status'](_0x7d1ded)[_0xe9ee('0x37')](_0x1e09ec);};}exports[_0xe9ee('0x38')]=function(_0x195895,_0x1ba794){var _0x5a2d0e={},_0x1df8bf={},_0x2adc97={'count':0x0,'rows':[]};var _0x578463=db[_0xe9ee('0x39')][_0xe9ee('0x3a')];_0x1df8bf[_0xe9ee('0x3b')]=_[_0xe9ee('0x3c')](_0x578463);_0x1df8bf[_0xe9ee('0x3d')]=_[_0xe9ee('0x3c')](_0x195895[_0xe9ee('0x3d')]);_0x1df8bf[_0xe9ee('0x3e')]=_[_0xe9ee('0x3f')](_0x1df8bf[_0xe9ee('0x3b')],_0x1df8bf[_0xe9ee('0x3d')]);_0x5a2d0e['attributes']=_[_0xe9ee('0x3f')](_0x1df8bf[_0xe9ee('0x3b')],qs['fields'](_0x195895['query'][_0xe9ee('0x40')]));_0x5a2d0e[_0xe9ee('0x41')]=_0x5a2d0e['attributes'][_0xe9ee('0x42')]?_0x5a2d0e[_0xe9ee('0x41')]:_0x1df8bf['model'];if(!_0x195895[_0xe9ee('0x3d')][_0xe9ee('0x43')](_0xe9ee('0x44'))){_0x5a2d0e[_0xe9ee('0x30')]=qs[_0xe9ee('0x30')](_0x195895[_0xe9ee('0x3d')]['limit']);_0x5a2d0e[_0xe9ee('0x2f')]=qs[_0xe9ee('0x2f')](_0x195895[_0xe9ee('0x3d')]['offset']);}_0x5a2d0e['order']=qs[_0xe9ee('0x45')](_0x195895[_0xe9ee('0x3d')][_0xe9ee('0x45')]);_0x5a2d0e[_0xe9ee('0x46')]=qs[_0xe9ee('0x3e')](_['pick'](_0x195895['query'],_0x1df8bf[_0xe9ee('0x3e')]));if(_0x195895['query'][_0xe9ee('0x47')]){_0x5a2d0e[_0xe9ee('0x46')]=_[_0xe9ee('0x48')](_0x5a2d0e[_0xe9ee('0x46')],{'$or':_[_0xe9ee('0x49')](_0x578463,function(_0x5cc769){if(_0x5cc769[_0xe9ee('0x4a')]['key']!==_0xe9ee('0x4b')){var _0x2f5386={};_0x2f5386[_0x5cc769[_0xe9ee('0x4c')]]={'$like':'%'+_0x195895[_0xe9ee('0x3d')][_0xe9ee('0x47')]+'%'};return _0x2f5386;}})});}_0x5a2d0e=_['merge']({},_0x5a2d0e,_0x195895['options']);var _0x34d60d={'where':_0x5a2d0e[_0xe9ee('0x46')]};_0x34d60d['include']=[];if(_0x195895['query'][_0xe9ee('0x4d')]){_0x34d60d[_0xe9ee('0x4e')][_0xe9ee('0x4f')]({'model':db['Tag'],'as':'Tags','attributes':['id'],'where':{'id':_0x195895[_0xe9ee('0x3d')][_0xe9ee('0x4d')]},'required':!![]});_0x34d60d[_0xe9ee('0x50')]=!![];}if(_0x195895[_0xe9ee('0x3d')]['read']){_0x34d60d[_0xe9ee('0x4e')][_0xe9ee('0x4f')]({'model':db['ChatMessage'],'as':_0xe9ee('0x51'),'attributes':['id','direction',_0xe9ee('0x52'),_0xe9ee('0x53')],'where':{'direction':'in','read':_0x195895[_0xe9ee('0x3d')]['read']||![]},'required':!![]});_0x34d60d[_0xe9ee('0x50')]=!![];}return db['ChatInteraction']['count'](_0x34d60d)['then'](function(_0x1ea704){_0x2adc97[_0xe9ee('0x2e')]=_0x1ea704;if(_0x195895['query'][_0xe9ee('0x54')]){_0x5a2d0e[_0xe9ee('0x4e')]=[{'model':db[_0xe9ee('0x55')],'as':_0xe9ee('0x56'),'required':![],'attributes':['id',_0xe9ee('0x36'),_0xe9ee('0x57')]},{'model':db[_0xe9ee('0x58')],'as':_0xe9ee('0x59'),'required':![]},{'model':db[_0xe9ee('0x55')],'as':_0xe9ee('0x5a'),'attributes':[_0xe9ee('0x36'),_0xe9ee('0x57'),_0xe9ee('0x5b')],'required':![]},{'model':db[_0xe9ee('0x5c')],'as':_0xe9ee('0x5d'),'attributes':[_0xe9ee('0x36'),_0xe9ee('0x5e')],'required':![]},{'model':db['ChatMessage'],'as':_0xe9ee('0x51'),'attributes':['id',_0xe9ee('0x5f'),_0xe9ee('0x52'),_0xe9ee('0x53')],'where':{'direction':'in','read':_0x195895[_0xe9ee('0x3d')][_0xe9ee('0x53')]||![]},'required':_0x195895[_0xe9ee('0x3d')][_0xe9ee('0x53')]||![]},{'model':db[_0xe9ee('0x60')],'as':_0xe9ee('0x61'),'attributes':['id','name','color'],'required':_0x195895[_0xe9ee('0x3d')][_0xe9ee('0x4d')]?!![]:![]},{'model':db[_0xe9ee('0x60')],'as':_0xe9ee('0x62'),'attributes':['id',_0xe9ee('0x36'),_0xe9ee('0x63')],'through':_0x195895['query'][_0xe9ee('0x4d')]?{'attributes':[],'where':{'TagId':_0x195895['query'][_0xe9ee('0x4d')]||undefined}}:{},'required':_0x195895[_0xe9ee('0x3d')][_0xe9ee('0x4d')]?!![]:![]}];}return db['ChatInteraction'][_0xe9ee('0x64')](_0x5a2d0e);})[_0xe9ee('0x1f')](function(_0x29930a){_0x2adc97['rows']=_0x29930a;return _0x2adc97;})[_0xe9ee('0x1f')](respondWithFilteredResult(_0x1ba794,_0x5a2d0e))['catch'](handleError(_0x1ba794,null));};exports[_0xe9ee('0x65')]=function(_0x44bc1e,_0x3e4f3a){var _0x3f8163={'raw':![],'where':{'id':_0x44bc1e[_0xe9ee('0x66')]['id']}},_0x382398={};_0x382398[_0xe9ee('0x3b')]=_[_0xe9ee('0x3c')](db[_0xe9ee('0x39')]['rawAttributes']);_0x382398['query']=_[_0xe9ee('0x3c')](_0x44bc1e[_0xe9ee('0x3d')]);_0x382398[_0xe9ee('0x3e')]=_[_0xe9ee('0x3f')](_0x382398['model'],_0x382398[_0xe9ee('0x3d')]);_0x3f8163[_0xe9ee('0x41')]=_[_0xe9ee('0x3f')](_0x382398[_0xe9ee('0x3b')],qs[_0xe9ee('0x40')](_0x44bc1e[_0xe9ee('0x3d')][_0xe9ee('0x40')]));_0x3f8163[_0xe9ee('0x41')]=_0x3f8163[_0xe9ee('0x41')][_0xe9ee('0x42')]?_0x3f8163['attributes']:_0x382398['model'];if(_0x44bc1e['query'][_0xe9ee('0x54')]){_0x3f8163['include']=[{'all':!![]}];}_0x3f8163=_[_0xe9ee('0x48')]({},_0x3f8163,_0x44bc1e[_0xe9ee('0x67')]);return db[_0xe9ee('0x39')][_0xe9ee('0x68')](_0x3f8163)['then'](handleEntityNotFound(_0x3e4f3a,null))[_0xe9ee('0x1f')](respondWithResult(_0x3e4f3a,null))[_0xe9ee('0x29')](handleError(_0x3e4f3a,null));};exports[_0xe9ee('0x69')]=function(_0x181fe3,_0x3f587d){return db['ChatInteraction'][_0xe9ee('0x69')](_0x181fe3['body'],{})[_0xe9ee('0x1f')](respondWithResult(_0x3f587d,0xc9))['catch'](handleError(_0x3f587d,null));};exports[_0xe9ee('0x6a')]=function(_0x36b623,_0x12593d){if(_0x36b623[_0xe9ee('0x6b')]['id']){delete _0x36b623['body']['id'];}return db['ChatInteraction'][_0xe9ee('0x68')]({'where':{'id':_0x36b623[_0xe9ee('0x66')]['id']}})[_0xe9ee('0x1f')](handleEntityNotFound(_0x12593d,null))[_0xe9ee('0x1f')](saveUpdates(_0x36b623['body'],null))[_0xe9ee('0x1f')](respondWithResult(_0x12593d,null))[_0xe9ee('0x29')](handleError(_0x12593d,null));};exports[_0xe9ee('0x34')]=function(_0x284101,_0x140904){return db['ChatInteraction'][_0xe9ee('0x68')]({'where':{'id':_0x284101[_0xe9ee('0x66')]['id']}})['then'](handleEntityNotFound(_0x140904,null))[_0xe9ee('0x1f')](removeEntity(_0x140904,null))[_0xe9ee('0x29')](handleError(_0x140904,null));};exports[_0xe9ee('0x6c')]=function(_0x1ed487,_0x147f22){return db[_0xe9ee('0x39')][_0xe9ee('0x6c')]()[_0xe9ee('0x1f')](respondWithResult(_0x147f22,null))[_0xe9ee('0x29')](handleError(_0x147f22,null));};exports[_0xe9ee('0x6d')]=function(_0x6f6f3d,_0x553681){if(_0x6f6f3d[_0xe9ee('0x6b')]['id']){delete _0x6f6f3d[_0xe9ee('0x6b')]['id'];}return db[_0xe9ee('0x39')]['find']({'where':{'id':_0x6f6f3d[_0xe9ee('0x66')]['id']}})[_0xe9ee('0x1f')](handleEntityNotFound(_0x553681,null))[_0xe9ee('0x1f')](saveUpdates(_0x6f6f3d[_0xe9ee('0x6b')],null))[_0xe9ee('0x1f')](respondWithResult(_0x553681,null))['catch'](handleError(_0x553681,null));};exports[_0xe9ee('0x6e')]=function(_0x4d32b3,_0x273d60,_0x2d816f){if(_0x4d32b3['body']['id']){delete _0x4d32b3[_0xe9ee('0x6b')]['id'];}return db[_0xe9ee('0x39')][_0xe9ee('0x68')]({'where':{'id':_0x4d32b3[_0xe9ee('0x66')]['id']}})['then'](function(_0x5bf900){if(!_0x5bf900){logger[_0xe9ee('0x26')](_0xe9ee('0x6f'),_0xe9ee('0x6e'),0x194,_0xe9ee('0x70'));_0x273d60[_0xe9ee('0x2a')](0x194);}else{if(_0x5bf900[_0xe9ee('0x71')]){throw new db['Sequelize'][(_0xe9ee('0x72'))](_0xe9ee('0x73'));}}return _0x5bf900;})[_0xe9ee('0x1f')](function(_0x5a709b){if(_0x5a709b){return _0x5a709b[_0xe9ee('0x6a')]({'closed':_0x4d32b3[_0xe9ee('0x6b')]['closed'],'disposition':_0x4d32b3[_0xe9ee('0x6b')]['disposition']})[_0xe9ee('0x1f')](function(_0x674c76){return _0x674c76;});}})[_0xe9ee('0x1f')](function(_0x3373f5){return respondWithRpcPromise('AbandonInteraction',_0xe9ee('0x6e'),_0x4d32b3[_0xe9ee('0x6b')],client9004);})[_0xe9ee('0x1f')](respondWithResult(_0x273d60,null))[_0xe9ee('0x29')](handleError(_0x273d60,null));};exports[_0xe9ee('0x74')]=function(_0x56c454,_0x5bc52f,_0x377487){_0x56c454[_0xe9ee('0x6b')][_0xe9ee('0x36')]=_0x56c454[_0xe9ee('0x75')][_0xe9ee('0x76')];_0x56c454[_0xe9ee('0x6b')][_0xe9ee('0x77')]=_0x56c454[_0xe9ee('0x75')]['filename'];_0x56c454[_0xe9ee('0x6b')][_0xe9ee('0x4a')]=_0x56c454[_0xe9ee('0x75')][_0xe9ee('0x78')];return db[_0xe9ee('0x79')][_0xe9ee('0x69')](_0x56c454[_0xe9ee('0x6b')])[_0xe9ee('0x1f')](respondWithResult(_0x5bc52f,0xc9))[_0xe9ee('0x29')](handleError(_0x5bc52f,null));};exports[_0xe9ee('0x7a')]=function(_0x363e5f,_0x284b4d,_0x480a2f){return db[_0xe9ee('0x39')][_0xe9ee('0x7b')]({'where':{'id':_0x363e5f[_0xe9ee('0x66')]['id']},'raw':!![]})[_0xe9ee('0x1f')](handleEntityNotFound(_0x284b4d,null))[_0xe9ee('0x1f')](function(_0x56d488){if(_0x56d488){if(_0x56d488[_0xe9ee('0x7c')]){return _0x284b4d['status'](0x193)[_0xe9ee('0x2d')]({'status':0x193,'message':_0xe9ee('0x7d')});}return db[_0xe9ee('0x79')]['findOne']({'where':{'id':_0x363e5f['query']['attachId']},'raw':!![]})[_0xe9ee('0x1f')](handleEntityNotFound(_0x284b4d,null));}})[_0xe9ee('0x1f')](function(_0x5a70da){if(_0x5a70da){return _0x284b4d[_0xe9ee('0x7e')](path[_0xe9ee('0x7f')](config['root'],_0xe9ee('0x80'),_0x5a70da[_0xe9ee('0x77')]));}})[_0xe9ee('0x29')](handleError(_0x284b4d,null));};exports[_0xe9ee('0x81')]=function(_0x37e845,_0x43aacf){var _0x4c2a6e=null;var _0x4c831a=null;var _0x1d391e=null;var _0x58a5c9=null;if(_0x37e845[_0xe9ee('0x6b')]['id']){delete _0x37e845['body']['id'];}if(_0x37e845[_0xe9ee('0x6b')]['mailTranscript']){_0x58a5c9=path[_0xe9ee('0x7f')](config[_0xe9ee('0x82')],'server/files/chat/upload/',util[_0xe9ee('0x83')](_0xe9ee('0x84'),Date[_0xe9ee('0x85')]()));_0x37e845[_0xe9ee('0x6b')][_0xe9ee('0x86')]=_0x58a5c9;}return db['ChatInteraction']['find']({'where':{'id':_0x37e845[_0xe9ee('0x66')]['id']},'include':[{'model':db[_0xe9ee('0x87')],'as':_0xe9ee('0x51'),'include':[{'model':db['User'],'as':_0xe9ee('0x55')}]}]})[_0xe9ee('0x1f')](handleEntityNotFound(_0x43aacf,null))[_0xe9ee('0x1f')](saveUpdates(_0x37e845[_0xe9ee('0x6b')],null))['then'](function(_0x391329){if(_0x391329){_0x4c2a6e=_0x391329;return db[_0xe9ee('0x5c')][_0xe9ee('0x68')]({'where':{'id':_0x4c2a6e['ChatWebsiteId']}});}})[_0xe9ee('0x1f')](function(_0x490429){if(_0x490429){_0x1d391e=_0x490429;return db['CmContact'][_0xe9ee('0x68')]({'where':{'id':_0x4c2a6e['ContactId']}});}})[_0xe9ee('0x1f')](function(_0x161b36){if(_0x161b36){_0x4c831a=_0x161b36;if(_0x58a5c9){var _0x42bc6d=null;for(var _0x3a2b5c=0x1;_0x3a2b5c<_0x4c2a6e[_0xe9ee('0x51')][_0xe9ee('0x42')];++_0x3a2b5c){_0x42bc6d=_0x4c2a6e['Messages'][_0x3a2b5c];var _0x1da6aa=_0x42bc6d[_0xe9ee('0x71')]?util['format'](_0xe9ee('0x88'),_0x1d391e[_0xe9ee('0x89')],_0x42bc6d[_0xe9ee('0x71')]):_0xe9ee('0x8a');var _0x44a219=_0x37e845[_0xe9ee('0x6b')]['customer']||util[_0xe9ee('0x83')](_0xe9ee('0x88'),_0xe9ee('0x8b'),_0x42bc6d[_0xe9ee('0x8c')]);switch(_0x1d391e[_0xe9ee('0x8d')]){case _0xe9ee('0x8e'):_0x1da6aa=_0x42bc6d[_0xe9ee('0x71')]?util[_0xe9ee('0x83')](_0xe9ee('0x88'),_0x1d391e['agentAlias'],_0x42bc6d['UserId']):_0xe9ee('0x8a');break;case _0xe9ee('0x8f'):_0x1da6aa=_0x42bc6d[_0xe9ee('0x71')]?_0x42bc6d['User'][_0xe9ee('0x90')]||_0x42bc6d[_0xe9ee('0x55')]['fullname']:_0xe9ee('0x8a');break;case _0xe9ee('0x91'):_0x1da6aa=_0x42bc6d[_0xe9ee('0x71')]?_0x42bc6d['User'][_0xe9ee('0x57')]:_0xe9ee('0x8a');break;default:_0x1da6aa=_0x42bc6d[_0xe9ee('0x71')]?util[_0xe9ee('0x83')]('%s%d',_0x1d391e[_0xe9ee('0x89')],_0x42bc6d[_0xe9ee('0x71')]):'System';}var _0x1c61fb=util[_0xe9ee('0x83')](_0xe9ee('0x92'),moment(_0x42bc6d[_0xe9ee('0x52')])[_0xe9ee('0x83')](_0xe9ee('0x93')),_0x42bc6d[_0xe9ee('0x5f')]==='in'?_0x44a219:_0x1da6aa,_0x42bc6d['body']);if(!_0x42bc6d[_0xe9ee('0x94')]){fs[_0xe9ee('0x95')](_0x58a5c9,_0x1c61fb);}}return db[_0xe9ee('0x96')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe9ee('0x97')],'as':_0xe9ee('0x98'),'raw':!![]}]});}}})[_0xe9ee('0x1f')](function(_0x3d6318){if(_0x3d6318&&_0x3d6318[_0xe9ee('0x98')]&&_0x37e845[_0xe9ee('0x6b')]){var _0xe1ea71={'tls':{'rejectUnauthorized':![]}};if(_0x3d6318[_0xe9ee('0x98')][_0xe9ee('0x99')]){_0xe1ea71[_0xe9ee('0x99')]=_0x3d6318[_0xe9ee('0x98')][_0xe9ee('0x99')];}else{_0xe1ea71['host']=_0x3d6318['Smtp'][_0xe9ee('0x9a')];_0xe1ea71[_0xe9ee('0x9b')]=_0x3d6318['Smtp'][_0xe9ee('0x9b')];_0xe1ea71['secure']=_0x3d6318['Smtp'][_0xe9ee('0x9c')];}if(_0x3d6318[_0xe9ee('0x98')]['authentication']){_0xe1ea71[_0xe9ee('0x9d')]={'user':_0x3d6318['Smtp'][_0xe9ee('0x9e')],'pass':_0x3d6318[_0xe9ee('0x98')][_0xe9ee('0x9f')]};}return respondWithRpcPromise(_0xe9ee('0xa0'),'sendMail',{'account':_0xe1ea71,'message':{'from':util[_0xe9ee('0x83')](_0xe9ee('0xa1'),_0x3d6318[_0xe9ee('0x36')],_0x3d6318[_0xe9ee('0xa2')]||_0x3d6318[_0xe9ee('0x98')][_0xe9ee('0x9e')]),'to':_0x37e845[_0xe9ee('0x6b')][_0xe9ee('0xa3')],'subject':_0xe9ee('0xa4'),'text':util[_0xe9ee('0x83')](_0xe9ee('0xa5'),_0x37e845[_0xe9ee('0x6b')]['mailTranscript']),'attachments':[{'path':_0x58a5c9}]}})[_0xe9ee('0x1f')](function(){return _0x4c2a6e;})[_0xe9ee('0x29')](function(_0x1cc2c6){console['error'](_0x1cc2c6);});}else{return _0x4c2a6e;}})['then'](respondWithStatusCode(_0x43aacf,0xc8))[_0xe9ee('0x29')](handleError(_0x43aacf,null));};exports[_0xe9ee('0xa6')]=function(_0x2106e7,_0x305e53,_0x5ec63c){return db['ChatMessage'][_0xe9ee('0x68')]({'where':{'id':_0x2106e7[_0xe9ee('0x66')]['id']}})[_0xe9ee('0x1f')](handleEntityNotFound(_0x305e53,null))['then'](function(_0x3dbdaf){if(_0x3dbdaf){return _0x3dbdaf[_0xe9ee('0xa6')](_0x2106e7[_0xe9ee('0x6b')][_0xe9ee('0xa7')],_[_0xe9ee('0xa8')](_0x2106e7[_0xe9ee('0x6b')],[_0xe9ee('0xa7'),'id'])||{});}})[_0xe9ee('0x1f')](respondWithResult(_0x305e53,null))[_0xe9ee('0x29')](handleError(_0x305e53,null));};exports[_0xe9ee('0xa9')]=function(_0x3337e3,_0x3cfc85,_0x1c8074){var _0xd7f2ee={'raw':![],'where':{}};var _0x42cc57={};var _0x20dbc4={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe9ee('0x7b')]({'where':{'id':_0x3337e3[_0xe9ee('0x66')]['id']}})[_0xe9ee('0x1f')](handleEntityNotFound(_0x3cfc85,null))[_0xe9ee('0x1f')](function(_0xb06bce){if(_0xb06bce){_0x42cc57[_0xe9ee('0x3b')]=_[_0xe9ee('0x3c')](db[_0xe9ee('0x87')][_0xe9ee('0x3a')]);_0x42cc57['query']=_[_0xe9ee('0x3c')](_0x3337e3[_0xe9ee('0x3d')]);_0x42cc57[_0xe9ee('0x3e')]=_[_0xe9ee('0x3f')](_0x42cc57['model'],_0x42cc57[_0xe9ee('0x3d')]);_0xd7f2ee['attributes']=_['intersection'](_0x42cc57[_0xe9ee('0x3b')],qs[_0xe9ee('0x40')](_0x3337e3['query'][_0xe9ee('0x40')]));_0xd7f2ee[_0xe9ee('0x41')]=_0xd7f2ee[_0xe9ee('0x41')][_0xe9ee('0x42')]?_0xd7f2ee[_0xe9ee('0x41')]:_0x42cc57['model'];if(!_0x3337e3[_0xe9ee('0x3d')][_0xe9ee('0x43')](_0xe9ee('0x44'))){_0xd7f2ee[_0xe9ee('0x30')]=qs[_0xe9ee('0x30')](_0x3337e3[_0xe9ee('0x3d')]['limit']);_0xd7f2ee['offset']=qs['offset'](_0x3337e3['query']['offset']);}_0xd7f2ee[_0xe9ee('0xaa')]=qs['sort'](_0x3337e3['query'][_0xe9ee('0x45')]);_0xd7f2ee[_0xe9ee('0x46')]=qs[_0xe9ee('0x3e')](_[_0xe9ee('0xab')](_0x3337e3[_0xe9ee('0x3d')],_0x42cc57['filters']));_0xd7f2ee[_0xe9ee('0x46')]['ChatInteractionId']=_0xb06bce['id'];if(_0x3337e3[_0xe9ee('0x3d')]['filter']){_0xd7f2ee[_0xe9ee('0x46')]=_[_0xe9ee('0x48')](_0xd7f2ee[_0xe9ee('0x46')],{'$or':_['map'](_0xd7f2ee[_0xe9ee('0x41')],function(_0x2ec367){var _0x2c892f={};_0x2c892f[_0x2ec367]={'$like':'%'+_0x3337e3[_0xe9ee('0x3d')]['filter']+'%'};return _0x2c892f;})});}if(_0x3337e3[_0xe9ee('0x3d')][_0xe9ee('0xac')]){var _0x5265af=_0x3337e3[_0xe9ee('0x3d')][_0xe9ee('0xac')][_0xe9ee('0xad')](',');var _0xe3c832={};_0xe3c832[_0x5265af[0x0]]={'$gte':moment(_0x5265af[0x1])[_0xe9ee('0x83')]('YYYY-MM-DD\x20HH:mm:ss')};_0xd7f2ee['where']=_[_0xe9ee('0x48')](_0xd7f2ee[_0xe9ee('0x46')],_0xe3c832);}_0xd7f2ee=_[_0xe9ee('0x48')]({},_0xd7f2ee,_0x3337e3[_0xe9ee('0x67')]);return db[_0xe9ee('0x87')][_0xe9ee('0x2e')]({'where':_0xd7f2ee[_0xe9ee('0x46')]})['then'](function(_0x19d06e){_0x20dbc4[_0xe9ee('0x2e')]=_0x19d06e;if(_0x3337e3[_0xe9ee('0x3d')]['includeAll']){_0xd7f2ee[_0xe9ee('0x4e')]=[{'all':!![]}];}return db['ChatMessage'][_0xe9ee('0x64')](_0xd7f2ee);})[_0xe9ee('0x1f')](function(_0x2b8943){_0x20dbc4[_0xe9ee('0xae')]=_0x2b8943;return _0x20dbc4;});}})[_0xe9ee('0x1f')](respondWithFilteredResult(_0x3cfc85,_0xd7f2ee))[_0xe9ee('0x29')](handleError(_0x3cfc85,null));};exports['getMyMessages']=function(_0x2d95d7,_0x26d234,_0x214c3b){var _0x46d503={'where':{}},_0x5a7d66={},_0x28cef3={'count':0x0,'rows':[]};return db[_0xe9ee('0x39')]['findOne']({'where':{'id':_0x2d95d7[_0xe9ee('0x66')]['id']}})[_0xe9ee('0x1f')](handleEntityNotFound(_0x26d234,null))[_0xe9ee('0x1f')](function(_0xaef31a){if(_0xaef31a){_0x5a7d66['model']=_[_0xe9ee('0x3c')](db[_0xe9ee('0x87')][_0xe9ee('0x3a')]);_0x5a7d66[_0xe9ee('0x3d')]=_[_0xe9ee('0x3c')](_0x2d95d7[_0xe9ee('0x3d')]);_0x5a7d66['filters']=_[_0xe9ee('0x3f')](_0x5a7d66['model'],_0x5a7d66[_0xe9ee('0x3d')]);_0x46d503[_0xe9ee('0x41')]=_[_0xe9ee('0x3f')](_0x5a7d66[_0xe9ee('0x3b')],qs[_0xe9ee('0x40')](_0x2d95d7['query']['fields']));_0x46d503[_0xe9ee('0x41')]=_0x46d503[_0xe9ee('0x41')][_0xe9ee('0x42')]?_0x46d503[_0xe9ee('0x41')]:_0x5a7d66[_0xe9ee('0x3b')];if(!_0x2d95d7[_0xe9ee('0x3d')][_0xe9ee('0x43')]('nolimit')){_0x46d503[_0xe9ee('0x30')]=qs['limit'](_0x2d95d7[_0xe9ee('0x3d')][_0xe9ee('0x30')]);_0x46d503[_0xe9ee('0x2f')]=qs[_0xe9ee('0x2f')](_0x2d95d7[_0xe9ee('0x3d')][_0xe9ee('0x2f')]);}_0x46d503[_0xe9ee('0xaa')]=qs[_0xe9ee('0x45')](_0x2d95d7[_0xe9ee('0x3d')][_0xe9ee('0x45')]);_0x46d503['where']=qs[_0xe9ee('0x3e')](_[_0xe9ee('0xab')](_0x2d95d7[_0xe9ee('0x3d')],_0x5a7d66['filters']));_0x46d503['where'][_0xe9ee('0xaf')]=_0xaef31a['id'];if(_0x2d95d7['query'][_0xe9ee('0x47')]){_0x46d503['where']=_[_0xe9ee('0x48')](_0x46d503[_0xe9ee('0x46')],{'$or':_[_0xe9ee('0x49')](_0x46d503[_0xe9ee('0x41')],function(_0x9d0a64){var _0xd46010={};_0xd46010[_0x9d0a64]={'$like':'%'+_0x2d95d7[_0xe9ee('0x3d')][_0xe9ee('0x47')]+'%'};return _0xd46010;})});}_0x46d503[_0xe9ee('0x46')]['secret']=![];if(_0x2d95d7[_0xe9ee('0x3d')]['id']){_0x46d503[_0xe9ee('0x46')]['id']={'$gt':_0x2d95d7[_0xe9ee('0x3d')]['id']};}_0x46d503=_[_0xe9ee('0x48')]({},_0x46d503,_0x2d95d7[_0xe9ee('0x67')]);return db[_0xe9ee('0x87')][_0xe9ee('0x2e')]({'where':_0x46d503[_0xe9ee('0x46')]})[_0xe9ee('0x1f')](function(_0x2a2a5d){_0x28cef3[_0xe9ee('0x2e')]=_0x2a2a5d;_0x46d503['include']=[];if(_0x2d95d7['query']['includeAgent']){_0x46d503[_0xe9ee('0x4e')][_0xe9ee('0x4f')]({'model':db[_0xe9ee('0x55')],'as':_0xe9ee('0x55'),'attributes':['id','fullname',_0xe9ee('0x90')]});}if(_0x2d95d7[_0xe9ee('0x3d')][_0xe9ee('0x54')]){_0x46d503['include']=[{'all':!![]}];}return db['ChatMessage'][_0xe9ee('0x64')](_0x46d503);})['then'](function(_0x330b12){_0x28cef3[_0xe9ee('0xae')]=_0x330b12;return _0x28cef3;});}})[_0xe9ee('0x1f')](respondWithFilteredResult(_0x26d234,_0x46d503))[_0xe9ee('0x29')](handleError(_0x26d234,null));};exports[_0xe9ee('0xb0')]=function(_0x5cb237,_0x9bd7a,_0x1e2fac){return db[_0xe9ee('0x39')][_0xe9ee('0x68')]({'where':{'id':_0x5cb237[_0xe9ee('0x66')]['id']}})[_0xe9ee('0x1f')](handleEntityNotFound(_0x9bd7a,null))['then'](function(_0x1a23c3){if(_0x1a23c3){return _0x1a23c3[_0xe9ee('0xb1')](_0x5cb237[_0xe9ee('0x6b')][_0xe9ee('0xa7')],_[_0xe9ee('0xa8')](_0x5cb237[_0xe9ee('0x6b')],[_0xe9ee('0xa7'),'id'])||{})['spread'](function(){return db[_0xe9ee('0x60')][_0xe9ee('0x64')]({'attributes':['id',_0xe9ee('0x36'),'color'],'where':{'id':_0x5cb237[_0xe9ee('0x6b')][_0xe9ee('0xa7')]}});})[_0xe9ee('0x1f')](function(_0x4d41b4){socket[_0xe9ee('0xb2')](_0xe9ee('0xb3'),{'id':Number(_0x5cb237[_0xe9ee('0x66')]['id']),'tags':_0x4d41b4||[]});return{'id':Number(_0x5cb237[_0xe9ee('0x66')]['id']),'tags':_0x4d41b4||[]};});}})['then'](respondWithResult(_0x9bd7a,null))[_0xe9ee('0x29')](handleError(_0x9bd7a,null));};exports['removeTags']=function(_0x257ef0,_0x2ee2e1,_0x4f7f69){var _0x19766d;return db['ChatInteraction'][_0xe9ee('0x68')]({'where':{'id':_0x257ef0[_0xe9ee('0x66')]['id']}})[_0xe9ee('0x1f')](handleEntityNotFound(_0x2ee2e1,null))[_0xe9ee('0x1f')](function(_0x517ece){if(_0x517ece){return _0x517ece[_0xe9ee('0xb4')](_0x257ef0[_0xe9ee('0x3d')][_0xe9ee('0xa7')]);}})[_0xe9ee('0x1f')](respondWithStatusCode(_0x2ee2e1,null))[_0xe9ee('0x29')](handleError(_0x2ee2e1,null));};exports['download']=function(_0x502b87,_0x436531){var _0x5b6504=moment()['unix']()['toString']();var _0x3bbcdc=path[_0xe9ee('0x7f')](config[_0xe9ee('0x82')],'server',_0xe9ee('0xb5'),_0xe9ee('0xb6'));var _0x1415ba=path[_0xe9ee('0x7f')](config[_0xe9ee('0x82')],_0xe9ee('0xb7'),_0xe9ee('0xb5'),_0xe9ee('0xb8'));var _0x1d8f03=path['join'](_0x3bbcdc,_0x5b6504);var _0x97c4ed=util[_0xe9ee('0x83')](_0xe9ee('0xb9'),_0x5b6504);var _0x5b2252=path[_0xe9ee('0x7f')](_0x3bbcdc,_0x97c4ed);var _0x261172=![];return db['ChatInteraction'][_0xe9ee('0x68')]({'where':{'id':_0x502b87[_0xe9ee('0x66')]['id']},'include':[{'model':db[_0xe9ee('0x87')],'as':'Messages','attributes':['id',_0xe9ee('0x6b')],'include':[{'model':db[_0xe9ee('0x55')],'as':_0xe9ee('0x55'),'attributes':['id',_0xe9ee('0x57')],'raw':!![]},{'model':db[_0xe9ee('0x58')],'as':'Contact','attributes':['id',_0xe9ee('0xba')],'raw':!![]},{'model':db[_0xe9ee('0x79')],'as':_0xe9ee('0x79'),'raw':!![]}]}]})[_0xe9ee('0x1f')](handleEntityNotFound(_0x436531,null))[_0xe9ee('0x1f')](function(_0x5ded6a){if(_0x5ded6a){_0x261172=!![];var _0x4f5a8b='';var _0x296a60={'format':_0xe9ee('0xbb'),'border':'1cm'};fs[_0xe9ee('0xbc')](_0x1d8f03);_0x4f5a8b+=util[_0xe9ee('0x83')](_0xe9ee('0xbd'),_0x5ded6a['id']);_0x4f5a8b+=util[_0xe9ee('0x83')]('

Date:\x20%s

',moment()[_0xe9ee('0x83')](_0xe9ee('0xbe'))[_0xe9ee('0xbf')]());_0x4f5a8b+=_0xe9ee('0xc0');for(var _0x33e126=0x1;_0x33e126<_0x5ded6a[_0xe9ee('0x51')]['length'];_0x33e126++){var _0x4c2b0a=_0x5ded6a[_0xe9ee('0x51')][_0x33e126];_0x4f5a8b+=_0xe9ee('0xc1');_0x4f5a8b+=util[_0xe9ee('0x83')](_0xe9ee('0xc2'),_0x4c2b0a[_0xe9ee('0x55')]?_0x4c2b0a[_0xe9ee('0x55')][_0xe9ee('0x57')]:_0x4c2b0a['Contact']['firstName'],_0x4c2b0a[_0xe9ee('0x6b')]);_0x4f5a8b+=_0xe9ee('0xc3');if(_0x4c2b0a[_0xe9ee('0x79')]){var _0x164b05=_0x4c2b0a['Attachment'];var _0x4f4d73=path[_0xe9ee('0x7f')](_0x1415ba,_0x164b05[_0xe9ee('0x77')]);if(fs[_0xe9ee('0xc4')](_0x4f4d73)){fs[_0xe9ee('0xc5')](_0x4f4d73)[_0xe9ee('0xc6')](fs[_0xe9ee('0xc7')](path[_0xe9ee('0x7f')](_0x1d8f03,_0x164b05[_0xe9ee('0x77')])));}}}return new BPromise(function(_0x3d2610,_0x1b8afd){pdf[_0xe9ee('0x69')](_0x4f5a8b,_0x296a60)[_0xe9ee('0xc8')](path['join'](_0x1d8f03,_0xe9ee('0xc9')+_0x5b6504+_0xe9ee('0xca')),function(_0xd2cbcb,_0x583825){if(_0xd2cbcb)return _0x1b8afd(_0xd2cbcb);_0x3d2610(_0x583825);});});}})['then'](function(){if(_0x261172){return new BPromise(function(_0x2d17e7,_0x1ec210){zipdir(_0x1d8f03,{'saveTo':_0x5b2252},function(_0x640be1,_0x523b18){if(_0x640be1)return _0x1ec210(_0x640be1);return _0x2d17e7(_0x523b18);});});}})[_0xe9ee('0x1f')](function(){if(_0x261172){return new BPromise(function(_0x3e7ad3,_0x44d22b){rimraf(_0x1d8f03,function(_0x1a553a){if(_0x1a553a)_0x44d22b(_0x1a553a);return _0x3e7ad3();});});}})[_0xe9ee('0x1f')](function(){if(_0x261172){return _0x436531[_0xe9ee('0x7e')](_0x5b2252,_0x97c4ed,function(_0x5422a3){if(_0x5422a3){console[_0xe9ee('0xcb')](_0xe9ee('0xcc'),_0x5422a3);}else{fs[_0xe9ee('0xcd')](_0x5b2252);}});}else{return _0x436531['sendStatus'](0xc8);}})['catch'](handleError(_0x436531,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index ddf2716..7ebe7ae 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 _0xc44d=['save','update','remove','hook','exports','events','ChatInteraction','setMaxListeners'];(function(_0x43389f,_0x5a81c9){var _0x1978e0=function(_0x544938){while(--_0x544938){_0x43389f['push'](_0x43389f['shift']());}};_0x1978e0(++_0x5a81c9);}(_0xc44d,0x7d));var _0xdc44=function(_0x28085b,_0x2f6171){_0x28085b=_0x28085b-0x0;var _0x4f1700=_0xc44d[_0x28085b];return _0x4f1700;};'use strict';var EventEmitter=require(_0xdc44('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xdc44('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdc44('0x2')](0x0);var events={'afterCreate':_0xdc44('0x3'),'afterUpdate':_0xdc44('0x4'),'afterDestroy':_0xdc44('0x5')};function emitEvent(_0x4b35bd){return function(_0x20627e,_0x15623b,_0x2af1dd){ChatInteractionEvents['emit'](_0x4b35bd+':'+_0x20627e['id'],_0x20627e);ChatInteractionEvents['emit'](_0x4b35bd,_0x20627e);_0x2af1dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdc44('0x6')](e,emitEvent(event));}}module[_0xdc44('0x7')]=ChatInteractionEvents; \ No newline at end of file +var _0xde5e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x2cc45e,_0x10dbc4){var _0x3b29b4=function(_0x46999d){while(--_0x46999d){_0x2cc45e['push'](_0x2cc45e['shift']());}};_0x3b29b4(++_0x10dbc4);}(_0xde5e,0x187));var _0xede5=function(_0xd8b2ea,_0x1cf0f8){_0xd8b2ea=_0xd8b2ea-0x0;var _0x2b8d1b=_0xde5e[_0xd8b2ea];return _0x2b8d1b;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xede5('0x0'))['db']['ChatInteraction'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xede5('0x1')](0x0);var events={'afterCreate':_0xede5('0x2'),'afterUpdate':_0xede5('0x3'),'afterDestroy':_0xede5('0x4')};function emitEvent(_0x2b5130){return function(_0x2f1278,_0x1073f4,_0x5d5b3d){ChatInteractionEvents['emit'](_0x2b5130+':'+_0x2f1278['id'],_0x2f1278);ChatInteractionEvents[_0xede5('0x5')](_0x2b5130,_0x2f1278);_0x5d5b3d(null);};}for(var e in events){if(events[_0xede5('0x6')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 1afe677..2480aa4 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 _0x4a01=['request-promise','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x4a01,0xdd));var _0x14a0=function(_0x1d8ffd,_0x2ad938){_0x1d8ffd=_0x1d8ffd-0x0;var _0x43b76d=_0x4a01[_0x1d8ffd];return _0x43b76d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x14a0('0x0'))(_0x14a0('0x1'));var moment=require(_0x14a0('0x2'));var BPromise=require(_0x14a0('0x3'));var rp=require(_0x14a0('0x4'));var attributes=require(_0x14a0('0x5'));module[_0x14a0('0x6')]=function(_0x1377a3,_0x2266c5){return _0x1377a3[_0x14a0('0x7')](_0x14a0('0x8'),attributes,{'tableName':_0x14a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x154722,_0x539811,_0x41ae05){if(_0x154722[_0x14a0('0xa')]('closed')){_0x154722[_0x14a0('0xb')]=moment()[_0x14a0('0xc')](_0x14a0('0xd'));}_0x41ae05(null,_0x154722);}},'charset':'utf8mb4','collate':_0x14a0('0xe')});}; \ No newline at end of file +var _0x55da=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','./chatInteraction.attributes','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x30d0fb,_0x5cabda){var _0x54be72=function(_0x149c59){while(--_0x149c59){_0x30d0fb['push'](_0x30d0fb['shift']());}};_0x54be72(++_0x5cabda);}(_0x55da,0x16d));var _0xa55d=function(_0x10b68c,_0x10ca7c){_0x10b68c=_0x10b68c-0x0;var _0xb01f02=_0x55da[_0x10b68c];return _0xb01f02;};'use strict';var _=require(_0xa55d('0x0'));var util=require('util');var logger=require(_0xa55d('0x1'))(_0xa55d('0x2'));var moment=require('moment');var BPromise=require(_0xa55d('0x3'));var rp=require(_0xa55d('0x4'));var attributes=require(_0xa55d('0x5'));module['exports']=function(_0x5865dc,_0x1cabbe){return _0x5865dc['define'](_0xa55d('0x6'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36b449,_0x11b9d6,_0x2a2033){if(_0x36b449[_0xa55d('0x7')](_0xa55d('0x8'))){_0x36b449[_0xa55d('0x9')]=moment()[_0xa55d('0xa')](_0xa55d('0xb'));}_0x2a2033(null,_0x36b449);}},'charset':_0xa55d('0xc'),'collate':_0xa55d('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 38f8a8f..1146886 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 _0x2c7b=['ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x2c7b,0x1c4));var _0xb2c7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2c7b[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xb2c7('0x0'));var moment=require(_0xb2c7('0x1'));var BPromise=require(_0xb2c7('0x2'));var rs=require(_0xb2c7('0x3'));var fs=require('fs');var Redis=require(_0xb2c7('0x4'));var db=require(_0xb2c7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2c7('0x6'))(_0xb2c7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2c7('0x8')]['http']({'port':0x232a});config[_0xb2c7('0x9')]=_[_0xb2c7('0xa')](config[_0xb2c7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb2c7('0xb'))(new Redis(config[_0xb2c7('0x9')]));require(_0xb2c7('0xc'))[_0xb2c7('0xd')](socket);function respondWithRpcPromise(_0x42a835,_0x1f9b2c,_0x18bcd2){return new BPromise(function(_0x411d8f,_0x401f07){return client['request'](_0x42a835,_0x18bcd2)[_0xb2c7('0xe')](function(_0x499a38){logger[_0xb2c7('0xf')](_0xb2c7('0x10'),_0x1f9b2c,_0xb2c7('0x11'));logger[_0xb2c7('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1f9b2c,_0xb2c7('0x11'),JSON[_0xb2c7('0x13')](_0x499a38));if(_0x499a38[_0xb2c7('0x14')]){if(_0x499a38[_0xb2c7('0x14')]['code']===0x1f4){logger[_0xb2c7('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x1f9b2c,_0x499a38[_0xb2c7('0x14')][_0xb2c7('0x15')]);return _0x401f07(_0x499a38[_0xb2c7('0x14')][_0xb2c7('0x15')]);}logger['error'](_0xb2c7('0x10'),_0x1f9b2c,_0x499a38[_0xb2c7('0x14')][_0xb2c7('0x15')]);return _0x411d8f(_0x499a38[_0xb2c7('0x14')]['message']);}else{logger[_0xb2c7('0xf')](_0xb2c7('0x10'),_0x1f9b2c,_0xb2c7('0x11'));_0x411d8f(_0x499a38[_0xb2c7('0x16')][_0xb2c7('0x15')]);}})[_0xb2c7('0x17')](function(_0x22dc22){logger[_0xb2c7('0x14')](_0xb2c7('0x10'),_0x1f9b2c,_0x22dc22);_0x401f07(_0x22dc22);});});}exports[_0xb2c7('0x18')]=function(_0x69852b){var _0x41a074=this;return new Promise(function(_0x229353,_0x107856){return db[_0xb2c7('0x19')]['update'](_0x69852b['body'],{'raw':_0x69852b['options']?_0x69852b[_0xb2c7('0x1a')][_0xb2c7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x69852b[_0xb2c7('0x1a')]?_0x69852b['options'][_0xb2c7('0x1c')]||null:null,'attributes':_0x69852b['options']?_0x69852b[_0xb2c7('0x1a')][_0xb2c7('0x1d')]||null:null,'limit':_0x69852b[_0xb2c7('0x1a')]?_0x69852b[_0xb2c7('0x1a')][_0xb2c7('0x1e')]||null:null})['then'](function(_0x43ec6e){logger['info']('UpdateChatInteraction',_0x69852b);logger[_0xb2c7('0x12')]('UpdateChatInteraction',_0x69852b,JSON[_0xb2c7('0x13')](_0x43ec6e));_0x229353(_0x43ec6e);})['catch'](function(_0x6ca349){logger[_0xb2c7('0x14')](_0xb2c7('0x18'),_0x6ca349[_0xb2c7('0x15')],_0x69852b);_0x107856(_0x41a074[_0xb2c7('0x14')](0x1f4,_0x6ca349[_0xb2c7('0x15')]));});});};exports[_0xb2c7('0x1f')]=function(_0x393b24){return new Promise(function(_0x1c7fce,_0x56ae16){return db[_0xb2c7('0x19')][_0xb2c7('0x20')]({'where':_0x393b24[_0xb2c7('0x1a')]?_0x393b24[_0xb2c7('0x1a')][_0xb2c7('0x1c')]||null:null})['then'](function(_0x4140ff){if(_0x4140ff){return _0x4140ff['addTags'](_0x393b24[_0xb2c7('0x21')][_0xb2c7('0x22')],_[_0xb2c7('0x23')](_0x393b24[_0xb2c7('0x21')],['ids','id'])||{});}})[_0xb2c7('0x24')](function(_0x2795e0){logger['info']('AddTags',_0x393b24);logger['debug'](_0xb2c7('0x25'),_0x393b24,JSON[_0xb2c7('0x13')](_0x2795e0));_0x1c7fce(_0x2795e0);})['catch'](function(_0x24964c){logger[_0xb2c7('0x14')]('AddTags',_0x24964c['message'],_0x393b24);_0x56ae16(_this['error'](0x1f4,_0x24964c[_0xb2c7('0x15')]));});});}; \ No newline at end of file +var _0xb344=['stringify','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','raw','options','where','attributes','then','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags'];(function(_0x2d9cec,_0x39649c){var _0x54fc23=function(_0x12feb5){while(--_0x12feb5){_0x2d9cec['push'](_0x2d9cec['shift']());}};_0x54fc23(++_0x39649c);}(_0xb344,0x109));var _0x4b34=function(_0x1d6e56,_0x1959b9){_0x1d6e56=_0x1d6e56-0x0;var _0xef8e84=_0xb344[_0x1d6e56];return _0xef8e84;};'use strict';var _=require(_0x4b34('0x0'));var util=require('util');var moment=require(_0x4b34('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b34('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b34('0x3'));var logger=require(_0x4b34('0x4'))(_0x4b34('0x5'));var config=require(_0x4b34('0x6'));var jayson=require(_0x4b34('0x7'));var client=jayson[_0x4b34('0x8')][_0x4b34('0x9')]({'port':0x232a});config[_0x4b34('0xa')]=_[_0x4b34('0xb')](config[_0x4b34('0xa')],{'host':_0x4b34('0xc'),'port':0x18eb});var socket=require(_0x4b34('0xd'))(new Redis(config['redis']));require(_0x4b34('0xe'))[_0x4b34('0xf')](socket);function respondWithRpcPromise(_0x198744,_0x2be153,_0x155118){return new BPromise(function(_0x244d10,_0x5c5b35){return client[_0x4b34('0x10')](_0x198744,_0x155118)['then'](function(_0x15eb7e){logger['info'](_0x4b34('0x11'),_0x2be153,'request\x20sent');logger[_0x4b34('0x12')](_0x4b34('0x13'),_0x2be153,_0x4b34('0x14'),JSON['stringify'](_0x15eb7e));if(_0x15eb7e[_0x4b34('0x15')]){if(_0x15eb7e[_0x4b34('0x15')][_0x4b34('0x16')]===0x1f4){logger[_0x4b34('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2be153,_0x15eb7e['error'][_0x4b34('0x17')]);return _0x5c5b35(_0x15eb7e[_0x4b34('0x15')][_0x4b34('0x17')]);}logger[_0x4b34('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2be153,_0x15eb7e[_0x4b34('0x15')][_0x4b34('0x17')]);return _0x244d10(_0x15eb7e['error'][_0x4b34('0x17')]);}else{logger[_0x4b34('0x18')](_0x4b34('0x11'),_0x2be153,_0x4b34('0x14'));_0x244d10(_0x15eb7e[_0x4b34('0x19')][_0x4b34('0x17')]);}})[_0x4b34('0x1a')](function(_0x3eb0aa){logger[_0x4b34('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2be153,_0x3eb0aa);_0x5c5b35(_0x3eb0aa);});});}exports[_0x4b34('0x1b')]=function(_0x5b0911){var _0x266ab3=this;return new Promise(function(_0x1d2d5f,_0x2f3d66){return db[_0x4b34('0x1c')][_0x4b34('0x1d')](_0x5b0911['body'],{'raw':_0x5b0911['options']?_0x5b0911['options'][_0x4b34('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b0911[_0x4b34('0x1f')]?_0x5b0911[_0x4b34('0x1f')][_0x4b34('0x20')]||null:null,'attributes':_0x5b0911['options']?_0x5b0911[_0x4b34('0x1f')][_0x4b34('0x21')]||null:null,'limit':_0x5b0911[_0x4b34('0x1f')]?_0x5b0911[_0x4b34('0x1f')]['limit']||null:null})[_0x4b34('0x22')](function(_0x44aafe){logger['info']('UpdateChatInteraction',_0x5b0911);logger[_0x4b34('0x12')](_0x4b34('0x1b'),_0x5b0911,JSON['stringify'](_0x44aafe));_0x1d2d5f(_0x44aafe);})[_0x4b34('0x1a')](function(_0x184b21){logger[_0x4b34('0x15')](_0x4b34('0x1b'),_0x184b21[_0x4b34('0x17')],_0x5b0911);_0x2f3d66(_0x266ab3['error'](0x1f4,_0x184b21[_0x4b34('0x17')]));});});};exports[_0x4b34('0x23')]=function(_0x11ae94){return new Promise(function(_0x49d5fe,_0xae7491){return db[_0x4b34('0x1c')][_0x4b34('0x24')]({'where':_0x11ae94[_0x4b34('0x1f')]?_0x11ae94[_0x4b34('0x1f')][_0x4b34('0x20')]||null:null})[_0x4b34('0x22')](function(_0x5d808b){if(_0x5d808b){return _0x5d808b[_0x4b34('0x25')](_0x11ae94[_0x4b34('0x26')][_0x4b34('0x27')],_[_0x4b34('0x28')](_0x11ae94[_0x4b34('0x26')],[_0x4b34('0x27'),'id'])||{});}})[_0x4b34('0x29')](function(_0x202e93){logger[_0x4b34('0x18')](_0x4b34('0x2a'),_0x11ae94);logger[_0x4b34('0x12')](_0x4b34('0x2a'),_0x11ae94,JSON[_0x4b34('0x2b')](_0x202e93));_0x49d5fe(_0x202e93);})[_0x4b34('0x1a')](function(_0x4bfec4){logger[_0x4b34('0x15')]('AddTags',_0x4bfec4[_0x4b34('0x17')],_0x11ae94);_0xae7491(_this['error'](0x1f4,_0x4bfec4[_0x4b34('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index dd4e538..7242fd3 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 _0x562f=['length','chatInteraction:','./chatInteraction.events','save','remove','update','removeListener'];(function(_0x42a0e4,_0x419ccb){var _0x88ecc9=function(_0x542ee9){while(--_0x542ee9){_0x42a0e4['push'](_0x42a0e4['shift']());}};_0x88ecc9(++_0x419ccb);}(_0x562f,0x80));var _0xf562=function(_0x560e64,_0x3b0905){_0x560e64=_0x560e64-0x0;var _0x5a9701=_0x562f[_0x560e64];return _0x5a9701;};'use strict';var ChatInteractionEvents=require(_0xf562('0x0'));var events=[_0xf562('0x1'),_0xf562('0x2'),_0xf562('0x3')];function createListener(_0x202f3d,_0x498061){return function(_0x524c22){_0x498061['emit'](_0x202f3d,_0x524c22);};}function removeListener(_0x2b375b,_0x51b24b){return function(){ChatInteractionEvents[_0xf562('0x4')](_0x2b375b,_0x51b24b);};}exports['register']=function(_0x240e78){for(var _0x21f7aa=0x0,_0x1deb08=events[_0xf562('0x5')];_0x21f7aa<_0x1deb08;_0x21f7aa++){var _0x2507eb=events[_0x21f7aa];var _0x2fff72=createListener(_0xf562('0x6')+_0x2507eb,_0x240e78);ChatInteractionEvents['on'](_0x2507eb,_0x2fff72);}}; \ No newline at end of file +var _0x431b=['emit','removeListener','./chatInteraction.events','save','remove'];(function(_0x291e35,_0x2f7ba9){var _0x5652a1=function(_0x3e1f4f){while(--_0x3e1f4f){_0x291e35['push'](_0x291e35['shift']());}};_0x5652a1(++_0x2f7ba9);}(_0x431b,0x18d));var _0xb431=function(_0x1c4317,_0x5a2d4f){_0x1c4317=_0x1c4317-0x0;var _0x22df22=_0x431b[_0x1c4317];return _0x22df22;};'use strict';var ChatInteractionEvents=require(_0xb431('0x0'));var events=[_0xb431('0x1'),_0xb431('0x2'),'update'];function createListener(_0x4041ca,_0x4504ca){return function(_0x2e4037){_0x4504ca[_0xb431('0x3')](_0x4041ca,_0x2e4037);};}function removeListener(_0x2fe9a1,_0x42dcc1){return function(){ChatInteractionEvents[_0xb431('0x4')](_0x2fe9a1,_0x42dcc1);};}exports['register']=function(_0x2f2e67){for(var _0x542887=0x0,_0x2fefc5=events['length'];_0x542887<_0x2fefc5;_0x542887++){var _0x5151a2=events[_0x542887];var _0x45adf2=createListener('chatInteraction:'+_0x5151a2,_0x2f2e67);ChatInteractionEvents['on'](_0x5151a2,_0x45adf2);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index d8a158e..c9bb537 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 _0x7072=['addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','delete','exports','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','post','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x252179,_0x3f5493){var _0x58525c=function(_0x378b3f){while(--_0x378b3f){_0x252179['push'](_0x252179['shift']());}};_0x58525c(++_0x3f5493);}(_0x7072,0x138));var _0x2707=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x7072[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2707('0x5'));var controller=require('./chatInteraction.controller');router[_0x2707('0x6')]('/',auth[_0x2707('0x7')](),controller[_0x2707('0x8')]);router[_0x2707('0x6')](_0x2707('0x9'),auth[_0x2707('0x7')](),controller[_0x2707('0xa')]);router[_0x2707('0x6')](_0x2707('0xb'),auth[_0x2707('0xc')](),controller['show']);router['get'](_0x2707('0xd'),auth[_0x2707('0xc')](),controller[_0x2707('0xe')]);router[_0x2707('0x6')](_0x2707('0xf'),auth[_0x2707('0x7')](),controller[_0x2707('0x10')]);router[_0x2707('0x6')](_0x2707('0x11'),auth[_0x2707('0xc')](),controller[_0x2707('0x12')]);router[_0x2707('0x6')](_0x2707('0x13'),auth['isAuthenticated'](),controller[_0x2707('0x14')]);router['post']('/',auth[_0x2707('0x7')](),controller[_0x2707('0x15')]);var upload=multer({'storage':multer[_0x2707('0x16')]({'destination':function(_0x3a67f2,_0x13d9ac,_0x4e52a3){_0x4e52a3(null,path[_0x2707('0x17')](config[_0x2707('0x18')],_0x2707('0x19')));},'filename':function(_0x5d523f,_0x1153d7,_0x42f374){_0x42f374(null,util[_0x2707('0x1a')](_0x2707('0x1b'),Date[_0x2707('0x1c')](),_0x1153d7[_0x2707('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2707('0x1e')](_0x2707('0x1f'),upload[_0x2707('0x20')]('file'),controller['attachmentUpload']);router['post'](_0x2707('0xf'),auth[_0x2707('0xc')](),controller[_0x2707('0x21')]);router[_0x2707('0x1e')](_0x2707('0x22'),auth[_0x2707('0x7')](),interaction[_0x2707('0x23')](_0x2707('0x24'),_0x2707('0x25')),controller[_0x2707('0x26')]);router[_0x2707('0x27')](_0x2707('0xb'),auth[_0x2707('0x7')](),interaction[_0x2707('0x23')]('chat',_0x2707('0x28')),controller[_0x2707('0x29')]);router[_0x2707('0x27')](_0x2707('0x2a'),controller[_0x2707('0x2b')]);router[_0x2707('0x27')]('/:id/abandon',auth[_0x2707('0xc')](),controller[_0x2707('0x2c')]);router[_0x2707('0x27')](_0x2707('0x2d'),controller[_0x2707('0x2e')]);router['delete'](_0x2707('0xb'),auth['isAuthenticated'](),interaction[_0x2707('0x23')](_0x2707('0x24'),_0x2707('0x2f')),controller['destroy']);router[_0x2707('0x30')](_0x2707('0x22'),auth[_0x2707('0x7')](),controller['removeTags']);module[_0x2707('0x31')]=router; \ No newline at end of file +var _0xa571=['file','attachmentUpload','/:id/tags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','join','server/files/attachments/','format','%s-%s','originalname','replace','single'];(function(_0x4f669e,_0xdb97f){var _0xa749b9=function(_0x513fae){while(--_0x513fae){_0x4f669e['push'](_0x4f669e['shift']());}};_0xa749b9(++_0xdb97f);}(_0xa571,0x107));var _0x1a57=function(_0x532d17,_0x443104){_0x532d17=_0x532d17-0x0;var _0x46712e=_0xa571[_0x532d17];return _0x46712e;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var auth=require(_0x1a57('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a57('0x6'));router['get']('/',auth[_0x1a57('0x7')](),controller[_0x1a57('0x8')]);router[_0x1a57('0x9')](_0x1a57('0xa'),auth[_0x1a57('0x7')](),controller[_0x1a57('0xb')]);router['get'](_0x1a57('0xc'),auth[_0x1a57('0xd')](),controller[_0x1a57('0xe')]);router['get'](_0x1a57('0xf'),auth[_0x1a57('0xd')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x9')](_0x1a57('0x11'),auth[_0x1a57('0x7')](),controller[_0x1a57('0x12')]);router[_0x1a57('0x9')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x1a57('0x13')]);router[_0x1a57('0x9')](_0x1a57('0x14'),auth['isAuthenticated'](),controller[_0x1a57('0x15')]);router[_0x1a57('0x16')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd08107,_0x17434c,_0x27e824){_0x27e824(null,path[_0x1a57('0x18')](config['root'],_0x1a57('0x19')));},'filename':function(_0x53c61f,_0x49ee05,_0x1b58d7){_0x1b58d7(null,util[_0x1a57('0x1a')](_0x1a57('0x1b'),Date['now'](),_0x49ee05[_0x1a57('0x1c')][_0x1a57('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1a57('0x16')]('/:id/attachment_upload',upload[_0x1a57('0x1e')](_0x1a57('0x1f')),controller[_0x1a57('0x20')]);router[_0x1a57('0x16')](_0x1a57('0x11'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x1a57('0x16')](_0x1a57('0x21'),auth[_0x1a57('0x7')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x1a57('0x22')]);router[_0x1a57('0x23')](_0x1a57('0xc'),auth[_0x1a57('0x7')](),interaction[_0x1a57('0x24')](_0x1a57('0x25'),_0x1a57('0x26')),controller[_0x1a57('0x27')]);router[_0x1a57('0x23')](_0x1a57('0x28'),controller[_0x1a57('0x29')]);router[_0x1a57('0x23')](_0x1a57('0x2a'),auth[_0x1a57('0xd')](),controller[_0x1a57('0x2b')]);router[_0x1a57('0x23')](_0x1a57('0x2c'),controller[_0x1a57('0x2d')]);router[_0x1a57('0x2e')](_0x1a57('0xc'),auth[_0x1a57('0x7')](),interaction[_0x1a57('0x24')]('chat','chatinteraction:destroy'),controller[_0x1a57('0x2f')]);router[_0x1a57('0x2e')]('/:id/tags',auth[_0x1a57('0x7')](),controller['removeTags']);module[_0x1a57('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ad744e0..b0a37aa 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 _0xe785=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x3e9986,_0x4dc6b2){var _0x1eca35=function(_0xeafdd8){while(--_0xeafdd8){_0x3e9986['push'](_0x3e9986['shift']());}};_0x1eca35(++_0x4dc6b2);}(_0xe785,0x128));var _0x5e78=function(_0x1cc7bf,_0x143305){_0x1cc7bf=_0x1cc7bf-0x0;var _0x2ca440=_0xe785[_0x1cc7bf];return _0x2ca440;};'use strict';var Sequelize=require(_0x5e78('0x0'));module[_0x5e78('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5e78('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5e78('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5e78('0x4')]}}; \ No newline at end of file +var _0x4745=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x42c341,_0x31d467){var _0x43621b=function(_0x54be74){while(--_0x54be74){_0x42c341['push'](_0x42c341['shift']());}};_0x43621b(++_0x31d467);}(_0x4745,0x1e7));var _0x5474=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x4745[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x5474('0x0'));module[_0x5474('0x1')]={'body':{'type':Sequelize[_0x5474('0x2')](_0x5474('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5474('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5474('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0036c47..28e05d4 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 _0xa639=['papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','ChatInternalMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','jsforce','querystring'];(function(_0xd9b7e,_0x2626e8){var _0x49386f=function(_0x2a29d4){while(--_0x2a29d4){_0xd9b7e['push'](_0xd9b7e['shift']());}};_0x49386f(++_0x2626e8);}(_0xa639,0x140));var _0x9a63=function(_0xadd386,_0x1fda2a){_0xadd386=_0xadd386-0x0;var _0xb996dd=_0xa639[_0xadd386];return _0xb996dd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9a63('0x0'));var rimraf=require(_0x9a63('0x1'));var zipdir=require(_0x9a63('0x2'));var jsonpatch=require(_0x9a63('0x3'));var rp=require(_0x9a63('0x4'));var moment=require('moment');var BPromise=require(_0x9a63('0x5'));var Mustache=require('mustache');var util=require(_0x9a63('0x6'));var path=require('path');var sox=require(_0x9a63('0x7'));var csv=require(_0x9a63('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9a63('0x9'));var squel=require(_0x9a63('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a63('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9a63('0x8'));var querystring=require(_0x9a63('0xc'));var Papa=require(_0x9a63('0xd'));var authService=require(_0x9a63('0xe'));var hardwareService=require(_0x9a63('0xf'));var Redis=require(_0x9a63('0x10'));var qs=require(_0x9a63('0x11'));var logger=require(_0x9a63('0x12'))('api');var utils=require(_0x9a63('0x13'));var config=require('../../config/environment');var db=require(_0x9a63('0x14'))['db'];config['redis']=_['defaults'](config[_0x9a63('0x15')],{'host':_0x9a63('0x16'),'port':0x18eb});var socket=require(_0x9a63('0x17'))(new Redis(config[_0x9a63('0x15')]));require('./chatInternalMessage.socket')[_0x9a63('0x18')](socket);function respondWithStatusCode(_0x116786,_0x486a5b){_0x486a5b=_0x486a5b||0xcc;return function(_0x2189de){if(_0x2189de){return _0x116786[_0x9a63('0x19')](_0x486a5b);}return _0x116786[_0x9a63('0x1a')](_0x486a5b)[_0x9a63('0x1b')]();};}function respondWithResult(_0x16f835,_0x19af35){_0x19af35=_0x19af35||0xc8;return function(_0x2479e7){if(_0x2479e7){return _0x16f835[_0x9a63('0x1a')](_0x19af35)[_0x9a63('0x1c')](_0x2479e7);}};}function respondWithFilteredResult(_0x83738e,_0x11860a){return function(_0x3d9aeb){if(_0x3d9aeb){var _0x5d9eda=_0x3d9aeb[_0x9a63('0x1d')],_0x7ac2c2=_0x11860a[_0x9a63('0x1e')],_0x13a98e=_0x11860a[_0x9a63('0x1e')]+_0x11860a[_0x9a63('0x1f')],_0x27ca0e;if(_0x13a98e>=_0x5d9eda){_0x13a98e=_0x5d9eda;_0x27ca0e=0xc8;}else{_0x27ca0e=0xce;}_0x83738e['status'](_0x27ca0e);return _0x83738e[_0x9a63('0x20')](_0x9a63('0x21'),_0x7ac2c2+'-'+_0x13a98e+'/'+_0x5d9eda)[_0x9a63('0x1c')](_0x3d9aeb);}return null;};}function patchUpdates(_0xf31ed4){return function(_0x3b8459){try{jsonpatch[_0x9a63('0x22')](_0x3b8459,_0xf31ed4,!![]);}catch(_0x5afa25){return BPromise[_0x9a63('0x23')](_0x5afa25);}return _0x3b8459[_0x9a63('0x24')]();};}function saveUpdates(_0x1dbf11,_0x54226c){return function(_0x435a5c){if(_0x435a5c){return _0x435a5c['update'](_0x1dbf11)[_0x9a63('0x25')](function(_0x2c37e4){return _0x2c37e4;});}return null;};}function removeEntity(_0xb8bd4a,_0x17aabc){return function(_0x4c7a6a){if(_0x4c7a6a){return _0x4c7a6a['destroy']()[_0x9a63('0x25')](function(){_0xb8bd4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c57d9,_0x132dba){return function(_0x47f5fd){if(!_0x47f5fd){_0x3c57d9[_0x9a63('0x19')](0x194);}return _0x47f5fd;};}function handleError(_0x5d2bfe,_0x2c0d8c){_0x2c0d8c=_0x2c0d8c||0x1f4;return function(_0x2f5b22){logger[_0x9a63('0x26')](_0x2f5b22[_0x9a63('0x27')]);if(_0x2f5b22[_0x9a63('0x28')]){delete _0x2f5b22['name'];}_0x5d2bfe[_0x9a63('0x1a')](_0x2c0d8c)[_0x9a63('0x29')](_0x2f5b22);};}exports['index']=function(_0x3d66ab,_0x136a7a){var _0x44a1b2={},_0x478fdc={},_0x26e3da={'count':0x0,'rows':[]};var _0x5ab632=db[_0x9a63('0x2a')][_0x9a63('0x2b')];_0x478fdc[_0x9a63('0x2c')]=_[_0x9a63('0x2d')](_0x5ab632);_0x478fdc[_0x9a63('0x2e')]=_[_0x9a63('0x2d')](_0x3d66ab[_0x9a63('0x2e')]);_0x478fdc[_0x9a63('0x2f')]=_[_0x9a63('0x30')](_0x478fdc[_0x9a63('0x2c')],_0x478fdc['query']);_0x44a1b2[_0x9a63('0x31')]=_['intersection'](_0x478fdc[_0x9a63('0x2c')],qs[_0x9a63('0x32')](_0x3d66ab[_0x9a63('0x2e')][_0x9a63('0x32')]));_0x44a1b2[_0x9a63('0x31')]=_0x44a1b2[_0x9a63('0x31')][_0x9a63('0x33')]?_0x44a1b2[_0x9a63('0x31')]:_0x478fdc[_0x9a63('0x2c')];if(!_0x3d66ab[_0x9a63('0x2e')][_0x9a63('0x34')](_0x9a63('0x35'))){_0x44a1b2[_0x9a63('0x1f')]=qs[_0x9a63('0x1f')](_0x3d66ab['query'][_0x9a63('0x1f')]);_0x44a1b2[_0x9a63('0x1e')]=qs[_0x9a63('0x1e')](_0x3d66ab[_0x9a63('0x2e')][_0x9a63('0x1e')]);}_0x44a1b2[_0x9a63('0x36')]=qs[_0x9a63('0x37')](_0x3d66ab[_0x9a63('0x2e')][_0x9a63('0x37')]);_0x44a1b2[_0x9a63('0x38')]=qs[_0x9a63('0x2f')](_[_0x9a63('0x39')](_0x3d66ab[_0x9a63('0x2e')],_0x478fdc['filters']));if(_0x3d66ab['query'][_0x9a63('0x3a')]){_0x44a1b2[_0x9a63('0x38')]=_['merge'](_0x44a1b2[_0x9a63('0x38')],{'$or':_['map'](_0x5ab632,function(_0x39920a){if(_0x39920a[_0x9a63('0x3b')]['key']!==_0x9a63('0x3c')){var _0x39211a={};_0x39211a[_0x39920a['field']]={'$like':'%'+_0x3d66ab[_0x9a63('0x2e')][_0x9a63('0x3a')]+'%'};return _0x39211a;}})});}_0x44a1b2=_[_0x9a63('0x3d')]({},_0x44a1b2,_0x3d66ab[_0x9a63('0x3e')]);var _0x506774={'where':_0x44a1b2['where']};return db[_0x9a63('0x2a')][_0x9a63('0x1d')](_0x506774)[_0x9a63('0x25')](function(_0x376549){_0x26e3da[_0x9a63('0x1d')]=_0x376549;if(_0x3d66ab[_0x9a63('0x2e')][_0x9a63('0x3f')]){_0x44a1b2[_0x9a63('0x40')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x9a63('0x41')](_0x44a1b2);})['then'](function(_0x4fcd23){_0x26e3da[_0x9a63('0x42')]=_0x4fcd23;return _0x26e3da;})[_0x9a63('0x25')](respondWithFilteredResult(_0x136a7a,_0x44a1b2))[_0x9a63('0x43')](handleError(_0x136a7a,null));};exports[_0x9a63('0x44')]=function(_0x403364,_0x462a0e){var _0x179d4f={'raw':!![],'where':{'id':_0x403364[_0x9a63('0x45')]['id']}},_0x28f3f6={};_0x28f3f6['model']=_[_0x9a63('0x2d')](db[_0x9a63('0x2a')][_0x9a63('0x2b')]);_0x28f3f6['query']=_[_0x9a63('0x2d')](_0x403364[_0x9a63('0x2e')]);_0x28f3f6[_0x9a63('0x2f')]=_['intersection'](_0x28f3f6[_0x9a63('0x2c')],_0x28f3f6[_0x9a63('0x2e')]);_0x179d4f[_0x9a63('0x31')]=_[_0x9a63('0x30')](_0x28f3f6[_0x9a63('0x2c')],qs[_0x9a63('0x32')](_0x403364[_0x9a63('0x2e')][_0x9a63('0x32')]));_0x179d4f[_0x9a63('0x31')]=_0x179d4f[_0x9a63('0x31')][_0x9a63('0x33')]?_0x179d4f[_0x9a63('0x31')]:_0x28f3f6[_0x9a63('0x2c')];if(_0x403364[_0x9a63('0x2e')][_0x9a63('0x3f')]){_0x179d4f[_0x9a63('0x40')]=[{'all':!![]}];}_0x179d4f=_[_0x9a63('0x3d')]({},_0x179d4f,_0x403364[_0x9a63('0x3e')]);return db['ChatInternalMessage'][_0x9a63('0x46')](_0x179d4f)[_0x9a63('0x25')](handleEntityNotFound(_0x462a0e,null))[_0x9a63('0x25')](respondWithResult(_0x462a0e,null))['catch'](handleError(_0x462a0e,null));};exports['create']=function(_0xe6b835,_0x9f210a){return db[_0x9a63('0x2a')][_0x9a63('0x47')](_0xe6b835[_0x9a63('0x48')],{})[_0x9a63('0x25')](respondWithResult(_0x9f210a,0xc9))[_0x9a63('0x43')](handleError(_0x9f210a,null));};exports[_0x9a63('0x49')]=function(_0x484d44,_0x4ac4b3){if(_0x484d44[_0x9a63('0x48')]['id']){delete _0x484d44[_0x9a63('0x48')]['id'];}return db[_0x9a63('0x2a')][_0x9a63('0x46')]({'where':{'id':_0x484d44[_0x9a63('0x45')]['id']}})[_0x9a63('0x25')](handleEntityNotFound(_0x4ac4b3,null))[_0x9a63('0x25')](saveUpdates(_0x484d44['body'],null))[_0x9a63('0x25')](respondWithResult(_0x4ac4b3,null))[_0x9a63('0x43')](handleError(_0x4ac4b3,null));};exports[_0x9a63('0x4a')]=function(_0x460e0e,_0x425650){return db[_0x9a63('0x2a')]['find']({'where':{'id':_0x460e0e[_0x9a63('0x45')]['id']}})[_0x9a63('0x25')](handleEntityNotFound(_0x425650,null))[_0x9a63('0x25')](removeEntity(_0x425650,null))[_0x9a63('0x43')](handleError(_0x425650,null));};exports[_0x9a63('0x4b')]=function(_0x502bbf,_0x2788d3){return db['ChatInternalMessage'][_0x9a63('0x4b')]()[_0x9a63('0x25')](respondWithResult(_0x2788d3,null))['catch'](handleError(_0x2788d3,null));};function wrapUser(_0x287bbe){return function(_0x2b9124){var _0x3275b0=_0x287bbe[_0x9a63('0x4c')]({'plain':!![]});_0x3275b0[_0x9a63('0x4d')]=[];if(_0x2b9124){_0x3275b0[_0x9a63('0x4e')]=_0x2b9124[_0x9a63('0x4f')];_0x3275b0[_0x9a63('0x50')]=_0x2b9124;}else{_0x3275b0[_0x9a63('0x4e')]=moment(0x0)[_0x9a63('0x51')](_0x9a63('0x52'));_0x3275b0['lastMessage']={};}return _0x3275b0;};}exports[_0x9a63('0x53')]=function(_0x1458df,_0x27c0a5,_0x48b2a7){var _0x2cd398=[];return db[_0x9a63('0x54')][_0x9a63('0x41')]({'where':{'role':[_0x9a63('0x55'),_0x9a63('0x56'),'user']},'attributes':['id',_0x9a63('0x57'),_0x9a63('0x28'),_0x9a63('0x58'),_0x9a63('0x59'),_0x9a63('0x5a'),_0x9a63('0x5b'),_0x9a63('0x5c'),_0x9a63('0x5d'),_0x9a63('0x5e')],'order':qs[_0x9a63('0x37')](_0x9a63('0x5f')),'include':[{'model':db[_0x9a63('0x60')],'as':_0x9a63('0x61'),'attributes':['id',_0x9a63('0x28'),'type'],'through':{'attributes':[]}}]})[_0x9a63('0x25')](function(_0x265034){if(_0x265034){var _0x237025=_0x1458df['user'][_0x9a63('0x4c')]({'plain':!![]});if(!_0x237025)throw new Error(_0x9a63('0x62'));if(_0x237025[_0x9a63('0x58')]===_0x9a63('0x63')){return db[_0x9a63('0x64')][_0x9a63('0x46')]({'where':{'name':_0x9a63('0x65'),'userProfileId':_0x237025[_0x9a63('0x66')]},'raw':!![]})[_0x9a63('0x25')](function(_0x54e579){if(_0x54e579){if(_0x54e579[_0x9a63('0x67')]===0x0){return db[_0x9a63('0x68')]['findAll']({'where':{'sectionId':_0x54e579['id']},'raw':!![]})['then'](function(_0x3fb32e){var _0x374a34=[];if(_[_0x9a63('0x69')](_0x3fb32e)){_0x374a34=_['filter'](_0x265034,function(_0x1b2e4d){if(_0x1b2e4d['role']!=='agent'){return _0x1b2e4d;}});return _0x374a34;}else{for(var _0x2f09e0=0x0;_0x2f09e0<_0x265034[_0x9a63('0x33')];_0x2f09e0++){var _0x9d04de=_0x265034[_0x2f09e0];if(_0x9d04de[_0x9a63('0x58')]===_0x9a63('0x55')){var _0x199a7e=_[_0x9a63('0x46')](_0x3fb32e,function(_0x205ac7){return _0x205ac7['resourceId']===_0x9d04de['id'];});if(_0x199a7e)_0x374a34[_0x9a63('0x6a')](_0x9d04de);}else{_0x374a34[_0x9a63('0x6a')](_0x9d04de);}}return _0x374a34;}});}else{return _0x265034;}}else{var _0x2bd2b6=_[_0x9a63('0x3a')](_0x265034,function(_0x6d118a){if(_0x6d118a[_0x9a63('0x58')]!==_0x9a63('0x55')){return _0x6d118a;}});return _0x2bd2b6;}});}else{return _0x265034;}}})[_0x9a63('0x25')](function(_0x3f72c7){var _0x1d774f=[];if(_0x3f72c7){_0x2cd398=_0x3f72c7;for(var _0x47fb34=0x0;_0x47fb34<_0x3f72c7['length'];_0x47fb34+=0x1){_0x2cd398[_0x47fb34][_0x9a63('0x4d')]=[];_0x1d774f[_0x9a63('0x6a')](db[_0x9a63('0x2a')]['find']({'where':{'FromId':[_0x1458df[_0x9a63('0x63')]['id'],_0x3f72c7[_0x47fb34]['id']],'ToId':[_0x1458df['user']['id'],_0x3f72c7[_0x47fb34]['id']],'ChatGroupId':null},'attributes':['id',_0x9a63('0x4f'),'FromId',_0x9a63('0x6b'),_0x9a63('0x6c'),_0x9a63('0x48')],'order':qs[_0x9a63('0x37')](_0x9a63('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3f72c7[_0x47fb34])));}return BPromise[_0x9a63('0x6e')](_0x1d774f);}return[];})[_0x9a63('0x25')](function(_0x36a9f6){return{'rows':_0x36a9f6,'count':_0x36a9f6['length']};})[_0x9a63('0x25')](respondWithResult(_0x27c0a5,null))[_0x9a63('0x43')](handleError(_0x27c0a5,null));}; \ No newline at end of file +var _0x27c5=['stack','name','send','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','offset','sort','where','merge','type','key','VIRTUAL','field','filter','options','ChatInternalMessage','include','findAll','rows','params','find','catch','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','internal','online','allowmessenger','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','isEmpty','resourceId','push','FromId','ToId','read','all','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','end','status','json','count','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x27c5,0x173));var _0x527c=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x27c5[_0x59d89e];return _0x554e93;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x527c('0x0'));var zipdir=require(_0x527c('0x1'));var jsonpatch=require(_0x527c('0x2'));var rp=require('request-promise');var moment=require(_0x527c('0x3'));var BPromise=require(_0x527c('0x4'));var Mustache=require(_0x527c('0x5'));var util=require(_0x527c('0x6'));var path=require(_0x527c('0x7'));var sox=require(_0x527c('0x8'));var csv=require(_0x527c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x527c('0xa'));var squel=require('squel');var crypto=require(_0x527c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x527c('0xc'));var toCsv=require(_0x527c('0x9'));var querystring=require(_0x527c('0xd'));var Papa=require('papaparse');var authService=require(_0x527c('0xe'));var hardwareService=require(_0x527c('0xf'));var Redis=require(_0x527c('0x10'));var qs=require(_0x527c('0x11'));var logger=require(_0x527c('0x12'))(_0x527c('0x13'));var utils=require(_0x527c('0x14'));var config=require(_0x527c('0x15'));var db=require(_0x527c('0x16'))['db'];config[_0x527c('0x17')]=_[_0x527c('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x527c('0x19'))(new Redis(config[_0x527c('0x17')]));require(_0x527c('0x1a'))[_0x527c('0x1b')](socket);function respondWithStatusCode(_0x546477,_0x416ed8){_0x416ed8=_0x416ed8||0xcc;return function(_0xf7c373){if(_0xf7c373){return _0x546477['sendStatus'](_0x416ed8);}return _0x546477['status'](_0x416ed8)[_0x527c('0x1c')]();};}function respondWithResult(_0x5eb87f,_0x4ac67f){_0x4ac67f=_0x4ac67f||0xc8;return function(_0x1eef2b){if(_0x1eef2b){return _0x5eb87f[_0x527c('0x1d')](_0x4ac67f)[_0x527c('0x1e')](_0x1eef2b);}};}function respondWithFilteredResult(_0x5e987c,_0x3208ec){return function(_0x1f2702){if(_0x1f2702){var _0x576197=_0x1f2702[_0x527c('0x1f')],_0x37894e=_0x3208ec['offset'],_0x478d6e=_0x3208ec['offset']+_0x3208ec[_0x527c('0x20')],_0x117dae;if(_0x478d6e>=_0x576197){_0x478d6e=_0x576197;_0x117dae=0xc8;}else{_0x117dae=0xce;}_0x5e987c[_0x527c('0x1d')](_0x117dae);return _0x5e987c[_0x527c('0x21')](_0x527c('0x22'),_0x37894e+'-'+_0x478d6e+'/'+_0x576197)['json'](_0x1f2702);}return null;};}function patchUpdates(_0x107430){return function(_0x526b03){try{jsonpatch[_0x527c('0x23')](_0x526b03,_0x107430,!![]);}catch(_0x56a42d){return BPromise[_0x527c('0x24')](_0x56a42d);}return _0x526b03['save']();};}function saveUpdates(_0x44c231,_0x31a2f8){return function(_0x37e0be){if(_0x37e0be){return _0x37e0be['update'](_0x44c231)[_0x527c('0x25')](function(_0x4809b5){return _0x4809b5;});}return null;};}function removeEntity(_0x176e11,_0x9f14f9){return function(_0x129635){if(_0x129635){return _0x129635[_0x527c('0x26')]()[_0x527c('0x25')](function(){_0x176e11[_0x527c('0x1d')](0xcc)[_0x527c('0x1c')]();});}};}function handleEntityNotFound(_0x175909,_0x5f354f){return function(_0x432f31){if(!_0x432f31){_0x175909[_0x527c('0x27')](0x194);}return _0x432f31;};}function handleError(_0x4c0ae5,_0x112f47){_0x112f47=_0x112f47||0x1f4;return function(_0x497ae4){logger[_0x527c('0x28')](_0x497ae4[_0x527c('0x29')]);if(_0x497ae4[_0x527c('0x2a')]){delete _0x497ae4['name'];}_0x4c0ae5['status'](_0x112f47)[_0x527c('0x2b')](_0x497ae4);};}exports['index']=function(_0x296689,_0x37e04f){var _0x223fd5={},_0x4c39ef={},_0x46ffef={'count':0x0,'rows':[]};var _0x1bafe9=db['ChatInternalMessage'][_0x527c('0x2c')];_0x4c39ef['model']=_[_0x527c('0x2d')](_0x1bafe9);_0x4c39ef[_0x527c('0x2e')]=_['keys'](_0x296689['query']);_0x4c39ef[_0x527c('0x2f')]=_[_0x527c('0x30')](_0x4c39ef[_0x527c('0x31')],_0x4c39ef[_0x527c('0x2e')]);_0x223fd5['attributes']=_[_0x527c('0x30')](_0x4c39ef['model'],qs[_0x527c('0x32')](_0x296689[_0x527c('0x2e')][_0x527c('0x32')]));_0x223fd5[_0x527c('0x33')]=_0x223fd5[_0x527c('0x33')][_0x527c('0x34')]?_0x223fd5[_0x527c('0x33')]:_0x4c39ef[_0x527c('0x31')];if(!_0x296689[_0x527c('0x2e')]['hasOwnProperty'](_0x527c('0x35'))){_0x223fd5['limit']=qs['limit'](_0x296689[_0x527c('0x2e')][_0x527c('0x20')]);_0x223fd5[_0x527c('0x36')]=qs['offset'](_0x296689[_0x527c('0x2e')][_0x527c('0x36')]);}_0x223fd5['order']=qs['sort'](_0x296689[_0x527c('0x2e')][_0x527c('0x37')]);_0x223fd5[_0x527c('0x38')]=qs['filters'](_['pick'](_0x296689[_0x527c('0x2e')],_0x4c39ef[_0x527c('0x2f')]));if(_0x296689['query']['filter']){_0x223fd5[_0x527c('0x38')]=_[_0x527c('0x39')](_0x223fd5[_0x527c('0x38')],{'$or':_['map'](_0x1bafe9,function(_0x1e2007){if(_0x1e2007[_0x527c('0x3a')][_0x527c('0x3b')]!==_0x527c('0x3c')){var _0x10b718={};_0x10b718[_0x1e2007[_0x527c('0x3d')]]={'$like':'%'+_0x296689[_0x527c('0x2e')][_0x527c('0x3e')]+'%'};return _0x10b718;}})});}_0x223fd5=_[_0x527c('0x39')]({},_0x223fd5,_0x296689[_0x527c('0x3f')]);var _0x4f95ca={'where':_0x223fd5[_0x527c('0x38')]};return db[_0x527c('0x40')][_0x527c('0x1f')](_0x4f95ca)['then'](function(_0x111cde){_0x46ffef[_0x527c('0x1f')]=_0x111cde;if(_0x296689[_0x527c('0x2e')]['includeAll']){_0x223fd5[_0x527c('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x527c('0x42')](_0x223fd5);})[_0x527c('0x25')](function(_0x55feb4){_0x46ffef[_0x527c('0x43')]=_0x55feb4;return _0x46ffef;})['then'](respondWithFilteredResult(_0x37e04f,_0x223fd5))['catch'](handleError(_0x37e04f,null));};exports['show']=function(_0x32ac87,_0x20a352){var _0x588f45={'raw':!![],'where':{'id':_0x32ac87[_0x527c('0x44')]['id']}},_0x34aeaf={};_0x34aeaf[_0x527c('0x31')]=_[_0x527c('0x2d')](db[_0x527c('0x40')][_0x527c('0x2c')]);_0x34aeaf[_0x527c('0x2e')]=_['keys'](_0x32ac87[_0x527c('0x2e')]);_0x34aeaf[_0x527c('0x2f')]=_[_0x527c('0x30')](_0x34aeaf[_0x527c('0x31')],_0x34aeaf[_0x527c('0x2e')]);_0x588f45[_0x527c('0x33')]=_[_0x527c('0x30')](_0x34aeaf[_0x527c('0x31')],qs[_0x527c('0x32')](_0x32ac87[_0x527c('0x2e')][_0x527c('0x32')]));_0x588f45['attributes']=_0x588f45['attributes']['length']?_0x588f45[_0x527c('0x33')]:_0x34aeaf[_0x527c('0x31')];if(_0x32ac87['query']['includeAll']){_0x588f45['include']=[{'all':!![]}];}_0x588f45=_['merge']({},_0x588f45,_0x32ac87['options']);return db['ChatInternalMessage'][_0x527c('0x45')](_0x588f45)[_0x527c('0x25')](handleEntityNotFound(_0x20a352,null))[_0x527c('0x25')](respondWithResult(_0x20a352,null))[_0x527c('0x46')](handleError(_0x20a352,null));};exports['create']=function(_0x3b75a3,_0x4ac33){return db[_0x527c('0x40')][_0x527c('0x47')](_0x3b75a3[_0x527c('0x48')],{})[_0x527c('0x25')](respondWithResult(_0x4ac33,0xc9))['catch'](handleError(_0x4ac33,null));};exports['update']=function(_0x2a50e9,_0x7e1d8a){if(_0x2a50e9[_0x527c('0x48')]['id']){delete _0x2a50e9['body']['id'];}return db[_0x527c('0x40')]['find']({'where':{'id':_0x2a50e9['params']['id']}})['then'](handleEntityNotFound(_0x7e1d8a,null))[_0x527c('0x25')](saveUpdates(_0x2a50e9['body'],null))[_0x527c('0x25')](respondWithResult(_0x7e1d8a,null))['catch'](handleError(_0x7e1d8a,null));};exports[_0x527c('0x26')]=function(_0x1e4243,_0x54ad19){return db['ChatInternalMessage']['find']({'where':{'id':_0x1e4243[_0x527c('0x44')]['id']}})[_0x527c('0x25')](handleEntityNotFound(_0x54ad19,null))[_0x527c('0x25')](removeEntity(_0x54ad19,null))[_0x527c('0x46')](handleError(_0x54ad19,null));};exports['describe']=function(_0x59a191,_0x397a01){return db[_0x527c('0x40')][_0x527c('0x49')]()[_0x527c('0x25')](respondWithResult(_0x397a01,null))['catch'](handleError(_0x397a01,null));};function wrapUser(_0xa7d524){return function(_0x2d56e9){var _0x303ab2=_0xa7d524['get']({'plain':!![]});_0x303ab2[_0x527c('0x4a')]=[];if(_0x2d56e9){_0x303ab2[_0x527c('0x4b')]=_0x2d56e9[_0x527c('0x4c')];_0x303ab2[_0x527c('0x4d')]=_0x2d56e9;}else{_0x303ab2[_0x527c('0x4b')]=moment(0x0)[_0x527c('0x4e')](_0x527c('0x4f'));_0x303ab2[_0x527c('0x4d')]={};}return _0x303ab2;};}exports['getUsers']=function(_0x57d8a0,_0x1aadec,_0x3240bd){var _0x4304ac=[];return db[_0x527c('0x50')][_0x527c('0x42')]({'where':{'role':[_0x527c('0x51'),_0x527c('0x52'),_0x527c('0x53')]},'attributes':['id',_0x527c('0x54'),_0x527c('0x2a'),_0x527c('0x55'),'userpic',_0x527c('0x56'),_0x527c('0x57'),'lastLoginAt',_0x527c('0x58'),'showWebBar'],'order':qs[_0x527c('0x37')]('-online'),'include':[{'model':db[_0x527c('0x59')],'as':_0x527c('0x5a'),'attributes':['id',_0x527c('0x2a'),_0x527c('0x3a')],'through':{'attributes':[]}}]})[_0x527c('0x25')](function(_0x3aa229){if(_0x3aa229){var _0x621eef=_0x57d8a0[_0x527c('0x53')][_0x527c('0x5b')]({'plain':!![]});if(!_0x621eef)throw new Error(_0x527c('0x5c'));if(_0x621eef[_0x527c('0x55')]===_0x527c('0x53')){return db[_0x527c('0x5d')]['find']({'where':{'name':_0x527c('0x5e'),'userProfileId':_0x621eef[_0x527c('0x5f')]},'raw':!![]})[_0x527c('0x25')](function(_0x3658b0){if(_0x3658b0){if(_0x3658b0['autoAssociation']===0x0){return db['UserProfileResource'][_0x527c('0x42')]({'where':{'sectionId':_0x3658b0['id']},'raw':!![]})['then'](function(_0x3d6e92){var _0x407b87=[];if(_[_0x527c('0x60')](_0x3d6e92)){_0x407b87=_[_0x527c('0x3e')](_0x3aa229,function(_0x8fcf3d){if(_0x8fcf3d['role']!=='agent'){return _0x8fcf3d;}});return _0x407b87;}else{for(var _0x354c64=0x0;_0x354c64<_0x3aa229['length'];_0x354c64++){var _0x1781fe=_0x3aa229[_0x354c64];if(_0x1781fe[_0x527c('0x55')]==='agent'){var _0x2b11d0=_[_0x527c('0x45')](_0x3d6e92,function(_0x59b6f6){return _0x59b6f6[_0x527c('0x61')]===_0x1781fe['id'];});if(_0x2b11d0)_0x407b87[_0x527c('0x62')](_0x1781fe);}else{_0x407b87[_0x527c('0x62')](_0x1781fe);}}return _0x407b87;}});}else{return _0x3aa229;}}else{var _0x593dc8=_[_0x527c('0x3e')](_0x3aa229,function(_0x103922){if(_0x103922[_0x527c('0x55')]!==_0x527c('0x51')){return _0x103922;}});return _0x593dc8;}});}else{return _0x3aa229;}}})['then'](function(_0x44e37a){var _0x399289=[];if(_0x44e37a){_0x4304ac=_0x44e37a;for(var _0x46227f=0x0;_0x46227f<_0x44e37a[_0x527c('0x34')];_0x46227f+=0x1){_0x4304ac[_0x46227f][_0x527c('0x4a')]=[];_0x399289[_0x527c('0x62')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x57d8a0['user']['id'],_0x44e37a[_0x46227f]['id']],'ToId':[_0x57d8a0['user']['id'],_0x44e37a[_0x46227f]['id']],'ChatGroupId':null},'attributes':['id',_0x527c('0x4c'),_0x527c('0x63'),_0x527c('0x64'),_0x527c('0x65'),_0x527c('0x48')],'order':qs[_0x527c('0x37')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x527c('0x25')](wrapUser(_0x44e37a[_0x46227f])));}return BPromise[_0x527c('0x66')](_0x399289);}return[];})[_0x527c('0x25')](function(_0x20a2c7){return{'rows':_0x20a2c7,'count':_0x20a2c7[_0x527c('0x34')]};})[_0x527c('0x25')](respondWithResult(_0x1aadec,null))[_0x527c('0x46')](handleError(_0x1aadec,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 29be498..7f2179f 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 _0xab43=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2f4f99,_0x58a215){var _0x492242=function(_0x58f633){while(--_0x58f633){_0x2f4f99['push'](_0x2f4f99['shift']());}};_0x492242(++_0x58a215);}(_0xab43,0x10f));var _0x3ab4=function(_0x4b44b0,_0x5c1093){_0x4b44b0=_0x4b44b0-0x0;var _0x3ef9fa=_0xab43[_0x4b44b0];return _0x3ef9fa;};'use strict';var EventEmitter=require(_0x3ab4('0x0'));var ChatInternalMessage=require(_0x3ab4('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3ab4('0x2')](0x0);var events={'afterCreate':_0x3ab4('0x3'),'afterUpdate':_0x3ab4('0x4'),'afterDestroy':_0x3ab4('0x5')};function emitEvent(_0x4a3834){return function(_0x3e57a5,_0x3e1005,_0x338fca){ChatInternalMessageEvents[_0x3ab4('0x6')](_0x4a3834+':'+_0x3e57a5['id'],_0x3e57a5);ChatInternalMessageEvents[_0x3ab4('0x6')](_0x4a3834,_0x3e57a5);_0x338fca(null);};}for(var e in events){if(events[_0x3ab4('0x7')](e)){var event=events[e];ChatInternalMessage[_0x3ab4('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x89b4=['setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x16a4b8,_0x250c37){var _0x306435=function(_0x86d916){while(--_0x86d916){_0x16a4b8['push'](_0x16a4b8['shift']());}};_0x306435(++_0x250c37);}(_0x89b4,0x147));var _0x489b=function(_0x2d7fe9,_0x48474c){_0x2d7fe9=_0x2d7fe9-0x0;var _0x57e9d5=_0x89b4[_0x2d7fe9];return _0x57e9d5;};'use strict';var EventEmitter=require(_0x489b('0x0'));var ChatInternalMessage=require(_0x489b('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x489b('0x2')](0x0);var events={'afterCreate':_0x489b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26d9a6){return function(_0x2a640a,_0x38f15b,_0xf46000){ChatInternalMessageEvents[_0x489b('0x4')](_0x26d9a6+':'+_0x2a640a['id'],_0x2a640a);ChatInternalMessageEvents['emit'](_0x26d9a6,_0x2a640a);_0xf46000(null);};}for(var e in events){if(events[_0x489b('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x489b('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 3112bef..94fd558 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 _0x0078=['request-promise','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x9809bb,_0x133edb){var _0x3d7f24=function(_0x2ce486){while(--_0x2ce486){_0x9809bb['push'](_0x9809bb['shift']());}};_0x3d7f24(++_0x133edb);}(_0x0078,0xf7));var _0x8007=function(_0x35d45f,_0x567567){_0x35d45f=_0x35d45f-0x0;var _0x1378e9=_0x0078[_0x35d45f];return _0x1378e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8007('0x0'));var moment=require(_0x8007('0x1'));var BPromise=require(_0x8007('0x2'));var rp=require(_0x8007('0x3'));var attributes=require(_0x8007('0x4'));module[_0x8007('0x5')]=function(_0x35f6a4,_0x28f81d){return _0x35f6a4['define'](_0x8007('0x6'),attributes,{'tableName':_0x8007('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8007('0x8'),'collate':_0x8007('0x9')});}; \ No newline at end of file +var _0x7f3c=['lodash','api','moment','bluebird','request-promise','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f3c,0x155));var _0xc7f3=function(_0x52e0da,_0x46546d){_0x52e0da=_0x52e0da-0x0;var _0x3490ec=_0x7f3c[_0x52e0da];return _0x3490ec;};'use strict';var _=require(_0xc7f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc7f3('0x1'));var moment=require(_0xc7f3('0x2'));var BPromise=require(_0xc7f3('0x3'));var rp=require(_0xc7f3('0x4'));var attributes=require('./chatInternalMessage.attributes');module[_0xc7f3('0x5')]=function(_0x2e1484,_0xdb8637){return _0x2e1484[_0xc7f3('0x6')](_0xc7f3('0x7'),attributes,{'tableName':_0xc7f3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc7f3('0x9'),'collate':_0xc7f3('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 4667dfd..b3aaf04 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 _0xd765=['then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x3c2b07,_0x1c2f21){var _0x5b18ec=function(_0x3459e0){while(--_0x3459e0){_0x3c2b07['push'](_0x3c2b07['shift']());}};_0x5b18ec(++_0x1c2f21);}(_0xd765,0x167));var _0x5d76=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd765[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var moment=require(_0x5d76('0x2'));var BPromise=require(_0x5d76('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d76('0x4'));var db=require(_0x5d76('0x5'))['db'];var utils=require(_0x5d76('0x6'));var logger=require(_0x5d76('0x7'))(_0x5d76('0x8'));var config=require(_0x5d76('0x9'));var jayson=require(_0x5d76('0xa'));var client=jayson['client'][_0x5d76('0xb')]({'port':0x232a});config[_0x5d76('0xc')]=_['defaults'](config[_0x5d76('0xc')],{'host':_0x5d76('0xd'),'port':0x18eb});var socket=require(_0x5d76('0xe'))(new Redis(config[_0x5d76('0xc')]));require(_0x5d76('0xf'))[_0x5d76('0x10')](socket);function respondWithRpcPromise(_0x3c8fee,_0x543a9b,_0x925056){return new BPromise(function(_0x288ea7,_0x37854a){return client[_0x5d76('0x11')](_0x3c8fee,_0x925056)[_0x5d76('0x12')](function(_0x3cdfd8){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x543a9b,_0x5d76('0x13'));logger[_0x5d76('0x14')](_0x5d76('0x15'),_0x543a9b,_0x5d76('0x13'),JSON[_0x5d76('0x16')](_0x3cdfd8));if(_0x3cdfd8[_0x5d76('0x17')]){if(_0x3cdfd8[_0x5d76('0x17')][_0x5d76('0x18')]===0x1f4){logger[_0x5d76('0x17')](_0x5d76('0x19'),_0x543a9b,_0x3cdfd8['error']['message']);return _0x37854a(_0x3cdfd8['error'][_0x5d76('0x1a')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x543a9b,_0x3cdfd8[_0x5d76('0x17')]['message']);return _0x288ea7(_0x3cdfd8[_0x5d76('0x17')][_0x5d76('0x1a')]);}else{logger['info'](_0x5d76('0x19'),_0x543a9b,_0x5d76('0x13'));_0x288ea7(_0x3cdfd8[_0x5d76('0x1b')][_0x5d76('0x1a')]);}})[_0x5d76('0x1c')](function(_0x5546a5){logger[_0x5d76('0x17')](_0x5d76('0x19'),_0x543a9b,_0x5546a5);_0x37854a(_0x5546a5);});});} \ No newline at end of file +var _0x9b86=['message','ChatInternalMessage,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','request\x20sent','stringify','error','code'];(function(_0x30225a,_0x233ad6){var _0x3551ef=function(_0x1a32d5){while(--_0x1a32d5){_0x30225a['push'](_0x30225a['shift']());}};_0x3551ef(++_0x233ad6);}(_0x9b86,0x171));var _0x69b8=function(_0x5f1c13,_0xc8b43d){_0x5f1c13=_0x5f1c13-0x0;var _0x398676=_0x9b86[_0x5f1c13];return _0x398676;};'use strict';var _=require(_0x69b8('0x0'));var util=require(_0x69b8('0x1'));var moment=require(_0x69b8('0x2'));var BPromise=require('bluebird');var rs=require(_0x69b8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69b8('0x4'))['db'];var utils=require(_0x69b8('0x5'));var logger=require(_0x69b8('0x6'))(_0x69b8('0x7'));var config=require(_0x69b8('0x8'));var jayson=require(_0x69b8('0x9'));var client=jayson[_0x69b8('0xa')][_0x69b8('0xb')]({'port':0x232a});config['redis']=_[_0x69b8('0xc')](config[_0x69b8('0xd')],{'host':_0x69b8('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x69b8('0xf'))[_0x69b8('0x10')](socket);function respondWithRpcPromise(_0x5c345d,_0x30f698,_0x44098b){return new BPromise(function(_0x5ddba4,_0x376b28){return client[_0x69b8('0x11')](_0x5c345d,_0x44098b)[_0x69b8('0x12')](function(_0x1792ff){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x30f698,'request\x20sent');logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x30f698,_0x69b8('0x13'),JSON[_0x69b8('0x14')](_0x1792ff));if(_0x1792ff[_0x69b8('0x15')]){if(_0x1792ff['error'][_0x69b8('0x16')]===0x1f4){logger[_0x69b8('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x30f698,_0x1792ff[_0x69b8('0x15')][_0x69b8('0x17')]);return _0x376b28(_0x1792ff[_0x69b8('0x15')][_0x69b8('0x17')]);}logger[_0x69b8('0x15')](_0x69b8('0x18'),_0x30f698,_0x1792ff['error'][_0x69b8('0x17')]);return _0x5ddba4(_0x1792ff[_0x69b8('0x15')]['message']);}else{logger[_0x69b8('0x19')](_0x69b8('0x18'),_0x30f698,_0x69b8('0x13'));_0x5ddba4(_0x1792ff[_0x69b8('0x1a')]['message']);}})[_0x69b8('0x1b')](function(_0xd252d9){logger[_0x69b8('0x15')](_0x69b8('0x18'),_0x30f698,_0xd252d9);_0x376b28(_0xd252d9);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index cf34561..f0d2ead 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 _0x882a=['length','chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register'];(function(_0x4a7926,_0x58e1de){var _0x598e78=function(_0x1e4774){while(--_0x1e4774){_0x4a7926['push'](_0x4a7926['shift']());}};_0x598e78(++_0x58e1de);}(_0x882a,0x1de));var _0xa882=function(_0x317e70,_0x3461a5){_0x317e70=_0x317e70-0x0;var _0x3bbb21=_0x882a[_0x317e70];return _0x3bbb21;};'use strict';var ChatInternalMessageEvents=require(_0xa882('0x0'));var events=[_0xa882('0x1'),'remove','update'];function createListener(_0x1ddd80,_0x4a6f33){return function(_0x182e0b){_0x4a6f33[_0xa882('0x2')](_0x1ddd80,_0x182e0b);};}function removeListener(_0x48c861,_0x2bdf2a){return function(){ChatInternalMessageEvents[_0xa882('0x3')](_0x48c861,_0x2bdf2a);};}exports[_0xa882('0x4')]=function(_0x24938b){for(var _0x5ce870=0x0,_0x14d622=events[_0xa882('0x5')];_0x5ce870<_0x14d622;_0x5ce870++){var _0x20e921=events[_0x5ce870];var _0x2c192f=createListener(_0xa882('0x6')+_0x20e921,_0x24938b);ChatInternalMessageEvents['on'](_0x20e921,_0x2c192f);}}; \ No newline at end of file +var _0x8b6c=['./chatInternalMessage.events','save','remove','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x59d5e7,_0x4e9630){var _0x362739=function(_0x5d6eee){while(--_0x5d6eee){_0x59d5e7['push'](_0x59d5e7['shift']());}};_0x362739(++_0x4e9630);}(_0x8b6c,0x80));var _0xc8b6=function(_0x19f121,_0x4f5a68){_0x19f121=_0x19f121-0x0;var _0xab204e=_0x8b6c[_0x19f121];return _0xab204e;};'use strict';var ChatInternalMessageEvents=require(_0xc8b6('0x0'));var events=[_0xc8b6('0x1'),_0xc8b6('0x2'),'update'];function createListener(_0x2cccb6,_0x41e392){return function(_0x5d2735){_0x41e392[_0xc8b6('0x3')](_0x2cccb6,_0x5d2735);};}function removeListener(_0x56b280,_0x5dc1f2){return function(){ChatInternalMessageEvents[_0xc8b6('0x4')](_0x56b280,_0x5dc1f2);};}exports[_0xc8b6('0x5')]=function(_0x32ecef){for(var _0x496d18=0x0,_0x21af0a=events[_0xc8b6('0x6')];_0x496d18<_0x21af0a;_0x496d18++){var _0x323c57=events[_0x496d18];var _0x23a603=createListener(_0xc8b6('0x7')+_0x323c57,_0x32ecef);ChatInternalMessageEvents['on'](_0x323c57,_0x23a603);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index cc8bd61..b34a449 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 _0x71c3=['index','/describe','isAuthenticated','describe','/users','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x1444dd,_0x4494de){var _0x37035d=function(_0x15c2ae){while(--_0x15c2ae){_0x1444dd['push'](_0x1444dd['shift']());}};_0x37035d(++_0x4494de);}(_0x71c3,0xc6));var _0x371c=function(_0x9259e2,_0x5a79e8){_0x9259e2=_0x9259e2-0x0;var _0x4de1db=_0x71c3[_0x9259e2];return _0x4de1db;};'use strict';var multer=require(_0x371c('0x0'));var util=require(_0x371c('0x1'));var path=require('path');var timeout=require(_0x371c('0x2'));var express=require(_0x371c('0x3'));var router=express[_0x371c('0x4')]();var auth=require(_0x371c('0x5'));var interaction=require(_0x371c('0x6'));var config=require(_0x371c('0x7'));var controller=require(_0x371c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x371c('0x9')]);router['get'](_0x371c('0xa'),auth[_0x371c('0xb')](),controller[_0x371c('0xc')]);router['get'](_0x371c('0xd'),auth['isAuthenticated'](),controller['getUsers']);router[_0x371c('0xe')](_0x371c('0xf'),auth[_0x371c('0xb')](),controller[_0x371c('0x10')]);router[_0x371c('0x11')]('/',auth[_0x371c('0xb')](),controller[_0x371c('0x12')]);router[_0x371c('0x13')](_0x371c('0xf'),controller['update']);router[_0x371c('0x14')](_0x371c('0xf'),auth[_0x371c('0xb')](),controller[_0x371c('0x15')]);module[_0x371c('0x16')]=router; \ No newline at end of file +var _0x1fa9=['/:id','show','create','put','update','delete','multer','path','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers'];(function(_0x48d15d,_0x1617e1){var _0x6b2afd=function(_0xd7efc8){while(--_0xd7efc8){_0x48d15d['push'](_0x48d15d['shift']());}};_0x6b2afd(++_0x1617e1);}(_0x1fa9,0x136));var _0x91fa=function(_0x269063,_0x5a5e39){_0x269063=_0x269063-0x0;var _0x266340=_0x1fa9[_0x269063];return _0x266340;};'use strict';var multer=require(_0x91fa('0x0'));var util=require('util');var path=require(_0x91fa('0x1'));var timeout=require('connect-timeout');var express=require(_0x91fa('0x2'));var router=express[_0x91fa('0x3')]();var auth=require(_0x91fa('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x91fa('0x5'));var controller=require(_0x91fa('0x6'));router[_0x91fa('0x7')]('/',auth[_0x91fa('0x8')](),controller[_0x91fa('0x9')]);router['get'](_0x91fa('0xa'),auth[_0x91fa('0x8')](),controller['describe']);router['get'](_0x91fa('0xb'),auth[_0x91fa('0x8')](),controller[_0x91fa('0xc')]);router[_0x91fa('0x7')](_0x91fa('0xd'),auth[_0x91fa('0x8')](),controller[_0x91fa('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x91fa('0xf')]);router[_0x91fa('0x10')](_0x91fa('0xd'),controller[_0x91fa('0x11')]);router[_0x91fa('0x12')](_0x91fa('0xd'),auth[_0x91fa('0x8')](),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 738d79c..3144ebf 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 _0x0186=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0186,0x139));var _0x6018=function(_0x164e57,_0x532572){_0x164e57=_0x164e57-0x0;var _0xfa712b=_0x0186[_0x164e57];return _0xfa712b;};'use strict';var Sequelize=require(_0x6018('0x0'));module[_0x6018('0x1')]={'body':{'type':Sequelize['TEXT'](_0x6018('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x6018('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6018('0x4')]('in','out'),'defaultValue':_0x6018('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6018('0x6')]}}; \ No newline at end of file +var _0x7565=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1e40df,_0x18b1a5){var _0x4bfb7b=function(_0x3d5ca4){while(--_0x3d5ca4){_0x1e40df['push'](_0x1e40df['shift']());}};_0x4bfb7b(++_0x18b1a5);}(_0x7565,0x14b));var _0x5756=function(_0x5796ef,_0xa93396){_0x5796ef=_0x5796ef-0x0;var _0x1ee6c7=_0x7565[_0x5796ef];return _0x1ee6c7;};'use strict';var Sequelize=require(_0x5756('0x0'));module[_0x5756('0x1')]={'body':{'type':Sequelize[_0x5756('0x2')](_0x5756('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5756('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5756('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5756('0x5')]('in',_0x5756('0x6')),'defaultValue':_0x5756('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5756('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index cd01217..08659f1 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 _0x3550=['order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','rows','show','includeAll','body','update','params','describe','../../config/logger','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','find','CmContact','Contact','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','user','role','acceptMessage','manual','interface','SIP/%s','event','EventManager','acceptmessage','parse','formData','chat-interactions','agent','null','RejectMessage','rejectMessage','channel','rejectmessage','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','redis','socket.io-emitter','http','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','ChatMessage','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3550,0x11b));var _0x0355=function(_0xc94265,_0x6978cc){_0xc94265=_0xc94265-0x0;var _0x2d2a25=_0x3550[_0xc94265];return _0x2d2a25;};'use strict';var pdf=require(_0x0355('0x0'));var emlformat=require(_0x0355('0x1'));var rimraf=require(_0x0355('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0355('0x3'));var rp=require(_0x0355('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0355('0x5'));var util=require(_0x0355('0x6'));var path=require(_0x0355('0x7'));var sox=require(_0x0355('0x8'));var csv=require(_0x0355('0x9'));var ejs=require(_0x0355('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0355('0xb'));var crypto=require(_0x0355('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0355('0xd'));var toCsv=require(_0x0355('0x9'));var querystring=require(_0x0355('0xe'));var Papa=require(_0x0355('0xf'));var authService=require(_0x0355('0x10'));var hardwareService=require(_0x0355('0x11'));var Redis=require(_0x0355('0x12'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x0355('0x13'));var utils=require(_0x0355('0x14'));var config=require(_0x0355('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0355('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x0355('0x17'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0355('0x18')]({'port':0x232c});var client9002=jayson[_0x0355('0x19')][_0x0355('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1ec3de,_0x56e60c,_0x155725,_0x513ed8){return new BPromise(function(_0x1ff1f2,_0x5aa066){var _0x8c6924=_0x513ed8||client;return _0x8c6924[_0x0355('0x1a')](_0x1ec3de,_0x155725)['then'](function(_0x5e1e66){logger[_0x0355('0x1b')](_0x0355('0x1c'),_0x56e60c,_0x0355('0x1d'));logger[_0x0355('0x1e')](_0x0355('0x1f'),_0x56e60c,_0x0355('0x1d'),JSON[_0x0355('0x20')](_0x5e1e66));if(_0x5e1e66['error']){if(_0x5e1e66[_0x0355('0x21')]['code']===0x1f4){logger[_0x0355('0x21')](_0x0355('0x1c'),_0x56e60c,_0x5e1e66[_0x0355('0x21')][_0x0355('0x22')]);return _0x5aa066(_0x5e1e66[_0x0355('0x21')][_0x0355('0x22')]);}logger[_0x0355('0x21')](_0x0355('0x1c'),_0x56e60c,_0x5e1e66[_0x0355('0x21')][_0x0355('0x22')]);return _0x1ff1f2(_0x5e1e66['error'][_0x0355('0x22')]);}else{logger[_0x0355('0x1b')](_0x0355('0x1c'),_0x56e60c,_0x0355('0x1d'));_0x1ff1f2(_0x5e1e66[_0x0355('0x23')]['message']);}})[_0x0355('0x24')](function(_0x158666){logger[_0x0355('0x21')](_0x0355('0x1c'),_0x56e60c,_0x158666);_0x5aa066(_0x158666);});});}function respondWithStatusCode(_0x53df95,_0x21e5a4){_0x21e5a4=_0x21e5a4||0xcc;return function(_0x1af650){if(_0x1af650){return _0x53df95['sendStatus'](_0x21e5a4);}return _0x53df95[_0x0355('0x25')](_0x21e5a4)[_0x0355('0x26')]();};}function respondWithResult(_0x62387d,_0x50acc0){_0x50acc0=_0x50acc0||0xc8;return function(_0x57d2a5){if(_0x57d2a5){return _0x62387d['status'](_0x50acc0)[_0x0355('0x27')](_0x57d2a5);}};}function respondWithFilteredResult(_0xd022d,_0x53b742){return function(_0x4fa9da){if(_0x4fa9da){var _0x275e10=_0x4fa9da[_0x0355('0x28')],_0xf8a0af=_0x53b742[_0x0355('0x29')],_0x1be6c4=_0x53b742['offset']+_0x53b742[_0x0355('0x2a')],_0x201fb0;if(_0x1be6c4>=_0x275e10){_0x1be6c4=_0x275e10;_0x201fb0=0xc8;}else{_0x201fb0=0xce;}_0xd022d[_0x0355('0x25')](_0x201fb0);return _0xd022d[_0x0355('0x2b')](_0x0355('0x2c'),_0xf8a0af+'-'+_0x1be6c4+'/'+_0x275e10)[_0x0355('0x27')](_0x4fa9da);}return null;};}function patchUpdates(_0x9c95b3){return function(_0x1d2a7d){try{jsonpatch[_0x0355('0x2d')](_0x1d2a7d,_0x9c95b3,!![]);}catch(_0xed2d36){return BPromise[_0x0355('0x2e')](_0xed2d36);}return _0x1d2a7d[_0x0355('0x2f')]();};}function saveUpdates(_0x5690eb,_0x5a0523){return function(_0x1ead5e){if(_0x1ead5e){return _0x1ead5e['update'](_0x5690eb)[_0x0355('0x30')](function(_0x376564){return _0x376564;});}return null;};}function removeEntity(_0x50769e,_0x53fe58){return function(_0x1c78be){if(_0x1c78be){return _0x1c78be[_0x0355('0x31')]()[_0x0355('0x30')](function(){_0x50769e[_0x0355('0x25')](0xcc)[_0x0355('0x26')]();});}};}function handleEntityNotFound(_0x59d701,_0xbf10a8){return function(_0xe8511f){if(!_0xe8511f){_0x59d701['sendStatus'](0x194);}return _0xe8511f;};}function handleError(_0x2b378d,_0x47d38a){_0x47d38a=_0x47d38a||0x1f4;return function(_0x44b3f2){logger[_0x0355('0x21')](_0x44b3f2[_0x0355('0x32')]);if(_0x44b3f2['name']){delete _0x44b3f2[_0x0355('0x33')];}_0x2b378d[_0x0355('0x25')](_0x47d38a)['send'](_0x44b3f2);};}exports['index']=function(_0x17a0d2,_0x221426){var _0x288134={},_0x1ad0ed={},_0x5c8880={'count':0x0,'rows':[]};var _0xa74c89=db[_0x0355('0x34')]['rawAttributes'];_0x1ad0ed[_0x0355('0x35')]=_['keys'](_0xa74c89);_0x1ad0ed[_0x0355('0x36')]=_[_0x0355('0x37')](_0x17a0d2['query']);_0x1ad0ed[_0x0355('0x38')]=_[_0x0355('0x39')](_0x1ad0ed[_0x0355('0x35')],_0x1ad0ed[_0x0355('0x36')]);_0x288134[_0x0355('0x3a')]=_[_0x0355('0x39')](_0x1ad0ed[_0x0355('0x35')],qs[_0x0355('0x3b')](_0x17a0d2[_0x0355('0x36')][_0x0355('0x3b')]));_0x288134[_0x0355('0x3a')]=_0x288134[_0x0355('0x3a')][_0x0355('0x3c')]?_0x288134[_0x0355('0x3a')]:_0x1ad0ed['model'];if(!_0x17a0d2['query'][_0x0355('0x3d')]('nolimit')){_0x288134[_0x0355('0x2a')]=qs[_0x0355('0x2a')](_0x17a0d2['query'][_0x0355('0x2a')]);_0x288134['offset']=qs['offset'](_0x17a0d2[_0x0355('0x36')]['offset']);}_0x288134[_0x0355('0x3e')]=qs['sort'](_0x17a0d2[_0x0355('0x36')][_0x0355('0x3f')]);_0x288134[_0x0355('0x40')]=qs[_0x0355('0x38')](_[_0x0355('0x41')](_0x17a0d2[_0x0355('0x36')],_0x1ad0ed[_0x0355('0x38')]));if(_0x17a0d2[_0x0355('0x36')][_0x0355('0x42')]){_0x288134[_0x0355('0x40')]=_[_0x0355('0x43')](_0x288134['where'],{'$or':_[_0x0355('0x44')](_0xa74c89,function(_0x82d39e){if(_0x82d39e[_0x0355('0x45')][_0x0355('0x46')]!==_0x0355('0x47')){var _0x33ff8f={};_0x33ff8f[_0x82d39e[_0x0355('0x48')]]={'$like':'%'+_0x17a0d2[_0x0355('0x36')]['filter']+'%'};return _0x33ff8f;}})});}_0x288134=_['merge']({},_0x288134,_0x17a0d2[_0x0355('0x49')]);var _0x1d8f89={'where':_0x288134['where']};return db[_0x0355('0x34')][_0x0355('0x28')](_0x1d8f89)[_0x0355('0x30')](function(_0x51e20b){_0x5c8880[_0x0355('0x28')]=_0x51e20b;if(_0x17a0d2[_0x0355('0x36')]['includeAll']){_0x288134[_0x0355('0x4a')]=[{'all':!![]}];}return db[_0x0355('0x34')]['findAll'](_0x288134);})[_0x0355('0x30')](function(_0x7b6724){_0x5c8880[_0x0355('0x4b')]=_0x7b6724;return _0x5c8880;})[_0x0355('0x30')](respondWithFilteredResult(_0x221426,_0x288134))[_0x0355('0x24')](handleError(_0x221426,null));};exports[_0x0355('0x4c')]=function(_0x395410,_0x1c7a36){var _0x2f957a={'raw':!![],'where':{'id':_0x395410['params']['id']}},_0x2b7137={};_0x2b7137[_0x0355('0x35')]=_[_0x0355('0x37')](db[_0x0355('0x34')]['rawAttributes']);_0x2b7137[_0x0355('0x36')]=_[_0x0355('0x37')](_0x395410[_0x0355('0x36')]);_0x2b7137['filters']=_['intersection'](_0x2b7137[_0x0355('0x35')],_0x2b7137[_0x0355('0x36')]);_0x2f957a[_0x0355('0x3a')]=_[_0x0355('0x39')](_0x2b7137[_0x0355('0x35')],qs[_0x0355('0x3b')](_0x395410[_0x0355('0x36')][_0x0355('0x3b')]));_0x2f957a[_0x0355('0x3a')]=_0x2f957a[_0x0355('0x3a')][_0x0355('0x3c')]?_0x2f957a[_0x0355('0x3a')]:_0x2b7137[_0x0355('0x35')];if(_0x395410[_0x0355('0x36')][_0x0355('0x4d')]){_0x2f957a[_0x0355('0x4a')]=[{'all':!![]}];}_0x2f957a=_['merge']({},_0x2f957a,_0x395410[_0x0355('0x49')]);return db[_0x0355('0x34')]['find'](_0x2f957a)['then'](handleEntityNotFound(_0x1c7a36,null))[_0x0355('0x30')](respondWithResult(_0x1c7a36,null))[_0x0355('0x24')](handleError(_0x1c7a36,null));};exports['create']=function(_0x48d0a2,_0x2171f8){return db[_0x0355('0x34')]['create'](_0x48d0a2[_0x0355('0x4e')],{})[_0x0355('0x30')](respondWithResult(_0x2171f8,0xc9))[_0x0355('0x24')](handleError(_0x2171f8,null));};exports[_0x0355('0x4f')]=function(_0x514214,_0x1cb462){if(_0x514214[_0x0355('0x4e')]['id']){delete _0x514214[_0x0355('0x4e')]['id'];}return db[_0x0355('0x34')]['find']({'where':{'id':_0x514214[_0x0355('0x50')]['id']}})[_0x0355('0x30')](handleEntityNotFound(_0x1cb462,null))[_0x0355('0x30')](saveUpdates(_0x514214[_0x0355('0x4e')],null))[_0x0355('0x30')](respondWithResult(_0x1cb462,null))[_0x0355('0x24')](handleError(_0x1cb462,null));};exports[_0x0355('0x31')]=function(_0x4024da,_0xebeaf){return db[_0x0355('0x34')]['find']({'where':{'id':_0x4024da[_0x0355('0x50')]['id']}})[_0x0355('0x30')](handleEntityNotFound(_0xebeaf,null))[_0x0355('0x30')](removeEntity(_0xebeaf,null))[_0x0355('0x24')](handleError(_0xebeaf,null));};exports[_0x0355('0x51')]=function(_0x3cbd34,_0x968b40){return db[_0x0355('0x34')]['describe']()['then'](respondWithResult(_0x968b40,null))[_0x0355('0x24')](handleError(_0x968b40,null));};var interaction_log=require(_0x0355('0x52'))('chat-interactions');exports[_0x0355('0x53')]=function(_0x18de70,_0x1987ec,_0x248dab){var _0x15dea3={'channel':_0x0355('0x54')};if(_0x18de70[_0x0355('0x4e')]['id']){delete _0x18de70[_0x0355('0x4e')]['id'];}_0x18de70['body'][_0x0355('0x55')]=!![];_0x18de70[_0x0355('0x4e')]['readAt']=moment()[_0x0355('0x56')](_0x0355('0x57'));_0x18de70['body'][_0x0355('0x58')]=_0x18de70[_0x0355('0x4e')][_0x0355('0x58')]||_0x18de70['user']['id'];return db[_0x0355('0x34')][_0x0355('0x59')]({'where':{'id':_0x18de70['params']['id'],'UserId':null},'include':[{'model':db[_0x0355('0x5a')],'as':_0x0355('0x5b')}]})[_0x0355('0x30')](handleEntityNotFound(_0x1987ec,null))[_0x0355('0x30')](saveUpdates(_0x18de70[_0x0355('0x4e')],null))['then'](function(_0x837502){if(_0x837502){_0x15dea3['message']=_0x837502[_0x0355('0x5c')]({'plain':!![]});return db[_0x0355('0x5d')][_0x0355('0x59')]({'where':{'id':_0x837502[_0x0355('0x5e')]}});}return null;})[_0x0355('0x30')](handleEntityNotFound(_0x1987ec,null))[_0x0355('0x30')](function(_0x2e5289){if(_0x2e5289){return _0x2e5289[_0x0355('0x4f')]({'UserId':_0x18de70[_0x0355('0x4e')]['UserId'],'read1stAt':_['isNil'](_0x2e5289[_0x0355('0x5f')])?moment()[_0x0355('0x56')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0355('0x30')](function(_0x5b6909){if(_0x5b6909){_0x15dea3[_0x0355('0x60')]=_0x5b6909['get']({'plain':!![]});interaction_log[_0x0355('0x1b')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x18de70[_0x0355('0x61')]['id'],_0x18de70['user'][_0x0355('0x33')],_0x18de70[_0x0355('0x61')][_0x0355('0x62')],_0x15dea3[_0x0355('0x60')]['id'],_0x18de70[_0x0355('0x4e')]?JSON[_0x0355('0x20')](_0x18de70[_0x0355('0x4e')]):'null');return respondWithRpcPromise('AcceptMessage',_0x0355('0x63'),_0x15dea3);}return null;})[_0x0355('0x30')](function(_0x131165){if(_0x131165){if(_0x18de70[_0x0355('0x4e')][_0x0355('0x64')]){_0x15dea3[_0x0355('0x22')][_0x0355('0x65')]=util['format'](_0x0355('0x66'),_0x18de70[_0x0355('0x61')][_0x0355('0x33')]);_0x15dea3[_0x0355('0x22')]['channel']=_0x15dea3['channel'];_0x15dea3[_0x0355('0x22')][_0x0355('0x67')]=_0x0355('0x53');return respondWithRpcPromise('EventManager',_0x0355('0x68'),{'event':_0x0355('0x69'),'message':_[_0x0355('0x43')](_0x15dea3['message'],JSON[_0x0355('0x6a')](_0x15dea3[_0x0355('0x60')][_0x0355('0x6b')]))},client9002)[_0x0355('0x30')](function(){return _0x15dea3;});}return _0x15dea3;}return null;})[_0x0355('0x30')](respondWithResult(_0x1987ec,null))[_0x0355('0x24')](handleError(_0x1987ec,null));};var interaction_log=require(_0x0355('0x52'))(_0x0355('0x6c'));exports[_0x0355('0x2e')]=function(_0x406604,_0x1f38c9,_0xd9a6e5){var _0x3dd60e={'agent':{},'channel':_0x0355('0x54')};if(_0x406604['body']['id']){delete _0x406604[_0x0355('0x4e')]['id'];}_0x406604[_0x0355('0x4e')][_0x0355('0x58')]=_0x406604[_0x0355('0x4e')][_0x0355('0x58')]||_0x406604['user']['id'];_0x3dd60e[_0x0355('0x6d')]['id']=_0x406604['body']['UserId'];return db[_0x0355('0x34')][_0x0355('0x59')]({'where':{'id':_0x406604['params']['id'],'UserId':null}})[_0x0355('0x30')](handleEntityNotFound(_0x1f38c9,null))[_0x0355('0x30')](function(_0x330e24){if(_0x330e24){_0x3dd60e[_0x0355('0x22')]=_0x330e24['get']({'plain':!![]});return db[_0x0355('0x5d')][_0x0355('0x59')]({'where':{'id':_0x330e24[_0x0355('0x5e')]}});}return null;})[_0x0355('0x30')](handleEntityNotFound(_0x1f38c9,null))[_0x0355('0x30')](function(_0x209fa6){if(_0x209fa6){_0x3dd60e[_0x0355('0x60')]=_0x209fa6[_0x0355('0x5c')]({'plain':!![]});interaction_log[_0x0355('0x1b')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x406604[_0x0355('0x61')]['id'],_0x406604[_0x0355('0x61')][_0x0355('0x33')],_0x406604['user'][_0x0355('0x62')],_0x3dd60e[_0x0355('0x60')]['id'],_0x406604[_0x0355('0x4e')]?JSON[_0x0355('0x20')](_0x406604['body']):_0x0355('0x6e'));return respondWithRpcPromise(_0x0355('0x6f'),_0x0355('0x70'),_0x3dd60e);}return null;})[_0x0355('0x30')](function(_0x21f9a7){if(_0x21f9a7){_0x21f9a7[_0x0355('0x22')][_0x0355('0x65')]=util[_0x0355('0x56')](_0x0355('0x66'),_0x406604[_0x0355('0x61')][_0x0355('0x33')]);_0x21f9a7[_0x0355('0x22')][_0x0355('0x71')]=_0x3dd60e['channel'];_0x21f9a7[_0x0355('0x22')][_0x0355('0x67')]='reject';respondWithRpcPromise(_0x0355('0x68'),_0x0355('0x68'),{'event':_0x0355('0x72'),'message':_0x21f9a7[_0x0355('0x22')]},client9002);return _0x3dd60e;}return null;})[_0x0355('0x30')](respondWithResult(_0x1f38c9,null))[_0x0355('0x24')](handleError(_0x1f38c9,null));}; \ No newline at end of file +var _0xaed2=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','count','offset','set','json','apply','save','update','then','name','send','index','ChatMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','rows','show','params','include','find','create','body','destroy','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','SIP/%s','event','EventManager','acceptmessage','formData','reject','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','channel','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x59d369,_0x56a533){var _0x58c3eb=function(_0x2acb03){while(--_0x2acb03){_0x59d369['push'](_0x59d369['shift']());}};_0x58c3eb(++_0x56a533);}(_0xaed2,0x1ea));var _0x2aed=function(_0x1c4f3a,_0x3d24fc){_0x1c4f3a=_0x1c4f3a-0x0;var _0x29e939=_0xaed2[_0x1c4f3a];return _0x29e939;};'use strict';var pdf=require(_0x2aed('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2aed('0x1'));var zipdir=require(_0x2aed('0x2'));var jsonpatch=require(_0x2aed('0x3'));var rp=require('request-promise');var moment=require(_0x2aed('0x4'));var BPromise=require(_0x2aed('0x5'));var Mustache=require(_0x2aed('0x6'));var util=require(_0x2aed('0x7'));var path=require(_0x2aed('0x8'));var sox=require(_0x2aed('0x9'));var csv=require('to-csv');var ejs=require(_0x2aed('0xa'));var fs=require('fs');var _=require(_0x2aed('0xb'));var squel=require(_0x2aed('0xc'));var crypto=require('crypto');var jsforce=require(_0x2aed('0xd'));var deskjs=require(_0x2aed('0xe'));var toCsv=require(_0x2aed('0xf'));var querystring=require(_0x2aed('0x10'));var Papa=require(_0x2aed('0x11'));var authService=require(_0x2aed('0x12'));var hardwareService=require(_0x2aed('0x13'));var Redis=require(_0x2aed('0x14'));var qs=require(_0x2aed('0x15'));var logger=require(_0x2aed('0x16'))(_0x2aed('0x17'));var utils=require(_0x2aed('0x18'));var config=require('../../config/environment');var db=require(_0x2aed('0x19'))['db'];config[_0x2aed('0x1a')]=_[_0x2aed('0x1b')](config[_0x2aed('0x1a')],{'host':_0x2aed('0x1c'),'port':0x18eb});var socket=require(_0x2aed('0x1d'))(new Redis(config['redis']));require(_0x2aed('0x1e'))[_0x2aed('0x1f')](socket);var jayson=require(_0x2aed('0x20'));var client=jayson[_0x2aed('0x21')][_0x2aed('0x22')]({'port':0x232c});var client9002=jayson[_0x2aed('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x162025,_0xfdea85,_0xf91b4b,_0x57fb21){return new BPromise(function(_0x10a4e0,_0x324a78){var _0x4bff2e=_0x57fb21||client;return _0x4bff2e[_0x2aed('0x23')](_0x162025,_0xf91b4b)['then'](function(_0x21badd){logger[_0x2aed('0x24')](_0x2aed('0x25'),_0xfdea85,_0x2aed('0x26'));logger[_0x2aed('0x27')](_0x2aed('0x28'),_0xfdea85,_0x2aed('0x26'),JSON[_0x2aed('0x29')](_0x21badd));if(_0x21badd[_0x2aed('0x2a')]){if(_0x21badd['error']['code']===0x1f4){logger[_0x2aed('0x2a')]('ChatMessage,\x20%s,\x20%s',_0xfdea85,_0x21badd[_0x2aed('0x2a')][_0x2aed('0x2b')]);return _0x324a78(_0x21badd[_0x2aed('0x2a')][_0x2aed('0x2b')]);}logger[_0x2aed('0x2a')](_0x2aed('0x25'),_0xfdea85,_0x21badd[_0x2aed('0x2a')][_0x2aed('0x2b')]);return _0x10a4e0(_0x21badd['error'][_0x2aed('0x2b')]);}else{logger['info'](_0x2aed('0x25'),_0xfdea85,_0x2aed('0x26'));_0x10a4e0(_0x21badd['result'][_0x2aed('0x2b')]);}})[_0x2aed('0x2c')](function(_0x493c3e){logger[_0x2aed('0x2a')](_0x2aed('0x25'),_0xfdea85,_0x493c3e);_0x324a78(_0x493c3e);});});}function respondWithStatusCode(_0x276eab,_0x1a99be){_0x1a99be=_0x1a99be||0xcc;return function(_0x15c87b){if(_0x15c87b){return _0x276eab[_0x2aed('0x2d')](_0x1a99be);}return _0x276eab[_0x2aed('0x2e')](_0x1a99be)[_0x2aed('0x2f')]();};}function respondWithResult(_0x5538c8,_0x4dfbaf){_0x4dfbaf=_0x4dfbaf||0xc8;return function(_0x5ec1cd){if(_0x5ec1cd){return _0x5538c8['status'](_0x4dfbaf)['json'](_0x5ec1cd);}};}function respondWithFilteredResult(_0x494491,_0x1dccd9){return function(_0x3d0dfe){if(_0x3d0dfe){var _0x5ccea8=_0x3d0dfe[_0x2aed('0x30')],_0x3909e3=_0x1dccd9[_0x2aed('0x31')],_0x203996=_0x1dccd9[_0x2aed('0x31')]+_0x1dccd9['limit'],_0x3e07a2;if(_0x203996>=_0x5ccea8){_0x203996=_0x5ccea8;_0x3e07a2=0xc8;}else{_0x3e07a2=0xce;}_0x494491[_0x2aed('0x2e')](_0x3e07a2);return _0x494491[_0x2aed('0x32')]('Content-Range',_0x3909e3+'-'+_0x203996+'/'+_0x5ccea8)[_0x2aed('0x33')](_0x3d0dfe);}return null;};}function patchUpdates(_0x32c0bd){return function(_0x21fd55){try{jsonpatch[_0x2aed('0x34')](_0x21fd55,_0x32c0bd,!![]);}catch(_0x5a5a79){return BPromise['reject'](_0x5a5a79);}return _0x21fd55[_0x2aed('0x35')]();};}function saveUpdates(_0x2d8744,_0x53b3a1){return function(_0x444f74){if(_0x444f74){return _0x444f74[_0x2aed('0x36')](_0x2d8744)[_0x2aed('0x37')](function(_0x23e8b9){return _0x23e8b9;});}return null;};}function removeEntity(_0x197c2d,_0x18e4fd){return function(_0x48f7e3){if(_0x48f7e3){return _0x48f7e3['destroy']()[_0x2aed('0x37')](function(){_0x197c2d[_0x2aed('0x2e')](0xcc)[_0x2aed('0x2f')]();});}};}function handleEntityNotFound(_0x14550c,_0x4cd8f1){return function(_0x5bb2b4){if(!_0x5bb2b4){_0x14550c[_0x2aed('0x2d')](0x194);}return _0x5bb2b4;};}function handleError(_0x33ad45,_0x39824f){_0x39824f=_0x39824f||0x1f4;return function(_0x4f89c1){logger[_0x2aed('0x2a')](_0x4f89c1['stack']);if(_0x4f89c1[_0x2aed('0x38')]){delete _0x4f89c1['name'];}_0x33ad45[_0x2aed('0x2e')](_0x39824f)[_0x2aed('0x39')](_0x4f89c1);};}exports[_0x2aed('0x3a')]=function(_0x4fdbb1,_0x5f13bc){var _0x2f5b1b={},_0x181176={},_0x451787={'count':0x0,'rows':[]};var _0x2af257=db[_0x2aed('0x3b')][_0x2aed('0x3c')];_0x181176[_0x2aed('0x3d')]=_['keys'](_0x2af257);_0x181176[_0x2aed('0x3e')]=_[_0x2aed('0x3f')](_0x4fdbb1['query']);_0x181176[_0x2aed('0x40')]=_[_0x2aed('0x41')](_0x181176['model'],_0x181176['query']);_0x2f5b1b[_0x2aed('0x42')]=_[_0x2aed('0x41')](_0x181176[_0x2aed('0x3d')],qs[_0x2aed('0x43')](_0x4fdbb1[_0x2aed('0x3e')][_0x2aed('0x43')]));_0x2f5b1b['attributes']=_0x2f5b1b['attributes'][_0x2aed('0x44')]?_0x2f5b1b['attributes']:_0x181176[_0x2aed('0x3d')];if(!_0x4fdbb1[_0x2aed('0x3e')][_0x2aed('0x45')](_0x2aed('0x46'))){_0x2f5b1b[_0x2aed('0x47')]=qs['limit'](_0x4fdbb1['query'][_0x2aed('0x47')]);_0x2f5b1b['offset']=qs[_0x2aed('0x31')](_0x4fdbb1[_0x2aed('0x3e')]['offset']);}_0x2f5b1b[_0x2aed('0x48')]=qs[_0x2aed('0x49')](_0x4fdbb1[_0x2aed('0x3e')][_0x2aed('0x49')]);_0x2f5b1b[_0x2aed('0x4a')]=qs[_0x2aed('0x40')](_[_0x2aed('0x4b')](_0x4fdbb1[_0x2aed('0x3e')],_0x181176[_0x2aed('0x40')]));if(_0x4fdbb1[_0x2aed('0x3e')]['filter']){_0x2f5b1b[_0x2aed('0x4a')]=_[_0x2aed('0x4c')](_0x2f5b1b[_0x2aed('0x4a')],{'$or':_['map'](_0x2af257,function(_0x31cc37){if(_0x31cc37[_0x2aed('0x4d')][_0x2aed('0x4e')]!==_0x2aed('0x4f')){var _0x49c051={};_0x49c051[_0x31cc37[_0x2aed('0x50')]]={'$like':'%'+_0x4fdbb1[_0x2aed('0x3e')][_0x2aed('0x51')]+'%'};return _0x49c051;}})});}_0x2f5b1b=_['merge']({},_0x2f5b1b,_0x4fdbb1[_0x2aed('0x52')]);var _0x1913ed={'where':_0x2f5b1b['where']};return db[_0x2aed('0x3b')][_0x2aed('0x30')](_0x1913ed)[_0x2aed('0x37')](function(_0x184db9){_0x451787[_0x2aed('0x30')]=_0x184db9;if(_0x4fdbb1[_0x2aed('0x3e')][_0x2aed('0x53')]){_0x2f5b1b['include']=[{'all':!![]}];}return db[_0x2aed('0x3b')]['findAll'](_0x2f5b1b);})[_0x2aed('0x37')](function(_0x578910){_0x451787[_0x2aed('0x54')]=_0x578910;return _0x451787;})[_0x2aed('0x37')](respondWithFilteredResult(_0x5f13bc,_0x2f5b1b))[_0x2aed('0x2c')](handleError(_0x5f13bc,null));};exports[_0x2aed('0x55')]=function(_0x4a737e,_0x5233d8){var _0x87ec70={'raw':!![],'where':{'id':_0x4a737e[_0x2aed('0x56')]['id']}},_0x11c266={};_0x11c266[_0x2aed('0x3d')]=_[_0x2aed('0x3f')](db[_0x2aed('0x3b')]['rawAttributes']);_0x11c266[_0x2aed('0x3e')]=_[_0x2aed('0x3f')](_0x4a737e[_0x2aed('0x3e')]);_0x11c266[_0x2aed('0x40')]=_[_0x2aed('0x41')](_0x11c266[_0x2aed('0x3d')],_0x11c266[_0x2aed('0x3e')]);_0x87ec70[_0x2aed('0x42')]=_[_0x2aed('0x41')](_0x11c266[_0x2aed('0x3d')],qs['fields'](_0x4a737e['query'][_0x2aed('0x43')]));_0x87ec70[_0x2aed('0x42')]=_0x87ec70[_0x2aed('0x42')][_0x2aed('0x44')]?_0x87ec70[_0x2aed('0x42')]:_0x11c266[_0x2aed('0x3d')];if(_0x4a737e[_0x2aed('0x3e')]['includeAll']){_0x87ec70[_0x2aed('0x57')]=[{'all':!![]}];}_0x87ec70=_[_0x2aed('0x4c')]({},_0x87ec70,_0x4a737e[_0x2aed('0x52')]);return db[_0x2aed('0x3b')][_0x2aed('0x58')](_0x87ec70)[_0x2aed('0x37')](handleEntityNotFound(_0x5233d8,null))['then'](respondWithResult(_0x5233d8,null))[_0x2aed('0x2c')](handleError(_0x5233d8,null));};exports['create']=function(_0x21ad95,_0x101280){return db['ChatMessage'][_0x2aed('0x59')](_0x21ad95[_0x2aed('0x5a')],{})[_0x2aed('0x37')](respondWithResult(_0x101280,0xc9))['catch'](handleError(_0x101280,null));};exports[_0x2aed('0x36')]=function(_0x541ad9,_0x40e051){if(_0x541ad9[_0x2aed('0x5a')]['id']){delete _0x541ad9[_0x2aed('0x5a')]['id'];}return db[_0x2aed('0x3b')]['find']({'where':{'id':_0x541ad9['params']['id']}})[_0x2aed('0x37')](handleEntityNotFound(_0x40e051,null))[_0x2aed('0x37')](saveUpdates(_0x541ad9[_0x2aed('0x5a')],null))[_0x2aed('0x37')](respondWithResult(_0x40e051,null))[_0x2aed('0x2c')](handleError(_0x40e051,null));};exports[_0x2aed('0x5b')]=function(_0x299456,_0x282c89){return db[_0x2aed('0x3b')][_0x2aed('0x58')]({'where':{'id':_0x299456['params']['id']}})[_0x2aed('0x37')](handleEntityNotFound(_0x282c89,null))[_0x2aed('0x37')](removeEntity(_0x282c89,null))[_0x2aed('0x2c')](handleError(_0x282c89,null));};exports[_0x2aed('0x5c')]=function(_0x19a538,_0x1cbb19){return db['ChatMessage'][_0x2aed('0x5c')]()[_0x2aed('0x37')](respondWithResult(_0x1cbb19,null))['catch'](handleError(_0x1cbb19,null));};var interaction_log=require('../../config/logger')(_0x2aed('0x5d'));exports[_0x2aed('0x5e')]=function(_0x267592,_0x2db8e7,_0x1de2e3){var _0x15a18d={'channel':_0x2aed('0x5f')};if(_0x267592['body']['id']){delete _0x267592[_0x2aed('0x5a')]['id'];}_0x267592[_0x2aed('0x5a')][_0x2aed('0x60')]=!![];_0x267592['body'][_0x2aed('0x61')]=moment()['format'](_0x2aed('0x62'));_0x267592[_0x2aed('0x5a')][_0x2aed('0x63')]=_0x267592['body'][_0x2aed('0x63')]||_0x267592[_0x2aed('0x64')]['id'];return db[_0x2aed('0x3b')][_0x2aed('0x58')]({'where':{'id':_0x267592[_0x2aed('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x2aed('0x65')],'as':_0x2aed('0x66')}]})[_0x2aed('0x37')](handleEntityNotFound(_0x2db8e7,null))['then'](saveUpdates(_0x267592[_0x2aed('0x5a')],null))[_0x2aed('0x37')](function(_0x3c8c3b){if(_0x3c8c3b){_0x15a18d[_0x2aed('0x2b')]=_0x3c8c3b[_0x2aed('0x67')]({'plain':!![]});return db[_0x2aed('0x68')][_0x2aed('0x58')]({'where':{'id':_0x3c8c3b[_0x2aed('0x69')]}});}return null;})[_0x2aed('0x37')](handleEntityNotFound(_0x2db8e7,null))['then'](function(_0x140c04){if(_0x140c04){return _0x140c04[_0x2aed('0x36')]({'UserId':_0x267592['body']['UserId'],'read1stAt':_['isNil'](_0x140c04[_0x2aed('0x6a')])?moment()[_0x2aed('0x6b')](_0x2aed('0x62')):undefined});}return null;})['then'](function(_0x5b8c45){if(_0x5b8c45){_0x15a18d[_0x2aed('0x6c')]=_0x5b8c45[_0x2aed('0x67')]({'plain':!![]});interaction_log[_0x2aed('0x24')](_0x2aed('0x6d'),_0x267592[_0x2aed('0x64')]['id'],_0x267592[_0x2aed('0x64')][_0x2aed('0x38')],_0x267592[_0x2aed('0x64')][_0x2aed('0x6e')],_0x15a18d['interaction']['id'],_0x267592['body']?JSON[_0x2aed('0x29')](_0x267592[_0x2aed('0x5a')]):_0x2aed('0x6f'));return respondWithRpcPromise(_0x2aed('0x70'),'acceptMessage',_0x15a18d);}return null;})[_0x2aed('0x37')](function(_0x45640d){if(_0x45640d){if(_0x267592[_0x2aed('0x5a')][_0x2aed('0x71')]){_0x15a18d['message'][_0x2aed('0x72')]=util[_0x2aed('0x6b')](_0x2aed('0x73'),_0x267592[_0x2aed('0x64')]['name']);_0x15a18d[_0x2aed('0x2b')]['channel']=_0x15a18d['channel'];_0x15a18d['message'][_0x2aed('0x74')]=_0x2aed('0x5e');return respondWithRpcPromise('EventManager',_0x2aed('0x75'),{'event':_0x2aed('0x76'),'message':_['merge'](_0x15a18d[_0x2aed('0x2b')],JSON['parse'](_0x15a18d[_0x2aed('0x6c')][_0x2aed('0x77')]))},client9002)['then'](function(){return _0x15a18d;});}return _0x15a18d;}return null;})[_0x2aed('0x37')](respondWithResult(_0x2db8e7,null))['catch'](handleError(_0x2db8e7,null));};var interaction_log=require(_0x2aed('0x16'))('chat-interactions');exports[_0x2aed('0x78')]=function(_0x1c2de5,_0x1a8dd1,_0x44547d){var _0x35aea1={'agent':{},'channel':_0x2aed('0x5f')};if(_0x1c2de5[_0x2aed('0x5a')]['id']){delete _0x1c2de5[_0x2aed('0x5a')]['id'];}_0x1c2de5[_0x2aed('0x5a')][_0x2aed('0x63')]=_0x1c2de5[_0x2aed('0x5a')]['UserId']||_0x1c2de5[_0x2aed('0x64')]['id'];_0x35aea1[_0x2aed('0x79')]['id']=_0x1c2de5[_0x2aed('0x5a')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x1c2de5[_0x2aed('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1a8dd1,null))[_0x2aed('0x37')](function(_0x1022cf){if(_0x1022cf){_0x35aea1[_0x2aed('0x2b')]=_0x1022cf[_0x2aed('0x67')]({'plain':!![]});return db[_0x2aed('0x68')][_0x2aed('0x58')]({'where':{'id':_0x1022cf[_0x2aed('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x1a8dd1,null))[_0x2aed('0x37')](function(_0x49ae3d){if(_0x49ae3d){_0x35aea1['interaction']=_0x49ae3d[_0x2aed('0x67')]({'plain':!![]});interaction_log[_0x2aed('0x24')](_0x2aed('0x7a'),_0x1c2de5[_0x2aed('0x64')]['id'],_0x1c2de5[_0x2aed('0x64')][_0x2aed('0x38')],_0x1c2de5[_0x2aed('0x64')]['role'],_0x35aea1[_0x2aed('0x6c')]['id'],_0x1c2de5['body']?JSON[_0x2aed('0x29')](_0x1c2de5['body']):_0x2aed('0x6f'));return respondWithRpcPromise(_0x2aed('0x7b'),'rejectMessage',_0x35aea1);}return null;})[_0x2aed('0x37')](function(_0x5c3564){if(_0x5c3564){_0x5c3564[_0x2aed('0x2b')]['interface']=util[_0x2aed('0x6b')](_0x2aed('0x73'),_0x1c2de5[_0x2aed('0x64')][_0x2aed('0x38')]);_0x5c3564[_0x2aed('0x2b')][_0x2aed('0x7c')]=_0x35aea1['channel'];_0x5c3564[_0x2aed('0x2b')][_0x2aed('0x74')]=_0x2aed('0x78');respondWithRpcPromise(_0x2aed('0x75'),_0x2aed('0x75'),{'event':'rejectmessage','message':_0x5c3564[_0x2aed('0x2b')]},client9002);return _0x35aea1;}return null;})[_0x2aed('0x37')](respondWithResult(_0x1a8dd1,null))[_0x2aed('0x2c')](handleError(_0x1a8dd1,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 277ae3f..c31a716 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 _0x3189=['hasOwnProperty','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit'];(function(_0x28b2c4,_0x3f1312){var _0x48e31b=function(_0x19faf9){while(--_0x19faf9){_0x28b2c4['push'](_0x28b2c4['shift']());}};_0x48e31b(++_0x3f1312);}(_0x3189,0x134));var _0x9318=function(_0x23d849,_0x43c31d){_0x23d849=_0x23d849-0x0;var _0x56acc2=_0x3189[_0x23d849];return _0x56acc2;};'use strict';var EventEmitter=require(_0x9318('0x0'));var ChatMessage=require(_0x9318('0x1'))['db'][_0x9318('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9318('0x3')](0x0);var events={'afterCreate':_0x9318('0x4'),'afterUpdate':_0x9318('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2798e7){return function(_0x54a583,_0x4c74e4,_0x311d15){ChatMessageEvents['emit'](_0x2798e7+':'+_0x54a583['id'],_0x54a583);ChatMessageEvents[_0x9318('0x6')](_0x2798e7,_0x54a583);_0x311d15(null);};}for(var e in events){if(events[_0x9318('0x7')](e)){var event=events[e];ChatMessage[_0x9318('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x0941=['exports','../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x50f8b6,_0x4a67d6){var _0x1e8650=function(_0x2f033f){while(--_0x2f033f){_0x50f8b6['push'](_0x50f8b6['shift']());}};_0x1e8650(++_0x4a67d6);}(_0x0941,0xd3));var _0x1094=function(_0x24747f,_0x17a0de){_0x24747f=_0x24747f-0x0;var _0x308e3b=_0x0941[_0x24747f];return _0x308e3b;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x1094('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1094('0x1'),'afterDestroy':'remove'};function emitEvent(_0x16ca60){return function(_0x46b7eb,_0x3758cd,_0x57497e){ChatMessageEvents[_0x1094('0x2')](_0x16ca60+':'+_0x46b7eb['id'],_0x46b7eb);ChatMessageEvents[_0x1094('0x2')](_0x16ca60,_0x46b7eb);_0x57497e(null);};}for(var e in events){if(events[_0x1094('0x3')](e)){var event=events[e];ChatMessage[_0x1094('0x4')](e,emitEvent(event));}}module[_0x1094('0x5')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 7edec93..668cdec 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 _0xd5f1=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','./chatMessage.attributes','ChatMessage','models','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','body','catch','error','utf8mb4'];(function(_0x25c9ce,_0x10152a){var _0xcc7ac0=function(_0x363263){while(--_0x363263){_0x25c9ce['push'](_0x25c9ce['shift']());}};_0xcc7ac0(++_0x10152a);}(_0xd5f1,0x1b1));var _0x1d5f=function(_0x5c431c,_0x3f1b8c){_0x5c431c=_0x5c431c-0x0;var _0x3ce6fb=_0xd5f1[_0x5c431c];return _0x3ce6fb;};'use strict';var _=require(_0x1d5f('0x0'));var util=require(_0x1d5f('0x1'));var logger=require(_0x1d5f('0x2'))(_0x1d5f('0x3'));var moment=require('moment');var BPromise=require(_0x1d5f('0x4'));var rp=require(_0x1d5f('0x5'));var attributes=require(_0x1d5f('0x6'));module['exports']=function(_0x4b6c76,_0x4c5bae){return _0x4b6c76['define'](_0x1d5f('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56521a,_0x2c6236,_0x3314bc){var _0x2ee4eb=_0x4b6c76[_0x1d5f('0x8')];var _0x4bc7e0=_0x56521a['get']({'plain':!![]});if(_0x4bc7e0[_0x1d5f('0x9')][_0x1d5f('0xa')]()==='in'||_0x4bc7e0[_0x1d5f('0x9')][_0x1d5f('0xa')]()===_0x1d5f('0xb')&&!_0x4bc7e0[_0x1d5f('0xc')]&&!_['isNil'](_0x4bc7e0[_0x1d5f('0xd')])){_0x2ee4eb[_0x1d5f('0xe')][_0x1d5f('0xf')]({'where':{'id':_0x4bc7e0[_0x1d5f('0x10')]}})[_0x1d5f('0x11')](function(_0x22592d){if(_0x22592d){_0x22592d['update']({'lastMsgAt':_0x4bc7e0[_0x1d5f('0x12')],'lastMsgDirection':_0x4bc7e0['direction'][_0x1d5f('0xa')](),'lastMsgBody':_0x4bc7e0[_0x1d5f('0x13')]});}})[_0x1d5f('0x14')](function(_0xabdf1e){console[_0x1d5f('0x15')](_0xabdf1e);});}_0x3314bc();}},'charset':_0x1d5f('0x16'),'collate':_0x1d5f('0x17')});}; \ No newline at end of file +var _0x3cf5=['api','moment','bluebird','exports','define','ChatMessage','models','get','direction','toLowerCase','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','body','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x222b50,_0x1f2114){var _0x49b883=function(_0x1f7531){while(--_0x1f7531){_0x222b50['push'](_0x222b50['shift']());}};_0x49b883(++_0x1f2114);}(_0x3cf5,0xa6));var _0x53cf=function(_0x11f418,_0x16283a){_0x11f418=_0x11f418-0x0;var _0x5d7f70=_0x3cf5[_0x11f418];return _0x5d7f70;};'use strict';var _=require(_0x53cf('0x0'));var util=require(_0x53cf('0x1'));var logger=require('../../config/logger')(_0x53cf('0x2'));var moment=require(_0x53cf('0x3'));var BPromise=require(_0x53cf('0x4'));var rp=require('request-promise');var attributes=require('./chatMessage.attributes');module[_0x53cf('0x5')]=function(_0x552e67,_0x1e8ded){return _0x552e67[_0x53cf('0x6')](_0x53cf('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x52b197,_0x4bb279,_0x39e779){var _0x4d6c91=_0x552e67[_0x53cf('0x8')];var _0x18ed01=_0x52b197[_0x53cf('0x9')]({'plain':!![]});if(_0x18ed01[_0x53cf('0xa')][_0x53cf('0xb')]()==='in'||_0x18ed01[_0x53cf('0xa')]['toLowerCase']()==='out'&&!_0x18ed01['secret']&&!_[_0x53cf('0xc')](_0x18ed01[_0x53cf('0xd')])){_0x4d6c91[_0x53cf('0xe')]['findOne']({'where':{'id':_0x18ed01[_0x53cf('0xf')]}})[_0x53cf('0x10')](function(_0x33bede){if(_0x33bede){_0x33bede[_0x53cf('0x11')]({'lastMsgAt':_0x18ed01[_0x53cf('0x12')],'lastMsgDirection':_0x18ed01[_0x53cf('0xa')]['toLowerCase'](),'lastMsgBody':_0x18ed01[_0x53cf('0x13')]});}})[_0x53cf('0x14')](function(_0x49e73d){console[_0x53cf('0x15')](_0x49e73d);});}_0x39e779();}},'charset':_0x53cf('0x16'),'collate':_0x53cf('0x17')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b82baf4..306f36f 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 _0xd99e=['../../config/logger','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','then','debug','util','moment','bluebird','randomstring','ioredis'];(function(_0x359940,_0x361167){var _0x57e618=function(_0x38780c){while(--_0x38780c){_0x359940['push'](_0x359940['shift']());}};_0x57e618(++_0x361167);}(_0xd99e,0xeb));var _0xed99=function(_0xa98302,_0x844f27){_0xa98302=_0xa98302-0x0;var _0x1ad8e3=_0xd99e[_0xa98302];return _0x1ad8e3;};'use strict';var _=require('lodash');var util=require(_0xed99('0x0'));var moment=require(_0xed99('0x1'));var BPromise=require(_0xed99('0x2'));var rs=require(_0xed99('0x3'));var fs=require('fs');var Redis=require(_0xed99('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed99('0x5'))('rpc');var config=require(_0xed99('0x6'));var jayson=require(_0xed99('0x7'));var client=jayson['client'][_0xed99('0x8')]({'port':0x232a});config[_0xed99('0x9')]=_['defaults'](config[_0xed99('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xed99('0xa'))(new Redis(config['redis']));require(_0xed99('0xb'))[_0xed99('0xc')](socket);function respondWithRpcPromise(_0x2a2428,_0x2dea8f,_0x300fbf){return new BPromise(function(_0x21d880,_0x3a14c2){return client[_0xed99('0xd')](_0x2a2428,_0x300fbf)['then'](function(_0x4a2277){logger[_0xed99('0xe')](_0xed99('0xf'),_0x2dea8f,_0xed99('0x10'));logger['debug'](_0xed99('0x11'),_0x2dea8f,_0xed99('0x10'),JSON[_0xed99('0x12')](_0x4a2277));if(_0x4a2277[_0xed99('0x13')]){if(_0x4a2277['error']['code']===0x1f4){logger[_0xed99('0x13')](_0xed99('0xf'),_0x2dea8f,_0x4a2277[_0xed99('0x13')][_0xed99('0x14')]);return _0x3a14c2(_0x4a2277['error']['message']);}logger[_0xed99('0x13')](_0xed99('0xf'),_0x2dea8f,_0x4a2277['error']['message']);return _0x21d880(_0x4a2277[_0xed99('0x13')][_0xed99('0x14')]);}else{logger[_0xed99('0xe')]('ChatMessage,\x20%s,\x20%s',_0x2dea8f,_0xed99('0x10'));_0x21d880(_0x4a2277[_0xed99('0x15')]['message']);}})['catch'](function(_0xacd6e5){logger[_0xed99('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2dea8f,_0xacd6e5);_0x3a14c2(_0xacd6e5);});});}exports[_0xed99('0x16')]=function(_0x3fafb9){var _0x4ff1ad=this;return new Promise(function(_0x1821ac,_0x3ff761){return db[_0xed99('0x17')][_0xed99('0x18')](_0x3fafb9[_0xed99('0x19')],{'raw':_0x3fafb9['options']?_0x3fafb9[_0xed99('0x1a')][_0xed99('0x1b')]===undefined?!![]:![]:!![]})[_0xed99('0x1c')](function(_0xe2692e){logger[_0xed99('0xe')](_0xed99('0x16'),_0x3fafb9);logger[_0xed99('0x1d')]('CreateChatMessage',_0x3fafb9,JSON['stringify'](_0xe2692e));_0x1821ac(_0xe2692e);})['catch'](function(_0x133713){logger[_0xed99('0x13')](_0xed99('0x16'),_0x133713[_0xed99('0x14')],_0x3fafb9);_0x3ff761(_0x4ff1ad[_0xed99('0x13')](0x1f4,_0x133713[_0xed99('0x14')]));});});}; \ No newline at end of file +var _0xf028=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter','redis','register','request','then'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xf028,0x74));var _0x8f02=function(_0x13cd63,_0x4ee60b){_0x13cd63=_0x13cd63-0x0;var _0x5b0e1b=_0xf028[_0x13cd63];return _0x5b0e1b;};'use strict';var _=require(_0x8f02('0x0'));var util=require(_0x8f02('0x1'));var moment=require(_0x8f02('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f02('0x3'));var fs=require('fs');var Redis=require(_0x8f02('0x4'));var db=require(_0x8f02('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f02('0x6'))(_0x8f02('0x7'));var config=require(_0x8f02('0x8'));var jayson=require(_0x8f02('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8f02('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8f02('0xb'))(new Redis(config[_0x8f02('0xc')]));require('./chatMessage.socket')[_0x8f02('0xd')](socket);function respondWithRpcPromise(_0xe800d,_0x319ea9,_0x250f84){return new BPromise(function(_0x13219d,_0x47ad96){return client[_0x8f02('0xe')](_0xe800d,_0x250f84)[_0x8f02('0xf')](function(_0x514860){logger[_0x8f02('0x10')](_0x8f02('0x11'),_0x319ea9,_0x8f02('0x12'));logger['debug'](_0x8f02('0x13'),_0x319ea9,_0x8f02('0x12'),JSON[_0x8f02('0x14')](_0x514860));if(_0x514860[_0x8f02('0x15')]){if(_0x514860[_0x8f02('0x15')][_0x8f02('0x16')]===0x1f4){logger[_0x8f02('0x15')](_0x8f02('0x11'),_0x319ea9,_0x514860['error'][_0x8f02('0x17')]);return _0x47ad96(_0x514860[_0x8f02('0x15')][_0x8f02('0x17')]);}logger[_0x8f02('0x15')](_0x8f02('0x11'),_0x319ea9,_0x514860['error'][_0x8f02('0x17')]);return _0x13219d(_0x514860['error']['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x319ea9,_0x8f02('0x12'));_0x13219d(_0x514860[_0x8f02('0x18')]['message']);}})[_0x8f02('0x19')](function(_0x530e96){logger['error'](_0x8f02('0x11'),_0x319ea9,_0x530e96);_0x47ad96(_0x530e96);});});}exports[_0x8f02('0x1a')]=function(_0x133f8d){var _0x3ce563=this;return new Promise(function(_0x6c96b3,_0x10ef4a){return db[_0x8f02('0x1b')][_0x8f02('0x1c')](_0x133f8d[_0x8f02('0x1d')],{'raw':_0x133f8d[_0x8f02('0x1e')]?_0x133f8d[_0x8f02('0x1e')][_0x8f02('0x1f')]===undefined?!![]:![]:!![]})[_0x8f02('0xf')](function(_0x5c6cb5){logger['info'](_0x8f02('0x1a'),_0x133f8d);logger[_0x8f02('0x20')]('CreateChatMessage',_0x133f8d,JSON[_0x8f02('0x14')](_0x5c6cb5));_0x6c96b3(_0x5c6cb5);})['catch'](function(_0xdc6389){logger['error'](_0x8f02('0x1a'),_0xdc6389[_0x8f02('0x17')],_0x133f8d);_0x10ef4a(_0x3ce563[_0x8f02('0x15')](0x1f4,_0xdc6389['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f807093..063e1f5 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 _0x3e74=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x3e74,0x175));var _0x43e7=function(_0xde3641,_0x4de4b2){_0xde3641=_0xde3641-0x0;var _0x1712b6=_0x3e74[_0xde3641];return _0x1712b6;};'use strict';var ChatMessageEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatMessageEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatMessageEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file +var _0x3e74=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x3e74,0x175));var _0x43e7=function(_0x12fdb4,_0x2dfd5f){_0x12fdb4=_0x12fdb4-0x0;var _0x4c1937=_0x3e74[_0x12fdb4];return _0x4c1937;};'use strict';var ChatMessageEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatMessageEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatMessageEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index e95b346..b0c7163 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 _0x17fb=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','reject','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x369219,_0x2bbd68){var _0x3bd48f=function(_0x2f34dd){while(--_0x2f34dd){_0x369219['push'](_0x369219['shift']());}};_0x3bd48f(++_0x2bbd68);}(_0x17fb,0xc1));var _0xb17f=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x17fb[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0xb17f('0x0'));var util=require(_0xb17f('0x1'));var path=require('path');var timeout=require(_0xb17f('0x2'));var express=require(_0xb17f('0x3'));var router=express['Router']();var auth=require(_0xb17f('0x4'));var interaction=require(_0xb17f('0x5'));var config=require(_0xb17f('0x6'));var controller=require(_0xb17f('0x7'));router[_0xb17f('0x8')]('/',auth[_0xb17f('0x9')](),controller[_0xb17f('0xa')]);router['get'](_0xb17f('0xb'),auth[_0xb17f('0x9')](),controller['describe']);router[_0xb17f('0x8')](_0xb17f('0xc'),auth[_0xb17f('0x9')](),controller[_0xb17f('0xd')]);router[_0xb17f('0xe')]('/',auth[_0xb17f('0x9')](),interaction[_0xb17f('0xf')](_0xb17f('0x10'),_0xb17f('0x11')),controller[_0xb17f('0x12')]);router[_0xb17f('0x13')]('/:id',controller[_0xb17f('0x14')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth[_0xb17f('0x9')](),controller[_0xb17f('0x15')]);router['delete'](_0xb17f('0xc'),auth[_0xb17f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2491=['destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe','/:id','chat','chatmessage:create','create','put','update','/:id/accept','accept','reject','delete'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x2491,0x11f));var _0x1249=function(_0xb04f7a,_0x52581c){_0xb04f7a=_0xb04f7a-0x0;var _0x247388=_0x2491[_0xb04f7a];return _0x247388;};'use strict';var multer=require(_0x1249('0x0'));var util=require(_0x1249('0x1'));var path=require('path');var timeout=require(_0x1249('0x2'));var express=require(_0x1249('0x3'));var router=express[_0x1249('0x4')]();var auth=require(_0x1249('0x5'));var interaction=require(_0x1249('0x6'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1249('0x7')]);router[_0x1249('0x8')]('/describe',auth[_0x1249('0x9')](),controller[_0x1249('0xa')]);router[_0x1249('0x8')](_0x1249('0xb'),auth[_0x1249('0x9')](),controller['show']);router['post']('/',auth[_0x1249('0x9')](),interaction['tracked'](_0x1249('0xc'),_0x1249('0xd')),controller[_0x1249('0xe')]);router[_0x1249('0xf')]('/:id',controller[_0x1249('0x10')]);router[_0x1249('0xf')](_0x1249('0x11'),auth[_0x1249('0x9')](),controller[_0x1249('0x12')]);router[_0x1249('0xf')]('/:id/reject',auth[_0x1249('0x9')](),controller[_0x1249('0x13')]);router[_0x1249('0x14')](_0x1249('0xb'),auth[_0x1249('0x9')](),controller[_0x1249('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 855c033..dfaeb84 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 _0x18a5=['sequelize','exports'];(function(_0x53a2a1,_0x595e09){var _0x270bc4=function(_0x27c716){while(--_0x27c716){_0x53a2a1['push'](_0x53a2a1['shift']());}};_0x270bc4(++_0x595e09);}(_0x18a5,0x164));var _0x518a=function(_0x43c4bd,_0x4b0c31){_0x43c4bd=_0x43c4bd-0x0;var _0x422adc=_0x18a5[_0x43c4bd];return _0x422adc;};'use strict';var Sequelize=require(_0x518a('0x0'));module[_0x518a('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x1f70=['sequelize','exports','TEXT','medium'];(function(_0x3b98d6,_0x25a570){var _0x2b0363=function(_0x1b668a){while(--_0x1b668a){_0x3b98d6['push'](_0x3b98d6['shift']());}};_0x2b0363(++_0x25a570);}(_0x1f70,0x18c));var _0x01f7=function(_0x456907,_0x84e54b){_0x456907=_0x456907-0x0;var _0x54a030=_0x1f70[_0x456907];return _0x54a030;};'use strict';var Sequelize=require(_0x01f7('0x0'));module[_0x01f7('0x1')]={'body':{'type':Sequelize[_0x01f7('0x2')](_0x01f7('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 99466c3..8b57a69 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 _0xc32d=['create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','ChatOfflineMessage','rawAttributes','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','options','includeAll','findAll','catch','show','fields','include'];(function(_0x39c49b,_0x556674){var _0x445ebc=function(_0x293b61){while(--_0x293b61){_0x39c49b['push'](_0x39c49b['shift']());}};_0x445ebc(++_0x556674);}(_0xc32d,0x16d));var _0xdc32=function(_0x19c750,_0x460688){_0x19c750=_0x19c750-0x0;var _0x51ee14=_0xc32d[_0x19c750];return _0x51ee14;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdc32('0x0'));var rimraf=require(_0xdc32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc32('0x2'));var rp=require(_0xdc32('0x3'));var moment=require('moment');var BPromise=require(_0xdc32('0x4'));var Mustache=require(_0xdc32('0x5'));var util=require(_0xdc32('0x6'));var path=require('path');var sox=require(_0xdc32('0x7'));var csv=require(_0xdc32('0x8'));var ejs=require(_0xdc32('0x9'));var fs=require('fs');var _=require(_0xdc32('0xa'));var squel=require('squel');var crypto=require(_0xdc32('0xb'));var jsforce=require(_0xdc32('0xc'));var deskjs=require(_0xdc32('0xd'));var toCsv=require(_0xdc32('0x8'));var querystring=require(_0xdc32('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xdc32('0xf'));var Redis=require(_0xdc32('0x10'));var qs=require(_0xdc32('0x11'));var logger=require(_0xdc32('0x12'))(_0xdc32('0x13'));var utils=require(_0xdc32('0x14'));var config=require(_0xdc32('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e71c7,_0x1b810b){_0x1b810b=_0x1b810b||0xcc;return function(_0x2a4936){if(_0x2a4936){return _0x5e71c7[_0xdc32('0x16')](_0x1b810b);}return _0x5e71c7[_0xdc32('0x17')](_0x1b810b)[_0xdc32('0x18')]();};}function respondWithResult(_0x2db845,_0x1f5058){_0x1f5058=_0x1f5058||0xc8;return function(_0x14d38e){if(_0x14d38e){return _0x2db845[_0xdc32('0x17')](_0x1f5058)[_0xdc32('0x19')](_0x14d38e);}};}function respondWithFilteredResult(_0x43b886,_0x4ffa6f){return function(_0x4a02bd){if(_0x4a02bd){var _0x370d40=_0x4a02bd[_0xdc32('0x1a')],_0x141747=_0x4ffa6f['offset'],_0x354108=_0x4ffa6f[_0xdc32('0x1b')]+_0x4ffa6f[_0xdc32('0x1c')],_0x54f316;if(_0x354108>=_0x370d40){_0x354108=_0x370d40;_0x54f316=0xc8;}else{_0x54f316=0xce;}_0x43b886[_0xdc32('0x17')](_0x54f316);return _0x43b886[_0xdc32('0x1d')](_0xdc32('0x1e'),_0x141747+'-'+_0x354108+'/'+_0x370d40)[_0xdc32('0x19')](_0x4a02bd);}return null;};}function patchUpdates(_0x4a23c3){return function(_0x519224){try{jsonpatch[_0xdc32('0x1f')](_0x519224,_0x4a23c3,!![]);}catch(_0x30695d){return BPromise[_0xdc32('0x20')](_0x30695d);}return _0x519224[_0xdc32('0x21')]();};}function saveUpdates(_0x366f9a,_0x22b23d){return function(_0x503a36){if(_0x503a36){return _0x503a36[_0xdc32('0x22')](_0x366f9a)['then'](function(_0x729b12){return _0x729b12;});}return null;};}function removeEntity(_0x2cdf43,_0x4b9bc2){return function(_0x1f1c14){if(_0x1f1c14){return _0x1f1c14[_0xdc32('0x23')]()[_0xdc32('0x24')](function(){_0x2cdf43['status'](0xcc)[_0xdc32('0x18')]();});}};}function handleEntityNotFound(_0x5c9d66,_0x57251a){return function(_0x5f0cf5){if(!_0x5f0cf5){_0x5c9d66[_0xdc32('0x16')](0x194);}return _0x5f0cf5;};}function handleError(_0x52251a,_0x55bcae){_0x55bcae=_0x55bcae||0x1f4;return function(_0x4607ab){logger[_0xdc32('0x25')](_0x4607ab['stack']);if(_0x4607ab[_0xdc32('0x26')]){delete _0x4607ab[_0xdc32('0x26')];}_0x52251a[_0xdc32('0x17')](_0x55bcae)['send'](_0x4607ab);};}exports[_0xdc32('0x27')]=function(_0x5a2b17,_0x4e95c8){var _0x410bed={},_0x35fb17={},_0x4d583c={'count':0x0,'rows':[]};var _0x1745d7=db[_0xdc32('0x28')][_0xdc32('0x29')];_0x35fb17[_0xdc32('0x2a')]=_[_0xdc32('0x2b')](_0x1745d7);_0x35fb17['query']=_['keys'](_0x5a2b17[_0xdc32('0x2c')]);_0x35fb17[_0xdc32('0x2d')]=_[_0xdc32('0x2e')](_0x35fb17[_0xdc32('0x2a')],_0x35fb17[_0xdc32('0x2c')]);_0x410bed[_0xdc32('0x2f')]=_[_0xdc32('0x2e')](_0x35fb17[_0xdc32('0x2a')],qs['fields'](_0x5a2b17[_0xdc32('0x2c')]['fields']));_0x410bed[_0xdc32('0x2f')]=_0x410bed[_0xdc32('0x2f')][_0xdc32('0x30')]?_0x410bed[_0xdc32('0x2f')]:_0x35fb17[_0xdc32('0x2a')];if(!_0x5a2b17[_0xdc32('0x2c')]['hasOwnProperty'](_0xdc32('0x31'))){_0x410bed[_0xdc32('0x1c')]=qs['limit'](_0x5a2b17[_0xdc32('0x2c')][_0xdc32('0x1c')]);_0x410bed['offset']=qs[_0xdc32('0x1b')](_0x5a2b17[_0xdc32('0x2c')][_0xdc32('0x1b')]);}_0x410bed[_0xdc32('0x32')]=qs['sort'](_0x5a2b17[_0xdc32('0x2c')][_0xdc32('0x33')]);_0x410bed['where']=qs['filters'](_[_0xdc32('0x34')](_0x5a2b17[_0xdc32('0x2c')],_0x35fb17[_0xdc32('0x2d')]));if(_0x5a2b17['query'][_0xdc32('0x35')]){_0x410bed[_0xdc32('0x36')]=_[_0xdc32('0x37')](_0x410bed['where'],{'$or':_[_0xdc32('0x38')](_0x1745d7,function(_0x246543){if(_0x246543[_0xdc32('0x39')][_0xdc32('0x3a')]!=='VIRTUAL'){var _0x5b40a0={};_0x5b40a0[_0x246543[_0xdc32('0x3b')]]={'$like':'%'+_0x5a2b17[_0xdc32('0x2c')]['filter']+'%'};return _0x5b40a0;}})});}_0x410bed=_[_0xdc32('0x37')]({},_0x410bed,_0x5a2b17[_0xdc32('0x3c')]);var _0x647b28={'where':_0x410bed[_0xdc32('0x36')]};return db['ChatOfflineMessage'][_0xdc32('0x1a')](_0x647b28)['then'](function(_0x372b38){_0x4d583c[_0xdc32('0x1a')]=_0x372b38;if(_0x5a2b17['query'][_0xdc32('0x3d')]){_0x410bed['include']=[{'all':!![]}];}return db[_0xdc32('0x28')][_0xdc32('0x3e')](_0x410bed);})[_0xdc32('0x24')](function(_0x1e688f){_0x4d583c['rows']=_0x1e688f;return _0x4d583c;})[_0xdc32('0x24')](respondWithFilteredResult(_0x4e95c8,_0x410bed))[_0xdc32('0x3f')](handleError(_0x4e95c8,null));};exports[_0xdc32('0x40')]=function(_0x5f4338,_0xe76f85){var _0x339845={'raw':!![],'where':{'id':_0x5f4338['params']['id']}},_0x442f27={};_0x442f27[_0xdc32('0x2a')]=_['keys'](db['ChatOfflineMessage'][_0xdc32('0x29')]);_0x442f27['query']=_['keys'](_0x5f4338['query']);_0x442f27[_0xdc32('0x2d')]=_[_0xdc32('0x2e')](_0x442f27[_0xdc32('0x2a')],_0x442f27['query']);_0x339845[_0xdc32('0x2f')]=_[_0xdc32('0x2e')](_0x442f27[_0xdc32('0x2a')],qs[_0xdc32('0x41')](_0x5f4338[_0xdc32('0x2c')][_0xdc32('0x41')]));_0x339845[_0xdc32('0x2f')]=_0x339845[_0xdc32('0x2f')][_0xdc32('0x30')]?_0x339845[_0xdc32('0x2f')]:_0x442f27[_0xdc32('0x2a')];if(_0x5f4338[_0xdc32('0x2c')][_0xdc32('0x3d')]){_0x339845[_0xdc32('0x42')]=[{'all':!![]}];}_0x339845=_['merge']({},_0x339845,_0x5f4338[_0xdc32('0x3c')]);return db['ChatOfflineMessage']['find'](_0x339845)[_0xdc32('0x24')](handleEntityNotFound(_0xe76f85,null))[_0xdc32('0x24')](respondWithResult(_0xe76f85,null))[_0xdc32('0x3f')](handleError(_0xe76f85,null));};exports[_0xdc32('0x43')]=function(_0x4c97a9,_0x42c02e){return db[_0xdc32('0x28')][_0xdc32('0x43')](_0x4c97a9['body'],{})['then'](respondWithResult(_0x42c02e,0xc9))[_0xdc32('0x3f')](handleError(_0x42c02e,null));};exports[_0xdc32('0x22')]=function(_0x662443,_0xeef3b9){if(_0x662443[_0xdc32('0x44')]['id']){delete _0x662443['body']['id'];}return db[_0xdc32('0x28')][_0xdc32('0x45')]({'where':{'id':_0x662443['params']['id']}})['then'](handleEntityNotFound(_0xeef3b9,null))['then'](saveUpdates(_0x662443[_0xdc32('0x44')],null))[_0xdc32('0x24')](respondWithResult(_0xeef3b9,null))[_0xdc32('0x3f')](handleError(_0xeef3b9,null));};exports[_0xdc32('0x23')]=function(_0x26462e,_0x46a610){return db[_0xdc32('0x28')][_0xdc32('0x45')]({'where':{'id':_0x26462e[_0xdc32('0x46')]['id']}})[_0xdc32('0x24')](handleEntityNotFound(_0x46a610,null))['then'](removeEntity(_0x46a610,null))[_0xdc32('0x3f')](handleError(_0x46a610,null));};exports[_0xdc32('0x47')]=function(_0xdd1656,_0x51bd83){return db['ChatOfflineMessage']['describe']()['then'](respondWithResult(_0x51bd83,null))['catch'](handleError(_0x51bd83,null));}; \ No newline at end of file +var _0x9e91=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','status','end','offset','limit','set','json','reject','update','destroy','then','sendStatus','stack','name','ChatOfflineMessage','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x9e91,0x11f));var _0x19e9=function(_0xd0e4c2,_0x40dd95){_0xd0e4c2=_0xd0e4c2-0x0;var _0x4fc15b=_0x9e91[_0xd0e4c2];return _0x4fc15b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x19e9('0x0'));var zipdir=require(_0x19e9('0x1'));var jsonpatch=require(_0x19e9('0x2'));var rp=require(_0x19e9('0x3'));var moment=require(_0x19e9('0x4'));var BPromise=require(_0x19e9('0x5'));var Mustache=require(_0x19e9('0x6'));var util=require(_0x19e9('0x7'));var path=require(_0x19e9('0x8'));var sox=require(_0x19e9('0x9'));var csv=require(_0x19e9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x19e9('0xb'));var squel=require(_0x19e9('0xc'));var crypto=require(_0x19e9('0xd'));var jsforce=require(_0x19e9('0xe'));var deskjs=require(_0x19e9('0xf'));var toCsv=require(_0x19e9('0xa'));var querystring=require(_0x19e9('0x10'));var Papa=require(_0x19e9('0x11'));var authService=require(_0x19e9('0x12'));var hardwareService=require(_0x19e9('0x13'));var Redis=require(_0x19e9('0x14'));var qs=require(_0x19e9('0x15'));var logger=require('../../config/logger')(_0x19e9('0x16'));var utils=require(_0x19e9('0x17'));var config=require(_0x19e9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b9920,_0x4434ee){_0x4434ee=_0x4434ee||0xcc;return function(_0x455b59){if(_0x455b59){return _0x5b9920['sendStatus'](_0x4434ee);}return _0x5b9920[_0x19e9('0x19')](_0x4434ee)[_0x19e9('0x1a')]();};}function respondWithResult(_0x3a3ff3,_0x745839){_0x745839=_0x745839||0xc8;return function(_0x5c1b47){if(_0x5c1b47){return _0x3a3ff3[_0x19e9('0x19')](_0x745839)['json'](_0x5c1b47);}};}function respondWithFilteredResult(_0x1cea01,_0x343278){return function(_0x55ef64){if(_0x55ef64){var _0x29548f=_0x55ef64['count'],_0x279e16=_0x343278[_0x19e9('0x1b')],_0x4ed903=_0x343278[_0x19e9('0x1b')]+_0x343278[_0x19e9('0x1c')],_0x461c25;if(_0x4ed903>=_0x29548f){_0x4ed903=_0x29548f;_0x461c25=0xc8;}else{_0x461c25=0xce;}_0x1cea01['status'](_0x461c25);return _0x1cea01[_0x19e9('0x1d')]('Content-Range',_0x279e16+'-'+_0x4ed903+'/'+_0x29548f)[_0x19e9('0x1e')](_0x55ef64);}return null;};}function patchUpdates(_0x280296){return function(_0xb2cd83){try{jsonpatch['apply'](_0xb2cd83,_0x280296,!![]);}catch(_0x1bb77d){return BPromise[_0x19e9('0x1f')](_0x1bb77d);}return _0xb2cd83['save']();};}function saveUpdates(_0x598c4b,_0x235fb6){return function(_0x5818eb){if(_0x5818eb){return _0x5818eb[_0x19e9('0x20')](_0x598c4b)['then'](function(_0x51e0a2){return _0x51e0a2;});}return null;};}function removeEntity(_0x366719,_0x54afd4){return function(_0x6fd290){if(_0x6fd290){return _0x6fd290[_0x19e9('0x21')]()[_0x19e9('0x22')](function(){_0x366719['status'](0xcc)[_0x19e9('0x1a')]();});}};}function handleEntityNotFound(_0x5999a4,_0x2803f5){return function(_0x717697){if(!_0x717697){_0x5999a4[_0x19e9('0x23')](0x194);}return _0x717697;};}function handleError(_0x4ee910,_0x11d8d2){_0x11d8d2=_0x11d8d2||0x1f4;return function(_0x4cac13){logger['error'](_0x4cac13[_0x19e9('0x24')]);if(_0x4cac13['name']){delete _0x4cac13[_0x19e9('0x25')];}_0x4ee910[_0x19e9('0x19')](_0x11d8d2)['send'](_0x4cac13);};}exports['index']=function(_0x4bb61f,_0xe2ccc9){var _0x12826f={},_0xcf65fc={},_0xe9d4f4={'count':0x0,'rows':[]};var _0x37f969=db[_0x19e9('0x26')][_0x19e9('0x27')];_0xcf65fc[_0x19e9('0x28')]=_['keys'](_0x37f969);_0xcf65fc[_0x19e9('0x29')]=_['keys'](_0x4bb61f[_0x19e9('0x29')]);_0xcf65fc[_0x19e9('0x2a')]=_[_0x19e9('0x2b')](_0xcf65fc[_0x19e9('0x28')],_0xcf65fc[_0x19e9('0x29')]);_0x12826f['attributes']=_[_0x19e9('0x2b')](_0xcf65fc[_0x19e9('0x28')],qs[_0x19e9('0x2c')](_0x4bb61f[_0x19e9('0x29')][_0x19e9('0x2c')]));_0x12826f[_0x19e9('0x2d')]=_0x12826f[_0x19e9('0x2d')][_0x19e9('0x2e')]?_0x12826f[_0x19e9('0x2d')]:_0xcf65fc[_0x19e9('0x28')];if(!_0x4bb61f['query'][_0x19e9('0x2f')](_0x19e9('0x30'))){_0x12826f[_0x19e9('0x1c')]=qs[_0x19e9('0x1c')](_0x4bb61f[_0x19e9('0x29')][_0x19e9('0x1c')]);_0x12826f[_0x19e9('0x1b')]=qs[_0x19e9('0x1b')](_0x4bb61f[_0x19e9('0x29')][_0x19e9('0x1b')]);}_0x12826f['order']=qs[_0x19e9('0x31')](_0x4bb61f[_0x19e9('0x29')]['sort']);_0x12826f[_0x19e9('0x32')]=qs[_0x19e9('0x2a')](_[_0x19e9('0x33')](_0x4bb61f[_0x19e9('0x29')],_0xcf65fc[_0x19e9('0x2a')]));if(_0x4bb61f[_0x19e9('0x29')][_0x19e9('0x34')]){_0x12826f['where']=_[_0x19e9('0x35')](_0x12826f[_0x19e9('0x32')],{'$or':_['map'](_0x37f969,function(_0x1fbad9){if(_0x1fbad9[_0x19e9('0x36')][_0x19e9('0x37')]!==_0x19e9('0x38')){var _0x206bea={};_0x206bea[_0x1fbad9[_0x19e9('0x39')]]={'$like':'%'+_0x4bb61f[_0x19e9('0x29')][_0x19e9('0x34')]+'%'};return _0x206bea;}})});}_0x12826f=_[_0x19e9('0x35')]({},_0x12826f,_0x4bb61f['options']);var _0x3b4bfc={'where':_0x12826f[_0x19e9('0x32')]};return db[_0x19e9('0x26')]['count'](_0x3b4bfc)[_0x19e9('0x22')](function(_0x19023a){_0xe9d4f4[_0x19e9('0x3a')]=_0x19023a;if(_0x4bb61f[_0x19e9('0x29')][_0x19e9('0x3b')]){_0x12826f[_0x19e9('0x3c')]=[{'all':!![]}];}return db[_0x19e9('0x26')][_0x19e9('0x3d')](_0x12826f);})[_0x19e9('0x22')](function(_0x2cde16){_0xe9d4f4[_0x19e9('0x3e')]=_0x2cde16;return _0xe9d4f4;})['then'](respondWithFilteredResult(_0xe2ccc9,_0x12826f))[_0x19e9('0x3f')](handleError(_0xe2ccc9,null));};exports[_0x19e9('0x40')]=function(_0x21ce65,_0x56573e){var _0x76cd47={'raw':!![],'where':{'id':_0x21ce65[_0x19e9('0x41')]['id']}},_0x4004f0={};_0x4004f0[_0x19e9('0x28')]=_['keys'](db[_0x19e9('0x26')]['rawAttributes']);_0x4004f0[_0x19e9('0x29')]=_[_0x19e9('0x42')](_0x21ce65[_0x19e9('0x29')]);_0x4004f0[_0x19e9('0x2a')]=_[_0x19e9('0x2b')](_0x4004f0['model'],_0x4004f0[_0x19e9('0x29')]);_0x76cd47[_0x19e9('0x2d')]=_['intersection'](_0x4004f0[_0x19e9('0x28')],qs[_0x19e9('0x2c')](_0x21ce65[_0x19e9('0x29')][_0x19e9('0x2c')]));_0x76cd47['attributes']=_0x76cd47[_0x19e9('0x2d')][_0x19e9('0x2e')]?_0x76cd47[_0x19e9('0x2d')]:_0x4004f0[_0x19e9('0x28')];if(_0x21ce65['query'][_0x19e9('0x3b')]){_0x76cd47[_0x19e9('0x3c')]=[{'all':!![]}];}_0x76cd47=_[_0x19e9('0x35')]({},_0x76cd47,_0x21ce65[_0x19e9('0x43')]);return db[_0x19e9('0x26')][_0x19e9('0x44')](_0x76cd47)['then'](handleEntityNotFound(_0x56573e,null))['then'](respondWithResult(_0x56573e,null))[_0x19e9('0x3f')](handleError(_0x56573e,null));};exports[_0x19e9('0x45')]=function(_0xba0775,_0x1f5810){return db[_0x19e9('0x26')][_0x19e9('0x45')](_0xba0775[_0x19e9('0x46')],{})[_0x19e9('0x22')](respondWithResult(_0x1f5810,0xc9))[_0x19e9('0x3f')](handleError(_0x1f5810,null));};exports['update']=function(_0x225e43,_0x44088d){if(_0x225e43[_0x19e9('0x46')]['id']){delete _0x225e43['body']['id'];}return db[_0x19e9('0x26')][_0x19e9('0x44')]({'where':{'id':_0x225e43[_0x19e9('0x41')]['id']}})[_0x19e9('0x22')](handleEntityNotFound(_0x44088d,null))[_0x19e9('0x22')](saveUpdates(_0x225e43[_0x19e9('0x46')],null))[_0x19e9('0x22')](respondWithResult(_0x44088d,null))[_0x19e9('0x3f')](handleError(_0x44088d,null));};exports[_0x19e9('0x21')]=function(_0x36bcbe,_0x2be5f6){return db[_0x19e9('0x26')][_0x19e9('0x44')]({'where':{'id':_0x36bcbe[_0x19e9('0x41')]['id']}})[_0x19e9('0x22')](handleEntityNotFound(_0x2be5f6,null))[_0x19e9('0x22')](removeEntity(_0x2be5f6,null))['catch'](handleError(_0x2be5f6,null));};exports[_0x19e9('0x47')]=function(_0x5b68e6,_0x5199a6){return db['ChatOfflineMessage'][_0x19e9('0x47')]()[_0x19e9('0x22')](respondWithResult(_0x5199a6,null))[_0x19e9('0x3f')](handleError(_0x5199a6,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 1debac4..a96f276 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 _0xc5f1=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise'];(function(_0x3ee728,_0x49e1b9){var _0x10aa27=function(_0x4da4ac){while(--_0x4da4ac){_0x3ee728['push'](_0x3ee728['shift']());}};_0x10aa27(++_0x49e1b9);}(_0xc5f1,0x15a));var _0x1c5f=function(_0x581419,_0x409195){_0x581419=_0x581419-0x0;var _0x514d4e=_0xc5f1[_0x581419];return _0x514d4e;};'use strict';var _=require(_0x1c5f('0x0'));var util=require(_0x1c5f('0x1'));var logger=require(_0x1c5f('0x2'))(_0x1c5f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1c5f('0x4'));var attributes=require(_0x1c5f('0x5'));module[_0x1c5f('0x6')]=function(_0x5caff4,_0x5ac7fe){return _0x5caff4['define'](_0x1c5f('0x7'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1c5f('0x8')});}; \ No newline at end of file +var _0x59a0=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','./chatOfflineMessage.attributes'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x59a0,0xc1));var _0x059a=function(_0x5fbdb6,_0x101938){_0x5fbdb6=_0x5fbdb6-0x0;var _0x4f4cf5=_0x59a0[_0x5fbdb6];return _0x4f4cf5;};'use strict';var _=require(_0x059a('0x0'));var util=require(_0x059a('0x1'));var logger=require(_0x059a('0x2'))(_0x059a('0x3'));var moment=require(_0x059a('0x4'));var BPromise=require(_0x059a('0x5'));var rp=require('request-promise');var attributes=require(_0x059a('0x6'));module['exports']=function(_0x465d29,_0x27ac40){return _0x465d29['define'](_0x059a('0x7'),attributes,{'tableName':_0x059a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x059a('0x9')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 060c30f..c53991b 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 _0xad65=['request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','ChatOfflineMessage,\x20%s,\x20%s','message'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xad65,0x1cf));var _0x5ad6=function(_0x246426,_0x505c21){_0x246426=_0x246426-0x0;var _0x320fcf=_0xad65[_0x246426];return _0x320fcf;};'use strict';var _=require(_0x5ad6('0x0'));var util=require(_0x5ad6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ad6('0x2'));var fs=require('fs');var Redis=require(_0x5ad6('0x3'));var db=require(_0x5ad6('0x4'))['db'];var utils=require(_0x5ad6('0x5'));var logger=require(_0x5ad6('0x6'))(_0x5ad6('0x7'));var config=require('../../config/environment');var jayson=require(_0x5ad6('0x8'));var client=jayson[_0x5ad6('0x9')][_0x5ad6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x305cd5,_0x13753f,_0x1de12){return new BPromise(function(_0x3579ca,_0x312517){return client[_0x5ad6('0xb')](_0x305cd5,_0x1de12)[_0x5ad6('0xc')](function(_0x5270df){logger[_0x5ad6('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x13753f,'request\x20sent');logger[_0x5ad6('0xe')](_0x5ad6('0xf'),_0x13753f,'request\x20sent',JSON['stringify'](_0x5270df));if(_0x5270df['error']){if(_0x5270df[_0x5ad6('0x10')][_0x5ad6('0x11')]===0x1f4){logger[_0x5ad6('0x10')](_0x5ad6('0x12'),_0x13753f,_0x5270df[_0x5ad6('0x10')][_0x5ad6('0x13')]);return _0x312517(_0x5270df[_0x5ad6('0x10')][_0x5ad6('0x13')]);}logger[_0x5ad6('0x10')](_0x5ad6('0x12'),_0x13753f,_0x5270df[_0x5ad6('0x10')][_0x5ad6('0x13')]);return _0x3579ca(_0x5270df['error']['message']);}else{logger[_0x5ad6('0xd')](_0x5ad6('0x12'),_0x13753f,_0x5ad6('0x14'));_0x3579ca(_0x5270df[_0x5ad6('0x15')][_0x5ad6('0x13')]);}})[_0x5ad6('0x16')](function(_0x46656a){logger[_0x5ad6('0x10')](_0x5ad6('0x12'),_0x13753f,_0x46656a);_0x312517(_0x46656a);});});} \ No newline at end of file +var _0x95c2=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0x95c2,0xf7));var _0x295c=function(_0x18443c,_0x1fc32e){_0x18443c=_0x18443c-0x0;var _0x371642=_0x95c2[_0x18443c];return _0x371642;};'use strict';var _=require(_0x295c('0x0'));var util=require('util');var moment=require(_0x295c('0x1'));var BPromise=require(_0x295c('0x2'));var rs=require(_0x295c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x295c('0x4'))['db'];var utils=require(_0x295c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x295c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x295c('0x7')][_0x295c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf82894,_0x5d451e,_0x385936){return new BPromise(function(_0x470148,_0x328f7c){return client[_0x295c('0x9')](_0xf82894,_0x385936)[_0x295c('0xa')](function(_0x4174cf){logger[_0x295c('0xb')](_0x295c('0xc'),_0x5d451e,_0x295c('0xd'));logger[_0x295c('0xe')](_0x295c('0xf'),_0x5d451e,_0x295c('0xd'),JSON['stringify'](_0x4174cf));if(_0x4174cf[_0x295c('0x10')]){if(_0x4174cf['error'][_0x295c('0x11')]===0x1f4){logger[_0x295c('0x10')](_0x295c('0xc'),_0x5d451e,_0x4174cf[_0x295c('0x10')][_0x295c('0x12')]);return _0x328f7c(_0x4174cf[_0x295c('0x10')][_0x295c('0x12')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5d451e,_0x4174cf[_0x295c('0x10')]['message']);return _0x470148(_0x4174cf[_0x295c('0x10')]['message']);}else{logger[_0x295c('0xb')](_0x295c('0xc'),_0x5d451e,_0x295c('0xd'));_0x470148(_0x4174cf[_0x295c('0x13')][_0x295c('0x12')]);}})['catch'](function(_0x587d1d){logger[_0x295c('0x10')](_0x295c('0xc'),_0x5d451e,_0x587d1d);_0x328f7c(_0x587d1d);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 6848f95..9520c32 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 _0x79d8=['isAuthenticated','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe'];(function(_0x250010,_0x489f87){var _0x2448f2=function(_0x56f2b2){while(--_0x56f2b2){_0x250010['push'](_0x250010['shift']());}};_0x2448f2(++_0x489f87);}(_0x79d8,0x67));var _0x879d=function(_0x217812,_0x4bd3f7){_0x217812=_0x217812-0x0;var _0x5c4d4d=_0x79d8[_0x217812];return _0x5c4d4d;};'use strict';var multer=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var path=require(_0x879d('0x2'));var timeout=require(_0x879d('0x3'));var express=require('express');var router=express[_0x879d('0x4')]();var auth=require(_0x879d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x879d('0x6'));var controller=require(_0x879d('0x7'));router[_0x879d('0x8')]('/',auth['isAuthenticated'](),controller[_0x879d('0x9')]);router[_0x879d('0x8')](_0x879d('0xa'),auth[_0x879d('0xb')](),controller['describe']);router[_0x879d('0x8')](_0x879d('0xc'),auth[_0x879d('0xb')](),controller[_0x879d('0xd')]);router[_0x879d('0xe')]('/',auth['isAuthenticated'](),controller[_0x879d('0xf')]);router['put']('/:id',auth[_0x879d('0xb')](),controller[_0x879d('0x10')]);router[_0x879d('0x11')]('/:id',auth[_0x879d('0xb')](),controller[_0x879d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7341=['/:id','update','delete','destroy','path','express','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','create','put'];(function(_0x32adcd,_0x2d1deb){var _0x1e298e=function(_0x3e5e63){while(--_0x3e5e63){_0x32adcd['push'](_0x32adcd['shift']());}};_0x1e298e(++_0x2d1deb);}(_0x7341,0xe4));var _0x1734=function(_0x42e5bd,_0x54e5b5){_0x42e5bd=_0x42e5bd-0x0;var _0x5bcc16=_0x7341[_0x42e5bd];return _0x5bcc16;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1734('0x0'));var timeout=require('connect-timeout');var express=require(_0x1734('0x1'));var router=express[_0x1734('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x1734('0x3'));var config=require(_0x1734('0x4'));var controller=require(_0x1734('0x5'));router[_0x1734('0x6')]('/',auth[_0x1734('0x7')](),controller[_0x1734('0x8')]);router[_0x1734('0x6')]('/describe',auth[_0x1734('0x7')](),controller[_0x1734('0x9')]);router[_0x1734('0x6')]('/:id',auth[_0x1734('0x7')](),controller['show']);router['post']('/',auth[_0x1734('0x7')](),controller[_0x1734('0xa')]);router[_0x1734('0xb')](_0x1734('0xc'),auth[_0x1734('0x7')](),controller[_0x1734('0xd')]);router[_0x1734('0xe')](_0x1734('0xc'),auth[_0x1734('0x7')](),controller[_0x1734('0xf')]);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 609a3fa..bad29da 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 _0x1956=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1956,0x15c));var _0x6195=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x1956[_0x1b3a5c];return _0x2ae8cb;};'use strict';var Sequelize=require(_0x6195('0x0'));module[_0x6195('0x1')]={'name':{'type':Sequelize[_0x6195('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6195('0x3')](_0x6195('0x4'),_0x6195('0x5')),'defaultValue':_0x6195('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6195('0x6')]}}; \ No newline at end of file +var _0x5416=['exports','STRING','ENUM','mouseOver','INTEGER','sequelize'];(function(_0x1d850e,_0x723bc4){var _0x2efd1f=function(_0x4aabc7){while(--_0x4aabc7){_0x1d850e['push'](_0x1d850e['shift']());}};_0x2efd1f(++_0x723bc4);}(_0x5416,0x13d));var _0x6541=function(_0x51d007,_0x233f7f){_0x51d007=_0x51d007-0x0;var _0xdc1a03=_0x5416[_0x51d007];return _0xdc1a03;};'use strict';var Sequelize=require(_0x6541('0x0'));module[_0x6541('0x1')]={'name':{'type':Sequelize[_0x6541('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6541('0x3')](_0x6541('0x4'),'timeout'),'defaultValue':_0x6541('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6541('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index e632cd8..8e061e4 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 _0xd881=['bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','end','status','json','count','offset','set','Content-Range','apply','save','then','sendStatus','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','options','ChatProactiveAction','catch','create','body','update','find','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x36b444,_0x505b35){var _0x786323=function(_0x146af0){while(--_0x146af0){_0x36b444['push'](_0x36b444['shift']());}};_0x786323(++_0x505b35);}(_0xd881,0x182));var _0x1d88=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd881[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require(_0x1d88('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1d88('0x1'));var zipdir=require(_0x1d88('0x2'));var jsonpatch=require(_0x1d88('0x3'));var rp=require(_0x1d88('0x4'));var moment=require(_0x1d88('0x5'));var BPromise=require(_0x1d88('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d88('0x7'));var sox=require(_0x1d88('0x8'));var csv=require(_0x1d88('0x9'));var ejs=require(_0x1d88('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1d88('0xb'));var crypto=require(_0x1d88('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d88('0xd'));var toCsv=require(_0x1d88('0x9'));var querystring=require(_0x1d88('0xe'));var Papa=require(_0x1d88('0xf'));var authService=require(_0x1d88('0x10'));var hardwareService=require(_0x1d88('0x11'));var Redis=require(_0x1d88('0x12'));var qs=require(_0x1d88('0x13'));var logger=require('../../config/logger')(_0x1d88('0x14'));var utils=require(_0x1d88('0x15'));var config=require(_0x1d88('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3de233,_0x485406){_0x485406=_0x485406||0xcc;return function(_0x37c67a){if(_0x37c67a){return _0x3de233['sendStatus'](_0x485406);}return _0x3de233['status'](_0x485406)[_0x1d88('0x17')]();};}function respondWithResult(_0xc2d0fb,_0x57e3dc){_0x57e3dc=_0x57e3dc||0xc8;return function(_0x28f286){if(_0x28f286){return _0xc2d0fb[_0x1d88('0x18')](_0x57e3dc)[_0x1d88('0x19')](_0x28f286);}};}function respondWithFilteredResult(_0x32d9e1,_0x1ef677){return function(_0x59dccd){if(_0x59dccd){var _0x3e99b5=_0x59dccd[_0x1d88('0x1a')],_0x344a76=_0x1ef677['offset'],_0x17a740=_0x1ef677[_0x1d88('0x1b')]+_0x1ef677['limit'],_0x4c49a8;if(_0x17a740>=_0x3e99b5){_0x17a740=_0x3e99b5;_0x4c49a8=0xc8;}else{_0x4c49a8=0xce;}_0x32d9e1[_0x1d88('0x18')](_0x4c49a8);return _0x32d9e1[_0x1d88('0x1c')](_0x1d88('0x1d'),_0x344a76+'-'+_0x17a740+'/'+_0x3e99b5)[_0x1d88('0x19')](_0x59dccd);}return null;};}function patchUpdates(_0x567cc5){return function(_0x1fa0c4){try{jsonpatch[_0x1d88('0x1e')](_0x1fa0c4,_0x567cc5,!![]);}catch(_0x3cf39c){return BPromise['reject'](_0x3cf39c);}return _0x1fa0c4[_0x1d88('0x1f')]();};}function saveUpdates(_0xb285ec,_0x417e36){return function(_0x175aae){if(_0x175aae){return _0x175aae['update'](_0xb285ec)[_0x1d88('0x20')](function(_0x318b7c){return _0x318b7c;});}return null;};}function removeEntity(_0x492457,_0x5c4520){return function(_0x1efb3e){if(_0x1efb3e){return _0x1efb3e['destroy']()[_0x1d88('0x20')](function(){_0x492457[_0x1d88('0x18')](0xcc)[_0x1d88('0x17')]();});}};}function handleEntityNotFound(_0x180984,_0x113fec){return function(_0x56658c){if(!_0x56658c){_0x180984[_0x1d88('0x21')](0x194);}return _0x56658c;};}function handleError(_0xee3ee6,_0x1a799a){_0x1a799a=_0x1a799a||0x1f4;return function(_0x526c98){logger['error'](_0x526c98[_0x1d88('0x22')]);if(_0x526c98['name']){delete _0x526c98[_0x1d88('0x23')];}_0xee3ee6[_0x1d88('0x18')](_0x1a799a)[_0x1d88('0x24')](_0x526c98);};}exports[_0x1d88('0x25')]=function(_0x4f1850,_0x9b2853){var _0x2af74c={'raw':!![],'where':{'id':_0x4f1850[_0x1d88('0x26')]['id']}},_0x363587={};_0x363587[_0x1d88('0x27')]=_[_0x1d88('0x28')](db['ChatProactiveAction'][_0x1d88('0x29')]);_0x363587[_0x1d88('0x2a')]=_[_0x1d88('0x28')](_0x4f1850[_0x1d88('0x2a')]);_0x363587[_0x1d88('0x2b')]=_[_0x1d88('0x2c')](_0x363587['model'],_0x363587[_0x1d88('0x2a')]);_0x2af74c[_0x1d88('0x2d')]=_['intersection'](_0x363587[_0x1d88('0x27')],qs[_0x1d88('0x2e')](_0x4f1850[_0x1d88('0x2a')][_0x1d88('0x2e')]));_0x2af74c[_0x1d88('0x2d')]=_0x2af74c['attributes']['length']?_0x2af74c[_0x1d88('0x2d')]:_0x363587[_0x1d88('0x27')];if(_0x4f1850['query'][_0x1d88('0x2f')]){_0x2af74c['include']=[{'all':!![]}];}_0x2af74c=_['merge']({},_0x2af74c,_0x4f1850[_0x1d88('0x30')]);return db[_0x1d88('0x31')]['find'](_0x2af74c)[_0x1d88('0x20')](handleEntityNotFound(_0x9b2853,null))['then'](respondWithResult(_0x9b2853,null))[_0x1d88('0x32')](handleError(_0x9b2853,null));};exports['create']=function(_0x555329,_0x5da349){return db[_0x1d88('0x31')][_0x1d88('0x33')](_0x555329[_0x1d88('0x34')],{})[_0x1d88('0x20')](respondWithResult(_0x5da349,0xc9))[_0x1d88('0x32')](handleError(_0x5da349,null));};exports[_0x1d88('0x35')]=function(_0x5ca2bf,_0x5bef8f){if(_0x5ca2bf[_0x1d88('0x34')]['id']){delete _0x5ca2bf['body']['id'];}return db[_0x1d88('0x31')][_0x1d88('0x36')]({'where':{'id':_0x5ca2bf[_0x1d88('0x26')]['id']}})['then'](handleEntityNotFound(_0x5bef8f,null))[_0x1d88('0x20')](saveUpdates(_0x5ca2bf[_0x1d88('0x34')],null))[_0x1d88('0x20')](respondWithResult(_0x5bef8f,null))[_0x1d88('0x32')](handleError(_0x5bef8f,null));};exports[_0x1d88('0x37')]=function(_0x9a005b,_0x3e5825){return db[_0x1d88('0x31')][_0x1d88('0x36')]({'where':{'id':_0x9a005b[_0x1d88('0x26')]['id']}})[_0x1d88('0x20')](handleEntityNotFound(_0x3e5825,null))[_0x1d88('0x20')](removeEntity(_0x3e5825,null))['catch'](handleError(_0x3e5825,null));}; \ No newline at end of file +var _0x6f49=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','show','params','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','squel','crypto'];(function(_0x430a54,_0x1912b){var _0x50e04f=function(_0x88ae65){while(--_0x88ae65){_0x430a54['push'](_0x430a54['shift']());}};_0x50e04f(++_0x1912b);}(_0x6f49,0xa6));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x96f4('0x0'));var rimraf=require(_0x96f4('0x1'));var zipdir=require(_0x96f4('0x2'));var jsonpatch=require(_0x96f4('0x3'));var rp=require(_0x96f4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96f4('0x5'));var path=require('path');var sox=require(_0x96f4('0x6'));var csv=require(_0x96f4('0x7'));var ejs=require(_0x96f4('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x96f4('0x9'));var crypto=require(_0x96f4('0xa'));var jsforce=require(_0x96f4('0xb'));var deskjs=require(_0x96f4('0xc'));var toCsv=require(_0x96f4('0x7'));var querystring=require(_0x96f4('0xd'));var Papa=require(_0x96f4('0xe'));var authService=require(_0x96f4('0xf'));var hardwareService=require(_0x96f4('0x10'));var Redis=require('ioredis');var qs=require(_0x96f4('0x11'));var logger=require(_0x96f4('0x12'))(_0x96f4('0x13'));var utils=require(_0x96f4('0x14'));var config=require(_0x96f4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32836c,_0x32d21c){_0x32d21c=_0x32d21c||0xcc;return function(_0x1fa6d9){if(_0x1fa6d9){return _0x32836c['sendStatus'](_0x32d21c);}return _0x32836c[_0x96f4('0x16')](_0x32d21c)[_0x96f4('0x17')]();};}function respondWithResult(_0x4f325f,_0x2faa44){_0x2faa44=_0x2faa44||0xc8;return function(_0x504e91){if(_0x504e91){return _0x4f325f['status'](_0x2faa44)['json'](_0x504e91);}};}function respondWithFilteredResult(_0x2a8a28,_0x31c27d){return function(_0x30b880){if(_0x30b880){var _0x24fba9=_0x30b880[_0x96f4('0x18')],_0x5355be=_0x31c27d[_0x96f4('0x19')],_0x33ce8c=_0x31c27d[_0x96f4('0x19')]+_0x31c27d[_0x96f4('0x1a')],_0x4ca17d;if(_0x33ce8c>=_0x24fba9){_0x33ce8c=_0x24fba9;_0x4ca17d=0xc8;}else{_0x4ca17d=0xce;}_0x2a8a28['status'](_0x4ca17d);return _0x2a8a28[_0x96f4('0x1b')](_0x96f4('0x1c'),_0x5355be+'-'+_0x33ce8c+'/'+_0x24fba9)[_0x96f4('0x1d')](_0x30b880);}return null;};}function patchUpdates(_0x4b60fa){return function(_0x3b2c4a){try{jsonpatch[_0x96f4('0x1e')](_0x3b2c4a,_0x4b60fa,!![]);}catch(_0x423ff3){return BPromise[_0x96f4('0x1f')](_0x423ff3);}return _0x3b2c4a[_0x96f4('0x20')]();};}function saveUpdates(_0x3030a3,_0x5ae4c4){return function(_0x2a6554){if(_0x2a6554){return _0x2a6554[_0x96f4('0x21')](_0x3030a3)['then'](function(_0x9e7762){return _0x9e7762;});}return null;};}function removeEntity(_0x56483f,_0x513d6d){return function(_0x1fc308){if(_0x1fc308){return _0x1fc308[_0x96f4('0x22')]()[_0x96f4('0x23')](function(){_0x56483f[_0x96f4('0x16')](0xcc)[_0x96f4('0x17')]();});}};}function handleEntityNotFound(_0x3cd656,_0x5c992d){return function(_0x287f36){if(!_0x287f36){_0x3cd656[_0x96f4('0x24')](0x194);}return _0x287f36;};}function handleError(_0x215ada,_0x399157){_0x399157=_0x399157||0x1f4;return function(_0x48a4a7){logger[_0x96f4('0x25')](_0x48a4a7[_0x96f4('0x26')]);if(_0x48a4a7[_0x96f4('0x27')]){delete _0x48a4a7[_0x96f4('0x27')];}_0x215ada[_0x96f4('0x16')](_0x399157)['send'](_0x48a4a7);};}exports[_0x96f4('0x28')]=function(_0xff2057,_0xd3571a){var _0x1db8fb={'raw':!![],'where':{'id':_0xff2057[_0x96f4('0x29')]['id']}},_0x29de6d={};_0x29de6d[_0x96f4('0x2a')]=_['keys'](db[_0x96f4('0x2b')][_0x96f4('0x2c')]);_0x29de6d['query']=_[_0x96f4('0x2d')](_0xff2057[_0x96f4('0x2e')]);_0x29de6d[_0x96f4('0x2f')]=_[_0x96f4('0x30')](_0x29de6d[_0x96f4('0x2a')],_0x29de6d[_0x96f4('0x2e')]);_0x1db8fb['attributes']=_['intersection'](_0x29de6d[_0x96f4('0x2a')],qs[_0x96f4('0x31')](_0xff2057[_0x96f4('0x2e')][_0x96f4('0x31')]));_0x1db8fb[_0x96f4('0x32')]=_0x1db8fb[_0x96f4('0x32')][_0x96f4('0x33')]?_0x1db8fb[_0x96f4('0x32')]:_0x29de6d[_0x96f4('0x2a')];if(_0xff2057['query'][_0x96f4('0x34')]){_0x1db8fb[_0x96f4('0x35')]=[{'all':!![]}];}_0x1db8fb=_[_0x96f4('0x36')]({},_0x1db8fb,_0xff2057['options']);return db['ChatProactiveAction'][_0x96f4('0x37')](_0x1db8fb)[_0x96f4('0x23')](handleEntityNotFound(_0xd3571a,null))[_0x96f4('0x23')](respondWithResult(_0xd3571a,null))[_0x96f4('0x38')](handleError(_0xd3571a,null));};exports[_0x96f4('0x39')]=function(_0x129950,_0x376faf){return db[_0x96f4('0x2b')][_0x96f4('0x39')](_0x129950['body'],{})[_0x96f4('0x23')](respondWithResult(_0x376faf,0xc9))['catch'](handleError(_0x376faf,null));};exports[_0x96f4('0x21')]=function(_0x3ed56e,_0x4df1b0){if(_0x3ed56e[_0x96f4('0x3a')]['id']){delete _0x3ed56e['body']['id'];}return db['ChatProactiveAction'][_0x96f4('0x37')]({'where':{'id':_0x3ed56e['params']['id']}})[_0x96f4('0x23')](handleEntityNotFound(_0x4df1b0,null))[_0x96f4('0x23')](saveUpdates(_0x3ed56e[_0x96f4('0x3a')],null))[_0x96f4('0x23')](respondWithResult(_0x4df1b0,null))[_0x96f4('0x38')](handleError(_0x4df1b0,null));};exports[_0x96f4('0x22')]=function(_0x237db0,_0x7e213c){return db[_0x96f4('0x2b')]['find']({'where':{'id':_0x237db0['params']['id']}})[_0x96f4('0x23')](handleEntityNotFound(_0x7e213c,null))[_0x96f4('0x23')](removeEntity(_0x7e213c,null))[_0x96f4('0x38')](handleError(_0x7e213c,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 3b0189b..b833f2e 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 _0x2032=['chat_proactive_actions','util','../../config/logger','api','bluebird','request-promise','exports','define','ChatProactiveAction'];(function(_0x12bbf8,_0x36413c){var _0x5d81b1=function(_0x19dba5){while(--_0x19dba5){_0x12bbf8['push'](_0x12bbf8['shift']());}};_0x5d81b1(++_0x36413c);}(_0x2032,0xd9));var _0x2203=function(_0x19988d,_0x1cc4c3){_0x19988d=_0x19988d-0x0;var _0x12def0=_0x2032[_0x19988d];return _0x12def0;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var attributes=require('./chatProactiveAction.attributes');module[_0x2203('0x5')]=function(_0x880dcd,_0x44ccfd){return _0x880dcd[_0x2203('0x6')](_0x2203('0x7'),attributes,{'tableName':_0x2203('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0295=['lodash','api','request-promise','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x143ce6,_0x46e089){var _0x33ed64=function(_0x5a6856){while(--_0x5a6856){_0x143ce6['push'](_0x143ce6['shift']());}};_0x33ed64(++_0x46e089);}(_0x0295,0x1f0));var _0x5029=function(_0x52bcbd,_0x8dcc55){_0x52bcbd=_0x52bcbd-0x0;var _0x2c4072=_0x0295[_0x52bcbd];return _0x2c4072;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var attributes=require(_0x5029('0x3'));module[_0x5029('0x4')]=function(_0x3d0af1,_0x170504){return _0x3d0af1[_0x5029('0x5')](_0x5029('0x6'),attributes,{'tableName':_0x5029('0x7'),'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 e2d40f5..022e785 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 _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(_0x32f250,_0x1fbca3){var _0x39ead3=function(_0x7e79d6){while(--_0x7e79d6){_0x32f250['push'](_0x32f250['shift']());}};_0x39ead3(++_0x1fbca3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 +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(_0x4d962c,_0xa82958){var _0x55d951=function(_0x51621e){while(--_0x51621e){_0x4d962c['push'](_0x4d962c['shift']());}};_0x55d951(++_0xa82958);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 85d5c50..5a0a3f0 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 _0x235b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x148084,_0x6282d6){var _0x2f764a=function(_0x3f124a){while(--_0x3f124a){_0x148084['push'](_0x148084['shift']());}};_0x2f764a(++_0x6282d6);}(_0x235b,0x1ed));var _0xb235=function(_0xd86335,_0xd90bf9){_0xd86335=_0xd86335-0x0;var _0x1be0e8=_0x235b[_0xd86335];return _0x1be0e8;};'use strict';var multer=require(_0xb235('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb235('0x1'));var express=require(_0xb235('0x2'));var router=express[_0xb235('0x3')]();var auth=require(_0xb235('0x4'));var interaction=require(_0xb235('0x5'));var config=require(_0xb235('0x6'));var controller=require('./chatProactiveAction.controller');router[_0xb235('0x7')](_0xb235('0x8'),auth[_0xb235('0x9')](),controller['show']);router[_0xb235('0xa')]('/',auth[_0xb235('0x9')](),controller[_0xb235('0xb')]);router[_0xb235('0xc')](_0xb235('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xb235('0xd')](_0xb235('0x8'),auth[_0xb235('0x9')](),controller[_0xb235('0xe')]);module[_0xb235('0xf')]=router; \ No newline at end of file +var _0xe6e4=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','show','post','create','put','/:id','isAuthenticated'];(function(_0x311187,_0x19cf65){var _0x14d5d0=function(_0x23e614){while(--_0x23e614){_0x311187['push'](_0x311187['shift']());}};_0x14d5d0(++_0x19cf65);}(_0xe6e4,0xc1));var _0x4e6e=function(_0x1f3ca1,_0x35f925){_0x1f3ca1=_0x1f3ca1-0x0;var _0x243ec7=_0xe6e4[_0x1f3ca1];return _0x243ec7;};'use strict';var multer=require(_0x4e6e('0x0'));var util=require(_0x4e6e('0x1'));var path=require(_0x4e6e('0x2'));var timeout=require(_0x4e6e('0x3'));var express=require(_0x4e6e('0x4'));var router=express[_0x4e6e('0x5')]();var auth=require(_0x4e6e('0x6'));var interaction=require(_0x4e6e('0x7'));var config=require(_0x4e6e('0x8'));var controller=require('./chatProactiveAction.controller');router[_0x4e6e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4e6e('0xa')]);router[_0x4e6e('0xb')]('/',auth['isAuthenticated'](),controller[_0x4e6e('0xc')]);router[_0x4e6e('0xd')](_0x4e6e('0xe'),auth[_0x4e6e('0xf')](),controller[_0x4e6e('0x10')]);router['delete'](_0x4e6e('0xe'),auth[_0x4e6e('0xf')](),controller[_0x4e6e('0x11')]);module[_0x4e6e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 0f0b36a..b5b29c1 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 _0xb090=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x35a553,_0x26a6ec){var _0x1591b8=function(_0xa595a5){while(--_0xa595a5){_0x35a553['push'](_0x35a553['shift']());}};_0x1591b8(++_0x26a6ec);}(_0xb090,0xd9));var _0x0b09=function(_0x2215c8,_0x32ea49){_0x2215c8=_0x2215c8-0x0;var _0x2d8d10=_0xb090[_0x2215c8];return _0x2d8d10;};'use strict';var Sequelize=require(_0x0b09('0x0'));module[_0x0b09('0x1')]={'name':{'type':Sequelize[_0x0b09('0x2')],'unique':_0x0b09('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0b09('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b09('0x4')](_0x0b09('0x5'),_0x0b09('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xc9ca=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x5031c8,_0x522b8a){var _0x1b1e66=function(_0x1c36e8){while(--_0x1c36e8){_0x5031c8['push'](_0x5031c8['shift']());}};_0x1b1e66(++_0x522b8a);}(_0xc9ca,0x1ea));var _0xac9c=function(_0x599aaf,_0x3d3622){_0x599aaf=_0x599aaf-0x0;var _0xd995f3=_0xc9ca[_0x599aaf];return _0xd995f3;};'use strict';var Sequelize=require('sequelize');module[_0xac9c('0x0')]={'name':{'type':Sequelize[_0xac9c('0x1')],'unique':_0xac9c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac9c('0x1')]},'timeout':{'type':Sequelize[_0xac9c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xac9c('0x4')](_0xac9c('0x5'),'beepall',_0xac9c('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 6f826e3..37eba4e 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 _0x7729=['../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','name','index','ChatQueue','rawAttributes','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','field','merge','count','includeAll','include','findAll','rows','params','length','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','addAgents','penalty','addTeams','removeTeams','emit','userChatQueue:save','removeAgents','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','ioredis'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7729,0x66));var _0x9772=function(_0x3d6030,_0x20d669){_0x3d6030=_0x3d6030-0x0;var _0xa1f111=_0x7729[_0x3d6030];return _0xa1f111;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9772('0x0'));var zipdir=require(_0x9772('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9772('0x2'));var moment=require(_0x9772('0x3'));var BPromise=require(_0x9772('0x4'));var Mustache=require(_0x9772('0x5'));var util=require(_0x9772('0x6'));var path=require(_0x9772('0x7'));var sox=require(_0x9772('0x8'));var csv=require(_0x9772('0x9'));var ejs=require(_0x9772('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9772('0xb'));var crypto=require(_0x9772('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9772('0xd'));var toCsv=require(_0x9772('0x9'));var querystring=require(_0x9772('0xe'));var Papa=require(_0x9772('0xf'));var authService=require(_0x9772('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9772('0x11'));var qs=require(_0x9772('0x12'));var logger=require('../../config/logger')(_0x9772('0x13'));var utils=require(_0x9772('0x14'));var config=require(_0x9772('0x15'));var db=require(_0x9772('0x16'))['db'];config[_0x9772('0x17')]=_[_0x9772('0x18')](config[_0x9772('0x17')],{'host':_0x9772('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x9772('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9772('0x1b')][_0x9772('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x288095,_0x1565fd,_0x5d1ffc,_0x58f92d){return new BPromise(function(_0x1e837b,_0x5eda84){var _0x261b18=_0x58f92d||client;return _0x261b18[_0x9772('0x1d')](_0x288095,_0x5d1ffc)[_0x9772('0x1e')](function(_0x3656e4){logger[_0x9772('0x1f')](_0x9772('0x20'),_0x1565fd,'request\x20sent');logger['debug'](_0x9772('0x21'),_0x1565fd,_0x9772('0x22'),JSON[_0x9772('0x23')](_0x3656e4));if(_0x3656e4[_0x9772('0x24')]){if(_0x3656e4[_0x9772('0x24')][_0x9772('0x25')]===0x1f4){logger[_0x9772('0x24')](_0x9772('0x20'),_0x1565fd,_0x3656e4[_0x9772('0x24')][_0x9772('0x26')]);return _0x5eda84(_0x3656e4[_0x9772('0x24')]['message']);}logger[_0x9772('0x24')](_0x9772('0x20'),_0x1565fd,_0x3656e4['error'][_0x9772('0x26')]);return _0x1e837b(_0x3656e4['error'][_0x9772('0x26')]);}else{logger['info'](_0x9772('0x20'),_0x1565fd,_0x9772('0x22'));_0x1e837b(_0x3656e4['result']['message']);}})[_0x9772('0x27')](function(_0x572060){logger[_0x9772('0x24')](_0x9772('0x20'),_0x1565fd,_0x572060);_0x5eda84(_0x572060);});});}function respondWithStatusCode(_0x6431eb,_0x4f8c8f){_0x4f8c8f=_0x4f8c8f||0xcc;return function(_0x3f7af6){if(_0x3f7af6){return _0x6431eb[_0x9772('0x28')](_0x4f8c8f);}return _0x6431eb[_0x9772('0x29')](_0x4f8c8f)[_0x9772('0x2a')]();};}function respondWithResult(_0xc57761,_0x248f3d){_0x248f3d=_0x248f3d||0xc8;return function(_0xd1d616){if(_0xd1d616){return _0xc57761['status'](_0x248f3d)['json'](_0xd1d616);}};}function respondWithFilteredResult(_0x10ab50,_0x1ffc1b){return function(_0x32239c){if(_0x32239c){var _0x5bb49a=_0x32239c['count'],_0x4d40fb=_0x1ffc1b[_0x9772('0x2b')],_0x512af3=_0x1ffc1b[_0x9772('0x2b')]+_0x1ffc1b[_0x9772('0x2c')],_0x4003e9;if(_0x512af3>=_0x5bb49a){_0x512af3=_0x5bb49a;_0x4003e9=0xc8;}else{_0x4003e9=0xce;}_0x10ab50['status'](_0x4003e9);return _0x10ab50['set'](_0x9772('0x2d'),_0x4d40fb+'-'+_0x512af3+'/'+_0x5bb49a)[_0x9772('0x2e')](_0x32239c);}return null;};}function patchUpdates(_0x4de186){return function(_0x408b41){try{jsonpatch[_0x9772('0x2f')](_0x408b41,_0x4de186,!![]);}catch(_0x1d6768){return BPromise[_0x9772('0x30')](_0x1d6768);}return _0x408b41['save']();};}function saveUpdates(_0x3a9189,_0x1a34f5){return function(_0x322e36){if(_0x322e36){return _0x322e36[_0x9772('0x31')](_0x3a9189)['then'](function(_0xe7fb29){return _0xe7fb29;});}return null;};}function removeEntity(_0x5ab25f,_0x112e83){return function(_0x41d929){if(_0x41d929){return _0x41d929[_0x9772('0x32')]()[_0x9772('0x1e')](function(){var _0x43bec6=_0x41d929[_0x9772('0x33')]({'plain':!![]});var _0x4c9105=_0x9772('0x34');return db[_0x9772('0x35')][_0x9772('0x32')]({'where':{'type':_0x4c9105,'resourceId':_0x43bec6['id']}})[_0x9772('0x1e')](function(){return _0x41d929;});})[_0x9772('0x1e')](function(){_0x5ab25f[_0x9772('0x29')](0xcc)[_0x9772('0x2a')]();});}};}function handleEntityNotFound(_0x1a0ab2,_0x8ead65){return function(_0x21856c){if(!_0x21856c){_0x1a0ab2['sendStatus'](0x194);}return _0x21856c;};}function handleError(_0x462f9e,_0x59878a){_0x59878a=_0x59878a||0x1f4;return function(_0x8a39a7){logger['error'](_0x8a39a7['stack']);if(_0x8a39a7[_0x9772('0x36')]){delete _0x8a39a7[_0x9772('0x36')];}_0x462f9e[_0x9772('0x29')](_0x59878a)['send'](_0x8a39a7);};}exports[_0x9772('0x37')]=function(_0x4c291b,_0x92a11d){var _0x2be59e={},_0x47206f={},_0x349904={'count':0x0,'rows':[]};var _0xa46c07=db[_0x9772('0x38')][_0x9772('0x39')];_0x47206f[_0x9772('0x3a')]=_[_0x9772('0x3b')](_0xa46c07);_0x47206f['query']=_[_0x9772('0x3b')](_0x4c291b['query']);_0x47206f[_0x9772('0x3c')]=_[_0x9772('0x3d')](_0x47206f[_0x9772('0x3a')],_0x47206f[_0x9772('0x3e')]);_0x2be59e[_0x9772('0x3f')]=_['intersection'](_0x47206f[_0x9772('0x3a')],qs['fields'](_0x4c291b[_0x9772('0x3e')][_0x9772('0x40')]));_0x2be59e[_0x9772('0x3f')]=_0x2be59e[_0x9772('0x3f')]['length']?_0x2be59e[_0x9772('0x3f')]:_0x47206f['model'];if(!_0x4c291b[_0x9772('0x3e')][_0x9772('0x41')](_0x9772('0x42'))){_0x2be59e['limit']=qs[_0x9772('0x2c')](_0x4c291b[_0x9772('0x3e')][_0x9772('0x2c')]);_0x2be59e[_0x9772('0x2b')]=qs[_0x9772('0x2b')](_0x4c291b[_0x9772('0x3e')][_0x9772('0x2b')]);}_0x2be59e[_0x9772('0x43')]=qs[_0x9772('0x44')](_0x4c291b['query'][_0x9772('0x44')]);_0x2be59e[_0x9772('0x45')]=qs[_0x9772('0x3c')](_[_0x9772('0x46')](_0x4c291b['query'],_0x47206f['filters']));if(_0x4c291b[_0x9772('0x3e')][_0x9772('0x47')]){_0x2be59e[_0x9772('0x45')]=_['merge'](_0x2be59e[_0x9772('0x45')],{'$or':_[_0x9772('0x48')](_0xa46c07,function(_0x1fd952){if(_0x1fd952[_0x9772('0x49')]['key']!=='VIRTUAL'){var _0xe9a838={};_0xe9a838[_0x1fd952[_0x9772('0x4a')]]={'$like':'%'+_0x4c291b['query']['filter']+'%'};return _0xe9a838;}})});}_0x2be59e=_[_0x9772('0x4b')]({},_0x2be59e,_0x4c291b['options']);var _0x54cca8={'where':_0x2be59e[_0x9772('0x45')]};return db['ChatQueue'][_0x9772('0x4c')](_0x54cca8)[_0x9772('0x1e')](function(_0x54fddc){_0x349904[_0x9772('0x4c')]=_0x54fddc;if(_0x4c291b[_0x9772('0x3e')][_0x9772('0x4d')]){_0x2be59e[_0x9772('0x4e')]=[{'all':!![]}];}return db[_0x9772('0x38')][_0x9772('0x4f')](_0x2be59e);})[_0x9772('0x1e')](function(_0x376b10){_0x349904[_0x9772('0x50')]=_0x376b10;return _0x349904;})['then'](respondWithFilteredResult(_0x92a11d,_0x2be59e))[_0x9772('0x27')](handleError(_0x92a11d,null));};exports['show']=function(_0x1b274e,_0x13cad8){var _0x226707={'raw':!![],'where':{'id':_0x1b274e[_0x9772('0x51')]['id']}},_0x54d2ea={};_0x54d2ea[_0x9772('0x3a')]=_[_0x9772('0x3b')](db[_0x9772('0x38')][_0x9772('0x39')]);_0x54d2ea[_0x9772('0x3e')]=_['keys'](_0x1b274e[_0x9772('0x3e')]);_0x54d2ea[_0x9772('0x3c')]=_[_0x9772('0x3d')](_0x54d2ea[_0x9772('0x3a')],_0x54d2ea['query']);_0x226707[_0x9772('0x3f')]=_['intersection'](_0x54d2ea['model'],qs[_0x9772('0x40')](_0x1b274e[_0x9772('0x3e')][_0x9772('0x40')]));_0x226707[_0x9772('0x3f')]=_0x226707[_0x9772('0x3f')][_0x9772('0x52')]?_0x226707['attributes']:_0x54d2ea[_0x9772('0x3a')];if(_0x1b274e['query'][_0x9772('0x4d')]){_0x226707['include']=[{'all':!![]}];}_0x226707=_[_0x9772('0x4b')]({},_0x226707,_0x1b274e[_0x9772('0x53')]);return db[_0x9772('0x38')]['find'](_0x226707)[_0x9772('0x1e')](handleEntityNotFound(_0x13cad8,null))[_0x9772('0x1e')](respondWithResult(_0x13cad8,null))[_0x9772('0x27')](handleError(_0x13cad8,null));};exports['create']=function(_0x2c113f,_0x299564){return db[_0x9772('0x38')][_0x9772('0x54')](_0x2c113f['body'],{})[_0x9772('0x1e')](function(_0x542519){var _0x4a78f5=_0x2c113f[_0x9772('0x55')][_0x9772('0x33')]({'plain':!![]});if(!_0x4a78f5)throw new Error(_0x9772('0x56'));if(_0x4a78f5[_0x9772('0x57')]==='user'){var _0x2ec40b=_0x542519[_0x9772('0x33')]({'plain':!![]});var _0x43a2b1=_0x9772('0x34');return db[_0x9772('0x58')][_0x9772('0x59')]({'where':{'name':_0x43a2b1,'userProfileId':_0x4a78f5[_0x9772('0x5a')]},'raw':!![]})[_0x9772('0x1e')](function(_0x113e8a){if(_0x113e8a&&_0x113e8a['autoAssociation']===0x0){return db[_0x9772('0x35')][_0x9772('0x54')]({'name':_0x2ec40b[_0x9772('0x36')],'resourceId':_0x2ec40b['id'],'type':_0x113e8a[_0x9772('0x36')],'sectionId':_0x113e8a['id']},{})[_0x9772('0x1e')](function(){return _0x542519;});}else{return _0x542519;}})['catch'](function(_0x2f4e4a){logger[_0x9772('0x24')](_0x9772('0x5b'),_0x2f4e4a);throw _0x2f4e4a;});}return _0x542519;})[_0x9772('0x1e')](respondWithResult(_0x299564,0xc9))[_0x9772('0x27')](handleError(_0x299564,null));};exports['update']=function(_0x4d9eea,_0x58e104){if(_0x4d9eea[_0x9772('0x5c')]['id']){delete _0x4d9eea[_0x9772('0x5c')]['id'];}return db[_0x9772('0x38')][_0x9772('0x59')]({'where':{'id':_0x4d9eea['params']['id']}})[_0x9772('0x1e')](handleEntityNotFound(_0x58e104,null))['then'](saveUpdates(_0x4d9eea[_0x9772('0x5c')],null))['then'](respondWithResult(_0x58e104,null))[_0x9772('0x27')](handleError(_0x58e104,null));};exports[_0x9772('0x32')]=function(_0x471d78,_0x16ac78){return db['ChatQueue'][_0x9772('0x59')]({'where':{'id':_0x471d78[_0x9772('0x51')]['id']}})[_0x9772('0x1e')](handleEntityNotFound(_0x16ac78,null))[_0x9772('0x1e')](removeEntity(_0x16ac78,null))[_0x9772('0x27')](handleError(_0x16ac78,null));};exports['describe']=function(_0x2ae103,_0x1cbf3a){return db[_0x9772('0x38')][_0x9772('0x5d')]()['then'](respondWithResult(_0x1cbf3a,null))[_0x9772('0x27')](handleError(_0x1cbf3a,null));};exports[_0x9772('0x5e')]=function(_0x2f878b,_0x27a0ed,_0x2b7716){var _0x1bc436={'raw':!![],'where':{}},_0x17ee60={},_0x262fb0;return db[_0x9772('0x38')][_0x9772('0x5f')]({'where':{'id':_0x2f878b[_0x9772('0x51')]['id']}})[_0x9772('0x1e')](handleEntityNotFound(_0x27a0ed,null))[_0x9772('0x1e')](function(_0x4ba6a4){if(_0x4ba6a4){_0x262fb0=_0x4ba6a4[_0x9772('0x33')]({'plain':!![]});_0x17ee60[_0x9772('0x3a')]=_[_0x9772('0x3b')](db[_0x9772('0x60')][_0x9772('0x39')]);_0x17ee60['query']=_[_0x9772('0x3b')](_0x2f878b[_0x9772('0x3e')]);_0x17ee60[_0x9772('0x3c')]=_[_0x9772('0x3d')](_0x17ee60['model'],_0x17ee60[_0x9772('0x3e')]);_0x1bc436[_0x9772('0x3f')]=_[_0x9772('0x3d')](_0x17ee60['model'],qs['fields'](_0x2f878b[_0x9772('0x3e')][_0x9772('0x40')]));_0x1bc436[_0x9772('0x3f')]=_0x1bc436[_0x9772('0x3f')][_0x9772('0x52')]?_0x1bc436[_0x9772('0x3f')]:_0x17ee60[_0x9772('0x3a')];if(!_0x2f878b[_0x9772('0x3e')][_0x9772('0x41')](_0x9772('0x42'))){_0x1bc436[_0x9772('0x2c')]=qs['limit'](_0x2f878b[_0x9772('0x3e')][_0x9772('0x2c')]);_0x1bc436[_0x9772('0x2b')]=qs[_0x9772('0x2b')](_0x2f878b[_0x9772('0x3e')][_0x9772('0x2b')]);}_0x1bc436[_0x9772('0x43')]=qs['sort'](_0x2f878b[_0x9772('0x3e')][_0x9772('0x44')]);_0x1bc436[_0x9772('0x45')]=qs['filters'](_['pick'](_0x2f878b[_0x9772('0x3e')],_0x17ee60[_0x9772('0x3c')]));_0x1bc436[_0x9772('0x45')][_0x9772('0x61')]=_0x4ba6a4['id'];if(_0x2f878b[_0x9772('0x3e')][_0x9772('0x47')]){_0x1bc436[_0x9772('0x45')]=_[_0x9772('0x4b')](_0x1bc436[_0x9772('0x45')],{'$or':_[_0x9772('0x48')](_0x1bc436[_0x9772('0x3f')],function(_0x4800af){var _0x3f50a1={};_0x3f50a1[_0x4800af]={'$like':'%'+_0x2f878b[_0x9772('0x3e')]['filter']+'%'};return _0x3f50a1;})});}_0x1bc436=_[_0x9772('0x4b')]({},_0x1bc436,_0x2f878b[_0x9772('0x53')]);return db[_0x9772('0x60')][_0x9772('0x4f')](_0x1bc436);}})[_0x9772('0x1e')](function(_0x11d0b1){if(_0x11d0b1){return db[_0x9772('0x62')][_0x9772('0x63')]({'where':{'id':_[_0x9772('0x48')](_0x11d0b1,'UserId'),'role':_0x9772('0x64')},'attributes':['id','name','chatPause',_0x9772('0x65'),_0x9772('0x66')]});}})['then'](function(_0x5c02fc){if(_0x5c02fc){return{'count':_0x5c02fc[_0x9772('0x4c')],'rows':_[_0x9772('0x48')](_0x5c02fc[_0x9772('0x50')],function(_0x156638){return{'membername':_0x156638[_0x9772('0x36')],'UserId':_0x156638['id'],'queue_name':_0x262fb0[_0x9772('0x36')],'ChatQueueId':_0x262fb0['id'],'interface':util[_0x9772('0x67')](_0x9772('0x68'),_0x9772('0x69'),_0x156638[_0x9772('0x36')]),'penalty':0x0,'paused':_0x156638['chatPause'],'createdAt':_0x156638[_0x9772('0x66')],'updatedAt':_0x156638['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9772('0x1e')](respondWithFilteredResult(_0x27a0ed,_0x1bc436))['catch'](handleError(_0x27a0ed,null));};exports[_0x9772('0x6a')]=function(_0x4f00e6,_0x3b9183,_0x9a51df){var _0x4efcf7={};var _0x54025e={};var _0xf0a9a0;var _0x539319;return db[_0x9772('0x38')][_0x9772('0x5f')]({'where':{'id':_0x4f00e6['params']['id']}})[_0x9772('0x1e')](handleEntityNotFound(_0x3b9183,null))[_0x9772('0x1e')](function(_0x5ca9c1){if(_0x5ca9c1){_0xf0a9a0=_0x5ca9c1;_0x54025e[_0x9772('0x3a')]=_[_0x9772('0x3b')](db[_0x9772('0x6b')][_0x9772('0x39')]);_0x54025e[_0x9772('0x3e')]=_[_0x9772('0x3b')](_0x4f00e6[_0x9772('0x3e')]);_0x54025e['filters']=_[_0x9772('0x3d')](_0x54025e[_0x9772('0x3a')],_0x54025e[_0x9772('0x3e')]);_0x4efcf7['attributes']=_['intersection'](_0x54025e['model'],qs[_0x9772('0x40')](_0x4f00e6[_0x9772('0x3e')][_0x9772('0x40')]));_0x4efcf7['attributes']=_0x4efcf7[_0x9772('0x3f')][_0x9772('0x52')]?_0x4efcf7[_0x9772('0x3f')]:_0x54025e[_0x9772('0x3a')];_0x4efcf7[_0x9772('0x43')]=qs[_0x9772('0x44')](_0x4f00e6[_0x9772('0x3e')][_0x9772('0x44')]);_0x4efcf7['where']=qs[_0x9772('0x3c')](_[_0x9772('0x46')](_0x4f00e6[_0x9772('0x3e')],_0x54025e[_0x9772('0x3c')]));if(_0x4f00e6['query'][_0x9772('0x47')]){_0x4efcf7[_0x9772('0x45')]=_['merge'](_0x4efcf7['where'],{'$or':_['map'](_0x4efcf7['attributes'],function(_0x3c4d1c){var _0x5af4fa={};_0x5af4fa[_0x3c4d1c]={'$like':'%'+_0x4f00e6[_0x9772('0x3e')][_0x9772('0x47')]+'%'};return _0x5af4fa;})});}_0x4efcf7=_[_0x9772('0x4b')]({},_0x4efcf7,_0x4f00e6['options']);return _0xf0a9a0[_0x9772('0x6a')](_0x4efcf7);}})[_0x9772('0x1e')](function(_0x5af14c){if(_0x5af14c){_0x539319=_0x5af14c['length'];if(!_0x4f00e6[_0x9772('0x3e')][_0x9772('0x41')](_0x9772('0x42'))){_0x4efcf7[_0x9772('0x2c')]=qs[_0x9772('0x2c')](_0x4f00e6[_0x9772('0x3e')][_0x9772('0x2c')]);_0x4efcf7[_0x9772('0x2b')]=qs['offset'](_0x4f00e6[_0x9772('0x3e')]['offset']);}return _0xf0a9a0[_0x9772('0x6a')](_0x4efcf7);}})[_0x9772('0x1e')](function(_0x58fe6e){if(_0x58fe6e){return _0x58fe6e?{'count':_0x539319,'rows':_0x58fe6e}:null;}})['then'](respondWithResult(_0x3b9183,null))[_0x9772('0x27')](handleError(_0x3b9183,null));};exports['addTeams']=function(_0x5c95a6,_0x51e9cd,_0x93e77c){var _0x16c2e5=[];var _0x18b0ed;return db[_0x9772('0x6b')][_0x9772('0x4f')]({'where':{'id':_0x5c95a6[_0x9772('0x5c')][_0x9772('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](function(_0xb464a4){if(_0xb464a4){for(var _0x546188=0x0;_0x546188<_0xb464a4['length'];_0x546188+=0x1){for(var _0x51e686=0x0;_0x51e686<_0xb464a4[_0x546188][_0x9772('0x6d')][_0x9772('0x52')];_0x51e686+=0x1){_0x16c2e5=_['union'](_0x16c2e5,[_0xb464a4[_0x546188][_0x9772('0x6d')][_0x51e686]['id']]);}}return _0x16c2e5;}})[_0x9772('0x1e')](function(_0x46e9ff){if(_0x46e9ff){return db[_0x9772('0x38')]['find']({'where':{'id':_0x5c95a6['params']['id']}});}})[_0x9772('0x1e')](function(_0x564b89){if(_0x564b89){_0x18b0ed=_0x564b89;return _0x18b0ed[_0x9772('0x6e')](_0x16c2e5,{'penalty':_0x5c95a6[_0x9772('0x5c')][_0x9772('0x6f')]});}})[_0x9772('0x1e')](function(_0x2896a5){if(_0x2896a5){return _0x18b0ed[_0x9772('0x70')](_0x5c95a6['body']['ids']);}})[_0x9772('0x1e')](handleEntityNotFound(_0x51e9cd,null))['then'](respondWithStatusCode(_0x51e9cd,null))['catch'](handleError(_0x51e9cd,null));};exports[_0x9772('0x71')]=function(_0x19f470,_0x3954b6,_0x15144f){var _0x208e5d=[];var _0x488cbd;return db[_0x9772('0x6b')]['findAll']({'where':{'id':_0x19f470['query'][_0x9772('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x9772('0x62')],'as':_0x9772('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x9772('0x1e')](function(_0x291153){if(_0x291153){for(var _0x85cf74=0x0;_0x85cf74<_0x291153[_0x9772('0x52')];_0x85cf74+=0x1){for(var _0x4418b4=0x0;_0x4418b4<_0x291153[_0x85cf74][_0x9772('0x6d')]['length'];_0x4418b4+=0x1){_0x208e5d=_['union'](_0x208e5d,[_0x291153[_0x85cf74]['Agents'][_0x4418b4]['id']]);}}return _0x208e5d;}})[_0x9772('0x1e')](function(_0x3993fc){if(_0x3993fc){return db[_0x9772('0x38')]['find']({'where':{'id':_0x19f470[_0x9772('0x51')]['id']}});}})[_0x9772('0x1e')](function(_0x568785){if(_0x568785){_0x488cbd=_0x568785;return _0x488cbd['removeAgents'](_0x208e5d);}})[_0x9772('0x1e')](function(_0x24af79){if(_0x488cbd){return _0x488cbd[_0x9772('0x71')](_0x19f470[_0x9772('0x3e')][_0x9772('0x6c')]);}})[_0x9772('0x1e')](handleEntityNotFound(_0x3954b6,null))[_0x9772('0x1e')](respondWithStatusCode(_0x3954b6,null))['catch'](handleError(_0x3954b6,null));};exports[_0x9772('0x6e')]=function(_0x233219,_0x4ee1b1,_0x16e8c6){return db[_0x9772('0x38')][_0x9772('0x59')]({'where':{'id':_0x233219[_0x9772('0x51')]['id']}})[_0x9772('0x1e')](handleEntityNotFound(_0x4ee1b1,null))[_0x9772('0x1e')](function(_0x4ced47){if(_0x4ced47){return _0x4ced47[_0x9772('0x6e')](_0x233219[_0x9772('0x5c')][_0x9772('0x6c')],_['omit'](_0x233219[_0x9772('0x5c')],[_0x9772('0x6c'),'id'])||{})['spread'](function(_0x2d9e3){for(var _0x949874=0x0;_0x949874<_0x233219[_0x9772('0x5c')][_0x9772('0x6c')]['length'];_0x949874+=0x1){socket[_0x9772('0x72')](_0x9772('0x73'),{'UserId':_0x233219[_0x9772('0x5c')][_0x9772('0x6c')][_0x949874],'ChatQueueId':_0x233219[_0x9772('0x51')]['id']});}return _0x2d9e3;});}})[_0x9772('0x1e')](respondWithResult(_0x4ee1b1,null))['catch'](handleError(_0x4ee1b1,null));};exports[_0x9772('0x74')]=function(_0x38ed61,_0x16055e,_0x33213d){var _0x58290d;return db[_0x9772('0x38')]['find']({'where':{'id':_0x38ed61[_0x9772('0x51')]['id']}})[_0x9772('0x1e')](handleEntityNotFound(_0x16055e,null))[_0x9772('0x1e')](function(_0x4b8495){if(_0x4b8495){return _0x4b8495['removeAgents'](_0x38ed61[_0x9772('0x3e')][_0x9772('0x6c')])['then'](function(_0x18b129){if(_[_0x9772('0x75')](_0x38ed61[_0x9772('0x3e')][_0x9772('0x6c')])){for(var _0x3a3ad8=0x0;_0x3a3ad8<_0x38ed61[_0x9772('0x3e')][_0x9772('0x6c')][_0x9772('0x52')];_0x3a3ad8+=0x1){socket[_0x9772('0x72')](_0x9772('0x76'),{'UserId':_0x38ed61[_0x9772('0x3e')][_0x9772('0x6c')][_0x3a3ad8],'ChatQueueId':_0x38ed61['params']['id']});}}else{socket[_0x9772('0x72')](_0x9772('0x76'),{'UserId':_0x38ed61[_0x9772('0x3e')][_0x9772('0x6c')],'ChatQueueId':_0x38ed61['params']['id']});}});}})[_0x9772('0x1e')](respondWithStatusCode(_0x16055e,null))[_0x9772('0x27')](handleError(_0x16055e,null));};exports[_0x9772('0x77')]=function(_0x468951,_0x1cd5f6,_0x2b4be3){var _0xe5426d={};var _0x1d576b={};var _0xa377c9;var _0x56010e;return db['ChatQueue'][_0x9772('0x5f')]({'where':{'id':_0x468951['params']['id']}})[_0x9772('0x1e')](handleEntityNotFound(_0x1cd5f6,null))[_0x9772('0x1e')](function(_0x3bd92f){if(_0x3bd92f){_0xa377c9=_0x3bd92f;_0x1d576b[_0x9772('0x3a')]=_[_0x9772('0x3b')](db[_0x9772('0x62')][_0x9772('0x39')]);_0x1d576b[_0x9772('0x3e')]=_[_0x9772('0x3b')](_0x468951['query']);_0x1d576b[_0x9772('0x3c')]=_['intersection'](_0x1d576b['model'],_0x1d576b[_0x9772('0x3e')]);_0xe5426d['attributes']=_['intersection'](_0x1d576b['model'],qs[_0x9772('0x40')](_0x468951['query'][_0x9772('0x40')]));_0xe5426d['attributes']=_0xe5426d[_0x9772('0x3f')][_0x9772('0x52')]?_0xe5426d[_0x9772('0x3f')]:_0x1d576b[_0x9772('0x3a')];_0xe5426d[_0x9772('0x43')]=qs[_0x9772('0x44')](_0x468951[_0x9772('0x3e')][_0x9772('0x44')]);_0xe5426d['where']=qs['filters'](_[_0x9772('0x46')](_0x468951['query'],_0x1d576b[_0x9772('0x3c')]));if(_0x468951[_0x9772('0x3e')][_0x9772('0x47')]){_0xe5426d[_0x9772('0x45')]=_[_0x9772('0x4b')](_0xe5426d[_0x9772('0x45')],{'$or':_['map'](_0xe5426d['attributes'],function(_0x3fcefb){var _0x58a271={};_0x58a271[_0x3fcefb]={'$like':'%'+_0x468951[_0x9772('0x3e')]['filter']+'%'};return _0x58a271;})});}_0xe5426d=_[_0x9772('0x4b')]({},_0xe5426d,_0x468951[_0x9772('0x53')]);return _0xa377c9['getAgents'](_0xe5426d);}})[_0x9772('0x1e')](function(_0x496475){if(_0x496475){_0x56010e=_0x496475[_0x9772('0x52')];if(!_0x468951[_0x9772('0x3e')][_0x9772('0x41')](_0x9772('0x42'))){_0xe5426d[_0x9772('0x2c')]=qs['limit'](_0x468951[_0x9772('0x3e')][_0x9772('0x2c')]);_0xe5426d['offset']=qs[_0x9772('0x2b')](_0x468951[_0x9772('0x3e')][_0x9772('0x2b')]);}return _0xa377c9[_0x9772('0x77')](_0xe5426d);}})[_0x9772('0x1e')](function(_0x15697a){if(_0x15697a){return _0x15697a?{'count':_0x56010e,'rows':_0x15697a}:null;}})[_0x9772('0x1e')](respondWithResult(_0x1cd5f6,null))[_0x9772('0x27')](handleError(_0x1cd5f6,null));}; \ No newline at end of file +var _0x585b=['ChatQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','ChatQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','rows','%s/%s','Team','getTeams','addTeams','ids','User','Agents','union','addAgents','penalty','removeAgents','removeTeams','emit','userChatQueue:save','isArray','userChatQueue:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','set','reject','save','update','destroy','UserProfileResource','name','send','index'];(function(_0x52e9a1,_0x5ea77e){var _0x2d41aa=function(_0xefcb3a){while(--_0xefcb3a){_0x52e9a1['push'](_0x52e9a1['shift']());}};_0x2d41aa(++_0x5ea77e);}(_0x585b,0x141));var _0xb585=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x585b[_0x2aec52];return _0x3b8835;};'use strict';var pdf=require(_0xb585('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb585('0x1'));var zipdir=require(_0xb585('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb585('0x3'));var moment=require('moment');var BPromise=require(_0xb585('0x4'));var Mustache=require(_0xb585('0x5'));var util=require(_0xb585('0x6'));var path=require(_0xb585('0x7'));var sox=require(_0xb585('0x8'));var csv=require(_0xb585('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb585('0xa'));var squel=require(_0xb585('0xb'));var crypto=require(_0xb585('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb585('0xd'));var toCsv=require(_0xb585('0x9'));var querystring=require(_0xb585('0xe'));var Papa=require(_0xb585('0xf'));var authService=require(_0xb585('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xb585('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xb585('0x12'))(_0xb585('0x13'));var utils=require(_0xb585('0x14'));var config=require(_0xb585('0x15'));var db=require(_0xb585('0x16'))['db'];config[_0xb585('0x17')]=_[_0xb585('0x18')](config[_0xb585('0x17')],{'host':_0xb585('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb585('0x1a'))[_0xb585('0x1b')](socket);var jayson=require(_0xb585('0x1c'));var client=jayson[_0xb585('0x1d')][_0xb585('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x35b17b,_0x48bd4e,_0x1fc7da,_0x4b6ca5){return new BPromise(function(_0x184a29,_0x227815){var _0x28effe=_0x4b6ca5||client;return _0x28effe[_0xb585('0x1f')](_0x35b17b,_0x1fc7da)[_0xb585('0x20')](function(_0x410974){logger[_0xb585('0x21')](_0xb585('0x22'),_0x48bd4e,_0xb585('0x23'));logger[_0xb585('0x24')](_0xb585('0x25'),_0x48bd4e,'request\x20sent',JSON[_0xb585('0x26')](_0x410974));if(_0x410974[_0xb585('0x27')]){if(_0x410974['error'][_0xb585('0x28')]===0x1f4){logger[_0xb585('0x27')](_0xb585('0x22'),_0x48bd4e,_0x410974[_0xb585('0x27')][_0xb585('0x29')]);return _0x227815(_0x410974[_0xb585('0x27')][_0xb585('0x29')]);}logger[_0xb585('0x27')]('ChatQueue,\x20%s,\x20%s',_0x48bd4e,_0x410974[_0xb585('0x27')][_0xb585('0x29')]);return _0x184a29(_0x410974[_0xb585('0x27')][_0xb585('0x29')]);}else{logger[_0xb585('0x21')](_0xb585('0x22'),_0x48bd4e,_0xb585('0x23'));_0x184a29(_0x410974[_0xb585('0x2a')][_0xb585('0x29')]);}})[_0xb585('0x2b')](function(_0x4f233f){logger[_0xb585('0x27')](_0xb585('0x22'),_0x48bd4e,_0x4f233f);_0x227815(_0x4f233f);});});}function respondWithStatusCode(_0x217576,_0x22fb3c){_0x22fb3c=_0x22fb3c||0xcc;return function(_0x1f08a8){if(_0x1f08a8){return _0x217576[_0xb585('0x2c')](_0x22fb3c);}return _0x217576[_0xb585('0x2d')](_0x22fb3c)['end']();};}function respondWithResult(_0x3c4e88,_0x2a13a1){_0x2a13a1=_0x2a13a1||0xc8;return function(_0x32aa35){if(_0x32aa35){return _0x3c4e88[_0xb585('0x2d')](_0x2a13a1)[_0xb585('0x2e')](_0x32aa35);}};}function respondWithFilteredResult(_0x1e473a,_0x4be30b){return function(_0x1de156){if(_0x1de156){var _0x4aec9f=_0x1de156['count'],_0x7be18=_0x4be30b['offset'],_0x14d8d9=_0x4be30b[_0xb585('0x2f')]+_0x4be30b['limit'],_0x364072;if(_0x14d8d9>=_0x4aec9f){_0x14d8d9=_0x4aec9f;_0x364072=0xc8;}else{_0x364072=0xce;}_0x1e473a[_0xb585('0x2d')](_0x364072);return _0x1e473a[_0xb585('0x30')]('Content-Range',_0x7be18+'-'+_0x14d8d9+'/'+_0x4aec9f)[_0xb585('0x2e')](_0x1de156);}return null;};}function patchUpdates(_0x234c51){return function(_0x3cdef0){try{jsonpatch['apply'](_0x3cdef0,_0x234c51,!![]);}catch(_0x27a345){return BPromise[_0xb585('0x31')](_0x27a345);}return _0x3cdef0[_0xb585('0x32')]();};}function saveUpdates(_0x2421f6,_0x13e53c){return function(_0x3321fc){if(_0x3321fc){return _0x3321fc[_0xb585('0x33')](_0x2421f6)[_0xb585('0x20')](function(_0x328e00){return _0x328e00;});}return null;};}function removeEntity(_0x2e99dd,_0x55807d){return function(_0x214ff4){if(_0x214ff4){return _0x214ff4[_0xb585('0x34')]()[_0xb585('0x20')](function(){var _0x41d607=_0x214ff4['get']({'plain':!![]});var _0xde50b1='ChatQueues';return db[_0xb585('0x35')][_0xb585('0x34')]({'where':{'type':_0xde50b1,'resourceId':_0x41d607['id']}})[_0xb585('0x20')](function(){return _0x214ff4;});})['then'](function(){_0x2e99dd[_0xb585('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x333d2e,_0x141139){return function(_0x153b50){if(!_0x153b50){_0x333d2e[_0xb585('0x2c')](0x194);}return _0x153b50;};}function handleError(_0x56fecb,_0x53568c){_0x53568c=_0x53568c||0x1f4;return function(_0x4a771a){logger[_0xb585('0x27')](_0x4a771a['stack']);if(_0x4a771a['name']){delete _0x4a771a[_0xb585('0x36')];}_0x56fecb[_0xb585('0x2d')](_0x53568c)[_0xb585('0x37')](_0x4a771a);};}exports[_0xb585('0x38')]=function(_0x215314,_0x80b2c4){var _0x1be3bd={},_0x4bfe6c={},_0xdfc4f5={'count':0x0,'rows':[]};var _0xdafe42=db[_0xb585('0x39')][_0xb585('0x3a')];_0x4bfe6c[_0xb585('0x3b')]=_[_0xb585('0x3c')](_0xdafe42);_0x4bfe6c[_0xb585('0x3d')]=_['keys'](_0x215314['query']);_0x4bfe6c[_0xb585('0x3e')]=_[_0xb585('0x3f')](_0x4bfe6c[_0xb585('0x3b')],_0x4bfe6c['query']);_0x1be3bd[_0xb585('0x40')]=_['intersection'](_0x4bfe6c[_0xb585('0x3b')],qs[_0xb585('0x41')](_0x215314['query'][_0xb585('0x41')]));_0x1be3bd[_0xb585('0x40')]=_0x1be3bd[_0xb585('0x40')][_0xb585('0x42')]?_0x1be3bd[_0xb585('0x40')]:_0x4bfe6c[_0xb585('0x3b')];if(!_0x215314[_0xb585('0x3d')][_0xb585('0x43')](_0xb585('0x44'))){_0x1be3bd[_0xb585('0x45')]=qs[_0xb585('0x45')](_0x215314['query']['limit']);_0x1be3bd[_0xb585('0x2f')]=qs[_0xb585('0x2f')](_0x215314[_0xb585('0x3d')][_0xb585('0x2f')]);}_0x1be3bd['order']=qs[_0xb585('0x46')](_0x215314[_0xb585('0x3d')][_0xb585('0x46')]);_0x1be3bd[_0xb585('0x47')]=qs[_0xb585('0x3e')](_[_0xb585('0x48')](_0x215314[_0xb585('0x3d')],_0x4bfe6c[_0xb585('0x3e')]));if(_0x215314[_0xb585('0x3d')][_0xb585('0x49')]){_0x1be3bd[_0xb585('0x47')]=_['merge'](_0x1be3bd['where'],{'$or':_[_0xb585('0x4a')](_0xdafe42,function(_0x2e187a){if(_0x2e187a[_0xb585('0x4b')][_0xb585('0x4c')]!==_0xb585('0x4d')){var _0x1b679f={};_0x1b679f[_0x2e187a[_0xb585('0x4e')]]={'$like':'%'+_0x215314['query']['filter']+'%'};return _0x1b679f;}})});}_0x1be3bd=_[_0xb585('0x4f')]({},_0x1be3bd,_0x215314[_0xb585('0x50')]);var _0x4801d7={'where':_0x1be3bd[_0xb585('0x47')]};return db[_0xb585('0x39')]['count'](_0x4801d7)[_0xb585('0x20')](function(_0x3b7b6d){_0xdfc4f5[_0xb585('0x51')]=_0x3b7b6d;if(_0x215314[_0xb585('0x3d')][_0xb585('0x52')]){_0x1be3bd[_0xb585('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0xb585('0x54')](_0x1be3bd);})['then'](function(_0x357c03){_0xdfc4f5['rows']=_0x357c03;return _0xdfc4f5;})[_0xb585('0x20')](respondWithFilteredResult(_0x80b2c4,_0x1be3bd))[_0xb585('0x2b')](handleError(_0x80b2c4,null));};exports[_0xb585('0x55')]=function(_0x5010eb,_0x48beb7){var _0x3f6744={'raw':!![],'where':{'id':_0x5010eb[_0xb585('0x56')]['id']}},_0x9838cc={};_0x9838cc[_0xb585('0x3b')]=_[_0xb585('0x3c')](db['ChatQueue'][_0xb585('0x3a')]);_0x9838cc[_0xb585('0x3d')]=_[_0xb585('0x3c')](_0x5010eb[_0xb585('0x3d')]);_0x9838cc[_0xb585('0x3e')]=_[_0xb585('0x3f')](_0x9838cc[_0xb585('0x3b')],_0x9838cc['query']);_0x3f6744[_0xb585('0x40')]=_[_0xb585('0x3f')](_0x9838cc['model'],qs['fields'](_0x5010eb[_0xb585('0x3d')][_0xb585('0x41')]));_0x3f6744[_0xb585('0x40')]=_0x3f6744[_0xb585('0x40')][_0xb585('0x42')]?_0x3f6744[_0xb585('0x40')]:_0x9838cc[_0xb585('0x3b')];if(_0x5010eb['query'][_0xb585('0x52')]){_0x3f6744[_0xb585('0x53')]=[{'all':!![]}];}_0x3f6744=_[_0xb585('0x4f')]({},_0x3f6744,_0x5010eb[_0xb585('0x50')]);return db[_0xb585('0x39')][_0xb585('0x57')](_0x3f6744)[_0xb585('0x20')](handleEntityNotFound(_0x48beb7,null))[_0xb585('0x20')](respondWithResult(_0x48beb7,null))[_0xb585('0x2b')](handleError(_0x48beb7,null));};exports[_0xb585('0x58')]=function(_0x4c3a02,_0x6726f2){return db[_0xb585('0x39')][_0xb585('0x58')](_0x4c3a02[_0xb585('0x59')],{})[_0xb585('0x20')](function(_0xe1bcc3){var _0x30095a=_0x4c3a02[_0xb585('0x5a')]['get']({'plain':!![]});if(!_0x30095a)throw new Error(_0xb585('0x5b'));if(_0x30095a['role']===_0xb585('0x5a')){var _0x234aaa=_0xe1bcc3[_0xb585('0x5c')]({'plain':!![]});var _0x16a2af=_0xb585('0x5d');return db[_0xb585('0x5e')][_0xb585('0x57')]({'where':{'name':_0x16a2af,'userProfileId':_0x30095a['userProfileId']},'raw':!![]})[_0xb585('0x20')](function(_0x17e417){if(_0x17e417&&_0x17e417[_0xb585('0x5f')]===0x0){return db[_0xb585('0x35')]['create']({'name':_0x234aaa[_0xb585('0x36')],'resourceId':_0x234aaa['id'],'type':_0x17e417[_0xb585('0x36')],'sectionId':_0x17e417['id']},{})[_0xb585('0x20')](function(){return _0xe1bcc3;});}else{return _0xe1bcc3;}})['catch'](function(_0x6d464b){logger[_0xb585('0x27')](_0xb585('0x60'),_0x6d464b);throw _0x6d464b;});}return _0xe1bcc3;})[_0xb585('0x20')](respondWithResult(_0x6726f2,0xc9))[_0xb585('0x2b')](handleError(_0x6726f2,null));};exports[_0xb585('0x33')]=function(_0x32fae9,_0x30495d){if(_0x32fae9['body']['id']){delete _0x32fae9[_0xb585('0x59')]['id'];}return db[_0xb585('0x39')]['find']({'where':{'id':_0x32fae9[_0xb585('0x56')]['id']}})[_0xb585('0x20')](handleEntityNotFound(_0x30495d,null))[_0xb585('0x20')](saveUpdates(_0x32fae9[_0xb585('0x59')],null))[_0xb585('0x20')](respondWithResult(_0x30495d,null))['catch'](handleError(_0x30495d,null));};exports[_0xb585('0x34')]=function(_0x34103f,_0x18f9e0){return db['ChatQueue'][_0xb585('0x57')]({'where':{'id':_0x34103f[_0xb585('0x56')]['id']}})[_0xb585('0x20')](handleEntityNotFound(_0x18f9e0,null))['then'](removeEntity(_0x18f9e0,null))['catch'](handleError(_0x18f9e0,null));};exports['describe']=function(_0x1b2bec,_0x3b8a95){return db[_0xb585('0x39')][_0xb585('0x61')]()[_0xb585('0x20')](respondWithResult(_0x3b8a95,null))[_0xb585('0x2b')](handleError(_0x3b8a95,null));};exports[_0xb585('0x62')]=function(_0x5854d9,_0x3d5ac6,_0x2d0c23){var _0x2b41ed={'raw':!![],'where':{}},_0xa6ac51={},_0x144862;return db[_0xb585('0x39')][_0xb585('0x63')]({'where':{'id':_0x5854d9['params']['id']}})['then'](handleEntityNotFound(_0x3d5ac6,null))[_0xb585('0x20')](function(_0x5cda70){if(_0x5cda70){_0x144862=_0x5cda70[_0xb585('0x5c')]({'plain':!![]});_0xa6ac51[_0xb585('0x3b')]=_[_0xb585('0x3c')](db[_0xb585('0x64')][_0xb585('0x3a')]);_0xa6ac51[_0xb585('0x3d')]=_[_0xb585('0x3c')](_0x5854d9[_0xb585('0x3d')]);_0xa6ac51[_0xb585('0x3e')]=_[_0xb585('0x3f')](_0xa6ac51[_0xb585('0x3b')],_0xa6ac51[_0xb585('0x3d')]);_0x2b41ed[_0xb585('0x40')]=_[_0xb585('0x3f')](_0xa6ac51[_0xb585('0x3b')],qs[_0xb585('0x41')](_0x5854d9[_0xb585('0x3d')][_0xb585('0x41')]));_0x2b41ed[_0xb585('0x40')]=_0x2b41ed['attributes'][_0xb585('0x42')]?_0x2b41ed['attributes']:_0xa6ac51[_0xb585('0x3b')];if(!_0x5854d9['query'][_0xb585('0x43')](_0xb585('0x44'))){_0x2b41ed['limit']=qs[_0xb585('0x45')](_0x5854d9[_0xb585('0x3d')][_0xb585('0x45')]);_0x2b41ed[_0xb585('0x2f')]=qs[_0xb585('0x2f')](_0x5854d9['query'][_0xb585('0x2f')]);}_0x2b41ed[_0xb585('0x65')]=qs[_0xb585('0x46')](_0x5854d9[_0xb585('0x3d')][_0xb585('0x46')]);_0x2b41ed[_0xb585('0x47')]=qs[_0xb585('0x3e')](_[_0xb585('0x48')](_0x5854d9[_0xb585('0x3d')],_0xa6ac51['filters']));_0x2b41ed[_0xb585('0x47')][_0xb585('0x66')]=_0x5cda70['id'];if(_0x5854d9[_0xb585('0x3d')]['filter']){_0x2b41ed[_0xb585('0x47')]=_['merge'](_0x2b41ed[_0xb585('0x47')],{'$or':_['map'](_0x2b41ed['attributes'],function(_0x3d6994){var _0x382f97={};_0x382f97[_0x3d6994]={'$like':'%'+_0x5854d9[_0xb585('0x3d')][_0xb585('0x49')]+'%'};return _0x382f97;})});}_0x2b41ed=_[_0xb585('0x4f')]({},_0x2b41ed,_0x5854d9[_0xb585('0x50')]);return db['UserChatQueue']['findAll'](_0x2b41ed);}})[_0xb585('0x20')](function(_0x337157){if(_0x337157){return db['User'][_0xb585('0x67')]({'where':{'id':_['map'](_0x337157,'UserId'),'role':_0xb585('0x68')},'attributes':['id','name',_0xb585('0x69'),_0xb585('0x6a'),_0xb585('0x6b')]});}})[_0xb585('0x20')](function(_0x1bd740){if(_0x1bd740){return{'count':_0x1bd740[_0xb585('0x51')],'rows':_[_0xb585('0x4a')](_0x1bd740[_0xb585('0x6c')],function(_0x4dcd94){return{'membername':_0x4dcd94[_0xb585('0x36')],'UserId':_0x4dcd94['id'],'queue_name':_0x144862[_0xb585('0x36')],'ChatQueueId':_0x144862['id'],'interface':util['format'](_0xb585('0x6d'),'SIP',_0x4dcd94[_0xb585('0x36')]),'penalty':0x0,'paused':_0x4dcd94['chatPause'],'createdAt':_0x4dcd94['createdAt'],'updatedAt':_0x4dcd94['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3d5ac6,_0x2b41ed))[_0xb585('0x2b')](handleError(_0x3d5ac6,null));};exports['getTeams']=function(_0x41c104,_0xaa097d,_0x1e388a){var _0x2c41a9={};var _0x11a212={};var _0x537014;var _0x3e7866;return db[_0xb585('0x39')][_0xb585('0x63')]({'where':{'id':_0x41c104[_0xb585('0x56')]['id']}})[_0xb585('0x20')](handleEntityNotFound(_0xaa097d,null))['then'](function(_0x2ea88a){if(_0x2ea88a){_0x537014=_0x2ea88a;_0x11a212['model']=_[_0xb585('0x3c')](db[_0xb585('0x6e')][_0xb585('0x3a')]);_0x11a212[_0xb585('0x3d')]=_[_0xb585('0x3c')](_0x41c104[_0xb585('0x3d')]);_0x11a212[_0xb585('0x3e')]=_[_0xb585('0x3f')](_0x11a212[_0xb585('0x3b')],_0x11a212[_0xb585('0x3d')]);_0x2c41a9[_0xb585('0x40')]=_[_0xb585('0x3f')](_0x11a212[_0xb585('0x3b')],qs['fields'](_0x41c104[_0xb585('0x3d')][_0xb585('0x41')]));_0x2c41a9[_0xb585('0x40')]=_0x2c41a9['attributes'][_0xb585('0x42')]?_0x2c41a9[_0xb585('0x40')]:_0x11a212['model'];_0x2c41a9[_0xb585('0x65')]=qs[_0xb585('0x46')](_0x41c104[_0xb585('0x3d')][_0xb585('0x46')]);_0x2c41a9[_0xb585('0x47')]=qs['filters'](_['pick'](_0x41c104[_0xb585('0x3d')],_0x11a212[_0xb585('0x3e')]));if(_0x41c104[_0xb585('0x3d')][_0xb585('0x49')]){_0x2c41a9[_0xb585('0x47')]=_[_0xb585('0x4f')](_0x2c41a9['where'],{'$or':_['map'](_0x2c41a9[_0xb585('0x40')],function(_0x203209){var _0x138ec4={};_0x138ec4[_0x203209]={'$like':'%'+_0x41c104[_0xb585('0x3d')][_0xb585('0x49')]+'%'};return _0x138ec4;})});}_0x2c41a9=_[_0xb585('0x4f')]({},_0x2c41a9,_0x41c104['options']);return _0x537014[_0xb585('0x6f')](_0x2c41a9);}})['then'](function(_0x12eb25){if(_0x12eb25){_0x3e7866=_0x12eb25['length'];if(!_0x41c104[_0xb585('0x3d')][_0xb585('0x43')]('nolimit')){_0x2c41a9[_0xb585('0x45')]=qs[_0xb585('0x45')](_0x41c104[_0xb585('0x3d')][_0xb585('0x45')]);_0x2c41a9[_0xb585('0x2f')]=qs[_0xb585('0x2f')](_0x41c104['query'][_0xb585('0x2f')]);}return _0x537014[_0xb585('0x6f')](_0x2c41a9);}})['then'](function(_0x1b9866){if(_0x1b9866){return _0x1b9866?{'count':_0x3e7866,'rows':_0x1b9866}:null;}})[_0xb585('0x20')](respondWithResult(_0xaa097d,null))[_0xb585('0x2b')](handleError(_0xaa097d,null));};exports[_0xb585('0x70')]=function(_0x5ac869,_0x25f656,_0x1ea42b){var _0x29d130=[];var _0x5529e7;return db[_0xb585('0x6e')][_0xb585('0x54')]({'where':{'id':_0x5ac869[_0xb585('0x59')][_0xb585('0x71')]},'attributes':['id'],'include':[{'model':db[_0xb585('0x72')],'as':_0xb585('0x73'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x468795){if(_0x468795){for(var _0x5259e3=0x0;_0x5259e3<_0x468795[_0xb585('0x42')];_0x5259e3+=0x1){for(var _0x400965=0x0;_0x400965<_0x468795[_0x5259e3][_0xb585('0x73')][_0xb585('0x42')];_0x400965+=0x1){_0x29d130=_[_0xb585('0x74')](_0x29d130,[_0x468795[_0x5259e3]['Agents'][_0x400965]['id']]);}}return _0x29d130;}})[_0xb585('0x20')](function(_0x37247e){if(_0x37247e){return db[_0xb585('0x39')][_0xb585('0x57')]({'where':{'id':_0x5ac869[_0xb585('0x56')]['id']}});}})[_0xb585('0x20')](function(_0x582a52){if(_0x582a52){_0x5529e7=_0x582a52;return _0x5529e7[_0xb585('0x75')](_0x29d130,{'penalty':_0x5ac869[_0xb585('0x59')][_0xb585('0x76')]});}})['then'](function(_0x31036d){if(_0x31036d){return _0x5529e7[_0xb585('0x70')](_0x5ac869[_0xb585('0x59')][_0xb585('0x71')]);}})['then'](handleEntityNotFound(_0x25f656,null))[_0xb585('0x20')](respondWithStatusCode(_0x25f656,null))[_0xb585('0x2b')](handleError(_0x25f656,null));};exports['removeTeams']=function(_0x528826,_0x2dc44c,_0x129de2){var _0x10849a=[];var _0x2e76fd;return db[_0xb585('0x6e')][_0xb585('0x54')]({'where':{'id':_0x528826[_0xb585('0x3d')][_0xb585('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb585('0x73'),'attributes':['id'],'raw':!![]}]})[_0xb585('0x20')](function(_0x19c115){if(_0x19c115){for(var _0x34ccb8=0x0;_0x34ccb8<_0x19c115[_0xb585('0x42')];_0x34ccb8+=0x1){for(var _0x145816=0x0;_0x145816<_0x19c115[_0x34ccb8]['Agents'][_0xb585('0x42')];_0x145816+=0x1){_0x10849a=_[_0xb585('0x74')](_0x10849a,[_0x19c115[_0x34ccb8][_0xb585('0x73')][_0x145816]['id']]);}}return _0x10849a;}})['then'](function(_0x22f018){if(_0x22f018){return db['ChatQueue'][_0xb585('0x57')]({'where':{'id':_0x528826['params']['id']}});}})[_0xb585('0x20')](function(_0x8316f8){if(_0x8316f8){_0x2e76fd=_0x8316f8;return _0x2e76fd[_0xb585('0x77')](_0x10849a);}})[_0xb585('0x20')](function(_0x4d14fa){if(_0x2e76fd){return _0x2e76fd[_0xb585('0x78')](_0x528826['query'][_0xb585('0x71')]);}})[_0xb585('0x20')](handleEntityNotFound(_0x2dc44c,null))[_0xb585('0x20')](respondWithStatusCode(_0x2dc44c,null))[_0xb585('0x2b')](handleError(_0x2dc44c,null));};exports[_0xb585('0x75')]=function(_0x320347,_0x1c8a67,_0x23c9d5){return db[_0xb585('0x39')][_0xb585('0x57')]({'where':{'id':_0x320347[_0xb585('0x56')]['id']}})['then'](handleEntityNotFound(_0x1c8a67,null))[_0xb585('0x20')](function(_0x1eea46){if(_0x1eea46){return _0x1eea46['addAgents'](_0x320347[_0xb585('0x59')][_0xb585('0x71')],_['omit'](_0x320347[_0xb585('0x59')],[_0xb585('0x71'),'id'])||{})['spread'](function(_0x2c42bb){for(var _0x508de9=0x0;_0x508de9<_0x320347[_0xb585('0x59')][_0xb585('0x71')][_0xb585('0x42')];_0x508de9+=0x1){socket[_0xb585('0x79')](_0xb585('0x7a'),{'UserId':_0x320347[_0xb585('0x59')][_0xb585('0x71')][_0x508de9],'ChatQueueId':_0x320347[_0xb585('0x56')]['id']});}return _0x2c42bb;});}})[_0xb585('0x20')](respondWithResult(_0x1c8a67,null))[_0xb585('0x2b')](handleError(_0x1c8a67,null));};exports[_0xb585('0x77')]=function(_0x5c3137,_0x27900a,_0x5110c0){var _0x2772e7;return db[_0xb585('0x39')][_0xb585('0x57')]({'where':{'id':_0x5c3137[_0xb585('0x56')]['id']}})[_0xb585('0x20')](handleEntityNotFound(_0x27900a,null))['then'](function(_0x15c3d5){if(_0x15c3d5){return _0x15c3d5[_0xb585('0x77')](_0x5c3137[_0xb585('0x3d')][_0xb585('0x71')])[_0xb585('0x20')](function(_0x5de04d){if(_[_0xb585('0x7b')](_0x5c3137[_0xb585('0x3d')]['ids'])){for(var _0x30024b=0x0;_0x30024b<_0x5c3137[_0xb585('0x3d')][_0xb585('0x71')][_0xb585('0x42')];_0x30024b+=0x1){socket[_0xb585('0x79')](_0xb585('0x7c'),{'UserId':_0x5c3137[_0xb585('0x3d')]['ids'][_0x30024b],'ChatQueueId':_0x5c3137[_0xb585('0x56')]['id']});}}else{socket[_0xb585('0x79')](_0xb585('0x7c'),{'UserId':_0x5c3137[_0xb585('0x3d')][_0xb585('0x71')],'ChatQueueId':_0x5c3137[_0xb585('0x56')]['id']});}});}})[_0xb585('0x20')](respondWithStatusCode(_0x27900a,null))[_0xb585('0x2b')](handleError(_0x27900a,null));};exports[_0xb585('0x7d')]=function(_0x2254db,_0x1b501e,_0x35cb59){var _0xed65cb={};var _0x528989={};var _0x364a07;var _0x5c5b48;return db[_0xb585('0x39')][_0xb585('0x63')]({'where':{'id':_0x2254db[_0xb585('0x56')]['id']}})[_0xb585('0x20')](handleEntityNotFound(_0x1b501e,null))[_0xb585('0x20')](function(_0x120241){if(_0x120241){_0x364a07=_0x120241;_0x528989[_0xb585('0x3b')]=_[_0xb585('0x3c')](db[_0xb585('0x72')][_0xb585('0x3a')]);_0x528989[_0xb585('0x3d')]=_[_0xb585('0x3c')](_0x2254db[_0xb585('0x3d')]);_0x528989[_0xb585('0x3e')]=_[_0xb585('0x3f')](_0x528989[_0xb585('0x3b')],_0x528989['query']);_0xed65cb[_0xb585('0x40')]=_[_0xb585('0x3f')](_0x528989[_0xb585('0x3b')],qs[_0xb585('0x41')](_0x2254db[_0xb585('0x3d')][_0xb585('0x41')]));_0xed65cb[_0xb585('0x40')]=_0xed65cb['attributes'][_0xb585('0x42')]?_0xed65cb['attributes']:_0x528989[_0xb585('0x3b')];_0xed65cb[_0xb585('0x65')]=qs['sort'](_0x2254db[_0xb585('0x3d')][_0xb585('0x46')]);_0xed65cb['where']=qs[_0xb585('0x3e')](_[_0xb585('0x48')](_0x2254db[_0xb585('0x3d')],_0x528989[_0xb585('0x3e')]));if(_0x2254db[_0xb585('0x3d')][_0xb585('0x49')]){_0xed65cb[_0xb585('0x47')]=_[_0xb585('0x4f')](_0xed65cb['where'],{'$or':_[_0xb585('0x4a')](_0xed65cb['attributes'],function(_0x595f92){var _0x101580={};_0x101580[_0x595f92]={'$like':'%'+_0x2254db['query'][_0xb585('0x49')]+'%'};return _0x101580;})});}_0xed65cb=_[_0xb585('0x4f')]({},_0xed65cb,_0x2254db['options']);return _0x364a07[_0xb585('0x7d')](_0xed65cb);}})[_0xb585('0x20')](function(_0x45fe18){if(_0x45fe18){_0x5c5b48=_0x45fe18['length'];if(!_0x2254db[_0xb585('0x3d')][_0xb585('0x43')]('nolimit')){_0xed65cb[_0xb585('0x45')]=qs[_0xb585('0x45')](_0x2254db[_0xb585('0x3d')]['limit']);_0xed65cb['offset']=qs[_0xb585('0x2f')](_0x2254db[_0xb585('0x3d')]['offset']);}return _0x364a07[_0xb585('0x7d')](_0xed65cb);}})[_0xb585('0x20')](function(_0x4224f1){if(_0x4224f1){return _0x4224f1?{'count':_0x5c5b48,'rows':_0x4224f1}:null;}})['then'](respondWithResult(_0x1b501e,null))[_0xb585('0x2b')](handleError(_0x1b501e,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 9c7e181..42f95ea 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 _0x24dd=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x58036d,_0x3863b8){var _0x12fb9f=function(_0x745f7b){while(--_0x745f7b){_0x58036d['push'](_0x58036d['shift']());}};_0x12fb9f(++_0x3863b8);}(_0x24dd,0x84));var _0xd24d=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x24dd[_0x3e112d];return _0x531c31;};'use strict';var EventEmitter=require(_0xd24d('0x0'));var ChatQueue=require(_0xd24d('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd24d('0x2')](0x0);var events={'afterCreate':_0xd24d('0x3'),'afterUpdate':_0xd24d('0x4'),'afterDestroy':_0xd24d('0x5')};function emitEvent(_0x974c7d){return function(_0x5be948,_0x23577a,_0x14c749){ChatQueueEvents['emit'](_0x974c7d+':'+_0x5be948['id'],_0x5be948);ChatQueueEvents[_0xd24d('0x6')](_0x974c7d,_0x5be948);_0x14c749(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xd24d('0x7')](e,emitEvent(event));}}module[_0xd24d('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x7a2b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4776f3,_0x2b8198){var _0x2b7b3a=function(_0x2a92f2){while(--_0x2a92f2){_0x4776f3['push'](_0x4776f3['shift']());}};_0x2b7b3a(++_0x2b8198);}(_0x7a2b,0x7c));var _0xb7a2=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7a2b[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0xb7a2('0x0'));var ChatQueue=require(_0xb7a2('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb7a2('0x2')};function emitEvent(_0x5a5b15){return function(_0x211d4e,_0x32b369,_0x3068a1){ChatQueueEvents[_0xb7a2('0x3')](_0x5a5b15+':'+_0x211d4e['id'],_0x211d4e);ChatQueueEvents[_0xb7a2('0x3')](_0x5a5b15,_0x211d4e);_0x3068a1(null);};}for(var e in events){if(events[_0xb7a2('0x4')](e)){var event=events[e];ChatQueue[_0xb7a2('0x5')](e,emitEvent(event));}}module[_0xb7a2('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 1b58744..7931d65 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 _0x0309=['bluebird','request-promise','./chatQueue.attributes','exports','chat_queues','lodash','../../config/logger','moment'];(function(_0x163b19,_0x292188){var _0x2b5180=function(_0x131c6a){while(--_0x131c6a){_0x163b19['push'](_0x163b19['shift']());}};_0x2b5180(++_0x292188);}(_0x0309,0x165));var _0x9030=function(_0x2c0375,_0x4f6744){_0x2c0375=_0x2c0375-0x0;var _0x36964f=_0x0309[_0x2c0375];return _0x36964f;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var logger=require(_0x9030('0x1'))('api');var moment=require(_0x9030('0x2'));var BPromise=require(_0x9030('0x3'));var rp=require(_0x9030('0x4'));var attributes=require(_0x9030('0x5'));module[_0x9030('0x6')]=function(_0x2e6276,_0xcbbe57){return _0x2e6276['define']('ChatQueue',attributes,{'tableName':_0x9030('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x207c=['util','../../config/logger','api','moment','bluebird','request-promise','./chatQueue.attributes','chat_queues'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x207c,0x1e8));var _0xc207=function(_0x44dc4c,_0x357e6a){_0x44dc4c=_0x44dc4c-0x0;var _0x4e644e=_0x207c[_0x44dc4c];return _0x4e644e;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var BPromise=require(_0xc207('0x4'));var rp=require(_0xc207('0x5'));var attributes=require(_0xc207('0x6'));module['exports']=function(_0x38ff02,_0x59bc89){return _0x38ff02['define']('ChatQueue',attributes,{'tableName':_0xc207('0x7'),'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 87bb9b4..bf773b9 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 _0xe0a1=['register','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','ChatQueue','options','raw','attributes','limit','include','map','model','GetChatQueue','catch','ShowChatQueue','find','where','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xe0a1,0x179));var _0x1e0a=function(_0x47bc58,_0x1e1998){_0x47bc58=_0x47bc58-0x0;var _0x4a0860=_0xe0a1[_0x47bc58];return _0x4a0860;};'use strict';var _=require(_0x1e0a('0x0'));var util=require(_0x1e0a('0x1'));var moment=require(_0x1e0a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e0a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e0a('0x4'))(_0x1e0a('0x5'));var config=require(_0x1e0a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1e0a('0x7')][_0x1e0a('0x8')]({'port':0x232a});config[_0x1e0a('0x9')]=_[_0x1e0a('0xa')](config[_0x1e0a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e0a('0xb'))(new Redis(config['redis']));require(_0x1e0a('0xc'))[_0x1e0a('0xd')](socket);function respondWithRpcPromise(_0x3c4b3e,_0x5d7b3a,_0xae3b16){return new BPromise(function(_0x3aecb1,_0x36020c){return client[_0x1e0a('0xe')](_0x3c4b3e,_0xae3b16)[_0x1e0a('0xf')](function(_0x1b1bcc){logger['info'](_0x1e0a('0x10'),_0x5d7b3a,'request\x20sent');logger[_0x1e0a('0x11')](_0x1e0a('0x12'),_0x5d7b3a,'request\x20sent',JSON[_0x1e0a('0x13')](_0x1b1bcc));if(_0x1b1bcc[_0x1e0a('0x14')]){if(_0x1b1bcc[_0x1e0a('0x14')][_0x1e0a('0x15')]===0x1f4){logger[_0x1e0a('0x14')](_0x1e0a('0x10'),_0x5d7b3a,_0x1b1bcc['error'][_0x1e0a('0x16')]);return _0x36020c(_0x1b1bcc[_0x1e0a('0x14')][_0x1e0a('0x16')]);}logger['error'](_0x1e0a('0x10'),_0x5d7b3a,_0x1b1bcc['error'][_0x1e0a('0x16')]);return _0x3aecb1(_0x1b1bcc[_0x1e0a('0x14')]['message']);}else{logger[_0x1e0a('0x17')](_0x1e0a('0x10'),_0x5d7b3a,_0x1e0a('0x18'));_0x3aecb1(_0x1b1bcc[_0x1e0a('0x19')]['message']);}})['catch'](function(_0x53585c){logger[_0x1e0a('0x14')](_0x1e0a('0x10'),_0x5d7b3a,_0x53585c);_0x36020c(_0x53585c);});});}exports['GetChatQueue']=function(_0x523f81){var _0xab0a0c=this;return new Promise(function(_0x220856,_0x523b9c){return db[_0x1e0a('0x1a')]['findAll']({'raw':_0x523f81[_0x1e0a('0x1b')]?_0x523f81['options'][_0x1e0a('0x1c')]===undefined?!![]:![]:!![],'where':_0x523f81['options']?_0x523f81['options']['where']||null:null,'attributes':_0x523f81[_0x1e0a('0x1b')]?_0x523f81[_0x1e0a('0x1b')][_0x1e0a('0x1d')]||null:null,'limit':_0x523f81['options']?_0x523f81[_0x1e0a('0x1b')][_0x1e0a('0x1e')]||null:null,'include':_0x523f81[_0x1e0a('0x1b')]?_0x523f81['options'][_0x1e0a('0x1f')]?_[_0x1e0a('0x20')](_0x523f81[_0x1e0a('0x1b')][_0x1e0a('0x1f')],function(_0x449cba){return{'model':db[_0x449cba[_0x1e0a('0x21')]],'as':_0x449cba['as'],'attributes':_0x449cba[_0x1e0a('0x1d')],'include':_0x449cba[_0x1e0a('0x1f')]?_[_0x1e0a('0x20')](_0x449cba[_0x1e0a('0x1f')],function(_0x18e80a){return{'model':db[_0x18e80a[_0x1e0a('0x21')]],'as':_0x18e80a['as'],'attributes':_0x18e80a[_0x1e0a('0x1d')],'include':_0x18e80a[_0x1e0a('0x1f')]?_[_0x1e0a('0x20')](_0x18e80a[_0x1e0a('0x1f')],function(_0x3ff05b){return{'model':db[_0x3ff05b[_0x1e0a('0x21')]],'as':_0x3ff05b['as'],'attributes':_0x3ff05b[_0x1e0a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1e0a('0xf')](function(_0x1ba3db){logger['info']('GetChatQueue',_0x523f81);logger[_0x1e0a('0x11')](_0x1e0a('0x22'),_0x523f81,JSON[_0x1e0a('0x13')](_0x1ba3db));_0x220856(_0x1ba3db);})[_0x1e0a('0x23')](function(_0x242d99){logger[_0x1e0a('0x14')](_0x1e0a('0x22'),_0x242d99[_0x1e0a('0x16')],_0x523f81);_0x523b9c(_0xab0a0c['error'](0x1f4,_0x242d99[_0x1e0a('0x16')]));});});};exports[_0x1e0a('0x24')]=function(_0x30cd5f){var _0x268559=this;return new Promise(function(_0x33499a,_0x341816){return db[_0x1e0a('0x1a')][_0x1e0a('0x25')]({'raw':_0x30cd5f[_0x1e0a('0x1b')]?_0x30cd5f[_0x1e0a('0x1b')][_0x1e0a('0x1c')]===undefined?!![]:![]:!![],'where':_0x30cd5f['options']?_0x30cd5f[_0x1e0a('0x1b')][_0x1e0a('0x26')]||null:null,'attributes':_0x30cd5f[_0x1e0a('0x1b')]?_0x30cd5f['options'][_0x1e0a('0x1d')]||null:null,'include':_0x30cd5f[_0x1e0a('0x1b')]?_0x30cd5f[_0x1e0a('0x1b')][_0x1e0a('0x1f')]?_[_0x1e0a('0x20')](_0x30cd5f[_0x1e0a('0x1b')]['include'],function(_0x46628c){return{'model':db[_0x46628c['model']],'as':_0x46628c['as'],'attributes':_0x46628c['attributes'],'include':_0x46628c[_0x1e0a('0x1f')]?_[_0x1e0a('0x20')](_0x46628c[_0x1e0a('0x1f')],function(_0x24142e){return{'model':db[_0x24142e[_0x1e0a('0x21')]],'as':_0x24142e['as'],'attributes':_0x24142e[_0x1e0a('0x1d')],'include':_0x24142e[_0x1e0a('0x1f')]?_['map'](_0x24142e[_0x1e0a('0x1f')],function(_0x3b54fd){return{'model':db[_0x3b54fd[_0x1e0a('0x21')]],'as':_0x3b54fd['as'],'attributes':_0x3b54fd[_0x1e0a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1e0a('0xf')](function(_0x4ec37c){logger[_0x1e0a('0x17')]('ShowChatQueue',_0x30cd5f);logger['debug'](_0x1e0a('0x24'),_0x30cd5f,JSON[_0x1e0a('0x13')](_0x4ec37c));_0x33499a(_0x4ec37c);})[_0x1e0a('0x23')](function(_0x1a2b1c){logger[_0x1e0a('0x14')](_0x1e0a('0x24'),_0x1a2b1c[_0x1e0a('0x16')],_0x30cd5f);_0x341816(_0x268559['error'](0x1f4,_0x1a2b1c['message']));});});}; \ No newline at end of file +var _0x29ad=['map','model','attributes','then','debug','ShowChatQueue','where','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','include'];(function(_0x565996,_0x1fda5d){var _0x3405f4=function(_0x27f53){while(--_0x27f53){_0x565996['push'](_0x565996['shift']());}};_0x3405f4(++_0x1fda5d);}(_0x29ad,0x166));var _0xd29a=function(_0x509d3b,_0x115e56){_0x509d3b=_0x509d3b-0x0;var _0x56449a=_0x29ad[_0x509d3b];return _0x56449a;};'use strict';var _=require(_0xd29a('0x0'));var util=require(_0xd29a('0x1'));var moment=require(_0xd29a('0x2'));var BPromise=require(_0xd29a('0x3'));var rs=require(_0xd29a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd29a('0x5'))(_0xd29a('0x6'));var config=require('../../config/environment');var jayson=require(_0xd29a('0x7'));var client=jayson[_0xd29a('0x8')][_0xd29a('0x9')]({'port':0x232a});config[_0xd29a('0xa')]=_[_0xd29a('0xb')](config[_0xd29a('0xa')],{'host':_0xd29a('0xc'),'port':0x18eb});var socket=require(_0xd29a('0xd'))(new Redis(config[_0xd29a('0xa')]));require(_0xd29a('0xe'))[_0xd29a('0xf')](socket);function respondWithRpcPromise(_0x229d32,_0x2e96cc,_0x30c31b){return new BPromise(function(_0x53d920,_0xe63b34){return client[_0xd29a('0x10')](_0x229d32,_0x30c31b)['then'](function(_0x26297f){logger[_0xd29a('0x11')](_0xd29a('0x12'),_0x2e96cc,_0xd29a('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2e96cc,_0xd29a('0x13'),JSON[_0xd29a('0x14')](_0x26297f));if(_0x26297f['error']){if(_0x26297f[_0xd29a('0x15')][_0xd29a('0x16')]===0x1f4){logger[_0xd29a('0x15')](_0xd29a('0x12'),_0x2e96cc,_0x26297f[_0xd29a('0x15')][_0xd29a('0x17')]);return _0xe63b34(_0x26297f['error'][_0xd29a('0x17')]);}logger[_0xd29a('0x15')](_0xd29a('0x12'),_0x2e96cc,_0x26297f[_0xd29a('0x15')][_0xd29a('0x17')]);return _0x53d920(_0x26297f[_0xd29a('0x15')][_0xd29a('0x17')]);}else{logger[_0xd29a('0x11')]('ChatQueue,\x20%s,\x20%s',_0x2e96cc,_0xd29a('0x13'));_0x53d920(_0x26297f[_0xd29a('0x18')][_0xd29a('0x17')]);}})[_0xd29a('0x19')](function(_0x16278d){logger[_0xd29a('0x15')](_0xd29a('0x12'),_0x2e96cc,_0x16278d);_0xe63b34(_0x16278d);});});}exports[_0xd29a('0x1a')]=function(_0x5bb690){var _0x3e383e=this;return new Promise(function(_0x58f392,_0x29c23f){return db[_0xd29a('0x1b')][_0xd29a('0x1c')]({'raw':_0x5bb690[_0xd29a('0x1d')]?_0x5bb690[_0xd29a('0x1d')][_0xd29a('0x1e')]===undefined?!![]:![]:!![],'where':_0x5bb690[_0xd29a('0x1d')]?_0x5bb690[_0xd29a('0x1d')]['where']||null:null,'attributes':_0x5bb690[_0xd29a('0x1d')]?_0x5bb690['options']['attributes']||null:null,'limit':_0x5bb690[_0xd29a('0x1d')]?_0x5bb690[_0xd29a('0x1d')]['limit']||null:null,'include':_0x5bb690['options']?_0x5bb690[_0xd29a('0x1d')][_0xd29a('0x1f')]?_[_0xd29a('0x20')](_0x5bb690[_0xd29a('0x1d')]['include'],function(_0x1f4930){return{'model':db[_0x1f4930[_0xd29a('0x21')]],'as':_0x1f4930['as'],'attributes':_0x1f4930[_0xd29a('0x22')],'include':_0x1f4930[_0xd29a('0x1f')]?_['map'](_0x1f4930[_0xd29a('0x1f')],function(_0x225467){return{'model':db[_0x225467[_0xd29a('0x21')]],'as':_0x225467['as'],'attributes':_0x225467[_0xd29a('0x22')],'include':_0x225467['include']?_[_0xd29a('0x20')](_0x225467['include'],function(_0x2bedec){return{'model':db[_0x2bedec[_0xd29a('0x21')]],'as':_0x2bedec['as'],'attributes':_0x2bedec[_0xd29a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd29a('0x23')](function(_0x35ae70){logger[_0xd29a('0x11')]('GetChatQueue',_0x5bb690);logger[_0xd29a('0x24')](_0xd29a('0x1a'),_0x5bb690,JSON['stringify'](_0x35ae70));_0x58f392(_0x35ae70);})['catch'](function(_0x4abcb7){logger['error'](_0xd29a('0x1a'),_0x4abcb7[_0xd29a('0x17')],_0x5bb690);_0x29c23f(_0x3e383e['error'](0x1f4,_0x4abcb7[_0xd29a('0x17')]));});});};exports[_0xd29a('0x25')]=function(_0x4cab9a){var _0x1b4559=this;return new Promise(function(_0x286cb4,_0xfdcded){return db[_0xd29a('0x1b')]['find']({'raw':_0x4cab9a[_0xd29a('0x1d')]?_0x4cab9a[_0xd29a('0x1d')][_0xd29a('0x1e')]===undefined?!![]:![]:!![],'where':_0x4cab9a['options']?_0x4cab9a[_0xd29a('0x1d')][_0xd29a('0x26')]||null:null,'attributes':_0x4cab9a[_0xd29a('0x1d')]?_0x4cab9a[_0xd29a('0x1d')]['attributes']||null:null,'include':_0x4cab9a[_0xd29a('0x1d')]?_0x4cab9a[_0xd29a('0x1d')][_0xd29a('0x1f')]?_[_0xd29a('0x20')](_0x4cab9a[_0xd29a('0x1d')][_0xd29a('0x1f')],function(_0x5abb90){return{'model':db[_0x5abb90[_0xd29a('0x21')]],'as':_0x5abb90['as'],'attributes':_0x5abb90['attributes'],'include':_0x5abb90['include']?_[_0xd29a('0x20')](_0x5abb90[_0xd29a('0x1f')],function(_0x49d9bd){return{'model':db[_0x49d9bd[_0xd29a('0x21')]],'as':_0x49d9bd['as'],'attributes':_0x49d9bd['attributes'],'include':_0x49d9bd['include']?_['map'](_0x49d9bd[_0xd29a('0x1f')],function(_0x84c9e0){return{'model':db[_0x84c9e0[_0xd29a('0x21')]],'as':_0x84c9e0['as'],'attributes':_0x84c9e0[_0xd29a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd29a('0x23')](function(_0x4284ab){logger[_0xd29a('0x11')]('ShowChatQueue',_0x4cab9a);logger[_0xd29a('0x24')](_0xd29a('0x25'),_0x4cab9a,JSON['stringify'](_0x4284ab));_0x286cb4(_0x4284ab);})[_0xd29a('0x19')](function(_0x57364e){logger[_0xd29a('0x15')](_0xd29a('0x25'),_0x57364e[_0xd29a('0x17')],_0x4cab9a);_0xfdcded(_0x1b4559[_0xd29a('0x15')](0x1f4,_0x57364e[_0xd29a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 52ff7cc..9bf5f34 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 faccf78..1d672b2 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 _0x8c4a=['removeTeams','removeAgents','exports','path','express','Router','../../config/environment','isAuthenticated','describe','/:id','show','get','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy'];(function(_0x3b42ab,_0x228050){var _0x4a633e=function(_0x128448){while(--_0x128448){_0x3b42ab['push'](_0x3b42ab['shift']());}};_0x4a633e(++_0x228050);}(_0x8c4a,0x13b));var _0xa8c4=function(_0x39a8e0,_0x49ff10){_0x39a8e0=_0x39a8e0-0x0;var _0x232e69=_0x8c4a[_0x39a8e0];return _0x232e69;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa8c4('0x0'));var timeout=require('connect-timeout');var express=require(_0xa8c4('0x1'));var router=express[_0xa8c4('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa8c4('0x3'));var controller=require('./chatQueue.controller');router['get']('/',auth[_0xa8c4('0x4')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa8c4('0x5')]);router['get'](_0xa8c4('0x6'),auth['isAuthenticated'](),controller[_0xa8c4('0x7')]);router[_0xa8c4('0x8')](_0xa8c4('0x9'),auth['isAuthenticated'](),controller[_0xa8c4('0xa')]);router[_0xa8c4('0x8')](_0xa8c4('0xb'),auth[_0xa8c4('0x4')](),controller[_0xa8c4('0xc')]);router[_0xa8c4('0x8')](_0xa8c4('0xd'),auth['isAuthenticated'](),controller[_0xa8c4('0xe')]);router[_0xa8c4('0xf')]('/',auth[_0xa8c4('0x4')](),controller[_0xa8c4('0x10')]);router['post']('/:id/teams',auth[_0xa8c4('0x4')](),controller[_0xa8c4('0x11')]);router[_0xa8c4('0xf')](_0xa8c4('0xd'),auth['isAuthenticated'](),controller[_0xa8c4('0x12')]);router[_0xa8c4('0x13')](_0xa8c4('0x6'),auth[_0xa8c4('0x4')](),controller[_0xa8c4('0x14')]);router[_0xa8c4('0x15')](_0xa8c4('0x6'),auth[_0xa8c4('0x4')](),controller[_0xa8c4('0x16')]);router[_0xa8c4('0x15')](_0xa8c4('0xb'),auth[_0xa8c4('0x4')](),controller[_0xa8c4('0x17')]);router['delete']('/:id/users',auth[_0xa8c4('0x4')](),controller[_0xa8c4('0x18')]);module[_0xa8c4('0x19')]=router; \ No newline at end of file +var _0xf59e=['get','isAuthenticated','index','/describe','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller'];(function(_0x487b44,_0x376771){var _0xfd9ee9=function(_0x23c606){while(--_0x23c606){_0x487b44['push'](_0x487b44['shift']());}};_0xfd9ee9(++_0x376771);}(_0xf59e,0x15f));var _0xef59=function(_0x2e1378,_0x27f0d2){_0x2e1378=_0x2e1378-0x0;var _0x26a103=_0xf59e[_0x2e1378];return _0x26a103;};'use strict';var multer=require(_0xef59('0x0'));var util=require(_0xef59('0x1'));var path=require(_0xef59('0x2'));var timeout=require(_0xef59('0x3'));var express=require(_0xef59('0x4'));var router=express['Router']();var auth=require(_0xef59('0x5'));var interaction=require(_0xef59('0x6'));var config=require(_0xef59('0x7'));var controller=require(_0xef59('0x8'));router[_0xef59('0x9')]('/',auth[_0xef59('0xa')](),controller[_0xef59('0xb')]);router[_0xef59('0x9')](_0xef59('0xc'),auth['isAuthenticated'](),controller[_0xef59('0xd')]);router[_0xef59('0x9')](_0xef59('0xe'),auth[_0xef59('0xa')](),controller['show']);router['get']('/:id/members',auth[_0xef59('0xa')](),controller[_0xef59('0xf')]);router[_0xef59('0x9')](_0xef59('0x10'),auth['isAuthenticated'](),controller[_0xef59('0x11')]);router['get'](_0xef59('0x12'),auth['isAuthenticated'](),controller[_0xef59('0x13')]);router[_0xef59('0x14')]('/',auth['isAuthenticated'](),controller[_0xef59('0x15')]);router[_0xef59('0x14')]('/:id/teams',auth[_0xef59('0xa')](),controller[_0xef59('0x16')]);router['post']('/:id/users',auth[_0xef59('0xa')](),controller[_0xef59('0x17')]);router[_0xef59('0x18')](_0xef59('0xe'),auth[_0xef59('0xa')](),controller['update']);router[_0xef59('0x19')](_0xef59('0xe'),auth['isAuthenticated'](),controller[_0xef59('0x1a')]);router['delete']('/:id/teams',auth[_0xef59('0xa')](),controller[_0xef59('0x1b')]);router[_0xef59('0x19')]('/:id/users',auth[_0xef59('0xa')](),controller[_0xef59('0x1c')]);module[_0xef59('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 43a8f44..b5e4b0f 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 _0x286c=['DATE','moment','exports','STRING'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x286c,0x1e5));var _0xc286=function(_0x55a731,_0x1b2ee1){_0x55a731=_0x55a731-0x0;var _0x2ae7fd=_0x286c[_0x55a731];return _0x2ae7fd;};'use strict';var moment=require(_0xc286('0x0'));var Sequelize=require('sequelize');module[_0xc286('0x1')]={'uniqueid':{'type':Sequelize[_0xc286('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc286('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc286('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc286('0x3')]},'reason':{'type':Sequelize[_0xc286('0x2')]}}; \ No newline at end of file +var _0xac51=['STRING','DATE','moment','sequelize','exports'];(function(_0x31d7a5,_0x11889d){var _0x3cc453=function(_0x495718){while(--_0x495718){_0x31d7a5['push'](_0x31d7a5['shift']());}};_0x3cc453(++_0x11889d);}(_0xac51,0xe8));var _0x1ac5=function(_0x1624f5,_0xa2f147){_0x1624f5=_0x1624f5-0x0;var _0x23b431=_0xac51[_0x1624f5];return _0x23b431;};'use strict';var moment=require(_0x1ac5('0x0'));var Sequelize=require(_0x1ac5('0x1'));module[_0x1ac5('0x2')]={'uniqueid':{'type':Sequelize[_0x1ac5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1ac5('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1ac5('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index f257c9d..1a3ca7e 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 _0x3f4b=['bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','options','ChatQueueReport','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x4b7380,_0x3e040b){var _0x3a2f6b=function(_0x4792de){while(--_0x4792de){_0x4b7380['push'](_0x4b7380['shift']());}};_0x3a2f6b(++_0x3e040b);}(_0x3f4b,0x1d8));var _0xb3f4=function(_0x5948eb,_0x5bd90a){_0x5948eb=_0x5948eb-0x0;var _0x408531=_0x3f4b[_0x5948eb];return _0x408531;};'use strict';var pdf=require(_0xb3f4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb3f4('0x1'));var zipdir=require(_0xb3f4('0x2'));var jsonpatch=require(_0xb3f4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb3f4('0x4'));var Mustache=require(_0xb3f4('0x5'));var util=require(_0xb3f4('0x6'));var path=require(_0xb3f4('0x7'));var sox=require('sox');var csv=require(_0xb3f4('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb3f4('0x9'));var squel=require(_0xb3f4('0xa'));var crypto=require(_0xb3f4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb3f4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xb3f4('0xd'));var Redis=require(_0xb3f4('0xe'));var qs=require(_0xb3f4('0xf'));var logger=require(_0xb3f4('0x10'))('api');var utils=require(_0xb3f4('0x11'));var config=require(_0xb3f4('0x12'));var db=require(_0xb3f4('0x13'))['db'];function respondWithStatusCode(_0x2e8ce1,_0x4711aa){_0x4711aa=_0x4711aa||0xcc;return function(_0xf567a8){if(_0xf567a8){return _0x2e8ce1[_0xb3f4('0x14')](_0x4711aa);}return _0x2e8ce1['status'](_0x4711aa)[_0xb3f4('0x15')]();};}function respondWithResult(_0x39849a,_0x4fcca3){_0x4fcca3=_0x4fcca3||0xc8;return function(_0x2a9df3){if(_0x2a9df3){return _0x39849a[_0xb3f4('0x16')](_0x4fcca3)['json'](_0x2a9df3);}};}function respondWithFilteredResult(_0x16b44c,_0x307ab1){return function(_0xfa8513){if(_0xfa8513){var _0x2e4d8b=_0xfa8513[_0xb3f4('0x17')],_0x480a41=_0x307ab1[_0xb3f4('0x18')],_0x39e21a=_0x307ab1[_0xb3f4('0x18')]+_0x307ab1[_0xb3f4('0x19')],_0x3705dd;if(_0x39e21a>=_0x2e4d8b){_0x39e21a=_0x2e4d8b;_0x3705dd=0xc8;}else{_0x3705dd=0xce;}_0x16b44c[_0xb3f4('0x16')](_0x3705dd);return _0x16b44c['set'](_0xb3f4('0x1a'),_0x480a41+'-'+_0x39e21a+'/'+_0x2e4d8b)['json'](_0xfa8513);}return null;};}function patchUpdates(_0x110359){return function(_0x551ecd){try{jsonpatch[_0xb3f4('0x1b')](_0x551ecd,_0x110359,!![]);}catch(_0x298006){return BPromise[_0xb3f4('0x1c')](_0x298006);}return _0x551ecd['save']();};}function saveUpdates(_0x57f189,_0x56e02d){return function(_0x12f1a7){if(_0x12f1a7){return _0x12f1a7[_0xb3f4('0x1d')](_0x57f189)[_0xb3f4('0x1e')](function(_0x46c954){return _0x46c954;});}return null;};}function removeEntity(_0x4cec22,_0x511649){return function(_0x4b5afe){if(_0x4b5afe){return _0x4b5afe[_0xb3f4('0x1f')]()[_0xb3f4('0x1e')](function(){_0x4cec22[_0xb3f4('0x16')](0xcc)[_0xb3f4('0x15')]();});}};}function handleEntityNotFound(_0x4ef8c0,_0x4448ab){return function(_0x1660c7){if(!_0x1660c7){_0x4ef8c0[_0xb3f4('0x14')](0x194);}return _0x1660c7;};}function handleError(_0xc5453c,_0x4d9c80){_0x4d9c80=_0x4d9c80||0x1f4;return function(_0xe8d60f){logger[_0xb3f4('0x20')](_0xe8d60f['stack']);if(_0xe8d60f['name']){delete _0xe8d60f[_0xb3f4('0x21')];}_0xc5453c[_0xb3f4('0x16')](_0x4d9c80)[_0xb3f4('0x22')](_0xe8d60f);};}exports[_0xb3f4('0x23')]=function(_0x4def5f,_0x5a9682){var _0x4d0634={},_0x44591c={},_0x481548={'count':0x0,'rows':[]};var _0x2a2f8a=db['ChatQueueReport']['rawAttributes'];_0x44591c[_0xb3f4('0x24')]=_[_0xb3f4('0x25')](_0x2a2f8a);_0x44591c['query']=_['keys'](_0x4def5f[_0xb3f4('0x26')]);_0x44591c[_0xb3f4('0x27')]=_[_0xb3f4('0x28')](_0x44591c['model'],_0x44591c[_0xb3f4('0x26')]);_0x4d0634[_0xb3f4('0x29')]=_[_0xb3f4('0x28')](_0x44591c[_0xb3f4('0x24')],qs[_0xb3f4('0x2a')](_0x4def5f[_0xb3f4('0x26')][_0xb3f4('0x2a')]));_0x4d0634['attributes']=_0x4d0634[_0xb3f4('0x29')][_0xb3f4('0x2b')]?_0x4d0634[_0xb3f4('0x29')]:_0x44591c[_0xb3f4('0x24')];if(!_0x4def5f[_0xb3f4('0x26')][_0xb3f4('0x2c')](_0xb3f4('0x2d'))){_0x4d0634[_0xb3f4('0x19')]=qs[_0xb3f4('0x19')](_0x4def5f['query'][_0xb3f4('0x19')]);_0x4d0634['offset']=qs[_0xb3f4('0x18')](_0x4def5f[_0xb3f4('0x26')][_0xb3f4('0x18')]);}_0x4d0634[_0xb3f4('0x2e')]=qs['sort'](_0x4def5f[_0xb3f4('0x26')][_0xb3f4('0x2f')]);_0x4d0634[_0xb3f4('0x30')]=qs[_0xb3f4('0x27')](_[_0xb3f4('0x31')](_0x4def5f[_0xb3f4('0x26')],_0x44591c[_0xb3f4('0x27')]));if(_0x4def5f[_0xb3f4('0x26')][_0xb3f4('0x32')]){_0x4d0634[_0xb3f4('0x30')]=_[_0xb3f4('0x33')](_0x4d0634['where'],{'$or':_[_0xb3f4('0x34')](_0x2a2f8a,function(_0x473a17){if(_0x473a17[_0xb3f4('0x35')][_0xb3f4('0x36')]!=='VIRTUAL'){var _0x826cdb={};_0x826cdb[_0x473a17['field']]={'$like':'%'+_0x4def5f[_0xb3f4('0x26')]['filter']+'%'};return _0x826cdb;}})});}_0x4d0634=_['merge']({},_0x4d0634,_0x4def5f[_0xb3f4('0x37')]);var _0x3f8a38={'where':_0x4d0634['where']};return db[_0xb3f4('0x38')]['count'](_0x3f8a38)[_0xb3f4('0x1e')](function(_0x21d89a){_0x481548['count']=_0x21d89a;if(_0x4def5f[_0xb3f4('0x26')][_0xb3f4('0x39')]){_0x4d0634[_0xb3f4('0x3a')]=[{'all':!![]}];}return db[_0xb3f4('0x38')][_0xb3f4('0x3b')](_0x4d0634);})['then'](function(_0x150c48){_0x481548['rows']=_0x150c48;return _0x481548;})[_0xb3f4('0x1e')](respondWithFilteredResult(_0x5a9682,_0x4d0634))[_0xb3f4('0x3c')](handleError(_0x5a9682,null));};exports[_0xb3f4('0x3d')]=function(_0x16280d,_0x4b5a72){var _0xaeff34={'raw':!![],'where':{'id':_0x16280d[_0xb3f4('0x3e')]['id']}},_0x496505={};_0x496505[_0xb3f4('0x24')]=_[_0xb3f4('0x25')](db[_0xb3f4('0x38')][_0xb3f4('0x3f')]);_0x496505[_0xb3f4('0x26')]=_['keys'](_0x16280d['query']);_0x496505['filters']=_[_0xb3f4('0x28')](_0x496505[_0xb3f4('0x24')],_0x496505['query']);_0xaeff34[_0xb3f4('0x29')]=_[_0xb3f4('0x28')](_0x496505[_0xb3f4('0x24')],qs[_0xb3f4('0x2a')](_0x16280d[_0xb3f4('0x26')][_0xb3f4('0x2a')]));_0xaeff34[_0xb3f4('0x29')]=_0xaeff34[_0xb3f4('0x29')][_0xb3f4('0x2b')]?_0xaeff34[_0xb3f4('0x29')]:_0x496505['model'];if(_0x16280d[_0xb3f4('0x26')][_0xb3f4('0x39')]){_0xaeff34[_0xb3f4('0x3a')]=[{'all':!![]}];}_0xaeff34=_[_0xb3f4('0x33')]({},_0xaeff34,_0x16280d[_0xb3f4('0x37')]);return db[_0xb3f4('0x38')]['find'](_0xaeff34)[_0xb3f4('0x1e')](handleEntityNotFound(_0x4b5a72,null))[_0xb3f4('0x1e')](respondWithResult(_0x4b5a72,null))['catch'](handleError(_0x4b5a72,null));};exports[_0xb3f4('0x40')]=function(_0x1107f4,_0x49f975){return db['ChatQueueReport'][_0xb3f4('0x40')](_0x1107f4[_0xb3f4('0x41')],{})[_0xb3f4('0x1e')](respondWithResult(_0x49f975,0xc9))[_0xb3f4('0x3c')](handleError(_0x49f975,null));};exports[_0xb3f4('0x1d')]=function(_0x3f489f,_0x4ae180){if(_0x3f489f[_0xb3f4('0x41')]['id']){delete _0x3f489f[_0xb3f4('0x41')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x3f489f[_0xb3f4('0x3e')]['id']}})[_0xb3f4('0x1e')](handleEntityNotFound(_0x4ae180,null))['then'](saveUpdates(_0x3f489f[_0xb3f4('0x41')],null))[_0xb3f4('0x1e')](respondWithResult(_0x4ae180,null))['catch'](handleError(_0x4ae180,null));};exports[_0xb3f4('0x1f')]=function(_0x9311b7,_0x3ce683){return db['ChatQueueReport'][_0xb3f4('0x42')]({'where':{'id':_0x9311b7[_0xb3f4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ce683,null))[_0xb3f4('0x1e')](removeEntity(_0x3ce683,null))[_0xb3f4('0x3c')](handleError(_0x3ce683,null));};exports[_0xb3f4('0x43')]=function(_0x4c7a51,_0x22d05c){return db[_0xb3f4('0x38')][_0xb3f4('0x43')]()['then'](respondWithResult(_0x22d05c,null))[_0xb3f4('0x3c')](handleError(_0x22d05c,null));}; \ No newline at end of file +var _0xe069=['desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','limit','set','reject','save','then','destroy','error','stack','name','send','ChatQueueReport','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xe069,0x1db));var _0x9e06=function(_0x45d354,_0x5ebfb1){_0x45d354=_0x45d354-0x0;var _0x13dfeb=_0xe069[_0x45d354];return _0x13dfeb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9e06('0x0'));var zipdir=require(_0x9e06('0x1'));var jsonpatch=require(_0x9e06('0x2'));var rp=require(_0x9e06('0x3'));var moment=require(_0x9e06('0x4'));var BPromise=require(_0x9e06('0x5'));var Mustache=require(_0x9e06('0x6'));var util=require(_0x9e06('0x7'));var path=require(_0x9e06('0x8'));var sox=require(_0x9e06('0x9'));var csv=require(_0x9e06('0xa'));var ejs=require(_0x9e06('0xb'));var fs=require('fs');var _=require(_0x9e06('0xc'));var squel=require(_0x9e06('0xd'));var crypto=require('crypto');var jsforce=require(_0x9e06('0xe'));var deskjs=require(_0x9e06('0xf'));var toCsv=require(_0x9e06('0xa'));var querystring=require(_0x9e06('0x10'));var Papa=require(_0x9e06('0x11'));var authService=require(_0x9e06('0x12'));var hardwareService=require(_0x9e06('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x9e06('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9e06('0x15'))['db'];function respondWithStatusCode(_0x3955a7,_0x242d81){_0x242d81=_0x242d81||0xcc;return function(_0x24c6e6){if(_0x24c6e6){return _0x3955a7[_0x9e06('0x16')](_0x242d81);}return _0x3955a7[_0x9e06('0x17')](_0x242d81)[_0x9e06('0x18')]();};}function respondWithResult(_0x147944,_0x4bd81a){_0x4bd81a=_0x4bd81a||0xc8;return function(_0x1b1e1b){if(_0x1b1e1b){return _0x147944[_0x9e06('0x17')](_0x4bd81a)[_0x9e06('0x19')](_0x1b1e1b);}};}function respondWithFilteredResult(_0xe526c8,_0x44a418){return function(_0x50738b){if(_0x50738b){var _0x3c9e05=_0x50738b[_0x9e06('0x1a')],_0x4aa43e=_0x44a418['offset'],_0x4a4ed1=_0x44a418['offset']+_0x44a418[_0x9e06('0x1b')],_0x26e3d5;if(_0x4a4ed1>=_0x3c9e05){_0x4a4ed1=_0x3c9e05;_0x26e3d5=0xc8;}else{_0x26e3d5=0xce;}_0xe526c8[_0x9e06('0x17')](_0x26e3d5);return _0xe526c8[_0x9e06('0x1c')]('Content-Range',_0x4aa43e+'-'+_0x4a4ed1+'/'+_0x3c9e05)[_0x9e06('0x19')](_0x50738b);}return null;};}function patchUpdates(_0x38b9b7){return function(_0x41817){try{jsonpatch['apply'](_0x41817,_0x38b9b7,!![]);}catch(_0x15e536){return BPromise[_0x9e06('0x1d')](_0x15e536);}return _0x41817[_0x9e06('0x1e')]();};}function saveUpdates(_0x38d2f1,_0x3c2879){return function(_0x50b977){if(_0x50b977){return _0x50b977['update'](_0x38d2f1)[_0x9e06('0x1f')](function(_0x256c84){return _0x256c84;});}return null;};}function removeEntity(_0x320009,_0x733bd4){return function(_0x29c980){if(_0x29c980){return _0x29c980[_0x9e06('0x20')]()[_0x9e06('0x1f')](function(){_0x320009['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x359aa7,_0x505500){return function(_0x250896){if(!_0x250896){_0x359aa7[_0x9e06('0x16')](0x194);}return _0x250896;};}function handleError(_0x1de63c,_0x8e235f){_0x8e235f=_0x8e235f||0x1f4;return function(_0x791e5a){logger[_0x9e06('0x21')](_0x791e5a[_0x9e06('0x22')]);if(_0x791e5a[_0x9e06('0x23')]){delete _0x791e5a[_0x9e06('0x23')];}_0x1de63c[_0x9e06('0x17')](_0x8e235f)[_0x9e06('0x24')](_0x791e5a);};}exports['index']=function(_0x2feb83,_0x357ee1){var _0x3d2a72={},_0xc3d185={},_0x3b2157={'count':0x0,'rows':[]};var _0x300711=db[_0x9e06('0x25')]['rawAttributes'];_0xc3d185[_0x9e06('0x26')]=_[_0x9e06('0x27')](_0x300711);_0xc3d185['query']=_[_0x9e06('0x27')](_0x2feb83[_0x9e06('0x28')]);_0xc3d185[_0x9e06('0x29')]=_['intersection'](_0xc3d185[_0x9e06('0x26')],_0xc3d185['query']);_0x3d2a72[_0x9e06('0x2a')]=_[_0x9e06('0x2b')](_0xc3d185[_0x9e06('0x26')],qs[_0x9e06('0x2c')](_0x2feb83[_0x9e06('0x28')][_0x9e06('0x2c')]));_0x3d2a72[_0x9e06('0x2a')]=_0x3d2a72[_0x9e06('0x2a')][_0x9e06('0x2d')]?_0x3d2a72[_0x9e06('0x2a')]:_0xc3d185[_0x9e06('0x26')];if(!_0x2feb83['query'][_0x9e06('0x2e')](_0x9e06('0x2f'))){_0x3d2a72[_0x9e06('0x1b')]=qs[_0x9e06('0x1b')](_0x2feb83[_0x9e06('0x28')]['limit']);_0x3d2a72[_0x9e06('0x30')]=qs[_0x9e06('0x30')](_0x2feb83['query'][_0x9e06('0x30')]);}_0x3d2a72['order']=qs[_0x9e06('0x31')](_0x2feb83['query'][_0x9e06('0x31')]);_0x3d2a72[_0x9e06('0x32')]=qs['filters'](_['pick'](_0x2feb83[_0x9e06('0x28')],_0xc3d185['filters']));if(_0x2feb83[_0x9e06('0x28')][_0x9e06('0x33')]){_0x3d2a72['where']=_[_0x9e06('0x34')](_0x3d2a72[_0x9e06('0x32')],{'$or':_[_0x9e06('0x35')](_0x300711,function(_0x252443){if(_0x252443[_0x9e06('0x36')][_0x9e06('0x37')]!==_0x9e06('0x38')){var _0x2ff545={};_0x2ff545[_0x252443[_0x9e06('0x39')]]={'$like':'%'+_0x2feb83['query'][_0x9e06('0x33')]+'%'};return _0x2ff545;}})});}_0x3d2a72=_[_0x9e06('0x34')]({},_0x3d2a72,_0x2feb83[_0x9e06('0x3a')]);var _0x5e78b7={'where':_0x3d2a72['where']};return db['ChatQueueReport'][_0x9e06('0x1a')](_0x5e78b7)[_0x9e06('0x1f')](function(_0x21dce2){_0x3b2157[_0x9e06('0x1a')]=_0x21dce2;if(_0x2feb83[_0x9e06('0x28')][_0x9e06('0x3b')]){_0x3d2a72['include']=[{'all':!![]}];}return db[_0x9e06('0x25')][_0x9e06('0x3c')](_0x3d2a72);})[_0x9e06('0x1f')](function(_0x369ab0){_0x3b2157[_0x9e06('0x3d')]=_0x369ab0;return _0x3b2157;})['then'](respondWithFilteredResult(_0x357ee1,_0x3d2a72))[_0x9e06('0x3e')](handleError(_0x357ee1,null));};exports['show']=function(_0x28900d,_0x39b552){var _0x516ff9={'raw':!![],'where':{'id':_0x28900d[_0x9e06('0x3f')]['id']}},_0x2ee904={};_0x2ee904[_0x9e06('0x26')]=_[_0x9e06('0x27')](db[_0x9e06('0x25')][_0x9e06('0x40')]);_0x2ee904['query']=_[_0x9e06('0x27')](_0x28900d[_0x9e06('0x28')]);_0x2ee904[_0x9e06('0x29')]=_[_0x9e06('0x2b')](_0x2ee904['model'],_0x2ee904[_0x9e06('0x28')]);_0x516ff9[_0x9e06('0x2a')]=_[_0x9e06('0x2b')](_0x2ee904[_0x9e06('0x26')],qs[_0x9e06('0x2c')](_0x28900d[_0x9e06('0x28')][_0x9e06('0x2c')]));_0x516ff9[_0x9e06('0x2a')]=_0x516ff9[_0x9e06('0x2a')][_0x9e06('0x2d')]?_0x516ff9[_0x9e06('0x2a')]:_0x2ee904[_0x9e06('0x26')];if(_0x28900d[_0x9e06('0x28')][_0x9e06('0x3b')]){_0x516ff9[_0x9e06('0x41')]=[{'all':!![]}];}_0x516ff9=_[_0x9e06('0x34')]({},_0x516ff9,_0x28900d[_0x9e06('0x3a')]);return db[_0x9e06('0x25')]['find'](_0x516ff9)[_0x9e06('0x1f')](handleEntityNotFound(_0x39b552,null))[_0x9e06('0x1f')](respondWithResult(_0x39b552,null))[_0x9e06('0x3e')](handleError(_0x39b552,null));};exports[_0x9e06('0x42')]=function(_0x3b9ede,_0x5c2b06){return db[_0x9e06('0x25')]['create'](_0x3b9ede[_0x9e06('0x43')],{})['then'](respondWithResult(_0x5c2b06,0xc9))[_0x9e06('0x3e')](handleError(_0x5c2b06,null));};exports['update']=function(_0x4e13b1,_0x3e7976){if(_0x4e13b1['body']['id']){delete _0x4e13b1[_0x9e06('0x43')]['id'];}return db[_0x9e06('0x25')][_0x9e06('0x44')]({'where':{'id':_0x4e13b1[_0x9e06('0x3f')]['id']}})[_0x9e06('0x1f')](handleEntityNotFound(_0x3e7976,null))[_0x9e06('0x1f')](saveUpdates(_0x4e13b1[_0x9e06('0x43')],null))[_0x9e06('0x1f')](respondWithResult(_0x3e7976,null))[_0x9e06('0x3e')](handleError(_0x3e7976,null));};exports[_0x9e06('0x20')]=function(_0x268f01,_0x5039e7){return db['ChatQueueReport'][_0x9e06('0x44')]({'where':{'id':_0x268f01['params']['id']}})['then'](handleEntityNotFound(_0x5039e7,null))[_0x9e06('0x1f')](removeEntity(_0x5039e7,null))[_0x9e06('0x3e')](handleError(_0x5039e7,null));};exports[_0x9e06('0x45')]=function(_0x4243f1,_0x452b3d){return db[_0x9e06('0x25')][_0x9e06('0x45')]()[_0x9e06('0x1f')](respondWithResult(_0x452b3d,null))[_0x9e06('0x3e')](handleError(_0x452b3d,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 5e0b3ba..096a012 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 _0x55ca=['request-promise','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','bluebird'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x55ca,0x126));var _0xa55c=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x55ca[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var attributes=require('./chatQueueReport.attributes');module[_0xa55c('0x4')]=function(_0x2db02a,_0xcb02e3){return _0x2db02a[_0xa55c('0x5')](_0xa55c('0x6'),attributes,{'tableName':_0xa55c('0x7'),'paranoid':![],'indexes':[{'name':_0xa55c('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['define','ChatQueueReport','report_chat_queue','uniqueid','lodash','../../config/logger','api','moment','./chatQueueReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x2146b2,_0x3cf9f4){_0x2146b2=_0x2146b2-0x0;var _0x2884b1=_0x3e74[_0x2146b2];return _0x2884b1;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x43e7('0x4'));module['exports']=function(_0x128b0f,_0xe838b4){return _0x128b0f[_0x43e7('0x5')](_0x43e7('0x6'),attributes,{'tableName':_0x43e7('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x43e7('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 1c403d1..8d2b612 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 _0x7ca6=['ioredis','../../mysqldb','../../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','error','code','message','result','catch','CreateChatQueueReport','body','options','raw','debug','UpdateChatQueueReport','ChatQueueReport','where','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x1f049e,_0x16a334){var _0x443456=function(_0x4526e1){while(--_0x4526e1){_0x1f049e['push'](_0x1f049e['shift']());}};_0x443456(++_0x16a334);}(_0x7ca6,0x145));var _0x67ca=function(_0x4f62b9,_0x55595b){_0x4f62b9=_0x4f62b9-0x0;var _0x549d03=_0x7ca6[_0x4f62b9];return _0x549d03;};'use strict';var _=require(_0x67ca('0x0'));var util=require(_0x67ca('0x1'));var moment=require(_0x67ca('0x2'));var BPromise=require(_0x67ca('0x3'));var rs=require(_0x67ca('0x4'));var fs=require('fs');var Redis=require(_0x67ca('0x5'));var db=require(_0x67ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x67ca('0x7'))(_0x67ca('0x8'));var config=require(_0x67ca('0x9'));var jayson=require(_0x67ca('0xa'));var client=jayson[_0x67ca('0xb')][_0x67ca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eac66,_0xe30cee,_0x1371e1){return new BPromise(function(_0x2bf601,_0x3e669b){return client['request'](_0x5eac66,_0x1371e1)[_0x67ca('0xd')](function(_0x2cc578){logger[_0x67ca('0xe')](_0x67ca('0xf'),_0xe30cee,_0x67ca('0x10'));logger['debug'](_0x67ca('0x11'),_0xe30cee,_0x67ca('0x10'),JSON[_0x67ca('0x12')](_0x2cc578));if(_0x2cc578[_0x67ca('0x13')]){if(_0x2cc578['error'][_0x67ca('0x14')]===0x1f4){logger[_0x67ca('0x13')](_0x67ca('0xf'),_0xe30cee,_0x2cc578[_0x67ca('0x13')][_0x67ca('0x15')]);return _0x3e669b(_0x2cc578[_0x67ca('0x13')]['message']);}logger[_0x67ca('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0xe30cee,_0x2cc578[_0x67ca('0x13')][_0x67ca('0x15')]);return _0x2bf601(_0x2cc578['error'][_0x67ca('0x15')]);}else{logger[_0x67ca('0xe')](_0x67ca('0xf'),_0xe30cee,_0x67ca('0x10'));_0x2bf601(_0x2cc578[_0x67ca('0x16')][_0x67ca('0x15')]);}})[_0x67ca('0x17')](function(_0x11ef5f){logger[_0x67ca('0x13')](_0x67ca('0xf'),_0xe30cee,_0x11ef5f);_0x3e669b(_0x11ef5f);});});}exports[_0x67ca('0x18')]=function(_0x58b918){var _0x3c85db=this;return new Promise(function(_0x1bd80e,_0x267065){return db['ChatQueueReport']['create'](_0x58b918[_0x67ca('0x19')],{'raw':_0x58b918[_0x67ca('0x1a')]?_0x58b918['options'][_0x67ca('0x1b')]===undefined?!![]:![]:!![]})[_0x67ca('0xd')](function(_0x4549ad){logger[_0x67ca('0xe')](_0x67ca('0x18'),_0x58b918);logger[_0x67ca('0x1c')](_0x67ca('0x18'),_0x58b918,JSON[_0x67ca('0x12')](_0x4549ad));_0x1bd80e(_0x4549ad);})[_0x67ca('0x17')](function(_0x4ec063){logger[_0x67ca('0x13')](_0x67ca('0x18'),_0x4ec063[_0x67ca('0x15')],_0x58b918);_0x267065(_0x3c85db[_0x67ca('0x13')](0x1f4,_0x4ec063[_0x67ca('0x15')]));});});};exports[_0x67ca('0x1d')]=function(_0x1b5346){var _0x451c77=this;return new Promise(function(_0x4e5455,_0x431e74){return db[_0x67ca('0x1e')]['update'](_0x1b5346[_0x67ca('0x19')],{'raw':_0x1b5346[_0x67ca('0x1a')]?_0x1b5346[_0x67ca('0x1a')][_0x67ca('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5346[_0x67ca('0x1a')]?_0x1b5346[_0x67ca('0x1a')][_0x67ca('0x1f')]||null:null,'attributes':_0x1b5346[_0x67ca('0x1a')]?_0x1b5346[_0x67ca('0x1a')]['attributes']||null:null,'limit':_0x1b5346[_0x67ca('0x1a')]?_0x1b5346[_0x67ca('0x1a')][_0x67ca('0x20')]||null:null})['then'](function(_0x453fd1){logger[_0x67ca('0xe')](_0x67ca('0x1d'),_0x1b5346);logger[_0x67ca('0x1c')](_0x67ca('0x1d'),_0x1b5346,JSON[_0x67ca('0x12')](_0x453fd1));_0x4e5455(_0x453fd1);})[_0x67ca('0x17')](function(_0x35cc7a){logger[_0x67ca('0x13')](_0x67ca('0x1d'),_0x35cc7a[_0x67ca('0x15')],_0x1b5346);_0x431e74(_0x451c77[_0x67ca('0x13')](0x1f4,_0x35cc7a[_0x67ca('0x15')]));});});}; \ No newline at end of file +var _0xd36d=['attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','UpdateChatQueueReport','update','where'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xd36d,0x160));var _0xdd36=function(_0x4a30c9,_0x558007){_0x4a30c9=_0x4a30c9-0x0;var _0x86c442=_0xd36d[_0x4a30c9];return _0x86c442;};'use strict';var _=require(_0xdd36('0x0'));var util=require('util');var moment=require(_0xdd36('0x1'));var BPromise=require(_0xdd36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd36('0x3'));var db=require(_0xdd36('0x4'))['db'];var utils=require(_0xdd36('0x5'));var logger=require('../../config/logger')(_0xdd36('0x6'));var config=require(_0xdd36('0x7'));var jayson=require(_0xdd36('0x8'));var client=jayson[_0xdd36('0x9')][_0xdd36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cfda4,_0x2b7d37,_0x47c509){return new BPromise(function(_0x4a7647,_0xd96ca6){return client[_0xdd36('0xb')](_0x4cfda4,_0x47c509)['then'](function(_0x5286f1){logger['info'](_0xdd36('0xc'),_0x2b7d37,_0xdd36('0xd'));logger[_0xdd36('0xe')](_0xdd36('0xf'),_0x2b7d37,_0xdd36('0xd'),JSON[_0xdd36('0x10')](_0x5286f1));if(_0x5286f1[_0xdd36('0x11')]){if(_0x5286f1[_0xdd36('0x11')][_0xdd36('0x12')]===0x1f4){logger[_0xdd36('0x11')](_0xdd36('0xc'),_0x2b7d37,_0x5286f1['error'][_0xdd36('0x13')]);return _0xd96ca6(_0x5286f1['error']['message']);}logger[_0xdd36('0x11')](_0xdd36('0xc'),_0x2b7d37,_0x5286f1['error']['message']);return _0x4a7647(_0x5286f1[_0xdd36('0x11')]['message']);}else{logger[_0xdd36('0x14')](_0xdd36('0xc'),_0x2b7d37,_0xdd36('0xd'));_0x4a7647(_0x5286f1[_0xdd36('0x15')][_0xdd36('0x13')]);}})[_0xdd36('0x16')](function(_0x162341){logger['error'](_0xdd36('0xc'),_0x2b7d37,_0x162341);_0xd96ca6(_0x162341);});});}exports['CreateChatQueueReport']=function(_0x245b24){var _0x387a5b=this;return new Promise(function(_0x1dabac,_0x4c7903){return db[_0xdd36('0x17')][_0xdd36('0x18')](_0x245b24[_0xdd36('0x19')],{'raw':_0x245b24[_0xdd36('0x1a')]?_0x245b24[_0xdd36('0x1a')][_0xdd36('0x1b')]===undefined?!![]:![]:!![]})[_0xdd36('0x1c')](function(_0x3f3f5e){logger[_0xdd36('0x14')](_0xdd36('0x1d'),_0x245b24);logger[_0xdd36('0xe')]('CreateChatQueueReport',_0x245b24,JSON[_0xdd36('0x10')](_0x3f3f5e));_0x1dabac(_0x3f3f5e);})['catch'](function(_0x59e99b){logger[_0xdd36('0x11')](_0xdd36('0x1d'),_0x59e99b[_0xdd36('0x13')],_0x245b24);_0x4c7903(_0x387a5b[_0xdd36('0x11')](0x1f4,_0x59e99b['message']));});});};exports[_0xdd36('0x1e')]=function(_0xcec4a6){var _0x41e5a7=this;return new Promise(function(_0x118b7d,_0x427b86){return db[_0xdd36('0x17')][_0xdd36('0x1f')](_0xcec4a6[_0xdd36('0x19')],{'raw':_0xcec4a6[_0xdd36('0x1a')]?_0xcec4a6[_0xdd36('0x1a')][_0xdd36('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcec4a6['options']?_0xcec4a6[_0xdd36('0x1a')][_0xdd36('0x20')]||null:null,'attributes':_0xcec4a6['options']?_0xcec4a6['options'][_0xdd36('0x21')]||null:null,'limit':_0xcec4a6['options']?_0xcec4a6[_0xdd36('0x1a')][_0xdd36('0x22')]||null:null})[_0xdd36('0x1c')](function(_0x10d228){logger['info']('UpdateChatQueueReport',_0xcec4a6);logger['debug'](_0xdd36('0x1e'),_0xcec4a6,JSON['stringify'](_0x10d228));_0x118b7d(_0x10d228);})['catch'](function(_0x4bc573){logger[_0xdd36('0x11')]('UpdateChatQueueReport',_0x4bc573[_0xdd36('0x13')],_0xcec4a6);_0x427b86(_0x41e5a7[_0xdd36('0x11')](0x1f4,_0x4bc573['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 84749fb..180e7af 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 _0xd0d6=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0xdfe866,_0x2e1ba1){var _0x39f106=function(_0x45b204){while(--_0x45b204){_0xdfe866['push'](_0xdfe866['shift']());}};_0x39f106(++_0x2e1ba1);}(_0xd0d6,0x140));var _0x6d0d=function(_0xb08ec2,_0x4b13cd){_0xb08ec2=_0xb08ec2-0x0;var _0x3938c4=_0xd0d6[_0xb08ec2];return _0x3938c4;};'use strict';var multer=require(_0x6d0d('0x0'));var util=require('util');var path=require(_0x6d0d('0x1'));var timeout=require(_0x6d0d('0x2'));var express=require(_0x6d0d('0x3'));var router=express[_0x6d0d('0x4')]();var auth=require(_0x6d0d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6d0d('0x6'));var controller=require(_0x6d0d('0x7'));router[_0x6d0d('0x8')]('/',auth[_0x6d0d('0x9')](),controller['index']);router[_0x6d0d('0x8')]('/describe',auth[_0x6d0d('0x9')](),controller[_0x6d0d('0xa')]);router[_0x6d0d('0x8')]('/:id',auth[_0x6d0d('0x9')](),controller[_0x6d0d('0xb')]);router[_0x6d0d('0xc')]('/',auth[_0x6d0d('0x9')](),controller[_0x6d0d('0xd')]);router[_0x6d0d('0xe')](_0x6d0d('0xf'),auth[_0x6d0d('0x9')](),controller[_0x6d0d('0x10')]);router[_0x6d0d('0x11')]('/:id',auth[_0x6d0d('0x9')](),controller[_0x6d0d('0x12')]);module[_0x6d0d('0x13')]=router; \ No newline at end of file +var _0x2ab4=['update','delete','destroy','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put'];(function(_0x28f33d,_0x493b89){var _0x26fc9d=function(_0x45323d){while(--_0x45323d){_0x28f33d['push'](_0x28f33d['shift']());}};_0x26fc9d(++_0x493b89);}(_0x2ab4,0xfa));var _0x42ab=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x2ab4[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x42ab('0x0'));var util=require('util');var path=require(_0x42ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x42ab('0x2'));var router=express['Router']();var auth=require(_0x42ab('0x3'));var interaction=require(_0x42ab('0x4'));var config=require(_0x42ab('0x5'));var controller=require(_0x42ab('0x6'));router['get']('/',auth[_0x42ab('0x7')](),controller[_0x42ab('0x8')]);router[_0x42ab('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x42ab('0xa')]);router['get'](_0x42ab('0xb'),auth[_0x42ab('0x7')](),controller[_0x42ab('0xc')]);router[_0x42ab('0xd')]('/',auth[_0x42ab('0x7')](),controller[_0x42ab('0xe')]);router[_0x42ab('0xf')](_0x42ab('0xb'),auth[_0x42ab('0x7')](),controller[_0x42ab('0x10')]);router[_0x42ab('0x11')](_0x42ab('0xb'),auth[_0x42ab('0x7')](),controller[_0x42ab('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index a3bc818..3f599f5 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 _0x2e21=['sequelize','exports','STRING','ENUM','account','agent','queue','NOW'];(function(_0x6f1031,_0x3c0a6f){var _0x4e1b8d=function(_0x159882){while(--_0x159882){_0x6f1031['push'](_0x6f1031['shift']());}};_0x4e1b8d(++_0x3c0a6f);}(_0x2e21,0x68));var _0x12e2=function(_0x4f4f67,_0x4868dc){_0x4f4f67=_0x4f4f67-0x0;var _0x4b3475=_0x2e21[_0x4f4f67];return _0x4b3475;};'use strict';var moment=require('moment');var Sequelize=require(_0x12e2('0x0'));module[_0x12e2('0x1')]={'uniqueid':{'type':Sequelize[_0x12e2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x12e2('0x3')](_0x12e2('0x4'),_0x12e2('0x5'),'queue'),'allowNull':![],'defaultValue':_0x12e2('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x12e2('0x7')]}}; \ No newline at end of file +var _0xb888=['NOW','moment','sequelize','STRING','account','agent','queue','DATE'];(function(_0x39609a,_0x28a563){var _0xecd92=function(_0x57241a){while(--_0x57241a){_0x39609a['push'](_0x39609a['shift']());}};_0xecd92(++_0x28a563);}(_0xb888,0x81));var _0x8b88=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb888[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x8b88('0x0'));var Sequelize=require(_0x8b88('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8b88('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8b88('0x3'),_0x8b88('0x4'),_0x8b88('0x5')),'allowNull':![],'defaultValue':_0x8b88('0x5')},'transferredAt':{'type':Sequelize[_0x8b88('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x8b88('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 16592bd..ca7aaba 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 _0x2c64=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','ChatTransferReport','includeAll','include','rows','show','params','options','find','catch','create','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','keys','query','filters','attributes','intersection','model','fields'];(function(_0x1db8b4,_0x2d21b6){var _0x403069=function(_0x2c3312){while(--_0x2c3312){_0x1db8b4['push'](_0x1db8b4['shift']());}};_0x403069(++_0x2d21b6);}(_0x2c64,0x181));var _0x42c6=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x2c64[_0x9fd887];return _0x1a54ab;};'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 authService=require(_0x42c6('0xf'));var hardwareService=require(_0x42c6('0x10'));var Redis=require('ioredis');var qs=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'];function respondWithStatusCode(_0x1e69e2,_0x427671){_0x427671=_0x427671||0xcc;return function(_0x7aaae2){if(_0x7aaae2){return _0x1e69e2[_0x42c6('0x16')](_0x427671);}return _0x1e69e2['status'](_0x427671)[_0x42c6('0x17')]();};}function respondWithResult(_0x1e9287,_0x21f74a){_0x21f74a=_0x21f74a||0xc8;return function(_0x43ebc5){if(_0x43ebc5){return _0x1e9287[_0x42c6('0x18')](_0x21f74a)[_0x42c6('0x19')](_0x43ebc5);}};}function respondWithFilteredResult(_0x373598,_0x51a06c){return function(_0x376d62){if(_0x376d62){var _0x1a2863=_0x376d62[_0x42c6('0x1a')],_0x189e46=_0x51a06c['offset'],_0x1ac8bd=_0x51a06c[_0x42c6('0x1b')]+_0x51a06c[_0x42c6('0x1c')],_0x56eba5;if(_0x1ac8bd>=_0x1a2863){_0x1ac8bd=_0x1a2863;_0x56eba5=0xc8;}else{_0x56eba5=0xce;}_0x373598[_0x42c6('0x18')](_0x56eba5);return _0x373598['set'](_0x42c6('0x1d'),_0x189e46+'-'+_0x1ac8bd+'/'+_0x1a2863)[_0x42c6('0x19')](_0x376d62);}return null;};}function patchUpdates(_0x3ff835){return function(_0x3fce8d){try{jsonpatch[_0x42c6('0x1e')](_0x3fce8d,_0x3ff835,!![]);}catch(_0x12b285){return BPromise[_0x42c6('0x1f')](_0x12b285);}return _0x3fce8d['save']();};}function saveUpdates(_0x51aae3,_0x141e3e){return function(_0x3139bc){if(_0x3139bc){return _0x3139bc[_0x42c6('0x20')](_0x51aae3)[_0x42c6('0x21')](function(_0x553fa7){return _0x553fa7;});}return null;};}function removeEntity(_0x542367,_0x2694e3){return function(_0x43f0e4){if(_0x43f0e4){return _0x43f0e4['destroy']()[_0x42c6('0x21')](function(){_0x542367['status'](0xcc)[_0x42c6('0x17')]();});}};}function handleEntityNotFound(_0x18c809,_0x11557c){return function(_0x1e5dc4){if(!_0x1e5dc4){_0x18c809[_0x42c6('0x16')](0x194);}return _0x1e5dc4;};}function handleError(_0x2734d5,_0x57dedd){_0x57dedd=_0x57dedd||0x1f4;return function(_0x9ed602){logger[_0x42c6('0x22')](_0x9ed602[_0x42c6('0x23')]);if(_0x9ed602[_0x42c6('0x24')]){delete _0x9ed602[_0x42c6('0x24')];}_0x2734d5['status'](_0x57dedd)[_0x42c6('0x25')](_0x9ed602);};}exports[_0x42c6('0x26')]=function(_0x1d9c11,_0x432253){var _0x496aaf={},_0x1b0fe7={},_0x3972b8={'count':0x0,'rows':[]};var _0x9fac8c=db['ChatTransferReport'][_0x42c6('0x27')];_0x1b0fe7['model']=_[_0x42c6('0x28')](_0x9fac8c);_0x1b0fe7[_0x42c6('0x29')]=_[_0x42c6('0x28')](_0x1d9c11[_0x42c6('0x29')]);_0x1b0fe7[_0x42c6('0x2a')]=_['intersection'](_0x1b0fe7['model'],_0x1b0fe7['query']);_0x496aaf[_0x42c6('0x2b')]=_[_0x42c6('0x2c')](_0x1b0fe7[_0x42c6('0x2d')],qs[_0x42c6('0x2e')](_0x1d9c11['query'][_0x42c6('0x2e')]));_0x496aaf[_0x42c6('0x2b')]=_0x496aaf['attributes'][_0x42c6('0x2f')]?_0x496aaf['attributes']:_0x1b0fe7[_0x42c6('0x2d')];if(!_0x1d9c11['query'][_0x42c6('0x30')](_0x42c6('0x31'))){_0x496aaf[_0x42c6('0x1c')]=qs[_0x42c6('0x1c')](_0x1d9c11[_0x42c6('0x29')][_0x42c6('0x1c')]);_0x496aaf[_0x42c6('0x1b')]=qs['offset'](_0x1d9c11[_0x42c6('0x29')][_0x42c6('0x1b')]);}_0x496aaf[_0x42c6('0x32')]=qs[_0x42c6('0x33')](_0x1d9c11[_0x42c6('0x29')][_0x42c6('0x33')]);_0x496aaf[_0x42c6('0x34')]=qs[_0x42c6('0x2a')](_[_0x42c6('0x35')](_0x1d9c11[_0x42c6('0x29')],_0x1b0fe7['filters']));if(_0x1d9c11[_0x42c6('0x29')][_0x42c6('0x36')]){_0x496aaf[_0x42c6('0x34')]=_[_0x42c6('0x37')](_0x496aaf[_0x42c6('0x34')],{'$or':_['map'](_0x9fac8c,function(_0xcaab0){if(_0xcaab0[_0x42c6('0x38')]['key']!==_0x42c6('0x39')){var _0x479ce6={};_0x479ce6[_0xcaab0[_0x42c6('0x3a')]]={'$like':'%'+_0x1d9c11['query'][_0x42c6('0x36')]+'%'};return _0x479ce6;}})});}_0x496aaf=_[_0x42c6('0x37')]({},_0x496aaf,_0x1d9c11['options']);var _0x111d2b={'where':_0x496aaf[_0x42c6('0x34')]};return db[_0x42c6('0x3b')]['count'](_0x111d2b)[_0x42c6('0x21')](function(_0x25d1e6){_0x3972b8[_0x42c6('0x1a')]=_0x25d1e6;if(_0x1d9c11['query'][_0x42c6('0x3c')]){_0x496aaf[_0x42c6('0x3d')]=[{'all':!![]}];}return db[_0x42c6('0x3b')]['findAll'](_0x496aaf);})[_0x42c6('0x21')](function(_0x2c96ac){_0x3972b8[_0x42c6('0x3e')]=_0x2c96ac;return _0x3972b8;})[_0x42c6('0x21')](respondWithFilteredResult(_0x432253,_0x496aaf))['catch'](handleError(_0x432253,null));};exports[_0x42c6('0x3f')]=function(_0x1ee2b2,_0x4df770){var _0x1c1020={'raw':!![],'where':{'id':_0x1ee2b2[_0x42c6('0x40')]['id']}},_0x360d29={};_0x360d29[_0x42c6('0x2d')]=_[_0x42c6('0x28')](db[_0x42c6('0x3b')][_0x42c6('0x27')]);_0x360d29['query']=_[_0x42c6('0x28')](_0x1ee2b2[_0x42c6('0x29')]);_0x360d29['filters']=_[_0x42c6('0x2c')](_0x360d29[_0x42c6('0x2d')],_0x360d29['query']);_0x1c1020[_0x42c6('0x2b')]=_['intersection'](_0x360d29[_0x42c6('0x2d')],qs['fields'](_0x1ee2b2[_0x42c6('0x29')][_0x42c6('0x2e')]));_0x1c1020[_0x42c6('0x2b')]=_0x1c1020['attributes'][_0x42c6('0x2f')]?_0x1c1020[_0x42c6('0x2b')]:_0x360d29[_0x42c6('0x2d')];if(_0x1ee2b2[_0x42c6('0x29')]['includeAll']){_0x1c1020[_0x42c6('0x3d')]=[{'all':!![]}];}_0x1c1020=_[_0x42c6('0x37')]({},_0x1c1020,_0x1ee2b2[_0x42c6('0x41')]);return db[_0x42c6('0x3b')][_0x42c6('0x42')](_0x1c1020)[_0x42c6('0x21')](handleEntityNotFound(_0x4df770,null))[_0x42c6('0x21')](respondWithResult(_0x4df770,null))[_0x42c6('0x43')](handleError(_0x4df770,null));};exports[_0x42c6('0x44')]=function(_0x405713,_0x2139ca){return db[_0x42c6('0x3b')][_0x42c6('0x44')](_0x405713['body'],{})[_0x42c6('0x21')](respondWithResult(_0x2139ca,0xc9))['catch'](handleError(_0x2139ca,null));};exports['update']=function(_0x61bdeb,_0x3326fb){if(_0x61bdeb[_0x42c6('0x45')]['id']){delete _0x61bdeb[_0x42c6('0x45')]['id'];}return db['ChatTransferReport'][_0x42c6('0x42')]({'where':{'id':_0x61bdeb[_0x42c6('0x40')]['id']}})[_0x42c6('0x21')](handleEntityNotFound(_0x3326fb,null))['then'](saveUpdates(_0x61bdeb[_0x42c6('0x45')],null))[_0x42c6('0x21')](respondWithResult(_0x3326fb,null))[_0x42c6('0x43')](handleError(_0x3326fb,null));};exports[_0x42c6('0x46')]=function(_0x4d1fd5,_0xccc63){return db[_0x42c6('0x3b')]['find']({'where':{'id':_0x4d1fd5[_0x42c6('0x40')]['id']}})[_0x42c6('0x21')](handleEntityNotFound(_0xccc63,null))[_0x42c6('0x21')](removeEntity(_0xccc63,null))[_0x42c6('0x43')](handleError(_0xccc63,null));};exports[_0x42c6('0x47')]=function(_0x27d3c2,_0x5e1567){return db['ChatTransferReport'][_0x42c6('0x47')]()[_0x42c6('0x21')](respondWithResult(_0x5e1567,null))[_0x42c6('0x43')](handleError(_0x5e1567,null));}; \ No newline at end of file +var _0x15ec=['ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x15ec,0x16c));var _0xc15e=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x15ec[_0x550d12];return _0x12103d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc15e('0x0'));var rimraf=require(_0xc15e('0x1'));var zipdir=require(_0xc15e('0x2'));var jsonpatch=require(_0xc15e('0x3'));var rp=require(_0xc15e('0x4'));var moment=require(_0xc15e('0x5'));var BPromise=require(_0xc15e('0x6'));var Mustache=require(_0xc15e('0x7'));var util=require(_0xc15e('0x8'));var path=require(_0xc15e('0x9'));var sox=require(_0xc15e('0xa'));var csv=require('to-csv');var ejs=require(_0xc15e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc15e('0xc'));var crypto=require(_0xc15e('0xd'));var jsforce=require(_0xc15e('0xe'));var deskjs=require(_0xc15e('0xf'));var toCsv=require(_0xc15e('0x10'));var querystring=require('querystring');var Papa=require(_0xc15e('0x11'));var authService=require(_0xc15e('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xc15e('0x13'));var logger=require(_0xc15e('0x14'))(_0xc15e('0x15'));var utils=require('../../config/utils');var config=require(_0xc15e('0x16'));var db=require(_0xc15e('0x17'))['db'];function respondWithStatusCode(_0x36bf1a,_0x5107ff){_0x5107ff=_0x5107ff||0xcc;return function(_0x19ab2f){if(_0x19ab2f){return _0x36bf1a[_0xc15e('0x18')](_0x5107ff);}return _0x36bf1a[_0xc15e('0x19')](_0x5107ff)[_0xc15e('0x1a')]();};}function respondWithResult(_0x5cc07f,_0x4b61e3){_0x4b61e3=_0x4b61e3||0xc8;return function(_0x407dd7){if(_0x407dd7){return _0x5cc07f['status'](_0x4b61e3)[_0xc15e('0x1b')](_0x407dd7);}};}function respondWithFilteredResult(_0x19b2d3,_0x1cc037){return function(_0x4b98dd){if(_0x4b98dd){var _0x7d4735=_0x4b98dd[_0xc15e('0x1c')],_0x37bf50=_0x1cc037['offset'],_0x1eb040=_0x1cc037[_0xc15e('0x1d')]+_0x1cc037[_0xc15e('0x1e')],_0x3401bf;if(_0x1eb040>=_0x7d4735){_0x1eb040=_0x7d4735;_0x3401bf=0xc8;}else{_0x3401bf=0xce;}_0x19b2d3[_0xc15e('0x19')](_0x3401bf);return _0x19b2d3['set'](_0xc15e('0x1f'),_0x37bf50+'-'+_0x1eb040+'/'+_0x7d4735)[_0xc15e('0x1b')](_0x4b98dd);}return null;};}function patchUpdates(_0x5a9950){return function(_0x11d1ce){try{jsonpatch[_0xc15e('0x20')](_0x11d1ce,_0x5a9950,!![]);}catch(_0x47c981){return BPromise[_0xc15e('0x21')](_0x47c981);}return _0x11d1ce[_0xc15e('0x22')]();};}function saveUpdates(_0x491433,_0x31581d){return function(_0x76c281){if(_0x76c281){return _0x76c281[_0xc15e('0x23')](_0x491433)[_0xc15e('0x24')](function(_0x5ea055){return _0x5ea055;});}return null;};}function removeEntity(_0xe83efa,_0x663f8){return function(_0x2e4ef6){if(_0x2e4ef6){return _0x2e4ef6[_0xc15e('0x25')]()[_0xc15e('0x24')](function(){_0xe83efa[_0xc15e('0x19')](0xcc)[_0xc15e('0x1a')]();});}};}function handleEntityNotFound(_0x48424e,_0x15beb7){return function(_0x49e7ee){if(!_0x49e7ee){_0x48424e['sendStatus'](0x194);}return _0x49e7ee;};}function handleError(_0x43b009,_0x55a424){_0x55a424=_0x55a424||0x1f4;return function(_0x427a41){logger[_0xc15e('0x26')](_0x427a41[_0xc15e('0x27')]);if(_0x427a41[_0xc15e('0x28')]){delete _0x427a41[_0xc15e('0x28')];}_0x43b009[_0xc15e('0x19')](_0x55a424)[_0xc15e('0x29')](_0x427a41);};}exports[_0xc15e('0x2a')]=function(_0x205dd2,_0x58961c){var _0x2c0377={},_0x5b04c6={},_0x29f6c7={'count':0x0,'rows':[]};var _0x152454=db[_0xc15e('0x2b')][_0xc15e('0x2c')];_0x5b04c6[_0xc15e('0x2d')]=_[_0xc15e('0x2e')](_0x152454);_0x5b04c6[_0xc15e('0x2f')]=_[_0xc15e('0x2e')](_0x205dd2['query']);_0x5b04c6[_0xc15e('0x30')]=_['intersection'](_0x5b04c6['model'],_0x5b04c6[_0xc15e('0x2f')]);_0x2c0377[_0xc15e('0x31')]=_['intersection'](_0x5b04c6[_0xc15e('0x2d')],qs[_0xc15e('0x32')](_0x205dd2[_0xc15e('0x2f')][_0xc15e('0x32')]));_0x2c0377[_0xc15e('0x31')]=_0x2c0377['attributes'][_0xc15e('0x33')]?_0x2c0377[_0xc15e('0x31')]:_0x5b04c6[_0xc15e('0x2d')];if(!_0x205dd2['query'][_0xc15e('0x34')](_0xc15e('0x35'))){_0x2c0377[_0xc15e('0x1e')]=qs[_0xc15e('0x1e')](_0x205dd2[_0xc15e('0x2f')][_0xc15e('0x1e')]);_0x2c0377['offset']=qs[_0xc15e('0x1d')](_0x205dd2['query'][_0xc15e('0x1d')]);}_0x2c0377['order']=qs[_0xc15e('0x36')](_0x205dd2['query'][_0xc15e('0x36')]);_0x2c0377[_0xc15e('0x37')]=qs['filters'](_[_0xc15e('0x38')](_0x205dd2[_0xc15e('0x2f')],_0x5b04c6['filters']));if(_0x205dd2[_0xc15e('0x2f')][_0xc15e('0x39')]){_0x2c0377[_0xc15e('0x37')]=_[_0xc15e('0x3a')](_0x2c0377[_0xc15e('0x37')],{'$or':_[_0xc15e('0x3b')](_0x152454,function(_0x47bb28){if(_0x47bb28[_0xc15e('0x3c')]['key']!==_0xc15e('0x3d')){var _0x5cf7a8={};_0x5cf7a8[_0x47bb28[_0xc15e('0x3e')]]={'$like':'%'+_0x205dd2[_0xc15e('0x2f')][_0xc15e('0x39')]+'%'};return _0x5cf7a8;}})});}_0x2c0377=_[_0xc15e('0x3a')]({},_0x2c0377,_0x205dd2[_0xc15e('0x3f')]);var _0x20f988={'where':_0x2c0377[_0xc15e('0x37')]};return db[_0xc15e('0x2b')]['count'](_0x20f988)[_0xc15e('0x24')](function(_0x21533c){_0x29f6c7[_0xc15e('0x1c')]=_0x21533c;if(_0x205dd2[_0xc15e('0x2f')][_0xc15e('0x40')]){_0x2c0377[_0xc15e('0x41')]=[{'all':!![]}];}return db[_0xc15e('0x2b')][_0xc15e('0x42')](_0x2c0377);})[_0xc15e('0x24')](function(_0xb351ce){_0x29f6c7[_0xc15e('0x43')]=_0xb351ce;return _0x29f6c7;})['then'](respondWithFilteredResult(_0x58961c,_0x2c0377))[_0xc15e('0x44')](handleError(_0x58961c,null));};exports['show']=function(_0x43ff6d,_0x349162){var _0x4457c0={'raw':!![],'where':{'id':_0x43ff6d[_0xc15e('0x45')]['id']}},_0x39435a={};_0x39435a[_0xc15e('0x2d')]=_[_0xc15e('0x2e')](db['ChatTransferReport'][_0xc15e('0x2c')]);_0x39435a[_0xc15e('0x2f')]=_[_0xc15e('0x2e')](_0x43ff6d[_0xc15e('0x2f')]);_0x39435a[_0xc15e('0x30')]=_['intersection'](_0x39435a[_0xc15e('0x2d')],_0x39435a[_0xc15e('0x2f')]);_0x4457c0['attributes']=_[_0xc15e('0x46')](_0x39435a['model'],qs['fields'](_0x43ff6d[_0xc15e('0x2f')][_0xc15e('0x32')]));_0x4457c0[_0xc15e('0x31')]=_0x4457c0[_0xc15e('0x31')][_0xc15e('0x33')]?_0x4457c0[_0xc15e('0x31')]:_0x39435a[_0xc15e('0x2d')];if(_0x43ff6d[_0xc15e('0x2f')]['includeAll']){_0x4457c0[_0xc15e('0x41')]=[{'all':!![]}];}_0x4457c0=_[_0xc15e('0x3a')]({},_0x4457c0,_0x43ff6d['options']);return db[_0xc15e('0x2b')][_0xc15e('0x47')](_0x4457c0)[_0xc15e('0x24')](handleEntityNotFound(_0x349162,null))['then'](respondWithResult(_0x349162,null))[_0xc15e('0x44')](handleError(_0x349162,null));};exports[_0xc15e('0x48')]=function(_0x4beb41,_0x109e6f){return db[_0xc15e('0x2b')][_0xc15e('0x48')](_0x4beb41[_0xc15e('0x49')],{})[_0xc15e('0x24')](respondWithResult(_0x109e6f,0xc9))['catch'](handleError(_0x109e6f,null));};exports[_0xc15e('0x23')]=function(_0x30be50,_0x19d36c){if(_0x30be50['body']['id']){delete _0x30be50[_0xc15e('0x49')]['id'];}return db[_0xc15e('0x2b')]['find']({'where':{'id':_0x30be50[_0xc15e('0x45')]['id']}})[_0xc15e('0x24')](handleEntityNotFound(_0x19d36c,null))[_0xc15e('0x24')](saveUpdates(_0x30be50[_0xc15e('0x49')],null))[_0xc15e('0x24')](respondWithResult(_0x19d36c,null))['catch'](handleError(_0x19d36c,null));};exports[_0xc15e('0x25')]=function(_0x2a4b58,_0x2cd03c){return db[_0xc15e('0x2b')][_0xc15e('0x47')]({'where':{'id':_0x2a4b58[_0xc15e('0x45')]['id']}})[_0xc15e('0x24')](handleEntityNotFound(_0x2cd03c,null))[_0xc15e('0x24')](removeEntity(_0x2cd03c,null))['catch'](handleError(_0x2cd03c,null));};exports[_0xc15e('0x4a')]=function(_0x263200,_0x1ffb59){return db['ChatTransferReport'][_0xc15e('0x4a')]()['then'](respondWithResult(_0x1ffb59,null))['catch'](handleError(_0x1ffb59,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 9ced42c..bc57492 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 _0x86d8=['uniqueid','lodash','util','../../config/logger','api','request-promise','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x440122,_0x257f29){var _0x17f90b=function(_0x1f0135){while(--_0x1f0135){_0x440122['push'](_0x440122['shift']());}};_0x17f90b(++_0x257f29);}(_0x86d8,0x123));var _0x886d=function(_0x28109f,_0x57bc0d){_0x28109f=_0x28109f-0x0;var _0x24c79f=_0x86d8[_0x28109f];return _0x24c79f;};'use strict';var _=require(_0x886d('0x0'));var util=require(_0x886d('0x1'));var logger=require(_0x886d('0x2'))(_0x886d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x886d('0x4'));var attributes=require(_0x886d('0x5'));module[_0x886d('0x6')]=function(_0x45c5fa,_0x6ddc00){return _0x45c5fa[_0x886d('0x7')](_0x886d('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x886d('0x9'),'fields':[_0x886d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3f6=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xe3f6,0xa6));var _0x6e3f=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xe3f6[_0x176329];return _0x31997c;};'use strict';var _=require(_0x6e3f('0x0'));var util=require(_0x6e3f('0x1'));var logger=require(_0x6e3f('0x2'))(_0x6e3f('0x3'));var moment=require(_0x6e3f('0x4'));var BPromise=require(_0x6e3f('0x5'));var rp=require('request-promise');var attributes=require('./chatTransferReport.attributes');module[_0x6e3f('0x6')]=function(_0x42d6f7,_0x42db24){return _0x42d6f7[_0x6e3f('0x7')](_0x6e3f('0x8'),attributes,{'tableName':_0x6e3f('0x9'),'paranoid':![],'indexes':[{'name':_0x6e3f('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index ea36875..8a39cb5 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 _0xc3fe=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0xc3fe,0xff));var _0xec3f=function(_0x2a0034,_0x51c1a1){_0x2a0034=_0x2a0034-0x0;var _0x55c1b0=_0xc3fe[_0x2a0034];return _0x55c1b0;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var moment=require(_0xec3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec3f('0x3'));var fs=require('fs');var Redis=require(_0xec3f('0x4'));var db=require(_0xec3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var config=require(_0xec3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b0b84,_0x526183,_0x503775){return new BPromise(function(_0xcb8557,_0x5df7fc){return client[_0xec3f('0xa')](_0x3b0b84,_0x503775)[_0xec3f('0xb')](function(_0x12a7c5){logger[_0xec3f('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));logger[_0xec3f('0xe')](_0xec3f('0xf'),_0x526183,_0xec3f('0xd'),JSON[_0xec3f('0x10')](_0x12a7c5));if(_0x12a7c5[_0xec3f('0x11')]){if(_0x12a7c5['error'][_0xec3f('0x12')]===0x1f4){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0x12a7c5['error']['message']);return _0x5df7fc(_0x12a7c5[_0xec3f('0x11')]['message']);}logger['error'](_0xec3f('0x13'),_0x526183,_0x12a7c5[_0xec3f('0x11')][_0xec3f('0x14')]);return _0xcb8557(_0x12a7c5['error']['message']);}else{logger[_0xec3f('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));_0xcb8557(_0x12a7c5[_0xec3f('0x15')]['message']);}})[_0xec3f('0x16')](function(_0xb8ee6f){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0xb8ee6f);_0x5df7fc(_0xb8ee6f);});});} \ No newline at end of file +var _0x559a=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x38b1bf,_0x4632b2){var _0x2bd954=function(_0x25fcbc){while(--_0x25fcbc){_0x38b1bf['push'](_0x38b1bf['shift']());}};_0x2bd954(++_0x4632b2);}(_0x559a,0xb3));var _0xa559=function(_0x210826,_0x285177){_0x210826=_0x210826-0x0;var _0x58062b=_0x559a[_0x210826];return _0x58062b;};'use strict';var _=require(_0xa559('0x0'));var util=require(_0xa559('0x1'));var moment=require('moment');var BPromise=require(_0xa559('0x2'));var rs=require(_0xa559('0x3'));var fs=require('fs');var Redis=require(_0xa559('0x4'));var db=require(_0xa559('0x5'))['db'];var utils=require(_0xa559('0x6'));var logger=require(_0xa559('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa559('0x8'));var client=jayson[_0xa559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2edab4,_0x1a5cec,_0x4eada1){return new BPromise(function(_0xb8055,_0x218e3b){return client[_0xa559('0xa')](_0x2edab4,_0x4eada1)[_0xa559('0xb')](function(_0x48aa9a){logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,_0xa559('0xe'));logger[_0xa559('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x1a5cec,'request\x20sent',JSON[_0xa559('0x10')](_0x48aa9a));if(_0x48aa9a[_0xa559('0x11')]){if(_0x48aa9a['error'][_0xa559('0x12')]===0x1f4){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a['error'][_0xa559('0x13')]);return _0x218e3b(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a[_0xa559('0x11')]['message']);return _0xb8055(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}else{logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,'request\x20sent');_0xb8055(_0x48aa9a[_0xa559('0x14')]['message']);}})[_0xa559('0x15')](function(_0x1387b6){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x1387b6);_0x218e3b(_0x1387b6);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 1fa5d0e..7601918 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 _0x5a59=['destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','post','put','/:id','update'];(function(_0x3b5dbf,_0x491c60){var _0x3b27d7=function(_0x1bc171){while(--_0x1bc171){_0x3b5dbf['push'](_0x3b5dbf['shift']());}};_0x3b27d7(++_0x491c60);}(_0x5a59,0x97));var _0x95a5=function(_0x2e4b05,_0x152a02){_0x2e4b05=_0x2e4b05-0x0;var _0x506cd3=_0x5a59[_0x2e4b05];return _0x506cd3;};'use strict';var multer=require(_0x95a5('0x0'));var util=require('util');var path=require(_0x95a5('0x1'));var timeout=require('connect-timeout');var express=require(_0x95a5('0x2'));var router=express[_0x95a5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x95a5('0x4'));var config=require(_0x95a5('0x5'));var controller=require(_0x95a5('0x6'));router[_0x95a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x95a5('0x8')]);router['get']('/describe',auth[_0x95a5('0x9')](),controller['describe']);router[_0x95a5('0x7')]('/:id',auth[_0x95a5('0x9')](),controller['show']);router[_0x95a5('0xa')]('/',auth[_0x95a5('0x9')](),controller['create']);router[_0x95a5('0xb')](_0x95a5('0xc'),auth['isAuthenticated'](),controller[_0x95a5('0xd')]);router['delete']('/:id',auth[_0x95a5('0x9')](),controller[_0x95a5('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb8ef=['../../config/environment','./chatTransferReport.controller','isAuthenticated','get','/:id','post','create','put','update','delete','exports','util','path','express','Router','../../components/interaction/service'];(function(_0x40453a,_0x1ff061){var _0x2da74d=function(_0x73e877){while(--_0x73e877){_0x40453a['push'](_0x40453a['shift']());}};_0x2da74d(++_0x1ff061);}(_0xb8ef,0x14b));var _0xfb8e=function(_0x23189d,_0x27372){_0x23189d=_0x23189d-0x0;var _0x519590=_0xb8ef[_0x23189d];return _0x519590;};'use strict';var multer=require('multer');var util=require(_0xfb8e('0x0'));var path=require(_0xfb8e('0x1'));var timeout=require('connect-timeout');var express=require(_0xfb8e('0x2'));var router=express[_0xfb8e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xfb8e('0x4'));var config=require(_0xfb8e('0x5'));var controller=require(_0xfb8e('0x6'));router['get']('/',auth[_0xfb8e('0x7')](),controller['index']);router[_0xfb8e('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xfb8e('0x8')](_0xfb8e('0x9'),auth[_0xfb8e('0x7')](),controller['show']);router[_0xfb8e('0xa')]('/',auth['isAuthenticated'](),controller[_0xfb8e('0xb')]);router[_0xfb8e('0xc')](_0xfb8e('0x9'),auth[_0xfb8e('0x7')](),controller[_0xfb8e('0xd')]);router[_0xfb8e('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfb8e('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 4164cc2..b5c8dff 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 _0x83c2=['Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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.','website_alias','bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us'];(function(_0x227033,_0x34dc79){var _0x494c08=function(_0x3f6b16){while(--_0x3f6b16){_0x227033['push'](_0x227033['shift']());}};_0x494c08(++_0x34dc79);}(_0x83c2,0xa8));var _0x283c=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0x83c2[_0x1562a2];return _0x39a636;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x283c('0x0'));module[_0x283c('0x1')]={'name':{'type':Sequelize[_0x283c('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x283c('0x3')},'description':{'type':Sequelize[_0x283c('0x2')]},'mapKey':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x4')},'mapKeyOffline':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x283c('0x2')],'allowNull':![],'defaultValue':_0x283c('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x283c('0x2')],'allowNull':![],'defaultValue':_0x283c('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x283c('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x283c('0x2')]},'animation':{'type':Sequelize[_0x283c('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x283c('0xa')]('rounded','squared'),'defaultValue':_0x283c('0xb')},'header_online':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0xd')},'offline_chat_button':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0xe')},'header_offline':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0xf')},'download_transcript':{'type':Sequelize[_0x283c('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x283c('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x283c('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x283c('0x11')]},'closingQuestion':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0x13')},'noteTitle':{'type':Sequelize[_0x283c('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0x14')},'closingMessage':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0xe')},'skipMessageButton':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x16')},'conditionAgreement':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM']('star',_0x283c('0x17')),'defaultValue':_0x283c('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x283c('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x283c('0x11')],'defaultValue':function(){return JSON[_0x283c('0x19')]({'items':[{'type':_0x283c('0x1a'),'variable':null,'config':{'placeholder':_0x283c('0x1b'),'type':_0x283c('0x1c'),'required':!![]},'props':{'title':_0x283c('0x1b'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x283c('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x283c('0x1d')](_0x283c('0x1e'))?JSON[_0x283c('0x1f')](this[_0x283c('0x1d')](_0x283c('0x1e'))):{};},'set':function(_0x534613){return this[_0x283c('0x20')](_0x283c('0x1e'),JSON[_0x283c('0x19')](_0x534613));}},'offlineForm':{'type':Sequelize[_0x283c('0x11')],'defaultValue':function(){return JSON[_0x283c('0x19')]({'items':[{'type':_0x283c('0x1a'),'props':{'title':_0x283c('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x283c('0x4'),'type':_0x283c('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x283c('0x21')},'props':{'title':_0x283c('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x283c('0x1d')](_0x283c('0x22'))?JSON[_0x283c('0x1f')](this[_0x283c('0x1d')](_0x283c('0x22'))):{};},'set':function(_0xc5e9a2){return this[_0x283c('0x20')](_0x283c('0x22'),JSON[_0x283c('0x19')](_0xc5e9a2));}},'token':{'type':Sequelize[_0x283c('0x2')],'defaultValue':function(){return rs[_0x283c('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x283c('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x283c('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0x24')},'waitingMessage':{'type':Sequelize[_0x283c('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x25')},'offlineMessageBody':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x283c('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x283c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x283c('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x283c('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x283c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0x29')},'verticalAlignment':{'type':Sequelize[_0x283c('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x283c('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x283c('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x283c('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x283c('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x283c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x283c('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x283c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x283c('0x2')],'defaultValue':_0x283c('0x2b')},'systemAvatar':{'type':Sequelize[_0x283c('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x283c('0x2c'),'set':function(_0x28d9d9){if(!_0x28d9d9)this[_0x283c('0x20')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x283c('0x2d'),_0x28d9d9);}}}; \ No newline at end of file +var _0xc7ed=['mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Skip','thumb','stringify','text','name','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0xc7ed,0x151));var _0xdc7e=function(_0x328d98,_0x4a34a3){_0x328d98=_0x328d98-0x0;var _0x188eb5=_0xc7ed[_0x328d98];return _0x188eb5;};'use strict';var Sequelize=require(_0xdc7e('0x0'));var rs=require(_0xdc7e('0x1'));module[_0xdc7e('0x2')]={'name':{'type':Sequelize[_0xdc7e('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xdc7e('0x3')],'allowNull':![],'unique':_0xdc7e('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x5')},'mapKeyOffline':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x5')},'key':{'type':Sequelize[_0xdc7e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdc7e('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xdc7e('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xdc7e('0x3')],'allowNull':![],'defaultValue':_0xdc7e('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xdc7e('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdc7e('0xa')]('rounded','squared'),'defaultValue':_0xdc7e('0xb')},'header_online':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0xc')},'start_chat_button':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xdc7e('0xd')},'download_transcript':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xdc7e('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xdc7e('0xf')]},'closingQuestion':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x12')},'placeholderMessage':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x13')},'closingMessage':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xdc7e('0x14')},'conditionAgreement':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xdc7e('0xa')]('star',_0xdc7e('0x15')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdc7e('0x16')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0xdc7e('0x17'),'required':!![]},'props':{'title':_0xdc7e('0x18'),'helpText':''}},{'type':_0xdc7e('0x19'),'props':{'title':_0xdc7e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xdc7e('0x5'),'type':_0xdc7e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdc7e('0x1a')](_0xdc7e('0x1b'))?JSON[_0xdc7e('0x1c')](this[_0xdc7e('0x1a')](_0xdc7e('0x1b'))):{};},'set':function(_0xde1490){return this[_0xdc7e('0x1d')](_0xdc7e('0x1b'),JSON['stringify'](_0xde1490));}},'offlineForm':{'type':Sequelize[_0xdc7e('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xdc7e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xdc7e('0x5'),'type':_0xdc7e('0x5')},'variable':null},{'type':_0xdc7e('0x1e'),'config':{'placeholder':_0xdc7e('0x1f')},'props':{'title':_0xdc7e('0x1f'),'helpText':_0xdc7e('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xdc7e('0x1a')](_0xdc7e('0x21'))?JSON['parse'](this['getDataValue'](_0xdc7e('0x21'))):{};},'set':function(_0x30dd26){return this[_0xdc7e('0x1d')]('offlineForm',JSON['stringify'](_0x30dd26));}},'token':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':function(){return rs[_0xdc7e('0x22')]();}},'autoclose':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdc7e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdc7e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xdc7e('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdc7e('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x25')},'offlineMessageBody':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xdc7e('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xdc7e('0x28')},'enableCustomerAttachment':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xdc7e('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xdc7e('0x3')]},'notificationTemplate':{'type':Sequelize[_0xdc7e('0xf')],'defaultValue':function(){return _0xdc7e('0x29');}},'notificationSound':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xdc7e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':_0xdc7e('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xdc7e('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xdc7e('0x3')]},'customerAvatar':{'type':Sequelize[_0xdc7e('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xdc7e('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdc7e('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdc7e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdc7e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xdc7e('0x2b')},'systemAvatar':{'type':Sequelize[_0xdc7e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc7e('0x8')],'comment':_0xdc7e('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xdc7e('0x2d'),'set':function(_0x23d993){if(!_0x23d993)this[_0xdc7e('0x1d')](_0xdc7e('0x2e'),null);this['setDataValue'](_0xdc7e('0x2f'),_0x23d993);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 19cf842..4815bd4 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 _0xb10b=['findAndCountAll','getApplications','chatProactiveAction','ChatProactiveAction','false','offlineForm','onlineForm','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','mandatoryDispositionPause','ChatWebsite','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','rows','show','rawAttributes','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','params','Pause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','sitepic','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','getSystemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','no\x20available\x20attributes','difference','updatedAt','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','list','applications','priority','asc','account','contact','lastName','referer','browser','format','%s\x20%s','version','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','createdAt','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','sendMail','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','timezone','No\x20timezone','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','replace','verticalAlignment','sequelize','transaction'];(function(_0x5b670d,_0x4e6d01){var _0x32c35b=function(_0x5cab28){while(--_0x5cab28){_0x5b670d['push'](_0x5b670d['shift']());}};_0x32c35b(++_0x4e6d01);}(_0xb10b,0x12a));var _0xbb10=function(_0x16c2b1,_0x36a70c){_0x16c2b1=_0x16c2b1-0x0;var _0x199ac4=_0xb10b[_0x16c2b1];return _0x199ac4;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var hardwareService=require(_0xbb10('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];config['redis']=_[_0xbb10('0x18')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))['register'](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});var client9003=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x36b5e8,_0x3e26f4,_0x2b184e,_0x4a2bfc){return new BPromise(function(_0x2eca0f,_0x1145f1){var _0x133ac2=_0x4a2bfc||client;return _0x133ac2[_0xbb10('0x20')](_0x36b5e8,_0x2b184e)[_0xbb10('0x21')](function(_0x1682a4){logger[_0xbb10('0x22')](_0xbb10('0x23'),_0x3e26f4,_0xbb10('0x24'));logger[_0xbb10('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3e26f4,_0xbb10('0x24'),JSON[_0xbb10('0x26')](_0x1682a4));if(_0x1682a4[_0xbb10('0x27')]){if(_0x1682a4[_0xbb10('0x27')][_0xbb10('0x28')]===0x1f4){logger[_0xbb10('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x3e26f4,_0x1682a4[_0xbb10('0x27')][_0xbb10('0x29')]);return _0x1145f1(_0x1682a4['error']['message']);}logger[_0xbb10('0x27')](_0xbb10('0x23'),_0x3e26f4,_0x1682a4[_0xbb10('0x27')][_0xbb10('0x29')]);return _0x2eca0f(_0x1682a4[_0xbb10('0x27')][_0xbb10('0x29')]);}else{logger[_0xbb10('0x22')](_0xbb10('0x23'),_0x3e26f4,_0xbb10('0x24'));_0x2eca0f(_0x1682a4[_0xbb10('0x2a')][_0xbb10('0x29')]);}})[_0xbb10('0x2b')](function(_0x537898){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3e26f4,_0x537898);_0x1145f1(_0x537898);});});}function respondWithStatusCode(_0xc93a04,_0x3c5ae7){_0x3c5ae7=_0x3c5ae7||0xcc;return function(_0x2c89b9){if(_0x2c89b9){return _0xc93a04['sendStatus'](_0x3c5ae7);}return _0xc93a04[_0xbb10('0x2c')](_0x3c5ae7)[_0xbb10('0x2d')]();};}function respondWithResult(_0x6ed43b,_0x1d5e95){_0x1d5e95=_0x1d5e95||0xc8;return function(_0x1acce9){if(_0x1acce9){return _0x6ed43b[_0xbb10('0x2c')](_0x1d5e95)[_0xbb10('0x2e')](_0x1acce9);}};}function respondWithFilteredResult(_0x4aabb9,_0x3796c7){return function(_0x21ac54){if(_0x21ac54){var _0xfc3595=_0x21ac54['count'],_0x2e0249=_0x3796c7[_0xbb10('0x2f')],_0x1d30aa=_0x3796c7['offset']+_0x3796c7[_0xbb10('0x30')],_0x2ff4c1;if(_0x1d30aa>=_0xfc3595){_0x1d30aa=_0xfc3595;_0x2ff4c1=0xc8;}else{_0x2ff4c1=0xce;}_0x4aabb9['status'](_0x2ff4c1);return _0x4aabb9[_0xbb10('0x31')](_0xbb10('0x32'),_0x2e0249+'-'+_0x1d30aa+'/'+_0xfc3595)[_0xbb10('0x2e')](_0x21ac54);}return null;};}function patchUpdates(_0x491db4){return function(_0x518d47){try{jsonpatch[_0xbb10('0x33')](_0x518d47,_0x491db4,!![]);}catch(_0x34f65e){return BPromise['reject'](_0x34f65e);}return _0x518d47[_0xbb10('0x34')]();};}function saveUpdates(_0x37dde7,_0x2f653f){return function(_0x1c0b57){if(_0x1c0b57){return _0x1c0b57[_0xbb10('0x35')](_0x37dde7)[_0xbb10('0x21')](function(_0xf85197){return _0xf85197;});}return null;};}function removeEntity(_0x4975f5,_0x25acb3){return function(_0x1da9c9){if(_0x1da9c9){return _0x1da9c9[_0xbb10('0x36')]()[_0xbb10('0x21')](function(){var _0xfb2c5e=_0x1da9c9[_0xbb10('0x37')]({'plain':!![]});var _0x188cbd=_0xbb10('0x38');return db[_0xbb10('0x39')]['destroy']({'where':{'type':_0x188cbd,'resourceId':_0xfb2c5e['id']}})[_0xbb10('0x21')](function(){return _0x1da9c9;});})[_0xbb10('0x21')](function(){_0x4975f5[_0xbb10('0x2c')](0xcc)[_0xbb10('0x2d')]();});}};}function handleEntityNotFound(_0x570f5a,_0x111762){return function(_0x5de37b){if(!_0x5de37b){_0x570f5a['sendStatus'](0x194);}return _0x5de37b;};}function handleError(_0x3eb3cc,_0x40c164){_0x40c164=_0x40c164||0x1f4;return function(_0x26e76a){logger[_0xbb10('0x27')](_0x26e76a[_0xbb10('0x3a')]);if(_0x26e76a[_0xbb10('0x3b')]){delete _0x26e76a['name'];}_0x3eb3cc[_0xbb10('0x2c')](_0x40c164)[_0xbb10('0x3c')](_0x26e76a);};}exports['index']=function(_0x5e3fbd,_0x5cd55f){var _0x31bee3={'include':[{'model':db['Pause'],'as':_0xbb10('0x3d')}]},_0x2b0b45={},_0x2b658a={'count':0x0,'rows':[]};var _0x3e8538=db[_0xbb10('0x3e')]['rawAttributes'];_0x2b0b45[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x3e8538);_0x2b0b45[_0xbb10('0x41')]=_[_0xbb10('0x40')](_0x5e3fbd['query']);_0x2b0b45[_0xbb10('0x42')]=_[_0xbb10('0x43')](_0x2b0b45['model'],_0x2b0b45[_0xbb10('0x41')]);_0x31bee3[_0xbb10('0x44')]=_[_0xbb10('0x43')](_0x2b0b45[_0xbb10('0x3f')],qs[_0xbb10('0x45')](_0x5e3fbd[_0xbb10('0x41')]['fields']));_0x31bee3[_0xbb10('0x44')]=_0x31bee3[_0xbb10('0x44')][_0xbb10('0x46')]?_0x31bee3[_0xbb10('0x44')]:_0x2b0b45['model'];if(!_0x5e3fbd[_0xbb10('0x41')][_0xbb10('0x47')](_0xbb10('0x48'))){_0x31bee3[_0xbb10('0x30')]=qs['limit'](_0x5e3fbd[_0xbb10('0x41')][_0xbb10('0x30')]);_0x31bee3['offset']=qs['offset'](_0x5e3fbd[_0xbb10('0x41')]['offset']);}_0x31bee3[_0xbb10('0x49')]=qs[_0xbb10('0x4a')](_0x5e3fbd['query'][_0xbb10('0x4a')]);_0x31bee3[_0xbb10('0x4b')]=qs[_0xbb10('0x42')](_['pick'](_0x5e3fbd[_0xbb10('0x41')],_0x2b0b45[_0xbb10('0x42')]));if(_0x5e3fbd[_0xbb10('0x41')][_0xbb10('0x4c')]){_0x31bee3[_0xbb10('0x4b')]=_[_0xbb10('0x4d')](_0x31bee3[_0xbb10('0x4b')],{'$or':_[_0xbb10('0x4e')](_0x3e8538,function(_0x205bb4){if(_0x205bb4[_0xbb10('0x4f')][_0xbb10('0x50')]!==_0xbb10('0x51')){var _0x4d30d6={};_0x4d30d6[_0x205bb4[_0xbb10('0x52')]]={'$like':'%'+_0x5e3fbd[_0xbb10('0x41')]['filter']+'%'};return _0x4d30d6;}})});}_0x31bee3=_[_0xbb10('0x4d')]({},_0x31bee3,_0x5e3fbd[_0xbb10('0x53')]);var _0x1a7df6={'where':_0x31bee3[_0xbb10('0x4b')]};return db[_0xbb10('0x3e')][_0xbb10('0x54')](_0x1a7df6)[_0xbb10('0x21')](function(_0x5be85e){_0x2b658a['count']=_0x5be85e;if(_0x5e3fbd[_0xbb10('0x41')][_0xbb10('0x55')]){_0x31bee3[_0xbb10('0x56')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x31bee3);})[_0xbb10('0x21')](function(_0x34cf4e){_0x2b658a[_0xbb10('0x57')]=_0x34cf4e;return _0x2b658a;})[_0xbb10('0x21')](respondWithFilteredResult(_0x5cd55f,_0x31bee3))[_0xbb10('0x2b')](handleError(_0x5cd55f,null));};exports[_0xbb10('0x58')]=function(_0x2f2552,_0x460788){var _0x2626d8={'raw':![],'where':{'id':_0x2f2552['params']['id']},'include':[{'model':db['Pause'],'as':_0xbb10('0x3d')}]},_0x3d7e7e={};_0x3d7e7e[_0xbb10('0x3f')]=_[_0xbb10('0x40')](db[_0xbb10('0x3e')][_0xbb10('0x59')]);_0x3d7e7e[_0xbb10('0x41')]=_[_0xbb10('0x40')](_0x2f2552[_0xbb10('0x41')]);_0x3d7e7e[_0xbb10('0x42')]=_[_0xbb10('0x43')](_0x3d7e7e[_0xbb10('0x3f')],_0x3d7e7e[_0xbb10('0x41')]);_0x2626d8[_0xbb10('0x44')]=_[_0xbb10('0x43')](_0x3d7e7e[_0xbb10('0x3f')],qs['fields'](_0x2f2552[_0xbb10('0x41')]['fields']));_0x2626d8[_0xbb10('0x44')]=_0x2626d8[_0xbb10('0x44')][_0xbb10('0x46')]?_0x2626d8[_0xbb10('0x44')]:_0x3d7e7e[_0xbb10('0x3f')];if(_0x2f2552[_0xbb10('0x41')][_0xbb10('0x55')]){_0x2626d8[_0xbb10('0x56')]=[{'all':!![]}];}_0x2626d8=_[_0xbb10('0x4d')]({},_0x2626d8,_0x2f2552[_0xbb10('0x53')]);return db[_0xbb10('0x3e')][_0xbb10('0x5a')](_0x2626d8)[_0xbb10('0x21')](handleEntityNotFound(_0x460788,null))[_0xbb10('0x21')](respondWithResult(_0x460788,null))[_0xbb10('0x2b')](handleError(_0x460788,null));};exports['create']=function(_0x4571b6,_0x466eb7){return db[_0xbb10('0x3e')][_0xbb10('0x5b')](_0x4571b6[_0xbb10('0x5c')],{})[_0xbb10('0x21')](function(_0x4bedd0){var _0x120bda=_0x4571b6[_0xbb10('0x5d')][_0xbb10('0x37')]({'plain':!![]});if(!_0x120bda)throw new Error(_0xbb10('0x5e'));if(_0x120bda[_0xbb10('0x5f')]===_0xbb10('0x5d')){var _0x175872=_0x4bedd0[_0xbb10('0x37')]({'plain':!![]});var _0x205e01=_0xbb10('0x38');return db[_0xbb10('0x60')][_0xbb10('0x5a')]({'where':{'name':_0x205e01,'userProfileId':_0x120bda[_0xbb10('0x61')]},'raw':!![]})['then'](function(_0x4ea1a6){if(_0x4ea1a6&&_0x4ea1a6[_0xbb10('0x62')]===0x0){return db[_0xbb10('0x39')][_0xbb10('0x5b')]({'name':_0x175872[_0xbb10('0x3b')],'resourceId':_0x175872['id'],'type':_0x4ea1a6['name'],'sectionId':_0x4ea1a6['id']},{})['then'](function(){return _0x4bedd0;});}else{return _0x4bedd0;}})[_0xbb10('0x2b')](function(_0xaf2cc3){logger[_0xbb10('0x27')](_0xbb10('0x63'),_0xaf2cc3);throw _0xaf2cc3;});}return _0x4bedd0;})[_0xbb10('0x21')](respondWithResult(_0x466eb7,0xc9))[_0xbb10('0x2b')](handleError(_0x466eb7,null));};exports[_0xbb10('0x35')]=function(_0x4a5fb9,_0x117e84){if(_0x4a5fb9[_0xbb10('0x5c')]['id']){delete _0x4a5fb9['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4a5fb9[_0xbb10('0x64')]['id']},'include':[{'model':db[_0xbb10('0x65')],'as':_0xbb10('0x3d')}]})['then'](handleEntityNotFound(_0x117e84,null))['then'](saveUpdates(_0x4a5fb9['body'],null))[_0xbb10('0x21')](respondWithResult(_0x117e84,null))[_0xbb10('0x2b')](handleError(_0x117e84,null));};exports[_0xbb10('0x36')]=function(_0x4e9fbd,_0xa1bbd9){return db[_0xbb10('0x3e')]['find']({'where':{'id':_0x4e9fbd['params']['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0xa1bbd9,null))[_0xbb10('0x21')](removeEntity(_0xa1bbd9,null))[_0xbb10('0x2b')](handleError(_0xa1bbd9,null));};exports[_0xbb10('0x66')]=function(_0x54b7c5,_0x43eaec){return db[_0xbb10('0x3e')][_0xbb10('0x66')]()['then'](respondWithResult(_0x43eaec,null))[_0xbb10('0x2b')](handleError(_0x43eaec,null));};exports[_0xbb10('0x67')]=function(_0x3e3617,_0x5b2bd4,_0x2ca491){if(_0x3e3617[_0xbb10('0x5c')]['id']){delete _0x3e3617[_0xbb10('0x5c')]['id'];}return db[_0xbb10('0x3e')]['find']({'where':{'id':_0x3e3617[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x5b2bd4,null))[_0xbb10('0x21')](function(_0x2d0f4b){if(_0x2d0f4b){_0x3e3617['body'][_0xbb10('0x68')]=_0x2d0f4b['id'];return db[_0xbb10('0x69')][_0xbb10('0x5b')](_0x3e3617[_0xbb10('0x5c')]);}})[_0xbb10('0x21')](respondWithResult(_0x5b2bd4,null))[_0xbb10('0x2b')](handleError(_0x5b2bd4,null));};exports[_0xbb10('0x6a')]=function(_0x4a30c5,_0x4a13d7,_0x5acd5e){var _0xdfbc0b={'raw':![],'where':{}};var _0x9c672d={};var _0x3eda96={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x4a30c5[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x4a13d7,null))[_0xbb10('0x21')](function(_0x3a9677){if(_0x3a9677){_0x9c672d[_0xbb10('0x3f')]=_[_0xbb10('0x40')](db['Disposition'][_0xbb10('0x59')]);_0x9c672d[_0xbb10('0x41')]=_[_0xbb10('0x40')](_0x4a30c5[_0xbb10('0x41')]);_0x9c672d[_0xbb10('0x42')]=_['intersection'](_0x9c672d['model'],_0x9c672d['query']);_0xdfbc0b[_0xbb10('0x44')]=_[_0xbb10('0x43')](_0x9c672d[_0xbb10('0x3f')],qs[_0xbb10('0x45')](_0x4a30c5[_0xbb10('0x41')][_0xbb10('0x45')]));_0xdfbc0b['attributes']=_0xdfbc0b[_0xbb10('0x44')]['length']?_0xdfbc0b['attributes']:_0x9c672d['model'];if(!_0x4a30c5[_0xbb10('0x41')][_0xbb10('0x47')](_0xbb10('0x48'))){_0xdfbc0b[_0xbb10('0x30')]=qs['limit'](_0x4a30c5[_0xbb10('0x41')]['limit']);_0xdfbc0b['offset']=qs[_0xbb10('0x2f')](_0x4a30c5[_0xbb10('0x41')][_0xbb10('0x2f')]);}_0xdfbc0b[_0xbb10('0x49')]=qs[_0xbb10('0x4a')](_0x4a30c5['query'][_0xbb10('0x4a')]);_0xdfbc0b[_0xbb10('0x4b')]=qs[_0xbb10('0x42')](_[_0xbb10('0x6b')](_0x4a30c5[_0xbb10('0x41')],_0x9c672d[_0xbb10('0x42')]));_0xdfbc0b[_0xbb10('0x4b')]['ChatWebsiteId']=_0x3a9677['id'];if(_0x4a30c5[_0xbb10('0x41')][_0xbb10('0x4c')]){_0xdfbc0b[_0xbb10('0x4b')]=_[_0xbb10('0x4d')](_0xdfbc0b[_0xbb10('0x4b')],{'$or':_[_0xbb10('0x4e')](_0xdfbc0b[_0xbb10('0x44')],function(_0x312a08){var _0x5a4429={};_0x5a4429[_0x312a08]={'$like':'%'+_0x4a30c5[_0xbb10('0x41')][_0xbb10('0x4c')]+'%'};return _0x5a4429;})});}_0xdfbc0b=_[_0xbb10('0x4d')]({},_0xdfbc0b,_0x4a30c5['options']);return db['Disposition']['count']({'where':_0xdfbc0b[_0xbb10('0x4b')]})['then'](function(_0x4e3d6a){_0x3eda96[_0xbb10('0x54')]=_0x4e3d6a;if(_0x4a30c5[_0xbb10('0x41')][_0xbb10('0x55')]){_0xdfbc0b[_0xbb10('0x56')]=[{'all':!![]}];}return db[_0xbb10('0x69')][_0xbb10('0x6c')](_0xdfbc0b);})[_0xbb10('0x21')](function(_0x417304){_0x3eda96[_0xbb10('0x57')]=_0x417304;return _0x3eda96;});}})['then'](respondWithFilteredResult(_0x4a13d7,_0xdfbc0b))[_0xbb10('0x2b')](handleError(_0x4a13d7,null));};exports[_0xbb10('0x6d')]=function(_0x46b6d2,_0x35b811,_0x5c8eb8){var _0x4c0795;return db[_0xbb10('0x3e')][_0xbb10('0x5a')]({'where':{'id':_0x46b6d2[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x35b811,null))['then'](function(_0x17d596){if(_0x17d596){return _0x17d596[_0xbb10('0x6d')](_0x46b6d2[_0xbb10('0x41')][_0xbb10('0x6e')]);}})[_0xbb10('0x21')](respondWithStatusCode(_0x35b811,null))['catch'](handleError(_0x35b811,null));};exports['addAnswer']=function(_0x372636,_0x53c698,_0x22c030){if(_0x372636['body']['id']){delete _0x372636[_0xbb10('0x5c')]['id'];}return db[_0xbb10('0x3e')]['find']({'where':{'id':_0x372636['params']['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x53c698,null))[_0xbb10('0x21')](function(_0x177f77){if(_0x177f77){_0x372636['body'][_0xbb10('0x68')]=_0x177f77['id'];return db[_0xbb10('0x6f')][_0xbb10('0x5b')](_0x372636[_0xbb10('0x5c')]);}})[_0xbb10('0x21')](respondWithResult(_0x53c698,null))[_0xbb10('0x2b')](handleError(_0x53c698,null));};exports[_0xbb10('0x70')]=function(_0x226363,_0x3e6246,_0x479d51){var _0x3367d4={'raw':![],'where':{}};var _0x28cc46={};var _0x412fbf={'count':0x0,'rows':[]};return db[_0xbb10('0x3e')][_0xbb10('0x71')]({'where':{'id':_0x226363[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x3e6246,null))[_0xbb10('0x21')](function(_0x17ed20){if(_0x17ed20){_0x28cc46[_0xbb10('0x3f')]=_[_0xbb10('0x40')](db[_0xbb10('0x6f')]['rawAttributes']);_0x28cc46['query']=_[_0xbb10('0x40')](_0x226363[_0xbb10('0x41')]);_0x28cc46[_0xbb10('0x42')]=_[_0xbb10('0x43')](_0x28cc46[_0xbb10('0x3f')],_0x28cc46['query']);_0x3367d4[_0xbb10('0x44')]=_[_0xbb10('0x43')](_0x28cc46[_0xbb10('0x3f')],qs[_0xbb10('0x45')](_0x226363[_0xbb10('0x41')][_0xbb10('0x45')]));_0x3367d4['attributes']=_0x3367d4[_0xbb10('0x44')][_0xbb10('0x46')]?_0x3367d4['attributes']:_0x28cc46[_0xbb10('0x3f')];if(!_0x226363['query'][_0xbb10('0x47')](_0xbb10('0x48'))){_0x3367d4[_0xbb10('0x30')]=qs[_0xbb10('0x30')](_0x226363[_0xbb10('0x41')]['limit']);_0x3367d4[_0xbb10('0x2f')]=qs['offset'](_0x226363[_0xbb10('0x41')][_0xbb10('0x2f')]);}_0x3367d4['order']=qs['sort'](_0x226363[_0xbb10('0x41')][_0xbb10('0x4a')]);_0x3367d4[_0xbb10('0x4b')]=qs[_0xbb10('0x42')](_[_0xbb10('0x6b')](_0x226363[_0xbb10('0x41')],_0x28cc46[_0xbb10('0x42')]));_0x3367d4[_0xbb10('0x4b')][_0xbb10('0x68')]=_0x17ed20['id'];if(_0x226363[_0xbb10('0x41')][_0xbb10('0x4c')]){_0x3367d4['where']=_[_0xbb10('0x4d')](_0x3367d4[_0xbb10('0x4b')],{'$or':_[_0xbb10('0x4e')](_0x3367d4[_0xbb10('0x44')],function(_0xfe02f5){var _0x86a6ff={};_0x86a6ff[_0xfe02f5]={'$like':'%'+_0x226363[_0xbb10('0x41')][_0xbb10('0x4c')]+'%'};return _0x86a6ff;})});}_0x3367d4=_[_0xbb10('0x4d')]({},_0x3367d4,_0x226363[_0xbb10('0x53')]);return db[_0xbb10('0x6f')][_0xbb10('0x54')]({'where':_0x3367d4['where']})[_0xbb10('0x21')](function(_0x5e0741){_0x412fbf[_0xbb10('0x54')]=_0x5e0741;if(_0x226363[_0xbb10('0x41')][_0xbb10('0x55')]){_0x3367d4[_0xbb10('0x56')]=[{'all':!![]}];}return db[_0xbb10('0x6f')]['findAll'](_0x3367d4);})[_0xbb10('0x21')](function(_0x217107){_0x412fbf[_0xbb10('0x57')]=_0x217107;return _0x412fbf;});}})[_0xbb10('0x21')](respondWithFilteredResult(_0x3e6246,_0x3367d4))[_0xbb10('0x2b')](handleError(_0x3e6246,null));};exports[_0xbb10('0x72')]=function(_0x4970fe,_0x4bd470,_0x5cc9d7){var _0x11ab88;return db[_0xbb10('0x3e')]['find']({'where':{'id':_0x4970fe[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x4bd470,null))['then'](function(_0x2831de){if(_0x2831de){return _0x2831de[_0xbb10('0x72')](_0x4970fe['query'][_0xbb10('0x6e')]);}})['then'](respondWithStatusCode(_0x4bd470,null))[_0xbb10('0x2b')](handleError(_0x4bd470,null));};exports[_0xbb10('0x73')]=function(_0x5d82e4,_0x34a5a3,_0x28cc74){_0x5d82e4['body']['sitepic']=_0x5d82e4[_0xbb10('0x74')][_0xbb10('0x75')];return db[_0xbb10('0x3e')][_0xbb10('0x5a')]({'where':{'id':_0x5d82e4[_0xbb10('0x64')]['id']}})['then'](handleEntityNotFound(_0x34a5a3,null))[_0xbb10('0x21')](saveUpdates(_0x5d82e4[_0xbb10('0x5c')],null))[_0xbb10('0x21')](respondWithResult(_0x34a5a3,null))['catch'](handleError(_0x34a5a3,null));};exports[_0xbb10('0x76')]=function(_0x4f90e6,_0x248887,_0xa5391d){_0x4f90e6[_0xbb10('0x5c')][_0xbb10('0x77')]=_0x4f90e6[_0xbb10('0x74')][_0xbb10('0x75')];return db[_0xbb10('0x3e')]['find']({'where':{'id':_0x4f90e6['params']['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x248887,null))[_0xbb10('0x21')](saveUpdates(_0x4f90e6[_0xbb10('0x5c')],null))[_0xbb10('0x21')](respondWithResult(_0x248887,null))[_0xbb10('0x2b')](handleError(_0x248887,null));};exports[_0xbb10('0x78')]=function(_0x1cccec,_0x1674f7,_0x3ede66){_0x1cccec[_0xbb10('0x5c')][_0xbb10('0x79')]=_0x1cccec[_0xbb10('0x74')][_0xbb10('0x75')];return db['ChatWebsite'][_0xbb10('0x5a')]({'where':{'id':_0x1cccec[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x1674f7,null))[_0xbb10('0x21')](saveUpdates(_0x1cccec[_0xbb10('0x5c')],null))[_0xbb10('0x21')](respondWithResult(_0x1674f7,null))[_0xbb10('0x2b')](handleError(_0x1674f7,null));};exports[_0xbb10('0x7a')]=function(_0x3c6c45,_0x3c92f4,_0x2a1c53){_0x3c6c45['body'][_0xbb10('0x7b')]=_0x3c6c45['file'][_0xbb10('0x75')];return db[_0xbb10('0x3e')][_0xbb10('0x5a')]({'where':{'id':_0x3c6c45[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x3c92f4,null))[_0xbb10('0x21')](saveUpdates(_0x3c6c45['body'],null))[_0xbb10('0x21')](respondWithResult(_0x3c92f4,null))['catch'](handleError(_0x3c92f4,null));};exports[_0xbb10('0x7c')]=function(_0x2141e9,_0xda122,_0x576bb6){var _0x2b652c=path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],_0xbb10('0x7f'));var _0x25c5b2={'where':{'id':_0x2141e9[_0xbb10('0x64')]['id']},'attributes':['id',_0xbb10('0x80')],'raw':!![]};var _0xa09041=![];return require('../../config/license/util')[_0xbb10('0x81')]()['then'](function(_0xe70161){if(_0xe70161){_0xa09041=_0xe70161[_0xbb10('0x82')];}})[_0xbb10('0x21')](function(){return db[_0xbb10('0x3e')][_0xbb10('0x5a')](_0x25c5b2);})[_0xbb10('0x21')](handleEntityNotFound(_0xda122,null))[_0xbb10('0x21')](function(_0x5e9888){if(_0x5e9888){if(!_[_0xbb10('0x83')](_0x5e9888['sitepic'])){if(fs['existsSync'](path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],_0xbb10('0x84'),_0x5e9888[_0xbb10('0x80')]))&&_0xa09041){_0x2b652c=path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],'server/files/images/logos/',_0x5e9888[_0xbb10('0x80')]);}}return _0xda122[_0xbb10('0x85')](_0x2b652c);}})[_0xbb10('0x2b')](handleError(_0xda122,null));};exports[_0xbb10('0x86')]=function(_0x136520,_0x28127c,_0x528aff){var _0xdfdc42=path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],_0xbb10('0x87'));var _0x31718f={'where':{'id':_0x136520[_0xbb10('0x64')]['id']},'attributes':['id',_0xbb10('0x77')],'raw':!![]};return db['ChatWebsite'][_0xbb10('0x5a')](_0x31718f)['then'](handleEntityNotFound(_0x28127c,null))[_0xbb10('0x21')](function(_0x4a6660){if(_0x4a6660){if(!_['isNil'](_0x4a6660[_0xbb10('0x77')])){if(fs[_0xbb10('0x88')](path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],_0xbb10('0x89'),_0x4a6660['agentAvatar']))){_0xdfdc42=path[_0xbb10('0x7d')](config['root'],'server/files/images/avatars/',_0x4a6660['agentAvatar']);}}return _0x28127c[_0xbb10('0x85')](_0xdfdc42);}})[_0xbb10('0x2b')](handleError(_0x28127c,null));};exports[_0xbb10('0x8a')]=function(_0x8a7c27,_0x2882d1,_0x5abedf){var _0x125bcf=path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],_0xbb10('0x8b'));var _0x4b3b21={'where':{'id':_0x8a7c27[_0xbb10('0x64')]['id']},'attributes':['id',_0xbb10('0x79'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x4b3b21)[_0xbb10('0x21')](handleEntityNotFound(_0x2882d1,null))[_0xbb10('0x21')](function(_0x2ae3c6){if(_0x2ae3c6){if(!_[_0xbb10('0x83')](_0x2ae3c6[_0xbb10('0x79')])){if(fs[_0xbb10('0x88')](path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],_0xbb10('0x89'),_0x2ae3c6[_0xbb10('0x79')]))&&_0x2ae3c6['showCustomerAvatar']){_0x125bcf=path['join'](config['root'],_0xbb10('0x89'),_0x2ae3c6[_0xbb10('0x79')]);}}return _0x2882d1[_0xbb10('0x85')](_0x125bcf);}})['catch'](handleError(_0x2882d1,null));};exports[_0xbb10('0x8c')]=function(_0x2f6be3,_0x2c638d,_0x290280){var _0x2a6589=path[_0xbb10('0x7d')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x356660={'where':{'id':_0x2f6be3['params']['id']},'attributes':['id',_0xbb10('0x7b')],'raw':!![]};return db[_0xbb10('0x3e')][_0xbb10('0x5a')](_0x356660)[_0xbb10('0x21')](handleEntityNotFound(_0x2c638d,null))[_0xbb10('0x21')](function(_0x2dfa04){if(_0x2dfa04){if(!_[_0xbb10('0x83')](_0x2dfa04[_0xbb10('0x7b')])){if(fs[_0xbb10('0x88')](path[_0xbb10('0x7d')](config['root'],_0xbb10('0x89'),_0x2dfa04['systemAvatar']))){_0x2a6589=path[_0xbb10('0x7d')](config['root'],_0xbb10('0x89'),_0x2dfa04[_0xbb10('0x7b')]);}}return _0x2c638d[_0xbb10('0x85')](_0x2a6589);}})[_0xbb10('0x2b')](handleError(_0x2c638d,null));};exports['notify']=function(_0xcc246f,_0x4960b1,_0xfe1154){var _0x1b6b9f=require(_0xbb10('0x8d'));var _0x5388dc=new _0x1b6b9f();var _0x298167=_0x5388dc[_0xbb10('0x8e')](_0xcc246f[_0xbb10('0x8f')][_0xbb10('0x90')])[_0xbb10('0x91')]();var _0x309ec1={'body':_0xcc246f['body'],'channel':'chat'};var _0x522a88=[];var _0x26a752=[];var _0x5ad3f1={};var _0x318908=![];return db['CmContact'][_0xbb10('0x66')]()[_0xbb10('0x21')](function(_0x385ad3){if(!_0x385ad3){throw new db['Sequelize']['ValidationError'](_0xbb10('0x92'));}_0x522a88=_[_0xbb10('0x93')](_[_0xbb10('0x40')](_0x385ad3),['createdAt',_0xbb10('0x94')]);_0x26a752=_[_0xbb10('0x93')](_[_0xbb10('0x40')](_0x385ad3),['createdAt','updatedAt','CompanyId',_0xbb10('0x95')]);if(_0xcc246f['body']['id']){delete _0xcc246f[_0xbb10('0x5c')]['id'];}if(_[_0xbb10('0x83')](_0xcc246f[_0xbb10('0x5c')][_0xbb10('0x96')])){throw new db[(_0xbb10('0x97'))][(_0xbb10('0x98'))](_0xbb10('0x99'));}if(_[_0xbb10('0x83')](_0xcc246f[_0xbb10('0x5c')][_0xbb10('0x5c')])||_0xcc246f[_0xbb10('0x5c')]['body']===''){throw new db[(_0xbb10('0x97'))][(_0xbb10('0x98'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbb10('0x83')](_0xcc246f['body']['mapKey'])){throw new db[(_0xbb10('0x97'))][(_0xbb10('0x98'))](_0xbb10('0x9a')+_0x26a752);}if(!_[_0xbb10('0x9b')](_0x26a752,_0xcc246f[_0xbb10('0x5c')]['mapKey'])){throw new db[(_0xbb10('0x97'))][(_0xbb10('0x98'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x26a752);}_0x5ad3f1[_0xcc246f[_0xbb10('0x5c')][_0xbb10('0x9c')]]=_0xcc246f['body'][_0xbb10('0x96')];})['then'](function(){return db[_0xbb10('0x3e')][_0xbb10('0x5a')]({'where':{'id':_0xcc246f[_0xbb10('0x64')]['id']},'include':[{'model':db[_0xbb10('0x9d')],'as':_0xbb10('0x9e'),'include':[{'model':db[_0xbb10('0x9f')],'as':_0xbb10('0xa0'),'where':_0x5ad3f1,'limit':0x1,'order':[['updatedAt',_0xbb10('0xa1')]]}]},{'model':db[_0xbb10('0xa2')],'as':_0xbb10('0xa3')}]});})[_0xbb10('0x21')](handleEntityNotFound(_0x4960b1,null))[_0xbb10('0x21')](function(_0x1301e3){if(_0x1301e3&&_0x1301e3['List']){_0x309ec1['account']=_0x1301e3;_0x309ec1['applications']=_0x1301e3[_0xbb10('0xa3')];_0x309ec1[_0xbb10('0xa4')]=_0x1301e3[_0xbb10('0x9e')];_0x309ec1[_0xbb10('0xa5')]=_['orderBy'](_0x309ec1[_0xbb10('0xa5')],[_0xbb10('0xa6')],[_0xbb10('0xa7')]);if(_0x309ec1['account']['Applications']){delete _0x309ec1[_0xbb10('0xa8')]['Applications'];}if(_0x309ec1[_0xbb10('0xa8')][_0xbb10('0x9e')]&&_0x309ec1[_0xbb10('0xa8')][_0xbb10('0x9e')][_0xbb10('0xa0')][_0xbb10('0x46')]){return _0x309ec1[_0xbb10('0xa8')]['List'][_0xbb10('0xa0')][0x0];}var _0x1eca6c=_['defaults'](_0xcc246f[_0xbb10('0x5c')],{'firstName':_0xcc246f[_0xbb10('0x5c')][_0xbb10('0x96')],'ListId':_0x1301e3['ListId']});_0x1eca6c[_0xcc246f['body']['mapKey']]=_0xcc246f[_0xbb10('0x5c')][_0xbb10('0x96')];return db['CmContact'][_0xbb10('0x5b')](_0x1eca6c,{'fields':_0x522a88,'raw':!![]});}})[_0xbb10('0x21')](handleEntityNotFound(_0x4960b1,null))[_0xbb10('0x21')](function(_0x24b0ea){_0x309ec1[_0xbb10('0xa9')]=_0x24b0ea;if(_0x24b0ea){var _0x1fe91e={'ContactId':_0x24b0ea['id'],'ChatWebsiteId':_0xcc246f[_0xbb10('0x64')]['id'],'from':(_0x24b0ea['firstName']||'')+'\x20'+(_0x24b0ea[_0xbb10('0xaa')]||''),'customerIp':_0xcc246f['body']['customerIp'],'referer':_0xcc246f['body'][_0xbb10('0xab')],'browserName':_0x298167[_0xbb10('0xac')]['name']&&_0x298167[_0xbb10('0xac')]['version']?util[_0xbb10('0xad')](_0xbb10('0xae'),_0x298167[_0xbb10('0xac')]['name'],_0x298167['browser'][_0xbb10('0xaf')]):'unknown','browserVersion':_0x298167[_0xbb10('0xac')][_0xbb10('0xaf')]||'unknown','osName':util['format'](_0xbb10('0xae'),_0x298167['os'][_0xbb10('0x3b')],_0x298167['os'][_0xbb10('0xaf')]),'osVersion':_0x298167['os']['version'],'deviceModel':_0x298167[_0xbb10('0xb0')][_0xbb10('0x3f')]&&_0x298167[_0xbb10('0xb0')]['vendor']?util[_0xbb10('0xad')](_0xbb10('0xb1'),_0x298167[_0xbb10('0xb0')][_0xbb10('0x3f')],_0x298167[_0xbb10('0xb0')][_0xbb10('0xb2')],_0x298167[_0xbb10('0xb0')][_0xbb10('0x4f')]):null,'deviceVendor':_0x298167[_0xbb10('0xb0')][_0xbb10('0xb2')],'deviceType':_0x298167[_0xbb10('0xb0')][_0xbb10('0x4f')],'formData':JSON[_0xbb10('0x26')](_0xcc246f['body'])};var _0x5eea19={'ChatWebsiteId':_0xcc246f[_0xbb10('0x64')]['id'],'closed':![]};if(_0xcc246f['body'][_0xbb10('0xb3')]){_0x5eea19[_0xbb10('0xb3')]=_0xcc246f[_0xbb10('0x5c')]['threadId'];return db[_0xbb10('0xb4')][_0xbb10('0x5a')]({'where':_0x5eea19})[_0xbb10('0x21')](function(_0xe5f8e2){if(_0xe5f8e2){return[_0xe5f8e2,![]];}_0x1fe91e[_0xbb10('0xb3')]=_0xcc246f['body'][_0xbb10('0xb3')];_0x1fe91e[_0xbb10('0xb5')]=_0xcc246f[_0xbb10('0x5c')][_0xbb10('0xb5')];return db[_0xbb10('0xb4')][_0xbb10('0x5b')](_0x1fe91e)['then'](function(_0x3d8043){return[_0x3d8043,!![]];});});}_0x5eea19[_0xbb10('0xb6')]=_0x24b0ea['id'];if(_0xcc246f['body'][_0xbb10('0xb7')]&&_0xcc246f[_0xbb10('0x5c')][_0xbb10('0xb7')]['id']){_0x5eea19['id']=_0xcc246f[_0xbb10('0x5c')][_0xbb10('0xb7')]['id'];return db[_0xbb10('0xb4')][_0xbb10('0x5a')]({'where':_0x5eea19})[_0xbb10('0x21')](function(_0x1d45c5){if(_0x1d45c5){return[_0x1d45c5,![]];}return db[_0xbb10('0xb4')][_0xbb10('0x5b')](_0x1fe91e)[_0xbb10('0x21')](function(_0x1db646){return[_0x1db646,!![]];});});}return db[_0xbb10('0xb4')][_0xbb10('0x5b')](_0x1fe91e)['then'](function(_0x12e6cb){return[_0x12e6cb,!![]];});}})[_0xbb10('0xb8')](function(_0x5507f6,_0x5baeaa){if(_0x5507f6){_0x318908=_0x5baeaa;if(!_0x5baeaa){var _0x237258={'from':(_0x309ec1[_0xbb10('0xa9')][_0xbb10('0xb9')]||'')+'\x20'+(_0x309ec1[_0xbb10('0xa9')][_0xbb10('0xaa')]||'')};if(_0xcc246f[_0xbb10('0x5c')][_0xbb10('0xb3')]&&_0xcc246f[_0xbb10('0x5c')][_0xbb10('0xba')]&&_0xcc246f['body']['threadId']!=_0xcc246f['body']['messageId']){_0x237258['threadId']=_0xcc246f['body'][_0xbb10('0xba')];}return _0x5507f6[_0xbb10('0x35')](_0x237258);}else{return _0x5507f6;}}})[_0xbb10('0x21')](function(_0x395ac8){_0x309ec1['interaction']=_0x395ac8[_0xbb10('0x37')]({'plain':!![]});_0x309ec1[_0xbb10('0xb7')][_0xbb10('0xbb')]=_0x318908;if(_0x309ec1[_0xbb10('0xb7')]['created']){if(_0x309ec1['account'][_0xbb10('0xbc')]){_0x309ec1[_0xbb10('0xa5')]['push']({'id':0x0,'priority':_0x309ec1['applications'][_0xbb10('0x46')]+0x1,'app':_0xbb10('0xbd'),'appdata':_0xbb10('0xbe'),'interval':_0xbb10('0xbf')});}}return db[_0xbb10('0xc0')]['create']({'body':_0xcc246f[_0xbb10('0x5c')]['body'],'ChatWebsiteId':_0xcc246f['params']['id'],'ChatInteractionId':_0x395ac8['id'],'direction':'in','ContactId':_0x309ec1[_0xbb10('0xa9')]['id'],'AttachmentId':_0xcc246f[_0xbb10('0x5c')][_0xbb10('0xc1')]});})[_0xbb10('0x21')](function(_0x3b1e6f){_0x309ec1[_0xbb10('0x29')]=_0x3b1e6f;if(_0x309ec1['interaction'][_0xbb10('0xc2')]){return db[_0xbb10('0xc3')][_0xbb10('0x5a')]({'attributes':['id',_0xbb10('0x3b')],'where':{'id':_0x309ec1[_0xbb10('0xb7')][_0xbb10('0xc2')]}})[_0xbb10('0x21')](function(_0xce60f4){if(_0xce60f4){_0x309ec1[_0xbb10('0xa5')][_0xbb10('0xc4')]({'id':0x0,'priority':0x0,'app':_0xbb10('0xc5'),'appdata':_0xce60f4[_0xbb10('0x3b')]+','+(_0x309ec1[_0xbb10('0xa8')][_0xbb10('0xc6')]||0xa),'interval':_0xbb10('0xbf')});_0x309ec1[_0xbb10('0xc7')]=!![];}return respondWithRpcPromise(_0xbb10('0xc8'),_0xbb10('0xc9'),_0x309ec1);});}return respondWithRpcPromise(_0xbb10('0xc8'),_0xbb10('0xc9'),_0x309ec1);})[_0xbb10('0x21')](function(_0x1f84b0){respondWithRpcPromise('EventManager',_0xbb10('0xca'),{'event':'notify','message':_0x1f84b0},client9002);return _0x1f84b0;})[_0xbb10('0x21')](respondWithResult(_0x4960b1,null))[_0xbb10('0x2b')](handleError(_0x4960b1,null));};exports[_0xbb10('0xcb')]=function(_0x2b1f0f,_0x40bbf1,_0x4f5689){var _0x5997f3,_0x572b4d,_0x36be49;var _0x2fac6c=[];var _0x482f7d=[];var _0x31b7f9={};return db[_0xbb10('0x9f')][_0xbb10('0x66')]()['then'](function(_0xae8e0a){if(!_0xae8e0a){throw new db[(_0xbb10('0x97'))][(_0xbb10('0x98'))]('no\x20available\x20attributes');}_0x482f7d=_[_0xbb10('0x93')](_['keys'](_0xae8e0a),[_0xbb10('0xcc'),'updatedAt']);_0x2fac6c=_['difference'](_['keys'](_0xae8e0a),['createdAt','updatedAt','CompanyId',_0xbb10('0x95')]);if(_0x2b1f0f[_0xbb10('0x5c')]['id']){delete _0x2b1f0f[_0xbb10('0x5c')]['id'];}if(_[_0xbb10('0x83')](_0x2b1f0f['body'][_0xbb10('0x96')])){throw _0x40bbf1[_0xbb10('0x2c')](0x1f4)[_0xbb10('0x3c')](new db[(_0xbb10('0x97'))][(_0xbb10('0x98'))](_0xbb10('0x99')));}if(_[_0xbb10('0x83')](_0x2b1f0f[_0xbb10('0x5c')][_0xbb10('0x5c')])||_0x2b1f0f[_0xbb10('0x5c')]['body']===''){throw _0x40bbf1[_0xbb10('0x2c')](0x1f4)[_0xbb10('0x3c')](new db[(_0xbb10('0x97'))]['ValidationError'](_0xbb10('0xcd')));}if(_[_0xbb10('0x83')](_0x2b1f0f[_0xbb10('0x5c')][_0xbb10('0xce')])){throw _0x40bbf1['status'](0x1f4)[_0xbb10('0x3c')](new db[(_0xbb10('0x97'))][(_0xbb10('0x98'))](_0xbb10('0xcf')+_0x2fac6c));}if(!_[_0xbb10('0x9b')](_0x2fac6c,_0x2b1f0f[_0xbb10('0x5c')][_0xbb10('0xce')])){throw _0x40bbf1[_0xbb10('0x2c')](0x1f4)[_0xbb10('0x3c')](new db[(_0xbb10('0x97'))][(_0xbb10('0x98'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2fac6c));}_0x31b7f9[_0x2b1f0f[_0xbb10('0x5c')][_0xbb10('0xce')]]=_0x2b1f0f['body']['from'];})[_0xbb10('0x21')](function(){return db[_0xbb10('0x3e')]['find']({'where':{'id':_0x2b1f0f[_0xbb10('0x64')]['id']},'include':[{'model':db[_0xbb10('0x9d')],'as':'List'}]});})[_0xbb10('0x21')](handleEntityNotFound(_0x40bbf1,null))[_0xbb10('0x21')](function(_0xb563e5){if(_0xb563e5&&_0xb563e5[_0xbb10('0x9e')]){_0x572b4d=_0xb563e5;var _0x3c92db=_['defaults'](_0x2b1f0f['body'],{'firstName':_0x2b1f0f['body'][_0xbb10('0x96')],'phone':_0x2b1f0f['body'][_0xbb10('0x96')],'ListId':_0xb563e5['ListId']});_0x3c92db[_0x2b1f0f['body'][_0xbb10('0xce')]]=_0x2b1f0f[_0xbb10('0x5c')][_0xbb10('0x96')];return db[_0xbb10('0x9f')][_0xbb10('0xd0')]({'where':_0x31b7f9,'defaults':_0x3c92db});}})[_0xbb10('0xb8')](function(_0x5b9d3f){if(_0x5b9d3f){_0x36be49=_0x5b9d3f;var _0x54d45b=fs['readFileSync'](path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],_0xbb10('0xd1')),_0xbb10('0xd2'));var _0x26bc1c=ejs[_0xbb10('0xd3')](_0x54d45b,{'body':_[_0xbb10('0xd4')](_0x2b1f0f['body'][_0xbb10('0x5c')]),'bodyTitle':_0x572b4d[_0xbb10('0xd5')]});return db[_0xbb10('0xd6')][_0xbb10('0x5b')]({'body':_0x26bc1c,'ContactId':_0x5b9d3f['id'],'ChatWebsiteId':_0x572b4d['id']});}})['then'](function(_0x287d4f){if(_0x287d4f){_0x5997f3=_0x287d4f;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0xd7')],'as':_0xbb10('0xd8'),'raw':!![]}]});}})[_0xbb10('0x21')](function(_0xf0c285){if(_0xf0c285&&_0xf0c285[_0xbb10('0xd8')]&&_0x572b4d[_0xbb10('0xd9')]){var _0x4b7bf8={'tls':{'rejectUnauthorized':![]}};if(_0xf0c285[_0xbb10('0xd8')][_0xbb10('0xda')]){_0x4b7bf8[_0xbb10('0xda')]=_0xf0c285[_0xbb10('0xd8')][_0xbb10('0xda')];}else{_0x4b7bf8[_0xbb10('0xdb')]=_0xf0c285[_0xbb10('0xd8')]['host'];_0x4b7bf8[_0xbb10('0xdc')]=_0xf0c285[_0xbb10('0xd8')][_0xbb10('0xdc')];_0x4b7bf8['secure']=_0xf0c285['Smtp'][_0xbb10('0xdd')];}if(_0xf0c285[_0xbb10('0xd8')][_0xbb10('0xde')]){_0x4b7bf8[_0xbb10('0xdf')]={'user':_0xf0c285[_0xbb10('0xd8')][_0xbb10('0x5d')],'pass':_0xf0c285[_0xbb10('0xd8')]['pass']};}return respondWithRpcPromise(_0xbb10('0xe0'),_0xbb10('0xe1'),{'account':_0x4b7bf8,'message':{'from':util[_0xbb10('0xad')]('\x22%s\x22\x20<%s>',_0xf0c285['name'],_0xf0c285['email']||_0xf0c285['Smtp'][_0xbb10('0x5d')]),'to':_0x572b4d[_0xbb10('0xd9')],'subject':_0x572b4d[_0xbb10('0xe2')],'text':_0x5997f3[_0xbb10('0x5c')]}},client9003)['then'](function(){return _0x5997f3;})[_0xbb10('0x2b')](function(_0x4f6b12){console[_0xbb10('0x27')](_0x4f6b12);});}})[_0xbb10('0x21')](function(){if(_0x5997f3){return _0x5997f3;}})[_0xbb10('0x21')](respondWithResult(_0x40bbf1,null))[_0xbb10('0x2b')](handleError(_0x40bbf1,null));};exports[_0xbb10('0xe3')]=function(_0x163fdd,_0x3c93d0,_0x4541f2){return db[_0xbb10('0xb4')][_0xbb10('0x5a')]({'where':{'id':_0x163fdd[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x3c93d0,null))['then'](function(_0x1bd6db){if(_0x1bd6db){return _0x1bd6db[_0xbb10('0xe3')](_0x163fdd[_0xbb10('0x5c')]['ids'],_[_0xbb10('0xe4')](_0x163fdd['body'],[_0xbb10('0x6e'),'id'])||{});}})[_0xbb10('0x21')](respondWithResult(_0x3c93d0,null))[_0xbb10('0x2b')](handleError(_0x3c93d0,null));};exports[_0xbb10('0xe5')]=function(_0x36a054,_0x533327,_0x5345df){var _0x842d94={'raw':![],'where':{}};var _0x4cf5cc={};var _0x553bb8={'count':0x0,'rows':[]};return db[_0xbb10('0x3e')]['findOne']({'where':{'id':_0x36a054[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x533327,null))[_0xbb10('0x21')](function(_0x4469c4){if(_0x4469c4){_0x4cf5cc[_0xbb10('0x3f')]=_[_0xbb10('0x40')](db[_0xbb10('0xb4')][_0xbb10('0x59')]);_0x4cf5cc['query']=_[_0xbb10('0x40')](_0x36a054['query']);_0x4cf5cc[_0xbb10('0x42')]=_['intersection'](_0x4cf5cc[_0xbb10('0x3f')],_0x4cf5cc[_0xbb10('0x41')]);_0x842d94['attributes']=_[_0xbb10('0x43')](_0x4cf5cc[_0xbb10('0x3f')],qs[_0xbb10('0x45')](_0x36a054['query'][_0xbb10('0x45')]));_0x842d94[_0xbb10('0x44')]=_0x842d94[_0xbb10('0x44')]['length']?_0x842d94[_0xbb10('0x44')]:_0x4cf5cc[_0xbb10('0x3f')];if(!_0x36a054[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x842d94['limit']=qs[_0xbb10('0x30')](_0x36a054[_0xbb10('0x41')][_0xbb10('0x30')]);_0x842d94[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x36a054[_0xbb10('0x41')][_0xbb10('0x2f')]);}_0x842d94[_0xbb10('0x49')]=qs[_0xbb10('0x4a')](_0x36a054[_0xbb10('0x41')]['sort']);_0x842d94['where']=qs[_0xbb10('0x42')](_[_0xbb10('0x6b')](_0x36a054[_0xbb10('0x41')],_0x4cf5cc['filters']));_0x842d94[_0xbb10('0x4b')][_0xbb10('0x68')]=_0x4469c4['id'];if(_0x36a054[_0xbb10('0x41')][_0xbb10('0x4c')]){_0x842d94[_0xbb10('0x4b')]=_[_0xbb10('0x4d')](_0x842d94[_0xbb10('0x4b')],{'$or':_[_0xbb10('0x4e')](_0x842d94[_0xbb10('0x44')],function(_0x4d2c8d){var _0xa7e6bd={};_0xa7e6bd[_0x4d2c8d]={'$like':'%'+_0x36a054[_0xbb10('0x41')][_0xbb10('0x4c')]+'%'};return _0xa7e6bd;})});}_0x842d94=_[_0xbb10('0x4d')]({},_0x842d94,_0x36a054['options']);return db[_0xbb10('0xb4')][_0xbb10('0x54')]({'where':_0x842d94[_0xbb10('0x4b')]})['then'](function(_0x59f9b2){_0x553bb8[_0xbb10('0x54')]=_0x59f9b2;if(_0x36a054['query'][_0xbb10('0x55')]){_0x842d94['include']=[{'model':db[_0xbb10('0x9f')],'as':_0xbb10('0xe6'),'required':![]},{'model':db[_0xbb10('0xc3')],'as':_0xbb10('0xe7'),'attributes':[_0xbb10('0x3b'),_0xbb10('0xe8'),_0xbb10('0xe9')],'required':![]},{'model':db['Tag'],'as':_0xbb10('0xea'),'attributes':['id',_0xbb10('0x3b'),_0xbb10('0xeb')],'where':_0x36a054[_0xbb10('0x41')][_0xbb10('0xec')]?{'id':_0x36a054[_0xbb10('0x41')]['tag']}:undefined,'required':_0x36a054[_0xbb10('0x41')][_0xbb10('0xec')]?!![]:![]}];}return db[_0xbb10('0xb4')][_0xbb10('0x6c')](_0x842d94);})[_0xbb10('0x21')](function(_0x16edac){_0x553bb8[_0xbb10('0x57')]=_0x16edac;return _0x553bb8;});}})['then'](respondWithFilteredResult(_0x533327,_0x842d94))[_0xbb10('0x2b')](handleError(_0x533327,null));};function iftimePromise(_0x183e57,_0x1e8713){return respondWithRpcPromise('Command',_0xbb10('0xed'),{'command':_0x1e8713['timezone']?util[_0xbb10('0xad')](_0xbb10('0xee'),_0x183e57[_0xbb10('0xef')],_0x1e8713['timezone']):util['format'](_0xbb10('0xf0'),_0x183e57[_0xbb10('0xef')])},client9002)[_0xbb10('0x21')](function(_0x27ea82){var _0x8ef7c1=_0x27ea82&&_0x27ea82[_0xbb10('0xf1')](_0xbb10('0xf2'))>=0x0?!![]:![];logger[_0xbb10('0x22')](_0xbb10('0xf3'),_0x1e8713['id'],_0x183e57['id'],_0x183e57[_0xbb10('0xef')],_0x8ef7c1?_0xbb10('0xf4'):'OFFLINE',_0x1e8713['timezone']?_0x1e8713[_0xbb10('0xf5')]:_0xbb10('0xf6'));return _0x8ef7c1;})['catch'](function(_0x576df0){logger[_0xbb10('0x27')](_0xbb10('0xf3'),_0x1e8713['id'],_0x183e57['id'],_0x183e57[_0xbb10('0xef')],util['inspect'](_0x576df0,{'showHidden':![],'depth':null}),_0x1e8713[_0xbb10('0xf5')]?_0x1e8713[_0xbb10('0xf5')]:'No\x20timezone');return![];});}exports[_0xbb10('0xed')]=function(_0x97224a,_0x544c9c,_0x5a5349){var _0x3eb533=0x0;var _0x26ec8e=0x0;var _0xfefdc=![];var _0x5cab64;var _0x5acd22;return db[_0xbb10('0x3e')][_0xbb10('0x5a')]({'where':{'id':_0x97224a['params']['id']},'include':[{'model':db[_0xbb10('0xf7')],'as':_0xbb10('0xf7'),'include':[{'model':db['Interval'],'as':_0xbb10('0xf8'),'attributes':['id',_0xbb10('0xef')],'raw':!![]}]}]})[_0xbb10('0x21')](handleEntityNotFound(_0x544c9c,null))[_0xbb10('0x21')](function(_0x5ac4e6){if(_0x5ac4e6){_0x5cab64=_0x5ac4e6;return _0x5ac4e6[_0xbb10('0xf9')]({'raw':!![]});}})['then'](function(_0x423253){if(_0x5cab64){if(_0x423253){_0x5acd22=_0x423253;}}return require(_0xbb10('0xfa'))[_0xbb10('0x81')]();})[_0xbb10('0x21')](function(_0x3b2ed0){if(_0x3b2ed0){_0x26ec8e=_0x3b2ed0[_0xbb10('0xfb')];_0xfefdc=_0x3b2ed0[_0xbb10('0x82')];}})[_0xbb10('0x21')](function(){return db['ChatInteraction'][_0xbb10('0x54')]({'where':{'closed':![]}});})[_0xbb10('0x21')](function(_0x6cdbe6){_0x3eb533=_0x6cdbe6;if(_0x26ec8e&&_0x6cdbe6>_0x26ec8e){return db[_0xbb10('0xfc')]['findOne']({'where':{'id':0x1}})['then'](function(_0xd23108){if(_0xd23108){_0xd23108[_0xbb10('0xfd')](_0xbb10('0xfe'));}});}})[_0xbb10('0x21')](function(){if(_0x5cab64['Interval']&&_0x5cab64[_0xbb10('0xf7')][_0xbb10('0xf8')]){var _0x4f0a22=[];for(var _0x327a34=0x0;_0x327a34<_0x5cab64['Interval']['Intervals'][_0xbb10('0x46')];_0x327a34++){var _0x18cede=_0x5cab64[_0xbb10('0xf7')][_0xbb10('0xf8')][_0x327a34][_0xbb10('0x37')]({'plain':!![]});_0x4f0a22['push'](iftimePromise(_0x18cede,_0x5cab64));}return BPromise[_0xbb10('0xff')](_0x4f0a22)[_0xbb10('0x21')](function(_0x356601){return _[_0xbb10('0x100')](_0x356601);});}else{return!![];}})[_0xbb10('0x21')](function(_0x344089){var _0xb90ba5=fs[_0xbb10('0x101')](path[_0xbb10('0x7d')](config[_0xbb10('0x7e')],_0xbb10('0x102')),_0xbb10('0xd2'));var _0x74ca46={'remote':_0x5cab64[_0xbb10('0x103')],'query':querystring[_0xbb10('0x26')](_[_0xbb10('0x4d')](_0x5cab64[_0xbb10('0x37')]({'plain':!![]}),{'customerIp':_0x97224a[_0xbb10('0x8f')][_0xbb10('0x104')]||_0x97224a[_0xbb10('0x8f')][_0xbb10('0x105')]||_0x97224a[_0xbb10('0x106')][_0xbb10('0x107')]||_0x97224a['ip'],'referer':_0x97224a[_0xbb10('0x8f')][_0xbb10('0xab')],'openedInteractions':_0x3eb533,'maxInteractions':_0x26ec8e,'virtual':_0xfefdc[_0xbb10('0xfb')],'online':_0x344089,'custom':_0xfefdc}))[_0xbb10('0x108')](/'/g,'\x5c\x27')};_0x544c9c['send'](ejs[_0xbb10('0xd3')](Mustache[_0xbb10('0xd3')](_0xb90ba5,_0x74ca46),{'proactiveActions':_0x5acd22,'alignment':_0x5cab64['alignment'],'verticalAlignment':_0x5cab64[_0xbb10('0x109')]}));})[_0xbb10('0x2b')](handleError(_0x544c9c,null));};exports['addApplications']=function(_0x3a20c0,_0x3b96dd,_0x4e97fd){return db[_0xbb10('0x3e')][_0xbb10('0x71')]({'where':{'id':_0x3a20c0[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x3b96dd,null))['then'](function(_0x170061){if(_0x170061){return db[_0xbb10('0x10a')][_0xbb10('0x10b')](function(_0x16ebc4){return db['ChatApplication'][_0xbb10('0x36')]({'where':{'ChatWebsiteId':_0x3a20c0[_0xbb10('0x64')]['id']},'transaction':_0x16ebc4})[_0xbb10('0x21')](function(_0x420a2e){var _0x385e4b=_[_0xbb10('0x4e')](_0x3a20c0[_0xbb10('0x5c')],function(_0x135604){_0x135604[_0xbb10('0x68')]=_0x3a20c0[_0xbb10('0x64')]['id'];return _0x135604;});return db[_0xbb10('0xa2')]['bulkCreate'](_0x385e4b,{'transaction':_0x16ebc4});});})[_0xbb10('0x21')](function(){return db[_0xbb10('0xa2')][_0xbb10('0x10c')]({'where':{'ChatWebsiteId':_0x3a20c0[_0xbb10('0x64')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x3b96dd,null))[_0xbb10('0x2b')](handleError(_0x3b96dd,null));};exports[_0xbb10('0x10d')]=function(_0x4785fb,_0x366ded,_0x5f0576){var _0x473cee={};var _0x3cf414={};var _0x2c5dd1;var _0x5df18b;return db['ChatWebsite'][_0xbb10('0x71')]({'where':{'id':_0x4785fb[_0xbb10('0x64')]['id']}})['then'](handleEntityNotFound(_0x366ded,null))['then'](function(_0x424bb1){if(_0x424bb1){_0x2c5dd1=_0x424bb1;_0x3cf414[_0xbb10('0x3f')]=_[_0xbb10('0x40')](db[_0xbb10('0xa2')][_0xbb10('0x59')]);_0x3cf414[_0xbb10('0x41')]=_['keys'](_0x4785fb[_0xbb10('0x41')]);_0x3cf414[_0xbb10('0x42')]=_[_0xbb10('0x43')](_0x3cf414[_0xbb10('0x3f')],_0x3cf414[_0xbb10('0x41')]);_0x473cee[_0xbb10('0x44')]=_[_0xbb10('0x43')](_0x3cf414[_0xbb10('0x3f')],qs[_0xbb10('0x45')](_0x4785fb[_0xbb10('0x41')]['fields']));_0x473cee[_0xbb10('0x44')]=_0x473cee[_0xbb10('0x44')]['length']?_0x473cee['attributes']:_0x3cf414['model'];_0x473cee['order']=qs['sort'](_0x4785fb['query']['sort']);_0x473cee['where']=qs[_0xbb10('0x42')](_[_0xbb10('0x6b')](_0x4785fb['query'],_0x3cf414[_0xbb10('0x42')]));if(_0x4785fb[_0xbb10('0x41')][_0xbb10('0x4c')]){_0x473cee[_0xbb10('0x4b')]=_[_0xbb10('0x4d')](_0x473cee[_0xbb10('0x4b')],{'$or':_[_0xbb10('0x4e')](_0x473cee[_0xbb10('0x44')],function(_0x405428){var _0x14d9e7={};_0x14d9e7[_0x405428]={'$like':'%'+_0x4785fb[_0xbb10('0x41')][_0xbb10('0x4c')]+'%'};return _0x14d9e7;})});}_0x473cee=_['merge']({},_0x473cee,_0x4785fb[_0xbb10('0x53')]);return _0x2c5dd1[_0xbb10('0x10d')](_0x473cee);}})[_0xbb10('0x21')](function(_0x3a6298){if(_0x3a6298){_0x5df18b=_0x3a6298[_0xbb10('0x46')];if(!_0x4785fb['query'][_0xbb10('0x47')]('nolimit')){_0x473cee['limit']=qs[_0xbb10('0x30')](_0x4785fb[_0xbb10('0x41')]['limit']);_0x473cee[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4785fb[_0xbb10('0x41')][_0xbb10('0x2f')]);}return _0x2c5dd1[_0xbb10('0x10d')](_0x473cee);}})['then'](function(_0x486a2f){if(_0x486a2f){return _0x486a2f?{'count':_0x5df18b,'rows':_0x486a2f}:null;}})[_0xbb10('0x21')](respondWithResult(_0x366ded,null))[_0xbb10('0x2b')](handleError(_0x366ded,null));};exports['addProactiveActions']=function(_0x108f23,_0x4cf976,_0x5a83de){return db[_0xbb10('0x10e')][_0xbb10('0x5a')]({'where':{'id':_0x108f23[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x4cf976,null))[_0xbb10('0x21')](function(_0x23bea4){if(_0x23bea4){return _0x23bea4['addProactiveActions'](_0x108f23[_0xbb10('0x5c')][_0xbb10('0x6e')],_[_0xbb10('0xe4')](_0x108f23[_0xbb10('0x5c')],['ids','id'])||{});}})[_0xbb10('0x21')](respondWithResult(_0x4cf976,null))[_0xbb10('0x2b')](handleError(_0x4cf976,null));};exports['getProactiveActions']=function(_0x49ef50,_0xeac82d,_0x5a4de3){var _0x40ff8e={};var _0x30ffca={};var _0x214dcb;var _0x3e19f4;return db['ChatWebsite'][_0xbb10('0x71')]({'where':{'id':_0x49ef50['params']['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0xeac82d,null))[_0xbb10('0x21')](function(_0x1d926f){if(_0x1d926f){_0x214dcb=_0x1d926f;_0x30ffca[_0xbb10('0x3f')]=_[_0xbb10('0x40')](db[_0xbb10('0x10f')][_0xbb10('0x59')]);_0x30ffca[_0xbb10('0x41')]=_[_0xbb10('0x40')](_0x49ef50['query']);_0x30ffca[_0xbb10('0x42')]=_[_0xbb10('0x43')](_0x30ffca[_0xbb10('0x3f')],_0x30ffca[_0xbb10('0x41')]);_0x40ff8e[_0xbb10('0x44')]=_['intersection'](_0x30ffca[_0xbb10('0x3f')],qs[_0xbb10('0x45')](_0x49ef50[_0xbb10('0x41')][_0xbb10('0x45')]));_0x40ff8e[_0xbb10('0x44')]=_0x40ff8e['attributes']['length']?_0x40ff8e['attributes']:_0x30ffca[_0xbb10('0x3f')];_0x40ff8e['order']=qs['sort'](_0x49ef50[_0xbb10('0x41')]['sort']);_0x40ff8e[_0xbb10('0x4b')]=qs[_0xbb10('0x42')](_['pick'](_0x49ef50[_0xbb10('0x41')],_0x30ffca[_0xbb10('0x42')]));if(_0x49ef50[_0xbb10('0x41')][_0xbb10('0x4c')]){_0x40ff8e['where']=_['merge'](_0x40ff8e['where'],{'$or':_[_0xbb10('0x4e')](_0x40ff8e[_0xbb10('0x44')],function(_0x551d64){var _0x31c019={};_0x31c019[_0x551d64]={'$like':'%'+_0x49ef50[_0xbb10('0x41')][_0xbb10('0x4c')]+'%'};return _0x31c019;})});}_0x40ff8e=_[_0xbb10('0x4d')]({},_0x40ff8e,_0x49ef50[_0xbb10('0x53')]);return _0x214dcb['getProactiveActions'](_0x40ff8e);}})[_0xbb10('0x21')](function(_0x7e9e52){if(_0x7e9e52){_0x3e19f4=_0x7e9e52[_0xbb10('0x46')];if(!_0x49ef50['query'][_0xbb10('0x47')]('nolimit')){_0x40ff8e[_0xbb10('0x30')]=qs[_0xbb10('0x30')](_0x49ef50[_0xbb10('0x41')]['limit']);_0x40ff8e[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x49ef50['query'][_0xbb10('0x2f')]);}return _0x214dcb[_0xbb10('0xf9')](_0x40ff8e);}})[_0xbb10('0x21')](function(_0x2e03eb){if(_0x2e03eb){return _0x2e03eb?{'count':_0x3e19f4,'rows':_0x2e03eb}:null;}})[_0xbb10('0x21')](respondWithResult(_0xeac82d,null))['catch'](handleError(_0xeac82d,null));};exports['getFields']=function(_0x1ef039,_0x3fe59b,_0x22dd3d){var _0x1b0734=_0x1ef039[_0xbb10('0x41')]['online']===_0xbb10('0x110')?_0xbb10('0x111'):_0xbb10('0x112');return db[_0xbb10('0x3e')][_0xbb10('0x5a')]({'attributes':['id',_0x1b0734],'where':{'id':_0x1ef039['params']['id']}})['then'](handleEntityNotFound(_0x3fe59b,null))[_0xbb10('0x21')](function(_0x18f6b1){if(_0x18f6b1){var _0x1052f5=_0x18f6b1[_0x1b0734];var _0x119e8f=_0x1052f5&&_0x1052f5['items']?_0x1052f5['items']:[];_0x3fe59b[_0xbb10('0x3c')]({'fromKey':_['isNil'](_0x1052f5['fromKey'])?undefined:_0x1052f5['fromKey'],'count':_0x119e8f['length'],'rows':_0x119e8f});}})[_0xbb10('0x2b')](handleError(_0x3fe59b,null));};exports[_0xbb10('0x113')]=function(_0x8dfa5e,_0x1f0938,_0x11e17e){var _0x520856={'raw':!![],'where':{}};var _0x12829c={};var _0x10c2cb={'count':0x0,'rows':[]};return db[_0xbb10('0x3e')]['findOne']({'where':{'id':_0x8dfa5e[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x1f0938,null))[_0xbb10('0x21')](function(_0x45c642){if(_0x45c642){_0x12829c[_0xbb10('0x3f')]=_[_0xbb10('0x40')](db[_0xbb10('0xd6')][_0xbb10('0x59')]);_0x12829c[_0xbb10('0x41')]=_[_0xbb10('0x40')](_0x8dfa5e[_0xbb10('0x41')]);_0x12829c[_0xbb10('0x42')]=_[_0xbb10('0x43')](_0x12829c[_0xbb10('0x3f')],_0x12829c[_0xbb10('0x41')]);_0x520856['attributes']=_['intersection'](_0x12829c['model'],qs[_0xbb10('0x45')](_0x8dfa5e['query'][_0xbb10('0x45')]));_0x520856['attributes']=_0x520856[_0xbb10('0x44')]['length']?_0x520856['attributes']:_0x12829c[_0xbb10('0x3f')];if(!_0x8dfa5e[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x520856[_0xbb10('0x30')]=qs[_0xbb10('0x30')](_0x8dfa5e[_0xbb10('0x41')]['limit']);_0x520856['offset']=qs[_0xbb10('0x2f')](_0x8dfa5e[_0xbb10('0x41')][_0xbb10('0x2f')]);}_0x520856[_0xbb10('0x49')]=qs[_0xbb10('0x4a')](_0x8dfa5e[_0xbb10('0x41')][_0xbb10('0x4a')]);_0x520856['where']=qs[_0xbb10('0x42')](_['pick'](_0x8dfa5e['query'],_0x12829c[_0xbb10('0x42')]));_0x520856['where'][_0xbb10('0x68')]=_0x45c642['id'];if(_0x8dfa5e[_0xbb10('0x41')][_0xbb10('0x4c')]){_0x520856[_0xbb10('0x4b')]=_[_0xbb10('0x4d')](_0x520856['where'],{'$or':_[_0xbb10('0x4e')](_0x520856[_0xbb10('0x44')],function(_0xf6f7ed){var _0x2701e8={};_0x2701e8[_0xf6f7ed]={'$like':'%'+_0x8dfa5e[_0xbb10('0x41')][_0xbb10('0x4c')]+'%'};return _0x2701e8;})});}_0x520856=_['merge']({},_0x520856,_0x8dfa5e['options']);return db[_0xbb10('0xd6')][_0xbb10('0x54')]({'where':_0x520856[_0xbb10('0x4b')]})[_0xbb10('0x21')](function(_0x38a9dc){_0x10c2cb['count']=_0x38a9dc;if(_0x8dfa5e['query'][_0xbb10('0x55')]){_0x520856[_0xbb10('0x56')]=[{'all':!![]}];}return db['ChatOfflineMessage']['findAll'](_0x520856);})[_0xbb10('0x21')](function(_0xed53e6){_0x10c2cb[_0xbb10('0x57')]=_0xed53e6;return _0x10c2cb;});}})[_0xbb10('0x21')](respondWithFilteredResult(_0x1f0938,_0x520856))[_0xbb10('0x2b')](handleError(_0x1f0938,null));};exports[_0xbb10('0x114')]=function(_0x5ca40a,_0x23fa34,_0x205784){return db[_0xbb10('0x3e')][_0xbb10('0x5a')]({'where':{'id':_0x5ca40a[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x23fa34,null))[_0xbb10('0x21')](function(_0x22e865){if(_0x22e865){return _0x22e865[_0xbb10('0x114')](_0x5ca40a['body']['ids'],_['omit'](_0x5ca40a[_0xbb10('0x5c')],[_0xbb10('0x6e'),'id'])||{})[_0xbb10('0xb8')](function(_0x270853){for(var _0x55265e=0x0;_0x55265e<_0x5ca40a['body']['ids'][_0xbb10('0x46')];_0x55265e+=0x1){socket[_0xbb10('0x115')](_0xbb10('0x116'),{'UserId':_0x5ca40a[_0xbb10('0x5c')][_0xbb10('0x6e')][_0x55265e],'ChatWebsiteId':_0x5ca40a[_0xbb10('0x64')]['id']});}return _0x270853;});}})[_0xbb10('0x21')](respondWithResult(_0x23fa34,null))[_0xbb10('0x2b')](handleError(_0x23fa34,null));};exports[_0xbb10('0x117')]=function(_0xb3139c,_0x332ea6,_0x1d227f){var _0x3e148f;return db[_0xbb10('0x3e')]['find']({'where':{'id':_0xb3139c[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x332ea6,null))[_0xbb10('0x21')](function(_0x2cf657){if(_0x2cf657){return _0x2cf657[_0xbb10('0x117')](_0xb3139c[_0xbb10('0x41')]['ids'])[_0xbb10('0x21')](function(_0x9d612b){if(_[_0xbb10('0x118')](_0xb3139c[_0xbb10('0x41')][_0xbb10('0x6e')])){for(var _0x425743=0x0;_0x425743<_0xb3139c[_0xbb10('0x41')][_0xbb10('0x6e')][_0xbb10('0x46')];_0x425743+=0x1){socket['emit'](_0xbb10('0x119'),{'UserId':_0xb3139c[_0xbb10('0x41')][_0xbb10('0x6e')][_0x425743],'ChatWebsiteId':_0xb3139c[_0xbb10('0x64')]['id']});}}else{socket[_0xbb10('0x115')](_0xbb10('0x119'),{'UserId':_0xb3139c[_0xbb10('0x41')][_0xbb10('0x6e')],'ChatWebsiteId':_0xb3139c[_0xbb10('0x64')]['id']});}});}})['then'](respondWithStatusCode(_0x332ea6,null))[_0xbb10('0x2b')](handleError(_0x332ea6,null));};exports['getAgents']=function(_0x15c71d,_0x2cd1b0,_0x57e0b2){var _0x57b52d={};var _0x366f28={};var _0x1157fb;var _0x2b355f;return db[_0xbb10('0x3e')][_0xbb10('0x71')]({'where':{'id':_0x15c71d[_0xbb10('0x64')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x2cd1b0,null))[_0xbb10('0x21')](function(_0x3108fc){if(_0x3108fc){_0x1157fb=_0x3108fc;_0x366f28[_0xbb10('0x3f')]=_[_0xbb10('0x40')](db[_0xbb10('0xc3')][_0xbb10('0x59')]);_0x366f28[_0xbb10('0x41')]=_[_0xbb10('0x40')](_0x15c71d['query']);_0x366f28[_0xbb10('0x42')]=_['intersection'](_0x366f28[_0xbb10('0x3f')],_0x366f28[_0xbb10('0x41')]);_0x57b52d[_0xbb10('0x44')]=_[_0xbb10('0x43')](_0x366f28[_0xbb10('0x3f')],qs[_0xbb10('0x45')](_0x15c71d[_0xbb10('0x41')][_0xbb10('0x45')]));_0x57b52d[_0xbb10('0x44')]=_0x57b52d['attributes']['length']?_0x57b52d[_0xbb10('0x44')]:_0x366f28[_0xbb10('0x3f')];_0x57b52d[_0xbb10('0x49')]=qs['sort'](_0x15c71d[_0xbb10('0x41')]['sort']);_0x57b52d[_0xbb10('0x4b')]=qs[_0xbb10('0x42')](_['pick'](_0x15c71d[_0xbb10('0x41')],_0x366f28[_0xbb10('0x42')]));if(_0x15c71d[_0xbb10('0x41')][_0xbb10('0x4c')]){_0x57b52d[_0xbb10('0x4b')]=_['merge'](_0x57b52d[_0xbb10('0x4b')],{'$or':_[_0xbb10('0x4e')](_0x57b52d['attributes'],function(_0x358e1c){var _0x1b0a9b={};_0x1b0a9b[_0x358e1c]={'$like':'%'+_0x15c71d['query'][_0xbb10('0x4c')]+'%'};return _0x1b0a9b;})});}_0x57b52d=_[_0xbb10('0x4d')]({},_0x57b52d,_0x15c71d[_0xbb10('0x53')]);return _0x1157fb[_0xbb10('0x11a')](_0x57b52d);}})['then'](function(_0xa0f8c3){if(_0xa0f8c3){_0x2b355f=_0xa0f8c3[_0xbb10('0x46')];if(!_0x15c71d[_0xbb10('0x41')]['hasOwnProperty']('nolimit')){_0x57b52d[_0xbb10('0x30')]=qs[_0xbb10('0x30')](_0x15c71d[_0xbb10('0x41')][_0xbb10('0x30')]);_0x57b52d['offset']=qs[_0xbb10('0x2f')](_0x15c71d[_0xbb10('0x41')][_0xbb10('0x2f')]);}return _0x1157fb[_0xbb10('0x11a')](_0x57b52d);}})[_0xbb10('0x21')](function(_0x5cfad3){if(_0x5cfad3){return _0x5cfad3?{'count':_0x2b355f,'rows':_0x5cfad3}:null;}})['then'](respondWithResult(_0x2cd1b0,null))[_0xbb10('0x2b')](handleError(_0x2cd1b0,null));}; \ No newline at end of file +var _0xe706=['custom','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','ChatApplication','List','applications','Applications','list','orderBy','priority','asc','account','contact','firstName','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','getLicense','License','chatLicenseExceeded','Intervals','push','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','http','client','request','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','then','get','ChatWebsites','end','stack','name','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','show','params','Pause','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','../../config/license/util'];(function(_0x2e3712,_0x1d0369){var _0x301251=function(_0x31249d){while(--_0x31249d){_0x2e3712['push'](_0x2e3712['shift']());}};_0x301251(++_0x1d0369);}(_0xe706,0xa3));var _0x6e70=function(_0x834bb6,_0x1c5e35){_0x834bb6=_0x834bb6-0x0;var _0xa35d00=_0xe706[_0x834bb6];return _0xa35d00;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var authService=require(_0x6e70('0x14'));var hardwareService=require(_0x6e70('0x15'));var Redis=require(_0x6e70('0x16'));var qs=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];config[_0x6e70('0x1b')]=_[_0x6e70('0x1c')](config[_0x6e70('0x1b')],{'host':_0x6e70('0x1d'),'port':0x18eb});var socket=require(_0x6e70('0x1e'))(new Redis(config[_0x6e70('0x1b')]));require(_0x6e70('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6e70('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x6e70('0x21')][_0x6e70('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x5d9263,_0x24f3ac,_0x5c3fe7,_0x2efc0f){return new BPromise(function(_0x161f23,_0x4ca554){var _0x49029f=_0x2efc0f||client;return _0x49029f[_0x6e70('0x22')](_0x5d9263,_0x5c3fe7)['then'](function(_0x28a21f){logger[_0x6e70('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x24f3ac,'request\x20sent');logger[_0x6e70('0x24')](_0x6e70('0x25'),_0x24f3ac,_0x6e70('0x26'),JSON[_0x6e70('0x27')](_0x28a21f));if(_0x28a21f[_0x6e70('0x28')]){if(_0x28a21f[_0x6e70('0x28')][_0x6e70('0x29')]===0x1f4){logger[_0x6e70('0x28')](_0x6e70('0x2a'),_0x24f3ac,_0x28a21f[_0x6e70('0x28')]['message']);return _0x4ca554(_0x28a21f[_0x6e70('0x28')][_0x6e70('0x2b')]);}logger[_0x6e70('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x24f3ac,_0x28a21f[_0x6e70('0x28')][_0x6e70('0x2b')]);return _0x161f23(_0x28a21f[_0x6e70('0x28')]['message']);}else{logger[_0x6e70('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x24f3ac,'request\x20sent');_0x161f23(_0x28a21f['result'][_0x6e70('0x2b')]);}})[_0x6e70('0x2c')](function(_0x51d292){logger[_0x6e70('0x28')](_0x6e70('0x2a'),_0x24f3ac,_0x51d292);_0x4ca554(_0x51d292);});});}function respondWithStatusCode(_0x5f268f,_0x338ad6){_0x338ad6=_0x338ad6||0xcc;return function(_0x67fb43){if(_0x67fb43){return _0x5f268f[_0x6e70('0x2d')](_0x338ad6);}return _0x5f268f['status'](_0x338ad6)['end']();};}function respondWithResult(_0x2c4d37,_0x3af17f){_0x3af17f=_0x3af17f||0xc8;return function(_0x83c836){if(_0x83c836){return _0x2c4d37[_0x6e70('0x2e')](_0x3af17f)[_0x6e70('0x2f')](_0x83c836);}};}function respondWithFilteredResult(_0x5d772a,_0x1952ea){return function(_0x406f29){if(_0x406f29){var _0xecf336=_0x406f29[_0x6e70('0x30')],_0x2864a0=_0x1952ea[_0x6e70('0x31')],_0x396a67=_0x1952ea[_0x6e70('0x31')]+_0x1952ea[_0x6e70('0x32')],_0x20a225;if(_0x396a67>=_0xecf336){_0x396a67=_0xecf336;_0x20a225=0xc8;}else{_0x20a225=0xce;}_0x5d772a['status'](_0x20a225);return _0x5d772a[_0x6e70('0x33')]('Content-Range',_0x2864a0+'-'+_0x396a67+'/'+_0xecf336)[_0x6e70('0x2f')](_0x406f29);}return null;};}function patchUpdates(_0x5a7a2a){return function(_0xdd7cc1){try{jsonpatch[_0x6e70('0x34')](_0xdd7cc1,_0x5a7a2a,!![]);}catch(_0x30fa0b){return BPromise['reject'](_0x30fa0b);}return _0xdd7cc1[_0x6e70('0x35')]();};}function saveUpdates(_0x42b094,_0x5780a1){return function(_0x13d673){if(_0x13d673){return _0x13d673[_0x6e70('0x36')](_0x42b094)['then'](function(_0x10d8f6){return _0x10d8f6;});}return null;};}function removeEntity(_0x3665a1,_0x2d52bd){return function(_0x2723d7){if(_0x2723d7){return _0x2723d7[_0x6e70('0x37')]()[_0x6e70('0x38')](function(){var _0x44b19d=_0x2723d7[_0x6e70('0x39')]({'plain':!![]});var _0xf146fd=_0x6e70('0x3a');return db['UserProfileResource'][_0x6e70('0x37')]({'where':{'type':_0xf146fd,'resourceId':_0x44b19d['id']}})['then'](function(){return _0x2723d7;});})[_0x6e70('0x38')](function(){_0x3665a1[_0x6e70('0x2e')](0xcc)[_0x6e70('0x3b')]();});}};}function handleEntityNotFound(_0x32d12d,_0x233a83){return function(_0x989b80){if(!_0x989b80){_0x32d12d[_0x6e70('0x2d')](0x194);}return _0x989b80;};}function handleError(_0xdd0bee,_0x80bebb){_0x80bebb=_0x80bebb||0x1f4;return function(_0x198dd1){logger[_0x6e70('0x28')](_0x198dd1[_0x6e70('0x3c')]);if(_0x198dd1[_0x6e70('0x3d')]){delete _0x198dd1['name'];}_0xdd0bee['status'](_0x80bebb)['send'](_0x198dd1);};}exports[_0x6e70('0x3e')]=function(_0x3841a0,_0x2cb5b0){var _0x1f6955={'include':[{'model':db['Pause'],'as':_0x6e70('0x3f')}]},_0x1872e9={},_0x3bdd87={'count':0x0,'rows':[]};var _0x9e7ad2=db[_0x6e70('0x40')][_0x6e70('0x41')];_0x1872e9[_0x6e70('0x42')]=_[_0x6e70('0x43')](_0x9e7ad2);_0x1872e9[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x3841a0['query']);_0x1872e9[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x1872e9[_0x6e70('0x42')],_0x1872e9[_0x6e70('0x44')]);_0x1f6955[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x1872e9[_0x6e70('0x42')],qs['fields'](_0x3841a0['query']['fields']));_0x1f6955[_0x6e70('0x47')]=_0x1f6955[_0x6e70('0x47')][_0x6e70('0x48')]?_0x1f6955[_0x6e70('0x47')]:_0x1872e9[_0x6e70('0x42')];if(!_0x3841a0['query'][_0x6e70('0x49')](_0x6e70('0x4a'))){_0x1f6955[_0x6e70('0x32')]=qs['limit'](_0x3841a0['query']['limit']);_0x1f6955[_0x6e70('0x31')]=qs['offset'](_0x3841a0[_0x6e70('0x44')][_0x6e70('0x31')]);}_0x1f6955[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x3841a0['query'][_0x6e70('0x4c')]);_0x1f6955['where']=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x3841a0[_0x6e70('0x44')],_0x1872e9[_0x6e70('0x45')]));if(_0x3841a0['query'][_0x6e70('0x4e')]){_0x1f6955[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x1f6955[_0x6e70('0x4f')],{'$or':_[_0x6e70('0x51')](_0x9e7ad2,function(_0x3fcb2d){if(_0x3fcb2d[_0x6e70('0x52')]['key']!==_0x6e70('0x53')){var _0x3884a4={};_0x3884a4[_0x3fcb2d[_0x6e70('0x54')]]={'$like':'%'+_0x3841a0[_0x6e70('0x44')][_0x6e70('0x4e')]+'%'};return _0x3884a4;}})});}_0x1f6955=_[_0x6e70('0x50')]({},_0x1f6955,_0x3841a0[_0x6e70('0x55')]);var _0x4ab26e={'where':_0x1f6955[_0x6e70('0x4f')]};return db['ChatWebsite'][_0x6e70('0x30')](_0x4ab26e)[_0x6e70('0x38')](function(_0x4b351e){_0x3bdd87['count']=_0x4b351e;if(_0x3841a0[_0x6e70('0x44')][_0x6e70('0x56')]){_0x1f6955[_0x6e70('0x57')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1f6955);})[_0x6e70('0x38')](function(_0x11ac3d){_0x3bdd87[_0x6e70('0x58')]=_0x11ac3d;return _0x3bdd87;})[_0x6e70('0x38')](respondWithFilteredResult(_0x2cb5b0,_0x1f6955))[_0x6e70('0x2c')](handleError(_0x2cb5b0,null));};exports[_0x6e70('0x59')]=function(_0x4ad5a9,_0x756a5b){var _0x3aa1a6={'raw':![],'where':{'id':_0x4ad5a9[_0x6e70('0x5a')]['id']},'include':[{'model':db[_0x6e70('0x5b')],'as':'mandatoryDispositionPause'}]},_0x219f4={};_0x219f4['model']=_[_0x6e70('0x43')](db[_0x6e70('0x40')][_0x6e70('0x41')]);_0x219f4[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x4ad5a9['query']);_0x219f4[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x219f4[_0x6e70('0x42')],_0x219f4[_0x6e70('0x44')]);_0x3aa1a6[_0x6e70('0x47')]=_['intersection'](_0x219f4[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x4ad5a9[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x3aa1a6[_0x6e70('0x47')]=_0x3aa1a6[_0x6e70('0x47')]['length']?_0x3aa1a6[_0x6e70('0x47')]:_0x219f4[_0x6e70('0x42')];if(_0x4ad5a9['query'][_0x6e70('0x56')]){_0x3aa1a6[_0x6e70('0x57')]=[{'all':!![]}];}_0x3aa1a6=_['merge']({},_0x3aa1a6,_0x4ad5a9[_0x6e70('0x55')]);return db[_0x6e70('0x40')][_0x6e70('0x5d')](_0x3aa1a6)[_0x6e70('0x38')](handleEntityNotFound(_0x756a5b,null))[_0x6e70('0x38')](respondWithResult(_0x756a5b,null))['catch'](handleError(_0x756a5b,null));};exports[_0x6e70('0x5e')]=function(_0x2d1336,_0x10d655){return db[_0x6e70('0x40')][_0x6e70('0x5e')](_0x2d1336[_0x6e70('0x5f')],{})[_0x6e70('0x38')](function(_0x2e2587){var _0x6043cd=_0x2d1336[_0x6e70('0x60')][_0x6e70('0x39')]({'plain':!![]});if(!_0x6043cd)throw new Error(_0x6e70('0x61'));if(_0x6043cd[_0x6e70('0x62')]===_0x6e70('0x60')){var _0x2a9173=_0x2e2587[_0x6e70('0x39')]({'plain':!![]});var _0x324fa6=_0x6e70('0x3a');return db[_0x6e70('0x63')][_0x6e70('0x5d')]({'where':{'name':_0x324fa6,'userProfileId':_0x6043cd['userProfileId']},'raw':!![]})[_0x6e70('0x38')](function(_0x4434dd){if(_0x4434dd&&_0x4434dd[_0x6e70('0x64')]===0x0){return db[_0x6e70('0x65')][_0x6e70('0x5e')]({'name':_0x2a9173[_0x6e70('0x3d')],'resourceId':_0x2a9173['id'],'type':_0x4434dd['name'],'sectionId':_0x4434dd['id']},{})[_0x6e70('0x38')](function(){return _0x2e2587;});}else{return _0x2e2587;}})[_0x6e70('0x2c')](function(_0x4f813a){logger[_0x6e70('0x28')](_0x6e70('0x66'),_0x4f813a);throw _0x4f813a;});}return _0x2e2587;})[_0x6e70('0x38')](respondWithResult(_0x10d655,0xc9))['catch'](handleError(_0x10d655,null));};exports['update']=function(_0x2f9be4,_0xd6bccd){if(_0x2f9be4[_0x6e70('0x5f')]['id']){delete _0x2f9be4[_0x6e70('0x5f')]['id'];}return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x2f9be4[_0x6e70('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x6e70('0x38')](handleEntityNotFound(_0xd6bccd,null))[_0x6e70('0x38')](saveUpdates(_0x2f9be4[_0x6e70('0x5f')],null))[_0x6e70('0x38')](respondWithResult(_0xd6bccd,null))['catch'](handleError(_0xd6bccd,null));};exports['destroy']=function(_0x2e972b,_0x4e5545){return db['ChatWebsite']['find']({'where':{'id':_0x2e972b[_0x6e70('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4e5545,null))[_0x6e70('0x38')](removeEntity(_0x4e5545,null))[_0x6e70('0x2c')](handleError(_0x4e5545,null));};exports[_0x6e70('0x67')]=function(_0x2f3626,_0x64ea5b){return db[_0x6e70('0x40')][_0x6e70('0x67')]()[_0x6e70('0x38')](respondWithResult(_0x64ea5b,null))['catch'](handleError(_0x64ea5b,null));};exports[_0x6e70('0x68')]=function(_0x6a560f,_0x22c836,_0x346c79){if(_0x6a560f[_0x6e70('0x5f')]['id']){delete _0x6a560f['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x6a560f[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x22c836,null))[_0x6e70('0x38')](function(_0x4ed5ad){if(_0x4ed5ad){_0x6a560f['body'][_0x6e70('0x69')]=_0x4ed5ad['id'];return db[_0x6e70('0x6a')][_0x6e70('0x5e')](_0x6a560f[_0x6e70('0x5f')]);}})[_0x6e70('0x38')](respondWithResult(_0x22c836,null))[_0x6e70('0x2c')](handleError(_0x22c836,null));};exports['getDispositions']=function(_0x2d2855,_0x3f5896,_0x30d11b){var _0x82a9a={'raw':![],'where':{}};var _0x515c0c={};var _0xce964b={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2d2855[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x3f5896,null))[_0x6e70('0x38')](function(_0xe24ad5){if(_0xe24ad5){_0x515c0c[_0x6e70('0x42')]=_[_0x6e70('0x43')](db['Disposition'][_0x6e70('0x41')]);_0x515c0c[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x2d2855[_0x6e70('0x44')]);_0x515c0c[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x515c0c[_0x6e70('0x42')],_0x515c0c[_0x6e70('0x44')]);_0x82a9a[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x515c0c['model'],qs[_0x6e70('0x5c')](_0x2d2855[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x82a9a['attributes']=_0x82a9a['attributes'][_0x6e70('0x48')]?_0x82a9a[_0x6e70('0x47')]:_0x515c0c[_0x6e70('0x42')];if(!_0x2d2855[_0x6e70('0x44')][_0x6e70('0x49')]('nolimit')){_0x82a9a['limit']=qs[_0x6e70('0x32')](_0x2d2855[_0x6e70('0x44')]['limit']);_0x82a9a[_0x6e70('0x31')]=qs[_0x6e70('0x31')](_0x2d2855[_0x6e70('0x44')][_0x6e70('0x31')]);}_0x82a9a[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x2d2855[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x82a9a[_0x6e70('0x4f')]=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x2d2855[_0x6e70('0x44')],_0x515c0c[_0x6e70('0x45')]));_0x82a9a[_0x6e70('0x4f')]['ChatWebsiteId']=_0xe24ad5['id'];if(_0x2d2855['query'][_0x6e70('0x4e')]){_0x82a9a['where']=_[_0x6e70('0x50')](_0x82a9a['where'],{'$or':_['map'](_0x82a9a[_0x6e70('0x47')],function(_0x48e04b){var _0x576069={};_0x576069[_0x48e04b]={'$like':'%'+_0x2d2855[_0x6e70('0x44')][_0x6e70('0x4e')]+'%'};return _0x576069;})});}_0x82a9a=_[_0x6e70('0x50')]({},_0x82a9a,_0x2d2855['options']);return db['Disposition']['count']({'where':_0x82a9a[_0x6e70('0x4f')]})['then'](function(_0x2e8ed3){_0xce964b[_0x6e70('0x30')]=_0x2e8ed3;if(_0x2d2855[_0x6e70('0x44')][_0x6e70('0x56')]){_0x82a9a[_0x6e70('0x57')]=[{'all':!![]}];}return db[_0x6e70('0x6a')][_0x6e70('0x6b')](_0x82a9a);})['then'](function(_0x282b02){_0xce964b[_0x6e70('0x58')]=_0x282b02;return _0xce964b;});}})[_0x6e70('0x38')](respondWithFilteredResult(_0x3f5896,_0x82a9a))['catch'](handleError(_0x3f5896,null));};exports[_0x6e70('0x6c')]=function(_0x227d94,_0x11a615,_0x267576){var _0x451960;return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x227d94[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x11a615,null))['then'](function(_0x463eed){if(_0x463eed){return _0x463eed[_0x6e70('0x6c')](_0x227d94['query'][_0x6e70('0x6d')]);}})[_0x6e70('0x38')](respondWithStatusCode(_0x11a615,null))['catch'](handleError(_0x11a615,null));};exports['addAnswer']=function(_0x4059cf,_0x502e6c,_0x154c8a){if(_0x4059cf['body']['id']){delete _0x4059cf[_0x6e70('0x5f')]['id'];}return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x4059cf[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x502e6c,null))[_0x6e70('0x38')](function(_0x3f985f){if(_0x3f985f){_0x4059cf['body']['ChatWebsiteId']=_0x3f985f['id'];return db[_0x6e70('0x6e')]['create'](_0x4059cf[_0x6e70('0x5f')]);}})[_0x6e70('0x38')](respondWithResult(_0x502e6c,null))[_0x6e70('0x2c')](handleError(_0x502e6c,null));};exports[_0x6e70('0x6f')]=function(_0x4b201f,_0x21fb9a,_0x5c30ce){var _0x260dfa={'raw':![],'where':{}};var _0x18a1be={};var _0x21cd21={'count':0x0,'rows':[]};return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x4b201f[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x21fb9a,null))['then'](function(_0x1d6acf){if(_0x1d6acf){_0x18a1be['model']=_[_0x6e70('0x43')](db['CannedAnswer']['rawAttributes']);_0x18a1be['query']=_[_0x6e70('0x43')](_0x4b201f[_0x6e70('0x44')]);_0x18a1be[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x18a1be[_0x6e70('0x42')],_0x18a1be['query']);_0x260dfa[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x18a1be['model'],qs[_0x6e70('0x5c')](_0x4b201f['query'][_0x6e70('0x5c')]));_0x260dfa['attributes']=_0x260dfa['attributes'][_0x6e70('0x48')]?_0x260dfa[_0x6e70('0x47')]:_0x18a1be[_0x6e70('0x42')];if(!_0x4b201f[_0x6e70('0x44')][_0x6e70('0x49')](_0x6e70('0x4a'))){_0x260dfa[_0x6e70('0x32')]=qs['limit'](_0x4b201f[_0x6e70('0x44')]['limit']);_0x260dfa[_0x6e70('0x31')]=qs[_0x6e70('0x31')](_0x4b201f[_0x6e70('0x44')][_0x6e70('0x31')]);}_0x260dfa[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x4b201f[_0x6e70('0x44')]['sort']);_0x260dfa[_0x6e70('0x4f')]=qs['filters'](_[_0x6e70('0x4d')](_0x4b201f[_0x6e70('0x44')],_0x18a1be[_0x6e70('0x45')]));_0x260dfa[_0x6e70('0x4f')][_0x6e70('0x69')]=_0x1d6acf['id'];if(_0x4b201f[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x260dfa[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x260dfa[_0x6e70('0x4f')],{'$or':_['map'](_0x260dfa[_0x6e70('0x47')],function(_0x411d8f){var _0x31559b={};_0x31559b[_0x411d8f]={'$like':'%'+_0x4b201f[_0x6e70('0x44')][_0x6e70('0x4e')]+'%'};return _0x31559b;})});}_0x260dfa=_['merge']({},_0x260dfa,_0x4b201f['options']);return db['CannedAnswer'][_0x6e70('0x30')]({'where':_0x260dfa[_0x6e70('0x4f')]})[_0x6e70('0x38')](function(_0x30c5bd){_0x21cd21[_0x6e70('0x30')]=_0x30c5bd;if(_0x4b201f[_0x6e70('0x44')][_0x6e70('0x56')]){_0x260dfa[_0x6e70('0x57')]=[{'all':!![]}];}return db[_0x6e70('0x6e')][_0x6e70('0x6b')](_0x260dfa);})[_0x6e70('0x38')](function(_0x400b20){_0x21cd21[_0x6e70('0x58')]=_0x400b20;return _0x21cd21;});}})[_0x6e70('0x38')](respondWithFilteredResult(_0x21fb9a,_0x260dfa))[_0x6e70('0x2c')](handleError(_0x21fb9a,null));};exports['removeAnswers']=function(_0x3a038a,_0x223610,_0x6fd098){var _0x156c3c;return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x3a038a['params']['id']}})['then'](handleEntityNotFound(_0x223610,null))[_0x6e70('0x38')](function(_0x433c79){if(_0x433c79){return _0x433c79[_0x6e70('0x71')](_0x3a038a[_0x6e70('0x44')][_0x6e70('0x6d')]);}})[_0x6e70('0x38')](respondWithStatusCode(_0x223610,null))[_0x6e70('0x2c')](handleError(_0x223610,null));};exports['addLogo']=function(_0x245123,_0x511830,_0x3296d2){_0x245123[_0x6e70('0x5f')][_0x6e70('0x72')]=_0x245123[_0x6e70('0x73')]['filename'];return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x245123['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x511830,null))['then'](saveUpdates(_0x245123[_0x6e70('0x5f')],null))['then'](respondWithResult(_0x511830,null))['catch'](handleError(_0x511830,null));};exports[_0x6e70('0x74')]=function(_0x455f49,_0x3cd4cc,_0x47edfe){_0x455f49[_0x6e70('0x5f')][_0x6e70('0x75')]=_0x455f49['file'][_0x6e70('0x76')];return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x455f49[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x3cd4cc,null))[_0x6e70('0x38')](saveUpdates(_0x455f49[_0x6e70('0x5f')],null))[_0x6e70('0x38')](respondWithResult(_0x3cd4cc,null))[_0x6e70('0x2c')](handleError(_0x3cd4cc,null));};exports['addCustomerAvatar']=function(_0x4e7a56,_0xb5e3be,_0x564d55){_0x4e7a56[_0x6e70('0x5f')][_0x6e70('0x77')]=_0x4e7a56['file'][_0x6e70('0x76')];return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x4e7a56['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0xb5e3be,null))[_0x6e70('0x38')](saveUpdates(_0x4e7a56[_0x6e70('0x5f')],null))[_0x6e70('0x38')](respondWithResult(_0xb5e3be,null))[_0x6e70('0x2c')](handleError(_0xb5e3be,null));};exports[_0x6e70('0x78')]=function(_0xb80704,_0xffa524,_0xd5b1c6){_0xb80704[_0x6e70('0x5f')][_0x6e70('0x79')]=_0xb80704[_0x6e70('0x73')][_0x6e70('0x76')];return db['ChatWebsite'][_0x6e70('0x5d')]({'where':{'id':_0xb80704[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0xffa524,null))[_0x6e70('0x38')](saveUpdates(_0xb80704[_0x6e70('0x5f')],null))['then'](respondWithResult(_0xffa524,null))[_0x6e70('0x2c')](handleError(_0xffa524,null));};exports[_0x6e70('0x7a')]=function(_0x2a5aed,_0x5e5b1f,_0x40a47f){var _0x5f12d3=path['join'](config[_0x6e70('0x7b')],_0x6e70('0x7c'));var _0x324353={'where':{'id':_0x2a5aed[_0x6e70('0x5a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x39e14f=![];return require(_0x6e70('0x7d'))['getLicense']()['then'](function(_0x48571f){if(_0x48571f){_0x39e14f=_0x48571f[_0x6e70('0x7e')];}})[_0x6e70('0x38')](function(){return db[_0x6e70('0x40')][_0x6e70('0x5d')](_0x324353);})[_0x6e70('0x38')](handleEntityNotFound(_0x5e5b1f,null))[_0x6e70('0x38')](function(_0x40c5c0){if(_0x40c5c0){if(!_['isNil'](_0x40c5c0[_0x6e70('0x72')])){if(fs[_0x6e70('0x7f')](path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x81'),_0x40c5c0[_0x6e70('0x72')]))&&_0x39e14f){_0x5f12d3=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x81'),_0x40c5c0[_0x6e70('0x72')]);}}return _0x5e5b1f[_0x6e70('0x82')](_0x5f12d3);}})[_0x6e70('0x2c')](handleError(_0x5e5b1f,null));};exports['getAvatar']=function(_0x2a1205,_0x1f1b96,_0x397289){var _0x551c7e=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x83'));var _0x1ff761={'where':{'id':_0x2a1205[_0x6e70('0x5a')]['id']},'attributes':['id',_0x6e70('0x75')],'raw':!![]};return db['ChatWebsite']['find'](_0x1ff761)[_0x6e70('0x38')](handleEntityNotFound(_0x1f1b96,null))[_0x6e70('0x38')](function(_0xc93d60){if(_0xc93d60){if(!_[_0x6e70('0x84')](_0xc93d60[_0x6e70('0x75')])){if(fs[_0x6e70('0x7f')](path['join'](config[_0x6e70('0x7b')],_0x6e70('0x85'),_0xc93d60[_0x6e70('0x75')]))){_0x551c7e=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x85'),_0xc93d60[_0x6e70('0x75')]);}}return _0x1f1b96[_0x6e70('0x82')](_0x551c7e);}})[_0x6e70('0x2c')](handleError(_0x1f1b96,null));};exports[_0x6e70('0x86')]=function(_0xd2d74f,_0x8b237a,_0x17647f){var _0xd06a34=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x87'));var _0x4ca2f4={'where':{'id':_0xd2d74f['params']['id']},'attributes':['id',_0x6e70('0x77'),_0x6e70('0x88')],'raw':!![]};return db[_0x6e70('0x40')][_0x6e70('0x5d')](_0x4ca2f4)[_0x6e70('0x38')](handleEntityNotFound(_0x8b237a,null))[_0x6e70('0x38')](function(_0x58a004){if(_0x58a004){if(!_[_0x6e70('0x84')](_0x58a004['customerAvatar'])){if(fs[_0x6e70('0x7f')](path['join'](config[_0x6e70('0x7b')],'server/files/images/avatars/',_0x58a004[_0x6e70('0x77')]))&&_0x58a004[_0x6e70('0x88')]){_0xd06a34=path[_0x6e70('0x80')](config['root'],_0x6e70('0x85'),_0x58a004[_0x6e70('0x77')]);}}return _0x8b237a[_0x6e70('0x82')](_0xd06a34);}})[_0x6e70('0x2c')](handleError(_0x8b237a,null));};exports[_0x6e70('0x89')]=function(_0x4028a2,_0x1e8bfd,_0x5002ba){var _0x2e3278=path[_0x6e70('0x80')](config['root'],_0x6e70('0x8a'));var _0x31a586={'where':{'id':_0x4028a2['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x6e70('0x40')]['find'](_0x31a586)[_0x6e70('0x38')](handleEntityNotFound(_0x1e8bfd,null))[_0x6e70('0x38')](function(_0x2695af){if(_0x2695af){if(!_[_0x6e70('0x84')](_0x2695af[_0x6e70('0x79')])){if(fs[_0x6e70('0x7f')](path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x85'),_0x2695af[_0x6e70('0x79')]))){_0x2e3278=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x85'),_0x2695af['systemAvatar']);}}return _0x1e8bfd[_0x6e70('0x82')](_0x2e3278);}})[_0x6e70('0x2c')](handleError(_0x1e8bfd,null));};exports[_0x6e70('0x8b')]=function(_0x472a93,_0x26d3f8,_0x29f2ec){var _0x1cf0d7=require(_0x6e70('0x8c'));var _0x44ebd6=new _0x1cf0d7();var _0x568799=_0x44ebd6[_0x6e70('0x8d')](_0x472a93[_0x6e70('0x8e')][_0x6e70('0x8f')])['getResult']();var _0x88522={'body':_0x472a93[_0x6e70('0x5f')],'channel':_0x6e70('0x90')};var _0x5c98b8=[];var _0x4af0bc=[];var _0x52bacf={};var _0x20ac7e=![];return db['CmContact']['describe']()[_0x6e70('0x38')](function(_0x83d7e3){if(!_0x83d7e3){throw new db[(_0x6e70('0x91'))][(_0x6e70('0x92'))](_0x6e70('0x93'));}_0x5c98b8=_[_0x6e70('0x94')](_[_0x6e70('0x43')](_0x83d7e3),[_0x6e70('0x95'),_0x6e70('0x96')]);_0x4af0bc=_[_0x6e70('0x94')](_['keys'](_0x83d7e3),[_0x6e70('0x95'),_0x6e70('0x96'),_0x6e70('0x97'),_0x6e70('0x98')]);if(_0x472a93[_0x6e70('0x5f')]['id']){delete _0x472a93[_0x6e70('0x5f')]['id'];}if(_[_0x6e70('0x84')](_0x472a93[_0x6e70('0x5f')][_0x6e70('0x99')])){throw new db[(_0x6e70('0x91'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x472a93['body'][_0x6e70('0x5f')])||_0x472a93[_0x6e70('0x5f')][_0x6e70('0x5f')]===''){throw new db['Sequelize'][(_0x6e70('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6e70('0x84')](_0x472a93['body']['mapKey'])){throw new db[(_0x6e70('0x91'))][(_0x6e70('0x92'))](_0x6e70('0x9a')+_0x4af0bc);}if(!_[_0x6e70('0x9b')](_0x4af0bc,_0x472a93[_0x6e70('0x5f')][_0x6e70('0x9c')])){throw new db[(_0x6e70('0x91'))]['ValidationError'](_0x6e70('0x9d')+_0x4af0bc);}_0x52bacf[_0x472a93[_0x6e70('0x5f')]['mapKey']]=_0x472a93[_0x6e70('0x5f')][_0x6e70('0x99')];})[_0x6e70('0x38')](function(){return db['ChatWebsite'][_0x6e70('0x5d')]({'where':{'id':_0x472a93[_0x6e70('0x5a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6e70('0x9e')],'as':_0x6e70('0x9f'),'where':_0x52bacf,'limit':0x1,'order':[[_0x6e70('0x96'),_0x6e70('0xa0')]]}]},{'model':db[_0x6e70('0xa1')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x26d3f8,null))[_0x6e70('0x38')](function(_0x1becb0){if(_0x1becb0&&_0x1becb0[_0x6e70('0xa2')]){_0x88522['account']=_0x1becb0;_0x88522[_0x6e70('0xa3')]=_0x1becb0[_0x6e70('0xa4')];_0x88522[_0x6e70('0xa5')]=_0x1becb0[_0x6e70('0xa2')];_0x88522[_0x6e70('0xa3')]=_[_0x6e70('0xa6')](_0x88522[_0x6e70('0xa3')],[_0x6e70('0xa7')],[_0x6e70('0xa8')]);if(_0x88522[_0x6e70('0xa9')]['Applications']){delete _0x88522[_0x6e70('0xa9')][_0x6e70('0xa4')];}if(_0x88522[_0x6e70('0xa9')][_0x6e70('0xa2')]&&_0x88522['account'][_0x6e70('0xa2')][_0x6e70('0x9f')][_0x6e70('0x48')]){return _0x88522['account'][_0x6e70('0xa2')][_0x6e70('0x9f')][0x0];}var _0x29da89=_[_0x6e70('0x1c')](_0x472a93['body'],{'firstName':_0x472a93[_0x6e70('0x5f')][_0x6e70('0x99')],'ListId':_0x1becb0[_0x6e70('0x98')]});_0x29da89[_0x472a93[_0x6e70('0x5f')][_0x6e70('0x9c')]]=_0x472a93[_0x6e70('0x5f')][_0x6e70('0x99')];return db[_0x6e70('0x9e')][_0x6e70('0x5e')](_0x29da89,{'fields':_0x5c98b8,'raw':!![]});}})[_0x6e70('0x38')](handleEntityNotFound(_0x26d3f8,null))['then'](function(_0x53f283){_0x88522[_0x6e70('0xaa')]=_0x53f283;if(_0x53f283){var _0x3dec80={'ContactId':_0x53f283['id'],'ChatWebsiteId':_0x472a93[_0x6e70('0x5a')]['id'],'from':(_0x53f283[_0x6e70('0xab')]||'')+'\x20'+(_0x53f283[_0x6e70('0xac')]||''),'customerIp':_0x472a93[_0x6e70('0x5f')][_0x6e70('0xad')],'referer':_0x472a93[_0x6e70('0x5f')][_0x6e70('0xae')],'browserName':_0x568799[_0x6e70('0xaf')][_0x6e70('0x3d')]&&_0x568799[_0x6e70('0xaf')][_0x6e70('0xb0')]?util[_0x6e70('0xb1')](_0x6e70('0xb2'),_0x568799['browser'][_0x6e70('0x3d')],_0x568799[_0x6e70('0xaf')][_0x6e70('0xb0')]):'unknown','browserVersion':_0x568799[_0x6e70('0xaf')][_0x6e70('0xb0')]||_0x6e70('0xb3'),'osName':util[_0x6e70('0xb1')](_0x6e70('0xb2'),_0x568799['os'][_0x6e70('0x3d')],_0x568799['os']['version']),'osVersion':_0x568799['os'][_0x6e70('0xb0')],'deviceModel':_0x568799[_0x6e70('0xb4')]['model']&&_0x568799[_0x6e70('0xb4')][_0x6e70('0xb5')]?util[_0x6e70('0xb1')](_0x6e70('0xb6'),_0x568799[_0x6e70('0xb4')]['model'],_0x568799['device'][_0x6e70('0xb5')],_0x568799['device'][_0x6e70('0x52')]):null,'deviceVendor':_0x568799[_0x6e70('0xb4')][_0x6e70('0xb5')],'deviceType':_0x568799[_0x6e70('0xb4')][_0x6e70('0x52')],'formData':JSON['stringify'](_0x472a93[_0x6e70('0x5f')])};var _0x237949={'ChatWebsiteId':_0x472a93[_0x6e70('0x5a')]['id'],'closed':![]};if(_0x472a93[_0x6e70('0x5f')][_0x6e70('0xb7')]){_0x237949[_0x6e70('0xb7')]=_0x472a93['body']['threadId'];return db[_0x6e70('0xb8')][_0x6e70('0x5d')]({'where':_0x237949})[_0x6e70('0x38')](function(_0x2fdf04){if(_0x2fdf04){return[_0x2fdf04,![]];}_0x3dec80['threadId']=_0x472a93['body'][_0x6e70('0xb7')];_0x3dec80[_0x6e70('0xb9')]=_0x472a93['body'][_0x6e70('0xb9')];return db[_0x6e70('0xb8')][_0x6e70('0x5e')](_0x3dec80)['then'](function(_0xec1de0){return[_0xec1de0,!![]];});});}_0x237949[_0x6e70('0xba')]=_0x53f283['id'];if(_0x472a93['body'][_0x6e70('0xbb')]&&_0x472a93['body'][_0x6e70('0xbb')]['id']){_0x237949['id']=_0x472a93[_0x6e70('0x5f')][_0x6e70('0xbb')]['id'];return db['ChatInteraction'][_0x6e70('0x5d')]({'where':_0x237949})[_0x6e70('0x38')](function(_0x2edb4a){if(_0x2edb4a){return[_0x2edb4a,![]];}return db[_0x6e70('0xb8')][_0x6e70('0x5e')](_0x3dec80)['then'](function(_0x12c458){return[_0x12c458,!![]];});});}return db['ChatInteraction'][_0x6e70('0x5e')](_0x3dec80)[_0x6e70('0x38')](function(_0x4617c9){return[_0x4617c9,!![]];});}})[_0x6e70('0xbc')](function(_0x307dfb,_0x26a56c){if(_0x307dfb){_0x20ac7e=_0x26a56c;if(!_0x26a56c){var _0x171940={'from':(_0x88522[_0x6e70('0xaa')]['firstName']||'')+'\x20'+(_0x88522[_0x6e70('0xaa')]['lastName']||'')};if(_0x472a93[_0x6e70('0x5f')][_0x6e70('0xb7')]&&_0x472a93[_0x6e70('0x5f')][_0x6e70('0xbd')]&&_0x472a93['body'][_0x6e70('0xb7')]!=_0x472a93['body']['messageId']){_0x171940[_0x6e70('0xb7')]=_0x472a93['body'][_0x6e70('0xbd')];}return _0x307dfb[_0x6e70('0x36')](_0x171940);}else{return _0x307dfb;}}})[_0x6e70('0x38')](function(_0x4e53fe){_0x88522['interaction']=_0x4e53fe[_0x6e70('0x39')]({'plain':!![]});_0x88522[_0x6e70('0xbb')][_0x6e70('0xbe')]=_0x20ac7e;if(_0x88522[_0x6e70('0xbb')][_0x6e70('0xbe')]){if(_0x88522[_0x6e70('0xa9')]['autoclose']){_0x88522[_0x6e70('0xa3')]['push']({'id':0x0,'priority':_0x88522['applications']['length']+0x1,'app':_0x6e70('0xbf'),'appdata':_0x6e70('0xc0'),'interval':'*,*,*,*'});}}return db[_0x6e70('0xc1')]['create']({'body':_0x472a93[_0x6e70('0x5f')][_0x6e70('0x5f')],'ChatWebsiteId':_0x472a93[_0x6e70('0x5a')]['id'],'ChatInteractionId':_0x4e53fe['id'],'direction':'in','ContactId':_0x88522[_0x6e70('0xaa')]['id'],'AttachmentId':_0x472a93[_0x6e70('0x5f')][_0x6e70('0xc2')]});})[_0x6e70('0x38')](function(_0x31b91f){_0x88522[_0x6e70('0x2b')]=_0x31b91f;if(_0x88522[_0x6e70('0xbb')][_0x6e70('0xc3')]){return db[_0x6e70('0xc4')]['find']({'attributes':['id','name'],'where':{'id':_0x88522[_0x6e70('0xbb')][_0x6e70('0xc3')]}})[_0x6e70('0x38')](function(_0x2363b6){if(_0x2363b6){_0x88522['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x6e70('0xc5'),'appdata':_0x2363b6[_0x6e70('0x3d')]+','+(_0x88522[_0x6e70('0xa9')][_0x6e70('0xc6')]||0xa),'interval':'*,*,*,*'});_0x88522[_0x6e70('0xc7')]=!![];}return respondWithRpcPromise('Start',_0x6e70('0xc8'),_0x88522);});}return respondWithRpcPromise(_0x6e70('0xc9'),_0x6e70('0xc8'),_0x88522);})[_0x6e70('0x38')](function(_0x3dd34c){respondWithRpcPromise('EventManager',_0x6e70('0xca'),{'event':_0x6e70('0x8b'),'message':_0x3dd34c},client9002);return _0x3dd34c;})[_0x6e70('0x38')](respondWithResult(_0x26d3f8,null))['catch'](handleError(_0x26d3f8,null));};exports[_0x6e70('0xcb')]=function(_0x20a675,_0x2b5529,_0x1cd88f){var _0x1a83ab,_0x330389,_0xb12214;var _0x3071e6=[];var _0x3ec1fe=[];var _0x105b8f={};return db[_0x6e70('0x9e')][_0x6e70('0x67')]()[_0x6e70('0x38')](function(_0xc2cf78){if(!_0xc2cf78){throw new db[(_0x6e70('0x91'))][(_0x6e70('0x92'))](_0x6e70('0x93'));}_0x3ec1fe=_[_0x6e70('0x94')](_[_0x6e70('0x43')](_0xc2cf78),[_0x6e70('0x95'),_0x6e70('0x96')]);_0x3071e6=_['difference'](_[_0x6e70('0x43')](_0xc2cf78),['createdAt','updatedAt','CompanyId','ListId']);if(_0x20a675[_0x6e70('0x5f')]['id']){delete _0x20a675[_0x6e70('0x5f')]['id'];}if(_[_0x6e70('0x84')](_0x20a675[_0x6e70('0x5f')][_0x6e70('0x99')])){throw _0x2b5529[_0x6e70('0x2e')](0x1f4)[_0x6e70('0xcc')](new db['Sequelize'][(_0x6e70('0x92'))](_0x6e70('0xcd')));}if(_['isNil'](_0x20a675['body'][_0x6e70('0x5f')])||_0x20a675[_0x6e70('0x5f')][_0x6e70('0x5f')]===''){throw _0x2b5529[_0x6e70('0x2e')](0x1f4)[_0x6e70('0xcc')](new db['Sequelize']['ValidationError'](_0x6e70('0xce')));}if(_[_0x6e70('0x84')](_0x20a675[_0x6e70('0x5f')]['mapKeyOffline'])){throw _0x2b5529[_0x6e70('0x2e')](0x1f4)[_0x6e70('0xcc')](new db[(_0x6e70('0x91'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3071e6));}if(!_[_0x6e70('0x9b')](_0x3071e6,_0x20a675[_0x6e70('0x5f')][_0x6e70('0xcf')])){throw _0x2b5529[_0x6e70('0x2e')](0x1f4)[_0x6e70('0xcc')](new db['Sequelize']['ValidationError'](_0x6e70('0xd0')+_0x3071e6));}_0x105b8f[_0x20a675[_0x6e70('0x5f')][_0x6e70('0xcf')]]=_0x20a675['body'][_0x6e70('0x99')];})[_0x6e70('0x38')](function(){return db[_0x6e70('0x40')]['find']({'where':{'id':_0x20a675[_0x6e70('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x6e70('0xa2')}]});})[_0x6e70('0x38')](handleEntityNotFound(_0x2b5529,null))['then'](function(_0x3b9e5a){if(_0x3b9e5a&&_0x3b9e5a[_0x6e70('0xa2')]){_0x330389=_0x3b9e5a;var _0x55d5d6=_[_0x6e70('0x1c')](_0x20a675[_0x6e70('0x5f')],{'firstName':_0x20a675[_0x6e70('0x5f')][_0x6e70('0x99')],'phone':_0x20a675[_0x6e70('0x5f')][_0x6e70('0x99')],'ListId':_0x3b9e5a[_0x6e70('0x98')]});_0x55d5d6[_0x20a675[_0x6e70('0x5f')][_0x6e70('0xcf')]]=_0x20a675[_0x6e70('0x5f')]['from'];return db['CmContact'][_0x6e70('0xd1')]({'where':_0x105b8f,'defaults':_0x55d5d6});}})['spread'](function(_0x32198a){if(_0x32198a){_0xb12214=_0x32198a;var _0x150d10=fs[_0x6e70('0xd2')](path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0xd3')),_0x6e70('0xd4'));var _0x3a9260=ejs[_0x6e70('0xd5')](_0x150d10,{'body':_['toPairs'](_0x20a675['body']['body']),'bodyTitle':_0x330389[_0x6e70('0xd6')]});return db['ChatOfflineMessage'][_0x6e70('0x5e')]({'body':_0x3a9260,'ContactId':_0x32198a['id'],'ChatWebsiteId':_0x330389['id']});}})[_0x6e70('0x38')](function(_0x1e8e4d){if(_0x1e8e4d){_0x1a83ab=_0x1e8e4d;return db[_0x6e70('0xd7')][_0x6e70('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x6e70('0xd8')],'as':'Smtp','raw':!![]}]});}})[_0x6e70('0x38')](function(_0xfa1678){if(_0xfa1678&&_0xfa1678[_0x6e70('0xd9')]&&_0x330389[_0x6e70('0xda')]){var _0x7bad03={'tls':{'rejectUnauthorized':![]}};if(_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xdb')]){_0x7bad03['service']=_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xdb')];}else{_0x7bad03['host']=_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xdc')];_0x7bad03['port']=_0xfa1678['Smtp'][_0x6e70('0xdd')];_0x7bad03[_0x6e70('0xde')]=_0xfa1678['Smtp'][_0x6e70('0xde')];}if(_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xdf')]){_0x7bad03[_0x6e70('0xe0')]={'user':_0xfa1678[_0x6e70('0xd9')]['user'],'pass':_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xe1')]};}return respondWithRpcPromise('SendMail',_0x6e70('0xe2'),{'account':_0x7bad03,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xfa1678['name'],_0xfa1678[_0x6e70('0xe3')]||_0xfa1678[_0x6e70('0xd9')]['user']),'to':_0x330389[_0x6e70('0xda')],'subject':_0x330389[_0x6e70('0xe4')],'text':_0x1a83ab['body']}},client9003)['then'](function(){return _0x1a83ab;})[_0x6e70('0x2c')](function(_0xc5bf0){console['error'](_0xc5bf0);});}})[_0x6e70('0x38')](function(){if(_0x1a83ab){return _0x1a83ab;}})[_0x6e70('0x38')](respondWithResult(_0x2b5529,null))[_0x6e70('0x2c')](handleError(_0x2b5529,null));};exports[_0x6e70('0xe5')]=function(_0x57d976,_0x183d58,_0x5cb9fb){return db['ChatInteraction']['find']({'where':{'id':_0x57d976[_0x6e70('0x5a')]['id']}})['then'](handleEntityNotFound(_0x183d58,null))[_0x6e70('0x38')](function(_0x8fbbf4){if(_0x8fbbf4){return _0x8fbbf4[_0x6e70('0xe5')](_0x57d976['body']['ids'],_[_0x6e70('0xe6')](_0x57d976['body'],[_0x6e70('0x6d'),'id'])||{});}})[_0x6e70('0x38')](respondWithResult(_0x183d58,null))[_0x6e70('0x2c')](handleError(_0x183d58,null));};exports[_0x6e70('0xe7')]=function(_0x2c5d28,_0x204c3a,_0x3976cf){var _0x526abf={'raw':![],'where':{}};var _0x23c944={};var _0x1346c1={'count':0x0,'rows':[]};return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x2c5d28['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x204c3a,null))[_0x6e70('0x38')](function(_0x3f9000){if(_0x3f9000){_0x23c944['model']=_[_0x6e70('0x43')](db[_0x6e70('0xb8')][_0x6e70('0x41')]);_0x23c944[_0x6e70('0x44')]=_['keys'](_0x2c5d28[_0x6e70('0x44')]);_0x23c944[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x23c944[_0x6e70('0x42')],_0x23c944['query']);_0x526abf[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x23c944[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x2c5d28[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x526abf[_0x6e70('0x47')]=_0x526abf[_0x6e70('0x47')][_0x6e70('0x48')]?_0x526abf[_0x6e70('0x47')]:_0x23c944[_0x6e70('0x42')];if(!_0x2c5d28[_0x6e70('0x44')]['hasOwnProperty'](_0x6e70('0x4a'))){_0x526abf[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x2c5d28[_0x6e70('0x44')][_0x6e70('0x32')]);_0x526abf['offset']=qs['offset'](_0x2c5d28[_0x6e70('0x44')][_0x6e70('0x31')]);}_0x526abf[_0x6e70('0x4b')]=qs['sort'](_0x2c5d28['query'][_0x6e70('0x4c')]);_0x526abf[_0x6e70('0x4f')]=qs['filters'](_[_0x6e70('0x4d')](_0x2c5d28[_0x6e70('0x44')],_0x23c944[_0x6e70('0x45')]));_0x526abf[_0x6e70('0x4f')][_0x6e70('0x69')]=_0x3f9000['id'];if(_0x2c5d28[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x526abf[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x526abf[_0x6e70('0x4f')],{'$or':_[_0x6e70('0x51')](_0x526abf[_0x6e70('0x47')],function(_0x3cbad0){var _0x41d78e={};_0x41d78e[_0x3cbad0]={'$like':'%'+_0x2c5d28['query'][_0x6e70('0x4e')]+'%'};return _0x41d78e;})});}_0x526abf=_[_0x6e70('0x50')]({},_0x526abf,_0x2c5d28['options']);return db[_0x6e70('0xb8')]['count']({'where':_0x526abf[_0x6e70('0x4f')]})['then'](function(_0x7e62f7){_0x1346c1[_0x6e70('0x30')]=_0x7e62f7;if(_0x2c5d28['query'][_0x6e70('0x56')]){_0x526abf['include']=[{'model':db['CmContact'],'as':_0x6e70('0xe8'),'required':![]},{'model':db[_0x6e70('0xc4')],'as':_0x6e70('0xe9'),'attributes':[_0x6e70('0x3d'),_0x6e70('0xea'),_0x6e70('0xeb')],'required':![]},{'model':db[_0x6e70('0xec')],'as':_0x6e70('0xed'),'attributes':['id',_0x6e70('0x3d'),_0x6e70('0xee')],'where':_0x2c5d28[_0x6e70('0x44')][_0x6e70('0xef')]?{'id':_0x2c5d28[_0x6e70('0x44')][_0x6e70('0xef')]}:undefined,'required':_0x2c5d28[_0x6e70('0x44')][_0x6e70('0xef')]?!![]:![]}];}return db[_0x6e70('0xb8')][_0x6e70('0x6b')](_0x526abf);})[_0x6e70('0x38')](function(_0x5ed63e){_0x1346c1[_0x6e70('0x58')]=_0x5ed63e;return _0x1346c1;});}})['then'](respondWithFilteredResult(_0x204c3a,_0x526abf))[_0x6e70('0x2c')](handleError(_0x204c3a,null));};function iftimePromise(_0x556ee2,_0x28a825){return respondWithRpcPromise(_0x6e70('0xf0'),_0x6e70('0xf1'),{'command':_0x28a825['timezone']?util[_0x6e70('0xb1')](_0x6e70('0xf2'),_0x556ee2[_0x6e70('0xf3')],_0x28a825[_0x6e70('0xf4')]):util[_0x6e70('0xb1')](_0x6e70('0xf5'),_0x556ee2['interval'])},client9002)[_0x6e70('0x38')](function(_0x10c7c3){var _0x41270a=_0x10c7c3&&_0x10c7c3['indexOf']('true')>=0x0?!![]:![];logger[_0x6e70('0x23')](_0x6e70('0xf6'),_0x28a825['id'],_0x556ee2['id'],_0x556ee2[_0x6e70('0xf3')],_0x41270a?_0x6e70('0xf7'):_0x6e70('0xf8'),_0x28a825['timezone']?_0x28a825[_0x6e70('0xf4')]:_0x6e70('0xf9'));return _0x41270a;})[_0x6e70('0x2c')](function(_0x3e883c){logger[_0x6e70('0x28')](_0x6e70('0xf6'),_0x28a825['id'],_0x556ee2['id'],_0x556ee2[_0x6e70('0xf3')],util[_0x6e70('0xfa')](_0x3e883c,{'showHidden':![],'depth':null}),_0x28a825[_0x6e70('0xf4')]?_0x28a825[_0x6e70('0xf4')]:_0x6e70('0xf9'));return![];});}exports[_0x6e70('0xf1')]=function(_0x16fe88,_0x25a891,_0x5f3b6f){var _0x3161a1=0x0;var _0x4a48da=0x0;var _0x395e9a=![];var _0x4cffd5;var _0x206d76;return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x16fe88[_0x6e70('0x5a')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x6e70('0xfb')],'as':'Intervals','attributes':['id',_0x6e70('0xf3')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x25a891,null))['then'](function(_0x3666d2){if(_0x3666d2){_0x4cffd5=_0x3666d2;return _0x3666d2[_0x6e70('0xfc')]({'raw':!![]});}})[_0x6e70('0x38')](function(_0x5078a1){if(_0x4cffd5){if(_0x5078a1){_0x206d76=_0x5078a1;}}return require('../../config/license/util')[_0x6e70('0xfd')]();})[_0x6e70('0x38')](function(_0x44c669){if(_0x44c669){_0x4a48da=_0x44c669['virtual'];_0x395e9a=_0x44c669[_0x6e70('0x7e')];}})[_0x6e70('0x38')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x529789){_0x3161a1=_0x529789;if(_0x4a48da&&_0x529789>_0x4a48da){return db[_0x6e70('0xfe')][_0x6e70('0x70')]({'where':{'id':0x1}})[_0x6e70('0x38')](function(_0x438fd7){if(_0x438fd7){_0x438fd7['increment'](_0x6e70('0xff'));}});}})[_0x6e70('0x38')](function(){if(_0x4cffd5[_0x6e70('0xfb')]&&_0x4cffd5['Interval'][_0x6e70('0x100')]){var _0x7e9085=[];for(var _0x309f53=0x0;_0x309f53<_0x4cffd5[_0x6e70('0xfb')][_0x6e70('0x100')][_0x6e70('0x48')];_0x309f53++){var _0xada7ca=_0x4cffd5[_0x6e70('0xfb')]['Intervals'][_0x309f53][_0x6e70('0x39')]({'plain':!![]});_0x7e9085[_0x6e70('0x101')](iftimePromise(_0xada7ca,_0x4cffd5));}return BPromise['all'](_0x7e9085)[_0x6e70('0x38')](function(_0x15a45d){return _[_0x6e70('0x102')](_0x15a45d);});}else{return!![];}})[_0x6e70('0x38')](function(_0x1662b0){var _0x35cda0=fs[_0x6e70('0xd2')](path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x103')),_0x6e70('0xd4'));var _0x151ba4={'remote':_0x4cffd5[_0x6e70('0x104')],'query':querystring['stringify'](_[_0x6e70('0x50')](_0x4cffd5[_0x6e70('0x39')]({'plain':!![]}),{'customerIp':_0x16fe88[_0x6e70('0x8e')]['x-forwarded-for']||_0x16fe88[_0x6e70('0x8e')][_0x6e70('0x105')]||_0x16fe88[_0x6e70('0x106')][_0x6e70('0x107')]||_0x16fe88['ip'],'referer':_0x16fe88[_0x6e70('0x8e')][_0x6e70('0xae')],'openedInteractions':_0x3161a1,'maxInteractions':_0x4a48da,'virtual':_0x395e9a[_0x6e70('0x108')],'online':_0x1662b0,'custom':_0x395e9a}))[_0x6e70('0x109')](/'/g,'\x5c\x27')};_0x25a891['send'](ejs[_0x6e70('0xd5')](Mustache[_0x6e70('0xd5')](_0x35cda0,_0x151ba4),{'proactiveActions':_0x206d76,'alignment':_0x4cffd5[_0x6e70('0x10a')],'verticalAlignment':_0x4cffd5[_0x6e70('0x10b')]}));})[_0x6e70('0x2c')](handleError(_0x25a891,null));};exports[_0x6e70('0x10c')]=function(_0x5ae297,_0x1f8272,_0x1b723f){return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x5ae297[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x1f8272,null))[_0x6e70('0x38')](function(_0x1c8cdd){if(_0x1c8cdd){return db[_0x6e70('0x10d')]['transaction'](function(_0x703d37){return db['ChatApplication'][_0x6e70('0x37')]({'where':{'ChatWebsiteId':_0x5ae297[_0x6e70('0x5a')]['id']},'transaction':_0x703d37})[_0x6e70('0x38')](function(_0x372a72){var _0x31477e=_[_0x6e70('0x51')](_0x5ae297['body'],function(_0x263690){_0x263690[_0x6e70('0x69')]=_0x5ae297[_0x6e70('0x5a')]['id'];return _0x263690;});return db['ChatApplication'][_0x6e70('0x10e')](_0x31477e,{'transaction':_0x703d37});});})[_0x6e70('0x38')](function(){return db[_0x6e70('0xa1')][_0x6e70('0x10f')]({'where':{'ChatWebsiteId':_0x5ae297[_0x6e70('0x5a')]['id']},'order':_0x6e70('0xa7')});});}})[_0x6e70('0x38')](respondWithResult(_0x1f8272,null))[_0x6e70('0x2c')](handleError(_0x1f8272,null));};exports['getApplications']=function(_0x46b658,_0x377fc9,_0x4fa024){var _0x15dc7e={};var _0x3c4d3a={};var _0x281fc2;var _0x1a0f36;return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x46b658[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x377fc9,null))['then'](function(_0x5bc20d){if(_0x5bc20d){_0x281fc2=_0x5bc20d;_0x3c4d3a[_0x6e70('0x42')]=_['keys'](db[_0x6e70('0xa1')][_0x6e70('0x41')]);_0x3c4d3a[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x46b658['query']);_0x3c4d3a[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x3c4d3a['model'],_0x3c4d3a[_0x6e70('0x44')]);_0x15dc7e[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x3c4d3a['model'],qs[_0x6e70('0x5c')](_0x46b658[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x15dc7e[_0x6e70('0x47')]=_0x15dc7e[_0x6e70('0x47')][_0x6e70('0x48')]?_0x15dc7e[_0x6e70('0x47')]:_0x3c4d3a[_0x6e70('0x42')];_0x15dc7e[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x46b658[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x15dc7e[_0x6e70('0x4f')]=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x46b658['query'],_0x3c4d3a[_0x6e70('0x45')]));if(_0x46b658[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x15dc7e[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x15dc7e[_0x6e70('0x4f')],{'$or':_['map'](_0x15dc7e[_0x6e70('0x47')],function(_0x43f742){var _0x4ce89a={};_0x4ce89a[_0x43f742]={'$like':'%'+_0x46b658['query'][_0x6e70('0x4e')]+'%'};return _0x4ce89a;})});}_0x15dc7e=_[_0x6e70('0x50')]({},_0x15dc7e,_0x46b658[_0x6e70('0x55')]);return _0x281fc2[_0x6e70('0x110')](_0x15dc7e);}})[_0x6e70('0x38')](function(_0x1bff94){if(_0x1bff94){_0x1a0f36=_0x1bff94[_0x6e70('0x48')];if(!_0x46b658['query']['hasOwnProperty'](_0x6e70('0x4a'))){_0x15dc7e[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x46b658[_0x6e70('0x44')][_0x6e70('0x32')]);_0x15dc7e['offset']=qs[_0x6e70('0x31')](_0x46b658[_0x6e70('0x44')][_0x6e70('0x31')]);}return _0x281fc2[_0x6e70('0x110')](_0x15dc7e);}})[_0x6e70('0x38')](function(_0x219353){if(_0x219353){return _0x219353?{'count':_0x1a0f36,'rows':_0x219353}:null;}})['then'](respondWithResult(_0x377fc9,null))[_0x6e70('0x2c')](handleError(_0x377fc9,null));};exports[_0x6e70('0x111')]=function(_0x64010,_0xbcaf1,_0x17cf03){return db[_0x6e70('0x112')][_0x6e70('0x5d')]({'where':{'id':_0x64010[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0xbcaf1,null))[_0x6e70('0x38')](function(_0x135231){if(_0x135231){return _0x135231[_0x6e70('0x111')](_0x64010[_0x6e70('0x5f')]['ids'],_[_0x6e70('0xe6')](_0x64010[_0x6e70('0x5f')],[_0x6e70('0x6d'),'id'])||{});}})[_0x6e70('0x38')](respondWithResult(_0xbcaf1,null))[_0x6e70('0x2c')](handleError(_0xbcaf1,null));};exports[_0x6e70('0xfc')]=function(_0x3da91d,_0x2764de,_0x25a840){var _0x28c3a5={};var _0x1b88a9={};var _0x35a444;var _0x57d646;return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x3da91d['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x2764de,null))['then'](function(_0x3c52d9){if(_0x3c52d9){_0x35a444=_0x3c52d9;_0x1b88a9[_0x6e70('0x42')]=_[_0x6e70('0x43')](db['ChatProactiveAction']['rawAttributes']);_0x1b88a9[_0x6e70('0x44')]=_['keys'](_0x3da91d[_0x6e70('0x44')]);_0x1b88a9[_0x6e70('0x45')]=_['intersection'](_0x1b88a9['model'],_0x1b88a9[_0x6e70('0x44')]);_0x28c3a5['attributes']=_[_0x6e70('0x46')](_0x1b88a9[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x3da91d[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x28c3a5[_0x6e70('0x47')]=_0x28c3a5[_0x6e70('0x47')][_0x6e70('0x48')]?_0x28c3a5[_0x6e70('0x47')]:_0x1b88a9['model'];_0x28c3a5[_0x6e70('0x4b')]=qs['sort'](_0x3da91d[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x28c3a5[_0x6e70('0x4f')]=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x3da91d[_0x6e70('0x44')],_0x1b88a9[_0x6e70('0x45')]));if(_0x3da91d[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x28c3a5['where']=_[_0x6e70('0x50')](_0x28c3a5['where'],{'$or':_[_0x6e70('0x51')](_0x28c3a5[_0x6e70('0x47')],function(_0xa4e543){var _0x23cd8f={};_0x23cd8f[_0xa4e543]={'$like':'%'+_0x3da91d[_0x6e70('0x44')][_0x6e70('0x4e')]+'%'};return _0x23cd8f;})});}_0x28c3a5=_['merge']({},_0x28c3a5,_0x3da91d[_0x6e70('0x55')]);return _0x35a444[_0x6e70('0xfc')](_0x28c3a5);}})[_0x6e70('0x38')](function(_0x39380b){if(_0x39380b){_0x57d646=_0x39380b[_0x6e70('0x48')];if(!_0x3da91d[_0x6e70('0x44')][_0x6e70('0x49')](_0x6e70('0x4a'))){_0x28c3a5['limit']=qs[_0x6e70('0x32')](_0x3da91d[_0x6e70('0x44')][_0x6e70('0x32')]);_0x28c3a5[_0x6e70('0x31')]=qs['offset'](_0x3da91d[_0x6e70('0x44')]['offset']);}return _0x35a444['getProactiveActions'](_0x28c3a5);}})[_0x6e70('0x38')](function(_0x40b556){if(_0x40b556){return _0x40b556?{'count':_0x57d646,'rows':_0x40b556}:null;}})[_0x6e70('0x38')](respondWithResult(_0x2764de,null))[_0x6e70('0x2c')](handleError(_0x2764de,null));};exports['getFields']=function(_0x4fba66,_0x5f2aa6,_0x3d8a55){var _0x3d016e=_0x4fba66['query'][_0x6e70('0x113')]==='false'?_0x6e70('0x114'):_0x6e70('0x115');return db['ChatWebsite'][_0x6e70('0x5d')]({'attributes':['id',_0x3d016e],'where':{'id':_0x4fba66[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x5f2aa6,null))[_0x6e70('0x38')](function(_0x49d5f8){if(_0x49d5f8){var _0x463448=_0x49d5f8[_0x3d016e];var _0x373f7c=_0x463448&&_0x463448[_0x6e70('0x116')]?_0x463448[_0x6e70('0x116')]:[];_0x5f2aa6['send']({'fromKey':_[_0x6e70('0x84')](_0x463448['fromKey'])?undefined:_0x463448[_0x6e70('0x117')],'count':_0x373f7c[_0x6e70('0x48')],'rows':_0x373f7c});}})[_0x6e70('0x2c')](handleError(_0x5f2aa6,null));};exports[_0x6e70('0x118')]=function(_0x226e26,_0x24f203,_0x172d6c){var _0x11ad05={'raw':!![],'where':{}};var _0x3e0204={};var _0x2386bb={'count':0x0,'rows':[]};return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x226e26[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x24f203,null))[_0x6e70('0x38')](function(_0x5bb918){if(_0x5bb918){_0x3e0204['model']=_[_0x6e70('0x43')](db[_0x6e70('0x119')][_0x6e70('0x41')]);_0x3e0204['query']=_[_0x6e70('0x43')](_0x226e26[_0x6e70('0x44')]);_0x3e0204['filters']=_['intersection'](_0x3e0204[_0x6e70('0x42')],_0x3e0204[_0x6e70('0x44')]);_0x11ad05[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x3e0204[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x226e26[_0x6e70('0x44')]['fields']));_0x11ad05[_0x6e70('0x47')]=_0x11ad05[_0x6e70('0x47')][_0x6e70('0x48')]?_0x11ad05[_0x6e70('0x47')]:_0x3e0204['model'];if(!_0x226e26[_0x6e70('0x44')][_0x6e70('0x49')](_0x6e70('0x4a'))){_0x11ad05[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x226e26[_0x6e70('0x44')][_0x6e70('0x32')]);_0x11ad05[_0x6e70('0x31')]=qs[_0x6e70('0x31')](_0x226e26[_0x6e70('0x44')]['offset']);}_0x11ad05[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x226e26[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x11ad05[_0x6e70('0x4f')]=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x226e26[_0x6e70('0x44')],_0x3e0204[_0x6e70('0x45')]));_0x11ad05[_0x6e70('0x4f')][_0x6e70('0x69')]=_0x5bb918['id'];if(_0x226e26[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x11ad05[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x11ad05[_0x6e70('0x4f')],{'$or':_[_0x6e70('0x51')](_0x11ad05[_0x6e70('0x47')],function(_0x4498bc){var _0x1d7f68={};_0x1d7f68[_0x4498bc]={'$like':'%'+_0x226e26[_0x6e70('0x44')]['filter']+'%'};return _0x1d7f68;})});}_0x11ad05=_[_0x6e70('0x50')]({},_0x11ad05,_0x226e26[_0x6e70('0x55')]);return db[_0x6e70('0x119')][_0x6e70('0x30')]({'where':_0x11ad05['where']})['then'](function(_0x473621){_0x2386bb[_0x6e70('0x30')]=_0x473621;if(_0x226e26['query']['includeAll']){_0x11ad05[_0x6e70('0x57')]=[{'all':!![]}];}return db[_0x6e70('0x119')][_0x6e70('0x6b')](_0x11ad05);})['then'](function(_0x5a52ba){_0x2386bb[_0x6e70('0x58')]=_0x5a52ba;return _0x2386bb;});}})[_0x6e70('0x38')](respondWithFilteredResult(_0x24f203,_0x11ad05))[_0x6e70('0x2c')](handleError(_0x24f203,null));};exports[_0x6e70('0x11a')]=function(_0x5a5fb2,_0x4818d3,_0x9a33e2){return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x5a5fb2['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x4818d3,null))['then'](function(_0x3ec865){if(_0x3ec865){return _0x3ec865[_0x6e70('0x11a')](_0x5a5fb2['body'][_0x6e70('0x6d')],_[_0x6e70('0xe6')](_0x5a5fb2[_0x6e70('0x5f')],[_0x6e70('0x6d'),'id'])||{})['spread'](function(_0x24ec1b){for(var _0x4b6894=0x0;_0x4b6894<_0x5a5fb2[_0x6e70('0x5f')][_0x6e70('0x6d')][_0x6e70('0x48')];_0x4b6894+=0x1){socket[_0x6e70('0x11b')](_0x6e70('0x11c'),{'UserId':_0x5a5fb2[_0x6e70('0x5f')][_0x6e70('0x6d')][_0x4b6894],'ChatWebsiteId':_0x5a5fb2['params']['id']});}return _0x24ec1b;});}})[_0x6e70('0x38')](respondWithResult(_0x4818d3,null))[_0x6e70('0x2c')](handleError(_0x4818d3,null));};exports[_0x6e70('0x11d')]=function(_0x40442a,_0x3839ee,_0x40f962){var _0x5132ce;return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x40442a['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x3839ee,null))['then'](function(_0x26263d){if(_0x26263d){return _0x26263d[_0x6e70('0x11d')](_0x40442a['query'][_0x6e70('0x6d')])[_0x6e70('0x38')](function(_0x3aa070){if(_[_0x6e70('0x11e')](_0x40442a[_0x6e70('0x44')][_0x6e70('0x6d')])){for(var _0x2b81a6=0x0;_0x2b81a6<_0x40442a[_0x6e70('0x44')][_0x6e70('0x6d')][_0x6e70('0x48')];_0x2b81a6+=0x1){socket['emit'](_0x6e70('0x11f'),{'UserId':_0x40442a[_0x6e70('0x44')][_0x6e70('0x6d')][_0x2b81a6],'ChatWebsiteId':_0x40442a['params']['id']});}}else{socket['emit']('userChatWebsite:remove',{'UserId':_0x40442a[_0x6e70('0x44')][_0x6e70('0x6d')],'ChatWebsiteId':_0x40442a[_0x6e70('0x5a')]['id']});}});}})['then'](respondWithStatusCode(_0x3839ee,null))[_0x6e70('0x2c')](handleError(_0x3839ee,null));};exports[_0x6e70('0x120')]=function(_0x3c2063,_0x30bb34,_0x3f4dfb){var _0x1e87e1={};var _0x2b51f4={};var _0x32937c;var _0x32f0d2;return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x3c2063[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x30bb34,null))['then'](function(_0x23010e){if(_0x23010e){_0x32937c=_0x23010e;_0x2b51f4[_0x6e70('0x42')]=_[_0x6e70('0x43')](db[_0x6e70('0xc4')][_0x6e70('0x41')]);_0x2b51f4['query']=_[_0x6e70('0x43')](_0x3c2063[_0x6e70('0x44')]);_0x2b51f4['filters']=_[_0x6e70('0x46')](_0x2b51f4[_0x6e70('0x42')],_0x2b51f4[_0x6e70('0x44')]);_0x1e87e1[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x2b51f4[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x3c2063['query'][_0x6e70('0x5c')]));_0x1e87e1['attributes']=_0x1e87e1[_0x6e70('0x47')][_0x6e70('0x48')]?_0x1e87e1[_0x6e70('0x47')]:_0x2b51f4[_0x6e70('0x42')];_0x1e87e1[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x3c2063[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x1e87e1[_0x6e70('0x4f')]=qs['filters'](_[_0x6e70('0x4d')](_0x3c2063[_0x6e70('0x44')],_0x2b51f4[_0x6e70('0x45')]));if(_0x3c2063[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x1e87e1[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x1e87e1[_0x6e70('0x4f')],{'$or':_[_0x6e70('0x51')](_0x1e87e1['attributes'],function(_0x51a1d9){var _0x31e037={};_0x31e037[_0x51a1d9]={'$like':'%'+_0x3c2063['query'][_0x6e70('0x4e')]+'%'};return _0x31e037;})});}_0x1e87e1=_[_0x6e70('0x50')]({},_0x1e87e1,_0x3c2063[_0x6e70('0x55')]);return _0x32937c[_0x6e70('0x120')](_0x1e87e1);}})[_0x6e70('0x38')](function(_0x5ee7ff){if(_0x5ee7ff){_0x32f0d2=_0x5ee7ff[_0x6e70('0x48')];if(!_0x3c2063['query'][_0x6e70('0x49')]('nolimit')){_0x1e87e1[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x3c2063[_0x6e70('0x44')][_0x6e70('0x32')]);_0x1e87e1['offset']=qs['offset'](_0x3c2063[_0x6e70('0x44')][_0x6e70('0x31')]);}return _0x32937c['getAgents'](_0x1e87e1);}})[_0x6e70('0x38')](function(_0x5bcfcb){if(_0x5bcfcb){return _0x5bcfcb?{'count':_0x32f0d2,'rows':_0x5bcfcb}:null;}})[_0x6e70('0x38')](respondWithResult(_0x30bb34,null))[_0x6e70('0x2c')](handleError(_0x30bb34,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 8b16398..a049ac6 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 _0x5a63=['../../mysqldb','save','emit','hasOwnProperty','exports','events'];(function(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0x5a63,0xe3));var _0x35a6=function(_0x232a78,_0x59ff9a){_0x232a78=_0x232a78-0x0;var _0x5907eb=_0x5a63[_0x232a78];return _0x5907eb;};'use strict';var EventEmitter=require(_0x35a6('0x0'));var ChatWebsite=require(_0x35a6('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x35a6('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x308a05){return function(_0x3462ed,_0x7a89ee,_0x4c032d){ChatWebsiteEvents[_0x35a6('0x3')](_0x308a05+':'+_0x3462ed['id'],_0x3462ed);ChatWebsiteEvents['emit'](_0x308a05,_0x3462ed);_0x4c032d(null);};}for(var e in events){if(events[_0x35a6('0x4')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x35a6('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3edc=['ChatWebsite','setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0xb11bf1,_0x41cabc){var _0x31a74c=function(_0x30099f){while(--_0x30099f){_0xb11bf1['push'](_0xb11bf1['shift']());}};_0x31a74c(++_0x41cabc);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x26f00b,_0x12dda3){_0x26f00b=_0x26f00b-0x0;var _0x72284=_0x3edc[_0x26f00b];return _0x72284;};'use strict';var EventEmitter=require(_0xc3ed('0x0'));var ChatWebsite=require(_0xc3ed('0x1'))['db'][_0xc3ed('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc3ed('0x3')](0x0);var events={'afterCreate':_0xc3ed('0x4'),'afterUpdate':'update','afterDestroy':_0xc3ed('0x5')};function emitEvent(_0x47efb0){return function(_0x3519ab,_0x19d8dc,_0x106c5b){ChatWebsiteEvents[_0xc3ed('0x6')](_0x47efb0+':'+_0x3519ab['id'],_0x3519ab);ChatWebsiteEvents[_0xc3ed('0x6')](_0x47efb0,_0x3519ab);_0x106c5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xc3ed('0x7')](e,emitEvent(event));}}module[_0xc3ed('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 2821322..acd650c 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 _0x0834=['define','chat_websites','../../config/logger','api','./chatWebsite.attributes','exports'];(function(_0x37b9f7,_0x33e9a1){var _0x311feb=function(_0x4fc773){while(--_0x4fc773){_0x37b9f7['push'](_0x37b9f7['shift']());}};_0x311feb(++_0x33e9a1);}(_0x0834,0x18e));var _0x4083=function(_0x3bafe6,_0x3432b7){_0x3bafe6=_0x3bafe6-0x0;var _0x30bc43=_0x0834[_0x3bafe6];return _0x30bc43;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4083('0x0'))(_0x4083('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x4083('0x2'));module[_0x4083('0x3')]=function(_0x4e3837,_0x3579bb){return _0x4e3837[_0x4083('0x4')]('ChatWebsite',attributes,{'tableName':_0x4083('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e77=['chat_websites','util','moment','bluebird','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x1a5f88,_0x2a9310){var _0x35e95=function(_0x512b54){while(--_0x512b54){_0x1a5f88['push'](_0x1a5f88['shift']());}};_0x35e95(++_0x2a9310);}(_0x6e77,0xef));var _0x76e7=function(_0xd70515,_0x50cfb3){_0xd70515=_0xd70515-0x0;var _0x1e9a3a=_0x6e77[_0xd70515];return _0x1e9a3a;};'use strict';var _=require('lodash');var util=require(_0x76e7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x76e7('0x1'));var BPromise=require(_0x76e7('0x2'));var rp=require('request-promise');var attributes=require(_0x76e7('0x3'));module[_0x76e7('0x4')]=function(_0xcc6627,_0x5eb27e){return _0xcc6627['define'](_0x76e7('0x5'),attributes,{'tableName':_0x76e7('0x6'),'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 d981d6c..1f053bb 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 _0x9e8e=['code','message','result','lodash','util','moment','bluebird','ioredis','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x6c823,_0x3f5e35){var _0x1fda1b=function(_0x1eb5b5){while(--_0x1eb5b5){_0x6c823['push'](_0x6c823['shift']());}};_0x1fda1b(++_0x3f5e35);}(_0x9e8e,0x179));var _0xe9e8=function(_0xe6946,_0x8c96ef){_0xe6946=_0xe6946-0x0;var _0x372213=_0x9e8e[_0xe6946];return _0x372213;};'use strict';var _=require(_0xe9e8('0x0'));var util=require(_0xe9e8('0x1'));var moment=require(_0xe9e8('0x2'));var BPromise=require(_0xe9e8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9e8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe9e8('0x5'));var config=require('../../config/environment');var jayson=require(_0xe9e8('0x6'));var client=jayson[_0xe9e8('0x7')][_0xe9e8('0x8')]({'port':0x232a});config['redis']=_[_0xe9e8('0x9')](config[_0xe9e8('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9e8('0xb'))(new Redis(config[_0xe9e8('0xa')]));require(_0xe9e8('0xc'))['register'](socket);function respondWithRpcPromise(_0x583d48,_0x4bef65,_0x5ad8ae){return new BPromise(function(_0x10cd4b,_0x5e444b){return client['request'](_0x583d48,_0x5ad8ae)['then'](function(_0x49e8ce){logger[_0xe9e8('0xd')](_0xe9e8('0xe'),_0x4bef65,_0xe9e8('0xf'));logger[_0xe9e8('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4bef65,_0xe9e8('0xf'),JSON[_0xe9e8('0x11')](_0x49e8ce));if(_0x49e8ce[_0xe9e8('0x12')]){if(_0x49e8ce['error'][_0xe9e8('0x13')]===0x1f4){logger['error'](_0xe9e8('0xe'),_0x4bef65,_0x49e8ce[_0xe9e8('0x12')][_0xe9e8('0x14')]);return _0x5e444b(_0x49e8ce[_0xe9e8('0x12')][_0xe9e8('0x14')]);}logger['error'](_0xe9e8('0xe'),_0x4bef65,_0x49e8ce['error'][_0xe9e8('0x14')]);return _0x10cd4b(_0x49e8ce[_0xe9e8('0x12')]['message']);}else{logger[_0xe9e8('0xd')](_0xe9e8('0xe'),_0x4bef65,_0xe9e8('0xf'));_0x10cd4b(_0x49e8ce[_0xe9e8('0x15')]['message']);}})['catch'](function(_0x1d56b2){logger[_0xe9e8('0x12')](_0xe9e8('0xe'),_0x4bef65,_0x1d56b2);_0x5e444b(_0x1d56b2);});});} \ No newline at end of file +var _0x3308=['redis','localhost','socket.io-emitter','./chatWebsite.socket','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults'];(function(_0x45911f,_0x48cb93){var _0x13da7d=function(_0xa2b45e){while(--_0xa2b45e){_0x45911f['push'](_0x45911f['shift']());}};_0x13da7d(++_0x48cb93);}(_0x3308,0x160));var _0x8330=function(_0x3de55c,_0x10ead6){_0x3de55c=_0x3de55c-0x0;var _0x1cebec=_0x3308[_0x3de55c];return _0x1cebec;};'use strict';var _=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var moment=require(_0x8330('0x2'));var BPromise=require(_0x8330('0x3'));var rs=require(_0x8330('0x4'));var fs=require('fs');var Redis=require(_0x8330('0x5'));var db=require(_0x8330('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8330('0x7'));var config=require('../../config/environment');var jayson=require(_0x8330('0x8'));var client=jayson[_0x8330('0x9')][_0x8330('0xa')]({'port':0x232a});config['redis']=_[_0x8330('0xb')](config[_0x8330('0xc')],{'host':_0x8330('0xd'),'port':0x18eb});var socket=require(_0x8330('0xe'))(new Redis(config[_0x8330('0xc')]));require(_0x8330('0xf'))['register'](socket);function respondWithRpcPromise(_0x3033eb,_0x4291e5,_0xc80f4c){return new BPromise(function(_0x5ec516,_0x52522c){return client['request'](_0x3033eb,_0xc80f4c)['then'](function(_0x56e9af){logger['info'](_0x8330('0x10'),_0x4291e5,'request\x20sent');logger[_0x8330('0x11')](_0x8330('0x12'),_0x4291e5,_0x8330('0x13'),JSON[_0x8330('0x14')](_0x56e9af));if(_0x56e9af[_0x8330('0x15')]){if(_0x56e9af['error'][_0x8330('0x16')]===0x1f4){logger['error'](_0x8330('0x10'),_0x4291e5,_0x56e9af[_0x8330('0x15')][_0x8330('0x17')]);return _0x52522c(_0x56e9af[_0x8330('0x15')][_0x8330('0x17')]);}logger[_0x8330('0x15')](_0x8330('0x10'),_0x4291e5,_0x56e9af[_0x8330('0x15')][_0x8330('0x17')]);return _0x5ec516(_0x56e9af['error'][_0x8330('0x17')]);}else{logger[_0x8330('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x4291e5,_0x8330('0x13'));_0x5ec516(_0x56e9af[_0x8330('0x19')][_0x8330('0x17')]);}})['catch'](function(_0xca2672){logger['error'](_0x8330('0x10'),_0x4291e5,_0xca2672);_0x52522c(_0xca2672);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 66d8523..1eb062b 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 _0x7380=['removeListener','chatWebsite:','save','remove'];(function(_0x13fac4,_0x3ca5b9){var _0x3daa35=function(_0x562144){while(--_0x562144){_0x13fac4['push'](_0x13fac4['shift']());}};_0x3daa35(++_0x3ca5b9);}(_0x7380,0x172));var _0x0738=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x7380[_0x1fc122];return _0xa2cb13;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x0738('0x0'),_0x0738('0x1'),'update'];function createListener(_0x48479a,_0x151b00){return function(_0xdb7ed1){_0x151b00['emit'](_0x48479a,_0xdb7ed1);};}function removeListener(_0x235e91,_0x2ed2be){return function(){ChatWebsiteEvents[_0x0738('0x2')](_0x235e91,_0x2ed2be);};}exports['register']=function(_0x5eef50){for(var _0x53272=0x0,_0x2d20bb=events['length'];_0x53272<_0x2d20bb;_0x53272++){var _0x5820db=events[_0x53272];var _0x14789c=createListener(_0x0738('0x3')+_0x5820db,_0x5eef50);ChatWebsiteEvents['on'](_0x5820db,_0x14789c);}}; \ No newline at end of file +var _0x50e5=['emit','removeListener','register','./chatWebsite.events','save','update'];(function(_0x2211b2,_0x3c32a7){var _0x1ff209=function(_0x9193ae){while(--_0x9193ae){_0x2211b2['push'](_0x2211b2['shift']());}};_0x1ff209(++_0x3c32a7);}(_0x50e5,0xb7));var _0x550e=function(_0x1fef59,_0x475e7b){_0x1fef59=_0x1fef59-0x0;var _0x31c220=_0x50e5[_0x1fef59];return _0x31c220;};'use strict';var ChatWebsiteEvents=require(_0x550e('0x0'));var events=[_0x550e('0x1'),'remove',_0x550e('0x2')];function createListener(_0x3e85ce,_0x3edf56){return function(_0x88d4bb){_0x3edf56[_0x550e('0x3')](_0x3e85ce,_0x88d4bb);};}function removeListener(_0x3f3a13,_0x78e6c5){return function(){ChatWebsiteEvents[_0x550e('0x4')](_0x3f3a13,_0x78e6c5);};}exports[_0x550e('0x5')]=function(_0x3d8c9b){for(var _0x863e3b=0x0,_0x41a221=events['length'];_0x863e3b<_0x41a221;_0x863e3b++){var _0x27ae27=events[_0x863e3b];var _0x20707a=createListener('chatWebsite:'+_0x27ae27,_0x3d8c9b);ChatWebsiteEvents['on'](_0x27ae27,_0x20707a);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 5b7cfe1..c3f131b 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 _0x2b37=['addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','server/files/images/avatars/','now','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addApplications','update','delete','destroy','removeDispositions','/:id/users','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','get','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getAgents','post','create','addDisposition'];(function(_0x47888a,_0x7d2f3a){var _0x2b15a4=function(_0x12a3e9){while(--_0x12a3e9){_0x47888a['push'](_0x47888a['shift']());}};_0x2b15a4(++_0x7d2f3a);}(_0x2b37,0x12b));var _0x72b3=function(_0x21dce8,_0x14adba){_0x21dce8=_0x21dce8-0x0;var _0x34a5c9=_0x2b37[_0x21dce8];return _0x34a5c9;};'use strict';var multer=require(_0x72b3('0x0'));var util=require(_0x72b3('0x1'));var path=require(_0x72b3('0x2'));var timeout=require(_0x72b3('0x3'));var express=require(_0x72b3('0x4'));var router=express[_0x72b3('0x5')]();var auth=require(_0x72b3('0x6'));var interaction=require(_0x72b3('0x7'));var config=require(_0x72b3('0x8'));var controller=require(_0x72b3('0x9'));router['get']('/',auth[_0x72b3('0xa')](),controller[_0x72b3('0xb')]);router['get'](_0x72b3('0xc'),auth[_0x72b3('0xa')](),controller[_0x72b3('0xd')]);router['get'](_0x72b3('0xe'),auth[_0x72b3('0xa')](),controller[_0x72b3('0xf')]);router['get'](_0x72b3('0x10'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x11')]);router[_0x72b3('0x12')](_0x72b3('0x13'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x14')]);router['get'](_0x72b3('0x15'),controller[_0x72b3('0x16')]);router['get'](_0x72b3('0x17'),controller['getAvatar']);router['get'](_0x72b3('0x18'),controller[_0x72b3('0x19')]);router[_0x72b3('0x12')](_0x72b3('0x1a'),controller[_0x72b3('0x1b')]);router[_0x72b3('0x12')](_0x72b3('0x1c'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x1d')]);router[_0x72b3('0x12')](_0x72b3('0x1e'),controller['getSnippet']);router[_0x72b3('0x12')](_0x72b3('0x1f'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x20')]);router[_0x72b3('0x12')](_0x72b3('0x21'),auth[_0x72b3('0xa')](),controller['getProactiveActions']);router[_0x72b3('0x12')](_0x72b3('0x22'),controller[_0x72b3('0x23')]);router[_0x72b3('0x12')](_0x72b3('0x24'),auth[_0x72b3('0xa')](),controller['getOfflineMessages']);router[_0x72b3('0x12')]('/:id/users',auth[_0x72b3('0xa')](),controller[_0x72b3('0x25')]);router[_0x72b3('0x26')]('/',auth[_0x72b3('0xa')](),controller[_0x72b3('0x27')]);router['post']('/:id/dispositions',auth[_0x72b3('0xa')](),controller[_0x72b3('0x28')]);router[_0x72b3('0x26')](_0x72b3('0x13'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x29')]);var upload=multer({'storage':multer[_0x72b3('0x2a')]({'destination':function(_0x277cee,_0x5007de,_0x59763b){_0x59763b(null,path[_0x72b3('0x2b')](config[_0x72b3('0x2c')],_0x72b3('0x2d')));},'filename':function(_0x46e584,_0x3df948,_0x5509ad){_0x5509ad(null,util[_0x72b3('0x2e')](_0x72b3('0x2f'),Date['now'](),_0x3df948[_0x72b3('0x30')]));}})});router[_0x72b3('0x26')](_0x72b3('0x15'),upload['single'](_0x72b3('0x31')),controller[_0x72b3('0x32')]);var upload=multer({'storage':multer[_0x72b3('0x2a')]({'destination':function(_0x546dfd,_0xfa238c,_0x19afed){_0x19afed(null,path[_0x72b3('0x2b')](config[_0x72b3('0x2c')],_0x72b3('0x33')));},'filename':function(_0x1f2ec9,_0x354a39,_0xa3cd5){_0xa3cd5(null,util[_0x72b3('0x2e')]('%s-%s',Date[_0x72b3('0x34')](),_0x354a39[_0x72b3('0x30')]));}})});router[_0x72b3('0x26')]('/:id/avatar',upload['single'](_0x72b3('0x31')),controller[_0x72b3('0x35')]);var upload=multer({'storage':multer[_0x72b3('0x2a')]({'destination':function(_0x5c743f,_0x5bfea0,_0x4078bf){_0x4078bf(null,path[_0x72b3('0x2b')](config[_0x72b3('0x2c')],_0x72b3('0x33')));},'filename':function(_0x23ce77,_0x8b44c2,_0x440ce1){_0x440ce1(null,util[_0x72b3('0x2e')](_0x72b3('0x2f'),Date[_0x72b3('0x34')](),_0x8b44c2[_0x72b3('0x30')]));}})});router['post'](_0x72b3('0x18'),upload[_0x72b3('0x36')](_0x72b3('0x31')),controller[_0x72b3('0x37')]);var upload=multer({'storage':multer[_0x72b3('0x2a')]({'destination':function(_0x3b7f0e,_0x7a9d85,_0x574415){_0x574415(null,path[_0x72b3('0x2b')](config[_0x72b3('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x40d4b0,_0x57200c,_0x3c5257){_0x3c5257(null,util[_0x72b3('0x2e')](_0x72b3('0x2f'),Date['now'](),_0x57200c[_0x72b3('0x30')]));}})});router[_0x72b3('0x26')](_0x72b3('0x1a'),upload[_0x72b3('0x36')]('file'),controller[_0x72b3('0x38')]);router['post'](_0x72b3('0x39'),controller[_0x72b3('0x3a')]);router[_0x72b3('0x26')](_0x72b3('0x3b'),controller[_0x72b3('0x3c')]);router['post'](_0x72b3('0x1c'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x72b3('0x26')](_0x72b3('0x1f'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x3d')]);router[_0x72b3('0x26')]('/:id/proactive_actions',auth[_0x72b3('0xa')](),controller['addProactiveActions']);router[_0x72b3('0x26')]('/:id/users',auth[_0x72b3('0xa')](),controller['addAgents']);router['put'](_0x72b3('0xe'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x3e')]);router[_0x72b3('0x3f')](_0x72b3('0xe'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x40')]);router[_0x72b3('0x3f')](_0x72b3('0x10'),auth[_0x72b3('0xa')](),controller[_0x72b3('0x41')]);router[_0x72b3('0x3f')](_0x72b3('0x13'),auth[_0x72b3('0xa')](),controller['removeAnswers']);router['delete'](_0x72b3('0x42'),auth[_0x72b3('0xa')](),controller['removeAgents']);module[_0x72b3('0x43')]=router; \ No newline at end of file +var _0xbf5c=['/:id/users','addAgents','/:id','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','create','/:id/dispositions','addDisposition','diskStorage','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','join','server/files/images/avatars/','originalname','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/offline','/:id/interactions','addInteraction','addApplications','addProactiveActions'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xbf5c,0xb8));var _0xcbf5=function(_0xe4dfd4,_0x183e07){_0xe4dfd4=_0xe4dfd4-0x0;var _0x20ba0e=_0xbf5c[_0xe4dfd4];return _0x20ba0e;};'use strict';var multer=require(_0xcbf5('0x0'));var util=require(_0xcbf5('0x1'));var path=require(_0xcbf5('0x2'));var timeout=require('connect-timeout');var express=require(_0xcbf5('0x3'));var router=express[_0xcbf5('0x4')]();var auth=require(_0xcbf5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcbf5('0x6'));var controller=require(_0xcbf5('0x7'));router['get']('/',auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x9')]);router[_0xcbf5('0xa')]('/describe',auth[_0xcbf5('0x8')](),controller[_0xcbf5('0xb')]);router['get']('/:id',auth[_0xcbf5('0x8')](),controller[_0xcbf5('0xc')]);router[_0xcbf5('0xa')]('/:id/dispositions',auth[_0xcbf5('0x8')](),controller[_0xcbf5('0xd')]);router[_0xcbf5('0xa')](_0xcbf5('0xe'),auth[_0xcbf5('0x8')](),controller[_0xcbf5('0xf')]);router['get'](_0xcbf5('0x10'),controller[_0xcbf5('0x11')]);router[_0xcbf5('0xa')]('/:id/avatar',controller['getAvatar']);router[_0xcbf5('0xa')]('/:id/customer_avatar',controller[_0xcbf5('0x12')]);router[_0xcbf5('0xa')](_0xcbf5('0x13'),controller[_0xcbf5('0x14')]);router['get']('/:id/interactions',auth[_0xcbf5('0x8')](),controller['getInteractions']);router[_0xcbf5('0xa')]('/:id/snippet',controller['getSnippet']);router[_0xcbf5('0xa')](_0xcbf5('0x15'),auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x16')]);router[_0xcbf5('0xa')](_0xcbf5('0x17'),auth[_0xcbf5('0x8')](),controller['getProactiveActions']);router[_0xcbf5('0xa')](_0xcbf5('0x18'),controller[_0xcbf5('0x19')]);router[_0xcbf5('0xa')](_0xcbf5('0x1a'),auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x1b')]);router[_0xcbf5('0xa')]('/:id/users',auth[_0xcbf5('0x8')](),controller['getAgents']);router[_0xcbf5('0x1c')]('/',auth['isAuthenticated'](),controller[_0xcbf5('0x1d')]);router[_0xcbf5('0x1c')](_0xcbf5('0x1e'),auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x1f')]);router[_0xcbf5('0x1c')]('/:id/canned_answers',auth[_0xcbf5('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xcbf5('0x20')]({'destination':function(_0x1b59d4,_0x26477c,_0x27558a){_0x27558a(null,path['join'](config[_0xcbf5('0x21')],_0xcbf5('0x22')));},'filename':function(_0x2aa7c,_0x41d465,_0x1a2635){_0x1a2635(null,util[_0xcbf5('0x23')](_0xcbf5('0x24'),Date[_0xcbf5('0x25')](),_0x41d465['originalname']));}})});router[_0xcbf5('0x1c')](_0xcbf5('0x10'),upload[_0xcbf5('0x26')](_0xcbf5('0x27')),controller[_0xcbf5('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1293ab,_0x367eb0,_0x9ce00){_0x9ce00(null,path[_0xcbf5('0x29')](config[_0xcbf5('0x21')],_0xcbf5('0x2a')));},'filename':function(_0x4b22f3,_0x2d98d2,_0x399f50){_0x399f50(null,util[_0xcbf5('0x23')](_0xcbf5('0x24'),Date[_0xcbf5('0x25')](),_0x2d98d2[_0xcbf5('0x2b')]));}})});router[_0xcbf5('0x1c')]('/:id/avatar',upload['single'](_0xcbf5('0x27')),controller['addAvatar']);var upload=multer({'storage':multer[_0xcbf5('0x20')]({'destination':function(_0xabcfef,_0x738c3f,_0x324502){_0x324502(null,path[_0xcbf5('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x6c4f76,_0x186947,_0xc4e7eb){_0xc4e7eb(null,util[_0xcbf5('0x23')](_0xcbf5('0x24'),Date[_0xcbf5('0x25')](),_0x186947[_0xcbf5('0x2b')]));}})});router['post'](_0xcbf5('0x2c'),upload[_0xcbf5('0x26')](_0xcbf5('0x27')),controller[_0xcbf5('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4840fe,_0x3e180c,_0x5e9b36){_0x5e9b36(null,path[_0xcbf5('0x29')](config[_0xcbf5('0x21')],'server/files/images/avatars/'));},'filename':function(_0x534142,_0x287eac,_0xe57956){_0xe57956(null,util[_0xcbf5('0x23')](_0xcbf5('0x24'),Date['now'](),_0x287eac[_0xcbf5('0x2b')]));}})});router[_0xcbf5('0x1c')](_0xcbf5('0x13'),upload[_0xcbf5('0x26')]('file'),controller[_0xcbf5('0x2e')]);router[_0xcbf5('0x1c')]('/:id/notify',controller['notify']);router[_0xcbf5('0x1c')](_0xcbf5('0x2f'),controller['offline']);router[_0xcbf5('0x1c')](_0xcbf5('0x30'),auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x31')]);router[_0xcbf5('0x1c')]('/:id/applications',auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x32')]);router['post'](_0xcbf5('0x17'),auth['isAuthenticated'](),controller[_0xcbf5('0x33')]);router['post'](_0xcbf5('0x34'),auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x35')]);router['put'](_0xcbf5('0x36'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xcbf5('0x36'),auth['isAuthenticated'](),controller['destroy']);router[_0xcbf5('0x37')](_0xcbf5('0x1e'),auth['isAuthenticated'](),controller[_0xcbf5('0x38')]);router['delete'](_0xcbf5('0xe'),auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x39')]);router[_0xcbf5('0x37')](_0xcbf5('0x34'),auth[_0xcbf5('0x8')](),controller[_0xcbf5('0x3a')]);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 17e3c97..a73265c 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 _0x2e2d=['sequelize','exports','name','STRING'];(function(_0x4a0e4f,_0xd472aa){var _0x2ffa66=function(_0x3a9915){while(--_0x3a9915){_0x4a0e4f['push'](_0x4a0e4f['shift']());}};_0x2ffa66(++_0xd472aa);}(_0x2e2d,0x10c));var _0xd2e2=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x2e2d[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0xd2e2('0x0'));module[_0xd2e2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd2e2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd2e2('0x3')]},'companyId':{'type':Sequelize[_0xd2e2('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd2e2('0x3')]},'fax':{'type':Sequelize[_0xd2e2('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xd2e2('0x3')]},'postalCode':{'type':Sequelize[_0xd2e2('0x3')]},'city':{'type':Sequelize[_0xd2e2('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd2e2('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd2e2('0x3')]},'sPostalCode':{'type':Sequelize[_0xd2e2('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xd2e2('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0694=['exports','STRING','name','sequelize'];(function(_0x4ffa0b,_0x222f05){var _0xc22b29=function(_0x356891){while(--_0x356891){_0x4ffa0b['push'](_0x4ffa0b['shift']());}};_0xc22b29(++_0x222f05);}(_0x0694,0x1df));var _0x4069=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0694[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x4069('0x0'));module[_0x4069('0x1')]={'name':{'type':Sequelize[_0x4069('0x2')],'unique':_0x4069('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4069('0x2')]},'companyId':{'type':Sequelize[_0x4069('0x2')]},'website':{'type':Sequelize[_0x4069('0x2')]},'phone':{'type':Sequelize[_0x4069('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4069('0x2')]},'street':{'type':Sequelize[_0x4069('0x2')]},'postalCode':{'type':Sequelize[_0x4069('0x2')]},'city':{'type':Sequelize[_0x4069('0x2')]},'country':{'type':Sequelize[_0x4069('0x2')]},'email':{'type':Sequelize[_0x4069('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x4069('0x2')]},'sPostalCode':{'type':Sequelize[_0x4069('0x2')]},'sCity':{'type':Sequelize[_0x4069('0x2')]},'sCountry':{'type':Sequelize[_0x4069('0x2')]},'description':{'type':Sequelize[_0x4069('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index d23f32a..cecd72b 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 _0xef4b=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','destroy','end','stack','name','send','CmCompany','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','sort','where','map','type','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','update','params','CmContact','addContacts','ids','omit','order','pick','filter','options','getContacts','nolimit','html-pdf'];(function(_0x462b5b,_0x16ed50){var _0x5af19a=function(_0x57e221){while(--_0x57e221){_0x462b5b['push'](_0x462b5b['shift']());}};_0x5af19a(++_0x16ed50);}(_0xef4b,0x16b));var _0xbef4=function(_0x1f404a,_0x5088b2){_0x1f404a=_0x1f404a-0x0;var _0x2cdcd5=_0xef4b[_0x1f404a];return _0x2cdcd5;};'use strict';var pdf=require(_0xbef4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbef4('0x1'));var zipdir=require(_0xbef4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbef4('0x3'));var moment=require(_0xbef4('0x4'));var BPromise=require(_0xbef4('0x5'));var Mustache=require(_0xbef4('0x6'));var util=require(_0xbef4('0x7'));var path=require(_0xbef4('0x8'));var sox=require(_0xbef4('0x9'));var csv=require(_0xbef4('0xa'));var ejs=require(_0xbef4('0xb'));var fs=require('fs');var _=require(_0xbef4('0xc'));var squel=require(_0xbef4('0xd'));var crypto=require('crypto');var jsforce=require(_0xbef4('0xe'));var deskjs=require(_0xbef4('0xf'));var toCsv=require(_0xbef4('0xa'));var querystring=require(_0xbef4('0x10'));var Papa=require('papaparse');var authService=require(_0xbef4('0x11'));var hardwareService=require(_0xbef4('0x12'));var Redis=require(_0xbef4('0x13'));var qs=require(_0xbef4('0x14'));var logger=require(_0xbef4('0x15'))(_0xbef4('0x16'));var utils=require(_0xbef4('0x17'));var config=require(_0xbef4('0x18'));var db=require(_0xbef4('0x19'))['db'];function respondWithStatusCode(_0x4ffac9,_0x3a945f){_0x3a945f=_0x3a945f||0xcc;return function(_0x45c79a){if(_0x45c79a){return _0x4ffac9[_0xbef4('0x1a')](_0x3a945f);}return _0x4ffac9[_0xbef4('0x1b')](_0x3a945f)['end']();};}function respondWithResult(_0xd116db,_0x65c3ff){_0x65c3ff=_0x65c3ff||0xc8;return function(_0x5693b2){if(_0x5693b2){return _0xd116db[_0xbef4('0x1b')](_0x65c3ff)[_0xbef4('0x1c')](_0x5693b2);}};}function respondWithFilteredResult(_0x2d2b1e,_0x2c242f){return function(_0x1e3be4){if(_0x1e3be4){var _0x5e68c1=_0x1e3be4[_0xbef4('0x1d')],_0x447e1e=_0x2c242f[_0xbef4('0x1e')],_0x1f8674=_0x2c242f[_0xbef4('0x1e')]+_0x2c242f[_0xbef4('0x1f')],_0xe9ab3;if(_0x1f8674>=_0x5e68c1){_0x1f8674=_0x5e68c1;_0xe9ab3=0xc8;}else{_0xe9ab3=0xce;}_0x2d2b1e['status'](_0xe9ab3);return _0x2d2b1e['set'](_0xbef4('0x20'),_0x447e1e+'-'+_0x1f8674+'/'+_0x5e68c1)['json'](_0x1e3be4);}return null;};}function patchUpdates(_0x147672){return function(_0x476553){try{jsonpatch[_0xbef4('0x21')](_0x476553,_0x147672,!![]);}catch(_0x245568){return BPromise[_0xbef4('0x22')](_0x245568);}return _0x476553[_0xbef4('0x23')]();};}function saveUpdates(_0x42e284,_0x41798d){return function(_0x2ceaac){if(_0x2ceaac){return _0x2ceaac['update'](_0x42e284)[_0xbef4('0x24')](function(_0x35044d){return _0x35044d;});}return null;};}function removeEntity(_0x4cab7a,_0x2591fc){return function(_0xa072f7){if(_0xa072f7){return _0xa072f7['destroy']()['then'](function(){var _0xbe9835=_0xa072f7[_0xbef4('0x25')]({'plain':!![]});var _0x39e4fa=_0xbef4('0x26');return db[_0xbef4('0x27')][_0xbef4('0x28')]({'where':{'type':_0x39e4fa,'resourceId':_0xbe9835['id']}})['then'](function(){return _0xa072f7;});})[_0xbef4('0x24')](function(){_0x4cab7a[_0xbef4('0x1b')](0xcc)[_0xbef4('0x29')]();});}};}function handleEntityNotFound(_0x45e699,_0x42cbdc){return function(_0x4f391f){if(!_0x4f391f){_0x45e699[_0xbef4('0x1a')](0x194);}return _0x4f391f;};}function handleError(_0x37bb4a,_0x2cdfe6){_0x2cdfe6=_0x2cdfe6||0x1f4;return function(_0x1f5a1f){logger['error'](_0x1f5a1f[_0xbef4('0x2a')]);if(_0x1f5a1f['name']){delete _0x1f5a1f[_0xbef4('0x2b')];}_0x37bb4a[_0xbef4('0x1b')](_0x2cdfe6)[_0xbef4('0x2c')](_0x1f5a1f);};}exports['index']=function(_0x40a908,_0xfd430d){var _0x48e0b4={},_0x193a67={},_0x26faec={'count':0x0,'rows':[]};var _0x3b057f=db[_0xbef4('0x2d')][_0xbef4('0x2e')];_0x193a67[_0xbef4('0x2f')]=_[_0xbef4('0x30')](_0x3b057f);_0x193a67['query']=_['keys'](_0x40a908[_0xbef4('0x31')]);_0x193a67[_0xbef4('0x32')]=_['intersection'](_0x193a67[_0xbef4('0x2f')],_0x193a67[_0xbef4('0x31')]);_0x48e0b4[_0xbef4('0x33')]=_[_0xbef4('0x34')](_0x193a67[_0xbef4('0x2f')],qs[_0xbef4('0x35')](_0x40a908['query'][_0xbef4('0x35')]));_0x48e0b4[_0xbef4('0x33')]=_0x48e0b4[_0xbef4('0x33')][_0xbef4('0x36')]?_0x48e0b4[_0xbef4('0x33')]:_0x193a67[_0xbef4('0x2f')];if(!_0x40a908[_0xbef4('0x31')]['hasOwnProperty']('nolimit')){_0x48e0b4[_0xbef4('0x1f')]=qs[_0xbef4('0x1f')](_0x40a908[_0xbef4('0x31')][_0xbef4('0x1f')]);_0x48e0b4[_0xbef4('0x1e')]=qs[_0xbef4('0x1e')](_0x40a908[_0xbef4('0x31')]['offset']);}_0x48e0b4['order']=qs[_0xbef4('0x37')](_0x40a908[_0xbef4('0x31')][_0xbef4('0x37')]);_0x48e0b4['where']=qs[_0xbef4('0x32')](_['pick'](_0x40a908[_0xbef4('0x31')],_0x193a67[_0xbef4('0x32')]));if(_0x40a908[_0xbef4('0x31')]['filter']){_0x48e0b4[_0xbef4('0x38')]=_['merge'](_0x48e0b4['where'],{'$or':_[_0xbef4('0x39')](_0x3b057f,function(_0x8f51f5){if(_0x8f51f5[_0xbef4('0x3a')][_0xbef4('0x3b')]!==_0xbef4('0x3c')){var _0x3707bb={};_0x3707bb[_0x8f51f5[_0xbef4('0x3d')]]={'$like':'%'+_0x40a908['query']['filter']+'%'};return _0x3707bb;}})});}_0x48e0b4=_[_0xbef4('0x3e')]({},_0x48e0b4,_0x40a908['options']);var _0x1241e3={'where':_0x48e0b4[_0xbef4('0x38')]};return db[_0xbef4('0x2d')][_0xbef4('0x1d')](_0x1241e3)[_0xbef4('0x24')](function(_0x47029e){_0x26faec[_0xbef4('0x1d')]=_0x47029e;if(_0x40a908['query'][_0xbef4('0x3f')]){_0x48e0b4[_0xbef4('0x40')]=[{'all':!![]}];}return db[_0xbef4('0x2d')][_0xbef4('0x41')](_0x48e0b4);})[_0xbef4('0x24')](function(_0x47b7f5){_0x26faec[_0xbef4('0x42')]=_0x47b7f5;return _0x26faec;})[_0xbef4('0x24')](respondWithFilteredResult(_0xfd430d,_0x48e0b4))[_0xbef4('0x43')](handleError(_0xfd430d,null));};exports[_0xbef4('0x44')]=function(_0x41d97e,_0x4887b6){var _0x4a0317={'raw':![],'where':{'id':_0x41d97e['params']['id']}},_0x4e0174={};_0x4e0174[_0xbef4('0x2f')]=_['keys'](db[_0xbef4('0x2d')][_0xbef4('0x2e')]);_0x4e0174['query']=_['keys'](_0x41d97e[_0xbef4('0x31')]);_0x4e0174['filters']=_[_0xbef4('0x34')](_0x4e0174[_0xbef4('0x2f')],_0x4e0174[_0xbef4('0x31')]);_0x4a0317['attributes']=_[_0xbef4('0x34')](_0x4e0174[_0xbef4('0x2f')],qs[_0xbef4('0x35')](_0x41d97e['query'][_0xbef4('0x35')]));_0x4a0317[_0xbef4('0x33')]=_0x4a0317['attributes'][_0xbef4('0x36')]?_0x4a0317[_0xbef4('0x33')]:_0x4e0174[_0xbef4('0x2f')];if(_0x41d97e['query'][_0xbef4('0x3f')]){_0x4a0317[_0xbef4('0x40')]=[{'all':!![]}];}_0x4a0317=_[_0xbef4('0x3e')]({},_0x4a0317,_0x41d97e['options']);return db[_0xbef4('0x2d')][_0xbef4('0x45')](_0x4a0317)['then'](handleEntityNotFound(_0x4887b6,null))['then'](respondWithResult(_0x4887b6,null))[_0xbef4('0x43')](handleError(_0x4887b6,null));};exports[_0xbef4('0x46')]=function(_0x1f55e5,_0x4d1fa1){return db[_0xbef4('0x2d')][_0xbef4('0x46')](_0x1f55e5[_0xbef4('0x47')],{})[_0xbef4('0x24')](function(_0x49b5c9){var _0x2b3da8=_0x1f55e5['user']['get']({'plain':!![]});if(!_0x2b3da8)throw new Error(_0xbef4('0x48'));if(_0x2b3da8[_0xbef4('0x49')]===_0xbef4('0x4a')){var _0x328418=_0x49b5c9[_0xbef4('0x25')]({'plain':!![]});var _0x6bbb50=_0xbef4('0x26');return db[_0xbef4('0x4b')][_0xbef4('0x45')]({'where':{'name':_0x6bbb50,'userProfileId':_0x2b3da8[_0xbef4('0x4c')]},'raw':!![]})[_0xbef4('0x24')](function(_0xe276c){if(_0xe276c&&_0xe276c[_0xbef4('0x4d')]===0x0){return db[_0xbef4('0x27')][_0xbef4('0x46')]({'name':_0x328418[_0xbef4('0x2b')],'resourceId':_0x328418['id'],'type':_0xe276c['name'],'sectionId':_0xe276c['id']},{})[_0xbef4('0x24')](function(){return _0x49b5c9;});}else{return _0x49b5c9;}})['catch'](function(_0x2f6cbc){logger[_0xbef4('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f6cbc);throw _0x2f6cbc;});}return _0x49b5c9;})[_0xbef4('0x24')](respondWithResult(_0x4d1fa1,0xc9))[_0xbef4('0x43')](handleError(_0x4d1fa1,null));};exports[_0xbef4('0x4f')]=function(_0x4b83d3,_0x459d24){if(_0x4b83d3[_0xbef4('0x47')]['id']){delete _0x4b83d3['body']['id'];}return db[_0xbef4('0x2d')][_0xbef4('0x45')]({'where':{'id':_0x4b83d3[_0xbef4('0x50')]['id']}})[_0xbef4('0x24')](handleEntityNotFound(_0x459d24,null))[_0xbef4('0x24')](saveUpdates(_0x4b83d3[_0xbef4('0x47')],null))['then'](respondWithResult(_0x459d24,null))['catch'](handleError(_0x459d24,null));};exports[_0xbef4('0x28')]=function(_0x1af836,_0x42d103){return db[_0xbef4('0x2d')][_0xbef4('0x45')]({'where':{'id':_0x1af836[_0xbef4('0x50')]['id']}})['then'](handleEntityNotFound(_0x42d103,null))[_0xbef4('0x24')](removeEntity(_0x42d103,null))[_0xbef4('0x43')](handleError(_0x42d103,null));};exports['addContacts']=function(_0x546883,_0x5916da,_0x3a88dc){return db[_0xbef4('0x51')][_0xbef4('0x45')]({'where':{'id':_0x546883['params']['id']}})[_0xbef4('0x24')](handleEntityNotFound(_0x5916da,null))[_0xbef4('0x24')](function(_0x9dbbae){if(_0x9dbbae){return _0x9dbbae[_0xbef4('0x52')](_0x546883[_0xbef4('0x47')][_0xbef4('0x53')],_[_0xbef4('0x54')](_0x546883[_0xbef4('0x47')],[_0xbef4('0x53'),'id'])||{});}})[_0xbef4('0x24')](respondWithResult(_0x5916da,null))['catch'](handleError(_0x5916da,null));};exports['getContacts']=function(_0x5cb4ba,_0x3598ba,_0x63ab61){var _0x47ef5c={};var _0x255ab3={};var _0x347570;var _0x1bb8ca;return db['CmCompany']['findOne']({'where':{'id':_0x5cb4ba['params']['id']}})[_0xbef4('0x24')](handleEntityNotFound(_0x3598ba,null))[_0xbef4('0x24')](function(_0x1a6f6b){if(_0x1a6f6b){_0x347570=_0x1a6f6b;_0x255ab3[_0xbef4('0x2f')]=_[_0xbef4('0x30')](db[_0xbef4('0x51')][_0xbef4('0x2e')]);_0x255ab3[_0xbef4('0x31')]=_['keys'](_0x5cb4ba[_0xbef4('0x31')]);_0x255ab3['filters']=_[_0xbef4('0x34')](_0x255ab3[_0xbef4('0x2f')],_0x255ab3[_0xbef4('0x31')]);_0x47ef5c[_0xbef4('0x33')]=_[_0xbef4('0x34')](_0x255ab3['model'],qs[_0xbef4('0x35')](_0x5cb4ba[_0xbef4('0x31')][_0xbef4('0x35')]));_0x47ef5c['attributes']=_0x47ef5c['attributes'][_0xbef4('0x36')]?_0x47ef5c['attributes']:_0x255ab3[_0xbef4('0x2f')];_0x47ef5c[_0xbef4('0x55')]=qs[_0xbef4('0x37')](_0x5cb4ba[_0xbef4('0x31')][_0xbef4('0x37')]);_0x47ef5c[_0xbef4('0x38')]=qs[_0xbef4('0x32')](_[_0xbef4('0x56')](_0x5cb4ba[_0xbef4('0x31')],_0x255ab3[_0xbef4('0x32')]));if(_0x5cb4ba['query']['filter']){_0x47ef5c[_0xbef4('0x38')]=_[_0xbef4('0x3e')](_0x47ef5c[_0xbef4('0x38')],{'$or':_[_0xbef4('0x39')](_0x47ef5c[_0xbef4('0x33')],function(_0x49134d){var _0x1522a1={};_0x1522a1[_0x49134d]={'$like':'%'+_0x5cb4ba[_0xbef4('0x31')][_0xbef4('0x57')]+'%'};return _0x1522a1;})});}_0x47ef5c=_[_0xbef4('0x3e')]({},_0x47ef5c,_0x5cb4ba[_0xbef4('0x58')]);return _0x347570[_0xbef4('0x59')](_0x47ef5c);}})['then'](function(_0x13283a){if(_0x13283a){_0x1bb8ca=_0x13283a[_0xbef4('0x36')];if(!_0x5cb4ba[_0xbef4('0x31')]['hasOwnProperty'](_0xbef4('0x5a'))){_0x47ef5c[_0xbef4('0x1f')]=qs[_0xbef4('0x1f')](_0x5cb4ba[_0xbef4('0x31')][_0xbef4('0x1f')]);_0x47ef5c[_0xbef4('0x1e')]=qs[_0xbef4('0x1e')](_0x5cb4ba[_0xbef4('0x31')][_0xbef4('0x1e')]);}return _0x347570[_0xbef4('0x59')](_0x47ef5c);}})[_0xbef4('0x24')](function(_0x4c25be){if(_0x4c25be){return _0x4c25be?{'count':_0x1bb8ca,'rows':_0x4c25be}:null;}})['then'](respondWithResult(_0x3598ba,null))[_0xbef4('0x43')](handleError(_0x3598ba,null));}; \ No newline at end of file +var _0x880c=['error','stack','name','send','index','CmCompany','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','include','findAll','rows','catch','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','hasOwnProperty','html-pdf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','end'];(function(_0x238dbf,_0x3c380b){var _0x29eb43=function(_0x4a86ac){while(--_0x4a86ac){_0x238dbf['push'](_0x238dbf['shift']());}};_0x29eb43(++_0x3c380b);}(_0x880c,0x1ea));var _0xc880=function(_0x5ab5dd,_0x5929f4){_0x5ab5dd=_0x5ab5dd-0x0;var _0x6892d2=_0x880c[_0x5ab5dd];return _0x6892d2;};'use strict';var pdf=require(_0xc880('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc880('0x1'));var moment=require(_0xc880('0x2'));var BPromise=require(_0xc880('0x3'));var Mustache=require(_0xc880('0x4'));var util=require('util');var path=require(_0xc880('0x5'));var sox=require('sox');var csv=require(_0xc880('0x6'));var ejs=require(_0xc880('0x7'));var fs=require('fs');var _=require(_0xc880('0x8'));var squel=require(_0xc880('0x9'));var crypto=require(_0xc880('0xa'));var jsforce=require(_0xc880('0xb'));var deskjs=require(_0xc880('0xc'));var toCsv=require(_0xc880('0x6'));var querystring=require(_0xc880('0xd'));var Papa=require('papaparse');var authService=require(_0xc880('0xe'));var hardwareService=require(_0xc880('0xf'));var Redis=require(_0xc880('0x10'));var qs=require(_0xc880('0x11'));var logger=require(_0xc880('0x12'))(_0xc880('0x13'));var utils=require(_0xc880('0x14'));var config=require(_0xc880('0x15'));var db=require(_0xc880('0x16'))['db'];function respondWithStatusCode(_0x503f70,_0x1ee9d3){_0x1ee9d3=_0x1ee9d3||0xcc;return function(_0x171d8a){if(_0x171d8a){return _0x503f70['sendStatus'](_0x1ee9d3);}return _0x503f70[_0xc880('0x17')](_0x1ee9d3)['end']();};}function respondWithResult(_0xb21442,_0x1dfa8b){_0x1dfa8b=_0x1dfa8b||0xc8;return function(_0x23b6a2){if(_0x23b6a2){return _0xb21442[_0xc880('0x17')](_0x1dfa8b)[_0xc880('0x18')](_0x23b6a2);}};}function respondWithFilteredResult(_0x17d44a,_0xc2e9a0){return function(_0x4a879e){if(_0x4a879e){var _0xb2bb7=_0x4a879e[_0xc880('0x19')],_0x46893e=_0xc2e9a0[_0xc880('0x1a')],_0x2a630b=_0xc2e9a0[_0xc880('0x1a')]+_0xc2e9a0['limit'],_0x807483;if(_0x2a630b>=_0xb2bb7){_0x2a630b=_0xb2bb7;_0x807483=0xc8;}else{_0x807483=0xce;}_0x17d44a[_0xc880('0x17')](_0x807483);return _0x17d44a[_0xc880('0x1b')](_0xc880('0x1c'),_0x46893e+'-'+_0x2a630b+'/'+_0xb2bb7)['json'](_0x4a879e);}return null;};}function patchUpdates(_0x10492b){return function(_0x4ee2a0){try{jsonpatch[_0xc880('0x1d')](_0x4ee2a0,_0x10492b,!![]);}catch(_0x4143f6){return BPromise['reject'](_0x4143f6);}return _0x4ee2a0[_0xc880('0x1e')]();};}function saveUpdates(_0x15bb35,_0x235716){return function(_0x1c4d21){if(_0x1c4d21){return _0x1c4d21[_0xc880('0x1f')](_0x15bb35)[_0xc880('0x20')](function(_0x2886b3){return _0x2886b3;});}return null;};}function removeEntity(_0x4a654b,_0x4ab449){return function(_0x49bbba){if(_0x49bbba){return _0x49bbba[_0xc880('0x21')]()['then'](function(){var _0x3bfbcd=_0x49bbba[_0xc880('0x22')]({'plain':!![]});var _0x315002=_0xc880('0x23');return db[_0xc880('0x24')][_0xc880('0x21')]({'where':{'type':_0x315002,'resourceId':_0x3bfbcd['id']}})[_0xc880('0x20')](function(){return _0x49bbba;});})['then'](function(){_0x4a654b[_0xc880('0x17')](0xcc)[_0xc880('0x25')]();});}};}function handleEntityNotFound(_0x4b6e5e,_0x1384c1){return function(_0xb25b9a){if(!_0xb25b9a){_0x4b6e5e['sendStatus'](0x194);}return _0xb25b9a;};}function handleError(_0x2d8de2,_0x104bf0){_0x104bf0=_0x104bf0||0x1f4;return function(_0x5bd7d2){logger[_0xc880('0x26')](_0x5bd7d2[_0xc880('0x27')]);if(_0x5bd7d2[_0xc880('0x28')]){delete _0x5bd7d2[_0xc880('0x28')];}_0x2d8de2[_0xc880('0x17')](_0x104bf0)[_0xc880('0x29')](_0x5bd7d2);};}exports[_0xc880('0x2a')]=function(_0x24d008,_0x5cf18f){var _0x26256d={},_0x37341e={},_0x28b28e={'count':0x0,'rows':[]};var _0x107e6d=db[_0xc880('0x2b')][_0xc880('0x2c')];_0x37341e[_0xc880('0x2d')]=_[_0xc880('0x2e')](_0x107e6d);_0x37341e[_0xc880('0x2f')]=_[_0xc880('0x2e')](_0x24d008['query']);_0x37341e[_0xc880('0x30')]=_[_0xc880('0x31')](_0x37341e[_0xc880('0x2d')],_0x37341e[_0xc880('0x2f')]);_0x26256d[_0xc880('0x32')]=_[_0xc880('0x31')](_0x37341e[_0xc880('0x2d')],qs[_0xc880('0x33')](_0x24d008[_0xc880('0x2f')][_0xc880('0x33')]));_0x26256d[_0xc880('0x32')]=_0x26256d[_0xc880('0x32')][_0xc880('0x34')]?_0x26256d[_0xc880('0x32')]:_0x37341e['model'];if(!_0x24d008['query']['hasOwnProperty'](_0xc880('0x35'))){_0x26256d[_0xc880('0x36')]=qs[_0xc880('0x36')](_0x24d008[_0xc880('0x2f')][_0xc880('0x36')]);_0x26256d[_0xc880('0x1a')]=qs[_0xc880('0x1a')](_0x24d008[_0xc880('0x2f')][_0xc880('0x1a')]);}_0x26256d[_0xc880('0x37')]=qs['sort'](_0x24d008['query'][_0xc880('0x38')]);_0x26256d[_0xc880('0x39')]=qs[_0xc880('0x30')](_[_0xc880('0x3a')](_0x24d008[_0xc880('0x2f')],_0x37341e[_0xc880('0x30')]));if(_0x24d008[_0xc880('0x2f')][_0xc880('0x3b')]){_0x26256d[_0xc880('0x39')]=_['merge'](_0x26256d['where'],{'$or':_[_0xc880('0x3c')](_0x107e6d,function(_0x34019d){if(_0x34019d[_0xc880('0x3d')][_0xc880('0x3e')]!==_0xc880('0x3f')){var _0x2d58a1={};_0x2d58a1[_0x34019d[_0xc880('0x40')]]={'$like':'%'+_0x24d008[_0xc880('0x2f')][_0xc880('0x3b')]+'%'};return _0x2d58a1;}})});}_0x26256d=_[_0xc880('0x41')]({},_0x26256d,_0x24d008[_0xc880('0x42')]);var _0x995b27={'where':_0x26256d[_0xc880('0x39')]};return db[_0xc880('0x2b')]['count'](_0x995b27)['then'](function(_0x12de6f){_0x28b28e[_0xc880('0x19')]=_0x12de6f;if(_0x24d008[_0xc880('0x2f')]['includeAll']){_0x26256d[_0xc880('0x43')]=[{'all':!![]}];}return db[_0xc880('0x2b')][_0xc880('0x44')](_0x26256d);})[_0xc880('0x20')](function(_0x1dd5bd){_0x28b28e[_0xc880('0x45')]=_0x1dd5bd;return _0x28b28e;})[_0xc880('0x20')](respondWithFilteredResult(_0x5cf18f,_0x26256d))[_0xc880('0x46')](handleError(_0x5cf18f,null));};exports['show']=function(_0x3741a2,_0x32aba7){var _0x4151e9={'raw':![],'where':{'id':_0x3741a2[_0xc880('0x47')]['id']}},_0x16f1bd={};_0x16f1bd[_0xc880('0x2d')]=_[_0xc880('0x2e')](db[_0xc880('0x2b')][_0xc880('0x2c')]);_0x16f1bd[_0xc880('0x2f')]=_[_0xc880('0x2e')](_0x3741a2[_0xc880('0x2f')]);_0x16f1bd[_0xc880('0x30')]=_['intersection'](_0x16f1bd['model'],_0x16f1bd[_0xc880('0x2f')]);_0x4151e9['attributes']=_[_0xc880('0x31')](_0x16f1bd[_0xc880('0x2d')],qs[_0xc880('0x33')](_0x3741a2['query'][_0xc880('0x33')]));_0x4151e9['attributes']=_0x4151e9['attributes'][_0xc880('0x34')]?_0x4151e9[_0xc880('0x32')]:_0x16f1bd[_0xc880('0x2d')];if(_0x3741a2['query'][_0xc880('0x48')]){_0x4151e9[_0xc880('0x43')]=[{'all':!![]}];}_0x4151e9=_[_0xc880('0x41')]({},_0x4151e9,_0x3741a2[_0xc880('0x42')]);return db[_0xc880('0x2b')]['find'](_0x4151e9)['then'](handleEntityNotFound(_0x32aba7,null))[_0xc880('0x20')](respondWithResult(_0x32aba7,null))[_0xc880('0x46')](handleError(_0x32aba7,null));};exports[_0xc880('0x49')]=function(_0x1671cc,_0x2eed6e){return db[_0xc880('0x2b')][_0xc880('0x49')](_0x1671cc[_0xc880('0x4a')],{})[_0xc880('0x20')](function(_0x443de9){var _0x4f91bf=_0x1671cc['user'][_0xc880('0x22')]({'plain':!![]});if(!_0x4f91bf)throw new Error(_0xc880('0x4b'));if(_0x4f91bf[_0xc880('0x4c')]==='user'){var _0x271220=_0x443de9[_0xc880('0x22')]({'plain':!![]});var _0x2b08a5=_0xc880('0x23');return db[_0xc880('0x4d')][_0xc880('0x4e')]({'where':{'name':_0x2b08a5,'userProfileId':_0x4f91bf[_0xc880('0x4f')]},'raw':!![]})[_0xc880('0x20')](function(_0x342d8e){if(_0x342d8e&&_0x342d8e[_0xc880('0x50')]===0x0){return db['UserProfileResource'][_0xc880('0x49')]({'name':_0x271220[_0xc880('0x28')],'resourceId':_0x271220['id'],'type':_0x342d8e[_0xc880('0x28')],'sectionId':_0x342d8e['id']},{})[_0xc880('0x20')](function(){return _0x443de9;});}else{return _0x443de9;}})[_0xc880('0x46')](function(_0xb736b6){logger[_0xc880('0x26')](_0xc880('0x51'),_0xb736b6);throw _0xb736b6;});}return _0x443de9;})['then'](respondWithResult(_0x2eed6e,0xc9))[_0xc880('0x46')](handleError(_0x2eed6e,null));};exports[_0xc880('0x1f')]=function(_0x10eebc,_0x333ee8){if(_0x10eebc['body']['id']){delete _0x10eebc['body']['id'];}return db[_0xc880('0x2b')][_0xc880('0x4e')]({'where':{'id':_0x10eebc['params']['id']}})[_0xc880('0x20')](handleEntityNotFound(_0x333ee8,null))[_0xc880('0x20')](saveUpdates(_0x10eebc[_0xc880('0x4a')],null))[_0xc880('0x20')](respondWithResult(_0x333ee8,null))[_0xc880('0x46')](handleError(_0x333ee8,null));};exports['destroy']=function(_0x44c4f8,_0x3126c1){return db['CmCompany'][_0xc880('0x4e')]({'where':{'id':_0x44c4f8['params']['id']}})[_0xc880('0x20')](handleEntityNotFound(_0x3126c1,null))[_0xc880('0x20')](removeEntity(_0x3126c1,null))['catch'](handleError(_0x3126c1,null));};exports[_0xc880('0x52')]=function(_0x14f12d,_0x30ce99,_0x19e13d){return db[_0xc880('0x53')][_0xc880('0x4e')]({'where':{'id':_0x14f12d[_0xc880('0x47')]['id']}})['then'](handleEntityNotFound(_0x30ce99,null))[_0xc880('0x20')](function(_0x10b33d){if(_0x10b33d){return _0x10b33d[_0xc880('0x52')](_0x14f12d['body'][_0xc880('0x54')],_['omit'](_0x14f12d[_0xc880('0x4a')],['ids','id'])||{});}})['then'](respondWithResult(_0x30ce99,null))[_0xc880('0x46')](handleError(_0x30ce99,null));};exports[_0xc880('0x55')]=function(_0x11bd30,_0x9fe76b,_0x471e42){var _0x5aa1d0={};var _0x5d1b79={};var _0xffd919;var _0x408a10;return db[_0xc880('0x2b')][_0xc880('0x56')]({'where':{'id':_0x11bd30[_0xc880('0x47')]['id']}})[_0xc880('0x20')](handleEntityNotFound(_0x9fe76b,null))[_0xc880('0x20')](function(_0x5d7087){if(_0x5d7087){_0xffd919=_0x5d7087;_0x5d1b79[_0xc880('0x2d')]=_['keys'](db[_0xc880('0x53')][_0xc880('0x2c')]);_0x5d1b79[_0xc880('0x2f')]=_[_0xc880('0x2e')](_0x11bd30[_0xc880('0x2f')]);_0x5d1b79['filters']=_['intersection'](_0x5d1b79[_0xc880('0x2d')],_0x5d1b79[_0xc880('0x2f')]);_0x5aa1d0['attributes']=_['intersection'](_0x5d1b79[_0xc880('0x2d')],qs['fields'](_0x11bd30['query'][_0xc880('0x33')]));_0x5aa1d0[_0xc880('0x32')]=_0x5aa1d0['attributes'][_0xc880('0x34')]?_0x5aa1d0[_0xc880('0x32')]:_0x5d1b79['model'];_0x5aa1d0['order']=qs[_0xc880('0x38')](_0x11bd30[_0xc880('0x2f')][_0xc880('0x38')]);_0x5aa1d0['where']=qs[_0xc880('0x30')](_['pick'](_0x11bd30[_0xc880('0x2f')],_0x5d1b79[_0xc880('0x30')]));if(_0x11bd30[_0xc880('0x2f')][_0xc880('0x3b')]){_0x5aa1d0[_0xc880('0x39')]=_[_0xc880('0x41')](_0x5aa1d0[_0xc880('0x39')],{'$or':_[_0xc880('0x3c')](_0x5aa1d0['attributes'],function(_0x47d84f){var _0x525b8d={};_0x525b8d[_0x47d84f]={'$like':'%'+_0x11bd30[_0xc880('0x2f')][_0xc880('0x3b')]+'%'};return _0x525b8d;})});}_0x5aa1d0=_[_0xc880('0x41')]({},_0x5aa1d0,_0x11bd30[_0xc880('0x42')]);return _0xffd919[_0xc880('0x55')](_0x5aa1d0);}})[_0xc880('0x20')](function(_0x2ad85f){if(_0x2ad85f){_0x408a10=_0x2ad85f[_0xc880('0x34')];if(!_0x11bd30[_0xc880('0x2f')][_0xc880('0x57')](_0xc880('0x35'))){_0x5aa1d0[_0xc880('0x36')]=qs['limit'](_0x11bd30[_0xc880('0x2f')][_0xc880('0x36')]);_0x5aa1d0[_0xc880('0x1a')]=qs[_0xc880('0x1a')](_0x11bd30[_0xc880('0x2f')][_0xc880('0x1a')]);}return _0xffd919['getContacts'](_0x5aa1d0);}})[_0xc880('0x20')](function(_0xd205d6){if(_0xd205d6){return _0xd205d6?{'count':_0x408a10,'rows':_0xd205d6}:null;}})['then'](respondWithResult(_0x9fe76b,null))[_0xc880('0x46')](handleError(_0x9fe76b,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index dacbd79..afde16a 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 _0x2750=['request-promise','./cmCompany.attributes','exports','define','cm_companies','lodash','../../config/logger','api','moment','bluebird'];(function(_0x56568a,_0x25efcb){var _0x3eeb13=function(_0x2b6123){while(--_0x2b6123){_0x56568a['push'](_0x56568a['shift']());}};_0x3eeb13(++_0x25efcb);}(_0x2750,0x13b));var _0x0275=function(_0x29ec0e,_0x2094cc){_0x29ec0e=_0x29ec0e-0x0;var _0x2aef8c=_0x2750[_0x29ec0e];return _0x2aef8c;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var attributes=require(_0x0275('0x6'));module[_0x0275('0x7')]=function(_0x4960,_0x3d0c9c){return _0x4960[_0x0275('0x8')]('CmCompany',attributes,{'tableName':_0x0275('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda55=['bluebird','request-promise','./cmCompany.attributes','exports','CmCompany','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda55,0x6d));var _0x5da5=function(_0x1c83c2,_0x495560){_0x1c83c2=_0x1c83c2-0x0;var _0x3223d0=_0xda55[_0x1c83c2];return _0x3223d0;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var attributes=require(_0x5da5('0x5'));module[_0x5da5('0x6')]=function(_0x5da254,_0x3400e9){return _0x5da254['define'](_0x5da5('0x7'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 06f69e9..630b6f8 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 _0xb6b0=['randomstring','../../mysqldb','../../config/logger','jayson/promise','http','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','moment','bluebird'];(function(_0x43af74,_0x18ea36){var _0x427ae5=function(_0x13eca4){while(--_0x13eca4){_0x43af74['push'](_0x43af74['shift']());}};_0x427ae5(++_0x18ea36);}(_0xb6b0,0x6a));var _0x0b6b=function(_0x24c0ba,_0xb888ba){_0x24c0ba=_0x24c0ba-0x0;var _0x3a5dee=_0xb6b0[_0x24c0ba];return _0x3a5dee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b6b('0x0'));var BPromise=require(_0x0b6b('0x1'));var rs=require(_0x0b6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b6b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b6b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0b6b('0x5'));var client=jayson['client'][_0x0b6b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x16c1c4,_0x4e909c,_0x382d57){return new BPromise(function(_0xd9f299,_0x21ec4a){return client['request'](_0x16c1c4,_0x382d57)[_0x0b6b('0x7')](function(_0x322b00){logger[_0x0b6b('0x8')]('CmCompany,\x20%s,\x20%s',_0x4e909c,_0x0b6b('0x9'));logger['debug'](_0x0b6b('0xa'),_0x4e909c,'request\x20sent',JSON[_0x0b6b('0xb')](_0x322b00));if(_0x322b00['error']){if(_0x322b00[_0x0b6b('0xc')][_0x0b6b('0xd')]===0x1f4){logger[_0x0b6b('0xc')](_0x0b6b('0xe'),_0x4e909c,_0x322b00['error'][_0x0b6b('0xf')]);return _0x21ec4a(_0x322b00[_0x0b6b('0xc')][_0x0b6b('0xf')]);}logger[_0x0b6b('0xc')](_0x0b6b('0xe'),_0x4e909c,_0x322b00[_0x0b6b('0xc')][_0x0b6b('0xf')]);return _0xd9f299(_0x322b00[_0x0b6b('0xc')][_0x0b6b('0xf')]);}else{logger[_0x0b6b('0x8')](_0x0b6b('0xe'),_0x4e909c,_0x0b6b('0x9'));_0xd9f299(_0x322b00[_0x0b6b('0x10')][_0x0b6b('0xf')]);}})[_0x0b6b('0x11')](function(_0x443c47){logger[_0x0b6b('0xc')](_0x0b6b('0xe'),_0x4e909c,_0x443c47);_0x21ec4a(_0x443c47);});});} \ No newline at end of file +var _0x219c=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x22b8f2,_0x29b187){var _0x4a9f82=function(_0x1f8f4a){while(--_0x1f8f4a){_0x22b8f2['push'](_0x22b8f2['shift']());}};_0x4a9f82(++_0x29b187);}(_0x219c,0xa9));var _0xc219=function(_0xd29fc3,_0x1c7cf6){_0xd29fc3=_0xd29fc3-0x0;var _0x4ba981=_0x219c[_0xd29fc3];return _0x4ba981;};'use strict';var _=require(_0xc219('0x0'));var util=require(_0xc219('0x1'));var moment=require(_0xc219('0x2'));var BPromise=require(_0xc219('0x3'));var rs=require(_0xc219('0x4'));var fs=require('fs');var Redis=require(_0xc219('0x5'));var db=require(_0xc219('0x6'))['db'];var utils=require(_0xc219('0x7'));var logger=require('../../config/logger')(_0xc219('0x8'));var config=require(_0xc219('0x9'));var jayson=require(_0xc219('0xa'));var client=jayson[_0xc219('0xb')][_0xc219('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54b700,_0x578846,_0x4e5f0e){return new BPromise(function(_0x3f57cb,_0x345bd8){return client[_0xc219('0xd')](_0x54b700,_0x4e5f0e)['then'](function(_0x4548eb){logger[_0xc219('0xe')](_0xc219('0xf'),_0x578846,_0xc219('0x10'));logger[_0xc219('0x11')](_0xc219('0x12'),_0x578846,_0xc219('0x10'),JSON[_0xc219('0x13')](_0x4548eb));if(_0x4548eb[_0xc219('0x14')]){if(_0x4548eb[_0xc219('0x14')][_0xc219('0x15')]===0x1f4){logger[_0xc219('0x14')](_0xc219('0xf'),_0x578846,_0x4548eb[_0xc219('0x14')][_0xc219('0x16')]);return _0x345bd8(_0x4548eb[_0xc219('0x14')][_0xc219('0x16')]);}logger[_0xc219('0x14')](_0xc219('0xf'),_0x578846,_0x4548eb[_0xc219('0x14')][_0xc219('0x16')]);return _0x3f57cb(_0x4548eb[_0xc219('0x14')]['message']);}else{logger[_0xc219('0xe')](_0xc219('0xf'),_0x578846,_0xc219('0x10'));_0x3f57cb(_0x4548eb[_0xc219('0x17')]['message']);}})[_0xc219('0x18')](function(_0x2c3aed){logger[_0xc219('0x14')](_0xc219('0xf'),_0x578846,_0x2c3aed);_0x345bd8(_0x2c3aed);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index dab500f..c55235b 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 _0xe04b=['post','addContacts','put','update','delete','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','/:id/contacts','getContacts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe04b,0x1c8));var _0xbe04=function(_0x26fc18,_0x117bde){_0x26fc18=_0x26fc18-0x0;var _0x2ec2e7=_0xe04b[_0x26fc18];return _0x2ec2e7;};'use strict';var multer=require(_0xbe04('0x0'));var util=require(_0xbe04('0x1'));var path=require('path');var timeout=require(_0xbe04('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xbe04('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbe04('0x4'));var controller=require(_0xbe04('0x5'));router[_0xbe04('0x6')]('/',auth[_0xbe04('0x7')](),controller[_0xbe04('0x8')]);router[_0xbe04('0x6')](_0xbe04('0x9'),auth[_0xbe04('0x7')](),controller['show']);router[_0xbe04('0x6')](_0xbe04('0xa'),auth[_0xbe04('0x7')](),controller[_0xbe04('0xb')]);router[_0xbe04('0xc')]('/',auth[_0xbe04('0x7')](),controller['create']);router[_0xbe04('0xc')](_0xbe04('0xa'),auth[_0xbe04('0x7')](),controller[_0xbe04('0xd')]);router[_0xbe04('0xe')](_0xbe04('0x9'),auth[_0xbe04('0x7')](),controller[_0xbe04('0xf')]);router[_0xbe04('0x10')](_0xbe04('0x9'),auth[_0xbe04('0x7')](),controller['destroy']);module[_0xbe04('0x11')]=router; \ No newline at end of file +var _0x27af=['/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','/:id','get'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x27af,0x1d5));var _0xf27a=function(_0x28a31f,_0x40a601){_0x28a31f=_0x28a31f-0x0;var _0x30e4fe=_0x27af[_0x28a31f];return _0x30e4fe;};'use strict';var multer=require('multer');var util=require(_0xf27a('0x0'));var path=require(_0xf27a('0x1'));var timeout=require('connect-timeout');var express=require(_0xf27a('0x2'));var router=express[_0xf27a('0x3')]();var auth=require(_0xf27a('0x4'));var interaction=require(_0xf27a('0x5'));var config=require(_0xf27a('0x6'));var controller=require(_0xf27a('0x7'));router['get']('/',auth[_0xf27a('0x8')](),controller['index']);router['get'](_0xf27a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xf27a('0xa')](_0xf27a('0xb'),auth[_0xf27a('0x8')](),controller[_0xf27a('0xc')]);router[_0xf27a('0xd')]('/',auth[_0xf27a('0x8')](),controller['create']);router[_0xf27a('0xd')](_0xf27a('0xb'),auth[_0xf27a('0x8')](),controller[_0xf27a('0xe')]);router[_0xf27a('0xf')](_0xf27a('0x9'),auth[_0xf27a('0x8')](),controller[_0xf27a('0x10')]);router[_0xf27a('0x11')](_0xf27a('0x9'),auth[_0xf27a('0x8')](),controller[_0xf27a('0x12')]);module[_0xf27a('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 0822947..6bd1ce6 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 _0x0855=['exports','STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize'];(function(_0x35108f,_0x4ecd1a){var _0x5f3cec=function(_0x66be48){while(--_0x66be48){_0x35108f['push'](_0x35108f['shift']());}};_0x5f3cec(++_0x4ecd1a);}(_0x0855,0xce));var _0x5085=function(_0x259ee5,_0x2b5109){_0x259ee5=_0x259ee5-0x0;var _0x1aa9cb=_0x0855[_0x259ee5];return _0x1aa9cb;};'use strict';var _=require(_0x5085('0x0'));var Sequelize=require(_0x5085('0x1'));module[_0x5085('0x2')]={'firstName':{'type':Sequelize[_0x5085('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5085('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5085('0x3')]},'city':{'type':Sequelize[_0x5085('0x3')]},'country':{'type':Sequelize[_0x5085('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5085('0x3')]},'description':{'type':Sequelize[_0x5085('0x4')]},'phone':{'type':Sequelize[_0x5085('0x3')]},'mobile':{'type':Sequelize[_0x5085('0x3')]},'fax':{'type':Sequelize[_0x5085('0x3')]},'email':{'type':Sequelize[_0x5085('0x3')]},'url':{'type':Sequelize[_0x5085('0x3')]},'facebook':{'type':Sequelize[_0x5085('0x3')]},'fb_data':{'type':Sequelize[_0x5085('0x3')]},'twitter':{'type':Sequelize[_0x5085('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x5085('0x3')]},'line':{'type':Sequelize[_0x5085('0x3')]},'wechat':{'type':Sequelize[_0x5085('0x3')]},'telegram':{'type':Sequelize[_0x5085('0x3')]},'UserId':{'type':Sequelize[_0x5085('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5085('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5085('0x7')]}}; \ No newline at end of file +var _0x5e73=['exports','STRING','TEXT','INTEGER','lodash','sequelize'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0x5e73,0xc4));var _0x35e7=function(_0xcfbb97,_0x3ba3c8){_0xcfbb97=_0xcfbb97-0x0;var _0x5bc0b7=_0x5e73[_0xcfbb97];return _0x5bc0b7;};'use strict';var _=require(_0x35e7('0x0'));var Sequelize=require(_0x35e7('0x1'));module[_0x35e7('0x2')]={'firstName':{'type':Sequelize[_0x35e7('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x35e7('0x3')]},'street':{'type':Sequelize[_0x35e7('0x3')]},'postalCode':{'type':Sequelize[_0x35e7('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x35e7('0x3')]},'description':{'type':Sequelize[_0x35e7('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x35e7('0x3')]},'fax':{'type':Sequelize[_0x35e7('0x3')]},'email':{'type':Sequelize[_0x35e7('0x3')]},'url':{'type':Sequelize[_0x35e7('0x3')]},'facebook':{'type':Sequelize[_0x35e7('0x3')]},'fb_data':{'type':Sequelize[_0x35e7('0x3')]},'twitter':{'type':Sequelize[_0x35e7('0x3')]},'skype':{'type':Sequelize[_0x35e7('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x35e7('0x3')]},'line':{'type':Sequelize[_0x35e7('0x3')]},'wechat':{'type':Sequelize[_0x35e7('0x3')]},'telegram':{'type':Sequelize[_0x35e7('0x3')]},'UserId':{'type':Sequelize[_0x35e7('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'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 947057a..31e395f 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 _0x2d81=['CmHopperHistory','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','import','agent','binding','firstName','stringify','message','start\x20child\x20process\x20correctly!','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','register','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmContact','describe','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','map','options','include','tag','push','Tag','distinct','includeAll','color','findAll','rows','catch','find','startsWith','cf_','columnName','displayName','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','body','CmHopper','from','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','create','bulkCreate','each','duplicates','findOrCreate','spread','show','params','Tags','get','ListId','$and','CmCustomField','omit','format','cf_%d','pickBy','isEmpty','table','cm_contacts','id\x20=\x20?','toParam','sequelize','values','phone','getTags','rawAttributes','order','pick','nolimit','setTags','findOne','ids','ContactId','getHopperHistories'];(function(_0x4b1289,_0x4809c0){var _0x24157c=function(_0x455148){while(--_0x455148){_0x4b1289['push'](_0x4b1289['shift']());}};_0x24157c(++_0x4809c0);}(_0x2d81,0xcf));var _0x12d8=function(_0x8a749d,_0x444b52){_0x8a749d=_0x8a749d-0x0;var _0x3d5b1c=_0x2d81[_0x8a749d];return _0x3d5b1c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x12d8('0x0'));var rimraf=require(_0x12d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x12d8('0x2'));var moment=require(_0x12d8('0x3'));var BPromise=require(_0x12d8('0x4'));var Mustache=require(_0x12d8('0x5'));var util=require('util');var path=require(_0x12d8('0x6'));var sox=require(_0x12d8('0x7'));var csv=require(_0x12d8('0x8'));var ejs=require(_0x12d8('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x12d8('0xa'));var deskjs=require(_0x12d8('0xb'));var toCsv=require(_0x12d8('0x8'));var querystring=require(_0x12d8('0xc'));var Papa=require(_0x12d8('0xd'));var authService=require(_0x12d8('0xe'));var hardwareService=require(_0x12d8('0xf'));var Redis=require(_0x12d8('0x10'));var qs=require(_0x12d8('0x11'));var logger=require(_0x12d8('0x12'))(_0x12d8('0x13'));var utils=require(_0x12d8('0x14'));var config=require(_0x12d8('0x15'));var db=require(_0x12d8('0x16'))['db'];config['redis']=_[_0x12d8('0x17')](config[_0x12d8('0x18')],{'host':_0x12d8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12d8('0x18')]));require('./cmContact.socket')[_0x12d8('0x1a')](socket);function respondWithStatusCode(_0x26902b,_0x30cf85){_0x30cf85=_0x30cf85||0xcc;return function(_0x1a91e5){if(_0x1a91e5){return _0x26902b['sendStatus'](_0x30cf85);}return _0x26902b[_0x12d8('0x1b')](_0x30cf85)[_0x12d8('0x1c')]();};}function respondWithResult(_0x4fdd13,_0x303bb5){_0x303bb5=_0x303bb5||0xc8;return function(_0x1f9187){if(_0x1f9187){return _0x4fdd13[_0x12d8('0x1b')](_0x303bb5)[_0x12d8('0x1d')](_0x1f9187);}};}function respondWithFilteredResult(_0x22d402,_0x20a9e6){return function(_0x4a036c){if(_0x4a036c){var _0x471071=_0x4a036c[_0x12d8('0x1e')],_0x44a5d1=_0x20a9e6[_0x12d8('0x1f')],_0x35f528=_0x20a9e6[_0x12d8('0x1f')]+_0x20a9e6[_0x12d8('0x20')],_0x49650e;if(_0x35f528>=_0x471071){_0x35f528=_0x471071;_0x49650e=0xc8;}else{_0x49650e=0xce;}_0x22d402['status'](_0x49650e);return _0x22d402[_0x12d8('0x21')]('Content-Range',_0x44a5d1+'-'+_0x35f528+'/'+_0x471071)[_0x12d8('0x1d')](_0x4a036c);}return null;};}function patchUpdates(_0x1b294e){return function(_0x23b1c5){try{jsonpatch[_0x12d8('0x22')](_0x23b1c5,_0x1b294e,!![]);}catch(_0x283548){return BPromise[_0x12d8('0x23')](_0x283548);}return _0x23b1c5[_0x12d8('0x24')]();};}function saveUpdates(_0x3022c4,_0x48a519){return function(_0x5e5b4c){if(_0x5e5b4c){return _0x5e5b4c[_0x12d8('0x25')](_0x3022c4)[_0x12d8('0x26')](function(_0x5b2b51){return _0x5b2b51;});}return null;};}function removeEntity(_0x40f8a1,_0x4ceee0){return function(_0x4ff1ac){if(_0x4ff1ac){return _0x4ff1ac[_0x12d8('0x27')]()[_0x12d8('0x26')](function(){_0x40f8a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x431640,_0x377a56){return function(_0x184771){if(!_0x184771){_0x431640['sendStatus'](0x194);}return _0x184771;};}function handleError(_0x4c72f6,_0x600d06){_0x600d06=_0x600d06||0x1f4;return function(_0x318a21){logger[_0x12d8('0x28')](_0x318a21[_0x12d8('0x29')]);if(_0x318a21[_0x12d8('0x2a')]){delete _0x318a21['name'];}_0x4c72f6['status'](_0x600d06)[_0x12d8('0x2b')](_0x318a21);};}exports[_0x12d8('0x2c')]=function(_0x4cd80c,_0x399bcd){var _0x5e0321={},_0x18318c={},_0x205d77={'count':0x0,'rows':[]};return db[_0x12d8('0x2d')][_0x12d8('0x2e')]()[_0x12d8('0x26')](function(_0x2c7e16){_0x18318c['model']=_[_0x12d8('0x2f')](_0x2c7e16);_0x18318c[_0x12d8('0x30')]=_['keys'](_0x4cd80c[_0x12d8('0x30')]);_0x18318c[_0x12d8('0x31')]=_['intersection'](_0x18318c[_0x12d8('0x32')],_0x18318c[_0x12d8('0x30')]);_0x5e0321[_0x12d8('0x33')]=_[_0x12d8('0x34')](_0x18318c['model'],qs[_0x12d8('0x35')](_0x4cd80c['query'][_0x12d8('0x35')]));_0x5e0321[_0x12d8('0x33')]=_0x5e0321[_0x12d8('0x33')][_0x12d8('0x36')]?_0x5e0321[_0x12d8('0x33')]:_0x18318c['model'];if(!_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x37')]('nolimit')){_0x5e0321[_0x12d8('0x20')]=qs[_0x12d8('0x20')](_0x4cd80c['query']['limit']);_0x5e0321['offset']=qs[_0x12d8('0x1f')](_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x1f')]);}_0x5e0321['order']=qs[_0x12d8('0x38')](_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x38')]);_0x5e0321[_0x12d8('0x39')]=qs[_0x12d8('0x31')](_['pick'](_0x4cd80c[_0x12d8('0x30')],_0x18318c[_0x12d8('0x31')]));if(_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x3a')]){_0x5e0321[_0x12d8('0x39')]=_[_0x12d8('0x3b')](_0x5e0321['where'],{'$or':_[_0x12d8('0x3c')](_0x5e0321[_0x12d8('0x33')],function(_0x1fc187){var _0x297d6b={};_0x297d6b[_0x1fc187]={'$like':'%'+_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x3a')]+'%'};return _0x297d6b;})});}_0x5e0321=_['merge']({},_0x5e0321,_0x4cd80c[_0x12d8('0x3d')]);var _0x4692aa={'where':_0x5e0321[_0x12d8('0x39')]};_0x4692aa[_0x12d8('0x3e')]=[];if(_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x3f')]){_0x4692aa['include'][_0x12d8('0x40')]({'model':db[_0x12d8('0x41')],'as':'Tags','attributes':['id'],'where':{'id':_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x3f')]},'required':!![]});_0x4692aa[_0x12d8('0x42')]=!![];}return db[_0x12d8('0x2d')][_0x12d8('0x1e')](_0x4692aa)[_0x12d8('0x26')](function(_0x47b570){_0x205d77[_0x12d8('0x1e')]=_0x47b570;if(_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x43')]){_0x5e0321[_0x12d8('0x3e')]=[{'model':db[_0x12d8('0x41')],'as':'Tags','attributes':['id',_0x12d8('0x2a'),_0x12d8('0x44')],'required':_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x3f')]?!![]:![]},{'model':db[_0x12d8('0x41')],'as':'ThroughTags','attributes':['id','name',_0x12d8('0x44')],'through':_0x4cd80c[_0x12d8('0x30')]['tag']?{'attributes':[],'where':{'TagId':_0x4cd80c[_0x12d8('0x30')]['tag']||undefined}}:{},'required':_0x4cd80c[_0x12d8('0x30')][_0x12d8('0x3f')]?!![]:![]}];}return db[_0x12d8('0x2d')][_0x12d8('0x45')](_0x5e0321);})[_0x12d8('0x26')](function(_0x54b81e){_0x205d77[_0x12d8('0x46')]=_0x54b81e;return _0x205d77;})[_0x12d8('0x26')](respondWithFilteredResult(_0x399bcd,_0x5e0321))[_0x12d8('0x47')](handleError(_0x399bcd,null));});};exports[_0x12d8('0x27')]=function(_0x1328a6,_0x14b17a){return db[_0x12d8('0x2d')][_0x12d8('0x48')]({'where':{'id':_0x1328a6['params']['id']}})['then'](handleEntityNotFound(_0x14b17a,null))[_0x12d8('0x26')](removeEntity(_0x14b17a,null))[_0x12d8('0x47')](handleError(_0x14b17a,null));};exports[_0x12d8('0x2e')]=function(_0x343c03,_0x55b1e6){return db[_0x12d8('0x2d')][_0x12d8('0x2e')]()[_0x12d8('0x26')](function(_0x50e69a){for(var _0x3e7197=0x0;_0x3e7197=_0xbfcb67){_0x18810e=_0xbfcb67;_0x28ed1b=0xc8;}else{_0x28ed1b=0xce;}_0x2626e5['status'](_0x28ed1b);return _0x2626e5[_0x82e7('0x25')](_0x82e7('0x26'),_0x595146+'-'+_0x18810e+'/'+_0xbfcb67)[_0x82e7('0x21')](_0x83d583);}return null;};}function patchUpdates(_0x18d186){return function(_0x1eaf6b){try{jsonpatch['apply'](_0x1eaf6b,_0x18d186,!![]);}catch(_0x4ce4c6){return BPromise['reject'](_0x4ce4c6);}return _0x1eaf6b[_0x82e7('0x27')]();};}function saveUpdates(_0x5bf310,_0x53e8fc){return function(_0x4ba01b){if(_0x4ba01b){return _0x4ba01b[_0x82e7('0x28')](_0x5bf310)[_0x82e7('0x29')](function(_0xf55b0f){return _0xf55b0f;});}return null;};}function removeEntity(_0xca0c10,_0x19529e){return function(_0x399e11){if(_0x399e11){return _0x399e11['destroy']()[_0x82e7('0x29')](function(){_0xca0c10['status'](0xcc)[_0x82e7('0x2a')]();});}};}function handleEntityNotFound(_0x27419a,_0x199d77){return function(_0x551d32){if(!_0x551d32){_0x27419a[_0x82e7('0x1f')](0x194);}return _0x551d32;};}function handleError(_0x163d76,_0x3a177d){_0x3a177d=_0x3a177d||0x1f4;return function(_0x5a5758){logger[_0x82e7('0x2b')](_0x5a5758[_0x82e7('0x2c')]);if(_0x5a5758['name']){delete _0x5a5758[_0x82e7('0x2d')];}_0x163d76[_0x82e7('0x20')](_0x3a177d)[_0x82e7('0x2e')](_0x5a5758);};}exports[_0x82e7('0x2f')]=function(_0x2fd504,_0x318e0e){var _0x3d44f9={},_0x35f25f={},_0x1c0017={'count':0x0,'rows':[]};return db[_0x82e7('0x30')]['describe']()[_0x82e7('0x29')](function(_0x8f2c0e){_0x35f25f['model']=_[_0x82e7('0x31')](_0x8f2c0e);_0x35f25f['query']=_[_0x82e7('0x31')](_0x2fd504[_0x82e7('0x32')]);_0x35f25f[_0x82e7('0x33')]=_[_0x82e7('0x34')](_0x35f25f[_0x82e7('0x35')],_0x35f25f['query']);_0x3d44f9[_0x82e7('0x36')]=_[_0x82e7('0x34')](_0x35f25f[_0x82e7('0x35')],qs[_0x82e7('0x37')](_0x2fd504['query'][_0x82e7('0x37')]));_0x3d44f9[_0x82e7('0x36')]=_0x3d44f9[_0x82e7('0x36')][_0x82e7('0x38')]?_0x3d44f9[_0x82e7('0x36')]:_0x35f25f['model'];if(!_0x2fd504[_0x82e7('0x32')][_0x82e7('0x39')](_0x82e7('0x3a'))){_0x3d44f9[_0x82e7('0x24')]=qs['limit'](_0x2fd504['query'][_0x82e7('0x24')]);_0x3d44f9['offset']=qs[_0x82e7('0x23')](_0x2fd504[_0x82e7('0x32')][_0x82e7('0x23')]);}_0x3d44f9[_0x82e7('0x3b')]=qs[_0x82e7('0x3c')](_0x2fd504['query'][_0x82e7('0x3c')]);_0x3d44f9['where']=qs[_0x82e7('0x33')](_[_0x82e7('0x3d')](_0x2fd504['query'],_0x35f25f[_0x82e7('0x33')]));if(_0x2fd504[_0x82e7('0x32')][_0x82e7('0x3e')]){_0x3d44f9[_0x82e7('0x3f')]=_['merge'](_0x3d44f9[_0x82e7('0x3f')],{'$or':_[_0x82e7('0x40')](_0x3d44f9[_0x82e7('0x36')],function(_0x1cfed7){var _0x9135b1={};_0x9135b1[_0x1cfed7]={'$like':'%'+_0x2fd504[_0x82e7('0x32')]['filter']+'%'};return _0x9135b1;})});}_0x3d44f9=_[_0x82e7('0x41')]({},_0x3d44f9,_0x2fd504[_0x82e7('0x42')]);var _0x3469c0={'where':_0x3d44f9[_0x82e7('0x3f')]};_0x3469c0['include']=[];if(_0x2fd504[_0x82e7('0x32')]['tag']){_0x3469c0[_0x82e7('0x43')][_0x82e7('0x44')]({'model':db[_0x82e7('0x45')],'as':'Tags','attributes':['id'],'where':{'id':_0x2fd504[_0x82e7('0x32')][_0x82e7('0x46')]},'required':!![]});_0x3469c0['distinct']=!![];}return db['CmContact'][_0x82e7('0x22')](_0x3469c0)[_0x82e7('0x29')](function(_0x2dd12d){_0x1c0017[_0x82e7('0x22')]=_0x2dd12d;if(_0x2fd504['query'][_0x82e7('0x47')]){_0x3d44f9[_0x82e7('0x43')]=[{'model':db[_0x82e7('0x45')],'as':'Tags','attributes':['id',_0x82e7('0x2d'),'color'],'required':_0x2fd504[_0x82e7('0x32')][_0x82e7('0x46')]?!![]:![]},{'model':db[_0x82e7('0x45')],'as':_0x82e7('0x48'),'attributes':['id',_0x82e7('0x2d'),_0x82e7('0x49')],'through':_0x2fd504[_0x82e7('0x32')][_0x82e7('0x46')]?{'attributes':[],'where':{'TagId':_0x2fd504['query'][_0x82e7('0x46')]||undefined}}:{},'required':_0x2fd504[_0x82e7('0x32')][_0x82e7('0x46')]?!![]:![]}];}return db[_0x82e7('0x30')][_0x82e7('0x4a')](_0x3d44f9);})[_0x82e7('0x29')](function(_0x24b483){_0x1c0017[_0x82e7('0x4b')]=_0x24b483;return _0x1c0017;})[_0x82e7('0x29')](respondWithFilteredResult(_0x318e0e,_0x3d44f9))[_0x82e7('0x4c')](handleError(_0x318e0e,null));});};exports['destroy']=function(_0x417ab8,_0x501cad){return db['CmContact'][_0x82e7('0x4d')]({'where':{'id':_0x417ab8[_0x82e7('0x4e')]['id']}})[_0x82e7('0x29')](handleEntityNotFound(_0x501cad,null))[_0x82e7('0x29')](removeEntity(_0x501cad,null))[_0x82e7('0x4c')](handleError(_0x501cad,null));};exports[_0x82e7('0x4f')]=function(_0x3c882f,_0x5d6664){return db[_0x82e7('0x30')][_0x82e7('0x4f')]()[_0x82e7('0x29')](function(_0x6b1531){for(var _0x13a021=0x0;_0x13a021{}\s\\|]/g,'-');_0x59b5a4(null,util['format'](_0xf482('0x1e'),path[_0xf482('0x1f')](_0x1e5f45[_0xf482('0x1c')],path[_0xf482('0x20')](_0x1e5f45[_0xf482('0x1c')])),Date[_0xf482('0x21')](),path[_0xf482('0x20')](_0x1e5f45['originalname'])));}})});router[_0xf482('0x16')](_0xf482('0x22'),upload[_0xf482('0x23')](_0xf482('0x24')),controller[_0xf482('0x25')]);var upload=multer({'storage':multer[_0xf482('0x1b')]({'destination':function(_0x52d060,_0x294db7,_0x5dee08){_0x5dee08(null,path[_0xf482('0x26')](config[_0xf482('0x27')],'server/files/tmp'));},'filename':function(_0x1aaa1e,_0x589184,_0x9cb67c){_0x589184[_0xf482('0x1c')]=_0x589184['originalname'][_0xf482('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9cb67c(null,util[_0xf482('0x28')]('%s-%s%s',path[_0xf482('0x1f')](_0x589184[_0xf482('0x1c')],path['extname'](_0x589184[_0xf482('0x1c')])),Date[_0xf482('0x21')](),path[_0xf482('0x20')](_0x589184['originalname'])));}})});router[_0xf482('0x16')]('/upload',upload['single'](_0xf482('0x24')),controller['upload']);router[_0xf482('0x16')]('/upload/:id',auth[_0xf482('0x8')](),controller['import']);router[_0xf482('0x29')]('/:id',auth[_0xf482('0x8')](),controller[_0xf482('0x2a')]);router['delete'](_0xf482('0xb'),auth[_0xf482('0x8')](),controller[_0xf482('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x91ec=['update','delete','multer','util','path','connect-timeout','Router','../../components/interaction/service','./cmContact.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/tags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','diskStorage','join','server/files/tmp','originalname','replace','basename','extname','now','/csv','single','file','format','%s-%s%s','/upload','upload','import','put'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x91ec,0x116));var _0xc91e=function(_0x55a4b2,_0x4a2f0a){_0x55a4b2=_0x55a4b2-0x0;var _0xddc47c=_0x91ec[_0x55a4b2];return _0xddc47c;};'use strict';var multer=require(_0xc91e('0x0'));var util=require(_0xc91e('0x1'));var path=require(_0xc91e('0x2'));var timeout=require(_0xc91e('0x3'));var express=require('express');var router=express[_0xc91e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc91e('0x5'));var config=require('../../config/environment');var controller=require(_0xc91e('0x6'));router[_0xc91e('0x7')]('/',auth['isAuthenticated'](),controller[_0xc91e('0x8')]);router[_0xc91e('0x7')](_0xc91e('0x9'),auth['isAuthenticated'](),controller[_0xc91e('0xa')]);router[_0xc91e('0x7')](_0xc91e('0xb'),auth[_0xc91e('0xc')](),controller[_0xc91e('0xd')]);router[_0xc91e('0x7')](_0xc91e('0xe'),auth['isAuthenticated'](),controller['getTags']);router[_0xc91e('0x7')](_0xc91e('0xf'),auth[_0xc91e('0xc')](),controller['getHoppers']);router[_0xc91e('0x7')](_0xc91e('0x10'),auth['isAuthenticated'](),controller[_0xc91e('0x11')]);router[_0xc91e('0x7')](_0xc91e('0x12'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xc91e('0x7')](_0xc91e('0x13'),auth[_0xc91e('0xc')](),controller[_0xc91e('0x14')]);router[_0xc91e('0x15')](_0xc91e('0x16'),auth[_0xc91e('0xc')](),controller[_0xc91e('0x17')]);router[_0xc91e('0x15')]('/',auth[_0xc91e('0xc')](),controller[_0xc91e('0x18')]);router[_0xc91e('0x15')](_0xc91e('0x19'),auth[_0xc91e('0xc')](),controller[_0xc91e('0x1a')]);router['post'](_0xc91e('0xe'),auth['isAuthenticated'](),controller['setTags']);var upload=multer({'storage':multer[_0xc91e('0x1b')]({'destination':function(_0x596fc9,_0x4e2bcc,_0x417cc5){_0x417cc5(null,path[_0xc91e('0x1c')](config['root'],_0xc91e('0x1d')));},'filename':function(_0xd40ccd,_0x2bdd07,_0x3fcf0f){_0x2bdd07[_0xc91e('0x1e')]=_0x2bdd07[_0xc91e('0x1e')][_0xc91e('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3fcf0f(null,util['format']('%s-%s%s',path[_0xc91e('0x20')](_0x2bdd07[_0xc91e('0x1e')],path[_0xc91e('0x21')](_0x2bdd07[_0xc91e('0x1e')])),Date[_0xc91e('0x22')](),path[_0xc91e('0x21')](_0x2bdd07[_0xc91e('0x1e')])));}})});router[_0xc91e('0x15')](_0xc91e('0x23'),upload[_0xc91e('0x24')](_0xc91e('0x25')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xc91e('0x1b')]({'destination':function(_0x1aca12,_0x138db4,_0x288b85){_0x288b85(null,path[_0xc91e('0x1c')](config['root'],'server/files/tmp'));},'filename':function(_0x1cf4ec,_0x21bcef,_0x323ec8){_0x21bcef[_0xc91e('0x1e')]=_0x21bcef[_0xc91e('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323ec8(null,util[_0xc91e('0x26')](_0xc91e('0x27'),path[_0xc91e('0x20')](_0x21bcef[_0xc91e('0x1e')],path[_0xc91e('0x21')](_0x21bcef['originalname'])),Date[_0xc91e('0x22')](),path['extname'](_0x21bcef[_0xc91e('0x1e')])));}})});router[_0xc91e('0x15')](_0xc91e('0x28'),upload['single'](_0xc91e('0x25')),controller[_0xc91e('0x29')]);router[_0xc91e('0x15')]('/upload/:id',auth[_0xc91e('0xc')](),controller[_0xc91e('0x2a')]);router[_0xc91e('0x2b')](_0xc91e('0xb'),auth['isAuthenticated'](),controller[_0xc91e('0x2c')]);router[_0xc91e('0x2d')](_0xc91e('0xb'),auth[_0xc91e('0xc')](),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 003b864..86a1745 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 _0x2d3e=['VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','select','values','isArray','setDataValue','BOOLEAN','sequelize','lodash','exports'];(function(_0x41ba6a,_0x4e4743){var _0x471956=function(_0x3d252f){while(--_0x3d252f){_0x41ba6a['push'](_0x41ba6a['shift']());}};_0x471956(++_0x4e4743);}(_0x2d3e,0x1ce));var _0xe2d3=function(_0x59f6fa,_0x201b35){_0x59f6fa=_0x59f6fa-0x0;var _0x274f7c=_0x2d3e[_0x59f6fa];return _0x274f7c;};'use strict';var Sequelize=require(_0xe2d3('0x0'));var _=require(_0xe2d3('0x1'));module[_0xe2d3('0x2')]={'name':{'type':Sequelize[_0xe2d3('0x3')],'get':function(_0x4a3769){return this[_0xe2d3('0x4')](_0xe2d3('0x5'));}},'alias':{'type':Sequelize[_0xe2d3('0x6')],'allowNull':![],'set':function(_0x33dbfe){this['setDataValue'](_0xe2d3('0x5'),_0x33dbfe?_0x33dbfe:this[_0xe2d3('0x4')](_0xe2d3('0x7')));}},'type':{'type':Sequelize[_0xe2d3('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xe2d3('0x8')](_0xe2d3('0x9')),'get':function(){if(this[_0xe2d3('0x4')]('type')===_0xe2d3('0xa')){return JSON['parse'](this[_0xe2d3('0x4')](_0xe2d3('0xb')));}else{return this[_0xe2d3('0x4')](_0xe2d3('0xb'));}},'set':function(_0x442d3d){if(Array[_0xe2d3('0xc')](_0x442d3d)){this[_0xe2d3('0xd')](_0xe2d3('0xb'),JSON['stringify'](_0x442d3d));}else{this[_0xe2d3('0xd')](_0xe2d3('0xb'),_0x442d3d);}}},'required':{'type':Sequelize[_0xe2d3('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f86=['BOOLEAN','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','long','type','select','parse','values','isArray','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f86,0x10b));var _0x65f8=function(_0x43037e,_0x1e2344){_0x43037e=_0x43037e-0x0;var _0x3e3adb=_0x5f86[_0x43037e];return _0x3e3adb;};'use strict';var Sequelize=require('sequelize');var _=require(_0x65f8('0x0'));module[_0x65f8('0x1')]={'name':{'type':Sequelize[_0x65f8('0x2')],'get':function(_0x4dce2e){return this[_0x65f8('0x3')]('alias');}},'alias':{'type':Sequelize[_0x65f8('0x4')],'allowNull':![],'set':function(_0x25a745){this[_0x65f8('0x5')]('alias',_0x25a745?_0x25a745:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x65f8('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x65f8('0x6')),'get':function(){if(this[_0x65f8('0x3')](_0x65f8('0x7'))===_0x65f8('0x8')){return JSON[_0x65f8('0x9')](this[_0x65f8('0x3')]('values'));}else{return this[_0x65f8('0x3')](_0x65f8('0xa'));}},'set':function(_0x4fc5fe){if(Array[_0x65f8('0xb')](_0x4fc5fe)){this['setDataValue'](_0x65f8('0xa'),JSON[_0x65f8('0xc')](_0x4fc5fe));}else{this[_0x65f8('0x5')]('values',_0x4fc5fe);}}},'required':{'type':Sequelize[_0x65f8('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 830817b..900eebd 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 _0x971c=['cf_%d','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','error','name','index','CmCustomField','rawAttributes','model','differenceBy','keys','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','filter','map','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','catch','show','params','length','find','body','transaction','create','Sequelize','TEXT','type','text','number','INTEGER','defaultValue','sequelize','queryInterface','cm_contacts','format'];(function(_0x189307,_0x188a83){var _0xb5dd95=function(_0xad5ffa){while(--_0xad5ffa){_0x189307['push'](_0x189307['shift']());}};_0xb5dd95(++_0x188a83);}(_0x971c,0x151));var _0xc971=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x971c[_0x2bf141];return _0x48277b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc971('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc971('0x1'));var rp=require(_0xc971('0x2'));var moment=require(_0xc971('0x3'));var BPromise=require(_0xc971('0x4'));var Mustache=require(_0xc971('0x5'));var util=require(_0xc971('0x6'));var path=require(_0xc971('0x7'));var sox=require(_0xc971('0x8'));var csv=require(_0xc971('0x9'));var ejs=require(_0xc971('0xa'));var fs=require('fs');var _=require(_0xc971('0xb'));var squel=require('squel');var crypto=require(_0xc971('0xc'));var jsforce=require(_0xc971('0xd'));var deskjs=require(_0xc971('0xe'));var toCsv=require(_0xc971('0x9'));var querystring=require(_0xc971('0xf'));var Papa=require(_0xc971('0x10'));var authService=require(_0xc971('0x11'));var hardwareService=require(_0xc971('0x12'));var Redis=require(_0xc971('0x13'));var qs=require(_0xc971('0x14'));var logger=require(_0xc971('0x15'))(_0xc971('0x16'));var utils=require('../../config/utils');var config=require(_0xc971('0x17'));var db=require(_0xc971('0x18'))['db'];function respondWithStatusCode(_0x2bccba,_0x20a955){_0x20a955=_0x20a955||0xcc;return function(_0xc6193b){if(_0xc6193b){return _0x2bccba[_0xc971('0x19')](_0x20a955);}return _0x2bccba[_0xc971('0x1a')](_0x20a955)[_0xc971('0x1b')]();};}function respondWithResult(_0x67afd1,_0x1c10f2){_0x1c10f2=_0x1c10f2||0xc8;return function(_0x33e197){if(_0x33e197){return _0x67afd1[_0xc971('0x1a')](_0x1c10f2)[_0xc971('0x1c')](_0x33e197);}};}function respondWithFilteredResult(_0x400f3f,_0x262593){return function(_0x3e3cd2){if(_0x3e3cd2){var _0x423387=_0x3e3cd2['count'],_0x4c4078=_0x262593[_0xc971('0x1d')],_0x4758ef=_0x262593['offset']+_0x262593[_0xc971('0x1e')],_0x5623b6;if(_0x4758ef>=_0x423387){_0x4758ef=_0x423387;_0x5623b6=0xc8;}else{_0x5623b6=0xce;}_0x400f3f['status'](_0x5623b6);return _0x400f3f['set']('Content-Range',_0x4c4078+'-'+_0x4758ef+'/'+_0x423387)[_0xc971('0x1c')](_0x3e3cd2);}return null;};}function patchUpdates(_0x4a9103){return function(_0x182a67){try{jsonpatch[_0xc971('0x1f')](_0x182a67,_0x4a9103,!![]);}catch(_0x18b030){return BPromise[_0xc971('0x20')](_0x18b030);}return _0x182a67[_0xc971('0x21')]();};}function saveUpdates(_0x4c590d,_0x14b7fd){return function(_0x273961){if(_0x273961){return _0x273961[_0xc971('0x22')](_0x4c590d)[_0xc971('0x23')](function(_0x508ff5){return _0x508ff5;});}return null;};}function removeEntity(_0x3d18e6,_0x568115){return function(_0x382cb7){if(_0x382cb7){return _0x382cb7[_0xc971('0x24')]()[_0xc971('0x23')](function(){_0x3d18e6[_0xc971('0x1a')](0xcc)[_0xc971('0x1b')]();});}};}function handleEntityNotFound(_0x1f17bb,_0x1168df){return function(_0x422544){if(!_0x422544){_0x1f17bb[_0xc971('0x19')](0x194);}return _0x422544;};}function handleError(_0xdae3b7,_0x233228){_0x233228=_0x233228||0x1f4;return function(_0xcb64fc){logger[_0xc971('0x25')](_0xcb64fc['stack']);if(_0xcb64fc[_0xc971('0x26')]){delete _0xcb64fc['name'];}_0xdae3b7[_0xc971('0x1a')](_0x233228)['send'](_0xcb64fc);};}exports[_0xc971('0x27')]=function(_0x41018c,_0x11363f){var _0x77de40={},_0x37c206={},_0x56f155={'count':0x0,'rows':[]};var _0x1223f8=db[_0xc971('0x28')][_0xc971('0x29')];_0x37c206[_0xc971('0x2a')]=_[_0xc971('0x2b')](_[_0xc971('0x2c')](_0x1223f8),[_0xc971('0x26')]);_0x37c206[_0xc971('0x2d')]=_[_0xc971('0x2c')](_0x41018c['query']);_0x37c206['filters']=_[_0xc971('0x2e')](_0x37c206[_0xc971('0x2a')],_0x37c206['query']);_0x77de40[_0xc971('0x2f')]=_[_0xc971('0x2e')](_0x37c206[_0xc971('0x2a')],qs[_0xc971('0x30')](_0x41018c['query']['fields']));_0x77de40[_0xc971('0x2f')]=_0x77de40['attributes']['length']?_0x77de40[_0xc971('0x2f')]:_0x37c206[_0xc971('0x2a')];if(!_0x41018c['query'][_0xc971('0x31')]('nolimit')){_0x77de40[_0xc971('0x1e')]=qs[_0xc971('0x1e')](_0x41018c[_0xc971('0x2d')]['limit']);_0x77de40[_0xc971('0x1d')]=qs[_0xc971('0x1d')](_0x41018c[_0xc971('0x2d')][_0xc971('0x1d')]);}_0x77de40['order']=qs[_0xc971('0x32')](_0x41018c[_0xc971('0x2d')][_0xc971('0x32')]);_0x77de40[_0xc971('0x33')]=qs[_0xc971('0x34')](_['pick'](_0x41018c[_0xc971('0x2d')],_0x37c206[_0xc971('0x34')]));if(_0x41018c[_0xc971('0x2d')][_0xc971('0x35')]){_0x77de40[_0xc971('0x33')]=_['merge'](_0x77de40[_0xc971('0x33')],{'$or':_[_0xc971('0x36')](_0x1223f8,function(_0x188ed4){if(_0x188ed4['type'][_0xc971('0x37')]!==_0xc971('0x38')){var _0x163153={};_0x163153[_0x188ed4[_0xc971('0x39')]]={'$like':'%'+_0x41018c[_0xc971('0x2d')][_0xc971('0x35')]+'%'};return _0x163153;}})});}_0x77de40=_[_0xc971('0x3a')]({},_0x77de40,_0x41018c[_0xc971('0x3b')]);var _0x433e3b={'where':_0x77de40['where']};return db[_0xc971('0x28')][_0xc971('0x3c')](_0x433e3b)[_0xc971('0x23')](function(_0xee140f){_0x56f155['count']=_0xee140f;if(_0x41018c[_0xc971('0x2d')][_0xc971('0x3d')]){_0x77de40[_0xc971('0x3e')]=[{'all':!![]}];}return db[_0xc971('0x28')][_0xc971('0x3f')](_0x77de40);})['then'](function(_0x2e3dea){_0x56f155['rows']=_0x2e3dea;return _0x56f155;})[_0xc971('0x23')](respondWithFilteredResult(_0x11363f,_0x77de40))[_0xc971('0x40')](handleError(_0x11363f,null));};exports[_0xc971('0x41')]=function(_0x25278c,_0x362069){var _0x53ec1c={'raw':!![],'where':{'id':_0x25278c[_0xc971('0x42')]['id']}},_0x8074cc={};_0x8074cc[_0xc971('0x2a')]=_['keys'](db[_0xc971('0x28')]['rawAttributes']);_0x8074cc[_0xc971('0x2d')]=_[_0xc971('0x2c')](_0x25278c[_0xc971('0x2d')]);_0x8074cc[_0xc971('0x34')]=_['intersection'](_0x8074cc[_0xc971('0x2a')],_0x8074cc[_0xc971('0x2d')]);_0x53ec1c[_0xc971('0x2f')]=_[_0xc971('0x2e')](_0x8074cc[_0xc971('0x2a')],qs[_0xc971('0x30')](_0x25278c[_0xc971('0x2d')][_0xc971('0x30')]));_0x53ec1c[_0xc971('0x2f')]=_0x53ec1c[_0xc971('0x2f')][_0xc971('0x43')]?_0x53ec1c[_0xc971('0x2f')]:_0x8074cc[_0xc971('0x2a')];if(_0x25278c[_0xc971('0x2d')][_0xc971('0x3d')]){_0x53ec1c['include']=[{'all':!![]}];}_0x53ec1c=_[_0xc971('0x3a')]({},_0x53ec1c,_0x25278c[_0xc971('0x3b')]);return db['CmCustomField'][_0xc971('0x44')](_0x53ec1c)[_0xc971('0x23')](handleEntityNotFound(_0x362069,null))[_0xc971('0x23')](respondWithResult(_0x362069,null))[_0xc971('0x40')](handleError(_0x362069,null));};exports[_0xc971('0x22')]=function(_0xc7207,_0x24b0b7){if(_0xc7207['body']['id']){delete _0xc7207['body']['id'];}return db[_0xc971('0x28')][_0xc971('0x44')]({'where':{'id':_0xc7207[_0xc971('0x42')]['id']}})[_0xc971('0x23')](handleEntityNotFound(_0x24b0b7,null))['then'](saveUpdates(_0xc7207[_0xc971('0x45')],null))[_0xc971('0x23')](respondWithResult(_0x24b0b7,null))[_0xc971('0x40')](handleError(_0x24b0b7,null));};exports[_0xc971('0x24')]=function(_0x457c98,_0x2ff24a){return db[_0xc971('0x28')]['find']({'where':{'id':_0x457c98[_0xc971('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ff24a,null))[_0xc971('0x23')](removeEntity(_0x2ff24a,null))[_0xc971('0x40')](handleError(_0x2ff24a,null));};exports['create']=function(_0x9e217c,_0x587ea3){var _0x5e2620;return db['sequelize'][_0xc971('0x46')](function(_0x154d85){return db[_0xc971('0x28')][_0xc971('0x47')](_0x9e217c[_0xc971('0x45')],{'transaction':_0x154d85})[_0xc971('0x23')](function(_0x1cd263){_0x5e2620=_0x1cd263;var _0x530e32={'type':db[_0xc971('0x48')][_0xc971('0x49')],'transaction':_0x154d85};switch(_0x9e217c[_0xc971('0x45')][_0xc971('0x4a')]){case _0xc971('0x4b'):_0x530e32['type']=db[_0xc971('0x48')][_0xc971('0x49')];break;case _0xc971('0x4c'):_0x530e32[_0xc971('0x4a')]=db[_0xc971('0x48')][_0xc971('0x4d')];break;case'switch':_0x530e32[_0xc971('0x4a')]=db[_0xc971('0x48')]['BOOLEAN'];_0x530e32[_0xc971('0x4e')]=![];break;default:}return db[_0xc971('0x4f')][_0xc971('0x50')]['addColumn'](_0xc971('0x51'),util[_0xc971('0x52')](_0xc971('0x53'),_0x5e2620['id']),_0x530e32);})[_0xc971('0x23')](function(){return _0x5e2620;});})[_0xc971('0x23')](respondWithResult(_0x587ea3,0xc9))[_0xc971('0x40')](handleError(_0x587ea3,null));}; \ No newline at end of file +var _0x4d13=['find','body','create','sequelize','transaction','Sequelize','TEXT','type','text','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','CmCustomField','rawAttributes','differenceBy','keys','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4d13,0xbf));var _0x34d1=function(_0x1d59c4,_0x512eda){_0x1d59c4=_0x1d59c4-0x0;var _0x138245=_0x4d13[_0x1d59c4];return _0x138245;};'use strict';var pdf=require(_0x34d1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34d1('0x1'));var zipdir=require(_0x34d1('0x2'));var jsonpatch=require(_0x34d1('0x3'));var rp=require(_0x34d1('0x4'));var moment=require(_0x34d1('0x5'));var BPromise=require(_0x34d1('0x6'));var Mustache=require(_0x34d1('0x7'));var util=require(_0x34d1('0x8'));var path=require(_0x34d1('0x9'));var sox=require(_0x34d1('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x34d1('0xb'));var crypto=require(_0x34d1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x34d1('0xd'));var toCsv=require(_0x34d1('0xe'));var querystring=require(_0x34d1('0xf'));var Papa=require(_0x34d1('0x10'));var authService=require(_0x34d1('0x11'));var hardwareService=require(_0x34d1('0x12'));var Redis=require(_0x34d1('0x13'));var qs=require(_0x34d1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x34d1('0x15'));var config=require('../../config/environment');var db=require(_0x34d1('0x16'))['db'];function respondWithStatusCode(_0x46cdfa,_0x4c7711){_0x4c7711=_0x4c7711||0xcc;return function(_0xbfe4bf){if(_0xbfe4bf){return _0x46cdfa[_0x34d1('0x17')](_0x4c7711);}return _0x46cdfa[_0x34d1('0x18')](_0x4c7711)[_0x34d1('0x19')]();};}function respondWithResult(_0x5c0fc9,_0x361750){_0x361750=_0x361750||0xc8;return function(_0x330591){if(_0x330591){return _0x5c0fc9[_0x34d1('0x18')](_0x361750)['json'](_0x330591);}};}function respondWithFilteredResult(_0x3c6742,_0x49a943){return function(_0x5d2c77){if(_0x5d2c77){var _0x23e029=_0x5d2c77[_0x34d1('0x1a')],_0x54fe39=_0x49a943[_0x34d1('0x1b')],_0x10d2bb=_0x49a943[_0x34d1('0x1b')]+_0x49a943[_0x34d1('0x1c')],_0x212bb1;if(_0x10d2bb>=_0x23e029){_0x10d2bb=_0x23e029;_0x212bb1=0xc8;}else{_0x212bb1=0xce;}_0x3c6742[_0x34d1('0x18')](_0x212bb1);return _0x3c6742['set'](_0x34d1('0x1d'),_0x54fe39+'-'+_0x10d2bb+'/'+_0x23e029)[_0x34d1('0x1e')](_0x5d2c77);}return null;};}function patchUpdates(_0x64d513){return function(_0x2475f){try{jsonpatch[_0x34d1('0x1f')](_0x2475f,_0x64d513,!![]);}catch(_0x357bcf){return BPromise[_0x34d1('0x20')](_0x357bcf);}return _0x2475f[_0x34d1('0x21')]();};}function saveUpdates(_0x4fbde4,_0x43e696){return function(_0x41263a){if(_0x41263a){return _0x41263a[_0x34d1('0x22')](_0x4fbde4)[_0x34d1('0x23')](function(_0x8ecdfc){return _0x8ecdfc;});}return null;};}function removeEntity(_0x1ea9f3,_0xafdf9e){return function(_0x3883ab){if(_0x3883ab){return _0x3883ab[_0x34d1('0x24')]()[_0x34d1('0x23')](function(){_0x1ea9f3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe16bcf,_0x579237){return function(_0x17c59d){if(!_0x17c59d){_0xe16bcf[_0x34d1('0x17')](0x194);}return _0x17c59d;};}function handleError(_0xaff926,_0x27956f){_0x27956f=_0x27956f||0x1f4;return function(_0x29c2b2){logger[_0x34d1('0x25')](_0x29c2b2[_0x34d1('0x26')]);if(_0x29c2b2[_0x34d1('0x27')]){delete _0x29c2b2[_0x34d1('0x27')];}_0xaff926[_0x34d1('0x18')](_0x27956f)['send'](_0x29c2b2);};}exports[_0x34d1('0x28')]=function(_0x40fc65,_0x5049cc){var _0x31b98d={},_0x548c4c={},_0x433a5d={'count':0x0,'rows':[]};var _0xb39163=db[_0x34d1('0x29')][_0x34d1('0x2a')];_0x548c4c['model']=_[_0x34d1('0x2b')](_[_0x34d1('0x2c')](_0xb39163),[_0x34d1('0x27')]);_0x548c4c['query']=_['keys'](_0x40fc65[_0x34d1('0x2d')]);_0x548c4c[_0x34d1('0x2e')]=_[_0x34d1('0x2f')](_0x548c4c['model'],_0x548c4c[_0x34d1('0x2d')]);_0x31b98d[_0x34d1('0x30')]=_[_0x34d1('0x2f')](_0x548c4c[_0x34d1('0x31')],qs[_0x34d1('0x32')](_0x40fc65[_0x34d1('0x2d')][_0x34d1('0x32')]));_0x31b98d[_0x34d1('0x30')]=_0x31b98d[_0x34d1('0x30')]['length']?_0x31b98d[_0x34d1('0x30')]:_0x548c4c[_0x34d1('0x31')];if(!_0x40fc65[_0x34d1('0x2d')]['hasOwnProperty'](_0x34d1('0x33'))){_0x31b98d['limit']=qs['limit'](_0x40fc65[_0x34d1('0x2d')][_0x34d1('0x1c')]);_0x31b98d[_0x34d1('0x1b')]=qs[_0x34d1('0x1b')](_0x40fc65['query'][_0x34d1('0x1b')]);}_0x31b98d[_0x34d1('0x34')]=qs[_0x34d1('0x35')](_0x40fc65[_0x34d1('0x2d')][_0x34d1('0x35')]);_0x31b98d[_0x34d1('0x36')]=qs['filters'](_[_0x34d1('0x37')](_0x40fc65[_0x34d1('0x2d')],_0x548c4c[_0x34d1('0x2e')]));if(_0x40fc65[_0x34d1('0x2d')]['filter']){_0x31b98d['where']=_[_0x34d1('0x38')](_0x31b98d[_0x34d1('0x36')],{'$or':_['map'](_0xb39163,function(_0x31634e){if(_0x31634e['type'][_0x34d1('0x39')]!==_0x34d1('0x3a')){var _0x26328={};_0x26328[_0x31634e[_0x34d1('0x3b')]]={'$like':'%'+_0x40fc65['query'][_0x34d1('0x3c')]+'%'};return _0x26328;}})});}_0x31b98d=_[_0x34d1('0x38')]({},_0x31b98d,_0x40fc65[_0x34d1('0x3d')]);var _0x283967={'where':_0x31b98d[_0x34d1('0x36')]};return db['CmCustomField'][_0x34d1('0x1a')](_0x283967)[_0x34d1('0x23')](function(_0x15e90d){_0x433a5d[_0x34d1('0x1a')]=_0x15e90d;if(_0x40fc65['query'][_0x34d1('0x3e')]){_0x31b98d[_0x34d1('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x34d1('0x40')](_0x31b98d);})[_0x34d1('0x23')](function(_0x3bd57b){_0x433a5d[_0x34d1('0x41')]=_0x3bd57b;return _0x433a5d;})[_0x34d1('0x23')](respondWithFilteredResult(_0x5049cc,_0x31b98d))[_0x34d1('0x42')](handleError(_0x5049cc,null));};exports[_0x34d1('0x43')]=function(_0x16fbac,_0x37233f){var _0x110254={'raw':!![],'where':{'id':_0x16fbac[_0x34d1('0x44')]['id']}},_0x1cafd0={};_0x1cafd0[_0x34d1('0x31')]=_[_0x34d1('0x2c')](db['CmCustomField'][_0x34d1('0x2a')]);_0x1cafd0[_0x34d1('0x2d')]=_[_0x34d1('0x2c')](_0x16fbac[_0x34d1('0x2d')]);_0x1cafd0[_0x34d1('0x2e')]=_['intersection'](_0x1cafd0[_0x34d1('0x31')],_0x1cafd0[_0x34d1('0x2d')]);_0x110254[_0x34d1('0x30')]=_['intersection'](_0x1cafd0[_0x34d1('0x31')],qs[_0x34d1('0x32')](_0x16fbac[_0x34d1('0x2d')][_0x34d1('0x32')]));_0x110254[_0x34d1('0x30')]=_0x110254[_0x34d1('0x30')][_0x34d1('0x45')]?_0x110254[_0x34d1('0x30')]:_0x1cafd0['model'];if(_0x16fbac[_0x34d1('0x2d')][_0x34d1('0x3e')]){_0x110254['include']=[{'all':!![]}];}_0x110254=_[_0x34d1('0x38')]({},_0x110254,_0x16fbac['options']);return db[_0x34d1('0x29')][_0x34d1('0x46')](_0x110254)[_0x34d1('0x23')](handleEntityNotFound(_0x37233f,null))[_0x34d1('0x23')](respondWithResult(_0x37233f,null))['catch'](handleError(_0x37233f,null));};exports[_0x34d1('0x22')]=function(_0x35c168,_0x4099e4){if(_0x35c168['body']['id']){delete _0x35c168['body']['id'];}return db[_0x34d1('0x29')][_0x34d1('0x46')]({'where':{'id':_0x35c168[_0x34d1('0x44')]['id']}})[_0x34d1('0x23')](handleEntityNotFound(_0x4099e4,null))['then'](saveUpdates(_0x35c168[_0x34d1('0x47')],null))[_0x34d1('0x23')](respondWithResult(_0x4099e4,null))['catch'](handleError(_0x4099e4,null));};exports[_0x34d1('0x24')]=function(_0x2418c6,_0x2e4eb7){return db[_0x34d1('0x29')][_0x34d1('0x46')]({'where':{'id':_0x2418c6['params']['id']}})[_0x34d1('0x23')](handleEntityNotFound(_0x2e4eb7,null))[_0x34d1('0x23')](removeEntity(_0x2e4eb7,null))[_0x34d1('0x42')](handleError(_0x2e4eb7,null));};exports[_0x34d1('0x48')]=function(_0x520eb3,_0x4c2e52){var _0x1e7014;return db[_0x34d1('0x49')][_0x34d1('0x4a')](function(_0x2b4f08){return db['CmCustomField'][_0x34d1('0x48')](_0x520eb3[_0x34d1('0x47')],{'transaction':_0x2b4f08})[_0x34d1('0x23')](function(_0x56ce43){_0x1e7014=_0x56ce43;var _0x4d9a9d={'type':db[_0x34d1('0x4b')][_0x34d1('0x4c')],'transaction':_0x2b4f08};switch(_0x520eb3[_0x34d1('0x47')][_0x34d1('0x4d')]){case _0x34d1('0x4e'):_0x4d9a9d[_0x34d1('0x4d')]=db[_0x34d1('0x4b')][_0x34d1('0x4c')];break;case'number':_0x4d9a9d['type']=db['Sequelize']['INTEGER'];break;case _0x34d1('0x4f'):_0x4d9a9d[_0x34d1('0x4d')]=db['Sequelize'][_0x34d1('0x50')];_0x4d9a9d[_0x34d1('0x51')]=![];break;default:}return db[_0x34d1('0x49')][_0x34d1('0x52')][_0x34d1('0x53')](_0x34d1('0x54'),util[_0x34d1('0x55')](_0x34d1('0x56'),_0x1e7014['id']),_0x4d9a9d);})['then'](function(){return _0x1e7014;});})[_0x34d1('0x23')](respondWithResult(_0x4c2e52,0xc9))[_0x34d1('0x42')](handleError(_0x4c2e52,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 9166468..1a9e04d 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 _0x9de2=['../../config/logger','bluebird','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x9de2,0x1ae));var _0x29de=function(_0x3db088,_0x30295f){_0x3db088=_0x3db088-0x0;var _0x5d2c40=_0x9de2[_0x3db088];return _0x5d2c40;};'use strict';var _=require(_0x29de('0x0'));var util=require(_0x29de('0x1'));var logger=require(_0x29de('0x2'))('api');var moment=require('moment');var BPromise=require(_0x29de('0x3'));var rp=require('request-promise');var attributes=require(_0x29de('0x4'));module[_0x29de('0x5')]=function(_0x168004,_0x5df66f){return _0x168004[_0x29de('0x6')](_0x29de('0x7'),attributes,{'tableName':_0x29de('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41b4=['cm_custom_fields','lodash','util','../../config/logger','api','moment','request-promise','./cmCustomField.attributes','define','CmCustomField'];(function(_0x1962e5,_0x50f8e3){var _0x31c4f1=function(_0x212a1d){while(--_0x212a1d){_0x1962e5['push'](_0x1962e5['shift']());}};_0x31c4f1(++_0x50f8e3);}(_0x41b4,0x1d7));var _0x441b=function(_0x357d4f,_0x4a6935){_0x357d4f=_0x357d4f-0x0;var _0x2ed6a4=_0x41b4[_0x357d4f];return _0x2ed6a4;};'use strict';var _=require(_0x441b('0x0'));var util=require(_0x441b('0x1'));var logger=require(_0x441b('0x2'))(_0x441b('0x3'));var moment=require(_0x441b('0x4'));var BPromise=require('bluebird');var rp=require(_0x441b('0x5'));var attributes=require(_0x441b('0x6'));module['exports']=function(_0x51d032,_0x54ed48){return _0x51d032[_0x441b('0x7')](_0x441b('0x8'),attributes,{'tableName':_0x441b('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index c416739..c9c9856 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 _0xb4c9=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0xb4c9,0x104));var _0x9b4c=function(_0x207fcf,_0x521e3a){_0x207fcf=_0x207fcf-0x0;var _0x4bbd40=_0xb4c9[_0x207fcf];return _0x4bbd40;};'use strict';var _=require(_0x9b4c('0x0'));var util=require(_0x9b4c('0x1'));var moment=require(_0x9b4c('0x2'));var BPromise=require(_0x9b4c('0x3'));var rs=require(_0x9b4c('0x4'));var fs=require('fs');var Redis=require(_0x9b4c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9b4c('0x6'))(_0x9b4c('0x7'));var config=require(_0x9b4c('0x8'));var jayson=require(_0x9b4c('0x9'));var client=jayson[_0x9b4c('0xa')][_0x9b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ac12d,_0xee769a,_0x4f62ba){return new BPromise(function(_0x230139,_0x137664){return client['request'](_0x3ac12d,_0x4f62ba)[_0x9b4c('0xc')](function(_0x186165){logger['info']('CmCustomField,\x20%s,\x20%s',_0xee769a,_0x9b4c('0xd'));logger['debug'](_0x9b4c('0xe'),_0xee769a,'request\x20sent',JSON[_0x9b4c('0xf')](_0x186165));if(_0x186165[_0x9b4c('0x10')]){if(_0x186165[_0x9b4c('0x10')]['code']===0x1f4){logger['error'](_0x9b4c('0x11'),_0xee769a,_0x186165['error'][_0x9b4c('0x12')]);return _0x137664(_0x186165[_0x9b4c('0x10')][_0x9b4c('0x12')]);}logger[_0x9b4c('0x10')]('CmCustomField,\x20%s,\x20%s',_0xee769a,_0x186165[_0x9b4c('0x10')]['message']);return _0x230139(_0x186165[_0x9b4c('0x10')]['message']);}else{logger[_0x9b4c('0x13')]('CmCustomField,\x20%s,\x20%s',_0xee769a,'request\x20sent');_0x230139(_0x186165[_0x9b4c('0x14')][_0x9b4c('0x12')]);}})[_0x9b4c('0x15')](function(_0xc33c01){logger['error'](_0x9b4c('0x11'),_0xee769a,_0xc33c01);_0x137664(_0xc33c01);});});} \ No newline at end of file +var _0x4ac7=['request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x4eb44c,_0x2885b8){var _0x3b3a0f=function(_0x84f828){while(--_0x84f828){_0x4eb44c['push'](_0x4eb44c['shift']());}};_0x3b3a0f(++_0x2885b8);}(_0x4ac7,0x170));var _0x74ac=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x4ac7[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x74ac('0x0'));var util=require(_0x74ac('0x1'));var moment=require(_0x74ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x74ac('0x3'));var fs=require('fs');var Redis=require(_0x74ac('0x4'));var db=require(_0x74ac('0x5'))['db'];var utils=require(_0x74ac('0x6'));var logger=require(_0x74ac('0x7'))(_0x74ac('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74ac('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b47fe,_0x2f3153,_0xb48d93){return new BPromise(function(_0x167c91,_0x3753bf){return client[_0x74ac('0xa')](_0x2b47fe,_0xb48d93)[_0x74ac('0xb')](function(_0x52110c){logger[_0x74ac('0xc')](_0x74ac('0xd'),_0x2f3153,_0x74ac('0xe'));logger[_0x74ac('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x2f3153,_0x74ac('0xe'),JSON[_0x74ac('0x10')](_0x52110c));if(_0x52110c[_0x74ac('0x11')]){if(_0x52110c['error']['code']===0x1f4){logger['error'](_0x74ac('0xd'),_0x2f3153,_0x52110c[_0x74ac('0x11')][_0x74ac('0x12')]);return _0x3753bf(_0x52110c[_0x74ac('0x11')][_0x74ac('0x12')]);}logger[_0x74ac('0x11')](_0x74ac('0xd'),_0x2f3153,_0x52110c[_0x74ac('0x11')][_0x74ac('0x12')]);return _0x167c91(_0x52110c[_0x74ac('0x11')]['message']);}else{logger[_0x74ac('0xc')](_0x74ac('0xd'),_0x2f3153,_0x74ac('0xe'));_0x167c91(_0x52110c[_0x74ac('0x13')][_0x74ac('0x12')]);}})[_0x74ac('0x14')](function(_0x52a5e5){logger[_0x74ac('0x11')]('CmCustomField,\x20%s,\x20%s',_0x2f3153,_0x52a5e5);_0x3753bf(_0x52a5e5);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3341779..ad11527 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 _0xb568=['connect-timeout','express','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x40932e,_0x4b8aa6){var _0x10b2fc=function(_0x4cb6a6){while(--_0x4cb6a6){_0x40932e['push'](_0x40932e['shift']());}};_0x10b2fc(++_0x4b8aa6);}(_0xb568,0x85));var _0x8b56=function(_0x273f3a,_0x3c3708){_0x273f3a=_0x273f3a-0x0;var _0x3272ab=_0xb568[_0x273f3a];return _0x3272ab;};'use strict';var multer=require(_0x8b56('0x0'));var util=require(_0x8b56('0x1'));var path=require(_0x8b56('0x2'));var timeout=require(_0x8b56('0x3'));var express=require(_0x8b56('0x4'));var router=express['Router']();var auth=require(_0x8b56('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b56('0x6'));var controller=require(_0x8b56('0x7'));router[_0x8b56('0x8')]('/',auth[_0x8b56('0x9')](),controller['index']);router[_0x8b56('0x8')](_0x8b56('0xa'),auth[_0x8b56('0x9')](),controller['show']);router[_0x8b56('0xb')]('/',auth[_0x8b56('0x9')](),controller['create']);router[_0x8b56('0xc')](_0x8b56('0xa'),auth[_0x8b56('0x9')](),controller[_0x8b56('0xd')]);router[_0x8b56('0xe')]('/:id',auth[_0x8b56('0x9')](),controller[_0x8b56('0xf')]);module[_0x8b56('0x10')]=router; \ No newline at end of file +var _0x7156=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0x7156,0xf8));var _0x6715=function(_0x253a43,_0x4ceb70){_0x253a43=_0x253a43-0x0;var _0x508ea6=_0x7156[_0x253a43];return _0x508ea6;};'use strict';var multer=require(_0x6715('0x0'));var util=require('util');var path=require(_0x6715('0x1'));var timeout=require(_0x6715('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x6715('0x3'));var interaction=require(_0x6715('0x4'));var config=require(_0x6715('0x5'));var controller=require('./cmCustomField.controller');router[_0x6715('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6715('0x7'),auth[_0x6715('0x8')](),controller[_0x6715('0x9')]);router[_0x6715('0xa')]('/',auth[_0x6715('0x8')](),controller[_0x6715('0xb')]);router[_0x6715('0xc')](_0x6715('0x7'),auth['isAuthenticated'](),controller[_0x6715('0xd')]);router[_0x6715('0xe')](_0x6715('0x7'),auth[_0x6715('0x8')](),controller[_0x6715('0xf')]);module[_0x6715('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 932f210..6559b04 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 _0xb387=['sequelize','exports','DATE','format','INTEGER','BOOLEAN','STRING','contactListQueue','moment'];(function(_0x274598,_0x1e5206){var _0x4c0878=function(_0x1f2f12){while(--_0x1f2f12){_0x274598['push'](_0x274598['shift']());}};_0x4c0878(++_0x1e5206);}(_0xb387,0x182));var _0x7b38=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0xb387[_0x56740a];return _0x257144;};'use strict';var moment=require(_0x7b38('0x0'));var Sequelize=require(_0x7b38('0x1'));module[_0x7b38('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7b38('0x3')],'defaultValue':moment()[_0x7b38('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x7b38('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7b38('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7b38('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7b38('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7b38('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7b38('0x3')]},'priority':{'type':Sequelize[_0x7b38('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7b38('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7b38('0x5')],'unique':_0x7b38('0x8')},'ListId':{'type':Sequelize[_0x7b38('0x5')],'unique':_0x7b38('0x8')},'UserId':{'type':Sequelize[_0x7b38('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x7b38('0x8')},'CampaignId':{'type':Sequelize[_0x7b38('0x5')]}}; \ No newline at end of file +var _0x0635=['exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x54f493,_0x385811){var _0x5f2b47=function(_0x2d2323){while(--_0x2d2323){_0x54f493['push'](_0x54f493['shift']());}};_0x5f2b47(++_0x385811);}(_0x0635,0x1cc));var _0x5063=function(_0x3d7bc8,_0x1388a9){_0x3d7bc8=_0x3d7bc8-0x0;var _0x328746=_0x0635[_0x3d7bc8];return _0x328746;};'use strict';var moment=require(_0x5063('0x0'));var Sequelize=require(_0x5063('0x1'));module[_0x5063('0x2')]={'phone':{'type':Sequelize[_0x5063('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x5063('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5063('0x5')](_0x5063('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5063('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5063('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5063('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5063('0x8')]},'priority':{'type':Sequelize[_0x5063('0x7')](0x2)[_0x5063('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5063('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5063('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5063('0x7')],'unique':_0x5063('0xa')},'UserId':{'type':Sequelize[_0x5063('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x5063('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index c9ba3f8..9bac570 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 _0xc8e2=['phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','preview','sequelize','transaction','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','Queue','dialActive','isNumber','error','getOpenContacts','entity\x20not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','name','send','index','CmHopper','rawAttributes','model','keys','query','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','order','sort','where','merge','map','type','VIRTUAL','filter','options','count','includeAll','rows','catch','show','params','intersection','include','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','createdAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum'];(function(_0x3f663a,_0x1f7fc5){var _0x37ea73=function(_0x40cde1){while(--_0x40cde1){_0x3f663a['push'](_0x3f663a['shift']());}};_0x37ea73(++_0x1f7fc5);}(_0xc8e2,0x1c9));var _0x2c8e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc8e2[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x2c8e('0x0'));var emlformat=require(_0x2c8e('0x1'));var rimraf=require(_0x2c8e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c8e('0x3'));var rp=require(_0x2c8e('0x4'));var moment=require(_0x2c8e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c8e('0x6'));var util=require('util');var path=require(_0x2c8e('0x7'));var sox=require('sox');var csv=require(_0x2c8e('0x8'));var ejs=require(_0x2c8e('0x9'));var fs=require('fs');var _=require(_0x2c8e('0xa'));var squel=require('squel');var crypto=require(_0x2c8e('0xb'));var jsforce=require(_0x2c8e('0xc'));var deskjs=require(_0x2c8e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2c8e('0xe'));var Papa=require(_0x2c8e('0xf'));var authService=require(_0x2c8e('0x10'));var hardwareService=require(_0x2c8e('0x11'));var Redis=require('ioredis');var qs=require(_0x2c8e('0x12'));var logger=require(_0x2c8e('0x13'))(_0x2c8e('0x14'));var utils=require(_0x2c8e('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe08113,_0x30f459){_0x30f459=_0x30f459||0xcc;return function(_0x114ffb){if(_0x114ffb){return _0xe08113[_0x2c8e('0x16')](_0x30f459);}return _0xe08113['status'](_0x30f459)[_0x2c8e('0x17')]();};}function respondWithResult(_0x586439,_0x23e214){_0x23e214=_0x23e214||0xc8;return function(_0x442f29){if(_0x442f29){return _0x586439[_0x2c8e('0x18')](_0x23e214)[_0x2c8e('0x19')](_0x442f29);}};}function respondWithFilteredResult(_0x682881,_0x380e67){return function(_0x1b3e40){if(_0x1b3e40){var _0x30d046=_0x1b3e40['count'],_0x5edfa5=_0x380e67['offset'],_0x34e809=_0x380e67[_0x2c8e('0x1a')]+_0x380e67[_0x2c8e('0x1b')],_0x25098c;if(_0x34e809>=_0x30d046){_0x34e809=_0x30d046;_0x25098c=0xc8;}else{_0x25098c=0xce;}_0x682881['status'](_0x25098c);return _0x682881[_0x2c8e('0x1c')](_0x2c8e('0x1d'),_0x5edfa5+'-'+_0x34e809+'/'+_0x30d046)[_0x2c8e('0x19')](_0x1b3e40);}return null;};}function patchUpdates(_0x3bf008){return function(_0x5821b5){try{jsonpatch['apply'](_0x5821b5,_0x3bf008,!![]);}catch(_0x552606){return BPromise[_0x2c8e('0x1e')](_0x552606);}return _0x5821b5['save']();};}function saveUpdates(_0xa4354f,_0x49145a){return function(_0x540b0f){if(_0x540b0f){return _0x540b0f[_0x2c8e('0x1f')](_0xa4354f)[_0x2c8e('0x20')](function(_0x77be8e){return _0x77be8e;});}return null;};}function removeEntity(_0x16cf94,_0x8a199f){return function(_0x27e873){if(_0x27e873){return _0x27e873[_0x2c8e('0x21')]()['then'](function(){_0x16cf94[_0x2c8e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ea37,_0x15f23){return function(_0x34762a){if(!_0x34762a){_0x35ea37['sendStatus'](0x194);}return _0x34762a;};}function handleError(_0xe2278a,_0x5acbb4){_0x5acbb4=_0x5acbb4||0x1f4;return function(_0x1ec516){logger['error'](_0x1ec516['stack']);if(_0x1ec516['name']){delete _0x1ec516[_0x2c8e('0x22')];}_0xe2278a['status'](_0x5acbb4)[_0x2c8e('0x23')](_0x1ec516);};}exports[_0x2c8e('0x24')]=function(_0x2d12f7,_0x5d4c37){var _0xfc0118={},_0x670a1c={},_0x36c79c={'count':0x0,'rows':[]};var _0x446161=db[_0x2c8e('0x25')][_0x2c8e('0x26')];_0x670a1c[_0x2c8e('0x27')]=_[_0x2c8e('0x28')](_0x446161);_0x670a1c[_0x2c8e('0x29')]=_['keys'](_0x2d12f7[_0x2c8e('0x29')]);_0x670a1c[_0x2c8e('0x2a')]=_['intersection'](_0x670a1c[_0x2c8e('0x27')],_0x670a1c[_0x2c8e('0x29')]);_0x670a1c[_0x2c8e('0x2a')]=_['concat'](_0x670a1c[_0x2c8e('0x2a')],[_0x2c8e('0x2b'),_0x2c8e('0x2c'),_0x2c8e('0x2d'),_0x2c8e('0x2e'),_0x2c8e('0x2f'),_0x2c8e('0x30'),_0x2c8e('0x31'),_0x2c8e('0x32'),'$not',_0x2c8e('0x33'),_0x2c8e('0x34'),'$in','$notIn',_0x2c8e('0x35'),'$notLike',_0x2c8e('0x36'),_0x2c8e('0x37'),_0x2c8e('0x35'),_0x2c8e('0x38'),_0x2c8e('0x39'),_0x2c8e('0x3a'),_0x2c8e('0x3b')]);_0xfc0118[_0x2c8e('0x3c')]=_['intersection'](_0x670a1c[_0x2c8e('0x27')],qs[_0x2c8e('0x3d')](_0x2d12f7['query'][_0x2c8e('0x3d')]));_0xfc0118[_0x2c8e('0x3c')]=_0xfc0118['attributes'][_0x2c8e('0x3e')]?_0xfc0118[_0x2c8e('0x3c')]:_0x670a1c[_0x2c8e('0x27')];if(!_0x2d12f7[_0x2c8e('0x29')]['hasOwnProperty']('nolimit')){_0xfc0118[_0x2c8e('0x1b')]=qs[_0x2c8e('0x1b')](_0x2d12f7[_0x2c8e('0x29')]['limit']);_0xfc0118['offset']=qs[_0x2c8e('0x1a')](_0x2d12f7[_0x2c8e('0x29')][_0x2c8e('0x1a')]);}_0xfc0118[_0x2c8e('0x3f')]=qs[_0x2c8e('0x40')](_0x2d12f7[_0x2c8e('0x29')][_0x2c8e('0x40')]);_0xfc0118[_0x2c8e('0x41')]=qs['filters'](_['pick'](_0x2d12f7['query'],_0x670a1c['filters']));if(_0x2d12f7[_0x2c8e('0x29')]['filter']){_0xfc0118['where']=_[_0x2c8e('0x42')](_0xfc0118[_0x2c8e('0x41')],{'$or':_[_0x2c8e('0x43')](_0x446161,function(_0x462044){if(_0x462044[_0x2c8e('0x44')]['key']!==_0x2c8e('0x45')){var _0x1d82e9={};_0x1d82e9[_0x462044['field']]={'$like':'%'+_0x2d12f7['query'][_0x2c8e('0x46')]+'%'};return _0x1d82e9;}})});}_0xfc0118=_['merge']({},_0xfc0118,_0x2d12f7[_0x2c8e('0x47')]);var _0x141c96={'where':_0xfc0118[_0x2c8e('0x41')]};return db[_0x2c8e('0x25')][_0x2c8e('0x48')](_0x141c96)[_0x2c8e('0x20')](function(_0x2e7199){_0x36c79c[_0x2c8e('0x48')]=_0x2e7199;if(_0x2d12f7[_0x2c8e('0x29')][_0x2c8e('0x49')]){_0xfc0118['include']=[{'all':!![]}];}return db[_0x2c8e('0x25')]['findAll'](_0xfc0118);})['then'](function(_0x4e1973){_0x36c79c[_0x2c8e('0x4a')]=_0x4e1973;return _0x36c79c;})['then'](respondWithFilteredResult(_0x5d4c37,_0xfc0118))[_0x2c8e('0x4b')](handleError(_0x5d4c37,null));};exports[_0x2c8e('0x4c')]=function(_0x152569,_0x403198){var _0x308253={'raw':!![],'where':{'id':_0x152569[_0x2c8e('0x4d')]['id']}},_0x480d39={};_0x480d39['model']=_[_0x2c8e('0x28')](db['CmHopper']['rawAttributes']);_0x480d39['query']=_[_0x2c8e('0x28')](_0x152569[_0x2c8e('0x29')]);_0x480d39[_0x2c8e('0x2a')]=_[_0x2c8e('0x4e')](_0x480d39[_0x2c8e('0x27')],_0x480d39[_0x2c8e('0x29')]);_0x308253[_0x2c8e('0x3c')]=_[_0x2c8e('0x4e')](_0x480d39[_0x2c8e('0x27')],qs[_0x2c8e('0x3d')](_0x152569[_0x2c8e('0x29')]['fields']));_0x308253[_0x2c8e('0x3c')]=_0x308253[_0x2c8e('0x3c')]['length']?_0x308253[_0x2c8e('0x3c')]:_0x480d39[_0x2c8e('0x27')];if(_0x152569['query'][_0x2c8e('0x49')]){_0x308253[_0x2c8e('0x4f')]=[{'all':!![]}];}_0x308253=_['merge']({},_0x308253,_0x152569[_0x2c8e('0x47')]);return db['CmHopper'][_0x2c8e('0x50')](_0x308253)[_0x2c8e('0x20')](handleEntityNotFound(_0x403198,null))[_0x2c8e('0x20')](respondWithResult(_0x403198,null))[_0x2c8e('0x4b')](handleError(_0x403198,null));};exports[_0x2c8e('0x51')]=function(_0x9c0432,_0x201001){return db[_0x2c8e('0x25')]['create'](_0x9c0432[_0x2c8e('0x52')],{})['then'](respondWithResult(_0x201001,0xc9))['catch'](handleError(_0x201001,null));};exports[_0x2c8e('0x1f')]=function(_0x38ca63,_0x2379ce){if(_0x38ca63[_0x2c8e('0x52')]['id']){delete _0x38ca63[_0x2c8e('0x52')]['id'];}return db[_0x2c8e('0x25')][_0x2c8e('0x50')]({'where':{'id':_0x38ca63['params']['id']}})[_0x2c8e('0x20')](handleEntityNotFound(_0x2379ce,null))[_0x2c8e('0x20')](saveUpdates(_0x38ca63[_0x2c8e('0x52')],null))[_0x2c8e('0x20')](respondWithResult(_0x2379ce,null))[_0x2c8e('0x4b')](handleError(_0x2379ce,null));};exports[_0x2c8e('0x53')]=function(_0x15bf1a,_0x4a50a0){return db[_0x2c8e('0x25')][_0x2c8e('0x53')]()[_0x2c8e('0x20')](respondWithResult(_0x4a50a0,null))[_0x2c8e('0x4b')](handleError(_0x4a50a0,null));};exports[_0x2c8e('0x21')]=function(_0x516007,_0x2be9a4){var _0x434b50;return db[_0x2c8e('0x25')][_0x2c8e('0x50')]({'where':{'id':_0x516007['params']['id']}})['then'](handleEntityNotFound(_0x2be9a4,null))[_0x2c8e('0x20')](function(_0x13429d){if(_0x13429d){return _0x13429d[_0x2c8e('0x21')]()[_0x2c8e('0x20')](function(_0x4b76a1){return _0x4b76a1;});}})[_0x2c8e('0x20')](function(_0x433590){_0x434b50=_0x433590;if(_0x433590){if(_0x433590[_0x2c8e('0x54')]||_0x433590[_0x2c8e('0x55')]){return db[_0x433590[_0x2c8e('0x54')]?'VoiceQueue':_0x2c8e('0x56')][_0x2c8e('0x50')]({'where':{'id':_0x433590[_0x2c8e('0x54')]?_0x433590[_0x2c8e('0x54')]:_0x433590[_0x2c8e('0x55')]},'attributes':['id','name'],'raw':!![]});}}})[_0x2c8e('0x20')](function(_0x51630d){var _0x21148b={};if(_0x51630d){_[_0x2c8e('0x42')](_0x21148b,_['omit'](_0x434b50['dataValues'],[_0x2c8e('0x57'),'updatedAt','id']));_0x21148b[_0x2c8e('0x58')]=0x15;_0x21148b[_0x2c8e('0x59')]='deleted';_0x21148b[_0x2c8e('0x5a')]=_0x51630d[_0x2c8e('0x22')];_0x21148b[_0x2c8e('0x5b')]=_0x516007[_0x2c8e('0x5c')]['name'];_0x21148b[_0x2c8e('0x5d')]=_0x516007['user']['id'];_0x21148b[_0x2c8e('0x5e')]=!![];_0x21148b[_0x2c8e('0x5f')]=moment()[_0x2c8e('0x60')](_0x2c8e('0x61'));_0x21148b[_0x2c8e('0x62')]=_0x434b50[_0x2c8e('0x63')];_0x21148b['campaigntype']=_0x434b50[_0x2c8e('0x54')]?_0x2c8e('0x64'):_0x2c8e('0x65');return db[_0x2c8e('0x66')][_0x2c8e('0x50')]({'where':{'id':_0x21148b[_0x2c8e('0x67')]},'attributes':['firstName',_0x2c8e('0x68')]})[_0x2c8e('0x20')](function(_0x33f071){if(!_[_0x2c8e('0x69')](_0x2be9a4)&&!_[_0x2c8e('0x69')](_0x33f071[_0x2c8e('0x6a')])){_0x21148b[_0x2c8e('0x6b')]=_0x33f071[_0x2c8e('0x6a')];if(!_[_0x2c8e('0x69')](_0x33f071[_0x2c8e('0x68')])){_0x21148b[_0x2c8e('0x6b')]+='\x20'+_0x33f071[_0x2c8e('0x68')];}}})[_0x2c8e('0x6c')](function(){return db[_0x2c8e('0x6d')][_0x2c8e('0x51')](_0x21148b);});}})[_0x2c8e('0x20')](function(){return _0x2be9a4[_0x2c8e('0x18')](0xcc)[_0x2c8e('0x17')]();})[_0x2c8e('0x4b')](handleError(_0x2be9a4,null));};exports['getPreview']=function(_0x7305ce,_0x424f44,_0x146e94){var _0x547c12=[];return db[_0x2c8e('0x66')]['describe']()[_0x2c8e('0x20')](function(_0x14f0d6){_0x547c12=_[_0x2c8e('0x28')](_0x14f0d6);return _0x7305ce['user'][_0x2c8e('0x6e')]({'where':{'type':_0x2c8e('0x6f'),'dialActive':!![],'dialMethod':_0x2c8e('0x70')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x2c8e('0x20')](function(_0x423651){if(_0x423651&&_0x423651[_0x2c8e('0x3e')]){return db[_0x2c8e('0x71')][_0x2c8e('0x72')](function(_0x1e3638){var _0x1c28ac={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x2c8e('0x61'))},'VoiceQueueId':{'$in':_[_0x2c8e('0x43')](_0x423651,'id')},'$or':[{'UserId':null},{'UserId':_0x7305ce[_0x2c8e('0x5c')]['id']}]};var _0x2b0118=[];if(_0x7305ce[_0x2c8e('0x52')][_0x2c8e('0x73')]&&_0x7305ce['body'][_0x2c8e('0x73')]==='prev'){if(!_[_0x2c8e('0x74')](_0x7305ce[_0x2c8e('0x52')][_0x2c8e('0x75')])){_0x1c28ac['id']={'$in':_0x7305ce[_0x2c8e('0x52')][_0x2c8e('0x75')]};}_0x2b0118=[[_0x2c8e('0x76'),_0x2c8e('0x77')],[_0x2c8e('0x78'),_0x423651[0x0][_0x2c8e('0x79')]===_0x2c8e('0x77')?_0x2c8e('0x7a'):_0x2c8e('0x77')],db['sequelize'][_0x2c8e('0x7b')](_0x2c8e('0x7c')),['id','DESC']];}else{if(!_[_0x2c8e('0x74')](_0x7305ce[_0x2c8e('0x52')][_0x2c8e('0x75')])){_0x1c28ac['id']={'$notIn':_0x7305ce[_0x2c8e('0x52')][_0x2c8e('0x75')]};}_0x2b0118=[[_0x2c8e('0x76'),'DESC'],[_0x2c8e('0x78'),_0x423651[0x0][_0x2c8e('0x79')]],db[_0x2c8e('0x71')][_0x2c8e('0x7b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x2c8e('0x77')]];}return db[_0x2c8e('0x25')][_0x2c8e('0x7d')]({'attributes':['id',_0x2c8e('0x7e')],'where':_0x1c28ac,'order':_0x2b0118,'transaction':_0x1e3638,'lock':_0x1e3638[_0x2c8e('0x7f')]['UPDATE'],'include':[{'model':db[_0x2c8e('0x66')],'as':_0x2c8e('0x80'),'attributes':_0x547c12,'include':[{'model':db[_0x2c8e('0x81')],'as':_0x2c8e('0x82'),'attributes':['id',_0x2c8e('0x22')]}]},{'model':db[_0x2c8e('0x83')],'as':_0x2c8e('0x84'),'attributes':['id',_0x2c8e('0x22')]},{'model':db['VoiceQueue'],'as':_0x2c8e('0x85'),'attributes':['id',_0x2c8e('0x22'),_0x2c8e('0x86')]}]})[_0x2c8e('0x20')](function(_0x3a4b26){if(_0x3a4b26){return _0x3a4b26[_0x2c8e('0x1f')]({'UserId':_0x7305ce[_0x2c8e('0x5c')]['id']},{'transaction':_0x1e3638});}});});}})[_0x2c8e('0x20')](handleEntityNotFound(_0x424f44,null))[_0x2c8e('0x20')](respondWithResult(_0x424f44,null))[_0x2c8e('0x4b')](handleError(_0x424f44,null));};exports['getOpenContacts']=function(_0x12e8ef,_0x4d9ade,_0x111f5b){return _0x12e8ef[_0x2c8e('0x5c')]['getVoiceQueues']({'where':{'type':_0x2c8e('0x6f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x2c8e('0x20')](function(_0x34b2e9){if(_0x34b2e9&&_0x34b2e9[_0x2c8e('0x3e')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c8e('0x60')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2c8e('0x43')](_0x34b2e9,'id')},'$or':[{'UserId':null},{'UserId':_0x12e8ef[_0x2c8e('0x5c')]['id']}]}});}return 0x0;})[_0x2c8e('0x20')](function(_0x5193a1){if(!_[_0x2c8e('0x69')](_0x5193a1)&&_[_0x2c8e('0x87')](_0x5193a1)){return _0x4d9ade[_0x2c8e('0x18')](0xc8)[_0x2c8e('0x19')]({'contacts':_0x5193a1});}else{logger[_0x2c8e('0x88')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x2c8e('0x89'),0x194,_0x2c8e('0x8a'));_0x4d9ade[_0x2c8e('0x16')](0x194);}})[_0x2c8e('0x4b')](handleError(_0x4d9ade,null));}; \ No newline at end of file +var _0xe657=['Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../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','stack','name','send','CmHopper','rawAttributes','model','keys','query','filters','intersection','concat','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','includeAll','merge','find','create','body','params','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','map','direction','isEmpty','hopperIds','priority','scheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','CmList'];(function(_0x391a1a,_0x145623){var _0xc9f85d=function(_0x381679){while(--_0x381679){_0x391a1a['push'](_0x391a1a['shift']());}};_0xc9f85d(++_0x145623);}(_0xe657,0x1d1));var _0x7e65=function(_0x54b53c,_0x2d5b3b){_0x54b53c=_0x54b53c-0x0;var _0x4f846e=_0xe657[_0x54b53c];return _0x4f846e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7e65('0x0'));var rimraf=require(_0x7e65('0x1'));var zipdir=require(_0x7e65('0x2'));var jsonpatch=require(_0x7e65('0x3'));var rp=require(_0x7e65('0x4'));var moment=require(_0x7e65('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7e65('0x6'));var path=require(_0x7e65('0x7'));var sox=require(_0x7e65('0x8'));var csv=require(_0x7e65('0x9'));var ejs=require(_0x7e65('0xa'));var fs=require('fs');var _=require(_0x7e65('0xb'));var squel=require(_0x7e65('0xc'));var crypto=require(_0x7e65('0xd'));var jsforce=require(_0x7e65('0xe'));var deskjs=require(_0x7e65('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7e65('0x10'));var Papa=require(_0x7e65('0x11'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7e65('0x12'));var qs=require(_0x7e65('0x13'));var logger=require(_0x7e65('0x14'))(_0x7e65('0x15'));var utils=require(_0x7e65('0x16'));var config=require(_0x7e65('0x17'));var db=require(_0x7e65('0x18'))['db'];function respondWithStatusCode(_0xc4f6e0,_0xc14667){_0xc14667=_0xc14667||0xcc;return function(_0x29cc71){if(_0x29cc71){return _0xc4f6e0[_0x7e65('0x19')](_0xc14667);}return _0xc4f6e0[_0x7e65('0x1a')](_0xc14667)[_0x7e65('0x1b')]();};}function respondWithResult(_0x5457d7,_0x6bf95){_0x6bf95=_0x6bf95||0xc8;return function(_0x5e47c0){if(_0x5e47c0){return _0x5457d7[_0x7e65('0x1a')](_0x6bf95)[_0x7e65('0x1c')](_0x5e47c0);}};}function respondWithFilteredResult(_0x408468,_0x5a3119){return function(_0x4a6be2){if(_0x4a6be2){var _0x5269b0=_0x4a6be2[_0x7e65('0x1d')],_0x397483=_0x5a3119['offset'],_0x301a90=_0x5a3119[_0x7e65('0x1e')]+_0x5a3119[_0x7e65('0x1f')],_0x3ae9cb;if(_0x301a90>=_0x5269b0){_0x301a90=_0x5269b0;_0x3ae9cb=0xc8;}else{_0x3ae9cb=0xce;}_0x408468[_0x7e65('0x1a')](_0x3ae9cb);return _0x408468[_0x7e65('0x20')](_0x7e65('0x21'),_0x397483+'-'+_0x301a90+'/'+_0x5269b0)[_0x7e65('0x1c')](_0x4a6be2);}return null;};}function patchUpdates(_0x158521){return function(_0x3810e2){try{jsonpatch[_0x7e65('0x22')](_0x3810e2,_0x158521,!![]);}catch(_0x1c7104){return BPromise[_0x7e65('0x23')](_0x1c7104);}return _0x3810e2[_0x7e65('0x24')]();};}function saveUpdates(_0x44953b,_0x2683c7){return function(_0x5dd62e){if(_0x5dd62e){return _0x5dd62e[_0x7e65('0x25')](_0x44953b)[_0x7e65('0x26')](function(_0x24f3e2){return _0x24f3e2;});}return null;};}function removeEntity(_0x371e91,_0x505777){return function(_0x1d5d7e){if(_0x1d5d7e){return _0x1d5d7e[_0x7e65('0x27')]()['then'](function(){_0x371e91[_0x7e65('0x1a')](0xcc)[_0x7e65('0x1b')]();});}};}function handleEntityNotFound(_0x3dc71c,_0x1eae60){return function(_0x5c6112){if(!_0x5c6112){_0x3dc71c[_0x7e65('0x19')](0x194);}return _0x5c6112;};}function handleError(_0x38dc68,_0xabe653){_0xabe653=_0xabe653||0x1f4;return function(_0x24f377){logger[_0x7e65('0x28')](_0x24f377[_0x7e65('0x29')]);if(_0x24f377[_0x7e65('0x2a')]){delete _0x24f377['name'];}_0x38dc68[_0x7e65('0x1a')](_0xabe653)[_0x7e65('0x2b')](_0x24f377);};}exports['index']=function(_0x5e0d67,_0x464c6c){var _0x4ef325={},_0x65f634={},_0x344c9f={'count':0x0,'rows':[]};var _0x12952f=db[_0x7e65('0x2c')][_0x7e65('0x2d')];_0x65f634[_0x7e65('0x2e')]=_[_0x7e65('0x2f')](_0x12952f);_0x65f634[_0x7e65('0x30')]=_[_0x7e65('0x2f')](_0x5e0d67[_0x7e65('0x30')]);_0x65f634[_0x7e65('0x31')]=_[_0x7e65('0x32')](_0x65f634[_0x7e65('0x2e')],_0x65f634[_0x7e65('0x30')]);_0x65f634['filters']=_[_0x7e65('0x33')](_0x65f634[_0x7e65('0x31')],['$and',_0x7e65('0x34'),_0x7e65('0x35'),'$gte',_0x7e65('0x36'),_0x7e65('0x37'),_0x7e65('0x38'),_0x7e65('0x39'),_0x7e65('0x3a'),_0x7e65('0x3b'),_0x7e65('0x3c'),_0x7e65('0x3d'),_0x7e65('0x3e'),_0x7e65('0x3f'),_0x7e65('0x40'),'$iLike',_0x7e65('0x41'),_0x7e65('0x3f'),_0x7e65('0x42'),_0x7e65('0x43'),_0x7e65('0x44'),_0x7e65('0x45')]);_0x4ef325[_0x7e65('0x46')]=_[_0x7e65('0x32')](_0x65f634['model'],qs[_0x7e65('0x47')](_0x5e0d67['query'][_0x7e65('0x47')]));_0x4ef325['attributes']=_0x4ef325[_0x7e65('0x46')][_0x7e65('0x48')]?_0x4ef325[_0x7e65('0x46')]:_0x65f634[_0x7e65('0x2e')];if(!_0x5e0d67['query'][_0x7e65('0x49')]('nolimit')){_0x4ef325[_0x7e65('0x1f')]=qs[_0x7e65('0x1f')](_0x5e0d67[_0x7e65('0x30')][_0x7e65('0x1f')]);_0x4ef325[_0x7e65('0x1e')]=qs['offset'](_0x5e0d67[_0x7e65('0x30')][_0x7e65('0x1e')]);}_0x4ef325['order']=qs[_0x7e65('0x4a')](_0x5e0d67[_0x7e65('0x30')]['sort']);_0x4ef325[_0x7e65('0x4b')]=qs[_0x7e65('0x31')](_[_0x7e65('0x4c')](_0x5e0d67[_0x7e65('0x30')],_0x65f634[_0x7e65('0x31')]));if(_0x5e0d67[_0x7e65('0x30')][_0x7e65('0x4d')]){_0x4ef325[_0x7e65('0x4b')]=_['merge'](_0x4ef325[_0x7e65('0x4b')],{'$or':_['map'](_0x12952f,function(_0x526fad){if(_0x526fad[_0x7e65('0x4e')][_0x7e65('0x4f')]!==_0x7e65('0x50')){var _0x38576d={};_0x38576d[_0x526fad[_0x7e65('0x51')]]={'$like':'%'+_0x5e0d67['query'][_0x7e65('0x4d')]+'%'};return _0x38576d;}})});}_0x4ef325=_['merge']({},_0x4ef325,_0x5e0d67[_0x7e65('0x52')]);var _0x4ace4f={'where':_0x4ef325['where']};return db['CmHopper'][_0x7e65('0x1d')](_0x4ace4f)[_0x7e65('0x26')](function(_0x42dec1){_0x344c9f[_0x7e65('0x1d')]=_0x42dec1;if(_0x5e0d67[_0x7e65('0x30')]['includeAll']){_0x4ef325[_0x7e65('0x53')]=[{'all':!![]}];}return db[_0x7e65('0x2c')][_0x7e65('0x54')](_0x4ef325);})[_0x7e65('0x26')](function(_0x1aec73){_0x344c9f[_0x7e65('0x55')]=_0x1aec73;return _0x344c9f;})[_0x7e65('0x26')](respondWithFilteredResult(_0x464c6c,_0x4ef325))[_0x7e65('0x56')](handleError(_0x464c6c,null));};exports[_0x7e65('0x57')]=function(_0x1953a5,_0x373fea){var _0x1a935d={'raw':!![],'where':{'id':_0x1953a5['params']['id']}},_0x5c9d0c={};_0x5c9d0c[_0x7e65('0x2e')]=_[_0x7e65('0x2f')](db[_0x7e65('0x2c')][_0x7e65('0x2d')]);_0x5c9d0c[_0x7e65('0x30')]=_[_0x7e65('0x2f')](_0x1953a5[_0x7e65('0x30')]);_0x5c9d0c[_0x7e65('0x31')]=_[_0x7e65('0x32')](_0x5c9d0c[_0x7e65('0x2e')],_0x5c9d0c[_0x7e65('0x30')]);_0x1a935d[_0x7e65('0x46')]=_[_0x7e65('0x32')](_0x5c9d0c[_0x7e65('0x2e')],qs['fields'](_0x1953a5[_0x7e65('0x30')][_0x7e65('0x47')]));_0x1a935d['attributes']=_0x1a935d[_0x7e65('0x46')][_0x7e65('0x48')]?_0x1a935d['attributes']:_0x5c9d0c['model'];if(_0x1953a5[_0x7e65('0x30')][_0x7e65('0x58')]){_0x1a935d[_0x7e65('0x53')]=[{'all':!![]}];}_0x1a935d=_[_0x7e65('0x59')]({},_0x1a935d,_0x1953a5['options']);return db[_0x7e65('0x2c')][_0x7e65('0x5a')](_0x1a935d)[_0x7e65('0x26')](handleEntityNotFound(_0x373fea,null))[_0x7e65('0x26')](respondWithResult(_0x373fea,null))[_0x7e65('0x56')](handleError(_0x373fea,null));};exports[_0x7e65('0x5b')]=function(_0x24e359,_0x12e55b){return db[_0x7e65('0x2c')]['create'](_0x24e359[_0x7e65('0x5c')],{})['then'](respondWithResult(_0x12e55b,0xc9))['catch'](handleError(_0x12e55b,null));};exports[_0x7e65('0x25')]=function(_0x4c4249,_0xd26a35){if(_0x4c4249[_0x7e65('0x5c')]['id']){delete _0x4c4249['body']['id'];}return db[_0x7e65('0x2c')][_0x7e65('0x5a')]({'where':{'id':_0x4c4249[_0x7e65('0x5d')]['id']}})[_0x7e65('0x26')](handleEntityNotFound(_0xd26a35,null))[_0x7e65('0x26')](saveUpdates(_0x4c4249[_0x7e65('0x5c')],null))[_0x7e65('0x26')](respondWithResult(_0xd26a35,null))[_0x7e65('0x56')](handleError(_0xd26a35,null));};exports[_0x7e65('0x5e')]=function(_0x347155,_0x41ed04){return db[_0x7e65('0x2c')][_0x7e65('0x5e')]()[_0x7e65('0x26')](respondWithResult(_0x41ed04,null))[_0x7e65('0x56')](handleError(_0x41ed04,null));};exports['destroy']=function(_0x5e47ba,_0x14d342){var _0x3c44c7;return db[_0x7e65('0x2c')][_0x7e65('0x5a')]({'where':{'id':_0x5e47ba[_0x7e65('0x5d')]['id']}})[_0x7e65('0x26')](handleEntityNotFound(_0x14d342,null))[_0x7e65('0x26')](function(_0x2d8008){if(_0x2d8008){return _0x2d8008[_0x7e65('0x27')]()[_0x7e65('0x26')](function(_0x2760d5){return _0x2760d5;});}})[_0x7e65('0x26')](function(_0xaaf33f){_0x3c44c7=_0xaaf33f;if(_0xaaf33f){if(_0xaaf33f[_0x7e65('0x5f')]||_0xaaf33f[_0x7e65('0x60')]){return db[_0xaaf33f['VoiceQueueId']?_0x7e65('0x61'):_0x7e65('0x62')][_0x7e65('0x5a')]({'where':{'id':_0xaaf33f[_0x7e65('0x5f')]?_0xaaf33f[_0x7e65('0x5f')]:_0xaaf33f[_0x7e65('0x60')]},'attributes':['id',_0x7e65('0x2a')],'raw':!![]});}}})[_0x7e65('0x26')](function(_0x5fdea1){var _0x219e15={};if(_0x5fdea1){_[_0x7e65('0x59')](_0x219e15,_[_0x7e65('0x63')](_0x3c44c7[_0x7e65('0x64')],[_0x7e65('0x65'),_0x7e65('0x66'),'id']));_0x219e15[_0x7e65('0x67')]=0x15;_0x219e15[_0x7e65('0x68')]=_0x7e65('0x69');_0x219e15[_0x7e65('0x6a')]=_0x5fdea1[_0x7e65('0x2a')];_0x219e15[_0x7e65('0x6b')]=_0x5e47ba[_0x7e65('0x6c')][_0x7e65('0x2a')];_0x219e15['UserId']=_0x5e47ba['user']['id'];_0x219e15[_0x7e65('0x69')]=!![];_0x219e15[_0x7e65('0x6d')]=moment()[_0x7e65('0x6e')](_0x7e65('0x6f'));_0x219e15[_0x7e65('0x70')]=_0x3c44c7[_0x7e65('0x71')];_0x219e15['campaigntype']=_0x3c44c7[_0x7e65('0x5f')]?_0x7e65('0x72'):'ivr';return db[_0x7e65('0x73')][_0x7e65('0x5a')]({'where':{'id':_0x219e15[_0x7e65('0x74')]},'attributes':[_0x7e65('0x75'),_0x7e65('0x76')]})[_0x7e65('0x26')](function(_0x18123a){if(!_[_0x7e65('0x77')](_0x14d342)&&!_[_0x7e65('0x77')](_0x18123a['firstName'])){_0x219e15[_0x7e65('0x78')]=_0x18123a[_0x7e65('0x75')];if(!_['isNil'](_0x18123a[_0x7e65('0x76')])){_0x219e15[_0x7e65('0x78')]+='\x20'+_0x18123a[_0x7e65('0x76')];}}})[_0x7e65('0x79')](function(){return db[_0x7e65('0x7a')]['create'](_0x219e15);});}})[_0x7e65('0x26')](function(){return _0x14d342[_0x7e65('0x1a')](0xcc)['end']();})[_0x7e65('0x56')](handleError(_0x14d342,null));};exports[_0x7e65('0x7b')]=function(_0x2e71cb,_0x4c0d33,_0x4753d8){var _0x59ca32=[];return db[_0x7e65('0x73')][_0x7e65('0x5e')]()['then'](function(_0x3e065e){_0x59ca32=_['keys'](_0x3e065e);return _0x2e71cb[_0x7e65('0x6c')][_0x7e65('0x7c')]({'where':{'type':_0x7e65('0x7d'),'dialActive':!![],'dialMethod':_0x7e65('0x7e')},'attributes':['id',_0x7e65('0x7f')],'raw':!![]});})['then'](function(_0x210b7a){if(_0x210b7a&&_0x210b7a[_0x7e65('0x48')]){return db[_0x7e65('0x80')][_0x7e65('0x81')](function(_0x28bc6f){var _0x26a6f4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7e65('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x7e65('0x82')](_0x210b7a,'id')},'$or':[{'UserId':null},{'UserId':_0x2e71cb[_0x7e65('0x6c')]['id']}]};var _0x39f0d4=[];if(_0x2e71cb[_0x7e65('0x5c')][_0x7e65('0x83')]&&_0x2e71cb[_0x7e65('0x5c')][_0x7e65('0x83')]==='prev'){if(!_[_0x7e65('0x84')](_0x2e71cb[_0x7e65('0x5c')][_0x7e65('0x85')])){_0x26a6f4['id']={'$in':_0x2e71cb[_0x7e65('0x5c')][_0x7e65('0x85')]};}_0x39f0d4=[[_0x7e65('0x86'),'ASC'],[_0x7e65('0x87'),_0x210b7a[0x0][_0x7e65('0x7f')]===_0x7e65('0x88')?_0x7e65('0x89'):_0x7e65('0x88')],db[_0x7e65('0x80')][_0x7e65('0x8a')](_0x7e65('0x8b')),['id',_0x7e65('0x89')]];}else{if(!_[_0x7e65('0x84')](_0x2e71cb[_0x7e65('0x5c')][_0x7e65('0x85')])){_0x26a6f4['id']={'$notIn':_0x2e71cb[_0x7e65('0x5c')][_0x7e65('0x85')]};}_0x39f0d4=[[_0x7e65('0x86'),_0x7e65('0x89')],[_0x7e65('0x87'),_0x210b7a[0x0][_0x7e65('0x7f')]],db['sequelize'][_0x7e65('0x8a')](_0x7e65('0x8c')),['id','ASC']];}return db[_0x7e65('0x2c')][_0x7e65('0x8d')]({'attributes':['id',_0x7e65('0x8e')],'where':_0x26a6f4,'order':_0x39f0d4,'transaction':_0x28bc6f,'lock':_0x28bc6f[_0x7e65('0x8f')][_0x7e65('0x90')],'include':[{'model':db[_0x7e65('0x73')],'as':'Contact','attributes':_0x59ca32,'include':[{'model':db[_0x7e65('0x91')],'as':'Company','attributes':['id',_0x7e65('0x2a')]}]},{'model':db[_0x7e65('0x92')],'as':'List','attributes':['id',_0x7e65('0x2a')]},{'model':db[_0x7e65('0x61')],'as':_0x7e65('0x93'),'attributes':['id',_0x7e65('0x2a'),_0x7e65('0x94')]}]})['then'](function(_0x4bcc93){if(_0x4bcc93){return _0x4bcc93[_0x7e65('0x25')]({'UserId':_0x2e71cb[_0x7e65('0x6c')]['id']},{'transaction':_0x28bc6f});}});});}})[_0x7e65('0x26')](handleEntityNotFound(_0x4c0d33,null))[_0x7e65('0x26')](respondWithResult(_0x4c0d33,null))[_0x7e65('0x56')](handleError(_0x4c0d33,null));};exports[_0x7e65('0x95')]=function(_0x31f3c8,_0x318398,_0x354adc){return _0x31f3c8[_0x7e65('0x6c')][_0x7e65('0x7c')]({'where':{'type':_0x7e65('0x7d'),'dialActive':!![],'dialMethod':_0x7e65('0x7e')},'attributes':['id'],'raw':!![]})[_0x7e65('0x26')](function(_0x44f8d5){if(_0x44f8d5&&_0x44f8d5[_0x7e65('0x48')]){return db['CmHopper'][_0x7e65('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7e65('0x6e')](_0x7e65('0x6f'))},'VoiceQueueId':{'$in':_[_0x7e65('0x82')](_0x44f8d5,'id')},'$or':[{'UserId':null},{'UserId':_0x31f3c8[_0x7e65('0x6c')]['id']}]}});}return 0x0;})[_0x7e65('0x26')](function(_0x2f6c1b){if(!_[_0x7e65('0x77')](_0x2f6c1b)&&_[_0x7e65('0x96')](_0x2f6c1b)){return _0x318398[_0x7e65('0x1a')](0xc8)[_0x7e65('0x1c')]({'contacts':_0x2f6c1b});}else{logger[_0x7e65('0x28')](_0x7e65('0x97'),_0x7e65('0x95'),0x194,_0x7e65('0x98'));_0x318398['sendStatus'](0x194);}})[_0x7e65('0x56')](handleError(_0x318398,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 44e126b..b720b75 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 _0x5542=['./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone','priority','lodash','api','moment','bluebird','request-promise'];(function(_0x411090,_0x294774){var _0x3608f2=function(_0x807123){while(--_0x807123){_0x411090['push'](_0x411090['shift']());}};_0x3608f2(++_0x294774);}(_0x5542,0x1b7));var _0x2554=function(_0x1af71a,_0x1d18ee){_0x1af71a=_0x1af71a-0x0;var _0x3acd6a=_0x5542[_0x1af71a];return _0x3acd6a;};'use strict';var _=require(_0x2554('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2554('0x1'));var moment=require(_0x2554('0x2'));var BPromise=require(_0x2554('0x3'));var rp=require(_0x2554('0x4'));var attributes=require(_0x2554('0x5'));module[_0x2554('0x6')]=function(_0x8ead41,_0x37f07e){return _0x8ead41[_0x2554('0x7')]('CmHopper',attributes,{'tableName':_0x2554('0x8'),'paranoid':![],'indexes':[{'name':_0x2554('0x9'),'fields':[_0x2554('0x9')]},{'name':_0x2554('0xa'),'fields':[_0x2554('0xa')]},{'name':_0x2554('0xb'),'fields':[_0x2554('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa000=['bluebird','request-promise','exports','define','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x97bb2b,_0x3f932a){var _0x2bd3dc=function(_0x5a78ae){while(--_0x5a78ae){_0x97bb2b['push'](_0x97bb2b['shift']());}};_0x2bd3dc(++_0x3f932a);}(_0xa000,0x1cf));var _0x0a00=function(_0x31773f,_0x5bd52a){_0x31773f=_0x31773f-0x0;var _0x12623b=_0xa000[_0x31773f];return _0x12623b;};'use strict';var _=require(_0x0a00('0x0'));var util=require(_0x0a00('0x1'));var logger=require(_0x0a00('0x2'))(_0x0a00('0x3'));var moment=require(_0x0a00('0x4'));var BPromise=require(_0x0a00('0x5'));var rp=require(_0x0a00('0x6'));var attributes=require('./cmHopper.attributes');module[_0x0a00('0x7')]=function(_0x63d602,_0x21cdbb){return _0x63d602[_0x0a00('0x8')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0a00('0x9'),'fields':[_0x0a00('0x9')]},{'name':_0x0a00('0xa'),'fields':['phone']},{'name':_0x0a00('0xb'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index b0f4720..ef1a574 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 _0x105d=['destroy','MoveContactManagedDialer','CountReScheduled','findAll','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UserId','UPDATE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request\x20sent','debug','stringify','code','error','CmHopper,\x20%s,\x20%s','message','info','result','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','catch','ShowCmHopper','find','then','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','CmContact','describe','sequelize','transaction','LOCK','Contact','keys','length','push','all','GetContactDialer','CmHopperFinal'];(function(_0x798ed8,_0x57b66a){var _0x18cbda=function(_0x5b0309){while(--_0x5b0309){_0x798ed8['push'](_0x798ed8['shift']());}};_0x18cbda(++_0x57b66a);}(_0x105d,0x96));var _0xd105=function(_0x239e4f,_0x4dc70e){_0x239e4f=_0x239e4f-0x0;var _0xd7a42a=_0x105d[_0x239e4f];return _0xd7a42a;};'use strict';var _=require(_0xd105('0x0'));var util=require(_0xd105('0x1'));var moment=require(_0xd105('0x2'));var BPromise=require(_0xd105('0x3'));var rs=require(_0xd105('0x4'));var fs=require('fs');var Redis=require(_0xd105('0x5'));var db=require(_0xd105('0x6'))['db'];var utils=require(_0xd105('0x7'));var logger=require(_0xd105('0x8'))('rpc');var config=require(_0xd105('0x9'));var jayson=require(_0xd105('0xa'));var client=jayson[_0xd105('0xb')][_0xd105('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x159ad5,_0x17dddb,_0x1b30e2){return new BPromise(function(_0x56dc8a,_0xe782d6){return client['request'](_0x159ad5,_0x1b30e2)['then'](function(_0x6818be){logger['info']('CmHopper,\x20%s,\x20%s',_0x17dddb,_0xd105('0xd'));logger[_0xd105('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x17dddb,_0xd105('0xd'),JSON[_0xd105('0xf')](_0x6818be));if(_0x6818be['error']){if(_0x6818be['error'][_0xd105('0x10')]===0x1f4){logger[_0xd105('0x11')](_0xd105('0x12'),_0x17dddb,_0x6818be[_0xd105('0x11')]['message']);return _0xe782d6(_0x6818be[_0xd105('0x11')][_0xd105('0x13')]);}logger[_0xd105('0x11')](_0xd105('0x12'),_0x17dddb,_0x6818be[_0xd105('0x11')][_0xd105('0x13')]);return _0x56dc8a(_0x6818be[_0xd105('0x11')]['message']);}else{logger[_0xd105('0x14')]('CmHopper,\x20%s,\x20%s',_0x17dddb,_0xd105('0xd'));_0x56dc8a(_0x6818be[_0xd105('0x15')][_0xd105('0x13')]);}})['catch'](function(_0x5e7d67){logger['error']('CmHopper,\x20%s,\x20%s',_0x17dddb,_0x5e7d67);_0xe782d6(_0x5e7d67);});});}exports[_0xd105('0x16')]=function(_0x3ba144){var _0x487f95=this;return new Promise(function(_0x280798,_0x499e7e){return db[_0xd105('0x17')]['findAll']({'raw':_0x3ba144[_0xd105('0x18')]?_0x3ba144['options'][_0xd105('0x19')]===undefined?!![]:![]:!![],'where':_0x3ba144[_0xd105('0x18')]?_0x3ba144[_0xd105('0x18')][_0xd105('0x1a')]||null:null,'attributes':_0x3ba144['options']?_0x3ba144[_0xd105('0x18')][_0xd105('0x1b')]||null:null,'limit':_0x3ba144['options']?_0x3ba144[_0xd105('0x18')][_0xd105('0x1c')]||null:null,'include':_0x3ba144['options']?_0x3ba144[_0xd105('0x18')][_0xd105('0x1d')]?_[_0xd105('0x1e')](_0x3ba144[_0xd105('0x18')][_0xd105('0x1d')],function(_0xb3b653){return{'model':db[_0xb3b653['model']],'as':_0xb3b653['as'],'attributes':_0xb3b653[_0xd105('0x1b')],'include':_0xb3b653['include']?_[_0xd105('0x1e')](_0xb3b653[_0xd105('0x1d')],function(_0x3047dd){return{'model':db[_0x3047dd[_0xd105('0x1f')]],'as':_0x3047dd['as'],'attributes':_0x3047dd['attributes'],'include':_0x3047dd[_0xd105('0x1d')]?_[_0xd105('0x1e')](_0x3047dd['include'],function(_0x2af4f2){return{'model':db[_0x2af4f2['model']],'as':_0x2af4f2['as'],'attributes':_0x2af4f2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e9283){logger[_0xd105('0x14')]('GetCmHopper',_0x3ba144);logger[_0xd105('0xe')](_0xd105('0x16'),_0x3ba144,JSON[_0xd105('0xf')](_0x1e9283));_0x280798(_0x1e9283);})[_0xd105('0x20')](function(_0x2bf38a){logger[_0xd105('0x11')](_0xd105('0x16'),_0x2bf38a[_0xd105('0x13')],_0x3ba144);_0x499e7e(_0x487f95[_0xd105('0x11')](0x1f4,_0x2bf38a['message']));});});};exports[_0xd105('0x21')]=function(_0x124bb4){var _0x12f296=this;return new Promise(function(_0x578c8f,_0x5c4524){return db[_0xd105('0x17')][_0xd105('0x22')]({'raw':_0x124bb4[_0xd105('0x18')]?_0x124bb4[_0xd105('0x18')][_0xd105('0x19')]===undefined?!![]:![]:!![],'where':_0x124bb4[_0xd105('0x18')]?_0x124bb4['options'][_0xd105('0x1a')]||null:null,'attributes':_0x124bb4[_0xd105('0x18')]?_0x124bb4[_0xd105('0x18')]['attributes']||null:null,'include':_0x124bb4[_0xd105('0x18')]?_0x124bb4['options'][_0xd105('0x1d')]?_[_0xd105('0x1e')](_0x124bb4[_0xd105('0x18')][_0xd105('0x1d')],function(_0x12991b){return{'model':db[_0x12991b[_0xd105('0x1f')]],'as':_0x12991b['as'],'attributes':_0x12991b[_0xd105('0x1b')],'include':_0x12991b['include']?_[_0xd105('0x1e')](_0x12991b[_0xd105('0x1d')],function(_0x431d8a){return{'model':db[_0x431d8a[_0xd105('0x1f')]],'as':_0x431d8a['as'],'attributes':_0x431d8a['attributes'],'include':_0x431d8a['include']?_[_0xd105('0x1e')](_0x431d8a[_0xd105('0x1d')],function(_0x4ab677){return{'model':db[_0x4ab677['model']],'as':_0x4ab677['as'],'attributes':_0x4ab677[_0xd105('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd105('0x23')](function(_0x4dd7a9){logger[_0xd105('0x14')]('ShowCmHopper',_0x124bb4);logger[_0xd105('0xe')](_0xd105('0x21'),_0x124bb4,JSON[_0xd105('0xf')](_0x4dd7a9));_0x578c8f(_0x4dd7a9);})[_0xd105('0x20')](function(_0x198faa){logger[_0xd105('0x11')](_0xd105('0x21'),_0x198faa[_0xd105('0x13')],_0x124bb4);_0x5c4524(_0x12f296['error'](0x1f4,_0x198faa[_0xd105('0x13')]));});});};exports[_0xd105('0x24')]=function(_0x4fa827){var _0xcb97e8=this;return new Promise(function(_0x1796f0,_0x4e1787){return db[_0xd105('0x17')][_0xd105('0x25')](_0x4fa827[_0xd105('0x26')],{'raw':_0x4fa827['options']?_0x4fa827[_0xd105('0x18')][_0xd105('0x19')]===undefined?!![]:![]:!![]})[_0xd105('0x23')](function(_0x1a8f23){logger['info'](_0xd105('0x24'),_0x4fa827);logger[_0xd105('0xe')](_0xd105('0x24'),_0x4fa827,JSON['stringify'](_0x1a8f23));_0x1796f0(_0x1a8f23);})[_0xd105('0x20')](function(_0x2a80c5){logger[_0xd105('0x11')](_0xd105('0x24'),_0x2a80c5[_0xd105('0x13')],_0x4fa827);_0x4e1787(_0xcb97e8[_0xd105('0x11')](0x1f4,_0x2a80c5[_0xd105('0x13')]));});});};exports[_0xd105('0x27')]=function(_0x1e7b07){var _0x496186=this;return new Promise(function(_0x484e1f,_0x126482){return db[_0xd105('0x17')][_0xd105('0x28')](_0x1e7b07[_0xd105('0x26')],{'raw':_0x1e7b07[_0xd105('0x18')]?_0x1e7b07['options'][_0xd105('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e7b07[_0xd105('0x18')]?_0x1e7b07[_0xd105('0x18')][_0xd105('0x1a')]||null:null,'attributes':_0x1e7b07['options']?_0x1e7b07['options'][_0xd105('0x1b')]||null:null,'limit':_0x1e7b07[_0xd105('0x18')]?_0x1e7b07[_0xd105('0x18')][_0xd105('0x1c')]||null:null})['then'](function(_0x4cccca){logger[_0xd105('0x14')](_0xd105('0x27'),_0x1e7b07);logger[_0xd105('0xe')]('UpdateCmHopper',_0x1e7b07,JSON['stringify'](_0x4cccca));_0x484e1f(_0x4cccca);})[_0xd105('0x20')](function(_0x3a4c1c){logger['error'](_0xd105('0x27'),_0x3a4c1c['message'],_0x1e7b07);_0x126482(_0x496186[_0xd105('0x11')](0x1f4,_0x3a4c1c['message']));});});};exports[_0xd105('0x29')]=function(_0x595418){var _0x38e025=this;return new Promise(function(_0x1f62aa,_0x1f2dbd){return db[_0xd105('0x17')]['destroy']({'where':_0x595418[_0xd105('0x18')]?_0x595418[_0xd105('0x18')]['where']||null:null})['then'](function(_0x675abf){logger['info']('DestroyCmHopper',_0x595418);logger[_0xd105('0xe')](_0xd105('0x29'),_0x595418,JSON['stringify'](_0x675abf));_0x1f62aa(_0x675abf);})[_0xd105('0x20')](function(_0x492e87){logger['error'](_0xd105('0x29'),_0x492e87['message'],_0x595418);_0x1f2dbd(_0x38e025[_0xd105('0x11')](0x1f4,_0x492e87['message']));});});};exports['GetContactDialer']=function(_0x25636a){var _0xc56a3c=this;return new Promise(function(_0x4bdc2c,_0x20a8a6){return db[_0xd105('0x2a')][_0xd105('0x2b')]()[_0xd105('0x23')](function(_0x587376){return db[_0xd105('0x2c')][_0xd105('0x2d')](function(_0x130fa2){return db[_0xd105('0x17')]['findAll']({'where':_0x25636a[_0xd105('0x18')]?_0x25636a[_0xd105('0x18')][_0xd105('0x1a')]||null:null,'attributes':_0x25636a[_0xd105('0x18')]?_0x25636a[_0xd105('0x18')][_0xd105('0x1b')]||null:null,'limit':_0x25636a[_0xd105('0x18')]?_0x25636a[_0xd105('0x18')][_0xd105('0x1c')]||null:null,'order':_0x25636a[_0xd105('0x18')]?_0x25636a['options']['order']||null:null,'transaction':_0x130fa2,'lock':_0x130fa2[_0xd105('0x2e')]['UPDATE'],'include':[{'model':db[_0xd105('0x2a')],'as':_0xd105('0x2f'),'attributes':_[_0xd105('0x30')](_0x587376)}]})[_0xd105('0x23')](function(_0x399c40){var _0x53b955=[];for(var _0x46f071=0x0;_0x46f071<_0x399c40[_0xd105('0x31')];_0x46f071+=0x1){_0x53b955[_0xd105('0x32')](_0x399c40[_0x46f071][_0xd105('0x28')](_0x25636a[_0xd105('0x26')],{'transaction':_0x130fa2}));}return BPromise[_0xd105('0x33')](_0x53b955);});})[_0xd105('0x23')](function(_0x59f8e3){logger[_0xd105('0x14')](_0xd105('0x34'),_0x25636a);logger[_0xd105('0xe')](_0xd105('0x34'),_0x25636a,JSON[_0xd105('0xf')](_0x59f8e3));_0x4bdc2c(_0x59f8e3);})[_0xd105('0x20')](function(_0x4a7ba6){logger[_0xd105('0x11')](_0xd105('0x34'),_0x4a7ba6[_0xd105('0x13')],_0x25636a);_0x20a8a6(_0xc56a3c[_0xd105('0x11')](0x1f4,_0x4a7ba6[_0xd105('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x5ac86d){var _0x1affc9=this;return new Promise(function(_0x3f48c7,_0xf2ac43){return db['sequelize']['transaction'](function(_0x1c40ce){return db[_0xd105('0x35')]['create'](_0x5ac86d[_0xd105('0x26')],{'raw':_0x5ac86d['options']?_0x5ac86d[_0xd105('0x18')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1c40ce})[_0xd105('0x23')](function(){return db[_0xd105('0x17')][_0xd105('0x36')]({'where':_0x5ac86d[_0xd105('0x18')]?_0x5ac86d[_0xd105('0x18')][_0xd105('0x1a')]||null:null,'transaction':_0x1c40ce});});})[_0xd105('0x23')](function(_0x111a47){logger[_0xd105('0x14')]('MoveContactManagedDialer',_0x5ac86d);logger[_0xd105('0xe')](_0xd105('0x37'),_0x5ac86d,JSON[_0xd105('0xf')](_0x111a47));_0x3f48c7(_0x111a47);})['catch'](function(_0x1f7fef){logger[_0xd105('0x11')]('MoveContactManagedDialer',_0x1f7fef[_0xd105('0x13')],_0x5ac86d);_0xf2ac43(_0x1affc9['error'](0x1f4,_0x1f7fef[_0xd105('0x13')]));});});};exports[_0xd105('0x38')]=function(_0x1d4e92){var _0x4c29d5=this;return new Promise(function(_0x4bdd80,_0x20fffd){return db[_0xd105('0x17')][_0xd105('0x39')]({'raw':_0x1d4e92[_0xd105('0x18')]?_0x1d4e92[_0xd105('0x18')][_0xd105('0x19')]===undefined?!![]:![]:!![],'where':_0x1d4e92['options']?_0x1d4e92['options'][_0xd105('0x1a')]||null:null,'attributes':[[db[_0xd105('0x2c')]['fn'](_0xd105('0x3a'),db['sequelize']['fn']('IF',db[_0xd105('0x2c')]['literal'](_0xd105('0x3b')+util['format'](_0xd105('0x3c'),moment()['format'](_0xd105('0x3d')))+_0xd105('0x3e')))),_0xd105('0x3f')]]})[_0xd105('0x23')](function(_0x2d33e3){logger[_0xd105('0x14')](_0xd105('0x38'),_0x1d4e92);logger['debug'](_0xd105('0x38'),_0x1d4e92,JSON[_0xd105('0xf')](_0x2d33e3));_0x4bdd80(_0x2d33e3);})['catch'](function(_0x2e1a9b){logger[_0xd105('0x11')](_0xd105('0x38'),_0x2e1a9b[_0xd105('0x13')],_0x1d4e92);_0x20fffd(_0x4c29d5[_0xd105('0x11')](0x1f4,_0x2e1a9b[_0xd105('0x13')]));});});};exports[_0xd105('0x40')]=function(_0x352f0a){var _0x2ffa06=this;return new Promise(function(_0x58ac5d,_0x28db28){return db[_0xd105('0x2a')][_0xd105('0x2b')]()[_0xd105('0x23')](function(_0x224fe1){return db[_0xd105('0x2c')][_0xd105('0x2d')](function(_0x40d3a0){return db[_0xd105('0x17')][_0xd105('0x39')]({'where':_0x352f0a['options']?_0x352f0a[_0xd105('0x18')][_0xd105('0x1a')]||null:null,'attributes':_0x352f0a['options']?_0x352f0a[_0xd105('0x18')][_0xd105('0x1b')]||null:null,'limit':0x1,'order':_0x352f0a['options']?_0x352f0a[_0xd105('0x18')][_0xd105('0x41')]||null:null,'group':db[_0xd105('0x17')][_0xd105('0x42')],'transaction':_0x40d3a0,'lock':_0x40d3a0[_0xd105('0x2e')][_0xd105('0x43')],'include':_0x352f0a[_0xd105('0x18')]?_0x352f0a['options'][_0xd105('0x1d')]?_[_0xd105('0x1e')](_0x352f0a[_0xd105('0x18')][_0xd105('0x1d')],function(_0x82c2a4){return{'model':db[_0x82c2a4['model']],'as':_0x82c2a4['as'],'attributes':_0x82c2a4[_0xd105('0x1b')],'include':_0x82c2a4[_0xd105('0x1d')]?_[_0xd105('0x1e')](_0x82c2a4[_0xd105('0x1d')],function(_0x3e9552){return{'model':db[_0x3e9552[_0xd105('0x1f')]],'as':_0x3e9552['as'],'attributes':_0x3e9552[_0xd105('0x1b')],'include':_0x3e9552[_0xd105('0x1d')]?_[_0xd105('0x1e')](_0x3e9552[_0xd105('0x1d')],function(_0x4e4802){return{'model':db[_0x4e4802['model']],'as':_0x4e4802['as'],'attributes':_0x4e4802['attributes']};}):[]};}):[]};}):[]:[]})[_0xd105('0x23')](function(_0x4871d7){var _0x59c225=[];for(var _0x19b88a=0x0;_0x19b88a<_0x4871d7[_0xd105('0x31')];_0x19b88a+=0x1){_0x59c225[_0xd105('0x32')](_0x4871d7[_0x19b88a]['update'](_0x352f0a['body'],{'transaction':_0x40d3a0}));}return BPromise[_0xd105('0x33')](_0x59c225);});})[_0xd105('0x23')](function(_0x27d3e5){logger[_0xd105('0x14')]('GetContactRecallMe',_0x352f0a);logger[_0xd105('0xe')](_0xd105('0x40'),_0x352f0a,JSON[_0xd105('0xf')](_0x27d3e5));_0x58ac5d(_0x27d3e5);})['catch'](function(_0x454c1a){logger[_0xd105('0x11')](_0xd105('0x40'),_0x454c1a[_0xd105('0x13')],_0x352f0a);_0x28db28(_0x2ffa06['error'](0x1f4,_0x454c1a[_0xd105('0x13')]));});});});}; \ No newline at end of file +var _0x6340=['transaction','order','LOCK','UPDATE','Contact','push','update','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','UserId','length','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize'];(function(_0x4e3042,_0x26264a){var _0x82941f=function(_0x5d1ab2){while(--_0x5d1ab2){_0x4e3042['push'](_0x4e3042['shift']());}};_0x82941f(++_0x26264a);}(_0x6340,0x89));var _0x0634=function(_0x2a371a,_0x2f5ad0){_0x2a371a=_0x2a371a-0x0;var _0x40ef68=_0x6340[_0x2a371a];return _0x40ef68;};'use strict';var _=require(_0x0634('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0634('0x1'));var db=require(_0x0634('0x2'))['db'];var utils=require(_0x0634('0x3'));var logger=require(_0x0634('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0634('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1abd45,_0x56792d,_0x1683d5){return new BPromise(function(_0x560f26,_0xea650){return client['request'](_0x1abd45,_0x1683d5)[_0x0634('0x6')](function(_0x52722f){logger[_0x0634('0x7')](_0x0634('0x8'),_0x56792d,_0x0634('0x9'));logger[_0x0634('0xa')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x56792d,'request\x20sent',JSON[_0x0634('0xb')](_0x52722f));if(_0x52722f['error']){if(_0x52722f[_0x0634('0xc')][_0x0634('0xd')]===0x1f4){logger[_0x0634('0xc')](_0x0634('0x8'),_0x56792d,_0x52722f[_0x0634('0xc')]['message']);return _0xea650(_0x52722f[_0x0634('0xc')][_0x0634('0xe')]);}logger[_0x0634('0xc')](_0x0634('0x8'),_0x56792d,_0x52722f[_0x0634('0xc')]['message']);return _0x560f26(_0x52722f['error'][_0x0634('0xe')]);}else{logger[_0x0634('0x7')](_0x0634('0x8'),_0x56792d,'request\x20sent');_0x560f26(_0x52722f[_0x0634('0xf')]['message']);}})[_0x0634('0x10')](function(_0x5d6f20){logger[_0x0634('0xc')](_0x0634('0x8'),_0x56792d,_0x5d6f20);_0xea650(_0x5d6f20);});});}exports['GetCmHopper']=function(_0x37642e){var _0xbdc18c=this;return new Promise(function(_0x3bfccf,_0x94cfb5){return db[_0x0634('0x11')][_0x0634('0x12')]({'raw':_0x37642e[_0x0634('0x13')]?_0x37642e['options'][_0x0634('0x14')]===undefined?!![]:![]:!![],'where':_0x37642e[_0x0634('0x13')]?_0x37642e[_0x0634('0x13')][_0x0634('0x15')]||null:null,'attributes':_0x37642e[_0x0634('0x13')]?_0x37642e[_0x0634('0x13')][_0x0634('0x16')]||null:null,'limit':_0x37642e[_0x0634('0x13')]?_0x37642e[_0x0634('0x13')][_0x0634('0x17')]||null:null,'include':_0x37642e[_0x0634('0x13')]?_0x37642e[_0x0634('0x13')][_0x0634('0x18')]?_[_0x0634('0x19')](_0x37642e[_0x0634('0x13')]['include'],function(_0x9a87b9){return{'model':db[_0x9a87b9[_0x0634('0x1a')]],'as':_0x9a87b9['as'],'attributes':_0x9a87b9[_0x0634('0x16')],'include':_0x9a87b9[_0x0634('0x18')]?_[_0x0634('0x19')](_0x9a87b9[_0x0634('0x18')],function(_0x2b72b4){return{'model':db[_0x2b72b4['model']],'as':_0x2b72b4['as'],'attributes':_0x2b72b4[_0x0634('0x16')],'include':_0x2b72b4[_0x0634('0x18')]?_[_0x0634('0x19')](_0x2b72b4[_0x0634('0x18')],function(_0x53a54c){return{'model':db[_0x53a54c[_0x0634('0x1a')]],'as':_0x53a54c['as'],'attributes':_0x53a54c[_0x0634('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0634('0x6')](function(_0x270831){logger[_0x0634('0x7')]('GetCmHopper',_0x37642e);logger['debug']('GetCmHopper',_0x37642e,JSON['stringify'](_0x270831));_0x3bfccf(_0x270831);})['catch'](function(_0x205b6b){logger[_0x0634('0xc')](_0x0634('0x1b'),_0x205b6b[_0x0634('0xe')],_0x37642e);_0x94cfb5(_0xbdc18c[_0x0634('0xc')](0x1f4,_0x205b6b['message']));});});};exports[_0x0634('0x1c')]=function(_0x11773d){var _0x5a180a=this;return new Promise(function(_0x264ee6,_0x5824a7){return db[_0x0634('0x11')][_0x0634('0x1d')]({'raw':_0x11773d[_0x0634('0x13')]?_0x11773d[_0x0634('0x13')][_0x0634('0x14')]===undefined?!![]:![]:!![],'where':_0x11773d[_0x0634('0x13')]?_0x11773d[_0x0634('0x13')][_0x0634('0x15')]||null:null,'attributes':_0x11773d[_0x0634('0x13')]?_0x11773d[_0x0634('0x13')]['attributes']||null:null,'include':_0x11773d[_0x0634('0x13')]?_0x11773d[_0x0634('0x13')][_0x0634('0x18')]?_['map'](_0x11773d['options'][_0x0634('0x18')],function(_0x53dc3c){return{'model':db[_0x53dc3c[_0x0634('0x1a')]],'as':_0x53dc3c['as'],'attributes':_0x53dc3c['attributes'],'include':_0x53dc3c[_0x0634('0x18')]?_[_0x0634('0x19')](_0x53dc3c[_0x0634('0x18')],function(_0x3c2147){return{'model':db[_0x3c2147[_0x0634('0x1a')]],'as':_0x3c2147['as'],'attributes':_0x3c2147[_0x0634('0x16')],'include':_0x3c2147[_0x0634('0x18')]?_[_0x0634('0x19')](_0x3c2147[_0x0634('0x18')],function(_0x1ca721){return{'model':db[_0x1ca721['model']],'as':_0x1ca721['as'],'attributes':_0x1ca721[_0x0634('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0634('0x6')](function(_0xe48632){logger[_0x0634('0x7')](_0x0634('0x1c'),_0x11773d);logger[_0x0634('0xa')](_0x0634('0x1c'),_0x11773d,JSON[_0x0634('0xb')](_0xe48632));_0x264ee6(_0xe48632);})['catch'](function(_0x1cbbad){logger[_0x0634('0xc')](_0x0634('0x1c'),_0x1cbbad['message'],_0x11773d);_0x5824a7(_0x5a180a[_0x0634('0xc')](0x1f4,_0x1cbbad[_0x0634('0xe')]));});});};exports[_0x0634('0x1e')]=function(_0x2e3f34){var _0x239b8d=this;return new Promise(function(_0x2a7d15,_0xc9a342){return db['CmHopper'][_0x0634('0x1f')](_0x2e3f34['body'],{'raw':_0x2e3f34[_0x0634('0x13')]?_0x2e3f34[_0x0634('0x13')][_0x0634('0x14')]===undefined?!![]:![]:!![]})[_0x0634('0x6')](function(_0x586e34){logger[_0x0634('0x7')]('CreateCmHopper',_0x2e3f34);logger['debug'](_0x0634('0x1e'),_0x2e3f34,JSON[_0x0634('0xb')](_0x586e34));_0x2a7d15(_0x586e34);})['catch'](function(_0x5041d9){logger['error'](_0x0634('0x1e'),_0x5041d9[_0x0634('0xe')],_0x2e3f34);_0xc9a342(_0x239b8d['error'](0x1f4,_0x5041d9[_0x0634('0xe')]));});});};exports[_0x0634('0x20')]=function(_0x2bdbf4){var _0x2774a8=this;return new Promise(function(_0xa5fd8,_0x577f4e){return db[_0x0634('0x11')]['update'](_0x2bdbf4[_0x0634('0x21')],{'raw':_0x2bdbf4[_0x0634('0x13')]?_0x2bdbf4['options'][_0x0634('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bdbf4[_0x0634('0x13')]?_0x2bdbf4['options'][_0x0634('0x15')]||null:null,'attributes':_0x2bdbf4[_0x0634('0x13')]?_0x2bdbf4[_0x0634('0x13')]['attributes']||null:null,'limit':_0x2bdbf4[_0x0634('0x13')]?_0x2bdbf4['options'][_0x0634('0x17')]||null:null})[_0x0634('0x6')](function(_0x2fd263){logger[_0x0634('0x7')](_0x0634('0x20'),_0x2bdbf4);logger[_0x0634('0xa')](_0x0634('0x20'),_0x2bdbf4,JSON[_0x0634('0xb')](_0x2fd263));_0xa5fd8(_0x2fd263);})[_0x0634('0x10')](function(_0x3ff08f){logger[_0x0634('0xc')](_0x0634('0x20'),_0x3ff08f[_0x0634('0xe')],_0x2bdbf4);_0x577f4e(_0x2774a8[_0x0634('0xc')](0x1f4,_0x3ff08f['message']));});});};exports[_0x0634('0x22')]=function(_0x454fbb){var _0x1aee13=this;return new Promise(function(_0x4d64c1,_0x4a12b5){return db[_0x0634('0x11')][_0x0634('0x23')]({'where':_0x454fbb[_0x0634('0x13')]?_0x454fbb[_0x0634('0x13')]['where']||null:null})[_0x0634('0x6')](function(_0xbeb054){logger[_0x0634('0x7')]('DestroyCmHopper',_0x454fbb);logger[_0x0634('0xa')]('DestroyCmHopper',_0x454fbb,JSON[_0x0634('0xb')](_0xbeb054));_0x4d64c1(_0xbeb054);})[_0x0634('0x10')](function(_0x35c18e){logger[_0x0634('0xc')]('DestroyCmHopper',_0x35c18e['message'],_0x454fbb);_0x4a12b5(_0x1aee13[_0x0634('0xc')](0x1f4,_0x35c18e['message']));});});};exports[_0x0634('0x24')]=function(_0x44467c){var _0x439972=this;return new Promise(function(_0x574c2e,_0x4caa4c){return db[_0x0634('0x25')][_0x0634('0x26')]()[_0x0634('0x6')](function(_0x35d86f){return db[_0x0634('0x27')][_0x0634('0x28')](function(_0x2274be){return db[_0x0634('0x11')][_0x0634('0x12')]({'where':_0x44467c[_0x0634('0x13')]?_0x44467c['options'][_0x0634('0x15')]||null:null,'attributes':_0x44467c[_0x0634('0x13')]?_0x44467c[_0x0634('0x13')][_0x0634('0x16')]||null:null,'limit':_0x44467c[_0x0634('0x13')]?_0x44467c[_0x0634('0x13')][_0x0634('0x17')]||null:null,'order':_0x44467c[_0x0634('0x13')]?_0x44467c[_0x0634('0x13')][_0x0634('0x29')]||null:null,'transaction':_0x2274be,'lock':_0x2274be[_0x0634('0x2a')][_0x0634('0x2b')],'include':[{'model':db['CmContact'],'as':_0x0634('0x2c'),'attributes':_['keys'](_0x35d86f)}]})[_0x0634('0x6')](function(_0xcd1c3b){var _0x5b53d8=[];for(var _0x3aa02a=0x0;_0x3aa02a<_0xcd1c3b['length'];_0x3aa02a+=0x1){_0x5b53d8[_0x0634('0x2d')](_0xcd1c3b[_0x3aa02a][_0x0634('0x2e')](_0x44467c['body'],{'transaction':_0x2274be}));}return BPromise[_0x0634('0x2f')](_0x5b53d8);});})[_0x0634('0x6')](function(_0x3b6360){logger[_0x0634('0x7')](_0x0634('0x24'),_0x44467c);logger[_0x0634('0xa')](_0x0634('0x24'),_0x44467c,JSON[_0x0634('0xb')](_0x3b6360));_0x574c2e(_0x3b6360);})[_0x0634('0x10')](function(_0x61d10c){logger['error'](_0x0634('0x24'),_0x61d10c[_0x0634('0xe')],_0x44467c);_0x4caa4c(_0x439972[_0x0634('0xc')](0x1f4,_0x61d10c['message']));});});});};exports[_0x0634('0x30')]=function(_0x537a53){var _0x53b93b=this;return new Promise(function(_0x2158d7,_0x4d3864){return db[_0x0634('0x27')]['transaction'](function(_0x41eb3f){return db[_0x0634('0x31')][_0x0634('0x1f')](_0x537a53[_0x0634('0x21')],{'raw':_0x537a53[_0x0634('0x13')]?_0x537a53[_0x0634('0x13')][_0x0634('0x14')]===undefined?!![]:![]:!![],'transaction':_0x41eb3f})[_0x0634('0x6')](function(){return db[_0x0634('0x11')][_0x0634('0x23')]({'where':_0x537a53[_0x0634('0x13')]?_0x537a53[_0x0634('0x13')][_0x0634('0x15')]||null:null,'transaction':_0x41eb3f});});})[_0x0634('0x6')](function(_0x410ed4){logger[_0x0634('0x7')]('MoveContactManagedDialer',_0x537a53);logger[_0x0634('0xa')]('MoveContactManagedDialer',_0x537a53,JSON[_0x0634('0xb')](_0x410ed4));_0x2158d7(_0x410ed4);})[_0x0634('0x10')](function(_0x4b3bcc){logger[_0x0634('0xc')]('MoveContactManagedDialer',_0x4b3bcc[_0x0634('0xe')],_0x537a53);_0x4d3864(_0x53b93b[_0x0634('0xc')](0x1f4,_0x4b3bcc[_0x0634('0xe')]));});});};exports[_0x0634('0x32')]=function(_0x1a28af){var _0x5b76bf=this;return new Promise(function(_0x1ea8e1,_0x1e8b57){return db[_0x0634('0x11')][_0x0634('0x12')]({'raw':_0x1a28af[_0x0634('0x13')]?_0x1a28af[_0x0634('0x13')][_0x0634('0x14')]===undefined?!![]:![]:!![],'where':_0x1a28af[_0x0634('0x13')]?_0x1a28af[_0x0634('0x13')]['where']||null:null,'attributes':[[db[_0x0634('0x27')]['fn'](_0x0634('0x33'),db[_0x0634('0x27')]['fn']('IF',db[_0x0634('0x27')]['literal'](_0x0634('0x34')+util[_0x0634('0x35')](_0x0634('0x36'),moment()[_0x0634('0x35')](_0x0634('0x37')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x0634('0x6')](function(_0xe6a229){logger[_0x0634('0x7')](_0x0634('0x32'),_0x1a28af);logger['debug']('CountReScheduled',_0x1a28af,JSON[_0x0634('0xb')](_0xe6a229));_0x1ea8e1(_0xe6a229);})['catch'](function(_0x7c0868){logger[_0x0634('0xc')](_0x0634('0x32'),_0x7c0868['message'],_0x1a28af);_0x1e8b57(_0x5b76bf[_0x0634('0xc')](0x1f4,_0x7c0868['message']));});});};exports[_0x0634('0x38')]=function(_0x4ae361){var _0x3a9bc5=this;return new Promise(function(_0x46da3d,_0x3f5ecd){return db[_0x0634('0x25')][_0x0634('0x26')]()[_0x0634('0x6')](function(_0x2c203a){return db[_0x0634('0x27')][_0x0634('0x28')](function(_0x527c6b){return db[_0x0634('0x11')]['findAll']({'where':_0x4ae361[_0x0634('0x13')]?_0x4ae361[_0x0634('0x13')][_0x0634('0x15')]||null:null,'attributes':_0x4ae361[_0x0634('0x13')]?_0x4ae361[_0x0634('0x13')][_0x0634('0x16')]||null:null,'limit':0x1,'order':_0x4ae361['options']?_0x4ae361['options'][_0x0634('0x29')]||null:null,'group':db[_0x0634('0x11')][_0x0634('0x39')],'transaction':_0x527c6b,'lock':_0x527c6b[_0x0634('0x2a')][_0x0634('0x2b')],'include':_0x4ae361[_0x0634('0x13')]?_0x4ae361[_0x0634('0x13')][_0x0634('0x18')]?_[_0x0634('0x19')](_0x4ae361[_0x0634('0x13')]['include'],function(_0x52c1c7){return{'model':db[_0x52c1c7[_0x0634('0x1a')]],'as':_0x52c1c7['as'],'attributes':_0x52c1c7[_0x0634('0x16')],'include':_0x52c1c7[_0x0634('0x18')]?_['map'](_0x52c1c7[_0x0634('0x18')],function(_0x5a1aca){return{'model':db[_0x5a1aca[_0x0634('0x1a')]],'as':_0x5a1aca['as'],'attributes':_0x5a1aca[_0x0634('0x16')],'include':_0x5a1aca[_0x0634('0x18')]?_[_0x0634('0x19')](_0x5a1aca[_0x0634('0x18')],function(_0x4beb70){return{'model':db[_0x4beb70[_0x0634('0x1a')]],'as':_0x4beb70['as'],'attributes':_0x4beb70[_0x0634('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0634('0x6')](function(_0x36ae7f){var _0xefeccb=[];for(var _0x2336f1=0x0;_0x2336f1<_0x36ae7f[_0x0634('0x3a')];_0x2336f1+=0x1){_0xefeccb[_0x0634('0x2d')](_0x36ae7f[_0x2336f1][_0x0634('0x2e')](_0x4ae361[_0x0634('0x21')],{'transaction':_0x527c6b}));}return BPromise['all'](_0xefeccb);});})[_0x0634('0x6')](function(_0x56bff8){logger['info'](_0x0634('0x38'),_0x4ae361);logger['debug']('GetContactRecallMe',_0x4ae361,JSON[_0x0634('0xb')](_0x56bff8));_0x46da3d(_0x56bff8);})['catch'](function(_0x497522){logger['error'](_0x0634('0x38'),_0x497522[_0x0634('0xe')],_0x4ae361);_0x3f5ecd(_0x3a9bc5['error'](0x1f4,_0x497522['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index c3aaac3..3df5e41 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x2b92c3,_0x58bf52){var _0x32fdd8=function(_0x4d4be6){while(--_0x4d4be6){_0x2b92c3['push'](_0x2b92c3['shift']());}};_0x32fdd8(++_0x58bf52);}(_0x7a54,0x106));var _0x47a5=function(_0x4e1b0b,_0x579131){_0x4e1b0b=_0x4e1b0b-0x0;var _0x5a3796=_0x7a54[_0x4e1b0b];return _0x5a3796;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=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(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_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 diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9b0ed7f..6964347 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 _0xb83e=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0xb83e,0x117));var _0xeb83=function(_0x3eadd1,_0x6edfbc){_0x3eadd1=_0x3eadd1-0x0;var _0x15a676=_0xb83e[_0x3eadd1];return _0x15a676;};'use strict';var moment=require(_0xeb83('0x0'));var Sequelize=require(_0xeb83('0x1'));module[_0xeb83('0x2')]={'phone':{'type':Sequelize[_0xeb83('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xeb83('0x4')],'unique':_0xeb83('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xeb83('0x4')],'unique':_0xeb83('0x5')}}; \ No newline at end of file +var _0x72f1=['STRING','contactListQueue','INTEGER','moment','sequelize'];(function(_0x675119,_0x3b33af){var _0x4ddee9=function(_0x402ff3){while(--_0x402ff3){_0x675119['push'](_0x675119['shift']());}};_0x4ddee9(++_0x3b33af);}(_0x72f1,0xe4));var _0x172f=function(_0x1fcac7,_0x5ee15a){_0x1fcac7=_0x1fcac7-0x0;var _0x1327b0=_0x72f1[_0x1fcac7];return _0x1327b0;};'use strict';var moment=require(_0x172f('0x0'));var Sequelize=require(_0x172f('0x1'));module['exports']={'phone':{'type':Sequelize[_0x172f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x172f('0x3')},'ListId':{'type':Sequelize[_0x172f('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x172f('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 84df72f..48be095 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 _0x4d39=['length','order','sort','filters','filter','where','merge','type','key','VIRTUAL','field','options','findAll','rows','catch','includeAll','find','body','destroy','params','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','CmHopperBlack','rawAttributes','keys','query','intersection','model','fields','attributes'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x4d39,0x1b3));var _0x94d3=function(_0x206d7e,_0x17ddce){_0x206d7e=_0x206d7e-0x0;var _0x3987db=_0x4d39[_0x206d7e];return _0x3987db;};'use strict';var pdf=require(_0x94d3('0x0'));var emlformat=require(_0x94d3('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x94d3('0x2'));var rp=require('request-promise');var moment=require(_0x94d3('0x3'));var BPromise=require(_0x94d3('0x4'));var Mustache=require(_0x94d3('0x5'));var util=require('util');var path=require(_0x94d3('0x6'));var sox=require('sox');var csv=require(_0x94d3('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x94d3('0x8'));var squel=require(_0x94d3('0x9'));var crypto=require(_0x94d3('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x94d3('0xb'));var Papa=require(_0x94d3('0xc'));var authService=require(_0x94d3('0xd'));var hardwareService=require(_0x94d3('0xe'));var Redis=require(_0x94d3('0xf'));var qs=require(_0x94d3('0x10'));var logger=require(_0x94d3('0x11'))(_0x94d3('0x12'));var utils=require(_0x94d3('0x13'));var config=require(_0x94d3('0x14'));var db=require(_0x94d3('0x15'))['db'];function respondWithStatusCode(_0x1fa856,_0x1d75c4){_0x1d75c4=_0x1d75c4||0xcc;return function(_0xaee478){if(_0xaee478){return _0x1fa856['sendStatus'](_0x1d75c4);}return _0x1fa856[_0x94d3('0x16')](_0x1d75c4)['end']();};}function respondWithResult(_0xf12c1e,_0x4f0365){_0x4f0365=_0x4f0365||0xc8;return function(_0x1a2ba0){if(_0x1a2ba0){return _0xf12c1e[_0x94d3('0x16')](_0x4f0365)[_0x94d3('0x17')](_0x1a2ba0);}};}function respondWithFilteredResult(_0x12fe5d,_0x7ae63d){return function(_0xd99185){if(_0xd99185){var _0xea6499=_0xd99185[_0x94d3('0x18')],_0x17f051=_0x7ae63d[_0x94d3('0x19')],_0x3105ac=_0x7ae63d[_0x94d3('0x19')]+_0x7ae63d[_0x94d3('0x1a')],_0x217094;if(_0x3105ac>=_0xea6499){_0x3105ac=_0xea6499;_0x217094=0xc8;}else{_0x217094=0xce;}_0x12fe5d[_0x94d3('0x16')](_0x217094);return _0x12fe5d[_0x94d3('0x1b')](_0x94d3('0x1c'),_0x17f051+'-'+_0x3105ac+'/'+_0xea6499)[_0x94d3('0x17')](_0xd99185);}return null;};}function patchUpdates(_0x5d7c3c){return function(_0x594928){try{jsonpatch[_0x94d3('0x1d')](_0x594928,_0x5d7c3c,!![]);}catch(_0x11a23f){return BPromise[_0x94d3('0x1e')](_0x11a23f);}return _0x594928[_0x94d3('0x1f')]();};}function saveUpdates(_0x393a93,_0x18f80a){return function(_0x3d454){if(_0x3d454){return _0x3d454[_0x94d3('0x20')](_0x393a93)[_0x94d3('0x21')](function(_0xe642a3){return _0xe642a3;});}return null;};}function removeEntity(_0x59f50d,_0x24171c){return function(_0x1a4ca3){if(_0x1a4ca3){return _0x1a4ca3['destroy']()['then'](function(){_0x59f50d[_0x94d3('0x16')](0xcc)[_0x94d3('0x22')]();});}};}function handleEntityNotFound(_0x3f0b7e,_0x3463d5){return function(_0x521e0f){if(!_0x521e0f){_0x3f0b7e[_0x94d3('0x23')](0x194);}return _0x521e0f;};}function handleError(_0x1e18bb,_0xf2b2d1){_0xf2b2d1=_0xf2b2d1||0x1f4;return function(_0x152b02){logger[_0x94d3('0x24')](_0x152b02[_0x94d3('0x25')]);if(_0x152b02[_0x94d3('0x26')]){delete _0x152b02['name'];}_0x1e18bb[_0x94d3('0x16')](_0xf2b2d1)[_0x94d3('0x27')](_0x152b02);};}exports['index']=function(_0x56a373,_0x45919a){var _0x52d593={},_0x49db66={},_0x51a7a8={'count':0x0,'rows':[]};var _0x4a4954=db[_0x94d3('0x28')][_0x94d3('0x29')];_0x49db66['model']=_[_0x94d3('0x2a')](_0x4a4954);_0x49db66[_0x94d3('0x2b')]=_[_0x94d3('0x2a')](_0x56a373[_0x94d3('0x2b')]);_0x49db66['filters']=_[_0x94d3('0x2c')](_0x49db66[_0x94d3('0x2d')],_0x49db66[_0x94d3('0x2b')]);_0x52d593['attributes']=_[_0x94d3('0x2c')](_0x49db66[_0x94d3('0x2d')],qs[_0x94d3('0x2e')](_0x56a373['query'][_0x94d3('0x2e')]));_0x52d593[_0x94d3('0x2f')]=_0x52d593['attributes'][_0x94d3('0x30')]?_0x52d593['attributes']:_0x49db66['model'];if(!_0x56a373['query']['hasOwnProperty']('nolimit')){_0x52d593[_0x94d3('0x1a')]=qs[_0x94d3('0x1a')](_0x56a373[_0x94d3('0x2b')][_0x94d3('0x1a')]);_0x52d593[_0x94d3('0x19')]=qs[_0x94d3('0x19')](_0x56a373[_0x94d3('0x2b')][_0x94d3('0x19')]);}_0x52d593[_0x94d3('0x31')]=qs[_0x94d3('0x32')](_0x56a373[_0x94d3('0x2b')][_0x94d3('0x32')]);_0x52d593['where']=qs[_0x94d3('0x33')](_['pick'](_0x56a373[_0x94d3('0x2b')],_0x49db66[_0x94d3('0x33')]));if(_0x56a373['query'][_0x94d3('0x34')]){_0x52d593[_0x94d3('0x35')]=_[_0x94d3('0x36')](_0x52d593['where'],{'$or':_['map'](_0x4a4954,function(_0x4547f2){if(_0x4547f2[_0x94d3('0x37')][_0x94d3('0x38')]!==_0x94d3('0x39')){var _0x19a794={};_0x19a794[_0x4547f2[_0x94d3('0x3a')]]={'$like':'%'+_0x56a373[_0x94d3('0x2b')][_0x94d3('0x34')]+'%'};return _0x19a794;}})});}_0x52d593=_[_0x94d3('0x36')]({},_0x52d593,_0x56a373[_0x94d3('0x3b')]);var _0x5d6794={'where':_0x52d593['where']};return db[_0x94d3('0x28')]['count'](_0x5d6794)[_0x94d3('0x21')](function(_0x1362a6){_0x51a7a8[_0x94d3('0x18')]=_0x1362a6;if(_0x56a373[_0x94d3('0x2b')]['includeAll']){_0x52d593['include']=[{'all':!![]}];}return db[_0x94d3('0x28')][_0x94d3('0x3c')](_0x52d593);})[_0x94d3('0x21')](function(_0x4fe1a1){_0x51a7a8[_0x94d3('0x3d')]=_0x4fe1a1;return _0x51a7a8;})[_0x94d3('0x21')](respondWithFilteredResult(_0x45919a,_0x52d593))[_0x94d3('0x3e')](handleError(_0x45919a,null));};exports['show']=function(_0x59b179,_0x1629d8){var _0x4bc4ce={'raw':!![],'where':{'id':_0x59b179['params']['id']}},_0x26446d={};_0x26446d['model']=_[_0x94d3('0x2a')](db[_0x94d3('0x28')]['rawAttributes']);_0x26446d[_0x94d3('0x2b')]=_[_0x94d3('0x2a')](_0x59b179[_0x94d3('0x2b')]);_0x26446d[_0x94d3('0x33')]=_['intersection'](_0x26446d['model'],_0x26446d[_0x94d3('0x2b')]);_0x4bc4ce[_0x94d3('0x2f')]=_[_0x94d3('0x2c')](_0x26446d['model'],qs[_0x94d3('0x2e')](_0x59b179[_0x94d3('0x2b')][_0x94d3('0x2e')]));_0x4bc4ce[_0x94d3('0x2f')]=_0x4bc4ce[_0x94d3('0x2f')]['length']?_0x4bc4ce[_0x94d3('0x2f')]:_0x26446d[_0x94d3('0x2d')];if(_0x59b179['query'][_0x94d3('0x3f')]){_0x4bc4ce['include']=[{'all':!![]}];}_0x4bc4ce=_['merge']({},_0x4bc4ce,_0x59b179['options']);return db[_0x94d3('0x28')][_0x94d3('0x40')](_0x4bc4ce)[_0x94d3('0x21')](handleEntityNotFound(_0x1629d8,null))[_0x94d3('0x21')](respondWithResult(_0x1629d8,null))['catch'](handleError(_0x1629d8,null));};exports[_0x94d3('0x20')]=function(_0x3acd61,_0x3014a6){if(_0x3acd61[_0x94d3('0x41')]['id']){delete _0x3acd61[_0x94d3('0x41')]['id'];}return db[_0x94d3('0x28')][_0x94d3('0x40')]({'where':{'id':_0x3acd61['params']['id']}})[_0x94d3('0x21')](handleEntityNotFound(_0x3014a6,null))[_0x94d3('0x21')](saveUpdates(_0x3acd61['body'],null))[_0x94d3('0x21')](respondWithResult(_0x3014a6,null))[_0x94d3('0x3e')](handleError(_0x3014a6,null));};exports[_0x94d3('0x42')]=function(_0x4e676b,_0x3aba14){return db[_0x94d3('0x28')][_0x94d3('0x40')]({'where':{'id':_0x4e676b[_0x94d3('0x43')]['id']}})[_0x94d3('0x21')](handleEntityNotFound(_0x3aba14,null))[_0x94d3('0x21')](removeEntity(_0x3aba14,null))[_0x94d3('0x3e')](handleError(_0x3aba14,null));};exports[_0x94d3('0x44')]=function(_0x3c833f,_0x54093b){return db[_0x94d3('0x28')]['describe']()[_0x94d3('0x21')](respondWithResult(_0x54093b,null))['catch'](handleError(_0x54093b,null));}; \ No newline at end of file +var _0xb1d0=['then','error','stack','name','index','CmHopperBlack','rawAttributes','keys','query','filters','intersection','attributes','fields','length','model','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','params','find','body','destroy','describe','html-pdf','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x18e72d,_0x3d32ed){var _0x311e26=function(_0x38b220){while(--_0x38b220){_0x18e72d['push'](_0x18e72d['shift']());}};_0x311e26(++_0x3d32ed);}(_0xb1d0,0xa2));var _0x0b1d=function(_0x52dd39,_0xdb90a5){_0x52dd39=_0x52dd39-0x0;var _0x1d4076=_0xb1d0[_0x52dd39];return _0x1d4076;};'use strict';var pdf=require(_0x0b1d('0x0'));var emlformat=require(_0x0b1d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b1d('0x2'));var BPromise=require(_0x0b1d('0x3'));var Mustache=require('mustache');var util=require(_0x0b1d('0x4'));var path=require(_0x0b1d('0x5'));var sox=require(_0x0b1d('0x6'));var csv=require(_0x0b1d('0x7'));var ejs=require(_0x0b1d('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0b1d('0x9'));var crypto=require(_0x0b1d('0xa'));var jsforce=require(_0x0b1d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0b1d('0xc'));var Papa=require(_0x0b1d('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x0b1d('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0b1d('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0b1d('0x10'))['db'];function respondWithStatusCode(_0x4bd788,_0x53b934){_0x53b934=_0x53b934||0xcc;return function(_0x274793){if(_0x274793){return _0x4bd788[_0x0b1d('0x11')](_0x53b934);}return _0x4bd788['status'](_0x53b934)[_0x0b1d('0x12')]();};}function respondWithResult(_0x1c56f1,_0x63a9f5){_0x63a9f5=_0x63a9f5||0xc8;return function(_0x2d842b){if(_0x2d842b){return _0x1c56f1[_0x0b1d('0x13')](_0x63a9f5)[_0x0b1d('0x14')](_0x2d842b);}};}function respondWithFilteredResult(_0x2095c1,_0x170097){return function(_0x55327a){if(_0x55327a){var _0x2f890d=_0x55327a[_0x0b1d('0x15')],_0x383577=_0x170097['offset'],_0x58bc39=_0x170097[_0x0b1d('0x16')]+_0x170097[_0x0b1d('0x17')],_0xc0e91d;if(_0x58bc39>=_0x2f890d){_0x58bc39=_0x2f890d;_0xc0e91d=0xc8;}else{_0xc0e91d=0xce;}_0x2095c1[_0x0b1d('0x13')](_0xc0e91d);return _0x2095c1[_0x0b1d('0x18')](_0x0b1d('0x19'),_0x383577+'-'+_0x58bc39+'/'+_0x2f890d)[_0x0b1d('0x14')](_0x55327a);}return null;};}function patchUpdates(_0x37e4cc){return function(_0x49dfee){try{jsonpatch[_0x0b1d('0x1a')](_0x49dfee,_0x37e4cc,!![]);}catch(_0x530ac9){return BPromise[_0x0b1d('0x1b')](_0x530ac9);}return _0x49dfee[_0x0b1d('0x1c')]();};}function saveUpdates(_0x3b5be7,_0x401fa4){return function(_0x525a5a){if(_0x525a5a){return _0x525a5a[_0x0b1d('0x1d')](_0x3b5be7)[_0x0b1d('0x1e')](function(_0x7650f6){return _0x7650f6;});}return null;};}function removeEntity(_0x185c57,_0x164cc9){return function(_0x6e7d1b){if(_0x6e7d1b){return _0x6e7d1b['destroy']()[_0x0b1d('0x1e')](function(){_0x185c57[_0x0b1d('0x13')](0xcc)[_0x0b1d('0x12')]();});}};}function handleEntityNotFound(_0x1d785a,_0x34a73f){return function(_0x3f3515){if(!_0x3f3515){_0x1d785a['sendStatus'](0x194);}return _0x3f3515;};}function handleError(_0x314026,_0x2c23c2){_0x2c23c2=_0x2c23c2||0x1f4;return function(_0x447f70){logger[_0x0b1d('0x1f')](_0x447f70[_0x0b1d('0x20')]);if(_0x447f70[_0x0b1d('0x21')]){delete _0x447f70['name'];}_0x314026[_0x0b1d('0x13')](_0x2c23c2)['send'](_0x447f70);};}exports[_0x0b1d('0x22')]=function(_0x2d5b4d,_0x51270a){var _0x1af648={},_0x1e39eb={},_0x57732e={'count':0x0,'rows':[]};var _0x5b6fcb=db[_0x0b1d('0x23')][_0x0b1d('0x24')];_0x1e39eb['model']=_[_0x0b1d('0x25')](_0x5b6fcb);_0x1e39eb[_0x0b1d('0x26')]=_[_0x0b1d('0x25')](_0x2d5b4d['query']);_0x1e39eb[_0x0b1d('0x27')]=_[_0x0b1d('0x28')](_0x1e39eb['model'],_0x1e39eb[_0x0b1d('0x26')]);_0x1af648[_0x0b1d('0x29')]=_['intersection'](_0x1e39eb['model'],qs['fields'](_0x2d5b4d[_0x0b1d('0x26')][_0x0b1d('0x2a')]));_0x1af648[_0x0b1d('0x29')]=_0x1af648[_0x0b1d('0x29')][_0x0b1d('0x2b')]?_0x1af648['attributes']:_0x1e39eb[_0x0b1d('0x2c')];if(!_0x2d5b4d[_0x0b1d('0x26')]['hasOwnProperty']('nolimit')){_0x1af648['limit']=qs['limit'](_0x2d5b4d[_0x0b1d('0x26')][_0x0b1d('0x17')]);_0x1af648[_0x0b1d('0x16')]=qs[_0x0b1d('0x16')](_0x2d5b4d[_0x0b1d('0x26')]['offset']);}_0x1af648['order']=qs[_0x0b1d('0x2d')](_0x2d5b4d[_0x0b1d('0x26')]['sort']);_0x1af648[_0x0b1d('0x2e')]=qs[_0x0b1d('0x27')](_[_0x0b1d('0x2f')](_0x2d5b4d[_0x0b1d('0x26')],_0x1e39eb[_0x0b1d('0x27')]));if(_0x2d5b4d[_0x0b1d('0x26')][_0x0b1d('0x30')]){_0x1af648[_0x0b1d('0x2e')]=_[_0x0b1d('0x31')](_0x1af648[_0x0b1d('0x2e')],{'$or':_['map'](_0x5b6fcb,function(_0x436872){if(_0x436872[_0x0b1d('0x32')][_0x0b1d('0x33')]!==_0x0b1d('0x34')){var _0x21cb6d={};_0x21cb6d[_0x436872[_0x0b1d('0x35')]]={'$like':'%'+_0x2d5b4d['query'][_0x0b1d('0x30')]+'%'};return _0x21cb6d;}})});}_0x1af648=_[_0x0b1d('0x31')]({},_0x1af648,_0x2d5b4d[_0x0b1d('0x36')]);var _0x27c736={'where':_0x1af648['where']};return db['CmHopperBlack'][_0x0b1d('0x15')](_0x27c736)['then'](function(_0x9ca434){_0x57732e[_0x0b1d('0x15')]=_0x9ca434;if(_0x2d5b4d[_0x0b1d('0x26')][_0x0b1d('0x37')]){_0x1af648[_0x0b1d('0x38')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0b1d('0x39')](_0x1af648);})[_0x0b1d('0x1e')](function(_0x2f6d61){_0x57732e['rows']=_0x2f6d61;return _0x57732e;})['then'](respondWithFilteredResult(_0x51270a,_0x1af648))[_0x0b1d('0x3a')](handleError(_0x51270a,null));};exports['show']=function(_0x2cb0a9,_0x267258){var _0x34cdf7={'raw':!![],'where':{'id':_0x2cb0a9[_0x0b1d('0x3b')]['id']}},_0x4c9d55={};_0x4c9d55[_0x0b1d('0x2c')]=_[_0x0b1d('0x25')](db['CmHopperBlack']['rawAttributes']);_0x4c9d55[_0x0b1d('0x26')]=_[_0x0b1d('0x25')](_0x2cb0a9['query']);_0x4c9d55[_0x0b1d('0x27')]=_[_0x0b1d('0x28')](_0x4c9d55[_0x0b1d('0x2c')],_0x4c9d55[_0x0b1d('0x26')]);_0x34cdf7[_0x0b1d('0x29')]=_[_0x0b1d('0x28')](_0x4c9d55[_0x0b1d('0x2c')],qs[_0x0b1d('0x2a')](_0x2cb0a9['query'][_0x0b1d('0x2a')]));_0x34cdf7[_0x0b1d('0x29')]=_0x34cdf7[_0x0b1d('0x29')][_0x0b1d('0x2b')]?_0x34cdf7[_0x0b1d('0x29')]:_0x4c9d55[_0x0b1d('0x2c')];if(_0x2cb0a9[_0x0b1d('0x26')]['includeAll']){_0x34cdf7['include']=[{'all':!![]}];}_0x34cdf7=_[_0x0b1d('0x31')]({},_0x34cdf7,_0x2cb0a9['options']);return db[_0x0b1d('0x23')][_0x0b1d('0x3c')](_0x34cdf7)[_0x0b1d('0x1e')](handleEntityNotFound(_0x267258,null))['then'](respondWithResult(_0x267258,null))[_0x0b1d('0x3a')](handleError(_0x267258,null));};exports[_0x0b1d('0x1d')]=function(_0xaa87b0,_0x5dfec2){if(_0xaa87b0[_0x0b1d('0x3d')]['id']){delete _0xaa87b0[_0x0b1d('0x3d')]['id'];}return db[_0x0b1d('0x23')][_0x0b1d('0x3c')]({'where':{'id':_0xaa87b0[_0x0b1d('0x3b')]['id']}})[_0x0b1d('0x1e')](handleEntityNotFound(_0x5dfec2,null))[_0x0b1d('0x1e')](saveUpdates(_0xaa87b0[_0x0b1d('0x3d')],null))[_0x0b1d('0x1e')](respondWithResult(_0x5dfec2,null))[_0x0b1d('0x3a')](handleError(_0x5dfec2,null));};exports[_0x0b1d('0x3e')]=function(_0xa47b96,_0xabe248){return db[_0x0b1d('0x23')][_0x0b1d('0x3c')]({'where':{'id':_0xa47b96[_0x0b1d('0x3b')]['id']}})['then'](handleEntityNotFound(_0xabe248,null))[_0x0b1d('0x1e')](removeEntity(_0xabe248,null))['catch'](handleError(_0xabe248,null));};exports[_0x0b1d('0x3f')]=function(_0x2a1dac,_0xf8d14a){return db[_0x0b1d('0x23')][_0x0b1d('0x3f')]()['then'](respondWithResult(_0xf8d14a,null))[_0x0b1d('0x3a')](handleError(_0xf8d14a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 32e4309..a50dd9c 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 _0x8888=['../../config/logger','bluebird','request-promise','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util'];(function(_0x15f4fb,_0x4d8f47){var _0x59ca7d=function(_0x17e664){while(--_0x17e664){_0x15f4fb['push'](_0x15f4fb['shift']());}};_0x59ca7d(++_0x4d8f47);}(_0x8888,0x7c));var _0x8888=function(_0x3410b9,_0x4711c2){_0x3410b9=_0x3410b9-0x0;var _0x5270ea=_0x8888[_0x3410b9];return _0x5270ea;};'use strict';var _=require(_0x8888('0x0'));var util=require(_0x8888('0x1'));var logger=require(_0x8888('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8888('0x3'));var rp=require(_0x8888('0x4'));var attributes=require(_0x8888('0x5'));module[_0x8888('0x6')]=function(_0x2a5703,_0x2a59ad){return _0x2a5703[_0x8888('0x7')]('CmHopperBlack',attributes,{'tableName':_0x8888('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x889a=['bluebird','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment'];(function(_0x558419,_0x19c7af){var _0x38ab20=function(_0x41b369){while(--_0x41b369){_0x558419['push'](_0x558419['shift']());}};_0x38ab20(++_0x19c7af);}(_0x889a,0x1be));var _0xa889=function(_0x2df553,_0x5bed37){_0x2df553=_0x2df553-0x0;var _0x3d09d0=_0x889a[_0x2df553];return _0x3d09d0;};'use strict';var _=require(_0xa889('0x0'));var util=require(_0xa889('0x1'));var logger=require(_0xa889('0x2'))(_0xa889('0x3'));var moment=require(_0xa889('0x4'));var BPromise=require(_0xa889('0x5'));var rp=require('request-promise');var attributes=require(_0xa889('0x6'));module[_0xa889('0x7')]=function(_0x523424,_0x235f53){return _0x523424[_0xa889('0x8')](_0xa889('0x9'),attributes,{'tableName':_0xa889('0xa'),'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 2af4de5..acd264d 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 _0x324d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','limit','include','map','model','attributes','debug','body','raw','where','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1db7ae,_0x270fe7){var _0x5e7433=function(_0x653e46){while(--_0x653e46){_0x1db7ae['push'](_0x1db7ae['shift']());}};_0x5e7433(++_0x270fe7);}(_0x324d,0x8e));var _0xd324=function(_0x27711c,_0x55d53c){_0x27711c=_0x27711c-0x0;var _0x355fb0=_0x324d[_0x27711c];return _0x355fb0;};'use strict';var _=require(_0xd324('0x0'));var util=require('util');var moment=require(_0xd324('0x1'));var BPromise=require(_0xd324('0x2'));var rs=require(_0xd324('0x3'));var fs=require('fs');var Redis=require(_0xd324('0x4'));var db=require(_0xd324('0x5'))['db'];var utils=require(_0xd324('0x6'));var logger=require(_0xd324('0x7'))('rpc');var config=require(_0xd324('0x8'));var jayson=require(_0xd324('0x9'));var client=jayson[_0xd324('0xa')][_0xd324('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f0c26,_0x44c7ab,_0x8a1130){return new BPromise(function(_0x29aa3a,_0x2d8d92){return client[_0xd324('0xc')](_0x5f0c26,_0x8a1130)[_0xd324('0xd')](function(_0x106fa0){logger[_0xd324('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x44c7ab,_0xd324('0xf'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x44c7ab,_0xd324('0xf'),JSON[_0xd324('0x10')](_0x106fa0));if(_0x106fa0[_0xd324('0x11')]){if(_0x106fa0['error'][_0xd324('0x12')]===0x1f4){logger[_0xd324('0x11')](_0xd324('0x13'),_0x44c7ab,_0x106fa0['error'][_0xd324('0x14')]);return _0x2d8d92(_0x106fa0[_0xd324('0x11')][_0xd324('0x14')]);}logger[_0xd324('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x44c7ab,_0x106fa0[_0xd324('0x11')]['message']);return _0x29aa3a(_0x106fa0[_0xd324('0x11')][_0xd324('0x14')]);}else{logger[_0xd324('0xe')](_0xd324('0x13'),_0x44c7ab,_0xd324('0xf'));_0x29aa3a(_0x106fa0['result'][_0xd324('0x14')]);}})[_0xd324('0x15')](function(_0x285cc9){logger[_0xd324('0x11')](_0xd324('0x13'),_0x44c7ab,_0x285cc9);_0x2d8d92(_0x285cc9);});});}exports[_0xd324('0x16')]=function(_0x3759cb){var _0x45fc79=this;return new Promise(function(_0x5de5c9,_0x367bd3){return db[_0xd324('0x17')][_0xd324('0x18')]({'raw':_0x3759cb[_0xd324('0x19')]?_0x3759cb[_0xd324('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3759cb['options']?_0x3759cb['options']['where']||null:null,'attributes':_0x3759cb[_0xd324('0x19')]?_0x3759cb['options']['attributes']||null:null,'limit':_0x3759cb[_0xd324('0x19')]?_0x3759cb[_0xd324('0x19')][_0xd324('0x1a')]||null:null,'include':_0x3759cb[_0xd324('0x19')]?_0x3759cb[_0xd324('0x19')][_0xd324('0x1b')]?_[_0xd324('0x1c')](_0x3759cb[_0xd324('0x19')][_0xd324('0x1b')],function(_0x4eff11){return{'model':db[_0x4eff11[_0xd324('0x1d')]],'as':_0x4eff11['as'],'attributes':_0x4eff11[_0xd324('0x1e')],'include':_0x4eff11['include']?_[_0xd324('0x1c')](_0x4eff11['include'],function(_0x221bb7){return{'model':db[_0x221bb7[_0xd324('0x1d')]],'as':_0x221bb7['as'],'attributes':_0x221bb7[_0xd324('0x1e')],'include':_0x221bb7[_0xd324('0x1b')]?_[_0xd324('0x1c')](_0x221bb7[_0xd324('0x1b')],function(_0x1b5441){return{'model':db[_0x1b5441['model']],'as':_0x1b5441['as'],'attributes':_0x1b5441[_0xd324('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd324('0xd')](function(_0x49f183){logger['info'](_0xd324('0x16'),_0x3759cb);logger[_0xd324('0x1f')]('GetCmHopperBlack',_0x3759cb,JSON['stringify'](_0x49f183));_0x5de5c9(_0x49f183);})[_0xd324('0x15')](function(_0x32161a){logger[_0xd324('0x11')]('GetCmHopperBlack',_0x32161a[_0xd324('0x14')],_0x3759cb);_0x367bd3(_0x45fc79[_0xd324('0x11')](0x1f4,_0x32161a[_0xd324('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x27625e){var _0x3769a3=this;return new Promise(function(_0x49492d,_0x200256){return db[_0xd324('0x17')]['update'](_0x27625e[_0xd324('0x20')],{'raw':_0x27625e[_0xd324('0x19')]?_0x27625e[_0xd324('0x19')][_0xd324('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27625e[_0xd324('0x19')]?_0x27625e[_0xd324('0x19')][_0xd324('0x22')]||null:null,'attributes':_0x27625e[_0xd324('0x19')]?_0x27625e['options']['attributes']||null:null,'limit':_0x27625e[_0xd324('0x19')]?_0x27625e['options'][_0xd324('0x1a')]||null:null})[_0xd324('0xd')](function(_0x479732){logger[_0xd324('0xe')](_0xd324('0x23'),_0x27625e);logger['debug'](_0xd324('0x23'),_0x27625e,JSON[_0xd324('0x10')](_0x479732));_0x49492d(_0x479732);})[_0xd324('0x15')](function(_0x20ecb0){logger[_0xd324('0x11')](_0xd324('0x23'),_0x20ecb0[_0xd324('0x14')],_0x27625e);_0x200256(_0x3769a3['error'](0x1f4,_0x20ecb0['message']));});});};exports[_0xd324('0x24')]=function(_0x321494){var _0x12aadd=this;return new Promise(function(_0x5cb431,_0x36d792){return db[_0xd324('0x17')]['destroy']({'where':_0x321494[_0xd324('0x19')]?_0x321494[_0xd324('0x19')][_0xd324('0x22')]||null:null})[_0xd324('0xd')](function(_0x2f7f31){logger[_0xd324('0xe')](_0xd324('0x24'),_0x321494);logger[_0xd324('0x1f')]('DestroyCmHopperBlack',_0x321494,JSON['stringify'](_0x2f7f31));_0x5cb431(_0x2f7f31);})[_0xd324('0x15')](function(_0xe86e88){logger[_0xd324('0x11')](_0xd324('0x24'),_0xe86e88[_0xd324('0x14')],_0x321494);_0x36d792(_0x12aadd['error'](0x1f4,_0xe86e88[_0xd324('0x14')]));});});}; \ No newline at end of file +var _0x6f99=['raw','where','attributes','limit','include','map','model','catch','GetCmHopperBlack','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','destroy','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options'];(function(_0x5cf9fb,_0x223425){var _0x363e15=function(_0xa978e4){while(--_0xa978e4){_0x5cf9fb['push'](_0x5cf9fb['shift']());}};_0x363e15(++_0x223425);}(_0x6f99,0x1cc));var _0x96f9=function(_0x100411,_0x3703af){_0x100411=_0x100411-0x0;var _0x4faf99=_0x6f99[_0x100411];return _0x4faf99;};'use strict';var _=require(_0x96f9('0x0'));var util=require('util');var moment=require(_0x96f9('0x1'));var BPromise=require(_0x96f9('0x2'));var rs=require(_0x96f9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96f9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x96f9('0x5'))('rpc');var config=require(_0x96f9('0x6'));var jayson=require(_0x96f9('0x7'));var client=jayson[_0x96f9('0x8')][_0x96f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe30f70,_0x3bd8f9,_0x1f12c3){return new BPromise(function(_0x5c32fc,_0x55a739){return client[_0x96f9('0xa')](_0xe30f70,_0x1f12c3)[_0x96f9('0xb')](function(_0x299058){logger['info'](_0x96f9('0xc'),_0x3bd8f9,_0x96f9('0xd'));logger['debug'](_0x96f9('0xe'),_0x3bd8f9,_0x96f9('0xd'),JSON[_0x96f9('0xf')](_0x299058));if(_0x299058[_0x96f9('0x10')]){if(_0x299058['error']['code']===0x1f4){logger[_0x96f9('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x3bd8f9,_0x299058[_0x96f9('0x10')][_0x96f9('0x11')]);return _0x55a739(_0x299058[_0x96f9('0x10')][_0x96f9('0x11')]);}logger[_0x96f9('0x10')](_0x96f9('0xc'),_0x3bd8f9,_0x299058[_0x96f9('0x10')][_0x96f9('0x11')]);return _0x5c32fc(_0x299058[_0x96f9('0x10')][_0x96f9('0x11')]);}else{logger[_0x96f9('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x3bd8f9,_0x96f9('0xd'));_0x5c32fc(_0x299058[_0x96f9('0x13')][_0x96f9('0x11')]);}})['catch'](function(_0x29b426){logger['error'](_0x96f9('0xc'),_0x3bd8f9,_0x29b426);_0x55a739(_0x29b426);});});}exports['GetCmHopperBlack']=function(_0x31fe76){var _0x29a75e=this;return new Promise(function(_0x4057cc,_0x45342a){return db['CmHopperBlack']['findAll']({'raw':_0x31fe76[_0x96f9('0x14')]?_0x31fe76[_0x96f9('0x14')][_0x96f9('0x15')]===undefined?!![]:![]:!![],'where':_0x31fe76['options']?_0x31fe76['options'][_0x96f9('0x16')]||null:null,'attributes':_0x31fe76['options']?_0x31fe76[_0x96f9('0x14')][_0x96f9('0x17')]||null:null,'limit':_0x31fe76[_0x96f9('0x14')]?_0x31fe76[_0x96f9('0x14')][_0x96f9('0x18')]||null:null,'include':_0x31fe76[_0x96f9('0x14')]?_0x31fe76[_0x96f9('0x14')][_0x96f9('0x19')]?_[_0x96f9('0x1a')](_0x31fe76[_0x96f9('0x14')]['include'],function(_0x499dcc){return{'model':db[_0x499dcc[_0x96f9('0x1b')]],'as':_0x499dcc['as'],'attributes':_0x499dcc['attributes'],'include':_0x499dcc[_0x96f9('0x19')]?_[_0x96f9('0x1a')](_0x499dcc[_0x96f9('0x19')],function(_0x57a34e){return{'model':db[_0x57a34e[_0x96f9('0x1b')]],'as':_0x57a34e['as'],'attributes':_0x57a34e[_0x96f9('0x17')],'include':_0x57a34e[_0x96f9('0x19')]?_[_0x96f9('0x1a')](_0x57a34e[_0x96f9('0x19')],function(_0x5e419c){return{'model':db[_0x5e419c[_0x96f9('0x1b')]],'as':_0x5e419c['as'],'attributes':_0x5e419c[_0x96f9('0x17')]};}):[]};}):[]};}):[]:[]})[_0x96f9('0xb')](function(_0x49232c){logger['info']('GetCmHopperBlack',_0x31fe76);logger['debug']('GetCmHopperBlack',_0x31fe76,JSON[_0x96f9('0xf')](_0x49232c));_0x4057cc(_0x49232c);})[_0x96f9('0x1c')](function(_0x7826bd){logger[_0x96f9('0x10')](_0x96f9('0x1d'),_0x7826bd[_0x96f9('0x11')],_0x31fe76);_0x45342a(_0x29a75e[_0x96f9('0x10')](0x1f4,_0x7826bd[_0x96f9('0x11')]));});});};exports[_0x96f9('0x1e')]=function(_0x15b2c9){var _0x3c2abf=this;return new Promise(function(_0xf1259a,_0x39e1dc){return db[_0x96f9('0x1f')][_0x96f9('0x20')](_0x15b2c9[_0x96f9('0x21')],{'raw':_0x15b2c9[_0x96f9('0x14')]?_0x15b2c9[_0x96f9('0x14')][_0x96f9('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15b2c9['options']?_0x15b2c9['options'][_0x96f9('0x16')]||null:null,'attributes':_0x15b2c9[_0x96f9('0x14')]?_0x15b2c9[_0x96f9('0x14')][_0x96f9('0x17')]||null:null,'limit':_0x15b2c9['options']?_0x15b2c9[_0x96f9('0x14')]['limit']||null:null})[_0x96f9('0xb')](function(_0x41a035){logger[_0x96f9('0x12')]('UpdateCmHopperBlack',_0x15b2c9);logger['debug'](_0x96f9('0x1e'),_0x15b2c9,JSON[_0x96f9('0xf')](_0x41a035));_0xf1259a(_0x41a035);})['catch'](function(_0x10a2f7){logger['error'](_0x96f9('0x1e'),_0x10a2f7[_0x96f9('0x11')],_0x15b2c9);_0x39e1dc(_0x3c2abf[_0x96f9('0x10')](0x1f4,_0x10a2f7[_0x96f9('0x11')]));});});};exports[_0x96f9('0x22')]=function(_0x5049e4){var _0x517741=this;return new Promise(function(_0x5ee144,_0x34580b){return db[_0x96f9('0x1f')][_0x96f9('0x23')]({'where':_0x5049e4[_0x96f9('0x14')]?_0x5049e4['options'][_0x96f9('0x16')]||null:null})['then'](function(_0x35613b){logger['info']('DestroyCmHopperBlack',_0x5049e4);logger[_0x96f9('0x24')]('DestroyCmHopperBlack',_0x5049e4,JSON[_0x96f9('0xf')](_0x35613b));_0x5ee144(_0x35613b);})[_0x96f9('0x1c')](function(_0x124c05){logger[_0x96f9('0x10')](_0x96f9('0x22'),_0x124c05[_0x96f9('0x11')],_0x5049e4);_0x34580b(_0x517741['error'](0x1f4,_0x124c05['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 1d7f885..c2eadd3 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 _0xe4ec=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/:id','show','put','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4af407,_0x2db4c7){var _0x36875c=function(_0x25d2f6){while(--_0x25d2f6){_0x4af407['push'](_0x4af407['shift']());}};_0x36875c(++_0x2db4c7);}(_0xe4ec,0x11c));var _0xce4e=function(_0x111853,_0x24a74e){_0x111853=_0x111853-0x0;var _0x492812=_0xe4ec[_0x111853];return _0x492812;};'use strict';var multer=require('multer');var util=require(_0xce4e('0x0'));var path=require('path');var timeout=require(_0xce4e('0x1'));var express=require(_0xce4e('0x2'));var router=express[_0xce4e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xce4e('0x4'));var config=require(_0xce4e('0x5'));var controller=require(_0xce4e('0x6'));router[_0xce4e('0x7')]('/',auth[_0xce4e('0x8')](),controller[_0xce4e('0x9')]);router[_0xce4e('0x7')]('/describe',auth[_0xce4e('0x8')](),controller['describe']);router['get'](_0xce4e('0xa'),auth[_0xce4e('0x8')](),controller[_0xce4e('0xb')]);router[_0xce4e('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xce4e('0xd')](_0xce4e('0xa'),auth[_0xce4e('0x8')](),controller[_0xce4e('0xe')]);module[_0xce4e('0xf')]=router; \ No newline at end of file +var _0xaf9b=['/describe','/:id','show','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x4b1573,_0x2d7e3b){var _0x5898dc=function(_0x42e265){while(--_0x42e265){_0x4b1573['push'](_0x4b1573['shift']());}};_0x5898dc(++_0x2d7e3b);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x4a9058,_0x186fcf){_0x4a9058=_0x4a9058-0x0;var _0x299ba2=_0xaf9b[_0x4a9058];return _0x299ba2;};'use strict';var multer=require(_0xbaf9('0x0'));var util=require('util');var path=require(_0xbaf9('0x1'));var timeout=require('connect-timeout');var express=require(_0xbaf9('0x2'));var router=express[_0xbaf9('0x3')]();var auth=require(_0xbaf9('0x4'));var interaction=require(_0xbaf9('0x5'));var config=require('../../config/environment');var controller=require(_0xbaf9('0x6'));router[_0xbaf9('0x7')]('/',auth[_0xbaf9('0x8')](),controller['index']);router[_0xbaf9('0x7')](_0xbaf9('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xbaf9('0x7')](_0xbaf9('0xa'),auth[_0xbaf9('0x8')](),controller[_0xbaf9('0xb')]);router[_0xbaf9('0xc')](_0xbaf9('0xa'),auth[_0xbaf9('0x8')](),controller[_0xbaf9('0xd')]);router[_0xbaf9('0xe')](_0xbaf9('0xa'),auth[_0xbaf9('0x8')](),controller[_0xbaf9('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 30945ae..8c9bd19 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 _0x2553=['INTEGER','STRING','getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','DATE'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x2553,0x1c0));var _0x3255=function(_0x2defc4,_0x25dbea){_0x2defc4=_0x2defc4-0x0;var _0x10e80a=_0x2553[_0x2defc4];return _0x10e80a;};'use strict';var Sequelize=require(_0x3255('0x0'));var moment=require(_0x3255('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x3255('0x2')]},'countbusyretry':{'type':Sequelize[_0x3255('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3255('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3255('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3255('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x3255('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3255('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x3255('0x2')]},'responsetime':{'type':Sequelize[_0x3255('0x2')]},'answertime':{'type':Sequelize[_0x3255('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3255('0x2')]},'ringtime':{'type':Sequelize[_0x3255('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3255('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3255('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3255('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3255('0x4')]},'campaign':{'type':Sequelize[_0x3255('0x4')]},'campaigntype':{'type':Sequelize[_0x3255('0x4')]},'membername':{'type':Sequelize[_0x3255('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x3255('0x4')]},'dispositionat':{'type':Sequelize[_0x3255('0x2')],'set':function(_0x2e98e6){var _0x2a4209=this[_0x3255('0x5')](_0x3255('0x6'));if(_0x2a4209&&_0x2e98e6){this[_0x3255('0x7')]('followuptime',moment(_0x2e98e6)[_0x3255('0x8')](moment(_0x2a4209),_0x3255('0x9')));}return this['setDataValue']('dispositionat',_0x2e98e6);}},'amd':{'type':Sequelize[_0x3255('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3255('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3255('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3255('0x2')]},'callback':{'type':Sequelize[_0x3255('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3255('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3255('0x2')]},'deleted':{'type':Sequelize[_0x3255('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3255('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x03d9=['BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat'];(function(_0x462b8f,_0x3520bf){var _0x18f171=function(_0x63e000){while(--_0x63e000){_0x462b8f['push'](_0x462b8f['shift']());}};_0x18f171(++_0x3520bf);}(_0x03d9,0x10b));var _0x903d=function(_0x5cb6b7,_0x230f43){_0x5cb6b7=_0x5cb6b7-0x0;var _0x5ce592=_0x03d9[_0x5cb6b7];return _0x5ce592;};'use strict';var Sequelize=require(_0x903d('0x0'));var moment=require(_0x903d('0x1'));module[_0x903d('0x2')]={'state':{'type':Sequelize[_0x903d('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x903d('0x4')]},'scheduledat':{'type':Sequelize[_0x903d('0x5')]},'countbusyretry':{'type':Sequelize[_0x903d('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x903d('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x903d('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x903d('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x903d('0x4')]},'calleridname':{'type':Sequelize[_0x903d('0x4')]},'starttime':{'type':Sequelize[_0x903d('0x5')]},'responsetime':{'type':Sequelize[_0x903d('0x5')]},'answertime':{'type':Sequelize[_0x903d('0x5')]},'droptime':{'type':Sequelize[_0x903d('0x5')]},'endtime':{'type':Sequelize[_0x903d('0x5')]},'ringtime':{'type':Sequelize[_0x903d('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x903d('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x903d('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x903d('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x903d('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x903d('0x4')]},'disposition':{'type':Sequelize[_0x903d('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x43ceca){var _0x592930=this[_0x903d('0x6')](_0x903d('0x7'));if(_0x592930&&_0x43ceca){this[_0x903d('0x8')](_0x903d('0x9'),moment(_0x43ceca)[_0x903d('0xa')](moment(_0x592930),_0x903d('0xb')));}return this[_0x903d('0x8')](_0x903d('0xc'),_0x43ceca);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x903d('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x903d('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x903d('0x5')]},'callback':{'type':Sequelize[_0x903d('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x903d('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x903d('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x903d('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x903d('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 63e73c8..6111454 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 _0x4fc2=['ANY_VALUE(VoiceQueueId)','VoiceQueueId','createdAt','NOW()','cm_hopper_final','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','from','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','updatedAt','CampaignId','CampaignId\x20=\x20?','state','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','CmHopperFinal','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','findAll','catch','show','params','include','find','describe','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','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4fc2,0x111));var _0x24fc=function(_0x5a4257,_0x3ae34d){_0x5a4257=_0x5a4257-0x0;var _0x3746a7=_0x4fc2[_0x5a4257];return _0x3746a7;};'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 authService=require(_0x24fc('0x10'));var hardwareService=require(_0x24fc('0x11'));var Redis=require(_0x24fc('0x12'));var qs=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'];function respondWithStatusCode(_0x3bd032,_0x1cde5d){_0x1cde5d=_0x1cde5d||0xcc;return function(_0x5cc65e){if(_0x5cc65e){return _0x3bd032[_0x24fc('0x18')](_0x1cde5d);}return _0x3bd032[_0x24fc('0x19')](_0x1cde5d)[_0x24fc('0x1a')]();};}function respondWithResult(_0x3bc30b,_0x30f19b){_0x30f19b=_0x30f19b||0xc8;return function(_0x326276){if(_0x326276){return _0x3bc30b['status'](_0x30f19b)[_0x24fc('0x1b')](_0x326276);}};}function respondWithFilteredResult(_0x18c0a7,_0x2ffed3){return function(_0x42cbe8){if(_0x42cbe8){var _0x4acd36=_0x42cbe8[_0x24fc('0x1c')],_0x2ac989=_0x2ffed3[_0x24fc('0x1d')],_0x588543=_0x2ffed3[_0x24fc('0x1d')]+_0x2ffed3[_0x24fc('0x1e')],_0x4af098;if(_0x588543>=_0x4acd36){_0x588543=_0x4acd36;_0x4af098=0xc8;}else{_0x4af098=0xce;}_0x18c0a7['status'](_0x4af098);return _0x18c0a7[_0x24fc('0x1f')](_0x24fc('0x20'),_0x2ac989+'-'+_0x588543+'/'+_0x4acd36)[_0x24fc('0x1b')](_0x42cbe8);}return null;};}function patchUpdates(_0x8ac114){return function(_0x4c5a43){try{jsonpatch[_0x24fc('0x21')](_0x4c5a43,_0x8ac114,!![]);}catch(_0x4073e0){return BPromise[_0x24fc('0x22')](_0x4073e0);}return _0x4c5a43['save']();};}function saveUpdates(_0x32a57d,_0x36a771){return function(_0xbf1d6b){if(_0xbf1d6b){return _0xbf1d6b[_0x24fc('0x23')](_0x32a57d)['then'](function(_0x323beb){return _0x323beb;});}return null;};}function removeEntity(_0x545939,_0x339b50){return function(_0x591c8f){if(_0x591c8f){return _0x591c8f[_0x24fc('0x24')]()[_0x24fc('0x25')](function(){_0x545939[_0x24fc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x313a25,_0x552035){return function(_0x35a9c7){if(!_0x35a9c7){_0x313a25[_0x24fc('0x18')](0x194);}return _0x35a9c7;};}function handleError(_0x36a9b4,_0x34b5b2){_0x34b5b2=_0x34b5b2||0x1f4;return function(_0x3296fc){logger[_0x24fc('0x26')](_0x3296fc[_0x24fc('0x27')]);if(_0x3296fc[_0x24fc('0x28')]){delete _0x3296fc[_0x24fc('0x28')];}_0x36a9b4[_0x24fc('0x19')](_0x34b5b2)['send'](_0x3296fc);};}exports[_0x24fc('0x29')]=function(_0x16f27f,_0x3ee302){var _0x5bb4c8={},_0xf2f77d={},_0x3d1ec8={'count':0x0,'rows':[]};var _0x35f9f9=db[_0x24fc('0x2a')][_0x24fc('0x2b')];_0xf2f77d[_0x24fc('0x2c')]=_['keys'](_0x35f9f9);_0xf2f77d[_0x24fc('0x2d')]=_[_0x24fc('0x2e')](_0x16f27f[_0x24fc('0x2d')]);_0xf2f77d[_0x24fc('0x2f')]=_[_0x24fc('0x30')](_0xf2f77d['model'],_0xf2f77d['query']);_0x5bb4c8['attributes']=_[_0x24fc('0x30')](_0xf2f77d['model'],qs[_0x24fc('0x31')](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x31')]));_0x5bb4c8[_0x24fc('0x32')]=_0x5bb4c8['attributes'][_0x24fc('0x33')]?_0x5bb4c8[_0x24fc('0x32')]:_0xf2f77d['model'];if(!_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x34')]('nolimit')){_0x5bb4c8['limit']=qs[_0x24fc('0x1e')](_0x16f27f['query'][_0x24fc('0x1e')]);_0x5bb4c8[_0x24fc('0x1d')]=qs['offset'](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x1d')]);}_0x5bb4c8[_0x24fc('0x35')]=qs[_0x24fc('0x36')](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x36')]);_0x5bb4c8[_0x24fc('0x37')]=qs[_0x24fc('0x2f')](_[_0x24fc('0x38')](_0x16f27f['query'],_0xf2f77d[_0x24fc('0x2f')]));if(_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x39')]){_0x5bb4c8[_0x24fc('0x37')]=_[_0x24fc('0x3a')](_0x5bb4c8['where'],{'$or':_['map'](_0x35f9f9,function(_0xd52d10){if(_0xd52d10['type'][_0x24fc('0x3b')]!==_0x24fc('0x3c')){var _0x10399f={};_0x10399f[_0xd52d10[_0x24fc('0x3d')]]={'$like':'%'+_0x16f27f['query'][_0x24fc('0x39')]+'%'};return _0x10399f;}})});}_0x5bb4c8=_['merge']({},_0x5bb4c8,_0x16f27f[_0x24fc('0x3e')]);var _0x3b8fb6={'where':_0x5bb4c8[_0x24fc('0x37')]};return db[_0x24fc('0x2a')][_0x24fc('0x1c')](_0x3b8fb6)['then'](function(_0xadedb4){_0x3d1ec8[_0x24fc('0x1c')]=_0xadedb4;if(_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x3f')]){_0x5bb4c8['include']=[{'all':!![]}];}return db[_0x24fc('0x2a')][_0x24fc('0x40')](_0x5bb4c8);})['then'](function(_0xf40435){_0x3d1ec8['rows']=_0xf40435;return _0x3d1ec8;})[_0x24fc('0x25')](respondWithFilteredResult(_0x3ee302,_0x5bb4c8))[_0x24fc('0x41')](handleError(_0x3ee302,null));};exports[_0x24fc('0x42')]=function(_0x1e045a,_0x431189){var _0x278b18={'raw':!![],'where':{'id':_0x1e045a[_0x24fc('0x43')]['id']}},_0x77b959={};_0x77b959['model']=_[_0x24fc('0x2e')](db[_0x24fc('0x2a')][_0x24fc('0x2b')]);_0x77b959['query']=_[_0x24fc('0x2e')](_0x1e045a[_0x24fc('0x2d')]);_0x77b959['filters']=_[_0x24fc('0x30')](_0x77b959[_0x24fc('0x2c')],_0x77b959[_0x24fc('0x2d')]);_0x278b18['attributes']=_[_0x24fc('0x30')](_0x77b959[_0x24fc('0x2c')],qs['fields'](_0x1e045a[_0x24fc('0x2d')][_0x24fc('0x31')]));_0x278b18[_0x24fc('0x32')]=_0x278b18[_0x24fc('0x32')]['length']?_0x278b18[_0x24fc('0x32')]:_0x77b959[_0x24fc('0x2c')];if(_0x1e045a[_0x24fc('0x2d')][_0x24fc('0x3f')]){_0x278b18[_0x24fc('0x44')]=[{'all':!![]}];}_0x278b18=_['merge']({},_0x278b18,_0x1e045a[_0x24fc('0x3e')]);return db[_0x24fc('0x2a')][_0x24fc('0x45')](_0x278b18)[_0x24fc('0x25')](handleEntityNotFound(_0x431189,null))['then'](respondWithResult(_0x431189,null))[_0x24fc('0x41')](handleError(_0x431189,null));};exports[_0x24fc('0x46')]=function(_0x5ea251,_0x5bbb6c){return db[_0x24fc('0x2a')]['describe']()['then'](respondWithResult(_0x5bbb6c,null))[_0x24fc('0x41')](handleError(_0x5bbb6c,null));};exports['update']=function(_0x281194,_0x264854){if(_0x281194[_0x24fc('0x47')]['uniqueid']){delete _0x281194[_0x24fc('0x47')][_0x24fc('0x48')];}return db[_0x24fc('0x2a')][_0x24fc('0x45')]({'where':{'uniqueid':_0x281194[_0x24fc('0x43')]['id']}})[_0x24fc('0x25')](handleEntityNotFound(_0x264854,null))[_0x24fc('0x25')](saveUpdates(_0x281194[_0x24fc('0x47')],null))['then'](respondWithResult(_0x264854,null))['catch'](handleError(_0x264854,null));};exports[_0x24fc('0x49')]=function(_0x2f1a99,_0x12e9f7,_0x5b5e7a){return db['CmHopperFinal'][_0x24fc('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x2f1a99[_0x24fc('0x43')]['id']},'attributes':[[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')][_0x24fc('0x4c')](_0x24fc('0x4d')))),_0x24fc('0x4e')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db['sequelize'][_0x24fc('0x4c')](_0x24fc('0x4f')))),_0x24fc('0x50')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db['sequelize']['fn']('IF',db[_0x24fc('0x4a')]['literal'](_0x24fc('0x51')))),_0x24fc('0x52')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')]['literal'](_0x24fc('0x53')))),_0x24fc('0x54')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')]['literal'](_0x24fc('0x55')))),_0x24fc('0x56')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')][_0x24fc('0x4c')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x24fc('0x57')],[db[_0x24fc('0x4a')]['fn']('COUNT',db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')][_0x24fc('0x4c')](_0x24fc('0x58')))),_0x24fc('0x59')],[db[_0x24fc('0x4a')]['fn']('COUNT',db[_0x24fc('0x4a')]['fn']('IF',db['sequelize'][_0x24fc('0x4c')](_0x24fc('0x5a')))),'answeringMachine']]})[_0x24fc('0x25')](handleEntityNotFound(_0x12e9f7,null))['then'](respondWithResult(_0x12e9f7,null))[_0x24fc('0x41')](handleError(_0x12e9f7,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xdff811,_0x27b612,_0x57daaf){return db[_0x24fc('0x2a')]['findAll']({'raw':![],'where':{'CampaignId':_0xdff811[_0x24fc('0x43')]['id']},'attributes':[[db[_0x24fc('0x4a')]['fn']('COUNT',db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')][_0x24fc('0x4c')](_0x24fc('0x4d')))),_0x24fc('0x4e')],[db['sequelize']['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')][_0x24fc('0x4c')](_0x24fc('0x4f')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x24fc('0x51')))),_0x24fc('0x52')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db['sequelize']['fn']('IF',db[_0x24fc('0x4a')][_0x24fc('0x4c')](_0x24fc('0x53')))),_0x24fc('0x54')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')][_0x24fc('0x4c')](_0x24fc('0x55')))),_0x24fc('0x56')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')]['literal'](_0x24fc('0x5b')))),_0x24fc('0x57')],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')][_0x24fc('0x4c')](_0x24fc('0x58')))),'reCallContacts'],[db[_0x24fc('0x4a')]['fn'](_0x24fc('0x4b'),db[_0x24fc('0x4a')]['fn']('IF',db[_0x24fc('0x4a')]['literal'](_0x24fc('0x5a')))),_0x24fc('0x5c')]]})['then'](handleEntityNotFound(_0x27b612,null))['then'](respondWithResult(_0x27b612,null))['catch'](handleError(_0x27b612,null));};exports[_0x24fc('0x5d')]=function(_0x698283,_0x246ef1,_0x2c6a97){return db[_0x24fc('0x5e')][_0x24fc('0x45')]({'where':{'id':_0x698283['params']['id']}})[_0x24fc('0x25')](handleEntityNotFound(_0x246ef1,null))[_0x24fc('0x25')](function(_0x5a2c09){var _0x51b1c0;if(_0x5a2c09){_0x51b1c0=squel[_0x24fc('0x5f')]()[_0x24fc('0x60')](_0x24fc('0x61'))['fromQuery']([_0x24fc('0x62'),_0x24fc('0x63'),_0x24fc('0x64'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel['select']()[_0x24fc('0x3d')](_0x24fc('0x65'),_0x24fc('0x62'))[_0x24fc('0x3d')]('NOW()',_0x24fc('0x63'))['field'](_0x24fc('0x66'),'ContactId')[_0x24fc('0x3d')](_0x24fc('0x67'),_0x24fc('0x68'))[_0x24fc('0x3d')](_0x24fc('0x69'),_0x24fc('0x6a'))[_0x24fc('0x3d')]('NOW()',_0x24fc('0x6b'))[_0x24fc('0x3d')](_0x24fc('0x6c'),'updatedAt')['from'](_0x24fc('0x6d'))[_0x24fc('0x37')]('VoiceQueueId\x20=\x20?',_0x698283[_0x24fc('0x43')]['id'][_0x24fc('0x6e')]())['where'](_0x24fc('0x6f'),_0x698283[_0x24fc('0x47')]['state'][_0x24fc('0x6e')]())[_0x24fc('0x37')](_0x24fc('0x70'))[_0x24fc('0x37')](_0x24fc('0x71'),squel[_0x24fc('0x72')]()['field']('phone')[_0x24fc('0x73')]('cm_hopper')[_0x24fc('0x37')]('VoiceQueueId\x20=\x20?',_0x698283['params']['id'][_0x24fc('0x6e')]()))[_0x24fc('0x37')](_0x24fc('0x71'),squel[_0x24fc('0x72')]()[_0x24fc('0x3d')](_0x24fc('0x74'))[_0x24fc('0x73')](_0x24fc('0x6d'))['where'](_0x24fc('0x75'),_0x698283[_0x24fc('0x43')]['id']['toString']())['where'](_0x24fc('0x76')))[_0x24fc('0x77')](_0x24fc('0x64')))[_0x24fc('0x6e')]();return db[_0x24fc('0x4a')]['query'](_0x51b1c0);}return[];})[_0x24fc('0x25')](respondWithResult(_0x246ef1,null))[_0x24fc('0x41')](handleError(_0x246ef1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x13ab57,_0x400fa7,_0x235ae2){return db['Campaign'][_0x24fc('0x45')]({'where':{'id':_0x13ab57[_0x24fc('0x43')]['id']}})[_0x24fc('0x25')](handleEntityNotFound(_0x400fa7,null))[_0x24fc('0x25')](function(_0x1ca1bb){var _0x1ce8cb;if(_0x1ca1bb){_0x1ce8cb=squel[_0x24fc('0x5f')]()[_0x24fc('0x60')](_0x24fc('0x61'))['fromQuery']([_0x24fc('0x62'),_0x24fc('0x63'),_0x24fc('0x64'),'ListId','CampaignId','createdAt',_0x24fc('0x78')],squel['select']()[_0x24fc('0x3d')](_0x24fc('0x65'),'phone')[_0x24fc('0x3d')]('NOW()',_0x24fc('0x63'))['field'](_0x24fc('0x66'),_0x24fc('0x64'))[_0x24fc('0x3d')](_0x24fc('0x67'),_0x24fc('0x68'))[_0x24fc('0x3d')]('ANY_VALUE(CampaignId)',_0x24fc('0x79'))[_0x24fc('0x3d')](_0x24fc('0x6c'),_0x24fc('0x6b'))[_0x24fc('0x3d')](_0x24fc('0x6c'),_0x24fc('0x78'))[_0x24fc('0x73')](_0x24fc('0x6d'))['where'](_0x24fc('0x7a'),_0x13ab57[_0x24fc('0x43')]['id'][_0x24fc('0x6e')]())[_0x24fc('0x37')]('state\x20=\x20?',_0x13ab57[_0x24fc('0x47')][_0x24fc('0x7b')][_0x24fc('0x6e')]())['where'](_0x24fc('0x70'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x24fc('0x3d')]('phone')[_0x24fc('0x73')](_0x24fc('0x61'))[_0x24fc('0x37')](_0x24fc('0x7a'),_0x13ab57['params']['id'][_0x24fc('0x6e')]()))[_0x24fc('0x37')](_0x24fc('0x71'),squel[_0x24fc('0x72')]()[_0x24fc('0x3d')]('calleridnum')[_0x24fc('0x73')](_0x24fc('0x6d'))[_0x24fc('0x37')](_0x24fc('0x7a'),_0x13ab57['params']['id']['toString']())[_0x24fc('0x37')](_0x24fc('0x76')))[_0x24fc('0x77')](_0x24fc('0x64')))[_0x24fc('0x6e')]();return db['sequelize'][_0x24fc('0x2d')](_0x1ce8cb);}return[];})[_0x24fc('0x25')](respondWithResult(_0x400fa7,null))[_0x24fc('0x41')](handleError(_0x400fa7,null));};exports['checkContactHopper']=function(_0xa8881f,_0x69a2cd,_0x437233){return db[_0x24fc('0x7c')][_0x24fc('0x7d')]({'where':{'VoiceQueueId':_0xa8881f['body']['VoiceQueueId'],'CampaignId':_0xa8881f['body'][_0x24fc('0x79')],'ContactId':_0xa8881f[_0x24fc('0x47')][_0x24fc('0x64')]}})[_0x24fc('0x25')](handleEntityNotFound(_0x69a2cd,null))[_0x24fc('0x25')](function(_0x2ac3e8){if(_0x2ac3e8){return _0x2ac3e8;}return null;})[_0x24fc('0x25')](respondWithResult(_0x69a2cd,null))[_0x24fc('0x41')](handleError(_0x69a2cd,null));}; \ No newline at end of file +var _0xbdb7=['uniqueid','body','find','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','phone','cm_hopper','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','from','state','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','count','offset','limit','set','Content-Range','reject','save','then','destroy','sendStatus','name','send','index','CmHopperFinal','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','where','filter','merge','map','type','key','VIRTUAL','field','include','findAll','rows','catch','show','includeAll','options','describe','update'];(function(_0x224bcd,_0x587d60){var _0x2e761a=function(_0x5be1da){while(--_0x5be1da){_0x224bcd['push'](_0x224bcd['shift']());}};_0x2e761a(++_0x587d60);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3db58d,_0x3f0c01){_0x3db58d=_0x3db58d-0x0;var _0x17158d=_0xbdb7[_0x3db58d];return _0x17158d;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var authService=require(_0x7bdb('0xf'));var hardwareService=require(_0x7bdb('0x10'));var Redis=require(_0x7bdb('0x11'));var qs=require(_0x7bdb('0x12'));var logger=require(_0x7bdb('0x13'))(_0x7bdb('0x14'));var utils=require(_0x7bdb('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b9b9,_0x3053d0){_0x3053d0=_0x3053d0||0xcc;return function(_0x25e3cb){if(_0x25e3cb){return _0x52b9b9['sendStatus'](_0x3053d0);}return _0x52b9b9[_0x7bdb('0x16')](_0x3053d0)['end']();};}function respondWithResult(_0x5898c1,_0x2abca6){_0x2abca6=_0x2abca6||0xc8;return function(_0x46dd4a){if(_0x46dd4a){return _0x5898c1['status'](_0x2abca6)['json'](_0x46dd4a);}};}function respondWithFilteredResult(_0x4e98f7,_0x4476ff){return function(_0x195b2e){if(_0x195b2e){var _0xe9919f=_0x195b2e[_0x7bdb('0x17')],_0x25d417=_0x4476ff[_0x7bdb('0x18')],_0x31c909=_0x4476ff['offset']+_0x4476ff[_0x7bdb('0x19')],_0xbde12a;if(_0x31c909>=_0xe9919f){_0x31c909=_0xe9919f;_0xbde12a=0xc8;}else{_0xbde12a=0xce;}_0x4e98f7[_0x7bdb('0x16')](_0xbde12a);return _0x4e98f7[_0x7bdb('0x1a')](_0x7bdb('0x1b'),_0x25d417+'-'+_0x31c909+'/'+_0xe9919f)['json'](_0x195b2e);}return null;};}function patchUpdates(_0x41f540){return function(_0x23e9eb){try{jsonpatch['apply'](_0x23e9eb,_0x41f540,!![]);}catch(_0x3e5f8e){return BPromise[_0x7bdb('0x1c')](_0x3e5f8e);}return _0x23e9eb[_0x7bdb('0x1d')]();};}function saveUpdates(_0x45d552,_0x112793){return function(_0x5bfc35){if(_0x5bfc35){return _0x5bfc35['update'](_0x45d552)[_0x7bdb('0x1e')](function(_0xcb25f2){return _0xcb25f2;});}return null;};}function removeEntity(_0x5daea4,_0x341fe4){return function(_0x118ea1){if(_0x118ea1){return _0x118ea1[_0x7bdb('0x1f')]()[_0x7bdb('0x1e')](function(){_0x5daea4[_0x7bdb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d37ac,_0xdad53d){return function(_0x40c447){if(!_0x40c447){_0x1d37ac[_0x7bdb('0x20')](0x194);}return _0x40c447;};}function handleError(_0x481f4b,_0x4d6e44){_0x4d6e44=_0x4d6e44||0x1f4;return function(_0x3c423f){logger['error'](_0x3c423f['stack']);if(_0x3c423f['name']){delete _0x3c423f[_0x7bdb('0x21')];}_0x481f4b['status'](_0x4d6e44)[_0x7bdb('0x22')](_0x3c423f);};}exports[_0x7bdb('0x23')]=function(_0x3ec129,_0x7c09cf){var _0x2a494e={},_0x523869={},_0x10e818={'count':0x0,'rows':[]};var _0x32242d=db[_0x7bdb('0x24')][_0x7bdb('0x25')];_0x523869[_0x7bdb('0x26')]=_[_0x7bdb('0x27')](_0x32242d);_0x523869[_0x7bdb('0x28')]=_[_0x7bdb('0x27')](_0x3ec129[_0x7bdb('0x28')]);_0x523869[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](_0x523869[_0x7bdb('0x26')],_0x523869['query']);_0x2a494e[_0x7bdb('0x2b')]=_[_0x7bdb('0x2a')](_0x523869[_0x7bdb('0x26')],qs[_0x7bdb('0x2c')](_0x3ec129[_0x7bdb('0x28')]['fields']));_0x2a494e[_0x7bdb('0x2b')]=_0x2a494e[_0x7bdb('0x2b')][_0x7bdb('0x2d')]?_0x2a494e[_0x7bdb('0x2b')]:_0x523869['model'];if(!_0x3ec129['query']['hasOwnProperty'](_0x7bdb('0x2e'))){_0x2a494e['limit']=qs[_0x7bdb('0x19')](_0x3ec129['query'][_0x7bdb('0x19')]);_0x2a494e[_0x7bdb('0x18')]=qs[_0x7bdb('0x18')](_0x3ec129['query'][_0x7bdb('0x18')]);}_0x2a494e['order']=qs['sort'](_0x3ec129[_0x7bdb('0x28')]['sort']);_0x2a494e[_0x7bdb('0x2f')]=qs['filters'](_['pick'](_0x3ec129[_0x7bdb('0x28')],_0x523869[_0x7bdb('0x29')]));if(_0x3ec129[_0x7bdb('0x28')][_0x7bdb('0x30')]){_0x2a494e[_0x7bdb('0x2f')]=_[_0x7bdb('0x31')](_0x2a494e['where'],{'$or':_[_0x7bdb('0x32')](_0x32242d,function(_0x464fde){if(_0x464fde[_0x7bdb('0x33')][_0x7bdb('0x34')]!==_0x7bdb('0x35')){var _0x14c522={};_0x14c522[_0x464fde[_0x7bdb('0x36')]]={'$like':'%'+_0x3ec129[_0x7bdb('0x28')][_0x7bdb('0x30')]+'%'};return _0x14c522;}})});}_0x2a494e=_['merge']({},_0x2a494e,_0x3ec129['options']);var _0x19c237={'where':_0x2a494e[_0x7bdb('0x2f')]};return db[_0x7bdb('0x24')][_0x7bdb('0x17')](_0x19c237)[_0x7bdb('0x1e')](function(_0x509e90){_0x10e818['count']=_0x509e90;if(_0x3ec129[_0x7bdb('0x28')]['includeAll']){_0x2a494e[_0x7bdb('0x37')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7bdb('0x38')](_0x2a494e);})['then'](function(_0x4cf3fa){_0x10e818[_0x7bdb('0x39')]=_0x4cf3fa;return _0x10e818;})[_0x7bdb('0x1e')](respondWithFilteredResult(_0x7c09cf,_0x2a494e))[_0x7bdb('0x3a')](handleError(_0x7c09cf,null));};exports[_0x7bdb('0x3b')]=function(_0x43c7d3,_0x2b4829){var _0x2e10f3={'raw':!![],'where':{'id':_0x43c7d3['params']['id']}},_0x501aff={};_0x501aff[_0x7bdb('0x26')]=_[_0x7bdb('0x27')](db[_0x7bdb('0x24')][_0x7bdb('0x25')]);_0x501aff[_0x7bdb('0x28')]=_[_0x7bdb('0x27')](_0x43c7d3[_0x7bdb('0x28')]);_0x501aff['filters']=_['intersection'](_0x501aff[_0x7bdb('0x26')],_0x501aff[_0x7bdb('0x28')]);_0x2e10f3[_0x7bdb('0x2b')]=_[_0x7bdb('0x2a')](_0x501aff['model'],qs[_0x7bdb('0x2c')](_0x43c7d3['query'][_0x7bdb('0x2c')]));_0x2e10f3[_0x7bdb('0x2b')]=_0x2e10f3[_0x7bdb('0x2b')][_0x7bdb('0x2d')]?_0x2e10f3[_0x7bdb('0x2b')]:_0x501aff[_0x7bdb('0x26')];if(_0x43c7d3[_0x7bdb('0x28')][_0x7bdb('0x3c')]){_0x2e10f3[_0x7bdb('0x37')]=[{'all':!![]}];}_0x2e10f3=_['merge']({},_0x2e10f3,_0x43c7d3[_0x7bdb('0x3d')]);return db[_0x7bdb('0x24')]['find'](_0x2e10f3)[_0x7bdb('0x1e')](handleEntityNotFound(_0x2b4829,null))['then'](respondWithResult(_0x2b4829,null))[_0x7bdb('0x3a')](handleError(_0x2b4829,null));};exports[_0x7bdb('0x3e')]=function(_0x122beb,_0x3a8415){return db[_0x7bdb('0x24')]['describe']()[_0x7bdb('0x1e')](respondWithResult(_0x3a8415,null))[_0x7bdb('0x3a')](handleError(_0x3a8415,null));};exports[_0x7bdb('0x3f')]=function(_0x3eda2e,_0x31244f){if(_0x3eda2e['body'][_0x7bdb('0x40')]){delete _0x3eda2e[_0x7bdb('0x41')][_0x7bdb('0x40')];}return db[_0x7bdb('0x24')][_0x7bdb('0x42')]({'where':{'uniqueid':_0x3eda2e[_0x7bdb('0x43')]['id']}})[_0x7bdb('0x1e')](handleEntityNotFound(_0x31244f,null))[_0x7bdb('0x1e')](saveUpdates(_0x3eda2e[_0x7bdb('0x41')],null))[_0x7bdb('0x1e')](respondWithResult(_0x31244f,null))['catch'](handleError(_0x31244f,null));};exports[_0x7bdb('0x44')]=function(_0x58c4bc,_0x47cccd,_0x1a7cbf){return db[_0x7bdb('0x24')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x58c4bc[_0x7bdb('0x43')]['id']},'attributes':[[db[_0x7bdb('0x45')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7bdb('0x46')](_0x7bdb('0x47')))),_0x7bdb('0x48')],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db[_0x7bdb('0x45')]['fn']('IF',db[_0x7bdb('0x45')][_0x7bdb('0x46')](_0x7bdb('0x4a')))),_0x7bdb('0x4b')],[db['sequelize']['fn'](_0x7bdb('0x49'),db['sequelize']['fn']('IF',db[_0x7bdb('0x45')][_0x7bdb('0x46')](_0x7bdb('0x4c')))),_0x7bdb('0x4d')],[db['sequelize']['fn'](_0x7bdb('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x7bdb('0x46')](_0x7bdb('0x4e')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x7bdb('0x45')]['fn']('IF',db['sequelize']['literal'](_0x7bdb('0x4f')))),_0x7bdb('0x50')],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db['sequelize']['fn']('IF',db[_0x7bdb('0x45')]['literal'](_0x7bdb('0x51')))),_0x7bdb('0x52')],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db[_0x7bdb('0x45')]['fn']('IF',db[_0x7bdb('0x45')]['literal'](_0x7bdb('0x53')))),_0x7bdb('0x54')],[db[_0x7bdb('0x45')]['fn']('COUNT',db[_0x7bdb('0x45')]['fn']('IF',db[_0x7bdb('0x45')]['literal'](_0x7bdb('0x55')))),'answeringMachine']]})[_0x7bdb('0x1e')](handleEntityNotFound(_0x47cccd,null))[_0x7bdb('0x1e')](respondWithResult(_0x47cccd,null))['catch'](handleError(_0x47cccd,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x21a54f,_0x2a6c5b,_0x560f54){return db[_0x7bdb('0x24')]['findAll']({'raw':![],'where':{'CampaignId':_0x21a54f[_0x7bdb('0x43')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x7bdb('0x45')]['fn']('IF',db[_0x7bdb('0x45')][_0x7bdb('0x46')](_0x7bdb('0x47')))),_0x7bdb('0x48')],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db[_0x7bdb('0x45')]['fn']('IF',db[_0x7bdb('0x45')][_0x7bdb('0x46')](_0x7bdb('0x4a')))),_0x7bdb('0x4b')],[db['sequelize']['fn'](_0x7bdb('0x49'),db[_0x7bdb('0x45')]['fn']('IF',db['sequelize'][_0x7bdb('0x46')](_0x7bdb('0x4c')))),_0x7bdb('0x4d')],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db['sequelize']['fn']('IF',db[_0x7bdb('0x45')][_0x7bdb('0x46')](_0x7bdb('0x4e')))),'congestionContacts'],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db[_0x7bdb('0x45')]['fn']('IF',db[_0x7bdb('0x45')][_0x7bdb('0x46')](_0x7bdb('0x4f')))),_0x7bdb('0x50')],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db['sequelize']['fn']('IF',db[_0x7bdb('0x45')][_0x7bdb('0x46')](_0x7bdb('0x51')))),_0x7bdb('0x52')],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db[_0x7bdb('0x45')]['fn']('IF',db[_0x7bdb('0x45')][_0x7bdb('0x46')](_0x7bdb('0x53')))),_0x7bdb('0x54')],[db[_0x7bdb('0x45')]['fn'](_0x7bdb('0x49'),db['sequelize']['fn']('IF',db[_0x7bdb('0x45')]['literal'](_0x7bdb('0x55')))),_0x7bdb('0x56')]]})[_0x7bdb('0x1e')](handleEntityNotFound(_0x2a6c5b,null))['then'](respondWithResult(_0x2a6c5b,null))[_0x7bdb('0x3a')](handleError(_0x2a6c5b,null));};exports[_0x7bdb('0x57')]=function(_0x4ebc9f,_0x3b4736,_0x1f9024){return db['VoiceQueue'][_0x7bdb('0x42')]({'where':{'id':_0x4ebc9f[_0x7bdb('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b4736,null))[_0x7bdb('0x1e')](function(_0x237688){var _0x4fbb58;if(_0x237688){_0x4fbb58=squel[_0x7bdb('0x58')]()[_0x7bdb('0x59')]('cm_hopper')[_0x7bdb('0x5a')](['phone',_0x7bdb('0x5b'),_0x7bdb('0x5c'),_0x7bdb('0x5d'),_0x7bdb('0x5e'),_0x7bdb('0x5f'),'updatedAt'],squel['select']()['field'](_0x7bdb('0x60'),'phone')[_0x7bdb('0x36')](_0x7bdb('0x61'),_0x7bdb('0x5b'))['field']('ANY_VALUE(ContactId)',_0x7bdb('0x5c'))[_0x7bdb('0x36')](_0x7bdb('0x62'),_0x7bdb('0x5d'))['field'](_0x7bdb('0x63'),_0x7bdb('0x5e'))[_0x7bdb('0x36')](_0x7bdb('0x61'),_0x7bdb('0x5f'))[_0x7bdb('0x36')]('NOW()',_0x7bdb('0x64'))['from'](_0x7bdb('0x65'))['where'](_0x7bdb('0x66'),_0x4ebc9f[_0x7bdb('0x43')]['id'][_0x7bdb('0x67')]())[_0x7bdb('0x2f')](_0x7bdb('0x68'),_0x4ebc9f['body']['state'][_0x7bdb('0x67')]())[_0x7bdb('0x2f')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x7bdb('0x2f')](_0x7bdb('0x69'),squel['select']()[_0x7bdb('0x36')](_0x7bdb('0x6a'))['from'](_0x7bdb('0x6b'))['where']('VoiceQueueId\x20=\x20?',_0x4ebc9f[_0x7bdb('0x43')]['id'][_0x7bdb('0x67')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7bdb('0x6c')]()['field'](_0x7bdb('0x6d'))['from'](_0x7bdb('0x65'))[_0x7bdb('0x2f')](_0x7bdb('0x66'),_0x4ebc9f[_0x7bdb('0x43')]['id']['toString']())[_0x7bdb('0x2f')](_0x7bdb('0x6e')))['group'](_0x7bdb('0x5c')))[_0x7bdb('0x67')]();return db['sequelize'][_0x7bdb('0x28')](_0x4fbb58);}return[];})[_0x7bdb('0x1e')](respondWithResult(_0x3b4736,null))[_0x7bdb('0x3a')](handleError(_0x3b4736,null));};exports[_0x7bdb('0x6f')]=function(_0x521d68,_0x324285,_0x5af736){return db[_0x7bdb('0x70')][_0x7bdb('0x42')]({'where':{'id':_0x521d68[_0x7bdb('0x43')]['id']}})['then'](handleEntityNotFound(_0x324285,null))[_0x7bdb('0x1e')](function(_0x4c1b4b){var _0x12bd09;if(_0x4c1b4b){_0x12bd09=squel[_0x7bdb('0x58')]()[_0x7bdb('0x59')](_0x7bdb('0x6b'))[_0x7bdb('0x5a')]([_0x7bdb('0x6a'),_0x7bdb('0x5b'),_0x7bdb('0x5c'),_0x7bdb('0x5d'),_0x7bdb('0x71'),_0x7bdb('0x5f'),_0x7bdb('0x64')],squel[_0x7bdb('0x6c')]()[_0x7bdb('0x36')](_0x7bdb('0x60'),_0x7bdb('0x6a'))['field'](_0x7bdb('0x61'),_0x7bdb('0x5b'))[_0x7bdb('0x36')](_0x7bdb('0x72'),_0x7bdb('0x5c'))[_0x7bdb('0x36')](_0x7bdb('0x62'),_0x7bdb('0x5d'))[_0x7bdb('0x36')](_0x7bdb('0x73'),_0x7bdb('0x71'))['field']('NOW()','createdAt')[_0x7bdb('0x36')](_0x7bdb('0x61'),'updatedAt')[_0x7bdb('0x74')](_0x7bdb('0x65'))['where']('CampaignId\x20=\x20?',_0x521d68['params']['id'][_0x7bdb('0x67')]())['where']('state\x20=\x20?',_0x521d68['body'][_0x7bdb('0x75')][_0x7bdb('0x67')]())[_0x7bdb('0x2f')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x7bdb('0x2f')](_0x7bdb('0x69'),squel[_0x7bdb('0x6c')]()[_0x7bdb('0x36')]('phone')[_0x7bdb('0x74')]('cm_hopper')[_0x7bdb('0x2f')](_0x7bdb('0x76'),_0x521d68[_0x7bdb('0x43')]['id']['toString']()))[_0x7bdb('0x2f')](_0x7bdb('0x69'),squel[_0x7bdb('0x6c')]()['field'](_0x7bdb('0x6d'))[_0x7bdb('0x74')]('cm_hopper_final')[_0x7bdb('0x2f')](_0x7bdb('0x76'),_0x521d68['params']['id'][_0x7bdb('0x67')]())[_0x7bdb('0x2f')](_0x7bdb('0x6e')))[_0x7bdb('0x77')](_0x7bdb('0x5c')))['toString']();return db[_0x7bdb('0x45')]['query'](_0x12bd09);}return[];})[_0x7bdb('0x1e')](respondWithResult(_0x324285,null))[_0x7bdb('0x3a')](handleError(_0x324285,null));};exports[_0x7bdb('0x78')]=function(_0x4b7730,_0xeebdc2,_0x59f4da){return db[_0x7bdb('0x79')]['findOne']({'where':{'VoiceQueueId':_0x4b7730[_0x7bdb('0x41')][_0x7bdb('0x5e')],'CampaignId':_0x4b7730[_0x7bdb('0x41')][_0x7bdb('0x71')],'ContactId':_0x4b7730[_0x7bdb('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xeebdc2,null))[_0x7bdb('0x1e')](function(_0x1175c6){if(_0x1175c6){return _0x1175c6;}return null;})[_0x7bdb('0x1e')](respondWithResult(_0xeebdc2,null))[_0x7bdb('0x3a')](handleError(_0xeebdc2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 565e705..6f21ae3 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 _0x57ca=['util','../../config/logger','moment','bluebird','request-promise','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x57ca,0x108));var _0xa57c=function(_0x29a7d1,_0x513ff3){_0x29a7d1=_0x29a7d1-0x0;var _0x408c79=_0x57ca[_0x29a7d1];return _0x408c79;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var attributes=require(_0xa57c('0x5'));module[_0xa57c('0x6')]=function(_0x48be2d,_0x40ba22){return _0x48be2d[_0xa57c('0x7')](_0xa57c('0x8'),attributes,{'tableName':_0xa57c('0x9'),'paranoid':![],'indexes':[{'name':_0xa57c('0xa'),'fields':[_0xa57c('0xa')]},{'name':_0xa57c('0xb'),'fields':[_0xa57c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['util','../../config/logger','moment','bluebird','request-promise','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x57ca,0x108));var _0xa57c=function(_0x2692d4,_0x1f323c){_0x2692d4=_0x2692d4-0x0;var _0x2c5d1d=_0x57ca[_0x2692d4];return _0x2c5d1d;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var attributes=require(_0xa57c('0x5'));module[_0xa57c('0x6')]=function(_0x48be2d,_0x40ba22){return _0x48be2d[_0xa57c('0x7')](_0xa57c('0x8'),attributes,{'tableName':_0xa57c('0x9'),'paranoid':![],'indexes':[{'name':_0xa57c('0xa'),'fields':[_0xa57c('0xa')]},{'name':_0xa57c('0xb'),'fields':[_0xa57c('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 e1c4873..a329284 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 _0xaa88=['debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','CmHopperFinal,\x20%s,\x20%s','message','result','catch','create','body','options','CreateCmHopperFinal','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent'];(function(_0x663d33,_0xa05498){var _0x6dbcde=function(_0x1b0710){while(--_0x1b0710){_0x663d33['push'](_0x663d33['shift']());}};_0x6dbcde(++_0xa05498);}(_0xaa88,0x137));var _0x8aa8=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0xaa88[_0x4df85c];return _0x4e2a61;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('CmHopperFinal,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}exports['CreateCmHopperFinal']=function(_0x2c1b9a){var _0x49d80d=this;return new Promise(function(_0x557adc,_0xab7af5){return db['CmHopperFinal'][_0x8aa8('0x15')](_0x2c1b9a[_0x8aa8('0x16')],{'raw':_0x2c1b9a[_0x8aa8('0x17')]?_0x2c1b9a[_0x8aa8('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x8aa8('0xb')](function(_0x36c445){logger[_0x8aa8('0xc')](_0x8aa8('0x18'),_0x2c1b9a);logger[_0x8aa8('0xe')](_0x8aa8('0x18'),_0x2c1b9a,JSON['stringify'](_0x36c445));_0x557adc(_0x36c445);})[_0x8aa8('0x14')](function(_0x4cc455){logger[_0x8aa8('0x10')]('CreateCmHopperFinal',_0x4cc455[_0x8aa8('0x12')],_0x2c1b9a);_0xab7af5(_0x49d80d['error'](0x1f4,_0x4cc455[_0x8aa8('0x12')]));});});}; \ No newline at end of file +var _0xa9e0=['message','result','catch','CmHopperFinal','create','body','options','raw','then','CreateCmHopperFinal','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x27b3fa,_0x506858){var _0x3a879e=function(_0x8d1131){while(--_0x8d1131){_0x27b3fa['push'](_0x27b3fa['shift']());}};_0x3a879e(++_0x506858);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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['CreateCmHopperFinal']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![]})[_0x0a9e('0x19')](function(_0x105080){logger['info'](_0x0a9e('0x1a'),_0x459eb1);logger[_0x0a9e('0xd')]('CreateCmHopperFinal',_0x459eb1,JSON[_0x0a9e('0x1b')](_0x105080));_0x106033(_0x105080);})['catch'](function(_0x588269){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x588269[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x588269['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index c3f92d3..a58d219 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x469492,_0x2d5107){var _0x22dfda=function(_0x1d0107){while(--_0x1d0107){_0x469492['push'](_0x469492['shift']());}};_0x22dfda(++_0x2d5107);}(_0x34e8,0x12c));var _0x834e=function(_0x1ae35e,_0x2edfb5){_0x1ae35e=_0x1ae35e-0x0;var _0x32d49e=_0x34e8[_0x1ae35e];return _0x32d49e;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x436208,_0x33e732){var _0xced8f9=function(_0x4c0eea){while(--_0x4c0eea){_0x436208['push'](_0x436208['shift']());}};_0xced8f9(++_0x33e732);}(_0x34e8,0x12c));var _0x834e=function(_0x5402fe,_0x1df195){_0x5402fe=_0x5402fe-0x0;var _0x22ed4d=_0x34e8[_0x5402fe];return _0x22ed4d;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x18')]);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 a738288..98616fb 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 _0x5a2a=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x107cf5,_0x9fea45){var _0x2bd836=function(_0x10ac93){while(--_0x10ac93){_0x107cf5['push'](_0x107cf5['shift']());}};_0x2bd836(++_0x9fea45);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x5d698f,_0x20cccf){_0x5d698f=_0x5d698f-0x0;var _0x5099d0=_0x5a2a[_0x5d698f];return _0x5099d0;};'use strict';var Sequelize=require(_0xa5a2('0x0'));module[_0xa5a2('0x1')]={'state':{'type':Sequelize[_0xa5a2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa5a2('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa5a2('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa5a2('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xa5a2('0x3')]},'originatecalleridname':{'type':Sequelize[_0xa5a2('0x3')]},'calleridnum':{'type':Sequelize[_0xa5a2('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xa5a2('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xa5a2('0x4')]},'droptime':{'type':Sequelize[_0xa5a2('0x4')]},'endtime':{'type':Sequelize[_0xa5a2('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa5a2('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa5a2('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa5a2('0x3')]},'campaign':{'type':Sequelize[_0xa5a2('0x3')]},'campaigntype':{'type':Sequelize[_0xa5a2('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa5a2('0x3')]},'amd':{'type':Sequelize[_0xa5a2('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa5a2('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xa5a2('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa5a2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa5a2('0x4')]},'recallme':{'type':Sequelize[_0xa5a2('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x39c7=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x5755e8,_0xcd6b0a){var _0x495913=function(_0x3097e){while(--_0x3097e){_0x5755e8['push'](_0x5755e8['shift']());}};_0x495913(++_0xcd6b0a);}(_0x39c7,0x85));var _0x739c=function(_0x1dab49,_0xb2a5ab){_0x1dab49=_0x1dab49-0x0;var _0x13f016=_0x39c7[_0x1dab49];return _0x13f016;};'use strict';var Sequelize=require('sequelize');module[_0x739c('0x0')]={'state':{'type':Sequelize[_0x739c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x739c('0x2')]},'scheduledat':{'type':Sequelize[_0x739c('0x3')]},'countbusyretry':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x739c('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x739c('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x739c('0x2')]},'starttime':{'type':Sequelize[_0x739c('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x739c('0x3')]},'endtime':{'type':Sequelize[_0x739c('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x739c('0x2')]},'campaigntype':{'type':Sequelize[_0x739c('0x2')]},'membername':{'type':Sequelize[_0x739c('0x2')]},'reason':{'type':Sequelize[_0x739c('0x2')]},'amd':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x739c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x739c('0x3')]},'recallme':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x739c('0x3')]},'edited':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 3a0c1b4..f2bb19a 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 _0x4b81=['catch','show','params','find','create','body','describe','uniqueid','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','CmHopperHistory','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows'];(function(_0x4bb593,_0x272ed0){var _0x2da2d8=function(_0x4b25e9){while(--_0x4b25e9){_0x4bb593['push'](_0x4bb593['shift']());}};_0x2da2d8(++_0x272ed0);}(_0x4b81,0x9e));var _0x14b8=function(_0x7d3039,_0x63151b){_0x7d3039=_0x7d3039-0x0;var _0x24031e=_0x4b81[_0x7d3039];return _0x24031e;};'use strict';var pdf=require(_0x14b8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x14b8('0x1'));var zipdir=require(_0x14b8('0x2'));var jsonpatch=require(_0x14b8('0x3'));var rp=require(_0x14b8('0x4'));var moment=require('moment');var BPromise=require(_0x14b8('0x5'));var Mustache=require(_0x14b8('0x6'));var util=require(_0x14b8('0x7'));var path=require(_0x14b8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x14b8('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x14b8('0xa'));var crypto=require(_0x14b8('0xb'));var jsforce=require(_0x14b8('0xc'));var deskjs=require(_0x14b8('0xd'));var toCsv=require(_0x14b8('0xe'));var querystring=require(_0x14b8('0xf'));var Papa=require(_0x14b8('0x10'));var authService=require(_0x14b8('0x11'));var hardwareService=require(_0x14b8('0x12'));var Redis=require('ioredis');var qs=require(_0x14b8('0x13'));var logger=require(_0x14b8('0x14'))(_0x14b8('0x15'));var utils=require(_0x14b8('0x16'));var config=require(_0x14b8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11ec47,_0x2b8da3){_0x2b8da3=_0x2b8da3||0xcc;return function(_0x1ef206){if(_0x1ef206){return _0x11ec47[_0x14b8('0x18')](_0x2b8da3);}return _0x11ec47[_0x14b8('0x19')](_0x2b8da3)[_0x14b8('0x1a')]();};}function respondWithResult(_0x5df8ef,_0xd43df7){_0xd43df7=_0xd43df7||0xc8;return function(_0x17de92){if(_0x17de92){return _0x5df8ef['status'](_0xd43df7)[_0x14b8('0x1b')](_0x17de92);}};}function respondWithFilteredResult(_0x10e778,_0x2bb9ab){return function(_0xaa6281){if(_0xaa6281){var _0x85b431=_0xaa6281[_0x14b8('0x1c')],_0x5a6a11=_0x2bb9ab[_0x14b8('0x1d')],_0x1eb9f6=_0x2bb9ab[_0x14b8('0x1d')]+_0x2bb9ab[_0x14b8('0x1e')],_0xe02bb9;if(_0x1eb9f6>=_0x85b431){_0x1eb9f6=_0x85b431;_0xe02bb9=0xc8;}else{_0xe02bb9=0xce;}_0x10e778[_0x14b8('0x19')](_0xe02bb9);return _0x10e778['set'](_0x14b8('0x1f'),_0x5a6a11+'-'+_0x1eb9f6+'/'+_0x85b431)['json'](_0xaa6281);}return null;};}function patchUpdates(_0x76b8bc){return function(_0x1fbfc5){try{jsonpatch[_0x14b8('0x20')](_0x1fbfc5,_0x76b8bc,!![]);}catch(_0x1b72b8){return BPromise[_0x14b8('0x21')](_0x1b72b8);}return _0x1fbfc5[_0x14b8('0x22')]();};}function saveUpdates(_0x174dc8,_0x86fe3e){return function(_0x1aef32){if(_0x1aef32){return _0x1aef32[_0x14b8('0x23')](_0x174dc8)[_0x14b8('0x24')](function(_0x993731){return _0x993731;});}return null;};}function removeEntity(_0x2b49f2,_0x587177){return function(_0xc17b48){if(_0xc17b48){return _0xc17b48[_0x14b8('0x25')]()[_0x14b8('0x24')](function(){_0x2b49f2[_0x14b8('0x19')](0xcc)[_0x14b8('0x1a')]();});}};}function handleEntityNotFound(_0x11418a,_0x535b0b){return function(_0x538864){if(!_0x538864){_0x11418a[_0x14b8('0x18')](0x194);}return _0x538864;};}function handleError(_0x45959b,_0x469bce){_0x469bce=_0x469bce||0x1f4;return function(_0x218a60){logger['error'](_0x218a60[_0x14b8('0x26')]);if(_0x218a60[_0x14b8('0x27')]){delete _0x218a60[_0x14b8('0x27')];}_0x45959b[_0x14b8('0x19')](_0x469bce)[_0x14b8('0x28')](_0x218a60);};}exports[_0x14b8('0x29')]=function(_0x200191,_0x448220){var _0x4241fb={},_0x52f224={},_0x13bb91={'count':0x0,'rows':[]};var _0x5dd77c=db[_0x14b8('0x2a')]['rawAttributes'];_0x52f224['model']=_[_0x14b8('0x2b')](_0x5dd77c);_0x52f224[_0x14b8('0x2c')]=_[_0x14b8('0x2b')](_0x200191['query']);_0x52f224[_0x14b8('0x2d')]=_['intersection'](_0x52f224[_0x14b8('0x2e')],_0x52f224['query']);_0x4241fb['attributes']=_[_0x14b8('0x2f')](_0x52f224[_0x14b8('0x2e')],qs[_0x14b8('0x30')](_0x200191['query'][_0x14b8('0x30')]));_0x4241fb[_0x14b8('0x31')]=_0x4241fb[_0x14b8('0x31')]['length']?_0x4241fb[_0x14b8('0x31')]:_0x52f224['model'];if(!_0x200191[_0x14b8('0x2c')][_0x14b8('0x32')](_0x14b8('0x33'))){_0x4241fb[_0x14b8('0x1e')]=qs[_0x14b8('0x1e')](_0x200191[_0x14b8('0x2c')][_0x14b8('0x1e')]);_0x4241fb['offset']=qs['offset'](_0x200191[_0x14b8('0x2c')]['offset']);}_0x4241fb[_0x14b8('0x34')]=qs[_0x14b8('0x35')](_0x200191[_0x14b8('0x2c')][_0x14b8('0x35')]);_0x4241fb['where']=qs[_0x14b8('0x2d')](_[_0x14b8('0x36')](_0x200191[_0x14b8('0x2c')],_0x52f224[_0x14b8('0x2d')]));if(_0x200191[_0x14b8('0x2c')]['filter']){_0x4241fb[_0x14b8('0x37')]=_[_0x14b8('0x38')](_0x4241fb[_0x14b8('0x37')],{'$or':_['map'](_0x5dd77c,function(_0x4d048b){if(_0x4d048b[_0x14b8('0x39')][_0x14b8('0x3a')]!==_0x14b8('0x3b')){var _0x2f7924={};_0x2f7924[_0x4d048b[_0x14b8('0x3c')]]={'$like':'%'+_0x200191[_0x14b8('0x2c')][_0x14b8('0x3d')]+'%'};return _0x2f7924;}})});}_0x4241fb=_['merge']({},_0x4241fb,_0x200191[_0x14b8('0x3e')]);var _0x129997={'where':_0x4241fb[_0x14b8('0x37')]};return db[_0x14b8('0x2a')][_0x14b8('0x1c')](_0x129997)[_0x14b8('0x24')](function(_0x5c4682){_0x13bb91[_0x14b8('0x1c')]=_0x5c4682;if(_0x200191[_0x14b8('0x2c')][_0x14b8('0x3f')]){_0x4241fb[_0x14b8('0x40')]=[{'all':!![]}];}return db[_0x14b8('0x2a')][_0x14b8('0x41')](_0x4241fb);})['then'](function(_0x1444d1){_0x13bb91[_0x14b8('0x42')]=_0x1444d1;return _0x13bb91;})[_0x14b8('0x24')](respondWithFilteredResult(_0x448220,_0x4241fb))[_0x14b8('0x43')](handleError(_0x448220,null));};exports[_0x14b8('0x44')]=function(_0x469f68,_0x7451cf){var _0x2ed496={'raw':!![],'where':{'id':_0x469f68[_0x14b8('0x45')]['id']}},_0x20c7d8={};_0x20c7d8['model']=_[_0x14b8('0x2b')](db['CmHopperHistory']['rawAttributes']);_0x20c7d8[_0x14b8('0x2c')]=_[_0x14b8('0x2b')](_0x469f68[_0x14b8('0x2c')]);_0x20c7d8[_0x14b8('0x2d')]=_[_0x14b8('0x2f')](_0x20c7d8[_0x14b8('0x2e')],_0x20c7d8['query']);_0x2ed496[_0x14b8('0x31')]=_[_0x14b8('0x2f')](_0x20c7d8[_0x14b8('0x2e')],qs[_0x14b8('0x30')](_0x469f68['query'][_0x14b8('0x30')]));_0x2ed496[_0x14b8('0x31')]=_0x2ed496[_0x14b8('0x31')]['length']?_0x2ed496['attributes']:_0x20c7d8[_0x14b8('0x2e')];if(_0x469f68['query'][_0x14b8('0x3f')]){_0x2ed496[_0x14b8('0x40')]=[{'all':!![]}];}_0x2ed496=_['merge']({},_0x2ed496,_0x469f68[_0x14b8('0x3e')]);return db[_0x14b8('0x2a')][_0x14b8('0x46')](_0x2ed496)[_0x14b8('0x24')](handleEntityNotFound(_0x7451cf,null))[_0x14b8('0x24')](respondWithResult(_0x7451cf,null))['catch'](handleError(_0x7451cf,null));};exports['create']=function(_0x18630f,_0x30a6a3){return db[_0x14b8('0x2a')][_0x14b8('0x47')](_0x18630f[_0x14b8('0x48')],{})[_0x14b8('0x24')](respondWithResult(_0x30a6a3,0xc9))[_0x14b8('0x43')](handleError(_0x30a6a3,null));};exports[_0x14b8('0x49')]=function(_0x7029e1,_0x2d54a1){return db[_0x14b8('0x2a')][_0x14b8('0x49')]()[_0x14b8('0x24')](respondWithResult(_0x2d54a1,null))[_0x14b8('0x43')](handleError(_0x2d54a1,null));};exports[_0x14b8('0x23')]=function(_0x5cd770,_0x4e15db){if(_0x5cd770['body'][_0x14b8('0x4a')]){delete _0x5cd770[_0x14b8('0x48')][_0x14b8('0x4a')];}return db['CmHopperHistory'][_0x14b8('0x46')]({'where':{'uniqueid':_0x5cd770[_0x14b8('0x45')]['id']}})[_0x14b8('0x24')](handleEntityNotFound(_0x4e15db,null))['then'](saveUpdates(_0x5cd770[_0x14b8('0x48')],null))['then'](respondWithResult(_0x4e15db,null))['catch'](handleError(_0x4e15db,null));}; \ No newline at end of file +var _0x450a=['catch','show','fields','find','create','body','describe','uniqueid','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','CmHopperHistory','rawAttributes','keys','query','filters','model','intersection','attributes','length','limit','order','where','pick','filter','merge','map','type','key','field','options','count','includeAll','include','findAll','rows'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0x450a,0x11c));var _0xa450=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x450a[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0xa450('0x0'));var emlformat=require(_0xa450('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa450('0x2'));var rp=require(_0xa450('0x3'));var moment=require('moment');var BPromise=require(_0xa450('0x4'));var Mustache=require(_0xa450('0x5'));var util=require('util');var path=require(_0xa450('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa450('0x7'));var fs=require('fs');var _=require(_0xa450('0x8'));var squel=require(_0xa450('0x9'));var crypto=require(_0xa450('0xa'));var jsforce=require(_0xa450('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa450('0xc'));var authService=require(_0xa450('0xd'));var hardwareService=require(_0xa450('0xe'));var Redis=require(_0xa450('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xa450('0x10'))('api');var utils=require(_0xa450('0x11'));var config=require(_0xa450('0x12'));var db=require(_0xa450('0x13'))['db'];function respondWithStatusCode(_0x349f18,_0x304cee){_0x304cee=_0x304cee||0xcc;return function(_0x5ac199){if(_0x5ac199){return _0x349f18[_0xa450('0x14')](_0x304cee);}return _0x349f18['status'](_0x304cee)['end']();};}function respondWithResult(_0x2645ee,_0x1d96b8){_0x1d96b8=_0x1d96b8||0xc8;return function(_0x20060e){if(_0x20060e){return _0x2645ee[_0xa450('0x15')](_0x1d96b8)['json'](_0x20060e);}};}function respondWithFilteredResult(_0x1b2ea5,_0x5289ba){return function(_0x5897ae){if(_0x5897ae){var _0x24b94f=_0x5897ae['count'],_0x4b43a5=_0x5289ba[_0xa450('0x16')],_0x571288=_0x5289ba[_0xa450('0x16')]+_0x5289ba['limit'],_0x3c78e6;if(_0x571288>=_0x24b94f){_0x571288=_0x24b94f;_0x3c78e6=0xc8;}else{_0x3c78e6=0xce;}_0x1b2ea5['status'](_0x3c78e6);return _0x1b2ea5[_0xa450('0x17')](_0xa450('0x18'),_0x4b43a5+'-'+_0x571288+'/'+_0x24b94f)[_0xa450('0x19')](_0x5897ae);}return null;};}function patchUpdates(_0x52e95c){return function(_0x297f5c){try{jsonpatch[_0xa450('0x1a')](_0x297f5c,_0x52e95c,!![]);}catch(_0x1e0d5c){return BPromise[_0xa450('0x1b')](_0x1e0d5c);}return _0x297f5c[_0xa450('0x1c')]();};}function saveUpdates(_0xfa71e8,_0x163e79){return function(_0x980102){if(_0x980102){return _0x980102[_0xa450('0x1d')](_0xfa71e8)[_0xa450('0x1e')](function(_0x27538a){return _0x27538a;});}return null;};}function removeEntity(_0x22bf55,_0x6e6850){return function(_0x47ae94){if(_0x47ae94){return _0x47ae94[_0xa450('0x1f')]()[_0xa450('0x1e')](function(){_0x22bf55[_0xa450('0x15')](0xcc)[_0xa450('0x20')]();});}};}function handleEntityNotFound(_0xd52995,_0x3f2c72){return function(_0x383f23){if(!_0x383f23){_0xd52995[_0xa450('0x14')](0x194);}return _0x383f23;};}function handleError(_0x2775ba,_0xc58205){_0xc58205=_0xc58205||0x1f4;return function(_0x5052ad){logger['error'](_0x5052ad[_0xa450('0x21')]);if(_0x5052ad[_0xa450('0x22')]){delete _0x5052ad[_0xa450('0x22')];}_0x2775ba['status'](_0xc58205)[_0xa450('0x23')](_0x5052ad);};}exports['index']=function(_0x4cd612,_0xef1846){var _0x210e39={},_0x28ed16={},_0x501d18={'count':0x0,'rows':[]};var _0x15d6b1=db[_0xa450('0x24')][_0xa450('0x25')];_0x28ed16['model']=_[_0xa450('0x26')](_0x15d6b1);_0x28ed16[_0xa450('0x27')]=_['keys'](_0x4cd612[_0xa450('0x27')]);_0x28ed16[_0xa450('0x28')]=_['intersection'](_0x28ed16[_0xa450('0x29')],_0x28ed16[_0xa450('0x27')]);_0x210e39['attributes']=_[_0xa450('0x2a')](_0x28ed16[_0xa450('0x29')],qs['fields'](_0x4cd612[_0xa450('0x27')]['fields']));_0x210e39[_0xa450('0x2b')]=_0x210e39['attributes'][_0xa450('0x2c')]?_0x210e39[_0xa450('0x2b')]:_0x28ed16[_0xa450('0x29')];if(!_0x4cd612[_0xa450('0x27')]['hasOwnProperty']('nolimit')){_0x210e39[_0xa450('0x2d')]=qs['limit'](_0x4cd612[_0xa450('0x27')][_0xa450('0x2d')]);_0x210e39[_0xa450('0x16')]=qs['offset'](_0x4cd612[_0xa450('0x27')]['offset']);}_0x210e39[_0xa450('0x2e')]=qs['sort'](_0x4cd612[_0xa450('0x27')]['sort']);_0x210e39[_0xa450('0x2f')]=qs[_0xa450('0x28')](_[_0xa450('0x30')](_0x4cd612[_0xa450('0x27')],_0x28ed16[_0xa450('0x28')]));if(_0x4cd612[_0xa450('0x27')][_0xa450('0x31')]){_0x210e39[_0xa450('0x2f')]=_[_0xa450('0x32')](_0x210e39[_0xa450('0x2f')],{'$or':_[_0xa450('0x33')](_0x15d6b1,function(_0x216275){if(_0x216275[_0xa450('0x34')][_0xa450('0x35')]!=='VIRTUAL'){var _0x12c338={};_0x12c338[_0x216275[_0xa450('0x36')]]={'$like':'%'+_0x4cd612[_0xa450('0x27')][_0xa450('0x31')]+'%'};return _0x12c338;}})});}_0x210e39=_['merge']({},_0x210e39,_0x4cd612[_0xa450('0x37')]);var _0x483794={'where':_0x210e39[_0xa450('0x2f')]};return db[_0xa450('0x24')]['count'](_0x483794)[_0xa450('0x1e')](function(_0x32ac4e){_0x501d18[_0xa450('0x38')]=_0x32ac4e;if(_0x4cd612[_0xa450('0x27')][_0xa450('0x39')]){_0x210e39[_0xa450('0x3a')]=[{'all':!![]}];}return db[_0xa450('0x24')][_0xa450('0x3b')](_0x210e39);})[_0xa450('0x1e')](function(_0x3d8d06){_0x501d18[_0xa450('0x3c')]=_0x3d8d06;return _0x501d18;})[_0xa450('0x1e')](respondWithFilteredResult(_0xef1846,_0x210e39))[_0xa450('0x3d')](handleError(_0xef1846,null));};exports[_0xa450('0x3e')]=function(_0x28a1eb,_0x3b46de){var _0x50e246={'raw':!![],'where':{'id':_0x28a1eb['params']['id']}},_0x1cf06f={};_0x1cf06f[_0xa450('0x29')]=_['keys'](db[_0xa450('0x24')][_0xa450('0x25')]);_0x1cf06f[_0xa450('0x27')]=_['keys'](_0x28a1eb[_0xa450('0x27')]);_0x1cf06f[_0xa450('0x28')]=_[_0xa450('0x2a')](_0x1cf06f[_0xa450('0x29')],_0x1cf06f[_0xa450('0x27')]);_0x50e246['attributes']=_['intersection'](_0x1cf06f[_0xa450('0x29')],qs[_0xa450('0x3f')](_0x28a1eb[_0xa450('0x27')][_0xa450('0x3f')]));_0x50e246['attributes']=_0x50e246['attributes'][_0xa450('0x2c')]?_0x50e246[_0xa450('0x2b')]:_0x1cf06f[_0xa450('0x29')];if(_0x28a1eb[_0xa450('0x27')][_0xa450('0x39')]){_0x50e246['include']=[{'all':!![]}];}_0x50e246=_[_0xa450('0x32')]({},_0x50e246,_0x28a1eb['options']);return db[_0xa450('0x24')][_0xa450('0x40')](_0x50e246)[_0xa450('0x1e')](handleEntityNotFound(_0x3b46de,null))[_0xa450('0x1e')](respondWithResult(_0x3b46de,null))[_0xa450('0x3d')](handleError(_0x3b46de,null));};exports[_0xa450('0x41')]=function(_0x176442,_0x3650ad){return db[_0xa450('0x24')][_0xa450('0x41')](_0x176442[_0xa450('0x42')],{})[_0xa450('0x1e')](respondWithResult(_0x3650ad,0xc9))[_0xa450('0x3d')](handleError(_0x3650ad,null));};exports[_0xa450('0x43')]=function(_0x2fb4be,_0x14942c){return db[_0xa450('0x24')][_0xa450('0x43')]()[_0xa450('0x1e')](respondWithResult(_0x14942c,null))['catch'](handleError(_0x14942c,null));};exports[_0xa450('0x1d')]=function(_0x282840,_0x27ebd6){if(_0x282840[_0xa450('0x42')][_0xa450('0x44')]){delete _0x282840[_0xa450('0x42')][_0xa450('0x44')];}return db[_0xa450('0x24')][_0xa450('0x40')]({'where':{'uniqueid':_0x282840['params']['id']}})['then'](handleEntityNotFound(_0x27ebd6,null))[_0xa450('0x1e')](saveUpdates(_0x282840[_0xa450('0x42')],null))[_0xa450('0x1e')](respondWithResult(_0x27ebd6,null))[_0xa450('0x3d')](handleError(_0x27ebd6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 9c55626..dfb31d4 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 _0x4299=['moment','request-promise','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api'];(function(_0x1c5996,_0x29f34){var _0x494f32=function(_0x4cdeba){while(--_0x4cdeba){_0x1c5996['push'](_0x1c5996['shift']());}};_0x494f32(++_0x29f34);}(_0x4299,0x131));var _0x9429=function(_0x8ef005,_0x2efb81){_0x8ef005=_0x8ef005-0x0;var _0x2726a1=_0x4299[_0x8ef005];return _0x2726a1;};'use strict';var _=require(_0x9429('0x0'));var util=require(_0x9429('0x1'));var logger=require('../../config/logger')(_0x9429('0x2'));var moment=require(_0x9429('0x3'));var BPromise=require('bluebird');var rp=require(_0x9429('0x4'));var attributes=require(_0x9429('0x5'));module[_0x9429('0x6')]=function(_0x40477b,_0x4bf1ca){return _0x40477b['define'](_0x9429('0x7'),attributes,{'tableName':_0x9429('0x8'),'paranoid':![],'indexes':[{'name':_0x9429('0x9'),'fields':[_0x9429('0x9')]},{'name':_0x9429('0xa'),'fields':[_0x9429('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9727=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2ebe99,_0x21c11e){var _0x2c2f9f=function(_0x573ce7){while(--_0x573ce7){_0x2ebe99['push'](_0x2ebe99['shift']());}};_0x2c2f9f(++_0x21c11e);}(_0x9727,0xca));var _0x7972=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x9727[_0x46401e];return _0x447cba;};'use strict';var _=require(_0x7972('0x0'));var util=require(_0x7972('0x1'));var logger=require(_0x7972('0x2'))('api');var moment=require(_0x7972('0x3'));var BPromise=require(_0x7972('0x4'));var rp=require(_0x7972('0x5'));var attributes=require(_0x7972('0x6'));module[_0x7972('0x7')]=function(_0x2957f7,_0xf1fd0d){return _0x2957f7[_0x7972('0x8')](_0x7972('0x9'),attributes,{'tableName':_0x7972('0xa'),'paranoid':![],'indexes':[{'name':_0x7972('0xb'),'fields':['endtime']},{'name':_0x7972('0xc'),'fields':[_0x7972('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 7e54088..e6a49fa 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 _0xafc2=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','where','COUNT','sequelize','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','stringify','catch','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','bluebird'];(function(_0x5b9418,_0x37e830){var _0x5261bc=function(_0x430c18){while(--_0x430c18){_0x5b9418['push'](_0x5b9418['shift']());}};_0x5261bc(++_0x37e830);}(_0xafc2,0x10e));var _0x2afc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xafc2[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2afc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2afc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2afc('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2afc('0x3'));var logger=require('../../config/logger')(_0x2afc('0x4'));var config=require(_0x2afc('0x5'));var jayson=require(_0x2afc('0x6'));var client=jayson['client'][_0x2afc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x457b52,_0x202425,_0x22b457){return new BPromise(function(_0xe674b1,_0x5940ef){return client[_0x2afc('0x8')](_0x457b52,_0x22b457)[_0x2afc('0x9')](function(_0x2082e8){logger[_0x2afc('0xa')](_0x2afc('0xb'),_0x202425,_0x2afc('0xc'));logger[_0x2afc('0xd')](_0x2afc('0xe'),_0x202425,_0x2afc('0xc'),JSON['stringify'](_0x2082e8));if(_0x2082e8['error']){if(_0x2082e8[_0x2afc('0xf')]['code']===0x1f4){logger[_0x2afc('0xf')](_0x2afc('0xb'),_0x202425,_0x2082e8['error'][_0x2afc('0x10')]);return _0x5940ef(_0x2082e8[_0x2afc('0xf')]['message']);}logger[_0x2afc('0xf')](_0x2afc('0xb'),_0x202425,_0x2082e8['error']['message']);return _0xe674b1(_0x2082e8[_0x2afc('0xf')][_0x2afc('0x10')]);}else{logger[_0x2afc('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x202425,'request\x20sent');_0xe674b1(_0x2082e8[_0x2afc('0x11')][_0x2afc('0x10')]);}})['catch'](function(_0xa3c99a){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x202425,_0xa3c99a);_0x5940ef(_0xa3c99a);});});}exports['CreateCmHopperHistory']=function(_0x2bb0cb){var _0x10157e=this;return new Promise(function(_0x4abd9,_0x1c9828){return db[_0x2afc('0x12')][_0x2afc('0x13')](_0x2bb0cb[_0x2afc('0x14')],{'raw':_0x2bb0cb[_0x2afc('0x15')]?_0x2bb0cb[_0x2afc('0x15')][_0x2afc('0x16')]===undefined?!![]:![]:!![]})[_0x2afc('0x9')](function(_0x4dabbd){logger[_0x2afc('0xa')](_0x2afc('0x17'),_0x2bb0cb);logger['debug'](_0x2afc('0x17'),_0x2bb0cb,JSON['stringify'](_0x4dabbd));_0x4abd9(_0x4dabbd);})['catch'](function(_0x4b0eef){logger[_0x2afc('0xf')](_0x2afc('0x17'),_0x4b0eef[_0x2afc('0x10')],_0x2bb0cb);_0x1c9828(_0x10157e[_0x2afc('0xf')](0x1f4,_0x4b0eef[_0x2afc('0x10')]));});});};exports[_0x2afc('0x18')]=function(_0x2ca709){var _0x85b03e=this;return new Promise(function(_0x2a1cde,_0x300aba){return db[_0x2afc('0x12')]['findAll']({'raw':_0x2ca709[_0x2afc('0x15')]?_0x2ca709[_0x2afc('0x15')][_0x2afc('0x16')]===undefined?!![]:![]:!![],'where':_0x2ca709[_0x2afc('0x15')]?_0x2ca709[_0x2afc('0x15')][_0x2afc('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['col']('id')),_0x2afc('0x1c')],[db[_0x2afc('0x1b')]['fn']('COUNT',db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x1e')))),'predictiveIntervalAnsweredCalls'],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x2afc('0x1f')],[db[_0x2afc('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x20')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x21'),db['sequelize']['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x22')))),_0x2afc('0x23')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x21'),db['sequelize']['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x24')))),'predictiveIntervalAvgTalktime']]})[_0x2afc('0x9')](function(_0x520385){logger[_0x2afc('0xa')](_0x2afc('0x18'),_0x2ca709);logger[_0x2afc('0xd')](_0x2afc('0x18'),_0x2ca709,JSON[_0x2afc('0x25')](_0x520385));_0x2a1cde(_0x520385);})[_0x2afc('0x26')](function(_0x33f145){logger['error'](_0x2afc('0x18'),_0x33f145[_0x2afc('0x10')],_0x2ca709);_0x300aba(_0x85b03e[_0x2afc('0xf')](0x1f4,_0x33f145[_0x2afc('0x10')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x321cbf){var _0x31abf1=this;return new Promise(function(_0x1e0edb,_0x1d0b44){return db[_0x2afc('0x12')][_0x2afc('0x27')]({'raw':_0x321cbf[_0x2afc('0x15')]?_0x321cbf[_0x2afc('0x15')][_0x2afc('0x16')]===undefined?!![]:![]:!![],'where':_0x321cbf[_0x2afc('0x15')]?_0x321cbf[_0x2afc('0x15')][_0x2afc('0x19')]||null:null,'attributes':[[_0x2afc('0x28'),_0x2afc('0x29')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db['sequelize'][_0x2afc('0x1d')](_0x2afc('0x2a')))),_0x2afc('0x2b')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db['sequelize']['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x2c')))),_0x2afc('0x2d')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x1e')))),_0x2afc('0x2e')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')]['literal'](_0x2afc('0x2f')))),_0x2afc('0x30')],[db[_0x2afc('0x1b')]['fn']('COUNT',db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x31')))),_0x2afc('0x32')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db['sequelize'][_0x2afc('0x1d')](_0x2afc('0x33')))),'outboundDropCallsDayTimeout'],[db[_0x2afc('0x1b')]['fn']('COUNT',db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')]['literal'](_0x2afc('0x34')))),'outboundDropCallsDayCallersExit'],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x35')))),_0x2afc('0x36')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x37')))),_0x2afc('0x38')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x3a')))),_0x2afc('0x3b')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')]['literal'](_0x2afc('0x3c')))),_0x2afc('0x3d')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['fn']('IF',db['sequelize'][_0x2afc('0x1d')](_0x2afc('0x3e')))),_0x2afc('0x3f')]],'group':[_0x2afc('0x28')]})['then'](function(_0x109edb){logger['info'](_0x2afc('0x40'),_0x321cbf);logger[_0x2afc('0xd')](_0x2afc('0x40'),_0x321cbf,JSON[_0x2afc('0x25')](_0x109edb));_0x1e0edb(_0x109edb);})[_0x2afc('0x26')](function(_0x36ae1c){logger['error'](_0x2afc('0x40'),_0x36ae1c['message'],_0x321cbf);_0x1d0b44(_0x31abf1[_0x2afc('0xf')](0x1f4,_0x36ae1c[_0x2afc('0x10')]));});});};exports[_0x2afc('0x41')]=function(_0x841d38){var _0x3a6038=this;return new Promise(function(_0x175017,_0x11a214){return db[_0x2afc('0x12')][_0x2afc('0x27')]({'raw':_0x841d38[_0x2afc('0x15')]?_0x841d38['options'][_0x2afc('0x16')]===undefined?!![]:![]:!![],'where':_0x841d38[_0x2afc('0x15')]?_0x841d38['options'][_0x2afc('0x19')]||null:null,'attributes':[[_0x2afc('0x28'),_0x2afc('0x29')],[db['sequelize']['fn'](_0x2afc('0x1a'),db[_0x2afc('0x1b')]['col']('id')),_0x2afc('0x42')],[db[_0x2afc('0x1b')]['fn'](_0x2afc('0x1a'),db['sequelize']['fn']('IF',db[_0x2afc('0x1b')][_0x2afc('0x1d')](_0x2afc('0x1e')))),_0x2afc('0x43')]],'group':[_0x2afc('0x28')]})[_0x2afc('0x9')](function(_0x7be444){logger[_0x2afc('0xa')](_0x2afc('0x41'),_0x841d38);logger[_0x2afc('0xd')](_0x2afc('0x41'),_0x841d38,JSON[_0x2afc('0x25')](_0x7be444));_0x175017(_0x7be444);})[_0x2afc('0x26')](function(_0x15381d){logger[_0x2afc('0xf')](_0x2afc('0x41'),_0x15381d[_0x2afc('0x10')],_0x841d38);_0x11a214(_0x3a6038[_0x2afc('0xf')](0x1f4,_0x15381d[_0x2afc('0x10')]));});});}; \ No newline at end of file +var _0xe27e=['CmHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','options','raw','CreateCmHopperHistory','stringify','findAll','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','AvgHandleTime','GetVoiceQueueHopperHistory'];(function(_0x3661b7,_0x3b31b6){var _0x3abaf0=function(_0x463a7a){while(--_0x463a7a){_0x3661b7['push'](_0x3661b7['shift']());}};_0x3abaf0(++_0x3b31b6);}(_0xe27e,0xa8));var _0xee27=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xe27e[_0x86b219];return _0x1f320c;};'use strict';var _=require(_0xee27('0x0'));var util=require('util');var moment=require(_0xee27('0x1'));var BPromise=require(_0xee27('0x2'));var rs=require(_0xee27('0x3'));var fs=require('fs');var Redis=require(_0xee27('0x4'));var db=require(_0xee27('0x5'))['db'];var utils=require(_0xee27('0x6'));var logger=require(_0xee27('0x7'))(_0xee27('0x8'));var config=require('../../config/environment');var jayson=require(_0xee27('0x9'));var client=jayson[_0xee27('0xa')][_0xee27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x199a2e,_0x4d16d6,_0x4df68b){return new BPromise(function(_0x5b97db,_0x472274){return client['request'](_0x199a2e,_0x4df68b)['then'](function(_0x4f0174){logger[_0xee27('0xc')](_0xee27('0xd'),_0x4d16d6,_0xee27('0xe'));logger[_0xee27('0xf')](_0xee27('0x10'),_0x4d16d6,_0xee27('0xe'),JSON['stringify'](_0x4f0174));if(_0x4f0174[_0xee27('0x11')]){if(_0x4f0174['error'][_0xee27('0x12')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4d16d6,_0x4f0174[_0xee27('0x11')][_0xee27('0x13')]);return _0x472274(_0x4f0174[_0xee27('0x11')][_0xee27('0x13')]);}logger[_0xee27('0x11')](_0xee27('0xd'),_0x4d16d6,_0x4f0174[_0xee27('0x11')]['message']);return _0x5b97db(_0x4f0174[_0xee27('0x11')][_0xee27('0x13')]);}else{logger[_0xee27('0xc')](_0xee27('0xd'),_0x4d16d6,_0xee27('0xe'));_0x5b97db(_0x4f0174[_0xee27('0x14')][_0xee27('0x13')]);}})[_0xee27('0x15')](function(_0x218725){logger[_0xee27('0x11')](_0xee27('0xd'),_0x4d16d6,_0x218725);_0x472274(_0x218725);});});}exports['CreateCmHopperHistory']=function(_0x4e1e6a){var _0x509358=this;return new Promise(function(_0x128b6d,_0x19cba3){return db['CmHopperHistory'][_0xee27('0x16')](_0x4e1e6a['body'],{'raw':_0x4e1e6a['options']?_0x4e1e6a[_0xee27('0x17')][_0xee27('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1e2127){logger[_0xee27('0xc')](_0xee27('0x19'),_0x4e1e6a);logger['debug'](_0xee27('0x19'),_0x4e1e6a,JSON[_0xee27('0x1a')](_0x1e2127));_0x128b6d(_0x1e2127);})['catch'](function(_0x378d08){logger[_0xee27('0x11')](_0xee27('0x19'),_0x378d08[_0xee27('0x13')],_0x4e1e6a);_0x19cba3(_0x509358[_0xee27('0x11')](0x1f4,_0x378d08[_0xee27('0x13')]));});});};exports['AvgHandleTime']=function(_0x4ff593){var _0x33eab5=this;return new Promise(function(_0x131bef,_0x4210c8){return db['CmHopperHistory'][_0xee27('0x1b')]({'raw':_0x4ff593[_0xee27('0x17')]?_0x4ff593[_0xee27('0x17')][_0xee27('0x18')]===undefined?!![]:![]:!![],'where':_0x4ff593[_0xee27('0x17')]?_0x4ff593['options']['where']||null:null,'attributes':[[db[_0xee27('0x1c')]['fn']('COUNT',db['sequelize'][_0xee27('0x1d')]('id')),_0xee27('0x1e')],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x21')))),'predictiveIntervalAnsweredCalls'],[db[_0xee27('0x1c')]['fn']('COUNT',db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')]['literal'](_0xee27('0x22')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')]['literal'](_0xee27('0x23')))),_0xee27('0x24')],[db[_0xee27('0x1c')]['fn'](_0xee27('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0xee27('0x20')](_0xee27('0x26')))),_0xee27('0x27')],[db[_0xee27('0x1c')]['fn'](_0xee27('0x25'),db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x28')))),_0xee27('0x29')]]})[_0xee27('0x2a')](function(_0x52897f){logger[_0xee27('0xc')]('AvgHandleTime',_0x4ff593);logger[_0xee27('0xf')](_0xee27('0x2b'),_0x4ff593,JSON[_0xee27('0x1a')](_0x52897f));_0x131bef(_0x52897f);})[_0xee27('0x15')](function(_0x4dc8c0){logger[_0xee27('0x11')](_0xee27('0x2b'),_0x4dc8c0[_0xee27('0x13')],_0x4ff593);_0x4210c8(_0x33eab5['error'](0x1f4,_0x4dc8c0[_0xee27('0x13')]));});});};exports[_0xee27('0x2c')]=function(_0x5bd67b){var _0xbd956c=this;return new Promise(function(_0x516d69,_0x431788){return db[_0xee27('0x2d')]['findAll']({'raw':_0x5bd67b[_0xee27('0x17')]?_0x5bd67b[_0xee27('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5bd67b[_0xee27('0x17')]?_0x5bd67b[_0xee27('0x17')]['where']||null:null,'attributes':[[_0xee27('0x2e'),_0xee27('0x2f')],[db['sequelize']['fn']('COUNT',db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x30')))),'outboundNoSuchCallsDay'],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db['sequelize'][_0xee27('0x20')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db['sequelize']['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x21')))),_0xee27('0x31')],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xee27('0x32')))),_0xee27('0x33')],[db['sequelize']['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x34')))),'outboundCongestionCallsDay'],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x35')))),_0xee27('0x36')],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db['sequelize']['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x37')))),_0xee27('0x38')],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xee27('0x39')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xee27('0x3a')))),_0xee27('0x3b')],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x3c')))),_0xee27('0x3d')],[db[_0xee27('0x1c')]['fn']('COUNT',db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x3e')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xee27('0x1c')]['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x3f')))),_0xee27('0x40')],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db['sequelize']['fn']('IF',db[_0xee27('0x1c')][_0xee27('0x20')](_0xee27('0x41')))),'outboundRejectCallsDay'],[db[_0xee27('0x1c')]['fn']('COUNT',db[_0xee27('0x1c')]['fn']('IF',db['sequelize'][_0xee27('0x20')](_0xee27('0x42')))),_0xee27('0x43')]],'group':['campaign']})[_0xee27('0x2a')](function(_0x20be0d){logger['info'](_0xee27('0x2c'),_0x5bd67b);logger[_0xee27('0xf')](_0xee27('0x2c'),_0x5bd67b,JSON[_0xee27('0x1a')](_0x20be0d));_0x516d69(_0x20be0d);})[_0xee27('0x15')](function(_0x3db55c){logger[_0xee27('0x11')](_0xee27('0x2c'),_0x3db55c['message'],_0x5bd67b);_0x431788(_0xbd956c[_0xee27('0x11')](0x1f4,_0x3db55c[_0xee27('0x13')]));});});};exports[_0xee27('0x44')]=function(_0x163479){var _0x25ddae=this;return new Promise(function(_0xf56109,_0x4483db){return db[_0xee27('0x2d')][_0xee27('0x1b')]({'raw':_0x163479[_0xee27('0x17')]?_0x163479[_0xee27('0x17')][_0xee27('0x18')]===undefined?!![]:![]:!![],'where':_0x163479[_0xee27('0x17')]?_0x163479[_0xee27('0x17')][_0xee27('0x45')]||null:null,'attributes':[['campaign','name'],[db[_0xee27('0x1c')]['fn'](_0xee27('0x1f'),db[_0xee27('0x1c')]['col']('id')),'ivrTotalCallsDays'],[db[_0xee27('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xee27('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xee27('0x46')]],'group':[_0xee27('0x2e')]})[_0xee27('0x2a')](function(_0x9f8c0d){logger[_0xee27('0xc')]('GetCampaignHopperHistory',_0x163479);logger['debug'](_0xee27('0x44'),_0x163479,JSON[_0xee27('0x1a')](_0x9f8c0d));_0xf56109(_0x9f8c0d);})[_0xee27('0x15')](function(_0x1c8cc4){logger['error'](_0xee27('0x44'),_0x1c8cc4[_0xee27('0x13')],_0x163479);_0x4483db(_0x25ddae[_0xee27('0x11')](0x1f4,_0x1c8cc4[_0xee27('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index c60dd29..8c683ef 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 _0xa647=['put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa647,0x81));var _0x7a64=function(_0x1e0043,_0x27e7dc){_0x1e0043=_0x1e0043-0x0;var _0x3bf284=_0xa647[_0x1e0043];return _0x3bf284;};'use strict';var multer=require(_0x7a64('0x0'));var util=require(_0x7a64('0x1'));var path=require(_0x7a64('0x2'));var timeout=require(_0x7a64('0x3'));var express=require(_0x7a64('0x4'));var router=express[_0x7a64('0x5')]();var auth=require(_0x7a64('0x6'));var interaction=require(_0x7a64('0x7'));var config=require(_0x7a64('0x8'));var controller=require(_0x7a64('0x9'));router[_0x7a64('0xa')]('/',auth[_0x7a64('0xb')](),controller['index']);router[_0x7a64('0xa')](_0x7a64('0xc'),auth['isAuthenticated'](),controller[_0x7a64('0xd')]);router[_0x7a64('0xa')](_0x7a64('0xe'),auth[_0x7a64('0xb')](),controller[_0x7a64('0xf')]);router[_0x7a64('0x10')]('/',auth[_0x7a64('0xb')](),controller[_0x7a64('0x11')]);router[_0x7a64('0x12')](_0x7a64('0xe'),auth[_0x7a64('0xb')](),controller[_0x7a64('0x13')]);module[_0x7a64('0x14')]=router; \ No newline at end of file +var _0x6208=['index','describe','/:id','show','post','create','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated'];(function(_0x52b9fd,_0x11075b){var _0x20288e=function(_0x80f57f){while(--_0x80f57f){_0x52b9fd['push'](_0x52b9fd['shift']());}};_0x20288e(++_0x11075b);}(_0x6208,0x17d));var _0x8620=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x6208[_0x3b19ea];return _0x40ece9;};'use strict';var multer=require(_0x8620('0x0'));var util=require('util');var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require('express');var router=express[_0x8620('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8620('0x4'));var config=require(_0x8620('0x5'));var controller=require(_0x8620('0x6'));router[_0x8620('0x7')]('/',auth[_0x8620('0x8')](),controller[_0x8620('0x9')]);router[_0x8620('0x7')]('/describe',auth[_0x8620('0x8')](),controller[_0x8620('0xa')]);router[_0x8620('0x7')](_0x8620('0xb'),auth[_0x8620('0x8')](),controller[_0x8620('0xc')]);router[_0x8620('0xd')]('/',auth[_0x8620('0x8')](),controller[_0x8620('0xe')]);router['put'](_0x8620('0xb'),auth[_0x8620('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index f002994..ebc2e4d 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 _0x6aa7=['name','sequelize','STRING'];(function(_0x296bed,_0x3ff4e5){var _0x13e2f1=function(_0x3b007e){while(--_0x3b007e){_0x296bed['push'](_0x296bed['shift']());}};_0x13e2f1(++_0x3ff4e5);}(_0x6aa7,0x178));var _0x76aa=function(_0x3c1527,_0x5e69e0){_0x3c1527=_0x3c1527-0x0;var _0x3d852b=_0x6aa7[_0x3c1527];return _0x3d852b;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'unique':_0x76aa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x76aa('0x1')]},'dialPrefix':{'type':Sequelize[_0x76aa('0x1')]}}; \ No newline at end of file +var _0x814b=['STRING','name','sequelize','exports'];(function(_0x5c9327,_0x3d60af){var _0x50e482=function(_0x5e4b4a){while(--_0x5e4b4a){_0x5c9327['push'](_0x5c9327['shift']());}};_0x50e482(++_0x3d60af);}(_0x814b,0x1a2));var _0xb814=function(_0x243bba,_0x1ea69f){_0x243bba=_0x243bba-0x0;var _0x12e696=_0x814b[_0x243bba];return _0x12e696;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'unique':_0xb814('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb814('0x2')]},'dialPrefix':{'type':Sequelize[_0xb814('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 25371e1..4c3d47e 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 _0x5a22=['getCustomFields','findOne','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','UserProfileResource','destroy','end','name','CmList','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','order','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','format','cf_%d','nolimit','raw','getContactsCsv','CustomFields','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s'];(function(_0x28ff30,_0x342f9c){var _0x453c8b=function(_0x40e323){while(--_0x40e323){_0x28ff30['push'](_0x28ff30['shift']());}};_0x453c8b(++_0x342f9c);}(_0x5a22,0x9b));var _0x25a2=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0x5a22[_0x5cfb92];return _0x1cd7c2;};'use strict';var pdf=require(_0x25a2('0x0'));var emlformat=require(_0x25a2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x25a2('0x2'));var jsonpatch=require(_0x25a2('0x3'));var rp=require('request-promise');var moment=require(_0x25a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x25a2('0x5'));var util=require(_0x25a2('0x6'));var path=require(_0x25a2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x25a2('0x8'));var squel=require(_0x25a2('0x9'));var crypto=require('crypto');var jsforce=require(_0x25a2('0xa'));var deskjs=require(_0x25a2('0xb'));var toCsv=require(_0x25a2('0xc'));var querystring=require(_0x25a2('0xd'));var Papa=require(_0x25a2('0xe'));var authService=require(_0x25a2('0xf'));var hardwareService=require(_0x25a2('0x10'));var Redis=require(_0x25a2('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x25a2('0x12'));var utils=require(_0x25a2('0x13'));var config=require(_0x25a2('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x25a2('0x15')](config[_0x25a2('0x16')],{'host':_0x25a2('0x17'),'port':0x18eb});var socket=require(_0x25a2('0x18'))(new Redis(config[_0x25a2('0x16')]));require(_0x25a2('0x19'))['register'](socket);function respondWithStatusCode(_0x99425e,_0x1fac68){_0x1fac68=_0x1fac68||0xcc;return function(_0x3b5d99){if(_0x3b5d99){return _0x99425e[_0x25a2('0x1a')](_0x1fac68);}return _0x99425e[_0x25a2('0x1b')](_0x1fac68)['end']();};}function respondWithResult(_0x5a49a5,_0x4ed926){_0x4ed926=_0x4ed926||0xc8;return function(_0x19c45b){if(_0x19c45b){return _0x5a49a5['status'](_0x4ed926)[_0x25a2('0x1c')](_0x19c45b);}};}function respondWithFilteredResult(_0x27119c,_0x452bc5){return function(_0x2bdf00){if(_0x2bdf00){var _0x2bf333=_0x2bdf00[_0x25a2('0x1d')],_0xa82b24=_0x452bc5['offset'],_0x547d50=_0x452bc5[_0x25a2('0x1e')]+_0x452bc5[_0x25a2('0x1f')],_0x22ff52;if(_0x547d50>=_0x2bf333){_0x547d50=_0x2bf333;_0x22ff52=0xc8;}else{_0x22ff52=0xce;}_0x27119c[_0x25a2('0x1b')](_0x22ff52);return _0x27119c[_0x25a2('0x20')](_0x25a2('0x21'),_0xa82b24+'-'+_0x547d50+'/'+_0x2bf333)['json'](_0x2bdf00);}return null;};}function patchUpdates(_0x398820){return function(_0xc7e165){try{jsonpatch['apply'](_0xc7e165,_0x398820,!![]);}catch(_0x121453){return BPromise[_0x25a2('0x22')](_0x121453);}return _0xc7e165['save']();};}function saveUpdates(_0x5377d9,_0x17db29){return function(_0x394a4c){if(_0x394a4c){return _0x394a4c[_0x25a2('0x23')](_0x5377d9)['then'](function(_0x48e88b){return _0x48e88b;});}return null;};}function removeEntity(_0x3701a2,_0x127d61){return function(_0x11fb2a){if(_0x11fb2a){return _0x11fb2a['destroy']()[_0x25a2('0x24')](function(){var _0x565767=_0x11fb2a['get']({'plain':!![]});var _0xde0fd7='Lists';return db[_0x25a2('0x25')][_0x25a2('0x26')]({'where':{'type':_0xde0fd7,'resourceId':_0x565767['id']}})[_0x25a2('0x24')](function(){return _0x11fb2a;});})[_0x25a2('0x24')](function(){_0x3701a2[_0x25a2('0x1b')](0xcc)[_0x25a2('0x27')]();});}};}function handleEntityNotFound(_0xc29f34,_0x1984e3){return function(_0x5ca60a){if(!_0x5ca60a){_0xc29f34[_0x25a2('0x1a')](0x194);}return _0x5ca60a;};}function handleError(_0x1ec3cf,_0x3a078f){_0x3a078f=_0x3a078f||0x1f4;return function(_0x41eefa){logger['error'](_0x41eefa['stack']);if(_0x41eefa[_0x25a2('0x28')]){delete _0x41eefa[_0x25a2('0x28')];}_0x1ec3cf[_0x25a2('0x1b')](_0x3a078f)['send'](_0x41eefa);};}exports['index']=function(_0x2ca6b5,_0x50dda1){var _0x5a0d9e={},_0x5e0438={},_0x275c27={'count':0x0,'rows':[]};var _0xa63146=db[_0x25a2('0x29')]['rawAttributes'];_0x5e0438[_0x25a2('0x2a')]=_[_0x25a2('0x2b')](_0xa63146);_0x5e0438[_0x25a2('0x2c')]=_[_0x25a2('0x2b')](_0x2ca6b5[_0x25a2('0x2c')]);_0x5e0438['filters']=_['intersection'](_0x5e0438[_0x25a2('0x2a')],_0x5e0438[_0x25a2('0x2c')]);_0x5a0d9e[_0x25a2('0x2d')]=_[_0x25a2('0x2e')](_0x5e0438[_0x25a2('0x2a')],qs[_0x25a2('0x2f')](_0x2ca6b5[_0x25a2('0x2c')]['fields']));_0x5a0d9e['attributes']=_0x5a0d9e[_0x25a2('0x2d')][_0x25a2('0x30')]?_0x5a0d9e[_0x25a2('0x2d')]:_0x5e0438['model'];if(!_0x2ca6b5[_0x25a2('0x2c')][_0x25a2('0x31')]('nolimit')){_0x5a0d9e['limit']=qs[_0x25a2('0x1f')](_0x2ca6b5[_0x25a2('0x2c')][_0x25a2('0x1f')]);_0x5a0d9e['offset']=qs['offset'](_0x2ca6b5[_0x25a2('0x2c')][_0x25a2('0x1e')]);}_0x5a0d9e['order']=qs[_0x25a2('0x32')](_0x2ca6b5[_0x25a2('0x2c')][_0x25a2('0x32')]);_0x5a0d9e[_0x25a2('0x33')]=qs[_0x25a2('0x34')](_[_0x25a2('0x35')](_0x2ca6b5[_0x25a2('0x2c')],_0x5e0438[_0x25a2('0x34')]));if(_0x2ca6b5['query']['filter']){_0x5a0d9e['where']=_[_0x25a2('0x36')](_0x5a0d9e['where'],{'$or':_[_0x25a2('0x37')](_0xa63146,function(_0x2eb876){if(_0x2eb876[_0x25a2('0x38')][_0x25a2('0x39')]!==_0x25a2('0x3a')){var _0x34e63d={};_0x34e63d[_0x2eb876[_0x25a2('0x3b')]]={'$like':'%'+_0x2ca6b5[_0x25a2('0x2c')][_0x25a2('0x3c')]+'%'};return _0x34e63d;}})});}_0x5a0d9e=_[_0x25a2('0x36')]({},_0x5a0d9e,_0x2ca6b5[_0x25a2('0x3d')]);var _0x44414a={'where':_0x5a0d9e[_0x25a2('0x33')]};return db[_0x25a2('0x29')][_0x25a2('0x1d')](_0x44414a)[_0x25a2('0x24')](function(_0x4a6874){_0x275c27[_0x25a2('0x1d')]=_0x4a6874;if(_0x2ca6b5[_0x25a2('0x2c')][_0x25a2('0x3e')]){_0x5a0d9e[_0x25a2('0x3f')]=[{'all':!![]}];}return db['CmList'][_0x25a2('0x40')](_0x5a0d9e);})[_0x25a2('0x24')](function(_0xef2182){_0x275c27[_0x25a2('0x41')]=_0xef2182;return _0x275c27;})[_0x25a2('0x24')](respondWithFilteredResult(_0x50dda1,_0x5a0d9e))[_0x25a2('0x42')](handleError(_0x50dda1,null));};exports[_0x25a2('0x43')]=function(_0x6e10a,_0x135727){var _0x44f215={'raw':![],'where':{'id':_0x6e10a[_0x25a2('0x44')]['id']}},_0x308650={};_0x308650[_0x25a2('0x2a')]=_[_0x25a2('0x2b')](db[_0x25a2('0x29')][_0x25a2('0x45')]);_0x308650[_0x25a2('0x2c')]=_[_0x25a2('0x2b')](_0x6e10a[_0x25a2('0x2c')]);_0x308650['filters']=_['intersection'](_0x308650[_0x25a2('0x2a')],_0x308650[_0x25a2('0x2c')]);_0x44f215[_0x25a2('0x2d')]=_[_0x25a2('0x2e')](_0x308650[_0x25a2('0x2a')],qs[_0x25a2('0x2f')](_0x6e10a[_0x25a2('0x2c')][_0x25a2('0x2f')]));_0x44f215['attributes']=_0x44f215[_0x25a2('0x2d')][_0x25a2('0x30')]?_0x44f215['attributes']:_0x308650[_0x25a2('0x2a')];if(_0x6e10a[_0x25a2('0x2c')][_0x25a2('0x3e')]){_0x44f215[_0x25a2('0x3f')]=[{'all':!![]}];}_0x44f215=_['merge']({},_0x44f215,_0x6e10a['options']);return db[_0x25a2('0x29')][_0x25a2('0x46')](_0x44f215)['then'](handleEntityNotFound(_0x135727,null))[_0x25a2('0x24')](respondWithResult(_0x135727,null))[_0x25a2('0x42')](handleError(_0x135727,null));};exports[_0x25a2('0x47')]=function(_0x432231,_0x4e125a){return db[_0x25a2('0x29')][_0x25a2('0x47')](_0x432231[_0x25a2('0x48')],{})[_0x25a2('0x24')](function(_0x4c2145){var _0x4c8c76=_0x432231[_0x25a2('0x49')][_0x25a2('0x4a')]({'plain':!![]});if(!_0x4c8c76)throw new Error(_0x25a2('0x4b'));if(_0x4c8c76[_0x25a2('0x4c')]===_0x25a2('0x49')){var _0x41278b=_0x4c2145[_0x25a2('0x4a')]({'plain':!![]});var _0x290e59=_0x25a2('0x4d');return db[_0x25a2('0x4e')][_0x25a2('0x46')]({'where':{'name':_0x290e59,'userProfileId':_0x4c8c76['userProfileId']},'raw':!![]})[_0x25a2('0x24')](function(_0x2e22da){if(_0x2e22da&&_0x2e22da['autoAssociation']===0x0){return db[_0x25a2('0x25')][_0x25a2('0x47')]({'name':_0x41278b['name'],'resourceId':_0x41278b['id'],'type':_0x2e22da['name'],'sectionId':_0x2e22da['id']},{})[_0x25a2('0x24')](function(){return _0x4c2145;});}else{return _0x4c2145;}})[_0x25a2('0x42')](function(_0x9acdb2){logger['error'](_0x25a2('0x4f'),_0x9acdb2);throw _0x9acdb2;});}return _0x4c2145;})[_0x25a2('0x24')](respondWithResult(_0x4e125a,0xc9))[_0x25a2('0x42')](handleError(_0x4e125a,null));};exports[_0x25a2('0x23')]=function(_0x2f777,_0x462264){if(_0x2f777[_0x25a2('0x48')]['id']){delete _0x2f777[_0x25a2('0x48')]['id'];}return db[_0x25a2('0x29')][_0x25a2('0x46')]({'where':{'id':_0x2f777['params']['id']}})[_0x25a2('0x24')](handleEntityNotFound(_0x462264,null))[_0x25a2('0x24')](saveUpdates(_0x2f777[_0x25a2('0x48')],null))[_0x25a2('0x24')](respondWithResult(_0x462264,null))[_0x25a2('0x42')](handleError(_0x462264,null));};exports[_0x25a2('0x26')]=function(_0x288869,_0x3d4a44){return db[_0x25a2('0x29')][_0x25a2('0x46')]({'where':{'id':_0x288869[_0x25a2('0x44')]['id']}})[_0x25a2('0x24')](handleEntityNotFound(_0x3d4a44,null))[_0x25a2('0x24')](removeEntity(_0x3d4a44,null))[_0x25a2('0x42')](handleError(_0x3d4a44,null));};exports['describe']=function(_0x46e670,_0x18f48e){return db['CmList'][_0x25a2('0x50')]()[_0x25a2('0x24')](respondWithResult(_0x18f48e,null))[_0x25a2('0x42')](handleError(_0x18f48e,null));};exports[_0x25a2('0x51')]=function(_0x411d69,_0x16827a,_0x57cf84){if(_0x411d69[_0x25a2('0x48')]['id']){delete _0x411d69[_0x25a2('0x48')]['id'];}return db[_0x25a2('0x29')]['find']({'where':{'id':_0x411d69['params']['id']}})[_0x25a2('0x24')](handleEntityNotFound(_0x16827a,null))[_0x25a2('0x24')](function(_0x14ef7f){if(_0x14ef7f){_0x411d69[_0x25a2('0x48')][_0x25a2('0x52')]=_0x14ef7f['id'];return db[_0x25a2('0x53')][_0x25a2('0x47')](_0x411d69['body']);}})[_0x25a2('0x24')](respondWithResult(_0x16827a,null))['catch'](handleError(_0x16827a,null));};exports[_0x25a2('0x54')]=function(_0xe10798,_0x13021e,_0x2f52ea){var _0x984146={'raw':![],'where':{}};var _0x3ef537={};var _0x3967b8={'count':0x0,'rows':[]};return db[_0x25a2('0x29')]['findOne']({'where':{'id':_0xe10798[_0x25a2('0x44')]['id']}})[_0x25a2('0x24')](handleEntityNotFound(_0x13021e,null))[_0x25a2('0x24')](function(_0x1cd2c1){if(_0x1cd2c1){_0x3ef537['model']=_[_0x25a2('0x2b')](db[_0x25a2('0x53')]['rawAttributes']);_0x3ef537['query']=_[_0x25a2('0x2b')](_0xe10798['query']);_0x3ef537[_0x25a2('0x34')]=_['intersection'](_0x3ef537[_0x25a2('0x2a')],_0x3ef537[_0x25a2('0x2c')]);_0x984146[_0x25a2('0x2d')]=_[_0x25a2('0x2e')](_0x3ef537[_0x25a2('0x2a')],qs[_0x25a2('0x2f')](_0xe10798[_0x25a2('0x2c')]['fields']));_0x984146[_0x25a2('0x2d')]=_0x984146[_0x25a2('0x2d')][_0x25a2('0x30')]?_0x984146[_0x25a2('0x2d')]:_0x3ef537['model'];if(!_0xe10798[_0x25a2('0x2c')][_0x25a2('0x31')]('nolimit')){_0x984146[_0x25a2('0x1f')]=qs[_0x25a2('0x1f')](_0xe10798[_0x25a2('0x2c')][_0x25a2('0x1f')]);_0x984146[_0x25a2('0x1e')]=qs['offset'](_0xe10798['query'][_0x25a2('0x1e')]);}_0x984146[_0x25a2('0x55')]=qs[_0x25a2('0x32')](_0xe10798[_0x25a2('0x2c')][_0x25a2('0x32')]);_0x984146[_0x25a2('0x33')]=qs[_0x25a2('0x34')](_[_0x25a2('0x35')](_0xe10798[_0x25a2('0x2c')],_0x3ef537['filters']));_0x984146['where'][_0x25a2('0x52')]=_0x1cd2c1['id'];if(_0xe10798[_0x25a2('0x2c')][_0x25a2('0x3c')]){_0x984146['where']=_['merge'](_0x984146[_0x25a2('0x33')],{'$or':_[_0x25a2('0x37')](_0x984146[_0x25a2('0x2d')],function(_0x5dd4bb){var _0x547c62={};_0x547c62[_0x5dd4bb]={'$like':'%'+_0xe10798[_0x25a2('0x2c')][_0x25a2('0x3c')]+'%'};return _0x547c62;})});}_0x984146=_[_0x25a2('0x36')]({},_0x984146,_0xe10798[_0x25a2('0x3d')]);return db[_0x25a2('0x53')]['count']({'where':_0x984146[_0x25a2('0x33')]})[_0x25a2('0x24')](function(_0x2055d4){_0x3967b8['count']=_0x2055d4;if(_0xe10798[_0x25a2('0x2c')][_0x25a2('0x3e')]){_0x984146[_0x25a2('0x3f')]=[{'all':!![]}];}return db[_0x25a2('0x53')][_0x25a2('0x40')](_0x984146);})[_0x25a2('0x24')](function(_0x5c3534){_0x3967b8[_0x25a2('0x41')]=_0x5c3534;return _0x3967b8;});}})[_0x25a2('0x24')](respondWithFilteredResult(_0x13021e,_0x984146))['catch'](handleError(_0x13021e,null));};exports[_0x25a2('0x56')]=function(_0x4931ec,_0x224090,_0x2fd708){var _0x254624;return db['CmList'][_0x25a2('0x46')]({'where':{'id':_0x4931ec[_0x25a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x224090,null))[_0x25a2('0x24')](function(_0x5c8631){if(_0x5c8631){return _0x5c8631['removeDispositions'](_0x4931ec['query'][_0x25a2('0x57')]);}})[_0x25a2('0x24')](respondWithStatusCode(_0x224090,null))[_0x25a2('0x42')](handleError(_0x224090,null));};exports[_0x25a2('0x58')]=function(_0x1385d0,_0x4b6b5,_0xb96a4f){return db[_0x25a2('0x29')][_0x25a2('0x46')]({'where':{'id':_0x1385d0['params']['id']}})[_0x25a2('0x24')](handleEntityNotFound(_0x4b6b5,null))[_0x25a2('0x24')](function(_0x258a83){if(_0x258a83){var _0x1e1c41=[];var _0x2c02c2={'success':[],'errors':[]};return db[_0x25a2('0x59')]['describe']()[_0x25a2('0x24')](function(_0x413217){if(_0x1385d0[_0x25a2('0x48')]['tags']&&_[_0x25a2('0x5a')](_0x1385d0[_0x25a2('0x48')]['tags'])){if(_0x1385d0[_0x25a2('0x48')]['tags'][_0x25a2('0x30')]){_0x1385d0['body'][_0x25a2('0x5b')]=_0x1385d0[_0x25a2('0x48')][_0x25a2('0x5b')][_0x25a2('0x5c')](';')+';';}else{_0x1385d0[_0x25a2('0x48')][_0x25a2('0x5b')]=null;}}else{_0x1385d0[_0x25a2('0x48')][_0x25a2('0x5b')]=null;}if(_0x1385d0['body']&&_[_0x25a2('0x5a')](_0x1385d0[_0x25a2('0x48')])){for(var _0x6ba7e3=0x0;_0x6ba7e3<_0x1385d0[_0x25a2('0x48')]['length'];_0x6ba7e3+=0x1){_0x1385d0[_0x25a2('0x48')][_0x6ba7e3][_0x25a2('0x52')]=_0x1385d0[_0x25a2('0x44')]['id'];_0x1e1c41[_0x25a2('0x5d')](_0x1385d0['body'][_0x6ba7e3]);}return BPromise['each'](_0x1e1c41,function(_0x5e4722){return db[_0x25a2('0x59')][_0x25a2('0x47')](_['omit'](_0x5e4722,[_0x25a2('0x57'),'id'])||{},{'fields':_[_0x25a2('0x2b')](_0x413217),'raw':!![]})[_0x25a2('0x24')](function(_0x3be624){_0x2c02c2[_0x25a2('0x5e')][_0x25a2('0x5d')](_0x3be624[_0x25a2('0x5f')]);})[_0x25a2('0x42')](function(_0x21ee22){_0x2c02c2[_0x25a2('0x60')][_0x25a2('0x5d')]({'data':_0x5e4722,'error':_0x21ee22[_0x25a2('0x61')]});});})[_0x25a2('0x24')](function(_0x12a152){return _0x2c02c2;})[_0x25a2('0x42')](function(_0x4203b2){return _0x4203b2;});}else{_0x4b6b5['status'](0x190)[_0x25a2('0x1c')]({'message':_0x25a2('0x62')});}});}})[_0x25a2('0x24')](respondWithResult(_0x4b6b5,null))[_0x25a2('0x42')](handleError(_0x4b6b5,null));};exports[_0x25a2('0x63')]=function(_0x37d69e,_0x266bdd,_0x3ea035){var _0x3accb0;return db[_0x25a2('0x29')][_0x25a2('0x46')]({'where':{'id':_0x37d69e['params']['id']},'include':[{'model':db[_0x25a2('0x64')],'as':'CustomFields'}]})[_0x25a2('0x24')](handleEntityNotFound(_0x266bdd,null))[_0x25a2('0x24')](function(_0xcac4d4){if(_0xcac4d4){_0x3accb0=_0xcac4d4;return db[_0x25a2('0x59')][_0x25a2('0x45')];}})[_0x25a2('0x24')](function(_0x5a9973){if(_0x5a9973){var _0x1c4fb6={};var _0x1b7baa={};_0x1b7baa[_0x25a2('0x2a')]=_[_0x25a2('0x65')](_[_0x25a2('0x2b')](_0x5a9973),_['map'](_0x3accb0['CustomFields'],function(_0x1dcc1b){return util[_0x25a2('0x66')](_0x25a2('0x67'),_0x1dcc1b['id']);}));_0x1b7baa[_0x25a2('0x2c')]=_[_0x25a2('0x2b')](_0x37d69e[_0x25a2('0x2c')]);_0x1b7baa[_0x25a2('0x34')]=_['intersection'](_0x1b7baa['model'],_0x1b7baa[_0x25a2('0x2c')]);_0x1c4fb6['attributes']=_[_0x25a2('0x2e')](_0x1b7baa[_0x25a2('0x2a')],qs[_0x25a2('0x2f')](_0x37d69e[_0x25a2('0x2c')][_0x25a2('0x2f')]));_0x1c4fb6[_0x25a2('0x2d')]=_0x1c4fb6['attributes'][_0x25a2('0x30')]?_0x1c4fb6[_0x25a2('0x2d')]:_0x1b7baa[_0x25a2('0x2a')];if(!_0x37d69e['query'][_0x25a2('0x31')](_0x25a2('0x68'))){_0x1c4fb6[_0x25a2('0x1f')]=qs[_0x25a2('0x1f')](_0x37d69e[_0x25a2('0x2c')][_0x25a2('0x1f')]);_0x1c4fb6['offset']=qs[_0x25a2('0x1e')](_0x37d69e[_0x25a2('0x2c')][_0x25a2('0x1e')]);}_0x1c4fb6['order']=qs['sort'](_0x37d69e[_0x25a2('0x2c')]['sort']);_0x1c4fb6[_0x25a2('0x33')]=qs[_0x25a2('0x34')](_[_0x25a2('0x35')](_0x37d69e[_0x25a2('0x2c')],_0x1b7baa[_0x25a2('0x34')]));_0x1c4fb6[_0x25a2('0x69')]=!![];if(_0x37d69e['query'][_0x25a2('0x3c')]){_0x1c4fb6[_0x25a2('0x33')]=_[_0x25a2('0x36')](_0x1c4fb6['where'],{'$or':_['map'](_0x1c4fb6['attributes'],function(_0x41b2a0){var _0x13ac9e={};_0x13ac9e[_0x41b2a0]={'$like':'%'+_0x37d69e[_0x25a2('0x2c')][_0x25a2('0x3c')]+'%'};return _0x13ac9e;})});}_0x1c4fb6=_['merge']({},_0x1c4fb6,_0x37d69e['options']);return _0x3accb0['getContacts'](_0x1c4fb6);}})[_0x25a2('0x24')](respondWithResult(_0x266bdd,null))['catch'](handleError(_0x266bdd,null));};exports[_0x25a2('0x6a')]=function(_0x29b346,_0x27c589,_0x3954a6){var _0x454325;return db['CmList'][_0x25a2('0x46')]({'where':{'id':_0x29b346[_0x25a2('0x44')]['id']},'include':[{'model':db[_0x25a2('0x64')],'as':'CustomFields'}]})[_0x25a2('0x24')](handleEntityNotFound(_0x27c589,null))[_0x25a2('0x24')](function(_0x2d7803){if(_0x2d7803){_0x454325=_0x2d7803;return db[_0x25a2('0x59')][_0x25a2('0x45')];}})[_0x25a2('0x24')](function(_0x2c6e17){if(_0x2c6e17){var _0x127443={};var _0x11e78b={};_0x11e78b['model']=_[_0x25a2('0x65')](_['keys'](_0x2c6e17),_['map'](_0x454325[_0x25a2('0x6b')],function(_0x11cbbd){return util[_0x25a2('0x66')](_0x25a2('0x67'),_0x11cbbd['id']);}));_0x11e78b[_0x25a2('0x2c')]=_['keys'](_0x29b346[_0x25a2('0x2c')]);_0x11e78b['filters']=_['intersection'](_0x11e78b[_0x25a2('0x2a')],_0x11e78b[_0x25a2('0x2c')]);_0x127443['attributes']=_[_0x25a2('0x2e')](_0x11e78b['model'],qs['fields'](_0x29b346[_0x25a2('0x2c')]['fields']));_0x127443[_0x25a2('0x2d')]=_0x127443[_0x25a2('0x2d')][_0x25a2('0x30')]?_0x127443['attributes']:_0x11e78b['model'];if(!_0x29b346[_0x25a2('0x2c')][_0x25a2('0x31')](_0x25a2('0x68'))){_0x127443[_0x25a2('0x1f')]=qs[_0x25a2('0x1f')](_0x29b346[_0x25a2('0x2c')][_0x25a2('0x1f')]);_0x127443[_0x25a2('0x1e')]=qs['offset'](_0x29b346[_0x25a2('0x2c')][_0x25a2('0x1e')]);}_0x127443[_0x25a2('0x55')]=qs[_0x25a2('0x32')](_0x29b346[_0x25a2('0x2c')][_0x25a2('0x32')]);_0x127443[_0x25a2('0x33')]=qs[_0x25a2('0x34')](_[_0x25a2('0x35')](_0x29b346[_0x25a2('0x2c')],_0x11e78b[_0x25a2('0x34')]));_0x127443[_0x25a2('0x69')]=!![];if(_0x29b346[_0x25a2('0x2c')][_0x25a2('0x3c')]){_0x127443[_0x25a2('0x33')]=_['merge'](_0x127443[_0x25a2('0x33')],{'$or':_[_0x25a2('0x37')](_0x127443[_0x25a2('0x2d')],function(_0x2fd2c3){var _0x4891cc={};_0x4891cc[_0x2fd2c3]={'$like':'%'+_0x29b346['query']['filter']+'%'};return _0x4891cc;})});}_0x127443=_[_0x25a2('0x36')]({},_0x127443,_0x29b346['options']);return _0x454325[_0x25a2('0x63')](_0x127443);}})[_0x25a2('0x24')](function(_0x729f58){if(!_['isEmpty'](_0x729f58)){var _0x19de3a=toCsv(_0x729f58);var _0x2a2db6=Date[_0x25a2('0x6c')]();fs[_0x25a2('0x6d')](util[_0x25a2('0x66')](_0x25a2('0x6e'),_0x454325['id'],_0x2a2db6),_0x19de3a);_0x27c589[_0x25a2('0x6f')](_0x25a2('0x70'),_0x25a2('0x71')+util[_0x25a2('0x66')](_0x25a2('0x72'),_0x454325['id'],_0x2a2db6));_0x27c589[_0x25a2('0x6f')](_0x25a2('0x73'),_0x25a2('0x74'));return _0x27c589[_0x25a2('0x75')](util[_0x25a2('0x66')](_0x25a2('0x6e'),_0x454325['id'],_0x2a2db6));}else{return _0x27c589[_0x25a2('0x1a')](0xcc);}})[_0x25a2('0x42')](handleError(_0x27c589,null));};exports[_0x25a2('0x76')]=function(_0x193314,_0x4bcb95,_0x52a52d){var _0x2fd6d6;delete _0x193314[_0x25a2('0x48')]['id'];return db[_0x25a2('0x29')]['findOne']({'where':{'id':_0x193314['params']['id']}})['then'](handleEntityNotFound(_0x4bcb95,null))['then'](function(_0xd0478d){if(_0xd0478d){return db[_0x25a2('0x77')]['transaction'](function(_0x3605bf){return db['CmCustomField'][_0x25a2('0x47')](_0x193314[_0x25a2('0x48')],{'transaction':_0x3605bf})['then'](function(_0x472d9f){_0x2fd6d6=_0x472d9f;return _0xd0478d[_0x25a2('0x78')](_0x472d9f,{'transaction':_0x3605bf});})[_0x25a2('0x24')](function(){var _0x5daaa6={'type':db[_0x25a2('0x79')]['TEXT'],'transaction':_0x3605bf};switch(_0x193314[_0x25a2('0x48')][_0x25a2('0x38')]){case'text':_0x5daaa6['type']=db[_0x25a2('0x79')][_0x25a2('0x7a')];break;case _0x25a2('0x7b'):_0x5daaa6[_0x25a2('0x38')]=db[_0x25a2('0x79')][_0x25a2('0x7c')];break;case _0x25a2('0x7d'):_0x5daaa6['type']=db['Sequelize'][_0x25a2('0x7e')];_0x5daaa6['defaultValue']=![];break;default:}return db[_0x25a2('0x77')][_0x25a2('0x7f')][_0x25a2('0x80')](_0x25a2('0x81'),util[_0x25a2('0x66')](_0x25a2('0x82'),_0x2fd6d6['id']),_0x5daaa6);})[_0x25a2('0x24')](function(){return _0x2fd6d6;});});}})[_0x25a2('0x24')](respondWithResult(_0x4bcb95,null))[_0x25a2('0x42')](handleError(_0x4bcb95,null));};exports[_0x25a2('0x83')]=function(_0x5adc65,_0x3199a1,_0x588bab){var _0x4f8188={};var _0x1d57e2={};var _0x3f7813;var _0x65bf13;return db['CmList'][_0x25a2('0x84')]({'where':{'id':_0x5adc65[_0x25a2('0x44')]['id']}})[_0x25a2('0x24')](handleEntityNotFound(_0x3199a1,null))[_0x25a2('0x24')](function(_0x105fd3){if(_0x105fd3){_0x3f7813=_0x105fd3;_0x1d57e2[_0x25a2('0x2a')]=_[_0x25a2('0x2b')](db['CmCustomField'][_0x25a2('0x45')]);_0x1d57e2['query']=_['keys'](_0x5adc65[_0x25a2('0x2c')]);_0x1d57e2[_0x25a2('0x34')]=_[_0x25a2('0x2e')](_0x1d57e2[_0x25a2('0x2a')],_0x1d57e2[_0x25a2('0x2c')]);_0x4f8188[_0x25a2('0x2d')]=_[_0x25a2('0x2e')](_0x1d57e2[_0x25a2('0x2a')],qs['fields'](_0x5adc65[_0x25a2('0x2c')][_0x25a2('0x2f')]));_0x4f8188['attributes']=_0x4f8188['attributes'][_0x25a2('0x30')]?_0x4f8188[_0x25a2('0x2d')]:_0x1d57e2[_0x25a2('0x2a')];_0x4f8188['order']=qs[_0x25a2('0x32')](_0x5adc65[_0x25a2('0x2c')][_0x25a2('0x32')]);_0x4f8188[_0x25a2('0x33')]=qs[_0x25a2('0x34')](_[_0x25a2('0x35')](_0x5adc65['query'],_0x1d57e2[_0x25a2('0x34')]));_0x4f8188[_0x25a2('0x33')]=_['merge'](_0x4f8188[_0x25a2('0x33')],{'$or':[{'ListId':_0x105fd3['id']},{'ListId':null}]});if(_0x5adc65['query'][_0x25a2('0x3c')]){_0x4f8188[_0x25a2('0x33')]=_[_0x25a2('0x36')](_0x4f8188[_0x25a2('0x33')],{'$or':_[_0x25a2('0x37')](_0x4f8188['attributes'],function(_0x10614e){var _0x230e55={};_0x230e55[_0x10614e]={'$like':'%'+_0x5adc65['query'][_0x25a2('0x3c')]+'%'};return _0x230e55;})});}_0x4f8188=_[_0x25a2('0x36')]({},_0x4f8188,_0x5adc65['options']);return db[_0x25a2('0x64')][_0x25a2('0x85')](_0x4f8188);}})[_0x25a2('0x24')](respondWithResult(_0x3199a1,null))['catch'](handleError(_0x3199a1,null));};exports[_0x25a2('0x86')]=function(_0x5ab15b,_0x27670d,_0x23af63){return db['CmList'][_0x25a2('0x46')]({'where':{'id':_0x5ab15b[_0x25a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x27670d,null))[_0x25a2('0x24')](function(_0x248f76){if(_0x248f76){return _0x248f76[_0x25a2('0x86')](_0x5ab15b[_0x25a2('0x48')][_0x25a2('0x57')],_[_0x25a2('0x87')](_0x5ab15b[_0x25a2('0x48')],[_0x25a2('0x57'),'id'])||{})[_0x25a2('0x88')](function(_0x377c5a){for(var _0x59d0db=0x0;_0x59d0db<_0x5ab15b[_0x25a2('0x48')][_0x25a2('0x57')][_0x25a2('0x30')];_0x59d0db+=0x1){socket[_0x25a2('0x89')](_0x25a2('0x8a'),{'UserId':_0x5ab15b['body'][_0x25a2('0x57')][_0x59d0db],'CmListId':_0x5ab15b[_0x25a2('0x44')]['id']});}return _0x377c5a;});}})[_0x25a2('0x24')](respondWithResult(_0x27670d,null))['catch'](handleError(_0x27670d,null));};exports[_0x25a2('0x8b')]=function(_0x486138,_0x107445,_0x5f1cbd){var _0x3c6005;return db['CmList'][_0x25a2('0x46')]({'where':{'id':_0x486138['params']['id']}})[_0x25a2('0x24')](handleEntityNotFound(_0x107445,null))[_0x25a2('0x24')](function(_0xf0fb16){if(_0xf0fb16){return _0xf0fb16[_0x25a2('0x8b')](_0x486138[_0x25a2('0x2c')][_0x25a2('0x57')])[_0x25a2('0x24')](function(_0x3ca644){if(_['isArray'](_0x486138[_0x25a2('0x2c')][_0x25a2('0x57')])){for(var _0x65a2a0=0x0;_0x65a2a0<_0x486138[_0x25a2('0x2c')][_0x25a2('0x57')]['length'];_0x65a2a0+=0x1){socket[_0x25a2('0x89')]('userCmList:remove',{'UserId':_0x486138['query'][_0x25a2('0x57')][_0x65a2a0],'CmListId':_0x486138[_0x25a2('0x44')]['id']});}}else{socket[_0x25a2('0x89')](_0x25a2('0x8c'),{'UserId':_0x486138[_0x25a2('0x2c')][_0x25a2('0x57')],'CmListId':_0x486138[_0x25a2('0x44')]['id']});}});}})[_0x25a2('0x24')](respondWithStatusCode(_0x107445,null))[_0x25a2('0x42')](handleError(_0x107445,null));};exports[_0x25a2('0x8d')]=function(_0x4ba6ae,_0x141781,_0x232a7){var _0xc85b18={};var _0x34006b={};var _0x2ece15;var _0x32b819;return db[_0x25a2('0x29')][_0x25a2('0x84')]({'where':{'id':_0x4ba6ae[_0x25a2('0x44')]['id']}})[_0x25a2('0x24')](handleEntityNotFound(_0x141781,null))['then'](function(_0x2cde51){if(_0x2cde51){_0x2ece15=_0x2cde51;_0x34006b[_0x25a2('0x2a')]=_[_0x25a2('0x2b')](db[_0x25a2('0x8e')][_0x25a2('0x45')]);_0x34006b[_0x25a2('0x2c')]=_[_0x25a2('0x2b')](_0x4ba6ae[_0x25a2('0x2c')]);_0x34006b['filters']=_[_0x25a2('0x2e')](_0x34006b[_0x25a2('0x2a')],_0x34006b[_0x25a2('0x2c')]);_0xc85b18[_0x25a2('0x2d')]=_[_0x25a2('0x2e')](_0x34006b[_0x25a2('0x2a')],qs[_0x25a2('0x2f')](_0x4ba6ae[_0x25a2('0x2c')]['fields']));_0xc85b18[_0x25a2('0x2d')]=_0xc85b18[_0x25a2('0x2d')][_0x25a2('0x30')]?_0xc85b18['attributes']:_0x34006b[_0x25a2('0x2a')];_0xc85b18[_0x25a2('0x55')]=qs[_0x25a2('0x32')](_0x4ba6ae['query']['sort']);_0xc85b18[_0x25a2('0x33')]=qs['filters'](_['pick'](_0x4ba6ae[_0x25a2('0x2c')],_0x34006b['filters']));if(_0x4ba6ae[_0x25a2('0x2c')][_0x25a2('0x3c')]){_0xc85b18['where']=_[_0x25a2('0x36')](_0xc85b18['where'],{'$or':_[_0x25a2('0x37')](_0xc85b18[_0x25a2('0x2d')],function(_0x1b3bb9){var _0x4c77e4={};_0x4c77e4[_0x1b3bb9]={'$like':'%'+_0x4ba6ae[_0x25a2('0x2c')][_0x25a2('0x3c')]+'%'};return _0x4c77e4;})});}_0xc85b18=_['merge']({},_0xc85b18,_0x4ba6ae[_0x25a2('0x3d')]);return _0x2ece15['getAgents'](_0xc85b18);}})['then'](function(_0x19b989){if(_0x19b989){_0x32b819=_0x19b989[_0x25a2('0x30')];if(!_0x4ba6ae[_0x25a2('0x2c')]['hasOwnProperty'](_0x25a2('0x68'))){_0xc85b18[_0x25a2('0x1f')]=qs[_0x25a2('0x1f')](_0x4ba6ae[_0x25a2('0x2c')]['limit']);_0xc85b18[_0x25a2('0x1e')]=qs[_0x25a2('0x1e')](_0x4ba6ae[_0x25a2('0x2c')][_0x25a2('0x1e')]);}return _0x2ece15[_0x25a2('0x8d')](_0xc85b18);}})[_0x25a2('0x24')](function(_0x1ffe05){if(_0x1ffe05){return _0x1ffe05?{'count':_0x32b819,'rows':_0x1ffe05}:null;}})['then'](respondWithResult(_0x141781,null))[_0x25a2('0x42')](handleError(_0x141781,null));}; \ No newline at end of file +var _0xb300=['Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','removeAgents','emit','userCmList:remove','getAgents','User','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','./cmList.socket','register','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','get','UserProfileResource','sendStatus','error','name','send','CmList','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Lists','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ListId','Disposition','getDispositions','findOne','include','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','omit','success','dataValues','message','Malformed\x20request\x20syntax','CustomFields','cf_%d','raw','getContacts','getContactsCsv','concat','format','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','Content-type','transaction','CmCustomField'];(function(_0x3223b1,_0x8d83bd){var _0x4ed13c=function(_0x35f366){while(--_0x35f366){_0x3223b1['push'](_0x3223b1['shift']());}};_0x4ed13c(++_0x8d83bd);}(_0xb300,0xa2));var _0x0b30=function(_0x4b338d,_0x4c5899){_0x4b338d=_0x4b338d-0x0;var _0x3e7cf6=_0xb300[_0x4b338d];return _0x3e7cf6;};'use strict';var pdf=require(_0x0b30('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0b30('0x1'));var zipdir=require(_0x0b30('0x2'));var jsonpatch=require(_0x0b30('0x3'));var rp=require(_0x0b30('0x4'));var moment=require('moment');var BPromise=require(_0x0b30('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0b30('0x6'));var sox=require(_0x0b30('0x7'));var csv=require(_0x0b30('0x8'));var ejs=require(_0x0b30('0x9'));var fs=require('fs');var _=require(_0x0b30('0xa'));var squel=require(_0x0b30('0xb'));var crypto=require(_0x0b30('0xc'));var jsforce=require(_0x0b30('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0b30('0xe'));var Papa=require(_0x0b30('0xf'));var authService=require(_0x0b30('0x10'));var hardwareService=require(_0x0b30('0x11'));var Redis=require('ioredis');var qs=require(_0x0b30('0x12'));var logger=require('../../config/logger')(_0x0b30('0x13'));var utils=require(_0x0b30('0x14'));var config=require(_0x0b30('0x15'));var db=require('../../mysqldb')['db'];config[_0x0b30('0x16')]=_[_0x0b30('0x17')](config[_0x0b30('0x16')],{'host':_0x0b30('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0b30('0x19'))[_0x0b30('0x1a')](socket);function respondWithStatusCode(_0x2a975e,_0x3592c6){_0x3592c6=_0x3592c6||0xcc;return function(_0x25768c){if(_0x25768c){return _0x2a975e['sendStatus'](_0x3592c6);}return _0x2a975e[_0x0b30('0x1b')](_0x3592c6)[_0x0b30('0x1c')]();};}function respondWithResult(_0x6e8641,_0x442e99){_0x442e99=_0x442e99||0xc8;return function(_0x167d43){if(_0x167d43){return _0x6e8641['status'](_0x442e99)[_0x0b30('0x1d')](_0x167d43);}};}function respondWithFilteredResult(_0x38726a,_0x516361){return function(_0x48c7c0){if(_0x48c7c0){var _0x14f8ef=_0x48c7c0['count'],_0x17d70d=_0x516361[_0x0b30('0x1e')],_0x442177=_0x516361[_0x0b30('0x1e')]+_0x516361[_0x0b30('0x1f')],_0x488834;if(_0x442177>=_0x14f8ef){_0x442177=_0x14f8ef;_0x488834=0xc8;}else{_0x488834=0xce;}_0x38726a['status'](_0x488834);return _0x38726a[_0x0b30('0x20')](_0x0b30('0x21'),_0x17d70d+'-'+_0x442177+'/'+_0x14f8ef)['json'](_0x48c7c0);}return null;};}function patchUpdates(_0x1d168f){return function(_0x302f29){try{jsonpatch[_0x0b30('0x22')](_0x302f29,_0x1d168f,!![]);}catch(_0x5afa1a){return BPromise['reject'](_0x5afa1a);}return _0x302f29[_0x0b30('0x23')]();};}function saveUpdates(_0x49c51e,_0xb21951){return function(_0x12c8f6){if(_0x12c8f6){return _0x12c8f6[_0x0b30('0x24')](_0x49c51e)[_0x0b30('0x25')](function(_0x45d33b){return _0x45d33b;});}return null;};}function removeEntity(_0x41a0fd,_0x44ec20){return function(_0x477ec7){if(_0x477ec7){return _0x477ec7['destroy']()['then'](function(){var _0x115942=_0x477ec7[_0x0b30('0x26')]({'plain':!![]});var _0x3ed8bc='Lists';return db[_0x0b30('0x27')]['destroy']({'where':{'type':_0x3ed8bc,'resourceId':_0x115942['id']}})['then'](function(){return _0x477ec7;});})['then'](function(){_0x41a0fd[_0x0b30('0x1b')](0xcc)[_0x0b30('0x1c')]();});}};}function handleEntityNotFound(_0x5b7ace,_0x96f1c7){return function(_0x587101){if(!_0x587101){_0x5b7ace[_0x0b30('0x28')](0x194);}return _0x587101;};}function handleError(_0x3d99ae,_0x38b596){_0x38b596=_0x38b596||0x1f4;return function(_0x81e526){logger[_0x0b30('0x29')](_0x81e526['stack']);if(_0x81e526[_0x0b30('0x2a')]){delete _0x81e526[_0x0b30('0x2a')];}_0x3d99ae[_0x0b30('0x1b')](_0x38b596)[_0x0b30('0x2b')](_0x81e526);};}exports['index']=function(_0x17de9e,_0x230c61){var _0x2da66a={},_0x2d2194={},_0x317aaa={'count':0x0,'rows':[]};var _0xd560c7=db[_0x0b30('0x2c')][_0x0b30('0x2d')];_0x2d2194[_0x0b30('0x2e')]=_[_0x0b30('0x2f')](_0xd560c7);_0x2d2194[_0x0b30('0x30')]=_[_0x0b30('0x2f')](_0x17de9e[_0x0b30('0x30')]);_0x2d2194[_0x0b30('0x31')]=_[_0x0b30('0x32')](_0x2d2194[_0x0b30('0x2e')],_0x2d2194[_0x0b30('0x30')]);_0x2da66a[_0x0b30('0x33')]=_[_0x0b30('0x32')](_0x2d2194[_0x0b30('0x2e')],qs[_0x0b30('0x34')](_0x17de9e[_0x0b30('0x30')]['fields']));_0x2da66a[_0x0b30('0x33')]=_0x2da66a[_0x0b30('0x33')][_0x0b30('0x35')]?_0x2da66a[_0x0b30('0x33')]:_0x2d2194[_0x0b30('0x2e')];if(!_0x17de9e[_0x0b30('0x30')][_0x0b30('0x36')](_0x0b30('0x37'))){_0x2da66a[_0x0b30('0x1f')]=qs[_0x0b30('0x1f')](_0x17de9e[_0x0b30('0x30')][_0x0b30('0x1f')]);_0x2da66a[_0x0b30('0x1e')]=qs[_0x0b30('0x1e')](_0x17de9e[_0x0b30('0x30')]['offset']);}_0x2da66a[_0x0b30('0x38')]=qs['sort'](_0x17de9e['query'][_0x0b30('0x39')]);_0x2da66a[_0x0b30('0x3a')]=qs[_0x0b30('0x31')](_[_0x0b30('0x3b')](_0x17de9e[_0x0b30('0x30')],_0x2d2194[_0x0b30('0x31')]));if(_0x17de9e[_0x0b30('0x30')][_0x0b30('0x3c')]){_0x2da66a[_0x0b30('0x3a')]=_[_0x0b30('0x3d')](_0x2da66a[_0x0b30('0x3a')],{'$or':_[_0x0b30('0x3e')](_0xd560c7,function(_0x2fecb0){if(_0x2fecb0[_0x0b30('0x3f')]['key']!==_0x0b30('0x40')){var _0x2579da={};_0x2579da[_0x2fecb0[_0x0b30('0x41')]]={'$like':'%'+_0x17de9e['query'][_0x0b30('0x3c')]+'%'};return _0x2579da;}})});}_0x2da66a=_[_0x0b30('0x3d')]({},_0x2da66a,_0x17de9e[_0x0b30('0x42')]);var _0x4711f1={'where':_0x2da66a['where']};return db[_0x0b30('0x2c')][_0x0b30('0x43')](_0x4711f1)[_0x0b30('0x25')](function(_0x1283ec){_0x317aaa[_0x0b30('0x43')]=_0x1283ec;if(_0x17de9e[_0x0b30('0x30')][_0x0b30('0x44')]){_0x2da66a['include']=[{'all':!![]}];}return db[_0x0b30('0x2c')][_0x0b30('0x45')](_0x2da66a);})[_0x0b30('0x25')](function(_0x50fc84){_0x317aaa[_0x0b30('0x46')]=_0x50fc84;return _0x317aaa;})[_0x0b30('0x25')](respondWithFilteredResult(_0x230c61,_0x2da66a))[_0x0b30('0x47')](handleError(_0x230c61,null));};exports[_0x0b30('0x48')]=function(_0x5bda82,_0x31f851){var _0x191b8a={'raw':![],'where':{'id':_0x5bda82[_0x0b30('0x49')]['id']}},_0x4f13a7={};_0x4f13a7[_0x0b30('0x2e')]=_['keys'](db['CmList'][_0x0b30('0x2d')]);_0x4f13a7['query']=_[_0x0b30('0x2f')](_0x5bda82[_0x0b30('0x30')]);_0x4f13a7[_0x0b30('0x31')]=_[_0x0b30('0x32')](_0x4f13a7['model'],_0x4f13a7['query']);_0x191b8a['attributes']=_['intersection'](_0x4f13a7['model'],qs[_0x0b30('0x34')](_0x5bda82['query'][_0x0b30('0x34')]));_0x191b8a[_0x0b30('0x33')]=_0x191b8a[_0x0b30('0x33')][_0x0b30('0x35')]?_0x191b8a[_0x0b30('0x33')]:_0x4f13a7[_0x0b30('0x2e')];if(_0x5bda82[_0x0b30('0x30')][_0x0b30('0x44')]){_0x191b8a['include']=[{'all':!![]}];}_0x191b8a=_[_0x0b30('0x3d')]({},_0x191b8a,_0x5bda82['options']);return db[_0x0b30('0x2c')][_0x0b30('0x4a')](_0x191b8a)['then'](handleEntityNotFound(_0x31f851,null))[_0x0b30('0x25')](respondWithResult(_0x31f851,null))[_0x0b30('0x47')](handleError(_0x31f851,null));};exports['create']=function(_0xee222b,_0xef144f){return db['CmList'][_0x0b30('0x4b')](_0xee222b[_0x0b30('0x4c')],{})[_0x0b30('0x25')](function(_0x4d49a3){var _0x440a02=_0xee222b[_0x0b30('0x4d')][_0x0b30('0x26')]({'plain':!![]});if(!_0x440a02)throw new Error(_0x0b30('0x4e'));if(_0x440a02['role']===_0x0b30('0x4d')){var _0x3fe72=_0x4d49a3[_0x0b30('0x26')]({'plain':!![]});var _0x5180bc=_0x0b30('0x4f');return db[_0x0b30('0x50')][_0x0b30('0x4a')]({'where':{'name':_0x5180bc,'userProfileId':_0x440a02[_0x0b30('0x51')]},'raw':!![]})[_0x0b30('0x25')](function(_0x4cd376){if(_0x4cd376&&_0x4cd376['autoAssociation']===0x0){return db[_0x0b30('0x27')][_0x0b30('0x4b')]({'name':_0x3fe72['name'],'resourceId':_0x3fe72['id'],'type':_0x4cd376[_0x0b30('0x2a')],'sectionId':_0x4cd376['id']},{})['then'](function(){return _0x4d49a3;});}else{return _0x4d49a3;}})['catch'](function(_0x3dee32){logger['error'](_0x0b30('0x52'),_0x3dee32);throw _0x3dee32;});}return _0x4d49a3;})['then'](respondWithResult(_0xef144f,0xc9))[_0x0b30('0x47')](handleError(_0xef144f,null));};exports[_0x0b30('0x24')]=function(_0x33fba6,_0x3da070){if(_0x33fba6[_0x0b30('0x4c')]['id']){delete _0x33fba6[_0x0b30('0x4c')]['id'];}return db[_0x0b30('0x2c')][_0x0b30('0x4a')]({'where':{'id':_0x33fba6[_0x0b30('0x49')]['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x3da070,null))['then'](saveUpdates(_0x33fba6[_0x0b30('0x4c')],null))[_0x0b30('0x25')](respondWithResult(_0x3da070,null))[_0x0b30('0x47')](handleError(_0x3da070,null));};exports[_0x0b30('0x53')]=function(_0x4d9b4d,_0x12ee6f){return db[_0x0b30('0x2c')][_0x0b30('0x4a')]({'where':{'id':_0x4d9b4d['params']['id']}})['then'](handleEntityNotFound(_0x12ee6f,null))['then'](removeEntity(_0x12ee6f,null))[_0x0b30('0x47')](handleError(_0x12ee6f,null));};exports['describe']=function(_0xdf9b50,_0x341704){return db['CmList'][_0x0b30('0x54')]()[_0x0b30('0x25')](respondWithResult(_0x341704,null))['catch'](handleError(_0x341704,null));};exports[_0x0b30('0x55')]=function(_0xfa02b9,_0x523e3e,_0x5721a7){if(_0xfa02b9[_0x0b30('0x4c')]['id']){delete _0xfa02b9[_0x0b30('0x4c')]['id'];}return db[_0x0b30('0x2c')][_0x0b30('0x4a')]({'where':{'id':_0xfa02b9[_0x0b30('0x49')]['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x523e3e,null))[_0x0b30('0x25')](function(_0x3a3b4c){if(_0x3a3b4c){_0xfa02b9[_0x0b30('0x4c')][_0x0b30('0x56')]=_0x3a3b4c['id'];return db[_0x0b30('0x57')][_0x0b30('0x4b')](_0xfa02b9[_0x0b30('0x4c')]);}})[_0x0b30('0x25')](respondWithResult(_0x523e3e,null))[_0x0b30('0x47')](handleError(_0x523e3e,null));};exports[_0x0b30('0x58')]=function(_0x75bf0a,_0x4709d4,_0x4974b4){var _0x1c2f97={'raw':![],'where':{}};var _0x32acc3={};var _0x243c18={'count':0x0,'rows':[]};return db[_0x0b30('0x2c')][_0x0b30('0x59')]({'where':{'id':_0x75bf0a[_0x0b30('0x49')]['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x4709d4,null))[_0x0b30('0x25')](function(_0x4a800e){if(_0x4a800e){_0x32acc3[_0x0b30('0x2e')]=_[_0x0b30('0x2f')](db[_0x0b30('0x57')]['rawAttributes']);_0x32acc3[_0x0b30('0x30')]=_[_0x0b30('0x2f')](_0x75bf0a[_0x0b30('0x30')]);_0x32acc3[_0x0b30('0x31')]=_['intersection'](_0x32acc3[_0x0b30('0x2e')],_0x32acc3['query']);_0x1c2f97[_0x0b30('0x33')]=_[_0x0b30('0x32')](_0x32acc3['model'],qs[_0x0b30('0x34')](_0x75bf0a[_0x0b30('0x30')]['fields']));_0x1c2f97[_0x0b30('0x33')]=_0x1c2f97[_0x0b30('0x33')][_0x0b30('0x35')]?_0x1c2f97[_0x0b30('0x33')]:_0x32acc3['model'];if(!_0x75bf0a[_0x0b30('0x30')][_0x0b30('0x36')](_0x0b30('0x37'))){_0x1c2f97[_0x0b30('0x1f')]=qs['limit'](_0x75bf0a[_0x0b30('0x30')][_0x0b30('0x1f')]);_0x1c2f97[_0x0b30('0x1e')]=qs[_0x0b30('0x1e')](_0x75bf0a[_0x0b30('0x30')][_0x0b30('0x1e')]);}_0x1c2f97['order']=qs['sort'](_0x75bf0a[_0x0b30('0x30')][_0x0b30('0x39')]);_0x1c2f97[_0x0b30('0x3a')]=qs[_0x0b30('0x31')](_[_0x0b30('0x3b')](_0x75bf0a[_0x0b30('0x30')],_0x32acc3[_0x0b30('0x31')]));_0x1c2f97[_0x0b30('0x3a')][_0x0b30('0x56')]=_0x4a800e['id'];if(_0x75bf0a[_0x0b30('0x30')][_0x0b30('0x3c')]){_0x1c2f97[_0x0b30('0x3a')]=_[_0x0b30('0x3d')](_0x1c2f97[_0x0b30('0x3a')],{'$or':_[_0x0b30('0x3e')](_0x1c2f97[_0x0b30('0x33')],function(_0x4fdd84){var _0x71419e={};_0x71419e[_0x4fdd84]={'$like':'%'+_0x75bf0a[_0x0b30('0x30')][_0x0b30('0x3c')]+'%'};return _0x71419e;})});}_0x1c2f97=_[_0x0b30('0x3d')]({},_0x1c2f97,_0x75bf0a['options']);return db[_0x0b30('0x57')]['count']({'where':_0x1c2f97['where']})[_0x0b30('0x25')](function(_0x8b21cb){_0x243c18[_0x0b30('0x43')]=_0x8b21cb;if(_0x75bf0a['query'][_0x0b30('0x44')]){_0x1c2f97[_0x0b30('0x5a')]=[{'all':!![]}];}return db[_0x0b30('0x57')][_0x0b30('0x45')](_0x1c2f97);})[_0x0b30('0x25')](function(_0x265577){_0x243c18['rows']=_0x265577;return _0x243c18;});}})['then'](respondWithFilteredResult(_0x4709d4,_0x1c2f97))['catch'](handleError(_0x4709d4,null));};exports[_0x0b30('0x5b')]=function(_0xc370ac,_0x4bf75d,_0x3a7a7a){var _0x3431b;return db[_0x0b30('0x2c')][_0x0b30('0x4a')]({'where':{'id':_0xc370ac[_0x0b30('0x49')]['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x4bf75d,null))[_0x0b30('0x25')](function(_0x3077c3){if(_0x3077c3){return _0x3077c3[_0x0b30('0x5b')](_0xc370ac[_0x0b30('0x30')][_0x0b30('0x5c')]);}})[_0x0b30('0x25')](respondWithStatusCode(_0x4bf75d,null))[_0x0b30('0x47')](handleError(_0x4bf75d,null));};exports[_0x0b30('0x5d')]=function(_0x412ca7,_0x338721,_0x2771fa){return db['CmList'][_0x0b30('0x4a')]({'where':{'id':_0x412ca7[_0x0b30('0x49')]['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x338721,null))['then'](function(_0x4dced8){if(_0x4dced8){var _0x4912cb=[];var _0x4df7aa={'success':[],'errors':[]};return db[_0x0b30('0x5e')]['describe']()[_0x0b30('0x25')](function(_0x5064ae){if(_0x412ca7[_0x0b30('0x4c')]['tags']&&_[_0x0b30('0x5f')](_0x412ca7['body'][_0x0b30('0x60')])){if(_0x412ca7['body'][_0x0b30('0x60')]['length']){_0x412ca7[_0x0b30('0x4c')][_0x0b30('0x60')]=_0x412ca7[_0x0b30('0x4c')]['tags'][_0x0b30('0x61')](';')+';';}else{_0x412ca7['body'][_0x0b30('0x60')]=null;}}else{_0x412ca7[_0x0b30('0x4c')][_0x0b30('0x60')]=null;}if(_0x412ca7[_0x0b30('0x4c')]&&_[_0x0b30('0x5f')](_0x412ca7[_0x0b30('0x4c')])){for(var _0x625cf8=0x0;_0x625cf8<_0x412ca7['body'][_0x0b30('0x35')];_0x625cf8+=0x1){_0x412ca7[_0x0b30('0x4c')][_0x625cf8]['ListId']=_0x412ca7[_0x0b30('0x49')]['id'];_0x4912cb[_0x0b30('0x62')](_0x412ca7[_0x0b30('0x4c')][_0x625cf8]);}return BPromise[_0x0b30('0x63')](_0x4912cb,function(_0x30ca4b){return db[_0x0b30('0x5e')][_0x0b30('0x4b')](_[_0x0b30('0x64')](_0x30ca4b,[_0x0b30('0x5c'),'id'])||{},{'fields':_[_0x0b30('0x2f')](_0x5064ae),'raw':!![]})['then'](function(_0x265988){_0x4df7aa[_0x0b30('0x65')][_0x0b30('0x62')](_0x265988[_0x0b30('0x66')]);})['catch'](function(_0x4ed8e9){_0x4df7aa['errors'][_0x0b30('0x62')]({'data':_0x30ca4b,'error':_0x4ed8e9[_0x0b30('0x67')]});});})[_0x0b30('0x25')](function(_0x1fc0bc){return _0x4df7aa;})[_0x0b30('0x47')](function(_0x30a762){return _0x30a762;});}else{_0x338721['status'](0x190)[_0x0b30('0x1d')]({'message':_0x0b30('0x68')});}});}})[_0x0b30('0x25')](respondWithResult(_0x338721,null))[_0x0b30('0x47')](handleError(_0x338721,null));};exports['getContacts']=function(_0x1ad6fa,_0x587b24,_0x2e2821){var _0x4106f0;return db[_0x0b30('0x2c')][_0x0b30('0x4a')]({'where':{'id':_0x1ad6fa[_0x0b30('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x0b30('0x69')}]})[_0x0b30('0x25')](handleEntityNotFound(_0x587b24,null))['then'](function(_0x49ade2){if(_0x49ade2){_0x4106f0=_0x49ade2;return db[_0x0b30('0x5e')][_0x0b30('0x2d')];}})[_0x0b30('0x25')](function(_0x20972a){if(_0x20972a){var _0x26ff4e={};var _0x317b96={};_0x317b96['model']=_['concat'](_['keys'](_0x20972a),_['map'](_0x4106f0[_0x0b30('0x69')],function(_0x5c0b1a){return util['format'](_0x0b30('0x6a'),_0x5c0b1a['id']);}));_0x317b96[_0x0b30('0x30')]=_[_0x0b30('0x2f')](_0x1ad6fa[_0x0b30('0x30')]);_0x317b96[_0x0b30('0x31')]=_[_0x0b30('0x32')](_0x317b96[_0x0b30('0x2e')],_0x317b96[_0x0b30('0x30')]);_0x26ff4e[_0x0b30('0x33')]=_[_0x0b30('0x32')](_0x317b96[_0x0b30('0x2e')],qs[_0x0b30('0x34')](_0x1ad6fa[_0x0b30('0x30')][_0x0b30('0x34')]));_0x26ff4e['attributes']=_0x26ff4e[_0x0b30('0x33')][_0x0b30('0x35')]?_0x26ff4e['attributes']:_0x317b96[_0x0b30('0x2e')];if(!_0x1ad6fa[_0x0b30('0x30')][_0x0b30('0x36')](_0x0b30('0x37'))){_0x26ff4e['limit']=qs[_0x0b30('0x1f')](_0x1ad6fa['query']['limit']);_0x26ff4e['offset']=qs['offset'](_0x1ad6fa['query'][_0x0b30('0x1e')]);}_0x26ff4e[_0x0b30('0x38')]=qs[_0x0b30('0x39')](_0x1ad6fa['query']['sort']);_0x26ff4e[_0x0b30('0x3a')]=qs[_0x0b30('0x31')](_[_0x0b30('0x3b')](_0x1ad6fa[_0x0b30('0x30')],_0x317b96[_0x0b30('0x31')]));_0x26ff4e[_0x0b30('0x6b')]=!![];if(_0x1ad6fa['query'][_0x0b30('0x3c')]){_0x26ff4e['where']=_[_0x0b30('0x3d')](_0x26ff4e[_0x0b30('0x3a')],{'$or':_[_0x0b30('0x3e')](_0x26ff4e[_0x0b30('0x33')],function(_0x3d790b){var _0x214204={};_0x214204[_0x3d790b]={'$like':'%'+_0x1ad6fa[_0x0b30('0x30')]['filter']+'%'};return _0x214204;})});}_0x26ff4e=_[_0x0b30('0x3d')]({},_0x26ff4e,_0x1ad6fa[_0x0b30('0x42')]);return _0x4106f0[_0x0b30('0x6c')](_0x26ff4e);}})[_0x0b30('0x25')](respondWithResult(_0x587b24,null))['catch'](handleError(_0x587b24,null));};exports[_0x0b30('0x6d')]=function(_0x30b4f4,_0x152000,_0xff6564){var _0x2bdac3;return db[_0x0b30('0x2c')][_0x0b30('0x4a')]({'where':{'id':_0x30b4f4[_0x0b30('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x0b30('0x69')}]})[_0x0b30('0x25')](handleEntityNotFound(_0x152000,null))[_0x0b30('0x25')](function(_0x1e64df){if(_0x1e64df){_0x2bdac3=_0x1e64df;return db['CmContact'][_0x0b30('0x2d')];}})[_0x0b30('0x25')](function(_0x1526d5){if(_0x1526d5){var _0x2da7a2={};var _0x1c6d3e={};_0x1c6d3e['model']=_[_0x0b30('0x6e')](_[_0x0b30('0x2f')](_0x1526d5),_[_0x0b30('0x3e')](_0x2bdac3['CustomFields'],function(_0x1eaaff){return util[_0x0b30('0x6f')](_0x0b30('0x6a'),_0x1eaaff['id']);}));_0x1c6d3e[_0x0b30('0x30')]=_[_0x0b30('0x2f')](_0x30b4f4[_0x0b30('0x30')]);_0x1c6d3e[_0x0b30('0x31')]=_[_0x0b30('0x32')](_0x1c6d3e[_0x0b30('0x2e')],_0x1c6d3e[_0x0b30('0x30')]);_0x2da7a2[_0x0b30('0x33')]=_['intersection'](_0x1c6d3e[_0x0b30('0x2e')],qs[_0x0b30('0x34')](_0x30b4f4[_0x0b30('0x30')][_0x0b30('0x34')]));_0x2da7a2[_0x0b30('0x33')]=_0x2da7a2[_0x0b30('0x33')][_0x0b30('0x35')]?_0x2da7a2['attributes']:_0x1c6d3e[_0x0b30('0x2e')];if(!_0x30b4f4['query'][_0x0b30('0x36')]('nolimit')){_0x2da7a2['limit']=qs[_0x0b30('0x1f')](_0x30b4f4['query']['limit']);_0x2da7a2[_0x0b30('0x1e')]=qs[_0x0b30('0x1e')](_0x30b4f4[_0x0b30('0x30')]['offset']);}_0x2da7a2['order']=qs[_0x0b30('0x39')](_0x30b4f4[_0x0b30('0x30')][_0x0b30('0x39')]);_0x2da7a2[_0x0b30('0x3a')]=qs['filters'](_[_0x0b30('0x3b')](_0x30b4f4[_0x0b30('0x30')],_0x1c6d3e[_0x0b30('0x31')]));_0x2da7a2[_0x0b30('0x6b')]=!![];if(_0x30b4f4[_0x0b30('0x30')][_0x0b30('0x3c')]){_0x2da7a2[_0x0b30('0x3a')]=_[_0x0b30('0x3d')](_0x2da7a2['where'],{'$or':_[_0x0b30('0x3e')](_0x2da7a2[_0x0b30('0x33')],function(_0x29d13e){var _0x4fbb4f={};_0x4fbb4f[_0x29d13e]={'$like':'%'+_0x30b4f4[_0x0b30('0x30')][_0x0b30('0x3c')]+'%'};return _0x4fbb4f;})});}_0x2da7a2=_[_0x0b30('0x3d')]({},_0x2da7a2,_0x30b4f4[_0x0b30('0x42')]);return _0x2bdac3['getContacts'](_0x2da7a2);}})['then'](function(_0x208315){if(!_[_0x0b30('0x70')](_0x208315)){var _0x5181da=toCsv(_0x208315);var _0x1d0f3e=Date['now']();fs[_0x0b30('0x71')](util[_0x0b30('0x6f')](_0x0b30('0x72'),_0x2bdac3['id'],_0x1d0f3e),_0x5181da);_0x152000['setHeader']('Content-disposition',_0x0b30('0x73')+util[_0x0b30('0x6f')](_0x0b30('0x74'),_0x2bdac3['id'],_0x1d0f3e));_0x152000['setHeader'](_0x0b30('0x75'),'text/csv');return _0x152000['download'](util['format'](_0x0b30('0x72'),_0x2bdac3['id'],_0x1d0f3e));}else{return _0x152000[_0x0b30('0x28')](0xcc);}})['catch'](handleError(_0x152000,null));};exports['addCustomField']=function(_0x51e846,_0x46fe48,_0x13193d){var _0x21db1c;delete _0x51e846['body']['id'];return db[_0x0b30('0x2c')][_0x0b30('0x59')]({'where':{'id':_0x51e846[_0x0b30('0x49')]['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x46fe48,null))[_0x0b30('0x25')](function(_0x3d5434){if(_0x3d5434){return db['sequelize'][_0x0b30('0x76')](function(_0x2a83af){return db[_0x0b30('0x77')][_0x0b30('0x4b')](_0x51e846['body'],{'transaction':_0x2a83af})[_0x0b30('0x25')](function(_0x522e1e){_0x21db1c=_0x522e1e;return _0x3d5434['addCustomFields'](_0x522e1e,{'transaction':_0x2a83af});})[_0x0b30('0x25')](function(){var _0x5cccb7={'type':db[_0x0b30('0x78')][_0x0b30('0x79')],'transaction':_0x2a83af};switch(_0x51e846[_0x0b30('0x4c')][_0x0b30('0x3f')]){case _0x0b30('0x7a'):_0x5cccb7[_0x0b30('0x3f')]=db[_0x0b30('0x78')][_0x0b30('0x79')];break;case _0x0b30('0x7b'):_0x5cccb7['type']=db[_0x0b30('0x78')][_0x0b30('0x7c')];break;case _0x0b30('0x7d'):_0x5cccb7[_0x0b30('0x3f')]=db[_0x0b30('0x78')][_0x0b30('0x7e')];_0x5cccb7[_0x0b30('0x7f')]=![];break;default:}return db[_0x0b30('0x80')][_0x0b30('0x81')][_0x0b30('0x82')](_0x0b30('0x83'),util[_0x0b30('0x6f')](_0x0b30('0x84'),_0x21db1c['id']),_0x5cccb7);})[_0x0b30('0x25')](function(){return _0x21db1c;});});}})[_0x0b30('0x25')](respondWithResult(_0x46fe48,null))[_0x0b30('0x47')](handleError(_0x46fe48,null));};exports[_0x0b30('0x85')]=function(_0x468d8b,_0x32e42c,_0x22c27a){var _0x1c3354={};var _0x11314c={};var _0x5e603a;var _0x7e73e9;return db[_0x0b30('0x2c')]['findOne']({'where':{'id':_0x468d8b[_0x0b30('0x49')]['id']}})['then'](handleEntityNotFound(_0x32e42c,null))[_0x0b30('0x25')](function(_0x413e99){if(_0x413e99){_0x5e603a=_0x413e99;_0x11314c['model']=_['keys'](db[_0x0b30('0x77')]['rawAttributes']);_0x11314c['query']=_['keys'](_0x468d8b[_0x0b30('0x30')]);_0x11314c[_0x0b30('0x31')]=_[_0x0b30('0x32')](_0x11314c[_0x0b30('0x2e')],_0x11314c[_0x0b30('0x30')]);_0x1c3354['attributes']=_[_0x0b30('0x32')](_0x11314c[_0x0b30('0x2e')],qs[_0x0b30('0x34')](_0x468d8b[_0x0b30('0x30')]['fields']));_0x1c3354['attributes']=_0x1c3354['attributes'][_0x0b30('0x35')]?_0x1c3354['attributes']:_0x11314c[_0x0b30('0x2e')];_0x1c3354['order']=qs[_0x0b30('0x39')](_0x468d8b['query'][_0x0b30('0x39')]);_0x1c3354['where']=qs['filters'](_[_0x0b30('0x3b')](_0x468d8b['query'],_0x11314c[_0x0b30('0x31')]));_0x1c3354[_0x0b30('0x3a')]=_[_0x0b30('0x3d')](_0x1c3354[_0x0b30('0x3a')],{'$or':[{'ListId':_0x413e99['id']},{'ListId':null}]});if(_0x468d8b['query'][_0x0b30('0x3c')]){_0x1c3354[_0x0b30('0x3a')]=_[_0x0b30('0x3d')](_0x1c3354[_0x0b30('0x3a')],{'$or':_[_0x0b30('0x3e')](_0x1c3354[_0x0b30('0x33')],function(_0x578a6b){var _0x394256={};_0x394256[_0x578a6b]={'$like':'%'+_0x468d8b[_0x0b30('0x30')][_0x0b30('0x3c')]+'%'};return _0x394256;})});}_0x1c3354=_[_0x0b30('0x3d')]({},_0x1c3354,_0x468d8b[_0x0b30('0x42')]);return db[_0x0b30('0x77')][_0x0b30('0x86')](_0x1c3354);}})['then'](respondWithResult(_0x32e42c,null))[_0x0b30('0x47')](handleError(_0x32e42c,null));};exports[_0x0b30('0x87')]=function(_0xcc8f31,_0x134bbf,_0x5dc591){return db['CmList'][_0x0b30('0x4a')]({'where':{'id':_0xcc8f31['params']['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x134bbf,null))[_0x0b30('0x25')](function(_0xcff73d){if(_0xcff73d){return _0xcff73d[_0x0b30('0x87')](_0xcc8f31[_0x0b30('0x4c')][_0x0b30('0x5c')],_['omit'](_0xcc8f31['body'],[_0x0b30('0x5c'),'id'])||{})['spread'](function(_0x559b7e){for(var _0x3e0abd=0x0;_0x3e0abd<_0xcc8f31[_0x0b30('0x4c')][_0x0b30('0x5c')][_0x0b30('0x35')];_0x3e0abd+=0x1){socket['emit']('userCmList:save',{'UserId':_0xcc8f31[_0x0b30('0x4c')]['ids'][_0x3e0abd],'CmListId':_0xcc8f31['params']['id']});}return _0x559b7e;});}})[_0x0b30('0x25')](respondWithResult(_0x134bbf,null))['catch'](handleError(_0x134bbf,null));};exports[_0x0b30('0x88')]=function(_0x30c4e0,_0x1d614e,_0xac03f9){var _0x4fc2b1;return db[_0x0b30('0x2c')][_0x0b30('0x4a')]({'where':{'id':_0x30c4e0[_0x0b30('0x49')]['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x1d614e,null))['then'](function(_0x1a2986){if(_0x1a2986){return _0x1a2986[_0x0b30('0x88')](_0x30c4e0[_0x0b30('0x30')][_0x0b30('0x5c')])[_0x0b30('0x25')](function(_0x5a2f88){if(_[_0x0b30('0x5f')](_0x30c4e0[_0x0b30('0x30')][_0x0b30('0x5c')])){for(var _0x32f154=0x0;_0x32f154<_0x30c4e0[_0x0b30('0x30')][_0x0b30('0x5c')]['length'];_0x32f154+=0x1){socket[_0x0b30('0x89')](_0x0b30('0x8a'),{'UserId':_0x30c4e0[_0x0b30('0x30')][_0x0b30('0x5c')][_0x32f154],'CmListId':_0x30c4e0['params']['id']});}}else{socket[_0x0b30('0x89')]('userCmList:remove',{'UserId':_0x30c4e0[_0x0b30('0x30')][_0x0b30('0x5c')],'CmListId':_0x30c4e0[_0x0b30('0x49')]['id']});}});}})[_0x0b30('0x25')](respondWithStatusCode(_0x1d614e,null))[_0x0b30('0x47')](handleError(_0x1d614e,null));};exports[_0x0b30('0x8b')]=function(_0x5a6b43,_0x57ba31,_0x251815){var _0x1ef25c={};var _0x410835={};var _0x25236b;var _0x5c81;return db[_0x0b30('0x2c')][_0x0b30('0x59')]({'where':{'id':_0x5a6b43['params']['id']}})[_0x0b30('0x25')](handleEntityNotFound(_0x57ba31,null))['then'](function(_0xb0f482){if(_0xb0f482){_0x25236b=_0xb0f482;_0x410835[_0x0b30('0x2e')]=_[_0x0b30('0x2f')](db[_0x0b30('0x8c')][_0x0b30('0x2d')]);_0x410835[_0x0b30('0x30')]=_[_0x0b30('0x2f')](_0x5a6b43[_0x0b30('0x30')]);_0x410835[_0x0b30('0x31')]=_['intersection'](_0x410835[_0x0b30('0x2e')],_0x410835[_0x0b30('0x30')]);_0x1ef25c[_0x0b30('0x33')]=_[_0x0b30('0x32')](_0x410835[_0x0b30('0x2e')],qs[_0x0b30('0x34')](_0x5a6b43['query']['fields']));_0x1ef25c[_0x0b30('0x33')]=_0x1ef25c[_0x0b30('0x33')]['length']?_0x1ef25c['attributes']:_0x410835['model'];_0x1ef25c[_0x0b30('0x38')]=qs['sort'](_0x5a6b43[_0x0b30('0x30')][_0x0b30('0x39')]);_0x1ef25c[_0x0b30('0x3a')]=qs[_0x0b30('0x31')](_[_0x0b30('0x3b')](_0x5a6b43['query'],_0x410835[_0x0b30('0x31')]));if(_0x5a6b43[_0x0b30('0x30')][_0x0b30('0x3c')]){_0x1ef25c[_0x0b30('0x3a')]=_[_0x0b30('0x3d')](_0x1ef25c[_0x0b30('0x3a')],{'$or':_[_0x0b30('0x3e')](_0x1ef25c[_0x0b30('0x33')],function(_0x425054){var _0xcdf35c={};_0xcdf35c[_0x425054]={'$like':'%'+_0x5a6b43[_0x0b30('0x30')][_0x0b30('0x3c')]+'%'};return _0xcdf35c;})});}_0x1ef25c=_['merge']({},_0x1ef25c,_0x5a6b43['options']);return _0x25236b[_0x0b30('0x8b')](_0x1ef25c);}})[_0x0b30('0x25')](function(_0x4727bd){if(_0x4727bd){_0x5c81=_0x4727bd[_0x0b30('0x35')];if(!_0x5a6b43[_0x0b30('0x30')][_0x0b30('0x36')](_0x0b30('0x37'))){_0x1ef25c[_0x0b30('0x1f')]=qs['limit'](_0x5a6b43['query'][_0x0b30('0x1f')]);_0x1ef25c[_0x0b30('0x1e')]=qs['offset'](_0x5a6b43[_0x0b30('0x30')][_0x0b30('0x1e')]);}return _0x25236b[_0x0b30('0x8b')](_0x1ef25c);}})['then'](function(_0x323535){if(_0x323535){return _0x323535?{'count':_0x5c81,'rows':_0x323535}:null;}})[_0x0b30('0x25')](respondWithResult(_0x57ba31,null))[_0x0b30('0x47')](handleError(_0x57ba31,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 771840c..3953f96 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 _0xd63e=['remove','emit','hook','events','CmList','setMaxListeners','save','update'];(function(_0x256d56,_0x24d87e){var _0x4010e3=function(_0x5a70c1){while(--_0x5a70c1){_0x256d56['push'](_0x256d56['shift']());}};_0x4010e3(++_0x24d87e);}(_0xd63e,0x19b));var _0xed63=function(_0x28fa86,_0x303544){_0x28fa86=_0x28fa86-0x0;var _0x33f670=_0xd63e[_0x28fa86];return _0x33f670;};'use strict';var EventEmitter=require(_0xed63('0x0'));var CmList=require('../../mysqldb')['db'][_0xed63('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xed63('0x2')](0x0);var events={'afterCreate':_0xed63('0x3'),'afterUpdate':_0xed63('0x4'),'afterDestroy':_0xed63('0x5')};function emitEvent(_0x7871d3){return function(_0x13be4b,_0x24929b,_0x2ac712){CmListEvents[_0xed63('0x6')](_0x7871d3+':'+_0x13be4b['id'],_0x13be4b);CmListEvents['emit'](_0x7871d3,_0x13be4b);_0x2ac712(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xed63('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x79ca=['../../mysqldb','CmList','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0x79ca,0x117));var _0xa79c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x79ca[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xa79c('0x0'));var CmList=require(_0xa79c('0x1'))['db'][_0xa79c('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xa79c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa79c('0x4'),'afterDestroy':_0xa79c('0x5')};function emitEvent(_0x340afb){return function(_0x57a875,_0xe19776,_0x585859){CmListEvents[_0xa79c('0x6')](_0x340afb+':'+_0x57a875['id'],_0x57a875);CmListEvents[_0xa79c('0x6')](_0x340afb,_0x57a875);_0x585859(null);};}for(var e in events){if(events[_0xa79c('0x7')](e)){var event=events[e];CmList[_0xa79c('0x8')](e,emitEvent(event));}}module[_0xa79c('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 494b8a7..6a27d10 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 _0xc9c3=['api','moment','bluebird','request-promise','define','CmList','cm_lists','lodash','util','../../config/logger'];(function(_0x103a07,_0x35acb4){var _0x404596=function(_0x5b6cf8){while(--_0x5b6cf8){_0x103a07['push'](_0x103a07['shift']());}};_0x404596(++_0x35acb4);}(_0xc9c3,0x165));var _0x3c9c=function(_0x2f27c8,_0x28aa44){_0x2f27c8=_0x2f27c8-0x0;var _0x2f8b0c=_0xc9c3[_0x2f27c8];return _0x2f8b0c;};'use strict';var _=require(_0x3c9c('0x0'));var util=require(_0x3c9c('0x1'));var logger=require(_0x3c9c('0x2'))(_0x3c9c('0x3'));var moment=require(_0x3c9c('0x4'));var BPromise=require(_0x3c9c('0x5'));var rp=require(_0x3c9c('0x6'));var attributes=require('./cmList.attributes');module['exports']=function(_0x3aace1,_0x118cd7){return _0x3aace1[_0x3c9c('0x7')](_0x3c9c('0x8'),attributes,{'tableName':_0x3c9c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30f9=['util','../../config/logger','api','moment','bluebird','request-promise','./cmList.attributes','define','CmList','lodash'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x30f9,0xe5));var _0x930f=function(_0x56eb70,_0x2bd75c){_0x56eb70=_0x56eb70-0x0;var _0x47f1fe=_0x30f9[_0x56eb70];return _0x47f1fe;};'use strict';var _=require(_0x930f('0x0'));var util=require(_0x930f('0x1'));var logger=require(_0x930f('0x2'))(_0x930f('0x3'));var moment=require(_0x930f('0x4'));var BPromise=require(_0x930f('0x5'));var rp=require(_0x930f('0x6'));var attributes=require(_0x930f('0x7'));module['exports']=function(_0x20f2f1,_0x556b8d){return _0x20f2f1[_0x930f('0x8')](_0x930f('0x9'),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 e1355a9..16ca828 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 _0xf337=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf337,0x171));var _0x7f33=function(_0x197246,_0x1ba3fe){_0x197246=_0x197246-0x0;var _0x2dc955=_0xf337[_0x197246];return _0x2dc955;};'use strict';var _=require('lodash');var util=require(_0x7f33('0x0'));var moment=require(_0x7f33('0x1'));var BPromise=require(_0x7f33('0x2'));var rs=require(_0x7f33('0x3'));var fs=require('fs');var Redis=require(_0x7f33('0x4'));var db=require(_0x7f33('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f33('0x6'))('rpc');var config=require(_0x7f33('0x7'));var jayson=require(_0x7f33('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7f33('0x9')],{'host':_0x7f33('0xa'),'port':0x18eb});var socket=require(_0x7f33('0xb'))(new Redis(config[_0x7f33('0x9')]));require('./cmList.socket')[_0x7f33('0xc')](socket);function respondWithRpcPromise(_0x50effa,_0x187345,_0x476326){return new BPromise(function(_0x146cd8,_0x4148a9){return client[_0x7f33('0xd')](_0x50effa,_0x476326)['then'](function(_0x332be6){logger[_0x7f33('0xe')](_0x7f33('0xf'),_0x187345,_0x7f33('0x10'));logger[_0x7f33('0x11')](_0x7f33('0x12'),_0x187345,_0x7f33('0x10'),JSON[_0x7f33('0x13')](_0x332be6));if(_0x332be6[_0x7f33('0x14')]){if(_0x332be6[_0x7f33('0x14')]['code']===0x1f4){logger['error'](_0x7f33('0xf'),_0x187345,_0x332be6[_0x7f33('0x14')][_0x7f33('0x15')]);return _0x4148a9(_0x332be6[_0x7f33('0x14')][_0x7f33('0x15')]);}logger[_0x7f33('0x14')](_0x7f33('0xf'),_0x187345,_0x332be6['error'][_0x7f33('0x15')]);return _0x146cd8(_0x332be6[_0x7f33('0x14')][_0x7f33('0x15')]);}else{logger[_0x7f33('0xe')](_0x7f33('0xf'),_0x187345,_0x7f33('0x10'));_0x146cd8(_0x332be6['result'][_0x7f33('0x15')]);}})[_0x7f33('0x16')](function(_0x281c1a){logger[_0x7f33('0x14')]('CmList,\x20%s,\x20%s',_0x187345,_0x281c1a);_0x4148a9(_0x281c1a);});});} \ No newline at end of file +var _0xf28b=['CmList,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','http','redis','defaults','localhost','socket.io-emitter','register','then','CmList,\x20%s,\x20%s','request\x20sent'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xf28b,0x74));var _0xbf28=function(_0x3caf90,_0x24cd38){_0x3caf90=_0x3caf90-0x0;var _0x55ff94=_0xf28b[_0x3caf90];return _0x55ff94;};'use strict';var _=require(_0xbf28('0x0'));var util=require(_0xbf28('0x1'));var moment=require(_0xbf28('0x2'));var BPromise=require(_0xbf28('0x3'));var rs=require(_0xbf28('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf28('0x5'))['db'];var utils=require(_0xbf28('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbf28('0x7')]({'port':0x232a});config[_0xbf28('0x8')]=_[_0xbf28('0x9')](config['redis'],{'host':_0xbf28('0xa'),'port':0x18eb});var socket=require(_0xbf28('0xb'))(new Redis(config['redis']));require('./cmList.socket')[_0xbf28('0xc')](socket);function respondWithRpcPromise(_0x32e4cf,_0x14b821,_0x29c1b0){return new BPromise(function(_0x7b3322,_0x1e9e74){return client['request'](_0x32e4cf,_0x29c1b0)[_0xbf28('0xd')](function(_0x4bb2cf){logger['info'](_0xbf28('0xe'),_0x14b821,_0xbf28('0xf'));logger['debug'](_0xbf28('0x10'),_0x14b821,_0xbf28('0xf'),JSON['stringify'](_0x4bb2cf));if(_0x4bb2cf['error']){if(_0x4bb2cf[_0xbf28('0x11')][_0xbf28('0x12')]===0x1f4){logger[_0xbf28('0x11')]('CmList,\x20%s,\x20%s',_0x14b821,_0x4bb2cf[_0xbf28('0x11')][_0xbf28('0x13')]);return _0x1e9e74(_0x4bb2cf['error'][_0xbf28('0x13')]);}logger[_0xbf28('0x11')](_0xbf28('0xe'),_0x14b821,_0x4bb2cf['error'][_0xbf28('0x13')]);return _0x7b3322(_0x4bb2cf[_0xbf28('0x11')][_0xbf28('0x13')]);}else{logger[_0xbf28('0x14')](_0xbf28('0xe'),_0x14b821,'request\x20sent');_0x7b3322(_0x4bb2cf[_0xbf28('0x15')][_0xbf28('0x13')]);}})['catch'](function(_0x544f72){logger[_0xbf28('0x11')](_0xbf28('0xe'),_0x14b821,_0x544f72);_0x1e9e74(_0x544f72);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 676506e..2672629 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 _0x3984=['update','emit','removeListener','register','length','./cmList.events','save','remove'];(function(_0x52ebf1,_0x1039f0){var _0x4c7e89=function(_0x2a759e){while(--_0x2a759e){_0x52ebf1['push'](_0x52ebf1['shift']());}};_0x4c7e89(++_0x1039f0);}(_0x3984,0x1ad));var _0x4398=function(_0x49cb71,_0x2f0149){_0x49cb71=_0x49cb71-0x0;var _0x3a50fd=_0x3984[_0x49cb71];return _0x3a50fd;};'use strict';var CmListEvents=require(_0x4398('0x0'));var events=[_0x4398('0x1'),_0x4398('0x2'),_0x4398('0x3')];function createListener(_0x1d7b26,_0x558d15){return function(_0x22d2b6){_0x558d15[_0x4398('0x4')](_0x1d7b26,_0x22d2b6);};}function removeListener(_0x5e02af,_0x1303fd){return function(){CmListEvents[_0x4398('0x5')](_0x5e02af,_0x1303fd);};}exports[_0x4398('0x6')]=function(_0x257a01){for(var _0xcce27f=0x0,_0x25e7f6=events[_0x4398('0x7')];_0xcce27f<_0x25e7f6;_0xcce27f++){var _0x164af=events[_0xcce27f];var _0x3fa011=createListener('cmList:'+_0x164af,_0x257a01);CmListEvents['on'](_0x164af,_0x3fa011);}}; \ No newline at end of file +var _0xfded=['update','removeListener','cmList:','./cmList.events','remove'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfded,0xcb));var _0xdfde=function(_0x33337f,_0x5d7319){_0x33337f=_0x33337f-0x0;var _0x3d9d50=_0xfded[_0x33337f];return _0x3d9d50;};'use strict';var CmListEvents=require(_0xdfde('0x0'));var events=['save',_0xdfde('0x1'),_0xdfde('0x2')];function createListener(_0x293802,_0x3f9d60){return function(_0x318c3c){_0x3f9d60['emit'](_0x293802,_0x318c3c);};}function removeListener(_0x3ff733,_0x108090){return function(){CmListEvents[_0xdfde('0x3')](_0x3ff733,_0x108090);};}exports['register']=function(_0x51e6d5){for(var _0x41ff4a=0x0,_0x4735a3=events['length'];_0x41ff4a<_0x4735a3;_0x41ff4a++){var _0xc5565a=events[_0x41ff4a];var _0xfc5eb5=createListener(_0xdfde('0x4')+_0xc5565a,_0x51e6d5);CmListEvents['on'](_0xc5565a,_0xfc5eb5);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 88e68a2..4f0d7dd 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 _0xd1e1=['destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','post','create','addDisposition','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put','update','delete'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xd1e1,0xe3));var _0x1d1e=function(_0xabc23e,_0x3d3662){_0xabc23e=_0xabc23e-0x0;var _0x5991d4=_0xd1e1[_0xabc23e];return _0x5991d4;};'use strict';var multer=require(_0x1d1e('0x0'));var util=require(_0x1d1e('0x1'));var path=require(_0x1d1e('0x2'));var timeout=require(_0x1d1e('0x3'));var express=require(_0x1d1e('0x4'));var router=express[_0x1d1e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1d1e('0x6'));var config=require(_0x1d1e('0x7'));var controller=require('./cmList.controller');router[_0x1d1e('0x8')]('/',auth['isAuthenticated'](),controller[_0x1d1e('0x9')]);router[_0x1d1e('0x8')](_0x1d1e('0xa'),auth[_0x1d1e('0xb')](),controller['describe']);router['get'](_0x1d1e('0xc'),auth[_0x1d1e('0xb')](),controller['show']);router[_0x1d1e('0x8')](_0x1d1e('0xd'),auth['isAuthenticated'](),controller[_0x1d1e('0xe')]);router['get'](_0x1d1e('0xf'),auth[_0x1d1e('0xb')](),controller[_0x1d1e('0x10')]);router[_0x1d1e('0x8')]('/:id/contacts/csv',auth[_0x1d1e('0xb')](),controller[_0x1d1e('0x11')]);router[_0x1d1e('0x8')]('/:id/fields',auth[_0x1d1e('0xb')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x1d1e('0xb')](),controller['getAgents']);router[_0x1d1e('0x12')]('/',auth[_0x1d1e('0xb')](),controller[_0x1d1e('0x13')]);router[_0x1d1e('0x12')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x1d1e('0x14')]);router[_0x1d1e('0x12')](_0x1d1e('0xf'),auth['isAuthenticated'](),controller[_0x1d1e('0x15')]);router[_0x1d1e('0x12')](_0x1d1e('0x16'),auth['isAuthenticated'](),controller[_0x1d1e('0x17')]);router[_0x1d1e('0x12')](_0x1d1e('0x18'),auth[_0x1d1e('0xb')](),controller[_0x1d1e('0x19')]);router[_0x1d1e('0x1a')]('/:id',auth[_0x1d1e('0xb')](),controller[_0x1d1e('0x1b')]);router[_0x1d1e('0x1c')](_0x1d1e('0xc'),auth['isAuthenticated'](),controller[_0x1d1e('0x1d')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x1d1e('0x1e')]);router[_0x1d1e('0x1c')](_0x1d1e('0x18'),auth[_0x1d1e('0xb')](),controller[_0x1d1e('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x75cb=['connect-timeout','express','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','/:id/users','addAgents','delete','removeDispositions','removeAgents','exports','util','path'];(function(_0x2acd35,_0x2b21df){var _0x272693=function(_0x118994){while(--_0x118994){_0x2acd35['push'](_0x2acd35['shift']());}};_0x272693(++_0x2b21df);}(_0x75cb,0x14e));var _0xb75c=function(_0x2566a5,_0x5c487a){_0x2566a5=_0x2566a5-0x0;var _0x2bf75f=_0x75cb[_0x2566a5];return _0x2bf75f;};'use strict';var multer=require('multer');var util=require(_0xb75c('0x0'));var path=require(_0xb75c('0x1'));var timeout=require(_0xb75c('0x2'));var express=require(_0xb75c('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('./cmList.controller');router[_0xb75c('0x4')]('/',auth[_0xb75c('0x5')](),controller['index']);router['get'](_0xb75c('0x6'),auth[_0xb75c('0x5')](),controller[_0xb75c('0x7')]);router['get'](_0xb75c('0x8'),auth[_0xb75c('0x5')](),controller[_0xb75c('0x9')]);router['get']('/:id/dispositions',auth[_0xb75c('0x5')](),controller['getDispositions']);router[_0xb75c('0x4')](_0xb75c('0xa'),auth[_0xb75c('0x5')](),controller[_0xb75c('0xb')]);router[_0xb75c('0x4')](_0xb75c('0xc'),auth[_0xb75c('0x5')](),controller['getContactsCsv']);router[_0xb75c('0x4')](_0xb75c('0xd'),auth[_0xb75c('0x5')](),controller[_0xb75c('0xe')]);router[_0xb75c('0x4')]('/:id/users',auth[_0xb75c('0x5')](),controller[_0xb75c('0xf')]);router[_0xb75c('0x10')]('/',auth[_0xb75c('0x5')](),controller[_0xb75c('0x11')]);router[_0xb75c('0x10')](_0xb75c('0x12'),auth[_0xb75c('0x5')](),controller[_0xb75c('0x13')]);router[_0xb75c('0x10')](_0xb75c('0xa'),auth['isAuthenticated'](),controller[_0xb75c('0x14')]);router['post']('/:id/fields',auth['isAuthenticated'](),controller[_0xb75c('0x15')]);router['post'](_0xb75c('0x16'),auth[_0xb75c('0x5')](),controller[_0xb75c('0x17')]);router['put'](_0xb75c('0x8'),auth[_0xb75c('0x5')](),controller['update']);router[_0xb75c('0x18')](_0xb75c('0x8'),auth[_0xb75c('0x5')](),controller['destroy']);router['delete'](_0xb75c('0x12'),auth[_0xb75c('0x5')](),controller[_0xb75c('0x19')]);router[_0xb75c('0x18')](_0xb75c('0x16'),auth[_0xb75c('0x5')](),controller[_0xb75c('0x1a')]);module[_0xb75c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 80031de..f47d736 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 _0x31d0=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x50eba0,_0x3f92b4){var _0x21c82b=function(_0x2fb4ec){while(--_0x2fb4ec){_0x50eba0['push'](_0x50eba0['shift']());}};_0x21c82b(++_0x3f92b4);}(_0x31d0,0x121));var _0x031d=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0x31d0[_0x59b439];return _0x521ea3;};'use strict';var Sequelize=require(_0x031d('0x0'));module[_0x031d('0x1')]={'name':{'type':Sequelize[_0x031d('0x2')],'get':function(_0x6586be){return this[_0x031d('0x3')](_0x031d('0x4'));}},'field':{'type':Sequelize[_0x031d('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x031d('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6334=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x43fc2d,_0x3a8e88){var _0x5e608=function(_0x1ca17d){while(--_0x1ca17d){_0x43fc2d['push'](_0x43fc2d['shift']());}};_0x5e608(++_0x3a8e88);}(_0x6334,0x7f));var _0x4633=function(_0x5864ef,_0x496812){_0x5864ef=_0x5864ef-0x0;var _0x21c244=_0x6334[_0x5864ef];return _0x21c244;};'use strict';var Sequelize=require(_0x4633('0x0'));module[_0x4633('0x1')]={'name':{'type':Sequelize[_0x4633('0x2')],'get':function(_0x4c18a4){return this['getDataValue'](_0x4633('0x3'));}},'field':{'type':Sequelize[_0x4633('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x4633('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x4633('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 e76a8ce..3a43806 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 _0x9f62=['Condition','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body'];(function(_0x26e14d,_0x1ba410){var _0x5f29c1=function(_0x2af084){while(--_0x2af084){_0x26e14d['push'](_0x26e14d['shift']());}};_0x5f29c1(++_0x1ba410);}(_0x9f62,0x154));var _0x29f6=function(_0x35d5cf,_0xbb1fb5){_0x35d5cf=_0x35d5cf-0x0;var _0x31f9ed=_0x9f62[_0x35d5cf];return _0x31f9ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29f6('0x1'));var jsonpatch=require(_0x29f6('0x2'));var rp=require(_0x29f6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x29f6('0x4'));var util=require(_0x29f6('0x5'));var path=require(_0x29f6('0x6'));var sox=require(_0x29f6('0x7'));var csv=require('to-csv');var ejs=require(_0x29f6('0x8'));var fs=require('fs');var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x29f6('0xd'));var hardwareService=require(_0x29f6('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x29f6('0xf'))(_0x29f6('0x10'));var utils=require('../../config/utils');var config=require(_0x29f6('0x11'));var db=require(_0x29f6('0x12'))['db'];function respondWithStatusCode(_0x5cf872,_0x5b9b6a){_0x5b9b6a=_0x5b9b6a||0xcc;return function(_0x559585){if(_0x559585){return _0x5cf872['sendStatus'](_0x5b9b6a);}return _0x5cf872[_0x29f6('0x13')](_0x5b9b6a)[_0x29f6('0x14')]();};}function respondWithResult(_0x189344,_0x11a1fd){_0x11a1fd=_0x11a1fd||0xc8;return function(_0x17de6e){if(_0x17de6e){return _0x189344[_0x29f6('0x13')](_0x11a1fd)[_0x29f6('0x15')](_0x17de6e);}};}function respondWithFilteredResult(_0x2418ee,_0x1ae582){return function(_0x19331f){if(_0x19331f){var _0x28d314=_0x19331f[_0x29f6('0x16')],_0x370484=_0x1ae582[_0x29f6('0x17')],_0x1dde97=_0x1ae582[_0x29f6('0x17')]+_0x1ae582['limit'],_0x3a75d0;if(_0x1dde97>=_0x28d314){_0x1dde97=_0x28d314;_0x3a75d0=0xc8;}else{_0x3a75d0=0xce;}_0x2418ee['status'](_0x3a75d0);return _0x2418ee[_0x29f6('0x18')](_0x29f6('0x19'),_0x370484+'-'+_0x1dde97+'/'+_0x28d314)[_0x29f6('0x15')](_0x19331f);}return null;};}function patchUpdates(_0x5c8246){return function(_0xcb90){try{jsonpatch[_0x29f6('0x1a')](_0xcb90,_0x5c8246,!![]);}catch(_0x49252f){return BPromise[_0x29f6('0x1b')](_0x49252f);}return _0xcb90[_0x29f6('0x1c')]();};}function saveUpdates(_0x42a8fa,_0x41b9f0){return function(_0xb6e7a9){if(_0xb6e7a9){return _0xb6e7a9[_0x29f6('0x1d')](_0x42a8fa)['then'](function(_0xfb8fd2){return _0xfb8fd2;});}return null;};}function removeEntity(_0x59def4,_0x4acb15){return function(_0x470019){if(_0x470019){return _0x470019[_0x29f6('0x1e')]()[_0x29f6('0x1f')](function(){_0x59def4[_0x29f6('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c672e,_0x49f67d){return function(_0xd4179c){if(!_0xd4179c){_0x2c672e[_0x29f6('0x20')](0x194);}return _0xd4179c;};}function handleError(_0x4200cc,_0x1b80aa){_0x1b80aa=_0x1b80aa||0x1f4;return function(_0x4fc725){logger[_0x29f6('0x21')](_0x4fc725[_0x29f6('0x22')]);if(_0x4fc725['name']){delete _0x4fc725[_0x29f6('0x23')];}_0x4200cc[_0x29f6('0x13')](_0x1b80aa)[_0x29f6('0x24')](_0x4fc725);};}exports[_0x29f6('0x1d')]=function(_0x84ccb7,_0x4333bc){if(_0x84ccb7[_0x29f6('0x25')]['id']){delete _0x84ccb7['body']['id'];}return db[_0x29f6('0x26')][_0x29f6('0x27')]({'where':{'id':_0x84ccb7[_0x29f6('0x28')]['id']}})[_0x29f6('0x1f')](handleEntityNotFound(_0x4333bc,null))[_0x29f6('0x1f')](saveUpdates(_0x84ccb7[_0x29f6('0x25')],null))[_0x29f6('0x1f')](respondWithResult(_0x4333bc,null))[_0x29f6('0x29')](handleError(_0x4333bc,null));};exports[_0x29f6('0x1e')]=function(_0x13a3a2,_0x2915bc){return db[_0x29f6('0x26')][_0x29f6('0x27')]({'where':{'id':_0x13a3a2[_0x29f6('0x28')]['id']}})[_0x29f6('0x1f')](handleEntityNotFound(_0x2915bc,null))[_0x29f6('0x1f')](removeEntity(_0x2915bc,null))[_0x29f6('0x29')](handleError(_0x2915bc,null));}; \ No newline at end of file +var _0x55e0=['body','Condition','find','catch','params','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','error','stack','name','send'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x55e0,0xdc));var _0x055e=function(_0x58d4ce,_0x154425){_0x58d4ce=_0x58d4ce-0x0;var _0x3c5170=_0x55e0[_0x58d4ce];return _0x3c5170;};'use strict';var pdf=require(_0x055e('0x0'));var emlformat=require(_0x055e('0x1'));var rimraf=require(_0x055e('0x2'));var zipdir=require(_0x055e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x055e('0x4'));var BPromise=require(_0x055e('0x5'));var Mustache=require(_0x055e('0x6'));var util=require(_0x055e('0x7'));var path=require(_0x055e('0x8'));var sox=require(_0x055e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x055e('0xa'));var squel=require('squel');var crypto=require(_0x055e('0xb'));var jsforce=require(_0x055e('0xc'));var deskjs=require(_0x055e('0xd'));var toCsv=require(_0x055e('0xe'));var querystring=require(_0x055e('0xf'));var Papa=require('papaparse');var authService=require(_0x055e('0x10'));var hardwareService=require(_0x055e('0x11'));var Redis=require(_0x055e('0x12'));var qs=require(_0x055e('0x13'));var logger=require(_0x055e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x055e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c44b2,_0x466da3){_0x466da3=_0x466da3||0xcc;return function(_0x72d424){if(_0x72d424){return _0x3c44b2[_0x055e('0x16')](_0x466da3);}return _0x3c44b2[_0x055e('0x17')](_0x466da3)[_0x055e('0x18')]();};}function respondWithResult(_0x236a2b,_0x4bca5d){_0x4bca5d=_0x4bca5d||0xc8;return function(_0x14064d){if(_0x14064d){return _0x236a2b[_0x055e('0x17')](_0x4bca5d)[_0x055e('0x19')](_0x14064d);}};}function respondWithFilteredResult(_0xe41bae,_0x222817){return function(_0x56af18){if(_0x56af18){var _0x230674=_0x56af18[_0x055e('0x1a')],_0x2fe55f=_0x222817[_0x055e('0x1b')],_0x111cdb=_0x222817[_0x055e('0x1b')]+_0x222817[_0x055e('0x1c')],_0x599533;if(_0x111cdb>=_0x230674){_0x111cdb=_0x230674;_0x599533=0xc8;}else{_0x599533=0xce;}_0xe41bae[_0x055e('0x17')](_0x599533);return _0xe41bae['set'](_0x055e('0x1d'),_0x2fe55f+'-'+_0x111cdb+'/'+_0x230674)[_0x055e('0x19')](_0x56af18);}return null;};}function patchUpdates(_0x2f4a06){return function(_0x2ed6fb){try{jsonpatch['apply'](_0x2ed6fb,_0x2f4a06,!![]);}catch(_0x4004ce){return BPromise[_0x055e('0x1e')](_0x4004ce);}return _0x2ed6fb['save']();};}function saveUpdates(_0xe2b7b5,_0x4412f9){return function(_0x10258f){if(_0x10258f){return _0x10258f[_0x055e('0x1f')](_0xe2b7b5)[_0x055e('0x20')](function(_0x4675ff){return _0x4675ff;});}return null;};}function removeEntity(_0x53b766,_0x31c355){return function(_0x2f0346){if(_0x2f0346){return _0x2f0346[_0x055e('0x21')]()['then'](function(){_0x53b766[_0x055e('0x17')](0xcc)[_0x055e('0x18')]();});}};}function handleEntityNotFound(_0x32c64e,_0x37243b){return function(_0x51df23){if(!_0x51df23){_0x32c64e[_0x055e('0x16')](0x194);}return _0x51df23;};}function handleError(_0x56c372,_0x33ffdf){_0x33ffdf=_0x33ffdf||0x1f4;return function(_0x42a6aa){logger[_0x055e('0x22')](_0x42a6aa[_0x055e('0x23')]);if(_0x42a6aa[_0x055e('0x24')]){delete _0x42a6aa[_0x055e('0x24')];}_0x56c372['status'](_0x33ffdf)[_0x055e('0x25')](_0x42a6aa);};}exports[_0x055e('0x1f')]=function(_0x2a82f8,_0x4b5891){if(_0x2a82f8[_0x055e('0x26')]['id']){delete _0x2a82f8[_0x055e('0x26')]['id'];}return db[_0x055e('0x27')][_0x055e('0x28')]({'where':{'id':_0x2a82f8['params']['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x4b5891,null))['then'](saveUpdates(_0x2a82f8[_0x055e('0x26')],null))[_0x055e('0x20')](respondWithResult(_0x4b5891,null))[_0x055e('0x29')](handleError(_0x4b5891,null));};exports[_0x055e('0x21')]=function(_0x1610f1,_0x5c0e76){return db[_0x055e('0x27')][_0x055e('0x28')]({'where':{'id':_0x1610f1[_0x055e('0x2a')]['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x5c0e76,null))[_0x055e('0x20')](removeEntity(_0x5c0e76,null))[_0x055e('0x29')](handleError(_0x5c0e76,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 24a57c5..8e23486 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 _0x2a74=['api','moment','bluebird','request-promise','./condition.attributes','define','Condition','tools_conditions','lodash','../../config/logger'];(function(_0x4aa155,_0x291fb9){var _0x1db59d=function(_0x332572){while(--_0x332572){_0x4aa155['push'](_0x4aa155['shift']());}};_0x1db59d(++_0x291fb9);}(_0x2a74,0xf8));var _0x42a7=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0x2a74[_0x2e6dbf];return _0x2680e5;};'use strict';var _=require(_0x42a7('0x0'));var util=require('util');var logger=require(_0x42a7('0x1'))(_0x42a7('0x2'));var moment=require(_0x42a7('0x3'));var BPromise=require(_0x42a7('0x4'));var rp=require(_0x42a7('0x5'));var attributes=require(_0x42a7('0x6'));module['exports']=function(_0xf7c057,_0x535e96){return _0xf7c057[_0x42a7('0x7')](_0x42a7('0x8'),attributes,{'tableName':_0x42a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ade=['request-promise','./condition.attributes','exports','define','Condition','util','api','moment','bluebird'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0x3ade,0x95));var _0xe3ad=function(_0x23f132,_0x5d919e){_0x23f132=_0x23f132-0x0;var _0x2b10bf=_0x3ade[_0x23f132];return _0x2b10bf;};'use strict';var _=require('lodash');var util=require(_0xe3ad('0x0'));var logger=require('../../config/logger')(_0xe3ad('0x1'));var moment=require(_0xe3ad('0x2'));var BPromise=require(_0xe3ad('0x3'));var rp=require(_0xe3ad('0x4'));var attributes=require(_0xe3ad('0x5'));module[_0xe3ad('0x6')]=function(_0x685ea8,_0x441ec6){return _0x685ea8[_0xe3ad('0x7')](_0xe3ad('0x8'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 26f11eb..ce33a93 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 _0x1804=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4f41a4,_0x2e8ff5){var _0x342ff8=function(_0x5b40d9){while(--_0x5b40d9){_0x4f41a4['push'](_0x4f41a4['shift']());}};_0x342ff8(++_0x2e8ff5);}(_0x1804,0x188));var _0x4180=function(_0x3eb348,_0x10273e){_0x3eb348=_0x3eb348-0x0;var _0x4854fb=_0x1804[_0x3eb348];return _0x4854fb;};'use strict';var _=require(_0x4180('0x0'));var util=require(_0x4180('0x1'));var moment=require(_0x4180('0x2'));var BPromise=require(_0x4180('0x3'));var rs=require(_0x4180('0x4'));var fs=require('fs');var Redis=require(_0x4180('0x5'));var db=require(_0x4180('0x6'))['db'];var utils=require(_0x4180('0x7'));var logger=require(_0x4180('0x8'))(_0x4180('0x9'));var config=require(_0x4180('0xa'));var jayson=require(_0x4180('0xb'));var client=jayson[_0x4180('0xc')][_0x4180('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15c9d8,_0x3d71a1,_0x1d56a1){return new BPromise(function(_0x153eb6,_0x4ff246){return client[_0x4180('0xe')](_0x15c9d8,_0x1d56a1)['then'](function(_0x4f6144){logger[_0x4180('0xf')](_0x4180('0x10'),_0x3d71a1,_0x4180('0x11'));logger[_0x4180('0x12')](_0x4180('0x13'),_0x3d71a1,_0x4180('0x11'),JSON['stringify'](_0x4f6144));if(_0x4f6144['error']){if(_0x4f6144[_0x4180('0x14')][_0x4180('0x15')]===0x1f4){logger[_0x4180('0x14')]('Condition,\x20%s,\x20%s',_0x3d71a1,_0x4f6144[_0x4180('0x14')]['message']);return _0x4ff246(_0x4f6144[_0x4180('0x14')][_0x4180('0x16')]);}logger[_0x4180('0x14')]('Condition,\x20%s,\x20%s',_0x3d71a1,_0x4f6144['error'][_0x4180('0x16')]);return _0x153eb6(_0x4f6144[_0x4180('0x14')][_0x4180('0x16')]);}else{logger['info'](_0x4180('0x10'),_0x3d71a1,_0x4180('0x11'));_0x153eb6(_0x4f6144[_0x4180('0x17')][_0x4180('0x16')]);}})[_0x4180('0x18')](function(_0x2789e1){logger['error'](_0x4180('0x10'),_0x3d71a1,_0x2789e1);_0x4ff246(_0x2789e1);});});} \ No newline at end of file +var _0x5a47=['http','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1b07fd,_0x23e934){var _0x47a06a=function(_0x36add1){while(--_0x36add1){_0x1b07fd['push'](_0x1b07fd['shift']());}};_0x47a06a(++_0x23e934);}(_0x5a47,0x16b));var _0x75a4=function(_0x76e3a6,_0x3ce9bc){_0x76e3a6=_0x76e3a6-0x0;var _0x536c29=_0x5a47[_0x76e3a6];return _0x536c29;};'use strict';var _=require(_0x75a4('0x0'));var util=require(_0x75a4('0x1'));var moment=require(_0x75a4('0x2'));var BPromise=require(_0x75a4('0x3'));var rs=require(_0x75a4('0x4'));var fs=require('fs');var Redis=require(_0x75a4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x75a4('0x6'));var logger=require(_0x75a4('0x7'))(_0x75a4('0x8'));var config=require(_0x75a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x75a4('0xa')][_0x75a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x75ae85,_0x619c2d,_0x54f9bd){return new BPromise(function(_0x137cfe,_0x500a48){return client[_0x75a4('0xc')](_0x75ae85,_0x54f9bd)['then'](function(_0x1a2b9d){logger['info'](_0x75a4('0xd'),_0x619c2d,_0x75a4('0xe'));logger[_0x75a4('0xf')](_0x75a4('0x10'),_0x619c2d,_0x75a4('0xe'),JSON['stringify'](_0x1a2b9d));if(_0x1a2b9d[_0x75a4('0x11')]){if(_0x1a2b9d[_0x75a4('0x11')]['code']===0x1f4){logger[_0x75a4('0x11')](_0x75a4('0xd'),_0x619c2d,_0x1a2b9d['error'][_0x75a4('0x12')]);return _0x500a48(_0x1a2b9d[_0x75a4('0x11')][_0x75a4('0x12')]);}logger[_0x75a4('0x11')](_0x75a4('0xd'),_0x619c2d,_0x1a2b9d[_0x75a4('0x11')][_0x75a4('0x12')]);return _0x137cfe(_0x1a2b9d[_0x75a4('0x11')][_0x75a4('0x12')]);}else{logger[_0x75a4('0x13')](_0x75a4('0xd'),_0x619c2d,_0x75a4('0xe'));_0x137cfe(_0x1a2b9d[_0x75a4('0x14')][_0x75a4('0x12')]);}})[_0x75a4('0x15')](function(_0x4cdb36){logger[_0x75a4('0x11')](_0x75a4('0xd'),_0x619c2d,_0x4cdb36);_0x500a48(_0x4cdb36);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 20c552c..56e63d0 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 _0xfa57=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x226c11,_0x14c0a4){var _0x4dc73e=function(_0x17e242){while(--_0x17e242){_0x226c11['push'](_0x226c11['shift']());}};_0x4dc73e(++_0x14c0a4);}(_0xfa57,0x9b));var _0x7fa5=function(_0x1208bf,_0x547f33){_0x1208bf=_0x1208bf-0x0;var _0x5aa0ce=_0xfa57[_0x1208bf];return _0x5aa0ce;};'use strict';var multer=require(_0x7fa5('0x0'));var util=require(_0x7fa5('0x1'));var path=require(_0x7fa5('0x2'));var timeout=require(_0x7fa5('0x3'));var express=require(_0x7fa5('0x4'));var router=express[_0x7fa5('0x5')]();var auth=require(_0x7fa5('0x6'));var interaction=require(_0x7fa5('0x7'));var config=require(_0x7fa5('0x8'));var controller=require(_0x7fa5('0x9'));router['put'](_0x7fa5('0xa'),auth[_0x7fa5('0xb')](),controller[_0x7fa5('0xc')]);router[_0x7fa5('0xd')](_0x7fa5('0xa'),auth[_0x7fa5('0xb')](),controller[_0x7fa5('0xe')]);module[_0x7fa5('0xf')]=router; \ No newline at end of file +var _0xc309=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','util'];(function(_0x155ce3,_0x5a20c1){var _0x18f90d=function(_0x445647){while(--_0x445647){_0x155ce3['push'](_0x155ce3['shift']());}};_0x18f90d(++_0x5a20c1);}(_0xc309,0x10f));var _0x9c30=function(_0xdd94b2,_0x33b0ea){_0xdd94b2=_0xdd94b2-0x0;var _0x439b61=_0xc309[_0xdd94b2];return _0x439b61;};'use strict';var multer=require('multer');var util=require(_0x9c30('0x0'));var path=require(_0x9c30('0x1'));var timeout=require(_0x9c30('0x2'));var express=require(_0x9c30('0x3'));var router=express[_0x9c30('0x4')]();var auth=require(_0x9c30('0x5'));var interaction=require(_0x9c30('0x6'));var config=require(_0x9c30('0x7'));var controller=require(_0x9c30('0x8'));router[_0x9c30('0x9')](_0x9c30('0xa'),auth['isAuthenticated'](),controller[_0x9c30('0xb')]);router[_0x9c30('0xc')]('/:id',auth[_0x9c30('0xd')](),controller[_0x9c30('0xe')]);module[_0x9c30('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index d589c7a..b5534ee 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 _0xd209=['exports','STRING','name','sequelize'];(function(_0x1fc3e4,_0x1ac06f){var _0x4bde37=function(_0x117023){while(--_0x117023){_0x1fc3e4['push'](_0x1fc3e4['shift']());}};_0x4bde37(++_0x1ac06f);}(_0xd209,0x1a7));var _0x9d20=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xd209[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x9d20('0x0'));module[_0x9d20('0x1')]={'name':{'type':Sequelize[_0x9d20('0x2')],'allowNull':![],'unique':_0x9d20('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6e26=['name','STRING'];(function(_0x1861a5,_0x2f9255){var _0x42b960=function(_0x264f19){while(--_0x264f19){_0x1861a5['push'](_0x1861a5['shift']());}};_0x42b960(++_0x2f9255);}(_0x6e26,0x197));var _0x66e2=function(_0x552cff,_0x16167f){_0x552cff=_0x552cff-0x0;var _0x19c90a=_0x6e26[_0x552cff];return _0x19c90a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x66e2('0x0')],'allowNull':![],'unique':_0x66e2('0x1')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 83eb340..8f5ae45 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 _0x87d3=['stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','map','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','count','offset','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','Dashboard','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s'];(function(_0xa2507b,_0x2cc5b9){var _0x461469=function(_0xce130c){while(--_0xce130c){_0xa2507b['push'](_0xa2507b['shift']());}};_0x461469(++_0x2cc5b9);}(_0x87d3,0x86));var _0x387d=function(_0x323d3a,_0x325482){_0x323d3a=_0x323d3a-0x0;var _0x24847a=_0x87d3[_0x323d3a];return _0x24847a;};'use strict';var pdf=require(_0x387d('0x0'));var emlformat=require(_0x387d('0x1'));var rimraf=require(_0x387d('0x2'));var zipdir=require(_0x387d('0x3'));var jsonpatch=require(_0x387d('0x4'));var rp=require(_0x387d('0x5'));var moment=require('moment');var BPromise=require(_0x387d('0x6'));var Mustache=require('mustache');var util=require(_0x387d('0x7'));var path=require(_0x387d('0x8'));var sox=require(_0x387d('0x9'));var csv=require('to-csv');var ejs=require(_0x387d('0xa'));var fs=require('fs');var _=require(_0x387d('0xb'));var squel=require(_0x387d('0xc'));var crypto=require(_0x387d('0xd'));var jsforce=require(_0x387d('0xe'));var deskjs=require(_0x387d('0xf'));var toCsv=require(_0x387d('0x10'));var querystring=require(_0x387d('0x11'));var Papa=require(_0x387d('0x12'));var authService=require(_0x387d('0x13'));var hardwareService=require(_0x387d('0x14'));var Redis=require('ioredis');var qs=require(_0x387d('0x15'));var logger=require(_0x387d('0x16'))(_0x387d('0x17'));var utils=require(_0x387d('0x18'));var config=require(_0x387d('0x19'));var db=require(_0x387d('0x1a'))['db'];config[_0x387d('0x1b')]=_[_0x387d('0x1c')](config[_0x387d('0x1b')],{'host':_0x387d('0x1d'),'port':0x18eb});var socket=require(_0x387d('0x1e'))(new Redis(config[_0x387d('0x1b')]));require(_0x387d('0x1f'))[_0x387d('0x20')](socket);function respondWithStatusCode(_0x11c3bd,_0x51000d){_0x51000d=_0x51000d||0xcc;return function(_0x4914a8){if(_0x4914a8){return _0x11c3bd[_0x387d('0x21')](_0x51000d);}return _0x11c3bd['status'](_0x51000d)['end']();};}function respondWithResult(_0x516b42,_0xf6f574){_0xf6f574=_0xf6f574||0xc8;return function(_0x316368){if(_0x316368){return _0x516b42[_0x387d('0x22')](_0xf6f574)[_0x387d('0x23')](_0x316368);}};}function respondWithFilteredResult(_0x3cd7ce,_0x396328){return function(_0x3bbf9f){if(_0x3bbf9f){var _0x1caada=_0x3bbf9f[_0x387d('0x24')],_0x560b1c=_0x396328['offset'],_0xf8ae7b=_0x396328[_0x387d('0x25')]+_0x396328['limit'],_0xa50585;if(_0xf8ae7b>=_0x1caada){_0xf8ae7b=_0x1caada;_0xa50585=0xc8;}else{_0xa50585=0xce;}_0x3cd7ce[_0x387d('0x22')](_0xa50585);return _0x3cd7ce['set'](_0x387d('0x26'),_0x560b1c+'-'+_0xf8ae7b+'/'+_0x1caada)[_0x387d('0x23')](_0x3bbf9f);}return null;};}function patchUpdates(_0x2abd07){return function(_0x37b84b){try{jsonpatch[_0x387d('0x27')](_0x37b84b,_0x2abd07,!![]);}catch(_0x5c733b){return BPromise['reject'](_0x5c733b);}return _0x37b84b[_0x387d('0x28')]();};}function saveUpdates(_0x7799a7,_0x2f2827){return function(_0x580a6e){if(_0x580a6e){return _0x580a6e[_0x387d('0x29')](_0x7799a7)[_0x387d('0x2a')](function(_0x3e5620){return _0x3e5620;});}return null;};}function removeEntity(_0x2be266,_0x36ee8b){return function(_0x5569db){if(_0x5569db){return _0x5569db['destroy']()['then'](function(){var _0x463121=_0x5569db['get']({'plain':!![]});var _0x5c567b='CustomDashboards';return db['UserProfileResource'][_0x387d('0x2b')]({'where':{'type':_0x5c567b,'resourceId':_0x463121['id']}})[_0x387d('0x2a')](function(){return _0x5569db;});})[_0x387d('0x2a')](function(){_0x2be266[_0x387d('0x22')](0xcc)[_0x387d('0x2c')]();});}};}function handleEntityNotFound(_0xe0982e,_0x1d3f3a){return function(_0x2df701){if(!_0x2df701){_0xe0982e[_0x387d('0x21')](0x194);}return _0x2df701;};}function handleError(_0x270231,_0x25214f){_0x25214f=_0x25214f||0x1f4;return function(_0x22a7a6){logger[_0x387d('0x2d')](_0x22a7a6[_0x387d('0x2e')]);if(_0x22a7a6[_0x387d('0x2f')]){delete _0x22a7a6[_0x387d('0x2f')];}_0x270231['status'](_0x25214f)[_0x387d('0x30')](_0x22a7a6);};}exports[_0x387d('0x31')]=function(_0x4495fb,_0x588feb){var _0x370689={},_0x452a11={},_0x386af6={'count':0x0,'rows':[]};var _0x23a388=db[_0x387d('0x32')]['rawAttributes'];_0x452a11[_0x387d('0x33')]=_[_0x387d('0x34')](_0x23a388);_0x452a11['query']=_['keys'](_0x4495fb[_0x387d('0x35')]);_0x452a11[_0x387d('0x36')]=_[_0x387d('0x37')](_0x452a11[_0x387d('0x33')],_0x452a11[_0x387d('0x35')]);_0x370689[_0x387d('0x38')]=_['intersection'](_0x452a11[_0x387d('0x33')],qs[_0x387d('0x39')](_0x4495fb[_0x387d('0x35')][_0x387d('0x39')]));_0x370689[_0x387d('0x38')]=_0x370689[_0x387d('0x38')][_0x387d('0x3a')]?_0x370689['attributes']:_0x452a11[_0x387d('0x33')];if(!_0x4495fb[_0x387d('0x35')][_0x387d('0x3b')](_0x387d('0x3c'))){_0x370689[_0x387d('0x3d')]=qs[_0x387d('0x3d')](_0x4495fb['query']['limit']);_0x370689['offset']=qs['offset'](_0x4495fb[_0x387d('0x35')][_0x387d('0x25')]);}_0x370689['order']=qs[_0x387d('0x3e')](_0x4495fb[_0x387d('0x35')]['sort']);_0x370689[_0x387d('0x3f')]=qs[_0x387d('0x36')](_[_0x387d('0x40')](_0x4495fb['query'],_0x452a11[_0x387d('0x36')]));if(_0x4495fb['query'][_0x387d('0x41')]){_0x370689[_0x387d('0x3f')]=_[_0x387d('0x42')](_0x370689[_0x387d('0x3f')],{'$or':_['map'](_0x23a388,function(_0xc2c15b){if(_0xc2c15b[_0x387d('0x43')]['key']!==_0x387d('0x44')){var _0x4af689={};_0x4af689[_0xc2c15b[_0x387d('0x45')]]={'$like':'%'+_0x4495fb[_0x387d('0x35')][_0x387d('0x41')]+'%'};return _0x4af689;}})});}_0x370689=_['merge']({},_0x370689,_0x4495fb[_0x387d('0x46')]);var _0x2c0e3b={'where':_0x370689[_0x387d('0x3f')]};return db['Dashboard'][_0x387d('0x24')](_0x2c0e3b)['then'](function(_0x564b18){_0x386af6[_0x387d('0x24')]=_0x564b18;if(_0x4495fb[_0x387d('0x35')][_0x387d('0x47')]){_0x370689[_0x387d('0x48')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x370689);})[_0x387d('0x2a')](function(_0x42d496){_0x386af6[_0x387d('0x49')]=_0x42d496;return _0x386af6;})[_0x387d('0x2a')](respondWithFilteredResult(_0x588feb,_0x370689))[_0x387d('0x4a')](handleError(_0x588feb,null));};exports[_0x387d('0x4b')]=function(_0x4e78c6,_0x510c17){var _0x32bfb6={'raw':![],'where':{'id':_0x4e78c6[_0x387d('0x4c')]['id']}},_0x28feb0={};_0x28feb0['model']=_[_0x387d('0x34')](db['Dashboard'][_0x387d('0x4d')]);_0x28feb0[_0x387d('0x35')]=_[_0x387d('0x34')](_0x4e78c6['query']);_0x28feb0[_0x387d('0x36')]=_[_0x387d('0x37')](_0x28feb0['model'],_0x28feb0[_0x387d('0x35')]);_0x32bfb6[_0x387d('0x38')]=_['intersection'](_0x28feb0[_0x387d('0x33')],qs[_0x387d('0x39')](_0x4e78c6[_0x387d('0x35')][_0x387d('0x39')]));_0x32bfb6['attributes']=_0x32bfb6[_0x387d('0x38')]['length']?_0x32bfb6[_0x387d('0x38')]:_0x28feb0[_0x387d('0x33')];if(_0x4e78c6[_0x387d('0x35')]['includeAll']){_0x32bfb6[_0x387d('0x48')]=[{'all':!![]}];}_0x32bfb6=_[_0x387d('0x42')]({},_0x32bfb6,_0x4e78c6[_0x387d('0x46')]);return db[_0x387d('0x32')][_0x387d('0x4e')](_0x32bfb6)[_0x387d('0x2a')](handleEntityNotFound(_0x510c17,null))[_0x387d('0x2a')](respondWithResult(_0x510c17,null))[_0x387d('0x4a')](handleError(_0x510c17,null));};exports[_0x387d('0x4f')]=function(_0x27fa45,_0x298dd4){return db['Dashboard'][_0x387d('0x4f')](_0x27fa45[_0x387d('0x50')],{})[_0x387d('0x2a')](function(_0x59d681){var _0x58d52b=_0x27fa45['user'][_0x387d('0x51')]({'plain':!![]});if(!_0x58d52b)throw new Error(_0x387d('0x52'));if(_0x58d52b[_0x387d('0x53')]===_0x387d('0x54')){var _0x36c35a=_0x59d681[_0x387d('0x51')]({'plain':!![]});var _0x1eee99=_0x387d('0x55');return db[_0x387d('0x56')][_0x387d('0x4e')]({'where':{'name':_0x1eee99,'userProfileId':_0x58d52b[_0x387d('0x57')]},'raw':!![]})[_0x387d('0x2a')](function(_0x3b3377){if(_0x3b3377&&_0x3b3377[_0x387d('0x58')]===0x0){return db[_0x387d('0x59')][_0x387d('0x4f')]({'name':_0x36c35a[_0x387d('0x2f')],'resourceId':_0x36c35a['id'],'type':_0x3b3377[_0x387d('0x2f')],'sectionId':_0x3b3377['id']},{})[_0x387d('0x2a')](function(){return _0x59d681;});}else{return _0x59d681;}})['catch'](function(_0x2e8d4e){logger[_0x387d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e8d4e);throw _0x2e8d4e;});}return _0x59d681;})['then'](respondWithResult(_0x298dd4,0xc9))[_0x387d('0x4a')](handleError(_0x298dd4,null));};exports[_0x387d('0x5a')]=function(_0x2bb7e3,_0x5cc418){var _0x2c050c={'raw':![],'where':{'id':_0x2bb7e3[_0x387d('0x4c')]['id']}},_0x1bccb0={};_0x1bccb0[_0x387d('0x33')]=_[_0x387d('0x34')](db[_0x387d('0x32')][_0x387d('0x4d')]);_0x2c050c[_0x387d('0x38')]=_[_0x387d('0x37')](_0x1bccb0[_0x387d('0x33')],qs[_0x387d('0x39')](_0x2bb7e3['query'][_0x387d('0x39')]));_0x2c050c[_0x387d('0x38')]=_0x2c050c[_0x387d('0x38')][_0x387d('0x3a')]?_0x2c050c[_0x387d('0x38')]:_0x1bccb0[_0x387d('0x33')];if(_0x2bb7e3[_0x387d('0x35')][_0x387d('0x47')]){_0x2c050c[_0x387d('0x48')]=[{'all':!![]}];}_0x2c050c=_[_0x387d('0x42')]({},_0x2c050c,_0x2bb7e3[_0x387d('0x46')]);return db['Dashboard'][_0x387d('0x4e')](_0x2c050c)[_0x387d('0x2a')](handleEntityNotFound(_0x5cc418,null))['then'](function(_0x1827bb){if(_0x1827bb){var _0x34f83c=_0x1827bb[_0x387d('0x51')]({'plain':!![]});_0x34f83c=qs[_0x387d('0x5b')](_0x34f83c,['id',_0x387d('0x5c'),'updatedAt']);_0x2bb7e3[_0x387d('0x50')]=_['omit'](_0x2bb7e3[_0x387d('0x50')],['id','createdAt',_0x387d('0x5d')]);return db['Dashboard']['create'](_[_0x387d('0x42')](_0x34f83c,_0x2bb7e3['body']),{'include':_0x2bb7e3['query'][_0x387d('0x47')]?[{'all':!![]}]:undefined})[_0x387d('0x2a')](function(_0x372788){var _0x354cd9=_0x2bb7e3[_0x387d('0x54')]['get']({'plain':!![]});if(!_0x354cd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x354cd9[_0x387d('0x53')]===_0x387d('0x54')){var _0x5c8d9e=_0x372788[_0x387d('0x51')]({'plain':!![]});var _0x31afc8='CustomDashboards';return db['UserProfileSection'][_0x387d('0x4e')]({'where':{'name':_0x31afc8,'userProfileId':_0x354cd9[_0x387d('0x57')]},'raw':!![]})['then'](function(_0x4a4898){if(_0x4a4898&&_0x4a4898['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5c8d9e[_0x387d('0x2f')],'resourceId':_0x5c8d9e['id'],'type':_0x4a4898[_0x387d('0x2f')],'sectionId':_0x4a4898['id']},{})[_0x387d('0x2a')](function(){return _0x372788;});}else{return _0x372788;}})[_0x387d('0x4a')](function(_0x487e50){logger[_0x387d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x487e50);throw _0x487e50;});}return _0x372788;});}})[_0x387d('0x2a')](respondWithResult(_0x5cc418,0xc9))[_0x387d('0x4a')](handleError(_0x5cc418,null));};exports[_0x387d('0x29')]=function(_0x5f2589,_0xe7b916){if(_0x5f2589['body']['id']){delete _0x5f2589[_0x387d('0x50')]['id'];}return db[_0x387d('0x32')][_0x387d('0x4e')]({'where':{'id':_0x5f2589['params']['id']}})[_0x387d('0x2a')](handleEntityNotFound(_0xe7b916,null))[_0x387d('0x2a')](saveUpdates(_0x5f2589[_0x387d('0x50')],null))['then'](respondWithResult(_0xe7b916,null))[_0x387d('0x4a')](handleError(_0xe7b916,null));};exports[_0x387d('0x2b')]=function(_0x2f8794,_0x4b5bc0){return db[_0x387d('0x32')][_0x387d('0x4e')]({'where':{'id':_0x2f8794[_0x387d('0x4c')]['id']}})[_0x387d('0x2a')](handleEntityNotFound(_0x4b5bc0,null))['then'](removeEntity(_0x4b5bc0,null))[_0x387d('0x4a')](handleError(_0x4b5bc0,null));};function widgetAttributes(_0x4c64c9){try{switch(_0x4c64c9['type']){case'iframe':return[{'name':_0x387d('0x5e'),'value':_0x4c64c9[_0x387d('0x5e')]||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9[_0x387d('0x5f')][0x0]?_0x4c64c9[_0x387d('0x5f')][0x0][_0x387d('0x60')]:undefined)||_0x387d('0x61')}];case _0x387d('0x62'):return[{'name':_0x387d('0x63'),'value':_0x4c64c9[_0x387d('0x63')]||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9[_0x387d('0x5f')][0x0]?_0x4c64c9[_0x387d('0x5f')][0x0]['value']:undefined)||''}];case _0x387d('0x64'):return[{'name':_0x387d('0x65'),'value':_0x4c64c9[_0x387d('0x65')]||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9['attrs'][0x0]?_0x4c64c9[_0x387d('0x5f')][0x0]['value']:undefined)||_0x387d('0x66')},{'name':_0x387d('0x67'),'value':_0x4c64c9[_0x387d('0x67')]||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9[_0x387d('0x5f')][0x1]?_0x4c64c9[_0x387d('0x5f')][0x1][_0x387d('0x60')]:undefined)||_0x387d('0x68')},{'name':_0x387d('0x69'),'value':_0x4c64c9[_0x387d('0x69')]||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9[_0x387d('0x5f')][0x2]?_0x4c64c9[_0x387d('0x5f')][0x2][_0x387d('0x60')]:undefined)||0xc}];case _0x387d('0x6a'):return[{'name':_0x387d('0x6b'),'value':_0x4c64c9['attrMetric']||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9[_0x387d('0x5f')][0x0]?_0x4c64c9[_0x387d('0x5f')][0x0][_0x387d('0x60')]:undefined)||_0x387d('0x6c')},{'name':_0x387d('0x6d'),'value':_0x4c64c9['attrVoiceQueues']||(_0x4c64c9['attrs']&&_0x4c64c9[_0x387d('0x5f')][0x1]?_0x4c64c9[_0x387d('0x5f')][0x1][_0x387d('0x60')]:undefined)||[]},{'name':_0x387d('0x69'),'value':_0x4c64c9[_0x387d('0x69')]||(_0x4c64c9['attrs']&&_0x4c64c9['attrs'][0x2]?_0x4c64c9[_0x387d('0x5f')][0x2][_0x387d('0x60')]:undefined)||0x14}];case _0x387d('0x6e'):case _0x387d('0x6f'):return[{'name':_0x387d('0x70'),'value':_0x4c64c9[_0x387d('0x70')]||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9[_0x387d('0x5f')][0x0]?_0x4c64c9[_0x387d('0x5f')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x4c64c9['attrSerie2']||(_0x4c64c9['attrs']&&_0x4c64c9[_0x387d('0x5f')][0x1]?_0x4c64c9[_0x387d('0x5f')][0x1][_0x387d('0x60')]:undefined)||null},{'name':'attrSerie3','value':_0x4c64c9[_0x387d('0x71')]||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9[_0x387d('0x5f')][0x2]?_0x4c64c9[_0x387d('0x5f')][0x2][_0x387d('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4c64c9['attrVoiceQueues']||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9['attrs'][0x3]?_0x4c64c9['attrs'][0x3]['value']:undefined)||[]}];case _0x387d('0x72'):return[{'name':'attrReport','type':_0x4c64c9[_0x387d('0x73')]||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9['attrs'][0x0]?_0x4c64c9[_0x387d('0x5f')][0x0][_0x387d('0x43')]:undefined)||null,'value':_0x4c64c9['attrReport']||(_0x4c64c9[_0x387d('0x5f')]&&_0x4c64c9[_0x387d('0x5f')][0x0]?_0x4c64c9[_0x387d('0x5f')][0x0][_0x387d('0x60')]:undefined)||null},{'name':_0x387d('0x74'),'value':_0x4c64c9[_0x387d('0x74')]||(_0x4c64c9['attrs']&&_0x4c64c9[_0x387d('0x5f')][0x1]?_0x4c64c9[_0x387d('0x5f')][0x1][_0x387d('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x241303){logger['error'](_0x387d('0x75'),JSON[_0x387d('0x76')](_0x241303));return[];}}exports[_0x387d('0x77')]=function(_0x5ab643,_0x5b3a00,_0x39b336){if(_0x5ab643['body']['id']){delete _0x5ab643['body']['id'];}return db[_0x387d('0x32')][_0x387d('0x4e')]({'where':{'id':_0x5ab643[_0x387d('0x4c')]['id']}})[_0x387d('0x2a')](handleEntityNotFound(_0x5b3a00,null))['then'](function(_0xae78b7){if(_0xae78b7){_0x5ab643[_0x387d('0x50')][_0x387d('0x78')]=_0xae78b7['id'];_0x5ab643[_0x387d('0x50')][_0x387d('0x5f')]=widgetAttributes(_0x5ab643[_0x387d('0x50')]);return db[_0x387d('0x79')][_0x387d('0x4f')](_0x5ab643[_0x387d('0x50')]);}})[_0x387d('0x2a')](respondWithResult(_0x5b3a00,null))[_0x387d('0x4a')](handleError(_0x5b3a00,null));};exports[_0x387d('0x7a')]=function(_0x265738,_0x2ed597,_0x3532b9){var _0x35c06d={};var _0x489100={};var _0x7adea9;var _0x5f0827;return db[_0x387d('0x32')][_0x387d('0x7b')]({'where':{'id':_0x265738[_0x387d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2ed597,null))['then'](function(_0x2c87e3){if(_0x2c87e3){_0x7adea9=_0x2c87e3;_0x489100[_0x387d('0x33')]=_[_0x387d('0x34')](db[_0x387d('0x79')]['rawAttributes']);_0x489100[_0x387d('0x35')]=_['keys'](_0x265738[_0x387d('0x35')]);_0x489100[_0x387d('0x36')]=_[_0x387d('0x37')](_0x489100[_0x387d('0x33')],_0x489100[_0x387d('0x35')]);_0x35c06d['attributes']=_[_0x387d('0x37')](_0x489100[_0x387d('0x33')],qs['fields'](_0x265738['query'][_0x387d('0x39')]));_0x35c06d['attributes']=_0x35c06d[_0x387d('0x38')][_0x387d('0x3a')]?_0x35c06d[_0x387d('0x38')]:_0x489100[_0x387d('0x33')];_0x35c06d[_0x387d('0x7c')]=qs[_0x387d('0x3e')](_0x265738[_0x387d('0x35')][_0x387d('0x3e')]);_0x35c06d['where']=qs[_0x387d('0x36')](_['pick'](_0x265738[_0x387d('0x35')],_0x489100[_0x387d('0x36')]));if(_0x265738[_0x387d('0x35')][_0x387d('0x41')]){_0x35c06d[_0x387d('0x3f')]=_['merge'](_0x35c06d[_0x387d('0x3f')],{'$or':_[_0x387d('0x7d')](_0x35c06d[_0x387d('0x38')],function(_0x18ba5d){var _0x13e4f6={};_0x13e4f6[_0x18ba5d]={'$like':'%'+_0x265738[_0x387d('0x35')][_0x387d('0x41')]+'%'};return _0x13e4f6;})});}_0x35c06d=_['merge']({},_0x35c06d,_0x265738[_0x387d('0x46')]);return _0x7adea9[_0x387d('0x7a')](_0x35c06d);}})['then'](function(_0x2b0722){if(_0x2b0722){_0x5f0827=_0x2b0722[_0x387d('0x3a')];if(!_0x265738[_0x387d('0x35')][_0x387d('0x3b')]('nolimit')){_0x35c06d[_0x387d('0x3d')]=qs[_0x387d('0x3d')](_0x265738[_0x387d('0x35')][_0x387d('0x3d')]);_0x35c06d[_0x387d('0x25')]=qs['offset'](_0x265738[_0x387d('0x35')][_0x387d('0x25')]);}return _0x7adea9['getItems'](_0x35c06d);}})['then'](function(_0x1856f4){if(_0x1856f4){return _0x1856f4?{'count':_0x5f0827,'rows':_0x1856f4}:null;}})[_0x387d('0x2a')](respondWithResult(_0x2ed597,null))[_0x387d('0x4a')](handleError(_0x2ed597,null));}; \ No newline at end of file +var _0x41be=['merge','map','field','filter','options','count','includeAll','rows','catch','params','filters','length','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','type','attrUrl','attrs','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','value','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','end','sendStatus','error','stack','name','send','Dashboard','rawAttributes','model','keys','query','intersection','attributes','fields','order','sort','where','pick'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x41be,0x11d));var _0xe41b=function(_0x1d90ca,_0x3bab16){_0x1d90ca=_0x1d90ca-0x0;var _0x28872b=_0x41be[_0x1d90ca];return _0x28872b;};'use strict';var pdf=require(_0xe41b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe41b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe41b('0x2'));var moment=require(_0xe41b('0x3'));var BPromise=require(_0xe41b('0x4'));var Mustache=require(_0xe41b('0x5'));var util=require(_0xe41b('0x6'));var path=require(_0xe41b('0x7'));var sox=require(_0xe41b('0x8'));var csv=require(_0xe41b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe41b('0xa'));var squel=require(_0xe41b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe41b('0xc'));var toCsv=require(_0xe41b('0x9'));var querystring=require('querystring');var Papa=require(_0xe41b('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0xe41b('0xe'));var Redis=require(_0xe41b('0xf'));var qs=require(_0xe41b('0x10'));var logger=require('../../config/logger')(_0xe41b('0x11'));var utils=require(_0xe41b('0x12'));var config=require(_0xe41b('0x13'));var db=require(_0xe41b('0x14'))['db'];config[_0xe41b('0x15')]=_[_0xe41b('0x16')](config[_0xe41b('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xe41b('0x17'))(new Redis(config[_0xe41b('0x15')]));require(_0xe41b('0x18'))['register'](socket);function respondWithStatusCode(_0x3566bc,_0x47eaa0){_0x47eaa0=_0x47eaa0||0xcc;return function(_0x30733b){if(_0x30733b){return _0x3566bc['sendStatus'](_0x47eaa0);}return _0x3566bc[_0xe41b('0x19')](_0x47eaa0)['end']();};}function respondWithResult(_0x3dbcfe,_0x77a67a){_0x77a67a=_0x77a67a||0xc8;return function(_0xb9c112){if(_0xb9c112){return _0x3dbcfe[_0xe41b('0x19')](_0x77a67a)[_0xe41b('0x1a')](_0xb9c112);}};}function respondWithFilteredResult(_0x444c9a,_0x4fc1cf){return function(_0x326778){if(_0x326778){var _0x47ac66=_0x326778['count'],_0x5cdd89=_0x4fc1cf['offset'],_0x56aba7=_0x4fc1cf[_0xe41b('0x1b')]+_0x4fc1cf[_0xe41b('0x1c')],_0x164d7d;if(_0x56aba7>=_0x47ac66){_0x56aba7=_0x47ac66;_0x164d7d=0xc8;}else{_0x164d7d=0xce;}_0x444c9a[_0xe41b('0x19')](_0x164d7d);return _0x444c9a[_0xe41b('0x1d')](_0xe41b('0x1e'),_0x5cdd89+'-'+_0x56aba7+'/'+_0x47ac66)[_0xe41b('0x1a')](_0x326778);}return null;};}function patchUpdates(_0x5aa590){return function(_0xfd89c0){try{jsonpatch[_0xe41b('0x1f')](_0xfd89c0,_0x5aa590,!![]);}catch(_0x426fc0){return BPromise[_0xe41b('0x20')](_0x426fc0);}return _0xfd89c0[_0xe41b('0x21')]();};}function saveUpdates(_0x387425,_0x1ed32e){return function(_0x542a5b){if(_0x542a5b){return _0x542a5b[_0xe41b('0x22')](_0x387425)[_0xe41b('0x23')](function(_0x39366d){return _0x39366d;});}return null;};}function removeEntity(_0x38dc11,_0x470d82){return function(_0x553bc7){if(_0x553bc7){return _0x553bc7[_0xe41b('0x24')]()[_0xe41b('0x23')](function(){var _0x50f202=_0x553bc7['get']({'plain':!![]});var _0x2e4838=_0xe41b('0x25');return db[_0xe41b('0x26')][_0xe41b('0x24')]({'where':{'type':_0x2e4838,'resourceId':_0x50f202['id']}})[_0xe41b('0x23')](function(){return _0x553bc7;});})[_0xe41b('0x23')](function(){_0x38dc11['status'](0xcc)[_0xe41b('0x27')]();});}};}function handleEntityNotFound(_0x2f07fc,_0x465ac3){return function(_0x4c6336){if(!_0x4c6336){_0x2f07fc[_0xe41b('0x28')](0x194);}return _0x4c6336;};}function handleError(_0x3a5e95,_0x2c2561){_0x2c2561=_0x2c2561||0x1f4;return function(_0x536f54){logger[_0xe41b('0x29')](_0x536f54[_0xe41b('0x2a')]);if(_0x536f54[_0xe41b('0x2b')]){delete _0x536f54[_0xe41b('0x2b')];}_0x3a5e95['status'](_0x2c2561)[_0xe41b('0x2c')](_0x536f54);};}exports['index']=function(_0xd5f0c4,_0x37666c){var _0x2cbb0a={},_0x44cae4={},_0x3df31d={'count':0x0,'rows':[]};var _0x4d8bae=db[_0xe41b('0x2d')][_0xe41b('0x2e')];_0x44cae4[_0xe41b('0x2f')]=_[_0xe41b('0x30')](_0x4d8bae);_0x44cae4[_0xe41b('0x31')]=_[_0xe41b('0x30')](_0xd5f0c4[_0xe41b('0x31')]);_0x44cae4['filters']=_[_0xe41b('0x32')](_0x44cae4['model'],_0x44cae4[_0xe41b('0x31')]);_0x2cbb0a[_0xe41b('0x33')]=_[_0xe41b('0x32')](_0x44cae4[_0xe41b('0x2f')],qs['fields'](_0xd5f0c4[_0xe41b('0x31')][_0xe41b('0x34')]));_0x2cbb0a[_0xe41b('0x33')]=_0x2cbb0a[_0xe41b('0x33')]['length']?_0x2cbb0a['attributes']:_0x44cae4[_0xe41b('0x2f')];if(!_0xd5f0c4[_0xe41b('0x31')]['hasOwnProperty']('nolimit')){_0x2cbb0a[_0xe41b('0x1c')]=qs[_0xe41b('0x1c')](_0xd5f0c4[_0xe41b('0x31')][_0xe41b('0x1c')]);_0x2cbb0a[_0xe41b('0x1b')]=qs[_0xe41b('0x1b')](_0xd5f0c4[_0xe41b('0x31')][_0xe41b('0x1b')]);}_0x2cbb0a[_0xe41b('0x35')]=qs[_0xe41b('0x36')](_0xd5f0c4['query'][_0xe41b('0x36')]);_0x2cbb0a[_0xe41b('0x37')]=qs['filters'](_[_0xe41b('0x38')](_0xd5f0c4[_0xe41b('0x31')],_0x44cae4['filters']));if(_0xd5f0c4[_0xe41b('0x31')]['filter']){_0x2cbb0a[_0xe41b('0x37')]=_[_0xe41b('0x39')](_0x2cbb0a[_0xe41b('0x37')],{'$or':_[_0xe41b('0x3a')](_0x4d8bae,function(_0x16f100){if(_0x16f100['type']['key']!=='VIRTUAL'){var _0x3859fd={};_0x3859fd[_0x16f100[_0xe41b('0x3b')]]={'$like':'%'+_0xd5f0c4['query'][_0xe41b('0x3c')]+'%'};return _0x3859fd;}})});}_0x2cbb0a=_['merge']({},_0x2cbb0a,_0xd5f0c4[_0xe41b('0x3d')]);var _0x5f3df3={'where':_0x2cbb0a[_0xe41b('0x37')]};return db[_0xe41b('0x2d')][_0xe41b('0x3e')](_0x5f3df3)[_0xe41b('0x23')](function(_0x94d2f9){_0x3df31d[_0xe41b('0x3e')]=_0x94d2f9;if(_0xd5f0c4[_0xe41b('0x31')][_0xe41b('0x3f')]){_0x2cbb0a['include']=[{'all':!![]}];}return db[_0xe41b('0x2d')]['findAll'](_0x2cbb0a);})[_0xe41b('0x23')](function(_0x39e29e){_0x3df31d[_0xe41b('0x40')]=_0x39e29e;return _0x3df31d;})['then'](respondWithFilteredResult(_0x37666c,_0x2cbb0a))[_0xe41b('0x41')](handleError(_0x37666c,null));};exports['show']=function(_0xcdec17,_0x316d53){var _0x55a1a4={'raw':![],'where':{'id':_0xcdec17[_0xe41b('0x42')]['id']}},_0x2160ba={};_0x2160ba[_0xe41b('0x2f')]=_[_0xe41b('0x30')](db['Dashboard'][_0xe41b('0x2e')]);_0x2160ba['query']=_['keys'](_0xcdec17[_0xe41b('0x31')]);_0x2160ba[_0xe41b('0x43')]=_[_0xe41b('0x32')](_0x2160ba[_0xe41b('0x2f')],_0x2160ba[_0xe41b('0x31')]);_0x55a1a4['attributes']=_['intersection'](_0x2160ba[_0xe41b('0x2f')],qs[_0xe41b('0x34')](_0xcdec17[_0xe41b('0x31')]['fields']));_0x55a1a4[_0xe41b('0x33')]=_0x55a1a4[_0xe41b('0x33')][_0xe41b('0x44')]?_0x55a1a4[_0xe41b('0x33')]:_0x2160ba['model'];if(_0xcdec17[_0xe41b('0x31')][_0xe41b('0x3f')]){_0x55a1a4[_0xe41b('0x45')]=[{'all':!![]}];}_0x55a1a4=_['merge']({},_0x55a1a4,_0xcdec17[_0xe41b('0x3d')]);return db[_0xe41b('0x2d')]['find'](_0x55a1a4)['then'](handleEntityNotFound(_0x316d53,null))[_0xe41b('0x23')](respondWithResult(_0x316d53,null))[_0xe41b('0x41')](handleError(_0x316d53,null));};exports[_0xe41b('0x46')]=function(_0x14d640,_0x12951d){return db['Dashboard'][_0xe41b('0x46')](_0x14d640[_0xe41b('0x47')],{})[_0xe41b('0x23')](function(_0x1738ba){var _0x25368f=_0x14d640['user'][_0xe41b('0x48')]({'plain':!![]});if(!_0x25368f)throw new Error(_0xe41b('0x49'));if(_0x25368f[_0xe41b('0x4a')]===_0xe41b('0x4b')){var _0x22a564=_0x1738ba['get']({'plain':!![]});var _0x3902fa=_0xe41b('0x25');return db[_0xe41b('0x4c')][_0xe41b('0x4d')]({'where':{'name':_0x3902fa,'userProfileId':_0x25368f[_0xe41b('0x4e')]},'raw':!![]})['then'](function(_0x228733){if(_0x228733&&_0x228733[_0xe41b('0x4f')]===0x0){return db[_0xe41b('0x26')][_0xe41b('0x46')]({'name':_0x22a564['name'],'resourceId':_0x22a564['id'],'type':_0x228733['name'],'sectionId':_0x228733['id']},{})[_0xe41b('0x23')](function(){return _0x1738ba;});}else{return _0x1738ba;}})[_0xe41b('0x41')](function(_0x12b3ef){logger[_0xe41b('0x29')](_0xe41b('0x50'),_0x12b3ef);throw _0x12b3ef;});}return _0x1738ba;})['then'](respondWithResult(_0x12951d,0xc9))['catch'](handleError(_0x12951d,null));};exports[_0xe41b('0x51')]=function(_0x35f4bb,_0x59f5b1){var _0x1a3f0a={'raw':![],'where':{'id':_0x35f4bb[_0xe41b('0x42')]['id']}},_0x5c69a7={};_0x5c69a7[_0xe41b('0x2f')]=_[_0xe41b('0x30')](db[_0xe41b('0x2d')]['rawAttributes']);_0x1a3f0a['attributes']=_[_0xe41b('0x32')](_0x5c69a7[_0xe41b('0x2f')],qs[_0xe41b('0x34')](_0x35f4bb[_0xe41b('0x31')][_0xe41b('0x34')]));_0x1a3f0a['attributes']=_0x1a3f0a['attributes']['length']?_0x1a3f0a[_0xe41b('0x33')]:_0x5c69a7[_0xe41b('0x2f')];if(_0x35f4bb[_0xe41b('0x31')][_0xe41b('0x3f')]){_0x1a3f0a[_0xe41b('0x45')]=[{'all':!![]}];}_0x1a3f0a=_[_0xe41b('0x39')]({},_0x1a3f0a,_0x35f4bb['options']);return db[_0xe41b('0x2d')][_0xe41b('0x4d')](_0x1a3f0a)['then'](handleEntityNotFound(_0x59f5b1,null))[_0xe41b('0x23')](function(_0x400279){if(_0x400279){var _0x4ce638=_0x400279[_0xe41b('0x48')]({'plain':!![]});_0x4ce638=qs[_0xe41b('0x52')](_0x4ce638,['id',_0xe41b('0x53'),'updatedAt']);_0x35f4bb[_0xe41b('0x47')]=_['omit'](_0x35f4bb[_0xe41b('0x47')],['id',_0xe41b('0x53'),'updatedAt']);return db['Dashboard'][_0xe41b('0x46')](_[_0xe41b('0x39')](_0x4ce638,_0x35f4bb[_0xe41b('0x47')]),{'include':_0x35f4bb[_0xe41b('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0xe41b('0x23')](function(_0x5edba2){var _0x207b02=_0x35f4bb[_0xe41b('0x4b')][_0xe41b('0x48')]({'plain':!![]});if(!_0x207b02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x207b02[_0xe41b('0x4a')]===_0xe41b('0x4b')){var _0x1892d1=_0x5edba2[_0xe41b('0x48')]({'plain':!![]});var _0x37a2c8=_0xe41b('0x25');return db['UserProfileSection'][_0xe41b('0x4d')]({'where':{'name':_0x37a2c8,'userProfileId':_0x207b02[_0xe41b('0x4e')]},'raw':!![]})[_0xe41b('0x23')](function(_0x25925d){if(_0x25925d&&_0x25925d['autoAssociation']===0x0){return db[_0xe41b('0x26')][_0xe41b('0x46')]({'name':_0x1892d1[_0xe41b('0x2b')],'resourceId':_0x1892d1['id'],'type':_0x25925d['name'],'sectionId':_0x25925d['id']},{})['then'](function(){return _0x5edba2;});}else{return _0x5edba2;}})[_0xe41b('0x41')](function(_0x2a275f){logger['error'](_0xe41b('0x50'),_0x2a275f);throw _0x2a275f;});}return _0x5edba2;});}})['then'](respondWithResult(_0x59f5b1,0xc9))['catch'](handleError(_0x59f5b1,null));};exports['update']=function(_0xc6b8a1,_0x44b94d){if(_0xc6b8a1[_0xe41b('0x47')]['id']){delete _0xc6b8a1[_0xe41b('0x47')]['id'];}return db[_0xe41b('0x2d')][_0xe41b('0x4d')]({'where':{'id':_0xc6b8a1['params']['id']}})[_0xe41b('0x23')](handleEntityNotFound(_0x44b94d,null))['then'](saveUpdates(_0xc6b8a1[_0xe41b('0x47')],null))[_0xe41b('0x23')](respondWithResult(_0x44b94d,null))[_0xe41b('0x41')](handleError(_0x44b94d,null));};exports[_0xe41b('0x24')]=function(_0x4b760c,_0xe1508c){return db[_0xe41b('0x2d')][_0xe41b('0x4d')]({'where':{'id':_0x4b760c['params']['id']}})[_0xe41b('0x23')](handleEntityNotFound(_0xe1508c,null))[_0xe41b('0x23')](removeEntity(_0xe1508c,null))[_0xe41b('0x41')](handleError(_0xe1508c,null));};function widgetAttributes(_0x377aec){try{switch(_0x377aec[_0xe41b('0x54')]){case'iframe':return[{'name':_0xe41b('0x55'),'value':_0x377aec['attrUrl']||(_0x377aec['attrs']&&_0x377aec[_0xe41b('0x56')][0x0]?_0x377aec[_0xe41b('0x56')][0x0]['value']:undefined)||_0xe41b('0x57')}];case'custom':return[{'name':_0xe41b('0x58'),'value':_0x377aec[_0xe41b('0x58')]||(_0x377aec[_0xe41b('0x56')]&&_0x377aec['attrs'][0x0]?_0x377aec[_0xe41b('0x56')][0x0]['value']:undefined)||''}];case _0xe41b('0x59'):return[{'name':_0xe41b('0x5a'),'value':_0x377aec['attrHourFormat']||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x0]?_0x377aec[_0xe41b('0x56')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xe41b('0x5b'),'value':_0x377aec[_0xe41b('0x5b')]||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x1]?_0x377aec['attrs'][0x1]['value']:undefined)||_0xe41b('0x5c')},{'name':_0xe41b('0x5d'),'value':_0x377aec['attrFontSize']||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x2]?_0x377aec[_0xe41b('0x56')][0x2][_0xe41b('0x5e')]:undefined)||0xc}];case _0xe41b('0x5f'):return[{'name':'attrMetric','value':_0x377aec[_0xe41b('0x60')]||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x0]?_0x377aec[_0xe41b('0x56')][0x0]['value']:undefined)||_0xe41b('0x61')},{'name':_0xe41b('0x62'),'value':_0x377aec[_0xe41b('0x62')]||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x1]?_0x377aec[_0xe41b('0x56')][0x1][_0xe41b('0x5e')]:undefined)||[]},{'name':_0xe41b('0x5d'),'value':_0x377aec[_0xe41b('0x5d')]||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x2]?_0x377aec['attrs'][0x2][_0xe41b('0x5e')]:undefined)||0x14}];case _0xe41b('0x63'):case'pie-chart':return[{'name':'attrSerie1','value':_0x377aec[_0xe41b('0x64')]||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x0]?_0x377aec['attrs'][0x0][_0xe41b('0x5e')]:undefined)||_0xe41b('0x61')},{'name':_0xe41b('0x65'),'value':_0x377aec[_0xe41b('0x65')]||(_0x377aec[_0xe41b('0x56')]&&_0x377aec['attrs'][0x1]?_0x377aec['attrs'][0x1]['value']:undefined)||null},{'name':_0xe41b('0x66'),'value':_0x377aec[_0xe41b('0x66')]||(_0x377aec['attrs']&&_0x377aec[_0xe41b('0x56')][0x2]?_0x377aec['attrs'][0x2][_0xe41b('0x5e')]:undefined)||null},{'name':_0xe41b('0x62'),'value':_0x377aec['attrVoiceQueues']||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x3]?_0x377aec['attrs'][0x3][_0xe41b('0x5e')]:undefined)||[]}];case _0xe41b('0x67'):return[{'name':_0xe41b('0x68'),'type':_0x377aec[_0xe41b('0x69')]||(_0x377aec['attrs']&&_0x377aec[_0xe41b('0x56')][0x0]?_0x377aec[_0xe41b('0x56')][0x0]['type']:undefined)||null,'value':_0x377aec[_0xe41b('0x68')]||(_0x377aec['attrs']&&_0x377aec[_0xe41b('0x56')][0x0]?_0x377aec[_0xe41b('0x56')][0x0][_0xe41b('0x5e')]:undefined)||null},{'name':_0xe41b('0x6a'),'value':_0x377aec['attrRefresh']||(_0x377aec[_0xe41b('0x56')]&&_0x377aec[_0xe41b('0x56')][0x1]?_0x377aec[_0xe41b('0x56')][0x1][_0xe41b('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0xf80275){logger[_0xe41b('0x29')]('widgetAttributes:\x20%s',JSON[_0xe41b('0x6b')](_0xf80275));return[];}}exports[_0xe41b('0x6c')]=function(_0x2c63c5,_0x3d5ece,_0x39cdb9){if(_0x2c63c5['body']['id']){delete _0x2c63c5['body']['id'];}return db[_0xe41b('0x2d')][_0xe41b('0x4d')]({'where':{'id':_0x2c63c5[_0xe41b('0x42')]['id']}})[_0xe41b('0x23')](handleEntityNotFound(_0x3d5ece,null))[_0xe41b('0x23')](function(_0x17a04b){if(_0x17a04b){_0x2c63c5['body'][_0xe41b('0x6d')]=_0x17a04b['id'];_0x2c63c5[_0xe41b('0x47')][_0xe41b('0x56')]=widgetAttributes(_0x2c63c5[_0xe41b('0x47')]);return db[_0xe41b('0x6e')]['create'](_0x2c63c5[_0xe41b('0x47')]);}})[_0xe41b('0x23')](respondWithResult(_0x3d5ece,null))[_0xe41b('0x41')](handleError(_0x3d5ece,null));};exports[_0xe41b('0x6f')]=function(_0x47dc6b,_0x551a95,_0x185e57){var _0x45e5b3={};var _0x1a216a={};var _0x441605;var _0x567ee5;return db[_0xe41b('0x2d')][_0xe41b('0x70')]({'where':{'id':_0x47dc6b[_0xe41b('0x42')]['id']}})[_0xe41b('0x23')](handleEntityNotFound(_0x551a95,null))[_0xe41b('0x23')](function(_0x85e43){if(_0x85e43){_0x441605=_0x85e43;_0x1a216a[_0xe41b('0x2f')]=_[_0xe41b('0x30')](db[_0xe41b('0x6e')]['rawAttributes']);_0x1a216a[_0xe41b('0x31')]=_['keys'](_0x47dc6b['query']);_0x1a216a['filters']=_[_0xe41b('0x32')](_0x1a216a['model'],_0x1a216a[_0xe41b('0x31')]);_0x45e5b3[_0xe41b('0x33')]=_['intersection'](_0x1a216a[_0xe41b('0x2f')],qs[_0xe41b('0x34')](_0x47dc6b[_0xe41b('0x31')]['fields']));_0x45e5b3['attributes']=_0x45e5b3[_0xe41b('0x33')][_0xe41b('0x44')]?_0x45e5b3[_0xe41b('0x33')]:_0x1a216a[_0xe41b('0x2f')];_0x45e5b3['order']=qs[_0xe41b('0x36')](_0x47dc6b[_0xe41b('0x31')]['sort']);_0x45e5b3[_0xe41b('0x37')]=qs[_0xe41b('0x43')](_['pick'](_0x47dc6b[_0xe41b('0x31')],_0x1a216a[_0xe41b('0x43')]));if(_0x47dc6b[_0xe41b('0x31')][_0xe41b('0x3c')]){_0x45e5b3[_0xe41b('0x37')]=_[_0xe41b('0x39')](_0x45e5b3[_0xe41b('0x37')],{'$or':_[_0xe41b('0x3a')](_0x45e5b3['attributes'],function(_0x3db388){var _0x2bc449={};_0x2bc449[_0x3db388]={'$like':'%'+_0x47dc6b[_0xe41b('0x31')][_0xe41b('0x3c')]+'%'};return _0x2bc449;})});}_0x45e5b3=_[_0xe41b('0x39')]({},_0x45e5b3,_0x47dc6b[_0xe41b('0x3d')]);return _0x441605[_0xe41b('0x6f')](_0x45e5b3);}})[_0xe41b('0x23')](function(_0x110189){if(_0x110189){_0x567ee5=_0x110189[_0xe41b('0x44')];if(!_0x47dc6b[_0xe41b('0x31')][_0xe41b('0x71')]('nolimit')){_0x45e5b3[_0xe41b('0x1c')]=qs[_0xe41b('0x1c')](_0x47dc6b['query']['limit']);_0x45e5b3['offset']=qs[_0xe41b('0x1b')](_0x47dc6b['query']['offset']);}return _0x441605['getItems'](_0x45e5b3);}})[_0xe41b('0x23')](function(_0x5d3ed9){if(_0x5d3ed9){return _0x5d3ed9?{'count':_0x567ee5,'rows':_0x5d3ed9}:null;}})[_0xe41b('0x23')](respondWithResult(_0x551a95,null))['catch'](handleError(_0x551a95,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 89ec128..192028f 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 _0x3a43=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x3817f5,_0x30e46f){var _0x435a81=function(_0x4ca106){while(--_0x4ca106){_0x3817f5['push'](_0x3817f5['shift']());}};_0x435a81(++_0x30e46f);}(_0x3a43,0x197));var _0x33a4=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x3a43[_0x4b1032];return _0x5a1d55;};'use strict';var EventEmitter=require(_0x33a4('0x0'));var Dashboard=require(_0x33a4('0x1'))['db'][_0x33a4('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x33a4('0x3')](0x0);var events={'afterCreate':_0x33a4('0x4'),'afterUpdate':'update','afterDestroy':_0x33a4('0x5')};function emitEvent(_0x14a9cd){return function(_0x5b2fa9,_0x3d2bda,_0x33790b){DashboardEvents[_0x33a4('0x6')](_0x14a9cd+':'+_0x5b2fa9['id'],_0x5b2fa9);DashboardEvents[_0x33a4('0x6')](_0x14a9cd,_0x5b2fa9);_0x33790b(null);};}for(var e in events){if(events[_0x33a4('0x7')](e)){var event=events[e];Dashboard[_0x33a4('0x8')](e,emitEvent(event));}}module[_0x33a4('0x9')]=DashboardEvents; \ No newline at end of file +var _0x42e2=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x28876d,_0x46f49d){var _0x1eb326=function(_0x47666f){while(--_0x47666f){_0x28876d['push'](_0x28876d['shift']());}};_0x1eb326(++_0x46f49d);}(_0x42e2,0x122));var _0x242e=function(_0x4bb434,_0x977754){_0x4bb434=_0x4bb434-0x0;var _0x25980e=_0x42e2[_0x4bb434];return _0x25980e;};'use strict';var EventEmitter=require(_0x242e('0x0'));var Dashboard=require(_0x242e('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x242e('0x2')](0x0);var events={'afterCreate':_0x242e('0x3'),'afterUpdate':_0x242e('0x4'),'afterDestroy':_0x242e('0x5')};function emitEvent(_0xf37f20){return function(_0x4df09f,_0x4ed272,_0x5c7f03){DashboardEvents['emit'](_0xf37f20+':'+_0x4df09f['id'],_0x4df09f);DashboardEvents[_0x242e('0x6')](_0xf37f20,_0x4df09f);_0x5c7f03(null);};}for(var e in events){if(events[_0x242e('0x7')](e)){var event=events[e];Dashboard[_0x242e('0x8')](e,emitEvent(event));}}module[_0x242e('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 9a6357b..dcf3620 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 _0x5ae0=['./dashboard.attributes','exports','define','Dashboard','dashboards','util','../../config/logger','moment','bluebird'];(function(_0x132c8c,_0x4b41bf){var _0x46162f=function(_0x371b3d){while(--_0x371b3d){_0x132c8c['push'](_0x132c8c['shift']());}};_0x46162f(++_0x4b41bf);}(_0x5ae0,0xf8));var _0x05ae=function(_0x84635a,_0x46e1f1){_0x84635a=_0x84635a-0x0;var _0x3729d6=_0x5ae0[_0x84635a];return _0x3729d6;};'use strict';var _=require('lodash');var util=require(_0x05ae('0x0'));var logger=require(_0x05ae('0x1'))('api');var moment=require(_0x05ae('0x2'));var BPromise=require(_0x05ae('0x3'));var rp=require('request-promise');var attributes=require(_0x05ae('0x4'));module[_0x05ae('0x5')]=function(_0x4aac85,_0x554b43){return _0x4aac85[_0x05ae('0x6')](_0x05ae('0x7'),attributes,{'tableName':_0x05ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1f1=['dashboards','lodash','util','api','moment','bluebird','request-promise','./dashboard.attributes','exports','define','Dashboard'];(function(_0x3b61d8,_0x2f72f1){var _0x6900a7=function(_0x402f17){while(--_0x402f17){_0x3b61d8['push'](_0x3b61d8['shift']());}};_0x6900a7(++_0x2f72f1);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x18313b,_0x5c914f){_0x18313b=_0x18313b-0x0;var _0x2ba97d=_0xd1f1[_0x18313b];return _0x2ba97d;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var logger=require('../../config/logger')(_0x1d1f('0x2'));var moment=require(_0x1d1f('0x3'));var BPromise=require(_0x1d1f('0x4'));var rp=require(_0x1d1f('0x5'));var attributes=require(_0x1d1f('0x6'));module[_0x1d1f('0x7')]=function(_0x2a2bb4,_0x5264b1){return _0x2a2bb4[_0x1d1f('0x8')](_0x1d1f('0x9'),attributes,{'tableName':_0x1d1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index f4cd9bb..bbe1ad0 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 _0xeec6=['debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0xad58a6,_0x29f46f){var _0x5d1424=function(_0x1bde8a){while(--_0x1bde8a){_0xad58a6['push'](_0xad58a6['shift']());}};_0x5d1424(++_0x29f46f);}(_0xeec6,0x1da));var _0x6eec=function(_0x24a737,_0x3ff299){_0x24a737=_0x24a737-0x0;var _0x37b618=_0xeec6[_0x24a737];return _0x37b618;};'use strict';var _=require(_0x6eec('0x0'));var util=require('util');var moment=require(_0x6eec('0x1'));var BPromise=require(_0x6eec('0x2'));var rs=require(_0x6eec('0x3'));var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require(_0x6eec('0xa'));var client=jayson[_0x6eec('0xb')][_0x6eec('0xc')]({'port':0x232a});config[_0x6eec('0xd')]=_[_0x6eec('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x69de7,_0x5cdb8c,_0x305663){return new BPromise(function(_0x39d7d3,_0x446599){return client[_0x6eec('0x10')](_0x69de7,_0x305663)[_0x6eec('0x11')](function(_0x464f4b){logger['info'](_0x6eec('0x12'),_0x5cdb8c,_0x6eec('0x13'));logger[_0x6eec('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5cdb8c,_0x6eec('0x13'),JSON[_0x6eec('0x15')](_0x464f4b));if(_0x464f4b[_0x6eec('0x16')]){if(_0x464f4b[_0x6eec('0x16')][_0x6eec('0x17')]===0x1f4){logger[_0x6eec('0x16')](_0x6eec('0x12'),_0x5cdb8c,_0x464f4b[_0x6eec('0x16')][_0x6eec('0x18')]);return _0x446599(_0x464f4b['error'][_0x6eec('0x18')]);}logger[_0x6eec('0x16')](_0x6eec('0x12'),_0x5cdb8c,_0x464f4b[_0x6eec('0x16')][_0x6eec('0x18')]);return _0x39d7d3(_0x464f4b[_0x6eec('0x16')]['message']);}else{logger['info'](_0x6eec('0x12'),_0x5cdb8c,'request\x20sent');_0x39d7d3(_0x464f4b[_0x6eec('0x19')]['message']);}})['catch'](function(_0x4e4ef0){logger['error'](_0x6eec('0x12'),_0x5cdb8c,_0x4e4ef0);_0x446599(_0x4e4ef0);});});} \ No newline at end of file +var _0x9881=['error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x14b819,_0x146efe){var _0x59a2a0=function(_0x12b27c){while(--_0x12b27c){_0x14b819['push'](_0x14b819['shift']());}};_0x59a2a0(++_0x146efe);}(_0x9881,0x1b5));var _0x1988=function(_0xb6cb2c,_0x55ca84){_0xb6cb2c=_0xb6cb2c-0x0;var _0x3ef0ea=_0x9881[_0xb6cb2c];return _0x3ef0ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1988('0x0'));var BPromise=require(_0x1988('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1988('0x2'));var db=require(_0x1988('0x3'))['db'];var utils=require(_0x1988('0x4'));var logger=require(_0x1988('0x5'))(_0x1988('0x6'));var config=require(_0x1988('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1988('0x8')][_0x1988('0x9')]({'port':0x232a});config[_0x1988('0xa')]=_[_0x1988('0xb')](config[_0x1988('0xa')],{'host':_0x1988('0xc'),'port':0x18eb});var socket=require(_0x1988('0xd'))(new Redis(config[_0x1988('0xa')]));require('./dashboard.socket')[_0x1988('0xe')](socket);function respondWithRpcPromise(_0x11d494,_0x4586e2,_0x5e4893){return new BPromise(function(_0x2f4e38,_0x440d64){return client[_0x1988('0xf')](_0x11d494,_0x5e4893)[_0x1988('0x10')](function(_0x45cfbc){logger[_0x1988('0x11')](_0x1988('0x12'),_0x4586e2,'request\x20sent');logger[_0x1988('0x13')](_0x1988('0x14'),_0x4586e2,_0x1988('0x15'),JSON['stringify'](_0x45cfbc));if(_0x45cfbc[_0x1988('0x16')]){if(_0x45cfbc[_0x1988('0x16')][_0x1988('0x17')]===0x1f4){logger[_0x1988('0x16')]('Dashboard,\x20%s,\x20%s',_0x4586e2,_0x45cfbc[_0x1988('0x16')][_0x1988('0x18')]);return _0x440d64(_0x45cfbc['error']['message']);}logger[_0x1988('0x16')](_0x1988('0x12'),_0x4586e2,_0x45cfbc['error'][_0x1988('0x18')]);return _0x2f4e38(_0x45cfbc[_0x1988('0x16')][_0x1988('0x18')]);}else{logger[_0x1988('0x11')](_0x1988('0x12'),_0x4586e2,_0x1988('0x15'));_0x2f4e38(_0x45cfbc[_0x1988('0x19')][_0x1988('0x18')]);}})[_0x1988('0x1a')](function(_0x5716c2){logger[_0x1988('0x16')](_0x1988('0x12'),_0x4586e2,_0x5716c2);_0x440d64(_0x5716c2);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f5d9b95..6e9a9a0 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 _0x1932=['register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x56d35c,_0x9bbe48){var _0xfcebce=function(_0x1a5bf8){while(--_0x1a5bf8){_0x56d35c['push'](_0x56d35c['shift']());}};_0xfcebce(++_0x9bbe48);}(_0x1932,0x193));var _0x2193=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x1932[_0x4d613c];return _0x301fe3;};'use strict';var DashboardEvents=require(_0x2193('0x0'));var events=[_0x2193('0x1'),_0x2193('0x2'),_0x2193('0x3')];function createListener(_0x375ba1,_0x5bc403){return function(_0x2373b3){_0x5bc403[_0x2193('0x4')](_0x375ba1,_0x2373b3);};}function removeListener(_0x12f47f,_0x56846a){return function(){DashboardEvents['removeListener'](_0x12f47f,_0x56846a);};}exports[_0x2193('0x5')]=function(_0x2bb1ad){for(var _0x202076=0x0,_0x510563=events[_0x2193('0x6')];_0x202076<_0x510563;_0x202076++){var _0x2e147b=events[_0x202076];var _0x5773b9=createListener(_0x2193('0x7')+_0x2e147b,_0x2bb1ad);DashboardEvents['on'](_0x2e147b,_0x5773b9);}}; \ No newline at end of file +var _0x59ab=['./dashboard.events','save','remove','update','emit','removeListener','register','dashboard:'];(function(_0x130f6d,_0x303610){var _0x59949e=function(_0x438856){while(--_0x438856){_0x130f6d['push'](_0x130f6d['shift']());}};_0x59949e(++_0x303610);}(_0x59ab,0x138));var _0xb59a=function(_0x18242c,_0x17ef5f){_0x18242c=_0x18242c-0x0;var _0x47f808=_0x59ab[_0x18242c];return _0x47f808;};'use strict';var DashboardEvents=require(_0xb59a('0x0'));var events=[_0xb59a('0x1'),_0xb59a('0x2'),_0xb59a('0x3')];function createListener(_0xc4d1ad,_0x54fcb){return function(_0x35c7cf){_0x54fcb[_0xb59a('0x4')](_0xc4d1ad,_0x35c7cf);};}function removeListener(_0x4a462e,_0x758686){return function(){DashboardEvents[_0xb59a('0x5')](_0x4a462e,_0x758686);};}exports[_0xb59a('0x6')]=function(_0x5d4d69){for(var _0x2e0e8a=0x0,_0x48423a=events['length'];_0x2e0e8a<_0x48423a;_0x2e0e8a++){var _0x2a80d1=events[_0x2e0e8a];var _0x41be00=createListener(_0xb59a('0x7')+_0x2a80d1,_0x5d4d69);DashboardEvents['on'](_0x2a80d1,_0x41be00);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index ad67e36..4b5fdaa 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 _0xb8c7=['post','/:id/items','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./dashboard.controller','isAuthenticated','index','get','getItems','/:id/clone','clone'];(function(_0x464184,_0x5c3c97){var _0x1115a5=function(_0x407f06){while(--_0x407f06){_0x464184['push'](_0x464184['shift']());}};_0x1115a5(++_0x5c3c97);}(_0xb8c7,0x1aa));var _0x7b8c=function(_0x3179da,_0x180f3f){_0x3179da=_0x3179da-0x0;var _0x2cb916=_0xb8c7[_0x3179da];return _0x2cb916;};'use strict';var multer=require(_0x7b8c('0x0'));var util=require(_0x7b8c('0x1'));var path=require(_0x7b8c('0x2'));var timeout=require(_0x7b8c('0x3'));var express=require(_0x7b8c('0x4'));var router=express[_0x7b8c('0x5')]();var auth=require(_0x7b8c('0x6'));var interaction=require(_0x7b8c('0x7'));var config=require('../../config/environment');var controller=require(_0x7b8c('0x8'));router['get']('/',auth[_0x7b8c('0x9')](),controller[_0x7b8c('0xa')]);router['get']('/:id',auth[_0x7b8c('0x9')](),controller['show']);router[_0x7b8c('0xb')]('/:id/items',auth['isAuthenticated'](),controller[_0x7b8c('0xc')]);router['post']('/',auth[_0x7b8c('0x9')](),controller['create']);router['post'](_0x7b8c('0xd'),auth[_0x7b8c('0x9')](),controller[_0x7b8c('0xe')]);router[_0x7b8c('0xf')](_0x7b8c('0x10'),auth[_0x7b8c('0x9')](),controller['addItem']);router['put'](_0x7b8c('0x11'),auth[_0x7b8c('0x9')](),controller[_0x7b8c('0x12')]);router['delete'](_0x7b8c('0x11'),auth[_0x7b8c('0x9')](),controller[_0x7b8c('0x13')]);module[_0x7b8c('0x14')]=router; \ No newline at end of file +var _0xe247=['../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','create','post','/:id/clone','clone','addItem','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1da818,_0x26992c){var _0x1e31b7=function(_0x2d9215){while(--_0x2d9215){_0x1da818['push'](_0x1da818['shift']());}};_0x1e31b7(++_0x26992c);}(_0xe247,0x161));var _0x7e24=function(_0x2483ff,_0xc0036d){_0x2483ff=_0x2483ff-0x0;var _0x51d24a=_0xe247[_0x2483ff];return _0x51d24a;};'use strict';var multer=require(_0x7e24('0x0'));var util=require(_0x7e24('0x1'));var path=require(_0x7e24('0x2'));var timeout=require(_0x7e24('0x3'));var express=require(_0x7e24('0x4'));var router=express['Router']();var auth=require(_0x7e24('0x5'));var interaction=require(_0x7e24('0x6'));var config=require(_0x7e24('0x7'));var controller=require(_0x7e24('0x8'));router[_0x7e24('0x9')]('/',auth['isAuthenticated'](),controller[_0x7e24('0xa')]);router[_0x7e24('0x9')](_0x7e24('0xb'),auth[_0x7e24('0xc')](),controller[_0x7e24('0xd')]);router[_0x7e24('0x9')](_0x7e24('0xe'),auth[_0x7e24('0xc')](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller[_0x7e24('0xf')]);router[_0x7e24('0x10')](_0x7e24('0x11'),auth[_0x7e24('0xc')](),controller[_0x7e24('0x12')]);router[_0x7e24('0x10')](_0x7e24('0xe'),auth[_0x7e24('0xc')](),controller[_0x7e24('0x13')]);router[_0x7e24('0x14')](_0x7e24('0xb'),auth[_0x7e24('0xc')](),controller[_0x7e24('0x15')]);router['delete'](_0x7e24('0xb'),auth[_0x7e24('0xc')](),controller[_0x7e24('0x16')]);module[_0x7e24('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 93ba7c5..103a8ad 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 _0x03a2=['sequelize','squel','exports','STRING','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x03a2,0x174));var _0x203a=function(_0x52e5fd,_0x53efb7){_0x52e5fd=_0x52e5fd-0x0;var _0x46ae7b=_0x03a2[_0x52e5fd];return _0x46ae7b;};'use strict';var Sequelize=require(_0x203a('0x0'));var squel=require(_0x203a('0x1'));var _=require('lodash');module[_0x203a('0x2')]={'title':{'type':Sequelize[_0x203a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x203a('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0x203a('0x4')](this[_0x203a('0x5')](_0x203a('0x6')));}catch(_0x41704c){return[];}},'set':function(_0x11f179){try{this['setDataValue'](_0x203a('0x6'),JSON[_0x203a('0x7')](_0x11f179));}catch(_0x152cfd){this[_0x203a('0x8')](_0x203a('0x6'),JSON[_0x203a('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x203a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x203a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x203a('0x9')]},'col':{'type':Sequelize[_0x203a('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x203a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x203a('0x3')],'allowNull':![],'defaultValue':_0x203a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x203a('0x3')]}}; \ No newline at end of file +var _0xf157=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x23d47d,_0x18be90){var _0x458d43=function(_0x3525dc){while(--_0x3525dc){_0x23d47d['push'](_0x23d47d['shift']());}};_0x458d43(++_0x18be90);}(_0xf157,0x6f));var _0x7f15=function(_0x4d1dc7,_0x219f26){_0x4d1dc7=_0x4d1dc7-0x0;var _0x4e937a=_0xf157[_0x4d1dc7];return _0x4e937a;};'use strict';var Sequelize=require(_0x7f15('0x0'));var squel=require('squel');var _=require(_0x7f15('0x1'));module[_0x7f15('0x2')]={'title':{'type':Sequelize[_0x7f15('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7f15('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7f15('0x4')](_0x7f15('0x5')),'get':function(){try{return JSON[_0x7f15('0x6')](this[_0x7f15('0x7')](_0x7f15('0x8')));}catch(_0x5568da){return[];}},'set':function(_0x15f2c4){try{this[_0x7f15('0x9')](_0x7f15('0x8'),JSON[_0x7f15('0xa')](_0x15f2c4));}catch(_0x3d2d48){this[_0x7f15('0x9')](_0x7f15('0x8'),JSON[_0x7f15('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x7f15('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7f15('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x7f15('0xb')]},'background':{'type':Sequelize[_0x7f15('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7f15('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7f15('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 23ec295..4654b30 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 _0x9576=['count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','merge','options','find','catch','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','body','create','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','register','status'];(function(_0x92179,_0x20d048){var _0x330fa5=function(_0x283daf){while(--_0x283daf){_0x92179['push'](_0x92179['shift']());}};_0x330fa5(++_0x20d048);}(_0x9576,0x182));var _0x6957=function(_0x555854,_0x329958){_0x555854=_0x555854-0x0;var _0x2dd0c8=_0x9576[_0x555854];return _0x2dd0c8;};'use strict';var pdf=require(_0x6957('0x0'));var emlformat=require(_0x6957('0x1'));var rimraf=require(_0x6957('0x2'));var zipdir=require(_0x6957('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6957('0x4'));var BPromise=require(_0x6957('0x5'));var Mustache=require(_0x6957('0x6'));var util=require(_0x6957('0x7'));var path=require(_0x6957('0x8'));var sox=require(_0x6957('0x9'));var csv=require(_0x6957('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6957('0xb'));var squel=require(_0x6957('0xc'));var crypto=require(_0x6957('0xd'));var jsforce=require(_0x6957('0xe'));var deskjs=require(_0x6957('0xf'));var toCsv=require(_0x6957('0xa'));var querystring=require('querystring');var Papa=require(_0x6957('0x10'));var authService=require(_0x6957('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x6957('0x12'));var logger=require(_0x6957('0x13'))(_0x6957('0x14'));var utils=require(_0x6957('0x15'));var config=require(_0x6957('0x16'));var db=require(_0x6957('0x17'))['db'];config[_0x6957('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6957('0x19'))(new Redis(config[_0x6957('0x18')]));require(_0x6957('0x1a'))[_0x6957('0x1b')](socket);function respondWithStatusCode(_0x345c3e,_0x1fd3d9){_0x1fd3d9=_0x1fd3d9||0xcc;return function(_0x25d32e){if(_0x25d32e){return _0x345c3e['sendStatus'](_0x1fd3d9);}return _0x345c3e['status'](_0x1fd3d9)['end']();};}function respondWithResult(_0x35fffc,_0x256ac7){_0x256ac7=_0x256ac7||0xc8;return function(_0x228f76){if(_0x228f76){return _0x35fffc[_0x6957('0x1c')](_0x256ac7)['json'](_0x228f76);}};}function respondWithFilteredResult(_0x14422d,_0x5a33b4){return function(_0x2a39b5){if(_0x2a39b5){var _0xabd232=_0x2a39b5[_0x6957('0x1d')],_0x49aa31=_0x5a33b4['offset'],_0x2ccd8e=_0x5a33b4[_0x6957('0x1e')]+_0x5a33b4[_0x6957('0x1f')],_0x448ff6;if(_0x2ccd8e>=_0xabd232){_0x2ccd8e=_0xabd232;_0x448ff6=0xc8;}else{_0x448ff6=0xce;}_0x14422d[_0x6957('0x1c')](_0x448ff6);return _0x14422d[_0x6957('0x20')](_0x6957('0x21'),_0x49aa31+'-'+_0x2ccd8e+'/'+_0xabd232)[_0x6957('0x22')](_0x2a39b5);}return null;};}function patchUpdates(_0x35ee5b){return function(_0x3081b2){try{jsonpatch['apply'](_0x3081b2,_0x35ee5b,!![]);}catch(_0x5ee3f8){return BPromise[_0x6957('0x23')](_0x5ee3f8);}return _0x3081b2[_0x6957('0x24')]();};}function saveUpdates(_0x18037f,_0x2569f4){return function(_0x3591fa){if(_0x3591fa){return _0x3591fa[_0x6957('0x25')](_0x18037f)[_0x6957('0x26')](function(_0x310a5e){return _0x310a5e;});}return null;};}function removeEntity(_0x56b0ba,_0x2b2dcd){return function(_0x3c9de7){if(_0x3c9de7){return _0x3c9de7[_0x6957('0x27')]()[_0x6957('0x26')](function(){_0x56b0ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1e6af,_0x2a57b6){return function(_0x5c4e49){if(!_0x5c4e49){_0xa1e6af['sendStatus'](0x194);}return _0x5c4e49;};}function handleError(_0x320e7d,_0xa2f92f){_0xa2f92f=_0xa2f92f||0x1f4;return function(_0x3bc22f){logger['error'](_0x3bc22f[_0x6957('0x28')]);if(_0x3bc22f[_0x6957('0x29')]){delete _0x3bc22f[_0x6957('0x29')];}_0x320e7d[_0x6957('0x1c')](_0xa2f92f)[_0x6957('0x2a')](_0x3bc22f);};}exports[_0x6957('0x2b')]=function(_0x2d33ef,_0x320e1a){var _0x595770={'raw':![],'where':{'id':_0x2d33ef[_0x6957('0x2c')]['id']}},_0x2e7fe1={};_0x2e7fe1[_0x6957('0x2d')]=_[_0x6957('0x2e')](db[_0x6957('0x2f')][_0x6957('0x30')]);_0x2e7fe1[_0x6957('0x31')]=_[_0x6957('0x2e')](_0x2d33ef[_0x6957('0x31')]);_0x2e7fe1[_0x6957('0x32')]=_[_0x6957('0x33')](_0x2e7fe1['model'],_0x2e7fe1['query']);_0x595770[_0x6957('0x34')]=_[_0x6957('0x33')](_0x2e7fe1[_0x6957('0x2d')],qs[_0x6957('0x35')](_0x2d33ef['query'][_0x6957('0x35')]));_0x595770[_0x6957('0x34')]=_0x595770[_0x6957('0x34')]['length']?_0x595770['attributes']:_0x2e7fe1[_0x6957('0x2d')];if(_0x2d33ef[_0x6957('0x31')][_0x6957('0x36')]){_0x595770['include']=[{'all':!![]}];}_0x595770=_[_0x6957('0x37')]({},_0x595770,_0x2d33ef[_0x6957('0x38')]);return db[_0x6957('0x2f')][_0x6957('0x39')](_0x595770)[_0x6957('0x26')](handleEntityNotFound(_0x320e1a,null))[_0x6957('0x26')](respondWithResult(_0x320e1a,null))[_0x6957('0x3a')](handleError(_0x320e1a,null));};exports[_0x6957('0x27')]=function(_0x244bee,_0x5744e7){return db[_0x6957('0x2f')][_0x6957('0x39')]({'where':{'id':_0x244bee[_0x6957('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5744e7,null))['then'](removeEntity(_0x5744e7,null))['catch'](handleError(_0x5744e7,null));};function widgetAttributes(_0x9dc614){try{switch(_0x9dc614['type']){case'iframe':return[{'name':_0x6957('0x3b'),'value':_0x9dc614[_0x6957('0x3b')]||(_0x9dc614['attrs']&&_0x9dc614['attrs'][0x0]?_0x9dc614[_0x6957('0x3c')][0x0][_0x6957('0x3d')]:undefined)||_0x6957('0x3e')}];case _0x6957('0x3f'):return[{'name':_0x6957('0x40'),'value':_0x9dc614['attrPath']||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614['attrs'][0x0]?_0x9dc614['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x9dc614['attrHourFormat']||(_0x9dc614['attrs']&&_0x9dc614['attrs'][0x0]?_0x9dc614['attrs'][0x0][_0x6957('0x3d')]:undefined)||_0x6957('0x41')},{'name':_0x6957('0x42'),'value':_0x9dc614[_0x6957('0x42')]||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x1]?_0x9dc614[_0x6957('0x3c')][0x1][_0x6957('0x3d')]:undefined)||'0.00'},{'name':_0x6957('0x43'),'value':_0x9dc614['attrFontSize']||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x2]?_0x9dc614[_0x6957('0x3c')][0x2][_0x6957('0x3d')]:undefined)||0xc}];case _0x6957('0x44'):return[{'name':_0x6957('0x45'),'value':_0x9dc614[_0x6957('0x45')]||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x0]?_0x9dc614[_0x6957('0x3c')][0x0][_0x6957('0x3d')]:undefined)||_0x6957('0x46')},{'name':_0x6957('0x47'),'value':_0x9dc614[_0x6957('0x47')]||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x1]?_0x9dc614['attrs'][0x1][_0x6957('0x3d')]:undefined)||[]},{'name':'attrFontSize','value':_0x9dc614['attrFontSize']||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614['attrs'][0x2]?_0x9dc614['attrs'][0x2][_0x6957('0x3d')]:undefined)||0x14}];case _0x6957('0x48'):case _0x6957('0x49'):return[{'name':_0x6957('0x4a'),'value':_0x9dc614[_0x6957('0x4a')]||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x0]?_0x9dc614[_0x6957('0x3c')][0x0][_0x6957('0x3d')]:undefined)||_0x6957('0x46')},{'name':'attrSerie2','value':_0x9dc614['attrSerie2']||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614['attrs'][0x1]?_0x9dc614[_0x6957('0x3c')][0x1][_0x6957('0x3d')]:undefined)||null},{'name':'attrSerie3','value':_0x9dc614[_0x6957('0x4b')]||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x2]?_0x9dc614[_0x6957('0x3c')][0x2][_0x6957('0x3d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x9dc614[_0x6957('0x47')]||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x3]?_0x9dc614[_0x6957('0x3c')][0x3]['value']:undefined)||[]}];case _0x6957('0x4c'):return[{'name':_0x6957('0x4d'),'type':_0x9dc614['reportType']||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x0]?_0x9dc614[_0x6957('0x3c')][0x0][_0x6957('0x4e')]:undefined)||null,'value':_0x9dc614['attrReport']||(_0x9dc614['attrs']&&_0x9dc614[_0x6957('0x3c')][0x0]?_0x9dc614[_0x6957('0x3c')][0x0][_0x6957('0x3d')]:undefined)||null},{'name':_0x6957('0x4f'),'value':_0x9dc614['attrRefresh']||(_0x9dc614[_0x6957('0x3c')]&&_0x9dc614[_0x6957('0x3c')][0x1]?_0x9dc614[_0x6957('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1e392c){logger['error'](_0x6957('0x50'),JSON['stringify'](_0x1e392c));return[];}}exports['create']=function(_0x274d40,_0x371e29){if(_0x274d40[_0x6957('0x51')]){_0x274d40[_0x6957('0x51')][_0x6957('0x3c')]=widgetAttributes(_0x274d40[_0x6957('0x51')]);}return db[_0x6957('0x2f')][_0x6957('0x52')](_0x274d40[_0x6957('0x51')],{})[_0x6957('0x26')](respondWithResult(_0x371e29,0xc9))['catch'](handleError(_0x371e29,null));};exports[_0x6957('0x25')]=function(_0x2abd65,_0x12b57e){if(_0x2abd65['body']['id']){delete _0x2abd65[_0x6957('0x51')]['id'];}_0x2abd65['body'][_0x6957('0x3c')]=widgetAttributes(_0x2abd65[_0x6957('0x51')]);return db['DashboardItem'][_0x6957('0x39')]({'where':{'id':_0x2abd65[_0x6957('0x2c')]['id']}})[_0x6957('0x26')](handleEntityNotFound(_0x12b57e,null))[_0x6957('0x26')](saveUpdates(_0x2abd65[_0x6957('0x51')],null))[_0x6957('0x26')](respondWithResult(_0x12b57e,null))[_0x6957('0x3a')](handleError(_0x12b57e,null));}; \ No newline at end of file +var _0x9802=['lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','type','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','reportType','attrRefresh','stringify','body','create','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x2c523a,_0x5ac80f){var _0x3334ca=function(_0x48c686){while(--_0x48c686){_0x2c523a['push'](_0x2c523a['shift']());}};_0x3334ca(++_0x5ac80f);}(_0x9802,0xf6));var _0x2980=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9802[_0x45d55e];return _0x29812a;};'use strict';var pdf=require(_0x2980('0x0'));var emlformat=require(_0x2980('0x1'));var rimraf=require(_0x2980('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2980('0x3'));var rp=require(_0x2980('0x4'));var moment=require(_0x2980('0x5'));var BPromise=require(_0x2980('0x6'));var Mustache=require(_0x2980('0x7'));var util=require('util');var path=require(_0x2980('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2980('0x9'));var squel=require(_0x2980('0xa'));var crypto=require(_0x2980('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2980('0xc'));var toCsv=require(_0x2980('0xd'));var querystring=require(_0x2980('0xe'));var Papa=require(_0x2980('0xf'));var authService=require(_0x2980('0x10'));var hardwareService=require(_0x2980('0x11'));var Redis=require(_0x2980('0x12'));var qs=require(_0x2980('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2980('0x14'));var db=require(_0x2980('0x15'))['db'];config[_0x2980('0x16')]=_[_0x2980('0x17')](config[_0x2980('0x16')],{'host':_0x2980('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2980('0x16')]));require('./dashboardItem.socket')[_0x2980('0x19')](socket);function respondWithStatusCode(_0x3da46c,_0x22323e){_0x22323e=_0x22323e||0xcc;return function(_0xe9a2f3){if(_0xe9a2f3){return _0x3da46c[_0x2980('0x1a')](_0x22323e);}return _0x3da46c[_0x2980('0x1b')](_0x22323e)['end']();};}function respondWithResult(_0x3266e8,_0x1e9a57){_0x1e9a57=_0x1e9a57||0xc8;return function(_0x422b99){if(_0x422b99){return _0x3266e8['status'](_0x1e9a57)[_0x2980('0x1c')](_0x422b99);}};}function respondWithFilteredResult(_0x5e5074,_0x74d740){return function(_0x15a58a){if(_0x15a58a){var _0x34bfed=_0x15a58a[_0x2980('0x1d')],_0x1ec2e9=_0x74d740['offset'],_0x2762c6=_0x74d740['offset']+_0x74d740[_0x2980('0x1e')],_0x177408;if(_0x2762c6>=_0x34bfed){_0x2762c6=_0x34bfed;_0x177408=0xc8;}else{_0x177408=0xce;}_0x5e5074[_0x2980('0x1b')](_0x177408);return _0x5e5074[_0x2980('0x1f')](_0x2980('0x20'),_0x1ec2e9+'-'+_0x2762c6+'/'+_0x34bfed)[_0x2980('0x1c')](_0x15a58a);}return null;};}function patchUpdates(_0x7f719f){return function(_0x2444ef){try{jsonpatch[_0x2980('0x21')](_0x2444ef,_0x7f719f,!![]);}catch(_0x183e66){return BPromise[_0x2980('0x22')](_0x183e66);}return _0x2444ef[_0x2980('0x23')]();};}function saveUpdates(_0x1a37eb,_0x479ad4){return function(_0x4213cf){if(_0x4213cf){return _0x4213cf['update'](_0x1a37eb)[_0x2980('0x24')](function(_0x5e6610){return _0x5e6610;});}return null;};}function removeEntity(_0x2242e1,_0x483bd8){return function(_0x4e6f87){if(_0x4e6f87){return _0x4e6f87[_0x2980('0x25')]()[_0x2980('0x24')](function(){_0x2242e1[_0x2980('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17ce7b,_0x258a1f){return function(_0x549457){if(!_0x549457){_0x17ce7b[_0x2980('0x1a')](0x194);}return _0x549457;};}function handleError(_0x2851dc,_0x2c54cb){_0x2c54cb=_0x2c54cb||0x1f4;return function(_0x98e126){logger[_0x2980('0x26')](_0x98e126[_0x2980('0x27')]);if(_0x98e126[_0x2980('0x28')]){delete _0x98e126[_0x2980('0x28')];}_0x2851dc[_0x2980('0x1b')](_0x2c54cb)['send'](_0x98e126);};}exports[_0x2980('0x29')]=function(_0x2e0f4d,_0x77ebd){var _0x158fdd={'raw':![],'where':{'id':_0x2e0f4d[_0x2980('0x2a')]['id']}},_0x2cacf2={};_0x2cacf2[_0x2980('0x2b')]=_[_0x2980('0x2c')](db[_0x2980('0x2d')][_0x2980('0x2e')]);_0x2cacf2[_0x2980('0x2f')]=_[_0x2980('0x2c')](_0x2e0f4d[_0x2980('0x2f')]);_0x2cacf2['filters']=_[_0x2980('0x30')](_0x2cacf2[_0x2980('0x2b')],_0x2cacf2[_0x2980('0x2f')]);_0x158fdd['attributes']=_['intersection'](_0x2cacf2['model'],qs[_0x2980('0x31')](_0x2e0f4d[_0x2980('0x2f')][_0x2980('0x31')]));_0x158fdd[_0x2980('0x32')]=_0x158fdd['attributes'][_0x2980('0x33')]?_0x158fdd[_0x2980('0x32')]:_0x2cacf2[_0x2980('0x2b')];if(_0x2e0f4d['query'][_0x2980('0x34')]){_0x158fdd[_0x2980('0x35')]=[{'all':!![]}];}_0x158fdd=_[_0x2980('0x36')]({},_0x158fdd,_0x2e0f4d['options']);return db['DashboardItem'][_0x2980('0x37')](_0x158fdd)['then'](handleEntityNotFound(_0x77ebd,null))[_0x2980('0x24')](respondWithResult(_0x77ebd,null))[_0x2980('0x38')](handleError(_0x77ebd,null));};exports[_0x2980('0x25')]=function(_0x1f9914,_0x417df1){return db[_0x2980('0x2d')][_0x2980('0x37')]({'where':{'id':_0x1f9914[_0x2980('0x2a')]['id']}})[_0x2980('0x24')](handleEntityNotFound(_0x417df1,null))['then'](removeEntity(_0x417df1,null))['catch'](handleError(_0x417df1,null));};function widgetAttributes(_0x4a33bb){try{switch(_0x4a33bb[_0x2980('0x39')]){case'iframe':return[{'name':'attrUrl','value':_0x4a33bb[_0x2980('0x3a')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb[_0x2980('0x3b')][0x0]?_0x4a33bb['attrs'][0x0][_0x2980('0x3c')]:undefined)||_0x2980('0x3d')}];case _0x2980('0x3e'):return[{'name':_0x2980('0x3f'),'value':_0x4a33bb['attrPath']||(_0x4a33bb['attrs']&&_0x4a33bb['attrs'][0x0]?_0x4a33bb[_0x2980('0x3b')][0x0]['value']:undefined)||''}];case _0x2980('0x40'):return[{'name':_0x2980('0x41'),'value':_0x4a33bb[_0x2980('0x41')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb['attrs'][0x0]?_0x4a33bb[_0x2980('0x3b')][0x0][_0x2980('0x3c')]:undefined)||_0x2980('0x42')},{'name':_0x2980('0x43'),'value':_0x4a33bb['attrTimezone']||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb[_0x2980('0x3b')][0x1]?_0x4a33bb[_0x2980('0x3b')][0x1][_0x2980('0x3c')]:undefined)||_0x2980('0x44')},{'name':_0x2980('0x45'),'value':_0x4a33bb[_0x2980('0x45')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb[_0x2980('0x3b')][0x2]?_0x4a33bb[_0x2980('0x3b')][0x2]['value']:undefined)||0xc}];case _0x2980('0x46'):return[{'name':_0x2980('0x47'),'value':_0x4a33bb[_0x2980('0x47')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb[_0x2980('0x3b')][0x0]?_0x4a33bb[_0x2980('0x3b')][0x0][_0x2980('0x3c')]:undefined)||_0x2980('0x48')},{'name':'attrVoiceQueues','value':_0x4a33bb[_0x2980('0x49')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb['attrs'][0x1]?_0x4a33bb[_0x2980('0x3b')][0x1][_0x2980('0x3c')]:undefined)||[]},{'name':'attrFontSize','value':_0x4a33bb['attrFontSize']||(_0x4a33bb['attrs']&&_0x4a33bb[_0x2980('0x3b')][0x2]?_0x4a33bb['attrs'][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x2980('0x4a'),'value':_0x4a33bb[_0x2980('0x4a')]||(_0x4a33bb['attrs']&&_0x4a33bb[_0x2980('0x3b')][0x0]?_0x4a33bb[_0x2980('0x3b')][0x0][_0x2980('0x3c')]:undefined)||_0x2980('0x48')},{'name':'attrSerie2','value':_0x4a33bb[_0x2980('0x4b')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb['attrs'][0x1]?_0x4a33bb[_0x2980('0x3b')][0x1][_0x2980('0x3c')]:undefined)||null},{'name':_0x2980('0x4c'),'value':_0x4a33bb[_0x2980('0x4c')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb['attrs'][0x2]?_0x4a33bb[_0x2980('0x3b')][0x2][_0x2980('0x3c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4a33bb[_0x2980('0x49')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb[_0x2980('0x3b')][0x3]?_0x4a33bb[_0x2980('0x3b')][0x3]['value']:undefined)||[]}];case _0x2980('0x4d'):return[{'name':_0x2980('0x4e'),'type':_0x4a33bb[_0x2980('0x4f')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb['attrs'][0x0]?_0x4a33bb['attrs'][0x0][_0x2980('0x39')]:undefined)||null,'value':_0x4a33bb[_0x2980('0x4e')]||(_0x4a33bb[_0x2980('0x3b')]&&_0x4a33bb[_0x2980('0x3b')][0x0]?_0x4a33bb['attrs'][0x0][_0x2980('0x3c')]:undefined)||null},{'name':_0x2980('0x50'),'value':_0x4a33bb['attrRefresh']||(_0x4a33bb['attrs']&&_0x4a33bb['attrs'][0x1]?_0x4a33bb['attrs'][0x1][_0x2980('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x3133f2){logger[_0x2980('0x26')]('widgetAttributes:\x20%s',JSON[_0x2980('0x51')](_0x3133f2));return[];}}exports['create']=function(_0x43ccec,_0x45cd74){if(_0x43ccec[_0x2980('0x52')]){_0x43ccec['body']['attrs']=widgetAttributes(_0x43ccec[_0x2980('0x52')]);}return db[_0x2980('0x2d')][_0x2980('0x53')](_0x43ccec[_0x2980('0x52')],{})[_0x2980('0x24')](respondWithResult(_0x45cd74,0xc9))['catch'](handleError(_0x45cd74,null));};exports[_0x2980('0x54')]=function(_0x190484,_0x143b15){if(_0x190484['body']['id']){delete _0x190484[_0x2980('0x52')]['id'];}_0x190484['body'][_0x2980('0x3b')]=widgetAttributes(_0x190484[_0x2980('0x52')]);return db['DashboardItem']['find']({'where':{'id':_0x190484['params']['id']}})[_0x2980('0x24')](handleEntityNotFound(_0x143b15,null))[_0x2980('0x24')](saveUpdates(_0x190484[_0x2980('0x52')],null))[_0x2980('0x24')](respondWithResult(_0x143b15,null))['catch'](handleError(_0x143b15,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index c08e361..c7a7366 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 _0xfbf3=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x3fdbe9,_0x3465de){var _0x2e2512=function(_0x3c8335){while(--_0x3c8335){_0x3fdbe9['push'](_0x3fdbe9['shift']());}};_0x2e2512(++_0x3465de);}(_0xfbf3,0xbd));var _0x3fbf=function(_0x459a66,_0x21f7a7){_0x459a66=_0x459a66-0x0;var _0x2ac1be=_0xfbf3[_0x459a66];return _0x2ac1be;};'use strict';var EventEmitter=require(_0x3fbf('0x0'));var DashboardItem=require(_0x3fbf('0x1'))['db'][_0x3fbf('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3fbf('0x3')](0x0);var events={'afterCreate':_0x3fbf('0x4'),'afterUpdate':_0x3fbf('0x5'),'afterDestroy':_0x3fbf('0x6')};function emitEvent(_0x44b8a4){return function(_0x8901c3,_0x3a223a,_0x45d33c){DashboardItemEvents['emit'](_0x44b8a4+':'+_0x8901c3['id'],_0x8901c3);DashboardItemEvents['emit'](_0x44b8a4,_0x8901c3);_0x45d33c(null);};}for(var e in events){if(events[_0x3fbf('0x7')](e)){var event=events[e];DashboardItem[_0x3fbf('0x8')](e,emitEvent(event));}}module[_0x3fbf('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xbe75=['emit','hook','events','../../mysqldb','update','remove'];(function(_0x48960e,_0x110180){var _0x3cd846=function(_0x54cdfe){while(--_0x54cdfe){_0x48960e['push'](_0x48960e['shift']());}};_0x3cd846(++_0x110180);}(_0xbe75,0xda));var _0x5be7=function(_0x156c95,_0x4e2eb9){_0x156c95=_0x156c95-0x0;var _0x15f2e0=_0xbe75[_0x156c95];return _0x15f2e0;};'use strict';var EventEmitter=require(_0x5be7('0x0'));var DashboardItem=require(_0x5be7('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5be7('0x2'),'afterDestroy':_0x5be7('0x3')};function emitEvent(_0x49ca49){return function(_0xf816c4,_0x2e0252,_0xbc6680){DashboardItemEvents[_0x5be7('0x4')](_0x49ca49+':'+_0xf816c4['id'],_0xf816c4);DashboardItemEvents[_0x5be7('0x4')](_0x49ca49,_0xf816c4);_0xbc6680(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x5be7('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 869ae3d..414cdab 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 _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x1bc750,_0x23f442){var _0xcd51da=function(_0x323854){while(--_0x323854){_0x1bc750['push'](_0x1bc750['shift']());}};_0xcd51da(++_0x23f442);}(_0x7a54,0x106));var _0x47a5=function(_0x31bf18,_0x4494d6){_0x31bf18=_0x31bf18-0x0;var _0x5a7e06=_0x7a54[_0x31bf18];return _0x5a7e06;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x571714,_0x30d2b3){var _0x599a14=function(_0x3874fa){while(--_0x3874fa){_0x571714['push'](_0x571714['shift']());}};_0x599a14(++_0x30d2b3);}(_0x7a54,0x106));var _0x47a5=function(_0xed1990,_0x273b50){_0xed1990=_0xed1990-0x0;var _0x419310=_0x7a54[_0xed1990];return _0x419310;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 45c03a5..af8ac2d 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 _0x40c0=['error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','code'];(function(_0x4b6599,_0x540477){var _0x2ed7cc=function(_0x218d3a){while(--_0x218d3a){_0x4b6599['push'](_0x4b6599['shift']());}};_0x2ed7cc(++_0x540477);}(_0x40c0,0x99));var _0x040c=function(_0x3a9427,_0x27078f){_0x3a9427=_0x3a9427-0x0;var _0x2f8840=_0x40c0[_0x3a9427];return _0x2f8840;};'use strict';var _=require('lodash');var util=require(_0x040c('0x0'));var moment=require(_0x040c('0x1'));var BPromise=require(_0x040c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x040c('0x3'));var db=require(_0x040c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x040c('0x5'))(_0x040c('0x6'));var config=require(_0x040c('0x7'));var jayson=require(_0x040c('0x8'));var client=jayson[_0x040c('0x9')][_0x040c('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x040c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x040c('0xc'))(new Redis(config[_0x040c('0xb')]));require(_0x040c('0xd'))[_0x040c('0xe')](socket);function respondWithRpcPromise(_0xbf7a5a,_0x591b3b,_0x4bddf1){return new BPromise(function(_0xc58e5d,_0x29b9e4){return client['request'](_0xbf7a5a,_0x4bddf1)[_0x040c('0xf')](function(_0x28558f){logger[_0x040c('0x10')](_0x040c('0x11'),_0x591b3b,'request\x20sent');logger[_0x040c('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x591b3b,_0x040c('0x13'),JSON[_0x040c('0x14')](_0x28558f));if(_0x28558f['error']){if(_0x28558f['error'][_0x040c('0x15')]===0x1f4){logger[_0x040c('0x16')](_0x040c('0x11'),_0x591b3b,_0x28558f['error'][_0x040c('0x17')]);return _0x29b9e4(_0x28558f[_0x040c('0x16')][_0x040c('0x17')]);}logger[_0x040c('0x16')](_0x040c('0x11'),_0x591b3b,_0x28558f[_0x040c('0x16')][_0x040c('0x17')]);return _0xc58e5d(_0x28558f[_0x040c('0x16')][_0x040c('0x17')]);}else{logger[_0x040c('0x10')]('DashboardItem,\x20%s,\x20%s',_0x591b3b,'request\x20sent');_0xc58e5d(_0x28558f[_0x040c('0x18')][_0x040c('0x17')]);}})['catch'](function(_0x462f62){logger[_0x040c('0x16')]('DashboardItem,\x20%s,\x20%s',_0x591b3b,_0x462f62);_0x29b9e4(_0x462f62);});});} \ No newline at end of file +var _0x65f9=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65f9,0x19d));var _0x965f=function(_0x1f33c3,_0xba6721){_0x1f33c3=_0x1f33c3-0x0;var _0x4d3011=_0x65f9[_0x1f33c3];return _0x4d3011;};'use strict';var _=require(_0x965f('0x0'));var util=require(_0x965f('0x1'));var moment=require(_0x965f('0x2'));var BPromise=require(_0x965f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x965f('0x4'))['db'];var utils=require(_0x965f('0x5'));var logger=require(_0x965f('0x6'))(_0x965f('0x7'));var config=require(_0x965f('0x8'));var jayson=require(_0x965f('0x9'));var client=jayson[_0x965f('0xa')][_0x965f('0xb')]({'port':0x232a});config[_0x965f('0xc')]=_[_0x965f('0xd')](config[_0x965f('0xc')],{'host':_0x965f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x965f('0xc')]));require(_0x965f('0xf'))[_0x965f('0x10')](socket);function respondWithRpcPromise(_0x20e985,_0x48d465,_0x233fac){return new BPromise(function(_0x3611b3,_0x1cc387){return client[_0x965f('0x11')](_0x20e985,_0x233fac)[_0x965f('0x12')](function(_0x2b5c64){logger[_0x965f('0x13')](_0x965f('0x14'),_0x48d465,_0x965f('0x15'));logger[_0x965f('0x16')](_0x965f('0x17'),_0x48d465,_0x965f('0x15'),JSON['stringify'](_0x2b5c64));if(_0x2b5c64[_0x965f('0x18')]){if(_0x2b5c64['error'][_0x965f('0x19')]===0x1f4){logger[_0x965f('0x18')](_0x965f('0x14'),_0x48d465,_0x2b5c64[_0x965f('0x18')][_0x965f('0x1a')]);return _0x1cc387(_0x2b5c64[_0x965f('0x18')]['message']);}logger[_0x965f('0x18')](_0x965f('0x14'),_0x48d465,_0x2b5c64[_0x965f('0x18')][_0x965f('0x1a')]);return _0x3611b3(_0x2b5c64['error'][_0x965f('0x1a')]);}else{logger['info'](_0x965f('0x14'),_0x48d465,_0x965f('0x15'));_0x3611b3(_0x2b5c64[_0x965f('0x1b')]['message']);}})[_0x965f('0x1c')](function(_0x2de7bb){logger[_0x965f('0x18')]('DashboardItem,\x20%s,\x20%s',_0x48d465,_0x2de7bb);_0x1cc387(_0x2de7bb);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 5b1188f..0432be1 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 _0x7217=['dashboardItem:','./dashboardItem.events','remove','update','removeListener','register','length'];(function(_0x31ce3d,_0x581047){var _0x203d95=function(_0x9b9243){while(--_0x9b9243){_0x31ce3d['push'](_0x31ce3d['shift']());}};_0x203d95(++_0x581047);}(_0x7217,0x19e));var _0x7721=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x7217[_0x43d11d];return _0x38cd08;};'use strict';var DashboardItemEvents=require(_0x7721('0x0'));var events=['save',_0x7721('0x1'),_0x7721('0x2')];function createListener(_0x1de988,_0x2a78d8){return function(_0x115ab3){_0x2a78d8['emit'](_0x1de988,_0x115ab3);};}function removeListener(_0x5bf160,_0x472a96){return function(){DashboardItemEvents[_0x7721('0x3')](_0x5bf160,_0x472a96);};}exports[_0x7721('0x4')]=function(_0x3fe47c){for(var _0xb239e0=0x0,_0xf7ff37=events[_0x7721('0x5')];_0xb239e0<_0xf7ff37;_0xb239e0++){var _0x21f680=events[_0xb239e0];var _0x225610=createListener(_0x7721('0x6')+_0x21f680,_0x3fe47c);DashboardItemEvents['on'](_0x21f680,_0x225610);}}; \ No newline at end of file +var _0xedd9=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x27fb49,_0x49b7c0){var _0x499cab=function(_0x5ee332){while(--_0x5ee332){_0x27fb49['push'](_0x27fb49['shift']());}};_0x499cab(++_0x49b7c0);}(_0xedd9,0xfc));var _0x9edd=function(_0x3d6541,_0xd61555){_0x3d6541=_0x3d6541-0x0;var _0x45b94b=_0xedd9[_0x3d6541];return _0x45b94b;};'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 74f0f06..273dc64 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 _0xe6d7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','show','post','/:id','destroy','exports','util','path','connect-timeout','express'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe6d7,0x1bc));var _0x7e6d=function(_0x3e948f,_0x19484d){_0x3e948f=_0x3e948f-0x0;var _0x4cc3de=_0xe6d7[_0x3e948f];return _0x4cc3de;};'use strict';var multer=require('multer');var util=require(_0x7e6d('0x0'));var path=require(_0x7e6d('0x1'));var timeout=require(_0x7e6d('0x2'));var express=require(_0x7e6d('0x3'));var router=express['Router']();var auth=require(_0x7e6d('0x4'));var interaction=require(_0x7e6d('0x5'));var config=require(_0x7e6d('0x6'));var controller=require(_0x7e6d('0x7'));router['get']('/:id',auth[_0x7e6d('0x8')](),controller[_0x7e6d('0x9')]);router[_0x7e6d('0xa')]('/',auth[_0x7e6d('0x8')](),controller['create']);router['put'](_0x7e6d('0xb'),auth[_0x7e6d('0x8')](),controller['update']);router['delete'](_0x7e6d('0xb'),auth[_0x7e6d('0x8')](),controller[_0x7e6d('0xc')]);module[_0x7e6d('0xd')]=router; \ No newline at end of file +var _0x1b9c=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./dashboardItem.controller','get'];(function(_0x315897,_0x11e7a2){var _0x5cb578=function(_0x2e6d24){while(--_0x2e6d24){_0x315897['push'](_0x315897['shift']());}};_0x5cb578(++_0x11e7a2);}(_0x1b9c,0x109));var _0xc1b9=function(_0x1b4026,_0x1a37d3){_0x1b4026=_0x1b4026-0x0;var _0x23627c=_0x1b9c[_0x1b4026];return _0x23627c;};'use strict';var multer=require(_0xc1b9('0x0'));var util=require('util');var path=require(_0xc1b9('0x1'));var timeout=require(_0xc1b9('0x2'));var express=require(_0xc1b9('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc1b9('0x4'));var config=require('../../config/environment');var controller=require(_0xc1b9('0x5'));router[_0xc1b9('0x6')](_0xc1b9('0x7'),auth[_0xc1b9('0x8')](),controller[_0xc1b9('0x9')]);router[_0xc1b9('0xa')]('/',auth[_0xc1b9('0x8')](),controller[_0xc1b9('0xb')]);router[_0xc1b9('0xc')](_0xc1b9('0x7'),auth['isAuthenticated'](),controller[_0xc1b9('0xd')]);router[_0xc1b9('0xe')](_0xc1b9('0x7'),auth[_0xc1b9('0x8')](),controller[_0xc1b9('0xf')]);module[_0xc1b9('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 76d75b4..f708ced 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 _0x526b=['STRING','sequelize','exports'];(function(_0x437339,_0x5ef32b){var _0x3b4c70=function(_0x227cab){while(--_0x227cab){_0x437339['push'](_0x437339['shift']());}};_0x3b4c70(++_0x5ef32b);}(_0x526b,0xeb));var _0xb526=function(_0x49316e,_0x25f440){_0x49316e=_0x49316e-0x0;var _0x1a9457=_0x526b[_0x49316e];return _0x1a9457;};'use strict';var Sequelize=require(_0xb526('0x0'));module[_0xb526('0x1')]={'name':{'type':Sequelize[_0xb526('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf628=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf628,0x103));var _0x8f62=function(_0x417c3d,_0xa26a47){_0x417c3d=_0x417c3d-0x0;var _0x1780de=_0xf628[_0x417c3d];return _0x1780de;};'use strict';var Sequelize=require(_0x8f62('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f62('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 8bc1d44..32469fe 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 _0xf481=['to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','Disposition','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','include','findAll','rows','catch','show','params','find','create','body','user','role','Dispositions','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0xf481,0x18a));var _0x1f48=function(_0x3ec0e8,_0x485a9d){_0x3ec0e8=_0x3ec0e8-0x0;var _0x26fd54=_0xf481[_0x3ec0e8];return _0x26fd54;};'use strict';var pdf=require(_0x1f48('0x0'));var emlformat=require(_0x1f48('0x1'));var rimraf=require(_0x1f48('0x2'));var zipdir=require(_0x1f48('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f48('0x4'));var moment=require(_0x1f48('0x5'));var BPromise=require(_0x1f48('0x6'));var Mustache=require(_0x1f48('0x7'));var util=require(_0x1f48('0x8'));var path=require(_0x1f48('0x9'));var sox=require(_0x1f48('0xa'));var csv=require(_0x1f48('0xb'));var ejs=require(_0x1f48('0xc'));var fs=require('fs');var _=require(_0x1f48('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1f48('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1f48('0xb'));var querystring=require(_0x1f48('0xf'));var Papa=require(_0x1f48('0x10'));var authService=require(_0x1f48('0x11'));var hardwareService=require(_0x1f48('0x12'));var Redis=require(_0x1f48('0x13'));var qs=require(_0x1f48('0x14'));var logger=require(_0x1f48('0x15'))(_0x1f48('0x16'));var utils=require(_0x1f48('0x17'));var config=require(_0x1f48('0x18'));var db=require(_0x1f48('0x19'))['db'];function respondWithStatusCode(_0x17f65b,_0x2ce267){_0x2ce267=_0x2ce267||0xcc;return function(_0x413005){if(_0x413005){return _0x17f65b[_0x1f48('0x1a')](_0x2ce267);}return _0x17f65b[_0x1f48('0x1b')](_0x2ce267)['end']();};}function respondWithResult(_0x52a9aa,_0x5d96ab){_0x5d96ab=_0x5d96ab||0xc8;return function(_0x37e328){if(_0x37e328){return _0x52a9aa[_0x1f48('0x1b')](_0x5d96ab)[_0x1f48('0x1c')](_0x37e328);}};}function respondWithFilteredResult(_0xf06634,_0x2be7f8){return function(_0xdb52c8){if(_0xdb52c8){var _0xf9fe1a=_0xdb52c8['count'],_0x5129d2=_0x2be7f8[_0x1f48('0x1d')],_0x496bc4=_0x2be7f8[_0x1f48('0x1d')]+_0x2be7f8[_0x1f48('0x1e')],_0x3f00a9;if(_0x496bc4>=_0xf9fe1a){_0x496bc4=_0xf9fe1a;_0x3f00a9=0xc8;}else{_0x3f00a9=0xce;}_0xf06634['status'](_0x3f00a9);return _0xf06634[_0x1f48('0x1f')]('Content-Range',_0x5129d2+'-'+_0x496bc4+'/'+_0xf9fe1a)[_0x1f48('0x1c')](_0xdb52c8);}return null;};}function patchUpdates(_0x34d58f){return function(_0x32a5a4){try{jsonpatch['apply'](_0x32a5a4,_0x34d58f,!![]);}catch(_0x27c624){return BPromise['reject'](_0x27c624);}return _0x32a5a4[_0x1f48('0x20')]();};}function saveUpdates(_0x32c160,_0x4a07b8){return function(_0x16c8c7){if(_0x16c8c7){return _0x16c8c7[_0x1f48('0x21')](_0x32c160)[_0x1f48('0x22')](function(_0x15c022){return _0x15c022;});}return null;};}function removeEntity(_0x3ab760,_0x57ad32){return function(_0x17660e){if(_0x17660e){return _0x17660e[_0x1f48('0x23')]()[_0x1f48('0x22')](function(){var _0x568945=_0x17660e[_0x1f48('0x24')]({'plain':!![]});var _0x19b142='Dispositions';return db[_0x1f48('0x25')][_0x1f48('0x23')]({'where':{'type':_0x19b142,'resourceId':_0x568945['id']}})[_0x1f48('0x22')](function(){return _0x17660e;});})[_0x1f48('0x22')](function(){_0x3ab760[_0x1f48('0x1b')](0xcc)[_0x1f48('0x26')]();});}};}function handleEntityNotFound(_0x54296c,_0x4cf410){return function(_0x156650){if(!_0x156650){_0x54296c[_0x1f48('0x1a')](0x194);}return _0x156650;};}function handleError(_0x3d6084,_0x2bbca1){_0x2bbca1=_0x2bbca1||0x1f4;return function(_0x47ef10){logger[_0x1f48('0x27')](_0x47ef10[_0x1f48('0x28')]);if(_0x47ef10['name']){delete _0x47ef10[_0x1f48('0x29')];}_0x3d6084[_0x1f48('0x1b')](_0x2bbca1)['send'](_0x47ef10);};}exports[_0x1f48('0x2a')]=function(_0x4862d5,_0x49778c){var _0x53fce3={},_0x5d854c={},_0x5e54fb={'count':0x0,'rows':[]};var _0x40a343=db[_0x1f48('0x2b')][_0x1f48('0x2c')];_0x5d854c['model']=_[_0x1f48('0x2d')](_0x40a343);_0x5d854c[_0x1f48('0x2e')]=_[_0x1f48('0x2d')](_0x4862d5[_0x1f48('0x2e')]);_0x5d854c[_0x1f48('0x2f')]=_[_0x1f48('0x30')](_0x5d854c['model'],_0x5d854c[_0x1f48('0x2e')]);_0x53fce3['attributes']=_[_0x1f48('0x30')](_0x5d854c[_0x1f48('0x31')],qs[_0x1f48('0x32')](_0x4862d5[_0x1f48('0x2e')][_0x1f48('0x32')]));_0x53fce3[_0x1f48('0x33')]=_0x53fce3[_0x1f48('0x33')][_0x1f48('0x34')]?_0x53fce3['attributes']:_0x5d854c[_0x1f48('0x31')];if(!_0x4862d5[_0x1f48('0x2e')][_0x1f48('0x35')]('nolimit')){_0x53fce3['limit']=qs[_0x1f48('0x1e')](_0x4862d5[_0x1f48('0x2e')][_0x1f48('0x1e')]);_0x53fce3[_0x1f48('0x1d')]=qs['offset'](_0x4862d5[_0x1f48('0x2e')][_0x1f48('0x1d')]);}_0x53fce3[_0x1f48('0x36')]=qs[_0x1f48('0x37')](_0x4862d5[_0x1f48('0x2e')][_0x1f48('0x37')]);_0x53fce3[_0x1f48('0x38')]=qs[_0x1f48('0x2f')](_[_0x1f48('0x39')](_0x4862d5[_0x1f48('0x2e')],_0x5d854c[_0x1f48('0x2f')]));if(_0x4862d5[_0x1f48('0x2e')][_0x1f48('0x3a')]){_0x53fce3[_0x1f48('0x38')]=_['merge'](_0x53fce3['where'],{'$or':_[_0x1f48('0x3b')](_0x40a343,function(_0x8701ce){if(_0x8701ce[_0x1f48('0x3c')][_0x1f48('0x3d')]!==_0x1f48('0x3e')){var _0x589c6c={};_0x589c6c[_0x8701ce[_0x1f48('0x3f')]]={'$like':'%'+_0x4862d5['query'][_0x1f48('0x3a')]+'%'};return _0x589c6c;}})});}_0x53fce3=_[_0x1f48('0x40')]({},_0x53fce3,_0x4862d5[_0x1f48('0x41')]);var _0x598d2f={'where':_0x53fce3[_0x1f48('0x38')]};return db[_0x1f48('0x2b')][_0x1f48('0x42')](_0x598d2f)[_0x1f48('0x22')](function(_0x1ba50d){_0x5e54fb[_0x1f48('0x42')]=_0x1ba50d;if(_0x4862d5[_0x1f48('0x2e')]['includeAll']){_0x53fce3[_0x1f48('0x43')]=[{'all':!![]}];}return db[_0x1f48('0x2b')][_0x1f48('0x44')](_0x53fce3);})[_0x1f48('0x22')](function(_0x27e919){_0x5e54fb[_0x1f48('0x45')]=_0x27e919;return _0x5e54fb;})[_0x1f48('0x22')](respondWithFilteredResult(_0x49778c,_0x53fce3))[_0x1f48('0x46')](handleError(_0x49778c,null));};exports[_0x1f48('0x47')]=function(_0x589dd5,_0x2287e2){var _0x89bb8d={'raw':!![],'where':{'id':_0x589dd5[_0x1f48('0x48')]['id']}},_0x4ede17={};_0x4ede17[_0x1f48('0x31')]=_[_0x1f48('0x2d')](db[_0x1f48('0x2b')][_0x1f48('0x2c')]);_0x4ede17['query']=_['keys'](_0x589dd5[_0x1f48('0x2e')]);_0x4ede17[_0x1f48('0x2f')]=_[_0x1f48('0x30')](_0x4ede17[_0x1f48('0x31')],_0x4ede17[_0x1f48('0x2e')]);_0x89bb8d[_0x1f48('0x33')]=_[_0x1f48('0x30')](_0x4ede17[_0x1f48('0x31')],qs[_0x1f48('0x32')](_0x589dd5['query'][_0x1f48('0x32')]));_0x89bb8d[_0x1f48('0x33')]=_0x89bb8d[_0x1f48('0x33')]['length']?_0x89bb8d[_0x1f48('0x33')]:_0x4ede17[_0x1f48('0x31')];if(_0x589dd5[_0x1f48('0x2e')]['includeAll']){_0x89bb8d[_0x1f48('0x43')]=[{'all':!![]}];}_0x89bb8d=_[_0x1f48('0x40')]({},_0x89bb8d,_0x589dd5[_0x1f48('0x41')]);return db[_0x1f48('0x2b')][_0x1f48('0x49')](_0x89bb8d)['then'](handleEntityNotFound(_0x2287e2,null))[_0x1f48('0x22')](respondWithResult(_0x2287e2,null))[_0x1f48('0x46')](handleError(_0x2287e2,null));};exports['create']=function(_0x151ba4,_0x477bbf){return db[_0x1f48('0x2b')][_0x1f48('0x4a')](_0x151ba4[_0x1f48('0x4b')],{})[_0x1f48('0x22')](function(_0xdc98fa){var _0x25ffd1=_0x151ba4[_0x1f48('0x4c')][_0x1f48('0x24')]({'plain':!![]});if(!_0x25ffd1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25ffd1[_0x1f48('0x4d')]===_0x1f48('0x4c')){var _0x41afdd=_0xdc98fa['get']({'plain':!![]});var _0x16db2d=_0x1f48('0x4e');return db['UserProfileSection'][_0x1f48('0x49')]({'where':{'name':_0x16db2d,'userProfileId':_0x25ffd1[_0x1f48('0x4f')]},'raw':!![]})[_0x1f48('0x22')](function(_0xfcd185){if(_0xfcd185&&_0xfcd185['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x41afdd['name'],'resourceId':_0x41afdd['id'],'type':_0xfcd185[_0x1f48('0x29')],'sectionId':_0xfcd185['id']},{})[_0x1f48('0x22')](function(){return _0xdc98fa;});}else{return _0xdc98fa;}})[_0x1f48('0x46')](function(_0x1fd97f){logger[_0x1f48('0x27')](_0x1f48('0x50'),_0x1fd97f);throw _0x1fd97f;});}return _0xdc98fa;})['then'](respondWithResult(_0x477bbf,0xc9))[_0x1f48('0x46')](handleError(_0x477bbf,null));};exports[_0x1f48('0x21')]=function(_0x4ada09,_0x31f69c){if(_0x4ada09['body']['id']){delete _0x4ada09[_0x1f48('0x4b')]['id'];}return db[_0x1f48('0x2b')][_0x1f48('0x49')]({'where':{'id':_0x4ada09[_0x1f48('0x48')]['id']}})[_0x1f48('0x22')](handleEntityNotFound(_0x31f69c,null))[_0x1f48('0x22')](saveUpdates(_0x4ada09['body'],null))[_0x1f48('0x22')](respondWithResult(_0x31f69c,null))[_0x1f48('0x46')](handleError(_0x31f69c,null));};exports[_0x1f48('0x23')]=function(_0x51815f,_0x3b6c67){return db[_0x1f48('0x2b')][_0x1f48('0x49')]({'where':{'id':_0x51815f[_0x1f48('0x48')]['id']}})[_0x1f48('0x22')](handleEntityNotFound(_0x3b6c67,null))[_0x1f48('0x22')](removeEntity(_0x3b6c67,null))[_0x1f48('0x46')](handleError(_0x3b6c67,null));}; \ No newline at end of file +var _0x04c2=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','index','Disposition','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','length','options','find','create','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x3f2f19,_0x2ea0c4){var _0x18f929=function(_0x358d09){while(--_0x358d09){_0x3f2f19['push'](_0x3f2f19['shift']());}};_0x18f929(++_0x2ea0c4);}(_0x04c2,0x143));var _0x204c=function(_0x55933f,_0x33712b){_0x55933f=_0x55933f-0x0;var _0x588e8d=_0x04c2[_0x55933f];return _0x588e8d;};'use strict';var pdf=require(_0x204c('0x0'));var emlformat=require(_0x204c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x204c('0x2'));var jsonpatch=require(_0x204c('0x3'));var rp=require(_0x204c('0x4'));var moment=require(_0x204c('0x5'));var BPromise=require(_0x204c('0x6'));var Mustache=require('mustache');var util=require(_0x204c('0x7'));var path=require(_0x204c('0x8'));var sox=require(_0x204c('0x9'));var csv=require(_0x204c('0xa'));var ejs=require(_0x204c('0xb'));var fs=require('fs');var _=require(_0x204c('0xc'));var squel=require(_0x204c('0xd'));var crypto=require(_0x204c('0xe'));var jsforce=require(_0x204c('0xf'));var deskjs=require(_0x204c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x204c('0x11'));var Papa=require(_0x204c('0x12'));var authService=require(_0x204c('0x13'));var hardwareService=require(_0x204c('0x14'));var Redis=require(_0x204c('0x15'));var qs=require(_0x204c('0x16'));var logger=require(_0x204c('0x17'))(_0x204c('0x18'));var utils=require(_0x204c('0x19'));var config=require(_0x204c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e4b7e,_0x444855){_0x444855=_0x444855||0xcc;return function(_0x317038){if(_0x317038){return _0x4e4b7e[_0x204c('0x1b')](_0x444855);}return _0x4e4b7e['status'](_0x444855)[_0x204c('0x1c')]();};}function respondWithResult(_0x1d6713,_0xc46afd){_0xc46afd=_0xc46afd||0xc8;return function(_0x3f1db8){if(_0x3f1db8){return _0x1d6713[_0x204c('0x1d')](_0xc46afd)[_0x204c('0x1e')](_0x3f1db8);}};}function respondWithFilteredResult(_0xdb2f9a,_0x2a98f6){return function(_0x13d68d){if(_0x13d68d){var _0x37eae0=_0x13d68d[_0x204c('0x1f')],_0x2dd02c=_0x2a98f6[_0x204c('0x20')],_0x16d548=_0x2a98f6[_0x204c('0x20')]+_0x2a98f6[_0x204c('0x21')],_0x18fea7;if(_0x16d548>=_0x37eae0){_0x16d548=_0x37eae0;_0x18fea7=0xc8;}else{_0x18fea7=0xce;}_0xdb2f9a[_0x204c('0x1d')](_0x18fea7);return _0xdb2f9a[_0x204c('0x22')]('Content-Range',_0x2dd02c+'-'+_0x16d548+'/'+_0x37eae0)[_0x204c('0x1e')](_0x13d68d);}return null;};}function patchUpdates(_0xafc84a){return function(_0x33f83b){try{jsonpatch[_0x204c('0x23')](_0x33f83b,_0xafc84a,!![]);}catch(_0x25a0cb){return BPromise[_0x204c('0x24')](_0x25a0cb);}return _0x33f83b[_0x204c('0x25')]();};}function saveUpdates(_0x5e13f0,_0x415dd7){return function(_0x1e46de){if(_0x1e46de){return _0x1e46de[_0x204c('0x26')](_0x5e13f0)[_0x204c('0x27')](function(_0xdad7e3){return _0xdad7e3;});}return null;};}function removeEntity(_0x127549,_0x57b667){return function(_0x5e800d){if(_0x5e800d){return _0x5e800d[_0x204c('0x28')]()[_0x204c('0x27')](function(){var _0x1861d7=_0x5e800d['get']({'plain':!![]});var _0x3e36d1=_0x204c('0x29');return db[_0x204c('0x2a')]['destroy']({'where':{'type':_0x3e36d1,'resourceId':_0x1861d7['id']}})[_0x204c('0x27')](function(){return _0x5e800d;});})['then'](function(){_0x127549[_0x204c('0x1d')](0xcc)[_0x204c('0x1c')]();});}};}function handleEntityNotFound(_0x1df4b6,_0x5efcfe){return function(_0x1d3936){if(!_0x1d3936){_0x1df4b6[_0x204c('0x1b')](0x194);}return _0x1d3936;};}function handleError(_0x9a456f,_0x5a3bdc){_0x5a3bdc=_0x5a3bdc||0x1f4;return function(_0x1f1a74){logger[_0x204c('0x2b')](_0x1f1a74[_0x204c('0x2c')]);if(_0x1f1a74[_0x204c('0x2d')]){delete _0x1f1a74['name'];}_0x9a456f[_0x204c('0x1d')](_0x5a3bdc)[_0x204c('0x2e')](_0x1f1a74);};}exports[_0x204c('0x2f')]=function(_0x446d4f,_0x234440){var _0x45320={},_0x5ce827={},_0x5cc3b6={'count':0x0,'rows':[]};var _0x447a41=db[_0x204c('0x30')][_0x204c('0x31')];_0x5ce827[_0x204c('0x32')]=_[_0x204c('0x33')](_0x447a41);_0x5ce827['query']=_[_0x204c('0x33')](_0x446d4f[_0x204c('0x34')]);_0x5ce827['filters']=_[_0x204c('0x35')](_0x5ce827['model'],_0x5ce827['query']);_0x45320[_0x204c('0x36')]=_[_0x204c('0x35')](_0x5ce827['model'],qs['fields'](_0x446d4f[_0x204c('0x34')][_0x204c('0x37')]));_0x45320[_0x204c('0x36')]=_0x45320['attributes']['length']?_0x45320[_0x204c('0x36')]:_0x5ce827['model'];if(!_0x446d4f[_0x204c('0x34')][_0x204c('0x38')](_0x204c('0x39'))){_0x45320[_0x204c('0x21')]=qs[_0x204c('0x21')](_0x446d4f['query'][_0x204c('0x21')]);_0x45320[_0x204c('0x20')]=qs[_0x204c('0x20')](_0x446d4f[_0x204c('0x34')][_0x204c('0x20')]);}_0x45320['order']=qs['sort'](_0x446d4f[_0x204c('0x34')][_0x204c('0x3a')]);_0x45320[_0x204c('0x3b')]=qs['filters'](_[_0x204c('0x3c')](_0x446d4f[_0x204c('0x34')],_0x5ce827[_0x204c('0x3d')]));if(_0x446d4f['query']['filter']){_0x45320[_0x204c('0x3b')]=_[_0x204c('0x3e')](_0x45320['where'],{'$or':_['map'](_0x447a41,function(_0x567f1c){if(_0x567f1c[_0x204c('0x3f')]['key']!==_0x204c('0x40')){var _0x124b4f={};_0x124b4f[_0x567f1c['field']]={'$like':'%'+_0x446d4f[_0x204c('0x34')][_0x204c('0x41')]+'%'};return _0x124b4f;}})});}_0x45320=_[_0x204c('0x3e')]({},_0x45320,_0x446d4f['options']);var _0x3775f6={'where':_0x45320[_0x204c('0x3b')]};return db[_0x204c('0x30')][_0x204c('0x1f')](_0x3775f6)[_0x204c('0x27')](function(_0x14a106){_0x5cc3b6[_0x204c('0x1f')]=_0x14a106;if(_0x446d4f[_0x204c('0x34')][_0x204c('0x42')]){_0x45320[_0x204c('0x43')]=[{'all':!![]}];}return db[_0x204c('0x30')]['findAll'](_0x45320);})[_0x204c('0x27')](function(_0x1ba0f3){_0x5cc3b6[_0x204c('0x44')]=_0x1ba0f3;return _0x5cc3b6;})[_0x204c('0x27')](respondWithFilteredResult(_0x234440,_0x45320))[_0x204c('0x45')](handleError(_0x234440,null));};exports[_0x204c('0x46')]=function(_0x237a0a,_0x313d93){var _0x1e4e69={'raw':!![],'where':{'id':_0x237a0a['params']['id']}},_0x199c11={};_0x199c11[_0x204c('0x32')]=_[_0x204c('0x33')](db[_0x204c('0x30')][_0x204c('0x31')]);_0x199c11[_0x204c('0x34')]=_[_0x204c('0x33')](_0x237a0a[_0x204c('0x34')]);_0x199c11[_0x204c('0x3d')]=_[_0x204c('0x35')](_0x199c11['model'],_0x199c11['query']);_0x1e4e69[_0x204c('0x36')]=_[_0x204c('0x35')](_0x199c11[_0x204c('0x32')],qs[_0x204c('0x37')](_0x237a0a['query'][_0x204c('0x37')]));_0x1e4e69[_0x204c('0x36')]=_0x1e4e69[_0x204c('0x36')][_0x204c('0x47')]?_0x1e4e69[_0x204c('0x36')]:_0x199c11[_0x204c('0x32')];if(_0x237a0a[_0x204c('0x34')][_0x204c('0x42')]){_0x1e4e69[_0x204c('0x43')]=[{'all':!![]}];}_0x1e4e69=_[_0x204c('0x3e')]({},_0x1e4e69,_0x237a0a[_0x204c('0x48')]);return db[_0x204c('0x30')][_0x204c('0x49')](_0x1e4e69)[_0x204c('0x27')](handleEntityNotFound(_0x313d93,null))[_0x204c('0x27')](respondWithResult(_0x313d93,null))[_0x204c('0x45')](handleError(_0x313d93,null));};exports[_0x204c('0x4a')]=function(_0x23fcf6,_0x305c42){return db[_0x204c('0x30')]['create'](_0x23fcf6['body'],{})['then'](function(_0xda2539){var _0x27dc3a=_0x23fcf6[_0x204c('0x4b')][_0x204c('0x4c')]({'plain':!![]});if(!_0x27dc3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27dc3a[_0x204c('0x4d')]===_0x204c('0x4b')){var _0x430a3c=_0xda2539['get']({'plain':!![]});var _0x310ea8=_0x204c('0x29');return db['UserProfileSection'][_0x204c('0x49')]({'where':{'name':_0x310ea8,'userProfileId':_0x27dc3a[_0x204c('0x4e')]},'raw':!![]})['then'](function(_0x1f097d){if(_0x1f097d&&_0x1f097d[_0x204c('0x4f')]===0x0){return db[_0x204c('0x2a')][_0x204c('0x4a')]({'name':_0x430a3c['name'],'resourceId':_0x430a3c['id'],'type':_0x1f097d[_0x204c('0x2d')],'sectionId':_0x1f097d['id']},{})[_0x204c('0x27')](function(){return _0xda2539;});}else{return _0xda2539;}})[_0x204c('0x45')](function(_0x5e48e0){logger[_0x204c('0x2b')](_0x204c('0x50'),_0x5e48e0);throw _0x5e48e0;});}return _0xda2539;})[_0x204c('0x27')](respondWithResult(_0x305c42,0xc9))['catch'](handleError(_0x305c42,null));};exports[_0x204c('0x26')]=function(_0x44f019,_0x12495b){if(_0x44f019[_0x204c('0x51')]['id']){delete _0x44f019[_0x204c('0x51')]['id'];}return db[_0x204c('0x30')][_0x204c('0x49')]({'where':{'id':_0x44f019[_0x204c('0x52')]['id']}})[_0x204c('0x27')](handleEntityNotFound(_0x12495b,null))[_0x204c('0x27')](saveUpdates(_0x44f019['body'],null))[_0x204c('0x27')](respondWithResult(_0x12495b,null))[_0x204c('0x45')](handleError(_0x12495b,null));};exports[_0x204c('0x28')]=function(_0x1f15eb,_0x3d5a7c){return db[_0x204c('0x30')]['find']({'where':{'id':_0x1f15eb[_0x204c('0x52')]['id']}})[_0x204c('0x27')](handleEntityNotFound(_0x3d5a7c,null))[_0x204c('0x27')](removeEntity(_0x3d5a7c,null))['catch'](handleError(_0x3d5a7c,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 2be2e60..a1445d4 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 _0x66fa=['tools_dispositions','name_voice','name','ListId','name_mail','MailAccountId','name_fax','name_openchannel','OpenchannelAccountId','lodash','util','api','moment','bluebird','request-promise','./disposition.attributes','exports','Disposition'];(function(_0x2d14cd,_0x47e7f1){var _0x24119d=function(_0x2097dd){while(--_0x2097dd){_0x2d14cd['push'](_0x2d14cd['shift']());}};_0x24119d(++_0x47e7f1);}(_0x66fa,0x117));var _0xa66f=function(_0xd3a447,_0x38205a){_0xd3a447=_0xd3a447-0x0;var _0x358853=_0x66fa[_0xd3a447];return _0x358853;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var attributes=require(_0xa66f('0x6'));module[_0xa66f('0x7')]=function(_0x3f4904,_0x5ebea5){return _0x3f4904['define'](_0xa66f('0x8'),attributes,{'tableName':_0xa66f('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa66f('0xa'),'fields':[_0xa66f('0xb'),_0xa66f('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0xa66f('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0xa66f('0xd'),'fields':['name',_0xa66f('0xe')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0xa66f('0xf'),'fields':[_0xa66f('0xb'),'FaxAccountId']},{'unique':!![],'name':_0xa66f('0x10'),'fields':['name',_0xa66f('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['bluebird','request-promise','./disposition.attributes','exports','define','Disposition','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','FaxAccountId','OpenchannelAccountId','lodash','util','../../config/logger','api'];(function(_0x3831ef,_0x58fea6){var _0x32c7c6=function(_0x515d93){while(--_0x515d93){_0x3831ef['push'](_0x3831ef['shift']());}};_0x32c7c6(++_0x58fea6);}(_0xdb28,0x106));var _0x8db2=function(_0x4ebcf8,_0x5cebd1){_0x4ebcf8=_0x4ebcf8-0x0;var _0x996b95=_0xdb28[_0x4ebcf8];return _0x996b95;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var attributes=require(_0x8db2('0x6'));module[_0x8db2('0x7')]=function(_0x11109e,_0x52bf99){return _0x11109e[_0x8db2('0x8')](_0x8db2('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x8db2('0xa'),_0x8db2('0xb')]},{'unique':!![],'name':_0x8db2('0xc'),'fields':[_0x8db2('0xa'),_0x8db2('0xd')]},{'unique':!![],'name':_0x8db2('0xe'),'fields':[_0x8db2('0xa'),'MailAccountId']},{'unique':!![],'name':_0x8db2('0xf'),'fields':[_0x8db2('0xa'),_0x8db2('0x10')]},{'unique':!![],'name':'name_fax','fields':[_0x8db2('0xa'),_0x8db2('0x11')]},{'unique':!![],'name':'name_openchannel','fields':[_0x8db2('0xa'),_0x8db2('0x12')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ebaee3a..fc9599c 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 _0x85d0=['../../config/logger','rpc','jayson/promise','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3fcbc5,_0x3bbb20){var _0x305659=function(_0xa92904){while(--_0xa92904){_0x3fcbc5['push'](_0x3fcbc5['shift']());}};_0x305659(++_0x3bbb20);}(_0x85d0,0x164));var _0x085d=function(_0x42633b,_0x44e927){_0x42633b=_0x42633b-0x0;var _0x483bef=_0x85d0[_0x42633b];return _0x483bef;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x085d('0x0'));var fs=require('fs');var Redis=require(_0x085d('0x1'));var db=require(_0x085d('0x2'))['db'];var utils=require(_0x085d('0x3'));var logger=require(_0x085d('0x4'))(_0x085d('0x5'));var config=require('../../config/environment');var jayson=require(_0x085d('0x6'));var client=jayson['client'][_0x085d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9acc97,_0x2a6902,_0x4a12b7){return new BPromise(function(_0xf65d01,_0xa94124){return client[_0x085d('0x8')](_0x9acc97,_0x4a12b7)[_0x085d('0x9')](function(_0x349271){logger[_0x085d('0xa')](_0x085d('0xb'),_0x2a6902,_0x085d('0xc'));logger[_0x085d('0xd')]('Disposition,\x20%s,\x20%s,\x20%s',_0x2a6902,_0x085d('0xc'),JSON[_0x085d('0xe')](_0x349271));if(_0x349271[_0x085d('0xf')]){if(_0x349271[_0x085d('0xf')]['code']===0x1f4){logger[_0x085d('0xf')](_0x085d('0xb'),_0x2a6902,_0x349271['error'][_0x085d('0x10')]);return _0xa94124(_0x349271[_0x085d('0xf')][_0x085d('0x10')]);}logger[_0x085d('0xf')]('Disposition,\x20%s,\x20%s',_0x2a6902,_0x349271[_0x085d('0xf')][_0x085d('0x10')]);return _0xf65d01(_0x349271['error']['message']);}else{logger[_0x085d('0xa')](_0x085d('0xb'),_0x2a6902,_0x085d('0xc'));_0xf65d01(_0x349271[_0x085d('0x11')][_0x085d('0x10')]);}})['catch'](function(_0x2b29be){logger[_0x085d('0xf')](_0x085d('0xb'),_0x2a6902,_0x2b29be);_0xa94124(_0x2b29be);});});} \ No newline at end of file +var _0x1b20=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','ioredis'];(function(_0x3c5a79,_0x565097){var _0x52835f=function(_0x139063){while(--_0x139063){_0x3c5a79['push'](_0x3c5a79['shift']());}};_0x52835f(++_0x565097);}(_0x1b20,0x66));var _0x01b2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b20[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var moment=require(_0x01b2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01b2('0x2'));var db=require(_0x01b2('0x3'))['db'];var utils=require(_0x01b2('0x4'));var logger=require(_0x01b2('0x5'))(_0x01b2('0x6'));var config=require(_0x01b2('0x7'));var jayson=require(_0x01b2('0x8'));var client=jayson[_0x01b2('0x9')][_0x01b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa64ad1,_0x43d561,_0x323470){return new BPromise(function(_0x508add,_0x132a08){return client['request'](_0xa64ad1,_0x323470)[_0x01b2('0xb')](function(_0x157fb6){logger[_0x01b2('0xc')](_0x01b2('0xd'),_0x43d561,_0x01b2('0xe'));logger[_0x01b2('0xf')](_0x01b2('0x10'),_0x43d561,_0x01b2('0xe'),JSON['stringify'](_0x157fb6));if(_0x157fb6[_0x01b2('0x11')]){if(_0x157fb6['error'][_0x01b2('0x12')]===0x1f4){logger['error'](_0x01b2('0xd'),_0x43d561,_0x157fb6[_0x01b2('0x11')][_0x01b2('0x13')]);return _0x132a08(_0x157fb6[_0x01b2('0x11')]['message']);}logger[_0x01b2('0x11')](_0x01b2('0xd'),_0x43d561,_0x157fb6[_0x01b2('0x11')][_0x01b2('0x13')]);return _0x508add(_0x157fb6[_0x01b2('0x11')]['message']);}else{logger[_0x01b2('0xc')](_0x01b2('0xd'),_0x43d561,_0x01b2('0xe'));_0x508add(_0x157fb6[_0x01b2('0x14')]['message']);}})['catch'](function(_0x2a8458){logger[_0x01b2('0x11')]('Disposition,\x20%s,\x20%s',_0x43d561,_0x2a8458);_0x132a08(_0x2a8458);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 1966b5e..1bc576f 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 _0x70ac=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','/:id','post','update','delete','destroy','multer'];(function(_0x54703a,_0x5ad1d9){var _0x304971=function(_0x2a87d3){while(--_0x2a87d3){_0x54703a['push'](_0x54703a['shift']());}};_0x304971(++_0x5ad1d9);}(_0x70ac,0x153));var _0xc70a=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x70ac[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0xc70a('0x0'));var util=require(_0xc70a('0x1'));var path=require(_0xc70a('0x2'));var timeout=require(_0xc70a('0x3'));var express=require(_0xc70a('0x4'));var router=express[_0xc70a('0x5')]();var auth=require(_0xc70a('0x6'));var interaction=require(_0xc70a('0x7'));var config=require(_0xc70a('0x8'));var controller=require(_0xc70a('0x9'));router['get']('/',auth[_0xc70a('0xa')](),controller[_0xc70a('0xb')]);router['get'](_0xc70a('0xc'),auth[_0xc70a('0xa')](),controller['show']);router[_0xc70a('0xd')]('/',auth[_0xc70a('0xa')](),controller['create']);router['put'](_0xc70a('0xc'),auth[_0xc70a('0xa')](),controller[_0xc70a('0xe')]);router[_0xc70a('0xf')](_0xc70a('0xc'),auth[_0xc70a('0xa')](),controller[_0xc70a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1128=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5bfb6d,_0x40a2da){var _0x4bdcaa=function(_0xd21141){while(--_0xd21141){_0x5bfb6d['push'](_0x5bfb6d['shift']());}};_0x4bdcaa(++_0x40a2da);}(_0x1128,0x147));var _0x8112=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0x1128[_0x57746e];return _0x5caeaa;};'use strict';var multer=require(_0x8112('0x0'));var util=require(_0x8112('0x1'));var path=require(_0x8112('0x2'));var timeout=require(_0x8112('0x3'));var express=require(_0x8112('0x4'));var router=express[_0x8112('0x5')]();var auth=require(_0x8112('0x6'));var interaction=require(_0x8112('0x7'));var config=require(_0x8112('0x8'));var controller=require(_0x8112('0x9'));router[_0x8112('0xa')]('/',auth[_0x8112('0xb')](),controller[_0x8112('0xc')]);router[_0x8112('0xa')](_0x8112('0xd'),auth[_0x8112('0xb')](),controller[_0x8112('0xe')]);router['post']('/',auth[_0x8112('0xb')](),controller['create']);router[_0x8112('0xf')]('/:id',auth[_0x8112('0xb')](),controller[_0x8112('0x10')]);router[_0x8112('0x11')](_0x8112('0xd'),auth[_0x8112('0xb')](),controller['destroy']);module[_0x8112('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 3e7d586..5a53043 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 _0xc9ed=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400','2400','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xc9ed,0x19b));var _0xdc9e=function(_0x29a753,_0x5ce67d){_0x29a753=_0x29a753-0x0;var _0x5d78c7=_0xc9ed[_0x29a753];return _0x5d78c7;};'use strict';var Sequelize=require(_0xdc9e('0x0'));module[_0xdc9e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdc9e('0x2')]},'ecm':{'type':Sequelize[_0xdc9e('0x3')](_0xdc9e('0x4'),'no'),'defaultValue':_0xdc9e('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xdc9e('0x5')},'localstationid':{'type':Sequelize[_0xdc9e('0x2')],'unique':_0xdc9e('0x6')},'minrate':{'type':Sequelize['ENUM']('2400',_0xdc9e('0x7'),_0xdc9e('0x8'),_0xdc9e('0x9'),_0xdc9e('0xa'),_0xdc9e('0xb')),'defaultValue':_0xdc9e('0x7')},'maxrate':{'type':Sequelize[_0xdc9e('0x3')](_0xdc9e('0xc'),_0xdc9e('0x7'),_0xdc9e('0x8'),_0xdc9e('0x9'),_0xdc9e('0xa'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xdc9e('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xdc9e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xdc9e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xdc9e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xdc9e('0xe'),'IAX',_0xdc9e('0xf'),_0xdc9e('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xdc9e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdc9e('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdc9e('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdc9e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdc9e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdc9e('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdc9e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc9e('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xdc9e('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xdc9e('0x12')],'defaultValue':![],'comment':_0xdc9e('0x14'),'set':function(_0x4523f1){if(!_0x4523f1)this['setDataValue'](_0xdc9e('0x15'),null);this[_0xdc9e('0x16')]('mandatoryDisposition',_0x4523f1);}}}; \ No newline at end of file +var _0x5bd0=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','12000','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0xb28123,_0x4adf7c){var _0xd4e5f0=function(_0x11bf8e){while(--_0x11bf8e){_0xb28123['push'](_0xb28123['shift']());}};_0xd4e5f0(++_0x4adf7c);}(_0x5bd0,0x162));var _0x05bd=function(_0xe323e3,_0x110473){_0xe323e3=_0xe323e3-0x0;var _0x208a43=_0x5bd0[_0xe323e3];return _0x208a43;};'use strict';var Sequelize=require(_0x05bd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x05bd('0x1')]},'ecm':{'type':Sequelize[_0x05bd('0x2')]('yes','no'),'defaultValue':_0x05bd('0x3')},'headerinfo':{'type':Sequelize[_0x05bd('0x1')],'defaultValue':_0x05bd('0x4')},'localstationid':{'type':Sequelize[_0x05bd('0x1')],'unique':_0x05bd('0x5')},'minrate':{'type':Sequelize[_0x05bd('0x2')](_0x05bd('0x6'),_0x05bd('0x7'),_0x05bd('0x8'),_0x05bd('0x9'),'12000',_0x05bd('0xa')),'defaultValue':_0x05bd('0x7')},'maxrate':{'type':Sequelize[_0x05bd('0x2')]('2400',_0x05bd('0x7'),_0x05bd('0x8'),_0x05bd('0x9'),_0x05bd('0xb'),_0x05bd('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x05bd('0xc')},'gateway':{'type':Sequelize[_0x05bd('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x05bd('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x05bd('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x05bd('0x2')](_0x05bd('0xe'),_0x05bd('0xf'),_0x05bd('0x10'),_0x05bd('0x11')),'defaultValue':_0x05bd('0xe')},'key':{'type':Sequelize[_0x05bd('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x05bd('0x12')],'defaultValue':function(){return _0x05bd('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x05bd('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x05bd('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x05bd('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x05bd('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x05bd('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x05bd('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x05bd('0x14')],'defaultValue':![],'comment':_0x05bd('0x16'),'set':function(_0x1b107a){if(!_0x1b107a)this[_0x05bd('0x17')](_0x05bd('0x18'),null);this[_0x05bd('0x17')]('mandatoryDisposition',_0x1b107a);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index d367449..134a5e5 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 _0x9253=['updateAccountApplications','update','tech','createdAt','updatedAt','ListId','FaxMessage','$gte','split','format','CmList','List','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','defaults','socket.io-emitter','redis','./faxAccount.socket','register','client','http','then','info','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','model','keys','query','filters','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','FaxAccount','include','findAll','show','attributes','includeAll','find','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','hasOwnProperty','pick','map','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Tags','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','ecm','faxdetect','headerinfo','modem','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax'];(function(_0x2aee3b,_0x6ea310){var _0x58c06f=function(_0xf47348){while(--_0xf47348){_0x2aee3b['push'](_0x2aee3b['shift']());}};_0x58c06f(++_0x6ea310);}(_0x9253,0xe0));var _0x3925=function(_0x4f3b4b,_0x590f08){_0x4f3b4b=_0x4f3b4b-0x0;var _0x1249e0=_0x9253[_0x4f3b4b];return _0x1249e0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3925('0x0'));var rimraf=require(_0x3925('0x1'));var zipdir=require(_0x3925('0x2'));var jsonpatch=require(_0x3925('0x3'));var rp=require(_0x3925('0x4'));var moment=require(_0x3925('0x5'));var BPromise=require(_0x3925('0x6'));var Mustache=require('mustache');var util=require(_0x3925('0x7'));var path=require(_0x3925('0x8'));var sox=require(_0x3925('0x9'));var csv=require(_0x3925('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3925('0xb'));var squel=require(_0x3925('0xc'));var crypto=require(_0x3925('0xd'));var jsforce=require(_0x3925('0xe'));var deskjs=require(_0x3925('0xf'));var toCsv=require(_0x3925('0xa'));var querystring=require('querystring');var Papa=require(_0x3925('0x10'));var authService=require(_0x3925('0x11'));var hardwareService=require(_0x3925('0x12'));var Redis=require(_0x3925('0x13'));var qs=require(_0x3925('0x14'));var logger=require(_0x3925('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3925('0x16'))['db'];config['redis']=_[_0x3925('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3925('0x18'))(new Redis(config[_0x3925('0x19')]));require(_0x3925('0x1a'))[_0x3925('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3925('0x1c')][_0x3925('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25dc8d,_0x4c0cfb,_0x4a9020,_0x510fa8){return new BPromise(function(_0x46fe70,_0x17d2bf){var _0x30d162=_0x510fa8||client;return _0x30d162['request'](_0x25dc8d,_0x4a9020)[_0x3925('0x1e')](function(_0x56e4a){logger[_0x3925('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x4c0cfb,_0x3925('0x20'));logger[_0x3925('0x21')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4c0cfb,_0x3925('0x20'),JSON[_0x3925('0x22')](_0x56e4a));if(_0x56e4a[_0x3925('0x23')]){if(_0x56e4a['error'][_0x3925('0x24')]===0x1f4){logger[_0x3925('0x23')](_0x3925('0x25'),_0x4c0cfb,_0x56e4a['error'][_0x3925('0x26')]);return _0x17d2bf(_0x56e4a[_0x3925('0x23')]['message']);}logger[_0x3925('0x23')](_0x3925('0x25'),_0x4c0cfb,_0x56e4a['error'][_0x3925('0x26')]);return _0x46fe70(_0x56e4a[_0x3925('0x23')]['message']);}else{logger[_0x3925('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x4c0cfb,_0x3925('0x20'));_0x46fe70(_0x56e4a[_0x3925('0x27')]['message']);}})[_0x3925('0x28')](function(_0x5a3720){logger[_0x3925('0x23')](_0x3925('0x25'),_0x4c0cfb,_0x5a3720);_0x17d2bf(_0x5a3720);});});}function respondWithStatusCode(_0x459b6b,_0x4cd15e){_0x4cd15e=_0x4cd15e||0xcc;return function(_0x5c883d){if(_0x5c883d){return _0x459b6b[_0x3925('0x29')](_0x4cd15e);}return _0x459b6b[_0x3925('0x2a')](_0x4cd15e)[_0x3925('0x2b')]();};}function respondWithResult(_0x3f6609,_0x2e193e){_0x2e193e=_0x2e193e||0xc8;return function(_0x593201){if(_0x593201){return _0x3f6609['status'](_0x2e193e)[_0x3925('0x2c')](_0x593201);}};}function respondWithFilteredResult(_0x521ad8,_0x3d0243){return function(_0x5e4c){if(_0x5e4c){var _0x4312fd=_0x5e4c[_0x3925('0x2d')],_0xefd84e=_0x3d0243[_0x3925('0x2e')],_0x1bcdf2=_0x3d0243[_0x3925('0x2e')]+_0x3d0243['limit'],_0xe7c101;if(_0x1bcdf2>=_0x4312fd){_0x1bcdf2=_0x4312fd;_0xe7c101=0xc8;}else{_0xe7c101=0xce;}_0x521ad8[_0x3925('0x2a')](_0xe7c101);return _0x521ad8[_0x3925('0x2f')]('Content-Range',_0xefd84e+'-'+_0x1bcdf2+'/'+_0x4312fd)['json'](_0x5e4c);}return null;};}function patchUpdates(_0x338748){return function(_0x11153c){try{jsonpatch[_0x3925('0x30')](_0x11153c,_0x338748,!![]);}catch(_0x1e5cc1){return BPromise[_0x3925('0x31')](_0x1e5cc1);}return _0x11153c['save']();};}function saveUpdates(_0x55495f,_0x289b57){return function(_0x404d45){if(_0x404d45){return _0x404d45['update'](_0x55495f)['then'](function(_0x36d755){return _0x36d755;});}return null;};}function removeEntity(_0x44c8f3,_0x3aec80){return function(_0x102033){if(_0x102033){return _0x102033['destroy']()[_0x3925('0x1e')](function(){var _0x4f7ad7=_0x102033[_0x3925('0x32')]({'plain':!![]});var _0x44d498=_0x3925('0x33');return db[_0x3925('0x34')][_0x3925('0x35')]({'where':{'type':_0x44d498,'resourceId':_0x4f7ad7['id']}})[_0x3925('0x1e')](function(){return _0x102033;});})['then'](function(){_0x44c8f3[_0x3925('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dd586,_0x52b4ff){return function(_0xdf54c8){if(!_0xdf54c8){_0x1dd586['sendStatus'](0x194);}return _0xdf54c8;};}function handleError(_0x5b47c2,_0x90a104){_0x90a104=_0x90a104||0x1f4;return function(_0x48b605){logger[_0x3925('0x23')](_0x48b605[_0x3925('0x36')]);if(_0x48b605[_0x3925('0x37')]){delete _0x48b605[_0x3925('0x37')];}_0x5b47c2[_0x3925('0x2a')](_0x90a104)[_0x3925('0x38')](_0x48b605);};}exports[_0x3925('0x39')]=function(_0x1eecb0,_0x2a6873){var _0xa88cf4={'include':[{'model':db[_0x3925('0x3a')],'as':_0x3925('0x3b')}]},_0x1789d6={},_0x5292a1={'count':0x0,'rows':[]};var _0x294c92=db['FaxAccount'][_0x3925('0x3c')];_0x1789d6[_0x3925('0x3d')]=_[_0x3925('0x3e')](_0x294c92);_0x1789d6['query']=_[_0x3925('0x3e')](_0x1eecb0[_0x3925('0x3f')]);_0x1789d6[_0x3925('0x40')]=_[_0x3925('0x41')](_0x1789d6[_0x3925('0x3d')],_0x1789d6['query']);_0xa88cf4['attributes']=_[_0x3925('0x41')](_0x1789d6['model'],qs[_0x3925('0x42')](_0x1eecb0[_0x3925('0x3f')][_0x3925('0x42')]));_0xa88cf4['attributes']=_0xa88cf4['attributes'][_0x3925('0x43')]?_0xa88cf4['attributes']:_0x1789d6[_0x3925('0x3d')];if(!_0x1eecb0[_0x3925('0x3f')]['hasOwnProperty'](_0x3925('0x44'))){_0xa88cf4[_0x3925('0x45')]=qs[_0x3925('0x45')](_0x1eecb0['query'][_0x3925('0x45')]);_0xa88cf4[_0x3925('0x2e')]=qs[_0x3925('0x2e')](_0x1eecb0[_0x3925('0x3f')][_0x3925('0x2e')]);}_0xa88cf4[_0x3925('0x46')]=qs[_0x3925('0x47')](_0x1eecb0[_0x3925('0x3f')]['sort']);_0xa88cf4[_0x3925('0x48')]=qs[_0x3925('0x40')](_['pick'](_0x1eecb0[_0x3925('0x3f')],_0x1789d6[_0x3925('0x40')]));if(_0x1eecb0['query'][_0x3925('0x49')]){_0xa88cf4['where']=_[_0x3925('0x4a')](_0xa88cf4[_0x3925('0x48')],{'$or':_['map'](_0x294c92,function(_0x5932cf){if(_0x5932cf[_0x3925('0x4b')][_0x3925('0x4c')]!==_0x3925('0x4d')){var _0x306ea1={};_0x306ea1[_0x5932cf[_0x3925('0x4e')]]={'$like':'%'+_0x1eecb0[_0x3925('0x3f')][_0x3925('0x49')]+'%'};return _0x306ea1;}})});}_0xa88cf4=_[_0x3925('0x4a')]({},_0xa88cf4,_0x1eecb0[_0x3925('0x4f')]);var _0x163c31={'where':_0xa88cf4[_0x3925('0x48')]};return db[_0x3925('0x50')]['count'](_0x163c31)[_0x3925('0x1e')](function(_0xb82adc){_0x5292a1[_0x3925('0x2d')]=_0xb82adc;if(_0x1eecb0[_0x3925('0x3f')]['includeAll']){_0xa88cf4[_0x3925('0x51')]=[{'all':!![]}];}return db['FaxAccount'][_0x3925('0x52')](_0xa88cf4);})[_0x3925('0x1e')](function(_0x5e1f55){_0x5292a1['rows']=_0x5e1f55;return _0x5292a1;})[_0x3925('0x1e')](respondWithFilteredResult(_0x2a6873,_0xa88cf4))['catch'](handleError(_0x2a6873,null));};exports[_0x3925('0x53')]=function(_0x335d78,_0x262423){var _0x544125={'raw':![],'where':{'id':_0x335d78['params']['id']},'include':[{'model':db['Pause'],'as':_0x3925('0x3b')}]},_0x3ef4aa={};_0x3ef4aa[_0x3925('0x3d')]=_[_0x3925('0x3e')](db[_0x3925('0x50')][_0x3925('0x3c')]);_0x3ef4aa[_0x3925('0x3f')]=_[_0x3925('0x3e')](_0x335d78['query']);_0x3ef4aa[_0x3925('0x40')]=_[_0x3925('0x41')](_0x3ef4aa[_0x3925('0x3d')],_0x3ef4aa[_0x3925('0x3f')]);_0x544125[_0x3925('0x54')]=_[_0x3925('0x41')](_0x3ef4aa[_0x3925('0x3d')],qs['fields'](_0x335d78[_0x3925('0x3f')]['fields']));_0x544125[_0x3925('0x54')]=_0x544125['attributes'][_0x3925('0x43')]?_0x544125[_0x3925('0x54')]:_0x3ef4aa[_0x3925('0x3d')];if(_0x335d78[_0x3925('0x3f')][_0x3925('0x55')]){_0x544125[_0x3925('0x51')]=[{'all':!![]}];}_0x544125=_[_0x3925('0x4a')]({},_0x544125,_0x335d78['options']);return db[_0x3925('0x50')][_0x3925('0x56')](_0x544125)[_0x3925('0x1e')](handleEntityNotFound(_0x262423,null))['then'](respondWithResult(_0x262423,null))['catch'](handleError(_0x262423,null));};exports['create']=function(_0x2c68d,_0x4f7a72){return db[_0x3925('0x50')][_0x3925('0x57')](_0x2c68d[_0x3925('0x58')],{})[_0x3925('0x1e')](function(_0x1b2387){var _0x22f8a2=_0x2c68d[_0x3925('0x59')][_0x3925('0x32')]({'plain':!![]});if(!_0x22f8a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22f8a2[_0x3925('0x5a')]===_0x3925('0x59')){var _0x993631=_0x1b2387['get']({'plain':!![]});var _0x38cea6=_0x3925('0x33');return db[_0x3925('0x5b')]['find']({'where':{'name':_0x38cea6,'userProfileId':_0x22f8a2['userProfileId']},'raw':!![]})['then'](function(_0x298501){if(_0x298501&&_0x298501['autoAssociation']===0x0){return db[_0x3925('0x34')][_0x3925('0x57')]({'name':_0x993631[_0x3925('0x37')],'resourceId':_0x993631['id'],'type':_0x298501[_0x3925('0x37')],'sectionId':_0x298501['id']},{})[_0x3925('0x1e')](function(){return _0x1b2387;});}else{return _0x1b2387;}})[_0x3925('0x28')](function(_0x24ea98){logger[_0x3925('0x23')](_0x3925('0x5c'),_0x24ea98);throw _0x24ea98;});}return _0x1b2387;})['then'](respondWithResult(_0x4f7a72,0xc9))['catch'](handleError(_0x4f7a72,null));};exports['update']=function(_0x49c951,_0x363cce){if(_0x49c951['body']['id']){delete _0x49c951['body']['id'];}return db[_0x3925('0x50')][_0x3925('0x56')]({'where':{'id':_0x49c951['params']['id']},'include':[{'model':db[_0x3925('0x3a')],'as':_0x3925('0x3b')}]})[_0x3925('0x1e')](handleEntityNotFound(_0x363cce,null))[_0x3925('0x1e')](saveUpdates(_0x49c951['body'],null))[_0x3925('0x1e')](respondWithResult(_0x363cce,null))[_0x3925('0x28')](handleError(_0x363cce,null));};exports[_0x3925('0x35')]=function(_0x38ec21,_0x5a89e7){return db[_0x3925('0x50')][_0x3925('0x56')]({'where':{'id':_0x38ec21[_0x3925('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5a89e7,null))[_0x3925('0x1e')](removeEntity(_0x5a89e7,null))[_0x3925('0x28')](handleError(_0x5a89e7,null));};exports['describe']=function(_0x261492,_0x3fffad){return db[_0x3925('0x50')][_0x3925('0x5e')]()[_0x3925('0x1e')](respondWithResult(_0x3fffad,null))[_0x3925('0x28')](handleError(_0x3fffad,null));};exports[_0x3925('0x5f')]=function(_0x1d28f0,_0x8c72ae,_0x20fd62){if(_0x1d28f0[_0x3925('0x58')]['id']){delete _0x1d28f0['body']['id'];}return db[_0x3925('0x50')][_0x3925('0x56')]({'where':{'id':_0x1d28f0['params']['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x8c72ae,null))[_0x3925('0x1e')](function(_0x2298db){if(_0x2298db){_0x1d28f0[_0x3925('0x58')][_0x3925('0x60')]=_0x2298db['id'];return db[_0x3925('0x61')][_0x3925('0x57')](_0x1d28f0['body']);}})[_0x3925('0x1e')](respondWithResult(_0x8c72ae,null))[_0x3925('0x28')](handleError(_0x8c72ae,null));};exports[_0x3925('0x62')]=function(_0x4921a1,_0xb8c7ae,_0x34c1d3){var _0x491cab={'raw':![],'where':{}};var _0x23e81d={};var _0x56d77d={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x4921a1[_0x3925('0x5d')]['id']}})['then'](handleEntityNotFound(_0xb8c7ae,null))[_0x3925('0x1e')](function(_0x3cbf88){if(_0x3cbf88){_0x23e81d['model']=_[_0x3925('0x3e')](db[_0x3925('0x61')][_0x3925('0x3c')]);_0x23e81d[_0x3925('0x3f')]=_[_0x3925('0x3e')](_0x4921a1['query']);_0x23e81d['filters']=_['intersection'](_0x23e81d[_0x3925('0x3d')],_0x23e81d[_0x3925('0x3f')]);_0x491cab[_0x3925('0x54')]=_[_0x3925('0x41')](_0x23e81d['model'],qs['fields'](_0x4921a1[_0x3925('0x3f')][_0x3925('0x42')]));_0x491cab['attributes']=_0x491cab[_0x3925('0x54')][_0x3925('0x43')]?_0x491cab[_0x3925('0x54')]:_0x23e81d[_0x3925('0x3d')];if(!_0x4921a1[_0x3925('0x3f')][_0x3925('0x63')](_0x3925('0x44'))){_0x491cab[_0x3925('0x45')]=qs['limit'](_0x4921a1[_0x3925('0x3f')][_0x3925('0x45')]);_0x491cab[_0x3925('0x2e')]=qs[_0x3925('0x2e')](_0x4921a1[_0x3925('0x3f')][_0x3925('0x2e')]);}_0x491cab[_0x3925('0x46')]=qs[_0x3925('0x47')](_0x4921a1[_0x3925('0x3f')]['sort']);_0x491cab[_0x3925('0x48')]=qs['filters'](_[_0x3925('0x64')](_0x4921a1[_0x3925('0x3f')],_0x23e81d[_0x3925('0x40')]));_0x491cab[_0x3925('0x48')][_0x3925('0x60')]=_0x3cbf88['id'];if(_0x4921a1[_0x3925('0x3f')]['filter']){_0x491cab[_0x3925('0x48')]=_['merge'](_0x491cab[_0x3925('0x48')],{'$or':_[_0x3925('0x65')](_0x491cab[_0x3925('0x54')],function(_0x4b9793){var _0x120dd9={};_0x120dd9[_0x4b9793]={'$like':'%'+_0x4921a1['query'][_0x3925('0x49')]+'%'};return _0x120dd9;})});}_0x491cab=_[_0x3925('0x4a')]({},_0x491cab,_0x4921a1[_0x3925('0x4f')]);return db[_0x3925('0x61')]['count']({'where':_0x491cab[_0x3925('0x48')]})[_0x3925('0x1e')](function(_0x253b73){_0x56d77d['count']=_0x253b73;if(_0x4921a1[_0x3925('0x3f')][_0x3925('0x55')]){_0x491cab[_0x3925('0x51')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x491cab);})[_0x3925('0x1e')](function(_0x180815){_0x56d77d[_0x3925('0x66')]=_0x180815;return _0x56d77d;});}})['then'](respondWithFilteredResult(_0xb8c7ae,_0x491cab))[_0x3925('0x28')](handleError(_0xb8c7ae,null));};exports['removeDispositions']=function(_0x2e5150,_0x1580b4,_0x2eea90){var _0x4e1d73;return db['FaxAccount']['find']({'where':{'id':_0x2e5150[_0x3925('0x5d')]['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x1580b4,null))[_0x3925('0x1e')](function(_0x38dc8f){if(_0x38dc8f){return _0x38dc8f[_0x3925('0x67')](_0x2e5150['query']['ids']);}})[_0x3925('0x1e')](respondWithStatusCode(_0x1580b4,null))[_0x3925('0x28')](handleError(_0x1580b4,null));};exports[_0x3925('0x68')]=function(_0x36ce7e,_0x26e1dc,_0x58eb84){if(_0x36ce7e[_0x3925('0x58')]['id']){delete _0x36ce7e['body']['id'];}return db[_0x3925('0x50')]['find']({'where':{'id':_0x36ce7e[_0x3925('0x5d')]['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x26e1dc,null))['then'](function(_0x23e14e){if(_0x23e14e){_0x36ce7e[_0x3925('0x58')][_0x3925('0x60')]=_0x23e14e['id'];return db[_0x3925('0x69')]['create'](_0x36ce7e['body']);}})[_0x3925('0x1e')](respondWithResult(_0x26e1dc,null))[_0x3925('0x28')](handleError(_0x26e1dc,null));};exports[_0x3925('0x6a')]=function(_0x10499a,_0x34d83a,_0x16c55b){var _0x109241={'raw':![],'where':{}};var _0x37df95={};var _0x1d31b5={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3925('0x6b')]({'where':{'id':_0x10499a[_0x3925('0x5d')]['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x34d83a,null))['then'](function(_0x555d26){if(_0x555d26){_0x37df95[_0x3925('0x3d')]=_[_0x3925('0x3e')](db[_0x3925('0x69')][_0x3925('0x3c')]);_0x37df95['query']=_['keys'](_0x10499a[_0x3925('0x3f')]);_0x37df95[_0x3925('0x40')]=_[_0x3925('0x41')](_0x37df95['model'],_0x37df95['query']);_0x109241[_0x3925('0x54')]=_[_0x3925('0x41')](_0x37df95['model'],qs['fields'](_0x10499a[_0x3925('0x3f')]['fields']));_0x109241[_0x3925('0x54')]=_0x109241['attributes'][_0x3925('0x43')]?_0x109241[_0x3925('0x54')]:_0x37df95[_0x3925('0x3d')];if(!_0x10499a[_0x3925('0x3f')]['hasOwnProperty']('nolimit')){_0x109241[_0x3925('0x45')]=qs[_0x3925('0x45')](_0x10499a[_0x3925('0x3f')]['limit']);_0x109241[_0x3925('0x2e')]=qs[_0x3925('0x2e')](_0x10499a['query'][_0x3925('0x2e')]);}_0x109241[_0x3925('0x46')]=qs[_0x3925('0x47')](_0x10499a[_0x3925('0x3f')]['sort']);_0x109241[_0x3925('0x48')]=qs[_0x3925('0x40')](_[_0x3925('0x64')](_0x10499a[_0x3925('0x3f')],_0x37df95[_0x3925('0x40')]));_0x109241[_0x3925('0x48')][_0x3925('0x60')]=_0x555d26['id'];if(_0x10499a[_0x3925('0x3f')][_0x3925('0x49')]){_0x109241['where']=_[_0x3925('0x4a')](_0x109241['where'],{'$or':_[_0x3925('0x65')](_0x109241[_0x3925('0x54')],function(_0xbf90a3){var _0x1f4c9d={};_0x1f4c9d[_0xbf90a3]={'$like':'%'+_0x10499a[_0x3925('0x3f')][_0x3925('0x49')]+'%'};return _0x1f4c9d;})});}_0x109241=_['merge']({},_0x109241,_0x10499a['options']);return db[_0x3925('0x69')][_0x3925('0x2d')]({'where':_0x109241[_0x3925('0x48')]})[_0x3925('0x1e')](function(_0x591d86){_0x1d31b5['count']=_0x591d86;if(_0x10499a['query'][_0x3925('0x55')]){_0x109241[_0x3925('0x51')]=[{'all':!![]}];}return db[_0x3925('0x69')][_0x3925('0x52')](_0x109241);})['then'](function(_0x3497e9){_0x1d31b5['rows']=_0x3497e9;return _0x1d31b5;});}})[_0x3925('0x1e')](respondWithFilteredResult(_0x34d83a,_0x109241))[_0x3925('0x28')](handleError(_0x34d83a,null));};exports['removeAnswers']=function(_0x32d7f4,_0x1bf594,_0x4692d7){var _0x1bd0c7;return db['FaxAccount'][_0x3925('0x56')]({'where':{'id':_0x32d7f4[_0x3925('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1bf594,null))[_0x3925('0x1e')](function(_0x5139bb){if(_0x5139bb){return _0x5139bb['removeAnswers'](_0x32d7f4[_0x3925('0x3f')][_0x3925('0x6c')]);}})['then'](respondWithStatusCode(_0x1bf594,null))[_0x3925('0x28')](handleError(_0x1bf594,null));};exports[_0x3925('0x6d')]=function(_0x358766,_0x2666a6,_0x412539){return db[_0x3925('0x6e')]['find']({'where':{'id':_0x358766[_0x3925('0x5d')]['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x2666a6,null))[_0x3925('0x1e')](function(_0x17521a){if(_0x17521a){return _0x17521a[_0x3925('0x6d')](_0x358766[_0x3925('0x58')]['ids'],_[_0x3925('0x6f')](_0x358766[_0x3925('0x58')],[_0x3925('0x6c'),'id'])||{});}})[_0x3925('0x1e')](respondWithResult(_0x2666a6,null))[_0x3925('0x28')](handleError(_0x2666a6,null));};exports[_0x3925('0x70')]=function(_0x22fdb6,_0x10e04e,_0x35d0ed){var _0x4b2fc6={'raw':![],'where':{}};var _0x2eb4c2={};var _0x316a7d={'count':0x0,'rows':[]};return db[_0x3925('0x50')]['findOne']({'where':{'id':_0x22fdb6['params']['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x10e04e,null))[_0x3925('0x1e')](function(_0x48835e){if(_0x48835e){_0x2eb4c2['model']=_[_0x3925('0x3e')](db[_0x3925('0x6e')][_0x3925('0x3c')]);_0x2eb4c2[_0x3925('0x3f')]=_[_0x3925('0x3e')](_0x22fdb6[_0x3925('0x3f')]);_0x2eb4c2['filters']=_['intersection'](_0x2eb4c2[_0x3925('0x3d')],_0x2eb4c2['query']);_0x4b2fc6['attributes']=_[_0x3925('0x41')](_0x2eb4c2[_0x3925('0x3d')],qs[_0x3925('0x42')](_0x22fdb6[_0x3925('0x3f')][_0x3925('0x42')]));_0x4b2fc6[_0x3925('0x54')]=_0x4b2fc6[_0x3925('0x54')]['length']?_0x4b2fc6['attributes']:_0x2eb4c2[_0x3925('0x3d')];if(!_0x22fdb6['query'][_0x3925('0x63')](_0x3925('0x44'))){_0x4b2fc6[_0x3925('0x45')]=qs[_0x3925('0x45')](_0x22fdb6[_0x3925('0x3f')]['limit']);_0x4b2fc6['offset']=qs[_0x3925('0x2e')](_0x22fdb6['query']['offset']);}_0x4b2fc6['order']=qs[_0x3925('0x47')](_0x22fdb6[_0x3925('0x3f')][_0x3925('0x47')]);_0x4b2fc6[_0x3925('0x48')]=qs[_0x3925('0x40')](_[_0x3925('0x64')](_0x22fdb6['query'],_0x2eb4c2[_0x3925('0x40')]));_0x4b2fc6[_0x3925('0x48')]['FaxAccountId']=_0x48835e['id'];if(_0x22fdb6['query']['filter']){_0x4b2fc6[_0x3925('0x48')]=_['merge'](_0x4b2fc6[_0x3925('0x48')],{'$or':_[_0x3925('0x65')](_0x4b2fc6[_0x3925('0x54')],function(_0x11c0c9){var _0x1ef8aa={};_0x1ef8aa[_0x11c0c9]={'$like':'%'+_0x22fdb6[_0x3925('0x3f')][_0x3925('0x49')]+'%'};return _0x1ef8aa;})});}_0x4b2fc6=_[_0x3925('0x4a')]({},_0x4b2fc6,_0x22fdb6[_0x3925('0x4f')]);return db[_0x3925('0x6e')][_0x3925('0x2d')]({'where':_0x4b2fc6['where']})[_0x3925('0x1e')](function(_0x316bad){_0x316a7d['count']=_0x316bad;if(_0x22fdb6[_0x3925('0x3f')][_0x3925('0x55')]){_0x4b2fc6[_0x3925('0x51')]=[{'model':db[_0x3925('0x71')],'as':_0x3925('0x72'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x3925('0x37'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x3925('0x73'),'attributes':['id',_0x3925('0x37'),'color'],'where':_0x22fdb6['query'][_0x3925('0x74')]?{'id':_0x22fdb6[_0x3925('0x3f')][_0x3925('0x74')]}:undefined,'required':_0x22fdb6[_0x3925('0x3f')]['tag']?!![]:![]}];}return db[_0x3925('0x6e')]['findAll'](_0x4b2fc6);})['then'](function(_0x585ea1){_0x316a7d[_0x3925('0x66')]=_0x585ea1;return _0x316a7d;});}})[_0x3925('0x1e')](respondWithFilteredResult(_0x10e04e,_0x4b2fc6))['catch'](handleError(_0x10e04e,null));};exports[_0x3925('0x75')]=function(_0x32b2d1,_0x265fc6,_0x2d1427){return db['FaxAccount']['findOne']({'where':{'id':_0x32b2d1['params']['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x265fc6,null))[_0x3925('0x1e')](function(_0x5edb26){if(_0x5edb26){return db[_0x3925('0x76')][_0x3925('0x77')](function(_0x3eaa8c){return db[_0x3925('0x78')]['destroy']({'where':{'FaxAccountId':_0x32b2d1[_0x3925('0x5d')]['id']},'transaction':_0x3eaa8c})[_0x3925('0x1e')](function(_0x2c4471){var _0xfa1c0c=_[_0x3925('0x65')](_0x32b2d1[_0x3925('0x58')],function(_0x1a49ba){_0x1a49ba['FaxAccountId']=_0x32b2d1[_0x3925('0x5d')]['id'];return _0x1a49ba;});return db[_0x3925('0x78')][_0x3925('0x79')](_0xfa1c0c,{'transaction':_0x3eaa8c});});})[_0x3925('0x1e')](function(){return db['FaxApplication'][_0x3925('0x7a')]({'where':{'FaxAccountId':_0x32b2d1['params']['id']},'order':'priority'});});}})[_0x3925('0x1e')](respondWithResult(_0x265fc6,null))['catch'](handleError(_0x265fc6,null));};exports[_0x3925('0x7b')]=function(_0x2c8a66,_0x4b3907,_0x599224){var _0x540e3e={};var _0x2d44ca={};var _0x2738c3;var _0xb776fe;return db[_0x3925('0x50')][_0x3925('0x6b')]({'where':{'id':_0x2c8a66[_0x3925('0x5d')]['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x4b3907,null))[_0x3925('0x1e')](function(_0x68939){if(_0x68939){_0x2738c3=_0x68939;_0x2d44ca['model']=_[_0x3925('0x3e')](db[_0x3925('0x78')]['rawAttributes']);_0x2d44ca[_0x3925('0x3f')]=_[_0x3925('0x3e')](_0x2c8a66[_0x3925('0x3f')]);_0x2d44ca[_0x3925('0x40')]=_[_0x3925('0x41')](_0x2d44ca[_0x3925('0x3d')],_0x2d44ca[_0x3925('0x3f')]);_0x540e3e[_0x3925('0x54')]=_[_0x3925('0x41')](_0x2d44ca[_0x3925('0x3d')],qs[_0x3925('0x42')](_0x2c8a66[_0x3925('0x3f')][_0x3925('0x42')]));_0x540e3e[_0x3925('0x54')]=_0x540e3e[_0x3925('0x54')][_0x3925('0x43')]?_0x540e3e['attributes']:_0x2d44ca[_0x3925('0x3d')];_0x540e3e[_0x3925('0x46')]=qs[_0x3925('0x47')](_0x2c8a66[_0x3925('0x3f')][_0x3925('0x47')]);_0x540e3e['where']=qs['filters'](_[_0x3925('0x64')](_0x2c8a66[_0x3925('0x3f')],_0x2d44ca[_0x3925('0x40')]));if(_0x2c8a66[_0x3925('0x3f')][_0x3925('0x49')]){_0x540e3e[_0x3925('0x48')]=_[_0x3925('0x4a')](_0x540e3e[_0x3925('0x48')],{'$or':_[_0x3925('0x65')](_0x540e3e['attributes'],function(_0x17ca19){var _0x53eb56={};_0x53eb56[_0x17ca19]={'$like':'%'+_0x2c8a66[_0x3925('0x3f')]['filter']+'%'};return _0x53eb56;})});}_0x540e3e=_[_0x3925('0x4a')]({},_0x540e3e,_0x2c8a66[_0x3925('0x4f')]);return _0x2738c3['getApplications'](_0x540e3e);}})[_0x3925('0x1e')](function(_0x2e8a3e){if(_0x2e8a3e){_0xb776fe=_0x2e8a3e[_0x3925('0x43')];if(!_0x2c8a66[_0x3925('0x3f')][_0x3925('0x63')](_0x3925('0x44'))){_0x540e3e[_0x3925('0x45')]=qs[_0x3925('0x45')](_0x2c8a66[_0x3925('0x3f')]['limit']);_0x540e3e['offset']=qs[_0x3925('0x2e')](_0x2c8a66[_0x3925('0x3f')][_0x3925('0x2e')]);}return _0x2738c3['getApplications'](_0x540e3e);}})[_0x3925('0x1e')](function(_0x346ce2){if(_0x346ce2){return _0x346ce2?{'count':_0xb776fe,'rows':_0x346ce2}:null;}})[_0x3925('0x1e')](respondWithResult(_0x4b3907,null))['catch'](handleError(_0x4b3907,null));};function Extension(_0x235054,_0xe8b47c,_0xc73236,_0x56ff16){this[_0x3925('0x7c')]=_0x3925('0x7d');this['exten']=_0x235054[_0x3925('0x7e')];this[_0x3925('0x7f')]=_0x56ff16;this[_0x3925('0x4b')]=_0x3925('0x80');this[_0x3925('0x81')]=_0x3925('0x82');this[_0x3925('0x60')]=_0x235054['id'];this[_0x3925('0x83')]=_0xe8b47c;this[_0x3925('0x84')]=_0xc73236;}function createExtensionsReciveFax(_0xab6f9e){var _0x116445=0x1;var _0x3e5411=[];_0x3e5411[_0x3925('0x85')](new Extension(_0xab6f9e,_0x116445,'',_0x3925('0x86')));_0x116445+=0x1;_0x3e5411[_0x3925('0x85')](new Extension(_0xab6f9e,_0x116445,'CDR(type)=inbound-fax','Set'));_0x116445+=0x1;for(var _0x2803f4 in _0xab6f9e){if(_0xab6f9e[_0x3925('0x63')](_0x2803f4)&&(_0x2803f4===_0x3925('0x87')||_0x2803f4==='localstationid'||_0x2803f4==='gateway'||_0x2803f4===_0x3925('0x88')||_0x2803f4===_0x3925('0x89')||_0x2803f4==='maxrate'||_0x2803f4==='minrate'||_0x2803f4===_0x3925('0x8a')||_0x2803f4==='t38timeout')){_0x3e5411[_0x3925('0x85')](new Extension(_0xab6f9e,_0x116445,_0x3925('0x8b')+_0x2803f4+')='+_0xab6f9e[_0x2803f4],_0x3925('0x8c')));_0x116445+=0x1;}}_0x3e5411[_0x3925('0x85')](new Extension(_0xab6f9e,_0x116445,'6',_0x3925('0x8d')));_0x116445+=0x1;_0x3e5411[_0x3925('0x85')](new Extension(_0xab6f9e,_0x116445,_0x3925('0x8e'),_0x3925('0x8f')));_0x116445=0x0;return _0x3e5411;}exports['addAccountApplications']=function(_0x299246,_0x111d49,_0x552e0f){var _0x14ee83;return db[_0x3925('0x76')]['transaction'](function(_0x3cd0b8){return db[_0x3925('0x50')][_0x3925('0x57')](_0x299246['body'],{'transaction':_0x3cd0b8})[_0x3925('0x1e')](function(_0x4d770b){_0x14ee83=_0x4d770b['get']({'plain':!![]});return db['VoiceExtension'][_0x3925('0x79')](createExtensionsReciveFax(_0x14ee83),{'transaction':_0x3cd0b8});});})[_0x3925('0x1e')](function(){return _0x14ee83;})['then'](respondWithResult(_0x111d49,null))[_0x3925('0x28')](handleError(_0x111d49,null));};exports[_0x3925('0x90')]=function(_0x169eb3,_0x322d0f,_0x219241){var _0x484776;return db['sequelize'][_0x3925('0x77')](function(_0x481011){return db[_0x3925('0x50')][_0x3925('0x91')](_0x169eb3['body'],{'where':{'id':_0x169eb3[_0x3925('0x58')]['id']},'transaction':_0x481011})['then'](function(_0x232b29){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x169eb3[_0x3925('0x58')]['id']},'transaction':_0x481011})[_0x3925('0x1e')](function(_0x3d92eb){return db['VoiceExtension'][_0x3925('0x79')](createExtensionsReciveFax(_[_0x3925('0x6f')](_0x169eb3[_0x3925('0x58')],[_0x3925('0x92'),_0x3925('0x4c'),_0x3925('0x93'),_0x3925('0x94'),'TrunkId',_0x3925('0x95')])),{'transaction':_0x481011});});});})['then'](function(){return db[_0x3925('0x50')]['findById'](_0x169eb3['body']['id']);})['then'](respondWithResult(_0x322d0f,null))['catch'](handleError(_0x322d0f,null));};exports['getMessages']=function(_0x2f98d6,_0x2f2e84,_0x19f007){var _0x79a5b4={'raw':!![],'where':{}};var _0x1758bd={};var _0x1466ca={'count':0x0,'rows':[]};return db[_0x3925('0x50')][_0x3925('0x6b')]({'where':{'id':_0x2f98d6[_0x3925('0x5d')]['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x2f2e84,null))[_0x3925('0x1e')](function(_0x3d0ac3){if(_0x3d0ac3){_0x1758bd['model']=_['keys'](db[_0x3925('0x96')][_0x3925('0x3c')]);_0x1758bd[_0x3925('0x3f')]=_[_0x3925('0x3e')](_0x2f98d6['query']);_0x1758bd['filters']=_[_0x3925('0x41')](_0x1758bd[_0x3925('0x3d')],_0x1758bd[_0x3925('0x3f')]);_0x79a5b4[_0x3925('0x54')]=_[_0x3925('0x41')](_0x1758bd[_0x3925('0x3d')],qs[_0x3925('0x42')](_0x2f98d6[_0x3925('0x3f')]['fields']));_0x79a5b4[_0x3925('0x54')]=_0x79a5b4[_0x3925('0x54')][_0x3925('0x43')]?_0x79a5b4[_0x3925('0x54')]:_0x1758bd[_0x3925('0x3d')];if(!_0x2f98d6[_0x3925('0x3f')][_0x3925('0x63')](_0x3925('0x44'))){_0x79a5b4[_0x3925('0x45')]=qs['limit'](_0x2f98d6[_0x3925('0x3f')][_0x3925('0x45')]);_0x79a5b4['offset']=qs['offset'](_0x2f98d6[_0x3925('0x3f')]['offset']);}_0x79a5b4[_0x3925('0x46')]=qs[_0x3925('0x47')](_0x2f98d6[_0x3925('0x3f')][_0x3925('0x47')]);_0x79a5b4[_0x3925('0x48')]=qs['filters'](_[_0x3925('0x64')](_0x2f98d6[_0x3925('0x3f')],_0x1758bd[_0x3925('0x40')]));_0x79a5b4['where'][_0x3925('0x60')]=_0x3d0ac3['id'];if(_0x2f98d6[_0x3925('0x3f')]['filter']){_0x79a5b4['where']=_[_0x3925('0x4a')](_0x79a5b4[_0x3925('0x48')],{'$or':_[_0x3925('0x65')](_0x79a5b4[_0x3925('0x54')],function(_0x4812b6){var _0x238a50={};_0x238a50[_0x4812b6]={'$like':'%'+_0x2f98d6[_0x3925('0x3f')]['filter']+'%'};return _0x238a50;})});}if(_0x2f98d6[_0x3925('0x3f')]['$gte']){var _0x194099=_0x2f98d6['query'][_0x3925('0x97')][_0x3925('0x98')](',');var _0x280386={};_0x280386[_0x194099[0x0]]={'$gte':moment(_0x194099[0x1])[_0x3925('0x99')]('YYYY-MM-DD\x20HH:mm:ss')};_0x79a5b4[_0x3925('0x48')]=_[_0x3925('0x4a')](_0x79a5b4[_0x3925('0x48')],_0x280386);}_0x79a5b4=_[_0x3925('0x4a')]({},_0x79a5b4,_0x2f98d6[_0x3925('0x4f')]);return db[_0x3925('0x96')][_0x3925('0x2d')]({'where':_0x79a5b4['where']})[_0x3925('0x1e')](function(_0x2f0675){_0x1466ca[_0x3925('0x2d')]=_0x2f0675;if(_0x2f98d6[_0x3925('0x3f')][_0x3925('0x55')]){_0x79a5b4[_0x3925('0x51')]=[{'all':!![]}];}return db['FaxMessage'][_0x3925('0x52')](_0x79a5b4);})[_0x3925('0x1e')](function(_0x5adc4d){_0x1466ca[_0x3925('0x66')]=_0x5adc4d;return _0x1466ca;});}})[_0x3925('0x1e')](respondWithFilteredResult(_0x2f2e84,_0x79a5b4))[_0x3925('0x28')](handleError(_0x2f2e84,null));};exports[_0x3925('0x38')]=function(_0x39c55b,_0x325568,_0xddcbf7){var _0x3971d1,_0x3a5819={},_0x3869a4;if(_0x39c55b[_0x3925('0x58')]['to']){_0x3869a4=_0x39c55b[_0x3925('0x58')]['to'][0x0];}return db[_0x3925('0x50')][_0x3925('0x56')]({'where':{'id':_0x39c55b[_0x3925('0x5d')]['id']},'include':[{'model':db[_0x3925('0x9a')],'as':_0x3925('0x9b'),'include':[{'model':db[_0x3925('0x71')],'as':'Contacts','where':{'fax':_0x3869a4},'limit':0x1,'order':[['updatedAt',_0x3925('0x9c')]]}]}]})[_0x3925('0x1e')](handleEntityNotFound(_0x325568,null))[_0x3925('0x1e')](function(_0x42972f){_0x3971d1=_0x42972f;if(_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')]&&_0x39c55b[_0x3925('0x58')]['attachments'][_0x3925('0x43')]){for(var _0x2d39ce=0x0;_0x2d39ce<_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')]['length'];_0x2d39ce+=0x1){_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')][_0x2d39ce]={'filename':_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')][_0x2d39ce]['name'],'id':_0x39c55b['body'][_0x3925('0x9d')][_0x2d39ce]['id'],'path':path[_0x3925('0x9e')](config['root'],_0x3925('0x9f'),_0x39c55b['body'][_0x3925('0x9d')][_0x2d39ce]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x3925('0xa0'),{'FaxAccountId':_['isNil'](_0x39c55b[_0x3925('0x5d')]['id'])?undefined:_0x39c55b[_0x3925('0x5d')]['id'],'path':_[_0x3925('0xa1')](_0x39c55b['body'][_0x3925('0x9d')][0x0][_0x3925('0x8')])?undefined:_0x39c55b['body'][_0x3925('0x9d')][0x0][_0x3925('0x8')],'fax':_[_0x3925('0xa1')](_0x39c55b[_0x3925('0x58')]['to'][0x0])?undefined:_0x39c55b['body']['to'][0x0]},client9002);})[_0x3925('0x1e')](function(){if(_0x3971d1){if(_[_0x3925('0xa1')](_0x39c55b[_0x3925('0x58')]['from'])){_0x39c55b[_0x3925('0x58')][_0x3925('0xa2')]=util[_0x3925('0x99')]('\x22%s\x22\x20<%s>',_0x3971d1[_0x3925('0x37')],_0x3971d1[_0x3925('0xa3')]);}if(_0x3971d1[_0x3925('0x9b')]){if(_0x3971d1[_0x3925('0x9b')][_0x3925('0xa4')][_0x3925('0x43')]){return _0x3971d1[_0x3925('0x9b')][_0x3925('0xa4')][0x0];}else{return db[_0x3925('0x71')]['create'](_[_0x3925('0x17')](_0x39c55b[_0x3925('0x58')],{'firstName':_0x39c55b[_0x3925('0x58')]['to'][0x0],'phone':_0x39c55b[_0x3925('0x58')]['to'][0x0],'fax':_0x39c55b[_0x3925('0x58')]['to'][0x0],'ListId':_0x3971d1[_0x3925('0x95')]}));}}else{throw new Error(_0x3925('0xa5'));}}else{throw new Error(_0x3925('0xa6'));}})[_0x3925('0x1e')](function(_0x428ba3){if(_0x428ba3){return db[_0x3925('0x6e')][_0x3925('0x56')]({'where':{'ContactId':_0x428ba3['id'],'closed':![],'FaxAccountId':_0x3971d1['id']}})['then'](function(_0x2d9bea){if(_0x2d9bea){return[_0x2d9bea,![]];}return db[_0x3925('0x6e')][_0x3925('0x57')]({'UserId':_0x39c55b[_0x3925('0x59')]['id'],'ContactId':_0x428ba3['id'],'FaxAccountId':_0x3971d1['id'],'fax':_0x39c55b[_0x3925('0x58')]['to'][0x0],'firstMsgDirection':_0x3925('0xa7'),'Messages':[_[_0x3925('0x4a')](_0x39c55b['body'],{'read':![],'body':_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')][0x0][_0x3925('0xa8')],'FaxAccountId':_0x3971d1['id'],'UserId':_0x39c55b[_0x3925('0x59')]['id'],'ContactId':_0x428ba3['id'],'AttachmentId':_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')][0x0]['id']})]},{'include':[{'model':db[_0x3925('0x96')],'as':'Messages'}]})[_0x3925('0x1e')](function(_0x5994e8){return[_0x5994e8,!![]];});});}else{throw new Error(_0x3925('0xa9'));}})['spread'](function(_0x4de7ae,_0x1092fa){if(_0x1092fa){return _0x4de7ae;}return db[_0x3925('0x96')][_0x3925('0x57')]({'direction':'out','read':![],'body':_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')][0x0][_0x3925('0xa8')],'FaxAccountId':_0x3971d1['id'],'FaxInteractionId':_0x4de7ae['id'],'UserId':_0x39c55b[_0x3925('0x59')]['id'],'ContactId':_0x4de7ae[_0x3925('0xaa')],'AttachmentId':_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')][0x0]['id']})[_0x3925('0x1e')](function(_0xa6db1c){_0x4de7ae[_0x3925('0xab')][_0x3925('0xac')]=[];_0x4de7ae[_0x3925('0xab')][_0x3925('0xac')][_0x3925('0x85')](_0xa6db1c[_0x3925('0xab')]);return _0x4de7ae;});})[_0x3925('0x1e')](function(_0x267f2d){respondWithRpcPromise(_0x3925('0xad'),_0x3925('0xad'),{'FaxAccountId':_[_0x3925('0xa1')](_0x39c55b[_0x3925('0x5d')]['id'])?undefined:_0x39c55b[_0x3925('0x5d')]['id'],'path':_[_0x3925('0xa1')](_0x39c55b['body']['attachments'][0x0][_0x3925('0x8')])?undefined:_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')][0x0][_0x3925('0x8')],'fax':_[_0x3925('0xa1')](_0x39c55b[_0x3925('0x58')]['to'][0x0])?undefined:_0x39c55b[_0x3925('0x58')]['to'][0x0],'AttachmentId':_0x39c55b[_0x3925('0x58')][_0x3925('0x9d')][0x0]['id']},client9002)[_0x3925('0x1e')](function(_0x5f158b){logger[_0x3925('0x1f')](_0x3925('0xae'),_0x5f158b);})[_0x3925('0x28')](function(_0x2a90d6){logger[_0x3925('0x1f')](_0x3925('0xae'),_0x2a90d6);});return _0x267f2d;})['then'](respondWithResult(_0x325568,null))[_0x3925('0x28')](handleError(_0x325568,null));};exports[_0x3925('0xaf')]=function(_0x2fb036,_0x231d4f,_0x215fd4){return db[_0x3925('0x50')][_0x3925('0x56')]({'where':{'id':_0x2fb036[_0x3925('0x5d')]['id']}})['then'](handleEntityNotFound(_0x231d4f,null))[_0x3925('0x1e')](function(_0x47cb05){if(_0x47cb05){return _0x47cb05['addAgents'](_0x2fb036['body'][_0x3925('0x6c')],_[_0x3925('0x6f')](_0x2fb036[_0x3925('0x58')],[_0x3925('0x6c'),'id'])||{})[_0x3925('0xb0')](function(_0xfcef05){for(var _0x576a12=0x0;_0x576a12<_0x2fb036[_0x3925('0x58')]['ids'][_0x3925('0x43')];_0x576a12+=0x1){socket[_0x3925('0xb1')](_0x3925('0xb2'),{'UserId':_0x2fb036['body'][_0x3925('0x6c')][_0x576a12],'FaxAccountId':_0x2fb036[_0x3925('0x5d')]['id']});}return _0xfcef05;});}})['then'](respondWithResult(_0x231d4f,null))[_0x3925('0x28')](handleError(_0x231d4f,null));};exports['removeAgents']=function(_0x2e0e60,_0x3892df,_0xc1fffa){var _0x2a622b;return db['FaxAccount']['find']({'where':{'id':_0x2e0e60['params']['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x3892df,null))[_0x3925('0x1e')](function(_0x16acea){if(_0x16acea){return _0x16acea[_0x3925('0xb3')](_0x2e0e60[_0x3925('0x3f')][_0x3925('0x6c')])[_0x3925('0x1e')](function(_0x3012cd){if(_[_0x3925('0xb4')](_0x2e0e60[_0x3925('0x3f')][_0x3925('0x6c')])){for(var _0x253d9e=0x0;_0x253d9e<_0x2e0e60[_0x3925('0x3f')]['ids']['length'];_0x253d9e+=0x1){socket[_0x3925('0xb1')](_0x3925('0xb5'),{'UserId':_0x2e0e60[_0x3925('0x3f')][_0x3925('0x6c')][_0x253d9e],'FaxAccountId':_0x2e0e60[_0x3925('0x5d')]['id']});}}else{socket['emit'](_0x3925('0xb5'),{'UserId':_0x2e0e60[_0x3925('0x3f')][_0x3925('0x6c')],'FaxAccountId':_0x2e0e60[_0x3925('0x5d')]['id']});}});}})[_0x3925('0x1e')](respondWithStatusCode(_0x3892df,null))[_0x3925('0x28')](handleError(_0x3892df,null));};exports[_0x3925('0xb6')]=function(_0xf178b4,_0x58dd1f,_0x3256cd){var _0x35b1e1={};var _0x37355b={};var _0x1dc135;var _0x6b0f38;return db[_0x3925('0x50')][_0x3925('0x6b')]({'where':{'id':_0xf178b4[_0x3925('0x5d')]['id']}})[_0x3925('0x1e')](handleEntityNotFound(_0x58dd1f,null))[_0x3925('0x1e')](function(_0x4e6f46){if(_0x4e6f46){_0x1dc135=_0x4e6f46;_0x37355b[_0x3925('0x3d')]=_[_0x3925('0x3e')](db[_0x3925('0xb7')][_0x3925('0x3c')]);_0x37355b[_0x3925('0x3f')]=_['keys'](_0xf178b4[_0x3925('0x3f')]);_0x37355b[_0x3925('0x40')]=_[_0x3925('0x41')](_0x37355b[_0x3925('0x3d')],_0x37355b[_0x3925('0x3f')]);_0x35b1e1['attributes']=_[_0x3925('0x41')](_0x37355b['model'],qs[_0x3925('0x42')](_0xf178b4['query'][_0x3925('0x42')]));_0x35b1e1[_0x3925('0x54')]=_0x35b1e1['attributes'][_0x3925('0x43')]?_0x35b1e1['attributes']:_0x37355b[_0x3925('0x3d')];_0x35b1e1[_0x3925('0x46')]=qs[_0x3925('0x47')](_0xf178b4[_0x3925('0x3f')]['sort']);_0x35b1e1[_0x3925('0x48')]=qs[_0x3925('0x40')](_['pick'](_0xf178b4[_0x3925('0x3f')],_0x37355b[_0x3925('0x40')]));if(_0xf178b4[_0x3925('0x3f')][_0x3925('0x49')]){_0x35b1e1[_0x3925('0x48')]=_[_0x3925('0x4a')](_0x35b1e1[_0x3925('0x48')],{'$or':_[_0x3925('0x65')](_0x35b1e1[_0x3925('0x54')],function(_0x43765d){var _0x310018={};_0x310018[_0x43765d]={'$like':'%'+_0xf178b4[_0x3925('0x3f')][_0x3925('0x49')]+'%'};return _0x310018;})});}_0x35b1e1=_['merge']({},_0x35b1e1,_0xf178b4[_0x3925('0x4f')]);return _0x1dc135[_0x3925('0xb6')](_0x35b1e1);}})['then'](function(_0x20fca1){if(_0x20fca1){_0x6b0f38=_0x20fca1[_0x3925('0x43')];if(!_0xf178b4[_0x3925('0x3f')]['hasOwnProperty'](_0x3925('0x44'))){_0x35b1e1[_0x3925('0x45')]=qs[_0x3925('0x45')](_0xf178b4[_0x3925('0x3f')][_0x3925('0x45')]);_0x35b1e1[_0x3925('0x2e')]=qs[_0x3925('0x2e')](_0xf178b4['query'][_0x3925('0x2e')]);}return _0x1dc135[_0x3925('0xb6')](_0x35b1e1);}})[_0x3925('0x1e')](function(_0x2fea97){if(_0x2fea97){return _0x2fea97?{'count':_0x6b0f38,'rows':_0x2fea97}:null;}})[_0x3925('0x1e')](respondWithResult(_0x58dd1f,null))['catch'](handleError(_0x58dd1f,null));}; \ No newline at end of file +var _0xf6c9=['attachments','root','server/files/attachments','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','json','count','offset','limit','set','apply','save','then','get','UserProfileResource','destroy','end','stack','name','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','FaxAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','findOne','CmContact','Contact','User','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','FaxApplication','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','gateway','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','DESC'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf6c9,0xdd));var _0x9f6c=function(_0x53aa0b,_0x34f216){_0x53aa0b=_0x53aa0b-0x0;var _0xcffd24=_0xf6c9[_0x53aa0b];return _0xcffd24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9f6c('0x0'));var rimraf=require(_0x9f6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f6c('0x2'));var moment=require(_0x9f6c('0x3'));var BPromise=require(_0x9f6c('0x4'));var Mustache=require(_0x9f6c('0x5'));var util=require(_0x9f6c('0x6'));var path=require('path');var sox=require(_0x9f6c('0x7'));var csv=require(_0x9f6c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f6c('0x9'));var squel=require(_0x9f6c('0xa'));var crypto=require(_0x9f6c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9f6c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9f6c('0xd'));var Papa=require(_0x9f6c('0xe'));var authService=require(_0x9f6c('0xf'));var hardwareService=require(_0x9f6c('0x10'));var Redis=require('ioredis');var qs=require(_0x9f6c('0x11'));var logger=require(_0x9f6c('0x12'))(_0x9f6c('0x13'));var utils=require(_0x9f6c('0x14'));var config=require(_0x9f6c('0x15'));var db=require(_0x9f6c('0x16'))['db'];config[_0x9f6c('0x17')]=_[_0x9f6c('0x18')](config['redis'],{'host':_0x9f6c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f6c('0x17')]));require(_0x9f6c('0x1a'))[_0x9f6c('0x1b')](socket);var jayson=require(_0x9f6c('0x1c'));var client=jayson[_0x9f6c('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x9f6c('0x1d')][_0x9f6c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x23749e,_0x55b129,_0x35819e,_0x5cd06b){return new BPromise(function(_0x4233b0,_0x2f373c){var _0xe61777=_0x5cd06b||client;return _0xe61777[_0x9f6c('0x1f')](_0x23749e,_0x35819e)['then'](function(_0x58286e){logger['info'](_0x9f6c('0x20'),_0x55b129,_0x9f6c('0x21'));logger[_0x9f6c('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x55b129,_0x9f6c('0x21'),JSON['stringify'](_0x58286e));if(_0x58286e[_0x9f6c('0x23')]){if(_0x58286e[_0x9f6c('0x23')]['code']===0x1f4){logger[_0x9f6c('0x23')](_0x9f6c('0x20'),_0x55b129,_0x58286e[_0x9f6c('0x23')][_0x9f6c('0x24')]);return _0x2f373c(_0x58286e[_0x9f6c('0x23')][_0x9f6c('0x24')]);}logger[_0x9f6c('0x23')](_0x9f6c('0x20'),_0x55b129,_0x58286e[_0x9f6c('0x23')][_0x9f6c('0x24')]);return _0x4233b0(_0x58286e[_0x9f6c('0x23')][_0x9f6c('0x24')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x55b129,_0x9f6c('0x21'));_0x4233b0(_0x58286e[_0x9f6c('0x25')][_0x9f6c('0x24')]);}})['catch'](function(_0x2381ab){logger['error']('FaxAccount,\x20%s,\x20%s',_0x55b129,_0x2381ab);_0x2f373c(_0x2381ab);});});}function respondWithStatusCode(_0xa25a7a,_0x48fc91){_0x48fc91=_0x48fc91||0xcc;return function(_0x493731){if(_0x493731){return _0xa25a7a[_0x9f6c('0x26')](_0x48fc91);}return _0xa25a7a[_0x9f6c('0x27')](_0x48fc91)['end']();};}function respondWithResult(_0x5be7f7,_0x314c29){_0x314c29=_0x314c29||0xc8;return function(_0x5807be){if(_0x5807be){return _0x5be7f7[_0x9f6c('0x27')](_0x314c29)[_0x9f6c('0x28')](_0x5807be);}};}function respondWithFilteredResult(_0x49741c,_0x2f4fb3){return function(_0xb7be0d){if(_0xb7be0d){var _0x1b3a2a=_0xb7be0d[_0x9f6c('0x29')],_0x55359b=_0x2f4fb3[_0x9f6c('0x2a')],_0x38f6a0=_0x2f4fb3[_0x9f6c('0x2a')]+_0x2f4fb3[_0x9f6c('0x2b')],_0x33e92b;if(_0x38f6a0>=_0x1b3a2a){_0x38f6a0=_0x1b3a2a;_0x33e92b=0xc8;}else{_0x33e92b=0xce;}_0x49741c[_0x9f6c('0x27')](_0x33e92b);return _0x49741c[_0x9f6c('0x2c')]('Content-Range',_0x55359b+'-'+_0x38f6a0+'/'+_0x1b3a2a)[_0x9f6c('0x28')](_0xb7be0d);}return null;};}function patchUpdates(_0x234877){return function(_0x3df469){try{jsonpatch[_0x9f6c('0x2d')](_0x3df469,_0x234877,!![]);}catch(_0x5e2f6a){return BPromise['reject'](_0x5e2f6a);}return _0x3df469[_0x9f6c('0x2e')]();};}function saveUpdates(_0x504a69,_0x40e68a){return function(_0xb0c367){if(_0xb0c367){return _0xb0c367['update'](_0x504a69)[_0x9f6c('0x2f')](function(_0x232a36){return _0x232a36;});}return null;};}function removeEntity(_0x39c8e7,_0xad230f){return function(_0x204c53){if(_0x204c53){return _0x204c53['destroy']()[_0x9f6c('0x2f')](function(){var _0x32774f=_0x204c53[_0x9f6c('0x30')]({'plain':!![]});var _0x9b12c='FaxAccounts';return db[_0x9f6c('0x31')][_0x9f6c('0x32')]({'where':{'type':_0x9b12c,'resourceId':_0x32774f['id']}})[_0x9f6c('0x2f')](function(){return _0x204c53;});})[_0x9f6c('0x2f')](function(){_0x39c8e7[_0x9f6c('0x27')](0xcc)[_0x9f6c('0x33')]();});}};}function handleEntityNotFound(_0x14a84f,_0x32bd70){return function(_0x23a8bc){if(!_0x23a8bc){_0x14a84f[_0x9f6c('0x26')](0x194);}return _0x23a8bc;};}function handleError(_0x568dc1,_0xdf7530){_0xdf7530=_0xdf7530||0x1f4;return function(_0x409025){logger['error'](_0x409025[_0x9f6c('0x34')]);if(_0x409025['name']){delete _0x409025[_0x9f6c('0x35')];}_0x568dc1[_0x9f6c('0x27')](_0xdf7530)[_0x9f6c('0x36')](_0x409025);};}exports[_0x9f6c('0x37')]=function(_0x3b06e8,_0xd8bd5){var _0x314e66={'include':[{'model':db[_0x9f6c('0x38')],'as':'mandatoryDispositionPause'}]},_0xe64e7a={},_0xaf522a={'count':0x0,'rows':[]};var _0x2e0f3c=db['FaxAccount'][_0x9f6c('0x39')];_0xe64e7a[_0x9f6c('0x3a')]=_[_0x9f6c('0x3b')](_0x2e0f3c);_0xe64e7a[_0x9f6c('0x3c')]=_[_0x9f6c('0x3b')](_0x3b06e8[_0x9f6c('0x3c')]);_0xe64e7a[_0x9f6c('0x3d')]=_[_0x9f6c('0x3e')](_0xe64e7a['model'],_0xe64e7a[_0x9f6c('0x3c')]);_0x314e66['attributes']=_[_0x9f6c('0x3e')](_0xe64e7a[_0x9f6c('0x3a')],qs[_0x9f6c('0x3f')](_0x3b06e8['query']['fields']));_0x314e66[_0x9f6c('0x40')]=_0x314e66[_0x9f6c('0x40')][_0x9f6c('0x41')]?_0x314e66[_0x9f6c('0x40')]:_0xe64e7a[_0x9f6c('0x3a')];if(!_0x3b06e8['query'][_0x9f6c('0x42')](_0x9f6c('0x43'))){_0x314e66[_0x9f6c('0x2b')]=qs[_0x9f6c('0x2b')](_0x3b06e8[_0x9f6c('0x3c')][_0x9f6c('0x2b')]);_0x314e66[_0x9f6c('0x2a')]=qs[_0x9f6c('0x2a')](_0x3b06e8[_0x9f6c('0x3c')][_0x9f6c('0x2a')]);}_0x314e66[_0x9f6c('0x44')]=qs[_0x9f6c('0x45')](_0x3b06e8[_0x9f6c('0x3c')][_0x9f6c('0x45')]);_0x314e66['where']=qs[_0x9f6c('0x3d')](_[_0x9f6c('0x46')](_0x3b06e8['query'],_0xe64e7a[_0x9f6c('0x3d')]));if(_0x3b06e8[_0x9f6c('0x3c')][_0x9f6c('0x47')]){_0x314e66[_0x9f6c('0x48')]=_[_0x9f6c('0x49')](_0x314e66[_0x9f6c('0x48')],{'$or':_[_0x9f6c('0x4a')](_0x2e0f3c,function(_0x49b3c9){if(_0x49b3c9[_0x9f6c('0x4b')][_0x9f6c('0x4c')]!==_0x9f6c('0x4d')){var _0x10d2ba={};_0x10d2ba[_0x49b3c9[_0x9f6c('0x4e')]]={'$like':'%'+_0x3b06e8['query'][_0x9f6c('0x47')]+'%'};return _0x10d2ba;}})});}_0x314e66=_[_0x9f6c('0x49')]({},_0x314e66,_0x3b06e8[_0x9f6c('0x4f')]);var _0x5d3029={'where':_0x314e66[_0x9f6c('0x48')]};return db[_0x9f6c('0x50')][_0x9f6c('0x29')](_0x5d3029)['then'](function(_0x1bddaf){_0xaf522a[_0x9f6c('0x29')]=_0x1bddaf;if(_0x3b06e8['query'][_0x9f6c('0x51')]){_0x314e66[_0x9f6c('0x52')]=[{'all':!![]}];}return db[_0x9f6c('0x50')][_0x9f6c('0x53')](_0x314e66);})['then'](function(_0x39c978){_0xaf522a[_0x9f6c('0x54')]=_0x39c978;return _0xaf522a;})[_0x9f6c('0x2f')](respondWithFilteredResult(_0xd8bd5,_0x314e66))[_0x9f6c('0x55')](handleError(_0xd8bd5,null));};exports[_0x9f6c('0x56')]=function(_0x2654e6,_0x266509){var _0x5404a8={'raw':![],'where':{'id':_0x2654e6[_0x9f6c('0x57')]['id']},'include':[{'model':db[_0x9f6c('0x38')],'as':'mandatoryDispositionPause'}]},_0x1af040={};_0x1af040['model']=_[_0x9f6c('0x3b')](db['FaxAccount'][_0x9f6c('0x39')]);_0x1af040[_0x9f6c('0x3c')]=_[_0x9f6c('0x3b')](_0x2654e6[_0x9f6c('0x3c')]);_0x1af040[_0x9f6c('0x3d')]=_[_0x9f6c('0x3e')](_0x1af040['model'],_0x1af040[_0x9f6c('0x3c')]);_0x5404a8['attributes']=_['intersection'](_0x1af040[_0x9f6c('0x3a')],qs[_0x9f6c('0x3f')](_0x2654e6[_0x9f6c('0x3c')][_0x9f6c('0x3f')]));_0x5404a8[_0x9f6c('0x40')]=_0x5404a8['attributes'][_0x9f6c('0x41')]?_0x5404a8[_0x9f6c('0x40')]:_0x1af040[_0x9f6c('0x3a')];if(_0x2654e6[_0x9f6c('0x3c')]['includeAll']){_0x5404a8[_0x9f6c('0x52')]=[{'all':!![]}];}_0x5404a8=_['merge']({},_0x5404a8,_0x2654e6['options']);return db[_0x9f6c('0x50')][_0x9f6c('0x58')](_0x5404a8)[_0x9f6c('0x2f')](handleEntityNotFound(_0x266509,null))['then'](respondWithResult(_0x266509,null))[_0x9f6c('0x55')](handleError(_0x266509,null));};exports['create']=function(_0x58b155,_0xcbfc95){return db[_0x9f6c('0x50')][_0x9f6c('0x59')](_0x58b155[_0x9f6c('0x5a')],{})[_0x9f6c('0x2f')](function(_0x53e5cc){var _0x1a6db7=_0x58b155[_0x9f6c('0x5b')][_0x9f6c('0x30')]({'plain':!![]});if(!_0x1a6db7)throw new Error(_0x9f6c('0x5c'));if(_0x1a6db7[_0x9f6c('0x5d')]===_0x9f6c('0x5b')){var _0x5aea86=_0x53e5cc[_0x9f6c('0x30')]({'plain':!![]});var _0xca0bfc=_0x9f6c('0x5e');return db['UserProfileSection']['find']({'where':{'name':_0xca0bfc,'userProfileId':_0x1a6db7[_0x9f6c('0x5f')]},'raw':!![]})['then'](function(_0x177196){if(_0x177196&&_0x177196[_0x9f6c('0x60')]===0x0){return db[_0x9f6c('0x31')]['create']({'name':_0x5aea86[_0x9f6c('0x35')],'resourceId':_0x5aea86['id'],'type':_0x177196[_0x9f6c('0x35')],'sectionId':_0x177196['id']},{})[_0x9f6c('0x2f')](function(){return _0x53e5cc;});}else{return _0x53e5cc;}})[_0x9f6c('0x55')](function(_0x380e80){logger[_0x9f6c('0x23')](_0x9f6c('0x61'),_0x380e80);throw _0x380e80;});}return _0x53e5cc;})[_0x9f6c('0x2f')](respondWithResult(_0xcbfc95,0xc9))[_0x9f6c('0x55')](handleError(_0xcbfc95,null));};exports[_0x9f6c('0x62')]=function(_0x28fbd7,_0x24015d){if(_0x28fbd7[_0x9f6c('0x5a')]['id']){delete _0x28fbd7[_0x9f6c('0x5a')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x28fbd7[_0x9f6c('0x57')]['id']},'include':[{'model':db[_0x9f6c('0x38')],'as':_0x9f6c('0x63')}]})['then'](handleEntityNotFound(_0x24015d,null))[_0x9f6c('0x2f')](saveUpdates(_0x28fbd7[_0x9f6c('0x5a')],null))['then'](respondWithResult(_0x24015d,null))[_0x9f6c('0x55')](handleError(_0x24015d,null));};exports['destroy']=function(_0x1da19a,_0x5090b9){return db[_0x9f6c('0x50')]['find']({'where':{'id':_0x1da19a[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x5090b9,null))[_0x9f6c('0x2f')](removeEntity(_0x5090b9,null))[_0x9f6c('0x55')](handleError(_0x5090b9,null));};exports[_0x9f6c('0x64')]=function(_0x4686a6,_0x5a0532){return db[_0x9f6c('0x50')][_0x9f6c('0x64')]()[_0x9f6c('0x2f')](respondWithResult(_0x5a0532,null))[_0x9f6c('0x55')](handleError(_0x5a0532,null));};exports[_0x9f6c('0x65')]=function(_0x392258,_0x4017a0,_0x4f3e1c){if(_0x392258['body']['id']){delete _0x392258[_0x9f6c('0x5a')]['id'];}return db['FaxAccount'][_0x9f6c('0x58')]({'where':{'id':_0x392258[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x4017a0,null))['then'](function(_0x4bb40f){if(_0x4bb40f){_0x392258[_0x9f6c('0x5a')][_0x9f6c('0x66')]=_0x4bb40f['id'];return db['Disposition']['create'](_0x392258[_0x9f6c('0x5a')]);}})[_0x9f6c('0x2f')](respondWithResult(_0x4017a0,null))[_0x9f6c('0x55')](handleError(_0x4017a0,null));};exports[_0x9f6c('0x67')]=function(_0x153ccc,_0x23cd6b,_0x3ddb1c){var _0x3db5de={'raw':![],'where':{}};var _0x5c891c={};var _0x1dddf6={'count':0x0,'rows':[]};return db[_0x9f6c('0x50')]['findOne']({'where':{'id':_0x153ccc[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x23cd6b,null))['then'](function(_0x44ce87){if(_0x44ce87){_0x5c891c[_0x9f6c('0x3a')]=_[_0x9f6c('0x3b')](db[_0x9f6c('0x68')][_0x9f6c('0x39')]);_0x5c891c[_0x9f6c('0x3c')]=_[_0x9f6c('0x3b')](_0x153ccc[_0x9f6c('0x3c')]);_0x5c891c[_0x9f6c('0x3d')]=_[_0x9f6c('0x3e')](_0x5c891c[_0x9f6c('0x3a')],_0x5c891c[_0x9f6c('0x3c')]);_0x3db5de[_0x9f6c('0x40')]=_['intersection'](_0x5c891c[_0x9f6c('0x3a')],qs[_0x9f6c('0x3f')](_0x153ccc[_0x9f6c('0x3c')]['fields']));_0x3db5de[_0x9f6c('0x40')]=_0x3db5de[_0x9f6c('0x40')][_0x9f6c('0x41')]?_0x3db5de[_0x9f6c('0x40')]:_0x5c891c[_0x9f6c('0x3a')];if(!_0x153ccc[_0x9f6c('0x3c')][_0x9f6c('0x42')]('nolimit')){_0x3db5de[_0x9f6c('0x2b')]=qs[_0x9f6c('0x2b')](_0x153ccc[_0x9f6c('0x3c')]['limit']);_0x3db5de[_0x9f6c('0x2a')]=qs[_0x9f6c('0x2a')](_0x153ccc[_0x9f6c('0x3c')]['offset']);}_0x3db5de[_0x9f6c('0x44')]=qs['sort'](_0x153ccc['query'][_0x9f6c('0x45')]);_0x3db5de[_0x9f6c('0x48')]=qs[_0x9f6c('0x3d')](_[_0x9f6c('0x46')](_0x153ccc[_0x9f6c('0x3c')],_0x5c891c[_0x9f6c('0x3d')]));_0x3db5de['where'][_0x9f6c('0x66')]=_0x44ce87['id'];if(_0x153ccc['query'][_0x9f6c('0x47')]){_0x3db5de['where']=_['merge'](_0x3db5de[_0x9f6c('0x48')],{'$or':_[_0x9f6c('0x4a')](_0x3db5de['attributes'],function(_0x1467b6){var _0x128a00={};_0x128a00[_0x1467b6]={'$like':'%'+_0x153ccc['query']['filter']+'%'};return _0x128a00;})});}_0x3db5de=_['merge']({},_0x3db5de,_0x153ccc[_0x9f6c('0x4f')]);return db[_0x9f6c('0x68')][_0x9f6c('0x29')]({'where':_0x3db5de[_0x9f6c('0x48')]})[_0x9f6c('0x2f')](function(_0x2bf70f){_0x1dddf6['count']=_0x2bf70f;if(_0x153ccc[_0x9f6c('0x3c')][_0x9f6c('0x51')]){_0x3db5de[_0x9f6c('0x52')]=[{'all':!![]}];}return db[_0x9f6c('0x68')][_0x9f6c('0x53')](_0x3db5de);})[_0x9f6c('0x2f')](function(_0x435200){_0x1dddf6['rows']=_0x435200;return _0x1dddf6;});}})[_0x9f6c('0x2f')](respondWithFilteredResult(_0x23cd6b,_0x3db5de))[_0x9f6c('0x55')](handleError(_0x23cd6b,null));};exports['removeDispositions']=function(_0x81e73b,_0x367f16,_0x334415){var _0x160007;return db[_0x9f6c('0x50')][_0x9f6c('0x58')]({'where':{'id':_0x81e73b[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x367f16,null))[_0x9f6c('0x2f')](function(_0x52be3c){if(_0x52be3c){return _0x52be3c[_0x9f6c('0x69')](_0x81e73b[_0x9f6c('0x3c')][_0x9f6c('0x6a')]);}})[_0x9f6c('0x2f')](respondWithStatusCode(_0x367f16,null))[_0x9f6c('0x55')](handleError(_0x367f16,null));};exports[_0x9f6c('0x6b')]=function(_0x495776,_0x18ac74,_0xc0bd33){if(_0x495776[_0x9f6c('0x5a')]['id']){delete _0x495776['body']['id'];}return db[_0x9f6c('0x50')][_0x9f6c('0x58')]({'where':{'id':_0x495776[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x18ac74,null))[_0x9f6c('0x2f')](function(_0x509358){if(_0x509358){_0x495776['body'][_0x9f6c('0x66')]=_0x509358['id'];return db[_0x9f6c('0x6c')][_0x9f6c('0x59')](_0x495776[_0x9f6c('0x5a')]);}})[_0x9f6c('0x2f')](respondWithResult(_0x18ac74,null))[_0x9f6c('0x55')](handleError(_0x18ac74,null));};exports[_0x9f6c('0x6d')]=function(_0x304c37,_0x5c5f44,_0x371ef4){var _0x5247e4={'raw':![],'where':{}};var _0x350933={};var _0x2b1701={'count':0x0,'rows':[]};return db[_0x9f6c('0x50')]['findOne']({'where':{'id':_0x304c37[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x5c5f44,null))[_0x9f6c('0x2f')](function(_0x4278f6){if(_0x4278f6){_0x350933[_0x9f6c('0x3a')]=_[_0x9f6c('0x3b')](db[_0x9f6c('0x6c')][_0x9f6c('0x39')]);_0x350933[_0x9f6c('0x3c')]=_[_0x9f6c('0x3b')](_0x304c37[_0x9f6c('0x3c')]);_0x350933[_0x9f6c('0x3d')]=_['intersection'](_0x350933[_0x9f6c('0x3a')],_0x350933[_0x9f6c('0x3c')]);_0x5247e4[_0x9f6c('0x40')]=_[_0x9f6c('0x3e')](_0x350933['model'],qs[_0x9f6c('0x3f')](_0x304c37[_0x9f6c('0x3c')]['fields']));_0x5247e4['attributes']=_0x5247e4[_0x9f6c('0x40')][_0x9f6c('0x41')]?_0x5247e4['attributes']:_0x350933[_0x9f6c('0x3a')];if(!_0x304c37[_0x9f6c('0x3c')][_0x9f6c('0x42')](_0x9f6c('0x43'))){_0x5247e4[_0x9f6c('0x2b')]=qs[_0x9f6c('0x2b')](_0x304c37[_0x9f6c('0x3c')][_0x9f6c('0x2b')]);_0x5247e4['offset']=qs[_0x9f6c('0x2a')](_0x304c37[_0x9f6c('0x3c')]['offset']);}_0x5247e4[_0x9f6c('0x44')]=qs[_0x9f6c('0x45')](_0x304c37[_0x9f6c('0x3c')][_0x9f6c('0x45')]);_0x5247e4['where']=qs[_0x9f6c('0x3d')](_[_0x9f6c('0x46')](_0x304c37[_0x9f6c('0x3c')],_0x350933[_0x9f6c('0x3d')]));_0x5247e4[_0x9f6c('0x48')]['FaxAccountId']=_0x4278f6['id'];if(_0x304c37[_0x9f6c('0x3c')][_0x9f6c('0x47')]){_0x5247e4['where']=_['merge'](_0x5247e4[_0x9f6c('0x48')],{'$or':_[_0x9f6c('0x4a')](_0x5247e4[_0x9f6c('0x40')],function(_0x2dd7bd){var _0x478c66={};_0x478c66[_0x2dd7bd]={'$like':'%'+_0x304c37[_0x9f6c('0x3c')][_0x9f6c('0x47')]+'%'};return _0x478c66;})});}_0x5247e4=_[_0x9f6c('0x49')]({},_0x5247e4,_0x304c37[_0x9f6c('0x4f')]);return db['CannedAnswer'][_0x9f6c('0x29')]({'where':_0x5247e4['where']})[_0x9f6c('0x2f')](function(_0x34a673){_0x2b1701['count']=_0x34a673;if(_0x304c37[_0x9f6c('0x3c')][_0x9f6c('0x51')]){_0x5247e4[_0x9f6c('0x52')]=[{'all':!![]}];}return db[_0x9f6c('0x6c')][_0x9f6c('0x53')](_0x5247e4);})[_0x9f6c('0x2f')](function(_0xd1294){_0x2b1701[_0x9f6c('0x54')]=_0xd1294;return _0x2b1701;});}})[_0x9f6c('0x2f')](respondWithFilteredResult(_0x5c5f44,_0x5247e4))[_0x9f6c('0x55')](handleError(_0x5c5f44,null));};exports[_0x9f6c('0x6e')]=function(_0x1cfd1a,_0xe074b6,_0x586d71){var _0x59e3d7;return db[_0x9f6c('0x50')][_0x9f6c('0x58')]({'where':{'id':_0x1cfd1a[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0xe074b6,null))[_0x9f6c('0x2f')](function(_0x5bcd9b){if(_0x5bcd9b){return _0x5bcd9b['removeAnswers'](_0x1cfd1a[_0x9f6c('0x3c')]['ids']);}})[_0x9f6c('0x2f')](respondWithStatusCode(_0xe074b6,null))[_0x9f6c('0x55')](handleError(_0xe074b6,null));};exports['addInteraction']=function(_0xa1ba9a,_0x2420da,_0x3c889a){return db[_0x9f6c('0x6f')][_0x9f6c('0x58')]({'where':{'id':_0xa1ba9a[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x2420da,null))['then'](function(_0x5e4e4a){if(_0x5e4e4a){return _0x5e4e4a[_0x9f6c('0x70')](_0xa1ba9a[_0x9f6c('0x5a')][_0x9f6c('0x6a')],_[_0x9f6c('0x71')](_0xa1ba9a['body'],[_0x9f6c('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x2420da,null))[_0x9f6c('0x55')](handleError(_0x2420da,null));};exports[_0x9f6c('0x72')]=function(_0x887f17,_0x3bf385,_0x4356e6){var _0x34dc8d={'raw':![],'where':{}};var _0x5ca500={};var _0x108a18={'count':0x0,'rows':[]};return db[_0x9f6c('0x50')][_0x9f6c('0x73')]({'where':{'id':_0x887f17[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x3bf385,null))[_0x9f6c('0x2f')](function(_0x2a72c1){if(_0x2a72c1){_0x5ca500[_0x9f6c('0x3a')]=_[_0x9f6c('0x3b')](db[_0x9f6c('0x6f')]['rawAttributes']);_0x5ca500['query']=_['keys'](_0x887f17[_0x9f6c('0x3c')]);_0x5ca500[_0x9f6c('0x3d')]=_[_0x9f6c('0x3e')](_0x5ca500['model'],_0x5ca500[_0x9f6c('0x3c')]);_0x34dc8d['attributes']=_[_0x9f6c('0x3e')](_0x5ca500[_0x9f6c('0x3a')],qs[_0x9f6c('0x3f')](_0x887f17['query']['fields']));_0x34dc8d['attributes']=_0x34dc8d[_0x9f6c('0x40')][_0x9f6c('0x41')]?_0x34dc8d[_0x9f6c('0x40')]:_0x5ca500['model'];if(!_0x887f17['query'][_0x9f6c('0x42')](_0x9f6c('0x43'))){_0x34dc8d[_0x9f6c('0x2b')]=qs[_0x9f6c('0x2b')](_0x887f17[_0x9f6c('0x3c')][_0x9f6c('0x2b')]);_0x34dc8d[_0x9f6c('0x2a')]=qs['offset'](_0x887f17['query'][_0x9f6c('0x2a')]);}_0x34dc8d[_0x9f6c('0x44')]=qs[_0x9f6c('0x45')](_0x887f17[_0x9f6c('0x3c')]['sort']);_0x34dc8d[_0x9f6c('0x48')]=qs['filters'](_[_0x9f6c('0x46')](_0x887f17[_0x9f6c('0x3c')],_0x5ca500[_0x9f6c('0x3d')]));_0x34dc8d[_0x9f6c('0x48')]['FaxAccountId']=_0x2a72c1['id'];if(_0x887f17[_0x9f6c('0x3c')][_0x9f6c('0x47')]){_0x34dc8d[_0x9f6c('0x48')]=_[_0x9f6c('0x49')](_0x34dc8d[_0x9f6c('0x48')],{'$or':_[_0x9f6c('0x4a')](_0x34dc8d['attributes'],function(_0x5a2cf8){var _0x5d6cc1={};_0x5d6cc1[_0x5a2cf8]={'$like':'%'+_0x887f17[_0x9f6c('0x3c')][_0x9f6c('0x47')]+'%'};return _0x5d6cc1;})});}_0x34dc8d=_[_0x9f6c('0x49')]({},_0x34dc8d,_0x887f17['options']);return db[_0x9f6c('0x6f')][_0x9f6c('0x29')]({'where':_0x34dc8d['where']})[_0x9f6c('0x2f')](function(_0x67dedc){_0x108a18[_0x9f6c('0x29')]=_0x67dedc;if(_0x887f17[_0x9f6c('0x3c')][_0x9f6c('0x51')]){_0x34dc8d[_0x9f6c('0x52')]=[{'model':db[_0x9f6c('0x74')],'as':_0x9f6c('0x75'),'required':![]},{'model':db[_0x9f6c('0x76')],'as':'Owner','attributes':[_0x9f6c('0x35'),_0x9f6c('0x77'),_0x9f6c('0x78')],'required':![]},{'model':db[_0x9f6c('0x79')],'as':_0x9f6c('0x7a'),'attributes':['id',_0x9f6c('0x35'),'color'],'where':_0x887f17[_0x9f6c('0x3c')][_0x9f6c('0x7b')]?{'id':_0x887f17[_0x9f6c('0x3c')]['tag']}:undefined,'required':_0x887f17[_0x9f6c('0x3c')][_0x9f6c('0x7b')]?!![]:![]}];}return db['FaxInteraction'][_0x9f6c('0x53')](_0x34dc8d);})[_0x9f6c('0x2f')](function(_0x3e4a7c){_0x108a18[_0x9f6c('0x54')]=_0x3e4a7c;return _0x108a18;});}})[_0x9f6c('0x2f')](respondWithFilteredResult(_0x3bf385,_0x34dc8d))[_0x9f6c('0x55')](handleError(_0x3bf385,null));};exports[_0x9f6c('0x7c')]=function(_0x56198f,_0x1e4379,_0x2888e4){return db[_0x9f6c('0x50')][_0x9f6c('0x73')]({'where':{'id':_0x56198f[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x1e4379,null))[_0x9f6c('0x2f')](function(_0x7dc56){if(_0x7dc56){return db[_0x9f6c('0x7d')][_0x9f6c('0x7e')](function(_0x11c8f6){return db['FaxApplication'][_0x9f6c('0x32')]({'where':{'FaxAccountId':_0x56198f[_0x9f6c('0x57')]['id']},'transaction':_0x11c8f6})[_0x9f6c('0x2f')](function(_0xf9b2bc){var _0x484dd6=_[_0x9f6c('0x4a')](_0x56198f[_0x9f6c('0x5a')],function(_0x3d0cb2){_0x3d0cb2[_0x9f6c('0x66')]=_0x56198f['params']['id'];return _0x3d0cb2;});return db['FaxApplication'][_0x9f6c('0x7f')](_0x484dd6,{'transaction':_0x11c8f6});});})['then'](function(){return db['FaxApplication'][_0x9f6c('0x80')]({'where':{'FaxAccountId':_0x56198f['params']['id']},'order':_0x9f6c('0x81')});});}})[_0x9f6c('0x2f')](respondWithResult(_0x1e4379,null))['catch'](handleError(_0x1e4379,null));};exports[_0x9f6c('0x82')]=function(_0x5ea3a5,_0x36d592,_0x5be222){var _0x53baea={};var _0x2a4bd0={};var _0x5db5af;var _0xc1ecf1;return db[_0x9f6c('0x50')]['findOne']({'where':{'id':_0x5ea3a5[_0x9f6c('0x57')]['id']}})['then'](handleEntityNotFound(_0x36d592,null))[_0x9f6c('0x2f')](function(_0x5a1e71){if(_0x5a1e71){_0x5db5af=_0x5a1e71;_0x2a4bd0[_0x9f6c('0x3a')]=_['keys'](db[_0x9f6c('0x83')][_0x9f6c('0x39')]);_0x2a4bd0[_0x9f6c('0x3c')]=_[_0x9f6c('0x3b')](_0x5ea3a5['query']);_0x2a4bd0['filters']=_[_0x9f6c('0x3e')](_0x2a4bd0[_0x9f6c('0x3a')],_0x2a4bd0['query']);_0x53baea['attributes']=_[_0x9f6c('0x3e')](_0x2a4bd0[_0x9f6c('0x3a')],qs[_0x9f6c('0x3f')](_0x5ea3a5['query']['fields']));_0x53baea[_0x9f6c('0x40')]=_0x53baea['attributes'][_0x9f6c('0x41')]?_0x53baea[_0x9f6c('0x40')]:_0x2a4bd0[_0x9f6c('0x3a')];_0x53baea[_0x9f6c('0x44')]=qs[_0x9f6c('0x45')](_0x5ea3a5[_0x9f6c('0x3c')][_0x9f6c('0x45')]);_0x53baea[_0x9f6c('0x48')]=qs[_0x9f6c('0x3d')](_['pick'](_0x5ea3a5[_0x9f6c('0x3c')],_0x2a4bd0[_0x9f6c('0x3d')]));if(_0x5ea3a5[_0x9f6c('0x3c')][_0x9f6c('0x47')]){_0x53baea[_0x9f6c('0x48')]=_[_0x9f6c('0x49')](_0x53baea[_0x9f6c('0x48')],{'$or':_['map'](_0x53baea[_0x9f6c('0x40')],function(_0x1dff4a){var _0x459c6a={};_0x459c6a[_0x1dff4a]={'$like':'%'+_0x5ea3a5[_0x9f6c('0x3c')][_0x9f6c('0x47')]+'%'};return _0x459c6a;})});}_0x53baea=_[_0x9f6c('0x49')]({},_0x53baea,_0x5ea3a5['options']);return _0x5db5af[_0x9f6c('0x82')](_0x53baea);}})[_0x9f6c('0x2f')](function(_0x29a817){if(_0x29a817){_0xc1ecf1=_0x29a817[_0x9f6c('0x41')];if(!_0x5ea3a5[_0x9f6c('0x3c')][_0x9f6c('0x42')](_0x9f6c('0x43'))){_0x53baea[_0x9f6c('0x2b')]=qs[_0x9f6c('0x2b')](_0x5ea3a5[_0x9f6c('0x3c')][_0x9f6c('0x2b')]);_0x53baea[_0x9f6c('0x2a')]=qs[_0x9f6c('0x2a')](_0x5ea3a5[_0x9f6c('0x3c')][_0x9f6c('0x2a')]);}return _0x5db5af['getApplications'](_0x53baea);}})[_0x9f6c('0x2f')](function(_0xdfb616){if(_0xdfb616){return _0xdfb616?{'count':_0xc1ecf1,'rows':_0xdfb616}:null;}})[_0x9f6c('0x2f')](respondWithResult(_0x36d592,null))['catch'](handleError(_0x36d592,null));};function Extension(_0x52bef8,_0x274ecf,_0x29f4ce,_0x791ed1){this[_0x9f6c('0x84')]=_0x9f6c('0x85');this[_0x9f6c('0x86')]=_0x52bef8[_0x9f6c('0x87')];this[_0x9f6c('0x88')]=_0x791ed1;this[_0x9f6c('0x4b')]='system';this['description']=_0x9f6c('0x89');this['FaxAccountId']=_0x52bef8['id'];this[_0x9f6c('0x81')]=_0x274ecf;this[_0x9f6c('0x8a')]=_0x29f4ce;}function createExtensionsReciveFax(_0x2f4afb){var _0x2142c8=0x1;var _0x1b3e2e=[];_0x1b3e2e[_0x9f6c('0x8b')](new Extension(_0x2f4afb,_0x2142c8,'','Answer'));_0x2142c8+=0x1;_0x1b3e2e[_0x9f6c('0x8b')](new Extension(_0x2f4afb,_0x2142c8,_0x9f6c('0x8c'),_0x9f6c('0x8d')));_0x2142c8+=0x1;for(var _0x50ee61 in _0x2f4afb){if(_0x2f4afb['hasOwnProperty'](_0x50ee61)&&(_0x50ee61==='ecm'||_0x50ee61===_0x9f6c('0x87')||_0x50ee61===_0x9f6c('0x8e')||_0x50ee61==='faxdetect'||_0x50ee61==='headerinfo'||_0x50ee61==='maxrate'||_0x50ee61===_0x9f6c('0x8f')||_0x50ee61===_0x9f6c('0x90')||_0x50ee61===_0x9f6c('0x91'))){_0x1b3e2e[_0x9f6c('0x8b')](new Extension(_0x2f4afb,_0x2142c8,_0x9f6c('0x92')+_0x50ee61+')='+_0x2f4afb[_0x50ee61],_0x9f6c('0x8d')));_0x2142c8+=0x1;}}_0x1b3e2e[_0x9f6c('0x8b')](new Extension(_0x2f4afb,_0x2142c8,'6',_0x9f6c('0x93')));_0x2142c8+=0x1;_0x1b3e2e[_0x9f6c('0x8b')](new Extension(_0x2f4afb,_0x2142c8,'/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',_0x9f6c('0x94')));_0x2142c8=0x0;return _0x1b3e2e;}exports[_0x9f6c('0x95')]=function(_0x17ce12,_0x32085f,_0x2a043d){var _0xb69b32;return db[_0x9f6c('0x7d')][_0x9f6c('0x7e')](function(_0x1cead7){return db['FaxAccount'][_0x9f6c('0x59')](_0x17ce12['body'],{'transaction':_0x1cead7})[_0x9f6c('0x2f')](function(_0x39ff87){_0xb69b32=_0x39ff87[_0x9f6c('0x30')]({'plain':!![]});return db['VoiceExtension'][_0x9f6c('0x7f')](createExtensionsReciveFax(_0xb69b32),{'transaction':_0x1cead7});});})[_0x9f6c('0x2f')](function(){return _0xb69b32;})[_0x9f6c('0x2f')](respondWithResult(_0x32085f,null))[_0x9f6c('0x55')](handleError(_0x32085f,null));};exports[_0x9f6c('0x96')]=function(_0x54abd0,_0x580d9a,_0x5315de){var _0x4563e7;return db[_0x9f6c('0x7d')][_0x9f6c('0x7e')](function(_0x40f69c){return db[_0x9f6c('0x50')]['update'](_0x54abd0[_0x9f6c('0x5a')],{'where':{'id':_0x54abd0[_0x9f6c('0x5a')]['id']},'transaction':_0x40f69c})[_0x9f6c('0x2f')](function(_0x81d26f){return db['VoiceExtension'][_0x9f6c('0x32')]({'where':{'FaxAccountId':_0x54abd0['body']['id']},'transaction':_0x40f69c})[_0x9f6c('0x2f')](function(_0x34364d){return db[_0x9f6c('0x97')][_0x9f6c('0x7f')](createExtensionsReciveFax(_[_0x9f6c('0x71')](_0x54abd0['body'],[_0x9f6c('0x98'),_0x9f6c('0x4c'),_0x9f6c('0x99'),_0x9f6c('0x9a'),_0x9f6c('0x9b'),_0x9f6c('0x9c')])),{'transaction':_0x40f69c});});});})['then'](function(){return db[_0x9f6c('0x50')][_0x9f6c('0x9d')](_0x54abd0['body']['id']);})[_0x9f6c('0x2f')](respondWithResult(_0x580d9a,null))[_0x9f6c('0x55')](handleError(_0x580d9a,null));};exports[_0x9f6c('0x9e')]=function(_0x2e617d,_0x4b52e7,_0x415826){var _0xec626={'raw':!![],'where':{}};var _0x29ca03={};var _0x35b9fb={'count':0x0,'rows':[]};return db[_0x9f6c('0x50')][_0x9f6c('0x73')]({'where':{'id':_0x2e617d[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x4b52e7,null))[_0x9f6c('0x2f')](function(_0x4a1723){if(_0x4a1723){_0x29ca03[_0x9f6c('0x3a')]=_[_0x9f6c('0x3b')](db[_0x9f6c('0x9f')][_0x9f6c('0x39')]);_0x29ca03[_0x9f6c('0x3c')]=_[_0x9f6c('0x3b')](_0x2e617d[_0x9f6c('0x3c')]);_0x29ca03[_0x9f6c('0x3d')]=_[_0x9f6c('0x3e')](_0x29ca03[_0x9f6c('0x3a')],_0x29ca03[_0x9f6c('0x3c')]);_0xec626[_0x9f6c('0x40')]=_['intersection'](_0x29ca03[_0x9f6c('0x3a')],qs[_0x9f6c('0x3f')](_0x2e617d[_0x9f6c('0x3c')][_0x9f6c('0x3f')]));_0xec626[_0x9f6c('0x40')]=_0xec626['attributes']['length']?_0xec626[_0x9f6c('0x40')]:_0x29ca03[_0x9f6c('0x3a')];if(!_0x2e617d['query'][_0x9f6c('0x42')](_0x9f6c('0x43'))){_0xec626[_0x9f6c('0x2b')]=qs[_0x9f6c('0x2b')](_0x2e617d[_0x9f6c('0x3c')]['limit']);_0xec626[_0x9f6c('0x2a')]=qs['offset'](_0x2e617d[_0x9f6c('0x3c')][_0x9f6c('0x2a')]);}_0xec626[_0x9f6c('0x44')]=qs['sort'](_0x2e617d[_0x9f6c('0x3c')][_0x9f6c('0x45')]);_0xec626['where']=qs[_0x9f6c('0x3d')](_[_0x9f6c('0x46')](_0x2e617d['query'],_0x29ca03['filters']));_0xec626[_0x9f6c('0x48')][_0x9f6c('0x66')]=_0x4a1723['id'];if(_0x2e617d[_0x9f6c('0x3c')]['filter']){_0xec626[_0x9f6c('0x48')]=_['merge'](_0xec626['where'],{'$or':_[_0x9f6c('0x4a')](_0xec626[_0x9f6c('0x40')],function(_0x2a9de4){var _0x43b7b5={};_0x43b7b5[_0x2a9de4]={'$like':'%'+_0x2e617d[_0x9f6c('0x3c')]['filter']+'%'};return _0x43b7b5;})});}if(_0x2e617d['query'][_0x9f6c('0xa0')]){var _0xf751b8=_0x2e617d[_0x9f6c('0x3c')][_0x9f6c('0xa0')][_0x9f6c('0xa1')](',');var _0x17f333={};_0x17f333[_0xf751b8[0x0]]={'$gte':moment(_0xf751b8[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xec626[_0x9f6c('0x48')]=_[_0x9f6c('0x49')](_0xec626[_0x9f6c('0x48')],_0x17f333);}_0xec626=_['merge']({},_0xec626,_0x2e617d[_0x9f6c('0x4f')]);return db[_0x9f6c('0x9f')][_0x9f6c('0x29')]({'where':_0xec626[_0x9f6c('0x48')]})[_0x9f6c('0x2f')](function(_0x28ca75){_0x35b9fb[_0x9f6c('0x29')]=_0x28ca75;if(_0x2e617d['query']['includeAll']){_0xec626[_0x9f6c('0x52')]=[{'all':!![]}];}return db[_0x9f6c('0x9f')][_0x9f6c('0x53')](_0xec626);})[_0x9f6c('0x2f')](function(_0x21d430){_0x35b9fb[_0x9f6c('0x54')]=_0x21d430;return _0x35b9fb;});}})[_0x9f6c('0x2f')](respondWithFilteredResult(_0x4b52e7,_0xec626))[_0x9f6c('0x55')](handleError(_0x4b52e7,null));};exports[_0x9f6c('0x36')]=function(_0x240cb3,_0x124cdc,_0x5c6406){var _0x7a9da,_0x1a685d={},_0x26b792;if(_0x240cb3[_0x9f6c('0x5a')]['to']){_0x26b792=_0x240cb3[_0x9f6c('0x5a')]['to'][0x0];}return db[_0x9f6c('0x50')][_0x9f6c('0x58')]({'where':{'id':_0x240cb3[_0x9f6c('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x9f6c('0x74')],'as':'Contacts','where':{'fax':_0x26b792},'limit':0x1,'order':[[_0x9f6c('0x9a'),_0x9f6c('0xa2')]]}]}]})[_0x9f6c('0x2f')](handleEntityNotFound(_0x124cdc,null))['then'](function(_0x14acdb){_0x7a9da=_0x14acdb;if(_0x240cb3['body'][_0x9f6c('0xa3')]&&_0x240cb3['body']['attachments']['length']){for(var _0x11245a=0x0;_0x11245a<_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa3')]['length'];_0x11245a+=0x1){_0x240cb3[_0x9f6c('0x5a')]['attachments'][_0x11245a]={'filename':_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa3')][_0x11245a][_0x9f6c('0x35')],'id':_0x240cb3['body']['attachments'][_0x11245a]['id'],'path':path['join'](config[_0x9f6c('0xa4')],_0x9f6c('0xa5'),_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa3')][_0x11245a]['basename'])};}}return respondWithRpcPromise(_0x9f6c('0xa6'),'CheckAfterSend',{'FaxAccountId':_[_0x9f6c('0xa7')](_0x240cb3['params']['id'])?undefined:_0x240cb3['params']['id'],'path':_[_0x9f6c('0xa7')](_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa3')][0x0][_0x9f6c('0xa8')])?undefined:_0x240cb3[_0x9f6c('0x5a')]['attachments'][0x0][_0x9f6c('0xa8')],'fax':_[_0x9f6c('0xa7')](_0x240cb3[_0x9f6c('0x5a')]['to'][0x0])?undefined:_0x240cb3[_0x9f6c('0x5a')]['to'][0x0]},client9002);})[_0x9f6c('0x2f')](function(){if(_0x7a9da){if(_[_0x9f6c('0xa7')](_0x240cb3[_0x9f6c('0x5a')]['from'])){_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa9')]=util[_0x9f6c('0xaa')](_0x9f6c('0xab'),_0x7a9da[_0x9f6c('0x35')],_0x7a9da[_0x9f6c('0xac')]);}if(_0x7a9da['List']){if(_0x7a9da[_0x9f6c('0xad')][_0x9f6c('0xae')]['length']){return _0x7a9da[_0x9f6c('0xad')][_0x9f6c('0xae')][0x0];}else{return db[_0x9f6c('0x74')][_0x9f6c('0x59')](_['defaults'](_0x240cb3['body'],{'firstName':_0x240cb3[_0x9f6c('0x5a')]['to'][0x0],'phone':_0x240cb3[_0x9f6c('0x5a')]['to'][0x0],'fax':_0x240cb3[_0x9f6c('0x5a')]['to'][0x0],'ListId':_0x7a9da[_0x9f6c('0x9c')]}));}}else{throw new Error(_0x9f6c('0xaf'));}}else{throw new Error(_0x9f6c('0xb0'));}})['then'](function(_0x4dc5db){if(_0x4dc5db){return db[_0x9f6c('0x6f')][_0x9f6c('0x58')]({'where':{'ContactId':_0x4dc5db['id'],'closed':![],'FaxAccountId':_0x7a9da['id']}})[_0x9f6c('0x2f')](function(_0x38f2fc){if(_0x38f2fc){return[_0x38f2fc,![]];}return db[_0x9f6c('0x6f')][_0x9f6c('0x59')]({'UserId':_0x240cb3['user']['id'],'ContactId':_0x4dc5db['id'],'FaxAccountId':_0x7a9da['id'],'fax':_0x240cb3[_0x9f6c('0x5a')]['to'][0x0],'firstMsgDirection':_0x9f6c('0xb1'),'Messages':[_[_0x9f6c('0x49')](_0x240cb3['body'],{'read':![],'body':_0x240cb3['body'][_0x9f6c('0xa3')][0x0][_0x9f6c('0xb2')],'FaxAccountId':_0x7a9da['id'],'UserId':_0x240cb3[_0x9f6c('0x5b')]['id'],'ContactId':_0x4dc5db['id'],'AttachmentId':_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa3')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x9f6c('0xb3')}]})[_0x9f6c('0x2f')](function(_0x4a32ff){return[_0x4a32ff,!![]];});});}else{throw new Error(_0x9f6c('0xb4'));}})[_0x9f6c('0xb5')](function(_0x1f53ed,_0x484f7d){if(_0x484f7d){return _0x1f53ed;}return db[_0x9f6c('0x9f')][_0x9f6c('0x59')]({'direction':_0x9f6c('0xb1'),'read':![],'body':_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa3')][0x0][_0x9f6c('0xb2')],'FaxAccountId':_0x7a9da['id'],'FaxInteractionId':_0x1f53ed['id'],'UserId':_0x240cb3['user']['id'],'ContactId':_0x1f53ed['ContactId'],'AttachmentId':_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa3')][0x0]['id']})['then'](function(_0x1538b9){_0x1f53ed[_0x9f6c('0xb6')][_0x9f6c('0xb3')]=[];_0x1f53ed['dataValues'][_0x9f6c('0xb3')][_0x9f6c('0x8b')](_0x1538b9[_0x9f6c('0xb6')]);return _0x1f53ed;});})['then'](function(_0xcbe688){respondWithRpcPromise(_0x9f6c('0xb7'),_0x9f6c('0xb7'),{'FaxAccountId':_[_0x9f6c('0xa7')](_0x240cb3['params']['id'])?undefined:_0x240cb3['params']['id'],'path':_[_0x9f6c('0xa7')](_0x240cb3['body'][_0x9f6c('0xa3')][0x0][_0x9f6c('0xa8')])?undefined:_0x240cb3[_0x9f6c('0x5a')][_0x9f6c('0xa3')][0x0]['path'],'fax':_['isNil'](_0x240cb3[_0x9f6c('0x5a')]['to'][0x0])?undefined:_0x240cb3[_0x9f6c('0x5a')]['to'][0x0],'AttachmentId':_0x240cb3['body'][_0x9f6c('0xa3')][0x0]['id']},client9002)['then'](function(_0x47783b){logger['info'](_0x9f6c('0xb8'),_0x47783b);})['catch'](function(_0x1e2046){logger['info']('SendFaxRpc,\x20%s',_0x1e2046);});return _0xcbe688;})[_0x9f6c('0x2f')](respondWithResult(_0x124cdc,null))[_0x9f6c('0x55')](handleError(_0x124cdc,null));};exports['addAgents']=function(_0x215aef,_0xcb46f3,_0x51fd36){return db[_0x9f6c('0x50')][_0x9f6c('0x58')]({'where':{'id':_0x215aef[_0x9f6c('0x57')]['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0xcb46f3,null))[_0x9f6c('0x2f')](function(_0x8d94e1){if(_0x8d94e1){return _0x8d94e1[_0x9f6c('0xb9')](_0x215aef[_0x9f6c('0x5a')][_0x9f6c('0x6a')],_[_0x9f6c('0x71')](_0x215aef[_0x9f6c('0x5a')],[_0x9f6c('0x6a'),'id'])||{})[_0x9f6c('0xb5')](function(_0x1c2d0e){for(var _0x3bdb91=0x0;_0x3bdb91<_0x215aef['body']['ids'][_0x9f6c('0x41')];_0x3bdb91+=0x1){socket[_0x9f6c('0xba')](_0x9f6c('0xbb'),{'UserId':_0x215aef['body'][_0x9f6c('0x6a')][_0x3bdb91],'FaxAccountId':_0x215aef[_0x9f6c('0x57')]['id']});}return _0x1c2d0e;});}})[_0x9f6c('0x2f')](respondWithResult(_0xcb46f3,null))[_0x9f6c('0x55')](handleError(_0xcb46f3,null));};exports[_0x9f6c('0xbc')]=function(_0x154f07,_0x693dec,_0x55f8e6){var _0x139be3;return db['FaxAccount']['find']({'where':{'id':_0x154f07['params']['id']}})[_0x9f6c('0x2f')](handleEntityNotFound(_0x693dec,null))[_0x9f6c('0x2f')](function(_0x2d1721){if(_0x2d1721){return _0x2d1721[_0x9f6c('0xbc')](_0x154f07[_0x9f6c('0x3c')]['ids'])[_0x9f6c('0x2f')](function(_0x4885fc){if(_[_0x9f6c('0xbd')](_0x154f07[_0x9f6c('0x3c')][_0x9f6c('0x6a')])){for(var _0xa27c17=0x0;_0xa27c17<_0x154f07[_0x9f6c('0x3c')][_0x9f6c('0x6a')][_0x9f6c('0x41')];_0xa27c17+=0x1){socket[_0x9f6c('0xba')](_0x9f6c('0xbe'),{'UserId':_0x154f07[_0x9f6c('0x3c')]['ids'][_0xa27c17],'FaxAccountId':_0x154f07[_0x9f6c('0x57')]['id']});}}else{socket[_0x9f6c('0xba')](_0x9f6c('0xbe'),{'UserId':_0x154f07['query']['ids'],'FaxAccountId':_0x154f07[_0x9f6c('0x57')]['id']});}});}})['then'](respondWithStatusCode(_0x693dec,null))[_0x9f6c('0x55')](handleError(_0x693dec,null));};exports[_0x9f6c('0xbf')]=function(_0x537fa4,_0x1c05d5,_0x244bfa){var _0x140ab9={};var _0x50ac0a={};var _0x8cae77;var _0x5b25b5;return db['FaxAccount'][_0x9f6c('0x73')]({'where':{'id':_0x537fa4[_0x9f6c('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c05d5,null))[_0x9f6c('0x2f')](function(_0x5128c8){if(_0x5128c8){_0x8cae77=_0x5128c8;_0x50ac0a[_0x9f6c('0x3a')]=_[_0x9f6c('0x3b')](db[_0x9f6c('0x76')][_0x9f6c('0x39')]);_0x50ac0a[_0x9f6c('0x3c')]=_[_0x9f6c('0x3b')](_0x537fa4[_0x9f6c('0x3c')]);_0x50ac0a['filters']=_['intersection'](_0x50ac0a[_0x9f6c('0x3a')],_0x50ac0a[_0x9f6c('0x3c')]);_0x140ab9[_0x9f6c('0x40')]=_[_0x9f6c('0x3e')](_0x50ac0a[_0x9f6c('0x3a')],qs[_0x9f6c('0x3f')](_0x537fa4[_0x9f6c('0x3c')][_0x9f6c('0x3f')]));_0x140ab9['attributes']=_0x140ab9[_0x9f6c('0x40')][_0x9f6c('0x41')]?_0x140ab9['attributes']:_0x50ac0a['model'];_0x140ab9['order']=qs[_0x9f6c('0x45')](_0x537fa4['query'][_0x9f6c('0x45')]);_0x140ab9[_0x9f6c('0x48')]=qs['filters'](_[_0x9f6c('0x46')](_0x537fa4[_0x9f6c('0x3c')],_0x50ac0a['filters']));if(_0x537fa4[_0x9f6c('0x3c')]['filter']){_0x140ab9[_0x9f6c('0x48')]=_[_0x9f6c('0x49')](_0x140ab9[_0x9f6c('0x48')],{'$or':_[_0x9f6c('0x4a')](_0x140ab9[_0x9f6c('0x40')],function(_0x495ae5){var _0x14025a={};_0x14025a[_0x495ae5]={'$like':'%'+_0x537fa4[_0x9f6c('0x3c')]['filter']+'%'};return _0x14025a;})});}_0x140ab9=_[_0x9f6c('0x49')]({},_0x140ab9,_0x537fa4[_0x9f6c('0x4f')]);return _0x8cae77[_0x9f6c('0xbf')](_0x140ab9);}})[_0x9f6c('0x2f')](function(_0x492af3){if(_0x492af3){_0x5b25b5=_0x492af3[_0x9f6c('0x41')];if(!_0x537fa4[_0x9f6c('0x3c')][_0x9f6c('0x42')](_0x9f6c('0x43'))){_0x140ab9[_0x9f6c('0x2b')]=qs['limit'](_0x537fa4[_0x9f6c('0x3c')][_0x9f6c('0x2b')]);_0x140ab9[_0x9f6c('0x2a')]=qs['offset'](_0x537fa4[_0x9f6c('0x3c')][_0x9f6c('0x2a')]);}return _0x8cae77[_0x9f6c('0xbf')](_0x140ab9);}})[_0x9f6c('0x2f')](function(_0x2f43ab){if(_0x2f43ab){return _0x2f43ab?{'count':_0x5b25b5,'rows':_0x2f43ab}:null;}})['then'](respondWithResult(_0x1c05d5,null))[_0x9f6c('0x55')](handleError(_0x1c05d5,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 68e4b8e..a4a65f8 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 _0x7bf7=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x199610,_0x53545f){var _0x44250d=function(_0x5e5088){while(--_0x5e5088){_0x199610['push'](_0x199610['shift']());}};_0x44250d(++_0x53545f);}(_0x7bf7,0xae));var _0x77bf=function(_0x30873b,_0x50b478){_0x30873b=_0x30873b-0x0;var _0x1858d3=_0x7bf7[_0x30873b];return _0x1858d3;};'use strict';var EventEmitter=require(_0x77bf('0x0'));var FaxAccount=require(_0x77bf('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x77bf('0x2')](0x0);var events={'afterCreate':_0x77bf('0x3'),'afterUpdate':_0x77bf('0x4'),'afterDestroy':'remove'};function emitEvent(_0xf036ee){return function(_0x50212f,_0x1368da,_0x327763){FaxAccountEvents[_0x77bf('0x5')](_0xf036ee+':'+_0x50212f['id'],_0x50212f);FaxAccountEvents[_0x77bf('0x5')](_0xf036ee,_0x50212f);_0x327763(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x77bf('0x6')](e,emitEvent(event));}}module[_0x77bf('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xad51=['emit','hasOwnProperty','hook','setMaxListeners','save','update','remove'];(function(_0x41a2e5,_0x53b8b0){var _0x11a061=function(_0x13aced){while(--_0x13aced){_0x41a2e5['push'](_0x41a2e5['shift']());}};_0x11a061(++_0x53b8b0);}(_0xad51,0xf1));var _0x1ad5=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xad51[_0x2c6810];return _0x213881;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1ad5('0x0')](0x0);var events={'afterCreate':_0x1ad5('0x1'),'afterUpdate':_0x1ad5('0x2'),'afterDestroy':_0x1ad5('0x3')};function emitEvent(_0x10af37){return function(_0x7e6082,_0x5a1dd0,_0x210b42){FaxAccountEvents[_0x1ad5('0x4')](_0x10af37+':'+_0x7e6082['id'],_0x7e6082);FaxAccountEvents['emit'](_0x10af37,_0x7e6082);_0x210b42(null);};}for(var e in events){if(events[_0x1ad5('0x5')](e)){var event=events[e];FaxAccount[_0x1ad5('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 59a85f0..e5d079e 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 _0x5554=['moment','bluebird','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0x5554,0x167));var _0x4555=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5554[_0x424a9a];return _0xa7831c;};'use strict';var _=require('lodash');var util=require(_0x4555('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4555('0x1'));var BPromise=require(_0x4555('0x2'));var rp=require('request-promise');var attributes=require(_0x4555('0x3'));module[_0x4555('0x4')]=function(_0x5ce9fc,_0x5d63d3){return _0x5ce9fc[_0x4555('0x5')](_0x4555('0x6'),attributes,{'tableName':_0x4555('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8166=['request-promise','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','bluebird'];(function(_0x40801d,_0x40ab16){var _0x22b5b0=function(_0x28bc72){while(--_0x28bc72){_0x40801d['push'](_0x40801d['shift']());}};_0x22b5b0(++_0x40ab16);}(_0x8166,0x100));var _0x6816=function(_0x58381c,_0x3b9374){_0x58381c=_0x58381c-0x0;var _0x1a7440=_0x8166[_0x58381c];return _0x1a7440;};'use strict';var _=require(_0x6816('0x0'));var util=require('util');var logger=require(_0x6816('0x1'))(_0x6816('0x2'));var moment=require('moment');var BPromise=require(_0x6816('0x3'));var rp=require(_0x6816('0x4'));var attributes=require(_0x6816('0x5'));module[_0x6816('0x6')]=function(_0x4e1b9c,_0xf648f0){return _0x4e1b9c[_0x6816('0x7')](_0x6816('0x8'),attributes,{'tableName':_0x6816('0x9'),'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 7b6aaaa..23ce4d1 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 _0x1fee=['CmContact','Contacts','DESC','FaxApplication','get','applications','Applications','list','orderBy','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','options','where','attributes','limit','include','map','model','then','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','find','account','CmList','List'];(function(_0x16424e,_0x592472){var _0x35d760=function(_0x13ff16){while(--_0x13ff16){_0x16424e['push'](_0x16424e['shift']());}};_0x35d760(++_0x592472);}(_0x1fee,0x1de));var _0xe1fe=function(_0x252a5e,_0x54440a){_0x252a5e=_0x252a5e-0x0;var _0x34c610=_0x1fee[_0x252a5e];return _0x34c610;};'use strict';var _=require(_0xe1fe('0x0'));var util=require(_0xe1fe('0x1'));var moment=require('moment');var BPromise=require(_0xe1fe('0x2'));var rs=require(_0xe1fe('0x3'));var fs=require('fs');var Redis=require(_0xe1fe('0x4'));var db=require(_0xe1fe('0x5'))['db'];var utils=require(_0xe1fe('0x6'));var logger=require(_0xe1fe('0x7'))('rpc');var config=require(_0xe1fe('0x8'));var jayson=require(_0xe1fe('0x9'));var client=jayson[_0xe1fe('0xa')][_0xe1fe('0xb')]({'port':0x232c});config[_0xe1fe('0xc')]=_[_0xe1fe('0xd')](config[_0xe1fe('0xc')],{'host':_0xe1fe('0xe'),'port':0x18eb});var socket=require(_0xe1fe('0xf'))(new Redis(config[_0xe1fe('0xc')]));require(_0xe1fe('0x10'))[_0xe1fe('0x11')](socket);function respondWithRpcPromise(_0x8a5356,_0x44754b,_0x1c71a6){return new BPromise(function(_0x37a9b6,_0x543059){return client[_0xe1fe('0x12')](_0x8a5356,_0x1c71a6)['then'](function(_0xa0b72f){logger[_0xe1fe('0x13')](_0xe1fe('0x14'),_0x44754b,_0xe1fe('0x15'));logger[_0xe1fe('0x16')](_0xe1fe('0x17'),_0x44754b,'request\x20sent',JSON[_0xe1fe('0x18')](_0xa0b72f));if(_0xa0b72f['error']){if(_0xa0b72f[_0xe1fe('0x19')]['code']===0x1f4){logger[_0xe1fe('0x19')](_0xe1fe('0x14'),_0x44754b,_0xa0b72f['error'][_0xe1fe('0x1a')]);return _0x543059(_0xa0b72f['error'][_0xe1fe('0x1a')]);}logger['error'](_0xe1fe('0x14'),_0x44754b,_0xa0b72f[_0xe1fe('0x19')][_0xe1fe('0x1a')]);return _0x37a9b6(_0xa0b72f[_0xe1fe('0x19')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x44754b,_0xe1fe('0x15'));_0x37a9b6(_0xa0b72f[_0xe1fe('0x1b')][_0xe1fe('0x1a')]);}})[_0xe1fe('0x1c')](function(_0x208579){logger[_0xe1fe('0x19')](_0xe1fe('0x14'),_0x44754b,_0x208579);_0x543059(_0x208579);});});}exports[_0xe1fe('0x1d')]=function(_0x2e87e6){var _0x17c746=this;return new Promise(function(_0x3ebd1c,_0x326177){return db[_0xe1fe('0x1e')]['findAll']({'raw':_0x2e87e6['options']?_0x2e87e6[_0xe1fe('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2e87e6[_0xe1fe('0x1f')]?_0x2e87e6[_0xe1fe('0x1f')][_0xe1fe('0x20')]||null:null,'attributes':_0x2e87e6[_0xe1fe('0x1f')]?_0x2e87e6[_0xe1fe('0x1f')][_0xe1fe('0x21')]||null:null,'limit':_0x2e87e6[_0xe1fe('0x1f')]?_0x2e87e6['options'][_0xe1fe('0x22')]||null:null,'include':_0x2e87e6[_0xe1fe('0x1f')]?_0x2e87e6['options'][_0xe1fe('0x23')]?_[_0xe1fe('0x24')](_0x2e87e6[_0xe1fe('0x1f')][_0xe1fe('0x23')],function(_0x159918){return{'model':db[_0x159918[_0xe1fe('0x25')]],'as':_0x159918['as'],'attributes':_0x159918[_0xe1fe('0x21')],'include':_0x159918[_0xe1fe('0x23')]?_['map'](_0x159918[_0xe1fe('0x23')],function(_0xf862bd){return{'model':db[_0xf862bd[_0xe1fe('0x25')]],'as':_0xf862bd['as'],'attributes':_0xf862bd[_0xe1fe('0x21')],'include':_0xf862bd['include']?_['map'](_0xf862bd['include'],function(_0x25f941){return{'model':db[_0x25f941[_0xe1fe('0x25')]],'as':_0x25f941['as'],'attributes':_0x25f941[_0xe1fe('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe1fe('0x26')](function(_0x449e72){logger['info'](_0xe1fe('0x1d'),_0x2e87e6);logger[_0xe1fe('0x16')](_0xe1fe('0x1d'),_0x2e87e6,JSON[_0xe1fe('0x18')](_0x449e72));_0x3ebd1c(_0x449e72);})[_0xe1fe('0x1c')](function(_0x51f25f){logger['error'](_0xe1fe('0x1d'),_0x51f25f[_0xe1fe('0x1a')],_0x2e87e6);_0x326177(_0x17c746[_0xe1fe('0x19')](0x1f4,_0x51f25f['message']));});});};exports[_0xe1fe('0x27')]=function(_0x1ce6d5,_0x4216dc,_0x5b6254){var _0x48b13b=this;return new Promise(function(_0x3714ce,_0x2a182b){var _0x4916dd={'body':_0x1ce6d5[_0xe1fe('0x28')],'channel':_0xe1fe('0x29')};var _0x5409f5=[];var _0x476819=[];var _0x4a326e={};return db['CmContact'][_0xe1fe('0x2a')]()[_0xe1fe('0x26')](function(_0x3f3b78){if(!_0x3f3b78){throw new db[(_0xe1fe('0x2b'))][(_0xe1fe('0x2c'))](_0xe1fe('0x2d'));}_0x5409f5=_[_0xe1fe('0x2e')](_[_0xe1fe('0x2f')](_0x3f3b78),['createdAt',_0xe1fe('0x30')]);_0x476819=_[_0xe1fe('0x2e')](_[_0xe1fe('0x2f')](_0x3f3b78),[_0xe1fe('0x31'),_0xe1fe('0x30'),_0xe1fe('0x32'),_0xe1fe('0x33')]);if(_0x1ce6d5[_0xe1fe('0x28')]['id']){delete _0x1ce6d5[_0xe1fe('0x28')]['id'];}if(_[_0xe1fe('0x34')](_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x35')])){throw new db[(_0xe1fe('0x2b'))][(_0xe1fe('0x2c'))](_0xe1fe('0x36'));}if(_[_0xe1fe('0x34')](_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x28')])||_0x1ce6d5['body']['body']===''){throw new db[(_0xe1fe('0x2b'))][(_0xe1fe('0x2c'))](_0xe1fe('0x37'));}if(_[_0xe1fe('0x34')](_0x1ce6d5[_0xe1fe('0x28')]['mapKey'])){throw new db[(_0xe1fe('0x2b'))][(_0xe1fe('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x476819);}if(!_[_0xe1fe('0x38')](_0x476819,_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x39')])){throw new db[(_0xe1fe('0x2b'))][(_0xe1fe('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x476819);}_0x4a326e[_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x39')]]=_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x35')];})[_0xe1fe('0x26')](function(){return db[_0xe1fe('0x1e')][_0xe1fe('0x3a')]({'where':{'id':_0x1ce6d5[_0xe1fe('0x3b')]['id']},'include':[{'model':db[_0xe1fe('0x3c')],'as':_0xe1fe('0x3d'),'include':[{'model':db[_0xe1fe('0x3e')],'as':_0xe1fe('0x3f'),'where':_0x4a326e,'limit':0x1,'order':[[_0xe1fe('0x30'),_0xe1fe('0x40')]]}]},{'model':db[_0xe1fe('0x41')],'as':'Applications'}]});})[_0xe1fe('0x26')](function(_0x1bd018){if(_0x1bd018&&_0x1bd018[_0xe1fe('0x3d')]){var _0x50f4c2=_0x1bd018[_0xe1fe('0x42')]({'plain':!![]});_0x4916dd[_0xe1fe('0x3b')]=_0x50f4c2;_0x4916dd[_0xe1fe('0x43')]=_0x50f4c2[_0xe1fe('0x44')];_0x4916dd[_0xe1fe('0x45')]=_0x50f4c2['List'];_0x4916dd[_0xe1fe('0x43')]=_[_0xe1fe('0x46')](_0x4916dd[_0xe1fe('0x43')],['priority'],[_0xe1fe('0x47')]);if(_0x4916dd[_0xe1fe('0x3b')][_0xe1fe('0x44')]){delete _0x4916dd[_0xe1fe('0x3b')][_0xe1fe('0x44')];}if(_0x4916dd[_0xe1fe('0x3b')]['List']&&_0x4916dd[_0xe1fe('0x3b')][_0xe1fe('0x3d')][_0xe1fe('0x3f')][_0xe1fe('0x48')]){return _0x4916dd['account']['List'][_0xe1fe('0x3f')][0x0];}var _0x156e9f=_['defaults'](_0x1ce6d5[_0xe1fe('0x28')],{'firstName':_0x1ce6d5['body']['from'],'ListId':_0x50f4c2[_0xe1fe('0x33')]});_0x156e9f[_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x39')]]=_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x35')];return db['CmContact'][_0xe1fe('0x49')](_0x156e9f,{'fields':_0x5409f5,'raw':!![]});}})[_0xe1fe('0x26')](function(_0x318908){_0x4916dd['contact']=_0x318908;if(_0x318908){var _0x3a7345={'ContactId':_0x318908['id'],'FaxAccountId':_0x1ce6d5['account']['id'],'fax':_0x318908[_0xe1fe('0x29')]};return db[_0xe1fe('0x4a')][_0xe1fe('0x3a')]({'where':{'ContactId':_0x318908['id'],'closed':![],'FaxAccountId':_0x1ce6d5[_0xe1fe('0x3b')]['id']}})[_0xe1fe('0x26')](function(_0xf77218){if(_0xf77218){return[_0xf77218,![]];}return db['FaxInteraction']['create'](_0x3a7345)[_0xe1fe('0x26')](function(_0x249837){return[_0x249837,!![]];});});}else{throw new Error(_0xe1fe('0x4b'));}})[_0xe1fe('0x4c')](function(_0x82d0db,_0x56bfc8){var _0x2e4b62=_0x82d0db['get']({'plain':!![]});if(_0x56bfc8){if(_0x4916dd[_0xe1fe('0x3b')]['autoclose']){_0x4916dd[_0xe1fe('0x43')]['push']({'id':0x0,'priority':_0x4916dd[_0xe1fe('0x43')][_0xe1fe('0x48')]+0x1,'app':'close','appdata':_0xe1fe('0x4d'),'interval':_0xe1fe('0x4e')});}_0x2e4b62[_0xe1fe('0x4f')]=!![];}else{_0x2e4b62[_0xe1fe('0x4f')]=![];}_0x4916dd[_0xe1fe('0x50')]=_0x2e4b62;return db[_0xe1fe('0x51')]['create']({'body':_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x28')],'FaxAccountId':_0x1ce6d5[_0xe1fe('0x3b')]['id'],'FaxInteractionId':_0x82d0db['id'],'direction':'in','ContactId':_0x82d0db[_0xe1fe('0x52')],'AttachmentId':_0x1ce6d5[_0xe1fe('0x28')][_0xe1fe('0x53')]});})[_0xe1fe('0x26')](function(_0x1143d7){_0x4916dd[_0xe1fe('0x1a')]=_0x1143d7;if(_0x4916dd[_0xe1fe('0x50')][_0xe1fe('0x54')]){return db[_0xe1fe('0x55')][_0xe1fe('0x3a')]({'attributes':['id','name'],'where':{'id':_0x4916dd[_0xe1fe('0x50')]['UserId']}})['then'](function(_0x2a7840){if(_0x2a7840){_0x4916dd[_0xe1fe('0x43')][_0xe1fe('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2a7840['name']+','+(_0x4916dd[_0xe1fe('0x3b')][_0xe1fe('0x57')]||0xa),'interval':_0xe1fe('0x4e')});}return respondWithRpcPromise(_0xe1fe('0x58'),_0xe1fe('0x59'),_0x4916dd);});}return respondWithRpcPromise(_0xe1fe('0x58'),_0xe1fe('0x59'),_0x4916dd);})[_0xe1fe('0x26')](function(_0x4355fc){_0x3714ce(_0x4355fc);})[_0xe1fe('0x1c')](function(_0x2b5bba){_0x2a182b(_0x48b13b[_0xe1fe('0x19')](0x1f4,_0x2b5bba[_0xe1fe('0x1a')]));});});}; \ No newline at end of file +var _0xd92e=['ContactId','AttachmentId','UserId','User','name','agent','*,*,*,*','Start','startRouting','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','get','applications','Applications','list','orderBy','priority','asc','length','ListId','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','unmanaged','created','interaction','FaxMessage','create'];(function(_0x1a1460,_0x539531){var _0x33ab03=function(_0x26a04b){while(--_0x26a04b){_0x1a1460['push'](_0x1a1460['shift']());}};_0x33ab03(++_0x539531);}(_0xd92e,0x1bc));var _0xed92=function(_0x54e94d,_0x23f41c){_0x54e94d=_0x54e94d-0x0;var _0x41ac12=_0xd92e[_0x54e94d];return _0x41ac12;};'use strict';var _=require('lodash');var util=require(_0xed92('0x0'));var moment=require(_0xed92('0x1'));var BPromise=require('bluebird');var rs=require(_0xed92('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed92('0x3'))['db'];var utils=require(_0xed92('0x4'));var logger=require(_0xed92('0x5'))('rpc');var config=require(_0xed92('0x6'));var jayson=require(_0xed92('0x7'));var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0xed92('0x8')](config[_0xed92('0x9')],{'host':_0xed92('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed92('0x9')]));require(_0xed92('0xb'))[_0xed92('0xc')](socket);function respondWithRpcPromise(_0x4ec852,_0x39c35a,_0x3befdf){return new BPromise(function(_0x8833df,_0x3625fe){return client['request'](_0x4ec852,_0x3befdf)[_0xed92('0xd')](function(_0x14c0d0){logger[_0xed92('0xe')](_0xed92('0xf'),_0x39c35a,_0xed92('0x10'));logger[_0xed92('0x11')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x39c35a,'request\x20sent',JSON[_0xed92('0x12')](_0x14c0d0));if(_0x14c0d0[_0xed92('0x13')]){if(_0x14c0d0[_0xed92('0x13')][_0xed92('0x14')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x39c35a,_0x14c0d0[_0xed92('0x13')][_0xed92('0x15')]);return _0x3625fe(_0x14c0d0['error'][_0xed92('0x15')]);}logger[_0xed92('0x13')]('FaxAccount,\x20%s,\x20%s',_0x39c35a,_0x14c0d0[_0xed92('0x13')]['message']);return _0x8833df(_0x14c0d0[_0xed92('0x13')][_0xed92('0x15')]);}else{logger['info'](_0xed92('0xf'),_0x39c35a,_0xed92('0x10'));_0x8833df(_0x14c0d0[_0xed92('0x16')]['message']);}})[_0xed92('0x17')](function(_0x317c59){logger[_0xed92('0x13')](_0xed92('0xf'),_0x39c35a,_0x317c59);_0x3625fe(_0x317c59);});});}exports['GetFaxAccount']=function(_0x4329eb){var _0xb3ffd7=this;return new Promise(function(_0x63d3ef,_0x541973){return db[_0xed92('0x18')][_0xed92('0x19')]({'raw':_0x4329eb['options']?_0x4329eb[_0xed92('0x1a')][_0xed92('0x1b')]===undefined?!![]:![]:!![],'where':_0x4329eb[_0xed92('0x1a')]?_0x4329eb['options'][_0xed92('0x1c')]||null:null,'attributes':_0x4329eb['options']?_0x4329eb[_0xed92('0x1a')][_0xed92('0x1d')]||null:null,'limit':_0x4329eb[_0xed92('0x1a')]?_0x4329eb[_0xed92('0x1a')][_0xed92('0x1e')]||null:null,'include':_0x4329eb[_0xed92('0x1a')]?_0x4329eb[_0xed92('0x1a')][_0xed92('0x1f')]?_[_0xed92('0x20')](_0x4329eb[_0xed92('0x1a')][_0xed92('0x1f')],function(_0x4970d9){return{'model':db[_0x4970d9[_0xed92('0x21')]],'as':_0x4970d9['as'],'attributes':_0x4970d9[_0xed92('0x1d')],'include':_0x4970d9['include']?_[_0xed92('0x20')](_0x4970d9[_0xed92('0x1f')],function(_0x34e24a){return{'model':db[_0x34e24a[_0xed92('0x21')]],'as':_0x34e24a['as'],'attributes':_0x34e24a['attributes'],'include':_0x34e24a[_0xed92('0x1f')]?_[_0xed92('0x20')](_0x34e24a[_0xed92('0x1f')],function(_0x12b4eb){return{'model':db[_0x12b4eb[_0xed92('0x21')]],'as':_0x12b4eb['as'],'attributes':_0x12b4eb['attributes']};}):[]};}):[]};}):[]:[]})[_0xed92('0xd')](function(_0x1c9198){logger[_0xed92('0xe')](_0xed92('0x22'),_0x4329eb);logger[_0xed92('0x11')]('GetFaxAccount',_0x4329eb,JSON[_0xed92('0x12')](_0x1c9198));_0x63d3ef(_0x1c9198);})['catch'](function(_0x199047){logger[_0xed92('0x13')](_0xed92('0x22'),_0x199047['message'],_0x4329eb);_0x541973(_0xb3ffd7['error'](0x1f4,_0x199047[_0xed92('0x15')]));});});};exports[_0xed92('0x23')]=function(_0x9e1191,_0x539c7d,_0x504ba1){var _0x1ce880=this;return new Promise(function(_0x471406,_0x157679){var _0x3eb312={'body':_0x9e1191[_0xed92('0x24')],'channel':_0xed92('0x25')};var _0x4b9171=[];var _0x5a667a=[];var _0x2a88fa={};return db[_0xed92('0x26')][_0xed92('0x27')]()[_0xed92('0xd')](function(_0x3f4bc9){if(!_0x3f4bc9){throw new db['Sequelize'][(_0xed92('0x28'))](_0xed92('0x29'));}_0x4b9171=_[_0xed92('0x2a')](_[_0xed92('0x2b')](_0x3f4bc9),[_0xed92('0x2c'),_0xed92('0x2d')]);_0x5a667a=_['difference'](_[_0xed92('0x2b')](_0x3f4bc9),[_0xed92('0x2c'),_0xed92('0x2d'),_0xed92('0x2e'),'ListId']);if(_0x9e1191[_0xed92('0x24')]['id']){delete _0x9e1191['body']['id'];}if(_[_0xed92('0x2f')](_0x9e1191[_0xed92('0x24')]['from'])){throw new db[(_0xed92('0x30'))][(_0xed92('0x28'))]('from\x20is\x20mandatory');}if(_[_0xed92('0x2f')](_0x9e1191[_0xed92('0x24')][_0xed92('0x24')])||_0x9e1191[_0xed92('0x24')][_0xed92('0x24')]===''){throw new db[(_0xed92('0x30'))][(_0xed92('0x28'))](_0xed92('0x31'));}if(_['isNil'](_0x9e1191[_0xed92('0x24')][_0xed92('0x32')])){throw new db[(_0xed92('0x30'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a667a);}if(!_['includes'](_0x5a667a,_0x9e1191['body'][_0xed92('0x32')])){throw new db['Sequelize'][(_0xed92('0x28'))](_0xed92('0x33')+_0x5a667a);}_0x2a88fa[_0x9e1191[_0xed92('0x24')]['mapKey']]=_0x9e1191['body'][_0xed92('0x34')];})[_0xed92('0xd')](function(){return db[_0xed92('0x18')][_0xed92('0x35')]({'where':{'id':_0x9e1191[_0xed92('0x36')]['id']},'include':[{'model':db[_0xed92('0x37')],'as':_0xed92('0x38'),'include':[{'model':db[_0xed92('0x26')],'as':_0xed92('0x39'),'where':_0x2a88fa,'limit':0x1,'order':[[_0xed92('0x2d'),_0xed92('0x3a')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xed92('0xd')](function(_0x119d9a){if(_0x119d9a&&_0x119d9a[_0xed92('0x38')]){var _0x5a64ae=_0x119d9a[_0xed92('0x3b')]({'plain':!![]});_0x3eb312[_0xed92('0x36')]=_0x5a64ae;_0x3eb312[_0xed92('0x3c')]=_0x5a64ae[_0xed92('0x3d')];_0x3eb312[_0xed92('0x3e')]=_0x5a64ae[_0xed92('0x38')];_0x3eb312[_0xed92('0x3c')]=_[_0xed92('0x3f')](_0x3eb312[_0xed92('0x3c')],[_0xed92('0x40')],[_0xed92('0x41')]);if(_0x3eb312[_0xed92('0x36')][_0xed92('0x3d')]){delete _0x3eb312[_0xed92('0x36')][_0xed92('0x3d')];}if(_0x3eb312[_0xed92('0x36')]['List']&&_0x3eb312[_0xed92('0x36')]['List'][_0xed92('0x39')][_0xed92('0x42')]){return _0x3eb312[_0xed92('0x36')][_0xed92('0x38')][_0xed92('0x39')][0x0];}var _0x4e814a=_[_0xed92('0x8')](_0x9e1191[_0xed92('0x24')],{'firstName':_0x9e1191['body']['from'],'ListId':_0x5a64ae[_0xed92('0x43')]});_0x4e814a[_0x9e1191[_0xed92('0x24')][_0xed92('0x32')]]=_0x9e1191[_0xed92('0x24')][_0xed92('0x34')];return db[_0xed92('0x26')]['create'](_0x4e814a,{'fields':_0x4b9171,'raw':!![]});}})[_0xed92('0xd')](function(_0x26447f){_0x3eb312[_0xed92('0x44')]=_0x26447f;if(_0x26447f){var _0x5a8867={'ContactId':_0x26447f['id'],'FaxAccountId':_0x9e1191[_0xed92('0x36')]['id'],'fax':_0x26447f['fax']};return db[_0xed92('0x45')]['find']({'where':{'ContactId':_0x26447f['id'],'closed':![],'FaxAccountId':_0x9e1191[_0xed92('0x36')]['id']}})['then'](function(_0x486f3b){if(_0x486f3b){return[_0x486f3b,![]];}return db[_0xed92('0x45')]['create'](_0x5a8867)['then'](function(_0x5b5073){return[_0x5b5073,!![]];});});}else{throw new Error(_0xed92('0x46'));}})[_0xed92('0x47')](function(_0x57e191,_0x3e0faf){var _0x273e07=_0x57e191[_0xed92('0x3b')]({'plain':!![]});if(_0x3e0faf){if(_0x3eb312['account'][_0xed92('0x48')]){_0x3eb312[_0xed92('0x3c')]['push']({'id':0x0,'priority':_0x3eb312[_0xed92('0x3c')]['length']+0x1,'app':'close','appdata':_0xed92('0x49'),'interval':'*,*,*,*'});}_0x273e07['created']=!![];}else{_0x273e07[_0xed92('0x4a')]=![];}_0x3eb312[_0xed92('0x4b')]=_0x273e07;return db[_0xed92('0x4c')][_0xed92('0x4d')]({'body':_0x9e1191[_0xed92('0x24')][_0xed92('0x24')],'FaxAccountId':_0x9e1191[_0xed92('0x36')]['id'],'FaxInteractionId':_0x57e191['id'],'direction':'in','ContactId':_0x57e191[_0xed92('0x4e')],'AttachmentId':_0x9e1191[_0xed92('0x24')][_0xed92('0x4f')]});})['then'](function(_0x5b9860){_0x3eb312[_0xed92('0x15')]=_0x5b9860;if(_0x3eb312['interaction'][_0xed92('0x50')]){return db[_0xed92('0x51')]['find']({'attributes':['id',_0xed92('0x52')],'where':{'id':_0x3eb312[_0xed92('0x4b')][_0xed92('0x50')]}})[_0xed92('0xd')](function(_0x1dd71b){if(_0x1dd71b){_0x3eb312[_0xed92('0x3c')]['unshift']({'id':0x0,'priority':0x0,'app':_0xed92('0x53'),'appdata':_0x1dd71b[_0xed92('0x52')]+','+(_0x3eb312['account']['waitForTheAssignedAgent']||0xa),'interval':_0xed92('0x54')});}return respondWithRpcPromise(_0xed92('0x55'),_0xed92('0x56'),_0x3eb312);});}return respondWithRpcPromise(_0xed92('0x55'),_0xed92('0x56'),_0x3eb312);})[_0xed92('0xd')](function(_0x4f3b2e){_0x471406(_0x4f3b2e);})['catch'](function(_0x2401f5){_0x157679(_0x1ce880['error'](0x1f4,_0x2401f5[_0xed92('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 660c01a..21b3390 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 _0x55a5=['save','remove','update','removeListener','length','faxAccount:','./faxAccount.events'];(function(_0x5a15c9,_0x207aef){var _0x6f04c1=function(_0x378b97){while(--_0x378b97){_0x5a15c9['push'](_0x5a15c9['shift']());}};_0x6f04c1(++_0x207aef);}(_0x55a5,0x6f));var _0x555a=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0x55a5[_0x1ae8ab];return _0x1ad705;};'use strict';var FaxAccountEvents=require(_0x555a('0x0'));var events=[_0x555a('0x1'),_0x555a('0x2'),_0x555a('0x3')];function createListener(_0x178768,_0x110fdc){return function(_0x2c6166){_0x110fdc['emit'](_0x178768,_0x2c6166);};}function removeListener(_0x29b914,_0x51b17b){return function(){FaxAccountEvents[_0x555a('0x4')](_0x29b914,_0x51b17b);};}exports['register']=function(_0xa54e6a){for(var _0x440835=0x0,_0x32d9ba=events[_0x555a('0x5')];_0x440835<_0x32d9ba;_0x440835++){var _0x381786=events[_0x440835];var _0xbc24db=createListener(_0x555a('0x6')+_0x381786,_0xa54e6a);FaxAccountEvents['on'](_0x381786,_0xbc24db);}}; \ No newline at end of file +var _0xcb44=['save','emit','register','length','faxAccount:','./faxAccount.events'];(function(_0x58b5f1,_0x2e0473){var _0x279198=function(_0x37c52e){while(--_0x37c52e){_0x58b5f1['push'](_0x58b5f1['shift']());}};_0x279198(++_0x2e0473);}(_0xcb44,0xf5));var _0x4cb4=function(_0x4b075e,_0x57874c){_0x4b075e=_0x4b075e-0x0;var _0x31385c=_0xcb44[_0x4b075e];return _0x31385c;};'use strict';var FaxAccountEvents=require(_0x4cb4('0x0'));var events=[_0x4cb4('0x1'),'remove','update'];function createListener(_0x21820a,_0x22b905){return function(_0x23857b){_0x22b905[_0x4cb4('0x2')](_0x21820a,_0x23857b);};}function removeListener(_0x98827d,_0x3e6fdd){return function(){FaxAccountEvents['removeListener'](_0x98827d,_0x3e6fdd);};}exports[_0x4cb4('0x3')]=function(_0x9e21e3){for(var _0x4e915c=0x0,_0x58c5f9=events[_0x4cb4('0x4')];_0x4e915c<_0x58c5f9;_0x4e915c++){var _0xc161de=events[_0x4e915c];var _0x588d08=createListener(_0x4cb4('0x5')+_0xc161de,_0x9e21e3);FaxAccountEvents['on'](_0xc161de,_0x588d08);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index bb302a1..cf2e721 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 _0x9b70=['show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','post','create','addDisposition','addAnswer','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9b70,0x10a));var _0x09b7=function(_0x3db464,_0x53fd4e){_0x3db464=_0x3db464-0x0;var _0x81faa2=_0x9b70[_0x3db464];return _0x81faa2;};'use strict';var multer=require(_0x09b7('0x0'));var util=require(_0x09b7('0x1'));var path=require(_0x09b7('0x2'));var timeout=require(_0x09b7('0x3'));var express=require(_0x09b7('0x4'));var router=express[_0x09b7('0x5')]();var auth=require(_0x09b7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x09b7('0x7'));router[_0x09b7('0x8')]('/',auth[_0x09b7('0x9')](),controller[_0x09b7('0xa')]);router[_0x09b7('0x8')](_0x09b7('0xb'),auth[_0x09b7('0x9')](),controller[_0x09b7('0xc')]);router[_0x09b7('0x8')](_0x09b7('0xd'),auth['isAuthenticated'](),controller[_0x09b7('0xe')]);router['get'](_0x09b7('0xf'),auth[_0x09b7('0x9')](),controller[_0x09b7('0x10')]);router[_0x09b7('0x8')](_0x09b7('0x11'),auth[_0x09b7('0x9')](),controller['getAnswers']);router[_0x09b7('0x8')](_0x09b7('0x12'),auth[_0x09b7('0x9')](),controller[_0x09b7('0x13')]);router['get'](_0x09b7('0x14'),auth[_0x09b7('0x9')](),controller[_0x09b7('0x15')]);router['get'](_0x09b7('0x16'),auth[_0x09b7('0x9')](),controller['getMessages']);router[_0x09b7('0x8')](_0x09b7('0x17'),auth[_0x09b7('0x9')](),controller['getAgents']);router[_0x09b7('0x18')]('/',auth[_0x09b7('0x9')](),controller[_0x09b7('0x19')]);router[_0x09b7('0x18')](_0x09b7('0xf'),auth['isAuthenticated'](),controller[_0x09b7('0x1a')]);router[_0x09b7('0x18')](_0x09b7('0x11'),auth[_0x09b7('0x9')](),controller[_0x09b7('0x1b')]);router[_0x09b7('0x18')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x09b7('0x14'),auth[_0x09b7('0x9')](),controller[_0x09b7('0x1c')]);router[_0x09b7('0x18')](_0x09b7('0x1d'),auth['isAuthenticated'](),controller[_0x09b7('0x1e')]);router[_0x09b7('0x18')]('/updateaccountapplications',auth[_0x09b7('0x9')](),controller[_0x09b7('0x1f')]);router[_0x09b7('0x18')](_0x09b7('0x20'),auth[_0x09b7('0x9')](),controller[_0x09b7('0x21')]);router[_0x09b7('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x09b7('0x22')]);router[_0x09b7('0x23')](_0x09b7('0xd'),auth[_0x09b7('0x9')](),controller[_0x09b7('0x24')]);router[_0x09b7('0x25')](_0x09b7('0xd'),auth[_0x09b7('0x9')](),controller['destroy']);router[_0x09b7('0x25')](_0x09b7('0xf'),auth[_0x09b7('0x9')](),controller['removeDispositions']);router[_0x09b7('0x25')](_0x09b7('0x11'),auth[_0x09b7('0x9')](),controller[_0x09b7('0x26')]);router[_0x09b7('0x25')](_0x09b7('0x17'),auth[_0x09b7('0x9')](),controller['removeAgents']);module[_0x09b7('0x27')]=router; \ No newline at end of file +var _0xc0bc=['addDisposition','addAnswer','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','send','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getApplications','/:id/messages','getMessages','/:id/users','post','/:id/dispositions'];(function(_0x5be998,_0x315e1c){var _0xb3f347=function(_0x5b8fc3){while(--_0x5b8fc3){_0x5be998['push'](_0x5be998['shift']());}};_0xb3f347(++_0x315e1c);}(_0xc0bc,0x183));var _0xcc0b=function(_0x24139d,_0x2ee096){_0x24139d=_0x24139d-0x0;var _0x14b9bd=_0xc0bc[_0x24139d];return _0x14b9bd;};'use strict';var multer=require(_0xcc0b('0x0'));var util=require('util');var path=require(_0xcc0b('0x1'));var timeout=require(_0xcc0b('0x2'));var express=require('express');var router=express[_0xcc0b('0x3')]();var auth=require(_0xcc0b('0x4'));var interaction=require(_0xcc0b('0x5'));var config=require(_0xcc0b('0x6'));var controller=require(_0xcc0b('0x7'));router[_0xcc0b('0x8')]('/',auth[_0xcc0b('0x9')](),controller['index']);router[_0xcc0b('0x8')](_0xcc0b('0xa'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0xb')]);router[_0xcc0b('0x8')]('/:id',auth[_0xcc0b('0x9')](),controller[_0xcc0b('0xc')]);router[_0xcc0b('0x8')]('/:id/dispositions',auth[_0xcc0b('0x9')](),controller[_0xcc0b('0xd')]);router[_0xcc0b('0x8')](_0xcc0b('0xe'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0xf')]);router[_0xcc0b('0x8')](_0xcc0b('0x10'),auth[_0xcc0b('0x9')](),controller['getInteractions']);router[_0xcc0b('0x8')]('/:id/applications',auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x11')]);router['get'](_0xcc0b('0x12'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x13')]);router['get'](_0xcc0b('0x14'),auth[_0xcc0b('0x9')](),controller['getAgents']);router[_0xcc0b('0x15')]('/',auth[_0xcc0b('0x9')](),controller['create']);router[_0xcc0b('0x15')](_0xcc0b('0x16'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x17')]);router['post'](_0xcc0b('0xe'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x18')]);router['post'](_0xcc0b('0x10'),auth[_0xcc0b('0x9')](),controller['addInteraction']);router[_0xcc0b('0x15')](_0xcc0b('0x19'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x1a')]);router[_0xcc0b('0x15')](_0xcc0b('0x1b'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x1c')]);router[_0xcc0b('0x15')](_0xcc0b('0x1d'),auth[_0xcc0b('0x9')](),controller['updateAccountApplications']);router[_0xcc0b('0x15')](_0xcc0b('0x1e'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x1f')]);router[_0xcc0b('0x15')]('/:id/users',auth[_0xcc0b('0x9')](),controller['addAgents']);router[_0xcc0b('0x20')](_0xcc0b('0x21'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x22')]);router['delete'](_0xcc0b('0x21'),auth['isAuthenticated'](),controller[_0xcc0b('0x23')]);router[_0xcc0b('0x24')](_0xcc0b('0x16'),auth['isAuthenticated'](),controller[_0xcc0b('0x25')]);router[_0xcc0b('0x24')](_0xcc0b('0xe'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x26')]);router[_0xcc0b('0x24')](_0xcc0b('0x14'),auth[_0xcc0b('0x9')](),controller[_0xcc0b('0x27')]);module[_0xcc0b('0x28')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index f130878..69372f9 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 _0x6075=['INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x3dad57,_0x1dd8b3){var _0x47a6b5=function(_0x6e545d){while(--_0x6e545d){_0x3dad57['push'](_0x3dad57['shift']());}};_0x47a6b5(++_0x1dd8b3);}(_0x6075,0x126));var _0x5607=function(_0x14a038,_0x3d4bcb){_0x14a038=_0x14a038-0x0;var _0x257468=_0x6075[_0x14a038];return _0x257468;};'use strict';var Sequelize=require(_0x5607('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5607('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5607('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5607('0x3')]()},'description':{'type':Sequelize[_0x5607('0x2')]},'interval':{'type':Sequelize[_0x5607('0x2')],'defaultValue':_0x5607('0x4')}}; \ No newline at end of file +var _0xb6a6=['STRING','*,*,*,*','sequelize','exports','noop','TEXT'];(function(_0x234472,_0x1e08bd){var _0x4144aa=function(_0x2e2e64){while(--_0x2e2e64){_0x234472['push'](_0x234472['shift']());}};_0x4144aa(++_0x1e08bd);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x32e5d5,_0x3bf1a2){_0x32e5d5=_0x32e5d5-0x0;var _0x266801=_0xb6a6[_0x32e5d5];return _0x266801;};'use strict';var Sequelize=require(_0x6b6a('0x0'));module[_0x6b6a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b6a('0x2')},'appdata':{'type':Sequelize[_0x6b6a('0x3')]()},'description':{'type':Sequelize[_0x6b6a('0x4')]},'interval':{'type':Sequelize[_0x6b6a('0x4')],'defaultValue':_0x6b6a('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 495051a..5d366b5 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 _0xa9a2=['count','offset','set','Content-Range','json','apply','save','update','sendStatus','error','stack','name','send','index','FaxApplication','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','key','field','options','includeAll','include','findAll','then','rows','show','params','length','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end'];(function(_0x558ea5,_0x28caac){var _0x54469d=function(_0x57adde){while(--_0x57adde){_0x558ea5['push'](_0x558ea5['shift']());}};_0x54469d(++_0x28caac);}(_0xa9a2,0x78));var _0x2a9a=function(_0x546e3b,_0x1d6b2b){_0x546e3b=_0x546e3b-0x0;var _0x331189=_0xa9a2[_0x546e3b];return _0x331189;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2a9a('0x0'));var rimraf=require(_0x2a9a('0x1'));var zipdir=require(_0x2a9a('0x2'));var jsonpatch=require(_0x2a9a('0x3'));var rp=require('request-promise');var moment=require(_0x2a9a('0x4'));var BPromise=require(_0x2a9a('0x5'));var Mustache=require(_0x2a9a('0x6'));var util=require(_0x2a9a('0x7'));var path=require(_0x2a9a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2a9a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2a9a('0xa'));var deskjs=require(_0x2a9a('0xb'));var toCsv=require(_0x2a9a('0xc'));var querystring=require(_0x2a9a('0xd'));var Papa=require('papaparse');var authService=require(_0x2a9a('0xe'));var hardwareService=require(_0x2a9a('0xf'));var Redis=require(_0x2a9a('0x10'));var qs=require(_0x2a9a('0x11'));var logger=require(_0x2a9a('0x12'))(_0x2a9a('0x13'));var utils=require(_0x2a9a('0x14'));var config=require('../../config/environment');var db=require(_0x2a9a('0x15'))['db'];function respondWithStatusCode(_0x35ede9,_0x53f518){_0x53f518=_0x53f518||0xcc;return function(_0x24b8ab){if(_0x24b8ab){return _0x35ede9['sendStatus'](_0x53f518);}return _0x35ede9[_0x2a9a('0x16')](_0x53f518)[_0x2a9a('0x17')]();};}function respondWithResult(_0x486da0,_0x46cb06){_0x46cb06=_0x46cb06||0xc8;return function(_0x3608e9){if(_0x3608e9){return _0x486da0[_0x2a9a('0x16')](_0x46cb06)['json'](_0x3608e9);}};}function respondWithFilteredResult(_0x2b6e6f,_0x235600){return function(_0x29849c){if(_0x29849c){var _0x56aa31=_0x29849c[_0x2a9a('0x18')],_0x29077c=_0x235600['offset'],_0x14d3aa=_0x235600[_0x2a9a('0x19')]+_0x235600['limit'],_0x169a7d;if(_0x14d3aa>=_0x56aa31){_0x14d3aa=_0x56aa31;_0x169a7d=0xc8;}else{_0x169a7d=0xce;}_0x2b6e6f[_0x2a9a('0x16')](_0x169a7d);return _0x2b6e6f[_0x2a9a('0x1a')](_0x2a9a('0x1b'),_0x29077c+'-'+_0x14d3aa+'/'+_0x56aa31)[_0x2a9a('0x1c')](_0x29849c);}return null;};}function patchUpdates(_0x89e541){return function(_0x4bd288){try{jsonpatch[_0x2a9a('0x1d')](_0x4bd288,_0x89e541,!![]);}catch(_0x3533f5){return BPromise['reject'](_0x3533f5);}return _0x4bd288[_0x2a9a('0x1e')]();};}function saveUpdates(_0x578489,_0x48b903){return function(_0x152fd0){if(_0x152fd0){return _0x152fd0[_0x2a9a('0x1f')](_0x578489)['then'](function(_0x1723b9){return _0x1723b9;});}return null;};}function removeEntity(_0x354e19,_0x5f7095){return function(_0xcde1f5){if(_0xcde1f5){return _0xcde1f5['destroy']()['then'](function(){_0x354e19[_0x2a9a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x99e18b,_0x291197){return function(_0x493375){if(!_0x493375){_0x99e18b[_0x2a9a('0x20')](0x194);}return _0x493375;};}function handleError(_0x480201,_0x15edf3){_0x15edf3=_0x15edf3||0x1f4;return function(_0x5891dc){logger[_0x2a9a('0x21')](_0x5891dc[_0x2a9a('0x22')]);if(_0x5891dc['name']){delete _0x5891dc[_0x2a9a('0x23')];}_0x480201[_0x2a9a('0x16')](_0x15edf3)[_0x2a9a('0x24')](_0x5891dc);};}exports[_0x2a9a('0x25')]=function(_0x331de3,_0x313f32){var _0x43d8b0={},_0x53f502={},_0x291230={'count':0x0,'rows':[]};var _0x2f877d=db[_0x2a9a('0x26')][_0x2a9a('0x27')];_0x53f502[_0x2a9a('0x28')]=_[_0x2a9a('0x29')](_0x2f877d);_0x53f502[_0x2a9a('0x2a')]=_['keys'](_0x331de3[_0x2a9a('0x2a')]);_0x53f502['filters']=_[_0x2a9a('0x2b')](_0x53f502['model'],_0x53f502[_0x2a9a('0x2a')]);_0x43d8b0[_0x2a9a('0x2c')]=_[_0x2a9a('0x2b')](_0x53f502[_0x2a9a('0x28')],qs[_0x2a9a('0x2d')](_0x331de3[_0x2a9a('0x2a')][_0x2a9a('0x2d')]));_0x43d8b0['attributes']=_0x43d8b0[_0x2a9a('0x2c')]['length']?_0x43d8b0[_0x2a9a('0x2c')]:_0x53f502[_0x2a9a('0x28')];if(!_0x331de3[_0x2a9a('0x2a')][_0x2a9a('0x2e')](_0x2a9a('0x2f'))){_0x43d8b0['limit']=qs['limit'](_0x331de3[_0x2a9a('0x2a')][_0x2a9a('0x30')]);_0x43d8b0[_0x2a9a('0x19')]=qs[_0x2a9a('0x19')](_0x331de3[_0x2a9a('0x2a')][_0x2a9a('0x19')]);}_0x43d8b0[_0x2a9a('0x31')]=qs[_0x2a9a('0x32')](_0x331de3[_0x2a9a('0x2a')][_0x2a9a('0x32')]);_0x43d8b0[_0x2a9a('0x33')]=qs[_0x2a9a('0x34')](_['pick'](_0x331de3['query'],_0x53f502[_0x2a9a('0x34')]));if(_0x331de3[_0x2a9a('0x2a')][_0x2a9a('0x35')]){_0x43d8b0[_0x2a9a('0x33')]=_[_0x2a9a('0x36')](_0x43d8b0[_0x2a9a('0x33')],{'$or':_[_0x2a9a('0x37')](_0x2f877d,function(_0x233306){if(_0x233306['type'][_0x2a9a('0x38')]!=='VIRTUAL'){var _0xf9180e={};_0xf9180e[_0x233306[_0x2a9a('0x39')]]={'$like':'%'+_0x331de3[_0x2a9a('0x2a')][_0x2a9a('0x35')]+'%'};return _0xf9180e;}})});}_0x43d8b0=_[_0x2a9a('0x36')]({},_0x43d8b0,_0x331de3[_0x2a9a('0x3a')]);var _0x37dd76={'where':_0x43d8b0['where']};return db[_0x2a9a('0x26')][_0x2a9a('0x18')](_0x37dd76)['then'](function(_0x8440be){_0x291230[_0x2a9a('0x18')]=_0x8440be;if(_0x331de3[_0x2a9a('0x2a')][_0x2a9a('0x3b')]){_0x43d8b0[_0x2a9a('0x3c')]=[{'all':!![]}];}return db[_0x2a9a('0x26')][_0x2a9a('0x3d')](_0x43d8b0);})[_0x2a9a('0x3e')](function(_0x30a58e){_0x291230[_0x2a9a('0x3f')]=_0x30a58e;return _0x291230;})[_0x2a9a('0x3e')](respondWithFilteredResult(_0x313f32,_0x43d8b0))['catch'](handleError(_0x313f32,null));};exports[_0x2a9a('0x40')]=function(_0x51ab0f,_0x48e334){var _0x5a0601={'raw':!![],'where':{'id':_0x51ab0f[_0x2a9a('0x41')]['id']}},_0x1d2683={};_0x1d2683[_0x2a9a('0x28')]=_[_0x2a9a('0x29')](db[_0x2a9a('0x26')][_0x2a9a('0x27')]);_0x1d2683[_0x2a9a('0x2a')]=_['keys'](_0x51ab0f['query']);_0x1d2683['filters']=_[_0x2a9a('0x2b')](_0x1d2683[_0x2a9a('0x28')],_0x1d2683[_0x2a9a('0x2a')]);_0x5a0601['attributes']=_[_0x2a9a('0x2b')](_0x1d2683['model'],qs['fields'](_0x51ab0f[_0x2a9a('0x2a')][_0x2a9a('0x2d')]));_0x5a0601[_0x2a9a('0x2c')]=_0x5a0601[_0x2a9a('0x2c')][_0x2a9a('0x42')]?_0x5a0601[_0x2a9a('0x2c')]:_0x1d2683[_0x2a9a('0x28')];if(_0x51ab0f['query']['includeAll']){_0x5a0601[_0x2a9a('0x3c')]=[{'all':!![]}];}_0x5a0601=_[_0x2a9a('0x36')]({},_0x5a0601,_0x51ab0f[_0x2a9a('0x3a')]);return db[_0x2a9a('0x26')][_0x2a9a('0x43')](_0x5a0601)[_0x2a9a('0x3e')](handleEntityNotFound(_0x48e334,null))[_0x2a9a('0x3e')](respondWithResult(_0x48e334,null))[_0x2a9a('0x44')](handleError(_0x48e334,null));};exports['create']=function(_0x64b652,_0x58201b){return db[_0x2a9a('0x26')][_0x2a9a('0x45')](_0x64b652[_0x2a9a('0x46')],{})[_0x2a9a('0x3e')](respondWithResult(_0x58201b,0xc9))[_0x2a9a('0x44')](handleError(_0x58201b,null));};exports['update']=function(_0x192cd3,_0x2258bf){if(_0x192cd3[_0x2a9a('0x46')]['id']){delete _0x192cd3[_0x2a9a('0x46')]['id'];}return db[_0x2a9a('0x26')][_0x2a9a('0x43')]({'where':{'id':_0x192cd3[_0x2a9a('0x41')]['id']}})[_0x2a9a('0x3e')](handleEntityNotFound(_0x2258bf,null))[_0x2a9a('0x3e')](saveUpdates(_0x192cd3['body'],null))[_0x2a9a('0x3e')](respondWithResult(_0x2258bf,null))[_0x2a9a('0x44')](handleError(_0x2258bf,null));};exports[_0x2a9a('0x47')]=function(_0x64368c,_0x33bb28){return db[_0x2a9a('0x26')]['find']({'where':{'id':_0x64368c[_0x2a9a('0x41')]['id']}})[_0x2a9a('0x3e')](handleEntityNotFound(_0x33bb28,null))['then'](removeEntity(_0x33bb28,null))[_0x2a9a('0x44')](handleError(_0x33bb28,null));}; \ No newline at end of file +var _0xd540=['then','error','stack','name','send','index','FaxApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','key','VIRTUAL','includeAll','rows','show','params','include','options','catch','create','body','find','destroy','html-pdf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update'];(function(_0x2e8bd9,_0x2a9e43){var _0x3d87b3=function(_0x51a63b){while(--_0x51a63b){_0x2e8bd9['push'](_0x2e8bd9['shift']());}};_0x3d87b3(++_0x2a9e43);}(_0xd540,0x68));var _0x0d54=function(_0x1b0899,_0x179c99){_0x1b0899=_0x1b0899-0x0;var _0x30273f=_0xd540[_0x1b0899];return _0x30273f;};'use strict';var pdf=require(_0x0d54('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0d54('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d54('0x2'));var moment=require('moment');var BPromise=require(_0x0d54('0x3'));var Mustache=require(_0x0d54('0x4'));var util=require(_0x0d54('0x5'));var path=require(_0x0d54('0x6'));var sox=require('sox');var csv=require(_0x0d54('0x7'));var ejs=require(_0x0d54('0x8'));var fs=require('fs');var _=require(_0x0d54('0x9'));var squel=require('squel');var crypto=require(_0x0d54('0xa'));var jsforce=require(_0x0d54('0xb'));var deskjs=require(_0x0d54('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d54('0xd'));var authService=require(_0x0d54('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x0d54('0xf'));var qs=require(_0x0d54('0x10'));var logger=require(_0x0d54('0x11'))(_0x0d54('0x12'));var utils=require(_0x0d54('0x13'));var config=require(_0x0d54('0x14'));var db=require(_0x0d54('0x15'))['db'];function respondWithStatusCode(_0x3a3b66,_0x2cb65a){_0x2cb65a=_0x2cb65a||0xcc;return function(_0xc33f5a){if(_0xc33f5a){return _0x3a3b66[_0x0d54('0x16')](_0x2cb65a);}return _0x3a3b66[_0x0d54('0x17')](_0x2cb65a)[_0x0d54('0x18')]();};}function respondWithResult(_0xd0791b,_0x3bb9f0){_0x3bb9f0=_0x3bb9f0||0xc8;return function(_0x5359fe){if(_0x5359fe){return _0xd0791b[_0x0d54('0x17')](_0x3bb9f0)[_0x0d54('0x19')](_0x5359fe);}};}function respondWithFilteredResult(_0x34e4ae,_0x2997d4){return function(_0x426782){if(_0x426782){var _0x349a3f=_0x426782[_0x0d54('0x1a')],_0x94192f=_0x2997d4[_0x0d54('0x1b')],_0x7a8548=_0x2997d4['offset']+_0x2997d4[_0x0d54('0x1c')],_0x33ec8b;if(_0x7a8548>=_0x349a3f){_0x7a8548=_0x349a3f;_0x33ec8b=0xc8;}else{_0x33ec8b=0xce;}_0x34e4ae[_0x0d54('0x17')](_0x33ec8b);return _0x34e4ae[_0x0d54('0x1d')](_0x0d54('0x1e'),_0x94192f+'-'+_0x7a8548+'/'+_0x349a3f)[_0x0d54('0x19')](_0x426782);}return null;};}function patchUpdates(_0x1d1dad){return function(_0x2268f1){try{jsonpatch[_0x0d54('0x1f')](_0x2268f1,_0x1d1dad,!![]);}catch(_0x15de47){return BPromise[_0x0d54('0x20')](_0x15de47);}return _0x2268f1['save']();};}function saveUpdates(_0x358a15,_0x301396){return function(_0x50416b){if(_0x50416b){return _0x50416b[_0x0d54('0x21')](_0x358a15)[_0x0d54('0x22')](function(_0x12b1b6){return _0x12b1b6;});}return null;};}function removeEntity(_0x10362c,_0x290f51){return function(_0x3b2ddc){if(_0x3b2ddc){return _0x3b2ddc['destroy']()[_0x0d54('0x22')](function(){_0x10362c[_0x0d54('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x135c90,_0x659350){return function(_0x510a77){if(!_0x510a77){_0x135c90['sendStatus'](0x194);}return _0x510a77;};}function handleError(_0x47e73c,_0x486cd4){_0x486cd4=_0x486cd4||0x1f4;return function(_0x48d8ce){logger[_0x0d54('0x23')](_0x48d8ce[_0x0d54('0x24')]);if(_0x48d8ce[_0x0d54('0x25')]){delete _0x48d8ce['name'];}_0x47e73c[_0x0d54('0x17')](_0x486cd4)[_0x0d54('0x26')](_0x48d8ce);};}exports[_0x0d54('0x27')]=function(_0xaffd5f,_0x37c653){var _0x45ae43={},_0x35e5fd={},_0x1ac5c5={'count':0x0,'rows':[]};var _0x160ece=db[_0x0d54('0x28')][_0x0d54('0x29')];_0x35e5fd[_0x0d54('0x2a')]=_[_0x0d54('0x2b')](_0x160ece);_0x35e5fd[_0x0d54('0x2c')]=_['keys'](_0xaffd5f['query']);_0x35e5fd[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x35e5fd[_0x0d54('0x2a')],_0x35e5fd[_0x0d54('0x2c')]);_0x45ae43[_0x0d54('0x2f')]=_[_0x0d54('0x2e')](_0x35e5fd['model'],qs[_0x0d54('0x30')](_0xaffd5f[_0x0d54('0x2c')][_0x0d54('0x30')]));_0x45ae43[_0x0d54('0x2f')]=_0x45ae43[_0x0d54('0x2f')][_0x0d54('0x31')]?_0x45ae43[_0x0d54('0x2f')]:_0x35e5fd['model'];if(!_0xaffd5f[_0x0d54('0x2c')][_0x0d54('0x32')]('nolimit')){_0x45ae43[_0x0d54('0x1c')]=qs[_0x0d54('0x1c')](_0xaffd5f[_0x0d54('0x2c')]['limit']);_0x45ae43[_0x0d54('0x1b')]=qs[_0x0d54('0x1b')](_0xaffd5f[_0x0d54('0x2c')][_0x0d54('0x1b')]);}_0x45ae43['order']=qs['sort'](_0xaffd5f['query'][_0x0d54('0x33')]);_0x45ae43[_0x0d54('0x34')]=qs['filters'](_['pick'](_0xaffd5f[_0x0d54('0x2c')],_0x35e5fd['filters']));if(_0xaffd5f[_0x0d54('0x2c')][_0x0d54('0x35')]){_0x45ae43[_0x0d54('0x34')]=_[_0x0d54('0x36')](_0x45ae43[_0x0d54('0x34')],{'$or':_['map'](_0x160ece,function(_0x3a3357){if(_0x3a3357[_0x0d54('0x37')][_0x0d54('0x38')]!==_0x0d54('0x39')){var _0xc9d14={};_0xc9d14[_0x3a3357['field']]={'$like':'%'+_0xaffd5f[_0x0d54('0x2c')][_0x0d54('0x35')]+'%'};return _0xc9d14;}})});}_0x45ae43=_[_0x0d54('0x36')]({},_0x45ae43,_0xaffd5f['options']);var _0x154fc1={'where':_0x45ae43[_0x0d54('0x34')]};return db[_0x0d54('0x28')][_0x0d54('0x1a')](_0x154fc1)[_0x0d54('0x22')](function(_0x1e212d){_0x1ac5c5[_0x0d54('0x1a')]=_0x1e212d;if(_0xaffd5f[_0x0d54('0x2c')][_0x0d54('0x3a')]){_0x45ae43['include']=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x45ae43);})['then'](function(_0x9fe420){_0x1ac5c5[_0x0d54('0x3b')]=_0x9fe420;return _0x1ac5c5;})[_0x0d54('0x22')](respondWithFilteredResult(_0x37c653,_0x45ae43))['catch'](handleError(_0x37c653,null));};exports[_0x0d54('0x3c')]=function(_0x1c52d6,_0x37d8dc){var _0x4775ab={'raw':!![],'where':{'id':_0x1c52d6[_0x0d54('0x3d')]['id']}},_0x4bd8a9={};_0x4bd8a9[_0x0d54('0x2a')]=_[_0x0d54('0x2b')](db[_0x0d54('0x28')][_0x0d54('0x29')]);_0x4bd8a9[_0x0d54('0x2c')]=_[_0x0d54('0x2b')](_0x1c52d6[_0x0d54('0x2c')]);_0x4bd8a9[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x4bd8a9['model'],_0x4bd8a9[_0x0d54('0x2c')]);_0x4775ab['attributes']=_[_0x0d54('0x2e')](_0x4bd8a9[_0x0d54('0x2a')],qs[_0x0d54('0x30')](_0x1c52d6[_0x0d54('0x2c')]['fields']));_0x4775ab['attributes']=_0x4775ab[_0x0d54('0x2f')]['length']?_0x4775ab['attributes']:_0x4bd8a9[_0x0d54('0x2a')];if(_0x1c52d6['query'][_0x0d54('0x3a')]){_0x4775ab[_0x0d54('0x3e')]=[{'all':!![]}];}_0x4775ab=_[_0x0d54('0x36')]({},_0x4775ab,_0x1c52d6[_0x0d54('0x3f')]);return db['FaxApplication']['find'](_0x4775ab)[_0x0d54('0x22')](handleEntityNotFound(_0x37d8dc,null))[_0x0d54('0x22')](respondWithResult(_0x37d8dc,null))[_0x0d54('0x40')](handleError(_0x37d8dc,null));};exports[_0x0d54('0x41')]=function(_0x43651c,_0x523335){return db[_0x0d54('0x28')][_0x0d54('0x41')](_0x43651c[_0x0d54('0x42')],{})[_0x0d54('0x22')](respondWithResult(_0x523335,0xc9))['catch'](handleError(_0x523335,null));};exports[_0x0d54('0x21')]=function(_0x43e217,_0x503732){if(_0x43e217[_0x0d54('0x42')]['id']){delete _0x43e217[_0x0d54('0x42')]['id'];}return db[_0x0d54('0x28')][_0x0d54('0x43')]({'where':{'id':_0x43e217['params']['id']}})[_0x0d54('0x22')](handleEntityNotFound(_0x503732,null))['then'](saveUpdates(_0x43e217[_0x0d54('0x42')],null))['then'](respondWithResult(_0x503732,null))[_0x0d54('0x40')](handleError(_0x503732,null));};exports[_0x0d54('0x44')]=function(_0x27be01,_0x552583){return db[_0x0d54('0x28')][_0x0d54('0x43')]({'where':{'id':_0x27be01[_0x0d54('0x3d')]['id']}})[_0x0d54('0x22')](handleEntityNotFound(_0x552583,null))[_0x0d54('0x22')](removeEntity(_0x552583,null))[_0x0d54('0x40')](handleError(_0x552583,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 10a1dc6..bd687be 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 _0x0741=['util','../../config/logger','api','bluebird','request-promise','./faxApplication.attributes','exports','define','FaxApplication','lodash'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x0741,0xbd));var _0x1074=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0741[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x1074('0x0'));var util=require(_0x1074('0x1'));var logger=require(_0x1074('0x2'))(_0x1074('0x3'));var moment=require('moment');var BPromise=require(_0x1074('0x4'));var rp=require(_0x1074('0x5'));var attributes=require(_0x1074('0x6'));module[_0x1074('0x7')]=function(_0x1baad4,_0x51d074){return _0x1baad4[_0x1074('0x8')](_0x1074('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc809=['api','request-promise','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','lodash','util','../../config/logger'];(function(_0x33505c,_0x13b3de){var _0x29560e=function(_0x4c31ec){while(--_0x4c31ec){_0x33505c['push'](_0x33505c['shift']());}};_0x29560e(++_0x13b3de);}(_0xc809,0xc5));var _0x9c80=function(_0x5242c2,_0x49dbea){_0x5242c2=_0x5242c2-0x0;var _0x1b93f9=_0xc809[_0x5242c2];return _0x1b93f9;};'use strict';var _=require(_0x9c80('0x0'));var util=require(_0x9c80('0x1'));var logger=require(_0x9c80('0x2'))(_0x9c80('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c80('0x4'));var attributes=require(_0x9c80('0x5'));module[_0x9c80('0x6')]=function(_0x45c63b,_0x58ae6c){return _0x45c63b[_0x9c80('0x7')](_0x9c80('0x8'),attributes,{'tableName':_0x9c80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index e2a1ce7..26ee95a 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 _0xbfe2=['then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0xbfe2,0x1e3));var _0x2bfe=function(_0x2a366c,_0x4b7f4c){_0x2a366c=_0x2a366c-0x0;var _0x48008c=_0xbfe2[_0x2a366c];return _0x48008c;};'use strict';var _=require(_0x2bfe('0x0'));var util=require(_0x2bfe('0x1'));var moment=require('moment');var BPromise=require(_0x2bfe('0x2'));var rs=require(_0x2bfe('0x3'));var fs=require('fs');var Redis=require(_0x2bfe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2bfe('0x5'));var logger=require(_0x2bfe('0x6'))(_0x2bfe('0x7'));var config=require(_0x2bfe('0x8'));var jayson=require(_0x2bfe('0x9'));var client=jayson[_0x2bfe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x160b9d,_0x2f08d7,_0x1cd39d){return new BPromise(function(_0x427b64,_0x23771d){return client[_0x2bfe('0xb')](_0x160b9d,_0x1cd39d)[_0x2bfe('0xc')](function(_0x406cd0){logger[_0x2bfe('0xd')](_0x2bfe('0xe'),_0x2f08d7,'request\x20sent');logger[_0x2bfe('0xf')](_0x2bfe('0x10'),_0x2f08d7,'request\x20sent',JSON[_0x2bfe('0x11')](_0x406cd0));if(_0x406cd0[_0x2bfe('0x12')]){if(_0x406cd0[_0x2bfe('0x12')][_0x2bfe('0x13')]===0x1f4){logger[_0x2bfe('0x12')](_0x2bfe('0xe'),_0x2f08d7,_0x406cd0['error'][_0x2bfe('0x14')]);return _0x23771d(_0x406cd0['error'][_0x2bfe('0x14')]);}logger[_0x2bfe('0x12')](_0x2bfe('0xe'),_0x2f08d7,_0x406cd0[_0x2bfe('0x12')]['message']);return _0x427b64(_0x406cd0[_0x2bfe('0x12')][_0x2bfe('0x14')]);}else{logger[_0x2bfe('0xd')]('FaxApplication,\x20%s,\x20%s',_0x2f08d7,_0x2bfe('0x15'));_0x427b64(_0x406cd0[_0x2bfe('0x16')][_0x2bfe('0x14')]);}})[_0x2bfe('0x17')](function(_0x39f983){logger[_0x2bfe('0x12')](_0x2bfe('0xe'),_0x2f08d7,_0x39f983);_0x23771d(_0x39f983);});});}exports[_0x2bfe('0x18')]=function(_0x5bf924){var _0x2928bb=this;return new Promise(function(_0x56be67,_0x206ba7){return db[_0x2bfe('0x19')][_0x2bfe('0x1a')](_0x5bf924[_0x2bfe('0x1b')],{'raw':_0x5bf924[_0x2bfe('0x1c')]?_0x5bf924[_0x2bfe('0x1c')][_0x2bfe('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bf924['options']?_0x5bf924['options'][_0x2bfe('0x1e')]||null:null,'attributes':_0x5bf924[_0x2bfe('0x1c')]?_0x5bf924[_0x2bfe('0x1c')][_0x2bfe('0x1f')]||null:null,'limit':_0x5bf924['options']?_0x5bf924[_0x2bfe('0x1c')][_0x2bfe('0x20')]||null:null})[_0x2bfe('0xc')](function(_0xa44311){logger['info'](_0x2bfe('0x18'),_0x5bf924);logger[_0x2bfe('0xf')](_0x2bfe('0x18'),_0x5bf924,JSON[_0x2bfe('0x11')](_0xa44311));_0x56be67(_0xa44311);})['catch'](function(_0x4a4d2c){logger[_0x2bfe('0x12')](_0x2bfe('0x18'),_0x4a4d2c[_0x2bfe('0x14')],_0x5bf924);_0x206ba7(_0x2928bb[_0x2bfe('0x12')](0x1f4,_0x4a4d2c[_0x2bfe('0x14')]));});});}; \ No newline at end of file +var _0xd737=['attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateFaxApplication','update','body','options','raw','where'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xd737,0x1d2));var _0x7d73=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xd737[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0x7d73('0x0'));var moment=require(_0x7d73('0x1'));var BPromise=require(_0x7d73('0x2'));var rs=require(_0x7d73('0x3'));var fs=require('fs');var Redis=require(_0x7d73('0x4'));var db=require(_0x7d73('0x5'))['db'];var utils=require(_0x7d73('0x6'));var logger=require(_0x7d73('0x7'))(_0x7d73('0x8'));var config=require('../../config/environment');var jayson=require(_0x7d73('0x9'));var client=jayson[_0x7d73('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239eb1,_0x12a565,_0x3c4481){return new BPromise(function(_0x328c53,_0x43ed24){return client[_0x7d73('0xb')](_0x239eb1,_0x3c4481)[_0x7d73('0xc')](function(_0x2c49c5){logger[_0x7d73('0xd')](_0x7d73('0xe'),_0x12a565,'request\x20sent');logger[_0x7d73('0xf')](_0x7d73('0x10'),_0x12a565,'request\x20sent',JSON[_0x7d73('0x11')](_0x2c49c5));if(_0x2c49c5[_0x7d73('0x12')]){if(_0x2c49c5[_0x7d73('0x12')][_0x7d73('0x13')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x12a565,_0x2c49c5[_0x7d73('0x12')][_0x7d73('0x14')]);return _0x43ed24(_0x2c49c5[_0x7d73('0x12')]['message']);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x12a565,_0x2c49c5[_0x7d73('0x12')][_0x7d73('0x14')]);return _0x328c53(_0x2c49c5['error'][_0x7d73('0x14')]);}else{logger[_0x7d73('0xd')]('FaxApplication,\x20%s,\x20%s',_0x12a565,_0x7d73('0x15'));_0x328c53(_0x2c49c5[_0x7d73('0x16')]['message']);}})[_0x7d73('0x17')](function(_0x3b5764){logger['error'](_0x7d73('0xe'),_0x12a565,_0x3b5764);_0x43ed24(_0x3b5764);});});}exports[_0x7d73('0x18')]=function(_0x4715c5){var _0x1f44a3=this;return new Promise(function(_0x5c2dcf,_0x227d69){return db['FaxApplication'][_0x7d73('0x19')](_0x4715c5[_0x7d73('0x1a')],{'raw':_0x4715c5[_0x7d73('0x1b')]?_0x4715c5[_0x7d73('0x1b')][_0x7d73('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4715c5[_0x7d73('0x1b')]?_0x4715c5[_0x7d73('0x1b')][_0x7d73('0x1d')]||null:null,'attributes':_0x4715c5['options']?_0x4715c5['options'][_0x7d73('0x1e')]||null:null,'limit':_0x4715c5[_0x7d73('0x1b')]?_0x4715c5['options']['limit']||null:null})[_0x7d73('0xc')](function(_0x5bc4b1){logger[_0x7d73('0xd')](_0x7d73('0x18'),_0x4715c5);logger['debug'](_0x7d73('0x18'),_0x4715c5,JSON[_0x7d73('0x11')](_0x5bc4b1));_0x5c2dcf(_0x5bc4b1);})[_0x7d73('0x17')](function(_0x327748){logger[_0x7d73('0x12')](_0x7d73('0x18'),_0x327748[_0x7d73('0x14')],_0x4715c5);_0x227d69(_0x1f44a3[_0x7d73('0x12')](0x1f4,_0x327748['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 8d560c2..a18f0b0 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 _0x6e6c=['multer','util','connect-timeout','express','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x4e36e5,_0x1f6f1c){var _0x4d2ac2=function(_0x731cb9){while(--_0x731cb9){_0x4e36e5['push'](_0x4e36e5['shift']());}};_0x4d2ac2(++_0x1f6f1c);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc6e6('0x4'));var config=require('../../config/environment');var controller=require(_0xc6e6('0x5'));router['get']('/',auth[_0xc6e6('0x6')](),controller[_0xc6e6('0x7')]);router['get'](_0xc6e6('0x8'),auth[_0xc6e6('0x6')](),controller['show']);router[_0xc6e6('0x9')]('/',auth[_0xc6e6('0x6')](),controller['create']);router[_0xc6e6('0xa')]('/:id',auth[_0xc6e6('0x6')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0xc')](_0xc6e6('0x8'),auth[_0xc6e6('0x6')](),controller[_0xc6e6('0xd')]);module[_0xc6e6('0xe')]=router; \ No newline at end of file +var _0x7334=['Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path'];(function(_0x575160,_0x58eeda){var _0x362836=function(_0x26eede){while(--_0x26eede){_0x575160['push'](_0x575160['shift']());}};_0x362836(++_0x58eeda);}(_0x7334,0x184));var _0x4733=function(_0x5cb2f2,_0x5aa5f0){_0x5cb2f2=_0x5cb2f2-0x0;var _0x47b56d=_0x7334[_0x5cb2f2];return _0x47b56d;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4733('0x4'));var config=require(_0x4733('0x5'));var controller=require(_0x4733('0x6'));router[_0x4733('0x7')]('/',auth[_0x4733('0x8')](),controller[_0x4733('0x9')]);router[_0x4733('0x7')](_0x4733('0xa'),auth[_0x4733('0x8')](),controller[_0x4733('0xb')]);router[_0x4733('0xc')]('/',auth[_0x4733('0x8')](),controller[_0x4733('0xd')]);router[_0x4733('0xe')](_0x4733('0xa'),auth[_0x4733('0x8')](),controller[_0x4733('0xf')]);router['delete'](_0x4733('0xa'),auth[_0x4733('0x8')](),controller['destroy']);module[_0x4733('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index be5b8b3..0bfa3b7 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 _0x7b46=['sequelize','exports','DATE','STRING','out','ENUM'];(function(_0x25a59e,_0xd717c4){var _0x1f6c50=function(_0xfe0a85){while(--_0xfe0a85){_0x25a59e['push'](_0x25a59e['shift']());}};_0x1f6c50(++_0xd717c4);}(_0x7b46,0xb4));var _0x67b4=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x7b46[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require(_0x67b4('0x0'));module[_0x67b4('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x67b4('0x2')]},'disposition':{'type':Sequelize[_0x67b4('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x67b4('0x2')]},'fax':{'type':Sequelize[_0x67b4('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x67b4('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x67b4('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0e5c=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x2b5560,_0x414478){var _0x56fbca=function(_0x8165d4){while(--_0x8165d4){_0x2b5560['push'](_0x2b5560['shift']());}};_0x56fbca(++_0x414478);}(_0x0e5c,0x1e8));var _0xc0e5=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x0e5c[_0xfcbcb8];return _0x1b1f97;};'use strict';var Sequelize=require(_0xc0e5('0x0'));module[_0xc0e5('0x1')]={'closed':{'type':Sequelize[_0xc0e5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc0e5('0x3')]},'disposition':{'type':Sequelize[_0xc0e5('0x4')]},'note':{'type':Sequelize[_0xc0e5('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xc0e5('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc0e5('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc0e5('0x5')]('in',_0xc0e5('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 99c7d38..d2228a8 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 _0x78ad=['register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','field','options','include','tag','push','Tag','Tags','distinct','read','FaxMessage','Messages','FaxInteraction','count','includeAll','Users','fullname','CmContact','Contact','User','Owner','internal','FaxAccount','color','ThroughTags','findAll','rows','catch','params','find','create','body','describe','addMessage','omit','getMessages','findOne','FaxInteractionId','$gte','split','format','addTags','setTags','ids','spread','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','createdAt','Attachment','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket'];(function(_0x5b2cf9,_0x45198a){var _0x274fe3=function(_0x5300f2){while(--_0x5300f2){_0x5b2cf9['push'](_0x5b2cf9['shift']());}};_0x274fe3(++_0x45198a);}(_0x78ad,0x64));var _0xd78a=function(_0x36976a,_0xf3a3cd){_0x36976a=_0x36976a-0x0;var _0x2b760d=_0x78ad[_0x36976a];return _0x2b760d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd78a('0x0'));var rimraf=require(_0xd78a('0x1'));var zipdir=require(_0xd78a('0x2'));var jsonpatch=require(_0xd78a('0x3'));var rp=require('request-promise');var moment=require(_0xd78a('0x4'));var BPromise=require(_0xd78a('0x5'));var Mustache=require(_0xd78a('0x6'));var util=require(_0xd78a('0x7'));var path=require(_0xd78a('0x8'));var sox=require(_0xd78a('0x9'));var csv=require(_0xd78a('0xa'));var ejs=require(_0xd78a('0xb'));var fs=require('fs');var _=require(_0xd78a('0xc'));var squel=require('squel');var crypto=require(_0xd78a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd78a('0xa'));var querystring=require('querystring');var Papa=require(_0xd78a('0xe'));var authService=require(_0xd78a('0xf'));var hardwareService=require(_0xd78a('0x10'));var Redis=require(_0xd78a('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xd78a('0x12'));var utils=require('../../config/utils');var config=require(_0xd78a('0x13'));var db=require(_0xd78a('0x14'))['db'];config[_0xd78a('0x15')]=_[_0xd78a('0x16')](config[_0xd78a('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xd78a('0x17'))(new Redis(config[_0xd78a('0x15')]));require(_0xd78a('0x18'))[_0xd78a('0x19')](socket);function respondWithStatusCode(_0x7e494f,_0x55463f){_0x55463f=_0x55463f||0xcc;return function(_0x46c418){if(_0x46c418){return _0x7e494f[_0xd78a('0x1a')](_0x55463f);}return _0x7e494f[_0xd78a('0x1b')](_0x55463f)[_0xd78a('0x1c')]();};}function respondWithResult(_0x136ee9,_0x551a38){_0x551a38=_0x551a38||0xc8;return function(_0x113316){if(_0x113316){return _0x136ee9[_0xd78a('0x1b')](_0x551a38)[_0xd78a('0x1d')](_0x113316);}};}function respondWithFilteredResult(_0x4476d3,_0x46543a){return function(_0x3bf6b1){if(_0x3bf6b1){var _0x33383b=_0x3bf6b1['count'],_0x413046=_0x46543a['offset'],_0x562400=_0x46543a[_0xd78a('0x1e')]+_0x46543a[_0xd78a('0x1f')],_0x523db2;if(_0x562400>=_0x33383b){_0x562400=_0x33383b;_0x523db2=0xc8;}else{_0x523db2=0xce;}_0x4476d3['status'](_0x523db2);return _0x4476d3[_0xd78a('0x20')](_0xd78a('0x21'),_0x413046+'-'+_0x562400+'/'+_0x33383b)['json'](_0x3bf6b1);}return null;};}function patchUpdates(_0xba54e2){return function(_0x1a383e){try{jsonpatch[_0xd78a('0x22')](_0x1a383e,_0xba54e2,!![]);}catch(_0x430bca){return BPromise[_0xd78a('0x23')](_0x430bca);}return _0x1a383e[_0xd78a('0x24')]();};}function saveUpdates(_0x25923d,_0x4cb403){return function(_0x3fa80c){if(_0x3fa80c){return _0x3fa80c[_0xd78a('0x25')](_0x25923d)[_0xd78a('0x26')](function(_0x40fb6f){return _0x40fb6f;});}return null;};}function removeEntity(_0x46ea83,_0x523765){return function(_0x429c1f){if(_0x429c1f){return _0x429c1f['destroy']()[_0xd78a('0x26')](function(){_0x46ea83[_0xd78a('0x1b')](0xcc)[_0xd78a('0x1c')]();});}};}function handleEntityNotFound(_0x11617a,_0x2da301){return function(_0xbe47b5){if(!_0xbe47b5){_0x11617a[_0xd78a('0x1a')](0x194);}return _0xbe47b5;};}function handleError(_0x42bbf7,_0x507f7a){_0x507f7a=_0x507f7a||0x1f4;return function(_0x2fa562){logger[_0xd78a('0x27')](_0x2fa562[_0xd78a('0x28')]);if(_0x2fa562[_0xd78a('0x29')]){delete _0x2fa562[_0xd78a('0x29')];}_0x42bbf7[_0xd78a('0x1b')](_0x507f7a)[_0xd78a('0x2a')](_0x2fa562);};}exports[_0xd78a('0x2b')]=function(_0x342655,_0x5585ac){var _0x1839ab={},_0x3bbc4a={},_0x262c06={'count':0x0,'rows':[]};var _0x73d077=db['FaxInteraction'][_0xd78a('0x2c')];_0x3bbc4a['model']=_[_0xd78a('0x2d')](_0x73d077);_0x3bbc4a[_0xd78a('0x2e')]=_[_0xd78a('0x2d')](_0x342655['query']);_0x3bbc4a[_0xd78a('0x2f')]=_[_0xd78a('0x30')](_0x3bbc4a[_0xd78a('0x31')],_0x3bbc4a[_0xd78a('0x2e')]);_0x1839ab[_0xd78a('0x32')]=_[_0xd78a('0x30')](_0x3bbc4a[_0xd78a('0x31')],qs[_0xd78a('0x33')](_0x342655[_0xd78a('0x2e')]['fields']));_0x1839ab[_0xd78a('0x32')]=_0x1839ab['attributes'][_0xd78a('0x34')]?_0x1839ab['attributes']:_0x3bbc4a[_0xd78a('0x31')];if(!_0x342655[_0xd78a('0x2e')][_0xd78a('0x35')](_0xd78a('0x36'))){_0x1839ab['limit']=qs['limit'](_0x342655[_0xd78a('0x2e')][_0xd78a('0x1f')]);_0x1839ab[_0xd78a('0x1e')]=qs[_0xd78a('0x1e')](_0x342655[_0xd78a('0x2e')][_0xd78a('0x1e')]);}_0x1839ab['order']=qs[_0xd78a('0x37')](_0x342655[_0xd78a('0x2e')][_0xd78a('0x37')]);_0x1839ab[_0xd78a('0x38')]=qs[_0xd78a('0x2f')](_['pick'](_0x342655[_0xd78a('0x2e')],_0x3bbc4a[_0xd78a('0x2f')]));if(_0x342655[_0xd78a('0x2e')][_0xd78a('0x39')]){_0x1839ab[_0xd78a('0x38')]=_[_0xd78a('0x3a')](_0x1839ab[_0xd78a('0x38')],{'$or':_[_0xd78a('0x3b')](_0x73d077,function(_0x1cbaa6){if(_0x1cbaa6[_0xd78a('0x3c')][_0xd78a('0x3d')]!=='VIRTUAL'){var _0x732363={};_0x732363[_0x1cbaa6[_0xd78a('0x3e')]]={'$like':'%'+_0x342655[_0xd78a('0x2e')][_0xd78a('0x39')]+'%'};return _0x732363;}})});}_0x1839ab=_[_0xd78a('0x3a')]({},_0x1839ab,_0x342655[_0xd78a('0x3f')]);var _0x539800={'where':_0x1839ab[_0xd78a('0x38')]};_0x539800[_0xd78a('0x40')]=[];if(_0x342655[_0xd78a('0x2e')][_0xd78a('0x41')]){_0x539800[_0xd78a('0x40')][_0xd78a('0x42')]({'model':db[_0xd78a('0x43')],'as':_0xd78a('0x44'),'attributes':['id'],'where':{'id':_0x342655[_0xd78a('0x2e')][_0xd78a('0x41')]},'required':!![]});_0x539800[_0xd78a('0x45')]=!![];}if(_0x342655[_0xd78a('0x2e')][_0xd78a('0x46')]){_0x539800[_0xd78a('0x40')][_0xd78a('0x42')]({'model':db[_0xd78a('0x47')],'as':_0xd78a('0x48'),'attributes':['id','direction','createdAt',_0xd78a('0x46')],'where':{'direction':'in','read':_0x342655[_0xd78a('0x2e')][_0xd78a('0x46')]||![]},'required':!![]});_0x539800['distinct']=!![];}return db[_0xd78a('0x49')][_0xd78a('0x4a')](_0x539800)['then'](function(_0x35a641){_0x262c06[_0xd78a('0x4a')]=_0x35a641;if(_0x342655[_0xd78a('0x2e')][_0xd78a('0x4b')]){_0x1839ab['include']=[{'model':db['User'],'as':_0xd78a('0x4c'),'required':![],'attributes':['id',_0xd78a('0x29'),_0xd78a('0x4d')]},{'model':db[_0xd78a('0x4e')],'as':_0xd78a('0x4f'),'required':![]},{'model':db[_0xd78a('0x50')],'as':_0xd78a('0x51'),'attributes':['name',_0xd78a('0x4d'),_0xd78a('0x52')],'required':![]},{'model':db[_0xd78a('0x53')],'as':'Account','attributes':[_0xd78a('0x29'),_0xd78a('0x3d')],'required':![]},{'model':db[_0xd78a('0x47')],'as':'Messages','attributes':['id','direction','createdAt',_0xd78a('0x46')],'where':{'direction':'in','read':_0x342655['query']['read']||![]},'required':_0x342655['query'][_0xd78a('0x46')]||![]},{'model':db[_0xd78a('0x43')],'as':_0xd78a('0x44'),'attributes':['id','name',_0xd78a('0x54')],'required':_0x342655[_0xd78a('0x2e')][_0xd78a('0x41')]?!![]:![]},{'model':db[_0xd78a('0x43')],'as':_0xd78a('0x55'),'attributes':['id',_0xd78a('0x29'),_0xd78a('0x54')],'through':_0x342655[_0xd78a('0x2e')][_0xd78a('0x41')]?{'attributes':[],'where':{'TagId':_0x342655['query']['tag']||undefined}}:{},'required':_0x342655[_0xd78a('0x2e')]['tag']?!![]:![]}];}return db[_0xd78a('0x49')][_0xd78a('0x56')](_0x1839ab);})[_0xd78a('0x26')](function(_0x3a07fb){_0x262c06[_0xd78a('0x57')]=_0x3a07fb;return _0x262c06;})['then'](respondWithFilteredResult(_0x5585ac,_0x1839ab))[_0xd78a('0x58')](handleError(_0x5585ac,null));};exports['show']=function(_0xd5bdd3,_0xcf93d){var _0x59d797={'raw':![],'where':{'id':_0xd5bdd3[_0xd78a('0x59')]['id']}},_0x1839a8={};_0x1839a8[_0xd78a('0x31')]=_[_0xd78a('0x2d')](db[_0xd78a('0x49')][_0xd78a('0x2c')]);_0x1839a8[_0xd78a('0x2e')]=_[_0xd78a('0x2d')](_0xd5bdd3[_0xd78a('0x2e')]);_0x1839a8['filters']=_[_0xd78a('0x30')](_0x1839a8[_0xd78a('0x31')],_0x1839a8['query']);_0x59d797[_0xd78a('0x32')]=_[_0xd78a('0x30')](_0x1839a8[_0xd78a('0x31')],qs[_0xd78a('0x33')](_0xd5bdd3[_0xd78a('0x2e')][_0xd78a('0x33')]));_0x59d797[_0xd78a('0x32')]=_0x59d797[_0xd78a('0x32')][_0xd78a('0x34')]?_0x59d797[_0xd78a('0x32')]:_0x1839a8[_0xd78a('0x31')];if(_0xd5bdd3[_0xd78a('0x2e')][_0xd78a('0x4b')]){_0x59d797[_0xd78a('0x40')]=[{'all':!![]}];}_0x59d797=_['merge']({},_0x59d797,_0xd5bdd3['options']);return db[_0xd78a('0x49')][_0xd78a('0x5a')](_0x59d797)['then'](handleEntityNotFound(_0xcf93d,null))[_0xd78a('0x26')](respondWithResult(_0xcf93d,null))[_0xd78a('0x58')](handleError(_0xcf93d,null));};exports[_0xd78a('0x5b')]=function(_0x32b843,_0x2dde71){return db[_0xd78a('0x49')][_0xd78a('0x5b')](_0x32b843[_0xd78a('0x5c')],{})[_0xd78a('0x26')](respondWithResult(_0x2dde71,0xc9))[_0xd78a('0x58')](handleError(_0x2dde71,null));};exports['update']=function(_0x3d3e4e,_0x4561e1){if(_0x3d3e4e[_0xd78a('0x5c')]['id']){delete _0x3d3e4e[_0xd78a('0x5c')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x3d3e4e['params']['id']}})[_0xd78a('0x26')](handleEntityNotFound(_0x4561e1,null))[_0xd78a('0x26')](saveUpdates(_0x3d3e4e[_0xd78a('0x5c')],null))[_0xd78a('0x26')](respondWithResult(_0x4561e1,null))[_0xd78a('0x58')](handleError(_0x4561e1,null));};exports['destroy']=function(_0x2a4f07,_0xab3f4a){return db[_0xd78a('0x49')][_0xd78a('0x5a')]({'where':{'id':_0x2a4f07[_0xd78a('0x59')]['id']}})['then'](handleEntityNotFound(_0xab3f4a,null))['then'](removeEntity(_0xab3f4a,null))[_0xd78a('0x58')](handleError(_0xab3f4a,null));};exports[_0xd78a('0x5d')]=function(_0x3cb8fa,_0x6a062e){return db[_0xd78a('0x49')][_0xd78a('0x5d')]()[_0xd78a('0x26')](respondWithResult(_0x6a062e,null))[_0xd78a('0x58')](handleError(_0x6a062e,null));};exports['addMessage']=function(_0x219417,_0x5dee93,_0x10c9e5){return db[_0xd78a('0x47')]['find']({'where':{'id':_0x219417[_0xd78a('0x59')]['id']}})[_0xd78a('0x26')](handleEntityNotFound(_0x5dee93,null))[_0xd78a('0x26')](function(_0x5f201d){if(_0x5f201d){return _0x5f201d[_0xd78a('0x5e')](_0x219417['body']['ids'],_[_0xd78a('0x5f')](_0x219417['body'],['ids','id'])||{});}})[_0xd78a('0x26')](respondWithResult(_0x5dee93,null))[_0xd78a('0x58')](handleError(_0x5dee93,null));};exports[_0xd78a('0x60')]=function(_0x215608,_0x20c55e,_0x49056a){var _0x53cc18={'raw':![],'where':{}};var _0x4e2d3b={};var _0x33bb0a={'count':0x0,'rows':[]};return db[_0xd78a('0x49')][_0xd78a('0x61')]({'where':{'id':_0x215608[_0xd78a('0x59')]['id']}})[_0xd78a('0x26')](handleEntityNotFound(_0x20c55e,null))['then'](function(_0x54c7a0){if(_0x54c7a0){_0x4e2d3b[_0xd78a('0x31')]=_[_0xd78a('0x2d')](db['FaxMessage'][_0xd78a('0x2c')]);_0x4e2d3b[_0xd78a('0x2e')]=_[_0xd78a('0x2d')](_0x215608[_0xd78a('0x2e')]);_0x4e2d3b[_0xd78a('0x2f')]=_['intersection'](_0x4e2d3b[_0xd78a('0x31')],_0x4e2d3b[_0xd78a('0x2e')]);_0x53cc18['attributes']=_[_0xd78a('0x30')](_0x4e2d3b[_0xd78a('0x31')],qs[_0xd78a('0x33')](_0x215608[_0xd78a('0x2e')][_0xd78a('0x33')]));_0x53cc18[_0xd78a('0x32')]=_0x53cc18[_0xd78a('0x32')][_0xd78a('0x34')]?_0x53cc18[_0xd78a('0x32')]:_0x4e2d3b[_0xd78a('0x31')];if(!_0x215608[_0xd78a('0x2e')][_0xd78a('0x35')](_0xd78a('0x36'))){_0x53cc18[_0xd78a('0x1f')]=qs[_0xd78a('0x1f')](_0x215608[_0xd78a('0x2e')][_0xd78a('0x1f')]);_0x53cc18[_0xd78a('0x1e')]=qs[_0xd78a('0x1e')](_0x215608['query'][_0xd78a('0x1e')]);}_0x53cc18['order']=qs[_0xd78a('0x37')](_0x215608[_0xd78a('0x2e')]['sort']);_0x53cc18[_0xd78a('0x38')]=qs[_0xd78a('0x2f')](_['pick'](_0x215608[_0xd78a('0x2e')],_0x4e2d3b[_0xd78a('0x2f')]));_0x53cc18[_0xd78a('0x38')][_0xd78a('0x62')]=_0x54c7a0['id'];if(_0x215608[_0xd78a('0x2e')][_0xd78a('0x39')]){_0x53cc18['where']=_[_0xd78a('0x3a')](_0x53cc18[_0xd78a('0x38')],{'$or':_['map'](_0x53cc18[_0xd78a('0x32')],function(_0x3fe398){var _0x3ed26e={};_0x3ed26e[_0x3fe398]={'$like':'%'+_0x215608['query']['filter']+'%'};return _0x3ed26e;})});}if(_0x215608[_0xd78a('0x2e')][_0xd78a('0x63')]){var _0x59d71a=_0x215608[_0xd78a('0x2e')][_0xd78a('0x63')][_0xd78a('0x64')](',');var _0x4290a3={};_0x4290a3[_0x59d71a[0x0]]={'$gte':moment(_0x59d71a[0x1])[_0xd78a('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};_0x53cc18[_0xd78a('0x38')]=_['merge'](_0x53cc18[_0xd78a('0x38')],_0x4290a3);}_0x53cc18=_['merge']({},_0x53cc18,_0x215608[_0xd78a('0x3f')]);return db[_0xd78a('0x47')][_0xd78a('0x4a')]({'where':_0x53cc18[_0xd78a('0x38')]})[_0xd78a('0x26')](function(_0x168675){_0x33bb0a['count']=_0x168675;if(_0x215608[_0xd78a('0x2e')][_0xd78a('0x4b')]){_0x53cc18[_0xd78a('0x40')]=[{'all':!![]}];}return db['FaxMessage'][_0xd78a('0x56')](_0x53cc18);})[_0xd78a('0x26')](function(_0x123496){_0x33bb0a[_0xd78a('0x57')]=_0x123496;return _0x33bb0a;});}})['then'](respondWithFilteredResult(_0x20c55e,_0x53cc18))[_0xd78a('0x58')](handleError(_0x20c55e,null));};exports[_0xd78a('0x66')]=function(_0x2a1651,_0x3327aa,_0x1380a6){return db['FaxInteraction'][_0xd78a('0x5a')]({'where':{'id':_0x2a1651['params']['id']}})['then'](handleEntityNotFound(_0x3327aa,null))['then'](function(_0x20110c){if(_0x20110c){return _0x20110c[_0xd78a('0x67')](_0x2a1651[_0xd78a('0x5c')][_0xd78a('0x68')],_[_0xd78a('0x5f')](_0x2a1651[_0xd78a('0x5c')],[_0xd78a('0x68'),'id'])||{})[_0xd78a('0x69')](function(){return db[_0xd78a('0x43')]['findAll']({'attributes':['id',_0xd78a('0x29'),_0xd78a('0x54')],'where':{'id':_0x2a1651[_0xd78a('0x5c')][_0xd78a('0x68')]}});})[_0xd78a('0x26')](function(_0x478e5f){socket[_0xd78a('0x6a')](_0xd78a('0x6b'),{'id':Number(_0x2a1651[_0xd78a('0x59')]['id']),'tags':_0x478e5f||[]});return{'id':Number(_0x2a1651[_0xd78a('0x59')]['id']),'tags':_0x478e5f||[]};});}})[_0xd78a('0x26')](respondWithResult(_0x3327aa,null))['catch'](handleError(_0x3327aa,null));};exports['removeTags']=function(_0x10fa06,_0x1fbfa5,_0x4f5e96){var _0x4e218c;return db[_0xd78a('0x49')][_0xd78a('0x5a')]({'where':{'id':_0x10fa06[_0xd78a('0x59')]['id']}})['then'](handleEntityNotFound(_0x1fbfa5,null))[_0xd78a('0x26')](function(_0x348bf3){if(_0x348bf3){return _0x348bf3[_0xd78a('0x6c')](_0x10fa06[_0xd78a('0x2e')][_0xd78a('0x68')]);}})['then'](respondWithStatusCode(_0x1fbfa5,null))[_0xd78a('0x58')](handleError(_0x1fbfa5,null));};exports[_0xd78a('0x6d')]=function(_0x2e39fe,_0x1572ac){var _0x16140d=moment()[_0xd78a('0x6e')]()[_0xd78a('0x6f')]();var _0x174be5=path[_0xd78a('0x70')](config[_0xd78a('0x71')],_0xd78a('0x72'),_0xd78a('0x73'),'attachments');var _0x20216e=path['join'](config['root'],_0xd78a('0x72'),_0xd78a('0x73'),_0xd78a('0x74'));var _0x2cdeb2=path[_0xd78a('0x70')](_0x20216e,_0x16140d);var _0x1f13d3=util[_0xd78a('0x65')]('interaction-%s.zip',_0x16140d);var _0x48f189=path[_0xd78a('0x70')](_0x20216e,_0x1f13d3);var _0x95996f=![];return db[_0xd78a('0x49')][_0xd78a('0x5a')]({'where':{'id':_0x2e39fe[_0xd78a('0x59')]['id']}})[_0xd78a('0x26')](handleEntityNotFound(_0x1572ac,null))[_0xd78a('0x26')](function(_0x2bb55b){if(_0x2bb55b){return _0x2bb55b[_0xd78a('0x60')]({'attributes':['id','body',_0xd78a('0x75')],'include':[{'model':db['Attachment'],'as':_0xd78a('0x76')}]});}return[];})[_0xd78a('0x26')](function(_0x33edcd){_0x95996f=_0x33edcd['length'];if(_0x33edcd[_0xd78a('0x34')]){fs[_0xd78a('0x77')](_0x2cdeb2);for(var _0x377824=0x0;_0x377824<_0x33edcd[_0xd78a('0x34')];_0x377824++){var _0x5b39a1=_0x33edcd[_0x377824];var _0x482c5f=_0x5b39a1[_0xd78a('0x76')];if(_0x482c5f){var _0x2473d2=path[_0xd78a('0x70')](_0x174be5,_0x482c5f['basename']);if(fs[_0xd78a('0x78')](_0x2473d2)){fs[_0xd78a('0x79')](_0x2473d2)[_0xd78a('0x7a')](fs[_0xd78a('0x7b')](path[_0xd78a('0x70')](_0x2cdeb2,_0x482c5f['basename'])));}}}}})[_0xd78a('0x26')](function(){if(_0x95996f){return new BPromise(function(_0x246357,_0x3fb766){zipdir(_0x2cdeb2,{'saveTo':_0x48f189},function(_0x2c4891,_0x408ac2){if(_0x2c4891)return _0x3fb766(_0x2c4891);return _0x246357(_0x408ac2);});});}})[_0xd78a('0x26')](function(){if(_0x95996f){return new BPromise(function(_0x106c29,_0x51384e){rimraf(_0x2cdeb2,function(_0x3f4ad5){if(_0x3f4ad5)_0x51384e(_0x3f4ad5);return _0x106c29();});});}})['then'](function(){if(_0x95996f){return _0x1572ac[_0xd78a('0x6d')](_0x48f189,_0x1f13d3,function(_0x50144a){if(_0x50144a){console['log']('err',_0x50144a);}else{fs[_0xd78a('0x7c')](_0x48f189);}});}else{return _0x1572ac[_0xd78a('0x1a')](0xc8);}})[_0xd78a('0x58')](handleError(_0x1572ac,null));}; \ No newline at end of file +var _0x1c35=['../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./faxInteraction.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','update','destroy','then','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','key','VIRTUAL','field','filter','merge','options','include','tag','push','Tag','Tags','distinct','read','FaxMessage','Messages','direction','createdAt','User','Users','fullname','CmContact','Contact','Account','ThroughTags','FaxInteraction','rows','catch','show','params','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','FaxInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','tmp','interaction-%s.zip','Attachment','pipe','createWriteStream','log','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x1f175e,_0x25487c){var _0x4ab74c=function(_0x301e14){while(--_0x301e14){_0x1f175e['push'](_0x1f175e['shift']());}};_0x4ab74c(++_0x25487c);}(_0x1c35,0x6e));var _0x51c3=function(_0x2972ad,_0x5f07f2){_0x2972ad=_0x2972ad-0x0;var _0x5c3026=_0x1c35[_0x2972ad];return _0x5c3026;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51c3('0x0'));var rimraf=require(_0x51c3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51c3('0x2'));var moment=require(_0x51c3('0x3'));var BPromise=require(_0x51c3('0x4'));var Mustache=require(_0x51c3('0x5'));var util=require(_0x51c3('0x6'));var path=require('path');var sox=require(_0x51c3('0x7'));var csv=require('to-csv');var ejs=require(_0x51c3('0x8'));var fs=require('fs');var _=require(_0x51c3('0x9'));var squel=require('squel');var crypto=require(_0x51c3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x51c3('0xb'));var toCsv=require(_0x51c3('0xc'));var querystring=require(_0x51c3('0xd'));var Papa=require(_0x51c3('0xe'));var authService=require(_0x51c3('0xf'));var hardwareService=require(_0x51c3('0x10'));var Redis=require(_0x51c3('0x11'));var qs=require(_0x51c3('0x12'));var logger=require(_0x51c3('0x13'))(_0x51c3('0x14'));var utils=require(_0x51c3('0x15'));var config=require(_0x51c3('0x16'));var db=require('../../mysqldb')['db'];config[_0x51c3('0x17')]=_[_0x51c3('0x18')](config[_0x51c3('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51c3('0x17')]));require(_0x51c3('0x19'))[_0x51c3('0x1a')](socket);function respondWithStatusCode(_0x3af2d1,_0x1b6ec5){_0x1b6ec5=_0x1b6ec5||0xcc;return function(_0x5b7e7d){if(_0x5b7e7d){return _0x3af2d1[_0x51c3('0x1b')](_0x1b6ec5);}return _0x3af2d1[_0x51c3('0x1c')](_0x1b6ec5)[_0x51c3('0x1d')]();};}function respondWithResult(_0x4fbee1,_0x4dfa84){_0x4dfa84=_0x4dfa84||0xc8;return function(_0x2e798d){if(_0x2e798d){return _0x4fbee1[_0x51c3('0x1c')](_0x4dfa84)['json'](_0x2e798d);}};}function respondWithFilteredResult(_0x2fd1d6,_0x1e6647){return function(_0x29356b){if(_0x29356b){var _0x2f9894=_0x29356b[_0x51c3('0x1e')],_0x294cbc=_0x1e6647['offset'],_0xd0cbcb=_0x1e6647[_0x51c3('0x1f')]+_0x1e6647[_0x51c3('0x20')],_0x5a08cf;if(_0xd0cbcb>=_0x2f9894){_0xd0cbcb=_0x2f9894;_0x5a08cf=0xc8;}else{_0x5a08cf=0xce;}_0x2fd1d6['status'](_0x5a08cf);return _0x2fd1d6[_0x51c3('0x21')](_0x51c3('0x22'),_0x294cbc+'-'+_0xd0cbcb+'/'+_0x2f9894)[_0x51c3('0x23')](_0x29356b);}return null;};}function patchUpdates(_0x23216d){return function(_0x6514ed){try{jsonpatch['apply'](_0x6514ed,_0x23216d,!![]);}catch(_0xc20153){return BPromise['reject'](_0xc20153);}return _0x6514ed['save']();};}function saveUpdates(_0x329233,_0x1d7289){return function(_0x57d053){if(_0x57d053){return _0x57d053[_0x51c3('0x24')](_0x329233)['then'](function(_0x33fd9c){return _0x33fd9c;});}return null;};}function removeEntity(_0x529039,_0x425a4a){return function(_0x1113e7){if(_0x1113e7){return _0x1113e7[_0x51c3('0x25')]()[_0x51c3('0x26')](function(){_0x529039[_0x51c3('0x1c')](0xcc)[_0x51c3('0x1d')]();});}};}function handleEntityNotFound(_0x65edaa,_0x28000b){return function(_0x527863){if(!_0x527863){_0x65edaa[_0x51c3('0x1b')](0x194);}return _0x527863;};}function handleError(_0x355d3c,_0x5223a4){_0x5223a4=_0x5223a4||0x1f4;return function(_0x5169a1){logger[_0x51c3('0x27')](_0x5169a1[_0x51c3('0x28')]);if(_0x5169a1[_0x51c3('0x29')]){delete _0x5169a1[_0x51c3('0x29')];}_0x355d3c[_0x51c3('0x1c')](_0x5223a4)[_0x51c3('0x2a')](_0x5169a1);};}exports[_0x51c3('0x2b')]=function(_0x5d1546,_0x12b96c){var _0x784c3d={},_0x1e0b24={},_0x3dc3eb={'count':0x0,'rows':[]};var _0x2eb9f1=db['FaxInteraction'][_0x51c3('0x2c')];_0x1e0b24[_0x51c3('0x2d')]=_['keys'](_0x2eb9f1);_0x1e0b24[_0x51c3('0x2e')]=_[_0x51c3('0x2f')](_0x5d1546['query']);_0x1e0b24[_0x51c3('0x30')]=_[_0x51c3('0x31')](_0x1e0b24[_0x51c3('0x2d')],_0x1e0b24[_0x51c3('0x2e')]);_0x784c3d[_0x51c3('0x32')]=_[_0x51c3('0x31')](_0x1e0b24[_0x51c3('0x2d')],qs['fields'](_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x33')]));_0x784c3d['attributes']=_0x784c3d[_0x51c3('0x32')][_0x51c3('0x34')]?_0x784c3d[_0x51c3('0x32')]:_0x1e0b24[_0x51c3('0x2d')];if(!_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x35')](_0x51c3('0x36'))){_0x784c3d[_0x51c3('0x20')]=qs[_0x51c3('0x20')](_0x5d1546['query'][_0x51c3('0x20')]);_0x784c3d[_0x51c3('0x1f')]=qs[_0x51c3('0x1f')](_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x1f')]);}_0x784c3d[_0x51c3('0x37')]=qs[_0x51c3('0x38')](_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x38')]);_0x784c3d['where']=qs['filters'](_[_0x51c3('0x39')](_0x5d1546[_0x51c3('0x2e')],_0x1e0b24['filters']));if(_0x5d1546[_0x51c3('0x2e')]['filter']){_0x784c3d[_0x51c3('0x3a')]=_['merge'](_0x784c3d[_0x51c3('0x3a')],{'$or':_['map'](_0x2eb9f1,function(_0x370fcd){if(_0x370fcd[_0x51c3('0x3b')][_0x51c3('0x3c')]!==_0x51c3('0x3d')){var _0x31e479={};_0x31e479[_0x370fcd[_0x51c3('0x3e')]]={'$like':'%'+_0x5d1546['query'][_0x51c3('0x3f')]+'%'};return _0x31e479;}})});}_0x784c3d=_[_0x51c3('0x40')]({},_0x784c3d,_0x5d1546[_0x51c3('0x41')]);var _0x7f4906={'where':_0x784c3d[_0x51c3('0x3a')]};_0x7f4906[_0x51c3('0x42')]=[];if(_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x43')]){_0x7f4906[_0x51c3('0x42')][_0x51c3('0x44')]({'model':db[_0x51c3('0x45')],'as':_0x51c3('0x46'),'attributes':['id'],'where':{'id':_0x5d1546['query'][_0x51c3('0x43')]},'required':!![]});_0x7f4906[_0x51c3('0x47')]=!![];}if(_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x48')]){_0x7f4906['include']['push']({'model':db[_0x51c3('0x49')],'as':_0x51c3('0x4a'),'attributes':['id',_0x51c3('0x4b'),_0x51c3('0x4c'),_0x51c3('0x48')],'where':{'direction':'in','read':_0x5d1546['query'][_0x51c3('0x48')]||![]},'required':!![]});_0x7f4906['distinct']=!![];}return db['FaxInteraction'][_0x51c3('0x1e')](_0x7f4906)['then'](function(_0x429cc7){_0x3dc3eb[_0x51c3('0x1e')]=_0x429cc7;if(_0x5d1546['query']['includeAll']){_0x784c3d[_0x51c3('0x42')]=[{'model':db[_0x51c3('0x4d')],'as':_0x51c3('0x4e'),'required':![],'attributes':['id',_0x51c3('0x29'),_0x51c3('0x4f')]},{'model':db[_0x51c3('0x50')],'as':_0x51c3('0x51'),'required':![]},{'model':db[_0x51c3('0x4d')],'as':'Owner','attributes':[_0x51c3('0x29'),_0x51c3('0x4f'),'internal'],'required':![]},{'model':db['FaxAccount'],'as':_0x51c3('0x52'),'attributes':[_0x51c3('0x29'),_0x51c3('0x3c')],'required':![]},{'model':db[_0x51c3('0x49')],'as':_0x51c3('0x4a'),'attributes':['id',_0x51c3('0x4b'),_0x51c3('0x4c'),_0x51c3('0x48')],'where':{'direction':'in','read':_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x48')]||![]},'required':_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x48')]||![]},{'model':db[_0x51c3('0x45')],'as':'Tags','attributes':['id',_0x51c3('0x29'),'color'],'required':_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x43')]?!![]:![]},{'model':db['Tag'],'as':_0x51c3('0x53'),'attributes':['id',_0x51c3('0x29'),'color'],'through':_0x5d1546[_0x51c3('0x2e')][_0x51c3('0x43')]?{'attributes':[],'where':{'TagId':_0x5d1546['query']['tag']||undefined}}:{},'required':_0x5d1546[_0x51c3('0x2e')]['tag']?!![]:![]}];}return db[_0x51c3('0x54')]['findAll'](_0x784c3d);})['then'](function(_0x2f3086){_0x3dc3eb[_0x51c3('0x55')]=_0x2f3086;return _0x3dc3eb;})[_0x51c3('0x26')](respondWithFilteredResult(_0x12b96c,_0x784c3d))[_0x51c3('0x56')](handleError(_0x12b96c,null));};exports[_0x51c3('0x57')]=function(_0x2607bc,_0x91b944){var _0x5d14db={'raw':![],'where':{'id':_0x2607bc[_0x51c3('0x58')]['id']}},_0x430a9b={};_0x430a9b[_0x51c3('0x2d')]=_[_0x51c3('0x2f')](db['FaxInteraction']['rawAttributes']);_0x430a9b[_0x51c3('0x2e')]=_[_0x51c3('0x2f')](_0x2607bc[_0x51c3('0x2e')]);_0x430a9b[_0x51c3('0x30')]=_['intersection'](_0x430a9b[_0x51c3('0x2d')],_0x430a9b[_0x51c3('0x2e')]);_0x5d14db[_0x51c3('0x32')]=_[_0x51c3('0x31')](_0x430a9b[_0x51c3('0x2d')],qs[_0x51c3('0x33')](_0x2607bc['query'][_0x51c3('0x33')]));_0x5d14db[_0x51c3('0x32')]=_0x5d14db[_0x51c3('0x32')][_0x51c3('0x34')]?_0x5d14db[_0x51c3('0x32')]:_0x430a9b[_0x51c3('0x2d')];if(_0x2607bc[_0x51c3('0x2e')]['includeAll']){_0x5d14db[_0x51c3('0x42')]=[{'all':!![]}];}_0x5d14db=_['merge']({},_0x5d14db,_0x2607bc[_0x51c3('0x41')]);return db[_0x51c3('0x54')][_0x51c3('0x59')](_0x5d14db)[_0x51c3('0x26')](handleEntityNotFound(_0x91b944,null))[_0x51c3('0x26')](respondWithResult(_0x91b944,null))[_0x51c3('0x56')](handleError(_0x91b944,null));};exports[_0x51c3('0x5a')]=function(_0x459098,_0x31f732){return db[_0x51c3('0x54')]['create'](_0x459098[_0x51c3('0x5b')],{})['then'](respondWithResult(_0x31f732,0xc9))['catch'](handleError(_0x31f732,null));};exports[_0x51c3('0x24')]=function(_0x351f6c,_0x5862a3){if(_0x351f6c['body']['id']){delete _0x351f6c[_0x51c3('0x5b')]['id'];}return db[_0x51c3('0x54')]['find']({'where':{'id':_0x351f6c['params']['id']}})[_0x51c3('0x26')](handleEntityNotFound(_0x5862a3,null))[_0x51c3('0x26')](saveUpdates(_0x351f6c[_0x51c3('0x5b')],null))[_0x51c3('0x26')](respondWithResult(_0x5862a3,null))[_0x51c3('0x56')](handleError(_0x5862a3,null));};exports[_0x51c3('0x25')]=function(_0x35056f,_0xdedcce){return db[_0x51c3('0x54')][_0x51c3('0x59')]({'where':{'id':_0x35056f[_0x51c3('0x58')]['id']}})[_0x51c3('0x26')](handleEntityNotFound(_0xdedcce,null))[_0x51c3('0x26')](removeEntity(_0xdedcce,null))['catch'](handleError(_0xdedcce,null));};exports[_0x51c3('0x5c')]=function(_0x4f9f24,_0x5c7261){return db['FaxInteraction'][_0x51c3('0x5c')]()[_0x51c3('0x26')](respondWithResult(_0x5c7261,null))[_0x51c3('0x56')](handleError(_0x5c7261,null));};exports[_0x51c3('0x5d')]=function(_0xbe8fb3,_0x53349e,_0xa13fc0){return db['FaxMessage'][_0x51c3('0x59')]({'where':{'id':_0xbe8fb3[_0x51c3('0x58')]['id']}})[_0x51c3('0x26')](handleEntityNotFound(_0x53349e,null))[_0x51c3('0x26')](function(_0x9055bb){if(_0x9055bb){return _0x9055bb[_0x51c3('0x5d')](_0xbe8fb3[_0x51c3('0x5b')][_0x51c3('0x5e')],_[_0x51c3('0x5f')](_0xbe8fb3[_0x51c3('0x5b')],[_0x51c3('0x5e'),'id'])||{});}})[_0x51c3('0x26')](respondWithResult(_0x53349e,null))[_0x51c3('0x56')](handleError(_0x53349e,null));};exports[_0x51c3('0x60')]=function(_0x119558,_0x3cc8d6,_0x4d20ec){var _0x2ec60f={'raw':![],'where':{}};var _0xb31617={};var _0x24812b={'count':0x0,'rows':[]};return db[_0x51c3('0x54')][_0x51c3('0x61')]({'where':{'id':_0x119558[_0x51c3('0x58')]['id']}})['then'](handleEntityNotFound(_0x3cc8d6,null))[_0x51c3('0x26')](function(_0x5b73fd){if(_0x5b73fd){_0xb31617[_0x51c3('0x2d')]=_[_0x51c3('0x2f')](db['FaxMessage'][_0x51c3('0x2c')]);_0xb31617[_0x51c3('0x2e')]=_['keys'](_0x119558[_0x51c3('0x2e')]);_0xb31617[_0x51c3('0x30')]=_['intersection'](_0xb31617['model'],_0xb31617[_0x51c3('0x2e')]);_0x2ec60f[_0x51c3('0x32')]=_[_0x51c3('0x31')](_0xb31617[_0x51c3('0x2d')],qs['fields'](_0x119558['query'][_0x51c3('0x33')]));_0x2ec60f[_0x51c3('0x32')]=_0x2ec60f[_0x51c3('0x32')][_0x51c3('0x34')]?_0x2ec60f[_0x51c3('0x32')]:_0xb31617[_0x51c3('0x2d')];if(!_0x119558[_0x51c3('0x2e')][_0x51c3('0x35')](_0x51c3('0x36'))){_0x2ec60f[_0x51c3('0x20')]=qs['limit'](_0x119558[_0x51c3('0x2e')]['limit']);_0x2ec60f['offset']=qs[_0x51c3('0x1f')](_0x119558['query']['offset']);}_0x2ec60f[_0x51c3('0x37')]=qs[_0x51c3('0x38')](_0x119558[_0x51c3('0x2e')][_0x51c3('0x38')]);_0x2ec60f[_0x51c3('0x3a')]=qs[_0x51c3('0x30')](_['pick'](_0x119558[_0x51c3('0x2e')],_0xb31617[_0x51c3('0x30')]));_0x2ec60f[_0x51c3('0x3a')][_0x51c3('0x62')]=_0x5b73fd['id'];if(_0x119558[_0x51c3('0x2e')][_0x51c3('0x3f')]){_0x2ec60f[_0x51c3('0x3a')]=_[_0x51c3('0x40')](_0x2ec60f['where'],{'$or':_['map'](_0x2ec60f[_0x51c3('0x32')],function(_0x48cb60){var _0x1573fd={};_0x1573fd[_0x48cb60]={'$like':'%'+_0x119558[_0x51c3('0x2e')][_0x51c3('0x3f')]+'%'};return _0x1573fd;})});}if(_0x119558[_0x51c3('0x2e')][_0x51c3('0x63')]){var _0x25faab=_0x119558[_0x51c3('0x2e')][_0x51c3('0x63')][_0x51c3('0x64')](',');var _0x20dd4c={};_0x20dd4c[_0x25faab[0x0]]={'$gte':moment(_0x25faab[0x1])[_0x51c3('0x65')](_0x51c3('0x66'))};_0x2ec60f[_0x51c3('0x3a')]=_[_0x51c3('0x40')](_0x2ec60f['where'],_0x20dd4c);}_0x2ec60f=_['merge']({},_0x2ec60f,_0x119558['options']);return db['FaxMessage'][_0x51c3('0x1e')]({'where':_0x2ec60f[_0x51c3('0x3a')]})['then'](function(_0x2b9a83){_0x24812b[_0x51c3('0x1e')]=_0x2b9a83;if(_0x119558[_0x51c3('0x2e')]['includeAll']){_0x2ec60f['include']=[{'all':!![]}];}return db[_0x51c3('0x49')][_0x51c3('0x67')](_0x2ec60f);})[_0x51c3('0x26')](function(_0x546415){_0x24812b[_0x51c3('0x55')]=_0x546415;return _0x24812b;});}})[_0x51c3('0x26')](respondWithFilteredResult(_0x3cc8d6,_0x2ec60f))[_0x51c3('0x56')](handleError(_0x3cc8d6,null));};exports[_0x51c3('0x68')]=function(_0x33cd47,_0x12e963,_0x438112){return db['FaxInteraction']['find']({'where':{'id':_0x33cd47['params']['id']}})['then'](handleEntityNotFound(_0x12e963,null))[_0x51c3('0x26')](function(_0x577b78){if(_0x577b78){return _0x577b78[_0x51c3('0x69')](_0x33cd47[_0x51c3('0x5b')][_0x51c3('0x5e')],_[_0x51c3('0x5f')](_0x33cd47[_0x51c3('0x5b')],['ids','id'])||{})[_0x51c3('0x6a')](function(){return db[_0x51c3('0x45')][_0x51c3('0x67')]({'attributes':['id',_0x51c3('0x29'),_0x51c3('0x6b')],'where':{'id':_0x33cd47[_0x51c3('0x5b')]['ids']}});})[_0x51c3('0x26')](function(_0x5e69a2){socket[_0x51c3('0x6c')](_0x51c3('0x6d'),{'id':Number(_0x33cd47[_0x51c3('0x58')]['id']),'tags':_0x5e69a2||[]});return{'id':Number(_0x33cd47[_0x51c3('0x58')]['id']),'tags':_0x5e69a2||[]};});}})[_0x51c3('0x26')](respondWithResult(_0x12e963,null))[_0x51c3('0x56')](handleError(_0x12e963,null));};exports[_0x51c3('0x6e')]=function(_0x2949d0,_0x384200,_0x5b6df8){var _0x2e5bc7;return db[_0x51c3('0x54')]['find']({'where':{'id':_0x2949d0[_0x51c3('0x58')]['id']}})[_0x51c3('0x26')](handleEntityNotFound(_0x384200,null))[_0x51c3('0x26')](function(_0x537fe5){if(_0x537fe5){return _0x537fe5[_0x51c3('0x6e')](_0x2949d0[_0x51c3('0x2e')][_0x51c3('0x5e')]);}})[_0x51c3('0x26')](respondWithStatusCode(_0x384200,null))[_0x51c3('0x56')](handleError(_0x384200,null));};exports[_0x51c3('0x6f')]=function(_0x224c56,_0x1ddbb2){var _0x51bbb5=moment()[_0x51c3('0x70')]()[_0x51c3('0x71')]();var _0x46519b=path[_0x51c3('0x72')](config[_0x51c3('0x73')],_0x51c3('0x74'),_0x51c3('0x75'),_0x51c3('0x76'));var _0x24d45a=path[_0x51c3('0x72')](config['root'],_0x51c3('0x74'),_0x51c3('0x75'),_0x51c3('0x77'));var _0x429e38=path[_0x51c3('0x72')](_0x24d45a,_0x51bbb5);var _0x172ca5=util[_0x51c3('0x65')](_0x51c3('0x78'),_0x51bbb5);var _0x3a5ff1=path['join'](_0x24d45a,_0x172ca5);var _0x13fe48=![];return db[_0x51c3('0x54')]['find']({'where':{'id':_0x224c56[_0x51c3('0x58')]['id']}})[_0x51c3('0x26')](handleEntityNotFound(_0x1ddbb2,null))[_0x51c3('0x26')](function(_0x485c96){if(_0x485c96){return _0x485c96[_0x51c3('0x60')]({'attributes':['id',_0x51c3('0x5b'),'createdAt'],'include':[{'model':db[_0x51c3('0x79')],'as':_0x51c3('0x79')}]});}return[];})['then'](function(_0x541b66){_0x13fe48=_0x541b66[_0x51c3('0x34')];if(_0x541b66['length']){fs['mkdirSync'](_0x429e38);for(var _0x35c6bd=0x0;_0x35c6bd<_0x541b66[_0x51c3('0x34')];_0x35c6bd++){var _0x4aad4c=_0x541b66[_0x35c6bd];var _0x1279dd=_0x4aad4c[_0x51c3('0x79')];if(_0x1279dd){var _0x30e87c=path['join'](_0x46519b,_0x1279dd['basename']);if(fs['existsSync'](_0x30e87c)){fs['createReadStream'](_0x30e87c)[_0x51c3('0x7a')](fs[_0x51c3('0x7b')](path['join'](_0x429e38,_0x1279dd['basename'])));}}}}})[_0x51c3('0x26')](function(){if(_0x13fe48){return new BPromise(function(_0x32454c,_0x3048c8){zipdir(_0x429e38,{'saveTo':_0x3a5ff1},function(_0x413dec,_0x3d9ead){if(_0x413dec)return _0x3048c8(_0x413dec);return _0x32454c(_0x3d9ead);});});}})[_0x51c3('0x26')](function(){if(_0x13fe48){return new BPromise(function(_0x365fd9,_0x235258){rimraf(_0x429e38,function(_0x37cd32){if(_0x37cd32)_0x235258(_0x37cd32);return _0x365fd9();});});}})[_0x51c3('0x26')](function(){if(_0x13fe48){return _0x1ddbb2[_0x51c3('0x6f')](_0x3a5ff1,_0x172ca5,function(_0xb6cb96){if(_0xb6cb96){console[_0x51c3('0x7c')]('err',_0xb6cb96);}else{fs[_0x51c3('0x7d')](_0x3a5ff1);}});}else{return _0x1ddbb2['sendStatus'](0xc8);}})[_0x51c3('0x56')](handleError(_0x1ddbb2,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index fe305aa..e7d5f0e 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 _0x1752=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','setMaxListeners','save','update'];(function(_0x9a189f,_0x13e562){var _0x55bc1a=function(_0x5ae6d9){while(--_0x5ae6d9){_0x9a189f['push'](_0x9a189f['shift']());}};_0x55bc1a(++_0x13e562);}(_0x1752,0xa5));var _0x2175=function(_0x910298,_0x46fa29){_0x910298=_0x910298-0x0;var _0x36c81d=_0x1752[_0x910298];return _0x36c81d;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x2175('0x0'))['db'][_0x2175('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2175('0x2')](0x0);var events={'afterCreate':_0x2175('0x3'),'afterUpdate':_0x2175('0x4'),'afterDestroy':_0x2175('0x5')};function emitEvent(_0x56c315){return function(_0x1ee277,_0x22c167,_0x12b8d9){FaxInteractionEvents[_0x2175('0x6')](_0x56c315+':'+_0x1ee277['id'],_0x1ee277);FaxInteractionEvents[_0x2175('0x6')](_0x56c315,_0x1ee277);_0x12b8d9(null);};}for(var e in events){if(events[_0x2175('0x7')](e)){var event=events[e];FaxInteraction[_0x2175('0x8')](e,emitEvent(event));}}module[_0x2175('0x9')]=FaxInteractionEvents; \ No newline at end of file +var _0x5423=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5423,0xe3));var _0x3542=function(_0x47dc79,_0x566875){_0x47dc79=_0x47dc79-0x0;var _0x51a9c1=_0x5423[_0x47dc79];return _0x51a9c1;};'use strict';var EventEmitter=require(_0x3542('0x0'));var FaxInteraction=require(_0x3542('0x1'))['db']['FaxInteraction'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3542('0x2')](0x0);var events={'afterCreate':_0x3542('0x3'),'afterUpdate':'update','afterDestroy':_0x3542('0x4')};function emitEvent(_0x1202d5){return function(_0xf0835,_0x2a1864,_0x54ea2f){FaxInteractionEvents[_0x3542('0x5')](_0x1202d5+':'+_0xf0835['id'],_0xf0835);FaxInteractionEvents[_0x3542('0x5')](_0x1202d5,_0xf0835);_0x54ea2f(null);};}for(var e in events){if(events[_0x3542('0x6')](e)){var event=events[e];FaxInteraction[_0x3542('0x7')](e,emitEvent(event));}}module[_0x3542('0x8')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 1e6002f..9af945b 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 _0xa9e0=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','./faxInteraction.attributes','exports','define','fax_interactions','closed'];(function(_0x2d90ff,_0x166b3e){var _0x3b1f82=function(_0xd04cac){while(--_0xd04cac){_0x2d90ff['push'](_0x2d90ff['shift']());}};_0x3b1f82(++_0x166b3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var attributes=require(_0x0a9e('0x4'));module[_0x0a9e('0x5')]=function(_0x2ab90b,_0x991246){return _0x2ab90b[_0x0a9e('0x6')]('FaxInteraction',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x441e3a,_0x2cc193,_0x5f41ea){if(_0x441e3a['changed'](_0x0a9e('0x8'))){_0x441e3a['closedAt']=moment()['format'](_0x0a9e('0x9'));}_0x5f41ea(null,_0x441e3a);}}});}; \ No newline at end of file +var _0xa9e0=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','./faxInteraction.attributes','exports','define','fax_interactions','closed'];(function(_0x375fac,_0x353b09){var _0x9d50fe=function(_0x59b5d8){while(--_0x59b5d8){_0x375fac['push'](_0x375fac['shift']());}};_0x9d50fe(++_0x353b09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 attributes=require(_0x0a9e('0x4'));module[_0x0a9e('0x5')]=function(_0x2ab90b,_0x991246){return _0x2ab90b[_0x0a9e('0x6')]('FaxInteraction',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x441e3a,_0x2cc193,_0x5f41ea){if(_0x441e3a['changed'](_0x0a9e('0x8'))){_0x441e3a['closedAt']=moment()['format'](_0x0a9e('0x9'));}_0x5f41ea(null,_0x441e3a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index df215ac..5049d20 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 _0x2782=['jayson/promise','client','http','redis','./faxInteraction.socket','request','then','request\x20sent','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','options','raw','where','limit','debug','stringify','AddTagsToFaxInteraction','find','omit','body','spread','info','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xe8764a,_0x1dc05f){var _0x2838c1=function(_0x1ab0b0){while(--_0x1ab0b0){_0xe8764a['push'](_0xe8764a['shift']());}};_0x2838c1(++_0x1dc05f);}(_0x2782,0x17c));var _0x2278=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0x2782[_0x1a809b];return _0x5d90e6;};'use strict';var _=require(_0x2278('0x0'));var util=require('util');var moment=require(_0x2278('0x1'));var BPromise=require(_0x2278('0x2'));var rs=require(_0x2278('0x3'));var fs=require('fs');var Redis=require(_0x2278('0x4'));var db=require(_0x2278('0x5'))['db'];var utils=require(_0x2278('0x6'));var logger=require(_0x2278('0x7'))(_0x2278('0x8'));var config=require(_0x2278('0x9'));var jayson=require(_0x2278('0xa'));var client=jayson[_0x2278('0xb')][_0x2278('0xc')]({'port':0x232a});config[_0x2278('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2278('0xd')]));require(_0x2278('0xe'))['register'](socket);function respondWithRpcPromise(_0x5a6be4,_0x248aa4,_0x388e59){return new BPromise(function(_0x56b801,_0x478028){return client[_0x2278('0xf')](_0x5a6be4,_0x388e59)[_0x2278('0x10')](function(_0x1a35ef){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x248aa4,_0x2278('0x11'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x248aa4,_0x2278('0x11'),JSON['stringify'](_0x1a35ef));if(_0x1a35ef[_0x2278('0x12')]){if(_0x1a35ef[_0x2278('0x12')][_0x2278('0x13')]===0x1f4){logger['error'](_0x2278('0x14'),_0x248aa4,_0x1a35ef[_0x2278('0x12')][_0x2278('0x15')]);return _0x478028(_0x1a35ef['error'][_0x2278('0x15')]);}logger[_0x2278('0x12')](_0x2278('0x14'),_0x248aa4,_0x1a35ef[_0x2278('0x12')][_0x2278('0x15')]);return _0x56b801(_0x1a35ef[_0x2278('0x12')][_0x2278('0x15')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x248aa4,'request\x20sent');_0x56b801(_0x1a35ef[_0x2278('0x16')][_0x2278('0x15')]);}})[_0x2278('0x17')](function(_0x21cb32){logger[_0x2278('0x12')](_0x2278('0x14'),_0x248aa4,_0x21cb32);_0x478028(_0x21cb32);});});}exports[_0x2278('0x18')]=function(_0x59cd7e){var _0x4a789a=this;return new Promise(function(_0x59258f,_0x3739d3){return db[_0x2278('0x19')]['update'](_0x59cd7e['body'],{'raw':_0x59cd7e[_0x2278('0x1a')]?_0x59cd7e['options'][_0x2278('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59cd7e[_0x2278('0x1a')]?_0x59cd7e['options'][_0x2278('0x1c')]||null:null,'attributes':_0x59cd7e['options']?_0x59cd7e[_0x2278('0x1a')]['attributes']||null:null,'limit':_0x59cd7e[_0x2278('0x1a')]?_0x59cd7e[_0x2278('0x1a')][_0x2278('0x1d')]||null:null})[_0x2278('0x10')](function(_0x17fef6){logger['info'](_0x2278('0x18'),_0x59cd7e);logger[_0x2278('0x1e')](_0x2278('0x18'),_0x59cd7e,JSON[_0x2278('0x1f')](_0x17fef6));_0x59258f(_0x17fef6);})['catch'](function(_0x320fed){logger[_0x2278('0x12')](_0x2278('0x18'),_0x320fed['message'],_0x59cd7e);_0x3739d3(_0x4a789a[_0x2278('0x12')](0x1f4,_0x320fed[_0x2278('0x15')]));});});};exports[_0x2278('0x20')]=function(_0x1ad6ad){return new Promise(function(_0x5f22c2,_0x4eaa47){return db[_0x2278('0x19')][_0x2278('0x21')]({'where':_0x1ad6ad[_0x2278('0x1a')]?_0x1ad6ad['options']['where']||null:null})[_0x2278('0x10')](function(_0x57c8f7){if(_0x57c8f7){return _0x57c8f7['addTags'](_0x1ad6ad['body']['ids'],_[_0x2278('0x22')](_0x1ad6ad[_0x2278('0x23')],['ids','id'])||{});}})[_0x2278('0x24')](function(_0x2a1465){logger[_0x2278('0x25')](_0x2278('0x26'),_0x1ad6ad);logger[_0x2278('0x1e')]('AddTags',_0x1ad6ad,JSON['stringify'](_0x2a1465));_0x5f22c2(_0x2a1465);})[_0x2278('0x17')](function(_0x47c247){logger[_0x2278('0x12')](_0x2278('0x26'),_0x47c247[_0x2278('0x15')],_0x1ad6ad);_0x4eaa47(_this[_0x2278('0x12')](0x1f4,_0x47c247[_0x2278('0x15')]));});});}; \ No newline at end of file +var _0x4a95=['UpdateFaxInteraction','AddTagsToFaxInteraction','find','ids','omit','spread','debug','AddTags','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','error','message','info','catch','FaxInteraction','update','body','options','raw','attributes','limit'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4a95,0x141));var _0x54a9=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4a95[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x54a9('0x0'));var moment=require(_0x54a9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54a9('0x2'));var db=require(_0x54a9('0x3'))['db'];var utils=require(_0x54a9('0x4'));var logger=require(_0x54a9('0x5'))('rpc');var config=require(_0x54a9('0x6'));var jayson=require(_0x54a9('0x7'));var client=jayson[_0x54a9('0x8')][_0x54a9('0x9')]({'port':0x232a});config[_0x54a9('0xa')]=_[_0x54a9('0xb')](config[_0x54a9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x54a9('0xc'))(new Redis(config[_0x54a9('0xa')]));require(_0x54a9('0xd'))[_0x54a9('0xe')](socket);function respondWithRpcPromise(_0x1815a6,_0x203f46,_0x48a2ef){return new BPromise(function(_0x4f57d5,_0x27f18b){return client[_0x54a9('0xf')](_0x1815a6,_0x48a2ef)[_0x54a9('0x10')](function(_0x3cd032){logger['info'](_0x54a9('0x11'),_0x203f46,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x203f46,_0x54a9('0x12'),JSON['stringify'](_0x3cd032));if(_0x3cd032[_0x54a9('0x13')]){if(_0x3cd032[_0x54a9('0x13')]['code']===0x1f4){logger[_0x54a9('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x203f46,_0x3cd032[_0x54a9('0x13')][_0x54a9('0x14')]);return _0x27f18b(_0x3cd032[_0x54a9('0x13')][_0x54a9('0x14')]);}logger[_0x54a9('0x13')](_0x54a9('0x11'),_0x203f46,_0x3cd032[_0x54a9('0x13')][_0x54a9('0x14')]);return _0x4f57d5(_0x3cd032[_0x54a9('0x13')]['message']);}else{logger[_0x54a9('0x15')](_0x54a9('0x11'),_0x203f46,'request\x20sent');_0x4f57d5(_0x3cd032['result'][_0x54a9('0x14')]);}})[_0x54a9('0x16')](function(_0x27edf4){logger[_0x54a9('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x203f46,_0x27edf4);_0x27f18b(_0x27edf4);});});}exports['UpdateFaxInteraction']=function(_0x14fcd9){var _0x93f370=this;return new Promise(function(_0x278eed,_0x8849a8){return db[_0x54a9('0x17')][_0x54a9('0x18')](_0x14fcd9[_0x54a9('0x19')],{'raw':_0x14fcd9[_0x54a9('0x1a')]?_0x14fcd9[_0x54a9('0x1a')][_0x54a9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14fcd9[_0x54a9('0x1a')]?_0x14fcd9[_0x54a9('0x1a')]['where']||null:null,'attributes':_0x14fcd9[_0x54a9('0x1a')]?_0x14fcd9['options'][_0x54a9('0x1c')]||null:null,'limit':_0x14fcd9[_0x54a9('0x1a')]?_0x14fcd9[_0x54a9('0x1a')][_0x54a9('0x1d')]||null:null})[_0x54a9('0x10')](function(_0x5b2bb0){logger[_0x54a9('0x15')](_0x54a9('0x1e'),_0x14fcd9);logger['debug'](_0x54a9('0x1e'),_0x14fcd9,JSON['stringify'](_0x5b2bb0));_0x278eed(_0x5b2bb0);})[_0x54a9('0x16')](function(_0x820c97){logger[_0x54a9('0x13')](_0x54a9('0x1e'),_0x820c97['message'],_0x14fcd9);_0x8849a8(_0x93f370['error'](0x1f4,_0x820c97['message']));});});};exports[_0x54a9('0x1f')]=function(_0x5cb894){return new Promise(function(_0x41a21c,_0x11be50){return db[_0x54a9('0x17')][_0x54a9('0x20')]({'where':_0x5cb894[_0x54a9('0x1a')]?_0x5cb894[_0x54a9('0x1a')]['where']||null:null})[_0x54a9('0x10')](function(_0x9160f0){if(_0x9160f0){return _0x9160f0['addTags'](_0x5cb894['body'][_0x54a9('0x21')],_[_0x54a9('0x22')](_0x5cb894[_0x54a9('0x19')],[_0x54a9('0x21'),'id'])||{});}})[_0x54a9('0x23')](function(_0x1b14b7){logger[_0x54a9('0x15')]('AddTags',_0x5cb894);logger[_0x54a9('0x24')](_0x54a9('0x25'),_0x5cb894,JSON[_0x54a9('0x26')](_0x1b14b7));_0x41a21c(_0x1b14b7);})[_0x54a9('0x16')](function(_0x156a8e){logger['error'](_0x54a9('0x25'),_0x156a8e[_0x54a9('0x14')],_0x5cb894);_0x11be50(_this['error'](0x1f4,_0x156a8e[_0x54a9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a197b79..5952cd5 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 _0xe565=['save','remove','update','emit','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0xe565,0x1af));var _0x5e56=function(_0x5f16c1,_0x49d8f8){_0x5f16c1=_0x5f16c1-0x0;var _0x2e1ada=_0xe565[_0x5f16c1];return _0x2e1ada;};'use strict';var FaxInteractionEvents=require(_0x5e56('0x0'));var events=[_0x5e56('0x1'),_0x5e56('0x2'),_0x5e56('0x3')];function createListener(_0x2bf921,_0x433522){return function(_0x3059c9){_0x433522[_0x5e56('0x4')](_0x2bf921,_0x3059c9);};}function removeListener(_0x5b4493,_0x5eca3f){return function(){FaxInteractionEvents['removeListener'](_0x5b4493,_0x5eca3f);};}exports[_0x5e56('0x5')]=function(_0x4c5628){for(var _0x3e1fc2=0x0,_0x4a4599=events[_0x5e56('0x6')];_0x3e1fc2<_0x4a4599;_0x3e1fc2++){var _0x44d9e8=events[_0x3e1fc2];var _0x45a29b=createListener(_0x5e56('0x7')+_0x44d9e8,_0x4c5628);FaxInteractionEvents['on'](_0x44d9e8,_0x45a29b);}}; \ No newline at end of file +var _0x3eb8=['faxInteraction:','save','remove','emit','removeListener','register','length'];(function(_0x5e56db,_0x37f86e){var _0x2f49c9=function(_0x4838e0){while(--_0x4838e0){_0x5e56db['push'](_0x5e56db['shift']());}};_0x2f49c9(++_0x37f86e);}(_0x3eb8,0x151));var _0x83eb=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x3eb8[_0x307d86];return _0x361745;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x83eb('0x0'),_0x83eb('0x1'),'update'];function createListener(_0x22106f,_0x55490f){return function(_0x2e96e5){_0x55490f[_0x83eb('0x2')](_0x22106f,_0x2e96e5);};}function removeListener(_0x521bbd,_0xca113){return function(){FaxInteractionEvents[_0x83eb('0x3')](_0x521bbd,_0xca113);};}exports[_0x83eb('0x4')]=function(_0x31d20c){for(var _0x40c568=0x0,_0x24b4e9=events[_0x83eb('0x5')];_0x40c568<_0x24b4e9;_0x40c568++){var _0x197c88=events[_0x40c568];var _0x4b1a22=createListener(_0x83eb('0x6')+_0x197c88,_0x31d20c);FaxInteractionEvents['on'](_0x197c88,_0x4b1a22);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index caf28f9..6e2acf7 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 _0xb3a5=['download','post','create','/:id/messages','addMessage','tracked','fax','faxinteraction:update','update','delete','destroy','/:id/tags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download'];(function(_0x571151,_0x4db943){var _0x49b499=function(_0x286adc){while(--_0x286adc){_0x571151['push'](_0x571151['shift']());}};_0x49b499(++_0x4db943);}(_0xb3a5,0x9e));var _0x5b3a=function(_0x119273,_0x2a1f06){_0x119273=_0x119273-0x0;var _0x488a16=_0xb3a5[_0x119273];return _0x488a16;};'use strict';var multer=require(_0x5b3a('0x0'));var util=require('util');var path=require(_0x5b3a('0x1'));var timeout=require(_0x5b3a('0x2'));var express=require(_0x5b3a('0x3'));var router=express[_0x5b3a('0x4')]();var auth=require(_0x5b3a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b3a('0x6'));var controller=require(_0x5b3a('0x7'));router['get']('/',auth[_0x5b3a('0x8')](),controller['index']);router[_0x5b3a('0x9')](_0x5b3a('0xa'),auth[_0x5b3a('0x8')](),controller[_0x5b3a('0xb')]);router[_0x5b3a('0x9')](_0x5b3a('0xc'),auth['isAuthenticated'](),controller[_0x5b3a('0xd')]);router[_0x5b3a('0x9')]('/:id/messages',auth[_0x5b3a('0x8')](),controller[_0x5b3a('0xe')]);router[_0x5b3a('0x9')](_0x5b3a('0xf'),auth[_0x5b3a('0x8')](),controller[_0x5b3a('0x10')]);router[_0x5b3a('0x11')]('/',auth[_0x5b3a('0x8')](),controller[_0x5b3a('0x12')]);router['post'](_0x5b3a('0x13'),auth[_0x5b3a('0x8')](),controller[_0x5b3a('0x14')]);router[_0x5b3a('0x11')]('/:id/tags',auth[_0x5b3a('0x8')](),interaction[_0x5b3a('0x15')]('fax','faxinteraction:addtags'),controller['addTags']);router['put'](_0x5b3a('0xc'),auth[_0x5b3a('0x8')](),interaction[_0x5b3a('0x15')](_0x5b3a('0x16'),_0x5b3a('0x17')),controller[_0x5b3a('0x18')]);router[_0x5b3a('0x19')](_0x5b3a('0xc'),auth[_0x5b3a('0x8')](),interaction[_0x5b3a('0x15')](_0x5b3a('0x16'),'faxinteraction:destroy'),controller[_0x5b3a('0x1a')]);router[_0x5b3a('0x19')](_0x5b3a('0x1b'),auth[_0x5b3a('0x8')](),controller['removeTags']);module[_0x5b3a('0x1c')]=router; \ No newline at end of file +var _0x3f27=['get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','index','isAuthenticated'];(function(_0x4269b5,_0x229da5){var _0x4c5097=function(_0x466a7d){while(--_0x466a7d){_0x4269b5['push'](_0x4269b5['shift']());}};_0x4c5097(++_0x229da5);}(_0x3f27,0x9a));var _0x73f2=function(_0x1af178,_0x4bd762){_0x1af178=_0x1af178-0x0;var _0x3e2566=_0x3f27[_0x1af178];return _0x3e2566;};'use strict';var multer=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var path=require(_0x73f2('0x2'));var timeout=require('connect-timeout');var express=require(_0x73f2('0x3'));var router=express[_0x73f2('0x4')]();var auth=require(_0x73f2('0x5'));var interaction=require(_0x73f2('0x6'));var config=require(_0x73f2('0x7'));var controller=require(_0x73f2('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x73f2('0x9')]);router['get']('/describe',auth[_0x73f2('0xa')](),controller['describe']);router[_0x73f2('0xb')](_0x73f2('0xc'),auth[_0x73f2('0xa')](),controller[_0x73f2('0xd')]);router[_0x73f2('0xb')](_0x73f2('0xe'),auth[_0x73f2('0xa')](),controller[_0x73f2('0xf')]);router['get'](_0x73f2('0x10'),auth[_0x73f2('0xa')](),controller[_0x73f2('0x11')]);router[_0x73f2('0x12')]('/',auth['isAuthenticated'](),controller[_0x73f2('0x13')]);router[_0x73f2('0x12')](_0x73f2('0xe'),auth[_0x73f2('0xa')](),controller[_0x73f2('0x14')]);router[_0x73f2('0x12')]('/:id/tags',auth[_0x73f2('0xa')](),interaction[_0x73f2('0x15')](_0x73f2('0x16'),_0x73f2('0x17')),controller[_0x73f2('0x18')]);router[_0x73f2('0x19')](_0x73f2('0xc'),auth[_0x73f2('0xa')](),interaction[_0x73f2('0x15')]('fax',_0x73f2('0x1a')),controller['update']);router[_0x73f2('0x1b')](_0x73f2('0xc'),auth[_0x73f2('0xa')](),interaction[_0x73f2('0x15')](_0x73f2('0x16'),_0x73f2('0x1c')),controller[_0x73f2('0x1d')]);router[_0x73f2('0x1b')](_0x73f2('0x1e'),auth[_0x73f2('0xa')](),controller[_0x73f2('0x1f')]);module[_0x73f2('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 018eab3..ac12ce3 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 _0x25d7=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x471e93,_0x2a7085){var _0x289d56=function(_0x14087f){while(--_0x14087f){_0x471e93['push'](_0x471e93['shift']());}};_0x289d56(++_0x2a7085);}(_0x25d7,0x136));var _0x725d=function(_0x5be795,_0x1cb1b8){_0x5be795=_0x5be795-0x0;var _0x4e8a3b=_0x25d7[_0x5be795];return _0x4e8a3b;};'use strict';var Sequelize=require(_0x725d('0x0'));module[_0x725d('0x1')]={'body':{'type':Sequelize[_0x725d('0x2')](_0x725d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x725d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x725d('0x5')]('in',_0x725d('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x725d('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x725d('0x7')]}}; \ No newline at end of file +var _0xbb1f=['medium','BOOLEAN','out','sequelize','TEXT'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xbb1f,0x1a7));var _0xfbb1=function(_0x2e2f84,_0x24e46f){_0x2e2f84=_0x2e2f84-0x0;var _0x448191=_0xbb1f[_0x2e2f84];return _0x448191;};'use strict';var Sequelize=require(_0xfbb1('0x0'));module['exports']={'body':{'type':Sequelize[_0xfbb1('0x1')](_0xfbb1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfbb1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfbb1('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xfbb1('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a1454fa..d803114 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 _0x563f=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','redis','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','name','send','index','FaxMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','includeAll','include','findAll','find','body','params','describe','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','interaction','get','role','null','AcceptMessage','manual','interface','SIP/%s','channel','accept','EventManager','../../config/logger','fax-interactions','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','create','findOne','fax','SendFax','FaxAccountId','isNil','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','root','server','files','Attachment','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x82471f,_0x45be84){var _0x2b4b9f=function(_0x3ea41a){while(--_0x3ea41a){_0x82471f['push'](_0x82471f['shift']());}};_0x2b4b9f(++_0x45be84);}(_0x563f,0xf6));var _0xf563=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x563f[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf563('0x0'));var rimraf=require(_0xf563('0x1'));var zipdir=require(_0xf563('0x2'));var jsonpatch=require(_0xf563('0x3'));var rp=require(_0xf563('0x4'));var moment=require(_0xf563('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf563('0x6'));var util=require(_0xf563('0x7'));var path=require(_0xf563('0x8'));var sox=require(_0xf563('0x9'));var csv=require(_0xf563('0xa'));var ejs=require(_0xf563('0xb'));var fs=require('fs');var _=require(_0xf563('0xc'));var squel=require(_0xf563('0xd'));var crypto=require(_0xf563('0xe'));var jsforce=require(_0xf563('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf563('0xa'));var querystring=require('querystring');var Papa=require(_0xf563('0x10'));var authService=require(_0xf563('0x11'));var hardwareService=require(_0xf563('0x12'));var Redis=require('ioredis');var qs=require(_0xf563('0x13'));var logger=require('../../config/logger')(_0xf563('0x14'));var utils=require(_0xf563('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf563('0x16')]=_['defaults'](config[_0xf563('0x16')],{'host':_0xf563('0x17'),'port':0x18eb});var socket=require(_0xf563('0x18'))(new Redis(config['redis']));require(_0xf563('0x19'))['register'](socket);var jayson=require(_0xf563('0x1a'));var client=jayson[_0xf563('0x1b')][_0xf563('0x1c')]({'port':0x232c});var client9002=jayson[_0xf563('0x1b')][_0xf563('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x138196,_0xc039f2,_0x26cb61,_0x5979b0){return new BPromise(function(_0x1d6d2a,_0x4d4a67){var _0x2a59c5=_0x5979b0||client;return _0x2a59c5[_0xf563('0x1d')](_0x138196,_0x26cb61)[_0xf563('0x1e')](function(_0x5b779c){logger[_0xf563('0x1f')](_0xf563('0x20'),_0xc039f2,_0xf563('0x21'));logger[_0xf563('0x22')](_0xf563('0x23'),_0xc039f2,_0xf563('0x21'),JSON[_0xf563('0x24')](_0x5b779c));if(_0x5b779c[_0xf563('0x25')]){if(_0x5b779c[_0xf563('0x25')][_0xf563('0x26')]===0x1f4){logger[_0xf563('0x25')](_0xf563('0x20'),_0xc039f2,_0x5b779c[_0xf563('0x25')]['message']);return _0x4d4a67(_0x5b779c['error'][_0xf563('0x27')]);}logger[_0xf563('0x25')]('FaxMessage,\x20%s,\x20%s',_0xc039f2,_0x5b779c['error'][_0xf563('0x27')]);return _0x1d6d2a(_0x5b779c['error'][_0xf563('0x27')]);}else{logger[_0xf563('0x1f')](_0xf563('0x20'),_0xc039f2,'request\x20sent');_0x1d6d2a(_0x5b779c[_0xf563('0x28')][_0xf563('0x27')]);}})[_0xf563('0x29')](function(_0x187e20){logger[_0xf563('0x25')](_0xf563('0x20'),_0xc039f2,_0x187e20);_0x4d4a67(_0x187e20);});});}function respondWithStatusCode(_0xde8340,_0x4e6aee){_0x4e6aee=_0x4e6aee||0xcc;return function(_0x4a6196){if(_0x4a6196){return _0xde8340[_0xf563('0x2a')](_0x4e6aee);}return _0xde8340[_0xf563('0x2b')](_0x4e6aee)[_0xf563('0x2c')]();};}function respondWithResult(_0x8d9b8b,_0x21450b){_0x21450b=_0x21450b||0xc8;return function(_0x2c394c){if(_0x2c394c){return _0x8d9b8b[_0xf563('0x2b')](_0x21450b)[_0xf563('0x2d')](_0x2c394c);}};}function respondWithFilteredResult(_0x3dd8c1,_0x5be964){return function(_0x5bc500){if(_0x5bc500){var _0x3147db=_0x5bc500[_0xf563('0x2e')],_0x436a7e=_0x5be964[_0xf563('0x2f')],_0x234957=_0x5be964[_0xf563('0x2f')]+_0x5be964[_0xf563('0x30')],_0x5baa4f;if(_0x234957>=_0x3147db){_0x234957=_0x3147db;_0x5baa4f=0xc8;}else{_0x5baa4f=0xce;}_0x3dd8c1[_0xf563('0x2b')](_0x5baa4f);return _0x3dd8c1['set'](_0xf563('0x31'),_0x436a7e+'-'+_0x234957+'/'+_0x3147db)[_0xf563('0x2d')](_0x5bc500);}return null;};}function patchUpdates(_0x3d23e7){return function(_0xc54203){try{jsonpatch[_0xf563('0x32')](_0xc54203,_0x3d23e7,!![]);}catch(_0x44e7a2){return BPromise[_0xf563('0x33')](_0x44e7a2);}return _0xc54203[_0xf563('0x34')]();};}function saveUpdates(_0x1018da,_0x479e4b){return function(_0x1d1ba3){if(_0x1d1ba3){return _0x1d1ba3[_0xf563('0x35')](_0x1018da)[_0xf563('0x1e')](function(_0x7112be){return _0x7112be;});}return null;};}function removeEntity(_0x21a1f2,_0x406142){return function(_0x368327){if(_0x368327){return _0x368327[_0xf563('0x36')]()[_0xf563('0x1e')](function(){_0x21a1f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x510c06,_0x319414){return function(_0x227973){if(!_0x227973){_0x510c06[_0xf563('0x2a')](0x194);}return _0x227973;};}function handleError(_0x25c9d2,_0x34fe8a){_0x34fe8a=_0x34fe8a||0x1f4;return function(_0x314913){logger[_0xf563('0x25')](_0x314913['stack']);if(_0x314913[_0xf563('0x37')]){delete _0x314913[_0xf563('0x37')];}_0x25c9d2['status'](_0x34fe8a)[_0xf563('0x38')](_0x314913);};}exports[_0xf563('0x39')]=function(_0xce505,_0xf755a0){var _0x420c76={},_0x582947={},_0x4425ec={'count':0x0,'rows':[]};var _0x37372e=db[_0xf563('0x3a')][_0xf563('0x3b')];_0x582947[_0xf563('0x3c')]=_[_0xf563('0x3d')](_0x37372e);_0x582947[_0xf563('0x3e')]=_[_0xf563('0x3d')](_0xce505[_0xf563('0x3e')]);_0x582947[_0xf563('0x3f')]=_['intersection'](_0x582947[_0xf563('0x3c')],_0x582947[_0xf563('0x3e')]);_0x420c76[_0xf563('0x40')]=_[_0xf563('0x41')](_0x582947[_0xf563('0x3c')],qs[_0xf563('0x42')](_0xce505[_0xf563('0x3e')][_0xf563('0x42')]));_0x420c76[_0xf563('0x40')]=_0x420c76[_0xf563('0x40')][_0xf563('0x43')]?_0x420c76['attributes']:_0x582947[_0xf563('0x3c')];if(!_0xce505['query'][_0xf563('0x44')](_0xf563('0x45'))){_0x420c76[_0xf563('0x30')]=qs[_0xf563('0x30')](_0xce505[_0xf563('0x3e')][_0xf563('0x30')]);_0x420c76[_0xf563('0x2f')]=qs[_0xf563('0x2f')](_0xce505[_0xf563('0x3e')][_0xf563('0x2f')]);}_0x420c76[_0xf563('0x46')]=qs['sort'](_0xce505['query'][_0xf563('0x47')]);_0x420c76[_0xf563('0x48')]=qs[_0xf563('0x3f')](_[_0xf563('0x49')](_0xce505[_0xf563('0x3e')],_0x582947['filters']));if(_0xce505['query'][_0xf563('0x4a')]){_0x420c76['where']=_[_0xf563('0x4b')](_0x420c76['where'],{'$or':_[_0xf563('0x4c')](_0x37372e,function(_0x23b80f){if(_0x23b80f[_0xf563('0x4d')][_0xf563('0x4e')]!=='VIRTUAL'){var _0x5a2da9={};_0x5a2da9[_0x23b80f[_0xf563('0x4f')]]={'$like':'%'+_0xce505['query'][_0xf563('0x4a')]+'%'};return _0x5a2da9;}})});}_0x420c76=_['merge']({},_0x420c76,_0xce505['options']);var _0x5a6ff5={'where':_0x420c76['where']};return db[_0xf563('0x3a')][_0xf563('0x2e')](_0x5a6ff5)[_0xf563('0x1e')](function(_0x56c368){_0x4425ec[_0xf563('0x2e')]=_0x56c368;if(_0xce505[_0xf563('0x3e')][_0xf563('0x50')]){_0x420c76[_0xf563('0x51')]=[{'all':!![]}];}return db['FaxMessage'][_0xf563('0x52')](_0x420c76);})['then'](function(_0x2a762e){_0x4425ec['rows']=_0x2a762e;return _0x4425ec;})[_0xf563('0x1e')](respondWithFilteredResult(_0xf755a0,_0x420c76))[_0xf563('0x29')](handleError(_0xf755a0,null));};exports['show']=function(_0x177a75,_0x432633){var _0x4450dd={'raw':!![],'where':{'id':_0x177a75['params']['id']}},_0x2dcae9={};_0x2dcae9[_0xf563('0x3c')]=_[_0xf563('0x3d')](db[_0xf563('0x3a')][_0xf563('0x3b')]);_0x2dcae9[_0xf563('0x3e')]=_[_0xf563('0x3d')](_0x177a75[_0xf563('0x3e')]);_0x2dcae9['filters']=_[_0xf563('0x41')](_0x2dcae9[_0xf563('0x3c')],_0x2dcae9[_0xf563('0x3e')]);_0x4450dd[_0xf563('0x40')]=_[_0xf563('0x41')](_0x2dcae9[_0xf563('0x3c')],qs[_0xf563('0x42')](_0x177a75[_0xf563('0x3e')][_0xf563('0x42')]));_0x4450dd[_0xf563('0x40')]=_0x4450dd[_0xf563('0x40')][_0xf563('0x43')]?_0x4450dd['attributes']:_0x2dcae9['model'];if(_0x177a75[_0xf563('0x3e')]['includeAll']){_0x4450dd[_0xf563('0x51')]=[{'all':!![]}];}_0x4450dd=_[_0xf563('0x4b')]({},_0x4450dd,_0x177a75['options']);return db[_0xf563('0x3a')][_0xf563('0x53')](_0x4450dd)['then'](handleEntityNotFound(_0x432633,null))[_0xf563('0x1e')](respondWithResult(_0x432633,null))['catch'](handleError(_0x432633,null));};exports[_0xf563('0x35')]=function(_0x3bd9e8,_0x563a1a){if(_0x3bd9e8[_0xf563('0x54')]['id']){delete _0x3bd9e8[_0xf563('0x54')]['id'];}return db[_0xf563('0x3a')][_0xf563('0x53')]({'where':{'id':_0x3bd9e8[_0xf563('0x55')]['id']}})[_0xf563('0x1e')](handleEntityNotFound(_0x563a1a,null))[_0xf563('0x1e')](saveUpdates(_0x3bd9e8[_0xf563('0x54')],null))[_0xf563('0x1e')](respondWithResult(_0x563a1a,null))[_0xf563('0x29')](handleError(_0x563a1a,null));};exports[_0xf563('0x36')]=function(_0x235bb4,_0x3240f9){return db['FaxMessage'][_0xf563('0x53')]({'where':{'id':_0x235bb4[_0xf563('0x55')]['id']}})['then'](handleEntityNotFound(_0x3240f9,null))[_0xf563('0x1e')](removeEntity(_0x3240f9,null))[_0xf563('0x29')](handleError(_0x3240f9,null));};exports[_0xf563('0x56')]=function(_0x2bfd7a,_0x208fbb){return db['FaxMessage']['describe']()[_0xf563('0x1e')](respondWithResult(_0x208fbb,null))[_0xf563('0x29')](handleError(_0x208fbb,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['accept']=function(_0x2c917c,_0xe55594,_0x554a0b){var _0x2df15f={'channel':'fax'};if(_0x2c917c['body']['id']){delete _0x2c917c[_0xf563('0x54')]['id'];}_0x2c917c[_0xf563('0x54')]['read']=!![];_0x2c917c[_0xf563('0x54')]['readAt']=moment()[_0xf563('0x57')](_0xf563('0x58'));_0x2c917c[_0xf563('0x54')]['UserId']=_0x2c917c[_0xf563('0x54')][_0xf563('0x59')]||_0x2c917c[_0xf563('0x5a')]['id'];return db[_0xf563('0x3a')][_0xf563('0x53')]({'where':{'id':_0x2c917c[_0xf563('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xf563('0x5b')],'as':_0xf563('0x5c')}]})[_0xf563('0x1e')](handleEntityNotFound(_0xe55594,null))['then'](saveUpdates(_0x2c917c[_0xf563('0x54')],null))[_0xf563('0x1e')](function(_0x163a95){if(_0x163a95){_0x2df15f[_0xf563('0x27')]=_0x163a95['get']({'plain':!![]});return db[_0xf563('0x5d')][_0xf563('0x53')]({'where':{'id':_0x163a95['FaxInteractionId']}});}return null;})[_0xf563('0x1e')](handleEntityNotFound(_0xe55594,null))[_0xf563('0x1e')](function(_0xfecccc){if(_0xfecccc){return _0xfecccc[_0xf563('0x35')]({'UserId':_0x2c917c[_0xf563('0x54')]['UserId'],'read1stAt':_['isNil'](_0xfecccc['read1stAt'])?moment()['format'](_0xf563('0x58')):undefined});}return null;})['then'](function(_0x391d5a){if(_0x391d5a){_0x2df15f[_0xf563('0x5e')]=_0x391d5a[_0xf563('0x5f')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c917c['user']['id'],_0x2c917c[_0xf563('0x5a')][_0xf563('0x37')],_0x2c917c[_0xf563('0x5a')][_0xf563('0x60')],_0x2df15f['interaction']['id'],_0x2c917c[_0xf563('0x54')]?JSON[_0xf563('0x24')](_0x2c917c[_0xf563('0x54')]):_0xf563('0x61'));return respondWithRpcPromise(_0xf563('0x62'),'acceptMessage',_0x2df15f);}return null;})[_0xf563('0x1e')](function(_0x223ff5){if(_0x223ff5){if(_0x2c917c['body'][_0xf563('0x63')]){_0x2df15f['message'][_0xf563('0x64')]=util[_0xf563('0x57')](_0xf563('0x65'),_0x2c917c['user'][_0xf563('0x37')]);_0x2df15f['message'][_0xf563('0x66')]=_0x2df15f[_0xf563('0x66')];_0x2df15f[_0xf563('0x27')]['event']=_0xf563('0x67');return respondWithRpcPromise(_0xf563('0x68'),'EventManager',{'event':'acceptmessage','message':_0x2df15f[_0xf563('0x27')]},client9002)[_0xf563('0x1e')](function(){return _0x2df15f;});}return _0x2df15f;}return null;})[_0xf563('0x1e')](respondWithResult(_0xe55594,null))['catch'](handleError(_0xe55594,null));};var interaction_log=require(_0xf563('0x69'))(_0xf563('0x6a'));exports[_0xf563('0x33')]=function(_0x5296ba,_0x387715,_0x4efc4d){var _0x64d486={'agent':{},'channel':'fax'};if(_0x5296ba[_0xf563('0x54')]['id']){delete _0x5296ba[_0xf563('0x54')]['id'];}_0x5296ba[_0xf563('0x54')][_0xf563('0x59')]=_0x5296ba[_0xf563('0x54')][_0xf563('0x59')]||_0x5296ba[_0xf563('0x5a')]['id'];_0x64d486[_0xf563('0x6b')]['id']=_0x5296ba[_0xf563('0x54')]['UserId'];return db[_0xf563('0x3a')][_0xf563('0x53')]({'where':{'id':_0x5296ba[_0xf563('0x55')]['id'],'UserId':null}})[_0xf563('0x1e')](handleEntityNotFound(_0x387715,null))[_0xf563('0x1e')](function(_0x48e2cd){if(_0x48e2cd){_0x64d486[_0xf563('0x27')]=_0x48e2cd[_0xf563('0x5f')]({'plain':!![]});return db[_0xf563('0x5d')][_0xf563('0x53')]({'where':{'id':_0x48e2cd[_0xf563('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x387715,null))[_0xf563('0x1e')](function(_0x2fdf98){if(_0x2fdf98){_0x64d486[_0xf563('0x5e')]=_0x2fdf98[_0xf563('0x5f')]({'plain':!![]});interaction_log['info'](_0xf563('0x6d'),_0x5296ba[_0xf563('0x5a')]['id'],_0x5296ba[_0xf563('0x5a')][_0xf563('0x37')],_0x5296ba['user'][_0xf563('0x60')],_0x64d486[_0xf563('0x5e')]['id'],_0x5296ba['body']?JSON[_0xf563('0x24')](_0x5296ba[_0xf563('0x54')]):_0xf563('0x61'));return respondWithRpcPromise(_0xf563('0x6e'),'rejectMessage',_0x64d486);}return null;})['then'](function(_0x53f8b4){if(_0x53f8b4){_0x53f8b4[_0xf563('0x27')][_0xf563('0x64')]=util['format'](_0xf563('0x65'),_0x5296ba[_0xf563('0x5a')][_0xf563('0x37')]);_0x53f8b4[_0xf563('0x27')]['channel']=_0x64d486[_0xf563('0x66')];_0x53f8b4[_0xf563('0x27')]['event']=_0xf563('0x33');respondWithRpcPromise(_0xf563('0x68'),_0xf563('0x68'),{'event':_0xf563('0x6f'),'message':_0x53f8b4[_0xf563('0x27')]},client9002);return _0x64d486;}return null;})['then'](respondWithResult(_0x387715,null))[_0xf563('0x29')](handleError(_0x387715,null));};exports['create']=function(_0xa66bc3,_0x10456e){var _0x259a2e;return db[_0xf563('0x3a')][_0xf563('0x70')](_0xa66bc3[_0xf563('0x54')],{})[_0xf563('0x1e')](function(_0x5287f5){_0x259a2e=_0x5287f5;return db[_0xf563('0x5b')][_0xf563('0x71')]({'where':{'id':_0x259a2e['ContactId']}});})[_0xf563('0x1e')](function(_0x352d9b){if(_['isNil'](_0x352d9b)){return;}else{_0x259a2e[_0xf563('0x72')]=_0x352d9b['fax'];return db['Attachment'][_0xf563('0x71')]({'where':{'id':_0x259a2e['AttachmentId']}});}})[_0xf563('0x1e')](function(_0x2f7362){return respondWithRpcPromise(_0xf563('0x73'),_0xf563('0x73'),{'FaxAccountId':_['isNil'](_0xa66bc3[_0xf563('0x54')])?undefined:_0xa66bc3[_0xf563('0x54')][_0xf563('0x74')],'path':_[_0xf563('0x75')](_0x2f7362)?undefined:util[_0xf563('0x57')](_0xf563('0x76'),_0x2f7362[_0xf563('0x77')]),'fax':_['isNil'](_0x259a2e['fax'])?undefined:_0x259a2e[_0xf563('0x72')],'AttachmentId':_0x259a2e[_0xf563('0x78')]},client9002);})[_0xf563('0x1e')](respondWithResult(_0x10456e,0xc9))[_0xf563('0x29')](handleError(_0x10456e,null));};exports[_0xf563('0x79')]=function(_0x25cc12,_0xa9977b){var _0x4fac36=path['join'](config[_0xf563('0x7a')],_0xf563('0x7b'),_0xf563('0x7c'),'attachments');return db['FaxMessage']['find']({'where':{'id':_0x25cc12[_0xf563('0x55')]['id']},'include':[{'model':db[_0xf563('0x7d')],'as':_0xf563('0x7d')}]})['then'](handleEntityNotFound(_0xa9977b,null))[_0xf563('0x1e')](function(_0x5dde86){if(_0x5dde86){return _0xa9977b[_0xf563('0x79')](path[_0xf563('0x7e')](_0x4fac36,_0x5dde86[_0xf563('0x7d')]['basename']));}})['catch'](handleError(_0xa9977b,null));}; \ No newline at end of file +var _0x26c3=['FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','download','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','json','count','offset','limit','status','set','reject','save','update','destroy','end','sendStatus','stack','name','send','index','FaxMessage','rawAttributes','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','include','rows','params','includeAll','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','SIP/%s','channel','event','agent','FaxInteraction','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','EventManager','rejectmessage','findOne','Attachment','AttachmentId','SendFax'];(function(_0x230c53,_0x488a8a){var _0x397074=function(_0x25a3c4){while(--_0x25a3c4){_0x230c53['push'](_0x230c53['shift']());}};_0x397074(++_0x488a8a);}(_0x26c3,0x18d));var _0x326c=function(_0x5c5962,_0x272e0b){_0x5c5962=_0x5c5962-0x0;var _0x332fd3=_0x26c3[_0x5c5962];return _0x332fd3;};'use strict';var pdf=require(_0x326c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x326c('0x1'));var zipdir=require(_0x326c('0x2'));var jsonpatch=require(_0x326c('0x3'));var rp=require(_0x326c('0x4'));var moment=require(_0x326c('0x5'));var BPromise=require(_0x326c('0x6'));var Mustache=require('mustache');var util=require(_0x326c('0x7'));var path=require('path');var sox=require(_0x326c('0x8'));var csv=require(_0x326c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x326c('0xa'));var crypto=require(_0x326c('0xb'));var jsforce=require(_0x326c('0xc'));var deskjs=require(_0x326c('0xd'));var toCsv=require(_0x326c('0x9'));var querystring=require(_0x326c('0xe'));var Papa=require(_0x326c('0xf'));var authService=require(_0x326c('0x10'));var hardwareService=require(_0x326c('0x11'));var Redis=require(_0x326c('0x12'));var qs=require(_0x326c('0x13'));var logger=require(_0x326c('0x14'))(_0x326c('0x15'));var utils=require(_0x326c('0x16'));var config=require(_0x326c('0x17'));var db=require(_0x326c('0x18'))['db'];config[_0x326c('0x19')]=_[_0x326c('0x1a')](config[_0x326c('0x19')],{'host':_0x326c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x326c('0x19')]));require('./faxMessage.socket')[_0x326c('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x326c('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x326c('0x1d')][_0x326c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2888af,_0x26acff,_0x2d67b3,_0x195c93){return new BPromise(function(_0x937eb5,_0x1f2ef1){var _0x4dd227=_0x195c93||client;return _0x4dd227[_0x326c('0x1f')](_0x2888af,_0x2d67b3)[_0x326c('0x20')](function(_0x4ff9b1){logger[_0x326c('0x21')](_0x326c('0x22'),_0x26acff,_0x326c('0x23'));logger[_0x326c('0x24')](_0x326c('0x25'),_0x26acff,_0x326c('0x23'),JSON['stringify'](_0x4ff9b1));if(_0x4ff9b1[_0x326c('0x26')]){if(_0x4ff9b1['error'][_0x326c('0x27')]===0x1f4){logger[_0x326c('0x26')](_0x326c('0x22'),_0x26acff,_0x4ff9b1[_0x326c('0x26')]['message']);return _0x1f2ef1(_0x4ff9b1[_0x326c('0x26')][_0x326c('0x28')]);}logger['error'](_0x326c('0x22'),_0x26acff,_0x4ff9b1[_0x326c('0x26')][_0x326c('0x28')]);return _0x937eb5(_0x4ff9b1[_0x326c('0x26')][_0x326c('0x28')]);}else{logger['info'](_0x326c('0x22'),_0x26acff,_0x326c('0x23'));_0x937eb5(_0x4ff9b1[_0x326c('0x29')][_0x326c('0x28')]);}})[_0x326c('0x2a')](function(_0x21c40b){logger['error'](_0x326c('0x22'),_0x26acff,_0x21c40b);_0x1f2ef1(_0x21c40b);});});}function respondWithStatusCode(_0x535373,_0x239297){_0x239297=_0x239297||0xcc;return function(_0x2791c3){if(_0x2791c3){return _0x535373['sendStatus'](_0x239297);}return _0x535373['status'](_0x239297)['end']();};}function respondWithResult(_0x45ee8d,_0x437f49){_0x437f49=_0x437f49||0xc8;return function(_0x17ee93){if(_0x17ee93){return _0x45ee8d['status'](_0x437f49)[_0x326c('0x2b')](_0x17ee93);}};}function respondWithFilteredResult(_0x449ca6,_0x1a2969){return function(_0x304bb4){if(_0x304bb4){var _0x20506e=_0x304bb4[_0x326c('0x2c')],_0x18c760=_0x1a2969['offset'],_0x57b108=_0x1a2969[_0x326c('0x2d')]+_0x1a2969[_0x326c('0x2e')],_0x215ec4;if(_0x57b108>=_0x20506e){_0x57b108=_0x20506e;_0x215ec4=0xc8;}else{_0x215ec4=0xce;}_0x449ca6[_0x326c('0x2f')](_0x215ec4);return _0x449ca6[_0x326c('0x30')]('Content-Range',_0x18c760+'-'+_0x57b108+'/'+_0x20506e)[_0x326c('0x2b')](_0x304bb4);}return null;};}function patchUpdates(_0xe8cc93){return function(_0x36f57c){try{jsonpatch['apply'](_0x36f57c,_0xe8cc93,!![]);}catch(_0x5958f0){return BPromise[_0x326c('0x31')](_0x5958f0);}return _0x36f57c[_0x326c('0x32')]();};}function saveUpdates(_0x35947b,_0x2c895d){return function(_0x6b5475){if(_0x6b5475){return _0x6b5475[_0x326c('0x33')](_0x35947b)[_0x326c('0x20')](function(_0xdb4a58){return _0xdb4a58;});}return null;};}function removeEntity(_0x19ee26,_0x469585){return function(_0x2e02d3){if(_0x2e02d3){return _0x2e02d3[_0x326c('0x34')]()['then'](function(){_0x19ee26[_0x326c('0x2f')](0xcc)[_0x326c('0x35')]();});}};}function handleEntityNotFound(_0x12a89c,_0x3378e4){return function(_0x17e34a){if(!_0x17e34a){_0x12a89c[_0x326c('0x36')](0x194);}return _0x17e34a;};}function handleError(_0x53b651,_0x273868){_0x273868=_0x273868||0x1f4;return function(_0x58382e){logger[_0x326c('0x26')](_0x58382e[_0x326c('0x37')]);if(_0x58382e[_0x326c('0x38')]){delete _0x58382e[_0x326c('0x38')];}_0x53b651[_0x326c('0x2f')](_0x273868)[_0x326c('0x39')](_0x58382e);};}exports[_0x326c('0x3a')]=function(_0x5afd0d,_0x251a20){var _0x543181={},_0x35c1a9={},_0x10cc03={'count':0x0,'rows':[]};var _0xc59e8f=db[_0x326c('0x3b')][_0x326c('0x3c')];_0x35c1a9[_0x326c('0x3d')]=_['keys'](_0xc59e8f);_0x35c1a9['query']=_[_0x326c('0x3e')](_0x5afd0d['query']);_0x35c1a9['filters']=_[_0x326c('0x3f')](_0x35c1a9[_0x326c('0x3d')],_0x35c1a9[_0x326c('0x40')]);_0x543181['attributes']=_['intersection'](_0x35c1a9['model'],qs[_0x326c('0x41')](_0x5afd0d[_0x326c('0x40')][_0x326c('0x41')]));_0x543181[_0x326c('0x42')]=_0x543181[_0x326c('0x42')][_0x326c('0x43')]?_0x543181[_0x326c('0x42')]:_0x35c1a9[_0x326c('0x3d')];if(!_0x5afd0d[_0x326c('0x40')][_0x326c('0x44')](_0x326c('0x45'))){_0x543181[_0x326c('0x2e')]=qs['limit'](_0x5afd0d[_0x326c('0x40')]['limit']);_0x543181[_0x326c('0x2d')]=qs[_0x326c('0x2d')](_0x5afd0d[_0x326c('0x40')][_0x326c('0x2d')]);}_0x543181[_0x326c('0x46')]=qs[_0x326c('0x47')](_0x5afd0d[_0x326c('0x40')]['sort']);_0x543181[_0x326c('0x48')]=qs[_0x326c('0x49')](_[_0x326c('0x4a')](_0x5afd0d[_0x326c('0x40')],_0x35c1a9[_0x326c('0x49')]));if(_0x5afd0d['query'][_0x326c('0x4b')]){_0x543181[_0x326c('0x48')]=_[_0x326c('0x4c')](_0x543181[_0x326c('0x48')],{'$or':_['map'](_0xc59e8f,function(_0x227a0a){if(_0x227a0a[_0x326c('0x4d')][_0x326c('0x4e')]!==_0x326c('0x4f')){var _0x4fd5a2={};_0x4fd5a2[_0x227a0a[_0x326c('0x50')]]={'$like':'%'+_0x5afd0d[_0x326c('0x40')][_0x326c('0x4b')]+'%'};return _0x4fd5a2;}})});}_0x543181=_[_0x326c('0x4c')]({},_0x543181,_0x5afd0d[_0x326c('0x51')]);var _0x423d56={'where':_0x543181[_0x326c('0x48')]};return db[_0x326c('0x3b')][_0x326c('0x2c')](_0x423d56)[_0x326c('0x20')](function(_0x12b93c){_0x10cc03['count']=_0x12b93c;if(_0x5afd0d[_0x326c('0x40')]['includeAll']){_0x543181[_0x326c('0x52')]=[{'all':!![]}];}return db[_0x326c('0x3b')]['findAll'](_0x543181);})[_0x326c('0x20')](function(_0x274c59){_0x10cc03[_0x326c('0x53')]=_0x274c59;return _0x10cc03;})['then'](respondWithFilteredResult(_0x251a20,_0x543181))['catch'](handleError(_0x251a20,null));};exports['show']=function(_0x3b7f03,_0x134a45){var _0x4cba6f={'raw':!![],'where':{'id':_0x3b7f03[_0x326c('0x54')]['id']}},_0x203ae0={};_0x203ae0[_0x326c('0x3d')]=_['keys'](db[_0x326c('0x3b')][_0x326c('0x3c')]);_0x203ae0['query']=_[_0x326c('0x3e')](_0x3b7f03[_0x326c('0x40')]);_0x203ae0[_0x326c('0x49')]=_[_0x326c('0x3f')](_0x203ae0['model'],_0x203ae0[_0x326c('0x40')]);_0x4cba6f[_0x326c('0x42')]=_['intersection'](_0x203ae0[_0x326c('0x3d')],qs[_0x326c('0x41')](_0x3b7f03[_0x326c('0x40')][_0x326c('0x41')]));_0x4cba6f[_0x326c('0x42')]=_0x4cba6f[_0x326c('0x42')][_0x326c('0x43')]?_0x4cba6f[_0x326c('0x42')]:_0x203ae0[_0x326c('0x3d')];if(_0x3b7f03['query'][_0x326c('0x55')]){_0x4cba6f['include']=[{'all':!![]}];}_0x4cba6f=_[_0x326c('0x4c')]({},_0x4cba6f,_0x3b7f03['options']);return db[_0x326c('0x3b')][_0x326c('0x56')](_0x4cba6f)['then'](handleEntityNotFound(_0x134a45,null))[_0x326c('0x20')](respondWithResult(_0x134a45,null))['catch'](handleError(_0x134a45,null));};exports[_0x326c('0x33')]=function(_0x219ee3,_0x413a5b){if(_0x219ee3[_0x326c('0x57')]['id']){delete _0x219ee3[_0x326c('0x57')]['id'];}return db[_0x326c('0x3b')][_0x326c('0x56')]({'where':{'id':_0x219ee3[_0x326c('0x54')]['id']}})[_0x326c('0x20')](handleEntityNotFound(_0x413a5b,null))[_0x326c('0x20')](saveUpdates(_0x219ee3['body'],null))[_0x326c('0x20')](respondWithResult(_0x413a5b,null))[_0x326c('0x2a')](handleError(_0x413a5b,null));};exports[_0x326c('0x34')]=function(_0x49f768,_0x536377){return db[_0x326c('0x3b')][_0x326c('0x56')]({'where':{'id':_0x49f768['params']['id']}})[_0x326c('0x20')](handleEntityNotFound(_0x536377,null))[_0x326c('0x20')](removeEntity(_0x536377,null))[_0x326c('0x2a')](handleError(_0x536377,null));};exports[_0x326c('0x58')]=function(_0x1504f6,_0x5c3291){return db[_0x326c('0x3b')][_0x326c('0x58')]()[_0x326c('0x20')](respondWithResult(_0x5c3291,null))[_0x326c('0x2a')](handleError(_0x5c3291,null));};var interaction_log=require(_0x326c('0x14'))(_0x326c('0x59'));exports[_0x326c('0x5a')]=function(_0x3d2e41,_0x27ed23,_0x457262){var _0x17f76c={'channel':_0x326c('0x5b')};if(_0x3d2e41['body']['id']){delete _0x3d2e41[_0x326c('0x57')]['id'];}_0x3d2e41[_0x326c('0x57')][_0x326c('0x5c')]=!![];_0x3d2e41[_0x326c('0x57')][_0x326c('0x5d')]=moment()[_0x326c('0x5e')](_0x326c('0x5f'));_0x3d2e41['body'][_0x326c('0x60')]=_0x3d2e41[_0x326c('0x57')][_0x326c('0x60')]||_0x3d2e41[_0x326c('0x61')]['id'];return db[_0x326c('0x3b')][_0x326c('0x56')]({'where':{'id':_0x3d2e41[_0x326c('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x326c('0x62')],'as':_0x326c('0x63')}]})['then'](handleEntityNotFound(_0x27ed23,null))[_0x326c('0x20')](saveUpdates(_0x3d2e41[_0x326c('0x57')],null))['then'](function(_0x5969cb){if(_0x5969cb){_0x17f76c['message']=_0x5969cb['get']({'plain':!![]});return db['FaxInteraction'][_0x326c('0x56')]({'where':{'id':_0x5969cb['FaxInteractionId']}});}return null;})[_0x326c('0x20')](handleEntityNotFound(_0x27ed23,null))[_0x326c('0x20')](function(_0x3a7a3e){if(_0x3a7a3e){return _0x3a7a3e[_0x326c('0x33')]({'UserId':_0x3d2e41[_0x326c('0x57')]['UserId'],'read1stAt':_[_0x326c('0x64')](_0x3a7a3e[_0x326c('0x65')])?moment()[_0x326c('0x5e')](_0x326c('0x5f')):undefined});}return null;})[_0x326c('0x20')](function(_0x511caa){if(_0x511caa){_0x17f76c[_0x326c('0x66')]=_0x511caa['get']({'plain':!![]});interaction_log['info'](_0x326c('0x67'),_0x3d2e41[_0x326c('0x61')]['id'],_0x3d2e41[_0x326c('0x61')][_0x326c('0x38')],_0x3d2e41[_0x326c('0x61')][_0x326c('0x68')],_0x17f76c[_0x326c('0x66')]['id'],_0x3d2e41['body']?JSON['stringify'](_0x3d2e41[_0x326c('0x57')]):_0x326c('0x69'));return respondWithRpcPromise(_0x326c('0x6a'),'acceptMessage',_0x17f76c);}return null;})[_0x326c('0x20')](function(_0x27c54a){if(_0x27c54a){if(_0x3d2e41['body'][_0x326c('0x6b')]){_0x17f76c[_0x326c('0x28')][_0x326c('0x6c')]=util[_0x326c('0x5e')](_0x326c('0x6d'),_0x3d2e41[_0x326c('0x61')]['name']);_0x17f76c['message'][_0x326c('0x6e')]=_0x17f76c[_0x326c('0x6e')];_0x17f76c[_0x326c('0x28')][_0x326c('0x6f')]=_0x326c('0x5a');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x17f76c['message']},client9002)[_0x326c('0x20')](function(){return _0x17f76c;});}return _0x17f76c;}return null;})[_0x326c('0x20')](respondWithResult(_0x27ed23,null))[_0x326c('0x2a')](handleError(_0x27ed23,null));};var interaction_log=require(_0x326c('0x14'))(_0x326c('0x59'));exports['reject']=function(_0x386f8f,_0xe6080d,_0x283fc1){var _0x3c725d={'agent':{},'channel':_0x326c('0x5b')};if(_0x386f8f[_0x326c('0x57')]['id']){delete _0x386f8f[_0x326c('0x57')]['id'];}_0x386f8f[_0x326c('0x57')]['UserId']=_0x386f8f[_0x326c('0x57')][_0x326c('0x60')]||_0x386f8f[_0x326c('0x61')]['id'];_0x3c725d[_0x326c('0x70')]['id']=_0x386f8f[_0x326c('0x57')][_0x326c('0x60')];return db[_0x326c('0x3b')]['find']({'where':{'id':_0x386f8f[_0x326c('0x54')]['id'],'UserId':null}})[_0x326c('0x20')](handleEntityNotFound(_0xe6080d,null))['then'](function(_0x7b411a){if(_0x7b411a){_0x3c725d[_0x326c('0x28')]=_0x7b411a['get']({'plain':!![]});return db[_0x326c('0x71')][_0x326c('0x56')]({'where':{'id':_0x7b411a['FaxInteractionId']}});}return null;})[_0x326c('0x20')](handleEntityNotFound(_0xe6080d,null))[_0x326c('0x20')](function(_0x3179b0){if(_0x3179b0){_0x3c725d[_0x326c('0x66')]=_0x3179b0[_0x326c('0x72')]({'plain':!![]});interaction_log[_0x326c('0x21')](_0x326c('0x73'),_0x386f8f[_0x326c('0x61')]['id'],_0x386f8f[_0x326c('0x61')][_0x326c('0x38')],_0x386f8f['user'][_0x326c('0x68')],_0x3c725d[_0x326c('0x66')]['id'],_0x386f8f[_0x326c('0x57')]?JSON['stringify'](_0x386f8f['body']):_0x326c('0x69'));return respondWithRpcPromise('RejectMessage',_0x326c('0x74'),_0x3c725d);}return null;})[_0x326c('0x20')](function(_0x1e119e){if(_0x1e119e){_0x1e119e[_0x326c('0x28')]['interface']=util['format'](_0x326c('0x6d'),_0x386f8f[_0x326c('0x61')][_0x326c('0x38')]);_0x1e119e[_0x326c('0x28')][_0x326c('0x6e')]=_0x3c725d[_0x326c('0x6e')];_0x1e119e['message']['event']=_0x326c('0x31');respondWithRpcPromise('EventManager',_0x326c('0x75'),{'event':_0x326c('0x76'),'message':_0x1e119e[_0x326c('0x28')]},client9002);return _0x3c725d;}return null;})[_0x326c('0x20')](respondWithResult(_0xe6080d,null))[_0x326c('0x2a')](handleError(_0xe6080d,null));};exports['create']=function(_0x5abc88,_0x250208){var _0x44e8bf;return db[_0x326c('0x3b')]['create'](_0x5abc88['body'],{})[_0x326c('0x20')](function(_0x1fd977){_0x44e8bf=_0x1fd977;return db[_0x326c('0x62')][_0x326c('0x77')]({'where':{'id':_0x44e8bf['ContactId']}});})[_0x326c('0x20')](function(_0x2e0a06){if(_[_0x326c('0x64')](_0x2e0a06)){return;}else{_0x44e8bf[_0x326c('0x5b')]=_0x2e0a06[_0x326c('0x5b')];return db[_0x326c('0x78')][_0x326c('0x77')]({'where':{'id':_0x44e8bf[_0x326c('0x79')]}});}})['then'](function(_0x255998){return respondWithRpcPromise('SendFax',_0x326c('0x7a'),{'FaxAccountId':_[_0x326c('0x64')](_0x5abc88[_0x326c('0x57')])?undefined:_0x5abc88['body'][_0x326c('0x7b')],'path':_[_0x326c('0x64')](_0x255998)?undefined:util[_0x326c('0x5e')](_0x326c('0x7c'),_0x255998[_0x326c('0x7d')]),'fax':_[_0x326c('0x64')](_0x44e8bf['fax'])?undefined:_0x44e8bf['fax'],'AttachmentId':_0x44e8bf['AttachmentId']},client9002);})['then'](respondWithResult(_0x250208,0xc9))[_0x326c('0x2a')](handleError(_0x250208,null));};exports['download']=function(_0x1e6fdf,_0x538777){var _0x1be099=path[_0x326c('0x7e')](config[_0x326c('0x7f')],_0x326c('0x80'),'files','attachments');return db[_0x326c('0x3b')]['find']({'where':{'id':_0x1e6fdf[_0x326c('0x54')]['id']},'include':[{'model':db[_0x326c('0x78')],'as':'Attachment'}]})[_0x326c('0x20')](handleEntityNotFound(_0x538777,null))[_0x326c('0x20')](function(_0xd89670){if(_0xd89670){return _0x538777[_0x326c('0x81')](path[_0x326c('0x7e')](_0x1be099,_0xd89670[_0x326c('0x78')]['basename']));}})[_0x326c('0x2a')](handleError(_0x538777,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 6fbaf09..e2c42ce 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 _0xd5d7=['emit','hook','events','FaxMessage','update','remove'];(function(_0x53f384,_0x4f00ec){var _0x2ebfca=function(_0x2cf14c){while(--_0x2cf14c){_0x53f384['push'](_0x53f384['shift']());}};_0x2ebfca(++_0x4f00ec);}(_0xd5d7,0x8c));var _0x7d5d=function(_0x13fab7,_0x16ab88){_0x13fab7=_0x13fab7-0x0;var _0x81eaec=_0xd5d7[_0x13fab7];return _0x81eaec;};'use strict';var EventEmitter=require(_0x7d5d('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7d5d('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d5d('0x2'),'afterDestroy':_0x7d5d('0x3')};function emitEvent(_0xda133f){return function(_0x1d7b25,_0x523ab2,_0x2a96e0){FaxMessageEvents[_0x7d5d('0x4')](_0xda133f+':'+_0x1d7b25['id'],_0x1d7b25);FaxMessageEvents['emit'](_0xda133f,_0x1d7b25);_0x2a96e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x7d5d('0x5')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xcc17=['setMaxListeners','remove','emit','hook','exports','events'];(function(_0x513823,_0x44e49f){var _0x183abe=function(_0x582c44){while(--_0x582c44){_0x513823['push'](_0x513823['shift']());}};_0x183abe(++_0x44e49f);}(_0xcc17,0x8f));var _0x7cc1=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0xcc17[_0x28407a];return _0x8bd6ef;};'use strict';var EventEmitter=require(_0x7cc1('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7cc1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7cc1('0x2')};function emitEvent(_0x159eee){return function(_0x2346fa,_0x1ca436,_0x43ed22){FaxMessageEvents[_0x7cc1('0x3')](_0x159eee+':'+_0x2346fa['id'],_0x2346fa);FaxMessageEvents[_0x7cc1('0x3')](_0x159eee,_0x2346fa);_0x43ed22(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x7cc1('0x4')](e,emitEvent(event));}}module[_0x7cc1('0x5')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index c887bde..a83e211 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 _0x4b59=['secret','UserId','findOne','FaxInteractionId','then','update','createdAt','body','utf8mb4','utf8mb4_unicode_ci','api','moment','request-promise','FaxMessage','models','toLowerCase','out'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x4b59,0x11a));var _0x94b5=function(_0x3d8240,_0x2663d4){_0x3d8240=_0x3d8240-0x0;var _0x3d0372=_0x4b59[_0x3d8240];return _0x3d0372;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x94b5('0x0'));var moment=require(_0x94b5('0x1'));var BPromise=require('bluebird');var rp=require(_0x94b5('0x2'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x36e4e4,_0x588246){return _0x36e4e4['define'](_0x94b5('0x3'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x38e628,_0x952ccf,_0x18cb99){var _0x267840=_0x36e4e4[_0x94b5('0x4')];var _0x4348f4=_0x38e628['get']({'plain':!![]});if(_0x4348f4['direction'][_0x94b5('0x5')]()==='in'||_0x4348f4['direction'][_0x94b5('0x5')]()===_0x94b5('0x6')&&!_0x4348f4[_0x94b5('0x7')]&&!_['isNil'](_0x4348f4[_0x94b5('0x8')])){_0x267840['FaxInteraction'][_0x94b5('0x9')]({'where':{'id':_0x4348f4[_0x94b5('0xa')]}})[_0x94b5('0xb')](function(_0x9d49e5){if(_0x9d49e5){_0x9d49e5[_0x94b5('0xc')]({'lastMsgAt':_0x4348f4[_0x94b5('0xd')],'lastMsgDirection':_0x4348f4['direction'][_0x94b5('0x5')](),'lastMsgBody':_0x4348f4[_0x94b5('0xe')]});}})['catch'](function(_0x57b37b){console['error'](_0x57b37b);});}_0x18cb99();}},'charset':_0x94b5('0xf'),'collate':_0x94b5('0x10')});}; \ No newline at end of file +var _0xa1a0=['fax_messages','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','body','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxMessage.attributes','exports','define'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0xa1a0,0x170));var _0x0a1a=function(_0x30b094,_0x555417){_0x30b094=_0x30b094-0x0;var _0x4337f3=_0xa1a0[_0x30b094];return _0x4337f3;};'use strict';var _=require(_0x0a1a('0x0'));var util=require(_0x0a1a('0x1'));var logger=require(_0x0a1a('0x2'))(_0x0a1a('0x3'));var moment=require(_0x0a1a('0x4'));var BPromise=require(_0x0a1a('0x5'));var rp=require(_0x0a1a('0x6'));var attributes=require(_0x0a1a('0x7'));module[_0x0a1a('0x8')]=function(_0x309be8,_0x209dad){return _0x309be8[_0x0a1a('0x9')]('FaxMessage',attributes,{'tableName':_0x0a1a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bf88d,_0x68d07b,_0x555331){var _0x3afc8c=_0x309be8[_0x0a1a('0xb')];var _0x360f88=_0x1bf88d[_0x0a1a('0xc')]({'plain':!![]});if(_0x360f88[_0x0a1a('0xd')][_0x0a1a('0xe')]()==='in'||_0x360f88[_0x0a1a('0xd')][_0x0a1a('0xe')]()===_0x0a1a('0xf')&&!_0x360f88[_0x0a1a('0x10')]&&!_['isNil'](_0x360f88[_0x0a1a('0x11')])){_0x3afc8c[_0x0a1a('0x12')]['findOne']({'where':{'id':_0x360f88[_0x0a1a('0x13')]}})[_0x0a1a('0x14')](function(_0x3fbebe){if(_0x3fbebe){_0x3fbebe[_0x0a1a('0x15')]({'lastMsgAt':_0x360f88[_0x0a1a('0x16')],'lastMsgDirection':_0x360f88['direction'][_0x0a1a('0xe')](),'lastMsgBody':_0x360f88[_0x0a1a('0x17')]});}})[_0x0a1a('0x18')](function(_0x5bb38e){console['error'](_0x5bb38e);});}_0x555331();}},'charset':_0x0a1a('0x19'),'collate':_0x0a1a('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 7f85ead..7eaea86 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 _0x448a=['redis','defaults','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','create','body','options','raw','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x35b2e8,_0x4cd01c){var _0x3d5c54=function(_0x52195d){while(--_0x52195d){_0x35b2e8['push'](_0x35b2e8['shift']());}};_0x3d5c54(++_0x4cd01c);}(_0x448a,0x1ef));var _0xa448=function(_0x5e59f2,_0x4d7f88){_0x5e59f2=_0x5e59f2-0x0;var _0x15de7b=_0x448a[_0x5e59f2];return _0x15de7b;};'use strict';var _=require('lodash');var util=require(_0xa448('0x0'));var moment=require(_0xa448('0x1'));var BPromise=require('bluebird');var rs=require(_0xa448('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa448('0x3'));var logger=require(_0xa448('0x4'))('rpc');var config=require(_0xa448('0x5'));var jayson=require(_0xa448('0x6'));var client=jayson[_0xa448('0x7')][_0xa448('0x8')]({'port':0x232a});config[_0xa448('0x9')]=_[_0xa448('0xa')](config[_0xa448('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa448('0x9')]));require(_0xa448('0xb'))[_0xa448('0xc')](socket);function respondWithRpcPromise(_0x13db02,_0x2e95bf,_0x81f261){return new BPromise(function(_0x1d8a87,_0x54a4c2){return client['request'](_0x13db02,_0x81f261)[_0xa448('0xd')](function(_0x183569){logger['info'](_0xa448('0xe'),_0x2e95bf,_0xa448('0xf'));logger[_0xa448('0x10')](_0xa448('0x11'),_0x2e95bf,_0xa448('0xf'),JSON[_0xa448('0x12')](_0x183569));if(_0x183569[_0xa448('0x13')]){if(_0x183569[_0xa448('0x13')][_0xa448('0x14')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x2e95bf,_0x183569[_0xa448('0x13')][_0xa448('0x15')]);return _0x54a4c2(_0x183569[_0xa448('0x13')][_0xa448('0x15')]);}logger[_0xa448('0x13')](_0xa448('0xe'),_0x2e95bf,_0x183569['error']['message']);return _0x1d8a87(_0x183569['error']['message']);}else{logger[_0xa448('0x16')](_0xa448('0xe'),_0x2e95bf,'request\x20sent');_0x1d8a87(_0x183569[_0xa448('0x17')][_0xa448('0x15')]);}})[_0xa448('0x18')](function(_0x38f0ac){logger[_0xa448('0x13')]('FaxMessage,\x20%s,\x20%s',_0x2e95bf,_0x38f0ac);_0x54a4c2(_0x38f0ac);});});}exports[_0xa448('0x19')]=function(_0x220fd5){var _0x77722=this;return new Promise(function(_0x28a80b,_0x1b6370){return db['FaxMessage'][_0xa448('0x1a')](_0x220fd5[_0xa448('0x1b')],{'raw':_0x220fd5[_0xa448('0x1c')]?_0x220fd5[_0xa448('0x1c')][_0xa448('0x1d')]===undefined?!![]:![]:!![]})[_0xa448('0xd')](function(_0x2afa93){logger[_0xa448('0x16')](_0xa448('0x19'),_0x220fd5);logger[_0xa448('0x10')](_0xa448('0x19'),_0x220fd5,JSON['stringify'](_0x2afa93));_0x28a80b(_0x2afa93);})[_0xa448('0x18')](function(_0x453d88){logger[_0xa448('0x13')](_0xa448('0x19'),_0x453d88['message'],_0x220fd5);_0x1b6370(_0x77722[_0xa448('0x13')](0x1f4,_0x453d88[_0xa448('0x15')]));});});};exports[_0xa448('0x1e')]=function(_0xac9518){var _0x5f3031=this;return new Promise(function(_0x46bcb3,_0x4daa90){return db[_0xa448('0x1f')][_0xa448('0x20')](_0xac9518[_0xa448('0x1b')],{'raw':_0xac9518[_0xa448('0x1c')]?_0xac9518[_0xa448('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xac9518[_0xa448('0x1c')]?_0xac9518[_0xa448('0x1c')][_0xa448('0x21')]||null:null,'attributes':_0xac9518[_0xa448('0x1c')]?_0xac9518[_0xa448('0x1c')][_0xa448('0x22')]||null:null,'limit':_0xac9518[_0xa448('0x1c')]?_0xac9518[_0xa448('0x1c')][_0xa448('0x23')]||null:null})[_0xa448('0xd')](function(_0x32bfa4){logger[_0xa448('0x16')](_0xa448('0x1e'),_0xac9518);logger[_0xa448('0x10')]('UpdateFaxMessage',_0xac9518,JSON[_0xa448('0x12')](_0x32bfa4));_0x46bcb3(_0x32bfa4);})[_0xa448('0x18')](function(_0x215329){logger[_0xa448('0x13')](_0xa448('0x1e'),_0x215329[_0xa448('0x15')],_0xac9518);_0x4daa90(_0x5f3031[_0xa448('0x13')](0x1f4,_0x215329['message']));});});}; \ No newline at end of file +var _0xb7cf=['result','catch','CreateFaxMessage','create','body','options','raw','UpdateFaxMessage','FaxMessage','update','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0xb7cf,0xca));var _0xfb7c=function(_0x295583,_0x4756aa){_0x295583=_0x295583-0x0;var _0x4c2ae6=_0xb7cf[_0x295583];return _0x4c2ae6;};'use strict';var _=require(_0xfb7c('0x0'));var util=require(_0xfb7c('0x1'));var moment=require(_0xfb7c('0x2'));var BPromise=require(_0xfb7c('0x3'));var rs=require(_0xfb7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb7c('0x5'))['db'];var utils=require(_0xfb7c('0x6'));var logger=require(_0xfb7c('0x7'))(_0xfb7c('0x8'));var config=require(_0xfb7c('0x9'));var jayson=require(_0xfb7c('0xa'));var client=jayson[_0xfb7c('0xb')][_0xfb7c('0xc')]({'port':0x232a});config[_0xfb7c('0xd')]=_[_0xfb7c('0xe')](config[_0xfb7c('0xd')],{'host':_0xfb7c('0xf'),'port':0x18eb});var socket=require(_0xfb7c('0x10'))(new Redis(config[_0xfb7c('0xd')]));require('./faxMessage.socket')[_0xfb7c('0x11')](socket);function respondWithRpcPromise(_0x1cbc01,_0x17d730,_0x577d42){return new BPromise(function(_0x595834,_0x5eef53){return client['request'](_0x1cbc01,_0x577d42)[_0xfb7c('0x12')](function(_0x19824b){logger[_0xfb7c('0x13')](_0xfb7c('0x14'),_0x17d730,_0xfb7c('0x15'));logger[_0xfb7c('0x16')](_0xfb7c('0x17'),_0x17d730,_0xfb7c('0x15'),JSON['stringify'](_0x19824b));if(_0x19824b[_0xfb7c('0x18')]){if(_0x19824b[_0xfb7c('0x18')]['code']===0x1f4){logger[_0xfb7c('0x18')](_0xfb7c('0x14'),_0x17d730,_0x19824b[_0xfb7c('0x18')][_0xfb7c('0x19')]);return _0x5eef53(_0x19824b[_0xfb7c('0x18')][_0xfb7c('0x19')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x17d730,_0x19824b[_0xfb7c('0x18')]['message']);return _0x595834(_0x19824b[_0xfb7c('0x18')][_0xfb7c('0x19')]);}else{logger[_0xfb7c('0x13')](_0xfb7c('0x14'),_0x17d730,'request\x20sent');_0x595834(_0x19824b[_0xfb7c('0x1a')]['message']);}})[_0xfb7c('0x1b')](function(_0x227410){logger[_0xfb7c('0x18')](_0xfb7c('0x14'),_0x17d730,_0x227410);_0x5eef53(_0x227410);});});}exports[_0xfb7c('0x1c')]=function(_0xb03af5){var _0x4745f5=this;return new Promise(function(_0x54cbcf,_0xd87c){return db['FaxMessage'][_0xfb7c('0x1d')](_0xb03af5[_0xfb7c('0x1e')],{'raw':_0xb03af5[_0xfb7c('0x1f')]?_0xb03af5[_0xfb7c('0x1f')][_0xfb7c('0x20')]===undefined?!![]:![]:!![]})[_0xfb7c('0x12')](function(_0x4065d6){logger[_0xfb7c('0x13')](_0xfb7c('0x1c'),_0xb03af5);logger['debug'](_0xfb7c('0x1c'),_0xb03af5,JSON['stringify'](_0x4065d6));_0x54cbcf(_0x4065d6);})['catch'](function(_0x2f8a98){logger[_0xfb7c('0x18')]('CreateFaxMessage',_0x2f8a98[_0xfb7c('0x19')],_0xb03af5);_0xd87c(_0x4745f5['error'](0x1f4,_0x2f8a98['message']));});});};exports[_0xfb7c('0x21')]=function(_0x432987){var _0x340680=this;return new Promise(function(_0x33b5db,_0x7a795){return db[_0xfb7c('0x22')][_0xfb7c('0x23')](_0x432987[_0xfb7c('0x1e')],{'raw':_0x432987['options']?_0x432987[_0xfb7c('0x1f')][_0xfb7c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x432987[_0xfb7c('0x1f')]?_0x432987['options']['where']||null:null,'attributes':_0x432987[_0xfb7c('0x1f')]?_0x432987['options']['attributes']||null:null,'limit':_0x432987['options']?_0x432987[_0xfb7c('0x1f')][_0xfb7c('0x24')]||null:null})[_0xfb7c('0x12')](function(_0x2f1a20){logger[_0xfb7c('0x13')](_0xfb7c('0x21'),_0x432987);logger[_0xfb7c('0x16')](_0xfb7c('0x21'),_0x432987,JSON[_0xfb7c('0x25')](_0x2f1a20));_0x33b5db(_0x2f1a20);})[_0xfb7c('0x1b')](function(_0x25317a){logger[_0xfb7c('0x18')](_0xfb7c('0x21'),_0x25317a['message'],_0x432987);_0x7a795(_0x340680[_0xfb7c('0x18')](0x1f4,_0x25317a[_0xfb7c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8150eaa..58a2e76 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 _0x1af3=['emit','register','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x50547e,_0x1cb723){var _0x45606f=function(_0x5b8d92){while(--_0x5b8d92){_0x50547e['push'](_0x50547e['shift']());}};_0x45606f(++_0x1cb723);}(_0x1af3,0x1ca));var _0x31af=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0x1af3[_0x2f6f50];return _0x2cf365;};'use strict';var FaxMessageEvents=require(_0x31af('0x0'));var events=[_0x31af('0x1'),_0x31af('0x2'),_0x31af('0x3')];function createListener(_0x450506,_0xf27e22){return function(_0x3d693c){_0xf27e22[_0x31af('0x4')](_0x450506,_0x3d693c);};}function removeListener(_0x3d64ae,_0xc098ee){return function(){FaxMessageEvents['removeListener'](_0x3d64ae,_0xc098ee);};}exports[_0x31af('0x5')]=function(_0x416162){for(var _0x1ac3f6=0x0,_0x21ddc5=events['length'];_0x1ac3f6<_0x21ddc5;_0x1ac3f6++){var _0x6be8e9=events[_0x1ac3f6];var _0x1833de=createListener(_0x31af('0x6')+_0x6be8e9,_0x416162);FaxMessageEvents['on'](_0x6be8e9,_0x1833de);}}; \ No newline at end of file +var _0xaa9d=['length','faxMessage:','./faxMessage.events','save','remove','update','removeListener','register'];(function(_0x33c195,_0x25b4f2){var _0x331e21=function(_0x5c460e){while(--_0x5c460e){_0x33c195['push'](_0x33c195['shift']());}};_0x331e21(++_0x25b4f2);}(_0xaa9d,0x1aa));var _0xdaa9=function(_0x1e6d92,_0x228cbe){_0x1e6d92=_0x1e6d92-0x0;var _0x2bd4b6=_0xaa9d[_0x1e6d92];return _0x2bd4b6;};'use strict';var FaxMessageEvents=require(_0xdaa9('0x0'));var events=[_0xdaa9('0x1'),_0xdaa9('0x2'),_0xdaa9('0x3')];function createListener(_0x1672d7,_0x47edb9){return function(_0x5de669){_0x47edb9['emit'](_0x1672d7,_0x5de669);};}function removeListener(_0x5cd202,_0x3579e6){return function(){FaxMessageEvents[_0xdaa9('0x4')](_0x5cd202,_0x3579e6);};}exports[_0xdaa9('0x5')]=function(_0x1472da){for(var _0x49ff8d=0x0,_0x548aee=events[_0xdaa9('0x6')];_0x49ff8d<_0x548aee;_0x49ff8d++){var _0x389004=events[_0x49ff8d];var _0x394817=createListener(_0xdaa9('0x7')+_0x389004,_0x1472da);FaxMessageEvents['on'](_0x389004,_0x394817);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 11f671c..b6a68b0 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 _0x3e24=['isAuthenticated','index','/describe','/:id','show','download','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get'];(function(_0x14e143,_0x459499){var _0x44364d=function(_0x426602){while(--_0x426602){_0x14e143['push'](_0x14e143['shift']());}};_0x44364d(++_0x459499);}(_0x3e24,0x167));var _0x43e2=function(_0x50d8b2,_0x46f88d){_0x50d8b2=_0x50d8b2-0x0;var _0x2f9972=_0x3e24[_0x50d8b2];return _0x2f9972;};'use strict';var multer=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var path=require(_0x43e2('0x2'));var timeout=require(_0x43e2('0x3'));var express=require(_0x43e2('0x4'));var router=express['Router']();var auth=require(_0x43e2('0x5'));var interaction=require(_0x43e2('0x6'));var config=require('../../config/environment');var controller=require(_0x43e2('0x7'));router[_0x43e2('0x8')]('/',auth[_0x43e2('0x9')](),controller[_0x43e2('0xa')]);router[_0x43e2('0x8')](_0x43e2('0xb'),auth[_0x43e2('0x9')](),controller['describe']);router[_0x43e2('0x8')](_0x43e2('0xc'),auth['isAuthenticated'](),controller[_0x43e2('0xd')]);router[_0x43e2('0x8')]('/:id/download',auth[_0x43e2('0x9')](),controller[_0x43e2('0xe')]);router['post']('/',auth[_0x43e2('0x9')](),interaction['tracked']('fax','faxmessage:create'),controller[_0x43e2('0xf')]);router[_0x43e2('0x10')](_0x43e2('0xc'),auth[_0x43e2('0x9')](),controller[_0x43e2('0x11')]);router[_0x43e2('0x10')](_0x43e2('0x12'),auth[_0x43e2('0x9')](),controller[_0x43e2('0x13')]);router[_0x43e2('0x10')](_0x43e2('0x14'),auth[_0x43e2('0x9')](),controller['reject']);router[_0x43e2('0x15')](_0x43e2('0xc'),auth[_0x43e2('0x9')](),controller[_0x43e2('0x16')]);module['exports']=router; \ No newline at end of file +var _0x7bd0=['reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','show','download','post','fax','faxmessage:create','create','put','/:id','update','accept','/:id/reject'];(function(_0x3d87c9,_0x19cedd){var _0x43d3f0=function(_0x39e1ad){while(--_0x39e1ad){_0x3d87c9['push'](_0x3d87c9['shift']());}};_0x43d3f0(++_0x19cedd);}(_0x7bd0,0x111));var _0x07bd=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x7bd0[_0x4907de];return _0x482054;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var auth=require(_0x07bd('0x6'));var interaction=require(_0x07bd('0x7'));var config=require('../../config/environment');var controller=require(_0x07bd('0x8'));router[_0x07bd('0x9')]('/',auth[_0x07bd('0xa')](),controller[_0x07bd('0xb')]);router[_0x07bd('0x9')](_0x07bd('0xc'),auth[_0x07bd('0xa')](),controller['describe']);router[_0x07bd('0x9')]('/:id',auth[_0x07bd('0xa')](),controller[_0x07bd('0xd')]);router[_0x07bd('0x9')]('/:id/download',auth[_0x07bd('0xa')](),controller[_0x07bd('0xe')]);router[_0x07bd('0xf')]('/',auth[_0x07bd('0xa')](),interaction['tracked'](_0x07bd('0x10'),_0x07bd('0x11')),controller[_0x07bd('0x12')]);router[_0x07bd('0x13')](_0x07bd('0x14'),auth[_0x07bd('0xa')](),controller[_0x07bd('0x15')]);router[_0x07bd('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0x07bd('0x16')]);router[_0x07bd('0x13')](_0x07bd('0x17'),auth[_0x07bd('0xa')](),controller[_0x07bd('0x18')]);router[_0x07bd('0x19')](_0x07bd('0x14'),auth['isAuthenticated'](),controller[_0x07bd('0x1a')]);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 c61485f..30c20c6 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 _0xa957=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xa957,0xd8));var _0x7a95=function(_0x46f715,_0x25ed97){_0x46f715=_0x46f715-0x0;var _0x1213e3=_0xa957[_0x46f715];return _0x1213e3;};'use strict';var Sequelize=require(_0x7a95('0x0'));module[_0x7a95('0x1')]={'name':{'type':Sequelize[_0x7a95('0x2')],'unique':_0x7a95('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7a95('0x2')]},'timeout':{'type':Sequelize[_0x7a95('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7a95('0x5')]('rrmemory',_0x7a95('0x6'),_0x7a95('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7a95('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2292=['INTEGER','ENUM','beepall','roundrobin','name','STRING'];(function(_0x2d8ca8,_0x22bcb6){var _0x268164=function(_0x58d046){while(--_0x58d046){_0x2d8ca8['push'](_0x2d8ca8['shift']());}};_0x268164(++_0x22bcb6);}(_0x2292,0x18a));var _0x2229=function(_0x5cd376,_0x163789){_0x5cd376=_0x5cd376-0x0;var _0x57de74=_0x2292[_0x5cd376];return _0x57de74;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2229('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2229('0x1')]},'timeout':{'type':Sequelize[_0x2229('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2229('0x3')]('rrmemory',_0x2229('0x4'),_0x2229('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2229('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 8f5326c..2c42e10 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 _0xff19=['userProfileId','autoAssociation','error','params','describe','getMembers','UserFaxQueue','FaxQueueId','User','findAndCountAll','agent','faxPause','createdAt','rows','updatedAt','findOne','Team','getTeams','addTeams','ids','Agents','removeTeams','union','addAgents','omit','spread','emit','userFaxQueue:save','removeAgents','isArray','userFaxQueue:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','sendStatus','status','end','offset','limit','set','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','FaxQueue','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','count','include','findAll','catch','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection'];(function(_0x45eec6,_0x46ea2f){var _0x21bbe5=function(_0x539a35){while(--_0x539a35){_0x45eec6['push'](_0x45eec6['shift']());}};_0x21bbe5(++_0x46ea2f);}(_0xff19,0x100));var _0x9ff1=function(_0x106bfd,_0x4c1659){_0x106bfd=_0x106bfd-0x0;var _0x2eed19=_0xff19[_0x106bfd];return _0x2eed19;};'use strict';var pdf=require(_0x9ff1('0x0'));var emlformat=require(_0x9ff1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9ff1('0x2'));var rp=require(_0x9ff1('0x3'));var moment=require(_0x9ff1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9ff1('0x5'));var path=require(_0x9ff1('0x6'));var sox=require('sox');var csv=require(_0x9ff1('0x7'));var ejs=require(_0x9ff1('0x8'));var fs=require('fs');var _=require(_0x9ff1('0x9'));var squel=require(_0x9ff1('0xa'));var crypto=require(_0x9ff1('0xb'));var jsforce=require(_0x9ff1('0xc'));var deskjs=require(_0x9ff1('0xd'));var toCsv=require(_0x9ff1('0x7'));var querystring=require('querystring');var Papa=require(_0x9ff1('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x9ff1('0xf'));var Redis=require(_0x9ff1('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x9ff1('0x11'))(_0x9ff1('0x12'));var utils=require(_0x9ff1('0x13'));var config=require(_0x9ff1('0x14'));var db=require(_0x9ff1('0x15'))['db'];config[_0x9ff1('0x16')]=_[_0x9ff1('0x17')](config['redis'],{'host':_0x9ff1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ff1('0x16')]));require(_0x9ff1('0x19'))['register'](socket);function respondWithStatusCode(_0xef9d83,_0x2d8673){_0x2d8673=_0x2d8673||0xcc;return function(_0x1203ba){if(_0x1203ba){return _0xef9d83[_0x9ff1('0x1a')](_0x2d8673);}return _0xef9d83[_0x9ff1('0x1b')](_0x2d8673)[_0x9ff1('0x1c')]();};}function respondWithResult(_0x4c9d58,_0x4cf960){_0x4cf960=_0x4cf960||0xc8;return function(_0x345006){if(_0x345006){return _0x4c9d58[_0x9ff1('0x1b')](_0x4cf960)['json'](_0x345006);}};}function respondWithFilteredResult(_0x3cc81e,_0x173966){return function(_0x1bd1a6){if(_0x1bd1a6){var _0xb6c010=_0x1bd1a6['count'],_0x5bb77e=_0x173966[_0x9ff1('0x1d')],_0x2ad4ee=_0x173966[_0x9ff1('0x1d')]+_0x173966[_0x9ff1('0x1e')],_0x469d1e;if(_0x2ad4ee>=_0xb6c010){_0x2ad4ee=_0xb6c010;_0x469d1e=0xc8;}else{_0x469d1e=0xce;}_0x3cc81e[_0x9ff1('0x1b')](_0x469d1e);return _0x3cc81e[_0x9ff1('0x1f')]('Content-Range',_0x5bb77e+'-'+_0x2ad4ee+'/'+_0xb6c010)['json'](_0x1bd1a6);}return null;};}function patchUpdates(_0x43a5d2){return function(_0x52cb06){try{jsonpatch['apply'](_0x52cb06,_0x43a5d2,!![]);}catch(_0x2ef1d6){return BPromise[_0x9ff1('0x20')](_0x2ef1d6);}return _0x52cb06[_0x9ff1('0x21')]();};}function saveUpdates(_0x1efd33,_0x2894f1){return function(_0x77b89c){if(_0x77b89c){return _0x77b89c[_0x9ff1('0x22')](_0x1efd33)['then'](function(_0x2fff4c){return _0x2fff4c;});}return null;};}function removeEntity(_0x15ac30,_0x15f3d5){return function(_0x166331){if(_0x166331){return _0x166331[_0x9ff1('0x23')]()[_0x9ff1('0x24')](function(){var _0x408c49=_0x166331[_0x9ff1('0x25')]({'plain':!![]});var _0x17c09b='FaxQueues';return db[_0x9ff1('0x26')][_0x9ff1('0x23')]({'where':{'type':_0x17c09b,'resourceId':_0x408c49['id']}})['then'](function(){return _0x166331;});})[_0x9ff1('0x24')](function(){_0x15ac30['status'](0xcc)[_0x9ff1('0x1c')]();});}};}function handleEntityNotFound(_0x1faa76,_0x452c30){return function(_0x4ae757){if(!_0x4ae757){_0x1faa76[_0x9ff1('0x1a')](0x194);}return _0x4ae757;};}function handleError(_0x1c1985,_0x296115){_0x296115=_0x296115||0x1f4;return function(_0xf89f18){logger['error'](_0xf89f18[_0x9ff1('0x27')]);if(_0xf89f18['name']){delete _0xf89f18[_0x9ff1('0x28')];}_0x1c1985[_0x9ff1('0x1b')](_0x296115)[_0x9ff1('0x29')](_0xf89f18);};}exports[_0x9ff1('0x2a')]=function(_0x35fdbb,_0x30723a){var _0x386ace={},_0x49aba5={},_0x1a276a={'count':0x0,'rows':[]};var _0x5ba03b=db[_0x9ff1('0x2b')]['rawAttributes'];_0x49aba5[_0x9ff1('0x2c')]=_[_0x9ff1('0x2d')](_0x5ba03b);_0x49aba5[_0x9ff1('0x2e')]=_[_0x9ff1('0x2d')](_0x35fdbb[_0x9ff1('0x2e')]);_0x49aba5[_0x9ff1('0x2f')]=_[_0x9ff1('0x30')](_0x49aba5[_0x9ff1('0x2c')],_0x49aba5[_0x9ff1('0x2e')]);_0x386ace[_0x9ff1('0x31')]=_[_0x9ff1('0x30')](_0x49aba5[_0x9ff1('0x2c')],qs[_0x9ff1('0x32')](_0x35fdbb['query']['fields']));_0x386ace[_0x9ff1('0x31')]=_0x386ace['attributes'][_0x9ff1('0x33')]?_0x386ace[_0x9ff1('0x31')]:_0x49aba5[_0x9ff1('0x2c')];if(!_0x35fdbb[_0x9ff1('0x2e')][_0x9ff1('0x34')](_0x9ff1('0x35'))){_0x386ace[_0x9ff1('0x1e')]=qs[_0x9ff1('0x1e')](_0x35fdbb[_0x9ff1('0x2e')][_0x9ff1('0x1e')]);_0x386ace[_0x9ff1('0x1d')]=qs[_0x9ff1('0x1d')](_0x35fdbb[_0x9ff1('0x2e')][_0x9ff1('0x1d')]);}_0x386ace[_0x9ff1('0x36')]=qs[_0x9ff1('0x37')](_0x35fdbb[_0x9ff1('0x2e')][_0x9ff1('0x37')]);_0x386ace[_0x9ff1('0x38')]=qs[_0x9ff1('0x2f')](_[_0x9ff1('0x39')](_0x35fdbb['query'],_0x49aba5['filters']));if(_0x35fdbb[_0x9ff1('0x2e')]['filter']){_0x386ace[_0x9ff1('0x38')]=_[_0x9ff1('0x3a')](_0x386ace[_0x9ff1('0x38')],{'$or':_[_0x9ff1('0x3b')](_0x5ba03b,function(_0x5a05e){if(_0x5a05e[_0x9ff1('0x3c')][_0x9ff1('0x3d')]!==_0x9ff1('0x3e')){var _0x174ed7={};_0x174ed7[_0x5a05e['field']]={'$like':'%'+_0x35fdbb['query'][_0x9ff1('0x3f')]+'%'};return _0x174ed7;}})});}_0x386ace=_[_0x9ff1('0x3a')]({},_0x386ace,_0x35fdbb[_0x9ff1('0x40')]);var _0xf6a7ee={'where':_0x386ace[_0x9ff1('0x38')]};return db[_0x9ff1('0x2b')][_0x9ff1('0x41')](_0xf6a7ee)['then'](function(_0x3ac38a){_0x1a276a['count']=_0x3ac38a;if(_0x35fdbb[_0x9ff1('0x2e')]['includeAll']){_0x386ace[_0x9ff1('0x42')]=[{'all':!![]}];}return db[_0x9ff1('0x2b')][_0x9ff1('0x43')](_0x386ace);})[_0x9ff1('0x24')](function(_0x1b8770){_0x1a276a['rows']=_0x1b8770;return _0x1a276a;})[_0x9ff1('0x24')](respondWithFilteredResult(_0x30723a,_0x386ace))[_0x9ff1('0x44')](handleError(_0x30723a,null));};exports[_0x9ff1('0x45')]=function(_0x43e809,_0xddafa2){var _0x1c66b2={'raw':!![],'where':{'id':_0x43e809['params']['id']}},_0x55c7f7={};_0x55c7f7['model']=_[_0x9ff1('0x2d')](db[_0x9ff1('0x2b')][_0x9ff1('0x46')]);_0x55c7f7['query']=_[_0x9ff1('0x2d')](_0x43e809[_0x9ff1('0x2e')]);_0x55c7f7[_0x9ff1('0x2f')]=_[_0x9ff1('0x30')](_0x55c7f7['model'],_0x55c7f7[_0x9ff1('0x2e')]);_0x1c66b2['attributes']=_[_0x9ff1('0x30')](_0x55c7f7[_0x9ff1('0x2c')],qs[_0x9ff1('0x32')](_0x43e809[_0x9ff1('0x2e')][_0x9ff1('0x32')]));_0x1c66b2[_0x9ff1('0x31')]=_0x1c66b2[_0x9ff1('0x31')]['length']?_0x1c66b2[_0x9ff1('0x31')]:_0x55c7f7[_0x9ff1('0x2c')];if(_0x43e809['query'][_0x9ff1('0x47')]){_0x1c66b2[_0x9ff1('0x42')]=[{'all':!![]}];}_0x1c66b2=_[_0x9ff1('0x3a')]({},_0x1c66b2,_0x43e809[_0x9ff1('0x40')]);return db['FaxQueue'][_0x9ff1('0x48')](_0x1c66b2)['then'](handleEntityNotFound(_0xddafa2,null))[_0x9ff1('0x24')](respondWithResult(_0xddafa2,null))[_0x9ff1('0x44')](handleError(_0xddafa2,null));};exports[_0x9ff1('0x49')]=function(_0x5ade73,_0x5d227b){return db[_0x9ff1('0x2b')][_0x9ff1('0x49')](_0x5ade73[_0x9ff1('0x4a')],{})['then'](function(_0x5e46a4){var _0x238406=_0x5ade73[_0x9ff1('0x4b')]['get']({'plain':!![]});if(!_0x238406)throw new Error(_0x9ff1('0x4c'));if(_0x238406[_0x9ff1('0x4d')]===_0x9ff1('0x4b')){var _0x773b28=_0x5e46a4[_0x9ff1('0x25')]({'plain':!![]});var _0x517c4a=_0x9ff1('0x4e');return db[_0x9ff1('0x4f')][_0x9ff1('0x48')]({'where':{'name':_0x517c4a,'userProfileId':_0x238406[_0x9ff1('0x50')]},'raw':!![]})[_0x9ff1('0x24')](function(_0x20b252){if(_0x20b252&&_0x20b252[_0x9ff1('0x51')]===0x0){return db[_0x9ff1('0x26')]['create']({'name':_0x773b28[_0x9ff1('0x28')],'resourceId':_0x773b28['id'],'type':_0x20b252[_0x9ff1('0x28')],'sectionId':_0x20b252['id']},{})[_0x9ff1('0x24')](function(){return _0x5e46a4;});}else{return _0x5e46a4;}})[_0x9ff1('0x44')](function(_0x28c38f){logger[_0x9ff1('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28c38f);throw _0x28c38f;});}return _0x5e46a4;})[_0x9ff1('0x24')](respondWithResult(_0x5d227b,0xc9))['catch'](handleError(_0x5d227b,null));};exports[_0x9ff1('0x22')]=function(_0x57fff8,_0x558123){if(_0x57fff8[_0x9ff1('0x4a')]['id']){delete _0x57fff8[_0x9ff1('0x4a')]['id'];}return db['FaxQueue'][_0x9ff1('0x48')]({'where':{'id':_0x57fff8[_0x9ff1('0x53')]['id']}})[_0x9ff1('0x24')](handleEntityNotFound(_0x558123,null))['then'](saveUpdates(_0x57fff8[_0x9ff1('0x4a')],null))['then'](respondWithResult(_0x558123,null))[_0x9ff1('0x44')](handleError(_0x558123,null));};exports[_0x9ff1('0x23')]=function(_0x20118a,_0x22cefa){return db['FaxQueue'][_0x9ff1('0x48')]({'where':{'id':_0x20118a[_0x9ff1('0x53')]['id']}})[_0x9ff1('0x24')](handleEntityNotFound(_0x22cefa,null))[_0x9ff1('0x24')](removeEntity(_0x22cefa,null))[_0x9ff1('0x44')](handleError(_0x22cefa,null));};exports[_0x9ff1('0x54')]=function(_0x683e55,_0x225532){return db[_0x9ff1('0x2b')][_0x9ff1('0x54')]()['then'](respondWithResult(_0x225532,null))[_0x9ff1('0x44')](handleError(_0x225532,null));};exports[_0x9ff1('0x55')]=function(_0x4cf259,_0x5e1c76,_0x3309ff){var _0x3504a2={'raw':!![],'where':{}},_0x5ad36c={},_0x1e09d2;return db[_0x9ff1('0x2b')]['findOne']({'where':{'id':_0x4cf259[_0x9ff1('0x53')]['id']}})[_0x9ff1('0x24')](handleEntityNotFound(_0x5e1c76,null))['then'](function(_0x184174){if(_0x184174){_0x1e09d2=_0x184174[_0x9ff1('0x25')]({'plain':!![]});_0x5ad36c[_0x9ff1('0x2c')]=_[_0x9ff1('0x2d')](db[_0x9ff1('0x56')][_0x9ff1('0x46')]);_0x5ad36c[_0x9ff1('0x2e')]=_[_0x9ff1('0x2d')](_0x4cf259[_0x9ff1('0x2e')]);_0x5ad36c['filters']=_['intersection'](_0x5ad36c[_0x9ff1('0x2c')],_0x5ad36c[_0x9ff1('0x2e')]);_0x3504a2['attributes']=_[_0x9ff1('0x30')](_0x5ad36c['model'],qs[_0x9ff1('0x32')](_0x4cf259['query'][_0x9ff1('0x32')]));_0x3504a2[_0x9ff1('0x31')]=_0x3504a2[_0x9ff1('0x31')][_0x9ff1('0x33')]?_0x3504a2['attributes']:_0x5ad36c['model'];if(!_0x4cf259[_0x9ff1('0x2e')][_0x9ff1('0x34')]('nolimit')){_0x3504a2[_0x9ff1('0x1e')]=qs['limit'](_0x4cf259['query'][_0x9ff1('0x1e')]);_0x3504a2[_0x9ff1('0x1d')]=qs[_0x9ff1('0x1d')](_0x4cf259[_0x9ff1('0x2e')][_0x9ff1('0x1d')]);}_0x3504a2[_0x9ff1('0x36')]=qs[_0x9ff1('0x37')](_0x4cf259['query'][_0x9ff1('0x37')]);_0x3504a2[_0x9ff1('0x38')]=qs[_0x9ff1('0x2f')](_[_0x9ff1('0x39')](_0x4cf259[_0x9ff1('0x2e')],_0x5ad36c['filters']));_0x3504a2['where'][_0x9ff1('0x57')]=_0x184174['id'];if(_0x4cf259[_0x9ff1('0x2e')][_0x9ff1('0x3f')]){_0x3504a2['where']=_[_0x9ff1('0x3a')](_0x3504a2['where'],{'$or':_[_0x9ff1('0x3b')](_0x3504a2['attributes'],function(_0xa74af3){var _0x156731={};_0x156731[_0xa74af3]={'$like':'%'+_0x4cf259[_0x9ff1('0x2e')][_0x9ff1('0x3f')]+'%'};return _0x156731;})});}_0x3504a2=_['merge']({},_0x3504a2,_0x4cf259[_0x9ff1('0x40')]);return db[_0x9ff1('0x56')]['findAll'](_0x3504a2);}})[_0x9ff1('0x24')](function(_0x55efa5){if(_0x55efa5){return db[_0x9ff1('0x58')][_0x9ff1('0x59')]({'where':{'id':_[_0x9ff1('0x3b')](_0x55efa5,'UserId'),'role':_0x9ff1('0x5a')},'attributes':['id',_0x9ff1('0x28'),_0x9ff1('0x5b'),'updatedAt',_0x9ff1('0x5c')]});}})['then'](function(_0xc86cd7){if(_0xc86cd7){return{'count':_0xc86cd7[_0x9ff1('0x41')],'rows':_['map'](_0xc86cd7[_0x9ff1('0x5d')],function(_0x13072e){return{'membername':_0x13072e[_0x9ff1('0x28')],'UserId':_0x13072e['id'],'queue_name':_0x1e09d2[_0x9ff1('0x28')],'FaxQueueId':_0x1e09d2['id'],'interface':util['format']('%s/%s','SIP',_0x13072e[_0x9ff1('0x28')]),'penalty':0x0,'paused':_0x13072e['faxPause'],'createdAt':_0x13072e[_0x9ff1('0x5c')],'updatedAt':_0x13072e[_0x9ff1('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9ff1('0x24')](respondWithFilteredResult(_0x5e1c76,_0x3504a2))[_0x9ff1('0x44')](handleError(_0x5e1c76,null));};exports['getTeams']=function(_0x22902d,_0x5d8ab5,_0x4c55a){var _0x42b879={};var _0x1ce9f2={};var _0x419c48;var _0xb26b63;return db[_0x9ff1('0x2b')][_0x9ff1('0x5f')]({'where':{'id':_0x22902d[_0x9ff1('0x53')]['id']}})[_0x9ff1('0x24')](handleEntityNotFound(_0x5d8ab5,null))['then'](function(_0x44ca0d){if(_0x44ca0d){_0x419c48=_0x44ca0d;_0x1ce9f2['model']=_[_0x9ff1('0x2d')](db[_0x9ff1('0x60')][_0x9ff1('0x46')]);_0x1ce9f2[_0x9ff1('0x2e')]=_[_0x9ff1('0x2d')](_0x22902d[_0x9ff1('0x2e')]);_0x1ce9f2[_0x9ff1('0x2f')]=_['intersection'](_0x1ce9f2[_0x9ff1('0x2c')],_0x1ce9f2[_0x9ff1('0x2e')]);_0x42b879[_0x9ff1('0x31')]=_[_0x9ff1('0x30')](_0x1ce9f2[_0x9ff1('0x2c')],qs[_0x9ff1('0x32')](_0x22902d[_0x9ff1('0x2e')][_0x9ff1('0x32')]));_0x42b879[_0x9ff1('0x31')]=_0x42b879[_0x9ff1('0x31')][_0x9ff1('0x33')]?_0x42b879[_0x9ff1('0x31')]:_0x1ce9f2[_0x9ff1('0x2c')];_0x42b879[_0x9ff1('0x36')]=qs[_0x9ff1('0x37')](_0x22902d[_0x9ff1('0x2e')][_0x9ff1('0x37')]);_0x42b879['where']=qs[_0x9ff1('0x2f')](_[_0x9ff1('0x39')](_0x22902d['query'],_0x1ce9f2[_0x9ff1('0x2f')]));if(_0x22902d[_0x9ff1('0x2e')][_0x9ff1('0x3f')]){_0x42b879[_0x9ff1('0x38')]=_[_0x9ff1('0x3a')](_0x42b879[_0x9ff1('0x38')],{'$or':_[_0x9ff1('0x3b')](_0x42b879[_0x9ff1('0x31')],function(_0x40b93a){var _0x41e1eb={};_0x41e1eb[_0x40b93a]={'$like':'%'+_0x22902d[_0x9ff1('0x2e')][_0x9ff1('0x3f')]+'%'};return _0x41e1eb;})});}_0x42b879=_[_0x9ff1('0x3a')]({},_0x42b879,_0x22902d[_0x9ff1('0x40')]);return _0x419c48['getTeams'](_0x42b879);}})['then'](function(_0x2bf1a7){if(_0x2bf1a7){_0xb26b63=_0x2bf1a7[_0x9ff1('0x33')];if(!_0x22902d[_0x9ff1('0x2e')][_0x9ff1('0x34')](_0x9ff1('0x35'))){_0x42b879[_0x9ff1('0x1e')]=qs[_0x9ff1('0x1e')](_0x22902d['query'][_0x9ff1('0x1e')]);_0x42b879[_0x9ff1('0x1d')]=qs[_0x9ff1('0x1d')](_0x22902d[_0x9ff1('0x2e')][_0x9ff1('0x1d')]);}return _0x419c48[_0x9ff1('0x61')](_0x42b879);}})[_0x9ff1('0x24')](function(_0x23c35a){if(_0x23c35a){return _0x23c35a?{'count':_0xb26b63,'rows':_0x23c35a}:null;}})[_0x9ff1('0x24')](respondWithResult(_0x5d8ab5,null))['catch'](handleError(_0x5d8ab5,null));};exports[_0x9ff1('0x62')]=function(_0x2aac29,_0x487317,_0x4e8e13){var _0x2b7a25=[];var _0x1e89d3;return db['Team'][_0x9ff1('0x43')]({'where':{'id':_0x2aac29[_0x9ff1('0x4a')][_0x9ff1('0x63')]},'attributes':['id'],'include':[{'model':db[_0x9ff1('0x58')],'as':_0x9ff1('0x64'),'attributes':['id'],'raw':!![]}]})[_0x9ff1('0x24')](function(_0x4392a5){if(_0x4392a5){for(var _0x5542c9=0x0;_0x5542c9<_0x4392a5[_0x9ff1('0x33')];_0x5542c9+=0x1){for(var _0x604dee=0x0;_0x604dee<_0x4392a5[_0x5542c9]['Agents'][_0x9ff1('0x33')];_0x604dee+=0x1){_0x2b7a25=_['union'](_0x2b7a25,[_0x4392a5[_0x5542c9][_0x9ff1('0x64')][_0x604dee]['id']]);}}return _0x2b7a25;}})[_0x9ff1('0x24')](function(_0x3c2090){if(_0x3c2090){return db[_0x9ff1('0x2b')][_0x9ff1('0x48')]({'where':{'id':_0x2aac29[_0x9ff1('0x53')]['id']}});}})[_0x9ff1('0x24')](function(_0x5b3f21){if(_0x5b3f21){_0x1e89d3=_0x5b3f21;return _0x1e89d3['addAgents'](_0x2b7a25,{'penalty':_0x2aac29['body']['penalty']});}})['then'](function(_0xdb65fe){if(_0xdb65fe){return _0x1e89d3['addTeams'](_0x2aac29[_0x9ff1('0x4a')][_0x9ff1('0x63')]);}})[_0x9ff1('0x24')](handleEntityNotFound(_0x487317,null))[_0x9ff1('0x24')](respondWithStatusCode(_0x487317,null))['catch'](handleError(_0x487317,null));};exports[_0x9ff1('0x65')]=function(_0x435c82,_0x50f31d,_0x9b6cdf){var _0x2b68cd=[];var _0x3744e1;return db[_0x9ff1('0x60')][_0x9ff1('0x43')]({'where':{'id':_0x435c82[_0x9ff1('0x2e')][_0x9ff1('0x63')]},'attributes':['id'],'include':[{'model':db[_0x9ff1('0x58')],'as':_0x9ff1('0x64'),'attributes':['id'],'raw':!![]}]})[_0x9ff1('0x24')](function(_0x140e30){if(_0x140e30){for(var _0x13e381=0x0;_0x13e381<_0x140e30['length'];_0x13e381+=0x1){for(var _0x506c9a=0x0;_0x506c9a<_0x140e30[_0x13e381]['Agents']['length'];_0x506c9a+=0x1){_0x2b68cd=_[_0x9ff1('0x66')](_0x2b68cd,[_0x140e30[_0x13e381]['Agents'][_0x506c9a]['id']]);}}return _0x2b68cd;}})[_0x9ff1('0x24')](function(_0x32dcca){if(_0x32dcca){return db[_0x9ff1('0x2b')][_0x9ff1('0x48')]({'where':{'id':_0x435c82[_0x9ff1('0x53')]['id']}});}})['then'](function(_0x5be03a){if(_0x5be03a){_0x3744e1=_0x5be03a;return _0x3744e1['removeAgents'](_0x2b68cd);}})['then'](function(_0x375c4f){if(_0x3744e1){return _0x3744e1[_0x9ff1('0x65')](_0x435c82['query'][_0x9ff1('0x63')]);}})[_0x9ff1('0x24')](handleEntityNotFound(_0x50f31d,null))[_0x9ff1('0x24')](respondWithStatusCode(_0x50f31d,null))[_0x9ff1('0x44')](handleError(_0x50f31d,null));};exports[_0x9ff1('0x67')]=function(_0x288699,_0x4a1bb3,_0x69facd){return db['FaxQueue'][_0x9ff1('0x48')]({'where':{'id':_0x288699[_0x9ff1('0x53')]['id']}})[_0x9ff1('0x24')](handleEntityNotFound(_0x4a1bb3,null))['then'](function(_0x48311e){if(_0x48311e){return _0x48311e[_0x9ff1('0x67')](_0x288699[_0x9ff1('0x4a')][_0x9ff1('0x63')],_[_0x9ff1('0x68')](_0x288699[_0x9ff1('0x4a')],[_0x9ff1('0x63'),'id'])||{})[_0x9ff1('0x69')](function(_0x5a8ca0){for(var _0x22945c=0x0;_0x22945c<_0x288699['body']['ids'][_0x9ff1('0x33')];_0x22945c+=0x1){socket[_0x9ff1('0x6a')](_0x9ff1('0x6b'),{'UserId':_0x288699['body'][_0x9ff1('0x63')][_0x22945c],'FaxQueueId':_0x288699[_0x9ff1('0x53')]['id']});}return _0x5a8ca0;});}})['then'](respondWithResult(_0x4a1bb3,null))['catch'](handleError(_0x4a1bb3,null));};exports[_0x9ff1('0x6c')]=function(_0x3de6ca,_0x2e14c1,_0x33402c){var _0x198eeb;return db['FaxQueue'][_0x9ff1('0x48')]({'where':{'id':_0x3de6ca[_0x9ff1('0x53')]['id']}})[_0x9ff1('0x24')](handleEntityNotFound(_0x2e14c1,null))[_0x9ff1('0x24')](function(_0x9fe43e){if(_0x9fe43e){return _0x9fe43e[_0x9ff1('0x6c')](_0x3de6ca[_0x9ff1('0x2e')][_0x9ff1('0x63')])[_0x9ff1('0x24')](function(_0xc7f6f3){if(_[_0x9ff1('0x6d')](_0x3de6ca['query'][_0x9ff1('0x63')])){for(var _0x963044=0x0;_0x963044<_0x3de6ca['query']['ids']['length'];_0x963044+=0x1){socket[_0x9ff1('0x6a')](_0x9ff1('0x6e'),{'UserId':_0x3de6ca['query'][_0x9ff1('0x63')][_0x963044],'FaxQueueId':_0x3de6ca[_0x9ff1('0x53')]['id']});}}else{socket[_0x9ff1('0x6a')]('userFaxQueue:remove',{'UserId':_0x3de6ca[_0x9ff1('0x2e')]['ids'],'FaxQueueId':_0x3de6ca['params']['id']});}});}})[_0x9ff1('0x24')](respondWithStatusCode(_0x2e14c1,null))[_0x9ff1('0x44')](handleError(_0x2e14c1,null));};exports[_0x9ff1('0x6f')]=function(_0x399d60,_0x452eaf,_0x41b55c){var _0x553740={};var _0x4bbb3b={};var _0x475ac6;var _0x36b2d4;return db['FaxQueue'][_0x9ff1('0x5f')]({'where':{'id':_0x399d60[_0x9ff1('0x53')]['id']}})['then'](handleEntityNotFound(_0x452eaf,null))['then'](function(_0x250735){if(_0x250735){_0x475ac6=_0x250735;_0x4bbb3b[_0x9ff1('0x2c')]=_[_0x9ff1('0x2d')](db[_0x9ff1('0x58')]['rawAttributes']);_0x4bbb3b['query']=_[_0x9ff1('0x2d')](_0x399d60[_0x9ff1('0x2e')]);_0x4bbb3b[_0x9ff1('0x2f')]=_[_0x9ff1('0x30')](_0x4bbb3b[_0x9ff1('0x2c')],_0x4bbb3b[_0x9ff1('0x2e')]);_0x553740['attributes']=_[_0x9ff1('0x30')](_0x4bbb3b[_0x9ff1('0x2c')],qs[_0x9ff1('0x32')](_0x399d60['query'][_0x9ff1('0x32')]));_0x553740[_0x9ff1('0x31')]=_0x553740[_0x9ff1('0x31')][_0x9ff1('0x33')]?_0x553740[_0x9ff1('0x31')]:_0x4bbb3b[_0x9ff1('0x2c')];_0x553740['order']=qs[_0x9ff1('0x37')](_0x399d60[_0x9ff1('0x2e')][_0x9ff1('0x37')]);_0x553740[_0x9ff1('0x38')]=qs['filters'](_[_0x9ff1('0x39')](_0x399d60['query'],_0x4bbb3b[_0x9ff1('0x2f')]));if(_0x399d60[_0x9ff1('0x2e')]['filter']){_0x553740[_0x9ff1('0x38')]=_['merge'](_0x553740[_0x9ff1('0x38')],{'$or':_['map'](_0x553740['attributes'],function(_0x5d0c96){var _0x57430a={};_0x57430a[_0x5d0c96]={'$like':'%'+_0x399d60['query'][_0x9ff1('0x3f')]+'%'};return _0x57430a;})});}_0x553740=_[_0x9ff1('0x3a')]({},_0x553740,_0x399d60['options']);return _0x475ac6[_0x9ff1('0x6f')](_0x553740);}})[_0x9ff1('0x24')](function(_0x12afb5){if(_0x12afb5){_0x36b2d4=_0x12afb5[_0x9ff1('0x33')];if(!_0x399d60[_0x9ff1('0x2e')][_0x9ff1('0x34')](_0x9ff1('0x35'))){_0x553740[_0x9ff1('0x1e')]=qs[_0x9ff1('0x1e')](_0x399d60[_0x9ff1('0x2e')][_0x9ff1('0x1e')]);_0x553740[_0x9ff1('0x1d')]=qs[_0x9ff1('0x1d')](_0x399d60[_0x9ff1('0x2e')][_0x9ff1('0x1d')]);}return _0x475ac6['getAgents'](_0x553740);}})[_0x9ff1('0x24')](function(_0x23ad6d){if(_0x23ad6d){return _0x23ad6d?{'count':_0x36b2d4,'rows':_0x23ad6d}:null;}})[_0x9ff1('0x24')](respondWithResult(_0x452eaf,null))[_0x9ff1('0x44')](handleError(_0x452eaf,null));}; \ No newline at end of file +var _0x6d66=['find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','map','filter','findAndCountAll','agent','faxPause','updatedAt','%s/%s','createdAt','getTeams','Team','order','ids','User','Agents','penalty','addTeams','removeTeams','union','removeAgents','addAgents','omit','emit','userFaxQueue:save','userFaxQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','offset','limit','set','apply','reject','then','destroy','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','key','VIRTUAL','field','options','FaxQueue','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x263fe3,_0x216b34){var _0x578222=function(_0x1e48ab){while(--_0x1e48ab){_0x263fe3['push'](_0x263fe3['shift']());}};_0x578222(++_0x216b34);}(_0x6d66,0x9c));var _0x66d6=function(_0x18a7c6,_0x4bf5ed){_0x18a7c6=_0x18a7c6-0x0;var _0x316139=_0x6d66[_0x18a7c6];return _0x316139;};'use strict';var pdf=require(_0x66d6('0x0'));var emlformat=require(_0x66d6('0x1'));var rimraf=require(_0x66d6('0x2'));var zipdir=require(_0x66d6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66d6('0x4'));var moment=require('moment');var BPromise=require(_0x66d6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x66d6('0x6'));var sox=require(_0x66d6('0x7'));var csv=require(_0x66d6('0x8'));var ejs=require(_0x66d6('0x9'));var fs=require('fs');var _=require(_0x66d6('0xa'));var squel=require(_0x66d6('0xb'));var crypto=require(_0x66d6('0xc'));var jsforce=require(_0x66d6('0xd'));var deskjs=require(_0x66d6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x66d6('0xf'));var authService=require(_0x66d6('0x10'));var hardwareService=require(_0x66d6('0x11'));var Redis=require(_0x66d6('0x12'));var qs=require(_0x66d6('0x13'));var logger=require(_0x66d6('0x14'))(_0x66d6('0x15'));var utils=require(_0x66d6('0x16'));var config=require(_0x66d6('0x17'));var db=require(_0x66d6('0x18'))['db'];config['redis']=_[_0x66d6('0x19')](config[_0x66d6('0x1a')],{'host':_0x66d6('0x1b'),'port':0x18eb});var socket=require(_0x66d6('0x1c'))(new Redis(config[_0x66d6('0x1a')]));require('./faxQueue.socket')[_0x66d6('0x1d')](socket);function respondWithStatusCode(_0x17d985,_0x12324a){_0x12324a=_0x12324a||0xcc;return function(_0x22634a){if(_0x22634a){return _0x17d985['sendStatus'](_0x12324a);}return _0x17d985[_0x66d6('0x1e')](_0x12324a)[_0x66d6('0x1f')]();};}function respondWithResult(_0x3da88b,_0x4dab78){_0x4dab78=_0x4dab78||0xc8;return function(_0x36e04b){if(_0x36e04b){return _0x3da88b[_0x66d6('0x1e')](_0x4dab78)[_0x66d6('0x20')](_0x36e04b);}};}function respondWithFilteredResult(_0x5a5f8f,_0x3dea1d){return function(_0x238f3){if(_0x238f3){var _0x2b2992=_0x238f3['count'],_0xd390c1=_0x3dea1d[_0x66d6('0x21')],_0x5a3606=_0x3dea1d['offset']+_0x3dea1d[_0x66d6('0x22')],_0xd3f247;if(_0x5a3606>=_0x2b2992){_0x5a3606=_0x2b2992;_0xd3f247=0xc8;}else{_0xd3f247=0xce;}_0x5a5f8f[_0x66d6('0x1e')](_0xd3f247);return _0x5a5f8f[_0x66d6('0x23')]('Content-Range',_0xd390c1+'-'+_0x5a3606+'/'+_0x2b2992)[_0x66d6('0x20')](_0x238f3);}return null;};}function patchUpdates(_0x625a7a){return function(_0x11c509){try{jsonpatch[_0x66d6('0x24')](_0x11c509,_0x625a7a,!![]);}catch(_0x20b293){return BPromise[_0x66d6('0x25')](_0x20b293);}return _0x11c509['save']();};}function saveUpdates(_0x1327fe,_0x5688f9){return function(_0x283c28){if(_0x283c28){return _0x283c28['update'](_0x1327fe)[_0x66d6('0x26')](function(_0x5f0d76){return _0x5f0d76;});}return null;};}function removeEntity(_0x64ebad,_0xf1b509){return function(_0x45aa7d){if(_0x45aa7d){return _0x45aa7d[_0x66d6('0x27')]()[_0x66d6('0x26')](function(){var _0x50efcb=_0x45aa7d['get']({'plain':!![]});var _0xe2d330=_0x66d6('0x28');return db[_0x66d6('0x29')][_0x66d6('0x27')]({'where':{'type':_0xe2d330,'resourceId':_0x50efcb['id']}})[_0x66d6('0x26')](function(){return _0x45aa7d;});})[_0x66d6('0x26')](function(){_0x64ebad[_0x66d6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x100f13,_0x451480){return function(_0x4bd663){if(!_0x4bd663){_0x100f13[_0x66d6('0x2a')](0x194);}return _0x4bd663;};}function handleError(_0x4ad96c,_0x2a0432){_0x2a0432=_0x2a0432||0x1f4;return function(_0x15cfa5){logger[_0x66d6('0x2b')](_0x15cfa5[_0x66d6('0x2c')]);if(_0x15cfa5[_0x66d6('0x2d')]){delete _0x15cfa5['name'];}_0x4ad96c['status'](_0x2a0432)[_0x66d6('0x2e')](_0x15cfa5);};}exports[_0x66d6('0x2f')]=function(_0x57489c,_0x288bf2){var _0x435eed={},_0x523648={},_0x3ec0a5={'count':0x0,'rows':[]};var _0x9ad459=db['FaxQueue'][_0x66d6('0x30')];_0x523648[_0x66d6('0x31')]=_[_0x66d6('0x32')](_0x9ad459);_0x523648['query']=_[_0x66d6('0x32')](_0x57489c[_0x66d6('0x33')]);_0x523648[_0x66d6('0x34')]=_['intersection'](_0x523648[_0x66d6('0x31')],_0x523648['query']);_0x435eed['attributes']=_[_0x66d6('0x35')](_0x523648[_0x66d6('0x31')],qs[_0x66d6('0x36')](_0x57489c[_0x66d6('0x33')]['fields']));_0x435eed['attributes']=_0x435eed[_0x66d6('0x37')][_0x66d6('0x38')]?_0x435eed[_0x66d6('0x37')]:_0x523648[_0x66d6('0x31')];if(!_0x57489c[_0x66d6('0x33')][_0x66d6('0x39')](_0x66d6('0x3a'))){_0x435eed['limit']=qs[_0x66d6('0x22')](_0x57489c[_0x66d6('0x33')]['limit']);_0x435eed[_0x66d6('0x21')]=qs[_0x66d6('0x21')](_0x57489c[_0x66d6('0x33')][_0x66d6('0x21')]);}_0x435eed['order']=qs[_0x66d6('0x3b')](_0x57489c[_0x66d6('0x33')][_0x66d6('0x3b')]);_0x435eed['where']=qs['filters'](_[_0x66d6('0x3c')](_0x57489c[_0x66d6('0x33')],_0x523648[_0x66d6('0x34')]));if(_0x57489c[_0x66d6('0x33')]['filter']){_0x435eed[_0x66d6('0x3d')]=_[_0x66d6('0x3e')](_0x435eed[_0x66d6('0x3d')],{'$or':_['map'](_0x9ad459,function(_0x1a0224){if(_0x1a0224['type'][_0x66d6('0x3f')]!==_0x66d6('0x40')){var _0x23a0ae={};_0x23a0ae[_0x1a0224[_0x66d6('0x41')]]={'$like':'%'+_0x57489c[_0x66d6('0x33')]['filter']+'%'};return _0x23a0ae;}})});}_0x435eed=_[_0x66d6('0x3e')]({},_0x435eed,_0x57489c[_0x66d6('0x42')]);var _0xc27cdf={'where':_0x435eed[_0x66d6('0x3d')]};return db[_0x66d6('0x43')][_0x66d6('0x44')](_0xc27cdf)[_0x66d6('0x26')](function(_0x53bf6b){_0x3ec0a5[_0x66d6('0x44')]=_0x53bf6b;if(_0x57489c[_0x66d6('0x33')][_0x66d6('0x45')]){_0x435eed[_0x66d6('0x46')]=[{'all':!![]}];}return db[_0x66d6('0x43')][_0x66d6('0x47')](_0x435eed);})[_0x66d6('0x26')](function(_0x46ea33){_0x3ec0a5[_0x66d6('0x48')]=_0x46ea33;return _0x3ec0a5;})['then'](respondWithFilteredResult(_0x288bf2,_0x435eed))[_0x66d6('0x49')](handleError(_0x288bf2,null));};exports[_0x66d6('0x4a')]=function(_0x28fc61,_0x5c1ec1){var _0x8b4d52={'raw':!![],'where':{'id':_0x28fc61[_0x66d6('0x4b')]['id']}},_0x3fa359={};_0x3fa359[_0x66d6('0x31')]=_[_0x66d6('0x32')](db[_0x66d6('0x43')]['rawAttributes']);_0x3fa359[_0x66d6('0x33')]=_[_0x66d6('0x32')](_0x28fc61[_0x66d6('0x33')]);_0x3fa359[_0x66d6('0x34')]=_[_0x66d6('0x35')](_0x3fa359[_0x66d6('0x31')],_0x3fa359['query']);_0x8b4d52[_0x66d6('0x37')]=_[_0x66d6('0x35')](_0x3fa359['model'],qs[_0x66d6('0x36')](_0x28fc61[_0x66d6('0x33')]['fields']));_0x8b4d52['attributes']=_0x8b4d52[_0x66d6('0x37')]['length']?_0x8b4d52[_0x66d6('0x37')]:_0x3fa359['model'];if(_0x28fc61['query'][_0x66d6('0x45')]){_0x8b4d52['include']=[{'all':!![]}];}_0x8b4d52=_['merge']({},_0x8b4d52,_0x28fc61[_0x66d6('0x42')]);return db['FaxQueue'][_0x66d6('0x4c')](_0x8b4d52)[_0x66d6('0x26')](handleEntityNotFound(_0x5c1ec1,null))[_0x66d6('0x26')](respondWithResult(_0x5c1ec1,null))['catch'](handleError(_0x5c1ec1,null));};exports[_0x66d6('0x4d')]=function(_0x1792c6,_0x37b162){return db[_0x66d6('0x43')][_0x66d6('0x4d')](_0x1792c6['body'],{})[_0x66d6('0x26')](function(_0x21565a){var _0x47e930=_0x1792c6[_0x66d6('0x4e')][_0x66d6('0x4f')]({'plain':!![]});if(!_0x47e930)throw new Error(_0x66d6('0x50'));if(_0x47e930[_0x66d6('0x51')]==='user'){var _0x573534=_0x21565a[_0x66d6('0x4f')]({'plain':!![]});var _0x56c9b2=_0x66d6('0x28');return db['UserProfileSection'][_0x66d6('0x4c')]({'where':{'name':_0x56c9b2,'userProfileId':_0x47e930[_0x66d6('0x52')]},'raw':!![]})[_0x66d6('0x26')](function(_0x405a7b){if(_0x405a7b&&_0x405a7b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x573534['name'],'resourceId':_0x573534['id'],'type':_0x405a7b[_0x66d6('0x2d')],'sectionId':_0x405a7b['id']},{})[_0x66d6('0x26')](function(){return _0x21565a;});}else{return _0x21565a;}})[_0x66d6('0x49')](function(_0x1a9e03){logger[_0x66d6('0x2b')](_0x66d6('0x53'),_0x1a9e03);throw _0x1a9e03;});}return _0x21565a;})[_0x66d6('0x26')](respondWithResult(_0x37b162,0xc9))[_0x66d6('0x49')](handleError(_0x37b162,null));};exports[_0x66d6('0x54')]=function(_0x3bbd00,_0x3353ab){if(_0x3bbd00[_0x66d6('0x55')]['id']){delete _0x3bbd00[_0x66d6('0x55')]['id'];}return db[_0x66d6('0x43')][_0x66d6('0x4c')]({'where':{'id':_0x3bbd00[_0x66d6('0x4b')]['id']}})[_0x66d6('0x26')](handleEntityNotFound(_0x3353ab,null))[_0x66d6('0x26')](saveUpdates(_0x3bbd00[_0x66d6('0x55')],null))['then'](respondWithResult(_0x3353ab,null))[_0x66d6('0x49')](handleError(_0x3353ab,null));};exports[_0x66d6('0x27')]=function(_0x49b401,_0x23db60){return db[_0x66d6('0x43')]['find']({'where':{'id':_0x49b401[_0x66d6('0x4b')]['id']}})[_0x66d6('0x26')](handleEntityNotFound(_0x23db60,null))[_0x66d6('0x26')](removeEntity(_0x23db60,null))[_0x66d6('0x49')](handleError(_0x23db60,null));};exports[_0x66d6('0x56')]=function(_0x59ff7e,_0x451041){return db[_0x66d6('0x43')][_0x66d6('0x56')]()['then'](respondWithResult(_0x451041,null))[_0x66d6('0x49')](handleError(_0x451041,null));};exports[_0x66d6('0x57')]=function(_0x582644,_0x1f3fe1,_0x3235e2){var _0x1de75c={'raw':!![],'where':{}},_0x1b955e={},_0x42747d;return db[_0x66d6('0x43')][_0x66d6('0x58')]({'where':{'id':_0x582644[_0x66d6('0x4b')]['id']}})[_0x66d6('0x26')](handleEntityNotFound(_0x1f3fe1,null))[_0x66d6('0x26')](function(_0xffaf55){if(_0xffaf55){_0x42747d=_0xffaf55['get']({'plain':!![]});_0x1b955e[_0x66d6('0x31')]=_[_0x66d6('0x32')](db[_0x66d6('0x59')][_0x66d6('0x30')]);_0x1b955e[_0x66d6('0x33')]=_['keys'](_0x582644[_0x66d6('0x33')]);_0x1b955e['filters']=_[_0x66d6('0x35')](_0x1b955e['model'],_0x1b955e[_0x66d6('0x33')]);_0x1de75c[_0x66d6('0x37')]=_[_0x66d6('0x35')](_0x1b955e[_0x66d6('0x31')],qs[_0x66d6('0x36')](_0x582644['query']['fields']));_0x1de75c[_0x66d6('0x37')]=_0x1de75c['attributes'][_0x66d6('0x38')]?_0x1de75c[_0x66d6('0x37')]:_0x1b955e['model'];if(!_0x582644[_0x66d6('0x33')][_0x66d6('0x39')](_0x66d6('0x3a'))){_0x1de75c[_0x66d6('0x22')]=qs[_0x66d6('0x22')](_0x582644['query'][_0x66d6('0x22')]);_0x1de75c[_0x66d6('0x21')]=qs[_0x66d6('0x21')](_0x582644['query']['offset']);}_0x1de75c['order']=qs[_0x66d6('0x3b')](_0x582644['query'][_0x66d6('0x3b')]);_0x1de75c['where']=qs[_0x66d6('0x34')](_[_0x66d6('0x3c')](_0x582644[_0x66d6('0x33')],_0x1b955e[_0x66d6('0x34')]));_0x1de75c['where'][_0x66d6('0x5a')]=_0xffaf55['id'];if(_0x582644[_0x66d6('0x33')]['filter']){_0x1de75c[_0x66d6('0x3d')]=_[_0x66d6('0x3e')](_0x1de75c['where'],{'$or':_[_0x66d6('0x5b')](_0x1de75c[_0x66d6('0x37')],function(_0x19dd0d){var _0x3bc903={};_0x3bc903[_0x19dd0d]={'$like':'%'+_0x582644[_0x66d6('0x33')][_0x66d6('0x5c')]+'%'};return _0x3bc903;})});}_0x1de75c=_[_0x66d6('0x3e')]({},_0x1de75c,_0x582644[_0x66d6('0x42')]);return db[_0x66d6('0x59')]['findAll'](_0x1de75c);}})['then'](function(_0x122a97){if(_0x122a97){return db['User'][_0x66d6('0x5d')]({'where':{'id':_[_0x66d6('0x5b')](_0x122a97,'UserId'),'role':_0x66d6('0x5e')},'attributes':['id',_0x66d6('0x2d'),_0x66d6('0x5f'),_0x66d6('0x60'),'createdAt']});}})[_0x66d6('0x26')](function(_0x38b676){if(_0x38b676){return{'count':_0x38b676[_0x66d6('0x44')],'rows':_[_0x66d6('0x5b')](_0x38b676['rows'],function(_0x469f00){return{'membername':_0x469f00[_0x66d6('0x2d')],'UserId':_0x469f00['id'],'queue_name':_0x42747d[_0x66d6('0x2d')],'FaxQueueId':_0x42747d['id'],'interface':util['format'](_0x66d6('0x61'),'SIP',_0x469f00[_0x66d6('0x2d')]),'penalty':0x0,'paused':_0x469f00[_0x66d6('0x5f')],'createdAt':_0x469f00[_0x66d6('0x62')],'updatedAt':_0x469f00[_0x66d6('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x66d6('0x26')](respondWithFilteredResult(_0x1f3fe1,_0x1de75c))[_0x66d6('0x49')](handleError(_0x1f3fe1,null));};exports[_0x66d6('0x63')]=function(_0x421d6d,_0x59bb88,_0x2a4d4c){var _0x229fa2={};var _0x19b427={};var _0x114ea;var _0x133470;return db[_0x66d6('0x43')][_0x66d6('0x58')]({'where':{'id':_0x421d6d[_0x66d6('0x4b')]['id']}})[_0x66d6('0x26')](handleEntityNotFound(_0x59bb88,null))[_0x66d6('0x26')](function(_0x7ca5e){if(_0x7ca5e){_0x114ea=_0x7ca5e;_0x19b427[_0x66d6('0x31')]=_['keys'](db[_0x66d6('0x64')]['rawAttributes']);_0x19b427[_0x66d6('0x33')]=_[_0x66d6('0x32')](_0x421d6d[_0x66d6('0x33')]);_0x19b427[_0x66d6('0x34')]=_[_0x66d6('0x35')](_0x19b427[_0x66d6('0x31')],_0x19b427['query']);_0x229fa2[_0x66d6('0x37')]=_[_0x66d6('0x35')](_0x19b427[_0x66d6('0x31')],qs[_0x66d6('0x36')](_0x421d6d[_0x66d6('0x33')][_0x66d6('0x36')]));_0x229fa2[_0x66d6('0x37')]=_0x229fa2[_0x66d6('0x37')][_0x66d6('0x38')]?_0x229fa2[_0x66d6('0x37')]:_0x19b427[_0x66d6('0x31')];_0x229fa2[_0x66d6('0x65')]=qs[_0x66d6('0x3b')](_0x421d6d[_0x66d6('0x33')]['sort']);_0x229fa2[_0x66d6('0x3d')]=qs['filters'](_[_0x66d6('0x3c')](_0x421d6d[_0x66d6('0x33')],_0x19b427[_0x66d6('0x34')]));if(_0x421d6d[_0x66d6('0x33')][_0x66d6('0x5c')]){_0x229fa2[_0x66d6('0x3d')]=_[_0x66d6('0x3e')](_0x229fa2['where'],{'$or':_[_0x66d6('0x5b')](_0x229fa2[_0x66d6('0x37')],function(_0x58ac7f){var _0x5a0218={};_0x5a0218[_0x58ac7f]={'$like':'%'+_0x421d6d['query'][_0x66d6('0x5c')]+'%'};return _0x5a0218;})});}_0x229fa2=_[_0x66d6('0x3e')]({},_0x229fa2,_0x421d6d['options']);return _0x114ea[_0x66d6('0x63')](_0x229fa2);}})[_0x66d6('0x26')](function(_0x225d26){if(_0x225d26){_0x133470=_0x225d26[_0x66d6('0x38')];if(!_0x421d6d[_0x66d6('0x33')][_0x66d6('0x39')]('nolimit')){_0x229fa2[_0x66d6('0x22')]=qs[_0x66d6('0x22')](_0x421d6d[_0x66d6('0x33')][_0x66d6('0x22')]);_0x229fa2[_0x66d6('0x21')]=qs[_0x66d6('0x21')](_0x421d6d[_0x66d6('0x33')][_0x66d6('0x21')]);}return _0x114ea[_0x66d6('0x63')](_0x229fa2);}})[_0x66d6('0x26')](function(_0xfad6d7){if(_0xfad6d7){return _0xfad6d7?{'count':_0x133470,'rows':_0xfad6d7}:null;}})['then'](respondWithResult(_0x59bb88,null))[_0x66d6('0x49')](handleError(_0x59bb88,null));};exports['addTeams']=function(_0x2669e4,_0x128fa1,_0x2db5dc){var _0x643768=[];var _0x503df7;return db[_0x66d6('0x64')][_0x66d6('0x47')]({'where':{'id':_0x2669e4[_0x66d6('0x55')][_0x66d6('0x66')]},'attributes':['id'],'include':[{'model':db[_0x66d6('0x67')],'as':_0x66d6('0x68'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x45d818){if(_0x45d818){for(var _0x12c67b=0x0;_0x12c67b<_0x45d818[_0x66d6('0x38')];_0x12c67b+=0x1){for(var _0x5119d3=0x0;_0x5119d3<_0x45d818[_0x12c67b]['Agents'][_0x66d6('0x38')];_0x5119d3+=0x1){_0x643768=_['union'](_0x643768,[_0x45d818[_0x12c67b]['Agents'][_0x5119d3]['id']]);}}return _0x643768;}})[_0x66d6('0x26')](function(_0x596776){if(_0x596776){return db['FaxQueue'][_0x66d6('0x4c')]({'where':{'id':_0x2669e4['params']['id']}});}})[_0x66d6('0x26')](function(_0x10c55a){if(_0x10c55a){_0x503df7=_0x10c55a;return _0x503df7['addAgents'](_0x643768,{'penalty':_0x2669e4[_0x66d6('0x55')][_0x66d6('0x69')]});}})[_0x66d6('0x26')](function(_0x187321){if(_0x187321){return _0x503df7[_0x66d6('0x6a')](_0x2669e4['body']['ids']);}})[_0x66d6('0x26')](handleEntityNotFound(_0x128fa1,null))[_0x66d6('0x26')](respondWithStatusCode(_0x128fa1,null))['catch'](handleError(_0x128fa1,null));};exports[_0x66d6('0x6b')]=function(_0x4804a8,_0x15f41a,_0x48e6d3){var _0x12257d=[];var _0x20200b;return db[_0x66d6('0x64')][_0x66d6('0x47')]({'where':{'id':_0x4804a8['query'][_0x66d6('0x66')]},'attributes':['id'],'include':[{'model':db[_0x66d6('0x67')],'as':_0x66d6('0x68'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x2c8a48){if(_0x2c8a48){for(var _0xf7829=0x0;_0xf7829<_0x2c8a48[_0x66d6('0x38')];_0xf7829+=0x1){for(var _0x26959c=0x0;_0x26959c<_0x2c8a48[_0xf7829][_0x66d6('0x68')][_0x66d6('0x38')];_0x26959c+=0x1){_0x12257d=_[_0x66d6('0x6c')](_0x12257d,[_0x2c8a48[_0xf7829][_0x66d6('0x68')][_0x26959c]['id']]);}}return _0x12257d;}})[_0x66d6('0x26')](function(_0x2b5a6b){if(_0x2b5a6b){return db[_0x66d6('0x43')]['find']({'where':{'id':_0x4804a8[_0x66d6('0x4b')]['id']}});}})['then'](function(_0x3416e5){if(_0x3416e5){_0x20200b=_0x3416e5;return _0x20200b[_0x66d6('0x6d')](_0x12257d);}})['then'](function(_0x47846d){if(_0x20200b){return _0x20200b[_0x66d6('0x6b')](_0x4804a8[_0x66d6('0x33')][_0x66d6('0x66')]);}})[_0x66d6('0x26')](handleEntityNotFound(_0x15f41a,null))[_0x66d6('0x26')](respondWithStatusCode(_0x15f41a,null))['catch'](handleError(_0x15f41a,null));};exports[_0x66d6('0x6e')]=function(_0x24f9f8,_0x389f05,_0xfc785){return db['FaxQueue']['find']({'where':{'id':_0x24f9f8[_0x66d6('0x4b')]['id']}})[_0x66d6('0x26')](handleEntityNotFound(_0x389f05,null))['then'](function(_0x30d9b9){if(_0x30d9b9){return _0x30d9b9[_0x66d6('0x6e')](_0x24f9f8['body'][_0x66d6('0x66')],_[_0x66d6('0x6f')](_0x24f9f8[_0x66d6('0x55')],[_0x66d6('0x66'),'id'])||{})['spread'](function(_0x8fa9f6){for(var _0x3bf168=0x0;_0x3bf168<_0x24f9f8['body'][_0x66d6('0x66')][_0x66d6('0x38')];_0x3bf168+=0x1){socket[_0x66d6('0x70')](_0x66d6('0x71'),{'UserId':_0x24f9f8[_0x66d6('0x55')]['ids'][_0x3bf168],'FaxQueueId':_0x24f9f8[_0x66d6('0x4b')]['id']});}return _0x8fa9f6;});}})['then'](respondWithResult(_0x389f05,null))[_0x66d6('0x49')](handleError(_0x389f05,null));};exports[_0x66d6('0x6d')]=function(_0x30ef1d,_0x239885,_0x3430b3){var _0x503a63;return db[_0x66d6('0x43')][_0x66d6('0x4c')]({'where':{'id':_0x30ef1d[_0x66d6('0x4b')]['id']}})[_0x66d6('0x26')](handleEntityNotFound(_0x239885,null))[_0x66d6('0x26')](function(_0xf446a5){if(_0xf446a5){return _0xf446a5['removeAgents'](_0x30ef1d[_0x66d6('0x33')]['ids'])[_0x66d6('0x26')](function(_0x23b0bd){if(_['isArray'](_0x30ef1d[_0x66d6('0x33')][_0x66d6('0x66')])){for(var _0x116991=0x0;_0x116991<_0x30ef1d['query'][_0x66d6('0x66')][_0x66d6('0x38')];_0x116991+=0x1){socket[_0x66d6('0x70')](_0x66d6('0x72'),{'UserId':_0x30ef1d[_0x66d6('0x33')][_0x66d6('0x66')][_0x116991],'FaxQueueId':_0x30ef1d[_0x66d6('0x4b')]['id']});}}else{socket[_0x66d6('0x70')]('userFaxQueue:remove',{'UserId':_0x30ef1d['query'][_0x66d6('0x66')],'FaxQueueId':_0x30ef1d[_0x66d6('0x4b')]['id']});}});}})[_0x66d6('0x26')](respondWithStatusCode(_0x239885,null))[_0x66d6('0x49')](handleError(_0x239885,null));};exports[_0x66d6('0x73')]=function(_0x8a8dd4,_0x9a07d7,_0x223c8c){var _0x2015ba={};var _0x5bf6a5={};var _0x334f9f;var _0x5769f6;return db['FaxQueue'][_0x66d6('0x58')]({'where':{'id':_0x8a8dd4[_0x66d6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9a07d7,null))[_0x66d6('0x26')](function(_0x5d81f2){if(_0x5d81f2){_0x334f9f=_0x5d81f2;_0x5bf6a5[_0x66d6('0x31')]=_[_0x66d6('0x32')](db['User'][_0x66d6('0x30')]);_0x5bf6a5['query']=_[_0x66d6('0x32')](_0x8a8dd4[_0x66d6('0x33')]);_0x5bf6a5[_0x66d6('0x34')]=_[_0x66d6('0x35')](_0x5bf6a5[_0x66d6('0x31')],_0x5bf6a5[_0x66d6('0x33')]);_0x2015ba['attributes']=_[_0x66d6('0x35')](_0x5bf6a5[_0x66d6('0x31')],qs[_0x66d6('0x36')](_0x8a8dd4[_0x66d6('0x33')][_0x66d6('0x36')]));_0x2015ba[_0x66d6('0x37')]=_0x2015ba[_0x66d6('0x37')]['length']?_0x2015ba[_0x66d6('0x37')]:_0x5bf6a5[_0x66d6('0x31')];_0x2015ba['order']=qs[_0x66d6('0x3b')](_0x8a8dd4[_0x66d6('0x33')][_0x66d6('0x3b')]);_0x2015ba[_0x66d6('0x3d')]=qs[_0x66d6('0x34')](_[_0x66d6('0x3c')](_0x8a8dd4['query'],_0x5bf6a5[_0x66d6('0x34')]));if(_0x8a8dd4[_0x66d6('0x33')][_0x66d6('0x5c')]){_0x2015ba[_0x66d6('0x3d')]=_[_0x66d6('0x3e')](_0x2015ba[_0x66d6('0x3d')],{'$or':_['map'](_0x2015ba[_0x66d6('0x37')],function(_0x2350ff){var _0x548017={};_0x548017[_0x2350ff]={'$like':'%'+_0x8a8dd4[_0x66d6('0x33')][_0x66d6('0x5c')]+'%'};return _0x548017;})});}_0x2015ba=_['merge']({},_0x2015ba,_0x8a8dd4[_0x66d6('0x42')]);return _0x334f9f['getAgents'](_0x2015ba);}})[_0x66d6('0x26')](function(_0x24e746){if(_0x24e746){_0x5769f6=_0x24e746[_0x66d6('0x38')];if(!_0x8a8dd4[_0x66d6('0x33')][_0x66d6('0x39')]('nolimit')){_0x2015ba[_0x66d6('0x22')]=qs[_0x66d6('0x22')](_0x8a8dd4[_0x66d6('0x33')]['limit']);_0x2015ba[_0x66d6('0x21')]=qs[_0x66d6('0x21')](_0x8a8dd4[_0x66d6('0x33')][_0x66d6('0x21')]);}return _0x334f9f[_0x66d6('0x73')](_0x2015ba);}})[_0x66d6('0x26')](function(_0x1f7668){if(_0x1f7668){return _0x1f7668?{'count':_0x5769f6,'rows':_0x1f7668}:null;}})[_0x66d6('0x26')](respondWithResult(_0x9a07d7,null))['catch'](handleError(_0x9a07d7,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index b9bad64..925af23 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 _0xa8a8=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x30c96f,_0xd2e1f2){var _0x93297=function(_0x31792c){while(--_0x31792c){_0x30c96f['push'](_0x30c96f['shift']());}};_0x93297(++_0xd2e1f2);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4c97c9,_0xee74bb){_0x4c97c9=_0x4c97c9-0x0;var _0x2186fd=_0xa8a8[_0x4c97c9];return _0x2186fd;};'use strict';var EventEmitter=require(_0x8a8a('0x0'));var FaxQueue=require(_0x8a8a('0x1'))['db'][_0x8a8a('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8a8a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a8a('0x4'),'afterDestroy':_0x8a8a('0x5')};function emitEvent(_0xf11a08){return function(_0x3ed1de,_0x45515d,_0x1cecd4){FaxQueueEvents[_0x8a8a('0x6')](_0xf11a08+':'+_0x3ed1de['id'],_0x3ed1de);FaxQueueEvents[_0x8a8a('0x6')](_0xf11a08,_0x3ed1de);_0x1cecd4(null);};}for(var e in events){if(events[_0x8a8a('0x7')](e)){var event=events[e];FaxQueue[_0x8a8a('0x8')](e,emitEvent(event));}}module[_0x8a8a('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x50a6=['hasOwnProperty','hook','exports','events','../../mysqldb','save','remove'];(function(_0x3a18da,_0x161e82){var _0x4f74c3=function(_0x3e7d9e){while(--_0x3e7d9e){_0x3a18da['push'](_0x3a18da['shift']());}};_0x4f74c3(++_0x161e82);}(_0x50a6,0xa4));var _0x650a=function(_0x51e51e,_0x1d852d){_0x51e51e=_0x51e51e-0x0;var _0x5ce929=_0x50a6[_0x51e51e];return _0x5ce929;};'use strict';var EventEmitter=require(_0x650a('0x0'));var FaxQueue=require(_0x650a('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x650a('0x2'),'afterUpdate':'update','afterDestroy':_0x650a('0x3')};function emitEvent(_0x15dd02){return function(_0x2c71ba,_0x4a0147,_0xa3311){FaxQueueEvents['emit'](_0x15dd02+':'+_0x2c71ba['id'],_0x2c71ba);FaxQueueEvents['emit'](_0x15dd02,_0x2c71ba);_0xa3311(null);};}for(var e in events){if(events[_0x650a('0x4')](e)){var event=events[e];FaxQueue[_0x650a('0x5')](e,emitEvent(event));}}module[_0x650a('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index f0d4e6d..6ad6c1d 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 _0x142c=['define','FaxQueue','fax_queues','lodash','../../config/logger','bluebird','request-promise','./faxQueue.attributes','exports'];(function(_0xa55b1f,_0x2daca1){var _0x5506e2=function(_0x3c3726){while(--_0x3c3726){_0xa55b1f['push'](_0xa55b1f['shift']());}};_0x5506e2(++_0x2daca1);}(_0x142c,0x8a));var _0xc142=function(_0x128f51,_0x93d223){_0x128f51=_0x128f51-0x0;var _0x225a3c=_0x142c[_0x128f51];return _0x225a3c;};'use strict';var _=require(_0xc142('0x0'));var util=require('util');var logger=require(_0xc142('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc142('0x2'));var rp=require(_0xc142('0x3'));var attributes=require(_0xc142('0x4'));module[_0xc142('0x5')]=function(_0x11e083,_0x49455c){return _0x11e083[_0xc142('0x6')](_0xc142('0x7'),attributes,{'tableName':_0xc142('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb303=['api','bluebird','request-promise','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger'];(function(_0xd46330,_0xa2ac21){var _0x3e08a2=function(_0x13224d){while(--_0x13224d){_0xd46330['push'](_0xd46330['shift']());}};_0x3e08a2(++_0xa2ac21);}(_0xb303,0x1e4));var _0x3b30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb303[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3b30('0x0'));var util=require('util');var logger=require(_0x3b30('0x1'))(_0x3b30('0x2'));var moment=require('moment');var BPromise=require(_0x3b30('0x3'));var rp=require(_0x3b30('0x4'));var attributes=require(_0x3b30('0x5'));module[_0x3b30('0x6')]=function(_0x15c894,_0x49f586){return _0x15c894[_0x3b30('0x7')]('FaxQueue',attributes,{'tableName':_0x3b30('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index d4a718c..704b415 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 _0x812b=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash'];(function(_0x28123a,_0x2cb75a){var _0x1aadc1=function(_0x60fd8d){while(--_0x60fd8d){_0x28123a['push'](_0x28123a['shift']());}};_0x1aadc1(++_0x2cb75a);}(_0x812b,0xe9));var _0xb812=function(_0x16b1b8,_0x432d03){_0x16b1b8=_0x16b1b8-0x0;var _0x558b1e=_0x812b[_0x16b1b8];return _0x558b1e;};'use strict';var _=require(_0xb812('0x0'));var util=require(_0xb812('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb812('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb812('0x3'))['db'];var utils=require(_0xb812('0x4'));var logger=require(_0xb812('0x5'))(_0xb812('0x6'));var config=require(_0xb812('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb812('0x8')]({'port':0x232a});config[_0xb812('0x9')]=_[_0xb812('0xa')](config['redis'],{'host':_0xb812('0xb'),'port':0x18eb});var socket=require(_0xb812('0xc'))(new Redis(config[_0xb812('0x9')]));require('./faxQueue.socket')[_0xb812('0xd')](socket);function respondWithRpcPromise(_0x2f61aa,_0x435cbe,_0x416252){return new BPromise(function(_0x104814,_0x1f3a8e){return client[_0xb812('0xe')](_0x2f61aa,_0x416252)[_0xb812('0xf')](function(_0x9b4f4d){logger[_0xb812('0x10')](_0xb812('0x11'),_0x435cbe,'request\x20sent');logger[_0xb812('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x435cbe,_0xb812('0x13'),JSON[_0xb812('0x14')](_0x9b4f4d));if(_0x9b4f4d[_0xb812('0x15')]){if(_0x9b4f4d[_0xb812('0x15')][_0xb812('0x16')]===0x1f4){logger[_0xb812('0x15')](_0xb812('0x11'),_0x435cbe,_0x9b4f4d[_0xb812('0x15')][_0xb812('0x17')]);return _0x1f3a8e(_0x9b4f4d[_0xb812('0x15')]['message']);}logger[_0xb812('0x15')](_0xb812('0x11'),_0x435cbe,_0x9b4f4d[_0xb812('0x15')][_0xb812('0x17')]);return _0x104814(_0x9b4f4d['error'][_0xb812('0x17')]);}else{logger['info'](_0xb812('0x11'),_0x435cbe,_0xb812('0x13'));_0x104814(_0x9b4f4d[_0xb812('0x18')]['message']);}})[_0xb812('0x19')](function(_0x5d2204){logger['error'](_0xb812('0x11'),_0x435cbe,_0x5d2204);_0x1f3a8e(_0x5d2204);});});}exports[_0xb812('0x1a')]=function(_0x3a6281){var _0x17d287=this;return new Promise(function(_0x1ce808,_0x4a3877){return db[_0xb812('0x1b')][_0xb812('0x1c')]({'raw':_0x3a6281[_0xb812('0x1d')]?_0x3a6281[_0xb812('0x1d')][_0xb812('0x1e')]===undefined?!![]:![]:!![],'where':_0x3a6281['options']?_0x3a6281[_0xb812('0x1d')][_0xb812('0x1f')]||null:null,'attributes':_0x3a6281[_0xb812('0x1d')]?_0x3a6281[_0xb812('0x1d')][_0xb812('0x20')]||null:null,'limit':_0x3a6281[_0xb812('0x1d')]?_0x3a6281[_0xb812('0x1d')][_0xb812('0x21')]||null:null,'include':_0x3a6281['options']?_0x3a6281[_0xb812('0x1d')][_0xb812('0x22')]?_[_0xb812('0x23')](_0x3a6281['options'][_0xb812('0x22')],function(_0x4d16fb){return{'model':db[_0x4d16fb[_0xb812('0x24')]],'as':_0x4d16fb['as'],'attributes':_0x4d16fb[_0xb812('0x20')],'include':_0x4d16fb[_0xb812('0x22')]?_[_0xb812('0x23')](_0x4d16fb[_0xb812('0x22')],function(_0x126ba6){return{'model':db[_0x126ba6[_0xb812('0x24')]],'as':_0x126ba6['as'],'attributes':_0x126ba6[_0xb812('0x20')],'include':_0x126ba6['include']?_[_0xb812('0x23')](_0x126ba6[_0xb812('0x22')],function(_0x3ea69c){return{'model':db[_0x3ea69c[_0xb812('0x24')]],'as':_0x3ea69c['as'],'attributes':_0x3ea69c[_0xb812('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb812('0xf')](function(_0x2cc928){logger[_0xb812('0x10')](_0xb812('0x1a'),_0x3a6281);logger['debug'](_0xb812('0x1a'),_0x3a6281,JSON[_0xb812('0x14')](_0x2cc928));_0x1ce808(_0x2cc928);})[_0xb812('0x19')](function(_0x35aa6c){logger[_0xb812('0x15')](_0xb812('0x1a'),_0x35aa6c[_0xb812('0x17')],_0x3a6281);_0x4a3877(_0x17d287[_0xb812('0x15')](0x1f4,_0x35aa6c[_0xb812('0x17')]));});});};exports[_0xb812('0x25')]=function(_0x3f5924){var _0x2cdbb4=this;return new Promise(function(_0x2a0ce5,_0x2366c0){return db['FaxQueue'][_0xb812('0x26')]({'raw':_0x3f5924[_0xb812('0x1d')]?_0x3f5924[_0xb812('0x1d')][_0xb812('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f5924[_0xb812('0x1d')]?_0x3f5924['options'][_0xb812('0x1f')]||null:null,'attributes':_0x3f5924[_0xb812('0x1d')]?_0x3f5924[_0xb812('0x1d')][_0xb812('0x20')]||null:null,'include':_0x3f5924['options']?_0x3f5924['options'][_0xb812('0x22')]?_[_0xb812('0x23')](_0x3f5924[_0xb812('0x1d')]['include'],function(_0xdf0bd7){return{'model':db[_0xdf0bd7[_0xb812('0x24')]],'as':_0xdf0bd7['as'],'attributes':_0xdf0bd7[_0xb812('0x20')],'include':_0xdf0bd7['include']?_['map'](_0xdf0bd7[_0xb812('0x22')],function(_0x22f1d0){return{'model':db[_0x22f1d0['model']],'as':_0x22f1d0['as'],'attributes':_0x22f1d0[_0xb812('0x20')],'include':_0x22f1d0[_0xb812('0x22')]?_[_0xb812('0x23')](_0x22f1d0[_0xb812('0x22')],function(_0x503e35){return{'model':db[_0x503e35[_0xb812('0x24')]],'as':_0x503e35['as'],'attributes':_0x503e35[_0xb812('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18df6e){logger[_0xb812('0x10')]('ShowFaxQueue',_0x3f5924);logger[_0xb812('0x12')](_0xb812('0x25'),_0x3f5924,JSON[_0xb812('0x14')](_0x18df6e));_0x2a0ce5(_0x18df6e);})[_0xb812('0x19')](function(_0x233cac){logger[_0xb812('0x15')](_0xb812('0x25'),_0x233cac['message'],_0x3f5924);_0x2366c0(_0x2cdbb4['error'](0x1f4,_0x233cac['message']));});});}; \ No newline at end of file +var _0x8bef=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','model','map','then','stringify','catch','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x281bd0,_0x18e3ad){var _0x222fee=function(_0x13e0a2){while(--_0x13e0a2){_0x281bd0['push'](_0x281bd0['shift']());}};_0x222fee(++_0x18e3ad);}(_0x8bef,0x192));var _0xf8be=function(_0x3bce39,_0x3edeff){_0x3bce39=_0x3bce39-0x0;var _0x424c8f=_0x8bef[_0x3bce39];return _0x424c8f;};'use strict';var _=require(_0xf8be('0x0'));var util=require(_0xf8be('0x1'));var moment=require(_0xf8be('0x2'));var BPromise=require(_0xf8be('0x3'));var rs=require(_0xf8be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8be('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8be('0x6'))(_0xf8be('0x7'));var config=require(_0xf8be('0x8'));var jayson=require(_0xf8be('0x9'));var client=jayson[_0xf8be('0xa')][_0xf8be('0xb')]({'port':0x232a});config['redis']=_[_0xf8be('0xc')](config[_0xf8be('0xd')],{'host':_0xf8be('0xe'),'port':0x18eb});var socket=require(_0xf8be('0xf'))(new Redis(config[_0xf8be('0xd')]));require(_0xf8be('0x10'))[_0xf8be('0x11')](socket);function respondWithRpcPromise(_0x55cf23,_0x4896f6,_0xfc217c){return new BPromise(function(_0x4dd4be,_0x246a8b){return client['request'](_0x55cf23,_0xfc217c)['then'](function(_0x352257){logger[_0xf8be('0x12')](_0xf8be('0x13'),_0x4896f6,_0xf8be('0x14'));logger[_0xf8be('0x15')](_0xf8be('0x16'),_0x4896f6,'request\x20sent',JSON['stringify'](_0x352257));if(_0x352257[_0xf8be('0x17')]){if(_0x352257['error'][_0xf8be('0x18')]===0x1f4){logger[_0xf8be('0x17')]('FaxQueue,\x20%s,\x20%s',_0x4896f6,_0x352257[_0xf8be('0x17')][_0xf8be('0x19')]);return _0x246a8b(_0x352257[_0xf8be('0x17')]['message']);}logger[_0xf8be('0x17')](_0xf8be('0x13'),_0x4896f6,_0x352257[_0xf8be('0x17')][_0xf8be('0x19')]);return _0x4dd4be(_0x352257[_0xf8be('0x17')][_0xf8be('0x19')]);}else{logger[_0xf8be('0x12')]('FaxQueue,\x20%s,\x20%s',_0x4896f6,_0xf8be('0x14'));_0x4dd4be(_0x352257['result'][_0xf8be('0x19')]);}})['catch'](function(_0x11845d){logger[_0xf8be('0x17')](_0xf8be('0x13'),_0x4896f6,_0x11845d);_0x246a8b(_0x11845d);});});}exports[_0xf8be('0x1a')]=function(_0x346324){var _0x5ab753=this;return new Promise(function(_0x13ea32,_0x3ed7dd){return db[_0xf8be('0x1b')][_0xf8be('0x1c')]({'raw':_0x346324[_0xf8be('0x1d')]?_0x346324['options'][_0xf8be('0x1e')]===undefined?!![]:![]:!![],'where':_0x346324[_0xf8be('0x1d')]?_0x346324[_0xf8be('0x1d')][_0xf8be('0x1f')]||null:null,'attributes':_0x346324[_0xf8be('0x1d')]?_0x346324[_0xf8be('0x1d')][_0xf8be('0x20')]||null:null,'limit':_0x346324['options']?_0x346324['options']['limit']||null:null,'include':_0x346324[_0xf8be('0x1d')]?_0x346324[_0xf8be('0x1d')][_0xf8be('0x21')]?_['map'](_0x346324[_0xf8be('0x1d')][_0xf8be('0x21')],function(_0x1d0187){return{'model':db[_0x1d0187['model']],'as':_0x1d0187['as'],'attributes':_0x1d0187[_0xf8be('0x20')],'include':_0x1d0187[_0xf8be('0x21')]?_['map'](_0x1d0187['include'],function(_0x4ef027){return{'model':db[_0x4ef027[_0xf8be('0x22')]],'as':_0x4ef027['as'],'attributes':_0x4ef027[_0xf8be('0x20')],'include':_0x4ef027[_0xf8be('0x21')]?_[_0xf8be('0x23')](_0x4ef027['include'],function(_0x13d2eb){return{'model':db[_0x13d2eb[_0xf8be('0x22')]],'as':_0x13d2eb['as'],'attributes':_0x13d2eb[_0xf8be('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf8be('0x24')](function(_0x5dc544){logger[_0xf8be('0x12')](_0xf8be('0x1a'),_0x346324);logger['debug']('GetFaxQueue',_0x346324,JSON[_0xf8be('0x25')](_0x5dc544));_0x13ea32(_0x5dc544);})[_0xf8be('0x26')](function(_0x4fdf59){logger[_0xf8be('0x17')](_0xf8be('0x1a'),_0x4fdf59[_0xf8be('0x19')],_0x346324);_0x3ed7dd(_0x5ab753['error'](0x1f4,_0x4fdf59['message']));});});};exports[_0xf8be('0x27')]=function(_0x2a2dde){var _0x39ae9e=this;return new Promise(function(_0x3289da,_0x5cfb44){return db[_0xf8be('0x1b')][_0xf8be('0x28')]({'raw':_0x2a2dde[_0xf8be('0x1d')]?_0x2a2dde['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a2dde[_0xf8be('0x1d')]?_0x2a2dde['options']['where']||null:null,'attributes':_0x2a2dde[_0xf8be('0x1d')]?_0x2a2dde['options'][_0xf8be('0x20')]||null:null,'include':_0x2a2dde['options']?_0x2a2dde[_0xf8be('0x1d')]['include']?_[_0xf8be('0x23')](_0x2a2dde['options'][_0xf8be('0x21')],function(_0x2381d2){return{'model':db[_0x2381d2[_0xf8be('0x22')]],'as':_0x2381d2['as'],'attributes':_0x2381d2['attributes'],'include':_0x2381d2['include']?_['map'](_0x2381d2['include'],function(_0x4dc913){return{'model':db[_0x4dc913[_0xf8be('0x22')]],'as':_0x4dc913['as'],'attributes':_0x4dc913[_0xf8be('0x20')],'include':_0x4dc913[_0xf8be('0x21')]?_[_0xf8be('0x23')](_0x4dc913[_0xf8be('0x21')],function(_0x541017){return{'model':db[_0x541017['model']],'as':_0x541017['as'],'attributes':_0x541017[_0xf8be('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dc708){logger[_0xf8be('0x12')](_0xf8be('0x27'),_0x2a2dde);logger[_0xf8be('0x15')](_0xf8be('0x27'),_0x2a2dde,JSON['stringify'](_0x5dc708));_0x3289da(_0x5dc708);})[_0xf8be('0x26')](function(_0x5ee9f6){logger[_0xf8be('0x17')](_0xf8be('0x27'),_0x5ee9f6['message'],_0x2a2dde);_0x5cfb44(_0x39ae9e['error'](0x1f4,_0x5ee9f6['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index e14b7b4..7a758e8 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 _0x8df6=['length','faxQueue:','./faxQueue.events','remove','update','emit','register'];(function(_0x194ecf,_0x2f04fc){var _0x5341c6=function(_0x400b04){while(--_0x400b04){_0x194ecf['push'](_0x194ecf['shift']());}};_0x5341c6(++_0x2f04fc);}(_0x8df6,0x191));var _0x68df=function(_0xeff6d9,_0x364b67){_0xeff6d9=_0xeff6d9-0x0;var _0x733943=_0x8df6[_0xeff6d9];return _0x733943;};'use strict';var FaxQueueEvents=require(_0x68df('0x0'));var events=['save',_0x68df('0x1'),_0x68df('0x2')];function createListener(_0x508194,_0x3a85e1){return function(_0x5adc52){_0x3a85e1[_0x68df('0x3')](_0x508194,_0x5adc52);};}function removeListener(_0x403d31,_0x56d0b){return function(){FaxQueueEvents['removeListener'](_0x403d31,_0x56d0b);};}exports[_0x68df('0x4')]=function(_0x3bf872){for(var _0x3e08a1=0x0,_0x3830ff=events[_0x68df('0x5')];_0x3e08a1<_0x3830ff;_0x3e08a1++){var _0x3d0a58=events[_0x3e08a1];var _0x2402f9=createListener(_0x68df('0x6')+_0x3d0a58,_0x3bf872);FaxQueueEvents['on'](_0x3d0a58,_0x2402f9);}}; \ No newline at end of file +var _0x7043=['register','length','faxQueue:','emit','removeListener'];(function(_0x274e0e,_0x3aace4){var _0x4ca356=function(_0x59e7a3){while(--_0x59e7a3){_0x274e0e['push'](_0x274e0e['shift']());}};_0x4ca356(++_0x3aace4);}(_0x7043,0xc6));var _0x3704=function(_0x4034b2,_0x40e7b5){_0x4034b2=_0x4034b2-0x0;var _0x4d57c3=_0x7043[_0x4034b2];return _0x4d57c3;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save','remove','update'];function createListener(_0x524e41,_0x2d1833){return function(_0xe01d4b){_0x2d1833[_0x3704('0x0')](_0x524e41,_0xe01d4b);};}function removeListener(_0x150dd4,_0x210c03){return function(){FaxQueueEvents[_0x3704('0x1')](_0x150dd4,_0x210c03);};}exports[_0x3704('0x2')]=function(_0x382361){for(var _0x58919c=0x0,_0x5ad103=events[_0x3704('0x3')];_0x58919c<_0x5ad103;_0x58919c++){var _0x41d2e4=events[_0x58919c];var _0x25da5a=createListener(_0x3704('0x4')+_0x41d2e4,_0x382361);FaxQueueEvents['on'](_0x41d2e4,_0x25da5a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index de1632c..2efbfc3 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 _0x4f61=['./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addAgents','put','update','delete','destroy','removeTeams','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x4f61,0x149));var _0x14f6=function(_0x52a7d0,_0x3bb98f){_0x52a7d0=_0x52a7d0-0x0;var _0x3a2f7c=_0x4f61[_0x52a7d0];return _0x3a2f7c;};'use strict';var multer=require(_0x14f6('0x0'));var util=require(_0x14f6('0x1'));var path=require(_0x14f6('0x2'));var timeout=require('connect-timeout');var express=require(_0x14f6('0x3'));var router=express[_0x14f6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x14f6('0x5'));var config=require(_0x14f6('0x6'));var controller=require(_0x14f6('0x7'));router[_0x14f6('0x8')]('/',auth[_0x14f6('0x9')](),controller[_0x14f6('0xa')]);router['get'](_0x14f6('0xb'),auth[_0x14f6('0x9')](),controller[_0x14f6('0xc')]);router[_0x14f6('0x8')](_0x14f6('0xd'),auth['isAuthenticated'](),controller[_0x14f6('0xe')]);router[_0x14f6('0x8')](_0x14f6('0xf'),auth['isAuthenticated'](),controller[_0x14f6('0x10')]);router[_0x14f6('0x8')]('/:id/teams',auth[_0x14f6('0x9')](),controller[_0x14f6('0x11')]);router[_0x14f6('0x8')](_0x14f6('0x12'),auth[_0x14f6('0x9')](),controller['getAgents']);router[_0x14f6('0x13')]('/',auth[_0x14f6('0x9')](),controller[_0x14f6('0x14')]);router[_0x14f6('0x13')](_0x14f6('0x15'),auth[_0x14f6('0x9')](),controller['addTeams']);router[_0x14f6('0x13')](_0x14f6('0x12'),auth['isAuthenticated'](),controller[_0x14f6('0x16')]);router[_0x14f6('0x17')](_0x14f6('0xd'),auth[_0x14f6('0x9')](),controller[_0x14f6('0x18')]);router[_0x14f6('0x19')](_0x14f6('0xd'),auth[_0x14f6('0x9')](),controller[_0x14f6('0x1a')]);router[_0x14f6('0x19')](_0x14f6('0x15'),auth['isAuthenticated'](),controller[_0x14f6('0x1b')]);router[_0x14f6('0x19')](_0x14f6('0x12'),auth[_0x14f6('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x8e61=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x2549b9,_0x3a0564){var _0x3366bb=function(_0x2c649a){while(--_0x2c649a){_0x2549b9['push'](_0x2549b9['shift']());}};_0x3366bb(++_0x3a0564);}(_0x8e61,0x1cc));var _0x18e6=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8e61[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x18e6('0x0'));var util=require(_0x18e6('0x1'));var path=require(_0x18e6('0x2'));var timeout=require(_0x18e6('0x3'));var express=require('express');var router=express[_0x18e6('0x4')]();var auth=require(_0x18e6('0x5'));var interaction=require(_0x18e6('0x6'));var config=require(_0x18e6('0x7'));var controller=require('./faxQueue.controller');router[_0x18e6('0x8')]('/',auth[_0x18e6('0x9')](),controller[_0x18e6('0xa')]);router['get'](_0x18e6('0xb'),auth[_0x18e6('0x9')](),controller[_0x18e6('0xc')]);router['get'](_0x18e6('0xd'),auth[_0x18e6('0x9')](),controller[_0x18e6('0xe')]);router['get'](_0x18e6('0xf'),auth[_0x18e6('0x9')](),controller[_0x18e6('0x10')]);router[_0x18e6('0x8')](_0x18e6('0x11'),auth[_0x18e6('0x9')](),controller['getTeams']);router[_0x18e6('0x8')](_0x18e6('0x12'),auth[_0x18e6('0x9')](),controller[_0x18e6('0x13')]);router[_0x18e6('0x14')]('/',auth[_0x18e6('0x9')](),controller[_0x18e6('0x15')]);router['post'](_0x18e6('0x11'),auth[_0x18e6('0x9')](),controller[_0x18e6('0x16')]);router[_0x18e6('0x14')](_0x18e6('0x12'),auth[_0x18e6('0x9')](),controller[_0x18e6('0x17')]);router[_0x18e6('0x18')](_0x18e6('0xd'),auth[_0x18e6('0x9')](),controller['update']);router[_0x18e6('0x19')](_0x18e6('0xd'),auth[_0x18e6('0x9')](),controller['destroy']);router[_0x18e6('0x19')](_0x18e6('0x11'),auth[_0x18e6('0x9')](),controller[_0x18e6('0x1a')]);router[_0x18e6('0x19')](_0x18e6('0x12'),auth[_0x18e6('0x9')](),controller[_0x18e6('0x1b')]);module[_0x18e6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 10d99be..016de91 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 _0x3db7=['STRING','DATE','moment','sequelize','exports'];(function(_0x236cdf,_0x21a3aa){var _0x4b1841=function(_0x490deb){while(--_0x490deb){_0x236cdf['push'](_0x236cdf['shift']());}};_0x4b1841(++_0x21a3aa);}(_0x3db7,0x13d));var _0x73db=function(_0x59b80f,_0xd5b4f1){_0x59b80f=_0x59b80f-0x0;var _0x1652aa=_0x3db7[_0x59b80f];return _0x1652aa;};'use strict';var moment=require(_0x73db('0x0'));var Sequelize=require(_0x73db('0x1'));module[_0x73db('0x2')]={'uniqueid':{'type':Sequelize[_0x73db('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x73db('0x3')]},'joinAt':{'type':Sequelize[_0x73db('0x4')]},'leaveAt':{'type':Sequelize[_0x73db('0x4')]},'acceptAt':{'type':Sequelize[_0x73db('0x4')]},'exitAt':{'type':Sequelize[_0x73db('0x4')]},'reason':{'type':Sequelize[_0x73db('0x3')]}}; \ No newline at end of file +var _0x975c=['moment','sequelize','STRING','DATE'];(function(_0xa10a3f,_0x24ad3c){var _0x2a5321=function(_0x5b91b2){while(--_0x5b91b2){_0xa10a3f['push'](_0xa10a3f['shift']());}};_0x2a5321(++_0x24ad3c);}(_0x975c,0x194));var _0xc975=function(_0x3e36d5,_0x3c0359){_0x3e36d5=_0x3e36d5-0x0;var _0x3ebbff=_0x975c[_0x3e36d5];return _0x3ebbff;};'use strict';var moment=require(_0xc975('0x0'));var Sequelize=require(_0xc975('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc975('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc975('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc975('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc975('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 8ddd116..16b3108 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 _0xf0a2=['save','update','then','error','stack','name','send','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','FaxQueueReport','count','findAll','rows','show','params','rawAttributes','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','apply','reject'];(function(_0x3a6e34,_0x1e0341){var _0x5094f6=function(_0x35b5bb){while(--_0x35b5bb){_0x3a6e34['push'](_0x3a6e34['shift']());}};_0x5094f6(++_0x1e0341);}(_0xf0a2,0x74));var _0x2f0a=function(_0x4a50c3,_0x4a3157){_0x4a50c3=_0x4a50c3-0x0;var _0x514985=_0xf0a2[_0x4a50c3];return _0x514985;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2f0a('0x0'));var rimraf=require(_0x2f0a('0x1'));var zipdir=require(_0x2f0a('0x2'));var jsonpatch=require(_0x2f0a('0x3'));var rp=require(_0x2f0a('0x4'));var moment=require(_0x2f0a('0x5'));var BPromise=require(_0x2f0a('0x6'));var Mustache=require(_0x2f0a('0x7'));var util=require(_0x2f0a('0x8'));var path=require(_0x2f0a('0x9'));var sox=require(_0x2f0a('0xa'));var csv=require(_0x2f0a('0xb'));var ejs=require(_0x2f0a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2f0a('0xd'));var crypto=require(_0x2f0a('0xe'));var jsforce=require(_0x2f0a('0xf'));var deskjs=require(_0x2f0a('0x10'));var toCsv=require(_0x2f0a('0xb'));var querystring=require('querystring');var Papa=require(_0x2f0a('0x11'));var authService=require(_0x2f0a('0x12'));var hardwareService=require(_0x2f0a('0x13'));var Redis=require('ioredis');var qs=require(_0x2f0a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2f0a('0x15'));var config=require(_0x2f0a('0x16'));var db=require(_0x2f0a('0x17'))['db'];function respondWithStatusCode(_0x15aae9,_0x22b4cf){_0x22b4cf=_0x22b4cf||0xcc;return function(_0x290207){if(_0x290207){return _0x15aae9[_0x2f0a('0x18')](_0x22b4cf);}return _0x15aae9['status'](_0x22b4cf)[_0x2f0a('0x19')]();};}function respondWithResult(_0x187a6c,_0x39c73d){_0x39c73d=_0x39c73d||0xc8;return function(_0x109689){if(_0x109689){return _0x187a6c[_0x2f0a('0x1a')](_0x39c73d)[_0x2f0a('0x1b')](_0x109689);}};}function respondWithFilteredResult(_0xfc0cf0,_0x40effc){return function(_0x2a418b){if(_0x2a418b){var _0x1a7607=_0x2a418b['count'],_0x193e81=_0x40effc[_0x2f0a('0x1c')],_0x1a0ac0=_0x40effc[_0x2f0a('0x1c')]+_0x40effc[_0x2f0a('0x1d')],_0x9cfd72;if(_0x1a0ac0>=_0x1a7607){_0x1a0ac0=_0x1a7607;_0x9cfd72=0xc8;}else{_0x9cfd72=0xce;}_0xfc0cf0[_0x2f0a('0x1a')](_0x9cfd72);return _0xfc0cf0['set']('Content-Range',_0x193e81+'-'+_0x1a0ac0+'/'+_0x1a7607)[_0x2f0a('0x1b')](_0x2a418b);}return null;};}function patchUpdates(_0x4a114b){return function(_0x60f1ee){try{jsonpatch[_0x2f0a('0x1e')](_0x60f1ee,_0x4a114b,!![]);}catch(_0x16618b){return BPromise[_0x2f0a('0x1f')](_0x16618b);}return _0x60f1ee[_0x2f0a('0x20')]();};}function saveUpdates(_0x19966f,_0x3426ed){return function(_0x508c80){if(_0x508c80){return _0x508c80[_0x2f0a('0x21')](_0x19966f)['then'](function(_0x4662fa){return _0x4662fa;});}return null;};}function removeEntity(_0x35f414,_0x1c6fb1){return function(_0x5cdf2b){if(_0x5cdf2b){return _0x5cdf2b['destroy']()[_0x2f0a('0x22')](function(){_0x35f414[_0x2f0a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27857f,_0x4513eb){return function(_0x520e53){if(!_0x520e53){_0x27857f[_0x2f0a('0x18')](0x194);}return _0x520e53;};}function handleError(_0x4890f3,_0x1a9120){_0x1a9120=_0x1a9120||0x1f4;return function(_0xdb0921){logger[_0x2f0a('0x23')](_0xdb0921[_0x2f0a('0x24')]);if(_0xdb0921[_0x2f0a('0x25')]){delete _0xdb0921[_0x2f0a('0x25')];}_0x4890f3[_0x2f0a('0x1a')](_0x1a9120)[_0x2f0a('0x26')](_0xdb0921);};}exports['index']=function(_0x4faf82,_0xe17b36){var _0x12d2ec={},_0x42ce5a={},_0x5e6014={'count':0x0,'rows':[]};var _0x10a2c3=db['FaxQueueReport']['rawAttributes'];_0x42ce5a[_0x2f0a('0x27')]=_[_0x2f0a('0x28')](_0x10a2c3);_0x42ce5a[_0x2f0a('0x29')]=_['keys'](_0x4faf82['query']);_0x42ce5a['filters']=_[_0x2f0a('0x2a')](_0x42ce5a['model'],_0x42ce5a[_0x2f0a('0x29')]);_0x12d2ec[_0x2f0a('0x2b')]=_[_0x2f0a('0x2a')](_0x42ce5a['model'],qs[_0x2f0a('0x2c')](_0x4faf82[_0x2f0a('0x29')][_0x2f0a('0x2c')]));_0x12d2ec[_0x2f0a('0x2b')]=_0x12d2ec[_0x2f0a('0x2b')][_0x2f0a('0x2d')]?_0x12d2ec[_0x2f0a('0x2b')]:_0x42ce5a[_0x2f0a('0x27')];if(!_0x4faf82[_0x2f0a('0x29')][_0x2f0a('0x2e')](_0x2f0a('0x2f'))){_0x12d2ec[_0x2f0a('0x1d')]=qs[_0x2f0a('0x1d')](_0x4faf82['query'][_0x2f0a('0x1d')]);_0x12d2ec[_0x2f0a('0x1c')]=qs['offset'](_0x4faf82[_0x2f0a('0x29')][_0x2f0a('0x1c')]);}_0x12d2ec[_0x2f0a('0x30')]=qs[_0x2f0a('0x31')](_0x4faf82[_0x2f0a('0x29')]['sort']);_0x12d2ec['where']=qs[_0x2f0a('0x32')](_[_0x2f0a('0x33')](_0x4faf82[_0x2f0a('0x29')],_0x42ce5a[_0x2f0a('0x32')]));if(_0x4faf82[_0x2f0a('0x29')][_0x2f0a('0x34')]){_0x12d2ec[_0x2f0a('0x35')]=_[_0x2f0a('0x36')](_0x12d2ec[_0x2f0a('0x35')],{'$or':_[_0x2f0a('0x37')](_0x10a2c3,function(_0x343400){if(_0x343400[_0x2f0a('0x38')][_0x2f0a('0x39')]!==_0x2f0a('0x3a')){var _0xd6e65d={};_0xd6e65d[_0x343400[_0x2f0a('0x3b')]]={'$like':'%'+_0x4faf82[_0x2f0a('0x29')][_0x2f0a('0x34')]+'%'};return _0xd6e65d;}})});}_0x12d2ec=_[_0x2f0a('0x36')]({},_0x12d2ec,_0x4faf82[_0x2f0a('0x3c')]);var _0x521562={'where':_0x12d2ec['where']};return db[_0x2f0a('0x3d')][_0x2f0a('0x3e')](_0x521562)[_0x2f0a('0x22')](function(_0x406f4a){_0x5e6014[_0x2f0a('0x3e')]=_0x406f4a;if(_0x4faf82[_0x2f0a('0x29')]['includeAll']){_0x12d2ec['include']=[{'all':!![]}];}return db[_0x2f0a('0x3d')][_0x2f0a('0x3f')](_0x12d2ec);})[_0x2f0a('0x22')](function(_0x18f259){_0x5e6014[_0x2f0a('0x40')]=_0x18f259;return _0x5e6014;})[_0x2f0a('0x22')](respondWithFilteredResult(_0xe17b36,_0x12d2ec))['catch'](handleError(_0xe17b36,null));};exports[_0x2f0a('0x41')]=function(_0x27c1cd,_0x168b61){var _0x53d650={'raw':!![],'where':{'id':_0x27c1cd[_0x2f0a('0x42')]['id']}},_0xc7ec15={};_0xc7ec15[_0x2f0a('0x27')]=_[_0x2f0a('0x28')](db[_0x2f0a('0x3d')][_0x2f0a('0x43')]);_0xc7ec15[_0x2f0a('0x29')]=_[_0x2f0a('0x28')](_0x27c1cd[_0x2f0a('0x29')]);_0xc7ec15[_0x2f0a('0x32')]=_[_0x2f0a('0x2a')](_0xc7ec15[_0x2f0a('0x27')],_0xc7ec15['query']);_0x53d650[_0x2f0a('0x2b')]=_[_0x2f0a('0x2a')](_0xc7ec15[_0x2f0a('0x27')],qs['fields'](_0x27c1cd[_0x2f0a('0x29')][_0x2f0a('0x2c')]));_0x53d650[_0x2f0a('0x2b')]=_0x53d650[_0x2f0a('0x2b')][_0x2f0a('0x2d')]?_0x53d650['attributes']:_0xc7ec15[_0x2f0a('0x27')];if(_0x27c1cd[_0x2f0a('0x29')]['includeAll']){_0x53d650['include']=[{'all':!![]}];}_0x53d650=_[_0x2f0a('0x36')]({},_0x53d650,_0x27c1cd['options']);return db[_0x2f0a('0x3d')]['find'](_0x53d650)[_0x2f0a('0x22')](handleEntityNotFound(_0x168b61,null))[_0x2f0a('0x22')](respondWithResult(_0x168b61,null))[_0x2f0a('0x44')](handleError(_0x168b61,null));};exports[_0x2f0a('0x45')]=function(_0x21c2d0,_0x4fb866){return db[_0x2f0a('0x3d')][_0x2f0a('0x45')](_0x21c2d0[_0x2f0a('0x46')],{})[_0x2f0a('0x22')](respondWithResult(_0x4fb866,0xc9))[_0x2f0a('0x44')](handleError(_0x4fb866,null));};exports['update']=function(_0x5eb062,_0xdaa6be){if(_0x5eb062[_0x2f0a('0x46')]['id']){delete _0x5eb062[_0x2f0a('0x46')]['id'];}return db[_0x2f0a('0x3d')][_0x2f0a('0x47')]({'where':{'id':_0x5eb062[_0x2f0a('0x42')]['id']}})[_0x2f0a('0x22')](handleEntityNotFound(_0xdaa6be,null))[_0x2f0a('0x22')](saveUpdates(_0x5eb062[_0x2f0a('0x46')],null))[_0x2f0a('0x22')](respondWithResult(_0xdaa6be,null))['catch'](handleError(_0xdaa6be,null));};exports[_0x2f0a('0x48')]=function(_0x113efb,_0xd36db9){return db['FaxQueueReport'][_0x2f0a('0x47')]({'where':{'id':_0x113efb[_0x2f0a('0x42')]['id']}})[_0x2f0a('0x22')](handleEntityNotFound(_0xd36db9,null))[_0x2f0a('0x22')](removeEntity(_0xd36db9,null))[_0x2f0a('0x44')](handleError(_0xd36db9,null));};exports[_0x2f0a('0x49')]=function(_0x530c0e,_0x295506){return db['FaxQueueReport'][_0x2f0a('0x49')]()[_0x2f0a('0x22')](respondWithResult(_0x295506,null))[_0x2f0a('0x44')](handleError(_0x295506,null));}; \ No newline at end of file +var _0x0393=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','key','VIRTUAL','field','filter','options','FaxQueueReport','includeAll','rows','catch','show','params','include','create','body','update','find','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','error','stack','name','send','rawAttributes','keys','query','model','intersection'];(function(_0x2f2c2b,_0x2a36c9){var _0x4bb508=function(_0x2cf266){while(--_0x2cf266){_0x2f2c2b['push'](_0x2f2c2b['shift']());}};_0x4bb508(++_0x2a36c9);}(_0x0393,0x68));var _0x3039=function(_0x3ebf97,_0x43920f){_0x3ebf97=_0x3ebf97-0x0;var _0x5106eb=_0x0393[_0x3ebf97];return _0x5106eb;};'use strict';var pdf=require(_0x3039('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3039('0x1'));var zipdir=require(_0x3039('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3039('0x3'));var moment=require('moment');var BPromise=require(_0x3039('0x4'));var Mustache=require(_0x3039('0x5'));var util=require(_0x3039('0x6'));var path=require(_0x3039('0x7'));var sox=require('sox');var csv=require(_0x3039('0x8'));var ejs=require(_0x3039('0x9'));var fs=require('fs');var _=require(_0x3039('0xa'));var squel=require(_0x3039('0xb'));var crypto=require(_0x3039('0xc'));var jsforce=require(_0x3039('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3039('0x8'));var querystring=require(_0x3039('0xe'));var Papa=require(_0x3039('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x3039('0x10'));var Redis=require(_0x3039('0x11'));var qs=require(_0x3039('0x12'));var logger=require(_0x3039('0x13'))(_0x3039('0x14'));var utils=require(_0x3039('0x15'));var config=require(_0x3039('0x16'));var db=require(_0x3039('0x17'))['db'];function respondWithStatusCode(_0x424151,_0xc932d7){_0xc932d7=_0xc932d7||0xcc;return function(_0x2bbf62){if(_0x2bbf62){return _0x424151[_0x3039('0x18')](_0xc932d7);}return _0x424151[_0x3039('0x19')](_0xc932d7)[_0x3039('0x1a')]();};}function respondWithResult(_0x5189f6,_0x19ef70){_0x19ef70=_0x19ef70||0xc8;return function(_0x546e0b){if(_0x546e0b){return _0x5189f6[_0x3039('0x19')](_0x19ef70)[_0x3039('0x1b')](_0x546e0b);}};}function respondWithFilteredResult(_0x52ec4e,_0x747f33){return function(_0x167907){if(_0x167907){var _0x2598f5=_0x167907[_0x3039('0x1c')],_0x5eb1e9=_0x747f33[_0x3039('0x1d')],_0x3b9b51=_0x747f33[_0x3039('0x1d')]+_0x747f33[_0x3039('0x1e')],_0x212c3b;if(_0x3b9b51>=_0x2598f5){_0x3b9b51=_0x2598f5;_0x212c3b=0xc8;}else{_0x212c3b=0xce;}_0x52ec4e[_0x3039('0x19')](_0x212c3b);return _0x52ec4e[_0x3039('0x1f')]('Content-Range',_0x5eb1e9+'-'+_0x3b9b51+'/'+_0x2598f5)[_0x3039('0x1b')](_0x167907);}return null;};}function patchUpdates(_0x52125d){return function(_0x2b2def){try{jsonpatch[_0x3039('0x20')](_0x2b2def,_0x52125d,!![]);}catch(_0x53e83c){return BPromise[_0x3039('0x21')](_0x53e83c);}return _0x2b2def['save']();};}function saveUpdates(_0x258107,_0x450ed0){return function(_0x432155){if(_0x432155){return _0x432155['update'](_0x258107)[_0x3039('0x22')](function(_0x547124){return _0x547124;});}return null;};}function removeEntity(_0x49644d,_0x58f4e8){return function(_0x432672){if(_0x432672){return _0x432672['destroy']()['then'](function(){_0x49644d[_0x3039('0x19')](0xcc)[_0x3039('0x1a')]();});}};}function handleEntityNotFound(_0x56b5af,_0x48b1c4){return function(_0x2aed23){if(!_0x2aed23){_0x56b5af['sendStatus'](0x194);}return _0x2aed23;};}function handleError(_0xc1d2bd,_0xd22e40){_0xd22e40=_0xd22e40||0x1f4;return function(_0x1403f4){logger[_0x3039('0x23')](_0x1403f4[_0x3039('0x24')]);if(_0x1403f4[_0x3039('0x25')]){delete _0x1403f4[_0x3039('0x25')];}_0xc1d2bd['status'](_0xd22e40)[_0x3039('0x26')](_0x1403f4);};}exports['index']=function(_0x2fc105,_0x276e9e){var _0xebaf8a={},_0x392ba0={},_0x557e86={'count':0x0,'rows':[]};var _0x48f410=db['FaxQueueReport'][_0x3039('0x27')];_0x392ba0['model']=_[_0x3039('0x28')](_0x48f410);_0x392ba0[_0x3039('0x29')]=_[_0x3039('0x28')](_0x2fc105[_0x3039('0x29')]);_0x392ba0['filters']=_['intersection'](_0x392ba0[_0x3039('0x2a')],_0x392ba0[_0x3039('0x29')]);_0xebaf8a['attributes']=_[_0x3039('0x2b')](_0x392ba0[_0x3039('0x2a')],qs['fields'](_0x2fc105[_0x3039('0x29')][_0x3039('0x2c')]));_0xebaf8a[_0x3039('0x2d')]=_0xebaf8a[_0x3039('0x2d')][_0x3039('0x2e')]?_0xebaf8a[_0x3039('0x2d')]:_0x392ba0[_0x3039('0x2a')];if(!_0x2fc105['query'][_0x3039('0x2f')](_0x3039('0x30'))){_0xebaf8a[_0x3039('0x1e')]=qs['limit'](_0x2fc105[_0x3039('0x29')][_0x3039('0x1e')]);_0xebaf8a[_0x3039('0x1d')]=qs[_0x3039('0x1d')](_0x2fc105[_0x3039('0x29')][_0x3039('0x1d')]);}_0xebaf8a[_0x3039('0x31')]=qs[_0x3039('0x32')](_0x2fc105[_0x3039('0x29')]['sort']);_0xebaf8a[_0x3039('0x33')]=qs[_0x3039('0x34')](_[_0x3039('0x35')](_0x2fc105[_0x3039('0x29')],_0x392ba0[_0x3039('0x34')]));if(_0x2fc105[_0x3039('0x29')]['filter']){_0xebaf8a[_0x3039('0x33')]=_[_0x3039('0x36')](_0xebaf8a['where'],{'$or':_[_0x3039('0x37')](_0x48f410,function(_0x24df46){if(_0x24df46['type'][_0x3039('0x38')]!==_0x3039('0x39')){var _0x20d038={};_0x20d038[_0x24df46[_0x3039('0x3a')]]={'$like':'%'+_0x2fc105[_0x3039('0x29')][_0x3039('0x3b')]+'%'};return _0x20d038;}})});}_0xebaf8a=_['merge']({},_0xebaf8a,_0x2fc105[_0x3039('0x3c')]);var _0x1dfde8={'where':_0xebaf8a[_0x3039('0x33')]};return db[_0x3039('0x3d')][_0x3039('0x1c')](_0x1dfde8)['then'](function(_0xd7bb37){_0x557e86[_0x3039('0x1c')]=_0xd7bb37;if(_0x2fc105['query'][_0x3039('0x3e')]){_0xebaf8a['include']=[{'all':!![]}];}return db[_0x3039('0x3d')]['findAll'](_0xebaf8a);})[_0x3039('0x22')](function(_0x250e7c){_0x557e86[_0x3039('0x3f')]=_0x250e7c;return _0x557e86;})['then'](respondWithFilteredResult(_0x276e9e,_0xebaf8a))[_0x3039('0x40')](handleError(_0x276e9e,null));};exports[_0x3039('0x41')]=function(_0x23b86b,_0x1063fd){var _0x517455={'raw':!![],'where':{'id':_0x23b86b[_0x3039('0x42')]['id']}},_0x46c17e={};_0x46c17e[_0x3039('0x2a')]=_[_0x3039('0x28')](db[_0x3039('0x3d')][_0x3039('0x27')]);_0x46c17e[_0x3039('0x29')]=_[_0x3039('0x28')](_0x23b86b[_0x3039('0x29')]);_0x46c17e[_0x3039('0x34')]=_[_0x3039('0x2b')](_0x46c17e[_0x3039('0x2a')],_0x46c17e[_0x3039('0x29')]);_0x517455[_0x3039('0x2d')]=_[_0x3039('0x2b')](_0x46c17e[_0x3039('0x2a')],qs[_0x3039('0x2c')](_0x23b86b[_0x3039('0x29')][_0x3039('0x2c')]));_0x517455[_0x3039('0x2d')]=_0x517455['attributes'][_0x3039('0x2e')]?_0x517455[_0x3039('0x2d')]:_0x46c17e[_0x3039('0x2a')];if(_0x23b86b[_0x3039('0x29')][_0x3039('0x3e')]){_0x517455[_0x3039('0x43')]=[{'all':!![]}];}_0x517455=_[_0x3039('0x36')]({},_0x517455,_0x23b86b[_0x3039('0x3c')]);return db[_0x3039('0x3d')]['find'](_0x517455)[_0x3039('0x22')](handleEntityNotFound(_0x1063fd,null))[_0x3039('0x22')](respondWithResult(_0x1063fd,null))[_0x3039('0x40')](handleError(_0x1063fd,null));};exports[_0x3039('0x44')]=function(_0x38f480,_0x2b1dad){return db['FaxQueueReport']['create'](_0x38f480[_0x3039('0x45')],{})[_0x3039('0x22')](respondWithResult(_0x2b1dad,0xc9))[_0x3039('0x40')](handleError(_0x2b1dad,null));};exports[_0x3039('0x46')]=function(_0x2c3b8e,_0x5574ba){if(_0x2c3b8e[_0x3039('0x45')]['id']){delete _0x2c3b8e[_0x3039('0x45')]['id'];}return db['FaxQueueReport'][_0x3039('0x47')]({'where':{'id':_0x2c3b8e[_0x3039('0x42')]['id']}})[_0x3039('0x22')](handleEntityNotFound(_0x5574ba,null))[_0x3039('0x22')](saveUpdates(_0x2c3b8e['body'],null))[_0x3039('0x22')](respondWithResult(_0x5574ba,null))['catch'](handleError(_0x5574ba,null));};exports[_0x3039('0x48')]=function(_0x53ade8,_0x2dd37a){return db[_0x3039('0x3d')][_0x3039('0x47')]({'where':{'id':_0x53ade8[_0x3039('0x42')]['id']}})[_0x3039('0x22')](handleEntityNotFound(_0x2dd37a,null))[_0x3039('0x22')](removeEntity(_0x2dd37a,null))['catch'](handleError(_0x2dd37a,null));};exports[_0x3039('0x49')]=function(_0x3e2370,_0x5a5cbc){return db[_0x3039('0x3d')]['describe']()[_0x3039('0x22')](respondWithResult(_0x5a5cbc,null))[_0x3039('0x40')](handleError(_0x5a5cbc,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 5771a0d..dd1f195 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 _0xee62=['FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','./faxQueueReport.attributes','exports','define'];(function(_0xc0ed67,_0xbd4503){var _0x55369d=function(_0x6025d2){while(--_0x6025d2){_0xc0ed67['push'](_0xc0ed67['shift']());}};_0x55369d(++_0xbd4503);}(_0xee62,0x93));var _0x2ee6=function(_0x3706af,_0x3aac8b){_0x3706af=_0x3706af-0x0;var _0x12b893=_0xee62[_0x3706af];return _0x12b893;};'use strict';var _=require(_0x2ee6('0x0'));var util=require('util');var logger=require(_0x2ee6('0x1'))(_0x2ee6('0x2'));var moment=require(_0x2ee6('0x3'));var BPromise=require(_0x2ee6('0x4'));var rp=require(_0x2ee6('0x5'));var attributes=require(_0x2ee6('0x6'));module[_0x2ee6('0x7')]=function(_0x4dc7ef,_0x562d6c){return _0x4dc7ef[_0x2ee6('0x8')](_0x2ee6('0x9'),attributes,{'tableName':_0x2ee6('0xa'),'paranoid':![],'indexes':[{'name':_0x2ee6('0xb'),'fields':[_0x2ee6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac3d=['uniqueid','util','api','moment','bluebird','request-promise','exports','define','FaxQueueReport','report_fax_queue'];(function(_0x171a5a,_0x5ed0cf){var _0x269c1e=function(_0x2b789d){while(--_0x2b789d){_0x171a5a['push'](_0x171a5a['shift']());}};_0x269c1e(++_0x5ed0cf);}(_0xac3d,0x119));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdac3('0x0'));var logger=require('../../config/logger')(_0xdac3('0x1'));var moment=require(_0xdac3('0x2'));var BPromise=require(_0xdac3('0x3'));var rp=require(_0xdac3('0x4'));var attributes=require('./faxQueueReport.attributes');module[_0xdac3('0x5')]=function(_0x33862e,_0x5f2475){return _0x33862e[_0xdac3('0x6')](_0xdac3('0x7'),attributes,{'tableName':_0xdac3('0x8'),'paranoid':![],'indexes':[{'name':_0xdac3('0x9'),'fields':[_0xdac3('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 60df41e..70577d6 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 _0x84a0=['FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x1b8f52,_0x111226){var _0x17c536=function(_0x3cbea5){while(--_0x3cbea5){_0x1b8f52['push'](_0x1b8f52['shift']());}};_0x17c536(++_0x111226);}(_0x84a0,0x66));var _0x084a=function(_0xdb50de,_0x3d968b){_0xdb50de=_0xdb50de-0x0;var _0x2747e5=_0x84a0[_0xdb50de];return _0x2747e5;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e6810,_0x373d2,_0x2b30bc){return new BPromise(function(_0x58d419,_0x1051a9){return client[_0x084a('0xa')](_0x2e6810,_0x2b30bc)[_0x084a('0xb')](function(_0x2888e3){logger[_0x084a('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x373d2,'request\x20sent');logger[_0x084a('0xd')](_0x084a('0xe'),_0x373d2,_0x084a('0xf'),JSON[_0x084a('0x10')](_0x2888e3));if(_0x2888e3[_0x084a('0x11')]){if(_0x2888e3['error']['code']===0x1f4){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);return _0x1051a9(_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);}logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3['error'][_0x084a('0x13')]);return _0x58d419(_0x2888e3['error'][_0x084a('0x13')]);}else{logger[_0x084a('0xc')](_0x084a('0x12'),_0x373d2,_0x084a('0xf'));_0x58d419(_0x2888e3[_0x084a('0x14')]['message']);}})[_0x084a('0x15')](function(_0x4abd81){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x4abd81);_0x1051a9(_0x4abd81);});});}exports['CreateFaxQueueReport']=function(_0xf2c333){var _0x32c729=this;return new Promise(function(_0x4134b9,_0x14bb19){return db[_0x084a('0x16')][_0x084a('0x17')](_0xf2c333[_0x084a('0x18')],{'raw':_0xf2c333[_0x084a('0x19')]?_0xf2c333[_0x084a('0x19')][_0x084a('0x1a')]===undefined?!![]:![]:!![]})[_0x084a('0xb')](function(_0x279e25){logger[_0x084a('0xc')](_0x084a('0x1b'),_0xf2c333);logger[_0x084a('0xd')]('CreateFaxQueueReport',_0xf2c333,JSON[_0x084a('0x10')](_0x279e25));_0x4134b9(_0x279e25);})[_0x084a('0x15')](function(_0x41a90f){logger[_0x084a('0x11')](_0x084a('0x1b'),_0x41a90f['message'],_0xf2c333);_0x14bb19(_0x32c729[_0x084a('0x11')](0x1f4,_0x41a90f[_0x084a('0x13')]));});});};exports[_0x084a('0x1c')]=function(_0x1f2c9f){var _0x18b43d=this;return new Promise(function(_0x3cdc1e,_0x5be167){return db[_0x084a('0x16')][_0x084a('0x1d')](_0x1f2c9f[_0x084a('0x18')],{'raw':_0x1f2c9f['options']?_0x1f2c9f[_0x084a('0x19')][_0x084a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f2c9f[_0x084a('0x19')]?_0x1f2c9f['options']['where']||null:null,'attributes':_0x1f2c9f['options']?_0x1f2c9f['options'][_0x084a('0x1e')]||null:null,'limit':_0x1f2c9f['options']?_0x1f2c9f['options']['limit']||null:null})[_0x084a('0xb')](function(_0x4651e6){logger[_0x084a('0xc')](_0x084a('0x1c'),_0x1f2c9f);logger[_0x084a('0xd')](_0x084a('0x1c'),_0x1f2c9f,JSON[_0x084a('0x10')](_0x4651e6));_0x3cdc1e(_0x4651e6);})[_0x084a('0x15')](function(_0x5e6ea8){logger[_0x084a('0x11')](_0x084a('0x1c'),_0x5e6ea8['message'],_0x1f2c9f);_0x5be167(_0x18b43d[_0x084a('0x11')](0x1f4,_0x5e6ea8[_0x084a('0x13')]));});});}; \ No newline at end of file +var _0x457b=['FaxQueueReport','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','body','options','raw','UpdateFaxQueueReport'];(function(_0x542c37,_0x1c665b){var _0x3512b0=function(_0x535d75){while(--_0x535d75){_0x542c37['push'](_0x542c37['shift']());}};_0x3512b0(++_0x1c665b);}(_0x457b,0xca));var _0xb457=function(_0x18d38c,_0xc5c2d3){_0x18d38c=_0x18d38c-0x0;var _0x474ba7=_0x457b[_0x18d38c];return _0x474ba7;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var moment=require('moment');var BPromise=require(_0xb457('0x2'));var rs=require(_0xb457('0x3'));var fs=require('fs');var Redis=require(_0xb457('0x4'));var db=require(_0xb457('0x5'))['db'];var utils=require(_0xb457('0x6'));var logger=require('../../config/logger')(_0xb457('0x7'));var config=require(_0xb457('0x8'));var jayson=require(_0xb457('0x9'));var client=jayson[_0xb457('0xa')][_0xb457('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x523e05,_0x5b8ba2,_0x13632b){return new BPromise(function(_0x2182d6,_0x48388c){return client['request'](_0x523e05,_0x13632b)[_0xb457('0xc')](function(_0x3baee8){logger[_0xb457('0xd')](_0xb457('0xe'),_0x5b8ba2,_0xb457('0xf'));logger[_0xb457('0x10')](_0xb457('0x11'),_0x5b8ba2,_0xb457('0xf'),JSON[_0xb457('0x12')](_0x3baee8));if(_0x3baee8[_0xb457('0x13')]){if(_0x3baee8[_0xb457('0x13')][_0xb457('0x14')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x5b8ba2,_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);return _0x48388c(_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);}logger[_0xb457('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x5b8ba2,_0x3baee8['error'][_0xb457('0x15')]);return _0x2182d6(_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);}else{logger[_0xb457('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x5b8ba2,_0xb457('0xf'));_0x2182d6(_0x3baee8[_0xb457('0x16')][_0xb457('0x15')]);}})[_0xb457('0x17')](function(_0x250a02){logger[_0xb457('0x13')](_0xb457('0xe'),_0x5b8ba2,_0x250a02);_0x48388c(_0x250a02);});});}exports[_0xb457('0x18')]=function(_0x54903c){var _0x37fd30=this;return new Promise(function(_0x3218f1,_0x12f888){return db['FaxQueueReport']['create'](_0x54903c[_0xb457('0x19')],{'raw':_0x54903c[_0xb457('0x1a')]?_0x54903c[_0xb457('0x1a')][_0xb457('0x1b')]===undefined?!![]:![]:!![]})[_0xb457('0xc')](function(_0x383706){logger[_0xb457('0xd')]('CreateFaxQueueReport',_0x54903c);logger['debug'](_0xb457('0x18'),_0x54903c,JSON[_0xb457('0x12')](_0x383706));_0x3218f1(_0x383706);})[_0xb457('0x17')](function(_0x588b53){logger[_0xb457('0x13')](_0xb457('0x18'),_0x588b53[_0xb457('0x15')],_0x54903c);_0x12f888(_0x37fd30['error'](0x1f4,_0x588b53['message']));});});};exports[_0xb457('0x1c')]=function(_0x4d055d){var _0x1c0ef5=this;return new Promise(function(_0x1f57a5,_0x179ef1){return db[_0xb457('0x1d')]['update'](_0x4d055d[_0xb457('0x19')],{'raw':_0x4d055d[_0xb457('0x1a')]?_0x4d055d['options'][_0xb457('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d055d[_0xb457('0x1a')]?_0x4d055d[_0xb457('0x1a')][_0xb457('0x1e')]||null:null,'attributes':_0x4d055d[_0xb457('0x1a')]?_0x4d055d[_0xb457('0x1a')][_0xb457('0x1f')]||null:null,'limit':_0x4d055d['options']?_0x4d055d[_0xb457('0x1a')][_0xb457('0x20')]||null:null})['then'](function(_0xaaf240){logger[_0xb457('0xd')](_0xb457('0x1c'),_0x4d055d);logger[_0xb457('0x10')](_0xb457('0x1c'),_0x4d055d,JSON['stringify'](_0xaaf240));_0x1f57a5(_0xaaf240);})[_0xb457('0x17')](function(_0x518ff0){logger[_0xb457('0x13')](_0xb457('0x1c'),_0x518ff0['message'],_0x4d055d);_0x179ef1(_0x1c0ef5[_0xb457('0x13')](0x1f4,_0x518ff0[_0xb457('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 5039d4c..cc0f669 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 _0x7684=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x7684,0xed));var _0x4768=function(_0x128f3a,_0x929550){_0x128f3a=_0x128f3a-0x0;var _0x523696=_0x7684[_0x128f3a];return _0x523696;};'use strict';var multer=require(_0x4768('0x0'));var util=require('util');var path=require(_0x4768('0x1'));var timeout=require(_0x4768('0x2'));var express=require('express');var router=express[_0x4768('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4768('0x4'));var config=require(_0x4768('0x5'));var controller=require(_0x4768('0x6'));router[_0x4768('0x7')]('/',auth['isAuthenticated'](),controller[_0x4768('0x8')]);router[_0x4768('0x7')](_0x4768('0x9'),auth[_0x4768('0xa')](),controller[_0x4768('0xb')]);router[_0x4768('0x7')]('/:id',auth[_0x4768('0xa')](),controller[_0x4768('0xc')]);router[_0x4768('0xd')]('/',auth['isAuthenticated'](),controller[_0x4768('0xe')]);router[_0x4768('0xf')](_0x4768('0x10'),auth[_0x4768('0xa')](),controller[_0x4768('0x11')]);router[_0x4768('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4768('0x13')]);module[_0x4768('0x14')]=router; \ No newline at end of file +var _0xc118=['isAuthenticated','/describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0xb3c8a8,_0x43f870){var _0x62b576=function(_0x710e33){while(--_0x710e33){_0xb3c8a8['push'](_0xb3c8a8['shift']());}};_0x62b576(++_0x43f870);}(_0xc118,0x15f));var _0x8c11=function(_0x5da3e6,_0x573419){_0x5da3e6=_0x5da3e6-0x0;var _0x5bab94=_0xc118[_0x5da3e6];return _0x5bab94;};'use strict';var multer=require(_0x8c11('0x0'));var util=require(_0x8c11('0x1'));var path=require(_0x8c11('0x2'));var timeout=require(_0x8c11('0x3'));var express=require(_0x8c11('0x4'));var router=express[_0x8c11('0x5')]();var auth=require(_0x8c11('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c11('0x7'));var controller=require(_0x8c11('0x8'));router[_0x8c11('0x9')]('/',auth[_0x8c11('0xa')](),controller['index']);router[_0x8c11('0x9')](_0x8c11('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8c11('0x9')](_0x8c11('0xc'),auth[_0x8c11('0xa')](),controller['show']);router['post']('/',auth[_0x8c11('0xa')](),controller[_0x8c11('0xd')]);router[_0x8c11('0xe')](_0x8c11('0xc'),auth[_0x8c11('0xa')](),controller[_0x8c11('0xf')]);router[_0x8c11('0x10')](_0x8c11('0xc'),auth[_0x8c11('0xa')](),controller[_0x8c11('0x11')]);module[_0x8c11('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 41b9026..cc95318 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 _0x4f2b=['queue','DATE','NOW','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x424c74,_0x2169c3){var _0x472aa1=function(_0x3dfdc4){while(--_0x3dfdc4){_0x424c74['push'](_0x424c74['shift']());}};_0x472aa1(++_0x2169c3);}(_0x4f2b,0x147));var _0xb4f2=function(_0x37046f,_0x425f7d){_0x37046f=_0x37046f-0x0;var _0x5c8e77=_0x4f2b[_0x37046f];return _0x5c8e77;};'use strict';var moment=require('moment');var Sequelize=require(_0xb4f2('0x0'));module[_0xb4f2('0x1')]={'uniqueid':{'type':Sequelize[_0xb4f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb4f2('0x3')](_0xb4f2('0x4'),_0xb4f2('0x5'),'queue'),'allowNull':![],'defaultValue':_0xb4f2('0x6')},'transferredAt':{'type':Sequelize[_0xb4f2('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xb4f2('0x8')]}}; \ No newline at end of file +var _0x165d=['STRING','ENUM','account','queue','DATE','NOW','exports'];(function(_0x101bad,_0x54e1f1){var _0x3c53cd=function(_0x43feec){while(--_0x43feec){_0x101bad['push'](_0x101bad['shift']());}};_0x3c53cd(++_0x54e1f1);}(_0x165d,0x180));var _0xd165=function(_0x405161,_0x4e399c){_0x405161=_0x405161-0x0;var _0x3fea88=_0x165d[_0x405161];return _0x3fea88;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd165('0x0')]={'uniqueid':{'type':Sequelize[_0xd165('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd165('0x2')](_0xd165('0x3'),'agent',_0xd165('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xd165('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xd165('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 1eece03..033af52 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 _0xd8b1=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','send','index','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','FaxTransferReport','findAll','show','params','find','create','body','catch','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x22e3c0,_0x4b4936){var _0x4b4bfb=function(_0x47fbfb){while(--_0x47fbfb){_0x22e3c0['push'](_0x22e3c0['shift']());}};_0x4b4bfb(++_0x4b4936);}(_0xd8b1,0x105));var _0x1d8b=function(_0x1383a3,_0x58e9af){_0x1383a3=_0x1383a3-0x0;var _0x1e6855=_0xd8b1[_0x1383a3];return _0x1e6855;};'use strict';var pdf=require(_0x1d8b('0x0'));var emlformat=require(_0x1d8b('0x1'));var rimraf=require(_0x1d8b('0x2'));var zipdir=require(_0x1d8b('0x3'));var jsonpatch=require(_0x1d8b('0x4'));var rp=require('request-promise');var moment=require(_0x1d8b('0x5'));var BPromise=require(_0x1d8b('0x6'));var Mustache=require('mustache');var util=require(_0x1d8b('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1d8b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1d8b('0x9'));var crypto=require(_0x1d8b('0xa'));var jsforce=require(_0x1d8b('0xb'));var deskjs=require(_0x1d8b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1d8b('0xd'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x1d8b('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x1d8b('0xf'))('api');var utils=require(_0x1d8b('0x10'));var config=require(_0x1d8b('0x11'));var db=require(_0x1d8b('0x12'))['db'];function respondWithStatusCode(_0x3c9ae1,_0x30de33){_0x30de33=_0x30de33||0xcc;return function(_0xfd985b){if(_0xfd985b){return _0x3c9ae1['sendStatus'](_0x30de33);}return _0x3c9ae1[_0x1d8b('0x13')](_0x30de33)[_0x1d8b('0x14')]();};}function respondWithResult(_0x2761df,_0x1bf879){_0x1bf879=_0x1bf879||0xc8;return function(_0x4486a8){if(_0x4486a8){return _0x2761df[_0x1d8b('0x13')](_0x1bf879)[_0x1d8b('0x15')](_0x4486a8);}};}function respondWithFilteredResult(_0x3f9c95,_0x4fa6d8){return function(_0x50c75f){if(_0x50c75f){var _0x3d54d3=_0x50c75f[_0x1d8b('0x16')],_0x3f31a4=_0x4fa6d8[_0x1d8b('0x17')],_0x44ebbe=_0x4fa6d8['offset']+_0x4fa6d8['limit'],_0x3bebce;if(_0x44ebbe>=_0x3d54d3){_0x44ebbe=_0x3d54d3;_0x3bebce=0xc8;}else{_0x3bebce=0xce;}_0x3f9c95[_0x1d8b('0x13')](_0x3bebce);return _0x3f9c95[_0x1d8b('0x18')](_0x1d8b('0x19'),_0x3f31a4+'-'+_0x44ebbe+'/'+_0x3d54d3)[_0x1d8b('0x15')](_0x50c75f);}return null;};}function patchUpdates(_0x41b6fe){return function(_0x5d52c0){try{jsonpatch[_0x1d8b('0x1a')](_0x5d52c0,_0x41b6fe,!![]);}catch(_0x57c63a){return BPromise['reject'](_0x57c63a);}return _0x5d52c0[_0x1d8b('0x1b')]();};}function saveUpdates(_0x1b9549,_0x37c3e2){return function(_0x4f3342){if(_0x4f3342){return _0x4f3342[_0x1d8b('0x1c')](_0x1b9549)[_0x1d8b('0x1d')](function(_0x3cdf3b){return _0x3cdf3b;});}return null;};}function removeEntity(_0x82e608,_0x2f9f64){return function(_0x130c00){if(_0x130c00){return _0x130c00[_0x1d8b('0x1e')]()['then'](function(){_0x82e608[_0x1d8b('0x13')](0xcc)[_0x1d8b('0x14')]();});}};}function handleEntityNotFound(_0x3d8fcb,_0x308b89){return function(_0x5235b6){if(!_0x5235b6){_0x3d8fcb['sendStatus'](0x194);}return _0x5235b6;};}function handleError(_0x41ddd6,_0x338146){_0x338146=_0x338146||0x1f4;return function(_0x49cc58){logger[_0x1d8b('0x1f')](_0x49cc58[_0x1d8b('0x20')]);if(_0x49cc58['name']){delete _0x49cc58['name'];}_0x41ddd6[_0x1d8b('0x13')](_0x338146)[_0x1d8b('0x21')](_0x49cc58);};}exports[_0x1d8b('0x22')]=function(_0xe76d45,_0x45d9a4){var _0x2e6249={},_0x1d525f={},_0x59d3bf={'count':0x0,'rows':[]};var _0x27371d=db['FaxTransferReport'][_0x1d8b('0x23')];_0x1d525f['model']=_[_0x1d8b('0x24')](_0x27371d);_0x1d525f[_0x1d8b('0x25')]=_[_0x1d8b('0x24')](_0xe76d45[_0x1d8b('0x25')]);_0x1d525f['filters']=_['intersection'](_0x1d525f[_0x1d8b('0x26')],_0x1d525f[_0x1d8b('0x25')]);_0x2e6249[_0x1d8b('0x27')]=_[_0x1d8b('0x28')](_0x1d525f[_0x1d8b('0x26')],qs[_0x1d8b('0x29')](_0xe76d45['query'][_0x1d8b('0x29')]));_0x2e6249[_0x1d8b('0x27')]=_0x2e6249[_0x1d8b('0x27')][_0x1d8b('0x2a')]?_0x2e6249[_0x1d8b('0x27')]:_0x1d525f[_0x1d8b('0x26')];if(!_0xe76d45[_0x1d8b('0x25')][_0x1d8b('0x2b')](_0x1d8b('0x2c'))){_0x2e6249['limit']=qs[_0x1d8b('0x2d')](_0xe76d45['query']['limit']);_0x2e6249['offset']=qs[_0x1d8b('0x17')](_0xe76d45[_0x1d8b('0x25')][_0x1d8b('0x17')]);}_0x2e6249[_0x1d8b('0x2e')]=qs[_0x1d8b('0x2f')](_0xe76d45['query'][_0x1d8b('0x2f')]);_0x2e6249[_0x1d8b('0x30')]=qs[_0x1d8b('0x31')](_[_0x1d8b('0x32')](_0xe76d45[_0x1d8b('0x25')],_0x1d525f[_0x1d8b('0x31')]));if(_0xe76d45[_0x1d8b('0x25')][_0x1d8b('0x33')]){_0x2e6249['where']=_[_0x1d8b('0x34')](_0x2e6249['where'],{'$or':_[_0x1d8b('0x35')](_0x27371d,function(_0x493ebe){if(_0x493ebe[_0x1d8b('0x36')][_0x1d8b('0x37')]!==_0x1d8b('0x38')){var _0x487e65={};_0x487e65[_0x493ebe[_0x1d8b('0x39')]]={'$like':'%'+_0xe76d45[_0x1d8b('0x25')][_0x1d8b('0x33')]+'%'};return _0x487e65;}})});}_0x2e6249=_[_0x1d8b('0x34')]({},_0x2e6249,_0xe76d45['options']);var _0x465f32={'where':_0x2e6249[_0x1d8b('0x30')]};return db['FaxTransferReport'][_0x1d8b('0x16')](_0x465f32)['then'](function(_0x55a77b){_0x59d3bf['count']=_0x55a77b;if(_0xe76d45[_0x1d8b('0x25')][_0x1d8b('0x3a')]){_0x2e6249[_0x1d8b('0x3b')]=[{'all':!![]}];}return db[_0x1d8b('0x3c')][_0x1d8b('0x3d')](_0x2e6249);})[_0x1d8b('0x1d')](function(_0xaee456){_0x59d3bf['rows']=_0xaee456;return _0x59d3bf;})[_0x1d8b('0x1d')](respondWithFilteredResult(_0x45d9a4,_0x2e6249))['catch'](handleError(_0x45d9a4,null));};exports[_0x1d8b('0x3e')]=function(_0x5da0e7,_0x390544){var _0x3f51f4={'raw':!![],'where':{'id':_0x5da0e7[_0x1d8b('0x3f')]['id']}},_0x474a57={};_0x474a57[_0x1d8b('0x26')]=_[_0x1d8b('0x24')](db[_0x1d8b('0x3c')]['rawAttributes']);_0x474a57['query']=_[_0x1d8b('0x24')](_0x5da0e7[_0x1d8b('0x25')]);_0x474a57[_0x1d8b('0x31')]=_[_0x1d8b('0x28')](_0x474a57[_0x1d8b('0x26')],_0x474a57['query']);_0x3f51f4[_0x1d8b('0x27')]=_[_0x1d8b('0x28')](_0x474a57['model'],qs['fields'](_0x5da0e7['query'][_0x1d8b('0x29')]));_0x3f51f4['attributes']=_0x3f51f4[_0x1d8b('0x27')][_0x1d8b('0x2a')]?_0x3f51f4['attributes']:_0x474a57[_0x1d8b('0x26')];if(_0x5da0e7[_0x1d8b('0x25')][_0x1d8b('0x3a')]){_0x3f51f4[_0x1d8b('0x3b')]=[{'all':!![]}];}_0x3f51f4=_[_0x1d8b('0x34')]({},_0x3f51f4,_0x5da0e7['options']);return db['FaxTransferReport'][_0x1d8b('0x40')](_0x3f51f4)[_0x1d8b('0x1d')](handleEntityNotFound(_0x390544,null))[_0x1d8b('0x1d')](respondWithResult(_0x390544,null))['catch'](handleError(_0x390544,null));};exports[_0x1d8b('0x41')]=function(_0x23f055,_0x143d7c){return db[_0x1d8b('0x3c')][_0x1d8b('0x41')](_0x23f055[_0x1d8b('0x42')],{})[_0x1d8b('0x1d')](respondWithResult(_0x143d7c,0xc9))[_0x1d8b('0x43')](handleError(_0x143d7c,null));};exports['update']=function(_0x29a2c7,_0x2cff83){if(_0x29a2c7[_0x1d8b('0x42')]['id']){delete _0x29a2c7[_0x1d8b('0x42')]['id'];}return db[_0x1d8b('0x3c')][_0x1d8b('0x40')]({'where':{'id':_0x29a2c7[_0x1d8b('0x3f')]['id']}})[_0x1d8b('0x1d')](handleEntityNotFound(_0x2cff83,null))['then'](saveUpdates(_0x29a2c7[_0x1d8b('0x42')],null))[_0x1d8b('0x1d')](respondWithResult(_0x2cff83,null))['catch'](handleError(_0x2cff83,null));};exports['destroy']=function(_0x33d7cd,_0x51584d){return db[_0x1d8b('0x3c')][_0x1d8b('0x40')]({'where':{'id':_0x33d7cd[_0x1d8b('0x3f')]['id']}})[_0x1d8b('0x1d')](handleEntityNotFound(_0x51584d,null))[_0x1d8b('0x1d')](removeEntity(_0x51584d,null))[_0x1d8b('0x43')](handleError(_0x51584d,null));};exports[_0x1d8b('0x44')]=function(_0x1e8504,_0x280c02){return db[_0x1d8b('0x3c')][_0x1d8b('0x44')]()[_0x1d8b('0x1d')](respondWithResult(_0x280c02,null))[_0x1d8b('0x43')](handleError(_0x280c02,null));}; \ No newline at end of file +var _0x3937=['jsforce','querystring','papaparse','../../components/auth/service','ioredis','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','apply','reject','save','update','then','error','stack','name','send','index','FaxTransferReport','rawAttributes','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','merge','map','key','field','filter','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x3937,0xbf));var _0x7393=function(_0x4220f1,_0x57b1ce){_0x4220f1=_0x4220f1-0x0;var _0x43613f=_0x3937[_0x4220f1];return _0x43613f;};'use strict';var pdf=require(_0x7393('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7393('0x1'));var zipdir=require(_0x7393('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7393('0x3'));var moment=require('moment');var BPromise=require(_0x7393('0x4'));var Mustache=require('mustache');var util=require(_0x7393('0x5'));var path=require(_0x7393('0x6'));var sox=require(_0x7393('0x7'));var csv=require(_0x7393('0x8'));var ejs=require(_0x7393('0x9'));var fs=require('fs');var _=require(_0x7393('0xa'));var squel=require(_0x7393('0xb'));var crypto=require(_0x7393('0xc'));var jsforce=require(_0x7393('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7393('0xe'));var Papa=require(_0x7393('0xf'));var authService=require(_0x7393('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7393('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7393('0x12'));var db=require(_0x7393('0x13'))['db'];function respondWithStatusCode(_0x29d8cc,_0x4fb764){_0x4fb764=_0x4fb764||0xcc;return function(_0x79fc4e){if(_0x79fc4e){return _0x29d8cc[_0x7393('0x14')](_0x4fb764);}return _0x29d8cc[_0x7393('0x15')](_0x4fb764)[_0x7393('0x16')]();};}function respondWithResult(_0xe86cf4,_0x1fe171){_0x1fe171=_0x1fe171||0xc8;return function(_0x38eaad){if(_0x38eaad){return _0xe86cf4[_0x7393('0x15')](_0x1fe171)[_0x7393('0x17')](_0x38eaad);}};}function respondWithFilteredResult(_0x4e521c,_0x47b152){return function(_0x414c37){if(_0x414c37){var _0x5d0d2b=_0x414c37['count'],_0x5b91a9=_0x47b152[_0x7393('0x18')],_0x4e7ec6=_0x47b152[_0x7393('0x18')]+_0x47b152['limit'],_0x82f5fa;if(_0x4e7ec6>=_0x5d0d2b){_0x4e7ec6=_0x5d0d2b;_0x82f5fa=0xc8;}else{_0x82f5fa=0xce;}_0x4e521c[_0x7393('0x15')](_0x82f5fa);return _0x4e521c['set']('Content-Range',_0x5b91a9+'-'+_0x4e7ec6+'/'+_0x5d0d2b)[_0x7393('0x17')](_0x414c37);}return null;};}function patchUpdates(_0x344bc8){return function(_0x1b032c){try{jsonpatch[_0x7393('0x19')](_0x1b032c,_0x344bc8,!![]);}catch(_0x31902f){return BPromise[_0x7393('0x1a')](_0x31902f);}return _0x1b032c[_0x7393('0x1b')]();};}function saveUpdates(_0x208b9a,_0x546642){return function(_0x52cd6a){if(_0x52cd6a){return _0x52cd6a[_0x7393('0x1c')](_0x208b9a)[_0x7393('0x1d')](function(_0x3979b7){return _0x3979b7;});}return null;};}function removeEntity(_0x7fc0ef,_0x131667){return function(_0x52f716){if(_0x52f716){return _0x52f716['destroy']()['then'](function(){_0x7fc0ef[_0x7393('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cfdf6,_0x2bf7a9){return function(_0xa8f852){if(!_0xa8f852){_0x4cfdf6['sendStatus'](0x194);}return _0xa8f852;};}function handleError(_0x432e67,_0x2b0389){_0x2b0389=_0x2b0389||0x1f4;return function(_0x1ac912){logger[_0x7393('0x1e')](_0x1ac912[_0x7393('0x1f')]);if(_0x1ac912[_0x7393('0x20')]){delete _0x1ac912[_0x7393('0x20')];}_0x432e67[_0x7393('0x15')](_0x2b0389)[_0x7393('0x21')](_0x1ac912);};}exports[_0x7393('0x22')]=function(_0x1d7188,_0x123ab4){var _0x19160c={},_0x4e1fea={},_0x39d95f={'count':0x0,'rows':[]};var _0x17e350=db[_0x7393('0x23')][_0x7393('0x24')];_0x4e1fea[_0x7393('0x25')]=_[_0x7393('0x26')](_0x17e350);_0x4e1fea['query']=_[_0x7393('0x26')](_0x1d7188['query']);_0x4e1fea[_0x7393('0x27')]=_['intersection'](_0x4e1fea[_0x7393('0x25')],_0x4e1fea[_0x7393('0x28')]);_0x19160c[_0x7393('0x29')]=_[_0x7393('0x2a')](_0x4e1fea[_0x7393('0x25')],qs[_0x7393('0x2b')](_0x1d7188[_0x7393('0x28')][_0x7393('0x2b')]));_0x19160c[_0x7393('0x29')]=_0x19160c[_0x7393('0x29')][_0x7393('0x2c')]?_0x19160c[_0x7393('0x29')]:_0x4e1fea['model'];if(!_0x1d7188['query'][_0x7393('0x2d')]('nolimit')){_0x19160c[_0x7393('0x2e')]=qs['limit'](_0x1d7188[_0x7393('0x28')]['limit']);_0x19160c[_0x7393('0x18')]=qs[_0x7393('0x18')](_0x1d7188[_0x7393('0x28')][_0x7393('0x18')]);}_0x19160c[_0x7393('0x2f')]=qs[_0x7393('0x30')](_0x1d7188[_0x7393('0x28')][_0x7393('0x30')]);_0x19160c[_0x7393('0x31')]=qs[_0x7393('0x27')](_['pick'](_0x1d7188[_0x7393('0x28')],_0x4e1fea['filters']));if(_0x1d7188[_0x7393('0x28')]['filter']){_0x19160c[_0x7393('0x31')]=_[_0x7393('0x32')](_0x19160c[_0x7393('0x31')],{'$or':_[_0x7393('0x33')](_0x17e350,function(_0x121d48){if(_0x121d48['type'][_0x7393('0x34')]!=='VIRTUAL'){var _0x434333={};_0x434333[_0x121d48[_0x7393('0x35')]]={'$like':'%'+_0x1d7188[_0x7393('0x28')][_0x7393('0x36')]+'%'};return _0x434333;}})});}_0x19160c=_[_0x7393('0x32')]({},_0x19160c,_0x1d7188['options']);var _0x4c82e6={'where':_0x19160c[_0x7393('0x31')]};return db[_0x7393('0x23')][_0x7393('0x37')](_0x4c82e6)[_0x7393('0x1d')](function(_0x54872c){_0x39d95f['count']=_0x54872c;if(_0x1d7188['query'][_0x7393('0x38')]){_0x19160c[_0x7393('0x39')]=[{'all':!![]}];}return db[_0x7393('0x23')][_0x7393('0x3a')](_0x19160c);})[_0x7393('0x1d')](function(_0x406b35){_0x39d95f[_0x7393('0x3b')]=_0x406b35;return _0x39d95f;})[_0x7393('0x1d')](respondWithFilteredResult(_0x123ab4,_0x19160c))[_0x7393('0x3c')](handleError(_0x123ab4,null));};exports[_0x7393('0x3d')]=function(_0xc39c05,_0x2241c8){var _0x7c5976={'raw':!![],'where':{'id':_0xc39c05[_0x7393('0x3e')]['id']}},_0x17b58b={};_0x17b58b[_0x7393('0x25')]=_[_0x7393('0x26')](db[_0x7393('0x23')][_0x7393('0x24')]);_0x17b58b[_0x7393('0x28')]=_[_0x7393('0x26')](_0xc39c05[_0x7393('0x28')]);_0x17b58b['filters']=_[_0x7393('0x2a')](_0x17b58b[_0x7393('0x25')],_0x17b58b[_0x7393('0x28')]);_0x7c5976[_0x7393('0x29')]=_[_0x7393('0x2a')](_0x17b58b[_0x7393('0x25')],qs[_0x7393('0x2b')](_0xc39c05[_0x7393('0x28')]['fields']));_0x7c5976['attributes']=_0x7c5976[_0x7393('0x29')]['length']?_0x7c5976[_0x7393('0x29')]:_0x17b58b[_0x7393('0x25')];if(_0xc39c05[_0x7393('0x28')][_0x7393('0x38')]){_0x7c5976[_0x7393('0x39')]=[{'all':!![]}];}_0x7c5976=_[_0x7393('0x32')]({},_0x7c5976,_0xc39c05['options']);return db[_0x7393('0x23')][_0x7393('0x3f')](_0x7c5976)[_0x7393('0x1d')](handleEntityNotFound(_0x2241c8,null))[_0x7393('0x1d')](respondWithResult(_0x2241c8,null))[_0x7393('0x3c')](handleError(_0x2241c8,null));};exports['create']=function(_0x5bbc1d,_0x770871){return db['FaxTransferReport'][_0x7393('0x40')](_0x5bbc1d[_0x7393('0x41')],{})[_0x7393('0x1d')](respondWithResult(_0x770871,0xc9))[_0x7393('0x3c')](handleError(_0x770871,null));};exports[_0x7393('0x1c')]=function(_0x4011a9,_0xccdf7c){if(_0x4011a9[_0x7393('0x41')]['id']){delete _0x4011a9[_0x7393('0x41')]['id'];}return db[_0x7393('0x23')][_0x7393('0x3f')]({'where':{'id':_0x4011a9[_0x7393('0x3e')]['id']}})[_0x7393('0x1d')](handleEntityNotFound(_0xccdf7c,null))[_0x7393('0x1d')](saveUpdates(_0x4011a9[_0x7393('0x41')],null))['then'](respondWithResult(_0xccdf7c,null))[_0x7393('0x3c')](handleError(_0xccdf7c,null));};exports[_0x7393('0x42')]=function(_0x27b796,_0x351ba9){return db['FaxTransferReport'][_0x7393('0x3f')]({'where':{'id':_0x27b796[_0x7393('0x3e')]['id']}})[_0x7393('0x1d')](handleEntityNotFound(_0x351ba9,null))[_0x7393('0x1d')](removeEntity(_0x351ba9,null))[_0x7393('0x3c')](handleError(_0x351ba9,null));};exports[_0x7393('0x43')]=function(_0x26af1e,_0x8cac53){return db[_0x7393('0x23')]['describe']()[_0x7393('0x1d')](respondWithResult(_0x8cac53,null))[_0x7393('0x3c')](handleError(_0x8cac53,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index be63ae9..0c4ca30 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 _0x5e1e=['bluebird','request-promise','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x545c34,_0x1699d3){var _0xf5d9a6=function(_0x57af68){while(--_0x57af68){_0x545c34['push'](_0x545c34['shift']());}};_0xf5d9a6(++_0x1699d3);}(_0x5e1e,0x119));var _0xe5e1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5e1e[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xe5e1('0x0'));var util=require(_0xe5e1('0x1'));var logger=require(_0xe5e1('0x2'))(_0xe5e1('0x3'));var moment=require(_0xe5e1('0x4'));var BPromise=require(_0xe5e1('0x5'));var rp=require(_0xe5e1('0x6'));var attributes=require(_0xe5e1('0x7'));module[_0xe5e1('0x8')]=function(_0x501839,_0x5045f3){return _0x501839['define']('FaxTransferReport',attributes,{'tableName':_0xe5e1('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe5e1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x34e9=['moment','request-promise','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1d578d,_0x2c4180){var _0x466d69=function(_0x2d7b31){while(--_0x2d7b31){_0x1d578d['push'](_0x1d578d['shift']());}};_0x466d69(++_0x2c4180);}(_0x34e9,0x1a0));var _0x934e=function(_0x53d2ee,_0x4e2781){_0x53d2ee=_0x53d2ee-0x0;var _0x35f4c6=_0x34e9[_0x53d2ee];return _0x35f4c6;};'use strict';var _=require(_0x934e('0x0'));var util=require(_0x934e('0x1'));var logger=require(_0x934e('0x2'))(_0x934e('0x3'));var moment=require(_0x934e('0x4'));var BPromise=require('bluebird');var rp=require(_0x934e('0x5'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x46e396,_0x597c76){return _0x46e396[_0x934e('0x6')](_0x934e('0x7'),attributes,{'tableName':_0x934e('0x8'),'paranoid':![],'indexes':[{'name':_0x934e('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 1268ae0..e5cd52c 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 _0x38db=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x38db,0xad));var _0xb38d=function(_0x2342c9,_0x78ba07){_0x2342c9=_0x2342c9-0x0;var _0x1e6d8d=_0x38db[_0x2342c9];return _0x1e6d8d;};'use strict';var _=require(_0xb38d('0x0'));var util=require(_0xb38d('0x1'));var moment=require('moment');var BPromise=require(_0xb38d('0x2'));var rs=require(_0xb38d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb38d('0x4'));var logger=require(_0xb38d('0x5'))(_0xb38d('0x6'));var config=require(_0xb38d('0x7'));var jayson=require(_0xb38d('0x8'));var client=jayson['client'][_0xb38d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ae3f5,_0x2076ba,_0xac264c){return new BPromise(function(_0x2d1b71,_0x592b70){return client[_0xb38d('0xa')](_0x2ae3f5,_0xac264c)[_0xb38d('0xb')](function(_0x201517){logger[_0xb38d('0xc')](_0xb38d('0xd'),_0x2076ba,'request\x20sent');logger[_0xb38d('0xe')](_0xb38d('0xf'),_0x2076ba,_0xb38d('0x10'),JSON[_0xb38d('0x11')](_0x201517));if(_0x201517[_0xb38d('0x12')]){if(_0x201517[_0xb38d('0x12')][_0xb38d('0x13')]===0x1f4){logger['error'](_0xb38d('0xd'),_0x2076ba,_0x201517[_0xb38d('0x12')][_0xb38d('0x14')]);return _0x592b70(_0x201517[_0xb38d('0x12')][_0xb38d('0x14')]);}logger[_0xb38d('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x2076ba,_0x201517['error'][_0xb38d('0x14')]);return _0x2d1b71(_0x201517[_0xb38d('0x12')][_0xb38d('0x14')]);}else{logger[_0xb38d('0xc')](_0xb38d('0xd'),_0x2076ba,'request\x20sent');_0x2d1b71(_0x201517[_0xb38d('0x15')][_0xb38d('0x14')]);}})['catch'](function(_0xa80497){logger[_0xb38d('0x12')](_0xb38d('0xd'),_0x2076ba,_0xa80497);_0x592b70(_0xa80497);});});} \ No newline at end of file +var _0x655e=['error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','request','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2908e,_0x3b6591){var _0x4bb7b2=function(_0x389bbd){while(--_0x389bbd){_0x2908e['push'](_0x2908e['shift']());}};_0x4bb7b2(++_0x3b6591);}(_0x655e,0xb8));var _0xe655=function(_0x125931,_0x48737e){_0x125931=_0x125931-0x0;var _0x3dfcad=_0x655e[_0x125931];return _0x3dfcad;};'use strict';var _=require(_0xe655('0x0'));var util=require(_0xe655('0x1'));var moment=require('moment');var BPromise=require(_0xe655('0x2'));var rs=require(_0xe655('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe655('0x4'))['db'];var utils=require(_0xe655('0x5'));var logger=require('../../config/logger')(_0xe655('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe655('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59cc4d,_0x2ad5c0,_0xbff649){return new BPromise(function(_0x59bcea,_0x2cfa27){return client[_0xe655('0x8')](_0x59cc4d,_0xbff649)['then'](function(_0x262da1){logger[_0xe655('0x9')](_0xe655('0xa'),_0x2ad5c0,'request\x20sent');logger['debug'](_0xe655('0xb'),_0x2ad5c0,_0xe655('0xc'),JSON[_0xe655('0xd')](_0x262da1));if(_0x262da1[_0xe655('0xe')]){if(_0x262da1['error'][_0xe655('0xf')]===0x1f4){logger[_0xe655('0xe')](_0xe655('0xa'),_0x2ad5c0,_0x262da1[_0xe655('0xe')][_0xe655('0x10')]);return _0x2cfa27(_0x262da1['error']['message']);}logger[_0xe655('0xe')](_0xe655('0xa'),_0x2ad5c0,_0x262da1[_0xe655('0xe')][_0xe655('0x10')]);return _0x59bcea(_0x262da1[_0xe655('0xe')]['message']);}else{logger['info'](_0xe655('0xa'),_0x2ad5c0,_0xe655('0xc'));_0x59bcea(_0x262da1['result'][_0xe655('0x10')]);}})[_0xe655('0x11')](function(_0x28d7a3){logger[_0xe655('0xe')](_0xe655('0xa'),_0x2ad5c0,_0x28d7a3);_0x2cfa27(_0x28d7a3);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 4f79b28..ea2e5ec 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 _0x8ef6=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2deaaf,_0x26e35d){var _0x478271=function(_0x3f997b){while(--_0x3f997b){_0x2deaaf['push'](_0x2deaaf['shift']());}};_0x478271(++_0x26e35d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4554ba,_0x1c97c8){_0x4554ba=_0x4554ba-0x0;var _0x1fcf10=_0x8ef6[_0x4554ba];return _0x1fcf10;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['get'](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')]('/',auth[_0x68ef('0xa')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')](_0x68ef('0xd'),auth['isAuthenticated'](),controller[_0x68ef('0x14')]);module[_0x68ef('0x15')]=router; \ No newline at end of file +var _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x227174,_0x310506){var _0x3f4538=function(_0x426e82){while(--_0x426e82){_0x227174['push'](_0x227174['shift']());}};_0x3f4538(++_0x310506);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'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('./faxTransferReport.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('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xe')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);module[_0x49c4('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 4e340b4..e2a913b 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 _0x0ae1=['../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x0ae1,0x1f4));var _0x10ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ae1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x10ae('0x0'));var path=require('path');var timeout=require(_0x10ae('0x1'));var express=require(_0x10ae('0x2'));var router=express[_0x10ae('0x3')]();var auth=require(_0x10ae('0x4'));var interaction=require(_0x10ae('0x5'));var config=require(_0x10ae('0x6'));var controller=require(_0x10ae('0x7'));router[_0x10ae('0x8')]('/',auth['isAuthenticated'](),controller[_0x10ae('0x9')]);router['get'](_0x10ae('0xa'),auth[_0x10ae('0xb')](),controller[_0x10ae('0xc')]);router['get'](_0x10ae('0xd'),auth[_0x10ae('0xb')](),controller[_0x10ae('0xe')]);router[_0x10ae('0x8')](_0x10ae('0xf'),auth[_0x10ae('0xb')](),controller[_0x10ae('0x10')]);router[_0x10ae('0x11')]('/',auth[_0x10ae('0xb')](),controller['create']);router[_0x10ae('0x11')](_0x10ae('0xd'),auth[_0x10ae('0xb')](),controller[_0x10ae('0x12')]);router[_0x10ae('0x13')](_0x10ae('0xa'),auth['isAuthenticated'](),controller[_0x10ae('0x14')]);router[_0x10ae('0x15')](_0x10ae('0xa'),auth[_0x10ae('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa70c=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update'];(function(_0xc9eaed,_0x2ab979){var _0x2f3fd3=function(_0xcdd809){while(--_0xcdd809){_0xc9eaed['push'](_0xc9eaed['shift']());}};_0x2f3fd3(++_0x2ab979);}(_0xa70c,0x177));var _0xca70=function(_0x483351,_0xb26b44){_0x483351=_0x483351-0x0;var _0x2f9d65=_0xa70c[_0x483351];return _0x2f9d65;};'use strict';var multer=require(_0xca70('0x0'));var util=require(_0xca70('0x1'));var path=require(_0xca70('0x2'));var timeout=require(_0xca70('0x3'));var express=require(_0xca70('0x4'));var router=express['Router']();var auth=require(_0xca70('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca70('0x6'));var controller=require(_0xca70('0x7'));router['get']('/',auth[_0xca70('0x8')](),controller[_0xca70('0x9')]);router[_0xca70('0xa')](_0xca70('0xb'),auth[_0xca70('0x8')](),controller[_0xca70('0xc')]);router[_0xca70('0xa')](_0xca70('0xd'),auth['isAuthenticated'](),controller[_0xca70('0xe')]);router['get']('/:id/fields',auth[_0xca70('0x8')](),controller[_0xca70('0xf')]);router[_0xca70('0x10')]('/',auth['isAuthenticated'](),controller[_0xca70('0x11')]);router[_0xca70('0x10')]('/:id/configurations',auth[_0xca70('0x8')](),controller[_0xca70('0x12')]);router[_0xca70('0x13')]('/:id',auth[_0xca70('0x8')](),controller[_0xca70('0x14')]);router['delete']('/:id',auth[_0xca70('0x8')](),controller['destroy']);module[_0xca70('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e59c069..d817150 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 _0xd906=['STRING','ENUM','basic','integrationTab'];(function(_0x59881a,_0x5ef668){var _0x33a221=function(_0x396188){while(--_0x396188){_0x59881a['push'](_0x59881a['shift']());}};_0x33a221(++_0x5ef668);}(_0xd906,0x1a4));var _0x6d90=function(_0x498953,_0x82d4af){_0x498953=_0x498953-0x0;var _0x4b2237=_0xd906[_0x498953];return _0x4b2237;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6d90('0x0')]},'authType':{'type':Sequelize[_0x6d90('0x1')](_0x6d90('0x2')),'defaultValue':_0x6d90('0x2')},'password':{'type':Sequelize[_0x6d90('0x0')]},'consumerKey':{'type':Sequelize[_0x6d90('0x0')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x6d90('0x0')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6d90('0x0')]},'type':{'type':Sequelize[_0x6d90('0x1')](_0x6d90('0x3'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xa7e1=['exports','STRING','basic','newTab','integrationTab','sequelize'];(function(_0x498c90,_0x35bcd1){var _0x5a100d=function(_0x54e511){while(--_0x54e511){_0x498c90['push'](_0x498c90['shift']());}};_0x5a100d(++_0x35bcd1);}(_0xa7e1,0x77));var _0x1a7e=function(_0x1d4d5b,_0x181e91){_0x1d4d5b=_0x1d4d5b-0x0;var _0x38f347=_0xa7e1[_0x1d4d5b];return _0x38f347;};'use strict';var Sequelize=require(_0x1a7e('0x0'));module[_0x1a7e('0x1')]={'name':{'type':Sequelize[_0x1a7e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1a7e('0x2')]},'remoteUri':{'type':Sequelize[_0x1a7e('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x1a7e('0x3')),'defaultValue':_0x1a7e('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x1a7e('0x2')]},'consumerSecret':{'type':Sequelize[_0x1a7e('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x1a7e('0x2')]},'serverUrl':{'type':Sequelize[_0x1a7e('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x1a7e('0x4')),'defaultValue':_0x1a7e('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 8f40e7d..1a3c859 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 _0xde2c=['getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','name','send','DeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','field','include','show','includeAll','options','find','create','body','params','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskConfiguration','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','toString','base64','concat','_embedded','active','label','test','statusCode'];(function(_0x1b5a3a,_0x2a706b){var _0x3b6a4e=function(_0x422587){while(--_0x422587){_0x1b5a3a['push'](_0x1b5a3a['shift']());}};_0x3b6a4e(++_0x2a706b);}(_0xde2c,0x7f));var _0xcde2=function(_0x16aaef,_0x410651){_0x16aaef=_0x16aaef-0x0;var _0x1c82ef=_0xde2c[_0x16aaef];return _0x1c82ef;};'use strict';var pdf=require(_0xcde2('0x0'));var emlformat=require(_0xcde2('0x1'));var rimraf=require(_0xcde2('0x2'));var zipdir=require(_0xcde2('0x3'));var jsonpatch=require(_0xcde2('0x4'));var rp=require(_0xcde2('0x5'));var moment=require(_0xcde2('0x6'));var BPromise=require(_0xcde2('0x7'));var Mustache=require('mustache');var util=require(_0xcde2('0x8'));var path=require(_0xcde2('0x9'));var sox=require(_0xcde2('0xa'));var csv=require(_0xcde2('0xb'));var ejs=require(_0xcde2('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0xcde2('0x12'));var Redis=require(_0xcde2('0x13'));var qs=require(_0xcde2('0x14'));var logger=require(_0xcde2('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcde2('0x16'));var db=require(_0xcde2('0x17'))['db'];var integrations=require(_0xcde2('0x18'));var jayson=require(_0xcde2('0x19'));var client=jayson[_0xcde2('0x1a')][_0xcde2('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x599294,_0x211215,_0x577062,_0x31c3ba){return new BPromise(function(_0x4f0ac9,_0x4b0e0e){var _0x34e079=_0x31c3ba||client;return _0x34e079[_0xcde2('0x1c')](_0x599294,_0x577062)[_0xcde2('0x1d')](function(_0x19b54b){logger[_0xcde2('0x1e')]('DeskAccount,\x20%s,\x20%s',_0x211215,_0xcde2('0x1f'));logger['debug'](_0xcde2('0x20'),_0x211215,_0xcde2('0x1f'),JSON[_0xcde2('0x21')](_0x19b54b));if(_0x19b54b[_0xcde2('0x22')]){if(_0x19b54b['error']['code']===0x1f4){logger['error'](_0xcde2('0x23'),_0x211215,_0x19b54b['error'][_0xcde2('0x24')]);return _0x4b0e0e(_0x19b54b[_0xcde2('0x22')][_0xcde2('0x24')]);}logger['error'](_0xcde2('0x23'),_0x211215,_0x19b54b[_0xcde2('0x22')][_0xcde2('0x24')]);return _0x4f0ac9(_0x19b54b[_0xcde2('0x22')][_0xcde2('0x24')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x211215,'request\x20sent');_0x4f0ac9(_0x19b54b[_0xcde2('0x25')][_0xcde2('0x24')]);}})[_0xcde2('0x26')](function(_0x4063d4){logger[_0xcde2('0x22')]('DeskAccount,\x20%s,\x20%s',_0x211215,_0x4063d4);_0x4b0e0e(_0x4063d4);});});}function respondWithStatusCode(_0x1104b8,_0x52368b){_0x52368b=_0x52368b||0xcc;return function(_0x280d8c){if(_0x280d8c){return _0x1104b8[_0xcde2('0x27')](_0x52368b);}return _0x1104b8[_0xcde2('0x28')](_0x52368b)['end']();};}function respondWithResult(_0x593aa4,_0x44a222){_0x44a222=_0x44a222||0xc8;return function(_0x207a12){if(_0x207a12){return _0x593aa4[_0xcde2('0x28')](_0x44a222)[_0xcde2('0x29')](_0x207a12);}};}function respondWithFilteredResult(_0xcadb2,_0x5a5b92){return function(_0x2d1d17){if(_0x2d1d17){var _0x45275a=_0x2d1d17[_0xcde2('0x2a')],_0x1dce65=_0x5a5b92[_0xcde2('0x2b')],_0x513965=_0x5a5b92[_0xcde2('0x2b')]+_0x5a5b92[_0xcde2('0x2c')],_0x2487eb;if(_0x513965>=_0x45275a){_0x513965=_0x45275a;_0x2487eb=0xc8;}else{_0x2487eb=0xce;}_0xcadb2[_0xcde2('0x28')](_0x2487eb);return _0xcadb2[_0xcde2('0x2d')](_0xcde2('0x2e'),_0x1dce65+'-'+_0x513965+'/'+_0x45275a)['json'](_0x2d1d17);}return null;};}function patchUpdates(_0x3c3c01){return function(_0x4a0826){try{jsonpatch[_0xcde2('0x2f')](_0x4a0826,_0x3c3c01,!![]);}catch(_0xb87851){return BPromise[_0xcde2('0x30')](_0xb87851);}return _0x4a0826['save']();};}function saveUpdates(_0xae46dc,_0x28fedd){return function(_0x58afb1){if(_0x58afb1){return _0x58afb1[_0xcde2('0x31')](_0xae46dc)[_0xcde2('0x1d')](function(_0x11471e){return _0x11471e;});}return null;};}function removeEntity(_0x2b2ea1,_0x14f784){return function(_0xb689cd){if(_0xb689cd){return _0xb689cd[_0xcde2('0x32')]()[_0xcde2('0x1d')](function(){_0x2b2ea1['status'](0xcc)[_0xcde2('0x33')]();});}};}function handleEntityNotFound(_0x6fda22,_0x21b7bd){return function(_0x15bd3e){if(!_0x15bd3e){_0x6fda22['sendStatus'](0x194);}return _0x15bd3e;};}function handleError(_0x2ae8e0,_0x42a21b){_0x42a21b=_0x42a21b||0x1f4;return function(_0x2e14f8){logger[_0xcde2('0x22')](_0x2e14f8['stack']);if(_0x2e14f8[_0xcde2('0x34')]){delete _0x2e14f8[_0xcde2('0x34')];}_0x2ae8e0[_0xcde2('0x28')](_0x42a21b)[_0xcde2('0x35')](_0x2e14f8);};}exports['index']=function(_0xb9c8d2,_0x5ab40f){var _0xbde4f4={},_0x3090b6={},_0x1646a6={'count':0x0,'rows':[]};var _0x49d8d7=db[_0xcde2('0x36')][_0xcde2('0x37')];_0x3090b6[_0xcde2('0x38')]=_[_0xcde2('0x39')](_0x49d8d7);_0x3090b6['query']=_['keys'](_0xb9c8d2[_0xcde2('0x3a')]);_0x3090b6[_0xcde2('0x3b')]=_[_0xcde2('0x3c')](_0x3090b6[_0xcde2('0x38')],_0x3090b6[_0xcde2('0x3a')]);_0xbde4f4[_0xcde2('0x3d')]=_[_0xcde2('0x3c')](_0x3090b6[_0xcde2('0x38')],qs[_0xcde2('0x3e')](_0xb9c8d2['query'][_0xcde2('0x3e')]));_0xbde4f4[_0xcde2('0x3d')]=_0xbde4f4[_0xcde2('0x3d')][_0xcde2('0x3f')]?_0xbde4f4[_0xcde2('0x3d')]:_0x3090b6['model'];if(!_0xb9c8d2['query'][_0xcde2('0x40')](_0xcde2('0x41'))){_0xbde4f4[_0xcde2('0x2c')]=qs[_0xcde2('0x2c')](_0xb9c8d2[_0xcde2('0x3a')][_0xcde2('0x2c')]);_0xbde4f4['offset']=qs['offset'](_0xb9c8d2['query'][_0xcde2('0x2b')]);}_0xbde4f4[_0xcde2('0x42')]=qs[_0xcde2('0x43')](_0xb9c8d2[_0xcde2('0x3a')][_0xcde2('0x43')]);_0xbde4f4[_0xcde2('0x44')]=qs[_0xcde2('0x3b')](_['pick'](_0xb9c8d2['query'],_0x3090b6[_0xcde2('0x3b')]));if(_0xb9c8d2['query'][_0xcde2('0x45')]){_0xbde4f4['where']=_[_0xcde2('0x46')](_0xbde4f4[_0xcde2('0x44')],{'$or':_[_0xcde2('0x47')](_0x49d8d7,function(_0x5ea9a9){if(_0x5ea9a9[_0xcde2('0x48')]['key']!==_0xcde2('0x49')){var _0x24a46a={};_0x24a46a[_0x5ea9a9[_0xcde2('0x4a')]]={'$like':'%'+_0xb9c8d2[_0xcde2('0x3a')][_0xcde2('0x45')]+'%'};return _0x24a46a;}})});}_0xbde4f4=_[_0xcde2('0x46')]({},_0xbde4f4,_0xb9c8d2['options']);var _0x4adc78={'where':_0xbde4f4[_0xcde2('0x44')]};return db['DeskAccount']['count'](_0x4adc78)[_0xcde2('0x1d')](function(_0x57b689){_0x1646a6[_0xcde2('0x2a')]=_0x57b689;if(_0xb9c8d2[_0xcde2('0x3a')]['includeAll']){_0xbde4f4[_0xcde2('0x4b')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0xbde4f4);})[_0xcde2('0x1d')](function(_0x289936){_0x1646a6['rows']=_0x289936;return _0x1646a6;})[_0xcde2('0x1d')](respondWithFilteredResult(_0x5ab40f,_0xbde4f4))['catch'](handleError(_0x5ab40f,null));};exports[_0xcde2('0x4c')]=function(_0x59129,_0x2d7b55){var _0x411103={'raw':![],'where':{'id':_0x59129['params']['id']}},_0x181b81={};_0x181b81[_0xcde2('0x38')]=_[_0xcde2('0x39')](db[_0xcde2('0x36')][_0xcde2('0x37')]);_0x181b81['query']=_['keys'](_0x59129[_0xcde2('0x3a')]);_0x181b81['filters']=_[_0xcde2('0x3c')](_0x181b81[_0xcde2('0x38')],_0x181b81[_0xcde2('0x3a')]);_0x411103[_0xcde2('0x3d')]=_[_0xcde2('0x3c')](_0x181b81[_0xcde2('0x38')],qs['fields'](_0x59129[_0xcde2('0x3a')]['fields']));_0x411103[_0xcde2('0x3d')]=_0x411103['attributes'][_0xcde2('0x3f')]?_0x411103[_0xcde2('0x3d')]:_0x181b81[_0xcde2('0x38')];if(_0x59129[_0xcde2('0x3a')][_0xcde2('0x4d')]){_0x411103[_0xcde2('0x4b')]=[{'all':!![]}];}_0x411103=_['merge']({},_0x411103,_0x59129[_0xcde2('0x4e')]);return db['DeskAccount'][_0xcde2('0x4f')](_0x411103)[_0xcde2('0x1d')](handleEntityNotFound(_0x2d7b55,null))[_0xcde2('0x1d')](respondWithResult(_0x2d7b55,null))[_0xcde2('0x26')](handleError(_0x2d7b55,null));};exports[_0xcde2('0x50')]=function(_0x9067c8,_0x3a0760){return db[_0xcde2('0x36')][_0xcde2('0x50')](_0x9067c8[_0xcde2('0x51')],{})[_0xcde2('0x1d')](respondWithResult(_0x3a0760,0xc9))[_0xcde2('0x26')](handleError(_0x3a0760,null));};exports['update']=function(_0x53bd70,_0x487565){if(_0x53bd70[_0xcde2('0x51')]['id']){delete _0x53bd70['body']['id'];}return db[_0xcde2('0x36')][_0xcde2('0x4f')]({'where':{'id':_0x53bd70[_0xcde2('0x52')]['id']}})['then'](handleEntityNotFound(_0x487565,null))[_0xcde2('0x1d')](saveUpdates(_0x53bd70['body'],null))[_0xcde2('0x1d')](respondWithResult(_0x487565,null))['catch'](handleError(_0x487565,null));};exports[_0xcde2('0x32')]=function(_0x10d6ab,_0x50d2bf){return db[_0xcde2('0x36')]['find']({'where':{'id':_0x10d6ab['params']['id']}})[_0xcde2('0x1d')](handleEntityNotFound(_0x50d2bf,null))[_0xcde2('0x1d')](removeEntity(_0x50d2bf,null))[_0xcde2('0x26')](handleError(_0x50d2bf,null));};exports[_0xcde2('0x53')]=function(_0x149e83,_0x3787b5,_0x522c37){var _0x47329f={};var _0x44b3fb={};var _0x21b4e6;var _0x145b4a;return db[_0xcde2('0x36')][_0xcde2('0x54')]({'where':{'id':_0x149e83['params']['id']}})['then'](handleEntityNotFound(_0x3787b5,null))[_0xcde2('0x1d')](function(_0x35c6e5){if(_0x35c6e5){_0x21b4e6=_0x35c6e5;_0x44b3fb[_0xcde2('0x38')]=_[_0xcde2('0x39')](db['DeskConfiguration'][_0xcde2('0x37')]);_0x44b3fb[_0xcde2('0x3a')]=_[_0xcde2('0x39')](_0x149e83[_0xcde2('0x3a')]);_0x44b3fb[_0xcde2('0x3b')]=_[_0xcde2('0x3c')](_0x44b3fb['model'],_0x44b3fb[_0xcde2('0x3a')]);_0x47329f[_0xcde2('0x3d')]=_['intersection'](_0x44b3fb[_0xcde2('0x38')],qs[_0xcde2('0x3e')](_0x149e83[_0xcde2('0x3a')][_0xcde2('0x3e')]));_0x47329f[_0xcde2('0x3d')]=_0x47329f[_0xcde2('0x3d')][_0xcde2('0x3f')]?_0x47329f[_0xcde2('0x3d')]:_0x44b3fb[_0xcde2('0x38')];_0x47329f[_0xcde2('0x42')]=qs['sort'](_0x149e83[_0xcde2('0x3a')][_0xcde2('0x43')]);_0x47329f['where']=qs[_0xcde2('0x3b')](_[_0xcde2('0x55')](_0x149e83[_0xcde2('0x3a')],_0x44b3fb['filters']));if(_0x149e83[_0xcde2('0x3a')][_0xcde2('0x45')]){_0x47329f[_0xcde2('0x44')]=_[_0xcde2('0x46')](_0x47329f[_0xcde2('0x44')],{'$or':_[_0xcde2('0x47')](_0x47329f[_0xcde2('0x3d')],function(_0x45bd76){var _0x857e85={};_0x857e85[_0x45bd76]={'$like':'%'+_0x149e83[_0xcde2('0x3a')][_0xcde2('0x45')]+'%'};return _0x857e85;})});}_0x47329f=_['merge']({},_0x47329f,_0x149e83['options']);return _0x21b4e6[_0xcde2('0x53')](_0x47329f);}})[_0xcde2('0x1d')](function(_0x1c9fbb){if(_0x1c9fbb){_0x145b4a=_0x1c9fbb['length'];if(!_0x149e83['query']['hasOwnProperty'](_0xcde2('0x41'))){_0x47329f[_0xcde2('0x2c')]=qs[_0xcde2('0x2c')](_0x149e83[_0xcde2('0x3a')][_0xcde2('0x2c')]);_0x47329f[_0xcde2('0x2b')]=qs['offset'](_0x149e83['query'][_0xcde2('0x2b')]);}return _0x21b4e6[_0xcde2('0x53')](_0x47329f);}})[_0xcde2('0x1d')](function(_0x289cd1){if(_0x289cd1){return _0x289cd1?{'count':_0x145b4a,'rows':_0x289cd1}:null;}})[_0xcde2('0x1d')](respondWithResult(_0x3787b5,null))[_0xcde2('0x26')](handleError(_0x3787b5,null));};exports[_0xcde2('0x56')]=function(_0x31234a,_0x3f0b7c,_0x2017c7){if(_0x31234a[_0xcde2('0x51')]['id']){delete _0x31234a[_0xcde2('0x51')]['id'];}return db[_0xcde2('0x36')][_0xcde2('0x54')]({'where':{'id':_0x31234a[_0xcde2('0x52')]['id']}})[_0xcde2('0x1d')](handleEntityNotFound(_0x3f0b7c,null))[_0xcde2('0x1d')](function(_0x97db81){if(_0x97db81){_0x31234a[_0xcde2('0x51')][_0xcde2('0x57')]=_0x97db81['id'];_0x31234a['body'][_0xcde2('0x58')]=integrations[_0xcde2('0x59')](_0x31234a[_0xcde2('0x51')][_0xcde2('0x5a')],_0x31234a[_0xcde2('0x51')]['type']);_0x31234a[_0xcde2('0x51')]['Descriptions']=integrations[_0xcde2('0x5b')](_0x31234a[_0xcde2('0x51')][_0xcde2('0x5a')],_0x31234a[_0xcde2('0x51')][_0xcde2('0x48')]);return db[_0xcde2('0x5c')][_0xcde2('0x50')](_0x31234a['body'],{'include':[{'model':db['DeskField'],'as':_0xcde2('0x58')},{'model':db['DeskField'],'as':_0xcde2('0x5d')}]});}return null;})[_0xcde2('0x1d')](respondWithResult(_0x3f0b7c,null))[_0xcde2('0x26')](handleError(_0x3f0b7c,null));};exports[_0xcde2('0x5e')]=function(_0x3ce6ec,_0x2ac7f1,_0x257950){var _0x4a4755=[{'name':_0xcde2('0x5f'),'label':_0xcde2('0x5f'),'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 _0x25ee3e='';return db[_0xcde2('0x36')]['findOne']({'where':{'id':_0x3ce6ec[_0xcde2('0x52')]['id']},'attributes':['id',_0xcde2('0x60'),_0xcde2('0x61'),_0xcde2('0x62'),_0xcde2('0x63'),_0xcde2('0x64'),_0xcde2('0x65'),_0xcde2('0x66'),_0xcde2('0x67')]})[_0xcde2('0x1d')](handleEntityNotFound(_0x2ac7f1,null))[_0xcde2('0x1d')](function(_0x225ddd){if(_0x225ddd){_0x25ee3e=_0x225ddd[_0xcde2('0x60')];var _0x505e84=_0x25ee3e[_0xcde2('0x68')](-0x1);if(_0x505e84==='/'){_0x25ee3e=_0x25ee3e[_0xcde2('0x69')](0x0,_0x25ee3e[_0xcde2('0x6a')](_0x505e84));}var _0x332f32={'method':_0xcde2('0x6b'),'uri':util[_0xcde2('0x6c')](_0xcde2('0x6d'),_0x25ee3e),'headers':{'Content-Type':_0xcde2('0x6e'),'Accept':_0xcde2('0x6e')},'json':!![]};if(_0x225ddd[_0xcde2('0x61')]===_0xcde2('0x6f')){_0x332f32[_0xcde2('0x70')][_0xcde2('0x71')]=util[_0xcde2('0x6c')](_0xcde2('0x72'),new Buffer(util[_0xcde2('0x6c')]('%s:%s',_0x225ddd['username'],_0x225ddd[_0xcde2('0x63')]))[_0xcde2('0x73')](_0xcde2('0x74')));}return rp(_0x332f32)[_0xcde2('0x1d')](function(_0x4ffd32){return _0x4a4755[_0xcde2('0x75')](_['map'](_0x4ffd32[_0xcde2('0x76')]['entries'],function(_0x476e2f){return{'id':_0x476e2f[_0xcde2('0x34')],'name':_0x476e2f['name'],'type':_0x476e2f[_0xcde2('0x48')],'active':_0x476e2f[_0xcde2('0x77')],'label':_0x476e2f[_0xcde2('0x78')],'custom':!![]};}));});}})['then'](function(_0x1bbc7e){return{'count':_0x1bbc7e[_0xcde2('0x3f')],'rows':_0x1bbc7e};})[_0xcde2('0x1d')](respondWithResult(_0x2ac7f1,null))[_0xcde2('0x26')](function(_0x4b7e5f){var _0x4a1a7d=_0x3ce6ec[_0xcde2('0x3a')][_0xcde2('0x79')]?0x1f4:_0x4b7e5f[_0xcde2('0x7a')]||0x1f4;logger[_0xcde2('0x22')](_0xcde2('0x7b'),_0xcde2('0x5e'),_0x4a1a7d,JSON['stringify'](_0x4b7e5f));delete _0x4b7e5f[_0xcde2('0x34')];if(_0x4a1a7d===0x191){_0x4a1a7d=0x190;}_0x2ac7f1[_0xcde2('0x28')](_0x4a1a7d)[_0xcde2('0x35')](_0x3ce6ec[_0xcde2('0x3a')][_0xcde2('0x79')]?{'message':_0xcde2('0x7c'),'statusCode':_0x4b7e5f[_0xcde2('0x7a')]}:_0x4b7e5f);});}; \ No newline at end of file +var _0x37e9=['username','consumerKey','consumerSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','authType','basic','%s:%s','toString','base64','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','count','offset','set','json','reject','save','update','destroy','name','send','index','DeskAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','show','find','create','body','params','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority'];(function(_0x13cbfb,_0x5b397d){var _0x2b4439=function(_0x707df2){while(--_0x707df2){_0x13cbfb['push'](_0x13cbfb['shift']());}};_0x2b4439(++_0x5b397d);}(_0x37e9,0x1e7));var _0x937e=function(_0x68622a,_0x21cd17){_0x68622a=_0x68622a-0x0;var _0x47b372=_0x37e9[_0x68622a];return _0x47b372;};'use strict';var pdf=require(_0x937e('0x0'));var emlformat=require(_0x937e('0x1'));var rimraf=require(_0x937e('0x2'));var zipdir=require(_0x937e('0x3'));var jsonpatch=require(_0x937e('0x4'));var rp=require(_0x937e('0x5'));var moment=require(_0x937e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x937e('0x7'));var util=require(_0x937e('0x8'));var path=require(_0x937e('0x9'));var sox=require(_0x937e('0xa'));var csv=require(_0x937e('0xb'));var ejs=require(_0x937e('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x937e('0xd'));var crypto=require(_0x937e('0xe'));var jsforce=require(_0x937e('0xf'));var deskjs=require(_0x937e('0x10'));var toCsv=require(_0x937e('0xb'));var querystring=require(_0x937e('0x11'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x937e('0x12'));var Redis=require(_0x937e('0x13'));var qs=require(_0x937e('0x14'));var logger=require(_0x937e('0x15'))(_0x937e('0x16'));var utils=require(_0x937e('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x937e('0x18'));var client=jayson[_0x937e('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x216c24,_0x31f851,_0x99e9bc,_0x1a0dc9){return new BPromise(function(_0x4f4f21,_0x369119){var _0x1ea9e2=_0x1a0dc9||client;return _0x1ea9e2[_0x937e('0x1a')](_0x216c24,_0x99e9bc)[_0x937e('0x1b')](function(_0x5ab042){logger[_0x937e('0x1c')](_0x937e('0x1d'),_0x31f851,_0x937e('0x1e'));logger[_0x937e('0x1f')](_0x937e('0x20'),_0x31f851,_0x937e('0x1e'),JSON[_0x937e('0x21')](_0x5ab042));if(_0x5ab042[_0x937e('0x22')]){if(_0x5ab042['error']['code']===0x1f4){logger[_0x937e('0x22')](_0x937e('0x1d'),_0x31f851,_0x5ab042[_0x937e('0x22')][_0x937e('0x23')]);return _0x369119(_0x5ab042[_0x937e('0x22')][_0x937e('0x23')]);}logger[_0x937e('0x22')](_0x937e('0x1d'),_0x31f851,_0x5ab042[_0x937e('0x22')]['message']);return _0x4f4f21(_0x5ab042[_0x937e('0x22')][_0x937e('0x23')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x31f851,_0x937e('0x1e'));_0x4f4f21(_0x5ab042[_0x937e('0x24')]['message']);}})[_0x937e('0x25')](function(_0x5ae493){logger[_0x937e('0x22')](_0x937e('0x1d'),_0x31f851,_0x5ae493);_0x369119(_0x5ae493);});});}function respondWithStatusCode(_0x218ddc,_0xdf7ea8){_0xdf7ea8=_0xdf7ea8||0xcc;return function(_0x132ece){if(_0x132ece){return _0x218ddc['sendStatus'](_0xdf7ea8);}return _0x218ddc[_0x937e('0x26')](_0xdf7ea8)[_0x937e('0x27')]();};}function respondWithResult(_0x35d24a,_0xecae9){_0xecae9=_0xecae9||0xc8;return function(_0x41ab49){if(_0x41ab49){return _0x35d24a[_0x937e('0x26')](_0xecae9)['json'](_0x41ab49);}};}function respondWithFilteredResult(_0x431f82,_0xcfeba2){return function(_0x2ee185){if(_0x2ee185){var _0x41ea93=_0x2ee185[_0x937e('0x28')],_0x5297b1=_0xcfeba2[_0x937e('0x29')],_0x181759=_0xcfeba2[_0x937e('0x29')]+_0xcfeba2['limit'],_0x2a27ec;if(_0x181759>=_0x41ea93){_0x181759=_0x41ea93;_0x2a27ec=0xc8;}else{_0x2a27ec=0xce;}_0x431f82[_0x937e('0x26')](_0x2a27ec);return _0x431f82[_0x937e('0x2a')]('Content-Range',_0x5297b1+'-'+_0x181759+'/'+_0x41ea93)[_0x937e('0x2b')](_0x2ee185);}return null;};}function patchUpdates(_0x369168){return function(_0x439caa){try{jsonpatch['apply'](_0x439caa,_0x369168,!![]);}catch(_0x314f86){return BPromise[_0x937e('0x2c')](_0x314f86);}return _0x439caa[_0x937e('0x2d')]();};}function saveUpdates(_0x2564c3,_0x1a90e7){return function(_0x1ee0a4){if(_0x1ee0a4){return _0x1ee0a4[_0x937e('0x2e')](_0x2564c3)[_0x937e('0x1b')](function(_0x2441a8){return _0x2441a8;});}return null;};}function removeEntity(_0x3b8a9a,_0xdf7235){return function(_0x137518){if(_0x137518){return _0x137518[_0x937e('0x2f')]()[_0x937e('0x1b')](function(){_0x3b8a9a[_0x937e('0x26')](0xcc)[_0x937e('0x27')]();});}};}function handleEntityNotFound(_0x5edde4,_0x35f1e4){return function(_0x405605){if(!_0x405605){_0x5edde4['sendStatus'](0x194);}return _0x405605;};}function handleError(_0x480d70,_0x117a6c){_0x117a6c=_0x117a6c||0x1f4;return function(_0x28ccbe){logger['error'](_0x28ccbe['stack']);if(_0x28ccbe[_0x937e('0x30')]){delete _0x28ccbe[_0x937e('0x30')];}_0x480d70[_0x937e('0x26')](_0x117a6c)[_0x937e('0x31')](_0x28ccbe);};}exports[_0x937e('0x32')]=function(_0x13a726,_0x5712f0){var _0x3056f7={},_0x1745be={},_0x5b404d={'count':0x0,'rows':[]};var _0x14dcb9=db[_0x937e('0x33')][_0x937e('0x34')];_0x1745be[_0x937e('0x35')]=_[_0x937e('0x36')](_0x14dcb9);_0x1745be[_0x937e('0x37')]=_['keys'](_0x13a726[_0x937e('0x37')]);_0x1745be[_0x937e('0x38')]=_['intersection'](_0x1745be[_0x937e('0x35')],_0x1745be[_0x937e('0x37')]);_0x3056f7[_0x937e('0x39')]=_[_0x937e('0x3a')](_0x1745be[_0x937e('0x35')],qs[_0x937e('0x3b')](_0x13a726[_0x937e('0x37')]['fields']));_0x3056f7[_0x937e('0x39')]=_0x3056f7[_0x937e('0x39')][_0x937e('0x3c')]?_0x3056f7[_0x937e('0x39')]:_0x1745be[_0x937e('0x35')];if(!_0x13a726[_0x937e('0x37')]['hasOwnProperty'](_0x937e('0x3d'))){_0x3056f7[_0x937e('0x3e')]=qs['limit'](_0x13a726[_0x937e('0x37')]['limit']);_0x3056f7[_0x937e('0x29')]=qs[_0x937e('0x29')](_0x13a726['query'][_0x937e('0x29')]);}_0x3056f7[_0x937e('0x3f')]=qs['sort'](_0x13a726['query'][_0x937e('0x40')]);_0x3056f7[_0x937e('0x41')]=qs[_0x937e('0x38')](_['pick'](_0x13a726[_0x937e('0x37')],_0x1745be[_0x937e('0x38')]));if(_0x13a726[_0x937e('0x37')][_0x937e('0x42')]){_0x3056f7[_0x937e('0x41')]=_[_0x937e('0x43')](_0x3056f7[_0x937e('0x41')],{'$or':_[_0x937e('0x44')](_0x14dcb9,function(_0x48f9b3){if(_0x48f9b3[_0x937e('0x45')][_0x937e('0x46')]!==_0x937e('0x47')){var _0x387e35={};_0x387e35[_0x48f9b3[_0x937e('0x48')]]={'$like':'%'+_0x13a726[_0x937e('0x37')]['filter']+'%'};return _0x387e35;}})});}_0x3056f7=_[_0x937e('0x43')]({},_0x3056f7,_0x13a726[_0x937e('0x49')]);var _0x51aa1c={'where':_0x3056f7[_0x937e('0x41')]};return db[_0x937e('0x33')][_0x937e('0x28')](_0x51aa1c)[_0x937e('0x1b')](function(_0x5aef15){_0x5b404d[_0x937e('0x28')]=_0x5aef15;if(_0x13a726[_0x937e('0x37')][_0x937e('0x4a')]){_0x3056f7['include']=[{'all':!![]}];}return db[_0x937e('0x33')]['findAll'](_0x3056f7);})[_0x937e('0x1b')](function(_0x343027){_0x5b404d['rows']=_0x343027;return _0x5b404d;})[_0x937e('0x1b')](respondWithFilteredResult(_0x5712f0,_0x3056f7))[_0x937e('0x25')](handleError(_0x5712f0,null));};exports[_0x937e('0x4b')]=function(_0x4779a3,_0x52376a){var _0x4f3fc1={'raw':![],'where':{'id':_0x4779a3['params']['id']}},_0x5bb8f3={};_0x5bb8f3[_0x937e('0x35')]=_[_0x937e('0x36')](db[_0x937e('0x33')][_0x937e('0x34')]);_0x5bb8f3['query']=_[_0x937e('0x36')](_0x4779a3[_0x937e('0x37')]);_0x5bb8f3[_0x937e('0x38')]=_[_0x937e('0x3a')](_0x5bb8f3[_0x937e('0x35')],_0x5bb8f3[_0x937e('0x37')]);_0x4f3fc1[_0x937e('0x39')]=_[_0x937e('0x3a')](_0x5bb8f3[_0x937e('0x35')],qs[_0x937e('0x3b')](_0x4779a3['query'][_0x937e('0x3b')]));_0x4f3fc1['attributes']=_0x4f3fc1[_0x937e('0x39')][_0x937e('0x3c')]?_0x4f3fc1[_0x937e('0x39')]:_0x5bb8f3[_0x937e('0x35')];if(_0x4779a3['query']['includeAll']){_0x4f3fc1['include']=[{'all':!![]}];}_0x4f3fc1=_[_0x937e('0x43')]({},_0x4f3fc1,_0x4779a3[_0x937e('0x49')]);return db[_0x937e('0x33')][_0x937e('0x4c')](_0x4f3fc1)[_0x937e('0x1b')](handleEntityNotFound(_0x52376a,null))[_0x937e('0x1b')](respondWithResult(_0x52376a,null))[_0x937e('0x25')](handleError(_0x52376a,null));};exports[_0x937e('0x4d')]=function(_0x8eae37,_0x659087){return db[_0x937e('0x33')][_0x937e('0x4d')](_0x8eae37['body'],{})['then'](respondWithResult(_0x659087,0xc9))[_0x937e('0x25')](handleError(_0x659087,null));};exports['update']=function(_0x2446a9,_0x7f444){if(_0x2446a9[_0x937e('0x4e')]['id']){delete _0x2446a9['body']['id'];}return db[_0x937e('0x33')]['find']({'where':{'id':_0x2446a9[_0x937e('0x4f')]['id']}})[_0x937e('0x1b')](handleEntityNotFound(_0x7f444,null))['then'](saveUpdates(_0x2446a9[_0x937e('0x4e')],null))[_0x937e('0x1b')](respondWithResult(_0x7f444,null))[_0x937e('0x25')](handleError(_0x7f444,null));};exports[_0x937e('0x2f')]=function(_0x1d6056,_0x3cbfd0){return db['DeskAccount'][_0x937e('0x4c')]({'where':{'id':_0x1d6056['params']['id']}})[_0x937e('0x1b')](handleEntityNotFound(_0x3cbfd0,null))[_0x937e('0x1b')](removeEntity(_0x3cbfd0,null))[_0x937e('0x25')](handleError(_0x3cbfd0,null));};exports[_0x937e('0x50')]=function(_0x24e0be,_0x466213,_0x32119b){var _0xca4c81={};var _0x3fa4f3={};var _0x58bde4;var _0x1270db;return db[_0x937e('0x33')][_0x937e('0x51')]({'where':{'id':_0x24e0be['params']['id']}})[_0x937e('0x1b')](handleEntityNotFound(_0x466213,null))[_0x937e('0x1b')](function(_0x184a5f){if(_0x184a5f){_0x58bde4=_0x184a5f;_0x3fa4f3[_0x937e('0x35')]=_[_0x937e('0x36')](db[_0x937e('0x52')][_0x937e('0x34')]);_0x3fa4f3[_0x937e('0x37')]=_[_0x937e('0x36')](_0x24e0be[_0x937e('0x37')]);_0x3fa4f3[_0x937e('0x38')]=_[_0x937e('0x3a')](_0x3fa4f3[_0x937e('0x35')],_0x3fa4f3['query']);_0xca4c81[_0x937e('0x39')]=_[_0x937e('0x3a')](_0x3fa4f3[_0x937e('0x35')],qs[_0x937e('0x3b')](_0x24e0be[_0x937e('0x37')][_0x937e('0x3b')]));_0xca4c81[_0x937e('0x39')]=_0xca4c81['attributes'][_0x937e('0x3c')]?_0xca4c81[_0x937e('0x39')]:_0x3fa4f3[_0x937e('0x35')];_0xca4c81[_0x937e('0x3f')]=qs['sort'](_0x24e0be['query'][_0x937e('0x40')]);_0xca4c81[_0x937e('0x41')]=qs[_0x937e('0x38')](_['pick'](_0x24e0be[_0x937e('0x37')],_0x3fa4f3[_0x937e('0x38')]));if(_0x24e0be[_0x937e('0x37')]['filter']){_0xca4c81[_0x937e('0x41')]=_['merge'](_0xca4c81[_0x937e('0x41')],{'$or':_[_0x937e('0x44')](_0xca4c81[_0x937e('0x39')],function(_0x269124){var _0x564eb0={};_0x564eb0[_0x269124]={'$like':'%'+_0x24e0be[_0x937e('0x37')][_0x937e('0x42')]+'%'};return _0x564eb0;})});}_0xca4c81=_[_0x937e('0x43')]({},_0xca4c81,_0x24e0be[_0x937e('0x49')]);return _0x58bde4['getConfigurations'](_0xca4c81);}})[_0x937e('0x1b')](function(_0x1f5954){if(_0x1f5954){_0x1270db=_0x1f5954[_0x937e('0x3c')];if(!_0x24e0be[_0x937e('0x37')][_0x937e('0x53')](_0x937e('0x3d'))){_0xca4c81['limit']=qs[_0x937e('0x3e')](_0x24e0be['query'][_0x937e('0x3e')]);_0xca4c81[_0x937e('0x29')]=qs['offset'](_0x24e0be[_0x937e('0x37')][_0x937e('0x29')]);}return _0x58bde4['getConfigurations'](_0xca4c81);}})[_0x937e('0x1b')](function(_0x424511){if(_0x424511){return _0x424511?{'count':_0x1270db,'rows':_0x424511}:null;}})['then'](respondWithResult(_0x466213,null))[_0x937e('0x25')](handleError(_0x466213,null));};exports[_0x937e('0x54')]=function(_0x300db1,_0x38710d,_0x244c0b){if(_0x300db1[_0x937e('0x4e')]['id']){delete _0x300db1[_0x937e('0x4e')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x300db1['params']['id']}})[_0x937e('0x1b')](handleEntityNotFound(_0x38710d,null))[_0x937e('0x1b')](function(_0x43e3a2){if(_0x43e3a2){_0x300db1[_0x937e('0x4e')]['AccountId']=_0x43e3a2['id'];_0x300db1['body'][_0x937e('0x55')]=integrations[_0x937e('0x56')](_0x300db1[_0x937e('0x4e')][_0x937e('0x57')],_0x300db1['body']['type']);_0x300db1['body'][_0x937e('0x58')]=integrations[_0x937e('0x59')](_0x300db1[_0x937e('0x4e')][_0x937e('0x57')],_0x300db1['body'][_0x937e('0x45')]);return db[_0x937e('0x52')][_0x937e('0x4d')](_0x300db1[_0x937e('0x4e')],{'include':[{'model':db[_0x937e('0x5a')],'as':_0x937e('0x55')},{'model':db[_0x937e('0x5a')],'as':_0x937e('0x58')}]});}return null;})['then'](respondWithResult(_0x38710d,null))['catch'](handleError(_0x38710d,null));};exports[_0x937e('0x5b')]=function(_0x336e53,_0x44a150,_0xdf9c6b){var _0x440c2d=[{'name':_0x937e('0x5c'),'label':_0x937e('0x5c'),'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 _0x320a92='';return db[_0x937e('0x33')][_0x937e('0x51')]({'where':{'id':_0x336e53['params']['id']},'attributes':['id','remoteUri','authType',_0x937e('0x5d'),'password',_0x937e('0x5e'),_0x937e('0x5f'),'token','tokenSecret']})[_0x937e('0x1b')](handleEntityNotFound(_0x44a150,null))[_0x937e('0x1b')](function(_0xe36b29){if(_0xe36b29){_0x320a92=_0xe36b29[_0x937e('0x60')];var _0x1eb789=_0x320a92[_0x937e('0x61')](-0x1);if(_0x1eb789==='/'){_0x320a92=_0x320a92[_0x937e('0x62')](0x0,_0x320a92[_0x937e('0x63')](_0x1eb789));}var _0xf681d3={'method':_0x937e('0x64'),'uri':util[_0x937e('0x65')](_0x937e('0x66'),_0x320a92),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0xe36b29[_0x937e('0x67')]===_0x937e('0x68')){_0xf681d3['headers']['Authorization']=util[_0x937e('0x65')]('Basic\x20%s',new Buffer(util[_0x937e('0x65')](_0x937e('0x69'),_0xe36b29[_0x937e('0x5d')],_0xe36b29['password']))[_0x937e('0x6a')](_0x937e('0x6b')));}return rp(_0xf681d3)[_0x937e('0x1b')](function(_0x47f594){return _0x440c2d[_0x937e('0x6c')](_[_0x937e('0x44')](_0x47f594[_0x937e('0x6d')][_0x937e('0x6e')],function(_0x1d133c){return{'id':_0x1d133c[_0x937e('0x30')],'name':_0x1d133c['name'],'type':_0x1d133c[_0x937e('0x45')],'active':_0x1d133c['active'],'label':_0x1d133c[_0x937e('0x6f')],'custom':!![]};}));});}})[_0x937e('0x1b')](function(_0x3b3933){return{'count':_0x3b3933[_0x937e('0x3c')],'rows':_0x3b3933};})['then'](respondWithResult(_0x44a150,null))[_0x937e('0x25')](function(_0x41b3a4){var _0x191792=_0x336e53[_0x937e('0x37')][_0x937e('0x70')]?0x1f4:_0x41b3a4[_0x937e('0x71')]||0x1f4;logger[_0x937e('0x22')](_0x937e('0x72'),_0x937e('0x5b'),_0x191792,JSON[_0x937e('0x21')](_0x41b3a4));delete _0x41b3a4['name'];if(_0x191792===0x191){_0x191792=0x190;}_0x44a150[_0x937e('0x26')](_0x191792)['send'](_0x336e53[_0x937e('0x37')][_0x937e('0x70')]?{'message':_0x937e('0x73'),'statusCode':_0x41b3a4[_0x937e('0x71')]}:_0x41b3a4);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index ea60f76..fdf63c8 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 _0xb2f3=['int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../components/integrations/configuration','exports','define','DeskAccount'];(function(_0x109751,_0x1c8c21){var _0x44fd3d=function(_0x77f5cb){while(--_0x77f5cb){_0x109751['push'](_0x109751['shift']());}};_0x44fd3d(++_0x1c8c21);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xb2f3[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var logger=require(_0x3b2f('0x2'))(_0x3b2f('0x3'));var moment=require(_0x3b2f('0x4'));var BPromise=require(_0x3b2f('0x5'));var rp=require(_0x3b2f('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x3b2f('0x7'));module[_0x3b2f('0x8')]=function(_0x198dcc,_0x47559b){return _0x198dcc[_0x3b2f('0x9')](_0x3b2f('0xa'),attributes,{'tableName':_0x3b2f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4f4=['bluebird','request-promise','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment'];(function(_0x47e3ef,_0x551b2c){var _0x502417=function(_0x500211){while(--_0x500211){_0x47e3ef['push'](_0x47e3ef['shift']());}};_0x502417(++_0x551b2c);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x7dd68e,_0x2b42f5){_0x7dd68e=_0x7dd68e-0x0;var _0x182d77=_0xf4f4[_0x7dd68e];return _0x182d77;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var logger=require('../../config/logger')(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var BPromise=require(_0x4f4f('0x4'));var rp=require(_0x4f4f('0x5'));var attributes=require(_0x4f4f('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x4f4f('0x7')]=function(_0x593952,_0x3f274d){return _0x593952[_0x4f4f('0x8')](_0x4f4f('0x9'),attributes,{'tableName':_0x4f4f('0xa'),'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 a792464..6afbfec 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 _0x8cce=['raw','where','include','model','attributes','map','then','GetDeskAccount','ShowDeskAccount','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options'];(function(_0x53e974,_0x136aae){var _0x134a33=function(_0xc60a0b){while(--_0xc60a0b){_0x53e974['push'](_0x53e974['shift']());}};_0x134a33(++_0x136aae);}(_0x8cce,0xd6));var _0xe8cc=function(_0x387b33,_0x1cb999){_0x387b33=_0x387b33-0x0;var _0x53d1b2=_0x8cce[_0x387b33];return _0x53d1b2;};'use strict';var _=require('lodash');var util=require(_0xe8cc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8cc('0x1'));var fs=require('fs');var Redis=require(_0xe8cc('0x2'));var db=require(_0xe8cc('0x3'))['db'];var utils=require(_0xe8cc('0x4'));var logger=require(_0xe8cc('0x5'))(_0xe8cc('0x6'));var config=require(_0xe8cc('0x7'));var jayson=require(_0xe8cc('0x8'));var client=jayson[_0xe8cc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bec94,_0x53bdb0,_0x57c54c){return new BPromise(function(_0x4ef8ab,_0x9a03a5){return client[_0xe8cc('0xa')](_0x1bec94,_0x57c54c)['then'](function(_0x1a6a2b){logger['info'](_0xe8cc('0xb'),_0x53bdb0,_0xe8cc('0xc'));logger[_0xe8cc('0xd')](_0xe8cc('0xe'),_0x53bdb0,_0xe8cc('0xc'),JSON[_0xe8cc('0xf')](_0x1a6a2b));if(_0x1a6a2b['error']){if(_0x1a6a2b[_0xe8cc('0x10')][_0xe8cc('0x11')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x53bdb0,_0x1a6a2b[_0xe8cc('0x10')]['message']);return _0x9a03a5(_0x1a6a2b['error'][_0xe8cc('0x12')]);}logger['error'](_0xe8cc('0xb'),_0x53bdb0,_0x1a6a2b[_0xe8cc('0x10')][_0xe8cc('0x12')]);return _0x4ef8ab(_0x1a6a2b['error'][_0xe8cc('0x12')]);}else{logger[_0xe8cc('0x13')](_0xe8cc('0xb'),_0x53bdb0,_0xe8cc('0xc'));_0x4ef8ab(_0x1a6a2b[_0xe8cc('0x14')][_0xe8cc('0x12')]);}})[_0xe8cc('0x15')](function(_0x3678d5){logger[_0xe8cc('0x10')](_0xe8cc('0xb'),_0x53bdb0,_0x3678d5);_0x9a03a5(_0x3678d5);});});}exports['GetDeskAccount']=function(_0x53656f){var _0x3a087a=this;return new Promise(function(_0xb703cc,_0x515e87){return db['DeskAccount'][_0xe8cc('0x16')]({'raw':_0x53656f[_0xe8cc('0x17')]?_0x53656f[_0xe8cc('0x17')][_0xe8cc('0x18')]===undefined?!![]:![]:!![],'where':_0x53656f[_0xe8cc('0x17')]?_0x53656f[_0xe8cc('0x17')][_0xe8cc('0x19')]||null:null,'attributes':_0x53656f[_0xe8cc('0x17')]?_0x53656f['options']['attributes']||null:null,'limit':_0x53656f[_0xe8cc('0x17')]?_0x53656f['options']['limit']||null:null,'include':_0x53656f[_0xe8cc('0x17')]?_0x53656f[_0xe8cc('0x17')][_0xe8cc('0x1a')]?_['map'](_0x53656f[_0xe8cc('0x17')][_0xe8cc('0x1a')],function(_0x2360ce){return{'model':db[_0x2360ce[_0xe8cc('0x1b')]],'as':_0x2360ce['as'],'attributes':_0x2360ce[_0xe8cc('0x1c')],'include':_0x2360ce[_0xe8cc('0x1a')]?_[_0xe8cc('0x1d')](_0x2360ce[_0xe8cc('0x1a')],function(_0x58cd29){return{'model':db[_0x58cd29[_0xe8cc('0x1b')]],'as':_0x58cd29['as'],'attributes':_0x58cd29[_0xe8cc('0x1c')],'include':_0x58cd29[_0xe8cc('0x1a')]?_[_0xe8cc('0x1d')](_0x58cd29[_0xe8cc('0x1a')],function(_0x2709b4){return{'model':db[_0x2709b4[_0xe8cc('0x1b')]],'as':_0x2709b4['as'],'attributes':_0x2709b4[_0xe8cc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0x1e')](function(_0x3a69fe){logger[_0xe8cc('0x13')](_0xe8cc('0x1f'),_0x53656f);logger[_0xe8cc('0xd')](_0xe8cc('0x1f'),_0x53656f,JSON['stringify'](_0x3a69fe));_0xb703cc(_0x3a69fe);})[_0xe8cc('0x15')](function(_0x278b5a){logger['error'](_0xe8cc('0x1f'),_0x278b5a[_0xe8cc('0x12')],_0x53656f);_0x515e87(_0x3a087a[_0xe8cc('0x10')](0x1f4,_0x278b5a[_0xe8cc('0x12')]));});});};exports[_0xe8cc('0x20')]=function(_0x45a0a2){var _0xdc9b1b=this;return new Promise(function(_0x407137,_0x2bab8d){return db['DeskAccount'][_0xe8cc('0x21')]({'raw':_0x45a0a2[_0xe8cc('0x17')]?_0x45a0a2[_0xe8cc('0x17')][_0xe8cc('0x18')]===undefined?!![]:![]:!![],'where':_0x45a0a2[_0xe8cc('0x17')]?_0x45a0a2[_0xe8cc('0x17')][_0xe8cc('0x19')]||null:null,'attributes':_0x45a0a2[_0xe8cc('0x17')]?_0x45a0a2[_0xe8cc('0x17')][_0xe8cc('0x1c')]||null:null,'include':_0x45a0a2[_0xe8cc('0x17')]?_0x45a0a2[_0xe8cc('0x17')]['include']?_['map'](_0x45a0a2['options']['include'],function(_0x7a468e){return{'model':db[_0x7a468e[_0xe8cc('0x1b')]],'as':_0x7a468e['as'],'attributes':_0x7a468e[_0xe8cc('0x1c')],'include':_0x7a468e['include']?_[_0xe8cc('0x1d')](_0x7a468e[_0xe8cc('0x1a')],function(_0x1d1fb9){return{'model':db[_0x1d1fb9[_0xe8cc('0x1b')]],'as':_0x1d1fb9['as'],'attributes':_0x1d1fb9['attributes'],'include':_0x1d1fb9[_0xe8cc('0x1a')]?_['map'](_0x1d1fb9[_0xe8cc('0x1a')],function(_0x17a9e8){return{'model':db[_0x17a9e8['model']],'as':_0x17a9e8['as'],'attributes':_0x17a9e8[_0xe8cc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0x1e')](function(_0x3595b7){logger['info'](_0xe8cc('0x20'),_0x45a0a2);logger[_0xe8cc('0xd')]('ShowDeskAccount',_0x45a0a2,JSON[_0xe8cc('0xf')](_0x3595b7));_0x407137(_0x3595b7);})[_0xe8cc('0x15')](function(_0x3f3093){logger[_0xe8cc('0x10')](_0xe8cc('0x20'),_0x3f3093[_0xe8cc('0x12')],_0x45a0a2);_0x2bab8d(_0xdc9b1b[_0xe8cc('0x10')](0x1f4,_0x3f3093[_0xe8cc('0x12')]));});});}; \ No newline at end of file +var _0xb145=['stringify','error','DeskAccount,\x20%s,\x20%s','message','result','catch','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetDeskAccount','where','ShowDeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb145,0xa3));var _0x5b14=function(_0x2def4a,_0x166028){_0x2def4a=_0x2def4a-0x0;var _0x5654da=_0xb145[_0x2def4a];return _0x5654da;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('DeskAccount,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});}exports['GetDeskAccount']=function(_0x48d395){var _0x58bf3c=this;return new Promise(function(_0x3f397d,_0x3035b5){return db[_0x5b14('0x17')][_0x5b14('0x18')]({'raw':_0x48d395[_0x5b14('0x19')]?_0x48d395[_0x5b14('0x19')][_0x5b14('0x1a')]===undefined?!![]:![]:!![],'where':_0x48d395['options']?_0x48d395['options']['where']||null:null,'attributes':_0x48d395[_0x5b14('0x19')]?_0x48d395[_0x5b14('0x19')][_0x5b14('0x1b')]||null:null,'limit':_0x48d395[_0x5b14('0x19')]?_0x48d395['options'][_0x5b14('0x1c')]||null:null,'include':_0x48d395[_0x5b14('0x19')]?_0x48d395['options'][_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x48d395['options'][_0x5b14('0x1d')],function(_0x54073f){return{'model':db[_0x54073f['model']],'as':_0x54073f['as'],'attributes':_0x54073f['attributes'],'include':_0x54073f['include']?_[_0x5b14('0x1e')](_0x54073f[_0x5b14('0x1d')],function(_0x153a25){return{'model':db[_0x153a25['model']],'as':_0x153a25['as'],'attributes':_0x153a25[_0x5b14('0x1b')],'include':_0x153a25[_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x153a25[_0x5b14('0x1d')],function(_0xe6851b){return{'model':db[_0xe6851b[_0x5b14('0x1f')]],'as':_0xe6851b['as'],'attributes':_0xe6851b[_0x5b14('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b14('0x20')](function(_0x296d65){logger[_0x5b14('0xd')](_0x5b14('0x21'),_0x48d395);logger[_0x5b14('0xf')](_0x5b14('0x21'),_0x48d395,JSON[_0x5b14('0x11')](_0x296d65));_0x3f397d(_0x296d65);})['catch'](function(_0x370fcd){logger[_0x5b14('0x12')]('GetDeskAccount',_0x370fcd['message'],_0x48d395);_0x3035b5(_0x58bf3c[_0x5b14('0x12')](0x1f4,_0x370fcd[_0x5b14('0x14')]));});});};exports['ShowDeskAccount']=function(_0x4c1f0e){var _0x21b43b=this;return new Promise(function(_0x4d3905,_0x38c665){return db[_0x5b14('0x17')]['find']({'raw':_0x4c1f0e['options']?_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c1f0e[_0x5b14('0x19')]?_0x4c1f0e['options'][_0x5b14('0x22')]||null:null,'attributes':_0x4c1f0e['options']?_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1b')]||null:null,'include':_0x4c1f0e[_0x5b14('0x19')]?_0x4c1f0e[_0x5b14('0x19')]['include']?_[_0x5b14('0x1e')](_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1d')],function(_0x37f62c){return{'model':db[_0x37f62c['model']],'as':_0x37f62c['as'],'attributes':_0x37f62c[_0x5b14('0x1b')],'include':_0x37f62c[_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x37f62c['include'],function(_0x2fe74d){return{'model':db[_0x2fe74d['model']],'as':_0x2fe74d['as'],'attributes':_0x2fe74d[_0x5b14('0x1b')],'include':_0x2fe74d[_0x5b14('0x1d')]?_['map'](_0x2fe74d[_0x5b14('0x1d')],function(_0x2a83d4){return{'model':db[_0x2a83d4['model']],'as':_0x2a83d4['as'],'attributes':_0x2a83d4[_0x5b14('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ce6bb){logger[_0x5b14('0xd')](_0x5b14('0x23'),_0x4c1f0e);logger[_0x5b14('0xf')]('ShowDeskAccount',_0x4c1f0e,JSON[_0x5b14('0x11')](_0x1ce6bb));_0x4d3905(_0x1ce6bb);})[_0x5b14('0x16')](function(_0x15d4c4){logger[_0x5b14('0x12')](_0x5b14('0x23'),_0x15d4c4[_0x5b14('0x14')],_0x4c1f0e);_0x38c665(_0x21b43b[_0x5b14('0x12')](0x1f4,_0x15d4c4[_0x5b14('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d3343fc..43383ef 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 _0xad7a=['../../config/environment','./intDeskConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','delete','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x13ae66,_0x2f8ada){var _0x2688b8=function(_0x8152dc){while(--_0x8152dc){_0x13ae66['push'](_0x13ae66['shift']());}};_0x2688b8(++_0x2f8ada);}(_0xad7a,0xa3));var _0xaad7=function(_0x4eb960,_0x2e59c0){_0x4eb960=_0x4eb960-0x0;var _0x43b3d5=_0xad7a[_0x4eb960];return _0x43b3d5;};'use strict';var multer=require('multer');var util=require(_0xaad7('0x0'));var path=require(_0xaad7('0x1'));var timeout=require('connect-timeout');var express=require(_0xaad7('0x2'));var router=express['Router']();var auth=require(_0xaad7('0x3'));var interaction=require(_0xaad7('0x4'));var config=require(_0xaad7('0x5'));var controller=require(_0xaad7('0x6'));router['get']('/',auth[_0xaad7('0x7')](),controller[_0xaad7('0x8')]);router['get'](_0xaad7('0x9'),auth[_0xaad7('0x7')](),controller[_0xaad7('0xa')]);router[_0xaad7('0xb')](_0xaad7('0xc'),auth[_0xaad7('0x7')](),controller['getFields']);router[_0xaad7('0xb')](_0xaad7('0xd'),auth[_0xaad7('0x7')](),controller['getSubjects']);router[_0xaad7('0xb')](_0xaad7('0xe'),auth[_0xaad7('0x7')](),controller[_0xaad7('0xf')]);router[_0xaad7('0xb')](_0xaad7('0x10'),auth[_0xaad7('0x7')](),controller['getTags']);router[_0xaad7('0x11')]('/',auth[_0xaad7('0x7')](),controller[_0xaad7('0x12')]);router['post'](_0xaad7('0x10'),auth[_0xaad7('0x7')](),controller['setTags']);router[_0xaad7('0x13')](_0xaad7('0x9'),auth[_0xaad7('0x7')](),controller['update']);router[_0xaad7('0x14')](_0xaad7('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc739=['get','isAuthenticated','index','/:id','getFields','getSubjects','/:id/descriptions','post','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x149207,_0x5b17b2){var _0xd9d694=function(_0x5f2229){while(--_0x5f2229){_0x149207['push'](_0x149207['shift']());}};_0xd9d694(++_0x5b17b2);}(_0xc739,0xdf));var _0x9c73=function(_0x49bb0d,_0x3b498e){_0x49bb0d=_0x49bb0d-0x0;var _0x5e653e=_0xc739[_0x49bb0d];return _0x5e653e;};'use strict';var multer=require(_0x9c73('0x0'));var util=require(_0x9c73('0x1'));var path=require(_0x9c73('0x2'));var timeout=require(_0x9c73('0x3'));var express=require('express');var router=express[_0x9c73('0x4')]();var auth=require(_0x9c73('0x5'));var interaction=require(_0x9c73('0x6'));var config=require(_0x9c73('0x7'));var controller=require('./intDeskConfiguration.controller');router[_0x9c73('0x8')]('/',auth[_0x9c73('0x9')](),controller[_0x9c73('0xa')]);router[_0x9c73('0x8')](_0x9c73('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x9c73('0xc')]);router[_0x9c73('0x8')]('/:id/subjects',auth[_0x9c73('0x9')](),controller[_0x9c73('0xd')]);router['get'](_0x9c73('0xe'),auth[_0x9c73('0x9')](),controller['getDescriptions']);router[_0x9c73('0x8')]('/:id/tags',auth[_0x9c73('0x9')](),controller['getTags']);router[_0x9c73('0xf')]('/',auth[_0x9c73('0x9')](),controller['create']);router['post']('/:id/tags',auth[_0x9c73('0x9')](),controller[_0x9c73('0x10')]);router[_0x9c73('0x11')](_0x9c73('0xb'),auth['isAuthenticated'](),controller[_0x9c73('0x12')]);router[_0x9c73('0x13')](_0x9c73('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9c73('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 5fed34c..10dbd2b 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 _0xb5c3=['sequelize','STRING'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0xb5c3,0x16a));var _0x3b5c=function(_0x20433c,_0x10f2b7){_0x20433c=_0x20433c-0x0;var _0x488c4f=_0xb5c3[_0x20433c];return _0x488c4f;};'use strict';var Sequelize=require(_0x3b5c('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b5c('0x1')]},'description':{'type':Sequelize[_0x3b5c('0x1')]}}; \ No newline at end of file +var _0xe413=['sequelize','STRING'];(function(_0x2eef95,_0x4c8333){var _0x3f84b0=function(_0x254eb8){while(--_0x254eb8){_0x2eef95['push'](_0x2eef95['shift']());}};_0x3f84b0(++_0x4c8333);}(_0xe413,0x96));var _0x3e41=function(_0x17a51f,_0x20b161){_0x17a51f=_0x17a51f-0x0;var _0x1b9bc8=_0xe413[_0x17a51f];return _0x1b9bc8;};'use strict';var Sequelize=require(_0x3e41('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3e41('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index babe0b2..7d4ff86 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 _0x2f68=['catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','end','stack','name','send','index','DeskConfiguration','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','intersection','create','body','find','params','findOne','getFields','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','squel','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x33f411,_0x1533d6){var _0x5e319e=function(_0x37f6ac){while(--_0x37f6ac){_0x33f411['push'](_0x33f411['shift']());}};_0x5e319e(++_0x1533d6);}(_0x2f68,0x9a));var _0x82f6=function(_0x2f178d,_0x1658e7){_0x2f178d=_0x2f178d-0x0;var _0x2291b0=_0x2f68[_0x2f178d];return _0x2291b0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x82f6('0x0'));var rimraf=require(_0x82f6('0x1'));var zipdir=require(_0x82f6('0x2'));var jsonpatch=require(_0x82f6('0x3'));var rp=require('request-promise');var moment=require(_0x82f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x82f6('0x5'));var util=require(_0x82f6('0x6'));var path=require('path');var sox=require(_0x82f6('0x7'));var csv=require(_0x82f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x8'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var authService=require(_0x82f6('0xc'));var hardwareService=require(_0x82f6('0xd'));var Redis=require('ioredis');var qs=require(_0x82f6('0xe'));var logger=require(_0x82f6('0xf'))(_0x82f6('0x10'));var utils=require(_0x82f6('0x11'));var config=require(_0x82f6('0x12'));var db=require(_0x82f6('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x82f6('0x14')][_0x82f6('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x4cc967,_0x194da7,_0x1f8bf5,_0x397527){return new BPromise(function(_0x465e5d,_0x371481){var _0xa00275=_0x397527||client;return _0xa00275[_0x82f6('0x16')](_0x4cc967,_0x1f8bf5)[_0x82f6('0x17')](function(_0x1e7cbc){logger['info'](_0x82f6('0x18'),_0x194da7,'request\x20sent');logger[_0x82f6('0x19')](_0x82f6('0x1a'),_0x194da7,_0x82f6('0x1b'),JSON[_0x82f6('0x1c')](_0x1e7cbc));if(_0x1e7cbc[_0x82f6('0x1d')]){if(_0x1e7cbc[_0x82f6('0x1d')][_0x82f6('0x1e')]===0x1f4){logger[_0x82f6('0x1d')](_0x82f6('0x18'),_0x194da7,_0x1e7cbc[_0x82f6('0x1d')][_0x82f6('0x1f')]);return _0x371481(_0x1e7cbc[_0x82f6('0x1d')][_0x82f6('0x1f')]);}logger[_0x82f6('0x1d')](_0x82f6('0x18'),_0x194da7,_0x1e7cbc['error'][_0x82f6('0x1f')]);return _0x465e5d(_0x1e7cbc[_0x82f6('0x1d')]['message']);}else{logger[_0x82f6('0x20')](_0x82f6('0x18'),_0x194da7,_0x82f6('0x1b'));_0x465e5d(_0x1e7cbc[_0x82f6('0x21')]['message']);}})[_0x82f6('0x22')](function(_0x4beccf){logger[_0x82f6('0x1d')](_0x82f6('0x18'),_0x194da7,_0x4beccf);_0x371481(_0x4beccf);});});}function respondWithStatusCode(_0x573a46,_0x516deb){_0x516deb=_0x516deb||0xcc;return function(_0x3af5f7){if(_0x3af5f7){return _0x573a46[_0x82f6('0x23')](_0x516deb);}return _0x573a46['status'](_0x516deb)['end']();};}function respondWithResult(_0x9f2272,_0x31face){_0x31face=_0x31face||0xc8;return function(_0x4fbd92){if(_0x4fbd92){return _0x9f2272[_0x82f6('0x24')](_0x31face)[_0x82f6('0x25')](_0x4fbd92);}};}function respondWithFilteredResult(_0x5037f8,_0x57ac0d){return function(_0x1c165b){if(_0x1c165b){var _0x5187d0=_0x1c165b[_0x82f6('0x26')],_0x469b6b=_0x57ac0d[_0x82f6('0x27')],_0x5a6d69=_0x57ac0d[_0x82f6('0x27')]+_0x57ac0d[_0x82f6('0x28')],_0x54ce11;if(_0x5a6d69>=_0x5187d0){_0x5a6d69=_0x5187d0;_0x54ce11=0xc8;}else{_0x54ce11=0xce;}_0x5037f8['status'](_0x54ce11);return _0x5037f8[_0x82f6('0x29')](_0x82f6('0x2a'),_0x469b6b+'-'+_0x5a6d69+'/'+_0x5187d0)[_0x82f6('0x25')](_0x1c165b);}return null;};}function patchUpdates(_0x400137){return function(_0x271c28){try{jsonpatch[_0x82f6('0x2b')](_0x271c28,_0x400137,!![]);}catch(_0x27e473){return BPromise[_0x82f6('0x2c')](_0x27e473);}return _0x271c28[_0x82f6('0x2d')]();};}function saveUpdates(_0x402449,_0x3c9419){return function(_0x20d1c5){if(_0x20d1c5){return _0x20d1c5[_0x82f6('0x2e')](_0x402449)[_0x82f6('0x17')](function(_0x51e080){return _0x51e080;});}return null;};}function removeEntity(_0x3bbf5c,_0x2c764f){return function(_0x418f34){if(_0x418f34){return _0x418f34['destroy']()[_0x82f6('0x17')](function(){_0x3bbf5c[_0x82f6('0x24')](0xcc)[_0x82f6('0x2f')]();});}};}function handleEntityNotFound(_0x3da5a9,_0x41cd65){return function(_0x457f09){if(!_0x457f09){_0x3da5a9[_0x82f6('0x23')](0x194);}return _0x457f09;};}function handleError(_0x299c36,_0x4756ee){_0x4756ee=_0x4756ee||0x1f4;return function(_0x2958fe){logger[_0x82f6('0x1d')](_0x2958fe[_0x82f6('0x30')]);if(_0x2958fe[_0x82f6('0x31')]){delete _0x2958fe[_0x82f6('0x31')];}_0x299c36['status'](_0x4756ee)[_0x82f6('0x32')](_0x2958fe);};}exports[_0x82f6('0x33')]=function(_0x1c6ce4,_0x276451){var _0xa9bd0={},_0x4390a9={},_0x34c2f1={'count':0x0,'rows':[]};var _0x383987=db[_0x82f6('0x34')][_0x82f6('0x35')];_0x4390a9[_0x82f6('0x36')]=_[_0x82f6('0x37')](_0x383987);_0x4390a9[_0x82f6('0x38')]=_[_0x82f6('0x37')](_0x1c6ce4['query']);_0x4390a9[_0x82f6('0x39')]=_['intersection'](_0x4390a9['model'],_0x4390a9[_0x82f6('0x38')]);_0xa9bd0[_0x82f6('0x3a')]=_['intersection'](_0x4390a9[_0x82f6('0x36')],qs[_0x82f6('0x3b')](_0x1c6ce4[_0x82f6('0x38')]['fields']));_0xa9bd0[_0x82f6('0x3a')]=_0xa9bd0['attributes'][_0x82f6('0x3c')]?_0xa9bd0['attributes']:_0x4390a9[_0x82f6('0x36')];if(!_0x1c6ce4['query'][_0x82f6('0x3d')](_0x82f6('0x3e'))){_0xa9bd0['limit']=qs[_0x82f6('0x28')](_0x1c6ce4[_0x82f6('0x38')][_0x82f6('0x28')]);_0xa9bd0[_0x82f6('0x27')]=qs['offset'](_0x1c6ce4[_0x82f6('0x38')][_0x82f6('0x27')]);}_0xa9bd0[_0x82f6('0x3f')]=qs[_0x82f6('0x40')](_0x1c6ce4['query'][_0x82f6('0x40')]);_0xa9bd0[_0x82f6('0x41')]=qs['filters'](_[_0x82f6('0x42')](_0x1c6ce4[_0x82f6('0x38')],_0x4390a9[_0x82f6('0x39')]));if(_0x1c6ce4[_0x82f6('0x38')][_0x82f6('0x43')]){_0xa9bd0['where']=_[_0x82f6('0x44')](_0xa9bd0['where'],{'$or':_[_0x82f6('0x45')](_0x383987,function(_0x38e82d){if(_0x38e82d[_0x82f6('0x46')][_0x82f6('0x47')]!==_0x82f6('0x48')){var _0x293002={};_0x293002[_0x38e82d[_0x82f6('0x49')]]={'$like':'%'+_0x1c6ce4['query'][_0x82f6('0x43')]+'%'};return _0x293002;}})});}_0xa9bd0=_[_0x82f6('0x44')]({},_0xa9bd0,_0x1c6ce4[_0x82f6('0x4a')]);var _0x1dc2a8={'where':_0xa9bd0['where']};return db[_0x82f6('0x34')]['count'](_0x1dc2a8)[_0x82f6('0x17')](function(_0x186f5d){_0x34c2f1[_0x82f6('0x26')]=_0x186f5d;if(_0x1c6ce4[_0x82f6('0x38')][_0x82f6('0x4b')]){_0xa9bd0[_0x82f6('0x4c')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x82f6('0x4d')](_0xa9bd0);})[_0x82f6('0x17')](function(_0x14a3c4){_0x34c2f1[_0x82f6('0x4e')]=_0x14a3c4;return _0x34c2f1;})[_0x82f6('0x17')](respondWithFilteredResult(_0x276451,_0xa9bd0))[_0x82f6('0x22')](handleError(_0x276451,null));};exports[_0x82f6('0x4f')]=function(_0x33e630,_0x529780){var _0x43b92e={'raw':![],'where':{'id':_0x33e630['params']['id']}},_0x26131b={};_0x26131b[_0x82f6('0x36')]=_['keys'](db[_0x82f6('0x34')]['rawAttributes']);_0x26131b[_0x82f6('0x38')]=_[_0x82f6('0x37')](_0x33e630[_0x82f6('0x38')]);_0x26131b[_0x82f6('0x39')]=_[_0x82f6('0x50')](_0x26131b[_0x82f6('0x36')],_0x26131b['query']);_0x43b92e[_0x82f6('0x3a')]=_[_0x82f6('0x50')](_0x26131b['model'],qs['fields'](_0x33e630[_0x82f6('0x38')][_0x82f6('0x3b')]));_0x43b92e[_0x82f6('0x3a')]=_0x43b92e['attributes'][_0x82f6('0x3c')]?_0x43b92e[_0x82f6('0x3a')]:_0x26131b[_0x82f6('0x36')];if(_0x33e630[_0x82f6('0x38')]['includeAll']){_0x43b92e['include']=[{'all':!![]}];}_0x43b92e=_[_0x82f6('0x44')]({},_0x43b92e,_0x33e630[_0x82f6('0x4a')]);return db[_0x82f6('0x34')]['find'](_0x43b92e)[_0x82f6('0x17')](handleEntityNotFound(_0x529780,null))[_0x82f6('0x17')](respondWithResult(_0x529780,null))['catch'](handleError(_0x529780,null));};exports['create']=function(_0x4fa2ca,_0x2e6b03){return db['DeskConfiguration'][_0x82f6('0x51')](_0x4fa2ca['body'],{})[_0x82f6('0x17')](respondWithResult(_0x2e6b03,0xc9))['catch'](handleError(_0x2e6b03,null));};exports[_0x82f6('0x2e')]=function(_0x58f89b,_0x4d28a9){if(_0x58f89b[_0x82f6('0x52')]['id']){delete _0x58f89b[_0x82f6('0x52')]['id'];}return db[_0x82f6('0x34')][_0x82f6('0x53')]({'where':{'id':_0x58f89b[_0x82f6('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d28a9,null))[_0x82f6('0x17')](saveUpdates(_0x58f89b[_0x82f6('0x52')],null))[_0x82f6('0x17')](respondWithResult(_0x4d28a9,null))['catch'](handleError(_0x4d28a9,null));};exports['destroy']=function(_0x13406f,_0x81e595){return db[_0x82f6('0x34')][_0x82f6('0x53')]({'where':{'id':_0x13406f['params']['id']}})[_0x82f6('0x17')](handleEntityNotFound(_0x81e595,null))[_0x82f6('0x17')](removeEntity(_0x81e595,null))[_0x82f6('0x22')](handleError(_0x81e595,null));};exports['getFields']=function(_0x5435bc,_0x5f0801,_0x44218c){var _0x310c9b={};var _0x221cfc={};var _0x59176d;var _0x4013f0;return db[_0x82f6('0x34')][_0x82f6('0x55')]({'where':{'id':_0x5435bc[_0x82f6('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f0801,null))[_0x82f6('0x17')](function(_0x94aed4){if(_0x94aed4){_0x59176d=_0x94aed4;_0x221cfc[_0x82f6('0x36')]=_[_0x82f6('0x37')](db['DeskField']['rawAttributes']);_0x221cfc[_0x82f6('0x38')]=_[_0x82f6('0x37')](_0x5435bc['query']);_0x221cfc[_0x82f6('0x39')]=_[_0x82f6('0x50')](_0x221cfc[_0x82f6('0x36')],_0x221cfc['query']);_0x310c9b[_0x82f6('0x3a')]=_[_0x82f6('0x50')](_0x221cfc[_0x82f6('0x36')],qs[_0x82f6('0x3b')](_0x5435bc[_0x82f6('0x38')][_0x82f6('0x3b')]));_0x310c9b['attributes']=_0x310c9b[_0x82f6('0x3a')][_0x82f6('0x3c')]?_0x310c9b[_0x82f6('0x3a')]:_0x221cfc[_0x82f6('0x36')];_0x310c9b[_0x82f6('0x3f')]=qs['sort'](_0x5435bc[_0x82f6('0x38')][_0x82f6('0x40')]);_0x310c9b[_0x82f6('0x41')]=qs[_0x82f6('0x39')](_[_0x82f6('0x42')](_0x5435bc[_0x82f6('0x38')],_0x221cfc[_0x82f6('0x39')]));if(_0x5435bc[_0x82f6('0x38')]['filter']){_0x310c9b[_0x82f6('0x41')]=_['merge'](_0x310c9b[_0x82f6('0x41')],{'$or':_[_0x82f6('0x45')](_0x310c9b['attributes'],function(_0x843458){var _0x32e43d={};_0x32e43d[_0x843458]={'$like':'%'+_0x5435bc[_0x82f6('0x38')]['filter']+'%'};return _0x32e43d;})});}_0x310c9b=_['merge']({},_0x310c9b,_0x5435bc[_0x82f6('0x4a')]);return _0x59176d[_0x82f6('0x56')](_0x310c9b);}})['then'](function(_0x4fdbdf){if(_0x4fdbdf){_0x4013f0=_0x4fdbdf[_0x82f6('0x3c')];if(!_0x5435bc[_0x82f6('0x38')][_0x82f6('0x3d')](_0x82f6('0x3e'))){_0x310c9b[_0x82f6('0x28')]=qs[_0x82f6('0x28')](_0x5435bc[_0x82f6('0x38')][_0x82f6('0x28')]);_0x310c9b[_0x82f6('0x27')]=qs[_0x82f6('0x27')](_0x5435bc[_0x82f6('0x38')][_0x82f6('0x27')]);}return _0x59176d['getFields'](_0x310c9b);}})[_0x82f6('0x17')](function(_0x16776e){if(_0x16776e){return _0x16776e?{'count':_0x4013f0,'rows':_0x16776e}:null;}})[_0x82f6('0x17')](respondWithResult(_0x5f0801,null))[_0x82f6('0x22')](handleError(_0x5f0801,null));};exports[_0x82f6('0x57')]=function(_0x4ef838,_0x1135a6,_0x46d5af){var _0x337050={};var _0x566192={};var _0x9b60c8;var _0x192dc7;return db[_0x82f6('0x34')][_0x82f6('0x55')]({'where':{'id':_0x4ef838[_0x82f6('0x54')]['id']}})[_0x82f6('0x17')](handleEntityNotFound(_0x1135a6,null))[_0x82f6('0x17')](function(_0x579a2c){if(_0x579a2c){_0x9b60c8=_0x579a2c;_0x566192[_0x82f6('0x36')]=_['keys'](db[_0x82f6('0x58')][_0x82f6('0x35')]);_0x566192[_0x82f6('0x38')]=_[_0x82f6('0x37')](_0x4ef838[_0x82f6('0x38')]);_0x566192[_0x82f6('0x39')]=_[_0x82f6('0x50')](_0x566192[_0x82f6('0x36')],_0x566192[_0x82f6('0x38')]);_0x337050['attributes']=_[_0x82f6('0x50')](_0x566192[_0x82f6('0x36')],qs[_0x82f6('0x3b')](_0x4ef838[_0x82f6('0x38')][_0x82f6('0x3b')]));_0x337050[_0x82f6('0x3a')]=_0x337050['attributes'][_0x82f6('0x3c')]?_0x337050[_0x82f6('0x3a')]:_0x566192['model'];_0x337050['order']=qs[_0x82f6('0x40')](_0x4ef838[_0x82f6('0x38')][_0x82f6('0x40')]);_0x337050[_0x82f6('0x41')]=qs[_0x82f6('0x39')](_[_0x82f6('0x42')](_0x4ef838['query'],_0x566192[_0x82f6('0x39')]));if(_0x4ef838['query'][_0x82f6('0x43')]){_0x337050['where']=_[_0x82f6('0x44')](_0x337050['where'],{'$or':_[_0x82f6('0x45')](_0x337050[_0x82f6('0x3a')],function(_0x203168){var _0x584f76={};_0x584f76[_0x203168]={'$like':'%'+_0x4ef838[_0x82f6('0x38')]['filter']+'%'};return _0x584f76;})});}_0x337050=_[_0x82f6('0x44')]({},_0x337050,_0x4ef838[_0x82f6('0x4a')]);return _0x9b60c8[_0x82f6('0x57')](_0x337050);}})['then'](function(_0x2646b2){if(_0x2646b2){_0x192dc7=_0x2646b2[_0x82f6('0x3c')];if(!_0x4ef838[_0x82f6('0x38')]['hasOwnProperty']('nolimit')){_0x337050[_0x82f6('0x28')]=qs[_0x82f6('0x28')](_0x4ef838[_0x82f6('0x38')][_0x82f6('0x28')]);_0x337050[_0x82f6('0x27')]=qs[_0x82f6('0x27')](_0x4ef838[_0x82f6('0x38')][_0x82f6('0x27')]);}return _0x9b60c8['getSubjects'](_0x337050);}})[_0x82f6('0x17')](function(_0x34de40){if(_0x34de40){return _0x34de40?{'count':_0x192dc7,'rows':_0x34de40}:null;}})['then'](respondWithResult(_0x1135a6,null))[_0x82f6('0x22')](handleError(_0x1135a6,null));};exports[_0x82f6('0x59')]=function(_0x1c1901,_0x47a7f1,_0x30632b){var _0x1d3f1b={};var _0x4ede38={};var _0x2cc906;var _0x50ab5c;return db[_0x82f6('0x34')][_0x82f6('0x55')]({'where':{'id':_0x1c1901[_0x82f6('0x54')]['id']}})[_0x82f6('0x17')](handleEntityNotFound(_0x47a7f1,null))[_0x82f6('0x17')](function(_0x4fbce1){if(_0x4fbce1){_0x2cc906=_0x4fbce1;_0x4ede38['model']=_[_0x82f6('0x37')](db[_0x82f6('0x58')][_0x82f6('0x35')]);_0x4ede38[_0x82f6('0x38')]=_[_0x82f6('0x37')](_0x1c1901['query']);_0x4ede38[_0x82f6('0x39')]=_['intersection'](_0x4ede38[_0x82f6('0x36')],_0x4ede38[_0x82f6('0x38')]);_0x1d3f1b[_0x82f6('0x3a')]=_[_0x82f6('0x50')](_0x4ede38[_0x82f6('0x36')],qs[_0x82f6('0x3b')](_0x1c1901[_0x82f6('0x38')]['fields']));_0x1d3f1b[_0x82f6('0x3a')]=_0x1d3f1b[_0x82f6('0x3a')]['length']?_0x1d3f1b[_0x82f6('0x3a')]:_0x4ede38[_0x82f6('0x36')];_0x1d3f1b[_0x82f6('0x3f')]=qs['sort'](_0x1c1901[_0x82f6('0x38')]['sort']);_0x1d3f1b[_0x82f6('0x41')]=qs[_0x82f6('0x39')](_['pick'](_0x1c1901[_0x82f6('0x38')],_0x4ede38[_0x82f6('0x39')]));if(_0x1c1901[_0x82f6('0x38')][_0x82f6('0x43')]){_0x1d3f1b['where']=_[_0x82f6('0x44')](_0x1d3f1b['where'],{'$or':_['map'](_0x1d3f1b[_0x82f6('0x3a')],function(_0x37a80f){var _0x426c85={};_0x426c85[_0x37a80f]={'$like':'%'+_0x1c1901[_0x82f6('0x38')][_0x82f6('0x43')]+'%'};return _0x426c85;})});}_0x1d3f1b=_['merge']({},_0x1d3f1b,_0x1c1901['options']);return _0x2cc906[_0x82f6('0x59')](_0x1d3f1b);}})['then'](function(_0x376b1b){if(_0x376b1b){_0x50ab5c=_0x376b1b[_0x82f6('0x3c')];if(!_0x1c1901[_0x82f6('0x38')]['hasOwnProperty'](_0x82f6('0x3e'))){_0x1d3f1b[_0x82f6('0x28')]=qs[_0x82f6('0x28')](_0x1c1901[_0x82f6('0x38')]['limit']);_0x1d3f1b[_0x82f6('0x27')]=qs[_0x82f6('0x27')](_0x1c1901[_0x82f6('0x38')][_0x82f6('0x27')]);}return _0x2cc906['getDescriptions'](_0x1d3f1b);}})['then'](function(_0x469665){if(_0x469665){return _0x469665?{'count':_0x50ab5c,'rows':_0x469665}:null;}})[_0x82f6('0x17')](respondWithResult(_0x47a7f1,null))[_0x82f6('0x22')](handleError(_0x47a7f1,null));};exports[_0x82f6('0x5a')]=function(_0x5df106,_0x147841,_0x2d2522){var _0x1bfc05={};var _0x1a4b8d={};var _0x31ff74;var _0x55fec2;return db['DeskConfiguration'][_0x82f6('0x55')]({'where':{'id':_0x5df106[_0x82f6('0x54')]['id']}})[_0x82f6('0x17')](handleEntityNotFound(_0x147841,null))[_0x82f6('0x17')](function(_0x90c55c){if(_0x90c55c){_0x31ff74=_0x90c55c;_0x1a4b8d['model']=_[_0x82f6('0x37')](db[_0x82f6('0x5b')][_0x82f6('0x35')]);_0x1a4b8d[_0x82f6('0x38')]=_[_0x82f6('0x37')](_0x5df106['query']);_0x1a4b8d['filters']=_[_0x82f6('0x50')](_0x1a4b8d['model'],_0x1a4b8d[_0x82f6('0x38')]);_0x1bfc05[_0x82f6('0x3a')]=_[_0x82f6('0x50')](_0x1a4b8d[_0x82f6('0x36')],qs[_0x82f6('0x3b')](_0x5df106['query'][_0x82f6('0x3b')]));_0x1bfc05[_0x82f6('0x3a')]=_0x1bfc05[_0x82f6('0x3a')]['length']?_0x1bfc05[_0x82f6('0x3a')]:_0x1a4b8d[_0x82f6('0x36')];_0x1bfc05['order']=qs[_0x82f6('0x40')](_0x5df106[_0x82f6('0x38')][_0x82f6('0x40')]);_0x1bfc05[_0x82f6('0x41')]=qs['filters'](_[_0x82f6('0x42')](_0x5df106[_0x82f6('0x38')],_0x1a4b8d['filters']));if(_0x5df106[_0x82f6('0x38')][_0x82f6('0x43')]){_0x1bfc05[_0x82f6('0x41')]=_[_0x82f6('0x44')](_0x1bfc05[_0x82f6('0x41')],{'$or':_[_0x82f6('0x45')](_0x1bfc05[_0x82f6('0x3a')],function(_0x4659af){var _0x5c2650={};_0x5c2650[_0x4659af]={'$like':'%'+_0x5df106[_0x82f6('0x38')]['filter']+'%'};return _0x5c2650;})});}_0x1bfc05=_[_0x82f6('0x44')]({},_0x1bfc05,_0x5df106['options']);return _0x31ff74['getTags'](_0x1bfc05);}})[_0x82f6('0x17')](function(_0x5da5c7){if(_0x5da5c7){_0x55fec2=_0x5da5c7[_0x82f6('0x3c')];if(!_0x5df106[_0x82f6('0x38')][_0x82f6('0x3d')](_0x82f6('0x3e'))){_0x1bfc05['limit']=qs[_0x82f6('0x28')](_0x5df106[_0x82f6('0x38')][_0x82f6('0x28')]);_0x1bfc05[_0x82f6('0x27')]=qs[_0x82f6('0x27')](_0x5df106[_0x82f6('0x38')]['offset']);}return _0x31ff74['getTags'](_0x1bfc05);}})[_0x82f6('0x17')](function(_0x2cde2f){if(_0x2cde2f){return _0x2cde2f?{'count':_0x55fec2,'rows':_0x2cde2f}:null;}})[_0x82f6('0x17')](respondWithResult(_0x147841,null))['catch'](handleError(_0x147841,null));};exports[_0x82f6('0x5c')]=function(_0x2169b4,_0x745ca3,_0xd71074){if(_0x2169b4[_0x82f6('0x52')]['id']){delete _0x2169b4[_0x82f6('0x52')]['id'];}return db[_0x82f6('0x34')]['findOne']({'where':{'id':_0x2169b4[_0x82f6('0x54')]['id']}})[_0x82f6('0x17')](handleEntityNotFound(_0x745ca3,null))[_0x82f6('0x17')](function(_0x38b54b){if(_0x38b54b){return _0x38b54b[_0x82f6('0x5c')](_0x2169b4['body'][_0x82f6('0x5d')]||[]);}return null;})[_0x82f6('0x17')](respondWithResult(_0x745ca3,null))[_0x82f6('0x22')](handleError(_0x745ca3,null));}; \ No newline at end of file +var _0x97c1=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','create','body','update','find','getFields','DeskField','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','destroy','stack','name','index','DeskConfiguration','rawAttributes','model'];(function(_0x268180,_0x1144e1){var _0x5bd0cc=function(_0x5ad0d1){while(--_0x5ad0d1){_0x268180['push'](_0x268180['shift']());}};_0x5bd0cc(++_0x1144e1);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0x197c('0x0'));var emlformat=require(_0x197c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x197c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x197c('0x3'));var BPromise=require(_0x197c('0x4'));var Mustache=require(_0x197c('0x5'));var util=require(_0x197c('0x6'));var path=require(_0x197c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x197c('0x8'));var fs=require('fs');var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var authService=require(_0x197c('0xe'));var hardwareService=require(_0x197c('0xf'));var Redis=require(_0x197c('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x197c('0x11'))(_0x197c('0x12'));var utils=require(_0x197c('0x13'));var config=require(_0x197c('0x14'));var db=require(_0x197c('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x197c('0x16')][_0x197c('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x27e46f,_0x1adcfa,_0x567658,_0x10c4db){return new BPromise(function(_0x1cccd6,_0x5a7e1c){var _0xf735ce=_0x10c4db||client;return _0xf735ce[_0x197c('0x18')](_0x27e46f,_0x567658)[_0x197c('0x19')](function(_0x587958){logger['info'](_0x197c('0x1a'),_0x1adcfa,_0x197c('0x1b'));logger[_0x197c('0x1c')](_0x197c('0x1d'),_0x1adcfa,_0x197c('0x1b'),JSON[_0x197c('0x1e')](_0x587958));if(_0x587958[_0x197c('0x1f')]){if(_0x587958[_0x197c('0x1f')]['code']===0x1f4){logger[_0x197c('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x1adcfa,_0x587958['error'][_0x197c('0x20')]);return _0x5a7e1c(_0x587958[_0x197c('0x1f')][_0x197c('0x20')]);}logger[_0x197c('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x1adcfa,_0x587958[_0x197c('0x1f')][_0x197c('0x20')]);return _0x1cccd6(_0x587958[_0x197c('0x1f')]['message']);}else{logger[_0x197c('0x21')](_0x197c('0x1a'),_0x1adcfa,_0x197c('0x1b'));_0x1cccd6(_0x587958[_0x197c('0x22')][_0x197c('0x20')]);}})[_0x197c('0x23')](function(_0x362bbf){logger[_0x197c('0x1f')](_0x197c('0x1a'),_0x1adcfa,_0x362bbf);_0x5a7e1c(_0x362bbf);});});}function respondWithStatusCode(_0x3dfb7b,_0x29b266){_0x29b266=_0x29b266||0xcc;return function(_0x177bc9){if(_0x177bc9){return _0x3dfb7b[_0x197c('0x24')](_0x29b266);}return _0x3dfb7b[_0x197c('0x25')](_0x29b266)[_0x197c('0x26')]();};}function respondWithResult(_0x25486a,_0x5f4a02){_0x5f4a02=_0x5f4a02||0xc8;return function(_0x112e27){if(_0x112e27){return _0x25486a[_0x197c('0x25')](_0x5f4a02)[_0x197c('0x27')](_0x112e27);}};}function respondWithFilteredResult(_0x499051,_0x2c2952){return function(_0x3331ac){if(_0x3331ac){var _0x4c3337=_0x3331ac[_0x197c('0x28')],_0x5e7bc9=_0x2c2952[_0x197c('0x29')],_0x12b37b=_0x2c2952[_0x197c('0x29')]+_0x2c2952[_0x197c('0x2a')],_0x48f759;if(_0x12b37b>=_0x4c3337){_0x12b37b=_0x4c3337;_0x48f759=0xc8;}else{_0x48f759=0xce;}_0x499051[_0x197c('0x25')](_0x48f759);return _0x499051[_0x197c('0x2b')](_0x197c('0x2c'),_0x5e7bc9+'-'+_0x12b37b+'/'+_0x4c3337)[_0x197c('0x27')](_0x3331ac);}return null;};}function patchUpdates(_0x4422d1){return function(_0x5df39e){try{jsonpatch['apply'](_0x5df39e,_0x4422d1,!![]);}catch(_0x574274){return BPromise['reject'](_0x574274);}return _0x5df39e[_0x197c('0x2d')]();};}function saveUpdates(_0x4c9256,_0x252cde){return function(_0x35dbf3){if(_0x35dbf3){return _0x35dbf3['update'](_0x4c9256)[_0x197c('0x19')](function(_0x4c7824){return _0x4c7824;});}return null;};}function removeEntity(_0x419202,_0x1155e1){return function(_0x2ace33){if(_0x2ace33){return _0x2ace33[_0x197c('0x2e')]()[_0x197c('0x19')](function(){_0x419202[_0x197c('0x25')](0xcc)[_0x197c('0x26')]();});}};}function handleEntityNotFound(_0x41d792,_0x1e974e){return function(_0x5692d9){if(!_0x5692d9){_0x41d792['sendStatus'](0x194);}return _0x5692d9;};}function handleError(_0x2a58f6,_0x3af036){_0x3af036=_0x3af036||0x1f4;return function(_0x3c56e3){logger[_0x197c('0x1f')](_0x3c56e3[_0x197c('0x2f')]);if(_0x3c56e3[_0x197c('0x30')]){delete _0x3c56e3[_0x197c('0x30')];}_0x2a58f6['status'](_0x3af036)['send'](_0x3c56e3);};}exports[_0x197c('0x31')]=function(_0x70a54,_0x4d085b){var _0x5bebe7={},_0x3cdaa1={},_0x2a884b={'count':0x0,'rows':[]};var _0x218339=db[_0x197c('0x32')][_0x197c('0x33')];_0x3cdaa1[_0x197c('0x34')]=_[_0x197c('0x35')](_0x218339);_0x3cdaa1[_0x197c('0x36')]=_[_0x197c('0x35')](_0x70a54['query']);_0x3cdaa1[_0x197c('0x37')]=_[_0x197c('0x38')](_0x3cdaa1[_0x197c('0x34')],_0x3cdaa1[_0x197c('0x36')]);_0x5bebe7[_0x197c('0x39')]=_[_0x197c('0x38')](_0x3cdaa1['model'],qs[_0x197c('0x3a')](_0x70a54[_0x197c('0x36')][_0x197c('0x3a')]));_0x5bebe7['attributes']=_0x5bebe7[_0x197c('0x39')][_0x197c('0x3b')]?_0x5bebe7[_0x197c('0x39')]:_0x3cdaa1[_0x197c('0x34')];if(!_0x70a54[_0x197c('0x36')][_0x197c('0x3c')](_0x197c('0x3d'))){_0x5bebe7[_0x197c('0x2a')]=qs[_0x197c('0x2a')](_0x70a54[_0x197c('0x36')]['limit']);_0x5bebe7[_0x197c('0x29')]=qs[_0x197c('0x29')](_0x70a54['query']['offset']);}_0x5bebe7[_0x197c('0x3e')]=qs[_0x197c('0x3f')](_0x70a54[_0x197c('0x36')][_0x197c('0x3f')]);_0x5bebe7[_0x197c('0x40')]=qs['filters'](_[_0x197c('0x41')](_0x70a54[_0x197c('0x36')],_0x3cdaa1[_0x197c('0x37')]));if(_0x70a54[_0x197c('0x36')][_0x197c('0x42')]){_0x5bebe7['where']=_[_0x197c('0x43')](_0x5bebe7[_0x197c('0x40')],{'$or':_[_0x197c('0x44')](_0x218339,function(_0x197b27){if(_0x197b27[_0x197c('0x45')]['key']!==_0x197c('0x46')){var _0x3f417d={};_0x3f417d[_0x197b27[_0x197c('0x47')]]={'$like':'%'+_0x70a54[_0x197c('0x36')][_0x197c('0x42')]+'%'};return _0x3f417d;}})});}_0x5bebe7=_[_0x197c('0x43')]({},_0x5bebe7,_0x70a54[_0x197c('0x48')]);var _0x146691={'where':_0x5bebe7[_0x197c('0x40')]};return db[_0x197c('0x32')][_0x197c('0x28')](_0x146691)['then'](function(_0x561895){_0x2a884b['count']=_0x561895;if(_0x70a54['query'][_0x197c('0x49')]){_0x5bebe7[_0x197c('0x4a')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x197c('0x4b')](_0x5bebe7);})[_0x197c('0x19')](function(_0x538449){_0x2a884b[_0x197c('0x4c')]=_0x538449;return _0x2a884b;})[_0x197c('0x19')](respondWithFilteredResult(_0x4d085b,_0x5bebe7))['catch'](handleError(_0x4d085b,null));};exports[_0x197c('0x4d')]=function(_0x233ae1,_0x47e652){var _0x3b24e2={'raw':![],'where':{'id':_0x233ae1[_0x197c('0x4e')]['id']}},_0x39eefd={};_0x39eefd['model']=_[_0x197c('0x35')](db[_0x197c('0x32')][_0x197c('0x33')]);_0x39eefd[_0x197c('0x36')]=_['keys'](_0x233ae1[_0x197c('0x36')]);_0x39eefd[_0x197c('0x37')]=_[_0x197c('0x38')](_0x39eefd['model'],_0x39eefd['query']);_0x3b24e2[_0x197c('0x39')]=_[_0x197c('0x38')](_0x39eefd[_0x197c('0x34')],qs[_0x197c('0x3a')](_0x233ae1[_0x197c('0x36')][_0x197c('0x3a')]));_0x3b24e2['attributes']=_0x3b24e2[_0x197c('0x39')]['length']?_0x3b24e2[_0x197c('0x39')]:_0x39eefd[_0x197c('0x34')];if(_0x233ae1[_0x197c('0x36')][_0x197c('0x49')]){_0x3b24e2[_0x197c('0x4a')]=[{'all':!![]}];}_0x3b24e2=_[_0x197c('0x43')]({},_0x3b24e2,_0x233ae1[_0x197c('0x48')]);return db[_0x197c('0x32')]['find'](_0x3b24e2)[_0x197c('0x19')](handleEntityNotFound(_0x47e652,null))[_0x197c('0x19')](respondWithResult(_0x47e652,null))[_0x197c('0x23')](handleError(_0x47e652,null));};exports['create']=function(_0x114ef5,_0x495c1d){return db[_0x197c('0x32')][_0x197c('0x4f')](_0x114ef5[_0x197c('0x50')],{})[_0x197c('0x19')](respondWithResult(_0x495c1d,0xc9))[_0x197c('0x23')](handleError(_0x495c1d,null));};exports[_0x197c('0x51')]=function(_0x360599,_0x21d21f){if(_0x360599['body']['id']){delete _0x360599[_0x197c('0x50')]['id'];}return db[_0x197c('0x32')][_0x197c('0x52')]({'where':{'id':_0x360599['params']['id']}})[_0x197c('0x19')](handleEntityNotFound(_0x21d21f,null))[_0x197c('0x19')](saveUpdates(_0x360599[_0x197c('0x50')],null))[_0x197c('0x19')](respondWithResult(_0x21d21f,null))[_0x197c('0x23')](handleError(_0x21d21f,null));};exports['destroy']=function(_0x4dfaeb,_0x249394){return db[_0x197c('0x32')][_0x197c('0x52')]({'where':{'id':_0x4dfaeb[_0x197c('0x4e')]['id']}})[_0x197c('0x19')](handleEntityNotFound(_0x249394,null))['then'](removeEntity(_0x249394,null))['catch'](handleError(_0x249394,null));};exports[_0x197c('0x53')]=function(_0x2974a5,_0x5855bd,_0xb3747b){var _0x23a19c={};var _0x1a607c={};var _0x40867c;var _0xc10419;return db[_0x197c('0x32')]['findOne']({'where':{'id':_0x2974a5[_0x197c('0x4e')]['id']}})[_0x197c('0x19')](handleEntityNotFound(_0x5855bd,null))['then'](function(_0x480cab){if(_0x480cab){_0x40867c=_0x480cab;_0x1a607c[_0x197c('0x34')]=_['keys'](db[_0x197c('0x54')][_0x197c('0x33')]);_0x1a607c[_0x197c('0x36')]=_['keys'](_0x2974a5[_0x197c('0x36')]);_0x1a607c[_0x197c('0x37')]=_['intersection'](_0x1a607c[_0x197c('0x34')],_0x1a607c[_0x197c('0x36')]);_0x23a19c[_0x197c('0x39')]=_['intersection'](_0x1a607c[_0x197c('0x34')],qs[_0x197c('0x3a')](_0x2974a5['query']['fields']));_0x23a19c[_0x197c('0x39')]=_0x23a19c[_0x197c('0x39')][_0x197c('0x3b')]?_0x23a19c['attributes']:_0x1a607c[_0x197c('0x34')];_0x23a19c[_0x197c('0x3e')]=qs[_0x197c('0x3f')](_0x2974a5['query'][_0x197c('0x3f')]);_0x23a19c[_0x197c('0x40')]=qs[_0x197c('0x37')](_[_0x197c('0x41')](_0x2974a5[_0x197c('0x36')],_0x1a607c[_0x197c('0x37')]));if(_0x2974a5[_0x197c('0x36')][_0x197c('0x42')]){_0x23a19c[_0x197c('0x40')]=_[_0x197c('0x43')](_0x23a19c['where'],{'$or':_[_0x197c('0x44')](_0x23a19c['attributes'],function(_0x491162){var _0x4a8e13={};_0x4a8e13[_0x491162]={'$like':'%'+_0x2974a5['query'][_0x197c('0x42')]+'%'};return _0x4a8e13;})});}_0x23a19c=_[_0x197c('0x43')]({},_0x23a19c,_0x2974a5[_0x197c('0x48')]);return _0x40867c[_0x197c('0x53')](_0x23a19c);}})['then'](function(_0x32d739){if(_0x32d739){_0xc10419=_0x32d739['length'];if(!_0x2974a5[_0x197c('0x36')]['hasOwnProperty'](_0x197c('0x3d'))){_0x23a19c['limit']=qs[_0x197c('0x2a')](_0x2974a5[_0x197c('0x36')][_0x197c('0x2a')]);_0x23a19c[_0x197c('0x29')]=qs['offset'](_0x2974a5[_0x197c('0x36')][_0x197c('0x29')]);}return _0x40867c[_0x197c('0x53')](_0x23a19c);}})['then'](function(_0x2a4857){if(_0x2a4857){return _0x2a4857?{'count':_0xc10419,'rows':_0x2a4857}:null;}})[_0x197c('0x19')](respondWithResult(_0x5855bd,null))[_0x197c('0x23')](handleError(_0x5855bd,null));};exports[_0x197c('0x55')]=function(_0x5596f3,_0x3d1d6c,_0x1e6371){var _0x436a53={};var _0x2c7e66={};var _0x1947bd;var _0x342efa;return db[_0x197c('0x32')][_0x197c('0x56')]({'where':{'id':_0x5596f3[_0x197c('0x4e')]['id']}})[_0x197c('0x19')](handleEntityNotFound(_0x3d1d6c,null))[_0x197c('0x19')](function(_0x171eac){if(_0x171eac){_0x1947bd=_0x171eac;_0x2c7e66[_0x197c('0x34')]=_['keys'](db['DeskField']['rawAttributes']);_0x2c7e66[_0x197c('0x36')]=_['keys'](_0x5596f3[_0x197c('0x36')]);_0x2c7e66['filters']=_['intersection'](_0x2c7e66[_0x197c('0x34')],_0x2c7e66[_0x197c('0x36')]);_0x436a53[_0x197c('0x39')]=_['intersection'](_0x2c7e66[_0x197c('0x34')],qs[_0x197c('0x3a')](_0x5596f3['query'][_0x197c('0x3a')]));_0x436a53[_0x197c('0x39')]=_0x436a53[_0x197c('0x39')][_0x197c('0x3b')]?_0x436a53['attributes']:_0x2c7e66[_0x197c('0x34')];_0x436a53['order']=qs[_0x197c('0x3f')](_0x5596f3['query'][_0x197c('0x3f')]);_0x436a53[_0x197c('0x40')]=qs[_0x197c('0x37')](_['pick'](_0x5596f3[_0x197c('0x36')],_0x2c7e66[_0x197c('0x37')]));if(_0x5596f3[_0x197c('0x36')]['filter']){_0x436a53[_0x197c('0x40')]=_[_0x197c('0x43')](_0x436a53[_0x197c('0x40')],{'$or':_[_0x197c('0x44')](_0x436a53[_0x197c('0x39')],function(_0x1c18aa){var _0x4bc7cc={};_0x4bc7cc[_0x1c18aa]={'$like':'%'+_0x5596f3[_0x197c('0x36')]['filter']+'%'};return _0x4bc7cc;})});}_0x436a53=_['merge']({},_0x436a53,_0x5596f3[_0x197c('0x48')]);return _0x1947bd[_0x197c('0x55')](_0x436a53);}})['then'](function(_0x41a758){if(_0x41a758){_0x342efa=_0x41a758[_0x197c('0x3b')];if(!_0x5596f3[_0x197c('0x36')][_0x197c('0x3c')](_0x197c('0x3d'))){_0x436a53['limit']=qs['limit'](_0x5596f3['query']['limit']);_0x436a53[_0x197c('0x29')]=qs[_0x197c('0x29')](_0x5596f3['query']['offset']);}return _0x1947bd[_0x197c('0x55')](_0x436a53);}})['then'](function(_0x4b1088){if(_0x4b1088){return _0x4b1088?{'count':_0x342efa,'rows':_0x4b1088}:null;}})[_0x197c('0x19')](respondWithResult(_0x3d1d6c,null))[_0x197c('0x23')](handleError(_0x3d1d6c,null));};exports[_0x197c('0x57')]=function(_0xca4458,_0xd74af9,_0x17285b){var _0x48c3d8={};var _0x2d0b21={};var _0x2321e1;var _0x43fc99;return db[_0x197c('0x32')][_0x197c('0x56')]({'where':{'id':_0xca4458[_0x197c('0x4e')]['id']}})[_0x197c('0x19')](handleEntityNotFound(_0xd74af9,null))['then'](function(_0x15d047){if(_0x15d047){_0x2321e1=_0x15d047;_0x2d0b21[_0x197c('0x34')]=_[_0x197c('0x35')](db[_0x197c('0x54')][_0x197c('0x33')]);_0x2d0b21[_0x197c('0x36')]=_['keys'](_0xca4458[_0x197c('0x36')]);_0x2d0b21[_0x197c('0x37')]=_['intersection'](_0x2d0b21[_0x197c('0x34')],_0x2d0b21[_0x197c('0x36')]);_0x48c3d8[_0x197c('0x39')]=_[_0x197c('0x38')](_0x2d0b21[_0x197c('0x34')],qs['fields'](_0xca4458['query']['fields']));_0x48c3d8[_0x197c('0x39')]=_0x48c3d8['attributes']['length']?_0x48c3d8[_0x197c('0x39')]:_0x2d0b21[_0x197c('0x34')];_0x48c3d8[_0x197c('0x3e')]=qs[_0x197c('0x3f')](_0xca4458[_0x197c('0x36')]['sort']);_0x48c3d8['where']=qs[_0x197c('0x37')](_[_0x197c('0x41')](_0xca4458['query'],_0x2d0b21[_0x197c('0x37')]));if(_0xca4458[_0x197c('0x36')][_0x197c('0x42')]){_0x48c3d8[_0x197c('0x40')]=_[_0x197c('0x43')](_0x48c3d8[_0x197c('0x40')],{'$or':_['map'](_0x48c3d8[_0x197c('0x39')],function(_0x45f2d0){var _0x40f745={};_0x40f745[_0x45f2d0]={'$like':'%'+_0xca4458[_0x197c('0x36')][_0x197c('0x42')]+'%'};return _0x40f745;})});}_0x48c3d8=_['merge']({},_0x48c3d8,_0xca4458['options']);return _0x2321e1[_0x197c('0x57')](_0x48c3d8);}})['then'](function(_0x1ea452){if(_0x1ea452){_0x43fc99=_0x1ea452[_0x197c('0x3b')];if(!_0xca4458[_0x197c('0x36')][_0x197c('0x3c')](_0x197c('0x3d'))){_0x48c3d8['limit']=qs[_0x197c('0x2a')](_0xca4458[_0x197c('0x36')][_0x197c('0x2a')]);_0x48c3d8[_0x197c('0x29')]=qs['offset'](_0xca4458['query'][_0x197c('0x29')]);}return _0x2321e1['getDescriptions'](_0x48c3d8);}})['then'](function(_0x34b3d6){if(_0x34b3d6){return _0x34b3d6?{'count':_0x43fc99,'rows':_0x34b3d6}:null;}})[_0x197c('0x19')](respondWithResult(_0xd74af9,null))[_0x197c('0x23')](handleError(_0xd74af9,null));};exports['getTags']=function(_0x4bc9af,_0x4c6322,_0x36a69d){var _0x545061={};var _0x17d82b={};var _0x235fce;var _0x5f3d33;return db[_0x197c('0x32')][_0x197c('0x56')]({'where':{'id':_0x4bc9af['params']['id']}})[_0x197c('0x19')](handleEntityNotFound(_0x4c6322,null))['then'](function(_0x217d70){if(_0x217d70){_0x235fce=_0x217d70;_0x17d82b[_0x197c('0x34')]=_[_0x197c('0x35')](db[_0x197c('0x58')][_0x197c('0x33')]);_0x17d82b['query']=_[_0x197c('0x35')](_0x4bc9af[_0x197c('0x36')]);_0x17d82b[_0x197c('0x37')]=_[_0x197c('0x38')](_0x17d82b[_0x197c('0x34')],_0x17d82b[_0x197c('0x36')]);_0x545061[_0x197c('0x39')]=_['intersection'](_0x17d82b[_0x197c('0x34')],qs['fields'](_0x4bc9af[_0x197c('0x36')][_0x197c('0x3a')]));_0x545061[_0x197c('0x39')]=_0x545061[_0x197c('0x39')]['length']?_0x545061[_0x197c('0x39')]:_0x17d82b[_0x197c('0x34')];_0x545061[_0x197c('0x3e')]=qs['sort'](_0x4bc9af[_0x197c('0x36')][_0x197c('0x3f')]);_0x545061[_0x197c('0x40')]=qs[_0x197c('0x37')](_[_0x197c('0x41')](_0x4bc9af[_0x197c('0x36')],_0x17d82b[_0x197c('0x37')]));if(_0x4bc9af['query'][_0x197c('0x42')]){_0x545061['where']=_[_0x197c('0x43')](_0x545061[_0x197c('0x40')],{'$or':_[_0x197c('0x44')](_0x545061[_0x197c('0x39')],function(_0x2f6c19){var _0x5d78b6={};_0x5d78b6[_0x2f6c19]={'$like':'%'+_0x4bc9af[_0x197c('0x36')][_0x197c('0x42')]+'%'};return _0x5d78b6;})});}_0x545061=_[_0x197c('0x43')]({},_0x545061,_0x4bc9af[_0x197c('0x48')]);return _0x235fce[_0x197c('0x59')](_0x545061);}})['then'](function(_0x534bc3){if(_0x534bc3){_0x5f3d33=_0x534bc3[_0x197c('0x3b')];if(!_0x4bc9af[_0x197c('0x36')][_0x197c('0x3c')](_0x197c('0x3d'))){_0x545061[_0x197c('0x2a')]=qs[_0x197c('0x2a')](_0x4bc9af[_0x197c('0x36')][_0x197c('0x2a')]);_0x545061['offset']=qs[_0x197c('0x29')](_0x4bc9af[_0x197c('0x36')]['offset']);}return _0x235fce[_0x197c('0x59')](_0x545061);}})[_0x197c('0x19')](function(_0x58d20d){if(_0x58d20d){return _0x58d20d?{'count':_0x5f3d33,'rows':_0x58d20d}:null;}})[_0x197c('0x19')](respondWithResult(_0x4c6322,null))[_0x197c('0x23')](handleError(_0x4c6322,null));};exports[_0x197c('0x5a')]=function(_0x296b7c,_0x11999c,_0x55e845){if(_0x296b7c['body']['id']){delete _0x296b7c[_0x197c('0x50')]['id'];}return db[_0x197c('0x32')][_0x197c('0x56')]({'where':{'id':_0x296b7c[_0x197c('0x4e')]['id']}})[_0x197c('0x19')](handleEntityNotFound(_0x11999c,null))[_0x197c('0x19')](function(_0x23b759){if(_0x23b759){return _0x23b759[_0x197c('0x5a')](_0x296b7c['body'][_0x197c('0x5b')]||[]);}return null;})[_0x197c('0x19')](respondWithResult(_0x11999c,null))[_0x197c('0x23')](handleError(_0x11999c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index c87cefb..bd23be8 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 _0xea28=['request-promise','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ba697,_0x186781){var _0x433b23=function(_0xe5df67){while(--_0xe5df67){_0x1ba697['push'](_0x1ba697['shift']());}};_0x433b23(++_0x186781);}(_0xea28,0x13a));var _0x8ea2=function(_0x397981,_0x329393){_0x397981=_0x397981-0x0;var _0x27a2ae=_0xea28[_0x397981];return _0x27a2ae;};'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 attributes=require(_0x8ea2('0x7'));module['exports']=function(_0x9b45ab,_0x23aaf1){return _0x9b45ab[_0x8ea2('0x8')]('DeskConfiguration',attributes,{'tableName':_0x8ea2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7d1=['bluebird','request-promise','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x485bb8,_0x3757e7){var _0x5d5c74=function(_0x58ae3d){while(--_0x58ae3d){_0x485bb8['push'](_0x485bb8['shift']());}};_0x5d5c74(++_0x3757e7);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2837f7,_0x4e358d){_0x2837f7=_0x2837f7-0x0;var _0x39d877=_0xd7d1[_0x2837f7];return _0x39d877;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var attributes=require(_0x1d7d('0x7'));module[_0x1d7d('0x8')]=function(_0x1adb6b,_0x3c0839){return _0x1adb6b[_0x1d7d('0x9')](_0x1d7d('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 8aaf8bf..7963a5a 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 _0x814b=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x814b,0x1a2));var _0xb814=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0x814b[_0x2300f2];return _0x6bd508;};'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')]('DeskConfiguration,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x46ed=['DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var rs=require(_0xd46e('0x3'));var fs=require('fs');var Redis=require(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd46e('0x5'));var logger=require(_0xd46e('0x6'))('rpc');var config=require(_0xd46e('0x7'));var jayson=require(_0xd46e('0x8'));var client=jayson[_0xd46e('0x9')][_0xd46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){return client[_0xd46e('0xb')](_0x45e680,_0x437ea0)[_0xd46e('0xc')](function(_0x59c88d){logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,'request\x20sent');logger[_0xd46e('0xf')](_0xd46e('0x10'),_0x855f24,_0xd46e('0x11'),JSON[_0xd46e('0x12')](_0x59c88d));if(_0x59c88d[_0xd46e('0x13')]){if(_0x59c88d[_0xd46e('0x13')]['code']===0x1f4){logger[_0xd46e('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x855f24,_0x59c88d['error'][_0xd46e('0x14')]);return _0x31259b(_0x59c88d[_0xd46e('0x13')]['message']);}logger['error'](_0xd46e('0xe'),_0x855f24,_0x59c88d[_0xd46e('0x13')][_0xd46e('0x14')]);return _0x144687(_0x59c88d[_0xd46e('0x13')]['message']);}else{logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,_0xd46e('0x11'));_0x144687(_0x59c88d[_0xd46e('0x15')][_0xd46e('0x14')]);}})['catch'](function(_0x1d50a5){logger[_0xd46e('0x13')](_0xd46e('0xe'),_0x855f24,_0x1d50a5);_0x31259b(_0x1d50a5);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 22b6292..f917bce 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 _0xf18a=['./intDeskField.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5266dc,_0x1ca0f8){var _0x1680a3=function(_0x4fb6ac){while(--_0x4fb6ac){_0x5266dc['push'](_0x5266dc['shift']());}};_0x1680a3(++_0x1ca0f8);}(_0xf18a,0x90));var _0xaf18=function(_0x33ee71,_0x503775){_0x33ee71=_0x33ee71-0x0;var _0x3be51c=_0xf18a[_0x33ee71];return _0x3be51c;};'use strict';var multer=require(_0xaf18('0x0'));var util=require(_0xaf18('0x1'));var path=require(_0xaf18('0x2'));var timeout=require(_0xaf18('0x3'));var express=require('express');var router=express[_0xaf18('0x4')]();var auth=require(_0xaf18('0x5'));var interaction=require(_0xaf18('0x6'));var config=require(_0xaf18('0x7'));var controller=require(_0xaf18('0x8'));router['get']('/',auth[_0xaf18('0x9')](),controller[_0xaf18('0xa')]);router[_0xaf18('0xb')]('/:id',auth[_0xaf18('0x9')](),controller[_0xaf18('0xc')]);router[_0xaf18('0xd')]('/',auth[_0xaf18('0x9')](),controller[_0xaf18('0xe')]);router[_0xaf18('0xf')](_0xaf18('0x10'),auth[_0xaf18('0x9')](),controller['update']);router[_0xaf18('0x11')]('/:id',auth[_0xaf18('0x9')](),controller[_0xaf18('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5b68=['destroy','multer','connect-timeout','../../config/environment','./intDeskField.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x30a204,_0x48370f){var _0x1a1350=function(_0x5844db){while(--_0x5844db){_0x30a204['push'](_0x30a204['shift']());}};_0x1a1350(++_0x48370f);}(_0x5b68,0xef));var _0x85b6=function(_0x2ca970,_0x32fe25){_0x2ca970=_0x2ca970-0x0;var _0x45f6e8=_0x5b68[_0x2ca970];return _0x45f6e8;};'use strict';var multer=require(_0x85b6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x85b6('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85b6('0x2'));var controller=require(_0x85b6('0x3'));router[_0x85b6('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x85b6('0x4')](_0x85b6('0x5'),auth[_0x85b6('0x6')](),controller[_0x85b6('0x7')]);router[_0x85b6('0x8')]('/',auth[_0x85b6('0x6')](),controller[_0x85b6('0x9')]);router[_0x85b6('0xa')](_0x85b6('0x5'),auth[_0x85b6('0x6')](),controller[_0x85b6('0xb')]);router[_0x85b6('0xc')](_0x85b6('0x5'),auth[_0x85b6('0x6')](),controller[_0x85b6('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 2d26a78..6bac637 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 _0x5b02=['BOOLEAN','sequelize','exports','ENUM','string','keyValue','STRING','variable'];(function(_0x1f6dd1,_0x2e5594){var _0x58fec6=function(_0x2e41ca){while(--_0x2e41ca){_0x1f6dd1['push'](_0x1f6dd1['shift']());}};_0x58fec6(++_0x2e5594);}(_0x5b02,0xe9));var _0x25b0=function(_0x1ca91d,_0x5363bb){_0x1ca91d=_0x1ca91d-0x0;var _0x43ed13=_0x5b02[_0x1ca91d];return _0x43ed13;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'type':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3'),'variable','customVariable',_0x25b0('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x25b0('0x5')]},'key':{'type':Sequelize[_0x25b0('0x5')]},'keyType':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3'),_0x25b0('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x25b0('0x5')]},'idField':{'type':Sequelize[_0x25b0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x25b0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x4df0ac,_0x18f735){var _0x1683d7=function(_0x2994eb){while(--_0x2994eb){_0x4df0ac['push'](_0x4df0ac['shift']());}};_0x1683d7(++_0x18f735);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3a4b71,_0x443a78){_0x3a4b71=_0x3a4b71-0x0;var _0x224c9f=_0xb58b[_0x3a4b71];return _0x224c9f;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3f49462..221756b 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 _0x9c44=['ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','sendStatus','status','json','count','offset','limit','save','update','then','error','stack','name','send','index','DeskField','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','key','field','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv'];(function(_0x20afe7,_0x215467){var _0x40c7fe=function(_0x41d974){while(--_0x41d974){_0x20afe7['push'](_0x20afe7['shift']());}};_0x40c7fe(++_0x215467);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'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 authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x49c4('0xf'));var qs=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'];function respondWithStatusCode(_0x1d19bf,_0x6d1b08){_0x6d1b08=_0x6d1b08||0xcc;return function(_0x5487cd){if(_0x5487cd){return _0x1d19bf[_0x49c4('0x13')](_0x6d1b08);}return _0x1d19bf[_0x49c4('0x14')](_0x6d1b08)['end']();};}function respondWithResult(_0x1909fe,_0x280996){_0x280996=_0x280996||0xc8;return function(_0x21f15a){if(_0x21f15a){return _0x1909fe[_0x49c4('0x14')](_0x280996)[_0x49c4('0x15')](_0x21f15a);}};}function respondWithFilteredResult(_0x18211c,_0x75ea8){return function(_0x3de397){if(_0x3de397){var _0x58d177=_0x3de397[_0x49c4('0x16')],_0x3acd06=_0x75ea8[_0x49c4('0x17')],_0x141003=_0x75ea8['offset']+_0x75ea8[_0x49c4('0x18')],_0x13a2db;if(_0x141003>=_0x58d177){_0x141003=_0x58d177;_0x13a2db=0xc8;}else{_0x13a2db=0xce;}_0x18211c[_0x49c4('0x14')](_0x13a2db);return _0x18211c['set']('Content-Range',_0x3acd06+'-'+_0x141003+'/'+_0x58d177)[_0x49c4('0x15')](_0x3de397);}return null;};}function patchUpdates(_0x2f82d5){return function(_0x3addb2){try{jsonpatch['apply'](_0x3addb2,_0x2f82d5,!![]);}catch(_0x24856d){return BPromise['reject'](_0x24856d);}return _0x3addb2[_0x49c4('0x19')]();};}function saveUpdates(_0x1806c2,_0xe31fcc){return function(_0x291526){if(_0x291526){return _0x291526[_0x49c4('0x1a')](_0x1806c2)[_0x49c4('0x1b')](function(_0x280893){return _0x280893;});}return null;};}function removeEntity(_0x46e475,_0x2197d2){return function(_0x578447){if(_0x578447){return _0x578447['destroy']()['then'](function(){_0x46e475[_0x49c4('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x592bb8,_0x2263ae){return function(_0x15581b){if(!_0x15581b){_0x592bb8[_0x49c4('0x13')](0x194);}return _0x15581b;};}function handleError(_0xd335e4,_0x4811c4){_0x4811c4=_0x4811c4||0x1f4;return function(_0x5850f2){logger[_0x49c4('0x1c')](_0x5850f2[_0x49c4('0x1d')]);if(_0x5850f2['name']){delete _0x5850f2[_0x49c4('0x1e')];}_0xd335e4[_0x49c4('0x14')](_0x4811c4)[_0x49c4('0x1f')](_0x5850f2);};}exports[_0x49c4('0x20')]=function(_0x531d92,_0x543ea2){var _0x449960={},_0x53c199={},_0x3800b7={'count':0x0,'rows':[]};var _0x3852b2=db[_0x49c4('0x21')][_0x49c4('0x22')];_0x53c199['model']=_[_0x49c4('0x23')](_0x3852b2);_0x53c199[_0x49c4('0x24')]=_[_0x49c4('0x23')](_0x531d92[_0x49c4('0x24')]);_0x53c199[_0x49c4('0x25')]=_[_0x49c4('0x26')](_0x53c199[_0x49c4('0x27')],_0x53c199[_0x49c4('0x24')]);_0x449960[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x53c199[_0x49c4('0x27')],qs['fields'](_0x531d92['query']['fields']));_0x449960[_0x49c4('0x28')]=_0x449960[_0x49c4('0x28')][_0x49c4('0x29')]?_0x449960[_0x49c4('0x28')]:_0x53c199[_0x49c4('0x27')];if(!_0x531d92['query'][_0x49c4('0x2a')](_0x49c4('0x2b'))){_0x449960[_0x49c4('0x18')]=qs[_0x49c4('0x18')](_0x531d92['query']['limit']);_0x449960[_0x49c4('0x17')]=qs[_0x49c4('0x17')](_0x531d92[_0x49c4('0x24')][_0x49c4('0x17')]);}_0x449960[_0x49c4('0x2c')]=qs['sort'](_0x531d92[_0x49c4('0x24')][_0x49c4('0x2d')]);_0x449960[_0x49c4('0x2e')]=qs['filters'](_['pick'](_0x531d92[_0x49c4('0x24')],_0x53c199[_0x49c4('0x25')]));if(_0x531d92[_0x49c4('0x24')][_0x49c4('0x2f')]){_0x449960[_0x49c4('0x2e')]=_[_0x49c4('0x30')](_0x449960[_0x49c4('0x2e')],{'$or':_[_0x49c4('0x31')](_0x3852b2,function(_0x3209cd){if(_0x3209cd['type'][_0x49c4('0x32')]!=='VIRTUAL'){var _0xdda586={};_0xdda586[_0x3209cd[_0x49c4('0x33')]]={'$like':'%'+_0x531d92[_0x49c4('0x24')][_0x49c4('0x2f')]+'%'};return _0xdda586;}})});}_0x449960=_['merge']({},_0x449960,_0x531d92[_0x49c4('0x34')]);var _0x31f3ff={'where':_0x449960[_0x49c4('0x2e')]};return db['DeskField'][_0x49c4('0x16')](_0x31f3ff)[_0x49c4('0x1b')](function(_0x178987){_0x3800b7[_0x49c4('0x16')]=_0x178987;if(_0x531d92[_0x49c4('0x24')][_0x49c4('0x35')]){_0x449960[_0x49c4('0x36')]=[{'all':!![]}];}return db[_0x49c4('0x21')][_0x49c4('0x37')](_0x449960);})[_0x49c4('0x1b')](function(_0x1e506a){_0x3800b7['rows']=_0x1e506a;return _0x3800b7;})[_0x49c4('0x1b')](respondWithFilteredResult(_0x543ea2,_0x449960))[_0x49c4('0x38')](handleError(_0x543ea2,null));};exports[_0x49c4('0x39')]=function(_0x23aa32,_0x41ad28){var _0x29dd5d={'raw':!![],'where':{'id':_0x23aa32[_0x49c4('0x3a')]['id']}},_0x1be62d={};_0x1be62d[_0x49c4('0x27')]=_[_0x49c4('0x23')](db[_0x49c4('0x21')][_0x49c4('0x22')]);_0x1be62d[_0x49c4('0x24')]=_['keys'](_0x23aa32[_0x49c4('0x24')]);_0x1be62d['filters']=_[_0x49c4('0x26')](_0x1be62d[_0x49c4('0x27')],_0x1be62d[_0x49c4('0x24')]);_0x29dd5d[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x1be62d[_0x49c4('0x27')],qs['fields'](_0x23aa32['query'][_0x49c4('0x3b')]));_0x29dd5d[_0x49c4('0x28')]=_0x29dd5d[_0x49c4('0x28')][_0x49c4('0x29')]?_0x29dd5d['attributes']:_0x1be62d[_0x49c4('0x27')];if(_0x23aa32[_0x49c4('0x24')][_0x49c4('0x35')]){_0x29dd5d[_0x49c4('0x36')]=[{'all':!![]}];}_0x29dd5d=_[_0x49c4('0x30')]({},_0x29dd5d,_0x23aa32[_0x49c4('0x34')]);return db[_0x49c4('0x21')][_0x49c4('0x3c')](_0x29dd5d)[_0x49c4('0x1b')](handleEntityNotFound(_0x41ad28,null))['then'](respondWithResult(_0x41ad28,null))[_0x49c4('0x38')](handleError(_0x41ad28,null));};exports['create']=function(_0x33696e,_0x628423){return db[_0x49c4('0x21')][_0x49c4('0x3d')](_0x33696e[_0x49c4('0x3e')],{})['then'](respondWithResult(_0x628423,0xc9))[_0x49c4('0x38')](handleError(_0x628423,null));};exports[_0x49c4('0x1a')]=function(_0x384862,_0x254d07){if(_0x384862[_0x49c4('0x3e')]['id']){delete _0x384862[_0x49c4('0x3e')]['id'];}return db[_0x49c4('0x21')]['find']({'where':{'id':_0x384862[_0x49c4('0x3a')]['id']}})['then'](handleEntityNotFound(_0x254d07,null))[_0x49c4('0x1b')](saveUpdates(_0x384862[_0x49c4('0x3e')],null))[_0x49c4('0x1b')](respondWithResult(_0x254d07,null))[_0x49c4('0x38')](handleError(_0x254d07,null));};exports[_0x49c4('0x3f')]=function(_0x30bea5,_0x2c6be1){return db['DeskField'][_0x49c4('0x3c')]({'where':{'id':_0x30bea5[_0x49c4('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x1b')](removeEntity(_0x2c6be1,null))[_0x49c4('0x38')](handleError(_0x2c6be1,null));}; \ No newline at end of file +var _0x34e8=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','DeskField','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','destroy','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x34e8,0x12c));var _0x834e=function(_0x4e1109,_0x8b7e09){_0x4e1109=_0x4e1109-0x0;var _0x5a0bed=_0x34e8[_0x4e1109];return _0x5a0bed;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var hardwareService=require(_0x834e('0x14'));var Redis=require(_0x834e('0x15'));var qs=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];function respondWithStatusCode(_0x2fd95c,_0x538bb3){_0x538bb3=_0x538bb3||0xcc;return function(_0x5e5b6d){if(_0x5e5b6d){return _0x2fd95c[_0x834e('0x1c')](_0x538bb3);}return _0x2fd95c['status'](_0x538bb3)[_0x834e('0x1d')]();};}function respondWithResult(_0x2d95f2,_0x28e659){_0x28e659=_0x28e659||0xc8;return function(_0x21cc0a){if(_0x21cc0a){return _0x2d95f2['status'](_0x28e659)[_0x834e('0x1e')](_0x21cc0a);}};}function respondWithFilteredResult(_0x302cbd,_0x57274a){return function(_0x316205){if(_0x316205){var _0x4a9cdc=_0x316205[_0x834e('0x1f')],_0x38a8cd=_0x57274a[_0x834e('0x20')],_0x36d443=_0x57274a[_0x834e('0x20')]+_0x57274a['limit'],_0x478afe;if(_0x36d443>=_0x4a9cdc){_0x36d443=_0x4a9cdc;_0x478afe=0xc8;}else{_0x478afe=0xce;}_0x302cbd[_0x834e('0x21')](_0x478afe);return _0x302cbd[_0x834e('0x22')](_0x834e('0x23'),_0x38a8cd+'-'+_0x36d443+'/'+_0x4a9cdc)[_0x834e('0x1e')](_0x316205);}return null;};}function patchUpdates(_0x237947){return function(_0x254677){try{jsonpatch[_0x834e('0x24')](_0x254677,_0x237947,!![]);}catch(_0x595515){return BPromise[_0x834e('0x25')](_0x595515);}return _0x254677[_0x834e('0x26')]();};}function saveUpdates(_0x113ff4,_0x325a99){return function(_0x4ab05d){if(_0x4ab05d){return _0x4ab05d[_0x834e('0x27')](_0x113ff4)[_0x834e('0x28')](function(_0x5a05c0){return _0x5a05c0;});}return null;};}function removeEntity(_0x1b4bdf,_0x28d687){return function(_0x8d406e){if(_0x8d406e){return _0x8d406e['destroy']()['then'](function(){_0x1b4bdf[_0x834e('0x21')](0xcc)[_0x834e('0x1d')]();});}};}function handleEntityNotFound(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(!_0x1dc1e0){_0x589dde['sendStatus'](0x194);}return _0x1dc1e0;};}function handleError(_0x3bc4f7,_0x2e1983){_0x2e1983=_0x2e1983||0x1f4;return function(_0x338636){logger['error'](_0x338636[_0x834e('0x29')]);if(_0x338636[_0x834e('0x2a')]){delete _0x338636['name'];}_0x3bc4f7['status'](_0x2e1983)[_0x834e('0x2b')](_0x338636);};}exports['index']=function(_0x2826ec,_0x3f1b0b){var _0x3db026={},_0x2cc2eb={},_0x3cd928={'count':0x0,'rows':[]};var _0x130cc5=db['DeskField']['rawAttributes'];_0x2cc2eb['model']=_['keys'](_0x130cc5);_0x2cc2eb[_0x834e('0x2c')]=_[_0x834e('0x2d')](_0x2826ec[_0x834e('0x2c')]);_0x2cc2eb['filters']=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],_0x2cc2eb[_0x834e('0x2c')]);_0x3db026[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],qs[_0x834e('0x31')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x31')]));_0x3db026['attributes']=_0x3db026[_0x834e('0x30')]['length']?_0x3db026[_0x834e('0x30')]:_0x2cc2eb[_0x834e('0x2f')];if(!_0x2826ec[_0x834e('0x2c')][_0x834e('0x32')](_0x834e('0x33'))){_0x3db026[_0x834e('0x34')]=qs[_0x834e('0x34')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x34')]);_0x3db026[_0x834e('0x20')]=qs['offset'](_0x2826ec[_0x834e('0x2c')][_0x834e('0x20')]);}_0x3db026[_0x834e('0x35')]=qs[_0x834e('0x36')](_0x2826ec['query'][_0x834e('0x36')]);_0x3db026[_0x834e('0x37')]=qs['filters'](_['pick'](_0x2826ec['query'],_0x2cc2eb[_0x834e('0x38')]));if(_0x2826ec[_0x834e('0x2c')][_0x834e('0x39')]){_0x3db026[_0x834e('0x37')]=_[_0x834e('0x3a')](_0x3db026[_0x834e('0x37')],{'$or':_['map'](_0x130cc5,function(_0x2c2d94){if(_0x2c2d94['type'][_0x834e('0x3b')]!==_0x834e('0x3c')){var _0x47abed={};_0x47abed[_0x2c2d94[_0x834e('0x3d')]]={'$like':'%'+_0x2826ec[_0x834e('0x2c')]['filter']+'%'};return _0x47abed;}})});}_0x3db026=_['merge']({},_0x3db026,_0x2826ec[_0x834e('0x3e')]);var _0xd0d43a={'where':_0x3db026[_0x834e('0x37')]};return db[_0x834e('0x3f')][_0x834e('0x1f')](_0xd0d43a)['then'](function(_0x1c5ed6){_0x3cd928['count']=_0x1c5ed6;if(_0x2826ec['query'][_0x834e('0x40')]){_0x3db026['include']=[{'all':!![]}];}return db[_0x834e('0x3f')][_0x834e('0x41')](_0x3db026);})[_0x834e('0x28')](function(_0x3c59af){_0x3cd928[_0x834e('0x42')]=_0x3c59af;return _0x3cd928;})['then'](respondWithFilteredResult(_0x3f1b0b,_0x3db026))[_0x834e('0x43')](handleError(_0x3f1b0b,null));};exports[_0x834e('0x44')]=function(_0x38f266,_0x58c5fb){var _0x35380e={'raw':!![],'where':{'id':_0x38f266['params']['id']}},_0x16ac45={};_0x16ac45[_0x834e('0x2f')]=_['keys'](db[_0x834e('0x3f')][_0x834e('0x45')]);_0x16ac45['query']=_['keys'](_0x38f266[_0x834e('0x2c')]);_0x16ac45[_0x834e('0x38')]=_[_0x834e('0x2e')](_0x16ac45[_0x834e('0x2f')],_0x16ac45[_0x834e('0x2c')]);_0x35380e[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x16ac45['model'],qs[_0x834e('0x31')](_0x38f266['query'][_0x834e('0x31')]));_0x35380e['attributes']=_0x35380e[_0x834e('0x30')]['length']?_0x35380e[_0x834e('0x30')]:_0x16ac45[_0x834e('0x2f')];if(_0x38f266['query'][_0x834e('0x40')]){_0x35380e[_0x834e('0x46')]=[{'all':!![]}];}_0x35380e=_[_0x834e('0x3a')]({},_0x35380e,_0x38f266[_0x834e('0x3e')]);return db[_0x834e('0x3f')][_0x834e('0x47')](_0x35380e)[_0x834e('0x28')](handleEntityNotFound(_0x58c5fb,null))[_0x834e('0x28')](respondWithResult(_0x58c5fb,null))[_0x834e('0x43')](handleError(_0x58c5fb,null));};exports[_0x834e('0x48')]=function(_0x5f3943,_0x3124be){return db[_0x834e('0x3f')]['create'](_0x5f3943[_0x834e('0x49')],{})[_0x834e('0x28')](respondWithResult(_0x3124be,0xc9))[_0x834e('0x43')](handleError(_0x3124be,null));};exports[_0x834e('0x27')]=function(_0x19b5ef,_0x4264b8){if(_0x19b5ef['body']['id']){delete _0x19b5ef['body']['id'];}return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x19b5ef[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x4264b8,null))[_0x834e('0x28')](saveUpdates(_0x19b5ef[_0x834e('0x49')],null))[_0x834e('0x28')](respondWithResult(_0x4264b8,null))[_0x834e('0x43')](handleError(_0x4264b8,null));};exports[_0x834e('0x4b')]=function(_0x390c45,_0xf02f0d){return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x390c45[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x28')](removeEntity(_0xf02f0d,null))[_0x834e('0x43')](handleError(_0xf02f0d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6c7631c..ad94e84 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 _0x67ab=['DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','api','moment','bluebird','exports'];(function(_0x7b2c71,_0x18f8fc){var _0x24d447=function(_0x316b37){while(--_0x316b37){_0x7b2c71['push'](_0x7b2c71['shift']());}};_0x24d447(++_0x18f8fc);}(_0x67ab,0x176));var _0xb67a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x67ab[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb67a('0x0'));var util=require(_0xb67a('0x1'));var logger=require('../../config/logger')(_0xb67a('0x2'));var moment=require(_0xb67a('0x3'));var BPromise=require(_0xb67a('0x4'));var rp=require('request-promise');var attributes=require('./intDeskField.attributes');module[_0xb67a('0x5')]=function(_0x54e6a2,_0x3f2212){return _0x54e6a2['define'](_0xb67a('0x6'),attributes,{'tableName':_0xb67a('0x7'),'paranoid':![],'indexes':[{'name':_0xb67a('0x8'),'fields':[_0xb67a('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1272=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x58a37e,_0x1069cf){var _0x3ec2f4=function(_0x26eeb5){while(--_0x26eeb5){_0x58a37e['push'](_0x58a37e['shift']());}};_0x3ec2f4(++_0x1069cf);}(_0x1272,0x177));var _0x2127=function(_0x4dedd3,_0x175841){_0x4dedd3=_0x4dedd3-0x0;var _0x48f768=_0x1272[_0x4dedd3];return _0x48f768;};'use strict';var _=require(_0x2127('0x0'));var util=require(_0x2127('0x1'));var logger=require(_0x2127('0x2'))(_0x2127('0x3'));var moment=require(_0x2127('0x4'));var BPromise=require(_0x2127('0x5'));var rp=require(_0x2127('0x6'));var attributes=require(_0x2127('0x7'));module[_0x2127('0x8')]=function(_0x289afe,_0x2e12ca){return _0x289afe[_0x2127('0x9')](_0x2127('0xa'),attributes,{'tableName':_0x2127('0xb'),'paranoid':![],'indexes':[{'name':_0x2127('0xc'),'fields':[_0x2127('0xd'),_0x2127('0xe')],'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 796fa1e..0dcd069 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 _0x0a9a=['DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0x0a9a,0x183));var _0xa0a9=function(_0x16b99e,_0x14dbe8){_0x16b99e=_0x16b99e-0x0;var _0x5f100b=_0x0a9a[_0x16b99e];return _0x5f100b;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('DeskField,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('DeskField,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file +var _0xa9e0=['http','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\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(_0x477616,_0x4b9b3f){var _0x587e67=function(_0x2570a9){while(--_0x2570a9){_0x477616['push'](_0x477616['shift']());}};_0x587e67(++_0x4b9b3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6bb8014..324d459 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 _0xf3c3=['/:id','show','getConfigurations','getFields','post','/:id/configurations','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index'];(function(_0x179a0c,_0x2ca073){var _0x1c8b9a=function(_0xfa6124){while(--_0xfa6124){_0x179a0c['push'](_0x179a0c['shift']());}};_0x1c8b9a(++_0x2ca073);}(_0xf3c3,0x154));var _0x3f3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3f3c('0x0'));var util=require('util');var path=require(_0x3f3c('0x1'));var timeout=require(_0x3f3c('0x2'));var express=require(_0x3f3c('0x3'));var router=express[_0x3f3c('0x4')]();var auth=require(_0x3f3c('0x5'));var interaction=require(_0x3f3c('0x6'));var config=require(_0x3f3c('0x7'));var controller=require(_0x3f3c('0x8'));router[_0x3f3c('0x9')]('/',auth[_0x3f3c('0xa')](),controller[_0x3f3c('0xb')]);router[_0x3f3c('0x9')](_0x3f3c('0xc'),auth[_0x3f3c('0xa')](),controller[_0x3f3c('0xd')]);router[_0x3f3c('0x9')]('/:id/configurations',auth[_0x3f3c('0xa')](),controller[_0x3f3c('0xe')]);router[_0x3f3c('0x9')]('/:id/fields',auth[_0x3f3c('0xa')](),controller[_0x3f3c('0xf')]);router[_0x3f3c('0x10')]('/',auth[_0x3f3c('0xa')](),controller['create']);router[_0x3f3c('0x10')](_0x3f3c('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3f3c('0x12')](_0x3f3c('0xc'),auth['isAuthenticated'](),controller[_0x3f3c('0x13')]);router['delete']('/:id',auth[_0x3f3c('0xa')](),controller[_0x3f3c('0x14')]);module[_0x3f3c('0x15')]=router; \ No newline at end of file +var _0x296f=['isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get'];(function(_0x4d399b,_0x3bd4a4){var _0x4435e5=function(_0x587f0a){while(--_0x587f0a){_0x4d399b['push'](_0x4d399b['shift']());}};_0x4435e5(++_0x3bd4a4);}(_0x296f,0x97));var _0xf296=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0x296f[_0x1e91eb];return _0x2af75a;};'use strict';var multer=require(_0xf296('0x0'));var util=require(_0xf296('0x1'));var path=require(_0xf296('0x2'));var timeout=require(_0xf296('0x3'));var express=require('express');var router=express[_0xf296('0x4')]();var auth=require(_0xf296('0x5'));var interaction=require(_0xf296('0x6'));var config=require(_0xf296('0x7'));var controller=require(_0xf296('0x8'));router[_0xf296('0x9')]('/',auth[_0xf296('0xa')](),controller[_0xf296('0xb')]);router[_0xf296('0x9')](_0xf296('0xc'),auth[_0xf296('0xa')](),controller['show']);router['get'](_0xf296('0xd'),auth[_0xf296('0xa')](),controller[_0xf296('0xe')]);router[_0xf296('0x9')](_0xf296('0xf'),auth['isAuthenticated'](),controller[_0xf296('0x10')]);router[_0xf296('0x11')]('/',auth[_0xf296('0xa')](),controller['create']);router[_0xf296('0x11')](_0xf296('0xd'),auth[_0xf296('0xa')](),controller['addConfiguration']);router[_0xf296('0x12')](_0xf296('0xc'),auth[_0xf296('0xa')](),controller[_0xf296('0x13')]);router[_0xf296('0x14')]('/:id',auth[_0xf296('0xa')](),controller[_0xf296('0x15')]);module[_0xf296('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index c5b8b1c..1da390b 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 _0x52a7=['sequelize','STRING'];(function(_0x17f891,_0x34c577){var _0x5bf2d4=function(_0x208a07){while(--_0x208a07){_0x17f891['push'](_0x17f891['shift']());}};_0x5bf2d4(++_0x34c577);}(_0x52a7,0x19c));var _0x752a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x52a7[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x752a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x752a('0x1')]},'remoteUri':{'type':Sequelize[_0x752a('0x1')]},'tenantId':{'type':Sequelize[_0x752a('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x752a('0x1')]},'serverUrl':{'type':Sequelize[_0x752a('0x1')]},'description':{'type':Sequelize[_0x752a('0x1')]}}; \ No newline at end of file +var _0xfcac=['exports','STRING'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0xfcac,0xc4));var _0xcfca=function(_0x324efd,_0x514390){_0x324efd=_0x324efd-0x0;var _0x1576a5=_0xfcac[_0x324efd];return _0x1576a5;};'use strict';var Sequelize=require('sequelize');module[_0xcfca('0x0')]={'name':{'type':Sequelize[_0xcfca('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xcfca('0x1')]},'remoteUri':{'type':Sequelize[_0xcfca('0x1')]},'tenantId':{'type':Sequelize[_0xcfca('0x1')]},'clientId':{'type':Sequelize[_0xcfca('0x1')]},'clientSecret':{'type':Sequelize[_0xcfca('0x1')]},'serverUrl':{'type':Sequelize[_0xcfca('0x1')]},'description':{'type':Sequelize[_0xcfca('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index bdcacc1..16e0969 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 _0x2b5d=['channel','Descriptions','Dynamics365Field','getFields','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','@odata.type','push','all','forEach','isNil','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','LogicalName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','OptionSet','DisplayName','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','status','json','count','offset','limit','set','reject','save','update','destroy','stack','name','send','index','Dynamics365Account','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','pick','merge','AccountId','Subjects','getSubjects'];(function(_0x26421c,_0x20a7b9){var _0x56ada2=function(_0x5a8a48){while(--_0x5a8a48){_0x26421c['push'](_0x26421c['shift']());}};_0x56ada2(++_0x20a7b9);}(_0x2b5d,0x155));var _0xd2b5=function(_0x4b635d,_0x3e4634){_0x4b635d=_0x4b635d-0x0;var _0x59a98e=_0x2b5d[_0x4b635d];return _0x59a98e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd2b5('0x0'));var rimraf=require(_0xd2b5('0x1'));var zipdir=require(_0xd2b5('0x2'));var jsonpatch=require(_0xd2b5('0x3'));var rp=require(_0xd2b5('0x4'));var moment=require(_0xd2b5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd2b5('0x6'));var util=require('util');var path=require(_0xd2b5('0x7'));var sox=require('sox');var csv=require(_0xd2b5('0x8'));var ejs=require(_0xd2b5('0x9'));var fs=require('fs');var _=require(_0xd2b5('0xa'));var squel=require('squel');var crypto=require(_0xd2b5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd2b5('0xc'));var toCsv=require(_0xd2b5('0x8'));var querystring=require('querystring');var Papa=require(_0xd2b5('0xd'));var authService=require(_0xd2b5('0xe'));var hardwareService=require(_0xd2b5('0xf'));var Redis=require(_0xd2b5('0x10'));var qs=require(_0xd2b5('0x11'));var logger=require(_0xd2b5('0x12'))(_0xd2b5('0x13'));var utils=require(_0xd2b5('0x14'));var config=require(_0xd2b5('0x15'));var db=require(_0xd2b5('0x16'))['db'];var integrations=require(_0xd2b5('0x17'));var jayson=require('jayson/promise');var client=jayson[_0xd2b5('0x18')][_0xd2b5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2029f2,_0x2da1ff,_0x312929,_0x20d274){return new BPromise(function(_0x3b13f7,_0x1f6850){var _0x323ff4=_0x20d274||client;return _0x323ff4[_0xd2b5('0x1a')](_0x2029f2,_0x312929)[_0xd2b5('0x1b')](function(_0x234865){logger[_0xd2b5('0x1c')](_0xd2b5('0x1d'),_0x2da1ff,'request\x20sent');logger[_0xd2b5('0x1e')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x2da1ff,_0xd2b5('0x1f'),JSON[_0xd2b5('0x20')](_0x234865));if(_0x234865[_0xd2b5('0x21')]){if(_0x234865[_0xd2b5('0x21')][_0xd2b5('0x22')]===0x1f4){logger[_0xd2b5('0x21')](_0xd2b5('0x1d'),_0x2da1ff,_0x234865[_0xd2b5('0x21')]['message']);return _0x1f6850(_0x234865[_0xd2b5('0x21')][_0xd2b5('0x23')]);}logger[_0xd2b5('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x2da1ff,_0x234865[_0xd2b5('0x21')][_0xd2b5('0x23')]);return _0x3b13f7(_0x234865['error'][_0xd2b5('0x23')]);}else{logger[_0xd2b5('0x1c')]('Dynamics365Account,\x20%s,\x20%s',_0x2da1ff,_0xd2b5('0x1f'));_0x3b13f7(_0x234865[_0xd2b5('0x24')][_0xd2b5('0x23')]);}})['catch'](function(_0x449910){logger[_0xd2b5('0x21')](_0xd2b5('0x1d'),_0x2da1ff,_0x449910);_0x1f6850(_0x449910);});});}function respondWithStatusCode(_0x3f877f,_0x74ab66){_0x74ab66=_0x74ab66||0xcc;return function(_0x1d912b){if(_0x1d912b){return _0x3f877f['sendStatus'](_0x74ab66);}return _0x3f877f[_0xd2b5('0x25')](_0x74ab66)['end']();};}function respondWithResult(_0x2fc724,_0x22ce58){_0x22ce58=_0x22ce58||0xc8;return function(_0x420593){if(_0x420593){return _0x2fc724[_0xd2b5('0x25')](_0x22ce58)[_0xd2b5('0x26')](_0x420593);}};}function respondWithFilteredResult(_0x269366,_0x1f1e0f){return function(_0x3e0db1){if(_0x3e0db1){var _0x24f7b7=_0x3e0db1[_0xd2b5('0x27')],_0x27f803=_0x1f1e0f[_0xd2b5('0x28')],_0x3277af=_0x1f1e0f[_0xd2b5('0x28')]+_0x1f1e0f[_0xd2b5('0x29')],_0x3315cf;if(_0x3277af>=_0x24f7b7){_0x3277af=_0x24f7b7;_0x3315cf=0xc8;}else{_0x3315cf=0xce;}_0x269366[_0xd2b5('0x25')](_0x3315cf);return _0x269366[_0xd2b5('0x2a')]('Content-Range',_0x27f803+'-'+_0x3277af+'/'+_0x24f7b7)[_0xd2b5('0x26')](_0x3e0db1);}return null;};}function patchUpdates(_0x47ed4c){return function(_0x531dab){try{jsonpatch['apply'](_0x531dab,_0x47ed4c,!![]);}catch(_0x299c93){return BPromise[_0xd2b5('0x2b')](_0x299c93);}return _0x531dab[_0xd2b5('0x2c')]();};}function saveUpdates(_0x10ce5e,_0x579aeb){return function(_0x2e93c6){if(_0x2e93c6){return _0x2e93c6[_0xd2b5('0x2d')](_0x10ce5e)[_0xd2b5('0x1b')](function(_0x1216cd){return _0x1216cd;});}return null;};}function removeEntity(_0xfa42c,_0x520fa5){return function(_0x55b447){if(_0x55b447){return _0x55b447[_0xd2b5('0x2e')]()[_0xd2b5('0x1b')](function(){_0xfa42c[_0xd2b5('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0xff2745,_0xa54513){return function(_0x7d7771){if(!_0x7d7771){_0xff2745['sendStatus'](0x194);}return _0x7d7771;};}function handleError(_0x1789de,_0x5c94fd){_0x5c94fd=_0x5c94fd||0x1f4;return function(_0x5a783a){logger[_0xd2b5('0x21')](_0x5a783a[_0xd2b5('0x2f')]);if(_0x5a783a[_0xd2b5('0x30')]){delete _0x5a783a[_0xd2b5('0x30')];}_0x1789de[_0xd2b5('0x25')](_0x5c94fd)[_0xd2b5('0x31')](_0x5a783a);};}exports[_0xd2b5('0x32')]=function(_0x4c873f,_0x46b8ff){var _0x17d820={},_0x2c88fa={},_0x318384={'count':0x0,'rows':[]};var _0x5614e2=db[_0xd2b5('0x33')][_0xd2b5('0x34')];_0x2c88fa[_0xd2b5('0x35')]=_[_0xd2b5('0x36')](_0x5614e2);_0x2c88fa[_0xd2b5('0x37')]=_[_0xd2b5('0x36')](_0x4c873f[_0xd2b5('0x37')]);_0x2c88fa[_0xd2b5('0x38')]=_[_0xd2b5('0x39')](_0x2c88fa[_0xd2b5('0x35')],_0x2c88fa[_0xd2b5('0x37')]);_0x17d820[_0xd2b5('0x3a')]=_[_0xd2b5('0x39')](_0x2c88fa[_0xd2b5('0x35')],qs[_0xd2b5('0x3b')](_0x4c873f['query']['fields']));_0x17d820[_0xd2b5('0x3a')]=_0x17d820[_0xd2b5('0x3a')]['length']?_0x17d820[_0xd2b5('0x3a')]:_0x2c88fa[_0xd2b5('0x35')];if(!_0x4c873f['query']['hasOwnProperty'](_0xd2b5('0x3c'))){_0x17d820[_0xd2b5('0x29')]=qs['limit'](_0x4c873f[_0xd2b5('0x37')]['limit']);_0x17d820[_0xd2b5('0x28')]=qs[_0xd2b5('0x28')](_0x4c873f[_0xd2b5('0x37')][_0xd2b5('0x28')]);}_0x17d820[_0xd2b5('0x3d')]=qs[_0xd2b5('0x3e')](_0x4c873f[_0xd2b5('0x37')]['sort']);_0x17d820[_0xd2b5('0x3f')]=qs[_0xd2b5('0x38')](_['pick'](_0x4c873f[_0xd2b5('0x37')],_0x2c88fa[_0xd2b5('0x38')]));if(_0x4c873f[_0xd2b5('0x37')][_0xd2b5('0x40')]){_0x17d820[_0xd2b5('0x3f')]=_['merge'](_0x17d820[_0xd2b5('0x3f')],{'$or':_[_0xd2b5('0x41')](_0x5614e2,function(_0x5a3e00){if(_0x5a3e00[_0xd2b5('0x42')][_0xd2b5('0x43')]!==_0xd2b5('0x44')){var _0x53db41={};_0x53db41[_0x5a3e00[_0xd2b5('0x45')]]={'$like':'%'+_0x4c873f[_0xd2b5('0x37')][_0xd2b5('0x40')]+'%'};return _0x53db41;}})});}_0x17d820=_['merge']({},_0x17d820,_0x4c873f[_0xd2b5('0x46')]);var _0x3fd158={'where':_0x17d820[_0xd2b5('0x3f')]};return db['Dynamics365Account'][_0xd2b5('0x27')](_0x3fd158)[_0xd2b5('0x1b')](function(_0x7e6219){_0x318384[_0xd2b5('0x27')]=_0x7e6219;if(_0x4c873f[_0xd2b5('0x37')][_0xd2b5('0x47')]){_0x17d820[_0xd2b5('0x48')]=[{'all':!![]}];}return db[_0xd2b5('0x33')]['findAll'](_0x17d820);})[_0xd2b5('0x1b')](function(_0x204327){_0x318384[_0xd2b5('0x49')]=_0x204327;return _0x318384;})[_0xd2b5('0x1b')](respondWithFilteredResult(_0x46b8ff,_0x17d820))[_0xd2b5('0x4a')](handleError(_0x46b8ff,null));};exports[_0xd2b5('0x4b')]=function(_0x1df126,_0x1a5cbd){var _0x334288={'raw':![],'where':{'id':_0x1df126['params']['id']}},_0x946d96={};_0x946d96[_0xd2b5('0x35')]=_[_0xd2b5('0x36')](db[_0xd2b5('0x33')][_0xd2b5('0x34')]);_0x946d96['query']=_[_0xd2b5('0x36')](_0x1df126['query']);_0x946d96[_0xd2b5('0x38')]=_[_0xd2b5('0x39')](_0x946d96['model'],_0x946d96[_0xd2b5('0x37')]);_0x334288[_0xd2b5('0x3a')]=_[_0xd2b5('0x39')](_0x946d96[_0xd2b5('0x35')],qs[_0xd2b5('0x3b')](_0x1df126[_0xd2b5('0x37')]['fields']));_0x334288[_0xd2b5('0x3a')]=_0x334288[_0xd2b5('0x3a')][_0xd2b5('0x4c')]?_0x334288[_0xd2b5('0x3a')]:_0x946d96[_0xd2b5('0x35')];if(_0x1df126[_0xd2b5('0x37')]['includeAll']){_0x334288['include']=[{'all':!![]}];}_0x334288=_['merge']({},_0x334288,_0x1df126[_0xd2b5('0x46')]);return db[_0xd2b5('0x33')][_0xd2b5('0x4d')](_0x334288)[_0xd2b5('0x1b')](handleEntityNotFound(_0x1a5cbd,null))['then'](respondWithResult(_0x1a5cbd,null))[_0xd2b5('0x4a')](handleError(_0x1a5cbd,null));};exports['create']=function(_0x1ea30e,_0x120bb3){return db['Dynamics365Account'][_0xd2b5('0x4e')](_0x1ea30e[_0xd2b5('0x4f')],{})[_0xd2b5('0x1b')](respondWithResult(_0x120bb3,0xc9))['catch'](handleError(_0x120bb3,null));};exports['update']=function(_0x416782,_0x32bd99){if(_0x416782['body']['id']){delete _0x416782[_0xd2b5('0x4f')]['id'];}return db['Dynamics365Account'][_0xd2b5('0x4d')]({'where':{'id':_0x416782[_0xd2b5('0x50')]['id']}})[_0xd2b5('0x1b')](handleEntityNotFound(_0x32bd99,null))[_0xd2b5('0x1b')](saveUpdates(_0x416782[_0xd2b5('0x4f')],null))[_0xd2b5('0x1b')](respondWithResult(_0x32bd99,null))[_0xd2b5('0x4a')](handleError(_0x32bd99,null));};exports[_0xd2b5('0x2e')]=function(_0x180950,_0x3633b8){return db[_0xd2b5('0x33')][_0xd2b5('0x4d')]({'where':{'id':_0x180950['params']['id']}})['then'](handleEntityNotFound(_0x3633b8,null))['then'](removeEntity(_0x3633b8,null))[_0xd2b5('0x4a')](handleError(_0x3633b8,null));};exports[_0xd2b5('0x51')]=function(_0x3bee45,_0x1bab45,_0x5440b6){var _0x20d0ab={};var _0x5eca70={};var _0x53e2a1;var _0x428445;return db[_0xd2b5('0x33')][_0xd2b5('0x52')]({'where':{'id':_0x3bee45[_0xd2b5('0x50')]['id']}})[_0xd2b5('0x1b')](handleEntityNotFound(_0x1bab45,null))[_0xd2b5('0x1b')](function(_0x19d3de){if(_0x19d3de){_0x53e2a1=_0x19d3de;_0x5eca70[_0xd2b5('0x35')]=_['keys'](db[_0xd2b5('0x53')]['rawAttributes']);_0x5eca70[_0xd2b5('0x37')]=_[_0xd2b5('0x36')](_0x3bee45['query']);_0x5eca70[_0xd2b5('0x38')]=_[_0xd2b5('0x39')](_0x5eca70[_0xd2b5('0x35')],_0x5eca70[_0xd2b5('0x37')]);_0x20d0ab[_0xd2b5('0x3a')]=_['intersection'](_0x5eca70[_0xd2b5('0x35')],qs[_0xd2b5('0x3b')](_0x3bee45[_0xd2b5('0x37')]['fields']));_0x20d0ab[_0xd2b5('0x3a')]=_0x20d0ab['attributes']['length']?_0x20d0ab[_0xd2b5('0x3a')]:_0x5eca70['model'];_0x20d0ab[_0xd2b5('0x3d')]=qs[_0xd2b5('0x3e')](_0x3bee45[_0xd2b5('0x37')]['sort']);_0x20d0ab[_0xd2b5('0x3f')]=qs[_0xd2b5('0x38')](_[_0xd2b5('0x54')](_0x3bee45[_0xd2b5('0x37')],_0x5eca70[_0xd2b5('0x38')]));if(_0x3bee45['query'][_0xd2b5('0x40')]){_0x20d0ab['where']=_[_0xd2b5('0x55')](_0x20d0ab['where'],{'$or':_[_0xd2b5('0x41')](_0x20d0ab['attributes'],function(_0x149f9f){var _0xbdb212={};_0xbdb212[_0x149f9f]={'$like':'%'+_0x3bee45[_0xd2b5('0x37')][_0xd2b5('0x40')]+'%'};return _0xbdb212;})});}_0x20d0ab=_[_0xd2b5('0x55')]({},_0x20d0ab,_0x3bee45['options']);return _0x53e2a1['getConfigurations'](_0x20d0ab);}})['then'](function(_0x229e3e){if(_0x229e3e){_0x428445=_0x229e3e[_0xd2b5('0x4c')];if(!_0x3bee45[_0xd2b5('0x37')]['hasOwnProperty'](_0xd2b5('0x3c'))){_0x20d0ab[_0xd2b5('0x29')]=qs[_0xd2b5('0x29')](_0x3bee45[_0xd2b5('0x37')][_0xd2b5('0x29')]);_0x20d0ab['offset']=qs[_0xd2b5('0x28')](_0x3bee45[_0xd2b5('0x37')][_0xd2b5('0x28')]);}return _0x53e2a1[_0xd2b5('0x51')](_0x20d0ab);}})[_0xd2b5('0x1b')](function(_0x31fb1a){if(_0x31fb1a){return _0x31fb1a?{'count':_0x428445,'rows':_0x31fb1a}:null;}})['then'](respondWithResult(_0x1bab45,null))[_0xd2b5('0x4a')](handleError(_0x1bab45,null));};exports['addConfiguration']=function(_0x39a518,_0x5663c4,_0x18cd89){if(_0x39a518[_0xd2b5('0x4f')]['id']){delete _0x39a518[_0xd2b5('0x4f')]['id'];}return db[_0xd2b5('0x33')][_0xd2b5('0x52')]({'where':{'id':_0x39a518['params']['id']}})[_0xd2b5('0x1b')](handleEntityNotFound(_0x5663c4,null))[_0xd2b5('0x1b')](function(_0x16c1fa){if(_0x16c1fa){_0x39a518[_0xd2b5('0x4f')][_0xd2b5('0x56')]=_0x16c1fa['id'];_0x39a518[_0xd2b5('0x4f')][_0xd2b5('0x57')]=integrations[_0xd2b5('0x58')](_0x39a518[_0xd2b5('0x4f')][_0xd2b5('0x59')],_0x39a518[_0xd2b5('0x4f')][_0xd2b5('0x42')]);_0x39a518[_0xd2b5('0x4f')][_0xd2b5('0x5a')]=integrations['getDescriptions'](_0x39a518[_0xd2b5('0x4f')][_0xd2b5('0x59')],_0x39a518['body'][_0xd2b5('0x42')]);return db[_0xd2b5('0x53')]['create'](_0x39a518['body'],{'include':[{'model':db[_0xd2b5('0x5b')],'as':'Subjects'},{'model':db[_0xd2b5('0x5b')],'as':_0xd2b5('0x5a')}]});}return null;})[_0xd2b5('0x1b')](respondWithResult(_0x5663c4,null))[_0xd2b5('0x4a')](handleError(_0x5663c4,null));};exports[_0xd2b5('0x5c')]=function(_0x8927e7,_0x39a7dd,_0x5e8589){var _0x1b680d=_0x8927e7[_0xd2b5('0x37')]['ticketType'];var _0x34f77e=_0x1b680d==='incident'?_0xd2b5('0x5d'):_0xd2b5('0x5e');var _0x335e97='';var _0xe4b975='';var _0x31ba22='';var _0x319aa3='';var _0xeca27a='';var _0x38e094='';var _0x237389='';var _0x5e8e81='';var _0x1c1b74=[_0xd2b5('0x5f'),'description',_0xd2b5('0x60'),_0xd2b5('0x61'),_0xd2b5('0x62'),_0xd2b5('0x63'),_0xd2b5('0x64'),_0xd2b5('0x65'),_0xd2b5('0x66'),_0xd2b5('0x67')];var _0x430154=[_0xd2b5('0x68'),_0xd2b5('0x69'),_0xd2b5('0x6a'),_0xd2b5('0x6b'),'contactidname',_0xd2b5('0x6c'),_0xd2b5('0x6d'),_0xd2b5('0x6e'),_0xd2b5('0x6f'),_0xd2b5('0x70'),_0xd2b5('0x71'),'createdbyyominame',_0xd2b5('0x72'),_0xd2b5('0x73'),_0xd2b5('0x74'),_0xd2b5('0x75'),_0xd2b5('0x76'),_0xd2b5('0x77'),_0xd2b5('0x78'),_0xd2b5('0x79'),_0xd2b5('0x7a'),_0xd2b5('0x7b'),'escalatedon',_0xd2b5('0x7c'),_0xd2b5('0x7d'),_0xd2b5('0x7e'),_0xd2b5('0x7f'),'influencescore',_0xd2b5('0x80'),_0xd2b5('0x81'),'masteridname','modifiedbyexternalpartyname',_0xd2b5('0x82'),_0xd2b5('0x83'),_0xd2b5('0x84'),'modifiedon',_0xd2b5('0x85'),_0xd2b5('0x86'),_0xd2b5('0x87'),_0xd2b5('0x88'),_0xd2b5('0x89'),_0xd2b5('0x8a'),_0xd2b5('0x8b'),_0xd2b5('0x8c'),'owneridtype','owneridyominame',_0xd2b5('0x8d'),_0xd2b5('0x8e'),'primarycontactidyominame',_0xd2b5('0x8f'),'productidname',_0xd2b5('0x90'),_0xd2b5('0x91'),_0xd2b5('0x92'),_0xd2b5('0x93'),_0xd2b5('0x94'),_0xd2b5('0x95'),_0xd2b5('0x96'),'slainvokedidname',_0xd2b5('0x97'),_0xd2b5('0x98'),_0xd2b5('0x99'),'statuscode',_0xd2b5('0x9a'),'ticketnumber',_0xd2b5('0x9b'),_0xd2b5('0x9c'),_0xd2b5('0x9d'),_0xd2b5('0x9e'),_0xd2b5('0x9f')];var _0x15c66c=_0x1c1b74[_0xd2b5('0xa0')](_0x430154);return db[_0xd2b5('0x33')][_0xd2b5('0x52')]({'where':{'id':_0x8927e7[_0xd2b5('0x50')]['id']},'attributes':['id',_0xd2b5('0xa1'),_0xd2b5('0xa2'),_0xd2b5('0xa3'),_0xd2b5('0xa4'),_0xd2b5('0xa5'),_0xd2b5('0xa6')]})['then'](handleEntityNotFound(_0x39a7dd,null))[_0xd2b5('0x1b')](function(_0x5c7310){if(_0x5c7310){_0x5e8e81=_0x5c7310[_0xd2b5('0xa3')];var _0x13db90=_0x5e8e81[_0xd2b5('0xa7')](-0x1);if(_0x13db90==='/'){_0x5e8e81=_0x5e8e81[_0xd2b5('0xa8')](0x0,_0x5e8e81[_0xd2b5('0xa9')](_0x13db90));}_0x237389=util[_0xd2b5('0xaa')](_0xd2b5('0xab'),_0x5e8e81);var _0xadc359={'method':'POST','uri':_0xd2b5('0xac')+_0x5c7310[_0xd2b5('0xa4')]+'/oauth2/token','form':{'client_id':_0x5c7310[_0xd2b5('0xa5')],'resource':_0x5e8e81,'username':_0x5c7310[_0xd2b5('0xa1')],'password':_0x5c7310[_0xd2b5('0xa2')],'grant_type':_0xd2b5('0xa2'),'client_secret':_0x5c7310[_0xd2b5('0xa6')]},'json':!![]};return rp(_0xadc359);}})[_0xd2b5('0x1b')](function(_0x386fc2){_0x38e094=_0x386fc2['access_token'];var _0xef897d={'method':'GET','uri':encodeURI(_0x237389+_0xd2b5('0xad')+_0x34f77e+'\x27'),'headers':{'Authorization':_0xd2b5('0xae')+_0x38e094,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xef897d);})[_0xd2b5('0x1b')](function(_0x47d10d){var _0x3b845d=_0x47d10d[_0xd2b5('0xaf')][0x0];var _0x1997ab=_0x3b845d[_0xd2b5('0xb0')];var _0x106048={'method':_0xd2b5('0xb1'),'uri':_0x237389+_0xd2b5('0xb2')+_0x1997ab+_0xd2b5('0xb3'),'headers':{'Authorization':_0xd2b5('0xae')+_0x38e094,'If-None-Match':null,'OData-Version':_0xd2b5('0xb4')},'json':!![]};return rp(_0x106048);})[_0xd2b5('0x1b')](function(_0x1f39ed){_0x335e97=_0x1f39ed;_0xe4b975=_0x335e97[_0xd2b5('0xb5')];_0xe4b975=_[_0xd2b5('0xb6')](_0xe4b975,function(_0x22ed33){return!_0x15c66c[_0xd2b5('0xb7')](_0x22ed33['LogicalName']);});var _0xe11c8=[];var _0x38d9de=[];_0xe4b975['forEach'](function(_0x2367e7){if(_0x2367e7['@odata.type']){var _0x50c74c=_0x2367e7[_0xd2b5('0xb8')][_0xd2b5('0xa8')](_0x2367e7[_0xd2b5('0xb8')][_0xd2b5('0xa9')]('.')+0x1);if(_0x50c74c==='PicklistAttributeMetadata'){_0xe11c8[_0xd2b5('0xb9')](getSelectList(_0x237389,_0x1b680d,_0x38d9de,_0x335e97[_0xd2b5('0xb0')],_0x2367e7['MetadataId'],_0x38e094));}}});return Promise[_0xd2b5('0xba')](_0xe11c8);})[_0xd2b5('0x1b')](function(_0x3ea9df){_0x31ba22=_0x3ea9df[0x0];var _0xd95bbb=[];var _0xc35d9f=[];_0xe4b975[_0xd2b5('0xbb')](function(_0x226a22){if(!_[_0xd2b5('0xbc')](_0x226a22[_0xd2b5('0xb8')])){var _0x18497b=_0x226a22[_0xd2b5('0xb8')][_0xd2b5('0xa8')](_0x226a22[_0xd2b5('0xb8')][_0xd2b5('0xa9')]('.')+0x1);if(_0x18497b==='BooleanAttributeMetadata'){_0xd95bbb[_0xd2b5('0xb9')](getBooleanList(_0x237389,_0x1b680d,_0xc35d9f,_0x335e97['MetadataId'],_0x226a22[_0xd2b5('0xb0')],_0x38e094));}}});return Promise[_0xd2b5('0xba')](_0xd95bbb);})[_0xd2b5('0x1b')](function(_0x10728c){_0x319aa3=_0x10728c[0x0];var _0x29f1e4=[];var _0x2e1750=[];_0xe4b975['forEach'](function(_0xc106ab){if(_0xc106ab[_0xd2b5('0xb8')]){var _0x150f7b=_0xc106ab[_0xd2b5('0xb8')]['substring'](_0xc106ab[_0xd2b5('0xb8')][_0xd2b5('0xa9')]('.')+0x1);if(_0x150f7b===_0xd2b5('0xbd')||_0x150f7b===_0xd2b5('0xbe')||_0x150f7b==='BigIntAttributeMetadata'||_0x150f7b===_0xd2b5('0xbf')||_0x150f7b===_0xd2b5('0xc0')||_0x150f7b===_0xd2b5('0xc1')||_0x150f7b==='StatusAttributeMetadata'||_0x150f7b===_0xd2b5('0xc2')||_0x150f7b===_0xd2b5('0xc3')||_0x150f7b===_0xd2b5('0xc4')){_0x29f1e4['push'](getInputList(_0x237389,_0x1b680d,_0x150f7b,_0x2e1750,_0x335e97[_0xd2b5('0xb0')],_0xc106ab['MetadataId'],_0x38e094));}}});return Promise[_0xd2b5('0xba')](_0x29f1e4);})[_0xd2b5('0x1b')](function(_0x453b0e){_0xeca27a=_0x453b0e[0x0];var _0x5b8b5a=_0x31ba22[_0xd2b5('0xa0')](_0x319aa3)[_0xd2b5('0xa0')](_0xeca27a);var _0x231afc={'count':_0x5b8b5a['length'],'rows':_0x5b8b5a};return _0x231afc;})['then'](respondWithResult(_0x39a7dd,null))[_0xd2b5('0x4a')](function(_0x4f5b18){console[_0xd2b5('0xc5')](_0xd2b5('0xc6')+_0x4f5b18);var _0x480d63=_0x8927e7[_0xd2b5('0x37')][_0xd2b5('0xc7')]?0x1f4:_0x4f5b18[_0xd2b5('0xc8')]||0x1f4;logger[_0xd2b5('0x21')](_0x4f5b18[_0xd2b5('0x2f')]);delete _0x4f5b18[_0xd2b5('0x30')];if(_0x480d63===0x191){_0x480d63=0x190;}_0x39a7dd[_0xd2b5('0x25')](_0x480d63)['send'](_0x8927e7[_0xd2b5('0x37')][_0xd2b5('0xc7')]?{'message':_0xd2b5('0xc9'),'statusCode':_0x4f5b18[_0xd2b5('0xc8')]}:_0x4f5b18);});};function getSelectList(_0x1d1b0e,_0x3330cd,_0x473987,_0xe86b4e,_0x306309,_0x1d8e92){var _0x5ee0ca={'method':_0xd2b5('0xb1'),'uri':_0x1d1b0e+_0xd2b5('0xb2')+_0xe86b4e+_0xd2b5('0xca')+_0x306309+_0xd2b5('0xcb')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xd2b5('0xae')+_0x1d8e92,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5ee0ca)[_0xd2b5('0x1b')](function(_0x323605){var _0x2d2d97=[];var _0x279f8c=_0x323605['OptionSet'][_0xd2b5('0xcc')];_0x279f8c[_0xd2b5('0xbb')](function(_0xf24d65){_0x2d2d97[_0xd2b5('0xb9')]({'name':_0xf24d65[_0xd2b5('0xcd')][_0xd2b5('0xce')]['Label'],'value':String(_0xf24d65[_0xd2b5('0xcf')])});});var _0x696bee={'id':_0x3330cd+'_'+_0x323605[_0xd2b5('0xd0')],'name':_0x323605['DisplayName'][_0xd2b5('0xce')][_0xd2b5('0xcd')],'custom':![],'options':_0x2d2d97};_0x473987[_0xd2b5('0xb9')](_0x696bee);return _0x473987;});}function getBooleanList(_0x333f74,_0x41558e,_0x9c2303,_0x5df962,_0x1ee1b6,_0x3c9470){var _0x52f185={'method':_0xd2b5('0xb1'),'uri':_0x333f74+_0xd2b5('0xb2')+_0x5df962+_0xd2b5('0xca')+_0x1ee1b6+_0xd2b5('0xd1'),'headers':{'Authorization':_0xd2b5('0xae')+_0x3c9470,'If-None-Match':null,'OData-Version':_0xd2b5('0xb4')},'json':!![]};return rp(_0x52f185)[_0xd2b5('0x1b')](function(_0x252d3c){var _0x22b281=[];_0x22b281['push']({'name':_0x252d3c['OptionSet'][_0xd2b5('0xd2')][_0xd2b5('0xcd')]['UserLocalizedLabel'][_0xd2b5('0xcd')],'value':_0xd2b5('0xd3')},{'name':_0x252d3c[_0xd2b5('0xd4')]['FalseOption'][_0xd2b5('0xcd')][_0xd2b5('0xce')][_0xd2b5('0xcd')],'value':'false'});var _0x349d55={'id':_0x41558e+'_'+_0x252d3c[_0xd2b5('0xd0')],'name':_0x252d3c[_0xd2b5('0xd5')][_0xd2b5('0xce')][_0xd2b5('0xcd')],'custom':![],'options':_0x22b281};_0x9c2303[_0xd2b5('0xb9')](_0x349d55);return _0x9c2303;});}function getInputList(_0xef51cf,_0x4be8d2,_0x37c1ae,_0x1863b7,_0xef38cc,_0x2b2c76,_0xacd330){var _0x162230={'method':_0xd2b5('0xb1'),'uri':_0xef51cf+'EntityDefinitions('+_0xef38cc+')/Attributes('+_0x2b2c76+')/Microsoft.Dynamics.CRM.'+_0x37c1ae+_0xd2b5('0xd6'),'headers':{'Authorization':'Bearer\x20'+_0xacd330,'If-None-Match':null,'OData-Version':_0xd2b5('0xb4')},'json':!![]};return rp(_0x162230)[_0xd2b5('0x1b')](function(_0x126bfa){var _0x1a58fd={'id':_0x4be8d2+'_'+_0x126bfa[_0xd2b5('0xd0')],'name':_0x126bfa[_0xd2b5('0xd5')]['UserLocalizedLabel']?_0x126bfa[_0xd2b5('0xd5')][_0xd2b5('0xce')]['Label']:_0x126bfa[_0xd2b5('0xd0')],'custom':![],'options':[]};_0x1863b7[_0xd2b5('0xb9')](_0x1a58fd);return _0x1863b7;});} \ No newline at end of file +var _0xb846=['params','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','lastIndexOf','format','%s/api/data/v9.0/','POST','tenantId','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','log','Dynamics365\x20error:\x20','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','Dynamics365Account','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','VIRTUAL','options','include','rows','catch','show'];(function(_0x177ef9,_0x59ec1a){var _0x11f0fa=function(_0x32b65e){while(--_0x32b65e){_0x177ef9['push'](_0x177ef9['shift']());}};_0x11f0fa(++_0x59ec1a);}(_0xb846,0x15f));var _0x6b84=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb846[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require(_0x6b84('0x0'));var emlformat=require(_0x6b84('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6b84('0x2'));var jsonpatch=require(_0x6b84('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6b84('0x4'));var Mustache=require(_0x6b84('0x5'));var util=require(_0x6b84('0x6'));var path=require(_0x6b84('0x7'));var sox=require(_0x6b84('0x8'));var csv=require(_0x6b84('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b84('0xa'));var squel=require(_0x6b84('0xb'));var crypto=require(_0x6b84('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6b84('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6b84('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6b84('0xf'));var qs=require(_0x6b84('0x10'));var logger=require(_0x6b84('0x11'))(_0x6b84('0x12'));var utils=require('../../config/utils');var config=require(_0x6b84('0x13'));var db=require(_0x6b84('0x14'))['db'];var integrations=require(_0x6b84('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x6b84('0x16')][_0x6b84('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4cb562,_0x452ce9,_0x2bb213,_0x7fdca2){return new BPromise(function(_0x50685d,_0x2ed246){var _0x5d1c76=_0x7fdca2||client;return _0x5d1c76[_0x6b84('0x18')](_0x4cb562,_0x2bb213)['then'](function(_0x383126){logger[_0x6b84('0x19')](_0x6b84('0x1a'),_0x452ce9,_0x6b84('0x1b'));logger[_0x6b84('0x1c')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x452ce9,_0x6b84('0x1b'),JSON[_0x6b84('0x1d')](_0x383126));if(_0x383126[_0x6b84('0x1e')]){if(_0x383126[_0x6b84('0x1e')]['code']===0x1f4){logger['error'](_0x6b84('0x1a'),_0x452ce9,_0x383126[_0x6b84('0x1e')][_0x6b84('0x1f')]);return _0x2ed246(_0x383126[_0x6b84('0x1e')][_0x6b84('0x1f')]);}logger[_0x6b84('0x1e')](_0x6b84('0x1a'),_0x452ce9,_0x383126['error']['message']);return _0x50685d(_0x383126[_0x6b84('0x1e')][_0x6b84('0x1f')]);}else{logger['info'](_0x6b84('0x1a'),_0x452ce9,_0x6b84('0x1b'));_0x50685d(_0x383126['result'][_0x6b84('0x1f')]);}})['catch'](function(_0x416fc2){logger[_0x6b84('0x1e')](_0x6b84('0x1a'),_0x452ce9,_0x416fc2);_0x2ed246(_0x416fc2);});});}function respondWithStatusCode(_0x562a60,_0x2ea855){_0x2ea855=_0x2ea855||0xcc;return function(_0x1f6965){if(_0x1f6965){return _0x562a60[_0x6b84('0x20')](_0x2ea855);}return _0x562a60[_0x6b84('0x21')](_0x2ea855)[_0x6b84('0x22')]();};}function respondWithResult(_0x25b227,_0x7b228b){_0x7b228b=_0x7b228b||0xc8;return function(_0x9f8c0f){if(_0x9f8c0f){return _0x25b227[_0x6b84('0x21')](_0x7b228b)[_0x6b84('0x23')](_0x9f8c0f);}};}function respondWithFilteredResult(_0x92b637,_0x32e24e){return function(_0x489ffa){if(_0x489ffa){var _0x54eab2=_0x489ffa[_0x6b84('0x24')],_0x538da9=_0x32e24e[_0x6b84('0x25')],_0x36e99c=_0x32e24e[_0x6b84('0x25')]+_0x32e24e['limit'],_0x28fc91;if(_0x36e99c>=_0x54eab2){_0x36e99c=_0x54eab2;_0x28fc91=0xc8;}else{_0x28fc91=0xce;}_0x92b637['status'](_0x28fc91);return _0x92b637[_0x6b84('0x26')](_0x6b84('0x27'),_0x538da9+'-'+_0x36e99c+'/'+_0x54eab2)[_0x6b84('0x23')](_0x489ffa);}return null;};}function patchUpdates(_0x259f34){return function(_0x201619){try{jsonpatch[_0x6b84('0x28')](_0x201619,_0x259f34,!![]);}catch(_0x4d45ff){return BPromise['reject'](_0x4d45ff);}return _0x201619[_0x6b84('0x29')]();};}function saveUpdates(_0x147a63,_0x6b689b){return function(_0x43c6d1){if(_0x43c6d1){return _0x43c6d1[_0x6b84('0x2a')](_0x147a63)['then'](function(_0x333ae1){return _0x333ae1;});}return null;};}function removeEntity(_0x5870f0,_0x2048f1){return function(_0x46a327){if(_0x46a327){return _0x46a327['destroy']()[_0x6b84('0x2b')](function(){_0x5870f0['status'](0xcc)[_0x6b84('0x22')]();});}};}function handleEntityNotFound(_0x33d455,_0x26cc4f){return function(_0x100ed2){if(!_0x100ed2){_0x33d455['sendStatus'](0x194);}return _0x100ed2;};}function handleError(_0x5308d2,_0x537f7e){_0x537f7e=_0x537f7e||0x1f4;return function(_0x3e73e3){logger[_0x6b84('0x1e')](_0x3e73e3[_0x6b84('0x2c')]);if(_0x3e73e3['name']){delete _0x3e73e3[_0x6b84('0x2d')];}_0x5308d2[_0x6b84('0x21')](_0x537f7e)[_0x6b84('0x2e')](_0x3e73e3);};}exports[_0x6b84('0x2f')]=function(_0x1ad3c3,_0x38f3b1){var _0x20ccca={},_0x58a906={},_0x5b7a6d={'count':0x0,'rows':[]};var _0x548685=db[_0x6b84('0x30')]['rawAttributes'];_0x58a906['model']=_[_0x6b84('0x31')](_0x548685);_0x58a906[_0x6b84('0x32')]=_[_0x6b84('0x31')](_0x1ad3c3[_0x6b84('0x32')]);_0x58a906[_0x6b84('0x33')]=_[_0x6b84('0x34')](_0x58a906[_0x6b84('0x35')],_0x58a906[_0x6b84('0x32')]);_0x20ccca[_0x6b84('0x36')]=_[_0x6b84('0x34')](_0x58a906[_0x6b84('0x35')],qs[_0x6b84('0x37')](_0x1ad3c3[_0x6b84('0x32')][_0x6b84('0x37')]));_0x20ccca[_0x6b84('0x36')]=_0x20ccca[_0x6b84('0x36')][_0x6b84('0x38')]?_0x20ccca[_0x6b84('0x36')]:_0x58a906[_0x6b84('0x35')];if(!_0x1ad3c3[_0x6b84('0x32')][_0x6b84('0x39')](_0x6b84('0x3a'))){_0x20ccca[_0x6b84('0x3b')]=qs['limit'](_0x1ad3c3[_0x6b84('0x32')]['limit']);_0x20ccca[_0x6b84('0x25')]=qs[_0x6b84('0x25')](_0x1ad3c3[_0x6b84('0x32')][_0x6b84('0x25')]);}_0x20ccca[_0x6b84('0x3c')]=qs[_0x6b84('0x3d')](_0x1ad3c3[_0x6b84('0x32')][_0x6b84('0x3d')]);_0x20ccca[_0x6b84('0x3e')]=qs[_0x6b84('0x33')](_['pick'](_0x1ad3c3['query'],_0x58a906[_0x6b84('0x33')]));if(_0x1ad3c3['query'][_0x6b84('0x3f')]){_0x20ccca[_0x6b84('0x3e')]=_[_0x6b84('0x40')](_0x20ccca[_0x6b84('0x3e')],{'$or':_[_0x6b84('0x41')](_0x548685,function(_0x18f083){if(_0x18f083[_0x6b84('0x42')]['key']!==_0x6b84('0x43')){var _0x52ac10={};_0x52ac10[_0x18f083['field']]={'$like':'%'+_0x1ad3c3[_0x6b84('0x32')]['filter']+'%'};return _0x52ac10;}})});}_0x20ccca=_[_0x6b84('0x40')]({},_0x20ccca,_0x1ad3c3[_0x6b84('0x44')]);var _0x2b2aff={'where':_0x20ccca[_0x6b84('0x3e')]};return db[_0x6b84('0x30')][_0x6b84('0x24')](_0x2b2aff)[_0x6b84('0x2b')](function(_0x43c6f9){_0x5b7a6d['count']=_0x43c6f9;if(_0x1ad3c3[_0x6b84('0x32')]['includeAll']){_0x20ccca[_0x6b84('0x45')]=[{'all':!![]}];}return db[_0x6b84('0x30')]['findAll'](_0x20ccca);})['then'](function(_0x4e996f){_0x5b7a6d[_0x6b84('0x46')]=_0x4e996f;return _0x5b7a6d;})[_0x6b84('0x2b')](respondWithFilteredResult(_0x38f3b1,_0x20ccca))[_0x6b84('0x47')](handleError(_0x38f3b1,null));};exports[_0x6b84('0x48')]=function(_0x5d113c,_0x254bce){var _0x165e21={'raw':![],'where':{'id':_0x5d113c[_0x6b84('0x49')]['id']}},_0x3fe542={};_0x3fe542[_0x6b84('0x35')]=_[_0x6b84('0x31')](db[_0x6b84('0x30')]['rawAttributes']);_0x3fe542[_0x6b84('0x32')]=_[_0x6b84('0x31')](_0x5d113c[_0x6b84('0x32')]);_0x3fe542[_0x6b84('0x33')]=_[_0x6b84('0x34')](_0x3fe542[_0x6b84('0x35')],_0x3fe542[_0x6b84('0x32')]);_0x165e21[_0x6b84('0x36')]=_[_0x6b84('0x34')](_0x3fe542['model'],qs[_0x6b84('0x37')](_0x5d113c[_0x6b84('0x32')]['fields']));_0x165e21[_0x6b84('0x36')]=_0x165e21['attributes'][_0x6b84('0x38')]?_0x165e21['attributes']:_0x3fe542[_0x6b84('0x35')];if(_0x5d113c[_0x6b84('0x32')]['includeAll']){_0x165e21[_0x6b84('0x45')]=[{'all':!![]}];}_0x165e21=_[_0x6b84('0x40')]({},_0x165e21,_0x5d113c['options']);return db['Dynamics365Account'][_0x6b84('0x4a')](_0x165e21)['then'](handleEntityNotFound(_0x254bce,null))[_0x6b84('0x2b')](respondWithResult(_0x254bce,null))[_0x6b84('0x47')](handleError(_0x254bce,null));};exports[_0x6b84('0x4b')]=function(_0x1c7fc1,_0x5bcf82){return db[_0x6b84('0x30')][_0x6b84('0x4b')](_0x1c7fc1[_0x6b84('0x4c')],{})[_0x6b84('0x2b')](respondWithResult(_0x5bcf82,0xc9))[_0x6b84('0x47')](handleError(_0x5bcf82,null));};exports[_0x6b84('0x2a')]=function(_0x35cc07,_0x7cefbe){if(_0x35cc07[_0x6b84('0x4c')]['id']){delete _0x35cc07[_0x6b84('0x4c')]['id'];}return db[_0x6b84('0x30')]['find']({'where':{'id':_0x35cc07[_0x6b84('0x49')]['id']}})[_0x6b84('0x2b')](handleEntityNotFound(_0x7cefbe,null))['then'](saveUpdates(_0x35cc07[_0x6b84('0x4c')],null))[_0x6b84('0x2b')](respondWithResult(_0x7cefbe,null))[_0x6b84('0x47')](handleError(_0x7cefbe,null));};exports[_0x6b84('0x4d')]=function(_0x4ee96c,_0x286bfe){return db[_0x6b84('0x30')][_0x6b84('0x4a')]({'where':{'id':_0x4ee96c[_0x6b84('0x49')]['id']}})[_0x6b84('0x2b')](handleEntityNotFound(_0x286bfe,null))[_0x6b84('0x2b')](removeEntity(_0x286bfe,null))[_0x6b84('0x47')](handleError(_0x286bfe,null));};exports[_0x6b84('0x4e')]=function(_0x39ca36,_0x50a5b2,_0x3c9239){var _0x3bf4bb={};var _0x530b5a={};var _0x2da006;var _0x3f7893;return db[_0x6b84('0x30')][_0x6b84('0x4f')]({'where':{'id':_0x39ca36[_0x6b84('0x49')]['id']}})['then'](handleEntityNotFound(_0x50a5b2,null))[_0x6b84('0x2b')](function(_0x28919b){if(_0x28919b){_0x2da006=_0x28919b;_0x530b5a[_0x6b84('0x35')]=_[_0x6b84('0x31')](db[_0x6b84('0x50')]['rawAttributes']);_0x530b5a['query']=_['keys'](_0x39ca36[_0x6b84('0x32')]);_0x530b5a[_0x6b84('0x33')]=_['intersection'](_0x530b5a[_0x6b84('0x35')],_0x530b5a[_0x6b84('0x32')]);_0x3bf4bb['attributes']=_[_0x6b84('0x34')](_0x530b5a[_0x6b84('0x35')],qs[_0x6b84('0x37')](_0x39ca36[_0x6b84('0x32')]['fields']));_0x3bf4bb[_0x6b84('0x36')]=_0x3bf4bb[_0x6b84('0x36')][_0x6b84('0x38')]?_0x3bf4bb[_0x6b84('0x36')]:_0x530b5a[_0x6b84('0x35')];_0x3bf4bb['order']=qs[_0x6b84('0x3d')](_0x39ca36[_0x6b84('0x32')][_0x6b84('0x3d')]);_0x3bf4bb['where']=qs['filters'](_['pick'](_0x39ca36[_0x6b84('0x32')],_0x530b5a[_0x6b84('0x33')]));if(_0x39ca36[_0x6b84('0x32')][_0x6b84('0x3f')]){_0x3bf4bb['where']=_['merge'](_0x3bf4bb[_0x6b84('0x3e')],{'$or':_[_0x6b84('0x41')](_0x3bf4bb[_0x6b84('0x36')],function(_0x59217a){var _0xd13a2f={};_0xd13a2f[_0x59217a]={'$like':'%'+_0x39ca36['query'][_0x6b84('0x3f')]+'%'};return _0xd13a2f;})});}_0x3bf4bb=_[_0x6b84('0x40')]({},_0x3bf4bb,_0x39ca36[_0x6b84('0x44')]);return _0x2da006[_0x6b84('0x4e')](_0x3bf4bb);}})[_0x6b84('0x2b')](function(_0x2e603a){if(_0x2e603a){_0x3f7893=_0x2e603a[_0x6b84('0x38')];if(!_0x39ca36[_0x6b84('0x32')][_0x6b84('0x39')](_0x6b84('0x3a'))){_0x3bf4bb[_0x6b84('0x3b')]=qs[_0x6b84('0x3b')](_0x39ca36['query']['limit']);_0x3bf4bb['offset']=qs[_0x6b84('0x25')](_0x39ca36[_0x6b84('0x32')][_0x6b84('0x25')]);}return _0x2da006[_0x6b84('0x4e')](_0x3bf4bb);}})[_0x6b84('0x2b')](function(_0x1adc86){if(_0x1adc86){return _0x1adc86?{'count':_0x3f7893,'rows':_0x1adc86}:null;}})[_0x6b84('0x2b')](respondWithResult(_0x50a5b2,null))['catch'](handleError(_0x50a5b2,null));};exports[_0x6b84('0x51')]=function(_0x1027d7,_0x1ebc6b,_0x13ef8f){if(_0x1027d7['body']['id']){delete _0x1027d7[_0x6b84('0x4c')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x1027d7[_0x6b84('0x49')]['id']}})[_0x6b84('0x2b')](handleEntityNotFound(_0x1ebc6b,null))[_0x6b84('0x2b')](function(_0x38fd22){if(_0x38fd22){_0x1027d7[_0x6b84('0x4c')][_0x6b84('0x52')]=_0x38fd22['id'];_0x1027d7[_0x6b84('0x4c')][_0x6b84('0x53')]=integrations[_0x6b84('0x54')](_0x1027d7[_0x6b84('0x4c')][_0x6b84('0x55')],_0x1027d7[_0x6b84('0x4c')][_0x6b84('0x42')]);_0x1027d7[_0x6b84('0x4c')][_0x6b84('0x56')]=integrations[_0x6b84('0x57')](_0x1027d7['body']['channel'],_0x1027d7[_0x6b84('0x4c')][_0x6b84('0x42')]);return db['Dynamics365Configuration'][_0x6b84('0x4b')](_0x1027d7[_0x6b84('0x4c')],{'include':[{'model':db[_0x6b84('0x58')],'as':_0x6b84('0x53')},{'model':db[_0x6b84('0x58')],'as':_0x6b84('0x56')}]});}return null;})[_0x6b84('0x2b')](respondWithResult(_0x1ebc6b,null))['catch'](handleError(_0x1ebc6b,null));};exports[_0x6b84('0x59')]=function(_0x25dfc5,_0x2dda44,_0x4f43fa){var _0x7a8a2c=_0x25dfc5[_0x6b84('0x32')][_0x6b84('0x5a')];var _0x818df2=_0x7a8a2c===_0x6b84('0x5b')?_0x6b84('0x5c'):_0x6b84('0x5d');var _0x47f226='';var _0xca88dd='';var _0x207823='';var _0x2677fe='';var _0x2c9f95='';var _0xf812bd='';var _0xad370b='';var _0x57a4fe='';var _0x5e0fc6=['title',_0x6b84('0x5e'),'customerid',_0x6b84('0x5f'),_0x6b84('0x60'),'subject',_0x6b84('0x61'),_0x6b84('0x62'),_0x6b84('0x63'),_0x6b84('0x64')];var _0xa2a76c=[_0x6b84('0x65'),'accountidyominame',_0x6b84('0x66'),_0x6b84('0x67'),_0x6b84('0x68'),_0x6b84('0x69'),_0x6b84('0x6a'),'contractidname',_0x6b84('0x6b'),_0x6b84('0x6c'),'createdbyname',_0x6b84('0x6d'),_0x6b84('0x6e'),_0x6b84('0x6f'),_0x6b84('0x70'),'customeridname',_0x6b84('0x71'),_0x6b84('0x72'),_0x6b84('0x73'),_0x6b84('0x74'),'entityimage_timestamp',_0x6b84('0x75'),_0x6b84('0x76'),_0x6b84('0x77'),_0x6b84('0x78'),'followupby',_0x6b84('0x79'),'influencescore',_0x6b84('0x7a'),_0x6b84('0x7b'),_0x6b84('0x7c'),_0x6b84('0x7d'),_0x6b84('0x7e'),_0x6b84('0x7f'),_0x6b84('0x80'),_0x6b84('0x81'),_0x6b84('0x82'),_0x6b84('0x83'),_0x6b84('0x84'),_0x6b84('0x85'),'numberofchildincidents',_0x6b84('0x86'),_0x6b84('0x87'),_0x6b84('0x88'),_0x6b84('0x89'),_0x6b84('0x8a'),'parentcaseidname','primarycontactidname',_0x6b84('0x8b'),_0x6b84('0x8c'),_0x6b84('0x8d'),'productserialnumber',_0x6b84('0x8e'),_0x6b84('0x8f'),'responseby',_0x6b84('0x90'),'responsiblecontactidyominame',_0x6b84('0x91'),_0x6b84('0x92'),_0x6b84('0x93'),_0x6b84('0x94'),_0x6b84('0x95'),_0x6b84('0x96'),_0x6b84('0x97'),_0x6b84('0x98'),_0x6b84('0x99'),_0x6b84('0x9a'),_0x6b84('0x9b'),_0x6b84('0x9c'),_0x6b84('0x9d')];var _0x4fafa5=_0x5e0fc6[_0x6b84('0x9e')](_0xa2a76c);return db[_0x6b84('0x30')][_0x6b84('0x4f')]({'where':{'id':_0x25dfc5[_0x6b84('0x49')]['id']},'attributes':['id',_0x6b84('0x9f'),_0x6b84('0xa0'),_0x6b84('0xa1'),'tenantId',_0x6b84('0xa2'),_0x6b84('0xa3')]})[_0x6b84('0x2b')](handleEntityNotFound(_0x2dda44,null))[_0x6b84('0x2b')](function(_0x1c2709){if(_0x1c2709){_0x57a4fe=_0x1c2709[_0x6b84('0xa1')];var _0x5c60c1=_0x57a4fe['slice'](-0x1);if(_0x5c60c1==='/'){_0x57a4fe=_0x57a4fe['substring'](0x0,_0x57a4fe[_0x6b84('0xa4')](_0x5c60c1));}_0xad370b=util[_0x6b84('0xa5')](_0x6b84('0xa6'),_0x57a4fe);var _0x34fcd2={'method':_0x6b84('0xa7'),'uri':'https://login.microsoftonline.com/'+_0x1c2709[_0x6b84('0xa8')]+'/oauth2/token','form':{'client_id':_0x1c2709[_0x6b84('0xa2')],'resource':_0x57a4fe,'username':_0x1c2709['username'],'password':_0x1c2709[_0x6b84('0xa0')],'grant_type':_0x6b84('0xa0'),'client_secret':_0x1c2709[_0x6b84('0xa3')]},'json':!![]};return rp(_0x34fcd2);}})[_0x6b84('0x2b')](function(_0x35b6f2){_0xf812bd=_0x35b6f2[_0x6b84('0xa9')];var _0x27348a={'method':'GET','uri':encodeURI(_0xad370b+_0x6b84('0xaa')+_0x818df2+'\x27'),'headers':{'Authorization':_0x6b84('0xab')+_0xf812bd,'If-None-Match':null,'OData-Version':_0x6b84('0xac')},'json':!![]};return rp(_0x27348a);})['then'](function(_0x523d39){var _0x1ca77b=_0x523d39['value'][0x0];var _0x567f1b=_0x1ca77b[_0x6b84('0xad')];var _0x506dc5={'method':_0x6b84('0xae'),'uri':_0xad370b+_0x6b84('0xaf')+_0x567f1b+_0x6b84('0xb0'),'headers':{'Authorization':_0x6b84('0xab')+_0xf812bd,'If-None-Match':null,'OData-Version':_0x6b84('0xac')},'json':!![]};return rp(_0x506dc5);})[_0x6b84('0x2b')](function(_0x240344){_0x47f226=_0x240344;_0xca88dd=_0x47f226[_0x6b84('0xb1')];_0xca88dd=_['remove'](_0xca88dd,function(_0x2d7aea){return!_0x4fafa5[_0x6b84('0xb2')](_0x2d7aea[_0x6b84('0xb3')]);});var _0x48787c=[];var _0x167952=[];_0xca88dd[_0x6b84('0xb4')](function(_0x2a7693){if(_0x2a7693[_0x6b84('0xb5')]){var _0x26e1c4=_0x2a7693[_0x6b84('0xb5')][_0x6b84('0xb6')](_0x2a7693[_0x6b84('0xb5')]['lastIndexOf']('.')+0x1);if(_0x26e1c4===_0x6b84('0xb7')){_0x48787c[_0x6b84('0xb8')](getSelectList(_0xad370b,_0x7a8a2c,_0x167952,_0x47f226[_0x6b84('0xad')],_0x2a7693[_0x6b84('0xad')],_0xf812bd));}}});return Promise[_0x6b84('0xb9')](_0x48787c);})['then'](function(_0x5259c1){_0x207823=_0x5259c1[0x0];var _0xa01d6c=[];var _0x504333=[];_0xca88dd[_0x6b84('0xb4')](function(_0x2b3929){if(!_['isNil'](_0x2b3929[_0x6b84('0xb5')])){var _0x23bafa=_0x2b3929[_0x6b84('0xb5')]['substring'](_0x2b3929[_0x6b84('0xb5')]['lastIndexOf']('.')+0x1);if(_0x23bafa===_0x6b84('0xba')){_0xa01d6c[_0x6b84('0xb8')](getBooleanList(_0xad370b,_0x7a8a2c,_0x504333,_0x47f226[_0x6b84('0xad')],_0x2b3929[_0x6b84('0xad')],_0xf812bd));}}});return Promise[_0x6b84('0xb9')](_0xa01d6c);})[_0x6b84('0x2b')](function(_0x1e04df){_0x2677fe=_0x1e04df[0x0];var _0x1619ed=[];var _0x2f9ef3=[];_0xca88dd[_0x6b84('0xb4')](function(_0x6fa8c9){if(_0x6fa8c9['@odata.type']){var _0x44fd19=_0x6fa8c9[_0x6b84('0xb5')]['substring'](_0x6fa8c9[_0x6b84('0xb5')][_0x6b84('0xa4')]('.')+0x1);if(_0x44fd19===_0x6b84('0xbb')||_0x44fd19===_0x6b84('0xbc')||_0x44fd19===_0x6b84('0xbd')||_0x44fd19==='IntegerAttributeMetadata'||_0x44fd19===_0x6b84('0xbe')||_0x44fd19==='DateTimeAttributeMetadata'||_0x44fd19===_0x6b84('0xbf')||_0x44fd19===_0x6b84('0xc0')||_0x44fd19===_0x6b84('0xc1')||_0x44fd19==='DecimalAttributeMetadata'){_0x1619ed['push'](getInputList(_0xad370b,_0x7a8a2c,_0x44fd19,_0x2f9ef3,_0x47f226[_0x6b84('0xad')],_0x6fa8c9[_0x6b84('0xad')],_0xf812bd));}}});return Promise[_0x6b84('0xb9')](_0x1619ed);})[_0x6b84('0x2b')](function(_0x55c5c2){_0x2c9f95=_0x55c5c2[0x0];var _0x481cf0=_0x207823[_0x6b84('0x9e')](_0x2677fe)[_0x6b84('0x9e')](_0x2c9f95);var _0x8e9339={'count':_0x481cf0[_0x6b84('0x38')],'rows':_0x481cf0};return _0x8e9339;})[_0x6b84('0x2b')](respondWithResult(_0x2dda44,null))['catch'](function(_0x1dca5d){console[_0x6b84('0xc2')](_0x6b84('0xc3')+_0x1dca5d);var _0x234217=_0x25dfc5[_0x6b84('0x32')]['test']?0x1f4:_0x1dca5d[_0x6b84('0xc4')]||0x1f4;logger[_0x6b84('0x1e')](_0x1dca5d['stack']);delete _0x1dca5d['name'];if(_0x234217===0x191){_0x234217=0x190;}_0x2dda44[_0x6b84('0x21')](_0x234217)['send'](_0x25dfc5[_0x6b84('0x32')]['test']?{'message':_0x6b84('0xc5'),'statusCode':_0x1dca5d[_0x6b84('0xc4')]}:_0x1dca5d);});};function getSelectList(_0x47b2b1,_0x5374c1,_0x53f6e6,_0x5da3a5,_0x502972,_0x58eb70){var _0x5c99f1={'method':_0x6b84('0xae'),'uri':_0x47b2b1+_0x6b84('0xaf')+_0x5da3a5+_0x6b84('0xc6')+_0x502972+_0x6b84('0xc7')+_0x6b84('0xc8'),'headers':{'Authorization':_0x6b84('0xab')+_0x58eb70,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5c99f1)['then'](function(_0x1b07b0){var _0x1f91f4=[];var _0x55415e=_0x1b07b0[_0x6b84('0xc9')][_0x6b84('0xca')];_0x55415e[_0x6b84('0xb4')](function(_0x2f4f59){_0x1f91f4[_0x6b84('0xb8')]({'name':_0x2f4f59[_0x6b84('0xcb')][_0x6b84('0xcc')][_0x6b84('0xcb')],'value':String(_0x2f4f59[_0x6b84('0xcd')])});});var _0x4c49fc={'id':_0x5374c1+'_'+_0x1b07b0[_0x6b84('0xb3')],'name':_0x1b07b0[_0x6b84('0xce')][_0x6b84('0xcc')][_0x6b84('0xcb')],'custom':![],'options':_0x1f91f4};_0x53f6e6['push'](_0x4c49fc);return _0x53f6e6;});}function getBooleanList(_0x2e6133,_0x478c24,_0x160a0d,_0x58652c,_0x301729,_0x2384d6){var _0x186b39={'method':_0x6b84('0xae'),'uri':_0x2e6133+_0x6b84('0xaf')+_0x58652c+_0x6b84('0xc6')+_0x301729+_0x6b84('0xcf'),'headers':{'Authorization':_0x6b84('0xab')+_0x2384d6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x186b39)[_0x6b84('0x2b')](function(_0x194d10){var _0x22b807=[];_0x22b807[_0x6b84('0xb8')]({'name':_0x194d10[_0x6b84('0xc9')][_0x6b84('0xd0')][_0x6b84('0xcb')][_0x6b84('0xcc')][_0x6b84('0xcb')],'value':_0x6b84('0xd1')},{'name':_0x194d10[_0x6b84('0xc9')]['FalseOption'][_0x6b84('0xcb')][_0x6b84('0xcc')][_0x6b84('0xcb')],'value':_0x6b84('0xd2')});var _0x19c565={'id':_0x478c24+'_'+_0x194d10[_0x6b84('0xb3')],'name':_0x194d10[_0x6b84('0xce')]['UserLocalizedLabel'][_0x6b84('0xcb')],'custom':![],'options':_0x22b807};_0x160a0d[_0x6b84('0xb8')](_0x19c565);return _0x160a0d;});}function getInputList(_0xf907b4,_0x187699,_0x53fa7a,_0x40a923,_0xd4197e,_0x2427eb,_0xa1dabc){var _0x160f3d={'method':_0x6b84('0xae'),'uri':_0xf907b4+_0x6b84('0xaf')+_0xd4197e+')/Attributes('+_0x2427eb+')/Microsoft.Dynamics.CRM.'+_0x53fa7a+_0x6b84('0xd3'),'headers':{'Authorization':_0x6b84('0xab')+_0xa1dabc,'If-None-Match':null,'OData-Version':_0x6b84('0xac')},'json':!![]};return rp(_0x160f3d)[_0x6b84('0x2b')](function(_0x1b4d83){var _0x382393={'id':_0x187699+'_'+_0x1b4d83['LogicalName'],'name':_0x1b4d83['DisplayName'][_0x6b84('0xcc')]?_0x1b4d83['DisplayName']['UserLocalizedLabel'][_0x6b84('0xcb')]:_0x1b4d83['LogicalName'],'custom':![],'options':[]};_0x40a923[_0x6b84('0xb8')](_0x382393);return _0x40a923;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 2082ef6..50abcc2 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 _0x00dc=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','./intDynamics365Account.attributes','../../components/integrations/configuration','define','Dynamics365Account'];(function(_0xfcee03,_0x53e5e5){var _0x381cfb=function(_0x45106a){while(--_0x45106a){_0xfcee03['push'](_0xfcee03['shift']());}};_0x381cfb(++_0x53e5e5);}(_0x00dc,0xd9));var _0xc00d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x00dc[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xc00d('0x0'));var util=require('util');var logger=require(_0xc00d('0x1'))('api');var moment=require(_0xc00d('0x2'));var BPromise=require('bluebird');var rp=require(_0xc00d('0x3'));var attributes=require(_0xc00d('0x4'));var integrations=require(_0xc00d('0x5'));module['exports']=function(_0x9440d1,_0x1fd755){return _0x9440d1[_0xc00d('0x6')](_0xc00d('0x7'),attributes,{'tableName':_0xc00d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde5c=['../../config/logger','api','moment','bluebird','request-promise','./intDynamics365Account.attributes','exports','define','Dynamics365Account','util'];(function(_0x3029b9,_0x5f35a4){var _0x18f206=function(_0x240f15){while(--_0x240f15){_0x3029b9['push'](_0x3029b9['shift']());}};_0x18f206(++_0x5f35a4);}(_0xde5c,0x1b7));var _0xcde5=function(_0x2679b0,_0x2a1a6f){_0x2679b0=_0x2679b0-0x0;var _0x192302=_0xde5c[_0x2679b0];return _0x192302;};'use strict';var _=require('lodash');var util=require(_0xcde5('0x0'));var logger=require(_0xcde5('0x1'))(_0xcde5('0x2'));var moment=require(_0xcde5('0x3'));var BPromise=require(_0xcde5('0x4'));var rp=require(_0xcde5('0x5'));var attributes=require(_0xcde5('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xcde5('0x7')]=function(_0x280482,_0x3d3075){return _0x280482[_0xcde5('0x8')](_0xcde5('0x9'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index f38266c..909895c 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 _0xd6a4=['message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowDynamics365Account','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x40d022,_0x4489a2){var _0x4720f6=function(_0x11593c){while(--_0x11593c){_0x40d022['push'](_0x40d022['shift']());}};_0x4720f6(++_0x4489a2);}(_0xd6a4,0x190));var _0x4d6a=function(_0x17fa0f,_0x4e1549){_0x17fa0f=_0x17fa0f-0x0;var _0x148de3=_0xd6a4[_0x17fa0f];return _0x148de3;};'use strict';var _=require(_0x4d6a('0x0'));var util=require(_0x4d6a('0x1'));var moment=require(_0x4d6a('0x2'));var BPromise=require(_0x4d6a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d6a('0x4'))['db'];var utils=require(_0x4d6a('0x5'));var logger=require(_0x4d6a('0x6'))('rpc');var config=require(_0x4d6a('0x7'));var jayson=require(_0x4d6a('0x8'));var client=jayson[_0x4d6a('0x9')][_0x4d6a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28fb2a,_0x397e82,_0x86e3){return new BPromise(function(_0x57ee33,_0x3efba2){return client[_0x4d6a('0xb')](_0x28fb2a,_0x86e3)[_0x4d6a('0xc')](function(_0x4cc7e1){logger[_0x4d6a('0xd')](_0x4d6a('0xe'),_0x397e82,_0x4d6a('0xf'));logger['debug'](_0x4d6a('0x10'),_0x397e82,_0x4d6a('0xf'),JSON[_0x4d6a('0x11')](_0x4cc7e1));if(_0x4cc7e1['error']){if(_0x4cc7e1[_0x4d6a('0x12')][_0x4d6a('0x13')]===0x1f4){logger[_0x4d6a('0x12')](_0x4d6a('0xe'),_0x397e82,_0x4cc7e1['error']['message']);return _0x3efba2(_0x4cc7e1[_0x4d6a('0x12')][_0x4d6a('0x14')]);}logger[_0x4d6a('0x12')](_0x4d6a('0xe'),_0x397e82,_0x4cc7e1[_0x4d6a('0x12')][_0x4d6a('0x14')]);return _0x57ee33(_0x4cc7e1[_0x4d6a('0x12')][_0x4d6a('0x14')]);}else{logger[_0x4d6a('0xd')](_0x4d6a('0xe'),_0x397e82,'request\x20sent');_0x57ee33(_0x4cc7e1['result'][_0x4d6a('0x14')]);}})[_0x4d6a('0x15')](function(_0x59f5b9){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x397e82,_0x59f5b9);_0x3efba2(_0x59f5b9);});});}exports[_0x4d6a('0x16')]=function(_0xc36b06){var _0xb42566=this;return new Promise(function(_0x27a698,_0x1b3adb){return db[_0x4d6a('0x17')][_0x4d6a('0x18')]({'raw':_0xc36b06[_0x4d6a('0x19')]?_0xc36b06[_0x4d6a('0x19')][_0x4d6a('0x1a')]===undefined?!![]:![]:!![],'where':_0xc36b06[_0x4d6a('0x19')]?_0xc36b06[_0x4d6a('0x19')][_0x4d6a('0x1b')]||null:null,'attributes':_0xc36b06[_0x4d6a('0x19')]?_0xc36b06[_0x4d6a('0x19')][_0x4d6a('0x1c')]||null:null,'limit':_0xc36b06[_0x4d6a('0x19')]?_0xc36b06[_0x4d6a('0x19')][_0x4d6a('0x1d')]||null:null,'include':_0xc36b06['options']?_0xc36b06['options'][_0x4d6a('0x1e')]?_['map'](_0xc36b06['options'][_0x4d6a('0x1e')],function(_0x5bd7c5){return{'model':db[_0x5bd7c5[_0x4d6a('0x1f')]],'as':_0x5bd7c5['as'],'attributes':_0x5bd7c5[_0x4d6a('0x1c')],'include':_0x5bd7c5[_0x4d6a('0x1e')]?_['map'](_0x5bd7c5['include'],function(_0x214f85){return{'model':db[_0x214f85[_0x4d6a('0x1f')]],'as':_0x214f85['as'],'attributes':_0x214f85[_0x4d6a('0x1c')],'include':_0x214f85[_0x4d6a('0x1e')]?_[_0x4d6a('0x20')](_0x214f85[_0x4d6a('0x1e')],function(_0x4c5ece){return{'model':db[_0x4c5ece[_0x4d6a('0x1f')]],'as':_0x4c5ece['as'],'attributes':_0x4c5ece[_0x4d6a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4d6a('0xc')](function(_0x297973){logger[_0x4d6a('0xd')](_0x4d6a('0x16'),_0xc36b06);logger[_0x4d6a('0x21')]('GetDynamics365Account',_0xc36b06,JSON['stringify'](_0x297973));_0x27a698(_0x297973);})[_0x4d6a('0x15')](function(_0x3f2c1f){logger[_0x4d6a('0x12')]('GetDynamics365Account',_0x3f2c1f['message'],_0xc36b06);_0x1b3adb(_0xb42566['error'](0x1f4,_0x3f2c1f['message']));});});};exports[_0x4d6a('0x22')]=function(_0x3f1f2a){var _0x281065=this;return new Promise(function(_0x3e0b65,_0x385c64){return db[_0x4d6a('0x17')]['find']({'raw':_0x3f1f2a[_0x4d6a('0x19')]?_0x3f1f2a[_0x4d6a('0x19')][_0x4d6a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f1f2a[_0x4d6a('0x19')]?_0x3f1f2a[_0x4d6a('0x19')][_0x4d6a('0x1b')]||null:null,'attributes':_0x3f1f2a[_0x4d6a('0x19')]?_0x3f1f2a[_0x4d6a('0x19')][_0x4d6a('0x1c')]||null:null,'include':_0x3f1f2a['options']?_0x3f1f2a['options'][_0x4d6a('0x1e')]?_[_0x4d6a('0x20')](_0x3f1f2a[_0x4d6a('0x19')]['include'],function(_0x469f8c){return{'model':db[_0x469f8c['model']],'as':_0x469f8c['as'],'attributes':_0x469f8c[_0x4d6a('0x1c')],'include':_0x469f8c['include']?_[_0x4d6a('0x20')](_0x469f8c[_0x4d6a('0x1e')],function(_0x3ee42e){return{'model':db[_0x3ee42e[_0x4d6a('0x1f')]],'as':_0x3ee42e['as'],'attributes':_0x3ee42e[_0x4d6a('0x1c')],'include':_0x3ee42e[_0x4d6a('0x1e')]?_[_0x4d6a('0x20')](_0x3ee42e[_0x4d6a('0x1e')],function(_0x45aa24){return{'model':db[_0x45aa24['model']],'as':_0x45aa24['as'],'attributes':_0x45aa24['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d6a('0xc')](function(_0x1d0f57){logger[_0x4d6a('0xd')]('ShowDynamics365Account',_0x3f1f2a);logger[_0x4d6a('0x21')](_0x4d6a('0x22'),_0x3f1f2a,JSON[_0x4d6a('0x11')](_0x1d0f57));_0x3e0b65(_0x1d0f57);})[_0x4d6a('0x15')](function(_0x21fd92){logger[_0x4d6a('0x12')]('ShowDynamics365Account',_0x21fd92[_0x4d6a('0x14')],_0x3f1f2a);_0x385c64(_0x281065[_0x4d6a('0x12')](0x1f4,_0x21fd92[_0x4d6a('0x14')]));});});}; \ No newline at end of file +var _0xe391=['../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','model','map','stringify','message','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xe391,0x15e));var _0x1e39=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xe391[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0x1e39('0x0'));var util=require(_0x1e39('0x1'));var moment=require(_0x1e39('0x2'));var BPromise=require(_0x1e39('0x3'));var rs=require(_0x1e39('0x4'));var fs=require('fs');var Redis=require(_0x1e39('0x5'));var db=require(_0x1e39('0x6'))['db'];var utils=require(_0x1e39('0x7'));var logger=require(_0x1e39('0x8'))(_0x1e39('0x9'));var config=require(_0x1e39('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1e39('0xb')][_0x1e39('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x182ccc,_0x17aa41,_0x15489d){return new BPromise(function(_0x4b3304,_0x2a8c06){return client[_0x1e39('0xd')](_0x182ccc,_0x15489d)[_0x1e39('0xe')](function(_0x1bcfa2){logger[_0x1e39('0xf')](_0x1e39('0x10'),_0x17aa41,'request\x20sent');logger[_0x1e39('0x11')](_0x1e39('0x12'),_0x17aa41,_0x1e39('0x13'),JSON['stringify'](_0x1bcfa2));if(_0x1bcfa2[_0x1e39('0x14')]){if(_0x1bcfa2[_0x1e39('0x14')]['code']===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x17aa41,_0x1bcfa2[_0x1e39('0x14')]['message']);return _0x2a8c06(_0x1bcfa2[_0x1e39('0x14')]['message']);}logger[_0x1e39('0x14')](_0x1e39('0x10'),_0x17aa41,_0x1bcfa2[_0x1e39('0x14')]['message']);return _0x4b3304(_0x1bcfa2[_0x1e39('0x14')]['message']);}else{logger[_0x1e39('0xf')](_0x1e39('0x10'),_0x17aa41,_0x1e39('0x13'));_0x4b3304(_0x1bcfa2['result']['message']);}})[_0x1e39('0x15')](function(_0xf7c5f){logger[_0x1e39('0x14')](_0x1e39('0x10'),_0x17aa41,_0xf7c5f);_0x2a8c06(_0xf7c5f);});});}exports[_0x1e39('0x16')]=function(_0x194978){var _0x3dccb8=this;return new Promise(function(_0x1ce04e,_0x5285d7){return db[_0x1e39('0x17')][_0x1e39('0x18')]({'raw':_0x194978[_0x1e39('0x19')]?_0x194978[_0x1e39('0x19')][_0x1e39('0x1a')]===undefined?!![]:![]:!![],'where':_0x194978[_0x1e39('0x19')]?_0x194978[_0x1e39('0x19')][_0x1e39('0x1b')]||null:null,'attributes':_0x194978[_0x1e39('0x19')]?_0x194978[_0x1e39('0x19')][_0x1e39('0x1c')]||null:null,'limit':_0x194978['options']?_0x194978[_0x1e39('0x19')]['limit']||null:null,'include':_0x194978[_0x1e39('0x19')]?_0x194978[_0x1e39('0x19')][_0x1e39('0x1d')]?_['map'](_0x194978[_0x1e39('0x19')][_0x1e39('0x1d')],function(_0x587010){return{'model':db[_0x587010[_0x1e39('0x1e')]],'as':_0x587010['as'],'attributes':_0x587010[_0x1e39('0x1c')],'include':_0x587010[_0x1e39('0x1d')]?_['map'](_0x587010[_0x1e39('0x1d')],function(_0x3070d9){return{'model':db[_0x3070d9['model']],'as':_0x3070d9['as'],'attributes':_0x3070d9['attributes'],'include':_0x3070d9['include']?_[_0x1e39('0x1f')](_0x3070d9[_0x1e39('0x1d')],function(_0x5e7121){return{'model':db[_0x5e7121[_0x1e39('0x1e')]],'as':_0x5e7121['as'],'attributes':_0x5e7121[_0x1e39('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e39('0xe')](function(_0x493c66){logger['info'](_0x1e39('0x16'),_0x194978);logger['debug'](_0x1e39('0x16'),_0x194978,JSON[_0x1e39('0x20')](_0x493c66));_0x1ce04e(_0x493c66);})[_0x1e39('0x15')](function(_0xe8af7){logger[_0x1e39('0x14')](_0x1e39('0x16'),_0xe8af7['message'],_0x194978);_0x5285d7(_0x3dccb8[_0x1e39('0x14')](0x1f4,_0xe8af7[_0x1e39('0x21')]));});});};exports[_0x1e39('0x22')]=function(_0x459eac){var _0x3b19e5=this;return new Promise(function(_0x749c63,_0x1cab09){return db[_0x1e39('0x17')][_0x1e39('0x23')]({'raw':_0x459eac['options']?_0x459eac[_0x1e39('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x459eac['options']?_0x459eac[_0x1e39('0x19')][_0x1e39('0x1b')]||null:null,'attributes':_0x459eac[_0x1e39('0x19')]?_0x459eac['options'][_0x1e39('0x1c')]||null:null,'include':_0x459eac[_0x1e39('0x19')]?_0x459eac[_0x1e39('0x19')][_0x1e39('0x1d')]?_[_0x1e39('0x1f')](_0x459eac[_0x1e39('0x19')][_0x1e39('0x1d')],function(_0x66270c){return{'model':db[_0x66270c[_0x1e39('0x1e')]],'as':_0x66270c['as'],'attributes':_0x66270c[_0x1e39('0x1c')],'include':_0x66270c[_0x1e39('0x1d')]?_[_0x1e39('0x1f')](_0x66270c['include'],function(_0x1976de){return{'model':db[_0x1976de['model']],'as':_0x1976de['as'],'attributes':_0x1976de[_0x1e39('0x1c')],'include':_0x1976de[_0x1e39('0x1d')]?_[_0x1e39('0x1f')](_0x1976de[_0x1e39('0x1d')],function(_0x486aa2){return{'model':db[_0x486aa2[_0x1e39('0x1e')]],'as':_0x486aa2['as'],'attributes':_0x486aa2[_0x1e39('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e39('0xe')](function(_0x4c440b){logger[_0x1e39('0xf')]('ShowDynamics365Account',_0x459eac);logger[_0x1e39('0x11')](_0x1e39('0x22'),_0x459eac,JSON['stringify'](_0x4c440b));_0x749c63(_0x4c440b);})[_0x1e39('0x15')](function(_0x1c9fad){logger[_0x1e39('0x14')](_0x1e39('0x22'),_0x1c9fad[_0x1e39('0x21')],_0x459eac);_0x1cab09(_0x3b19e5[_0x1e39('0x14')](0x1f4,_0x1c9fad[_0x1e39('0x21')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index fb824ad..2593f81 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 _0x1ae6=['get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getDescriptions','post','put','/:id','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3765ff,_0x16916e){var _0x333f28=function(_0x208816){while(--_0x208816){_0x3765ff['push'](_0x3765ff['shift']());}};_0x333f28(++_0x16916e);}(_0x1ae6,0x1b1));var _0x61ae=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1ae6[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require('multer');var util=require(_0x61ae('0x0'));var path=require(_0x61ae('0x1'));var timeout=require('connect-timeout');var express=require(_0x61ae('0x2'));var router=express[_0x61ae('0x3')]();var auth=require(_0x61ae('0x4'));var interaction=require(_0x61ae('0x5'));var config=require(_0x61ae('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0x61ae('0x7')]('/',auth[_0x61ae('0x8')](),controller[_0x61ae('0x9')]);router[_0x61ae('0x7')]('/:id',auth[_0x61ae('0x8')](),controller['show']);router[_0x61ae('0x7')](_0x61ae('0xa'),auth['isAuthenticated'](),controller[_0x61ae('0xb')]);router[_0x61ae('0x7')](_0x61ae('0xc'),auth[_0x61ae('0x8')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x61ae('0x8')](),controller[_0x61ae('0xd')]);router[_0x61ae('0xe')]('/',auth[_0x61ae('0x8')](),controller['create']);router[_0x61ae('0xf')](_0x61ae('0x10'),auth[_0x61ae('0x8')](),controller['update']);router[_0x61ae('0x11')](_0x61ae('0x10'),auth[_0x61ae('0x8')](),controller[_0x61ae('0x12')]);module[_0x61ae('0x13')]=router; \ No newline at end of file +var _0x216c=['update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x2a362a,_0x3c9015){var _0x3a77d9=function(_0x1cc012){while(--_0x1cc012){_0x2a362a['push'](_0x2a362a['shift']());}};_0x3a77d9(++_0x3c9015);}(_0x216c,0x1e7));var _0xc216=function(_0x3b544b,_0x34dc33){_0x3b544b=_0x3b544b-0x0;var _0x2119eb=_0x216c[_0x3b544b];return _0x2119eb;};'use strict';var multer=require('multer');var util=require(_0xc216('0x0'));var path=require('path');var timeout=require(_0xc216('0x1'));var express=require(_0xc216('0x2'));var router=express[_0xc216('0x3')]();var auth=require(_0xc216('0x4'));var interaction=require(_0xc216('0x5'));var config=require(_0xc216('0x6'));var controller=require(_0xc216('0x7'));router[_0xc216('0x8')]('/',auth[_0xc216('0x9')](),controller['index']);router[_0xc216('0x8')](_0xc216('0xa'),auth[_0xc216('0x9')](),controller[_0xc216('0xb')]);router[_0xc216('0x8')]('/:id/fields',auth[_0xc216('0x9')](),controller[_0xc216('0xc')]);router[_0xc216('0x8')](_0xc216('0xd'),auth[_0xc216('0x9')](),controller[_0xc216('0xe')]);router[_0xc216('0x8')](_0xc216('0xf'),auth['isAuthenticated'](),controller[_0xc216('0x10')]);router[_0xc216('0x11')]('/',auth[_0xc216('0x9')](),controller[_0xc216('0x12')]);router['put']('/:id',auth[_0xc216('0x9')](),controller[_0xc216('0x13')]);router[_0xc216('0x14')](_0xc216('0xa'),auth[_0xc216('0x9')](),controller[_0xc216('0x15')]);module[_0xc216('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 5d0821a..b30a447 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 _0x4d81=['exports','STRING','ENUM','phonecall','incident','sequelize'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x4d81,0x71));var _0x14d8=function(_0x3b1f9d,_0x45b691){_0x3b1f9d=_0x3b1f9d-0x0;var _0x1c6626=_0x4d81[_0x3b1f9d];return _0x1c6626;};'use strict';var Sequelize=require(_0x14d8('0x0'));module[_0x14d8('0x1')]={'name':{'type':Sequelize[_0x14d8('0x2')]},'description':{'type':Sequelize[_0x14d8('0x2')]},'ticketType':{'type':Sequelize[_0x14d8('0x3')]('incident',_0x14d8('0x4')),'defaultValue':_0x14d8('0x5')}}; \ No newline at end of file +var _0x0bb1=['phonecall','sequelize','ENUM','incident'];(function(_0x1b6a0f,_0x54ee7){var _0x62078f=function(_0x125377){while(--_0x125377){_0x1b6a0f['push'](_0x1b6a0f['shift']());}};_0x62078f(++_0x54ee7);}(_0x0bb1,0xcd));var _0x10bb=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x0bb1[_0x515afd];return _0x536d53;};'use strict';var Sequelize=require(_0x10bb('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x10bb('0x1')](_0x10bb('0x2'),_0x10bb('0x3')),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ab03ffc..2636b09 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 _0x84a0=['count','includeAll','include','findAll','rows','show','find','create','body','params','getFields','findOne','Dynamics365Field','map','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','type','field','options','Dynamics365Configuration'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x84a0,0x66));var _0x084a=function(_0x13e2b9,_0x1b04d6){_0x13e2b9=_0x13e2b9-0x0;var _0x400822=_0x84a0[_0x13e2b9];return _0x400822;};'use strict';var pdf=require(_0x084a('0x0'));var emlformat=require(_0x084a('0x1'));var rimraf=require(_0x084a('0x2'));var zipdir=require(_0x084a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x084a('0x4'));var moment=require(_0x084a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x084a('0x6'));var path=require(_0x084a('0x7'));var sox=require('sox');var csv=require(_0x084a('0x8'));var ejs=require(_0x084a('0x9'));var fs=require('fs');var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0x8'));var querystring=require(_0x084a('0xe'));var Papa=require(_0x084a('0xf'));var authService=require(_0x084a('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x084a('0x11'));var logger=require(_0x084a('0x12'))(_0x084a('0x13'));var utils=require(_0x084a('0x14'));var config=require(_0x084a('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x084a('0x16')][_0x084a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xec90a5,_0x9245b1,_0x1bdfb8,_0x414b05){return new BPromise(function(_0x3ff351,_0x3a76d1){var _0x5aef40=_0x414b05||client;return _0x5aef40[_0x084a('0x18')](_0xec90a5,_0x1bdfb8)['then'](function(_0x225de0){logger[_0x084a('0x19')](_0x084a('0x1a'),_0x9245b1,_0x084a('0x1b'));logger[_0x084a('0x1c')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x9245b1,_0x084a('0x1b'),JSON['stringify'](_0x225de0));if(_0x225de0[_0x084a('0x1d')]){if(_0x225de0[_0x084a('0x1d')]['code']===0x1f4){logger[_0x084a('0x1d')](_0x084a('0x1a'),_0x9245b1,_0x225de0[_0x084a('0x1d')][_0x084a('0x1e')]);return _0x3a76d1(_0x225de0[_0x084a('0x1d')][_0x084a('0x1e')]);}logger[_0x084a('0x1d')](_0x084a('0x1a'),_0x9245b1,_0x225de0[_0x084a('0x1d')][_0x084a('0x1e')]);return _0x3ff351(_0x225de0[_0x084a('0x1d')][_0x084a('0x1e')]);}else{logger[_0x084a('0x19')](_0x084a('0x1a'),_0x9245b1,_0x084a('0x1b'));_0x3ff351(_0x225de0['result'][_0x084a('0x1e')]);}})[_0x084a('0x1f')](function(_0x41a90f){logger[_0x084a('0x1d')](_0x084a('0x1a'),_0x9245b1,_0x41a90f);_0x3a76d1(_0x41a90f);});});}function respondWithStatusCode(_0x4865c8,_0x755c24){_0x755c24=_0x755c24||0xcc;return function(_0x288e9e){if(_0x288e9e){return _0x4865c8[_0x084a('0x20')](_0x755c24);}return _0x4865c8[_0x084a('0x21')](_0x755c24)[_0x084a('0x22')]();};}function respondWithResult(_0x3cdc1e,_0x5be167){_0x5be167=_0x5be167||0xc8;return function(_0x297e5b){if(_0x297e5b){return _0x3cdc1e[_0x084a('0x21')](_0x5be167)[_0x084a('0x23')](_0x297e5b);}};}function respondWithFilteredResult(_0x5b1474,_0x8806d5){return function(_0x3dd8b9){if(_0x3dd8b9){var _0xfc9b8c=_0x3dd8b9['count'],_0x4c5658=_0x8806d5[_0x084a('0x24')],_0x5596ac=_0x8806d5['offset']+_0x8806d5['limit'],_0x4874fe;if(_0x5596ac>=_0xfc9b8c){_0x5596ac=_0xfc9b8c;_0x4874fe=0xc8;}else{_0x4874fe=0xce;}_0x5b1474['status'](_0x4874fe);return _0x5b1474[_0x084a('0x25')](_0x084a('0x26'),_0x4c5658+'-'+_0x5596ac+'/'+_0xfc9b8c)[_0x084a('0x23')](_0x3dd8b9);}return null;};}function patchUpdates(_0x2c4149){return function(_0x3be7a6){try{jsonpatch[_0x084a('0x27')](_0x3be7a6,_0x2c4149,!![]);}catch(_0x378de6){return BPromise[_0x084a('0x28')](_0x378de6);}return _0x3be7a6['save']();};}function saveUpdates(_0x2ed3cd,_0x3b2b38){return function(_0x501a16){if(_0x501a16){return _0x501a16[_0x084a('0x29')](_0x2ed3cd)[_0x084a('0x2a')](function(_0x225000){return _0x225000;});}return null;};}function removeEntity(_0x19937c,_0x448ae9){return function(_0x202602){if(_0x202602){return _0x202602[_0x084a('0x2b')]()[_0x084a('0x2a')](function(){_0x19937c[_0x084a('0x21')](0xcc)[_0x084a('0x22')]();});}};}function handleEntityNotFound(_0x42af5f,_0x31bb9e){return function(_0x365f8c){if(!_0x365f8c){_0x42af5f['sendStatus'](0x194);}return _0x365f8c;};}function handleError(_0x54ff9b,_0x1ecc73){_0x1ecc73=_0x1ecc73||0x1f4;return function(_0x282fcc){logger[_0x084a('0x1d')](_0x282fcc[_0x084a('0x2c')]);if(_0x282fcc[_0x084a('0x2d')]){delete _0x282fcc['name'];}_0x54ff9b[_0x084a('0x21')](_0x1ecc73)[_0x084a('0x2e')](_0x282fcc);};}exports[_0x084a('0x2f')]=function(_0x53fc69,_0x109593){var _0x2fe5c5={},_0x2e1d11={},_0x4c4c90={'count':0x0,'rows':[]};var _0x5bd9ca=db['Dynamics365Configuration'][_0x084a('0x30')];_0x2e1d11[_0x084a('0x31')]=_[_0x084a('0x32')](_0x5bd9ca);_0x2e1d11['query']=_[_0x084a('0x32')](_0x53fc69[_0x084a('0x33')]);_0x2e1d11[_0x084a('0x34')]=_[_0x084a('0x35')](_0x2e1d11[_0x084a('0x31')],_0x2e1d11[_0x084a('0x33')]);_0x2fe5c5[_0x084a('0x36')]=_[_0x084a('0x35')](_0x2e1d11[_0x084a('0x31')],qs[_0x084a('0x37')](_0x53fc69[_0x084a('0x33')][_0x084a('0x37')]));_0x2fe5c5[_0x084a('0x36')]=_0x2fe5c5[_0x084a('0x36')][_0x084a('0x38')]?_0x2fe5c5['attributes']:_0x2e1d11[_0x084a('0x31')];if(!_0x53fc69[_0x084a('0x33')][_0x084a('0x39')](_0x084a('0x3a'))){_0x2fe5c5[_0x084a('0x3b')]=qs[_0x084a('0x3b')](_0x53fc69[_0x084a('0x33')][_0x084a('0x3b')]);_0x2fe5c5[_0x084a('0x24')]=qs['offset'](_0x53fc69[_0x084a('0x33')][_0x084a('0x24')]);}_0x2fe5c5[_0x084a('0x3c')]=qs[_0x084a('0x3d')](_0x53fc69[_0x084a('0x33')][_0x084a('0x3d')]);_0x2fe5c5['where']=qs[_0x084a('0x34')](_[_0x084a('0x3e')](_0x53fc69['query'],_0x2e1d11[_0x084a('0x34')]));if(_0x53fc69[_0x084a('0x33')][_0x084a('0x3f')]){_0x2fe5c5['where']=_[_0x084a('0x40')](_0x2fe5c5[_0x084a('0x41')],{'$or':_['map'](_0x5bd9ca,function(_0x3e2b92){if(_0x3e2b92[_0x084a('0x42')]['key']!=='VIRTUAL'){var _0x3288d4={};_0x3288d4[_0x3e2b92[_0x084a('0x43')]]={'$like':'%'+_0x53fc69[_0x084a('0x33')][_0x084a('0x3f')]+'%'};return _0x3288d4;}})});}_0x2fe5c5=_[_0x084a('0x40')]({},_0x2fe5c5,_0x53fc69[_0x084a('0x44')]);var _0x2be41a={'where':_0x2fe5c5[_0x084a('0x41')]};return db[_0x084a('0x45')][_0x084a('0x46')](_0x2be41a)[_0x084a('0x2a')](function(_0x593cc8){_0x4c4c90['count']=_0x593cc8;if(_0x53fc69[_0x084a('0x33')][_0x084a('0x47')]){_0x2fe5c5[_0x084a('0x48')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x084a('0x49')](_0x2fe5c5);})[_0x084a('0x2a')](function(_0x3092ea){_0x4c4c90[_0x084a('0x4a')]=_0x3092ea;return _0x4c4c90;})[_0x084a('0x2a')](respondWithFilteredResult(_0x109593,_0x2fe5c5))['catch'](handleError(_0x109593,null));};exports[_0x084a('0x4b')]=function(_0x51b29d,_0x259424){var _0x4f98c6={'raw':![],'where':{'id':_0x51b29d['params']['id']}},_0x1ffd20={};_0x1ffd20['model']=_[_0x084a('0x32')](db[_0x084a('0x45')]['rawAttributes']);_0x1ffd20[_0x084a('0x33')]=_[_0x084a('0x32')](_0x51b29d[_0x084a('0x33')]);_0x1ffd20[_0x084a('0x34')]=_['intersection'](_0x1ffd20[_0x084a('0x31')],_0x1ffd20[_0x084a('0x33')]);_0x4f98c6[_0x084a('0x36')]=_[_0x084a('0x35')](_0x1ffd20['model'],qs[_0x084a('0x37')](_0x51b29d[_0x084a('0x33')][_0x084a('0x37')]));_0x4f98c6[_0x084a('0x36')]=_0x4f98c6['attributes']['length']?_0x4f98c6[_0x084a('0x36')]:_0x1ffd20[_0x084a('0x31')];if(_0x51b29d[_0x084a('0x33')][_0x084a('0x47')]){_0x4f98c6[_0x084a('0x48')]=[{'all':!![]}];}_0x4f98c6=_[_0x084a('0x40')]({},_0x4f98c6,_0x51b29d[_0x084a('0x44')]);return db[_0x084a('0x45')][_0x084a('0x4c')](_0x4f98c6)[_0x084a('0x2a')](handleEntityNotFound(_0x259424,null))[_0x084a('0x2a')](respondWithResult(_0x259424,null))[_0x084a('0x1f')](handleError(_0x259424,null));};exports['create']=function(_0xcdd5b,_0x37fce4){return db[_0x084a('0x45')][_0x084a('0x4d')](_0xcdd5b[_0x084a('0x4e')],{})[_0x084a('0x2a')](respondWithResult(_0x37fce4,0xc9))[_0x084a('0x1f')](handleError(_0x37fce4,null));};exports['update']=function(_0x1a2a3c,_0x40dc39){if(_0x1a2a3c[_0x084a('0x4e')]['id']){delete _0x1a2a3c['body']['id'];}return db['Dynamics365Configuration'][_0x084a('0x4c')]({'where':{'id':_0x1a2a3c['params']['id']}})[_0x084a('0x2a')](handleEntityNotFound(_0x40dc39,null))[_0x084a('0x2a')](saveUpdates(_0x1a2a3c['body'],null))[_0x084a('0x2a')](respondWithResult(_0x40dc39,null))['catch'](handleError(_0x40dc39,null));};exports['destroy']=function(_0x420aba,_0x1a7260){return db[_0x084a('0x45')][_0x084a('0x4c')]({'where':{'id':_0x420aba[_0x084a('0x4f')]['id']}})[_0x084a('0x2a')](handleEntityNotFound(_0x1a7260,null))[_0x084a('0x2a')](removeEntity(_0x1a7260,null))['catch'](handleError(_0x1a7260,null));};exports[_0x084a('0x50')]=function(_0x4389b3,_0x3d7f0a,_0x4c651a){var _0x10e8ab={};var _0x339088={};var _0x12db87;var _0x9246dd;return db['Dynamics365Configuration'][_0x084a('0x51')]({'where':{'id':_0x4389b3['params']['id']}})[_0x084a('0x2a')](handleEntityNotFound(_0x3d7f0a,null))[_0x084a('0x2a')](function(_0x21a18a){if(_0x21a18a){_0x12db87=_0x21a18a;_0x339088['model']=_['keys'](db[_0x084a('0x52')][_0x084a('0x30')]);_0x339088['query']=_[_0x084a('0x32')](_0x4389b3['query']);_0x339088['filters']=_[_0x084a('0x35')](_0x339088[_0x084a('0x31')],_0x339088[_0x084a('0x33')]);_0x10e8ab[_0x084a('0x36')]=_[_0x084a('0x35')](_0x339088[_0x084a('0x31')],qs[_0x084a('0x37')](_0x4389b3[_0x084a('0x33')][_0x084a('0x37')]));_0x10e8ab['attributes']=_0x10e8ab[_0x084a('0x36')][_0x084a('0x38')]?_0x10e8ab[_0x084a('0x36')]:_0x339088['model'];_0x10e8ab[_0x084a('0x3c')]=qs[_0x084a('0x3d')](_0x4389b3['query'][_0x084a('0x3d')]);_0x10e8ab['where']=qs['filters'](_[_0x084a('0x3e')](_0x4389b3['query'],_0x339088['filters']));if(_0x4389b3[_0x084a('0x33')][_0x084a('0x3f')]){_0x10e8ab[_0x084a('0x41')]=_['merge'](_0x10e8ab[_0x084a('0x41')],{'$or':_[_0x084a('0x53')](_0x10e8ab[_0x084a('0x36')],function(_0x2cad52){var _0x45e2d3={};_0x45e2d3[_0x2cad52]={'$like':'%'+_0x4389b3[_0x084a('0x33')][_0x084a('0x3f')]+'%'};return _0x45e2d3;})});}_0x10e8ab=_['merge']({},_0x10e8ab,_0x4389b3['options']);return _0x12db87[_0x084a('0x50')](_0x10e8ab);}})[_0x084a('0x2a')](function(_0x5c77a3){if(_0x5c77a3){_0x9246dd=_0x5c77a3[_0x084a('0x38')];if(!_0x4389b3[_0x084a('0x33')][_0x084a('0x39')](_0x084a('0x3a'))){_0x10e8ab['limit']=qs[_0x084a('0x3b')](_0x4389b3[_0x084a('0x33')][_0x084a('0x3b')]);_0x10e8ab['offset']=qs['offset'](_0x4389b3[_0x084a('0x33')][_0x084a('0x24')]);}return _0x12db87[_0x084a('0x50')](_0x10e8ab);}})[_0x084a('0x2a')](function(_0x7adab6){if(_0x7adab6){return _0x7adab6?{'count':_0x9246dd,'rows':_0x7adab6}:null;}})[_0x084a('0x2a')](respondWithResult(_0x3d7f0a,null))[_0x084a('0x1f')](handleError(_0x3d7f0a,null));};exports['getSubjects']=function(_0x22efb6,_0x51a066,_0x4e713c){var _0x24a553={};var _0x3acf1b={};var _0x2c35ce;var _0x4a2745;return db[_0x084a('0x45')]['findOne']({'where':{'id':_0x22efb6[_0x084a('0x4f')]['id']}})[_0x084a('0x2a')](handleEntityNotFound(_0x51a066,null))[_0x084a('0x2a')](function(_0x12cef4){if(_0x12cef4){_0x2c35ce=_0x12cef4;_0x3acf1b[_0x084a('0x31')]=_[_0x084a('0x32')](db['Dynamics365Field']['rawAttributes']);_0x3acf1b[_0x084a('0x33')]=_[_0x084a('0x32')](_0x22efb6[_0x084a('0x33')]);_0x3acf1b[_0x084a('0x34')]=_[_0x084a('0x35')](_0x3acf1b[_0x084a('0x31')],_0x3acf1b['query']);_0x24a553[_0x084a('0x36')]=_[_0x084a('0x35')](_0x3acf1b[_0x084a('0x31')],qs[_0x084a('0x37')](_0x22efb6[_0x084a('0x33')][_0x084a('0x37')]));_0x24a553[_0x084a('0x36')]=_0x24a553['attributes'][_0x084a('0x38')]?_0x24a553[_0x084a('0x36')]:_0x3acf1b[_0x084a('0x31')];_0x24a553[_0x084a('0x3c')]=qs[_0x084a('0x3d')](_0x22efb6[_0x084a('0x33')][_0x084a('0x3d')]);_0x24a553[_0x084a('0x41')]=qs[_0x084a('0x34')](_[_0x084a('0x3e')](_0x22efb6['query'],_0x3acf1b['filters']));if(_0x22efb6['query'][_0x084a('0x3f')]){_0x24a553[_0x084a('0x41')]=_['merge'](_0x24a553[_0x084a('0x41')],{'$or':_[_0x084a('0x53')](_0x24a553[_0x084a('0x36')],function(_0x252021){var _0x57c249={};_0x57c249[_0x252021]={'$like':'%'+_0x22efb6['query'][_0x084a('0x3f')]+'%'};return _0x57c249;})});}_0x24a553=_[_0x084a('0x40')]({},_0x24a553,_0x22efb6[_0x084a('0x44')]);return _0x2c35ce[_0x084a('0x54')](_0x24a553);}})[_0x084a('0x2a')](function(_0x372563){if(_0x372563){_0x4a2745=_0x372563[_0x084a('0x38')];if(!_0x22efb6['query'][_0x084a('0x39')](_0x084a('0x3a'))){_0x24a553[_0x084a('0x3b')]=qs[_0x084a('0x3b')](_0x22efb6[_0x084a('0x33')][_0x084a('0x3b')]);_0x24a553[_0x084a('0x24')]=qs['offset'](_0x22efb6[_0x084a('0x33')][_0x084a('0x24')]);}return _0x2c35ce[_0x084a('0x54')](_0x24a553);}})[_0x084a('0x2a')](function(_0x417048){if(_0x417048){return _0x417048?{'count':_0x4a2745,'rows':_0x417048}:null;}})[_0x084a('0x2a')](respondWithResult(_0x51a066,null))[_0x084a('0x1f')](handleError(_0x51a066,null));};exports[_0x084a('0x55')]=function(_0x3da502,_0xd75c49,_0x219d38){var _0x57cc66={};var _0x2932b6={};var _0x29916a;var _0x4b8f1f;return db[_0x084a('0x45')]['findOne']({'where':{'id':_0x3da502['params']['id']}})[_0x084a('0x2a')](handleEntityNotFound(_0xd75c49,null))[_0x084a('0x2a')](function(_0x55297a){if(_0x55297a){_0x29916a=_0x55297a;_0x2932b6[_0x084a('0x31')]=_[_0x084a('0x32')](db[_0x084a('0x52')][_0x084a('0x30')]);_0x2932b6[_0x084a('0x33')]=_[_0x084a('0x32')](_0x3da502[_0x084a('0x33')]);_0x2932b6[_0x084a('0x34')]=_[_0x084a('0x35')](_0x2932b6[_0x084a('0x31')],_0x2932b6[_0x084a('0x33')]);_0x57cc66[_0x084a('0x36')]=_[_0x084a('0x35')](_0x2932b6[_0x084a('0x31')],qs[_0x084a('0x37')](_0x3da502['query'][_0x084a('0x37')]));_0x57cc66[_0x084a('0x36')]=_0x57cc66[_0x084a('0x36')][_0x084a('0x38')]?_0x57cc66[_0x084a('0x36')]:_0x2932b6[_0x084a('0x31')];_0x57cc66[_0x084a('0x3c')]=qs[_0x084a('0x3d')](_0x3da502['query']['sort']);_0x57cc66[_0x084a('0x41')]=qs[_0x084a('0x34')](_['pick'](_0x3da502['query'],_0x2932b6[_0x084a('0x34')]));if(_0x3da502['query'][_0x084a('0x3f')]){_0x57cc66['where']=_[_0x084a('0x40')](_0x57cc66[_0x084a('0x41')],{'$or':_[_0x084a('0x53')](_0x57cc66[_0x084a('0x36')],function(_0x5af718){var _0x5ebbe8={};_0x5ebbe8[_0x5af718]={'$like':'%'+_0x3da502['query'][_0x084a('0x3f')]+'%'};return _0x5ebbe8;})});}_0x57cc66=_[_0x084a('0x40')]({},_0x57cc66,_0x3da502[_0x084a('0x44')]);return _0x29916a['getDescriptions'](_0x57cc66);}})[_0x084a('0x2a')](function(_0x3aef7d){if(_0x3aef7d){_0x4b8f1f=_0x3aef7d['length'];if(!_0x3da502[_0x084a('0x33')][_0x084a('0x39')]('nolimit')){_0x57cc66[_0x084a('0x3b')]=qs[_0x084a('0x3b')](_0x3da502[_0x084a('0x33')]['limit']);_0x57cc66['offset']=qs[_0x084a('0x24')](_0x3da502['query'][_0x084a('0x24')]);}return _0x29916a[_0x084a('0x55')](_0x57cc66);}})[_0x084a('0x2a')](function(_0xd9b1d8){if(_0xd9b1d8){return _0xd9b1d8?{'count':_0x4b8f1f,'rows':_0xd9b1d8}:null;}})[_0x084a('0x2a')](respondWithResult(_0xd75c49,null))[_0x084a('0x1f')](handleError(_0xd75c49,null));}; \ No newline at end of file +var _0x4024=['status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','stack','name','send','Dynamics365Configuration','rawAttributes','model','query','keys','intersection','fields','length','attributes','nolimit','order','sort','filters','pick','where','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','crypto','../../components/auth/service','ioredis','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4024,0x89));var _0x4402=function(_0x454498,_0x1d118b){_0x454498=_0x454498-0x0;var _0xc4ab7d=_0x4024[_0x454498];return _0xc4ab7d;};'use strict';var pdf=require(_0x4402('0x0'));var emlformat=require(_0x4402('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4402('0x2'));var jsonpatch=require(_0x4402('0x3'));var rp=require('request-promise');var moment=require(_0x4402('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4402('0x5'));var util=require(_0x4402('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4402('0x7'));var ejs=require(_0x4402('0x8'));var fs=require('fs');var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x4402('0xb'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x4402('0xc'));var qs=require('../../components/parsers/qs');var logger=require(_0x4402('0xd'))('api');var utils=require(_0x4402('0xe'));var config=require(_0x4402('0xf'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4402('0x10'));var client=jayson[_0x4402('0x11')][_0x4402('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x4c9032,_0x7e4475,_0x34d952,_0x42f1b0){return new BPromise(function(_0x19d2f4,_0x248ad9){var _0x31710c=_0x42f1b0||client;return _0x31710c[_0x4402('0x13')](_0x4c9032,_0x34d952)[_0x4402('0x14')](function(_0x295ac5){logger[_0x4402('0x15')](_0x4402('0x16'),_0x7e4475,_0x4402('0x17'));logger[_0x4402('0x18')](_0x4402('0x19'),_0x7e4475,_0x4402('0x17'),JSON[_0x4402('0x1a')](_0x295ac5));if(_0x295ac5[_0x4402('0x1b')]){if(_0x295ac5[_0x4402('0x1b')][_0x4402('0x1c')]===0x1f4){logger[_0x4402('0x1b')]('Dynamics365Configuration,\x20%s,\x20%s',_0x7e4475,_0x295ac5['error'][_0x4402('0x1d')]);return _0x248ad9(_0x295ac5[_0x4402('0x1b')]['message']);}logger[_0x4402('0x1b')](_0x4402('0x16'),_0x7e4475,_0x295ac5['error'][_0x4402('0x1d')]);return _0x19d2f4(_0x295ac5['error']['message']);}else{logger[_0x4402('0x15')](_0x4402('0x16'),_0x7e4475,_0x4402('0x17'));_0x19d2f4(_0x295ac5['result'][_0x4402('0x1d')]);}})['catch'](function(_0x47ab54){logger[_0x4402('0x1b')](_0x4402('0x16'),_0x7e4475,_0x47ab54);_0x248ad9(_0x47ab54);});});}function respondWithStatusCode(_0x110787,_0xc583b){_0xc583b=_0xc583b||0xcc;return function(_0x258d10){if(_0x258d10){return _0x110787[_0x4402('0x1e')](_0xc583b);}return _0x110787[_0x4402('0x1f')](_0xc583b)[_0x4402('0x20')]();};}function respondWithResult(_0x24a9b8,_0x4d6846){_0x4d6846=_0x4d6846||0xc8;return function(_0x1409a9){if(_0x1409a9){return _0x24a9b8['status'](_0x4d6846)[_0x4402('0x21')](_0x1409a9);}};}function respondWithFilteredResult(_0x5ab28d,_0x29f56b){return function(_0x211424){if(_0x211424){var _0x5a43d0=_0x211424[_0x4402('0x22')],_0x15c19f=_0x29f56b[_0x4402('0x23')],_0x4e9cb5=_0x29f56b[_0x4402('0x23')]+_0x29f56b[_0x4402('0x24')],_0x59d52f;if(_0x4e9cb5>=_0x5a43d0){_0x4e9cb5=_0x5a43d0;_0x59d52f=0xc8;}else{_0x59d52f=0xce;}_0x5ab28d[_0x4402('0x1f')](_0x59d52f);return _0x5ab28d['set'](_0x4402('0x25'),_0x15c19f+'-'+_0x4e9cb5+'/'+_0x5a43d0)['json'](_0x211424);}return null;};}function patchUpdates(_0x71da2f){return function(_0x1e2340){try{jsonpatch[_0x4402('0x26')](_0x1e2340,_0x71da2f,!![]);}catch(_0x48d20d){return BPromise[_0x4402('0x27')](_0x48d20d);}return _0x1e2340[_0x4402('0x28')]();};}function saveUpdates(_0x316239,_0x3f4bcb){return function(_0x2526d1){if(_0x2526d1){return _0x2526d1[_0x4402('0x29')](_0x316239)[_0x4402('0x14')](function(_0x435cfe){return _0x435cfe;});}return null;};}function removeEntity(_0x16a9f5,_0xd46d0){return function(_0xcea26b){if(_0xcea26b){return _0xcea26b['destroy']()[_0x4402('0x14')](function(){_0x16a9f5['status'](0xcc)[_0x4402('0x20')]();});}};}function handleEntityNotFound(_0x554096,_0x2dea0f){return function(_0x3c7c65){if(!_0x3c7c65){_0x554096[_0x4402('0x1e')](0x194);}return _0x3c7c65;};}function handleError(_0x215914,_0x3d6887){_0x3d6887=_0x3d6887||0x1f4;return function(_0x480781){logger[_0x4402('0x1b')](_0x480781[_0x4402('0x2a')]);if(_0x480781[_0x4402('0x2b')]){delete _0x480781['name'];}_0x215914[_0x4402('0x1f')](_0x3d6887)[_0x4402('0x2c')](_0x480781);};}exports['index']=function(_0x2db1fe,_0x437e83){var _0x2f59e9={},_0x215c12={},_0x170058={'count':0x0,'rows':[]};var _0x235f30=db[_0x4402('0x2d')][_0x4402('0x2e')];_0x215c12[_0x4402('0x2f')]=_['keys'](_0x235f30);_0x215c12[_0x4402('0x30')]=_[_0x4402('0x31')](_0x2db1fe[_0x4402('0x30')]);_0x215c12['filters']=_[_0x4402('0x32')](_0x215c12[_0x4402('0x2f')],_0x215c12['query']);_0x2f59e9['attributes']=_[_0x4402('0x32')](_0x215c12[_0x4402('0x2f')],qs[_0x4402('0x33')](_0x2db1fe[_0x4402('0x30')]['fields']));_0x2f59e9['attributes']=_0x2f59e9['attributes'][_0x4402('0x34')]?_0x2f59e9[_0x4402('0x35')]:_0x215c12[_0x4402('0x2f')];if(!_0x2db1fe[_0x4402('0x30')]['hasOwnProperty'](_0x4402('0x36'))){_0x2f59e9[_0x4402('0x24')]=qs[_0x4402('0x24')](_0x2db1fe['query'][_0x4402('0x24')]);_0x2f59e9['offset']=qs[_0x4402('0x23')](_0x2db1fe[_0x4402('0x30')]['offset']);}_0x2f59e9[_0x4402('0x37')]=qs['sort'](_0x2db1fe[_0x4402('0x30')][_0x4402('0x38')]);_0x2f59e9['where']=qs[_0x4402('0x39')](_[_0x4402('0x3a')](_0x2db1fe[_0x4402('0x30')],_0x215c12[_0x4402('0x39')]));if(_0x2db1fe['query']['filter']){_0x2f59e9[_0x4402('0x3b')]=_['merge'](_0x2f59e9[_0x4402('0x3b')],{'$or':_[_0x4402('0x3c')](_0x235f30,function(_0xb9cf85){if(_0xb9cf85[_0x4402('0x3d')][_0x4402('0x3e')]!==_0x4402('0x3f')){var _0x173040={};_0x173040[_0xb9cf85[_0x4402('0x40')]]={'$like':'%'+_0x2db1fe[_0x4402('0x30')][_0x4402('0x41')]+'%'};return _0x173040;}})});}_0x2f59e9=_['merge']({},_0x2f59e9,_0x2db1fe[_0x4402('0x42')]);var _0x3236fc={'where':_0x2f59e9['where']};return db[_0x4402('0x2d')][_0x4402('0x22')](_0x3236fc)['then'](function(_0x4115d6){_0x170058[_0x4402('0x22')]=_0x4115d6;if(_0x2db1fe[_0x4402('0x30')][_0x4402('0x43')]){_0x2f59e9[_0x4402('0x44')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x4402('0x45')](_0x2f59e9);})[_0x4402('0x14')](function(_0x21d34f){_0x170058[_0x4402('0x46')]=_0x21d34f;return _0x170058;})[_0x4402('0x14')](respondWithFilteredResult(_0x437e83,_0x2f59e9))[_0x4402('0x47')](handleError(_0x437e83,null));};exports[_0x4402('0x48')]=function(_0x136c9c,_0x260297){var _0x100489={'raw':![],'where':{'id':_0x136c9c['params']['id']}},_0x22b463={};_0x22b463[_0x4402('0x2f')]=_['keys'](db[_0x4402('0x2d')][_0x4402('0x2e')]);_0x22b463['query']=_[_0x4402('0x31')](_0x136c9c[_0x4402('0x30')]);_0x22b463[_0x4402('0x39')]=_[_0x4402('0x32')](_0x22b463[_0x4402('0x2f')],_0x22b463[_0x4402('0x30')]);_0x100489['attributes']=_[_0x4402('0x32')](_0x22b463[_0x4402('0x2f')],qs[_0x4402('0x33')](_0x136c9c[_0x4402('0x30')][_0x4402('0x33')]));_0x100489[_0x4402('0x35')]=_0x100489[_0x4402('0x35')][_0x4402('0x34')]?_0x100489[_0x4402('0x35')]:_0x22b463['model'];if(_0x136c9c['query']['includeAll']){_0x100489['include']=[{'all':!![]}];}_0x100489=_[_0x4402('0x49')]({},_0x100489,_0x136c9c[_0x4402('0x42')]);return db[_0x4402('0x2d')][_0x4402('0x4a')](_0x100489)['then'](handleEntityNotFound(_0x260297,null))[_0x4402('0x14')](respondWithResult(_0x260297,null))[_0x4402('0x47')](handleError(_0x260297,null));};exports[_0x4402('0x4b')]=function(_0x2a4ea7,_0x196b2f){return db[_0x4402('0x2d')][_0x4402('0x4b')](_0x2a4ea7['body'],{})[_0x4402('0x14')](respondWithResult(_0x196b2f,0xc9))[_0x4402('0x47')](handleError(_0x196b2f,null));};exports[_0x4402('0x29')]=function(_0x11c162,_0x266dfe){if(_0x11c162[_0x4402('0x4c')]['id']){delete _0x11c162['body']['id'];}return db[_0x4402('0x2d')][_0x4402('0x4a')]({'where':{'id':_0x11c162[_0x4402('0x4d')]['id']}})[_0x4402('0x14')](handleEntityNotFound(_0x266dfe,null))[_0x4402('0x14')](saveUpdates(_0x11c162[_0x4402('0x4c')],null))[_0x4402('0x14')](respondWithResult(_0x266dfe,null))['catch'](handleError(_0x266dfe,null));};exports['destroy']=function(_0x1a94f5,_0xb82409){return db[_0x4402('0x2d')]['find']({'where':{'id':_0x1a94f5['params']['id']}})[_0x4402('0x14')](handleEntityNotFound(_0xb82409,null))[_0x4402('0x14')](removeEntity(_0xb82409,null))[_0x4402('0x47')](handleError(_0xb82409,null));};exports[_0x4402('0x4e')]=function(_0x3ee2fe,_0x37ba14,_0x248104){var _0x18e905={};var _0x394ac9={};var _0x3f2599;var _0x353679;return db[_0x4402('0x2d')][_0x4402('0x4f')]({'where':{'id':_0x3ee2fe['params']['id']}})[_0x4402('0x14')](handleEntityNotFound(_0x37ba14,null))['then'](function(_0xe4530a){if(_0xe4530a){_0x3f2599=_0xe4530a;_0x394ac9['model']=_[_0x4402('0x31')](db[_0x4402('0x50')][_0x4402('0x2e')]);_0x394ac9[_0x4402('0x30')]=_[_0x4402('0x31')](_0x3ee2fe[_0x4402('0x30')]);_0x394ac9['filters']=_[_0x4402('0x32')](_0x394ac9[_0x4402('0x2f')],_0x394ac9[_0x4402('0x30')]);_0x18e905[_0x4402('0x35')]=_[_0x4402('0x32')](_0x394ac9['model'],qs[_0x4402('0x33')](_0x3ee2fe[_0x4402('0x30')][_0x4402('0x33')]));_0x18e905[_0x4402('0x35')]=_0x18e905[_0x4402('0x35')][_0x4402('0x34')]?_0x18e905[_0x4402('0x35')]:_0x394ac9[_0x4402('0x2f')];_0x18e905['order']=qs[_0x4402('0x38')](_0x3ee2fe[_0x4402('0x30')]['sort']);_0x18e905[_0x4402('0x3b')]=qs[_0x4402('0x39')](_['pick'](_0x3ee2fe['query'],_0x394ac9[_0x4402('0x39')]));if(_0x3ee2fe[_0x4402('0x30')][_0x4402('0x41')]){_0x18e905['where']=_[_0x4402('0x49')](_0x18e905[_0x4402('0x3b')],{'$or':_[_0x4402('0x3c')](_0x18e905['attributes'],function(_0x2fe275){var _0x41a2c6={};_0x41a2c6[_0x2fe275]={'$like':'%'+_0x3ee2fe[_0x4402('0x30')]['filter']+'%'};return _0x41a2c6;})});}_0x18e905=_[_0x4402('0x49')]({},_0x18e905,_0x3ee2fe[_0x4402('0x42')]);return _0x3f2599['getFields'](_0x18e905);}})['then'](function(_0x40869c){if(_0x40869c){_0x353679=_0x40869c['length'];if(!_0x3ee2fe[_0x4402('0x30')][_0x4402('0x51')]('nolimit')){_0x18e905['limit']=qs[_0x4402('0x24')](_0x3ee2fe[_0x4402('0x30')][_0x4402('0x24')]);_0x18e905[_0x4402('0x23')]=qs['offset'](_0x3ee2fe[_0x4402('0x30')][_0x4402('0x23')]);}return _0x3f2599[_0x4402('0x4e')](_0x18e905);}})[_0x4402('0x14')](function(_0x2b2b40){if(_0x2b2b40){return _0x2b2b40?{'count':_0x353679,'rows':_0x2b2b40}:null;}})[_0x4402('0x14')](respondWithResult(_0x37ba14,null))[_0x4402('0x47')](handleError(_0x37ba14,null));};exports['getSubjects']=function(_0x333a72,_0x2ee6e8,_0x559d1c){var _0x508111={};var _0x2bee9d={};var _0x4aaa60;var _0x30569e;return db['Dynamics365Configuration'][_0x4402('0x4f')]({'where':{'id':_0x333a72[_0x4402('0x4d')]['id']}})[_0x4402('0x14')](handleEntityNotFound(_0x2ee6e8,null))[_0x4402('0x14')](function(_0x3c89bf){if(_0x3c89bf){_0x4aaa60=_0x3c89bf;_0x2bee9d[_0x4402('0x2f')]=_[_0x4402('0x31')](db[_0x4402('0x50')][_0x4402('0x2e')]);_0x2bee9d[_0x4402('0x30')]=_[_0x4402('0x31')](_0x333a72[_0x4402('0x30')]);_0x2bee9d[_0x4402('0x39')]=_[_0x4402('0x32')](_0x2bee9d[_0x4402('0x2f')],_0x2bee9d[_0x4402('0x30')]);_0x508111['attributes']=_[_0x4402('0x32')](_0x2bee9d[_0x4402('0x2f')],qs[_0x4402('0x33')](_0x333a72['query'][_0x4402('0x33')]));_0x508111['attributes']=_0x508111[_0x4402('0x35')][_0x4402('0x34')]?_0x508111[_0x4402('0x35')]:_0x2bee9d[_0x4402('0x2f')];_0x508111['order']=qs[_0x4402('0x38')](_0x333a72['query'][_0x4402('0x38')]);_0x508111[_0x4402('0x3b')]=qs[_0x4402('0x39')](_['pick'](_0x333a72[_0x4402('0x30')],_0x2bee9d['filters']));if(_0x333a72[_0x4402('0x30')][_0x4402('0x41')]){_0x508111[_0x4402('0x3b')]=_[_0x4402('0x49')](_0x508111[_0x4402('0x3b')],{'$or':_[_0x4402('0x3c')](_0x508111[_0x4402('0x35')],function(_0x2bed7c){var _0x438048={};_0x438048[_0x2bed7c]={'$like':'%'+_0x333a72['query'][_0x4402('0x41')]+'%'};return _0x438048;})});}_0x508111=_[_0x4402('0x49')]({},_0x508111,_0x333a72[_0x4402('0x42')]);return _0x4aaa60[_0x4402('0x52')](_0x508111);}})[_0x4402('0x14')](function(_0x10284a){if(_0x10284a){_0x30569e=_0x10284a[_0x4402('0x34')];if(!_0x333a72[_0x4402('0x30')][_0x4402('0x51')]('nolimit')){_0x508111[_0x4402('0x24')]=qs[_0x4402('0x24')](_0x333a72[_0x4402('0x30')]['limit']);_0x508111[_0x4402('0x23')]=qs['offset'](_0x333a72[_0x4402('0x30')]['offset']);}return _0x4aaa60[_0x4402('0x52')](_0x508111);}})[_0x4402('0x14')](function(_0x552962){if(_0x552962){return _0x552962?{'count':_0x30569e,'rows':_0x552962}:null;}})[_0x4402('0x14')](respondWithResult(_0x2ee6e8,null))['catch'](handleError(_0x2ee6e8,null));};exports[_0x4402('0x53')]=function(_0x2005d0,_0x5d6af7,_0x253375){var _0x2df3dc={};var _0x50f5ed={};var _0x189259;var _0x13c47e;return db['Dynamics365Configuration'][_0x4402('0x4f')]({'where':{'id':_0x2005d0[_0x4402('0x4d')]['id']}})[_0x4402('0x14')](handleEntityNotFound(_0x5d6af7,null))[_0x4402('0x14')](function(_0x439e95){if(_0x439e95){_0x189259=_0x439e95;_0x50f5ed[_0x4402('0x2f')]=_[_0x4402('0x31')](db[_0x4402('0x50')][_0x4402('0x2e')]);_0x50f5ed[_0x4402('0x30')]=_[_0x4402('0x31')](_0x2005d0[_0x4402('0x30')]);_0x50f5ed[_0x4402('0x39')]=_[_0x4402('0x32')](_0x50f5ed['model'],_0x50f5ed[_0x4402('0x30')]);_0x2df3dc[_0x4402('0x35')]=_['intersection'](_0x50f5ed[_0x4402('0x2f')],qs['fields'](_0x2005d0[_0x4402('0x30')][_0x4402('0x33')]));_0x2df3dc[_0x4402('0x35')]=_0x2df3dc['attributes'][_0x4402('0x34')]?_0x2df3dc[_0x4402('0x35')]:_0x50f5ed[_0x4402('0x2f')];_0x2df3dc['order']=qs[_0x4402('0x38')](_0x2005d0[_0x4402('0x30')][_0x4402('0x38')]);_0x2df3dc[_0x4402('0x3b')]=qs['filters'](_[_0x4402('0x3a')](_0x2005d0[_0x4402('0x30')],_0x50f5ed[_0x4402('0x39')]));if(_0x2005d0[_0x4402('0x30')][_0x4402('0x41')]){_0x2df3dc[_0x4402('0x3b')]=_[_0x4402('0x49')](_0x2df3dc[_0x4402('0x3b')],{'$or':_[_0x4402('0x3c')](_0x2df3dc[_0x4402('0x35')],function(_0x45c4d9){var _0x2fc027={};_0x2fc027[_0x45c4d9]={'$like':'%'+_0x2005d0[_0x4402('0x30')]['filter']+'%'};return _0x2fc027;})});}_0x2df3dc=_[_0x4402('0x49')]({},_0x2df3dc,_0x2005d0[_0x4402('0x42')]);return _0x189259[_0x4402('0x53')](_0x2df3dc);}})[_0x4402('0x14')](function(_0x567bcf){if(_0x567bcf){_0x13c47e=_0x567bcf['length'];if(!_0x2005d0[_0x4402('0x30')][_0x4402('0x51')](_0x4402('0x36'))){_0x2df3dc[_0x4402('0x24')]=qs['limit'](_0x2005d0[_0x4402('0x30')][_0x4402('0x24')]);_0x2df3dc['offset']=qs[_0x4402('0x23')](_0x2005d0[_0x4402('0x30')][_0x4402('0x23')]);}return _0x189259[_0x4402('0x53')](_0x2df3dc);}})[_0x4402('0x14')](function(_0x5f5945){if(_0x5f5945){return _0x5f5945?{'count':_0x13c47e,'rows':_0x5f5945}:null;}})[_0x4402('0x14')](respondWithResult(_0x5d6af7,null))[_0x4402('0x47')](handleError(_0x5d6af7,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 9e78ae1..2c4d6a9 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 _0x3a55=['bluebird','request-promise','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api','moment'];(function(_0x25e5b0,_0x473d2f){var _0x17c3f7=function(_0x13f2af){while(--_0x13f2af){_0x25e5b0['push'](_0x25e5b0['shift']());}};_0x17c3f7(++_0x473d2f);}(_0x3a55,0x102));var _0x53a5=function(_0x1f50d7,_0x3855b0){_0x1f50d7=_0x1f50d7-0x0;var _0x586344=_0x3a55[_0x1f50d7];return _0x586344;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x53a5('0x0'))(_0x53a5('0x1'));var moment=require(_0x53a5('0x2'));var BPromise=require(_0x53a5('0x3'));var rp=require(_0x53a5('0x4'));var attributes=require(_0x53a5('0x5'));module['exports']=function(_0x2af2f4,_0x5ddeaf){return _0x2af2f4[_0x53a5('0x6')](_0x53a5('0x7'),attributes,{'tableName':_0x53a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94e6=['./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','moment','bluebird'];(function(_0x5f19cb,_0x2900a7){var _0x45fb73=function(_0x1ed0b0){while(--_0x1ed0b0){_0x5f19cb['push'](_0x5f19cb['shift']());}};_0x45fb73(++_0x2900a7);}(_0x94e6,0x15b));var _0x694e=function(_0x24649b,_0x5a9bf8){_0x24649b=_0x24649b-0x0;var _0x1c921a=_0x94e6[_0x24649b];return _0x1c921a;};'use strict';var _=require('lodash');var util=require(_0x694e('0x0'));var logger=require(_0x694e('0x1'))('api');var moment=require(_0x694e('0x2'));var BPromise=require(_0x694e('0x3'));var rp=require('request-promise');var attributes=require(_0x694e('0x4'));module[_0x694e('0x5')]=function(_0x183554,_0x2f8ae8){return _0x183554[_0x694e('0x6')](_0x694e('0x7'),attributes,{'tableName':_0x694e('0x8'),'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 a4c3670..73fd737 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 _0x6d0c=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent'];(function(_0x51f2cf,_0x3bbfbc){var _0x571db8=function(_0x1abba0){while(--_0x1abba0){_0x51f2cf['push'](_0x51f2cf['shift']());}};_0x571db8(++_0x3bbfbc);}(_0x6d0c,0x1c1));var _0xc6d0=function(_0x2cbbce,_0x45bf6f){_0x2cbbce=_0x2cbbce-0x0;var _0x4edb59=_0x6d0c[_0x2cbbce];return _0x4edb59;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc6d0('0x0'));var BPromise=require(_0xc6d0('0x1'));var rs=require(_0xc6d0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6d0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6d0('0x4'))(_0xc6d0('0x5'));var config=require(_0xc6d0('0x6'));var jayson=require(_0xc6d0('0x7'));var client=jayson[_0xc6d0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e7727,_0x32f033,_0x169e61){return new BPromise(function(_0x128173,_0x4dda3f){return client['request'](_0x4e7727,_0x169e61)[_0xc6d0('0x9')](function(_0x24fd24){logger[_0xc6d0('0xa')](_0xc6d0('0xb'),_0x32f033,_0xc6d0('0xc'));logger[_0xc6d0('0xd')](_0xc6d0('0xe'),_0x32f033,'request\x20sent',JSON[_0xc6d0('0xf')](_0x24fd24));if(_0x24fd24[_0xc6d0('0x10')]){if(_0x24fd24[_0xc6d0('0x10')][_0xc6d0('0x11')]===0x1f4){logger['error'](_0xc6d0('0xb'),_0x32f033,_0x24fd24[_0xc6d0('0x10')]['message']);return _0x4dda3f(_0x24fd24[_0xc6d0('0x10')]['message']);}logger[_0xc6d0('0x10')](_0xc6d0('0xb'),_0x32f033,_0x24fd24['error'][_0xc6d0('0x12')]);return _0x128173(_0x24fd24[_0xc6d0('0x10')]['message']);}else{logger[_0xc6d0('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x32f033,_0xc6d0('0xc'));_0x128173(_0x24fd24[_0xc6d0('0x13')][_0xc6d0('0x12')]);}})[_0xc6d0('0x14')](function(_0xc124b1){logger[_0xc6d0('0x10')](_0xc6d0('0xb'),_0x32f033,_0xc124b1);_0x4dda3f(_0xc124b1);});});} \ No newline at end of file +var _0x173b=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x173b,0x1d7));var _0xb173=function(_0x3b4670,_0x3b0d40){_0x3b4670=_0x3b4670-0x0;var _0x5443f9=_0x173b[_0x3b4670];return _0x5443f9;};'use strict';var _=require('lodash');var util=require(_0xb173('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb173('0x1'));var db=require(_0xb173('0x2'))['db'];var utils=require(_0xb173('0x3'));var logger=require(_0xb173('0x4'))(_0xb173('0x5'));var config=require(_0xb173('0x6'));var jayson=require(_0xb173('0x7'));var client=jayson['client'][_0xb173('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2744fe,_0x1f1b4c,_0x423815){return new BPromise(function(_0xd26ac3,_0x3cba1f){return client[_0xb173('0x9')](_0x2744fe,_0x423815)[_0xb173('0xa')](function(_0x5f155b){logger[_0xb173('0xb')](_0xb173('0xc'),_0x1f1b4c,_0xb173('0xd'));logger[_0xb173('0xe')](_0xb173('0xf'),_0x1f1b4c,_0xb173('0xd'),JSON[_0xb173('0x10')](_0x5f155b));if(_0x5f155b[_0xb173('0x11')]){if(_0x5f155b[_0xb173('0x11')][_0xb173('0x12')]===0x1f4){logger[_0xb173('0x11')](_0xb173('0xc'),_0x1f1b4c,_0x5f155b[_0xb173('0x11')]['message']);return _0x3cba1f(_0x5f155b[_0xb173('0x11')][_0xb173('0x13')]);}logger[_0xb173('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1f1b4c,_0x5f155b['error']['message']);return _0xd26ac3(_0x5f155b['error'][_0xb173('0x13')]);}else{logger[_0xb173('0xb')](_0xb173('0xc'),_0x1f1b4c,_0xb173('0xd'));_0xd26ac3(_0x5f155b[_0xb173('0x14')][_0xb173('0x13')]);}})[_0xb173('0x15')](function(_0x48c101){logger[_0xb173('0x11')](_0xb173('0xc'),_0x1f1b4c,_0x48c101);_0x3cba1f(_0x48c101);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 3202fa1..da0d9f3 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 _0xa521=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','multer'];(function(_0xdcfe14,_0x1caac0){var _0x317232=function(_0xbd8d6b){while(--_0xbd8d6b){_0xdcfe14['push'](_0xdcfe14['shift']());}};_0x317232(++_0x1caac0);}(_0xa521,0x109));var _0x1a52=function(_0xe4c1e4,_0x2e28cf){_0xe4c1e4=_0xe4c1e4-0x0;var _0x616214=_0xa521[_0xe4c1e4];return _0x616214;};'use strict';var multer=require(_0x1a52('0x0'));var util=require(_0x1a52('0x1'));var path=require(_0x1a52('0x2'));var timeout=require(_0x1a52('0x3'));var express=require(_0x1a52('0x4'));var router=express[_0x1a52('0x5')]();var auth=require(_0x1a52('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1a52('0x7'));var controller=require(_0x1a52('0x8'));router[_0x1a52('0x9')]('/',auth[_0x1a52('0xa')](),controller[_0x1a52('0xb')]);router[_0x1a52('0x9')]('/:id',auth[_0x1a52('0xa')](),controller[_0x1a52('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a52('0xd')]);router[_0x1a52('0xe')](_0x1a52('0xf'),auth[_0x1a52('0xa')](),controller[_0x1a52('0x10')]);router[_0x1a52('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1a52('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9f18=['/:id','show','post','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x346a39,_0x3f4c30){var _0x5c0cf6=function(_0x46b223){while(--_0x46b223){_0x346a39['push'](_0x346a39['shift']());}};_0x5c0cf6(++_0x3f4c30);}(_0x9f18,0x1af));var _0x89f1=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x9f18[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0x89f1('0x0'));var util=require(_0x89f1('0x1'));var path=require(_0x89f1('0x2'));var timeout=require(_0x89f1('0x3'));var express=require(_0x89f1('0x4'));var router=express[_0x89f1('0x5')]();var auth=require(_0x89f1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x89f1('0x7'));var controller=require('./intDynamics365Field.controller');router[_0x89f1('0x8')]('/',auth[_0x89f1('0x9')](),controller[_0x89f1('0xa')]);router[_0x89f1('0x8')](_0x89f1('0xb'),auth[_0x89f1('0x9')](),controller[_0x89f1('0xc')]);router[_0x89f1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x89f1('0xe')]('/:id',auth[_0x89f1('0x9')](),controller['update']);router[_0x89f1('0xf')](_0x89f1('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x89f1('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 1901749..2ad2ed4 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 _0xee5b=['keyValue','STRING','variable','sequelize','ENUM','string','customVariable'];(function(_0xd94f10,_0x3dadfd){var _0x263983=function(_0x2470a8){while(--_0x2470a8){_0xd94f10['push'](_0xd94f10['shift']());}};_0x263983(++_0x3dadfd);}(_0xee5b,0x1f4));var _0xbee5=function(_0x29f20b,_0x59b4d3){_0x29f20b=_0x29f20b-0x0;var _0x150d47=_0xee5b[_0x29f20b];return _0x150d47;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'type':{'type':Sequelize[_0xbee5('0x1')](_0xbee5('0x2'),'variable',_0xbee5('0x3'),_0xbee5('0x4')),'defaultValue':_0xbee5('0x2')},'content':{'type':Sequelize[_0xbee5('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbee5('0x2'),_0xbee5('0x6'),_0xbee5('0x3'))},'keyContent':{'type':Sequelize[_0xbee5('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x57cc1c,_0x1cc152){var _0xc2065a=function(_0x4f50ca){while(--_0x4f50ca){_0x57cc1c['push'](_0x57cc1c['shift']());}};_0xc2065a(++_0x1cc152);}(_0xb688,0xcf));var _0x8b68=function(_0x29a856,_0x30970d){_0x29a856=_0x29a856-0x0;var _0x51b04a=_0xb688[_0x29a856];return _0x51b04a;};'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/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 12f8571..e3f411b 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 _0x1d1e=['end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','Dynamics365Field','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','type','key','field','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x1d1e,0x1e5));var _0xe1d1=function(_0x1a5a53,_0x598a8c){_0x1a5a53=_0x1a5a53-0x0;var _0xf75355=_0x1d1e[_0x1a5a53];return _0xf75355;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe1d1('0x0'));var rimraf=require(_0xe1d1('0x1'));var zipdir=require(_0xe1d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1d1('0x3'));var moment=require(_0xe1d1('0x4'));var BPromise=require(_0xe1d1('0x5'));var Mustache=require(_0xe1d1('0x6'));var util=require(_0xe1d1('0x7'));var path=require(_0xe1d1('0x8'));var sox=require(_0xe1d1('0x9'));var csv=require(_0xe1d1('0xa'));var ejs=require(_0xe1d1('0xb'));var fs=require('fs');var _=require(_0xe1d1('0xc'));var squel=require(_0xe1d1('0xd'));var crypto=require(_0xe1d1('0xe'));var jsforce=require(_0xe1d1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe1d1('0xa'));var querystring=require('querystring');var Papa=require(_0xe1d1('0x10'));var authService=require(_0xe1d1('0x11'));var hardwareService=require(_0xe1d1('0x12'));var Redis=require(_0xe1d1('0x13'));var qs=require(_0xe1d1('0x14'));var logger=require('../../config/logger')(_0xe1d1('0x15'));var utils=require(_0xe1d1('0x16'));var config=require(_0xe1d1('0x17'));var db=require(_0xe1d1('0x18'))['db'];function respondWithStatusCode(_0x1a1114,_0x59d9e6){_0x59d9e6=_0x59d9e6||0xcc;return function(_0x35b5f9){if(_0x35b5f9){return _0x1a1114['sendStatus'](_0x59d9e6);}return _0x1a1114[_0xe1d1('0x19')](_0x59d9e6)[_0xe1d1('0x1a')]();};}function respondWithResult(_0x357902,_0x555127){_0x555127=_0x555127||0xc8;return function(_0x3073aa){if(_0x3073aa){return _0x357902[_0xe1d1('0x19')](_0x555127)[_0xe1d1('0x1b')](_0x3073aa);}};}function respondWithFilteredResult(_0x180e59,_0xfa35ab){return function(_0x14aada){if(_0x14aada){var _0x22dfab=_0x14aada['count'],_0xb6da15=_0xfa35ab[_0xe1d1('0x1c')],_0x57616d=_0xfa35ab['offset']+_0xfa35ab[_0xe1d1('0x1d')],_0xbc4f72;if(_0x57616d>=_0x22dfab){_0x57616d=_0x22dfab;_0xbc4f72=0xc8;}else{_0xbc4f72=0xce;}_0x180e59[_0xe1d1('0x19')](_0xbc4f72);return _0x180e59[_0xe1d1('0x1e')](_0xe1d1('0x1f'),_0xb6da15+'-'+_0x57616d+'/'+_0x22dfab)[_0xe1d1('0x1b')](_0x14aada);}return null;};}function patchUpdates(_0x5d5bef){return function(_0x53d17a){try{jsonpatch[_0xe1d1('0x20')](_0x53d17a,_0x5d5bef,!![]);}catch(_0x2e84c9){return BPromise[_0xe1d1('0x21')](_0x2e84c9);}return _0x53d17a['save']();};}function saveUpdates(_0x25731c,_0x1a6237){return function(_0x571a3b){if(_0x571a3b){return _0x571a3b[_0xe1d1('0x22')](_0x25731c)[_0xe1d1('0x23')](function(_0x1e8200){return _0x1e8200;});}return null;};}function removeEntity(_0x42df9b,_0x2c23cb){return function(_0x2352ce){if(_0x2352ce){return _0x2352ce[_0xe1d1('0x24')]()[_0xe1d1('0x23')](function(){_0x42df9b[_0xe1d1('0x19')](0xcc)[_0xe1d1('0x1a')]();});}};}function handleEntityNotFound(_0x579750,_0x4f627c){return function(_0x18e623){if(!_0x18e623){_0x579750[_0xe1d1('0x25')](0x194);}return _0x18e623;};}function handleError(_0x198619,_0x13960f){_0x13960f=_0x13960f||0x1f4;return function(_0x5b0edb){logger['error'](_0x5b0edb[_0xe1d1('0x26')]);if(_0x5b0edb[_0xe1d1('0x27')]){delete _0x5b0edb[_0xe1d1('0x27')];}_0x198619[_0xe1d1('0x19')](_0x13960f)[_0xe1d1('0x28')](_0x5b0edb);};}exports[_0xe1d1('0x29')]=function(_0xea3d38,_0xd4118c){var _0xbd603d={},_0x5a0b53={},_0x54b635={'count':0x0,'rows':[]};var _0x498a4d=db[_0xe1d1('0x2a')][_0xe1d1('0x2b')];_0x5a0b53[_0xe1d1('0x2c')]=_['keys'](_0x498a4d);_0x5a0b53[_0xe1d1('0x2d')]=_[_0xe1d1('0x2e')](_0xea3d38[_0xe1d1('0x2d')]);_0x5a0b53[_0xe1d1('0x2f')]=_[_0xe1d1('0x30')](_0x5a0b53[_0xe1d1('0x2c')],_0x5a0b53[_0xe1d1('0x2d')]);_0xbd603d[_0xe1d1('0x31')]=_[_0xe1d1('0x30')](_0x5a0b53[_0xe1d1('0x2c')],qs[_0xe1d1('0x32')](_0xea3d38['query']['fields']));_0xbd603d[_0xe1d1('0x31')]=_0xbd603d[_0xe1d1('0x31')]['length']?_0xbd603d[_0xe1d1('0x31')]:_0x5a0b53[_0xe1d1('0x2c')];if(!_0xea3d38[_0xe1d1('0x2d')][_0xe1d1('0x33')](_0xe1d1('0x34'))){_0xbd603d['limit']=qs['limit'](_0xea3d38[_0xe1d1('0x2d')][_0xe1d1('0x1d')]);_0xbd603d['offset']=qs[_0xe1d1('0x1c')](_0xea3d38[_0xe1d1('0x2d')]['offset']);}_0xbd603d[_0xe1d1('0x35')]=qs['sort'](_0xea3d38[_0xe1d1('0x2d')]['sort']);_0xbd603d['where']=qs[_0xe1d1('0x2f')](_[_0xe1d1('0x36')](_0xea3d38[_0xe1d1('0x2d')],_0x5a0b53[_0xe1d1('0x2f')]));if(_0xea3d38[_0xe1d1('0x2d')][_0xe1d1('0x37')]){_0xbd603d[_0xe1d1('0x38')]=_['merge'](_0xbd603d[_0xe1d1('0x38')],{'$or':_['map'](_0x498a4d,function(_0x568a48){if(_0x568a48[_0xe1d1('0x39')][_0xe1d1('0x3a')]!=='VIRTUAL'){var _0x69001c={};_0x69001c[_0x568a48[_0xe1d1('0x3b')]]={'$like':'%'+_0xea3d38['query'][_0xe1d1('0x37')]+'%'};return _0x69001c;}})});}_0xbd603d=_[_0xe1d1('0x3c')]({},_0xbd603d,_0xea3d38['options']);var _0x3d1077={'where':_0xbd603d[_0xe1d1('0x38')]};return db[_0xe1d1('0x2a')]['count'](_0x3d1077)[_0xe1d1('0x23')](function(_0x2ac3eb){_0x54b635['count']=_0x2ac3eb;if(_0xea3d38[_0xe1d1('0x2d')][_0xe1d1('0x3d')]){_0xbd603d[_0xe1d1('0x3e')]=[{'all':!![]}];}return db[_0xe1d1('0x2a')][_0xe1d1('0x3f')](_0xbd603d);})[_0xe1d1('0x23')](function(_0x2885b2){_0x54b635[_0xe1d1('0x40')]=_0x2885b2;return _0x54b635;})[_0xe1d1('0x23')](respondWithFilteredResult(_0xd4118c,_0xbd603d))[_0xe1d1('0x41')](handleError(_0xd4118c,null));};exports[_0xe1d1('0x42')]=function(_0xd78468,_0x74bf0d){var _0x1babaf={'raw':!![],'where':{'id':_0xd78468[_0xe1d1('0x43')]['id']}},_0x5d5947={};_0x5d5947[_0xe1d1('0x2c')]=_[_0xe1d1('0x2e')](db[_0xe1d1('0x2a')][_0xe1d1('0x2b')]);_0x5d5947[_0xe1d1('0x2d')]=_[_0xe1d1('0x2e')](_0xd78468[_0xe1d1('0x2d')]);_0x5d5947[_0xe1d1('0x2f')]=_[_0xe1d1('0x30')](_0x5d5947['model'],_0x5d5947[_0xe1d1('0x2d')]);_0x1babaf[_0xe1d1('0x31')]=_[_0xe1d1('0x30')](_0x5d5947[_0xe1d1('0x2c')],qs[_0xe1d1('0x32')](_0xd78468[_0xe1d1('0x2d')][_0xe1d1('0x32')]));_0x1babaf['attributes']=_0x1babaf[_0xe1d1('0x31')][_0xe1d1('0x44')]?_0x1babaf[_0xe1d1('0x31')]:_0x5d5947['model'];if(_0xd78468['query'][_0xe1d1('0x3d')]){_0x1babaf[_0xe1d1('0x3e')]=[{'all':!![]}];}_0x1babaf=_[_0xe1d1('0x3c')]({},_0x1babaf,_0xd78468[_0xe1d1('0x45')]);return db[_0xe1d1('0x2a')][_0xe1d1('0x46')](_0x1babaf)[_0xe1d1('0x23')](handleEntityNotFound(_0x74bf0d,null))['then'](respondWithResult(_0x74bf0d,null))['catch'](handleError(_0x74bf0d,null));};exports[_0xe1d1('0x47')]=function(_0x1f0d2b,_0x2993d2){return db['Dynamics365Field'][_0xe1d1('0x47')](_0x1f0d2b[_0xe1d1('0x48')],{})[_0xe1d1('0x23')](respondWithResult(_0x2993d2,0xc9))[_0xe1d1('0x41')](handleError(_0x2993d2,null));};exports[_0xe1d1('0x22')]=function(_0x595b82,_0x517eab){if(_0x595b82[_0xe1d1('0x48')]['id']){delete _0x595b82[_0xe1d1('0x48')]['id'];}return db[_0xe1d1('0x2a')]['find']({'where':{'id':_0x595b82[_0xe1d1('0x43')]['id']}})['then'](handleEntityNotFound(_0x517eab,null))[_0xe1d1('0x23')](saveUpdates(_0x595b82['body'],null))['then'](respondWithResult(_0x517eab,null))[_0xe1d1('0x41')](handleError(_0x517eab,null));};exports[_0xe1d1('0x24')]=function(_0x4cfc3c,_0x175f3b){return db[_0xe1d1('0x2a')][_0xe1d1('0x46')]({'where':{'id':_0x4cfc3c['params']['id']}})['then'](handleEntityNotFound(_0x175f3b,null))['then'](removeEntity(_0x175f3b,null))[_0xe1d1('0x41')](handleError(_0x175f3b,null));}; \ No newline at end of file +var _0x7617=['name','index','Dynamics365Field','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','findAll','rows','show','params','filters','include','catch','create','body','find','html-pdf','eml-format','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x7617,0x1cd));var _0x7761=function(_0x446c3e,_0x1e8c29){_0x446c3e=_0x446c3e-0x0;var _0x1c3048=_0x7617[_0x446c3e];return _0x1c3048;};'use strict';var pdf=require(_0x7761('0x0'));var emlformat=require(_0x7761('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7761('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7761('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7761('0x4'));var path=require(_0x7761('0x5'));var sox=require(_0x7761('0x6'));var csv=require(_0x7761('0x7'));var ejs=require(_0x7761('0x8'));var fs=require('fs');var _=require(_0x7761('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7761('0xa'));var deskjs=require(_0x7761('0xb'));var toCsv=require(_0x7761('0x7'));var querystring=require(_0x7761('0xc'));var Papa=require(_0x7761('0xd'));var authService=require(_0x7761('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7761('0xf'));var qs=require(_0x7761('0x10'));var logger=require(_0x7761('0x11'))(_0x7761('0x12'));var utils=require('../../config/utils');var config=require(_0x7761('0x13'));var db=require(_0x7761('0x14'))['db'];function respondWithStatusCode(_0xdf7d8,_0x33ff41){_0x33ff41=_0x33ff41||0xcc;return function(_0x1f3b97){if(_0x1f3b97){return _0xdf7d8[_0x7761('0x15')](_0x33ff41);}return _0xdf7d8['status'](_0x33ff41)[_0x7761('0x16')]();};}function respondWithResult(_0x1938e7,_0x3fd190){_0x3fd190=_0x3fd190||0xc8;return function(_0xc37ec3){if(_0xc37ec3){return _0x1938e7[_0x7761('0x17')](_0x3fd190)[_0x7761('0x18')](_0xc37ec3);}};}function respondWithFilteredResult(_0x292f1b,_0x5cf5c9){return function(_0x265e6c){if(_0x265e6c){var _0x1ab8de=_0x265e6c[_0x7761('0x19')],_0x5530e2=_0x5cf5c9['offset'],_0x44f95c=_0x5cf5c9[_0x7761('0x1a')]+_0x5cf5c9[_0x7761('0x1b')],_0x51644e;if(_0x44f95c>=_0x1ab8de){_0x44f95c=_0x1ab8de;_0x51644e=0xc8;}else{_0x51644e=0xce;}_0x292f1b['status'](_0x51644e);return _0x292f1b['set'](_0x7761('0x1c'),_0x5530e2+'-'+_0x44f95c+'/'+_0x1ab8de)[_0x7761('0x18')](_0x265e6c);}return null;};}function patchUpdates(_0x81f22f){return function(_0x1fcda2){try{jsonpatch['apply'](_0x1fcda2,_0x81f22f,!![]);}catch(_0x1a6868){return BPromise[_0x7761('0x1d')](_0x1a6868);}return _0x1fcda2[_0x7761('0x1e')]();};}function saveUpdates(_0x24163e,_0x403b05){return function(_0x21a1c0){if(_0x21a1c0){return _0x21a1c0[_0x7761('0x1f')](_0x24163e)[_0x7761('0x20')](function(_0x3beddc){return _0x3beddc;});}return null;};}function removeEntity(_0x5c3e8a,_0x2cc05b){return function(_0x482ecf){if(_0x482ecf){return _0x482ecf[_0x7761('0x21')]()[_0x7761('0x20')](function(){_0x5c3e8a[_0x7761('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12eabc,_0x816194){return function(_0x488f90){if(!_0x488f90){_0x12eabc[_0x7761('0x15')](0x194);}return _0x488f90;};}function handleError(_0x238d69,_0x6f227){_0x6f227=_0x6f227||0x1f4;return function(_0x1e8bc0){logger[_0x7761('0x22')](_0x1e8bc0[_0x7761('0x23')]);if(_0x1e8bc0[_0x7761('0x24')]){delete _0x1e8bc0[_0x7761('0x24')];}_0x238d69[_0x7761('0x17')](_0x6f227)['send'](_0x1e8bc0);};}exports[_0x7761('0x25')]=function(_0x34676e,_0x42b3fe){var _0x1a49b1={},_0x5f4422={},_0x48f059={'count':0x0,'rows':[]};var _0x163e29=db[_0x7761('0x26')][_0x7761('0x27')];_0x5f4422['model']=_[_0x7761('0x28')](_0x163e29);_0x5f4422[_0x7761('0x29')]=_[_0x7761('0x28')](_0x34676e[_0x7761('0x29')]);_0x5f4422['filters']=_[_0x7761('0x2a')](_0x5f4422[_0x7761('0x2b')],_0x5f4422[_0x7761('0x29')]);_0x1a49b1[_0x7761('0x2c')]=_['intersection'](_0x5f4422['model'],qs['fields'](_0x34676e[_0x7761('0x29')][_0x7761('0x2d')]));_0x1a49b1['attributes']=_0x1a49b1[_0x7761('0x2c')][_0x7761('0x2e')]?_0x1a49b1[_0x7761('0x2c')]:_0x5f4422['model'];if(!_0x34676e['query'][_0x7761('0x2f')](_0x7761('0x30'))){_0x1a49b1[_0x7761('0x1b')]=qs['limit'](_0x34676e[_0x7761('0x29')]['limit']);_0x1a49b1[_0x7761('0x1a')]=qs[_0x7761('0x1a')](_0x34676e[_0x7761('0x29')]['offset']);}_0x1a49b1[_0x7761('0x31')]=qs[_0x7761('0x32')](_0x34676e['query']['sort']);_0x1a49b1[_0x7761('0x33')]=qs['filters'](_[_0x7761('0x34')](_0x34676e['query'],_0x5f4422['filters']));if(_0x34676e[_0x7761('0x29')]['filter']){_0x1a49b1[_0x7761('0x33')]=_[_0x7761('0x35')](_0x1a49b1[_0x7761('0x33')],{'$or':_[_0x7761('0x36')](_0x163e29,function(_0x50e9a4){if(_0x50e9a4[_0x7761('0x37')][_0x7761('0x38')]!==_0x7761('0x39')){var _0x526355={};_0x526355[_0x50e9a4[_0x7761('0x3a')]]={'$like':'%'+_0x34676e[_0x7761('0x29')][_0x7761('0x3b')]+'%'};return _0x526355;}})});}_0x1a49b1=_['merge']({},_0x1a49b1,_0x34676e[_0x7761('0x3c')]);var _0x103f7a={'where':_0x1a49b1[_0x7761('0x33')]};return db[_0x7761('0x26')]['count'](_0x103f7a)[_0x7761('0x20')](function(_0x2c9caa){_0x48f059[_0x7761('0x19')]=_0x2c9caa;if(_0x34676e[_0x7761('0x29')]['includeAll']){_0x1a49b1['include']=[{'all':!![]}];}return db[_0x7761('0x26')][_0x7761('0x3d')](_0x1a49b1);})[_0x7761('0x20')](function(_0x3ade84){_0x48f059[_0x7761('0x3e')]=_0x3ade84;return _0x48f059;})[_0x7761('0x20')](respondWithFilteredResult(_0x42b3fe,_0x1a49b1))['catch'](handleError(_0x42b3fe,null));};exports[_0x7761('0x3f')]=function(_0x5a1a72,_0xb7ecc8){var _0x4410aa={'raw':!![],'where':{'id':_0x5a1a72[_0x7761('0x40')]['id']}},_0x24f954={};_0x24f954[_0x7761('0x2b')]=_[_0x7761('0x28')](db['Dynamics365Field'][_0x7761('0x27')]);_0x24f954[_0x7761('0x29')]=_[_0x7761('0x28')](_0x5a1a72[_0x7761('0x29')]);_0x24f954[_0x7761('0x41')]=_[_0x7761('0x2a')](_0x24f954['model'],_0x24f954[_0x7761('0x29')]);_0x4410aa[_0x7761('0x2c')]=_[_0x7761('0x2a')](_0x24f954[_0x7761('0x2b')],qs[_0x7761('0x2d')](_0x5a1a72['query'][_0x7761('0x2d')]));_0x4410aa[_0x7761('0x2c')]=_0x4410aa[_0x7761('0x2c')]['length']?_0x4410aa['attributes']:_0x24f954['model'];if(_0x5a1a72[_0x7761('0x29')]['includeAll']){_0x4410aa[_0x7761('0x42')]=[{'all':!![]}];}_0x4410aa=_[_0x7761('0x35')]({},_0x4410aa,_0x5a1a72[_0x7761('0x3c')]);return db[_0x7761('0x26')]['find'](_0x4410aa)['then'](handleEntityNotFound(_0xb7ecc8,null))[_0x7761('0x20')](respondWithResult(_0xb7ecc8,null))[_0x7761('0x43')](handleError(_0xb7ecc8,null));};exports[_0x7761('0x44')]=function(_0x1dda10,_0x9c0c18){return db['Dynamics365Field'][_0x7761('0x44')](_0x1dda10[_0x7761('0x45')],{})[_0x7761('0x20')](respondWithResult(_0x9c0c18,0xc9))[_0x7761('0x43')](handleError(_0x9c0c18,null));};exports[_0x7761('0x1f')]=function(_0x229437,_0x53f9be){if(_0x229437[_0x7761('0x45')]['id']){delete _0x229437[_0x7761('0x45')]['id'];}return db[_0x7761('0x26')][_0x7761('0x46')]({'where':{'id':_0x229437[_0x7761('0x40')]['id']}})['then'](handleEntityNotFound(_0x53f9be,null))[_0x7761('0x20')](saveUpdates(_0x229437[_0x7761('0x45')],null))[_0x7761('0x20')](respondWithResult(_0x53f9be,null))[_0x7761('0x43')](handleError(_0x53f9be,null));};exports[_0x7761('0x21')]=function(_0x5a580d,_0x2949ce){return db['Dynamics365Field']['find']({'where':{'id':_0x5a580d[_0x7761('0x40')]['id']}})[_0x7761('0x20')](handleEntityNotFound(_0x2949ce,null))['then'](removeEntity(_0x2949ce,null))[_0x7761('0x43')](handleError(_0x2949ce,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 8a524b2..d80e021 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 _0x0e52=['int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','./intDynamics365Field.attributes','define'];(function(_0x1ba0a3,_0x35822e){var _0x43b37b=function(_0x1bc6e2){while(--_0x1bc6e2){_0x1ba0a3['push'](_0x1ba0a3['shift']());}};_0x43b37b(++_0x35822e);}(_0x0e52,0x117));var _0x20e5=function(_0x29e076,_0x5b1cce){_0x29e076=_0x29e076-0x0;var _0x3569f0=_0x0e52[_0x29e076];return _0x3569f0;};'use strict';var _=require(_0x20e5('0x0'));var util=require(_0x20e5('0x1'));var logger=require(_0x20e5('0x2'))(_0x20e5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x20e5('0x4'));var attributes=require(_0x20e5('0x5'));module['exports']=function(_0x233436,_0x1ab6bc){return _0x233436[_0x20e5('0x6')]('Dynamics365Field',attributes,{'tableName':_0x20e5('0x7'),'paranoid':![],'indexes':[{'name':_0x20e5('0x8'),'fields':[_0x20e5('0x9'),_0x20e5('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8864=['idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x3cad31,_0x25658c){var _0x3855a0=function(_0x4dcfdc){while(--_0x4dcfdc){_0x3cad31['push'](_0x3cad31['shift']());}};_0x3855a0(++_0x25658c);}(_0x8864,0xff));var _0x4886=function(_0x5c4d15,_0x32fe23){_0x5c4d15=_0x5c4d15-0x0;var _0x1f974a=_0x8864[_0x5c4d15];return _0x1f974a;};'use strict';var _=require(_0x4886('0x0'));var util=require('util');var logger=require(_0x4886('0x1'))(_0x4886('0x2'));var moment=require('moment');var BPromise=require(_0x4886('0x3'));var rp=require(_0x4886('0x4'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x477fe3,_0x1a0d66){return _0x477fe3[_0x4886('0x5')](_0x4886('0x6'),attributes,{'tableName':_0x4886('0x7'),'paranoid':![],'indexes':[{'name':_0x4886('0x8'),'fields':[_0x4886('0x9'),_0x4886('0xa')],'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 80cb243..0cc436a 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 _0xf496=['rpc','../../config/environment','jayson/promise','client','request','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Dynamics365Field,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x44799d,_0x26c23a){var _0x4f4a20=function(_0x298a71){while(--_0x298a71){_0x44799d['push'](_0x44799d['shift']());}};_0x4f4a20(++_0x26c23a);}(_0xf496,0x1c7));var _0x6f49=function(_0x4a53bd,_0x4186ac){_0x4a53bd=_0x4a53bd-0x0;var _0x1bfbd8=_0xf496[_0x4a53bd];return _0x1bfbd8;};'use strict';var _=require(_0x6f49('0x0'));var util=require(_0x6f49('0x1'));var moment=require(_0x6f49('0x2'));var BPromise=require(_0x6f49('0x3'));var rs=require(_0x6f49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f49('0x5'))['db'];var utils=require(_0x6f49('0x6'));var logger=require('../../config/logger')(_0x6f49('0x7'));var config=require(_0x6f49('0x8'));var jayson=require(_0x6f49('0x9'));var client=jayson[_0x6f49('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1185c8,_0x23d8d7,_0x426d37){return new BPromise(function(_0x4792ec,_0x587bb5){return client[_0x6f49('0xb')](_0x1185c8,_0x426d37)['then'](function(_0x41fe1e){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x23d8d7,'request\x20sent');logger['debug'](_0x6f49('0xc'),_0x23d8d7,_0x6f49('0xd'),JSON['stringify'](_0x41fe1e));if(_0x41fe1e[_0x6f49('0xe')]){if(_0x41fe1e[_0x6f49('0xe')][_0x6f49('0xf')]===0x1f4){logger[_0x6f49('0xe')](_0x6f49('0x10'),_0x23d8d7,_0x41fe1e[_0x6f49('0xe')][_0x6f49('0x11')]);return _0x587bb5(_0x41fe1e[_0x6f49('0xe')][_0x6f49('0x11')]);}logger['error'](_0x6f49('0x10'),_0x23d8d7,_0x41fe1e[_0x6f49('0xe')][_0x6f49('0x11')]);return _0x4792ec(_0x41fe1e['error'][_0x6f49('0x11')]);}else{logger[_0x6f49('0x12')](_0x6f49('0x10'),_0x23d8d7,_0x6f49('0xd'));_0x4792ec(_0x41fe1e[_0x6f49('0x13')][_0x6f49('0x11')]);}})[_0x6f49('0x14')](function(_0x515dc6){logger[_0x6f49('0xe')](_0x6f49('0x10'),_0x23d8d7,_0x515dc6);_0x587bb5(_0x515dc6);});});} \ No newline at end of file +var _0x1e41=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e41,0x11c));var _0x11e4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1e41[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x11e4('0x0'));var moment=require(_0x11e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x11e4('0x2'));var fs=require('fs');var Redis=require(_0x11e4('0x3'));var db=require(_0x11e4('0x4'))['db'];var utils=require(_0x11e4('0x5'));var logger=require('../../config/logger')(_0x11e4('0x6'));var config=require(_0x11e4('0x7'));var jayson=require(_0x11e4('0x8'));var client=jayson['client'][_0x11e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xee095e,_0x1eab1b,_0x2b1b9a){return new BPromise(function(_0x15ca35,_0x153e81){return client[_0x11e4('0xa')](_0xee095e,_0x2b1b9a)['then'](function(_0x3c1a5c){logger[_0x11e4('0xb')](_0x11e4('0xc'),_0x1eab1b,_0x11e4('0xd'));logger[_0x11e4('0xe')](_0x11e4('0xf'),_0x1eab1b,_0x11e4('0xd'),JSON[_0x11e4('0x10')](_0x3c1a5c));if(_0x3c1a5c['error']){if(_0x3c1a5c[_0x11e4('0x11')][_0x11e4('0x12')]===0x1f4){logger[_0x11e4('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x1eab1b,_0x3c1a5c['error'][_0x11e4('0x13')]);return _0x153e81(_0x3c1a5c[_0x11e4('0x11')]['message']);}logger[_0x11e4('0x11')](_0x11e4('0xc'),_0x1eab1b,_0x3c1a5c[_0x11e4('0x11')][_0x11e4('0x13')]);return _0x15ca35(_0x3c1a5c[_0x11e4('0x11')][_0x11e4('0x13')]);}else{logger['info'](_0x11e4('0xc'),_0x1eab1b,_0x11e4('0xd'));_0x15ca35(_0x3c1a5c[_0x11e4('0x14')]['message']);}})[_0x11e4('0x15')](function(_0xd2c83e){logger[_0x11e4('0x11')](_0x11e4('0xc'),_0x1eab1b,_0xd2c83e);_0x153e81(_0xd2c83e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 68b4181..82cd360 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 _0x9f38=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','util','path','connect-timeout'];(function(_0x559eb8,_0x3e338b){var _0x4c2f59=function(_0x6a3ff5){while(--_0x6a3ff5){_0x559eb8['push'](_0x559eb8['shift']());}};_0x4c2f59(++_0x3e338b);}(_0x9f38,0xd9));var _0x89f3=function(_0x3fa2b2,_0x313fe2){_0x3fa2b2=_0x3fa2b2-0x0;var _0x40c516=_0x9f38[_0x3fa2b2];return _0x40c516;};'use strict';var multer=require('multer');var util=require(_0x89f3('0x0'));var path=require(_0x89f3('0x1'));var timeout=require(_0x89f3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x89f3('0x3'));var interaction=require(_0x89f3('0x4'));var config=require(_0x89f3('0x5'));var controller=require(_0x89f3('0x6'));router[_0x89f3('0x7')]('/',auth[_0x89f3('0x8')](),controller[_0x89f3('0x9')]);router[_0x89f3('0x7')](_0x89f3('0xa'),auth[_0x89f3('0x8')](),controller[_0x89f3('0xb')]);router['get'](_0x89f3('0xc'),auth['isAuthenticated'](),controller[_0x89f3('0xd')]);router[_0x89f3('0x7')](_0x89f3('0xe'),auth[_0x89f3('0x8')](),controller[_0x89f3('0xf')]);router[_0x89f3('0x10')]('/',auth[_0x89f3('0x8')](),controller[_0x89f3('0x11')]);router[_0x89f3('0x10')](_0x89f3('0xc'),auth[_0x89f3('0x8')](),controller[_0x89f3('0x12')]);router['put']('/:id',auth[_0x89f3('0x8')](),controller[_0x89f3('0x13')]);router[_0x89f3('0x14')]('/:id',auth[_0x89f3('0x8')](),controller['destroy']);module[_0x89f3('0x15')]=router; \ No newline at end of file +var _0x30d8=['post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create'];(function(_0x1ea492,_0x677c05){var _0x376d0e=function(_0x74c96e){while(--_0x74c96e){_0x1ea492['push'](_0x1ea492['shift']());}};_0x376d0e(++_0x677c05);}(_0x30d8,0x78));var _0x830d=function(_0x3261b3,_0x330324){_0x3261b3=_0x3261b3-0x0;var _0xd37de6=_0x30d8[_0x3261b3];return _0xd37de6;};'use strict';var multer=require(_0x830d('0x0'));var util=require('util');var path=require(_0x830d('0x1'));var timeout=require(_0x830d('0x2'));var express=require(_0x830d('0x3'));var router=express[_0x830d('0x4')]();var auth=require(_0x830d('0x5'));var interaction=require(_0x830d('0x6'));var config=require(_0x830d('0x7'));var controller=require(_0x830d('0x8'));router[_0x830d('0x9')]('/',auth[_0x830d('0xa')](),controller[_0x830d('0xb')]);router['get'](_0x830d('0xc'),auth[_0x830d('0xa')](),controller[_0x830d('0xd')]);router[_0x830d('0x9')](_0x830d('0xe'),auth[_0x830d('0xa')](),controller[_0x830d('0xf')]);router[_0x830d('0x9')]('/:id/fields',auth[_0x830d('0xa')](),controller[_0x830d('0x10')]);router['post']('/',auth[_0x830d('0xa')](),controller[_0x830d('0x11')]);router[_0x830d('0x12')](_0x830d('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x830d('0x13')](_0x830d('0xc'),auth[_0x830d('0xa')](),controller[_0x830d('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x830d('0x15')]);module[_0x830d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 2b10a1c..dd1b245 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 _0xe3cd=['sequelize','STRING','username'];(function(_0x2b420b,_0x23f0c8){var _0x4727c8=function(_0x2e9907){while(--_0x2e9907){_0x2b420b['push'](_0x2b420b['shift']());}};_0x4727c8(++_0x23f0c8);}(_0xe3cd,0x16b));var _0xde3c=function(_0x52e715,_0x146427){_0x52e715=_0x52e715-0x0;var _0x29a465=_0xe3cd[_0x52e715];return _0x29a465;};'use strict';var Sequelize=require(_0xde3c('0x0'));module['exports']={'name':{'type':Sequelize[_0xde3c('0x1')]},'description':{'type':Sequelize[_0xde3c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xde3c('0x2')},'apiKey':{'type':Sequelize[_0xde3c('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xde3c('0x1')]}}; \ No newline at end of file +var _0x7cd8=['sequelize','exports','username','STRING','remoteUri'];(function(_0x4c2769,_0x42aadd){var _0x27bdf9=function(_0x4136a5){while(--_0x4136a5){_0x4c2769['push'](_0x4c2769['shift']());}};_0x27bdf9(++_0x42aadd);}(_0x7cd8,0x1e5));var _0x87cd=function(_0xe43a78,_0x5f0fdd){_0xe43a78=_0xe43a78-0x0;var _0x3a451f=_0x7cd8[_0xe43a78];return _0x3a451f;};'use strict';var Sequelize=require(_0x87cd('0x0'));module[_0x87cd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x87cd('0x2')},'apiKey':{'type':Sequelize[_0x87cd('0x3')]},'remoteUri':{'type':Sequelize[_0x87cd('0x3')],'unique':_0x87cd('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 5739a33..ad8a98e 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 _0xa9fc=['show','params','includeAll','options','create','body','find','destroy','findOne','FreshdeskConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request\x20sent','debug','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','Content-Range','reject','update','then','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','field','include','rows'];(function(_0x26a818,_0x40708a){var _0x5d8ca0=function(_0x3cc7ed){while(--_0x3cc7ed){_0x26a818['push'](_0x26a818['shift']());}};_0x5d8ca0(++_0x40708a);}(_0xa9fc,0x19f));var _0xca9f=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0xa9fc[_0x450689];return _0x46ffb0;};'use strict';var pdf=require(_0xca9f('0x0'));var emlformat=require(_0xca9f('0x1'));var rimraf=require(_0xca9f('0x2'));var zipdir=require(_0xca9f('0x3'));var jsonpatch=require(_0xca9f('0x4'));var rp=require('request-promise');var moment=require(_0xca9f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xca9f('0x6'));var util=require(_0xca9f('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca9f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca9f('0x9'));var crypto=require(_0xca9f('0xa'));var jsforce=require(_0xca9f('0xb'));var deskjs=require(_0xca9f('0xc'));var toCsv=require(_0xca9f('0xd'));var querystring=require(_0xca9f('0xe'));var Papa=require(_0xca9f('0xf'));var authService=require(_0xca9f('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xca9f('0x11'));var qs=require(_0xca9f('0x12'));var logger=require(_0xca9f('0x13'))(_0xca9f('0x14'));var utils=require('../../config/utils');var config=require(_0xca9f('0x15'));var db=require(_0xca9f('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xca9f('0x17'));var client=jayson[_0xca9f('0x18')][_0xca9f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2aefea,_0x14cf3a,_0x13c082,_0x109ec0){return new BPromise(function(_0x2cb6f4,_0x33f8c7){var _0x864d21=_0x109ec0||client;return _0x864d21['request'](_0x2aefea,_0x13c082)['then'](function(_0x300c62){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x14cf3a,_0xca9f('0x1a'));logger[_0xca9f('0x1b')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x14cf3a,_0xca9f('0x1a'),JSON['stringify'](_0x300c62));if(_0x300c62[_0xca9f('0x1c')]){if(_0x300c62['error'][_0xca9f('0x1d')]===0x1f4){logger[_0xca9f('0x1c')](_0xca9f('0x1e'),_0x14cf3a,_0x300c62[_0xca9f('0x1c')][_0xca9f('0x1f')]);return _0x33f8c7(_0x300c62['error'][_0xca9f('0x1f')]);}logger['error'](_0xca9f('0x1e'),_0x14cf3a,_0x300c62[_0xca9f('0x1c')][_0xca9f('0x1f')]);return _0x2cb6f4(_0x300c62[_0xca9f('0x1c')][_0xca9f('0x1f')]);}else{logger['info'](_0xca9f('0x1e'),_0x14cf3a,_0xca9f('0x1a'));_0x2cb6f4(_0x300c62[_0xca9f('0x20')][_0xca9f('0x1f')]);}})[_0xca9f('0x21')](function(_0x4f9e9c){logger['error'](_0xca9f('0x1e'),_0x14cf3a,_0x4f9e9c);_0x33f8c7(_0x4f9e9c);});});}function respondWithStatusCode(_0x96b3ec,_0x162328){_0x162328=_0x162328||0xcc;return function(_0x1066bc){if(_0x1066bc){return _0x96b3ec[_0xca9f('0x22')](_0x162328);}return _0x96b3ec['status'](_0x162328)[_0xca9f('0x23')]();};}function respondWithResult(_0x1f7939,_0x46a0e8){_0x46a0e8=_0x46a0e8||0xc8;return function(_0x4d64eb){if(_0x4d64eb){return _0x1f7939[_0xca9f('0x24')](_0x46a0e8)[_0xca9f('0x25')](_0x4d64eb);}};}function respondWithFilteredResult(_0x428825,_0x133222){return function(_0x88025b){if(_0x88025b){var _0x4c4558=_0x88025b[_0xca9f('0x26')],_0xa5f9bc=_0x133222[_0xca9f('0x27')],_0x33efe0=_0x133222['offset']+_0x133222['limit'],_0x4297c8;if(_0x33efe0>=_0x4c4558){_0x33efe0=_0x4c4558;_0x4297c8=0xc8;}else{_0x4297c8=0xce;}_0x428825[_0xca9f('0x24')](_0x4297c8);return _0x428825['set'](_0xca9f('0x28'),_0xa5f9bc+'-'+_0x33efe0+'/'+_0x4c4558)[_0xca9f('0x25')](_0x88025b);}return null;};}function patchUpdates(_0x17d202){return function(_0x1360d1){try{jsonpatch['apply'](_0x1360d1,_0x17d202,!![]);}catch(_0x596703){return BPromise[_0xca9f('0x29')](_0x596703);}return _0x1360d1['save']();};}function saveUpdates(_0x26b33d,_0x54beae){return function(_0x2fa5e1){if(_0x2fa5e1){return _0x2fa5e1[_0xca9f('0x2a')](_0x26b33d)[_0xca9f('0x2b')](function(_0x300aa2){return _0x300aa2;});}return null;};}function removeEntity(_0x282dc4,_0x1c9138){return function(_0x4f9368){if(_0x4f9368){return _0x4f9368['destroy']()[_0xca9f('0x2b')](function(){_0x282dc4['status'](0xcc)[_0xca9f('0x23')]();});}};}function handleEntityNotFound(_0x33a9d5,_0x2c2d98){return function(_0x4bb01e){if(!_0x4bb01e){_0x33a9d5['sendStatus'](0x194);}return _0x4bb01e;};}function handleError(_0x42b113,_0x359026){_0x359026=_0x359026||0x1f4;return function(_0xe5d738){logger['error'](_0xe5d738[_0xca9f('0x2c')]);if(_0xe5d738[_0xca9f('0x2d')]){delete _0xe5d738['name'];}_0x42b113['status'](_0x359026)[_0xca9f('0x2e')](_0xe5d738);};}exports[_0xca9f('0x2f')]=function(_0x33e1dc,_0x4363fd){var _0x48205e={},_0x34538e={},_0x3c44ea={'count':0x0,'rows':[]};var _0x28b5f9=db[_0xca9f('0x30')][_0xca9f('0x31')];_0x34538e[_0xca9f('0x32')]=_[_0xca9f('0x33')](_0x28b5f9);_0x34538e[_0xca9f('0x34')]=_['keys'](_0x33e1dc[_0xca9f('0x34')]);_0x34538e['filters']=_[_0xca9f('0x35')](_0x34538e[_0xca9f('0x32')],_0x34538e['query']);_0x48205e[_0xca9f('0x36')]=_[_0xca9f('0x35')](_0x34538e[_0xca9f('0x32')],qs[_0xca9f('0x37')](_0x33e1dc[_0xca9f('0x34')]['fields']));_0x48205e['attributes']=_0x48205e['attributes'][_0xca9f('0x38')]?_0x48205e[_0xca9f('0x36')]:_0x34538e[_0xca9f('0x32')];if(!_0x33e1dc['query'][_0xca9f('0x39')](_0xca9f('0x3a'))){_0x48205e['limit']=qs[_0xca9f('0x3b')](_0x33e1dc[_0xca9f('0x34')]['limit']);_0x48205e[_0xca9f('0x27')]=qs[_0xca9f('0x27')](_0x33e1dc[_0xca9f('0x34')][_0xca9f('0x27')]);}_0x48205e[_0xca9f('0x3c')]=qs['sort'](_0x33e1dc[_0xca9f('0x34')][_0xca9f('0x3d')]);_0x48205e['where']=qs[_0xca9f('0x3e')](_[_0xca9f('0x3f')](_0x33e1dc[_0xca9f('0x34')],_0x34538e[_0xca9f('0x3e')]));if(_0x33e1dc[_0xca9f('0x34')][_0xca9f('0x40')]){_0x48205e[_0xca9f('0x41')]=_[_0xca9f('0x42')](_0x48205e[_0xca9f('0x41')],{'$or':_[_0xca9f('0x43')](_0x28b5f9,function(_0x2bc911){if(_0x2bc911[_0xca9f('0x44')]['key']!==_0xca9f('0x45')){var _0x874947={};_0x874947[_0x2bc911[_0xca9f('0x46')]]={'$like':'%'+_0x33e1dc[_0xca9f('0x34')][_0xca9f('0x40')]+'%'};return _0x874947;}})});}_0x48205e=_['merge']({},_0x48205e,_0x33e1dc['options']);var _0x470ad6={'where':_0x48205e['where']};return db[_0xca9f('0x30')][_0xca9f('0x26')](_0x470ad6)[_0xca9f('0x2b')](function(_0x33cba8){_0x3c44ea[_0xca9f('0x26')]=_0x33cba8;if(_0x33e1dc[_0xca9f('0x34')]['includeAll']){_0x48205e[_0xca9f('0x47')]=[{'all':!![]}];}return db[_0xca9f('0x30')]['findAll'](_0x48205e);})[_0xca9f('0x2b')](function(_0x3e61c6){_0x3c44ea[_0xca9f('0x48')]=_0x3e61c6;return _0x3c44ea;})[_0xca9f('0x2b')](respondWithFilteredResult(_0x4363fd,_0x48205e))['catch'](handleError(_0x4363fd,null));};exports[_0xca9f('0x49')]=function(_0x543b3c,_0x405728){var _0xd89e45={'raw':![],'where':{'id':_0x543b3c[_0xca9f('0x4a')]['id']}},_0x1147bd={};_0x1147bd['model']=_['keys'](db['FreshdeskAccount'][_0xca9f('0x31')]);_0x1147bd[_0xca9f('0x34')]=_[_0xca9f('0x33')](_0x543b3c[_0xca9f('0x34')]);_0x1147bd[_0xca9f('0x3e')]=_[_0xca9f('0x35')](_0x1147bd[_0xca9f('0x32')],_0x1147bd[_0xca9f('0x34')]);_0xd89e45[_0xca9f('0x36')]=_[_0xca9f('0x35')](_0x1147bd['model'],qs[_0xca9f('0x37')](_0x543b3c['query'][_0xca9f('0x37')]));_0xd89e45[_0xca9f('0x36')]=_0xd89e45['attributes'][_0xca9f('0x38')]?_0xd89e45[_0xca9f('0x36')]:_0x1147bd[_0xca9f('0x32')];if(_0x543b3c[_0xca9f('0x34')][_0xca9f('0x4b')]){_0xd89e45[_0xca9f('0x47')]=[{'all':!![]}];}_0xd89e45=_[_0xca9f('0x42')]({},_0xd89e45,_0x543b3c[_0xca9f('0x4c')]);return db['FreshdeskAccount']['find'](_0xd89e45)[_0xca9f('0x2b')](handleEntityNotFound(_0x405728,null))[_0xca9f('0x2b')](respondWithResult(_0x405728,null))[_0xca9f('0x21')](handleError(_0x405728,null));};exports[_0xca9f('0x4d')]=function(_0x18acdc,_0x14ba2c){return db['FreshdeskAccount'][_0xca9f('0x4d')](_0x18acdc[_0xca9f('0x4e')],{})[_0xca9f('0x2b')](respondWithResult(_0x14ba2c,0xc9))['catch'](handleError(_0x14ba2c,null));};exports[_0xca9f('0x2a')]=function(_0x4772dc,_0x595ba2){if(_0x4772dc['body']['id']){delete _0x4772dc[_0xca9f('0x4e')]['id'];}return db[_0xca9f('0x30')][_0xca9f('0x4f')]({'where':{'id':_0x4772dc[_0xca9f('0x4a')]['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0x595ba2,null))[_0xca9f('0x2b')](saveUpdates(_0x4772dc[_0xca9f('0x4e')],null))[_0xca9f('0x2b')](respondWithResult(_0x595ba2,null))[_0xca9f('0x21')](handleError(_0x595ba2,null));};exports[_0xca9f('0x50')]=function(_0x1db533,_0x41f4de){return db[_0xca9f('0x30')][_0xca9f('0x4f')]({'where':{'id':_0x1db533[_0xca9f('0x4a')]['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0x41f4de,null))[_0xca9f('0x2b')](removeEntity(_0x41f4de,null))[_0xca9f('0x21')](handleError(_0x41f4de,null));};exports['getConfigurations']=function(_0x3ad946,_0xbe329b,_0x505ce6){var _0x5c8119={};var _0x5ac9ed={};var _0x36512d;var _0xca2173;return db[_0xca9f('0x30')][_0xca9f('0x51')]({'where':{'id':_0x3ad946[_0xca9f('0x4a')]['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0xbe329b,null))[_0xca9f('0x2b')](function(_0xf769a8){if(_0xf769a8){_0x36512d=_0xf769a8;_0x5ac9ed[_0xca9f('0x32')]=_['keys'](db[_0xca9f('0x52')]['rawAttributes']);_0x5ac9ed['query']=_['keys'](_0x3ad946[_0xca9f('0x34')]);_0x5ac9ed[_0xca9f('0x3e')]=_[_0xca9f('0x35')](_0x5ac9ed['model'],_0x5ac9ed['query']);_0x5c8119[_0xca9f('0x36')]=_[_0xca9f('0x35')](_0x5ac9ed['model'],qs['fields'](_0x3ad946[_0xca9f('0x34')][_0xca9f('0x37')]));_0x5c8119['attributes']=_0x5c8119[_0xca9f('0x36')][_0xca9f('0x38')]?_0x5c8119['attributes']:_0x5ac9ed['model'];_0x5c8119[_0xca9f('0x3c')]=qs[_0xca9f('0x3d')](_0x3ad946['query'][_0xca9f('0x3d')]);_0x5c8119['where']=qs['filters'](_[_0xca9f('0x3f')](_0x3ad946['query'],_0x5ac9ed['filters']));if(_0x3ad946[_0xca9f('0x34')][_0xca9f('0x40')]){_0x5c8119[_0xca9f('0x41')]=_[_0xca9f('0x42')](_0x5c8119['where'],{'$or':_[_0xca9f('0x43')](_0x5c8119[_0xca9f('0x36')],function(_0x5b105f){var _0xd292fd={};_0xd292fd[_0x5b105f]={'$like':'%'+_0x3ad946[_0xca9f('0x34')][_0xca9f('0x40')]+'%'};return _0xd292fd;})});}_0x5c8119=_['merge']({},_0x5c8119,_0x3ad946[_0xca9f('0x4c')]);return _0x36512d[_0xca9f('0x53')](_0x5c8119);}})[_0xca9f('0x2b')](function(_0x5080cd){if(_0x5080cd){_0xca2173=_0x5080cd[_0xca9f('0x38')];if(!_0x3ad946[_0xca9f('0x34')][_0xca9f('0x39')](_0xca9f('0x3a'))){_0x5c8119[_0xca9f('0x3b')]=qs[_0xca9f('0x3b')](_0x3ad946[_0xca9f('0x34')]['limit']);_0x5c8119[_0xca9f('0x27')]=qs['offset'](_0x3ad946['query']['offset']);}return _0x36512d['getConfigurations'](_0x5c8119);}})['then'](function(_0x23e815){if(_0x23e815){return _0x23e815?{'count':_0xca2173,'rows':_0x23e815}:null;}})['then'](respondWithResult(_0xbe329b,null))['catch'](handleError(_0xbe329b,null));};exports['addConfiguration']=function(_0x2d9d23,_0x5e960a,_0xfaf6af){if(_0x2d9d23['body']['id']){delete _0x2d9d23['body']['id'];}return db[_0xca9f('0x30')]['findOne']({'where':{'id':_0x2d9d23[_0xca9f('0x4a')]['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0x5e960a,null))[_0xca9f('0x2b')](function(_0x2f5368){if(_0x2f5368){_0x2d9d23[_0xca9f('0x4e')][_0xca9f('0x54')]=_0x2f5368['id'];_0x2d9d23[_0xca9f('0x4e')][_0xca9f('0x55')]=integrations[_0xca9f('0x56')](_0x2d9d23[_0xca9f('0x4e')][_0xca9f('0x57')],_0x2d9d23[_0xca9f('0x4e')][_0xca9f('0x44')]);_0x2d9d23[_0xca9f('0x4e')][_0xca9f('0x58')]=integrations['getDescriptions'](_0x2d9d23[_0xca9f('0x4e')]['channel'],_0x2d9d23[_0xca9f('0x4e')][_0xca9f('0x44')]);return db[_0xca9f('0x52')]['create'](_0x2d9d23[_0xca9f('0x4e')],{'include':[{'model':db[_0xca9f('0x59')],'as':_0xca9f('0x55')},{'model':db[_0xca9f('0x59')],'as':_0xca9f('0x58')}]});}return null;})['then'](respondWithResult(_0x5e960a,null))[_0xca9f('0x21')](handleError(_0x5e960a,null));};exports[_0xca9f('0x5a')]=function(_0xc84c0b,_0x25db8c,_0x3158dc){var _0x55c421='';return db[_0xca9f('0x30')][_0xca9f('0x51')]({'where':{'id':_0xc84c0b[_0xca9f('0x4a')]['id']},'attributes':['id',_0xca9f('0x5b'),_0xca9f('0x5c')]})[_0xca9f('0x2b')](handleEntityNotFound(_0x25db8c,null))[_0xca9f('0x2b')](function(_0x2d2d9a){if(_0x2d2d9a){_0x55c421=_0x2d2d9a[_0xca9f('0x5b')];var _0x18a19d=_0x55c421[_0xca9f('0x5d')](-0x1);if(_0x18a19d==='/'){_0x55c421=_0x55c421['substring'](0x0,_0x55c421[_0xca9f('0x5e')](_0x18a19d));}return rp({'method':'GET','uri':util[_0xca9f('0x5f')](_0xca9f('0x60'),_0x55c421,_0xca9f('0x61')),'headers':{'Authorization':util[_0xca9f('0x5f')](_0xca9f('0x62'),new Buffer(util[_0xca9f('0x5f')](_0xca9f('0x63'),_0x2d2d9a[_0xca9f('0x5c')]))[_0xca9f('0x64')](_0xca9f('0x65')))},'json':!![]});}})[_0xca9f('0x2b')](function(_0x4db1cd){if(_0x4db1cd){var _0x46372c=[_0xca9f('0x66'),_0xca9f('0x67'),_0xca9f('0x68'),_0xca9f('0x69'),_0xca9f('0x24'),_0xca9f('0x6a'),'group',_0xca9f('0x6b'),_0xca9f('0x6c'),_0xca9f('0x6d'),_0xca9f('0x6e')];_['remove'](_0x4db1cd,function(_0xfe941f){return _0x46372c[_0xca9f('0x6f')](_0xfe941f['name'])||!_0xfe941f[_0xca9f('0x70')]&&_0xfe941f['type']!==_0xca9f('0x71')&&_0xfe941f['type']!==_0xca9f('0x72');});return{'count':_0x4db1cd[_0xca9f('0x38')],'rows':_['map'](_0x4db1cd,function(_0x47fdcc){return{'id':_0x47fdcc['name'],'name':_0x47fdcc[_0xca9f('0x73')],'custom':!_0x47fdcc[_0xca9f('0x70')],'options':_0x47fdcc[_0xca9f('0x74')]?_[_0xca9f('0x43')](_0x47fdcc[_0xca9f('0x74')],function(_0xe936f1){return{'name':_['capitalize'](_0xe936f1),'value':_0xe936f1};}):[]};})};}})[_0xca9f('0x2b')](respondWithResult(_0x25db8c,null))['catch'](function(_0x1d3441){var _0x21e8ba=_0xc84c0b[_0xca9f('0x34')][_0xca9f('0x75')]?0x1f4:_0x1d3441[_0xca9f('0x76')]||0x1f4;logger['error'](_0xca9f('0x77'),_0xca9f('0x5a'),_0x21e8ba,JSON[_0xca9f('0x78')](_0x1d3441));delete _0x1d3441[_0xca9f('0x2d')];if(_0x21e8ba===0x191){_0x21e8ba=0x190;}_0x25db8c[_0xca9f('0x24')](_0x21e8ba)[_0xca9f('0x2e')](_0xc84c0b[_0xca9f('0x34')][_0xca9f('0x75')]?{'message':_0xca9f('0x79'),'statusCode':_0x1d3441[_0xca9f('0x76')]}:_0x1d3441);});}; \ No newline at end of file +var _0x0b0e=['body','find','params','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','channel','Descriptions','getDescriptions','FreshdeskField','Subjects','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','requester','subject','agent','priority','source','ticket_type','group','company','remove','custom_text','custom_dropdown','map','label','default','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','status','json','count','offset','limit','Content-Range','apply','reject','then','end','sendStatus','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','field','includeAll','include','rows','catch','options','create'];(function(_0x4b5d2c,_0x4bcd69){var _0x38f6b2=function(_0x411356){while(--_0x411356){_0x4b5d2c['push'](_0x4b5d2c['shift']());}};_0x38f6b2(++_0x4bcd69);}(_0x0b0e,0x187));var _0xe0b0=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0x0b0e[_0x57d740];return _0x6607ef;};'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 authService=require(_0xe0b0('0x10'));var hardwareService=require(_0xe0b0('0x11'));var Redis=require('ioredis');var qs=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'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe0b0('0x17'));var client=jayson[_0xe0b0('0x18')][_0xe0b0('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x45f914,_0x34fed4,_0x4d2bf7,_0x3782be){return new BPromise(function(_0x154de6,_0x743318){var _0x24babd=_0x3782be||client;return _0x24babd[_0xe0b0('0x1a')](_0x45f914,_0x4d2bf7)['then'](function(_0x41a7e2){logger['info'](_0xe0b0('0x1b'),_0x34fed4,_0xe0b0('0x1c'));logger['debug'](_0xe0b0('0x1d'),_0x34fed4,'request\x20sent',JSON[_0xe0b0('0x1e')](_0x41a7e2));if(_0x41a7e2[_0xe0b0('0x1f')]){if(_0x41a7e2['error']['code']===0x1f4){logger[_0xe0b0('0x1f')]('FreshdeskAccount,\x20%s,\x20%s',_0x34fed4,_0x41a7e2['error']['message']);return _0x743318(_0x41a7e2[_0xe0b0('0x1f')]['message']);}logger['error'](_0xe0b0('0x1b'),_0x34fed4,_0x41a7e2['error'][_0xe0b0('0x20')]);return _0x154de6(_0x41a7e2['error'][_0xe0b0('0x20')]);}else{logger[_0xe0b0('0x21')](_0xe0b0('0x1b'),_0x34fed4,_0xe0b0('0x1c'));_0x154de6(_0x41a7e2[_0xe0b0('0x22')]['message']);}})['catch'](function(_0x2fa820){logger['error'](_0xe0b0('0x1b'),_0x34fed4,_0x2fa820);_0x743318(_0x2fa820);});});}function respondWithStatusCode(_0x31b5f8,_0x513e63){_0x513e63=_0x513e63||0xcc;return function(_0x170ad8){if(_0x170ad8){return _0x31b5f8['sendStatus'](_0x513e63);}return _0x31b5f8[_0xe0b0('0x23')](_0x513e63)['end']();};}function respondWithResult(_0x28586d,_0x576352){_0x576352=_0x576352||0xc8;return function(_0x3e5c88){if(_0x3e5c88){return _0x28586d['status'](_0x576352)[_0xe0b0('0x24')](_0x3e5c88);}};}function respondWithFilteredResult(_0x4aafbe,_0x3c221d){return function(_0x5c5317){if(_0x5c5317){var _0x362aba=_0x5c5317[_0xe0b0('0x25')],_0x3c3bc2=_0x3c221d[_0xe0b0('0x26')],_0x1f1ebd=_0x3c221d['offset']+_0x3c221d[_0xe0b0('0x27')],_0x1d91ad;if(_0x1f1ebd>=_0x362aba){_0x1f1ebd=_0x362aba;_0x1d91ad=0xc8;}else{_0x1d91ad=0xce;}_0x4aafbe[_0xe0b0('0x23')](_0x1d91ad);return _0x4aafbe['set'](_0xe0b0('0x28'),_0x3c3bc2+'-'+_0x1f1ebd+'/'+_0x362aba)[_0xe0b0('0x24')](_0x5c5317);}return null;};}function patchUpdates(_0x36d137){return function(_0x1d5759){try{jsonpatch[_0xe0b0('0x29')](_0x1d5759,_0x36d137,!![]);}catch(_0x254cad){return BPromise[_0xe0b0('0x2a')](_0x254cad);}return _0x1d5759['save']();};}function saveUpdates(_0x1854b8,_0x3c0109){return function(_0x48a9b5){if(_0x48a9b5){return _0x48a9b5['update'](_0x1854b8)[_0xe0b0('0x2b')](function(_0x33e672){return _0x33e672;});}return null;};}function removeEntity(_0x422575,_0x3f81d5){return function(_0x2ab1b1){if(_0x2ab1b1){return _0x2ab1b1['destroy']()[_0xe0b0('0x2b')](function(){_0x422575[_0xe0b0('0x23')](0xcc)[_0xe0b0('0x2c')]();});}};}function handleEntityNotFound(_0x29d725,_0x27158f){return function(_0x4fe835){if(!_0x4fe835){_0x29d725[_0xe0b0('0x2d')](0x194);}return _0x4fe835;};}function handleError(_0x208945,_0xfc51d3){_0xfc51d3=_0xfc51d3||0x1f4;return function(_0x31c6f5){logger[_0xe0b0('0x1f')](_0x31c6f5[_0xe0b0('0x2e')]);if(_0x31c6f5[_0xe0b0('0x2f')]){delete _0x31c6f5[_0xe0b0('0x2f')];}_0x208945[_0xe0b0('0x23')](_0xfc51d3)[_0xe0b0('0x30')](_0x31c6f5);};}exports[_0xe0b0('0x31')]=function(_0x1a0c90,_0x1d35bc){var _0x2a1c44={},_0xca25d={},_0x4cf80c={'count':0x0,'rows':[]};var _0x121608=db[_0xe0b0('0x32')][_0xe0b0('0x33')];_0xca25d[_0xe0b0('0x34')]=_[_0xe0b0('0x35')](_0x121608);_0xca25d[_0xe0b0('0x36')]=_[_0xe0b0('0x35')](_0x1a0c90['query']);_0xca25d['filters']=_['intersection'](_0xca25d['model'],_0xca25d[_0xe0b0('0x36')]);_0x2a1c44[_0xe0b0('0x37')]=_[_0xe0b0('0x38')](_0xca25d['model'],qs[_0xe0b0('0x39')](_0x1a0c90[_0xe0b0('0x36')][_0xe0b0('0x39')]));_0x2a1c44[_0xe0b0('0x37')]=_0x2a1c44['attributes'][_0xe0b0('0x3a')]?_0x2a1c44[_0xe0b0('0x37')]:_0xca25d[_0xe0b0('0x34')];if(!_0x1a0c90[_0xe0b0('0x36')][_0xe0b0('0x3b')](_0xe0b0('0x3c'))){_0x2a1c44[_0xe0b0('0x27')]=qs[_0xe0b0('0x27')](_0x1a0c90[_0xe0b0('0x36')]['limit']);_0x2a1c44[_0xe0b0('0x26')]=qs['offset'](_0x1a0c90[_0xe0b0('0x36')][_0xe0b0('0x26')]);}_0x2a1c44[_0xe0b0('0x3d')]=qs[_0xe0b0('0x3e')](_0x1a0c90['query'][_0xe0b0('0x3e')]);_0x2a1c44[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_[_0xe0b0('0x41')](_0x1a0c90[_0xe0b0('0x36')],_0xca25d[_0xe0b0('0x40')]));if(_0x1a0c90[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x2a1c44['where']=_[_0xe0b0('0x43')](_0x2a1c44[_0xe0b0('0x3f')],{'$or':_['map'](_0x121608,function(_0x515bd2){if(_0x515bd2[_0xe0b0('0x44')][_0xe0b0('0x45')]!=='VIRTUAL'){var _0x18a59d={};_0x18a59d[_0x515bd2[_0xe0b0('0x46')]]={'$like':'%'+_0x1a0c90[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x18a59d;}})});}_0x2a1c44=_[_0xe0b0('0x43')]({},_0x2a1c44,_0x1a0c90['options']);var _0x5d2fa2={'where':_0x2a1c44['where']};return db[_0xe0b0('0x32')][_0xe0b0('0x25')](_0x5d2fa2)['then'](function(_0x9f7459){_0x4cf80c[_0xe0b0('0x25')]=_0x9f7459;if(_0x1a0c90[_0xe0b0('0x36')][_0xe0b0('0x47')]){_0x2a1c44[_0xe0b0('0x48')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x2a1c44);})[_0xe0b0('0x2b')](function(_0x407a9c){_0x4cf80c[_0xe0b0('0x49')]=_0x407a9c;return _0x4cf80c;})[_0xe0b0('0x2b')](respondWithFilteredResult(_0x1d35bc,_0x2a1c44))[_0xe0b0('0x4a')](handleError(_0x1d35bc,null));};exports['show']=function(_0x3b1474,_0x11d4fd){var _0x534340={'raw':![],'where':{'id':_0x3b1474['params']['id']}},_0x50c805={};_0x50c805[_0xe0b0('0x34')]=_[_0xe0b0('0x35')](db[_0xe0b0('0x32')][_0xe0b0('0x33')]);_0x50c805['query']=_[_0xe0b0('0x35')](_0x3b1474[_0xe0b0('0x36')]);_0x50c805['filters']=_['intersection'](_0x50c805[_0xe0b0('0x34')],_0x50c805[_0xe0b0('0x36')]);_0x534340['attributes']=_[_0xe0b0('0x38')](_0x50c805[_0xe0b0('0x34')],qs['fields'](_0x3b1474['query'][_0xe0b0('0x39')]));_0x534340['attributes']=_0x534340[_0xe0b0('0x37')][_0xe0b0('0x3a')]?_0x534340[_0xe0b0('0x37')]:_0x50c805[_0xe0b0('0x34')];if(_0x3b1474[_0xe0b0('0x36')][_0xe0b0('0x47')]){_0x534340['include']=[{'all':!![]}];}_0x534340=_['merge']({},_0x534340,_0x3b1474[_0xe0b0('0x4b')]);return db['FreshdeskAccount']['find'](_0x534340)[_0xe0b0('0x2b')](handleEntityNotFound(_0x11d4fd,null))[_0xe0b0('0x2b')](respondWithResult(_0x11d4fd,null))['catch'](handleError(_0x11d4fd,null));};exports['create']=function(_0x13adfb,_0x10b5a6){return db[_0xe0b0('0x32')][_0xe0b0('0x4c')](_0x13adfb[_0xe0b0('0x4d')],{})[_0xe0b0('0x2b')](respondWithResult(_0x10b5a6,0xc9))[_0xe0b0('0x4a')](handleError(_0x10b5a6,null));};exports['update']=function(_0x22c7bc,_0x5ec880){if(_0x22c7bc[_0xe0b0('0x4d')]['id']){delete _0x22c7bc['body']['id'];}return db['FreshdeskAccount'][_0xe0b0('0x4e')]({'where':{'id':_0x22c7bc[_0xe0b0('0x4f')]['id']}})[_0xe0b0('0x2b')](handleEntityNotFound(_0x5ec880,null))[_0xe0b0('0x2b')](saveUpdates(_0x22c7bc[_0xe0b0('0x4d')],null))[_0xe0b0('0x2b')](respondWithResult(_0x5ec880,null))[_0xe0b0('0x4a')](handleError(_0x5ec880,null));};exports[_0xe0b0('0x50')]=function(_0x2e1c9b,_0x4e0d87){return db[_0xe0b0('0x32')]['find']({'where':{'id':_0x2e1c9b[_0xe0b0('0x4f')]['id']}})[_0xe0b0('0x2b')](handleEntityNotFound(_0x4e0d87,null))[_0xe0b0('0x2b')](removeEntity(_0x4e0d87,null))[_0xe0b0('0x4a')](handleError(_0x4e0d87,null));};exports[_0xe0b0('0x51')]=function(_0x3bdb25,_0x5ba329,_0x1a057c){var _0x16ea00={};var _0x437a15={};var _0x271445;var _0x3bb6d6;return db[_0xe0b0('0x32')][_0xe0b0('0x52')]({'where':{'id':_0x3bdb25[_0xe0b0('0x4f')]['id']}})[_0xe0b0('0x2b')](handleEntityNotFound(_0x5ba329,null))[_0xe0b0('0x2b')](function(_0x1eb5d6){if(_0x1eb5d6){_0x271445=_0x1eb5d6;_0x437a15[_0xe0b0('0x34')]=_[_0xe0b0('0x35')](db[_0xe0b0('0x53')][_0xe0b0('0x33')]);_0x437a15[_0xe0b0('0x36')]=_[_0xe0b0('0x35')](_0x3bdb25[_0xe0b0('0x36')]);_0x437a15['filters']=_[_0xe0b0('0x38')](_0x437a15[_0xe0b0('0x34')],_0x437a15[_0xe0b0('0x36')]);_0x16ea00[_0xe0b0('0x37')]=_[_0xe0b0('0x38')](_0x437a15[_0xe0b0('0x34')],qs[_0xe0b0('0x39')](_0x3bdb25['query']['fields']));_0x16ea00[_0xe0b0('0x37')]=_0x16ea00[_0xe0b0('0x37')][_0xe0b0('0x3a')]?_0x16ea00['attributes']:_0x437a15[_0xe0b0('0x34')];_0x16ea00[_0xe0b0('0x3d')]=qs[_0xe0b0('0x3e')](_0x3bdb25[_0xe0b0('0x36')][_0xe0b0('0x3e')]);_0x16ea00['where']=qs[_0xe0b0('0x40')](_[_0xe0b0('0x41')](_0x3bdb25[_0xe0b0('0x36')],_0x437a15['filters']));if(_0x3bdb25[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x16ea00['where']=_[_0xe0b0('0x43')](_0x16ea00['where'],{'$or':_['map'](_0x16ea00[_0xe0b0('0x37')],function(_0x57b51e){var _0x4d75e4={};_0x4d75e4[_0x57b51e]={'$like':'%'+_0x3bdb25[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x4d75e4;})});}_0x16ea00=_[_0xe0b0('0x43')]({},_0x16ea00,_0x3bdb25[_0xe0b0('0x4b')]);return _0x271445['getConfigurations'](_0x16ea00);}})[_0xe0b0('0x2b')](function(_0x2287a5){if(_0x2287a5){_0x3bb6d6=_0x2287a5[_0xe0b0('0x3a')];if(!_0x3bdb25[_0xe0b0('0x36')][_0xe0b0('0x3b')](_0xe0b0('0x3c'))){_0x16ea00[_0xe0b0('0x27')]=qs[_0xe0b0('0x27')](_0x3bdb25['query']['limit']);_0x16ea00[_0xe0b0('0x26')]=qs[_0xe0b0('0x26')](_0x3bdb25[_0xe0b0('0x36')]['offset']);}return _0x271445['getConfigurations'](_0x16ea00);}})[_0xe0b0('0x2b')](function(_0x26f36f){if(_0x26f36f){return _0x26f36f?{'count':_0x3bb6d6,'rows':_0x26f36f}:null;}})['then'](respondWithResult(_0x5ba329,null))['catch'](handleError(_0x5ba329,null));};exports[_0xe0b0('0x54')]=function(_0x42b2d3,_0x38eb8e,_0x29175a){if(_0x42b2d3[_0xe0b0('0x4d')]['id']){delete _0x42b2d3[_0xe0b0('0x4d')]['id'];}return db[_0xe0b0('0x32')][_0xe0b0('0x52')]({'where':{'id':_0x42b2d3['params']['id']}})[_0xe0b0('0x2b')](handleEntityNotFound(_0x38eb8e,null))[_0xe0b0('0x2b')](function(_0x1673bc){if(_0x1673bc){_0x42b2d3['body']['AccountId']=_0x1673bc['id'];_0x42b2d3['body']['Subjects']=integrations['getSubjects'](_0x42b2d3['body'][_0xe0b0('0x55')],_0x42b2d3['body']['type']);_0x42b2d3[_0xe0b0('0x4d')][_0xe0b0('0x56')]=integrations[_0xe0b0('0x57')](_0x42b2d3[_0xe0b0('0x4d')][_0xe0b0('0x55')],_0x42b2d3[_0xe0b0('0x4d')][_0xe0b0('0x44')]);return db[_0xe0b0('0x53')]['create'](_0x42b2d3[_0xe0b0('0x4d')],{'include':[{'model':db[_0xe0b0('0x58')],'as':_0xe0b0('0x59')},{'model':db[_0xe0b0('0x58')],'as':_0xe0b0('0x56')}]});}return null;})[_0xe0b0('0x2b')](respondWithResult(_0x38eb8e,null))[_0xe0b0('0x4a')](handleError(_0x38eb8e,null));};exports['getFields']=function(_0xaf2607,_0x5981a3,_0x2c9147){var _0x28b927='';return db[_0xe0b0('0x32')][_0xe0b0('0x52')]({'where':{'id':_0xaf2607['params']['id']},'attributes':['id',_0xe0b0('0x5a'),_0xe0b0('0x5b')]})['then'](handleEntityNotFound(_0x5981a3,null))['then'](function(_0x28b907){if(_0x28b907){_0x28b927=_0x28b907[_0xe0b0('0x5a')];var _0x196625=_0x28b927[_0xe0b0('0x5c')](-0x1);if(_0x196625==='/'){_0x28b927=_0x28b927[_0xe0b0('0x5d')](0x0,_0x28b927[_0xe0b0('0x5e')](_0x196625));}return rp({'method':_0xe0b0('0x5f'),'uri':util[_0xe0b0('0x60')](_0xe0b0('0x61'),_0x28b927,_0xe0b0('0x62')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xe0b0('0x60')]('%s:X',_0x28b907['apiKey']))['toString']('base64'))},'json':!![]});}})[_0xe0b0('0x2b')](function(_0x584350){if(_0x584350){var _0x654d2b=[_0xe0b0('0x63'),_0xe0b0('0x64'),_0xe0b0('0x65'),'description',_0xe0b0('0x23'),_0xe0b0('0x66'),'group',_0xe0b0('0x67'),_0xe0b0('0x68'),_0xe0b0('0x69'),_0xe0b0('0x6a')];_[_0xe0b0('0x6b')](_0x584350,function(_0x5cc4fc){return _0x654d2b['includes'](_0x5cc4fc['name'])||!_0x5cc4fc['default']&&_0x5cc4fc['type']!==_0xe0b0('0x6c')&&_0x5cc4fc['type']!==_0xe0b0('0x6d');});return{'count':_0x584350['length'],'rows':_[_0xe0b0('0x6e')](_0x584350,function(_0x5c85d6){return{'id':_0x5c85d6[_0xe0b0('0x2f')],'name':_0x5c85d6[_0xe0b0('0x6f')],'custom':!_0x5c85d6[_0xe0b0('0x70')],'options':_0x5c85d6[_0xe0b0('0x71')]?_['map'](_0x5c85d6['choices'],function(_0x4e2b7c){return{'name':_['capitalize'](_0x4e2b7c),'value':_0x4e2b7c};}):[]};})};}})[_0xe0b0('0x2b')](respondWithResult(_0x5981a3,null))[_0xe0b0('0x4a')](function(_0x264363){var _0x4377f7=_0xaf2607[_0xe0b0('0x36')]['test']?0x1f4:_0x264363[_0xe0b0('0x72')]||0x1f4;logger[_0xe0b0('0x1f')](_0xe0b0('0x73'),_0xe0b0('0x74'),_0x4377f7,JSON[_0xe0b0('0x1e')](_0x264363));delete _0x264363[_0xe0b0('0x2f')];if(_0x4377f7===0x191){_0x4377f7=0x190;}_0x5981a3[_0xe0b0('0x23')](_0x4377f7)[_0xe0b0('0x30')](_0xaf2607[_0xe0b0('0x36')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x264363[_0xe0b0('0x72')]}:_0x264363);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 69968b9..29e9103 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 _0x3f19=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','moment','request-promise','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x130523,_0x299f4f){var _0x319a73=function(_0x53bc5f){while(--_0x53bc5f){_0x130523['push'](_0x130523['shift']());}};_0x319a73(++_0x299f4f);}(_0x3f19,0xc0));var _0x93f1=function(_0xf2ee56,_0x565642){_0xf2ee56=_0xf2ee56-0x0;var _0x2b9bc9=_0x3f19[_0xf2ee56];return _0x2b9bc9;};'use strict';var _=require(_0x93f1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x93f1('0x1'));var BPromise=require('bluebird');var rp=require(_0x93f1('0x2'));var attributes=require(_0x93f1('0x3'));var integrations=require(_0x93f1('0x4'));module[_0x93f1('0x5')]=function(_0x5dbfbc,_0x1ca333){return _0x5dbfbc[_0x93f1('0x6')](_0x93f1('0x7'),attributes,{'tableName':_0x93f1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae53=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xae53,0xf7));var _0x3ae5=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xae53[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x3ae5('0x0'));var util=require(_0x3ae5('0x1'));var logger=require(_0x3ae5('0x2'))(_0x3ae5('0x3'));var moment=require('moment');var BPromise=require(_0x3ae5('0x4'));var rp=require(_0x3ae5('0x5'));var attributes=require(_0x3ae5('0x6'));var integrations=require(_0x3ae5('0x7'));module[_0x3ae5('0x8')]=function(_0xb4de48,_0x510db0){return _0xb4de48[_0x3ae5('0x9')]('FreshdeskAccount',attributes,{'tableName':_0x3ae5('0xa'),'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 e7ed504..49f77b1 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 _0x51dc=['map','include','model','attributes','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','FreshdeskAccount','findAll','options','raw','where','limit'];(function(_0x14d6be,_0xcc7140){var _0x193f73=function(_0x1e4301){while(--_0x1e4301){_0x14d6be['push'](_0x14d6be['shift']());}};_0x193f73(++_0xcc7140);}(_0x51dc,0x8e));var _0xc51d=function(_0x1cf60e,_0x4fb33d){_0x1cf60e=_0x1cf60e-0x0;var _0x342a1e=_0x51dc[_0x1cf60e];return _0x342a1e;};'use strict';var _=require(_0xc51d('0x0'));var util=require('util');var moment=require(_0xc51d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc51d('0x2'));var fs=require('fs');var Redis=require(_0xc51d('0x3'));var db=require(_0xc51d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc51d('0x5'))(_0xc51d('0x6'));var config=require(_0xc51d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc51d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40416,_0x57af9c,_0x3da542){return new BPromise(function(_0x3fcfb1,_0x54baf7){return client[_0xc51d('0x9')](_0x40416,_0x3da542)[_0xc51d('0xa')](function(_0x50ad28){logger['info'](_0xc51d('0xb'),_0x57af9c,_0xc51d('0xc'));logger[_0xc51d('0xd')](_0xc51d('0xe'),_0x57af9c,_0xc51d('0xc'),JSON[_0xc51d('0xf')](_0x50ad28));if(_0x50ad28['error']){if(_0x50ad28['error'][_0xc51d('0x10')]===0x1f4){logger['error'](_0xc51d('0xb'),_0x57af9c,_0x50ad28[_0xc51d('0x11')][_0xc51d('0x12')]);return _0x54baf7(_0x50ad28[_0xc51d('0x11')][_0xc51d('0x12')]);}logger[_0xc51d('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x57af9c,_0x50ad28[_0xc51d('0x11')][_0xc51d('0x12')]);return _0x3fcfb1(_0x50ad28['error']['message']);}else{logger[_0xc51d('0x13')](_0xc51d('0xb'),_0x57af9c,'request\x20sent');_0x3fcfb1(_0x50ad28[_0xc51d('0x14')]['message']);}})[_0xc51d('0x15')](function(_0x320e8e){logger[_0xc51d('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x57af9c,_0x320e8e);_0x54baf7(_0x320e8e);});});}exports['GetFreshdeskAccount']=function(_0x47ab96){var _0xd61112=this;return new Promise(function(_0x8f47b4,_0x32733b){return db[_0xc51d('0x16')][_0xc51d('0x17')]({'raw':_0x47ab96[_0xc51d('0x18')]?_0x47ab96['options'][_0xc51d('0x19')]===undefined?!![]:![]:!![],'where':_0x47ab96[_0xc51d('0x18')]?_0x47ab96[_0xc51d('0x18')][_0xc51d('0x1a')]||null:null,'attributes':_0x47ab96['options']?_0x47ab96[_0xc51d('0x18')]['attributes']||null:null,'limit':_0x47ab96[_0xc51d('0x18')]?_0x47ab96['options'][_0xc51d('0x1b')]||null:null,'include':_0x47ab96['options']?_0x47ab96[_0xc51d('0x18')]['include']?_[_0xc51d('0x1c')](_0x47ab96[_0xc51d('0x18')][_0xc51d('0x1d')],function(_0x8d02a2){return{'model':db[_0x8d02a2[_0xc51d('0x1e')]],'as':_0x8d02a2['as'],'attributes':_0x8d02a2[_0xc51d('0x1f')],'include':_0x8d02a2[_0xc51d('0x1d')]?_[_0xc51d('0x1c')](_0x8d02a2[_0xc51d('0x1d')],function(_0x7895e6){return{'model':db[_0x7895e6[_0xc51d('0x1e')]],'as':_0x7895e6['as'],'attributes':_0x7895e6[_0xc51d('0x1f')],'include':_0x7895e6[_0xc51d('0x1d')]?_[_0xc51d('0x1c')](_0x7895e6[_0xc51d('0x1d')],function(_0x4138e1){return{'model':db[_0x4138e1[_0xc51d('0x1e')]],'as':_0x4138e1['as'],'attributes':_0x4138e1[_0xc51d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc51d('0xa')](function(_0xa3d984){logger[_0xc51d('0x13')]('GetFreshdeskAccount',_0x47ab96);logger[_0xc51d('0xd')](_0xc51d('0x20'),_0x47ab96,JSON['stringify'](_0xa3d984));_0x8f47b4(_0xa3d984);})[_0xc51d('0x15')](function(_0xc62cfc){logger[_0xc51d('0x11')](_0xc51d('0x20'),_0xc62cfc[_0xc51d('0x12')],_0x47ab96);_0x32733b(_0xd61112[_0xc51d('0x11')](0x1f4,_0xc62cfc[_0xc51d('0x12')]));});});};exports[_0xc51d('0x21')]=function(_0x559618){var _0x173e31=this;return new Promise(function(_0x1da450,_0xf6df5f){return db[_0xc51d('0x16')]['find']({'raw':_0x559618[_0xc51d('0x18')]?_0x559618[_0xc51d('0x18')][_0xc51d('0x19')]===undefined?!![]:![]:!![],'where':_0x559618[_0xc51d('0x18')]?_0x559618['options'][_0xc51d('0x1a')]||null:null,'attributes':_0x559618['options']?_0x559618[_0xc51d('0x18')][_0xc51d('0x1f')]||null:null,'include':_0x559618['options']?_0x559618['options']['include']?_[_0xc51d('0x1c')](_0x559618[_0xc51d('0x18')][_0xc51d('0x1d')],function(_0x5b72ca){return{'model':db[_0x5b72ca[_0xc51d('0x1e')]],'as':_0x5b72ca['as'],'attributes':_0x5b72ca[_0xc51d('0x1f')],'include':_0x5b72ca['include']?_[_0xc51d('0x1c')](_0x5b72ca[_0xc51d('0x1d')],function(_0x15f193){return{'model':db[_0x15f193[_0xc51d('0x1e')]],'as':_0x15f193['as'],'attributes':_0x15f193[_0xc51d('0x1f')],'include':_0x15f193['include']?_[_0xc51d('0x1c')](_0x15f193['include'],function(_0xa1c7f8){return{'model':db[_0xa1c7f8[_0xc51d('0x1e')]],'as':_0xa1c7f8['as'],'attributes':_0xa1c7f8[_0xc51d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc51d('0xa')](function(_0x6961b2){logger[_0xc51d('0x13')](_0xc51d('0x21'),_0x559618);logger[_0xc51d('0xd')](_0xc51d('0x21'),_0x559618,JSON[_0xc51d('0xf')](_0x6961b2));_0x1da450(_0x6961b2);})[_0xc51d('0x15')](function(_0x47b444){logger['error'](_0xc51d('0x21'),_0x47b444['message'],_0x559618);_0xf6df5f(_0x173e31[_0xc51d('0x11')](0x1f4,_0x47b444[_0xc51d('0x12')]));});});}; \ No newline at end of file +var _0x6f03=['include','map','model','debug','ShowFreshdeskAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit'];(function(_0x2cf437,_0x5b0508){var _0x2f1fd2=function(_0x30f000){while(--_0x30f000){_0x2cf437['push'](_0x2cf437['shift']());}};_0x2f1fd2(++_0x5b0508);}(_0x6f03,0x1e2));var _0x36f0=function(_0x55ae66,_0x1e5723){_0x55ae66=_0x55ae66-0x0;var _0x2122ef=_0x6f03[_0x55ae66];return _0x2122ef;};'use strict';var _=require(_0x36f0('0x0'));var util=require(_0x36f0('0x1'));var moment=require(_0x36f0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36f0('0x3'));var db=require(_0x36f0('0x4'))['db'];var utils=require(_0x36f0('0x5'));var logger=require(_0x36f0('0x6'))(_0x36f0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x36f0('0x8')][_0x36f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25a9b1,_0x3243ce,_0x3f276c){return new BPromise(function(_0x17ffe9,_0x43c46b){return client[_0x36f0('0xa')](_0x25a9b1,_0x3f276c)[_0x36f0('0xb')](function(_0xd546d7){logger[_0x36f0('0xc')](_0x36f0('0xd'),_0x3243ce,_0x36f0('0xe'));logger['debug'](_0x36f0('0xf'),_0x3243ce,'request\x20sent',JSON[_0x36f0('0x10')](_0xd546d7));if(_0xd546d7[_0x36f0('0x11')]){if(_0xd546d7['error'][_0x36f0('0x12')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3243ce,_0xd546d7['error'][_0x36f0('0x13')]);return _0x43c46b(_0xd546d7['error'][_0x36f0('0x13')]);}logger[_0x36f0('0x11')](_0x36f0('0xd'),_0x3243ce,_0xd546d7[_0x36f0('0x11')][_0x36f0('0x13')]);return _0x17ffe9(_0xd546d7[_0x36f0('0x11')][_0x36f0('0x13')]);}else{logger[_0x36f0('0xc')](_0x36f0('0xd'),_0x3243ce,_0x36f0('0xe'));_0x17ffe9(_0xd546d7['result']['message']);}})[_0x36f0('0x14')](function(_0x57b32c){logger[_0x36f0('0x11')](_0x36f0('0xd'),_0x3243ce,_0x57b32c);_0x43c46b(_0x57b32c);});});}exports[_0x36f0('0x15')]=function(_0x1c4db5){var _0x39b91b=this;return new Promise(function(_0x10e5ee,_0x244f74){return db[_0x36f0('0x16')]['findAll']({'raw':_0x1c4db5['options']?_0x1c4db5[_0x36f0('0x17')][_0x36f0('0x18')]===undefined?!![]:![]:!![],'where':_0x1c4db5[_0x36f0('0x17')]?_0x1c4db5[_0x36f0('0x17')][_0x36f0('0x19')]||null:null,'attributes':_0x1c4db5[_0x36f0('0x17')]?_0x1c4db5[_0x36f0('0x17')][_0x36f0('0x1a')]||null:null,'limit':_0x1c4db5['options']?_0x1c4db5['options'][_0x36f0('0x1b')]||null:null,'include':_0x1c4db5[_0x36f0('0x17')]?_0x1c4db5[_0x36f0('0x17')][_0x36f0('0x1c')]?_['map'](_0x1c4db5[_0x36f0('0x17')][_0x36f0('0x1c')],function(_0x3af809){return{'model':db[_0x3af809['model']],'as':_0x3af809['as'],'attributes':_0x3af809[_0x36f0('0x1a')],'include':_0x3af809[_0x36f0('0x1c')]?_[_0x36f0('0x1d')](_0x3af809[_0x36f0('0x1c')],function(_0x562f9c){return{'model':db[_0x562f9c[_0x36f0('0x1e')]],'as':_0x562f9c['as'],'attributes':_0x562f9c[_0x36f0('0x1a')],'include':_0x562f9c[_0x36f0('0x1c')]?_['map'](_0x562f9c[_0x36f0('0x1c')],function(_0x396da4){return{'model':db[_0x396da4[_0x36f0('0x1e')]],'as':_0x396da4['as'],'attributes':_0x396da4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2419cd){logger[_0x36f0('0xc')](_0x36f0('0x15'),_0x1c4db5);logger[_0x36f0('0x1f')](_0x36f0('0x15'),_0x1c4db5,JSON[_0x36f0('0x10')](_0x2419cd));_0x10e5ee(_0x2419cd);})[_0x36f0('0x14')](function(_0x339c70){logger['error'](_0x36f0('0x15'),_0x339c70[_0x36f0('0x13')],_0x1c4db5);_0x244f74(_0x39b91b['error'](0x1f4,_0x339c70[_0x36f0('0x13')]));});});};exports[_0x36f0('0x20')]=function(_0x33173b){var _0x5d7281=this;return new Promise(function(_0x48a839,_0x1f5ff3){return db[_0x36f0('0x16')][_0x36f0('0x21')]({'raw':_0x33173b[_0x36f0('0x17')]?_0x33173b['options'][_0x36f0('0x18')]===undefined?!![]:![]:!![],'where':_0x33173b['options']?_0x33173b[_0x36f0('0x17')][_0x36f0('0x19')]||null:null,'attributes':_0x33173b['options']?_0x33173b['options']['attributes']||null:null,'include':_0x33173b[_0x36f0('0x17')]?_0x33173b['options']['include']?_[_0x36f0('0x1d')](_0x33173b[_0x36f0('0x17')][_0x36f0('0x1c')],function(_0x22d4a9){return{'model':db[_0x22d4a9[_0x36f0('0x1e')]],'as':_0x22d4a9['as'],'attributes':_0x22d4a9[_0x36f0('0x1a')],'include':_0x22d4a9[_0x36f0('0x1c')]?_[_0x36f0('0x1d')](_0x22d4a9[_0x36f0('0x1c')],function(_0x25fa4){return{'model':db[_0x25fa4[_0x36f0('0x1e')]],'as':_0x25fa4['as'],'attributes':_0x25fa4[_0x36f0('0x1a')],'include':_0x25fa4[_0x36f0('0x1c')]?_[_0x36f0('0x1d')](_0x25fa4['include'],function(_0x477bf1){return{'model':db[_0x477bf1['model']],'as':_0x477bf1['as'],'attributes':_0x477bf1[_0x36f0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x36f0('0xb')](function(_0x257e54){logger[_0x36f0('0xc')](_0x36f0('0x20'),_0x33173b);logger[_0x36f0('0x1f')](_0x36f0('0x20'),_0x33173b,JSON[_0x36f0('0x10')](_0x257e54));_0x48a839(_0x257e54);})[_0x36f0('0x14')](function(_0xd98409){logger[_0x36f0('0x11')](_0x36f0('0x20'),_0xd98409[_0x36f0('0x13')],_0x33173b);_0x1f5ff3(_0x5d7281[_0x36f0('0x11')](0x1f4,_0xd98409[_0x36f0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 5d3f439..3c71a8a 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 _0x8ef6=['isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get'];(function(_0x756348,_0x38d7e2){var _0x505558=function(_0x2f8663){while(--_0x2f8663){_0x756348['push'](_0x756348['shift']());}};_0x505558(++_0x38d7e2);}(_0x8ef6,0xf2));var _0x68ef=function(_0x468df0,_0x3e472d){_0x468df0=_0x468df0-0x0;var _0x408328=_0x8ef6[_0x468df0];return _0x408328;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['get'](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xe')]);router[_0x68ef('0x9')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x9')](_0x68ef('0x11'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x9')]('/:id/tags',auth[_0x68ef('0xa')](),controller[_0x68ef('0x13')]);router[_0x68ef('0x14')]('/',auth[_0x68ef('0xa')](),controller[_0x68ef('0x15')]);router[_0x68ef('0x14')]('/:id/tags',auth[_0x68ef('0xa')](),controller[_0x68ef('0x16')]);router[_0x68ef('0x17')]('/:id',auth[_0x68ef('0xa')](),controller[_0x68ef('0x18')]);router[_0x68ef('0x19')]('/:id',auth[_0x68ef('0xa')](),controller[_0x68ef('0x1a')]);module[_0x68ef('0x1b')]=router; \ No newline at end of file +var _0x2d17=['get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x2d17,0x17e));var _0x72d1=function(_0x2acffa,_0x190384){_0x2acffa=_0x2acffa-0x0;var _0x4bd695=_0x2d17[_0x2acffa];return _0x4bd695;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var auth=require(_0x72d1('0x4'));var interaction=require(_0x72d1('0x5'));var config=require('../../config/environment');var controller=require(_0x72d1('0x6'));router['get']('/',auth[_0x72d1('0x7')](),controller['index']);router[_0x72d1('0x8')](_0x72d1('0x9'),auth['isAuthenticated'](),controller[_0x72d1('0xa')]);router[_0x72d1('0x8')](_0x72d1('0xb'),auth['isAuthenticated'](),controller[_0x72d1('0xc')]);router[_0x72d1('0x8')](_0x72d1('0xd'),auth['isAuthenticated'](),controller[_0x72d1('0xe')]);router[_0x72d1('0x8')](_0x72d1('0xf'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x10')]);router[_0x72d1('0x8')](_0x72d1('0x11'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x12')]);router[_0x72d1('0x13')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x14')]);router[_0x72d1('0x13')](_0x72d1('0x11'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x15')]);router[_0x72d1('0x16')](_0x72d1('0x9'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x17')]);router[_0x72d1('0x18')](_0x72d1('0x9'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x19')]);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 7fa317e..fa8c280 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 _0x8fb6=['STRING','exports'];(function(_0x1288db,_0x211057){var _0x1df750=function(_0x2caccc){while(--_0x2caccc){_0x1288db['push'](_0x1288db['shift']());}};_0x1df750(++_0x211057);}(_0x8fb6,0x1b9));var _0x68fb=function(_0x280771,_0x4c944b){_0x280771=_0x280771-0x0;var _0x289982=_0x8fb6[_0x280771];return _0x289982;};'use strict';var Sequelize=require('sequelize');module[_0x68fb('0x0')]={'name':{'type':Sequelize[_0x68fb('0x1')]},'description':{'type':Sequelize[_0x68fb('0x1')]}}; \ No newline at end of file +var _0x3a74=['exports','STRING','sequelize'];(function(_0x62afb1,_0x2d1ca8){var _0x45f320=function(_0x1e1f6e){while(--_0x1e1f6e){_0x62afb1['push'](_0x62afb1['shift']());}};_0x45f320(++_0x2d1ca8);}(_0x3a74,0x161));var _0x43a7=function(_0x3f2668,_0x156268){_0x3f2668=_0x3f2668-0x0;var _0x1da0b7=_0x3a74[_0x3f2668];return _0x1da0b7;};'use strict';var Sequelize=require(_0x43a7('0x0'));module[_0x43a7('0x1')]={'name':{'type':Sequelize[_0x43a7('0x2')]},'description':{'type':Sequelize[_0x43a7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 9e3a5bb..35737eb 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 _0x2e53=['status','end','json','count','limit','Content-Range','apply','reject','update','then','name','index','FreshdeskConfiguration','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','offset','order','sort','pick','merge','type','key','VIRTUAL','field','filter','options','where','include','findAll','rows','params','includeAll','find','create','body','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','map','nolimit','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','lodash','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','client','request','info','debug','request\x20sent','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','sendStatus'];(function(_0x27df4c,_0x2715f4){var _0x71f61f=function(_0x44e228){while(--_0x44e228){_0x27df4c['push'](_0x27df4c['shift']());}};_0x71f61f(++_0x2715f4);}(_0x2e53,0xda));var _0x32e5=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0x2e53[_0x28fbe3];return _0x45db6a;};'use strict';var pdf=require(_0x32e5('0x0'));var emlformat=require(_0x32e5('0x1'));var rimraf=require(_0x32e5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x32e5('0x3'));var moment=require('moment');var BPromise=require(_0x32e5('0x4'));var Mustache=require(_0x32e5('0x5'));var util=require(_0x32e5('0x6'));var path=require('path');var sox=require(_0x32e5('0x7'));var csv=require(_0x32e5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x32e5('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x32e5('0xa'));var toCsv=require(_0x32e5('0x8'));var querystring=require(_0x32e5('0xb'));var Papa=require('papaparse');var authService=require(_0x32e5('0xc'));var hardwareService=require(_0x32e5('0xd'));var Redis=require(_0x32e5('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x32e5('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x32e5('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x416905,_0x222a9f,_0x2444c5,_0x3f5920){return new BPromise(function(_0x23fc7d,_0x4b9763){var _0x41c044=_0x3f5920||client;return _0x41c044[_0x32e5('0x11')](_0x416905,_0x2444c5)['then'](function(_0x154aa2){logger[_0x32e5('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x222a9f,'request\x20sent');logger[_0x32e5('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x222a9f,_0x32e5('0x14'),JSON[_0x32e5('0x15')](_0x154aa2));if(_0x154aa2[_0x32e5('0x16')]){if(_0x154aa2[_0x32e5('0x16')][_0x32e5('0x17')]===0x1f4){logger[_0x32e5('0x16')](_0x32e5('0x18'),_0x222a9f,_0x154aa2['error'][_0x32e5('0x19')]);return _0x4b9763(_0x154aa2[_0x32e5('0x16')]['message']);}logger[_0x32e5('0x16')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x222a9f,_0x154aa2[_0x32e5('0x16')][_0x32e5('0x19')]);return _0x23fc7d(_0x154aa2[_0x32e5('0x16')]['message']);}else{logger['info'](_0x32e5('0x18'),_0x222a9f,_0x32e5('0x14'));_0x23fc7d(_0x154aa2['result'][_0x32e5('0x19')]);}})[_0x32e5('0x1a')](function(_0x4879da){logger[_0x32e5('0x16')](_0x32e5('0x18'),_0x222a9f,_0x4879da);_0x4b9763(_0x4879da);});});}function respondWithStatusCode(_0x27e7d3,_0x441f73){_0x441f73=_0x441f73||0xcc;return function(_0x3978b9){if(_0x3978b9){return _0x27e7d3[_0x32e5('0x1b')](_0x441f73);}return _0x27e7d3[_0x32e5('0x1c')](_0x441f73)[_0x32e5('0x1d')]();};}function respondWithResult(_0x145439,_0x3749b4){_0x3749b4=_0x3749b4||0xc8;return function(_0x339fdb){if(_0x339fdb){return _0x145439['status'](_0x3749b4)[_0x32e5('0x1e')](_0x339fdb);}};}function respondWithFilteredResult(_0x2eb243,_0x491dc2){return function(_0x4e95c7){if(_0x4e95c7){var _0x58b712=_0x4e95c7[_0x32e5('0x1f')],_0x100971=_0x491dc2['offset'],_0x39fbd0=_0x491dc2['offset']+_0x491dc2[_0x32e5('0x20')],_0xd20414;if(_0x39fbd0>=_0x58b712){_0x39fbd0=_0x58b712;_0xd20414=0xc8;}else{_0xd20414=0xce;}_0x2eb243['status'](_0xd20414);return _0x2eb243['set'](_0x32e5('0x21'),_0x100971+'-'+_0x39fbd0+'/'+_0x58b712)[_0x32e5('0x1e')](_0x4e95c7);}return null;};}function patchUpdates(_0x2429f1){return function(_0x507e42){try{jsonpatch[_0x32e5('0x22')](_0x507e42,_0x2429f1,!![]);}catch(_0x1818db){return BPromise[_0x32e5('0x23')](_0x1818db);}return _0x507e42['save']();};}function saveUpdates(_0x449864,_0x43ebb7){return function(_0x4b2cad){if(_0x4b2cad){return _0x4b2cad[_0x32e5('0x24')](_0x449864)[_0x32e5('0x25')](function(_0x204271){return _0x204271;});}return null;};}function removeEntity(_0x341d9a,_0x52cbaf){return function(_0x445e81){if(_0x445e81){return _0x445e81['destroy']()[_0x32e5('0x25')](function(){_0x341d9a['status'](0xcc)[_0x32e5('0x1d')]();});}};}function handleEntityNotFound(_0x172f8c,_0x141c96){return function(_0x34f1e6){if(!_0x34f1e6){_0x172f8c[_0x32e5('0x1b')](0x194);}return _0x34f1e6;};}function handleError(_0x2c4796,_0x227ee5){_0x227ee5=_0x227ee5||0x1f4;return function(_0x50c8d4){logger[_0x32e5('0x16')](_0x50c8d4['stack']);if(_0x50c8d4[_0x32e5('0x26')]){delete _0x50c8d4[_0x32e5('0x26')];}_0x2c4796['status'](_0x227ee5)['send'](_0x50c8d4);};}exports[_0x32e5('0x27')]=function(_0x539cb7,_0x27207b){var _0x536efb={},_0x540757={},_0x12597c={'count':0x0,'rows':[]};var _0x3e3d67=db[_0x32e5('0x28')][_0x32e5('0x29')];_0x540757[_0x32e5('0x2a')]=_['keys'](_0x3e3d67);_0x540757[_0x32e5('0x2b')]=_[_0x32e5('0x2c')](_0x539cb7['query']);_0x540757[_0x32e5('0x2d')]=_['intersection'](_0x540757[_0x32e5('0x2a')],_0x540757[_0x32e5('0x2b')]);_0x536efb['attributes']=_[_0x32e5('0x2e')](_0x540757[_0x32e5('0x2a')],qs[_0x32e5('0x2f')](_0x539cb7['query'][_0x32e5('0x2f')]));_0x536efb[_0x32e5('0x30')]=_0x536efb[_0x32e5('0x30')][_0x32e5('0x31')]?_0x536efb['attributes']:_0x540757[_0x32e5('0x2a')];if(!_0x539cb7[_0x32e5('0x2b')]['hasOwnProperty']('nolimit')){_0x536efb[_0x32e5('0x20')]=qs['limit'](_0x539cb7[_0x32e5('0x2b')][_0x32e5('0x20')]);_0x536efb[_0x32e5('0x32')]=qs['offset'](_0x539cb7[_0x32e5('0x2b')][_0x32e5('0x32')]);}_0x536efb[_0x32e5('0x33')]=qs[_0x32e5('0x34')](_0x539cb7[_0x32e5('0x2b')][_0x32e5('0x34')]);_0x536efb['where']=qs[_0x32e5('0x2d')](_[_0x32e5('0x35')](_0x539cb7[_0x32e5('0x2b')],_0x540757[_0x32e5('0x2d')]));if(_0x539cb7['query']['filter']){_0x536efb['where']=_[_0x32e5('0x36')](_0x536efb['where'],{'$or':_['map'](_0x3e3d67,function(_0xf7b1f3){if(_0xf7b1f3[_0x32e5('0x37')][_0x32e5('0x38')]!==_0x32e5('0x39')){var _0x3af55a={};_0x3af55a[_0xf7b1f3[_0x32e5('0x3a')]]={'$like':'%'+_0x539cb7['query'][_0x32e5('0x3b')]+'%'};return _0x3af55a;}})});}_0x536efb=_['merge']({},_0x536efb,_0x539cb7[_0x32e5('0x3c')]);var _0xc55d0f={'where':_0x536efb[_0x32e5('0x3d')]};return db[_0x32e5('0x28')][_0x32e5('0x1f')](_0xc55d0f)[_0x32e5('0x25')](function(_0x356a14){_0x12597c['count']=_0x356a14;if(_0x539cb7[_0x32e5('0x2b')]['includeAll']){_0x536efb[_0x32e5('0x3e')]=[{'all':!![]}];}return db[_0x32e5('0x28')][_0x32e5('0x3f')](_0x536efb);})[_0x32e5('0x25')](function(_0x72fae4){_0x12597c[_0x32e5('0x40')]=_0x72fae4;return _0x12597c;})['then'](respondWithFilteredResult(_0x27207b,_0x536efb))[_0x32e5('0x1a')](handleError(_0x27207b,null));};exports['show']=function(_0x27a02e,_0x11da9a){var _0x3d1bc5={'raw':![],'where':{'id':_0x27a02e[_0x32e5('0x41')]['id']}},_0x21c67d={};_0x21c67d['model']=_['keys'](db[_0x32e5('0x28')]['rawAttributes']);_0x21c67d['query']=_[_0x32e5('0x2c')](_0x27a02e[_0x32e5('0x2b')]);_0x21c67d[_0x32e5('0x2d')]=_[_0x32e5('0x2e')](_0x21c67d[_0x32e5('0x2a')],_0x21c67d[_0x32e5('0x2b')]);_0x3d1bc5[_0x32e5('0x30')]=_[_0x32e5('0x2e')](_0x21c67d[_0x32e5('0x2a')],qs[_0x32e5('0x2f')](_0x27a02e[_0x32e5('0x2b')][_0x32e5('0x2f')]));_0x3d1bc5[_0x32e5('0x30')]=_0x3d1bc5[_0x32e5('0x30')][_0x32e5('0x31')]?_0x3d1bc5[_0x32e5('0x30')]:_0x21c67d[_0x32e5('0x2a')];if(_0x27a02e[_0x32e5('0x2b')][_0x32e5('0x42')]){_0x3d1bc5[_0x32e5('0x3e')]=[{'all':!![]}];}_0x3d1bc5=_[_0x32e5('0x36')]({},_0x3d1bc5,_0x27a02e['options']);return db[_0x32e5('0x28')][_0x32e5('0x43')](_0x3d1bc5)['then'](handleEntityNotFound(_0x11da9a,null))[_0x32e5('0x25')](respondWithResult(_0x11da9a,null))[_0x32e5('0x1a')](handleError(_0x11da9a,null));};exports['create']=function(_0x32bc5c,_0x5c4ba4){return db['FreshdeskConfiguration'][_0x32e5('0x44')](_0x32bc5c['body'],{})['then'](respondWithResult(_0x5c4ba4,0xc9))[_0x32e5('0x1a')](handleError(_0x5c4ba4,null));};exports[_0x32e5('0x24')]=function(_0x419394,_0xff5eda){if(_0x419394[_0x32e5('0x45')]['id']){delete _0x419394[_0x32e5('0x45')]['id'];}return db[_0x32e5('0x28')]['find']({'where':{'id':_0x419394[_0x32e5('0x41')]['id']}})[_0x32e5('0x25')](handleEntityNotFound(_0xff5eda,null))[_0x32e5('0x25')](saveUpdates(_0x419394[_0x32e5('0x45')],null))[_0x32e5('0x25')](respondWithResult(_0xff5eda,null))[_0x32e5('0x1a')](handleError(_0xff5eda,null));};exports[_0x32e5('0x46')]=function(_0x260a99,_0x1bcb4e){return db[_0x32e5('0x28')][_0x32e5('0x43')]({'where':{'id':_0x260a99[_0x32e5('0x41')]['id']}})['then'](handleEntityNotFound(_0x1bcb4e,null))[_0x32e5('0x25')](removeEntity(_0x1bcb4e,null))['catch'](handleError(_0x1bcb4e,null));};exports[_0x32e5('0x47')]=function(_0x122480,_0x3019e5,_0x1370ce){var _0x53094b={};var _0x218803={};var _0x303c14;var _0x5b695d;return db[_0x32e5('0x28')][_0x32e5('0x48')]({'where':{'id':_0x122480[_0x32e5('0x41')]['id']}})[_0x32e5('0x25')](handleEntityNotFound(_0x3019e5,null))['then'](function(_0x661ec1){if(_0x661ec1){_0x303c14=_0x661ec1;_0x218803[_0x32e5('0x2a')]=_[_0x32e5('0x2c')](db[_0x32e5('0x49')][_0x32e5('0x29')]);_0x218803[_0x32e5('0x2b')]=_[_0x32e5('0x2c')](_0x122480['query']);_0x218803[_0x32e5('0x2d')]=_['intersection'](_0x218803[_0x32e5('0x2a')],_0x218803[_0x32e5('0x2b')]);_0x53094b['attributes']=_['intersection'](_0x218803[_0x32e5('0x2a')],qs[_0x32e5('0x2f')](_0x122480[_0x32e5('0x2b')][_0x32e5('0x2f')]));_0x53094b[_0x32e5('0x30')]=_0x53094b[_0x32e5('0x30')][_0x32e5('0x31')]?_0x53094b[_0x32e5('0x30')]:_0x218803[_0x32e5('0x2a')];_0x53094b[_0x32e5('0x33')]=qs[_0x32e5('0x34')](_0x122480['query'][_0x32e5('0x34')]);_0x53094b['where']=qs[_0x32e5('0x2d')](_['pick'](_0x122480[_0x32e5('0x2b')],_0x218803[_0x32e5('0x2d')]));if(_0x122480[_0x32e5('0x2b')][_0x32e5('0x3b')]){_0x53094b[_0x32e5('0x3d')]=_[_0x32e5('0x36')](_0x53094b[_0x32e5('0x3d')],{'$or':_['map'](_0x53094b[_0x32e5('0x30')],function(_0x4902b9){var _0x2c87b0={};_0x2c87b0[_0x4902b9]={'$like':'%'+_0x122480[_0x32e5('0x2b')]['filter']+'%'};return _0x2c87b0;})});}_0x53094b=_[_0x32e5('0x36')]({},_0x53094b,_0x122480[_0x32e5('0x3c')]);return _0x303c14['getFields'](_0x53094b);}})['then'](function(_0x15a463){if(_0x15a463){_0x5b695d=_0x15a463['length'];if(!_0x122480[_0x32e5('0x2b')][_0x32e5('0x4a')]('nolimit')){_0x53094b[_0x32e5('0x20')]=qs[_0x32e5('0x20')](_0x122480['query'][_0x32e5('0x20')]);_0x53094b['offset']=qs[_0x32e5('0x32')](_0x122480[_0x32e5('0x2b')]['offset']);}return _0x303c14['getFields'](_0x53094b);}})[_0x32e5('0x25')](function(_0x18bf30){if(_0x18bf30){return _0x18bf30?{'count':_0x5b695d,'rows':_0x18bf30}:null;}})[_0x32e5('0x25')](respondWithResult(_0x3019e5,null))[_0x32e5('0x1a')](handleError(_0x3019e5,null));};exports[_0x32e5('0x4b')]=function(_0x11f321,_0x24d9e4,_0x31f6c0){var _0x333495={};var _0x3c789d={};var _0x26594a;var _0x109690;return db[_0x32e5('0x28')][_0x32e5('0x48')]({'where':{'id':_0x11f321[_0x32e5('0x41')]['id']}})[_0x32e5('0x25')](handleEntityNotFound(_0x24d9e4,null))[_0x32e5('0x25')](function(_0x51815d){if(_0x51815d){_0x26594a=_0x51815d;_0x3c789d[_0x32e5('0x2a')]=_['keys'](db[_0x32e5('0x49')][_0x32e5('0x29')]);_0x3c789d[_0x32e5('0x2b')]=_['keys'](_0x11f321[_0x32e5('0x2b')]);_0x3c789d[_0x32e5('0x2d')]=_[_0x32e5('0x2e')](_0x3c789d[_0x32e5('0x2a')],_0x3c789d[_0x32e5('0x2b')]);_0x333495[_0x32e5('0x30')]=_['intersection'](_0x3c789d[_0x32e5('0x2a')],qs[_0x32e5('0x2f')](_0x11f321['query']['fields']));_0x333495[_0x32e5('0x30')]=_0x333495[_0x32e5('0x30')][_0x32e5('0x31')]?_0x333495[_0x32e5('0x30')]:_0x3c789d['model'];_0x333495[_0x32e5('0x33')]=qs[_0x32e5('0x34')](_0x11f321[_0x32e5('0x2b')][_0x32e5('0x34')]);_0x333495[_0x32e5('0x3d')]=qs['filters'](_[_0x32e5('0x35')](_0x11f321[_0x32e5('0x2b')],_0x3c789d[_0x32e5('0x2d')]));if(_0x11f321[_0x32e5('0x2b')][_0x32e5('0x3b')]){_0x333495[_0x32e5('0x3d')]=_[_0x32e5('0x36')](_0x333495[_0x32e5('0x3d')],{'$or':_[_0x32e5('0x4c')](_0x333495['attributes'],function(_0x440787){var _0x655f18={};_0x655f18[_0x440787]={'$like':'%'+_0x11f321[_0x32e5('0x2b')]['filter']+'%'};return _0x655f18;})});}_0x333495=_[_0x32e5('0x36')]({},_0x333495,_0x11f321[_0x32e5('0x3c')]);return _0x26594a[_0x32e5('0x4b')](_0x333495);}})[_0x32e5('0x25')](function(_0x4ffc08){if(_0x4ffc08){_0x109690=_0x4ffc08[_0x32e5('0x31')];if(!_0x11f321['query'][_0x32e5('0x4a')](_0x32e5('0x4d'))){_0x333495[_0x32e5('0x20')]=qs['limit'](_0x11f321['query'][_0x32e5('0x20')]);_0x333495['offset']=qs['offset'](_0x11f321[_0x32e5('0x2b')][_0x32e5('0x32')]);}return _0x26594a[_0x32e5('0x4b')](_0x333495);}})[_0x32e5('0x25')](function(_0x4e3435){if(_0x4e3435){return _0x4e3435?{'count':_0x109690,'rows':_0x4e3435}:null;}})[_0x32e5('0x25')](respondWithResult(_0x24d9e4,null))['catch'](handleError(_0x24d9e4,null));};exports[_0x32e5('0x4e')]=function(_0xf345c2,_0x4c1f7d,_0x192925){var _0x2482dd={};var _0x5486b8={};var _0x31543a;var _0x4aac56;return db[_0x32e5('0x28')][_0x32e5('0x48')]({'where':{'id':_0xf345c2[_0x32e5('0x41')]['id']}})[_0x32e5('0x25')](handleEntityNotFound(_0x4c1f7d,null))['then'](function(_0x2ef619){if(_0x2ef619){_0x31543a=_0x2ef619;_0x5486b8[_0x32e5('0x2a')]=_[_0x32e5('0x2c')](db[_0x32e5('0x49')][_0x32e5('0x29')]);_0x5486b8[_0x32e5('0x2b')]=_[_0x32e5('0x2c')](_0xf345c2['query']);_0x5486b8[_0x32e5('0x2d')]=_[_0x32e5('0x2e')](_0x5486b8[_0x32e5('0x2a')],_0x5486b8[_0x32e5('0x2b')]);_0x2482dd['attributes']=_['intersection'](_0x5486b8[_0x32e5('0x2a')],qs[_0x32e5('0x2f')](_0xf345c2[_0x32e5('0x2b')][_0x32e5('0x2f')]));_0x2482dd[_0x32e5('0x30')]=_0x2482dd[_0x32e5('0x30')]['length']?_0x2482dd[_0x32e5('0x30')]:_0x5486b8[_0x32e5('0x2a')];_0x2482dd['order']=qs[_0x32e5('0x34')](_0xf345c2[_0x32e5('0x2b')][_0x32e5('0x34')]);_0x2482dd[_0x32e5('0x3d')]=qs['filters'](_[_0x32e5('0x35')](_0xf345c2[_0x32e5('0x2b')],_0x5486b8[_0x32e5('0x2d')]));if(_0xf345c2[_0x32e5('0x2b')][_0x32e5('0x3b')]){_0x2482dd[_0x32e5('0x3d')]=_[_0x32e5('0x36')](_0x2482dd[_0x32e5('0x3d')],{'$or':_['map'](_0x2482dd['attributes'],function(_0x515888){var _0x24a094={};_0x24a094[_0x515888]={'$like':'%'+_0xf345c2[_0x32e5('0x2b')][_0x32e5('0x3b')]+'%'};return _0x24a094;})});}_0x2482dd=_[_0x32e5('0x36')]({},_0x2482dd,_0xf345c2['options']);return _0x31543a[_0x32e5('0x4e')](_0x2482dd);}})[_0x32e5('0x25')](function(_0x1dcf78){if(_0x1dcf78){_0x4aac56=_0x1dcf78[_0x32e5('0x31')];if(!_0xf345c2[_0x32e5('0x2b')][_0x32e5('0x4a')](_0x32e5('0x4d'))){_0x2482dd[_0x32e5('0x20')]=qs[_0x32e5('0x20')](_0xf345c2[_0x32e5('0x2b')][_0x32e5('0x20')]);_0x2482dd['offset']=qs['offset'](_0xf345c2[_0x32e5('0x2b')]['offset']);}return _0x31543a['getDescriptions'](_0x2482dd);}})[_0x32e5('0x25')](function(_0x5edfc5){if(_0x5edfc5){return _0x5edfc5?{'count':_0x4aac56,'rows':_0x5edfc5}:null;}})['then'](respondWithResult(_0x4c1f7d,null))['catch'](handleError(_0x4c1f7d,null));};exports[_0x32e5('0x4f')]=function(_0x328362,_0x809e6e,_0x2868d7){var _0x1e790f={};var _0x56a2c9={};var _0x411bcc;var _0x37481e;return db['FreshdeskConfiguration'][_0x32e5('0x48')]({'where':{'id':_0x328362[_0x32e5('0x41')]['id']}})[_0x32e5('0x25')](handleEntityNotFound(_0x809e6e,null))['then'](function(_0x400767){if(_0x400767){_0x411bcc=_0x400767;_0x56a2c9[_0x32e5('0x2a')]=_[_0x32e5('0x2c')](db['Tag'][_0x32e5('0x29')]);_0x56a2c9[_0x32e5('0x2b')]=_[_0x32e5('0x2c')](_0x328362['query']);_0x56a2c9[_0x32e5('0x2d')]=_[_0x32e5('0x2e')](_0x56a2c9[_0x32e5('0x2a')],_0x56a2c9[_0x32e5('0x2b')]);_0x1e790f[_0x32e5('0x30')]=_[_0x32e5('0x2e')](_0x56a2c9[_0x32e5('0x2a')],qs['fields'](_0x328362['query']['fields']));_0x1e790f['attributes']=_0x1e790f['attributes'][_0x32e5('0x31')]?_0x1e790f[_0x32e5('0x30')]:_0x56a2c9['model'];_0x1e790f[_0x32e5('0x33')]=qs[_0x32e5('0x34')](_0x328362[_0x32e5('0x2b')][_0x32e5('0x34')]);_0x1e790f[_0x32e5('0x3d')]=qs[_0x32e5('0x2d')](_[_0x32e5('0x35')](_0x328362[_0x32e5('0x2b')],_0x56a2c9[_0x32e5('0x2d')]));if(_0x328362[_0x32e5('0x2b')]['filter']){_0x1e790f['where']=_[_0x32e5('0x36')](_0x1e790f[_0x32e5('0x3d')],{'$or':_['map'](_0x1e790f['attributes'],function(_0x411c41){var _0x2a4990={};_0x2a4990[_0x411c41]={'$like':'%'+_0x328362['query'][_0x32e5('0x3b')]+'%'};return _0x2a4990;})});}_0x1e790f=_[_0x32e5('0x36')]({},_0x1e790f,_0x328362[_0x32e5('0x3c')]);return _0x411bcc[_0x32e5('0x4f')](_0x1e790f);}})['then'](function(_0x4c6308){if(_0x4c6308){_0x37481e=_0x4c6308[_0x32e5('0x31')];if(!_0x328362[_0x32e5('0x2b')]['hasOwnProperty'](_0x32e5('0x4d'))){_0x1e790f[_0x32e5('0x20')]=qs[_0x32e5('0x20')](_0x328362['query'][_0x32e5('0x20')]);_0x1e790f[_0x32e5('0x32')]=qs['offset'](_0x328362[_0x32e5('0x2b')]['offset']);}return _0x411bcc[_0x32e5('0x4f')](_0x1e790f);}})[_0x32e5('0x25')](function(_0x56d846){if(_0x56d846){return _0x56d846?{'count':_0x37481e,'rows':_0x56d846}:null;}})[_0x32e5('0x25')](respondWithResult(_0x809e6e,null))['catch'](handleError(_0x809e6e,null));};exports[_0x32e5('0x50')]=function(_0x5e2721,_0x260bdb,_0x3c9198){if(_0x5e2721['body']['id']){delete _0x5e2721[_0x32e5('0x45')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5e2721['params']['id']}})[_0x32e5('0x25')](handleEntityNotFound(_0x260bdb,null))['then'](function(_0x205bfb){if(_0x205bfb){return _0x205bfb[_0x32e5('0x50')](_0x5e2721[_0x32e5('0x45')][_0x32e5('0x51')]||[]);}return null;})['then'](respondWithResult(_0x260bdb,null))['catch'](handleError(_0x260bdb,null));}; \ No newline at end of file +var _0xcc16=['status','json','count','offset','set','apply','reject','update','then','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes','model','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','params','find','create','body','getFields','FreshdeskField','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','end'];(function(_0xfa420e,_0x1a93ef){var _0x314b04=function(_0x5881c9){while(--_0x5881c9){_0xfa420e['push'](_0xfa420e['shift']());}};_0x314b04(++_0x1a93ef);}(_0xcc16,0x1a7));var _0x6cc1=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0xcc16[_0x21c2c8];return _0x4dd745;};'use strict';var pdf=require(_0x6cc1('0x0'));var emlformat=require(_0x6cc1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6cc1('0x2'));var jsonpatch=require(_0x6cc1('0x3'));var rp=require(_0x6cc1('0x4'));var moment=require(_0x6cc1('0x5'));var BPromise=require(_0x6cc1('0x6'));var Mustache=require(_0x6cc1('0x7'));var util=require(_0x6cc1('0x8'));var path=require(_0x6cc1('0x9'));var sox=require(_0x6cc1('0xa'));var csv=require(_0x6cc1('0xb'));var ejs=require(_0x6cc1('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6cc1('0xd'));var crypto=require(_0x6cc1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6cc1('0xf'));var toCsv=require(_0x6cc1('0xb'));var querystring=require(_0x6cc1('0x10'));var Papa=require('papaparse');var authService=require(_0x6cc1('0x11'));var hardwareService=require(_0x6cc1('0x12'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x6cc1('0x13'))(_0x6cc1('0x14'));var utils=require(_0x6cc1('0x15'));var config=require('../../config/environment');var db=require(_0x6cc1('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6cc1('0x17')][_0x6cc1('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2a2f82,_0x1fcc81,_0x57e607,_0xdef17){return new BPromise(function(_0x572ac2,_0x2f271e){var _0xc9b9cf=_0xdef17||client;return _0xc9b9cf[_0x6cc1('0x19')](_0x2a2f82,_0x57e607)['then'](function(_0x57d10a){logger[_0x6cc1('0x1a')](_0x6cc1('0x1b'),_0x1fcc81,'request\x20sent');logger[_0x6cc1('0x1c')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1fcc81,_0x6cc1('0x1d'),JSON['stringify'](_0x57d10a));if(_0x57d10a[_0x6cc1('0x1e')]){if(_0x57d10a['error'][_0x6cc1('0x1f')]===0x1f4){logger[_0x6cc1('0x1e')](_0x6cc1('0x1b'),_0x1fcc81,_0x57d10a[_0x6cc1('0x1e')][_0x6cc1('0x20')]);return _0x2f271e(_0x57d10a['error'][_0x6cc1('0x20')]);}logger[_0x6cc1('0x1e')](_0x6cc1('0x1b'),_0x1fcc81,_0x57d10a[_0x6cc1('0x1e')][_0x6cc1('0x20')]);return _0x572ac2(_0x57d10a[_0x6cc1('0x1e')][_0x6cc1('0x20')]);}else{logger[_0x6cc1('0x1a')](_0x6cc1('0x1b'),_0x1fcc81,_0x6cc1('0x1d'));_0x572ac2(_0x57d10a[_0x6cc1('0x21')][_0x6cc1('0x20')]);}})[_0x6cc1('0x22')](function(_0x406863){logger[_0x6cc1('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1fcc81,_0x406863);_0x2f271e(_0x406863);});});}function respondWithStatusCode(_0x4b18fe,_0x25881){_0x25881=_0x25881||0xcc;return function(_0x1beba8){if(_0x1beba8){return _0x4b18fe[_0x6cc1('0x23')](_0x25881);}return _0x4b18fe['status'](_0x25881)[_0x6cc1('0x24')]();};}function respondWithResult(_0x4f79dc,_0xabed9e){_0xabed9e=_0xabed9e||0xc8;return function(_0x28f32f){if(_0x28f32f){return _0x4f79dc[_0x6cc1('0x25')](_0xabed9e)[_0x6cc1('0x26')](_0x28f32f);}};}function respondWithFilteredResult(_0xfe42b,_0x4bea7f){return function(_0x88b056){if(_0x88b056){var _0x3a8f1f=_0x88b056[_0x6cc1('0x27')],_0x17e46f=_0x4bea7f['offset'],_0x28df49=_0x4bea7f[_0x6cc1('0x28')]+_0x4bea7f['limit'],_0x1da238;if(_0x28df49>=_0x3a8f1f){_0x28df49=_0x3a8f1f;_0x1da238=0xc8;}else{_0x1da238=0xce;}_0xfe42b[_0x6cc1('0x25')](_0x1da238);return _0xfe42b[_0x6cc1('0x29')]('Content-Range',_0x17e46f+'-'+_0x28df49+'/'+_0x3a8f1f)[_0x6cc1('0x26')](_0x88b056);}return null;};}function patchUpdates(_0x23e0b2){return function(_0x194568){try{jsonpatch[_0x6cc1('0x2a')](_0x194568,_0x23e0b2,!![]);}catch(_0xe96204){return BPromise[_0x6cc1('0x2b')](_0xe96204);}return _0x194568['save']();};}function saveUpdates(_0x1a66ef,_0x324148){return function(_0x32b39d){if(_0x32b39d){return _0x32b39d[_0x6cc1('0x2c')](_0x1a66ef)[_0x6cc1('0x2d')](function(_0x58e4df){return _0x58e4df;});}return null;};}function removeEntity(_0x474b99,_0x1c8310){return function(_0x63d6bc){if(_0x63d6bc){return _0x63d6bc[_0x6cc1('0x2e')]()[_0x6cc1('0x2d')](function(){_0x474b99[_0x6cc1('0x25')](0xcc)[_0x6cc1('0x24')]();});}};}function handleEntityNotFound(_0x53b8c3,_0x20a931){return function(_0x2b2309){if(!_0x2b2309){_0x53b8c3[_0x6cc1('0x23')](0x194);}return _0x2b2309;};}function handleError(_0x553278,_0x2d448b){_0x2d448b=_0x2d448b||0x1f4;return function(_0xf8d59a){logger[_0x6cc1('0x1e')](_0xf8d59a[_0x6cc1('0x2f')]);if(_0xf8d59a[_0x6cc1('0x30')]){delete _0xf8d59a[_0x6cc1('0x30')];}_0x553278['status'](_0x2d448b)[_0x6cc1('0x31')](_0xf8d59a);};}exports[_0x6cc1('0x32')]=function(_0x2b5fd0,_0x5df961){var _0x1cff49={},_0x911a34={},_0x5347a9={'count':0x0,'rows':[]};var _0x242d35=db[_0x6cc1('0x33')][_0x6cc1('0x34')];_0x911a34[_0x6cc1('0x35')]=_[_0x6cc1('0x36')](_0x242d35);_0x911a34['query']=_['keys'](_0x2b5fd0['query']);_0x911a34[_0x6cc1('0x37')]=_['intersection'](_0x911a34[_0x6cc1('0x35')],_0x911a34['query']);_0x1cff49[_0x6cc1('0x38')]=_[_0x6cc1('0x39')](_0x911a34[_0x6cc1('0x35')],qs[_0x6cc1('0x3a')](_0x2b5fd0[_0x6cc1('0x3b')]['fields']));_0x1cff49['attributes']=_0x1cff49[_0x6cc1('0x38')][_0x6cc1('0x3c')]?_0x1cff49[_0x6cc1('0x38')]:_0x911a34[_0x6cc1('0x35')];if(!_0x2b5fd0['query'][_0x6cc1('0x3d')]('nolimit')){_0x1cff49['limit']=qs[_0x6cc1('0x3e')](_0x2b5fd0['query']['limit']);_0x1cff49[_0x6cc1('0x28')]=qs[_0x6cc1('0x28')](_0x2b5fd0[_0x6cc1('0x3b')][_0x6cc1('0x28')]);}_0x1cff49[_0x6cc1('0x3f')]=qs['sort'](_0x2b5fd0[_0x6cc1('0x3b')][_0x6cc1('0x40')]);_0x1cff49[_0x6cc1('0x41')]=qs[_0x6cc1('0x37')](_[_0x6cc1('0x42')](_0x2b5fd0[_0x6cc1('0x3b')],_0x911a34[_0x6cc1('0x37')]));if(_0x2b5fd0['query'][_0x6cc1('0x43')]){_0x1cff49[_0x6cc1('0x41')]=_[_0x6cc1('0x44')](_0x1cff49[_0x6cc1('0x41')],{'$or':_[_0x6cc1('0x45')](_0x242d35,function(_0x160bce){if(_0x160bce[_0x6cc1('0x46')][_0x6cc1('0x47')]!==_0x6cc1('0x48')){var _0x4a7117={};_0x4a7117[_0x160bce[_0x6cc1('0x49')]]={'$like':'%'+_0x2b5fd0[_0x6cc1('0x3b')][_0x6cc1('0x43')]+'%'};return _0x4a7117;}})});}_0x1cff49=_[_0x6cc1('0x44')]({},_0x1cff49,_0x2b5fd0[_0x6cc1('0x4a')]);var _0x2e68a8={'where':_0x1cff49[_0x6cc1('0x41')]};return db[_0x6cc1('0x33')][_0x6cc1('0x27')](_0x2e68a8)[_0x6cc1('0x2d')](function(_0x1135af){_0x5347a9[_0x6cc1('0x27')]=_0x1135af;if(_0x2b5fd0[_0x6cc1('0x3b')][_0x6cc1('0x4b')]){_0x1cff49[_0x6cc1('0x4c')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x6cc1('0x4d')](_0x1cff49);})[_0x6cc1('0x2d')](function(_0x52547c){_0x5347a9['rows']=_0x52547c;return _0x5347a9;})[_0x6cc1('0x2d')](respondWithFilteredResult(_0x5df961,_0x1cff49))['catch'](handleError(_0x5df961,null));};exports['show']=function(_0x5889ff,_0x2aec1a){var _0x43550f={'raw':![],'where':{'id':_0x5889ff[_0x6cc1('0x4e')]['id']}},_0xa42884={};_0xa42884[_0x6cc1('0x35')]=_[_0x6cc1('0x36')](db[_0x6cc1('0x33')]['rawAttributes']);_0xa42884['query']=_[_0x6cc1('0x36')](_0x5889ff[_0x6cc1('0x3b')]);_0xa42884['filters']=_[_0x6cc1('0x39')](_0xa42884[_0x6cc1('0x35')],_0xa42884[_0x6cc1('0x3b')]);_0x43550f[_0x6cc1('0x38')]=_[_0x6cc1('0x39')](_0xa42884[_0x6cc1('0x35')],qs[_0x6cc1('0x3a')](_0x5889ff['query']['fields']));_0x43550f[_0x6cc1('0x38')]=_0x43550f[_0x6cc1('0x38')][_0x6cc1('0x3c')]?_0x43550f['attributes']:_0xa42884[_0x6cc1('0x35')];if(_0x5889ff[_0x6cc1('0x3b')][_0x6cc1('0x4b')]){_0x43550f[_0x6cc1('0x4c')]=[{'all':!![]}];}_0x43550f=_[_0x6cc1('0x44')]({},_0x43550f,_0x5889ff['options']);return db['FreshdeskConfiguration'][_0x6cc1('0x4f')](_0x43550f)['then'](handleEntityNotFound(_0x2aec1a,null))[_0x6cc1('0x2d')](respondWithResult(_0x2aec1a,null))[_0x6cc1('0x22')](handleError(_0x2aec1a,null));};exports[_0x6cc1('0x50')]=function(_0x77a103,_0x537994){return db['FreshdeskConfiguration']['create'](_0x77a103[_0x6cc1('0x51')],{})[_0x6cc1('0x2d')](respondWithResult(_0x537994,0xc9))['catch'](handleError(_0x537994,null));};exports[_0x6cc1('0x2c')]=function(_0x4aefa6,_0x4dfed2){if(_0x4aefa6[_0x6cc1('0x51')]['id']){delete _0x4aefa6[_0x6cc1('0x51')]['id'];}return db[_0x6cc1('0x33')]['find']({'where':{'id':_0x4aefa6[_0x6cc1('0x4e')]['id']}})[_0x6cc1('0x2d')](handleEntityNotFound(_0x4dfed2,null))[_0x6cc1('0x2d')](saveUpdates(_0x4aefa6[_0x6cc1('0x51')],null))['then'](respondWithResult(_0x4dfed2,null))[_0x6cc1('0x22')](handleError(_0x4dfed2,null));};exports[_0x6cc1('0x2e')]=function(_0x5c523b,_0x32f50e){return db[_0x6cc1('0x33')][_0x6cc1('0x4f')]({'where':{'id':_0x5c523b['params']['id']}})[_0x6cc1('0x2d')](handleEntityNotFound(_0x32f50e,null))['then'](removeEntity(_0x32f50e,null))[_0x6cc1('0x22')](handleError(_0x32f50e,null));};exports[_0x6cc1('0x52')]=function(_0x35fea1,_0x18e029,_0x4b42e7){var _0x1ddcdc={};var _0x2a2ff0={};var _0x28f885;var _0xb5ea0e;return db[_0x6cc1('0x33')]['findOne']({'where':{'id':_0x35fea1[_0x6cc1('0x4e')]['id']}})[_0x6cc1('0x2d')](handleEntityNotFound(_0x18e029,null))[_0x6cc1('0x2d')](function(_0x3d1099){if(_0x3d1099){_0x28f885=_0x3d1099;_0x2a2ff0['model']=_[_0x6cc1('0x36')](db[_0x6cc1('0x53')][_0x6cc1('0x34')]);_0x2a2ff0[_0x6cc1('0x3b')]=_[_0x6cc1('0x36')](_0x35fea1[_0x6cc1('0x3b')]);_0x2a2ff0[_0x6cc1('0x37')]=_[_0x6cc1('0x39')](_0x2a2ff0[_0x6cc1('0x35')],_0x2a2ff0[_0x6cc1('0x3b')]);_0x1ddcdc[_0x6cc1('0x38')]=_['intersection'](_0x2a2ff0[_0x6cc1('0x35')],qs[_0x6cc1('0x3a')](_0x35fea1[_0x6cc1('0x3b')][_0x6cc1('0x3a')]));_0x1ddcdc[_0x6cc1('0x38')]=_0x1ddcdc[_0x6cc1('0x38')][_0x6cc1('0x3c')]?_0x1ddcdc[_0x6cc1('0x38')]:_0x2a2ff0['model'];_0x1ddcdc[_0x6cc1('0x3f')]=qs[_0x6cc1('0x40')](_0x35fea1['query'][_0x6cc1('0x40')]);_0x1ddcdc['where']=qs['filters'](_['pick'](_0x35fea1[_0x6cc1('0x3b')],_0x2a2ff0[_0x6cc1('0x37')]));if(_0x35fea1['query']['filter']){_0x1ddcdc[_0x6cc1('0x41')]=_[_0x6cc1('0x44')](_0x1ddcdc[_0x6cc1('0x41')],{'$or':_[_0x6cc1('0x45')](_0x1ddcdc[_0x6cc1('0x38')],function(_0x4e1862){var _0xb3e4be={};_0xb3e4be[_0x4e1862]={'$like':'%'+_0x35fea1[_0x6cc1('0x3b')][_0x6cc1('0x43')]+'%'};return _0xb3e4be;})});}_0x1ddcdc=_[_0x6cc1('0x44')]({},_0x1ddcdc,_0x35fea1[_0x6cc1('0x4a')]);return _0x28f885[_0x6cc1('0x52')](_0x1ddcdc);}})[_0x6cc1('0x2d')](function(_0x2eabf7){if(_0x2eabf7){_0xb5ea0e=_0x2eabf7[_0x6cc1('0x3c')];if(!_0x35fea1[_0x6cc1('0x3b')][_0x6cc1('0x3d')](_0x6cc1('0x54'))){_0x1ddcdc[_0x6cc1('0x3e')]=qs[_0x6cc1('0x3e')](_0x35fea1[_0x6cc1('0x3b')][_0x6cc1('0x3e')]);_0x1ddcdc[_0x6cc1('0x28')]=qs['offset'](_0x35fea1[_0x6cc1('0x3b')][_0x6cc1('0x28')]);}return _0x28f885[_0x6cc1('0x52')](_0x1ddcdc);}})[_0x6cc1('0x2d')](function(_0x49af88){if(_0x49af88){return _0x49af88?{'count':_0xb5ea0e,'rows':_0x49af88}:null;}})[_0x6cc1('0x2d')](respondWithResult(_0x18e029,null))[_0x6cc1('0x22')](handleError(_0x18e029,null));};exports[_0x6cc1('0x55')]=function(_0x516159,_0x4c5f10,_0x478e9a){var _0x5d564a={};var _0x3bb45f={};var _0x3de489;var _0x41520a;return db[_0x6cc1('0x33')][_0x6cc1('0x56')]({'where':{'id':_0x516159[_0x6cc1('0x4e')]['id']}})[_0x6cc1('0x2d')](handleEntityNotFound(_0x4c5f10,null))[_0x6cc1('0x2d')](function(_0x53dd84){if(_0x53dd84){_0x3de489=_0x53dd84;_0x3bb45f['model']=_[_0x6cc1('0x36')](db[_0x6cc1('0x53')]['rawAttributes']);_0x3bb45f[_0x6cc1('0x3b')]=_[_0x6cc1('0x36')](_0x516159[_0x6cc1('0x3b')]);_0x3bb45f[_0x6cc1('0x37')]=_[_0x6cc1('0x39')](_0x3bb45f['model'],_0x3bb45f[_0x6cc1('0x3b')]);_0x5d564a[_0x6cc1('0x38')]=_[_0x6cc1('0x39')](_0x3bb45f[_0x6cc1('0x35')],qs[_0x6cc1('0x3a')](_0x516159[_0x6cc1('0x3b')][_0x6cc1('0x3a')]));_0x5d564a[_0x6cc1('0x38')]=_0x5d564a['attributes'][_0x6cc1('0x3c')]?_0x5d564a[_0x6cc1('0x38')]:_0x3bb45f[_0x6cc1('0x35')];_0x5d564a[_0x6cc1('0x3f')]=qs[_0x6cc1('0x40')](_0x516159[_0x6cc1('0x3b')][_0x6cc1('0x40')]);_0x5d564a['where']=qs[_0x6cc1('0x37')](_[_0x6cc1('0x42')](_0x516159[_0x6cc1('0x3b')],_0x3bb45f['filters']));if(_0x516159[_0x6cc1('0x3b')][_0x6cc1('0x43')]){_0x5d564a[_0x6cc1('0x41')]=_['merge'](_0x5d564a[_0x6cc1('0x41')],{'$or':_['map'](_0x5d564a[_0x6cc1('0x38')],function(_0x313f6e){var _0x227c87={};_0x227c87[_0x313f6e]={'$like':'%'+_0x516159['query'][_0x6cc1('0x43')]+'%'};return _0x227c87;})});}_0x5d564a=_[_0x6cc1('0x44')]({},_0x5d564a,_0x516159[_0x6cc1('0x4a')]);return _0x3de489['getSubjects'](_0x5d564a);}})[_0x6cc1('0x2d')](function(_0x33e636){if(_0x33e636){_0x41520a=_0x33e636['length'];if(!_0x516159[_0x6cc1('0x3b')][_0x6cc1('0x3d')]('nolimit')){_0x5d564a[_0x6cc1('0x3e')]=qs[_0x6cc1('0x3e')](_0x516159['query'][_0x6cc1('0x3e')]);_0x5d564a[_0x6cc1('0x28')]=qs[_0x6cc1('0x28')](_0x516159[_0x6cc1('0x3b')]['offset']);}return _0x3de489[_0x6cc1('0x55')](_0x5d564a);}})['then'](function(_0x2743b5){if(_0x2743b5){return _0x2743b5?{'count':_0x41520a,'rows':_0x2743b5}:null;}})['then'](respondWithResult(_0x4c5f10,null))[_0x6cc1('0x22')](handleError(_0x4c5f10,null));};exports[_0x6cc1('0x57')]=function(_0x856b38,_0x1aaaec,_0x2bfef0){var _0x56ca79={};var _0x1eb4c6={};var _0x21a096;var _0x12a878;return db['FreshdeskConfiguration'][_0x6cc1('0x56')]({'where':{'id':_0x856b38['params']['id']}})[_0x6cc1('0x2d')](handleEntityNotFound(_0x1aaaec,null))['then'](function(_0x3535a7){if(_0x3535a7){_0x21a096=_0x3535a7;_0x1eb4c6[_0x6cc1('0x35')]=_[_0x6cc1('0x36')](db[_0x6cc1('0x53')][_0x6cc1('0x34')]);_0x1eb4c6[_0x6cc1('0x3b')]=_['keys'](_0x856b38[_0x6cc1('0x3b')]);_0x1eb4c6['filters']=_[_0x6cc1('0x39')](_0x1eb4c6['model'],_0x1eb4c6[_0x6cc1('0x3b')]);_0x56ca79[_0x6cc1('0x38')]=_[_0x6cc1('0x39')](_0x1eb4c6['model'],qs[_0x6cc1('0x3a')](_0x856b38[_0x6cc1('0x3b')][_0x6cc1('0x3a')]));_0x56ca79[_0x6cc1('0x38')]=_0x56ca79[_0x6cc1('0x38')][_0x6cc1('0x3c')]?_0x56ca79[_0x6cc1('0x38')]:_0x1eb4c6[_0x6cc1('0x35')];_0x56ca79[_0x6cc1('0x3f')]=qs[_0x6cc1('0x40')](_0x856b38['query'][_0x6cc1('0x40')]);_0x56ca79['where']=qs[_0x6cc1('0x37')](_['pick'](_0x856b38[_0x6cc1('0x3b')],_0x1eb4c6[_0x6cc1('0x37')]));if(_0x856b38['query']['filter']){_0x56ca79['where']=_[_0x6cc1('0x44')](_0x56ca79['where'],{'$or':_[_0x6cc1('0x45')](_0x56ca79['attributes'],function(_0x2ec156){var _0x1c0bac={};_0x1c0bac[_0x2ec156]={'$like':'%'+_0x856b38['query'][_0x6cc1('0x43')]+'%'};return _0x1c0bac;})});}_0x56ca79=_[_0x6cc1('0x44')]({},_0x56ca79,_0x856b38['options']);return _0x21a096[_0x6cc1('0x57')](_0x56ca79);}})[_0x6cc1('0x2d')](function(_0x2930c6){if(_0x2930c6){_0x12a878=_0x2930c6[_0x6cc1('0x3c')];if(!_0x856b38[_0x6cc1('0x3b')]['hasOwnProperty'](_0x6cc1('0x54'))){_0x56ca79['limit']=qs[_0x6cc1('0x3e')](_0x856b38[_0x6cc1('0x3b')][_0x6cc1('0x3e')]);_0x56ca79[_0x6cc1('0x28')]=qs[_0x6cc1('0x28')](_0x856b38['query'][_0x6cc1('0x28')]);}return _0x21a096[_0x6cc1('0x57')](_0x56ca79);}})[_0x6cc1('0x2d')](function(_0x3163ca){if(_0x3163ca){return _0x3163ca?{'count':_0x12a878,'rows':_0x3163ca}:null;}})['then'](respondWithResult(_0x1aaaec,null))['catch'](handleError(_0x1aaaec,null));};exports[_0x6cc1('0x58')]=function(_0x1088aa,_0x723a3e,_0x29a5d3){var _0x4c1166={};var _0x882d98={};var _0xe66a93;var _0x424bc2;return db['FreshdeskConfiguration'][_0x6cc1('0x56')]({'where':{'id':_0x1088aa[_0x6cc1('0x4e')]['id']}})[_0x6cc1('0x2d')](handleEntityNotFound(_0x723a3e,null))[_0x6cc1('0x2d')](function(_0x4479bb){if(_0x4479bb){_0xe66a93=_0x4479bb;_0x882d98['model']=_[_0x6cc1('0x36')](db[_0x6cc1('0x59')][_0x6cc1('0x34')]);_0x882d98['query']=_[_0x6cc1('0x36')](_0x1088aa['query']);_0x882d98['filters']=_[_0x6cc1('0x39')](_0x882d98['model'],_0x882d98['query']);_0x4c1166[_0x6cc1('0x38')]=_[_0x6cc1('0x39')](_0x882d98[_0x6cc1('0x35')],qs[_0x6cc1('0x3a')](_0x1088aa[_0x6cc1('0x3b')]['fields']));_0x4c1166['attributes']=_0x4c1166['attributes'][_0x6cc1('0x3c')]?_0x4c1166[_0x6cc1('0x38')]:_0x882d98[_0x6cc1('0x35')];_0x4c1166[_0x6cc1('0x3f')]=qs[_0x6cc1('0x40')](_0x1088aa[_0x6cc1('0x3b')]['sort']);_0x4c1166[_0x6cc1('0x41')]=qs[_0x6cc1('0x37')](_[_0x6cc1('0x42')](_0x1088aa[_0x6cc1('0x3b')],_0x882d98['filters']));if(_0x1088aa['query']['filter']){_0x4c1166[_0x6cc1('0x41')]=_[_0x6cc1('0x44')](_0x4c1166[_0x6cc1('0x41')],{'$or':_['map'](_0x4c1166['attributes'],function(_0x1b71a3){var _0xd67880={};_0xd67880[_0x1b71a3]={'$like':'%'+_0x1088aa['query']['filter']+'%'};return _0xd67880;})});}_0x4c1166=_[_0x6cc1('0x44')]({},_0x4c1166,_0x1088aa[_0x6cc1('0x4a')]);return _0xe66a93['getTags'](_0x4c1166);}})['then'](function(_0x3f9e7c){if(_0x3f9e7c){_0x424bc2=_0x3f9e7c['length'];if(!_0x1088aa[_0x6cc1('0x3b')][_0x6cc1('0x3d')]('nolimit')){_0x4c1166['limit']=qs[_0x6cc1('0x3e')](_0x1088aa[_0x6cc1('0x3b')][_0x6cc1('0x3e')]);_0x4c1166['offset']=qs['offset'](_0x1088aa[_0x6cc1('0x3b')][_0x6cc1('0x28')]);}return _0xe66a93['getTags'](_0x4c1166);}})['then'](function(_0x5f4553){if(_0x5f4553){return _0x5f4553?{'count':_0x424bc2,'rows':_0x5f4553}:null;}})[_0x6cc1('0x2d')](respondWithResult(_0x723a3e,null))[_0x6cc1('0x22')](handleError(_0x723a3e,null));};exports[_0x6cc1('0x5a')]=function(_0x34810b,_0x215da0,_0x28800b){if(_0x34810b[_0x6cc1('0x51')]['id']){delete _0x34810b[_0x6cc1('0x51')]['id'];}return db[_0x6cc1('0x33')][_0x6cc1('0x56')]({'where':{'id':_0x34810b['params']['id']}})[_0x6cc1('0x2d')](handleEntityNotFound(_0x215da0,null))[_0x6cc1('0x2d')](function(_0x26986e){if(_0x26986e){return _0x26986e[_0x6cc1('0x5a')](_0x34810b[_0x6cc1('0x51')][_0x6cc1('0x5b')]||[]);}return null;})['then'](respondWithResult(_0x215da0,null))[_0x6cc1('0x22')](handleError(_0x215da0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2515dbb..06c10d4 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 _0x7e81=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3b58f0,_0x23a901){var _0x14e427=function(_0x4d4b5b){while(--_0x4d4b5b){_0x3b58f0['push'](_0x3b58f0['shift']());}};_0x14e427(++_0x23a901);}(_0x7e81,0xc5));var _0x17e8=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x7e81[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x17e8('0x0'));var util=require(_0x17e8('0x1'));var logger=require(_0x17e8('0x2'))(_0x17e8('0x3'));var moment=require(_0x17e8('0x4'));var BPromise=require(_0x17e8('0x5'));var rp=require(_0x17e8('0x6'));var attributes=require(_0x17e8('0x7'));module[_0x17e8('0x8')]=function(_0x364a73,_0x4a2d30){return _0x364a73[_0x17e8('0x9')](_0x17e8('0xa'),attributes,{'tableName':_0x17e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc82=['./intFreshdeskConfiguration.attributes','int_freshdesk_configurations','lodash','moment'];(function(_0x42af30,_0x5cf3dd){var _0xe09b2f=function(_0x27c714){while(--_0x27c714){_0x42af30['push'](_0x42af30['shift']());}};_0xe09b2f(++_0x5cf3dd);}(_0xbc82,0x13e));var _0x2bc8=function(_0x26578c,_0x11bff1){_0x26578c=_0x26578c-0x0;var _0x1c2a77=_0xbc82[_0x26578c];return _0x1c2a77;};'use strict';var _=require(_0x2bc8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2bc8('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x2bc8('0x2'));module['exports']=function(_0x528bc4,_0x43e157){return _0x528bc4['define']('FreshdeskConfiguration',attributes,{'tableName':_0x2bc8('0x3'),'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 19126ed..a90850f 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 _0xade0=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x6d786a,_0x461651){var _0x50a9f3=function(_0x3cd238){while(--_0x3cd238){_0x6d786a['push'](_0x6d786a['shift']());}};_0x50a9f3(++_0x461651);}(_0xade0,0x1f4));var _0x0ade=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0xade0[_0x209fcd];return _0x501d5e;};'use strict';var _=require(_0x0ade('0x0'));var util=require(_0x0ade('0x1'));var moment=require(_0x0ade('0x2'));var BPromise=require(_0x0ade('0x3'));var rs=require(_0x0ade('0x4'));var fs=require('fs');var Redis=require(_0x0ade('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ade('0x6'))(_0x0ade('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ade('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7078,_0x5084cc,_0x28df23){return new BPromise(function(_0x15bc42,_0x3e132a){return client['request'](_0x5d7078,_0x28df23)[_0x0ade('0x9')](function(_0x1bb8fb){logger[_0x0ade('0xa')](_0x0ade('0xb'),_0x5084cc,_0x0ade('0xc'));logger[_0x0ade('0xd')](_0x0ade('0xe'),_0x5084cc,'request\x20sent',JSON[_0x0ade('0xf')](_0x1bb8fb));if(_0x1bb8fb[_0x0ade('0x10')]){if(_0x1bb8fb['error']['code']===0x1f4){logger[_0x0ade('0x10')](_0x0ade('0xb'),_0x5084cc,_0x1bb8fb[_0x0ade('0x10')][_0x0ade('0x11')]);return _0x3e132a(_0x1bb8fb[_0x0ade('0x10')][_0x0ade('0x11')]);}logger[_0x0ade('0x10')](_0x0ade('0xb'),_0x5084cc,_0x1bb8fb[_0x0ade('0x10')]['message']);return _0x15bc42(_0x1bb8fb[_0x0ade('0x10')]['message']);}else{logger[_0x0ade('0xa')](_0x0ade('0xb'),_0x5084cc,_0x0ade('0xc'));_0x15bc42(_0x1bb8fb[_0x0ade('0x12')][_0x0ade('0x11')]);}})['catch'](function(_0x1833af){logger[_0x0ade('0x10')](_0x0ade('0xb'),_0x5084cc,_0x1833af);_0x3e132a(_0x1833af);});});} \ No newline at end of file +var _0x0d0f=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x183013,_0x127331){var _0x42db99=function(_0x3a529d){while(--_0x3a529d){_0x183013['push'](_0x183013['shift']());}};_0x42db99(++_0x127331);}(_0x0d0f,0x184));var _0xf0d0=function(_0x432df7,_0x432b3e){_0x432df7=_0x432df7-0x0;var _0x90effe=_0x0d0f[_0x432df7];return _0x90effe;};'use strict';var _=require(_0xf0d0('0x0'));var util=require(_0xf0d0('0x1'));var moment=require('moment');var BPromise=require(_0xf0d0('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(_0xf0d0('0x3'))(_0xf0d0('0x4'));var config=require(_0xf0d0('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf0d0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4305da,_0x3a5ab2,_0x4ddc02){return new BPromise(function(_0x3753e2,_0xbf374c){return client[_0xf0d0('0x7')](_0x4305da,_0x4ddc02)[_0xf0d0('0x8')](function(_0x1a6fdd){logger[_0xf0d0('0x9')](_0xf0d0('0xa'),_0x3a5ab2,_0xf0d0('0xb'));logger[_0xf0d0('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3a5ab2,_0xf0d0('0xb'),JSON[_0xf0d0('0xd')](_0x1a6fdd));if(_0x1a6fdd[_0xf0d0('0xe')]){if(_0x1a6fdd[_0xf0d0('0xe')][_0xf0d0('0xf')]===0x1f4){logger[_0xf0d0('0xe')](_0xf0d0('0xa'),_0x3a5ab2,_0x1a6fdd[_0xf0d0('0xe')][_0xf0d0('0x10')]);return _0xbf374c(_0x1a6fdd[_0xf0d0('0xe')][_0xf0d0('0x10')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a5ab2,_0x1a6fdd[_0xf0d0('0xe')][_0xf0d0('0x10')]);return _0x3753e2(_0x1a6fdd['error'][_0xf0d0('0x10')]);}else{logger[_0xf0d0('0x9')](_0xf0d0('0xa'),_0x3a5ab2,_0xf0d0('0xb'));_0x3753e2(_0x1a6fdd['result'][_0xf0d0('0x10')]);}})[_0xf0d0('0x11')](function(_0x238d95){logger[_0xf0d0('0xe')](_0xf0d0('0xa'),_0x3a5ab2,_0x238d95);_0xbf374c(_0x238d95);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3ca4f57..9094703 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 _0xf77d=['isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x26890b,_0x3df154){var _0x9becd0=function(_0x2f8be6){while(--_0x2f8be6){_0x26890b['push'](_0x26890b['shift']());}};_0x9becd0(++_0x3df154);}(_0xf77d,0x15c));var _0xdf77=function(_0x31dd7e,_0x72d5da){_0x31dd7e=_0x31dd7e-0x0;var _0x2a6bfd=_0xf77d[_0x31dd7e];return _0x2a6bfd;};'use strict';var multer=require(_0xdf77('0x0'));var util=require(_0xdf77('0x1'));var path=require(_0xdf77('0x2'));var timeout=require(_0xdf77('0x3'));var express=require(_0xdf77('0x4'));var router=express[_0xdf77('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf77('0x6'));var config=require(_0xdf77('0x7'));var controller=require('./intFreshdeskField.controller');router[_0xdf77('0x8')]('/',auth[_0xdf77('0x9')](),controller['index']);router[_0xdf77('0x8')](_0xdf77('0xa'),auth['isAuthenticated'](),controller[_0xdf77('0xb')]);router[_0xdf77('0xc')]('/',auth[_0xdf77('0x9')](),controller[_0xdf77('0xd')]);router['put'](_0xdf77('0xa'),auth[_0xdf77('0x9')](),controller['update']);router[_0xdf77('0xe')](_0xdf77('0xa'),auth[_0xdf77('0x9')](),controller[_0xdf77('0xf')]);module[_0xdf77('0x10')]=router; \ No newline at end of file +var _0xdadf=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create','put','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xdadf,0x1e7));var _0xfdad=function(_0x198a6c,_0x4ccdfc){_0x198a6c=_0x198a6c-0x0;var _0x30fd1b=_0xdadf[_0x198a6c];return _0x30fd1b;};'use strict';var multer=require(_0xfdad('0x0'));var util=require(_0xfdad('0x1'));var path=require(_0xfdad('0x2'));var timeout=require('connect-timeout');var express=require(_0xfdad('0x3'));var router=express[_0xfdad('0x4')]();var auth=require(_0xfdad('0x5'));var interaction=require(_0xfdad('0x6'));var config=require(_0xfdad('0x7'));var controller=require(_0xfdad('0x8'));router[_0xfdad('0x9')]('/',auth[_0xfdad('0xa')](),controller[_0xfdad('0xb')]);router['get'](_0xfdad('0xc'),auth[_0xfdad('0xa')](),controller[_0xfdad('0xd')]);router['post']('/',auth[_0xfdad('0xa')](),controller[_0xfdad('0xe')]);router[_0xfdad('0xf')](_0xfdad('0xc'),auth[_0xfdad('0xa')](),controller['update']);router['delete'](_0xfdad('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xfdad('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 0a7f848..ab1a54d 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 _0x9c00=['sequelize','exports','variable','customVariable','string','STRING','ENUM','BOOLEAN'];(function(_0x472d1a,_0x32a816){var _0x2cad59=function(_0x2297ef){while(--_0x2297ef){_0x472d1a['push'](_0x472d1a['shift']());}};_0x2cad59(++_0x32a816);}(_0x9c00,0x1a0));var _0x09c0=function(_0x3f4bc1,_0x15ace5){_0x3f4bc1=_0x3f4bc1-0x0;var _0x46fcf6=_0x9c00[_0x3f4bc1];return _0x46fcf6;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x09c0('0x2'),_0x09c0('0x3'),'keyValue'),'defaultValue':_0x09c0('0x4')},'content':{'type':Sequelize[_0x09c0('0x5')]},'key':{'type':Sequelize[_0x09c0('0x5')]},'keyType':{'type':Sequelize[_0x09c0('0x6')](_0x09c0('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x09c0('0x5')]},'idField':{'type':Sequelize[_0x09c0('0x5')]},'nameField':{'type':Sequelize[_0x09c0('0x5')]},'customField':{'type':Sequelize[_0x09c0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x09c0('0x5')]}}; \ No newline at end of file +var _0xe706=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x723288,_0x361804){var _0x45fecf=function(_0x39fbe1){while(--_0x39fbe1){_0x723288['push'](_0x723288['shift']());}};_0x45fecf(++_0x361804);}(_0xe706,0xa3));var _0x6e70=function(_0x128d68,_0x555a32){_0x128d68=_0x128d68-0x0;var _0x24ad4d=_0xe706[_0x128d68];return _0x24ad4d;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'type':{'type':Sequelize[_0x6e70('0x2')]('string',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')),'defaultValue':_0x6e70('0x6')},'content':{'type':Sequelize[_0x6e70('0x7')]},'key':{'type':Sequelize[_0x6e70('0x7')]},'keyType':{'type':Sequelize[_0x6e70('0x2')](_0x6e70('0x6'),_0x6e70('0x3'),_0x6e70('0x4'))},'keyContent':{'type':Sequelize[_0x6e70('0x7')]},'idField':{'type':Sequelize[_0x6e70('0x7')]},'nameField':{'type':Sequelize[_0x6e70('0x7')]},'customField':{'type':Sequelize[_0x6e70('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e70('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 8f0b7a2..d3f74b1 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 _0xb4c1=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs'];(function(_0xbf3f74,_0x1ae4bf){var _0xd26ead=function(_0x558853){while(--_0x558853){_0xbf3f74['push'](_0xbf3f74['shift']());}};_0xd26ead(++_0x1ae4bf);}(_0xb4c1,0x18d));var _0x1b4c=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb4c1[_0x199572];return _0x13cfa3;};'use strict';var pdf=require(_0x1b4c('0x0'));var emlformat=require(_0x1b4c('0x1'));var rimraf=require(_0x1b4c('0x2'));var zipdir=require(_0x1b4c('0x3'));var jsonpatch=require(_0x1b4c('0x4'));var rp=require(_0x1b4c('0x5'));var moment=require(_0x1b4c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x1b4c('0x7'));var util=require(_0x1b4c('0x8'));var path=require(_0x1b4c('0x9'));var sox=require('sox');var csv=require(_0x1b4c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1b4c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1b4c('0xa'));var querystring=require(_0x1b4c('0xc'));var Papa=require('papaparse');var authService=require(_0x1b4c('0xd'));var hardwareService=require(_0x1b4c('0xe'));var Redis=require(_0x1b4c('0xf'));var qs=require(_0x1b4c('0x10'));var logger=require('../../config/logger')(_0x1b4c('0x11'));var utils=require(_0x1b4c('0x12'));var config=require(_0x1b4c('0x13'));var db=require(_0x1b4c('0x14'))['db'];function respondWithStatusCode(_0x7e5208,_0x144662){_0x144662=_0x144662||0xcc;return function(_0x50dd88){if(_0x50dd88){return _0x7e5208[_0x1b4c('0x15')](_0x144662);}return _0x7e5208[_0x1b4c('0x16')](_0x144662)[_0x1b4c('0x17')]();};}function respondWithResult(_0xbcb19b,_0x12677e){_0x12677e=_0x12677e||0xc8;return function(_0x1de5aa){if(_0x1de5aa){return _0xbcb19b[_0x1b4c('0x16')](_0x12677e)[_0x1b4c('0x18')](_0x1de5aa);}};}function respondWithFilteredResult(_0x17940b,_0x260818){return function(_0x51c0fe){if(_0x51c0fe){var _0x454977=_0x51c0fe[_0x1b4c('0x19')],_0x57c795=_0x260818[_0x1b4c('0x1a')],_0x3fb9ef=_0x260818[_0x1b4c('0x1a')]+_0x260818[_0x1b4c('0x1b')],_0x36cbdf;if(_0x3fb9ef>=_0x454977){_0x3fb9ef=_0x454977;_0x36cbdf=0xc8;}else{_0x36cbdf=0xce;}_0x17940b[_0x1b4c('0x16')](_0x36cbdf);return _0x17940b[_0x1b4c('0x1c')](_0x1b4c('0x1d'),_0x57c795+'-'+_0x3fb9ef+'/'+_0x454977)[_0x1b4c('0x18')](_0x51c0fe);}return null;};}function patchUpdates(_0x4f45bd){return function(_0x40d010){try{jsonpatch[_0x1b4c('0x1e')](_0x40d010,_0x4f45bd,!![]);}catch(_0x59c02c){return BPromise['reject'](_0x59c02c);}return _0x40d010[_0x1b4c('0x1f')]();};}function saveUpdates(_0x3fb509,_0xcc08fe){return function(_0x518d78){if(_0x518d78){return _0x518d78['update'](_0x3fb509)[_0x1b4c('0x20')](function(_0x11bcca){return _0x11bcca;});}return null;};}function removeEntity(_0x50a8f4,_0x57ca8f){return function(_0x2a4e42){if(_0x2a4e42){return _0x2a4e42[_0x1b4c('0x21')]()[_0x1b4c('0x20')](function(){_0x50a8f4[_0x1b4c('0x16')](0xcc)[_0x1b4c('0x17')]();});}};}function handleEntityNotFound(_0x253096,_0x1d456e){return function(_0x155f0b){if(!_0x155f0b){_0x253096['sendStatus'](0x194);}return _0x155f0b;};}function handleError(_0x1833e2,_0x4623ed){_0x4623ed=_0x4623ed||0x1f4;return function(_0x14ab1b){logger[_0x1b4c('0x22')](_0x14ab1b[_0x1b4c('0x23')]);if(_0x14ab1b[_0x1b4c('0x24')]){delete _0x14ab1b['name'];}_0x1833e2['status'](_0x4623ed)[_0x1b4c('0x25')](_0x14ab1b);};}exports[_0x1b4c('0x26')]=function(_0x28fc5f,_0x5eb4d6){var _0x3c737d={},_0xbfccf4={},_0x1227f8={'count':0x0,'rows':[]};var _0x355fc0=db[_0x1b4c('0x27')][_0x1b4c('0x28')];_0xbfccf4[_0x1b4c('0x29')]=_[_0x1b4c('0x2a')](_0x355fc0);_0xbfccf4[_0x1b4c('0x2b')]=_['keys'](_0x28fc5f[_0x1b4c('0x2b')]);_0xbfccf4['filters']=_['intersection'](_0xbfccf4[_0x1b4c('0x29')],_0xbfccf4['query']);_0x3c737d[_0x1b4c('0x2c')]=_[_0x1b4c('0x2d')](_0xbfccf4[_0x1b4c('0x29')],qs[_0x1b4c('0x2e')](_0x28fc5f[_0x1b4c('0x2b')][_0x1b4c('0x2e')]));_0x3c737d['attributes']=_0x3c737d['attributes'][_0x1b4c('0x2f')]?_0x3c737d[_0x1b4c('0x2c')]:_0xbfccf4[_0x1b4c('0x29')];if(!_0x28fc5f[_0x1b4c('0x2b')][_0x1b4c('0x30')]('nolimit')){_0x3c737d[_0x1b4c('0x1b')]=qs['limit'](_0x28fc5f[_0x1b4c('0x2b')]['limit']);_0x3c737d[_0x1b4c('0x1a')]=qs[_0x1b4c('0x1a')](_0x28fc5f[_0x1b4c('0x2b')][_0x1b4c('0x1a')]);}_0x3c737d[_0x1b4c('0x31')]=qs[_0x1b4c('0x32')](_0x28fc5f['query'][_0x1b4c('0x32')]);_0x3c737d[_0x1b4c('0x33')]=qs[_0x1b4c('0x34')](_['pick'](_0x28fc5f[_0x1b4c('0x2b')],_0xbfccf4[_0x1b4c('0x34')]));if(_0x28fc5f[_0x1b4c('0x2b')][_0x1b4c('0x35')]){_0x3c737d[_0x1b4c('0x33')]=_['merge'](_0x3c737d[_0x1b4c('0x33')],{'$or':_[_0x1b4c('0x36')](_0x355fc0,function(_0x40cd63){if(_0x40cd63[_0x1b4c('0x37')]['key']!==_0x1b4c('0x38')){var _0x2baa7c={};_0x2baa7c[_0x40cd63['field']]={'$like':'%'+_0x28fc5f[_0x1b4c('0x2b')][_0x1b4c('0x35')]+'%'};return _0x2baa7c;}})});}_0x3c737d=_[_0x1b4c('0x39')]({},_0x3c737d,_0x28fc5f[_0x1b4c('0x3a')]);var _0x35605b={'where':_0x3c737d[_0x1b4c('0x33')]};return db['FreshdeskField']['count'](_0x35605b)[_0x1b4c('0x20')](function(_0x4cf02b){_0x1227f8[_0x1b4c('0x19')]=_0x4cf02b;if(_0x28fc5f[_0x1b4c('0x2b')][_0x1b4c('0x3b')]){_0x3c737d[_0x1b4c('0x3c')]=[{'all':!![]}];}return db['FreshdeskField'][_0x1b4c('0x3d')](_0x3c737d);})['then'](function(_0x1b9144){_0x1227f8[_0x1b4c('0x3e')]=_0x1b9144;return _0x1227f8;})[_0x1b4c('0x20')](respondWithFilteredResult(_0x5eb4d6,_0x3c737d))[_0x1b4c('0x3f')](handleError(_0x5eb4d6,null));};exports['show']=function(_0xd24bd0,_0x57299c){var _0x3f30c0={'raw':!![],'where':{'id':_0xd24bd0[_0x1b4c('0x40')]['id']}},_0x28446a={};_0x28446a['model']=_['keys'](db[_0x1b4c('0x27')][_0x1b4c('0x28')]);_0x28446a[_0x1b4c('0x2b')]=_[_0x1b4c('0x2a')](_0xd24bd0['query']);_0x28446a[_0x1b4c('0x34')]=_[_0x1b4c('0x2d')](_0x28446a['model'],_0x28446a[_0x1b4c('0x2b')]);_0x3f30c0['attributes']=_['intersection'](_0x28446a[_0x1b4c('0x29')],qs[_0x1b4c('0x2e')](_0xd24bd0['query'][_0x1b4c('0x2e')]));_0x3f30c0['attributes']=_0x3f30c0[_0x1b4c('0x2c')][_0x1b4c('0x2f')]?_0x3f30c0[_0x1b4c('0x2c')]:_0x28446a['model'];if(_0xd24bd0[_0x1b4c('0x2b')]['includeAll']){_0x3f30c0[_0x1b4c('0x3c')]=[{'all':!![]}];}_0x3f30c0=_[_0x1b4c('0x39')]({},_0x3f30c0,_0xd24bd0['options']);return db[_0x1b4c('0x27')][_0x1b4c('0x41')](_0x3f30c0)[_0x1b4c('0x20')](handleEntityNotFound(_0x57299c,null))[_0x1b4c('0x20')](respondWithResult(_0x57299c,null))[_0x1b4c('0x3f')](handleError(_0x57299c,null));};exports[_0x1b4c('0x42')]=function(_0x2e38af,_0x27ad92){return db[_0x1b4c('0x27')][_0x1b4c('0x42')](_0x2e38af['body'],{})[_0x1b4c('0x20')](respondWithResult(_0x27ad92,0xc9))[_0x1b4c('0x3f')](handleError(_0x27ad92,null));};exports[_0x1b4c('0x43')]=function(_0x2cd7ad,_0x2a9ad8){if(_0x2cd7ad[_0x1b4c('0x44')]['id']){delete _0x2cd7ad[_0x1b4c('0x44')]['id'];}return db[_0x1b4c('0x27')]['find']({'where':{'id':_0x2cd7ad['params']['id']}})[_0x1b4c('0x20')](handleEntityNotFound(_0x2a9ad8,null))[_0x1b4c('0x20')](saveUpdates(_0x2cd7ad[_0x1b4c('0x44')],null))['then'](respondWithResult(_0x2a9ad8,null))[_0x1b4c('0x3f')](handleError(_0x2a9ad8,null));};exports[_0x1b4c('0x21')]=function(_0x455f5d,_0x4fa963){return db[_0x1b4c('0x27')][_0x1b4c('0x41')]({'where':{'id':_0x455f5d[_0x1b4c('0x40')]['id']}})[_0x1b4c('0x20')](handleEntityNotFound(_0x4fa963,null))[_0x1b4c('0x20')](removeEntity(_0x4fa963,null))[_0x1b4c('0x3f')](handleError(_0x4fa963,null));}; \ No newline at end of file +var _0xb729=['destroy','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','Content-Range','apply','save','then','stack','name','index','FreshdeskField','rawAttributes','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','include','findAll','show','params','keys','includeAll','find','catch','create','body','update'];(function(_0x4cf959,_0xa40dfa){var _0x4b4134=function(_0x5501db){while(--_0x5501db){_0x4cf959['push'](_0x4cf959['shift']());}};_0x4b4134(++_0xa40dfa);}(_0xb729,0x150));var _0x9b72=function(_0x35e59e,_0x7546fe){_0x35e59e=_0x35e59e-0x0;var _0x11770f=_0xb729[_0x35e59e];return _0x11770f;};'use strict';var pdf=require(_0x9b72('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b72('0x1'));var rp=require(_0x9b72('0x2'));var moment=require('moment');var BPromise=require(_0x9b72('0x3'));var Mustache=require(_0x9b72('0x4'));var util=require(_0x9b72('0x5'));var path=require('path');var sox=require(_0x9b72('0x6'));var csv=require(_0x9b72('0x7'));var ejs=require(_0x9b72('0x8'));var fs=require('fs');var _=require(_0x9b72('0x9'));var squel=require('squel');var crypto=require(_0x9b72('0xa'));var jsforce=require(_0x9b72('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b72('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x9b72('0xd'));var Redis=require(_0x9b72('0xe'));var qs=require(_0x9b72('0xf'));var logger=require(_0x9b72('0x10'))('api');var utils=require(_0x9b72('0x11'));var config=require(_0x9b72('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a1a15,_0x76919){_0x76919=_0x76919||0xcc;return function(_0x9edac7){if(_0x9edac7){return _0x5a1a15[_0x9b72('0x13')](_0x76919);}return _0x5a1a15[_0x9b72('0x14')](_0x76919)[_0x9b72('0x15')]();};}function respondWithResult(_0x18e896,_0x5bed65){_0x5bed65=_0x5bed65||0xc8;return function(_0x25d178){if(_0x25d178){return _0x18e896[_0x9b72('0x14')](_0x5bed65)[_0x9b72('0x16')](_0x25d178);}};}function respondWithFilteredResult(_0x1f8be4,_0x227b17){return function(_0x24f01b){if(_0x24f01b){var _0x5e94ec=_0x24f01b[_0x9b72('0x17')],_0x39df5a=_0x227b17['offset'],_0x230927=_0x227b17['offset']+_0x227b17['limit'],_0xfbaae4;if(_0x230927>=_0x5e94ec){_0x230927=_0x5e94ec;_0xfbaae4=0xc8;}else{_0xfbaae4=0xce;}_0x1f8be4[_0x9b72('0x14')](_0xfbaae4);return _0x1f8be4['set'](_0x9b72('0x18'),_0x39df5a+'-'+_0x230927+'/'+_0x5e94ec)[_0x9b72('0x16')](_0x24f01b);}return null;};}function patchUpdates(_0x2a15e1){return function(_0x5c2043){try{jsonpatch[_0x9b72('0x19')](_0x5c2043,_0x2a15e1,!![]);}catch(_0xfdedab){return BPromise['reject'](_0xfdedab);}return _0x5c2043[_0x9b72('0x1a')]();};}function saveUpdates(_0xc9c8c4,_0xc4f9fc){return function(_0x366a03){if(_0x366a03){return _0x366a03['update'](_0xc9c8c4)[_0x9b72('0x1b')](function(_0x41a87f){return _0x41a87f;});}return null;};}function removeEntity(_0x4b3c11,_0x4996eb){return function(_0x4b3eb9){if(_0x4b3eb9){return _0x4b3eb9['destroy']()[_0x9b72('0x1b')](function(){_0x4b3c11[_0x9b72('0x14')](0xcc)[_0x9b72('0x15')]();});}};}function handleEntityNotFound(_0x442e14,_0x47016f){return function(_0x3c6a13){if(!_0x3c6a13){_0x442e14[_0x9b72('0x13')](0x194);}return _0x3c6a13;};}function handleError(_0x1b9e76,_0x2f6535){_0x2f6535=_0x2f6535||0x1f4;return function(_0x53ab74){logger['error'](_0x53ab74[_0x9b72('0x1c')]);if(_0x53ab74[_0x9b72('0x1d')]){delete _0x53ab74['name'];}_0x1b9e76[_0x9b72('0x14')](_0x2f6535)['send'](_0x53ab74);};}exports[_0x9b72('0x1e')]=function(_0x216e20,_0x2f767c){var _0x304052={},_0x181033={},_0x357b2e={'count':0x0,'rows':[]};var _0x5e6e76=db[_0x9b72('0x1f')][_0x9b72('0x20')];_0x181033[_0x9b72('0x21')]=_['keys'](_0x5e6e76);_0x181033['query']=_['keys'](_0x216e20[_0x9b72('0x22')]);_0x181033[_0x9b72('0x23')]=_['intersection'](_0x181033[_0x9b72('0x21')],_0x181033[_0x9b72('0x22')]);_0x304052[_0x9b72('0x24')]=_[_0x9b72('0x25')](_0x181033[_0x9b72('0x21')],qs[_0x9b72('0x26')](_0x216e20['query']['fields']));_0x304052[_0x9b72('0x24')]=_0x304052[_0x9b72('0x24')][_0x9b72('0x27')]?_0x304052[_0x9b72('0x24')]:_0x181033['model'];if(!_0x216e20[_0x9b72('0x22')][_0x9b72('0x28')](_0x9b72('0x29'))){_0x304052[_0x9b72('0x2a')]=qs['limit'](_0x216e20[_0x9b72('0x22')]['limit']);_0x304052[_0x9b72('0x2b')]=qs[_0x9b72('0x2b')](_0x216e20[_0x9b72('0x22')]['offset']);}_0x304052[_0x9b72('0x2c')]=qs[_0x9b72('0x2d')](_0x216e20[_0x9b72('0x22')][_0x9b72('0x2d')]);_0x304052[_0x9b72('0x2e')]=qs[_0x9b72('0x23')](_[_0x9b72('0x2f')](_0x216e20[_0x9b72('0x22')],_0x181033[_0x9b72('0x23')]));if(_0x216e20[_0x9b72('0x22')][_0x9b72('0x30')]){_0x304052[_0x9b72('0x2e')]=_[_0x9b72('0x31')](_0x304052[_0x9b72('0x2e')],{'$or':_[_0x9b72('0x32')](_0x5e6e76,function(_0x4f9000){if(_0x4f9000[_0x9b72('0x33')][_0x9b72('0x34')]!==_0x9b72('0x35')){var _0xb84788={};_0xb84788[_0x4f9000['field']]={'$like':'%'+_0x216e20[_0x9b72('0x22')][_0x9b72('0x30')]+'%'};return _0xb84788;}})});}_0x304052=_[_0x9b72('0x31')]({},_0x304052,_0x216e20[_0x9b72('0x36')]);var _0x21aab2={'where':_0x304052[_0x9b72('0x2e')]};return db['FreshdeskField'][_0x9b72('0x17')](_0x21aab2)[_0x9b72('0x1b')](function(_0x531873){_0x357b2e['count']=_0x531873;if(_0x216e20[_0x9b72('0x22')]['includeAll']){_0x304052[_0x9b72('0x37')]=[{'all':!![]}];}return db[_0x9b72('0x1f')][_0x9b72('0x38')](_0x304052);})[_0x9b72('0x1b')](function(_0x468ad5){_0x357b2e['rows']=_0x468ad5;return _0x357b2e;})['then'](respondWithFilteredResult(_0x2f767c,_0x304052))['catch'](handleError(_0x2f767c,null));};exports[_0x9b72('0x39')]=function(_0x484933,_0x102d66){var _0x20854f={'raw':!![],'where':{'id':_0x484933[_0x9b72('0x3a')]['id']}},_0x418adb={};_0x418adb[_0x9b72('0x21')]=_[_0x9b72('0x3b')](db[_0x9b72('0x1f')][_0x9b72('0x20')]);_0x418adb[_0x9b72('0x22')]=_[_0x9b72('0x3b')](_0x484933['query']);_0x418adb['filters']=_[_0x9b72('0x25')](_0x418adb[_0x9b72('0x21')],_0x418adb[_0x9b72('0x22')]);_0x20854f['attributes']=_[_0x9b72('0x25')](_0x418adb[_0x9b72('0x21')],qs['fields'](_0x484933[_0x9b72('0x22')]['fields']));_0x20854f[_0x9b72('0x24')]=_0x20854f[_0x9b72('0x24')][_0x9b72('0x27')]?_0x20854f[_0x9b72('0x24')]:_0x418adb['model'];if(_0x484933[_0x9b72('0x22')][_0x9b72('0x3c')]){_0x20854f[_0x9b72('0x37')]=[{'all':!![]}];}_0x20854f=_[_0x9b72('0x31')]({},_0x20854f,_0x484933[_0x9b72('0x36')]);return db[_0x9b72('0x1f')][_0x9b72('0x3d')](_0x20854f)['then'](handleEntityNotFound(_0x102d66,null))['then'](respondWithResult(_0x102d66,null))[_0x9b72('0x3e')](handleError(_0x102d66,null));};exports[_0x9b72('0x3f')]=function(_0x7f9afb,_0x5687c5){return db[_0x9b72('0x1f')][_0x9b72('0x3f')](_0x7f9afb[_0x9b72('0x40')],{})[_0x9b72('0x1b')](respondWithResult(_0x5687c5,0xc9))[_0x9b72('0x3e')](handleError(_0x5687c5,null));};exports[_0x9b72('0x41')]=function(_0x273abd,_0x1f1b38){if(_0x273abd[_0x9b72('0x40')]['id']){delete _0x273abd[_0x9b72('0x40')]['id'];}return db[_0x9b72('0x1f')][_0x9b72('0x3d')]({'where':{'id':_0x273abd['params']['id']}})[_0x9b72('0x1b')](handleEntityNotFound(_0x1f1b38,null))['then'](saveUpdates(_0x273abd['body'],null))['then'](respondWithResult(_0x1f1b38,null))['catch'](handleError(_0x1f1b38,null));};exports[_0x9b72('0x42')]=function(_0x458de3,_0xaba8b9){return db['FreshdeskField'][_0x9b72('0x3d')]({'where':{'id':_0x458de3[_0x9b72('0x3a')]['id']}})[_0x9b72('0x1b')](handleEntityNotFound(_0xaba8b9,null))['then'](removeEntity(_0xaba8b9,null))[_0x9b72('0x3e')](handleError(_0xaba8b9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 6b6571b..44f17f6 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 _0xcd54=['exports','define','FreshdeskField','freshdesk_unique_index','lodash','util','../../config/logger','bluebird','request-promise','./intFreshdeskField.attributes'];(function(_0x335ca6,_0xad68eb){var _0x1f93c9=function(_0x57081f){while(--_0x57081f){_0x335ca6['push'](_0x335ca6['shift']());}};_0x1f93c9(++_0xad68eb);}(_0xcd54,0x162));var _0x4cd5=function(_0x60d287,_0x26eef4){_0x60d287=_0x60d287-0x0;var _0x380216=_0xcd54[_0x60d287];return _0x380216;};'use strict';var _=require(_0x4cd5('0x0'));var util=require(_0x4cd5('0x1'));var logger=require(_0x4cd5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4cd5('0x3'));var rp=require(_0x4cd5('0x4'));var attributes=require(_0x4cd5('0x5'));module[_0x4cd5('0x6')]=function(_0x261333,_0xf920c0){return _0x261333[_0x4cd5('0x7')](_0x4cd5('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x4cd5('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x73ae=['freshdesk_unique_index','idField','FieldId','util','moment','bluebird','exports','define','int_freshdesk_fields'];(function(_0x3fd0c7,_0x2748a){var _0xb32cc9=function(_0x4b3fae){while(--_0x4b3fae){_0x3fd0c7['push'](_0x3fd0c7['shift']());}};_0xb32cc9(++_0x2748a);}(_0x73ae,0x135));var _0xe73a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x73ae[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xe73a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe73a('0x1'));var BPromise=require(_0xe73a('0x2'));var rp=require('request-promise');var attributes=require('./intFreshdeskField.attributes');module[_0xe73a('0x3')]=function(_0x5c5131,_0x5c9737){return _0x5c5131[_0xe73a('0x4')]('FreshdeskField',attributes,{'tableName':_0xe73a('0x5'),'paranoid':![],'indexes':[{'name':_0xe73a('0x6'),'fields':[_0xe73a('0x7'),_0xe73a('0x8')],'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 d06eb3c..a14d93e 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 _0x4fdb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x54872d,_0x4ab02c){_0x54872d=_0x54872d-0x0;var _0x55b784=_0x4fdb[_0x54872d];return _0x55b784;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rs=require(_0xb4fd('0x4'));var fs=require('fs');var Redis=require(_0xb4fd('0x5'));var db=require(_0xb4fd('0x6'))['db'];var utils=require(_0xb4fd('0x7'));var logger=require(_0xb4fd('0x8'))('rpc');var config=require(_0xb4fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4fd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53273f,_0x299bff,_0x3af8e3){return new BPromise(function(_0x1151b5,_0x52dca2){return client['request'](_0x53273f,_0x3af8e3)[_0xb4fd('0xb')](function(_0x4f9d18){logger[_0xb4fd('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x299bff,_0xb4fd('0xd'));logger[_0xb4fd('0xe')](_0xb4fd('0xf'),_0x299bff,_0xb4fd('0xd'),JSON[_0xb4fd('0x10')](_0x4f9d18));if(_0x4f9d18['error']){if(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x12')]===0x1f4){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x4f9d18['error'][_0xb4fd('0x14')]);return _0x52dca2(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}logger['error'](_0xb4fd('0x13'),_0x299bff,_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);return _0x1151b5(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}else{logger[_0xb4fd('0xc')](_0xb4fd('0x13'),_0x299bff,'request\x20sent');_0x1151b5(_0x4f9d18[_0xb4fd('0x15')][_0xb4fd('0x14')]);}})[_0xb4fd('0x16')](function(_0x2d4701){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x2d4701);_0x52dca2(_0x2d4701);});});} \ No newline at end of file +var _0xb7c8=['error','FreshdeskField,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x5ef922,_0x259ae6){var _0x4c3391=function(_0x3e5202){while(--_0x3e5202){_0x5ef922['push'](_0x5ef922['shift']());}};_0x4c3391(++_0x259ae6);}(_0xb7c8,0x119));var _0x8b7c=function(_0x5678de,_0x50c539){_0x5678de=_0x5678de-0x0;var _0x239585=_0xb7c8[_0x5678de];return _0x239585;};'use strict';var _=require('lodash');var util=require(_0x8b7c('0x0'));var moment=require(_0x8b7c('0x1'));var BPromise=require(_0x8b7c('0x2'));var rs=require(_0x8b7c('0x3'));var fs=require('fs');var Redis=require(_0x8b7c('0x4'));var db=require(_0x8b7c('0x5'))['db'];var utils=require(_0x8b7c('0x6'));var logger=require('../../config/logger')(_0x8b7c('0x7'));var config=require(_0x8b7c('0x8'));var jayson=require(_0x8b7c('0x9'));var client=jayson[_0x8b7c('0xa')][_0x8b7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12665c,_0x7a3850,_0x3c8fd6){return new BPromise(function(_0x6afb55,_0x30a924){return client[_0x8b7c('0xc')](_0x12665c,_0x3c8fd6)[_0x8b7c('0xd')](function(_0x48370e){logger[_0x8b7c('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x7a3850,_0x8b7c('0xf'));logger[_0x8b7c('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x7a3850,_0x8b7c('0xf'),JSON[_0x8b7c('0x11')](_0x48370e));if(_0x48370e[_0x8b7c('0x12')]){if(_0x48370e['error']['code']===0x1f4){logger[_0x8b7c('0x12')](_0x8b7c('0x13'),_0x7a3850,_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);return _0x30a924(_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);}logger[_0x8b7c('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x7a3850,_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);return _0x6afb55(_0x48370e[_0x8b7c('0x12')]['message']);}else{logger[_0x8b7c('0xe')](_0x8b7c('0x13'),_0x7a3850,'request\x20sent');_0x6afb55(_0x48370e[_0x8b7c('0x15')][_0x8b7c('0x14')]);}})[_0x8b7c('0x16')](function(_0x1682fd){logger[_0x8b7c('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x7a3850,_0x1682fd);_0x30a924(_0x1682fd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 50caea7..579eb49 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 _0xe9b4=['get','isAuthenticated','index','show','/:id/configurations','getFields','post','create','addConfiguration','put','/:id','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller'];(function(_0x6aabd8,_0x3374bd){var _0x3ec1ca=function(_0x57fd10){while(--_0x57fd10){_0x6aabd8['push'](_0x6aabd8['shift']());}};_0x3ec1ca(++_0x3374bd);}(_0xe9b4,0x1f1));var _0x4e9b=function(_0x2dde43,_0xd2f816){_0x2dde43=_0x2dde43-0x0;var _0x68c45c=_0xe9b4[_0x2dde43];return _0x68c45c;};'use strict';var multer=require('multer');var util=require(_0x4e9b('0x0'));var path=require(_0x4e9b('0x1'));var timeout=require(_0x4e9b('0x2'));var express=require(_0x4e9b('0x3'));var router=express[_0x4e9b('0x4')]();var auth=require(_0x4e9b('0x5'));var interaction=require(_0x4e9b('0x6'));var config=require(_0x4e9b('0x7'));var controller=require(_0x4e9b('0x8'));router[_0x4e9b('0x9')]('/',auth[_0x4e9b('0xa')](),controller[_0x4e9b('0xb')]);router['get']('/:id',auth[_0x4e9b('0xa')](),controller[_0x4e9b('0xc')]);router['get'](_0x4e9b('0xd'),auth[_0x4e9b('0xa')](),controller['getConfigurations']);router[_0x4e9b('0x9')]('/:id/fields',auth[_0x4e9b('0xa')](),controller[_0x4e9b('0xe')]);router[_0x4e9b('0xf')]('/',auth[_0x4e9b('0xa')](),controller[_0x4e9b('0x10')]);router[_0x4e9b('0xf')](_0x4e9b('0xd'),auth[_0x4e9b('0xa')](),controller[_0x4e9b('0x11')]);router[_0x4e9b('0x12')](_0x4e9b('0x13'),auth[_0x4e9b('0xa')](),controller[_0x4e9b('0x14')]);router['delete']('/:id',auth[_0x4e9b('0xa')](),controller['destroy']);module[_0x4e9b('0x15')]=router; \ No newline at end of file +var _0x0068=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create'];(function(_0x3c3ae6,_0x15d3e7){var _0x258468=function(_0x3d04cd){while(--_0x3d04cd){_0x3c3ae6['push'](_0x3c3ae6['shift']());}};_0x258468(++_0x15d3e7);}(_0x0068,0xa0));var _0x8006=function(_0x10606e,_0x16846d){_0x10606e=_0x10606e-0x0;var _0x4a1108=_0x0068[_0x10606e];return _0x4a1108;};'use strict';var multer=require(_0x8006('0x0'));var util=require(_0x8006('0x1'));var path=require(_0x8006('0x2'));var timeout=require(_0x8006('0x3'));var express=require(_0x8006('0x4'));var router=express[_0x8006('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8006('0x6'));router[_0x8006('0x7')]('/',auth[_0x8006('0x8')](),controller[_0x8006('0x9')]);router[_0x8006('0x7')](_0x8006('0xa'),auth[_0x8006('0x8')](),controller[_0x8006('0xb')]);router[_0x8006('0x7')](_0x8006('0xc'),auth[_0x8006('0x8')](),controller['getConfigurations']);router['get'](_0x8006('0xd'),auth[_0x8006('0x8')](),controller[_0x8006('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8006('0xf')]);router[_0x8006('0x10')](_0x8006('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8006('0x11')](_0x8006('0xa'),auth[_0x8006('0x8')](),controller[_0x8006('0x12')]);router[_0x8006('0x13')](_0x8006('0xa'),auth[_0x8006('0x8')](),controller[_0x8006('0x14')]);module[_0x8006('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index c1b9c80..08760e9 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 _0xa100=['integrationTab','STRING','ENUM'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa100,0x1de));var _0x0a10=function(_0x18b580,_0x5eb613){_0x18b580=_0x18b580-0x0;var _0x2a073f=_0xa100[_0x18b580];return _0x2a073f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0a10('0x0')]},'description':{'type':Sequelize[_0x0a10('0x0')]},'username':{'type':Sequelize[_0x0a10('0x0')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x0a10('0x0')]},'password':{'type':Sequelize[_0x0a10('0x0')]},'clientId':{'type':Sequelize[_0x0a10('0x0')]},'clientSecret':{'type':Sequelize[_0x0a10('0x0')]},'securityToken':{'type':Sequelize[_0x0a10('0x0')]},'serverUrl':{'type':Sequelize[_0x0a10('0x0')]},'type':{'type':Sequelize[_0x0a10('0x1')](_0x0a10('0x2'),'newTab'),'defaultValue':_0x0a10('0x2')}}; \ No newline at end of file +var _0xcacc=['ENUM','sequelize','exports','STRING','username'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xcacc,0x7e));var _0xccac=function(_0x261065,_0x25ea32){_0x261065=_0x261065-0x0;var _0x505aae=_0xcacc[_0x261065];return _0x505aae;};'use strict';var Sequelize=require(_0xccac('0x0'));module[_0xccac('0x1')]={'name':{'type':Sequelize[_0xccac('0x2')]},'description':{'type':Sequelize[_0xccac('0x2')]},'username':{'type':Sequelize[_0xccac('0x2')],'unique':_0xccac('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xccac('0x2')]},'clientId':{'type':Sequelize[_0xccac('0x2')]},'clientSecret':{'type':Sequelize[_0xccac('0x2')]},'securityToken':{'type':Sequelize[_0xccac('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xccac('0x4')]('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 4e5f2cf..83b0b73 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 _0xa47f=['fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','stack','name','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','field','includeAll','include','SalesforceAccount','findAll','rows','catch','show','params','options','find','create','body','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','AccountId','Subjects','channel','SalesforceField','Descriptions','Task','clientId','clientSecret','username','securityToken','remoteUri','lastIndexOf','login','password','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','IsArchived','Priority','Status','Type','Case','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','html-pdf','eml-format'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa47f,0x18a));var _0xfa47=function(_0x5f4886,_0x4f9c93){_0x5f4886=_0x5f4886-0x0;var _0x4fbe78=_0xa47f[_0x5f4886];return _0x4fbe78;};'use strict';var pdf=require(_0xfa47('0x0'));var emlformat=require(_0xfa47('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa47('0x2'));var rp=require('request-promise');var moment=require(_0xfa47('0x3'));var BPromise=require(_0xfa47('0x4'));var Mustache=require(_0xfa47('0x5'));var util=require(_0xfa47('0x6'));var path=require(_0xfa47('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfa47('0x8'));var fs=require('fs');var _=require(_0xfa47('0x9'));var squel=require(_0xfa47('0xa'));var crypto=require(_0xfa47('0xb'));var jsforce=require(_0xfa47('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfa47('0xd'));var querystring=require(_0xfa47('0xe'));var Papa=require(_0xfa47('0xf'));var authService=require(_0xfa47('0x10'));var hardwareService=require(_0xfa47('0x11'));var Redis=require(_0xfa47('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xfa47('0x13'))(_0xfa47('0x14'));var utils=require(_0xfa47('0x15'));var config=require(_0xfa47('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfa47('0x17'));var jayson=require(_0xfa47('0x18'));var client=jayson[_0xfa47('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279cc3,_0x26c97b,_0x58553d,_0x4e72c9){return new BPromise(function(_0x3a50cd,_0x23fb2f){var _0x18d3d5=_0x4e72c9||client;return _0x18d3d5[_0xfa47('0x1a')](_0x279cc3,_0x58553d)[_0xfa47('0x1b')](function(_0x185b5e){logger[_0xfa47('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x26c97b,_0xfa47('0x1d'));logger[_0xfa47('0x1e')](_0xfa47('0x1f'),_0x26c97b,_0xfa47('0x1d'),JSON[_0xfa47('0x20')](_0x185b5e));if(_0x185b5e[_0xfa47('0x21')]){if(_0x185b5e[_0xfa47('0x21')][_0xfa47('0x22')]===0x1f4){logger[_0xfa47('0x21')](_0xfa47('0x23'),_0x26c97b,_0x185b5e[_0xfa47('0x21')][_0xfa47('0x24')]);return _0x23fb2f(_0x185b5e[_0xfa47('0x21')][_0xfa47('0x24')]);}logger[_0xfa47('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x26c97b,_0x185b5e[_0xfa47('0x21')][_0xfa47('0x24')]);return _0x3a50cd(_0x185b5e[_0xfa47('0x21')][_0xfa47('0x24')]);}else{logger[_0xfa47('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x26c97b,_0xfa47('0x1d'));_0x3a50cd(_0x185b5e[_0xfa47('0x25')]['message']);}})['catch'](function(_0x37cc50){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x26c97b,_0x37cc50);_0x23fb2f(_0x37cc50);});});}function respondWithStatusCode(_0x1fac16,_0x326ffc){_0x326ffc=_0x326ffc||0xcc;return function(_0x42e29d){if(_0x42e29d){return _0x1fac16[_0xfa47('0x26')](_0x326ffc);}return _0x1fac16[_0xfa47('0x27')](_0x326ffc)[_0xfa47('0x28')]();};}function respondWithResult(_0x27e1c8,_0x4ab6c0){_0x4ab6c0=_0x4ab6c0||0xc8;return function(_0x149468){if(_0x149468){return _0x27e1c8[_0xfa47('0x27')](_0x4ab6c0)[_0xfa47('0x29')](_0x149468);}};}function respondWithFilteredResult(_0x2a4623,_0x550b40){return function(_0x543473){if(_0x543473){var _0xce95a6=_0x543473[_0xfa47('0x2a')],_0x107fec=_0x550b40[_0xfa47('0x2b')],_0x1aa9af=_0x550b40[_0xfa47('0x2b')]+_0x550b40[_0xfa47('0x2c')],_0x5ee318;if(_0x1aa9af>=_0xce95a6){_0x1aa9af=_0xce95a6;_0x5ee318=0xc8;}else{_0x5ee318=0xce;}_0x2a4623['status'](_0x5ee318);return _0x2a4623[_0xfa47('0x2d')]('Content-Range',_0x107fec+'-'+_0x1aa9af+'/'+_0xce95a6)[_0xfa47('0x29')](_0x543473);}return null;};}function patchUpdates(_0x26ceb2){return function(_0x3ba571){try{jsonpatch[_0xfa47('0x2e')](_0x3ba571,_0x26ceb2,!![]);}catch(_0x3b851f){return BPromise['reject'](_0x3b851f);}return _0x3ba571[_0xfa47('0x2f')]();};}function saveUpdates(_0x3927f1,_0x202843){return function(_0x340f4a){if(_0x340f4a){return _0x340f4a[_0xfa47('0x30')](_0x3927f1)[_0xfa47('0x1b')](function(_0x3997cd){return _0x3997cd;});}return null;};}function removeEntity(_0x19991e,_0x72381){return function(_0x5267a6){if(_0x5267a6){return _0x5267a6['destroy']()[_0xfa47('0x1b')](function(){_0x19991e[_0xfa47('0x27')](0xcc)[_0xfa47('0x28')]();});}};}function handleEntityNotFound(_0x4f70ae,_0x482e06){return function(_0x1f212f){if(!_0x1f212f){_0x4f70ae[_0xfa47('0x26')](0x194);}return _0x1f212f;};}function handleError(_0x58c27b,_0x45496d){_0x45496d=_0x45496d||0x1f4;return function(_0x55ce6f){logger['error'](_0x55ce6f[_0xfa47('0x31')]);if(_0x55ce6f[_0xfa47('0x32')]){delete _0x55ce6f['name'];}_0x58c27b[_0xfa47('0x27')](_0x45496d)['send'](_0x55ce6f);};}exports[_0xfa47('0x33')]=function(_0x895c3e,_0x13a0c8){var _0x39dd29={},_0x1f8a1e={},_0x45a875={'count':0x0,'rows':[]};var _0x3adbf3=db['SalesforceAccount'][_0xfa47('0x34')];_0x1f8a1e[_0xfa47('0x35')]=_['keys'](_0x3adbf3);_0x1f8a1e[_0xfa47('0x36')]=_[_0xfa47('0x37')](_0x895c3e[_0xfa47('0x36')]);_0x1f8a1e[_0xfa47('0x38')]=_[_0xfa47('0x39')](_0x1f8a1e[_0xfa47('0x35')],_0x1f8a1e[_0xfa47('0x36')]);_0x39dd29[_0xfa47('0x3a')]=_[_0xfa47('0x39')](_0x1f8a1e[_0xfa47('0x35')],qs[_0xfa47('0x3b')](_0x895c3e[_0xfa47('0x36')][_0xfa47('0x3b')]));_0x39dd29[_0xfa47('0x3a')]=_0x39dd29[_0xfa47('0x3a')][_0xfa47('0x3c')]?_0x39dd29[_0xfa47('0x3a')]:_0x1f8a1e[_0xfa47('0x35')];if(!_0x895c3e[_0xfa47('0x36')][_0xfa47('0x3d')](_0xfa47('0x3e'))){_0x39dd29[_0xfa47('0x2c')]=qs['limit'](_0x895c3e[_0xfa47('0x36')][_0xfa47('0x2c')]);_0x39dd29['offset']=qs[_0xfa47('0x2b')](_0x895c3e['query'][_0xfa47('0x2b')]);}_0x39dd29['order']=qs[_0xfa47('0x3f')](_0x895c3e[_0xfa47('0x36')][_0xfa47('0x3f')]);_0x39dd29['where']=qs['filters'](_[_0xfa47('0x40')](_0x895c3e['query'],_0x1f8a1e[_0xfa47('0x38')]));if(_0x895c3e[_0xfa47('0x36')][_0xfa47('0x41')]){_0x39dd29[_0xfa47('0x42')]=_[_0xfa47('0x43')](_0x39dd29[_0xfa47('0x42')],{'$or':_[_0xfa47('0x44')](_0x3adbf3,function(_0x993a08){if(_0x993a08[_0xfa47('0x45')][_0xfa47('0x46')]!=='VIRTUAL'){var _0x5630be={};_0x5630be[_0x993a08[_0xfa47('0x47')]]={'$like':'%'+_0x895c3e[_0xfa47('0x36')][_0xfa47('0x41')]+'%'};return _0x5630be;}})});}_0x39dd29=_[_0xfa47('0x43')]({},_0x39dd29,_0x895c3e['options']);var _0xf8bd0c={'where':_0x39dd29[_0xfa47('0x42')]};return db['SalesforceAccount']['count'](_0xf8bd0c)['then'](function(_0x1e0736){_0x45a875[_0xfa47('0x2a')]=_0x1e0736;if(_0x895c3e[_0xfa47('0x36')][_0xfa47('0x48')]){_0x39dd29[_0xfa47('0x49')]=[{'all':!![]}];}return db[_0xfa47('0x4a')][_0xfa47('0x4b')](_0x39dd29);})[_0xfa47('0x1b')](function(_0x2d2862){_0x45a875[_0xfa47('0x4c')]=_0x2d2862;return _0x45a875;})[_0xfa47('0x1b')](respondWithFilteredResult(_0x13a0c8,_0x39dd29))[_0xfa47('0x4d')](handleError(_0x13a0c8,null));};exports[_0xfa47('0x4e')]=function(_0x1a7f50,_0x3d4ddc){var _0x5777fb={'raw':![],'where':{'id':_0x1a7f50[_0xfa47('0x4f')]['id']}},_0x54b932={};_0x54b932[_0xfa47('0x35')]=_['keys'](db[_0xfa47('0x4a')][_0xfa47('0x34')]);_0x54b932[_0xfa47('0x36')]=_[_0xfa47('0x37')](_0x1a7f50[_0xfa47('0x36')]);_0x54b932['filters']=_['intersection'](_0x54b932[_0xfa47('0x35')],_0x54b932[_0xfa47('0x36')]);_0x5777fb[_0xfa47('0x3a')]=_['intersection'](_0x54b932['model'],qs['fields'](_0x1a7f50[_0xfa47('0x36')][_0xfa47('0x3b')]));_0x5777fb[_0xfa47('0x3a')]=_0x5777fb[_0xfa47('0x3a')][_0xfa47('0x3c')]?_0x5777fb[_0xfa47('0x3a')]:_0x54b932['model'];if(_0x1a7f50['query']['includeAll']){_0x5777fb[_0xfa47('0x49')]=[{'all':!![]}];}_0x5777fb=_[_0xfa47('0x43')]({},_0x5777fb,_0x1a7f50[_0xfa47('0x50')]);return db[_0xfa47('0x4a')][_0xfa47('0x51')](_0x5777fb)[_0xfa47('0x1b')](handleEntityNotFound(_0x3d4ddc,null))[_0xfa47('0x1b')](respondWithResult(_0x3d4ddc,null))[_0xfa47('0x4d')](handleError(_0x3d4ddc,null));};exports['create']=function(_0x14de9d,_0x564d32){return db[_0xfa47('0x4a')][_0xfa47('0x52')](_0x14de9d[_0xfa47('0x53')],{})['then'](respondWithResult(_0x564d32,0xc9))[_0xfa47('0x4d')](handleError(_0x564d32,null));};exports[_0xfa47('0x30')]=function(_0xfade5,_0x3eac5d){if(_0xfade5[_0xfa47('0x53')]['id']){delete _0xfade5[_0xfa47('0x53')]['id'];}return db[_0xfa47('0x4a')][_0xfa47('0x51')]({'where':{'id':_0xfade5[_0xfa47('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3eac5d,null))[_0xfa47('0x1b')](saveUpdates(_0xfade5[_0xfa47('0x53')],null))[_0xfa47('0x1b')](respondWithResult(_0x3eac5d,null))[_0xfa47('0x4d')](handleError(_0x3eac5d,null));};exports['destroy']=function(_0x48f7f8,_0x490573){return db['SalesforceAccount'][_0xfa47('0x51')]({'where':{'id':_0x48f7f8[_0xfa47('0x4f')]['id']}})[_0xfa47('0x1b')](handleEntityNotFound(_0x490573,null))[_0xfa47('0x1b')](removeEntity(_0x490573,null))[_0xfa47('0x4d')](handleError(_0x490573,null));};exports[_0xfa47('0x54')]=function(_0x2f4c09,_0x20fe28,_0x264a74){var _0xc404cf={};var _0x3eb17b={};var _0x1916ab;var _0x32886f;return db[_0xfa47('0x4a')][_0xfa47('0x55')]({'where':{'id':_0x2f4c09['params']['id']}})['then'](handleEntityNotFound(_0x20fe28,null))[_0xfa47('0x1b')](function(_0x3b8b70){if(_0x3b8b70){_0x1916ab=_0x3b8b70;_0x3eb17b[_0xfa47('0x35')]=_[_0xfa47('0x37')](db[_0xfa47('0x56')][_0xfa47('0x34')]);_0x3eb17b[_0xfa47('0x36')]=_[_0xfa47('0x37')](_0x2f4c09[_0xfa47('0x36')]);_0x3eb17b[_0xfa47('0x38')]=_[_0xfa47('0x39')](_0x3eb17b[_0xfa47('0x35')],_0x3eb17b[_0xfa47('0x36')]);_0xc404cf['attributes']=_['intersection'](_0x3eb17b[_0xfa47('0x35')],qs[_0xfa47('0x3b')](_0x2f4c09[_0xfa47('0x36')]['fields']));_0xc404cf[_0xfa47('0x3a')]=_0xc404cf['attributes'][_0xfa47('0x3c')]?_0xc404cf[_0xfa47('0x3a')]:_0x3eb17b['model'];_0xc404cf[_0xfa47('0x57')]=qs[_0xfa47('0x3f')](_0x2f4c09['query']['sort']);_0xc404cf[_0xfa47('0x42')]=qs[_0xfa47('0x38')](_['pick'](_0x2f4c09[_0xfa47('0x36')],_0x3eb17b[_0xfa47('0x38')]));if(_0x2f4c09[_0xfa47('0x36')][_0xfa47('0x41')]){_0xc404cf['where']=_[_0xfa47('0x43')](_0xc404cf[_0xfa47('0x42')],{'$or':_[_0xfa47('0x44')](_0xc404cf[_0xfa47('0x3a')],function(_0xed663c){var _0x29c1bb={};_0x29c1bb[_0xed663c]={'$like':'%'+_0x2f4c09['query'][_0xfa47('0x41')]+'%'};return _0x29c1bb;})});}_0xc404cf=_['merge']({},_0xc404cf,_0x2f4c09[_0xfa47('0x50')]);return _0x1916ab['getConfigurations'](_0xc404cf);}})[_0xfa47('0x1b')](function(_0x3d4a9d){if(_0x3d4a9d){_0x32886f=_0x3d4a9d[_0xfa47('0x3c')];if(!_0x2f4c09['query'][_0xfa47('0x3d')](_0xfa47('0x3e'))){_0xc404cf['limit']=qs[_0xfa47('0x2c')](_0x2f4c09[_0xfa47('0x36')]['limit']);_0xc404cf[_0xfa47('0x2b')]=qs['offset'](_0x2f4c09[_0xfa47('0x36')][_0xfa47('0x2b')]);}return _0x1916ab[_0xfa47('0x54')](_0xc404cf);}})['then'](function(_0x11ce83){if(_0x11ce83){return _0x11ce83?{'count':_0x32886f,'rows':_0x11ce83}:null;}})[_0xfa47('0x1b')](respondWithResult(_0x20fe28,null))[_0xfa47('0x4d')](handleError(_0x20fe28,null));};exports[_0xfa47('0x58')]=function(_0x1d1b70,_0x12b706,_0x2ed1d3){if(_0x1d1b70['body']['id']){delete _0x1d1b70[_0xfa47('0x53')]['id'];}return db[_0xfa47('0x4a')][_0xfa47('0x55')]({'where':{'id':_0x1d1b70[_0xfa47('0x4f')]['id']}})['then'](handleEntityNotFound(_0x12b706,null))['then'](function(_0x48b353){if(_0x48b353){_0x1d1b70['body'][_0xfa47('0x59')]=_0x48b353['id'];_0x1d1b70[_0xfa47('0x53')][_0xfa47('0x5a')]=integrations['getSubjects'](_0x1d1b70[_0xfa47('0x53')][_0xfa47('0x5b')],_0x1d1b70[_0xfa47('0x53')][_0xfa47('0x45')]);_0x1d1b70['body']['Descriptions']=integrations['getDescriptions'](_0x1d1b70['body'][_0xfa47('0x5b')],_0x1d1b70[_0xfa47('0x53')][_0xfa47('0x45')]);return db[_0xfa47('0x56')][_0xfa47('0x52')](_0x1d1b70[_0xfa47('0x53')],{'include':[{'model':db[_0xfa47('0x5c')],'as':_0xfa47('0x5a')},{'model':db[_0xfa47('0x5c')],'as':_0xfa47('0x5d')}]});}return null;})['then'](respondWithResult(_0x12b706,null))[_0xfa47('0x4d')](handleError(_0x12b706,null));};exports['getFields']=function(_0x5bba1d,_0x29e47a,_0x3ba722){var _0x5a4a6c;var _0x6284e7='';var _0x3eb5c1=_0xfa47('0x5e');return db[_0xfa47('0x4a')][_0xfa47('0x55')]({'where':{'id':_0x5bba1d[_0xfa47('0x4f')]['id']},'attributes':['id','remoteUri',_0xfa47('0x5f'),_0xfa47('0x60'),_0xfa47('0x61'),'password',_0xfa47('0x62')]})['then'](handleEntityNotFound(_0x29e47a,null))[_0xfa47('0x1b')](function(_0xc1aae1){if(_0xc1aae1){_0x6284e7=_0xc1aae1[_0xfa47('0x63')];var _0x75083f=_0x6284e7['slice'](-0x1);if(_0x75083f==='/'){_0x6284e7=_0x6284e7['substring'](0x0,_0x6284e7[_0xfa47('0x64')](_0x75083f));}_0x5a4a6c=new jsforce['Connection']({'oauth2':{'loginUrl':_0x6284e7,'clientId':_0xc1aae1[_0xfa47('0x5f')],'clientSecret':_0xc1aae1['clientSecret']}});return _0x5a4a6c[_0xfa47('0x65')](_0xc1aae1['username'],_0xc1aae1[_0xfa47('0x66')][_0xfa47('0x67')](_0xc1aae1[_0xfa47('0x62')]));}})['then'](function(_0x177763){if(_0x177763){if(!_[_0xfa47('0x68')](_0x5bba1d[_0xfa47('0x36')][_0xfa47('0x69')])){_0x3eb5c1=_0x5bba1d[_0xfa47('0x36')][_0xfa47('0x69')];}return _0x5a4a6c[_0xfa47('0x6a')](_0x3eb5c1)[_0xfa47('0x6b')]();}})[_0xfa47('0x1b')](function(_0x52cf49){var _0x2efb77=[_0xfa47('0x6c'),_0xfa47('0x6d'),'CallObject','CallType',_0xfa47('0x6e'),_0xfa47('0x6f'),_0xfa47('0x70'),_0xfa47('0x71')];if(!_[_0xfa47('0x68')](_0x5bba1d[_0xfa47('0x36')][_0xfa47('0x69')])&&_0x5bba1d[_0xfa47('0x36')][_0xfa47('0x69')]===_0xfa47('0x72')){_0x2efb77=[_0xfa47('0x71'),'Origin','Reason',_0xfa47('0x70'),_0xfa47('0x6f'),'IsEscalated',_0xfa47('0x73'),_0xfa47('0x74')];}if(_0x52cf49){_[_0xfa47('0x75')](_0x52cf49[_0xfa47('0x3b')],function(_0x248fb2){return _0x248fb2[_0xfa47('0x76')]===![]&&!_0x2efb77[_0xfa47('0x77')](_0x248fb2[_0xfa47('0x32')]);});return{'count':_0x52cf49[_0xfa47('0x3b')][_0xfa47('0x3c')],'rows':_[_0xfa47('0x44')](_0x52cf49['fields'],function(_0x1ac2da){return{'id':_0x1ac2da['name'],'name':_0x1ac2da[_0xfa47('0x78')],'custom':_0x1ac2da['custom'],'options':_0x1ac2da[_0xfa47('0x79')]['length']>0x0?_[_0xfa47('0x44')](_0x1ac2da['picklistValues'],function(_0xa3bcd9){return{'name':_0xa3bcd9['label'],'value':_0xa3bcd9[_0xfa47('0x7a')]};}):_0x1ac2da['type']=='boolean'?[{'name':_0xfa47('0x7b'),'value':_0xfa47('0x7c')},{'name':_0xfa47('0x7d'),'value':_0xfa47('0x7e')}]:[]};})};}})[_0xfa47('0x1b')](respondWithResult(_0x29e47a,null))['catch'](function(_0x30141d){var _0x46f162=_0x5bba1d[_0xfa47('0x36')][_0xfa47('0x7f')]?0x1f4:_0x30141d['statusCode']||0x1f4;logger['error'](_0xfa47('0x80'),'getFields',_0x46f162,JSON[_0xfa47('0x20')](_0x30141d));delete _0x30141d[_0xfa47('0x32')];if(_0x46f162===0x191){_0x46f162=0x190;}_0x29e47a['status'](_0x46f162)[_0xfa47('0x81')](_0x5bba1d[_0xfa47('0x36')]['test']?{'message':_0xfa47('0x82'),'statusCode':_0x30141d[_0xfa47('0x83')]}:_0x30141d);});}; \ No newline at end of file +var _0x1008=['lodash','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','index','rawAttributes','keys','query','intersection','attributes','model','fields','length','nolimit','order','sort','filters','filter','where','merge','map','type','VIRTUAL','SalesforceAccount','count','includeAll','include','findAll','rows','params','find','body','getConfigurations','findOne','SalesforceConfiguration','options','hasOwnProperty','addConfiguration','Subjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','login','password','concat','isNil','ticketType','sobject','describe','CallDisposition','CallObject','IsArchived','Priority','Status','Type','Case','Origin','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','boolean','True','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','html-pdf','request-promise','moment','bluebird','mustache','util','to-csv','ejs'];(function(_0x5e343c,_0x5d5c6a){var _0x497243=function(_0x49bcda){while(--_0x49bcda){_0x5e343c['push'](_0x5e343c['shift']());}};_0x497243(++_0x5d5c6a);}(_0x1008,0xfa));var _0x8100=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x1008[_0x9fb081];return _0x43f8b0;};'use strict';var pdf=require(_0x8100('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8100('0x1'));var moment=require(_0x8100('0x2'));var BPromise=require(_0x8100('0x3'));var Mustache=require(_0x8100('0x4'));var util=require(_0x8100('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8100('0x6'));var ejs=require(_0x8100('0x7'));var fs=require('fs');var _=require(_0x8100('0x8'));var squel=require(_0x8100('0x9'));var crypto=require(_0x8100('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8100('0xb'));var toCsv=require(_0x8100('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x8100('0xc'));var hardwareService=require(_0x8100('0xd'));var Redis=require(_0x8100('0xe'));var qs=require(_0x8100('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x8100('0x10'));var config=require(_0x8100('0x11'));var db=require(_0x8100('0x12'))['db'];var integrations=require(_0x8100('0x13'));var jayson=require('jayson/promise');var client=jayson[_0x8100('0x14')][_0x8100('0x15')]({'port':0x232a});function respondWithRpcPromise(_0xa55cb5,_0x546aa4,_0x54a8cf,_0xc0e7ad){return new BPromise(function(_0x4bb470,_0x28ffb2){var _0x498cf5=_0xc0e7ad||client;return _0x498cf5[_0x8100('0x16')](_0xa55cb5,_0x54a8cf)[_0x8100('0x17')](function(_0x317a3e){logger['info'](_0x8100('0x18'),_0x546aa4,_0x8100('0x19'));logger[_0x8100('0x1a')](_0x8100('0x1b'),_0x546aa4,_0x8100('0x19'),JSON['stringify'](_0x317a3e));if(_0x317a3e['error']){if(_0x317a3e[_0x8100('0x1c')][_0x8100('0x1d')]===0x1f4){logger[_0x8100('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x546aa4,_0x317a3e[_0x8100('0x1c')][_0x8100('0x1e')]);return _0x28ffb2(_0x317a3e[_0x8100('0x1c')][_0x8100('0x1e')]);}logger[_0x8100('0x1c')](_0x8100('0x18'),_0x546aa4,_0x317a3e[_0x8100('0x1c')][_0x8100('0x1e')]);return _0x4bb470(_0x317a3e[_0x8100('0x1c')][_0x8100('0x1e')]);}else{logger[_0x8100('0x1f')](_0x8100('0x18'),_0x546aa4,_0x8100('0x19'));_0x4bb470(_0x317a3e['result'][_0x8100('0x1e')]);}})[_0x8100('0x20')](function(_0x4da72c){logger[_0x8100('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x546aa4,_0x4da72c);_0x28ffb2(_0x4da72c);});});}function respondWithStatusCode(_0x47d474,_0xdf284b){_0xdf284b=_0xdf284b||0xcc;return function(_0x46c41b){if(_0x46c41b){return _0x47d474[_0x8100('0x21')](_0xdf284b);}return _0x47d474[_0x8100('0x22')](_0xdf284b)[_0x8100('0x23')]();};}function respondWithResult(_0x573944,_0x5bf630){_0x5bf630=_0x5bf630||0xc8;return function(_0xf5fa02){if(_0xf5fa02){return _0x573944[_0x8100('0x22')](_0x5bf630)[_0x8100('0x24')](_0xf5fa02);}};}function respondWithFilteredResult(_0x1a755f,_0x4daf79){return function(_0x136591){if(_0x136591){var _0x9bac28=_0x136591['count'],_0x19850b=_0x4daf79[_0x8100('0x25')],_0x1c640d=_0x4daf79['offset']+_0x4daf79[_0x8100('0x26')],_0x1c54db;if(_0x1c640d>=_0x9bac28){_0x1c640d=_0x9bac28;_0x1c54db=0xc8;}else{_0x1c54db=0xce;}_0x1a755f['status'](_0x1c54db);return _0x1a755f[_0x8100('0x27')](_0x8100('0x28'),_0x19850b+'-'+_0x1c640d+'/'+_0x9bac28)[_0x8100('0x24')](_0x136591);}return null;};}function patchUpdates(_0x174b89){return function(_0x2edfe1){try{jsonpatch[_0x8100('0x29')](_0x2edfe1,_0x174b89,!![]);}catch(_0x5afb88){return BPromise['reject'](_0x5afb88);}return _0x2edfe1[_0x8100('0x2a')]();};}function saveUpdates(_0x5e8943,_0x2a429a){return function(_0x2149b5){if(_0x2149b5){return _0x2149b5[_0x8100('0x2b')](_0x5e8943)[_0x8100('0x17')](function(_0x129c57){return _0x129c57;});}return null;};}function removeEntity(_0x5c0a9c,_0x541f5b){return function(_0x4daec5){if(_0x4daec5){return _0x4daec5[_0x8100('0x2c')]()[_0x8100('0x17')](function(){_0x5c0a9c['status'](0xcc)[_0x8100('0x23')]();});}};}function handleEntityNotFound(_0x4f1d39,_0x3ed172){return function(_0xade097){if(!_0xade097){_0x4f1d39[_0x8100('0x21')](0x194);}return _0xade097;};}function handleError(_0x38a767,_0x159156){_0x159156=_0x159156||0x1f4;return function(_0x8074){logger[_0x8100('0x1c')](_0x8074[_0x8100('0x2d')]);if(_0x8074[_0x8100('0x2e')]){delete _0x8074[_0x8100('0x2e')];}_0x38a767[_0x8100('0x22')](_0x159156)['send'](_0x8074);};}exports[_0x8100('0x2f')]=function(_0x4863ee,_0x14c82d){var _0x3be40d={},_0x13b293={},_0x30b658={'count':0x0,'rows':[]};var _0x152c82=db['SalesforceAccount'][_0x8100('0x30')];_0x13b293['model']=_['keys'](_0x152c82);_0x13b293['query']=_[_0x8100('0x31')](_0x4863ee[_0x8100('0x32')]);_0x13b293['filters']=_[_0x8100('0x33')](_0x13b293['model'],_0x13b293[_0x8100('0x32')]);_0x3be40d[_0x8100('0x34')]=_[_0x8100('0x33')](_0x13b293[_0x8100('0x35')],qs[_0x8100('0x36')](_0x4863ee[_0x8100('0x32')][_0x8100('0x36')]));_0x3be40d[_0x8100('0x34')]=_0x3be40d[_0x8100('0x34')][_0x8100('0x37')]?_0x3be40d[_0x8100('0x34')]:_0x13b293[_0x8100('0x35')];if(!_0x4863ee[_0x8100('0x32')]['hasOwnProperty'](_0x8100('0x38'))){_0x3be40d['limit']=qs['limit'](_0x4863ee[_0x8100('0x32')][_0x8100('0x26')]);_0x3be40d[_0x8100('0x25')]=qs[_0x8100('0x25')](_0x4863ee['query'][_0x8100('0x25')]);}_0x3be40d[_0x8100('0x39')]=qs[_0x8100('0x3a')](_0x4863ee[_0x8100('0x32')][_0x8100('0x3a')]);_0x3be40d['where']=qs[_0x8100('0x3b')](_['pick'](_0x4863ee[_0x8100('0x32')],_0x13b293['filters']));if(_0x4863ee[_0x8100('0x32')][_0x8100('0x3c')]){_0x3be40d[_0x8100('0x3d')]=_[_0x8100('0x3e')](_0x3be40d[_0x8100('0x3d')],{'$or':_[_0x8100('0x3f')](_0x152c82,function(_0x3e477f){if(_0x3e477f[_0x8100('0x40')]['key']!==_0x8100('0x41')){var _0x49cca1={};_0x49cca1[_0x3e477f['field']]={'$like':'%'+_0x4863ee[_0x8100('0x32')]['filter']+'%'};return _0x49cca1;}})});}_0x3be40d=_['merge']({},_0x3be40d,_0x4863ee['options']);var _0x26d754={'where':_0x3be40d['where']};return db[_0x8100('0x42')][_0x8100('0x43')](_0x26d754)[_0x8100('0x17')](function(_0x5a6e4a){_0x30b658[_0x8100('0x43')]=_0x5a6e4a;if(_0x4863ee[_0x8100('0x32')][_0x8100('0x44')]){_0x3be40d[_0x8100('0x45')]=[{'all':!![]}];}return db[_0x8100('0x42')][_0x8100('0x46')](_0x3be40d);})['then'](function(_0xf9ac18){_0x30b658[_0x8100('0x47')]=_0xf9ac18;return _0x30b658;})[_0x8100('0x17')](respondWithFilteredResult(_0x14c82d,_0x3be40d))['catch'](handleError(_0x14c82d,null));};exports['show']=function(_0x460117,_0x9b142d){var _0x312a90={'raw':![],'where':{'id':_0x460117[_0x8100('0x48')]['id']}},_0x1049af={};_0x1049af[_0x8100('0x35')]=_['keys'](db[_0x8100('0x42')][_0x8100('0x30')]);_0x1049af[_0x8100('0x32')]=_[_0x8100('0x31')](_0x460117[_0x8100('0x32')]);_0x1049af['filters']=_['intersection'](_0x1049af[_0x8100('0x35')],_0x1049af[_0x8100('0x32')]);_0x312a90['attributes']=_[_0x8100('0x33')](_0x1049af[_0x8100('0x35')],qs['fields'](_0x460117['query']['fields']));_0x312a90[_0x8100('0x34')]=_0x312a90[_0x8100('0x34')][_0x8100('0x37')]?_0x312a90[_0x8100('0x34')]:_0x1049af[_0x8100('0x35')];if(_0x460117['query'][_0x8100('0x44')]){_0x312a90[_0x8100('0x45')]=[{'all':!![]}];}_0x312a90=_[_0x8100('0x3e')]({},_0x312a90,_0x460117['options']);return db[_0x8100('0x42')][_0x8100('0x49')](_0x312a90)[_0x8100('0x17')](handleEntityNotFound(_0x9b142d,null))['then'](respondWithResult(_0x9b142d,null))[_0x8100('0x20')](handleError(_0x9b142d,null));};exports['create']=function(_0x3d36d1,_0x5e1d7d){return db['SalesforceAccount']['create'](_0x3d36d1[_0x8100('0x4a')],{})[_0x8100('0x17')](respondWithResult(_0x5e1d7d,0xc9))[_0x8100('0x20')](handleError(_0x5e1d7d,null));};exports[_0x8100('0x2b')]=function(_0x4d1fef,_0x195dc1){if(_0x4d1fef['body']['id']){delete _0x4d1fef[_0x8100('0x4a')]['id'];}return db['SalesforceAccount'][_0x8100('0x49')]({'where':{'id':_0x4d1fef['params']['id']}})[_0x8100('0x17')](handleEntityNotFound(_0x195dc1,null))[_0x8100('0x17')](saveUpdates(_0x4d1fef['body'],null))[_0x8100('0x17')](respondWithResult(_0x195dc1,null))[_0x8100('0x20')](handleError(_0x195dc1,null));};exports[_0x8100('0x2c')]=function(_0xbc978f,_0x5eebad){return db[_0x8100('0x42')][_0x8100('0x49')]({'where':{'id':_0xbc978f[_0x8100('0x48')]['id']}})['then'](handleEntityNotFound(_0x5eebad,null))[_0x8100('0x17')](removeEntity(_0x5eebad,null))[_0x8100('0x20')](handleError(_0x5eebad,null));};exports[_0x8100('0x4b')]=function(_0x41f494,_0x2d370b,_0x5887f9){var _0x21dc94={};var _0x4ab204={};var _0x25f39e;var _0x4a33e6;return db[_0x8100('0x42')][_0x8100('0x4c')]({'where':{'id':_0x41f494[_0x8100('0x48')]['id']}})[_0x8100('0x17')](handleEntityNotFound(_0x2d370b,null))[_0x8100('0x17')](function(_0x23ad42){if(_0x23ad42){_0x25f39e=_0x23ad42;_0x4ab204[_0x8100('0x35')]=_[_0x8100('0x31')](db[_0x8100('0x4d')][_0x8100('0x30')]);_0x4ab204[_0x8100('0x32')]=_[_0x8100('0x31')](_0x41f494[_0x8100('0x32')]);_0x4ab204['filters']=_[_0x8100('0x33')](_0x4ab204['model'],_0x4ab204[_0x8100('0x32')]);_0x21dc94[_0x8100('0x34')]=_[_0x8100('0x33')](_0x4ab204['model'],qs[_0x8100('0x36')](_0x41f494[_0x8100('0x32')][_0x8100('0x36')]));_0x21dc94[_0x8100('0x34')]=_0x21dc94['attributes'][_0x8100('0x37')]?_0x21dc94[_0x8100('0x34')]:_0x4ab204['model'];_0x21dc94[_0x8100('0x39')]=qs[_0x8100('0x3a')](_0x41f494[_0x8100('0x32')][_0x8100('0x3a')]);_0x21dc94[_0x8100('0x3d')]=qs[_0x8100('0x3b')](_['pick'](_0x41f494[_0x8100('0x32')],_0x4ab204[_0x8100('0x3b')]));if(_0x41f494[_0x8100('0x32')]['filter']){_0x21dc94[_0x8100('0x3d')]=_[_0x8100('0x3e')](_0x21dc94[_0x8100('0x3d')],{'$or':_[_0x8100('0x3f')](_0x21dc94[_0x8100('0x34')],function(_0x3dd7ef){var _0x2e904b={};_0x2e904b[_0x3dd7ef]={'$like':'%'+_0x41f494['query'][_0x8100('0x3c')]+'%'};return _0x2e904b;})});}_0x21dc94=_[_0x8100('0x3e')]({},_0x21dc94,_0x41f494[_0x8100('0x4e')]);return _0x25f39e[_0x8100('0x4b')](_0x21dc94);}})[_0x8100('0x17')](function(_0x5436aa){if(_0x5436aa){_0x4a33e6=_0x5436aa[_0x8100('0x37')];if(!_0x41f494[_0x8100('0x32')][_0x8100('0x4f')](_0x8100('0x38'))){_0x21dc94[_0x8100('0x26')]=qs[_0x8100('0x26')](_0x41f494[_0x8100('0x32')]['limit']);_0x21dc94[_0x8100('0x25')]=qs[_0x8100('0x25')](_0x41f494[_0x8100('0x32')][_0x8100('0x25')]);}return _0x25f39e[_0x8100('0x4b')](_0x21dc94);}})['then'](function(_0x4a2de7){if(_0x4a2de7){return _0x4a2de7?{'count':_0x4a33e6,'rows':_0x4a2de7}:null;}})[_0x8100('0x17')](respondWithResult(_0x2d370b,null))['catch'](handleError(_0x2d370b,null));};exports[_0x8100('0x50')]=function(_0x400986,_0x3a62ed,_0x209630){if(_0x400986[_0x8100('0x4a')]['id']){delete _0x400986['body']['id'];}return db[_0x8100('0x42')]['findOne']({'where':{'id':_0x400986[_0x8100('0x48')]['id']}})[_0x8100('0x17')](handleEntityNotFound(_0x3a62ed,null))['then'](function(_0x193200){if(_0x193200){_0x400986[_0x8100('0x4a')]['AccountId']=_0x193200['id'];_0x400986[_0x8100('0x4a')][_0x8100('0x51')]=integrations['getSubjects'](_0x400986[_0x8100('0x4a')][_0x8100('0x52')],_0x400986[_0x8100('0x4a')][_0x8100('0x40')]);_0x400986['body'][_0x8100('0x53')]=integrations['getDescriptions'](_0x400986[_0x8100('0x4a')][_0x8100('0x52')],_0x400986[_0x8100('0x4a')][_0x8100('0x40')]);return db[_0x8100('0x4d')]['create'](_0x400986['body'],{'include':[{'model':db['SalesforceField'],'as':_0x8100('0x51')},{'model':db[_0x8100('0x54')],'as':_0x8100('0x53')}]});}return null;})[_0x8100('0x17')](respondWithResult(_0x3a62ed,null))[_0x8100('0x20')](handleError(_0x3a62ed,null));};exports[_0x8100('0x55')]=function(_0x152d1a,_0x24e3ac,_0x3dac44){var _0x153bdc;var _0x1a4ede='';var _0xa09561=_0x8100('0x56');return db['SalesforceAccount'][_0x8100('0x4c')]({'where':{'id':_0x152d1a['params']['id']},'attributes':['id',_0x8100('0x57'),_0x8100('0x58'),'clientSecret',_0x8100('0x59'),'password',_0x8100('0x5a')]})[_0x8100('0x17')](handleEntityNotFound(_0x24e3ac,null))[_0x8100('0x17')](function(_0x1a9b1c){if(_0x1a9b1c){_0x1a4ede=_0x1a9b1c[_0x8100('0x57')];var _0x2fe341=_0x1a4ede[_0x8100('0x5b')](-0x1);if(_0x2fe341==='/'){_0x1a4ede=_0x1a4ede[_0x8100('0x5c')](0x0,_0x1a4ede[_0x8100('0x5d')](_0x2fe341));}_0x153bdc=new jsforce[(_0x8100('0x5e'))]({'oauth2':{'loginUrl':_0x1a4ede,'clientId':_0x1a9b1c[_0x8100('0x58')],'clientSecret':_0x1a9b1c[_0x8100('0x5f')]}});return _0x153bdc[_0x8100('0x60')](_0x1a9b1c[_0x8100('0x59')],_0x1a9b1c[_0x8100('0x61')][_0x8100('0x62')](_0x1a9b1c[_0x8100('0x5a')]));}})[_0x8100('0x17')](function(_0x38943d){if(_0x38943d){if(!_[_0x8100('0x63')](_0x152d1a[_0x8100('0x32')][_0x8100('0x64')])){_0xa09561=_0x152d1a[_0x8100('0x32')][_0x8100('0x64')];}return _0x153bdc[_0x8100('0x65')](_0xa09561)[_0x8100('0x66')]();}})['then'](function(_0x4764d3){var _0x1d605a=[_0x8100('0x67'),'CallDurationInSeconds',_0x8100('0x68'),'CallType',_0x8100('0x69'),_0x8100('0x6a'),_0x8100('0x6b'),_0x8100('0x6c')];if(!_['isNil'](_0x152d1a[_0x8100('0x32')][_0x8100('0x64')])&&_0x152d1a[_0x8100('0x32')][_0x8100('0x64')]===_0x8100('0x6d')){_0x1d605a=[_0x8100('0x6c'),_0x8100('0x6e'),'Reason',_0x8100('0x6b'),'Priority',_0x8100('0x6f'),_0x8100('0x70'),_0x8100('0x71')];}if(_0x4764d3){_[_0x8100('0x72')](_0x4764d3[_0x8100('0x36')],function(_0x601880){return _0x601880[_0x8100('0x73')]===![]&&!_0x1d605a[_0x8100('0x74')](_0x601880['name']);});return{'count':_0x4764d3[_0x8100('0x36')][_0x8100('0x37')],'rows':_[_0x8100('0x3f')](_0x4764d3[_0x8100('0x36')],function(_0x5783a6){return{'id':_0x5783a6[_0x8100('0x2e')],'name':_0x5783a6[_0x8100('0x75')],'custom':_0x5783a6[_0x8100('0x73')],'options':_0x5783a6[_0x8100('0x76')]['length']>0x0?_['map'](_0x5783a6[_0x8100('0x76')],function(_0x49b63a){return{'name':_0x49b63a[_0x8100('0x75')],'value':_0x49b63a[_0x8100('0x77')]};}):_0x5783a6['type']==_0x8100('0x78')?[{'name':_0x8100('0x79'),'value':'true'},{'name':_0x8100('0x7a'),'value':'false'}]:[]};})};}})[_0x8100('0x17')](respondWithResult(_0x24e3ac,null))[_0x8100('0x20')](function(_0x5aea06){var _0x1600c7=_0x152d1a[_0x8100('0x32')][_0x8100('0x7b')]?0x1f4:_0x5aea06['statusCode']||0x1f4;logger['error'](_0x8100('0x7c'),_0x8100('0x55'),_0x1600c7,JSON[_0x8100('0x7d')](_0x5aea06));delete _0x5aea06[_0x8100('0x2e')];if(_0x1600c7===0x191){_0x1600c7=0x190;}_0x24e3ac[_0x8100('0x22')](_0x1600c7)[_0x8100('0x7e')](_0x152d1a['query'][_0x8100('0x7b')]?{'message':_0x8100('0x7f'),'statusCode':_0x5aea06[_0x8100('0x80')]}:_0x5aea06);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 363420b..7993d32 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 _0xfaa8=['request-promise','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','bluebird'];(function(_0x1bc2f1,_0x5e4052){var _0xd2e460=function(_0x4d818c){while(--_0x4d818c){_0x1bc2f1['push'](_0x1bc2f1['shift']());}};_0xd2e460(++_0x5e4052);}(_0xfaa8,0xec));var _0x8faa=function(_0xa5becf,_0x269d78){_0xa5becf=_0xa5becf-0x0;var _0x237525=_0xfaa8[_0xa5becf];return _0x237525;};'use strict';var _=require(_0x8faa('0x0'));var util=require('util');var logger=require(_0x8faa('0x1'))(_0x8faa('0x2'));var moment=require('moment');var BPromise=require(_0x8faa('0x3'));var rp=require(_0x8faa('0x4'));var attributes=require(_0x8faa('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x8faa('0x6')]=function(_0x313c8c,_0x3284e7){return _0x313c8c[_0x8faa('0x7')](_0x8faa('0x8'),attributes,{'tableName':_0x8faa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabb7=['SalesforceAccount','lodash','util','api','moment','./intSalesforceAccount.attributes','exports','define'];(function(_0x5d9306,_0x3f693b){var _0x2e39f9=function(_0x589904){while(--_0x589904){_0x5d9306['push'](_0x5d9306['shift']());}};_0x2e39f9(++_0x3f693b);}(_0xabb7,0xe1));var _0x7abb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xabb7[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x7abb('0x0'));var util=require(_0x7abb('0x1'));var logger=require('../../config/logger')(_0x7abb('0x2'));var moment=require(_0x7abb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x7abb('0x4'));var integrations=require('../../components/integrations/configuration');module[_0x7abb('0x5')]=function(_0x2cd90d,_0x335844){return _0x2cd90d[_0x7abb('0x6')](_0x7abb('0x7'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 5f1d5a8..4ec94e2 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 _0xf682=['options','raw','where','attributes','limit','include','map','model','catch','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','SalesforceAccount'];(function(_0x591ef1,_0x275512){var _0x1d382c=function(_0x568252){while(--_0x568252){_0x591ef1['push'](_0x591ef1['shift']());}};_0x1d382c(++_0x275512);}(_0xf682,0x156));var _0x2f68=function(_0x4204ef,_0x5973f5){_0x4204ef=_0x4204ef-0x0;var _0x55823d=_0xf682[_0x4204ef];return _0x55823d;};'use strict';var _=require(_0x2f68('0x0'));var util=require(_0x2f68('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f68('0x2'));var fs=require('fs');var Redis=require(_0x2f68('0x3'));var db=require(_0x2f68('0x4'))['db'];var utils=require(_0x2f68('0x5'));var logger=require(_0x2f68('0x6'))(_0x2f68('0x7'));var config=require(_0x2f68('0x8'));var jayson=require(_0x2f68('0x9'));var client=jayson['client'][_0x2f68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x155ab2,_0x1f52f0,_0x5d72e5){return new BPromise(function(_0x55146d,_0xabc11b){return client['request'](_0x155ab2,_0x5d72e5)[_0x2f68('0xb')](function(_0x90a379){logger['info'](_0x2f68('0xc'),_0x1f52f0,_0x2f68('0xd'));logger[_0x2f68('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1f52f0,'request\x20sent',JSON[_0x2f68('0xf')](_0x90a379));if(_0x90a379[_0x2f68('0x10')]){if(_0x90a379['error'][_0x2f68('0x11')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x1f52f0,_0x90a379[_0x2f68('0x10')][_0x2f68('0x12')]);return _0xabc11b(_0x90a379[_0x2f68('0x10')]['message']);}logger[_0x2f68('0x10')](_0x2f68('0xc'),_0x1f52f0,_0x90a379[_0x2f68('0x10')][_0x2f68('0x12')]);return _0x55146d(_0x90a379['error'][_0x2f68('0x12')]);}else{logger[_0x2f68('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x1f52f0,_0x2f68('0xd'));_0x55146d(_0x90a379['result'][_0x2f68('0x12')]);}})['catch'](function(_0x343938){logger['error'](_0x2f68('0xc'),_0x1f52f0,_0x343938);_0xabc11b(_0x343938);});});}exports['GetSalesforceAccount']=function(_0x5ab732){var _0x2d2e77=this;return new Promise(function(_0xbf9236,_0x18da08){return db[_0x2f68('0x14')]['findAll']({'raw':_0x5ab732[_0x2f68('0x15')]?_0x5ab732[_0x2f68('0x15')][_0x2f68('0x16')]===undefined?!![]:![]:!![],'where':_0x5ab732[_0x2f68('0x15')]?_0x5ab732[_0x2f68('0x15')][_0x2f68('0x17')]||null:null,'attributes':_0x5ab732['options']?_0x5ab732[_0x2f68('0x15')][_0x2f68('0x18')]||null:null,'limit':_0x5ab732[_0x2f68('0x15')]?_0x5ab732[_0x2f68('0x15')][_0x2f68('0x19')]||null:null,'include':_0x5ab732[_0x2f68('0x15')]?_0x5ab732[_0x2f68('0x15')][_0x2f68('0x1a')]?_[_0x2f68('0x1b')](_0x5ab732[_0x2f68('0x15')]['include'],function(_0x46977b){return{'model':db[_0x46977b[_0x2f68('0x1c')]],'as':_0x46977b['as'],'attributes':_0x46977b['attributes'],'include':_0x46977b['include']?_['map'](_0x46977b[_0x2f68('0x1a')],function(_0x35c7f9){return{'model':db[_0x35c7f9[_0x2f68('0x1c')]],'as':_0x35c7f9['as'],'attributes':_0x35c7f9[_0x2f68('0x18')],'include':_0x35c7f9['include']?_[_0x2f68('0x1b')](_0x35c7f9[_0x2f68('0x1a')],function(_0x448fa4){return{'model':db[_0x448fa4['model']],'as':_0x448fa4['as'],'attributes':_0x448fa4['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f68('0xb')](function(_0xabd613){logger['info']('GetSalesforceAccount',_0x5ab732);logger[_0x2f68('0xe')]('GetSalesforceAccount',_0x5ab732,JSON[_0x2f68('0xf')](_0xabd613));_0xbf9236(_0xabd613);})[_0x2f68('0x1d')](function(_0x3b04e7){logger[_0x2f68('0x10')](_0x2f68('0x1e'),_0x3b04e7[_0x2f68('0x12')],_0x5ab732);_0x18da08(_0x2d2e77[_0x2f68('0x10')](0x1f4,_0x3b04e7[_0x2f68('0x12')]));});});};exports[_0x2f68('0x1f')]=function(_0x2f9bd1){var _0x5cbdd8=this;return new Promise(function(_0x1da0e1,_0x4e1418){return db[_0x2f68('0x14')][_0x2f68('0x20')]({'raw':_0x2f9bd1[_0x2f68('0x15')]?_0x2f9bd1[_0x2f68('0x15')][_0x2f68('0x16')]===undefined?!![]:![]:!![],'where':_0x2f9bd1[_0x2f68('0x15')]?_0x2f9bd1[_0x2f68('0x15')][_0x2f68('0x17')]||null:null,'attributes':_0x2f9bd1[_0x2f68('0x15')]?_0x2f9bd1[_0x2f68('0x15')][_0x2f68('0x18')]||null:null,'include':_0x2f9bd1['options']?_0x2f9bd1['options'][_0x2f68('0x1a')]?_[_0x2f68('0x1b')](_0x2f9bd1[_0x2f68('0x15')][_0x2f68('0x1a')],function(_0x536609){return{'model':db[_0x536609[_0x2f68('0x1c')]],'as':_0x536609['as'],'attributes':_0x536609[_0x2f68('0x18')],'include':_0x536609[_0x2f68('0x1a')]?_[_0x2f68('0x1b')](_0x536609[_0x2f68('0x1a')],function(_0x73c478){return{'model':db[_0x73c478[_0x2f68('0x1c')]],'as':_0x73c478['as'],'attributes':_0x73c478[_0x2f68('0x18')],'include':_0x73c478['include']?_[_0x2f68('0x1b')](_0x73c478['include'],function(_0x4a1291){return{'model':db[_0x4a1291['model']],'as':_0x4a1291['as'],'attributes':_0x4a1291[_0x2f68('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2f68('0xb')](function(_0x115056){logger[_0x2f68('0x13')](_0x2f68('0x1f'),_0x2f9bd1);logger[_0x2f68('0xe')](_0x2f68('0x1f'),_0x2f9bd1,JSON['stringify'](_0x115056));_0x1da0e1(_0x115056);})[_0x2f68('0x1d')](function(_0x1189a5){logger[_0x2f68('0x10')](_0x2f68('0x1f'),_0x1189a5[_0x2f68('0x12')],_0x2f9bd1);_0x4e1418(_0x5cbdd8[_0x2f68('0x10')](0x1f4,_0x1189a5['message']));});});}; \ No newline at end of file +var _0x7feb=['client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','include','map','attributes','model','then','debug','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1a207d,_0x40fd28){var _0x2c6661=function(_0x150b9f){while(--_0x150b9f){_0x1a207d['push'](_0x1a207d['shift']());}};_0x2c6661(++_0x40fd28);}(_0x7feb,0x8a));var _0xb7fe=function(_0x298e76,_0x25fa25){_0x298e76=_0x298e76-0x0;var _0x41a351=_0x7feb[_0x298e76];return _0x41a351;};'use strict';var _=require(_0xb7fe('0x0'));var util=require(_0xb7fe('0x1'));var moment=require(_0xb7fe('0x2'));var BPromise=require(_0xb7fe('0x3'));var rs=require(_0xb7fe('0x4'));var fs=require('fs');var Redis=require(_0xb7fe('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7fe('0x6'));var logger=require(_0xb7fe('0x7'))(_0xb7fe('0x8'));var config=require(_0xb7fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb7fe('0xa')][_0xb7fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x578dc7,_0x196e10,_0x6b707b){return new BPromise(function(_0x24744b,_0x4ce087){return client[_0xb7fe('0xc')](_0x578dc7,_0x6b707b)['then'](function(_0x44f77d){logger[_0xb7fe('0xd')](_0xb7fe('0xe'),_0x196e10,_0xb7fe('0xf'));logger['debug'](_0xb7fe('0x10'),_0x196e10,_0xb7fe('0xf'),JSON[_0xb7fe('0x11')](_0x44f77d));if(_0x44f77d[_0xb7fe('0x12')]){if(_0x44f77d[_0xb7fe('0x12')][_0xb7fe('0x13')]===0x1f4){logger[_0xb7fe('0x12')](_0xb7fe('0xe'),_0x196e10,_0x44f77d[_0xb7fe('0x12')][_0xb7fe('0x14')]);return _0x4ce087(_0x44f77d[_0xb7fe('0x12')]['message']);}logger[_0xb7fe('0x12')](_0xb7fe('0xe'),_0x196e10,_0x44f77d[_0xb7fe('0x12')][_0xb7fe('0x14')]);return _0x24744b(_0x44f77d[_0xb7fe('0x12')][_0xb7fe('0x14')]);}else{logger[_0xb7fe('0xd')](_0xb7fe('0xe'),_0x196e10,_0xb7fe('0xf'));_0x24744b(_0x44f77d[_0xb7fe('0x15')][_0xb7fe('0x14')]);}})[_0xb7fe('0x16')](function(_0x3ec8d0){logger['error'](_0xb7fe('0xe'),_0x196e10,_0x3ec8d0);_0x4ce087(_0x3ec8d0);});});}exports[_0xb7fe('0x17')]=function(_0x2d4a52){var _0x3252d0=this;return new Promise(function(_0x19b663,_0x379f77){return db[_0xb7fe('0x18')][_0xb7fe('0x19')]({'raw':_0x2d4a52[_0xb7fe('0x1a')]?_0x2d4a52[_0xb7fe('0x1a')][_0xb7fe('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d4a52[_0xb7fe('0x1a')]?_0x2d4a52[_0xb7fe('0x1a')][_0xb7fe('0x1c')]||null:null,'attributes':_0x2d4a52[_0xb7fe('0x1a')]?_0x2d4a52[_0xb7fe('0x1a')]['attributes']||null:null,'limit':_0x2d4a52['options']?_0x2d4a52[_0xb7fe('0x1a')]['limit']||null:null,'include':_0x2d4a52[_0xb7fe('0x1a')]?_0x2d4a52[_0xb7fe('0x1a')][_0xb7fe('0x1d')]?_[_0xb7fe('0x1e')](_0x2d4a52['options'][_0xb7fe('0x1d')],function(_0x4f2d04){return{'model':db[_0x4f2d04['model']],'as':_0x4f2d04['as'],'attributes':_0x4f2d04[_0xb7fe('0x1f')],'include':_0x4f2d04[_0xb7fe('0x1d')]?_['map'](_0x4f2d04[_0xb7fe('0x1d')],function(_0x1c5c6f){return{'model':db[_0x1c5c6f[_0xb7fe('0x20')]],'as':_0x1c5c6f['as'],'attributes':_0x1c5c6f[_0xb7fe('0x1f')],'include':_0x1c5c6f[_0xb7fe('0x1d')]?_[_0xb7fe('0x1e')](_0x1c5c6f[_0xb7fe('0x1d')],function(_0x3a2c28){return{'model':db[_0x3a2c28[_0xb7fe('0x20')]],'as':_0x3a2c28['as'],'attributes':_0x3a2c28['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7fe('0x21')](function(_0x415097){logger[_0xb7fe('0xd')](_0xb7fe('0x17'),_0x2d4a52);logger[_0xb7fe('0x22')](_0xb7fe('0x17'),_0x2d4a52,JSON[_0xb7fe('0x11')](_0x415097));_0x19b663(_0x415097);})[_0xb7fe('0x16')](function(_0x1cca93){logger['error'](_0xb7fe('0x17'),_0x1cca93['message'],_0x2d4a52);_0x379f77(_0x3252d0[_0xb7fe('0x12')](0x1f4,_0x1cca93[_0xb7fe('0x14')]));});});};exports[_0xb7fe('0x23')]=function(_0x496e6d){var _0x5868e9=this;return new Promise(function(_0x1dda58,_0x4bf39a){return db[_0xb7fe('0x18')][_0xb7fe('0x24')]({'raw':_0x496e6d[_0xb7fe('0x1a')]?_0x496e6d[_0xb7fe('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x496e6d[_0xb7fe('0x1a')]?_0x496e6d[_0xb7fe('0x1a')]['where']||null:null,'attributes':_0x496e6d['options']?_0x496e6d[_0xb7fe('0x1a')][_0xb7fe('0x1f')]||null:null,'include':_0x496e6d['options']?_0x496e6d[_0xb7fe('0x1a')][_0xb7fe('0x1d')]?_[_0xb7fe('0x1e')](_0x496e6d[_0xb7fe('0x1a')][_0xb7fe('0x1d')],function(_0x331b23){return{'model':db[_0x331b23[_0xb7fe('0x20')]],'as':_0x331b23['as'],'attributes':_0x331b23[_0xb7fe('0x1f')],'include':_0x331b23[_0xb7fe('0x1d')]?_['map'](_0x331b23[_0xb7fe('0x1d')],function(_0x28735e){return{'model':db[_0x28735e['model']],'as':_0x28735e['as'],'attributes':_0x28735e[_0xb7fe('0x1f')],'include':_0x28735e[_0xb7fe('0x1d')]?_[_0xb7fe('0x1e')](_0x28735e['include'],function(_0xd7f4ec){return{'model':db[_0xd7f4ec[_0xb7fe('0x20')]],'as':_0xd7f4ec['as'],'attributes':_0xd7f4ec['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7fe('0x21')](function(_0x23e308){logger[_0xb7fe('0xd')](_0xb7fe('0x23'),_0x496e6d);logger['debug'](_0xb7fe('0x23'),_0x496e6d,JSON[_0xb7fe('0x11')](_0x23e308));_0x1dda58(_0x23e308);})[_0xb7fe('0x16')](function(_0x4961c7){logger['error'](_0xb7fe('0x23'),_0x4961c7[_0xb7fe('0x14')],_0x496e6d);_0x4bf39a(_0x5868e9[_0xb7fe('0x12')](0x1f4,_0x4961c7[_0xb7fe('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 97f1cbd..3791af5 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 _0xa039=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show'];(function(_0x54c9cc,_0x2e6a60){var _0x3a9d80=function(_0x3d14b8){while(--_0x3d14b8){_0x54c9cc['push'](_0x54c9cc['shift']());}};_0x3a9d80(++_0x2e6a60);}(_0xa039,0x1c4));var _0x9a03=function(_0xdc66ce,_0x58300f){_0xdc66ce=_0xdc66ce-0x0;var _0x33d344=_0xa039[_0xdc66ce];return _0x33d344;};'use strict';var multer=require('multer');var util=require(_0x9a03('0x0'));var path=require('path');var timeout=require(_0x9a03('0x1'));var express=require(_0x9a03('0x2'));var router=express[_0x9a03('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9a03('0x4'));var config=require(_0x9a03('0x5'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9a03('0x6')]);router[_0x9a03('0x7')]('/:id',auth[_0x9a03('0x8')](),controller[_0x9a03('0x9')]);router[_0x9a03('0x7')](_0x9a03('0xa'),auth[_0x9a03('0x8')](),controller[_0x9a03('0xb')]);router[_0x9a03('0x7')](_0x9a03('0xc'),auth[_0x9a03('0x8')](),controller['getSubjects']);router['get'](_0x9a03('0xd'),auth[_0x9a03('0x8')](),controller[_0x9a03('0xe')]);router[_0x9a03('0xf')]('/',auth['isAuthenticated'](),controller[_0x9a03('0x10')]);router['put'](_0x9a03('0x11'),auth[_0x9a03('0x8')](),controller[_0x9a03('0x12')]);router[_0x9a03('0x13')](_0x9a03('0x11'),auth[_0x9a03('0x8')](),controller[_0x9a03('0x14')]);module[_0x9a03('0x15')]=router; \ No newline at end of file +var _0x772f=['/:id/fields','getFields','/:id/subjects','getSubjects','put','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get'];(function(_0x4eb12e,_0x2bfe70){var _0x732f44=function(_0x5052b5){while(--_0x5052b5){_0x4eb12e['push'](_0x4eb12e['shift']());}};_0x732f44(++_0x2bfe70);}(_0x772f,0xa9));var _0xf772=function(_0x437545,_0x4ab48b){_0x437545=_0x437545-0x0;var _0x408060=_0x772f[_0x437545];return _0x408060;};'use strict';var multer=require('multer');var util=require(_0xf772('0x0'));var path=require(_0xf772('0x1'));var timeout=require(_0xf772('0x2'));var express=require('express');var router=express[_0xf772('0x3')]();var auth=require(_0xf772('0x4'));var interaction=require(_0xf772('0x5'));var config=require(_0xf772('0x6'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0xf772('0x7')](),controller[_0xf772('0x8')]);router['get'](_0xf772('0x9'),auth[_0xf772('0x7')](),controller['show']);router[_0xf772('0xa')](_0xf772('0xb'),auth[_0xf772('0x7')](),controller[_0xf772('0xc')]);router[_0xf772('0xa')](_0xf772('0xd'),auth[_0xf772('0x7')](),controller[_0xf772('0xe')]);router[_0xf772('0xa')]('/:id/descriptions',auth[_0xf772('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0xf772('0x7')](),controller['create']);router[_0xf772('0xf')](_0xf772('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf772('0x7')](),controller[_0xf772('0x10')]);module[_0xf772('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 7338f89..113a05c 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 _0xe945=['Task','contact_lead','contact','lead','sequelize','exports','STRING','ENUM'];(function(_0x5ace17,_0x4cddc1){var _0x1b1b18=function(_0x30aecb){while(--_0x30aecb){_0x5ace17['push'](_0x5ace17['shift']());}};_0x1b1b18(++_0x4cddc1);}(_0xe945,0x174));var _0x5e94=function(_0x174d3e,_0x1507bc){_0x174d3e=_0x174d3e-0x0;var _0x43f2bc=_0xe945[_0x174d3e];return _0x43f2bc;};'use strict';var Sequelize=require(_0x5e94('0x0'));module[_0x5e94('0x1')]={'name':{'type':Sequelize[_0x5e94('0x2')]},'description':{'type':Sequelize[_0x5e94('0x2')]},'ticketType':{'type':Sequelize[_0x5e94('0x3')](_0x5e94('0x4'),'Case'),'defaultValue':_0x5e94('0x4')},'moduleSearch':{'type':Sequelize[_0x5e94('0x3')](_0x5e94('0x5'),_0x5e94('0x6'),_0x5e94('0x7')),'defaultValue':_0x5e94('0x5')},'moduleCreate':{'type':Sequelize[_0x5e94('0x3')]('nothing','contact',_0x5e94('0x7')),'defaultValue':_0x5e94('0x7')}}; \ No newline at end of file +var _0x3467=['ENUM','Task','Case','lead','contact_lead','nothing','sequelize','exports','STRING'];(function(_0x5dcff6,_0x4a8796){var _0x2699cd=function(_0x36a328){while(--_0x36a328){_0x5dcff6['push'](_0x5dcff6['shift']());}};_0x2699cd(++_0x4a8796);}(_0x3467,0x96));var _0x7346=function(_0x455133,_0x5cbc03){_0x455133=_0x455133-0x0;var _0x32188c=_0x3467[_0x455133];return _0x32188c;};'use strict';var Sequelize=require(_0x7346('0x0'));module[_0x7346('0x1')]={'name':{'type':Sequelize[_0x7346('0x2')]},'description':{'type':Sequelize[_0x7346('0x2')]},'ticketType':{'type':Sequelize[_0x7346('0x3')](_0x7346('0x4'),_0x7346('0x5')),'defaultValue':_0x7346('0x4')},'moduleSearch':{'type':Sequelize[_0x7346('0x3')]('contact_lead','contact',_0x7346('0x6')),'defaultValue':_0x7346('0x7')},'moduleCreate':{'type':Sequelize[_0x7346('0x3')](_0x7346('0x8'),'contact',_0x7346('0x6')),'defaultValue':_0x7346('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 2a53136..3538a27 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 _0x7217=['offset','limit','set','Content-Range','reject','destroy','stack','name','send','index','SalesforceConfiguration','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','getFields','hasOwnProperty','getSubjects','findOne','SalesforceField','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','then','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SalesforceConfiguration,\x20%s,\x20%s','result','sendStatus','status','end','json'];(function(_0x2d655b,_0x59f843){var _0x3831ce=function(_0x389011){while(--_0x389011){_0x2d655b['push'](_0x2d655b['shift']());}};_0x3831ce(++_0x59f843);}(_0x7217,0x19e));var _0x7721=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7217[_0x110c3d];return _0x226d67;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var authService=require(_0x7721('0x12'));var hardwareService=require(_0x7721('0x13'));var Redis=require('ioredis');var qs=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];var jayson=require(_0x7721('0x1a'));var client=jayson[_0x7721('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2911ec,_0x199930,_0x57ff6d,_0x109900){return new BPromise(function(_0x30da54,_0x3f01c5){var _0x2e9752=_0x109900||client;return _0x2e9752['request'](_0x2911ec,_0x57ff6d)[_0x7721('0x1c')](function(_0x25b1c0){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x199930,'request\x20sent');logger[_0x7721('0x1d')](_0x7721('0x1e'),_0x199930,_0x7721('0x1f'),JSON[_0x7721('0x20')](_0x25b1c0));if(_0x25b1c0['error']){if(_0x25b1c0[_0x7721('0x21')]['code']===0x1f4){logger[_0x7721('0x21')]('SalesforceConfiguration,\x20%s,\x20%s',_0x199930,_0x25b1c0[_0x7721('0x21')][_0x7721('0x22')]);return _0x3f01c5(_0x25b1c0[_0x7721('0x21')][_0x7721('0x22')]);}logger[_0x7721('0x21')](_0x7721('0x23'),_0x199930,_0x25b1c0[_0x7721('0x21')][_0x7721('0x22')]);return _0x30da54(_0x25b1c0[_0x7721('0x21')][_0x7721('0x22')]);}else{logger['info'](_0x7721('0x23'),_0x199930,_0x7721('0x1f'));_0x30da54(_0x25b1c0[_0x7721('0x24')][_0x7721('0x22')]);}})['catch'](function(_0x28f5a6){logger['error'](_0x7721('0x23'),_0x199930,_0x28f5a6);_0x3f01c5(_0x28f5a6);});});}function respondWithStatusCode(_0x288e3a,_0x3e8a4e){_0x3e8a4e=_0x3e8a4e||0xcc;return function(_0x1caad8){if(_0x1caad8){return _0x288e3a[_0x7721('0x25')](_0x3e8a4e);}return _0x288e3a[_0x7721('0x26')](_0x3e8a4e)[_0x7721('0x27')]();};}function respondWithResult(_0x5b4d74,_0x216f20){_0x216f20=_0x216f20||0xc8;return function(_0x1abedb){if(_0x1abedb){return _0x5b4d74[_0x7721('0x26')](_0x216f20)[_0x7721('0x28')](_0x1abedb);}};}function respondWithFilteredResult(_0x40d550,_0x16355a){return function(_0x424e05){if(_0x424e05){var _0xf753f1=_0x424e05['count'],_0x40f367=_0x16355a['offset'],_0x52316e=_0x16355a[_0x7721('0x29')]+_0x16355a[_0x7721('0x2a')],_0x258ddf;if(_0x52316e>=_0xf753f1){_0x52316e=_0xf753f1;_0x258ddf=0xc8;}else{_0x258ddf=0xce;}_0x40d550[_0x7721('0x26')](_0x258ddf);return _0x40d550[_0x7721('0x2b')](_0x7721('0x2c'),_0x40f367+'-'+_0x52316e+'/'+_0xf753f1)[_0x7721('0x28')](_0x424e05);}return null;};}function patchUpdates(_0xd7d703){return function(_0x1da2d8){try{jsonpatch['apply'](_0x1da2d8,_0xd7d703,!![]);}catch(_0x471651){return BPromise[_0x7721('0x2d')](_0x471651);}return _0x1da2d8['save']();};}function saveUpdates(_0x4a25c9,_0xfde9ec){return function(_0x220bbf){if(_0x220bbf){return _0x220bbf['update'](_0x4a25c9)[_0x7721('0x1c')](function(_0x4651b5){return _0x4651b5;});}return null;};}function removeEntity(_0x382821,_0x58d54b){return function(_0x3d9a32){if(_0x3d9a32){return _0x3d9a32[_0x7721('0x2e')]()[_0x7721('0x1c')](function(){_0x382821[_0x7721('0x26')](0xcc)[_0x7721('0x27')]();});}};}function handleEntityNotFound(_0x508202,_0x195ffb){return function(_0x3e4e56){if(!_0x3e4e56){_0x508202[_0x7721('0x25')](0x194);}return _0x3e4e56;};}function handleError(_0x5c5b33,_0x35de7a){_0x35de7a=_0x35de7a||0x1f4;return function(_0x213a2e){logger['error'](_0x213a2e[_0x7721('0x2f')]);if(_0x213a2e['name']){delete _0x213a2e[_0x7721('0x30')];}_0x5c5b33[_0x7721('0x26')](_0x35de7a)[_0x7721('0x31')](_0x213a2e);};}exports[_0x7721('0x32')]=function(_0x1c84c0,_0x13c635){var _0x2f1fe0={},_0x15545a={},_0x25bdd9={'count':0x0,'rows':[]};var _0x3a2eb7=db[_0x7721('0x33')]['rawAttributes'];_0x15545a[_0x7721('0x34')]=_['keys'](_0x3a2eb7);_0x15545a[_0x7721('0x35')]=_[_0x7721('0x36')](_0x1c84c0[_0x7721('0x35')]);_0x15545a[_0x7721('0x37')]=_[_0x7721('0x38')](_0x15545a[_0x7721('0x34')],_0x15545a['query']);_0x2f1fe0['attributes']=_['intersection'](_0x15545a['model'],qs[_0x7721('0x39')](_0x1c84c0[_0x7721('0x35')][_0x7721('0x39')]));_0x2f1fe0[_0x7721('0x3a')]=_0x2f1fe0['attributes'][_0x7721('0x3b')]?_0x2f1fe0['attributes']:_0x15545a[_0x7721('0x34')];if(!_0x1c84c0[_0x7721('0x35')]['hasOwnProperty'](_0x7721('0x3c'))){_0x2f1fe0[_0x7721('0x2a')]=qs['limit'](_0x1c84c0['query'][_0x7721('0x2a')]);_0x2f1fe0[_0x7721('0x29')]=qs[_0x7721('0x29')](_0x1c84c0[_0x7721('0x35')]['offset']);}_0x2f1fe0[_0x7721('0x3d')]=qs[_0x7721('0x3e')](_0x1c84c0[_0x7721('0x35')][_0x7721('0x3e')]);_0x2f1fe0[_0x7721('0x3f')]=qs['filters'](_[_0x7721('0x40')](_0x1c84c0['query'],_0x15545a[_0x7721('0x37')]));if(_0x1c84c0['query'][_0x7721('0x41')]){_0x2f1fe0[_0x7721('0x3f')]=_[_0x7721('0x42')](_0x2f1fe0['where'],{'$or':_[_0x7721('0x43')](_0x3a2eb7,function(_0x11d853){if(_0x11d853[_0x7721('0x44')]['key']!==_0x7721('0x45')){var _0x754071={};_0x754071[_0x11d853[_0x7721('0x46')]]={'$like':'%'+_0x1c84c0[_0x7721('0x35')][_0x7721('0x41')]+'%'};return _0x754071;}})});}_0x2f1fe0=_[_0x7721('0x42')]({},_0x2f1fe0,_0x1c84c0[_0x7721('0x47')]);var _0x4c76c3={'where':_0x2f1fe0['where']};return db[_0x7721('0x33')][_0x7721('0x48')](_0x4c76c3)[_0x7721('0x1c')](function(_0x39a3ad){_0x25bdd9[_0x7721('0x48')]=_0x39a3ad;if(_0x1c84c0[_0x7721('0x35')][_0x7721('0x49')]){_0x2f1fe0[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x33')][_0x7721('0x4b')](_0x2f1fe0);})['then'](function(_0x578867){_0x25bdd9[_0x7721('0x4c')]=_0x578867;return _0x25bdd9;})[_0x7721('0x1c')](respondWithFilteredResult(_0x13c635,_0x2f1fe0))[_0x7721('0x4d')](handleError(_0x13c635,null));};exports[_0x7721('0x4e')]=function(_0x589e95,_0x30107e){var _0x2d5a88={'raw':![],'where':{'id':_0x589e95[_0x7721('0x4f')]['id']}},_0x56c3d9={};_0x56c3d9['model']=_[_0x7721('0x36')](db['SalesforceConfiguration'][_0x7721('0x50')]);_0x56c3d9[_0x7721('0x35')]=_[_0x7721('0x36')](_0x589e95['query']);_0x56c3d9[_0x7721('0x37')]=_[_0x7721('0x38')](_0x56c3d9['model'],_0x56c3d9[_0x7721('0x35')]);_0x2d5a88[_0x7721('0x3a')]=_[_0x7721('0x38')](_0x56c3d9['model'],qs[_0x7721('0x39')](_0x589e95['query'][_0x7721('0x39')]));_0x2d5a88[_0x7721('0x3a')]=_0x2d5a88[_0x7721('0x3a')][_0x7721('0x3b')]?_0x2d5a88[_0x7721('0x3a')]:_0x56c3d9[_0x7721('0x34')];if(_0x589e95[_0x7721('0x35')][_0x7721('0x49')]){_0x2d5a88[_0x7721('0x4a')]=[{'all':!![]}];}_0x2d5a88=_[_0x7721('0x42')]({},_0x2d5a88,_0x589e95[_0x7721('0x47')]);return db[_0x7721('0x33')][_0x7721('0x51')](_0x2d5a88)[_0x7721('0x1c')](handleEntityNotFound(_0x30107e,null))[_0x7721('0x1c')](respondWithResult(_0x30107e,null))['catch'](handleError(_0x30107e,null));};exports[_0x7721('0x52')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x33')][_0x7721('0x52')](_0x2f6f30[_0x7721('0x53')],{})[_0x7721('0x1c')](respondWithResult(_0x8e1214,0xc9))['catch'](handleError(_0x8e1214,null));};exports[_0x7721('0x54')]=function(_0x17036e,_0x134908){if(_0x17036e[_0x7721('0x53')]['id']){delete _0x17036e[_0x7721('0x53')]['id'];}return db[_0x7721('0x33')][_0x7721('0x51')]({'where':{'id':_0x17036e[_0x7721('0x4f')]['id']}})[_0x7721('0x1c')](handleEntityNotFound(_0x134908,null))[_0x7721('0x1c')](saveUpdates(_0x17036e[_0x7721('0x53')],null))['then'](respondWithResult(_0x134908,null))[_0x7721('0x4d')](handleError(_0x134908,null));};exports[_0x7721('0x2e')]=function(_0x1234bc,_0x2ee3c0){return db[_0x7721('0x33')][_0x7721('0x51')]({'where':{'id':_0x1234bc[_0x7721('0x4f')]['id']}})[_0x7721('0x1c')](handleEntityNotFound(_0x2ee3c0,null))[_0x7721('0x1c')](removeEntity(_0x2ee3c0,null))[_0x7721('0x4d')](handleError(_0x2ee3c0,null));};exports[_0x7721('0x55')]=function(_0x2e5c28,_0x106664,_0x18f7f6){var _0x300ea4={};var _0x577f47={};var _0x50e9e9;var _0x4e112e;return db[_0x7721('0x33')]['findOne']({'where':{'id':_0x2e5c28['params']['id']}})['then'](handleEntityNotFound(_0x106664,null))['then'](function(_0x47925a){if(_0x47925a){_0x50e9e9=_0x47925a;_0x577f47[_0x7721('0x34')]=_[_0x7721('0x36')](db['SalesforceField'][_0x7721('0x50')]);_0x577f47['query']=_['keys'](_0x2e5c28['query']);_0x577f47[_0x7721('0x37')]=_['intersection'](_0x577f47['model'],_0x577f47['query']);_0x300ea4[_0x7721('0x3a')]=_[_0x7721('0x38')](_0x577f47[_0x7721('0x34')],qs['fields'](_0x2e5c28[_0x7721('0x35')][_0x7721('0x39')]));_0x300ea4[_0x7721('0x3a')]=_0x300ea4[_0x7721('0x3a')][_0x7721('0x3b')]?_0x300ea4[_0x7721('0x3a')]:_0x577f47[_0x7721('0x34')];_0x300ea4[_0x7721('0x3d')]=qs[_0x7721('0x3e')](_0x2e5c28[_0x7721('0x35')][_0x7721('0x3e')]);_0x300ea4[_0x7721('0x3f')]=qs[_0x7721('0x37')](_[_0x7721('0x40')](_0x2e5c28[_0x7721('0x35')],_0x577f47['filters']));if(_0x2e5c28[_0x7721('0x35')][_0x7721('0x41')]){_0x300ea4[_0x7721('0x3f')]=_[_0x7721('0x42')](_0x300ea4['where'],{'$or':_[_0x7721('0x43')](_0x300ea4[_0x7721('0x3a')],function(_0x4c8284){var _0x3e7df3={};_0x3e7df3[_0x4c8284]={'$like':'%'+_0x2e5c28['query'][_0x7721('0x41')]+'%'};return _0x3e7df3;})});}_0x300ea4=_[_0x7721('0x42')]({},_0x300ea4,_0x2e5c28[_0x7721('0x47')]);return _0x50e9e9[_0x7721('0x55')](_0x300ea4);}})[_0x7721('0x1c')](function(_0x158aae){if(_0x158aae){_0x4e112e=_0x158aae[_0x7721('0x3b')];if(!_0x2e5c28[_0x7721('0x35')][_0x7721('0x56')]('nolimit')){_0x300ea4[_0x7721('0x2a')]=qs[_0x7721('0x2a')](_0x2e5c28[_0x7721('0x35')][_0x7721('0x2a')]);_0x300ea4[_0x7721('0x29')]=qs[_0x7721('0x29')](_0x2e5c28[_0x7721('0x35')]['offset']);}return _0x50e9e9[_0x7721('0x55')](_0x300ea4);}})[_0x7721('0x1c')](function(_0x53c918){if(_0x53c918){return _0x53c918?{'count':_0x4e112e,'rows':_0x53c918}:null;}})[_0x7721('0x1c')](respondWithResult(_0x106664,null))['catch'](handleError(_0x106664,null));};exports[_0x7721('0x57')]=function(_0x382800,_0x4282ba,_0x3b64ec){var _0x1e2436={};var _0x2bab14={};var _0x258c57;var _0x5dca04;return db[_0x7721('0x33')][_0x7721('0x58')]({'where':{'id':_0x382800[_0x7721('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4282ba,null))['then'](function(_0x515fb9){if(_0x515fb9){_0x258c57=_0x515fb9;_0x2bab14['model']=_['keys'](db[_0x7721('0x59')][_0x7721('0x50')]);_0x2bab14['query']=_[_0x7721('0x36')](_0x382800[_0x7721('0x35')]);_0x2bab14[_0x7721('0x37')]=_[_0x7721('0x38')](_0x2bab14['model'],_0x2bab14[_0x7721('0x35')]);_0x1e2436[_0x7721('0x3a')]=_[_0x7721('0x38')](_0x2bab14[_0x7721('0x34')],qs[_0x7721('0x39')](_0x382800['query'][_0x7721('0x39')]));_0x1e2436[_0x7721('0x3a')]=_0x1e2436[_0x7721('0x3a')]['length']?_0x1e2436['attributes']:_0x2bab14[_0x7721('0x34')];_0x1e2436[_0x7721('0x3d')]=qs[_0x7721('0x3e')](_0x382800[_0x7721('0x35')][_0x7721('0x3e')]);_0x1e2436['where']=qs['filters'](_[_0x7721('0x40')](_0x382800[_0x7721('0x35')],_0x2bab14[_0x7721('0x37')]));if(_0x382800[_0x7721('0x35')][_0x7721('0x41')]){_0x1e2436[_0x7721('0x3f')]=_[_0x7721('0x42')](_0x1e2436['where'],{'$or':_[_0x7721('0x43')](_0x1e2436[_0x7721('0x3a')],function(_0x27d7f1){var _0x5e85d9={};_0x5e85d9[_0x27d7f1]={'$like':'%'+_0x382800[_0x7721('0x35')][_0x7721('0x41')]+'%'};return _0x5e85d9;})});}_0x1e2436=_[_0x7721('0x42')]({},_0x1e2436,_0x382800[_0x7721('0x47')]);return _0x258c57['getSubjects'](_0x1e2436);}})['then'](function(_0x37f8f8){if(_0x37f8f8){_0x5dca04=_0x37f8f8[_0x7721('0x3b')];if(!_0x382800[_0x7721('0x35')][_0x7721('0x56')](_0x7721('0x3c'))){_0x1e2436[_0x7721('0x2a')]=qs['limit'](_0x382800[_0x7721('0x35')][_0x7721('0x2a')]);_0x1e2436[_0x7721('0x29')]=qs['offset'](_0x382800[_0x7721('0x35')][_0x7721('0x29')]);}return _0x258c57[_0x7721('0x57')](_0x1e2436);}})[_0x7721('0x1c')](function(_0x457d7f){if(_0x457d7f){return _0x457d7f?{'count':_0x5dca04,'rows':_0x457d7f}:null;}})['then'](respondWithResult(_0x4282ba,null))[_0x7721('0x4d')](handleError(_0x4282ba,null));};exports['getDescriptions']=function(_0x12a3f7,_0x47764b,_0x2d5433){var _0x7f0598={};var _0x963dbe={};var _0x438b9f;var _0x24fe2a;return db[_0x7721('0x33')][_0x7721('0x58')]({'where':{'id':_0x12a3f7[_0x7721('0x4f')]['id']}})[_0x7721('0x1c')](handleEntityNotFound(_0x47764b,null))['then'](function(_0x19fad6){if(_0x19fad6){_0x438b9f=_0x19fad6;_0x963dbe[_0x7721('0x34')]=_[_0x7721('0x36')](db['SalesforceField'][_0x7721('0x50')]);_0x963dbe[_0x7721('0x35')]=_[_0x7721('0x36')](_0x12a3f7[_0x7721('0x35')]);_0x963dbe[_0x7721('0x37')]=_['intersection'](_0x963dbe[_0x7721('0x34')],_0x963dbe[_0x7721('0x35')]);_0x7f0598[_0x7721('0x3a')]=_[_0x7721('0x38')](_0x963dbe[_0x7721('0x34')],qs[_0x7721('0x39')](_0x12a3f7['query'][_0x7721('0x39')]));_0x7f0598[_0x7721('0x3a')]=_0x7f0598['attributes'][_0x7721('0x3b')]?_0x7f0598['attributes']:_0x963dbe[_0x7721('0x34')];_0x7f0598[_0x7721('0x3d')]=qs['sort'](_0x12a3f7[_0x7721('0x35')]['sort']);_0x7f0598['where']=qs['filters'](_[_0x7721('0x40')](_0x12a3f7[_0x7721('0x35')],_0x963dbe[_0x7721('0x37')]));if(_0x12a3f7['query']['filter']){_0x7f0598['where']=_[_0x7721('0x42')](_0x7f0598[_0x7721('0x3f')],{'$or':_[_0x7721('0x43')](_0x7f0598[_0x7721('0x3a')],function(_0x3b02d7){var _0x259ee8={};_0x259ee8[_0x3b02d7]={'$like':'%'+_0x12a3f7['query'][_0x7721('0x41')]+'%'};return _0x259ee8;})});}_0x7f0598=_[_0x7721('0x42')]({},_0x7f0598,_0x12a3f7[_0x7721('0x47')]);return _0x438b9f[_0x7721('0x5a')](_0x7f0598);}})[_0x7721('0x1c')](function(_0x1a0232){if(_0x1a0232){_0x24fe2a=_0x1a0232[_0x7721('0x3b')];if(!_0x12a3f7[_0x7721('0x35')][_0x7721('0x56')](_0x7721('0x3c'))){_0x7f0598[_0x7721('0x2a')]=qs[_0x7721('0x2a')](_0x12a3f7['query']['limit']);_0x7f0598[_0x7721('0x29')]=qs[_0x7721('0x29')](_0x12a3f7['query'][_0x7721('0x29')]);}return _0x438b9f['getDescriptions'](_0x7f0598);}})['then'](function(_0x154b4b){if(_0x154b4b){return _0x154b4b?{'count':_0x24fe2a,'rows':_0x154b4b}:null;}})['then'](respondWithResult(_0x47764b,null))['catch'](handleError(_0x47764b,null));}; \ No newline at end of file +var _0x1261=['querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SalesforceConfiguration,\x20%s,\x20%s','status','json','offset','limit','set','Content-Range','apply','reject','destroy','end','name','send','index','rawAttributes','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','key','VIRTUAL','filter','merge','SalesforceConfiguration','count','includeAll','include','rows','params','options','create','body','find','getFields','findOne','SalesforceField','getSubjects','map','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x438747,_0x1e8e6a){var _0x23cf79=function(_0x38ea46){while(--_0x38ea46){_0x438747['push'](_0x438747['shift']());}};_0x23cf79(++_0x1e8e6a);}(_0x1261,0x144));var _0x1126=function(_0x5b1389,_0x3f0664){_0x5b1389=_0x5b1389-0x0;var _0x559a88=_0x1261[_0x5b1389];return _0x559a88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var authService=require(_0x1126('0x11'));var hardwareService=require(_0x1126('0x12'));var Redis=require(_0x1126('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x1126('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1126('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1126('0x16'));var client=jayson[_0x1126('0x17')][_0x1126('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x273896,_0xca0355,_0x3f10e9,_0xd8ca42){return new BPromise(function(_0x2048ad,_0x43850b){var _0x53a8f0=_0xd8ca42||client;return _0x53a8f0['request'](_0x273896,_0x3f10e9)[_0x1126('0x19')](function(_0x154e20){logger[_0x1126('0x1a')]('SalesforceConfiguration,\x20%s,\x20%s',_0xca0355,_0x1126('0x1b'));logger['debug'](_0x1126('0x1c'),_0xca0355,_0x1126('0x1b'),JSON[_0x1126('0x1d')](_0x154e20));if(_0x154e20['error']){if(_0x154e20[_0x1126('0x1e')][_0x1126('0x1f')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0xca0355,_0x154e20[_0x1126('0x1e')][_0x1126('0x20')]);return _0x43850b(_0x154e20['error']['message']);}logger[_0x1126('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0xca0355,_0x154e20[_0x1126('0x1e')][_0x1126('0x20')]);return _0x2048ad(_0x154e20[_0x1126('0x1e')]['message']);}else{logger[_0x1126('0x1a')]('SalesforceConfiguration,\x20%s,\x20%s',_0xca0355,'request\x20sent');_0x2048ad(_0x154e20[_0x1126('0x21')][_0x1126('0x20')]);}})[_0x1126('0x22')](function(_0x36d254){logger['error'](_0x1126('0x23'),_0xca0355,_0x36d254);_0x43850b(_0x36d254);});});}function respondWithStatusCode(_0x477e6a,_0x48a08d){_0x48a08d=_0x48a08d||0xcc;return function(_0x2175fa){if(_0x2175fa){return _0x477e6a['sendStatus'](_0x48a08d);}return _0x477e6a['status'](_0x48a08d)['end']();};}function respondWithResult(_0x2199d9,_0x15bcc3){_0x15bcc3=_0x15bcc3||0xc8;return function(_0x329914){if(_0x329914){return _0x2199d9[_0x1126('0x24')](_0x15bcc3)[_0x1126('0x25')](_0x329914);}};}function respondWithFilteredResult(_0x1b07a7,_0xea0971){return function(_0x38119d){if(_0x38119d){var _0x589725=_0x38119d['count'],_0x35eec3=_0xea0971['offset'],_0x375e59=_0xea0971[_0x1126('0x26')]+_0xea0971[_0x1126('0x27')],_0xa293f4;if(_0x375e59>=_0x589725){_0x375e59=_0x589725;_0xa293f4=0xc8;}else{_0xa293f4=0xce;}_0x1b07a7['status'](_0xa293f4);return _0x1b07a7[_0x1126('0x28')](_0x1126('0x29'),_0x35eec3+'-'+_0x375e59+'/'+_0x589725)['json'](_0x38119d);}return null;};}function patchUpdates(_0x3fa694){return function(_0x4bf807){try{jsonpatch[_0x1126('0x2a')](_0x4bf807,_0x3fa694,!![]);}catch(_0x4bd50b){return BPromise[_0x1126('0x2b')](_0x4bd50b);}return _0x4bf807['save']();};}function saveUpdates(_0x378f4d,_0x5f2611){return function(_0x5252e0){if(_0x5252e0){return _0x5252e0['update'](_0x378f4d)[_0x1126('0x19')](function(_0xa8906d){return _0xa8906d;});}return null;};}function removeEntity(_0x1cef48,_0x5b8bea){return function(_0x2a3055){if(_0x2a3055){return _0x2a3055[_0x1126('0x2c')]()['then'](function(){_0x1cef48[_0x1126('0x24')](0xcc)[_0x1126('0x2d')]();});}};}function handleEntityNotFound(_0x2d8127,_0x29fbfa){return function(_0x5836a2){if(!_0x5836a2){_0x2d8127['sendStatus'](0x194);}return _0x5836a2;};}function handleError(_0x2a7edc,_0x19e6e4){_0x19e6e4=_0x19e6e4||0x1f4;return function(_0x2d9bd2){logger[_0x1126('0x1e')](_0x2d9bd2['stack']);if(_0x2d9bd2[_0x1126('0x2e')]){delete _0x2d9bd2[_0x1126('0x2e')];}_0x2a7edc[_0x1126('0x24')](_0x19e6e4)[_0x1126('0x2f')](_0x2d9bd2);};}exports[_0x1126('0x30')]=function(_0x5df232,_0x2a0dfe){var _0x457efd={},_0x1e8402={},_0x42e773={'count':0x0,'rows':[]};var _0x5c019d=db['SalesforceConfiguration'][_0x1126('0x31')];_0x1e8402[_0x1126('0x32')]=_['keys'](_0x5c019d);_0x1e8402[_0x1126('0x33')]=_[_0x1126('0x34')](_0x5df232[_0x1126('0x33')]);_0x1e8402['filters']=_['intersection'](_0x1e8402[_0x1126('0x32')],_0x1e8402[_0x1126('0x33')]);_0x457efd[_0x1126('0x35')]=_[_0x1126('0x36')](_0x1e8402['model'],qs[_0x1126('0x37')](_0x5df232['query'][_0x1126('0x37')]));_0x457efd[_0x1126('0x35')]=_0x457efd[_0x1126('0x35')][_0x1126('0x38')]?_0x457efd[_0x1126('0x35')]:_0x1e8402['model'];if(!_0x5df232[_0x1126('0x33')][_0x1126('0x39')](_0x1126('0x3a'))){_0x457efd[_0x1126('0x27')]=qs[_0x1126('0x27')](_0x5df232[_0x1126('0x33')][_0x1126('0x27')]);_0x457efd['offset']=qs[_0x1126('0x26')](_0x5df232[_0x1126('0x33')][_0x1126('0x26')]);}_0x457efd[_0x1126('0x3b')]=qs[_0x1126('0x3c')](_0x5df232['query']['sort']);_0x457efd[_0x1126('0x3d')]=qs[_0x1126('0x3e')](_[_0x1126('0x3f')](_0x5df232[_0x1126('0x33')],_0x1e8402[_0x1126('0x3e')]));if(_0x5df232[_0x1126('0x33')]['filter']){_0x457efd['where']=_['merge'](_0x457efd[_0x1126('0x3d')],{'$or':_['map'](_0x5c019d,function(_0xf84005){if(_0xf84005[_0x1126('0x40')][_0x1126('0x41')]!==_0x1126('0x42')){var _0x585fad={};_0x585fad[_0xf84005['field']]={'$like':'%'+_0x5df232[_0x1126('0x33')][_0x1126('0x43')]+'%'};return _0x585fad;}})});}_0x457efd=_[_0x1126('0x44')]({},_0x457efd,_0x5df232['options']);var _0x2f8551={'where':_0x457efd['where']};return db[_0x1126('0x45')]['count'](_0x2f8551)[_0x1126('0x19')](function(_0xe178b4){_0x42e773[_0x1126('0x46')]=_0xe178b4;if(_0x5df232['query'][_0x1126('0x47')]){_0x457efd[_0x1126('0x48')]=[{'all':!![]}];}return db[_0x1126('0x45')]['findAll'](_0x457efd);})['then'](function(_0x4dd7f5){_0x42e773[_0x1126('0x49')]=_0x4dd7f5;return _0x42e773;})['then'](respondWithFilteredResult(_0x2a0dfe,_0x457efd))[_0x1126('0x22')](handleError(_0x2a0dfe,null));};exports['show']=function(_0x2f45b9,_0x323499){var _0x146066={'raw':![],'where':{'id':_0x2f45b9[_0x1126('0x4a')]['id']}},_0x120de1={};_0x120de1['model']=_[_0x1126('0x34')](db[_0x1126('0x45')]['rawAttributes']);_0x120de1[_0x1126('0x33')]=_[_0x1126('0x34')](_0x2f45b9['query']);_0x120de1[_0x1126('0x3e')]=_[_0x1126('0x36')](_0x120de1['model'],_0x120de1[_0x1126('0x33')]);_0x146066[_0x1126('0x35')]=_[_0x1126('0x36')](_0x120de1['model'],qs[_0x1126('0x37')](_0x2f45b9[_0x1126('0x33')][_0x1126('0x37')]));_0x146066[_0x1126('0x35')]=_0x146066[_0x1126('0x35')][_0x1126('0x38')]?_0x146066[_0x1126('0x35')]:_0x120de1[_0x1126('0x32')];if(_0x2f45b9['query'][_0x1126('0x47')]){_0x146066['include']=[{'all':!![]}];}_0x146066=_[_0x1126('0x44')]({},_0x146066,_0x2f45b9[_0x1126('0x4b')]);return db['SalesforceConfiguration']['find'](_0x146066)[_0x1126('0x19')](handleEntityNotFound(_0x323499,null))[_0x1126('0x19')](respondWithResult(_0x323499,null))[_0x1126('0x22')](handleError(_0x323499,null));};exports['create']=function(_0x3cb44c,_0x3506d7){return db[_0x1126('0x45')][_0x1126('0x4c')](_0x3cb44c['body'],{})[_0x1126('0x19')](respondWithResult(_0x3506d7,0xc9))[_0x1126('0x22')](handleError(_0x3506d7,null));};exports['update']=function(_0x4bcc08,_0x4abb4d){if(_0x4bcc08['body']['id']){delete _0x4bcc08[_0x1126('0x4d')]['id'];}return db[_0x1126('0x45')]['find']({'where':{'id':_0x4bcc08[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0x4abb4d,null))[_0x1126('0x19')](saveUpdates(_0x4bcc08[_0x1126('0x4d')],null))[_0x1126('0x19')](respondWithResult(_0x4abb4d,null))['catch'](handleError(_0x4abb4d,null));};exports[_0x1126('0x2c')]=function(_0x267592,_0x5d6414){return db[_0x1126('0x45')][_0x1126('0x4e')]({'where':{'id':_0x267592[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0x5d6414,null))[_0x1126('0x19')](removeEntity(_0x5d6414,null))['catch'](handleError(_0x5d6414,null));};exports[_0x1126('0x4f')]=function(_0x49aeaa,_0x868b2c,_0x952d14){var _0x33c971={};var _0x590bc2={};var _0x427add;var _0x2340f8;return db['SalesforceConfiguration'][_0x1126('0x50')]({'where':{'id':_0x49aeaa[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0x868b2c,null))['then'](function(_0x2fe6dc){if(_0x2fe6dc){_0x427add=_0x2fe6dc;_0x590bc2[_0x1126('0x32')]=_[_0x1126('0x34')](db[_0x1126('0x51')][_0x1126('0x31')]);_0x590bc2[_0x1126('0x33')]=_[_0x1126('0x34')](_0x49aeaa[_0x1126('0x33')]);_0x590bc2['filters']=_[_0x1126('0x36')](_0x590bc2[_0x1126('0x32')],_0x590bc2[_0x1126('0x33')]);_0x33c971[_0x1126('0x35')]=_[_0x1126('0x36')](_0x590bc2['model'],qs[_0x1126('0x37')](_0x49aeaa[_0x1126('0x33')]['fields']));_0x33c971[_0x1126('0x35')]=_0x33c971['attributes'][_0x1126('0x38')]?_0x33c971[_0x1126('0x35')]:_0x590bc2['model'];_0x33c971[_0x1126('0x3b')]=qs[_0x1126('0x3c')](_0x49aeaa[_0x1126('0x33')]['sort']);_0x33c971[_0x1126('0x3d')]=qs['filters'](_['pick'](_0x49aeaa[_0x1126('0x33')],_0x590bc2[_0x1126('0x3e')]));if(_0x49aeaa[_0x1126('0x33')][_0x1126('0x43')]){_0x33c971[_0x1126('0x3d')]=_[_0x1126('0x44')](_0x33c971[_0x1126('0x3d')],{'$or':_['map'](_0x33c971[_0x1126('0x35')],function(_0x43ec00){var _0x116867={};_0x116867[_0x43ec00]={'$like':'%'+_0x49aeaa[_0x1126('0x33')][_0x1126('0x43')]+'%'};return _0x116867;})});}_0x33c971=_[_0x1126('0x44')]({},_0x33c971,_0x49aeaa['options']);return _0x427add['getFields'](_0x33c971);}})[_0x1126('0x19')](function(_0x3921c2){if(_0x3921c2){_0x2340f8=_0x3921c2['length'];if(!_0x49aeaa['query']['hasOwnProperty']('nolimit')){_0x33c971[_0x1126('0x27')]=qs[_0x1126('0x27')](_0x49aeaa[_0x1126('0x33')]['limit']);_0x33c971[_0x1126('0x26')]=qs[_0x1126('0x26')](_0x49aeaa[_0x1126('0x33')][_0x1126('0x26')]);}return _0x427add[_0x1126('0x4f')](_0x33c971);}})[_0x1126('0x19')](function(_0x131056){if(_0x131056){return _0x131056?{'count':_0x2340f8,'rows':_0x131056}:null;}})['then'](respondWithResult(_0x868b2c,null))[_0x1126('0x22')](handleError(_0x868b2c,null));};exports[_0x1126('0x52')]=function(_0x43bd70,_0xd8171c,_0x288b9b){var _0x56c003={};var _0x5d758d={};var _0x15cf3d;var _0x2643d7;return db['SalesforceConfiguration'][_0x1126('0x50')]({'where':{'id':_0x43bd70[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0xd8171c,null))[_0x1126('0x19')](function(_0x2828d4){if(_0x2828d4){_0x15cf3d=_0x2828d4;_0x5d758d[_0x1126('0x32')]=_[_0x1126('0x34')](db[_0x1126('0x51')][_0x1126('0x31')]);_0x5d758d[_0x1126('0x33')]=_[_0x1126('0x34')](_0x43bd70[_0x1126('0x33')]);_0x5d758d[_0x1126('0x3e')]=_['intersection'](_0x5d758d[_0x1126('0x32')],_0x5d758d[_0x1126('0x33')]);_0x56c003[_0x1126('0x35')]=_['intersection'](_0x5d758d['model'],qs[_0x1126('0x37')](_0x43bd70[_0x1126('0x33')][_0x1126('0x37')]));_0x56c003[_0x1126('0x35')]=_0x56c003['attributes']['length']?_0x56c003['attributes']:_0x5d758d[_0x1126('0x32')];_0x56c003[_0x1126('0x3b')]=qs[_0x1126('0x3c')](_0x43bd70[_0x1126('0x33')]['sort']);_0x56c003[_0x1126('0x3d')]=qs['filters'](_[_0x1126('0x3f')](_0x43bd70[_0x1126('0x33')],_0x5d758d[_0x1126('0x3e')]));if(_0x43bd70[_0x1126('0x33')][_0x1126('0x43')]){_0x56c003[_0x1126('0x3d')]=_[_0x1126('0x44')](_0x56c003['where'],{'$or':_[_0x1126('0x53')](_0x56c003['attributes'],function(_0x3c1dda){var _0x906531={};_0x906531[_0x3c1dda]={'$like':'%'+_0x43bd70['query'][_0x1126('0x43')]+'%'};return _0x906531;})});}_0x56c003=_[_0x1126('0x44')]({},_0x56c003,_0x43bd70['options']);return _0x15cf3d[_0x1126('0x52')](_0x56c003);}})[_0x1126('0x19')](function(_0x4b1d04){if(_0x4b1d04){_0x2643d7=_0x4b1d04['length'];if(!_0x43bd70[_0x1126('0x33')][_0x1126('0x39')](_0x1126('0x3a'))){_0x56c003['limit']=qs['limit'](_0x43bd70['query'][_0x1126('0x27')]);_0x56c003['offset']=qs['offset'](_0x43bd70[_0x1126('0x33')]['offset']);}return _0x15cf3d[_0x1126('0x52')](_0x56c003);}})[_0x1126('0x19')](function(_0x51ccdc){if(_0x51ccdc){return _0x51ccdc?{'count':_0x2643d7,'rows':_0x51ccdc}:null;}})[_0x1126('0x19')](respondWithResult(_0xd8171c,null))[_0x1126('0x22')](handleError(_0xd8171c,null));};exports[_0x1126('0x54')]=function(_0xc3bb7f,_0x1644fc,_0x5e9872){var _0xec8540={};var _0x426faa={};var _0x5679ec;var _0xd182b1;return db[_0x1126('0x45')][_0x1126('0x50')]({'where':{'id':_0xc3bb7f[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0x1644fc,null))[_0x1126('0x19')](function(_0x59512b){if(_0x59512b){_0x5679ec=_0x59512b;_0x426faa[_0x1126('0x32')]=_[_0x1126('0x34')](db[_0x1126('0x51')][_0x1126('0x31')]);_0x426faa[_0x1126('0x33')]=_[_0x1126('0x34')](_0xc3bb7f[_0x1126('0x33')]);_0x426faa[_0x1126('0x3e')]=_[_0x1126('0x36')](_0x426faa['model'],_0x426faa[_0x1126('0x33')]);_0xec8540[_0x1126('0x35')]=_[_0x1126('0x36')](_0x426faa[_0x1126('0x32')],qs[_0x1126('0x37')](_0xc3bb7f['query'][_0x1126('0x37')]));_0xec8540['attributes']=_0xec8540['attributes'][_0x1126('0x38')]?_0xec8540[_0x1126('0x35')]:_0x426faa['model'];_0xec8540['order']=qs[_0x1126('0x3c')](_0xc3bb7f[_0x1126('0x33')][_0x1126('0x3c')]);_0xec8540[_0x1126('0x3d')]=qs[_0x1126('0x3e')](_[_0x1126('0x3f')](_0xc3bb7f[_0x1126('0x33')],_0x426faa[_0x1126('0x3e')]));if(_0xc3bb7f[_0x1126('0x33')]['filter']){_0xec8540[_0x1126('0x3d')]=_[_0x1126('0x44')](_0xec8540[_0x1126('0x3d')],{'$or':_[_0x1126('0x53')](_0xec8540[_0x1126('0x35')],function(_0x336b4b){var _0x482199={};_0x482199[_0x336b4b]={'$like':'%'+_0xc3bb7f[_0x1126('0x33')][_0x1126('0x43')]+'%'};return _0x482199;})});}_0xec8540=_[_0x1126('0x44')]({},_0xec8540,_0xc3bb7f[_0x1126('0x4b')]);return _0x5679ec[_0x1126('0x54')](_0xec8540);}})[_0x1126('0x19')](function(_0x2418ca){if(_0x2418ca){_0xd182b1=_0x2418ca[_0x1126('0x38')];if(!_0xc3bb7f[_0x1126('0x33')][_0x1126('0x39')]('nolimit')){_0xec8540['limit']=qs[_0x1126('0x27')](_0xc3bb7f['query'][_0x1126('0x27')]);_0xec8540['offset']=qs[_0x1126('0x26')](_0xc3bb7f['query'][_0x1126('0x26')]);}return _0x5679ec['getDescriptions'](_0xec8540);}})['then'](function(_0x48c461){if(_0x48c461){return _0x48c461?{'count':_0xd182b1,'rows':_0x48c461}:null;}})[_0x1126('0x19')](respondWithResult(_0x1644fc,null))[_0x1126('0x22')](handleError(_0x1644fc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 41a80c6..ab47594 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 _0x1ae0=['exports','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','./intSalesforceConfiguration.attributes'];(function(_0xf34d07,_0x31abc0){var _0x552c0d=function(_0x409e4f){while(--_0x409e4f){_0xf34d07['push'](_0xf34d07['shift']());}};_0x552c0d(++_0x31abc0);}(_0x1ae0,0xb8));var _0x01ae=function(_0x358fd3,_0x4a9c44){_0x358fd3=_0x358fd3-0x0;var _0x1ad0f3=_0x1ae0[_0x358fd3];return _0x1ad0f3;};'use strict';var _=require('lodash');var util=require(_0x01ae('0x0'));var logger=require(_0x01ae('0x1'))(_0x01ae('0x2'));var moment=require(_0x01ae('0x3'));var BPromise=require(_0x01ae('0x4'));var rp=require('request-promise');var attributes=require(_0x01ae('0x5'));module[_0x01ae('0x6')]=function(_0x3d8540,_0x2d6369){return _0x3d8540[_0x01ae('0x7')](_0x01ae('0x8'),attributes,{'tableName':_0x01ae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59c5=['../../config/logger','moment','bluebird','request-promise','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x1b23b8,_0x3b7cb7){var _0x42824d=function(_0x71c592){while(--_0x71c592){_0x1b23b8['push'](_0x1b23b8['shift']());}};_0x42824d(++_0x3b7cb7);}(_0x59c5,0x132));var _0x559c=function(_0x502831,_0x4a518d){_0x502831=_0x502831-0x0;var _0x15d589=_0x59c5[_0x502831];return _0x15d589;};'use strict';var _=require(_0x559c('0x0'));var util=require(_0x559c('0x1'));var logger=require(_0x559c('0x2'))('api');var moment=require(_0x559c('0x3'));var BPromise=require(_0x559c('0x4'));var rp=require(_0x559c('0x5'));var attributes=require(_0x559c('0x6'));module[_0x559c('0x7')]=function(_0x5e9904,_0x51ca8e){return _0x5e9904[_0x559c('0x8')](_0x559c('0x9'),attributes,{'tableName':_0x559c('0xa'),'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 e45ed85..66b4375 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(_0x586154,_0x43695c){var _0x31bf02=function(_0x150074){while(--_0x150074){_0x586154['push'](_0x586154['shift']());}};_0x31bf02(++_0x43695c);}(_0xe14b,0x93));var _0xbe14=function(_0x11631c,_0x30f8f8){_0x11631c=_0x11631c-0x0;var _0x30d93d=_0xe14b[_0x11631c];return _0x30d93d;};'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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1dab7b,_0x3db8bb){var _0xb4d59c=function(_0x24e3d8){while(--_0x24e3d8){_0x1dab7b['push'](_0x1dab7b['shift']());}};_0xb4d59c(++_0x3db8bb);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0x5fc3[_0x4b9978];return _0x42f0e5;};'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')]('SalesforceConfiguration,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SalesforceConfiguration,\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']('SalesforceConfiguration,\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/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 8c6672e..ec00a96 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 _0xb478=['show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x48a1e7,_0x56dd65){var _0x224150=function(_0x2c30d4){while(--_0x2c30d4){_0x48a1e7['push'](_0x48a1e7['shift']());}};_0x224150(++_0x56dd65);}(_0xb478,0xce));var _0x8b47=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xb478[_0x269ee8];return _0x4d98bd;};'use strict';var multer=require(_0x8b47('0x0'));var util=require('util');var path=require(_0x8b47('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b47('0x2'));var router=express[_0x8b47('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8b47('0x4'));var config=require(_0x8b47('0x5'));var controller=require('./intSalesforceField.controller');router[_0x8b47('0x6')]('/',auth[_0x8b47('0x7')](),controller[_0x8b47('0x8')]);router[_0x8b47('0x6')](_0x8b47('0x9'),auth[_0x8b47('0x7')](),controller[_0x8b47('0xa')]);router[_0x8b47('0xb')]('/',auth[_0x8b47('0x7')](),controller[_0x8b47('0xc')]);router[_0x8b47('0xd')](_0x8b47('0x9'),auth[_0x8b47('0x7')](),controller[_0x8b47('0xe')]);router[_0x8b47('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8b47('0x10')]);module[_0x8b47('0x11')]=router; \ No newline at end of file +var _0x6581=['index','show','post','create','put','/:id','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','./intSalesforceField.controller','isAuthenticated'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x6581,0x1ac));var _0x1658=function(_0x5a4cac,_0x1e7252){_0x5a4cac=_0x5a4cac-0x0;var _0x3e7cb0=_0x6581[_0x5a4cac];return _0x3e7cb0;};'use strict';var multer=require('multer');var util=require(_0x1658('0x0'));var path=require(_0x1658('0x1'));var timeout=require(_0x1658('0x2'));var express=require('express');var router=express[_0x1658('0x3')]();var auth=require(_0x1658('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1658('0x5'));router['get']('/',auth[_0x1658('0x6')](),controller[_0x1658('0x7')]);router['get']('/:id',auth[_0x1658('0x6')](),controller[_0x1658('0x8')]);router[_0x1658('0x9')]('/',auth['isAuthenticated'](),controller[_0x1658('0xa')]);router[_0x1658('0xb')](_0x1658('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1658('0xd')](_0x1658('0xc'),auth[_0x1658('0x6')](),controller[_0x1658('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 56b2e65..4a30780 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 _0xf1d0=['string','variable','customVariable','STRING','sequelize','ENUM'];(function(_0x3c4c9e,_0xc18dff){var _0x197cf3=function(_0x2290c4){while(--_0x2290c4){_0x3c4c9e['push'](_0x3c4c9e['shift']());}};_0x197cf3(++_0xc18dff);}(_0xf1d0,0x9a));var _0x0f1d=function(_0x5d7661,_0x206fa2){_0x5d7661=_0x5d7661-0x0;var _0x17c054=_0xf1d0[_0x5d7661];return _0x17c054;};'use strict';var Sequelize=require(_0x0f1d('0x0'));module['exports']={'type':{'type':Sequelize[_0x0f1d('0x1')](_0x0f1d('0x2'),_0x0f1d('0x3'),_0x0f1d('0x4'),'keyValue'),'defaultValue':_0x0f1d('0x2')},'content':{'type':Sequelize[_0x0f1d('0x5')]},'key':{'type':Sequelize[_0x0f1d('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x0f1d('0x2'),'variable',_0x0f1d('0x4'))},'keyContent':{'type':Sequelize[_0x0f1d('0x5')]},'idField':{'type':Sequelize[_0x0f1d('0x5')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf3dd=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x14d76a,_0x38c683){var _0x5baef8=function(_0x4cb8ae){while(--_0x4cb8ae){_0x14d76a['push'](_0x14d76a['shift']());}};_0x5baef8(++_0x38c683);}(_0xf3dd,0x129));var _0xdf3d=function(_0x50d0dc,_0x23bcb0){_0x50d0dc=_0x50d0dc-0x0;var _0x49f2a9=_0xf3dd[_0x50d0dc];return _0x49f2a9;};'use strict';var Sequelize=require(_0xdf3d('0x0'));module[_0xdf3d('0x1')]={'type':{'type':Sequelize[_0xdf3d('0x2')](_0xdf3d('0x3'),_0xdf3d('0x4'),_0xdf3d('0x5'),_0xdf3d('0x6')),'defaultValue':_0xdf3d('0x3')},'content':{'type':Sequelize[_0xdf3d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xdf3d('0x4'),_0xdf3d('0x5'))},'keyContent':{'type':Sequelize[_0xdf3d('0x7')]},'idField':{'type':Sequelize[_0xdf3d('0x7')]},'variableName':{'type':Sequelize[_0xdf3d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 5873c55..cea18e0 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 _0x2f7a=['findAll','catch','params','length','create','body','find','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','reject','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','SalesforceField','includeAll','include'];(function(_0x1f0454,_0x41fd2f){var _0x4a3b81=function(_0x286622){while(--_0x286622){_0x1f0454['push'](_0x1f0454['shift']());}};_0x4a3b81(++_0x41fd2f);}(_0x2f7a,0x151));var _0xa2f7=function(_0x4a27cb,_0x587c30){_0x4a27cb=_0x4a27cb-0x0;var _0x55e026=_0x2f7a[_0x4a27cb];return _0x55e026;};'use strict';var pdf=require(_0xa2f7('0x0'));var emlformat=require(_0xa2f7('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f7('0x2'));var rp=require(_0xa2f7('0x3'));var moment=require(_0xa2f7('0x4'));var BPromise=require(_0xa2f7('0x5'));var Mustache=require(_0xa2f7('0x6'));var util=require(_0xa2f7('0x7'));var path=require(_0xa2f7('0x8'));var sox=require(_0xa2f7('0x9'));var csv=require(_0xa2f7('0xa'));var ejs=require(_0xa2f7('0xb'));var fs=require('fs');var _=require(_0xa2f7('0xc'));var squel=require(_0xa2f7('0xd'));var crypto=require(_0xa2f7('0xe'));var jsforce=require(_0xa2f7('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa2f7('0x10'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xa2f7('0x11'));var Redis=require(_0xa2f7('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xa2f7('0x13'))(_0xa2f7('0x14'));var utils=require(_0xa2f7('0x15'));var config=require(_0xa2f7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x252770,_0x282049){_0x282049=_0x282049||0xcc;return function(_0x2669a9){if(_0x2669a9){return _0x252770[_0xa2f7('0x17')](_0x282049);}return _0x252770[_0xa2f7('0x18')](_0x282049)[_0xa2f7('0x19')]();};}function respondWithResult(_0x3ce029,_0xa0754){_0xa0754=_0xa0754||0xc8;return function(_0x4cb00f){if(_0x4cb00f){return _0x3ce029['status'](_0xa0754)[_0xa2f7('0x1a')](_0x4cb00f);}};}function respondWithFilteredResult(_0x22e2a9,_0x398842){return function(_0x4fa1b5){if(_0x4fa1b5){var _0x2898f9=_0x4fa1b5[_0xa2f7('0x1b')],_0x363bc8=_0x398842['offset'],_0x1636f7=_0x398842[_0xa2f7('0x1c')]+_0x398842[_0xa2f7('0x1d')],_0x53014c;if(_0x1636f7>=_0x2898f9){_0x1636f7=_0x2898f9;_0x53014c=0xc8;}else{_0x53014c=0xce;}_0x22e2a9['status'](_0x53014c);return _0x22e2a9[_0xa2f7('0x1e')]('Content-Range',_0x363bc8+'-'+_0x1636f7+'/'+_0x2898f9)[_0xa2f7('0x1a')](_0x4fa1b5);}return null;};}function patchUpdates(_0x4b81ad){return function(_0x514ad6){try{jsonpatch['apply'](_0x514ad6,_0x4b81ad,!![]);}catch(_0x4251a7){return BPromise[_0xa2f7('0x1f')](_0x4251a7);}return _0x514ad6['save']();};}function saveUpdates(_0x4016b4,_0x4d3242){return function(_0x25709b){if(_0x25709b){return _0x25709b['update'](_0x4016b4)[_0xa2f7('0x20')](function(_0x269594){return _0x269594;});}return null;};}function removeEntity(_0x50d083,_0x245a7b){return function(_0x3b5ceb){if(_0x3b5ceb){return _0x3b5ceb[_0xa2f7('0x21')]()[_0xa2f7('0x20')](function(){_0x50d083[_0xa2f7('0x18')](0xcc)[_0xa2f7('0x19')]();});}};}function handleEntityNotFound(_0x531461,_0x50709e){return function(_0x3c9054){if(!_0x3c9054){_0x531461[_0xa2f7('0x17')](0x194);}return _0x3c9054;};}function handleError(_0x5cc418,_0x2b44e0){_0x2b44e0=_0x2b44e0||0x1f4;return function(_0x2891c1){logger['error'](_0x2891c1[_0xa2f7('0x22')]);if(_0x2891c1[_0xa2f7('0x23')]){delete _0x2891c1[_0xa2f7('0x23')];}_0x5cc418[_0xa2f7('0x18')](_0x2b44e0)[_0xa2f7('0x24')](_0x2891c1);};}exports[_0xa2f7('0x25')]=function(_0x4db4ff,_0x123622){var _0x5c05c4={},_0x32f28e={},_0x60fab5={'count':0x0,'rows':[]};var _0x265e31=db['SalesforceField'][_0xa2f7('0x26')];_0x32f28e[_0xa2f7('0x27')]=_[_0xa2f7('0x28')](_0x265e31);_0x32f28e['query']=_['keys'](_0x4db4ff[_0xa2f7('0x29')]);_0x32f28e[_0xa2f7('0x2a')]=_[_0xa2f7('0x2b')](_0x32f28e[_0xa2f7('0x27')],_0x32f28e[_0xa2f7('0x29')]);_0x5c05c4['attributes']=_[_0xa2f7('0x2b')](_0x32f28e[_0xa2f7('0x27')],qs['fields'](_0x4db4ff[_0xa2f7('0x29')][_0xa2f7('0x2c')]));_0x5c05c4[_0xa2f7('0x2d')]=_0x5c05c4[_0xa2f7('0x2d')]['length']?_0x5c05c4['attributes']:_0x32f28e[_0xa2f7('0x27')];if(!_0x4db4ff[_0xa2f7('0x29')][_0xa2f7('0x2e')](_0xa2f7('0x2f'))){_0x5c05c4[_0xa2f7('0x1d')]=qs['limit'](_0x4db4ff[_0xa2f7('0x29')][_0xa2f7('0x1d')]);_0x5c05c4[_0xa2f7('0x1c')]=qs[_0xa2f7('0x1c')](_0x4db4ff[_0xa2f7('0x29')][_0xa2f7('0x1c')]);}_0x5c05c4[_0xa2f7('0x30')]=qs[_0xa2f7('0x31')](_0x4db4ff['query'][_0xa2f7('0x31')]);_0x5c05c4[_0xa2f7('0x32')]=qs[_0xa2f7('0x2a')](_[_0xa2f7('0x33')](_0x4db4ff[_0xa2f7('0x29')],_0x32f28e['filters']));if(_0x4db4ff['query'][_0xa2f7('0x34')]){_0x5c05c4['where']=_[_0xa2f7('0x35')](_0x5c05c4[_0xa2f7('0x32')],{'$or':_[_0xa2f7('0x36')](_0x265e31,function(_0x11369c){if(_0x11369c[_0xa2f7('0x37')]['key']!=='VIRTUAL'){var _0x24e13b={};_0x24e13b[_0x11369c['field']]={'$like':'%'+_0x4db4ff[_0xa2f7('0x29')]['filter']+'%'};return _0x24e13b;}})});}_0x5c05c4=_[_0xa2f7('0x35')]({},_0x5c05c4,_0x4db4ff['options']);var _0xecce3a={'where':_0x5c05c4[_0xa2f7('0x32')]};return db[_0xa2f7('0x38')][_0xa2f7('0x1b')](_0xecce3a)['then'](function(_0x1bf827){_0x60fab5['count']=_0x1bf827;if(_0x4db4ff[_0xa2f7('0x29')][_0xa2f7('0x39')]){_0x5c05c4[_0xa2f7('0x3a')]=[{'all':!![]}];}return db[_0xa2f7('0x38')][_0xa2f7('0x3b')](_0x5c05c4);})[_0xa2f7('0x20')](function(_0x13dae0){_0x60fab5['rows']=_0x13dae0;return _0x60fab5;})[_0xa2f7('0x20')](respondWithFilteredResult(_0x123622,_0x5c05c4))[_0xa2f7('0x3c')](handleError(_0x123622,null));};exports['show']=function(_0x58d472,_0x49af80){var _0x586b73={'raw':!![],'where':{'id':_0x58d472[_0xa2f7('0x3d')]['id']}},_0x35f6e1={};_0x35f6e1[_0xa2f7('0x27')]=_['keys'](db[_0xa2f7('0x38')]['rawAttributes']);_0x35f6e1['query']=_[_0xa2f7('0x28')](_0x58d472[_0xa2f7('0x29')]);_0x35f6e1['filters']=_[_0xa2f7('0x2b')](_0x35f6e1[_0xa2f7('0x27')],_0x35f6e1[_0xa2f7('0x29')]);_0x586b73[_0xa2f7('0x2d')]=_[_0xa2f7('0x2b')](_0x35f6e1[_0xa2f7('0x27')],qs['fields'](_0x58d472['query'][_0xa2f7('0x2c')]));_0x586b73['attributes']=_0x586b73[_0xa2f7('0x2d')][_0xa2f7('0x3e')]?_0x586b73['attributes']:_0x35f6e1['model'];if(_0x58d472['query'][_0xa2f7('0x39')]){_0x586b73[_0xa2f7('0x3a')]=[{'all':!![]}];}_0x586b73=_[_0xa2f7('0x35')]({},_0x586b73,_0x58d472['options']);return db['SalesforceField']['find'](_0x586b73)[_0xa2f7('0x20')](handleEntityNotFound(_0x49af80,null))['then'](respondWithResult(_0x49af80,null))[_0xa2f7('0x3c')](handleError(_0x49af80,null));};exports[_0xa2f7('0x3f')]=function(_0x3ee940,_0x57fd64){return db[_0xa2f7('0x38')][_0xa2f7('0x3f')](_0x3ee940['body'],{})[_0xa2f7('0x20')](respondWithResult(_0x57fd64,0xc9))['catch'](handleError(_0x57fd64,null));};exports['update']=function(_0x19a008,_0x50eb90){if(_0x19a008[_0xa2f7('0x40')]['id']){delete _0x19a008[_0xa2f7('0x40')]['id'];}return db[_0xa2f7('0x38')][_0xa2f7('0x41')]({'where':{'id':_0x19a008['params']['id']}})['then'](handleEntityNotFound(_0x50eb90,null))[_0xa2f7('0x20')](saveUpdates(_0x19a008[_0xa2f7('0x40')],null))[_0xa2f7('0x20')](respondWithResult(_0x50eb90,null))[_0xa2f7('0x3c')](handleError(_0x50eb90,null));};exports[_0xa2f7('0x21')]=function(_0x2e4b6a,_0x52ca05){return db[_0xa2f7('0x38')]['find']({'where':{'id':_0x2e4b6a[_0xa2f7('0x3d')]['id']}})[_0xa2f7('0x20')](handleEntityNotFound(_0x52ca05,null))[_0xa2f7('0x20')](removeEntity(_0x52ca05,null))['catch'](handleError(_0x52ca05,null));}; \ No newline at end of file +var _0x00e1=['json','count','offset','set','Content-Range','update','destroy','then','end','stack','name','send','index','SalesforceField','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','key','VIRTUAL','field','options','includeAll','rows','catch','show','length','include','merge','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x00e1,0x151));var _0x100e=function(_0x359ead,_0x5159e4){_0x359ead=_0x359ead-0x0;var _0x3cb71f=_0x00e1[_0x359ead];return _0x3cb71f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x100e('0x0'));var rimraf=require(_0x100e('0x1'));var zipdir=require(_0x100e('0x2'));var jsonpatch=require(_0x100e('0x3'));var rp=require(_0x100e('0x4'));var moment=require(_0x100e('0x5'));var BPromise=require(_0x100e('0x6'));var Mustache=require(_0x100e('0x7'));var util=require(_0x100e('0x8'));var path=require(_0x100e('0x9'));var sox=require(_0x100e('0xa'));var csv=require('to-csv');var ejs=require(_0x100e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x100e('0xc'));var crypto=require(_0x100e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x100e('0xe'));var toCsv=require(_0x100e('0xf'));var querystring=require(_0x100e('0x10'));var Papa=require(_0x100e('0x11'));var authService=require(_0x100e('0x12'));var hardwareService=require(_0x100e('0x13'));var Redis=require(_0x100e('0x14'));var qs=require(_0x100e('0x15'));var logger=require(_0x100e('0x16'))(_0x100e('0x17'));var utils=require('../../config/utils');var config=require(_0x100e('0x18'));var db=require(_0x100e('0x19'))['db'];function respondWithStatusCode(_0x10047b,_0x1c1a73){_0x1c1a73=_0x1c1a73||0xcc;return function(_0x2c6d69){if(_0x2c6d69){return _0x10047b[_0x100e('0x1a')](_0x1c1a73);}return _0x10047b[_0x100e('0x1b')](_0x1c1a73)['end']();};}function respondWithResult(_0x48ef1c,_0x5b3277){_0x5b3277=_0x5b3277||0xc8;return function(_0xcc03d){if(_0xcc03d){return _0x48ef1c[_0x100e('0x1b')](_0x5b3277)[_0x100e('0x1c')](_0xcc03d);}};}function respondWithFilteredResult(_0x4c157f,_0x47449f){return function(_0x22a60a){if(_0x22a60a){var _0x39967c=_0x22a60a[_0x100e('0x1d')],_0x13fb41=_0x47449f[_0x100e('0x1e')],_0x161927=_0x47449f[_0x100e('0x1e')]+_0x47449f['limit'],_0x545f51;if(_0x161927>=_0x39967c){_0x161927=_0x39967c;_0x545f51=0xc8;}else{_0x545f51=0xce;}_0x4c157f[_0x100e('0x1b')](_0x545f51);return _0x4c157f[_0x100e('0x1f')](_0x100e('0x20'),_0x13fb41+'-'+_0x161927+'/'+_0x39967c)[_0x100e('0x1c')](_0x22a60a);}return null;};}function patchUpdates(_0xd082af){return function(_0x421c7e){try{jsonpatch['apply'](_0x421c7e,_0xd082af,!![]);}catch(_0x214dfe){return BPromise['reject'](_0x214dfe);}return _0x421c7e['save']();};}function saveUpdates(_0x4ae083,_0x20b5a6){return function(_0x11f596){if(_0x11f596){return _0x11f596[_0x100e('0x21')](_0x4ae083)['then'](function(_0x227f01){return _0x227f01;});}return null;};}function removeEntity(_0x2ea34a,_0x3eddd3){return function(_0x18de3f){if(_0x18de3f){return _0x18de3f[_0x100e('0x22')]()[_0x100e('0x23')](function(){_0x2ea34a[_0x100e('0x1b')](0xcc)[_0x100e('0x24')]();});}};}function handleEntityNotFound(_0x4ba837,_0x4713b7){return function(_0x4624aa){if(!_0x4624aa){_0x4ba837['sendStatus'](0x194);}return _0x4624aa;};}function handleError(_0x439ceb,_0x557e39){_0x557e39=_0x557e39||0x1f4;return function(_0x43d8b2){logger['error'](_0x43d8b2[_0x100e('0x25')]);if(_0x43d8b2[_0x100e('0x26')]){delete _0x43d8b2[_0x100e('0x26')];}_0x439ceb[_0x100e('0x1b')](_0x557e39)[_0x100e('0x27')](_0x43d8b2);};}exports[_0x100e('0x28')]=function(_0x1f0e21,_0x2a8eb2){var _0x54e7e1={},_0xb759d0={},_0x49fed1={'count':0x0,'rows':[]};var _0x11f64d=db[_0x100e('0x29')][_0x100e('0x2a')];_0xb759d0[_0x100e('0x2b')]=_['keys'](_0x11f64d);_0xb759d0['query']=_[_0x100e('0x2c')](_0x1f0e21[_0x100e('0x2d')]);_0xb759d0[_0x100e('0x2e')]=_['intersection'](_0xb759d0['model'],_0xb759d0[_0x100e('0x2d')]);_0x54e7e1[_0x100e('0x2f')]=_['intersection'](_0xb759d0['model'],qs[_0x100e('0x30')](_0x1f0e21[_0x100e('0x2d')][_0x100e('0x30')]));_0x54e7e1['attributes']=_0x54e7e1[_0x100e('0x2f')]['length']?_0x54e7e1[_0x100e('0x2f')]:_0xb759d0[_0x100e('0x2b')];if(!_0x1f0e21['query'][_0x100e('0x31')](_0x100e('0x32'))){_0x54e7e1[_0x100e('0x33')]=qs[_0x100e('0x33')](_0x1f0e21[_0x100e('0x2d')][_0x100e('0x33')]);_0x54e7e1['offset']=qs[_0x100e('0x1e')](_0x1f0e21['query'][_0x100e('0x1e')]);}_0x54e7e1[_0x100e('0x34')]=qs[_0x100e('0x35')](_0x1f0e21[_0x100e('0x2d')][_0x100e('0x35')]);_0x54e7e1[_0x100e('0x36')]=qs[_0x100e('0x2e')](_[_0x100e('0x37')](_0x1f0e21[_0x100e('0x2d')],_0xb759d0[_0x100e('0x2e')]));if(_0x1f0e21['query'][_0x100e('0x38')]){_0x54e7e1[_0x100e('0x36')]=_['merge'](_0x54e7e1[_0x100e('0x36')],{'$or':_['map'](_0x11f64d,function(_0x5e8196){if(_0x5e8196[_0x100e('0x39')][_0x100e('0x3a')]!==_0x100e('0x3b')){var _0x31d0d2={};_0x31d0d2[_0x5e8196[_0x100e('0x3c')]]={'$like':'%'+_0x1f0e21[_0x100e('0x2d')]['filter']+'%'};return _0x31d0d2;}})});}_0x54e7e1=_['merge']({},_0x54e7e1,_0x1f0e21[_0x100e('0x3d')]);var _0x2008e5={'where':_0x54e7e1[_0x100e('0x36')]};return db['SalesforceField'][_0x100e('0x1d')](_0x2008e5)[_0x100e('0x23')](function(_0x24d518){_0x49fed1['count']=_0x24d518;if(_0x1f0e21[_0x100e('0x2d')][_0x100e('0x3e')]){_0x54e7e1['include']=[{'all':!![]}];}return db[_0x100e('0x29')]['findAll'](_0x54e7e1);})[_0x100e('0x23')](function(_0x3576e2){_0x49fed1[_0x100e('0x3f')]=_0x3576e2;return _0x49fed1;})[_0x100e('0x23')](respondWithFilteredResult(_0x2a8eb2,_0x54e7e1))[_0x100e('0x40')](handleError(_0x2a8eb2,null));};exports[_0x100e('0x41')]=function(_0x31e1b0,_0x2e08df){var _0x457929={'raw':!![],'where':{'id':_0x31e1b0['params']['id']}},_0x2a1b5d={};_0x2a1b5d['model']=_[_0x100e('0x2c')](db[_0x100e('0x29')]['rawAttributes']);_0x2a1b5d['query']=_[_0x100e('0x2c')](_0x31e1b0[_0x100e('0x2d')]);_0x2a1b5d['filters']=_['intersection'](_0x2a1b5d['model'],_0x2a1b5d['query']);_0x457929[_0x100e('0x2f')]=_['intersection'](_0x2a1b5d['model'],qs[_0x100e('0x30')](_0x31e1b0[_0x100e('0x2d')][_0x100e('0x30')]));_0x457929[_0x100e('0x2f')]=_0x457929['attributes'][_0x100e('0x42')]?_0x457929[_0x100e('0x2f')]:_0x2a1b5d['model'];if(_0x31e1b0['query'][_0x100e('0x3e')]){_0x457929[_0x100e('0x43')]=[{'all':!![]}];}_0x457929=_[_0x100e('0x44')]({},_0x457929,_0x31e1b0['options']);return db[_0x100e('0x29')][_0x100e('0x45')](_0x457929)['then'](handleEntityNotFound(_0x2e08df,null))[_0x100e('0x23')](respondWithResult(_0x2e08df,null))[_0x100e('0x40')](handleError(_0x2e08df,null));};exports[_0x100e('0x46')]=function(_0x5783fd,_0x15a763){return db['SalesforceField'][_0x100e('0x46')](_0x5783fd[_0x100e('0x47')],{})['then'](respondWithResult(_0x15a763,0xc9))[_0x100e('0x40')](handleError(_0x15a763,null));};exports[_0x100e('0x21')]=function(_0x4fa0a3,_0x53d22f){if(_0x4fa0a3[_0x100e('0x47')]['id']){delete _0x4fa0a3[_0x100e('0x47')]['id'];}return db[_0x100e('0x29')][_0x100e('0x45')]({'where':{'id':_0x4fa0a3[_0x100e('0x48')]['id']}})[_0x100e('0x23')](handleEntityNotFound(_0x53d22f,null))[_0x100e('0x23')](saveUpdates(_0x4fa0a3[_0x100e('0x47')],null))[_0x100e('0x23')](respondWithResult(_0x53d22f,null))['catch'](handleError(_0x53d22f,null));};exports[_0x100e('0x22')]=function(_0xd1dd08,_0x104585){return db[_0x100e('0x29')]['find']({'where':{'id':_0xd1dd08[_0x100e('0x48')]['id']}})['then'](handleEntityNotFound(_0x104585,null))[_0x100e('0x23')](removeEntity(_0x104585,null))[_0x100e('0x40')](handleError(_0x104585,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 6cd6a3f..eace3b2 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 _0xcb3d=['../../config/logger','api','moment','bluebird','request-promise','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','lodash','util'];(function(_0x1ece0a,_0x38e36a){var _0x10b8a7=function(_0xf5721d){while(--_0xf5721d){_0x1ece0a['push'](_0x1ece0a['shift']());}};_0x10b8a7(++_0x38e36a);}(_0xcb3d,0x191));var _0xdcb3=function(_0x29d32b,_0x1bc829){_0x29d32b=_0x29d32b-0x0;var _0x27e2e1=_0xcb3d[_0x29d32b];return _0x27e2e1;};'use strict';var _=require(_0xdcb3('0x0'));var util=require(_0xdcb3('0x1'));var logger=require(_0xdcb3('0x2'))(_0xdcb3('0x3'));var moment=require(_0xdcb3('0x4'));var BPromise=require(_0xdcb3('0x5'));var rp=require(_0xdcb3('0x6'));var attributes=require(_0xdcb3('0x7'));module[_0xdcb3('0x8')]=function(_0x184625,_0x104b88){return _0x184625[_0xdcb3('0x9')](_0xdcb3('0xa'),attributes,{'tableName':_0xdcb3('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xdcb3('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee92=['moment','bluebird','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x322b74,_0x1114e0){var _0x4c18ff=function(_0x53d81d){while(--_0x53d81d){_0x322b74['push'](_0x322b74['shift']());}};_0x4c18ff(++_0x1114e0);}(_0xee92,0x111));var _0x2ee9=function(_0x2ecc61,_0x2058ff){_0x2ecc61=_0x2ecc61-0x0;var _0x288f69=_0xee92[_0x2ecc61];return _0x288f69;};'use strict';var _=require('lodash');var util=require(_0x2ee9('0x0'));var logger=require(_0x2ee9('0x1'))(_0x2ee9('0x2'));var moment=require(_0x2ee9('0x3'));var BPromise=require(_0x2ee9('0x4'));var rp=require('request-promise');var attributes=require(_0x2ee9('0x5'));module[_0x2ee9('0x6')]=function(_0x4b05de,_0x45100c){return _0x4b05de[_0x2ee9('0x7')](_0x2ee9('0x8'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x2ee9('0x9'),'fields':[_0x2ee9('0xa'),_0x2ee9('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 f8531de..4fb2359 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 _0xe037=['info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xe037,0x14b));var _0x7e03=function(_0xcbe787,_0x401e4c){_0xcbe787=_0xcbe787-0x0;var _0x4c78fa=_0xe037[_0xcbe787];return _0x4c78fa;};'use strict';var _=require(_0x7e03('0x0'));var util=require(_0x7e03('0x1'));var moment=require(_0x7e03('0x2'));var BPromise=require(_0x7e03('0x3'));var rs=require(_0x7e03('0x4'));var fs=require('fs');var Redis=require(_0x7e03('0x5'));var db=require(_0x7e03('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e03('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e03('0x8')][_0x7e03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143cb0,_0x2ec5ba,_0x2256f0){return new BPromise(function(_0x45c4ff,_0x21e0a3){return client[_0x7e03('0xa')](_0x143cb0,_0x2256f0)['then'](function(_0x4f7fa9){logger[_0x7e03('0xb')](_0x7e03('0xc'),_0x2ec5ba,_0x7e03('0xd'));logger[_0x7e03('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x2ec5ba,_0x7e03('0xd'),JSON['stringify'](_0x4f7fa9));if(_0x4f7fa9[_0x7e03('0xf')]){if(_0x4f7fa9[_0x7e03('0xf')][_0x7e03('0x10')]===0x1f4){logger[_0x7e03('0xf')](_0x7e03('0xc'),_0x2ec5ba,_0x4f7fa9[_0x7e03('0xf')][_0x7e03('0x11')]);return _0x21e0a3(_0x4f7fa9[_0x7e03('0xf')]['message']);}logger[_0x7e03('0xf')]('SalesforceField,\x20%s,\x20%s',_0x2ec5ba,_0x4f7fa9['error'][_0x7e03('0x11')]);return _0x45c4ff(_0x4f7fa9[_0x7e03('0xf')][_0x7e03('0x11')]);}else{logger[_0x7e03('0xb')](_0x7e03('0xc'),_0x2ec5ba,'request\x20sent');_0x45c4ff(_0x4f7fa9['result'][_0x7e03('0x11')]);}})[_0x7e03('0x12')](function(_0x205042){logger[_0x7e03('0xf')]('SalesforceField,\x20%s,\x20%s',_0x2ec5ba,_0x205042);_0x21e0a3(_0x205042);});});} \ No newline at end of file +var _0xaa3e=['../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','request\x20sent','debug','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring'];(function(_0x4c496a,_0x1d5dfc){var _0x85c328=function(_0x6d08fd){while(--_0x6d08fd){_0x4c496a['push'](_0x4c496a['shift']());}};_0x85c328(++_0x1d5dfc);}(_0xaa3e,0x1b4));var _0xeaa3=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xaa3e[_0x3ff685];return _0x2046c9;};'use strict';var _=require(_0xeaa3('0x0'));var util=require(_0xeaa3('0x1'));var moment=require(_0xeaa3('0x2'));var BPromise=require('bluebird');var rs=require(_0xeaa3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaa3('0x4'))['db'];var utils=require(_0xeaa3('0x5'));var logger=require(_0xeaa3('0x6'))(_0xeaa3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41f1da,_0x2dbf34,_0x99f376){return new BPromise(function(_0x4a772d,_0x45e347){return client[_0xeaa3('0x8')](_0x41f1da,_0x99f376)[_0xeaa3('0x9')](function(_0x58f15d){logger['info']('SalesforceField,\x20%s,\x20%s',_0x2dbf34,_0xeaa3('0xa'));logger[_0xeaa3('0xb')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x2dbf34,'request\x20sent',JSON[_0xeaa3('0xc')](_0x58f15d));if(_0x58f15d['error']){if(_0x58f15d[_0xeaa3('0xd')][_0xeaa3('0xe')]===0x1f4){logger[_0xeaa3('0xd')]('SalesforceField,\x20%s,\x20%s',_0x2dbf34,_0x58f15d[_0xeaa3('0xd')]['message']);return _0x45e347(_0x58f15d[_0xeaa3('0xd')][_0xeaa3('0xf')]);}logger[_0xeaa3('0xd')](_0xeaa3('0x10'),_0x2dbf34,_0x58f15d['error'][_0xeaa3('0xf')]);return _0x4a772d(_0x58f15d['error'][_0xeaa3('0xf')]);}else{logger[_0xeaa3('0x11')](_0xeaa3('0x10'),_0x2dbf34,'request\x20sent');_0x4a772d(_0x58f15d[_0xeaa3('0x12')]['message']);}})[_0xeaa3('0x13')](function(_0x4bdbf1){logger[_0xeaa3('0xd')](_0xeaa3('0x10'),_0x2dbf34,_0x4bdbf1);_0x45e347(_0x4bdbf1);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index ecccccf..ef91458 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 _0x7a35=['./intServicenowAccount.controller','isAuthenticated','index','/:id','show','getConfigurations','get','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x10c552,_0x4bca08){var _0x58572b=function(_0x2df4c8){while(--_0x2df4c8){_0x10c552['push'](_0x10c552['shift']());}};_0x58572b(++_0x4bca08);}(_0x7a35,0x88));var _0x57a3=function(_0x40baf1,_0x39a1e3){_0x40baf1=_0x40baf1-0x0;var _0x293477=_0x7a35[_0x40baf1];return _0x293477;};'use strict';var multer=require('multer');var util=require(_0x57a3('0x0'));var path=require(_0x57a3('0x1'));var timeout=require(_0x57a3('0x2'));var express=require(_0x57a3('0x3'));var router=express[_0x57a3('0x4')]();var auth=require(_0x57a3('0x5'));var interaction=require(_0x57a3('0x6'));var config=require(_0x57a3('0x7'));var controller=require(_0x57a3('0x8'));router['get']('/',auth[_0x57a3('0x9')](),controller[_0x57a3('0xa')]);router['get'](_0x57a3('0xb'),auth['isAuthenticated'](),controller[_0x57a3('0xc')]);router['get']('/:id/configurations',auth[_0x57a3('0x9')](),controller[_0x57a3('0xd')]);router[_0x57a3('0xe')](_0x57a3('0xf'),auth[_0x57a3('0x9')](),controller[_0x57a3('0x10')]);router[_0x57a3('0x11')]('/',auth[_0x57a3('0x9')](),controller[_0x57a3('0x12')]);router[_0x57a3('0x11')]('/:id/configurations',auth[_0x57a3('0x9')](),controller[_0x57a3('0x13')]);router[_0x57a3('0x14')](_0x57a3('0xb'),auth[_0x57a3('0x9')](),controller['update']);router[_0x57a3('0x15')](_0x57a3('0xb'),auth[_0x57a3('0x9')](),controller[_0x57a3('0x16')]);module[_0x57a3('0x17')]=router; \ No newline at end of file +var _0xd75b=['get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xd75b,0x66));var _0xbd75=function(_0x296905,_0x3e8b5b){_0x296905=_0x296905-0x0;var _0x522424=_0xd75b[_0x296905];return _0x522424;};'use strict';var multer=require(_0xbd75('0x0'));var util=require('util');var path=require(_0xbd75('0x1'));var timeout=require(_0xbd75('0x2'));var express=require(_0xbd75('0x3'));var router=express[_0xbd75('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbd75('0x5'));var config=require(_0xbd75('0x6'));var controller=require(_0xbd75('0x7'));router[_0xbd75('0x8')]('/',auth[_0xbd75('0x9')](),controller[_0xbd75('0xa')]);router['get'](_0xbd75('0xb'),auth[_0xbd75('0x9')](),controller['show']);router[_0xbd75('0x8')](_0xbd75('0xc'),auth[_0xbd75('0x9')](),controller[_0xbd75('0xd')]);router[_0xbd75('0x8')](_0xbd75('0xe'),auth[_0xbd75('0x9')](),controller[_0xbd75('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd75('0x10')]);router[_0xbd75('0x11')](_0xbd75('0xc'),auth[_0xbd75('0x9')](),controller[_0xbd75('0x12')]);router['put']('/:id',auth[_0xbd75('0x9')](),controller[_0xbd75('0x13')]);router['delete']('/:id',auth[_0xbd75('0x9')](),controller[_0xbd75('0x14')]);module[_0xbd75('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 9eea2e2..93a5ea9 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 _0x1d2d=['sequelize','exports','STRING','remoteUri'];(function(_0x21f83c,_0x309e0c){var _0x4a15f2=function(_0x3ef5c6){while(--_0x3ef5c6){_0x21f83c['push'](_0x21f83c['shift']());}};_0x4a15f2(++_0x309e0c);}(_0x1d2d,0xf0));var _0xd1d2=function(_0xb05127,_0x204f6b){_0xb05127=_0xb05127-0x0;var _0x3eed33=_0x1d2d[_0xb05127];return _0x3eed33;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module[_0xd1d2('0x1')]={'name':{'type':Sequelize[_0xd1d2('0x2')]},'description':{'type':Sequelize[_0xd1d2('0x2')]},'username':{'type':Sequelize[_0xd1d2('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xd1d2('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd1d2('0x3')},'serverUrl':{'type':Sequelize[_0xd1d2('0x2')]}}; \ No newline at end of file +var _0x579c=['STRING','remoteUri','sequelize','exports'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x579c,0xda));var _0xc579=function(_0x71ef5c,_0x7b5528){_0x71ef5c=_0x71ef5c-0x0;var _0x1d34d0=_0x579c[_0x71ef5c];return _0x1d34d0;};'use strict';var Sequelize=require(_0xc579('0x0'));module[_0xc579('0x1')]={'name':{'type':Sequelize[_0xc579('0x2')]},'description':{'type':Sequelize[_0xc579('0x2')]},'username':{'type':Sequelize[_0xc579('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xc579('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc579('0x2')],'unique':_0xc579('0x3')},'serverUrl':{'type':Sequelize[_0xc579('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 1a9430c..a559387 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 _0x57ca=['Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','notify','incident_state','severity','category','made_sla','caused_by','watch_list','sys_updated_on','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','business_duration','work_end','resolved_at','caller_id','approval_set','subcategory','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','sys_mod_count','reopen_count','upon_approval','location','password','serverUrl','remoteUri','slice','format','%s/api/now/table/','log','assign','remove','forEach','label','all','push','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','false','GET','inactive','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','stack','name','send','rawAttributes','model','keys','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','map','type','field','filter','merge','options','ServicenowAccount','include','findAll','show','params','intersection','includeAll','create','body','find','getConfigurations','ServicenowConfiguration','length','order','addConfiguration','findOne','AccountId','Subjects','channel'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x57ca,0x108));var _0xa57c=function(_0x40ca6e,_0x59b87d){_0x40ca6e=_0x40ca6e-0x0;var _0x4b1273=_0x57ca[_0x40ca6e];return _0x4b1273;};'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 authService=require(_0xa57c('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xa57c('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xa57c('0x12'))(_0xa57c('0x13'));var utils=require('../../config/utils');var config=require(_0xa57c('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa57c('0x15'));var jayson=require(_0xa57c('0x16'));var client=jayson[_0xa57c('0x17')][_0xa57c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x205e72,_0x57a546,_0x2644a1,_0x546cde){return new BPromise(function(_0x30d23d,_0x3d5995){var _0x30940d=_0x546cde||client;return _0x30940d[_0xa57c('0x19')](_0x205e72,_0x2644a1)[_0xa57c('0x1a')](function(_0x37a323){logger[_0xa57c('0x1b')]('ServicenowAccount,\x20%s,\x20%s',_0x57a546,_0xa57c('0x1c'));logger[_0xa57c('0x1d')](_0xa57c('0x1e'),_0x57a546,'request\x20sent',JSON[_0xa57c('0x1f')](_0x37a323));if(_0x37a323['error']){if(_0x37a323[_0xa57c('0x20')][_0xa57c('0x21')]===0x1f4){logger[_0xa57c('0x20')](_0xa57c('0x22'),_0x57a546,_0x37a323[_0xa57c('0x20')][_0xa57c('0x23')]);return _0x3d5995(_0x37a323[_0xa57c('0x20')][_0xa57c('0x23')]);}logger['error'](_0xa57c('0x22'),_0x57a546,_0x37a323['error']['message']);return _0x30d23d(_0x37a323[_0xa57c('0x20')][_0xa57c('0x23')]);}else{logger[_0xa57c('0x1b')](_0xa57c('0x22'),_0x57a546,'request\x20sent');_0x30d23d(_0x37a323[_0xa57c('0x24')][_0xa57c('0x23')]);}})[_0xa57c('0x25')](function(_0x2213b2){logger[_0xa57c('0x20')](_0xa57c('0x22'),_0x57a546,_0x2213b2);_0x3d5995(_0x2213b2);});});}function respondWithStatusCode(_0x1e0192,_0x42038e){_0x42038e=_0x42038e||0xcc;return function(_0x2e99ed){if(_0x2e99ed){return _0x1e0192[_0xa57c('0x26')](_0x42038e);}return _0x1e0192[_0xa57c('0x27')](_0x42038e)[_0xa57c('0x28')]();};}function respondWithResult(_0x241dcc,_0x10a33d){_0x10a33d=_0x10a33d||0xc8;return function(_0x431bec){if(_0x431bec){return _0x241dcc['status'](_0x10a33d)[_0xa57c('0x29')](_0x431bec);}};}function respondWithFilteredResult(_0x5226d0,_0x27884d){return function(_0x5228b9){if(_0x5228b9){var _0x315ad7=_0x5228b9[_0xa57c('0x2a')],_0x1e8e45=_0x27884d[_0xa57c('0x2b')],_0x8ee1c0=_0x27884d['offset']+_0x27884d[_0xa57c('0x2c')],_0xe50fb8;if(_0x8ee1c0>=_0x315ad7){_0x8ee1c0=_0x315ad7;_0xe50fb8=0xc8;}else{_0xe50fb8=0xce;}_0x5226d0['status'](_0xe50fb8);return _0x5226d0['set'](_0xa57c('0x2d'),_0x1e8e45+'-'+_0x8ee1c0+'/'+_0x315ad7)[_0xa57c('0x29')](_0x5228b9);}return null;};}function patchUpdates(_0x5a3e03){return function(_0x12898b){try{jsonpatch[_0xa57c('0x2e')](_0x12898b,_0x5a3e03,!![]);}catch(_0x3eb9e9){return BPromise['reject'](_0x3eb9e9);}return _0x12898b[_0xa57c('0x2f')]();};}function saveUpdates(_0x58d46f,_0xf5f70c){return function(_0x5464f2){if(_0x5464f2){return _0x5464f2[_0xa57c('0x30')](_0x58d46f)['then'](function(_0xd4c5d4){return _0xd4c5d4;});}return null;};}function removeEntity(_0x532164,_0x9e02bb){return function(_0x1d82d9){if(_0x1d82d9){return _0x1d82d9[_0xa57c('0x31')]()[_0xa57c('0x1a')](function(){_0x532164[_0xa57c('0x27')](0xcc)[_0xa57c('0x28')]();});}};}function handleEntityNotFound(_0x4f45c7,_0x5aa91e){return function(_0x10cc39){if(!_0x10cc39){_0x4f45c7['sendStatus'](0x194);}return _0x10cc39;};}function handleError(_0xbece0a,_0x315787){_0x315787=_0x315787||0x1f4;return function(_0x27ada0){logger['error'](_0x27ada0[_0xa57c('0x32')]);if(_0x27ada0['name']){delete _0x27ada0[_0xa57c('0x33')];}_0xbece0a['status'](_0x315787)[_0xa57c('0x34')](_0x27ada0);};}exports['index']=function(_0x433116,_0x46f03d){var _0x4903ae={},_0x3b8d17={},_0x47b65c={'count':0x0,'rows':[]};var _0x1eeeb8=db['ServicenowAccount'][_0xa57c('0x35')];_0x3b8d17[_0xa57c('0x36')]=_[_0xa57c('0x37')](_0x1eeeb8);_0x3b8d17[_0xa57c('0x38')]=_[_0xa57c('0x37')](_0x433116[_0xa57c('0x38')]);_0x3b8d17['filters']=_['intersection'](_0x3b8d17[_0xa57c('0x36')],_0x3b8d17[_0xa57c('0x38')]);_0x4903ae[_0xa57c('0x39')]=_['intersection'](_0x3b8d17[_0xa57c('0x36')],qs['fields'](_0x433116[_0xa57c('0x38')][_0xa57c('0x3a')]));_0x4903ae['attributes']=_0x4903ae['attributes']['length']?_0x4903ae[_0xa57c('0x39')]:_0x3b8d17[_0xa57c('0x36')];if(!_0x433116[_0xa57c('0x38')][_0xa57c('0x3b')](_0xa57c('0x3c'))){_0x4903ae[_0xa57c('0x2c')]=qs['limit'](_0x433116[_0xa57c('0x38')][_0xa57c('0x2c')]);_0x4903ae['offset']=qs['offset'](_0x433116[_0xa57c('0x38')][_0xa57c('0x2b')]);}_0x4903ae['order']=qs[_0xa57c('0x3d')](_0x433116[_0xa57c('0x38')][_0xa57c('0x3d')]);_0x4903ae[_0xa57c('0x3e')]=qs[_0xa57c('0x3f')](_[_0xa57c('0x40')](_0x433116['query'],_0x3b8d17[_0xa57c('0x3f')]));if(_0x433116['query']['filter']){_0x4903ae['where']=_['merge'](_0x4903ae['where'],{'$or':_[_0xa57c('0x41')](_0x1eeeb8,function(_0x32ed25){if(_0x32ed25[_0xa57c('0x42')]['key']!=='VIRTUAL'){var _0x49e072={};_0x49e072[_0x32ed25[_0xa57c('0x43')]]={'$like':'%'+_0x433116[_0xa57c('0x38')][_0xa57c('0x44')]+'%'};return _0x49e072;}})});}_0x4903ae=_[_0xa57c('0x45')]({},_0x4903ae,_0x433116[_0xa57c('0x46')]);var _0x17c5dd={'where':_0x4903ae['where']};return db[_0xa57c('0x47')][_0xa57c('0x2a')](_0x17c5dd)[_0xa57c('0x1a')](function(_0x3a3a4a){_0x47b65c[_0xa57c('0x2a')]=_0x3a3a4a;if(_0x433116[_0xa57c('0x38')]['includeAll']){_0x4903ae[_0xa57c('0x48')]=[{'all':!![]}];}return db[_0xa57c('0x47')][_0xa57c('0x49')](_0x4903ae);})[_0xa57c('0x1a')](function(_0x269dfd){_0x47b65c['rows']=_0x269dfd;return _0x47b65c;})[_0xa57c('0x1a')](respondWithFilteredResult(_0x46f03d,_0x4903ae))[_0xa57c('0x25')](handleError(_0x46f03d,null));};exports[_0xa57c('0x4a')]=function(_0x17aae4,_0x7ba8ab){var _0x11fccc={'raw':![],'where':{'id':_0x17aae4[_0xa57c('0x4b')]['id']}},_0x5e155a={};_0x5e155a[_0xa57c('0x36')]=_[_0xa57c('0x37')](db[_0xa57c('0x47')][_0xa57c('0x35')]);_0x5e155a[_0xa57c('0x38')]=_['keys'](_0x17aae4['query']);_0x5e155a['filters']=_['intersection'](_0x5e155a[_0xa57c('0x36')],_0x5e155a['query']);_0x11fccc[_0xa57c('0x39')]=_[_0xa57c('0x4c')](_0x5e155a['model'],qs[_0xa57c('0x3a')](_0x17aae4[_0xa57c('0x38')][_0xa57c('0x3a')]));_0x11fccc[_0xa57c('0x39')]=_0x11fccc[_0xa57c('0x39')]['length']?_0x11fccc[_0xa57c('0x39')]:_0x5e155a[_0xa57c('0x36')];if(_0x17aae4[_0xa57c('0x38')][_0xa57c('0x4d')]){_0x11fccc[_0xa57c('0x48')]=[{'all':!![]}];}_0x11fccc=_['merge']({},_0x11fccc,_0x17aae4[_0xa57c('0x46')]);return db['ServicenowAccount']['find'](_0x11fccc)[_0xa57c('0x1a')](handleEntityNotFound(_0x7ba8ab,null))[_0xa57c('0x1a')](respondWithResult(_0x7ba8ab,null))[_0xa57c('0x25')](handleError(_0x7ba8ab,null));};exports['create']=function(_0x56d36c,_0x10c281){return db[_0xa57c('0x47')][_0xa57c('0x4e')](_0x56d36c[_0xa57c('0x4f')],{})['then'](respondWithResult(_0x10c281,0xc9))[_0xa57c('0x25')](handleError(_0x10c281,null));};exports[_0xa57c('0x30')]=function(_0xe8c63e,_0x59eadc){if(_0xe8c63e['body']['id']){delete _0xe8c63e[_0xa57c('0x4f')]['id'];}return db[_0xa57c('0x47')]['find']({'where':{'id':_0xe8c63e[_0xa57c('0x4b')]['id']}})[_0xa57c('0x1a')](handleEntityNotFound(_0x59eadc,null))[_0xa57c('0x1a')](saveUpdates(_0xe8c63e[_0xa57c('0x4f')],null))[_0xa57c('0x1a')](respondWithResult(_0x59eadc,null))[_0xa57c('0x25')](handleError(_0x59eadc,null));};exports[_0xa57c('0x31')]=function(_0x4ee02a,_0x523a79){return db[_0xa57c('0x47')][_0xa57c('0x50')]({'where':{'id':_0x4ee02a[_0xa57c('0x4b')]['id']}})[_0xa57c('0x1a')](handleEntityNotFound(_0x523a79,null))[_0xa57c('0x1a')](removeEntity(_0x523a79,null))[_0xa57c('0x25')](handleError(_0x523a79,null));};exports[_0xa57c('0x51')]=function(_0x4519a0,_0x522d0e,_0x4da028){var _0x28997e={};var _0x4e18ad={};var _0x1880e6;var _0x1da3ef;return db[_0xa57c('0x47')]['findOne']({'where':{'id':_0x4519a0[_0xa57c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x522d0e,null))[_0xa57c('0x1a')](function(_0x4b3416){if(_0x4b3416){_0x1880e6=_0x4b3416;_0x4e18ad[_0xa57c('0x36')]=_[_0xa57c('0x37')](db[_0xa57c('0x52')][_0xa57c('0x35')]);_0x4e18ad['query']=_[_0xa57c('0x37')](_0x4519a0[_0xa57c('0x38')]);_0x4e18ad[_0xa57c('0x3f')]=_[_0xa57c('0x4c')](_0x4e18ad[_0xa57c('0x36')],_0x4e18ad['query']);_0x28997e[_0xa57c('0x39')]=_[_0xa57c('0x4c')](_0x4e18ad[_0xa57c('0x36')],qs[_0xa57c('0x3a')](_0x4519a0[_0xa57c('0x38')][_0xa57c('0x3a')]));_0x28997e[_0xa57c('0x39')]=_0x28997e[_0xa57c('0x39')][_0xa57c('0x53')]?_0x28997e[_0xa57c('0x39')]:_0x4e18ad['model'];_0x28997e[_0xa57c('0x54')]=qs[_0xa57c('0x3d')](_0x4519a0[_0xa57c('0x38')][_0xa57c('0x3d')]);_0x28997e[_0xa57c('0x3e')]=qs[_0xa57c('0x3f')](_['pick'](_0x4519a0[_0xa57c('0x38')],_0x4e18ad[_0xa57c('0x3f')]));if(_0x4519a0['query'][_0xa57c('0x44')]){_0x28997e[_0xa57c('0x3e')]=_[_0xa57c('0x45')](_0x28997e[_0xa57c('0x3e')],{'$or':_[_0xa57c('0x41')](_0x28997e[_0xa57c('0x39')],function(_0x24efa0){var _0x5e1103={};_0x5e1103[_0x24efa0]={'$like':'%'+_0x4519a0[_0xa57c('0x38')]['filter']+'%'};return _0x5e1103;})});}_0x28997e=_[_0xa57c('0x45')]({},_0x28997e,_0x4519a0['options']);return _0x1880e6[_0xa57c('0x51')](_0x28997e);}})['then'](function(_0x3ef1f1){if(_0x3ef1f1){_0x1da3ef=_0x3ef1f1[_0xa57c('0x53')];if(!_0x4519a0['query'][_0xa57c('0x3b')](_0xa57c('0x3c'))){_0x28997e[_0xa57c('0x2c')]=qs[_0xa57c('0x2c')](_0x4519a0['query'][_0xa57c('0x2c')]);_0x28997e[_0xa57c('0x2b')]=qs[_0xa57c('0x2b')](_0x4519a0[_0xa57c('0x38')][_0xa57c('0x2b')]);}return _0x1880e6[_0xa57c('0x51')](_0x28997e);}})[_0xa57c('0x1a')](function(_0x2a5983){if(_0x2a5983){return _0x2a5983?{'count':_0x1da3ef,'rows':_0x2a5983}:null;}})[_0xa57c('0x1a')](respondWithResult(_0x522d0e,null))[_0xa57c('0x25')](handleError(_0x522d0e,null));};exports[_0xa57c('0x55')]=function(_0x399968,_0x27ab1b,_0x83e9c7){if(_0x399968[_0xa57c('0x4f')]['id']){delete _0x399968[_0xa57c('0x4f')]['id'];}return db['ServicenowAccount'][_0xa57c('0x56')]({'where':{'id':_0x399968['params']['id']}})[_0xa57c('0x1a')](handleEntityNotFound(_0x27ab1b,null))[_0xa57c('0x1a')](function(_0x245238){if(_0x245238){_0x399968['body'][_0xa57c('0x57')]=_0x245238['id'];_0x399968[_0xa57c('0x4f')][_0xa57c('0x58')]=integrations['getSubjects'](_0x399968['body'][_0xa57c('0x59')],_0x399968[_0xa57c('0x4f')][_0xa57c('0x42')]);_0x399968[_0xa57c('0x4f')][_0xa57c('0x5a')]=integrations[_0xa57c('0x5b')](_0x399968[_0xa57c('0x4f')][_0xa57c('0x59')],_0x399968[_0xa57c('0x4f')]['type']);return db[_0xa57c('0x52')][_0xa57c('0x4e')](_0x399968['body'],{'include':[{'model':db[_0xa57c('0x5c')],'as':_0xa57c('0x58')},{'model':db[_0xa57c('0x5c')],'as':_0xa57c('0x5a')}]});}return null;})[_0xa57c('0x1a')](respondWithResult(_0x27ab1b,null))[_0xa57c('0x25')](handleError(_0x27ab1b,null));};exports[_0xa57c('0x5d')]=function(_0x10616e,_0x5a457d,_0x2960fd){var _0x29bf7f=['made_sla',_0xa57c('0x5e'),_0xa57c('0x5f'),'subcategory','close_code',_0xa57c('0x60'),_0xa57c('0x61'),_0xa57c('0x62'),_0xa57c('0x63')];var _0x45b211=['parent',_0xa57c('0x64'),_0xa57c('0x65'),_0xa57c('0x66'),'upon_reject',_0xa57c('0x67'),'child_incidents',_0xa57c('0x5e'),_0xa57c('0x68'),_0xa57c('0x69'),_0xa57c('0x6a'),'sys_updated_by',_0xa57c('0x6b'),_0xa57c('0x6c'),_0xa57c('0x6d'),_0xa57c('0x6e'),'state',_0xa57c('0x6f'),_0xa57c('0x5f'),_0xa57c('0x54'),'calendar_stc',_0xa57c('0x70'),_0xa57c('0x71'),_0xa57c('0x72'),'impact',_0xa57c('0x73'),_0xa57c('0x74'),_0xa57c('0x75'),_0xa57c('0x76'),'sys_domain_path',_0xa57c('0x77'),_0xa57c('0x78'),'expected_start',_0xa57c('0x79'),_0xa57c('0x7a'),'group_list',_0xa57c('0x7b'),'reopened_time',_0xa57c('0x7c'),_0xa57c('0x7d'),_0xa57c('0x7e'),_0xa57c('0x7f'),'work_notes',_0xa57c('0x80'),_0xa57c('0x81'),_0xa57c('0x82'),_0xa57c('0x83'),_0xa57c('0x84'),_0xa57c('0x85'),_0xa57c('0x86'),_0xa57c('0x87'),_0xa57c('0x88'),_0xa57c('0x89'),_0xa57c('0x60'),'sys_class_name','close_notes','closed_by',_0xa57c('0x8a'),'parent_incident',_0xa57c('0x8b'),_0xa57c('0x8c'),_0xa57c('0x8d'),'incident_state',_0xa57c('0x8e'),_0xa57c('0x8f'),_0xa57c('0x90'),_0xa57c('0x91'),_0xa57c('0x92'),_0xa57c('0x93'),_0xa57c('0x62'),'comments',_0xa57c('0x94'),_0xa57c('0x95'),'comments_and_work_notes','due_date',_0xa57c('0x96'),_0xa57c('0x97'),'sys_tags','escalation',_0xa57c('0x98'),'correlation_id',_0xa57c('0x99'),_0xa57c('0x63')];var _0x4962c9='';var _0x1cda66='';var _0x1706f1=[];var _0x44558f='';var _0x3df8f5='';var _0x562e79=[];var _0x4dd551='';var _0x17fc78='';var _0x4f7260={};var _0x30838d='';return db[_0xa57c('0x47')]['findOne']({'where':{'id':_0x10616e['params']['id']},'attributes':['id','username',_0xa57c('0x9a'),'email','remoteUri',_0xa57c('0x9b')]})[_0xa57c('0x1a')](handleEntityNotFound(_0x5a457d,null))[_0xa57c('0x1a')](function(_0x49d03b){if(_0x49d03b){_0x30838d=_0x49d03b[_0xa57c('0x9c')];var _0x1f28e9=_0x30838d[_0xa57c('0x9d')](-0x1);if(_0x1f28e9==='/'){_0x30838d=_0x30838d['substring'](0x0,_0x30838d['lastIndexOf'](_0x1f28e9));}_0x17fc78=util[_0xa57c('0x9e')]('%s/api/now/doc/table/schema/',_0x30838d);_0x4dd551=util[_0xa57c('0x9e')](_0xa57c('0x9f'),_0x30838d);_0x4f7260={'user':_0x49d03b['username'],'pass':_0x49d03b[_0xa57c('0x9a')]};var _0x55261e={'method':'GET','uri':_0x17fc78+'incident?sysparm_display_value=all','auth':_0x4f7260,'json':!![]};return rp(_0x55261e);}})[_0xa57c('0x1a')](function(_0x4985bb){if(_0x4985bb['result']['length']>0x0){_0x4962c9=_0x4985bb[_0xa57c('0x24')];}console[_0xa57c('0xa0')]('incident\x20table\x20objects',_0x4962c9);_0x562e79=[];_0x1cda66=Object[_0xa57c('0xa1')]([],_0x4962c9);_[_0xa57c('0xa2')](_0x1cda66,function(_0x25298c){return!_0x29bf7f['includes'](_0x25298c[_0xa57c('0x33')]);});_0x1cda66[_0xa57c('0xa3')](function(_0x997b84){var _0x16b727=createFieldObject(_0x4dd551,_0x4f7260,_0x997b84['internalType'],_0x997b84['name'],_0x997b84[_0xa57c('0xa4')],![]);_0x562e79['push'](_0x16b727);});return Promise[_0xa57c('0xa5')](_0x562e79);})[_0xa57c('0x1a')](function(_0x2cc12b){_0x1706f1=_0x2cc12b;_0x44558f=Object['assign']([],_0x4962c9);console[_0xa57c('0xa0')]('TCL:\x20_object',_0x4962c9);_['remove'](_0x44558f,function(_0x193e63){return _0x45b211['includes'](_0x193e63[_0xa57c('0x33')]);});console[_0xa57c('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x44558f);_0x562e79=[];_0x44558f['forEach'](function(_0x46fbea){var _0x3142d1=createFieldObject(_0x4dd551,_0x4f7260,_0x46fbea['internalType'],_0x46fbea['name'],_0x46fbea[_0xa57c('0xa4')],!![]);_0x562e79[_0xa57c('0xa6')](_0x3142d1);});return Promise[_0xa57c('0xa5')](_0x562e79);})['then'](function(_0xa179c7){_0x3df8f5=_0xa179c7;var _0x10f8b4=_0x1706f1[_0xa57c('0xa7')](_0x3df8f5);return{'count':_0x10f8b4[_0xa57c('0x53')],'rows':_0x10f8b4};})[_0xa57c('0x1a')](respondWithResult(_0x5a457d,null))[_0xa57c('0x25')](function(_0x10f1b5){console[_0xa57c('0xa0')](_0xa57c('0xa8')+_0x10f1b5);var _0x75888e=_0x10616e[_0xa57c('0x38')][_0xa57c('0xa9')]?0x1f4:_0x10f1b5[_0xa57c('0xaa')]||0x1f4;logger['error'](_0x10f1b5[_0xa57c('0x32')]);delete _0x10f1b5[_0xa57c('0x33')];if(_0x75888e===0x191){_0x75888e=0x190;}_0x5a457d[_0xa57c('0x27')](_0x75888e)[_0xa57c('0x34')](_0x10616e[_0xa57c('0x38')][_0xa57c('0xa9')]?{'message':'Wrong\x20credentials','statusCode':_0x10f1b5['statusCode']}:_0x10f1b5);});};function createFieldObject(_0x35efab,_0x58e922,_0x5e6ac5,_0x68c843,_0x138edd,_0x122522){return new Promise(function(_0x4baf82,_0x305ed0){var _0x15d761={'id':_0x68c843,'name':_0x138edd,'custom':_0x122522};if(_0x5e6ac5===_0xa57c('0xab')){_0x15d761[_0xa57c('0x46')]=[{'name':_0xa57c('0xac'),'value':'true'},{'name':'False','value':_0xa57c('0xad')}];_0x4baf82(_0x15d761);}else{var _0x113ced={'method':_0xa57c('0xae'),'uri':_0x35efab+'sys_choice?sysparm_query=name=incident^element='+_0x68c843,'auth':_0x58e922,'json':!![]};return rp(_0x113ced)[_0xa57c('0x1a')](function(_0x4e98c8){var _0x10add5=[];if(_0x4e98c8[_0xa57c('0x24')][_0xa57c('0x53')]>0x0){_0x4e98c8[_0xa57c('0x24')][_0xa57c('0xa3')](function(_0x80dfcb){if(_0x80dfcb[_0xa57c('0xaf')]==='false'){var _0x5649c8={'name':_0x80dfcb[_0xa57c('0xa4')],'value':_0x80dfcb[_0xa57c('0xb0')]};_0x10add5[_0xa57c('0xa6')](_0x5649c8);}});}_0x15d761['options']=_0x10add5;if(_0x15d761['options'][_0xa57c('0x53')]>0x0){_0x4baf82(_0x15d761);}else{if(_0x122522==![]){_0x4baf82();}else{_0x4baf82(_0x15d761);}}});}});} \ No newline at end of file +var _0xafc4=['hold_reason','subcategory','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','close_code','correlation_display','work_start','assignment_group','business_stc','description','calendar_duration','notify','sys_class_name','closed_by','follow_up','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','all','TCL:\x20_object','includes','forEach','internalType','label','concat','ServiceNow\x20error:\x20','test','statusCode','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','push','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','count','set','reject','save','update','destroy','stack','name','send','index','ServicenowAccount','rawAttributes','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ServicenowField','Descriptions','getFields','made_sla'];(function(_0x7472aa,_0x3971a1){var _0x12e552=function(_0x3c58d4){while(--_0x3c58d4){_0x7472aa['push'](_0x7472aa['shift']());}};_0x12e552(++_0x3971a1);}(_0xafc4,0x69));var _0x4afc=function(_0x402765,_0x530aaf){_0x402765=_0x402765-0x0;var _0x225bd2=_0xafc4[_0x402765];return _0x225bd2;};'use strict';var pdf=require(_0x4afc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4afc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4afc('0x2'));var rp=require(_0x4afc('0x3'));var moment=require(_0x4afc('0x4'));var BPromise=require(_0x4afc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4afc('0x6'));var csv=require(_0x4afc('0x7'));var ejs=require(_0x4afc('0x8'));var fs=require('fs');var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x7'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var authService=require(_0x4afc('0xf'));var hardwareService=require(_0x4afc('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x4afc('0x11'))('api');var utils=require(_0x4afc('0x12'));var config=require(_0x4afc('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4afc('0x14'));var jayson=require(_0x4afc('0x15'));var client=jayson[_0x4afc('0x16')][_0x4afc('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x1d8f98,_0x2f1c59,_0x1ad8fd,_0x23b03e){return new BPromise(function(_0x5effb4,_0x26f3f1){var _0x429fd8=_0x23b03e||client;return _0x429fd8[_0x4afc('0x18')](_0x1d8f98,_0x1ad8fd)[_0x4afc('0x19')](function(_0x5f2dc9){logger['info'](_0x4afc('0x1a'),_0x2f1c59,'request\x20sent');logger[_0x4afc('0x1b')](_0x4afc('0x1c'),_0x2f1c59,_0x4afc('0x1d'),JSON[_0x4afc('0x1e')](_0x5f2dc9));if(_0x5f2dc9[_0x4afc('0x1f')]){if(_0x5f2dc9[_0x4afc('0x1f')][_0x4afc('0x20')]===0x1f4){logger[_0x4afc('0x1f')](_0x4afc('0x1a'),_0x2f1c59,_0x5f2dc9[_0x4afc('0x1f')][_0x4afc('0x21')]);return _0x26f3f1(_0x5f2dc9['error'][_0x4afc('0x21')]);}logger[_0x4afc('0x1f')](_0x4afc('0x1a'),_0x2f1c59,_0x5f2dc9[_0x4afc('0x1f')]['message']);return _0x5effb4(_0x5f2dc9[_0x4afc('0x1f')][_0x4afc('0x21')]);}else{logger[_0x4afc('0x22')](_0x4afc('0x1a'),_0x2f1c59,_0x4afc('0x1d'));_0x5effb4(_0x5f2dc9[_0x4afc('0x23')][_0x4afc('0x21')]);}})['catch'](function(_0x5403e4){logger[_0x4afc('0x1f')]('ServicenowAccount,\x20%s,\x20%s',_0x2f1c59,_0x5403e4);_0x26f3f1(_0x5403e4);});});}function respondWithStatusCode(_0x37debf,_0x4e9a48){_0x4e9a48=_0x4e9a48||0xcc;return function(_0x1aa676){if(_0x1aa676){return _0x37debf[_0x4afc('0x24')](_0x4e9a48);}return _0x37debf[_0x4afc('0x25')](_0x4e9a48)[_0x4afc('0x26')]();};}function respondWithResult(_0x86dbd4,_0x28a86c){_0x28a86c=_0x28a86c||0xc8;return function(_0x40a0db){if(_0x40a0db){return _0x86dbd4[_0x4afc('0x25')](_0x28a86c)[_0x4afc('0x27')](_0x40a0db);}};}function respondWithFilteredResult(_0x100220,_0x4e8273){return function(_0x359c07){if(_0x359c07){var _0x35f5b3=_0x359c07[_0x4afc('0x28')],_0x55842c=_0x4e8273['offset'],_0xc3952e=_0x4e8273['offset']+_0x4e8273['limit'],_0x244f6c;if(_0xc3952e>=_0x35f5b3){_0xc3952e=_0x35f5b3;_0x244f6c=0xc8;}else{_0x244f6c=0xce;}_0x100220[_0x4afc('0x25')](_0x244f6c);return _0x100220[_0x4afc('0x29')]('Content-Range',_0x55842c+'-'+_0xc3952e+'/'+_0x35f5b3)[_0x4afc('0x27')](_0x359c07);}return null;};}function patchUpdates(_0x628e42){return function(_0x494fe7){try{jsonpatch['apply'](_0x494fe7,_0x628e42,!![]);}catch(_0x52e3dd){return BPromise[_0x4afc('0x2a')](_0x52e3dd);}return _0x494fe7[_0x4afc('0x2b')]();};}function saveUpdates(_0x17a43d,_0x46357b){return function(_0xc1d91){if(_0xc1d91){return _0xc1d91[_0x4afc('0x2c')](_0x17a43d)['then'](function(_0x290391){return _0x290391;});}return null;};}function removeEntity(_0x3d1693,_0x1ba6b5){return function(_0x2f178c){if(_0x2f178c){return _0x2f178c[_0x4afc('0x2d')]()[_0x4afc('0x19')](function(){_0x3d1693[_0x4afc('0x25')](0xcc)[_0x4afc('0x26')]();});}};}function handleEntityNotFound(_0x5ac7a8,_0x1383cf){return function(_0x51660d){if(!_0x51660d){_0x5ac7a8['sendStatus'](0x194);}return _0x51660d;};}function handleError(_0x324a12,_0x33ebbc){_0x33ebbc=_0x33ebbc||0x1f4;return function(_0x266f7f){logger[_0x4afc('0x1f')](_0x266f7f[_0x4afc('0x2e')]);if(_0x266f7f[_0x4afc('0x2f')]){delete _0x266f7f['name'];}_0x324a12[_0x4afc('0x25')](_0x33ebbc)[_0x4afc('0x30')](_0x266f7f);};}exports[_0x4afc('0x31')]=function(_0x127ac8,_0x3127e6){var _0x2f9d1c={},_0x48f0c6={},_0x22eea2={'count':0x0,'rows':[]};var _0x2ddce1=db[_0x4afc('0x32')][_0x4afc('0x33')];_0x48f0c6['model']=_['keys'](_0x2ddce1);_0x48f0c6[_0x4afc('0x34')]=_[_0x4afc('0x35')](_0x127ac8[_0x4afc('0x34')]);_0x48f0c6['filters']=_['intersection'](_0x48f0c6[_0x4afc('0x36')],_0x48f0c6['query']);_0x2f9d1c['attributes']=_[_0x4afc('0x37')](_0x48f0c6[_0x4afc('0x36')],qs[_0x4afc('0x38')](_0x127ac8[_0x4afc('0x34')][_0x4afc('0x38')]));_0x2f9d1c[_0x4afc('0x39')]=_0x2f9d1c[_0x4afc('0x39')][_0x4afc('0x3a')]?_0x2f9d1c[_0x4afc('0x39')]:_0x48f0c6[_0x4afc('0x36')];if(!_0x127ac8[_0x4afc('0x34')][_0x4afc('0x3b')](_0x4afc('0x3c'))){_0x2f9d1c[_0x4afc('0x3d')]=qs[_0x4afc('0x3d')](_0x127ac8['query'][_0x4afc('0x3d')]);_0x2f9d1c[_0x4afc('0x3e')]=qs[_0x4afc('0x3e')](_0x127ac8[_0x4afc('0x34')][_0x4afc('0x3e')]);}_0x2f9d1c[_0x4afc('0x3f')]=qs[_0x4afc('0x40')](_0x127ac8['query']['sort']);_0x2f9d1c['where']=qs[_0x4afc('0x41')](_[_0x4afc('0x42')](_0x127ac8['query'],_0x48f0c6[_0x4afc('0x41')]));if(_0x127ac8[_0x4afc('0x34')][_0x4afc('0x43')]){_0x2f9d1c[_0x4afc('0x44')]=_['merge'](_0x2f9d1c[_0x4afc('0x44')],{'$or':_[_0x4afc('0x45')](_0x2ddce1,function(_0x348bc1){if(_0x348bc1[_0x4afc('0x46')][_0x4afc('0x47')]!==_0x4afc('0x48')){var _0x51dca0={};_0x51dca0[_0x348bc1[_0x4afc('0x49')]]={'$like':'%'+_0x127ac8['query'][_0x4afc('0x43')]+'%'};return _0x51dca0;}})});}_0x2f9d1c=_[_0x4afc('0x4a')]({},_0x2f9d1c,_0x127ac8[_0x4afc('0x4b')]);var _0x5878eb={'where':_0x2f9d1c['where']};return db[_0x4afc('0x32')][_0x4afc('0x28')](_0x5878eb)[_0x4afc('0x19')](function(_0x12e97d){_0x22eea2[_0x4afc('0x28')]=_0x12e97d;if(_0x127ac8[_0x4afc('0x34')][_0x4afc('0x4c')]){_0x2f9d1c[_0x4afc('0x4d')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x4afc('0x4e')](_0x2f9d1c);})[_0x4afc('0x19')](function(_0x4c1be5){_0x22eea2[_0x4afc('0x4f')]=_0x4c1be5;return _0x22eea2;})['then'](respondWithFilteredResult(_0x3127e6,_0x2f9d1c))[_0x4afc('0x50')](handleError(_0x3127e6,null));};exports[_0x4afc('0x51')]=function(_0x16c6c4,_0x5e0ebd){var _0xd0f517={'raw':![],'where':{'id':_0x16c6c4[_0x4afc('0x52')]['id']}},_0xe5a92={};_0xe5a92[_0x4afc('0x36')]=_[_0x4afc('0x35')](db[_0x4afc('0x32')]['rawAttributes']);_0xe5a92['query']=_['keys'](_0x16c6c4[_0x4afc('0x34')]);_0xe5a92[_0x4afc('0x41')]=_[_0x4afc('0x37')](_0xe5a92[_0x4afc('0x36')],_0xe5a92[_0x4afc('0x34')]);_0xd0f517[_0x4afc('0x39')]=_[_0x4afc('0x37')](_0xe5a92[_0x4afc('0x36')],qs[_0x4afc('0x38')](_0x16c6c4[_0x4afc('0x34')]['fields']));_0xd0f517[_0x4afc('0x39')]=_0xd0f517['attributes']['length']?_0xd0f517[_0x4afc('0x39')]:_0xe5a92['model'];if(_0x16c6c4[_0x4afc('0x34')][_0x4afc('0x4c')]){_0xd0f517[_0x4afc('0x4d')]=[{'all':!![]}];}_0xd0f517=_[_0x4afc('0x4a')]({},_0xd0f517,_0x16c6c4['options']);return db[_0x4afc('0x32')]['find'](_0xd0f517)[_0x4afc('0x19')](handleEntityNotFound(_0x5e0ebd,null))[_0x4afc('0x19')](respondWithResult(_0x5e0ebd,null))[_0x4afc('0x50')](handleError(_0x5e0ebd,null));};exports[_0x4afc('0x53')]=function(_0x25ffb3,_0xd46c35){return db[_0x4afc('0x32')][_0x4afc('0x53')](_0x25ffb3[_0x4afc('0x54')],{})[_0x4afc('0x19')](respondWithResult(_0xd46c35,0xc9))[_0x4afc('0x50')](handleError(_0xd46c35,null));};exports[_0x4afc('0x2c')]=function(_0x507bfc,_0x154fcb){if(_0x507bfc[_0x4afc('0x54')]['id']){delete _0x507bfc[_0x4afc('0x54')]['id'];}return db[_0x4afc('0x32')][_0x4afc('0x55')]({'where':{'id':_0x507bfc[_0x4afc('0x52')]['id']}})[_0x4afc('0x19')](handleEntityNotFound(_0x154fcb,null))[_0x4afc('0x19')](saveUpdates(_0x507bfc[_0x4afc('0x54')],null))[_0x4afc('0x19')](respondWithResult(_0x154fcb,null))[_0x4afc('0x50')](handleError(_0x154fcb,null));};exports[_0x4afc('0x2d')]=function(_0x1e03f5,_0x5c1421){return db[_0x4afc('0x32')]['find']({'where':{'id':_0x1e03f5[_0x4afc('0x52')]['id']}})[_0x4afc('0x19')](handleEntityNotFound(_0x5c1421,null))[_0x4afc('0x19')](removeEntity(_0x5c1421,null))[_0x4afc('0x50')](handleError(_0x5c1421,null));};exports['getConfigurations']=function(_0x486c23,_0x240ea8,_0x2f9790){var _0x5f16cb={};var _0x40021e={};var _0x3af52c;var _0xb1c023;return db[_0x4afc('0x32')][_0x4afc('0x56')]({'where':{'id':_0x486c23[_0x4afc('0x52')]['id']}})[_0x4afc('0x19')](handleEntityNotFound(_0x240ea8,null))[_0x4afc('0x19')](function(_0x24e1d3){if(_0x24e1d3){_0x3af52c=_0x24e1d3;_0x40021e[_0x4afc('0x36')]=_[_0x4afc('0x35')](db[_0x4afc('0x57')][_0x4afc('0x33')]);_0x40021e[_0x4afc('0x34')]=_['keys'](_0x486c23[_0x4afc('0x34')]);_0x40021e[_0x4afc('0x41')]=_[_0x4afc('0x37')](_0x40021e[_0x4afc('0x36')],_0x40021e[_0x4afc('0x34')]);_0x5f16cb[_0x4afc('0x39')]=_[_0x4afc('0x37')](_0x40021e['model'],qs[_0x4afc('0x38')](_0x486c23[_0x4afc('0x34')]['fields']));_0x5f16cb['attributes']=_0x5f16cb[_0x4afc('0x39')][_0x4afc('0x3a')]?_0x5f16cb[_0x4afc('0x39')]:_0x40021e[_0x4afc('0x36')];_0x5f16cb[_0x4afc('0x3f')]=qs[_0x4afc('0x40')](_0x486c23[_0x4afc('0x34')][_0x4afc('0x40')]);_0x5f16cb[_0x4afc('0x44')]=qs[_0x4afc('0x41')](_['pick'](_0x486c23['query'],_0x40021e[_0x4afc('0x41')]));if(_0x486c23[_0x4afc('0x34')]['filter']){_0x5f16cb[_0x4afc('0x44')]=_[_0x4afc('0x4a')](_0x5f16cb['where'],{'$or':_['map'](_0x5f16cb[_0x4afc('0x39')],function(_0x26f4ee){var _0x576ea0={};_0x576ea0[_0x26f4ee]={'$like':'%'+_0x486c23['query'][_0x4afc('0x43')]+'%'};return _0x576ea0;})});}_0x5f16cb=_['merge']({},_0x5f16cb,_0x486c23['options']);return _0x3af52c[_0x4afc('0x58')](_0x5f16cb);}})[_0x4afc('0x19')](function(_0x53f9ca){if(_0x53f9ca){_0xb1c023=_0x53f9ca[_0x4afc('0x3a')];if(!_0x486c23[_0x4afc('0x34')][_0x4afc('0x3b')](_0x4afc('0x3c'))){_0x5f16cb[_0x4afc('0x3d')]=qs[_0x4afc('0x3d')](_0x486c23['query'][_0x4afc('0x3d')]);_0x5f16cb[_0x4afc('0x3e')]=qs[_0x4afc('0x3e')](_0x486c23['query']['offset']);}return _0x3af52c['getConfigurations'](_0x5f16cb);}})[_0x4afc('0x19')](function(_0x135931){if(_0x135931){return _0x135931?{'count':_0xb1c023,'rows':_0x135931}:null;}})[_0x4afc('0x19')](respondWithResult(_0x240ea8,null))['catch'](handleError(_0x240ea8,null));};exports[_0x4afc('0x59')]=function(_0x548d02,_0x55b178,_0x54625e){if(_0x548d02[_0x4afc('0x54')]['id']){delete _0x548d02[_0x4afc('0x54')]['id'];}return db[_0x4afc('0x32')]['findOne']({'where':{'id':_0x548d02[_0x4afc('0x52')]['id']}})[_0x4afc('0x19')](handleEntityNotFound(_0x55b178,null))[_0x4afc('0x19')](function(_0x5e3e9b){if(_0x5e3e9b){_0x548d02[_0x4afc('0x54')][_0x4afc('0x5a')]=_0x5e3e9b['id'];_0x548d02[_0x4afc('0x54')][_0x4afc('0x5b')]=integrations[_0x4afc('0x5c')](_0x548d02['body']['channel'],_0x548d02[_0x4afc('0x54')][_0x4afc('0x46')]);_0x548d02[_0x4afc('0x54')]['Descriptions']=integrations[_0x4afc('0x5d')](_0x548d02[_0x4afc('0x54')][_0x4afc('0x5e')],_0x548d02[_0x4afc('0x54')][_0x4afc('0x46')]);return db['ServicenowConfiguration'][_0x4afc('0x53')](_0x548d02[_0x4afc('0x54')],{'include':[{'model':db['ServicenowField'],'as':_0x4afc('0x5b')},{'model':db[_0x4afc('0x5f')],'as':_0x4afc('0x60')}]});}return null;})['then'](respondWithResult(_0x55b178,null))[_0x4afc('0x50')](handleError(_0x55b178,null));};exports[_0x4afc('0x61')]=function(_0x83587,_0xd9ceac,_0x428c61){var _0x3c0339=[_0x4afc('0x62'),_0x4afc('0x63'),'knowledge',_0x4afc('0x64'),'close_code','notify',_0x4afc('0x65'),_0x4afc('0x66'),_0x4afc('0x67')];var _0x5908f0=['parent',_0x4afc('0x62'),_0x4afc('0x68'),_0x4afc('0x69'),_0x4afc('0x6a'),_0x4afc('0x6b'),_0x4afc('0x6c'),_0x4afc('0x63'),_0x4afc('0x6d'),_0x4afc('0x6e'),_0x4afc('0x6f'),_0x4afc('0x70'),_0x4afc('0x71'),_0x4afc('0x72'),_0x4afc('0x73'),_0x4afc('0x74'),_0x4afc('0x75'),'sys_created_by',_0x4afc('0x76'),_0x4afc('0x3f'),_0x4afc('0x77'),_0x4afc('0x78'),_0x4afc('0x79'),_0x4afc('0x7a'),_0x4afc('0x7b'),_0x4afc('0x7c'),_0x4afc('0x7d'),'business_service',_0x4afc('0x7e'),_0x4afc('0x7f'),_0x4afc('0x80'),_0x4afc('0x81'),'expected_start',_0x4afc('0x82'),_0x4afc('0x83'),_0x4afc('0x84'),_0x4afc('0x85'),_0x4afc('0x86'),_0x4afc('0x87'),_0x4afc('0x88'),_0x4afc('0x89'),_0x4afc('0x64'),_0x4afc('0x8a'),'short_description',_0x4afc('0x8b'),_0x4afc('0x8c'),'delivery_task',_0x4afc('0x8d'),_0x4afc('0x8e'),_0x4afc('0x8f'),'additional_assignee_list',_0x4afc('0x90'),_0x4afc('0x91'),_0x4afc('0x92'),_0x4afc('0x93'),'close_notes',_0x4afc('0x94'),_0x4afc('0x95'),'parent_incident',_0x4afc('0x96'),_0x4afc('0x97'),_0x4afc('0x98'),'incident_state','urgency',_0x4afc('0x99'),_0x4afc('0x9a'),_0x4afc('0x9b'),_0x4afc('0x9c'),_0x4afc('0x9d'),_0x4afc('0x66'),_0x4afc('0x9e'),_0x4afc('0x9f'),_0x4afc('0xa0'),_0x4afc('0xa1'),_0x4afc('0xa2'),_0x4afc('0xa3'),_0x4afc('0xa4'),_0x4afc('0xa5'),_0x4afc('0xa6'),_0x4afc('0xa7'),'correlation_id',_0x4afc('0xa8'),_0x4afc('0x67')];var _0x4b3823='';var _0xd8f88a='';var _0x4d92e6=[];var _0x4b93ea='';var _0x6ac9ae='';var _0x4ae14b=[];var _0x4a6509='';var _0x2a1efe='';var _0x529582={};var _0x1ca8fb='';return db['ServicenowAccount'][_0x4afc('0x56')]({'where':{'id':_0x83587[_0x4afc('0x52')]['id']},'attributes':['id',_0x4afc('0xa9'),_0x4afc('0xaa'),_0x4afc('0xab'),'remoteUri',_0x4afc('0xac')]})[_0x4afc('0x19')](handleEntityNotFound(_0xd9ceac,null))['then'](function(_0x4f97a4){if(_0x4f97a4){_0x1ca8fb=_0x4f97a4[_0x4afc('0xad')];var _0x1b6b80=_0x1ca8fb[_0x4afc('0xae')](-0x1);if(_0x1b6b80==='/'){_0x1ca8fb=_0x1ca8fb[_0x4afc('0xaf')](0x0,_0x1ca8fb[_0x4afc('0xb0')](_0x1b6b80));}_0x2a1efe=util['format'](_0x4afc('0xb1'),_0x1ca8fb);_0x4a6509=util[_0x4afc('0xb2')](_0x4afc('0xb3'),_0x1ca8fb);_0x529582={'user':_0x4f97a4[_0x4afc('0xa9')],'pass':_0x4f97a4['password']};var _0x114e0f={'method':'GET','uri':_0x2a1efe+_0x4afc('0xb4'),'auth':_0x529582,'json':!![]};return rp(_0x114e0f);}})[_0x4afc('0x19')](function(_0xbec1eb){if(_0xbec1eb[_0x4afc('0x23')][_0x4afc('0x3a')]>0x0){_0x4b3823=_0xbec1eb[_0x4afc('0x23')];}console[_0x4afc('0xb5')](_0x4afc('0xb6'),_0x4b3823);_0x4ae14b=[];_0xd8f88a=Object[_0x4afc('0xb7')]([],_0x4b3823);_[_0x4afc('0xb8')](_0xd8f88a,function(_0x27dd60){return!_0x3c0339['includes'](_0x27dd60[_0x4afc('0x2f')]);});_0xd8f88a['forEach'](function(_0x393a46){var _0x4b40db=createFieldObject(_0x4a6509,_0x529582,_0x393a46['internalType'],_0x393a46[_0x4afc('0x2f')],_0x393a46['label'],![]);_0x4ae14b['push'](_0x4b40db);});return Promise[_0x4afc('0xb9')](_0x4ae14b);})['then'](function(_0x272e36){_0x4d92e6=_0x272e36;_0x4b93ea=Object[_0x4afc('0xb7')]([],_0x4b3823);console['log'](_0x4afc('0xba'),_0x4b3823);_[_0x4afc('0xb8')](_0x4b93ea,function(_0x57366a){return _0x5908f0[_0x4afc('0xbb')](_0x57366a[_0x4afc('0x2f')]);});console[_0x4afc('0xb5')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4b93ea);_0x4ae14b=[];_0x4b93ea[_0x4afc('0xbc')](function(_0x298c87){var _0x40c7c8=createFieldObject(_0x4a6509,_0x529582,_0x298c87[_0x4afc('0xbd')],_0x298c87[_0x4afc('0x2f')],_0x298c87[_0x4afc('0xbe')],!![]);_0x4ae14b['push'](_0x40c7c8);});return Promise['all'](_0x4ae14b);})[_0x4afc('0x19')](function(_0x35d54b){_0x6ac9ae=_0x35d54b;var _0x4e95d4=_0x4d92e6[_0x4afc('0xbf')](_0x6ac9ae);return{'count':_0x4e95d4[_0x4afc('0x3a')],'rows':_0x4e95d4};})['then'](respondWithResult(_0xd9ceac,null))[_0x4afc('0x50')](function(_0x102fd8){console[_0x4afc('0xb5')](_0x4afc('0xc0')+_0x102fd8);var _0x2585b3=_0x83587['query'][_0x4afc('0xc1')]?0x1f4:_0x102fd8[_0x4afc('0xc2')]||0x1f4;logger[_0x4afc('0x1f')](_0x102fd8[_0x4afc('0x2e')]);delete _0x102fd8[_0x4afc('0x2f')];if(_0x2585b3===0x191){_0x2585b3=0x190;}_0xd9ceac['status'](_0x2585b3)[_0x4afc('0x30')](_0x83587[_0x4afc('0x34')][_0x4afc('0xc1')]?{'message':'Wrong\x20credentials','statusCode':_0x102fd8[_0x4afc('0xc2')]}:_0x102fd8);});};function createFieldObject(_0x1466e9,_0x5bcfa7,_0x530119,_0x4c27a2,_0x1119a9,_0xbd4a65){return new Promise(function(_0x4c81c1,_0x271311){var _0x46fe46={'id':_0x4c27a2,'name':_0x1119a9,'custom':_0xbd4a65};if(_0x530119==='boolean'){_0x46fe46[_0x4afc('0x4b')]=[{'name':_0x4afc('0xc3'),'value':_0x4afc('0xc4')},{'name':_0x4afc('0xc5'),'value':_0x4afc('0xc6')}];_0x4c81c1(_0x46fe46);}else{var _0x37387f={'method':_0x4afc('0xc7'),'uri':_0x1466e9+_0x4afc('0xc8')+_0x4c27a2,'auth':_0x5bcfa7,'json':!![]};return rp(_0x37387f)[_0x4afc('0x19')](function(_0x48dc45){var _0x33b16e=[];if(_0x48dc45[_0x4afc('0x23')][_0x4afc('0x3a')]>0x0){_0x48dc45[_0x4afc('0x23')]['forEach'](function(_0x20570b){if(_0x20570b[_0x4afc('0xc9')]==='false'){var _0x5d5f04={'name':_0x20570b['label'],'value':_0x20570b[_0x4afc('0xca')]};_0x33b16e[_0x4afc('0xcb')](_0x5d5f04);}});}_0x46fe46[_0x4afc('0x4b')]=_0x33b16e;if(_0x46fe46['options'][_0x4afc('0x3a')]>0x0){_0x4c81c1(_0x46fe46);}else{if(_0xbd4a65==![]){_0x4c81c1();}else{_0x4c81c1(_0x46fe46);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7b2a8ad..52d5749 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 _0x76f7=['request-promise','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','moment'];(function(_0x45e647,_0x2c482c){var _0x2deace=function(_0x12e383){while(--_0x12e383){_0x45e647['push'](_0x45e647['shift']());}};_0x2deace(++_0x2c482c);}(_0x76f7,0xd9));var _0x776f=function(_0x3387bf,_0x399fc0){_0x3387bf=_0x3387bf-0x0;var _0x50405b=_0x76f7[_0x3387bf];return _0x50405b;};'use strict';var _=require(_0x776f('0x0'));var util=require(_0x776f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x776f('0x2'));var BPromise=require('bluebird');var rp=require(_0x776f('0x3'));var attributes=require(_0x776f('0x4'));var integrations=require(_0x776f('0x5'));module[_0x776f('0x6')]=function(_0x4ff3d2,_0x254822){return _0x4ff3d2[_0x776f('0x7')](_0x776f('0x8'),attributes,{'tableName':_0x776f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef59=['exports','int_servicenow_accounts','lodash','../../config/logger','api','bluebird','../../components/integrations/configuration'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xef59,0x80));var _0x9ef5=function(_0x18a01c,_0xd1a13a){_0x18a01c=_0x18a01c-0x0;var _0x2b0cd6=_0xef59[_0x18a01c];return _0x2b0cd6;};'use strict';var _=require(_0x9ef5('0x0'));var util=require('util');var logger=require(_0x9ef5('0x1'))(_0x9ef5('0x2'));var moment=require('moment');var BPromise=require(_0x9ef5('0x3'));var rp=require('request-promise');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x9ef5('0x4'));module[_0x9ef5('0x5')]=function(_0x113aa0,_0x2ca87f){return _0x113aa0['define']('ServicenowAccount',attributes,{'tableName':_0x9ef5('0x6'),'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 eb17507..e5c1649 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 _0xaafb=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','include','map','model','ShowServicenowAccount'];(function(_0x19ba99,_0x44a14e){var _0x103179=function(_0x6e0456){while(--_0x6e0456){_0x19ba99['push'](_0x19ba99['shift']());}};_0x103179(++_0x44a14e);}(_0xaafb,0x176));var _0xbaaf=function(_0x3fde68,_0xad35d8){_0x3fde68=_0x3fde68-0x0;var _0x150236=_0xaafb[_0x3fde68];return _0x150236;};'use strict';var _=require('lodash');var util=require(_0xbaaf('0x0'));var moment=require(_0xbaaf('0x1'));var BPromise=require(_0xbaaf('0x2'));var rs=require(_0xbaaf('0x3'));var fs=require('fs');var Redis=require(_0xbaaf('0x4'));var db=require(_0xbaaf('0x5'))['db'];var utils=require(_0xbaaf('0x6'));var logger=require('../../config/logger')(_0xbaaf('0x7'));var config=require(_0xbaaf('0x8'));var jayson=require(_0xbaaf('0x9'));var client=jayson[_0xbaaf('0xa')][_0xbaaf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9fdfeb,_0x375d94,_0x45f8a3){return new BPromise(function(_0x2aa8c0,_0x409062){return client['request'](_0x9fdfeb,_0x45f8a3)[_0xbaaf('0xc')](function(_0xf29032){logger[_0xbaaf('0xd')](_0xbaaf('0xe'),_0x375d94,_0xbaaf('0xf'));logger[_0xbaaf('0x10')](_0xbaaf('0x11'),_0x375d94,_0xbaaf('0xf'),JSON[_0xbaaf('0x12')](_0xf29032));if(_0xf29032[_0xbaaf('0x13')]){if(_0xf29032[_0xbaaf('0x13')][_0xbaaf('0x14')]===0x1f4){logger['error'](_0xbaaf('0xe'),_0x375d94,_0xf29032[_0xbaaf('0x13')][_0xbaaf('0x15')]);return _0x409062(_0xf29032[_0xbaaf('0x13')][_0xbaaf('0x15')]);}logger[_0xbaaf('0x13')](_0xbaaf('0xe'),_0x375d94,_0xf29032['error'][_0xbaaf('0x15')]);return _0x2aa8c0(_0xf29032[_0xbaaf('0x13')][_0xbaaf('0x15')]);}else{logger[_0xbaaf('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x375d94,'request\x20sent');_0x2aa8c0(_0xf29032[_0xbaaf('0x16')][_0xbaaf('0x15')]);}})[_0xbaaf('0x17')](function(_0x1d3798){logger['error'](_0xbaaf('0xe'),_0x375d94,_0x1d3798);_0x409062(_0x1d3798);});});}exports[_0xbaaf('0x18')]=function(_0x1b534c){var _0x57d969=this;return new Promise(function(_0x1c879c,_0x16ee0f){return db[_0xbaaf('0x19')]['findAll']({'raw':_0x1b534c[_0xbaaf('0x1a')]?_0x1b534c[_0xbaaf('0x1a')][_0xbaaf('0x1b')]===undefined?!![]:![]:!![],'where':_0x1b534c[_0xbaaf('0x1a')]?_0x1b534c[_0xbaaf('0x1a')][_0xbaaf('0x1c')]||null:null,'attributes':_0x1b534c['options']?_0x1b534c['options'][_0xbaaf('0x1d')]||null:null,'limit':_0x1b534c[_0xbaaf('0x1a')]?_0x1b534c[_0xbaaf('0x1a')]['limit']||null:null,'include':_0x1b534c['options']?_0x1b534c[_0xbaaf('0x1a')][_0xbaaf('0x1e')]?_[_0xbaaf('0x1f')](_0x1b534c[_0xbaaf('0x1a')][_0xbaaf('0x1e')],function(_0xafe12b){return{'model':db[_0xafe12b[_0xbaaf('0x20')]],'as':_0xafe12b['as'],'attributes':_0xafe12b[_0xbaaf('0x1d')],'include':_0xafe12b[_0xbaaf('0x1e')]?_[_0xbaaf('0x1f')](_0xafe12b[_0xbaaf('0x1e')],function(_0x365734){return{'model':db[_0x365734[_0xbaaf('0x20')]],'as':_0x365734['as'],'attributes':_0x365734[_0xbaaf('0x1d')],'include':_0x365734['include']?_[_0xbaaf('0x1f')](_0x365734[_0xbaaf('0x1e')],function(_0x32208f){return{'model':db[_0x32208f[_0xbaaf('0x20')]],'as':_0x32208f['as'],'attributes':_0x32208f[_0xbaaf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbaaf('0xc')](function(_0x4b128d){logger[_0xbaaf('0xd')]('GetServicenowAccount',_0x1b534c);logger[_0xbaaf('0x10')](_0xbaaf('0x18'),_0x1b534c,JSON[_0xbaaf('0x12')](_0x4b128d));_0x1c879c(_0x4b128d);})['catch'](function(_0xf7697){logger[_0xbaaf('0x13')]('GetServicenowAccount',_0xf7697['message'],_0x1b534c);_0x16ee0f(_0x57d969[_0xbaaf('0x13')](0x1f4,_0xf7697[_0xbaaf('0x15')]));});});};exports[_0xbaaf('0x21')]=function(_0x3b1e47){var _0x551a17=this;return new Promise(function(_0x573aa0,_0x4b056c){return db[_0xbaaf('0x19')]['find']({'raw':_0x3b1e47['options']?_0x3b1e47['options'][_0xbaaf('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b1e47[_0xbaaf('0x1a')]?_0x3b1e47[_0xbaaf('0x1a')][_0xbaaf('0x1c')]||null:null,'attributes':_0x3b1e47['options']?_0x3b1e47[_0xbaaf('0x1a')]['attributes']||null:null,'include':_0x3b1e47[_0xbaaf('0x1a')]?_0x3b1e47[_0xbaaf('0x1a')]['include']?_[_0xbaaf('0x1f')](_0x3b1e47[_0xbaaf('0x1a')][_0xbaaf('0x1e')],function(_0x7436b2){return{'model':db[_0x7436b2[_0xbaaf('0x20')]],'as':_0x7436b2['as'],'attributes':_0x7436b2[_0xbaaf('0x1d')],'include':_0x7436b2[_0xbaaf('0x1e')]?_[_0xbaaf('0x1f')](_0x7436b2[_0xbaaf('0x1e')],function(_0x48730f){return{'model':db[_0x48730f['model']],'as':_0x48730f['as'],'attributes':_0x48730f['attributes'],'include':_0x48730f[_0xbaaf('0x1e')]?_[_0xbaaf('0x1f')](_0x48730f[_0xbaaf('0x1e')],function(_0x59eb6c){return{'model':db[_0x59eb6c[_0xbaaf('0x20')]],'as':_0x59eb6c['as'],'attributes':_0x59eb6c['attributes']};}):[]};}):[]};}):[]:[]})[_0xbaaf('0xc')](function(_0x26de45){logger['info'](_0xbaaf('0x21'),_0x3b1e47);logger[_0xbaaf('0x10')]('ShowServicenowAccount',_0x3b1e47,JSON[_0xbaaf('0x12')](_0x26de45));_0x573aa0(_0x26de45);})['catch'](function(_0x1eb09c){logger[_0xbaaf('0x13')]('ShowServicenowAccount',_0x1eb09c[_0xbaaf('0x15')],_0x3b1e47);_0x4b056c(_0x551a17[_0xbaaf('0x13')](0x1f4,_0x1eb09c['message']));});});}; \ No newline at end of file +var _0x0240=['limit','include','attributes','map','model','then','debug','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','findAll','options','where'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x0240,0x1b9));var _0x0024=function(_0x2da765,_0x55d175){_0x2da765=_0x2da765-0x0;var _0x3e6f56=_0x0240[_0x2da765];return _0x3e6f56;};'use strict';var _=require(_0x0024('0x0'));var util=require(_0x0024('0x1'));var moment=require(_0x0024('0x2'));var BPromise=require(_0x0024('0x3'));var rs=require(_0x0024('0x4'));var fs=require('fs');var Redis=require(_0x0024('0x5'));var db=require(_0x0024('0x6'))['db'];var utils=require(_0x0024('0x7'));var logger=require(_0x0024('0x8'))(_0x0024('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0024('0xa')][_0x0024('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b63a4,_0x5e4284,_0x134105){return new BPromise(function(_0x29e9ef,_0x452802){return client[_0x0024('0xc')](_0x3b63a4,_0x134105)['then'](function(_0x5d0b3a){logger[_0x0024('0xd')](_0x0024('0xe'),_0x5e4284,_0x0024('0xf'));logger['debug'](_0x0024('0x10'),_0x5e4284,_0x0024('0xf'),JSON[_0x0024('0x11')](_0x5d0b3a));if(_0x5d0b3a[_0x0024('0x12')]){if(_0x5d0b3a[_0x0024('0x12')][_0x0024('0x13')]===0x1f4){logger[_0x0024('0x12')](_0x0024('0xe'),_0x5e4284,_0x5d0b3a[_0x0024('0x12')][_0x0024('0x14')]);return _0x452802(_0x5d0b3a[_0x0024('0x12')][_0x0024('0x14')]);}logger[_0x0024('0x12')](_0x0024('0xe'),_0x5e4284,_0x5d0b3a[_0x0024('0x12')]['message']);return _0x29e9ef(_0x5d0b3a[_0x0024('0x12')]['message']);}else{logger[_0x0024('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x5e4284,_0x0024('0xf'));_0x29e9ef(_0x5d0b3a[_0x0024('0x15')]['message']);}})[_0x0024('0x16')](function(_0x5337c7){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5e4284,_0x5337c7);_0x452802(_0x5337c7);});});}exports[_0x0024('0x17')]=function(_0x5443f6){var _0x1d8675=this;return new Promise(function(_0x298e51,_0x11dbac){return db['ServicenowAccount'][_0x0024('0x18')]({'raw':_0x5443f6[_0x0024('0x19')]?_0x5443f6[_0x0024('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5443f6[_0x0024('0x19')]?_0x5443f6[_0x0024('0x19')][_0x0024('0x1a')]||null:null,'attributes':_0x5443f6['options']?_0x5443f6[_0x0024('0x19')]['attributes']||null:null,'limit':_0x5443f6[_0x0024('0x19')]?_0x5443f6[_0x0024('0x19')][_0x0024('0x1b')]||null:null,'include':_0x5443f6[_0x0024('0x19')]?_0x5443f6[_0x0024('0x19')][_0x0024('0x1c')]?_['map'](_0x5443f6[_0x0024('0x19')][_0x0024('0x1c')],function(_0x58922d){return{'model':db[_0x58922d['model']],'as':_0x58922d['as'],'attributes':_0x58922d[_0x0024('0x1d')],'include':_0x58922d[_0x0024('0x1c')]?_[_0x0024('0x1e')](_0x58922d[_0x0024('0x1c')],function(_0x4e4851){return{'model':db[_0x4e4851[_0x0024('0x1f')]],'as':_0x4e4851['as'],'attributes':_0x4e4851[_0x0024('0x1d')],'include':_0x4e4851['include']?_[_0x0024('0x1e')](_0x4e4851[_0x0024('0x1c')],function(_0x120c78){return{'model':db[_0x120c78[_0x0024('0x1f')]],'as':_0x120c78['as'],'attributes':_0x120c78[_0x0024('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0024('0x20')](function(_0x1982f9){logger[_0x0024('0xd')](_0x0024('0x17'),_0x5443f6);logger[_0x0024('0x21')](_0x0024('0x17'),_0x5443f6,JSON['stringify'](_0x1982f9));_0x298e51(_0x1982f9);})[_0x0024('0x16')](function(_0x46938c){logger[_0x0024('0x12')](_0x0024('0x17'),_0x46938c[_0x0024('0x14')],_0x5443f6);_0x11dbac(_0x1d8675[_0x0024('0x12')](0x1f4,_0x46938c[_0x0024('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x59fb15){var _0x5a13b5=this;return new Promise(function(_0x23f5dd,_0x16d101){return db['ServicenowAccount'][_0x0024('0x22')]({'raw':_0x59fb15[_0x0024('0x19')]?_0x59fb15[_0x0024('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x59fb15['options']?_0x59fb15[_0x0024('0x19')][_0x0024('0x1a')]||null:null,'attributes':_0x59fb15[_0x0024('0x19')]?_0x59fb15[_0x0024('0x19')][_0x0024('0x1d')]||null:null,'include':_0x59fb15['options']?_0x59fb15[_0x0024('0x19')][_0x0024('0x1c')]?_[_0x0024('0x1e')](_0x59fb15[_0x0024('0x19')][_0x0024('0x1c')],function(_0x20ec34){return{'model':db[_0x20ec34[_0x0024('0x1f')]],'as':_0x20ec34['as'],'attributes':_0x20ec34[_0x0024('0x1d')],'include':_0x20ec34[_0x0024('0x1c')]?_[_0x0024('0x1e')](_0x20ec34[_0x0024('0x1c')],function(_0xf3c4f2){return{'model':db[_0xf3c4f2[_0x0024('0x1f')]],'as':_0xf3c4f2['as'],'attributes':_0xf3c4f2['attributes'],'include':_0xf3c4f2[_0x0024('0x1c')]?_['map'](_0xf3c4f2[_0x0024('0x1c')],function(_0x38f933){return{'model':db[_0x38f933[_0x0024('0x1f')]],'as':_0x38f933['as'],'attributes':_0x38f933[_0x0024('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0024('0x20')](function(_0x2fb5eb){logger[_0x0024('0xd')](_0x0024('0x23'),_0x59fb15);logger[_0x0024('0x21')]('ShowServicenowAccount',_0x59fb15,JSON[_0x0024('0x11')](_0x2fb5eb));_0x23f5dd(_0x2fb5eb);})[_0x0024('0x16')](function(_0x35bc75){logger[_0x0024('0x12')](_0x0024('0x23'),_0x35bc75['message'],_0x59fb15);_0x16d101(_0x5a13b5['error'](0x1f4,_0x35bc75[_0x0024('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 8842dfe..6f4023d 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 _0x30cd=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x2e045d,_0x44c5c4){var _0x27680f=function(_0x3ac30d){while(--_0x3ac30d){_0x2e045d['push'](_0x2e045d['shift']());}};_0x27680f(++_0x44c5c4);}(_0x30cd,0x1ba));var _0xd30c=function(_0x233578,_0xfd4f8c){_0x233578=_0x233578-0x0;var _0x5b0187=_0x30cd[_0x233578];return _0x5b0187;};'use strict';var multer=require(_0xd30c('0x0'));var util=require(_0xd30c('0x1'));var path=require(_0xd30c('0x2'));var timeout=require(_0xd30c('0x3'));var express=require(_0xd30c('0x4'));var router=express[_0xd30c('0x5')]();var auth=require(_0xd30c('0x6'));var interaction=require(_0xd30c('0x7'));var config=require('../../config/environment');var controller=require(_0xd30c('0x8'));router[_0xd30c('0x9')]('/',auth[_0xd30c('0xa')](),controller[_0xd30c('0xb')]);router[_0xd30c('0x9')](_0xd30c('0xc'),auth[_0xd30c('0xa')](),controller[_0xd30c('0xd')]);router[_0xd30c('0x9')](_0xd30c('0xe'),auth[_0xd30c('0xa')](),controller[_0xd30c('0xf')]);router['get'](_0xd30c('0x10'),auth[_0xd30c('0xa')](),controller[_0xd30c('0x11')]);router[_0xd30c('0x9')](_0xd30c('0x12'),auth[_0xd30c('0xa')](),controller[_0xd30c('0x13')]);router[_0xd30c('0x14')]('/',auth[_0xd30c('0xa')](),controller[_0xd30c('0x15')]);router[_0xd30c('0x16')]('/:id',auth[_0xd30c('0xa')](),controller[_0xd30c('0x17')]);router[_0xd30c('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xd30c('0x19')]);module['exports']=router; \ No newline at end of file +var _0xfc21=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xfc21,0x1b5));var _0x1fc2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfc21[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x1fc2('0x0'));var util=require(_0x1fc2('0x1'));var path=require(_0x1fc2('0x2'));var timeout=require('connect-timeout');var express=require(_0x1fc2('0x3'));var router=express[_0x1fc2('0x4')]();var auth=require(_0x1fc2('0x5'));var interaction=require(_0x1fc2('0x6'));var config=require('../../config/environment');var controller=require(_0x1fc2('0x7'));router[_0x1fc2('0x8')]('/',auth[_0x1fc2('0x9')](),controller['index']);router[_0x1fc2('0x8')](_0x1fc2('0xa'),auth[_0x1fc2('0x9')](),controller[_0x1fc2('0xb')]);router[_0x1fc2('0x8')](_0x1fc2('0xc'),auth[_0x1fc2('0x9')](),controller[_0x1fc2('0xd')]);router[_0x1fc2('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x1fc2('0xe')]);router[_0x1fc2('0x8')](_0x1fc2('0xf'),auth[_0x1fc2('0x9')](),controller[_0x1fc2('0x10')]);router[_0x1fc2('0x11')]('/',auth[_0x1fc2('0x9')](),controller[_0x1fc2('0x12')]);router[_0x1fc2('0x13')](_0x1fc2('0xa'),auth['isAuthenticated'](),controller[_0x1fc2('0x14')]);router[_0x1fc2('0x15')]('/:id',auth[_0x1fc2('0x9')](),controller[_0x1fc2('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index e8a715a..2131739 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 _0xdd89=['STRING','sequelize','exports'];(function(_0x169e89,_0x2fde3b){var _0x1c4212=function(_0x401f67){while(--_0x401f67){_0x169e89['push'](_0x169e89['shift']());}};_0x1c4212(++_0x2fde3b);}(_0xdd89,0x169));var _0x9dd8=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0xdd89[_0x2ad008];return _0x4538cf;};'use strict';var Sequelize=require(_0x9dd8('0x0'));module[_0x9dd8('0x1')]={'name':{'type':Sequelize[_0x9dd8('0x2')]},'description':{'type':Sequelize[_0x9dd8('0x2')]}}; \ No newline at end of file +var _0xb223=['STRING','exports'];(function(_0x4a2b51,_0x3df59d){var _0x2510d3=function(_0x3cc58d){while(--_0x3cc58d){_0x4a2b51['push'](_0x4a2b51['shift']());}};_0x2510d3(++_0x3df59d);}(_0xb223,0x1e9));var _0x3b22=function(_0x307831,_0x508287){_0x307831=_0x307831-0x0;var _0x12ed17=_0xb223[_0x307831];return _0x12ed17;};'use strict';var Sequelize=require('sequelize');module[_0x3b22('0x0')]={'name':{'type':Sequelize[_0x3b22('0x1')]},'description':{'type':Sequelize[_0x3b22('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index c52c964..555348d 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 _0xa8a8=['then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','Content-Range','reject','save','update','destroy','end','stack','name','send','index','ServicenowConfiguration','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','map','VIRTUAL','field','count','includeAll','include','rows','show','params','length','options','find','body','getFields','findOne','ServicenowField','filter','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x2f2dd0,_0x242127){var _0x3c48d1=function(_0x4516b1){while(--_0x4516b1){_0x2f2dd0['push'](_0x2f2dd0['shift']());}};_0x3c48d1(++_0x242127);}(_0xa8a8,0xec));var _0x8a8a=function(_0x199070,_0x59fcde){_0x199070=_0x199070-0x0;var _0x4b358a=_0xa8a8[_0x199070];return _0x4b358a;};'use strict';var pdf=require(_0x8a8a('0x0'));var emlformat=require(_0x8a8a('0x1'));var rimraf=require(_0x8a8a('0x2'));var zipdir=require(_0x8a8a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a8a('0x4'));var moment=require(_0x8a8a('0x5'));var BPromise=require(_0x8a8a('0x6'));var Mustache=require(_0x8a8a('0x7'));var util=require(_0x8a8a('0x8'));var path=require(_0x8a8a('0x9'));var sox=require(_0x8a8a('0xa'));var csv=require(_0x8a8a('0xb'));var ejs=require(_0x8a8a('0xc'));var fs=require('fs');var _=require(_0x8a8a('0xd'));var squel=require(_0x8a8a('0xe'));var crypto=require(_0x8a8a('0xf'));var jsforce=require(_0x8a8a('0x10'));var deskjs=require(_0x8a8a('0x11'));var toCsv=require(_0x8a8a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x8a8a('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x8a8a('0x13'));var qs=require(_0x8a8a('0x14'));var logger=require('../../config/logger')(_0x8a8a('0x15'));var utils=require(_0x8a8a('0x16'));var config=require(_0x8a8a('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8a8a('0x18'));var client=jayson[_0x8a8a('0x19')][_0x8a8a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x234481,_0x4a1b91,_0x23febf,_0x4e5d74){return new BPromise(function(_0x25e1d5,_0xb2a3bc){var _0x787eec=_0x4e5d74||client;return _0x787eec[_0x8a8a('0x1b')](_0x234481,_0x23febf)[_0x8a8a('0x1c')](function(_0x78b0f0){logger[_0x8a8a('0x1d')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4a1b91,_0x8a8a('0x1e'));logger['debug'](_0x8a8a('0x1f'),_0x4a1b91,_0x8a8a('0x1e'),JSON[_0x8a8a('0x20')](_0x78b0f0));if(_0x78b0f0[_0x8a8a('0x21')]){if(_0x78b0f0[_0x8a8a('0x21')]['code']===0x1f4){logger[_0x8a8a('0x21')](_0x8a8a('0x22'),_0x4a1b91,_0x78b0f0[_0x8a8a('0x21')][_0x8a8a('0x23')]);return _0xb2a3bc(_0x78b0f0[_0x8a8a('0x21')][_0x8a8a('0x23')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x4a1b91,_0x78b0f0['error']['message']);return _0x25e1d5(_0x78b0f0['error'][_0x8a8a('0x23')]);}else{logger[_0x8a8a('0x1d')](_0x8a8a('0x22'),_0x4a1b91,_0x8a8a('0x1e'));_0x25e1d5(_0x78b0f0[_0x8a8a('0x24')][_0x8a8a('0x23')]);}})[_0x8a8a('0x25')](function(_0xe0321c){logger[_0x8a8a('0x21')](_0x8a8a('0x22'),_0x4a1b91,_0xe0321c);_0xb2a3bc(_0xe0321c);});});}function respondWithStatusCode(_0xb9db78,_0x3aa2bb){_0x3aa2bb=_0x3aa2bb||0xcc;return function(_0x3b4ece){if(_0x3b4ece){return _0xb9db78[_0x8a8a('0x26')](_0x3aa2bb);}return _0xb9db78[_0x8a8a('0x27')](_0x3aa2bb)['end']();};}function respondWithResult(_0x3c096f,_0x16c55b){_0x16c55b=_0x16c55b||0xc8;return function(_0x268b2f){if(_0x268b2f){return _0x3c096f[_0x8a8a('0x27')](_0x16c55b)[_0x8a8a('0x28')](_0x268b2f);}};}function respondWithFilteredResult(_0x251315,_0x3aa46d){return function(_0x5f4dcc){if(_0x5f4dcc){var _0x31d21a=_0x5f4dcc['count'],_0x38c1e0=_0x3aa46d[_0x8a8a('0x29')],_0x2e217a=_0x3aa46d[_0x8a8a('0x29')]+_0x3aa46d['limit'],_0x54ff7e;if(_0x2e217a>=_0x31d21a){_0x2e217a=_0x31d21a;_0x54ff7e=0xc8;}else{_0x54ff7e=0xce;}_0x251315['status'](_0x54ff7e);return _0x251315['set'](_0x8a8a('0x2a'),_0x38c1e0+'-'+_0x2e217a+'/'+_0x31d21a)['json'](_0x5f4dcc);}return null;};}function patchUpdates(_0x10b916){return function(_0xdd6221){try{jsonpatch['apply'](_0xdd6221,_0x10b916,!![]);}catch(_0x36c7f8){return BPromise[_0x8a8a('0x2b')](_0x36c7f8);}return _0xdd6221[_0x8a8a('0x2c')]();};}function saveUpdates(_0x8df0cb,_0x41802e){return function(_0x3d6594){if(_0x3d6594){return _0x3d6594[_0x8a8a('0x2d')](_0x8df0cb)[_0x8a8a('0x1c')](function(_0x5768a6){return _0x5768a6;});}return null;};}function removeEntity(_0x4ca706,_0x56e79e){return function(_0x2a00a7){if(_0x2a00a7){return _0x2a00a7[_0x8a8a('0x2e')]()['then'](function(){_0x4ca706[_0x8a8a('0x27')](0xcc)[_0x8a8a('0x2f')]();});}};}function handleEntityNotFound(_0x481e92,_0x3abab2){return function(_0x431b3a){if(!_0x431b3a){_0x481e92[_0x8a8a('0x26')](0x194);}return _0x431b3a;};}function handleError(_0x49e287,_0x5bee53){_0x5bee53=_0x5bee53||0x1f4;return function(_0x8457a0){logger['error'](_0x8457a0[_0x8a8a('0x30')]);if(_0x8457a0[_0x8a8a('0x31')]){delete _0x8457a0[_0x8a8a('0x31')];}_0x49e287[_0x8a8a('0x27')](_0x5bee53)[_0x8a8a('0x32')](_0x8457a0);};}exports[_0x8a8a('0x33')]=function(_0x37ce45,_0x389ad1){var _0x320398={},_0xf7d4d7={},_0x27de26={'count':0x0,'rows':[]};var _0x45ddb4=db[_0x8a8a('0x34')][_0x8a8a('0x35')];_0xf7d4d7[_0x8a8a('0x36')]=_[_0x8a8a('0x37')](_0x45ddb4);_0xf7d4d7[_0x8a8a('0x38')]=_[_0x8a8a('0x37')](_0x37ce45['query']);_0xf7d4d7['filters']=_['intersection'](_0xf7d4d7[_0x8a8a('0x36')],_0xf7d4d7[_0x8a8a('0x38')]);_0x320398[_0x8a8a('0x39')]=_[_0x8a8a('0x3a')](_0xf7d4d7[_0x8a8a('0x36')],qs['fields'](_0x37ce45['query'][_0x8a8a('0x3b')]));_0x320398['attributes']=_0x320398[_0x8a8a('0x39')]['length']?_0x320398['attributes']:_0xf7d4d7[_0x8a8a('0x36')];if(!_0x37ce45[_0x8a8a('0x38')][_0x8a8a('0x3c')](_0x8a8a('0x3d'))){_0x320398[_0x8a8a('0x3e')]=qs[_0x8a8a('0x3e')](_0x37ce45[_0x8a8a('0x38')]['limit']);_0x320398[_0x8a8a('0x29')]=qs[_0x8a8a('0x29')](_0x37ce45[_0x8a8a('0x38')]['offset']);}_0x320398[_0x8a8a('0x3f')]=qs[_0x8a8a('0x40')](_0x37ce45[_0x8a8a('0x38')]['sort']);_0x320398[_0x8a8a('0x41')]=qs[_0x8a8a('0x42')](_[_0x8a8a('0x43')](_0x37ce45[_0x8a8a('0x38')],_0xf7d4d7[_0x8a8a('0x42')]));if(_0x37ce45[_0x8a8a('0x38')]['filter']){_0x320398['where']=_[_0x8a8a('0x44')](_0x320398['where'],{'$or':_[_0x8a8a('0x45')](_0x45ddb4,function(_0x1aa8b5){if(_0x1aa8b5['type']['key']!==_0x8a8a('0x46')){var _0x1ea8f7={};_0x1ea8f7[_0x1aa8b5[_0x8a8a('0x47')]]={'$like':'%'+_0x37ce45[_0x8a8a('0x38')]['filter']+'%'};return _0x1ea8f7;}})});}_0x320398=_[_0x8a8a('0x44')]({},_0x320398,_0x37ce45['options']);var _0x2fbd23={'where':_0x320398[_0x8a8a('0x41')]};return db['ServicenowConfiguration'][_0x8a8a('0x48')](_0x2fbd23)[_0x8a8a('0x1c')](function(_0x2836de){_0x27de26['count']=_0x2836de;if(_0x37ce45[_0x8a8a('0x38')][_0x8a8a('0x49')]){_0x320398[_0x8a8a('0x4a')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x320398);})[_0x8a8a('0x1c')](function(_0x1eb8bf){_0x27de26[_0x8a8a('0x4b')]=_0x1eb8bf;return _0x27de26;})['then'](respondWithFilteredResult(_0x389ad1,_0x320398))[_0x8a8a('0x25')](handleError(_0x389ad1,null));};exports[_0x8a8a('0x4c')]=function(_0x86588c,_0xcf230e){var _0x2d4c11={'raw':![],'where':{'id':_0x86588c[_0x8a8a('0x4d')]['id']}},_0x504104={};_0x504104[_0x8a8a('0x36')]=_[_0x8a8a('0x37')](db[_0x8a8a('0x34')][_0x8a8a('0x35')]);_0x504104['query']=_[_0x8a8a('0x37')](_0x86588c[_0x8a8a('0x38')]);_0x504104[_0x8a8a('0x42')]=_[_0x8a8a('0x3a')](_0x504104[_0x8a8a('0x36')],_0x504104[_0x8a8a('0x38')]);_0x2d4c11['attributes']=_[_0x8a8a('0x3a')](_0x504104[_0x8a8a('0x36')],qs[_0x8a8a('0x3b')](_0x86588c[_0x8a8a('0x38')]['fields']));_0x2d4c11[_0x8a8a('0x39')]=_0x2d4c11[_0x8a8a('0x39')][_0x8a8a('0x4e')]?_0x2d4c11['attributes']:_0x504104['model'];if(_0x86588c[_0x8a8a('0x38')][_0x8a8a('0x49')]){_0x2d4c11[_0x8a8a('0x4a')]=[{'all':!![]}];}_0x2d4c11=_[_0x8a8a('0x44')]({},_0x2d4c11,_0x86588c[_0x8a8a('0x4f')]);return db[_0x8a8a('0x34')][_0x8a8a('0x50')](_0x2d4c11)[_0x8a8a('0x1c')](handleEntityNotFound(_0xcf230e,null))[_0x8a8a('0x1c')](respondWithResult(_0xcf230e,null))['catch'](handleError(_0xcf230e,null));};exports['create']=function(_0x17ffeb,_0x10f689){return db['ServicenowConfiguration']['create'](_0x17ffeb[_0x8a8a('0x51')],{})['then'](respondWithResult(_0x10f689,0xc9))[_0x8a8a('0x25')](handleError(_0x10f689,null));};exports['update']=function(_0x4642d5,_0xa2b8a1){if(_0x4642d5[_0x8a8a('0x51')]['id']){delete _0x4642d5[_0x8a8a('0x51')]['id'];}return db[_0x8a8a('0x34')][_0x8a8a('0x50')]({'where':{'id':_0x4642d5[_0x8a8a('0x4d')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0xa2b8a1,null))[_0x8a8a('0x1c')](saveUpdates(_0x4642d5[_0x8a8a('0x51')],null))['then'](respondWithResult(_0xa2b8a1,null))[_0x8a8a('0x25')](handleError(_0xa2b8a1,null));};exports[_0x8a8a('0x2e')]=function(_0x32a4ed,_0x1e3bf5){return db[_0x8a8a('0x34')]['find']({'where':{'id':_0x32a4ed[_0x8a8a('0x4d')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x1e3bf5,null))['then'](removeEntity(_0x1e3bf5,null))['catch'](handleError(_0x1e3bf5,null));};exports[_0x8a8a('0x52')]=function(_0x3c3f3d,_0x322b4c,_0x2ba3bf){var _0x265e98={};var _0x2dc4e8={};var _0x5ed59c;var _0x481d02;return db['ServicenowConfiguration'][_0x8a8a('0x53')]({'where':{'id':_0x3c3f3d['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x322b4c,null))[_0x8a8a('0x1c')](function(_0x4e1ca8){if(_0x4e1ca8){_0x5ed59c=_0x4e1ca8;_0x2dc4e8[_0x8a8a('0x36')]=_[_0x8a8a('0x37')](db[_0x8a8a('0x54')][_0x8a8a('0x35')]);_0x2dc4e8['query']=_[_0x8a8a('0x37')](_0x3c3f3d['query']);_0x2dc4e8[_0x8a8a('0x42')]=_[_0x8a8a('0x3a')](_0x2dc4e8['model'],_0x2dc4e8[_0x8a8a('0x38')]);_0x265e98[_0x8a8a('0x39')]=_[_0x8a8a('0x3a')](_0x2dc4e8[_0x8a8a('0x36')],qs['fields'](_0x3c3f3d[_0x8a8a('0x38')][_0x8a8a('0x3b')]));_0x265e98[_0x8a8a('0x39')]=_0x265e98['attributes']['length']?_0x265e98[_0x8a8a('0x39')]:_0x2dc4e8['model'];_0x265e98['order']=qs['sort'](_0x3c3f3d[_0x8a8a('0x38')][_0x8a8a('0x40')]);_0x265e98['where']=qs[_0x8a8a('0x42')](_['pick'](_0x3c3f3d['query'],_0x2dc4e8[_0x8a8a('0x42')]));if(_0x3c3f3d[_0x8a8a('0x38')]['filter']){_0x265e98[_0x8a8a('0x41')]=_[_0x8a8a('0x44')](_0x265e98[_0x8a8a('0x41')],{'$or':_[_0x8a8a('0x45')](_0x265e98[_0x8a8a('0x39')],function(_0x126dba){var _0x4c8272={};_0x4c8272[_0x126dba]={'$like':'%'+_0x3c3f3d[_0x8a8a('0x38')][_0x8a8a('0x55')]+'%'};return _0x4c8272;})});}_0x265e98=_['merge']({},_0x265e98,_0x3c3f3d[_0x8a8a('0x4f')]);return _0x5ed59c[_0x8a8a('0x52')](_0x265e98);}})[_0x8a8a('0x1c')](function(_0x190c45){if(_0x190c45){_0x481d02=_0x190c45[_0x8a8a('0x4e')];if(!_0x3c3f3d[_0x8a8a('0x38')][_0x8a8a('0x3c')](_0x8a8a('0x3d'))){_0x265e98[_0x8a8a('0x3e')]=qs[_0x8a8a('0x3e')](_0x3c3f3d['query'][_0x8a8a('0x3e')]);_0x265e98[_0x8a8a('0x29')]=qs['offset'](_0x3c3f3d[_0x8a8a('0x38')][_0x8a8a('0x29')]);}return _0x5ed59c[_0x8a8a('0x52')](_0x265e98);}})[_0x8a8a('0x1c')](function(_0x3e0af2){if(_0x3e0af2){return _0x3e0af2?{'count':_0x481d02,'rows':_0x3e0af2}:null;}})['then'](respondWithResult(_0x322b4c,null))[_0x8a8a('0x25')](handleError(_0x322b4c,null));};exports[_0x8a8a('0x56')]=function(_0x3edc54,_0x2984eb,_0x3fc483){var _0x224ec2={};var _0x1a6f51={};var _0x4fc5c8;var _0x2a221b;return db[_0x8a8a('0x34')][_0x8a8a('0x53')]({'where':{'id':_0x3edc54['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x2984eb,null))['then'](function(_0x15b2e7){if(_0x15b2e7){_0x4fc5c8=_0x15b2e7;_0x1a6f51[_0x8a8a('0x36')]=_['keys'](db[_0x8a8a('0x54')][_0x8a8a('0x35')]);_0x1a6f51[_0x8a8a('0x38')]=_[_0x8a8a('0x37')](_0x3edc54[_0x8a8a('0x38')]);_0x1a6f51[_0x8a8a('0x42')]=_[_0x8a8a('0x3a')](_0x1a6f51[_0x8a8a('0x36')],_0x1a6f51[_0x8a8a('0x38')]);_0x224ec2[_0x8a8a('0x39')]=_[_0x8a8a('0x3a')](_0x1a6f51[_0x8a8a('0x36')],qs[_0x8a8a('0x3b')](_0x3edc54[_0x8a8a('0x38')][_0x8a8a('0x3b')]));_0x224ec2[_0x8a8a('0x39')]=_0x224ec2[_0x8a8a('0x39')][_0x8a8a('0x4e')]?_0x224ec2['attributes']:_0x1a6f51[_0x8a8a('0x36')];_0x224ec2['order']=qs[_0x8a8a('0x40')](_0x3edc54[_0x8a8a('0x38')][_0x8a8a('0x40')]);_0x224ec2['where']=qs['filters'](_[_0x8a8a('0x43')](_0x3edc54[_0x8a8a('0x38')],_0x1a6f51[_0x8a8a('0x42')]));if(_0x3edc54['query']['filter']){_0x224ec2[_0x8a8a('0x41')]=_[_0x8a8a('0x44')](_0x224ec2[_0x8a8a('0x41')],{'$or':_[_0x8a8a('0x45')](_0x224ec2[_0x8a8a('0x39')],function(_0x3c1ecf){var _0x1f0970={};_0x1f0970[_0x3c1ecf]={'$like':'%'+_0x3edc54[_0x8a8a('0x38')]['filter']+'%'};return _0x1f0970;})});}_0x224ec2=_[_0x8a8a('0x44')]({},_0x224ec2,_0x3edc54[_0x8a8a('0x4f')]);return _0x4fc5c8['getSubjects'](_0x224ec2);}})[_0x8a8a('0x1c')](function(_0x316d7b){if(_0x316d7b){_0x2a221b=_0x316d7b[_0x8a8a('0x4e')];if(!_0x3edc54[_0x8a8a('0x38')][_0x8a8a('0x3c')](_0x8a8a('0x3d'))){_0x224ec2['limit']=qs[_0x8a8a('0x3e')](_0x3edc54[_0x8a8a('0x38')][_0x8a8a('0x3e')]);_0x224ec2[_0x8a8a('0x29')]=qs[_0x8a8a('0x29')](_0x3edc54['query'][_0x8a8a('0x29')]);}return _0x4fc5c8[_0x8a8a('0x56')](_0x224ec2);}})[_0x8a8a('0x1c')](function(_0x3d9511){if(_0x3d9511){return _0x3d9511?{'count':_0x2a221b,'rows':_0x3d9511}:null;}})[_0x8a8a('0x1c')](respondWithResult(_0x2984eb,null))[_0x8a8a('0x25')](handleError(_0x2984eb,null));};exports[_0x8a8a('0x57')]=function(_0x106df7,_0x351f25,_0x268343){var _0x491b2e={};var _0x306a50={};var _0x20b40e;var _0x3bb8d7;return db[_0x8a8a('0x34')][_0x8a8a('0x53')]({'where':{'id':_0x106df7['params']['id']}})['then'](handleEntityNotFound(_0x351f25,null))[_0x8a8a('0x1c')](function(_0x46c4f6){if(_0x46c4f6){_0x20b40e=_0x46c4f6;_0x306a50[_0x8a8a('0x36')]=_['keys'](db[_0x8a8a('0x54')][_0x8a8a('0x35')]);_0x306a50[_0x8a8a('0x38')]=_[_0x8a8a('0x37')](_0x106df7['query']);_0x306a50[_0x8a8a('0x42')]=_[_0x8a8a('0x3a')](_0x306a50[_0x8a8a('0x36')],_0x306a50['query']);_0x491b2e['attributes']=_['intersection'](_0x306a50[_0x8a8a('0x36')],qs['fields'](_0x106df7[_0x8a8a('0x38')]['fields']));_0x491b2e['attributes']=_0x491b2e[_0x8a8a('0x39')]['length']?_0x491b2e['attributes']:_0x306a50['model'];_0x491b2e[_0x8a8a('0x3f')]=qs['sort'](_0x106df7['query'][_0x8a8a('0x40')]);_0x491b2e['where']=qs[_0x8a8a('0x42')](_['pick'](_0x106df7[_0x8a8a('0x38')],_0x306a50[_0x8a8a('0x42')]));if(_0x106df7[_0x8a8a('0x38')][_0x8a8a('0x55')]){_0x491b2e['where']=_[_0x8a8a('0x44')](_0x491b2e[_0x8a8a('0x41')],{'$or':_['map'](_0x491b2e[_0x8a8a('0x39')],function(_0xf3cf32){var _0x913e4c={};_0x913e4c[_0xf3cf32]={'$like':'%'+_0x106df7[_0x8a8a('0x38')]['filter']+'%'};return _0x913e4c;})});}_0x491b2e=_['merge']({},_0x491b2e,_0x106df7[_0x8a8a('0x4f')]);return _0x20b40e[_0x8a8a('0x57')](_0x491b2e);}})[_0x8a8a('0x1c')](function(_0x5bd333){if(_0x5bd333){_0x3bb8d7=_0x5bd333[_0x8a8a('0x4e')];if(!_0x106df7[_0x8a8a('0x38')][_0x8a8a('0x3c')]('nolimit')){_0x491b2e[_0x8a8a('0x3e')]=qs[_0x8a8a('0x3e')](_0x106df7[_0x8a8a('0x38')][_0x8a8a('0x3e')]);_0x491b2e[_0x8a8a('0x29')]=qs['offset'](_0x106df7[_0x8a8a('0x38')][_0x8a8a('0x29')]);}return _0x20b40e[_0x8a8a('0x57')](_0x491b2e);}})[_0x8a8a('0x1c')](function(_0xa58962){if(_0xa58962){return _0xa58962?{'count':_0x3bb8d7,'rows':_0xa58962}:null;}})[_0x8a8a('0x1c')](respondWithResult(_0x351f25,null))[_0x8a8a('0x25')](handleError(_0x351f25,null));}; \ No newline at end of file +var _0x2dae=['merge','map','type','key','VIRTUAL','options','includeAll','rows','catch','show','include','find','create','body','params','findOne','ServicenowField','nolimit','getFields','getSubjects','getDescriptions','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','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','sendStatus','status','json','count','offset','limit','apply','save','update','end','stack','name','send','index','ServicenowConfiguration','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x2dae,0xc3));var _0xe2da=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0x2dae[_0x39872b];return _0x55fa18;};'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 authService=require('../../components/auth/service');var hardwareService=require(_0xe2da('0x13'));var Redis=require(_0xe2da('0x14'));var qs=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'];var jayson=require('jayson/promise');var client=jayson[_0xe2da('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4377c6,_0x245ad7,_0x37064e,_0x411b9f){return new BPromise(function(_0xfab73e,_0x5660b5){var _0x295a86=_0x411b9f||client;return _0x295a86['request'](_0x4377c6,_0x37064e)[_0xe2da('0x1c')](function(_0x5e1702){logger['info'](_0xe2da('0x1d'),_0x245ad7,_0xe2da('0x1e'));logger[_0xe2da('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x245ad7,_0xe2da('0x1e'),JSON[_0xe2da('0x20')](_0x5e1702));if(_0x5e1702[_0xe2da('0x21')]){if(_0x5e1702[_0xe2da('0x21')]['code']===0x1f4){logger[_0xe2da('0x21')](_0xe2da('0x1d'),_0x245ad7,_0x5e1702[_0xe2da('0x21')][_0xe2da('0x22')]);return _0x5660b5(_0x5e1702[_0xe2da('0x21')]['message']);}logger[_0xe2da('0x21')](_0xe2da('0x1d'),_0x245ad7,_0x5e1702['error'][_0xe2da('0x22')]);return _0xfab73e(_0x5e1702[_0xe2da('0x21')][_0xe2da('0x22')]);}else{logger[_0xe2da('0x23')](_0xe2da('0x1d'),_0x245ad7,_0xe2da('0x1e'));_0xfab73e(_0x5e1702['result'][_0xe2da('0x22')]);}})['catch'](function(_0x30efdc){logger[_0xe2da('0x21')](_0xe2da('0x1d'),_0x245ad7,_0x30efdc);_0x5660b5(_0x30efdc);});});}function respondWithStatusCode(_0x28f1d3,_0x30dea4){_0x30dea4=_0x30dea4||0xcc;return function(_0x1e45e9){if(_0x1e45e9){return _0x28f1d3[_0xe2da('0x24')](_0x30dea4);}return _0x28f1d3[_0xe2da('0x25')](_0x30dea4)['end']();};}function respondWithResult(_0x1c901e,_0x357bff){_0x357bff=_0x357bff||0xc8;return function(_0xb4d957){if(_0xb4d957){return _0x1c901e[_0xe2da('0x25')](_0x357bff)[_0xe2da('0x26')](_0xb4d957);}};}function respondWithFilteredResult(_0x230fb8,_0x124d93){return function(_0x56c37e){if(_0x56c37e){var _0x2adc49=_0x56c37e[_0xe2da('0x27')],_0x3e23d7=_0x124d93[_0xe2da('0x28')],_0x1dc228=_0x124d93[_0xe2da('0x28')]+_0x124d93[_0xe2da('0x29')],_0x38ee5e;if(_0x1dc228>=_0x2adc49){_0x1dc228=_0x2adc49;_0x38ee5e=0xc8;}else{_0x38ee5e=0xce;}_0x230fb8['status'](_0x38ee5e);return _0x230fb8['set']('Content-Range',_0x3e23d7+'-'+_0x1dc228+'/'+_0x2adc49)[_0xe2da('0x26')](_0x56c37e);}return null;};}function patchUpdates(_0x8c91db){return function(_0x4146ad){try{jsonpatch[_0xe2da('0x2a')](_0x4146ad,_0x8c91db,!![]);}catch(_0x5de7fb){return BPromise['reject'](_0x5de7fb);}return _0x4146ad[_0xe2da('0x2b')]();};}function saveUpdates(_0x1ec8ca,_0x262d40){return function(_0x39f983){if(_0x39f983){return _0x39f983[_0xe2da('0x2c')](_0x1ec8ca)[_0xe2da('0x1c')](function(_0x195b93){return _0x195b93;});}return null;};}function removeEntity(_0xd9bfa9,_0x461610){return function(_0x499400){if(_0x499400){return _0x499400['destroy']()[_0xe2da('0x1c')](function(){_0xd9bfa9[_0xe2da('0x25')](0xcc)[_0xe2da('0x2d')]();});}};}function handleEntityNotFound(_0x34f5fe,_0x195537){return function(_0x27e86d){if(!_0x27e86d){_0x34f5fe[_0xe2da('0x24')](0x194);}return _0x27e86d;};}function handleError(_0x7fa46c,_0x28e61a){_0x28e61a=_0x28e61a||0x1f4;return function(_0x46df04){logger[_0xe2da('0x21')](_0x46df04[_0xe2da('0x2e')]);if(_0x46df04[_0xe2da('0x2f')]){delete _0x46df04[_0xe2da('0x2f')];}_0x7fa46c[_0xe2da('0x25')](_0x28e61a)[_0xe2da('0x30')](_0x46df04);};}exports[_0xe2da('0x31')]=function(_0x3a6f08,_0x5a078e){var _0x32dddc={},_0x8bd0fc={},_0x39dae5={'count':0x0,'rows':[]};var _0x5e1f39=db[_0xe2da('0x32')][_0xe2da('0x33')];_0x8bd0fc[_0xe2da('0x34')]=_['keys'](_0x5e1f39);_0x8bd0fc['query']=_[_0xe2da('0x35')](_0x3a6f08[_0xe2da('0x36')]);_0x8bd0fc['filters']=_[_0xe2da('0x37')](_0x8bd0fc[_0xe2da('0x34')],_0x8bd0fc[_0xe2da('0x36')]);_0x32dddc[_0xe2da('0x38')]=_[_0xe2da('0x37')](_0x8bd0fc['model'],qs[_0xe2da('0x39')](_0x3a6f08['query']['fields']));_0x32dddc[_0xe2da('0x38')]=_0x32dddc['attributes'][_0xe2da('0x3a')]?_0x32dddc[_0xe2da('0x38')]:_0x8bd0fc['model'];if(!_0x3a6f08[_0xe2da('0x36')][_0xe2da('0x3b')]('nolimit')){_0x32dddc['limit']=qs['limit'](_0x3a6f08[_0xe2da('0x36')][_0xe2da('0x29')]);_0x32dddc[_0xe2da('0x28')]=qs[_0xe2da('0x28')](_0x3a6f08[_0xe2da('0x36')][_0xe2da('0x28')]);}_0x32dddc[_0xe2da('0x3c')]=qs['sort'](_0x3a6f08[_0xe2da('0x36')][_0xe2da('0x3d')]);_0x32dddc[_0xe2da('0x3e')]=qs[_0xe2da('0x3f')](_[_0xe2da('0x40')](_0x3a6f08['query'],_0x8bd0fc[_0xe2da('0x3f')]));if(_0x3a6f08[_0xe2da('0x36')][_0xe2da('0x41')]){_0x32dddc['where']=_[_0xe2da('0x42')](_0x32dddc[_0xe2da('0x3e')],{'$or':_[_0xe2da('0x43')](_0x5e1f39,function(_0x4096c5){if(_0x4096c5[_0xe2da('0x44')][_0xe2da('0x45')]!==_0xe2da('0x46')){var _0x29ec1a={};_0x29ec1a[_0x4096c5['field']]={'$like':'%'+_0x3a6f08[_0xe2da('0x36')][_0xe2da('0x41')]+'%'};return _0x29ec1a;}})});}_0x32dddc=_[_0xe2da('0x42')]({},_0x32dddc,_0x3a6f08[_0xe2da('0x47')]);var _0x3457d0={'where':_0x32dddc['where']};return db[_0xe2da('0x32')][_0xe2da('0x27')](_0x3457d0)[_0xe2da('0x1c')](function(_0x11d27b){_0x39dae5[_0xe2da('0x27')]=_0x11d27b;if(_0x3a6f08[_0xe2da('0x36')][_0xe2da('0x48')]){_0x32dddc['include']=[{'all':!![]}];}return db[_0xe2da('0x32')]['findAll'](_0x32dddc);})[_0xe2da('0x1c')](function(_0x54b3ad){_0x39dae5[_0xe2da('0x49')]=_0x54b3ad;return _0x39dae5;})['then'](respondWithFilteredResult(_0x5a078e,_0x32dddc))[_0xe2da('0x4a')](handleError(_0x5a078e,null));};exports[_0xe2da('0x4b')]=function(_0x525912,_0x224956){var _0x369dea={'raw':![],'where':{'id':_0x525912['params']['id']}},_0x342d22={};_0x342d22[_0xe2da('0x34')]=_['keys'](db['ServicenowConfiguration'][_0xe2da('0x33')]);_0x342d22['query']=_[_0xe2da('0x35')](_0x525912[_0xe2da('0x36')]);_0x342d22['filters']=_[_0xe2da('0x37')](_0x342d22[_0xe2da('0x34')],_0x342d22['query']);_0x369dea['attributes']=_[_0xe2da('0x37')](_0x342d22['model'],qs[_0xe2da('0x39')](_0x525912[_0xe2da('0x36')][_0xe2da('0x39')]));_0x369dea[_0xe2da('0x38')]=_0x369dea[_0xe2da('0x38')][_0xe2da('0x3a')]?_0x369dea[_0xe2da('0x38')]:_0x342d22[_0xe2da('0x34')];if(_0x525912[_0xe2da('0x36')]['includeAll']){_0x369dea[_0xe2da('0x4c')]=[{'all':!![]}];}_0x369dea=_[_0xe2da('0x42')]({},_0x369dea,_0x525912[_0xe2da('0x47')]);return db['ServicenowConfiguration'][_0xe2da('0x4d')](_0x369dea)[_0xe2da('0x1c')](handleEntityNotFound(_0x224956,null))[_0xe2da('0x1c')](respondWithResult(_0x224956,null))[_0xe2da('0x4a')](handleError(_0x224956,null));};exports[_0xe2da('0x4e')]=function(_0x3166dd,_0x246384){return db['ServicenowConfiguration']['create'](_0x3166dd[_0xe2da('0x4f')],{})[_0xe2da('0x1c')](respondWithResult(_0x246384,0xc9))[_0xe2da('0x4a')](handleError(_0x246384,null));};exports['update']=function(_0x572690,_0x41d2ca){if(_0x572690['body']['id']){delete _0x572690[_0xe2da('0x4f')]['id'];}return db[_0xe2da('0x32')][_0xe2da('0x4d')]({'where':{'id':_0x572690[_0xe2da('0x50')]['id']}})[_0xe2da('0x1c')](handleEntityNotFound(_0x41d2ca,null))[_0xe2da('0x1c')](saveUpdates(_0x572690[_0xe2da('0x4f')],null))[_0xe2da('0x1c')](respondWithResult(_0x41d2ca,null))[_0xe2da('0x4a')](handleError(_0x41d2ca,null));};exports['destroy']=function(_0x26a9f0,_0x2f763b){return db[_0xe2da('0x32')][_0xe2da('0x4d')]({'where':{'id':_0x26a9f0['params']['id']}})[_0xe2da('0x1c')](handleEntityNotFound(_0x2f763b,null))[_0xe2da('0x1c')](removeEntity(_0x2f763b,null))[_0xe2da('0x4a')](handleError(_0x2f763b,null));};exports['getFields']=function(_0x394511,_0x24cd44,_0x3e6e98){var _0x1dd128={};var _0x188bb0={};var _0x22a571;var _0x12128b;return db[_0xe2da('0x32')][_0xe2da('0x51')]({'where':{'id':_0x394511[_0xe2da('0x50')]['id']}})[_0xe2da('0x1c')](handleEntityNotFound(_0x24cd44,null))[_0xe2da('0x1c')](function(_0x505c24){if(_0x505c24){_0x22a571=_0x505c24;_0x188bb0[_0xe2da('0x34')]=_[_0xe2da('0x35')](db[_0xe2da('0x52')][_0xe2da('0x33')]);_0x188bb0[_0xe2da('0x36')]=_[_0xe2da('0x35')](_0x394511[_0xe2da('0x36')]);_0x188bb0['filters']=_[_0xe2da('0x37')](_0x188bb0['model'],_0x188bb0[_0xe2da('0x36')]);_0x1dd128[_0xe2da('0x38')]=_['intersection'](_0x188bb0['model'],qs[_0xe2da('0x39')](_0x394511['query'][_0xe2da('0x39')]));_0x1dd128['attributes']=_0x1dd128[_0xe2da('0x38')][_0xe2da('0x3a')]?_0x1dd128[_0xe2da('0x38')]:_0x188bb0['model'];_0x1dd128['order']=qs['sort'](_0x394511[_0xe2da('0x36')][_0xe2da('0x3d')]);_0x1dd128[_0xe2da('0x3e')]=qs[_0xe2da('0x3f')](_['pick'](_0x394511[_0xe2da('0x36')],_0x188bb0[_0xe2da('0x3f')]));if(_0x394511[_0xe2da('0x36')][_0xe2da('0x41')]){_0x1dd128[_0xe2da('0x3e')]=_[_0xe2da('0x42')](_0x1dd128[_0xe2da('0x3e')],{'$or':_['map'](_0x1dd128[_0xe2da('0x38')],function(_0x4666b3){var _0x3f0a4b={};_0x3f0a4b[_0x4666b3]={'$like':'%'+_0x394511[_0xe2da('0x36')][_0xe2da('0x41')]+'%'};return _0x3f0a4b;})});}_0x1dd128=_['merge']({},_0x1dd128,_0x394511[_0xe2da('0x47')]);return _0x22a571['getFields'](_0x1dd128);}})[_0xe2da('0x1c')](function(_0x4d5997){if(_0x4d5997){_0x12128b=_0x4d5997[_0xe2da('0x3a')];if(!_0x394511['query']['hasOwnProperty'](_0xe2da('0x53'))){_0x1dd128[_0xe2da('0x29')]=qs[_0xe2da('0x29')](_0x394511[_0xe2da('0x36')][_0xe2da('0x29')]);_0x1dd128[_0xe2da('0x28')]=qs[_0xe2da('0x28')](_0x394511[_0xe2da('0x36')][_0xe2da('0x28')]);}return _0x22a571[_0xe2da('0x54')](_0x1dd128);}})['then'](function(_0x430a65){if(_0x430a65){return _0x430a65?{'count':_0x12128b,'rows':_0x430a65}:null;}})[_0xe2da('0x1c')](respondWithResult(_0x24cd44,null))[_0xe2da('0x4a')](handleError(_0x24cd44,null));};exports[_0xe2da('0x55')]=function(_0x4ea2a6,_0xe81698,_0x9877c2){var _0x36ed64={};var _0x408f95={};var _0x573ea6;var _0x455bb2;return db['ServicenowConfiguration'][_0xe2da('0x51')]({'where':{'id':_0x4ea2a6[_0xe2da('0x50')]['id']}})['then'](handleEntityNotFound(_0xe81698,null))[_0xe2da('0x1c')](function(_0xe006f5){if(_0xe006f5){_0x573ea6=_0xe006f5;_0x408f95[_0xe2da('0x34')]=_[_0xe2da('0x35')](db[_0xe2da('0x52')]['rawAttributes']);_0x408f95[_0xe2da('0x36')]=_['keys'](_0x4ea2a6['query']);_0x408f95['filters']=_['intersection'](_0x408f95[_0xe2da('0x34')],_0x408f95[_0xe2da('0x36')]);_0x36ed64[_0xe2da('0x38')]=_[_0xe2da('0x37')](_0x408f95[_0xe2da('0x34')],qs[_0xe2da('0x39')](_0x4ea2a6[_0xe2da('0x36')][_0xe2da('0x39')]));_0x36ed64[_0xe2da('0x38')]=_0x36ed64['attributes'][_0xe2da('0x3a')]?_0x36ed64[_0xe2da('0x38')]:_0x408f95[_0xe2da('0x34')];_0x36ed64[_0xe2da('0x3c')]=qs[_0xe2da('0x3d')](_0x4ea2a6[_0xe2da('0x36')][_0xe2da('0x3d')]);_0x36ed64[_0xe2da('0x3e')]=qs[_0xe2da('0x3f')](_[_0xe2da('0x40')](_0x4ea2a6['query'],_0x408f95[_0xe2da('0x3f')]));if(_0x4ea2a6[_0xe2da('0x36')][_0xe2da('0x41')]){_0x36ed64[_0xe2da('0x3e')]=_[_0xe2da('0x42')](_0x36ed64[_0xe2da('0x3e')],{'$or':_[_0xe2da('0x43')](_0x36ed64[_0xe2da('0x38')],function(_0x110e42){var _0x28722f={};_0x28722f[_0x110e42]={'$like':'%'+_0x4ea2a6[_0xe2da('0x36')][_0xe2da('0x41')]+'%'};return _0x28722f;})});}_0x36ed64=_['merge']({},_0x36ed64,_0x4ea2a6[_0xe2da('0x47')]);return _0x573ea6['getSubjects'](_0x36ed64);}})[_0xe2da('0x1c')](function(_0x6babeb){if(_0x6babeb){_0x455bb2=_0x6babeb[_0xe2da('0x3a')];if(!_0x4ea2a6[_0xe2da('0x36')][_0xe2da('0x3b')](_0xe2da('0x53'))){_0x36ed64[_0xe2da('0x29')]=qs['limit'](_0x4ea2a6[_0xe2da('0x36')][_0xe2da('0x29')]);_0x36ed64[_0xe2da('0x28')]=qs[_0xe2da('0x28')](_0x4ea2a6[_0xe2da('0x36')][_0xe2da('0x28')]);}return _0x573ea6['getSubjects'](_0x36ed64);}})[_0xe2da('0x1c')](function(_0x3d1083){if(_0x3d1083){return _0x3d1083?{'count':_0x455bb2,'rows':_0x3d1083}:null;}})[_0xe2da('0x1c')](respondWithResult(_0xe81698,null))[_0xe2da('0x4a')](handleError(_0xe81698,null));};exports[_0xe2da('0x56')]=function(_0x3c7119,_0x43e447,_0x4e72b7){var _0x298511={};var _0x2937f2={};var _0x3934f2;var _0x172745;return db[_0xe2da('0x32')][_0xe2da('0x51')]({'where':{'id':_0x3c7119['params']['id']}})[_0xe2da('0x1c')](handleEntityNotFound(_0x43e447,null))['then'](function(_0x58555e){if(_0x58555e){_0x3934f2=_0x58555e;_0x2937f2[_0xe2da('0x34')]=_[_0xe2da('0x35')](db[_0xe2da('0x52')]['rawAttributes']);_0x2937f2[_0xe2da('0x36')]=_[_0xe2da('0x35')](_0x3c7119[_0xe2da('0x36')]);_0x2937f2[_0xe2da('0x3f')]=_['intersection'](_0x2937f2[_0xe2da('0x34')],_0x2937f2['query']);_0x298511['attributes']=_[_0xe2da('0x37')](_0x2937f2[_0xe2da('0x34')],qs[_0xe2da('0x39')](_0x3c7119[_0xe2da('0x36')][_0xe2da('0x39')]));_0x298511[_0xe2da('0x38')]=_0x298511['attributes'][_0xe2da('0x3a')]?_0x298511[_0xe2da('0x38')]:_0x2937f2[_0xe2da('0x34')];_0x298511['order']=qs[_0xe2da('0x3d')](_0x3c7119[_0xe2da('0x36')][_0xe2da('0x3d')]);_0x298511['where']=qs[_0xe2da('0x3f')](_[_0xe2da('0x40')](_0x3c7119[_0xe2da('0x36')],_0x2937f2[_0xe2da('0x3f')]));if(_0x3c7119[_0xe2da('0x36')]['filter']){_0x298511[_0xe2da('0x3e')]=_[_0xe2da('0x42')](_0x298511[_0xe2da('0x3e')],{'$or':_[_0xe2da('0x43')](_0x298511[_0xe2da('0x38')],function(_0x3f6082){var _0x1fff3f={};_0x1fff3f[_0x3f6082]={'$like':'%'+_0x3c7119[_0xe2da('0x36')][_0xe2da('0x41')]+'%'};return _0x1fff3f;})});}_0x298511=_['merge']({},_0x298511,_0x3c7119[_0xe2da('0x47')]);return _0x3934f2[_0xe2da('0x56')](_0x298511);}})['then'](function(_0x246357){if(_0x246357){_0x172745=_0x246357['length'];if(!_0x3c7119['query']['hasOwnProperty'](_0xe2da('0x53'))){_0x298511[_0xe2da('0x29')]=qs['limit'](_0x3c7119[_0xe2da('0x36')]['limit']);_0x298511[_0xe2da('0x28')]=qs[_0xe2da('0x28')](_0x3c7119[_0xe2da('0x36')][_0xe2da('0x28')]);}return _0x3934f2[_0xe2da('0x56')](_0x298511);}})[_0xe2da('0x1c')](function(_0x1af423){if(_0x1af423){return _0x1af423?{'count':_0x172745,'rows':_0x1af423}:null;}})['then'](respondWithResult(_0x43e447,null))['catch'](handleError(_0x43e447,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e0117f6..9f6583e 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 _0x9143=['util','api','request-promise','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9143,0x107));var _0x3914=function(_0x12ecec,_0x1f1c7e){_0x12ecec=_0x12ecec-0x0;var _0x7446a0=_0x9143[_0x12ecec];return _0x7446a0;};'use strict';var _=require(_0x3914('0x0'));var util=require(_0x3914('0x1'));var logger=require('../../config/logger')(_0x3914('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3914('0x3'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x3914('0x4')]=function(_0x59492f,_0x378c6a){return _0x59492f[_0x3914('0x5')](_0x3914('0x6'),attributes,{'tableName':_0x3914('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0463=['./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x0463,0x144));var _0x3046=function(_0x57a355,_0x3362c8){_0x57a355=_0x57a355-0x0;var _0x35e808=_0x0463[_0x57a355];return _0x35e808;};'use strict';var _=require(_0x3046('0x0'));var util=require(_0x3046('0x1'));var logger=require(_0x3046('0x2'))(_0x3046('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x3046('0x4'));module[_0x3046('0x5')]=function(_0x412681,_0x20cca7){return _0x412681['define'](_0x3046('0x6'),attributes,{'tableName':_0x3046('0x7'),'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 38bc843..f165929 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 _0xde20=['result','catch','lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x1eb18f,_0x5097a7){var _0x4c5fb6=function(_0x579786){while(--_0x579786){_0x1eb18f['push'](_0x1eb18f['shift']());}};_0x4c5fb6(++_0x5097a7);}(_0xde20,0xe6));var _0x0de2=function(_0x3ab681,_0x53c521){_0x3ab681=_0x3ab681-0x0;var _0x1efc8a=_0xde20[_0x3ab681];return _0x1efc8a;};'use strict';var _=require(_0x0de2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0de2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0de2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0de2('0x3'))(_0x0de2('0x4'));var config=require(_0x0de2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0de2('0x6')][_0x0de2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x246b45,_0x4024bf,_0xf93f46){return new BPromise(function(_0x433acb,_0x4b4041){return client['request'](_0x246b45,_0xf93f46)[_0x0de2('0x8')](function(_0x3f7476){logger[_0x0de2('0x9')](_0x0de2('0xa'),_0x4024bf,'request\x20sent');logger[_0x0de2('0xb')](_0x0de2('0xc'),_0x4024bf,_0x0de2('0xd'),JSON['stringify'](_0x3f7476));if(_0x3f7476[_0x0de2('0xe')]){if(_0x3f7476[_0x0de2('0xe')][_0x0de2('0xf')]===0x1f4){logger[_0x0de2('0xe')](_0x0de2('0xa'),_0x4024bf,_0x3f7476[_0x0de2('0xe')][_0x0de2('0x10')]);return _0x4b4041(_0x3f7476[_0x0de2('0xe')]['message']);}logger[_0x0de2('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4024bf,_0x3f7476[_0x0de2('0xe')][_0x0de2('0x10')]);return _0x433acb(_0x3f7476[_0x0de2('0xe')][_0x0de2('0x10')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x4024bf,'request\x20sent');_0x433acb(_0x3f7476[_0x0de2('0x11')][_0x0de2('0x10')]);}})[_0x0de2('0x12')](function(_0x369ae1){logger[_0x0de2('0xe')](_0x0de2('0xa'),_0x4024bf,_0x369ae1);_0x4b4041(_0x369ae1);});});} \ No newline at end of file +var _0x6666=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','result','catch'];(function(_0xcebf99,_0xc51861){var _0x3e72d3=function(_0x53c2d0){while(--_0x53c2d0){_0xcebf99['push'](_0xcebf99['shift']());}};_0x3e72d3(++_0xc51861);}(_0x6666,0xb4));var _0x6666=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x6666[_0x525af9];return _0x129fbf;};'use strict';var _=require(_0x6666('0x0'));var util=require('util');var moment=require(_0x6666('0x1'));var BPromise=require(_0x6666('0x2'));var rs=require(_0x6666('0x3'));var fs=require('fs');var Redis=require(_0x6666('0x4'));var db=require(_0x6666('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6666('0x6'));var jayson=require(_0x6666('0x7'));var client=jayson[_0x6666('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52301c,_0x4c1207,_0x1e6932){return new BPromise(function(_0x29978b,_0x917803){return client[_0x6666('0x9')](_0x52301c,_0x1e6932)['then'](function(_0x138a7a){logger[_0x6666('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4c1207,_0x6666('0xb'));logger['debug'](_0x6666('0xc'),_0x4c1207,_0x6666('0xb'),JSON[_0x6666('0xd')](_0x138a7a));if(_0x138a7a[_0x6666('0xe')]){if(_0x138a7a[_0x6666('0xe')][_0x6666('0xf')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x4c1207,_0x138a7a[_0x6666('0xe')]['message']);return _0x917803(_0x138a7a['error'][_0x6666('0x10')]);}logger[_0x6666('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4c1207,_0x138a7a[_0x6666('0xe')]['message']);return _0x29978b(_0x138a7a[_0x6666('0xe')][_0x6666('0x10')]);}else{logger[_0x6666('0xa')](_0x6666('0x11'),_0x4c1207,'request\x20sent');_0x29978b(_0x138a7a[_0x6666('0x12')][_0x6666('0x10')]);}})[_0x6666('0x13')](function(_0x2f7fb6){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x4c1207,_0x2f7fb6);_0x917803(_0x2f7fb6);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 215b6b6..aadce98 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 _0x820e=['create','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post'];(function(_0x1444e5,_0x2bb1aa){var _0x3f9318=function(_0x1e79f5){while(--_0x1e79f5){_0x1444e5['push'](_0x1444e5['shift']());}};_0x3f9318(++_0x2bb1aa);}(_0x820e,0x17c));var _0xe820=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x820e[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xe820('0x0'));var path=require('path');var timeout=require(_0xe820('0x1'));var express=require(_0xe820('0x2'));var router=express['Router']();var auth=require(_0xe820('0x3'));var interaction=require(_0xe820('0x4'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0xe820('0x5')]('/',auth[_0xe820('0x6')](),controller[_0xe820('0x7')]);router['get'](_0xe820('0x8'),auth[_0xe820('0x6')](),controller[_0xe820('0x9')]);router[_0xe820('0xa')]('/',auth[_0xe820('0x6')](),controller[_0xe820('0xb')]);router[_0xe820('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xe820('0xd')]);router[_0xe820('0xe')](_0xe820('0x8'),auth[_0xe820('0x6')](),controller[_0xe820('0xf')]);module[_0xe820('0x10')]=router; \ No newline at end of file +var _0x56bb=['isAuthenticated','index','/:id','show','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0x1e0499,_0x2222ed){var _0x527766=function(_0xac41b8){while(--_0xac41b8){_0x1e0499['push'](_0x1e0499['shift']());}};_0x527766(++_0x2222ed);}(_0x56bb,0x158));var _0xb56b=function(_0x16732a,_0x46cf6e){_0x16732a=_0x16732a-0x0;var _0x370a71=_0x56bb[_0x16732a];return _0x370a71;};'use strict';var multer=require(_0xb56b('0x0'));var util=require(_0xb56b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb56b('0x2'));var router=express[_0xb56b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb56b('0x4'));var config=require(_0xb56b('0x5'));var controller=require(_0xb56b('0x6'));router['get']('/',auth[_0xb56b('0x7')](),controller[_0xb56b('0x8')]);router['get'](_0xb56b('0x9'),auth[_0xb56b('0x7')](),controller[_0xb56b('0xa')]);router['post']('/',auth[_0xb56b('0x7')](),controller['create']);router['put']('/:id',auth[_0xb56b('0x7')](),controller['update']);router['delete'](_0xb56b('0x9'),auth['isAuthenticated'](),controller[_0xb56b('0xb')]);module[_0xb56b('0xc')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 32a74b9..8063b6d 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 _0x2750=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x3fb560,_0x1e301f){var _0x4999b3=function(_0x4ad22e){while(--_0x4ad22e){_0x3fb560['push'](_0x3fb560['shift']());}};_0x4999b3(++_0x1e301f);}(_0x2750,0x13b));var _0x0275=function(_0x4348bd,_0x59ecc7){_0x4348bd=_0x4348bd-0x0;var _0x43dd2f=_0x2750[_0x4348bd];return _0x43dd2f;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'type':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),_0x0275('0x3'),_0x0275('0x4'),_0x0275('0x5')),'defaultValue':_0x0275('0x2')},'content':{'type':Sequelize[_0x0275('0x6')]},'key':{'type':Sequelize[_0x0275('0x6')]},'keyType':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),'variable',_0x0275('0x4'))},'keyContent':{'type':Sequelize[_0x0275('0x6')]},'idField':{'type':Sequelize[_0x0275('0x6')]},'nameField':{'type':Sequelize[_0x0275('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0275('0x6')]}}; \ No newline at end of file +var _0x2547=['variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x58bb33,_0x42c54d){var _0x1e9dc5=function(_0x65df99){while(--_0x65df99){_0x58bb33['push'](_0x58bb33['shift']());}};_0x1e9dc5(++_0x42c54d);}(_0x2547,0x1cd));var _0x7254=function(_0x5388d7,_0x3bb17d){_0x5388d7=_0x5388d7-0x0;var _0x4f0871=_0x2547[_0x5388d7];return _0x4f0871;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'type':{'type':Sequelize[_0x7254('0x1')](_0x7254('0x2'),_0x7254('0x3'),_0x7254('0x4'),_0x7254('0x5')),'defaultValue':_0x7254('0x2')},'content':{'type':Sequelize[_0x7254('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7254('0x1')](_0x7254('0x2'),_0x7254('0x3'),_0x7254('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7254('0x6')]},'nameField':{'type':Sequelize[_0x7254('0x6')]},'customField':{'type':Sequelize[_0x7254('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 5542d3d..88f20fb 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 _0xe666=['papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','then','error','stack','name','ServicenowField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','key','field','options','includeAll','findAll','show','params','include','find','catch','create','body','update','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5d734a,_0x18782b){var _0x281fda=function(_0x4d938d){while(--_0x4d938d){_0x5d734a['push'](_0x5d734a['shift']());}};_0x281fda(++_0x18782b);}(_0xe666,0x1ee));var _0x6e66=function(_0x325975,_0x3d4364){_0x325975=_0x325975-0x0;var _0x1f12dc=_0xe666[_0x325975];return _0x1f12dc;};'use strict';var pdf=require(_0x6e66('0x0'));var emlformat=require(_0x6e66('0x1'));var rimraf=require(_0x6e66('0x2'));var zipdir=require(_0x6e66('0x3'));var jsonpatch=require(_0x6e66('0x4'));var rp=require(_0x6e66('0x5'));var moment=require(_0x6e66('0x6'));var BPromise=require(_0x6e66('0x7'));var Mustache=require(_0x6e66('0x8'));var util=require('util');var path=require('path');var sox=require(_0x6e66('0x9'));var csv=require(_0x6e66('0xa'));var ejs=require(_0x6e66('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6e66('0xc'));var crypto=require(_0x6e66('0xd'));var jsforce=require(_0x6e66('0xe'));var deskjs=require(_0x6e66('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6e66('0x10'));var Papa=require(_0x6e66('0x11'));var authService=require(_0x6e66('0x12'));var hardwareService=require(_0x6e66('0x13'));var Redis=require('ioredis');var qs=require(_0x6e66('0x14'));var logger=require(_0x6e66('0x15'))(_0x6e66('0x16'));var utils=require(_0x6e66('0x17'));var config=require(_0x6e66('0x18'));var db=require(_0x6e66('0x19'))['db'];function respondWithStatusCode(_0x1d3de5,_0x288a87){_0x288a87=_0x288a87||0xcc;return function(_0x2d1341){if(_0x2d1341){return _0x1d3de5[_0x6e66('0x1a')](_0x288a87);}return _0x1d3de5[_0x6e66('0x1b')](_0x288a87)[_0x6e66('0x1c')]();};}function respondWithResult(_0x10a5c3,_0x5549a9){_0x5549a9=_0x5549a9||0xc8;return function(_0xe7710a){if(_0xe7710a){return _0x10a5c3[_0x6e66('0x1b')](_0x5549a9)['json'](_0xe7710a);}};}function respondWithFilteredResult(_0x2ed5a6,_0x1c885f){return function(_0x12af3c){if(_0x12af3c){var _0x511a84=_0x12af3c[_0x6e66('0x1d')],_0x5637ae=_0x1c885f[_0x6e66('0x1e')],_0x907edd=_0x1c885f[_0x6e66('0x1e')]+_0x1c885f['limit'],_0x343857;if(_0x907edd>=_0x511a84){_0x907edd=_0x511a84;_0x343857=0xc8;}else{_0x343857=0xce;}_0x2ed5a6['status'](_0x343857);return _0x2ed5a6['set'](_0x6e66('0x1f'),_0x5637ae+'-'+_0x907edd+'/'+_0x511a84)[_0x6e66('0x20')](_0x12af3c);}return null;};}function patchUpdates(_0x303731){return function(_0x4bed8d){try{jsonpatch[_0x6e66('0x21')](_0x4bed8d,_0x303731,!![]);}catch(_0x15774e){return BPromise[_0x6e66('0x22')](_0x15774e);}return _0x4bed8d[_0x6e66('0x23')]();};}function saveUpdates(_0x5eda82,_0x44f030){return function(_0x4b2927){if(_0x4b2927){return _0x4b2927['update'](_0x5eda82)[_0x6e66('0x24')](function(_0x262a64){return _0x262a64;});}return null;};}function removeEntity(_0x28f726,_0x5eb82d){return function(_0x5ce271){if(_0x5ce271){return _0x5ce271['destroy']()[_0x6e66('0x24')](function(){_0x28f726[_0x6e66('0x1b')](0xcc)[_0x6e66('0x1c')]();});}};}function handleEntityNotFound(_0x321fd8,_0x127159){return function(_0x46356c){if(!_0x46356c){_0x321fd8['sendStatus'](0x194);}return _0x46356c;};}function handleError(_0x209e2b,_0x5a2cee){_0x5a2cee=_0x5a2cee||0x1f4;return function(_0x4e392d){logger[_0x6e66('0x25')](_0x4e392d[_0x6e66('0x26')]);if(_0x4e392d[_0x6e66('0x27')]){delete _0x4e392d['name'];}_0x209e2b[_0x6e66('0x1b')](_0x5a2cee)['send'](_0x4e392d);};}exports['index']=function(_0x2dff74,_0x2b05f9){var _0x599c95={},_0x9f49b9={},_0x492dd3={'count':0x0,'rows':[]};var _0x2b577d=db[_0x6e66('0x28')][_0x6e66('0x29')];_0x9f49b9[_0x6e66('0x2a')]=_[_0x6e66('0x2b')](_0x2b577d);_0x9f49b9[_0x6e66('0x2c')]=_[_0x6e66('0x2b')](_0x2dff74[_0x6e66('0x2c')]);_0x9f49b9[_0x6e66('0x2d')]=_['intersection'](_0x9f49b9['model'],_0x9f49b9[_0x6e66('0x2c')]);_0x599c95[_0x6e66('0x2e')]=_[_0x6e66('0x2f')](_0x9f49b9[_0x6e66('0x2a')],qs[_0x6e66('0x30')](_0x2dff74['query']['fields']));_0x599c95['attributes']=_0x599c95[_0x6e66('0x2e')][_0x6e66('0x31')]?_0x599c95['attributes']:_0x9f49b9['model'];if(!_0x2dff74[_0x6e66('0x2c')][_0x6e66('0x32')](_0x6e66('0x33'))){_0x599c95[_0x6e66('0x34')]=qs[_0x6e66('0x34')](_0x2dff74[_0x6e66('0x2c')]['limit']);_0x599c95[_0x6e66('0x1e')]=qs[_0x6e66('0x1e')](_0x2dff74[_0x6e66('0x2c')]['offset']);}_0x599c95[_0x6e66('0x35')]=qs[_0x6e66('0x36')](_0x2dff74[_0x6e66('0x2c')][_0x6e66('0x36')]);_0x599c95[_0x6e66('0x37')]=qs['filters'](_['pick'](_0x2dff74[_0x6e66('0x2c')],_0x9f49b9[_0x6e66('0x2d')]));if(_0x2dff74[_0x6e66('0x2c')][_0x6e66('0x38')]){_0x599c95[_0x6e66('0x37')]=_[_0x6e66('0x39')](_0x599c95[_0x6e66('0x37')],{'$or':_[_0x6e66('0x3a')](_0x2b577d,function(_0x1647fe){if(_0x1647fe['type'][_0x6e66('0x3b')]!=='VIRTUAL'){var _0x276841={};_0x276841[_0x1647fe[_0x6e66('0x3c')]]={'$like':'%'+_0x2dff74[_0x6e66('0x2c')][_0x6e66('0x38')]+'%'};return _0x276841;}})});}_0x599c95=_['merge']({},_0x599c95,_0x2dff74[_0x6e66('0x3d')]);var _0x1016d9={'where':_0x599c95[_0x6e66('0x37')]};return db['ServicenowField'][_0x6e66('0x1d')](_0x1016d9)[_0x6e66('0x24')](function(_0x174135){_0x492dd3[_0x6e66('0x1d')]=_0x174135;if(_0x2dff74['query'][_0x6e66('0x3e')]){_0x599c95['include']=[{'all':!![]}];}return db[_0x6e66('0x28')][_0x6e66('0x3f')](_0x599c95);})['then'](function(_0xb0f99e){_0x492dd3['rows']=_0xb0f99e;return _0x492dd3;})[_0x6e66('0x24')](respondWithFilteredResult(_0x2b05f9,_0x599c95))['catch'](handleError(_0x2b05f9,null));};exports[_0x6e66('0x40')]=function(_0x4d96c3,_0x30f832){var _0x22a5a7={'raw':!![],'where':{'id':_0x4d96c3[_0x6e66('0x41')]['id']}},_0x53235f={};_0x53235f[_0x6e66('0x2a')]=_['keys'](db[_0x6e66('0x28')]['rawAttributes']);_0x53235f[_0x6e66('0x2c')]=_[_0x6e66('0x2b')](_0x4d96c3[_0x6e66('0x2c')]);_0x53235f[_0x6e66('0x2d')]=_['intersection'](_0x53235f[_0x6e66('0x2a')],_0x53235f[_0x6e66('0x2c')]);_0x22a5a7[_0x6e66('0x2e')]=_[_0x6e66('0x2f')](_0x53235f[_0x6e66('0x2a')],qs[_0x6e66('0x30')](_0x4d96c3[_0x6e66('0x2c')][_0x6e66('0x30')]));_0x22a5a7['attributes']=_0x22a5a7['attributes']['length']?_0x22a5a7[_0x6e66('0x2e')]:_0x53235f[_0x6e66('0x2a')];if(_0x4d96c3[_0x6e66('0x2c')][_0x6e66('0x3e')]){_0x22a5a7[_0x6e66('0x42')]=[{'all':!![]}];}_0x22a5a7=_['merge']({},_0x22a5a7,_0x4d96c3['options']);return db[_0x6e66('0x28')][_0x6e66('0x43')](_0x22a5a7)[_0x6e66('0x24')](handleEntityNotFound(_0x30f832,null))[_0x6e66('0x24')](respondWithResult(_0x30f832,null))[_0x6e66('0x44')](handleError(_0x30f832,null));};exports[_0x6e66('0x45')]=function(_0x31f0bd,_0x1b552e){return db[_0x6e66('0x28')][_0x6e66('0x45')](_0x31f0bd[_0x6e66('0x46')],{})[_0x6e66('0x24')](respondWithResult(_0x1b552e,0xc9))['catch'](handleError(_0x1b552e,null));};exports[_0x6e66('0x47')]=function(_0x1a92b0,_0x354a4c){if(_0x1a92b0[_0x6e66('0x46')]['id']){delete _0x1a92b0[_0x6e66('0x46')]['id'];}return db[_0x6e66('0x28')]['find']({'where':{'id':_0x1a92b0[_0x6e66('0x41')]['id']}})[_0x6e66('0x24')](handleEntityNotFound(_0x354a4c,null))[_0x6e66('0x24')](saveUpdates(_0x1a92b0[_0x6e66('0x46')],null))['then'](respondWithResult(_0x354a4c,null))[_0x6e66('0x44')](handleError(_0x354a4c,null));};exports[_0x6e66('0x48')]=function(_0xeeffff,_0x37ae5c){return db[_0x6e66('0x28')][_0x6e66('0x43')]({'where':{'id':_0xeeffff[_0x6e66('0x41')]['id']}})['then'](handleEntityNotFound(_0x37ae5c,null))['then'](removeEntity(_0x37ae5c,null))['catch'](handleError(_0x37ae5c,null));}; \ No newline at end of file +var _0xbab1=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','end','error','stack','name','send','ServicenowField','model','query','filters','intersection','fields','attributes','nolimit','sort','filter','where','type','key','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','merge','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0xbab1,0x73));var _0x1bab=function(_0xac99d9,_0x1d6a41){_0xac99d9=_0xac99d9-0x0;var _0x2c2432=_0xbab1[_0xac99d9];return _0x2c2432;};'use strict';var pdf=require(_0x1bab('0x0'));var emlformat=require(_0x1bab('0x1'));var rimraf=require(_0x1bab('0x2'));var zipdir=require(_0x1bab('0x3'));var jsonpatch=require(_0x1bab('0x4'));var rp=require(_0x1bab('0x5'));var moment=require(_0x1bab('0x6'));var BPromise=require(_0x1bab('0x7'));var Mustache=require(_0x1bab('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1bab('0x9'));var ejs=require(_0x1bab('0xa'));var fs=require('fs');var _=require(_0x1bab('0xb'));var squel=require(_0x1bab('0xc'));var crypto=require(_0x1bab('0xd'));var jsforce=require(_0x1bab('0xe'));var deskjs=require(_0x1bab('0xf'));var toCsv=require(_0x1bab('0x9'));var querystring=require(_0x1bab('0x10'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x1bab('0x11'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x1bab('0x12'))(_0x1bab('0x13'));var utils=require(_0x1bab('0x14'));var config=require(_0x1bab('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ea857,_0x387196){_0x387196=_0x387196||0xcc;return function(_0xcc959){if(_0xcc959){return _0x4ea857[_0x1bab('0x16')](_0x387196);}return _0x4ea857['status'](_0x387196)['end']();};}function respondWithResult(_0x31f072,_0x328c7a){_0x328c7a=_0x328c7a||0xc8;return function(_0x5dd1e0){if(_0x5dd1e0){return _0x31f072[_0x1bab('0x17')](_0x328c7a)[_0x1bab('0x18')](_0x5dd1e0);}};}function respondWithFilteredResult(_0x4d15ba,_0x46201e){return function(_0x5e2faa){if(_0x5e2faa){var _0x1b6ed8=_0x5e2faa['count'],_0x2eba14=_0x46201e[_0x1bab('0x19')],_0x517bed=_0x46201e[_0x1bab('0x19')]+_0x46201e[_0x1bab('0x1a')],_0x3f8771;if(_0x517bed>=_0x1b6ed8){_0x517bed=_0x1b6ed8;_0x3f8771=0xc8;}else{_0x3f8771=0xce;}_0x4d15ba[_0x1bab('0x17')](_0x3f8771);return _0x4d15ba[_0x1bab('0x1b')](_0x1bab('0x1c'),_0x2eba14+'-'+_0x517bed+'/'+_0x1b6ed8)['json'](_0x5e2faa);}return null;};}function patchUpdates(_0x4a1ba7){return function(_0x214a29){try{jsonpatch['apply'](_0x214a29,_0x4a1ba7,!![]);}catch(_0xf2c0e8){return BPromise[_0x1bab('0x1d')](_0xf2c0e8);}return _0x214a29[_0x1bab('0x1e')]();};}function saveUpdates(_0x37ddfc,_0x2cfd70){return function(_0x2de750){if(_0x2de750){return _0x2de750[_0x1bab('0x1f')](_0x37ddfc)[_0x1bab('0x20')](function(_0x34e191){return _0x34e191;});}return null;};}function removeEntity(_0x3dab8e,_0x9b8259){return function(_0x42dbf4){if(_0x42dbf4){return _0x42dbf4['destroy']()[_0x1bab('0x20')](function(){_0x3dab8e[_0x1bab('0x17')](0xcc)[_0x1bab('0x21')]();});}};}function handleEntityNotFound(_0x4b55c,_0x2fa6e7){return function(_0x3eb1ff){if(!_0x3eb1ff){_0x4b55c[_0x1bab('0x16')](0x194);}return _0x3eb1ff;};}function handleError(_0xd5c4f0,_0x7fe167){_0x7fe167=_0x7fe167||0x1f4;return function(_0x2dbef7){logger[_0x1bab('0x22')](_0x2dbef7[_0x1bab('0x23')]);if(_0x2dbef7['name']){delete _0x2dbef7[_0x1bab('0x24')];}_0xd5c4f0[_0x1bab('0x17')](_0x7fe167)[_0x1bab('0x25')](_0x2dbef7);};}exports['index']=function(_0x40e62d,_0x2af7dc){var _0x58036f={},_0x2c9bf8={},_0x56ebf5={'count':0x0,'rows':[]};var _0x43359f=db[_0x1bab('0x26')]['rawAttributes'];_0x2c9bf8[_0x1bab('0x27')]=_['keys'](_0x43359f);_0x2c9bf8['query']=_['keys'](_0x40e62d[_0x1bab('0x28')]);_0x2c9bf8[_0x1bab('0x29')]=_[_0x1bab('0x2a')](_0x2c9bf8['model'],_0x2c9bf8[_0x1bab('0x28')]);_0x58036f['attributes']=_['intersection'](_0x2c9bf8[_0x1bab('0x27')],qs[_0x1bab('0x2b')](_0x40e62d[_0x1bab('0x28')][_0x1bab('0x2b')]));_0x58036f['attributes']=_0x58036f[_0x1bab('0x2c')]['length']?_0x58036f[_0x1bab('0x2c')]:_0x2c9bf8['model'];if(!_0x40e62d[_0x1bab('0x28')]['hasOwnProperty'](_0x1bab('0x2d'))){_0x58036f['limit']=qs[_0x1bab('0x1a')](_0x40e62d[_0x1bab('0x28')]['limit']);_0x58036f[_0x1bab('0x19')]=qs[_0x1bab('0x19')](_0x40e62d['query'][_0x1bab('0x19')]);}_0x58036f['order']=qs[_0x1bab('0x2e')](_0x40e62d[_0x1bab('0x28')]['sort']);_0x58036f['where']=qs['filters'](_['pick'](_0x40e62d[_0x1bab('0x28')],_0x2c9bf8[_0x1bab('0x29')]));if(_0x40e62d[_0x1bab('0x28')][_0x1bab('0x2f')]){_0x58036f[_0x1bab('0x30')]=_['merge'](_0x58036f['where'],{'$or':_['map'](_0x43359f,function(_0x5edc9f){if(_0x5edc9f[_0x1bab('0x31')][_0x1bab('0x32')]!==_0x1bab('0x33')){var _0xd67f4f={};_0xd67f4f[_0x5edc9f['field']]={'$like':'%'+_0x40e62d[_0x1bab('0x28')]['filter']+'%'};return _0xd67f4f;}})});}_0x58036f=_['merge']({},_0x58036f,_0x40e62d[_0x1bab('0x34')]);var _0x1eedd3={'where':_0x58036f[_0x1bab('0x30')]};return db['ServicenowField'][_0x1bab('0x35')](_0x1eedd3)[_0x1bab('0x20')](function(_0x2d0f8a){_0x56ebf5[_0x1bab('0x35')]=_0x2d0f8a;if(_0x40e62d[_0x1bab('0x28')][_0x1bab('0x36')]){_0x58036f[_0x1bab('0x37')]=[{'all':!![]}];}return db[_0x1bab('0x26')]['findAll'](_0x58036f);})[_0x1bab('0x20')](function(_0xec8d9){_0x56ebf5[_0x1bab('0x38')]=_0xec8d9;return _0x56ebf5;})[_0x1bab('0x20')](respondWithFilteredResult(_0x2af7dc,_0x58036f))['catch'](handleError(_0x2af7dc,null));};exports[_0x1bab('0x39')]=function(_0x525e0d,_0x401d18){var _0x4c1592={'raw':!![],'where':{'id':_0x525e0d[_0x1bab('0x3a')]['id']}},_0x141061={};_0x141061[_0x1bab('0x27')]=_[_0x1bab('0x3b')](db[_0x1bab('0x26')]['rawAttributes']);_0x141061['query']=_[_0x1bab('0x3b')](_0x525e0d[_0x1bab('0x28')]);_0x141061[_0x1bab('0x29')]=_[_0x1bab('0x2a')](_0x141061[_0x1bab('0x27')],_0x141061[_0x1bab('0x28')]);_0x4c1592['attributes']=_[_0x1bab('0x2a')](_0x141061['model'],qs['fields'](_0x525e0d[_0x1bab('0x28')]['fields']));_0x4c1592[_0x1bab('0x2c')]=_0x4c1592[_0x1bab('0x2c')]['length']?_0x4c1592[_0x1bab('0x2c')]:_0x141061['model'];if(_0x525e0d[_0x1bab('0x28')]['includeAll']){_0x4c1592[_0x1bab('0x37')]=[{'all':!![]}];}_0x4c1592=_[_0x1bab('0x3c')]({},_0x4c1592,_0x525e0d['options']);return db['ServicenowField'][_0x1bab('0x3d')](_0x4c1592)[_0x1bab('0x20')](handleEntityNotFound(_0x401d18,null))[_0x1bab('0x20')](respondWithResult(_0x401d18,null))[_0x1bab('0x3e')](handleError(_0x401d18,null));};exports[_0x1bab('0x3f')]=function(_0x16506a,_0x3e0df2){return db[_0x1bab('0x26')][_0x1bab('0x3f')](_0x16506a[_0x1bab('0x40')],{})[_0x1bab('0x20')](respondWithResult(_0x3e0df2,0xc9))['catch'](handleError(_0x3e0df2,null));};exports['update']=function(_0x17b435,_0x32a532){if(_0x17b435[_0x1bab('0x40')]['id']){delete _0x17b435[_0x1bab('0x40')]['id'];}return db[_0x1bab('0x26')]['find']({'where':{'id':_0x17b435['params']['id']}})['then'](handleEntityNotFound(_0x32a532,null))[_0x1bab('0x20')](saveUpdates(_0x17b435[_0x1bab('0x40')],null))[_0x1bab('0x20')](respondWithResult(_0x32a532,null))[_0x1bab('0x3e')](handleError(_0x32a532,null));};exports[_0x1bab('0x41')]=function(_0x2b50d5,_0x33c73b){return db[_0x1bab('0x26')][_0x1bab('0x3d')]({'where':{'id':_0x2b50d5['params']['id']}})[_0x1bab('0x20')](handleEntityNotFound(_0x33c73b,null))['then'](removeEntity(_0x33c73b,null))[_0x1bab('0x3e')](handleError(_0x33c73b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index de87dfc..fd8fb10 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 _0x1f9e=['bluebird','request-promise','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x1067df,_0x2051e2){var _0x11415d=function(_0x306f45){while(--_0x306f45){_0x1067df['push'](_0x1067df['shift']());}};_0x11415d(++_0x2051e2);}(_0x1f9e,0x14d));var _0xe1f9=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x1f9e[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0xe1f9('0x0'));var util=require('util');var logger=require(_0xe1f9('0x1'))('api');var moment=require(_0xe1f9('0x2'));var BPromise=require(_0xe1f9('0x3'));var rp=require(_0xe1f9('0x4'));var attributes=require(_0xe1f9('0x5'));module[_0xe1f9('0x6')]=function(_0x4b3c32,_0x81c1c6){return _0x4b3c32[_0xe1f9('0x7')](_0xe1f9('0x8'),attributes,{'tableName':_0xe1f9('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xe1f9('0xa'),_0xe1f9('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x26f6=['servicenow_unique_index','idField','FieldId','../../config/logger','api','moment','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x26f6,0xe9));var _0x626f=function(_0x5c9229,_0xa75e2d){_0x5c9229=_0x5c9229-0x0;var _0x14d485=_0x26f6[_0x5c9229];return _0x14d485;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x626f('0x0'))(_0x626f('0x1'));var moment=require(_0x626f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./intServicenowField.attributes');module[_0x626f('0x3')]=function(_0x42c021,_0x1e9051){return _0x42c021[_0x626f('0x4')](_0x626f('0x5'),attributes,{'tableName':_0x626f('0x6'),'paranoid':![],'indexes':[{'name':_0x626f('0x7'),'fields':[_0x626f('0x8'),_0x626f('0x9')],'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 a2cf464..c717c7a 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 _0x8e3f=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x962edb,_0x5dd356){var _0x359dcf=function(_0x978f40){while(--_0x978f40){_0x962edb['push'](_0x962edb['shift']());}};_0x359dcf(++_0x5dd356);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});} \ No newline at end of file +var _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x22d687,_0x33e289){var _0x4a3fba=function(_0x5c6993){while(--_0x5c6993){_0x22d687['push'](_0x22d687['shift']());}};_0x4a3fba(++_0x33e289);}(_0x90b1,0x1bb));var _0x190b=function(_0x261a4a,_0x389a4f){_0x261a4a=_0x261a4a-0x0;var _0xc8d5b4=_0x90b1[_0x261a4a];return _0xc8d5b4;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('ServicenowField,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index c01b8ff..fee8c02 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 _0xc155=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','post','addConfiguration','update','delete','destroy','multer','util','path'];(function(_0x310c20,_0x71b3ad){var _0x1b2a54=function(_0x530552){while(--_0x530552){_0x310c20['push'](_0x310c20['shift']());}};_0x1b2a54(++_0x71b3ad);}(_0xc155,0x90));var _0x5c15=function(_0xc325fe,_0x399d8f){_0xc325fe=_0xc325fe-0x0;var _0x2b2114=_0xc155[_0xc325fe];return _0x2b2114;};'use strict';var multer=require(_0x5c15('0x0'));var util=require(_0x5c15('0x1'));var path=require(_0x5c15('0x2'));var timeout=require(_0x5c15('0x3'));var express=require(_0x5c15('0x4'));var router=express[_0x5c15('0x5')]();var auth=require(_0x5c15('0x6'));var interaction=require(_0x5c15('0x7'));var config=require('../../config/environment');var controller=require(_0x5c15('0x8'));router[_0x5c15('0x9')]('/',auth['isAuthenticated'](),controller[_0x5c15('0xa')]);router[_0x5c15('0x9')](_0x5c15('0xb'),auth['isAuthenticated'](),controller[_0x5c15('0xc')]);router[_0x5c15('0x9')](_0x5c15('0xd'),auth[_0x5c15('0xe')](),controller['getConfigurations']);router['get'](_0x5c15('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x5c15('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5c15('0x10')](_0x5c15('0xd'),auth['isAuthenticated'](),controller[_0x5c15('0x11')]);router['put']('/:id',auth[_0x5c15('0xe')](),controller[_0x5c15('0x12')]);router[_0x5c15('0x13')]('/:id',auth[_0x5c15('0xe')](),controller[_0x5c15('0x14')]);module['exports']=router; \ No newline at end of file +var _0x69c9=['./intSugarcrmAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getFields','post','create','addConfiguration','put','/:id','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x54d72f,_0x40ec59){var _0x179e0d=function(_0x53b5b9){while(--_0x53b5b9){_0x54d72f['push'](_0x54d72f['shift']());}};_0x179e0d(++_0x40ec59);}(_0x69c9,0xf5));var _0x969c=function(_0x38ef30,_0xce27cf){_0x38ef30=_0x38ef30-0x0;var _0x264012=_0x69c9[_0x38ef30];return _0x264012;};'use strict';var multer=require('multer');var util=require(_0x969c('0x0'));var path=require('path');var timeout=require(_0x969c('0x1'));var express=require(_0x969c('0x2'));var router=express[_0x969c('0x3')]();var auth=require(_0x969c('0x4'));var interaction=require(_0x969c('0x5'));var config=require(_0x969c('0x6'));var controller=require(_0x969c('0x7'));router[_0x969c('0x8')]('/',auth[_0x969c('0x9')](),controller[_0x969c('0xa')]);router[_0x969c('0x8')]('/:id',auth[_0x969c('0x9')](),controller[_0x969c('0xb')]);router[_0x969c('0x8')](_0x969c('0xc'),auth[_0x969c('0x9')](),controller['getConfigurations']);router[_0x969c('0x8')]('/:id/fields',auth[_0x969c('0x9')](),controller[_0x969c('0xd')]);router[_0x969c('0xe')]('/',auth[_0x969c('0x9')](),controller[_0x969c('0xf')]);router['post'](_0x969c('0xc'),auth['isAuthenticated'](),controller[_0x969c('0x10')]);router[_0x969c('0x11')](_0x969c('0x12'),auth[_0x969c('0x9')](),controller['update']);router[_0x969c('0x13')](_0x969c('0x12'),auth['isAuthenticated'](),controller[_0x969c('0x14')]);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 c457789..8797d85 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 _0x4373=['exports','STRING','remoteUri','sequelize'];(function(_0x1474ec,_0x1a4304){var _0x4dd06c=function(_0x2ecc44){while(--_0x2ecc44){_0x1474ec['push'](_0x1474ec['shift']());}};_0x4dd06c(++_0x1a4304);}(_0x4373,0x1ab));var _0x3437=function(_0x24ef60,_0x563ae0){_0x24ef60=_0x24ef60-0x0;var _0x309a1d=_0x4373[_0x24ef60];return _0x309a1d;};'use strict';var Sequelize=require(_0x3437('0x0'));module[_0x3437('0x1')]={'name':{'type':Sequelize[_0x3437('0x2')]},'description':{'type':Sequelize[_0x3437('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3437('0x2')],'unique':_0x3437('0x3')},'serverUrl':{'type':Sequelize[_0x3437('0x2')]}}; \ No newline at end of file +var _0x52ed=['remoteUri','sequelize','exports','STRING','username'];(function(_0x136426,_0x57907c){var _0x43d306=function(_0x4816b6){while(--_0x4816b6){_0x136426['push'](_0x136426['shift']());}};_0x43d306(++_0x57907c);}(_0x52ed,0xab));var _0xd52e=function(_0x1b9c2a,_0x50582e){_0x1b9c2a=_0x1b9c2a-0x0;var _0x21ab47=_0x52ed[_0x1b9c2a];return _0x21ab47;};'use strict';var Sequelize=require(_0xd52e('0x0'));module[_0xd52e('0x1')]={'name':{'type':Sequelize[_0xd52e('0x2')]},'description':{'type':Sequelize[_0xd52e('0x2')]},'username':{'type':Sequelize[_0xd52e('0x2')],'unique':_0xd52e('0x3')},'password':{'type':Sequelize[_0xd52e('0x2')]},'remoteUri':{'type':Sequelize[_0xd52e('0x2')],'unique':_0xd52e('0x4')},'serverUrl':{'type':Sequelize[_0xd52e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 878c4c6..1000034 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 _0xcf1e=['includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','http','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','name','send','index','SugarcrmAccount','rawAttributes','model','query','keys','attributes','intersection','fields','nolimit','limit','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','then','include','findAll','rows','show','params','length','includeAll','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','order','map','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','password','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','username','PLAIN','Invalid\x20Login','values','module_fields'];(function(_0x5109c1,_0x37195b){var _0x47c577=function(_0x573ed4){while(--_0x573ed4){_0x5109c1['push'](_0x5109c1['shift']());}};_0x47c577(++_0x37195b);}(_0xcf1e,0x88));var _0xecf1=function(_0x2278de,_0x25cc69){_0x2278de=_0x2278de-0x0;var _0x3ed51f=_0xcf1e[_0x2278de];return _0x3ed51f;};'use strict';var pdf=require(_0xecf1('0x0'));var emlformat=require(_0xecf1('0x1'));var rimraf=require(_0xecf1('0x2'));var zipdir=require(_0xecf1('0x3'));var jsonpatch=require(_0xecf1('0x4'));var rp=require(_0xecf1('0x5'));var moment=require(_0xecf1('0x6'));var BPromise=require(_0xecf1('0x7'));var Mustache=require(_0xecf1('0x8'));var util=require(_0xecf1('0x9'));var path=require('path');var sox=require(_0xecf1('0xa'));var csv=require(_0xecf1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xecf1('0xc'));var crypto=require(_0xecf1('0xd'));var jsforce=require(_0xecf1('0xe'));var deskjs=require(_0xecf1('0xf'));var toCsv=require(_0xecf1('0xb'));var querystring=require(_0xecf1('0x10'));var Papa=require(_0xecf1('0x11'));var authService=require(_0xecf1('0x12'));var hardwareService=require(_0xecf1('0x13'));var Redis=require(_0xecf1('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xecf1('0x15'))('api');var utils=require(_0xecf1('0x16'));var config=require(_0xecf1('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xecf1('0x18'));var jayson=require('jayson/promise');var client=jayson['client'][_0xecf1('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3d3908,_0x1e4b10,_0x51949f,_0x342d99){return new BPromise(function(_0x493c0a,_0x174a1e){var _0x2f03b9=_0x342d99||client;return _0x2f03b9[_0xecf1('0x1a')](_0x3d3908,_0x51949f)['then'](function(_0x132d96){logger[_0xecf1('0x1b')]('SugarcrmAccount,\x20%s,\x20%s',_0x1e4b10,_0xecf1('0x1c'));logger[_0xecf1('0x1d')](_0xecf1('0x1e'),_0x1e4b10,'request\x20sent',JSON[_0xecf1('0x1f')](_0x132d96));if(_0x132d96[_0xecf1('0x20')]){if(_0x132d96['error'][_0xecf1('0x21')]===0x1f4){logger['error'](_0xecf1('0x22'),_0x1e4b10,_0x132d96['error'][_0xecf1('0x23')]);return _0x174a1e(_0x132d96[_0xecf1('0x20')][_0xecf1('0x23')]);}logger[_0xecf1('0x20')](_0xecf1('0x22'),_0x1e4b10,_0x132d96['error'][_0xecf1('0x23')]);return _0x493c0a(_0x132d96[_0xecf1('0x20')][_0xecf1('0x23')]);}else{logger['info'](_0xecf1('0x22'),_0x1e4b10,_0xecf1('0x1c'));_0x493c0a(_0x132d96['result'][_0xecf1('0x23')]);}})[_0xecf1('0x24')](function(_0x1e2167){logger['error'](_0xecf1('0x22'),_0x1e4b10,_0x1e2167);_0x174a1e(_0x1e2167);});});}function respondWithStatusCode(_0x2a9c40,_0x5d41bd){_0x5d41bd=_0x5d41bd||0xcc;return function(_0x250b34){if(_0x250b34){return _0x2a9c40[_0xecf1('0x25')](_0x5d41bd);}return _0x2a9c40[_0xecf1('0x26')](_0x5d41bd)[_0xecf1('0x27')]();};}function respondWithResult(_0x3c1e2c,_0x69bf0d){_0x69bf0d=_0x69bf0d||0xc8;return function(_0x38cc17){if(_0x38cc17){return _0x3c1e2c['status'](_0x69bf0d)['json'](_0x38cc17);}};}function respondWithFilteredResult(_0x50562,_0x322589){return function(_0xbe031e){if(_0xbe031e){var _0x1e8b2f=_0xbe031e[_0xecf1('0x28')],_0x28aca1=_0x322589[_0xecf1('0x29')],_0x35b1f5=_0x322589[_0xecf1('0x29')]+_0x322589['limit'],_0x3c9a80;if(_0x35b1f5>=_0x1e8b2f){_0x35b1f5=_0x1e8b2f;_0x3c9a80=0xc8;}else{_0x3c9a80=0xce;}_0x50562[_0xecf1('0x26')](_0x3c9a80);return _0x50562[_0xecf1('0x2a')](_0xecf1('0x2b'),_0x28aca1+'-'+_0x35b1f5+'/'+_0x1e8b2f)[_0xecf1('0x2c')](_0xbe031e);}return null;};}function patchUpdates(_0x5977b3){return function(_0x43c984){try{jsonpatch[_0xecf1('0x2d')](_0x43c984,_0x5977b3,!![]);}catch(_0x3e0986){return BPromise['reject'](_0x3e0986);}return _0x43c984[_0xecf1('0x2e')]();};}function saveUpdates(_0x382ac1,_0x3b3e6e){return function(_0x5f160d){if(_0x5f160d){return _0x5f160d[_0xecf1('0x2f')](_0x382ac1)['then'](function(_0x37f9b4){return _0x37f9b4;});}return null;};}function removeEntity(_0x506782,_0x5437e7){return function(_0x2d9b56){if(_0x2d9b56){return _0x2d9b56['destroy']()['then'](function(){_0x506782[_0xecf1('0x26')](0xcc)[_0xecf1('0x27')]();});}};}function handleEntityNotFound(_0x35420d,_0x2b9277){return function(_0x49908c){if(!_0x49908c){_0x35420d[_0xecf1('0x25')](0x194);}return _0x49908c;};}function handleError(_0x263b36,_0x589b5a){_0x589b5a=_0x589b5a||0x1f4;return function(_0x44755e){logger[_0xecf1('0x20')](_0x44755e['stack']);if(_0x44755e[_0xecf1('0x30')]){delete _0x44755e[_0xecf1('0x30')];}_0x263b36[_0xecf1('0x26')](_0x589b5a)[_0xecf1('0x31')](_0x44755e);};}exports[_0xecf1('0x32')]=function(_0xfb7118,_0x3ef2e1){var _0x2c066a={},_0x452f62={},_0x187b0c={'count':0x0,'rows':[]};var _0x51a0ca=db[_0xecf1('0x33')][_0xecf1('0x34')];_0x452f62[_0xecf1('0x35')]=_['keys'](_0x51a0ca);_0x452f62[_0xecf1('0x36')]=_[_0xecf1('0x37')](_0xfb7118[_0xecf1('0x36')]);_0x452f62['filters']=_['intersection'](_0x452f62['model'],_0x452f62[_0xecf1('0x36')]);_0x2c066a[_0xecf1('0x38')]=_[_0xecf1('0x39')](_0x452f62['model'],qs[_0xecf1('0x3a')](_0xfb7118[_0xecf1('0x36')][_0xecf1('0x3a')]));_0x2c066a[_0xecf1('0x38')]=_0x2c066a[_0xecf1('0x38')]['length']?_0x2c066a[_0xecf1('0x38')]:_0x452f62['model'];if(!_0xfb7118['query']['hasOwnProperty'](_0xecf1('0x3b'))){_0x2c066a[_0xecf1('0x3c')]=qs[_0xecf1('0x3c')](_0xfb7118[_0xecf1('0x36')][_0xecf1('0x3c')]);_0x2c066a[_0xecf1('0x29')]=qs[_0xecf1('0x29')](_0xfb7118[_0xecf1('0x36')][_0xecf1('0x29')]);}_0x2c066a['order']=qs[_0xecf1('0x3d')](_0xfb7118[_0xecf1('0x36')][_0xecf1('0x3d')]);_0x2c066a[_0xecf1('0x3e')]=qs[_0xecf1('0x3f')](_[_0xecf1('0x40')](_0xfb7118['query'],_0x452f62[_0xecf1('0x3f')]));if(_0xfb7118[_0xecf1('0x36')][_0xecf1('0x41')]){_0x2c066a[_0xecf1('0x3e')]=_[_0xecf1('0x42')](_0x2c066a[_0xecf1('0x3e')],{'$or':_['map'](_0x51a0ca,function(_0x2e2158){if(_0x2e2158[_0xecf1('0x43')][_0xecf1('0x44')]!==_0xecf1('0x45')){var _0x2382bd={};_0x2382bd[_0x2e2158[_0xecf1('0x46')]]={'$like':'%'+_0xfb7118[_0xecf1('0x36')][_0xecf1('0x41')]+'%'};return _0x2382bd;}})});}_0x2c066a=_['merge']({},_0x2c066a,_0xfb7118[_0xecf1('0x47')]);var _0x2f0997={'where':_0x2c066a[_0xecf1('0x3e')]};return db['SugarcrmAccount'][_0xecf1('0x28')](_0x2f0997)[_0xecf1('0x48')](function(_0x1cdd17){_0x187b0c['count']=_0x1cdd17;if(_0xfb7118[_0xecf1('0x36')]['includeAll']){_0x2c066a[_0xecf1('0x49')]=[{'all':!![]}];}return db[_0xecf1('0x33')][_0xecf1('0x4a')](_0x2c066a);})[_0xecf1('0x48')](function(_0x36940c){_0x187b0c[_0xecf1('0x4b')]=_0x36940c;return _0x187b0c;})[_0xecf1('0x48')](respondWithFilteredResult(_0x3ef2e1,_0x2c066a))[_0xecf1('0x24')](handleError(_0x3ef2e1,null));};exports[_0xecf1('0x4c')]=function(_0x49b865,_0x2aa110){var _0x8bd99e={'raw':![],'where':{'id':_0x49b865[_0xecf1('0x4d')]['id']}},_0x1b3fb8={};_0x1b3fb8[_0xecf1('0x35')]=_[_0xecf1('0x37')](db[_0xecf1('0x33')]['rawAttributes']);_0x1b3fb8[_0xecf1('0x36')]=_[_0xecf1('0x37')](_0x49b865[_0xecf1('0x36')]);_0x1b3fb8[_0xecf1('0x3f')]=_[_0xecf1('0x39')](_0x1b3fb8['model'],_0x1b3fb8['query']);_0x8bd99e[_0xecf1('0x38')]=_[_0xecf1('0x39')](_0x1b3fb8['model'],qs['fields'](_0x49b865[_0xecf1('0x36')][_0xecf1('0x3a')]));_0x8bd99e['attributes']=_0x8bd99e[_0xecf1('0x38')][_0xecf1('0x4e')]?_0x8bd99e[_0xecf1('0x38')]:_0x1b3fb8[_0xecf1('0x35')];if(_0x49b865[_0xecf1('0x36')][_0xecf1('0x4f')]){_0x8bd99e[_0xecf1('0x49')]=[{'all':!![]}];}_0x8bd99e=_[_0xecf1('0x42')]({},_0x8bd99e,_0x49b865[_0xecf1('0x47')]);return db['SugarcrmAccount'][_0xecf1('0x50')](_0x8bd99e)[_0xecf1('0x48')](handleEntityNotFound(_0x2aa110,null))['then'](respondWithResult(_0x2aa110,null))[_0xecf1('0x24')](handleError(_0x2aa110,null));};exports[_0xecf1('0x51')]=function(_0x35a681,_0x5e97ec){return db['SugarcrmAccount'][_0xecf1('0x51')](_0x35a681[_0xecf1('0x52')],{})[_0xecf1('0x48')](respondWithResult(_0x5e97ec,0xc9))['catch'](handleError(_0x5e97ec,null));};exports[_0xecf1('0x2f')]=function(_0x39724d,_0x2cf1e4){if(_0x39724d[_0xecf1('0x52')]['id']){delete _0x39724d[_0xecf1('0x52')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x39724d[_0xecf1('0x4d')]['id']}})[_0xecf1('0x48')](handleEntityNotFound(_0x2cf1e4,null))[_0xecf1('0x48')](saveUpdates(_0x39724d['body'],null))['then'](respondWithResult(_0x2cf1e4,null))['catch'](handleError(_0x2cf1e4,null));};exports[_0xecf1('0x53')]=function(_0x1fc87f,_0x5cd9c6){return db['SugarcrmAccount'][_0xecf1('0x50')]({'where':{'id':_0x1fc87f[_0xecf1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5cd9c6,null))['then'](removeEntity(_0x5cd9c6,null))['catch'](handleError(_0x5cd9c6,null));};exports[_0xecf1('0x54')]=function(_0x2210f6,_0x487c77,_0x5d2cf3){var _0x411225={};var _0x475169={};var _0x5af0ac;var _0x2dc673;return db[_0xecf1('0x33')][_0xecf1('0x55')]({'where':{'id':_0x2210f6[_0xecf1('0x4d')]['id']}})[_0xecf1('0x48')](handleEntityNotFound(_0x487c77,null))[_0xecf1('0x48')](function(_0x5409bf){if(_0x5409bf){_0x5af0ac=_0x5409bf;_0x475169[_0xecf1('0x35')]=_[_0xecf1('0x37')](db[_0xecf1('0x56')][_0xecf1('0x34')]);_0x475169[_0xecf1('0x36')]=_[_0xecf1('0x37')](_0x2210f6[_0xecf1('0x36')]);_0x475169['filters']=_[_0xecf1('0x39')](_0x475169[_0xecf1('0x35')],_0x475169[_0xecf1('0x36')]);_0x411225[_0xecf1('0x38')]=_['intersection'](_0x475169['model'],qs[_0xecf1('0x3a')](_0x2210f6[_0xecf1('0x36')][_0xecf1('0x3a')]));_0x411225['attributes']=_0x411225[_0xecf1('0x38')][_0xecf1('0x4e')]?_0x411225[_0xecf1('0x38')]:_0x475169[_0xecf1('0x35')];_0x411225[_0xecf1('0x57')]=qs[_0xecf1('0x3d')](_0x2210f6[_0xecf1('0x36')][_0xecf1('0x3d')]);_0x411225[_0xecf1('0x3e')]=qs[_0xecf1('0x3f')](_[_0xecf1('0x40')](_0x2210f6[_0xecf1('0x36')],_0x475169['filters']));if(_0x2210f6['query']['filter']){_0x411225[_0xecf1('0x3e')]=_['merge'](_0x411225[_0xecf1('0x3e')],{'$or':_[_0xecf1('0x58')](_0x411225[_0xecf1('0x38')],function(_0x3d1c94){var _0x419308={};_0x419308[_0x3d1c94]={'$like':'%'+_0x2210f6[_0xecf1('0x36')]['filter']+'%'};return _0x419308;})});}_0x411225=_['merge']({},_0x411225,_0x2210f6[_0xecf1('0x47')]);return _0x5af0ac['getConfigurations'](_0x411225);}})[_0xecf1('0x48')](function(_0x975de2){if(_0x975de2){_0x2dc673=_0x975de2[_0xecf1('0x4e')];if(!_0x2210f6[_0xecf1('0x36')][_0xecf1('0x59')](_0xecf1('0x3b'))){_0x411225['limit']=qs['limit'](_0x2210f6['query']['limit']);_0x411225[_0xecf1('0x29')]=qs[_0xecf1('0x29')](_0x2210f6[_0xecf1('0x36')][_0xecf1('0x29')]);}return _0x5af0ac['getConfigurations'](_0x411225);}})[_0xecf1('0x48')](function(_0xad787a){if(_0xad787a){return _0xad787a?{'count':_0x2dc673,'rows':_0xad787a}:null;}})[_0xecf1('0x48')](respondWithResult(_0x487c77,null))[_0xecf1('0x24')](handleError(_0x487c77,null));};exports['addConfiguration']=function(_0x24ea8e,_0x5defc8,_0x4cf826){if(_0x24ea8e[_0xecf1('0x52')]['id']){delete _0x24ea8e['body']['id'];}return db[_0xecf1('0x33')][_0xecf1('0x55')]({'where':{'id':_0x24ea8e[_0xecf1('0x4d')]['id']}})[_0xecf1('0x48')](handleEntityNotFound(_0x5defc8,null))[_0xecf1('0x48')](function(_0x138bea){if(_0x138bea){_0x24ea8e[_0xecf1('0x52')][_0xecf1('0x5a')]=_0x138bea['id'];_0x24ea8e['body'][_0xecf1('0x5b')]=integrations[_0xecf1('0x5c')](_0x24ea8e[_0xecf1('0x52')]['channel'],_0x24ea8e[_0xecf1('0x52')][_0xecf1('0x43')]);_0x24ea8e[_0xecf1('0x52')][_0xecf1('0x5d')]=integrations[_0xecf1('0x5e')](_0x24ea8e[_0xecf1('0x52')][_0xecf1('0x5f')],_0x24ea8e[_0xecf1('0x52')][_0xecf1('0x43')]);return db[_0xecf1('0x56')][_0xecf1('0x51')](_0x24ea8e[_0xecf1('0x52')],{'include':[{'model':db['SugarcrmField'],'as':_0xecf1('0x5b')},{'model':db[_0xecf1('0x60')],'as':_0xecf1('0x5d')}]});}return null;})[_0xecf1('0x48')](respondWithResult(_0x5defc8,null))['catch'](handleError(_0x5defc8,null));};exports['getFields']=function(_0x2ed1e1,_0x2d7213,_0x61f513){var _0x577049='';var _0x3b82b5=['id','name',_0xecf1('0x61'),_0xecf1('0x62'),_0xecf1('0x63'),_0xecf1('0x64'),'duration_hours',_0xecf1('0x65'),_0xecf1('0x66'),_0xecf1('0x67'),_0xecf1('0x68'),_0xecf1('0x69')];return db[_0xecf1('0x33')][_0xecf1('0x55')]({'where':{'id':_0x2ed1e1[_0xecf1('0x4d')]['id']},'attributes':['id','username',_0xecf1('0x6a'),'remoteUri']})['then'](handleEntityNotFound(_0x2d7213,null))['then'](function(_0x4e8cb7){if(_0x4e8cb7){_0x577049=_0x4e8cb7['remoteUri'];var _0x2e669d=_0x577049[_0xecf1('0x6b')](-0x1);if(_0x2e669d==='/'){_0x577049=_0x577049[_0xecf1('0x6c')](0x0,_0x577049[_0xecf1('0x6d')](_0x2e669d));}return rp({'method':_0xecf1('0x6e'),'uri':util[_0xecf1('0x6f')](_0xecf1('0x70'),_0x577049,_0xecf1('0x71')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xecf1('0x72'),'rest_data':JSON[_0xecf1('0x1f')]({'user_auth':{'user_name':_0x4e8cb7[_0xecf1('0x73')],'password':_0x4e8cb7['password'],'encryption':_0xecf1('0x74')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xecf1('0x48')](function(_0x31bef9){if(_0x31bef9&&_0x31bef9[_0xecf1('0x30')]!==_0xecf1('0x75')&&_0x31bef9[_0xecf1('0x30')]!=='Password\x20Expired'){return rp({'method':_0xecf1('0x6e'),'uri':util['format'](_0xecf1('0x70'),_0x577049,_0xecf1('0x71')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xecf1('0x72'),'response_type':_0xecf1('0x72'),'rest_data':JSON[_0xecf1('0x1f')]({'session':_0x31bef9['id'],'module_name':'Calls'})}})[_0xecf1('0x48')](function(_0x140bc1){if(_0x140bc1){var _0x36abe6=_[_0xecf1('0x76')](_0x140bc1[_0xecf1('0x77')]);_['remove'](_0x36abe6,function(_0x4b9ff2){return _0x3b82b5[_0xecf1('0x78')](_0x4b9ff2['name']);});return{'count':_0x36abe6['length'],'rows':_['map'](_0x36abe6,function(_0x25f613){return{'id':_0x25f613[_0xecf1('0x30')],'name':_0x25f613[_0xecf1('0x79')],'custom':_['endsWith'](_0x25f613[_0xecf1('0x30')],'_c')?!![]:![],'options':_0x25f613['options']?_[_0xecf1('0x58')](_[_0xecf1('0x76')](_0x25f613[_0xecf1('0x47')]),function(_0x4cc3e8){return{'name':_0x4cc3e8[_0xecf1('0x7a')],'value':_0x4cc3e8[_0xecf1('0x30')]};}):[]};})};}})[_0xecf1('0x48')](respondWithResult(_0x2d7213,null))['catch'](function(_0x384fde){var _0x312704=_0x2ed1e1['query'][_0xecf1('0x7b')]?0x1f4:_0x384fde[_0xecf1('0x7c')]||0x1f4;logger[_0xecf1('0x20')](_0xecf1('0x7d'),_0xecf1('0x7e'),_0x312704,JSON[_0xecf1('0x1f')](_0x384fde));delete _0x384fde[_0xecf1('0x30')];if(_0x312704===0x191){_0x312704=0x190;}_0x2d7213[_0xecf1('0x26')](_0x312704)[_0xecf1('0x31')](_0x2ed1e1['query'][_0xecf1('0x7b')]?{'message':_0xecf1('0x7f'),'statusCode':_0x384fde['statusCode']}:_0x384fde);});}else{var _0x386e04=0x1f4;_0x2d7213[_0xecf1('0x26')](_0x386e04)[_0xecf1('0x31')]({'message':_0xecf1('0x7f'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xacad=['test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../components/integrations/configuration','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','offset','limit','status','json','reject','save','destroy','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','SugarcrmAccount','count','findAll','rows','show','includeAll','create','body','update','find','params','getConfigurations','findOne','SugarcrmConfiguration','order','hasOwnProperty','addConfiguration','Subjects','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','description','parent_id','parent_type','parent_name','username','remoteUri','slice','lastIndexOf','format','%s%s','JSON','PLAIN','Invalid\x20Login','POST','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','label','endsWith'];(function(_0x388d71,_0x321a9f){var _0x399cee=function(_0x391bda){while(--_0x391bda){_0x388d71['push'](_0x388d71['shift']());}};_0x399cee(++_0x321a9f);}(_0xacad,0x1da));var _0xdaca=function(_0xa46694,_0x273e30){_0xa46694=_0xa46694-0x0;var _0x2a1904=_0xacad[_0xa46694];return _0x2a1904;};'use strict';var pdf=require(_0xdaca('0x0'));var emlformat=require(_0xdaca('0x1'));var rimraf=require(_0xdaca('0x2'));var zipdir=require(_0xdaca('0x3'));var jsonpatch=require(_0xdaca('0x4'));var rp=require(_0xdaca('0x5'));var moment=require(_0xdaca('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdaca('0x7'));var path=require(_0xdaca('0x8'));var sox=require(_0xdaca('0x9'));var csv=require(_0xdaca('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdaca('0xb'));var squel=require(_0xdaca('0xc'));var crypto=require(_0xdaca('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdaca('0xe'));var toCsv=require(_0xdaca('0xa'));var querystring=require(_0xdaca('0xf'));var Papa=require('papaparse');var authService=require(_0xdaca('0x10'));var hardwareService=require(_0xdaca('0x11'));var Redis=require(_0xdaca('0x12'));var qs=require(_0xdaca('0x13'));var logger=require(_0xdaca('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdaca('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdaca('0x16'));var jayson=require(_0xdaca('0x17'));var client=jayson[_0xdaca('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13b58e,_0x8e23d1,_0x3dba80,_0x337be5){return new BPromise(function(_0x424252,_0x5f55e8){var _0x462824=_0x337be5||client;return _0x462824[_0xdaca('0x19')](_0x13b58e,_0x3dba80)[_0xdaca('0x1a')](function(_0x352672){logger[_0xdaca('0x1b')](_0xdaca('0x1c'),_0x8e23d1,_0xdaca('0x1d'));logger['debug'](_0xdaca('0x1e'),_0x8e23d1,'request\x20sent',JSON[_0xdaca('0x1f')](_0x352672));if(_0x352672[_0xdaca('0x20')]){if(_0x352672[_0xdaca('0x20')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x8e23d1,_0x352672[_0xdaca('0x20')][_0xdaca('0x21')]);return _0x5f55e8(_0x352672[_0xdaca('0x20')][_0xdaca('0x21')]);}logger[_0xdaca('0x20')](_0xdaca('0x1c'),_0x8e23d1,_0x352672[_0xdaca('0x20')]['message']);return _0x424252(_0x352672[_0xdaca('0x20')][_0xdaca('0x21')]);}else{logger[_0xdaca('0x1b')](_0xdaca('0x1c'),_0x8e23d1,'request\x20sent');_0x424252(_0x352672[_0xdaca('0x22')]['message']);}})[_0xdaca('0x23')](function(_0x4726ab){logger['error'](_0xdaca('0x1c'),_0x8e23d1,_0x4726ab);_0x5f55e8(_0x4726ab);});});}function respondWithStatusCode(_0x14e0f6,_0x2152cf){_0x2152cf=_0x2152cf||0xcc;return function(_0x27b59e){if(_0x27b59e){return _0x14e0f6[_0xdaca('0x24')](_0x2152cf);}return _0x14e0f6['status'](_0x2152cf)['end']();};}function respondWithResult(_0x85e447,_0x579a56){_0x579a56=_0x579a56||0xc8;return function(_0x7517b2){if(_0x7517b2){return _0x85e447['status'](_0x579a56)['json'](_0x7517b2);}};}function respondWithFilteredResult(_0x27bc2f,_0x441595){return function(_0x545937){if(_0x545937){var _0x2b5fbb=_0x545937['count'],_0x59c6fe=_0x441595[_0xdaca('0x25')],_0x126a69=_0x441595[_0xdaca('0x25')]+_0x441595[_0xdaca('0x26')],_0x53f2d7;if(_0x126a69>=_0x2b5fbb){_0x126a69=_0x2b5fbb;_0x53f2d7=0xc8;}else{_0x53f2d7=0xce;}_0x27bc2f[_0xdaca('0x27')](_0x53f2d7);return _0x27bc2f['set']('Content-Range',_0x59c6fe+'-'+_0x126a69+'/'+_0x2b5fbb)[_0xdaca('0x28')](_0x545937);}return null;};}function patchUpdates(_0x582ec4){return function(_0x14f648){try{jsonpatch['apply'](_0x14f648,_0x582ec4,!![]);}catch(_0x42a83a){return BPromise[_0xdaca('0x29')](_0x42a83a);}return _0x14f648[_0xdaca('0x2a')]();};}function saveUpdates(_0x5589c0,_0x283e74){return function(_0x5ddafc){if(_0x5ddafc){return _0x5ddafc['update'](_0x5589c0)['then'](function(_0x24ceaa){return _0x24ceaa;});}return null;};}function removeEntity(_0x4637b8,_0x4ed140){return function(_0x389f76){if(_0x389f76){return _0x389f76[_0xdaca('0x2b')]()[_0xdaca('0x1a')](function(){_0x4637b8[_0xdaca('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8292,_0x13118f){return function(_0x55d0b0){if(!_0x55d0b0){_0x2f8292[_0xdaca('0x24')](0x194);}return _0x55d0b0;};}function handleError(_0x2587b0,_0x235a08){_0x235a08=_0x235a08||0x1f4;return function(_0x19ca49){logger[_0xdaca('0x20')](_0x19ca49[_0xdaca('0x2c')]);if(_0x19ca49['name']){delete _0x19ca49[_0xdaca('0x2d')];}_0x2587b0[_0xdaca('0x27')](_0x235a08)['send'](_0x19ca49);};}exports[_0xdaca('0x2e')]=function(_0x26bb23,_0x5a9759){var _0xce94f7={},_0x2c76d0={},_0x34c4c0={'count':0x0,'rows':[]};var _0x25af7c=db['SugarcrmAccount'][_0xdaca('0x2f')];_0x2c76d0[_0xdaca('0x30')]=_[_0xdaca('0x31')](_0x25af7c);_0x2c76d0[_0xdaca('0x32')]=_['keys'](_0x26bb23['query']);_0x2c76d0[_0xdaca('0x33')]=_[_0xdaca('0x34')](_0x2c76d0[_0xdaca('0x30')],_0x2c76d0['query']);_0xce94f7[_0xdaca('0x35')]=_[_0xdaca('0x34')](_0x2c76d0['model'],qs[_0xdaca('0x36')](_0x26bb23[_0xdaca('0x32')]['fields']));_0xce94f7[_0xdaca('0x35')]=_0xce94f7[_0xdaca('0x35')][_0xdaca('0x37')]?_0xce94f7[_0xdaca('0x35')]:_0x2c76d0[_0xdaca('0x30')];if(!_0x26bb23[_0xdaca('0x32')]['hasOwnProperty'](_0xdaca('0x38'))){_0xce94f7[_0xdaca('0x26')]=qs['limit'](_0x26bb23[_0xdaca('0x32')]['limit']);_0xce94f7['offset']=qs[_0xdaca('0x25')](_0x26bb23[_0xdaca('0x32')][_0xdaca('0x25')]);}_0xce94f7['order']=qs[_0xdaca('0x39')](_0x26bb23['query']['sort']);_0xce94f7[_0xdaca('0x3a')]=qs[_0xdaca('0x33')](_[_0xdaca('0x3b')](_0x26bb23[_0xdaca('0x32')],_0x2c76d0[_0xdaca('0x33')]));if(_0x26bb23[_0xdaca('0x32')][_0xdaca('0x3c')]){_0xce94f7[_0xdaca('0x3a')]=_[_0xdaca('0x3d')](_0xce94f7['where'],{'$or':_[_0xdaca('0x3e')](_0x25af7c,function(_0x20c3ca){if(_0x20c3ca[_0xdaca('0x3f')][_0xdaca('0x40')]!==_0xdaca('0x41')){var _0x5c55e2={};_0x5c55e2[_0x20c3ca[_0xdaca('0x42')]]={'$like':'%'+_0x26bb23['query']['filter']+'%'};return _0x5c55e2;}})});}_0xce94f7=_[_0xdaca('0x3d')]({},_0xce94f7,_0x26bb23[_0xdaca('0x43')]);var _0x254df9={'where':_0xce94f7[_0xdaca('0x3a')]};return db[_0xdaca('0x44')][_0xdaca('0x45')](_0x254df9)['then'](function(_0x34404a){_0x34c4c0[_0xdaca('0x45')]=_0x34404a;if(_0x26bb23[_0xdaca('0x32')]['includeAll']){_0xce94f7['include']=[{'all':!![]}];}return db[_0xdaca('0x44')][_0xdaca('0x46')](_0xce94f7);})['then'](function(_0x10d819){_0x34c4c0[_0xdaca('0x47')]=_0x10d819;return _0x34c4c0;})['then'](respondWithFilteredResult(_0x5a9759,_0xce94f7))[_0xdaca('0x23')](handleError(_0x5a9759,null));};exports[_0xdaca('0x48')]=function(_0x2886c6,_0x420baa){var _0x4aeef7={'raw':![],'where':{'id':_0x2886c6['params']['id']}},_0x6df8c0={};_0x6df8c0[_0xdaca('0x30')]=_[_0xdaca('0x31')](db['SugarcrmAccount']['rawAttributes']);_0x6df8c0[_0xdaca('0x32')]=_[_0xdaca('0x31')](_0x2886c6[_0xdaca('0x32')]);_0x6df8c0[_0xdaca('0x33')]=_[_0xdaca('0x34')](_0x6df8c0[_0xdaca('0x30')],_0x6df8c0[_0xdaca('0x32')]);_0x4aeef7['attributes']=_[_0xdaca('0x34')](_0x6df8c0[_0xdaca('0x30')],qs[_0xdaca('0x36')](_0x2886c6[_0xdaca('0x32')][_0xdaca('0x36')]));_0x4aeef7[_0xdaca('0x35')]=_0x4aeef7[_0xdaca('0x35')][_0xdaca('0x37')]?_0x4aeef7[_0xdaca('0x35')]:_0x6df8c0[_0xdaca('0x30')];if(_0x2886c6[_0xdaca('0x32')][_0xdaca('0x49')]){_0x4aeef7['include']=[{'all':!![]}];}_0x4aeef7=_[_0xdaca('0x3d')]({},_0x4aeef7,_0x2886c6[_0xdaca('0x43')]);return db['SugarcrmAccount']['find'](_0x4aeef7)['then'](handleEntityNotFound(_0x420baa,null))[_0xdaca('0x1a')](respondWithResult(_0x420baa,null))[_0xdaca('0x23')](handleError(_0x420baa,null));};exports[_0xdaca('0x4a')]=function(_0x36f5b2,_0x4518fe){return db['SugarcrmAccount'][_0xdaca('0x4a')](_0x36f5b2[_0xdaca('0x4b')],{})['then'](respondWithResult(_0x4518fe,0xc9))[_0xdaca('0x23')](handleError(_0x4518fe,null));};exports[_0xdaca('0x4c')]=function(_0x558b95,_0x2fb3e3){if(_0x558b95[_0xdaca('0x4b')]['id']){delete _0x558b95[_0xdaca('0x4b')]['id'];}return db['SugarcrmAccount'][_0xdaca('0x4d')]({'where':{'id':_0x558b95[_0xdaca('0x4e')]['id']}})[_0xdaca('0x1a')](handleEntityNotFound(_0x2fb3e3,null))[_0xdaca('0x1a')](saveUpdates(_0x558b95[_0xdaca('0x4b')],null))[_0xdaca('0x1a')](respondWithResult(_0x2fb3e3,null))[_0xdaca('0x23')](handleError(_0x2fb3e3,null));};exports[_0xdaca('0x2b')]=function(_0x411a30,_0x2e7a63){return db[_0xdaca('0x44')][_0xdaca('0x4d')]({'where':{'id':_0x411a30[_0xdaca('0x4e')]['id']}})[_0xdaca('0x1a')](handleEntityNotFound(_0x2e7a63,null))[_0xdaca('0x1a')](removeEntity(_0x2e7a63,null))['catch'](handleError(_0x2e7a63,null));};exports[_0xdaca('0x4f')]=function(_0x11187c,_0x33df42,_0x2e94e6){var _0x29ee09={};var _0x39984d={};var _0x33dde8;var _0x5ca869;return db[_0xdaca('0x44')][_0xdaca('0x50')]({'where':{'id':_0x11187c['params']['id']}})[_0xdaca('0x1a')](handleEntityNotFound(_0x33df42,null))[_0xdaca('0x1a')](function(_0x2e76be){if(_0x2e76be){_0x33dde8=_0x2e76be;_0x39984d['model']=_[_0xdaca('0x31')](db[_0xdaca('0x51')]['rawAttributes']);_0x39984d[_0xdaca('0x32')]=_['keys'](_0x11187c['query']);_0x39984d[_0xdaca('0x33')]=_['intersection'](_0x39984d[_0xdaca('0x30')],_0x39984d[_0xdaca('0x32')]);_0x29ee09[_0xdaca('0x35')]=_[_0xdaca('0x34')](_0x39984d[_0xdaca('0x30')],qs[_0xdaca('0x36')](_0x11187c['query'][_0xdaca('0x36')]));_0x29ee09[_0xdaca('0x35')]=_0x29ee09['attributes'][_0xdaca('0x37')]?_0x29ee09[_0xdaca('0x35')]:_0x39984d[_0xdaca('0x30')];_0x29ee09[_0xdaca('0x52')]=qs[_0xdaca('0x39')](_0x11187c[_0xdaca('0x32')]['sort']);_0x29ee09[_0xdaca('0x3a')]=qs[_0xdaca('0x33')](_['pick'](_0x11187c[_0xdaca('0x32')],_0x39984d[_0xdaca('0x33')]));if(_0x11187c['query'][_0xdaca('0x3c')]){_0x29ee09[_0xdaca('0x3a')]=_[_0xdaca('0x3d')](_0x29ee09[_0xdaca('0x3a')],{'$or':_['map'](_0x29ee09['attributes'],function(_0x197144){var _0xec2f92={};_0xec2f92[_0x197144]={'$like':'%'+_0x11187c[_0xdaca('0x32')]['filter']+'%'};return _0xec2f92;})});}_0x29ee09=_[_0xdaca('0x3d')]({},_0x29ee09,_0x11187c[_0xdaca('0x43')]);return _0x33dde8[_0xdaca('0x4f')](_0x29ee09);}})[_0xdaca('0x1a')](function(_0x835828){if(_0x835828){_0x5ca869=_0x835828[_0xdaca('0x37')];if(!_0x11187c[_0xdaca('0x32')][_0xdaca('0x53')](_0xdaca('0x38'))){_0x29ee09[_0xdaca('0x26')]=qs[_0xdaca('0x26')](_0x11187c['query']['limit']);_0x29ee09[_0xdaca('0x25')]=qs[_0xdaca('0x25')](_0x11187c['query'][_0xdaca('0x25')]);}return _0x33dde8[_0xdaca('0x4f')](_0x29ee09);}})[_0xdaca('0x1a')](function(_0x3ce341){if(_0x3ce341){return _0x3ce341?{'count':_0x5ca869,'rows':_0x3ce341}:null;}})['then'](respondWithResult(_0x33df42,null))['catch'](handleError(_0x33df42,null));};exports[_0xdaca('0x54')]=function(_0x587897,_0x1d3022,_0x2ec25c){if(_0x587897[_0xdaca('0x4b')]['id']){delete _0x587897[_0xdaca('0x4b')]['id'];}return db[_0xdaca('0x44')][_0xdaca('0x50')]({'where':{'id':_0x587897['params']['id']}})[_0xdaca('0x1a')](handleEntityNotFound(_0x1d3022,null))[_0xdaca('0x1a')](function(_0x198440){if(_0x198440){_0x587897[_0xdaca('0x4b')]['AccountId']=_0x198440['id'];_0x587897['body'][_0xdaca('0x55')]=integrations['getSubjects'](_0x587897[_0xdaca('0x4b')]['channel'],_0x587897['body'][_0xdaca('0x3f')]);_0x587897[_0xdaca('0x4b')][_0xdaca('0x56')]=integrations[_0xdaca('0x57')](_0x587897[_0xdaca('0x4b')]['channel'],_0x587897['body'][_0xdaca('0x3f')]);return db[_0xdaca('0x51')][_0xdaca('0x4a')](_0x587897[_0xdaca('0x4b')],{'include':[{'model':db[_0xdaca('0x58')],'as':_0xdaca('0x55')},{'model':db[_0xdaca('0x58')],'as':_0xdaca('0x56')}]});}return null;})[_0xdaca('0x1a')](respondWithResult(_0x1d3022,null))['catch'](handleError(_0x1d3022,null));};exports['getFields']=function(_0x551672,_0x32633f,_0x475a06){var _0x1cd5f8='';var _0x5ea56b=['id','name',_0xdaca('0x59'),'created_by',_0xdaca('0x5a'),'date_start','duration_hours','duration_minutes',_0xdaca('0x5b'),_0xdaca('0x5c'),_0xdaca('0x5d'),'direction'];return db[_0xdaca('0x44')]['findOne']({'where':{'id':_0x551672[_0xdaca('0x4e')]['id']},'attributes':['id',_0xdaca('0x5e'),'password',_0xdaca('0x5f')]})['then'](handleEntityNotFound(_0x32633f,null))[_0xdaca('0x1a')](function(_0x1622dc){if(_0x1622dc){_0x1cd5f8=_0x1622dc['remoteUri'];var _0x531194=_0x1cd5f8[_0xdaca('0x60')](-0x1);if(_0x531194==='/'){_0x1cd5f8=_0x1cd5f8['substring'](0x0,_0x1cd5f8[_0xdaca('0x61')](_0x531194));}return rp({'method':'POST','uri':util[_0xdaca('0x62')](_0xdaca('0x63'),_0x1cd5f8,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0xdaca('0x64'),'response_type':_0xdaca('0x64'),'rest_data':JSON[_0xdaca('0x1f')]({'user_auth':{'user_name':_0x1622dc[_0xdaca('0x5e')],'password':_0x1622dc['password'],'encryption':_0xdaca('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xdaca('0x1a')](function(_0x49097f){if(_0x49097f&&_0x49097f['name']!==_0xdaca('0x66')&&_0x49097f['name']!=='Password\x20Expired'){return rp({'method':_0xdaca('0x67'),'uri':util[_0xdaca('0x62')]('%s%s',_0x1cd5f8,_0xdaca('0x68')),'json':!![],'form':{'method':_0xdaca('0x69'),'input_type':_0xdaca('0x64'),'response_type':_0xdaca('0x64'),'rest_data':JSON[_0xdaca('0x1f')]({'session':_0x49097f['id'],'module_name':_0xdaca('0x6a')})}})[_0xdaca('0x1a')](function(_0x59d363){if(_0x59d363){var _0xb3c420=_[_0xdaca('0x6b')](_0x59d363[_0xdaca('0x6c')]);_['remove'](_0xb3c420,function(_0x1bc009){return _0x5ea56b['includes'](_0x1bc009[_0xdaca('0x2d')]);});return{'count':_0xb3c420[_0xdaca('0x37')],'rows':_[_0xdaca('0x3e')](_0xb3c420,function(_0x5ca0f7){return{'id':_0x5ca0f7[_0xdaca('0x2d')],'name':_0x5ca0f7[_0xdaca('0x6d')],'custom':_[_0xdaca('0x6e')](_0x5ca0f7['name'],'_c')?!![]:![],'options':_0x5ca0f7[_0xdaca('0x43')]?_[_0xdaca('0x3e')](_[_0xdaca('0x6b')](_0x5ca0f7[_0xdaca('0x43')]),function(_0x43a269){return{'name':_0x43a269['value'],'value':_0x43a269[_0xdaca('0x2d')]};}):[]};})};}})[_0xdaca('0x1a')](respondWithResult(_0x32633f,null))['catch'](function(_0x397c06){var _0x109984=_0x551672[_0xdaca('0x32')][_0xdaca('0x6f')]?0x1f4:_0x397c06[_0xdaca('0x70')]||0x1f4;logger[_0xdaca('0x20')](_0xdaca('0x71'),_0xdaca('0x72'),_0x109984,JSON[_0xdaca('0x1f')](_0x397c06));delete _0x397c06[_0xdaca('0x2d')];if(_0x109984===0x191){_0x109984=0x190;}_0x32633f['status'](_0x109984)[_0xdaca('0x73')](_0x551672[_0xdaca('0x32')][_0xdaca('0x6f')]?{'message':_0xdaca('0x74'),'statusCode':_0x397c06[_0xdaca('0x70')]}:_0x397c06);});}else{var _0x5f20be=0x1f4;_0x32633f[_0xdaca('0x27')](_0x5f20be)[_0xdaca('0x73')]({'message':_0xdaca('0x74'),'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 dbbdd66..f030361 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 _0x0327=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x34be87,_0x54afc3){var _0x411683=function(_0x2b5030){while(--_0x2b5030){_0x34be87['push'](_0x34be87['shift']());}};_0x411683(++_0x54afc3);}(_0x0327,0x1e7));var _0x7032=function(_0x114a2e,_0x430f9d){_0x114a2e=_0x114a2e-0x0;var _0x3aad57=_0x0327[_0x114a2e];return _0x3aad57;};'use strict';var _=require(_0x7032('0x0'));var util=require(_0x7032('0x1'));var logger=require(_0x7032('0x2'))(_0x7032('0x3'));var moment=require(_0x7032('0x4'));var BPromise=require(_0x7032('0x5'));var rp=require(_0x7032('0x6'));var attributes=require(_0x7032('0x7'));var integrations=require(_0x7032('0x8'));module[_0x7032('0x9')]=function(_0x248587,_0x492e66){return _0x248587[_0x7032('0xa')](_0x7032('0xb'),attributes,{'tableName':_0x7032('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e8f=['api','moment','bluebird','request-promise','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x57afe3,_0xc1d2a5){var _0x199921=function(_0x2c3288){while(--_0x2c3288){_0x57afe3['push'](_0x57afe3['shift']());}};_0x199921(++_0xc1d2a5);}(_0x5e8f,0x8d));var _0xf5e8=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x5e8f[_0x1d2bbb];return _0x38082b;};'use strict';var _=require(_0xf5e8('0x0'));var util=require(_0xf5e8('0x1'));var logger=require(_0xf5e8('0x2'))(_0xf5e8('0x3'));var moment=require(_0xf5e8('0x4'));var BPromise=require(_0xf5e8('0x5'));var rp=require(_0xf5e8('0x6'));var attributes=require(_0xf5e8('0x7'));var integrations=require(_0xf5e8('0x8'));module[_0xf5e8('0x9')]=function(_0x585b71,_0x3131ab){return _0x585b71['define'](_0xf5e8('0xa'),attributes,{'tableName':_0xf5e8('0xb'),'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 8af6ca9..06858ea 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 _0x8852=['GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch'];(function(_0x413896,_0xb6ba58){var _0x1b04aa=function(_0x4aff09){while(--_0x4aff09){_0x413896['push'](_0x413896['shift']());}};_0x1b04aa(++_0xb6ba58);}(_0x8852,0x16e));var _0x2885=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x8852[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x2885('0x0'));var util=require(_0x2885('0x1'));var moment=require(_0x2885('0x2'));var BPromise=require('bluebird');var rs=require(_0x2885('0x3'));var fs=require('fs');var Redis=require(_0x2885('0x4'));var db=require(_0x2885('0x5'))['db'];var utils=require(_0x2885('0x6'));var logger=require(_0x2885('0x7'))(_0x2885('0x8'));var config=require('../../config/environment');var jayson=require(_0x2885('0x9'));var client=jayson['client'][_0x2885('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f441d,_0x32db9b,_0x12531e){return new BPromise(function(_0x141301,_0x165ce1){return client[_0x2885('0xb')](_0x5f441d,_0x12531e)['then'](function(_0x225d41){logger['info'](_0x2885('0xc'),_0x32db9b,_0x2885('0xd'));logger['debug'](_0x2885('0xe'),_0x32db9b,_0x2885('0xd'),JSON['stringify'](_0x225d41));if(_0x225d41[_0x2885('0xf')]){if(_0x225d41[_0x2885('0xf')]['code']===0x1f4){logger[_0x2885('0xf')](_0x2885('0xc'),_0x32db9b,_0x225d41['error'][_0x2885('0x10')]);return _0x165ce1(_0x225d41[_0x2885('0xf')][_0x2885('0x10')]);}logger[_0x2885('0xf')](_0x2885('0xc'),_0x32db9b,_0x225d41[_0x2885('0xf')]['message']);return _0x141301(_0x225d41[_0x2885('0xf')][_0x2885('0x10')]);}else{logger[_0x2885('0x11')](_0x2885('0xc'),_0x32db9b,_0x2885('0xd'));_0x141301(_0x225d41['result'][_0x2885('0x10')]);}})[_0x2885('0x12')](function(_0x11e0a8){logger['error'](_0x2885('0xc'),_0x32db9b,_0x11e0a8);_0x165ce1(_0x11e0a8);});});}exports[_0x2885('0x13')]=function(_0x22c519){var _0x589638=this;return new Promise(function(_0xa85824,_0x3a862c){return db['SugarcrmAccount'][_0x2885('0x14')]({'raw':_0x22c519['options']?_0x22c519[_0x2885('0x15')][_0x2885('0x16')]===undefined?!![]:![]:!![],'where':_0x22c519[_0x2885('0x15')]?_0x22c519[_0x2885('0x15')][_0x2885('0x17')]||null:null,'attributes':_0x22c519['options']?_0x22c519[_0x2885('0x15')][_0x2885('0x18')]||null:null,'limit':_0x22c519['options']?_0x22c519[_0x2885('0x15')][_0x2885('0x19')]||null:null,'include':_0x22c519['options']?_0x22c519[_0x2885('0x15')][_0x2885('0x1a')]?_['map'](_0x22c519[_0x2885('0x15')][_0x2885('0x1a')],function(_0x206969){return{'model':db[_0x206969['model']],'as':_0x206969['as'],'attributes':_0x206969['attributes'],'include':_0x206969[_0x2885('0x1a')]?_[_0x2885('0x1b')](_0x206969[_0x2885('0x1a')],function(_0x2cd291){return{'model':db[_0x2cd291[_0x2885('0x1c')]],'as':_0x2cd291['as'],'attributes':_0x2cd291[_0x2885('0x18')],'include':_0x2cd291[_0x2885('0x1a')]?_[_0x2885('0x1b')](_0x2cd291[_0x2885('0x1a')],function(_0xa41c83){return{'model':db[_0xa41c83[_0x2885('0x1c')]],'as':_0xa41c83['as'],'attributes':_0xa41c83[_0x2885('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3eb92e){logger[_0x2885('0x11')](_0x2885('0x13'),_0x22c519);logger[_0x2885('0x1d')](_0x2885('0x13'),_0x22c519,JSON[_0x2885('0x1e')](_0x3eb92e));_0xa85824(_0x3eb92e);})[_0x2885('0x12')](function(_0x51d90b){logger[_0x2885('0xf')](_0x2885('0x13'),_0x51d90b[_0x2885('0x10')],_0x22c519);_0x3a862c(_0x589638[_0x2885('0xf')](0x1f4,_0x51d90b[_0x2885('0x10')]));});});};exports[_0x2885('0x1f')]=function(_0x43ad30){var _0x555042=this;return new Promise(function(_0x1b5001,_0x7a6e3c){return db[_0x2885('0x20')][_0x2885('0x21')]({'raw':_0x43ad30[_0x2885('0x15')]?_0x43ad30[_0x2885('0x15')][_0x2885('0x16')]===undefined?!![]:![]:!![],'where':_0x43ad30[_0x2885('0x15')]?_0x43ad30[_0x2885('0x15')]['where']||null:null,'attributes':_0x43ad30[_0x2885('0x15')]?_0x43ad30[_0x2885('0x15')][_0x2885('0x18')]||null:null,'include':_0x43ad30[_0x2885('0x15')]?_0x43ad30['options'][_0x2885('0x1a')]?_['map'](_0x43ad30[_0x2885('0x15')][_0x2885('0x1a')],function(_0xdb62ee){return{'model':db[_0xdb62ee['model']],'as':_0xdb62ee['as'],'attributes':_0xdb62ee[_0x2885('0x18')],'include':_0xdb62ee[_0x2885('0x1a')]?_['map'](_0xdb62ee[_0x2885('0x1a')],function(_0xeb9b99){return{'model':db[_0xeb9b99[_0x2885('0x1c')]],'as':_0xeb9b99['as'],'attributes':_0xeb9b99[_0x2885('0x18')],'include':_0xeb9b99[_0x2885('0x1a')]?_['map'](_0xeb9b99[_0x2885('0x1a')],function(_0x3f527c){return{'model':db[_0x3f527c[_0x2885('0x1c')]],'as':_0x3f527c['as'],'attributes':_0x3f527c[_0x2885('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2885('0x22')](function(_0x21ff7a){logger[_0x2885('0x11')](_0x2885('0x1f'),_0x43ad30);logger[_0x2885('0x1d')](_0x2885('0x1f'),_0x43ad30,JSON['stringify'](_0x21ff7a));_0x1b5001(_0x21ff7a);})[_0x2885('0x12')](function(_0x50557a){logger[_0x2885('0xf')](_0x2885('0x1f'),_0x50557a['message'],_0x43ad30);_0x7a6e3c(_0x555042['error'](0x1f4,_0x50557a[_0x2885('0x10')]));});});}; \ No newline at end of file +var _0xdf0b=['request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info'];(function(_0x36eca3,_0x30764d){var _0x1ee4cb=function(_0xde3234){while(--_0xde3234){_0x36eca3['push'](_0x36eca3['shift']());}};_0x1ee4cb(++_0x30764d);}(_0xdf0b,0xd6));var _0xbdf0=function(_0x1a1404,_0x14deda){_0x1a1404=_0x1a1404-0x0;var _0x526783=_0xdf0b[_0x1a1404];return _0x526783;};'use strict';var _=require(_0xbdf0('0x0'));var util=require(_0xbdf0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdf0('0x2'));var db=require(_0xbdf0('0x3'))['db'];var utils=require(_0xbdf0('0x4'));var logger=require('../../config/logger')(_0xbdf0('0x5'));var config=require('../../config/environment');var jayson=require(_0xbdf0('0x6'));var client=jayson[_0xbdf0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3741ba,_0x4eb9d6,_0x363bbc){return new BPromise(function(_0x4cd4b3,_0x3496be){return client['request'](_0x3741ba,_0x363bbc)[_0xbdf0('0x8')](function(_0x5342cc){logger[_0xbdf0('0x9')]('SugarcrmAccount,\x20%s,\x20%s',_0x4eb9d6,_0xbdf0('0xa'));logger[_0xbdf0('0xb')](_0xbdf0('0xc'),_0x4eb9d6,_0xbdf0('0xa'),JSON[_0xbdf0('0xd')](_0x5342cc));if(_0x5342cc['error']){if(_0x5342cc[_0xbdf0('0xe')][_0xbdf0('0xf')]===0x1f4){logger[_0xbdf0('0xe')](_0xbdf0('0x10'),_0x4eb9d6,_0x5342cc[_0xbdf0('0xe')]['message']);return _0x3496be(_0x5342cc[_0xbdf0('0xe')][_0xbdf0('0x11')]);}logger['error'](_0xbdf0('0x10'),_0x4eb9d6,_0x5342cc[_0xbdf0('0xe')][_0xbdf0('0x11')]);return _0x4cd4b3(_0x5342cc[_0xbdf0('0xe')][_0xbdf0('0x11')]);}else{logger[_0xbdf0('0x9')](_0xbdf0('0x10'),_0x4eb9d6,_0xbdf0('0xa'));_0x4cd4b3(_0x5342cc[_0xbdf0('0x12')]['message']);}})['catch'](function(_0x47fb6f){logger[_0xbdf0('0xe')](_0xbdf0('0x10'),_0x4eb9d6,_0x47fb6f);_0x3496be(_0x47fb6f);});});}exports[_0xbdf0('0x13')]=function(_0x4bbea0){var _0x3234eb=this;return new Promise(function(_0x419d57,_0x6ae3f7){return db[_0xbdf0('0x14')]['findAll']({'raw':_0x4bbea0['options']?_0x4bbea0[_0xbdf0('0x15')][_0xbdf0('0x16')]===undefined?!![]:![]:!![],'where':_0x4bbea0[_0xbdf0('0x15')]?_0x4bbea0[_0xbdf0('0x15')][_0xbdf0('0x17')]||null:null,'attributes':_0x4bbea0[_0xbdf0('0x15')]?_0x4bbea0[_0xbdf0('0x15')][_0xbdf0('0x18')]||null:null,'limit':_0x4bbea0['options']?_0x4bbea0[_0xbdf0('0x15')][_0xbdf0('0x19')]||null:null,'include':_0x4bbea0[_0xbdf0('0x15')]?_0x4bbea0['options'][_0xbdf0('0x1a')]?_[_0xbdf0('0x1b')](_0x4bbea0['options'][_0xbdf0('0x1a')],function(_0x75eec4){return{'model':db[_0x75eec4[_0xbdf0('0x1c')]],'as':_0x75eec4['as'],'attributes':_0x75eec4[_0xbdf0('0x18')],'include':_0x75eec4[_0xbdf0('0x1a')]?_[_0xbdf0('0x1b')](_0x75eec4[_0xbdf0('0x1a')],function(_0x5a7337){return{'model':db[_0x5a7337[_0xbdf0('0x1c')]],'as':_0x5a7337['as'],'attributes':_0x5a7337[_0xbdf0('0x18')],'include':_0x5a7337[_0xbdf0('0x1a')]?_[_0xbdf0('0x1b')](_0x5a7337[_0xbdf0('0x1a')],function(_0x16f06f){return{'model':db[_0x16f06f[_0xbdf0('0x1c')]],'as':_0x16f06f['as'],'attributes':_0x16f06f['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdf0('0x8')](function(_0x369ce6){logger[_0xbdf0('0x9')](_0xbdf0('0x13'),_0x4bbea0);logger['debug'](_0xbdf0('0x13'),_0x4bbea0,JSON[_0xbdf0('0xd')](_0x369ce6));_0x419d57(_0x369ce6);})['catch'](function(_0x217823){logger[_0xbdf0('0xe')](_0xbdf0('0x13'),_0x217823[_0xbdf0('0x11')],_0x4bbea0);_0x6ae3f7(_0x3234eb[_0xbdf0('0xe')](0x1f4,_0x217823[_0xbdf0('0x11')]));});});};exports[_0xbdf0('0x1d')]=function(_0x2592af){var _0x4d8a11=this;return new Promise(function(_0x34096a,_0x1f9f65){return db[_0xbdf0('0x14')][_0xbdf0('0x1e')]({'raw':_0x2592af[_0xbdf0('0x15')]?_0x2592af[_0xbdf0('0x15')][_0xbdf0('0x16')]===undefined?!![]:![]:!![],'where':_0x2592af[_0xbdf0('0x15')]?_0x2592af[_0xbdf0('0x15')][_0xbdf0('0x17')]||null:null,'attributes':_0x2592af[_0xbdf0('0x15')]?_0x2592af[_0xbdf0('0x15')][_0xbdf0('0x18')]||null:null,'include':_0x2592af[_0xbdf0('0x15')]?_0x2592af[_0xbdf0('0x15')][_0xbdf0('0x1a')]?_['map'](_0x2592af[_0xbdf0('0x15')][_0xbdf0('0x1a')],function(_0xae188a){return{'model':db[_0xae188a[_0xbdf0('0x1c')]],'as':_0xae188a['as'],'attributes':_0xae188a['attributes'],'include':_0xae188a[_0xbdf0('0x1a')]?_[_0xbdf0('0x1b')](_0xae188a['include'],function(_0x35d903){return{'model':db[_0x35d903[_0xbdf0('0x1c')]],'as':_0x35d903['as'],'attributes':_0x35d903[_0xbdf0('0x18')],'include':_0x35d903['include']?_[_0xbdf0('0x1b')](_0x35d903[_0xbdf0('0x1a')],function(_0x23ccc6){return{'model':db[_0x23ccc6[_0xbdf0('0x1c')]],'as':_0x23ccc6['as'],'attributes':_0x23ccc6[_0xbdf0('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x591636){logger[_0xbdf0('0x9')]('ShowSugarcrmAccount',_0x2592af);logger[_0xbdf0('0xb')](_0xbdf0('0x1d'),_0x2592af,JSON[_0xbdf0('0xd')](_0x591636));_0x34096a(_0x591636);})[_0xbdf0('0x1f')](function(_0x756de5){logger['error'](_0xbdf0('0x1d'),_0x756de5[_0xbdf0('0x11')],_0x2592af);_0x1f9f65(_0x4d8a11['error'](0x1f4,_0x756de5['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 795f65a..3e285e2 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 _0x0422=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x6415a4,_0x574dfb){var _0x40ceed=function(_0x5b057a){while(--_0x5b057a){_0x6415a4['push'](_0x6415a4['shift']());}};_0x40ceed(++_0x574dfb);}(_0x0422,0x1b3));var _0x2042=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x0422[_0x187d80];return _0x498a77;};'use strict';var multer=require(_0x2042('0x0'));var util=require(_0x2042('0x1'));var path=require(_0x2042('0x2'));var timeout=require(_0x2042('0x3'));var express=require(_0x2042('0x4'));var router=express[_0x2042('0x5')]();var auth=require(_0x2042('0x6'));var interaction=require(_0x2042('0x7'));var config=require(_0x2042('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x2042('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2042('0xa'),auth[_0x2042('0xb')](),controller[_0x2042('0xc')]);router[_0x2042('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2042('0xd')]);router['get'](_0x2042('0xe'),auth[_0x2042('0xb')](),controller[_0x2042('0xf')]);router[_0x2042('0x9')](_0x2042('0x10'),auth[_0x2042('0xb')](),controller[_0x2042('0x11')]);router[_0x2042('0x12')]('/',auth['isAuthenticated'](),controller[_0x2042('0x13')]);router[_0x2042('0x14')](_0x2042('0xa'),auth[_0x2042('0xb')](),controller['update']);router[_0x2042('0x15')](_0x2042('0xa'),auth[_0x2042('0xb')](),controller[_0x2042('0x16')]);module[_0x2042('0x17')]=router; \ No newline at end of file +var _0xc89e=['/:id/fields','getFields','getDescriptions','post','create','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x5adb11,_0x120822){var _0x437516=function(_0xad72d3){while(--_0xad72d3){_0x5adb11['push'](_0x5adb11['shift']());}};_0x437516(++_0x120822);}(_0xc89e,0x10c));var _0xec89=function(_0x383247,_0x6ef2fe){_0x383247=_0x383247-0x0;var _0x43a803=_0xc89e[_0x383247];return _0x43a803;};'use strict';var multer=require('multer');var util=require(_0xec89('0x0'));var path=require(_0xec89('0x1'));var timeout=require(_0xec89('0x2'));var express=require(_0xec89('0x3'));var router=express['Router']();var auth=require(_0xec89('0x4'));var interaction=require(_0xec89('0x5'));var config=require(_0xec89('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xec89('0x7')]('/',auth[_0xec89('0x8')](),controller[_0xec89('0x9')]);router[_0xec89('0x7')](_0xec89('0xa'),auth[_0xec89('0x8')](),controller[_0xec89('0xb')]);router[_0xec89('0x7')](_0xec89('0xc'),auth['isAuthenticated'](),controller[_0xec89('0xd')]);router[_0xec89('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xec89('0x7')]('/:id/descriptions',auth[_0xec89('0x8')](),controller[_0xec89('0xe')]);router[_0xec89('0xf')]('/',auth[_0xec89('0x8')](),controller[_0xec89('0x10')]);router['put'](_0xec89('0xa'),auth[_0xec89('0x8')](),controller[_0xec89('0x11')]);router['delete'](_0xec89('0xa'),auth[_0xec89('0x8')](),controller[_0xec89('0x12')]);module[_0xec89('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 bd975c0..bc425d9 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 _0xeac5=['exports'];(function(_0x42cca0,_0x593120){var _0x588fba=function(_0x100868){while(--_0x100868){_0x42cca0['push'](_0x42cca0['shift']());}};_0x588fba(++_0x593120);}(_0xeac5,0x1c1));var _0x5eac=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0xeac5[_0x2ec2bf];return _0x2c279c;};'use strict';var Sequelize=require('sequelize');module[_0x5eac('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x91bb=['STRING','exports'];(function(_0x15a895,_0x5ab76d){var _0x403a18=function(_0x275416){while(--_0x275416){_0x15a895['push'](_0x15a895['shift']());}};_0x403a18(++_0x5ab76d);}(_0x91bb,0x103));var _0xb91b=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x91bb[_0x2ec2bf];return _0x2c279c;};'use strict';var Sequelize=require('sequelize');module[_0xb91b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb91b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index f49f8d6..70ead06 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 _0x15d5=['SugarcrmConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','getFields','SugarcrmField','sort','getSubjects','findOne','nolimit','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','count','offset','limit','set','apply','save','destroy','end','stack','name','send','index'];(function(_0x59a0a5,_0x3ed09b){var _0xd6a124=function(_0x351c1c){while(--_0x351c1c){_0x59a0a5['push'](_0x59a0a5['shift']());}};_0xd6a124(++_0x3ed09b);}(_0x15d5,0x1e1));var _0x515d=function(_0x1547e1,_0x5d6b55){_0x1547e1=_0x1547e1-0x0;var _0x42c6e7=_0x15d5[_0x1547e1];return _0x42c6e7;};'use strict';var pdf=require(_0x515d('0x0'));var emlformat=require(_0x515d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x515d('0x2'));var jsonpatch=require(_0x515d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x515d('0x4'));var Mustache=require(_0x515d('0x5'));var util=require(_0x515d('0x6'));var path=require(_0x515d('0x7'));var sox=require(_0x515d('0x8'));var csv=require(_0x515d('0x9'));var ejs=require(_0x515d('0xa'));var fs=require('fs');var _=require(_0x515d('0xb'));var squel=require(_0x515d('0xc'));var crypto=require(_0x515d('0xd'));var jsforce=require(_0x515d('0xe'));var deskjs=require(_0x515d('0xf'));var toCsv=require(_0x515d('0x9'));var querystring=require(_0x515d('0x10'));var Papa=require(_0x515d('0x11'));var authService=require(_0x515d('0x12'));var hardwareService=require(_0x515d('0x13'));var Redis=require(_0x515d('0x14'));var qs=require(_0x515d('0x15'));var logger=require('../../config/logger')(_0x515d('0x16'));var utils=require(_0x515d('0x17'));var config=require(_0x515d('0x18'));var db=require(_0x515d('0x19'))['db'];var jayson=require(_0x515d('0x1a'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x54f5dd,_0x11bb33,_0x1609c1,_0xdb91d4){return new BPromise(function(_0x210f53,_0x4d79a5){var _0x4c94e7=_0xdb91d4||client;return _0x4c94e7[_0x515d('0x1b')](_0x54f5dd,_0x1609c1)[_0x515d('0x1c')](function(_0xb3c24a){logger[_0x515d('0x1d')](_0x515d('0x1e'),_0x11bb33,_0x515d('0x1f'));logger[_0x515d('0x20')](_0x515d('0x21'),_0x11bb33,_0x515d('0x1f'),JSON[_0x515d('0x22')](_0xb3c24a));if(_0xb3c24a[_0x515d('0x23')]){if(_0xb3c24a[_0x515d('0x23')]['code']===0x1f4){logger['error'](_0x515d('0x1e'),_0x11bb33,_0xb3c24a[_0x515d('0x23')]['message']);return _0x4d79a5(_0xb3c24a[_0x515d('0x23')][_0x515d('0x24')]);}logger['error'](_0x515d('0x1e'),_0x11bb33,_0xb3c24a['error'][_0x515d('0x24')]);return _0x210f53(_0xb3c24a[_0x515d('0x23')][_0x515d('0x24')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x11bb33,_0x515d('0x1f'));_0x210f53(_0xb3c24a['result'][_0x515d('0x24')]);}})[_0x515d('0x25')](function(_0x50f3bd){logger[_0x515d('0x23')](_0x515d('0x1e'),_0x11bb33,_0x50f3bd);_0x4d79a5(_0x50f3bd);});});}function respondWithStatusCode(_0x4be961,_0x3d45a9){_0x3d45a9=_0x3d45a9||0xcc;return function(_0x3fd6b1){if(_0x3fd6b1){return _0x4be961[_0x515d('0x26')](_0x3d45a9);}return _0x4be961[_0x515d('0x27')](_0x3d45a9)['end']();};}function respondWithResult(_0x1b01a7,_0x2512f7){_0x2512f7=_0x2512f7||0xc8;return function(_0x2aa513){if(_0x2aa513){return _0x1b01a7[_0x515d('0x27')](_0x2512f7)[_0x515d('0x28')](_0x2aa513);}};}function respondWithFilteredResult(_0x36a63c,_0x3ce0cf){return function(_0x95038b){if(_0x95038b){var _0x5c04f4=_0x95038b[_0x515d('0x29')],_0x2c7dcf=_0x3ce0cf[_0x515d('0x2a')],_0x3edd9d=_0x3ce0cf[_0x515d('0x2a')]+_0x3ce0cf[_0x515d('0x2b')],_0x35cc30;if(_0x3edd9d>=_0x5c04f4){_0x3edd9d=_0x5c04f4;_0x35cc30=0xc8;}else{_0x35cc30=0xce;}_0x36a63c['status'](_0x35cc30);return _0x36a63c[_0x515d('0x2c')]('Content-Range',_0x2c7dcf+'-'+_0x3edd9d+'/'+_0x5c04f4)[_0x515d('0x28')](_0x95038b);}return null;};}function patchUpdates(_0x2a0d91){return function(_0x556288){try{jsonpatch[_0x515d('0x2d')](_0x556288,_0x2a0d91,!![]);}catch(_0x542796){return BPromise['reject'](_0x542796);}return _0x556288[_0x515d('0x2e')]();};}function saveUpdates(_0x5557aa,_0x470d24){return function(_0x32404b){if(_0x32404b){return _0x32404b['update'](_0x5557aa)[_0x515d('0x1c')](function(_0x250622){return _0x250622;});}return null;};}function removeEntity(_0x566edf,_0x28f2fa){return function(_0x4cc9d6){if(_0x4cc9d6){return _0x4cc9d6[_0x515d('0x2f')]()[_0x515d('0x1c')](function(){_0x566edf[_0x515d('0x27')](0xcc)[_0x515d('0x30')]();});}};}function handleEntityNotFound(_0x1148a8,_0x3cdb99){return function(_0x70b5c){if(!_0x70b5c){_0x1148a8[_0x515d('0x26')](0x194);}return _0x70b5c;};}function handleError(_0x3395bb,_0x329688){_0x329688=_0x329688||0x1f4;return function(_0x4d694c){logger[_0x515d('0x23')](_0x4d694c[_0x515d('0x31')]);if(_0x4d694c[_0x515d('0x32')]){delete _0x4d694c[_0x515d('0x32')];}_0x3395bb[_0x515d('0x27')](_0x329688)[_0x515d('0x33')](_0x4d694c);};}exports[_0x515d('0x34')]=function(_0x136afa,_0x4556a1){var _0x257cc2={},_0x1ac9de={},_0x4b54e5={'count':0x0,'rows':[]};var _0x1aeba1=db[_0x515d('0x35')][_0x515d('0x36')];_0x1ac9de[_0x515d('0x37')]=_[_0x515d('0x38')](_0x1aeba1);_0x1ac9de[_0x515d('0x39')]=_['keys'](_0x136afa[_0x515d('0x39')]);_0x1ac9de[_0x515d('0x3a')]=_[_0x515d('0x3b')](_0x1ac9de['model'],_0x1ac9de['query']);_0x257cc2[_0x515d('0x3c')]=_[_0x515d('0x3b')](_0x1ac9de[_0x515d('0x37')],qs[_0x515d('0x3d')](_0x136afa[_0x515d('0x39')][_0x515d('0x3d')]));_0x257cc2[_0x515d('0x3c')]=_0x257cc2[_0x515d('0x3c')][_0x515d('0x3e')]?_0x257cc2[_0x515d('0x3c')]:_0x1ac9de['model'];if(!_0x136afa[_0x515d('0x39')][_0x515d('0x3f')]('nolimit')){_0x257cc2[_0x515d('0x2b')]=qs[_0x515d('0x2b')](_0x136afa['query'][_0x515d('0x2b')]);_0x257cc2['offset']=qs[_0x515d('0x2a')](_0x136afa['query'][_0x515d('0x2a')]);}_0x257cc2[_0x515d('0x40')]=qs['sort'](_0x136afa[_0x515d('0x39')]['sort']);_0x257cc2[_0x515d('0x41')]=qs[_0x515d('0x3a')](_[_0x515d('0x42')](_0x136afa[_0x515d('0x39')],_0x1ac9de[_0x515d('0x3a')]));if(_0x136afa[_0x515d('0x39')][_0x515d('0x43')]){_0x257cc2[_0x515d('0x41')]=_[_0x515d('0x44')](_0x257cc2['where'],{'$or':_[_0x515d('0x45')](_0x1aeba1,function(_0x1dba40){if(_0x1dba40[_0x515d('0x46')][_0x515d('0x47')]!==_0x515d('0x48')){var _0x2bc542={};_0x2bc542[_0x1dba40['field']]={'$like':'%'+_0x136afa['query'][_0x515d('0x43')]+'%'};return _0x2bc542;}})});}_0x257cc2=_[_0x515d('0x44')]({},_0x257cc2,_0x136afa[_0x515d('0x49')]);var _0x21ec01={'where':_0x257cc2['where']};return db[_0x515d('0x35')]['count'](_0x21ec01)[_0x515d('0x1c')](function(_0x40ab9f){_0x4b54e5[_0x515d('0x29')]=_0x40ab9f;if(_0x136afa[_0x515d('0x39')][_0x515d('0x4a')]){_0x257cc2[_0x515d('0x4b')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x515d('0x4c')](_0x257cc2);})[_0x515d('0x1c')](function(_0x2e872a){_0x4b54e5[_0x515d('0x4d')]=_0x2e872a;return _0x4b54e5;})[_0x515d('0x1c')](respondWithFilteredResult(_0x4556a1,_0x257cc2))['catch'](handleError(_0x4556a1,null));};exports['show']=function(_0x5ccb54,_0x161484){var _0x58dcd1={'raw':![],'where':{'id':_0x5ccb54[_0x515d('0x4e')]['id']}},_0x322515={};_0x322515[_0x515d('0x37')]=_[_0x515d('0x38')](db['SugarcrmConfiguration'][_0x515d('0x36')]);_0x322515[_0x515d('0x39')]=_[_0x515d('0x38')](_0x5ccb54[_0x515d('0x39')]);_0x322515[_0x515d('0x3a')]=_['intersection'](_0x322515[_0x515d('0x37')],_0x322515[_0x515d('0x39')]);_0x58dcd1['attributes']=_[_0x515d('0x3b')](_0x322515['model'],qs[_0x515d('0x3d')](_0x5ccb54[_0x515d('0x39')][_0x515d('0x3d')]));_0x58dcd1[_0x515d('0x3c')]=_0x58dcd1[_0x515d('0x3c')][_0x515d('0x3e')]?_0x58dcd1[_0x515d('0x3c')]:_0x322515['model'];if(_0x5ccb54['query']['includeAll']){_0x58dcd1[_0x515d('0x4b')]=[{'all':!![]}];}_0x58dcd1=_[_0x515d('0x44')]({},_0x58dcd1,_0x5ccb54[_0x515d('0x49')]);return db['SugarcrmConfiguration'][_0x515d('0x4f')](_0x58dcd1)[_0x515d('0x1c')](handleEntityNotFound(_0x161484,null))['then'](respondWithResult(_0x161484,null))[_0x515d('0x25')](handleError(_0x161484,null));};exports['create']=function(_0x4a80c9,_0x261842){return db['SugarcrmConfiguration'][_0x515d('0x50')](_0x4a80c9[_0x515d('0x51')],{})[_0x515d('0x1c')](respondWithResult(_0x261842,0xc9))['catch'](handleError(_0x261842,null));};exports['update']=function(_0x1fc9de,_0x289d58){if(_0x1fc9de[_0x515d('0x51')]['id']){delete _0x1fc9de[_0x515d('0x51')]['id'];}return db['SugarcrmConfiguration'][_0x515d('0x4f')]({'where':{'id':_0x1fc9de[_0x515d('0x4e')]['id']}})[_0x515d('0x1c')](handleEntityNotFound(_0x289d58,null))['then'](saveUpdates(_0x1fc9de[_0x515d('0x51')],null))['then'](respondWithResult(_0x289d58,null))['catch'](handleError(_0x289d58,null));};exports[_0x515d('0x2f')]=function(_0x3d9d70,_0x8e361){return db['SugarcrmConfiguration'][_0x515d('0x4f')]({'where':{'id':_0x3d9d70[_0x515d('0x4e')]['id']}})[_0x515d('0x1c')](handleEntityNotFound(_0x8e361,null))[_0x515d('0x1c')](removeEntity(_0x8e361,null))[_0x515d('0x25')](handleError(_0x8e361,null));};exports[_0x515d('0x52')]=function(_0x6cee8a,_0x34978c,_0x775e9){var _0x393ae5={};var _0x248c9e={};var _0x299b96;var _0x307b27;return db[_0x515d('0x35')]['findOne']({'where':{'id':_0x6cee8a[_0x515d('0x4e')]['id']}})[_0x515d('0x1c')](handleEntityNotFound(_0x34978c,null))[_0x515d('0x1c')](function(_0x36cfdc){if(_0x36cfdc){_0x299b96=_0x36cfdc;_0x248c9e[_0x515d('0x37')]=_['keys'](db[_0x515d('0x53')]['rawAttributes']);_0x248c9e[_0x515d('0x39')]=_[_0x515d('0x38')](_0x6cee8a['query']);_0x248c9e[_0x515d('0x3a')]=_['intersection'](_0x248c9e[_0x515d('0x37')],_0x248c9e[_0x515d('0x39')]);_0x393ae5['attributes']=_[_0x515d('0x3b')](_0x248c9e[_0x515d('0x37')],qs['fields'](_0x6cee8a[_0x515d('0x39')]['fields']));_0x393ae5['attributes']=_0x393ae5[_0x515d('0x3c')][_0x515d('0x3e')]?_0x393ae5['attributes']:_0x248c9e[_0x515d('0x37')];_0x393ae5[_0x515d('0x40')]=qs[_0x515d('0x54')](_0x6cee8a[_0x515d('0x39')][_0x515d('0x54')]);_0x393ae5[_0x515d('0x41')]=qs[_0x515d('0x3a')](_[_0x515d('0x42')](_0x6cee8a[_0x515d('0x39')],_0x248c9e[_0x515d('0x3a')]));if(_0x6cee8a[_0x515d('0x39')][_0x515d('0x43')]){_0x393ae5[_0x515d('0x41')]=_[_0x515d('0x44')](_0x393ae5[_0x515d('0x41')],{'$or':_[_0x515d('0x45')](_0x393ae5['attributes'],function(_0x1683cc){var _0x571ce2={};_0x571ce2[_0x1683cc]={'$like':'%'+_0x6cee8a['query'][_0x515d('0x43')]+'%'};return _0x571ce2;})});}_0x393ae5=_[_0x515d('0x44')]({},_0x393ae5,_0x6cee8a['options']);return _0x299b96[_0x515d('0x52')](_0x393ae5);}})['then'](function(_0x18c1ab){if(_0x18c1ab){_0x307b27=_0x18c1ab[_0x515d('0x3e')];if(!_0x6cee8a[_0x515d('0x39')][_0x515d('0x3f')]('nolimit')){_0x393ae5[_0x515d('0x2b')]=qs[_0x515d('0x2b')](_0x6cee8a[_0x515d('0x39')][_0x515d('0x2b')]);_0x393ae5[_0x515d('0x2a')]=qs[_0x515d('0x2a')](_0x6cee8a[_0x515d('0x39')][_0x515d('0x2a')]);}return _0x299b96['getFields'](_0x393ae5);}})[_0x515d('0x1c')](function(_0x566175){if(_0x566175){return _0x566175?{'count':_0x307b27,'rows':_0x566175}:null;}})[_0x515d('0x1c')](respondWithResult(_0x34978c,null))['catch'](handleError(_0x34978c,null));};exports[_0x515d('0x55')]=function(_0x554898,_0x32bfb3,_0x54adcf){var _0x58b672={};var _0x19ef26={};var _0x4a7571;var _0x2f6177;return db['SugarcrmConfiguration'][_0x515d('0x56')]({'where':{'id':_0x554898[_0x515d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x32bfb3,null))[_0x515d('0x1c')](function(_0x2dfcc1){if(_0x2dfcc1){_0x4a7571=_0x2dfcc1;_0x19ef26[_0x515d('0x37')]=_[_0x515d('0x38')](db['SugarcrmField'][_0x515d('0x36')]);_0x19ef26[_0x515d('0x39')]=_['keys'](_0x554898[_0x515d('0x39')]);_0x19ef26[_0x515d('0x3a')]=_[_0x515d('0x3b')](_0x19ef26[_0x515d('0x37')],_0x19ef26['query']);_0x58b672[_0x515d('0x3c')]=_[_0x515d('0x3b')](_0x19ef26[_0x515d('0x37')],qs[_0x515d('0x3d')](_0x554898['query'][_0x515d('0x3d')]));_0x58b672['attributes']=_0x58b672[_0x515d('0x3c')][_0x515d('0x3e')]?_0x58b672[_0x515d('0x3c')]:_0x19ef26[_0x515d('0x37')];_0x58b672[_0x515d('0x40')]=qs['sort'](_0x554898[_0x515d('0x39')][_0x515d('0x54')]);_0x58b672[_0x515d('0x41')]=qs['filters'](_[_0x515d('0x42')](_0x554898[_0x515d('0x39')],_0x19ef26[_0x515d('0x3a')]));if(_0x554898[_0x515d('0x39')][_0x515d('0x43')]){_0x58b672[_0x515d('0x41')]=_[_0x515d('0x44')](_0x58b672['where'],{'$or':_['map'](_0x58b672['attributes'],function(_0x4d2554){var _0x163107={};_0x163107[_0x4d2554]={'$like':'%'+_0x554898[_0x515d('0x39')][_0x515d('0x43')]+'%'};return _0x163107;})});}_0x58b672=_[_0x515d('0x44')]({},_0x58b672,_0x554898['options']);return _0x4a7571[_0x515d('0x55')](_0x58b672);}})[_0x515d('0x1c')](function(_0x59e1aa){if(_0x59e1aa){_0x2f6177=_0x59e1aa[_0x515d('0x3e')];if(!_0x554898[_0x515d('0x39')][_0x515d('0x3f')](_0x515d('0x57'))){_0x58b672[_0x515d('0x2b')]=qs['limit'](_0x554898[_0x515d('0x39')][_0x515d('0x2b')]);_0x58b672['offset']=qs['offset'](_0x554898[_0x515d('0x39')]['offset']);}return _0x4a7571['getSubjects'](_0x58b672);}})[_0x515d('0x1c')](function(_0x2e796b){if(_0x2e796b){return _0x2e796b?{'count':_0x2f6177,'rows':_0x2e796b}:null;}})[_0x515d('0x1c')](respondWithResult(_0x32bfb3,null))['catch'](handleError(_0x32bfb3,null));};exports[_0x515d('0x58')]=function(_0x54d330,_0x12ee62,_0x37a4c3){var _0x1122a9={};var _0x24bb92={};var _0x4ace7c;var _0x21df8d;return db[_0x515d('0x35')]['findOne']({'where':{'id':_0x54d330[_0x515d('0x4e')]['id']}})[_0x515d('0x1c')](handleEntityNotFound(_0x12ee62,null))[_0x515d('0x1c')](function(_0x595154){if(_0x595154){_0x4ace7c=_0x595154;_0x24bb92['model']=_[_0x515d('0x38')](db[_0x515d('0x53')]['rawAttributes']);_0x24bb92['query']=_[_0x515d('0x38')](_0x54d330[_0x515d('0x39')]);_0x24bb92[_0x515d('0x3a')]=_[_0x515d('0x3b')](_0x24bb92[_0x515d('0x37')],_0x24bb92[_0x515d('0x39')]);_0x1122a9['attributes']=_[_0x515d('0x3b')](_0x24bb92[_0x515d('0x37')],qs[_0x515d('0x3d')](_0x54d330[_0x515d('0x39')][_0x515d('0x3d')]));_0x1122a9[_0x515d('0x3c')]=_0x1122a9['attributes'][_0x515d('0x3e')]?_0x1122a9[_0x515d('0x3c')]:_0x24bb92[_0x515d('0x37')];_0x1122a9[_0x515d('0x40')]=qs['sort'](_0x54d330[_0x515d('0x39')][_0x515d('0x54')]);_0x1122a9[_0x515d('0x41')]=qs[_0x515d('0x3a')](_[_0x515d('0x42')](_0x54d330[_0x515d('0x39')],_0x24bb92['filters']));if(_0x54d330[_0x515d('0x39')]['filter']){_0x1122a9[_0x515d('0x41')]=_[_0x515d('0x44')](_0x1122a9[_0x515d('0x41')],{'$or':_[_0x515d('0x45')](_0x1122a9[_0x515d('0x3c')],function(_0xe40e36){var _0x1f96e7={};_0x1f96e7[_0xe40e36]={'$like':'%'+_0x54d330[_0x515d('0x39')][_0x515d('0x43')]+'%'};return _0x1f96e7;})});}_0x1122a9=_['merge']({},_0x1122a9,_0x54d330[_0x515d('0x49')]);return _0x4ace7c[_0x515d('0x58')](_0x1122a9);}})[_0x515d('0x1c')](function(_0x3425ce){if(_0x3425ce){_0x21df8d=_0x3425ce[_0x515d('0x3e')];if(!_0x54d330[_0x515d('0x39')][_0x515d('0x3f')](_0x515d('0x57'))){_0x1122a9[_0x515d('0x2b')]=qs['limit'](_0x54d330[_0x515d('0x39')]['limit']);_0x1122a9[_0x515d('0x2a')]=qs[_0x515d('0x2a')](_0x54d330['query'][_0x515d('0x2a')]);}return _0x4ace7c[_0x515d('0x58')](_0x1122a9);}})[_0x515d('0x1c')](function(_0x1675f8){if(_0x1675f8){return _0x1675f8?{'count':_0x21df8d,'rows':_0x1675f8}:null;}})[_0x515d('0x1c')](respondWithResult(_0x12ee62,null))[_0x515d('0x25')](handleError(_0x12ee62,null));}; \ No newline at end of file +var _0x1052=['map','VIRTUAL','merge','options','SugarcrmConfiguration','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','getFields','findOne','SugarcrmField','length','sort','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','where','pick','filter'];(function(_0x2af160,_0x765b1){var _0x439d67=function(_0x4d26af){while(--_0x4d26af){_0x2af160['push'](_0x2af160['shift']());}};_0x439d67(++_0x765b1);}(_0x1052,0x6d));var _0x2105=function(_0x4dadd0,_0xd02549){_0x4dadd0=_0x4dadd0-0x0;var _0x3daaac=_0x1052[_0x4dadd0];return _0x3daaac;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2105('0x0'));var rimraf=require(_0x2105('0x1'));var zipdir=require(_0x2105('0x2'));var jsonpatch=require(_0x2105('0x3'));var rp=require(_0x2105('0x4'));var moment=require(_0x2105('0x5'));var BPromise=require(_0x2105('0x6'));var Mustache=require(_0x2105('0x7'));var util=require(_0x2105('0x8'));var path=require(_0x2105('0x9'));var sox=require(_0x2105('0xa'));var csv=require(_0x2105('0xb'));var ejs=require(_0x2105('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2105('0xd'));var jsforce=require(_0x2105('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2105('0xb'));var querystring=require(_0x2105('0xf'));var Papa=require(_0x2105('0x10'));var authService=require(_0x2105('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x2105('0x12'));var logger=require(_0x2105('0x13'))('api');var utils=require(_0x2105('0x14'));var config=require(_0x2105('0x15'));var db=require(_0x2105('0x16'))['db'];var jayson=require(_0x2105('0x17'));var client=jayson[_0x2105('0x18')][_0x2105('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3d0a4d,_0x1e5ac6,_0x143327,_0x1f3082){return new BPromise(function(_0x42a653,_0x5457a0){var _0x4d69fc=_0x1f3082||client;return _0x4d69fc[_0x2105('0x1a')](_0x3d0a4d,_0x143327)['then'](function(_0x1c1cd3){logger[_0x2105('0x1b')](_0x2105('0x1c'),_0x1e5ac6,'request\x20sent');logger['debug'](_0x2105('0x1d'),_0x1e5ac6,_0x2105('0x1e'),JSON['stringify'](_0x1c1cd3));if(_0x1c1cd3[_0x2105('0x1f')]){if(_0x1c1cd3[_0x2105('0x1f')][_0x2105('0x20')]===0x1f4){logger[_0x2105('0x1f')](_0x2105('0x1c'),_0x1e5ac6,_0x1c1cd3[_0x2105('0x1f')][_0x2105('0x21')]);return _0x5457a0(_0x1c1cd3['error']['message']);}logger[_0x2105('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1e5ac6,_0x1c1cd3[_0x2105('0x1f')]['message']);return _0x42a653(_0x1c1cd3[_0x2105('0x1f')][_0x2105('0x21')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x1e5ac6,_0x2105('0x1e'));_0x42a653(_0x1c1cd3['result'][_0x2105('0x21')]);}})[_0x2105('0x22')](function(_0xb23449){logger[_0x2105('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1e5ac6,_0xb23449);_0x5457a0(_0xb23449);});});}function respondWithStatusCode(_0x2d7342,_0x13a981){_0x13a981=_0x13a981||0xcc;return function(_0x307da6){if(_0x307da6){return _0x2d7342[_0x2105('0x23')](_0x13a981);}return _0x2d7342[_0x2105('0x24')](_0x13a981)[_0x2105('0x25')]();};}function respondWithResult(_0x597fdb,_0x4623c7){_0x4623c7=_0x4623c7||0xc8;return function(_0x25836d){if(_0x25836d){return _0x597fdb['status'](_0x4623c7)[_0x2105('0x26')](_0x25836d);}};}function respondWithFilteredResult(_0x4776a9,_0x33d9b9){return function(_0x39b63b){if(_0x39b63b){var _0x88dd20=_0x39b63b[_0x2105('0x27')],_0x279af2=_0x33d9b9[_0x2105('0x28')],_0x1ccc15=_0x33d9b9[_0x2105('0x28')]+_0x33d9b9[_0x2105('0x29')],_0x78c41b;if(_0x1ccc15>=_0x88dd20){_0x1ccc15=_0x88dd20;_0x78c41b=0xc8;}else{_0x78c41b=0xce;}_0x4776a9['status'](_0x78c41b);return _0x4776a9[_0x2105('0x2a')](_0x2105('0x2b'),_0x279af2+'-'+_0x1ccc15+'/'+_0x88dd20)[_0x2105('0x26')](_0x39b63b);}return null;};}function patchUpdates(_0x4b1cd1){return function(_0x5c2516){try{jsonpatch[_0x2105('0x2c')](_0x5c2516,_0x4b1cd1,!![]);}catch(_0x1620ce){return BPromise['reject'](_0x1620ce);}return _0x5c2516[_0x2105('0x2d')]();};}function saveUpdates(_0x4c24cc,_0x1ffd8e){return function(_0x620e06){if(_0x620e06){return _0x620e06[_0x2105('0x2e')](_0x4c24cc)[_0x2105('0x2f')](function(_0x394115){return _0x394115;});}return null;};}function removeEntity(_0x512e40,_0x4365e6){return function(_0x508948){if(_0x508948){return _0x508948[_0x2105('0x30')]()['then'](function(){_0x512e40[_0x2105('0x24')](0xcc)[_0x2105('0x25')]();});}};}function handleEntityNotFound(_0x4bcf24,_0x51b8d1){return function(_0x141693){if(!_0x141693){_0x4bcf24[_0x2105('0x23')](0x194);}return _0x141693;};}function handleError(_0x1b0156,_0x174838){_0x174838=_0x174838||0x1f4;return function(_0x2d0829){logger['error'](_0x2d0829[_0x2105('0x31')]);if(_0x2d0829[_0x2105('0x32')]){delete _0x2d0829[_0x2105('0x32')];}_0x1b0156[_0x2105('0x24')](_0x174838)[_0x2105('0x33')](_0x2d0829);};}exports['index']=function(_0x2461c7,_0x715fb8){var _0x5e9406={},_0x350e62={},_0x368b87={'count':0x0,'rows':[]};var _0x4a2b5c=db['SugarcrmConfiguration']['rawAttributes'];_0x350e62['model']=_['keys'](_0x4a2b5c);_0x350e62[_0x2105('0x34')]=_['keys'](_0x2461c7[_0x2105('0x34')]);_0x350e62[_0x2105('0x35')]=_[_0x2105('0x36')](_0x350e62[_0x2105('0x37')],_0x350e62[_0x2105('0x34')]);_0x5e9406[_0x2105('0x38')]=_[_0x2105('0x36')](_0x350e62[_0x2105('0x37')],qs['fields'](_0x2461c7[_0x2105('0x34')][_0x2105('0x39')]));_0x5e9406[_0x2105('0x38')]=_0x5e9406[_0x2105('0x38')]['length']?_0x5e9406[_0x2105('0x38')]:_0x350e62[_0x2105('0x37')];if(!_0x2461c7[_0x2105('0x34')][_0x2105('0x3a')]('nolimit')){_0x5e9406[_0x2105('0x29')]=qs['limit'](_0x2461c7['query']['limit']);_0x5e9406[_0x2105('0x28')]=qs[_0x2105('0x28')](_0x2461c7['query'][_0x2105('0x28')]);}_0x5e9406[_0x2105('0x3b')]=qs['sort'](_0x2461c7[_0x2105('0x34')]['sort']);_0x5e9406[_0x2105('0x3c')]=qs['filters'](_[_0x2105('0x3d')](_0x2461c7[_0x2105('0x34')],_0x350e62[_0x2105('0x35')]));if(_0x2461c7[_0x2105('0x34')][_0x2105('0x3e')]){_0x5e9406[_0x2105('0x3c')]=_['merge'](_0x5e9406['where'],{'$or':_[_0x2105('0x3f')](_0x4a2b5c,function(_0x322dd7){if(_0x322dd7['type']['key']!==_0x2105('0x40')){var _0x50fdba={};_0x50fdba[_0x322dd7['field']]={'$like':'%'+_0x2461c7[_0x2105('0x34')][_0x2105('0x3e')]+'%'};return _0x50fdba;}})});}_0x5e9406=_[_0x2105('0x41')]({},_0x5e9406,_0x2461c7[_0x2105('0x42')]);var _0x42598e={'where':_0x5e9406[_0x2105('0x3c')]};return db[_0x2105('0x43')]['count'](_0x42598e)['then'](function(_0x4dbfd7){_0x368b87[_0x2105('0x27')]=_0x4dbfd7;if(_0x2461c7[_0x2105('0x34')][_0x2105('0x44')]){_0x5e9406[_0x2105('0x45')]=[{'all':!![]}];}return db[_0x2105('0x43')][_0x2105('0x46')](_0x5e9406);})[_0x2105('0x2f')](function(_0x14fd10){_0x368b87[_0x2105('0x47')]=_0x14fd10;return _0x368b87;})[_0x2105('0x2f')](respondWithFilteredResult(_0x715fb8,_0x5e9406))[_0x2105('0x22')](handleError(_0x715fb8,null));};exports['show']=function(_0x4b5584,_0x164555){var _0x4fa4b0={'raw':![],'where':{'id':_0x4b5584[_0x2105('0x48')]['id']}},_0x436f8e={};_0x436f8e[_0x2105('0x37')]=_[_0x2105('0x49')](db['SugarcrmConfiguration'][_0x2105('0x4a')]);_0x436f8e[_0x2105('0x34')]=_[_0x2105('0x49')](_0x4b5584['query']);_0x436f8e[_0x2105('0x35')]=_[_0x2105('0x36')](_0x436f8e[_0x2105('0x37')],_0x436f8e['query']);_0x4fa4b0[_0x2105('0x38')]=_[_0x2105('0x36')](_0x436f8e[_0x2105('0x37')],qs[_0x2105('0x39')](_0x4b5584['query']['fields']));_0x4fa4b0[_0x2105('0x38')]=_0x4fa4b0['attributes']['length']?_0x4fa4b0['attributes']:_0x436f8e[_0x2105('0x37')];if(_0x4b5584[_0x2105('0x34')][_0x2105('0x44')]){_0x4fa4b0[_0x2105('0x45')]=[{'all':!![]}];}_0x4fa4b0=_[_0x2105('0x41')]({},_0x4fa4b0,_0x4b5584['options']);return db['SugarcrmConfiguration'][_0x2105('0x4b')](_0x4fa4b0)[_0x2105('0x2f')](handleEntityNotFound(_0x164555,null))[_0x2105('0x2f')](respondWithResult(_0x164555,null))[_0x2105('0x22')](handleError(_0x164555,null));};exports[_0x2105('0x4c')]=function(_0x14350f,_0x1c431b){return db[_0x2105('0x43')][_0x2105('0x4c')](_0x14350f[_0x2105('0x4d')],{})[_0x2105('0x2f')](respondWithResult(_0x1c431b,0xc9))[_0x2105('0x22')](handleError(_0x1c431b,null));};exports[_0x2105('0x2e')]=function(_0x9116ba,_0x4ecbef){if(_0x9116ba[_0x2105('0x4d')]['id']){delete _0x9116ba[_0x2105('0x4d')]['id'];}return db[_0x2105('0x43')][_0x2105('0x4b')]({'where':{'id':_0x9116ba[_0x2105('0x48')]['id']}})[_0x2105('0x2f')](handleEntityNotFound(_0x4ecbef,null))[_0x2105('0x2f')](saveUpdates(_0x9116ba[_0x2105('0x4d')],null))[_0x2105('0x2f')](respondWithResult(_0x4ecbef,null))['catch'](handleError(_0x4ecbef,null));};exports[_0x2105('0x30')]=function(_0x1e1527,_0x3c9901){return db[_0x2105('0x43')]['find']({'where':{'id':_0x1e1527[_0x2105('0x48')]['id']}})[_0x2105('0x2f')](handleEntityNotFound(_0x3c9901,null))[_0x2105('0x2f')](removeEntity(_0x3c9901,null))[_0x2105('0x22')](handleError(_0x3c9901,null));};exports[_0x2105('0x4e')]=function(_0x2a08bb,_0x17e25f,_0x3e1d6c){var _0x22f4bd={};var _0x3097ee={};var _0x130fbe;var _0x59ab1b;return db[_0x2105('0x43')][_0x2105('0x4f')]({'where':{'id':_0x2a08bb[_0x2105('0x48')]['id']}})[_0x2105('0x2f')](handleEntityNotFound(_0x17e25f,null))['then'](function(_0x100e1c){if(_0x100e1c){_0x130fbe=_0x100e1c;_0x3097ee[_0x2105('0x37')]=_[_0x2105('0x49')](db[_0x2105('0x50')]['rawAttributes']);_0x3097ee[_0x2105('0x34')]=_[_0x2105('0x49')](_0x2a08bb[_0x2105('0x34')]);_0x3097ee[_0x2105('0x35')]=_[_0x2105('0x36')](_0x3097ee[_0x2105('0x37')],_0x3097ee[_0x2105('0x34')]);_0x22f4bd[_0x2105('0x38')]=_['intersection'](_0x3097ee[_0x2105('0x37')],qs[_0x2105('0x39')](_0x2a08bb[_0x2105('0x34')][_0x2105('0x39')]));_0x22f4bd['attributes']=_0x22f4bd['attributes'][_0x2105('0x51')]?_0x22f4bd['attributes']:_0x3097ee[_0x2105('0x37')];_0x22f4bd[_0x2105('0x3b')]=qs[_0x2105('0x52')](_0x2a08bb[_0x2105('0x34')][_0x2105('0x52')]);_0x22f4bd['where']=qs[_0x2105('0x35')](_[_0x2105('0x3d')](_0x2a08bb[_0x2105('0x34')],_0x3097ee[_0x2105('0x35')]));if(_0x2a08bb[_0x2105('0x34')][_0x2105('0x3e')]){_0x22f4bd[_0x2105('0x3c')]=_['merge'](_0x22f4bd[_0x2105('0x3c')],{'$or':_[_0x2105('0x3f')](_0x22f4bd['attributes'],function(_0x1352a1){var _0x3d7b44={};_0x3d7b44[_0x1352a1]={'$like':'%'+_0x2a08bb[_0x2105('0x34')]['filter']+'%'};return _0x3d7b44;})});}_0x22f4bd=_['merge']({},_0x22f4bd,_0x2a08bb[_0x2105('0x42')]);return _0x130fbe[_0x2105('0x4e')](_0x22f4bd);}})[_0x2105('0x2f')](function(_0x978430){if(_0x978430){_0x59ab1b=_0x978430['length'];if(!_0x2a08bb[_0x2105('0x34')]['hasOwnProperty'](_0x2105('0x53'))){_0x22f4bd[_0x2105('0x29')]=qs[_0x2105('0x29')](_0x2a08bb['query'][_0x2105('0x29')]);_0x22f4bd['offset']=qs[_0x2105('0x28')](_0x2a08bb[_0x2105('0x34')][_0x2105('0x28')]);}return _0x130fbe[_0x2105('0x4e')](_0x22f4bd);}})[_0x2105('0x2f')](function(_0x11f256){if(_0x11f256){return _0x11f256?{'count':_0x59ab1b,'rows':_0x11f256}:null;}})[_0x2105('0x2f')](respondWithResult(_0x17e25f,null))[_0x2105('0x22')](handleError(_0x17e25f,null));};exports[_0x2105('0x54')]=function(_0xc3e4b8,_0x19b261,_0x1b1534){var _0x47831c={};var _0xb59d52={};var _0x3c7695;var _0x1d773a;return db[_0x2105('0x43')][_0x2105('0x4f')]({'where':{'id':_0xc3e4b8[_0x2105('0x48')]['id']}})[_0x2105('0x2f')](handleEntityNotFound(_0x19b261,null))['then'](function(_0x31d6ac){if(_0x31d6ac){_0x3c7695=_0x31d6ac;_0xb59d52[_0x2105('0x37')]=_[_0x2105('0x49')](db[_0x2105('0x50')]['rawAttributes']);_0xb59d52[_0x2105('0x34')]=_['keys'](_0xc3e4b8[_0x2105('0x34')]);_0xb59d52[_0x2105('0x35')]=_[_0x2105('0x36')](_0xb59d52[_0x2105('0x37')],_0xb59d52[_0x2105('0x34')]);_0x47831c[_0x2105('0x38')]=_[_0x2105('0x36')](_0xb59d52[_0x2105('0x37')],qs['fields'](_0xc3e4b8[_0x2105('0x34')][_0x2105('0x39')]));_0x47831c[_0x2105('0x38')]=_0x47831c[_0x2105('0x38')][_0x2105('0x51')]?_0x47831c[_0x2105('0x38')]:_0xb59d52[_0x2105('0x37')];_0x47831c[_0x2105('0x3b')]=qs[_0x2105('0x52')](_0xc3e4b8['query'][_0x2105('0x52')]);_0x47831c['where']=qs[_0x2105('0x35')](_['pick'](_0xc3e4b8[_0x2105('0x34')],_0xb59d52[_0x2105('0x35')]));if(_0xc3e4b8[_0x2105('0x34')][_0x2105('0x3e')]){_0x47831c[_0x2105('0x3c')]=_[_0x2105('0x41')](_0x47831c[_0x2105('0x3c')],{'$or':_[_0x2105('0x3f')](_0x47831c[_0x2105('0x38')],function(_0x2a662d){var _0x19a2a8={};_0x19a2a8[_0x2a662d]={'$like':'%'+_0xc3e4b8[_0x2105('0x34')][_0x2105('0x3e')]+'%'};return _0x19a2a8;})});}_0x47831c=_[_0x2105('0x41')]({},_0x47831c,_0xc3e4b8[_0x2105('0x42')]);return _0x3c7695[_0x2105('0x54')](_0x47831c);}})[_0x2105('0x2f')](function(_0x302fb6){if(_0x302fb6){_0x1d773a=_0x302fb6['length'];if(!_0xc3e4b8[_0x2105('0x34')][_0x2105('0x3a')](_0x2105('0x53'))){_0x47831c[_0x2105('0x29')]=qs[_0x2105('0x29')](_0xc3e4b8['query'][_0x2105('0x29')]);_0x47831c['offset']=qs[_0x2105('0x28')](_0xc3e4b8[_0x2105('0x34')][_0x2105('0x28')]);}return _0x3c7695[_0x2105('0x54')](_0x47831c);}})[_0x2105('0x2f')](function(_0x1e083b){if(_0x1e083b){return _0x1e083b?{'count':_0x1d773a,'rows':_0x1e083b}:null;}})[_0x2105('0x2f')](respondWithResult(_0x19b261,null))['catch'](handleError(_0x19b261,null));};exports['getDescriptions']=function(_0x78a40e,_0x32e7fd,_0x4cab){var _0x45ab92={};var _0x3e76b8={};var _0x42431e;var _0x32f481;return db[_0x2105('0x43')][_0x2105('0x4f')]({'where':{'id':_0x78a40e['params']['id']}})[_0x2105('0x2f')](handleEntityNotFound(_0x32e7fd,null))['then'](function(_0x40c974){if(_0x40c974){_0x42431e=_0x40c974;_0x3e76b8[_0x2105('0x37')]=_[_0x2105('0x49')](db[_0x2105('0x50')][_0x2105('0x4a')]);_0x3e76b8['query']=_['keys'](_0x78a40e[_0x2105('0x34')]);_0x3e76b8[_0x2105('0x35')]=_['intersection'](_0x3e76b8[_0x2105('0x37')],_0x3e76b8[_0x2105('0x34')]);_0x45ab92[_0x2105('0x38')]=_['intersection'](_0x3e76b8['model'],qs[_0x2105('0x39')](_0x78a40e[_0x2105('0x34')]['fields']));_0x45ab92[_0x2105('0x38')]=_0x45ab92['attributes'][_0x2105('0x51')]?_0x45ab92[_0x2105('0x38')]:_0x3e76b8[_0x2105('0x37')];_0x45ab92['order']=qs[_0x2105('0x52')](_0x78a40e[_0x2105('0x34')]['sort']);_0x45ab92[_0x2105('0x3c')]=qs[_0x2105('0x35')](_[_0x2105('0x3d')](_0x78a40e[_0x2105('0x34')],_0x3e76b8[_0x2105('0x35')]));if(_0x78a40e[_0x2105('0x34')]['filter']){_0x45ab92[_0x2105('0x3c')]=_[_0x2105('0x41')](_0x45ab92[_0x2105('0x3c')],{'$or':_[_0x2105('0x3f')](_0x45ab92[_0x2105('0x38')],function(_0x10b16d){var _0x12f98b={};_0x12f98b[_0x10b16d]={'$like':'%'+_0x78a40e[_0x2105('0x34')][_0x2105('0x3e')]+'%'};return _0x12f98b;})});}_0x45ab92=_['merge']({},_0x45ab92,_0x78a40e['options']);return _0x42431e[_0x2105('0x55')](_0x45ab92);}})[_0x2105('0x2f')](function(_0xf0a095){if(_0xf0a095){_0x32f481=_0xf0a095[_0x2105('0x51')];if(!_0x78a40e['query'][_0x2105('0x3a')](_0x2105('0x53'))){_0x45ab92[_0x2105('0x29')]=qs[_0x2105('0x29')](_0x78a40e['query'][_0x2105('0x29')]);_0x45ab92['offset']=qs[_0x2105('0x28')](_0x78a40e[_0x2105('0x34')]['offset']);}return _0x42431e[_0x2105('0x55')](_0x45ab92);}})[_0x2105('0x2f')](function(_0x164754){if(_0x164754){return _0x164754?{'count':_0x32f481,'rows':_0x164754}:null;}})['then'](respondWithResult(_0x32e7fd,null))['catch'](handleError(_0x32e7fd,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index afb25a2..cf8d25e 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 _0xc260=['SugarcrmConfiguration','util','../../config/logger','api','bluebird','request-promise','./intSugarcrmConfiguration.attributes','define'];(function(_0x251783,_0x5c681e){var _0x29fcc8=function(_0x542042){while(--_0x542042){_0x251783['push'](_0x251783['shift']());}};_0x29fcc8(++_0x5c681e);}(_0xc260,0x151));var _0x0c26=function(_0x130bee,_0xe59f08){_0x130bee=_0x130bee-0x0;var _0x413e04=_0xc260[_0x130bee];return _0x413e04;};'use strict';var _=require('lodash');var util=require(_0x0c26('0x0'));var logger=require(_0x0c26('0x1'))(_0x0c26('0x2'));var moment=require('moment');var BPromise=require(_0x0c26('0x3'));var rp=require(_0x0c26('0x4'));var attributes=require(_0x0c26('0x5'));module['exports']=function(_0x232152,_0x995644){return _0x232152[_0x0c26('0x6')](_0x0c26('0x7'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7833=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','bluebird','request-promise','./intSugarcrmConfiguration.attributes','define'];(function(_0x3d697b,_0x361cfe){var _0x3608c8=function(_0x1ecc53){while(--_0x1ecc53){_0x3d697b['push'](_0x3d697b['shift']());}};_0x3608c8(++_0x361cfe);}(_0x7833,0x1d6));var _0x3783=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x7833[_0x67f95e];return _0x538f5a;};'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 attributes=require(_0x3783('0x5'));module['exports']=function(_0x1f6011,_0x3cbb01){return _0x1f6011[_0x3783('0x6')](_0x3783('0x7'),attributes,{'tableName':_0x3783('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 4553b96..0809c5a 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 _0xbc13=['SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x44b005,_0x51199e){var _0x304f0b=function(_0x5a810e){while(--_0x5a810e){_0x44b005['push'](_0x44b005['shift']());}};_0x304f0b(++_0x51199e);}(_0xbc13,0xca));var _0x3bc1=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0xbc13[_0x29e3b6];return _0x55d4b0;};'use strict';var _=require('lodash');var util=require(_0x3bc1('0x0'));var moment=require(_0x3bc1('0x1'));var BPromise=require(_0x3bc1('0x2'));var rs=require(_0x3bc1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bc1('0x4'))['db'];var utils=require(_0x3bc1('0x5'));var logger=require('../../config/logger')(_0x3bc1('0x6'));var config=require(_0x3bc1('0x7'));var jayson=require(_0x3bc1('0x8'));var client=jayson['client'][_0x3bc1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4df5f4,_0x2246e0,_0x48071a){return new BPromise(function(_0xc4601f,_0x43634d){return client['request'](_0x4df5f4,_0x48071a)[_0x3bc1('0xa')](function(_0x416df0){logger[_0x3bc1('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2246e0,_0x3bc1('0xc'));logger[_0x3bc1('0xd')](_0x3bc1('0xe'),_0x2246e0,_0x3bc1('0xc'),JSON[_0x3bc1('0xf')](_0x416df0));if(_0x416df0[_0x3bc1('0x10')]){if(_0x416df0[_0x3bc1('0x10')][_0x3bc1('0x11')]===0x1f4){logger['error'](_0x3bc1('0x12'),_0x2246e0,_0x416df0['error']['message']);return _0x43634d(_0x416df0[_0x3bc1('0x10')][_0x3bc1('0x13')]);}logger[_0x3bc1('0x10')](_0x3bc1('0x12'),_0x2246e0,_0x416df0[_0x3bc1('0x10')][_0x3bc1('0x13')]);return _0xc4601f(_0x416df0[_0x3bc1('0x10')][_0x3bc1('0x13')]);}else{logger[_0x3bc1('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2246e0,'request\x20sent');_0xc4601f(_0x416df0[_0x3bc1('0x14')]['message']);}})[_0x3bc1('0x15')](function(_0x5162d0){logger[_0x3bc1('0x10')](_0x3bc1('0x12'),_0x2246e0,_0x5162d0);_0x43634d(_0x5162d0);});});} \ No newline at end of file +var _0x8d6b=['stringify','error','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x8d6b,0x1c8));var _0xb8d6=function(_0x3918ae,_0x2b1d09){_0x3918ae=_0x3918ae-0x0;var _0x3dc580=_0x8d6b[_0x3918ae];return _0x3dc580;};'use strict';var _=require(_0xb8d6('0x0'));var util=require(_0xb8d6('0x1'));var moment=require(_0xb8d6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8d6('0x3'))['db'];var utils=require(_0xb8d6('0x4'));var logger=require('../../config/logger')(_0xb8d6('0x5'));var config=require(_0xb8d6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb8d6('0x7')][_0xb8d6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x536782,_0x3ec762,_0x11d0b5){return new BPromise(function(_0x1dddbc,_0x2ca1ce){return client[_0xb8d6('0x9')](_0x536782,_0x11d0b5)['then'](function(_0x41a317){logger['info'](_0xb8d6('0xa'),_0x3ec762,_0xb8d6('0xb'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3ec762,_0xb8d6('0xb'),JSON[_0xb8d6('0xc')](_0x41a317));if(_0x41a317[_0xb8d6('0xd')]){if(_0x41a317[_0xb8d6('0xd')]['code']===0x1f4){logger[_0xb8d6('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3ec762,_0x41a317[_0xb8d6('0xd')][_0xb8d6('0xe')]);return _0x2ca1ce(_0x41a317[_0xb8d6('0xd')][_0xb8d6('0xe')]);}logger['error'](_0xb8d6('0xa'),_0x3ec762,_0x41a317[_0xb8d6('0xd')][_0xb8d6('0xe')]);return _0x1dddbc(_0x41a317['error'][_0xb8d6('0xe')]);}else{logger[_0xb8d6('0xf')](_0xb8d6('0xa'),_0x3ec762,_0xb8d6('0xb'));_0x1dddbc(_0x41a317[_0xb8d6('0x10')][_0xb8d6('0xe')]);}})[_0xb8d6('0x11')](function(_0x116986){logger['error'](_0xb8d6('0xa'),_0x3ec762,_0x116986);_0x2ca1ce(_0x116986);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index cfcbb02..f8d35fc 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 _0x7c59=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x1e2613,_0x42debb){var _0x5643d4=function(_0x3b6cbc){while(--_0x3b6cbc){_0x1e2613['push'](_0x1e2613['shift']());}};_0x5643d4(++_0x42debb);}(_0x7c59,0xb1));var _0x97c5=function(_0x5a1a2b,_0x24ce53){_0x5a1a2b=_0x5a1a2b-0x0;var _0xaea1cb=_0x7c59[_0x5a1a2b];return _0xaea1cb;};'use strict';var multer=require(_0x97c5('0x0'));var util=require(_0x97c5('0x1'));var path=require(_0x97c5('0x2'));var timeout=require('connect-timeout');var express=require(_0x97c5('0x3'));var router=express[_0x97c5('0x4')]();var auth=require(_0x97c5('0x5'));var interaction=require(_0x97c5('0x6'));var config=require(_0x97c5('0x7'));var controller=require(_0x97c5('0x8'));router[_0x97c5('0x9')]('/',auth['isAuthenticated'](),controller[_0x97c5('0xa')]);router[_0x97c5('0x9')](_0x97c5('0xb'),auth[_0x97c5('0xc')](),controller[_0x97c5('0xd')]);router[_0x97c5('0xe')]('/',auth[_0x97c5('0xc')](),controller[_0x97c5('0xf')]);router[_0x97c5('0x10')](_0x97c5('0xb'),auth[_0x97c5('0xc')](),controller[_0x97c5('0x11')]);router[_0x97c5('0x12')](_0x97c5('0xb'),auth[_0x97c5('0xc')](),controller[_0x97c5('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5a10=['update','delete','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3d1e3b,_0x11ce69){var _0x2cb94f=function(_0x394cbd){while(--_0x394cbd){_0x3d1e3b['push'](_0x3d1e3b['shift']());}};_0x2cb94f(++_0x11ce69);}(_0x5a10,0x104));var _0x05a1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5a10[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x05a1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x05a1('0x1'));var router=express['Router']();var auth=require(_0x05a1('0x2'));var interaction=require(_0x05a1('0x3'));var config=require(_0x05a1('0x4'));var controller=require('./intSugarcrmField.controller');router[_0x05a1('0x5')]('/',auth[_0x05a1('0x6')](),controller[_0x05a1('0x7')]);router[_0x05a1('0x5')](_0x05a1('0x8'),auth[_0x05a1('0x6')](),controller[_0x05a1('0x9')]);router[_0x05a1('0xa')]('/',auth['isAuthenticated'](),controller[_0x05a1('0xb')]);router['put'](_0x05a1('0x8'),auth['isAuthenticated'](),controller[_0x05a1('0xc')]);router[_0x05a1('0xd')](_0x05a1('0x8'),auth[_0x05a1('0x6')](),controller[_0x05a1('0xe')]);module[_0x05a1('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index b4df94a..6f34eab 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 _0xd64b=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x5f347d,_0x26795e){var _0x1a69f6=function(_0x45f72b){while(--_0x45f72b){_0x5f347d['push'](_0x5f347d['shift']());}};_0x1a69f6(++_0x26795e);}(_0xd64b,0xc1));var _0xbd64=function(_0x5c42bd,_0x45b22b){_0x5c42bd=_0x5c42bd-0x0;var _0x5b3ea2=_0xd64b[_0x5c42bd];return _0x5b3ea2;};'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 +var _0x70e0=['BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','string','STRING','variable'];(function(_0x196a0d,_0x26fdcd){var _0x56d8ee=function(_0x4510fb){while(--_0x4510fb){_0x196a0d['push'](_0x196a0d['shift']());}};_0x56d8ee(++_0x26fdcd);}(_0x70e0,0x17b));var _0x070e=function(_0x54af71,_0x407e64){_0x54af71=_0x54af71-0x0;var _0x293c08=_0x70e0[_0x54af71];return _0x293c08;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'type':{'type':Sequelize[_0x070e('0x2')]('string','variable',_0x070e('0x3'),_0x070e('0x4')),'defaultValue':_0x070e('0x5')},'content':{'type':Sequelize[_0x070e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x070e('0x2')]('string',_0x070e('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x070e('0x6')]},'customField':{'type':Sequelize[_0x070e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 8da6f79..6704101 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 _0xa8ec=['papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','end','stack','name','send','index','SugarcrmField','rawAttributes','model','keys','query','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','findAll','rows','show','params','attributes','find','catch','create','update','body','html-pdf','eml-format','rimraf','zip-dir','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xa8ec,0x1ad));var _0xca8e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa8ec[_0x5f0089];return _0x193892;};'use strict';var pdf=require(_0xca8e('0x0'));var emlformat=require(_0xca8e('0x1'));var rimraf=require(_0xca8e('0x2'));var zipdir=require(_0xca8e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xca8e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca8e('0x5'));var path=require(_0xca8e('0x6'));var sox=require(_0xca8e('0x7'));var csv=require('to-csv');var ejs=require(_0xca8e('0x8'));var fs=require('fs');var _=require(_0xca8e('0x9'));var squel=require(_0xca8e('0xa'));var crypto=require(_0xca8e('0xb'));var jsforce=require(_0xca8e('0xc'));var deskjs=require(_0xca8e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xca8e('0xe'));var Papa=require(_0xca8e('0xf'));var authService=require(_0xca8e('0x10'));var hardwareService=require(_0xca8e('0x11'));var Redis=require('ioredis');var qs=require(_0xca8e('0x12'));var logger=require(_0xca8e('0x13'))('api');var utils=require(_0xca8e('0x14'));var config=require(_0xca8e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13cdcf,_0x5ed1e1){_0x5ed1e1=_0x5ed1e1||0xcc;return function(_0x20ec00){if(_0x20ec00){return _0x13cdcf[_0xca8e('0x16')](_0x5ed1e1);}return _0x13cdcf[_0xca8e('0x17')](_0x5ed1e1)['end']();};}function respondWithResult(_0x4696bb,_0x9230b1){_0x9230b1=_0x9230b1||0xc8;return function(_0x23a57f){if(_0x23a57f){return _0x4696bb[_0xca8e('0x17')](_0x9230b1)[_0xca8e('0x18')](_0x23a57f);}};}function respondWithFilteredResult(_0x1daa19,_0x1bb7ec){return function(_0x1b4d33){if(_0x1b4d33){var _0x24fa35=_0x1b4d33[_0xca8e('0x19')],_0x35c24e=_0x1bb7ec[_0xca8e('0x1a')],_0x3fbc10=_0x1bb7ec[_0xca8e('0x1a')]+_0x1bb7ec[_0xca8e('0x1b')],_0x7f3320;if(_0x3fbc10>=_0x24fa35){_0x3fbc10=_0x24fa35;_0x7f3320=0xc8;}else{_0x7f3320=0xce;}_0x1daa19['status'](_0x7f3320);return _0x1daa19[_0xca8e('0x1c')](_0xca8e('0x1d'),_0x35c24e+'-'+_0x3fbc10+'/'+_0x24fa35)['json'](_0x1b4d33);}return null;};}function patchUpdates(_0xc6ed7e){return function(_0xadbd){try{jsonpatch[_0xca8e('0x1e')](_0xadbd,_0xc6ed7e,!![]);}catch(_0x1f0ebc){return BPromise[_0xca8e('0x1f')](_0x1f0ebc);}return _0xadbd[_0xca8e('0x20')]();};}function saveUpdates(_0x3f1301,_0x3b3ab6){return function(_0x45df4a){if(_0x45df4a){return _0x45df4a['update'](_0x3f1301)['then'](function(_0x5ef70f){return _0x5ef70f;});}return null;};}function removeEntity(_0x1d1206,_0xdf2d94){return function(_0x1cbd6e){if(_0x1cbd6e){return _0x1cbd6e[_0xca8e('0x21')]()[_0xca8e('0x22')](function(){_0x1d1206[_0xca8e('0x17')](0xcc)[_0xca8e('0x23')]();});}};}function handleEntityNotFound(_0x2b3cb6,_0x265324){return function(_0x538718){if(!_0x538718){_0x2b3cb6[_0xca8e('0x16')](0x194);}return _0x538718;};}function handleError(_0x6acb20,_0xdf4971){_0xdf4971=_0xdf4971||0x1f4;return function(_0x435681){logger['error'](_0x435681[_0xca8e('0x24')]);if(_0x435681[_0xca8e('0x25')]){delete _0x435681[_0xca8e('0x25')];}_0x6acb20[_0xca8e('0x17')](_0xdf4971)[_0xca8e('0x26')](_0x435681);};}exports[_0xca8e('0x27')]=function(_0xf2daf2,_0x37cce5){var _0x4f11a9={},_0x529ada={},_0x4460cb={'count':0x0,'rows':[]};var _0x5add2a=db[_0xca8e('0x28')][_0xca8e('0x29')];_0x529ada[_0xca8e('0x2a')]=_[_0xca8e('0x2b')](_0x5add2a);_0x529ada[_0xca8e('0x2c')]=_[_0xca8e('0x2b')](_0xf2daf2[_0xca8e('0x2c')]);_0x529ada['filters']=_[_0xca8e('0x2d')](_0x529ada[_0xca8e('0x2a')],_0x529ada['query']);_0x4f11a9['attributes']=_[_0xca8e('0x2d')](_0x529ada['model'],qs[_0xca8e('0x2e')](_0xf2daf2[_0xca8e('0x2c')][_0xca8e('0x2e')]));_0x4f11a9['attributes']=_0x4f11a9['attributes'][_0xca8e('0x2f')]?_0x4f11a9['attributes']:_0x529ada[_0xca8e('0x2a')];if(!_0xf2daf2[_0xca8e('0x2c')][_0xca8e('0x30')](_0xca8e('0x31'))){_0x4f11a9[_0xca8e('0x1b')]=qs['limit'](_0xf2daf2['query'][_0xca8e('0x1b')]);_0x4f11a9[_0xca8e('0x1a')]=qs[_0xca8e('0x1a')](_0xf2daf2['query'][_0xca8e('0x1a')]);}_0x4f11a9[_0xca8e('0x32')]=qs[_0xca8e('0x33')](_0xf2daf2['query'][_0xca8e('0x33')]);_0x4f11a9[_0xca8e('0x34')]=qs[_0xca8e('0x35')](_[_0xca8e('0x36')](_0xf2daf2[_0xca8e('0x2c')],_0x529ada['filters']));if(_0xf2daf2[_0xca8e('0x2c')]['filter']){_0x4f11a9[_0xca8e('0x34')]=_['merge'](_0x4f11a9['where'],{'$or':_[_0xca8e('0x37')](_0x5add2a,function(_0x150881){if(_0x150881[_0xca8e('0x38')][_0xca8e('0x39')]!==_0xca8e('0x3a')){var _0x451dd7={};_0x451dd7[_0x150881[_0xca8e('0x3b')]]={'$like':'%'+_0xf2daf2[_0xca8e('0x2c')][_0xca8e('0x3c')]+'%'};return _0x451dd7;}})});}_0x4f11a9=_[_0xca8e('0x3d')]({},_0x4f11a9,_0xf2daf2[_0xca8e('0x3e')]);var _0x56884d={'where':_0x4f11a9[_0xca8e('0x34')]};return db['SugarcrmField'][_0xca8e('0x19')](_0x56884d)[_0xca8e('0x22')](function(_0x37abcc){_0x4460cb['count']=_0x37abcc;if(_0xf2daf2['query'][_0xca8e('0x3f')]){_0x4f11a9['include']=[{'all':!![]}];}return db[_0xca8e('0x28')][_0xca8e('0x40')](_0x4f11a9);})[_0xca8e('0x22')](function(_0x13a304){_0x4460cb[_0xca8e('0x41')]=_0x13a304;return _0x4460cb;})['then'](respondWithFilteredResult(_0x37cce5,_0x4f11a9))['catch'](handleError(_0x37cce5,null));};exports[_0xca8e('0x42')]=function(_0x2258d1,_0x5de053){var _0x4f3afc={'raw':!![],'where':{'id':_0x2258d1[_0xca8e('0x43')]['id']}},_0x478f3a={};_0x478f3a[_0xca8e('0x2a')]=_[_0xca8e('0x2b')](db[_0xca8e('0x28')][_0xca8e('0x29')]);_0x478f3a[_0xca8e('0x2c')]=_['keys'](_0x2258d1[_0xca8e('0x2c')]);_0x478f3a['filters']=_[_0xca8e('0x2d')](_0x478f3a['model'],_0x478f3a[_0xca8e('0x2c')]);_0x4f3afc[_0xca8e('0x44')]=_['intersection'](_0x478f3a[_0xca8e('0x2a')],qs[_0xca8e('0x2e')](_0x2258d1[_0xca8e('0x2c')][_0xca8e('0x2e')]));_0x4f3afc[_0xca8e('0x44')]=_0x4f3afc[_0xca8e('0x44')][_0xca8e('0x2f')]?_0x4f3afc[_0xca8e('0x44')]:_0x478f3a[_0xca8e('0x2a')];if(_0x2258d1[_0xca8e('0x2c')]['includeAll']){_0x4f3afc['include']=[{'all':!![]}];}_0x4f3afc=_['merge']({},_0x4f3afc,_0x2258d1['options']);return db['SugarcrmField'][_0xca8e('0x45')](_0x4f3afc)[_0xca8e('0x22')](handleEntityNotFound(_0x5de053,null))[_0xca8e('0x22')](respondWithResult(_0x5de053,null))[_0xca8e('0x46')](handleError(_0x5de053,null));};exports[_0xca8e('0x47')]=function(_0x404f8b,_0x55dd97){return db[_0xca8e('0x28')]['create'](_0x404f8b['body'],{})['then'](respondWithResult(_0x55dd97,0xc9))['catch'](handleError(_0x55dd97,null));};exports[_0xca8e('0x48')]=function(_0xf143fb,_0x319c4e){if(_0xf143fb['body']['id']){delete _0xf143fb[_0xca8e('0x49')]['id'];}return db[_0xca8e('0x28')][_0xca8e('0x45')]({'where':{'id':_0xf143fb['params']['id']}})[_0xca8e('0x22')](handleEntityNotFound(_0x319c4e,null))[_0xca8e('0x22')](saveUpdates(_0xf143fb['body'],null))[_0xca8e('0x22')](respondWithResult(_0x319c4e,null))[_0xca8e('0x46')](handleError(_0x319c4e,null));};exports['destroy']=function(_0x35195a,_0x34237c){return db[_0xca8e('0x28')][_0xca8e('0x45')]({'where':{'id':_0x35195a['params']['id']}})[_0xca8e('0x22')](handleEntityNotFound(_0x34237c,null))[_0xca8e('0x22')](removeEntity(_0x34237c,null))[_0xca8e('0x46')](handleError(_0x34237c,null));}; \ No newline at end of file +var _0xb59f=['jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','save','update','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','map','field','includeAll','include','findAll','rows','params','options','find','catch','create','body','html-pdf','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel'];(function(_0x1858e3,_0x528492){var _0x17aec2=function(_0x39c7cf){while(--_0x39c7cf){_0x1858e3['push'](_0x1858e3['shift']());}};_0x17aec2(++_0x528492);}(_0xb59f,0x149));var _0xfb59=function(_0x5331d6,_0x226b55){_0x5331d6=_0x5331d6-0x0;var _0x4fce9a=_0xb59f[_0x5331d6];return _0x4fce9a;};'use strict';var pdf=require(_0xfb59('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfb59('0x1'));var zipdir=require(_0xfb59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfb59('0x3'));var BPromise=require(_0xfb59('0x4'));var Mustache=require('mustache');var util=require(_0xfb59('0x5'));var path=require(_0xfb59('0x6'));var sox=require('sox');var csv=require(_0xfb59('0x7'));var ejs=require(_0xfb59('0x8'));var fs=require('fs');var _=require(_0xfb59('0x9'));var squel=require(_0xfb59('0xa'));var crypto=require('crypto');var jsforce=require(_0xfb59('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfb59('0x7'));var querystring=require(_0xfb59('0xc'));var Papa=require(_0xfb59('0xd'));var authService=require(_0xfb59('0xe'));var hardwareService=require(_0xfb59('0xf'));var Redis=require(_0xfb59('0x10'));var qs=require(_0xfb59('0x11'));var logger=require(_0xfb59('0x12'))('api');var utils=require(_0xfb59('0x13'));var config=require(_0xfb59('0x14'));var db=require(_0xfb59('0x15'))['db'];function respondWithStatusCode(_0x35dd03,_0xc626bf){_0xc626bf=_0xc626bf||0xcc;return function(_0x5a3225){if(_0x5a3225){return _0x35dd03[_0xfb59('0x16')](_0xc626bf);}return _0x35dd03[_0xfb59('0x17')](_0xc626bf)[_0xfb59('0x18')]();};}function respondWithResult(_0x4be342,_0x52cf70){_0x52cf70=_0x52cf70||0xc8;return function(_0x1c8aef){if(_0x1c8aef){return _0x4be342[_0xfb59('0x17')](_0x52cf70)[_0xfb59('0x19')](_0x1c8aef);}};}function respondWithFilteredResult(_0x519c76,_0x3f754d){return function(_0x90f24c){if(_0x90f24c){var _0x54e2bd=_0x90f24c[_0xfb59('0x1a')],_0x49d952=_0x3f754d[_0xfb59('0x1b')],_0x492073=_0x3f754d['offset']+_0x3f754d['limit'],_0x1b2fe9;if(_0x492073>=_0x54e2bd){_0x492073=_0x54e2bd;_0x1b2fe9=0xc8;}else{_0x1b2fe9=0xce;}_0x519c76[_0xfb59('0x17')](_0x1b2fe9);return _0x519c76['set']('Content-Range',_0x49d952+'-'+_0x492073+'/'+_0x54e2bd)[_0xfb59('0x19')](_0x90f24c);}return null;};}function patchUpdates(_0x525484){return function(_0x84080a){try{jsonpatch[_0xfb59('0x1c')](_0x84080a,_0x525484,!![]);}catch(_0x423d9b){return BPromise['reject'](_0x423d9b);}return _0x84080a[_0xfb59('0x1d')]();};}function saveUpdates(_0xf2e102,_0x3f6f53){return function(_0xabec74){if(_0xabec74){return _0xabec74[_0xfb59('0x1e')](_0xf2e102)[_0xfb59('0x1f')](function(_0xd86ab2){return _0xd86ab2;});}return null;};}function removeEntity(_0x2c06b4,_0x32cd36){return function(_0x2a97af){if(_0x2a97af){return _0x2a97af[_0xfb59('0x20')]()[_0xfb59('0x1f')](function(){_0x2c06b4[_0xfb59('0x17')](0xcc)[_0xfb59('0x18')]();});}};}function handleEntityNotFound(_0x2a6e1c,_0x111b7f){return function(_0x527b59){if(!_0x527b59){_0x2a6e1c[_0xfb59('0x16')](0x194);}return _0x527b59;};}function handleError(_0xafa3e9,_0x1f0279){_0x1f0279=_0x1f0279||0x1f4;return function(_0x5dd2aa){logger[_0xfb59('0x21')](_0x5dd2aa[_0xfb59('0x22')]);if(_0x5dd2aa[_0xfb59('0x23')]){delete _0x5dd2aa[_0xfb59('0x23')];}_0xafa3e9[_0xfb59('0x17')](_0x1f0279)[_0xfb59('0x24')](_0x5dd2aa);};}exports[_0xfb59('0x25')]=function(_0x528d7c,_0x23c045){var _0xc159ec={},_0x2e66e1={},_0x3b276f={'count':0x0,'rows':[]};var _0x483c39=db[_0xfb59('0x26')][_0xfb59('0x27')];_0x2e66e1[_0xfb59('0x28')]=_['keys'](_0x483c39);_0x2e66e1[_0xfb59('0x29')]=_[_0xfb59('0x2a')](_0x528d7c[_0xfb59('0x29')]);_0x2e66e1['filters']=_[_0xfb59('0x2b')](_0x2e66e1[_0xfb59('0x28')],_0x2e66e1[_0xfb59('0x29')]);_0xc159ec[_0xfb59('0x2c')]=_['intersection'](_0x2e66e1[_0xfb59('0x28')],qs[_0xfb59('0x2d')](_0x528d7c[_0xfb59('0x29')]['fields']));_0xc159ec[_0xfb59('0x2c')]=_0xc159ec[_0xfb59('0x2c')]['length']?_0xc159ec['attributes']:_0x2e66e1[_0xfb59('0x28')];if(!_0x528d7c[_0xfb59('0x29')][_0xfb59('0x2e')](_0xfb59('0x2f'))){_0xc159ec['limit']=qs[_0xfb59('0x30')](_0x528d7c[_0xfb59('0x29')][_0xfb59('0x30')]);_0xc159ec[_0xfb59('0x1b')]=qs[_0xfb59('0x1b')](_0x528d7c[_0xfb59('0x29')][_0xfb59('0x1b')]);}_0xc159ec[_0xfb59('0x31')]=qs[_0xfb59('0x32')](_0x528d7c['query'][_0xfb59('0x32')]);_0xc159ec[_0xfb59('0x33')]=qs['filters'](_[_0xfb59('0x34')](_0x528d7c[_0xfb59('0x29')],_0x2e66e1[_0xfb59('0x35')]));if(_0x528d7c[_0xfb59('0x29')][_0xfb59('0x36')]){_0xc159ec[_0xfb59('0x33')]=_[_0xfb59('0x37')](_0xc159ec[_0xfb59('0x33')],{'$or':_[_0xfb59('0x38')](_0x483c39,function(_0x4a63d5){if(_0x4a63d5['type']['key']!=='VIRTUAL'){var _0x5cd1b2={};_0x5cd1b2[_0x4a63d5[_0xfb59('0x39')]]={'$like':'%'+_0x528d7c[_0xfb59('0x29')]['filter']+'%'};return _0x5cd1b2;}})});}_0xc159ec=_[_0xfb59('0x37')]({},_0xc159ec,_0x528d7c['options']);var _0x521cd3={'where':_0xc159ec[_0xfb59('0x33')]};return db[_0xfb59('0x26')][_0xfb59('0x1a')](_0x521cd3)['then'](function(_0x393030){_0x3b276f['count']=_0x393030;if(_0x528d7c['query'][_0xfb59('0x3a')]){_0xc159ec[_0xfb59('0x3b')]=[{'all':!![]}];}return db[_0xfb59('0x26')][_0xfb59('0x3c')](_0xc159ec);})['then'](function(_0x548cb6){_0x3b276f[_0xfb59('0x3d')]=_0x548cb6;return _0x3b276f;})[_0xfb59('0x1f')](respondWithFilteredResult(_0x23c045,_0xc159ec))['catch'](handleError(_0x23c045,null));};exports['show']=function(_0x4f5f89,_0x58f96e){var _0x414531={'raw':!![],'where':{'id':_0x4f5f89[_0xfb59('0x3e')]['id']}},_0x192190={};_0x192190['model']=_[_0xfb59('0x2a')](db[_0xfb59('0x26')][_0xfb59('0x27')]);_0x192190[_0xfb59('0x29')]=_[_0xfb59('0x2a')](_0x4f5f89[_0xfb59('0x29')]);_0x192190['filters']=_[_0xfb59('0x2b')](_0x192190[_0xfb59('0x28')],_0x192190[_0xfb59('0x29')]);_0x414531[_0xfb59('0x2c')]=_[_0xfb59('0x2b')](_0x192190[_0xfb59('0x28')],qs[_0xfb59('0x2d')](_0x4f5f89['query']['fields']));_0x414531[_0xfb59('0x2c')]=_0x414531['attributes']['length']?_0x414531[_0xfb59('0x2c')]:_0x192190['model'];if(_0x4f5f89['query'][_0xfb59('0x3a')]){_0x414531[_0xfb59('0x3b')]=[{'all':!![]}];}_0x414531=_['merge']({},_0x414531,_0x4f5f89[_0xfb59('0x3f')]);return db[_0xfb59('0x26')][_0xfb59('0x40')](_0x414531)['then'](handleEntityNotFound(_0x58f96e,null))[_0xfb59('0x1f')](respondWithResult(_0x58f96e,null))[_0xfb59('0x41')](handleError(_0x58f96e,null));};exports[_0xfb59('0x42')]=function(_0x36f39b,_0x3e1483){return db[_0xfb59('0x26')][_0xfb59('0x42')](_0x36f39b[_0xfb59('0x43')],{})[_0xfb59('0x1f')](respondWithResult(_0x3e1483,0xc9))[_0xfb59('0x41')](handleError(_0x3e1483,null));};exports[_0xfb59('0x1e')]=function(_0x36f637,_0x501b53){if(_0x36f637['body']['id']){delete _0x36f637[_0xfb59('0x43')]['id'];}return db[_0xfb59('0x26')][_0xfb59('0x40')]({'where':{'id':_0x36f637[_0xfb59('0x3e')]['id']}})[_0xfb59('0x1f')](handleEntityNotFound(_0x501b53,null))['then'](saveUpdates(_0x36f637[_0xfb59('0x43')],null))[_0xfb59('0x1f')](respondWithResult(_0x501b53,null))[_0xfb59('0x41')](handleError(_0x501b53,null));};exports[_0xfb59('0x20')]=function(_0x55ed48,_0x4e2b48){return db[_0xfb59('0x26')][_0xfb59('0x40')]({'where':{'id':_0x55ed48['params']['id']}})['then'](handleEntityNotFound(_0x4e2b48,null))['then'](removeEntity(_0x4e2b48,null))['catch'](handleError(_0x4e2b48,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index c6636f6..5db8f8d 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 _0x9045=['lodash','util','api','moment','bluebird','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x9045,0x142));var _0x5904=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x9045[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x5904('0x0'));var util=require(_0x5904('0x1'));var logger=require('../../config/logger')(_0x5904('0x2'));var moment=require(_0x5904('0x3'));var BPromise=require(_0x5904('0x4'));var rp=require('request-promise');var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x23e750,_0x241ea4){return _0x23e750['define']('SugarcrmField',attributes,{'tableName':_0x5904('0x5'),'paranoid':![],'indexes':[{'name':_0x5904('0x6'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbbfd=['idField','FieldId','util','../../config/logger','api','bluebird','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x1261ac,_0x357a74){var _0x363168=function(_0x45c05c){while(--_0x45c05c){_0x1261ac['push'](_0x1261ac['shift']());}};_0x363168(++_0x357a74);}(_0xbbfd,0x86));var _0xdbbf=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xbbfd[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require(_0xdbbf('0x0'));var logger=require(_0xdbbf('0x1'))(_0xdbbf('0x2'));var moment=require('moment');var BPromise=require(_0xdbbf('0x3'));var rp=require('request-promise');var attributes=require(_0xdbbf('0x4'));module[_0xdbbf('0x5')]=function(_0x45046c,_0x136c8b){return _0x45046c[_0xdbbf('0x6')](_0xdbbf('0x7'),attributes,{'tableName':_0xdbbf('0x8'),'paranoid':![],'indexes':[{'name':_0xdbbf('0x9'),'fields':[_0xdbbf('0xa'),_0xdbbf('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index e76e2c6..0a5046b 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 _0xc064=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0x298c7e,_0x570c94){var _0x3d9c67=function(_0x27df29){while(--_0x27df29){_0x298c7e['push'](_0x298c7e['shift']());}};_0x3d9c67(++_0x570c94);}(_0xc064,0xb7));var _0x4c06=function(_0x15ec65,_0x2ad2ed){_0x15ec65=_0x15ec65-0x0;var _0x4fc398=_0xc064[_0x15ec65];return _0x4fc398;};'use strict';var _=require(_0x4c06('0x0'));var util=require(_0x4c06('0x1'));var moment=require('moment');var BPromise=require(_0x4c06('0x2'));var rs=require(_0x4c06('0x3'));var fs=require('fs');var Redis=require(_0x4c06('0x4'));var db=require(_0x4c06('0x5'))['db'];var utils=require(_0x4c06('0x6'));var logger=require(_0x4c06('0x7'))(_0x4c06('0x8'));var config=require(_0x4c06('0x9'));var jayson=require(_0x4c06('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2cb9b4,_0x2612c6,_0x5733f0){return new BPromise(function(_0x954f11,_0x20e04b){return client['request'](_0x2cb9b4,_0x5733f0)[_0x4c06('0xb')](function(_0x41769c){logger[_0x4c06('0xc')](_0x4c06('0xd'),_0x2612c6,_0x4c06('0xe'));logger[_0x4c06('0xf')](_0x4c06('0x10'),_0x2612c6,_0x4c06('0xe'),JSON['stringify'](_0x41769c));if(_0x41769c[_0x4c06('0x11')]){if(_0x41769c['error'][_0x4c06('0x12')]===0x1f4){logger['error'](_0x4c06('0xd'),_0x2612c6,_0x41769c[_0x4c06('0x11')]['message']);return _0x20e04b(_0x41769c[_0x4c06('0x11')][_0x4c06('0x13')]);}logger[_0x4c06('0x11')](_0x4c06('0xd'),_0x2612c6,_0x41769c[_0x4c06('0x11')][_0x4c06('0x13')]);return _0x954f11(_0x41769c['error'][_0x4c06('0x13')]);}else{logger['info'](_0x4c06('0xd'),_0x2612c6,_0x4c06('0xe'));_0x954f11(_0x41769c[_0x4c06('0x14')][_0x4c06('0x13')]);}})[_0x4c06('0x15')](function(_0x37e458){logger[_0x4c06('0x11')](_0x4c06('0xd'),_0x2612c6,_0x37e458);_0x20e04b(_0x37e458);});});} \ No newline at end of file +var _0x149d=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x325b13,_0x1f2901){var _0x582d53=function(_0x108924){while(--_0x108924){_0x325b13['push'](_0x325b13['shift']());}};_0x582d53(++_0x1f2901);}(_0x149d,0xad));var _0xd149=function(_0x2e11b6,_0x1042b5){_0x2e11b6=_0x2e11b6-0x0;var _0x119f0b=_0x149d[_0x2e11b6];return _0x119f0b;};'use strict';var _=require(_0xd149('0x0'));var util=require(_0xd149('0x1'));var moment=require(_0xd149('0x2'));var BPromise=require('bluebird');var rs=require(_0xd149('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd149('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd149('0x5'))('rpc');var config=require(_0xd149('0x6'));var jayson=require(_0xd149('0x7'));var client=jayson[_0xd149('0x8')][_0xd149('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x261e35,_0x153bb8,_0x5150b0){return new BPromise(function(_0x2c9998,_0x6fbe05){return client[_0xd149('0xa')](_0x261e35,_0x5150b0)['then'](function(_0x31d2e9){logger[_0xd149('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x153bb8,_0xd149('0xc'));logger[_0xd149('0xd')](_0xd149('0xe'),_0x153bb8,_0xd149('0xc'),JSON[_0xd149('0xf')](_0x31d2e9));if(_0x31d2e9[_0xd149('0x10')]){if(_0x31d2e9[_0xd149('0x10')][_0xd149('0x11')]===0x1f4){logger[_0xd149('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x153bb8,_0x31d2e9[_0xd149('0x10')]['message']);return _0x6fbe05(_0x31d2e9['error'][_0xd149('0x12')]);}logger[_0xd149('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x153bb8,_0x31d2e9[_0xd149('0x10')][_0xd149('0x12')]);return _0x2c9998(_0x31d2e9['error'][_0xd149('0x12')]);}else{logger['info'](_0xd149('0x13'),_0x153bb8,_0xd149('0xc'));_0x2c9998(_0x31d2e9[_0xd149('0x14')][_0xd149('0x12')]);}})[_0xd149('0x15')](function(_0x591a74){logger[_0xd149('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x153bb8,_0x591a74);_0x6fbe05(_0x591a74);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 893e7b2..302de7d 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 _0xd5ed=['addConfiguration','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post'];(function(_0x430b10,_0x45a31e){var _0x412122=function(_0x4f3da1){while(--_0x4f3da1){_0x430b10['push'](_0x430b10['shift']());}};_0x412122(++_0x45a31e);}(_0xd5ed,0x1a3));var _0xdd5e=function(_0x34cc33,_0x3c6503){_0x34cc33=_0x34cc33-0x0;var _0x4ccf27=_0xd5ed[_0x34cc33];return _0x4ccf27;};'use strict';var multer=require(_0xdd5e('0x0'));var util=require('util');var path=require(_0xdd5e('0x1'));var timeout=require(_0xdd5e('0x2'));var express=require(_0xdd5e('0x3'));var router=express[_0xdd5e('0x4')]();var auth=require(_0xdd5e('0x5'));var interaction=require(_0xdd5e('0x6'));var config=require(_0xdd5e('0x7'));var controller=require('./intVtigerAccount.controller');router[_0xdd5e('0x8')]('/',auth[_0xdd5e('0x9')](),controller[_0xdd5e('0xa')]);router[_0xdd5e('0x8')](_0xdd5e('0xb'),auth[_0xdd5e('0x9')](),controller[_0xdd5e('0xc')]);router[_0xdd5e('0x8')](_0xdd5e('0xd'),auth['isAuthenticated'](),controller[_0xdd5e('0xe')]);router[_0xdd5e('0x8')](_0xdd5e('0xf'),auth[_0xdd5e('0x9')](),controller['getFields']);router['post']('/',auth[_0xdd5e('0x9')](),controller[_0xdd5e('0x10')]);router[_0xdd5e('0x11')](_0xdd5e('0xd'),auth['isAuthenticated'](),controller[_0xdd5e('0x12')]);router[_0xdd5e('0x13')](_0xdd5e('0xb'),auth[_0xdd5e('0x9')](),controller[_0xdd5e('0x14')]);router[_0xdd5e('0x15')](_0xdd5e('0xb'),auth[_0xdd5e('0x9')](),controller['destroy']);module[_0xdd5e('0x16')]=router; \ No newline at end of file +var _0xc4ab=['connect-timeout','express','Router','../../components/auth/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4ab,0x129));var _0xbc4a=function(_0x59d583,_0x2b33b2){_0x59d583=_0x59d583-0x0;var _0x4d7ae2=_0xc4ab[_0x59d583];return _0x4d7ae2;};'use strict';var multer=require(_0xbc4a('0x0'));var util=require(_0xbc4a('0x1'));var path=require(_0xbc4a('0x2'));var timeout=require(_0xbc4a('0x3'));var express=require(_0xbc4a('0x4'));var router=express[_0xbc4a('0x5')]();var auth=require(_0xbc4a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbc4a('0x7'));router[_0xbc4a('0x8')]('/',auth[_0xbc4a('0x9')](),controller[_0xbc4a('0xa')]);router[_0xbc4a('0x8')](_0xbc4a('0xb'),auth['isAuthenticated'](),controller[_0xbc4a('0xc')]);router[_0xbc4a('0x8')]('/:id/configurations',auth[_0xbc4a('0x9')](),controller[_0xbc4a('0xd')]);router['get'](_0xbc4a('0xe'),auth[_0xbc4a('0x9')](),controller[_0xbc4a('0xf')]);router[_0xbc4a('0x10')]('/',auth[_0xbc4a('0x9')](),controller[_0xbc4a('0x11')]);router['post'](_0xbc4a('0x12'),auth['isAuthenticated'](),controller[_0xbc4a('0x13')]);router[_0xbc4a('0x14')](_0xbc4a('0xb'),auth[_0xbc4a('0x9')](),controller[_0xbc4a('0x15')]);router[_0xbc4a('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xbc4a('0x17')]);module[_0xbc4a('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e728ab2..e21d081 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 _0x84d9=['sequelize','exports','STRING','HelpDesk'];(function(_0x315b67,_0x4fca93){var _0x6ed6=function(_0x1f3b63){while(--_0x1f3b63){_0x315b67['push'](_0x315b67['shift']());}};_0x6ed6(++_0x4fca93);}(_0x84d9,0x1e4));var _0x984d=function(_0x2a1aab,_0x5ef2f8){_0x2a1aab=_0x2a1aab-0x0;var _0x506e57=_0x84d9[_0x2a1aab];return _0x506e57;};'use strict';var Sequelize=require(_0x984d('0x0'));module[_0x984d('0x1')]={'name':{'type':Sequelize[_0x984d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x984d('0x2')]},'username':{'type':Sequelize[_0x984d('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x984d('0x2')],'allowNull':![],'defaultValue':_0x984d('0x3')},'remoteUri':{'type':Sequelize[_0x984d('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x984d('0x2')]},'accessKey':{'type':Sequelize[_0x984d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe8e8=['sequelize','exports','STRING','HelpDesk'];(function(_0x4662e3,_0x3c9e27){var _0x3ab0e7=function(_0x5f1d33){while(--_0x5f1d33){_0x4662e3['push'](_0x4662e3['shift']());}};_0x3ab0e7(++_0x3c9e27);}(_0xe8e8,0x144));var _0x8e8e=function(_0x56a96c,_0x17a738){_0x56a96c=_0x56a96c-0x0;var _0x35c3e3=_0xe8e8[_0x56a96c];return _0x35c3e3;};'use strict';var Sequelize=require(_0x8e8e('0x0'));module[_0x8e8e('0x1')]={'name':{'type':Sequelize[_0x8e8e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8e8e('0x2')]},'username':{'type':Sequelize[_0x8e8e('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8e8e('0x2')],'allowNull':![],'defaultValue':_0x8e8e('0x3')},'remoteUri':{'type':Sequelize[_0x8e8e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8e8e('0x2')]},'accessKey':{'type':Sequelize[_0x8e8e('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 8383317..dfb6788 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 _0xcf66=['ioredis','../../config/logger','api','../../config/utils','../../config/environment','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','set','Content-Range','save','update','destroy','sendStatus','stack','name','send','index','VtigerAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','type','key','VIRTUAL','field','include','findAll','rows','show','params','includeAll','find','create','body','getConfigurations','findOne','map','options','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','format','%s/webservice.php','getchallenge','success','POST','token','GET','describe','sessionName','autogenerated','reference','owner','includes','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0xcf66,0x71));var _0x6cf6=function(_0x19442d,_0x5d8f7f){_0x19442d=_0x19442d-0x0;var _0x5a4ba0=_0xcf66[_0x19442d];return _0x5a4ba0;};'use strict';var pdf=require(_0x6cf6('0x0'));var emlformat=require(_0x6cf6('0x1'));var rimraf=require(_0x6cf6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6cf6('0x3'));var rp=require(_0x6cf6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6cf6('0x5'));var util=require(_0x6cf6('0x6'));var path=require('path');var sox=require(_0x6cf6('0x7'));var csv=require(_0x6cf6('0x8'));var ejs=require(_0x6cf6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x8'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6cf6('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x6cf6('0x10'))(_0x6cf6('0x11'));var utils=require(_0x6cf6('0x12'));var config=require(_0x6cf6('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x6cf6('0x14')][_0x6cf6('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x372d12,_0x39e8c3,_0x3e62a7,_0x114c2c){return new BPromise(function(_0x57909f,_0x32fe64){var _0x494ece=_0x114c2c||client;return _0x494ece[_0x6cf6('0x16')](_0x372d12,_0x3e62a7)[_0x6cf6('0x17')](function(_0x4b073f){logger[_0x6cf6('0x18')](_0x6cf6('0x19'),_0x39e8c3,_0x6cf6('0x1a'));logger[_0x6cf6('0x1b')](_0x6cf6('0x1c'),_0x39e8c3,_0x6cf6('0x1a'),JSON[_0x6cf6('0x1d')](_0x4b073f));if(_0x4b073f[_0x6cf6('0x1e')]){if(_0x4b073f[_0x6cf6('0x1e')][_0x6cf6('0x1f')]===0x1f4){logger['error'](_0x6cf6('0x19'),_0x39e8c3,_0x4b073f[_0x6cf6('0x1e')][_0x6cf6('0x20')]);return _0x32fe64(_0x4b073f['error'][_0x6cf6('0x20')]);}logger[_0x6cf6('0x1e')](_0x6cf6('0x19'),_0x39e8c3,_0x4b073f[_0x6cf6('0x1e')][_0x6cf6('0x20')]);return _0x57909f(_0x4b073f[_0x6cf6('0x1e')][_0x6cf6('0x20')]);}else{logger['info'](_0x6cf6('0x19'),_0x39e8c3,_0x6cf6('0x1a'));_0x57909f(_0x4b073f[_0x6cf6('0x21')][_0x6cf6('0x20')]);}})[_0x6cf6('0x22')](function(_0x470ea4){logger[_0x6cf6('0x1e')](_0x6cf6('0x19'),_0x39e8c3,_0x470ea4);_0x32fe64(_0x470ea4);});});}function respondWithStatusCode(_0x5b2767,_0x5b30e0){_0x5b30e0=_0x5b30e0||0xcc;return function(_0x276225){if(_0x276225){return _0x5b2767['sendStatus'](_0x5b30e0);}return _0x5b2767[_0x6cf6('0x23')](_0x5b30e0)[_0x6cf6('0x24')]();};}function respondWithResult(_0x14ae3e,_0x448f26){_0x448f26=_0x448f26||0xc8;return function(_0x3f9871){if(_0x3f9871){return _0x14ae3e[_0x6cf6('0x23')](_0x448f26)[_0x6cf6('0x25')](_0x3f9871);}};}function respondWithFilteredResult(_0x4e0e85,_0x2779b7){return function(_0xc7b489){if(_0xc7b489){var _0x3eaa31=_0xc7b489[_0x6cf6('0x26')],_0x558405=_0x2779b7[_0x6cf6('0x27')],_0xf4eec5=_0x2779b7['offset']+_0x2779b7['limit'],_0x2e56ca;if(_0xf4eec5>=_0x3eaa31){_0xf4eec5=_0x3eaa31;_0x2e56ca=0xc8;}else{_0x2e56ca=0xce;}_0x4e0e85[_0x6cf6('0x23')](_0x2e56ca);return _0x4e0e85[_0x6cf6('0x28')](_0x6cf6('0x29'),_0x558405+'-'+_0xf4eec5+'/'+_0x3eaa31)[_0x6cf6('0x25')](_0xc7b489);}return null;};}function patchUpdates(_0x5ccc8f){return function(_0x2afc06){try{jsonpatch['apply'](_0x2afc06,_0x5ccc8f,!![]);}catch(_0x4ceeb9){return BPromise['reject'](_0x4ceeb9);}return _0x2afc06[_0x6cf6('0x2a')]();};}function saveUpdates(_0x65433,_0x33d308){return function(_0x42f488){if(_0x42f488){return _0x42f488[_0x6cf6('0x2b')](_0x65433)['then'](function(_0x348d9e){return _0x348d9e;});}return null;};}function removeEntity(_0x2ae422,_0x356340){return function(_0x535b28){if(_0x535b28){return _0x535b28[_0x6cf6('0x2c')]()[_0x6cf6('0x17')](function(){_0x2ae422[_0x6cf6('0x23')](0xcc)[_0x6cf6('0x24')]();});}};}function handleEntityNotFound(_0x197c7e,_0x1339a2){return function(_0x11f66d){if(!_0x11f66d){_0x197c7e[_0x6cf6('0x2d')](0x194);}return _0x11f66d;};}function handleError(_0x22f23b,_0x3d0b22){_0x3d0b22=_0x3d0b22||0x1f4;return function(_0x16d34f){logger[_0x6cf6('0x1e')](_0x16d34f[_0x6cf6('0x2e')]);if(_0x16d34f[_0x6cf6('0x2f')]){delete _0x16d34f[_0x6cf6('0x2f')];}_0x22f23b[_0x6cf6('0x23')](_0x3d0b22)[_0x6cf6('0x30')](_0x16d34f);};}exports[_0x6cf6('0x31')]=function(_0x5cc6cd,_0xa18a04){var _0x3314a3={},_0x19e94d={},_0xa1f482={'count':0x0,'rows':[]};var _0x10f3c4=db[_0x6cf6('0x32')][_0x6cf6('0x33')];_0x19e94d[_0x6cf6('0x34')]=_[_0x6cf6('0x35')](_0x10f3c4);_0x19e94d[_0x6cf6('0x36')]=_[_0x6cf6('0x35')](_0x5cc6cd['query']);_0x19e94d[_0x6cf6('0x37')]=_[_0x6cf6('0x38')](_0x19e94d[_0x6cf6('0x34')],_0x19e94d[_0x6cf6('0x36')]);_0x3314a3[_0x6cf6('0x39')]=_[_0x6cf6('0x38')](_0x19e94d[_0x6cf6('0x34')],qs[_0x6cf6('0x3a')](_0x5cc6cd[_0x6cf6('0x36')]['fields']));_0x3314a3[_0x6cf6('0x39')]=_0x3314a3[_0x6cf6('0x39')][_0x6cf6('0x3b')]?_0x3314a3[_0x6cf6('0x39')]:_0x19e94d[_0x6cf6('0x34')];if(!_0x5cc6cd[_0x6cf6('0x36')][_0x6cf6('0x3c')](_0x6cf6('0x3d'))){_0x3314a3[_0x6cf6('0x3e')]=qs['limit'](_0x5cc6cd[_0x6cf6('0x36')]['limit']);_0x3314a3[_0x6cf6('0x27')]=qs[_0x6cf6('0x27')](_0x5cc6cd[_0x6cf6('0x36')][_0x6cf6('0x27')]);}_0x3314a3[_0x6cf6('0x3f')]=qs[_0x6cf6('0x40')](_0x5cc6cd[_0x6cf6('0x36')][_0x6cf6('0x40')]);_0x3314a3['where']=qs[_0x6cf6('0x37')](_[_0x6cf6('0x41')](_0x5cc6cd['query'],_0x19e94d[_0x6cf6('0x37')]));if(_0x5cc6cd[_0x6cf6('0x36')][_0x6cf6('0x42')]){_0x3314a3['where']=_[_0x6cf6('0x43')](_0x3314a3[_0x6cf6('0x44')],{'$or':_['map'](_0x10f3c4,function(_0x3f1084){if(_0x3f1084[_0x6cf6('0x45')][_0x6cf6('0x46')]!==_0x6cf6('0x47')){var _0x41195e={};_0x41195e[_0x3f1084[_0x6cf6('0x48')]]={'$like':'%'+_0x5cc6cd[_0x6cf6('0x36')]['filter']+'%'};return _0x41195e;}})});}_0x3314a3=_[_0x6cf6('0x43')]({},_0x3314a3,_0x5cc6cd['options']);var _0x114a4a={'where':_0x3314a3[_0x6cf6('0x44')]};return db['VtigerAccount'][_0x6cf6('0x26')](_0x114a4a)[_0x6cf6('0x17')](function(_0x235f37){_0xa1f482[_0x6cf6('0x26')]=_0x235f37;if(_0x5cc6cd[_0x6cf6('0x36')]['includeAll']){_0x3314a3[_0x6cf6('0x49')]=[{'all':!![]}];}return db[_0x6cf6('0x32')][_0x6cf6('0x4a')](_0x3314a3);})['then'](function(_0x10168f){_0xa1f482[_0x6cf6('0x4b')]=_0x10168f;return _0xa1f482;})[_0x6cf6('0x17')](respondWithFilteredResult(_0xa18a04,_0x3314a3))['catch'](handleError(_0xa18a04,null));};exports[_0x6cf6('0x4c')]=function(_0x5c08b3,_0x586e8d){var _0x31a7c9={'raw':![],'where':{'id':_0x5c08b3[_0x6cf6('0x4d')]['id']}},_0x37edba={};_0x37edba[_0x6cf6('0x34')]=_[_0x6cf6('0x35')](db[_0x6cf6('0x32')][_0x6cf6('0x33')]);_0x37edba[_0x6cf6('0x36')]=_[_0x6cf6('0x35')](_0x5c08b3[_0x6cf6('0x36')]);_0x37edba[_0x6cf6('0x37')]=_[_0x6cf6('0x38')](_0x37edba[_0x6cf6('0x34')],_0x37edba['query']);_0x31a7c9[_0x6cf6('0x39')]=_[_0x6cf6('0x38')](_0x37edba['model'],qs['fields'](_0x5c08b3[_0x6cf6('0x36')][_0x6cf6('0x3a')]));_0x31a7c9[_0x6cf6('0x39')]=_0x31a7c9[_0x6cf6('0x39')][_0x6cf6('0x3b')]?_0x31a7c9[_0x6cf6('0x39')]:_0x37edba['model'];if(_0x5c08b3[_0x6cf6('0x36')][_0x6cf6('0x4e')]){_0x31a7c9[_0x6cf6('0x49')]=[{'all':!![]}];}_0x31a7c9=_['merge']({},_0x31a7c9,_0x5c08b3['options']);return db[_0x6cf6('0x32')][_0x6cf6('0x4f')](_0x31a7c9)[_0x6cf6('0x17')](handleEntityNotFound(_0x586e8d,null))[_0x6cf6('0x17')](respondWithResult(_0x586e8d,null))[_0x6cf6('0x22')](handleError(_0x586e8d,null));};exports[_0x6cf6('0x50')]=function(_0x2cb470,_0x3e8aee){return db[_0x6cf6('0x32')][_0x6cf6('0x50')](_0x2cb470['body'],{})[_0x6cf6('0x17')](respondWithResult(_0x3e8aee,0xc9))[_0x6cf6('0x22')](handleError(_0x3e8aee,null));};exports[_0x6cf6('0x2b')]=function(_0x131ea6,_0x2fdf83){if(_0x131ea6[_0x6cf6('0x51')]['id']){delete _0x131ea6[_0x6cf6('0x51')]['id'];}return db[_0x6cf6('0x32')][_0x6cf6('0x4f')]({'where':{'id':_0x131ea6[_0x6cf6('0x4d')]['id']}})[_0x6cf6('0x17')](handleEntityNotFound(_0x2fdf83,null))['then'](saveUpdates(_0x131ea6[_0x6cf6('0x51')],null))['then'](respondWithResult(_0x2fdf83,null))[_0x6cf6('0x22')](handleError(_0x2fdf83,null));};exports[_0x6cf6('0x2c')]=function(_0x498539,_0x1fa5b0){return db[_0x6cf6('0x32')][_0x6cf6('0x4f')]({'where':{'id':_0x498539[_0x6cf6('0x4d')]['id']}})[_0x6cf6('0x17')](handleEntityNotFound(_0x1fa5b0,null))[_0x6cf6('0x17')](removeEntity(_0x1fa5b0,null))['catch'](handleError(_0x1fa5b0,null));};exports[_0x6cf6('0x52')]=function(_0x167356,_0x160c7f,_0x511655){var _0x4f1de3={};var _0x2c8736={};var _0x140ed2;var _0x5daf8e;return db[_0x6cf6('0x32')][_0x6cf6('0x53')]({'where':{'id':_0x167356[_0x6cf6('0x4d')]['id']}})[_0x6cf6('0x17')](handleEntityNotFound(_0x160c7f,null))[_0x6cf6('0x17')](function(_0x58ec7e){if(_0x58ec7e){_0x140ed2=_0x58ec7e;_0x2c8736[_0x6cf6('0x34')]=_[_0x6cf6('0x35')](db['VtigerConfiguration']['rawAttributes']);_0x2c8736[_0x6cf6('0x36')]=_[_0x6cf6('0x35')](_0x167356[_0x6cf6('0x36')]);_0x2c8736[_0x6cf6('0x37')]=_[_0x6cf6('0x38')](_0x2c8736['model'],_0x2c8736['query']);_0x4f1de3[_0x6cf6('0x39')]=_[_0x6cf6('0x38')](_0x2c8736[_0x6cf6('0x34')],qs[_0x6cf6('0x3a')](_0x167356[_0x6cf6('0x36')]['fields']));_0x4f1de3['attributes']=_0x4f1de3['attributes'][_0x6cf6('0x3b')]?_0x4f1de3[_0x6cf6('0x39')]:_0x2c8736[_0x6cf6('0x34')];_0x4f1de3[_0x6cf6('0x3f')]=qs['sort'](_0x167356[_0x6cf6('0x36')]['sort']);_0x4f1de3[_0x6cf6('0x44')]=qs['filters'](_[_0x6cf6('0x41')](_0x167356[_0x6cf6('0x36')],_0x2c8736[_0x6cf6('0x37')]));if(_0x167356[_0x6cf6('0x36')][_0x6cf6('0x42')]){_0x4f1de3['where']=_[_0x6cf6('0x43')](_0x4f1de3['where'],{'$or':_[_0x6cf6('0x54')](_0x4f1de3['attributes'],function(_0x4363f7){var _0x549c0b={};_0x549c0b[_0x4363f7]={'$like':'%'+_0x167356[_0x6cf6('0x36')][_0x6cf6('0x42')]+'%'};return _0x549c0b;})});}_0x4f1de3=_['merge']({},_0x4f1de3,_0x167356[_0x6cf6('0x55')]);return _0x140ed2[_0x6cf6('0x52')](_0x4f1de3);}})[_0x6cf6('0x17')](function(_0x24c701){if(_0x24c701){_0x5daf8e=_0x24c701[_0x6cf6('0x3b')];if(!_0x167356[_0x6cf6('0x36')][_0x6cf6('0x3c')]('nolimit')){_0x4f1de3['limit']=qs[_0x6cf6('0x3e')](_0x167356[_0x6cf6('0x36')]['limit']);_0x4f1de3[_0x6cf6('0x27')]=qs['offset'](_0x167356['query'][_0x6cf6('0x27')]);}return _0x140ed2['getConfigurations'](_0x4f1de3);}})['then'](function(_0x454f20){if(_0x454f20){return _0x454f20?{'count':_0x5daf8e,'rows':_0x454f20}:null;}})[_0x6cf6('0x17')](respondWithResult(_0x160c7f,null))[_0x6cf6('0x22')](handleError(_0x160c7f,null));};exports['addConfiguration']=function(_0x18b60c,_0x4a2451,_0x2dedba){if(_0x18b60c[_0x6cf6('0x51')]['id']){delete _0x18b60c['body']['id'];}return db[_0x6cf6('0x32')][_0x6cf6('0x53')]({'where':{'id':_0x18b60c[_0x6cf6('0x4d')]['id']}})[_0x6cf6('0x17')](handleEntityNotFound(_0x4a2451,null))[_0x6cf6('0x17')](function(_0x40ea5e){if(_0x40ea5e){_0x18b60c['body'][_0x6cf6('0x56')]=_0x40ea5e['id'];_0x18b60c[_0x6cf6('0x51')][_0x6cf6('0x57')]=integrations[_0x6cf6('0x58')](_0x18b60c[_0x6cf6('0x51')][_0x6cf6('0x59')],_0x18b60c['body']['type']);_0x18b60c['body'][_0x6cf6('0x5a')]=integrations['getDescriptions'](_0x18b60c[_0x6cf6('0x51')]['channel'],_0x18b60c[_0x6cf6('0x51')][_0x6cf6('0x45')]);return db['VtigerConfiguration'][_0x6cf6('0x50')](_0x18b60c[_0x6cf6('0x51')],{'include':[{'model':db[_0x6cf6('0x5b')],'as':'Subjects'},{'model':db[_0x6cf6('0x5b')],'as':'Descriptions'}]});}return null;})[_0x6cf6('0x17')](respondWithResult(_0x4a2451,null))[_0x6cf6('0x22')](handleError(_0x4a2451,null));};var md5=require(_0x6cf6('0x5c'));exports[_0x6cf6('0x5d')]=function(_0x33b436,_0x3336f9,_0x187ef2){var _0x4df5a8=null;var _0x317e1a=null;var _0x5d7d29=null;var _0x3f3d67=null;var _0xdb7124='';return db[_0x6cf6('0x32')][_0x6cf6('0x53')]({'where':{'id':_0x33b436['params']['id']},'attributes':['id','name',_0x6cf6('0x5e'),_0x6cf6('0x5f'),_0x6cf6('0x60'),_0x6cf6('0x61'),_0x6cf6('0x62'),_0x6cf6('0x63')]})['then'](handleEntityNotFound(_0x3336f9,null))['then'](function(_0x1c73bf){if(_0x1c73bf){_0x4df5a8=_0x1c73bf['username'];_0x317e1a=_0x1c73bf[_0x6cf6('0x63')];_0x5d7d29=_0x1c73bf[_0x6cf6('0x60')];_0xdb7124=_0x1c73bf[_0x6cf6('0x61')];var _0x1e5df1=_0xdb7124['slice'](-0x1);if(_0x1e5df1==='/'){_0xdb7124=_0xdb7124[_0x6cf6('0x64')](0x0,_0xdb7124['lastIndexOf'](_0x1e5df1));}_0x3f3d67=util[_0x6cf6('0x65')](_0x6cf6('0x66'),_0xdb7124);var _0x6e0794={'method':'GET','uri':_0x3f3d67,'qs':{'operation':_0x6cf6('0x67'),'username':_0x1c73bf[_0x6cf6('0x5e')]},'json':!![]};return rp(_0x6e0794);}})[_0x6cf6('0x17')](function(_0x4c4c6c){if(_0x4c4c6c[_0x6cf6('0x68')]){var _0x4572={'method':_0x6cf6('0x69'),'uri':_0x3f3d67,'form':{'operation':'login','username':_0x4df5a8,'accessKey':md5(_0x4c4c6c['result'][_0x6cf6('0x6a')]+_0x317e1a)},'json':!![]};return rp(_0x4572);}})['then'](function(_0x4c3136){if(_0x4c3136[_0x6cf6('0x68')]){var _0x4244a4={'method':_0x6cf6('0x6b'),'uri':_0x3f3d67,'qs':{'operation':_0x6cf6('0x6c'),'username':_0x4df5a8,'sessionName':_0x4c3136[_0x6cf6('0x21')][_0x6cf6('0x6d')],'elementType':_0x5d7d29},'json':!![]};return rp(_0x4244a4);}})[_0x6cf6('0x17')](function(_0x36492d){if(_0x36492d[_0x6cf6('0x68')]){var _0x4eb614=[_0x6cf6('0x6e'),_0x6cf6('0x6f'),_0x6cf6('0x70')];_['remove'](_0x36492d['result'][_0x6cf6('0x3a')],function(_0x169a33){return _0x4eb614[_0x6cf6('0x71')](_0x169a33[_0x6cf6('0x45')][_0x6cf6('0x2f')]);});_[_0x6cf6('0x72')](_0x36492d['result'][_0x6cf6('0x3a')],function(_0x17f730){return _0x17f730[_0x6cf6('0x73')]===_0x6cf6('0x74');});return{'count':_0x36492d[_0x6cf6('0x21')][_0x6cf6('0x3a')][_0x6cf6('0x3b')],'rows':_['map'](_0x36492d[_0x6cf6('0x21')][_0x6cf6('0x3a')],function(_0x4ed983){return{'id':_0x4ed983[_0x6cf6('0x2f')],'name':_0x4ed983[_0x6cf6('0x75')],'custom':_[_0x6cf6('0x76')](_0x4ed983['name'],_0x6cf6('0x77'))?!![]:![],'options':_0x4ed983[_0x6cf6('0x45')][_0x6cf6('0x2f')]===_0x6cf6('0x78')&&_0x4ed983[_0x6cf6('0x45')][_0x6cf6('0x79')]['length']>0x0?_['map'](_0x4ed983['type'][_0x6cf6('0x79')],function(_0x542d76){return{'name':_0x542d76[_0x6cf6('0x75')],'value':_0x542d76[_0x6cf6('0x7a')]};}):[]};})};}})['then'](respondWithResult(_0x3336f9,null))[_0x6cf6('0x22')](function(_0x121249){console[_0x6cf6('0x7b')](_0x6cf6('0x7c')+_0x121249);var _0x100306=_0x33b436['query'][_0x6cf6('0x7d')]?0x1f4:_0x121249[_0x6cf6('0x7e')]||0x1f4;logger[_0x6cf6('0x1e')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x100306,JSON[_0x6cf6('0x1d')](_0x121249));delete _0x121249[_0x6cf6('0x2f')];if(_0x100306===0x191){_0x100306=0x190;}_0x3336f9[_0x6cf6('0x23')](_0x100306)[_0x6cf6('0x30')](_0x33b436[_0x6cf6('0x36')][_0x6cf6('0x7d')]?{'message':_0x6cf6('0x7f'),'statusCode':_0x121249['statusCode']}:_0x121249);});}; \ No newline at end of file +var _0x4227=['test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','http','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','update','destroy','name','send','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','key','VIRTUAL','field','merge','options','include','VtigerAccount','findAll','rows','show','params','length','includeAll','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','map','addConfiguration','AccountId','Subjects','getSubjects','channel','type','getDescriptions','VtigerField','Descriptions','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','reference','owner','remove','includes','editable','false','label','cf_','picklistValues','value','log','vTiger\x20error:\x20'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x4227,0x89));var _0x7422=function(_0x542ddc,_0x1030f8){_0x542ddc=_0x542ddc-0x0;var _0x46a492=_0x4227[_0x542ddc];return _0x46a492;};'use strict';var pdf=require(_0x7422('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7422('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7422('0x2'));var moment=require(_0x7422('0x3'));var BPromise=require(_0x7422('0x4'));var Mustache=require('mustache');var util=require(_0x7422('0x5'));var path=require(_0x7422('0x6'));var sox=require(_0x7422('0x7'));var csv=require(_0x7422('0x8'));var ejs=require(_0x7422('0x9'));var fs=require('fs');var _=require(_0x7422('0xa'));var squel=require(_0x7422('0xb'));var crypto=require(_0x7422('0xc'));var jsforce=require(_0x7422('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7422('0x8'));var querystring=require(_0x7422('0xe'));var Papa=require(_0x7422('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x7422('0x10'));var Redis=require('ioredis');var qs=require(_0x7422('0x11'));var logger=require(_0x7422('0x12'))(_0x7422('0x13'));var utils=require(_0x7422('0x14'));var config=require(_0x7422('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7422('0x16'));var jayson=require(_0x7422('0x17'));var client=jayson['client'][_0x7422('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2acd6c,_0x4f46dc,_0x117e37,_0x12a5cd){return new BPromise(function(_0x555082,_0x4d3f91){var _0xeafd58=_0x12a5cd||client;return _0xeafd58['request'](_0x2acd6c,_0x117e37)[_0x7422('0x19')](function(_0x788829){logger['info'](_0x7422('0x1a'),_0x4f46dc,_0x7422('0x1b'));logger[_0x7422('0x1c')](_0x7422('0x1d'),_0x4f46dc,_0x7422('0x1b'),JSON[_0x7422('0x1e')](_0x788829));if(_0x788829['error']){if(_0x788829[_0x7422('0x1f')][_0x7422('0x20')]===0x1f4){logger[_0x7422('0x1f')](_0x7422('0x1a'),_0x4f46dc,_0x788829['error'][_0x7422('0x21')]);return _0x4d3f91(_0x788829['error'][_0x7422('0x21')]);}logger[_0x7422('0x1f')](_0x7422('0x1a'),_0x4f46dc,_0x788829['error'][_0x7422('0x21')]);return _0x555082(_0x788829[_0x7422('0x1f')][_0x7422('0x21')]);}else{logger[_0x7422('0x22')]('VtigerAccount,\x20%s,\x20%s',_0x4f46dc,'request\x20sent');_0x555082(_0x788829[_0x7422('0x23')][_0x7422('0x21')]);}})[_0x7422('0x24')](function(_0x7d34f2){logger[_0x7422('0x1f')](_0x7422('0x1a'),_0x4f46dc,_0x7d34f2);_0x4d3f91(_0x7d34f2);});});}function respondWithStatusCode(_0xe4f174,_0x596b89){_0x596b89=_0x596b89||0xcc;return function(_0x24ce62){if(_0x24ce62){return _0xe4f174[_0x7422('0x25')](_0x596b89);}return _0xe4f174['status'](_0x596b89)[_0x7422('0x26')]();};}function respondWithResult(_0x23fb68,_0x11ab32){_0x11ab32=_0x11ab32||0xc8;return function(_0x3eeb9c){if(_0x3eeb9c){return _0x23fb68['status'](_0x11ab32)[_0x7422('0x27')](_0x3eeb9c);}};}function respondWithFilteredResult(_0x2eed9f,_0x3cdea0){return function(_0x2dd10f){if(_0x2dd10f){var _0x3438d1=_0x2dd10f[_0x7422('0x28')],_0x5e997b=_0x3cdea0[_0x7422('0x29')],_0x34f1b0=_0x3cdea0['offset']+_0x3cdea0[_0x7422('0x2a')],_0x9c29c0;if(_0x34f1b0>=_0x3438d1){_0x34f1b0=_0x3438d1;_0x9c29c0=0xc8;}else{_0x9c29c0=0xce;}_0x2eed9f[_0x7422('0x2b')](_0x9c29c0);return _0x2eed9f[_0x7422('0x2c')](_0x7422('0x2d'),_0x5e997b+'-'+_0x34f1b0+'/'+_0x3438d1)['json'](_0x2dd10f);}return null;};}function patchUpdates(_0x1cd623){return function(_0x41d4a1){try{jsonpatch['apply'](_0x41d4a1,_0x1cd623,!![]);}catch(_0x4e4ac1){return BPromise[_0x7422('0x2e')](_0x4e4ac1);}return _0x41d4a1[_0x7422('0x2f')]();};}function saveUpdates(_0x5e08f7,_0x1d5ae5){return function(_0x194a5e){if(_0x194a5e){return _0x194a5e[_0x7422('0x30')](_0x5e08f7)[_0x7422('0x19')](function(_0x1f23b7){return _0x1f23b7;});}return null;};}function removeEntity(_0x2ca9ab,_0x212a66){return function(_0xa9d41){if(_0xa9d41){return _0xa9d41[_0x7422('0x31')]()[_0x7422('0x19')](function(){_0x2ca9ab[_0x7422('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c794,_0x3d0fb9){return function(_0x22327f){if(!_0x22327f){_0x50c794[_0x7422('0x25')](0x194);}return _0x22327f;};}function handleError(_0x4c4984,_0x3823a5){_0x3823a5=_0x3823a5||0x1f4;return function(_0x339b85){logger[_0x7422('0x1f')](_0x339b85['stack']);if(_0x339b85['name']){delete _0x339b85[_0x7422('0x32')];}_0x4c4984['status'](_0x3823a5)[_0x7422('0x33')](_0x339b85);};}exports['index']=function(_0x18b594,_0x57d732){var _0x45e26d={},_0x566d99={},_0x4a7981={'count':0x0,'rows':[]};var _0x6b7b02=db['VtigerAccount'][_0x7422('0x34')];_0x566d99[_0x7422('0x35')]=_[_0x7422('0x36')](_0x6b7b02);_0x566d99[_0x7422('0x37')]=_[_0x7422('0x36')](_0x18b594[_0x7422('0x37')]);_0x566d99[_0x7422('0x38')]=_['intersection'](_0x566d99[_0x7422('0x35')],_0x566d99[_0x7422('0x37')]);_0x45e26d[_0x7422('0x39')]=_[_0x7422('0x3a')](_0x566d99[_0x7422('0x35')],qs['fields'](_0x18b594[_0x7422('0x37')][_0x7422('0x3b')]));_0x45e26d['attributes']=_0x45e26d[_0x7422('0x39')]['length']?_0x45e26d[_0x7422('0x39')]:_0x566d99['model'];if(!_0x18b594['query'][_0x7422('0x3c')](_0x7422('0x3d'))){_0x45e26d[_0x7422('0x2a')]=qs['limit'](_0x18b594[_0x7422('0x37')][_0x7422('0x2a')]);_0x45e26d['offset']=qs[_0x7422('0x29')](_0x18b594['query'][_0x7422('0x29')]);}_0x45e26d[_0x7422('0x3e')]=qs[_0x7422('0x3f')](_0x18b594[_0x7422('0x37')][_0x7422('0x3f')]);_0x45e26d[_0x7422('0x40')]=qs[_0x7422('0x38')](_['pick'](_0x18b594[_0x7422('0x37')],_0x566d99[_0x7422('0x38')]));if(_0x18b594['query'][_0x7422('0x41')]){_0x45e26d[_0x7422('0x40')]=_['merge'](_0x45e26d[_0x7422('0x40')],{'$or':_['map'](_0x6b7b02,function(_0x303c62){if(_0x303c62['type'][_0x7422('0x42')]!==_0x7422('0x43')){var _0xcea170={};_0xcea170[_0x303c62[_0x7422('0x44')]]={'$like':'%'+_0x18b594[_0x7422('0x37')][_0x7422('0x41')]+'%'};return _0xcea170;}})});}_0x45e26d=_[_0x7422('0x45')]({},_0x45e26d,_0x18b594[_0x7422('0x46')]);var _0x2feb86={'where':_0x45e26d[_0x7422('0x40')]};return db['VtigerAccount'][_0x7422('0x28')](_0x2feb86)['then'](function(_0x558f9d){_0x4a7981[_0x7422('0x28')]=_0x558f9d;if(_0x18b594[_0x7422('0x37')]['includeAll']){_0x45e26d[_0x7422('0x47')]=[{'all':!![]}];}return db[_0x7422('0x48')][_0x7422('0x49')](_0x45e26d);})[_0x7422('0x19')](function(_0x3301c7){_0x4a7981[_0x7422('0x4a')]=_0x3301c7;return _0x4a7981;})[_0x7422('0x19')](respondWithFilteredResult(_0x57d732,_0x45e26d))['catch'](handleError(_0x57d732,null));};exports[_0x7422('0x4b')]=function(_0x131ca2,_0x433457){var _0x45ad30={'raw':![],'where':{'id':_0x131ca2[_0x7422('0x4c')]['id']}},_0x52f1bc={};_0x52f1bc[_0x7422('0x35')]=_[_0x7422('0x36')](db['VtigerAccount'][_0x7422('0x34')]);_0x52f1bc[_0x7422('0x37')]=_['keys'](_0x131ca2['query']);_0x52f1bc['filters']=_[_0x7422('0x3a')](_0x52f1bc[_0x7422('0x35')],_0x52f1bc['query']);_0x45ad30[_0x7422('0x39')]=_['intersection'](_0x52f1bc[_0x7422('0x35')],qs[_0x7422('0x3b')](_0x131ca2[_0x7422('0x37')][_0x7422('0x3b')]));_0x45ad30['attributes']=_0x45ad30['attributes'][_0x7422('0x4d')]?_0x45ad30[_0x7422('0x39')]:_0x52f1bc['model'];if(_0x131ca2[_0x7422('0x37')][_0x7422('0x4e')]){_0x45ad30['include']=[{'all':!![]}];}_0x45ad30=_[_0x7422('0x45')]({},_0x45ad30,_0x131ca2[_0x7422('0x46')]);return db[_0x7422('0x48')][_0x7422('0x4f')](_0x45ad30)[_0x7422('0x19')](handleEntityNotFound(_0x433457,null))[_0x7422('0x19')](respondWithResult(_0x433457,null))[_0x7422('0x24')](handleError(_0x433457,null));};exports[_0x7422('0x50')]=function(_0x1ad0af,_0x424559){return db['VtigerAccount'][_0x7422('0x50')](_0x1ad0af[_0x7422('0x51')],{})[_0x7422('0x19')](respondWithResult(_0x424559,0xc9))['catch'](handleError(_0x424559,null));};exports[_0x7422('0x30')]=function(_0x28531a,_0x295a6e){if(_0x28531a[_0x7422('0x51')]['id']){delete _0x28531a[_0x7422('0x51')]['id'];}return db[_0x7422('0x48')]['find']({'where':{'id':_0x28531a[_0x7422('0x4c')]['id']}})[_0x7422('0x19')](handleEntityNotFound(_0x295a6e,null))[_0x7422('0x19')](saveUpdates(_0x28531a[_0x7422('0x51')],null))[_0x7422('0x19')](respondWithResult(_0x295a6e,null))[_0x7422('0x24')](handleError(_0x295a6e,null));};exports[_0x7422('0x31')]=function(_0x515ee4,_0x305418){return db['VtigerAccount']['find']({'where':{'id':_0x515ee4[_0x7422('0x4c')]['id']}})['then'](handleEntityNotFound(_0x305418,null))[_0x7422('0x19')](removeEntity(_0x305418,null))[_0x7422('0x24')](handleError(_0x305418,null));};exports[_0x7422('0x52')]=function(_0x54f19e,_0x18f5d7,_0x2eaff4){var _0x13366c={};var _0x1e5475={};var _0x57e7a7;var _0x5889f7;return db[_0x7422('0x48')][_0x7422('0x53')]({'where':{'id':_0x54f19e['params']['id']}})['then'](handleEntityNotFound(_0x18f5d7,null))[_0x7422('0x19')](function(_0x935550){if(_0x935550){_0x57e7a7=_0x935550;_0x1e5475[_0x7422('0x35')]=_[_0x7422('0x36')](db[_0x7422('0x54')][_0x7422('0x34')]);_0x1e5475[_0x7422('0x37')]=_[_0x7422('0x36')](_0x54f19e[_0x7422('0x37')]);_0x1e5475[_0x7422('0x38')]=_['intersection'](_0x1e5475[_0x7422('0x35')],_0x1e5475[_0x7422('0x37')]);_0x13366c[_0x7422('0x39')]=_[_0x7422('0x3a')](_0x1e5475[_0x7422('0x35')],qs[_0x7422('0x3b')](_0x54f19e['query'][_0x7422('0x3b')]));_0x13366c[_0x7422('0x39')]=_0x13366c[_0x7422('0x39')][_0x7422('0x4d')]?_0x13366c[_0x7422('0x39')]:_0x1e5475[_0x7422('0x35')];_0x13366c[_0x7422('0x3e')]=qs[_0x7422('0x3f')](_0x54f19e['query']['sort']);_0x13366c[_0x7422('0x40')]=qs[_0x7422('0x38')](_[_0x7422('0x55')](_0x54f19e['query'],_0x1e5475[_0x7422('0x38')]));if(_0x54f19e['query']['filter']){_0x13366c[_0x7422('0x40')]=_['merge'](_0x13366c[_0x7422('0x40')],{'$or':_[_0x7422('0x56')](_0x13366c[_0x7422('0x39')],function(_0x108e72){var _0x381ace={};_0x381ace[_0x108e72]={'$like':'%'+_0x54f19e[_0x7422('0x37')][_0x7422('0x41')]+'%'};return _0x381ace;})});}_0x13366c=_[_0x7422('0x45')]({},_0x13366c,_0x54f19e[_0x7422('0x46')]);return _0x57e7a7[_0x7422('0x52')](_0x13366c);}})[_0x7422('0x19')](function(_0x48c587){if(_0x48c587){_0x5889f7=_0x48c587[_0x7422('0x4d')];if(!_0x54f19e[_0x7422('0x37')][_0x7422('0x3c')](_0x7422('0x3d'))){_0x13366c['limit']=qs[_0x7422('0x2a')](_0x54f19e['query'][_0x7422('0x2a')]);_0x13366c['offset']=qs[_0x7422('0x29')](_0x54f19e[_0x7422('0x37')]['offset']);}return _0x57e7a7[_0x7422('0x52')](_0x13366c);}})[_0x7422('0x19')](function(_0x398a8f){if(_0x398a8f){return _0x398a8f?{'count':_0x5889f7,'rows':_0x398a8f}:null;}})[_0x7422('0x19')](respondWithResult(_0x18f5d7,null))[_0x7422('0x24')](handleError(_0x18f5d7,null));};exports[_0x7422('0x57')]=function(_0x5af3d9,_0x1fdfa9,_0x2012f0){if(_0x5af3d9['body']['id']){delete _0x5af3d9[_0x7422('0x51')]['id'];}return db[_0x7422('0x48')]['findOne']({'where':{'id':_0x5af3d9[_0x7422('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1fdfa9,null))[_0x7422('0x19')](function(_0x4670e0){if(_0x4670e0){_0x5af3d9[_0x7422('0x51')][_0x7422('0x58')]=_0x4670e0['id'];_0x5af3d9[_0x7422('0x51')][_0x7422('0x59')]=integrations[_0x7422('0x5a')](_0x5af3d9['body'][_0x7422('0x5b')],_0x5af3d9['body'][_0x7422('0x5c')]);_0x5af3d9[_0x7422('0x51')]['Descriptions']=integrations[_0x7422('0x5d')](_0x5af3d9[_0x7422('0x51')][_0x7422('0x5b')],_0x5af3d9[_0x7422('0x51')]['type']);return db['VtigerConfiguration'][_0x7422('0x50')](_0x5af3d9[_0x7422('0x51')],{'include':[{'model':db[_0x7422('0x5e')],'as':_0x7422('0x59')},{'model':db[_0x7422('0x5e')],'as':_0x7422('0x5f')}]});}return null;})[_0x7422('0x19')](respondWithResult(_0x1fdfa9,null))[_0x7422('0x24')](handleError(_0x1fdfa9,null));};var md5=require(_0x7422('0x60'));exports['getFields']=function(_0x170705,_0x514724,_0x4f0d0f){var _0x110b3f=null;var _0x52b8b6=null;var _0x4bd3e0=null;var _0x2f4e99=null;var _0xb7a85a='';return db[_0x7422('0x48')][_0x7422('0x53')]({'where':{'id':_0x170705[_0x7422('0x4c')]['id']},'attributes':['id',_0x7422('0x32'),_0x7422('0x61'),_0x7422('0x62'),'moduleName',_0x7422('0x63'),_0x7422('0x64'),_0x7422('0x65')]})[_0x7422('0x19')](handleEntityNotFound(_0x514724,null))['then'](function(_0x3cb32b){if(_0x3cb32b){_0x110b3f=_0x3cb32b[_0x7422('0x61')];_0x52b8b6=_0x3cb32b[_0x7422('0x65')];_0x4bd3e0=_0x3cb32b[_0x7422('0x66')];_0xb7a85a=_0x3cb32b['remoteUri'];var _0x42b7d3=_0xb7a85a[_0x7422('0x67')](-0x1);if(_0x42b7d3==='/'){_0xb7a85a=_0xb7a85a[_0x7422('0x68')](0x0,_0xb7a85a['lastIndexOf'](_0x42b7d3));}_0x2f4e99=util[_0x7422('0x69')](_0x7422('0x6a'),_0xb7a85a);var _0xcceb4d={'method':_0x7422('0x6b'),'uri':_0x2f4e99,'qs':{'operation':_0x7422('0x6c'),'username':_0x3cb32b[_0x7422('0x61')]},'json':!![]};return rp(_0xcceb4d);}})[_0x7422('0x19')](function(_0x4e63a0){if(_0x4e63a0[_0x7422('0x6d')]){var _0x12b377={'method':_0x7422('0x6e'),'uri':_0x2f4e99,'form':{'operation':_0x7422('0x6f'),'username':_0x110b3f,'accessKey':md5(_0x4e63a0['result'][_0x7422('0x70')]+_0x52b8b6)},'json':!![]};return rp(_0x12b377);}})['then'](function(_0x86b363){if(_0x86b363[_0x7422('0x6d')]){var _0x1ae8d0={'method':'GET','uri':_0x2f4e99,'qs':{'operation':_0x7422('0x71'),'username':_0x110b3f,'sessionName':_0x86b363[_0x7422('0x23')][_0x7422('0x72')],'elementType':_0x4bd3e0},'json':!![]};return rp(_0x1ae8d0);}})['then'](function(_0x1effdf){if(_0x1effdf[_0x7422('0x6d')]){var _0x44e8d4=['autogenerated',_0x7422('0x73'),_0x7422('0x74')];_[_0x7422('0x75')](_0x1effdf[_0x7422('0x23')][_0x7422('0x3b')],function(_0x14d47f){return _0x44e8d4[_0x7422('0x76')](_0x14d47f['type'][_0x7422('0x32')]);});_[_0x7422('0x75')](_0x1effdf[_0x7422('0x23')][_0x7422('0x3b')],function(_0xdb7260){return _0xdb7260[_0x7422('0x77')]===_0x7422('0x78');});return{'count':_0x1effdf[_0x7422('0x23')][_0x7422('0x3b')][_0x7422('0x4d')],'rows':_[_0x7422('0x56')](_0x1effdf[_0x7422('0x23')][_0x7422('0x3b')],function(_0x119c9b){return{'id':_0x119c9b[_0x7422('0x32')],'name':_0x119c9b[_0x7422('0x79')],'custom':_['startsWith'](_0x119c9b[_0x7422('0x32')],_0x7422('0x7a'))?!![]:![],'options':_0x119c9b[_0x7422('0x5c')][_0x7422('0x32')]==='picklist'&&_0x119c9b[_0x7422('0x5c')][_0x7422('0x7b')]['length']>0x0?_[_0x7422('0x56')](_0x119c9b[_0x7422('0x5c')]['picklistValues'],function(_0x36533e){return{'name':_0x36533e[_0x7422('0x79')],'value':_0x36533e[_0x7422('0x7c')]};}):[]};})};}})[_0x7422('0x19')](respondWithResult(_0x514724,null))['catch'](function(_0x3ecce8){console[_0x7422('0x7d')](_0x7422('0x7e')+_0x3ecce8);var _0x544ea9=_0x170705[_0x7422('0x37')][_0x7422('0x7f')]?0x1f4:_0x3ecce8[_0x7422('0x80')]||0x1f4;logger['error'](_0x7422('0x81'),_0x7422('0x82'),_0x544ea9,JSON[_0x7422('0x1e')](_0x3ecce8));delete _0x3ecce8[_0x7422('0x32')];if(_0x544ea9===0x191){_0x544ea9=0x190;}_0x514724[_0x7422('0x2b')](_0x544ea9)['send'](_0x170705[_0x7422('0x37')][_0x7422('0x7f')]?{'message':_0x7422('0x83'),'statusCode':_0x3ecce8['statusCode']}:_0x3ecce8);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index f4df019..b15a3de 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 _0xf780=['./intVtigerAccount.attributes','exports','define','lodash','util','api','moment','request-promise'];(function(_0x46cb56,_0x361ed6){var _0x32f490=function(_0x2911c6){while(--_0x2911c6){_0x46cb56['push'](_0x46cb56['shift']());}};_0x32f490(++_0x361ed6);}(_0xf780,0xf3));var _0x0f78=function(_0x9058db,_0x235f2a){_0x9058db=_0x9058db-0x0;var _0x506b86=_0xf780[_0x9058db];return _0x506b86;};'use strict';var _=require(_0x0f78('0x0'));var util=require(_0x0f78('0x1'));var logger=require('../../config/logger')(_0x0f78('0x2'));var moment=require(_0x0f78('0x3'));var BPromise=require('bluebird');var rp=require(_0x0f78('0x4'));var attributes=require(_0x0f78('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x0f78('0x6')]=function(_0x2a233f,_0x9f32f2){return _0x2a233f[_0x0f78('0x7')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4134=['api','moment','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x189b65,_0x271010){var _0xe66978=function(_0xf51265){while(--_0xf51265){_0x189b65['push'](_0x189b65['shift']());}};_0xe66978(++_0x271010);}(_0x4134,0xb1));var _0x4413=function(_0x2679d1,_0x2deb01){_0x2679d1=_0x2679d1-0x0;var _0x476ad6=_0x4134[_0x2679d1];return _0x476ad6;};'use strict';var _=require(_0x4413('0x0'));var util=require(_0x4413('0x1'));var logger=require(_0x4413('0x2'))(_0x4413('0x3'));var moment=require(_0x4413('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x4413('0x5'));module[_0x4413('0x6')]=function(_0xeca30c,_0x120fbb){return _0xeca30c['define'](_0x4413('0x7'),attributes,{'tableName':_0x4413('0x8'),'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 a0c69d8..4860dd5 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 _0x8959=['limit','include','map','model','catch','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x8959,0x1e2));var _0x9895=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0x8959[_0x673722];return _0x21249c;};'use strict';var _=require(_0x9895('0x0'));var util=require(_0x9895('0x1'));var moment=require(_0x9895('0x2'));var BPromise=require('bluebird');var rs=require(_0x9895('0x3'));var fs=require('fs');var Redis=require(_0x9895('0x4'));var db=require(_0x9895('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9895('0x6'));var client=jayson[_0x9895('0x7')][_0x9895('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1efb20,_0x15d42f,_0xbd373a){return new BPromise(function(_0x32d727,_0x5ddd76){return client[_0x9895('0x9')](_0x1efb20,_0xbd373a)[_0x9895('0xa')](function(_0x36cfba){logger[_0x9895('0xb')](_0x9895('0xc'),_0x15d42f,_0x9895('0xd'));logger[_0x9895('0xe')](_0x9895('0xf'),_0x15d42f,'request\x20sent',JSON[_0x9895('0x10')](_0x36cfba));if(_0x36cfba[_0x9895('0x11')]){if(_0x36cfba[_0x9895('0x11')][_0x9895('0x12')]===0x1f4){logger[_0x9895('0x11')](_0x9895('0xc'),_0x15d42f,_0x36cfba[_0x9895('0x11')][_0x9895('0x13')]);return _0x5ddd76(_0x36cfba[_0x9895('0x11')][_0x9895('0x13')]);}logger[_0x9895('0x11')](_0x9895('0xc'),_0x15d42f,_0x36cfba[_0x9895('0x11')]['message']);return _0x32d727(_0x36cfba[_0x9895('0x11')][_0x9895('0x13')]);}else{logger[_0x9895('0xb')](_0x9895('0xc'),_0x15d42f,_0x9895('0xd'));_0x32d727(_0x36cfba[_0x9895('0x14')]['message']);}})['catch'](function(_0x38fe50){logger[_0x9895('0x11')](_0x9895('0xc'),_0x15d42f,_0x38fe50);_0x5ddd76(_0x38fe50);});});}exports[_0x9895('0x15')]=function(_0x11b818){var _0x6d47db=this;return new Promise(function(_0x47e37e,_0x42cd02){return db[_0x9895('0x16')][_0x9895('0x17')]({'raw':_0x11b818[_0x9895('0x18')]?_0x11b818[_0x9895('0x18')][_0x9895('0x19')]===undefined?!![]:![]:!![],'where':_0x11b818[_0x9895('0x18')]?_0x11b818['options'][_0x9895('0x1a')]||null:null,'attributes':_0x11b818[_0x9895('0x18')]?_0x11b818[_0x9895('0x18')][_0x9895('0x1b')]||null:null,'limit':_0x11b818[_0x9895('0x18')]?_0x11b818[_0x9895('0x18')][_0x9895('0x1c')]||null:null,'include':_0x11b818['options']?_0x11b818[_0x9895('0x18')][_0x9895('0x1d')]?_[_0x9895('0x1e')](_0x11b818[_0x9895('0x18')][_0x9895('0x1d')],function(_0x2fe594){return{'model':db[_0x2fe594[_0x9895('0x1f')]],'as':_0x2fe594['as'],'attributes':_0x2fe594['attributes'],'include':_0x2fe594['include']?_[_0x9895('0x1e')](_0x2fe594[_0x9895('0x1d')],function(_0xee0588){return{'model':db[_0xee0588['model']],'as':_0xee0588['as'],'attributes':_0xee0588[_0x9895('0x1b')],'include':_0xee0588['include']?_[_0x9895('0x1e')](_0xee0588[_0x9895('0x1d')],function(_0x151268){return{'model':db[_0x151268[_0x9895('0x1f')]],'as':_0x151268['as'],'attributes':_0x151268[_0x9895('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9895('0xa')](function(_0x373628){logger[_0x9895('0xb')]('GetVtigerAccount',_0x11b818);logger[_0x9895('0xe')](_0x9895('0x15'),_0x11b818,JSON[_0x9895('0x10')](_0x373628));_0x47e37e(_0x373628);})[_0x9895('0x20')](function(_0x2a485e){logger['error'](_0x9895('0x15'),_0x2a485e[_0x9895('0x13')],_0x11b818);_0x42cd02(_0x6d47db['error'](0x1f4,_0x2a485e['message']));});});};exports[_0x9895('0x21')]=function(_0x5d0c03){var _0x19b4b5=this;return new Promise(function(_0x7ba00b,_0x21f68d){return db[_0x9895('0x16')]['find']({'raw':_0x5d0c03[_0x9895('0x18')]?_0x5d0c03[_0x9895('0x18')][_0x9895('0x19')]===undefined?!![]:![]:!![],'where':_0x5d0c03[_0x9895('0x18')]?_0x5d0c03[_0x9895('0x18')][_0x9895('0x1a')]||null:null,'attributes':_0x5d0c03[_0x9895('0x18')]?_0x5d0c03[_0x9895('0x18')][_0x9895('0x1b')]||null:null,'include':_0x5d0c03[_0x9895('0x18')]?_0x5d0c03[_0x9895('0x18')][_0x9895('0x1d')]?_[_0x9895('0x1e')](_0x5d0c03[_0x9895('0x18')]['include'],function(_0x1d8469){return{'model':db[_0x1d8469[_0x9895('0x1f')]],'as':_0x1d8469['as'],'attributes':_0x1d8469[_0x9895('0x1b')],'include':_0x1d8469[_0x9895('0x1d')]?_[_0x9895('0x1e')](_0x1d8469[_0x9895('0x1d')],function(_0x447c15){return{'model':db[_0x447c15[_0x9895('0x1f')]],'as':_0x447c15['as'],'attributes':_0x447c15[_0x9895('0x1b')],'include':_0x447c15[_0x9895('0x1d')]?_[_0x9895('0x1e')](_0x447c15[_0x9895('0x1d')],function(_0x92a0db){return{'model':db[_0x92a0db[_0x9895('0x1f')]],'as':_0x92a0db['as'],'attributes':_0x92a0db['attributes']};}):[]};}):[]};}):[]:[]})[_0x9895('0xa')](function(_0x44883a){logger[_0x9895('0xb')](_0x9895('0x21'),_0x5d0c03);logger[_0x9895('0xe')](_0x9895('0x21'),_0x5d0c03,JSON[_0x9895('0x10')](_0x44883a));_0x7ba00b(_0x44883a);})['catch'](function(_0x6784a7){logger[_0x9895('0x11')](_0x9895('0x21'),_0x6784a7['message'],_0x5d0c03);_0x21f68d(_0x19b4b5[_0x9895('0x11')](0x1f4,_0x6784a7['message']));});});}; \ No newline at end of file +var _0x7865=['rpc','../../config/environment','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','model','map','include','then','debug','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x30b478,_0x53da1c){var _0x447e22=function(_0x4b661e){while(--_0x4b661e){_0x30b478['push'](_0x30b478['shift']());}};_0x447e22(++_0x53da1c);}(_0x7865,0x19c));var _0x5786=function(_0x3a4588,_0x47b8a0){_0x3a4588=_0x3a4588-0x0;var _0x58fe61=_0x7865[_0x3a4588];return _0x58fe61;};'use strict';var _=require(_0x5786('0x0'));var util=require(_0x5786('0x1'));var moment=require('moment');var BPromise=require(_0x5786('0x2'));var rs=require(_0x5786('0x3'));var fs=require('fs');var Redis=require(_0x5786('0x4'));var db=require(_0x5786('0x5'))['db'];var utils=require(_0x5786('0x6'));var logger=require(_0x5786('0x7'))(_0x5786('0x8'));var config=require(_0x5786('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5786('0xa')][_0x5786('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c69a0,_0x5e50d0,_0x7384ff){return new BPromise(function(_0x4d6f3e,_0x12618f){return client[_0x5786('0xc')](_0x5c69a0,_0x7384ff)['then'](function(_0x2d47a2){logger['info'](_0x5786('0xd'),_0x5e50d0,_0x5786('0xe'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x5e50d0,_0x5786('0xe'),JSON[_0x5786('0xf')](_0x2d47a2));if(_0x2d47a2['error']){if(_0x2d47a2[_0x5786('0x10')]['code']===0x1f4){logger['error'](_0x5786('0xd'),_0x5e50d0,_0x2d47a2[_0x5786('0x10')][_0x5786('0x11')]);return _0x12618f(_0x2d47a2[_0x5786('0x10')][_0x5786('0x11')]);}logger[_0x5786('0x10')](_0x5786('0xd'),_0x5e50d0,_0x2d47a2['error'][_0x5786('0x11')]);return _0x4d6f3e(_0x2d47a2['error'][_0x5786('0x11')]);}else{logger[_0x5786('0x12')](_0x5786('0xd'),_0x5e50d0,_0x5786('0xe'));_0x4d6f3e(_0x2d47a2[_0x5786('0x13')][_0x5786('0x11')]);}})[_0x5786('0x14')](function(_0x1a035e){logger[_0x5786('0x10')](_0x5786('0xd'),_0x5e50d0,_0x1a035e);_0x12618f(_0x1a035e);});});}exports[_0x5786('0x15')]=function(_0x51cf9c){var _0x32ab94=this;return new Promise(function(_0x176e23,_0x170059){return db[_0x5786('0x16')][_0x5786('0x17')]({'raw':_0x51cf9c[_0x5786('0x18')]?_0x51cf9c[_0x5786('0x18')][_0x5786('0x19')]===undefined?!![]:![]:!![],'where':_0x51cf9c[_0x5786('0x18')]?_0x51cf9c[_0x5786('0x18')][_0x5786('0x1a')]||null:null,'attributes':_0x51cf9c[_0x5786('0x18')]?_0x51cf9c['options'][_0x5786('0x1b')]||null:null,'limit':_0x51cf9c[_0x5786('0x18')]?_0x51cf9c[_0x5786('0x18')]['limit']||null:null,'include':_0x51cf9c[_0x5786('0x18')]?_0x51cf9c[_0x5786('0x18')]['include']?_['map'](_0x51cf9c['options']['include'],function(_0x30f15f){return{'model':db[_0x30f15f[_0x5786('0x1c')]],'as':_0x30f15f['as'],'attributes':_0x30f15f[_0x5786('0x1b')],'include':_0x30f15f['include']?_[_0x5786('0x1d')](_0x30f15f[_0x5786('0x1e')],function(_0x2b80aa){return{'model':db[_0x2b80aa['model']],'as':_0x2b80aa['as'],'attributes':_0x2b80aa[_0x5786('0x1b')],'include':_0x2b80aa['include']?_['map'](_0x2b80aa[_0x5786('0x1e')],function(_0xc19531){return{'model':db[_0xc19531[_0x5786('0x1c')]],'as':_0xc19531['as'],'attributes':_0xc19531[_0x5786('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5786('0x1f')](function(_0x261f7e){logger[_0x5786('0x12')](_0x5786('0x15'),_0x51cf9c);logger[_0x5786('0x20')](_0x5786('0x15'),_0x51cf9c,JSON[_0x5786('0xf')](_0x261f7e));_0x176e23(_0x261f7e);})[_0x5786('0x14')](function(_0x3a114d){logger[_0x5786('0x10')]('GetVtigerAccount',_0x3a114d['message'],_0x51cf9c);_0x170059(_0x32ab94[_0x5786('0x10')](0x1f4,_0x3a114d['message']));});});};exports[_0x5786('0x21')]=function(_0x5f0e41){var _0x21d66c=this;return new Promise(function(_0x4c2abf,_0x1c682d){return db[_0x5786('0x16')][_0x5786('0x22')]({'raw':_0x5f0e41[_0x5786('0x18')]?_0x5f0e41['options'][_0x5786('0x19')]===undefined?!![]:![]:!![],'where':_0x5f0e41[_0x5786('0x18')]?_0x5f0e41[_0x5786('0x18')][_0x5786('0x1a')]||null:null,'attributes':_0x5f0e41[_0x5786('0x18')]?_0x5f0e41[_0x5786('0x18')][_0x5786('0x1b')]||null:null,'include':_0x5f0e41[_0x5786('0x18')]?_0x5f0e41['options'][_0x5786('0x1e')]?_[_0x5786('0x1d')](_0x5f0e41[_0x5786('0x18')][_0x5786('0x1e')],function(_0x509504){return{'model':db[_0x509504[_0x5786('0x1c')]],'as':_0x509504['as'],'attributes':_0x509504[_0x5786('0x1b')],'include':_0x509504[_0x5786('0x1e')]?_[_0x5786('0x1d')](_0x509504[_0x5786('0x1e')],function(_0x29b997){return{'model':db[_0x29b997['model']],'as':_0x29b997['as'],'attributes':_0x29b997['attributes'],'include':_0x29b997[_0x5786('0x1e')]?_[_0x5786('0x1d')](_0x29b997[_0x5786('0x1e')],function(_0x2647da){return{'model':db[_0x2647da[_0x5786('0x1c')]],'as':_0x2647da['as'],'attributes':_0x2647da[_0x5786('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5786('0x1f')](function(_0x34a573){logger[_0x5786('0x12')](_0x5786('0x21'),_0x5f0e41);logger[_0x5786('0x20')](_0x5786('0x21'),_0x5f0e41,JSON[_0x5786('0xf')](_0x34a573));_0x4c2abf(_0x34a573);})['catch'](function(_0xdc7868){logger['error'](_0x5786('0x21'),_0xdc7868[_0x5786('0x11')],_0x5f0e41);_0x1c682d(_0x21d66c[_0x5786('0x10')](0x1f4,_0xdc7868[_0x5786('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 4eff439..0239eb0 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(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb7e7[_0x126558];return _0x1f6d14;};'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 _0xcb91=['/:id/descriptions','getDescriptions','post','create','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects'];(function(_0x3034ce,_0x1421b6){var _0x4bc0e3=function(_0x49a5ca){while(--_0x49a5ca){_0x3034ce['push'](_0x3034ce['shift']());}};_0x4bc0e3(++_0x1421b6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xcb91[_0x452968];return _0xb6f9ae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./intVtigerConfiguration.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/fields',auth[_0x1cb9('0x7')](),controller['getFields']);router['get'](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x6')](_0x1cb9('0xc'),auth['isAuthenticated'](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x11')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x12')]);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 3ee7542..bfb18a4 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 _0xccff=['STRING','sequelize','exports'];(function(_0x12f283,_0x1c2efb){var _0x29db43=function(_0x515c6a){while(--_0x515c6a){_0x12f283['push'](_0x12f283['shift']());}};_0x29db43(++_0x1c2efb);}(_0xccff,0xd0));var _0xfccf=function(_0x509dad,_0x1f995f){_0x509dad=_0x509dad-0x0;var _0x21e122=_0xccff[_0x509dad];return _0x21e122;};'use strict';var Sequelize=require(_0xfccf('0x0'));module[_0xfccf('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfccf('0x2')]}}; \ No newline at end of file +var _0x5499=['exports','STRING','sequelize'];(function(_0x803f04,_0x40e90a){var _0x19fa63=function(_0x9425df){while(--_0x9425df){_0x803f04['push'](_0x803f04['shift']());}};_0x19fa63(++_0x40e90a);}(_0x5499,0x83));var _0x9549=function(_0x3b2bfb,_0x2fabce){_0x3b2bfb=_0x3b2bfb-0x0;var _0x4a3498=_0x5499[_0x3b2bfb];return _0x4a3498;};'use strict';var Sequelize=require(_0x9549('0x0'));module[_0x9549('0x1')]={'name':{'type':Sequelize[_0x9549('0x2')]},'description':{'type':Sequelize[_0x9549('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index b6ee9fa..fa8b07c 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 _0x2ffe=['findAll','show','params','find','create','body','findOne','VtigerField','map','getFields','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','limit','set','Content-Range','json','apply','reject','update','destroy','end','sendStatus','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','field','filter','options','VtigerConfiguration','count','includeAll','include'];(function(_0x4c5eb9,_0x5545f){var _0x25e2c6=function(_0x1f8a03){while(--_0x1f8a03){_0x4c5eb9['push'](_0x4c5eb9['shift']());}};_0x25e2c6(++_0x5545f);}(_0x2ffe,0x6a));var _0xe2ff=function(_0x2e6359,_0x854d95){_0x2e6359=_0x2e6359-0x0;var _0x26aa67=_0x2ffe[_0x2e6359];return _0x26aa67;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe2ff('0x0'));var rimraf=require(_0xe2ff('0x1'));var zipdir=require(_0xe2ff('0x2'));var jsonpatch=require(_0xe2ff('0x3'));var rp=require(_0xe2ff('0x4'));var moment=require('moment');var BPromise=require(_0xe2ff('0x5'));var Mustache=require(_0xe2ff('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe2ff('0x7'));var csv=require(_0xe2ff('0x8'));var ejs=require(_0xe2ff('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe2ff('0xa'));var crypto=require(_0xe2ff('0xb'));var jsforce=require(_0xe2ff('0xc'));var deskjs=require(_0xe2ff('0xd'));var toCsv=require(_0xe2ff('0x8'));var querystring=require(_0xe2ff('0xe'));var Papa=require(_0xe2ff('0xf'));var authService=require(_0xe2ff('0x10'));var hardwareService=require(_0xe2ff('0x11'));var Redis=require(_0xe2ff('0x12'));var qs=require(_0xe2ff('0x13'));var logger=require(_0xe2ff('0x14'))(_0xe2ff('0x15'));var utils=require(_0xe2ff('0x16'));var config=require(_0xe2ff('0x17'));var db=require(_0xe2ff('0x18'))['db'];var jayson=require(_0xe2ff('0x19'));var client=jayson['client'][_0xe2ff('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1e4519,_0x47f1c4,_0x1b2a6a,_0x3061e2){return new BPromise(function(_0x1c60ab,_0x300b70){var _0x19cee9=_0x3061e2||client;return _0x19cee9[_0xe2ff('0x1b')](_0x1e4519,_0x1b2a6a)[_0xe2ff('0x1c')](function(_0x96907c){logger[_0xe2ff('0x1d')](_0xe2ff('0x1e'),_0x47f1c4,_0xe2ff('0x1f'));logger[_0xe2ff('0x20')](_0xe2ff('0x21'),_0x47f1c4,_0xe2ff('0x1f'),JSON[_0xe2ff('0x22')](_0x96907c));if(_0x96907c[_0xe2ff('0x23')]){if(_0x96907c['error'][_0xe2ff('0x24')]===0x1f4){logger[_0xe2ff('0x23')](_0xe2ff('0x1e'),_0x47f1c4,_0x96907c[_0xe2ff('0x23')]['message']);return _0x300b70(_0x96907c[_0xe2ff('0x23')][_0xe2ff('0x25')]);}logger[_0xe2ff('0x23')](_0xe2ff('0x1e'),_0x47f1c4,_0x96907c[_0xe2ff('0x23')][_0xe2ff('0x25')]);return _0x1c60ab(_0x96907c[_0xe2ff('0x23')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x47f1c4,'request\x20sent');_0x1c60ab(_0x96907c[_0xe2ff('0x26')][_0xe2ff('0x25')]);}})[_0xe2ff('0x27')](function(_0x2b4d38){logger[_0xe2ff('0x23')](_0xe2ff('0x1e'),_0x47f1c4,_0x2b4d38);_0x300b70(_0x2b4d38);});});}function respondWithStatusCode(_0x335d9c,_0x1d0aa8){_0x1d0aa8=_0x1d0aa8||0xcc;return function(_0x12dc09){if(_0x12dc09){return _0x335d9c['sendStatus'](_0x1d0aa8);}return _0x335d9c[_0xe2ff('0x28')](_0x1d0aa8)['end']();};}function respondWithResult(_0xa6ad9,_0xf16952){_0xf16952=_0xf16952||0xc8;return function(_0x495bb2){if(_0x495bb2){return _0xa6ad9[_0xe2ff('0x28')](_0xf16952)['json'](_0x495bb2);}};}function respondWithFilteredResult(_0x5265b5,_0x497890){return function(_0x373529){if(_0x373529){var _0x4a2954=_0x373529['count'],_0x5582ef=_0x497890['offset'],_0x1a6fcd=_0x497890[_0xe2ff('0x29')]+_0x497890[_0xe2ff('0x2a')],_0x143ed9;if(_0x1a6fcd>=_0x4a2954){_0x1a6fcd=_0x4a2954;_0x143ed9=0xc8;}else{_0x143ed9=0xce;}_0x5265b5[_0xe2ff('0x28')](_0x143ed9);return _0x5265b5[_0xe2ff('0x2b')](_0xe2ff('0x2c'),_0x5582ef+'-'+_0x1a6fcd+'/'+_0x4a2954)[_0xe2ff('0x2d')](_0x373529);}return null;};}function patchUpdates(_0x5baeab){return function(_0xac598b){try{jsonpatch[_0xe2ff('0x2e')](_0xac598b,_0x5baeab,!![]);}catch(_0x42cae4){return BPromise[_0xe2ff('0x2f')](_0x42cae4);}return _0xac598b['save']();};}function saveUpdates(_0xb4ca2a,_0x1da1c8){return function(_0x5e14d9){if(_0x5e14d9){return _0x5e14d9[_0xe2ff('0x30')](_0xb4ca2a)[_0xe2ff('0x1c')](function(_0x32a533){return _0x32a533;});}return null;};}function removeEntity(_0x4c5570,_0x21a601){return function(_0x1034f8){if(_0x1034f8){return _0x1034f8[_0xe2ff('0x31')]()[_0xe2ff('0x1c')](function(){_0x4c5570[_0xe2ff('0x28')](0xcc)[_0xe2ff('0x32')]();});}};}function handleEntityNotFound(_0x4184f3,_0x14fafe){return function(_0x49a4f1){if(!_0x49a4f1){_0x4184f3[_0xe2ff('0x33')](0x194);}return _0x49a4f1;};}function handleError(_0xa8139b,_0x136508){_0x136508=_0x136508||0x1f4;return function(_0x5481ca){logger['error'](_0x5481ca['stack']);if(_0x5481ca['name']){delete _0x5481ca[_0xe2ff('0x34')];}_0xa8139b[_0xe2ff('0x28')](_0x136508)[_0xe2ff('0x35')](_0x5481ca);};}exports[_0xe2ff('0x36')]=function(_0x20403c,_0x41aed6){var _0x7b6050={},_0x519bc2={},_0x3c38be={'count':0x0,'rows':[]};var _0x2fbb29=db['VtigerConfiguration'][_0xe2ff('0x37')];_0x519bc2['model']=_[_0xe2ff('0x38')](_0x2fbb29);_0x519bc2[_0xe2ff('0x39')]=_['keys'](_0x20403c[_0xe2ff('0x39')]);_0x519bc2[_0xe2ff('0x3a')]=_[_0xe2ff('0x3b')](_0x519bc2[_0xe2ff('0x3c')],_0x519bc2['query']);_0x7b6050['attributes']=_[_0xe2ff('0x3b')](_0x519bc2[_0xe2ff('0x3c')],qs[_0xe2ff('0x3d')](_0x20403c['query'][_0xe2ff('0x3d')]));_0x7b6050[_0xe2ff('0x3e')]=_0x7b6050[_0xe2ff('0x3e')][_0xe2ff('0x3f')]?_0x7b6050[_0xe2ff('0x3e')]:_0x519bc2[_0xe2ff('0x3c')];if(!_0x20403c['query'][_0xe2ff('0x40')](_0xe2ff('0x41'))){_0x7b6050[_0xe2ff('0x2a')]=qs[_0xe2ff('0x2a')](_0x20403c[_0xe2ff('0x39')][_0xe2ff('0x2a')]);_0x7b6050[_0xe2ff('0x29')]=qs[_0xe2ff('0x29')](_0x20403c['query'][_0xe2ff('0x29')]);}_0x7b6050[_0xe2ff('0x42')]=qs[_0xe2ff('0x43')](_0x20403c[_0xe2ff('0x39')][_0xe2ff('0x43')]);_0x7b6050[_0xe2ff('0x44')]=qs[_0xe2ff('0x3a')](_['pick'](_0x20403c[_0xe2ff('0x39')],_0x519bc2['filters']));if(_0x20403c['query']['filter']){_0x7b6050[_0xe2ff('0x44')]=_[_0xe2ff('0x45')](_0x7b6050[_0xe2ff('0x44')],{'$or':_['map'](_0x2fbb29,function(_0x3f4572){if(_0x3f4572[_0xe2ff('0x46')][_0xe2ff('0x47')]!==_0xe2ff('0x48')){var _0x3961aa={};_0x3961aa[_0x3f4572[_0xe2ff('0x49')]]={'$like':'%'+_0x20403c[_0xe2ff('0x39')][_0xe2ff('0x4a')]+'%'};return _0x3961aa;}})});}_0x7b6050=_[_0xe2ff('0x45')]({},_0x7b6050,_0x20403c[_0xe2ff('0x4b')]);var _0x1e4c4d={'where':_0x7b6050[_0xe2ff('0x44')]};return db[_0xe2ff('0x4c')][_0xe2ff('0x4d')](_0x1e4c4d)[_0xe2ff('0x1c')](function(_0xa3d34){_0x3c38be[_0xe2ff('0x4d')]=_0xa3d34;if(_0x20403c[_0xe2ff('0x39')][_0xe2ff('0x4e')]){_0x7b6050[_0xe2ff('0x4f')]=[{'all':!![]}];}return db[_0xe2ff('0x4c')][_0xe2ff('0x50')](_0x7b6050);})[_0xe2ff('0x1c')](function(_0xa15a79){_0x3c38be['rows']=_0xa15a79;return _0x3c38be;})[_0xe2ff('0x1c')](respondWithFilteredResult(_0x41aed6,_0x7b6050))['catch'](handleError(_0x41aed6,null));};exports[_0xe2ff('0x51')]=function(_0x27ecaa,_0x12c5dd){var _0x9ddb96={'raw':![],'where':{'id':_0x27ecaa[_0xe2ff('0x52')]['id']}},_0x4acdcb={};_0x4acdcb[_0xe2ff('0x3c')]=_['keys'](db[_0xe2ff('0x4c')]['rawAttributes']);_0x4acdcb[_0xe2ff('0x39')]=_[_0xe2ff('0x38')](_0x27ecaa['query']);_0x4acdcb[_0xe2ff('0x3a')]=_[_0xe2ff('0x3b')](_0x4acdcb['model'],_0x4acdcb['query']);_0x9ddb96[_0xe2ff('0x3e')]=_['intersection'](_0x4acdcb[_0xe2ff('0x3c')],qs[_0xe2ff('0x3d')](_0x27ecaa[_0xe2ff('0x39')][_0xe2ff('0x3d')]));_0x9ddb96[_0xe2ff('0x3e')]=_0x9ddb96[_0xe2ff('0x3e')][_0xe2ff('0x3f')]?_0x9ddb96['attributes']:_0x4acdcb[_0xe2ff('0x3c')];if(_0x27ecaa[_0xe2ff('0x39')][_0xe2ff('0x4e')]){_0x9ddb96[_0xe2ff('0x4f')]=[{'all':!![]}];}_0x9ddb96=_['merge']({},_0x9ddb96,_0x27ecaa[_0xe2ff('0x4b')]);return db[_0xe2ff('0x4c')][_0xe2ff('0x53')](_0x9ddb96)['then'](handleEntityNotFound(_0x12c5dd,null))['then'](respondWithResult(_0x12c5dd,null))[_0xe2ff('0x27')](handleError(_0x12c5dd,null));};exports[_0xe2ff('0x54')]=function(_0x53939a,_0x9934c0){return db[_0xe2ff('0x4c')]['create'](_0x53939a['body'],{})['then'](respondWithResult(_0x9934c0,0xc9))['catch'](handleError(_0x9934c0,null));};exports[_0xe2ff('0x30')]=function(_0x323acf,_0x218044){if(_0x323acf[_0xe2ff('0x55')]['id']){delete _0x323acf['body']['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x323acf[_0xe2ff('0x52')]['id']}})['then'](handleEntityNotFound(_0x218044,null))['then'](saveUpdates(_0x323acf[_0xe2ff('0x55')],null))['then'](respondWithResult(_0x218044,null))[_0xe2ff('0x27')](handleError(_0x218044,null));};exports[_0xe2ff('0x31')]=function(_0x3ae1a7,_0x576d06){return db[_0xe2ff('0x4c')]['find']({'where':{'id':_0x3ae1a7['params']['id']}})['then'](handleEntityNotFound(_0x576d06,null))['then'](removeEntity(_0x576d06,null))[_0xe2ff('0x27')](handleError(_0x576d06,null));};exports['getFields']=function(_0x5b641f,_0x595331,_0x5a2ae2){var _0x21b874={};var _0x3a4ec2={};var _0x19b1c2;var _0xa60f1c;return db[_0xe2ff('0x4c')][_0xe2ff('0x56')]({'where':{'id':_0x5b641f[_0xe2ff('0x52')]['id']}})['then'](handleEntityNotFound(_0x595331,null))[_0xe2ff('0x1c')](function(_0x3eb46e){if(_0x3eb46e){_0x19b1c2=_0x3eb46e;_0x3a4ec2[_0xe2ff('0x3c')]=_[_0xe2ff('0x38')](db[_0xe2ff('0x57')]['rawAttributes']);_0x3a4ec2[_0xe2ff('0x39')]=_[_0xe2ff('0x38')](_0x5b641f[_0xe2ff('0x39')]);_0x3a4ec2[_0xe2ff('0x3a')]=_[_0xe2ff('0x3b')](_0x3a4ec2[_0xe2ff('0x3c')],_0x3a4ec2[_0xe2ff('0x39')]);_0x21b874[_0xe2ff('0x3e')]=_[_0xe2ff('0x3b')](_0x3a4ec2[_0xe2ff('0x3c')],qs['fields'](_0x5b641f[_0xe2ff('0x39')][_0xe2ff('0x3d')]));_0x21b874[_0xe2ff('0x3e')]=_0x21b874[_0xe2ff('0x3e')][_0xe2ff('0x3f')]?_0x21b874[_0xe2ff('0x3e')]:_0x3a4ec2[_0xe2ff('0x3c')];_0x21b874['order']=qs[_0xe2ff('0x43')](_0x5b641f['query']['sort']);_0x21b874[_0xe2ff('0x44')]=qs[_0xe2ff('0x3a')](_['pick'](_0x5b641f[_0xe2ff('0x39')],_0x3a4ec2[_0xe2ff('0x3a')]));if(_0x5b641f[_0xe2ff('0x39')][_0xe2ff('0x4a')]){_0x21b874[_0xe2ff('0x44')]=_['merge'](_0x21b874[_0xe2ff('0x44')],{'$or':_[_0xe2ff('0x58')](_0x21b874[_0xe2ff('0x3e')],function(_0x5d6e0e){var _0x157d3c={};_0x157d3c[_0x5d6e0e]={'$like':'%'+_0x5b641f[_0xe2ff('0x39')][_0xe2ff('0x4a')]+'%'};return _0x157d3c;})});}_0x21b874=_[_0xe2ff('0x45')]({},_0x21b874,_0x5b641f[_0xe2ff('0x4b')]);return _0x19b1c2[_0xe2ff('0x59')](_0x21b874);}})[_0xe2ff('0x1c')](function(_0x42e731){if(_0x42e731){_0xa60f1c=_0x42e731['length'];if(!_0x5b641f[_0xe2ff('0x39')]['hasOwnProperty']('nolimit')){_0x21b874[_0xe2ff('0x2a')]=qs[_0xe2ff('0x2a')](_0x5b641f[_0xe2ff('0x39')]['limit']);_0x21b874[_0xe2ff('0x29')]=qs['offset'](_0x5b641f[_0xe2ff('0x39')][_0xe2ff('0x29')]);}return _0x19b1c2[_0xe2ff('0x59')](_0x21b874);}})[_0xe2ff('0x1c')](function(_0x2fb229){if(_0x2fb229){return _0x2fb229?{'count':_0xa60f1c,'rows':_0x2fb229}:null;}})[_0xe2ff('0x1c')](respondWithResult(_0x595331,null))[_0xe2ff('0x27')](handleError(_0x595331,null));};exports['getSubjects']=function(_0x2936e9,_0x13a6c1,_0x2c03b7){var _0x208e48={};var _0x55071b={};var _0x52fb2f;var _0x119acc;return db[_0xe2ff('0x4c')][_0xe2ff('0x56')]({'where':{'id':_0x2936e9[_0xe2ff('0x52')]['id']}})[_0xe2ff('0x1c')](handleEntityNotFound(_0x13a6c1,null))['then'](function(_0x33ca34){if(_0x33ca34){_0x52fb2f=_0x33ca34;_0x55071b['model']=_[_0xe2ff('0x38')](db[_0xe2ff('0x57')]['rawAttributes']);_0x55071b[_0xe2ff('0x39')]=_[_0xe2ff('0x38')](_0x2936e9[_0xe2ff('0x39')]);_0x55071b['filters']=_[_0xe2ff('0x3b')](_0x55071b[_0xe2ff('0x3c')],_0x55071b['query']);_0x208e48[_0xe2ff('0x3e')]=_[_0xe2ff('0x3b')](_0x55071b['model'],qs[_0xe2ff('0x3d')](_0x2936e9[_0xe2ff('0x39')][_0xe2ff('0x3d')]));_0x208e48['attributes']=_0x208e48[_0xe2ff('0x3e')][_0xe2ff('0x3f')]?_0x208e48[_0xe2ff('0x3e')]:_0x55071b[_0xe2ff('0x3c')];_0x208e48[_0xe2ff('0x42')]=qs['sort'](_0x2936e9['query'][_0xe2ff('0x43')]);_0x208e48['where']=qs['filters'](_[_0xe2ff('0x5a')](_0x2936e9['query'],_0x55071b[_0xe2ff('0x3a')]));if(_0x2936e9[_0xe2ff('0x39')][_0xe2ff('0x4a')]){_0x208e48[_0xe2ff('0x44')]=_['merge'](_0x208e48[_0xe2ff('0x44')],{'$or':_[_0xe2ff('0x58')](_0x208e48[_0xe2ff('0x3e')],function(_0x58435a){var _0x28ee94={};_0x28ee94[_0x58435a]={'$like':'%'+_0x2936e9[_0xe2ff('0x39')][_0xe2ff('0x4a')]+'%'};return _0x28ee94;})});}_0x208e48=_[_0xe2ff('0x45')]({},_0x208e48,_0x2936e9[_0xe2ff('0x4b')]);return _0x52fb2f['getSubjects'](_0x208e48);}})['then'](function(_0x1f214f){if(_0x1f214f){_0x119acc=_0x1f214f[_0xe2ff('0x3f')];if(!_0x2936e9[_0xe2ff('0x39')]['hasOwnProperty'](_0xe2ff('0x41'))){_0x208e48[_0xe2ff('0x2a')]=qs[_0xe2ff('0x2a')](_0x2936e9[_0xe2ff('0x39')][_0xe2ff('0x2a')]);_0x208e48[_0xe2ff('0x29')]=qs['offset'](_0x2936e9[_0xe2ff('0x39')][_0xe2ff('0x29')]);}return _0x52fb2f[_0xe2ff('0x5b')](_0x208e48);}})['then'](function(_0x2c7ac5){if(_0x2c7ac5){return _0x2c7ac5?{'count':_0x119acc,'rows':_0x2c7ac5}:null;}})[_0xe2ff('0x1c')](respondWithResult(_0x13a6c1,null))[_0xe2ff('0x27')](handleError(_0x13a6c1,null));};exports[_0xe2ff('0x5c')]=function(_0x3f16a7,_0x2d5a79,_0x545a8e){var _0x14ba6c={};var _0xe1827c={};var _0x583d01;var _0x42cd72;return db[_0xe2ff('0x4c')][_0xe2ff('0x56')]({'where':{'id':_0x3f16a7[_0xe2ff('0x52')]['id']}})[_0xe2ff('0x1c')](handleEntityNotFound(_0x2d5a79,null))[_0xe2ff('0x1c')](function(_0x4364fe){if(_0x4364fe){_0x583d01=_0x4364fe;_0xe1827c[_0xe2ff('0x3c')]=_[_0xe2ff('0x38')](db[_0xe2ff('0x57')][_0xe2ff('0x37')]);_0xe1827c[_0xe2ff('0x39')]=_['keys'](_0x3f16a7['query']);_0xe1827c[_0xe2ff('0x3a')]=_[_0xe2ff('0x3b')](_0xe1827c[_0xe2ff('0x3c')],_0xe1827c[_0xe2ff('0x39')]);_0x14ba6c[_0xe2ff('0x3e')]=_[_0xe2ff('0x3b')](_0xe1827c['model'],qs['fields'](_0x3f16a7['query'][_0xe2ff('0x3d')]));_0x14ba6c['attributes']=_0x14ba6c[_0xe2ff('0x3e')][_0xe2ff('0x3f')]?_0x14ba6c[_0xe2ff('0x3e')]:_0xe1827c[_0xe2ff('0x3c')];_0x14ba6c[_0xe2ff('0x42')]=qs['sort'](_0x3f16a7[_0xe2ff('0x39')][_0xe2ff('0x43')]);_0x14ba6c['where']=qs[_0xe2ff('0x3a')](_[_0xe2ff('0x5a')](_0x3f16a7[_0xe2ff('0x39')],_0xe1827c[_0xe2ff('0x3a')]));if(_0x3f16a7[_0xe2ff('0x39')][_0xe2ff('0x4a')]){_0x14ba6c['where']=_[_0xe2ff('0x45')](_0x14ba6c[_0xe2ff('0x44')],{'$or':_['map'](_0x14ba6c[_0xe2ff('0x3e')],function(_0x4bb982){var _0x2f5550={};_0x2f5550[_0x4bb982]={'$like':'%'+_0x3f16a7[_0xe2ff('0x39')][_0xe2ff('0x4a')]+'%'};return _0x2f5550;})});}_0x14ba6c=_[_0xe2ff('0x45')]({},_0x14ba6c,_0x3f16a7[_0xe2ff('0x4b')]);return _0x583d01['getDescriptions'](_0x14ba6c);}})['then'](function(_0x2e7f6d){if(_0x2e7f6d){_0x42cd72=_0x2e7f6d[_0xe2ff('0x3f')];if(!_0x3f16a7[_0xe2ff('0x39')]['hasOwnProperty']('nolimit')){_0x14ba6c[_0xe2ff('0x2a')]=qs['limit'](_0x3f16a7[_0xe2ff('0x39')][_0xe2ff('0x2a')]);_0x14ba6c[_0xe2ff('0x29')]=qs[_0xe2ff('0x29')](_0x3f16a7['query']['offset']);}return _0x583d01['getDescriptions'](_0x14ba6c);}})['then'](function(_0x411288){if(_0x411288){return _0x411288?{'count':_0x42cd72,'rows':_0x411288}:null;}})[_0xe2ff('0x1c')](respondWithResult(_0x2d5a79,null))[_0xe2ff('0x27')](handleError(_0x2d5a79,null));}; \ No newline at end of file +var _0x2ace=['merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','params','destroy','getFields','findOne','VtigerField','filter','map','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','count','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','VtigerConfiguration','rawAttributes','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','offset','order','sort','pick','where'];(function(_0x3b3fa4,_0x1d2a23){var _0x277d19=function(_0x548da2){while(--_0x548da2){_0x3b3fa4['push'](_0x3b3fa4['shift']());}};_0x277d19(++_0x1d2a23);}(_0x2ace,0x17e));var _0xe2ac=function(_0x9861ff,_0x41fb17){_0x9861ff=_0x9861ff-0x0;var _0x48852b=_0x2ace[_0x9861ff];return _0x48852b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe2ac('0x0'));var rimraf=require(_0xe2ac('0x1'));var zipdir=require(_0xe2ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ac('0x3'));var moment=require(_0xe2ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2ac('0x5'));var util=require(_0xe2ac('0x6'));var path=require(_0xe2ac('0x7'));var sox=require(_0xe2ac('0x8'));var csv=require(_0xe2ac('0x9'));var ejs=require(_0xe2ac('0xa'));var fs=require('fs');var _=require(_0xe2ac('0xb'));var squel=require(_0xe2ac('0xc'));var crypto=require(_0xe2ac('0xd'));var jsforce=require(_0xe2ac('0xe'));var deskjs=require(_0xe2ac('0xf'));var toCsv=require(_0xe2ac('0x9'));var querystring=require(_0xe2ac('0x10'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xe2ac('0x11'));var Redis=require('ioredis');var qs=require(_0xe2ac('0x12'));var logger=require(_0xe2ac('0x13'))('api');var utils=require(_0xe2ac('0x14'));var config=require(_0xe2ac('0x15'));var db=require(_0xe2ac('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe2ac('0x17')][_0xe2ac('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x199773,_0x109a2d,_0x346dc4,_0x5ee9ca){return new BPromise(function(_0x76dab9,_0x5c3425){var _0x4404d7=_0x5ee9ca||client;return _0x4404d7[_0xe2ac('0x19')](_0x199773,_0x346dc4)[_0xe2ac('0x1a')](function(_0x290584){logger[_0xe2ac('0x1b')](_0xe2ac('0x1c'),_0x109a2d,_0xe2ac('0x1d'));logger[_0xe2ac('0x1e')](_0xe2ac('0x1f'),_0x109a2d,'request\x20sent',JSON[_0xe2ac('0x20')](_0x290584));if(_0x290584[_0xe2ac('0x21')]){if(_0x290584['error'][_0xe2ac('0x22')]===0x1f4){logger[_0xe2ac('0x21')](_0xe2ac('0x1c'),_0x109a2d,_0x290584[_0xe2ac('0x21')]['message']);return _0x5c3425(_0x290584['error']['message']);}logger[_0xe2ac('0x21')](_0xe2ac('0x1c'),_0x109a2d,_0x290584[_0xe2ac('0x21')][_0xe2ac('0x23')]);return _0x76dab9(_0x290584[_0xe2ac('0x21')][_0xe2ac('0x23')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x109a2d,_0xe2ac('0x1d'));_0x76dab9(_0x290584['result'][_0xe2ac('0x23')]);}})[_0xe2ac('0x24')](function(_0x2083b3){logger[_0xe2ac('0x21')](_0xe2ac('0x1c'),_0x109a2d,_0x2083b3);_0x5c3425(_0x2083b3);});});}function respondWithStatusCode(_0x1224c5,_0x504ffd){_0x504ffd=_0x504ffd||0xcc;return function(_0x20a59e){if(_0x20a59e){return _0x1224c5[_0xe2ac('0x25')](_0x504ffd);}return _0x1224c5['status'](_0x504ffd)['end']();};}function respondWithResult(_0x2f6220,_0x4c9981){_0x4c9981=_0x4c9981||0xc8;return function(_0x1eafd7){if(_0x1eafd7){return _0x2f6220[_0xe2ac('0x26')](_0x4c9981)['json'](_0x1eafd7);}};}function respondWithFilteredResult(_0x192649,_0x47b950){return function(_0x20dc3f){if(_0x20dc3f){var _0xffd8c7=_0x20dc3f[_0xe2ac('0x27')],_0x1000e6=_0x47b950['offset'],_0x557cb2=_0x47b950['offset']+_0x47b950[_0xe2ac('0x28')],_0x2702cd;if(_0x557cb2>=_0xffd8c7){_0x557cb2=_0xffd8c7;_0x2702cd=0xc8;}else{_0x2702cd=0xce;}_0x192649[_0xe2ac('0x26')](_0x2702cd);return _0x192649[_0xe2ac('0x29')](_0xe2ac('0x2a'),_0x1000e6+'-'+_0x557cb2+'/'+_0xffd8c7)['json'](_0x20dc3f);}return null;};}function patchUpdates(_0x2ccd98){return function(_0x5f32e8){try{jsonpatch[_0xe2ac('0x2b')](_0x5f32e8,_0x2ccd98,!![]);}catch(_0x1d8031){return BPromise[_0xe2ac('0x2c')](_0x1d8031);}return _0x5f32e8[_0xe2ac('0x2d')]();};}function saveUpdates(_0x28c1a0,_0x25a70e){return function(_0x49335e){if(_0x49335e){return _0x49335e[_0xe2ac('0x2e')](_0x28c1a0)['then'](function(_0x493d18){return _0x493d18;});}return null;};}function removeEntity(_0x52f008,_0x2e4984){return function(_0x298397){if(_0x298397){return _0x298397['destroy']()[_0xe2ac('0x1a')](function(){_0x52f008[_0xe2ac('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9299,_0x972c9b){return function(_0x58d8bb){if(!_0x58d8bb){_0x2f9299['sendStatus'](0x194);}return _0x58d8bb;};}function handleError(_0xd4db2a,_0x5d34a2){_0x5d34a2=_0x5d34a2||0x1f4;return function(_0x1fa079){logger[_0xe2ac('0x21')](_0x1fa079[_0xe2ac('0x2f')]);if(_0x1fa079[_0xe2ac('0x30')]){delete _0x1fa079[_0xe2ac('0x30')];}_0xd4db2a[_0xe2ac('0x26')](_0x5d34a2)[_0xe2ac('0x31')](_0x1fa079);};}exports[_0xe2ac('0x32')]=function(_0x16a023,_0x4ced94){var _0x14cb81={},_0x6f66e0={},_0x1c3cd6={'count':0x0,'rows':[]};var _0x3eb37c=db[_0xe2ac('0x33')][_0xe2ac('0x34')];_0x6f66e0['model']=_[_0xe2ac('0x35')](_0x3eb37c);_0x6f66e0['query']=_[_0xe2ac('0x35')](_0x16a023[_0xe2ac('0x36')]);_0x6f66e0[_0xe2ac('0x37')]=_[_0xe2ac('0x38')](_0x6f66e0['model'],_0x6f66e0[_0xe2ac('0x36')]);_0x14cb81['attributes']=_['intersection'](_0x6f66e0['model'],qs['fields'](_0x16a023[_0xe2ac('0x36')][_0xe2ac('0x39')]));_0x14cb81['attributes']=_0x14cb81[_0xe2ac('0x3a')][_0xe2ac('0x3b')]?_0x14cb81[_0xe2ac('0x3a')]:_0x6f66e0[_0xe2ac('0x3c')];if(!_0x16a023[_0xe2ac('0x36')][_0xe2ac('0x3d')](_0xe2ac('0x3e'))){_0x14cb81['limit']=qs[_0xe2ac('0x28')](_0x16a023['query']['limit']);_0x14cb81[_0xe2ac('0x3f')]=qs[_0xe2ac('0x3f')](_0x16a023[_0xe2ac('0x36')][_0xe2ac('0x3f')]);}_0x14cb81[_0xe2ac('0x40')]=qs[_0xe2ac('0x41')](_0x16a023[_0xe2ac('0x36')][_0xe2ac('0x41')]);_0x14cb81['where']=qs[_0xe2ac('0x37')](_[_0xe2ac('0x42')](_0x16a023[_0xe2ac('0x36')],_0x6f66e0[_0xe2ac('0x37')]));if(_0x16a023[_0xe2ac('0x36')]['filter']){_0x14cb81[_0xe2ac('0x43')]=_[_0xe2ac('0x44')](_0x14cb81['where'],{'$or':_['map'](_0x3eb37c,function(_0x3f95fd){if(_0x3f95fd[_0xe2ac('0x45')][_0xe2ac('0x46')]!==_0xe2ac('0x47')){var _0x1e9da7={};_0x1e9da7[_0x3f95fd['field']]={'$like':'%'+_0x16a023[_0xe2ac('0x36')]['filter']+'%'};return _0x1e9da7;}})});}_0x14cb81=_[_0xe2ac('0x44')]({},_0x14cb81,_0x16a023[_0xe2ac('0x48')]);var _0x24d6ea={'where':_0x14cb81['where']};return db[_0xe2ac('0x33')][_0xe2ac('0x27')](_0x24d6ea)[_0xe2ac('0x1a')](function(_0xbb443a){_0x1c3cd6[_0xe2ac('0x27')]=_0xbb443a;if(_0x16a023[_0xe2ac('0x36')][_0xe2ac('0x49')]){_0x14cb81[_0xe2ac('0x4a')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xe2ac('0x4b')](_0x14cb81);})['then'](function(_0x4c4116){_0x1c3cd6[_0xe2ac('0x4c')]=_0x4c4116;return _0x1c3cd6;})[_0xe2ac('0x1a')](respondWithFilteredResult(_0x4ced94,_0x14cb81))[_0xe2ac('0x24')](handleError(_0x4ced94,null));};exports[_0xe2ac('0x4d')]=function(_0x43b7d7,_0x21e7e5){var _0x3715ad={'raw':![],'where':{'id':_0x43b7d7['params']['id']}},_0x7601e4={};_0x7601e4[_0xe2ac('0x3c')]=_['keys'](db[_0xe2ac('0x33')][_0xe2ac('0x34')]);_0x7601e4[_0xe2ac('0x36')]=_[_0xe2ac('0x35')](_0x43b7d7[_0xe2ac('0x36')]);_0x7601e4[_0xe2ac('0x37')]=_['intersection'](_0x7601e4['model'],_0x7601e4['query']);_0x3715ad[_0xe2ac('0x3a')]=_[_0xe2ac('0x38')](_0x7601e4[_0xe2ac('0x3c')],qs[_0xe2ac('0x39')](_0x43b7d7[_0xe2ac('0x36')]['fields']));_0x3715ad['attributes']=_0x3715ad[_0xe2ac('0x3a')]['length']?_0x3715ad['attributes']:_0x7601e4[_0xe2ac('0x3c')];if(_0x43b7d7[_0xe2ac('0x36')][_0xe2ac('0x49')]){_0x3715ad[_0xe2ac('0x4a')]=[{'all':!![]}];}_0x3715ad=_[_0xe2ac('0x44')]({},_0x3715ad,_0x43b7d7[_0xe2ac('0x48')]);return db[_0xe2ac('0x33')][_0xe2ac('0x4e')](_0x3715ad)[_0xe2ac('0x1a')](handleEntityNotFound(_0x21e7e5,null))[_0xe2ac('0x1a')](respondWithResult(_0x21e7e5,null))['catch'](handleError(_0x21e7e5,null));};exports[_0xe2ac('0x4f')]=function(_0x1a407f,_0x573f86){return db[_0xe2ac('0x33')][_0xe2ac('0x4f')](_0x1a407f['body'],{})[_0xe2ac('0x1a')](respondWithResult(_0x573f86,0xc9))[_0xe2ac('0x24')](handleError(_0x573f86,null));};exports['update']=function(_0x146076,_0x633f72){if(_0x146076['body']['id']){delete _0x146076[_0xe2ac('0x50')]['id'];}return db[_0xe2ac('0x33')][_0xe2ac('0x4e')]({'where':{'id':_0x146076[_0xe2ac('0x51')]['id']}})['then'](handleEntityNotFound(_0x633f72,null))[_0xe2ac('0x1a')](saveUpdates(_0x146076['body'],null))[_0xe2ac('0x1a')](respondWithResult(_0x633f72,null))[_0xe2ac('0x24')](handleError(_0x633f72,null));};exports[_0xe2ac('0x52')]=function(_0xc50d68,_0x318b3f){return db['VtigerConfiguration'][_0xe2ac('0x4e')]({'where':{'id':_0xc50d68[_0xe2ac('0x51')]['id']}})[_0xe2ac('0x1a')](handleEntityNotFound(_0x318b3f,null))[_0xe2ac('0x1a')](removeEntity(_0x318b3f,null))[_0xe2ac('0x24')](handleError(_0x318b3f,null));};exports[_0xe2ac('0x53')]=function(_0x56eef8,_0x33b635,_0x13cbd0){var _0x3d9be6={};var _0x1add6e={};var _0x42c009;var _0xceaf52;return db[_0xe2ac('0x33')][_0xe2ac('0x54')]({'where':{'id':_0x56eef8['params']['id']}})['then'](handleEntityNotFound(_0x33b635,null))[_0xe2ac('0x1a')](function(_0x2dfe56){if(_0x2dfe56){_0x42c009=_0x2dfe56;_0x1add6e['model']=_[_0xe2ac('0x35')](db[_0xe2ac('0x55')][_0xe2ac('0x34')]);_0x1add6e[_0xe2ac('0x36')]=_['keys'](_0x56eef8['query']);_0x1add6e['filters']=_[_0xe2ac('0x38')](_0x1add6e[_0xe2ac('0x3c')],_0x1add6e[_0xe2ac('0x36')]);_0x3d9be6[_0xe2ac('0x3a')]=_[_0xe2ac('0x38')](_0x1add6e['model'],qs[_0xe2ac('0x39')](_0x56eef8[_0xe2ac('0x36')][_0xe2ac('0x39')]));_0x3d9be6[_0xe2ac('0x3a')]=_0x3d9be6[_0xe2ac('0x3a')][_0xe2ac('0x3b')]?_0x3d9be6[_0xe2ac('0x3a')]:_0x1add6e[_0xe2ac('0x3c')];_0x3d9be6[_0xe2ac('0x40')]=qs[_0xe2ac('0x41')](_0x56eef8['query'][_0xe2ac('0x41')]);_0x3d9be6[_0xe2ac('0x43')]=qs['filters'](_['pick'](_0x56eef8['query'],_0x1add6e[_0xe2ac('0x37')]));if(_0x56eef8[_0xe2ac('0x36')][_0xe2ac('0x56')]){_0x3d9be6[_0xe2ac('0x43')]=_[_0xe2ac('0x44')](_0x3d9be6[_0xe2ac('0x43')],{'$or':_[_0xe2ac('0x57')](_0x3d9be6['attributes'],function(_0x13f049){var _0x1856bd={};_0x1856bd[_0x13f049]={'$like':'%'+_0x56eef8['query'][_0xe2ac('0x56')]+'%'};return _0x1856bd;})});}_0x3d9be6=_[_0xe2ac('0x44')]({},_0x3d9be6,_0x56eef8['options']);return _0x42c009[_0xe2ac('0x53')](_0x3d9be6);}})[_0xe2ac('0x1a')](function(_0x2091a2){if(_0x2091a2){_0xceaf52=_0x2091a2[_0xe2ac('0x3b')];if(!_0x56eef8[_0xe2ac('0x36')]['hasOwnProperty'](_0xe2ac('0x3e'))){_0x3d9be6[_0xe2ac('0x28')]=qs[_0xe2ac('0x28')](_0x56eef8[_0xe2ac('0x36')]['limit']);_0x3d9be6[_0xe2ac('0x3f')]=qs[_0xe2ac('0x3f')](_0x56eef8[_0xe2ac('0x36')]['offset']);}return _0x42c009[_0xe2ac('0x53')](_0x3d9be6);}})[_0xe2ac('0x1a')](function(_0x2f5787){if(_0x2f5787){return _0x2f5787?{'count':_0xceaf52,'rows':_0x2f5787}:null;}})[_0xe2ac('0x1a')](respondWithResult(_0x33b635,null))[_0xe2ac('0x24')](handleError(_0x33b635,null));};exports[_0xe2ac('0x58')]=function(_0x133501,_0x570968,_0x135192){var _0x2b8212={};var _0x3d1cc2={};var _0x59ab47;var _0x127c17;return db[_0xe2ac('0x33')]['findOne']({'where':{'id':_0x133501[_0xe2ac('0x51')]['id']}})['then'](handleEntityNotFound(_0x570968,null))['then'](function(_0x4b52f1){if(_0x4b52f1){_0x59ab47=_0x4b52f1;_0x3d1cc2[_0xe2ac('0x3c')]=_[_0xe2ac('0x35')](db['VtigerField'][_0xe2ac('0x34')]);_0x3d1cc2['query']=_[_0xe2ac('0x35')](_0x133501[_0xe2ac('0x36')]);_0x3d1cc2[_0xe2ac('0x37')]=_[_0xe2ac('0x38')](_0x3d1cc2['model'],_0x3d1cc2[_0xe2ac('0x36')]);_0x2b8212[_0xe2ac('0x3a')]=_['intersection'](_0x3d1cc2[_0xe2ac('0x3c')],qs[_0xe2ac('0x39')](_0x133501[_0xe2ac('0x36')]['fields']));_0x2b8212[_0xe2ac('0x3a')]=_0x2b8212['attributes']['length']?_0x2b8212[_0xe2ac('0x3a')]:_0x3d1cc2[_0xe2ac('0x3c')];_0x2b8212[_0xe2ac('0x40')]=qs['sort'](_0x133501['query']['sort']);_0x2b8212[_0xe2ac('0x43')]=qs[_0xe2ac('0x37')](_[_0xe2ac('0x42')](_0x133501[_0xe2ac('0x36')],_0x3d1cc2['filters']));if(_0x133501[_0xe2ac('0x36')][_0xe2ac('0x56')]){_0x2b8212[_0xe2ac('0x43')]=_['merge'](_0x2b8212[_0xe2ac('0x43')],{'$or':_[_0xe2ac('0x57')](_0x2b8212[_0xe2ac('0x3a')],function(_0x10d719){var _0xb8dc5={};_0xb8dc5[_0x10d719]={'$like':'%'+_0x133501[_0xe2ac('0x36')][_0xe2ac('0x56')]+'%'};return _0xb8dc5;})});}_0x2b8212=_[_0xe2ac('0x44')]({},_0x2b8212,_0x133501[_0xe2ac('0x48')]);return _0x59ab47[_0xe2ac('0x58')](_0x2b8212);}})['then'](function(_0x2f4a3f){if(_0x2f4a3f){_0x127c17=_0x2f4a3f[_0xe2ac('0x3b')];if(!_0x133501[_0xe2ac('0x36')]['hasOwnProperty'](_0xe2ac('0x3e'))){_0x2b8212[_0xe2ac('0x28')]=qs[_0xe2ac('0x28')](_0x133501['query'][_0xe2ac('0x28')]);_0x2b8212[_0xe2ac('0x3f')]=qs[_0xe2ac('0x3f')](_0x133501[_0xe2ac('0x36')][_0xe2ac('0x3f')]);}return _0x59ab47[_0xe2ac('0x58')](_0x2b8212);}})[_0xe2ac('0x1a')](function(_0x4993fb){if(_0x4993fb){return _0x4993fb?{'count':_0x127c17,'rows':_0x4993fb}:null;}})[_0xe2ac('0x1a')](respondWithResult(_0x570968,null))[_0xe2ac('0x24')](handleError(_0x570968,null));};exports['getDescriptions']=function(_0x12b643,_0x1992a2,_0xcccdf6){var _0x1ac250={};var _0x12bc78={};var _0x40503f;var _0x10a038;return db[_0xe2ac('0x33')][_0xe2ac('0x54')]({'where':{'id':_0x12b643['params']['id']}})['then'](handleEntityNotFound(_0x1992a2,null))['then'](function(_0x4bdaa9){if(_0x4bdaa9){_0x40503f=_0x4bdaa9;_0x12bc78[_0xe2ac('0x3c')]=_[_0xe2ac('0x35')](db[_0xe2ac('0x55')][_0xe2ac('0x34')]);_0x12bc78[_0xe2ac('0x36')]=_['keys'](_0x12b643[_0xe2ac('0x36')]);_0x12bc78['filters']=_[_0xe2ac('0x38')](_0x12bc78[_0xe2ac('0x3c')],_0x12bc78[_0xe2ac('0x36')]);_0x1ac250[_0xe2ac('0x3a')]=_['intersection'](_0x12bc78[_0xe2ac('0x3c')],qs['fields'](_0x12b643['query'][_0xe2ac('0x39')]));_0x1ac250[_0xe2ac('0x3a')]=_0x1ac250[_0xe2ac('0x3a')][_0xe2ac('0x3b')]?_0x1ac250[_0xe2ac('0x3a')]:_0x12bc78[_0xe2ac('0x3c')];_0x1ac250[_0xe2ac('0x40')]=qs['sort'](_0x12b643[_0xe2ac('0x36')][_0xe2ac('0x41')]);_0x1ac250[_0xe2ac('0x43')]=qs['filters'](_[_0xe2ac('0x42')](_0x12b643['query'],_0x12bc78[_0xe2ac('0x37')]));if(_0x12b643[_0xe2ac('0x36')]['filter']){_0x1ac250['where']=_[_0xe2ac('0x44')](_0x1ac250[_0xe2ac('0x43')],{'$or':_[_0xe2ac('0x57')](_0x1ac250[_0xe2ac('0x3a')],function(_0x2f7759){var _0x28eccc={};_0x28eccc[_0x2f7759]={'$like':'%'+_0x12b643[_0xe2ac('0x36')][_0xe2ac('0x56')]+'%'};return _0x28eccc;})});}_0x1ac250=_[_0xe2ac('0x44')]({},_0x1ac250,_0x12b643[_0xe2ac('0x48')]);return _0x40503f[_0xe2ac('0x59')](_0x1ac250);}})[_0xe2ac('0x1a')](function(_0x1dc310){if(_0x1dc310){_0x10a038=_0x1dc310['length'];if(!_0x12b643['query'][_0xe2ac('0x3d')](_0xe2ac('0x3e'))){_0x1ac250['limit']=qs['limit'](_0x12b643[_0xe2ac('0x36')]['limit']);_0x1ac250['offset']=qs[_0xe2ac('0x3f')](_0x12b643[_0xe2ac('0x36')]['offset']);}return _0x40503f[_0xe2ac('0x59')](_0x1ac250);}})[_0xe2ac('0x1a')](function(_0x28fd43){if(_0x28fd43){return _0x28fd43?{'count':_0x10a038,'rows':_0x28fd43}:null;}})[_0xe2ac('0x1a')](respondWithResult(_0x1992a2,null))[_0xe2ac('0x24')](handleError(_0x1992a2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 0716483..934305a 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 _0x39b5=['api','moment','bluebird','request-promise','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger'];(function(_0x306da8,_0x469206){var _0x14a94b=function(_0x4764c8){while(--_0x4764c8){_0x306da8['push'](_0x306da8['shift']());}};_0x14a94b(++_0x469206);}(_0x39b5,0x1b5));var _0x539b=function(_0x58b3d5,_0x5584f8){_0x58b3d5=_0x58b3d5-0x0;var _0x2f6de9=_0x39b5[_0x58b3d5];return _0x2f6de9;};'use strict';var _=require(_0x539b('0x0'));var util=require(_0x539b('0x1'));var logger=require(_0x539b('0x2'))(_0x539b('0x3'));var moment=require(_0x539b('0x4'));var BPromise=require(_0x539b('0x5'));var rp=require(_0x539b('0x6'));var attributes=require(_0x539b('0x7'));module[_0x539b('0x8')]=function(_0x1dbaa0,_0x41e2e1){return _0x1dbaa0[_0x539b('0x9')](_0x539b('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94b8=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','api','moment','request-promise'];(function(_0x59af17,_0x179f25){var _0x41306e=function(_0x3a1f56){while(--_0x3a1f56){_0x59af17['push'](_0x59af17['shift']());}};_0x41306e(++_0x179f25);}(_0x94b8,0x100));var _0x894b=function(_0x52507e,_0x3e9496){_0x52507e=_0x52507e-0x0;var _0x1185b0=_0x94b8[_0x52507e];return _0x1185b0;};'use strict';var _=require(_0x894b('0x0'));var util=require(_0x894b('0x1'));var logger=require('../../config/logger')(_0x894b('0x2'));var moment=require(_0x894b('0x3'));var BPromise=require('bluebird');var rp=require(_0x894b('0x4'));var attributes=require(_0x894b('0x5'));module[_0x894b('0x6')]=function(_0x22b7dc,_0x268e94){return _0x22b7dc[_0x894b('0x7')](_0x894b('0x8'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 2ca8a85..1345e33 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 _0x6bb1=['jayson/promise','client','http','info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e5f6a,_0x1ddbc2){var _0x17f378=function(_0x279232){while(--_0x279232){_0x5e5f6a['push'](_0x5e5f6a['shift']());}};_0x17f378(++_0x1ddbc2);}(_0x6bb1,0xae));var _0x16bb=function(_0x3ffa8f,_0x12aa87){_0x3ffa8f=_0x3ffa8f-0x0;var _0x5c2fcb=_0x6bb1[_0x3ffa8f];return _0x5c2fcb;};'use strict';var _=require(_0x16bb('0x0'));var util=require(_0x16bb('0x1'));var moment=require('moment');var BPromise=require(_0x16bb('0x2'));var rs=require(_0x16bb('0x3'));var fs=require('fs');var Redis=require(_0x16bb('0x4'));var db=require(_0x16bb('0x5'))['db'];var utils=require(_0x16bb('0x6'));var logger=require(_0x16bb('0x7'))(_0x16bb('0x8'));var config=require(_0x16bb('0x9'));var jayson=require(_0x16bb('0xa'));var client=jayson[_0x16bb('0xb')][_0x16bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e4a8b,_0x2ec317,_0x317121){return new BPromise(function(_0x3f2dca,_0x3a4c57){return client['request'](_0x3e4a8b,_0x317121)['then'](function(_0x405219){logger[_0x16bb('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x2ec317,_0x16bb('0xe'));logger['debug'](_0x16bb('0xf'),_0x2ec317,_0x16bb('0xe'),JSON[_0x16bb('0x10')](_0x405219));if(_0x405219[_0x16bb('0x11')]){if(_0x405219[_0x16bb('0x11')][_0x16bb('0x12')]===0x1f4){logger[_0x16bb('0x11')](_0x16bb('0x13'),_0x2ec317,_0x405219[_0x16bb('0x11')][_0x16bb('0x14')]);return _0x3a4c57(_0x405219['error'][_0x16bb('0x14')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2ec317,_0x405219[_0x16bb('0x11')][_0x16bb('0x14')]);return _0x3f2dca(_0x405219['error'][_0x16bb('0x14')]);}else{logger[_0x16bb('0xd')](_0x16bb('0x13'),_0x2ec317,'request\x20sent');_0x3f2dca(_0x405219[_0x16bb('0x15')]['message']);}})[_0x16bb('0x16')](function(_0x61aff0){logger[_0x16bb('0x11')](_0x16bb('0x13'),_0x2ec317,_0x61aff0);_0x3a4c57(_0x61aff0);});});} \ No newline at end of file +var _0x1a89=['http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1a89,0xe6));var _0x91a8=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1a89[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x91a8('0x0'));var util=require(_0x91a8('0x1'));var moment=require(_0x91a8('0x2'));var BPromise=require(_0x91a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91a8('0x4'));var db=require(_0x91a8('0x5'))['db'];var utils=require(_0x91a8('0x6'));var logger=require(_0x91a8('0x7'))('rpc');var config=require(_0x91a8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x91a8('0x9')][_0x91a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xab516,_0x41c236,_0x4a6322){return new BPromise(function(_0x6896b6,_0xd5d103){return client[_0x91a8('0xb')](_0xab516,_0x4a6322)[_0x91a8('0xc')](function(_0x572b5f){logger[_0x91a8('0xd')](_0x91a8('0xe'),_0x41c236,_0x91a8('0xf'));logger[_0x91a8('0x10')](_0x91a8('0x11'),_0x41c236,'request\x20sent',JSON[_0x91a8('0x12')](_0x572b5f));if(_0x572b5f[_0x91a8('0x13')]){if(_0x572b5f['error'][_0x91a8('0x14')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x41c236,_0x572b5f[_0x91a8('0x13')]['message']);return _0xd5d103(_0x572b5f[_0x91a8('0x13')]['message']);}logger['error'](_0x91a8('0xe'),_0x41c236,_0x572b5f[_0x91a8('0x13')][_0x91a8('0x15')]);return _0x6896b6(_0x572b5f[_0x91a8('0x13')]['message']);}else{logger[_0x91a8('0xd')](_0x91a8('0xe'),_0x41c236,'request\x20sent');_0x6896b6(_0x572b5f[_0x91a8('0x16')][_0x91a8('0x15')]);}})[_0x91a8('0x17')](function(_0x45395e){logger[_0x91a8('0x13')](_0x91a8('0xe'),_0x41c236,_0x45395e);_0xd5d103(_0x45395e);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d1eb51f..9bc36fd 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 _0xddec=['multer','util','path','express','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xddec,0xcc));var _0xcdde=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xddec[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xcdde('0x0'));var util=require(_0xcdde('0x1'));var path=require(_0xcdde('0x2'));var timeout=require('connect-timeout');var express=require(_0xcdde('0x3'));var router=express['Router']();var auth=require(_0xcdde('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcdde('0x5'));var controller=require(_0xcdde('0x6'));router[_0xcdde('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcdde('0x8'),auth[_0xcdde('0x9')](),controller[_0xcdde('0xa')]);router['post']('/',auth[_0xcdde('0x9')](),controller[_0xcdde('0xb')]);router[_0xcdde('0xc')]('/:id',auth[_0xcdde('0x9')](),controller[_0xcdde('0xd')]);router[_0xcdde('0xe')](_0xcdde('0x8'),auth['isAuthenticated'](),controller[_0xcdde('0xf')]);module[_0xcdde('0x10')]=router; \ No newline at end of file +var _0xee23=['create','put','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','/:id','show','post'];(function(_0x211de5,_0x27c6d0){var _0x519c2a=function(_0x432a31){while(--_0x432a31){_0x211de5['push'](_0x211de5['shift']());}};_0x519c2a(++_0x27c6d0);}(_0xee23,0x1a9));var _0x3ee2=function(_0x401c76,_0x19689f){_0x401c76=_0x401c76-0x0;var _0x2334c4=_0xee23[_0x401c76];return _0x2334c4;};'use strict';var multer=require(_0x3ee2('0x0'));var util=require(_0x3ee2('0x1'));var path=require(_0x3ee2('0x2'));var timeout=require(_0x3ee2('0x3'));var express=require('express');var router=express[_0x3ee2('0x4')]();var auth=require(_0x3ee2('0x5'));var interaction=require(_0x3ee2('0x6'));var config=require('../../config/environment');var controller=require(_0x3ee2('0x7'));router[_0x3ee2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3ee2('0x9'),auth['isAuthenticated'](),controller[_0x3ee2('0xa')]);router[_0x3ee2('0xb')]('/',auth['isAuthenticated'](),controller[_0x3ee2('0xc')]);router[_0x3ee2('0xd')](_0x3ee2('0x9'),auth['isAuthenticated'](),controller[_0x3ee2('0xe')]);router[_0x3ee2('0xf')](_0x3ee2('0x9'),auth[_0x3ee2('0x10')](),controller[_0x3ee2('0x11')]);module[_0x3ee2('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index db7b61c..2e914d5 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 _0xb7e7=['customVariable','BOOLEAN','sequelize','ENUM','variable','keyValue','STRING'];(function(_0x2da6a7,_0x5182c5){var _0x273e3a=function(_0x2143bf){while(--_0x2143bf){_0x2da6a7['push'](_0x2da6a7['shift']());}};_0x273e3a(++_0x5182c5);}(_0xb7e7,0x121));var _0x7b7e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb7e7[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'type':{'type':Sequelize[_0x7b7e('0x1')]('string',_0x7b7e('0x2'),'customVariable',_0x7b7e('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7b7e('0x4')]},'key':{'type':Sequelize[_0x7b7e('0x4')]},'keyType':{'type':Sequelize[_0x7b7e('0x1')]('string','variable',_0x7b7e('0x5'))},'keyContent':{'type':Sequelize[_0x7b7e('0x4')]},'idField':{'type':Sequelize[_0x7b7e('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7b7e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7b7e('0x4')]}}; \ No newline at end of file +var _0xec56=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0xd292e7,_0x4b414a){var _0x2e9660=function(_0x301867){while(--_0x301867){_0xd292e7['push'](_0xd292e7['shift']());}};_0x2e9660(++_0x4b414a);}(_0xec56,0x1bd));var _0x6ec5=function(_0x8519f4,_0x3fd51d){_0x8519f4=_0x8519f4-0x0;var _0x589cac=_0xec56[_0x8519f4];return _0x589cac;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3'),_0x6ec5('0x4')),'defaultValue':_0x6ec5('0x1')},'content':{'type':Sequelize[_0x6ec5('0x5')]},'key':{'type':Sequelize[_0x6ec5('0x5')]},'keyType':{'type':Sequelize[_0x6ec5('0x6')](_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3'))},'keyContent':{'type':Sequelize[_0x6ec5('0x5')]},'idField':{'type':Sequelize[_0x6ec5('0x5')]},'nameField':{'type':Sequelize[_0x6ec5('0x5')]},'customField':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ec5('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index dcd2e2b..ad5d0ed 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 _0x3a95=['length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','findAll','catch','include','create','body','update','find','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/utils','status','end','count','offset','limit','set','Content-Range','json','reject','then','destroy','sendStatus','name','send','index','VtigerField','rawAttributes','keys','query','filters','intersection','model','fields','attributes'];(function(_0x2fb573,_0x1a13b4){var _0x46dde5=function(_0x38d914){while(--_0x38d914){_0x2fb573['push'](_0x2fb573['shift']());}};_0x46dde5(++_0x1a13b4);}(_0x3a95,0x12b));var _0x53a9=function(_0x5c402d,_0x1dda4e){_0x5c402d=_0x5c402d-0x0;var _0x3dcc91=_0x3a95[_0x5c402d];return _0x3dcc91;};'use strict';var pdf=require(_0x53a9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x53a9('0x1'));var zipdir=require(_0x53a9('0x2'));var jsonpatch=require(_0x53a9('0x3'));var rp=require('request-promise');var moment=require(_0x53a9('0x4'));var BPromise=require(_0x53a9('0x5'));var Mustache=require(_0x53a9('0x6'));var util=require(_0x53a9('0x7'));var path=require(_0x53a9('0x8'));var sox=require(_0x53a9('0x9'));var csv=require(_0x53a9('0xa'));var ejs=require(_0x53a9('0xb'));var fs=require('fs');var _=require(_0x53a9('0xc'));var squel=require(_0x53a9('0xd'));var crypto=require(_0x53a9('0xe'));var jsforce=require(_0x53a9('0xf'));var deskjs=require(_0x53a9('0x10'));var toCsv=require(_0x53a9('0xa'));var querystring=require('querystring');var Papa=require(_0x53a9('0x11'));var authService=require(_0x53a9('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x53a9('0x13'));var qs=require(_0x53a9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x53a9('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29f06f,_0x10b516){_0x10b516=_0x10b516||0xcc;return function(_0x34f160){if(_0x34f160){return _0x29f06f['sendStatus'](_0x10b516);}return _0x29f06f[_0x53a9('0x16')](_0x10b516)[_0x53a9('0x17')]();};}function respondWithResult(_0x201c80,_0x486b76){_0x486b76=_0x486b76||0xc8;return function(_0x20181a){if(_0x20181a){return _0x201c80[_0x53a9('0x16')](_0x486b76)['json'](_0x20181a);}};}function respondWithFilteredResult(_0x2cadc1,_0xa7a7f6){return function(_0x219611){if(_0x219611){var _0x2326d4=_0x219611[_0x53a9('0x18')],_0x3c5495=_0xa7a7f6[_0x53a9('0x19')],_0x4746f7=_0xa7a7f6['offset']+_0xa7a7f6[_0x53a9('0x1a')],_0x47c8b7;if(_0x4746f7>=_0x2326d4){_0x4746f7=_0x2326d4;_0x47c8b7=0xc8;}else{_0x47c8b7=0xce;}_0x2cadc1['status'](_0x47c8b7);return _0x2cadc1[_0x53a9('0x1b')](_0x53a9('0x1c'),_0x3c5495+'-'+_0x4746f7+'/'+_0x2326d4)[_0x53a9('0x1d')](_0x219611);}return null;};}function patchUpdates(_0x38e20d){return function(_0x2d9ba9){try{jsonpatch['apply'](_0x2d9ba9,_0x38e20d,!![]);}catch(_0x2ad76a){return BPromise[_0x53a9('0x1e')](_0x2ad76a);}return _0x2d9ba9['save']();};}function saveUpdates(_0x355deb,_0x531f79){return function(_0x200713){if(_0x200713){return _0x200713['update'](_0x355deb)[_0x53a9('0x1f')](function(_0x6710cc){return _0x6710cc;});}return null;};}function removeEntity(_0xbb05c4,_0x344980){return function(_0x22b1c7){if(_0x22b1c7){return _0x22b1c7[_0x53a9('0x20')]()[_0x53a9('0x1f')](function(){_0xbb05c4[_0x53a9('0x16')](0xcc)[_0x53a9('0x17')]();});}};}function handleEntityNotFound(_0x6327c8,_0x5d8355){return function(_0x36c190){if(!_0x36c190){_0x6327c8[_0x53a9('0x21')](0x194);}return _0x36c190;};}function handleError(_0x40ba85,_0x25865c){_0x25865c=_0x25865c||0x1f4;return function(_0x4660d8){logger['error'](_0x4660d8['stack']);if(_0x4660d8[_0x53a9('0x22')]){delete _0x4660d8[_0x53a9('0x22')];}_0x40ba85['status'](_0x25865c)[_0x53a9('0x23')](_0x4660d8);};}exports[_0x53a9('0x24')]=function(_0xbe5dc,_0x2f4093){var _0x25c378={},_0x21d3f6={},_0x16d54a={'count':0x0,'rows':[]};var _0x3fdae9=db[_0x53a9('0x25')][_0x53a9('0x26')];_0x21d3f6['model']=_[_0x53a9('0x27')](_0x3fdae9);_0x21d3f6[_0x53a9('0x28')]=_['keys'](_0xbe5dc[_0x53a9('0x28')]);_0x21d3f6[_0x53a9('0x29')]=_[_0x53a9('0x2a')](_0x21d3f6['model'],_0x21d3f6[_0x53a9('0x28')]);_0x25c378['attributes']=_[_0x53a9('0x2a')](_0x21d3f6[_0x53a9('0x2b')],qs['fields'](_0xbe5dc[_0x53a9('0x28')][_0x53a9('0x2c')]));_0x25c378[_0x53a9('0x2d')]=_0x25c378['attributes'][_0x53a9('0x2e')]?_0x25c378[_0x53a9('0x2d')]:_0x21d3f6['model'];if(!_0xbe5dc['query']['hasOwnProperty'](_0x53a9('0x2f'))){_0x25c378['limit']=qs[_0x53a9('0x1a')](_0xbe5dc['query'][_0x53a9('0x1a')]);_0x25c378['offset']=qs[_0x53a9('0x19')](_0xbe5dc[_0x53a9('0x28')][_0x53a9('0x19')]);}_0x25c378[_0x53a9('0x30')]=qs[_0x53a9('0x31')](_0xbe5dc['query']['sort']);_0x25c378[_0x53a9('0x32')]=qs[_0x53a9('0x29')](_[_0x53a9('0x33')](_0xbe5dc[_0x53a9('0x28')],_0x21d3f6[_0x53a9('0x29')]));if(_0xbe5dc[_0x53a9('0x28')]['filter']){_0x25c378[_0x53a9('0x32')]=_[_0x53a9('0x34')](_0x25c378[_0x53a9('0x32')],{'$or':_[_0x53a9('0x35')](_0x3fdae9,function(_0x1e998a){if(_0x1e998a[_0x53a9('0x36')][_0x53a9('0x37')]!==_0x53a9('0x38')){var _0x57c0f1={};_0x57c0f1[_0x1e998a[_0x53a9('0x39')]]={'$like':'%'+_0xbe5dc[_0x53a9('0x28')][_0x53a9('0x3a')]+'%'};return _0x57c0f1;}})});}_0x25c378=_[_0x53a9('0x34')]({},_0x25c378,_0xbe5dc[_0x53a9('0x3b')]);var _0x154209={'where':_0x25c378[_0x53a9('0x32')]};return db[_0x53a9('0x25')]['count'](_0x154209)[_0x53a9('0x1f')](function(_0x22eda4){_0x16d54a['count']=_0x22eda4;if(_0xbe5dc[_0x53a9('0x28')][_0x53a9('0x3c')]){_0x25c378['include']=[{'all':!![]}];}return db[_0x53a9('0x25')][_0x53a9('0x3d')](_0x25c378);})[_0x53a9('0x1f')](function(_0x28a8d0){_0x16d54a['rows']=_0x28a8d0;return _0x16d54a;})[_0x53a9('0x1f')](respondWithFilteredResult(_0x2f4093,_0x25c378))[_0x53a9('0x3e')](handleError(_0x2f4093,null));};exports['show']=function(_0xf088be,_0x5dab5f){var _0x1f5d77={'raw':!![],'where':{'id':_0xf088be['params']['id']}},_0x37d72={};_0x37d72[_0x53a9('0x2b')]=_[_0x53a9('0x27')](db[_0x53a9('0x25')][_0x53a9('0x26')]);_0x37d72[_0x53a9('0x28')]=_[_0x53a9('0x27')](_0xf088be[_0x53a9('0x28')]);_0x37d72[_0x53a9('0x29')]=_['intersection'](_0x37d72[_0x53a9('0x2b')],_0x37d72[_0x53a9('0x28')]);_0x1f5d77[_0x53a9('0x2d')]=_[_0x53a9('0x2a')](_0x37d72[_0x53a9('0x2b')],qs[_0x53a9('0x2c')](_0xf088be['query'][_0x53a9('0x2c')]));_0x1f5d77[_0x53a9('0x2d')]=_0x1f5d77[_0x53a9('0x2d')]['length']?_0x1f5d77['attributes']:_0x37d72[_0x53a9('0x2b')];if(_0xf088be[_0x53a9('0x28')][_0x53a9('0x3c')]){_0x1f5d77[_0x53a9('0x3f')]=[{'all':!![]}];}_0x1f5d77=_[_0x53a9('0x34')]({},_0x1f5d77,_0xf088be['options']);return db[_0x53a9('0x25')]['find'](_0x1f5d77)[_0x53a9('0x1f')](handleEntityNotFound(_0x5dab5f,null))['then'](respondWithResult(_0x5dab5f,null))[_0x53a9('0x3e')](handleError(_0x5dab5f,null));};exports[_0x53a9('0x40')]=function(_0x4dcbe0,_0x33a23a){return db[_0x53a9('0x25')][_0x53a9('0x40')](_0x4dcbe0[_0x53a9('0x41')],{})[_0x53a9('0x1f')](respondWithResult(_0x33a23a,0xc9))['catch'](handleError(_0x33a23a,null));};exports[_0x53a9('0x42')]=function(_0x1affd8,_0x1c9f77){if(_0x1affd8[_0x53a9('0x41')]['id']){delete _0x1affd8[_0x53a9('0x41')]['id'];}return db[_0x53a9('0x25')][_0x53a9('0x43')]({'where':{'id':_0x1affd8['params']['id']}})['then'](handleEntityNotFound(_0x1c9f77,null))[_0x53a9('0x1f')](saveUpdates(_0x1affd8[_0x53a9('0x41')],null))['then'](respondWithResult(_0x1c9f77,null))[_0x53a9('0x3e')](handleError(_0x1c9f77,null));};exports[_0x53a9('0x20')]=function(_0x31ef6c,_0x408966){return db[_0x53a9('0x25')][_0x53a9('0x43')]({'where':{'id':_0x31ef6c[_0x53a9('0x44')]['id']}})[_0x53a9('0x1f')](handleEntityNotFound(_0x408966,null))[_0x53a9('0x1f')](removeEntity(_0x408966,null))[_0x53a9('0x3e')](handleError(_0x408966,null));}; \ No newline at end of file +var _0xe424=['count','offset','limit','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','send','VtigerField','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','destroy','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json'];(function(_0x303c62,_0x2b87c){var _0x5ec777=function(_0x431f76){while(--_0x431f76){_0x303c62['push'](_0x303c62['shift']());}};_0x5ec777(++_0x2b87c);}(_0xe424,0x1d3));var _0x4e42=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0xe424[_0x37756b];return _0x46efec;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4e42('0x0'));var rp=require(_0x4e42('0x1'));var moment=require(_0x4e42('0x2'));var BPromise=require(_0x4e42('0x3'));var Mustache=require(_0x4e42('0x4'));var util=require(_0x4e42('0x5'));var path=require(_0x4e42('0x6'));var sox=require(_0x4e42('0x7'));var csv=require('to-csv');var ejs=require(_0x4e42('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4e42('0x9'));var crypto=require(_0x4e42('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4e42('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4e42('0xc'));var authService=require(_0x4e42('0xd'));var hardwareService=require(_0x4e42('0xe'));var Redis=require('ioredis');var qs=require(_0x4e42('0xf'));var logger=require(_0x4e42('0x10'))(_0x4e42('0x11'));var utils=require(_0x4e42('0x12'));var config=require(_0x4e42('0x13'));var db=require(_0x4e42('0x14'))['db'];function respondWithStatusCode(_0x195c61,_0x43327b){_0x43327b=_0x43327b||0xcc;return function(_0x2619f4){if(_0x2619f4){return _0x195c61['sendStatus'](_0x43327b);}return _0x195c61['status'](_0x43327b)['end']();};}function respondWithResult(_0x29247d,_0x5df313){_0x5df313=_0x5df313||0xc8;return function(_0x2fec35){if(_0x2fec35){return _0x29247d[_0x4e42('0x15')](_0x5df313)[_0x4e42('0x16')](_0x2fec35);}};}function respondWithFilteredResult(_0xef814d,_0x127d85){return function(_0x341929){if(_0x341929){var _0x449ae4=_0x341929[_0x4e42('0x17')],_0x4ff6a0=_0x127d85[_0x4e42('0x18')],_0x2aa3b9=_0x127d85[_0x4e42('0x18')]+_0x127d85[_0x4e42('0x19')],_0x5e51ee;if(_0x2aa3b9>=_0x449ae4){_0x2aa3b9=_0x449ae4;_0x5e51ee=0xc8;}else{_0x5e51ee=0xce;}_0xef814d['status'](_0x5e51ee);return _0xef814d[_0x4e42('0x1a')](_0x4e42('0x1b'),_0x4ff6a0+'-'+_0x2aa3b9+'/'+_0x449ae4)[_0x4e42('0x16')](_0x341929);}return null;};}function patchUpdates(_0x429830){return function(_0x300486){try{jsonpatch[_0x4e42('0x1c')](_0x300486,_0x429830,!![]);}catch(_0x4c5529){return BPromise[_0x4e42('0x1d')](_0x4c5529);}return _0x300486['save']();};}function saveUpdates(_0xf11316,_0x57b849){return function(_0xdd3f3e){if(_0xdd3f3e){return _0xdd3f3e[_0x4e42('0x1e')](_0xf11316)[_0x4e42('0x1f')](function(_0x35b628){return _0x35b628;});}return null;};}function removeEntity(_0x14a0ce,_0x2f71e0){return function(_0x46fa9d){if(_0x46fa9d){return _0x46fa9d['destroy']()[_0x4e42('0x1f')](function(){_0x14a0ce[_0x4e42('0x15')](0xcc)[_0x4e42('0x20')]();});}};}function handleEntityNotFound(_0x1b2353,_0x17a7c3){return function(_0x55f102){if(!_0x55f102){_0x1b2353[_0x4e42('0x21')](0x194);}return _0x55f102;};}function handleError(_0x31c880,_0x3688dc){_0x3688dc=_0x3688dc||0x1f4;return function(_0x53e35a){logger[_0x4e42('0x22')](_0x53e35a['stack']);if(_0x53e35a['name']){delete _0x53e35a[_0x4e42('0x23')];}_0x31c880['status'](_0x3688dc)[_0x4e42('0x24')](_0x53e35a);};}exports['index']=function(_0x2688ba,_0xb63b61){var _0x574a2e={},_0x292e56={},_0x3b422e={'count':0x0,'rows':[]};var _0x57e7b5=db[_0x4e42('0x25')]['rawAttributes'];_0x292e56[_0x4e42('0x26')]=_['keys'](_0x57e7b5);_0x292e56[_0x4e42('0x27')]=_[_0x4e42('0x28')](_0x2688ba[_0x4e42('0x27')]);_0x292e56[_0x4e42('0x29')]=_[_0x4e42('0x2a')](_0x292e56[_0x4e42('0x26')],_0x292e56[_0x4e42('0x27')]);_0x574a2e[_0x4e42('0x2b')]=_['intersection'](_0x292e56['model'],qs[_0x4e42('0x2c')](_0x2688ba[_0x4e42('0x27')][_0x4e42('0x2c')]));_0x574a2e[_0x4e42('0x2b')]=_0x574a2e[_0x4e42('0x2b')][_0x4e42('0x2d')]?_0x574a2e[_0x4e42('0x2b')]:_0x292e56[_0x4e42('0x26')];if(!_0x2688ba[_0x4e42('0x27')][_0x4e42('0x2e')](_0x4e42('0x2f'))){_0x574a2e[_0x4e42('0x19')]=qs[_0x4e42('0x19')](_0x2688ba[_0x4e42('0x27')]['limit']);_0x574a2e[_0x4e42('0x18')]=qs['offset'](_0x2688ba[_0x4e42('0x27')][_0x4e42('0x18')]);}_0x574a2e[_0x4e42('0x30')]=qs['sort'](_0x2688ba[_0x4e42('0x27')][_0x4e42('0x31')]);_0x574a2e[_0x4e42('0x32')]=qs[_0x4e42('0x29')](_[_0x4e42('0x33')](_0x2688ba[_0x4e42('0x27')],_0x292e56[_0x4e42('0x29')]));if(_0x2688ba[_0x4e42('0x27')][_0x4e42('0x34')]){_0x574a2e[_0x4e42('0x32')]=_[_0x4e42('0x35')](_0x574a2e['where'],{'$or':_[_0x4e42('0x36')](_0x57e7b5,function(_0x434f33){if(_0x434f33[_0x4e42('0x37')][_0x4e42('0x38')]!==_0x4e42('0x39')){var _0x180fd9={};_0x180fd9[_0x434f33[_0x4e42('0x3a')]]={'$like':'%'+_0x2688ba['query']['filter']+'%'};return _0x180fd9;}})});}_0x574a2e=_[_0x4e42('0x35')]({},_0x574a2e,_0x2688ba[_0x4e42('0x3b')]);var _0x5916c4={'where':_0x574a2e[_0x4e42('0x32')]};return db[_0x4e42('0x25')][_0x4e42('0x17')](_0x5916c4)[_0x4e42('0x1f')](function(_0x160a47){_0x3b422e[_0x4e42('0x17')]=_0x160a47;if(_0x2688ba['query'][_0x4e42('0x3c')]){_0x574a2e[_0x4e42('0x3d')]=[{'all':!![]}];}return db[_0x4e42('0x25')][_0x4e42('0x3e')](_0x574a2e);})[_0x4e42('0x1f')](function(_0x553988){_0x3b422e[_0x4e42('0x3f')]=_0x553988;return _0x3b422e;})[_0x4e42('0x1f')](respondWithFilteredResult(_0xb63b61,_0x574a2e))[_0x4e42('0x40')](handleError(_0xb63b61,null));};exports['show']=function(_0x3678c3,_0x27a71d){var _0x22b206={'raw':!![],'where':{'id':_0x3678c3[_0x4e42('0x41')]['id']}},_0x4bef22={};_0x4bef22[_0x4e42('0x26')]=_['keys'](db[_0x4e42('0x25')][_0x4e42('0x42')]);_0x4bef22[_0x4e42('0x27')]=_[_0x4e42('0x28')](_0x3678c3[_0x4e42('0x27')]);_0x4bef22['filters']=_['intersection'](_0x4bef22[_0x4e42('0x26')],_0x4bef22[_0x4e42('0x27')]);_0x22b206['attributes']=_[_0x4e42('0x2a')](_0x4bef22[_0x4e42('0x26')],qs[_0x4e42('0x2c')](_0x3678c3['query']['fields']));_0x22b206[_0x4e42('0x2b')]=_0x22b206[_0x4e42('0x2b')][_0x4e42('0x2d')]?_0x22b206[_0x4e42('0x2b')]:_0x4bef22['model'];if(_0x3678c3[_0x4e42('0x27')][_0x4e42('0x3c')]){_0x22b206[_0x4e42('0x3d')]=[{'all':!![]}];}_0x22b206=_[_0x4e42('0x35')]({},_0x22b206,_0x3678c3[_0x4e42('0x3b')]);return db[_0x4e42('0x25')]['find'](_0x22b206)[_0x4e42('0x1f')](handleEntityNotFound(_0x27a71d,null))['then'](respondWithResult(_0x27a71d,null))[_0x4e42('0x40')](handleError(_0x27a71d,null));};exports[_0x4e42('0x43')]=function(_0x1d5eaa,_0x1c9a48){return db[_0x4e42('0x25')][_0x4e42('0x43')](_0x1d5eaa[_0x4e42('0x44')],{})[_0x4e42('0x1f')](respondWithResult(_0x1c9a48,0xc9))['catch'](handleError(_0x1c9a48,null));};exports[_0x4e42('0x1e')]=function(_0x39e4e0,_0x5e2b1b){if(_0x39e4e0[_0x4e42('0x44')]['id']){delete _0x39e4e0[_0x4e42('0x44')]['id'];}return db[_0x4e42('0x25')]['find']({'where':{'id':_0x39e4e0[_0x4e42('0x41')]['id']}})[_0x4e42('0x1f')](handleEntityNotFound(_0x5e2b1b,null))['then'](saveUpdates(_0x39e4e0['body'],null))[_0x4e42('0x1f')](respondWithResult(_0x5e2b1b,null))['catch'](handleError(_0x5e2b1b,null));};exports[_0x4e42('0x45')]=function(_0x357442,_0x45a5f8){return db[_0x4e42('0x25')]['find']({'where':{'id':_0x357442['params']['id']}})['then'](handleEntityNotFound(_0x45a5f8,null))[_0x4e42('0x1f')](removeEntity(_0x45a5f8,null))[_0x4e42('0x40')](handleError(_0x45a5f8,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 950d245..bc8f5c6 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 _0x44e9=['moment','bluebird','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x188b3c,_0x4fb09a){var _0x4b9182=function(_0x25e4c3){while(--_0x25e4c3){_0x188b3c['push'](_0x188b3c['shift']());}};_0x4b9182(++_0x4fb09a);}(_0x44e9,0x168));var _0x944e=function(_0x5385e8,_0x3b8daf){_0x5385e8=_0x5385e8-0x0;var _0x49f94b=_0x44e9[_0x5385e8];return _0x49f94b;};'use strict';var _=require(_0x944e('0x0'));var util=require(_0x944e('0x1'));var logger=require(_0x944e('0x2'))(_0x944e('0x3'));var moment=require(_0x944e('0x4'));var BPromise=require(_0x944e('0x5'));var rp=require('request-promise');var attributes=require(_0x944e('0x6'));module[_0x944e('0x7')]=function(_0x1c09be,_0xe18076){return _0x1c09be[_0x944e('0x8')]('VtigerField',attributes,{'tableName':_0x944e('0x9'),'paranoid':![],'indexes':[{'name':_0x944e('0xa'),'fields':[_0x944e('0xb'),_0x944e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd3cc=['request-promise','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x598014,_0x39d7b8){var _0x436330=function(_0x1971cd){while(--_0x1971cd){_0x598014['push'](_0x598014['shift']());}};_0x436330(++_0x39d7b8);}(_0xd3cc,0x170));var _0xcd3c=function(_0x14ba11,_0x22ebe8){_0x14ba11=_0x14ba11-0x0;var _0xf2f32b=_0xd3cc[_0x14ba11];return _0xf2f32b;};'use strict';var _=require(_0xcd3c('0x0'));var util=require(_0xcd3c('0x1'));var logger=require(_0xcd3c('0x2'))('api');var moment=require(_0xcd3c('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd3c('0x4'));var attributes=require(_0xcd3c('0x5'));module['exports']=function(_0x400f1f,_0x5b7e99){return _0x400f1f[_0xcd3c('0x6')](_0xcd3c('0x7'),attributes,{'tableName':_0xcd3c('0x8'),'paranoid':![],'indexes':[{'name':_0xcd3c('0x9'),'fields':[_0xcd3c('0xa'),_0xcd3c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 7c895a7..90513ef 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 _0xe73f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','bluebird','randomstring'];(function(_0xc40b9f,_0x17ec1f){var _0x535b9c=function(_0x591b19){while(--_0x591b19){_0xc40b9f['push'](_0xc40b9f['shift']());}};_0x535b9c(++_0x17ec1f);}(_0xe73f,0xbc));var _0xfe73=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe73f[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xfe73('0x0'));var util=require('util');var moment=require(_0xfe73('0x1'));var BPromise=require(_0xfe73('0x2'));var rs=require(_0xfe73('0x3'));var fs=require('fs');var Redis=require(_0xfe73('0x4'));var db=require(_0xfe73('0x5'))['db'];var utils=require(_0xfe73('0x6'));var logger=require(_0xfe73('0x7'))(_0xfe73('0x8'));var config=require(_0xfe73('0x9'));var jayson=require(_0xfe73('0xa'));var client=jayson[_0xfe73('0xb')][_0xfe73('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x189e40,_0x9b0402,_0xf9b076){return new BPromise(function(_0x243591,_0x556dd3){return client[_0xfe73('0xd')](_0x189e40,_0xf9b076)[_0xfe73('0xe')](function(_0x16842d){logger['info'](_0xfe73('0xf'),_0x9b0402,_0xfe73('0x10'));logger[_0xfe73('0x11')](_0xfe73('0x12'),_0x9b0402,_0xfe73('0x10'),JSON[_0xfe73('0x13')](_0x16842d));if(_0x16842d[_0xfe73('0x14')]){if(_0x16842d['error']['code']===0x1f4){logger[_0xfe73('0x14')](_0xfe73('0xf'),_0x9b0402,_0x16842d['error']['message']);return _0x556dd3(_0x16842d[_0xfe73('0x14')][_0xfe73('0x15')]);}logger['error'](_0xfe73('0xf'),_0x9b0402,_0x16842d[_0xfe73('0x14')][_0xfe73('0x15')]);return _0x243591(_0x16842d[_0xfe73('0x14')][_0xfe73('0x15')]);}else{logger[_0xfe73('0x16')](_0xfe73('0xf'),_0x9b0402,_0xfe73('0x10'));_0x243591(_0x16842d[_0xfe73('0x17')][_0xfe73('0x15')]);}})['catch'](function(_0x18408b){logger[_0xfe73('0x14')](_0xfe73('0xf'),_0x9b0402,_0x18408b);_0x556dd3(_0x18408b);});});} \ No newline at end of file +var _0xf3b1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x144c9c,_0x471a0d){var _0x160e33=function(_0x467ad3){while(--_0x467ad3){_0x144c9c['push'](_0x144c9c['shift']());}};_0x160e33(++_0x471a0d);}(_0xf3b1,0xab));var _0x1f3b=function(_0x52f9e5,_0x49d065){_0x52f9e5=_0x52f9e5-0x0;var _0x7c2bb5=_0xf3b1[_0x52f9e5];return _0x7c2bb5;};'use strict';var _=require(_0x1f3b('0x0'));var util=require(_0x1f3b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1f3b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f3b('0x3'))['db'];var utils=require(_0x1f3b('0x4'));var logger=require(_0x1f3b('0x5'))(_0x1f3b('0x6'));var config=require(_0x1f3b('0x7'));var jayson=require(_0x1f3b('0x8'));var client=jayson[_0x1f3b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x103b24,_0x3aa5cc,_0x577ac9){return new BPromise(function(_0x281d8d,_0x455e7e){return client[_0x1f3b('0xa')](_0x103b24,_0x577ac9)['then'](function(_0x114946){logger[_0x1f3b('0xb')](_0x1f3b('0xc'),_0x3aa5cc,_0x1f3b('0xd'));logger[_0x1f3b('0xe')](_0x1f3b('0xf'),_0x3aa5cc,_0x1f3b('0xd'),JSON[_0x1f3b('0x10')](_0x114946));if(_0x114946[_0x1f3b('0x11')]){if(_0x114946['error'][_0x1f3b('0x12')]===0x1f4){logger['error'](_0x1f3b('0xc'),_0x3aa5cc,_0x114946[_0x1f3b('0x11')]['message']);return _0x455e7e(_0x114946[_0x1f3b('0x11')][_0x1f3b('0x13')]);}logger[_0x1f3b('0x11')](_0x1f3b('0xc'),_0x3aa5cc,_0x114946['error'][_0x1f3b('0x13')]);return _0x281d8d(_0x114946[_0x1f3b('0x11')][_0x1f3b('0x13')]);}else{logger[_0x1f3b('0xb')](_0x1f3b('0xc'),_0x3aa5cc,_0x1f3b('0xd'));_0x281d8d(_0x114946[_0x1f3b('0x14')][_0x1f3b('0x13')]);}})[_0x1f3b('0x15')](function(_0x2f4998){logger['error']('VtigerField,\x20%s,\x20%s',_0x3aa5cc,_0x2f4998);_0x455e7e(_0x2f4998);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index bc0299c..0c1d794 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 _0xfac6=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields'];(function(_0x198303,_0x572645){var _0x42e2df=function(_0x47614d){while(--_0x47614d){_0x198303['push'](_0x198303['shift']());}};_0x42e2df(++_0x572645);}(_0xfac6,0x1d1));var _0x6fac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfac6[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6fac('0x0'));var util=require(_0x6fac('0x1'));var path=require(_0x6fac('0x2'));var timeout=require('connect-timeout');var express=require(_0x6fac('0x3'));var router=express[_0x6fac('0x4')]();var auth=require(_0x6fac('0x5'));var interaction=require(_0x6fac('0x6'));var config=require(_0x6fac('0x7'));var controller=require(_0x6fac('0x8'));router[_0x6fac('0x9')]('/',auth[_0x6fac('0xa')](),controller['index']);router['get'](_0x6fac('0xb'),auth[_0x6fac('0xa')](),controller[_0x6fac('0xc')]);router[_0x6fac('0x9')](_0x6fac('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x6fac('0x9')](_0x6fac('0xe'),auth[_0x6fac('0xa')](),controller[_0x6fac('0xf')]);router[_0x6fac('0x10')]('/',auth[_0x6fac('0xa')](),controller[_0x6fac('0x11')]);router[_0x6fac('0x10')](_0x6fac('0xd'),auth[_0x6fac('0xa')](),controller[_0x6fac('0x12')]);router[_0x6fac('0x13')](_0x6fac('0xb'),auth['isAuthenticated'](),controller[_0x6fac('0x14')]);router[_0x6fac('0x15')]('/:id',auth[_0x6fac('0xa')](),controller[_0x6fac('0x16')]);module[_0x6fac('0x17')]=router; \ No newline at end of file +var _0x91a4=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x526186,_0x58ca2d){var _0x5c1ee6=function(_0x55d43d){while(--_0x55d43d){_0x526186['push'](_0x526186['shift']());}};_0x5c1ee6(++_0x58ca2d);}(_0x91a4,0x1c9));var _0x491a=function(_0x22a290,_0x4e5c23){_0x22a290=_0x22a290-0x0;var _0x30e1a7=_0x91a4[_0x22a290];return _0x30e1a7;};'use strict';var multer=require(_0x491a('0x0'));var util=require(_0x491a('0x1'));var path=require('path');var timeout=require(_0x491a('0x2'));var express=require(_0x491a('0x3'));var router=express[_0x491a('0x4')]();var auth=require(_0x491a('0x5'));var interaction=require(_0x491a('0x6'));var config=require(_0x491a('0x7'));var controller=require(_0x491a('0x8'));router[_0x491a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x491a('0x9')](_0x491a('0xa'),auth[_0x491a('0xb')](),controller[_0x491a('0xc')]);router['get']('/:id/configurations',auth[_0x491a('0xb')](),controller[_0x491a('0xd')]);router[_0x491a('0x9')](_0x491a('0xe'),auth[_0x491a('0xb')](),controller['getFields']);router[_0x491a('0xf')]('/',auth[_0x491a('0xb')](),controller[_0x491a('0x10')]);router[_0x491a('0xf')](_0x491a('0x11'),auth[_0x491a('0xb')](),controller[_0x491a('0x12')]);router['put'](_0x491a('0xa'),auth[_0x491a('0xb')](),controller[_0x491a('0x13')]);router[_0x491a('0x14')](_0x491a('0xa'),auth[_0x491a('0xb')](),controller[_0x491a('0x15')]);module[_0x491a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 7ccd62e..0afa529 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 _0xf5cd=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab'];(function(_0xb47b2a,_0xc898e9){var _0x3c9992=function(_0x21e5cc){while(--_0x21e5cc){_0xb47b2a['push'](_0xb47b2a['shift']());}};_0x3c9992(++_0xc898e9);}(_0xf5cd,0xea));var _0xdf5c=function(_0x43dfd4,_0x2d6fdc){_0x43dfd4=_0x43dfd4-0x0;var _0x27cd19=_0xf5cd[_0x43dfd4];return _0x27cd19;};'use strict';var Sequelize=require(_0xdf5c('0x0'));module[_0xdf5c('0x1')]={'name':{'type':Sequelize[_0xdf5c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xdf5c('0x2')],'unique':_0xdf5c('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xdf5c('0x2')]},'remoteUri':{'type':Sequelize[_0xdf5c('0x2')],'unique':_0xdf5c('0x4')},'authType':{'type':Sequelize[_0xdf5c('0x5')](_0xdf5c('0x6'),_0xdf5c('0x7')),'defaultValue':_0xdf5c('0x6')},'serverUrl':{'type':Sequelize[_0xdf5c('0x2')]},'type':{'type':Sequelize[_0xdf5c('0x5')](_0xdf5c('0x8'),'newTab'),'defaultValue':_0xdf5c('0x8')}}; \ No newline at end of file +var _0x74d6=['username','STRING','ENUM','password','integrationTab'];(function(_0x48f401,_0x5d2d63){var _0x28d72d=function(_0x5251e3){while(--_0x5251e3){_0x48f401['push'](_0x48f401['shift']());}};_0x28d72d(++_0x5d2d63);}(_0x74d6,0xeb));var _0x674d=function(_0x2d8cf8,_0x45dbb1){_0x2d8cf8=_0x2d8cf8-0x0;var _0x147e5b=_0x74d6[_0x2d8cf8];return _0x147e5b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x674d('0x0')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x674d('0x1')]},'remoteUri':{'type':Sequelize[_0x674d('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x674d('0x2')](_0x674d('0x3'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x674d('0x2')](_0x674d('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 957f7b1..4fe8efb 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 _0x0cde=['message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy','stack','name','send','index','ZendeskAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','ZendeskConfiguration','length','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','type','Descriptions','getFields','username','password','token','remoteUri','slice','substring','GET','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','stringify','error'];(function(_0x5232f0,_0x38e509){var _0x526a40=function(_0x5483f2){while(--_0x5483f2){_0x5232f0['push'](_0x5232f0['shift']());}};_0x526a40(++_0x38e509);}(_0x0cde,0x1d0));var _0xe0cd=function(_0x5ebba4,_0x54e215){_0x5ebba4=_0x5ebba4-0x0;var _0x4a510b=_0x0cde[_0x5ebba4];return _0x4a510b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe0cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe0cd('0x1'));var rp=require(_0xe0cd('0x2'));var moment=require(_0xe0cd('0x3'));var BPromise=require(_0xe0cd('0x4'));var Mustache=require(_0xe0cd('0x5'));var util=require(_0xe0cd('0x6'));var path=require(_0xe0cd('0x7'));var sox=require(_0xe0cd('0x8'));var csv=require(_0xe0cd('0x9'));var ejs=require(_0xe0cd('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe0cd('0xb'));var crypto=require(_0xe0cd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe0cd('0x9'));var querystring=require(_0xe0cd('0xd'));var Papa=require(_0xe0cd('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xe0cd('0xf'));var Redis=require(_0xe0cd('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xe0cd('0x11'))(_0xe0cd('0x12'));var utils=require(_0xe0cd('0x13'));var config=require(_0xe0cd('0x14'));var db=require(_0xe0cd('0x15'))['db'];var integrations=require(_0xe0cd('0x16'));var jayson=require(_0xe0cd('0x17'));var client=jayson['client'][_0xe0cd('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x113ecd,_0x479c7a,_0xcf239d,_0x3cf9ec){return new BPromise(function(_0x24fbc8,_0x1b3a15){var _0x1c9ea2=_0x3cf9ec||client;return _0x1c9ea2[_0xe0cd('0x19')](_0x113ecd,_0xcf239d)[_0xe0cd('0x1a')](function(_0x3da23d){logger[_0xe0cd('0x1b')](_0xe0cd('0x1c'),_0x479c7a,'request\x20sent');logger[_0xe0cd('0x1d')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x479c7a,'request\x20sent',JSON[_0xe0cd('0x1e')](_0x3da23d));if(_0x3da23d['error']){if(_0x3da23d[_0xe0cd('0x1f')]['code']===0x1f4){logger[_0xe0cd('0x1f')](_0xe0cd('0x1c'),_0x479c7a,_0x3da23d[_0xe0cd('0x1f')][_0xe0cd('0x20')]);return _0x1b3a15(_0x3da23d[_0xe0cd('0x1f')]['message']);}logger[_0xe0cd('0x1f')]('ZendeskAccount,\x20%s,\x20%s',_0x479c7a,_0x3da23d[_0xe0cd('0x1f')][_0xe0cd('0x20')]);return _0x24fbc8(_0x3da23d[_0xe0cd('0x1f')]['message']);}else{logger[_0xe0cd('0x1b')]('ZendeskAccount,\x20%s,\x20%s',_0x479c7a,_0xe0cd('0x21'));_0x24fbc8(_0x3da23d[_0xe0cd('0x22')]['message']);}})[_0xe0cd('0x23')](function(_0x3c3141){logger['error'](_0xe0cd('0x1c'),_0x479c7a,_0x3c3141);_0x1b3a15(_0x3c3141);});});}function respondWithStatusCode(_0x3222cf,_0x35611d){_0x35611d=_0x35611d||0xcc;return function(_0x1a7618){if(_0x1a7618){return _0x3222cf[_0xe0cd('0x24')](_0x35611d);}return _0x3222cf[_0xe0cd('0x25')](_0x35611d)[_0xe0cd('0x26')]();};}function respondWithResult(_0x3f039e,_0x4a8008){_0x4a8008=_0x4a8008||0xc8;return function(_0x4684c8){if(_0x4684c8){return _0x3f039e['status'](_0x4a8008)[_0xe0cd('0x27')](_0x4684c8);}};}function respondWithFilteredResult(_0x5b4a95,_0x50139b){return function(_0x3a2dc4){if(_0x3a2dc4){var _0x20c898=_0x3a2dc4[_0xe0cd('0x28')],_0xac431f=_0x50139b[_0xe0cd('0x29')],_0x19a9ee=_0x50139b['offset']+_0x50139b[_0xe0cd('0x2a')],_0x5ba2b8;if(_0x19a9ee>=_0x20c898){_0x19a9ee=_0x20c898;_0x5ba2b8=0xc8;}else{_0x5ba2b8=0xce;}_0x5b4a95[_0xe0cd('0x25')](_0x5ba2b8);return _0x5b4a95[_0xe0cd('0x2b')](_0xe0cd('0x2c'),_0xac431f+'-'+_0x19a9ee+'/'+_0x20c898)[_0xe0cd('0x27')](_0x3a2dc4);}return null;};}function patchUpdates(_0x2e4cba){return function(_0x41bc00){try{jsonpatch['apply'](_0x41bc00,_0x2e4cba,!![]);}catch(_0x4d6120){return BPromise['reject'](_0x4d6120);}return _0x41bc00[_0xe0cd('0x2d')]();};}function saveUpdates(_0x39aed9,_0x5808a8){return function(_0x5ddb0a){if(_0x5ddb0a){return _0x5ddb0a[_0xe0cd('0x2e')](_0x39aed9)['then'](function(_0x28d65e){return _0x28d65e;});}return null;};}function removeEntity(_0x3a40c7,_0x9146fe){return function(_0x1484eb){if(_0x1484eb){return _0x1484eb[_0xe0cd('0x2f')]()[_0xe0cd('0x1a')](function(){_0x3a40c7[_0xe0cd('0x25')](0xcc)[_0xe0cd('0x26')]();});}};}function handleEntityNotFound(_0x19d3bb,_0x40126e){return function(_0xf1c83e){if(!_0xf1c83e){_0x19d3bb[_0xe0cd('0x24')](0x194);}return _0xf1c83e;};}function handleError(_0x4596a3,_0x101d60){_0x101d60=_0x101d60||0x1f4;return function(_0x2234af){logger['error'](_0x2234af[_0xe0cd('0x30')]);if(_0x2234af['name']){delete _0x2234af[_0xe0cd('0x31')];}_0x4596a3['status'](_0x101d60)[_0xe0cd('0x32')](_0x2234af);};}exports[_0xe0cd('0x33')]=function(_0x54bbf9,_0x45e547){var _0x42f809={},_0x29b9da={},_0x4f5ab6={'count':0x0,'rows':[]};var _0x51392c=db[_0xe0cd('0x34')][_0xe0cd('0x35')];_0x29b9da['model']=_[_0xe0cd('0x36')](_0x51392c);_0x29b9da[_0xe0cd('0x37')]=_[_0xe0cd('0x36')](_0x54bbf9[_0xe0cd('0x37')]);_0x29b9da[_0xe0cd('0x38')]=_[_0xe0cd('0x39')](_0x29b9da[_0xe0cd('0x3a')],_0x29b9da[_0xe0cd('0x37')]);_0x42f809[_0xe0cd('0x3b')]=_['intersection'](_0x29b9da[_0xe0cd('0x3a')],qs[_0xe0cd('0x3c')](_0x54bbf9[_0xe0cd('0x37')][_0xe0cd('0x3c')]));_0x42f809[_0xe0cd('0x3b')]=_0x42f809[_0xe0cd('0x3b')]['length']?_0x42f809[_0xe0cd('0x3b')]:_0x29b9da[_0xe0cd('0x3a')];if(!_0x54bbf9['query']['hasOwnProperty'](_0xe0cd('0x3d'))){_0x42f809[_0xe0cd('0x2a')]=qs['limit'](_0x54bbf9[_0xe0cd('0x37')][_0xe0cd('0x2a')]);_0x42f809[_0xe0cd('0x29')]=qs[_0xe0cd('0x29')](_0x54bbf9[_0xe0cd('0x37')][_0xe0cd('0x29')]);}_0x42f809[_0xe0cd('0x3e')]=qs[_0xe0cd('0x3f')](_0x54bbf9[_0xe0cd('0x37')]['sort']);_0x42f809[_0xe0cd('0x40')]=qs[_0xe0cd('0x38')](_[_0xe0cd('0x41')](_0x54bbf9[_0xe0cd('0x37')],_0x29b9da[_0xe0cd('0x38')]));if(_0x54bbf9[_0xe0cd('0x37')][_0xe0cd('0x42')]){_0x42f809[_0xe0cd('0x40')]=_[_0xe0cd('0x43')](_0x42f809[_0xe0cd('0x40')],{'$or':_[_0xe0cd('0x44')](_0x51392c,function(_0x3d115d){if(_0x3d115d['type']['key']!==_0xe0cd('0x45')){var _0x99a40f={};_0x99a40f[_0x3d115d['field']]={'$like':'%'+_0x54bbf9[_0xe0cd('0x37')][_0xe0cd('0x42')]+'%'};return _0x99a40f;}})});}_0x42f809=_[_0xe0cd('0x43')]({},_0x42f809,_0x54bbf9[_0xe0cd('0x46')]);var _0x587cd4={'where':_0x42f809[_0xe0cd('0x40')]};return db[_0xe0cd('0x34')][_0xe0cd('0x28')](_0x587cd4)['then'](function(_0x58fd8a){_0x4f5ab6[_0xe0cd('0x28')]=_0x58fd8a;if(_0x54bbf9[_0xe0cd('0x37')][_0xe0cd('0x47')]){_0x42f809[_0xe0cd('0x48')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xe0cd('0x49')](_0x42f809);})[_0xe0cd('0x1a')](function(_0xe75aca){_0x4f5ab6[_0xe0cd('0x4a')]=_0xe75aca;return _0x4f5ab6;})[_0xe0cd('0x1a')](respondWithFilteredResult(_0x45e547,_0x42f809))[_0xe0cd('0x23')](handleError(_0x45e547,null));};exports[_0xe0cd('0x4b')]=function(_0x3fb764,_0x25dbb7){var _0x2c8eb8={'raw':![],'where':{'id':_0x3fb764[_0xe0cd('0x4c')]['id']}},_0x173f47={};_0x173f47[_0xe0cd('0x3a')]=_[_0xe0cd('0x36')](db['ZendeskAccount'][_0xe0cd('0x35')]);_0x173f47[_0xe0cd('0x37')]=_[_0xe0cd('0x36')](_0x3fb764[_0xe0cd('0x37')]);_0x173f47['filters']=_['intersection'](_0x173f47[_0xe0cd('0x3a')],_0x173f47[_0xe0cd('0x37')]);_0x2c8eb8[_0xe0cd('0x3b')]=_[_0xe0cd('0x39')](_0x173f47['model'],qs[_0xe0cd('0x3c')](_0x3fb764[_0xe0cd('0x37')][_0xe0cd('0x3c')]));_0x2c8eb8[_0xe0cd('0x3b')]=_0x2c8eb8['attributes']['length']?_0x2c8eb8[_0xe0cd('0x3b')]:_0x173f47[_0xe0cd('0x3a')];if(_0x3fb764['query'][_0xe0cd('0x47')]){_0x2c8eb8[_0xe0cd('0x48')]=[{'all':!![]}];}_0x2c8eb8=_['merge']({},_0x2c8eb8,_0x3fb764[_0xe0cd('0x46')]);return db[_0xe0cd('0x34')][_0xe0cd('0x4d')](_0x2c8eb8)[_0xe0cd('0x1a')](handleEntityNotFound(_0x25dbb7,null))[_0xe0cd('0x1a')](respondWithResult(_0x25dbb7,null))[_0xe0cd('0x23')](handleError(_0x25dbb7,null));};exports[_0xe0cd('0x4e')]=function(_0x5c2967,_0xf1258a){return db[_0xe0cd('0x34')]['create'](_0x5c2967[_0xe0cd('0x4f')],{})[_0xe0cd('0x1a')](respondWithResult(_0xf1258a,0xc9))[_0xe0cd('0x23')](handleError(_0xf1258a,null));};exports[_0xe0cd('0x2e')]=function(_0x44e0b9,_0xf73960){if(_0x44e0b9[_0xe0cd('0x4f')]['id']){delete _0x44e0b9[_0xe0cd('0x4f')]['id'];}return db[_0xe0cd('0x34')][_0xe0cd('0x4d')]({'where':{'id':_0x44e0b9['params']['id']}})[_0xe0cd('0x1a')](handleEntityNotFound(_0xf73960,null))[_0xe0cd('0x1a')](saveUpdates(_0x44e0b9[_0xe0cd('0x4f')],null))[_0xe0cd('0x1a')](respondWithResult(_0xf73960,null))[_0xe0cd('0x23')](handleError(_0xf73960,null));};exports['destroy']=function(_0xd4baeb,_0x5918be){return db[_0xe0cd('0x34')][_0xe0cd('0x4d')]({'where':{'id':_0xd4baeb[_0xe0cd('0x4c')]['id']}})[_0xe0cd('0x1a')](handleEntityNotFound(_0x5918be,null))[_0xe0cd('0x1a')](removeEntity(_0x5918be,null))[_0xe0cd('0x23')](handleError(_0x5918be,null));};exports['getConfigurations']=function(_0x1e5118,_0x799924,_0x2e3476){var _0x1459be={};var _0x82f246={};var _0x5813f2;var _0x2c5205;return db[_0xe0cd('0x34')]['findOne']({'where':{'id':_0x1e5118['params']['id']}})[_0xe0cd('0x1a')](handleEntityNotFound(_0x799924,null))[_0xe0cd('0x1a')](function(_0xc8da7b){if(_0xc8da7b){_0x5813f2=_0xc8da7b;_0x82f246[_0xe0cd('0x3a')]=_[_0xe0cd('0x36')](db[_0xe0cd('0x50')]['rawAttributes']);_0x82f246['query']=_['keys'](_0x1e5118[_0xe0cd('0x37')]);_0x82f246[_0xe0cd('0x38')]=_[_0xe0cd('0x39')](_0x82f246[_0xe0cd('0x3a')],_0x82f246['query']);_0x1459be[_0xe0cd('0x3b')]=_[_0xe0cd('0x39')](_0x82f246[_0xe0cd('0x3a')],qs[_0xe0cd('0x3c')](_0x1e5118[_0xe0cd('0x37')][_0xe0cd('0x3c')]));_0x1459be[_0xe0cd('0x3b')]=_0x1459be[_0xe0cd('0x3b')][_0xe0cd('0x51')]?_0x1459be[_0xe0cd('0x3b')]:_0x82f246[_0xe0cd('0x3a')];_0x1459be['order']=qs[_0xe0cd('0x3f')](_0x1e5118[_0xe0cd('0x37')][_0xe0cd('0x3f')]);_0x1459be[_0xe0cd('0x40')]=qs[_0xe0cd('0x38')](_[_0xe0cd('0x41')](_0x1e5118[_0xe0cd('0x37')],_0x82f246[_0xe0cd('0x38')]));if(_0x1e5118[_0xe0cd('0x37')]['filter']){_0x1459be[_0xe0cd('0x40')]=_[_0xe0cd('0x43')](_0x1459be['where'],{'$or':_['map'](_0x1459be[_0xe0cd('0x3b')],function(_0x517bad){var _0x1b2bf0={};_0x1b2bf0[_0x517bad]={'$like':'%'+_0x1e5118['query'][_0xe0cd('0x42')]+'%'};return _0x1b2bf0;})});}_0x1459be=_[_0xe0cd('0x43')]({},_0x1459be,_0x1e5118[_0xe0cd('0x46')]);return _0x5813f2[_0xe0cd('0x52')](_0x1459be);}})['then'](function(_0x48eae5){if(_0x48eae5){_0x2c5205=_0x48eae5['length'];if(!_0x1e5118['query']['hasOwnProperty'](_0xe0cd('0x3d'))){_0x1459be['limit']=qs['limit'](_0x1e5118[_0xe0cd('0x37')][_0xe0cd('0x2a')]);_0x1459be[_0xe0cd('0x29')]=qs[_0xe0cd('0x29')](_0x1e5118['query'][_0xe0cd('0x29')]);}return _0x5813f2[_0xe0cd('0x52')](_0x1459be);}})[_0xe0cd('0x1a')](function(_0x2f07e9){if(_0x2f07e9){return _0x2f07e9?{'count':_0x2c5205,'rows':_0x2f07e9}:null;}})[_0xe0cd('0x1a')](respondWithResult(_0x799924,null))['catch'](handleError(_0x799924,null));};exports['addConfiguration']=function(_0x534296,_0x5f55e9,_0x5ee304){if(_0x534296[_0xe0cd('0x4f')]['id']){delete _0x534296[_0xe0cd('0x4f')]['id'];}return db['ZendeskAccount'][_0xe0cd('0x53')]({'where':{'id':_0x534296[_0xe0cd('0x4c')]['id']}})[_0xe0cd('0x1a')](handleEntityNotFound(_0x5f55e9,null))['then'](function(_0x3239cd){if(_0x3239cd){_0x534296[_0xe0cd('0x4f')][_0xe0cd('0x54')]=_0x3239cd['id'];_0x534296[_0xe0cd('0x4f')][_0xe0cd('0x55')]=integrations[_0xe0cd('0x56')](_0x534296[_0xe0cd('0x4f')][_0xe0cd('0x57')],_0x534296[_0xe0cd('0x4f')]['type']);_0x534296['body']['Descriptions']=integrations[_0xe0cd('0x58')](_0x534296['body']['channel'],_0x534296[_0xe0cd('0x4f')][_0xe0cd('0x59')]);return db['ZendeskConfiguration']['create'](_0x534296[_0xe0cd('0x4f')],{'include':[{'model':db['ZendeskField'],'as':_0xe0cd('0x55')},{'model':db['ZendeskField'],'as':_0xe0cd('0x5a')}]});}return null;})[_0xe0cd('0x1a')](respondWithResult(_0x5f55e9,null))['catch'](handleError(_0x5f55e9,null));};exports[_0xe0cd('0x5b')]=function(_0x39a56d,_0x42b21a,_0xd1d3d5){var _0x1b8fd5='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x39a56d['params']['id']},'attributes':['id',_0xe0cd('0x5c'),_0xe0cd('0x5d'),_0xe0cd('0x5e'),'authType',_0xe0cd('0x5f')]})['then'](handleEntityNotFound(_0x42b21a,null))[_0xe0cd('0x1a')](function(_0x2f8686){if(_0x2f8686){_0x1b8fd5=_0x2f8686[_0xe0cd('0x5f')];var _0x1934b4=_0x1b8fd5[_0xe0cd('0x60')](-0x1);if(_0x1934b4==='/'){_0x1b8fd5=_0x1b8fd5[_0xe0cd('0x61')](0x0,_0x1b8fd5['lastIndexOf'](_0x1934b4));}var _0x11bd28={'method':_0xe0cd('0x62'),'uri':util['format'](_0xe0cd('0x63'),_0x1b8fd5,_0xe0cd('0x64')),'json':!![]};switch(_0x2f8686[_0xe0cd('0x65')]){case _0xe0cd('0x5d'):_0x11bd28[_0xe0cd('0x66')]={'Authorization':util[_0xe0cd('0x67')](_0xe0cd('0x68'),new Buffer(util['format'](_0xe0cd('0x69'),_0x2f8686[_0xe0cd('0x5c')],_0x2f8686['password']))[_0xe0cd('0x6a')](_0xe0cd('0x6b')))};break;case _0xe0cd('0x5e'):_0x11bd28[_0xe0cd('0x66')]={'Authorization':util[_0xe0cd('0x67')](_0xe0cd('0x68'),new Buffer(util['format'](_0xe0cd('0x6c'),_0x2f8686['username'],_0x2f8686[_0xe0cd('0x5e')]))[_0xe0cd('0x6a')](_0xe0cd('0x6b')))};break;default:throw new db[(_0xe0cd('0x6d'))][(_0xe0cd('0x6e'))](_0xe0cd('0x6f'));}return rp(_0x11bd28);}})[_0xe0cd('0x1a')](function(_0x571485){if(_0x571485){var _0x434bc9=[_0xe0cd('0x70'),_0xe0cd('0x71'),'group',_0xe0cd('0x72')];_[_0xe0cd('0x73')](_0x571485[_0xe0cd('0x64')],function(_0x53db77){return _0x434bc9[_0xe0cd('0x74')](_0x53db77['type']);});return{'count':_0x571485[_0xe0cd('0x64')][_0xe0cd('0x51')],'rows':_[_0xe0cd('0x44')](_0x571485[_0xe0cd('0x64')],function(_0x202d0d){return{'id':_0x202d0d['id'],'name':_0x202d0d[_0xe0cd('0x75')]>0x7?_0x202d0d['title']:_0x202d0d[_0xe0cd('0x59')],'custom':_0x202d0d[_0xe0cd('0x75')]>0x7?!![]:![],'options':_0x202d0d['system_field_options']?_0x202d0d[_0xe0cd('0x76')]:_0x202d0d[_0xe0cd('0x77')]?_0x202d0d[_0xe0cd('0x77')]:[]};})};}})[_0xe0cd('0x1a')](respondWithResult(_0x42b21a,null))[_0xe0cd('0x23')](function(_0x1a1272){var _0x5b1b4e=_0x39a56d[_0xe0cd('0x37')][_0xe0cd('0x78')]?0x1f4:_0x1a1272['statusCode']||0x1f4;logger[_0xe0cd('0x1f')](_0xe0cd('0x79'),_0xe0cd('0x5b'),_0x5b1b4e,JSON[_0xe0cd('0x1e')](_0x1a1272));delete _0x1a1272[_0xe0cd('0x31')];if(_0x5b1b4e===0x191){_0x5b1b4e=0x190;}_0x42b21a[_0xe0cd('0x25')](_0x5b1b4e)[_0xe0cd('0x32')](_0x39a56d['query']['test']?{'message':_0xe0cd('0x7a'),'statusCode':_0x1a1272[_0xe0cd('0x7b')]}:_0x1a1272);});}; \ No newline at end of file +var _0xde1e=['format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','map','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','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','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','ZendeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','findAll','show','params','create','body','find','getConfigurations','ZendeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','username','token','authType','remoteUri','slice','lastIndexOf','GET'];(function(_0x26645b,_0x2c2d9b){var _0x224520=function(_0x3ab38e){while(--_0x3ab38e){_0x26645b['push'](_0x26645b['shift']());}};_0x224520(++_0x2c2d9b);}(_0xde1e,0x9d));var _0xede1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xde1e[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xede1('0x0'));var emlformat=require(_0xede1('0x1'));var rimraf=require(_0xede1('0x2'));var zipdir=require(_0xede1('0x3'));var jsonpatch=require(_0xede1('0x4'));var rp=require(_0xede1('0x5'));var moment=require('moment');var BPromise=require(_0xede1('0x6'));var Mustache=require(_0xede1('0x7'));var util=require(_0xede1('0x8'));var path=require(_0xede1('0x9'));var sox=require(_0xede1('0xa'));var csv=require(_0xede1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xede1('0xc'));var squel=require(_0xede1('0xd'));var crypto=require(_0xede1('0xe'));var jsforce=require(_0xede1('0xf'));var deskjs=require(_0xede1('0x10'));var toCsv=require(_0xede1('0xb'));var querystring=require('querystring');var Papa=require(_0xede1('0x11'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xede1('0x12'));var qs=require(_0xede1('0x13'));var logger=require(_0xede1('0x14'))(_0xede1('0x15'));var utils=require(_0xede1('0x16'));var config=require(_0xede1('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xede1('0x18'));var jayson=require(_0xede1('0x19'));var client=jayson[_0xede1('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56bcfa,_0x288dc7,_0x2c18bd,_0x1c7cb2){return new BPromise(function(_0x3dea69,_0x1f0d5d){var _0x4e3575=_0x1c7cb2||client;return _0x4e3575[_0xede1('0x1b')](_0x56bcfa,_0x2c18bd)[_0xede1('0x1c')](function(_0x176828){logger[_0xede1('0x1d')](_0xede1('0x1e'),_0x288dc7,_0xede1('0x1f'));logger[_0xede1('0x20')](_0xede1('0x21'),_0x288dc7,'request\x20sent',JSON[_0xede1('0x22')](_0x176828));if(_0x176828[_0xede1('0x23')]){if(_0x176828[_0xede1('0x23')][_0xede1('0x24')]===0x1f4){logger[_0xede1('0x23')](_0xede1('0x1e'),_0x288dc7,_0x176828[_0xede1('0x23')][_0xede1('0x25')]);return _0x1f0d5d(_0x176828[_0xede1('0x23')][_0xede1('0x25')]);}logger[_0xede1('0x23')]('ZendeskAccount,\x20%s,\x20%s',_0x288dc7,_0x176828[_0xede1('0x23')]['message']);return _0x3dea69(_0x176828['error'][_0xede1('0x25')]);}else{logger[_0xede1('0x1d')](_0xede1('0x1e'),_0x288dc7,_0xede1('0x1f'));_0x3dea69(_0x176828[_0xede1('0x26')][_0xede1('0x25')]);}})[_0xede1('0x27')](function(_0x38f970){logger['error'](_0xede1('0x1e'),_0x288dc7,_0x38f970);_0x1f0d5d(_0x38f970);});});}function respondWithStatusCode(_0x3c13d9,_0x588cd4){_0x588cd4=_0x588cd4||0xcc;return function(_0x530ab8){if(_0x530ab8){return _0x3c13d9[_0xede1('0x28')](_0x588cd4);}return _0x3c13d9[_0xede1('0x29')](_0x588cd4)['end']();};}function respondWithResult(_0x50bc2f,_0x47fff3){_0x47fff3=_0x47fff3||0xc8;return function(_0x12149f){if(_0x12149f){return _0x50bc2f[_0xede1('0x29')](_0x47fff3)[_0xede1('0x2a')](_0x12149f);}};}function respondWithFilteredResult(_0x1a5569,_0x36ddc8){return function(_0x1cc7eb){if(_0x1cc7eb){var _0x2a8ebb=_0x1cc7eb[_0xede1('0x2b')],_0x174ec3=_0x36ddc8[_0xede1('0x2c')],_0x23509d=_0x36ddc8['offset']+_0x36ddc8[_0xede1('0x2d')],_0x4719be;if(_0x23509d>=_0x2a8ebb){_0x23509d=_0x2a8ebb;_0x4719be=0xc8;}else{_0x4719be=0xce;}_0x1a5569[_0xede1('0x29')](_0x4719be);return _0x1a5569['set'](_0xede1('0x2e'),_0x174ec3+'-'+_0x23509d+'/'+_0x2a8ebb)[_0xede1('0x2a')](_0x1cc7eb);}return null;};}function patchUpdates(_0xbf0a98){return function(_0x357173){try{jsonpatch[_0xede1('0x2f')](_0x357173,_0xbf0a98,!![]);}catch(_0xc8d879){return BPromise[_0xede1('0x30')](_0xc8d879);}return _0x357173[_0xede1('0x31')]();};}function saveUpdates(_0x1fe5c3,_0x5a7bdd){return function(_0x47fd68){if(_0x47fd68){return _0x47fd68[_0xede1('0x32')](_0x1fe5c3)['then'](function(_0x347a7b){return _0x347a7b;});}return null;};}function removeEntity(_0x27ab56,_0x393ece){return function(_0x3661a8){if(_0x3661a8){return _0x3661a8[_0xede1('0x33')]()[_0xede1('0x1c')](function(){_0x27ab56[_0xede1('0x29')](0xcc)[_0xede1('0x34')]();});}};}function handleEntityNotFound(_0x3596a1,_0x4e55bb){return function(_0x232a79){if(!_0x232a79){_0x3596a1['sendStatus'](0x194);}return _0x232a79;};}function handleError(_0x2b401f,_0x4a0698){_0x4a0698=_0x4a0698||0x1f4;return function(_0x46a483){logger[_0xede1('0x23')](_0x46a483[_0xede1('0x35')]);if(_0x46a483[_0xede1('0x36')]){delete _0x46a483[_0xede1('0x36')];}_0x2b401f['status'](_0x4a0698)[_0xede1('0x37')](_0x46a483);};}exports['index']=function(_0x14967c,_0x10ff2f){var _0x12d116={},_0x13c9f4={},_0x3c028b={'count':0x0,'rows':[]};var _0x53f563=db[_0xede1('0x38')][_0xede1('0x39')];_0x13c9f4[_0xede1('0x3a')]=_[_0xede1('0x3b')](_0x53f563);_0x13c9f4[_0xede1('0x3c')]=_[_0xede1('0x3b')](_0x14967c['query']);_0x13c9f4[_0xede1('0x3d')]=_[_0xede1('0x3e')](_0x13c9f4[_0xede1('0x3a')],_0x13c9f4['query']);_0x12d116[_0xede1('0x3f')]=_[_0xede1('0x3e')](_0x13c9f4['model'],qs[_0xede1('0x40')](_0x14967c[_0xede1('0x3c')]['fields']));_0x12d116['attributes']=_0x12d116[_0xede1('0x3f')][_0xede1('0x41')]?_0x12d116[_0xede1('0x3f')]:_0x13c9f4[_0xede1('0x3a')];if(!_0x14967c[_0xede1('0x3c')][_0xede1('0x42')](_0xede1('0x43'))){_0x12d116[_0xede1('0x2d')]=qs[_0xede1('0x2d')](_0x14967c[_0xede1('0x3c')]['limit']);_0x12d116[_0xede1('0x2c')]=qs[_0xede1('0x2c')](_0x14967c[_0xede1('0x3c')][_0xede1('0x2c')]);}_0x12d116[_0xede1('0x44')]=qs[_0xede1('0x45')](_0x14967c['query'][_0xede1('0x45')]);_0x12d116[_0xede1('0x46')]=qs[_0xede1('0x3d')](_[_0xede1('0x47')](_0x14967c[_0xede1('0x3c')],_0x13c9f4[_0xede1('0x3d')]));if(_0x14967c[_0xede1('0x3c')][_0xede1('0x48')]){_0x12d116[_0xede1('0x46')]=_[_0xede1('0x49')](_0x12d116[_0xede1('0x46')],{'$or':_['map'](_0x53f563,function(_0x16cf6a){if(_0x16cf6a[_0xede1('0x4a')]['key']!==_0xede1('0x4b')){var _0x2ac8db={};_0x2ac8db[_0x16cf6a[_0xede1('0x4c')]]={'$like':'%'+_0x14967c[_0xede1('0x3c')][_0xede1('0x48')]+'%'};return _0x2ac8db;}})});}_0x12d116=_[_0xede1('0x49')]({},_0x12d116,_0x14967c[_0xede1('0x4d')]);var _0x46003b={'where':_0x12d116['where']};return db['ZendeskAccount'][_0xede1('0x2b')](_0x46003b)[_0xede1('0x1c')](function(_0x1b359e){_0x3c028b['count']=_0x1b359e;if(_0x14967c[_0xede1('0x3c')][_0xede1('0x4e')]){_0x12d116['include']=[{'all':!![]}];}return db[_0xede1('0x38')][_0xede1('0x4f')](_0x12d116);})[_0xede1('0x1c')](function(_0x2c1ec5){_0x3c028b['rows']=_0x2c1ec5;return _0x3c028b;})['then'](respondWithFilteredResult(_0x10ff2f,_0x12d116))[_0xede1('0x27')](handleError(_0x10ff2f,null));};exports[_0xede1('0x50')]=function(_0x3d699f,_0x4a7804){var _0x80f061={'raw':![],'where':{'id':_0x3d699f[_0xede1('0x51')]['id']}},_0x57cc43={};_0x57cc43[_0xede1('0x3a')]=_[_0xede1('0x3b')](db[_0xede1('0x38')][_0xede1('0x39')]);_0x57cc43[_0xede1('0x3c')]=_[_0xede1('0x3b')](_0x3d699f['query']);_0x57cc43[_0xede1('0x3d')]=_[_0xede1('0x3e')](_0x57cc43['model'],_0x57cc43[_0xede1('0x3c')]);_0x80f061[_0xede1('0x3f')]=_[_0xede1('0x3e')](_0x57cc43[_0xede1('0x3a')],qs[_0xede1('0x40')](_0x3d699f[_0xede1('0x3c')][_0xede1('0x40')]));_0x80f061[_0xede1('0x3f')]=_0x80f061[_0xede1('0x3f')][_0xede1('0x41')]?_0x80f061[_0xede1('0x3f')]:_0x57cc43[_0xede1('0x3a')];if(_0x3d699f[_0xede1('0x3c')][_0xede1('0x4e')]){_0x80f061['include']=[{'all':!![]}];}_0x80f061=_[_0xede1('0x49')]({},_0x80f061,_0x3d699f[_0xede1('0x4d')]);return db[_0xede1('0x38')]['find'](_0x80f061)[_0xede1('0x1c')](handleEntityNotFound(_0x4a7804,null))[_0xede1('0x1c')](respondWithResult(_0x4a7804,null))[_0xede1('0x27')](handleError(_0x4a7804,null));};exports[_0xede1('0x52')]=function(_0x2babbf,_0x5a472d){return db[_0xede1('0x38')][_0xede1('0x52')](_0x2babbf[_0xede1('0x53')],{})[_0xede1('0x1c')](respondWithResult(_0x5a472d,0xc9))['catch'](handleError(_0x5a472d,null));};exports[_0xede1('0x32')]=function(_0x2f285e,_0x3ee763){if(_0x2f285e[_0xede1('0x53')]['id']){delete _0x2f285e[_0xede1('0x53')]['id'];}return db[_0xede1('0x38')][_0xede1('0x54')]({'where':{'id':_0x2f285e[_0xede1('0x51')]['id']}})['then'](handleEntityNotFound(_0x3ee763,null))[_0xede1('0x1c')](saveUpdates(_0x2f285e[_0xede1('0x53')],null))[_0xede1('0x1c')](respondWithResult(_0x3ee763,null))[_0xede1('0x27')](handleError(_0x3ee763,null));};exports[_0xede1('0x33')]=function(_0x21ad74,_0x538313){return db[_0xede1('0x38')][_0xede1('0x54')]({'where':{'id':_0x21ad74[_0xede1('0x51')]['id']}})[_0xede1('0x1c')](handleEntityNotFound(_0x538313,null))[_0xede1('0x1c')](removeEntity(_0x538313,null))['catch'](handleError(_0x538313,null));};exports[_0xede1('0x55')]=function(_0x156b51,_0x24e64f,_0x44f654){var _0x30d57d={};var _0x479c56={};var _0x51cc86;var _0xe6e59c;return db[_0xede1('0x38')]['findOne']({'where':{'id':_0x156b51[_0xede1('0x51')]['id']}})['then'](handleEntityNotFound(_0x24e64f,null))[_0xede1('0x1c')](function(_0x882822){if(_0x882822){_0x51cc86=_0x882822;_0x479c56[_0xede1('0x3a')]=_[_0xede1('0x3b')](db[_0xede1('0x56')][_0xede1('0x39')]);_0x479c56[_0xede1('0x3c')]=_[_0xede1('0x3b')](_0x156b51[_0xede1('0x3c')]);_0x479c56[_0xede1('0x3d')]=_['intersection'](_0x479c56[_0xede1('0x3a')],_0x479c56[_0xede1('0x3c')]);_0x30d57d['attributes']=_[_0xede1('0x3e')](_0x479c56[_0xede1('0x3a')],qs[_0xede1('0x40')](_0x156b51[_0xede1('0x3c')][_0xede1('0x40')]));_0x30d57d['attributes']=_0x30d57d[_0xede1('0x3f')]['length']?_0x30d57d[_0xede1('0x3f')]:_0x479c56[_0xede1('0x3a')];_0x30d57d[_0xede1('0x44')]=qs['sort'](_0x156b51[_0xede1('0x3c')][_0xede1('0x45')]);_0x30d57d['where']=qs[_0xede1('0x3d')](_['pick'](_0x156b51[_0xede1('0x3c')],_0x479c56[_0xede1('0x3d')]));if(_0x156b51[_0xede1('0x3c')][_0xede1('0x48')]){_0x30d57d[_0xede1('0x46')]=_[_0xede1('0x49')](_0x30d57d[_0xede1('0x46')],{'$or':_['map'](_0x30d57d[_0xede1('0x3f')],function(_0x17b7bf){var _0x5dddc0={};_0x5dddc0[_0x17b7bf]={'$like':'%'+_0x156b51[_0xede1('0x3c')][_0xede1('0x48')]+'%'};return _0x5dddc0;})});}_0x30d57d=_[_0xede1('0x49')]({},_0x30d57d,_0x156b51[_0xede1('0x4d')]);return _0x51cc86[_0xede1('0x55')](_0x30d57d);}})['then'](function(_0x545a03){if(_0x545a03){_0xe6e59c=_0x545a03[_0xede1('0x41')];if(!_0x156b51['query'][_0xede1('0x42')](_0xede1('0x43'))){_0x30d57d[_0xede1('0x2d')]=qs[_0xede1('0x2d')](_0x156b51[_0xede1('0x3c')][_0xede1('0x2d')]);_0x30d57d[_0xede1('0x2c')]=qs[_0xede1('0x2c')](_0x156b51[_0xede1('0x3c')][_0xede1('0x2c')]);}return _0x51cc86[_0xede1('0x55')](_0x30d57d);}})[_0xede1('0x1c')](function(_0x5de3c4){if(_0x5de3c4){return _0x5de3c4?{'count':_0xe6e59c,'rows':_0x5de3c4}:null;}})['then'](respondWithResult(_0x24e64f,null))[_0xede1('0x27')](handleError(_0x24e64f,null));};exports[_0xede1('0x57')]=function(_0x2fc2a4,_0x332dd8,_0x41983f){if(_0x2fc2a4[_0xede1('0x53')]['id']){delete _0x2fc2a4[_0xede1('0x53')]['id'];}return db['ZendeskAccount'][_0xede1('0x58')]({'where':{'id':_0x2fc2a4[_0xede1('0x51')]['id']}})['then'](handleEntityNotFound(_0x332dd8,null))[_0xede1('0x1c')](function(_0x4c6592){if(_0x4c6592){_0x2fc2a4[_0xede1('0x53')][_0xede1('0x59')]=_0x4c6592['id'];_0x2fc2a4[_0xede1('0x53')][_0xede1('0x5a')]=integrations[_0xede1('0x5b')](_0x2fc2a4[_0xede1('0x53')][_0xede1('0x5c')],_0x2fc2a4[_0xede1('0x53')][_0xede1('0x4a')]);_0x2fc2a4[_0xede1('0x53')]['Descriptions']=integrations['getDescriptions'](_0x2fc2a4['body']['channel'],_0x2fc2a4['body'][_0xede1('0x4a')]);return db[_0xede1('0x56')]['create'](_0x2fc2a4['body'],{'include':[{'model':db[_0xede1('0x5d')],'as':_0xede1('0x5a')},{'model':db[_0xede1('0x5d')],'as':_0xede1('0x5e')}]});}return null;})['then'](respondWithResult(_0x332dd8,null))['catch'](handleError(_0x332dd8,null));};exports[_0xede1('0x5f')]=function(_0x1e2fb3,_0x32525e,_0x49ba62){var _0x520d34='';return db[_0xede1('0x38')][_0xede1('0x58')]({'where':{'id':_0x1e2fb3[_0xede1('0x51')]['id']},'attributes':['id',_0xede1('0x60'),'password',_0xede1('0x61'),_0xede1('0x62'),_0xede1('0x63')]})[_0xede1('0x1c')](handleEntityNotFound(_0x32525e,null))[_0xede1('0x1c')](function(_0x4187c6){if(_0x4187c6){_0x520d34=_0x4187c6[_0xede1('0x63')];var _0x5b5db8=_0x520d34[_0xede1('0x64')](-0x1);if(_0x5b5db8==='/'){_0x520d34=_0x520d34['substring'](0x0,_0x520d34[_0xede1('0x65')](_0x5b5db8));}var _0x108f1a={'method':_0xede1('0x66'),'uri':util[_0xede1('0x67')](_0xede1('0x68'),_0x520d34,_0xede1('0x69')),'json':!![]};switch(_0x4187c6[_0xede1('0x62')]){case _0xede1('0x6a'):_0x108f1a[_0xede1('0x6b')]={'Authorization':util[_0xede1('0x67')](_0xede1('0x6c'),new Buffer(util[_0xede1('0x67')](_0xede1('0x6d'),_0x4187c6[_0xede1('0x60')],_0x4187c6[_0xede1('0x6a')]))['toString'](_0xede1('0x6e')))};break;case _0xede1('0x61'):_0x108f1a[_0xede1('0x6b')]={'Authorization':util[_0xede1('0x67')]('Basic\x20%s',new Buffer(util['format'](_0xede1('0x6f'),_0x4187c6[_0xede1('0x60')],_0x4187c6[_0xede1('0x61')]))[_0xede1('0x70')]('base64'))};break;default:throw new db[(_0xede1('0x71'))][(_0xede1('0x72'))](_0xede1('0x73'));}return rp(_0x108f1a);}})['then'](function(_0x433609){if(_0x433609){var _0x28677b=[_0xede1('0x74'),_0xede1('0x75'),'group',_0xede1('0x76')];_[_0xede1('0x77')](_0x433609[_0xede1('0x69')],function(_0x3c1852){return _0x28677b[_0xede1('0x78')](_0x3c1852[_0xede1('0x4a')]);});return{'count':_0x433609[_0xede1('0x69')][_0xede1('0x41')],'rows':_[_0xede1('0x79')](_0x433609[_0xede1('0x69')],function(_0xde537d){return{'id':_0xde537d['id'],'name':_0xde537d[_0xede1('0x7a')]>0x7?_0xde537d[_0xede1('0x7b')]:_0xde537d['type'],'custom':_0xde537d[_0xede1('0x7a')]>0x7?!![]:![],'options':_0xde537d[_0xede1('0x7c')]?_0xde537d['system_field_options']:_0xde537d[_0xede1('0x7d')]?_0xde537d[_0xede1('0x7d')]:[]};})};}})['then'](respondWithResult(_0x32525e,null))[_0xede1('0x27')](function(_0xd2b70a){var _0x183aa1=_0x1e2fb3['query'][_0xede1('0x7e')]?0x1f4:_0xd2b70a[_0xede1('0x7f')]||0x1f4;logger[_0xede1('0x23')](_0xede1('0x80'),_0xede1('0x5f'),_0x183aa1,JSON[_0xede1('0x22')](_0xd2b70a));delete _0xd2b70a[_0xede1('0x36')];if(_0x183aa1===0x191){_0x183aa1=0x190;}_0x32525e[_0xede1('0x29')](_0x183aa1)[_0xede1('0x37')](_0x1e2fb3[_0xede1('0x3c')][_0xede1('0x7e')]?{'message':_0xede1('0x81'),'statusCode':_0xd2b70a['statusCode']}:_0xd2b70a);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 0b400bb..76419e7 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 _0xb6db=['moment','bluebird','request-promise','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','util','../../config/logger','api'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0xb6db,0xef));var _0xbb6d=function(_0x33b9d2,_0x290cef){_0x33b9d2=_0x33b9d2-0x0;var _0x4384e8=_0xb6db[_0x33b9d2];return _0x4384e8;};'use strict';var _=require('lodash');var util=require(_0xbb6d('0x0'));var logger=require(_0xbb6d('0x1'))(_0xbb6d('0x2'));var moment=require(_0xbb6d('0x3'));var BPromise=require(_0xbb6d('0x4'));var rp=require(_0xbb6d('0x5'));var attributes=require(_0xbb6d('0x6'));var integrations=require(_0xbb6d('0x7'));module[_0xbb6d('0x8')]=function(_0x3e13b7,_0x493568){return _0x3e13b7[_0xbb6d('0x9')]('ZendeskAccount',attributes,{'tableName':_0xbb6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1943=['request-promise','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','moment','bluebird'];(function(_0x53341e,_0x2d30b1){var _0x5408d1=function(_0x4f109f){while(--_0x4f109f){_0x53341e['push'](_0x53341e['shift']());}};_0x5408d1(++_0x2d30b1);}(_0x1943,0xed));var _0x3194=function(_0xc59d5d,_0x5a6b47){_0xc59d5d=_0xc59d5d-0x0;var _0x3771b1=_0x1943[_0xc59d5d];return _0x3771b1;};'use strict';var _=require(_0x3194('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3194('0x1'));var BPromise=require(_0x3194('0x2'));var rp=require(_0x3194('0x3'));var attributes=require(_0x3194('0x4'));var integrations=require(_0x3194('0x5'));module[_0x3194('0x6')]=function(_0x5f55d7,_0x5bf118){return _0x5f55d7[_0x3194('0x7')](_0x3194('0x8'),attributes,{'tableName':_0x3194('0x9'),'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 c6fa825..1b3eeff 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 _0x2c8f=['include','map','model','attributes','ShowZendeskAccount','find','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit'];(function(_0x381cd7,_0x5cd931){var _0x42fb4d=function(_0x2ee505){while(--_0x2ee505){_0x381cd7['push'](_0x381cd7['shift']());}};_0x42fb4d(++_0x5cd931);}(_0x2c8f,0x192));var _0xf2c8=function(_0x4f9e74,_0x5a5b40){_0x4f9e74=_0x4f9e74-0x0;var _0x36f2e1=_0x2c8f[_0x4f9e74];return _0x36f2e1;};'use strict';var _=require('lodash');var util=require(_0xf2c8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2c8('0x1'));var db=require(_0xf2c8('0x2'))['db'];var utils=require(_0xf2c8('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf2c8('0x4'));var jayson=require(_0xf2c8('0x5'));var client=jayson[_0xf2c8('0x6')][_0xf2c8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2785ee,_0x4eae22,_0x475616){return new BPromise(function(_0x28cc0d,_0x4e3109){return client[_0xf2c8('0x8')](_0x2785ee,_0x475616)[_0xf2c8('0x9')](function(_0x2112fc){logger['info'](_0xf2c8('0xa'),_0x4eae22,_0xf2c8('0xb'));logger[_0xf2c8('0xc')](_0xf2c8('0xd'),_0x4eae22,_0xf2c8('0xb'),JSON[_0xf2c8('0xe')](_0x2112fc));if(_0x2112fc[_0xf2c8('0xf')]){if(_0x2112fc[_0xf2c8('0xf')]['code']===0x1f4){logger[_0xf2c8('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x4eae22,_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);return _0x4e3109(_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);}logger[_0xf2c8('0xf')](_0xf2c8('0xa'),_0x4eae22,_0x2112fc['error'][_0xf2c8('0x10')]);return _0x28cc0d(_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);}else{logger[_0xf2c8('0x11')](_0xf2c8('0xa'),_0x4eae22,_0xf2c8('0xb'));_0x28cc0d(_0x2112fc[_0xf2c8('0x12')]['message']);}})[_0xf2c8('0x13')](function(_0x3cbc33){logger[_0xf2c8('0xf')](_0xf2c8('0xa'),_0x4eae22,_0x3cbc33);_0x4e3109(_0x3cbc33);});});}exports[_0xf2c8('0x14')]=function(_0x52e9d0){var _0x49a07c=this;return new Promise(function(_0x104d9d,_0x290953){return db[_0xf2c8('0x15')][_0xf2c8('0x16')]({'raw':_0x52e9d0['options']?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x18')]===undefined?!![]:![]:!![],'where':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0['options'][_0xf2c8('0x19')]||null:null,'attributes':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0['options']['attributes']||null:null,'limit':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x1a')]||null:null,'include':_0x52e9d0['options']?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x52e9d0[_0xf2c8('0x17')]['include'],function(_0x17956f){return{'model':db[_0x17956f[_0xf2c8('0x1d')]],'as':_0x17956f['as'],'attributes':_0x17956f[_0xf2c8('0x1e')],'include':_0x17956f[_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x17956f['include'],function(_0x93707c){return{'model':db[_0x93707c['model']],'as':_0x93707c['as'],'attributes':_0x93707c[_0xf2c8('0x1e')],'include':_0x93707c[_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x93707c[_0xf2c8('0x1b')],function(_0x1d2e74){return{'model':db[_0x1d2e74[_0xf2c8('0x1d')]],'as':_0x1d2e74['as'],'attributes':_0x1d2e74[_0xf2c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf2c8('0x9')](function(_0x33f1b0){logger[_0xf2c8('0x11')](_0xf2c8('0x14'),_0x52e9d0);logger[_0xf2c8('0xc')](_0xf2c8('0x14'),_0x52e9d0,JSON['stringify'](_0x33f1b0));_0x104d9d(_0x33f1b0);})[_0xf2c8('0x13')](function(_0x5146e4){logger['error'](_0xf2c8('0x14'),_0x5146e4['message'],_0x52e9d0);_0x290953(_0x49a07c[_0xf2c8('0xf')](0x1f4,_0x5146e4[_0xf2c8('0x10')]));});});};exports[_0xf2c8('0x1f')]=function(_0x10c825){var _0x123b45=this;return new Promise(function(_0x12a547,_0x27a7dc){return db['ZendeskAccount'][_0xf2c8('0x20')]({'raw':_0x10c825[_0xf2c8('0x17')]?_0x10c825[_0xf2c8('0x17')][_0xf2c8('0x18')]===undefined?!![]:![]:!![],'where':_0x10c825[_0xf2c8('0x17')]?_0x10c825[_0xf2c8('0x17')]['where']||null:null,'attributes':_0x10c825[_0xf2c8('0x17')]?_0x10c825['options'][_0xf2c8('0x1e')]||null:null,'include':_0x10c825['options']?_0x10c825[_0xf2c8('0x17')][_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x10c825[_0xf2c8('0x17')][_0xf2c8('0x1b')],function(_0x5b6e0b){return{'model':db[_0x5b6e0b[_0xf2c8('0x1d')]],'as':_0x5b6e0b['as'],'attributes':_0x5b6e0b[_0xf2c8('0x1e')],'include':_0x5b6e0b['include']?_[_0xf2c8('0x1c')](_0x5b6e0b[_0xf2c8('0x1b')],function(_0x4a24e8){return{'model':db[_0x4a24e8[_0xf2c8('0x1d')]],'as':_0x4a24e8['as'],'attributes':_0x4a24e8[_0xf2c8('0x1e')],'include':_0x4a24e8[_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x4a24e8[_0xf2c8('0x1b')],function(_0x54e851){return{'model':db[_0x54e851['model']],'as':_0x54e851['as'],'attributes':_0x54e851[_0xf2c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf2c8('0x9')](function(_0xb48f51){logger[_0xf2c8('0x11')](_0xf2c8('0x1f'),_0x10c825);logger[_0xf2c8('0xc')](_0xf2c8('0x1f'),_0x10c825,JSON[_0xf2c8('0xe')](_0xb48f51));_0x12a547(_0xb48f51);})['catch'](function(_0x2e7c54){logger[_0xf2c8('0xf')](_0xf2c8('0x1f'),_0x2e7c54['message'],_0x10c825);_0x27a7dc(_0x123b45['error'](0x1f4,_0x2e7c54['message']));});});}; \ No newline at end of file +var _0x6c3d=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','findAll','options','raw','limit','map','include','model','attributes','debug','ShowZendeskAccount','ZendeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x457608,_0x1100f9){var _0x1e5eed=function(_0x15dbc5){while(--_0x15dbc5){_0x457608['push'](_0x457608['shift']());}};_0x1e5eed(++_0x1100f9);}(_0x6c3d,0x96));var _0xd6c3=function(_0x37a42a,_0x56692a){_0x37a42a=_0x37a42a-0x0;var _0x4c1b15=_0x6c3d[_0x37a42a];return _0x4c1b15;};'use strict';var _=require(_0xd6c3('0x0'));var util=require(_0xd6c3('0x1'));var moment=require(_0xd6c3('0x2'));var BPromise=require(_0xd6c3('0x3'));var rs=require(_0xd6c3('0x4'));var fs=require('fs');var Redis=require(_0xd6c3('0x5'));var db=require(_0xd6c3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6c3('0x7'))(_0xd6c3('0x8'));var config=require(_0xd6c3('0x9'));var jayson=require(_0xd6c3('0xa'));var client=jayson[_0xd6c3('0xb')][_0xd6c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1728a2,_0x4a5436,_0x4a89d0){return new BPromise(function(_0x33edba,_0x1925e1){return client[_0xd6c3('0xd')](_0x1728a2,_0x4a89d0)[_0xd6c3('0xe')](function(_0x1af156){logger[_0xd6c3('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x4a5436,_0xd6c3('0x10'));logger['debug'](_0xd6c3('0x11'),_0x4a5436,_0xd6c3('0x10'),JSON[_0xd6c3('0x12')](_0x1af156));if(_0x1af156[_0xd6c3('0x13')]){if(_0x1af156[_0xd6c3('0x13')][_0xd6c3('0x14')]===0x1f4){logger[_0xd6c3('0x13')](_0xd6c3('0x15'),_0x4a5436,_0x1af156['error'][_0xd6c3('0x16')]);return _0x1925e1(_0x1af156[_0xd6c3('0x13')][_0xd6c3('0x16')]);}logger[_0xd6c3('0x13')](_0xd6c3('0x15'),_0x4a5436,_0x1af156[_0xd6c3('0x13')][_0xd6c3('0x16')]);return _0x33edba(_0x1af156['error'][_0xd6c3('0x16')]);}else{logger[_0xd6c3('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x4a5436,_0xd6c3('0x10'));_0x33edba(_0x1af156[_0xd6c3('0x17')][_0xd6c3('0x16')]);}})[_0xd6c3('0x18')](function(_0x1529e6){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4a5436,_0x1529e6);_0x1925e1(_0x1529e6);});});}exports[_0xd6c3('0x19')]=function(_0x3e9ecc){var _0x4a8fe9=this;return new Promise(function(_0x354b5a,_0x1b3969){return db['ZendeskAccount'][_0xd6c3('0x1a')]({'raw':_0x3e9ecc[_0xd6c3('0x1b')]?_0x3e9ecc[_0xd6c3('0x1b')][_0xd6c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e9ecc['options']?_0x3e9ecc[_0xd6c3('0x1b')]['where']||null:null,'attributes':_0x3e9ecc[_0xd6c3('0x1b')]?_0x3e9ecc['options']['attributes']||null:null,'limit':_0x3e9ecc[_0xd6c3('0x1b')]?_0x3e9ecc['options'][_0xd6c3('0x1d')]||null:null,'include':_0x3e9ecc['options']?_0x3e9ecc[_0xd6c3('0x1b')]['include']?_[_0xd6c3('0x1e')](_0x3e9ecc[_0xd6c3('0x1b')][_0xd6c3('0x1f')],function(_0x4fdbfb){return{'model':db[_0x4fdbfb[_0xd6c3('0x20')]],'as':_0x4fdbfb['as'],'attributes':_0x4fdbfb[_0xd6c3('0x21')],'include':_0x4fdbfb[_0xd6c3('0x1f')]?_[_0xd6c3('0x1e')](_0x4fdbfb['include'],function(_0x48746f){return{'model':db[_0x48746f[_0xd6c3('0x20')]],'as':_0x48746f['as'],'attributes':_0x48746f[_0xd6c3('0x21')],'include':_0x48746f[_0xd6c3('0x1f')]?_[_0xd6c3('0x1e')](_0x48746f[_0xd6c3('0x1f')],function(_0x2bd83e){return{'model':db[_0x2bd83e[_0xd6c3('0x20')]],'as':_0x2bd83e['as'],'attributes':_0x2bd83e[_0xd6c3('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e5f11){logger[_0xd6c3('0xf')](_0xd6c3('0x19'),_0x3e9ecc);logger[_0xd6c3('0x22')](_0xd6c3('0x19'),_0x3e9ecc,JSON[_0xd6c3('0x12')](_0x5e5f11));_0x354b5a(_0x5e5f11);})[_0xd6c3('0x18')](function(_0x102bf5){logger[_0xd6c3('0x13')](_0xd6c3('0x19'),_0x102bf5[_0xd6c3('0x16')],_0x3e9ecc);_0x1b3969(_0x4a8fe9[_0xd6c3('0x13')](0x1f4,_0x102bf5['message']));});});};exports[_0xd6c3('0x23')]=function(_0x480c80){var _0x206100=this;return new Promise(function(_0x90d193,_0x59258f){return db[_0xd6c3('0x24')][_0xd6c3('0x25')]({'raw':_0x480c80[_0xd6c3('0x1b')]?_0x480c80[_0xd6c3('0x1b')][_0xd6c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x480c80[_0xd6c3('0x1b')]?_0x480c80[_0xd6c3('0x1b')][_0xd6c3('0x26')]||null:null,'attributes':_0x480c80['options']?_0x480c80[_0xd6c3('0x1b')][_0xd6c3('0x21')]||null:null,'include':_0x480c80['options']?_0x480c80[_0xd6c3('0x1b')]['include']?_[_0xd6c3('0x1e')](_0x480c80[_0xd6c3('0x1b')][_0xd6c3('0x1f')],function(_0x26d6cd){return{'model':db[_0x26d6cd[_0xd6c3('0x20')]],'as':_0x26d6cd['as'],'attributes':_0x26d6cd[_0xd6c3('0x21')],'include':_0x26d6cd[_0xd6c3('0x1f')]?_['map'](_0x26d6cd[_0xd6c3('0x1f')],function(_0x30e4c8){return{'model':db[_0x30e4c8[_0xd6c3('0x20')]],'as':_0x30e4c8['as'],'attributes':_0x30e4c8[_0xd6c3('0x21')],'include':_0x30e4c8[_0xd6c3('0x1f')]?_[_0xd6c3('0x1e')](_0x30e4c8[_0xd6c3('0x1f')],function(_0xa906bb){return{'model':db[_0xa906bb[_0xd6c3('0x20')]],'as':_0xa906bb['as'],'attributes':_0xa906bb[_0xd6c3('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5eefce){logger['info'](_0xd6c3('0x23'),_0x480c80);logger[_0xd6c3('0x22')](_0xd6c3('0x23'),_0x480c80,JSON['stringify'](_0x5eefce));_0x90d193(_0x5eefce);})[_0xd6c3('0x18')](function(_0x18e092){logger['error']('ShowZendeskAccount',_0x18e092[_0xd6c3('0x16')],_0x480c80);_0x59258f(_0x206100[_0xd6c3('0x13')](0x1f4,_0x18e092[_0xd6c3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 1706075..55c6594 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 _0x7e03=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','setTags','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields'];(function(_0x44e811,_0x59df8a){var _0x4b3fc4=function(_0x475cdf){while(--_0x475cdf){_0x44e811['push'](_0x44e811['shift']());}};_0x4b3fc4(++_0x59df8a);}(_0x7e03,0x152));var _0x37e0=function(_0x2f70e6,_0x23aa34){_0x2f70e6=_0x2f70e6-0x0;var _0x18175a=_0x7e03[_0x2f70e6];return _0x18175a;};'use strict';var multer=require('multer');var util=require(_0x37e0('0x0'));var path=require(_0x37e0('0x1'));var timeout=require(_0x37e0('0x2'));var express=require('express');var router=express[_0x37e0('0x3')]();var auth=require(_0x37e0('0x4'));var interaction=require(_0x37e0('0x5'));var config=require(_0x37e0('0x6'));var controller=require(_0x37e0('0x7'));router[_0x37e0('0x8')]('/',auth[_0x37e0('0x9')](),controller[_0x37e0('0xa')]);router['get']('/:id',auth[_0x37e0('0x9')](),controller[_0x37e0('0xb')]);router[_0x37e0('0x8')](_0x37e0('0xc'),auth['isAuthenticated'](),controller[_0x37e0('0xd')]);router[_0x37e0('0x8')](_0x37e0('0xe'),auth[_0x37e0('0x9')](),controller[_0x37e0('0xf')]);router[_0x37e0('0x8')](_0x37e0('0x10'),auth[_0x37e0('0x9')](),controller[_0x37e0('0x11')]);router[_0x37e0('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0x37e0('0x12')]);router['post']('/',auth[_0x37e0('0x9')](),controller['create']);router[_0x37e0('0x13')]('/:id/tags',auth[_0x37e0('0x9')](),controller[_0x37e0('0x14')]);router[_0x37e0('0x15')](_0x37e0('0x16'),auth['isAuthenticated'](),controller[_0x37e0('0x17')]);router[_0x37e0('0x18')](_0x37e0('0x16'),auth[_0x37e0('0x9')](),controller[_0x37e0('0x19')]);module[_0x37e0('0x1a')]=router; \ No newline at end of file +var _0x027c=['setTags','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags','post','create'];(function(_0x40daa2,_0x22afa8){var _0x1e7c5d=function(_0x23b3ad){while(--_0x23b3ad){_0x40daa2['push'](_0x40daa2['shift']());}};_0x1e7c5d(++_0x22afa8);}(_0x027c,0x113));var _0xc027=function(_0xa856f,_0x292e7f){_0xa856f=_0xa856f-0x0;var _0x2a7a6f=_0x027c[_0xa856f];return _0x2a7a6f;};'use strict';var multer=require(_0xc027('0x0'));var util=require(_0xc027('0x1'));var path=require(_0xc027('0x2'));var timeout=require(_0xc027('0x3'));var express=require(_0xc027('0x4'));var router=express[_0xc027('0x5')]();var auth=require(_0xc027('0x6'));var interaction=require(_0xc027('0x7'));var config=require(_0xc027('0x8'));var controller=require(_0xc027('0x9'));router[_0xc027('0xa')]('/',auth[_0xc027('0xb')](),controller[_0xc027('0xc')]);router[_0xc027('0xa')](_0xc027('0xd'),auth[_0xc027('0xb')](),controller[_0xc027('0xe')]);router[_0xc027('0xa')](_0xc027('0xf'),auth[_0xc027('0xb')](),controller[_0xc027('0x10')]);router['get']('/:id/subjects',auth[_0xc027('0xb')](),controller[_0xc027('0x11')]);router['get']('/:id/descriptions',auth[_0xc027('0xb')](),controller[_0xc027('0x12')]);router['get'](_0xc027('0x13'),auth[_0xc027('0xb')](),controller['getTags']);router[_0xc027('0x14')]('/',auth[_0xc027('0xb')](),controller[_0xc027('0x15')]);router[_0xc027('0x14')](_0xc027('0x13'),auth[_0xc027('0xb')](),controller[_0xc027('0x16')]);router[_0xc027('0x17')](_0xc027('0xd'),auth[_0xc027('0xb')](),controller[_0xc027('0x18')]);router[_0xc027('0x19')](_0xc027('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc027('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5527f8e..0df2f0d 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 _0xf2e8=['sequelize','exports','STRING'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xf2e8,0x108));var _0x8f2e=function(_0x86f499,_0x5eb3e2){_0x86f499=_0x86f499-0x0;var _0x4be36b=_0xf2e8[_0x86f499];return _0x4be36b;};'use strict';var Sequelize=require(_0x8f2e('0x0'));module[_0x8f2e('0x1')]={'name':{'type':Sequelize[_0x8f2e('0x2')]},'description':{'type':Sequelize[_0x8f2e('0x2')]}}; \ No newline at end of file +var _0x23d3=['exports','STRING'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x23d3,0x1aa));var _0x323d=function(_0x1f07ca,_0x4bf053){_0x1f07ca=_0x1f07ca-0x0;var _0x82542d=_0x23d3[_0x1f07ca];return _0x82542d;};'use strict';var Sequelize=require('sequelize');module[_0x323d('0x0')]={'name':{'type':Sequelize[_0x323d('0x1')]},'description':{'type':Sequelize[_0x323d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index fdb3d14..81de746 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 _0xc52c=['findOne','order','map','filter','getSubjects','ZendeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','ZendeskConfiguration,\x20%s,\x20%s','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','destroy','name','send','index','ZendeskConfiguration','rawAttributes','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','findAll','rows','show','params','fields','include','options','find','create','body','getFields'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0xc52c,0x1d6));var _0xcc52=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc52c[_0x56482c];return _0x5aae7a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcc52('0x0'));var rimraf=require(_0xcc52('0x1'));var zipdir=require(_0xcc52('0x2'));var jsonpatch=require(_0xcc52('0x3'));var rp=require(_0xcc52('0x4'));var moment=require(_0xcc52('0x5'));var BPromise=require(_0xcc52('0x6'));var Mustache=require(_0xcc52('0x7'));var util=require(_0xcc52('0x8'));var path=require('path');var sox=require(_0xcc52('0x9'));var csv=require(_0xcc52('0xa'));var ejs=require(_0xcc52('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcc52('0xc'));var crypto=require(_0xcc52('0xd'));var jsforce=require(_0xcc52('0xe'));var deskjs=require(_0xcc52('0xf'));var toCsv=require(_0xcc52('0xa'));var querystring=require(_0xcc52('0x10'));var Papa=require(_0xcc52('0x11'));var authService=require(_0xcc52('0x12'));var hardwareService=require(_0xcc52('0x13'));var Redis=require(_0xcc52('0x14'));var qs=require(_0xcc52('0x15'));var logger=require(_0xcc52('0x16'))(_0xcc52('0x17'));var utils=require(_0xcc52('0x18'));var config=require(_0xcc52('0x19'));var db=require(_0xcc52('0x1a'))['db'];var jayson=require(_0xcc52('0x1b'));var client=jayson[_0xcc52('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34c69d,_0x57467e,_0x4280d9,_0x3cecff){return new BPromise(function(_0x1b4101,_0x133930){var _0x14da9c=_0x3cecff||client;return _0x14da9c[_0xcc52('0x1d')](_0x34c69d,_0x4280d9)[_0xcc52('0x1e')](function(_0x2e3215){logger[_0xcc52('0x1f')]('ZendeskConfiguration,\x20%s,\x20%s',_0x57467e,_0xcc52('0x20'));logger['debug'](_0xcc52('0x21'),_0x57467e,'request\x20sent',JSON['stringify'](_0x2e3215));if(_0x2e3215[_0xcc52('0x22')]){if(_0x2e3215['error']['code']===0x1f4){logger[_0xcc52('0x22')]('ZendeskConfiguration,\x20%s,\x20%s',_0x57467e,_0x2e3215[_0xcc52('0x22')][_0xcc52('0x23')]);return _0x133930(_0x2e3215['error'][_0xcc52('0x23')]);}logger['error'](_0xcc52('0x24'),_0x57467e,_0x2e3215[_0xcc52('0x22')][_0xcc52('0x23')]);return _0x1b4101(_0x2e3215[_0xcc52('0x22')][_0xcc52('0x23')]);}else{logger[_0xcc52('0x1f')]('ZendeskConfiguration,\x20%s,\x20%s',_0x57467e,'request\x20sent');_0x1b4101(_0x2e3215[_0xcc52('0x25')][_0xcc52('0x23')]);}})[_0xcc52('0x26')](function(_0x319439){logger['error'](_0xcc52('0x24'),_0x57467e,_0x319439);_0x133930(_0x319439);});});}function respondWithStatusCode(_0xf613a4,_0x39a842){_0x39a842=_0x39a842||0xcc;return function(_0x55904b){if(_0x55904b){return _0xf613a4[_0xcc52('0x27')](_0x39a842);}return _0xf613a4[_0xcc52('0x28')](_0x39a842)[_0xcc52('0x29')]();};}function respondWithResult(_0x3b1c64,_0x2602ec){_0x2602ec=_0x2602ec||0xc8;return function(_0x32e048){if(_0x32e048){return _0x3b1c64[_0xcc52('0x28')](_0x2602ec)['json'](_0x32e048);}};}function respondWithFilteredResult(_0x131872,_0x3c0957){return function(_0x21d71d){if(_0x21d71d){var _0x1cab24=_0x21d71d[_0xcc52('0x2a')],_0x48525a=_0x3c0957[_0xcc52('0x2b')],_0x57f4f7=_0x3c0957[_0xcc52('0x2b')]+_0x3c0957[_0xcc52('0x2c')],_0x386818;if(_0x57f4f7>=_0x1cab24){_0x57f4f7=_0x1cab24;_0x386818=0xc8;}else{_0x386818=0xce;}_0x131872[_0xcc52('0x28')](_0x386818);return _0x131872[_0xcc52('0x2d')](_0xcc52('0x2e'),_0x48525a+'-'+_0x57f4f7+'/'+_0x1cab24)[_0xcc52('0x2f')](_0x21d71d);}return null;};}function patchUpdates(_0x18c0a8){return function(_0x1492c3){try{jsonpatch[_0xcc52('0x30')](_0x1492c3,_0x18c0a8,!![]);}catch(_0x59268d){return BPromise['reject'](_0x59268d);}return _0x1492c3['save']();};}function saveUpdates(_0x1650d7,_0x1e9c88){return function(_0x439cce){if(_0x439cce){return _0x439cce[_0xcc52('0x31')](_0x1650d7)[_0xcc52('0x1e')](function(_0x443f16){return _0x443f16;});}return null;};}function removeEntity(_0x536ba9,_0x14f00a){return function(_0x99dbc5){if(_0x99dbc5){return _0x99dbc5[_0xcc52('0x32')]()[_0xcc52('0x1e')](function(){_0x536ba9[_0xcc52('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a0faa,_0x203095){return function(_0x3b34a8){if(!_0x3b34a8){_0x4a0faa[_0xcc52('0x27')](0x194);}return _0x3b34a8;};}function handleError(_0x10d903,_0xa387d6){_0xa387d6=_0xa387d6||0x1f4;return function(_0x4bcd0a){logger['error'](_0x4bcd0a['stack']);if(_0x4bcd0a[_0xcc52('0x33')]){delete _0x4bcd0a['name'];}_0x10d903[_0xcc52('0x28')](_0xa387d6)[_0xcc52('0x34')](_0x4bcd0a);};}exports[_0xcc52('0x35')]=function(_0x592576,_0x331e6c){var _0x1af714={},_0x174698={},_0x3ed471={'count':0x0,'rows':[]};var _0x4a7869=db[_0xcc52('0x36')][_0xcc52('0x37')];_0x174698['model']=_[_0xcc52('0x38')](_0x4a7869);_0x174698[_0xcc52('0x39')]=_[_0xcc52('0x38')](_0x592576['query']);_0x174698['filters']=_[_0xcc52('0x3a')](_0x174698[_0xcc52('0x3b')],_0x174698[_0xcc52('0x39')]);_0x1af714[_0xcc52('0x3c')]=_[_0xcc52('0x3a')](_0x174698['model'],qs['fields'](_0x592576[_0xcc52('0x39')]['fields']));_0x1af714[_0xcc52('0x3c')]=_0x1af714['attributes'][_0xcc52('0x3d')]?_0x1af714[_0xcc52('0x3c')]:_0x174698[_0xcc52('0x3b')];if(!_0x592576['query'][_0xcc52('0x3e')](_0xcc52('0x3f'))){_0x1af714['limit']=qs[_0xcc52('0x2c')](_0x592576[_0xcc52('0x39')][_0xcc52('0x2c')]);_0x1af714[_0xcc52('0x2b')]=qs['offset'](_0x592576[_0xcc52('0x39')]['offset']);}_0x1af714['order']=qs[_0xcc52('0x40')](_0x592576[_0xcc52('0x39')][_0xcc52('0x40')]);_0x1af714[_0xcc52('0x41')]=qs[_0xcc52('0x42')](_[_0xcc52('0x43')](_0x592576[_0xcc52('0x39')],_0x174698[_0xcc52('0x42')]));if(_0x592576[_0xcc52('0x39')]['filter']){_0x1af714[_0xcc52('0x41')]=_[_0xcc52('0x44')](_0x1af714['where'],{'$or':_['map'](_0x4a7869,function(_0x1f768a){if(_0x1f768a[_0xcc52('0x45')]['key']!==_0xcc52('0x46')){var _0x49863f={};_0x49863f[_0x1f768a['field']]={'$like':'%'+_0x592576[_0xcc52('0x39')]['filter']+'%'};return _0x49863f;}})});}_0x1af714=_[_0xcc52('0x44')]({},_0x1af714,_0x592576['options']);var _0x589984={'where':_0x1af714[_0xcc52('0x41')]};return db[_0xcc52('0x36')][_0xcc52('0x2a')](_0x589984)['then'](function(_0x407cfe){_0x3ed471[_0xcc52('0x2a')]=_0x407cfe;if(_0x592576[_0xcc52('0x39')]['includeAll']){_0x1af714['include']=[{'all':!![]}];}return db[_0xcc52('0x36')][_0xcc52('0x47')](_0x1af714);})[_0xcc52('0x1e')](function(_0x4c8bc7){_0x3ed471[_0xcc52('0x48')]=_0x4c8bc7;return _0x3ed471;})[_0xcc52('0x1e')](respondWithFilteredResult(_0x331e6c,_0x1af714))[_0xcc52('0x26')](handleError(_0x331e6c,null));};exports[_0xcc52('0x49')]=function(_0x222007,_0x48e4d2){var _0x1e8d43={'raw':![],'where':{'id':_0x222007[_0xcc52('0x4a')]['id']}},_0x1ce2af={};_0x1ce2af['model']=_[_0xcc52('0x38')](db[_0xcc52('0x36')][_0xcc52('0x37')]);_0x1ce2af[_0xcc52('0x39')]=_[_0xcc52('0x38')](_0x222007['query']);_0x1ce2af[_0xcc52('0x42')]=_[_0xcc52('0x3a')](_0x1ce2af[_0xcc52('0x3b')],_0x1ce2af[_0xcc52('0x39')]);_0x1e8d43[_0xcc52('0x3c')]=_['intersection'](_0x1ce2af[_0xcc52('0x3b')],qs['fields'](_0x222007[_0xcc52('0x39')][_0xcc52('0x4b')]));_0x1e8d43[_0xcc52('0x3c')]=_0x1e8d43['attributes']['length']?_0x1e8d43['attributes']:_0x1ce2af[_0xcc52('0x3b')];if(_0x222007[_0xcc52('0x39')]['includeAll']){_0x1e8d43[_0xcc52('0x4c')]=[{'all':!![]}];}_0x1e8d43=_['merge']({},_0x1e8d43,_0x222007[_0xcc52('0x4d')]);return db[_0xcc52('0x36')][_0xcc52('0x4e')](_0x1e8d43)[_0xcc52('0x1e')](handleEntityNotFound(_0x48e4d2,null))[_0xcc52('0x1e')](respondWithResult(_0x48e4d2,null))['catch'](handleError(_0x48e4d2,null));};exports[_0xcc52('0x4f')]=function(_0x1f1e52,_0x52dd57){return db[_0xcc52('0x36')]['create'](_0x1f1e52[_0xcc52('0x50')],{})[_0xcc52('0x1e')](respondWithResult(_0x52dd57,0xc9))[_0xcc52('0x26')](handleError(_0x52dd57,null));};exports[_0xcc52('0x31')]=function(_0x4c0aac,_0x40221b){if(_0x4c0aac[_0xcc52('0x50')]['id']){delete _0x4c0aac['body']['id'];}return db[_0xcc52('0x36')][_0xcc52('0x4e')]({'where':{'id':_0x4c0aac[_0xcc52('0x4a')]['id']}})['then'](handleEntityNotFound(_0x40221b,null))['then'](saveUpdates(_0x4c0aac[_0xcc52('0x50')],null))[_0xcc52('0x1e')](respondWithResult(_0x40221b,null))['catch'](handleError(_0x40221b,null));};exports[_0xcc52('0x32')]=function(_0x2f4466,_0x53ae44){return db['ZendeskConfiguration'][_0xcc52('0x4e')]({'where':{'id':_0x2f4466[_0xcc52('0x4a')]['id']}})[_0xcc52('0x1e')](handleEntityNotFound(_0x53ae44,null))[_0xcc52('0x1e')](removeEntity(_0x53ae44,null))[_0xcc52('0x26')](handleError(_0x53ae44,null));};exports[_0xcc52('0x51')]=function(_0x49e5f0,_0x3fbb83,_0x45290a){var _0x455525={};var _0x53d65a={};var _0x5e251c;var _0x515e56;return db[_0xcc52('0x36')][_0xcc52('0x52')]({'where':{'id':_0x49e5f0[_0xcc52('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fbb83,null))[_0xcc52('0x1e')](function(_0x416274){if(_0x416274){_0x5e251c=_0x416274;_0x53d65a['model']=_[_0xcc52('0x38')](db['ZendeskField']['rawAttributes']);_0x53d65a['query']=_['keys'](_0x49e5f0[_0xcc52('0x39')]);_0x53d65a[_0xcc52('0x42')]=_['intersection'](_0x53d65a[_0xcc52('0x3b')],_0x53d65a[_0xcc52('0x39')]);_0x455525[_0xcc52('0x3c')]=_['intersection'](_0x53d65a[_0xcc52('0x3b')],qs['fields'](_0x49e5f0[_0xcc52('0x39')][_0xcc52('0x4b')]));_0x455525[_0xcc52('0x3c')]=_0x455525[_0xcc52('0x3c')][_0xcc52('0x3d')]?_0x455525[_0xcc52('0x3c')]:_0x53d65a[_0xcc52('0x3b')];_0x455525[_0xcc52('0x53')]=qs[_0xcc52('0x40')](_0x49e5f0[_0xcc52('0x39')][_0xcc52('0x40')]);_0x455525[_0xcc52('0x41')]=qs[_0xcc52('0x42')](_['pick'](_0x49e5f0['query'],_0x53d65a[_0xcc52('0x42')]));if(_0x49e5f0[_0xcc52('0x39')]['filter']){_0x455525['where']=_[_0xcc52('0x44')](_0x455525['where'],{'$or':_[_0xcc52('0x54')](_0x455525[_0xcc52('0x3c')],function(_0x4f6070){var _0x362066={};_0x362066[_0x4f6070]={'$like':'%'+_0x49e5f0[_0xcc52('0x39')][_0xcc52('0x55')]+'%'};return _0x362066;})});}_0x455525=_['merge']({},_0x455525,_0x49e5f0['options']);return _0x5e251c[_0xcc52('0x51')](_0x455525);}})[_0xcc52('0x1e')](function(_0x56827c){if(_0x56827c){_0x515e56=_0x56827c[_0xcc52('0x3d')];if(!_0x49e5f0[_0xcc52('0x39')][_0xcc52('0x3e')](_0xcc52('0x3f'))){_0x455525[_0xcc52('0x2c')]=qs['limit'](_0x49e5f0[_0xcc52('0x39')][_0xcc52('0x2c')]);_0x455525[_0xcc52('0x2b')]=qs[_0xcc52('0x2b')](_0x49e5f0[_0xcc52('0x39')]['offset']);}return _0x5e251c[_0xcc52('0x51')](_0x455525);}})['then'](function(_0x3db194){if(_0x3db194){return _0x3db194?{'count':_0x515e56,'rows':_0x3db194}:null;}})['then'](respondWithResult(_0x3fbb83,null))[_0xcc52('0x26')](handleError(_0x3fbb83,null));};exports['getSubjects']=function(_0xbf09d2,_0x346f0a,_0x1a2c3e){var _0x4750d5={};var _0x190e2f={};var _0x27c1f7;var _0x252027;return db[_0xcc52('0x36')]['findOne']({'where':{'id':_0xbf09d2[_0xcc52('0x4a')]['id']}})[_0xcc52('0x1e')](handleEntityNotFound(_0x346f0a,null))[_0xcc52('0x1e')](function(_0x609289){if(_0x609289){_0x27c1f7=_0x609289;_0x190e2f[_0xcc52('0x3b')]=_[_0xcc52('0x38')](db['ZendeskField'][_0xcc52('0x37')]);_0x190e2f[_0xcc52('0x39')]=_[_0xcc52('0x38')](_0xbf09d2[_0xcc52('0x39')]);_0x190e2f[_0xcc52('0x42')]=_['intersection'](_0x190e2f[_0xcc52('0x3b')],_0x190e2f['query']);_0x4750d5[_0xcc52('0x3c')]=_[_0xcc52('0x3a')](_0x190e2f[_0xcc52('0x3b')],qs[_0xcc52('0x4b')](_0xbf09d2[_0xcc52('0x39')][_0xcc52('0x4b')]));_0x4750d5['attributes']=_0x4750d5[_0xcc52('0x3c')]['length']?_0x4750d5[_0xcc52('0x3c')]:_0x190e2f[_0xcc52('0x3b')];_0x4750d5['order']=qs[_0xcc52('0x40')](_0xbf09d2[_0xcc52('0x39')][_0xcc52('0x40')]);_0x4750d5[_0xcc52('0x41')]=qs[_0xcc52('0x42')](_[_0xcc52('0x43')](_0xbf09d2['query'],_0x190e2f[_0xcc52('0x42')]));if(_0xbf09d2[_0xcc52('0x39')][_0xcc52('0x55')]){_0x4750d5[_0xcc52('0x41')]=_[_0xcc52('0x44')](_0x4750d5['where'],{'$or':_['map'](_0x4750d5[_0xcc52('0x3c')],function(_0x4d2c66){var _0x1c1cda={};_0x1c1cda[_0x4d2c66]={'$like':'%'+_0xbf09d2['query'][_0xcc52('0x55')]+'%'};return _0x1c1cda;})});}_0x4750d5=_[_0xcc52('0x44')]({},_0x4750d5,_0xbf09d2[_0xcc52('0x4d')]);return _0x27c1f7[_0xcc52('0x56')](_0x4750d5);}})['then'](function(_0x2f4f58){if(_0x2f4f58){_0x252027=_0x2f4f58[_0xcc52('0x3d')];if(!_0xbf09d2['query'][_0xcc52('0x3e')](_0xcc52('0x3f'))){_0x4750d5[_0xcc52('0x2c')]=qs['limit'](_0xbf09d2[_0xcc52('0x39')][_0xcc52('0x2c')]);_0x4750d5[_0xcc52('0x2b')]=qs['offset'](_0xbf09d2['query'][_0xcc52('0x2b')]);}return _0x27c1f7[_0xcc52('0x56')](_0x4750d5);}})[_0xcc52('0x1e')](function(_0x3e68e4){if(_0x3e68e4){return _0x3e68e4?{'count':_0x252027,'rows':_0x3e68e4}:null;}})[_0xcc52('0x1e')](respondWithResult(_0x346f0a,null))[_0xcc52('0x26')](handleError(_0x346f0a,null));};exports['getDescriptions']=function(_0x413045,_0x16ddeb,_0x5421f3){var _0x5ce08f={};var _0xa4b399={};var _0x3fe1ce;var _0x55e612;return db[_0xcc52('0x36')][_0xcc52('0x52')]({'where':{'id':_0x413045[_0xcc52('0x4a')]['id']}})[_0xcc52('0x1e')](handleEntityNotFound(_0x16ddeb,null))['then'](function(_0x3524b1){if(_0x3524b1){_0x3fe1ce=_0x3524b1;_0xa4b399[_0xcc52('0x3b')]=_[_0xcc52('0x38')](db[_0xcc52('0x57')][_0xcc52('0x37')]);_0xa4b399[_0xcc52('0x39')]=_[_0xcc52('0x38')](_0x413045[_0xcc52('0x39')]);_0xa4b399[_0xcc52('0x42')]=_[_0xcc52('0x3a')](_0xa4b399[_0xcc52('0x3b')],_0xa4b399[_0xcc52('0x39')]);_0x5ce08f[_0xcc52('0x3c')]=_['intersection'](_0xa4b399[_0xcc52('0x3b')],qs[_0xcc52('0x4b')](_0x413045['query']['fields']));_0x5ce08f['attributes']=_0x5ce08f[_0xcc52('0x3c')][_0xcc52('0x3d')]?_0x5ce08f[_0xcc52('0x3c')]:_0xa4b399[_0xcc52('0x3b')];_0x5ce08f[_0xcc52('0x53')]=qs['sort'](_0x413045[_0xcc52('0x39')][_0xcc52('0x40')]);_0x5ce08f[_0xcc52('0x41')]=qs['filters'](_['pick'](_0x413045[_0xcc52('0x39')],_0xa4b399[_0xcc52('0x42')]));if(_0x413045[_0xcc52('0x39')][_0xcc52('0x55')]){_0x5ce08f['where']=_[_0xcc52('0x44')](_0x5ce08f['where'],{'$or':_[_0xcc52('0x54')](_0x5ce08f[_0xcc52('0x3c')],function(_0x3630e3){var _0x258c0a={};_0x258c0a[_0x3630e3]={'$like':'%'+_0x413045[_0xcc52('0x39')]['filter']+'%'};return _0x258c0a;})});}_0x5ce08f=_[_0xcc52('0x44')]({},_0x5ce08f,_0x413045[_0xcc52('0x4d')]);return _0x3fe1ce[_0xcc52('0x58')](_0x5ce08f);}})[_0xcc52('0x1e')](function(_0x610f8b){if(_0x610f8b){_0x55e612=_0x610f8b['length'];if(!_0x413045['query'][_0xcc52('0x3e')]('nolimit')){_0x5ce08f[_0xcc52('0x2c')]=qs[_0xcc52('0x2c')](_0x413045[_0xcc52('0x39')][_0xcc52('0x2c')]);_0x5ce08f['offset']=qs[_0xcc52('0x2b')](_0x413045['query'][_0xcc52('0x2b')]);}return _0x3fe1ce[_0xcc52('0x58')](_0x5ce08f);}})[_0xcc52('0x1e')](function(_0x3eaf95){if(_0x3eaf95){return _0x3eaf95?{'count':_0x55e612,'rows':_0x3eaf95}:null;}})[_0xcc52('0x1e')](respondWithResult(_0x16ddeb,null))[_0xcc52('0x26')](handleError(_0x16ddeb,null));};exports[_0xcc52('0x59')]=function(_0x37e118,_0x5b1380,_0x4d02ae){var _0x4f00a2={};var _0x53c8d1={};var _0x5ccf82;var _0x8d270e;return db[_0xcc52('0x36')][_0xcc52('0x52')]({'where':{'id':_0x37e118['params']['id']}})['then'](handleEntityNotFound(_0x5b1380,null))[_0xcc52('0x1e')](function(_0x3ac9cb){if(_0x3ac9cb){_0x5ccf82=_0x3ac9cb;_0x53c8d1[_0xcc52('0x3b')]=_[_0xcc52('0x38')](db['Tag'][_0xcc52('0x37')]);_0x53c8d1[_0xcc52('0x39')]=_['keys'](_0x37e118[_0xcc52('0x39')]);_0x53c8d1['filters']=_[_0xcc52('0x3a')](_0x53c8d1[_0xcc52('0x3b')],_0x53c8d1['query']);_0x4f00a2[_0xcc52('0x3c')]=_[_0xcc52('0x3a')](_0x53c8d1[_0xcc52('0x3b')],qs[_0xcc52('0x4b')](_0x37e118[_0xcc52('0x39')]['fields']));_0x4f00a2[_0xcc52('0x3c')]=_0x4f00a2['attributes']['length']?_0x4f00a2[_0xcc52('0x3c')]:_0x53c8d1[_0xcc52('0x3b')];_0x4f00a2['order']=qs[_0xcc52('0x40')](_0x37e118[_0xcc52('0x39')][_0xcc52('0x40')]);_0x4f00a2[_0xcc52('0x41')]=qs[_0xcc52('0x42')](_[_0xcc52('0x43')](_0x37e118['query'],_0x53c8d1[_0xcc52('0x42')]));if(_0x37e118[_0xcc52('0x39')]['filter']){_0x4f00a2[_0xcc52('0x41')]=_['merge'](_0x4f00a2[_0xcc52('0x41')],{'$or':_[_0xcc52('0x54')](_0x4f00a2[_0xcc52('0x3c')],function(_0x1801c4){var _0x222be0={};_0x222be0[_0x1801c4]={'$like':'%'+_0x37e118[_0xcc52('0x39')][_0xcc52('0x55')]+'%'};return _0x222be0;})});}_0x4f00a2=_['merge']({},_0x4f00a2,_0x37e118['options']);return _0x5ccf82[_0xcc52('0x59')](_0x4f00a2);}})['then'](function(_0x2cc808){if(_0x2cc808){_0x8d270e=_0x2cc808[_0xcc52('0x3d')];if(!_0x37e118['query']['hasOwnProperty'](_0xcc52('0x3f'))){_0x4f00a2[_0xcc52('0x2c')]=qs[_0xcc52('0x2c')](_0x37e118[_0xcc52('0x39')][_0xcc52('0x2c')]);_0x4f00a2['offset']=qs[_0xcc52('0x2b')](_0x37e118[_0xcc52('0x39')][_0xcc52('0x2b')]);}return _0x5ccf82[_0xcc52('0x59')](_0x4f00a2);}})[_0xcc52('0x1e')](function(_0x44420a){if(_0x44420a){return _0x44420a?{'count':_0x8d270e,'rows':_0x44420a}:null;}})[_0xcc52('0x1e')](respondWithResult(_0x5b1380,null))[_0xcc52('0x26')](handleError(_0x5b1380,null));};exports[_0xcc52('0x5a')]=function(_0xfc68a2,_0x3b8e4e,_0x32c308){if(_0xfc68a2['body']['id']){delete _0xfc68a2[_0xcc52('0x50')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0xfc68a2[_0xcc52('0x4a')]['id']}})[_0xcc52('0x1e')](handleEntityNotFound(_0x3b8e4e,null))[_0xcc52('0x1e')](function(_0x4a89b3){if(_0x4a89b3){return _0x4a89b3[_0xcc52('0x5a')](_0xfc68a2['body'][_0xcc52('0x5b')]||[]);}return null;})[_0xcc52('0x1e')](respondWithResult(_0x3b8e4e,null))[_0xcc52('0x26')](handleError(_0x3b8e4e,null));}; \ No newline at end of file +var _0xe9e6=['getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','request','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','stack','name','send','index','ZendeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','then','includeAll','findAll','show','params','include','options','find','catch','create','body','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions'];(function(_0x324e43,_0x320dad){var _0x433798=function(_0x151fcb){while(--_0x151fcb){_0x324e43['push'](_0x324e43['shift']());}};_0x433798(++_0x320dad);}(_0xe9e6,0x178));var _0x6e9e=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xe9e6[_0x1b5aea];return _0x15cfc6;};'use strict';var pdf=require(_0x6e9e('0x0'));var emlformat=require(_0x6e9e('0x1'));var rimraf=require(_0x6e9e('0x2'));var zipdir=require(_0x6e9e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e9e('0x4'));var moment=require(_0x6e9e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6e9e('0x6'));var util=require(_0x6e9e('0x7'));var path=require(_0x6e9e('0x8'));var sox=require(_0x6e9e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6e9e('0xa'));var squel=require(_0x6e9e('0xb'));var crypto=require(_0x6e9e('0xc'));var jsforce=require(_0x6e9e('0xd'));var deskjs=require(_0x6e9e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6e9e('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x6e9e('0x10'));var Redis=require('ioredis');var qs=require(_0x6e9e('0x11'));var logger=require(_0x6e9e('0x12'))('api');var utils=require(_0x6e9e('0x13'));var config=require(_0x6e9e('0x14'));var db=require(_0x6e9e('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6e9e('0x16')][_0x6e9e('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39787f,_0x1773c6,_0x13fbc2,_0x2b9aa4){return new BPromise(function(_0x5ee4c6,_0xd2d0e6){var _0x25715a=_0x2b9aa4||client;return _0x25715a[_0x6e9e('0x18')](_0x39787f,_0x13fbc2)['then'](function(_0x53ec7c){logger[_0x6e9e('0x19')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1773c6,_0x6e9e('0x1a'));logger[_0x6e9e('0x1b')](_0x6e9e('0x1c'),_0x1773c6,_0x6e9e('0x1a'),JSON['stringify'](_0x53ec7c));if(_0x53ec7c[_0x6e9e('0x1d')]){if(_0x53ec7c[_0x6e9e('0x1d')][_0x6e9e('0x1e')]===0x1f4){logger[_0x6e9e('0x1d')](_0x6e9e('0x1f'),_0x1773c6,_0x53ec7c[_0x6e9e('0x1d')]['message']);return _0xd2d0e6(_0x53ec7c[_0x6e9e('0x1d')][_0x6e9e('0x20')]);}logger[_0x6e9e('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1773c6,_0x53ec7c[_0x6e9e('0x1d')][_0x6e9e('0x20')]);return _0x5ee4c6(_0x53ec7c[_0x6e9e('0x1d')][_0x6e9e('0x20')]);}else{logger[_0x6e9e('0x19')](_0x6e9e('0x1f'),_0x1773c6,_0x6e9e('0x1a'));_0x5ee4c6(_0x53ec7c[_0x6e9e('0x21')][_0x6e9e('0x20')]);}})['catch'](function(_0x385266){logger['error'](_0x6e9e('0x1f'),_0x1773c6,_0x385266);_0xd2d0e6(_0x385266);});});}function respondWithStatusCode(_0x3af945,_0x20d8f7){_0x20d8f7=_0x20d8f7||0xcc;return function(_0x22fea8){if(_0x22fea8){return _0x3af945[_0x6e9e('0x22')](_0x20d8f7);}return _0x3af945[_0x6e9e('0x23')](_0x20d8f7)[_0x6e9e('0x24')]();};}function respondWithResult(_0xea156b,_0x348f83){_0x348f83=_0x348f83||0xc8;return function(_0x1d5f76){if(_0x1d5f76){return _0xea156b[_0x6e9e('0x23')](_0x348f83)[_0x6e9e('0x25')](_0x1d5f76);}};}function respondWithFilteredResult(_0x26e213,_0x230344){return function(_0x12e1d5){if(_0x12e1d5){var _0x467902=_0x12e1d5[_0x6e9e('0x26')],_0x4ca0e7=_0x230344['offset'],_0x9c76b3=_0x230344[_0x6e9e('0x27')]+_0x230344[_0x6e9e('0x28')],_0x40edaf;if(_0x9c76b3>=_0x467902){_0x9c76b3=_0x467902;_0x40edaf=0xc8;}else{_0x40edaf=0xce;}_0x26e213['status'](_0x40edaf);return _0x26e213['set'](_0x6e9e('0x29'),_0x4ca0e7+'-'+_0x9c76b3+'/'+_0x467902)[_0x6e9e('0x25')](_0x12e1d5);}return null;};}function patchUpdates(_0x224234){return function(_0x12c7f0){try{jsonpatch['apply'](_0x12c7f0,_0x224234,!![]);}catch(_0x1e5c35){return BPromise[_0x6e9e('0x2a')](_0x1e5c35);}return _0x12c7f0[_0x6e9e('0x2b')]();};}function saveUpdates(_0x5b087e,_0x40f562){return function(_0xa65e23){if(_0xa65e23){return _0xa65e23[_0x6e9e('0x2c')](_0x5b087e)['then'](function(_0x1d1ce1){return _0x1d1ce1;});}return null;};}function removeEntity(_0x379652,_0x29a9f7){return function(_0x2aaeb2){if(_0x2aaeb2){return _0x2aaeb2[_0x6e9e('0x2d')]()['then'](function(){_0x379652[_0x6e9e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c6eff,_0x3f0a9d){return function(_0xaa4316){if(!_0xaa4316){_0x3c6eff[_0x6e9e('0x22')](0x194);}return _0xaa4316;};}function handleError(_0x44a196,_0x4b6983){_0x4b6983=_0x4b6983||0x1f4;return function(_0x2d21a7){logger[_0x6e9e('0x1d')](_0x2d21a7[_0x6e9e('0x2e')]);if(_0x2d21a7['name']){delete _0x2d21a7[_0x6e9e('0x2f')];}_0x44a196[_0x6e9e('0x23')](_0x4b6983)[_0x6e9e('0x30')](_0x2d21a7);};}exports[_0x6e9e('0x31')]=function(_0x5d54c7,_0x479948){var _0x90658={},_0xb01c8b={},_0x211245={'count':0x0,'rows':[]};var _0xd305e0=db[_0x6e9e('0x32')][_0x6e9e('0x33')];_0xb01c8b[_0x6e9e('0x34')]=_[_0x6e9e('0x35')](_0xd305e0);_0xb01c8b[_0x6e9e('0x36')]=_[_0x6e9e('0x35')](_0x5d54c7[_0x6e9e('0x36')]);_0xb01c8b[_0x6e9e('0x37')]=_[_0x6e9e('0x38')](_0xb01c8b[_0x6e9e('0x34')],_0xb01c8b[_0x6e9e('0x36')]);_0x90658[_0x6e9e('0x39')]=_['intersection'](_0xb01c8b['model'],qs[_0x6e9e('0x3a')](_0x5d54c7[_0x6e9e('0x36')][_0x6e9e('0x3a')]));_0x90658[_0x6e9e('0x39')]=_0x90658[_0x6e9e('0x39')][_0x6e9e('0x3b')]?_0x90658[_0x6e9e('0x39')]:_0xb01c8b[_0x6e9e('0x34')];if(!_0x5d54c7[_0x6e9e('0x36')][_0x6e9e('0x3c')](_0x6e9e('0x3d'))){_0x90658[_0x6e9e('0x28')]=qs[_0x6e9e('0x28')](_0x5d54c7[_0x6e9e('0x36')][_0x6e9e('0x28')]);_0x90658['offset']=qs[_0x6e9e('0x27')](_0x5d54c7[_0x6e9e('0x36')][_0x6e9e('0x27')]);}_0x90658['order']=qs[_0x6e9e('0x3e')](_0x5d54c7[_0x6e9e('0x36')][_0x6e9e('0x3e')]);_0x90658[_0x6e9e('0x3f')]=qs[_0x6e9e('0x37')](_[_0x6e9e('0x40')](_0x5d54c7[_0x6e9e('0x36')],_0xb01c8b[_0x6e9e('0x37')]));if(_0x5d54c7['query'][_0x6e9e('0x41')]){_0x90658['where']=_[_0x6e9e('0x42')](_0x90658['where'],{'$or':_[_0x6e9e('0x43')](_0xd305e0,function(_0x3808a9){if(_0x3808a9[_0x6e9e('0x44')][_0x6e9e('0x45')]!==_0x6e9e('0x46')){var _0x263956={};_0x263956[_0x3808a9[_0x6e9e('0x47')]]={'$like':'%'+_0x5d54c7[_0x6e9e('0x36')]['filter']+'%'};return _0x263956;}})});}_0x90658=_[_0x6e9e('0x42')]({},_0x90658,_0x5d54c7['options']);var _0x40c35e={'where':_0x90658[_0x6e9e('0x3f')]};return db[_0x6e9e('0x32')][_0x6e9e('0x26')](_0x40c35e)[_0x6e9e('0x48')](function(_0x321e98){_0x211245[_0x6e9e('0x26')]=_0x321e98;if(_0x5d54c7['query'][_0x6e9e('0x49')]){_0x90658['include']=[{'all':!![]}];}return db[_0x6e9e('0x32')][_0x6e9e('0x4a')](_0x90658);})[_0x6e9e('0x48')](function(_0xcde1a9){_0x211245['rows']=_0xcde1a9;return _0x211245;})[_0x6e9e('0x48')](respondWithFilteredResult(_0x479948,_0x90658))['catch'](handleError(_0x479948,null));};exports[_0x6e9e('0x4b')]=function(_0x490c3d,_0x42ee38){var _0x46ddb6={'raw':![],'where':{'id':_0x490c3d[_0x6e9e('0x4c')]['id']}},_0x426f75={};_0x426f75[_0x6e9e('0x34')]=_[_0x6e9e('0x35')](db[_0x6e9e('0x32')][_0x6e9e('0x33')]);_0x426f75[_0x6e9e('0x36')]=_[_0x6e9e('0x35')](_0x490c3d['query']);_0x426f75['filters']=_[_0x6e9e('0x38')](_0x426f75['model'],_0x426f75[_0x6e9e('0x36')]);_0x46ddb6['attributes']=_['intersection'](_0x426f75['model'],qs[_0x6e9e('0x3a')](_0x490c3d['query'][_0x6e9e('0x3a')]));_0x46ddb6[_0x6e9e('0x39')]=_0x46ddb6['attributes'][_0x6e9e('0x3b')]?_0x46ddb6[_0x6e9e('0x39')]:_0x426f75['model'];if(_0x490c3d['query'][_0x6e9e('0x49')]){_0x46ddb6[_0x6e9e('0x4d')]=[{'all':!![]}];}_0x46ddb6=_[_0x6e9e('0x42')]({},_0x46ddb6,_0x490c3d[_0x6e9e('0x4e')]);return db['ZendeskConfiguration'][_0x6e9e('0x4f')](_0x46ddb6)['then'](handleEntityNotFound(_0x42ee38,null))[_0x6e9e('0x48')](respondWithResult(_0x42ee38,null))[_0x6e9e('0x50')](handleError(_0x42ee38,null));};exports[_0x6e9e('0x51')]=function(_0x3d171b,_0x55630c){return db['ZendeskConfiguration'][_0x6e9e('0x51')](_0x3d171b[_0x6e9e('0x52')],{})[_0x6e9e('0x48')](respondWithResult(_0x55630c,0xc9))[_0x6e9e('0x50')](handleError(_0x55630c,null));};exports[_0x6e9e('0x2c')]=function(_0x25b818,_0x255c39){if(_0x25b818[_0x6e9e('0x52')]['id']){delete _0x25b818[_0x6e9e('0x52')]['id'];}return db['ZendeskConfiguration'][_0x6e9e('0x4f')]({'where':{'id':_0x25b818[_0x6e9e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x255c39,null))['then'](saveUpdates(_0x25b818[_0x6e9e('0x52')],null))[_0x6e9e('0x48')](respondWithResult(_0x255c39,null))[_0x6e9e('0x50')](handleError(_0x255c39,null));};exports['destroy']=function(_0x3e3e18,_0x38b100){return db[_0x6e9e('0x32')][_0x6e9e('0x4f')]({'where':{'id':_0x3e3e18[_0x6e9e('0x4c')]['id']}})[_0x6e9e('0x48')](handleEntityNotFound(_0x38b100,null))[_0x6e9e('0x48')](removeEntity(_0x38b100,null))['catch'](handleError(_0x38b100,null));};exports[_0x6e9e('0x53')]=function(_0x4f1a96,_0x3046ba,_0x359d6c){var _0x444d1c={};var _0x2fb6cd={};var _0x5521a3;var _0x3b7e0a;return db[_0x6e9e('0x32')][_0x6e9e('0x54')]({'where':{'id':_0x4f1a96[_0x6e9e('0x4c')]['id']}})[_0x6e9e('0x48')](handleEntityNotFound(_0x3046ba,null))[_0x6e9e('0x48')](function(_0x2b8a78){if(_0x2b8a78){_0x5521a3=_0x2b8a78;_0x2fb6cd[_0x6e9e('0x34')]=_[_0x6e9e('0x35')](db['ZendeskField'][_0x6e9e('0x33')]);_0x2fb6cd['query']=_[_0x6e9e('0x35')](_0x4f1a96['query']);_0x2fb6cd[_0x6e9e('0x37')]=_['intersection'](_0x2fb6cd[_0x6e9e('0x34')],_0x2fb6cd[_0x6e9e('0x36')]);_0x444d1c[_0x6e9e('0x39')]=_[_0x6e9e('0x38')](_0x2fb6cd[_0x6e9e('0x34')],qs['fields'](_0x4f1a96[_0x6e9e('0x36')]['fields']));_0x444d1c[_0x6e9e('0x39')]=_0x444d1c[_0x6e9e('0x39')][_0x6e9e('0x3b')]?_0x444d1c[_0x6e9e('0x39')]:_0x2fb6cd[_0x6e9e('0x34')];_0x444d1c['order']=qs[_0x6e9e('0x3e')](_0x4f1a96[_0x6e9e('0x36')]['sort']);_0x444d1c[_0x6e9e('0x3f')]=qs['filters'](_[_0x6e9e('0x40')](_0x4f1a96[_0x6e9e('0x36')],_0x2fb6cd[_0x6e9e('0x37')]));if(_0x4f1a96[_0x6e9e('0x36')][_0x6e9e('0x41')]){_0x444d1c[_0x6e9e('0x3f')]=_[_0x6e9e('0x42')](_0x444d1c['where'],{'$or':_[_0x6e9e('0x43')](_0x444d1c[_0x6e9e('0x39')],function(_0x194e55){var _0x32c084={};_0x32c084[_0x194e55]={'$like':'%'+_0x4f1a96[_0x6e9e('0x36')][_0x6e9e('0x41')]+'%'};return _0x32c084;})});}_0x444d1c=_[_0x6e9e('0x42')]({},_0x444d1c,_0x4f1a96[_0x6e9e('0x4e')]);return _0x5521a3['getFields'](_0x444d1c);}})[_0x6e9e('0x48')](function(_0x29be25){if(_0x29be25){_0x3b7e0a=_0x29be25['length'];if(!_0x4f1a96['query'][_0x6e9e('0x3c')](_0x6e9e('0x3d'))){_0x444d1c[_0x6e9e('0x28')]=qs[_0x6e9e('0x28')](_0x4f1a96[_0x6e9e('0x36')][_0x6e9e('0x28')]);_0x444d1c['offset']=qs['offset'](_0x4f1a96[_0x6e9e('0x36')][_0x6e9e('0x27')]);}return _0x5521a3[_0x6e9e('0x53')](_0x444d1c);}})['then'](function(_0xe581ad){if(_0xe581ad){return _0xe581ad?{'count':_0x3b7e0a,'rows':_0xe581ad}:null;}})['then'](respondWithResult(_0x3046ba,null))[_0x6e9e('0x50')](handleError(_0x3046ba,null));};exports['getSubjects']=function(_0x483e90,_0x208d90,_0x494325){var _0x16528b={};var _0x1d0d85={};var _0x2f8bb5;var _0x394fa2;return db[_0x6e9e('0x32')]['findOne']({'where':{'id':_0x483e90[_0x6e9e('0x4c')]['id']}})[_0x6e9e('0x48')](handleEntityNotFound(_0x208d90,null))['then'](function(_0x93bb8d){if(_0x93bb8d){_0x2f8bb5=_0x93bb8d;_0x1d0d85[_0x6e9e('0x34')]=_[_0x6e9e('0x35')](db[_0x6e9e('0x55')]['rawAttributes']);_0x1d0d85[_0x6e9e('0x36')]=_[_0x6e9e('0x35')](_0x483e90[_0x6e9e('0x36')]);_0x1d0d85[_0x6e9e('0x37')]=_[_0x6e9e('0x38')](_0x1d0d85['model'],_0x1d0d85['query']);_0x16528b[_0x6e9e('0x39')]=_[_0x6e9e('0x38')](_0x1d0d85[_0x6e9e('0x34')],qs[_0x6e9e('0x3a')](_0x483e90[_0x6e9e('0x36')][_0x6e9e('0x3a')]));_0x16528b[_0x6e9e('0x39')]=_0x16528b['attributes'][_0x6e9e('0x3b')]?_0x16528b[_0x6e9e('0x39')]:_0x1d0d85[_0x6e9e('0x34')];_0x16528b[_0x6e9e('0x56')]=qs[_0x6e9e('0x3e')](_0x483e90[_0x6e9e('0x36')][_0x6e9e('0x3e')]);_0x16528b['where']=qs['filters'](_[_0x6e9e('0x40')](_0x483e90['query'],_0x1d0d85[_0x6e9e('0x37')]));if(_0x483e90['query'][_0x6e9e('0x41')]){_0x16528b['where']=_[_0x6e9e('0x42')](_0x16528b[_0x6e9e('0x3f')],{'$or':_[_0x6e9e('0x43')](_0x16528b[_0x6e9e('0x39')],function(_0x7973d){var _0x2a6a08={};_0x2a6a08[_0x7973d]={'$like':'%'+_0x483e90[_0x6e9e('0x36')]['filter']+'%'};return _0x2a6a08;})});}_0x16528b=_['merge']({},_0x16528b,_0x483e90['options']);return _0x2f8bb5[_0x6e9e('0x57')](_0x16528b);}})[_0x6e9e('0x48')](function(_0x39d78d){if(_0x39d78d){_0x394fa2=_0x39d78d['length'];if(!_0x483e90[_0x6e9e('0x36')][_0x6e9e('0x3c')](_0x6e9e('0x3d'))){_0x16528b[_0x6e9e('0x28')]=qs[_0x6e9e('0x28')](_0x483e90[_0x6e9e('0x36')]['limit']);_0x16528b['offset']=qs['offset'](_0x483e90[_0x6e9e('0x36')]['offset']);}return _0x2f8bb5[_0x6e9e('0x57')](_0x16528b);}})[_0x6e9e('0x48')](function(_0x5ef750){if(_0x5ef750){return _0x5ef750?{'count':_0x394fa2,'rows':_0x5ef750}:null;}})[_0x6e9e('0x48')](respondWithResult(_0x208d90,null))['catch'](handleError(_0x208d90,null));};exports[_0x6e9e('0x58')]=function(_0x536597,_0x43189f,_0x17cf96){var _0x509f73={};var _0x4c440b={};var _0x39f437;var _0x3c36fe;return db[_0x6e9e('0x32')][_0x6e9e('0x54')]({'where':{'id':_0x536597[_0x6e9e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43189f,null))[_0x6e9e('0x48')](function(_0x5dd833){if(_0x5dd833){_0x39f437=_0x5dd833;_0x4c440b[_0x6e9e('0x34')]=_['keys'](db[_0x6e9e('0x55')][_0x6e9e('0x33')]);_0x4c440b[_0x6e9e('0x36')]=_[_0x6e9e('0x35')](_0x536597['query']);_0x4c440b['filters']=_[_0x6e9e('0x38')](_0x4c440b[_0x6e9e('0x34')],_0x4c440b[_0x6e9e('0x36')]);_0x509f73[_0x6e9e('0x39')]=_[_0x6e9e('0x38')](_0x4c440b[_0x6e9e('0x34')],qs['fields'](_0x536597[_0x6e9e('0x36')][_0x6e9e('0x3a')]));_0x509f73[_0x6e9e('0x39')]=_0x509f73['attributes'][_0x6e9e('0x3b')]?_0x509f73[_0x6e9e('0x39')]:_0x4c440b[_0x6e9e('0x34')];_0x509f73[_0x6e9e('0x56')]=qs[_0x6e9e('0x3e')](_0x536597['query'][_0x6e9e('0x3e')]);_0x509f73[_0x6e9e('0x3f')]=qs[_0x6e9e('0x37')](_['pick'](_0x536597[_0x6e9e('0x36')],_0x4c440b['filters']));if(_0x536597[_0x6e9e('0x36')]['filter']){_0x509f73[_0x6e9e('0x3f')]=_['merge'](_0x509f73[_0x6e9e('0x3f')],{'$or':_[_0x6e9e('0x43')](_0x509f73[_0x6e9e('0x39')],function(_0x3ff659){var _0x17dea6={};_0x17dea6[_0x3ff659]={'$like':'%'+_0x536597[_0x6e9e('0x36')][_0x6e9e('0x41')]+'%'};return _0x17dea6;})});}_0x509f73=_[_0x6e9e('0x42')]({},_0x509f73,_0x536597[_0x6e9e('0x4e')]);return _0x39f437['getDescriptions'](_0x509f73);}})[_0x6e9e('0x48')](function(_0x3d1097){if(_0x3d1097){_0x3c36fe=_0x3d1097[_0x6e9e('0x3b')];if(!_0x536597[_0x6e9e('0x36')][_0x6e9e('0x3c')](_0x6e9e('0x3d'))){_0x509f73[_0x6e9e('0x28')]=qs[_0x6e9e('0x28')](_0x536597['query'][_0x6e9e('0x28')]);_0x509f73[_0x6e9e('0x27')]=qs[_0x6e9e('0x27')](_0x536597[_0x6e9e('0x36')][_0x6e9e('0x27')]);}return _0x39f437['getDescriptions'](_0x509f73);}})[_0x6e9e('0x48')](function(_0x34da87){if(_0x34da87){return _0x34da87?{'count':_0x3c36fe,'rows':_0x34da87}:null;}})[_0x6e9e('0x48')](respondWithResult(_0x43189f,null))[_0x6e9e('0x50')](handleError(_0x43189f,null));};exports[_0x6e9e('0x59')]=function(_0x2442a5,_0x21b765,_0x2833c6){var _0x42050f={};var _0x2a7c0e={};var _0x4dd086;var _0x39d3a8;return db[_0x6e9e('0x32')][_0x6e9e('0x54')]({'where':{'id':_0x2442a5['params']['id']}})[_0x6e9e('0x48')](handleEntityNotFound(_0x21b765,null))[_0x6e9e('0x48')](function(_0x40a6ad){if(_0x40a6ad){_0x4dd086=_0x40a6ad;_0x2a7c0e[_0x6e9e('0x34')]=_[_0x6e9e('0x35')](db[_0x6e9e('0x5a')][_0x6e9e('0x33')]);_0x2a7c0e[_0x6e9e('0x36')]=_[_0x6e9e('0x35')](_0x2442a5[_0x6e9e('0x36')]);_0x2a7c0e['filters']=_[_0x6e9e('0x38')](_0x2a7c0e['model'],_0x2a7c0e[_0x6e9e('0x36')]);_0x42050f[_0x6e9e('0x39')]=_[_0x6e9e('0x38')](_0x2a7c0e[_0x6e9e('0x34')],qs['fields'](_0x2442a5[_0x6e9e('0x36')][_0x6e9e('0x3a')]));_0x42050f['attributes']=_0x42050f[_0x6e9e('0x39')][_0x6e9e('0x3b')]?_0x42050f[_0x6e9e('0x39')]:_0x2a7c0e[_0x6e9e('0x34')];_0x42050f[_0x6e9e('0x56')]=qs[_0x6e9e('0x3e')](_0x2442a5[_0x6e9e('0x36')][_0x6e9e('0x3e')]);_0x42050f[_0x6e9e('0x3f')]=qs[_0x6e9e('0x37')](_[_0x6e9e('0x40')](_0x2442a5[_0x6e9e('0x36')],_0x2a7c0e[_0x6e9e('0x37')]));if(_0x2442a5[_0x6e9e('0x36')][_0x6e9e('0x41')]){_0x42050f['where']=_['merge'](_0x42050f['where'],{'$or':_[_0x6e9e('0x43')](_0x42050f[_0x6e9e('0x39')],function(_0x2ea451){var _0x1afaf5={};_0x1afaf5[_0x2ea451]={'$like':'%'+_0x2442a5[_0x6e9e('0x36')][_0x6e9e('0x41')]+'%'};return _0x1afaf5;})});}_0x42050f=_[_0x6e9e('0x42')]({},_0x42050f,_0x2442a5[_0x6e9e('0x4e')]);return _0x4dd086[_0x6e9e('0x59')](_0x42050f);}})['then'](function(_0x58ce1a){if(_0x58ce1a){_0x39d3a8=_0x58ce1a[_0x6e9e('0x3b')];if(!_0x2442a5['query'][_0x6e9e('0x3c')](_0x6e9e('0x3d'))){_0x42050f[_0x6e9e('0x28')]=qs[_0x6e9e('0x28')](_0x2442a5['query'][_0x6e9e('0x28')]);_0x42050f[_0x6e9e('0x27')]=qs['offset'](_0x2442a5[_0x6e9e('0x36')][_0x6e9e('0x27')]);}return _0x4dd086[_0x6e9e('0x59')](_0x42050f);}})[_0x6e9e('0x48')](function(_0x29e085){if(_0x29e085){return _0x29e085?{'count':_0x39d3a8,'rows':_0x29e085}:null;}})[_0x6e9e('0x48')](respondWithResult(_0x21b765,null))[_0x6e9e('0x50')](handleError(_0x21b765,null));};exports['setTags']=function(_0x24933f,_0x210b4a,_0x11640e){if(_0x24933f['body']['id']){delete _0x24933f[_0x6e9e('0x52')]['id'];}return db[_0x6e9e('0x32')][_0x6e9e('0x54')]({'where':{'id':_0x24933f['params']['id']}})[_0x6e9e('0x48')](handleEntityNotFound(_0x210b4a,null))[_0x6e9e('0x48')](function(_0x2f34b6){if(_0x2f34b6){return _0x2f34b6[_0x6e9e('0x5b')](_0x24933f[_0x6e9e('0x52')][_0x6e9e('0x5c')]||[]);}return null;})[_0x6e9e('0x48')](respondWithResult(_0x210b4a,null))[_0x6e9e('0x50')](handleError(_0x210b4a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 5855e7e..0af52e6 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 _0x0c46=['./intZendeskConfiguration.attributes','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x0c46,0x111));var _0x60c4=function(_0x558c61,_0x11c751){_0x558c61=_0x558c61-0x0;var _0x4203d7=_0x0c46[_0x558c61];return _0x4203d7;};'use strict';var _=require(_0x60c4('0x0'));var util=require(_0x60c4('0x1'));var logger=require(_0x60c4('0x2'))(_0x60c4('0x3'));var moment=require(_0x60c4('0x4'));var BPromise=require(_0x60c4('0x5'));var rp=require(_0x60c4('0x6'));var attributes=require(_0x60c4('0x7'));module['exports']=function(_0x321dc5,_0x519484){return _0x321dc5[_0x60c4('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x60c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x043f=['exports','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','./intZendeskConfiguration.attributes'];(function(_0x2f8a72,_0x3cffee){var _0xf4a1fe=function(_0x48b5f8){while(--_0x48b5f8){_0x2f8a72['push'](_0x2f8a72['shift']());}};_0xf4a1fe(++_0x3cffee);}(_0x043f,0xd5));var _0xf043=function(_0x1c5202,_0x5bc415){_0x1c5202=_0x1c5202-0x0;var _0xae684b=_0x043f[_0x1c5202];return _0xae684b;};'use strict';var _=require(_0xf043('0x0'));var util=require(_0xf043('0x1'));var logger=require(_0xf043('0x2'))(_0xf043('0x3'));var moment=require(_0xf043('0x4'));var BPromise=require('bluebird');var rp=require(_0xf043('0x5'));var attributes=require(_0xf043('0x6'));module[_0xf043('0x7')]=function(_0x22d991,_0x194312){return _0x22d991[_0xf043('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0xf043('0x9'),'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 5aeac1e..f709e38 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 _0x5e5b=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x521e33,_0x55f926){var _0x407fdc=function(_0x23105e){while(--_0x23105e){_0x521e33['push'](_0x521e33['shift']());}};_0x407fdc(++_0x55f926);}(_0x5e5b,0x87));var _0xb5e5=function(_0x3607b2,_0x18fa72){_0x3607b2=_0x3607b2-0x0;var _0x33dbc8=_0x5e5b[_0x3607b2];return _0x33dbc8;};'use strict';var _=require(_0xb5e5('0x0'));var util=require(_0xb5e5('0x1'));var moment=require(_0xb5e5('0x2'));var BPromise=require('bluebird');var rs=require(_0xb5e5('0x3'));var fs=require('fs');var Redis=require(_0xb5e5('0x4'));var db=require(_0xb5e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5e5('0x6'))(_0xb5e5('0x7'));var config=require(_0xb5e5('0x8'));var jayson=require(_0xb5e5('0x9'));var client=jayson['client'][_0xb5e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d6a06,_0x2e178a,_0x289101){return new BPromise(function(_0x197e20,_0x1a84d9){return client[_0xb5e5('0xb')](_0x5d6a06,_0x289101)['then'](function(_0x3893aa){logger[_0xb5e5('0xc')](_0xb5e5('0xd'),_0x2e178a,'request\x20sent');logger[_0xb5e5('0xe')](_0xb5e5('0xf'),_0x2e178a,'request\x20sent',JSON[_0xb5e5('0x10')](_0x3893aa));if(_0x3893aa['error']){if(_0x3893aa[_0xb5e5('0x11')][_0xb5e5('0x12')]===0x1f4){logger[_0xb5e5('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2e178a,_0x3893aa[_0xb5e5('0x11')][_0xb5e5('0x13')]);return _0x1a84d9(_0x3893aa[_0xb5e5('0x11')]['message']);}logger['error'](_0xb5e5('0xd'),_0x2e178a,_0x3893aa[_0xb5e5('0x11')]['message']);return _0x197e20(_0x3893aa['error'][_0xb5e5('0x13')]);}else{logger[_0xb5e5('0xc')](_0xb5e5('0xd'),_0x2e178a,'request\x20sent');_0x197e20(_0x3893aa[_0xb5e5('0x14')][_0xb5e5('0x13')]);}})[_0xb5e5('0x15')](function(_0x25f2d0){logger[_0xb5e5('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2e178a,_0x25f2d0);_0x1a84d9(_0x25f2d0);});});} \ No newline at end of file +var _0x56b3=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x5ca09f,_0x40c37c){var _0x121660=function(_0xe515e9){while(--_0xe515e9){_0x5ca09f['push'](_0x5ca09f['shift']());}};_0x121660(++_0x40c37c);}(_0x56b3,0xd9));var _0x356b=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x56b3[_0x1d04b5];return _0x161342;};'use strict';var _=require(_0x356b('0x0'));var util=require(_0x356b('0x1'));var moment=require(_0x356b('0x2'));var BPromise=require('bluebird');var rs=require(_0x356b('0x3'));var fs=require('fs');var Redis=require(_0x356b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x356b('0x5'));var config=require(_0x356b('0x6'));var jayson=require(_0x356b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3137,_0x39917e,_0x1fc35f){return new BPromise(function(_0x5a3eb9,_0x497859){return client[_0x356b('0x8')](_0x2e3137,_0x1fc35f)[_0x356b('0x9')](function(_0x191cfe){logger[_0x356b('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39917e,_0x356b('0xb'));logger[_0x356b('0xc')](_0x356b('0xd'),_0x39917e,_0x356b('0xb'),JSON['stringify'](_0x191cfe));if(_0x191cfe[_0x356b('0xe')]){if(_0x191cfe['error'][_0x356b('0xf')]===0x1f4){logger[_0x356b('0xe')](_0x356b('0x10'),_0x39917e,_0x191cfe[_0x356b('0xe')][_0x356b('0x11')]);return _0x497859(_0x191cfe['error'][_0x356b('0x11')]);}logger[_0x356b('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39917e,_0x191cfe['error'][_0x356b('0x11')]);return _0x5a3eb9(_0x191cfe['error'][_0x356b('0x11')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x39917e,_0x356b('0xb'));_0x5a3eb9(_0x191cfe['result']['message']);}})[_0x356b('0x12')](function(_0x25f6d7){logger[_0x356b('0xe')](_0x356b('0x10'),_0x39917e,_0x25f6d7);_0x497859(_0x25f6d7);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index d03f1b5..69fde56 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 _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x14b36e,_0x8dd826){var _0x616e7=function(_0x14e594){while(--_0x14e594){_0x14b36e['push'](_0x14b36e['shift']());}};_0x616e7(++_0x8dd826);}(_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['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=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(_0xc09bac,_0x2fecd0){var _0x54eb83=function(_0x2ff19b){while(--_0x2ff19b){_0xc09bac['push'](_0xc09bac['shift']());}};_0x54eb83(++_0x2fecd0);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var 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 2f998a2..e3be2c0 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 _0x91a7=['STRING','exports','ENUM','string','customVariable'];(function(_0x3806a6,_0x2f6881){var _0x2f150e=function(_0x55cce0){while(--_0x55cce0){_0x3806a6['push'](_0x3806a6['shift']());}};_0x2f150e(++_0x2f6881);}(_0x91a7,0xe7));var _0x791a=function(_0x548961,_0x5a13d0){_0x548961=_0x548961-0x0;var _0x31593d=_0x91a7[_0x548961];return _0x31593d;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'type':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'),'keyValue'),'defaultValue':_0x791a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x791a('0x4')]},'nameField':{'type':Sequelize[_0x791a('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x791a('0x4')]}}; \ No newline at end of file +var _0x6c76=['customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x6c76,0x184));var _0x66c7=function(_0x587963,_0x193e71){_0x587963=_0x587963-0x0;var _0x23541b=_0x6c76[_0x587963];return _0x23541b;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'type':{'type':Sequelize[_0x66c7('0x2')]('string',_0x66c7('0x3'),_0x66c7('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x66c7('0x5')]},'key':{'type':Sequelize[_0x66c7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x66c7('0x6'),_0x66c7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x66c7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x66c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66c7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1079b01..ded5b1f 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 _0x4ac1=['fields','length','nolimit','limit','order','sort','filters','filter','where','merge','map','type','key','options','count','include','findAll','catch','show','params','includeAll','find','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','stack','name','send','ZendeskField','rawAttributes','model','keys','query','attributes','intersection'];(function(_0x3a037b,_0x25ec24){var _0x11b964=function(_0x267d89){while(--_0x267d89){_0x3a037b['push'](_0x3a037b['shift']());}};_0x11b964(++_0x25ec24);}(_0x4ac1,0xf1));var _0x14ac=function(_0x3ebc9b,_0x19f15d){_0x3ebc9b=_0x3ebc9b-0x0;var _0x1a255d=_0x4ac1[_0x3ebc9b];return _0x1a255d;};'use strict';var pdf=require(_0x14ac('0x0'));var emlformat=require(_0x14ac('0x1'));var rimraf=require(_0x14ac('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14ac('0x3'));var rp=require(_0x14ac('0x4'));var moment=require(_0x14ac('0x5'));var BPromise=require(_0x14ac('0x6'));var Mustache=require(_0x14ac('0x7'));var util=require(_0x14ac('0x8'));var path=require(_0x14ac('0x9'));var sox=require(_0x14ac('0xa'));var csv=require(_0x14ac('0xb'));var ejs=require(_0x14ac('0xc'));var fs=require('fs');var _=require(_0x14ac('0xd'));var squel=require(_0x14ac('0xe'));var crypto=require('crypto');var jsforce=require(_0x14ac('0xf'));var deskjs=require(_0x14ac('0x10'));var toCsv=require('to-csv');var querystring=require(_0x14ac('0x11'));var Papa=require(_0x14ac('0x12'));var authService=require(_0x14ac('0x13'));var hardwareService=require(_0x14ac('0x14'));var Redis=require('ioredis');var qs=require(_0x14ac('0x15'));var logger=require(_0x14ac('0x16'))(_0x14ac('0x17'));var utils=require(_0x14ac('0x18'));var config=require('../../config/environment');var db=require(_0x14ac('0x19'))['db'];function respondWithStatusCode(_0x2354ce,_0x45d64b){_0x45d64b=_0x45d64b||0xcc;return function(_0x575510){if(_0x575510){return _0x2354ce[_0x14ac('0x1a')](_0x45d64b);}return _0x2354ce[_0x14ac('0x1b')](_0x45d64b)[_0x14ac('0x1c')]();};}function respondWithResult(_0x4c7b05,_0x52f38b){_0x52f38b=_0x52f38b||0xc8;return function(_0x1ca6da){if(_0x1ca6da){return _0x4c7b05[_0x14ac('0x1b')](_0x52f38b)[_0x14ac('0x1d')](_0x1ca6da);}};}function respondWithFilteredResult(_0x321510,_0x3de956){return function(_0x34b965){if(_0x34b965){var _0x4ebfda=_0x34b965['count'],_0x4c4217=_0x3de956[_0x14ac('0x1e')],_0x32b801=_0x3de956[_0x14ac('0x1e')]+_0x3de956['limit'],_0x5ce1be;if(_0x32b801>=_0x4ebfda){_0x32b801=_0x4ebfda;_0x5ce1be=0xc8;}else{_0x5ce1be=0xce;}_0x321510[_0x14ac('0x1b')](_0x5ce1be);return _0x321510[_0x14ac('0x1f')]('Content-Range',_0x4c4217+'-'+_0x32b801+'/'+_0x4ebfda)['json'](_0x34b965);}return null;};}function patchUpdates(_0x1768ff){return function(_0x2d5da9){try{jsonpatch[_0x14ac('0x20')](_0x2d5da9,_0x1768ff,!![]);}catch(_0x5020b7){return BPromise[_0x14ac('0x21')](_0x5020b7);}return _0x2d5da9[_0x14ac('0x22')]();};}function saveUpdates(_0x552e57,_0x41024d){return function(_0x4d89d7){if(_0x4d89d7){return _0x4d89d7[_0x14ac('0x23')](_0x552e57)[_0x14ac('0x24')](function(_0x3be91b){return _0x3be91b;});}return null;};}function removeEntity(_0x105e91,_0x876a09){return function(_0x5b8737){if(_0x5b8737){return _0x5b8737['destroy']()[_0x14ac('0x24')](function(){_0x105e91[_0x14ac('0x1b')](0xcc)[_0x14ac('0x1c')]();});}};}function handleEntityNotFound(_0x4bf123,_0x28071b){return function(_0x2d11e0){if(!_0x2d11e0){_0x4bf123[_0x14ac('0x1a')](0x194);}return _0x2d11e0;};}function handleError(_0x431251,_0x16178b){_0x16178b=_0x16178b||0x1f4;return function(_0x290a6a){logger['error'](_0x290a6a[_0x14ac('0x25')]);if(_0x290a6a['name']){delete _0x290a6a[_0x14ac('0x26')];}_0x431251[_0x14ac('0x1b')](_0x16178b)[_0x14ac('0x27')](_0x290a6a);};}exports['index']=function(_0x1b9080,_0x250513){var _0x412e25={},_0x59de39={},_0x479675={'count':0x0,'rows':[]};var _0x125052=db[_0x14ac('0x28')][_0x14ac('0x29')];_0x59de39[_0x14ac('0x2a')]=_[_0x14ac('0x2b')](_0x125052);_0x59de39[_0x14ac('0x2c')]=_[_0x14ac('0x2b')](_0x1b9080['query']);_0x59de39['filters']=_['intersection'](_0x59de39[_0x14ac('0x2a')],_0x59de39[_0x14ac('0x2c')]);_0x412e25[_0x14ac('0x2d')]=_[_0x14ac('0x2e')](_0x59de39[_0x14ac('0x2a')],qs[_0x14ac('0x2f')](_0x1b9080[_0x14ac('0x2c')][_0x14ac('0x2f')]));_0x412e25['attributes']=_0x412e25[_0x14ac('0x2d')][_0x14ac('0x30')]?_0x412e25[_0x14ac('0x2d')]:_0x59de39['model'];if(!_0x1b9080[_0x14ac('0x2c')]['hasOwnProperty'](_0x14ac('0x31'))){_0x412e25[_0x14ac('0x32')]=qs[_0x14ac('0x32')](_0x1b9080[_0x14ac('0x2c')][_0x14ac('0x32')]);_0x412e25[_0x14ac('0x1e')]=qs[_0x14ac('0x1e')](_0x1b9080[_0x14ac('0x2c')]['offset']);}_0x412e25[_0x14ac('0x33')]=qs['sort'](_0x1b9080[_0x14ac('0x2c')][_0x14ac('0x34')]);_0x412e25['where']=qs['filters'](_['pick'](_0x1b9080[_0x14ac('0x2c')],_0x59de39[_0x14ac('0x35')]));if(_0x1b9080[_0x14ac('0x2c')][_0x14ac('0x36')]){_0x412e25[_0x14ac('0x37')]=_[_0x14ac('0x38')](_0x412e25[_0x14ac('0x37')],{'$or':_[_0x14ac('0x39')](_0x125052,function(_0xc35102){if(_0xc35102[_0x14ac('0x3a')][_0x14ac('0x3b')]!=='VIRTUAL'){var _0x1fd1a2={};_0x1fd1a2[_0xc35102['field']]={'$like':'%'+_0x1b9080[_0x14ac('0x2c')][_0x14ac('0x36')]+'%'};return _0x1fd1a2;}})});}_0x412e25=_['merge']({},_0x412e25,_0x1b9080[_0x14ac('0x3c')]);var _0x2ea41d={'where':_0x412e25['where']};return db['ZendeskField'][_0x14ac('0x3d')](_0x2ea41d)['then'](function(_0x78c0e7){_0x479675['count']=_0x78c0e7;if(_0x1b9080[_0x14ac('0x2c')]['includeAll']){_0x412e25[_0x14ac('0x3e')]=[{'all':!![]}];}return db['ZendeskField'][_0x14ac('0x3f')](_0x412e25);})[_0x14ac('0x24')](function(_0x2e4acf){_0x479675['rows']=_0x2e4acf;return _0x479675;})[_0x14ac('0x24')](respondWithFilteredResult(_0x250513,_0x412e25))[_0x14ac('0x40')](handleError(_0x250513,null));};exports[_0x14ac('0x41')]=function(_0x470cc3,_0xfb843a){var _0x33d112={'raw':!![],'where':{'id':_0x470cc3[_0x14ac('0x42')]['id']}},_0x39eee7={};_0x39eee7[_0x14ac('0x2a')]=_[_0x14ac('0x2b')](db[_0x14ac('0x28')][_0x14ac('0x29')]);_0x39eee7[_0x14ac('0x2c')]=_[_0x14ac('0x2b')](_0x470cc3[_0x14ac('0x2c')]);_0x39eee7[_0x14ac('0x35')]=_[_0x14ac('0x2e')](_0x39eee7[_0x14ac('0x2a')],_0x39eee7[_0x14ac('0x2c')]);_0x33d112[_0x14ac('0x2d')]=_[_0x14ac('0x2e')](_0x39eee7[_0x14ac('0x2a')],qs[_0x14ac('0x2f')](_0x470cc3[_0x14ac('0x2c')][_0x14ac('0x2f')]));_0x33d112[_0x14ac('0x2d')]=_0x33d112[_0x14ac('0x2d')][_0x14ac('0x30')]?_0x33d112[_0x14ac('0x2d')]:_0x39eee7[_0x14ac('0x2a')];if(_0x470cc3[_0x14ac('0x2c')][_0x14ac('0x43')]){_0x33d112[_0x14ac('0x3e')]=[{'all':!![]}];}_0x33d112=_['merge']({},_0x33d112,_0x470cc3[_0x14ac('0x3c')]);return db[_0x14ac('0x28')][_0x14ac('0x44')](_0x33d112)['then'](handleEntityNotFound(_0xfb843a,null))[_0x14ac('0x24')](respondWithResult(_0xfb843a,null))[_0x14ac('0x40')](handleError(_0xfb843a,null));};exports[_0x14ac('0x45')]=function(_0x24f062,_0x1719e5){return db[_0x14ac('0x28')]['create'](_0x24f062[_0x14ac('0x46')],{})['then'](respondWithResult(_0x1719e5,0xc9))[_0x14ac('0x40')](handleError(_0x1719e5,null));};exports[_0x14ac('0x23')]=function(_0x382fd1,_0xb59f6){if(_0x382fd1[_0x14ac('0x46')]['id']){delete _0x382fd1[_0x14ac('0x46')]['id'];}return db[_0x14ac('0x28')][_0x14ac('0x44')]({'where':{'id':_0x382fd1[_0x14ac('0x42')]['id']}})[_0x14ac('0x24')](handleEntityNotFound(_0xb59f6,null))[_0x14ac('0x24')](saveUpdates(_0x382fd1['body'],null))[_0x14ac('0x24')](respondWithResult(_0xb59f6,null))[_0x14ac('0x40')](handleError(_0xb59f6,null));};exports[_0x14ac('0x47')]=function(_0x20893f,_0x55bc9d){return db[_0x14ac('0x28')][_0x14ac('0x44')]({'where':{'id':_0x20893f[_0x14ac('0x42')]['id']}})[_0x14ac('0x24')](handleEntityNotFound(_0x55bc9d,null))['then'](removeEntity(_0x55bc9d,null))[_0x14ac('0x40')](handleError(_0x55bc9d,null));}; \ No newline at end of file +var _0x43cc=['name','send','index','ZendeskField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','rows','show','params','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','jsforce','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43cc,0x16f));var _0xc43c=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x43cc[_0x128450];return _0x4d80ed;};'use strict';var pdf=require(_0xc43c('0x0'));var emlformat=require(_0xc43c('0x1'));var rimraf=require(_0xc43c('0x2'));var zipdir=require(_0xc43c('0x3'));var jsonpatch=require(_0xc43c('0x4'));var rp=require(_0xc43c('0x5'));var moment=require(_0xc43c('0x6'));var BPromise=require(_0xc43c('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc43c('0x8'));var sox=require(_0xc43c('0x9'));var csv=require(_0xc43c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc43c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc43c('0xa'));var querystring=require(_0xc43c('0xc'));var Papa=require('papaparse');var authService=require(_0xc43c('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xc43c('0xe'));var qs=require(_0xc43c('0xf'));var logger=require('../../config/logger')(_0xc43c('0x10'));var utils=require(_0xc43c('0x11'));var config=require(_0xc43c('0x12'));var db=require(_0xc43c('0x13'))['db'];function respondWithStatusCode(_0x34f581,_0x2a781f){_0x2a781f=_0x2a781f||0xcc;return function(_0x192fd2){if(_0x192fd2){return _0x34f581['sendStatus'](_0x2a781f);}return _0x34f581['status'](_0x2a781f)[_0xc43c('0x14')]();};}function respondWithResult(_0x2a4d66,_0x4cb696){_0x4cb696=_0x4cb696||0xc8;return function(_0x3c5679){if(_0x3c5679){return _0x2a4d66[_0xc43c('0x15')](_0x4cb696)[_0xc43c('0x16')](_0x3c5679);}};}function respondWithFilteredResult(_0xeb76da,_0x227b36){return function(_0x3980c4){if(_0x3980c4){var _0x3960f1=_0x3980c4[_0xc43c('0x17')],_0x254cc2=_0x227b36[_0xc43c('0x18')],_0x49f6a8=_0x227b36[_0xc43c('0x18')]+_0x227b36['limit'],_0x4f1444;if(_0x49f6a8>=_0x3960f1){_0x49f6a8=_0x3960f1;_0x4f1444=0xc8;}else{_0x4f1444=0xce;}_0xeb76da[_0xc43c('0x15')](_0x4f1444);return _0xeb76da[_0xc43c('0x19')](_0xc43c('0x1a'),_0x254cc2+'-'+_0x49f6a8+'/'+_0x3960f1)[_0xc43c('0x16')](_0x3980c4);}return null;};}function patchUpdates(_0x37b6dc){return function(_0x10e156){try{jsonpatch[_0xc43c('0x1b')](_0x10e156,_0x37b6dc,!![]);}catch(_0x369905){return BPromise['reject'](_0x369905);}return _0x10e156[_0xc43c('0x1c')]();};}function saveUpdates(_0x918608,_0x530322){return function(_0x37154b){if(_0x37154b){return _0x37154b[_0xc43c('0x1d')](_0x918608)['then'](function(_0x57fd53){return _0x57fd53;});}return null;};}function removeEntity(_0x36780f,_0x511d9d){return function(_0x4850ae){if(_0x4850ae){return _0x4850ae[_0xc43c('0x1e')]()[_0xc43c('0x1f')](function(){_0x36780f[_0xc43c('0x15')](0xcc)[_0xc43c('0x14')]();});}};}function handleEntityNotFound(_0x3cfe93,_0x2af119){return function(_0x194bde){if(!_0x194bde){_0x3cfe93[_0xc43c('0x20')](0x194);}return _0x194bde;};}function handleError(_0x529b14,_0x15b3b5){_0x15b3b5=_0x15b3b5||0x1f4;return function(_0x4169d4){logger[_0xc43c('0x21')](_0x4169d4[_0xc43c('0x22')]);if(_0x4169d4[_0xc43c('0x23')]){delete _0x4169d4[_0xc43c('0x23')];}_0x529b14[_0xc43c('0x15')](_0x15b3b5)[_0xc43c('0x24')](_0x4169d4);};}exports[_0xc43c('0x25')]=function(_0x49437e,_0xc5cda){var _0x4ba29d={},_0x2a30ff={},_0x4fdb21={'count':0x0,'rows':[]};var _0x520c9a=db[_0xc43c('0x26')][_0xc43c('0x27')];_0x2a30ff[_0xc43c('0x28')]=_[_0xc43c('0x29')](_0x520c9a);_0x2a30ff[_0xc43c('0x2a')]=_[_0xc43c('0x29')](_0x49437e['query']);_0x2a30ff[_0xc43c('0x2b')]=_[_0xc43c('0x2c')](_0x2a30ff['model'],_0x2a30ff[_0xc43c('0x2a')]);_0x4ba29d['attributes']=_['intersection'](_0x2a30ff[_0xc43c('0x28')],qs[_0xc43c('0x2d')](_0x49437e[_0xc43c('0x2a')]['fields']));_0x4ba29d[_0xc43c('0x2e')]=_0x4ba29d[_0xc43c('0x2e')][_0xc43c('0x2f')]?_0x4ba29d[_0xc43c('0x2e')]:_0x2a30ff[_0xc43c('0x28')];if(!_0x49437e[_0xc43c('0x2a')][_0xc43c('0x30')](_0xc43c('0x31'))){_0x4ba29d[_0xc43c('0x32')]=qs[_0xc43c('0x32')](_0x49437e[_0xc43c('0x2a')][_0xc43c('0x32')]);_0x4ba29d[_0xc43c('0x18')]=qs[_0xc43c('0x18')](_0x49437e[_0xc43c('0x2a')][_0xc43c('0x18')]);}_0x4ba29d[_0xc43c('0x33')]=qs[_0xc43c('0x34')](_0x49437e[_0xc43c('0x2a')][_0xc43c('0x34')]);_0x4ba29d['where']=qs['filters'](_[_0xc43c('0x35')](_0x49437e[_0xc43c('0x2a')],_0x2a30ff[_0xc43c('0x2b')]));if(_0x49437e[_0xc43c('0x2a')]['filter']){_0x4ba29d['where']=_[_0xc43c('0x36')](_0x4ba29d[_0xc43c('0x37')],{'$or':_['map'](_0x520c9a,function(_0x5f0046){if(_0x5f0046['type']['key']!==_0xc43c('0x38')){var _0x2aeadc={};_0x2aeadc[_0x5f0046['field']]={'$like':'%'+_0x49437e[_0xc43c('0x2a')][_0xc43c('0x39')]+'%'};return _0x2aeadc;}})});}_0x4ba29d=_[_0xc43c('0x36')]({},_0x4ba29d,_0x49437e['options']);var _0x2d5d8a={'where':_0x4ba29d[_0xc43c('0x37')]};return db['ZendeskField']['count'](_0x2d5d8a)[_0xc43c('0x1f')](function(_0x2a5619){_0x4fdb21[_0xc43c('0x17')]=_0x2a5619;if(_0x49437e[_0xc43c('0x2a')][_0xc43c('0x3a')]){_0x4ba29d[_0xc43c('0x3b')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x4ba29d);})[_0xc43c('0x1f')](function(_0x10d641){_0x4fdb21[_0xc43c('0x3c')]=_0x10d641;return _0x4fdb21;})[_0xc43c('0x1f')](respondWithFilteredResult(_0xc5cda,_0x4ba29d))['catch'](handleError(_0xc5cda,null));};exports[_0xc43c('0x3d')]=function(_0x1da087,_0x836356){var _0x4c544d={'raw':!![],'where':{'id':_0x1da087[_0xc43c('0x3e')]['id']}},_0x3da281={};_0x3da281[_0xc43c('0x28')]=_[_0xc43c('0x29')](db[_0xc43c('0x26')][_0xc43c('0x27')]);_0x3da281[_0xc43c('0x2a')]=_[_0xc43c('0x29')](_0x1da087[_0xc43c('0x2a')]);_0x3da281[_0xc43c('0x2b')]=_['intersection'](_0x3da281[_0xc43c('0x28')],_0x3da281[_0xc43c('0x2a')]);_0x4c544d['attributes']=_[_0xc43c('0x2c')](_0x3da281[_0xc43c('0x28')],qs[_0xc43c('0x2d')](_0x1da087['query']['fields']));_0x4c544d[_0xc43c('0x2e')]=_0x4c544d['attributes']['length']?_0x4c544d['attributes']:_0x3da281[_0xc43c('0x28')];if(_0x1da087[_0xc43c('0x2a')]['includeAll']){_0x4c544d[_0xc43c('0x3b')]=[{'all':!![]}];}_0x4c544d=_['merge']({},_0x4c544d,_0x1da087['options']);return db[_0xc43c('0x26')][_0xc43c('0x3f')](_0x4c544d)['then'](handleEntityNotFound(_0x836356,null))[_0xc43c('0x1f')](respondWithResult(_0x836356,null))['catch'](handleError(_0x836356,null));};exports[_0xc43c('0x40')]=function(_0x1589f1,_0x4c2085){return db[_0xc43c('0x26')][_0xc43c('0x40')](_0x1589f1[_0xc43c('0x41')],{})['then'](respondWithResult(_0x4c2085,0xc9))['catch'](handleError(_0x4c2085,null));};exports[_0xc43c('0x1d')]=function(_0x1fa72f,_0x43020e){if(_0x1fa72f[_0xc43c('0x41')]['id']){delete _0x1fa72f[_0xc43c('0x41')]['id'];}return db[_0xc43c('0x26')]['find']({'where':{'id':_0x1fa72f['params']['id']}})[_0xc43c('0x1f')](handleEntityNotFound(_0x43020e,null))[_0xc43c('0x1f')](saveUpdates(_0x1fa72f[_0xc43c('0x41')],null))['then'](respondWithResult(_0x43020e,null))[_0xc43c('0x42')](handleError(_0x43020e,null));};exports[_0xc43c('0x1e')]=function(_0x2efa1f,_0x13632f){return db['ZendeskField']['find']({'where':{'id':_0x2efa1f['params']['id']}})['then'](handleEntityNotFound(_0x13632f,null))['then'](removeEntity(_0x13632f,null))[_0xc43c('0x42')](handleError(_0x13632f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5aa7098..6f53530 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 _0xb7e7=['idField','lodash','../../config/logger','moment','request-promise','exports','int_zendesk_fields','zendesk_unique_index'];(function(_0x2105b7,_0x121ec8){var _0x4239e7=function(_0x1d1758){while(--_0x1d1758){_0x2105b7['push'](_0x2105b7['shift']());}};_0x4239e7(++_0x121ec8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xb7e7[_0x9aada2];return _0x196dff;};'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 attributes=require('./intZendeskField.attributes');module[_0x7b7e('0x4')]=function(_0x118577,_0x1d9384){return _0x118577['define']('ZendeskField',attributes,{'tableName':_0x7b7e('0x5'),'paranoid':![],'indexes':[{'name':_0x7b7e('0x6'),'fields':[_0x7b7e('0x7'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c00=['../../config/logger','moment','request-promise','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util'];(function(_0xe49f8c,_0x439565){var _0x2e06e4=function(_0x222c3d){while(--_0x222c3d){_0xe49f8c['push'](_0xe49f8c['shift']());}};_0x2e06e4(++_0x439565);}(_0x5c00,0x17e));var _0x05c0=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x5c00[_0x107f10];return _0x811cab;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var logger=require(_0x05c0('0x2'))('api');var moment=require(_0x05c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x05c0('0x4'));var attributes=require(_0x05c0('0x5'));module[_0x05c0('0x6')]=function(_0x28d9c7,_0x565efc){return _0x28d9c7[_0x05c0('0x7')](_0x05c0('0x8'),attributes,{'tableName':_0x05c0('0x9'),'paranoid':![],'indexes':[{'name':_0x05c0('0xa'),'fields':['idField',_0x05c0('0xb')],'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 b81d57a..95de149 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 _0x9c00=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis'];(function(_0x462bc3,_0x20667f){var _0x1861dc=function(_0x4fbc5e){while(--_0x4fbc5e){_0x462bc3['push'](_0x462bc3['shift']());}};_0x1861dc(++_0x20667f);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5aabcb,_0x219fbd){_0x5aabcb=_0x5aabcb-0x0;var _0x4b6e71=_0x9c00[_0x5aabcb];return _0x4b6e71;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x09c0('0x2'));var fs=require('fs');var Redis=require(_0x09c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c0('0x4'));var logger=require(_0x09c0('0x5'))(_0x09c0('0x6'));var config=require(_0x09c0('0x7'));var jayson=require(_0x09c0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3d7e,_0x17d11f,_0x1b633b){return new BPromise(function(_0x3187aa,_0x17cd9d){return client['request'](_0x1f3d7e,_0x1b633b)[_0x09c0('0x9')](function(_0x1c1246){logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,_0x09c0('0xc'));logger[_0x09c0('0xd')](_0x09c0('0xe'),_0x17d11f,_0x09c0('0xc'),JSON[_0x09c0('0xf')](_0x1c1246));if(_0x1c1246[_0x09c0('0x10')]){if(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x11')]===0x1f4){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x17cd9d(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x3187aa(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}else{logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,'request\x20sent');_0x3187aa(_0x1c1246['result']['message']);}})[_0x09c0('0x13')](function(_0x11f4b2){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x11f4b2);_0x17cd9d(_0x11f4b2);});});} \ No newline at end of file +var _0xe9e8=['info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x11af91,_0x47cefe){var _0x15c42b=function(_0x39c74d){while(--_0x39c74d){_0x11af91['push'](_0x11af91['shift']());}};_0x15c42b(++_0x47cefe);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x1213a5,_0x2873ac){_0x1213a5=_0x1213a5-0x0;var _0x17a930=_0xe9e8[_0x1213a5];return _0x17a930;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))(_0x8e9e('0x8'));var config=require(_0x8e9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e9e('0xa')][_0x8e9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x204f5c,_0x1fb8d3,_0x58f822){return new BPromise(function(_0x3b5d21,_0x2ae896){return client[_0x8e9e('0xc')](_0x204f5c,_0x58f822)['then'](function(_0x39f5e5){logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1fb8d3,_0x8e9e('0x11'),JSON[_0x8e9e('0x12')](_0x39f5e5));if(_0x39f5e5[_0x8e9e('0x13')]){if(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x14')]===0x1f4){logger['error'](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5['error'][_0x8e9e('0x15')]);return _0x2ae896(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);}logger[_0x8e9e('0x13')](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);return _0x3b5d21(_0x39f5e5['error']['message']);}else{logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');_0x3b5d21(_0x39f5e5[_0x8e9e('0x16')][_0x8e9e('0x15')]);}})[_0x8e9e('0x17')](function(_0x22b2c7){logger[_0x8e9e('0x13')]('ZendeskField,\x20%s,\x20%s',_0x1fb8d3,_0x22b2c7);_0x2ae896(_0x22b2c7);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 1dac321..ef801c4 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 _0x4fc2=['getFields','post','create','addConfiguration','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x3b6335,_0x32f96a){var _0x353cb1=function(_0x117a73){while(--_0x117a73){_0x3b6335['push'](_0x3b6335['shift']());}};_0x353cb1(++_0x32f96a);}(_0x4fc2,0x111));var _0x24fc=function(_0x154276,_0xdced12){_0x154276=_0x154276-0x0;var _0xff137e=_0x4fc2[_0x154276];return _0xff137e;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var auth=require(_0x24fc('0x5'));var interaction=require(_0x24fc('0x6'));var config=require('../../config/environment');var controller=require(_0x24fc('0x7'));router[_0x24fc('0x8')]('/',auth['isAuthenticated'](),controller[_0x24fc('0x9')]);router[_0x24fc('0x8')]('/:id',auth[_0x24fc('0xa')](),controller[_0x24fc('0xb')]);router[_0x24fc('0x8')](_0x24fc('0xc'),auth[_0x24fc('0xa')](),controller[_0x24fc('0xd')]);router['get'](_0x24fc('0xe'),auth[_0x24fc('0xa')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')]('/',auth[_0x24fc('0xa')](),controller[_0x24fc('0x11')]);router[_0x24fc('0x10')](_0x24fc('0xc'),auth['isAuthenticated'](),controller[_0x24fc('0x12')]);router[_0x24fc('0x13')]('/:id',auth[_0x24fc('0xa')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0x16'),auth[_0x24fc('0xa')](),controller[_0x24fc('0x17')]);module['exports']=router; \ No newline at end of file +var _0xf7b4=['express','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','connect-timeout'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf7b4,0x152));var _0x4f7b=function(_0x3de618,_0x410649){_0x3de618=_0x3de618-0x0;var _0x1daabb=_0xf7b4[_0x3de618];return _0x1daabb;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4f7b('0x3'));var config=require(_0x4f7b('0x4'));var controller=require(_0x4f7b('0x5'));router[_0x4f7b('0x6')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x8')]);router[_0x4f7b('0x6')](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xa')]);router[_0x4f7b('0x6')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller['getConfigurations']);router[_0x4f7b('0x6')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0xe')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xf')]);router[_0x4f7b('0xe')]('/:id/configurations',auth[_0x4f7b('0x7')](),controller['addConfiguration']);router['put'](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x10')]);router[_0x4f7b('0x11')]('/:id',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x12')]);module[_0x4f7b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index c6e1d8c..8ec391d 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 _0xae07=['STRING','sequelize','exports'];(function(_0x2c21a1,_0x338adb){var _0x4e8a3e=function(_0x247397){while(--_0x247397){_0x2c21a1['push'](_0x2c21a1['shift']());}};_0x4e8a3e(++_0x338adb);}(_0xae07,0xbe));var _0x7ae0=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xae07[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x7ae0('0x0'));module[_0x7ae0('0x1')]={'name':{'type':Sequelize[_0x7ae0('0x2')]},'description':{'type':Sequelize[_0x7ae0('0x2')]},'authToken':{'type':Sequelize[_0x7ae0('0x2')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x7ae0('0x2')]}}; \ No newline at end of file +var _0xfbd4=['sequelize','exports','STRING'];(function(_0x188eb5,_0x3d7c66){var _0x3768ea=function(_0xcf07b0){while(--_0xcf07b0){_0x188eb5['push'](_0x188eb5['shift']());}};_0x3768ea(++_0x3d7c66);}(_0xfbd4,0x120));var _0x4fbd=function(_0x5da8bf,_0x426fc3){_0x5da8bf=_0x5da8bf-0x0;var _0x535682=_0xfbd4[_0x5da8bf];return _0x535682;};'use strict';var Sequelize=require(_0x4fbd('0x0'));module[_0x4fbd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x4fbd('0x2')]},'host':{'type':Sequelize[_0x4fbd('0x2')]},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3020788..4ca3cdf 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 _0xc95e=['papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','then','end','stack','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','ZohoAccount','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','destroy','ZohoConfiguration','filters','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','getFields','findOne','host','authToken','slice','substring','format','crmapi','response','Calls','section','Call\x20Purpose','includes','customfield','true','Pick\x20List','val','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x52540f,_0x3365a6){var _0x34a565=function(_0x2ef804){while(--_0x2ef804){_0x52540f['push'](_0x52540f['shift']());}};_0x34a565(++_0x3365a6);}(_0xc95e,0x14d));var _0xec95=function(_0x51353e,_0x2cc903){_0x51353e=_0x51353e-0x0;var _0x3b5f4e=_0xc95e[_0x51353e];return _0x3b5f4e;};'use strict';var pdf=require(_0xec95('0x0'));var emlformat=require(_0xec95('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xec95('0x2'));var jsonpatch=require(_0xec95('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xec95('0x4'));var util=require('util');var path=require(_0xec95('0x5'));var sox=require('sox');var csv=require(_0xec95('0x6'));var ejs=require(_0xec95('0x7'));var fs=require('fs');var _=require(_0xec95('0x8'));var squel=require(_0xec95('0x9'));var crypto=require('crypto');var jsforce=require(_0xec95('0xa'));var deskjs=require(_0xec95('0xb'));var toCsv=require(_0xec95('0x6'));var querystring=require('querystring');var Papa=require(_0xec95('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0xec95('0xd'));var Redis=require(_0xec95('0xe'));var qs=require(_0xec95('0xf'));var logger=require(_0xec95('0x10'))('api');var utils=require(_0xec95('0x11'));var config=require(_0xec95('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0xec95('0x13'));var jayson=require(_0xec95('0x14'));var client=jayson[_0xec95('0x15')][_0xec95('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x121c5b,_0x5ed48b,_0x209aa9,_0x46a6a2){return new BPromise(function(_0x2b80fe,_0x1d5b6c){var _0x3df470=_0x46a6a2||client;return _0x3df470[_0xec95('0x17')](_0x121c5b,_0x209aa9)['then'](function(_0x1fc690){logger[_0xec95('0x18')]('ZohoAccount,\x20%s,\x20%s',_0x5ed48b,'request\x20sent');logger[_0xec95('0x19')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5ed48b,_0xec95('0x1a'),JSON[_0xec95('0x1b')](_0x1fc690));if(_0x1fc690[_0xec95('0x1c')]){if(_0x1fc690[_0xec95('0x1c')][_0xec95('0x1d')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x5ed48b,_0x1fc690[_0xec95('0x1c')][_0xec95('0x1e')]);return _0x1d5b6c(_0x1fc690[_0xec95('0x1c')][_0xec95('0x1e')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x5ed48b,_0x1fc690[_0xec95('0x1c')][_0xec95('0x1e')]);return _0x2b80fe(_0x1fc690['error']['message']);}else{logger[_0xec95('0x18')](_0xec95('0x1f'),_0x5ed48b,_0xec95('0x1a'));_0x2b80fe(_0x1fc690[_0xec95('0x20')][_0xec95('0x1e')]);}})['catch'](function(_0x328ae6){logger[_0xec95('0x1c')](_0xec95('0x1f'),_0x5ed48b,_0x328ae6);_0x1d5b6c(_0x328ae6);});});}function respondWithStatusCode(_0x4fdfd2,_0x7a1029){_0x7a1029=_0x7a1029||0xcc;return function(_0xfda1b4){if(_0xfda1b4){return _0x4fdfd2[_0xec95('0x21')](_0x7a1029);}return _0x4fdfd2[_0xec95('0x22')](_0x7a1029)['end']();};}function respondWithResult(_0x9065fd,_0x5478f7){_0x5478f7=_0x5478f7||0xc8;return function(_0x548be2){if(_0x548be2){return _0x9065fd[_0xec95('0x22')](_0x5478f7)[_0xec95('0x23')](_0x548be2);}};}function respondWithFilteredResult(_0x3381a1,_0x41a7bb){return function(_0x15c570){if(_0x15c570){var _0x381e34=_0x15c570[_0xec95('0x24')],_0x297f4e=_0x41a7bb['offset'],_0x446d9d=_0x41a7bb['offset']+_0x41a7bb[_0xec95('0x25')],_0x2a5b14;if(_0x446d9d>=_0x381e34){_0x446d9d=_0x381e34;_0x2a5b14=0xc8;}else{_0x2a5b14=0xce;}_0x3381a1[_0xec95('0x22')](_0x2a5b14);return _0x3381a1[_0xec95('0x26')](_0xec95('0x27'),_0x297f4e+'-'+_0x446d9d+'/'+_0x381e34)[_0xec95('0x23')](_0x15c570);}return null;};}function patchUpdates(_0x5dca01){return function(_0x3b7b7d){try{jsonpatch[_0xec95('0x28')](_0x3b7b7d,_0x5dca01,!![]);}catch(_0x17c909){return BPromise[_0xec95('0x29')](_0x17c909);}return _0x3b7b7d[_0xec95('0x2a')]();};}function saveUpdates(_0x1465f1,_0x57670d){return function(_0xf869c7){if(_0xf869c7){return _0xf869c7['update'](_0x1465f1)[_0xec95('0x2b')](function(_0x4ca7d5){return _0x4ca7d5;});}return null;};}function removeEntity(_0x4408cb,_0x526b2b){return function(_0x3fdaca){if(_0x3fdaca){return _0x3fdaca['destroy']()[_0xec95('0x2b')](function(){_0x4408cb['status'](0xcc)[_0xec95('0x2c')]();});}};}function handleEntityNotFound(_0x19cda5,_0x5bfea5){return function(_0x35b91b){if(!_0x35b91b){_0x19cda5[_0xec95('0x21')](0x194);}return _0x35b91b;};}function handleError(_0x19895c,_0x308dec){_0x308dec=_0x308dec||0x1f4;return function(_0x463cc5){logger[_0xec95('0x1c')](_0x463cc5[_0xec95('0x2d')]);if(_0x463cc5[_0xec95('0x2e')]){delete _0x463cc5['name'];}_0x19895c[_0xec95('0x22')](_0x308dec)[_0xec95('0x2f')](_0x463cc5);};}exports['index']=function(_0xe574d,_0x4498b5){var _0x480f62={},_0x175518={},_0x12e35e={'count':0x0,'rows':[]};var _0xc9681b=db['ZohoAccount'][_0xec95('0x30')];_0x175518[_0xec95('0x31')]=_[_0xec95('0x32')](_0xc9681b);_0x175518[_0xec95('0x33')]=_[_0xec95('0x32')](_0xe574d['query']);_0x175518['filters']=_[_0xec95('0x34')](_0x175518[_0xec95('0x31')],_0x175518[_0xec95('0x33')]);_0x480f62[_0xec95('0x35')]=_[_0xec95('0x34')](_0x175518[_0xec95('0x31')],qs[_0xec95('0x36')](_0xe574d[_0xec95('0x33')]['fields']));_0x480f62[_0xec95('0x35')]=_0x480f62[_0xec95('0x35')][_0xec95('0x37')]?_0x480f62[_0xec95('0x35')]:_0x175518[_0xec95('0x31')];if(!_0xe574d[_0xec95('0x33')][_0xec95('0x38')]('nolimit')){_0x480f62[_0xec95('0x25')]=qs[_0xec95('0x25')](_0xe574d[_0xec95('0x33')][_0xec95('0x25')]);_0x480f62[_0xec95('0x39')]=qs[_0xec95('0x39')](_0xe574d['query'][_0xec95('0x39')]);}_0x480f62[_0xec95('0x3a')]=qs[_0xec95('0x3b')](_0xe574d['query']['sort']);_0x480f62[_0xec95('0x3c')]=qs['filters'](_[_0xec95('0x3d')](_0xe574d[_0xec95('0x33')],_0x175518['filters']));if(_0xe574d['query'][_0xec95('0x3e')]){_0x480f62[_0xec95('0x3c')]=_[_0xec95('0x3f')](_0x480f62['where'],{'$or':_[_0xec95('0x40')](_0xc9681b,function(_0x539c63){if(_0x539c63[_0xec95('0x41')][_0xec95('0x42')]!==_0xec95('0x43')){var _0x16a005={};_0x16a005[_0x539c63[_0xec95('0x44')]]={'$like':'%'+_0xe574d[_0xec95('0x33')][_0xec95('0x3e')]+'%'};return _0x16a005;}})});}_0x480f62=_['merge']({},_0x480f62,_0xe574d[_0xec95('0x45')]);var _0x224a75={'where':_0x480f62[_0xec95('0x3c')]};return db[_0xec95('0x46')][_0xec95('0x24')](_0x224a75)[_0xec95('0x2b')](function(_0x4ccffc){_0x12e35e[_0xec95('0x24')]=_0x4ccffc;if(_0xe574d['query']['includeAll']){_0x480f62[_0xec95('0x47')]=[{'all':!![]}];}return db['ZohoAccount'][_0xec95('0x48')](_0x480f62);})[_0xec95('0x2b')](function(_0x593c4a){_0x12e35e[_0xec95('0x49')]=_0x593c4a;return _0x12e35e;})['then'](respondWithFilteredResult(_0x4498b5,_0x480f62))[_0xec95('0x4a')](handleError(_0x4498b5,null));};exports[_0xec95('0x4b')]=function(_0xf3310f,_0x347eec){var _0x4a051d={'raw':![],'where':{'id':_0xf3310f['params']['id']}},_0xdb8840={};_0xdb8840['model']=_[_0xec95('0x32')](db[_0xec95('0x46')][_0xec95('0x30')]);_0xdb8840['query']=_['keys'](_0xf3310f[_0xec95('0x33')]);_0xdb8840['filters']=_[_0xec95('0x34')](_0xdb8840['model'],_0xdb8840[_0xec95('0x33')]);_0x4a051d[_0xec95('0x35')]=_[_0xec95('0x34')](_0xdb8840[_0xec95('0x31')],qs[_0xec95('0x36')](_0xf3310f[_0xec95('0x33')][_0xec95('0x36')]));_0x4a051d['attributes']=_0x4a051d[_0xec95('0x35')][_0xec95('0x37')]?_0x4a051d[_0xec95('0x35')]:_0xdb8840[_0xec95('0x31')];if(_0xf3310f[_0xec95('0x33')][_0xec95('0x4c')]){_0x4a051d[_0xec95('0x47')]=[{'all':!![]}];}_0x4a051d=_[_0xec95('0x3f')]({},_0x4a051d,_0xf3310f[_0xec95('0x45')]);return db[_0xec95('0x46')][_0xec95('0x4d')](_0x4a051d)[_0xec95('0x2b')](handleEntityNotFound(_0x347eec,null))['then'](respondWithResult(_0x347eec,null))[_0xec95('0x4a')](handleError(_0x347eec,null));};exports[_0xec95('0x4e')]=function(_0x1f0916,_0x4519a7){return db[_0xec95('0x46')][_0xec95('0x4e')](_0x1f0916['body'],{})[_0xec95('0x2b')](respondWithResult(_0x4519a7,0xc9))['catch'](handleError(_0x4519a7,null));};exports[_0xec95('0x4f')]=function(_0x2a4007,_0x5105d7){if(_0x2a4007[_0xec95('0x50')]['id']){delete _0x2a4007[_0xec95('0x50')]['id'];}return db[_0xec95('0x46')][_0xec95('0x4d')]({'where':{'id':_0x2a4007[_0xec95('0x51')]['id']}})['then'](handleEntityNotFound(_0x5105d7,null))[_0xec95('0x2b')](saveUpdates(_0x2a4007[_0xec95('0x50')],null))[_0xec95('0x2b')](respondWithResult(_0x5105d7,null))[_0xec95('0x4a')](handleError(_0x5105d7,null));};exports[_0xec95('0x52')]=function(_0x338b93,_0x2c5b4b){return db[_0xec95('0x46')][_0xec95('0x4d')]({'where':{'id':_0x338b93[_0xec95('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c5b4b,null))[_0xec95('0x2b')](removeEntity(_0x2c5b4b,null))[_0xec95('0x4a')](handleError(_0x2c5b4b,null));};exports['getConfigurations']=function(_0x5590a3,_0x14e9d8,_0x5e137b){var _0x5ea086={};var _0x2a6ebd={};var _0x35b25d;var _0x3d4089;return db[_0xec95('0x46')]['findOne']({'where':{'id':_0x5590a3['params']['id']}})[_0xec95('0x2b')](handleEntityNotFound(_0x14e9d8,null))[_0xec95('0x2b')](function(_0x2e7f00){if(_0x2e7f00){_0x35b25d=_0x2e7f00;_0x2a6ebd[_0xec95('0x31')]=_[_0xec95('0x32')](db[_0xec95('0x53')][_0xec95('0x30')]);_0x2a6ebd[_0xec95('0x33')]=_[_0xec95('0x32')](_0x5590a3[_0xec95('0x33')]);_0x2a6ebd[_0xec95('0x54')]=_['intersection'](_0x2a6ebd['model'],_0x2a6ebd[_0xec95('0x33')]);_0x5ea086[_0xec95('0x35')]=_['intersection'](_0x2a6ebd['model'],qs['fields'](_0x5590a3[_0xec95('0x33')][_0xec95('0x36')]));_0x5ea086[_0xec95('0x35')]=_0x5ea086['attributes']['length']?_0x5ea086[_0xec95('0x35')]:_0x2a6ebd[_0xec95('0x31')];_0x5ea086[_0xec95('0x3a')]=qs[_0xec95('0x3b')](_0x5590a3[_0xec95('0x33')][_0xec95('0x3b')]);_0x5ea086[_0xec95('0x3c')]=qs[_0xec95('0x54')](_[_0xec95('0x3d')](_0x5590a3[_0xec95('0x33')],_0x2a6ebd[_0xec95('0x54')]));if(_0x5590a3[_0xec95('0x33')][_0xec95('0x3e')]){_0x5ea086[_0xec95('0x3c')]=_[_0xec95('0x3f')](_0x5ea086[_0xec95('0x3c')],{'$or':_[_0xec95('0x40')](_0x5ea086[_0xec95('0x35')],function(_0x20954b){var _0x25b44c={};_0x25b44c[_0x20954b]={'$like':'%'+_0x5590a3[_0xec95('0x33')]['filter']+'%'};return _0x25b44c;})});}_0x5ea086=_[_0xec95('0x3f')]({},_0x5ea086,_0x5590a3[_0xec95('0x45')]);return _0x35b25d['getConfigurations'](_0x5ea086);}})[_0xec95('0x2b')](function(_0x2995b3){if(_0x2995b3){_0x3d4089=_0x2995b3[_0xec95('0x37')];if(!_0x5590a3[_0xec95('0x33')][_0xec95('0x38')](_0xec95('0x55'))){_0x5ea086[_0xec95('0x25')]=qs['limit'](_0x5590a3[_0xec95('0x33')][_0xec95('0x25')]);_0x5ea086['offset']=qs['offset'](_0x5590a3['query']['offset']);}return _0x35b25d[_0xec95('0x56')](_0x5ea086);}})[_0xec95('0x2b')](function(_0x13dd9a){if(_0x13dd9a){return _0x13dd9a?{'count':_0x3d4089,'rows':_0x13dd9a}:null;}})['then'](respondWithResult(_0x14e9d8,null))['catch'](handleError(_0x14e9d8,null));};exports[_0xec95('0x57')]=function(_0x2ac1ec,_0x371373,_0x2eb060){if(_0x2ac1ec[_0xec95('0x50')]['id']){delete _0x2ac1ec[_0xec95('0x50')]['id'];}return db[_0xec95('0x46')]['findOne']({'where':{'id':_0x2ac1ec[_0xec95('0x51')]['id']}})[_0xec95('0x2b')](handleEntityNotFound(_0x371373,null))['then'](function(_0x63b4ee){if(_0x63b4ee){_0x2ac1ec[_0xec95('0x50')][_0xec95('0x58')]=_0x63b4ee['id'];_0x2ac1ec[_0xec95('0x50')][_0xec95('0x59')]=integrations['getSubjects'](_0x2ac1ec[_0xec95('0x50')]['channel'],_0x2ac1ec[_0xec95('0x50')][_0xec95('0x41')]);_0x2ac1ec[_0xec95('0x50')][_0xec95('0x5a')]=integrations[_0xec95('0x5b')](_0x2ac1ec[_0xec95('0x50')][_0xec95('0x5c')],_0x2ac1ec[_0xec95('0x50')]['type']);return db['ZohoConfiguration']['create'](_0x2ac1ec['body'],{'include':[{'model':db[_0xec95('0x5d')],'as':_0xec95('0x59')},{'model':db[_0xec95('0x5d')],'as':_0xec95('0x5a')}]});}return null;})['then'](respondWithResult(_0x371373,null))[_0xec95('0x4a')](handleError(_0x371373,null));};exports[_0xec95('0x5e')]=function(_0x4cea11,_0x17a620,_0x5d74fc){var _0x1f9697='';return db[_0xec95('0x46')][_0xec95('0x5f')]({'where':{'id':_0x4cea11[_0xec95('0x51')]['id']},'attributes':['id',_0xec95('0x60'),_0xec95('0x61')]})[_0xec95('0x2b')](handleEntityNotFound(_0x17a620,null))['then'](function(_0x596aeb){if(_0x596aeb){_0x1f9697=_0x596aeb['host'];var _0x1d2643=_0x1f9697[_0xec95('0x62')](-0x1);if(_0x1d2643==='/'){_0x1f9697=_0x1f9697[_0xec95('0x63')](0x0,_0x1f9697['lastIndexOf'](_0x1d2643));}return rp({'method':'GET','uri':util[_0xec95('0x64')]('https://crm.%s/crm/private/json/Calls/getFields',_0x1f9697),'qs':{'authtoken':_0x596aeb['authToken'],'scope':_0xec95('0x65')},'json':!![]});}})[_0xec95('0x2b')](function(_0x58bed6){if(_0x58bed6){if(_0x58bed6[_0xec95('0x66')]&&_0x58bed6[_0xec95('0x66')][_0xec95('0x1c')]){throw new Error(_0x58bed6[_0xec95('0x66')][_0xec95('0x1c')][_0xec95('0x1e')]);}var _0x56825e=[];if(_0x58bed6[_0xec95('0x67')]&&_0x58bed6[_0xec95('0x67')]['section']){if(_0x58bed6['Calls'][_0xec95('0x68')]['FL']){var _0x4fca94=[_0xec95('0x69')];for(var _0x1f5e6b=0x0,_0x39140f=_0x58bed6[_0xec95('0x67')][_0xec95('0x68')]['FL'][_0xec95('0x37')];_0x1f5e6b<_0x39140f;_0x1f5e6b++){if(_[_0xec95('0x6a')](_0x4fca94,_0x58bed6[_0xec95('0x67')][_0xec95('0x68')]['FL'][_0x1f5e6b]['dv'])){_0x56825e['push']({'id':_0x58bed6[_0xec95('0x67')][_0xec95('0x68')]['FL'][_0x1f5e6b]['dv'],'name':_0x58bed6[_0xec95('0x67')][_0xec95('0x68')]['FL'][_0x1f5e6b]['label'],'custom':_0x58bed6[_0xec95('0x67')]['section']['FL'][_0x1f5e6b][_0xec95('0x6b')]===_0xec95('0x6c')?!![]:![],'options':_0x58bed6[_0xec95('0x67')][_0xec95('0x68')]['FL'][_0x1f5e6b][_0xec95('0x41')]===_0xec95('0x6d')&&_0x58bed6[_0xec95('0x67')][_0xec95('0x68')]['FL'][_0x1f5e6b][_0xec95('0x6e')]?_[_0xec95('0x40')](_0x58bed6[_0xec95('0x67')][_0xec95('0x68')]['FL'][_0x1f5e6b][_0xec95('0x6e')],function(_0x1c9f03){return{'name':_0x1c9f03,'value':_0x1c9f03};}):[]});}}}}return{'count':_0x56825e[_0xec95('0x37')],'rows':_0x56825e};}})[_0xec95('0x2b')](respondWithResult(_0x17a620,null))[_0xec95('0x4a')](function(_0x1952b7){var _0x2897cc=_0x4cea11['query'][_0xec95('0x6f')]?0x1f4:_0x1952b7['statusCode']||0x1f4;logger[_0xec95('0x1c')](_0xec95('0x70'),_0xec95('0x5e'),_0x2897cc,JSON['stringify'](_0x1952b7));delete _0x1952b7[_0xec95('0x2e')];if(_0x2897cc===0x191){_0x2897cc=0x190;}_0x17a620['status'](_0x2897cc)['send'](_0x4cea11[_0xec95('0x33')][_0xec95('0x6f')]?{'message':_0xec95('0x71'),'statusCode':_0x1952b7[_0xec95('0x72')]}:_0x1952b7);});}; \ No newline at end of file +var _0xd846=['apply','reject','save','update','end','stack','send','index','ZohoAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','catch','params','create','body','find','destroy','getConfigurations','findOne','ZohoConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','getFields','host','authToken','slice','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','Call\x20Purpose','label','customfield','Pick\x20List','val','statusCode','name','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/environment','../../mysqldb','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','sendStatus','status','count','offset','Content-Range','json'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0xd846,0x195));var _0x6d84=function(_0x5dc63a,_0x149321){_0x5dc63a=_0x5dc63a-0x0;var _0x446b5c=_0xd846[_0x5dc63a];return _0x446b5c;};'use strict';var pdf=require(_0x6d84('0x0'));var emlformat=require(_0x6d84('0x1'));var rimraf=require(_0x6d84('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6d84('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d84('0x4'));var util=require(_0x6d84('0x5'));var path=require('path');var sox=require(_0x6d84('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6d84('0x7'));var squel=require(_0x6d84('0x8'));var crypto=require(_0x6d84('0x9'));var jsforce=require(_0x6d84('0xa'));var deskjs=require(_0x6d84('0xb'));var toCsv=require(_0x6d84('0xc'));var querystring=require(_0x6d84('0xd'));var Papa=require(_0x6d84('0xe'));var authService=require(_0x6d84('0xf'));var hardwareService=require(_0x6d84('0x10'));var Redis=require(_0x6d84('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x6d84('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6d84('0x13'));var db=require(_0x6d84('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x6d84('0x15')][_0x6d84('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x1b772e,_0x23253b,_0x18aaa4,_0x44a860){return new BPromise(function(_0x492a0b,_0x1b4d95){var _0x1d66dd=_0x44a860||client;return _0x1d66dd[_0x6d84('0x17')](_0x1b772e,_0x18aaa4)[_0x6d84('0x18')](function(_0xfd8617){logger[_0x6d84('0x19')]('ZohoAccount,\x20%s,\x20%s',_0x23253b,_0x6d84('0x1a'));logger[_0x6d84('0x1b')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x23253b,_0x6d84('0x1a'),JSON[_0x6d84('0x1c')](_0xfd8617));if(_0xfd8617[_0x6d84('0x1d')]){if(_0xfd8617[_0x6d84('0x1d')][_0x6d84('0x1e')]===0x1f4){logger[_0x6d84('0x1d')](_0x6d84('0x1f'),_0x23253b,_0xfd8617['error']['message']);return _0x1b4d95(_0xfd8617['error']['message']);}logger[_0x6d84('0x1d')](_0x6d84('0x1f'),_0x23253b,_0xfd8617[_0x6d84('0x1d')][_0x6d84('0x20')]);return _0x492a0b(_0xfd8617[_0x6d84('0x1d')][_0x6d84('0x20')]);}else{logger[_0x6d84('0x19')]('ZohoAccount,\x20%s,\x20%s',_0x23253b,_0x6d84('0x1a'));_0x492a0b(_0xfd8617['result'][_0x6d84('0x20')]);}})['catch'](function(_0x3d846f){logger[_0x6d84('0x1d')](_0x6d84('0x1f'),_0x23253b,_0x3d846f);_0x1b4d95(_0x3d846f);});});}function respondWithStatusCode(_0x369c54,_0x13ecf2){_0x13ecf2=_0x13ecf2||0xcc;return function(_0x464b88){if(_0x464b88){return _0x369c54[_0x6d84('0x21')](_0x13ecf2);}return _0x369c54[_0x6d84('0x22')](_0x13ecf2)['end']();};}function respondWithResult(_0x117369,_0x19a7ab){_0x19a7ab=_0x19a7ab||0xc8;return function(_0x1add21){if(_0x1add21){return _0x117369[_0x6d84('0x22')](_0x19a7ab)['json'](_0x1add21);}};}function respondWithFilteredResult(_0x501b3c,_0x2e7983){return function(_0x450014){if(_0x450014){var _0x1a1dcd=_0x450014[_0x6d84('0x23')],_0x4b4a01=_0x2e7983[_0x6d84('0x24')],_0x1bfc9c=_0x2e7983[_0x6d84('0x24')]+_0x2e7983['limit'],_0x11a472;if(_0x1bfc9c>=_0x1a1dcd){_0x1bfc9c=_0x1a1dcd;_0x11a472=0xc8;}else{_0x11a472=0xce;}_0x501b3c[_0x6d84('0x22')](_0x11a472);return _0x501b3c['set'](_0x6d84('0x25'),_0x4b4a01+'-'+_0x1bfc9c+'/'+_0x1a1dcd)[_0x6d84('0x26')](_0x450014);}return null;};}function patchUpdates(_0x214516){return function(_0x3113e3){try{jsonpatch[_0x6d84('0x27')](_0x3113e3,_0x214516,!![]);}catch(_0x497830){return BPromise[_0x6d84('0x28')](_0x497830);}return _0x3113e3[_0x6d84('0x29')]();};}function saveUpdates(_0x3cfd50,_0x1be2d6){return function(_0xabe911){if(_0xabe911){return _0xabe911[_0x6d84('0x2a')](_0x3cfd50)['then'](function(_0x1e0ba8){return _0x1e0ba8;});}return null;};}function removeEntity(_0x40b150,_0x4159b6){return function(_0x9009a9){if(_0x9009a9){return _0x9009a9['destroy']()[_0x6d84('0x18')](function(){_0x40b150[_0x6d84('0x22')](0xcc)[_0x6d84('0x2b')]();});}};}function handleEntityNotFound(_0x487687,_0x19eab1){return function(_0x5c6ac7){if(!_0x5c6ac7){_0x487687[_0x6d84('0x21')](0x194);}return _0x5c6ac7;};}function handleError(_0x19cf97,_0x248e4d){_0x248e4d=_0x248e4d||0x1f4;return function(_0x5f1c47){logger[_0x6d84('0x1d')](_0x5f1c47[_0x6d84('0x2c')]);if(_0x5f1c47['name']){delete _0x5f1c47['name'];}_0x19cf97[_0x6d84('0x22')](_0x248e4d)[_0x6d84('0x2d')](_0x5f1c47);};}exports[_0x6d84('0x2e')]=function(_0x30d50c,_0x51e20b){var _0x3bf2e3={},_0x5411f1={},_0x252efa={'count':0x0,'rows':[]};var _0x471b24=db[_0x6d84('0x2f')][_0x6d84('0x30')];_0x5411f1[_0x6d84('0x31')]=_[_0x6d84('0x32')](_0x471b24);_0x5411f1['query']=_[_0x6d84('0x32')](_0x30d50c[_0x6d84('0x33')]);_0x5411f1[_0x6d84('0x34')]=_[_0x6d84('0x35')](_0x5411f1[_0x6d84('0x31')],_0x5411f1[_0x6d84('0x33')]);_0x3bf2e3['attributes']=_[_0x6d84('0x35')](_0x5411f1[_0x6d84('0x31')],qs[_0x6d84('0x36')](_0x30d50c[_0x6d84('0x33')][_0x6d84('0x36')]));_0x3bf2e3[_0x6d84('0x37')]=_0x3bf2e3[_0x6d84('0x37')][_0x6d84('0x38')]?_0x3bf2e3[_0x6d84('0x37')]:_0x5411f1[_0x6d84('0x31')];if(!_0x30d50c[_0x6d84('0x33')][_0x6d84('0x39')](_0x6d84('0x3a'))){_0x3bf2e3[_0x6d84('0x3b')]=qs[_0x6d84('0x3b')](_0x30d50c[_0x6d84('0x33')][_0x6d84('0x3b')]);_0x3bf2e3[_0x6d84('0x24')]=qs[_0x6d84('0x24')](_0x30d50c[_0x6d84('0x33')][_0x6d84('0x24')]);}_0x3bf2e3[_0x6d84('0x3c')]=qs['sort'](_0x30d50c[_0x6d84('0x33')][_0x6d84('0x3d')]);_0x3bf2e3[_0x6d84('0x3e')]=qs['filters'](_[_0x6d84('0x3f')](_0x30d50c[_0x6d84('0x33')],_0x5411f1[_0x6d84('0x34')]));if(_0x30d50c['query'][_0x6d84('0x40')]){_0x3bf2e3[_0x6d84('0x3e')]=_[_0x6d84('0x41')](_0x3bf2e3[_0x6d84('0x3e')],{'$or':_[_0x6d84('0x42')](_0x471b24,function(_0x5fc09b){if(_0x5fc09b[_0x6d84('0x43')][_0x6d84('0x44')]!==_0x6d84('0x45')){var _0x193572={};_0x193572[_0x5fc09b[_0x6d84('0x46')]]={'$like':'%'+_0x30d50c[_0x6d84('0x33')][_0x6d84('0x40')]+'%'};return _0x193572;}})});}_0x3bf2e3=_[_0x6d84('0x41')]({},_0x3bf2e3,_0x30d50c[_0x6d84('0x47')]);var _0x26abf3={'where':_0x3bf2e3[_0x6d84('0x3e')]};return db[_0x6d84('0x2f')][_0x6d84('0x23')](_0x26abf3)[_0x6d84('0x18')](function(_0x111904){_0x252efa[_0x6d84('0x23')]=_0x111904;if(_0x30d50c[_0x6d84('0x33')][_0x6d84('0x48')]){_0x3bf2e3[_0x6d84('0x49')]=[{'all':!![]}];}return db[_0x6d84('0x2f')]['findAll'](_0x3bf2e3);})[_0x6d84('0x18')](function(_0x5676fb){_0x252efa['rows']=_0x5676fb;return _0x252efa;})[_0x6d84('0x18')](respondWithFilteredResult(_0x51e20b,_0x3bf2e3))[_0x6d84('0x4a')](handleError(_0x51e20b,null));};exports['show']=function(_0x3db3c7,_0x2ecd66){var _0xc0b057={'raw':![],'where':{'id':_0x3db3c7[_0x6d84('0x4b')]['id']}},_0x5dc607={};_0x5dc607[_0x6d84('0x31')]=_['keys'](db[_0x6d84('0x2f')]['rawAttributes']);_0x5dc607[_0x6d84('0x33')]=_[_0x6d84('0x32')](_0x3db3c7[_0x6d84('0x33')]);_0x5dc607[_0x6d84('0x34')]=_[_0x6d84('0x35')](_0x5dc607['model'],_0x5dc607['query']);_0xc0b057['attributes']=_[_0x6d84('0x35')](_0x5dc607[_0x6d84('0x31')],qs[_0x6d84('0x36')](_0x3db3c7[_0x6d84('0x33')][_0x6d84('0x36')]));_0xc0b057[_0x6d84('0x37')]=_0xc0b057[_0x6d84('0x37')][_0x6d84('0x38')]?_0xc0b057['attributes']:_0x5dc607['model'];if(_0x3db3c7[_0x6d84('0x33')]['includeAll']){_0xc0b057[_0x6d84('0x49')]=[{'all':!![]}];}_0xc0b057=_['merge']({},_0xc0b057,_0x3db3c7['options']);return db['ZohoAccount']['find'](_0xc0b057)[_0x6d84('0x18')](handleEntityNotFound(_0x2ecd66,null))['then'](respondWithResult(_0x2ecd66,null))[_0x6d84('0x4a')](handleError(_0x2ecd66,null));};exports[_0x6d84('0x4c')]=function(_0x9e16ae,_0x4eb695){return db[_0x6d84('0x2f')]['create'](_0x9e16ae[_0x6d84('0x4d')],{})[_0x6d84('0x18')](respondWithResult(_0x4eb695,0xc9))['catch'](handleError(_0x4eb695,null));};exports[_0x6d84('0x2a')]=function(_0x4eec12,_0x58a0ab){if(_0x4eec12[_0x6d84('0x4d')]['id']){delete _0x4eec12[_0x6d84('0x4d')]['id'];}return db[_0x6d84('0x2f')][_0x6d84('0x4e')]({'where':{'id':_0x4eec12[_0x6d84('0x4b')]['id']}})[_0x6d84('0x18')](handleEntityNotFound(_0x58a0ab,null))[_0x6d84('0x18')](saveUpdates(_0x4eec12['body'],null))[_0x6d84('0x18')](respondWithResult(_0x58a0ab,null))[_0x6d84('0x4a')](handleError(_0x58a0ab,null));};exports[_0x6d84('0x4f')]=function(_0x2bfc4a,_0x2522da){return db[_0x6d84('0x2f')]['find']({'where':{'id':_0x2bfc4a[_0x6d84('0x4b')]['id']}})[_0x6d84('0x18')](handleEntityNotFound(_0x2522da,null))[_0x6d84('0x18')](removeEntity(_0x2522da,null))[_0x6d84('0x4a')](handleError(_0x2522da,null));};exports[_0x6d84('0x50')]=function(_0x4b44ba,_0x593f86,_0xdb5bf5){var _0xc9cac5={};var _0x103f49={};var _0x563689;var _0x5a4dd9;return db['ZohoAccount'][_0x6d84('0x51')]({'where':{'id':_0x4b44ba[_0x6d84('0x4b')]['id']}})[_0x6d84('0x18')](handleEntityNotFound(_0x593f86,null))['then'](function(_0x4c976e){if(_0x4c976e){_0x563689=_0x4c976e;_0x103f49[_0x6d84('0x31')]=_[_0x6d84('0x32')](db[_0x6d84('0x52')][_0x6d84('0x30')]);_0x103f49['query']=_[_0x6d84('0x32')](_0x4b44ba['query']);_0x103f49[_0x6d84('0x34')]=_['intersection'](_0x103f49[_0x6d84('0x31')],_0x103f49[_0x6d84('0x33')]);_0xc9cac5[_0x6d84('0x37')]=_[_0x6d84('0x35')](_0x103f49['model'],qs[_0x6d84('0x36')](_0x4b44ba[_0x6d84('0x33')][_0x6d84('0x36')]));_0xc9cac5[_0x6d84('0x37')]=_0xc9cac5[_0x6d84('0x37')][_0x6d84('0x38')]?_0xc9cac5[_0x6d84('0x37')]:_0x103f49[_0x6d84('0x31')];_0xc9cac5[_0x6d84('0x3c')]=qs['sort'](_0x4b44ba[_0x6d84('0x33')][_0x6d84('0x3d')]);_0xc9cac5[_0x6d84('0x3e')]=qs['filters'](_[_0x6d84('0x3f')](_0x4b44ba['query'],_0x103f49['filters']));if(_0x4b44ba[_0x6d84('0x33')][_0x6d84('0x40')]){_0xc9cac5['where']=_['merge'](_0xc9cac5['where'],{'$or':_[_0x6d84('0x42')](_0xc9cac5[_0x6d84('0x37')],function(_0x34b6c9){var _0x2d68c3={};_0x2d68c3[_0x34b6c9]={'$like':'%'+_0x4b44ba[_0x6d84('0x33')][_0x6d84('0x40')]+'%'};return _0x2d68c3;})});}_0xc9cac5=_[_0x6d84('0x41')]({},_0xc9cac5,_0x4b44ba[_0x6d84('0x47')]);return _0x563689[_0x6d84('0x50')](_0xc9cac5);}})[_0x6d84('0x18')](function(_0x22f77d){if(_0x22f77d){_0x5a4dd9=_0x22f77d['length'];if(!_0x4b44ba[_0x6d84('0x33')][_0x6d84('0x39')](_0x6d84('0x3a'))){_0xc9cac5[_0x6d84('0x3b')]=qs[_0x6d84('0x3b')](_0x4b44ba[_0x6d84('0x33')]['limit']);_0xc9cac5[_0x6d84('0x24')]=qs[_0x6d84('0x24')](_0x4b44ba[_0x6d84('0x33')][_0x6d84('0x24')]);}return _0x563689[_0x6d84('0x50')](_0xc9cac5);}})[_0x6d84('0x18')](function(_0x114bc2){if(_0x114bc2){return _0x114bc2?{'count':_0x5a4dd9,'rows':_0x114bc2}:null;}})[_0x6d84('0x18')](respondWithResult(_0x593f86,null))[_0x6d84('0x4a')](handleError(_0x593f86,null));};exports[_0x6d84('0x53')]=function(_0x1aa22f,_0x5c55c6,_0x325eb0){if(_0x1aa22f[_0x6d84('0x4d')]['id']){delete _0x1aa22f[_0x6d84('0x4d')]['id'];}return db[_0x6d84('0x2f')]['findOne']({'where':{'id':_0x1aa22f['params']['id']}})[_0x6d84('0x18')](handleEntityNotFound(_0x5c55c6,null))['then'](function(_0x2352c9){if(_0x2352c9){_0x1aa22f[_0x6d84('0x4d')]['AccountId']=_0x2352c9['id'];_0x1aa22f[_0x6d84('0x4d')]['Subjects']=integrations[_0x6d84('0x54')](_0x1aa22f[_0x6d84('0x4d')][_0x6d84('0x55')],_0x1aa22f[_0x6d84('0x4d')][_0x6d84('0x43')]);_0x1aa22f[_0x6d84('0x4d')][_0x6d84('0x56')]=integrations[_0x6d84('0x57')](_0x1aa22f[_0x6d84('0x4d')][_0x6d84('0x55')],_0x1aa22f[_0x6d84('0x4d')]['type']);return db['ZohoConfiguration'][_0x6d84('0x4c')](_0x1aa22f['body'],{'include':[{'model':db[_0x6d84('0x58')],'as':_0x6d84('0x59')},{'model':db[_0x6d84('0x58')],'as':_0x6d84('0x56')}]});}return null;})['then'](respondWithResult(_0x5c55c6,null))[_0x6d84('0x4a')](handleError(_0x5c55c6,null));};exports[_0x6d84('0x5a')]=function(_0xd89b55,_0x470899,_0x351cdc){var _0x1da6e2='';return db['ZohoAccount'][_0x6d84('0x51')]({'where':{'id':_0xd89b55[_0x6d84('0x4b')]['id']},'attributes':['id',_0x6d84('0x5b'),_0x6d84('0x5c')]})[_0x6d84('0x18')](handleEntityNotFound(_0x470899,null))[_0x6d84('0x18')](function(_0x5e866f){if(_0x5e866f){_0x1da6e2=_0x5e866f[_0x6d84('0x5b')];var _0x2fdbe0=_0x1da6e2[_0x6d84('0x5d')](-0x1);if(_0x2fdbe0==='/'){_0x1da6e2=_0x1da6e2['substring'](0x0,_0x1da6e2[_0x6d84('0x5e')](_0x2fdbe0));}return rp({'method':_0x6d84('0x5f'),'uri':util[_0x6d84('0x60')](_0x6d84('0x61'),_0x1da6e2),'qs':{'authtoken':_0x5e866f[_0x6d84('0x5c')],'scope':_0x6d84('0x62')},'json':!![]});}})[_0x6d84('0x18')](function(_0x357c50){if(_0x357c50){if(_0x357c50[_0x6d84('0x63')]&&_0x357c50['response']['error']){throw new Error(_0x357c50[_0x6d84('0x63')][_0x6d84('0x1d')][_0x6d84('0x20')]);}var _0x2a2633=[];if(_0x357c50[_0x6d84('0x64')]&&_0x357c50['Calls'][_0x6d84('0x65')]){if(_0x357c50['Calls'][_0x6d84('0x65')]['FL']){var _0x1a5cb5=[_0x6d84('0x66')];for(var _0xa4753f=0x0,_0x3bb002=_0x357c50[_0x6d84('0x64')][_0x6d84('0x65')]['FL'][_0x6d84('0x38')];_0xa4753f<_0x3bb002;_0xa4753f++){if(_['includes'](_0x1a5cb5,_0x357c50[_0x6d84('0x64')][_0x6d84('0x65')]['FL'][_0xa4753f]['dv'])){_0x2a2633['push']({'id':_0x357c50[_0x6d84('0x64')]['section']['FL'][_0xa4753f]['dv'],'name':_0x357c50[_0x6d84('0x64')][_0x6d84('0x65')]['FL'][_0xa4753f][_0x6d84('0x67')],'custom':_0x357c50[_0x6d84('0x64')]['section']['FL'][_0xa4753f][_0x6d84('0x68')]==='true'?!![]:![],'options':_0x357c50['Calls'][_0x6d84('0x65')]['FL'][_0xa4753f][_0x6d84('0x43')]===_0x6d84('0x69')&&_0x357c50['Calls'][_0x6d84('0x65')]['FL'][_0xa4753f][_0x6d84('0x6a')]?_[_0x6d84('0x42')](_0x357c50[_0x6d84('0x64')][_0x6d84('0x65')]['FL'][_0xa4753f][_0x6d84('0x6a')],function(_0x124036){return{'name':_0x124036,'value':_0x124036};}):[]});}}}}return{'count':_0x2a2633[_0x6d84('0x38')],'rows':_0x2a2633};}})['then'](respondWithResult(_0x470899,null))[_0x6d84('0x4a')](function(_0x58dec2){var _0x3c75b0=_0xd89b55[_0x6d84('0x33')]['test']?0x1f4:_0x58dec2[_0x6d84('0x6b')]||0x1f4;logger[_0x6d84('0x1d')]('getFields,\x20%s,\x20%s,\x20%s',_0x6d84('0x5a'),_0x3c75b0,JSON[_0x6d84('0x1c')](_0x58dec2));delete _0x58dec2[_0x6d84('0x6c')];if(_0x3c75b0===0x191){_0x3c75b0=0x190;}_0x470899[_0x6d84('0x22')](_0x3c75b0)[_0x6d84('0x2d')](_0xd89b55[_0x6d84('0x33')][_0x6d84('0x6d')]?{'message':_0x6d84('0x6e'),'statusCode':_0x58dec2[_0x6d84('0x6b')]}:_0x58dec2);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 835828c..bb62101 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 _0xc4fb=['lodash','../../config/logger','api','moment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0x1357ec,_0x5da608){var _0x5e17e3=function(_0x39beba){while(--_0x39beba){_0x1357ec['push'](_0x1357ec['shift']());}};_0x5e17e3(++_0x5da608);}(_0xc4fb,0x15e));var _0xbc4f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc4fb[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xbc4f('0x0'));var util=require('util');var logger=require(_0xbc4f('0x1'))(_0xbc4f('0x2'));var moment=require(_0xbc4f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xbc4f('0x4'));var integrations=require(_0xbc4f('0x5'));module[_0xbc4f('0x6')]=function(_0x13f0ee,_0x11284a){return _0x13f0ee[_0xbc4f('0x7')](_0xbc4f('0x8'),attributes,{'tableName':_0xbc4f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd25f=['define','int_zoho_accounts','util','../../config/logger','moment','bluebird','request-promise','./intZohoAccount.attributes','exports'];(function(_0x191a64,_0x560b04){var _0x52e971=function(_0x3ebe3d){while(--_0x3ebe3d){_0x191a64['push'](_0x191a64['shift']());}};_0x52e971(++_0x560b04);}(_0xd25f,0xa4));var _0xfd25=function(_0x47fb54,_0x28698c){_0x47fb54=_0x47fb54-0x0;var _0x1139a7=_0xd25f[_0x47fb54];return _0x1139a7;};'use strict';var _=require('lodash');var util=require(_0xfd25('0x0'));var logger=require(_0xfd25('0x1'))('api');var moment=require(_0xfd25('0x2'));var BPromise=require(_0xfd25('0x3'));var rp=require(_0xfd25('0x4'));var attributes=require(_0xfd25('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xfd25('0x6')]=function(_0x3f6be6,_0x1d9fe8){return _0x3f6be6[_0xfd25('0x7')]('ZohoAccount',attributes,{'tableName':_0xfd25('0x8'),'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 aafee3f..b16da38 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 _0x5a1b=['debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetZohoAccount','ZohoAccount','findAll','options','raw','limit','include','map','model','attributes','then','catch','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x322652,_0x5a85c0){var _0x5d5e88=function(_0x5ce853){while(--_0x5ce853){_0x322652['push'](_0x322652['shift']());}};_0x5d5e88(++_0x5a85c0);}(_0x5a1b,0xe6));var _0xb5a1=function(_0x4241e6,_0xce5237){_0x4241e6=_0x4241e6-0x0;var _0x1ff2cb=_0x5a1b[_0x4241e6];return _0x1ff2cb;};'use strict';var _=require(_0xb5a1('0x0'));var util=require(_0xb5a1('0x1'));var moment=require(_0xb5a1('0x2'));var BPromise=require(_0xb5a1('0x3'));var rs=require(_0xb5a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5a1('0x5'))['db'];var utils=require(_0xb5a1('0x6'));var logger=require(_0xb5a1('0x7'))('rpc');var config=require(_0xb5a1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb5a1('0x9')][_0xb5a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46833b,_0x51e738,_0x23e426){return new BPromise(function(_0x2c59a5,_0x1c64d0){return client[_0xb5a1('0xb')](_0x46833b,_0x23e426)['then'](function(_0xb680b7){logger[_0xb5a1('0xc')](_0xb5a1('0xd'),_0x51e738,_0xb5a1('0xe'));logger[_0xb5a1('0xf')](_0xb5a1('0x10'),_0x51e738,_0xb5a1('0xe'),JSON[_0xb5a1('0x11')](_0xb680b7));if(_0xb680b7[_0xb5a1('0x12')]){if(_0xb680b7[_0xb5a1('0x12')][_0xb5a1('0x13')]===0x1f4){logger[_0xb5a1('0x12')](_0xb5a1('0xd'),_0x51e738,_0xb680b7['error'][_0xb5a1('0x14')]);return _0x1c64d0(_0xb680b7['error'][_0xb5a1('0x14')]);}logger[_0xb5a1('0x12')](_0xb5a1('0xd'),_0x51e738,_0xb680b7[_0xb5a1('0x12')][_0xb5a1('0x14')]);return _0x2c59a5(_0xb680b7[_0xb5a1('0x12')][_0xb5a1('0x14')]);}else{logger[_0xb5a1('0xc')](_0xb5a1('0xd'),_0x51e738,'request\x20sent');_0x2c59a5(_0xb680b7['result'][_0xb5a1('0x14')]);}})['catch'](function(_0x5522e1){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x51e738,_0x5522e1);_0x1c64d0(_0x5522e1);});});}exports[_0xb5a1('0x15')]=function(_0x377251){var _0x3efdfc=this;return new Promise(function(_0x30adb7,_0x5525d5){return db[_0xb5a1('0x16')][_0xb5a1('0x17')]({'raw':_0x377251['options']?_0x377251[_0xb5a1('0x18')][_0xb5a1('0x19')]===undefined?!![]:![]:!![],'where':_0x377251[_0xb5a1('0x18')]?_0x377251[_0xb5a1('0x18')]['where']||null:null,'attributes':_0x377251['options']?_0x377251[_0xb5a1('0x18')]['attributes']||null:null,'limit':_0x377251[_0xb5a1('0x18')]?_0x377251[_0xb5a1('0x18')][_0xb5a1('0x1a')]||null:null,'include':_0x377251[_0xb5a1('0x18')]?_0x377251['options'][_0xb5a1('0x1b')]?_[_0xb5a1('0x1c')](_0x377251[_0xb5a1('0x18')][_0xb5a1('0x1b')],function(_0xa425f6){return{'model':db[_0xa425f6[_0xb5a1('0x1d')]],'as':_0xa425f6['as'],'attributes':_0xa425f6['attributes'],'include':_0xa425f6[_0xb5a1('0x1b')]?_[_0xb5a1('0x1c')](_0xa425f6[_0xb5a1('0x1b')],function(_0x32e439){return{'model':db[_0x32e439[_0xb5a1('0x1d')]],'as':_0x32e439['as'],'attributes':_0x32e439[_0xb5a1('0x1e')],'include':_0x32e439[_0xb5a1('0x1b')]?_['map'](_0x32e439[_0xb5a1('0x1b')],function(_0x540e79){return{'model':db[_0x540e79['model']],'as':_0x540e79['as'],'attributes':_0x540e79[_0xb5a1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb5a1('0x1f')](function(_0x4d93aa){logger[_0xb5a1('0xc')](_0xb5a1('0x15'),_0x377251);logger[_0xb5a1('0xf')](_0xb5a1('0x15'),_0x377251,JSON[_0xb5a1('0x11')](_0x4d93aa));_0x30adb7(_0x4d93aa);})[_0xb5a1('0x20')](function(_0x1117d7){logger[_0xb5a1('0x12')](_0xb5a1('0x15'),_0x1117d7[_0xb5a1('0x14')],_0x377251);_0x5525d5(_0x3efdfc[_0xb5a1('0x12')](0x1f4,_0x1117d7[_0xb5a1('0x14')]));});});};exports[_0xb5a1('0x21')]=function(_0x317752){var _0x284340=this;return new Promise(function(_0x46273b,_0x4267ce){return db['ZohoAccount'][_0xb5a1('0x22')]({'raw':_0x317752[_0xb5a1('0x18')]?_0x317752[_0xb5a1('0x18')][_0xb5a1('0x19')]===undefined?!![]:![]:!![],'where':_0x317752[_0xb5a1('0x18')]?_0x317752['options']['where']||null:null,'attributes':_0x317752[_0xb5a1('0x18')]?_0x317752[_0xb5a1('0x18')][_0xb5a1('0x1e')]||null:null,'include':_0x317752[_0xb5a1('0x18')]?_0x317752['options'][_0xb5a1('0x1b')]?_[_0xb5a1('0x1c')](_0x317752[_0xb5a1('0x18')][_0xb5a1('0x1b')],function(_0x27e2c7){return{'model':db[_0x27e2c7[_0xb5a1('0x1d')]],'as':_0x27e2c7['as'],'attributes':_0x27e2c7['attributes'],'include':_0x27e2c7[_0xb5a1('0x1b')]?_[_0xb5a1('0x1c')](_0x27e2c7['include'],function(_0x3b3155){return{'model':db[_0x3b3155[_0xb5a1('0x1d')]],'as':_0x3b3155['as'],'attributes':_0x3b3155[_0xb5a1('0x1e')],'include':_0x3b3155[_0xb5a1('0x1b')]?_['map'](_0x3b3155[_0xb5a1('0x1b')],function(_0x557c4b){return{'model':db[_0x557c4b['model']],'as':_0x557c4b['as'],'attributes':_0x557c4b[_0xb5a1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb5a1('0x1f')](function(_0x4f07f1){logger[_0xb5a1('0xc')](_0xb5a1('0x21'),_0x317752);logger[_0xb5a1('0xf')]('ShowZohoAccount',_0x317752,JSON[_0xb5a1('0x11')](_0x4f07f1));_0x46273b(_0x4f07f1);})[_0xb5a1('0x20')](function(_0x450833){logger[_0xb5a1('0x12')](_0xb5a1('0x21'),_0x450833[_0xb5a1('0x14')],_0x317752);_0x4267ce(_0x284340['error'](0x1f4,_0x450833[_0xb5a1('0x14')]));});});}; \ No newline at end of file +var _0xa0b2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','map','model','catch','ShowZohoAccount','find','debug','lodash','util','ioredis','../../config/utils','../../config/logger'];(function(_0x4aac41,_0x40dfc6){var _0x543a0f=function(_0x5265d8){while(--_0x5265d8){_0x4aac41['push'](_0x4aac41['shift']());}};_0x543a0f(++_0x40dfc6);}(_0xa0b2,0x14f));var _0x2a0b=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0xa0b2[_0x500c0];return _0xdd146f;};'use strict';var _=require(_0x2a0b('0x0'));var util=require(_0x2a0b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a0b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a0b('0x3'));var logger=require(_0x2a0b('0x4'))(_0x2a0b('0x5'));var config=require(_0x2a0b('0x6'));var jayson=require(_0x2a0b('0x7'));var client=jayson[_0x2a0b('0x8')][_0x2a0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x246761,_0x4d2c2e,_0x33dc8f){return new BPromise(function(_0x57f0d5,_0x3158e9){return client[_0x2a0b('0xa')](_0x246761,_0x33dc8f)[_0x2a0b('0xb')](function(_0x299184){logger[_0x2a0b('0xc')](_0x2a0b('0xd'),_0x4d2c2e,'request\x20sent');logger['debug'](_0x2a0b('0xe'),_0x4d2c2e,_0x2a0b('0xf'),JSON[_0x2a0b('0x10')](_0x299184));if(_0x299184[_0x2a0b('0x11')]){if(_0x299184[_0x2a0b('0x11')][_0x2a0b('0x12')]===0x1f4){logger[_0x2a0b('0x11')](_0x2a0b('0xd'),_0x4d2c2e,_0x299184['error'][_0x2a0b('0x13')]);return _0x3158e9(_0x299184['error'][_0x2a0b('0x13')]);}logger['error'](_0x2a0b('0xd'),_0x4d2c2e,_0x299184[_0x2a0b('0x11')][_0x2a0b('0x13')]);return _0x57f0d5(_0x299184[_0x2a0b('0x11')][_0x2a0b('0x13')]);}else{logger[_0x2a0b('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x4d2c2e,_0x2a0b('0xf'));_0x57f0d5(_0x299184['result'][_0x2a0b('0x13')]);}})['catch'](function(_0x3dc478){logger[_0x2a0b('0x11')](_0x2a0b('0xd'),_0x4d2c2e,_0x3dc478);_0x3158e9(_0x3dc478);});});}exports[_0x2a0b('0x14')]=function(_0x2bea7a){var _0x34e2b1=this;return new Promise(function(_0x1ca874,_0x3ce59f){return db[_0x2a0b('0x15')]['findAll']({'raw':_0x2bea7a['options']?_0x2bea7a[_0x2a0b('0x16')][_0x2a0b('0x17')]===undefined?!![]:![]:!![],'where':_0x2bea7a['options']?_0x2bea7a[_0x2a0b('0x16')][_0x2a0b('0x18')]||null:null,'attributes':_0x2bea7a[_0x2a0b('0x16')]?_0x2bea7a[_0x2a0b('0x16')][_0x2a0b('0x19')]||null:null,'limit':_0x2bea7a[_0x2a0b('0x16')]?_0x2bea7a[_0x2a0b('0x16')][_0x2a0b('0x1a')]||null:null,'include':_0x2bea7a[_0x2a0b('0x16')]?_0x2bea7a['options'][_0x2a0b('0x1b')]?_[_0x2a0b('0x1c')](_0x2bea7a[_0x2a0b('0x16')]['include'],function(_0x386cba){return{'model':db[_0x386cba['model']],'as':_0x386cba['as'],'attributes':_0x386cba[_0x2a0b('0x19')],'include':_0x386cba[_0x2a0b('0x1b')]?_[_0x2a0b('0x1c')](_0x386cba['include'],function(_0x8b7ecd){return{'model':db[_0x8b7ecd[_0x2a0b('0x1d')]],'as':_0x8b7ecd['as'],'attributes':_0x8b7ecd[_0x2a0b('0x19')],'include':_0x8b7ecd['include']?_[_0x2a0b('0x1c')](_0x8b7ecd[_0x2a0b('0x1b')],function(_0x3e7082){return{'model':db[_0x3e7082['model']],'as':_0x3e7082['as'],'attributes':_0x3e7082[_0x2a0b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x247e09){logger['info'](_0x2a0b('0x14'),_0x2bea7a);logger['debug'](_0x2a0b('0x14'),_0x2bea7a,JSON[_0x2a0b('0x10')](_0x247e09));_0x1ca874(_0x247e09);})[_0x2a0b('0x1e')](function(_0x5621ba){logger[_0x2a0b('0x11')](_0x2a0b('0x14'),_0x5621ba[_0x2a0b('0x13')],_0x2bea7a);_0x3ce59f(_0x34e2b1[_0x2a0b('0x11')](0x1f4,_0x5621ba[_0x2a0b('0x13')]));});});};exports[_0x2a0b('0x1f')]=function(_0x4d459d){var _0x403368=this;return new Promise(function(_0x5b8bfb,_0x450fb4){return db[_0x2a0b('0x15')][_0x2a0b('0x20')]({'raw':_0x4d459d[_0x2a0b('0x16')]?_0x4d459d[_0x2a0b('0x16')][_0x2a0b('0x17')]===undefined?!![]:![]:!![],'where':_0x4d459d[_0x2a0b('0x16')]?_0x4d459d[_0x2a0b('0x16')]['where']||null:null,'attributes':_0x4d459d[_0x2a0b('0x16')]?_0x4d459d[_0x2a0b('0x16')][_0x2a0b('0x19')]||null:null,'include':_0x4d459d[_0x2a0b('0x16')]?_0x4d459d[_0x2a0b('0x16')][_0x2a0b('0x1b')]?_[_0x2a0b('0x1c')](_0x4d459d[_0x2a0b('0x16')][_0x2a0b('0x1b')],function(_0x4997cf){return{'model':db[_0x4997cf[_0x2a0b('0x1d')]],'as':_0x4997cf['as'],'attributes':_0x4997cf[_0x2a0b('0x19')],'include':_0x4997cf[_0x2a0b('0x1b')]?_['map'](_0x4997cf[_0x2a0b('0x1b')],function(_0x1d3a51){return{'model':db[_0x1d3a51[_0x2a0b('0x1d')]],'as':_0x1d3a51['as'],'attributes':_0x1d3a51[_0x2a0b('0x19')],'include':_0x1d3a51['include']?_[_0x2a0b('0x1c')](_0x1d3a51[_0x2a0b('0x1b')],function(_0x122637){return{'model':db[_0x122637[_0x2a0b('0x1d')]],'as':_0x122637['as'],'attributes':_0x122637[_0x2a0b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2a0b('0xb')](function(_0x1f97bb){logger['info']('ShowZohoAccount',_0x4d459d);logger[_0x2a0b('0x21')](_0x2a0b('0x1f'),_0x4d459d,JSON[_0x2a0b('0x10')](_0x1f97bb));_0x5b8bfb(_0x1f97bb);})[_0x2a0b('0x1e')](function(_0x5b2912){logger[_0x2a0b('0x11')](_0x2a0b('0x1f'),_0x5b2912[_0x2a0b('0x13')],_0x4d459d);_0x450fb4(_0x403368[_0x2a0b('0x11')](0x1f4,_0x5b2912['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index d979f0d..9d63f0d 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 _0xa87e=['index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','create','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated'];(function(_0xe1bdfa,_0x5371ce){var _0x28daee=function(_0x3d0cbb){while(--_0x3d0cbb){_0xe1bdfa['push'](_0xe1bdfa['shift']());}};_0x28daee(++_0x5371ce);}(_0xa87e,0x185));var _0xea87=function(_0x396d74,_0x22736a){_0x396d74=_0x396d74-0x0;var _0x693fcc=_0xa87e[_0x396d74];return _0x693fcc;};'use strict';var multer=require(_0xea87('0x0'));var util=require(_0xea87('0x1'));var path=require(_0xea87('0x2'));var timeout=require('connect-timeout');var express=require(_0xea87('0x3'));var router=express[_0xea87('0x4')]();var auth=require(_0xea87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea87('0x6'));var controller=require(_0xea87('0x7'));router[_0xea87('0x8')]('/',auth[_0xea87('0x9')](),controller[_0xea87('0xa')]);router['get'](_0xea87('0xb'),auth[_0xea87('0x9')](),controller[_0xea87('0xc')]);router[_0xea87('0x8')]('/:id/fields',auth[_0xea87('0x9')](),controller[_0xea87('0xd')]);router['get'](_0xea87('0xe'),auth['isAuthenticated'](),controller[_0xea87('0xf')]);router[_0xea87('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xea87('0x10')]);router['post']('/',auth[_0xea87('0x9')](),controller[_0xea87('0x11')]);router['put'](_0xea87('0xb'),auth[_0xea87('0x9')](),controller[_0xea87('0x12')]);router['delete'](_0xea87('0xb'),auth[_0xea87('0x9')](),controller[_0xea87('0x13')]);module[_0xea87('0x14')]=router; \ No newline at end of file +var _0xfbdb=['destroy','multer','path','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update'];(function(_0x38a66b,_0x34182f){var _0x3cd26f=function(_0x412525){while(--_0x412525){_0x38a66b['push'](_0x38a66b['shift']());}};_0x3cd26f(++_0x34182f);}(_0xfbdb,0x1ba));var _0xbfbd=function(_0x4662fc,_0x996714){_0x4662fc=_0x4662fc-0x0;var _0x410021=_0xfbdb[_0x4662fc];return _0x410021;};'use strict';var multer=require(_0xbfbd('0x0'));var util=require('util');var path=require(_0xbfbd('0x1'));var timeout=require('connect-timeout');var express=require(_0xbfbd('0x2'));var router=express[_0xbfbd('0x3')]();var auth=require(_0xbfbd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbfbd('0x5'));var controller=require(_0xbfbd('0x6'));router[_0xbfbd('0x7')]('/',auth[_0xbfbd('0x8')](),controller[_0xbfbd('0x9')]);router[_0xbfbd('0x7')](_0xbfbd('0xa'),auth[_0xbfbd('0x8')](),controller[_0xbfbd('0xb')]);router[_0xbfbd('0x7')](_0xbfbd('0xc'),auth['isAuthenticated'](),controller[_0xbfbd('0xd')]);router[_0xbfbd('0x7')](_0xbfbd('0xe'),auth['isAuthenticated'](),controller[_0xbfbd('0xf')]);router[_0xbfbd('0x7')](_0xbfbd('0x10'),auth[_0xbfbd('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0xbfbd('0x8')](),controller[_0xbfbd('0x11')]);router[_0xbfbd('0x12')](_0xbfbd('0xa'),auth[_0xbfbd('0x8')](),controller[_0xbfbd('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xbfbd('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 5c64362..6d2aa51 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 _0xc684=['exports','STRING'];(function(_0x4754e7,_0x241f5d){var _0x3b8578=function(_0x41b9de){while(--_0x41b9de){_0x4754e7['push'](_0x4754e7['shift']());}};_0x3b8578(++_0x241f5d);}(_0xc684,0x13a));var _0x4c68=function(_0x3dab4d,_0x145310){_0x3dab4d=_0x3dab4d-0x0;var _0x19155f=_0xc684[_0x3dab4d];return _0x19155f;};'use strict';var Sequelize=require('sequelize');module[_0x4c68('0x0')]={'name':{'type':Sequelize[_0x4c68('0x1')]},'description':{'type':Sequelize[_0x4c68('0x1')]}}; \ No newline at end of file +var _0xc276=['exports','STRING','sequelize'];(function(_0x3c6899,_0x4e94ea){var _0x362bf4=function(_0x47a81d){while(--_0x47a81d){_0x3c6899['push'](_0x3c6899['shift']());}};_0x362bf4(++_0x4e94ea);}(_0xc276,0xf8));var _0x6c27=function(_0x268ed1,_0x52d3dd){_0x268ed1=_0x268ed1-0x0;var _0x5a7f73=_0xc276[_0x268ed1];return _0x5a7f73;};'use strict';var Sequelize=require(_0x6c27('0x0'));module[_0x6c27('0x1')]={'name':{'type':Sequelize[_0x6c27('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 3270890..5d0112c 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 _0x4158=['jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../mysqldb','jayson/promise','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','json','count','limit','Content-Range','apply','reject','save','update','stack','name','send','ZohoConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','findAll','params','create','body','find','destroy','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x8e7f52,_0x59b28d){var _0x5d31dd=function(_0x2c469a){while(--_0x2c469a){_0x8e7f52['push'](_0x8e7f52['shift']());}};_0x5d31dd(++_0x59b28d);}(_0x4158,0xf2));var _0x8415=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4158[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8415('0x0'));var rimraf=require(_0x8415('0x1'));var zipdir=require(_0x8415('0x2'));var jsonpatch=require(_0x8415('0x3'));var rp=require(_0x8415('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8415('0x5'));var path=require(_0x8415('0x6'));var sox=require(_0x8415('0x7'));var csv=require(_0x8415('0x8'));var ejs=require(_0x8415('0x9'));var fs=require('fs');var _=require(_0x8415('0xa'));var squel=require(_0x8415('0xb'));var crypto=require(_0x8415('0xc'));var jsforce=require(_0x8415('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8415('0xe'));var Papa=require(_0x8415('0xf'));var authService=require(_0x8415('0x10'));var hardwareService=require(_0x8415('0x11'));var Redis=require(_0x8415('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x8415('0x13'))(_0x8415('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8415('0x15'))['db'];var jayson=require(_0x8415('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b0fc0,_0x35d190,_0x100d5a,_0x351344){return new BPromise(function(_0x3bfac7,_0x5f3c01){var _0x17a15c=_0x351344||client;return _0x17a15c['request'](_0x2b0fc0,_0x100d5a)[_0x8415('0x17')](function(_0x51442e){logger[_0x8415('0x18')](_0x8415('0x19'),_0x35d190,_0x8415('0x1a'));logger[_0x8415('0x1b')](_0x8415('0x1c'),_0x35d190,_0x8415('0x1a'),JSON[_0x8415('0x1d')](_0x51442e));if(_0x51442e['error']){if(_0x51442e[_0x8415('0x1e')][_0x8415('0x1f')]===0x1f4){logger[_0x8415('0x1e')](_0x8415('0x19'),_0x35d190,_0x51442e['error'][_0x8415('0x20')]);return _0x5f3c01(_0x51442e[_0x8415('0x1e')][_0x8415('0x20')]);}logger[_0x8415('0x1e')](_0x8415('0x19'),_0x35d190,_0x51442e[_0x8415('0x1e')][_0x8415('0x20')]);return _0x3bfac7(_0x51442e['error']['message']);}else{logger['info'](_0x8415('0x19'),_0x35d190,'request\x20sent');_0x3bfac7(_0x51442e[_0x8415('0x21')][_0x8415('0x20')]);}})[_0x8415('0x22')](function(_0x114f38){logger[_0x8415('0x1e')](_0x8415('0x19'),_0x35d190,_0x114f38);_0x5f3c01(_0x114f38);});});}function respondWithStatusCode(_0x2b9b66,_0x46c67d){_0x46c67d=_0x46c67d||0xcc;return function(_0x14da8b){if(_0x14da8b){return _0x2b9b66[_0x8415('0x23')](_0x46c67d);}return _0x2b9b66[_0x8415('0x24')](_0x46c67d)[_0x8415('0x25')]();};}function respondWithResult(_0x599fc3,_0x1d16aa){_0x1d16aa=_0x1d16aa||0xc8;return function(_0x2c8d21){if(_0x2c8d21){return _0x599fc3[_0x8415('0x24')](_0x1d16aa)[_0x8415('0x26')](_0x2c8d21);}};}function respondWithFilteredResult(_0x36eb02,_0x996cb6){return function(_0x2cf8cb){if(_0x2cf8cb){var _0x37256f=_0x2cf8cb[_0x8415('0x27')],_0x13800c=_0x996cb6['offset'],_0x23e59c=_0x996cb6['offset']+_0x996cb6[_0x8415('0x28')],_0x3d3b7d;if(_0x23e59c>=_0x37256f){_0x23e59c=_0x37256f;_0x3d3b7d=0xc8;}else{_0x3d3b7d=0xce;}_0x36eb02[_0x8415('0x24')](_0x3d3b7d);return _0x36eb02['set'](_0x8415('0x29'),_0x13800c+'-'+_0x23e59c+'/'+_0x37256f)[_0x8415('0x26')](_0x2cf8cb);}return null;};}function patchUpdates(_0x371f4e){return function(_0x39e8f6){try{jsonpatch[_0x8415('0x2a')](_0x39e8f6,_0x371f4e,!![]);}catch(_0x5aa700){return BPromise[_0x8415('0x2b')](_0x5aa700);}return _0x39e8f6[_0x8415('0x2c')]();};}function saveUpdates(_0x1488bb,_0x326863){return function(_0x4ceb99){if(_0x4ceb99){return _0x4ceb99[_0x8415('0x2d')](_0x1488bb)[_0x8415('0x17')](function(_0x1f1670){return _0x1f1670;});}return null;};}function removeEntity(_0xc3d098,_0xd53039){return function(_0x20d91e){if(_0x20d91e){return _0x20d91e['destroy']()[_0x8415('0x17')](function(){_0xc3d098[_0x8415('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57744e,_0x15ebe6){return function(_0x2edf85){if(!_0x2edf85){_0x57744e[_0x8415('0x23')](0x194);}return _0x2edf85;};}function handleError(_0x2bedf8,_0x5674a9){_0x5674a9=_0x5674a9||0x1f4;return function(_0x2ced30){logger['error'](_0x2ced30[_0x8415('0x2e')]);if(_0x2ced30['name']){delete _0x2ced30[_0x8415('0x2f')];}_0x2bedf8['status'](_0x5674a9)[_0x8415('0x30')](_0x2ced30);};}exports['index']=function(_0x51daa3,_0xf20070){var _0x3bf659={},_0x449380={},_0x3a6df7={'count':0x0,'rows':[]};var _0x16c8ea=db[_0x8415('0x31')][_0x8415('0x32')];_0x449380['model']=_[_0x8415('0x33')](_0x16c8ea);_0x449380[_0x8415('0x34')]=_[_0x8415('0x33')](_0x51daa3[_0x8415('0x34')]);_0x449380[_0x8415('0x35')]=_[_0x8415('0x36')](_0x449380[_0x8415('0x37')],_0x449380['query']);_0x3bf659[_0x8415('0x38')]=_[_0x8415('0x36')](_0x449380['model'],qs[_0x8415('0x39')](_0x51daa3['query'][_0x8415('0x39')]));_0x3bf659['attributes']=_0x3bf659[_0x8415('0x38')][_0x8415('0x3a')]?_0x3bf659['attributes']:_0x449380[_0x8415('0x37')];if(!_0x51daa3[_0x8415('0x34')][_0x8415('0x3b')](_0x8415('0x3c'))){_0x3bf659[_0x8415('0x28')]=qs[_0x8415('0x28')](_0x51daa3[_0x8415('0x34')]['limit']);_0x3bf659['offset']=qs[_0x8415('0x3d')](_0x51daa3['query'][_0x8415('0x3d')]);}_0x3bf659[_0x8415('0x3e')]=qs[_0x8415('0x3f')](_0x51daa3['query'][_0x8415('0x3f')]);_0x3bf659[_0x8415('0x40')]=qs[_0x8415('0x35')](_[_0x8415('0x41')](_0x51daa3['query'],_0x449380[_0x8415('0x35')]));if(_0x51daa3[_0x8415('0x34')][_0x8415('0x42')]){_0x3bf659['where']=_['merge'](_0x3bf659['where'],{'$or':_[_0x8415('0x43')](_0x16c8ea,function(_0x246097){if(_0x246097[_0x8415('0x44')][_0x8415('0x45')]!==_0x8415('0x46')){var _0x4278bf={};_0x4278bf[_0x246097['field']]={'$like':'%'+_0x51daa3['query'][_0x8415('0x42')]+'%'};return _0x4278bf;}})});}_0x3bf659=_[_0x8415('0x47')]({},_0x3bf659,_0x51daa3[_0x8415('0x48')]);var _0x478dac={'where':_0x3bf659[_0x8415('0x40')]};return db[_0x8415('0x31')][_0x8415('0x27')](_0x478dac)[_0x8415('0x17')](function(_0x333def){_0x3a6df7[_0x8415('0x27')]=_0x333def;if(_0x51daa3[_0x8415('0x34')][_0x8415('0x49')]){_0x3bf659[_0x8415('0x4a')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x8415('0x4b')](_0x3bf659);})[_0x8415('0x17')](function(_0x2a672c){_0x3a6df7['rows']=_0x2a672c;return _0x3a6df7;})['then'](respondWithFilteredResult(_0xf20070,_0x3bf659))[_0x8415('0x22')](handleError(_0xf20070,null));};exports['show']=function(_0x13104a,_0x49e27c){var _0x5e1208={'raw':![],'where':{'id':_0x13104a[_0x8415('0x4c')]['id']}},_0x2e9fd1={};_0x2e9fd1[_0x8415('0x37')]=_[_0x8415('0x33')](db[_0x8415('0x31')][_0x8415('0x32')]);_0x2e9fd1[_0x8415('0x34')]=_['keys'](_0x13104a[_0x8415('0x34')]);_0x2e9fd1[_0x8415('0x35')]=_[_0x8415('0x36')](_0x2e9fd1[_0x8415('0x37')],_0x2e9fd1[_0x8415('0x34')]);_0x5e1208[_0x8415('0x38')]=_[_0x8415('0x36')](_0x2e9fd1[_0x8415('0x37')],qs[_0x8415('0x39')](_0x13104a['query']['fields']));_0x5e1208['attributes']=_0x5e1208[_0x8415('0x38')]['length']?_0x5e1208['attributes']:_0x2e9fd1[_0x8415('0x37')];if(_0x13104a['query'][_0x8415('0x49')]){_0x5e1208['include']=[{'all':!![]}];}_0x5e1208=_['merge']({},_0x5e1208,_0x13104a[_0x8415('0x48')]);return db[_0x8415('0x31')]['find'](_0x5e1208)[_0x8415('0x17')](handleEntityNotFound(_0x49e27c,null))[_0x8415('0x17')](respondWithResult(_0x49e27c,null))[_0x8415('0x22')](handleError(_0x49e27c,null));};exports[_0x8415('0x4d')]=function(_0x32fe8f,_0x1339bd){return db['ZohoConfiguration'][_0x8415('0x4d')](_0x32fe8f['body'],{})[_0x8415('0x17')](respondWithResult(_0x1339bd,0xc9))[_0x8415('0x22')](handleError(_0x1339bd,null));};exports[_0x8415('0x2d')]=function(_0x11539a,_0x39442a){if(_0x11539a[_0x8415('0x4e')]['id']){delete _0x11539a['body']['id'];}return db['ZohoConfiguration'][_0x8415('0x4f')]({'where':{'id':_0x11539a['params']['id']}})['then'](handleEntityNotFound(_0x39442a,null))[_0x8415('0x17')](saveUpdates(_0x11539a[_0x8415('0x4e')],null))[_0x8415('0x17')](respondWithResult(_0x39442a,null))['catch'](handleError(_0x39442a,null));};exports[_0x8415('0x50')]=function(_0x3ae4ad,_0x15ab64){return db[_0x8415('0x31')][_0x8415('0x4f')]({'where':{'id':_0x3ae4ad['params']['id']}})[_0x8415('0x17')](handleEntityNotFound(_0x15ab64,null))[_0x8415('0x17')](removeEntity(_0x15ab64,null))[_0x8415('0x22')](handleError(_0x15ab64,null));};exports[_0x8415('0x51')]=function(_0x1421dd,_0x11d297,_0x3c64de){var _0xc07f37={};var _0x479ddf={};var _0x1f0a82;var _0x2868a0;return db[_0x8415('0x31')]['findOne']({'where':{'id':_0x1421dd[_0x8415('0x4c')]['id']}})[_0x8415('0x17')](handleEntityNotFound(_0x11d297,null))['then'](function(_0x21f136){if(_0x21f136){_0x1f0a82=_0x21f136;_0x479ddf[_0x8415('0x37')]=_[_0x8415('0x33')](db['ZohoField'][_0x8415('0x32')]);_0x479ddf[_0x8415('0x34')]=_[_0x8415('0x33')](_0x1421dd['query']);_0x479ddf['filters']=_[_0x8415('0x36')](_0x479ddf[_0x8415('0x37')],_0x479ddf[_0x8415('0x34')]);_0xc07f37[_0x8415('0x38')]=_[_0x8415('0x36')](_0x479ddf[_0x8415('0x37')],qs['fields'](_0x1421dd[_0x8415('0x34')]['fields']));_0xc07f37[_0x8415('0x38')]=_0xc07f37['attributes'][_0x8415('0x3a')]?_0xc07f37[_0x8415('0x38')]:_0x479ddf[_0x8415('0x37')];_0xc07f37[_0x8415('0x3e')]=qs[_0x8415('0x3f')](_0x1421dd[_0x8415('0x34')]['sort']);_0xc07f37[_0x8415('0x40')]=qs[_0x8415('0x35')](_[_0x8415('0x41')](_0x1421dd[_0x8415('0x34')],_0x479ddf['filters']));if(_0x1421dd[_0x8415('0x34')][_0x8415('0x42')]){_0xc07f37[_0x8415('0x40')]=_[_0x8415('0x47')](_0xc07f37[_0x8415('0x40')],{'$or':_[_0x8415('0x43')](_0xc07f37[_0x8415('0x38')],function(_0x1526de){var _0x2d5f11={};_0x2d5f11[_0x1526de]={'$like':'%'+_0x1421dd[_0x8415('0x34')][_0x8415('0x42')]+'%'};return _0x2d5f11;})});}_0xc07f37=_['merge']({},_0xc07f37,_0x1421dd[_0x8415('0x48')]);return _0x1f0a82['getFields'](_0xc07f37);}})[_0x8415('0x17')](function(_0x7ec80d){if(_0x7ec80d){_0x2868a0=_0x7ec80d['length'];if(!_0x1421dd[_0x8415('0x34')][_0x8415('0x3b')]('nolimit')){_0xc07f37[_0x8415('0x28')]=qs[_0x8415('0x28')](_0x1421dd[_0x8415('0x34')]['limit']);_0xc07f37[_0x8415('0x3d')]=qs[_0x8415('0x3d')](_0x1421dd[_0x8415('0x34')]['offset']);}return _0x1f0a82[_0x8415('0x51')](_0xc07f37);}})[_0x8415('0x17')](function(_0x565d3c){if(_0x565d3c){return _0x565d3c?{'count':_0x2868a0,'rows':_0x565d3c}:null;}})['then'](respondWithResult(_0x11d297,null))['catch'](handleError(_0x11d297,null));};exports[_0x8415('0x52')]=function(_0x162a70,_0x2c490a,_0x21d304){var _0x28b383={};var _0x37f36e={};var _0x5279eb;var _0x2f179d;return db['ZohoConfiguration'][_0x8415('0x53')]({'where':{'id':_0x162a70['params']['id']}})[_0x8415('0x17')](handleEntityNotFound(_0x2c490a,null))[_0x8415('0x17')](function(_0x2d1219){if(_0x2d1219){_0x5279eb=_0x2d1219;_0x37f36e['model']=_['keys'](db['ZohoField'][_0x8415('0x32')]);_0x37f36e[_0x8415('0x34')]=_['keys'](_0x162a70[_0x8415('0x34')]);_0x37f36e[_0x8415('0x35')]=_[_0x8415('0x36')](_0x37f36e[_0x8415('0x37')],_0x37f36e[_0x8415('0x34')]);_0x28b383[_0x8415('0x38')]=_[_0x8415('0x36')](_0x37f36e['model'],qs[_0x8415('0x39')](_0x162a70[_0x8415('0x34')][_0x8415('0x39')]));_0x28b383[_0x8415('0x38')]=_0x28b383['attributes'][_0x8415('0x3a')]?_0x28b383[_0x8415('0x38')]:_0x37f36e[_0x8415('0x37')];_0x28b383[_0x8415('0x3e')]=qs[_0x8415('0x3f')](_0x162a70['query'][_0x8415('0x3f')]);_0x28b383[_0x8415('0x40')]=qs[_0x8415('0x35')](_[_0x8415('0x41')](_0x162a70['query'],_0x37f36e[_0x8415('0x35')]));if(_0x162a70['query'][_0x8415('0x42')]){_0x28b383[_0x8415('0x40')]=_[_0x8415('0x47')](_0x28b383[_0x8415('0x40')],{'$or':_[_0x8415('0x43')](_0x28b383['attributes'],function(_0x5b46f6){var _0x44ba50={};_0x44ba50[_0x5b46f6]={'$like':'%'+_0x162a70[_0x8415('0x34')][_0x8415('0x42')]+'%'};return _0x44ba50;})});}_0x28b383=_['merge']({},_0x28b383,_0x162a70[_0x8415('0x48')]);return _0x5279eb['getSubjects'](_0x28b383);}})[_0x8415('0x17')](function(_0x180bd5){if(_0x180bd5){_0x2f179d=_0x180bd5[_0x8415('0x3a')];if(!_0x162a70[_0x8415('0x34')]['hasOwnProperty']('nolimit')){_0x28b383[_0x8415('0x28')]=qs[_0x8415('0x28')](_0x162a70[_0x8415('0x34')][_0x8415('0x28')]);_0x28b383[_0x8415('0x3d')]=qs['offset'](_0x162a70[_0x8415('0x34')]['offset']);}return _0x5279eb[_0x8415('0x52')](_0x28b383);}})['then'](function(_0x1a9d92){if(_0x1a9d92){return _0x1a9d92?{'count':_0x2f179d,'rows':_0x1a9d92}:null;}})[_0x8415('0x17')](respondWithResult(_0x2c490a,null))[_0x8415('0x22')](handleError(_0x2c490a,null));};exports['getDescriptions']=function(_0x26c6a0,_0x18687d,_0x3916a5){var _0x17ebc1={};var _0x3fdeba={};var _0x2e7ac3;var _0xce14a4;return db[_0x8415('0x31')][_0x8415('0x53')]({'where':{'id':_0x26c6a0[_0x8415('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18687d,null))[_0x8415('0x17')](function(_0x20dd3b){if(_0x20dd3b){_0x2e7ac3=_0x20dd3b;_0x3fdeba[_0x8415('0x37')]=_['keys'](db['ZohoField'][_0x8415('0x32')]);_0x3fdeba[_0x8415('0x34')]=_[_0x8415('0x33')](_0x26c6a0[_0x8415('0x34')]);_0x3fdeba[_0x8415('0x35')]=_[_0x8415('0x36')](_0x3fdeba[_0x8415('0x37')],_0x3fdeba['query']);_0x17ebc1[_0x8415('0x38')]=_[_0x8415('0x36')](_0x3fdeba[_0x8415('0x37')],qs['fields'](_0x26c6a0[_0x8415('0x34')][_0x8415('0x39')]));_0x17ebc1[_0x8415('0x38')]=_0x17ebc1[_0x8415('0x38')][_0x8415('0x3a')]?_0x17ebc1[_0x8415('0x38')]:_0x3fdeba[_0x8415('0x37')];_0x17ebc1['order']=qs['sort'](_0x26c6a0[_0x8415('0x34')]['sort']);_0x17ebc1[_0x8415('0x40')]=qs[_0x8415('0x35')](_['pick'](_0x26c6a0[_0x8415('0x34')],_0x3fdeba[_0x8415('0x35')]));if(_0x26c6a0[_0x8415('0x34')][_0x8415('0x42')]){_0x17ebc1[_0x8415('0x40')]=_[_0x8415('0x47')](_0x17ebc1['where'],{'$or':_[_0x8415('0x43')](_0x17ebc1[_0x8415('0x38')],function(_0x222422){var _0x30b204={};_0x30b204[_0x222422]={'$like':'%'+_0x26c6a0[_0x8415('0x34')][_0x8415('0x42')]+'%'};return _0x30b204;})});}_0x17ebc1=_[_0x8415('0x47')]({},_0x17ebc1,_0x26c6a0[_0x8415('0x48')]);return _0x2e7ac3['getDescriptions'](_0x17ebc1);}})['then'](function(_0x986ed7){if(_0x986ed7){_0xce14a4=_0x986ed7['length'];if(!_0x26c6a0[_0x8415('0x34')][_0x8415('0x3b')](_0x8415('0x3c'))){_0x17ebc1['limit']=qs['limit'](_0x26c6a0[_0x8415('0x34')]['limit']);_0x17ebc1['offset']=qs[_0x8415('0x3d')](_0x26c6a0[_0x8415('0x34')]['offset']);}return _0x2e7ac3[_0x8415('0x54')](_0x17ebc1);}})['then'](function(_0x407239){if(_0x407239){return _0x407239?{'count':_0xce14a4,'rows':_0x407239}:null;}})[_0x8415('0x17')](respondWithResult(_0x18687d,null))[_0x8415('0x22')](handleError(_0x18687d,null));}; \ No newline at end of file +var _0xe93d=['name','send','index','ZohoConfiguration','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','update','getFields','findOne','ZohoField','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy'];(function(_0x4a3f4a,_0xf5031f){var _0x5cb287=function(_0x5704b2){while(--_0x5704b2){_0x4a3f4a['push'](_0x4a3f4a['shift']());}};_0x5cb287(++_0xf5031f);}(_0xe93d,0x12a));var _0xde93=function(_0x3da605,_0x2393ea){_0x3da605=_0x3da605-0x0;var _0x1fe1cf=_0xe93d[_0x3da605];return _0x1fe1cf;};'use strict';var pdf=require(_0xde93('0x0'));var emlformat=require(_0xde93('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xde93('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xde93('0x3'));var BPromise=require(_0xde93('0x4'));var Mustache=require(_0xde93('0x5'));var util=require('util');var path=require(_0xde93('0x6'));var sox=require(_0xde93('0x7'));var csv=require(_0xde93('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xde93('0x9'));var squel=require('squel');var crypto=require(_0xde93('0xa'));var jsforce=require(_0xde93('0xb'));var deskjs=require(_0xde93('0xc'));var toCsv=require('to-csv');var querystring=require(_0xde93('0xd'));var Papa=require(_0xde93('0xe'));var authService=require(_0xde93('0xf'));var hardwareService=require(_0xde93('0x10'));var Redis=require('ioredis');var qs=require(_0xde93('0x11'));var logger=require(_0xde93('0x12'))(_0xde93('0x13'));var utils=require(_0xde93('0x14'));var config=require('../../config/environment');var db=require(_0xde93('0x15'))['db'];var jayson=require(_0xde93('0x16'));var client=jayson[_0xde93('0x17')][_0xde93('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x54025f,_0x2fb5f9,_0x48d049,_0x244133){return new BPromise(function(_0x1d9d13,_0x9f03b6){var _0x9ec99f=_0x244133||client;return _0x9ec99f[_0xde93('0x19')](_0x54025f,_0x48d049)['then'](function(_0x53cc6d){logger['info'](_0xde93('0x1a'),_0x2fb5f9,_0xde93('0x1b'));logger['debug'](_0xde93('0x1c'),_0x2fb5f9,'request\x20sent',JSON['stringify'](_0x53cc6d));if(_0x53cc6d['error']){if(_0x53cc6d['error']['code']===0x1f4){logger[_0xde93('0x1d')](_0xde93('0x1a'),_0x2fb5f9,_0x53cc6d[_0xde93('0x1d')][_0xde93('0x1e')]);return _0x9f03b6(_0x53cc6d[_0xde93('0x1d')][_0xde93('0x1e')]);}logger[_0xde93('0x1d')](_0xde93('0x1a'),_0x2fb5f9,_0x53cc6d[_0xde93('0x1d')][_0xde93('0x1e')]);return _0x1d9d13(_0x53cc6d[_0xde93('0x1d')][_0xde93('0x1e')]);}else{logger[_0xde93('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x2fb5f9,_0xde93('0x1b'));_0x1d9d13(_0x53cc6d['result'][_0xde93('0x1e')]);}})[_0xde93('0x20')](function(_0x41dbf7){logger[_0xde93('0x1d')](_0xde93('0x1a'),_0x2fb5f9,_0x41dbf7);_0x9f03b6(_0x41dbf7);});});}function respondWithStatusCode(_0x21e105,_0x4ca563){_0x4ca563=_0x4ca563||0xcc;return function(_0x540819){if(_0x540819){return _0x21e105[_0xde93('0x21')](_0x4ca563);}return _0x21e105[_0xde93('0x22')](_0x4ca563)[_0xde93('0x23')]();};}function respondWithResult(_0x27a358,_0x3f041c){_0x3f041c=_0x3f041c||0xc8;return function(_0x248267){if(_0x248267){return _0x27a358['status'](_0x3f041c)[_0xde93('0x24')](_0x248267);}};}function respondWithFilteredResult(_0x468778,_0x5c0c26){return function(_0x128b25){if(_0x128b25){var _0x9d102a=_0x128b25[_0xde93('0x25')],_0xb62443=_0x5c0c26[_0xde93('0x26')],_0x4feeaf=_0x5c0c26[_0xde93('0x26')]+_0x5c0c26[_0xde93('0x27')],_0x4bf0d4;if(_0x4feeaf>=_0x9d102a){_0x4feeaf=_0x9d102a;_0x4bf0d4=0xc8;}else{_0x4bf0d4=0xce;}_0x468778[_0xde93('0x22')](_0x4bf0d4);return _0x468778[_0xde93('0x28')](_0xde93('0x29'),_0xb62443+'-'+_0x4feeaf+'/'+_0x9d102a)[_0xde93('0x24')](_0x128b25);}return null;};}function patchUpdates(_0x1be959){return function(_0x40c1ac){try{jsonpatch[_0xde93('0x2a')](_0x40c1ac,_0x1be959,!![]);}catch(_0x12fad2){return BPromise[_0xde93('0x2b')](_0x12fad2);}return _0x40c1ac['save']();};}function saveUpdates(_0x497ff2,_0x59a142){return function(_0x314707){if(_0x314707){return _0x314707['update'](_0x497ff2)[_0xde93('0x2c')](function(_0x2a4de1){return _0x2a4de1;});}return null;};}function removeEntity(_0x4aeb33,_0x47bf05){return function(_0xe1935a){if(_0xe1935a){return _0xe1935a[_0xde93('0x2d')]()['then'](function(){_0x4aeb33['status'](0xcc)[_0xde93('0x23')]();});}};}function handleEntityNotFound(_0x1bb81e,_0x1a2ad3){return function(_0x40a9bf){if(!_0x40a9bf){_0x1bb81e[_0xde93('0x21')](0x194);}return _0x40a9bf;};}function handleError(_0x2fb507,_0xacf092){_0xacf092=_0xacf092||0x1f4;return function(_0x3f1168){logger[_0xde93('0x1d')](_0x3f1168['stack']);if(_0x3f1168[_0xde93('0x2e')]){delete _0x3f1168[_0xde93('0x2e')];}_0x2fb507[_0xde93('0x22')](_0xacf092)[_0xde93('0x2f')](_0x3f1168);};}exports[_0xde93('0x30')]=function(_0x32636f,_0x57c1d9){var _0x566673={},_0x5f48fb={},_0xbac1d7={'count':0x0,'rows':[]};var _0xe0c71b=db[_0xde93('0x31')]['rawAttributes'];_0x5f48fb[_0xde93('0x32')]=_[_0xde93('0x33')](_0xe0c71b);_0x5f48fb[_0xde93('0x34')]=_[_0xde93('0x33')](_0x32636f[_0xde93('0x34')]);_0x5f48fb['filters']=_[_0xde93('0x35')](_0x5f48fb[_0xde93('0x32')],_0x5f48fb['query']);_0x566673[_0xde93('0x36')]=_[_0xde93('0x35')](_0x5f48fb[_0xde93('0x32')],qs[_0xde93('0x37')](_0x32636f[_0xde93('0x34')]['fields']));_0x566673['attributes']=_0x566673[_0xde93('0x36')][_0xde93('0x38')]?_0x566673[_0xde93('0x36')]:_0x5f48fb[_0xde93('0x32')];if(!_0x32636f[_0xde93('0x34')][_0xde93('0x39')](_0xde93('0x3a'))){_0x566673[_0xde93('0x27')]=qs[_0xde93('0x27')](_0x32636f[_0xde93('0x34')][_0xde93('0x27')]);_0x566673[_0xde93('0x26')]=qs[_0xde93('0x26')](_0x32636f[_0xde93('0x34')][_0xde93('0x26')]);}_0x566673[_0xde93('0x3b')]=qs[_0xde93('0x3c')](_0x32636f[_0xde93('0x34')][_0xde93('0x3c')]);_0x566673[_0xde93('0x3d')]=qs[_0xde93('0x3e')](_[_0xde93('0x3f')](_0x32636f[_0xde93('0x34')],_0x5f48fb['filters']));if(_0x32636f[_0xde93('0x34')][_0xde93('0x40')]){_0x566673[_0xde93('0x3d')]=_[_0xde93('0x41')](_0x566673[_0xde93('0x3d')],{'$or':_[_0xde93('0x42')](_0xe0c71b,function(_0x216fd3){if(_0x216fd3['type'][_0xde93('0x43')]!==_0xde93('0x44')){var _0x1ac8bc={};_0x1ac8bc[_0x216fd3[_0xde93('0x45')]]={'$like':'%'+_0x32636f['query'][_0xde93('0x40')]+'%'};return _0x1ac8bc;}})});}_0x566673=_[_0xde93('0x41')]({},_0x566673,_0x32636f[_0xde93('0x46')]);var _0x1f1ac9={'where':_0x566673[_0xde93('0x3d')]};return db[_0xde93('0x31')]['count'](_0x1f1ac9)[_0xde93('0x2c')](function(_0xb170e3){_0xbac1d7['count']=_0xb170e3;if(_0x32636f['query'][_0xde93('0x47')]){_0x566673[_0xde93('0x48')]=[{'all':!![]}];}return db[_0xde93('0x31')][_0xde93('0x49')](_0x566673);})[_0xde93('0x2c')](function(_0xd72978){_0xbac1d7[_0xde93('0x4a')]=_0xd72978;return _0xbac1d7;})[_0xde93('0x2c')](respondWithFilteredResult(_0x57c1d9,_0x566673))['catch'](handleError(_0x57c1d9,null));};exports['show']=function(_0x379f44,_0x383e3e){var _0x562334={'raw':![],'where':{'id':_0x379f44[_0xde93('0x4b')]['id']}},_0x29ee33={};_0x29ee33[_0xde93('0x32')]=_[_0xde93('0x33')](db['ZohoConfiguration'][_0xde93('0x4c')]);_0x29ee33[_0xde93('0x34')]=_[_0xde93('0x33')](_0x379f44[_0xde93('0x34')]);_0x29ee33['filters']=_[_0xde93('0x35')](_0x29ee33[_0xde93('0x32')],_0x29ee33[_0xde93('0x34')]);_0x562334[_0xde93('0x36')]=_[_0xde93('0x35')](_0x29ee33[_0xde93('0x32')],qs[_0xde93('0x37')](_0x379f44[_0xde93('0x34')][_0xde93('0x37')]));_0x562334[_0xde93('0x36')]=_0x562334[_0xde93('0x36')][_0xde93('0x38')]?_0x562334['attributes']:_0x29ee33[_0xde93('0x32')];if(_0x379f44[_0xde93('0x34')][_0xde93('0x47')]){_0x562334[_0xde93('0x48')]=[{'all':!![]}];}_0x562334=_[_0xde93('0x41')]({},_0x562334,_0x379f44[_0xde93('0x46')]);return db[_0xde93('0x31')][_0xde93('0x4d')](_0x562334)[_0xde93('0x2c')](handleEntityNotFound(_0x383e3e,null))[_0xde93('0x2c')](respondWithResult(_0x383e3e,null))[_0xde93('0x20')](handleError(_0x383e3e,null));};exports[_0xde93('0x4e')]=function(_0x499898,_0x24a36c){return db[_0xde93('0x31')]['create'](_0x499898[_0xde93('0x4f')],{})[_0xde93('0x2c')](respondWithResult(_0x24a36c,0xc9))[_0xde93('0x20')](handleError(_0x24a36c,null));};exports[_0xde93('0x50')]=function(_0xf9fcf5,_0x4f0e16){if(_0xf9fcf5['body']['id']){delete _0xf9fcf5[_0xde93('0x4f')]['id'];}return db[_0xde93('0x31')][_0xde93('0x4d')]({'where':{'id':_0xf9fcf5[_0xde93('0x4b')]['id']}})[_0xde93('0x2c')](handleEntityNotFound(_0x4f0e16,null))[_0xde93('0x2c')](saveUpdates(_0xf9fcf5[_0xde93('0x4f')],null))['then'](respondWithResult(_0x4f0e16,null))[_0xde93('0x20')](handleError(_0x4f0e16,null));};exports[_0xde93('0x2d')]=function(_0x1d3239,_0x2a4b60){return db[_0xde93('0x31')][_0xde93('0x4d')]({'where':{'id':_0x1d3239[_0xde93('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a4b60,null))['then'](removeEntity(_0x2a4b60,null))['catch'](handleError(_0x2a4b60,null));};exports[_0xde93('0x51')]=function(_0x23e12c,_0x24d926,_0x4fd392){var _0x1f9dda={};var _0x36ee43={};var _0x39c578;var _0x1595a6;return db[_0xde93('0x31')][_0xde93('0x52')]({'where':{'id':_0x23e12c[_0xde93('0x4b')]['id']}})[_0xde93('0x2c')](handleEntityNotFound(_0x24d926,null))['then'](function(_0x5d05f2){if(_0x5d05f2){_0x39c578=_0x5d05f2;_0x36ee43[_0xde93('0x32')]=_[_0xde93('0x33')](db[_0xde93('0x53')][_0xde93('0x4c')]);_0x36ee43[_0xde93('0x34')]=_[_0xde93('0x33')](_0x23e12c[_0xde93('0x34')]);_0x36ee43[_0xde93('0x3e')]=_['intersection'](_0x36ee43[_0xde93('0x32')],_0x36ee43[_0xde93('0x34')]);_0x1f9dda[_0xde93('0x36')]=_[_0xde93('0x35')](_0x36ee43['model'],qs[_0xde93('0x37')](_0x23e12c[_0xde93('0x34')][_0xde93('0x37')]));_0x1f9dda['attributes']=_0x1f9dda[_0xde93('0x36')][_0xde93('0x38')]?_0x1f9dda['attributes']:_0x36ee43[_0xde93('0x32')];_0x1f9dda['order']=qs['sort'](_0x23e12c[_0xde93('0x34')][_0xde93('0x3c')]);_0x1f9dda[_0xde93('0x3d')]=qs[_0xde93('0x3e')](_['pick'](_0x23e12c['query'],_0x36ee43['filters']));if(_0x23e12c[_0xde93('0x34')][_0xde93('0x40')]){_0x1f9dda[_0xde93('0x3d')]=_[_0xde93('0x41')](_0x1f9dda[_0xde93('0x3d')],{'$or':_[_0xde93('0x42')](_0x1f9dda[_0xde93('0x36')],function(_0x3b682b){var _0x10efa0={};_0x10efa0[_0x3b682b]={'$like':'%'+_0x23e12c['query']['filter']+'%'};return _0x10efa0;})});}_0x1f9dda=_[_0xde93('0x41')]({},_0x1f9dda,_0x23e12c[_0xde93('0x46')]);return _0x39c578['getFields'](_0x1f9dda);}})['then'](function(_0x4f89a8){if(_0x4f89a8){_0x1595a6=_0x4f89a8['length'];if(!_0x23e12c['query'][_0xde93('0x39')](_0xde93('0x3a'))){_0x1f9dda[_0xde93('0x27')]=qs[_0xde93('0x27')](_0x23e12c[_0xde93('0x34')][_0xde93('0x27')]);_0x1f9dda[_0xde93('0x26')]=qs[_0xde93('0x26')](_0x23e12c[_0xde93('0x34')][_0xde93('0x26')]);}return _0x39c578['getFields'](_0x1f9dda);}})[_0xde93('0x2c')](function(_0x37b96b){if(_0x37b96b){return _0x37b96b?{'count':_0x1595a6,'rows':_0x37b96b}:null;}})[_0xde93('0x2c')](respondWithResult(_0x24d926,null))['catch'](handleError(_0x24d926,null));};exports[_0xde93('0x54')]=function(_0x491196,_0x478a13,_0xa2644e){var _0x570055={};var _0x4d1f41={};var _0x127e09;var _0x2adf5b;return db[_0xde93('0x31')][_0xde93('0x52')]({'where':{'id':_0x491196[_0xde93('0x4b')]['id']}})[_0xde93('0x2c')](handleEntityNotFound(_0x478a13,null))['then'](function(_0x512178){if(_0x512178){_0x127e09=_0x512178;_0x4d1f41[_0xde93('0x32')]=_[_0xde93('0x33')](db['ZohoField'][_0xde93('0x4c')]);_0x4d1f41[_0xde93('0x34')]=_[_0xde93('0x33')](_0x491196[_0xde93('0x34')]);_0x4d1f41['filters']=_['intersection'](_0x4d1f41[_0xde93('0x32')],_0x4d1f41['query']);_0x570055['attributes']=_[_0xde93('0x35')](_0x4d1f41[_0xde93('0x32')],qs['fields'](_0x491196[_0xde93('0x34')]['fields']));_0x570055[_0xde93('0x36')]=_0x570055[_0xde93('0x36')][_0xde93('0x38')]?_0x570055[_0xde93('0x36')]:_0x4d1f41[_0xde93('0x32')];_0x570055[_0xde93('0x3b')]=qs[_0xde93('0x3c')](_0x491196[_0xde93('0x34')][_0xde93('0x3c')]);_0x570055[_0xde93('0x3d')]=qs[_0xde93('0x3e')](_[_0xde93('0x3f')](_0x491196[_0xde93('0x34')],_0x4d1f41[_0xde93('0x3e')]));if(_0x491196['query']['filter']){_0x570055[_0xde93('0x3d')]=_['merge'](_0x570055[_0xde93('0x3d')],{'$or':_[_0xde93('0x42')](_0x570055[_0xde93('0x36')],function(_0x4795a1){var _0x577ac8={};_0x577ac8[_0x4795a1]={'$like':'%'+_0x491196['query']['filter']+'%'};return _0x577ac8;})});}_0x570055=_[_0xde93('0x41')]({},_0x570055,_0x491196[_0xde93('0x46')]);return _0x127e09[_0xde93('0x54')](_0x570055);}})[_0xde93('0x2c')](function(_0x3c624e){if(_0x3c624e){_0x2adf5b=_0x3c624e[_0xde93('0x38')];if(!_0x491196['query'][_0xde93('0x39')](_0xde93('0x3a'))){_0x570055[_0xde93('0x27')]=qs[_0xde93('0x27')](_0x491196['query'][_0xde93('0x27')]);_0x570055['offset']=qs[_0xde93('0x26')](_0x491196['query']['offset']);}return _0x127e09[_0xde93('0x54')](_0x570055);}})[_0xde93('0x2c')](function(_0x3cf463){if(_0x3cf463){return _0x3cf463?{'count':_0x2adf5b,'rows':_0x3cf463}:null;}})[_0xde93('0x2c')](respondWithResult(_0x478a13,null))[_0xde93('0x20')](handleError(_0x478a13,null));};exports[_0xde93('0x55')]=function(_0x2e7145,_0x315d16,_0x279d25){var _0x2ab3fc={};var _0x48b2b9={};var _0x175c59;var _0x385013;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x2e7145[_0xde93('0x4b')]['id']}})['then'](handleEntityNotFound(_0x315d16,null))[_0xde93('0x2c')](function(_0x4e2361){if(_0x4e2361){_0x175c59=_0x4e2361;_0x48b2b9[_0xde93('0x32')]=_['keys'](db[_0xde93('0x53')][_0xde93('0x4c')]);_0x48b2b9[_0xde93('0x34')]=_['keys'](_0x2e7145[_0xde93('0x34')]);_0x48b2b9[_0xde93('0x3e')]=_[_0xde93('0x35')](_0x48b2b9[_0xde93('0x32')],_0x48b2b9[_0xde93('0x34')]);_0x2ab3fc[_0xde93('0x36')]=_[_0xde93('0x35')](_0x48b2b9[_0xde93('0x32')],qs['fields'](_0x2e7145[_0xde93('0x34')][_0xde93('0x37')]));_0x2ab3fc[_0xde93('0x36')]=_0x2ab3fc[_0xde93('0x36')][_0xde93('0x38')]?_0x2ab3fc['attributes']:_0x48b2b9['model'];_0x2ab3fc[_0xde93('0x3b')]=qs['sort'](_0x2e7145[_0xde93('0x34')][_0xde93('0x3c')]);_0x2ab3fc['where']=qs[_0xde93('0x3e')](_[_0xde93('0x3f')](_0x2e7145[_0xde93('0x34')],_0x48b2b9[_0xde93('0x3e')]));if(_0x2e7145['query'][_0xde93('0x40')]){_0x2ab3fc[_0xde93('0x3d')]=_[_0xde93('0x41')](_0x2ab3fc[_0xde93('0x3d')],{'$or':_[_0xde93('0x42')](_0x2ab3fc[_0xde93('0x36')],function(_0x2bd00c){var _0xa584c2={};_0xa584c2[_0x2bd00c]={'$like':'%'+_0x2e7145[_0xde93('0x34')]['filter']+'%'};return _0xa584c2;})});}_0x2ab3fc=_[_0xde93('0x41')]({},_0x2ab3fc,_0x2e7145[_0xde93('0x46')]);return _0x175c59[_0xde93('0x55')](_0x2ab3fc);}})['then'](function(_0x17be88){if(_0x17be88){_0x385013=_0x17be88[_0xde93('0x38')];if(!_0x2e7145['query'][_0xde93('0x39')](_0xde93('0x3a'))){_0x2ab3fc['limit']=qs[_0xde93('0x27')](_0x2e7145[_0xde93('0x34')][_0xde93('0x27')]);_0x2ab3fc[_0xde93('0x26')]=qs[_0xde93('0x26')](_0x2e7145['query']['offset']);}return _0x175c59[_0xde93('0x55')](_0x2ab3fc);}})[_0xde93('0x2c')](function(_0x238f35){if(_0x238f35){return _0x238f35?{'count':_0x385013,'rows':_0x238f35}:null;}})['then'](respondWithResult(_0x315d16,null))['catch'](handleError(_0x315d16,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c72598f..72fb05e 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 _0x9d02=['moment','request-promise','./intZohoConfiguration.attributes','define','lodash','../../config/logger'];(function(_0x31a5ac,_0x37f1af){var _0x47497a=function(_0x5f2a78){while(--_0x5f2a78){_0x31a5ac['push'](_0x31a5ac['shift']());}};_0x47497a(++_0x37f1af);}(_0x9d02,0x118));var _0x29d0=function(_0x3910f8,_0x434d0c){_0x3910f8=_0x3910f8-0x0;var _0x5065d8=_0x9d02[_0x3910f8];return _0x5065d8;};'use strict';var _=require(_0x29d0('0x0'));var util=require('util');var logger=require(_0x29d0('0x1'))('api');var moment=require(_0x29d0('0x2'));var BPromise=require('bluebird');var rp=require(_0x29d0('0x3'));var attributes=require(_0x29d0('0x4'));module['exports']=function(_0x33c00f,_0x2e9e8a){return _0x33c00f[_0x29d0('0x5')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb76=['request-promise','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x22ce3a,_0xf4a6d4){var _0x4be173=function(_0x48acdf){while(--_0x48acdf){_0x22ce3a['push'](_0x22ce3a['shift']());}};_0x4be173(++_0xf4a6d4);}(_0xdb76,0x1be));var _0x6db7=function(_0x53b568,_0x5a1b53){_0x53b568=_0x53b568-0x0;var _0x34fbd8=_0xdb76[_0x53b568];return _0x34fbd8;};'use strict';var _=require(_0x6db7('0x0'));var util=require(_0x6db7('0x1'));var logger=require(_0x6db7('0x2'))(_0x6db7('0x3'));var moment=require(_0x6db7('0x4'));var BPromise=require('bluebird');var rp=require(_0x6db7('0x5'));var attributes=require(_0x6db7('0x6'));module[_0x6db7('0x7')]=function(_0x40f6ce,_0x57a095){return _0x40f6ce[_0x6db7('0x8')](_0x6db7('0x9'),attributes,{'tableName':_0x6db7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index df71673..fcb5dc2 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 _0x4947=['ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring'];(function(_0xbc9917,_0x479324){var _0x20ab5a=function(_0x43951d){while(--_0x43951d){_0xbc9917['push'](_0xbc9917['shift']());}};_0x20ab5a(++_0x479324);}(_0x4947,0xb9));var _0x7494=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x4947[_0x21353c];return _0xa99120;};'use strict';var _=require('lodash');var util=require(_0x7494('0x0'));var moment=require(_0x7494('0x1'));var BPromise=require(_0x7494('0x2'));var rs=require(_0x7494('0x3'));var fs=require('fs');var Redis=require(_0x7494('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7494('0x5'))(_0x7494('0x6'));var config=require('../../config/environment');var jayson=require(_0x7494('0x7'));var client=jayson[_0x7494('0x8')][_0x7494('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8dd7,_0x440329,_0x1cb77a){return new BPromise(function(_0x5483d6,_0x4aa56d){return client[_0x7494('0xa')](_0x3d8dd7,_0x1cb77a)['then'](function(_0x2b8f3c){logger[_0x7494('0xb')](_0x7494('0xc'),_0x440329,_0x7494('0xd'));logger[_0x7494('0xe')](_0x7494('0xf'),_0x440329,_0x7494('0xd'),JSON[_0x7494('0x10')](_0x2b8f3c));if(_0x2b8f3c[_0x7494('0x11')]){if(_0x2b8f3c[_0x7494('0x11')][_0x7494('0x12')]===0x1f4){logger[_0x7494('0x11')](_0x7494('0xc'),_0x440329,_0x2b8f3c[_0x7494('0x11')]['message']);return _0x4aa56d(_0x2b8f3c['error'][_0x7494('0x13')]);}logger['error'](_0x7494('0xc'),_0x440329,_0x2b8f3c[_0x7494('0x11')]['message']);return _0x5483d6(_0x2b8f3c[_0x7494('0x11')][_0x7494('0x13')]);}else{logger[_0x7494('0xb')](_0x7494('0xc'),_0x440329,'request\x20sent');_0x5483d6(_0x2b8f3c[_0x7494('0x14')][_0x7494('0x13')]);}})['catch'](function(_0x2457fb){logger[_0x7494('0x11')](_0x7494('0xc'),_0x440329,_0x2457fb);_0x4aa56d(_0x2457fb);});});} \ No newline at end of file +var _0x0902=['catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x457a96,_0x20d124){var _0x5c7957=function(_0x419b53){while(--_0x419b53){_0x457a96['push'](_0x457a96['shift']());}};_0x5c7957(++_0x20d124);}(_0x0902,0x190));var _0x2090=function(_0x5567cd,_0x35ca37){_0x5567cd=_0x5567cd-0x0;var _0x559621=_0x0902[_0x5567cd];return _0x559621;};'use strict';var _=require(_0x2090('0x0'));var util=require('util');var moment=require(_0x2090('0x1'));var BPromise=require(_0x2090('0x2'));var rs=require(_0x2090('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2090('0x4'));var logger=require(_0x2090('0x5'))(_0x2090('0x6'));var config=require(_0x2090('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2090('0x8')][_0x2090('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x323381,_0xc8e778,_0x126ada){return new BPromise(function(_0x1244cb,_0x1b95c3){return client[_0x2090('0xa')](_0x323381,_0x126ada)[_0x2090('0xb')](function(_0x5fa09){logger['info'](_0x2090('0xc'),_0xc8e778,_0x2090('0xd'));logger['debug'](_0x2090('0xe'),_0xc8e778,'request\x20sent',JSON[_0x2090('0xf')](_0x5fa09));if(_0x5fa09[_0x2090('0x10')]){if(_0x5fa09[_0x2090('0x10')]['code']===0x1f4){logger[_0x2090('0x10')](_0x2090('0xc'),_0xc8e778,_0x5fa09[_0x2090('0x10')][_0x2090('0x11')]);return _0x1b95c3(_0x5fa09[_0x2090('0x10')][_0x2090('0x11')]);}logger[_0x2090('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0xc8e778,_0x5fa09[_0x2090('0x10')][_0x2090('0x11')]);return _0x1244cb(_0x5fa09[_0x2090('0x10')][_0x2090('0x11')]);}else{logger['info'](_0x2090('0xc'),_0xc8e778,_0x2090('0xd'));_0x1244cb(_0x5fa09['result'][_0x2090('0x11')]);}})[_0x2090('0x12')](function(_0x357c1b){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xc8e778,_0x357c1b);_0x1b95c3(_0x357c1b);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index d84b98b..898cfc8 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 _0x43f8=['show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id'];(function(_0x4a63fc,_0x167a02){var _0x30d4c3=function(_0x3eecb2){while(--_0x3eecb2){_0x4a63fc['push'](_0x4a63fc['shift']());}};_0x30d4c3(++_0x167a02);}(_0x43f8,0x195));var _0x843f=function(_0x2e3d56,_0x4fb6ed){_0x2e3d56=_0x2e3d56-0x0;var _0x1815c1=_0x43f8[_0x2e3d56];return _0x1815c1;};'use strict';var multer=require(_0x843f('0x0'));var util=require(_0x843f('0x1'));var path=require(_0x843f('0x2'));var timeout=require(_0x843f('0x3'));var express=require(_0x843f('0x4'));var router=express['Router']();var auth=require(_0x843f('0x5'));var interaction=require(_0x843f('0x6'));var config=require(_0x843f('0x7'));var controller=require(_0x843f('0x8'));router[_0x843f('0x9')]('/',auth[_0x843f('0xa')](),controller[_0x843f('0xb')]);router[_0x843f('0x9')](_0x843f('0xc'),auth[_0x843f('0xa')](),controller[_0x843f('0xd')]);router[_0x843f('0xe')]('/',auth['isAuthenticated'](),controller[_0x843f('0xf')]);router[_0x843f('0x10')]('/:id',auth[_0x843f('0xa')](),controller['update']);router[_0x843f('0x11')](_0x843f('0xc'),auth[_0x843f('0xa')](),controller['destroy']);module[_0x843f('0x12')]=router; \ No newline at end of file +var _0xc8ce=['isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get'];(function(_0x557c0b,_0x50ce81){var _0x5b808e=function(_0x4018b6){while(--_0x4018b6){_0x557c0b['push'](_0x557c0b['shift']());}};_0x5b808e(++_0x50ce81);}(_0xc8ce,0x7f));var _0xec8c=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xc8ce[_0x3b90ab];return _0x206e92;};'use strict';var multer=require(_0xec8c('0x0'));var util=require(_0xec8c('0x1'));var path=require('path');var timeout=require(_0xec8c('0x2'));var express=require(_0xec8c('0x3'));var router=express[_0xec8c('0x4')]();var auth=require(_0xec8c('0x5'));var interaction=require(_0xec8c('0x6'));var config=require('../../config/environment');var controller=require(_0xec8c('0x7'));router[_0xec8c('0x8')]('/',auth[_0xec8c('0x9')](),controller['index']);router[_0xec8c('0x8')](_0xec8c('0xa'),auth[_0xec8c('0x9')](),controller['show']);router['post']('/',auth[_0xec8c('0x9')](),controller[_0xec8c('0xb')]);router[_0xec8c('0xc')](_0xec8c('0xa'),auth[_0xec8c('0x9')](),controller[_0xec8c('0xd')]);router[_0xec8c('0xe')]('/:id',auth[_0xec8c('0x9')](),controller[_0xec8c('0xf')]);module[_0xec8c('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 5d91bb6..b1b7e63 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 _0x5ff3=['STRING','ENUM','variable','exports','string','customVariable','keyValue'];(function(_0x4eec46,_0x513505){var _0x125ca7=function(_0x6cdfb6){while(--_0x6cdfb6){_0x4eec46['push'](_0x4eec46['shift']());}};_0x125ca7(++_0x513505);}(_0x5ff3,0x17d));var _0x35ff=function(_0x4a1903,_0x4b813a){_0x4a1903=_0x4a1903-0x0;var _0x21a686=_0x5ff3[_0x4a1903];return _0x21a686;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'type':{'type':Sequelize['ENUM'](_0x35ff('0x1'),'variable',_0x35ff('0x2'),_0x35ff('0x3')),'defaultValue':_0x35ff('0x1')},'content':{'type':Sequelize[_0x35ff('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x35ff('0x5')](_0x35ff('0x1'),_0x35ff('0x6'),_0x35ff('0x2'))},'keyContent':{'type':Sequelize[_0x35ff('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x35ff('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x35ff('0x4')]}}; \ No newline at end of file +var _0x0713=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x3db122,_0x5e6bee){var _0x325b67=function(_0x5095af){while(--_0x5095af){_0x3db122['push'](_0x3db122['shift']());}};_0x325b67(++_0x5e6bee);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3071('0x5')]},'key':{'type':Sequelize[_0x3071('0x5')]},'keyType':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'))},'keyContent':{'type':Sequelize[_0x3071('0x5')]},'idField':{'type':Sequelize[_0x3071('0x5')]},'nameField':{'type':Sequelize[_0x3071('0x5')]},'customField':{'type':Sequelize[_0x3071('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3071('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index a2bbf25..4e882ce 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 _0x2a58=['reject','save','destroy','then','stack','name','send','index','ZohoField','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','map','type','key','field','filter','options','includeAll','findAll','rows','catch','params','length','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x36b146,_0x1f38b6){var _0x1b3bca=function(_0x237521){while(--_0x237521){_0x36b146['push'](_0x36b146['shift']());}};_0x1b3bca(++_0x1f38b6);}(_0x2a58,0x1d0));var _0x82a5=function(_0x32302b,_0x4bd8c4){_0x32302b=_0x32302b-0x0;var _0x41a2d8=_0x2a58[_0x32302b];return _0x41a2d8;};'use strict';var pdf=require(_0x82a5('0x0'));var emlformat=require(_0x82a5('0x1'));var rimraf=require(_0x82a5('0x2'));var zipdir=require(_0x82a5('0x3'));var jsonpatch=require(_0x82a5('0x4'));var rp=require(_0x82a5('0x5'));var moment=require(_0x82a5('0x6'));var BPromise=require(_0x82a5('0x7'));var Mustache=require('mustache');var util=require(_0x82a5('0x8'));var path=require(_0x82a5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x82a5('0xa'));var fs=require('fs');var _=require(_0x82a5('0xb'));var squel=require(_0x82a5('0xc'));var crypto=require(_0x82a5('0xd'));var jsforce=require(_0x82a5('0xe'));var deskjs=require(_0x82a5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x82a5('0x10'));var Papa=require(_0x82a5('0x11'));var authService=require(_0x82a5('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x82a5('0x13'));var qs=require(_0x82a5('0x14'));var logger=require('../../config/logger')(_0x82a5('0x15'));var utils=require(_0x82a5('0x16'));var config=require(_0x82a5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x323e4f,_0x3eef12){_0x3eef12=_0x3eef12||0xcc;return function(_0x127fea){if(_0x127fea){return _0x323e4f[_0x82a5('0x18')](_0x3eef12);}return _0x323e4f[_0x82a5('0x19')](_0x3eef12)[_0x82a5('0x1a')]();};}function respondWithResult(_0x31fb35,_0x566669){_0x566669=_0x566669||0xc8;return function(_0x3d8ff2){if(_0x3d8ff2){return _0x31fb35[_0x82a5('0x19')](_0x566669)[_0x82a5('0x1b')](_0x3d8ff2);}};}function respondWithFilteredResult(_0x26784e,_0x5231c1){return function(_0x407f31){if(_0x407f31){var _0x15257a=_0x407f31[_0x82a5('0x1c')],_0x4e103a=_0x5231c1[_0x82a5('0x1d')],_0xaafbe6=_0x5231c1[_0x82a5('0x1d')]+_0x5231c1[_0x82a5('0x1e')],_0xd147e8;if(_0xaafbe6>=_0x15257a){_0xaafbe6=_0x15257a;_0xd147e8=0xc8;}else{_0xd147e8=0xce;}_0x26784e[_0x82a5('0x19')](_0xd147e8);return _0x26784e[_0x82a5('0x1f')](_0x82a5('0x20'),_0x4e103a+'-'+_0xaafbe6+'/'+_0x15257a)[_0x82a5('0x1b')](_0x407f31);}return null;};}function patchUpdates(_0x4bb339){return function(_0x1cbdf2){try{jsonpatch['apply'](_0x1cbdf2,_0x4bb339,!![]);}catch(_0x1285aa){return BPromise[_0x82a5('0x21')](_0x1285aa);}return _0x1cbdf2[_0x82a5('0x22')]();};}function saveUpdates(_0x54d7a6,_0x5bbaba){return function(_0x53fceb){if(_0x53fceb){return _0x53fceb['update'](_0x54d7a6)['then'](function(_0x479afb){return _0x479afb;});}return null;};}function removeEntity(_0x4821d4,_0x2b7e56){return function(_0x1481fa){if(_0x1481fa){return _0x1481fa[_0x82a5('0x23')]()[_0x82a5('0x24')](function(){_0x4821d4[_0x82a5('0x19')](0xcc)[_0x82a5('0x1a')]();});}};}function handleEntityNotFound(_0x3ccf0b,_0x3fcfa2){return function(_0x36b8f1){if(!_0x36b8f1){_0x3ccf0b[_0x82a5('0x18')](0x194);}return _0x36b8f1;};}function handleError(_0x506183,_0xc51dd6){_0xc51dd6=_0xc51dd6||0x1f4;return function(_0x342d75){logger['error'](_0x342d75[_0x82a5('0x25')]);if(_0x342d75[_0x82a5('0x26')]){delete _0x342d75[_0x82a5('0x26')];}_0x506183['status'](_0xc51dd6)[_0x82a5('0x27')](_0x342d75);};}exports[_0x82a5('0x28')]=function(_0x119be0,_0x3bb13a){var _0x28a130={},_0x5aad24={},_0x2ff206={'count':0x0,'rows':[]};var _0x2ea2ef=db[_0x82a5('0x29')]['rawAttributes'];_0x5aad24[_0x82a5('0x2a')]=_[_0x82a5('0x2b')](_0x2ea2ef);_0x5aad24[_0x82a5('0x2c')]=_[_0x82a5('0x2b')](_0x119be0[_0x82a5('0x2c')]);_0x5aad24[_0x82a5('0x2d')]=_[_0x82a5('0x2e')](_0x5aad24[_0x82a5('0x2a')],_0x5aad24['query']);_0x28a130[_0x82a5('0x2f')]=_[_0x82a5('0x2e')](_0x5aad24[_0x82a5('0x2a')],qs['fields'](_0x119be0[_0x82a5('0x2c')][_0x82a5('0x30')]));_0x28a130[_0x82a5('0x2f')]=_0x28a130[_0x82a5('0x2f')]['length']?_0x28a130[_0x82a5('0x2f')]:_0x5aad24[_0x82a5('0x2a')];if(!_0x119be0[_0x82a5('0x2c')][_0x82a5('0x31')](_0x82a5('0x32'))){_0x28a130['limit']=qs[_0x82a5('0x1e')](_0x119be0[_0x82a5('0x2c')][_0x82a5('0x1e')]);_0x28a130[_0x82a5('0x1d')]=qs[_0x82a5('0x1d')](_0x119be0[_0x82a5('0x2c')][_0x82a5('0x1d')]);}_0x28a130[_0x82a5('0x33')]=qs['sort'](_0x119be0['query']['sort']);_0x28a130[_0x82a5('0x34')]=qs[_0x82a5('0x2d')](_[_0x82a5('0x35')](_0x119be0[_0x82a5('0x2c')],_0x5aad24['filters']));if(_0x119be0[_0x82a5('0x2c')]['filter']){_0x28a130[_0x82a5('0x34')]=_[_0x82a5('0x36')](_0x28a130[_0x82a5('0x34')],{'$or':_[_0x82a5('0x37')](_0x2ea2ef,function(_0x2531d2){if(_0x2531d2[_0x82a5('0x38')][_0x82a5('0x39')]!=='VIRTUAL'){var _0xf688b4={};_0xf688b4[_0x2531d2[_0x82a5('0x3a')]]={'$like':'%'+_0x119be0['query'][_0x82a5('0x3b')]+'%'};return _0xf688b4;}})});}_0x28a130=_['merge']({},_0x28a130,_0x119be0[_0x82a5('0x3c')]);var _0x2ade4b={'where':_0x28a130[_0x82a5('0x34')]};return db[_0x82a5('0x29')][_0x82a5('0x1c')](_0x2ade4b)['then'](function(_0x4a66e6){_0x2ff206[_0x82a5('0x1c')]=_0x4a66e6;if(_0x119be0[_0x82a5('0x2c')][_0x82a5('0x3d')]){_0x28a130['include']=[{'all':!![]}];}return db[_0x82a5('0x29')][_0x82a5('0x3e')](_0x28a130);})[_0x82a5('0x24')](function(_0x233ccb){_0x2ff206[_0x82a5('0x3f')]=_0x233ccb;return _0x2ff206;})['then'](respondWithFilteredResult(_0x3bb13a,_0x28a130))[_0x82a5('0x40')](handleError(_0x3bb13a,null));};exports['show']=function(_0x3d0b60,_0x3a7bc7){var _0x2abbc1={'raw':!![],'where':{'id':_0x3d0b60[_0x82a5('0x41')]['id']}},_0x12193d={};_0x12193d[_0x82a5('0x2a')]=_[_0x82a5('0x2b')](db[_0x82a5('0x29')]['rawAttributes']);_0x12193d[_0x82a5('0x2c')]=_[_0x82a5('0x2b')](_0x3d0b60[_0x82a5('0x2c')]);_0x12193d[_0x82a5('0x2d')]=_[_0x82a5('0x2e')](_0x12193d[_0x82a5('0x2a')],_0x12193d[_0x82a5('0x2c')]);_0x2abbc1[_0x82a5('0x2f')]=_[_0x82a5('0x2e')](_0x12193d['model'],qs[_0x82a5('0x30')](_0x3d0b60[_0x82a5('0x2c')]['fields']));_0x2abbc1['attributes']=_0x2abbc1[_0x82a5('0x2f')][_0x82a5('0x42')]?_0x2abbc1[_0x82a5('0x2f')]:_0x12193d['model'];if(_0x3d0b60[_0x82a5('0x2c')]['includeAll']){_0x2abbc1['include']=[{'all':!![]}];}_0x2abbc1=_[_0x82a5('0x36')]({},_0x2abbc1,_0x3d0b60['options']);return db['ZohoField'][_0x82a5('0x43')](_0x2abbc1)['then'](handleEntityNotFound(_0x3a7bc7,null))[_0x82a5('0x24')](respondWithResult(_0x3a7bc7,null))[_0x82a5('0x40')](handleError(_0x3a7bc7,null));};exports['create']=function(_0xca8c8,_0x21409c){return db[_0x82a5('0x29')][_0x82a5('0x44')](_0xca8c8[_0x82a5('0x45')],{})[_0x82a5('0x24')](respondWithResult(_0x21409c,0xc9))['catch'](handleError(_0x21409c,null));};exports[_0x82a5('0x46')]=function(_0x19a560,_0x17dae2){if(_0x19a560[_0x82a5('0x45')]['id']){delete _0x19a560['body']['id'];}return db['ZohoField']['find']({'where':{'id':_0x19a560[_0x82a5('0x41')]['id']}})[_0x82a5('0x24')](handleEntityNotFound(_0x17dae2,null))[_0x82a5('0x24')](saveUpdates(_0x19a560[_0x82a5('0x45')],null))['then'](respondWithResult(_0x17dae2,null))[_0x82a5('0x40')](handleError(_0x17dae2,null));};exports[_0x82a5('0x23')]=function(_0x173f41,_0x5dab63){return db[_0x82a5('0x29')][_0x82a5('0x43')]({'where':{'id':_0x173f41['params']['id']}})['then'](handleEntityNotFound(_0x5dab63,null))['then'](removeEntity(_0x5dab63,null))[_0x82a5('0x40')](handleError(_0x5dab63,null));}; \ No newline at end of file +var _0x846f=['filter','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','set','json','reject','save','destroy','end','sendStatus','error','stack','name','index','ZohoField','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','merge','map','type','VIRTUAL','field'];(function(_0x4ab944,_0x9a7414){var _0x41195f=function(_0x565019){while(--_0x565019){_0x4ab944['push'](_0x4ab944['shift']());}};_0x41195f(++_0x9a7414);}(_0x846f,0x93));var _0xf846=function(_0x2c4972,_0x47408c){_0x2c4972=_0x2c4972-0x0;var _0xa69368=_0x846f[_0x2c4972];return _0xa69368;};'use strict';var pdf=require(_0xf846('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf846('0x1'));var zipdir=require(_0xf846('0x2'));var jsonpatch=require(_0xf846('0x3'));var rp=require('request-promise');var moment=require(_0xf846('0x4'));var BPromise=require(_0xf846('0x5'));var Mustache=require(_0xf846('0x6'));var util=require(_0xf846('0x7'));var path=require(_0xf846('0x8'));var sox=require('sox');var csv=require(_0xf846('0x9'));var ejs=require(_0xf846('0xa'));var fs=require('fs');var _=require(_0xf846('0xb'));var squel=require(_0xf846('0xc'));var crypto=require(_0xf846('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf846('0x9'));var querystring=require(_0xf846('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xf846('0xf'));var logger=require(_0xf846('0x10'))('api');var utils=require(_0xf846('0x11'));var config=require(_0xf846('0x12'));var db=require(_0xf846('0x13'))['db'];function respondWithStatusCode(_0x208d42,_0x1f11d7){_0x1f11d7=_0x1f11d7||0xcc;return function(_0x28e634){if(_0x28e634){return _0x208d42['sendStatus'](_0x1f11d7);}return _0x208d42[_0xf846('0x14')](_0x1f11d7)['end']();};}function respondWithResult(_0x4d1f44,_0x547625){_0x547625=_0x547625||0xc8;return function(_0x81f7cd){if(_0x81f7cd){return _0x4d1f44[_0xf846('0x14')](_0x547625)['json'](_0x81f7cd);}};}function respondWithFilteredResult(_0x423faf,_0x5e4d51){return function(_0x548fbf){if(_0x548fbf){var _0x4cb115=_0x548fbf[_0xf846('0x15')],_0x59fe82=_0x5e4d51[_0xf846('0x16')],_0x1e3c2b=_0x5e4d51[_0xf846('0x16')]+_0x5e4d51['limit'],_0x3f2155;if(_0x1e3c2b>=_0x4cb115){_0x1e3c2b=_0x4cb115;_0x3f2155=0xc8;}else{_0x3f2155=0xce;}_0x423faf['status'](_0x3f2155);return _0x423faf[_0xf846('0x17')]('Content-Range',_0x59fe82+'-'+_0x1e3c2b+'/'+_0x4cb115)[_0xf846('0x18')](_0x548fbf);}return null;};}function patchUpdates(_0x5952fe){return function(_0x41618f){try{jsonpatch['apply'](_0x41618f,_0x5952fe,!![]);}catch(_0x20e95e){return BPromise[_0xf846('0x19')](_0x20e95e);}return _0x41618f[_0xf846('0x1a')]();};}function saveUpdates(_0x585a51,_0xfba07){return function(_0x26a976){if(_0x26a976){return _0x26a976['update'](_0x585a51)['then'](function(_0x50f244){return _0x50f244;});}return null;};}function removeEntity(_0x45d0a3,_0x5f0321){return function(_0x300e11){if(_0x300e11){return _0x300e11[_0xf846('0x1b')]()['then'](function(){_0x45d0a3['status'](0xcc)[_0xf846('0x1c')]();});}};}function handleEntityNotFound(_0x123d2d,_0x32a00d){return function(_0x5d18a9){if(!_0x5d18a9){_0x123d2d[_0xf846('0x1d')](0x194);}return _0x5d18a9;};}function handleError(_0x185d93,_0x24b224){_0x24b224=_0x24b224||0x1f4;return function(_0x54be15){logger[_0xf846('0x1e')](_0x54be15[_0xf846('0x1f')]);if(_0x54be15[_0xf846('0x20')]){delete _0x54be15[_0xf846('0x20')];}_0x185d93[_0xf846('0x14')](_0x24b224)['send'](_0x54be15);};}exports[_0xf846('0x21')]=function(_0x575ddb,_0x13fc54){var _0x5dca86={},_0xee0bcf={},_0x348fea={'count':0x0,'rows':[]};var _0x5b594f=db[_0xf846('0x22')][_0xf846('0x23')];_0xee0bcf['model']=_[_0xf846('0x24')](_0x5b594f);_0xee0bcf['query']=_[_0xf846('0x24')](_0x575ddb[_0xf846('0x25')]);_0xee0bcf[_0xf846('0x26')]=_['intersection'](_0xee0bcf[_0xf846('0x27')],_0xee0bcf[_0xf846('0x25')]);_0x5dca86[_0xf846('0x28')]=_[_0xf846('0x29')](_0xee0bcf[_0xf846('0x27')],qs[_0xf846('0x2a')](_0x575ddb['query'][_0xf846('0x2a')]));_0x5dca86[_0xf846('0x28')]=_0x5dca86[_0xf846('0x28')][_0xf846('0x2b')]?_0x5dca86[_0xf846('0x28')]:_0xee0bcf[_0xf846('0x27')];if(!_0x575ddb[_0xf846('0x25')][_0xf846('0x2c')]('nolimit')){_0x5dca86['limit']=qs[_0xf846('0x2d')](_0x575ddb['query']['limit']);_0x5dca86[_0xf846('0x16')]=qs[_0xf846('0x16')](_0x575ddb['query'][_0xf846('0x16')]);}_0x5dca86[_0xf846('0x2e')]=qs[_0xf846('0x2f')](_0x575ddb[_0xf846('0x25')][_0xf846('0x2f')]);_0x5dca86[_0xf846('0x30')]=qs['filters'](_['pick'](_0x575ddb[_0xf846('0x25')],_0xee0bcf[_0xf846('0x26')]));if(_0x575ddb[_0xf846('0x25')]['filter']){_0x5dca86['where']=_[_0xf846('0x31')](_0x5dca86[_0xf846('0x30')],{'$or':_[_0xf846('0x32')](_0x5b594f,function(_0x182a0a){if(_0x182a0a[_0xf846('0x33')]['key']!==_0xf846('0x34')){var _0x422620={};_0x422620[_0x182a0a[_0xf846('0x35')]]={'$like':'%'+_0x575ddb['query'][_0xf846('0x36')]+'%'};return _0x422620;}})});}_0x5dca86=_[_0xf846('0x31')]({},_0x5dca86,_0x575ddb[_0xf846('0x37')]);var _0x15ea4c={'where':_0x5dca86[_0xf846('0x30')]};return db[_0xf846('0x22')][_0xf846('0x15')](_0x15ea4c)[_0xf846('0x38')](function(_0x1a540a){_0x348fea[_0xf846('0x15')]=_0x1a540a;if(_0x575ddb['query'][_0xf846('0x39')]){_0x5dca86[_0xf846('0x3a')]=[{'all':!![]}];}return db[_0xf846('0x22')][_0xf846('0x3b')](_0x5dca86);})['then'](function(_0x3085e9){_0x348fea[_0xf846('0x3c')]=_0x3085e9;return _0x348fea;})[_0xf846('0x38')](respondWithFilteredResult(_0x13fc54,_0x5dca86))[_0xf846('0x3d')](handleError(_0x13fc54,null));};exports[_0xf846('0x3e')]=function(_0x39fd69,_0xfafba){var _0x232718={'raw':!![],'where':{'id':_0x39fd69[_0xf846('0x3f')]['id']}},_0x477be3={};_0x477be3[_0xf846('0x27')]=_['keys'](db['ZohoField'][_0xf846('0x23')]);_0x477be3[_0xf846('0x25')]=_['keys'](_0x39fd69[_0xf846('0x25')]);_0x477be3[_0xf846('0x26')]=_['intersection'](_0x477be3[_0xf846('0x27')],_0x477be3[_0xf846('0x25')]);_0x232718[_0xf846('0x28')]=_['intersection'](_0x477be3[_0xf846('0x27')],qs[_0xf846('0x2a')](_0x39fd69[_0xf846('0x25')][_0xf846('0x2a')]));_0x232718['attributes']=_0x232718[_0xf846('0x28')]['length']?_0x232718['attributes']:_0x477be3[_0xf846('0x27')];if(_0x39fd69[_0xf846('0x25')]['includeAll']){_0x232718[_0xf846('0x3a')]=[{'all':!![]}];}_0x232718=_['merge']({},_0x232718,_0x39fd69[_0xf846('0x37')]);return db[_0xf846('0x22')][_0xf846('0x40')](_0x232718)['then'](handleEntityNotFound(_0xfafba,null))[_0xf846('0x38')](respondWithResult(_0xfafba,null))['catch'](handleError(_0xfafba,null));};exports[_0xf846('0x41')]=function(_0x34bee6,_0x444314){return db[_0xf846('0x22')]['create'](_0x34bee6[_0xf846('0x42')],{})[_0xf846('0x38')](respondWithResult(_0x444314,0xc9))['catch'](handleError(_0x444314,null));};exports['update']=function(_0x1c2934,_0x535aa2){if(_0x1c2934['body']['id']){delete _0x1c2934['body']['id'];}return db['ZohoField'][_0xf846('0x40')]({'where':{'id':_0x1c2934['params']['id']}})[_0xf846('0x38')](handleEntityNotFound(_0x535aa2,null))[_0xf846('0x38')](saveUpdates(_0x1c2934[_0xf846('0x42')],null))[_0xf846('0x38')](respondWithResult(_0x535aa2,null))['catch'](handleError(_0x535aa2,null));};exports[_0xf846('0x1b')]=function(_0x44cfb8,_0x271afc){return db['ZohoField']['find']({'where':{'id':_0x44cfb8[_0xf846('0x3f')]['id']}})[_0xf846('0x38')](handleEntityNotFound(_0x271afc,null))[_0xf846('0x38')](removeEntity(_0x271afc,null))[_0xf846('0x3d')](handleError(_0x271afc,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 98066f9..9432eff 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 _0x8d59=['util','../../config/logger','api','moment','bluebird','request-promise','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash'];(function(_0x44a4f9,_0x2fad3e){var _0x4136bf=function(_0x98ab3){while(--_0x98ab3){_0x44a4f9['push'](_0x44a4f9['shift']());}};_0x4136bf(++_0x2fad3e);}(_0x8d59,0x109));var _0x98d5=function(_0x234bf7,_0x41c898){_0x234bf7=_0x234bf7-0x0;var _0x4d232a=_0x8d59[_0x234bf7];return _0x4d232a;};'use strict';var _=require(_0x98d5('0x0'));var util=require(_0x98d5('0x1'));var logger=require(_0x98d5('0x2'))(_0x98d5('0x3'));var moment=require(_0x98d5('0x4'));var BPromise=require(_0x98d5('0x5'));var rp=require(_0x98d5('0x6'));var attributes=require(_0x98d5('0x7'));module[_0x98d5('0x8')]=function(_0x115abf,_0x336e5b){return _0x115abf[_0x98d5('0x9')](_0x98d5('0xa'),attributes,{'tableName':_0x98d5('0xb'),'paranoid':![],'indexes':[{'name':_0x98d5('0xc'),'fields':[_0x98d5('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x05bf=['../../config/logger','api','moment','bluebird','request-promise','./intZohoField.attributes','exports','define','zoho_unique_index','lodash','util'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x05bf,0xe5));var _0xf05b=function(_0x59ea68,_0x138227){_0x59ea68=_0x59ea68-0x0;var _0x214e13=_0x05bf[_0x59ea68];return _0x214e13;};'use strict';var _=require(_0xf05b('0x0'));var util=require(_0xf05b('0x1'));var logger=require(_0xf05b('0x2'))(_0xf05b('0x3'));var moment=require(_0xf05b('0x4'));var BPromise=require(_0xf05b('0x5'));var rp=require(_0xf05b('0x6'));var attributes=require(_0xf05b('0x7'));module[_0xf05b('0x8')]=function(_0x236984,_0x58ad59){return _0x236984[_0xf05b('0x9')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xf05b('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index dc1ee98..d8ca56d 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 _0xdc33=['../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3397f8,_0x1020d2){var _0x955006=function(_0x203892){while(--_0x203892){_0x3397f8['push'](_0x3397f8['shift']());}};_0x955006(++_0x1020d2);}(_0xdc33,0x78));var _0x3dc3=function(_0xa39674,_0x531422){_0xa39674=_0xa39674-0x0;var _0x21730d=_0xdc33[_0xa39674];return _0x21730d;};'use strict';var _=require(_0x3dc3('0x0'));var util=require('util');var moment=require(_0x3dc3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3dc3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3dc3('0x3'));var logger=require(_0x3dc3('0x4'))(_0x3dc3('0x5'));var config=require(_0x3dc3('0x6'));var jayson=require(_0x3dc3('0x7'));var client=jayson[_0x3dc3('0x8')][_0x3dc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x499fe0,_0x1da375,_0x5be8f3){return new BPromise(function(_0x223533,_0x34f161){return client[_0x3dc3('0xa')](_0x499fe0,_0x5be8f3)['then'](function(_0x203bd5){logger[_0x3dc3('0xb')](_0x3dc3('0xc'),_0x1da375,_0x3dc3('0xd'));logger[_0x3dc3('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1da375,_0x3dc3('0xd'),JSON[_0x3dc3('0xf')](_0x203bd5));if(_0x203bd5[_0x3dc3('0x10')]){if(_0x203bd5['error'][_0x3dc3('0x11')]===0x1f4){logger[_0x3dc3('0x10')](_0x3dc3('0xc'),_0x1da375,_0x203bd5[_0x3dc3('0x10')][_0x3dc3('0x12')]);return _0x34f161(_0x203bd5[_0x3dc3('0x10')][_0x3dc3('0x12')]);}logger[_0x3dc3('0x10')](_0x3dc3('0xc'),_0x1da375,_0x203bd5[_0x3dc3('0x10')][_0x3dc3('0x12')]);return _0x223533(_0x203bd5['error'][_0x3dc3('0x12')]);}else{logger[_0x3dc3('0xb')](_0x3dc3('0xc'),_0x1da375,_0x3dc3('0xd'));_0x223533(_0x203bd5[_0x3dc3('0x13')][_0x3dc3('0x12')]);}})[_0x3dc3('0x14')](function(_0x21a604){logger['error'](_0x3dc3('0xc'),_0x1da375,_0x21a604);_0x34f161(_0x21a604);});});} \ No newline at end of file +var _0xa301=['ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x1d0d23,_0x43e210){var _0x2d295b=function(_0x214774){while(--_0x214774){_0x1d0d23['push'](_0x1d0d23['shift']());}};_0x2d295b(++_0x43e210);}(_0xa301,0x147));var _0x1a30=function(_0xc7a334,_0x4ebd91){_0xc7a334=_0xc7a334-0x0;var _0x50b89e=_0xa301[_0xc7a334];return _0x50b89e;};'use strict';var _=require(_0x1a30('0x0'));var util=require(_0x1a30('0x1'));var moment=require('moment');var BPromise=require(_0x1a30('0x2'));var rs=require(_0x1a30('0x3'));var fs=require('fs');var Redis=require(_0x1a30('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a30('0x5'));var logger=require(_0x1a30('0x6'))(_0x1a30('0x7'));var config=require(_0x1a30('0x8'));var jayson=require(_0x1a30('0x9'));var client=jayson[_0x1a30('0xa')][_0x1a30('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1438e2,_0x8d1e2,_0x522a92){return new BPromise(function(_0x548d98,_0x4c13a9){return client['request'](_0x1438e2,_0x522a92)['then'](function(_0x5a2b6f){logger[_0x1a30('0xc')](_0x1a30('0xd'),_0x8d1e2,_0x1a30('0xe'));logger['debug'](_0x1a30('0xf'),_0x8d1e2,_0x1a30('0xe'),JSON['stringify'](_0x5a2b6f));if(_0x5a2b6f['error']){if(_0x5a2b6f[_0x1a30('0x10')][_0x1a30('0x11')]===0x1f4){logger[_0x1a30('0x10')](_0x1a30('0xd'),_0x8d1e2,_0x5a2b6f['error'][_0x1a30('0x12')]);return _0x4c13a9(_0x5a2b6f['error'][_0x1a30('0x12')]);}logger[_0x1a30('0x10')](_0x1a30('0xd'),_0x8d1e2,_0x5a2b6f[_0x1a30('0x10')][_0x1a30('0x12')]);return _0x548d98(_0x5a2b6f[_0x1a30('0x10')]['message']);}else{logger[_0x1a30('0xc')](_0x1a30('0xd'),_0x8d1e2,_0x1a30('0xe'));_0x548d98(_0x5a2b6f['result']['message']);}})['catch'](function(_0x21338b){logger['error'](_0x1a30('0xd'),_0x8d1e2,_0x21338b);_0x4c13a9(_0x21338b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 9f503d3..8710db1 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 _0xed1c=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4b1984,_0x547455){var _0x1328ce=function(_0x5b4c70){while(--_0x5b4c70){_0x4b1984['push'](_0x4b1984['shift']());}};_0x1328ce(++_0x547455);}(_0xed1c,0xe4));var _0xced1=function(_0x505218,_0x5b1436){_0x505218=_0x505218-0x0;var _0x24b683=_0xed1c[_0x505218];return _0x24b683;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xced1('0x2'));var interaction=require(_0xced1('0x3'));var config=require(_0xced1('0x4'));module['exports']=router; \ No newline at end of file +var _0xd916=['../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout','express'];(function(_0x2fc863,_0x1c7683){var _0x309a6c=function(_0x32c8fe){while(--_0x32c8fe){_0x2fc863['push'](_0x2fc863['shift']());}};_0x309a6c(++_0x1c7683);}(_0xd916,0x18a));var _0x6d91=function(_0x176730,_0xbc6b62){_0x176730=_0x176730-0x0;var _0x52be5a=_0xd916[_0x176730];return _0x52be5a;};'use strict';var multer=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var path=require(_0x6d91('0x2'));var timeout=require(_0x6d91('0x3'));var express=require(_0x6d91('0x4'));var router=express['Router']();var auth=require(_0x6d91('0x5'));var interaction=require(_0x6d91('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 49b8afe..b88de76 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 _0x668a=['sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x23785c,_0x1c6e72){var _0x2dc080=function(_0x353f41){while(--_0x353f41){_0x23785c['push'](_0x23785c['shift']());}};_0x2dc080(++_0x1c6e72);}(_0x668a,0x1a4));var _0xa668=function(_0x24bdd4,_0x49bcee){_0x24bdd4=_0x24bdd4-0x0;var _0x557b68=_0x668a[_0x24bdd4];return _0x557b68;};'use strict';var Sequelize=require(_0xa668('0x0'));module['exports']={'name':{'type':Sequelize[_0xa668('0x1')],'allowNull':![],'unique':_0xa668('0x2')},'version':{'type':Sequelize[_0xa668('0x1')],'allowNull':![],'unique':_0xa668('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xa668('0x3')},'filename':{'type':Sequelize[_0xa668('0x1')]},'path':{'type':Sequelize[_0xa668('0x1')]},'type':{'type':Sequelize[_0xa668('0x1')]},'size':{'type':Sequelize[_0xa668('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xa668('0x1')]},'logo':{'type':Sequelize[_0xa668('0x1')]},'state':{'type':Sequelize[_0xa668('0x1')],'unique':'state'},'description':{'type':Sequelize[_0xa668('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xa668('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x4b64=['INTEGER','BOOLEAN','state','exports','STRING','unique_name_and_version','app.js'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x4b64,0x122));var _0x44b6=function(_0x13c1ec,_0x31fe45){_0x13c1ec=_0x13c1ec-0x0;var _0x3df630=_0x4b64[_0x13c1ec];return _0x3df630;};'use strict';var Sequelize=require('sequelize');module[_0x44b6('0x0')]={'name':{'type':Sequelize[_0x44b6('0x1')],'allowNull':![],'unique':_0x44b6('0x2')},'version':{'type':Sequelize[_0x44b6('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x44b6('0x1')],'defaultValue':_0x44b6('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x44b6('0x1')]},'type':{'type':Sequelize[_0x44b6('0x1')]},'size':{'type':Sequelize[_0x44b6('0x4')]},'active':{'type':Sequelize[_0x44b6('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x44b6('0x1')]},'logo':{'type':Sequelize[_0x44b6('0x1')]},'state':{'type':Sequelize[_0x44b6('0x1')],'unique':_0x44b6('0x6')},'description':{'type':Sequelize[_0x44b6('0x1')]},'title':{'type':Sequelize[_0x44b6('0x1')]},'remoteUri':{'type':Sequelize[_0x44b6('0x1')]},'link':{'type':Sequelize[_0x44b6('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 86c34f0..ddb28af 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 _0xac35=['nolimit','limit','order','sort','pick','where','type','key','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','Integration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xac35,0x141));var _0x5ac3=function(_0x584667,_0x494c5f){_0x584667=_0x584667-0x0;var _0x1393ed=_0xac35[_0x584667];return _0x1393ed;};'use strict';var pdf=require(_0x5ac3('0x0'));var emlformat=require(_0x5ac3('0x1'));var rimraf=require(_0x5ac3('0x2'));var zipdir=require(_0x5ac3('0x3'));var jsonpatch=require(_0x5ac3('0x4'));var rp=require(_0x5ac3('0x5'));var moment=require(_0x5ac3('0x6'));var BPromise=require(_0x5ac3('0x7'));var Mustache=require(_0x5ac3('0x8'));var util=require(_0x5ac3('0x9'));var path=require(_0x5ac3('0xa'));var sox=require(_0x5ac3('0xb'));var csv=require(_0x5ac3('0xc'));var ejs=require(_0x5ac3('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5ac3('0xe'));var crypto=require('crypto');var jsforce=require(_0x5ac3('0xf'));var deskjs=require(_0x5ac3('0x10'));var toCsv=require(_0x5ac3('0xc'));var querystring=require(_0x5ac3('0x11'));var Papa=require(_0x5ac3('0x12'));var authService=require(_0x5ac3('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5ac3('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0x5ac3('0x15'))(_0x5ac3('0x16'));var utils=require(_0x5ac3('0x17'));var config=require(_0x5ac3('0x18'));var db=require(_0x5ac3('0x19'))['db'];function respondWithStatusCode(_0x43e407,_0x963aa5){_0x963aa5=_0x963aa5||0xcc;return function(_0x5921c6){if(_0x5921c6){return _0x43e407[_0x5ac3('0x1a')](_0x963aa5);}return _0x43e407[_0x5ac3('0x1b')](_0x963aa5)[_0x5ac3('0x1c')]();};}function respondWithResult(_0x1192d6,_0x297c33){_0x297c33=_0x297c33||0xc8;return function(_0x24ed02){if(_0x24ed02){return _0x1192d6[_0x5ac3('0x1b')](_0x297c33)[_0x5ac3('0x1d')](_0x24ed02);}};}function respondWithFilteredResult(_0x5b64a8,_0x585770){return function(_0x3926d0){if(_0x3926d0){var _0x388da8=_0x3926d0[_0x5ac3('0x1e')],_0x516c97=_0x585770[_0x5ac3('0x1f')],_0x2eec4a=_0x585770[_0x5ac3('0x1f')]+_0x585770['limit'],_0x4b718a;if(_0x2eec4a>=_0x388da8){_0x2eec4a=_0x388da8;_0x4b718a=0xc8;}else{_0x4b718a=0xce;}_0x5b64a8[_0x5ac3('0x1b')](_0x4b718a);return _0x5b64a8[_0x5ac3('0x20')](_0x5ac3('0x21'),_0x516c97+'-'+_0x2eec4a+'/'+_0x388da8)[_0x5ac3('0x1d')](_0x3926d0);}return null;};}function patchUpdates(_0x5aab00){return function(_0x22907d){try{jsonpatch[_0x5ac3('0x22')](_0x22907d,_0x5aab00,!![]);}catch(_0x16ca9a){return BPromise[_0x5ac3('0x23')](_0x16ca9a);}return _0x22907d[_0x5ac3('0x24')]();};}function saveUpdates(_0xeb7dea,_0x2039b1){return function(_0x2fcc26){if(_0x2fcc26){return _0x2fcc26[_0x5ac3('0x25')](_0xeb7dea)[_0x5ac3('0x26')](function(_0xe65817){return _0xe65817;});}return null;};}function removeEntity(_0x38486d,_0x579d76){return function(_0x462b1d){if(_0x462b1d){return _0x462b1d[_0x5ac3('0x27')]()[_0x5ac3('0x26')](function(){_0x38486d[_0x5ac3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11915f,_0x1e28f6){return function(_0x2aa7c9){if(!_0x2aa7c9){_0x11915f[_0x5ac3('0x1a')](0x194);}return _0x2aa7c9;};}function handleError(_0x5ec3fc,_0x1eb39c){_0x1eb39c=_0x1eb39c||0x1f4;return function(_0x567807){logger[_0x5ac3('0x28')](_0x567807['stack']);if(_0x567807['name']){delete _0x567807[_0x5ac3('0x29')];}_0x5ec3fc[_0x5ac3('0x1b')](_0x1eb39c)['send'](_0x567807);};}exports[_0x5ac3('0x2a')]=function(_0x3912f6,_0x2fd301){var _0x1f563e={},_0x4af783={},_0x452519={'count':0x0,'rows':[]};var _0x228deb=db[_0x5ac3('0x2b')][_0x5ac3('0x2c')];_0x4af783[_0x5ac3('0x2d')]=_[_0x5ac3('0x2e')](_0x228deb);_0x4af783[_0x5ac3('0x2f')]=_['keys'](_0x3912f6[_0x5ac3('0x2f')]);_0x4af783[_0x5ac3('0x30')]=_[_0x5ac3('0x31')](_0x4af783['model'],_0x4af783[_0x5ac3('0x2f')]);_0x1f563e[_0x5ac3('0x32')]=_[_0x5ac3('0x31')](_0x4af783['model'],qs[_0x5ac3('0x33')](_0x3912f6['query'][_0x5ac3('0x33')]));_0x1f563e['attributes']=_0x1f563e[_0x5ac3('0x32')][_0x5ac3('0x34')]?_0x1f563e['attributes']:_0x4af783['model'];if(!_0x3912f6['query'][_0x5ac3('0x35')](_0x5ac3('0x36'))){_0x1f563e['limit']=qs[_0x5ac3('0x37')](_0x3912f6[_0x5ac3('0x2f')][_0x5ac3('0x37')]);_0x1f563e[_0x5ac3('0x1f')]=qs[_0x5ac3('0x1f')](_0x3912f6[_0x5ac3('0x2f')]['offset']);}_0x1f563e[_0x5ac3('0x38')]=qs[_0x5ac3('0x39')](_0x3912f6[_0x5ac3('0x2f')][_0x5ac3('0x39')]);_0x1f563e['where']=qs['filters'](_[_0x5ac3('0x3a')](_0x3912f6['query'],_0x4af783[_0x5ac3('0x30')]));if(_0x3912f6[_0x5ac3('0x2f')]['filter']){_0x1f563e[_0x5ac3('0x3b')]=_['merge'](_0x1f563e[_0x5ac3('0x3b')],{'$or':_['map'](_0x228deb,function(_0x4fe034){if(_0x4fe034[_0x5ac3('0x3c')][_0x5ac3('0x3d')]!==_0x5ac3('0x3e')){var _0x301cf6={};_0x301cf6[_0x4fe034['field']]={'$like':'%'+_0x3912f6[_0x5ac3('0x2f')]['filter']+'%'};return _0x301cf6;}})});}_0x1f563e=_[_0x5ac3('0x3f')]({},_0x1f563e,_0x3912f6[_0x5ac3('0x40')]);var _0x264c12={'where':_0x1f563e[_0x5ac3('0x3b')]};return db[_0x5ac3('0x2b')]['count'](_0x264c12)[_0x5ac3('0x26')](function(_0x101fd3){_0x452519[_0x5ac3('0x1e')]=_0x101fd3;if(_0x3912f6[_0x5ac3('0x2f')][_0x5ac3('0x41')]){_0x1f563e[_0x5ac3('0x42')]=[{'all':!![]}];}return db[_0x5ac3('0x2b')][_0x5ac3('0x43')](_0x1f563e);})[_0x5ac3('0x26')](function(_0x5cba25){_0x452519[_0x5ac3('0x44')]=_0x5cba25;return _0x452519;})[_0x5ac3('0x26')](respondWithFilteredResult(_0x2fd301,_0x1f563e))[_0x5ac3('0x45')](handleError(_0x2fd301,null));};exports[_0x5ac3('0x46')]=function(_0x5bd8e6,_0x20c16c){var _0x35155b={'raw':![],'where':{'id':_0x5bd8e6['params']['id']}},_0x4fddb2={};_0x4fddb2[_0x5ac3('0x2d')]=_[_0x5ac3('0x2e')](db[_0x5ac3('0x2b')]['rawAttributes']);_0x4fddb2[_0x5ac3('0x2f')]=_[_0x5ac3('0x2e')](_0x5bd8e6[_0x5ac3('0x2f')]);_0x4fddb2[_0x5ac3('0x30')]=_[_0x5ac3('0x31')](_0x4fddb2[_0x5ac3('0x2d')],_0x4fddb2[_0x5ac3('0x2f')]);_0x35155b[_0x5ac3('0x32')]=_[_0x5ac3('0x31')](_0x4fddb2[_0x5ac3('0x2d')],qs[_0x5ac3('0x33')](_0x5bd8e6[_0x5ac3('0x2f')][_0x5ac3('0x33')]));_0x35155b['attributes']=_0x35155b['attributes']['length']?_0x35155b['attributes']:_0x4fddb2['model'];if(_0x5bd8e6['query'][_0x5ac3('0x41')]){_0x35155b[_0x5ac3('0x42')]=[{'all':!![]}];}_0x35155b=_[_0x5ac3('0x3f')]({},_0x35155b,_0x5bd8e6['options']);return db[_0x5ac3('0x2b')][_0x5ac3('0x47')](_0x35155b)[_0x5ac3('0x26')](handleEntityNotFound(_0x20c16c,null))[_0x5ac3('0x26')](respondWithResult(_0x20c16c,null))[_0x5ac3('0x45')](handleError(_0x20c16c,null));};exports['create']=function(_0x310d9c,_0x402d38){return db[_0x5ac3('0x2b')][_0x5ac3('0x48')](_0x310d9c[_0x5ac3('0x49')],{})['then'](respondWithResult(_0x402d38,0xc9))[_0x5ac3('0x45')](handleError(_0x402d38,null));};exports[_0x5ac3('0x25')]=function(_0x2a1c1b,_0x20c46d){if(_0x2a1c1b['body']['id']){delete _0x2a1c1b[_0x5ac3('0x49')]['id'];}return db[_0x5ac3('0x2b')][_0x5ac3('0x47')]({'where':{'id':_0x2a1c1b[_0x5ac3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20c46d,null))[_0x5ac3('0x26')](saveUpdates(_0x2a1c1b[_0x5ac3('0x49')],null))[_0x5ac3('0x26')](respondWithResult(_0x20c46d,null))[_0x5ac3('0x45')](handleError(_0x20c46d,null));};exports[_0x5ac3('0x27')]=function(_0x3a421f,_0x6293c3){return db['Integration']['find']({'where':{'id':_0x3a421f[_0x5ac3('0x4a')]['id']}})[_0x5ac3('0x26')](handleEntityNotFound(_0x6293c3,null))[_0x5ac3('0x26')](removeEntity(_0x6293c3,null))[_0x5ac3('0x45')](handleError(_0x6293c3,null));}; \ No newline at end of file +var _0x34bd=['../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','then','destroy','end','name','send','rawAttributes','keys','query','filters','model','attributes','fields','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','field','include','Integration','findAll','rows','intersection','length','includeAll','options','find','create','catch','body','params','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x17e111,_0x17aaa3){var _0x2ef578=function(_0x4ae89b){while(--_0x4ae89b){_0x17e111['push'](_0x17e111['shift']());}};_0x2ef578(++_0x17aaa3);}(_0x34bd,0x1d2));var _0xd34b=function(_0x261fc3,_0x93ec46){_0x261fc3=_0x261fc3-0x0;var _0x83da99=_0x34bd[_0x261fc3];return _0x83da99;};'use strict';var pdf=require(_0xd34b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd34b('0x1'));var jsonpatch=require(_0xd34b('0x2'));var rp=require(_0xd34b('0x3'));var moment=require(_0xd34b('0x4'));var BPromise=require(_0xd34b('0x5'));var Mustache=require(_0xd34b('0x6'));var util=require(_0xd34b('0x7'));var path=require('path');var sox=require(_0xd34b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd34b('0x9'));var crypto=require(_0xd34b('0xa'));var jsforce=require(_0xd34b('0xb'));var deskjs=require(_0xd34b('0xc'));var toCsv=require(_0xd34b('0xd'));var querystring=require(_0xd34b('0xe'));var Papa=require(_0xd34b('0xf'));var authService=require(_0xd34b('0x10'));var hardwareService=require(_0xd34b('0x11'));var Redis=require(_0xd34b('0x12'));var qs=require(_0xd34b('0x13'));var logger=require(_0xd34b('0x14'))('api');var utils=require(_0xd34b('0x15'));var config=require('../../config/environment');var db=require(_0xd34b('0x16'))['db'];function respondWithStatusCode(_0x2e0e8c,_0x13dbae){_0x13dbae=_0x13dbae||0xcc;return function(_0x2fb7a8){if(_0x2fb7a8){return _0x2e0e8c[_0xd34b('0x17')](_0x13dbae);}return _0x2e0e8c[_0xd34b('0x18')](_0x13dbae)['end']();};}function respondWithResult(_0x41012b,_0x3af475){_0x3af475=_0x3af475||0xc8;return function(_0x4a2dbf){if(_0x4a2dbf){return _0x41012b[_0xd34b('0x18')](_0x3af475)[_0xd34b('0x19')](_0x4a2dbf);}};}function respondWithFilteredResult(_0x1ebdc5,_0x494105){return function(_0x326f00){if(_0x326f00){var _0x214c65=_0x326f00[_0xd34b('0x1a')],_0x5a46be=_0x494105[_0xd34b('0x1b')],_0x3c74e2=_0x494105[_0xd34b('0x1b')]+_0x494105['limit'],_0x4ce87b;if(_0x3c74e2>=_0x214c65){_0x3c74e2=_0x214c65;_0x4ce87b=0xc8;}else{_0x4ce87b=0xce;}_0x1ebdc5[_0xd34b('0x18')](_0x4ce87b);return _0x1ebdc5[_0xd34b('0x1c')](_0xd34b('0x1d'),_0x5a46be+'-'+_0x3c74e2+'/'+_0x214c65)[_0xd34b('0x19')](_0x326f00);}return null;};}function patchUpdates(_0x206f16){return function(_0x5d45e5){try{jsonpatch['apply'](_0x5d45e5,_0x206f16,!![]);}catch(_0x16cab0){return BPromise[_0xd34b('0x1e')](_0x16cab0);}return _0x5d45e5[_0xd34b('0x1f')]();};}function saveUpdates(_0x1e4523,_0x291a00){return function(_0x3152a9){if(_0x3152a9){return _0x3152a9['update'](_0x1e4523)[_0xd34b('0x20')](function(_0x2d98e5){return _0x2d98e5;});}return null;};}function removeEntity(_0x1ae4ec,_0x17466c){return function(_0x5f1f0d){if(_0x5f1f0d){return _0x5f1f0d[_0xd34b('0x21')]()[_0xd34b('0x20')](function(){_0x1ae4ec[_0xd34b('0x18')](0xcc)[_0xd34b('0x22')]();});}};}function handleEntityNotFound(_0x3a0972,_0x27eb68){return function(_0x5afc42){if(!_0x5afc42){_0x3a0972[_0xd34b('0x17')](0x194);}return _0x5afc42;};}function handleError(_0x49c485,_0x2187c0){_0x2187c0=_0x2187c0||0x1f4;return function(_0x2ae0e1){logger['error'](_0x2ae0e1['stack']);if(_0x2ae0e1['name']){delete _0x2ae0e1[_0xd34b('0x23')];}_0x49c485[_0xd34b('0x18')](_0x2187c0)[_0xd34b('0x24')](_0x2ae0e1);};}exports['index']=function(_0x34b192,_0x36b108){var _0x5bac80={},_0x21a653={},_0x38637f={'count':0x0,'rows':[]};var _0x342885=db['Integration'][_0xd34b('0x25')];_0x21a653['model']=_[_0xd34b('0x26')](_0x342885);_0x21a653[_0xd34b('0x27')]=_[_0xd34b('0x26')](_0x34b192['query']);_0x21a653[_0xd34b('0x28')]=_['intersection'](_0x21a653[_0xd34b('0x29')],_0x21a653['query']);_0x5bac80[_0xd34b('0x2a')]=_['intersection'](_0x21a653[_0xd34b('0x29')],qs[_0xd34b('0x2b')](_0x34b192['query'][_0xd34b('0x2b')]));_0x5bac80[_0xd34b('0x2a')]=_0x5bac80[_0xd34b('0x2a')]['length']?_0x5bac80[_0xd34b('0x2a')]:_0x21a653[_0xd34b('0x29')];if(!_0x34b192[_0xd34b('0x27')]['hasOwnProperty'](_0xd34b('0x2c'))){_0x5bac80[_0xd34b('0x2d')]=qs[_0xd34b('0x2d')](_0x34b192[_0xd34b('0x27')][_0xd34b('0x2d')]);_0x5bac80[_0xd34b('0x1b')]=qs[_0xd34b('0x1b')](_0x34b192['query'][_0xd34b('0x1b')]);}_0x5bac80[_0xd34b('0x2e')]=qs[_0xd34b('0x2f')](_0x34b192[_0xd34b('0x27')][_0xd34b('0x2f')]);_0x5bac80['where']=qs[_0xd34b('0x28')](_[_0xd34b('0x30')](_0x34b192[_0xd34b('0x27')],_0x21a653['filters']));if(_0x34b192['query'][_0xd34b('0x31')]){_0x5bac80[_0xd34b('0x32')]=_[_0xd34b('0x33')](_0x5bac80['where'],{'$or':_[_0xd34b('0x34')](_0x342885,function(_0x91e8ba){if(_0x91e8ba[_0xd34b('0x35')][_0xd34b('0x36')]!=='VIRTUAL'){var _0x54b77a={};_0x54b77a[_0x91e8ba[_0xd34b('0x37')]]={'$like':'%'+_0x34b192[_0xd34b('0x27')]['filter']+'%'};return _0x54b77a;}})});}_0x5bac80=_['merge']({},_0x5bac80,_0x34b192['options']);var _0x64acdf={'where':_0x5bac80[_0xd34b('0x32')]};return db['Integration'][_0xd34b('0x1a')](_0x64acdf)[_0xd34b('0x20')](function(_0x26a52f){_0x38637f[_0xd34b('0x1a')]=_0x26a52f;if(_0x34b192[_0xd34b('0x27')]['includeAll']){_0x5bac80[_0xd34b('0x38')]=[{'all':!![]}];}return db[_0xd34b('0x39')][_0xd34b('0x3a')](_0x5bac80);})[_0xd34b('0x20')](function(_0x589ec9){_0x38637f[_0xd34b('0x3b')]=_0x589ec9;return _0x38637f;})[_0xd34b('0x20')](respondWithFilteredResult(_0x36b108,_0x5bac80))['catch'](handleError(_0x36b108,null));};exports['show']=function(_0x3f9aeb,_0x2fdb14){var _0x1c9365={'raw':![],'where':{'id':_0x3f9aeb['params']['id']}},_0x158f43={};_0x158f43[_0xd34b('0x29')]=_[_0xd34b('0x26')](db['Integration']['rawAttributes']);_0x158f43['query']=_[_0xd34b('0x26')](_0x3f9aeb['query']);_0x158f43['filters']=_[_0xd34b('0x3c')](_0x158f43['model'],_0x158f43[_0xd34b('0x27')]);_0x1c9365['attributes']=_[_0xd34b('0x3c')](_0x158f43[_0xd34b('0x29')],qs[_0xd34b('0x2b')](_0x3f9aeb[_0xd34b('0x27')][_0xd34b('0x2b')]));_0x1c9365['attributes']=_0x1c9365[_0xd34b('0x2a')][_0xd34b('0x3d')]?_0x1c9365[_0xd34b('0x2a')]:_0x158f43[_0xd34b('0x29')];if(_0x3f9aeb[_0xd34b('0x27')][_0xd34b('0x3e')]){_0x1c9365[_0xd34b('0x38')]=[{'all':!![]}];}_0x1c9365=_[_0xd34b('0x33')]({},_0x1c9365,_0x3f9aeb[_0xd34b('0x3f')]);return db[_0xd34b('0x39')][_0xd34b('0x40')](_0x1c9365)[_0xd34b('0x20')](handleEntityNotFound(_0x2fdb14,null))['then'](respondWithResult(_0x2fdb14,null))['catch'](handleError(_0x2fdb14,null));};exports[_0xd34b('0x41')]=function(_0x14516b,_0x511814){return db[_0xd34b('0x39')][_0xd34b('0x41')](_0x14516b['body'],{})[_0xd34b('0x20')](respondWithResult(_0x511814,0xc9))[_0xd34b('0x42')](handleError(_0x511814,null));};exports['update']=function(_0x5d5b24,_0x36c91e){if(_0x5d5b24[_0xd34b('0x43')]['id']){delete _0x5d5b24[_0xd34b('0x43')]['id'];}return db['Integration'][_0xd34b('0x40')]({'where':{'id':_0x5d5b24['params']['id']}})[_0xd34b('0x20')](handleEntityNotFound(_0x36c91e,null))['then'](saveUpdates(_0x5d5b24[_0xd34b('0x43')],null))['then'](respondWithResult(_0x36c91e,null))[_0xd34b('0x42')](handleError(_0x36c91e,null));};exports[_0xd34b('0x21')]=function(_0x2fee4e,_0x334661){return db[_0xd34b('0x39')][_0xd34b('0x40')]({'where':{'id':_0x2fee4e[_0xd34b('0x44')]['id']}})[_0xd34b('0x20')](handleEntityNotFound(_0x334661,null))[_0xd34b('0x20')](removeEntity(_0x334661,null))[_0xd34b('0x42')](handleError(_0x334661,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b7b631f..599101f 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 _0xc6ac=['util','../../config/logger','api','moment','bluebird','request-promise','./integration.attributes','exports','define','Integration','integrations','lodash'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4b110b,_0x3f153f){_0x4b110b=_0x4b110b-0x0;var _0xfef83=_0xc6ac[_0x4b110b];return _0xfef83;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var attributes=require(_0xcc6a('0x7'));module[_0xcc6a('0x8')]=function(_0x22ee99,_0x2f26ab){return _0x22ee99[_0xcc6a('0x9')](_0xcc6a('0xa'),attributes,{'tableName':_0xcc6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['../../config/logger','api','moment','bluebird','define','Integration','integrations','lodash','util'];(function(_0xcbaefc,_0x1d0908){var _0x328b5a=function(_0xde8e34){while(--_0xde8e34){_0xcbaefc['push'](_0xcbaefc['shift']());}};_0x328b5a(++_0x1d0908);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'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 attributes=require('./integration.attributes');module['exports']=function(_0x2f48ed,_0x15b967){return _0x2f48ed[_0xac4a('0x6')](_0xac4a('0x7'),attributes,{'tableName':_0xac4a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 266cc81..6ad2b20 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 _0x360b=['Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x392be3,_0xf1d603){var _0x1453b2=function(_0x5bdce8){while(--_0x5bdce8){_0x392be3['push'](_0x392be3['shift']());}};_0x1453b2(++_0xf1d603);}(_0x360b,0x15e));var _0xb360=function(_0x45e64b,_0x12a3c5){_0x45e64b=_0x45e64b-0x0;var _0x6f59e=_0x360b[_0x45e64b];return _0x6f59e;};'use strict';var _=require('lodash');var util=require(_0xb360('0x0'));var moment=require(_0xb360('0x1'));var BPromise=require(_0xb360('0x2'));var rs=require(_0xb360('0x3'));var fs=require('fs');var Redis=require(_0xb360('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb360('0x5'));var config=require(_0xb360('0x6'));var jayson=require(_0xb360('0x7'));var client=jayson[_0xb360('0x8')][_0xb360('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bdd74,_0x23ae09,_0x1dd1fa){return new BPromise(function(_0x29af3d,_0x236618){return client['request'](_0x5bdd74,_0x1dd1fa)['then'](function(_0x387620){logger[_0xb360('0xa')]('Integration,\x20%s,\x20%s',_0x23ae09,'request\x20sent');logger['debug'](_0xb360('0xb'),_0x23ae09,_0xb360('0xc'),JSON[_0xb360('0xd')](_0x387620));if(_0x387620[_0xb360('0xe')]){if(_0x387620[_0xb360('0xe')]['code']===0x1f4){logger[_0xb360('0xe')](_0xb360('0xf'),_0x23ae09,_0x387620[_0xb360('0xe')]['message']);return _0x236618(_0x387620[_0xb360('0xe')]['message']);}logger[_0xb360('0xe')](_0xb360('0xf'),_0x23ae09,_0x387620['error'][_0xb360('0x10')]);return _0x29af3d(_0x387620['error'][_0xb360('0x10')]);}else{logger[_0xb360('0xa')](_0xb360('0xf'),_0x23ae09,_0xb360('0xc'));_0x29af3d(_0x387620[_0xb360('0x11')][_0xb360('0x10')]);}})[_0xb360('0x12')](function(_0x1656f9){logger[_0xb360('0xe')](_0xb360('0xf'),_0x23ae09,_0x1656f9);_0x236618(_0x1656f9);});});} \ No newline at end of file +var _0xce80=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0xbb9cb0,_0x4c1858){var _0x5cfd58=function(_0x28b75c){while(--_0x28b75c){_0xbb9cb0['push'](_0xbb9cb0['shift']());}};_0x5cfd58(++_0x4c1858);}(_0xce80,0x127));var _0x0ce8=function(_0x152230,_0x2a0477){_0x152230=_0x152230-0x0;var _0xc57076=_0xce80[_0x152230];return _0xc57076;};'use strict';var _=require(_0x0ce8('0x0'));var util=require(_0x0ce8('0x1'));var moment=require(_0x0ce8('0x2'));var BPromise=require(_0x0ce8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ce8('0x4'));var db=require(_0x0ce8('0x5'))['db'];var utils=require(_0x0ce8('0x6'));var logger=require(_0x0ce8('0x7'))(_0x0ce8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ce8('0x9')][_0x0ce8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2078a4,_0x33ecfb,_0x287841){return new BPromise(function(_0x25fd4c,_0x22da01){return client[_0x0ce8('0xb')](_0x2078a4,_0x287841)[_0x0ce8('0xc')](function(_0x1a970b){logger[_0x0ce8('0xd')](_0x0ce8('0xe'),_0x33ecfb,'request\x20sent');logger[_0x0ce8('0xf')](_0x0ce8('0x10'),_0x33ecfb,_0x0ce8('0x11'),JSON[_0x0ce8('0x12')](_0x1a970b));if(_0x1a970b[_0x0ce8('0x13')]){if(_0x1a970b['error'][_0x0ce8('0x14')]===0x1f4){logger[_0x0ce8('0x13')](_0x0ce8('0xe'),_0x33ecfb,_0x1a970b['error'][_0x0ce8('0x15')]);return _0x22da01(_0x1a970b['error'][_0x0ce8('0x15')]);}logger['error'](_0x0ce8('0xe'),_0x33ecfb,_0x1a970b['error'][_0x0ce8('0x15')]);return _0x25fd4c(_0x1a970b[_0x0ce8('0x13')][_0x0ce8('0x15')]);}else{logger[_0x0ce8('0xd')](_0x0ce8('0xe'),_0x33ecfb,_0x0ce8('0x11'));_0x25fd4c(_0x1a970b[_0x0ce8('0x16')][_0x0ce8('0x15')]);}})['catch'](function(_0x106170){logger[_0x0ce8('0x13')]('Integration,\x20%s,\x20%s',_0x33ecfb,_0x106170);_0x22da01(_0x106170);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f89fb16..d801b4c 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 _0xefbb=['/describe','/:id','show','post','create','put','update','exports','multer','connect-timeout','Router','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index'];(function(_0x2d33ca,_0x2b7361){var _0x5e61fb=function(_0xc91342){while(--_0xc91342){_0x2d33ca['push'](_0x2d33ca['shift']());}};_0x5e61fb(++_0x2b7361);}(_0xefbb,0x198));var _0xbefb=function(_0x391bf8,_0x4316a8){_0x391bf8=_0x391bf8-0x0;var _0x4f694d=_0xefbb[_0x391bf8];return _0x4f694d;};'use strict';var multer=require(_0xbefb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbefb('0x1'));var express=require('express');var router=express[_0xbefb('0x2')]();var auth=require(_0xbefb('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbefb('0x4'));router[_0xbefb('0x5')]('/',auth[_0xbefb('0x6')](),controller[_0xbefb('0x7')]);router['get'](_0xbefb('0x8'),auth[_0xbefb('0x6')](),controller['describe']);router[_0xbefb('0x5')](_0xbefb('0x9'),auth[_0xbefb('0x6')](),controller[_0xbefb('0xa')]);router[_0xbefb('0xb')]('/',auth['isAuthenticated'](),controller[_0xbefb('0xc')]);router[_0xbefb('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbefb('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xbefb('0xf')]=router; \ No newline at end of file +var _0x117d=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x5de177,_0xffd2f1){var _0x19a45b=function(_0x2ad17b){while(--_0x2ad17b){_0x5de177['push'](_0x5de177['shift']());}};_0x19a45b(++_0xffd2f1);}(_0x117d,0xac));var _0xd117=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0x117d[_0x311666];return _0x2bc692;};'use strict';var multer=require(_0xd117('0x0'));var util=require(_0xd117('0x1'));var path=require(_0xd117('0x2'));var timeout=require('connect-timeout');var express=require(_0xd117('0x3'));var router=express[_0xd117('0x4')]();var auth=require(_0xd117('0x5'));var interaction=require(_0xd117('0x6'));var config=require(_0xd117('0x7'));var controller=require('./integrationReport.controller');router[_0xd117('0x8')]('/',auth[_0xd117('0x9')](),controller[_0xd117('0xa')]);router[_0xd117('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xd117('0xb')]);router[_0xd117('0x8')](_0xd117('0xc'),auth[_0xd117('0x9')](),controller[_0xd117('0xd')]);router[_0xd117('0xe')]('/',auth[_0xd117('0x9')](),controller[_0xd117('0xf')]);router[_0xd117('0x10')](_0xd117('0xc'),auth[_0xd117('0x9')](),controller[_0xd117('0x11')]);router[_0xd117('0x12')]('/:id',auth[_0xd117('0x9')](),controller[_0xd117('0x13')]);module[_0xd117('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 42b53de..a3e2eb1 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 _0x7e98=['STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','sequelize'];(function(_0x5d0d11,_0x2e08aa){var _0x3da643=function(_0x113956){while(--_0x113956){_0x5d0d11['push'](_0x5d0d11['shift']());}};_0x3da643(++_0x2e08aa);}(_0x7e98,0x8f));var _0x87e9=function(_0x544f8b,_0x5a5223){_0x544f8b=_0x544f8b-0x0;var _0x7601c6=_0x7e98[_0x544f8b];return _0x7601c6;};'use strict';var Sequelize=require(_0x87e9('0x0'));module['exports']={'integration':{'type':Sequelize[_0x87e9('0x1')]},'eventChannel':{'type':Sequelize[_0x87e9('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x87e9('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x87e9('0x1')]},'uniqueid':{'type':Sequelize[_0x87e9('0x1')]},'calleridnum':{'type':Sequelize[_0x87e9('0x1')]},'calleridname':{'type':Sequelize[_0x87e9('0x1')]},'queue':{'type':Sequelize[_0x87e9('0x1')]},'interface':{'type':Sequelize[_0x87e9('0x1')]},'membername':{'type':Sequelize[_0x87e9('0x1')]},'agentcalledAt':{'type':Sequelize[_0x87e9('0x2')]},'agentconnectAt':{'type':Sequelize[_0x87e9('0x2')]},'holdtime':{'type':Sequelize[_0x87e9('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x87e9('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x87e9('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x87e9('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x87e9('0x2')]},'agentdump':{'type':Sequelize[_0x87e9('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x87e9('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x87e9('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x87e9('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x87e9('0x1')]},'exten':{'type':Sequelize[_0x87e9('0x1')]},'priority':{'type':Sequelize[_0x87e9('0x1')]},'destchannel':{'type':Sequelize[_0x87e9('0x1')]},'destchannelstate':{'type':Sequelize[_0x87e9('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x87e9('0x1')]},'destcalleridnum':{'type':Sequelize[_0x87e9('0x1')]},'destcalleridname':{'type':Sequelize[_0x87e9('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x87e9('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x87e9('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x87e9('0x1')]},'destcontext':{'type':Sequelize[_0x87e9('0x1')]},'destexten':{'type':Sequelize[_0x87e9('0x1')]},'destpriority':{'type':Sequelize[_0x87e9('0x1')]},'destuniqueid':{'type':Sequelize[_0x87e9('0x1')]},'messageId':{'type':Sequelize[_0x87e9('0x1')]},'inReplyTo':{'type':Sequelize[_0x87e9('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x87e9('0x1')]},'to':{'type':Sequelize[_0x87e9('0x1')]},'cc':{'type':Sequelize[_0x87e9('0x1')]},'attachment':{'type':Sequelize[_0x87e9('0x5')]},'html':{'type':Sequelize[_0x87e9('0x5')]},'text':{'type':Sequelize[_0x87e9('0x5')]},'status':{'type':Sequelize[_0x87e9('0x6')](_0x87e9('0x7'),'SENDING',_0x87e9('0x8'),'FAILED')},'url':{'type':Sequelize[_0x87e9('0x1')]},'app':{'type':Sequelize[_0x87e9('0x1')]},'appdata':{'type':Sequelize[_0x87e9('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x33a1=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED'];(function(_0x5b8874,_0x358c0e){var _0x45da1e=function(_0x4fa2ab){while(--_0x4fa2ab){_0x5b8874['push'](_0x5b8874['shift']());}};_0x45da1e(++_0x358c0e);}(_0x33a1,0x1d4));var _0x133a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x33a1[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x133a('0x0'));module[_0x133a('0x1')]={'integration':{'type':Sequelize[_0x133a('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x133a('0x2')]},'ticketId':{'type':Sequelize[_0x133a('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x133a('0x2')]},'uniqueid':{'type':Sequelize[_0x133a('0x2')]},'calleridnum':{'type':Sequelize[_0x133a('0x2')]},'calleridname':{'type':Sequelize[_0x133a('0x2')]},'queue':{'type':Sequelize[_0x133a('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x133a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x133a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x133a('0x3')]},'holdtime':{'type':Sequelize[_0x133a('0x4')]},'agentcomplete':{'type':Sequelize[_0x133a('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x133a('0x3')]},'talktime':{'type':Sequelize[_0x133a('0x4')]},'agentacw':{'type':Sequelize[_0x133a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x133a('0x4')]},'reason':{'type':Sequelize[_0x133a('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x133a('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x133a('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x133a('0x2')]},'channelstate':{'type':Sequelize[_0x133a('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x133a('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x133a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x133a('0x2')]},'exten':{'type':Sequelize[_0x133a('0x2')]},'priority':{'type':Sequelize[_0x133a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x133a('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x133a('0x2')]},'destcalleridname':{'type':Sequelize[_0x133a('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x133a('0x2')]},'destlanguage':{'type':Sequelize[_0x133a('0x2')]},'destaccountcode':{'type':Sequelize[_0x133a('0x2')]},'destcontext':{'type':Sequelize[_0x133a('0x2')]},'destexten':{'type':Sequelize[_0x133a('0x2')]},'destpriority':{'type':Sequelize[_0x133a('0x2')]},'destuniqueid':{'type':Sequelize[_0x133a('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x133a('0x2')]},'to':{'type':Sequelize[_0x133a('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x133a('0x6')]},'html':{'type':Sequelize[_0x133a('0x6')]},'text':{'type':Sequelize[_0x133a('0x6')]},'status':{'type':Sequelize[_0x133a('0x7')](_0x133a('0x8'),_0x133a('0x9'),_0x133a('0xa'),_0x133a('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 66f1f41..6f68a19 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 _0x6aab=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','IntegrationReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x513ba6,_0x3384b9){var _0x22419e=function(_0x5b431b){while(--_0x5b431b){_0x513ba6['push'](_0x513ba6['shift']());}};_0x22419e(++_0x3384b9);}(_0x6aab,0x173));var _0xb6aa=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x6aab[_0x3d42d8];return _0x27fc41;};'use strict';var pdf=require(_0xb6aa('0x0'));var emlformat=require(_0xb6aa('0x1'));var rimraf=require(_0xb6aa('0x2'));var zipdir=require(_0xb6aa('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6aa('0x4'));var moment=require(_0xb6aa('0x5'));var BPromise=require(_0xb6aa('0x6'));var Mustache=require('mustache');var util=require(_0xb6aa('0x7'));var path=require(_0xb6aa('0x8'));var sox=require(_0xb6aa('0x9'));var csv=require(_0xb6aa('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb6aa('0xb'));var crypto=require(_0xb6aa('0xc'));var jsforce=require(_0xb6aa('0xd'));var deskjs=require(_0xb6aa('0xe'));var toCsv=require(_0xb6aa('0xa'));var querystring=require(_0xb6aa('0xf'));var Papa=require(_0xb6aa('0x10'));var authService=require(_0xb6aa('0x11'));var hardwareService=require(_0xb6aa('0x12'));var Redis=require(_0xb6aa('0x13'));var qs=require(_0xb6aa('0x14'));var logger=require(_0xb6aa('0x15'))(_0xb6aa('0x16'));var utils=require(_0xb6aa('0x17'));var config=require(_0xb6aa('0x18'));var db=require(_0xb6aa('0x19'))['db'];function respondWithStatusCode(_0x25ef68,_0xc8f518){_0xc8f518=_0xc8f518||0xcc;return function(_0x2e70c6){if(_0x2e70c6){return _0x25ef68[_0xb6aa('0x1a')](_0xc8f518);}return _0x25ef68['status'](_0xc8f518)[_0xb6aa('0x1b')]();};}function respondWithResult(_0xf5a8eb,_0x17c427){_0x17c427=_0x17c427||0xc8;return function(_0x49cab7){if(_0x49cab7){return _0xf5a8eb[_0xb6aa('0x1c')](_0x17c427)[_0xb6aa('0x1d')](_0x49cab7);}};}function respondWithFilteredResult(_0x18bfdd,_0x388bf2){return function(_0x3cfa00){if(_0x3cfa00){var _0x458af7=_0x3cfa00[_0xb6aa('0x1e')],_0x55038d=_0x388bf2['offset'],_0x2d8102=_0x388bf2[_0xb6aa('0x1f')]+_0x388bf2[_0xb6aa('0x20')],_0xa88f4e;if(_0x2d8102>=_0x458af7){_0x2d8102=_0x458af7;_0xa88f4e=0xc8;}else{_0xa88f4e=0xce;}_0x18bfdd[_0xb6aa('0x1c')](_0xa88f4e);return _0x18bfdd[_0xb6aa('0x21')](_0xb6aa('0x22'),_0x55038d+'-'+_0x2d8102+'/'+_0x458af7)['json'](_0x3cfa00);}return null;};}function patchUpdates(_0x173cea){return function(_0x1dd9c8){try{jsonpatch[_0xb6aa('0x23')](_0x1dd9c8,_0x173cea,!![]);}catch(_0x2b4579){return BPromise[_0xb6aa('0x24')](_0x2b4579);}return _0x1dd9c8['save']();};}function saveUpdates(_0x80bf9c,_0x372a1c){return function(_0x2d5d67){if(_0x2d5d67){return _0x2d5d67[_0xb6aa('0x25')](_0x80bf9c)[_0xb6aa('0x26')](function(_0x317150){return _0x317150;});}return null;};}function removeEntity(_0xf1c444,_0x320eaf){return function(_0x3f97b9){if(_0x3f97b9){return _0x3f97b9[_0xb6aa('0x27')]()[_0xb6aa('0x26')](function(){_0xf1c444[_0xb6aa('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1031d0,_0x490102){return function(_0x382bd1){if(!_0x382bd1){_0x1031d0[_0xb6aa('0x1a')](0x194);}return _0x382bd1;};}function handleError(_0x5cda26,_0x17e9ef){_0x17e9ef=_0x17e9ef||0x1f4;return function(_0x5781ad){logger[_0xb6aa('0x28')](_0x5781ad[_0xb6aa('0x29')]);if(_0x5781ad[_0xb6aa('0x2a')]){delete _0x5781ad[_0xb6aa('0x2a')];}_0x5cda26[_0xb6aa('0x1c')](_0x17e9ef)[_0xb6aa('0x2b')](_0x5781ad);};}exports[_0xb6aa('0x2c')]=function(_0x27ef7d,_0x18709d){var _0x44a27f={},_0x41f973={},_0x5ba45e={'count':0x0,'rows':[]};var _0xf50f8=db[_0xb6aa('0x2d')][_0xb6aa('0x2e')];_0x41f973[_0xb6aa('0x2f')]=_[_0xb6aa('0x30')](_0xf50f8);_0x41f973[_0xb6aa('0x31')]=_[_0xb6aa('0x30')](_0x27ef7d[_0xb6aa('0x31')]);_0x41f973[_0xb6aa('0x32')]=_[_0xb6aa('0x33')](_0x41f973['model'],_0x41f973['query']);_0x44a27f[_0xb6aa('0x34')]=_[_0xb6aa('0x33')](_0x41f973[_0xb6aa('0x2f')],qs[_0xb6aa('0x35')](_0x27ef7d[_0xb6aa('0x31')][_0xb6aa('0x35')]));_0x44a27f[_0xb6aa('0x34')]=_0x44a27f['attributes']['length']?_0x44a27f[_0xb6aa('0x34')]:_0x41f973[_0xb6aa('0x2f')];if(!_0x27ef7d[_0xb6aa('0x31')][_0xb6aa('0x36')](_0xb6aa('0x37'))){_0x44a27f['limit']=qs['limit'](_0x27ef7d[_0xb6aa('0x31')][_0xb6aa('0x20')]);_0x44a27f[_0xb6aa('0x1f')]=qs[_0xb6aa('0x1f')](_0x27ef7d['query'][_0xb6aa('0x1f')]);}_0x44a27f[_0xb6aa('0x38')]=qs['sort'](_0x27ef7d[_0xb6aa('0x31')][_0xb6aa('0x39')]);_0x44a27f[_0xb6aa('0x3a')]=qs[_0xb6aa('0x32')](_[_0xb6aa('0x3b')](_0x27ef7d[_0xb6aa('0x31')],_0x41f973[_0xb6aa('0x32')]));if(_0x27ef7d['query'][_0xb6aa('0x3c')]){_0x44a27f[_0xb6aa('0x3a')]=_['merge'](_0x44a27f[_0xb6aa('0x3a')],{'$or':_['map'](_0xf50f8,function(_0x507e82){if(_0x507e82[_0xb6aa('0x3d')][_0xb6aa('0x3e')]!==_0xb6aa('0x3f')){var _0x1f3359={};_0x1f3359[_0x507e82['field']]={'$like':'%'+_0x27ef7d[_0xb6aa('0x31')]['filter']+'%'};return _0x1f3359;}})});}_0x44a27f=_[_0xb6aa('0x40')]({},_0x44a27f,_0x27ef7d[_0xb6aa('0x41')]);var _0x34ddbd={'where':_0x44a27f[_0xb6aa('0x3a')]};return db[_0xb6aa('0x2d')][_0xb6aa('0x1e')](_0x34ddbd)[_0xb6aa('0x26')](function(_0x24cc3c){_0x5ba45e['count']=_0x24cc3c;if(_0x27ef7d[_0xb6aa('0x31')][_0xb6aa('0x42')]){_0x44a27f['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xb6aa('0x43')](_0x44a27f);})[_0xb6aa('0x26')](function(_0x3f60e0){_0x5ba45e[_0xb6aa('0x44')]=_0x3f60e0;return _0x5ba45e;})['then'](respondWithFilteredResult(_0x18709d,_0x44a27f))[_0xb6aa('0x45')](handleError(_0x18709d,null));};exports[_0xb6aa('0x46')]=function(_0x3c8ead,_0x33c550){var _0x51c115={'raw':![],'where':{'id':_0x3c8ead['params']['id']}},_0x4eacc4={};_0x4eacc4[_0xb6aa('0x2f')]=_[_0xb6aa('0x30')](db['IntegrationReport']['rawAttributes']);_0x4eacc4['query']=_[_0xb6aa('0x30')](_0x3c8ead[_0xb6aa('0x31')]);_0x4eacc4[_0xb6aa('0x32')]=_[_0xb6aa('0x33')](_0x4eacc4[_0xb6aa('0x2f')],_0x4eacc4['query']);_0x51c115[_0xb6aa('0x34')]=_['intersection'](_0x4eacc4[_0xb6aa('0x2f')],qs['fields'](_0x3c8ead[_0xb6aa('0x31')]['fields']));_0x51c115['attributes']=_0x51c115[_0xb6aa('0x34')][_0xb6aa('0x47')]?_0x51c115[_0xb6aa('0x34')]:_0x4eacc4[_0xb6aa('0x2f')];if(_0x3c8ead[_0xb6aa('0x31')][_0xb6aa('0x42')]){_0x51c115[_0xb6aa('0x48')]=[{'all':!![]}];}_0x51c115=_['merge']({},_0x51c115,_0x3c8ead[_0xb6aa('0x41')]);return db[_0xb6aa('0x2d')][_0xb6aa('0x49')](_0x51c115)[_0xb6aa('0x26')](handleEntityNotFound(_0x33c550,null))[_0xb6aa('0x26')](respondWithResult(_0x33c550,null))['catch'](handleError(_0x33c550,null));};exports[_0xb6aa('0x4a')]=function(_0x3203a5,_0x26f2c4){return db[_0xb6aa('0x2d')][_0xb6aa('0x4a')](_0x3203a5[_0xb6aa('0x4b')],{})[_0xb6aa('0x26')](respondWithResult(_0x26f2c4,0xc9))[_0xb6aa('0x45')](handleError(_0x26f2c4,null));};exports[_0xb6aa('0x25')]=function(_0x210c9a,_0x2cccf2){if(_0x210c9a[_0xb6aa('0x4b')]['id']){delete _0x210c9a[_0xb6aa('0x4b')]['id'];}return db[_0xb6aa('0x2d')][_0xb6aa('0x49')]({'where':{'id':_0x210c9a[_0xb6aa('0x4c')]['id']}})[_0xb6aa('0x26')](handleEntityNotFound(_0x2cccf2,null))[_0xb6aa('0x26')](saveUpdates(_0x210c9a[_0xb6aa('0x4b')],null))[_0xb6aa('0x26')](respondWithResult(_0x2cccf2,null))[_0xb6aa('0x45')](handleError(_0x2cccf2,null));};exports[_0xb6aa('0x27')]=function(_0x52ef2e,_0x148c4b){return db[_0xb6aa('0x2d')][_0xb6aa('0x49')]({'where':{'id':_0x52ef2e[_0xb6aa('0x4c')]['id']}})[_0xb6aa('0x26')](handleEntityNotFound(_0x148c4b,null))[_0xb6aa('0x26')](removeEntity(_0x148c4b,null))[_0xb6aa('0x45')](handleError(_0x148c4b,null));};exports[_0xb6aa('0x4d')]=function(_0x733f64,_0x446c29){return db[_0xb6aa('0x2d')]['describe']()[_0xb6aa('0x26')](respondWithResult(_0x446c29,null))[_0xb6aa('0x45')](handleError(_0x446c29,null));}; \ No newline at end of file +var _0x3700=['../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','error','name','send','index','IntegrationReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','findAll','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','papaparse','../../config/license/hardware','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3700,0x170));var _0x0370=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x3700[_0x401676];return _0x4f13fe;};'use strict';var pdf=require(_0x0370('0x0'));var emlformat=require(_0x0370('0x1'));var rimraf=require(_0x0370('0x2'));var zipdir=require(_0x0370('0x3'));var jsonpatch=require(_0x0370('0x4'));var rp=require(_0x0370('0x5'));var moment=require('moment');var BPromise=require(_0x0370('0x6'));var Mustache=require(_0x0370('0x7'));var util=require('util');var path=require(_0x0370('0x8'));var sox=require(_0x0370('0x9'));var csv=require(_0x0370('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0370('0xb'));var crypto=require('crypto');var jsforce=require(_0x0370('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0370('0xa'));var querystring=require('querystring');var Papa=require(_0x0370('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x0370('0xe'));var Redis=require('ioredis');var qs=require(_0x0370('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x0370('0x10'));var config=require(_0x0370('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec4551,_0x569638){_0x569638=_0x569638||0xcc;return function(_0x3b89eb){if(_0x3b89eb){return _0xec4551[_0x0370('0x12')](_0x569638);}return _0xec4551[_0x0370('0x13')](_0x569638)[_0x0370('0x14')]();};}function respondWithResult(_0xb5a594,_0x4eede2){_0x4eede2=_0x4eede2||0xc8;return function(_0x3b18c4){if(_0x3b18c4){return _0xb5a594[_0x0370('0x13')](_0x4eede2)[_0x0370('0x15')](_0x3b18c4);}};}function respondWithFilteredResult(_0x1ce51f,_0x594c73){return function(_0x5e3a62){if(_0x5e3a62){var _0x38cf0a=_0x5e3a62[_0x0370('0x16')],_0x2124c3=_0x594c73[_0x0370('0x17')],_0x4b577c=_0x594c73[_0x0370('0x17')]+_0x594c73[_0x0370('0x18')],_0x1a87a7;if(_0x4b577c>=_0x38cf0a){_0x4b577c=_0x38cf0a;_0x1a87a7=0xc8;}else{_0x1a87a7=0xce;}_0x1ce51f['status'](_0x1a87a7);return _0x1ce51f[_0x0370('0x19')](_0x0370('0x1a'),_0x2124c3+'-'+_0x4b577c+'/'+_0x38cf0a)[_0x0370('0x15')](_0x5e3a62);}return null;};}function patchUpdates(_0x4cf151){return function(_0x4abf74){try{jsonpatch['apply'](_0x4abf74,_0x4cf151,!![]);}catch(_0x48e85d){return BPromise['reject'](_0x48e85d);}return _0x4abf74['save']();};}function saveUpdates(_0x3916f4,_0x25785a){return function(_0x45ffda){if(_0x45ffda){return _0x45ffda[_0x0370('0x1b')](_0x3916f4)[_0x0370('0x1c')](function(_0x1e76b7){return _0x1e76b7;});}return null;};}function removeEntity(_0x29aedf,_0xc86834){return function(_0x57000f){if(_0x57000f){return _0x57000f[_0x0370('0x1d')]()[_0x0370('0x1c')](function(){_0x29aedf[_0x0370('0x13')](0xcc)[_0x0370('0x14')]();});}};}function handleEntityNotFound(_0x8d4713,_0x527c17){return function(_0x3ae264){if(!_0x3ae264){_0x8d4713[_0x0370('0x12')](0x194);}return _0x3ae264;};}function handleError(_0x4cbf3c,_0xf5409c){_0xf5409c=_0xf5409c||0x1f4;return function(_0x50fed0){logger[_0x0370('0x1e')](_0x50fed0['stack']);if(_0x50fed0[_0x0370('0x1f')]){delete _0x50fed0[_0x0370('0x1f')];}_0x4cbf3c[_0x0370('0x13')](_0xf5409c)[_0x0370('0x20')](_0x50fed0);};}exports[_0x0370('0x21')]=function(_0x1084ca,_0x18b1ba){var _0x468797={},_0x3a5702={},_0x4451a8={'count':0x0,'rows':[]};var _0x4fc61e=db[_0x0370('0x22')][_0x0370('0x23')];_0x3a5702[_0x0370('0x24')]=_[_0x0370('0x25')](_0x4fc61e);_0x3a5702['query']=_[_0x0370('0x25')](_0x1084ca[_0x0370('0x26')]);_0x3a5702[_0x0370('0x27')]=_['intersection'](_0x3a5702[_0x0370('0x24')],_0x3a5702[_0x0370('0x26')]);_0x468797[_0x0370('0x28')]=_[_0x0370('0x29')](_0x3a5702['model'],qs[_0x0370('0x2a')](_0x1084ca['query'][_0x0370('0x2a')]));_0x468797['attributes']=_0x468797[_0x0370('0x28')][_0x0370('0x2b')]?_0x468797[_0x0370('0x28')]:_0x3a5702[_0x0370('0x24')];if(!_0x1084ca[_0x0370('0x26')][_0x0370('0x2c')](_0x0370('0x2d'))){_0x468797['limit']=qs[_0x0370('0x18')](_0x1084ca['query'][_0x0370('0x18')]);_0x468797[_0x0370('0x17')]=qs[_0x0370('0x17')](_0x1084ca[_0x0370('0x26')][_0x0370('0x17')]);}_0x468797['order']=qs[_0x0370('0x2e')](_0x1084ca[_0x0370('0x26')]['sort']);_0x468797[_0x0370('0x2f')]=qs[_0x0370('0x27')](_[_0x0370('0x30')](_0x1084ca['query'],_0x3a5702[_0x0370('0x27')]));if(_0x1084ca[_0x0370('0x26')]['filter']){_0x468797['where']=_[_0x0370('0x31')](_0x468797[_0x0370('0x2f')],{'$or':_[_0x0370('0x32')](_0x4fc61e,function(_0x56e951){if(_0x56e951[_0x0370('0x33')][_0x0370('0x34')]!==_0x0370('0x35')){var _0x81424b={};_0x81424b[_0x56e951['field']]={'$like':'%'+_0x1084ca[_0x0370('0x26')][_0x0370('0x36')]+'%'};return _0x81424b;}})});}_0x468797=_[_0x0370('0x31')]({},_0x468797,_0x1084ca['options']);var _0x386ed1={'where':_0x468797[_0x0370('0x2f')]};return db['IntegrationReport']['count'](_0x386ed1)[_0x0370('0x1c')](function(_0x126600){_0x4451a8[_0x0370('0x16')]=_0x126600;if(_0x1084ca['query'][_0x0370('0x37')]){_0x468797[_0x0370('0x38')]=[{'all':!![]}];}return db['IntegrationReport'][_0x0370('0x39')](_0x468797);})['then'](function(_0x7d68cc){_0x4451a8['rows']=_0x7d68cc;return _0x4451a8;})[_0x0370('0x1c')](respondWithFilteredResult(_0x18b1ba,_0x468797))['catch'](handleError(_0x18b1ba,null));};exports['show']=function(_0x4e08e6,_0x181b64){var _0x2e0c59={'raw':![],'where':{'id':_0x4e08e6[_0x0370('0x3a')]['id']}},_0x325e5f={};_0x325e5f[_0x0370('0x24')]=_['keys'](db['IntegrationReport'][_0x0370('0x23')]);_0x325e5f['query']=_[_0x0370('0x25')](_0x4e08e6['query']);_0x325e5f[_0x0370('0x27')]=_[_0x0370('0x29')](_0x325e5f['model'],_0x325e5f['query']);_0x2e0c59[_0x0370('0x28')]=_[_0x0370('0x29')](_0x325e5f[_0x0370('0x24')],qs[_0x0370('0x2a')](_0x4e08e6[_0x0370('0x26')][_0x0370('0x2a')]));_0x2e0c59[_0x0370('0x28')]=_0x2e0c59[_0x0370('0x28')][_0x0370('0x2b')]?_0x2e0c59['attributes']:_0x325e5f[_0x0370('0x24')];if(_0x4e08e6[_0x0370('0x26')]['includeAll']){_0x2e0c59[_0x0370('0x38')]=[{'all':!![]}];}_0x2e0c59=_[_0x0370('0x31')]({},_0x2e0c59,_0x4e08e6['options']);return db['IntegrationReport'][_0x0370('0x3b')](_0x2e0c59)[_0x0370('0x1c')](handleEntityNotFound(_0x181b64,null))[_0x0370('0x1c')](respondWithResult(_0x181b64,null))[_0x0370('0x3c')](handleError(_0x181b64,null));};exports[_0x0370('0x3d')]=function(_0x16a02b,_0x1d0a69){return db[_0x0370('0x22')][_0x0370('0x3d')](_0x16a02b[_0x0370('0x3e')],{})[_0x0370('0x1c')](respondWithResult(_0x1d0a69,0xc9))[_0x0370('0x3c')](handleError(_0x1d0a69,null));};exports[_0x0370('0x1b')]=function(_0x6e4cc6,_0x2af83c){if(_0x6e4cc6[_0x0370('0x3e')]['id']){delete _0x6e4cc6[_0x0370('0x3e')]['id'];}return db[_0x0370('0x22')][_0x0370('0x3b')]({'where':{'id':_0x6e4cc6['params']['id']}})['then'](handleEntityNotFound(_0x2af83c,null))['then'](saveUpdates(_0x6e4cc6[_0x0370('0x3e')],null))[_0x0370('0x1c')](respondWithResult(_0x2af83c,null))[_0x0370('0x3c')](handleError(_0x2af83c,null));};exports[_0x0370('0x1d')]=function(_0x3fbf6f,_0x505179){return db[_0x0370('0x22')]['find']({'where':{'id':_0x3fbf6f[_0x0370('0x3a')]['id']}})['then'](handleEntityNotFound(_0x505179,null))[_0x0370('0x1c')](removeEntity(_0x505179,null))[_0x0370('0x3c')](handleError(_0x505179,null));};exports['describe']=function(_0x3d65ba,_0x17cc4e){return db[_0x0370('0x22')][_0x0370('0x3f')]()[_0x0370('0x1c')](respondWithResult(_0x17cc4e,null))[_0x0370('0x3c')](handleError(_0x17cc4e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d0a9591..faf5786 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 _0xcca7=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','request-promise','exports'];(function(_0x5ecca5,_0x2bb5ff){var _0x424150=function(_0x325d35){while(--_0x325d35){_0x5ecca5['push'](_0x5ecca5['shift']());}};_0x424150(++_0x2bb5ff);}(_0xcca7,0x1aa));var _0x7cca=function(_0x1d2eec,_0x5f0a2c){_0x1d2eec=_0x1d2eec-0x0;var _0x2df149=_0xcca7[_0x1d2eec];return _0x2df149;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var attributes=require('./integrationReport.attributes');module[_0x7cca('0x5')]=function(_0x9523f7,_0x2126f7){return _0x9523f7[_0x7cca('0x6')](_0x7cca('0x7'),attributes,{'tableName':_0x7cca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['./integrationReport.attributes','IntegrationReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x17b68b,_0x3223e9){var _0x5ef6ad=function(_0x3717b9){while(--_0x3717b9){_0x17b68b['push'](_0x17b68b['shift']());}};_0x5ef6ad(++_0x3223e9);}(_0x53ec,0x192));var _0xc53e=function(_0x17d314,_0x4c6cc8){_0x17d314=_0x17d314-0x0;var _0x58e7d3=_0x53ec[_0x17d314];return _0x58e7d3;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var attributes=require(_0xc53e('0x6'));module['exports']=function(_0x2b90f6,_0x38033d){return _0x2b90f6['define'](_0xc53e('0x7'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 5ab16fb..269fde2 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 _0x8e2c=['jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5a5bcf,_0x43c7c8){var _0x2dbae3=function(_0x5b400a){while(--_0x5b400a){_0x5a5bcf['push'](_0x5a5bcf['shift']());}};_0x2dbae3(++_0x43c7c8);}(_0x8e2c,0x157));var _0xc8e2=function(_0x3b6364,_0x7b2228){_0x3b6364=_0x3b6364-0x0;var _0x9a1aeb=_0x8e2c[_0x3b6364];return _0x9a1aeb;};'use strict';var _=require(_0xc8e2('0x0'));var util=require(_0xc8e2('0x1'));var moment=require('moment');var BPromise=require(_0xc8e2('0x2'));var rs=require(_0xc8e2('0x3'));var fs=require('fs');var Redis=require(_0xc8e2('0x4'));var db=require(_0xc8e2('0x5'))['db'];var utils=require(_0xc8e2('0x6'));var logger=require(_0xc8e2('0x7'))('rpc');var config=require(_0xc8e2('0x8'));var jayson=require(_0xc8e2('0x9'));var client=jayson[_0xc8e2('0xa')][_0xc8e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208039,_0x385663,_0x27f2e1){return new BPromise(function(_0x264aaf,_0x1c7924){return client['request'](_0x208039,_0x27f2e1)[_0xc8e2('0xc')](function(_0x4a1991){logger[_0xc8e2('0xd')](_0xc8e2('0xe'),_0x385663,_0xc8e2('0xf'));logger['debug'](_0xc8e2('0x10'),_0x385663,_0xc8e2('0xf'),JSON[_0xc8e2('0x11')](_0x4a1991));if(_0x4a1991[_0xc8e2('0x12')]){if(_0x4a1991['error'][_0xc8e2('0x13')]===0x1f4){logger[_0xc8e2('0x12')](_0xc8e2('0xe'),_0x385663,_0x4a1991[_0xc8e2('0x12')][_0xc8e2('0x14')]);return _0x1c7924(_0x4a1991[_0xc8e2('0x12')]['message']);}logger['error'](_0xc8e2('0xe'),_0x385663,_0x4a1991[_0xc8e2('0x12')][_0xc8e2('0x14')]);return _0x264aaf(_0x4a1991['error']['message']);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x385663,_0xc8e2('0xf'));_0x264aaf(_0x4a1991[_0xc8e2('0x15')][_0xc8e2('0x14')]);}})['catch'](function(_0x4d8756){logger[_0xc8e2('0x12')](_0xc8e2('0xe'),_0x385663,_0x4d8756);_0x1c7924(_0x4d8756);});});} \ No newline at end of file +var _0xe621=['request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe621,0x1a9));var _0x1e62=function(_0x3b3de1,_0x4c0436){_0x3b3de1=_0x3b3de1-0x0;var _0x16e843=_0xe621[_0x3b3de1];return _0x16e843;};'use strict';var _=require(_0x1e62('0x0'));var util=require(_0x1e62('0x1'));var moment=require(_0x1e62('0x2'));var BPromise=require(_0x1e62('0x3'));var rs=require(_0x1e62('0x4'));var fs=require('fs');var Redis=require(_0x1e62('0x5'));var db=require(_0x1e62('0x6'))['db'];var utils=require(_0x1e62('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1e62('0x8'));var jayson=require(_0x1e62('0x9'));var client=jayson[_0x1e62('0xa')][_0x1e62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bc612,_0x51a8ce,_0xcf8699){return new BPromise(function(_0x128c72,_0x3f1e24){return client[_0x1e62('0xc')](_0x2bc612,_0xcf8699)[_0x1e62('0xd')](function(_0x389998){logger['info'](_0x1e62('0xe'),_0x51a8ce,_0x1e62('0xf'));logger[_0x1e62('0x10')](_0x1e62('0x11'),_0x51a8ce,'request\x20sent',JSON['stringify'](_0x389998));if(_0x389998[_0x1e62('0x12')]){if(_0x389998[_0x1e62('0x12')][_0x1e62('0x13')]===0x1f4){logger[_0x1e62('0x12')](_0x1e62('0xe'),_0x51a8ce,_0x389998['error'][_0x1e62('0x14')]);return _0x3f1e24(_0x389998[_0x1e62('0x12')][_0x1e62('0x14')]);}logger['error'](_0x1e62('0xe'),_0x51a8ce,_0x389998[_0x1e62('0x12')]['message']);return _0x128c72(_0x389998[_0x1e62('0x12')][_0x1e62('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x51a8ce,_0x1e62('0xf'));_0x128c72(_0x389998[_0x1e62('0x15')][_0x1e62('0x14')]);}})[_0x1e62('0x16')](function(_0x2599b8){logger[_0x1e62('0x12')](_0x1e62('0xe'),_0x51a8ce,_0x2599b8);_0x3f1e24(_0x2599b8);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b88dc63..b7d4b6f 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 _0x08e2=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x08e2,0xe0));var _0x208e=function(_0xb62ac4,_0x2d72fa){_0xb62ac4=_0xb62ac4-0x0;var _0xf2c8f4=_0x08e2[_0xb62ac4];return _0xf2c8f4;};'use strict';var multer=require(_0x208e('0x0'));var util=require(_0x208e('0x1'));var path=require(_0x208e('0x2'));var timeout=require(_0x208e('0x3'));var express=require(_0x208e('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x208e('0x5'));var config=require(_0x208e('0x6'));var controller=require(_0x208e('0x7'));router[_0x208e('0x8')]('/',auth[_0x208e('0x9')](),controller[_0x208e('0xa')]);router[_0x208e('0x8')](_0x208e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x208e('0x8')](_0x208e('0xc'),auth[_0x208e('0x9')](),controller[_0x208e('0xd')]);router[_0x208e('0xe')]('/',auth['isAuthenticated'](),controller[_0x208e('0xf')]);router[_0x208e('0xe')](_0x208e('0xc'),auth[_0x208e('0x9')](),controller[_0x208e('0x10')]);router[_0x208e('0xe')](_0x208e('0x11'),auth[_0x208e('0x9')](),controller[_0x208e('0x12')]);router[_0x208e('0x13')](_0x208e('0xb'),auth[_0x208e('0x9')](),controller[_0x208e('0x14')]);router[_0x208e('0x15')](_0x208e('0xb'),auth[_0x208e('0x9')](),controller[_0x208e('0x16')]);module[_0x208e('0x17')]=router; \ No newline at end of file +var _0x8611=['isAuthenticated','index','/:id','show','get','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x8611,0x143));var _0x1861=function(_0x36dc70,_0x4ca84d){_0x36dc70=_0x36dc70-0x0;var _0x43a65f=_0x8611[_0x36dc70];return _0x43a65f;};'use strict';var multer=require(_0x1861('0x0'));var util=require(_0x1861('0x1'));var path=require(_0x1861('0x2'));var timeout=require(_0x1861('0x3'));var express=require('express');var router=express[_0x1861('0x4')]();var auth=require(_0x1861('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1861('0x6'));var controller=require('./interval.controller');router['get']('/',auth[_0x1861('0x7')](),controller[_0x1861('0x8')]);router['get'](_0x1861('0x9'),auth[_0x1861('0x7')](),controller[_0x1861('0xa')]);router[_0x1861('0xb')](_0x1861('0xc'),auth['isAuthenticated'](),controller[_0x1861('0xd')]);router[_0x1861('0xe')]('/',auth['isAuthenticated'](),controller[_0x1861('0xf')]);router[_0x1861('0xe')]('/:id/sub_intervals',auth[_0x1861('0x7')](),controller[_0x1861('0x10')]);router['post'](_0x1861('0x11'),auth[_0x1861('0x7')](),controller['addIntervals']);router[_0x1861('0x12')](_0x1861('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x1861('0x13')]('/:id',auth[_0x1861('0x7')](),controller[_0x1861('0x14')]);module[_0x1861('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index ed7f3cf..c9c9eb5 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 _0x5419=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5419,0x175));var _0x9541=function(_0x302e01,_0x3fb113){_0x302e01=_0x302e01-0x0;var _0xa17411=_0x5419[_0x302e01];return _0xa17411;};'use strict';var Sequelize=require(_0x9541('0x0'));module[_0x9541('0x1')]={'name':{'type':Sequelize[_0x9541('0x2')]},'description':{'type':Sequelize[_0x9541('0x2')]},'interval':{'type':Sequelize[_0x9541('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x0586=['STRING','exports'];(function(_0x566342,_0x4a8a5d){var _0x1271e6=function(_0x294661){while(--_0x294661){_0x566342['push'](_0x566342['shift']());}};_0x1271e6(++_0x4a8a5d);}(_0x0586,0x15b));var _0x6058=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0586[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6058('0x0')]={'name':{'type':Sequelize[_0x6058('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6058('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 9ab2235..79b07ff 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 _0x9d8a=['ejs','crypto','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','then','destroy','get','error','name','send','index','Interval','rawAttributes','model','keys','query','intersection','fields','attributes','length','limit','order','sort','filters','pick','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','IntervalId','getIntervals','filter','addIntervals','findOne','sequelize','bulkCreate','html-pdf','eml-format','rimraf','request-promise','util','path','sox'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x9d8a,0x19d));var _0xa9d8=function(_0x4a734d,_0x5f1dec){_0x4a734d=_0x4a734d-0x0;var _0xdac9c2=_0x9d8a[_0x4a734d];return _0xdac9c2;};'use strict';var pdf=require(_0xa9d8('0x0'));var emlformat=require(_0xa9d8('0x1'));var rimraf=require(_0xa9d8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa9d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa9d8('0x4'));var path=require(_0xa9d8('0x5'));var sox=require(_0xa9d8('0x6'));var csv=require('to-csv');var ejs=require(_0xa9d8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa9d8('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xa9d8('0x9'));var toCsv=require('to-csv');var querystring=require(_0xa9d8('0xa'));var Papa=require(_0xa9d8('0xb'));var authService=require('../../components/auth/service');var hardwareService=require(_0xa9d8('0xc'));var Redis=require(_0xa9d8('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0xa9d8('0xe'))(_0xa9d8('0xf'));var utils=require(_0xa9d8('0x10'));var config=require(_0xa9d8('0x11'));var db=require(_0xa9d8('0x12'))['db'];var extensions=require(_0xa9d8('0x13'));function respondWithStatusCode(_0x2d5c6c,_0x462c68){_0x462c68=_0x462c68||0xcc;return function(_0x1709c2){if(_0x1709c2){return _0x2d5c6c[_0xa9d8('0x14')](_0x462c68);}return _0x2d5c6c[_0xa9d8('0x15')](_0x462c68)[_0xa9d8('0x16')]();};}function respondWithResult(_0xe17e92,_0x4e1db6){_0x4e1db6=_0x4e1db6||0xc8;return function(_0x2e22d0){if(_0x2e22d0){return _0xe17e92['status'](_0x4e1db6)[_0xa9d8('0x17')](_0x2e22d0);}};}function respondWithFilteredResult(_0x46d863,_0x3aa4f0){return function(_0x98caeb){if(_0x98caeb){var _0x135aed=_0x98caeb['count'],_0x188651=_0x3aa4f0[_0xa9d8('0x18')],_0x3a07f2=_0x3aa4f0['offset']+_0x3aa4f0['limit'],_0x3e1194;if(_0x3a07f2>=_0x135aed){_0x3a07f2=_0x135aed;_0x3e1194=0xc8;}else{_0x3e1194=0xce;}_0x46d863['status'](_0x3e1194);return _0x46d863[_0xa9d8('0x19')](_0xa9d8('0x1a'),_0x188651+'-'+_0x3a07f2+'/'+_0x135aed)[_0xa9d8('0x17')](_0x98caeb);}return null;};}function patchUpdates(_0x5b7ff8){return function(_0x765a6a){try{jsonpatch[_0xa9d8('0x1b')](_0x765a6a,_0x5b7ff8,!![]);}catch(_0x5b1489){return BPromise[_0xa9d8('0x1c')](_0x5b1489);}return _0x765a6a['save']();};}function saveUpdates(_0x39a59b,_0x2ce703){return function(_0x32f653){if(_0x32f653){return _0x32f653['update'](_0x39a59b)[_0xa9d8('0x1d')](function(_0xbb73b7){return _0xbb73b7;});}return null;};}function removeEntity(_0x27cccb,_0x509c5b){return function(_0x138545){if(_0x138545){return _0x138545[_0xa9d8('0x1e')]()['then'](function(){var _0x18af65=_0x138545[_0xa9d8('0x1f')]({'plain':!![]});var _0x835502='Intervals';return db['UserProfileResource'][_0xa9d8('0x1e')]({'where':{'type':_0x835502,'resourceId':_0x18af65['id']}})[_0xa9d8('0x1d')](function(){return _0x138545;});})[_0xa9d8('0x1d')](function(){_0x27cccb[_0xa9d8('0x15')](0xcc)[_0xa9d8('0x16')]();});}};}function handleEntityNotFound(_0x144c1a,_0x1b7463){return function(_0x309d02){if(!_0x309d02){_0x144c1a[_0xa9d8('0x14')](0x194);}return _0x309d02;};}function handleError(_0x4131ea,_0x3e70f8){_0x3e70f8=_0x3e70f8||0x1f4;return function(_0x51f2ee){logger[_0xa9d8('0x20')](_0x51f2ee['stack']);if(_0x51f2ee[_0xa9d8('0x21')]){delete _0x51f2ee[_0xa9d8('0x21')];}_0x4131ea['status'](_0x3e70f8)[_0xa9d8('0x22')](_0x51f2ee);};}exports[_0xa9d8('0x23')]=function(_0x911e39,_0x4c37f1){var _0x179e42={},_0x2805bd={},_0x5346b5={'count':0x0,'rows':[]};var _0x32f229=db[_0xa9d8('0x24')][_0xa9d8('0x25')];_0x2805bd[_0xa9d8('0x26')]=_[_0xa9d8('0x27')](_0x32f229);_0x2805bd[_0xa9d8('0x28')]=_['keys'](_0x911e39[_0xa9d8('0x28')]);_0x2805bd['filters']=_[_0xa9d8('0x29')](_0x2805bd[_0xa9d8('0x26')],_0x2805bd[_0xa9d8('0x28')]);_0x179e42['attributes']=_[_0xa9d8('0x29')](_0x2805bd[_0xa9d8('0x26')],qs['fields'](_0x911e39['query'][_0xa9d8('0x2a')]));_0x179e42[_0xa9d8('0x2b')]=_0x179e42['attributes'][_0xa9d8('0x2c')]?_0x179e42['attributes']:_0x2805bd[_0xa9d8('0x26')];if(!_0x911e39[_0xa9d8('0x28')]['hasOwnProperty']('nolimit')){_0x179e42['limit']=qs[_0xa9d8('0x2d')](_0x911e39[_0xa9d8('0x28')]['limit']);_0x179e42['offset']=qs['offset'](_0x911e39[_0xa9d8('0x28')][_0xa9d8('0x18')]);}_0x179e42[_0xa9d8('0x2e')]=qs[_0xa9d8('0x2f')](_0x911e39[_0xa9d8('0x28')][_0xa9d8('0x2f')]);_0x179e42['where']=qs[_0xa9d8('0x30')](_[_0xa9d8('0x31')](_0x911e39[_0xa9d8('0x28')],_0x2805bd[_0xa9d8('0x30')]));if(_0x911e39[_0xa9d8('0x28')]['filter']){_0x179e42[_0xa9d8('0x32')]=_[_0xa9d8('0x33')](_0x179e42[_0xa9d8('0x32')],{'$or':_[_0xa9d8('0x34')](_0x32f229,function(_0x30ad7f){if(_0x30ad7f[_0xa9d8('0x35')][_0xa9d8('0x36')]!==_0xa9d8('0x37')){var _0x203f84={};_0x203f84[_0x30ad7f[_0xa9d8('0x38')]]={'$like':'%'+_0x911e39['query']['filter']+'%'};return _0x203f84;}})});}_0x179e42=_[_0xa9d8('0x33')]({},_0x179e42,_0x911e39[_0xa9d8('0x39')]);var _0x37a607={'where':_0x179e42[_0xa9d8('0x32')]};return db['Interval']['count'](_0x37a607)[_0xa9d8('0x1d')](function(_0x47aa2e){_0x5346b5[_0xa9d8('0x3a')]=_0x47aa2e;if(_0x911e39[_0xa9d8('0x28')][_0xa9d8('0x3b')]){_0x179e42['include']=[{'all':!![]}];}return db[_0xa9d8('0x24')][_0xa9d8('0x3c')](_0x179e42);})[_0xa9d8('0x1d')](function(_0x221d30){_0x5346b5[_0xa9d8('0x3d')]=_0x221d30;return _0x5346b5;})[_0xa9d8('0x1d')](respondWithFilteredResult(_0x4c37f1,_0x179e42))[_0xa9d8('0x3e')](handleError(_0x4c37f1,null));};exports['show']=function(_0xe9629,_0x1337f9){var _0x113ad3={'raw':!![],'where':{'id':_0xe9629['params']['id']}},_0xea5a03={};_0xea5a03[_0xa9d8('0x26')]=_[_0xa9d8('0x27')](db[_0xa9d8('0x24')][_0xa9d8('0x25')]);_0xea5a03[_0xa9d8('0x28')]=_[_0xa9d8('0x27')](_0xe9629[_0xa9d8('0x28')]);_0xea5a03[_0xa9d8('0x30')]=_[_0xa9d8('0x29')](_0xea5a03[_0xa9d8('0x26')],_0xea5a03[_0xa9d8('0x28')]);_0x113ad3[_0xa9d8('0x2b')]=_[_0xa9d8('0x29')](_0xea5a03[_0xa9d8('0x26')],qs[_0xa9d8('0x2a')](_0xe9629[_0xa9d8('0x28')][_0xa9d8('0x2a')]));_0x113ad3[_0xa9d8('0x2b')]=_0x113ad3['attributes'][_0xa9d8('0x2c')]?_0x113ad3[_0xa9d8('0x2b')]:_0xea5a03[_0xa9d8('0x26')];if(_0xe9629[_0xa9d8('0x28')][_0xa9d8('0x3b')]){_0x113ad3[_0xa9d8('0x3f')]=[{'all':!![]}];}_0x113ad3=_[_0xa9d8('0x33')]({},_0x113ad3,_0xe9629['options']);return db[_0xa9d8('0x24')][_0xa9d8('0x40')](_0x113ad3)[_0xa9d8('0x1d')](handleEntityNotFound(_0x1337f9,null))['then'](respondWithResult(_0x1337f9,null))[_0xa9d8('0x3e')](handleError(_0x1337f9,null));};exports[_0xa9d8('0x41')]=function(_0x2644d6,_0x81eadc){return db[_0xa9d8('0x24')][_0xa9d8('0x41')](_0x2644d6[_0xa9d8('0x42')],{})[_0xa9d8('0x1d')](function(_0x4c9975){var _0x5a7c43=_0x2644d6['user'][_0xa9d8('0x1f')]({'plain':!![]});if(!_0x5a7c43)throw new Error(_0xa9d8('0x43'));if(_0x5a7c43[_0xa9d8('0x44')]===_0xa9d8('0x45')){var _0x56ea0d=_0x4c9975[_0xa9d8('0x1f')]({'plain':!![]});var _0x43e990=_0xa9d8('0x46');return db[_0xa9d8('0x47')]['find']({'where':{'name':_0x43e990,'userProfileId':_0x5a7c43[_0xa9d8('0x48')]},'raw':!![]})[_0xa9d8('0x1d')](function(_0x245935){if(_0x245935&&_0x245935[_0xa9d8('0x49')]===0x0){return db['UserProfileResource'][_0xa9d8('0x41')]({'name':_0x56ea0d[_0xa9d8('0x21')],'resourceId':_0x56ea0d['id'],'type':_0x245935[_0xa9d8('0x21')],'sectionId':_0x245935['id']},{})[_0xa9d8('0x1d')](function(){return _0x4c9975;});}else{return _0x4c9975;}})[_0xa9d8('0x3e')](function(_0x134a61){logger[_0xa9d8('0x20')](_0xa9d8('0x4a'),_0x134a61);throw _0x134a61;});}return _0x4c9975;})[_0xa9d8('0x1d')](respondWithResult(_0x81eadc,0xc9))[_0xa9d8('0x3e')](handleError(_0x81eadc,null));};exports[_0xa9d8('0x4b')]=function(_0x35c819,_0x4986fe){if(_0x35c819[_0xa9d8('0x42')]['id']){delete _0x35c819['body']['id'];}return db['Interval'][_0xa9d8('0x40')]({'where':{'id':_0x35c819[_0xa9d8('0x4c')]['id']}})[_0xa9d8('0x1d')](handleEntityNotFound(_0x4986fe,null))['then'](saveUpdates(_0x35c819['body'],null))['then'](respondWithResult(_0x4986fe,null))[_0xa9d8('0x3e')](handleError(_0x4986fe,null));};exports[_0xa9d8('0x1e')]=function(_0x298254,_0x5bfa88){return db[_0xa9d8('0x24')][_0xa9d8('0x40')]({'where':{'id':_0x298254['params']['id']}})[_0xa9d8('0x1d')](handleEntityNotFound(_0x5bfa88,null))['then'](removeEntity(_0x5bfa88,null))[_0xa9d8('0x3e')](handleError(_0x5bfa88,null));};exports['addInterval']=function(_0x169f3b,_0x275d61,_0x4a7cc9){if(_0x169f3b[_0xa9d8('0x42')]['id']){delete _0x169f3b['body']['id'];}return db[_0xa9d8('0x24')][_0xa9d8('0x40')]({'where':{'id':_0x169f3b[_0xa9d8('0x4c')]['id']}})[_0xa9d8('0x1d')](handleEntityNotFound(_0x275d61,null))[_0xa9d8('0x1d')](function(_0x49fec0){if(_0x49fec0){_0x169f3b[_0xa9d8('0x42')][_0xa9d8('0x4d')]=_0x49fec0['id'];return db[_0xa9d8('0x24')][_0xa9d8('0x41')](_0x169f3b[_0xa9d8('0x42')]);}})[_0xa9d8('0x1d')](respondWithResult(_0x275d61,null))[_0xa9d8('0x3e')](handleError(_0x275d61,null));};exports[_0xa9d8('0x4e')]=function(_0x50c86a,_0x1219b0,_0x3b8679){var _0x4d41c0={};var _0x40cb7b={};var _0x8d0ee0;var _0x5b6c67;return db[_0xa9d8('0x24')]['findOne']({'where':{'id':_0x50c86a['params']['id']}})[_0xa9d8('0x1d')](handleEntityNotFound(_0x1219b0,null))[_0xa9d8('0x1d')](function(_0x367f61){if(_0x367f61){_0x8d0ee0=_0x367f61;_0x40cb7b[_0xa9d8('0x26')]=_['keys'](db['Interval'][_0xa9d8('0x25')]);_0x40cb7b[_0xa9d8('0x28')]=_[_0xa9d8('0x27')](_0x50c86a[_0xa9d8('0x28')]);_0x40cb7b[_0xa9d8('0x30')]=_[_0xa9d8('0x29')](_0x40cb7b[_0xa9d8('0x26')],_0x40cb7b[_0xa9d8('0x28')]);_0x4d41c0[_0xa9d8('0x2b')]=_[_0xa9d8('0x29')](_0x40cb7b[_0xa9d8('0x26')],qs[_0xa9d8('0x2a')](_0x50c86a[_0xa9d8('0x28')][_0xa9d8('0x2a')]));_0x4d41c0[_0xa9d8('0x2b')]=_0x4d41c0[_0xa9d8('0x2b')][_0xa9d8('0x2c')]?_0x4d41c0[_0xa9d8('0x2b')]:_0x40cb7b[_0xa9d8('0x26')];_0x4d41c0['order']=qs[_0xa9d8('0x2f')](_0x50c86a[_0xa9d8('0x28')][_0xa9d8('0x2f')]);_0x4d41c0[_0xa9d8('0x32')]=qs[_0xa9d8('0x30')](_['pick'](_0x50c86a[_0xa9d8('0x28')],_0x40cb7b[_0xa9d8('0x30')]));if(_0x50c86a[_0xa9d8('0x28')][_0xa9d8('0x4f')]){_0x4d41c0['where']=_[_0xa9d8('0x33')](_0x4d41c0[_0xa9d8('0x32')],{'$or':_[_0xa9d8('0x34')](_0x4d41c0[_0xa9d8('0x2b')],function(_0x4659e9){var _0x1e6f39={};_0x1e6f39[_0x4659e9]={'$like':'%'+_0x50c86a[_0xa9d8('0x28')]['filter']+'%'};return _0x1e6f39;})});}_0x4d41c0=_['merge']({},_0x4d41c0,_0x50c86a[_0xa9d8('0x39')]);return _0x8d0ee0[_0xa9d8('0x4e')](_0x4d41c0);}})[_0xa9d8('0x1d')](function(_0x487b2f){if(_0x487b2f){_0x5b6c67=_0x487b2f[_0xa9d8('0x2c')];if(!_0x50c86a[_0xa9d8('0x28')]['hasOwnProperty']('nolimit')){_0x4d41c0[_0xa9d8('0x2d')]=qs['limit'](_0x50c86a[_0xa9d8('0x28')]['limit']);_0x4d41c0[_0xa9d8('0x18')]=qs[_0xa9d8('0x18')](_0x50c86a[_0xa9d8('0x28')][_0xa9d8('0x18')]);}return _0x8d0ee0[_0xa9d8('0x4e')](_0x4d41c0);}})[_0xa9d8('0x1d')](function(_0x3c9385){if(_0x3c9385){return _0x3c9385?{'count':_0x5b6c67,'rows':_0x3c9385}:null;}})['then'](respondWithResult(_0x1219b0,null))[_0xa9d8('0x3e')](handleError(_0x1219b0,null));};exports[_0xa9d8('0x50')]=function(_0x144d9f,_0x268ae9,_0x5f3314){return db['Interval'][_0xa9d8('0x51')]({'where':{'id':_0x144d9f[_0xa9d8('0x4c')]['id']}})[_0xa9d8('0x1d')](handleEntityNotFound(_0x268ae9,null))['then'](function(_0x4bd9c9){if(_0x4bd9c9){return db[_0xa9d8('0x52')]['transaction'](function(_0xa6a5ab){return db['Interval'][_0xa9d8('0x1e')]({'where':{'IntervalId':_0x144d9f[_0xa9d8('0x4c')]['id']},'transaction':_0xa6a5ab})[_0xa9d8('0x1d')](function(_0x343579){var _0x322ccb=_[_0xa9d8('0x34')](_0x144d9f['body'],function(_0x2d1489){delete _0x2d1489['id'];_0x2d1489[_0xa9d8('0x4d')]=_0x144d9f['params']['id'];return _0x2d1489;});return db[_0xa9d8('0x24')][_0xa9d8('0x53')](_0x322ccb,{'transaction':_0xa6a5ab});});})[_0xa9d8('0x1d')](function(){return db[_0xa9d8('0x24')]['findAll']({'where':{'IntervalId':_0x144d9f[_0xa9d8('0x4c')]['id']}});});}})['then'](respondWithResult(_0x268ae9,null))[_0xa9d8('0x3e')](handleError(_0x268ae9,null));}; \ No newline at end of file +var _0x7e8d=['userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','fields','map','addIntervals','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','../../components/extensions/rewrite','end','status','json','offset','Content-Range','apply','reject','then','get','Intervals','UserProfileResource','destroy','sendStatus','error','name','send','Interval','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','include','rows','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7e8d,0x1b0));var _0xd7e8=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x7e8d[_0x31991b];return _0x307304;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd7e8('0x0'));var rimraf=require(_0xd7e8('0x1'));var zipdir=require(_0xd7e8('0x2'));var jsonpatch=require(_0xd7e8('0x3'));var rp=require(_0xd7e8('0x4'));var moment=require(_0xd7e8('0x5'));var BPromise=require(_0xd7e8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd7e8('0x7'));var csv=require('to-csv');var ejs=require(_0xd7e8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd7e8('0x9'));var jsforce=require(_0xd7e8('0xa'));var deskjs=require(_0xd7e8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd7e8('0xc'));var Papa=require(_0xd7e8('0xd'));var authService=require(_0xd7e8('0xe'));var hardwareService=require(_0xd7e8('0xf'));var Redis=require(_0xd7e8('0x10'));var qs=require(_0xd7e8('0x11'));var logger=require(_0xd7e8('0x12'))('api');var utils=require(_0xd7e8('0x13'));var config=require('../../config/environment');var db=require(_0xd7e8('0x14'))['db'];var extensions=require(_0xd7e8('0x15'));function respondWithStatusCode(_0x3430cd,_0x37034e){_0x37034e=_0x37034e||0xcc;return function(_0x56d4af){if(_0x56d4af){return _0x3430cd['sendStatus'](_0x37034e);}return _0x3430cd['status'](_0x37034e)[_0xd7e8('0x16')]();};}function respondWithResult(_0x430677,_0x34169a){_0x34169a=_0x34169a||0xc8;return function(_0x34b534){if(_0x34b534){return _0x430677[_0xd7e8('0x17')](_0x34169a)[_0xd7e8('0x18')](_0x34b534);}};}function respondWithFilteredResult(_0xf1580c,_0x37ae6a){return function(_0x472eca){if(_0x472eca){var _0x2ac791=_0x472eca['count'],_0x208bac=_0x37ae6a[_0xd7e8('0x19')],_0x249efc=_0x37ae6a[_0xd7e8('0x19')]+_0x37ae6a['limit'],_0x364b1e;if(_0x249efc>=_0x2ac791){_0x249efc=_0x2ac791;_0x364b1e=0xc8;}else{_0x364b1e=0xce;}_0xf1580c[_0xd7e8('0x17')](_0x364b1e);return _0xf1580c['set'](_0xd7e8('0x1a'),_0x208bac+'-'+_0x249efc+'/'+_0x2ac791)[_0xd7e8('0x18')](_0x472eca);}return null;};}function patchUpdates(_0x1c757e){return function(_0x57c4bf){try{jsonpatch[_0xd7e8('0x1b')](_0x57c4bf,_0x1c757e,!![]);}catch(_0x3adcdc){return BPromise[_0xd7e8('0x1c')](_0x3adcdc);}return _0x57c4bf['save']();};}function saveUpdates(_0x454926,_0x24546b){return function(_0x32af81){if(_0x32af81){return _0x32af81['update'](_0x454926)[_0xd7e8('0x1d')](function(_0xc7ad52){return _0xc7ad52;});}return null;};}function removeEntity(_0x4679ba,_0x1872ac){return function(_0x4c95d8){if(_0x4c95d8){return _0x4c95d8['destroy']()[_0xd7e8('0x1d')](function(){var _0x9a78a7=_0x4c95d8[_0xd7e8('0x1e')]({'plain':!![]});var _0x504430=_0xd7e8('0x1f');return db[_0xd7e8('0x20')][_0xd7e8('0x21')]({'where':{'type':_0x504430,'resourceId':_0x9a78a7['id']}})[_0xd7e8('0x1d')](function(){return _0x4c95d8;});})[_0xd7e8('0x1d')](function(){_0x4679ba[_0xd7e8('0x17')](0xcc)[_0xd7e8('0x16')]();});}};}function handleEntityNotFound(_0x42f52e,_0x363ecf){return function(_0x2ce745){if(!_0x2ce745){_0x42f52e[_0xd7e8('0x22')](0x194);}return _0x2ce745;};}function handleError(_0x550e8b,_0x57e5b2){_0x57e5b2=_0x57e5b2||0x1f4;return function(_0x239a7a){logger[_0xd7e8('0x23')](_0x239a7a['stack']);if(_0x239a7a[_0xd7e8('0x24')]){delete _0x239a7a[_0xd7e8('0x24')];}_0x550e8b[_0xd7e8('0x17')](_0x57e5b2)[_0xd7e8('0x25')](_0x239a7a);};}exports['index']=function(_0x154f2a,_0x46e031){var _0x54ee27={},_0xfb46ec={},_0x4d22af={'count':0x0,'rows':[]};var _0x11e74e=db[_0xd7e8('0x26')][_0xd7e8('0x27')];_0xfb46ec['model']=_[_0xd7e8('0x28')](_0x11e74e);_0xfb46ec[_0xd7e8('0x29')]=_[_0xd7e8('0x28')](_0x154f2a['query']);_0xfb46ec[_0xd7e8('0x2a')]=_[_0xd7e8('0x2b')](_0xfb46ec[_0xd7e8('0x2c')],_0xfb46ec[_0xd7e8('0x29')]);_0x54ee27[_0xd7e8('0x2d')]=_['intersection'](_0xfb46ec[_0xd7e8('0x2c')],qs['fields'](_0x154f2a[_0xd7e8('0x29')]['fields']));_0x54ee27[_0xd7e8('0x2d')]=_0x54ee27[_0xd7e8('0x2d')][_0xd7e8('0x2e')]?_0x54ee27[_0xd7e8('0x2d')]:_0xfb46ec[_0xd7e8('0x2c')];if(!_0x154f2a[_0xd7e8('0x29')][_0xd7e8('0x2f')](_0xd7e8('0x30'))){_0x54ee27[_0xd7e8('0x31')]=qs[_0xd7e8('0x31')](_0x154f2a[_0xd7e8('0x29')][_0xd7e8('0x31')]);_0x54ee27[_0xd7e8('0x19')]=qs['offset'](_0x154f2a[_0xd7e8('0x29')][_0xd7e8('0x19')]);}_0x54ee27[_0xd7e8('0x32')]=qs['sort'](_0x154f2a[_0xd7e8('0x29')][_0xd7e8('0x33')]);_0x54ee27[_0xd7e8('0x34')]=qs['filters'](_[_0xd7e8('0x35')](_0x154f2a[_0xd7e8('0x29')],_0xfb46ec[_0xd7e8('0x2a')]));if(_0x154f2a['query'][_0xd7e8('0x36')]){_0x54ee27[_0xd7e8('0x34')]=_[_0xd7e8('0x37')](_0x54ee27[_0xd7e8('0x34')],{'$or':_['map'](_0x11e74e,function(_0x57acc2){if(_0x57acc2[_0xd7e8('0x38')][_0xd7e8('0x39')]!==_0xd7e8('0x3a')){var _0x8a8ce={};_0x8a8ce[_0x57acc2[_0xd7e8('0x3b')]]={'$like':'%'+_0x154f2a[_0xd7e8('0x29')][_0xd7e8('0x36')]+'%'};return _0x8a8ce;}})});}_0x54ee27=_[_0xd7e8('0x37')]({},_0x54ee27,_0x154f2a[_0xd7e8('0x3c')]);var _0x3c7566={'where':_0x54ee27[_0xd7e8('0x34')]};return db[_0xd7e8('0x26')][_0xd7e8('0x3d')](_0x3c7566)[_0xd7e8('0x1d')](function(_0x5aba3b){_0x4d22af[_0xd7e8('0x3d')]=_0x5aba3b;if(_0x154f2a[_0xd7e8('0x29')]['includeAll']){_0x54ee27[_0xd7e8('0x3e')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x54ee27);})[_0xd7e8('0x1d')](function(_0x199bb3){_0x4d22af[_0xd7e8('0x3f')]=_0x199bb3;return _0x4d22af;})['then'](respondWithFilteredResult(_0x46e031,_0x54ee27))['catch'](handleError(_0x46e031,null));};exports['show']=function(_0x56cdad,_0x34ab0b){var _0x1081f2={'raw':!![],'where':{'id':_0x56cdad[_0xd7e8('0x40')]['id']}},_0xf63289={};_0xf63289[_0xd7e8('0x2c')]=_[_0xd7e8('0x28')](db[_0xd7e8('0x26')][_0xd7e8('0x27')]);_0xf63289[_0xd7e8('0x29')]=_[_0xd7e8('0x28')](_0x56cdad[_0xd7e8('0x29')]);_0xf63289[_0xd7e8('0x2a')]=_[_0xd7e8('0x2b')](_0xf63289[_0xd7e8('0x2c')],_0xf63289[_0xd7e8('0x29')]);_0x1081f2['attributes']=_['intersection'](_0xf63289[_0xd7e8('0x2c')],qs['fields'](_0x56cdad['query']['fields']));_0x1081f2[_0xd7e8('0x2d')]=_0x1081f2[_0xd7e8('0x2d')]['length']?_0x1081f2[_0xd7e8('0x2d')]:_0xf63289[_0xd7e8('0x2c')];if(_0x56cdad['query'][_0xd7e8('0x41')]){_0x1081f2[_0xd7e8('0x3e')]=[{'all':!![]}];}_0x1081f2=_[_0xd7e8('0x37')]({},_0x1081f2,_0x56cdad[_0xd7e8('0x3c')]);return db[_0xd7e8('0x26')][_0xd7e8('0x42')](_0x1081f2)['then'](handleEntityNotFound(_0x34ab0b,null))[_0xd7e8('0x1d')](respondWithResult(_0x34ab0b,null))['catch'](handleError(_0x34ab0b,null));};exports[_0xd7e8('0x43')]=function(_0x4da79e,_0x21cfef){return db[_0xd7e8('0x26')][_0xd7e8('0x43')](_0x4da79e[_0xd7e8('0x44')],{})[_0xd7e8('0x1d')](function(_0xe9f0b2){var _0x11b09a=_0x4da79e[_0xd7e8('0x45')][_0xd7e8('0x1e')]({'plain':!![]});if(!_0x11b09a)throw new Error(_0xd7e8('0x46'));if(_0x11b09a['role']==='user'){var _0x5535c1=_0xe9f0b2[_0xd7e8('0x1e')]({'plain':!![]});var _0x3351e6=_0xd7e8('0x1f');return db[_0xd7e8('0x47')]['find']({'where':{'name':_0x3351e6,'userProfileId':_0x11b09a[_0xd7e8('0x48')]},'raw':!![]})[_0xd7e8('0x1d')](function(_0x1e5daf){if(_0x1e5daf&&_0x1e5daf['autoAssociation']===0x0){return db[_0xd7e8('0x20')][_0xd7e8('0x43')]({'name':_0x5535c1[_0xd7e8('0x24')],'resourceId':_0x5535c1['id'],'type':_0x1e5daf[_0xd7e8('0x24')],'sectionId':_0x1e5daf['id']},{})[_0xd7e8('0x1d')](function(){return _0xe9f0b2;});}else{return _0xe9f0b2;}})[_0xd7e8('0x49')](function(_0x22714f){logger['error'](_0xd7e8('0x4a'),_0x22714f);throw _0x22714f;});}return _0xe9f0b2;})[_0xd7e8('0x1d')](respondWithResult(_0x21cfef,0xc9))['catch'](handleError(_0x21cfef,null));};exports[_0xd7e8('0x4b')]=function(_0x3b7008,_0x15e874){if(_0x3b7008['body']['id']){delete _0x3b7008[_0xd7e8('0x44')]['id'];}return db[_0xd7e8('0x26')][_0xd7e8('0x42')]({'where':{'id':_0x3b7008[_0xd7e8('0x40')]['id']}})['then'](handleEntityNotFound(_0x15e874,null))[_0xd7e8('0x1d')](saveUpdates(_0x3b7008[_0xd7e8('0x44')],null))[_0xd7e8('0x1d')](respondWithResult(_0x15e874,null))[_0xd7e8('0x49')](handleError(_0x15e874,null));};exports[_0xd7e8('0x21')]=function(_0x24bcd0,_0x33aeb3){return db[_0xd7e8('0x26')][_0xd7e8('0x42')]({'where':{'id':_0x24bcd0['params']['id']}})[_0xd7e8('0x1d')](handleEntityNotFound(_0x33aeb3,null))[_0xd7e8('0x1d')](removeEntity(_0x33aeb3,null))[_0xd7e8('0x49')](handleError(_0x33aeb3,null));};exports[_0xd7e8('0x4c')]=function(_0x1c8949,_0x88a976,_0x44c3d6){if(_0x1c8949[_0xd7e8('0x44')]['id']){delete _0x1c8949[_0xd7e8('0x44')]['id'];}return db[_0xd7e8('0x26')][_0xd7e8('0x42')]({'where':{'id':_0x1c8949['params']['id']}})[_0xd7e8('0x1d')](handleEntityNotFound(_0x88a976,null))[_0xd7e8('0x1d')](function(_0x7597){if(_0x7597){_0x1c8949[_0xd7e8('0x44')][_0xd7e8('0x4d')]=_0x7597['id'];return db[_0xd7e8('0x26')][_0xd7e8('0x43')](_0x1c8949[_0xd7e8('0x44')]);}})[_0xd7e8('0x1d')](respondWithResult(_0x88a976,null))[_0xd7e8('0x49')](handleError(_0x88a976,null));};exports[_0xd7e8('0x4e')]=function(_0x551428,_0x16248f,_0x4037b6){var _0x2993d4={};var _0x5e77c3={};var _0x23c4e2;var _0x1b7085;return db[_0xd7e8('0x26')][_0xd7e8('0x4f')]({'where':{'id':_0x551428[_0xd7e8('0x40')]['id']}})[_0xd7e8('0x1d')](handleEntityNotFound(_0x16248f,null))[_0xd7e8('0x1d')](function(_0x482696){if(_0x482696){_0x23c4e2=_0x482696;_0x5e77c3[_0xd7e8('0x2c')]=_[_0xd7e8('0x28')](db['Interval'][_0xd7e8('0x27')]);_0x5e77c3[_0xd7e8('0x29')]=_[_0xd7e8('0x28')](_0x551428['query']);_0x5e77c3[_0xd7e8('0x2a')]=_[_0xd7e8('0x2b')](_0x5e77c3[_0xd7e8('0x2c')],_0x5e77c3[_0xd7e8('0x29')]);_0x2993d4[_0xd7e8('0x2d')]=_[_0xd7e8('0x2b')](_0x5e77c3[_0xd7e8('0x2c')],qs[_0xd7e8('0x50')](_0x551428['query'][_0xd7e8('0x50')]));_0x2993d4['attributes']=_0x2993d4[_0xd7e8('0x2d')]['length']?_0x2993d4['attributes']:_0x5e77c3['model'];_0x2993d4['order']=qs['sort'](_0x551428['query'][_0xd7e8('0x33')]);_0x2993d4['where']=qs[_0xd7e8('0x2a')](_['pick'](_0x551428[_0xd7e8('0x29')],_0x5e77c3[_0xd7e8('0x2a')]));if(_0x551428['query']['filter']){_0x2993d4[_0xd7e8('0x34')]=_[_0xd7e8('0x37')](_0x2993d4[_0xd7e8('0x34')],{'$or':_[_0xd7e8('0x51')](_0x2993d4[_0xd7e8('0x2d')],function(_0x2beccb){var _0x378ebd={};_0x378ebd[_0x2beccb]={'$like':'%'+_0x551428[_0xd7e8('0x29')][_0xd7e8('0x36')]+'%'};return _0x378ebd;})});}_0x2993d4=_[_0xd7e8('0x37')]({},_0x2993d4,_0x551428['options']);return _0x23c4e2[_0xd7e8('0x4e')](_0x2993d4);}})[_0xd7e8('0x1d')](function(_0xf48612){if(_0xf48612){_0x1b7085=_0xf48612[_0xd7e8('0x2e')];if(!_0x551428[_0xd7e8('0x29')][_0xd7e8('0x2f')](_0xd7e8('0x30'))){_0x2993d4[_0xd7e8('0x31')]=qs[_0xd7e8('0x31')](_0x551428[_0xd7e8('0x29')]['limit']);_0x2993d4[_0xd7e8('0x19')]=qs[_0xd7e8('0x19')](_0x551428[_0xd7e8('0x29')][_0xd7e8('0x19')]);}return _0x23c4e2[_0xd7e8('0x4e')](_0x2993d4);}})[_0xd7e8('0x1d')](function(_0x6612d8){if(_0x6612d8){return _0x6612d8?{'count':_0x1b7085,'rows':_0x6612d8}:null;}})['then'](respondWithResult(_0x16248f,null))[_0xd7e8('0x49')](handleError(_0x16248f,null));};exports[_0xd7e8('0x52')]=function(_0x4fcf54,_0x196f3d,_0x3f9e95){return db[_0xd7e8('0x26')][_0xd7e8('0x4f')]({'where':{'id':_0x4fcf54[_0xd7e8('0x40')]['id']}})[_0xd7e8('0x1d')](handleEntityNotFound(_0x196f3d,null))[_0xd7e8('0x1d')](function(_0xf88eac){if(_0xf88eac){return db['sequelize'][_0xd7e8('0x53')](function(_0x58e2f2){return db[_0xd7e8('0x26')][_0xd7e8('0x21')]({'where':{'IntervalId':_0x4fcf54[_0xd7e8('0x40')]['id']},'transaction':_0x58e2f2})[_0xd7e8('0x1d')](function(_0x28028f){var _0x31004f=_[_0xd7e8('0x51')](_0x4fcf54[_0xd7e8('0x44')],function(_0x57a113){delete _0x57a113['id'];_0x57a113[_0xd7e8('0x4d')]=_0x4fcf54[_0xd7e8('0x40')]['id'];return _0x57a113;});return db[_0xd7e8('0x26')]['bulkCreate'](_0x31004f,{'transaction':_0x58e2f2});});})[_0xd7e8('0x1d')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x4fcf54[_0xd7e8('0x40')]['id']}});});}})[_0xd7e8('0x1d')](respondWithResult(_0x196f3d,null))[_0xd7e8('0x49')](handleError(_0x196f3d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index aba4e9c..7f0edb8 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 _0x1259=['exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./interval.attributes','../../components/extensions/rewrite'];(function(_0x1c575c,_0x397b48){var _0x2f77fb=function(_0x3737dd){while(--_0x3737dd){_0x1c575c['push'](_0x1c575c['shift']());}};_0x2f77fb(++_0x397b48);}(_0x1259,0xe5));var _0x9125=function(_0x5e4219,_0x2342a0){_0x5e4219=_0x5e4219-0x0;var _0x395815=_0x1259[_0x5e4219];return _0x395815;};'use strict';var _=require(_0x9125('0x0'));var util=require(_0x9125('0x1'));var logger=require(_0x9125('0x2'))(_0x9125('0x3'));var moment=require(_0x9125('0x4'));var BPromise=require(_0x9125('0x5'));var rp=require(_0x9125('0x6'));var attributes=require(_0x9125('0x7'));var extensions=require(_0x9125('0x8'));module[_0x9125('0x9')]=function(_0x319beb,_0xbe14b4){return _0x319beb[_0x9125('0xa')](_0x9125('0xb'),attributes,{'tableName':_0x9125('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x370747,_0x4920b0){extensions['rewrite'](_0x319beb,_0x370747);},'afterBulkCreate':function(_0x4925b1,_0x3fe43,_0x4051d7){_0x4051d7();extensions[_0x9125('0xd')](_0x319beb,_0x4925b1[0x0]);},'afterUpdate':function(_0x1bde53,_0x33bd11){extensions[_0x9125('0xd')](_0x319beb,_0x1bde53);},'afterDestroy':function(_0x5ed4f5,_0x3ec26b){extensions['rewrite'](_0x319beb,_0x5ed4f5);}}});}; \ No newline at end of file +var _0x23a8=['./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','bluebird'];(function(_0xc127c1,_0x4375da){var _0x2cdb0f=function(_0x3afc66){while(--_0x3afc66){_0xc127c1['push'](_0xc127c1['shift']());}};_0x2cdb0f(++_0x4375da);}(_0x23a8,0x1d6));var _0x823a=function(_0x4d134b,_0x213f13){_0x4d134b=_0x4d134b-0x0;var _0x1cdd57=_0x23a8[_0x4d134b];return _0x1cdd57;};'use strict';var _=require(_0x823a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x823a('0x1'));var rp=require('request-promise');var attributes=require(_0x823a('0x2'));var extensions=require(_0x823a('0x3'));module[_0x823a('0x4')]=function(_0x4b3ad6,_0x43227d){return _0x4b3ad6[_0x823a('0x5')]('Interval',attributes,{'tableName':_0x823a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a3987,_0x245788){extensions[_0x823a('0x7')](_0x4b3ad6,_0x4a3987);},'afterBulkCreate':function(_0x2d737c,_0x3a18df,_0x2aa729){_0x2aa729();extensions[_0x823a('0x7')](_0x4b3ad6,_0x2d737c[0x0]);},'afterUpdate':function(_0x175b43,_0xc4d8aa){extensions['rewrite'](_0x4b3ad6,_0x175b43);},'afterDestroy':function(_0x3e811d,_0x4eb897){extensions[_0x823a('0x7')](_0x4b3ad6,_0x3e811d);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f0b180f..b01bab6 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 _0xe14b=['catch','GetInterval','Interval','findAll','options','raw','where','attributes','include','model','map','stringify','ShowInterval','find','debug','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Interval,\x20%s,\x20%s','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x451999,_0x1b3908){var _0x1b696e=function(_0x259ab1){while(--_0x259ab1){_0x451999['push'](_0x451999['shift']());}};_0x1b696e(++_0x1b3908);}(_0xe14b,0x93));var _0xbe14=function(_0x384bdb,_0x54c114){_0x384bdb=_0x384bdb-0x0;var _0x595bcd=_0xe14b[_0x384bdb];return _0x595bcd;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'limit':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['limit']||null:null,'include':_0x29ab73[_0xbe14('0x16')]?_0x29ab73['options'][_0xbe14('0x1a')]?_['map'](_0x29ab73[_0xbe14('0x16')][_0xbe14('0x1a')],function(_0x505dbd){return{'model':db[_0x505dbd[_0xbe14('0x1b')]],'as':_0x505dbd['as'],'attributes':_0x505dbd['attributes'],'include':_0x505dbd[_0xbe14('0x1a')]?_['map'](_0x505dbd[_0xbe14('0x1a')],function(_0x5fa043){return{'model':db[_0x5fa043[_0xbe14('0x1b')]],'as':_0x5fa043['as'],'attributes':_0x5fa043[_0xbe14('0x19')],'include':_0x5fa043[_0xbe14('0x1a')]?_[_0xbe14('0x1c')](_0x5fa043['include'],function(_0x1822e0){return{'model':db[_0x1822e0[_0xbe14('0x1b')]],'as':_0x1822e0['as'],'attributes':_0x1822e0[_0xbe14('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x5dd475){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x5dd475));_0x5ea1f8(_0x5dd475);})[_0xbe14('0x12')](function(_0x19252f){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x19252f[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x19252f[_0xbe14('0x10')]));});});};exports[_0xbe14('0x1e')]=function(_0x40538f){var _0x3bf43c=this;return new Promise(function(_0x39dc0a,_0x10ae36){return db[_0xbe14('0x14')][_0xbe14('0x1f')]({'raw':_0x40538f[_0xbe14('0x16')]?_0x40538f[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x40538f[_0xbe14('0x16')]?_0x40538f['options'][_0xbe14('0x18')]||null:null,'attributes':_0x40538f['options']?_0x40538f['options'][_0xbe14('0x19')]||null:null,'include':_0x40538f['options']?_0x40538f[_0xbe14('0x16')][_0xbe14('0x1a')]?_['map'](_0x40538f['options']['include'],function(_0x412ad5){return{'model':db[_0x412ad5[_0xbe14('0x1b')]],'as':_0x412ad5['as'],'attributes':_0x412ad5['attributes'],'include':_0x412ad5[_0xbe14('0x1a')]?_[_0xbe14('0x1c')](_0x412ad5[_0xbe14('0x1a')],function(_0x1aa849){return{'model':db[_0x1aa849[_0xbe14('0x1b')]],'as':_0x1aa849['as'],'attributes':_0x1aa849['attributes'],'include':_0x1aa849['include']?_[_0xbe14('0x1c')](_0x1aa849['include'],function(_0x5dd7aa){return{'model':db[_0x5dd7aa['model']],'as':_0x5dd7aa['as'],'attributes':_0x5dd7aa[_0xbe14('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x2bb45){logger[_0xbe14('0xa')](_0xbe14('0x1e'),_0x40538f);logger[_0xbe14('0x20')](_0xbe14('0x1e'),_0x40538f,JSON[_0xbe14('0x1d')](_0x2bb45));_0x39dc0a(_0x2bb45);})[_0xbe14('0x12')](function(_0x2dfd5a){logger[_0xbe14('0xe')](_0xbe14('0x1e'),_0x2dfd5a['message'],_0x40538f);_0x10ae36(_0x3bf43c['error'](0x1f4,_0x2dfd5a[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x04de=['Interval','findAll','options','raw','where','attributes','include','model','ShowInterval','find','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Interval,\x20%s,\x20%s','result','catch','GetInterval'];(function(_0x2ff8cb,_0x18ca49){var _0x4de8f3=function(_0x155399){while(--_0x155399){_0x2ff8cb['push'](_0x2ff8cb['shift']());}};_0x4de8f3(++_0x18ca49);}(_0x04de,0x107));var _0xe04d=function(_0x29d865,_0x710929){_0x29d865=_0x29d865-0x0;var _0x441618=_0x04de[_0x29d865];return _0x441618;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));var BPromise=require(_0xe04d('0x3'));var rs=require(_0xe04d('0x4'));var fs=require('fs');var Redis=require(_0xe04d('0x5'));var db=require(_0xe04d('0x6'))['db'];var utils=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var config=require(_0xe04d('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x531688,_0x55efb5,_0x210e93){return new BPromise(function(_0x72b1ce,_0x1be121){return client[_0xe04d('0xb')](_0x531688,_0x210e93)[_0xe04d('0xc')](function(_0x2ae3c9){logger[_0xe04d('0xd')]('Interval,\x20%s,\x20%s',_0x55efb5,_0xe04d('0xe'));logger[_0xe04d('0xf')](_0xe04d('0x10'),_0x55efb5,_0xe04d('0xe'),JSON[_0xe04d('0x11')](_0x2ae3c9));if(_0x2ae3c9[_0xe04d('0x12')]){if(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x13')]===0x1f4){logger[_0xe04d('0x12')]('Interval,\x20%s,\x20%s',_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x1be121(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x72b1ce(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}else{logger[_0xe04d('0xd')](_0xe04d('0x15'),_0x55efb5,'request\x20sent');_0x72b1ce(_0x2ae3c9[_0xe04d('0x16')]['message']);}})[_0xe04d('0x17')](function(_0x49c063){logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x49c063);_0x1be121(_0x49c063);});});}exports[_0xe04d('0x18')]=function(_0x93b107){var _0x4090e0=this;return new Promise(function(_0x35a2b4,_0x251772){return db[_0xe04d('0x19')][_0xe04d('0x1a')]({'raw':_0x93b107['options']?_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1c')]===undefined?!![]:![]:!![],'where':_0x93b107[_0xe04d('0x1b')]?_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1d')]||null:null,'attributes':_0x93b107[_0xe04d('0x1b')]?_0x93b107['options'][_0xe04d('0x1e')]||null:null,'limit':_0x93b107[_0xe04d('0x1b')]?_0x93b107['options']['limit']||null:null,'include':_0x93b107['options']?_0x93b107[_0xe04d('0x1b')]['include']?_['map'](_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1f')],function(_0x495f73){return{'model':db[_0x495f73[_0xe04d('0x20')]],'as':_0x495f73['as'],'attributes':_0x495f73['attributes'],'include':_0x495f73[_0xe04d('0x1f')]?_['map'](_0x495f73[_0xe04d('0x1f')],function(_0x456822){return{'model':db[_0x456822[_0xe04d('0x20')]],'as':_0x456822['as'],'attributes':_0x456822[_0xe04d('0x1e')],'include':_0x456822[_0xe04d('0x1f')]?_['map'](_0x456822[_0xe04d('0x1f')],function(_0x3e43ca){return{'model':db[_0x3e43ca[_0xe04d('0x20')]],'as':_0x3e43ca['as'],'attributes':_0x3e43ca[_0xe04d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc73068){logger[_0xe04d('0xd')](_0xe04d('0x18'),_0x93b107);logger['debug'](_0xe04d('0x18'),_0x93b107,JSON['stringify'](_0xc73068));_0x35a2b4(_0xc73068);})['catch'](function(_0x569e4b){logger[_0xe04d('0x12')](_0xe04d('0x18'),_0x569e4b['message'],_0x93b107);_0x251772(_0x4090e0['error'](0x1f4,_0x569e4b[_0xe04d('0x14')]));});});};exports[_0xe04d('0x21')]=function(_0xff4dfb){var _0x4a2a10=this;return new Promise(function(_0x2cf005,_0x370cea){return db['Interval'][_0xe04d('0x22')]({'raw':_0xff4dfb['options']?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1c')]===undefined?!![]:![]:!![],'where':_0xff4dfb['options']?_0xff4dfb[_0xe04d('0x1b')]['where']||null:null,'attributes':_0xff4dfb[_0xe04d('0x1b')]?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1e')]||null:null,'include':_0xff4dfb[_0xe04d('0x1b')]?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1f')]?_[_0xe04d('0x23')](_0xff4dfb['options'][_0xe04d('0x1f')],function(_0x152837){return{'model':db[_0x152837[_0xe04d('0x20')]],'as':_0x152837['as'],'attributes':_0x152837[_0xe04d('0x1e')],'include':_0x152837[_0xe04d('0x1f')]?_[_0xe04d('0x23')](_0x152837[_0xe04d('0x1f')],function(_0x10b44f){return{'model':db[_0x10b44f[_0xe04d('0x20')]],'as':_0x10b44f['as'],'attributes':_0x10b44f['attributes'],'include':_0x10b44f[_0xe04d('0x1f')]?_['map'](_0x10b44f[_0xe04d('0x1f')],function(_0x547f56){return{'model':db[_0x547f56['model']],'as':_0x547f56['as'],'attributes':_0x547f56[_0xe04d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe04d('0xc')](function(_0x261116){logger[_0xe04d('0xd')]('ShowInterval',_0xff4dfb);logger[_0xe04d('0xf')](_0xe04d('0x21'),_0xff4dfb,JSON[_0xe04d('0x11')](_0x261116));_0x2cf005(_0x261116);})[_0xe04d('0x17')](function(_0x322228){logger['error']('ShowInterval',_0x322228[_0xe04d('0x14')],_0xff4dfb);_0x370cea(_0x4a2a10['error'](0x1f4,_0x322228['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d4c9385..41d8b9a 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x419912,_0x988212){var _0x5c0ff3=function(_0x1ee0f5){while(--_0x1ee0f5){_0x419912['push'](_0x419912['shift']());}};_0x5c0ff3(++_0x988212);}(_0x5f2f,0x73));var _0xf5f2=function(_0x46b5b1,_0x373190){_0x46b5b1=_0x46b5b1-0x0;var _0x344652=_0x5f2f[_0x46b5b1];return _0x344652;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 6ea7c81..8a82391 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 _0x70e0=['error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','MOTGUI','Report','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','POST','base64','request','setEncoding','utf8','end','status','statusCode','json'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x70e0,0x17b));var _0x070e=function(_0x1281f1,_0x72eb40){_0x1281f1=_0x1281f1-0x0;var _0x5cb459=_0x70e0[_0x1281f1];return _0x5cb459;};'use strict';var BPromise=require(_0x070e('0x0'));var https=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var USERNAME='support';var PASSWORD=_0x070e('0x3');function openIssue(_0xee173,_0x277d32){var _0x2593e5={'fields':{'project':{'key':_0xee173['key']||_0x070e('0x4')},'summary':(_0xee173['summary']||_0x070e('0x5'))+'\x20from\x20'+_0xee173['ip'],'description':_0xee173['description']||JSON['stringify'](_0xee173),'issuetype':{'name':_0xee173[_0x070e('0x6')]||_0x070e('0x7')}}};_0x2593e5[_0x070e('0x8')][_0x070e('0x9')]=_0xee173[_0x070e('0xa')];_0x2593e5[_0x070e('0x8')][_0x070e('0xb')]=_0xee173['oldToken'];_0x2593e5['fields'][_0x070e('0xc')]=_0xee173[_0x070e('0xd')];_0x2593e5[_0x070e('0x8')][_0x070e('0xe')]=_0xee173[_0x070e('0xf')];_0x2593e5[_0x070e('0x8')][_0x070e('0x10')]=_0xee173[_0x070e('0x11')];_0x2593e5[_0x070e('0x8')][_0x070e('0x12')]=_0xee173['ip'];var _0x2930b8={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x070e('0x13'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x070e('0x14'))}};var _0x14c3fd=JSON['stringify'](_0x2593e5);var _0x5d3a38=https[_0x070e('0x15')](_0x2930b8,function(_0xeae1a5){_0xeae1a5[_0x070e('0x16')](_0x070e('0x17'));var _0x5bc71e='';_0xeae1a5['on']('data',function(_0x17e2e4){_0x5bc71e+=_0x17e2e4;});_0xeae1a5['on'](_0x070e('0x18'),function(){if(_0x277d32){return _0x277d32[_0x070e('0x19')](_0xeae1a5[_0x070e('0x1a')])[_0x070e('0x1b')](JSON['parse'](_0x5bc71e));}});});_0x5d3a38['on'](_0x070e('0x1c'),function(_0x168dc6){if(_0x277d32){return _0x277d32[_0x070e('0x19')](0x1f4)[_0x070e('0x1b')]({'errors':[{'message':_0x070e('0x1d'),'type':'api.jira'}]});}});_0x5d3a38['write'](_0x14c3fd);_0x5d3a38['end']();}exports[_0x070e('0x1e')]=openIssue;exports[_0x070e('0x1f')]=function(_0x20dc60,_0x4be0d7){_0x20dc60[_0x070e('0x20')]['ip']=_0x20dc60['headers'][_0x070e('0x21')]||_0x20dc60[_0x070e('0x22')][_0x070e('0x23')]||_0x20dc60[_0x070e('0x24')][_0x070e('0x23')]||_0x20dc60[_0x070e('0x22')][_0x070e('0x24')][_0x070e('0x23')];return openIssue(_0x20dc60['body'],_0x4be0d7);}; \ No newline at end of file +var _0x70e0=['error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','MOTGUI','Report','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','POST','base64','request','setEncoding','utf8','end','status','statusCode','json'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x70e0,0x17b));var _0x070e=function(_0x537745,_0x2566f6){_0x537745=_0x537745-0x0;var _0x1c2291=_0x70e0[_0x537745];return _0x1c2291;};'use strict';var BPromise=require(_0x070e('0x0'));var https=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var USERNAME='support';var PASSWORD=_0x070e('0x3');function openIssue(_0xee173,_0x277d32){var _0x2593e5={'fields':{'project':{'key':_0xee173['key']||_0x070e('0x4')},'summary':(_0xee173['summary']||_0x070e('0x5'))+'\x20from\x20'+_0xee173['ip'],'description':_0xee173['description']||JSON['stringify'](_0xee173),'issuetype':{'name':_0xee173[_0x070e('0x6')]||_0x070e('0x7')}}};_0x2593e5[_0x070e('0x8')][_0x070e('0x9')]=_0xee173[_0x070e('0xa')];_0x2593e5[_0x070e('0x8')][_0x070e('0xb')]=_0xee173['oldToken'];_0x2593e5['fields'][_0x070e('0xc')]=_0xee173[_0x070e('0xd')];_0x2593e5[_0x070e('0x8')][_0x070e('0xe')]=_0xee173[_0x070e('0xf')];_0x2593e5[_0x070e('0x8')][_0x070e('0x10')]=_0xee173[_0x070e('0x11')];_0x2593e5[_0x070e('0x8')][_0x070e('0x12')]=_0xee173['ip'];var _0x2930b8={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x070e('0x13'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x070e('0x14'))}};var _0x14c3fd=JSON['stringify'](_0x2593e5);var _0x5d3a38=https[_0x070e('0x15')](_0x2930b8,function(_0xeae1a5){_0xeae1a5[_0x070e('0x16')](_0x070e('0x17'));var _0x5bc71e='';_0xeae1a5['on']('data',function(_0x17e2e4){_0x5bc71e+=_0x17e2e4;});_0xeae1a5['on'](_0x070e('0x18'),function(){if(_0x277d32){return _0x277d32[_0x070e('0x19')](_0xeae1a5[_0x070e('0x1a')])[_0x070e('0x1b')](JSON['parse'](_0x5bc71e));}});});_0x5d3a38['on'](_0x070e('0x1c'),function(_0x168dc6){if(_0x277d32){return _0x277d32[_0x070e('0x19')](0x1f4)[_0x070e('0x1b')]({'errors':[{'message':_0x070e('0x1d'),'type':'api.jira'}]});}});_0x5d3a38['write'](_0x14c3fd);_0x5d3a38['end']();}exports[_0x070e('0x1e')]=openIssue;exports[_0x070e('0x1f')]=function(_0x20dc60,_0x4be0d7){_0x20dc60[_0x070e('0x20')]['ip']=_0x20dc60['headers'][_0x070e('0x21')]||_0x20dc60[_0x070e('0x22')][_0x070e('0x23')]||_0x20dc60[_0x070e('0x24')][_0x070e('0x23')]||_0x20dc60[_0x070e('0x22')][_0x070e('0x24')][_0x070e('0x23')];return openIssue(_0x20dc60['body'],_0x4be0d7);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 43b2a44..db50d81 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 _0xcc85=['index','/describe','isAuthenticated','describe','/:id','show','post','create','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x2bcb4d,_0x1b1d96){var _0x423940=function(_0x28e92e){while(--_0x28e92e){_0x2bcb4d['push'](_0x2bcb4d['shift']());}};_0x423940(++_0x1b1d96);}(_0xcc85,0x6e));var _0x5cc8=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0xcc85[_0x39d39d];return _0x577ac3;};'use strict';var multer=require(_0x5cc8('0x0'));var util=require('util');var path=require(_0x5cc8('0x1'));var timeout=require(_0x5cc8('0x2'));var express=require(_0x5cc8('0x3'));var router=express[_0x5cc8('0x4')]();var auth=require(_0x5cc8('0x5'));var interaction=require(_0x5cc8('0x6'));var config=require(_0x5cc8('0x7'));var controller=require(_0x5cc8('0x8'));router[_0x5cc8('0x9')]('/',auth['isAuthenticated'](),controller[_0x5cc8('0xa')]);router[_0x5cc8('0x9')](_0x5cc8('0xb'),auth[_0x5cc8('0xc')](),controller[_0x5cc8('0xd')]);router[_0x5cc8('0x9')](_0x5cc8('0xe'),auth[_0x5cc8('0xc')](),controller[_0x5cc8('0xf')]);router[_0x5cc8('0x10')]('/',auth[_0x5cc8('0xc')](),controller[_0x5cc8('0x11')]);router['put'](_0x5cc8('0xe'),auth['isAuthenticated'](),controller[_0x5cc8('0x12')]);router['delete'](_0x5cc8('0xe'),auth[_0x5cc8('0xc')](),controller[_0x5cc8('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4d4d=['describe','show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','/describe'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0x4d4d,0x183));var _0xd4d4=function(_0x5d38af,_0x40f1c7){_0x5d38af=_0x5d38af-0x0;var _0x227cd3=_0x4d4d[_0x5d38af];return _0x227cd3;};'use strict';var multer=require('multer');var util=require(_0xd4d4('0x0'));var path=require(_0xd4d4('0x1'));var timeout=require(_0xd4d4('0x2'));var express=require('express');var router=express[_0xd4d4('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd4d4('0x4'));var controller=require(_0xd4d4('0x5'));router[_0xd4d4('0x6')]('/',auth[_0xd4d4('0x7')](),controller['index']);router['get'](_0xd4d4('0x8'),auth[_0xd4d4('0x7')](),controller[_0xd4d4('0x9')]);router[_0xd4d4('0x6')]('/:id',auth[_0xd4d4('0x7')](),controller[_0xd4d4('0xa')]);router['post']('/',auth[_0xd4d4('0x7')](),controller[_0xd4d4('0xb')]);router[_0xd4d4('0xc')](_0xd4d4('0xd'),auth[_0xd4d4('0x7')](),controller[_0xd4d4('0xe')]);router[_0xd4d4('0xf')](_0xd4d4('0xd'),auth[_0xd4d4('0x7')](),controller[_0xd4d4('0x10')]);module[_0xd4d4('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index be03813..4cb0307 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 _0xcaa3=['STRING','TEXT','long','sequelize','exports'];(function(_0x36b535,_0x2fb432){var _0xd347ec=function(_0x2d797a){while(--_0x2d797a){_0x36b535['push'](_0x36b535['shift']());}};_0xd347ec(++_0x2fb432);}(_0xcaa3,0xcb));var _0x3caa=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xcaa3[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x3caa('0x0'));module[_0x3caa('0x1')]={'question':{'type':Sequelize[_0x3caa('0x2')]},'answer':{'type':Sequelize[_0x3caa('0x3')](_0x3caa('0x4'))},'membername':{'type':Sequelize[_0x3caa('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3caa('0x2')]},'calleridname':{'type':Sequelize[_0x3caa('0x2')]},'calleridnum':{'type':Sequelize[_0x3caa('0x2')]},'questionId':{'type':Sequelize[_0x3caa('0x2')]}}; \ No newline at end of file +var _0x6f2f=['STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x6f2f[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0xf6f2('0x0'));module[_0xf6f2('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize[_0xf6f2('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf6f2('0x2')]},'calleridname':{'type':Sequelize[_0xf6f2('0x2')]},'calleridnum':{'type':Sequelize[_0xf6f2('0x2')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 0fe4dcf..95cf2c1 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 _0x7a54=['mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','index','JscriptyAnswerReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','offset','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','include','rows','catch','show','params','length','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x2f19d8,_0x2ada94){var _0x46099c=function(_0x32813e){while(--_0x32813e){_0x2f19d8['push'](_0x2f19d8['shift']());}};_0x46099c(++_0x2ada94);}(_0x7a54,0x106));var _0x47a5=function(_0x1bd2c5,_0x4ee814){_0x1bd2c5=_0x1bd2c5-0x0;var _0x1ccf6e=_0x7a54[_0x1bd2c5];return _0x1ccf6e;};'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 authService=require(_0x47a5('0xe'));var hardwareService=require(_0x47a5('0xf'));var Redis=require('ioredis');var qs=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'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x5ef1b1,_0xe2dea9){return function(_0x385687){if(!_0x385687){_0x5ef1b1['sendStatus'](0x194);}return _0x385687;};}function handleError(_0x28747d,_0xc4cd63){_0xc4cd63=_0xc4cd63||0x1f4;return function(_0x4437f1){logger[_0x47a5('0x21')](_0x4437f1[_0x47a5('0x22')]);if(_0x4437f1['name']){delete _0x4437f1['name'];}_0x28747d[_0x47a5('0x16')](_0xc4cd63)['send'](_0x4437f1);};}exports[_0x47a5('0x23')]=function(_0x5b6c4e,_0x23cb77){var _0x378208={},_0x36ad34={},_0x1dac65={'count':0x0,'rows':[]};var _0x21f296=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x36ad34[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x21f296);_0x36ad34[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x29')]=_['intersection'](_0x36ad34[_0x47a5('0x26')],_0x36ad34['query']);_0x378208[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x36ad34[_0x47a5('0x26')],qs['fields'](_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x2c')]));_0x378208[_0x47a5('0x2a')]=_0x378208[_0x47a5('0x2a')]['length']?_0x378208['attributes']:_0x36ad34[_0x47a5('0x26')];if(!_0x5b6c4e[_0x47a5('0x28')]['hasOwnProperty']('nolimit')){_0x378208[_0x47a5('0x19')]=qs[_0x47a5('0x19')](_0x5b6c4e['query'][_0x47a5('0x19')]);_0x378208['offset']=qs[_0x47a5('0x2d')](_0x5b6c4e[_0x47a5('0x28')]['offset']);}_0x378208['order']=qs[_0x47a5('0x2e')](_0x5b6c4e['query'][_0x47a5('0x2e')]);_0x378208[_0x47a5('0x2f')]=qs[_0x47a5('0x29')](_['pick'](_0x5b6c4e[_0x47a5('0x28')],_0x36ad34['filters']));if(_0x5b6c4e['query'][_0x47a5('0x30')]){_0x378208['where']=_[_0x47a5('0x31')](_0x378208['where'],{'$or':_[_0x47a5('0x32')](_0x21f296,function(_0x3534cb){if(_0x3534cb[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xed6320={};_0xed6320[_0x3534cb[_0x47a5('0x36')]]={'$like':'%'+_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x30')]+'%'};return _0xed6320;}})});}_0x378208=_['merge']({},_0x378208,_0x5b6c4e[_0x47a5('0x37')]);var _0x10f136={'where':_0x378208['where']};return db[_0x47a5('0x24')][_0x47a5('0x18')](_0x10f136)[_0x47a5('0x20')](function(_0x49c4b5){_0x1dac65[_0x47a5('0x18')]=_0x49c4b5;if(_0x5b6c4e[_0x47a5('0x28')]['includeAll']){_0x378208[_0x47a5('0x38')]=[{'all':!![]}];}return db[_0x47a5('0x24')]['findAll'](_0x378208);})['then'](function(_0x5ebd8c){_0x1dac65[_0x47a5('0x39')]=_0x5ebd8c;return _0x1dac65;})['then'](respondWithFilteredResult(_0x23cb77,_0x378208))[_0x47a5('0x3a')](handleError(_0x23cb77,null));};exports[_0x47a5('0x3b')]=function(_0x301a85,_0x111f0d){var _0x1b2c80={'raw':!![],'where':{'id':_0x301a85[_0x47a5('0x3c')]['id']}},_0xcb5243={};_0xcb5243[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0xcb5243[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x301a85['query']);_0xcb5243[_0x47a5('0x29')]=_[_0x47a5('0x2b')](_0xcb5243[_0x47a5('0x26')],_0xcb5243[_0x47a5('0x28')]);_0x1b2c80['attributes']=_[_0x47a5('0x2b')](_0xcb5243['model'],qs['fields'](_0x301a85['query']['fields']));_0x1b2c80[_0x47a5('0x2a')]=_0x1b2c80['attributes'][_0x47a5('0x3d')]?_0x1b2c80[_0x47a5('0x2a')]:_0xcb5243[_0x47a5('0x26')];if(_0x301a85['query'][_0x47a5('0x3e')]){_0x1b2c80[_0x47a5('0x38')]=[{'all':!![]}];}_0x1b2c80=_['merge']({},_0x1b2c80,_0x301a85['options']);return db[_0x47a5('0x24')]['find'](_0x1b2c80)[_0x47a5('0x20')](handleEntityNotFound(_0x111f0d,null))[_0x47a5('0x20')](respondWithResult(_0x111f0d,null))[_0x47a5('0x3a')](handleError(_0x111f0d,null));};exports[_0x47a5('0x3f')]=function(_0x34a9ae,_0xf0edbb){return db[_0x47a5('0x24')][_0x47a5('0x3f')](_0x34a9ae[_0x47a5('0x40')],{})[_0x47a5('0x20')](respondWithResult(_0xf0edbb,0xc9))[_0x47a5('0x3a')](handleError(_0xf0edbb,null));};exports[_0x47a5('0x1e')]=function(_0xe28d76,_0x3574d4){if(_0xe28d76[_0x47a5('0x40')]['id']){delete _0xe28d76[_0x47a5('0x40')]['id'];}return db['JscriptyAnswerReport'][_0x47a5('0x41')]({'where':{'id':_0xe28d76[_0x47a5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3574d4,null))['then'](saveUpdates(_0xe28d76[_0x47a5('0x40')],null))['then'](respondWithResult(_0x3574d4,null))[_0x47a5('0x3a')](handleError(_0x3574d4,null));};exports[_0x47a5('0x1f')]=function(_0x54c35f,_0x4f62d3){return db[_0x47a5('0x24')]['find']({'where':{'id':_0x54c35f[_0x47a5('0x3c')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x20')](removeEntity(_0x4f62d3,null))[_0x47a5('0x3a')](handleError(_0x4f62d3,null));};exports[_0x47a5('0x42')]=function(_0x26acd2,_0x238ebb){return db['JscriptyAnswerReport']['describe']()[_0x47a5('0x20')](respondWithResult(_0x238ebb,null))[_0x47a5('0x3a')](handleError(_0x238ebb,null));}; \ No newline at end of file +var _0x7a54=['mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','index','JscriptyAnswerReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','offset','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','include','rows','catch','show','params','length','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x2a4064,_0x448d6a){var _0x5185fc=function(_0x4469f3){while(--_0x4469f3){_0x2a4064['push'](_0x2a4064['shift']());}};_0x5185fc(++_0x448d6a);}(_0x7a54,0x106));var _0x47a5=function(_0x822e2d,_0x15668f){_0x822e2d=_0x822e2d-0x0;var _0x1beb34=_0x7a54[_0x822e2d];return _0x1beb34;};'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 authService=require(_0x47a5('0xe'));var hardwareService=require(_0x47a5('0xf'));var Redis=require('ioredis');var qs=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'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x5ef1b1,_0xe2dea9){return function(_0x385687){if(!_0x385687){_0x5ef1b1['sendStatus'](0x194);}return _0x385687;};}function handleError(_0x28747d,_0xc4cd63){_0xc4cd63=_0xc4cd63||0x1f4;return function(_0x4437f1){logger[_0x47a5('0x21')](_0x4437f1[_0x47a5('0x22')]);if(_0x4437f1['name']){delete _0x4437f1['name'];}_0x28747d[_0x47a5('0x16')](_0xc4cd63)['send'](_0x4437f1);};}exports[_0x47a5('0x23')]=function(_0x5b6c4e,_0x23cb77){var _0x378208={},_0x36ad34={},_0x1dac65={'count':0x0,'rows':[]};var _0x21f296=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x36ad34[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x21f296);_0x36ad34[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x29')]=_['intersection'](_0x36ad34[_0x47a5('0x26')],_0x36ad34['query']);_0x378208[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x36ad34[_0x47a5('0x26')],qs['fields'](_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x2c')]));_0x378208[_0x47a5('0x2a')]=_0x378208[_0x47a5('0x2a')]['length']?_0x378208['attributes']:_0x36ad34[_0x47a5('0x26')];if(!_0x5b6c4e[_0x47a5('0x28')]['hasOwnProperty']('nolimit')){_0x378208[_0x47a5('0x19')]=qs[_0x47a5('0x19')](_0x5b6c4e['query'][_0x47a5('0x19')]);_0x378208['offset']=qs[_0x47a5('0x2d')](_0x5b6c4e[_0x47a5('0x28')]['offset']);}_0x378208['order']=qs[_0x47a5('0x2e')](_0x5b6c4e['query'][_0x47a5('0x2e')]);_0x378208[_0x47a5('0x2f')]=qs[_0x47a5('0x29')](_['pick'](_0x5b6c4e[_0x47a5('0x28')],_0x36ad34['filters']));if(_0x5b6c4e['query'][_0x47a5('0x30')]){_0x378208['where']=_[_0x47a5('0x31')](_0x378208['where'],{'$or':_[_0x47a5('0x32')](_0x21f296,function(_0x3534cb){if(_0x3534cb[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xed6320={};_0xed6320[_0x3534cb[_0x47a5('0x36')]]={'$like':'%'+_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x30')]+'%'};return _0xed6320;}})});}_0x378208=_['merge']({},_0x378208,_0x5b6c4e[_0x47a5('0x37')]);var _0x10f136={'where':_0x378208['where']};return db[_0x47a5('0x24')][_0x47a5('0x18')](_0x10f136)[_0x47a5('0x20')](function(_0x49c4b5){_0x1dac65[_0x47a5('0x18')]=_0x49c4b5;if(_0x5b6c4e[_0x47a5('0x28')]['includeAll']){_0x378208[_0x47a5('0x38')]=[{'all':!![]}];}return db[_0x47a5('0x24')]['findAll'](_0x378208);})['then'](function(_0x5ebd8c){_0x1dac65[_0x47a5('0x39')]=_0x5ebd8c;return _0x1dac65;})['then'](respondWithFilteredResult(_0x23cb77,_0x378208))[_0x47a5('0x3a')](handleError(_0x23cb77,null));};exports[_0x47a5('0x3b')]=function(_0x301a85,_0x111f0d){var _0x1b2c80={'raw':!![],'where':{'id':_0x301a85[_0x47a5('0x3c')]['id']}},_0xcb5243={};_0xcb5243[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0xcb5243[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x301a85['query']);_0xcb5243[_0x47a5('0x29')]=_[_0x47a5('0x2b')](_0xcb5243[_0x47a5('0x26')],_0xcb5243[_0x47a5('0x28')]);_0x1b2c80['attributes']=_[_0x47a5('0x2b')](_0xcb5243['model'],qs['fields'](_0x301a85['query']['fields']));_0x1b2c80[_0x47a5('0x2a')]=_0x1b2c80['attributes'][_0x47a5('0x3d')]?_0x1b2c80[_0x47a5('0x2a')]:_0xcb5243[_0x47a5('0x26')];if(_0x301a85['query'][_0x47a5('0x3e')]){_0x1b2c80[_0x47a5('0x38')]=[{'all':!![]}];}_0x1b2c80=_['merge']({},_0x1b2c80,_0x301a85['options']);return db[_0x47a5('0x24')]['find'](_0x1b2c80)[_0x47a5('0x20')](handleEntityNotFound(_0x111f0d,null))[_0x47a5('0x20')](respondWithResult(_0x111f0d,null))[_0x47a5('0x3a')](handleError(_0x111f0d,null));};exports[_0x47a5('0x3f')]=function(_0x34a9ae,_0xf0edbb){return db[_0x47a5('0x24')][_0x47a5('0x3f')](_0x34a9ae[_0x47a5('0x40')],{})[_0x47a5('0x20')](respondWithResult(_0xf0edbb,0xc9))[_0x47a5('0x3a')](handleError(_0xf0edbb,null));};exports[_0x47a5('0x1e')]=function(_0xe28d76,_0x3574d4){if(_0xe28d76[_0x47a5('0x40')]['id']){delete _0xe28d76[_0x47a5('0x40')]['id'];}return db['JscriptyAnswerReport'][_0x47a5('0x41')]({'where':{'id':_0xe28d76[_0x47a5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3574d4,null))['then'](saveUpdates(_0xe28d76[_0x47a5('0x40')],null))['then'](respondWithResult(_0x3574d4,null))[_0x47a5('0x3a')](handleError(_0x3574d4,null));};exports[_0x47a5('0x1f')]=function(_0x54c35f,_0x4f62d3){return db[_0x47a5('0x24')]['find']({'where':{'id':_0x54c35f[_0x47a5('0x3c')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x20')](removeEntity(_0x4f62d3,null))[_0x47a5('0x3a')](handleError(_0x4f62d3,null));};exports[_0x47a5('0x42')]=function(_0x26acd2,_0x238ebb){return db['JscriptyAnswerReport']['describe']()[_0x47a5('0x20')](respondWithResult(_0x238ebb,null))[_0x47a5('0x3a')](handleError(_0x238ebb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 853d92d..a8c7eba 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 _0xcf62=['report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0x338a15,_0x24be35){var _0x29619a=function(_0x5360a7){while(--_0x5360a7){_0x338a15['push'](_0x338a15['shift']());}};_0x29619a(++_0x24be35);}(_0xcf62,0x1f0));var _0x2cf6=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xcf62[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var util=require(_0x2cf6('0x0'));var logger=require(_0x2cf6('0x1'))(_0x2cf6('0x2'));var moment=require(_0x2cf6('0x3'));var BPromise=require(_0x2cf6('0x4'));var rp=require(_0x2cf6('0x5'));var attributes=require(_0x2cf6('0x6'));module[_0x2cf6('0x7')]=function(_0x4c243e,_0x26f8c9){return _0x4c243e[_0x2cf6('0x8')](_0x2cf6('0x9'),attributes,{'tableName':_0x2cf6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x411b=['moment','request-promise','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api'];(function(_0x32dcd0,_0x364dde){var _0x24e15b=function(_0x49349f){while(--_0x49349f){_0x32dcd0['push'](_0x32dcd0['shift']());}};_0x24e15b(++_0x364dde);}(_0x411b,0x1f1));var _0xb411=function(_0x48e253,_0x3d7334){_0x48e253=_0x48e253-0x0;var _0x368c39=_0x411b[_0x48e253];return _0x368c39;};'use strict';var _=require(_0xb411('0x0'));var util=require('util');var logger=require(_0xb411('0x1'))(_0xb411('0x2'));var moment=require(_0xb411('0x3'));var BPromise=require('bluebird');var rp=require(_0xb411('0x4'));var attributes=require(_0xb411('0x5'));module[_0xb411('0x6')]=function(_0x27233e,_0x2c34da){return _0x27233e[_0xb411('0x7')](_0xb411('0x8'),attributes,{'tableName':_0xb411('0x9'),'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 a215a26..37ca191 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 _0xdc32=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0xdc32,0xef));var _0x2dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dc3('0x0'));var util=require(_0x2dc3('0x1'));var moment=require(_0x2dc3('0x2'));var BPromise=require('bluebird');var rs=require(_0x2dc3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2dc3('0x4'));var logger=require('../../config/logger')(_0x2dc3('0x5'));var config=require(_0x2dc3('0x6'));var jayson=require(_0x2dc3('0x7'));var client=jayson[_0x2dc3('0x8')][_0x2dc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x278a18,_0x105839,_0x36915d){return new BPromise(function(_0x2ad6ed,_0x4fa525){return client[_0x2dc3('0xa')](_0x278a18,_0x36915d)[_0x2dc3('0xb')](function(_0x373dc9){logger[_0x2dc3('0xc')](_0x2dc3('0xd'),_0x105839,_0x2dc3('0xe'));logger[_0x2dc3('0xf')](_0x2dc3('0x10'),_0x105839,_0x2dc3('0xe'),JSON[_0x2dc3('0x11')](_0x373dc9));if(_0x373dc9[_0x2dc3('0x12')]){if(_0x373dc9[_0x2dc3('0x12')]['code']===0x1f4){logger[_0x2dc3('0x12')](_0x2dc3('0xd'),_0x105839,_0x373dc9[_0x2dc3('0x12')][_0x2dc3('0x13')]);return _0x4fa525(_0x373dc9[_0x2dc3('0x12')][_0x2dc3('0x13')]);}logger['error'](_0x2dc3('0xd'),_0x105839,_0x373dc9[_0x2dc3('0x12')][_0x2dc3('0x13')]);return _0x2ad6ed(_0x373dc9[_0x2dc3('0x12')][_0x2dc3('0x13')]);}else{logger[_0x2dc3('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x105839,'request\x20sent');_0x2ad6ed(_0x373dc9['result'][_0x2dc3('0x13')]);}})[_0x2dc3('0x14')](function(_0x121310){logger[_0x2dc3('0x12')](_0x2dc3('0xd'),_0x105839,_0x121310);_0x4fa525(_0x121310);});});} \ No newline at end of file +var _0xd19f=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xd19f,0x161));var _0xfd19=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0xd19f[_0x102b0c];return _0x9b15ca;};'use strict';var _=require(_0xfd19('0x0'));var util=require(_0xfd19('0x1'));var moment=require(_0xfd19('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd19('0x3'));var fs=require('fs');var Redis=require(_0xfd19('0x4'));var db=require(_0xfd19('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd19('0x6'))(_0xfd19('0x7'));var config=require(_0xfd19('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd19('0x9')][_0xfd19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c2fc8,_0x449716,_0x23bc96){return new BPromise(function(_0x51d6b9,_0x449990){return client[_0xfd19('0xb')](_0x5c2fc8,_0x23bc96)[_0xfd19('0xc')](function(_0x36135f){logger[_0xfd19('0xd')](_0xfd19('0xe'),_0x449716,_0xfd19('0xf'));logger[_0xfd19('0x10')](_0xfd19('0x11'),_0x449716,_0xfd19('0xf'),JSON['stringify'](_0x36135f));if(_0x36135f[_0xfd19('0x12')]){if(_0x36135f[_0xfd19('0x12')]['code']===0x1f4){logger[_0xfd19('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x449716,_0x36135f['error']['message']);return _0x449990(_0x36135f[_0xfd19('0x12')][_0xfd19('0x13')]);}logger[_0xfd19('0x12')](_0xfd19('0xe'),_0x449716,_0x36135f[_0xfd19('0x12')]['message']);return _0x51d6b9(_0x36135f[_0xfd19('0x12')][_0xfd19('0x13')]);}else{logger[_0xfd19('0xd')](_0xfd19('0xe'),_0x449716,_0xfd19('0xf'));_0x51d6b9(_0x36135f[_0xfd19('0x14')][_0xfd19('0x13')]);}})[_0xfd19('0x15')](function(_0x277c4e){logger[_0xfd19('0x12')](_0xfd19('0xe'),_0x449716,_0x277c4e);_0x449990(_0x277c4e);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 1894edb..fe36828 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 _0xe2dc=['Router','../../components/auth/service','../../config/environment','isAuthenticated','index','show','/:id/sessions','getSessions','get','getAnswers','/:id/summary','30s','create','post','/:id/clone','clone','put','update','delete','/:id','destroy','exports','multer','connect-timeout','express'];(function(_0x158d27,_0x3fafef){var _0x200219=function(_0x168f46){while(--_0x168f46){_0x158d27['push'](_0x158d27['shift']());}};_0x200219(++_0x3fafef);}(_0xe2dc,0xde));var _0xce2d=function(_0x50430d,_0x46a9ad){_0x50430d=_0x50430d-0x0;var _0xbf0108=_0xe2dc[_0x50430d];return _0xbf0108;};'use strict';var multer=require(_0xce2d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xce2d('0x1'));var express=require(_0xce2d('0x2'));var router=express[_0xce2d('0x3')]();var auth=require(_0xce2d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce2d('0x5'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0xce2d('0x6')](),controller[_0xce2d('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xce2d('0x8')]);router['get'](_0xce2d('0x9'),auth[_0xce2d('0x6')](),controller[_0xce2d('0xa')]);router[_0xce2d('0xb')]('/:id/answers',auth[_0xce2d('0x6')](),controller[_0xce2d('0xc')]);router[_0xce2d('0xb')](_0xce2d('0xd'),auth[_0xce2d('0x6')](),timeout(_0xce2d('0xe')),controller['getSummary']);router['post']('/',auth[_0xce2d('0x6')](),controller[_0xce2d('0xf')]);router[_0xce2d('0x10')](_0xce2d('0x11'),auth[_0xce2d('0x6')](),controller[_0xce2d('0x12')]);router[_0xce2d('0x13')]('/:id',auth[_0xce2d('0x6')](),controller[_0xce2d('0x14')]);router[_0xce2d('0x15')](_0xce2d('0x16'),auth['isAuthenticated'](),controller[_0xce2d('0x17')]);module[_0xce2d('0x18')]=router; \ No newline at end of file +var _0xb9fa=['get','isAuthenticated','index','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28d9d5,_0xef71e0){var _0x5f41fc=function(_0x3ef5d7){while(--_0x3ef5d7){_0x28d9d5['push'](_0x28d9d5['shift']());}};_0x5f41fc(++_0xef71e0);}(_0xb9fa,0x1a8));var _0xab9f=function(_0x50f79c,_0x14cc0f){_0x50f79c=_0x50f79c-0x0;var _0x57e024=_0xb9fa[_0x50f79c];return _0x57e024;};'use strict';var multer=require('multer');var util=require(_0xab9f('0x0'));var path=require(_0xab9f('0x1'));var timeout=require(_0xab9f('0x2'));var express=require(_0xab9f('0x3'));var router=express[_0xab9f('0x4')]();var auth=require(_0xab9f('0x5'));var interaction=require(_0xab9f('0x6'));var config=require(_0xab9f('0x7'));var controller=require('./jscriptyProject.controller');router[_0xab9f('0x8')]('/',auth[_0xab9f('0x9')](),controller[_0xab9f('0xa')]);router['get']('/:id',auth[_0xab9f('0x9')](),controller['show']);router[_0xab9f('0x8')](_0xab9f('0xb'),auth[_0xab9f('0x9')](),controller[_0xab9f('0xc')]);router[_0xab9f('0x8')](_0xab9f('0xd'),auth[_0xab9f('0x9')](),controller['getAnswers']);router['get'](_0xab9f('0xe'),auth[_0xab9f('0x9')](),timeout(_0xab9f('0xf')),controller[_0xab9f('0x10')]);router[_0xab9f('0x11')]('/',auth[_0xab9f('0x9')](),controller[_0xab9f('0x12')]);router[_0xab9f('0x11')](_0xab9f('0x13'),auth[_0xab9f('0x9')](),controller[_0xab9f('0x14')]);router[_0xab9f('0x15')]('/:id',auth[_0xab9f('0x9')](),controller[_0xab9f('0x16')]);router[_0xab9f('0x17')](_0xab9f('0x18'),auth[_0xab9f('0x9')](),controller[_0xab9f('0x19')]);module[_0xab9f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 76363c4..e6e9389 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 _0x34c5=['long','isObjectLike','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','STRING','name'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x34c5,0x87));var _0x534c=function(_0x570571,_0x2bff10){_0x570571=_0x570571-0x0;var _0x302694=_0x34c5[_0x570571];return _0x302694;};'use strict';var Sequelize=require(_0x534c('0x0'));var _=require(_0x534c('0x1'));var util=require(_0x534c('0x2'));module['exports']={'name':{'type':Sequelize[_0x534c('0x3')],'unique':_0x534c('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x534c('0x5')),'set':function(_0x55807c){if(_[_0x534c('0x6')](_0x55807c)){this['setDataValue'](_0x534c('0x7'),JSON[_0x534c('0x8')](_0x55807c));}else if(_[_0x534c('0x9')](_0x55807c)){this[_0x534c('0xa')]('formData',_0x55807c);}else{this[_0x534c('0xa')](_0x534c('0x7'),util['format'](_0x534c('0xb'),this[_0x534c('0xc')](_0x534c('0x4'))||'',this[_0x534c('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x534c('0xd')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc5b7=['exports','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util'];(function(_0xc53d5e,_0x29c93e){var _0x49abdf=function(_0x2eb88e){while(--_0x2eb88e){_0xc53d5e['push'](_0xc53d5e['shift']());}};_0x49abdf(++_0x29c93e);}(_0xc5b7,0x93));var _0x7c5b=function(_0x548d6e,_0x523a72){_0x548d6e=_0x548d6e-0x0;var _0x11ce65=_0xc5b7[_0x548d6e];return _0x11ce65;};'use strict';var Sequelize=require(_0x7c5b('0x0'));var _=require(_0x7c5b('0x1'));var util=require(_0x7c5b('0x2'));module[_0x7c5b('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x7c5b('0x4')]},'formData':{'type':Sequelize[_0x7c5b('0x5')](_0x7c5b('0x6')),'set':function(_0x1e1c34){if(_[_0x7c5b('0x7')](_0x1e1c34)){this[_0x7c5b('0x8')](_0x7c5b('0x9'),JSON[_0x7c5b('0xa')](_0x1e1c34));}else if(_[_0x7c5b('0xb')](_0x1e1c34)){this['setDataValue'](_0x7c5b('0x9'),_0x1e1c34);}else{this[_0x7c5b('0x8')](_0x7c5b('0x9'),util['format'](_0x7c5b('0xc'),this['getDataValue']('name')||'',this[_0x7c5b('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7c5b('0xe')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 9dbc8be..6984aaa 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 _0x288c=['status','end','count','offset','limit','Content-Range','json','apply','reject','then','destroy','Projects','UserProfileResource','sendStatus','error','name','send','index','JscriptyProject','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','map','type','key','includeAll','include','rows','catch','params','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','update','getSessions','findOne','JscriptySessionReport','order','pick','ProjectId','findAll','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','api','../../mysqldb'];(function(_0x2ff115,_0x5864a8){var _0x3c5c72=function(_0x2f5b80){while(--_0x2f5b80){_0x2ff115['push'](_0x2ff115['shift']());}};_0x3c5c72(++_0x5864a8);}(_0x288c,0x1a4));var _0xc288=function(_0xd4d369,_0x4f6ad2){_0xd4d369=_0xd4d369-0x0;var _0x293e5d=_0x288c[_0xd4d369];return _0x293e5d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc288('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc288('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc288('0x2'));var BPromise=require(_0xc288('0x3'));var Mustache=require(_0xc288('0x4'));var util=require(_0xc288('0x5'));var path=require(_0xc288('0x6'));var sox=require(_0xc288('0x7'));var csv=require(_0xc288('0x8'));var ejs=require(_0xc288('0x9'));var fs=require('fs');var _=require(_0xc288('0xa'));var squel=require(_0xc288('0xb'));var crypto=require(_0xc288('0xc'));var jsforce=require(_0xc288('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc288('0x8'));var querystring=require(_0xc288('0xe'));var Papa=require(_0xc288('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xc288('0x10'));var Redis=require(_0xc288('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc288('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc288('0x13'))['db'];function respondWithStatusCode(_0x3ff44d,_0xadb632){_0xadb632=_0xadb632||0xcc;return function(_0x2e62a0){if(_0x2e62a0){return _0x3ff44d['sendStatus'](_0xadb632);}return _0x3ff44d[_0xc288('0x14')](_0xadb632)[_0xc288('0x15')]();};}function respondWithResult(_0x3de165,_0x96f6b0){_0x96f6b0=_0x96f6b0||0xc8;return function(_0x1cf9e8){if(_0x1cf9e8){return _0x3de165['status'](_0x96f6b0)['json'](_0x1cf9e8);}};}function respondWithFilteredResult(_0x3a9474,_0x59ed2b){return function(_0xd7f66b){if(_0xd7f66b){var _0x4d3f99=_0xd7f66b[_0xc288('0x16')],_0x12d0b8=_0x59ed2b[_0xc288('0x17')],_0x1208bc=_0x59ed2b[_0xc288('0x17')]+_0x59ed2b[_0xc288('0x18')],_0x12ff87;if(_0x1208bc>=_0x4d3f99){_0x1208bc=_0x4d3f99;_0x12ff87=0xc8;}else{_0x12ff87=0xce;}_0x3a9474[_0xc288('0x14')](_0x12ff87);return _0x3a9474['set'](_0xc288('0x19'),_0x12d0b8+'-'+_0x1208bc+'/'+_0x4d3f99)[_0xc288('0x1a')](_0xd7f66b);}return null;};}function patchUpdates(_0x9154c1){return function(_0x54012c){try{jsonpatch[_0xc288('0x1b')](_0x54012c,_0x9154c1,!![]);}catch(_0x214680){return BPromise[_0xc288('0x1c')](_0x214680);}return _0x54012c['save']();};}function saveUpdates(_0x560683,_0x1b26d8){return function(_0x58b9e3){if(_0x58b9e3){return _0x58b9e3['update'](_0x560683)[_0xc288('0x1d')](function(_0x5d50ea){return _0x5d50ea;});}return null;};}function removeEntity(_0x3ef2a3,_0x3d031b){return function(_0x438328){if(_0x438328){return _0x438328[_0xc288('0x1e')]()[_0xc288('0x1d')](function(){var _0x49b247=_0x438328['get']({'plain':!![]});var _0x9493a9=_0xc288('0x1f');return db[_0xc288('0x20')][_0xc288('0x1e')]({'where':{'type':_0x9493a9,'resourceId':_0x49b247['id']}})[_0xc288('0x1d')](function(){return _0x438328;});})[_0xc288('0x1d')](function(){_0x3ef2a3[_0xc288('0x14')](0xcc)[_0xc288('0x15')]();});}};}function handleEntityNotFound(_0x5d250d,_0x2981f7){return function(_0x1be2f3){if(!_0x1be2f3){_0x5d250d[_0xc288('0x21')](0x194);}return _0x1be2f3;};}function handleError(_0x200879,_0x269182){_0x269182=_0x269182||0x1f4;return function(_0x36e1e3){logger[_0xc288('0x22')](_0x36e1e3['stack']);if(_0x36e1e3[_0xc288('0x23')]){delete _0x36e1e3[_0xc288('0x23')];}_0x200879[_0xc288('0x14')](_0x269182)[_0xc288('0x24')](_0x36e1e3);};}exports[_0xc288('0x25')]=function(_0x45bfad,_0x1d64d5){var _0x5c07a6={},_0x4f45b0={},_0x430b49={'count':0x0,'rows':[]};var _0x23bc2a=db[_0xc288('0x26')][_0xc288('0x27')];_0x4f45b0[_0xc288('0x28')]=_[_0xc288('0x29')](_0x23bc2a);_0x4f45b0[_0xc288('0x2a')]=_[_0xc288('0x29')](_0x45bfad[_0xc288('0x2a')]);_0x4f45b0['filters']=_[_0xc288('0x2b')](_0x4f45b0[_0xc288('0x28')],_0x4f45b0[_0xc288('0x2a')]);_0x5c07a6[_0xc288('0x2c')]=_[_0xc288('0x2b')](_0x4f45b0[_0xc288('0x28')],qs[_0xc288('0x2d')](_0x45bfad[_0xc288('0x2a')]['fields']));_0x5c07a6[_0xc288('0x2c')]=_0x5c07a6[_0xc288('0x2c')][_0xc288('0x2e')]?_0x5c07a6[_0xc288('0x2c')]:_0x4f45b0[_0xc288('0x28')];if(!_0x45bfad['query'][_0xc288('0x2f')](_0xc288('0x30'))){_0x5c07a6[_0xc288('0x18')]=qs[_0xc288('0x18')](_0x45bfad[_0xc288('0x2a')][_0xc288('0x18')]);_0x5c07a6[_0xc288('0x17')]=qs[_0xc288('0x17')](_0x45bfad[_0xc288('0x2a')][_0xc288('0x17')]);}_0x5c07a6['order']=qs[_0xc288('0x31')](_0x45bfad[_0xc288('0x2a')][_0xc288('0x31')]);_0x5c07a6['where']=qs['filters'](_['pick'](_0x45bfad[_0xc288('0x2a')],_0x4f45b0[_0xc288('0x32')]));if(_0x45bfad['query'][_0xc288('0x33')]){_0x5c07a6[_0xc288('0x34')]=_[_0xc288('0x35')](_0x5c07a6[_0xc288('0x34')],{'$or':_[_0xc288('0x36')](_0x23bc2a,function(_0x3c30c7){if(_0x3c30c7[_0xc288('0x37')][_0xc288('0x38')]!=='VIRTUAL'){var _0x3e99df={};_0x3e99df[_0x3c30c7['field']]={'$like':'%'+_0x45bfad[_0xc288('0x2a')]['filter']+'%'};return _0x3e99df;}})});}_0x5c07a6=_[_0xc288('0x35')]({},_0x5c07a6,_0x45bfad['options']);var _0xf15279={'where':_0x5c07a6['where']};return db[_0xc288('0x26')][_0xc288('0x16')](_0xf15279)[_0xc288('0x1d')](function(_0x606d71){_0x430b49[_0xc288('0x16')]=_0x606d71;if(_0x45bfad[_0xc288('0x2a')][_0xc288('0x39')]){_0x5c07a6[_0xc288('0x3a')]=[{'all':!![]}];}return db[_0xc288('0x26')]['findAll'](_0x5c07a6);})[_0xc288('0x1d')](function(_0x5d4fa5){_0x430b49[_0xc288('0x3b')]=_0x5d4fa5;return _0x430b49;})[_0xc288('0x1d')](respondWithFilteredResult(_0x1d64d5,_0x5c07a6))[_0xc288('0x3c')](handleError(_0x1d64d5,null));};exports['show']=function(_0x536784,_0x417366){var _0x38e24f={'raw':![],'where':{'id':_0x536784[_0xc288('0x3d')]['id']}},_0x26fd39={};_0x26fd39[_0xc288('0x28')]=_[_0xc288('0x29')](db[_0xc288('0x26')][_0xc288('0x27')]);_0x26fd39['query']=_[_0xc288('0x29')](_0x536784['query']);_0x26fd39[_0xc288('0x32')]=_['intersection'](_0x26fd39[_0xc288('0x28')],_0x26fd39[_0xc288('0x2a')]);_0x38e24f['attributes']=_[_0xc288('0x2b')](_0x26fd39['model'],qs[_0xc288('0x2d')](_0x536784[_0xc288('0x2a')]['fields']));_0x38e24f[_0xc288('0x2c')]=_0x38e24f['attributes'][_0xc288('0x2e')]?_0x38e24f[_0xc288('0x2c')]:_0x26fd39['model'];if(_0x536784[_0xc288('0x2a')]['includeAll']){_0x38e24f[_0xc288('0x3a')]=[{'all':!![]}];}_0x38e24f=_[_0xc288('0x35')]({},_0x38e24f,_0x536784[_0xc288('0x3e')]);return db[_0xc288('0x26')][_0xc288('0x3f')](_0x38e24f)[_0xc288('0x1d')](handleEntityNotFound(_0x417366,null))[_0xc288('0x1d')](respondWithResult(_0x417366,null))[_0xc288('0x3c')](handleError(_0x417366,null));};exports['create']=function(_0x19e94c,_0x2f1aa6){return db[_0xc288('0x26')][_0xc288('0x40')](_0x19e94c[_0xc288('0x41')],{})[_0xc288('0x1d')](function(_0x2468ab){var _0x2621cc=_0x19e94c['user'][_0xc288('0x42')]({'plain':!![]});if(!_0x2621cc)throw new Error(_0xc288('0x43'));if(_0x2621cc[_0xc288('0x44')]===_0xc288('0x45')){var _0x2519b1=_0x2468ab[_0xc288('0x42')]({'plain':!![]});var _0x5196bd=_0xc288('0x1f');return db[_0xc288('0x46')][_0xc288('0x3f')]({'where':{'name':_0x5196bd,'userProfileId':_0x2621cc[_0xc288('0x47')]},'raw':!![]})[_0xc288('0x1d')](function(_0xbd4494){if(_0xbd4494&&_0xbd4494[_0xc288('0x48')]===0x0){return db[_0xc288('0x20')][_0xc288('0x40')]({'name':_0x2519b1[_0xc288('0x23')],'resourceId':_0x2519b1['id'],'type':_0xbd4494[_0xc288('0x23')],'sectionId':_0xbd4494['id']},{})['then'](function(){return _0x2468ab;});}else{return _0x2468ab;}})[_0xc288('0x3c')](function(_0x50f1f2){logger[_0xc288('0x22')](_0xc288('0x49'),_0x50f1f2);throw _0x50f1f2;});}return _0x2468ab;})[_0xc288('0x1d')](respondWithResult(_0x2f1aa6,0xc9))[_0xc288('0x3c')](handleError(_0x2f1aa6,null));};exports['clone']=function(_0x311167,_0x64f4f9){var _0xb27624={'raw':![],'where':{'id':_0x311167[_0xc288('0x3d')]['id']}},_0x57afc1={};_0x57afc1[_0xc288('0x28')]=_['keys'](db['JscriptyProject'][_0xc288('0x27')]);_0xb27624['attributes']=_[_0xc288('0x2b')](_0x57afc1['model'],qs[_0xc288('0x2d')](_0x311167[_0xc288('0x2a')][_0xc288('0x2d')]));_0xb27624[_0xc288('0x2c')]=_0xb27624[_0xc288('0x2c')][_0xc288('0x2e')]?_0xb27624[_0xc288('0x2c')]:_0x57afc1[_0xc288('0x28')];if(_0x311167[_0xc288('0x2a')][_0xc288('0x39')]){_0xb27624[_0xc288('0x3a')]=[{'all':!![]}];}_0xb27624=_[_0xc288('0x35')]({},_0xb27624,_0x311167[_0xc288('0x3e')]);return db[_0xc288('0x26')]['find'](_0xb27624)[_0xc288('0x1d')](handleEntityNotFound(_0x64f4f9,null))[_0xc288('0x1d')](function(_0xe29059){if(_0xe29059){var _0x12c3fb=_0xe29059['get']({'plain':!![]});_0x12c3fb=qs['omit'](_0x12c3fb,['id',_0xc288('0x4a'),_0xc288('0x4b')]);_0x311167[_0xc288('0x41')]=_[_0xc288('0x4c')](_0x311167[_0xc288('0x41')],['id',_0xc288('0x4a'),_0xc288('0x4b')]);return db['JscriptyProject'][_0xc288('0x40')](_[_0xc288('0x35')](_0x12c3fb,_0x311167[_0xc288('0x41')]),{'include':_0x311167[_0xc288('0x2a')][_0xc288('0x39')]?[{'all':!![]}]:undefined})[_0xc288('0x1d')](function(_0x5a9f17){var _0x5d4ff1=_0x311167[_0xc288('0x45')][_0xc288('0x42')]({'plain':!![]});if(!_0x5d4ff1)throw new Error(_0xc288('0x43'));if(_0x5d4ff1[_0xc288('0x44')]===_0xc288('0x45')){var _0x52161e=_0x5a9f17[_0xc288('0x42')]({'plain':!![]});var _0x7285ac=_0xc288('0x1f');return db['UserProfileSection'][_0xc288('0x3f')]({'where':{'name':_0x7285ac,'userProfileId':_0x5d4ff1[_0xc288('0x47')]},'raw':!![]})[_0xc288('0x1d')](function(_0x1947ec){if(_0x1947ec&&_0x1947ec[_0xc288('0x48')]===0x0){return db[_0xc288('0x20')][_0xc288('0x40')]({'name':_0x52161e['name'],'resourceId':_0x52161e['id'],'type':_0x1947ec['name'],'sectionId':_0x1947ec['id']},{})[_0xc288('0x1d')](function(){return _0x5a9f17;});}else{return _0x5a9f17;}})[_0xc288('0x3c')](function(_0x1798aa){logger['error'](_0xc288('0x49'),_0x1798aa);throw _0x1798aa;});}return _0x5a9f17;});}})[_0xc288('0x1d')](respondWithResult(_0x64f4f9,0xc9))[_0xc288('0x3c')](handleError(_0x64f4f9,null));};exports[_0xc288('0x4d')]=function(_0x58512f,_0x39036d){if(_0x58512f[_0xc288('0x41')]['id']){delete _0x58512f[_0xc288('0x41')]['id'];}return db[_0xc288('0x26')][_0xc288('0x3f')]({'where':{'id':_0x58512f['params']['id']}})[_0xc288('0x1d')](handleEntityNotFound(_0x39036d,null))[_0xc288('0x1d')](saveUpdates(_0x58512f[_0xc288('0x41')],null))['then'](respondWithResult(_0x39036d,null))[_0xc288('0x3c')](handleError(_0x39036d,null));};exports[_0xc288('0x1e')]=function(_0x99f106,_0x267cd6){return db[_0xc288('0x26')][_0xc288('0x3f')]({'where':{'id':_0x99f106[_0xc288('0x3d')]['id']}})[_0xc288('0x1d')](handleEntityNotFound(_0x267cd6,null))['then'](removeEntity(_0x267cd6,null))[_0xc288('0x3c')](handleError(_0x267cd6,null));};exports[_0xc288('0x4e')]=function(_0x185cd1,_0x38c6aa,_0x498b8b){var _0x27eccf={'raw':!![],'where':{}};var _0x3f9989={};var _0x2fdb53={'count':0x0,'rows':[]};return db[_0xc288('0x26')][_0xc288('0x4f')]({'where':{'id':_0x185cd1[_0xc288('0x3d')]['id']}})[_0xc288('0x1d')](handleEntityNotFound(_0x38c6aa,null))[_0xc288('0x1d')](function(_0x4fdf04){if(_0x4fdf04){_0x3f9989[_0xc288('0x28')]=_[_0xc288('0x29')](db[_0xc288('0x50')][_0xc288('0x27')]);_0x3f9989[_0xc288('0x2a')]=_[_0xc288('0x29')](_0x185cd1[_0xc288('0x2a')]);_0x3f9989[_0xc288('0x32')]=_[_0xc288('0x2b')](_0x3f9989[_0xc288('0x28')],_0x3f9989[_0xc288('0x2a')]);_0x27eccf[_0xc288('0x2c')]=_[_0xc288('0x2b')](_0x3f9989['model'],qs['fields'](_0x185cd1[_0xc288('0x2a')]['fields']));_0x27eccf[_0xc288('0x2c')]=_0x27eccf[_0xc288('0x2c')][_0xc288('0x2e')]?_0x27eccf[_0xc288('0x2c')]:_0x3f9989[_0xc288('0x28')];if(!_0x185cd1[_0xc288('0x2a')]['hasOwnProperty'](_0xc288('0x30'))){_0x27eccf[_0xc288('0x18')]=qs['limit'](_0x185cd1[_0xc288('0x2a')][_0xc288('0x18')]);_0x27eccf[_0xc288('0x17')]=qs[_0xc288('0x17')](_0x185cd1[_0xc288('0x2a')][_0xc288('0x17')]);}_0x27eccf[_0xc288('0x51')]=qs[_0xc288('0x31')](_0x185cd1['query']['sort']);_0x27eccf[_0xc288('0x34')]=qs[_0xc288('0x32')](_[_0xc288('0x52')](_0x185cd1[_0xc288('0x2a')],_0x3f9989[_0xc288('0x32')]));_0x27eccf[_0xc288('0x34')][_0xc288('0x53')]=_0x4fdf04['id'];if(_0x185cd1[_0xc288('0x2a')]['filter']){_0x27eccf[_0xc288('0x34')]=_[_0xc288('0x35')](_0x27eccf[_0xc288('0x34')],{'$or':_[_0xc288('0x36')](_0x27eccf[_0xc288('0x2c')],function(_0x26120e){var _0x1fbdb0={};_0x1fbdb0[_0x26120e]={'$like':'%'+_0x185cd1[_0xc288('0x2a')][_0xc288('0x33')]+'%'};return _0x1fbdb0;})});}_0x27eccf=_[_0xc288('0x35')]({},_0x27eccf,_0x185cd1['options']);return db[_0xc288('0x50')][_0xc288('0x16')]({'where':_0x27eccf[_0xc288('0x34')]})['then'](function(_0x34059e){_0x2fdb53[_0xc288('0x16')]=_0x34059e;if(_0x185cd1[_0xc288('0x2a')]['includeAll']){_0x27eccf[_0xc288('0x3a')]=[{'all':!![]}];}return db[_0xc288('0x50')][_0xc288('0x54')](_0x27eccf);})[_0xc288('0x1d')](function(_0x181f70){_0x2fdb53[_0xc288('0x3b')]=_0x181f70;return _0x2fdb53;});}})[_0xc288('0x1d')](respondWithFilteredResult(_0x38c6aa,_0x27eccf))[_0xc288('0x3c')](handleError(_0x38c6aa,null));};exports['getAnswers']=function(_0x1b1801,_0xd919d2,_0x46dd1d){var _0x5ed10a={'raw':!![],'where':{}};var _0x46443e={};var _0x1bd6f9={'count':0x0,'rows':[]};return db[_0xc288('0x26')][_0xc288('0x4f')]({'where':{'id':_0x1b1801[_0xc288('0x3d')]['id']}})['then'](handleEntityNotFound(_0xd919d2,null))[_0xc288('0x1d')](function(_0x229744){if(_0x229744){_0x46443e[_0xc288('0x28')]=_[_0xc288('0x29')](db['JscriptyAnswerReport'][_0xc288('0x27')]);_0x46443e[_0xc288('0x2a')]=_[_0xc288('0x29')](_0x1b1801['query']);_0x46443e[_0xc288('0x32')]=_[_0xc288('0x2b')](_0x46443e[_0xc288('0x28')],_0x46443e[_0xc288('0x2a')]);_0x5ed10a[_0xc288('0x2c')]=_[_0xc288('0x2b')](_0x46443e[_0xc288('0x28')],qs['fields'](_0x1b1801[_0xc288('0x2a')][_0xc288('0x2d')]));_0x5ed10a[_0xc288('0x2c')]=_0x5ed10a['attributes'][_0xc288('0x2e')]?_0x5ed10a[_0xc288('0x2c')]:_0x46443e[_0xc288('0x28')];if(!_0x1b1801[_0xc288('0x2a')][_0xc288('0x2f')]('nolimit')){_0x5ed10a[_0xc288('0x18')]=qs['limit'](_0x1b1801['query'][_0xc288('0x18')]);_0x5ed10a[_0xc288('0x17')]=qs[_0xc288('0x17')](_0x1b1801[_0xc288('0x2a')][_0xc288('0x17')]);}_0x5ed10a[_0xc288('0x51')]=qs[_0xc288('0x31')](_0x1b1801[_0xc288('0x2a')]['sort']);_0x5ed10a[_0xc288('0x34')]=qs['filters'](_[_0xc288('0x52')](_0x1b1801[_0xc288('0x2a')],_0x46443e[_0xc288('0x32')]));_0x5ed10a[_0xc288('0x34')][_0xc288('0x53')]=_0x229744['id'];if(_0x1b1801[_0xc288('0x2a')][_0xc288('0x33')]){_0x5ed10a[_0xc288('0x34')]=_[_0xc288('0x35')](_0x5ed10a[_0xc288('0x34')],{'$or':_['map'](_0x5ed10a[_0xc288('0x2c')],function(_0x1bd0ee){var _0x43fd11={};_0x43fd11[_0x1bd0ee]={'$like':'%'+_0x1b1801['query'][_0xc288('0x33')]+'%'};return _0x43fd11;})});}_0x5ed10a=_[_0xc288('0x35')]({},_0x5ed10a,_0x1b1801[_0xc288('0x3e')]);return db[_0xc288('0x55')][_0xc288('0x16')]({'where':_0x5ed10a[_0xc288('0x34')]})['then'](function(_0x47b520){_0x1bd6f9[_0xc288('0x16')]=_0x47b520;if(_0x1b1801[_0xc288('0x2a')][_0xc288('0x39')]){_0x5ed10a[_0xc288('0x3a')]=[{'all':!![]}];}return db[_0xc288('0x55')]['findAll'](_0x5ed10a);})[_0xc288('0x1d')](function(_0x19cf7f){_0x1bd6f9[_0xc288('0x3b')]=_0x19cf7f;return _0x1bd6f9;});}})[_0xc288('0x1d')](respondWithFilteredResult(_0xd919d2,_0x5ed10a))[_0xc288('0x3c')](handleError(_0xd919d2,null));};function char(_0x48b595){return _0xc288('0x56')===typeof _0x48b595?String[_0xc288('0x57')][_0xc288('0x1b')](null,arguments):_0x48b595;}function needsEncapsulation(_0x7a5ddd){return!!_0x7a5ddd&&(_0x7a5ddd[_0xc288('0x58')]()[_0xc288('0x59')](char(0xd))>=0x0||_0x7a5ddd['toString']()[_0xc288('0x59')](char(0xa))>=0x0||_0x7a5ddd[_0xc288('0x58')]()['indexOf'](char(0x2c))>=0x0||_0x7a5ddd['toString']()[_0xc288('0x59')](char(0x22))>=0x0);}function encapsulate(_0x354a37){var _0x56ea74=char(0x22),_0x3ee42b='\x5c'+char(0x22),_0xd6e945=_0x354a37['toString']()[_0xc288('0x5a')](new RegExp(_0x56ea74,'g'),_0x3ee42b);return _0x56ea74+_0xd6e945+_0x56ea74;}exports[_0xc288('0x5b')]=function(_0x5f17d4,_0x4dafe2,_0x246c52){var _0x4f2adf,_0xad8cd0;var _0x28c0f4={'where':{'ProjectId':_0x5f17d4[_0xc288('0x3d')]['id']}};if(_0x5f17d4[_0xc288('0x2a')]['startTime']){_0x28c0f4[_0xc288('0x34')][_0xc288('0x5c')]=JSON[_0xc288('0x5d')](_0x5f17d4[_0xc288('0x2a')][_0xc288('0x5e')]);}return db[_0xc288('0x50')]['findAll'](_0x28c0f4)[_0xc288('0x1d')](handleEntityNotFound(_0x4dafe2,null))[_0xc288('0x1d')](function(_0x3cddd4){if(_0x3cddd4){_0x4f2adf=_0x3cddd4;return db[_0xc288('0x5f')][_0xc288('0x54')]({'where':{'SessionId':{'$in':_[_0xc288('0x36')](_0x4f2adf,'id')},'ProjectId':_0x5f17d4['params']['id']},'order':'-createdAt'});}})[_0xc288('0x1d')](handleEntityNotFound(_0x4dafe2,null))[_0xc288('0x1d')](function(_0x5c0f89){if(_0x5c0f89){_0xad8cd0=_0x5c0f89;var _0x57ad1c={};for(var _0x24bf40=0x0,_0x1ca095=_0xad8cd0[_0xc288('0x2e')];_0x24bf40<_0x1ca095;_0x24bf40++){if(!_0x57ad1c[_0xc288('0x2f')](_0xad8cd0[_0x24bf40][_0xc288('0x60')])){_0x57ad1c[_0xad8cd0[_0x24bf40][_0xc288('0x60')]]=needsEncapsulation(_0xad8cd0[_0x24bf40]['question'])?encapsulate(_0xad8cd0[_0x24bf40][_0xc288('0x61')]):_0xad8cd0[_0x24bf40][_0xc288('0x61')];}}var _0x47d8c7=[],_0xb1011f={};for(var _0x15e731=0x0,_0x12cfd3=_0x4f2adf['length'];_0x15e731<_0x12cfd3;_0x15e731++){_0xb1011f={'ProjectId':_0x5f17d4[_0xc288('0x3d')]['id'],'SessionId':_0x4f2adf[_0x15e731]['id'],'StartTime':moment(_0x4f2adf[_0x15e731]['starttime'])['format'](_0xc288('0x62'))};for(var _0x518d5d=0x0,_0x16c911=_0xad8cd0['length'];_0x518d5d<_0x16c911;_0x518d5d++){if(_0xad8cd0[_0x518d5d][_0xc288('0x63')]==_0x4f2adf[_0x15e731]['id']&&_0x57ad1c['hasOwnProperty'](_0xad8cd0[_0x518d5d][_0xc288('0x60')])){_0xb1011f[_0x57ad1c[_0xad8cd0[_0x518d5d][_0xc288('0x60')]]]=_0xad8cd0[_0x518d5d][_0xc288('0x64')];}}for(var _0x2b71c3 in _0x57ad1c){if(!_0xb1011f[_0xc288('0x2f')](_0x57ad1c[_0x2b71c3])){_0xb1011f[_0x57ad1c[_0x2b71c3]]=null;}}_0x47d8c7[_0xc288('0x65')](_0xb1011f);}return _0x47d8c7;}})[_0xc288('0x1d')](function(_0x19927e){if(!_['isEmpty'](_0x19927e)){var _0x4ddf6c=toCsv(_0x19927e);var _0x1c7d9e=Date[_0xc288('0x66')]();fs[_0xc288('0x67')](util[_0xc288('0x68')](_0xc288('0x69'),_0x5f17d4[_0xc288('0x3d')]['id'],_0x1c7d9e),_0x4ddf6c);_0x4dafe2[_0xc288('0x6a')](_0xc288('0x6b'),_0xc288('0x6c')+util[_0xc288('0x68')](_0xc288('0x6d'),_0x5f17d4['params']['id'],_0x1c7d9e));_0x4dafe2[_0xc288('0x6a')]('Content-type','text/csv');return _0x4dafe2['download'](util['format'](_0xc288('0x69'),_0x5f17d4[_0xc288('0x3d')]['id'],_0x1c7d9e));}else{return _0x4dafe2[_0xc288('0x21')](0xcc);}})[_0xc288('0x3c')](handleError(_0x4dafe2,null));}; \ No newline at end of file +var _0x0ac8=['parse','JscriptyQuestionReport','-createdAt','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','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','Content-Range','apply','save','update','then','get','Projects','UserProfileResource','destroy','end','error','stack','name','index','JscriptyProject','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','map','type','key','field','options','include','rows','catch','show','params','rawAttributes','includeAll','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getSessions','findOne','JscriptySessionReport','nolimit','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime'];(function(_0x56cc28,_0x4a921e){var _0x1f5798=function(_0x45f7a5){while(--_0x45f7a5){_0x56cc28['push'](_0x56cc28['shift']());}};_0x1f5798(++_0x4a921e);}(_0x0ac8,0xfe));var _0x80ac=function(_0xbcd604,_0x5c6862){_0xbcd604=_0xbcd604-0x0;var _0x16a71e=_0x0ac8[_0xbcd604];return _0x16a71e;};'use strict';var pdf=require(_0x80ac('0x0'));var emlformat=require(_0x80ac('0x1'));var rimraf=require(_0x80ac('0x2'));var zipdir=require(_0x80ac('0x3'));var jsonpatch=require(_0x80ac('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x80ac('0x5'));var Mustache=require(_0x80ac('0x6'));var util=require(_0x80ac('0x7'));var path=require(_0x80ac('0x8'));var sox=require('sox');var csv=require(_0x80ac('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x80ac('0xa'));var jsforce=require(_0x80ac('0xb'));var deskjs=require(_0x80ac('0xc'));var toCsv=require(_0x80ac('0x9'));var querystring=require(_0x80ac('0xd'));var Papa=require(_0x80ac('0xe'));var authService=require(_0x80ac('0xf'));var hardwareService=require(_0x80ac('0x10'));var Redis=require(_0x80ac('0x11'));var qs=require(_0x80ac('0x12'));var logger=require('../../config/logger')(_0x80ac('0x13'));var utils=require(_0x80ac('0x14'));var config=require(_0x80ac('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b8789,_0x547edd){_0x547edd=_0x547edd||0xcc;return function(_0x2fd919){if(_0x2fd919){return _0x3b8789[_0x80ac('0x16')](_0x547edd);}return _0x3b8789[_0x80ac('0x17')](_0x547edd)['end']();};}function respondWithResult(_0x1df672,_0x4c2957){_0x4c2957=_0x4c2957||0xc8;return function(_0x9cedb2){if(_0x9cedb2){return _0x1df672[_0x80ac('0x17')](_0x4c2957)['json'](_0x9cedb2);}};}function respondWithFilteredResult(_0x5f32ca,_0x38ea8d){return function(_0x50e8ab){if(_0x50e8ab){var _0x4755bc=_0x50e8ab[_0x80ac('0x18')],_0x18451c=_0x38ea8d['offset'],_0x42ef5e=_0x38ea8d[_0x80ac('0x19')]+_0x38ea8d['limit'],_0x43e52d;if(_0x42ef5e>=_0x4755bc){_0x42ef5e=_0x4755bc;_0x43e52d=0xc8;}else{_0x43e52d=0xce;}_0x5f32ca[_0x80ac('0x17')](_0x43e52d);return _0x5f32ca['set'](_0x80ac('0x1a'),_0x18451c+'-'+_0x42ef5e+'/'+_0x4755bc)['json'](_0x50e8ab);}return null;};}function patchUpdates(_0x5054ea){return function(_0x190de2){try{jsonpatch[_0x80ac('0x1b')](_0x190de2,_0x5054ea,!![]);}catch(_0x267a14){return BPromise['reject'](_0x267a14);}return _0x190de2[_0x80ac('0x1c')]();};}function saveUpdates(_0x34456c,_0x5f5dc9){return function(_0x101bcb){if(_0x101bcb){return _0x101bcb[_0x80ac('0x1d')](_0x34456c)[_0x80ac('0x1e')](function(_0x1c20aa){return _0x1c20aa;});}return null;};}function removeEntity(_0x22a227,_0x4aefac){return function(_0x372d3d){if(_0x372d3d){return _0x372d3d['destroy']()['then'](function(){var _0xe62a19=_0x372d3d[_0x80ac('0x1f')]({'plain':!![]});var _0x18f703=_0x80ac('0x20');return db[_0x80ac('0x21')][_0x80ac('0x22')]({'where':{'type':_0x18f703,'resourceId':_0xe62a19['id']}})[_0x80ac('0x1e')](function(){return _0x372d3d;});})['then'](function(){_0x22a227['status'](0xcc)[_0x80ac('0x23')]();});}};}function handleEntityNotFound(_0x736351,_0x37e05d){return function(_0x135f20){if(!_0x135f20){_0x736351[_0x80ac('0x16')](0x194);}return _0x135f20;};}function handleError(_0x12c6c3,_0x135d4e){_0x135d4e=_0x135d4e||0x1f4;return function(_0x31ed9b){logger[_0x80ac('0x24')](_0x31ed9b[_0x80ac('0x25')]);if(_0x31ed9b[_0x80ac('0x26')]){delete _0x31ed9b[_0x80ac('0x26')];}_0x12c6c3[_0x80ac('0x17')](_0x135d4e)['send'](_0x31ed9b);};}exports[_0x80ac('0x27')]=function(_0xfc7da9,_0x3539ea){var _0x4e981f={},_0xb9060c={},_0x141284={'count':0x0,'rows':[]};var _0x3ff0b3=db[_0x80ac('0x28')]['rawAttributes'];_0xb9060c[_0x80ac('0x29')]=_['keys'](_0x3ff0b3);_0xb9060c[_0x80ac('0x2a')]=_[_0x80ac('0x2b')](_0xfc7da9[_0x80ac('0x2a')]);_0xb9060c[_0x80ac('0x2c')]=_['intersection'](_0xb9060c['model'],_0xb9060c[_0x80ac('0x2a')]);_0x4e981f['attributes']=_[_0x80ac('0x2d')](_0xb9060c[_0x80ac('0x29')],qs[_0x80ac('0x2e')](_0xfc7da9[_0x80ac('0x2a')][_0x80ac('0x2e')]));_0x4e981f[_0x80ac('0x2f')]=_0x4e981f[_0x80ac('0x2f')][_0x80ac('0x30')]?_0x4e981f['attributes']:_0xb9060c[_0x80ac('0x29')];if(!_0xfc7da9[_0x80ac('0x2a')][_0x80ac('0x31')]('nolimit')){_0x4e981f['limit']=qs[_0x80ac('0x32')](_0xfc7da9[_0x80ac('0x2a')][_0x80ac('0x32')]);_0x4e981f[_0x80ac('0x19')]=qs[_0x80ac('0x19')](_0xfc7da9[_0x80ac('0x2a')][_0x80ac('0x19')]);}_0x4e981f[_0x80ac('0x33')]=qs['sort'](_0xfc7da9['query'][_0x80ac('0x34')]);_0x4e981f[_0x80ac('0x35')]=qs[_0x80ac('0x2c')](_[_0x80ac('0x36')](_0xfc7da9['query'],_0xb9060c[_0x80ac('0x2c')]));if(_0xfc7da9[_0x80ac('0x2a')][_0x80ac('0x37')]){_0x4e981f[_0x80ac('0x35')]=_['merge'](_0x4e981f[_0x80ac('0x35')],{'$or':_[_0x80ac('0x38')](_0x3ff0b3,function(_0x2fcab1){if(_0x2fcab1[_0x80ac('0x39')][_0x80ac('0x3a')]!=='VIRTUAL'){var _0x507e37={};_0x507e37[_0x2fcab1[_0x80ac('0x3b')]]={'$like':'%'+_0xfc7da9[_0x80ac('0x2a')][_0x80ac('0x37')]+'%'};return _0x507e37;}})});}_0x4e981f=_['merge']({},_0x4e981f,_0xfc7da9[_0x80ac('0x3c')]);var _0x13743f={'where':_0x4e981f[_0x80ac('0x35')]};return db[_0x80ac('0x28')]['count'](_0x13743f)['then'](function(_0x2842a8){_0x141284[_0x80ac('0x18')]=_0x2842a8;if(_0xfc7da9[_0x80ac('0x2a')]['includeAll']){_0x4e981f[_0x80ac('0x3d')]=[{'all':!![]}];}return db[_0x80ac('0x28')]['findAll'](_0x4e981f);})['then'](function(_0x2ac51f){_0x141284[_0x80ac('0x3e')]=_0x2ac51f;return _0x141284;})[_0x80ac('0x1e')](respondWithFilteredResult(_0x3539ea,_0x4e981f))[_0x80ac('0x3f')](handleError(_0x3539ea,null));};exports[_0x80ac('0x40')]=function(_0x3b8ff2,_0x4013f5){var _0x470035={'raw':![],'where':{'id':_0x3b8ff2[_0x80ac('0x41')]['id']}},_0x34227f={};_0x34227f['model']=_[_0x80ac('0x2b')](db[_0x80ac('0x28')][_0x80ac('0x42')]);_0x34227f[_0x80ac('0x2a')]=_['keys'](_0x3b8ff2[_0x80ac('0x2a')]);_0x34227f[_0x80ac('0x2c')]=_[_0x80ac('0x2d')](_0x34227f[_0x80ac('0x29')],_0x34227f[_0x80ac('0x2a')]);_0x470035[_0x80ac('0x2f')]=_['intersection'](_0x34227f[_0x80ac('0x29')],qs[_0x80ac('0x2e')](_0x3b8ff2['query'][_0x80ac('0x2e')]));_0x470035['attributes']=_0x470035[_0x80ac('0x2f')][_0x80ac('0x30')]?_0x470035['attributes']:_0x34227f[_0x80ac('0x29')];if(_0x3b8ff2['query'][_0x80ac('0x43')]){_0x470035[_0x80ac('0x3d')]=[{'all':!![]}];}_0x470035=_[_0x80ac('0x44')]({},_0x470035,_0x3b8ff2[_0x80ac('0x3c')]);return db[_0x80ac('0x28')][_0x80ac('0x45')](_0x470035)[_0x80ac('0x1e')](handleEntityNotFound(_0x4013f5,null))[_0x80ac('0x1e')](respondWithResult(_0x4013f5,null))['catch'](handleError(_0x4013f5,null));};exports[_0x80ac('0x46')]=function(_0x4652ce,_0x422fd0){return db['JscriptyProject'][_0x80ac('0x46')](_0x4652ce[_0x80ac('0x47')],{})[_0x80ac('0x1e')](function(_0x3f1bae){var _0x394dc3=_0x4652ce['user'][_0x80ac('0x1f')]({'plain':!![]});if(!_0x394dc3)throw new Error(_0x80ac('0x48'));if(_0x394dc3[_0x80ac('0x49')]===_0x80ac('0x4a')){var _0x5d34f0=_0x3f1bae[_0x80ac('0x1f')]({'plain':!![]});var _0x1c0c0d='Projects';return db[_0x80ac('0x4b')][_0x80ac('0x45')]({'where':{'name':_0x1c0c0d,'userProfileId':_0x394dc3['userProfileId']},'raw':!![]})['then'](function(_0x2a0b6f){if(_0x2a0b6f&&_0x2a0b6f[_0x80ac('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x5d34f0[_0x80ac('0x26')],'resourceId':_0x5d34f0['id'],'type':_0x2a0b6f[_0x80ac('0x26')],'sectionId':_0x2a0b6f['id']},{})[_0x80ac('0x1e')](function(){return _0x3f1bae;});}else{return _0x3f1bae;}})[_0x80ac('0x3f')](function(_0x1cde75){logger['error'](_0x80ac('0x4d'),_0x1cde75);throw _0x1cde75;});}return _0x3f1bae;})['then'](respondWithResult(_0x422fd0,0xc9))[_0x80ac('0x3f')](handleError(_0x422fd0,null));};exports[_0x80ac('0x4e')]=function(_0x5afccc,_0x4e3611){var _0x5cadcc={'raw':![],'where':{'id':_0x5afccc['params']['id']}},_0x45cb68={};_0x45cb68[_0x80ac('0x29')]=_[_0x80ac('0x2b')](db[_0x80ac('0x28')]['rawAttributes']);_0x5cadcc['attributes']=_[_0x80ac('0x2d')](_0x45cb68[_0x80ac('0x29')],qs[_0x80ac('0x2e')](_0x5afccc[_0x80ac('0x2a')][_0x80ac('0x2e')]));_0x5cadcc[_0x80ac('0x2f')]=_0x5cadcc[_0x80ac('0x2f')][_0x80ac('0x30')]?_0x5cadcc[_0x80ac('0x2f')]:_0x45cb68[_0x80ac('0x29')];if(_0x5afccc['query'][_0x80ac('0x43')]){_0x5cadcc[_0x80ac('0x3d')]=[{'all':!![]}];}_0x5cadcc=_['merge']({},_0x5cadcc,_0x5afccc[_0x80ac('0x3c')]);return db[_0x80ac('0x28')][_0x80ac('0x45')](_0x5cadcc)[_0x80ac('0x1e')](handleEntityNotFound(_0x4e3611,null))['then'](function(_0x479482){if(_0x479482){var _0x5ca76a=_0x479482[_0x80ac('0x1f')]({'plain':!![]});_0x5ca76a=qs[_0x80ac('0x4f')](_0x5ca76a,['id',_0x80ac('0x50'),'updatedAt']);_0x5afccc[_0x80ac('0x47')]=_['omit'](_0x5afccc[_0x80ac('0x47')],['id',_0x80ac('0x50'),_0x80ac('0x51')]);return db['JscriptyProject'][_0x80ac('0x46')](_[_0x80ac('0x44')](_0x5ca76a,_0x5afccc[_0x80ac('0x47')]),{'include':_0x5afccc[_0x80ac('0x2a')][_0x80ac('0x43')]?[{'all':!![]}]:undefined})[_0x80ac('0x1e')](function(_0x4ad0a2){var _0x1b10a1=_0x5afccc[_0x80ac('0x4a')]['get']({'plain':!![]});if(!_0x1b10a1)throw new Error(_0x80ac('0x48'));if(_0x1b10a1[_0x80ac('0x49')]===_0x80ac('0x4a')){var _0x1d7b12=_0x4ad0a2[_0x80ac('0x1f')]({'plain':!![]});var _0x4d2296=_0x80ac('0x20');return db[_0x80ac('0x4b')][_0x80ac('0x45')]({'where':{'name':_0x4d2296,'userProfileId':_0x1b10a1[_0x80ac('0x52')]},'raw':!![]})['then'](function(_0x137ea1){if(_0x137ea1&&_0x137ea1[_0x80ac('0x4c')]===0x0){return db['UserProfileResource'][_0x80ac('0x46')]({'name':_0x1d7b12[_0x80ac('0x26')],'resourceId':_0x1d7b12['id'],'type':_0x137ea1['name'],'sectionId':_0x137ea1['id']},{})['then'](function(){return _0x4ad0a2;});}else{return _0x4ad0a2;}})[_0x80ac('0x3f')](function(_0x32b6e1){logger[_0x80ac('0x24')](_0x80ac('0x4d'),_0x32b6e1);throw _0x32b6e1;});}return _0x4ad0a2;});}})[_0x80ac('0x1e')](respondWithResult(_0x4e3611,0xc9))['catch'](handleError(_0x4e3611,null));};exports[_0x80ac('0x1d')]=function(_0x41c130,_0xdc089c){if(_0x41c130[_0x80ac('0x47')]['id']){delete _0x41c130[_0x80ac('0x47')]['id'];}return db[_0x80ac('0x28')][_0x80ac('0x45')]({'where':{'id':_0x41c130[_0x80ac('0x41')]['id']}})[_0x80ac('0x1e')](handleEntityNotFound(_0xdc089c,null))[_0x80ac('0x1e')](saveUpdates(_0x41c130[_0x80ac('0x47')],null))['then'](respondWithResult(_0xdc089c,null))[_0x80ac('0x3f')](handleError(_0xdc089c,null));};exports[_0x80ac('0x22')]=function(_0x2d688c,_0x4862b8){return db[_0x80ac('0x28')][_0x80ac('0x45')]({'where':{'id':_0x2d688c[_0x80ac('0x41')]['id']}})[_0x80ac('0x1e')](handleEntityNotFound(_0x4862b8,null))[_0x80ac('0x1e')](removeEntity(_0x4862b8,null))[_0x80ac('0x3f')](handleError(_0x4862b8,null));};exports[_0x80ac('0x53')]=function(_0x32308a,_0x433ab7,_0x750f52){var _0x4c5d90={'raw':!![],'where':{}};var _0x13fed1={};var _0x374302={'count':0x0,'rows':[]};return db[_0x80ac('0x28')][_0x80ac('0x54')]({'where':{'id':_0x32308a[_0x80ac('0x41')]['id']}})['then'](handleEntityNotFound(_0x433ab7,null))[_0x80ac('0x1e')](function(_0xff857d){if(_0xff857d){_0x13fed1[_0x80ac('0x29')]=_[_0x80ac('0x2b')](db[_0x80ac('0x55')][_0x80ac('0x42')]);_0x13fed1['query']=_[_0x80ac('0x2b')](_0x32308a[_0x80ac('0x2a')]);_0x13fed1[_0x80ac('0x2c')]=_[_0x80ac('0x2d')](_0x13fed1[_0x80ac('0x29')],_0x13fed1[_0x80ac('0x2a')]);_0x4c5d90[_0x80ac('0x2f')]=_[_0x80ac('0x2d')](_0x13fed1[_0x80ac('0x29')],qs['fields'](_0x32308a[_0x80ac('0x2a')]['fields']));_0x4c5d90[_0x80ac('0x2f')]=_0x4c5d90['attributes'][_0x80ac('0x30')]?_0x4c5d90[_0x80ac('0x2f')]:_0x13fed1['model'];if(!_0x32308a[_0x80ac('0x2a')][_0x80ac('0x31')](_0x80ac('0x56'))){_0x4c5d90[_0x80ac('0x32')]=qs[_0x80ac('0x32')](_0x32308a[_0x80ac('0x2a')][_0x80ac('0x32')]);_0x4c5d90['offset']=qs[_0x80ac('0x19')](_0x32308a[_0x80ac('0x2a')]['offset']);}_0x4c5d90['order']=qs[_0x80ac('0x34')](_0x32308a['query'][_0x80ac('0x34')]);_0x4c5d90[_0x80ac('0x35')]=qs['filters'](_['pick'](_0x32308a[_0x80ac('0x2a')],_0x13fed1[_0x80ac('0x2c')]));_0x4c5d90['where'][_0x80ac('0x57')]=_0xff857d['id'];if(_0x32308a[_0x80ac('0x2a')][_0x80ac('0x37')]){_0x4c5d90[_0x80ac('0x35')]=_[_0x80ac('0x44')](_0x4c5d90['where'],{'$or':_[_0x80ac('0x38')](_0x4c5d90['attributes'],function(_0x31e752){var _0x4b5cb6={};_0x4b5cb6[_0x31e752]={'$like':'%'+_0x32308a['query'][_0x80ac('0x37')]+'%'};return _0x4b5cb6;})});}_0x4c5d90=_['merge']({},_0x4c5d90,_0x32308a[_0x80ac('0x3c')]);return db[_0x80ac('0x55')][_0x80ac('0x18')]({'where':_0x4c5d90[_0x80ac('0x35')]})[_0x80ac('0x1e')](function(_0x83c904){_0x374302[_0x80ac('0x18')]=_0x83c904;if(_0x32308a['query'][_0x80ac('0x43')]){_0x4c5d90[_0x80ac('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x80ac('0x58')](_0x4c5d90);})[_0x80ac('0x1e')](function(_0x108c3e){_0x374302[_0x80ac('0x3e')]=_0x108c3e;return _0x374302;});}})[_0x80ac('0x1e')](respondWithFilteredResult(_0x433ab7,_0x4c5d90))[_0x80ac('0x3f')](handleError(_0x433ab7,null));};exports[_0x80ac('0x59')]=function(_0xd9c124,_0x46ceee,_0x4ecdf3){var _0x5f400e={'raw':!![],'where':{}};var _0x30e9a9={};var _0xeb4546={'count':0x0,'rows':[]};return db[_0x80ac('0x28')][_0x80ac('0x54')]({'where':{'id':_0xd9c124[_0x80ac('0x41')]['id']}})[_0x80ac('0x1e')](handleEntityNotFound(_0x46ceee,null))[_0x80ac('0x1e')](function(_0x525535){if(_0x525535){_0x30e9a9['model']=_[_0x80ac('0x2b')](db[_0x80ac('0x5a')][_0x80ac('0x42')]);_0x30e9a9['query']=_['keys'](_0xd9c124['query']);_0x30e9a9[_0x80ac('0x2c')]=_[_0x80ac('0x2d')](_0x30e9a9[_0x80ac('0x29')],_0x30e9a9[_0x80ac('0x2a')]);_0x5f400e[_0x80ac('0x2f')]=_[_0x80ac('0x2d')](_0x30e9a9[_0x80ac('0x29')],qs[_0x80ac('0x2e')](_0xd9c124[_0x80ac('0x2a')][_0x80ac('0x2e')]));_0x5f400e[_0x80ac('0x2f')]=_0x5f400e[_0x80ac('0x2f')][_0x80ac('0x30')]?_0x5f400e['attributes']:_0x30e9a9['model'];if(!_0xd9c124[_0x80ac('0x2a')][_0x80ac('0x31')](_0x80ac('0x56'))){_0x5f400e[_0x80ac('0x32')]=qs[_0x80ac('0x32')](_0xd9c124['query']['limit']);_0x5f400e['offset']=qs['offset'](_0xd9c124[_0x80ac('0x2a')][_0x80ac('0x19')]);}_0x5f400e[_0x80ac('0x33')]=qs[_0x80ac('0x34')](_0xd9c124[_0x80ac('0x2a')][_0x80ac('0x34')]);_0x5f400e[_0x80ac('0x35')]=qs[_0x80ac('0x2c')](_['pick'](_0xd9c124['query'],_0x30e9a9['filters']));_0x5f400e[_0x80ac('0x35')]['ProjectId']=_0x525535['id'];if(_0xd9c124[_0x80ac('0x2a')][_0x80ac('0x37')]){_0x5f400e[_0x80ac('0x35')]=_[_0x80ac('0x44')](_0x5f400e['where'],{'$or':_[_0x80ac('0x38')](_0x5f400e['attributes'],function(_0x407794){var _0x1bd413={};_0x1bd413[_0x407794]={'$like':'%'+_0xd9c124[_0x80ac('0x2a')]['filter']+'%'};return _0x1bd413;})});}_0x5f400e=_[_0x80ac('0x44')]({},_0x5f400e,_0xd9c124[_0x80ac('0x3c')]);return db['JscriptyAnswerReport'][_0x80ac('0x18')]({'where':_0x5f400e[_0x80ac('0x35')]})[_0x80ac('0x1e')](function(_0x2f170d){_0xeb4546[_0x80ac('0x18')]=_0x2f170d;if(_0xd9c124[_0x80ac('0x2a')][_0x80ac('0x43')]){_0x5f400e[_0x80ac('0x3d')]=[{'all':!![]}];}return db[_0x80ac('0x5a')][_0x80ac('0x58')](_0x5f400e);})[_0x80ac('0x1e')](function(_0x28b492){_0xeb4546[_0x80ac('0x3e')]=_0x28b492;return _0xeb4546;});}})['then'](respondWithFilteredResult(_0x46ceee,_0x5f400e))[_0x80ac('0x3f')](handleError(_0x46ceee,null));};function char(_0x575455){return _0x80ac('0x5b')===typeof _0x575455?String[_0x80ac('0x5c')][_0x80ac('0x1b')](null,arguments):_0x575455;}function needsEncapsulation(_0xe86b1d){return!!_0xe86b1d&&(_0xe86b1d[_0x80ac('0x5d')]()[_0x80ac('0x5e')](char(0xd))>=0x0||_0xe86b1d[_0x80ac('0x5d')]()['indexOf'](char(0xa))>=0x0||_0xe86b1d['toString']()[_0x80ac('0x5e')](char(0x2c))>=0x0||_0xe86b1d[_0x80ac('0x5d')]()[_0x80ac('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x1038a1){var _0x2708b0=char(0x22),_0x48d0b4='\x5c'+char(0x22),_0x15d0d4=_0x1038a1[_0x80ac('0x5d')]()['replace'](new RegExp(_0x2708b0,'g'),_0x48d0b4);return _0x2708b0+_0x15d0d4+_0x2708b0;}exports[_0x80ac('0x5f')]=function(_0x494889,_0x4bc3c9,_0x2b861f){var _0x3b05e0,_0x15f2cf;var _0x34863c={'where':{'ProjectId':_0x494889[_0x80ac('0x41')]['id']}};if(_0x494889[_0x80ac('0x2a')]['startTime']){_0x34863c[_0x80ac('0x35')][_0x80ac('0x60')]=JSON[_0x80ac('0x61')](_0x494889[_0x80ac('0x2a')]['startTime']);}return db[_0x80ac('0x55')][_0x80ac('0x58')](_0x34863c)[_0x80ac('0x1e')](handleEntityNotFound(_0x4bc3c9,null))['then'](function(_0xb1340c){if(_0xb1340c){_0x3b05e0=_0xb1340c;return db[_0x80ac('0x62')][_0x80ac('0x58')]({'where':{'SessionId':{'$in':_[_0x80ac('0x38')](_0x3b05e0,'id')},'ProjectId':_0x494889[_0x80ac('0x41')]['id']},'order':_0x80ac('0x63')});}})[_0x80ac('0x1e')](handleEntityNotFound(_0x4bc3c9,null))['then'](function(_0x592731){if(_0x592731){_0x15f2cf=_0x592731;var _0x26f468={};for(var _0x144802=0x0,_0x37a379=_0x15f2cf[_0x80ac('0x30')];_0x144802<_0x37a379;_0x144802++){if(!_0x26f468[_0x80ac('0x31')](_0x15f2cf[_0x144802][_0x80ac('0x64')])){_0x26f468[_0x15f2cf[_0x144802][_0x80ac('0x64')]]=needsEncapsulation(_0x15f2cf[_0x144802][_0x80ac('0x65')])?encapsulate(_0x15f2cf[_0x144802][_0x80ac('0x65')]):_0x15f2cf[_0x144802][_0x80ac('0x65')];}}var _0x2d71b3=[],_0x276895={};for(var _0x529307=0x0,_0x18befc=_0x3b05e0['length'];_0x529307<_0x18befc;_0x529307++){_0x276895={'ProjectId':_0x494889[_0x80ac('0x41')]['id'],'SessionId':_0x3b05e0[_0x529307]['id'],'StartTime':moment(_0x3b05e0[_0x529307][_0x80ac('0x60')])[_0x80ac('0x66')](_0x80ac('0x67'))};for(var _0x467dfb=0x0,_0x173e18=_0x15f2cf['length'];_0x467dfb<_0x173e18;_0x467dfb++){if(_0x15f2cf[_0x467dfb][_0x80ac('0x68')]==_0x3b05e0[_0x529307]['id']&&_0x26f468[_0x80ac('0x31')](_0x15f2cf[_0x467dfb]['questionId'])){_0x276895[_0x26f468[_0x15f2cf[_0x467dfb][_0x80ac('0x64')]]]=_0x15f2cf[_0x467dfb][_0x80ac('0x69')];}}for(var _0x19e17e in _0x26f468){if(!_0x276895[_0x80ac('0x31')](_0x26f468[_0x19e17e])){_0x276895[_0x26f468[_0x19e17e]]=null;}}_0x2d71b3[_0x80ac('0x6a')](_0x276895);}return _0x2d71b3;}})['then'](function(_0x910558){if(!_[_0x80ac('0x6b')](_0x910558)){var _0x2cbd91=toCsv(_0x910558);var _0x4b2c74=Date[_0x80ac('0x6c')]();fs[_0x80ac('0x6d')](util['format'](_0x80ac('0x6e'),_0x494889['params']['id'],_0x4b2c74),_0x2cbd91);_0x4bc3c9[_0x80ac('0x6f')]('Content-disposition',_0x80ac('0x70')+util[_0x80ac('0x66')](_0x80ac('0x71'),_0x494889[_0x80ac('0x41')]['id'],_0x4b2c74));_0x4bc3c9[_0x80ac('0x6f')](_0x80ac('0x72'),_0x80ac('0x73'));return _0x4bc3c9[_0x80ac('0x74')](util[_0x80ac('0x66')](_0x80ac('0x6e'),_0x494889[_0x80ac('0x41')]['id'],_0x4b2c74));}else{return _0x4bc3c9['sendStatus'](0xcc);}})[_0x80ac('0x3f')](handleError(_0x4bc3c9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 87eecc6..8c23b63 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 _0x26f9=['util','api','request-promise','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x26f9,0x16f));var _0x926f=function(_0x550a09,_0x54b8dc){_0x550a09=_0x550a09-0x0;var _0x4ca9cd=_0x26f9[_0x550a09];return _0x4ca9cd;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var logger=require('../../config/logger')(_0x926f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x926f('0x3'));var attributes=require(_0x926f('0x4'));module['exports']=function(_0x38dd25,_0x40adf5){return _0x38dd25[_0x926f('0x5')](_0x926f('0x6'),attributes,{'tableName':_0x926f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68a1=['define','jscripty_projects','lodash','util','../../config/logger','api','bluebird','request-promise','./jscriptyProject.attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x68a1,0x89));var _0x168a=function(_0x381a74,_0x4c718c){_0x381a74=_0x381a74-0x0;var _0x1ca789=_0x68a1[_0x381a74];return _0x1ca789;};'use strict';var _=require(_0x168a('0x0'));var util=require(_0x168a('0x1'));var logger=require(_0x168a('0x2'))(_0x168a('0x3'));var moment=require('moment');var BPromise=require(_0x168a('0x4'));var rp=require(_0x168a('0x5'));var attributes=require(_0x168a('0x6'));module['exports']=function(_0x34543b,_0x26cf55){return _0x34543b[_0x168a('0x7')]('JscriptyProject',attributes,{'tableName':_0x168a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 99e68c5..e8c32f1 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 _0xc50e=['stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','result','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0xc50e,0x16b));var _0xec50=function(_0x1a7fb2,_0x35f58c){_0x1a7fb2=_0x1a7fb2-0x0;var _0x3031b2=_0xc50e[_0x1a7fb2];return _0x3031b2;};'use strict';var _=require(_0xec50('0x0'));var util=require(_0xec50('0x1'));var moment=require('moment');var BPromise=require(_0xec50('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec50('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xec50('0x4'));var config=require(_0xec50('0x5'));var jayson=require(_0xec50('0x6'));var client=jayson[_0xec50('0x7')][_0xec50('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15ae14,_0x5b3357,_0x2835c9){return new BPromise(function(_0x59ff6d,_0x1adc60){return client[_0xec50('0x9')](_0x15ae14,_0x2835c9)[_0xec50('0xa')](function(_0x131b32){logger[_0xec50('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5b3357,_0xec50('0xc'));logger[_0xec50('0xd')](_0xec50('0xe'),_0x5b3357,_0xec50('0xc'),JSON[_0xec50('0xf')](_0x131b32));if(_0x131b32['error']){if(_0x131b32[_0xec50('0x10')][_0xec50('0x11')]===0x1f4){logger[_0xec50('0x10')](_0xec50('0x12'),_0x5b3357,_0x131b32['error']['message']);return _0x1adc60(_0x131b32[_0xec50('0x10')][_0xec50('0x13')]);}logger[_0xec50('0x10')](_0xec50('0x12'),_0x5b3357,_0x131b32[_0xec50('0x10')][_0xec50('0x13')]);return _0x59ff6d(_0x131b32[_0xec50('0x10')]['message']);}else{logger[_0xec50('0xb')](_0xec50('0x12'),_0x5b3357,_0xec50('0xc'));_0x59ff6d(_0x131b32[_0xec50('0x14')]['message']);}})['catch'](function(_0x14b726){logger[_0xec50('0x10')](_0xec50('0x12'),_0x5b3357,_0x14b726);_0x1adc60(_0x14b726);});});} \ No newline at end of file +var _0x1512=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x461888,_0x445651){var _0x3ac17e=function(_0x34ef45){while(--_0x34ef45){_0x461888['push'](_0x461888['shift']());}};_0x3ac17e(++_0x445651);}(_0x1512,0x1d1));var _0x2151=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1512[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2151('0x0'));var util=require(_0x2151('0x1'));var moment=require(_0x2151('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2151('0x3'));var db=require(_0x2151('0x4'))['db'];var utils=require(_0x2151('0x5'));var logger=require('../../config/logger')(_0x2151('0x6'));var config=require(_0x2151('0x7'));var jayson=require(_0x2151('0x8'));var client=jayson[_0x2151('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe75e2b,_0x210569,_0x47f398){return new BPromise(function(_0x26082c,_0x4b6812){return client[_0x2151('0xa')](_0xe75e2b,_0x47f398)[_0x2151('0xb')](function(_0x561580){logger[_0x2151('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x210569,_0x2151('0xd'));logger[_0x2151('0xe')](_0x2151('0xf'),_0x210569,'request\x20sent',JSON[_0x2151('0x10')](_0x561580));if(_0x561580[_0x2151('0x11')]){if(_0x561580['error'][_0x2151('0x12')]===0x1f4){logger[_0x2151('0x11')](_0x2151('0x13'),_0x210569,_0x561580[_0x2151('0x11')][_0x2151('0x14')]);return _0x4b6812(_0x561580[_0x2151('0x11')][_0x2151('0x14')]);}logger[_0x2151('0x11')](_0x2151('0x13'),_0x210569,_0x561580[_0x2151('0x11')][_0x2151('0x14')]);return _0x26082c(_0x561580[_0x2151('0x11')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x210569,_0x2151('0xd'));_0x26082c(_0x561580[_0x2151('0x15')]['message']);}})[_0x2151('0x16')](function(_0x40d42b){logger[_0x2151('0x11')](_0x2151('0x13'),_0x210569,_0x40d42b);_0x4b6812(_0x40d42b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index f64ddbe..047c983 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 _0xd8e5=['exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','describe','isAuthenticated','post','delete','/:id','destroy'];(function(_0x59e02a,_0xf4ce9e){var _0x1466e4=function(_0x18a7fd){while(--_0x18a7fd){_0x59e02a['push'](_0x59e02a['shift']());}};_0x1466e4(++_0xf4ce9e);}(_0xd8e5,0x17b));var _0x5d8e=function(_0x54a011,_0x518bc8){_0x54a011=_0x54a011-0x0;var _0x2dea7d=_0xd8e5[_0x54a011];return _0x2dea7d;};'use strict';var multer=require(_0x5d8e('0x0'));var util=require(_0x5d8e('0x1'));var path=require(_0x5d8e('0x2'));var timeout=require(_0x5d8e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x5d8e('0x4'));var interaction=require(_0x5d8e('0x5'));var config=require(_0x5d8e('0x6'));var controller=require(_0x5d8e('0x7'));router[_0x5d8e('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d8e('0x9')]);router[_0x5d8e('0x8')](_0x5d8e('0xa'),auth['isAuthenticated'](),controller[_0x5d8e('0xb')]);router['get']('/:id',auth[_0x5d8e('0xc')](),controller['show']);router[_0x5d8e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x5d8e('0xc')](),controller['update']);router[_0x5d8e('0xe')](_0x5d8e('0xf'),auth[_0x5d8e('0xc')](),controller[_0x5d8e('0x10')]);module[_0x5d8e('0x11')]=router; \ No newline at end of file +var _0xaf5f=['isAuthenticated','index','describe','/:id','show','post','put','update','delete','multer','util','path','express','Router','./jscriptyQuestionReport.controller','get'];(function(_0x202402,_0x688ad0){var _0xf02df5=function(_0x29ef26){while(--_0x29ef26){_0x202402['push'](_0x202402['shift']());}};_0xf02df5(++_0x688ad0);}(_0xaf5f,0x199));var _0xfaf5=function(_0x4f0fd2,_0x24323f){_0x4f0fd2=_0x4f0fd2-0x0;var _0x4fceec=_0xaf5f[_0x4f0fd2];return _0x4fceec;};'use strict';var multer=require(_0xfaf5('0x0'));var util=require(_0xfaf5('0x1'));var path=require(_0xfaf5('0x2'));var timeout=require('connect-timeout');var express=require(_0xfaf5('0x3'));var router=express[_0xfaf5('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfaf5('0x5'));router[_0xfaf5('0x6')]('/',auth[_0xfaf5('0x7')](),controller[_0xfaf5('0x8')]);router[_0xfaf5('0x6')]('/describe',auth[_0xfaf5('0x7')](),controller[_0xfaf5('0x9')]);router['get'](_0xfaf5('0xa'),auth[_0xfaf5('0x7')](),controller[_0xfaf5('0xb')]);router[_0xfaf5('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfaf5('0xd')]('/:id',auth[_0xfaf5('0x7')](),controller[_0xfaf5('0xe')]);router[_0xfaf5('0xf')](_0xfaf5('0xa'),auth[_0xfaf5('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 8f2ca84..165d57f 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 _0x4a3c=['sequelize','STRING','TEXT','long'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x16ef93,_0x2cb895){_0x16ef93=_0x16ef93-0x0;var _0x47ed85=_0x4a3c[_0x16ef93];return _0x47ed85;};'use strict';var Sequelize=require(_0xc4a3('0x0'));module['exports']={'question':{'type':Sequelize[_0xc4a3('0x1')]},'answer':{'type':Sequelize[_0xc4a3('0x2')](_0xc4a3('0x3'))},'membername':{'type':Sequelize[_0xc4a3('0x1')]},'projectname':{'type':Sequelize[_0xc4a3('0x1')]},'queue':{'type':Sequelize[_0xc4a3('0x1')]},'uniqueid':{'type':Sequelize[_0xc4a3('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc4a3('0x1')]},'questionId':{'type':Sequelize[_0xc4a3('0x1')]}}; \ No newline at end of file +var _0xa74d=['STRING','TEXT','long','exports'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa74d,0x1cf));var _0xda74=function(_0xacef71,_0x2e58c2){_0xacef71=_0xacef71-0x0;var _0x4df6de=_0xa74d[_0xacef71];return _0x4df6de;};'use strict';var Sequelize=require('sequelize');module[_0xda74('0x0')]={'question':{'type':Sequelize[_0xda74('0x1')]},'answer':{'type':Sequelize[_0xda74('0x2')](_0xda74('0x3'))},'membername':{'type':Sequelize[_0xda74('0x1')]},'projectname':{'type':Sequelize[_0xda74('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xda74('0x1')]},'calleridname':{'type':Sequelize[_0xda74('0x1')]},'calleridnum':{'type':Sequelize[_0xda74('0x1')]},'questionId':{'type':Sequelize[_0xda74('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 7b360c9..c3533a5 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 _0xe1e3=['Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','index','rawAttributes','keys','query','filters','intersection','fields','attributes','length','model','order','sort','pick','where','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','JscriptyQuestionReport','create','body','find','describe','html-pdf','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','limit','set'];(function(_0x3c25d7,_0x50ebd0){var _0xd8d3a6=function(_0xfa4124){while(--_0xfa4124){_0x3c25d7['push'](_0x3c25d7['shift']());}};_0xd8d3a6(++_0x50ebd0);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0xd65ef0,_0x5881e8){_0xd65ef0=_0xd65ef0-0x0;var _0x1a9ed9=_0xe1e3[_0xd65ef0];return _0x1a9ed9;};'use strict';var pdf=require(_0x3e1e('0x0'));var emlformat=require(_0x3e1e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3e1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e1e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e1e('0x4'));var util=require(_0x3e1e('0x5'));var path=require(_0x3e1e('0x6'));var sox=require(_0x3e1e('0x7'));var csv=require(_0x3e1e('0x8'));var ejs=require(_0x3e1e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x8'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3e1e('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x3e1e('0x10'))(_0x3e1e('0x11'));var utils=require(_0x3e1e('0x12'));var config=require('../../config/environment');var db=require(_0x3e1e('0x13'))['db'];function respondWithStatusCode(_0x4e6eee,_0x4fcd4f){_0x4fcd4f=_0x4fcd4f||0xcc;return function(_0x4e47b9){if(_0x4e47b9){return _0x4e6eee['sendStatus'](_0x4fcd4f);}return _0x4e6eee['status'](_0x4fcd4f)[_0x3e1e('0x14')]();};}function respondWithResult(_0x595660,_0x4d1e78){_0x4d1e78=_0x4d1e78||0xc8;return function(_0x3a9375){if(_0x3a9375){return _0x595660[_0x3e1e('0x15')](_0x4d1e78)[_0x3e1e('0x16')](_0x3a9375);}};}function respondWithFilteredResult(_0x50f221,_0x5b34ec){return function(_0x4131a1){if(_0x4131a1){var _0x1b62e6=_0x4131a1['count'],_0x4dca60=_0x5b34ec[_0x3e1e('0x17')],_0x26cb35=_0x5b34ec['offset']+_0x5b34ec[_0x3e1e('0x18')],_0x1f0af9;if(_0x26cb35>=_0x1b62e6){_0x26cb35=_0x1b62e6;_0x1f0af9=0xc8;}else{_0x1f0af9=0xce;}_0x50f221[_0x3e1e('0x15')](_0x1f0af9);return _0x50f221[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x4dca60+'-'+_0x26cb35+'/'+_0x1b62e6)[_0x3e1e('0x16')](_0x4131a1);}return null;};}function patchUpdates(_0x1c181b){return function(_0x569f49){try{jsonpatch['apply'](_0x569f49,_0x1c181b,!![]);}catch(_0x4a9497){return BPromise[_0x3e1e('0x1b')](_0x4a9497);}return _0x569f49[_0x3e1e('0x1c')]();};}function saveUpdates(_0xa3e99c,_0x57c660){return function(_0x1c5acd){if(_0x1c5acd){return _0x1c5acd['update'](_0xa3e99c)[_0x3e1e('0x1d')](function(_0x33ec1d){return _0x33ec1d;});}return null;};}function removeEntity(_0x474085,_0x5f4e29){return function(_0x53e051){if(_0x53e051){return _0x53e051[_0x3e1e('0x1e')]()[_0x3e1e('0x1d')](function(){_0x474085['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13d7ac,_0x1b5097){return function(_0x488f9f){if(!_0x488f9f){_0x13d7ac[_0x3e1e('0x1f')](0x194);}return _0x488f9f;};}function handleError(_0x56ae51,_0x164b15){_0x164b15=_0x164b15||0x1f4;return function(_0x33bf0f){logger[_0x3e1e('0x20')](_0x33bf0f[_0x3e1e('0x21')]);if(_0x33bf0f[_0x3e1e('0x22')]){delete _0x33bf0f[_0x3e1e('0x22')];}_0x56ae51['status'](_0x164b15)['send'](_0x33bf0f);};}exports[_0x3e1e('0x23')]=function(_0x541ef1,_0x55db8f){var _0x4be84e={},_0x56b9a8={},_0x1a33bb={'count':0x0,'rows':[]};var _0x43ec88=db['JscriptyQuestionReport'][_0x3e1e('0x24')];_0x56b9a8['model']=_[_0x3e1e('0x25')](_0x43ec88);_0x56b9a8[_0x3e1e('0x26')]=_['keys'](_0x541ef1[_0x3e1e('0x26')]);_0x56b9a8[_0x3e1e('0x27')]=_[_0x3e1e('0x28')](_0x56b9a8['model'],_0x56b9a8[_0x3e1e('0x26')]);_0x4be84e['attributes']=_['intersection'](_0x56b9a8['model'],qs[_0x3e1e('0x29')](_0x541ef1['query']['fields']));_0x4be84e[_0x3e1e('0x2a')]=_0x4be84e[_0x3e1e('0x2a')][_0x3e1e('0x2b')]?_0x4be84e[_0x3e1e('0x2a')]:_0x56b9a8[_0x3e1e('0x2c')];if(!_0x541ef1['query']['hasOwnProperty']('nolimit')){_0x4be84e['limit']=qs[_0x3e1e('0x18')](_0x541ef1[_0x3e1e('0x26')][_0x3e1e('0x18')]);_0x4be84e[_0x3e1e('0x17')]=qs[_0x3e1e('0x17')](_0x541ef1[_0x3e1e('0x26')][_0x3e1e('0x17')]);}_0x4be84e[_0x3e1e('0x2d')]=qs['sort'](_0x541ef1[_0x3e1e('0x26')][_0x3e1e('0x2e')]);_0x4be84e['where']=qs[_0x3e1e('0x27')](_[_0x3e1e('0x2f')](_0x541ef1[_0x3e1e('0x26')],_0x56b9a8[_0x3e1e('0x27')]));if(_0x541ef1['query']['filter']){_0x4be84e[_0x3e1e('0x30')]=_[_0x3e1e('0x31')](_0x4be84e['where'],{'$or':_[_0x3e1e('0x32')](_0x43ec88,function(_0x290fa2){if(_0x290fa2['type'][_0x3e1e('0x33')]!==_0x3e1e('0x34')){var _0x31b10e={};_0x31b10e[_0x290fa2[_0x3e1e('0x35')]]={'$like':'%'+_0x541ef1[_0x3e1e('0x26')]['filter']+'%'};return _0x31b10e;}})});}_0x4be84e=_[_0x3e1e('0x31')]({},_0x4be84e,_0x541ef1[_0x3e1e('0x36')]);var _0x1c622e={'where':_0x4be84e[_0x3e1e('0x30')]};return db['JscriptyQuestionReport'][_0x3e1e('0x37')](_0x1c622e)[_0x3e1e('0x1d')](function(_0x111da4){_0x1a33bb[_0x3e1e('0x37')]=_0x111da4;if(_0x541ef1[_0x3e1e('0x26')][_0x3e1e('0x38')]){_0x4be84e[_0x3e1e('0x39')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x3e1e('0x3a')](_0x4be84e);})['then'](function(_0x53bdf5){_0x1a33bb[_0x3e1e('0x3b')]=_0x53bdf5;return _0x1a33bb;})[_0x3e1e('0x1d')](respondWithFilteredResult(_0x55db8f,_0x4be84e))[_0x3e1e('0x3c')](handleError(_0x55db8f,null));};exports['show']=function(_0x3dbd2a,_0xb030eb){var _0x4d372a={'raw':!![],'where':{'id':_0x3dbd2a[_0x3e1e('0x3d')]['id']}},_0x16d03f={};_0x16d03f['model']=_['keys'](db[_0x3e1e('0x3e')]['rawAttributes']);_0x16d03f['query']=_[_0x3e1e('0x25')](_0x3dbd2a[_0x3e1e('0x26')]);_0x16d03f[_0x3e1e('0x27')]=_[_0x3e1e('0x28')](_0x16d03f[_0x3e1e('0x2c')],_0x16d03f['query']);_0x4d372a['attributes']=_[_0x3e1e('0x28')](_0x16d03f[_0x3e1e('0x2c')],qs[_0x3e1e('0x29')](_0x3dbd2a['query'][_0x3e1e('0x29')]));_0x4d372a[_0x3e1e('0x2a')]=_0x4d372a[_0x3e1e('0x2a')]['length']?_0x4d372a[_0x3e1e('0x2a')]:_0x16d03f['model'];if(_0x3dbd2a['query'][_0x3e1e('0x38')]){_0x4d372a[_0x3e1e('0x39')]=[{'all':!![]}];}_0x4d372a=_[_0x3e1e('0x31')]({},_0x4d372a,_0x3dbd2a[_0x3e1e('0x36')]);return db['JscriptyQuestionReport']['find'](_0x4d372a)['then'](handleEntityNotFound(_0xb030eb,null))['then'](respondWithResult(_0xb030eb,null))[_0x3e1e('0x3c')](handleError(_0xb030eb,null));};exports[_0x3e1e('0x3f')]=function(_0x480e20,_0x5c380d){return db[_0x3e1e('0x3e')][_0x3e1e('0x3f')](_0x480e20[_0x3e1e('0x40')],{})['then'](respondWithResult(_0x5c380d,0xc9))[_0x3e1e('0x3c')](handleError(_0x5c380d,null));};exports['update']=function(_0xd34c28,_0x4713bd){if(_0xd34c28[_0x3e1e('0x40')]['id']){delete _0xd34c28[_0x3e1e('0x40')]['id'];}return db[_0x3e1e('0x3e')][_0x3e1e('0x41')]({'where':{'id':_0xd34c28['params']['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x4713bd,null))[_0x3e1e('0x1d')](saveUpdates(_0xd34c28['body'],null))[_0x3e1e('0x1d')](respondWithResult(_0x4713bd,null))[_0x3e1e('0x3c')](handleError(_0x4713bd,null));};exports['destroy']=function(_0x1cc820,_0x347b3f){return db[_0x3e1e('0x3e')][_0x3e1e('0x41')]({'where':{'id':_0x1cc820['params']['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x347b3f,null))[_0x3e1e('0x1d')](removeEntity(_0x347b3f,null))[_0x3e1e('0x3c')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x42')]=function(_0x4bce83,_0xbeaf39){return db[_0x3e1e('0x3e')][_0x3e1e('0x42')]()[_0x3e1e('0x1d')](respondWithResult(_0xbeaf39,null))[_0x3e1e('0x3c')](handleError(_0xbeaf39,null));}; \ No newline at end of file +var _0x63a5=['offset','limit','Content-Range','save','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x17ef88,_0x581af4){var _0x1dc0fc=function(_0x390176){while(--_0x390176){_0x17ef88['push'](_0x17ef88['shift']());}};_0x1dc0fc(++_0x581af4);}(_0x63a5,0x18e));var _0x563a=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x63a5[_0x119d5a];return _0x15bff4;};'use strict';var pdf=require(_0x563a('0x0'));var emlformat=require(_0x563a('0x1'));var rimraf=require(_0x563a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x563a('0x3'));var rp=require('request-promise');var moment=require(_0x563a('0x4'));var BPromise=require(_0x563a('0x5'));var Mustache=require(_0x563a('0x6'));var util=require(_0x563a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x563a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0x8'));var querystring=require(_0x563a('0xc'));var Papa=require(_0x563a('0xd'));var authService=require(_0x563a('0xe'));var hardwareService=require(_0x563a('0xf'));var Redis=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var logger=require(_0x563a('0x12'))(_0x563a('0x13'));var utils=require(_0x563a('0x14'));var config=require(_0x563a('0x15'));var db=require(_0x563a('0x16'))['db'];function respondWithStatusCode(_0x3d618a,_0x5059f4){_0x5059f4=_0x5059f4||0xcc;return function(_0x61d5b2){if(_0x61d5b2){return _0x3d618a[_0x563a('0x17')](_0x5059f4);}return _0x3d618a[_0x563a('0x18')](_0x5059f4)[_0x563a('0x19')]();};}function respondWithResult(_0x2e01ec,_0x46fb3e){_0x46fb3e=_0x46fb3e||0xc8;return function(_0x50396b){if(_0x50396b){return _0x2e01ec[_0x563a('0x18')](_0x46fb3e)[_0x563a('0x1a')](_0x50396b);}};}function respondWithFilteredResult(_0x8c3727,_0x26987f){return function(_0x5a2980){if(_0x5a2980){var _0x504cb7=_0x5a2980[_0x563a('0x1b')],_0x414535=_0x26987f[_0x563a('0x1c')],_0x2ad667=_0x26987f[_0x563a('0x1c')]+_0x26987f[_0x563a('0x1d')],_0x5b291f;if(_0x2ad667>=_0x504cb7){_0x2ad667=_0x504cb7;_0x5b291f=0xc8;}else{_0x5b291f=0xce;}_0x8c3727['status'](_0x5b291f);return _0x8c3727['set'](_0x563a('0x1e'),_0x414535+'-'+_0x2ad667+'/'+_0x504cb7)[_0x563a('0x1a')](_0x5a2980);}return null;};}function patchUpdates(_0x54a3b4){return function(_0x526a51){try{jsonpatch['apply'](_0x526a51,_0x54a3b4,!![]);}catch(_0x52b99a){return BPromise['reject'](_0x52b99a);}return _0x526a51[_0x563a('0x1f')]();};}function saveUpdates(_0x300956,_0x26061f){return function(_0x43b7a8){if(_0x43b7a8){return _0x43b7a8['update'](_0x300956)['then'](function(_0x3930f0){return _0x3930f0;});}return null;};}function removeEntity(_0x9f8b29,_0x1a16cd){return function(_0x2beccb){if(_0x2beccb){return _0x2beccb[_0x563a('0x20')]()[_0x563a('0x21')](function(){_0x9f8b29[_0x563a('0x18')](0xcc)[_0x563a('0x19')]();});}};}function handleEntityNotFound(_0x506491,_0xd59ba8){return function(_0x5422f6){if(!_0x5422f6){_0x506491[_0x563a('0x17')](0x194);}return _0x5422f6;};}function handleError(_0xd3e0ae,_0x3a36a4){_0x3a36a4=_0x3a36a4||0x1f4;return function(_0x1250e6){logger[_0x563a('0x22')](_0x1250e6[_0x563a('0x23')]);if(_0x1250e6[_0x563a('0x24')]){delete _0x1250e6[_0x563a('0x24')];}_0xd3e0ae['status'](_0x3a36a4)[_0x563a('0x25')](_0x1250e6);};}exports[_0x563a('0x26')]=function(_0x2311f2,_0x3d79ac){var _0xce8165={},_0x1898f9={},_0x1afdff={'count':0x0,'rows':[]};var _0x199045=db[_0x563a('0x27')][_0x563a('0x28')];_0x1898f9[_0x563a('0x29')]=_[_0x563a('0x2a')](_0x199045);_0x1898f9[_0x563a('0x2b')]=_[_0x563a('0x2a')](_0x2311f2['query']);_0x1898f9[_0x563a('0x2c')]=_[_0x563a('0x2d')](_0x1898f9[_0x563a('0x29')],_0x1898f9['query']);_0xce8165[_0x563a('0x2e')]=_[_0x563a('0x2d')](_0x1898f9[_0x563a('0x29')],qs[_0x563a('0x2f')](_0x2311f2[_0x563a('0x2b')][_0x563a('0x2f')]));_0xce8165[_0x563a('0x2e')]=_0xce8165['attributes'][_0x563a('0x30')]?_0xce8165[_0x563a('0x2e')]:_0x1898f9[_0x563a('0x29')];if(!_0x2311f2[_0x563a('0x2b')][_0x563a('0x31')]('nolimit')){_0xce8165['limit']=qs['limit'](_0x2311f2['query'][_0x563a('0x1d')]);_0xce8165[_0x563a('0x1c')]=qs[_0x563a('0x1c')](_0x2311f2[_0x563a('0x2b')][_0x563a('0x1c')]);}_0xce8165[_0x563a('0x32')]=qs['sort'](_0x2311f2['query'][_0x563a('0x33')]);_0xce8165[_0x563a('0x34')]=qs[_0x563a('0x2c')](_[_0x563a('0x35')](_0x2311f2[_0x563a('0x2b')],_0x1898f9[_0x563a('0x2c')]));if(_0x2311f2[_0x563a('0x2b')][_0x563a('0x36')]){_0xce8165[_0x563a('0x34')]=_[_0x563a('0x37')](_0xce8165[_0x563a('0x34')],{'$or':_[_0x563a('0x38')](_0x199045,function(_0x251a98){if(_0x251a98[_0x563a('0x39')][_0x563a('0x3a')]!==_0x563a('0x3b')){var _0x5c1ef7={};_0x5c1ef7[_0x251a98[_0x563a('0x3c')]]={'$like':'%'+_0x2311f2[_0x563a('0x2b')][_0x563a('0x36')]+'%'};return _0x5c1ef7;}})});}_0xce8165=_['merge']({},_0xce8165,_0x2311f2[_0x563a('0x3d')]);var _0x5e774f={'where':_0xce8165[_0x563a('0x34')]};return db[_0x563a('0x27')]['count'](_0x5e774f)['then'](function(_0x1b48f1){_0x1afdff['count']=_0x1b48f1;if(_0x2311f2[_0x563a('0x2b')][_0x563a('0x3e')]){_0xce8165[_0x563a('0x3f')]=[{'all':!![]}];}return db[_0x563a('0x27')]['findAll'](_0xce8165);})['then'](function(_0x615d2e){_0x1afdff['rows']=_0x615d2e;return _0x1afdff;})[_0x563a('0x21')](respondWithFilteredResult(_0x3d79ac,_0xce8165))[_0x563a('0x40')](handleError(_0x3d79ac,null));};exports[_0x563a('0x41')]=function(_0x9c392c,_0x3a2eb0){var _0x38fab5={'raw':!![],'where':{'id':_0x9c392c[_0x563a('0x42')]['id']}},_0x4bf555={};_0x4bf555['model']=_[_0x563a('0x2a')](db['JscriptyQuestionReport'][_0x563a('0x28')]);_0x4bf555[_0x563a('0x2b')]=_[_0x563a('0x2a')](_0x9c392c[_0x563a('0x2b')]);_0x4bf555['filters']=_['intersection'](_0x4bf555['model'],_0x4bf555[_0x563a('0x2b')]);_0x38fab5[_0x563a('0x2e')]=_[_0x563a('0x2d')](_0x4bf555[_0x563a('0x29')],qs[_0x563a('0x2f')](_0x9c392c[_0x563a('0x2b')][_0x563a('0x2f')]));_0x38fab5[_0x563a('0x2e')]=_0x38fab5[_0x563a('0x2e')][_0x563a('0x30')]?_0x38fab5[_0x563a('0x2e')]:_0x4bf555[_0x563a('0x29')];if(_0x9c392c[_0x563a('0x2b')][_0x563a('0x3e')]){_0x38fab5[_0x563a('0x3f')]=[{'all':!![]}];}_0x38fab5=_[_0x563a('0x37')]({},_0x38fab5,_0x9c392c[_0x563a('0x3d')]);return db[_0x563a('0x27')][_0x563a('0x43')](_0x38fab5)['then'](handleEntityNotFound(_0x3a2eb0,null))['then'](respondWithResult(_0x3a2eb0,null))[_0x563a('0x40')](handleError(_0x3a2eb0,null));};exports[_0x563a('0x44')]=function(_0x33929c,_0x545a0e){return db[_0x563a('0x27')][_0x563a('0x44')](_0x33929c[_0x563a('0x45')],{})[_0x563a('0x21')](respondWithResult(_0x545a0e,0xc9))['catch'](handleError(_0x545a0e,null));};exports['update']=function(_0x3ab1c1,_0x29aebd){if(_0x3ab1c1[_0x563a('0x45')]['id']){delete _0x3ab1c1[_0x563a('0x45')]['id'];}return db[_0x563a('0x27')][_0x563a('0x43')]({'where':{'id':_0x3ab1c1[_0x563a('0x42')]['id']}})[_0x563a('0x21')](handleEntityNotFound(_0x29aebd,null))['then'](saveUpdates(_0x3ab1c1[_0x563a('0x45')],null))[_0x563a('0x21')](respondWithResult(_0x29aebd,null))['catch'](handleError(_0x29aebd,null));};exports[_0x563a('0x20')]=function(_0x5a063a,_0x3ea787){return db[_0x563a('0x27')][_0x563a('0x43')]({'where':{'id':_0x5a063a['params']['id']}})[_0x563a('0x21')](handleEntityNotFound(_0x3ea787,null))[_0x563a('0x21')](removeEntity(_0x3ea787,null))[_0x563a('0x40')](handleError(_0x3ea787,null));};exports[_0x563a('0x46')]=function(_0x6fe8a9,_0x18b686){return db[_0x563a('0x27')][_0x563a('0x46')]()[_0x563a('0x21')](respondWithResult(_0x18b686,null))[_0x563a('0x40')](handleError(_0x18b686,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 0c8eb86..a970bd3 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 _0x26c6=['util','moment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x602335,_0x3e6ec1){var _0x1022ff=function(_0x1d41f8){while(--_0x1d41f8){_0x602335['push'](_0x602335['shift']());}};_0x1022ff(++_0x3e6ec1);}(_0x26c6,0x84));var _0x626c=function(_0x4a1602,_0x4774ab){_0x4a1602=_0x4a1602-0x0;var _0x1474c2=_0x26c6[_0x4a1602];return _0x1474c2;};'use strict';var _=require(_0x626c('0x0'));var util=require(_0x626c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x626c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x626c('0x3'));module['exports']=function(_0x4e51ce,_0x3f291e){return _0x4e51ce[_0x626c('0x4')](_0x626c('0x5'),attributes,{'tableName':_0x626c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed11=['exports','define','JscriptyQuestionReport','report_jscripty_questions','bluebird','request-promise','./jscriptyQuestionReport.attributes'];(function(_0x4f1ee6,_0x3a0ac1){var _0x331ef3=function(_0x2ca0dd){while(--_0x2ca0dd){_0x4f1ee6['push'](_0x4f1ee6['shift']());}};_0x331ef3(++_0x3a0ac1);}(_0xed11,0x107));var _0x1ed1=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xed11[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1ed1('0x0'));var rp=require(_0x1ed1('0x1'));var attributes=require(_0x1ed1('0x2'));module[_0x1ed1('0x3')]=function(_0x4f2eb3,_0xeb38a7){return _0x4f2eb3[_0x1ed1('0x4')](_0x1ed1('0x5'),attributes,{'tableName':_0x1ed1('0x6'),'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 78849d9..fa56a15 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 _0x9167=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','lodash'];(function(_0x41e05c,_0x348678){var _0x6d48cd=function(_0x3f2a9c){while(--_0x3f2a9c){_0x41e05c['push'](_0x41e05c['shift']());}};_0x6d48cd(++_0x348678);}(_0x9167,0x16f));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7916('0x0'));var util=require(_0x7916('0x1'));var moment=require(_0x7916('0x2'));var BPromise=require(_0x7916('0x3'));var rs=require(_0x7916('0x4'));var fs=require('fs');var Redis=require(_0x7916('0x5'));var db=require(_0x7916('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7916('0x7'))(_0x7916('0x8'));var config=require(_0x7916('0x9'));var jayson=require(_0x7916('0xa'));var client=jayson[_0x7916('0xb')][_0x7916('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xaf310d,_0x2410e3,_0x1e3fc4){return new BPromise(function(_0x46b881,_0x28bfde){return client[_0x7916('0xd')](_0xaf310d,_0x1e3fc4)[_0x7916('0xe')](function(_0xe900a0){logger[_0x7916('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2410e3,_0x7916('0x10'));logger['debug'](_0x7916('0x11'),_0x2410e3,'request\x20sent',JSON[_0x7916('0x12')](_0xe900a0));if(_0xe900a0[_0x7916('0x13')]){if(_0xe900a0['error'][_0x7916('0x14')]===0x1f4){logger['error'](_0x7916('0x15'),_0x2410e3,_0xe900a0[_0x7916('0x13')][_0x7916('0x16')]);return _0x28bfde(_0xe900a0[_0x7916('0x13')]['message']);}logger[_0x7916('0x13')](_0x7916('0x15'),_0x2410e3,_0xe900a0['error'][_0x7916('0x16')]);return _0x46b881(_0xe900a0[_0x7916('0x13')][_0x7916('0x16')]);}else{logger[_0x7916('0xf')](_0x7916('0x15'),_0x2410e3,_0x7916('0x10'));_0x46b881(_0xe900a0['result'][_0x7916('0x16')]);}})['catch'](function(_0x1fb78d){logger[_0x7916('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2410e3,_0x1fb78d);_0x28bfde(_0x1fb78d);});});} \ No newline at end of file +var _0xef19=['error','code','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0xef19,0x17b));var _0x9ef1=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0xef19[_0x1dd532];return _0x3732aa;};'use strict';var _=require(_0x9ef1('0x0'));var util=require('util');var moment=require(_0x9ef1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ef1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9ef1('0x3'));var logger=require(_0x9ef1('0x4'))(_0x9ef1('0x5'));var config=require(_0x9ef1('0x6'));var jayson=require(_0x9ef1('0x7'));var client=jayson[_0x9ef1('0x8')][_0x9ef1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49af1b,_0xfffc0b,_0x35a4f1){return new BPromise(function(_0x2cf3f5,_0x14b96e){return client[_0x9ef1('0xa')](_0x49af1b,_0x35a4f1)[_0x9ef1('0xb')](function(_0xc50bf4){logger[_0x9ef1('0xc')](_0x9ef1('0xd'),_0xfffc0b,_0x9ef1('0xe'));logger[_0x9ef1('0xf')](_0x9ef1('0x10'),_0xfffc0b,_0x9ef1('0xe'),JSON['stringify'](_0xc50bf4));if(_0xc50bf4['error']){if(_0xc50bf4[_0x9ef1('0x11')][_0x9ef1('0x12')]===0x1f4){logger[_0x9ef1('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xfffc0b,_0xc50bf4[_0x9ef1('0x11')]['message']);return _0x14b96e(_0xc50bf4[_0x9ef1('0x11')]['message']);}logger[_0x9ef1('0x11')](_0x9ef1('0xd'),_0xfffc0b,_0xc50bf4[_0x9ef1('0x11')][_0x9ef1('0x13')]);return _0x2cf3f5(_0xc50bf4[_0x9ef1('0x11')]['message']);}else{logger[_0x9ef1('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xfffc0b,_0x9ef1('0xe'));_0x2cf3f5(_0xc50bf4[_0x9ef1('0x14')][_0x9ef1('0x13')]);}})[_0x9ef1('0x15')](function(_0x27c7f5){logger[_0x9ef1('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xfffc0b,_0x27c7f5);_0x14b96e(_0x27c7f5);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index f0db294..2475407 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 _0xc115=['put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','/:id/questions','getQuestions','post'];(function(_0x260073,_0xbe6af9){var _0x4ff033=function(_0x4a7c64){while(--_0x4a7c64){_0x260073['push'](_0x260073['shift']());}};_0x4ff033(++_0xbe6af9);}(_0xc115,0x12f));var _0x5c11=function(_0x56a22e,_0x4f9e9a){_0x56a22e=_0x56a22e-0x0;var _0x4daef0=_0xc115[_0x56a22e];return _0x4daef0;};'use strict';var multer=require(_0x5c11('0x0'));var util=require(_0x5c11('0x1'));var path=require(_0x5c11('0x2'));var timeout=require(_0x5c11('0x3'));var express=require('express');var router=express[_0x5c11('0x4')]();var auth=require(_0x5c11('0x5'));var interaction=require(_0x5c11('0x6'));var config=require(_0x5c11('0x7'));var controller=require(_0x5c11('0x8'));router[_0x5c11('0x9')]('/',auth[_0x5c11('0xa')](),controller[_0x5c11('0xb')]);router[_0x5c11('0x9')]('/describe',auth[_0x5c11('0xa')](),controller[_0x5c11('0xc')]);router['get'](_0x5c11('0xd'),auth[_0x5c11('0xa')](),controller['show']);router['get'](_0x5c11('0xe'),auth['isAuthenticated'](),controller[_0x5c11('0xf')]);router[_0x5c11('0x10')]('/',auth[_0x5c11('0xa')](),controller['create']);router[_0x5c11('0x11')](_0x5c11('0xd'),auth[_0x5c11('0xa')](),controller[_0x5c11('0x12')]);router['delete'](_0x5c11('0xd'),auth[_0x5c11('0xa')](),controller['destroy']);module[_0x5c11('0x13')]=router; \ No newline at end of file +var _0x1817=['../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/questions','getQuestions','post','put','delete','destroy','util','connect-timeout','../../components/auth/service'];(function(_0x561516,_0x58da59){var _0x4f4fc0=function(_0x356950){while(--_0x356950){_0x561516['push'](_0x561516['shift']());}};_0x4f4fc0(++_0x58da59);}(_0x1817,0x193));var _0x7181=function(_0x5e6fe4,_0x2f10df){_0x5e6fe4=_0x5e6fe4-0x0;var _0x407a67=_0x1817[_0x5e6fe4];return _0x407a67;};'use strict';var multer=require('multer');var util=require(_0x7181('0x0'));var path=require('path');var timeout=require(_0x7181('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x7181('0x2'));var interaction=require(_0x7181('0x3'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x7181('0x4')]('/',auth[_0x7181('0x5')](),controller['index']);router[_0x7181('0x4')]('/describe',auth[_0x7181('0x5')](),controller['describe']);router[_0x7181('0x4')](_0x7181('0x6'),auth[_0x7181('0x5')](),controller[_0x7181('0x7')]);router['get'](_0x7181('0x8'),auth[_0x7181('0x5')](),controller[_0x7181('0x9')]);router[_0x7181('0xa')]('/',auth[_0x7181('0x5')](),controller['create']);router[_0x7181('0xb')](_0x7181('0x6'),auth[_0x7181('0x5')](),controller['update']);router[_0x7181('0xc')](_0x7181('0x6'),auth[_0x7181('0x5')](),controller[_0x7181('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a6d9195..556f862 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 _0x95a9=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','exports','DATE','setDataValue','endtime','format'];(function(_0x5714f6,_0x43c386){var _0x5756ba=function(_0x2e728e){while(--_0x2e728e){_0x5714f6['push'](_0x5714f6['shift']());}};_0x5756ba(++_0x43c386);}(_0x95a9,0x10b));var _0x995a=function(_0xe5442a,_0x2bc5d6){_0xe5442a=_0xe5442a-0x0;var _0x25688b=_0x95a9[_0xe5442a];return _0x25688b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x995a('0x0')]={'starttime':{'type':Sequelize[_0x995a('0x1')],'set':function(_0x325187){this['setDataValue']('starttime',_0x325187);this[_0x995a('0x2')](_0x995a('0x3'),moment()[_0x995a('0x4')](_0x995a('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x995a('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x995a('0x6')]},'calleridname':{'type':Sequelize[_0x995a('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x995a('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x53a6=['moment','exports','setDataValue','starttime','endtime','format','STRING'];(function(_0x301d66,_0x168bc2){var _0x36e45f=function(_0x43799e){while(--_0x43799e){_0x301d66['push'](_0x301d66['shift']());}};_0x36e45f(++_0x168bc2);}(_0x53a6,0x18f));var _0x653a=function(_0x211685,_0x35ed14){_0x211685=_0x211685-0x0;var _0x48433a=_0x53a6[_0x211685];return _0x48433a;};'use strict';var moment=require(_0x653a('0x0'));var Sequelize=require('sequelize');module[_0x653a('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x7cc034){this[_0x653a('0x2')](_0x653a('0x3'),_0x7cc034);this['setDataValue'](_0x653a('0x4'),moment()[_0x653a('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x653a('0x6')]},'projectname':{'type':Sequelize[_0x653a('0x6')]},'queue':{'type':Sequelize[_0x653a('0x6')]},'uniqueid':{'type':Sequelize[_0x653a('0x6')]},'calleridname':{'type':Sequelize[_0x653a('0x6')]},'calleridnum':{'type':Sequelize[_0x653a('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index f1869db..92b4e01 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 _0x8eb1=['sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','JscriptySessionReport','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','getQuestions','findOne','keys','SessionId','JscriptyQuestionReport','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x5e326a,_0x429584){var _0x5b1c1f=function(_0x13a7ff){while(--_0x13a7ff){_0x5e326a['push'](_0x5e326a['shift']());}};_0x5b1c1f(++_0x429584);}(_0x8eb1,0x103));var _0x18eb=function(_0x5a2aab,_0x290b04){_0x5a2aab=_0x5a2aab-0x0;var _0x4a0b09=_0x8eb1[_0x5a2aab];return _0x4a0b09;};'use strict';var pdf=require(_0x18eb('0x0'));var emlformat=require(_0x18eb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x18eb('0x2'));var jsonpatch=require(_0x18eb('0x3'));var rp=require(_0x18eb('0x4'));var moment=require(_0x18eb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x18eb('0x6'));var util=require(_0x18eb('0x7'));var path=require(_0x18eb('0x8'));var sox=require('sox');var csv=require(_0x18eb('0x9'));var ejs=require(_0x18eb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x18eb('0xb'));var crypto=require(_0x18eb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x18eb('0x9'));var querystring=require('querystring');var Papa=require(_0x18eb('0xd'));var authService=require(_0x18eb('0xe'));var hardwareService=require(_0x18eb('0xf'));var Redis=require(_0x18eb('0x10'));var qs=require(_0x18eb('0x11'));var logger=require(_0x18eb('0x12'))(_0x18eb('0x13'));var utils=require(_0x18eb('0x14'));var config=require('../../config/environment');var db=require(_0x18eb('0x15'))['db'];function respondWithStatusCode(_0x3a0892,_0x367640){_0x367640=_0x367640||0xcc;return function(_0x2bc37d){if(_0x2bc37d){return _0x3a0892[_0x18eb('0x16')](_0x367640);}return _0x3a0892[_0x18eb('0x17')](_0x367640)[_0x18eb('0x18')]();};}function respondWithResult(_0xc13ad1,_0x42ab2d){_0x42ab2d=_0x42ab2d||0xc8;return function(_0x2a1d87){if(_0x2a1d87){return _0xc13ad1[_0x18eb('0x17')](_0x42ab2d)['json'](_0x2a1d87);}};}function respondWithFilteredResult(_0x568187,_0x3f2dca){return function(_0x1d918f){if(_0x1d918f){var _0x55bbef=_0x1d918f['count'],_0x155169=_0x3f2dca['offset'],_0x394786=_0x3f2dca[_0x18eb('0x19')]+_0x3f2dca[_0x18eb('0x1a')],_0x4ea234;if(_0x394786>=_0x55bbef){_0x394786=_0x55bbef;_0x4ea234=0xc8;}else{_0x4ea234=0xce;}_0x568187[_0x18eb('0x17')](_0x4ea234);return _0x568187[_0x18eb('0x1b')](_0x18eb('0x1c'),_0x155169+'-'+_0x394786+'/'+_0x55bbef)[_0x18eb('0x1d')](_0x1d918f);}return null;};}function patchUpdates(_0x53eaef){return function(_0x1373c0){try{jsonpatch[_0x18eb('0x1e')](_0x1373c0,_0x53eaef,!![]);}catch(_0x1ade6c){return BPromise[_0x18eb('0x1f')](_0x1ade6c);}return _0x1373c0[_0x18eb('0x20')]();};}function saveUpdates(_0x3eba82,_0x1fd877){return function(_0x45b15f){if(_0x45b15f){return _0x45b15f[_0x18eb('0x21')](_0x3eba82)[_0x18eb('0x22')](function(_0x38ff67){return _0x38ff67;});}return null;};}function removeEntity(_0x50d750,_0x60c712){return function(_0x2d0f86){if(_0x2d0f86){return _0x2d0f86[_0x18eb('0x23')]()['then'](function(){_0x50d750[_0x18eb('0x17')](0xcc)[_0x18eb('0x18')]();});}};}function handleEntityNotFound(_0x32a969,_0x11f116){return function(_0x2d2737){if(!_0x2d2737){_0x32a969[_0x18eb('0x16')](0x194);}return _0x2d2737;};}function handleError(_0x7afb72,_0x5e29d6){_0x5e29d6=_0x5e29d6||0x1f4;return function(_0xe893da){logger['error'](_0xe893da[_0x18eb('0x24')]);if(_0xe893da[_0x18eb('0x25')]){delete _0xe893da[_0x18eb('0x25')];}_0x7afb72[_0x18eb('0x17')](_0x5e29d6)[_0x18eb('0x26')](_0xe893da);};}exports['index']=function(_0x338d45,_0x260f84){var _0x2f2eee={},_0x3eb7c9={},_0x23eee6={'count':0x0,'rows':[]};var _0x2aeaa1=db['JscriptySessionReport'][_0x18eb('0x27')];_0x3eb7c9[_0x18eb('0x28')]=_['keys'](_0x2aeaa1);_0x3eb7c9[_0x18eb('0x29')]=_['keys'](_0x338d45[_0x18eb('0x29')]);_0x3eb7c9[_0x18eb('0x2a')]=_[_0x18eb('0x2b')](_0x3eb7c9[_0x18eb('0x28')],_0x3eb7c9[_0x18eb('0x29')]);_0x2f2eee[_0x18eb('0x2c')]=_[_0x18eb('0x2b')](_0x3eb7c9[_0x18eb('0x28')],qs['fields'](_0x338d45[_0x18eb('0x29')][_0x18eb('0x2d')]));_0x2f2eee['attributes']=_0x2f2eee[_0x18eb('0x2c')][_0x18eb('0x2e')]?_0x2f2eee[_0x18eb('0x2c')]:_0x3eb7c9[_0x18eb('0x28')];if(!_0x338d45[_0x18eb('0x29')]['hasOwnProperty'](_0x18eb('0x2f'))){_0x2f2eee[_0x18eb('0x1a')]=qs[_0x18eb('0x1a')](_0x338d45[_0x18eb('0x29')]['limit']);_0x2f2eee[_0x18eb('0x19')]=qs[_0x18eb('0x19')](_0x338d45[_0x18eb('0x29')][_0x18eb('0x19')]);}_0x2f2eee[_0x18eb('0x30')]=qs[_0x18eb('0x31')](_0x338d45[_0x18eb('0x29')][_0x18eb('0x31')]);_0x2f2eee[_0x18eb('0x32')]=qs['filters'](_[_0x18eb('0x33')](_0x338d45[_0x18eb('0x29')],_0x3eb7c9[_0x18eb('0x2a')]));if(_0x338d45[_0x18eb('0x29')][_0x18eb('0x34')]){_0x2f2eee[_0x18eb('0x32')]=_[_0x18eb('0x35')](_0x2f2eee[_0x18eb('0x32')],{'$or':_[_0x18eb('0x36')](_0x2aeaa1,function(_0x39480d){if(_0x39480d[_0x18eb('0x37')][_0x18eb('0x38')]!==_0x18eb('0x39')){var _0x164204={};_0x164204[_0x39480d['field']]={'$like':'%'+_0x338d45['query'][_0x18eb('0x34')]+'%'};return _0x164204;}})});}_0x2f2eee=_[_0x18eb('0x35')]({},_0x2f2eee,_0x338d45[_0x18eb('0x3a')]);var _0x6562df={'where':_0x2f2eee[_0x18eb('0x32')]};return db[_0x18eb('0x3b')][_0x18eb('0x3c')](_0x6562df)[_0x18eb('0x22')](function(_0xa4181f){_0x23eee6[_0x18eb('0x3c')]=_0xa4181f;if(_0x338d45[_0x18eb('0x29')][_0x18eb('0x3d')]){_0x2f2eee[_0x18eb('0x3e')]=[{'all':!![]}];}return db[_0x18eb('0x3b')][_0x18eb('0x3f')](_0x2f2eee);})[_0x18eb('0x22')](function(_0x5507cb){_0x23eee6[_0x18eb('0x40')]=_0x5507cb;return _0x23eee6;})[_0x18eb('0x22')](respondWithFilteredResult(_0x260f84,_0x2f2eee))[_0x18eb('0x41')](handleError(_0x260f84,null));};exports[_0x18eb('0x42')]=function(_0x39d8c0,_0x5225c3){var _0x3fe4c9={'raw':!![],'where':{'id':_0x39d8c0[_0x18eb('0x43')]['id']}},_0x5aefe3={};_0x5aefe3['model']=_['keys'](db[_0x18eb('0x3b')][_0x18eb('0x27')]);_0x5aefe3['query']=_['keys'](_0x39d8c0['query']);_0x5aefe3[_0x18eb('0x2a')]=_[_0x18eb('0x2b')](_0x5aefe3['model'],_0x5aefe3[_0x18eb('0x29')]);_0x3fe4c9[_0x18eb('0x2c')]=_['intersection'](_0x5aefe3['model'],qs[_0x18eb('0x2d')](_0x39d8c0[_0x18eb('0x29')]['fields']));_0x3fe4c9['attributes']=_0x3fe4c9[_0x18eb('0x2c')][_0x18eb('0x2e')]?_0x3fe4c9[_0x18eb('0x2c')]:_0x5aefe3[_0x18eb('0x28')];if(_0x39d8c0['query']['includeAll']){_0x3fe4c9[_0x18eb('0x3e')]=[{'all':!![]}];}_0x3fe4c9=_[_0x18eb('0x35')]({},_0x3fe4c9,_0x39d8c0[_0x18eb('0x3a')]);return db['JscriptySessionReport']['find'](_0x3fe4c9)[_0x18eb('0x22')](handleEntityNotFound(_0x5225c3,null))['then'](respondWithResult(_0x5225c3,null))[_0x18eb('0x41')](handleError(_0x5225c3,null));};exports[_0x18eb('0x44')]=function(_0x1e8fdf,_0x5459df){return db[_0x18eb('0x3b')][_0x18eb('0x44')](_0x1e8fdf[_0x18eb('0x45')],{})['then'](respondWithResult(_0x5459df,0xc9))[_0x18eb('0x41')](handleError(_0x5459df,null));};exports[_0x18eb('0x21')]=function(_0x9f09be,_0x434e5b){if(_0x9f09be['body']['id']){delete _0x9f09be[_0x18eb('0x45')]['id'];}return db['JscriptySessionReport'][_0x18eb('0x46')]({'where':{'id':_0x9f09be['params']['id']}})['then'](handleEntityNotFound(_0x434e5b,null))['then'](saveUpdates(_0x9f09be[_0x18eb('0x45')],null))[_0x18eb('0x22')](respondWithResult(_0x434e5b,null))[_0x18eb('0x41')](handleError(_0x434e5b,null));};exports[_0x18eb('0x23')]=function(_0xbe4e2a,_0x1688f3){return db[_0x18eb('0x3b')][_0x18eb('0x46')]({'where':{'id':_0xbe4e2a[_0x18eb('0x43')]['id']}})[_0x18eb('0x22')](handleEntityNotFound(_0x1688f3,null))[_0x18eb('0x22')](removeEntity(_0x1688f3,null))[_0x18eb('0x41')](handleError(_0x1688f3,null));};exports[_0x18eb('0x47')]=function(_0x92d9cf,_0x1acc93){return db['JscriptySessionReport'][_0x18eb('0x47')]()[_0x18eb('0x22')](respondWithResult(_0x1acc93,null))[_0x18eb('0x41')](handleError(_0x1acc93,null));};exports[_0x18eb('0x48')]=function(_0x2da002,_0x2456cb,_0x115a61){var _0x57c5bc={'raw':!![],'where':{}};var _0x2e10b6={};var _0x1220d2={'count':0x0,'rows':[]};return db[_0x18eb('0x3b')][_0x18eb('0x49')]({'where':{'id':_0x2da002['params']['id']}})['then'](handleEntityNotFound(_0x2456cb,null))[_0x18eb('0x22')](function(_0x2a091b){if(_0x2a091b){_0x2e10b6['model']=_[_0x18eb('0x4a')](db['JscriptyQuestionReport'][_0x18eb('0x27')]);_0x2e10b6[_0x18eb('0x29')]=_[_0x18eb('0x4a')](_0x2da002[_0x18eb('0x29')]);_0x2e10b6[_0x18eb('0x2a')]=_[_0x18eb('0x2b')](_0x2e10b6[_0x18eb('0x28')],_0x2e10b6[_0x18eb('0x29')]);_0x57c5bc[_0x18eb('0x2c')]=_[_0x18eb('0x2b')](_0x2e10b6[_0x18eb('0x28')],qs[_0x18eb('0x2d')](_0x2da002[_0x18eb('0x29')][_0x18eb('0x2d')]));_0x57c5bc[_0x18eb('0x2c')]=_0x57c5bc[_0x18eb('0x2c')][_0x18eb('0x2e')]?_0x57c5bc[_0x18eb('0x2c')]:_0x2e10b6['model'];if(!_0x2da002['query']['hasOwnProperty'](_0x18eb('0x2f'))){_0x57c5bc[_0x18eb('0x1a')]=qs[_0x18eb('0x1a')](_0x2da002[_0x18eb('0x29')][_0x18eb('0x1a')]);_0x57c5bc[_0x18eb('0x19')]=qs[_0x18eb('0x19')](_0x2da002[_0x18eb('0x29')][_0x18eb('0x19')]);}_0x57c5bc[_0x18eb('0x30')]=qs[_0x18eb('0x31')](_0x2da002['query'][_0x18eb('0x31')]);_0x57c5bc['where']=qs[_0x18eb('0x2a')](_[_0x18eb('0x33')](_0x2da002[_0x18eb('0x29')],_0x2e10b6['filters']));_0x57c5bc[_0x18eb('0x32')][_0x18eb('0x4b')]=_0x2a091b['id'];if(_0x2da002[_0x18eb('0x29')][_0x18eb('0x34')]){_0x57c5bc[_0x18eb('0x32')]=_['merge'](_0x57c5bc[_0x18eb('0x32')],{'$or':_[_0x18eb('0x36')](_0x57c5bc[_0x18eb('0x2c')],function(_0x245fa0){var _0x5a0dfd={};_0x5a0dfd[_0x245fa0]={'$like':'%'+_0x2da002[_0x18eb('0x29')][_0x18eb('0x34')]+'%'};return _0x5a0dfd;})});}_0x57c5bc=_['merge']({},_0x57c5bc,_0x2da002[_0x18eb('0x3a')]);return db[_0x18eb('0x4c')][_0x18eb('0x3c')]({'where':_0x57c5bc[_0x18eb('0x32')]})[_0x18eb('0x22')](function(_0x1ee080){_0x1220d2[_0x18eb('0x3c')]=_0x1ee080;if(_0x2da002['query'][_0x18eb('0x3d')]){_0x57c5bc['include']=[{'all':!![]}];}return db[_0x18eb('0x4c')][_0x18eb('0x3f')](_0x57c5bc);})[_0x18eb('0x22')](function(_0x85f346){_0x1220d2[_0x18eb('0x40')]=_0x85f346;return _0x1220d2;});}})['then'](respondWithFilteredResult(_0x2456cb,_0x57c5bc))[_0x18eb('0x41')](handleError(_0x2456cb,null));}; \ No newline at end of file +var _0xb642=['api','../../config/utils','sendStatus','status','end','count','offset','set','Content-Range','json','save','update','then','error','stack','name','send','index','JscriptySessionReport','rawAttributes','keys','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','length','SessionId','map','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x106487,_0x23de58){var _0xc1da08=function(_0x2b06db){while(--_0x2b06db){_0x106487['push'](_0x106487['shift']());}};_0xc1da08(++_0x23de58);}(_0xb642,0x15d));var _0x2b64=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xb642[_0x46aff0];return _0x9d78cf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2b64('0x0'));var rimraf=require(_0x2b64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b64('0x2'));var rp=require(_0x2b64('0x3'));var moment=require(_0x2b64('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2b64('0x5'));var path=require('path');var sox=require(_0x2b64('0x6'));var csv=require(_0x2b64('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2b64('0x8'));var squel=require(_0x2b64('0x9'));var crypto=require(_0x2b64('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2b64('0xb'));var toCsv=require(_0x2b64('0x7'));var querystring=require(_0x2b64('0xc'));var Papa=require('papaparse');var authService=require(_0x2b64('0xd'));var hardwareService=require(_0x2b64('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x2b64('0xf'))(_0x2b64('0x10'));var utils=require(_0x2b64('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38c051,_0xb5fa85){_0xb5fa85=_0xb5fa85||0xcc;return function(_0x1c8a6d){if(_0x1c8a6d){return _0x38c051[_0x2b64('0x12')](_0xb5fa85);}return _0x38c051[_0x2b64('0x13')](_0xb5fa85)[_0x2b64('0x14')]();};}function respondWithResult(_0x23a9c3,_0x33c3ac){_0x33c3ac=_0x33c3ac||0xc8;return function(_0x4a6d40){if(_0x4a6d40){return _0x23a9c3[_0x2b64('0x13')](_0x33c3ac)['json'](_0x4a6d40);}};}function respondWithFilteredResult(_0x38983f,_0x50c346){return function(_0x6897a9){if(_0x6897a9){var _0x762c03=_0x6897a9[_0x2b64('0x15')],_0x272ad6=_0x50c346[_0x2b64('0x16')],_0x3e1675=_0x50c346['offset']+_0x50c346['limit'],_0x300c93;if(_0x3e1675>=_0x762c03){_0x3e1675=_0x762c03;_0x300c93=0xc8;}else{_0x300c93=0xce;}_0x38983f['status'](_0x300c93);return _0x38983f[_0x2b64('0x17')](_0x2b64('0x18'),_0x272ad6+'-'+_0x3e1675+'/'+_0x762c03)[_0x2b64('0x19')](_0x6897a9);}return null;};}function patchUpdates(_0xbc85be){return function(_0x36c7db){try{jsonpatch['apply'](_0x36c7db,_0xbc85be,!![]);}catch(_0x3c6c62){return BPromise['reject'](_0x3c6c62);}return _0x36c7db[_0x2b64('0x1a')]();};}function saveUpdates(_0x29e2db,_0x4718e8){return function(_0x35e8d2){if(_0x35e8d2){return _0x35e8d2[_0x2b64('0x1b')](_0x29e2db)['then'](function(_0x322c96){return _0x322c96;});}return null;};}function removeEntity(_0x2f35d8,_0x48aaa8){return function(_0x37ccfa){if(_0x37ccfa){return _0x37ccfa['destroy']()[_0x2b64('0x1c')](function(){_0x2f35d8[_0x2b64('0x13')](0xcc)[_0x2b64('0x14')]();});}};}function handleEntityNotFound(_0xb664ce,_0x4210e2){return function(_0x39c08b){if(!_0x39c08b){_0xb664ce['sendStatus'](0x194);}return _0x39c08b;};}function handleError(_0x36b2f8,_0x346373){_0x346373=_0x346373||0x1f4;return function(_0x2ef361){logger[_0x2b64('0x1d')](_0x2ef361[_0x2b64('0x1e')]);if(_0x2ef361['name']){delete _0x2ef361[_0x2b64('0x1f')];}_0x36b2f8[_0x2b64('0x13')](_0x346373)[_0x2b64('0x20')](_0x2ef361);};}exports[_0x2b64('0x21')]=function(_0x2b5c19,_0x3b2ded){var _0x122f2c={},_0x2d74c3={},_0x42c2de={'count':0x0,'rows':[]};var _0xdb7eaa=db[_0x2b64('0x22')][_0x2b64('0x23')];_0x2d74c3['model']=_[_0x2b64('0x24')](_0xdb7eaa);_0x2d74c3[_0x2b64('0x25')]=_[_0x2b64('0x24')](_0x2b5c19[_0x2b64('0x25')]);_0x2d74c3['filters']=_[_0x2b64('0x26')](_0x2d74c3['model'],_0x2d74c3[_0x2b64('0x25')]);_0x122f2c[_0x2b64('0x27')]=_[_0x2b64('0x26')](_0x2d74c3[_0x2b64('0x28')],qs[_0x2b64('0x29')](_0x2b5c19['query'][_0x2b64('0x29')]));_0x122f2c[_0x2b64('0x27')]=_0x122f2c[_0x2b64('0x27')]['length']?_0x122f2c['attributes']:_0x2d74c3[_0x2b64('0x28')];if(!_0x2b5c19[_0x2b64('0x25')][_0x2b64('0x2a')](_0x2b64('0x2b'))){_0x122f2c[_0x2b64('0x2c')]=qs['limit'](_0x2b5c19['query'][_0x2b64('0x2c')]);_0x122f2c[_0x2b64('0x16')]=qs[_0x2b64('0x16')](_0x2b5c19[_0x2b64('0x25')][_0x2b64('0x16')]);}_0x122f2c[_0x2b64('0x2d')]=qs[_0x2b64('0x2e')](_0x2b5c19[_0x2b64('0x25')][_0x2b64('0x2e')]);_0x122f2c[_0x2b64('0x2f')]=qs[_0x2b64('0x30')](_['pick'](_0x2b5c19[_0x2b64('0x25')],_0x2d74c3[_0x2b64('0x30')]));if(_0x2b5c19[_0x2b64('0x25')]['filter']){_0x122f2c['where']=_[_0x2b64('0x31')](_0x122f2c[_0x2b64('0x2f')],{'$or':_['map'](_0xdb7eaa,function(_0x2ce6d6){if(_0x2ce6d6[_0x2b64('0x32')][_0x2b64('0x33')]!==_0x2b64('0x34')){var _0x23582d={};_0x23582d[_0x2ce6d6[_0x2b64('0x35')]]={'$like':'%'+_0x2b5c19['query'][_0x2b64('0x36')]+'%'};return _0x23582d;}})});}_0x122f2c=_[_0x2b64('0x31')]({},_0x122f2c,_0x2b5c19[_0x2b64('0x37')]);var _0x4a3f0f={'where':_0x122f2c[_0x2b64('0x2f')]};return db['JscriptySessionReport'][_0x2b64('0x15')](_0x4a3f0f)[_0x2b64('0x1c')](function(_0x129948){_0x42c2de[_0x2b64('0x15')]=_0x129948;if(_0x2b5c19[_0x2b64('0x25')][_0x2b64('0x38')]){_0x122f2c[_0x2b64('0x39')]=[{'all':!![]}];}return db[_0x2b64('0x22')][_0x2b64('0x3a')](_0x122f2c);})['then'](function(_0x17603e){_0x42c2de[_0x2b64('0x3b')]=_0x17603e;return _0x42c2de;})['then'](respondWithFilteredResult(_0x3b2ded,_0x122f2c))['catch'](handleError(_0x3b2ded,null));};exports['show']=function(_0x5aa7fb,_0x26b793){var _0x313bdd={'raw':!![],'where':{'id':_0x5aa7fb[_0x2b64('0x3c')]['id']}},_0xe629ad={};_0xe629ad[_0x2b64('0x28')]=_['keys'](db['JscriptySessionReport'][_0x2b64('0x23')]);_0xe629ad[_0x2b64('0x25')]=_[_0x2b64('0x24')](_0x5aa7fb[_0x2b64('0x25')]);_0xe629ad['filters']=_[_0x2b64('0x26')](_0xe629ad[_0x2b64('0x28')],_0xe629ad[_0x2b64('0x25')]);_0x313bdd[_0x2b64('0x27')]=_[_0x2b64('0x26')](_0xe629ad['model'],qs[_0x2b64('0x29')](_0x5aa7fb[_0x2b64('0x25')][_0x2b64('0x29')]));_0x313bdd[_0x2b64('0x27')]=_0x313bdd[_0x2b64('0x27')]['length']?_0x313bdd[_0x2b64('0x27')]:_0xe629ad[_0x2b64('0x28')];if(_0x5aa7fb[_0x2b64('0x25')][_0x2b64('0x38')]){_0x313bdd[_0x2b64('0x39')]=[{'all':!![]}];}_0x313bdd=_[_0x2b64('0x31')]({},_0x313bdd,_0x5aa7fb['options']);return db[_0x2b64('0x22')][_0x2b64('0x3d')](_0x313bdd)[_0x2b64('0x1c')](handleEntityNotFound(_0x26b793,null))[_0x2b64('0x1c')](respondWithResult(_0x26b793,null))[_0x2b64('0x3e')](handleError(_0x26b793,null));};exports[_0x2b64('0x3f')]=function(_0x469a25,_0x432fb2){return db[_0x2b64('0x22')][_0x2b64('0x3f')](_0x469a25[_0x2b64('0x40')],{})[_0x2b64('0x1c')](respondWithResult(_0x432fb2,0xc9))[_0x2b64('0x3e')](handleError(_0x432fb2,null));};exports['update']=function(_0x387cb9,_0x4bf2b6){if(_0x387cb9[_0x2b64('0x40')]['id']){delete _0x387cb9[_0x2b64('0x40')]['id'];}return db['JscriptySessionReport'][_0x2b64('0x3d')]({'where':{'id':_0x387cb9[_0x2b64('0x3c')]['id']}})[_0x2b64('0x1c')](handleEntityNotFound(_0x4bf2b6,null))[_0x2b64('0x1c')](saveUpdates(_0x387cb9[_0x2b64('0x40')],null))['then'](respondWithResult(_0x4bf2b6,null))[_0x2b64('0x3e')](handleError(_0x4bf2b6,null));};exports[_0x2b64('0x41')]=function(_0x49fda3,_0x45960b){return db['JscriptySessionReport']['find']({'where':{'id':_0x49fda3[_0x2b64('0x3c')]['id']}})['then'](handleEntityNotFound(_0x45960b,null))[_0x2b64('0x1c')](removeEntity(_0x45960b,null))[_0x2b64('0x3e')](handleError(_0x45960b,null));};exports['describe']=function(_0x5a35f5,_0x4a5c08){return db[_0x2b64('0x22')][_0x2b64('0x42')]()[_0x2b64('0x1c')](respondWithResult(_0x4a5c08,null))['catch'](handleError(_0x4a5c08,null));};exports[_0x2b64('0x43')]=function(_0x3b646a,_0x6eb617,_0x585ff6){var _0x2732f1={'raw':!![],'where':{}};var _0x5324d5={};var _0xcdfcd2={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x2b64('0x44')]({'where':{'id':_0x3b646a['params']['id']}})[_0x2b64('0x1c')](handleEntityNotFound(_0x6eb617,null))['then'](function(_0x410bae){if(_0x410bae){_0x5324d5[_0x2b64('0x28')]=_[_0x2b64('0x24')](db[_0x2b64('0x45')][_0x2b64('0x23')]);_0x5324d5[_0x2b64('0x25')]=_[_0x2b64('0x24')](_0x3b646a[_0x2b64('0x25')]);_0x5324d5[_0x2b64('0x30')]=_[_0x2b64('0x26')](_0x5324d5['model'],_0x5324d5[_0x2b64('0x25')]);_0x2732f1[_0x2b64('0x27')]=_['intersection'](_0x5324d5[_0x2b64('0x28')],qs['fields'](_0x3b646a[_0x2b64('0x25')][_0x2b64('0x29')]));_0x2732f1[_0x2b64('0x27')]=_0x2732f1[_0x2b64('0x27')][_0x2b64('0x46')]?_0x2732f1[_0x2b64('0x27')]:_0x5324d5[_0x2b64('0x28')];if(!_0x3b646a['query']['hasOwnProperty'](_0x2b64('0x2b'))){_0x2732f1[_0x2b64('0x2c')]=qs['limit'](_0x3b646a[_0x2b64('0x25')][_0x2b64('0x2c')]);_0x2732f1[_0x2b64('0x16')]=qs[_0x2b64('0x16')](_0x3b646a[_0x2b64('0x25')]['offset']);}_0x2732f1['order']=qs[_0x2b64('0x2e')](_0x3b646a['query']['sort']);_0x2732f1[_0x2b64('0x2f')]=qs[_0x2b64('0x30')](_['pick'](_0x3b646a['query'],_0x5324d5[_0x2b64('0x30')]));_0x2732f1[_0x2b64('0x2f')][_0x2b64('0x47')]=_0x410bae['id'];if(_0x3b646a[_0x2b64('0x25')][_0x2b64('0x36')]){_0x2732f1[_0x2b64('0x2f')]=_[_0x2b64('0x31')](_0x2732f1[_0x2b64('0x2f')],{'$or':_[_0x2b64('0x48')](_0x2732f1[_0x2b64('0x27')],function(_0x11a463){var _0x18ad36={};_0x18ad36[_0x11a463]={'$like':'%'+_0x3b646a[_0x2b64('0x25')][_0x2b64('0x36')]+'%'};return _0x18ad36;})});}_0x2732f1=_[_0x2b64('0x31')]({},_0x2732f1,_0x3b646a['options']);return db[_0x2b64('0x45')][_0x2b64('0x15')]({'where':_0x2732f1['where']})['then'](function(_0x176c19){_0xcdfcd2['count']=_0x176c19;if(_0x3b646a[_0x2b64('0x25')]['includeAll']){_0x2732f1[_0x2b64('0x39')]=[{'all':!![]}];}return db[_0x2b64('0x45')][_0x2b64('0x3a')](_0x2732f1);})['then'](function(_0x254b66){_0xcdfcd2[_0x2b64('0x3b')]=_0x254b66;return _0xcdfcd2;});}})[_0x2b64('0x1c')](respondWithFilteredResult(_0x6eb617,_0x2732f1))[_0x2b64('0x3e')](handleError(_0x6eb617,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index e96bffb..e609b40 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 _0x6dcd=['request-promise','exports','define','util','bluebird'];(function(_0x3ab687,_0x2f3a18){var _0x512596=function(_0x981ef2){while(--_0x981ef2){_0x3ab687['push'](_0x3ab687['shift']());}};_0x512596(++_0x2f3a18);}(_0x6dcd,0x13e));var _0xd6dc=function(_0x87778b,_0x508f14){_0x87778b=_0x87778b-0x0;var _0x2eb1c3=_0x6dcd[_0x87778b];return _0x2eb1c3;};'use strict';var _=require('lodash');var util=require(_0xd6dc('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd6dc('0x1'));var rp=require(_0xd6dc('0x2'));var attributes=require('./jscriptySessionReport.attributes');module[_0xd6dc('0x3')]=function(_0x1c5bdc,_0x2da93e){return _0x1c5bdc[_0xd6dc('0x4')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df2=['../../config/logger','api','moment','bluebird','request-promise','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash'];(function(_0x45a3a6,_0x5707b){var _0x5ebed4=function(_0x117bb3){while(--_0x117bb3){_0x45a3a6['push'](_0x45a3a6['shift']());}};_0x5ebed4(++_0x5707b);}(_0x6df2,0x103));var _0x26df=function(_0x36d2ed,_0x1ba35d){_0x36d2ed=_0x36d2ed-0x0;var _0x5ebd37=_0x6df2[_0x36d2ed];return _0x5ebd37;};'use strict';var _=require(_0x26df('0x0'));var util=require('util');var logger=require(_0x26df('0x1'))(_0x26df('0x2'));var moment=require(_0x26df('0x3'));var BPromise=require(_0x26df('0x4'));var rp=require(_0x26df('0x5'));var attributes=require(_0x26df('0x6'));module[_0x26df('0x7')]=function(_0x1d571f,_0x4937a9){return _0x1d571f[_0x26df('0x8')](_0x26df('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index e38dcfe..95bc4a7 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 _0x9300=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','lodash','bluebird','randomstring'];(function(_0x190a13,_0x5315a3){var _0x3f9b79=function(_0x25dc6f){while(--_0x25dc6f){_0x190a13['push'](_0x190a13['shift']());}};_0x3f9b79(++_0x5315a3);}(_0x9300,0x153));var _0x0930=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0x9300[_0x4c184d];return _0x23d997;};'use strict';var _=require(_0x0930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0930('0x1'));var rs=require(_0x0930('0x2'));var fs=require('fs');var Redis=require(_0x0930('0x3'));var db=require(_0x0930('0x4'))['db'];var utils=require(_0x0930('0x5'));var logger=require('../../config/logger')(_0x0930('0x6'));var config=require(_0x0930('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0930('0x8')][_0x0930('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45705a,_0x34c693,_0x2c0f94){return new BPromise(function(_0x1ec24f,_0x5bc3df){return client['request'](_0x45705a,_0x2c0f94)[_0x0930('0xa')](function(_0x4b1994){logger[_0x0930('0xb')](_0x0930('0xc'),_0x34c693,'request\x20sent');logger[_0x0930('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x34c693,'request\x20sent',JSON[_0x0930('0xe')](_0x4b1994));if(_0x4b1994[_0x0930('0xf')]){if(_0x4b1994['error']['code']===0x1f4){logger[_0x0930('0xf')](_0x0930('0xc'),_0x34c693,_0x4b1994[_0x0930('0xf')][_0x0930('0x10')]);return _0x5bc3df(_0x4b1994[_0x0930('0xf')][_0x0930('0x10')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x34c693,_0x4b1994['error'][_0x0930('0x10')]);return _0x1ec24f(_0x4b1994['error'][_0x0930('0x10')]);}else{logger[_0x0930('0xb')](_0x0930('0xc'),_0x34c693,_0x0930('0x11'));_0x1ec24f(_0x4b1994[_0x0930('0x12')][_0x0930('0x10')]);}})['catch'](function(_0x3ec27b){logger[_0x0930('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x34c693,_0x3ec27b);_0x5bc3df(_0x3ec27b);});});} \ No newline at end of file +var _0x7f59=['request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x16829a,_0x5e998a){var _0x2cdaab=function(_0x1df15b){while(--_0x1df15b){_0x16829a['push'](_0x16829a['shift']());}};_0x2cdaab(++_0x5e998a);}(_0x7f59,0x12e));var _0x97f5=function(_0x2a8f42,_0x480b4b){_0x2a8f42=_0x2a8f42-0x0;var _0x44f5d3=_0x7f59[_0x2a8f42];return _0x44f5d3;};'use strict';var _=require(_0x97f5('0x0'));var util=require(_0x97f5('0x1'));var moment=require('moment');var BPromise=require(_0x97f5('0x2'));var rs=require(_0x97f5('0x3'));var fs=require('fs');var Redis=require(_0x97f5('0x4'));var db=require(_0x97f5('0x5'))['db'];var utils=require(_0x97f5('0x6'));var logger=require(_0x97f5('0x7'))(_0x97f5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad891,_0x1d0a13,_0x3d25ec){return new BPromise(function(_0x317b2d,_0x3637fd){return client[_0x97f5('0x9')](_0x2ad891,_0x3d25ec)['then'](function(_0x492ff0){logger['info'](_0x97f5('0xa'),_0x1d0a13,'request\x20sent');logger[_0x97f5('0xb')](_0x97f5('0xc'),_0x1d0a13,'request\x20sent',JSON[_0x97f5('0xd')](_0x492ff0));if(_0x492ff0[_0x97f5('0xe')]){if(_0x492ff0[_0x97f5('0xe')][_0x97f5('0xf')]===0x1f4){logger['error'](_0x97f5('0xa'),_0x1d0a13,_0x492ff0['error']['message']);return _0x3637fd(_0x492ff0['error'][_0x97f5('0x10')]);}logger['error'](_0x97f5('0xa'),_0x1d0a13,_0x492ff0['error'][_0x97f5('0x10')]);return _0x317b2d(_0x492ff0[_0x97f5('0xe')][_0x97f5('0x10')]);}else{logger[_0x97f5('0x11')](_0x97f5('0xa'),_0x1d0a13,_0x97f5('0x12'));_0x317b2d(_0x492ff0[_0x97f5('0x13')][_0x97f5('0x10')]);}})['catch'](function(_0x4c1392){logger[_0x97f5('0xe')](_0x97f5('0xa'),_0x1d0a13,_0x4c1392);_0x3637fd(_0x4c1392);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 0186007..5429c84 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 _0x03d4=['isAuthenticated','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','get'];(function(_0xcf2356,_0x5f21d1){var _0x5a3ef6=function(_0x13f8e9){while(--_0x13f8e9){_0xcf2356['push'](_0xcf2356['shift']());}};_0x5a3ef6(++_0x5f21d1);}(_0x03d4,0xdf));var _0x403d=function(_0x1bb994,_0x1325e1){_0x1bb994=_0x1bb994-0x0;var _0x3fdca6=_0x03d4[_0x1bb994];return _0x3fdca6;};'use strict';var multer=require(_0x403d('0x0'));var util=require(_0x403d('0x1'));var path=require(_0x403d('0x2'));var timeout=require(_0x403d('0x3'));var express=require('express');var router=express[_0x403d('0x4')]();var auth=require(_0x403d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x403d('0x6')]('/',controller['index']);router['put']('/:id',auth[_0x403d('0x7')](),controller[_0x403d('0x8')]);module[_0x403d('0x9')]=router; \ No newline at end of file +var _0x34e6=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','exports','multer','util','path','connect-timeout'];(function(_0x1b8772,_0x342893){var _0xdda3f3=function(_0x184d3e){while(--_0x184d3e){_0x1b8772['push'](_0x1b8772['shift']());}};_0xdda3f3(++_0x342893);}(_0x34e6,0x15c));var _0x634e=function(_0x3a92e2,_0x3db8b0){_0x3a92e2=_0x3a92e2-0x0;var _0x3ade0b=_0x34e6[_0x3a92e2];return _0x3ade0b;};'use strict';var multer=require(_0x634e('0x0'));var util=require(_0x634e('0x1'));var path=require(_0x634e('0x2'));var timeout=require(_0x634e('0x3'));var express=require(_0x634e('0x4'));var router=express[_0x634e('0x5')]();var auth=require(_0x634e('0x6'));var interaction=require(_0x634e('0x7'));var config=require(_0x634e('0x8'));var controller=require(_0x634e('0x9'));router[_0x634e('0xa')]('/',controller[_0x634e('0xb')]);router[_0x634e('0xc')](_0x634e('0xd'),auth[_0x634e('0xe')](),controller['update']);module[_0x634e('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index d66060c..cabcd3d 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 _0xe412=['sequelize','STRING','INTEGER'];(function(_0x2b5853,_0x2607d6){var _0x404b31=function(_0x149f5e){while(--_0x149f5e){_0x2b5853['push'](_0x2b5853['shift']());}};_0x404b31(++_0x2607d6);}(_0xe412,0x1e6));var _0x2e41=function(_0x2ebba1,_0x4f1832){_0x2ebba1=_0x2ebba1-0x0;var _0x2a046d=_0xe412[_0x2ebba1];return _0x2a046d;};'use strict';var Sequelize=require(_0x2e41('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x2e41('0x1')]},'data2':{'type':Sequelize[_0x2e41('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x2e41('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe3e4=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x1c7f68,_0x414a93){var _0x101d1e=function(_0xefa6ba){while(--_0xefa6ba){_0x1c7f68['push'](_0x1c7f68['shift']());}};_0x101d1e(++_0x414a93);}(_0xe3e4,0xc6));var _0x4e3e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe3e4[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4e3e('0x0'));module[_0x4e3e('0x1')]={'license':{'type':Sequelize[_0x4e3e('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x4e3e('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x4e3e('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index bf7db13..71d67f2 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 _0x4b78=['filters','intersection','attributes','fields','length','merge','options','catch','update','body','find','params','get','checkLicense','key','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','model','keys','License','rawAttributes','query'];(function(_0x57cf42,_0x5daea0){var _0x477180=function(_0x65cbea){while(--_0x65cbea){_0x57cf42['push'](_0x57cf42['shift']());}};_0x477180(++_0x5daea0);}(_0x4b78,0x11d));var _0x84b7=function(_0x4748df,_0x246c02){_0x4748df=_0x4748df-0x0;var _0x499ef7=_0x4b78[_0x4748df];return _0x499ef7;};'use strict';var pdf=require(_0x84b7('0x0'));var emlformat=require(_0x84b7('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x84b7('0x2'));var moment=require(_0x84b7('0x3'));var BPromise=require(_0x84b7('0x4'));var Mustache=require(_0x84b7('0x5'));var util=require(_0x84b7('0x6'));var path=require('path');var sox=require(_0x84b7('0x7'));var csv=require(_0x84b7('0x8'));var ejs=require(_0x84b7('0x9'));var fs=require('fs');var _=require(_0x84b7('0xa'));var squel=require('squel');var crypto=require(_0x84b7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x84b7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x84b7('0xd'));var qs=require(_0x84b7('0xe'));var logger=require(_0x84b7('0xf'))('api');var utils=require(_0x84b7('0x10'));var config=require(_0x84b7('0x11'));var db=require(_0x84b7('0x12'))['db'];function respondWithStatusCode(_0xe2c8c2,_0x545875){_0x545875=_0x545875||0xcc;return function(_0xf10793){if(_0xf10793){return _0xe2c8c2[_0x84b7('0x13')](_0x545875);}return _0xe2c8c2[_0x84b7('0x14')](_0x545875)[_0x84b7('0x15')]();};}function respondWithResult(_0x457ed2,_0x4901fc){_0x4901fc=_0x4901fc||0xc8;return function(_0x4f6818){if(_0x4f6818){return _0x457ed2['status'](_0x4901fc)[_0x84b7('0x16')](_0x4f6818);}};}function respondWithFilteredResult(_0x60824c,_0x16b8b8){return function(_0x4fe0a3){if(_0x4fe0a3){var _0x30c096=_0x4fe0a3[_0x84b7('0x17')],_0x3a65e7=_0x16b8b8['offset'],_0x165155=_0x16b8b8['offset']+_0x16b8b8['limit'],_0x81c29;if(_0x165155>=_0x30c096){_0x165155=_0x30c096;_0x81c29=0xc8;}else{_0x81c29=0xce;}_0x60824c[_0x84b7('0x14')](_0x81c29);return _0x60824c[_0x84b7('0x18')](_0x84b7('0x19'),_0x3a65e7+'-'+_0x165155+'/'+_0x30c096)['json'](_0x4fe0a3);}return null;};}function patchUpdates(_0x509884){return function(_0x4ed5e6){try{jsonpatch[_0x84b7('0x1a')](_0x4ed5e6,_0x509884,!![]);}catch(_0xe41531){return BPromise[_0x84b7('0x1b')](_0xe41531);}return _0x4ed5e6[_0x84b7('0x1c')]();};}function saveUpdates(_0x4f9c34,_0x2c8fbf){return function(_0x4e8c21){if(_0x4e8c21){return _0x4e8c21['update'](_0x4f9c34)[_0x84b7('0x1d')](function(_0x50dfa3){return _0x50dfa3;});}return null;};}function removeEntity(_0x59cc08,_0x183f9b){return function(_0x115c50){if(_0x115c50){return _0x115c50[_0x84b7('0x1e')]()[_0x84b7('0x1d')](function(){_0x59cc08['status'](0xcc)[_0x84b7('0x15')]();});}};}function handleEntityNotFound(_0x2dd65e,_0x306939){return function(_0xa2cc76){if(!_0xa2cc76){_0x2dd65e[_0x84b7('0x13')](0x194);}return _0xa2cc76;};}function handleError(_0x3d25b0,_0x4df551){_0x4df551=_0x4df551||0x1f4;return function(_0x138847){logger[_0x84b7('0x1f')](_0x138847[_0x84b7('0x20')]);if(_0x138847[_0x84b7('0x21')]){delete _0x138847[_0x84b7('0x21')];}_0x3d25b0[_0x84b7('0x14')](_0x4df551)['send'](_0x138847);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x1207b7,_0x149a8f){var _0xa1f329={'raw':!![],'where':{'id':0x1}},_0x1822d2={};_0x1822d2[_0x84b7('0x22')]=_[_0x84b7('0x23')](db[_0x84b7('0x24')][_0x84b7('0x25')]);_0x1822d2[_0x84b7('0x26')]=_[_0x84b7('0x23')](_0x1207b7['query']);_0x1822d2[_0x84b7('0x27')]=_[_0x84b7('0x28')](_0x1822d2['model'],_0x1822d2['query']);_0xa1f329[_0x84b7('0x29')]=_[_0x84b7('0x28')](_0x1822d2[_0x84b7('0x22')],qs[_0x84b7('0x2a')](_0x1207b7[_0x84b7('0x26')][_0x84b7('0x2a')]));_0xa1f329[_0x84b7('0x29')]=_0xa1f329[_0x84b7('0x29')][_0x84b7('0x2b')]?_0xa1f329[_0x84b7('0x29')]:_0x1822d2[_0x84b7('0x22')];_0xa1f329=_[_0x84b7('0x2c')]({},_0xa1f329,_0x1207b7[_0x84b7('0x2d')]);return utilLicense['getLicense'](_0xa1f329)['then'](respondWithResult(_0x149a8f,null))[_0x84b7('0x2e')](handleError(_0x149a8f,null));};exports[_0x84b7('0x2f')]=function(_0x3c4584,_0xe39f9d){if(_0x3c4584['body']['id']){delete _0x3c4584[_0x84b7('0x30')]['id'];}return db[_0x84b7('0x24')][_0x84b7('0x31')]({'where':{'id':_0x3c4584[_0x84b7('0x32')]['id']}})[_0x84b7('0x1d')](handleEntityNotFound(_0xe39f9d,null))[_0x84b7('0x1d')](function(_0x4dc86f){var _0x642346=_0x4dc86f[_0x84b7('0x33')]({'plain':!![]});return utilLicense[_0x84b7('0x34')](_0x642346,_0x3c4584[_0x84b7('0x30')][_0x84b7('0x35')]);})[_0x84b7('0x1d')](function(_0x1b4df1){if(!_0x1b4df1['demo']){return saveUpdates(_0x3c4584[_0x84b7('0x30')],null);}return _0x1b4df1;})[_0x84b7('0x1d')](respondWithResult(_0xe39f9d,null))[_0x84b7('0x2e')](handleError(_0xe39f9d,null));}; \ No newline at end of file +var _0xddf5=['api','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','../../config/license/util','index','model','keys','rawAttributes','query','attributes','intersection','fields','merge','options','getLicense','catch','body','License','get','checkLicense','key','demo','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs'];(function(_0x38bc1f,_0x2cd276){var _0x3b6954=function(_0x125aef){while(--_0x125aef){_0x38bc1f['push'](_0x38bc1f['shift']());}};_0x3b6954(++_0x2cd276);}(_0xddf5,0x1b5));var _0x5ddf=function(_0x4487d4,_0x298b00){_0x4487d4=_0x4487d4-0x0;var _0x5f24c1=_0xddf5[_0x4487d4];return _0x5f24c1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5ddf('0x0'));var zipdir=require(_0x5ddf('0x1'));var jsonpatch=require(_0x5ddf('0x2'));var rp=require(_0x5ddf('0x3'));var moment=require(_0x5ddf('0x4'));var BPromise=require(_0x5ddf('0x5'));var Mustache=require(_0x5ddf('0x6'));var util=require('util');var path=require(_0x5ddf('0x7'));var sox=require(_0x5ddf('0x8'));var csv=require(_0x5ddf('0x9'));var ejs=require(_0x5ddf('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5ddf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5ddf('0xc'));var toCsv=require(_0x5ddf('0x9'));var querystring=require(_0x5ddf('0xd'));var Papa=require(_0x5ddf('0xe'));var authService=require(_0x5ddf('0xf'));var hardwareService=require(_0x5ddf('0x10'));var Redis=require(_0x5ddf('0x11'));var qs=require(_0x5ddf('0x12'));var logger=require('../../config/logger')(_0x5ddf('0x13'));var utils=require('../../config/utils');var config=require(_0x5ddf('0x14'));var db=require(_0x5ddf('0x15'))['db'];function respondWithStatusCode(_0x28c3c0,_0x281263){_0x281263=_0x281263||0xcc;return function(_0x45d357){if(_0x45d357){return _0x28c3c0['sendStatus'](_0x281263);}return _0x28c3c0['status'](_0x281263)[_0x5ddf('0x16')]();};}function respondWithResult(_0x2a8fdf,_0x59ec8e){_0x59ec8e=_0x59ec8e||0xc8;return function(_0x174d8b){if(_0x174d8b){return _0x2a8fdf[_0x5ddf('0x17')](_0x59ec8e)[_0x5ddf('0x18')](_0x174d8b);}};}function respondWithFilteredResult(_0x2e5ccf,_0x194771){return function(_0x1e955e){if(_0x1e955e){var _0x16814c=_0x1e955e['count'],_0x41e7e2=_0x194771[_0x5ddf('0x19')],_0x498c50=_0x194771[_0x5ddf('0x19')]+_0x194771[_0x5ddf('0x1a')],_0x5d73c7;if(_0x498c50>=_0x16814c){_0x498c50=_0x16814c;_0x5d73c7=0xc8;}else{_0x5d73c7=0xce;}_0x2e5ccf[_0x5ddf('0x17')](_0x5d73c7);return _0x2e5ccf[_0x5ddf('0x1b')](_0x5ddf('0x1c'),_0x41e7e2+'-'+_0x498c50+'/'+_0x16814c)['json'](_0x1e955e);}return null;};}function patchUpdates(_0x1ebc7f){return function(_0x47e243){try{jsonpatch[_0x5ddf('0x1d')](_0x47e243,_0x1ebc7f,!![]);}catch(_0x3dea5d){return BPromise[_0x5ddf('0x1e')](_0x3dea5d);}return _0x47e243['save']();};}function saveUpdates(_0x188812,_0x35faa2){return function(_0x36a411){if(_0x36a411){return _0x36a411[_0x5ddf('0x1f')](_0x188812)[_0x5ddf('0x20')](function(_0x3aab29){return _0x3aab29;});}return null;};}function removeEntity(_0x4dedc2,_0x177f3e){return function(_0x2c6eee){if(_0x2c6eee){return _0x2c6eee['destroy']()[_0x5ddf('0x20')](function(){_0x4dedc2[_0x5ddf('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aba09,_0x4c79f3){return function(_0x4c81a9){if(!_0x4c81a9){_0x4aba09[_0x5ddf('0x21')](0x194);}return _0x4c81a9;};}function handleError(_0x182dba,_0x4d22ab){_0x4d22ab=_0x4d22ab||0x1f4;return function(_0x26c68c){logger[_0x5ddf('0x22')](_0x26c68c[_0x5ddf('0x23')]);if(_0x26c68c[_0x5ddf('0x24')]){delete _0x26c68c[_0x5ddf('0x24')];}_0x182dba[_0x5ddf('0x17')](_0x4d22ab)[_0x5ddf('0x25')](_0x26c68c);};}var utilLicense=require(_0x5ddf('0x26'));exports[_0x5ddf('0x27')]=function(_0x302b43,_0x21648f){var _0xbf584c={'raw':!![],'where':{'id':0x1}},_0x135088={};_0x135088[_0x5ddf('0x28')]=_[_0x5ddf('0x29')](db['License'][_0x5ddf('0x2a')]);_0x135088[_0x5ddf('0x2b')]=_['keys'](_0x302b43[_0x5ddf('0x2b')]);_0x135088['filters']=_['intersection'](_0x135088[_0x5ddf('0x28')],_0x135088[_0x5ddf('0x2b')]);_0xbf584c[_0x5ddf('0x2c')]=_[_0x5ddf('0x2d')](_0x135088[_0x5ddf('0x28')],qs[_0x5ddf('0x2e')](_0x302b43[_0x5ddf('0x2b')][_0x5ddf('0x2e')]));_0xbf584c[_0x5ddf('0x2c')]=_0xbf584c[_0x5ddf('0x2c')]['length']?_0xbf584c[_0x5ddf('0x2c')]:_0x135088['model'];_0xbf584c=_[_0x5ddf('0x2f')]({},_0xbf584c,_0x302b43[_0x5ddf('0x30')]);return utilLicense[_0x5ddf('0x31')](_0xbf584c)['then'](respondWithResult(_0x21648f,null))[_0x5ddf('0x32')](handleError(_0x21648f,null));};exports[_0x5ddf('0x1f')]=function(_0x3c0a44,_0x25ce1f){if(_0x3c0a44[_0x5ddf('0x33')]['id']){delete _0x3c0a44['body']['id'];}return db[_0x5ddf('0x34')]['find']({'where':{'id':_0x3c0a44['params']['id']}})[_0x5ddf('0x20')](handleEntityNotFound(_0x25ce1f,null))[_0x5ddf('0x20')](function(_0x1d0f99){var _0x3e13fb=_0x1d0f99[_0x5ddf('0x35')]({'plain':!![]});return utilLicense[_0x5ddf('0x36')](_0x3e13fb,_0x3c0a44[_0x5ddf('0x33')][_0x5ddf('0x37')]);})['then'](function(_0x4f1dfe){if(!_0x4f1dfe[_0x5ddf('0x38')]){return saveUpdates(_0x3c0a44[_0x5ddf('0x33')],null);}return _0x4f1dfe;})['then'](respondWithResult(_0x25ce1f,null))['catch'](handleError(_0x25ce1f,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index c00de33..c8759af 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 _0x946e=['define','license','lodash','../../config/logger','moment','./license.attributes','exports'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x946e,0x1d0));var _0xe946=function(_0x28fec5,_0x1467f0){_0x28fec5=_0x28fec5-0x0;var _0x2194bf=_0x946e[_0x28fec5];return _0x2194bf;};'use strict';var _=require(_0xe946('0x0'));var util=require('util');var logger=require(_0xe946('0x1'))('api');var moment=require(_0xe946('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xe946('0x3'));module[_0xe946('0x4')]=function(_0x2b42cd,_0x145058){return _0x2b42cd[_0xe946('0x5')]('License',attributes,{'tableName':_0xe946('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57cf=['api','moment','bluebird','request-promise','./license.attributes','exports','define','license','lodash','util','../../config/logger'];(function(_0x1fece4,_0x4a6f77){var _0x51148b=function(_0x1612f4){while(--_0x1612f4){_0x1fece4['push'](_0x1fece4['shift']());}};_0x51148b(++_0x4a6f77);}(_0x57cf,0x11b));var _0xf57c=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0x57cf[_0x408b34];return _0x1182aa;};'use strict';var _=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var logger=require(_0xf57c('0x2'))(_0xf57c('0x3'));var moment=require(_0xf57c('0x4'));var BPromise=require(_0xf57c('0x5'));var rp=require(_0xf57c('0x6'));var attributes=require(_0xf57c('0x7'));module[_0xf57c('0x8')]=function(_0x16d54f,_0x5bff91){return _0x16d54f[_0xf57c('0x9')]('License',attributes,{'tableName':_0xf57c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index ab91922..a3e5ee7 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 _0x1208=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','License,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2f51be,_0x134bcb){var _0x50b117=function(_0x24b7b9){while(--_0x24b7b9){_0x2f51be['push'](_0x2f51be['shift']());}};_0x50b117(++_0x134bcb);}(_0x1208,0x144));var _0x8120=function(_0x483c4b,_0x5c2d21){_0x483c4b=_0x483c4b-0x0;var _0x445a78=_0x1208[_0x483c4b];return _0x445a78;};'use strict';var _=require(_0x8120('0x0'));var util=require(_0x8120('0x1'));var moment=require(_0x8120('0x2'));var BPromise=require(_0x8120('0x3'));var rs=require(_0x8120('0x4'));var fs=require('fs');var Redis=require(_0x8120('0x5'));var db=require(_0x8120('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8120('0x7'));var config=require(_0x8120('0x8'));var jayson=require(_0x8120('0x9'));var client=jayson[_0x8120('0xa')][_0x8120('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11b913,_0x12b0b5,_0x47ba4f){return new BPromise(function(_0x577da0,_0x302e40){return client[_0x8120('0xc')](_0x11b913,_0x47ba4f)[_0x8120('0xd')](function(_0x4fab81){logger[_0x8120('0xe')]('License,\x20%s,\x20%s',_0x12b0b5,'request\x20sent');logger[_0x8120('0xf')](_0x8120('0x10'),_0x12b0b5,_0x8120('0x11'),JSON['stringify'](_0x4fab81));if(_0x4fab81[_0x8120('0x12')]){if(_0x4fab81[_0x8120('0x12')]['code']===0x1f4){logger[_0x8120('0x12')](_0x8120('0x13'),_0x12b0b5,_0x4fab81[_0x8120('0x12')][_0x8120('0x14')]);return _0x302e40(_0x4fab81[_0x8120('0x12')][_0x8120('0x14')]);}logger[_0x8120('0x12')](_0x8120('0x13'),_0x12b0b5,_0x4fab81[_0x8120('0x12')][_0x8120('0x14')]);return _0x577da0(_0x4fab81[_0x8120('0x12')][_0x8120('0x14')]);}else{logger[_0x8120('0xe')](_0x8120('0x13'),_0x12b0b5,_0x8120('0x11'));_0x577da0(_0x4fab81[_0x8120('0x15')][_0x8120('0x14')]);}})['catch'](function(_0x1c3f59){logger[_0x8120('0x12')](_0x8120('0x13'),_0x12b0b5,_0x1c3f59);_0x302e40(_0x1c3f59);});});} \ No newline at end of file +var _0x794f=['code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1c9cfb,_0x4efc3b){var _0x32436a=function(_0x6836da){while(--_0x6836da){_0x1c9cfb['push'](_0x1c9cfb['shift']());}};_0x32436a(++_0x4efc3b);}(_0x794f,0xb7));var _0xf794=function(_0x229df0,_0x5b47b9){_0x229df0=_0x229df0-0x0;var _0x4fcebe=_0x794f[_0x229df0];return _0x4fcebe;};'use strict';var _=require(_0xf794('0x0'));var util=require(_0xf794('0x1'));var moment=require(_0xf794('0x2'));var BPromise=require('bluebird');var rs=require(_0xf794('0x3'));var fs=require('fs');var Redis=require(_0xf794('0x4'));var db=require(_0xf794('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf794('0x6'))(_0xf794('0x7'));var config=require(_0xf794('0x8'));var jayson=require(_0xf794('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f8d1f,_0x4669cf,_0x34bfce){return new BPromise(function(_0x1a53aa,_0x4987b6){return client['request'](_0x3f8d1f,_0x34bfce)[_0xf794('0xa')](function(_0x160542){logger[_0xf794('0xb')](_0xf794('0xc'),_0x4669cf,_0xf794('0xd'));logger['debug'](_0xf794('0xe'),_0x4669cf,_0xf794('0xd'),JSON[_0xf794('0xf')](_0x160542));if(_0x160542['error']){if(_0x160542[_0xf794('0x10')][_0xf794('0x11')]===0x1f4){logger[_0xf794('0x10')](_0xf794('0xc'),_0x4669cf,_0x160542['error'][_0xf794('0x12')]);return _0x4987b6(_0x160542[_0xf794('0x10')][_0xf794('0x12')]);}logger[_0xf794('0x10')](_0xf794('0xc'),_0x4669cf,_0x160542[_0xf794('0x10')]['message']);return _0x1a53aa(_0x160542[_0xf794('0x10')]['message']);}else{logger[_0xf794('0xb')](_0xf794('0xc'),_0x4669cf,'request\x20sent');_0x1a53aa(_0x160542['result'][_0xf794('0x12')]);}})[_0xf794('0x13')](function(_0x2e9238){logger[_0xf794('0x10')](_0xf794('0xc'),_0x4669cf,_0x2e9238);_0x4987b6(_0x2e9238);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0d8302f..473a124 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 _0xeb8e=['/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','post','addDisposition','addAnswer','create','addImap','/:id/out_servers','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeImap','destroy','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getSmtp'];(function(_0x4859ff,_0x1b0362){var _0x446603=function(_0x4d81a8){while(--_0x4d81a8){_0x4859ff['push'](_0x4859ff['shift']());}};_0x446603(++_0x1b0362);}(_0xeb8e,0x17a));var _0xeeb8=function(_0x5705dd,_0xbcafd2){_0x5705dd=_0x5705dd-0x0;var _0x3b492e=_0xeb8e[_0x5705dd];return _0x3b492e;};'use strict';var multer=require(_0xeeb8('0x0'));var util=require('util');var path=require(_0xeeb8('0x1'));var timeout=require(_0xeeb8('0x2'));var express=require(_0xeeb8('0x3'));var router=express['Router']();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['get']('/describe',auth[_0xeeb8('0x9')](),controller['describe']);router[_0xeeb8('0x8')](_0xeeb8('0xb'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0xc')]);router['get'](_0xeeb8('0xd'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0xe')]);router[_0xeeb8('0x8')](_0xeeb8('0xf'),auth[_0xeeb8('0x9')](),controller['getAnswers']);router[_0xeeb8('0x8')](_0xeeb8('0x10'),auth[_0xeeb8('0x9')](),controller['getImap']);router[_0xeeb8('0x8')]('/:id/out_servers',auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x11')]);router[_0xeeb8('0x8')](_0xeeb8('0x12'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x13')]);router[_0xeeb8('0x8')](_0xeeb8('0x14'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x15')]);router[_0xeeb8('0x8')](_0xeeb8('0x16'),auth['isAuthenticated'](),controller[_0xeeb8('0x17')]);router[_0xeeb8('0x8')](_0xeeb8('0x18'),auth[_0xeeb8('0x9')](),controller['verifySmtp']);router['get'](_0xeeb8('0x19'),auth[_0xeeb8('0x9')](),controller['getAgents']);router[_0xeeb8('0x1a')](_0xeeb8('0xd'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x1b')]);router[_0xeeb8('0x1a')](_0xeeb8('0xf'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x1c')]);router[_0xeeb8('0x1a')]('/',auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x1d')]);router[_0xeeb8('0x1a')](_0xeeb8('0x10'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x1e')]);router[_0xeeb8('0x1a')](_0xeeb8('0x1f'),auth[_0xeeb8('0x9')](),controller['addSmtp']);router[_0xeeb8('0x1a')](_0xeeb8('0x12'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x20')]);router[_0xeeb8('0x1a')](_0xeeb8('0x14'),auth['isAuthenticated'](),controller[_0xeeb8('0x21')]);router['post'](_0xeeb8('0x22'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x23')]);router[_0xeeb8('0x1a')](_0xeeb8('0x19'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x24')]);router[_0xeeb8('0x25')](_0xeeb8('0xb'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x26')]);router[_0xeeb8('0x27')](_0xeeb8('0xd'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x28')]);router[_0xeeb8('0x27')](_0xeeb8('0xf'),auth[_0xeeb8('0x9')](),controller['removeAnswers']);router[_0xeeb8('0x27')](_0xeeb8('0x10'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x29')]);router[_0xeeb8('0x27')](_0xeeb8('0x1f'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0xeeb8('0x27')](_0xeeb8('0xb'),auth['isAuthenticated'](),controller[_0xeeb8('0x2a')]);router['delete'](_0xeeb8('0x19'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x9003=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','update','delete','removeAnswers','/:id/in_servers','removeImap','destroy','removeAgents','exports','multer','path'];(function(_0xc544b6,_0x2488f9){var _0xa660dc=function(_0x2cbc71){while(--_0x2cbc71){_0xc544b6['push'](_0xc544b6['shift']());}};_0xa660dc(++_0x2488f9);}(_0x9003,0x91));var _0x3900=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x9003[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x3900('0x0'));var util=require('util');var path=require(_0x3900('0x1'));var timeout=require(_0x3900('0x2'));var express=require(_0x3900('0x3'));var router=express[_0x3900('0x4')]();var auth=require(_0x3900('0x5'));var interaction=require(_0x3900('0x6'));var config=require(_0x3900('0x7'));var controller=require(_0x3900('0x8'));router[_0x3900('0x9')]('/',auth[_0x3900('0xa')](),controller[_0x3900('0xb')]);router[_0x3900('0x9')](_0x3900('0xc'),auth[_0x3900('0xa')](),controller['describe']);router[_0x3900('0x9')](_0x3900('0xd'),auth[_0x3900('0xa')](),controller[_0x3900('0xe')]);router[_0x3900('0x9')](_0x3900('0xf'),auth[_0x3900('0xa')](),controller[_0x3900('0x10')]);router['get'](_0x3900('0x11'),auth[_0x3900('0xa')](),controller[_0x3900('0x12')]);router[_0x3900('0x9')]('/:id/in_servers',auth[_0x3900('0xa')](),controller[_0x3900('0x13')]);router['get'](_0x3900('0x14'),auth[_0x3900('0xa')](),controller[_0x3900('0x15')]);router['get']('/:id/interactions',auth[_0x3900('0xa')](),controller[_0x3900('0x16')]);router[_0x3900('0x9')](_0x3900('0x17'),auth[_0x3900('0xa')](),controller[_0x3900('0x18')]);router[_0x3900('0x9')]('/:id/messages',auth[_0x3900('0xa')](),controller[_0x3900('0x19')]);router[_0x3900('0x9')](_0x3900('0x1a'),auth['isAuthenticated'](),controller[_0x3900('0x1b')]);router[_0x3900('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x3900('0x1c')]);router[_0x3900('0x1d')](_0x3900('0xf'),auth['isAuthenticated'](),controller[_0x3900('0x1e')]);router[_0x3900('0x1d')](_0x3900('0x11'),auth[_0x3900('0xa')](),controller['addAnswer']);router[_0x3900('0x1d')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3900('0x1d')]('/:id/in_servers',auth[_0x3900('0xa')](),controller[_0x3900('0x1f')]);router['post'](_0x3900('0x14'),auth[_0x3900('0xa')](),controller[_0x3900('0x20')]);router[_0x3900('0x1d')](_0x3900('0x21'),auth[_0x3900('0xa')](),controller[_0x3900('0x22')]);router[_0x3900('0x1d')](_0x3900('0x17'),auth[_0x3900('0xa')](),controller[_0x3900('0x23')]);router[_0x3900('0x1d')](_0x3900('0x24'),auth[_0x3900('0xa')](),controller[_0x3900('0x25')]);router[_0x3900('0x1d')](_0x3900('0x26'),auth['isAuthenticated'](),controller[_0x3900('0x27')]);router[_0x3900('0x28')](_0x3900('0xd'),auth[_0x3900('0xa')](),controller[_0x3900('0x29')]);router[_0x3900('0x2a')](_0x3900('0xf'),auth[_0x3900('0xa')](),controller['removeDispositions']);router[_0x3900('0x2a')](_0x3900('0x11'),auth[_0x3900('0xa')](),controller[_0x3900('0x2b')]);router[_0x3900('0x2a')](_0x3900('0x2c'),auth['isAuthenticated'](),controller[_0x3900('0x2d')]);router[_0x3900('0x2a')]('/:id/out_servers',auth[_0x3900('0xa')](),controller['removeSmtp']);router['delete']('/:id',auth[_0x3900('0xa')](),controller[_0x3900('0x2e')]);router[_0x3900('0x2a')](_0x3900('0x26'),auth['isAuthenticated'](),controller[_0x3900('0x2f')]);module[_0x3900('0x30')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index d3ef954..413a486 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 _0xc06a=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x4b9dc9,_0x14b3a2){var _0x57b302=function(_0x4f99ff){while(--_0x4f99ff){_0x4b9dc9['push'](_0x4b9dc9['shift']());}};_0x57b302(++_0x14b3a2);}(_0xc06a,0x193));var _0xac06=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc06a[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xac06('0x0'));module[_0xac06('0x1')]={'description':{'type':Sequelize[_0xac06('0x2')]},'name':{'type':Sequelize[_0xac06('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xac06('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xac06('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xac06('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xac06('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xac06('0x4')]},'markAsUnread':{'type':Sequelize[_0xac06('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xac06('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xac06('0x5')](0x2)[_0xac06('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xac06('0x4')],'defaultValue':function(){return _0xac06('0x7');}},'notificationSound':{'type':Sequelize[_0xac06('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xac06('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xac06('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xac06('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xac06('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xac06('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xac06('0x3')],'defaultValue':![],'comment':_0xac06('0x8'),'set':function(_0x1d71d2){if(!_0x1d71d2)this['setDataValue'](_0xac06('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x1d71d2);}}}; \ No newline at end of file +var _0xef38=['Arial,Helvetica,sans-serif','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef38,0x193));var _0x8ef3=function(_0x49fa2e,_0x4227a0){_0x49fa2e=_0x49fa2e-0x0;var _0x32eb14=_0xef38[_0x49fa2e];return _0x32eb14;};'use strict';var Sequelize=require(_0x8ef3('0x0'));module[_0x8ef3('0x1')]={'description':{'type':Sequelize[_0x8ef3('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x8ef3('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8ef3('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x8ef3('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8ef3('0x2')],'allowNull':![],'defaultValue':_0x8ef3('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8ef3('0x4')],'defaultValue':function(){return _0x8ef3('0x6');}},'notificationSound':{'type':Sequelize[_0x8ef3('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8ef3('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8ef3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8ef3('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8ef3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8ef3('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x8ef3('0x3')],'defaultValue':![],'comment':_0x8ef3('0x9'),'set':function(_0x41f839){if(!_0x41f839)this[_0x8ef3('0xa')]('mandatoryDispositionPauseId',null);this[_0x8ef3('0xa')](_0x8ef3('0xb'),_0x41f839);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index b48f5a5..9723a44 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 _0x4fef=['merge','findAll','removeDispositions','ids','CannedAnswer','create','getAnswers','findOne','hasOwnProperty','removeAnswers','email','isNil','active','description','cservice','user','password','pass','authentication','host','port','service','cuser','role','MailAccounts','autoAssociation','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','User','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','root','basename','auth','secure','SendMail','sendMail','ListId','messageId','subject','attach','out','Interaction','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','Imap','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','map','key','VIRTUAL','field','filter','options','includeAll','include','rows','show','params','MailServerIn','keys','length','body','find','Pause','describe','addDisposition','MailAccountId','Disposition','getDispositions'];(function(_0x3f2056,_0x24206f){var _0x56ec56=function(_0x250e83){while(--_0x250e83){_0x3f2056['push'](_0x3f2056['shift']());}};_0x56ec56(++_0x24206f);}(_0x4fef,0x10f));var _0xf4fe=function(_0x13bc6a,_0x32cc9c){_0x13bc6a=_0x13bc6a-0x0;var _0x4d21d2=_0x4fef[_0x13bc6a];return _0x4d21d2;};'use strict';var pdf=require(_0xf4fe('0x0'));var emlformat=require(_0xf4fe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf4fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4fe('0x3'));var moment=require(_0xf4fe('0x4'));var BPromise=require(_0xf4fe('0x5'));var Mustache=require(_0xf4fe('0x6'));var util=require(_0xf4fe('0x7'));var path=require(_0xf4fe('0x8'));var sox=require(_0xf4fe('0x9'));var csv=require(_0xf4fe('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf4fe('0xb'));var squel=require(_0xf4fe('0xc'));var crypto=require('crypto');var jsforce=require(_0xf4fe('0xd'));var deskjs=require(_0xf4fe('0xe'));var toCsv=require(_0xf4fe('0xa'));var querystring=require(_0xf4fe('0xf'));var Papa=require(_0xf4fe('0x10'));var authService=require(_0xf4fe('0x11'));var hardwareService=require(_0xf4fe('0x12'));var Redis=require(_0xf4fe('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0xf4fe('0x14'))('api');var utils=require(_0xf4fe('0x15'));var config=require(_0xf4fe('0x16'));var db=require(_0xf4fe('0x17'))['db'];config[_0xf4fe('0x18')]=_[_0xf4fe('0x19')](config['redis'],{'host':_0xf4fe('0x1a'),'port':0x18eb});var socket=require(_0xf4fe('0x1b'))(new Redis(config[_0xf4fe('0x18')]));require('./mailAccount.socket')[_0xf4fe('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf4fe('0x1d')][_0xf4fe('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x316685,_0x4eb042,_0x93346e,_0x3442f1){return new BPromise(function(_0x5de99e,_0x2a00ea){var _0x362e4d=_0x3442f1||client;return _0x362e4d[_0xf4fe('0x1f')](_0x316685,_0x93346e)['then'](function(_0x5daee4){logger[_0xf4fe('0x20')](_0xf4fe('0x21'),_0x4eb042,'request\x20sent');logger['debug'](_0xf4fe('0x22'),_0x4eb042,_0xf4fe('0x23'),JSON[_0xf4fe('0x24')](_0x5daee4));if(_0x5daee4[_0xf4fe('0x25')]){if(_0x5daee4[_0xf4fe('0x25')][_0xf4fe('0x26')]===0x1f4){logger[_0xf4fe('0x25')](_0xf4fe('0x21'),_0x4eb042,_0x5daee4[_0xf4fe('0x25')][_0xf4fe('0x27')]);return _0x2a00ea(_0x5daee4[_0xf4fe('0x25')][_0xf4fe('0x27')]);}logger[_0xf4fe('0x25')](_0xf4fe('0x21'),_0x4eb042,_0x5daee4['error'][_0xf4fe('0x27')]);return _0x5de99e(_0x5daee4['error']['message']);}else{logger['info'](_0xf4fe('0x21'),_0x4eb042,'request\x20sent');_0x5de99e(_0x5daee4['result'][_0xf4fe('0x27')]);}})[_0xf4fe('0x28')](function(_0x27cb2a){logger[_0xf4fe('0x25')](_0xf4fe('0x21'),_0x4eb042,_0x27cb2a);_0x2a00ea(_0x27cb2a);});});}function respondWithStatusCode(_0xf9e5d6,_0x51dc14){_0x51dc14=_0x51dc14||0xcc;return function(_0x1f4013){if(_0x1f4013){return _0xf9e5d6[_0xf4fe('0x29')](_0x51dc14);}return _0xf9e5d6[_0xf4fe('0x2a')](_0x51dc14)[_0xf4fe('0x2b')]();};}function respondWithResult(_0x4141ec,_0x477de5){_0x477de5=_0x477de5||0xc8;return function(_0xa38aa1){if(_0xa38aa1){return _0x4141ec['status'](_0x477de5)[_0xf4fe('0x2c')](_0xa38aa1);}};}function respondWithFilteredResult(_0x112b80,_0x1c455a){return function(_0x5c3f68){if(_0x5c3f68){var _0x538a68=_0x5c3f68[_0xf4fe('0x2d')],_0x2c94c9=_0x1c455a[_0xf4fe('0x2e')],_0x47e54c=_0x1c455a[_0xf4fe('0x2e')]+_0x1c455a[_0xf4fe('0x2f')],_0x5b74b9;if(_0x47e54c>=_0x538a68){_0x47e54c=_0x538a68;_0x5b74b9=0xc8;}else{_0x5b74b9=0xce;}_0x112b80['status'](_0x5b74b9);return _0x112b80['set'](_0xf4fe('0x30'),_0x2c94c9+'-'+_0x47e54c+'/'+_0x538a68)[_0xf4fe('0x2c')](_0x5c3f68);}return null;};}function patchUpdates(_0x5990de){return function(_0x89403c){try{jsonpatch[_0xf4fe('0x31')](_0x89403c,_0x5990de,!![]);}catch(_0x394785){return BPromise[_0xf4fe('0x32')](_0x394785);}return _0x89403c[_0xf4fe('0x33')]();};}function saveUpdates(_0x3a0109,_0x16d3f7){return function(_0x638217){if(_0x638217){return _0x638217[_0xf4fe('0x34')](_0x3a0109)[_0xf4fe('0x35')](function(_0x843dc8){return _0x843dc8;});}return null;};}function removeEntity(_0x356b07,_0x4d7535){return function(_0x49a386){if(_0x49a386){return _0x49a386[_0xf4fe('0x36')]()[_0xf4fe('0x35')](function(){var _0x527fae=_0x49a386[_0xf4fe('0x37')]({'plain':!![]});var _0x3019ff='MailAccounts';return db[_0xf4fe('0x38')][_0xf4fe('0x36')]({'where':{'type':_0x3019ff,'resourceId':_0x527fae['id']}})[_0xf4fe('0x35')](function(){return _0x49a386;});})[_0xf4fe('0x35')](function(){_0x356b07[_0xf4fe('0x2a')](0xcc)[_0xf4fe('0x2b')]();});}};}function handleEntityNotFound(_0x52139e,_0x35d03a){return function(_0x10f729){if(!_0x10f729){_0x52139e['sendStatus'](0x194);}return _0x10f729;};}function handleError(_0x21034d,_0x2d97fd){_0x2d97fd=_0x2d97fd||0x1f4;return function(_0x35fed3){logger[_0xf4fe('0x25')](_0x35fed3[_0xf4fe('0x39')]);if(_0x35fed3['name']){delete _0x35fed3[_0xf4fe('0x3a')];}_0x21034d[_0xf4fe('0x2a')](_0x2d97fd)[_0xf4fe('0x3b')](_0x35fed3);};}exports['index']=function(_0x7454ee,_0x19945f){var _0x4ea16a={'include':[{'model':db['MailServerIn'],'as':_0xf4fe('0x3c')},{'model':db[_0xf4fe('0x3d')],'as':_0xf4fe('0x3e')},{'model':db['Pause'],'as':_0xf4fe('0x3f')}]},_0x24345b={},_0x5e2948={'count':0x0,'rows':[]};var _0x3ffbe5=db[_0xf4fe('0x40')][_0xf4fe('0x41')];_0x24345b[_0xf4fe('0x42')]=_['keys'](_0x3ffbe5);_0x24345b[_0xf4fe('0x43')]=_['keys'](_0x7454ee['query']);_0x24345b[_0xf4fe('0x44')]=_[_0xf4fe('0x45')](_0x24345b[_0xf4fe('0x42')],_0x24345b[_0xf4fe('0x43')]);_0x4ea16a['attributes']=_[_0xf4fe('0x45')](_0x24345b[_0xf4fe('0x42')],qs['fields'](_0x7454ee[_0xf4fe('0x43')][_0xf4fe('0x46')]));_0x4ea16a[_0xf4fe('0x47')]=_0x4ea16a[_0xf4fe('0x47')]['length']?_0x4ea16a[_0xf4fe('0x47')]:_0x24345b[_0xf4fe('0x42')];if(!_0x7454ee[_0xf4fe('0x43')]['hasOwnProperty'](_0xf4fe('0x48'))){_0x4ea16a[_0xf4fe('0x2f')]=qs[_0xf4fe('0x2f')](_0x7454ee[_0xf4fe('0x43')]['limit']);_0x4ea16a[_0xf4fe('0x2e')]=qs[_0xf4fe('0x2e')](_0x7454ee[_0xf4fe('0x43')][_0xf4fe('0x2e')]);}_0x4ea16a[_0xf4fe('0x49')]=qs['sort'](_0x7454ee[_0xf4fe('0x43')][_0xf4fe('0x4a')]);_0x4ea16a[_0xf4fe('0x4b')]=qs[_0xf4fe('0x44')](_[_0xf4fe('0x4c')](_0x7454ee[_0xf4fe('0x43')],_0x24345b[_0xf4fe('0x44')]));if(_0x7454ee[_0xf4fe('0x43')]['filter']){_0x4ea16a[_0xf4fe('0x4b')]=_['merge'](_0x4ea16a[_0xf4fe('0x4b')],{'$or':_[_0xf4fe('0x4d')](_0x3ffbe5,function(_0x196563){if(_0x196563['type'][_0xf4fe('0x4e')]!==_0xf4fe('0x4f')){var _0xbcfd5={};_0xbcfd5[_0x196563[_0xf4fe('0x50')]]={'$like':'%'+_0x7454ee['query'][_0xf4fe('0x51')]+'%'};return _0xbcfd5;}})});}_0x4ea16a=_['merge']({},_0x4ea16a,_0x7454ee[_0xf4fe('0x52')]);var _0x1087e2={'where':_0x4ea16a[_0xf4fe('0x4b')]};return db[_0xf4fe('0x40')][_0xf4fe('0x2d')](_0x1087e2)['then'](function(_0x269b69){_0x5e2948['count']=_0x269b69;if(_0x7454ee[_0xf4fe('0x43')][_0xf4fe('0x53')]){_0x4ea16a[_0xf4fe('0x54')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x4ea16a);})['then'](function(_0x31c30c){_0x5e2948[_0xf4fe('0x55')]=_0x31c30c;return _0x5e2948;})[_0xf4fe('0x35')](respondWithFilteredResult(_0x19945f,_0x4ea16a))[_0xf4fe('0x28')](handleError(_0x19945f,null));};exports[_0xf4fe('0x56')]=function(_0x2d8597,_0x2aeb8e){var _0x57acfa={'raw':![],'where':{'id':_0x2d8597[_0xf4fe('0x57')]['id']},'include':[{'model':db[_0xf4fe('0x58')],'as':'Imap'},{'model':db[_0xf4fe('0x3d')],'as':_0xf4fe('0x3e')},{'model':db['Pause'],'as':_0xf4fe('0x3f')}]},_0x2e491a={};_0x2e491a[_0xf4fe('0x42')]=_[_0xf4fe('0x59')](db['MailAccount']['rawAttributes']);_0x2e491a[_0xf4fe('0x43')]=_[_0xf4fe('0x59')](_0x2d8597[_0xf4fe('0x43')]);_0x2e491a[_0xf4fe('0x44')]=_['intersection'](_0x2e491a[_0xf4fe('0x42')],_0x2e491a[_0xf4fe('0x43')]);_0x57acfa[_0xf4fe('0x47')]=_[_0xf4fe('0x45')](_0x2e491a[_0xf4fe('0x42')],qs[_0xf4fe('0x46')](_0x2d8597['query'][_0xf4fe('0x46')]));_0x57acfa[_0xf4fe('0x47')]=_0x57acfa['attributes'][_0xf4fe('0x5a')]?_0x57acfa[_0xf4fe('0x47')]:_0x2e491a[_0xf4fe('0x42')];if(_0x2d8597[_0xf4fe('0x43')]['includeAll']){_0x57acfa['include']=[{'all':!![]}];}_0x57acfa=_['merge']({},_0x57acfa,_0x2d8597[_0xf4fe('0x52')]);return db[_0xf4fe('0x40')]['find'](_0x57acfa)[_0xf4fe('0x35')](handleEntityNotFound(_0x2aeb8e,null))[_0xf4fe('0x35')](respondWithResult(_0x2aeb8e,null))[_0xf4fe('0x28')](handleError(_0x2aeb8e,null));};exports[_0xf4fe('0x34')]=function(_0x3538e9,_0xf8c766){if(_0x3538e9[_0xf4fe('0x5b')]['id']){delete _0x3538e9['body']['id'];}return db[_0xf4fe('0x40')][_0xf4fe('0x5c')]({'where':{'id':_0x3538e9['params']['id']},'include':[{'model':db[_0xf4fe('0x58')],'as':'Imap'},{'model':db[_0xf4fe('0x3d')],'as':'Smtp'},{'model':db[_0xf4fe('0x5d')],'as':_0xf4fe('0x3f')}]})[_0xf4fe('0x35')](handleEntityNotFound(_0xf8c766,null))[_0xf4fe('0x35')](saveUpdates(_0x3538e9[_0xf4fe('0x5b')],null))[_0xf4fe('0x35')](function(_0xc3fb60){if(_0xc3fb60&&_0x3538e9[_0xf4fe('0x5b')][_0xf4fe('0x3c')]){return db['MailServerIn']['update'](_0x3538e9[_0xf4fe('0x5b')][_0xf4fe('0x3c')],{'where':{'MailAccountId':_0xc3fb60['id']}})[_0xf4fe('0x35')](function(){return _0xc3fb60;});}return _0xc3fb60;})['then'](function(_0x21331d){if(_0x21331d&&_0x3538e9[_0xf4fe('0x5b')][_0xf4fe('0x3e')]){return db[_0xf4fe('0x3d')]['update'](_0x3538e9[_0xf4fe('0x5b')][_0xf4fe('0x3e')],{'where':{'MailAccountId':_0x21331d['id']}})[_0xf4fe('0x35')](function(){return _0x21331d;});}return _0x21331d;})['then'](respondWithResult(_0xf8c766,null))['catch'](handleError(_0xf8c766,null));};exports[_0xf4fe('0x5e')]=function(_0x39b51b,_0x46c33f){return db['MailAccount']['describe']()[_0xf4fe('0x35')](respondWithResult(_0x46c33f,null))[_0xf4fe('0x28')](handleError(_0x46c33f,null));};exports[_0xf4fe('0x5f')]=function(_0x1c7124,_0x1bedaa,_0x1771aa){if(_0x1c7124[_0xf4fe('0x5b')]['id']){delete _0x1c7124[_0xf4fe('0x5b')]['id'];}return db['MailAccount'][_0xf4fe('0x5c')]({'where':{'id':_0x1c7124[_0xf4fe('0x57')]['id']}})['then'](handleEntityNotFound(_0x1bedaa,null))['then'](function(_0x366ef1){if(_0x366ef1){_0x1c7124[_0xf4fe('0x5b')][_0xf4fe('0x60')]=_0x366ef1['id'];return db[_0xf4fe('0x61')]['create'](_0x1c7124[_0xf4fe('0x5b')]);}})['then'](respondWithResult(_0x1bedaa,null))[_0xf4fe('0x28')](handleError(_0x1bedaa,null));};exports[_0xf4fe('0x62')]=function(_0xaf548b,_0x4b0f3d,_0x511e24){var _0x54148f={'raw':![],'where':{}};var _0x2e625e={};var _0x39d75a={'count':0x0,'rows':[]};return db[_0xf4fe('0x40')]['findOne']({'where':{'id':_0xaf548b[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x4b0f3d,null))[_0xf4fe('0x35')](function(_0x3cb883){if(_0x3cb883){_0x2e625e[_0xf4fe('0x42')]=_[_0xf4fe('0x59')](db['Disposition'][_0xf4fe('0x41')]);_0x2e625e[_0xf4fe('0x43')]=_['keys'](_0xaf548b['query']);_0x2e625e['filters']=_[_0xf4fe('0x45')](_0x2e625e[_0xf4fe('0x42')],_0x2e625e[_0xf4fe('0x43')]);_0x54148f[_0xf4fe('0x47')]=_[_0xf4fe('0x45')](_0x2e625e[_0xf4fe('0x42')],qs[_0xf4fe('0x46')](_0xaf548b['query'][_0xf4fe('0x46')]));_0x54148f[_0xf4fe('0x47')]=_0x54148f[_0xf4fe('0x47')][_0xf4fe('0x5a')]?_0x54148f[_0xf4fe('0x47')]:_0x2e625e[_0xf4fe('0x42')];if(!_0xaf548b[_0xf4fe('0x43')]['hasOwnProperty'](_0xf4fe('0x48'))){_0x54148f['limit']=qs[_0xf4fe('0x2f')](_0xaf548b['query'][_0xf4fe('0x2f')]);_0x54148f[_0xf4fe('0x2e')]=qs[_0xf4fe('0x2e')](_0xaf548b[_0xf4fe('0x43')][_0xf4fe('0x2e')]);}_0x54148f['order']=qs[_0xf4fe('0x4a')](_0xaf548b[_0xf4fe('0x43')]['sort']);_0x54148f[_0xf4fe('0x4b')]=qs['filters'](_['pick'](_0xaf548b[_0xf4fe('0x43')],_0x2e625e[_0xf4fe('0x44')]));_0x54148f[_0xf4fe('0x4b')][_0xf4fe('0x60')]=_0x3cb883['id'];if(_0xaf548b['query'][_0xf4fe('0x51')]){_0x54148f[_0xf4fe('0x4b')]=_[_0xf4fe('0x63')](_0x54148f['where'],{'$or':_[_0xf4fe('0x4d')](_0x54148f[_0xf4fe('0x47')],function(_0x468f14){var _0x23a22a={};_0x23a22a[_0x468f14]={'$like':'%'+_0xaf548b[_0xf4fe('0x43')][_0xf4fe('0x51')]+'%'};return _0x23a22a;})});}_0x54148f=_[_0xf4fe('0x63')]({},_0x54148f,_0xaf548b[_0xf4fe('0x52')]);return db[_0xf4fe('0x61')][_0xf4fe('0x2d')]({'where':_0x54148f[_0xf4fe('0x4b')]})['then'](function(_0x2de252){_0x39d75a[_0xf4fe('0x2d')]=_0x2de252;if(_0xaf548b['query']['includeAll']){_0x54148f[_0xf4fe('0x54')]=[{'all':!![]}];}return db[_0xf4fe('0x61')][_0xf4fe('0x64')](_0x54148f);})['then'](function(_0x39fedd){_0x39d75a['rows']=_0x39fedd;return _0x39d75a;});}})[_0xf4fe('0x35')](respondWithFilteredResult(_0x4b0f3d,_0x54148f))[_0xf4fe('0x28')](handleError(_0x4b0f3d,null));};exports['removeDispositions']=function(_0x7b626f,_0x4b831c,_0x55306f){var _0x154282;return db['MailAccount'][_0xf4fe('0x5c')]({'where':{'id':_0x7b626f['params']['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x4b831c,null))[_0xf4fe('0x35')](function(_0xb922fa){if(_0xb922fa){return _0xb922fa[_0xf4fe('0x65')](_0x7b626f[_0xf4fe('0x43')][_0xf4fe('0x66')]);}})[_0xf4fe('0x35')](respondWithStatusCode(_0x4b831c,null))[_0xf4fe('0x28')](handleError(_0x4b831c,null));};exports['addAnswer']=function(_0x4314cc,_0x5468ce,_0x277ccc){if(_0x4314cc['body']['id']){delete _0x4314cc[_0xf4fe('0x5b')]['id'];}return db[_0xf4fe('0x40')][_0xf4fe('0x5c')]({'where':{'id':_0x4314cc[_0xf4fe('0x57')]['id']}})['then'](handleEntityNotFound(_0x5468ce,null))[_0xf4fe('0x35')](function(_0x21ca88){if(_0x21ca88){_0x4314cc['body'][_0xf4fe('0x60')]=_0x21ca88['id'];return db[_0xf4fe('0x67')][_0xf4fe('0x68')](_0x4314cc['body']);}})[_0xf4fe('0x35')](respondWithResult(_0x5468ce,null))['catch'](handleError(_0x5468ce,null));};exports[_0xf4fe('0x69')]=function(_0x401df3,_0x3dcf0b,_0x110058){var _0x3a8b8b={'raw':![],'where':{}};var _0x23fbaa={};var _0x4f7ab5={'count':0x0,'rows':[]};return db[_0xf4fe('0x40')][_0xf4fe('0x6a')]({'where':{'id':_0x401df3['params']['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x3dcf0b,null))[_0xf4fe('0x35')](function(_0x4310fe){if(_0x4310fe){_0x23fbaa[_0xf4fe('0x42')]=_[_0xf4fe('0x59')](db['CannedAnswer'][_0xf4fe('0x41')]);_0x23fbaa[_0xf4fe('0x43')]=_[_0xf4fe('0x59')](_0x401df3[_0xf4fe('0x43')]);_0x23fbaa[_0xf4fe('0x44')]=_[_0xf4fe('0x45')](_0x23fbaa[_0xf4fe('0x42')],_0x23fbaa[_0xf4fe('0x43')]);_0x3a8b8b[_0xf4fe('0x47')]=_[_0xf4fe('0x45')](_0x23fbaa[_0xf4fe('0x42')],qs['fields'](_0x401df3[_0xf4fe('0x43')][_0xf4fe('0x46')]));_0x3a8b8b[_0xf4fe('0x47')]=_0x3a8b8b[_0xf4fe('0x47')][_0xf4fe('0x5a')]?_0x3a8b8b['attributes']:_0x23fbaa['model'];if(!_0x401df3['query'][_0xf4fe('0x6b')](_0xf4fe('0x48'))){_0x3a8b8b[_0xf4fe('0x2f')]=qs[_0xf4fe('0x2f')](_0x401df3[_0xf4fe('0x43')][_0xf4fe('0x2f')]);_0x3a8b8b['offset']=qs[_0xf4fe('0x2e')](_0x401df3['query'][_0xf4fe('0x2e')]);}_0x3a8b8b[_0xf4fe('0x49')]=qs[_0xf4fe('0x4a')](_0x401df3[_0xf4fe('0x43')][_0xf4fe('0x4a')]);_0x3a8b8b[_0xf4fe('0x4b')]=qs[_0xf4fe('0x44')](_[_0xf4fe('0x4c')](_0x401df3[_0xf4fe('0x43')],_0x23fbaa[_0xf4fe('0x44')]));_0x3a8b8b[_0xf4fe('0x4b')][_0xf4fe('0x60')]=_0x4310fe['id'];if(_0x401df3[_0xf4fe('0x43')]['filter']){_0x3a8b8b['where']=_['merge'](_0x3a8b8b['where'],{'$or':_[_0xf4fe('0x4d')](_0x3a8b8b['attributes'],function(_0x1a93a0){var _0x138865={};_0x138865[_0x1a93a0]={'$like':'%'+_0x401df3[_0xf4fe('0x43')][_0xf4fe('0x51')]+'%'};return _0x138865;})});}_0x3a8b8b=_[_0xf4fe('0x63')]({},_0x3a8b8b,_0x401df3['options']);return db[_0xf4fe('0x67')]['count']({'where':_0x3a8b8b[_0xf4fe('0x4b')]})[_0xf4fe('0x35')](function(_0x2d76b9){_0x4f7ab5['count']=_0x2d76b9;if(_0x401df3['query'][_0xf4fe('0x53')]){_0x3a8b8b[_0xf4fe('0x54')]=[{'all':!![]}];}return db[_0xf4fe('0x67')]['findAll'](_0x3a8b8b);})['then'](function(_0x330e92){_0x4f7ab5[_0xf4fe('0x55')]=_0x330e92;return _0x4f7ab5;});}})['then'](respondWithFilteredResult(_0x3dcf0b,_0x3a8b8b))[_0xf4fe('0x28')](handleError(_0x3dcf0b,null));};exports[_0xf4fe('0x6c')]=function(_0x5de4e5,_0x4dcef3,_0x2e4012){var _0x2486dd;return db[_0xf4fe('0x40')]['find']({'where':{'id':_0x5de4e5['params']['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x4dcef3,null))[_0xf4fe('0x35')](function(_0x6ebda6){if(_0x6ebda6){return _0x6ebda6[_0xf4fe('0x6c')](_0x5de4e5[_0xf4fe('0x43')][_0xf4fe('0x66')]);}})[_0xf4fe('0x35')](respondWithStatusCode(_0x4dcef3,null))[_0xf4fe('0x28')](handleError(_0x4dcef3,null));};exports['create']=function(_0x5ab818,_0x84a129){var _0x8523f2={'name':_0x5ab818[_0xf4fe('0x5b')]['name'],'key':_0x5ab818['body']['key'],'email':_0x5ab818[_0xf4fe('0x5b')][_0xf4fe('0x6d')],'ListId':_0x5ab818['body']['ListId'],'active':!_[_0xf4fe('0x6e')](_0x5ab818[_0xf4fe('0x5b')]['active'])?_0x5ab818[_0xf4fe('0x5b')][_0xf4fe('0x6f')]:!![],'description':_0x5ab818['body'][_0xf4fe('0x70')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x5ab818['body'][_0xf4fe('0x71')])){if(_0x5ab818['body']['cauthentication']){_0x8523f2['Imap'][_0xf4fe('0x72')]=_0x8523f2[_0xf4fe('0x3e')][_0xf4fe('0x72')]=_0x5ab818[_0xf4fe('0x5b')]['cuser'];_0x8523f2[_0xf4fe('0x3c')][_0xf4fe('0x73')]=_0x8523f2['Smtp'][_0xf4fe('0x74')]=_0x5ab818[_0xf4fe('0x5b')]['cpassword'];}else{_0x8523f2[_0xf4fe('0x3c')][_0xf4fe('0x75')]=_0x8523f2[_0xf4fe('0x3e')][_0xf4fe('0x75')]=![];}_0x8523f2[_0xf4fe('0x3c')][_0xf4fe('0x76')]=_0x5ab818[_0xf4fe('0x5b')][_0xf4fe('0x3c')]['host'];_0x8523f2[_0xf4fe('0x3c')][_0xf4fe('0x77')]=_0x5ab818[_0xf4fe('0x5b')][_0xf4fe('0x3c')][_0xf4fe('0x77')];_0x8523f2[_0xf4fe('0x3e')]['host']=_0x5ab818[_0xf4fe('0x5b')][_0xf4fe('0x3e')][_0xf4fe('0x76')];_0x8523f2['Smtp']['port']=_0x5ab818[_0xf4fe('0x5b')][_0xf4fe('0x3e')]['port'];}else{_0x8523f2[_0xf4fe('0x3c')][_0xf4fe('0x78')]=_0x8523f2['Smtp'][_0xf4fe('0x78')]=_0x5ab818[_0xf4fe('0x5b')][_0xf4fe('0x71')];_0x8523f2['Imap']['user']=_0x8523f2[_0xf4fe('0x3e')]['user']=_0x5ab818[_0xf4fe('0x5b')][_0xf4fe('0x79')];_0x8523f2[_0xf4fe('0x3c')]['password']=_0x8523f2[_0xf4fe('0x3e')][_0xf4fe('0x74')]=_0x5ab818['body']['cpassword'];}return db['MailAccount'][_0xf4fe('0x68')](_0x8523f2,{'include':[{'model':db[_0xf4fe('0x3d')],'as':_0xf4fe('0x3e')},{'model':db['MailServerIn'],'as':_0xf4fe('0x3c')}]})[_0xf4fe('0x35')](function(_0x285aa7){var _0x178a5a=_0x5ab818[_0xf4fe('0x72')][_0xf4fe('0x37')]({'plain':!![]});if(!_0x178a5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x178a5a[_0xf4fe('0x7a')]==='user'){var _0x26a514=_0x285aa7[_0xf4fe('0x37')]({'plain':!![]});return db['UserProfileSection'][_0xf4fe('0x5c')]({'where':{'name':_0xf4fe('0x7b'),'userProfileId':_0x178a5a['userProfileId']},'raw':!![]})[_0xf4fe('0x35')](function(_0x2a8f95){if(_0x2a8f95&&_0x2a8f95[_0xf4fe('0x7c')]===0x0){return db[_0xf4fe('0x38')][_0xf4fe('0x68')]({'name':_0x26a514[_0xf4fe('0x3a')],'resourceId':_0x26a514['id'],'type':_0x2a8f95[_0xf4fe('0x3a')],'sectionId':_0x2a8f95['id']},{})[_0xf4fe('0x35')](function(){return _0x285aa7;});}else{return _0x285aa7;}})['catch'](function(_0x117275){logger[_0xf4fe('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x117275);throw _0x117275;});}return _0x285aa7;})[_0xf4fe('0x35')](respondWithResult(_0x84a129,0xc9))[_0xf4fe('0x28')](handleError(_0x84a129,null));};exports[_0xf4fe('0x7d')]=function(_0xbbcb8b,_0x40341e,_0x31c4aa){return db[_0xf4fe('0x40')][_0xf4fe('0x6a')]({'where':{'id':_0xbbcb8b[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x40341e,null))[_0xf4fe('0x35')](function(_0x540bd4){if(_0x540bd4){return _0x540bd4['getImap']();}return null;})[_0xf4fe('0x35')](respondWithResult(_0x40341e,null))[_0xf4fe('0x28')](handleError(_0x40341e,null));};exports[_0xf4fe('0x7e')]=function(_0x1f8fe5,_0x5c996c,_0x4701b8){if(_0x1f8fe5[_0xf4fe('0x5b')]['id']){delete _0x1f8fe5[_0xf4fe('0x5b')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1f8fe5[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x5c996c,null))[_0xf4fe('0x35')](function(_0x50f5e9){if(_0x50f5e9){_0x1f8fe5[_0xf4fe('0x5b')][_0xf4fe('0x60')]=_0x50f5e9['id'];return db[_0xf4fe('0x58')][_0xf4fe('0x68')](_0x1f8fe5[_0xf4fe('0x5b')]);}})[_0xf4fe('0x35')](respondWithResult(_0x5c996c,null))[_0xf4fe('0x28')](handleError(_0x5c996c,null));};exports[_0xf4fe('0x7f')]=function(_0x5dc8ea,_0x172f52,_0x5a804a){return db['MailAccount'][_0xf4fe('0x6a')]({'where':{'id':_0x5dc8ea['params']['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x172f52,null))[_0xf4fe('0x35')](function(_0x84b42d){if(_0x84b42d){return _0x84b42d['setImap'](null);}return null;})[_0xf4fe('0x35')](respondWithStatusCode(_0x172f52,null))[_0xf4fe('0x28')](handleError(_0x172f52,null));};exports[_0xf4fe('0x80')]=function(_0xeab409,_0x13dc72,_0x3fe819){return db['MailAccount'][_0xf4fe('0x6a')]({'where':{'id':_0xeab409[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x13dc72,null))[_0xf4fe('0x35')](function(_0x5ce114){if(_0x5ce114){return _0x5ce114[_0xf4fe('0x80')]();}return null;})[_0xf4fe('0x35')](respondWithResult(_0x13dc72,null))[_0xf4fe('0x28')](handleError(_0x13dc72,null));};exports[_0xf4fe('0x81')]=function(_0x99b9e6,_0xd76295,_0x54962a){if(_0x99b9e6[_0xf4fe('0x5b')]['id']){delete _0x99b9e6[_0xf4fe('0x5b')]['id'];}return db[_0xf4fe('0x40')][_0xf4fe('0x5c')]({'where':{'id':_0x99b9e6[_0xf4fe('0x57')]['id']}})['then'](handleEntityNotFound(_0xd76295,null))[_0xf4fe('0x35')](function(_0x2a81b3){if(_0x2a81b3){_0x99b9e6[_0xf4fe('0x5b')][_0xf4fe('0x60')]=_0x2a81b3['id'];return db['MailServerOut'][_0xf4fe('0x68')](_0x99b9e6[_0xf4fe('0x5b')]);}})['then'](respondWithResult(_0xd76295,null))[_0xf4fe('0x28')](handleError(_0xd76295,null));};exports[_0xf4fe('0x82')]=function(_0x4c1297,_0x27aa55,_0x507803){return db[_0xf4fe('0x40')][_0xf4fe('0x6a')]({'where':{'id':_0x4c1297[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x27aa55,null))['then'](function(_0x7f2e68){if(_0x7f2e68){return _0x7f2e68[_0xf4fe('0x83')](null);}return null;})[_0xf4fe('0x35')](respondWithStatusCode(_0x27aa55,null))[_0xf4fe('0x28')](handleError(_0x27aa55,null));};exports[_0xf4fe('0x84')]=function(_0x5b35e1,_0x121ffa,_0x1ef90d){return db[_0xf4fe('0x85')][_0xf4fe('0x5c')]({'where':{'id':_0x5b35e1['params']['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x121ffa,null))['then'](function(_0x1fcf37){if(_0x1fcf37){return _0x1fcf37[_0xf4fe('0x84')](_0x5b35e1[_0xf4fe('0x5b')][_0xf4fe('0x66')],_[_0xf4fe('0x86')](_0x5b35e1['body'],[_0xf4fe('0x66'),'id'])||{});}})[_0xf4fe('0x35')](respondWithResult(_0x121ffa,null))[_0xf4fe('0x28')](handleError(_0x121ffa,null));};exports['getInteractions']=function(_0x1ef01f,_0x181bb5,_0x21c4b3){var _0x29ee17={'raw':![],'where':{}};var _0x427f12={};var _0x5b8398={'count':0x0,'rows':[]};return db['MailAccount'][_0xf4fe('0x6a')]({'where':{'id':_0x1ef01f['params']['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x181bb5,null))[_0xf4fe('0x35')](function(_0x1dce28){if(_0x1dce28){_0x427f12['model']=_['keys'](db['MailInteraction'][_0xf4fe('0x41')]);_0x427f12['query']=_[_0xf4fe('0x59')](_0x1ef01f[_0xf4fe('0x43')]);_0x427f12['filters']=_[_0xf4fe('0x45')](_0x427f12['model'],_0x427f12[_0xf4fe('0x43')]);_0x29ee17[_0xf4fe('0x47')]=_[_0xf4fe('0x45')](_0x427f12['model'],qs[_0xf4fe('0x46')](_0x1ef01f[_0xf4fe('0x43')]['fields']));_0x29ee17[_0xf4fe('0x47')]=_0x29ee17['attributes'][_0xf4fe('0x5a')]?_0x29ee17[_0xf4fe('0x47')]:_0x427f12['model'];if(!_0x1ef01f['query'][_0xf4fe('0x6b')](_0xf4fe('0x48'))){_0x29ee17[_0xf4fe('0x2f')]=qs[_0xf4fe('0x2f')](_0x1ef01f[_0xf4fe('0x43')][_0xf4fe('0x2f')]);_0x29ee17[_0xf4fe('0x2e')]=qs[_0xf4fe('0x2e')](_0x1ef01f[_0xf4fe('0x43')]['offset']);}_0x29ee17[_0xf4fe('0x49')]=qs[_0xf4fe('0x4a')](_0x1ef01f[_0xf4fe('0x43')][_0xf4fe('0x4a')]);_0x29ee17[_0xf4fe('0x4b')]=qs['filters'](_[_0xf4fe('0x4c')](_0x1ef01f[_0xf4fe('0x43')],_0x427f12[_0xf4fe('0x44')]));_0x29ee17[_0xf4fe('0x4b')]['MailAccountId']=_0x1dce28['id'];if(_0x1ef01f['query'][_0xf4fe('0x51')]){_0x29ee17[_0xf4fe('0x4b')]=_[_0xf4fe('0x63')](_0x29ee17[_0xf4fe('0x4b')],{'$or':_[_0xf4fe('0x4d')](_0x29ee17['attributes'],function(_0x10f67e){var _0x4a75dc={};_0x4a75dc[_0x10f67e]={'$like':'%'+_0x1ef01f[_0xf4fe('0x43')][_0xf4fe('0x51')]+'%'};return _0x4a75dc;})});}_0x29ee17=_[_0xf4fe('0x63')]({},_0x29ee17,_0x1ef01f[_0xf4fe('0x52')]);return db['MailInteraction'][_0xf4fe('0x2d')]({'where':_0x29ee17[_0xf4fe('0x4b')]})[_0xf4fe('0x35')](function(_0xbea8b4){_0x5b8398[_0xf4fe('0x2d')]=_0xbea8b4;if(_0x1ef01f[_0xf4fe('0x43')][_0xf4fe('0x53')]){_0x29ee17[_0xf4fe('0x54')]=[{'model':db[_0xf4fe('0x87')],'as':'Contact','required':![]},{'model':db[_0xf4fe('0x88')],'as':'Owner','attributes':[_0xf4fe('0x3a'),_0xf4fe('0x89'),'internal'],'required':![]},{'model':db[_0xf4fe('0x8a')],'as':_0xf4fe('0x8b'),'attributes':['id',_0xf4fe('0x3a'),'color'],'where':_0x1ef01f[_0xf4fe('0x43')][_0xf4fe('0x8c')]?{'id':_0x1ef01f[_0xf4fe('0x43')]['tag']}:undefined,'required':_0x1ef01f[_0xf4fe('0x43')][_0xf4fe('0x8c')]?!![]:![]}];}return db['MailInteraction'][_0xf4fe('0x64')](_0x29ee17);})[_0xf4fe('0x35')](function(_0x86a1f4){_0x5b8398[_0xf4fe('0x55')]=_0x86a1f4;return _0x5b8398;});}})[_0xf4fe('0x35')](respondWithFilteredResult(_0x181bb5,_0x29ee17))[_0xf4fe('0x28')](handleError(_0x181bb5,null));};exports[_0xf4fe('0x8d')]=function(_0x493e61,_0x4735eb,_0x1ebd76){return db[_0xf4fe('0x40')][_0xf4fe('0x6a')]({'where':{'id':_0x493e61['params']['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x4735eb,null))[_0xf4fe('0x35')](function(_0x5499e7){if(_0x5499e7){return db[_0xf4fe('0x8e')][_0xf4fe('0x8f')](function(_0xe3c778){return db[_0xf4fe('0x90')]['destroy']({'where':{'MailAccountId':_0x493e61[_0xf4fe('0x57')]['id']},'transaction':_0xe3c778})[_0xf4fe('0x35')](function(_0x8484e9){var _0x56b490=_[_0xf4fe('0x4d')](_0x493e61['body'],function(_0x2d17b8){_0x2d17b8[_0xf4fe('0x60')]=_0x493e61[_0xf4fe('0x57')]['id'];return _0x2d17b8;});return db[_0xf4fe('0x90')][_0xf4fe('0x91')](_0x56b490,{'transaction':_0xe3c778});});})['then'](function(){return db[_0xf4fe('0x90')][_0xf4fe('0x92')]({'where':{'MailAccountId':_0x493e61[_0xf4fe('0x57')]['id']},'order':_0xf4fe('0x93')});});}})['then'](respondWithResult(_0x4735eb,null))[_0xf4fe('0x28')](handleError(_0x4735eb,null));};exports[_0xf4fe('0x94')]=function(_0x55d5cc,_0xfb42b6,_0x4fa064){var _0x5ddde3={};var _0x5322f4={};var _0x1b76d5;var _0x4a5486;return db[_0xf4fe('0x40')][_0xf4fe('0x6a')]({'where':{'id':_0x55d5cc['params']['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0xfb42b6,null))['then'](function(_0x3d53d8){if(_0x3d53d8){_0x1b76d5=_0x3d53d8;_0x5322f4[_0xf4fe('0x42')]=_['keys'](db[_0xf4fe('0x90')][_0xf4fe('0x41')]);_0x5322f4['query']=_[_0xf4fe('0x59')](_0x55d5cc[_0xf4fe('0x43')]);_0x5322f4[_0xf4fe('0x44')]=_[_0xf4fe('0x45')](_0x5322f4[_0xf4fe('0x42')],_0x5322f4[_0xf4fe('0x43')]);_0x5ddde3['attributes']=_[_0xf4fe('0x45')](_0x5322f4[_0xf4fe('0x42')],qs[_0xf4fe('0x46')](_0x55d5cc['query'][_0xf4fe('0x46')]));_0x5ddde3['attributes']=_0x5ddde3[_0xf4fe('0x47')]['length']?_0x5ddde3[_0xf4fe('0x47')]:_0x5322f4[_0xf4fe('0x42')];_0x5ddde3['order']=qs[_0xf4fe('0x4a')](_0x55d5cc[_0xf4fe('0x43')][_0xf4fe('0x4a')]);_0x5ddde3[_0xf4fe('0x4b')]=qs[_0xf4fe('0x44')](_['pick'](_0x55d5cc[_0xf4fe('0x43')],_0x5322f4[_0xf4fe('0x44')]));if(_0x55d5cc['query']['filter']){_0x5ddde3[_0xf4fe('0x4b')]=_[_0xf4fe('0x63')](_0x5ddde3[_0xf4fe('0x4b')],{'$or':_[_0xf4fe('0x4d')](_0x5ddde3[_0xf4fe('0x47')],function(_0x5ebfdc){var _0x53d8a8={};_0x53d8a8[_0x5ebfdc]={'$like':'%'+_0x55d5cc[_0xf4fe('0x43')][_0xf4fe('0x51')]+'%'};return _0x53d8a8;})});}_0x5ddde3=_['merge']({},_0x5ddde3,_0x55d5cc[_0xf4fe('0x52')]);return _0x1b76d5['getApplications'](_0x5ddde3);}})[_0xf4fe('0x35')](function(_0x3aa812){if(_0x3aa812){_0x4a5486=_0x3aa812[_0xf4fe('0x5a')];if(!_0x55d5cc[_0xf4fe('0x43')][_0xf4fe('0x6b')](_0xf4fe('0x48'))){_0x5ddde3[_0xf4fe('0x2f')]=qs[_0xf4fe('0x2f')](_0x55d5cc['query'][_0xf4fe('0x2f')]);_0x5ddde3[_0xf4fe('0x2e')]=qs[_0xf4fe('0x2e')](_0x55d5cc[_0xf4fe('0x43')][_0xf4fe('0x2e')]);}return _0x1b76d5[_0xf4fe('0x94')](_0x5ddde3);}})['then'](function(_0x2dbe2e){if(_0x2dbe2e){return _0x2dbe2e?{'count':_0x4a5486,'rows':_0x2dbe2e}:null;}})[_0xf4fe('0x35')](respondWithResult(_0xfb42b6,null))[_0xf4fe('0x28')](handleError(_0xfb42b6,null));};exports[_0xf4fe('0x95')]=function(_0x529211,_0x165171,_0x67e7bb){var _0x1d8802={'raw':!![],'where':{}};var _0x513ae9={};var _0xd22ec3={'count':0x0,'rows':[]};return db[_0xf4fe('0x40')][_0xf4fe('0x6a')]({'where':{'id':_0x529211['params']['id']}})['then'](handleEntityNotFound(_0x165171,null))[_0xf4fe('0x35')](function(_0x4e9467){if(_0x4e9467){_0x513ae9['model']=_[_0xf4fe('0x59')](db[_0xf4fe('0x96')][_0xf4fe('0x41')]);_0x513ae9['query']=_[_0xf4fe('0x59')](_0x529211[_0xf4fe('0x43')]);_0x513ae9['filters']=_['intersection'](_0x513ae9[_0xf4fe('0x42')],_0x513ae9[_0xf4fe('0x43')]);_0x1d8802['attributes']=_[_0xf4fe('0x45')](_0x513ae9['model'],qs['fields'](_0x529211[_0xf4fe('0x43')]['fields']));_0x1d8802['attributes']=_0x1d8802[_0xf4fe('0x47')][_0xf4fe('0x5a')]?_0x1d8802['attributes']:_0x513ae9[_0xf4fe('0x42')];if(!_0x529211[_0xf4fe('0x43')][_0xf4fe('0x6b')](_0xf4fe('0x48'))){_0x1d8802[_0xf4fe('0x2f')]=qs[_0xf4fe('0x2f')](_0x529211[_0xf4fe('0x43')][_0xf4fe('0x2f')]);_0x1d8802[_0xf4fe('0x2e')]=qs[_0xf4fe('0x2e')](_0x529211[_0xf4fe('0x43')][_0xf4fe('0x2e')]);}_0x1d8802[_0xf4fe('0x49')]=qs[_0xf4fe('0x4a')](_0x529211[_0xf4fe('0x43')]['sort']);_0x1d8802[_0xf4fe('0x4b')]=qs['filters'](_[_0xf4fe('0x4c')](_0x529211[_0xf4fe('0x43')],_0x513ae9['filters']));_0x1d8802['where'][_0xf4fe('0x60')]=_0x4e9467['id'];if(_0x529211[_0xf4fe('0x43')]['filter']){_0x1d8802[_0xf4fe('0x4b')]=_[_0xf4fe('0x63')](_0x1d8802[_0xf4fe('0x4b')],{'$or':_[_0xf4fe('0x4d')](_0x1d8802[_0xf4fe('0x47')],function(_0x6e188e){var _0x2a5c6b={};_0x2a5c6b[_0x6e188e]={'$like':'%'+_0x529211[_0xf4fe('0x43')][_0xf4fe('0x51')]+'%'};return _0x2a5c6b;})});}if(_0x529211['query'][_0xf4fe('0x97')]){var _0x510ae6=_0x529211['query'][_0xf4fe('0x97')][_0xf4fe('0x98')](',');var _0x169ba5={};_0x169ba5[_0x510ae6[0x0]]={'$gte':moment(_0x510ae6[0x1])['format'](_0xf4fe('0x99'))};_0x1d8802['where']=_['merge'](_0x1d8802[_0xf4fe('0x4b')],_0x169ba5);}_0x1d8802=_[_0xf4fe('0x63')]({},_0x1d8802,_0x529211['options']);return db['MailMessage'][_0xf4fe('0x2d')]({'where':_0x1d8802['where']})[_0xf4fe('0x35')](function(_0x57781a){_0xd22ec3[_0xf4fe('0x2d')]=_0x57781a;if(_0x529211[_0xf4fe('0x43')][_0xf4fe('0x53')]){_0x1d8802['include']=[{'all':!![]}];}return db[_0xf4fe('0x96')][_0xf4fe('0x64')](_0x1d8802);})[_0xf4fe('0x35')](function(_0x19de69){_0xd22ec3[_0xf4fe('0x55')]=_0x19de69;return _0xd22ec3;});}})[_0xf4fe('0x35')](respondWithFilteredResult(_0x165171,_0x1d8802))[_0xf4fe('0x28')](handleError(_0x165171,null));};exports[_0xf4fe('0x3b')]=function(_0xf60954,_0x40a21d,_0x550de0){var _0x80faf5,_0x546470={},_0x44e8ad;if(_0xf60954[_0xf4fe('0x5b')]['to']){_0x44e8ad=_0xf60954[_0xf4fe('0x5b')]['to'][_0xf4fe('0x98')](',')[0x0];}return db['MailAccount'][_0xf4fe('0x5c')]({'where':{'id':_0xf60954[_0xf4fe('0x57')]['id']},'include':[{'model':db[_0xf4fe('0x9a')],'as':_0xf4fe('0x9b'),'include':[{'model':db[_0xf4fe('0x87')],'as':_0xf4fe('0x9c'),'where':{'email':_0x44e8ad},'limit':0x1,'order':[[_0xf4fe('0x9d'),_0xf4fe('0x9e')]]}]},{'model':db['MailServerOut'],'as':_0xf4fe('0x3e'),'raw':!![]}]})[_0xf4fe('0x35')](handleEntityNotFound(_0x40a21d,null))['then'](function(_0xaa0501){if(_0xaa0501){_0x80faf5=_0xaa0501;if(_0xaa0501[_0xf4fe('0x3e')]){if(_[_0xf4fe('0x6e')](_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0x9f')])){_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0x9f')]=util[_0xf4fe('0xa0')](_0xf4fe('0xa1'),_0xaa0501[_0xf4fe('0x3a')],_0xaa0501[_0xf4fe('0x6d')]||_0xaa0501[_0xf4fe('0x3e')][_0xf4fe('0x72')]);}if(_0xf60954['body'][_0xf4fe('0xa2')]&&_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0xa2')][_0xf4fe('0x5a')]){for(var _0xaab267=0x0;_0xaab267<_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0xa2')][_0xf4fe('0x5a')];_0xaab267+=0x1){_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0xa2')][_0xaab267]={'filename':_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0xa2')][_0xaab267][_0xf4fe('0x3a')],'path':path[_0xf4fe('0xa3')](config[_0xf4fe('0xa4')],'server/files/attachments',_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0xa2')][_0xaab267][_0xf4fe('0xa5')])};}}var _0x305d71={'tls':{'rejectUnauthorized':![]}};if(_[_0xf4fe('0x6e')](_0xaa0501['Smtp'][_0xf4fe('0x78')])){if(_0xaa0501[_0xf4fe('0x3e')][_0xf4fe('0x75')]){_0x305d71[_0xf4fe('0xa6')]={'user':_0xaa0501[_0xf4fe('0x3e')][_0xf4fe('0x72')],'pass':_0xaa0501[_0xf4fe('0x3e')]['pass']};}_0x305d71[_0xf4fe('0x76')]=_0xaa0501[_0xf4fe('0x3e')][_0xf4fe('0x76')];_0x305d71[_0xf4fe('0x77')]=_0xaa0501[_0xf4fe('0x3e')][_0xf4fe('0x77')];_0x305d71[_0xf4fe('0xa7')]=_0xaa0501[_0xf4fe('0x3e')][_0xf4fe('0xa7')];}else{_0x305d71[_0xf4fe('0x78')]=_0xaa0501[_0xf4fe('0x3e')][_0xf4fe('0x78')];_0x305d71[_0xf4fe('0xa6')]={'user':_0xaa0501[_0xf4fe('0x3e')]['user'],'pass':_0xaa0501[_0xf4fe('0x3e')][_0xf4fe('0x74')]};}return respondWithRpcPromise(_0xf4fe('0xa8'),_0xf4fe('0xa9'),{'account':_0x305d71,'message':_0xf60954[_0xf4fe('0x5b')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x512c79){if(_0x512c79){_0x546470=_0x512c79;if(_0x80faf5['List']){if(_0x80faf5[_0xf4fe('0x9b')][_0xf4fe('0x9c')][_0xf4fe('0x5a')]){return _0x80faf5['List']['Contacts'][0x0];}else{return db[_0xf4fe('0x87')][_0xf4fe('0x68')](_[_0xf4fe('0x19')](_0xf60954['body'],{'firstName':_0xf60954[_0xf4fe('0x5b')]['to'],'email':_0xf60954[_0xf4fe('0x5b')]['to'],'phone':_0xf60954[_0xf4fe('0x5b')]['to'],'ListId':_0x80faf5[_0xf4fe('0xaa')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xf4fe('0x35')](function(_0x4c72b0){if(_0x4c72b0){var _0x6b0f89={'UserId':_0xf60954[_0xf4fe('0x72')]['id'],'ContactId':_0x4c72b0['id'],'MailAccountId':_0x80faf5['id'],'inReplyTo':_0x546470[_0xf4fe('0xab')],'to':_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0x9f')],'cc':_0xf60954[_0xf4fe('0x5b')]['cc'],'subject':_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0xac')],'attach':_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0xad')],'firstMsgDirection':_0xf4fe('0xae'),'lastMsgAt':moment()[_0xf4fe('0xa0')](_0xf4fe('0x99')),'lastMsgDirection':_0xf4fe('0xae'),'lastMsgBody':_0xf60954['body'][_0xf4fe('0x5b')],'Messages':[_['merge'](_0xf60954['body'],{'messageId':_0x546470['messageId'],'sentAt':moment()[_0xf4fe('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x80faf5['id'],'UserId':_0xf60954[_0xf4fe('0x72')]['id'],'ContactId':_0x4c72b0['id']})]};if(_0xf60954[_0xf4fe('0x5b')][_0xf4fe('0xaf')]){_0x6b0f89=_[_0xf4fe('0x63')](_0x6b0f89,_0xf60954['body'][_0xf4fe('0xaf')]);}return db['MailInteraction'][_0xf4fe('0x68')](_0x6b0f89,{'include':[{'model':db[_0xf4fe('0x96')],'as':'Messages'}]});}})[_0xf4fe('0x35')](respondWithResult(_0x40a21d,null))[_0xf4fe('0x28')](handleError(_0x40a21d,null));};exports[_0xf4fe('0xb0')]=function(_0x3c139a,_0x817e73,_0x4a120a){return db[_0xf4fe('0x40')]['find']({'where':{'id':_0x3c139a[_0xf4fe('0x57')]['id']},'include':[{'model':db[_0xf4fe('0x3d')],'as':_0xf4fe('0x3e'),'raw':!![]}]})[_0xf4fe('0x35')](handleEntityNotFound(_0x817e73,null))[_0xf4fe('0x35')](function(_0xbde4b1){if(_0xbde4b1&&_0xbde4b1['Smtp']){var _0x1d960a={'id':_0xbde4b1['id'],'tls':{'rejectUnauthorized':![]}};if(_0xbde4b1['Smtp']['service']){_0x1d960a[_0xf4fe('0x78')]=_0xbde4b1[_0xf4fe('0x3e')][_0xf4fe('0x78')];}else{_0x1d960a[_0xf4fe('0x76')]=_0xbde4b1['Smtp'][_0xf4fe('0x76')];_0x1d960a[_0xf4fe('0x77')]=_0xbde4b1['Smtp'][_0xf4fe('0x77')];_0x1d960a['secure']=_0xbde4b1[_0xf4fe('0x3e')]['secure'];}if(_0xbde4b1[_0xf4fe('0x3e')][_0xf4fe('0x75')]){_0x1d960a[_0xf4fe('0xa6')]={'user':_0xbde4b1['Smtp']['user'],'pass':_0xbde4b1[_0xf4fe('0x3e')][_0xf4fe('0x74')]};}return respondWithRpcPromise('VerifySmtp',_0xf4fe('0xb0'),{'account':_0x1d960a});}})[_0xf4fe('0x35')](respondWithResult(_0x817e73,null))[_0xf4fe('0x28')](handleError(_0x817e73,null));};exports['destroy']=function(_0x59c53d,_0x457db2){return db[_0xf4fe('0x40')][_0xf4fe('0x5c')]({'where':{'id':_0x59c53d[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x457db2,null))[_0xf4fe('0x35')](function(_0x250466){if(_0x250466&&_0x250466[_0xf4fe('0x78')]){throw new db[(_0xf4fe('0xb1'))][(_0xf4fe('0xb2'))](_0xf4fe('0xb3'));}return _0x250466;})['then'](removeEntity(_0x457db2,null))[_0xf4fe('0x28')](handleError(_0x457db2,null));};exports[_0xf4fe('0xb4')]=function(_0x2c7587,_0x3b1389,_0x558246){return db[_0xf4fe('0x40')][_0xf4fe('0x5c')]({'where':{'id':_0x2c7587[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x3b1389,null))['then'](function(_0x487f66){if(_0x487f66){return _0x487f66['addAgents'](_0x2c7587[_0xf4fe('0x5b')][_0xf4fe('0x66')],_['omit'](_0x2c7587[_0xf4fe('0x5b')],[_0xf4fe('0x66'),'id'])||{})['spread'](function(_0x6426e1){for(var _0x2524cf=0x0;_0x2524cf<_0x2c7587[_0xf4fe('0x5b')][_0xf4fe('0x66')]['length'];_0x2524cf+=0x1){socket[_0xf4fe('0xb5')]('userMailAccount:save',{'UserId':_0x2c7587[_0xf4fe('0x5b')][_0xf4fe('0x66')][_0x2524cf],'MailAccountId':_0x2c7587[_0xf4fe('0x57')]['id']});}return _0x6426e1;});}})[_0xf4fe('0x35')](respondWithResult(_0x3b1389,null))['catch'](handleError(_0x3b1389,null));};exports[_0xf4fe('0xb6')]=function(_0x134ec7,_0x178cc1,_0x5e8e60){var _0x5d5df8;return db[_0xf4fe('0x40')][_0xf4fe('0x5c')]({'where':{'id':_0x134ec7[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x178cc1,null))[_0xf4fe('0x35')](function(_0xc8d814){if(_0xc8d814){return _0xc8d814[_0xf4fe('0xb6')](_0x134ec7[_0xf4fe('0x43')][_0xf4fe('0x66')])[_0xf4fe('0x35')](function(_0x190124){if(_['isArray'](_0x134ec7[_0xf4fe('0x43')]['ids'])){for(var _0x4d85a5=0x0;_0x4d85a5<_0x134ec7[_0xf4fe('0x43')][_0xf4fe('0x66')][_0xf4fe('0x5a')];_0x4d85a5+=0x1){socket['emit']('userMailAccount:remove',{'UserId':_0x134ec7[_0xf4fe('0x43')][_0xf4fe('0x66')][_0x4d85a5],'MailAccountId':_0x134ec7[_0xf4fe('0x57')]['id']});}}else{socket['emit'](_0xf4fe('0xb7'),{'UserId':_0x134ec7[_0xf4fe('0x43')][_0xf4fe('0x66')],'MailAccountId':_0x134ec7[_0xf4fe('0x57')]['id']});}});}})[_0xf4fe('0x35')](respondWithStatusCode(_0x178cc1,null))[_0xf4fe('0x28')](handleError(_0x178cc1,null));};exports['getAgents']=function(_0x4efc39,_0x5203b5,_0x57c76b){var _0x5a4516={};var _0x1bf43a={};var _0x484e10;var _0x4557d;return db[_0xf4fe('0x40')][_0xf4fe('0x6a')]({'where':{'id':_0x4efc39[_0xf4fe('0x57')]['id']}})[_0xf4fe('0x35')](handleEntityNotFound(_0x5203b5,null))[_0xf4fe('0x35')](function(_0x36ee6e){if(_0x36ee6e){_0x484e10=_0x36ee6e;_0x1bf43a[_0xf4fe('0x42')]=_[_0xf4fe('0x59')](db[_0xf4fe('0x88')]['rawAttributes']);_0x1bf43a[_0xf4fe('0x43')]=_[_0xf4fe('0x59')](_0x4efc39[_0xf4fe('0x43')]);_0x1bf43a[_0xf4fe('0x44')]=_[_0xf4fe('0x45')](_0x1bf43a[_0xf4fe('0x42')],_0x1bf43a[_0xf4fe('0x43')]);_0x5a4516[_0xf4fe('0x47')]=_[_0xf4fe('0x45')](_0x1bf43a['model'],qs['fields'](_0x4efc39['query'][_0xf4fe('0x46')]));_0x5a4516[_0xf4fe('0x47')]=_0x5a4516[_0xf4fe('0x47')][_0xf4fe('0x5a')]?_0x5a4516[_0xf4fe('0x47')]:_0x1bf43a['model'];_0x5a4516[_0xf4fe('0x49')]=qs[_0xf4fe('0x4a')](_0x4efc39[_0xf4fe('0x43')][_0xf4fe('0x4a')]);_0x5a4516[_0xf4fe('0x4b')]=qs['filters'](_[_0xf4fe('0x4c')](_0x4efc39[_0xf4fe('0x43')],_0x1bf43a[_0xf4fe('0x44')]));if(_0x4efc39['query']['filter']){_0x5a4516[_0xf4fe('0x4b')]=_[_0xf4fe('0x63')](_0x5a4516[_0xf4fe('0x4b')],{'$or':_[_0xf4fe('0x4d')](_0x5a4516[_0xf4fe('0x47')],function(_0x687a7b){var _0x5c908f={};_0x5c908f[_0x687a7b]={'$like':'%'+_0x4efc39[_0xf4fe('0x43')]['filter']+'%'};return _0x5c908f;})});}_0x5a4516=_['merge']({},_0x5a4516,_0x4efc39[_0xf4fe('0x52')]);return _0x484e10['getAgents'](_0x5a4516);}})['then'](function(_0x5d9b2c){if(_0x5d9b2c){_0x4557d=_0x5d9b2c[_0xf4fe('0x5a')];if(!_0x4efc39[_0xf4fe('0x43')][_0xf4fe('0x6b')](_0xf4fe('0x48'))){_0x5a4516[_0xf4fe('0x2f')]=qs[_0xf4fe('0x2f')](_0x4efc39['query'][_0xf4fe('0x2f')]);_0x5a4516['offset']=qs[_0xf4fe('0x2e')](_0x4efc39[_0xf4fe('0x43')][_0xf4fe('0x2e')]);}return _0x484e10[_0xf4fe('0xb8')](_0x5a4516);}})[_0xf4fe('0x35')](function(_0x5a731d){if(_0x5a731d){return _0x5a731d?{'count':_0x4557d,'rows':_0x5a731d}:null;}})[_0xf4fe('0x35')](respondWithResult(_0x5203b5,null))[_0xf4fe('0x28')](handleError(_0x5203b5,null));}; \ No newline at end of file +var _0x1ac2=['cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','omit','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','MailApplication','bulkCreate','getApplications','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','CmContact','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','removeAgents','isArray','emit','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','status','count','offset','limit','Content-Range','json','apply','reject','save','update','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','map','VIRTUAL','field','merge','includeAll','include','findAll','params','Imap','body','find','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','order','options','rows','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','key','email','active','isNil','user','pass','authentication','host','port','service','cservice','cuser','password'];(function(_0x50df3e,_0x3f37cd){var _0x21a626=function(_0x13bea5){while(--_0x13bea5){_0x50df3e['push'](_0x50df3e['shift']());}};_0x21a626(++_0x3f37cd);}(_0x1ac2,0xfd));var _0x21ac=function(_0x3648d5,_0x413d26){_0x3648d5=_0x3648d5-0x0;var _0x16e702=_0x1ac2[_0x3648d5];return _0x16e702;};'use strict';var pdf=require(_0x21ac('0x0'));var emlformat=require(_0x21ac('0x1'));var rimraf=require(_0x21ac('0x2'));var zipdir=require(_0x21ac('0x3'));var jsonpatch=require(_0x21ac('0x4'));var rp=require(_0x21ac('0x5'));var moment=require(_0x21ac('0x6'));var BPromise=require(_0x21ac('0x7'));var Mustache=require(_0x21ac('0x8'));var util=require(_0x21ac('0x9'));var path=require(_0x21ac('0xa'));var sox=require('sox');var csv=require(_0x21ac('0xb'));var ejs=require(_0x21ac('0xc'));var fs=require('fs');var _=require(_0x21ac('0xd'));var squel=require('squel');var crypto=require(_0x21ac('0xe'));var jsforce=require(_0x21ac('0xf'));var deskjs=require(_0x21ac('0x10'));var toCsv=require(_0x21ac('0xb'));var querystring=require(_0x21ac('0x11'));var Papa=require(_0x21ac('0x12'));var authService=require(_0x21ac('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x21ac('0x14'));var qs=require(_0x21ac('0x15'));var logger=require(_0x21ac('0x16'))(_0x21ac('0x17'));var utils=require(_0x21ac('0x18'));var config=require(_0x21ac('0x19'));var db=require(_0x21ac('0x1a'))['db'];config['redis']=_[_0x21ac('0x1b')](config[_0x21ac('0x1c')],{'host':_0x21ac('0x1d'),'port':0x18eb});var socket=require(_0x21ac('0x1e'))(new Redis(config[_0x21ac('0x1c')]));require(_0x21ac('0x1f'))[_0x21ac('0x20')](socket);var jayson=require(_0x21ac('0x21'));var client=jayson[_0x21ac('0x22')]['http']({'port':0x232b});function respondWithRpcPromise(_0x3498e3,_0x3c1e0e,_0xc92caa,_0x3efc93){return new BPromise(function(_0x5bbb71,_0xb1c52c){var _0x41701d=_0x3efc93||client;return _0x41701d['request'](_0x3498e3,_0xc92caa)[_0x21ac('0x23')](function(_0x1c31ac){logger['info']('MailAccount,\x20%s,\x20%s',_0x3c1e0e,_0x21ac('0x24'));logger[_0x21ac('0x25')](_0x21ac('0x26'),_0x3c1e0e,_0x21ac('0x24'),JSON[_0x21ac('0x27')](_0x1c31ac));if(_0x1c31ac[_0x21ac('0x28')]){if(_0x1c31ac[_0x21ac('0x28')][_0x21ac('0x29')]===0x1f4){logger[_0x21ac('0x28')](_0x21ac('0x2a'),_0x3c1e0e,_0x1c31ac[_0x21ac('0x28')][_0x21ac('0x2b')]);return _0xb1c52c(_0x1c31ac[_0x21ac('0x28')][_0x21ac('0x2b')]);}logger[_0x21ac('0x28')](_0x21ac('0x2a'),_0x3c1e0e,_0x1c31ac[_0x21ac('0x28')][_0x21ac('0x2b')]);return _0x5bbb71(_0x1c31ac['error']['message']);}else{logger['info'](_0x21ac('0x2a'),_0x3c1e0e,_0x21ac('0x24'));_0x5bbb71(_0x1c31ac[_0x21ac('0x2c')][_0x21ac('0x2b')]);}})[_0x21ac('0x2d')](function(_0x4618f8){logger['error'](_0x21ac('0x2a'),_0x3c1e0e,_0x4618f8);_0xb1c52c(_0x4618f8);});});}function respondWithStatusCode(_0x5a709e,_0x353f08){_0x353f08=_0x353f08||0xcc;return function(_0x45e924){if(_0x45e924){return _0x5a709e['sendStatus'](_0x353f08);}return _0x5a709e[_0x21ac('0x2e')](_0x353f08)['end']();};}function respondWithResult(_0x15a5fd,_0x4201fe){_0x4201fe=_0x4201fe||0xc8;return function(_0xcf313e){if(_0xcf313e){return _0x15a5fd['status'](_0x4201fe)['json'](_0xcf313e);}};}function respondWithFilteredResult(_0x40dc99,_0xe6c8f1){return function(_0x1c838a){if(_0x1c838a){var _0x36a758=_0x1c838a[_0x21ac('0x2f')],_0x39ca73=_0xe6c8f1['offset'],_0x2c7c4d=_0xe6c8f1[_0x21ac('0x30')]+_0xe6c8f1[_0x21ac('0x31')],_0x17370e;if(_0x2c7c4d>=_0x36a758){_0x2c7c4d=_0x36a758;_0x17370e=0xc8;}else{_0x17370e=0xce;}_0x40dc99['status'](_0x17370e);return _0x40dc99['set'](_0x21ac('0x32'),_0x39ca73+'-'+_0x2c7c4d+'/'+_0x36a758)[_0x21ac('0x33')](_0x1c838a);}return null;};}function patchUpdates(_0x4bbf71){return function(_0x4bcf11){try{jsonpatch[_0x21ac('0x34')](_0x4bcf11,_0x4bbf71,!![]);}catch(_0x28e1c5){return BPromise[_0x21ac('0x35')](_0x28e1c5);}return _0x4bcf11[_0x21ac('0x36')]();};}function saveUpdates(_0x2d6760,_0x42d8b2){return function(_0x248a41){if(_0x248a41){return _0x248a41[_0x21ac('0x37')](_0x2d6760)['then'](function(_0x2e74be){return _0x2e74be;});}return null;};}function removeEntity(_0xf1d3a8,_0x457bb2){return function(_0x1e32dc){if(_0x1e32dc){return _0x1e32dc['destroy']()[_0x21ac('0x23')](function(){var _0x8c6592=_0x1e32dc['get']({'plain':!![]});var _0x2390b6='MailAccounts';return db[_0x21ac('0x38')][_0x21ac('0x39')]({'where':{'type':_0x2390b6,'resourceId':_0x8c6592['id']}})[_0x21ac('0x23')](function(){return _0x1e32dc;});})['then'](function(){_0xf1d3a8[_0x21ac('0x2e')](0xcc)[_0x21ac('0x3a')]();});}};}function handleEntityNotFound(_0x1337a4,_0x34ba6e){return function(_0x44a762){if(!_0x44a762){_0x1337a4[_0x21ac('0x3b')](0x194);}return _0x44a762;};}function handleError(_0x393d83,_0x1226f4){_0x1226f4=_0x1226f4||0x1f4;return function(_0x459d0a){logger[_0x21ac('0x28')](_0x459d0a[_0x21ac('0x3c')]);if(_0x459d0a[_0x21ac('0x3d')]){delete _0x459d0a[_0x21ac('0x3d')];}_0x393d83[_0x21ac('0x2e')](_0x1226f4)[_0x21ac('0x3e')](_0x459d0a);};}exports[_0x21ac('0x3f')]=function(_0x231a92,_0x2f2fa6){var _0x59920a={'include':[{'model':db[_0x21ac('0x40')],'as':'Imap'},{'model':db[_0x21ac('0x41')],'as':_0x21ac('0x42')},{'model':db[_0x21ac('0x43')],'as':_0x21ac('0x44')}]},_0x33b77e={},_0x160c6f={'count':0x0,'rows':[]};var _0x4d9066=db[_0x21ac('0x45')][_0x21ac('0x46')];_0x33b77e[_0x21ac('0x47')]=_[_0x21ac('0x48')](_0x4d9066);_0x33b77e[_0x21ac('0x49')]=_[_0x21ac('0x48')](_0x231a92[_0x21ac('0x49')]);_0x33b77e[_0x21ac('0x4a')]=_[_0x21ac('0x4b')](_0x33b77e[_0x21ac('0x47')],_0x33b77e[_0x21ac('0x49')]);_0x59920a[_0x21ac('0x4c')]=_['intersection'](_0x33b77e[_0x21ac('0x47')],qs[_0x21ac('0x4d')](_0x231a92['query'][_0x21ac('0x4d')]));_0x59920a['attributes']=_0x59920a[_0x21ac('0x4c')][_0x21ac('0x4e')]?_0x59920a[_0x21ac('0x4c')]:_0x33b77e[_0x21ac('0x47')];if(!_0x231a92[_0x21ac('0x49')][_0x21ac('0x4f')](_0x21ac('0x50'))){_0x59920a[_0x21ac('0x31')]=qs['limit'](_0x231a92[_0x21ac('0x49')]['limit']);_0x59920a[_0x21ac('0x30')]=qs[_0x21ac('0x30')](_0x231a92[_0x21ac('0x49')][_0x21ac('0x30')]);}_0x59920a['order']=qs[_0x21ac('0x51')](_0x231a92['query'][_0x21ac('0x51')]);_0x59920a['where']=qs['filters'](_[_0x21ac('0x52')](_0x231a92[_0x21ac('0x49')],_0x33b77e[_0x21ac('0x4a')]));if(_0x231a92[_0x21ac('0x49')][_0x21ac('0x53')]){_0x59920a[_0x21ac('0x54')]=_['merge'](_0x59920a[_0x21ac('0x54')],{'$or':_[_0x21ac('0x55')](_0x4d9066,function(_0xec8763){if(_0xec8763['type']['key']!==_0x21ac('0x56')){var _0x23ed71={};_0x23ed71[_0xec8763[_0x21ac('0x57')]]={'$like':'%'+_0x231a92['query'][_0x21ac('0x53')]+'%'};return _0x23ed71;}})});}_0x59920a=_[_0x21ac('0x58')]({},_0x59920a,_0x231a92['options']);var _0x492076={'where':_0x59920a[_0x21ac('0x54')]};return db[_0x21ac('0x45')][_0x21ac('0x2f')](_0x492076)[_0x21ac('0x23')](function(_0xd1d315){_0x160c6f[_0x21ac('0x2f')]=_0xd1d315;if(_0x231a92[_0x21ac('0x49')][_0x21ac('0x59')]){_0x59920a[_0x21ac('0x5a')]=[{'all':!![]}];}return db[_0x21ac('0x45')][_0x21ac('0x5b')](_0x59920a);})['then'](function(_0x21c321){_0x160c6f['rows']=_0x21c321;return _0x160c6f;})[_0x21ac('0x23')](respondWithFilteredResult(_0x2f2fa6,_0x59920a))[_0x21ac('0x2d')](handleError(_0x2f2fa6,null));};exports['show']=function(_0x1faa23,_0x1af1f8){var _0x34fdfa={'raw':![],'where':{'id':_0x1faa23[_0x21ac('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x21ac('0x5d')},{'model':db[_0x21ac('0x41')],'as':_0x21ac('0x42')},{'model':db[_0x21ac('0x43')],'as':_0x21ac('0x44')}]},_0x5925f4={};_0x5925f4[_0x21ac('0x47')]=_['keys'](db[_0x21ac('0x45')]['rawAttributes']);_0x5925f4[_0x21ac('0x49')]=_[_0x21ac('0x48')](_0x1faa23['query']);_0x5925f4['filters']=_['intersection'](_0x5925f4[_0x21ac('0x47')],_0x5925f4[_0x21ac('0x49')]);_0x34fdfa[_0x21ac('0x4c')]=_[_0x21ac('0x4b')](_0x5925f4[_0x21ac('0x47')],qs[_0x21ac('0x4d')](_0x1faa23[_0x21ac('0x49')][_0x21ac('0x4d')]));_0x34fdfa['attributes']=_0x34fdfa[_0x21ac('0x4c')][_0x21ac('0x4e')]?_0x34fdfa['attributes']:_0x5925f4[_0x21ac('0x47')];if(_0x1faa23[_0x21ac('0x49')][_0x21ac('0x59')]){_0x34fdfa[_0x21ac('0x5a')]=[{'all':!![]}];}_0x34fdfa=_['merge']({},_0x34fdfa,_0x1faa23['options']);return db['MailAccount']['find'](_0x34fdfa)['then'](handleEntityNotFound(_0x1af1f8,null))[_0x21ac('0x23')](respondWithResult(_0x1af1f8,null))['catch'](handleError(_0x1af1f8,null));};exports[_0x21ac('0x37')]=function(_0x4aa3fd,_0x53b7c3){if(_0x4aa3fd[_0x21ac('0x5e')]['id']){delete _0x4aa3fd['body']['id'];}return db['MailAccount'][_0x21ac('0x5f')]({'where':{'id':_0x4aa3fd[_0x21ac('0x5c')]['id']},'include':[{'model':db[_0x21ac('0x40')],'as':_0x21ac('0x5d')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x53b7c3,null))[_0x21ac('0x23')](saveUpdates(_0x4aa3fd[_0x21ac('0x5e')],null))['then'](function(_0x202d54){if(_0x202d54&&_0x4aa3fd[_0x21ac('0x5e')][_0x21ac('0x5d')]){return db['MailServerIn'][_0x21ac('0x37')](_0x4aa3fd[_0x21ac('0x5e')][_0x21ac('0x5d')],{'where':{'MailAccountId':_0x202d54['id']}})[_0x21ac('0x23')](function(){return _0x202d54;});}return _0x202d54;})[_0x21ac('0x23')](function(_0x31cb50){if(_0x31cb50&&_0x4aa3fd[_0x21ac('0x5e')]['Smtp']){return db[_0x21ac('0x41')]['update'](_0x4aa3fd[_0x21ac('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x31cb50['id']}})[_0x21ac('0x23')](function(){return _0x31cb50;});}return _0x31cb50;})['then'](respondWithResult(_0x53b7c3,null))[_0x21ac('0x2d')](handleError(_0x53b7c3,null));};exports[_0x21ac('0x60')]=function(_0x5e3207,_0x122c66){return db[_0x21ac('0x45')]['describe']()[_0x21ac('0x23')](respondWithResult(_0x122c66,null))[_0x21ac('0x2d')](handleError(_0x122c66,null));};exports[_0x21ac('0x61')]=function(_0x11fa33,_0x455ae6,_0xd96a05){if(_0x11fa33[_0x21ac('0x5e')]['id']){delete _0x11fa33['body']['id'];}return db[_0x21ac('0x45')][_0x21ac('0x5f')]({'where':{'id':_0x11fa33[_0x21ac('0x5c')]['id']}})['then'](handleEntityNotFound(_0x455ae6,null))[_0x21ac('0x23')](function(_0x4d6048){if(_0x4d6048){_0x11fa33[_0x21ac('0x5e')][_0x21ac('0x62')]=_0x4d6048['id'];return db[_0x21ac('0x63')][_0x21ac('0x64')](_0x11fa33[_0x21ac('0x5e')]);}})[_0x21ac('0x23')](respondWithResult(_0x455ae6,null))[_0x21ac('0x2d')](handleError(_0x455ae6,null));};exports[_0x21ac('0x65')]=function(_0x215824,_0x2f953c,_0xe27ab6){var _0x2e0e2c={'raw':![],'where':{}};var _0x174f60={};var _0x3106ba={'count':0x0,'rows':[]};return db[_0x21ac('0x45')]['findOne']({'where':{'id':_0x215824['params']['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x2f953c,null))[_0x21ac('0x23')](function(_0x1793e4){if(_0x1793e4){_0x174f60[_0x21ac('0x47')]=_[_0x21ac('0x48')](db[_0x21ac('0x63')]['rawAttributes']);_0x174f60[_0x21ac('0x49')]=_['keys'](_0x215824[_0x21ac('0x49')]);_0x174f60[_0x21ac('0x4a')]=_[_0x21ac('0x4b')](_0x174f60[_0x21ac('0x47')],_0x174f60[_0x21ac('0x49')]);_0x2e0e2c[_0x21ac('0x4c')]=_['intersection'](_0x174f60['model'],qs[_0x21ac('0x4d')](_0x215824[_0x21ac('0x49')][_0x21ac('0x4d')]));_0x2e0e2c[_0x21ac('0x4c')]=_0x2e0e2c[_0x21ac('0x4c')][_0x21ac('0x4e')]?_0x2e0e2c[_0x21ac('0x4c')]:_0x174f60[_0x21ac('0x47')];if(!_0x215824['query'][_0x21ac('0x4f')](_0x21ac('0x50'))){_0x2e0e2c[_0x21ac('0x31')]=qs[_0x21ac('0x31')](_0x215824[_0x21ac('0x49')][_0x21ac('0x31')]);_0x2e0e2c[_0x21ac('0x30')]=qs['offset'](_0x215824[_0x21ac('0x49')][_0x21ac('0x30')]);}_0x2e0e2c[_0x21ac('0x66')]=qs[_0x21ac('0x51')](_0x215824[_0x21ac('0x49')][_0x21ac('0x51')]);_0x2e0e2c[_0x21ac('0x54')]=qs[_0x21ac('0x4a')](_['pick'](_0x215824[_0x21ac('0x49')],_0x174f60[_0x21ac('0x4a')]));_0x2e0e2c[_0x21ac('0x54')][_0x21ac('0x62')]=_0x1793e4['id'];if(_0x215824[_0x21ac('0x49')]['filter']){_0x2e0e2c[_0x21ac('0x54')]=_[_0x21ac('0x58')](_0x2e0e2c['where'],{'$or':_[_0x21ac('0x55')](_0x2e0e2c[_0x21ac('0x4c')],function(_0x4a36e1){var _0x525faa={};_0x525faa[_0x4a36e1]={'$like':'%'+_0x215824[_0x21ac('0x49')][_0x21ac('0x53')]+'%'};return _0x525faa;})});}_0x2e0e2c=_['merge']({},_0x2e0e2c,_0x215824[_0x21ac('0x67')]);return db[_0x21ac('0x63')][_0x21ac('0x2f')]({'where':_0x2e0e2c['where']})[_0x21ac('0x23')](function(_0x4911de){_0x3106ba['count']=_0x4911de;if(_0x215824[_0x21ac('0x49')][_0x21ac('0x59')]){_0x2e0e2c['include']=[{'all':!![]}];}return db['Disposition'][_0x21ac('0x5b')](_0x2e0e2c);})['then'](function(_0x31b307){_0x3106ba[_0x21ac('0x68')]=_0x31b307;return _0x3106ba;});}})['then'](respondWithFilteredResult(_0x2f953c,_0x2e0e2c))[_0x21ac('0x2d')](handleError(_0x2f953c,null));};exports[_0x21ac('0x69')]=function(_0x2c6a42,_0x39386e,_0x5be067){var _0x17df5b;return db[_0x21ac('0x45')][_0x21ac('0x5f')]({'where':{'id':_0x2c6a42[_0x21ac('0x5c')]['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x39386e,null))['then'](function(_0x5abd9c){if(_0x5abd9c){return _0x5abd9c[_0x21ac('0x69')](_0x2c6a42[_0x21ac('0x49')][_0x21ac('0x6a')]);}})[_0x21ac('0x23')](respondWithStatusCode(_0x39386e,null))[_0x21ac('0x2d')](handleError(_0x39386e,null));};exports[_0x21ac('0x6b')]=function(_0x228191,_0x7774a8,_0x52a91a){if(_0x228191[_0x21ac('0x5e')]['id']){delete _0x228191[_0x21ac('0x5e')]['id'];}return db[_0x21ac('0x45')][_0x21ac('0x5f')]({'where':{'id':_0x228191['params']['id']}})['then'](handleEntityNotFound(_0x7774a8,null))[_0x21ac('0x23')](function(_0x26c95b){if(_0x26c95b){_0x228191['body']['MailAccountId']=_0x26c95b['id'];return db['CannedAnswer'][_0x21ac('0x64')](_0x228191['body']);}})[_0x21ac('0x23')](respondWithResult(_0x7774a8,null))[_0x21ac('0x2d')](handleError(_0x7774a8,null));};exports[_0x21ac('0x6c')]=function(_0x2ca52c,_0x74377c,_0x4261aa){var _0x77bd20={'raw':![],'where':{}};var _0xba8b9a={};var _0xbd8038={'count':0x0,'rows':[]};return db['MailAccount'][_0x21ac('0x6d')]({'where':{'id':_0x2ca52c[_0x21ac('0x5c')]['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x74377c,null))['then'](function(_0x2cfffe){if(_0x2cfffe){_0xba8b9a[_0x21ac('0x47')]=_[_0x21ac('0x48')](db['CannedAnswer']['rawAttributes']);_0xba8b9a['query']=_['keys'](_0x2ca52c[_0x21ac('0x49')]);_0xba8b9a['filters']=_[_0x21ac('0x4b')](_0xba8b9a[_0x21ac('0x47')],_0xba8b9a['query']);_0x77bd20['attributes']=_[_0x21ac('0x4b')](_0xba8b9a[_0x21ac('0x47')],qs[_0x21ac('0x4d')](_0x2ca52c[_0x21ac('0x49')][_0x21ac('0x4d')]));_0x77bd20[_0x21ac('0x4c')]=_0x77bd20[_0x21ac('0x4c')][_0x21ac('0x4e')]?_0x77bd20[_0x21ac('0x4c')]:_0xba8b9a['model'];if(!_0x2ca52c[_0x21ac('0x49')][_0x21ac('0x4f')](_0x21ac('0x50'))){_0x77bd20['limit']=qs[_0x21ac('0x31')](_0x2ca52c[_0x21ac('0x49')][_0x21ac('0x31')]);_0x77bd20['offset']=qs[_0x21ac('0x30')](_0x2ca52c[_0x21ac('0x49')][_0x21ac('0x30')]);}_0x77bd20[_0x21ac('0x66')]=qs[_0x21ac('0x51')](_0x2ca52c[_0x21ac('0x49')][_0x21ac('0x51')]);_0x77bd20['where']=qs['filters'](_[_0x21ac('0x52')](_0x2ca52c['query'],_0xba8b9a[_0x21ac('0x4a')]));_0x77bd20[_0x21ac('0x54')][_0x21ac('0x62')]=_0x2cfffe['id'];if(_0x2ca52c['query'][_0x21ac('0x53')]){_0x77bd20['where']=_[_0x21ac('0x58')](_0x77bd20[_0x21ac('0x54')],{'$or':_['map'](_0x77bd20[_0x21ac('0x4c')],function(_0x558a2d){var _0x3feca0={};_0x3feca0[_0x558a2d]={'$like':'%'+_0x2ca52c[_0x21ac('0x49')][_0x21ac('0x53')]+'%'};return _0x3feca0;})});}_0x77bd20=_[_0x21ac('0x58')]({},_0x77bd20,_0x2ca52c['options']);return db[_0x21ac('0x6e')][_0x21ac('0x2f')]({'where':_0x77bd20['where']})[_0x21ac('0x23')](function(_0x2f86cc){_0xbd8038['count']=_0x2f86cc;if(_0x2ca52c['query']['includeAll']){_0x77bd20[_0x21ac('0x5a')]=[{'all':!![]}];}return db[_0x21ac('0x6e')][_0x21ac('0x5b')](_0x77bd20);})[_0x21ac('0x23')](function(_0x59a178){_0xbd8038[_0x21ac('0x68')]=_0x59a178;return _0xbd8038;});}})['then'](respondWithFilteredResult(_0x74377c,_0x77bd20))[_0x21ac('0x2d')](handleError(_0x74377c,null));};exports[_0x21ac('0x6f')]=function(_0x2a17a8,_0x563f5e,_0x40ded6){var _0x41bb55;return db[_0x21ac('0x45')][_0x21ac('0x5f')]({'where':{'id':_0x2a17a8['params']['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x563f5e,null))[_0x21ac('0x23')](function(_0x2fe546){if(_0x2fe546){return _0x2fe546[_0x21ac('0x6f')](_0x2a17a8[_0x21ac('0x49')][_0x21ac('0x6a')]);}})[_0x21ac('0x23')](respondWithStatusCode(_0x563f5e,null))[_0x21ac('0x2d')](handleError(_0x563f5e,null));};exports[_0x21ac('0x64')]=function(_0x3eeea2,_0x4b0bf9){var _0xfe759d={'name':_0x3eeea2['body'][_0x21ac('0x3d')],'key':_0x3eeea2['body'][_0x21ac('0x70')],'email':_0x3eeea2['body'][_0x21ac('0x71')],'ListId':_0x3eeea2['body']['ListId'],'active':!_['isNil'](_0x3eeea2[_0x21ac('0x5e')][_0x21ac('0x72')])?_0x3eeea2['body'][_0x21ac('0x72')]:!![],'description':_0x3eeea2['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0x21ac('0x73')](_0x3eeea2['body']['cservice'])){if(_0x3eeea2[_0x21ac('0x5e')]['cauthentication']){_0xfe759d[_0x21ac('0x5d')][_0x21ac('0x74')]=_0xfe759d['Smtp'][_0x21ac('0x74')]=_0x3eeea2[_0x21ac('0x5e')]['cuser'];_0xfe759d[_0x21ac('0x5d')]['password']=_0xfe759d[_0x21ac('0x42')][_0x21ac('0x75')]=_0x3eeea2['body']['cpassword'];}else{_0xfe759d[_0x21ac('0x5d')][_0x21ac('0x76')]=_0xfe759d['Smtp'][_0x21ac('0x76')]=![];}_0xfe759d[_0x21ac('0x5d')][_0x21ac('0x77')]=_0x3eeea2['body']['Imap'][_0x21ac('0x77')];_0xfe759d[_0x21ac('0x5d')][_0x21ac('0x78')]=_0x3eeea2[_0x21ac('0x5e')][_0x21ac('0x5d')]['port'];_0xfe759d[_0x21ac('0x42')][_0x21ac('0x77')]=_0x3eeea2[_0x21ac('0x5e')][_0x21ac('0x42')]['host'];_0xfe759d[_0x21ac('0x42')]['port']=_0x3eeea2[_0x21ac('0x5e')][_0x21ac('0x42')]['port'];}else{_0xfe759d[_0x21ac('0x5d')][_0x21ac('0x79')]=_0xfe759d[_0x21ac('0x42')]['service']=_0x3eeea2[_0x21ac('0x5e')][_0x21ac('0x7a')];_0xfe759d[_0x21ac('0x5d')][_0x21ac('0x74')]=_0xfe759d[_0x21ac('0x42')][_0x21ac('0x74')]=_0x3eeea2[_0x21ac('0x5e')][_0x21ac('0x7b')];_0xfe759d[_0x21ac('0x5d')][_0x21ac('0x7c')]=_0xfe759d[_0x21ac('0x42')][_0x21ac('0x75')]=_0x3eeea2[_0x21ac('0x5e')][_0x21ac('0x7d')];}return db[_0x21ac('0x45')][_0x21ac('0x64')](_0xfe759d,{'include':[{'model':db[_0x21ac('0x41')],'as':'Smtp'},{'model':db[_0x21ac('0x40')],'as':_0x21ac('0x5d')}]})['then'](function(_0x561c82){var _0x3b1357=_0x3eeea2[_0x21ac('0x74')][_0x21ac('0x7e')]({'plain':!![]});if(!_0x3b1357)throw new Error(_0x21ac('0x7f'));if(_0x3b1357[_0x21ac('0x80')]===_0x21ac('0x74')){var _0x264138=_0x561c82[_0x21ac('0x7e')]({'plain':!![]});return db[_0x21ac('0x81')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x3b1357[_0x21ac('0x82')]},'raw':!![]})[_0x21ac('0x23')](function(_0x26bc03){if(_0x26bc03&&_0x26bc03['autoAssociation']===0x0){return db[_0x21ac('0x38')][_0x21ac('0x64')]({'name':_0x264138[_0x21ac('0x3d')],'resourceId':_0x264138['id'],'type':_0x26bc03[_0x21ac('0x3d')],'sectionId':_0x26bc03['id']},{})[_0x21ac('0x23')](function(){return _0x561c82;});}else{return _0x561c82;}})[_0x21ac('0x2d')](function(_0x215657){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x215657);throw _0x215657;});}return _0x561c82;})[_0x21ac('0x23')](respondWithResult(_0x4b0bf9,0xc9))[_0x21ac('0x2d')](handleError(_0x4b0bf9,null));};exports['getImap']=function(_0x4fe4a0,_0x202a1a,_0x314e36){return db[_0x21ac('0x45')][_0x21ac('0x6d')]({'where':{'id':_0x4fe4a0[_0x21ac('0x5c')]['id']}})['then'](handleEntityNotFound(_0x202a1a,null))[_0x21ac('0x23')](function(_0xf5e996){if(_0xf5e996){return _0xf5e996['getImap']();}return null;})[_0x21ac('0x23')](respondWithResult(_0x202a1a,null))[_0x21ac('0x2d')](handleError(_0x202a1a,null));};exports['addImap']=function(_0x355195,_0x50e7dc,_0x539bc6){if(_0x355195[_0x21ac('0x5e')]['id']){delete _0x355195[_0x21ac('0x5e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x355195[_0x21ac('0x5c')]['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x50e7dc,null))[_0x21ac('0x23')](function(_0x46f33c){if(_0x46f33c){_0x355195[_0x21ac('0x5e')]['MailAccountId']=_0x46f33c['id'];return db[_0x21ac('0x40')][_0x21ac('0x64')](_0x355195[_0x21ac('0x5e')]);}})[_0x21ac('0x23')](respondWithResult(_0x50e7dc,null))[_0x21ac('0x2d')](handleError(_0x50e7dc,null));};exports['removeImap']=function(_0x3ceb1e,_0x170006,_0x24518a){return db[_0x21ac('0x45')][_0x21ac('0x6d')]({'where':{'id':_0x3ceb1e[_0x21ac('0x5c')]['id']}})['then'](handleEntityNotFound(_0x170006,null))[_0x21ac('0x23')](function(_0x5397ae){if(_0x5397ae){return _0x5397ae[_0x21ac('0x83')](null);}return null;})[_0x21ac('0x23')](respondWithStatusCode(_0x170006,null))[_0x21ac('0x2d')](handleError(_0x170006,null));};exports['getSmtp']=function(_0x2a49fe,_0x7bca93,_0x2adb81){return db[_0x21ac('0x45')][_0x21ac('0x6d')]({'where':{'id':_0x2a49fe[_0x21ac('0x5c')]['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x7bca93,null))[_0x21ac('0x23')](function(_0x541502){if(_0x541502){return _0x541502[_0x21ac('0x84')]();}return null;})[_0x21ac('0x23')](respondWithResult(_0x7bca93,null))['catch'](handleError(_0x7bca93,null));};exports['addSmtp']=function(_0x1d531d,_0x45b567,_0xa988ec){if(_0x1d531d['body']['id']){delete _0x1d531d[_0x21ac('0x5e')]['id'];}return db[_0x21ac('0x45')]['find']({'where':{'id':_0x1d531d[_0x21ac('0x5c')]['id']}})['then'](handleEntityNotFound(_0x45b567,null))[_0x21ac('0x23')](function(_0x2204d2){if(_0x2204d2){_0x1d531d[_0x21ac('0x5e')][_0x21ac('0x62')]=_0x2204d2['id'];return db['MailServerOut'][_0x21ac('0x64')](_0x1d531d[_0x21ac('0x5e')]);}})[_0x21ac('0x23')](respondWithResult(_0x45b567,null))[_0x21ac('0x2d')](handleError(_0x45b567,null));};exports[_0x21ac('0x85')]=function(_0x5dfe21,_0x2c0d76,_0xd7b71e){return db[_0x21ac('0x45')][_0x21ac('0x6d')]({'where':{'id':_0x5dfe21[_0x21ac('0x5c')]['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x2c0d76,null))[_0x21ac('0x23')](function(_0xdb68ba){if(_0xdb68ba){return _0xdb68ba['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x2c0d76,null))[_0x21ac('0x2d')](handleError(_0x2c0d76,null));};exports[_0x21ac('0x86')]=function(_0x456148,_0x718d09,_0x1825fe){return db[_0x21ac('0x87')][_0x21ac('0x5f')]({'where':{'id':_0x456148['params']['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x718d09,null))['then'](function(_0xd98d84){if(_0xd98d84){return _0xd98d84[_0x21ac('0x86')](_0x456148[_0x21ac('0x5e')][_0x21ac('0x6a')],_[_0x21ac('0x88')](_0x456148[_0x21ac('0x5e')],['ids','id'])||{});}})[_0x21ac('0x23')](respondWithResult(_0x718d09,null))['catch'](handleError(_0x718d09,null));};exports['getInteractions']=function(_0x2934ec,_0x3e237f,_0x5fb7ef){var _0x56d092={'raw':![],'where':{}};var _0x1b9914={};var _0x596aab={'count':0x0,'rows':[]};return db[_0x21ac('0x45')][_0x21ac('0x6d')]({'where':{'id':_0x2934ec[_0x21ac('0x5c')]['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x3e237f,null))[_0x21ac('0x23')](function(_0x468384){if(_0x468384){_0x1b9914[_0x21ac('0x47')]=_[_0x21ac('0x48')](db[_0x21ac('0x87')][_0x21ac('0x46')]);_0x1b9914['query']=_[_0x21ac('0x48')](_0x2934ec[_0x21ac('0x49')]);_0x1b9914['filters']=_[_0x21ac('0x4b')](_0x1b9914[_0x21ac('0x47')],_0x1b9914['query']);_0x56d092[_0x21ac('0x4c')]=_[_0x21ac('0x4b')](_0x1b9914[_0x21ac('0x47')],qs[_0x21ac('0x4d')](_0x2934ec[_0x21ac('0x49')][_0x21ac('0x4d')]));_0x56d092[_0x21ac('0x4c')]=_0x56d092[_0x21ac('0x4c')][_0x21ac('0x4e')]?_0x56d092[_0x21ac('0x4c')]:_0x1b9914[_0x21ac('0x47')];if(!_0x2934ec[_0x21ac('0x49')][_0x21ac('0x4f')](_0x21ac('0x50'))){_0x56d092[_0x21ac('0x31')]=qs['limit'](_0x2934ec['query'][_0x21ac('0x31')]);_0x56d092['offset']=qs[_0x21ac('0x30')](_0x2934ec[_0x21ac('0x49')][_0x21ac('0x30')]);}_0x56d092[_0x21ac('0x66')]=qs['sort'](_0x2934ec[_0x21ac('0x49')]['sort']);_0x56d092['where']=qs[_0x21ac('0x4a')](_['pick'](_0x2934ec[_0x21ac('0x49')],_0x1b9914[_0x21ac('0x4a')]));_0x56d092[_0x21ac('0x54')][_0x21ac('0x62')]=_0x468384['id'];if(_0x2934ec[_0x21ac('0x49')][_0x21ac('0x53')]){_0x56d092['where']=_['merge'](_0x56d092[_0x21ac('0x54')],{'$or':_[_0x21ac('0x55')](_0x56d092['attributes'],function(_0x33d309){var _0x3a3ff5={};_0x3a3ff5[_0x33d309]={'$like':'%'+_0x2934ec[_0x21ac('0x49')]['filter']+'%'};return _0x3a3ff5;})});}_0x56d092=_['merge']({},_0x56d092,_0x2934ec[_0x21ac('0x67')]);return db[_0x21ac('0x87')]['count']({'where':_0x56d092[_0x21ac('0x54')]})[_0x21ac('0x23')](function(_0xe05a3f){_0x596aab[_0x21ac('0x2f')]=_0xe05a3f;if(_0x2934ec['query'][_0x21ac('0x59')]){_0x56d092[_0x21ac('0x5a')]=[{'model':db['CmContact'],'as':_0x21ac('0x89'),'required':![]},{'model':db[_0x21ac('0x8a')],'as':_0x21ac('0x8b'),'attributes':[_0x21ac('0x3d'),_0x21ac('0x8c'),_0x21ac('0x8d')],'required':![]},{'model':db[_0x21ac('0x8e')],'as':_0x21ac('0x8f'),'attributes':['id','name',_0x21ac('0x90')],'where':_0x2934ec['query'][_0x21ac('0x91')]?{'id':_0x2934ec[_0x21ac('0x49')]['tag']}:undefined,'required':_0x2934ec[_0x21ac('0x49')][_0x21ac('0x91')]?!![]:![]}];}return db[_0x21ac('0x87')]['findAll'](_0x56d092);})['then'](function(_0x1854b6){_0x596aab[_0x21ac('0x68')]=_0x1854b6;return _0x596aab;});}})['then'](respondWithFilteredResult(_0x3e237f,_0x56d092))[_0x21ac('0x2d')](handleError(_0x3e237f,null));};exports[_0x21ac('0x92')]=function(_0x4af183,_0x5337fa,_0x3b1ce6){return db[_0x21ac('0x45')]['findOne']({'where':{'id':_0x4af183[_0x21ac('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5337fa,null))['then'](function(_0x1ed348){if(_0x1ed348){return db[_0x21ac('0x93')]['transaction'](function(_0x53a516){return db[_0x21ac('0x94')]['destroy']({'where':{'MailAccountId':_0x4af183['params']['id']},'transaction':_0x53a516})[_0x21ac('0x23')](function(_0x337eb7){var _0x4a55c2=_['map'](_0x4af183[_0x21ac('0x5e')],function(_0x447688){_0x447688[_0x21ac('0x62')]=_0x4af183[_0x21ac('0x5c')]['id'];return _0x447688;});return db[_0x21ac('0x94')][_0x21ac('0x95')](_0x4a55c2,{'transaction':_0x53a516});});})[_0x21ac('0x23')](function(){return db[_0x21ac('0x94')]['findAndCountAll']({'where':{'MailAccountId':_0x4af183[_0x21ac('0x5c')]['id']},'order':'priority'});});}})[_0x21ac('0x23')](respondWithResult(_0x5337fa,null))[_0x21ac('0x2d')](handleError(_0x5337fa,null));};exports[_0x21ac('0x96')]=function(_0x42de99,_0x1edc0d,_0xfb0d04){var _0x5446ff={};var _0x4d28fa={};var _0x14b83c;var _0x4bb123;return db['MailAccount']['findOne']({'where':{'id':_0x42de99['params']['id']}})['then'](handleEntityNotFound(_0x1edc0d,null))['then'](function(_0x588023){if(_0x588023){_0x14b83c=_0x588023;_0x4d28fa['model']=_['keys'](db[_0x21ac('0x94')][_0x21ac('0x46')]);_0x4d28fa['query']=_[_0x21ac('0x48')](_0x42de99[_0x21ac('0x49')]);_0x4d28fa['filters']=_['intersection'](_0x4d28fa[_0x21ac('0x47')],_0x4d28fa['query']);_0x5446ff[_0x21ac('0x4c')]=_[_0x21ac('0x4b')](_0x4d28fa[_0x21ac('0x47')],qs[_0x21ac('0x4d')](_0x42de99[_0x21ac('0x49')]['fields']));_0x5446ff[_0x21ac('0x4c')]=_0x5446ff[_0x21ac('0x4c')][_0x21ac('0x4e')]?_0x5446ff[_0x21ac('0x4c')]:_0x4d28fa['model'];_0x5446ff[_0x21ac('0x66')]=qs[_0x21ac('0x51')](_0x42de99[_0x21ac('0x49')][_0x21ac('0x51')]);_0x5446ff[_0x21ac('0x54')]=qs[_0x21ac('0x4a')](_[_0x21ac('0x52')](_0x42de99['query'],_0x4d28fa['filters']));if(_0x42de99[_0x21ac('0x49')][_0x21ac('0x53')]){_0x5446ff[_0x21ac('0x54')]=_['merge'](_0x5446ff[_0x21ac('0x54')],{'$or':_[_0x21ac('0x55')](_0x5446ff['attributes'],function(_0x2f8430){var _0x479a25={};_0x479a25[_0x2f8430]={'$like':'%'+_0x42de99[_0x21ac('0x49')][_0x21ac('0x53')]+'%'};return _0x479a25;})});}_0x5446ff=_[_0x21ac('0x58')]({},_0x5446ff,_0x42de99[_0x21ac('0x67')]);return _0x14b83c['getApplications'](_0x5446ff);}})['then'](function(_0x56fb6d){if(_0x56fb6d){_0x4bb123=_0x56fb6d[_0x21ac('0x4e')];if(!_0x42de99['query']['hasOwnProperty'](_0x21ac('0x50'))){_0x5446ff['limit']=qs[_0x21ac('0x31')](_0x42de99[_0x21ac('0x49')][_0x21ac('0x31')]);_0x5446ff['offset']=qs['offset'](_0x42de99['query']['offset']);}return _0x14b83c[_0x21ac('0x96')](_0x5446ff);}})[_0x21ac('0x23')](function(_0x223567){if(_0x223567){return _0x223567?{'count':_0x4bb123,'rows':_0x223567}:null;}})[_0x21ac('0x23')](respondWithResult(_0x1edc0d,null))[_0x21ac('0x2d')](handleError(_0x1edc0d,null));};exports['getMessages']=function(_0x179908,_0x27deeb,_0x30693f){var _0x4dd9a0={'raw':!![],'where':{}};var _0x168125={};var _0xe1db1b={'count':0x0,'rows':[]};return db['MailAccount'][_0x21ac('0x6d')]({'where':{'id':_0x179908['params']['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x27deeb,null))[_0x21ac('0x23')](function(_0x1f1ea5){if(_0x1f1ea5){_0x168125[_0x21ac('0x47')]=_[_0x21ac('0x48')](db['MailMessage']['rawAttributes']);_0x168125[_0x21ac('0x49')]=_[_0x21ac('0x48')](_0x179908[_0x21ac('0x49')]);_0x168125['filters']=_[_0x21ac('0x4b')](_0x168125[_0x21ac('0x47')],_0x168125[_0x21ac('0x49')]);_0x4dd9a0[_0x21ac('0x4c')]=_[_0x21ac('0x4b')](_0x168125[_0x21ac('0x47')],qs[_0x21ac('0x4d')](_0x179908[_0x21ac('0x49')]['fields']));_0x4dd9a0[_0x21ac('0x4c')]=_0x4dd9a0[_0x21ac('0x4c')][_0x21ac('0x4e')]?_0x4dd9a0[_0x21ac('0x4c')]:_0x168125[_0x21ac('0x47')];if(!_0x179908[_0x21ac('0x49')]['hasOwnProperty']('nolimit')){_0x4dd9a0['limit']=qs[_0x21ac('0x31')](_0x179908[_0x21ac('0x49')][_0x21ac('0x31')]);_0x4dd9a0[_0x21ac('0x30')]=qs[_0x21ac('0x30')](_0x179908[_0x21ac('0x49')][_0x21ac('0x30')]);}_0x4dd9a0[_0x21ac('0x66')]=qs[_0x21ac('0x51')](_0x179908[_0x21ac('0x49')][_0x21ac('0x51')]);_0x4dd9a0[_0x21ac('0x54')]=qs[_0x21ac('0x4a')](_[_0x21ac('0x52')](_0x179908[_0x21ac('0x49')],_0x168125['filters']));_0x4dd9a0[_0x21ac('0x54')][_0x21ac('0x62')]=_0x1f1ea5['id'];if(_0x179908[_0x21ac('0x49')][_0x21ac('0x53')]){_0x4dd9a0[_0x21ac('0x54')]=_[_0x21ac('0x58')](_0x4dd9a0[_0x21ac('0x54')],{'$or':_[_0x21ac('0x55')](_0x4dd9a0['attributes'],function(_0x541486){var _0x6496df={};_0x6496df[_0x541486]={'$like':'%'+_0x179908['query']['filter']+'%'};return _0x6496df;})});}if(_0x179908[_0x21ac('0x49')]['$gte']){var _0x5413ab=_0x179908[_0x21ac('0x49')][_0x21ac('0x97')][_0x21ac('0x98')](',');var _0x5e2255={};_0x5e2255[_0x5413ab[0x0]]={'$gte':moment(_0x5413ab[0x1])[_0x21ac('0x99')](_0x21ac('0x9a'))};_0x4dd9a0[_0x21ac('0x54')]=_[_0x21ac('0x58')](_0x4dd9a0[_0x21ac('0x54')],_0x5e2255);}_0x4dd9a0=_[_0x21ac('0x58')]({},_0x4dd9a0,_0x179908['options']);return db[_0x21ac('0x9b')][_0x21ac('0x2f')]({'where':_0x4dd9a0[_0x21ac('0x54')]})['then'](function(_0x107dd9){_0xe1db1b[_0x21ac('0x2f')]=_0x107dd9;if(_0x179908[_0x21ac('0x49')][_0x21ac('0x59')]){_0x4dd9a0[_0x21ac('0x5a')]=[{'all':!![]}];}return db[_0x21ac('0x9b')][_0x21ac('0x5b')](_0x4dd9a0);})['then'](function(_0x428bf1){_0xe1db1b['rows']=_0x428bf1;return _0xe1db1b;});}})[_0x21ac('0x23')](respondWithFilteredResult(_0x27deeb,_0x4dd9a0))['catch'](handleError(_0x27deeb,null));};exports[_0x21ac('0x3e')]=function(_0x11697a,_0x170aa2,_0x57bb5c){var _0x465d40,_0x4cf663={},_0x50d412;if(_0x11697a[_0x21ac('0x5e')]['to']){_0x50d412=_0x11697a[_0x21ac('0x5e')]['to'][_0x21ac('0x98')](',')[0x0];}return db['MailAccount'][_0x21ac('0x5f')]({'where':{'id':_0x11697a[_0x21ac('0x5c')]['id']},'include':[{'model':db[_0x21ac('0x9c')],'as':_0x21ac('0x9d'),'include':[{'model':db[_0x21ac('0x9e')],'as':_0x21ac('0x9f'),'where':{'email':_0x50d412},'limit':0x1,'order':[[_0x21ac('0xa0'),'DESC']]}]},{'model':db[_0x21ac('0x41')],'as':_0x21ac('0x42'),'raw':!![]}]})[_0x21ac('0x23')](handleEntityNotFound(_0x170aa2,null))['then'](function(_0x3b7ef0){if(_0x3b7ef0){_0x465d40=_0x3b7ef0;if(_0x3b7ef0['Smtp']){if(_['isNil'](_0x11697a[_0x21ac('0x5e')][_0x21ac('0xa1')])){_0x11697a[_0x21ac('0x5e')][_0x21ac('0xa1')]=util[_0x21ac('0x99')](_0x21ac('0xa2'),_0x3b7ef0['name'],_0x3b7ef0[_0x21ac('0x71')]||_0x3b7ef0[_0x21ac('0x42')]['user']);}if(_0x11697a['body'][_0x21ac('0xa3')]&&_0x11697a['body'][_0x21ac('0xa3')][_0x21ac('0x4e')]){for(var _0x101f41=0x0;_0x101f41<_0x11697a[_0x21ac('0x5e')][_0x21ac('0xa3')][_0x21ac('0x4e')];_0x101f41+=0x1){_0x11697a[_0x21ac('0x5e')][_0x21ac('0xa3')][_0x101f41]={'filename':_0x11697a['body'][_0x21ac('0xa3')][_0x101f41]['name'],'path':path[_0x21ac('0xa4')](config['root'],'server/files/attachments',_0x11697a[_0x21ac('0x5e')][_0x21ac('0xa3')][_0x101f41][_0x21ac('0xa5')])};}}var _0x923ac3={'tls':{'rejectUnauthorized':![]}};if(_[_0x21ac('0x73')](_0x3b7ef0[_0x21ac('0x42')][_0x21ac('0x79')])){if(_0x3b7ef0['Smtp'][_0x21ac('0x76')]){_0x923ac3['auth']={'user':_0x3b7ef0[_0x21ac('0x42')][_0x21ac('0x74')],'pass':_0x3b7ef0[_0x21ac('0x42')][_0x21ac('0x75')]};}_0x923ac3[_0x21ac('0x77')]=_0x3b7ef0['Smtp'][_0x21ac('0x77')];_0x923ac3['port']=_0x3b7ef0[_0x21ac('0x42')]['port'];_0x923ac3['secure']=_0x3b7ef0[_0x21ac('0x42')][_0x21ac('0xa6')];}else{_0x923ac3[_0x21ac('0x79')]=_0x3b7ef0[_0x21ac('0x42')][_0x21ac('0x79')];_0x923ac3[_0x21ac('0xa7')]={'user':_0x3b7ef0[_0x21ac('0x42')]['user'],'pass':_0x3b7ef0['Smtp'][_0x21ac('0x75')]};}return respondWithRpcPromise(_0x21ac('0xa8'),_0x21ac('0xa9'),{'account':_0x923ac3,'message':_0x11697a[_0x21ac('0x5e')]});}else{throw new Error(_0x21ac('0xaa'));}}})[_0x21ac('0x23')](function(_0xf9fd2f){if(_0xf9fd2f){_0x4cf663=_0xf9fd2f;if(_0x465d40[_0x21ac('0x9d')]){if(_0x465d40[_0x21ac('0x9d')]['Contacts'][_0x21ac('0x4e')]){return _0x465d40['List']['Contacts'][0x0];}else{return db['CmContact'][_0x21ac('0x64')](_[_0x21ac('0x1b')](_0x11697a[_0x21ac('0x5e')],{'firstName':_0x11697a[_0x21ac('0x5e')]['to'],'email':_0x11697a[_0x21ac('0x5e')]['to'],'phone':_0x11697a['body']['to'],'ListId':_0x465d40[_0x21ac('0xab')]}));}}else{throw new Error(_0x21ac('0xaa'));}}})['then'](function(_0x1ea97b){if(_0x1ea97b){var _0x315a26={'UserId':_0x11697a['user']['id'],'ContactId':_0x1ea97b['id'],'MailAccountId':_0x465d40['id'],'inReplyTo':_0x4cf663[_0x21ac('0xac')],'to':_0x11697a['body'][_0x21ac('0xa1')],'cc':_0x11697a[_0x21ac('0x5e')]['cc'],'subject':_0x11697a['body'][_0x21ac('0xad')],'attach':_0x11697a[_0x21ac('0x5e')][_0x21ac('0xae')],'firstMsgDirection':_0x21ac('0xaf'),'lastMsgAt':moment()[_0x21ac('0x99')](_0x21ac('0x9a')),'lastMsgDirection':_0x21ac('0xaf'),'lastMsgBody':_0x11697a[_0x21ac('0x5e')][_0x21ac('0x5e')],'Messages':[_[_0x21ac('0x58')](_0x11697a['body'],{'messageId':_0x4cf663['messageId'],'sentAt':moment()[_0x21ac('0x99')](_0x21ac('0x9a')),'read':!![],'MailAccountId':_0x465d40['id'],'UserId':_0x11697a[_0x21ac('0x74')]['id'],'ContactId':_0x1ea97b['id']})]};if(_0x11697a[_0x21ac('0x5e')][_0x21ac('0xb0')]){_0x315a26=_[_0x21ac('0x58')](_0x315a26,_0x11697a['body'][_0x21ac('0xb0')]);}return db[_0x21ac('0x87')][_0x21ac('0x64')](_0x315a26,{'include':[{'model':db[_0x21ac('0x9b')],'as':_0x21ac('0xb1')}]});}})[_0x21ac('0x23')](respondWithResult(_0x170aa2,null))[_0x21ac('0x2d')](handleError(_0x170aa2,null));};exports[_0x21ac('0xb2')]=function(_0x4d25fd,_0x19c007,_0x1c62e0){return db[_0x21ac('0x45')][_0x21ac('0x5f')]({'where':{'id':_0x4d25fd[_0x21ac('0x5c')]['id']},'include':[{'model':db[_0x21ac('0x41')],'as':_0x21ac('0x42'),'raw':!![]}]})['then'](handleEntityNotFound(_0x19c007,null))[_0x21ac('0x23')](function(_0xf69659){if(_0xf69659&&_0xf69659[_0x21ac('0x42')]){var _0x506808={'id':_0xf69659['id'],'tls':{'rejectUnauthorized':![]}};if(_0xf69659[_0x21ac('0x42')][_0x21ac('0x79')]){_0x506808['service']=_0xf69659[_0x21ac('0x42')][_0x21ac('0x79')];}else{_0x506808[_0x21ac('0x77')]=_0xf69659['Smtp']['host'];_0x506808[_0x21ac('0x78')]=_0xf69659[_0x21ac('0x42')][_0x21ac('0x78')];_0x506808[_0x21ac('0xa6')]=_0xf69659[_0x21ac('0x42')][_0x21ac('0xa6')];}if(_0xf69659[_0x21ac('0x42')][_0x21ac('0x76')]){_0x506808[_0x21ac('0xa7')]={'user':_0xf69659[_0x21ac('0x42')][_0x21ac('0x74')],'pass':_0xf69659[_0x21ac('0x42')][_0x21ac('0x75')]};}return respondWithRpcPromise(_0x21ac('0xb3'),_0x21ac('0xb2'),{'account':_0x506808});}})['then'](respondWithResult(_0x19c007,null))[_0x21ac('0x2d')](handleError(_0x19c007,null));};exports[_0x21ac('0x39')]=function(_0x491290,_0x594d89){return db[_0x21ac('0x45')][_0x21ac('0x5f')]({'where':{'id':_0x491290[_0x21ac('0x5c')]['id']}})['then'](handleEntityNotFound(_0x594d89,null))[_0x21ac('0x23')](function(_0x503888){if(_0x503888&&_0x503888[_0x21ac('0x79')]){throw new db[(_0x21ac('0xb4'))][(_0x21ac('0xb5'))](_0x21ac('0xb6'));}return _0x503888;})[_0x21ac('0x23')](removeEntity(_0x594d89,null))[_0x21ac('0x2d')](handleError(_0x594d89,null));};exports['addAgents']=function(_0x11ce53,_0x2ca39a,_0x3cc06f){return db[_0x21ac('0x45')][_0x21ac('0x5f')]({'where':{'id':_0x11ce53[_0x21ac('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2ca39a,null))[_0x21ac('0x23')](function(_0x1ffe81){if(_0x1ffe81){return _0x1ffe81[_0x21ac('0xb7')](_0x11ce53[_0x21ac('0x5e')]['ids'],_[_0x21ac('0x88')](_0x11ce53[_0x21ac('0x5e')],[_0x21ac('0x6a'),'id'])||{})['spread'](function(_0x2979cb){for(var _0x234033=0x0;_0x234033<_0x11ce53[_0x21ac('0x5e')][_0x21ac('0x6a')]['length'];_0x234033+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x11ce53['body']['ids'][_0x234033],'MailAccountId':_0x11ce53[_0x21ac('0x5c')]['id']});}return _0x2979cb;});}})[_0x21ac('0x23')](respondWithResult(_0x2ca39a,null))[_0x21ac('0x2d')](handleError(_0x2ca39a,null));};exports[_0x21ac('0xb8')]=function(_0x418650,_0x3b31cb,_0x35a0fc){var _0x1e8680;return db['MailAccount']['find']({'where':{'id':_0x418650[_0x21ac('0x5c')]['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x3b31cb,null))['then'](function(_0x18a362){if(_0x18a362){return _0x18a362[_0x21ac('0xb8')](_0x418650[_0x21ac('0x49')][_0x21ac('0x6a')])[_0x21ac('0x23')](function(_0x2f3df0){if(_[_0x21ac('0xb9')](_0x418650[_0x21ac('0x49')][_0x21ac('0x6a')])){for(var _0x3f1ee9=0x0;_0x3f1ee9<_0x418650[_0x21ac('0x49')]['ids']['length'];_0x3f1ee9+=0x1){socket[_0x21ac('0xba')](_0x21ac('0xbb'),{'UserId':_0x418650[_0x21ac('0x49')][_0x21ac('0x6a')][_0x3f1ee9],'MailAccountId':_0x418650[_0x21ac('0x5c')]['id']});}}else{socket['emit'](_0x21ac('0xbb'),{'UserId':_0x418650[_0x21ac('0x49')]['ids'],'MailAccountId':_0x418650['params']['id']});}});}})['then'](respondWithStatusCode(_0x3b31cb,null))[_0x21ac('0x2d')](handleError(_0x3b31cb,null));};exports[_0x21ac('0xbc')]=function(_0x1d3e37,_0x5e36af,_0x4a0c57){var _0x5f036a={};var _0x554e1a={};var _0x13e7d6;var _0x158d90;return db[_0x21ac('0x45')][_0x21ac('0x6d')]({'where':{'id':_0x1d3e37['params']['id']}})[_0x21ac('0x23')](handleEntityNotFound(_0x5e36af,null))[_0x21ac('0x23')](function(_0x23fbd4){if(_0x23fbd4){_0x13e7d6=_0x23fbd4;_0x554e1a[_0x21ac('0x47')]=_[_0x21ac('0x48')](db[_0x21ac('0x8a')][_0x21ac('0x46')]);_0x554e1a[_0x21ac('0x49')]=_['keys'](_0x1d3e37[_0x21ac('0x49')]);_0x554e1a[_0x21ac('0x4a')]=_[_0x21ac('0x4b')](_0x554e1a[_0x21ac('0x47')],_0x554e1a[_0x21ac('0x49')]);_0x5f036a[_0x21ac('0x4c')]=_[_0x21ac('0x4b')](_0x554e1a['model'],qs[_0x21ac('0x4d')](_0x1d3e37[_0x21ac('0x49')][_0x21ac('0x4d')]));_0x5f036a[_0x21ac('0x4c')]=_0x5f036a[_0x21ac('0x4c')][_0x21ac('0x4e')]?_0x5f036a[_0x21ac('0x4c')]:_0x554e1a['model'];_0x5f036a[_0x21ac('0x66')]=qs[_0x21ac('0x51')](_0x1d3e37[_0x21ac('0x49')][_0x21ac('0x51')]);_0x5f036a[_0x21ac('0x54')]=qs[_0x21ac('0x4a')](_[_0x21ac('0x52')](_0x1d3e37['query'],_0x554e1a[_0x21ac('0x4a')]));if(_0x1d3e37['query'][_0x21ac('0x53')]){_0x5f036a[_0x21ac('0x54')]=_[_0x21ac('0x58')](_0x5f036a['where'],{'$or':_['map'](_0x5f036a[_0x21ac('0x4c')],function(_0x4dc02a){var _0x2f320f={};_0x2f320f[_0x4dc02a]={'$like':'%'+_0x1d3e37[_0x21ac('0x49')][_0x21ac('0x53')]+'%'};return _0x2f320f;})});}_0x5f036a=_[_0x21ac('0x58')]({},_0x5f036a,_0x1d3e37['options']);return _0x13e7d6[_0x21ac('0xbc')](_0x5f036a);}})[_0x21ac('0x23')](function(_0x329261){if(_0x329261){_0x158d90=_0x329261['length'];if(!_0x1d3e37[_0x21ac('0x49')][_0x21ac('0x4f')]('nolimit')){_0x5f036a['limit']=qs[_0x21ac('0x31')](_0x1d3e37[_0x21ac('0x49')]['limit']);_0x5f036a[_0x21ac('0x30')]=qs[_0x21ac('0x30')](_0x1d3e37[_0x21ac('0x49')][_0x21ac('0x30')]);}return _0x13e7d6[_0x21ac('0xbc')](_0x5f036a);}})[_0x21ac('0x23')](function(_0x3097cd){if(_0x3097cd){return _0x3097cd?{'count':_0x158d90,'rows':_0x3097cd}:null;}})[_0x21ac('0x23')](respondWithResult(_0x5e36af,null))[_0x21ac('0x2d')](handleError(_0x5e36af,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5980eab..d9b8540 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 _0x8dfb=['emit','hook','events','MailAccount','save','update'];(function(_0xe2991b,_0x3386ce){var _0x4b13ca=function(_0x35bbc8){while(--_0x35bbc8){_0xe2991b['push'](_0xe2991b['shift']());}};_0x4b13ca(++_0x3386ce);}(_0x8dfb,0x74));var _0xb8df=function(_0x1f4f0b,_0xc6db05){_0x1f4f0b=_0x1f4f0b-0x0;var _0x1be5c2=_0x8dfb[_0x1f4f0b];return _0x1be5c2;};'use strict';var EventEmitter=require(_0xb8df('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xb8df('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8df('0x2'),'afterUpdate':_0xb8df('0x3'),'afterDestroy':'remove'};function emitEvent(_0x9270d9){return function(_0x2619b7,_0x41ca92,_0x3ce71f){MailAccountEvents[_0xb8df('0x4')](_0x9270d9+':'+_0x2619b7['id'],_0x2619b7);MailAccountEvents['emit'](_0x9270d9,_0x2619b7);_0x3ce71f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xb8df('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x9571=['hasOwnProperty','hook','events','../../mysqldb','MailAccount','save','update','remove'];(function(_0x172a4f,_0x555198){var _0x56dc5e=function(_0x2c367f){while(--_0x2c367f){_0x172a4f['push'](_0x172a4f['shift']());}};_0x56dc5e(++_0x555198);}(_0x9571,0x17a));var _0x1957=function(_0x5f1d32,_0x47d03f){_0x5f1d32=_0x5f1d32-0x0;var _0x49145a=_0x9571[_0x5f1d32];return _0x49145a;};'use strict';var EventEmitter=require(_0x1957('0x0'));var MailAccount=require(_0x1957('0x1'))['db'][_0x1957('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1957('0x3'),'afterUpdate':_0x1957('0x4'),'afterDestroy':_0x1957('0x5')};function emitEvent(_0x48dfa9){return function(_0x4c0a45,_0x501642,_0x7bf599){MailAccountEvents['emit'](_0x48dfa9+':'+_0x4c0a45['id'],_0x4c0a45);MailAccountEvents['emit'](_0x48dfa9,_0x4c0a45);_0x7bf599(null);};}for(var e in events){if(events[_0x1957('0x6')](e)){var event=events[e];MailAccount[_0x1957('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 33f2cf2..81d59cb 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 _0x97b9=['lodash','util','api','bluebird','./mailAccount.attributes','exports','MailAccount','mail_accounts'];(function(_0x3caf1f,_0x26d30b){var _0x41cab7=function(_0x4e9580){while(--_0x4e9580){_0x3caf1f['push'](_0x3caf1f['shift']());}};_0x41cab7(++_0x26d30b);}(_0x97b9,0x110));var _0x997b=function(_0x12a843,_0x11ae0f){_0x12a843=_0x12a843-0x0;var _0x50d8e3=_0x97b9[_0x12a843];return _0x50d8e3;};'use strict';var _=require(_0x997b('0x0'));var util=require(_0x997b('0x1'));var logger=require('../../config/logger')(_0x997b('0x2'));var moment=require('moment');var BPromise=require(_0x997b('0x3'));var rp=require('request-promise');var attributes=require(_0x997b('0x4'));module[_0x997b('0x5')]=function(_0x4b90e9,_0xc1fd59){return _0x4b90e9['define'](_0x997b('0x6'),attributes,{'tableName':_0x997b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82e1=['moment','bluebird','request-promise','./mailAccount.attributes','exports','define','mail_accounts','lodash','../../config/logger','api'];(function(_0x342819,_0x47002b){var _0x4b67c1=function(_0x18c51a){while(--_0x18c51a){_0x342819['push'](_0x342819['shift']());}};_0x4b67c1(++_0x47002b);}(_0x82e1,0x13d));var _0x182e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x82e1[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x182e('0x0'));var util=require('util');var logger=require(_0x182e('0x1'))(_0x182e('0x2'));var moment=require(_0x182e('0x3'));var BPromise=require(_0x182e('0x4'));var rp=require(_0x182e('0x5'));var attributes=require(_0x182e('0x6'));module[_0x182e('0x7')]=function(_0x1620bf,_0x111a0f){return _0x1620bf[_0x182e('0x8')]('MailAccount',attributes,{'tableName':_0x182e('0x9'),'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 ccc75ab..960e381 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 _0x4031=['push','close','*,*,*,*','length','defaults','create','List\x20not\x20found','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','created','contact','attachments','originCc','bcc','Attachments','name','UserId','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailAccount','findAll','options','raw','attributes','limit','include','model','map','GetMailAccount','find','where','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','Applications','MailServerOut','List','get','applications','list','orderBy','priority','autoclose'];(function(_0x21bdc8,_0x173f3b){var _0x2b3214=function(_0x2fd19d){while(--_0x2fd19d){_0x21bdc8['push'](_0x21bdc8['shift']());}};_0x2b3214(++_0x173f3b);}(_0x4031,0x1c1));var _0x1403=function(_0x96878d,_0x2de812){_0x96878d=_0x96878d-0x0;var _0x2c6820=_0x4031[_0x96878d];return _0x2c6820;};'use strict';var _=require(_0x1403('0x0'));var util=require(_0x1403('0x1'));var moment=require(_0x1403('0x2'));var BPromise=require(_0x1403('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1403('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1403('0x5'));var logger=require(_0x1403('0x6'))(_0x1403('0x7'));var config=require(_0x1403('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1403('0x9')][_0x1403('0xa')]({'port':0x232c});config[_0x1403('0xb')]=_['defaults'](config['redis'],{'host':_0x1403('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1403('0xb')]));require(_0x1403('0xd'))[_0x1403('0xe')](socket);function respondWithRpcPromise(_0x47a1d1,_0x5f50b4,_0x59f009){return new BPromise(function(_0x5e8f1d,_0x5d428c){return client[_0x1403('0xf')](_0x47a1d1,_0x59f009)[_0x1403('0x10')](function(_0x2696e5){logger[_0x1403('0x11')](_0x1403('0x12'),_0x5f50b4,_0x1403('0x13'));logger[_0x1403('0x14')](_0x1403('0x15'),_0x5f50b4,'request\x20sent',JSON[_0x1403('0x16')](_0x2696e5));if(_0x2696e5[_0x1403('0x17')]){if(_0x2696e5[_0x1403('0x17')]['code']===0x1f4){logger[_0x1403('0x17')](_0x1403('0x12'),_0x5f50b4,_0x2696e5['error'][_0x1403('0x18')]);return _0x5d428c(_0x2696e5[_0x1403('0x17')][_0x1403('0x18')]);}logger[_0x1403('0x17')](_0x1403('0x12'),_0x5f50b4,_0x2696e5[_0x1403('0x17')][_0x1403('0x18')]);return _0x5e8f1d(_0x2696e5[_0x1403('0x17')][_0x1403('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x5f50b4,_0x1403('0x13'));_0x5e8f1d(_0x2696e5[_0x1403('0x19')][_0x1403('0x18')]);}})[_0x1403('0x1a')](function(_0x251021){logger[_0x1403('0x17')](_0x1403('0x12'),_0x5f50b4,_0x251021);_0x5d428c(_0x251021);});});}exports['GetMailAccount']=function(_0xb1cac8){var _0x438003=this;return new Promise(function(_0x144fc6,_0x90acf7){return db[_0x1403('0x1b')][_0x1403('0x1c')]({'raw':_0xb1cac8[_0x1403('0x1d')]?_0xb1cac8[_0x1403('0x1d')][_0x1403('0x1e')]===undefined?!![]:![]:!![],'where':_0xb1cac8['options']?_0xb1cac8[_0x1403('0x1d')]['where']||null:null,'attributes':_0xb1cac8[_0x1403('0x1d')]?_0xb1cac8[_0x1403('0x1d')][_0x1403('0x1f')]||null:null,'limit':_0xb1cac8['options']?_0xb1cac8[_0x1403('0x1d')][_0x1403('0x20')]||null:null,'include':_0xb1cac8[_0x1403('0x1d')]?_0xb1cac8['options'][_0x1403('0x21')]?_['map'](_0xb1cac8[_0x1403('0x1d')][_0x1403('0x21')],function(_0x59e8a6){return{'model':db[_0x59e8a6[_0x1403('0x22')]],'as':_0x59e8a6['as'],'attributes':_0x59e8a6[_0x1403('0x1f')],'include':_0x59e8a6[_0x1403('0x21')]?_[_0x1403('0x23')](_0x59e8a6[_0x1403('0x21')],function(_0x30d6f3){return{'model':db[_0x30d6f3[_0x1403('0x22')]],'as':_0x30d6f3['as'],'attributes':_0x30d6f3[_0x1403('0x1f')],'include':_0x30d6f3[_0x1403('0x21')]?_[_0x1403('0x23')](_0x30d6f3[_0x1403('0x21')],function(_0x369412){return{'model':db[_0x369412['model']],'as':_0x369412['as'],'attributes':_0x369412['attributes']};}):[]};}):[]};}):[]:[]})[_0x1403('0x10')](function(_0x274ed5){logger[_0x1403('0x11')]('GetMailAccount',_0xb1cac8);logger[_0x1403('0x14')](_0x1403('0x24'),_0xb1cac8,JSON['stringify'](_0x274ed5));_0x144fc6(_0x274ed5);})[_0x1403('0x1a')](function(_0x2f27f7){logger['error']('GetMailAccount',_0x2f27f7[_0x1403('0x18')],_0xb1cac8);_0x90acf7(_0x438003['error'](0x1f4,_0x2f27f7[_0x1403('0x18')]));});});};exports['ShowMailAccount']=function(_0x5a73f0){var _0x561228=this;return new Promise(function(_0x39b968,_0x5a3cd0){return db[_0x1403('0x1b')][_0x1403('0x25')]({'raw':_0x5a73f0[_0x1403('0x1d')]?_0x5a73f0[_0x1403('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5a73f0[_0x1403('0x1d')]?_0x5a73f0[_0x1403('0x1d')][_0x1403('0x26')]||null:null,'attributes':_0x5a73f0[_0x1403('0x1d')]?_0x5a73f0['options'][_0x1403('0x1f')]||null:null,'include':_0x5a73f0[_0x1403('0x1d')]?_0x5a73f0[_0x1403('0x1d')]['include']?_['map'](_0x5a73f0[_0x1403('0x1d')]['include'],function(_0x5dd899){return{'model':db[_0x5dd899[_0x1403('0x22')]],'as':_0x5dd899['as'],'attributes':_0x5dd899[_0x1403('0x1f')],'include':_0x5dd899[_0x1403('0x21')]?_['map'](_0x5dd899[_0x1403('0x21')],function(_0x564043){return{'model':db[_0x564043[_0x1403('0x22')]],'as':_0x564043['as'],'attributes':_0x564043['attributes'],'include':_0x564043['include']?_[_0x1403('0x23')](_0x564043['include'],function(_0x1dd283){return{'model':db[_0x1dd283[_0x1403('0x22')]],'as':_0x1dd283['as'],'attributes':_0x1dd283[_0x1403('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1403('0x10')](function(_0x2bc69c){logger[_0x1403('0x11')](_0x1403('0x27'),_0x5a73f0);logger[_0x1403('0x14')](_0x1403('0x27'),_0x5a73f0,JSON[_0x1403('0x16')](_0x2bc69c));_0x39b968(_0x2bc69c);})[_0x1403('0x1a')](function(_0x45e3e1){logger[_0x1403('0x17')]('ShowMailAccount',_0x45e3e1['message'],_0x5a73f0);_0x5a3cd0(_0x561228['error'](0x1f4,_0x45e3e1[_0x1403('0x18')]));});});};exports[_0x1403('0x28')]=function(_0x4d0065){var _0x40b922=this;return new Promise(function(_0x5d27e9,_0x5e4849){var _0x1d391a={'body':_0x4d0065[_0x1403('0x29')],'channel':_0x1403('0x2a')};var _0x2a17c5=_[_0x1403('0x2b')](_[_0x1403('0x2c')](db[_0x1403('0x2d')]['rawAttributes']),[_0x1403('0x2e'),_0x1403('0x2f'),_0x1403('0x30'),_0x1403('0x31')]);var _0x15b156=![];if(_0x4d0065[_0x1403('0x29')]['id']){delete _0x4d0065[_0x1403('0x29')]['id'];}if(_[_0x1403('0x32')](_0x4d0065[_0x1403('0x29')][_0x1403('0x33')])){return _0x5e4849(_0x40b922[_0x1403('0x17')](0x1f4,_0x1403('0x34')));}if(_[_0x1403('0x32')](_0x4d0065[_0x1403('0x29')]['body'])||_0x4d0065[_0x1403('0x29')]['body']===''){return _0x5e4849(_0x40b922[_0x1403('0x17')](0x1f4,_0x1403('0x35')));}if(_[_0x1403('0x32')](_0x4d0065[_0x1403('0x29')]['mapKey'])){return _0x5e4849(_0x40b922['error'](0x1f4,_0x1403('0x36')+_0x2a17c5));}if(!_[_0x1403('0x37')](_0x2a17c5,_0x4d0065[_0x1403('0x29')][_0x1403('0x38')])){return _0x5e4849(_0x40b922[_0x1403('0x17')](0x1f4,_0x1403('0x39')+_0x2a17c5));}var _0x3abeeb={};_0x3abeeb[_0x4d0065[_0x1403('0x29')][_0x1403('0x38')]]=_0x4d0065[_0x1403('0x29')][_0x1403('0x33')];return db['MailAccount'][_0x1403('0x25')]({'where':{'id':_0x4d0065[_0x1403('0x3a')]['id']},'include':[{'model':db[_0x1403('0x3b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x1403('0x3c'),'where':_0x3abeeb,'limit':0x1,'order':[[_0x1403('0x2f'),_0x1403('0x3d')]]}]},{'model':db['MailApplication'],'as':_0x1403('0x3e')},{'model':db[_0x1403('0x3f')],'as':'Smtp'}]})[_0x1403('0x10')](function(_0x4cb483){if(_0x4cb483&&_0x4cb483[_0x1403('0x40')]){var _0x26bcab=_0x4cb483[_0x1403('0x41')]({'plain':!![]});_0x1d391a['account']=_['omit'](_0x26bcab,['Applications','List']);_0x1d391a[_0x1403('0x42')]=_0x26bcab[_0x1403('0x3e')];_0x1d391a[_0x1403('0x43')]=_0x26bcab[_0x1403('0x40')];_0x1d391a[_0x1403('0x42')]=_[_0x1403('0x44')](_0x1d391a['applications'],[_0x1403('0x45')],['asc']);if(_0x1d391a['account']&&_0x1d391a['account'][_0x1403('0x46')]){_0x1d391a[_0x1403('0x42')][_0x1403('0x47')]({'id':0x0,'priority':_0x1d391a[_0x1403('0x42')]['length']+0x1,'app':_0x1403('0x48'),'appdata':_0x1403('0x46'),'interval':_0x1403('0x49')});}if(_0x1d391a[_0x1403('0x3a')][_0x1403('0x3e')]){delete _0x1d391a['account'][_0x1403('0x3e')];}if(_0x1d391a[_0x1403('0x3a')][_0x1403('0x40')]){delete _0x1d391a['account']['List'];}if(_0x26bcab['List'][_0x1403('0x3c')][_0x1403('0x4a')]){return _0x26bcab[_0x1403('0x40')][_0x1403('0x3c')][0x0];}var _0x2a1f43=_[_0x1403('0x4b')](_0x4d0065[_0x1403('0x29')],{'firstName':_0x4d0065[_0x1403('0x29')][_0x1403('0x33')],'ListId':_0x26bcab['ListId']});_0x2a1f43[_0x4d0065[_0x1403('0x29')][_0x1403('0x38')]]=_0x4d0065[_0x1403('0x29')][_0x1403('0x33')];return db[_0x1403('0x2d')][_0x1403('0x4c')](_0x2a1f43);}else{throw new Error(_0x1403('0x4d'));}})[_0x1403('0x10')](function(_0x393f29){_0x1d391a['contact']=_0x393f29;if(_0x393f29){if(!_0x4d0065['body']['message'][_0x1403('0x4e')]){_0x4d0065[_0x1403('0x29')][_0x1403('0x18')]['messageId']=rs[_0x1403('0x4f')]()+'\x20'+_0x4d0065[_0x1403('0x29')][_0x1403('0x18')][_0x1403('0x33')];}var _0x28176c={'ContactId':_0x393f29['id'],'MailAccountId':_0x4d0065[_0x1403('0x3a')]['id'],'inReplyTo':_0x4d0065[_0x1403('0x29')][_0x1403('0x18')][_0x1403('0x4e')],'to':_0x4d0065[_0x1403('0x29')][_0x1403('0x18')][_0x1403('0x33')],'cc':_0x4d0065['body']['message']['cc'],'subject':_0x4d0065['body'][_0x1403('0x18')][_0x1403('0x50')],'attach':_0x4d0065['body']['message'][_0x1403('0x51')],'lastMsgAt':moment()['format'](_0x1403('0x52')),'lastMsgDirection':'in','lastMsgBody':_0x4d0065[_0x1403('0x29')][_0x1403('0x29')]};return db[_0x1403('0x53')][_0x1403('0x25')]({'where':{'closed':![],'MailAccountId':_0x4d0065[_0x1403('0x3a')]['id']},'include':[{'model':db[_0x1403('0x54')],'as':_0x1403('0x55'),'attributes':[_0x1403('0x4e')],'where':{'messageId':_0x4d0065[_0x1403('0x29')][_0x1403('0x18')][_0x1403('0x56')]}}]})['then'](function(_0x4cd97e){if(_0x4cd97e){return[_0x4cd97e,![]];}return db[_0x1403('0x53')][_0x1403('0x4c')](_0x28176c)['then'](function(_0x432821){return[_0x432821,!![]];});});}else{throw new Error(_0x1403('0x57'));}})[_0x1403('0x58')](function(_0x20bf72,_0x36a97e){if(_0x20bf72){_0x15b156=_0x36a97e;if(!_0x36a97e){return _0x20bf72[_0x1403('0x59')]({'inReplyTo':_0x4d0065['body'][_0x1403('0x18')][_0x1403('0x4e')],'to':_0x4d0065[_0x1403('0x29')]['message'][_0x1403('0x33')],'cc':_0x4d0065[_0x1403('0x29')][_0x1403('0x18')]['cc'],'subject':_0x4d0065['body'][_0x1403('0x18')][_0x1403('0x50')],'attach':_0x20bf72[_0x1403('0x51')]?_0x20bf72[_0x1403('0x51')]:_0x4d0065[_0x1403('0x29')][_0x1403('0x18')][_0x1403('0x51')],'substatus':null,'substatusAt':moment()[_0x1403('0x5a')](_0x1403('0x52')),'lastMsgAt':moment()[_0x1403('0x5a')](_0x1403('0x52')),'lastMsgDirection':'in','lastMsgBody':_0x4d0065[_0x1403('0x29')][_0x1403('0x29')]});}else{return _0x20bf72;}}})[_0x1403('0x10')](function(_0x2441b4){_0x1d391a['interaction']=_0x2441b4[_0x1403('0x41')]({'plain':!![]});_0x1d391a[_0x1403('0x5b')][_0x1403('0x5c')]=_0x15b156;return db[_0x1403('0x54')][_0x1403('0x4c')]({'body':_0x4d0065[_0x1403('0x29')][_0x1403('0x29')],'MailAccountId':_0x4d0065[_0x1403('0x3a')]['id'],'MailInteractionId':_0x2441b4['id'],'direction':'in','ContactId':_0x1d391a[_0x1403('0x5d')]['id'],'messageId':_0x4d0065[_0x1403('0x29')][_0x1403('0x18')][_0x1403('0x4e')],'from':_0x4d0065[_0x1403('0x29')][_0x1403('0x18')]['from'],'to':_0x4d0065[_0x1403('0x29')]['message']['to'],'cc':_0x4d0065[_0x1403('0x29')]['message']['cc'],'subject':_0x4d0065['body']['message'][_0x1403('0x50')],'attach':_0x4d0065[_0x1403('0x29')][_0x1403('0x18')][_0x1403('0x51')],'Attachments':_0x4d0065[_0x1403('0x29')]['message'][_0x1403('0x5e')],'originTo':_0x4d0065[_0x1403('0x29')][_0x1403('0x18')]['originTo'],'originCc':_0x4d0065['body'][_0x1403('0x18')][_0x1403('0x5f')],'bcc':_0x4d0065[_0x1403('0x29')]['message'][_0x1403('0x60')]},{'include':[{'model':db['Attachment'],'as':_0x1403('0x61')}]});})[_0x1403('0x10')](function(_0x2c9319){_0x1d391a[_0x1403('0x18')]=_0x2c9319;if(_0x1d391a[_0x1403('0x5b')]['UserId']){return db['User'][_0x1403('0x25')]({'attributes':['id',_0x1403('0x62')],'where':{'id':_0x1d391a[_0x1403('0x5b')][_0x1403('0x63')]}})[_0x1403('0x10')](function(_0x8aa9e8){if(_0x8aa9e8){_0x1d391a[_0x1403('0x42')][_0x1403('0x64')]({'id':0x0,'priority':0x0,'app':_0x1403('0x65'),'appdata':_0x8aa9e8[_0x1403('0x62')]+','+(_0x1d391a[_0x1403('0x3a')]['waitForTheAssignedAgent']||0xa),'interval':_0x1403('0x49')});}return respondWithRpcPromise(_0x1403('0x66'),'startRouting',_0x1d391a);});}return respondWithRpcPromise(_0x1403('0x66'),_0x1403('0x67'),_0x1d391a);})[_0x1403('0x10')](function(_0xda8037){_0x5d27e9(_0xda8037);})[_0x1403('0x1a')](function(_0xe28a97){_0x5e4849(_0x40b922[_0x1403('0x17')](0x1f4,_0xe28a97['message']));});});}; \ No newline at end of file +var _0x38ba=['subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','Contact\x20not\x20found','update','interaction','created','MailMessage','contact','attachments','Attachment','UserId','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','MailAccount','findAll','options','raw','attributes','limit','map','include','model','GetMailAccount','ShowMailAccount','find','where','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','Contacts','DESC','MailApplication','Applications','MailServerOut','get','omit','List','applications','orderBy','priority','asc','autoclose','length','close','*,*,*,*','create','messageId','generate'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0x38ba,0xd4));var _0xa38b=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x38ba[_0x2a0183];return _0x158c3a;};'use strict';var _=require(_0xa38b('0x0'));var util=require(_0xa38b('0x1'));var moment=require(_0xa38b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa38b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa38b('0x4'))['db'];var utils=require(_0xa38b('0x5'));var logger=require('../../config/logger')(_0xa38b('0x6'));var config=require('../../config/environment');var jayson=require(_0xa38b('0x7'));var client=jayson[_0xa38b('0x8')][_0xa38b('0x9')]({'port':0x232c});config[_0xa38b('0xa')]=_['defaults'](config[_0xa38b('0xa')],{'host':_0xa38b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa38b('0xa')]));require(_0xa38b('0xc'))['register'](socket);function respondWithRpcPromise(_0x41d04b,_0x4b8ccb,_0x4ee202){return new BPromise(function(_0x180509,_0x1ebd5e){return client[_0xa38b('0xd')](_0x41d04b,_0x4ee202)[_0xa38b('0xe')](function(_0x3a0369){logger[_0xa38b('0xf')](_0xa38b('0x10'),_0x4b8ccb,_0xa38b('0x11'));logger[_0xa38b('0x12')](_0xa38b('0x13'),_0x4b8ccb,'request\x20sent',JSON[_0xa38b('0x14')](_0x3a0369));if(_0x3a0369[_0xa38b('0x15')]){if(_0x3a0369[_0xa38b('0x15')][_0xa38b('0x16')]===0x1f4){logger['error'](_0xa38b('0x10'),_0x4b8ccb,_0x3a0369[_0xa38b('0x15')]['message']);return _0x1ebd5e(_0x3a0369[_0xa38b('0x15')]['message']);}logger[_0xa38b('0x15')](_0xa38b('0x10'),_0x4b8ccb,_0x3a0369['error']['message']);return _0x180509(_0x3a0369['error']['message']);}else{logger['info'](_0xa38b('0x10'),_0x4b8ccb,'request\x20sent');_0x180509(_0x3a0369[_0xa38b('0x17')][_0xa38b('0x18')]);}})[_0xa38b('0x19')](function(_0x17d188){logger[_0xa38b('0x15')](_0xa38b('0x10'),_0x4b8ccb,_0x17d188);_0x1ebd5e(_0x17d188);});});}exports['GetMailAccount']=function(_0x3a8d41){var _0x487d9e=this;return new Promise(function(_0x303f06,_0x12523b){return db[_0xa38b('0x1a')][_0xa38b('0x1b')]({'raw':_0x3a8d41[_0xa38b('0x1c')]?_0x3a8d41['options'][_0xa38b('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a8d41[_0xa38b('0x1c')]?_0x3a8d41[_0xa38b('0x1c')]['where']||null:null,'attributes':_0x3a8d41[_0xa38b('0x1c')]?_0x3a8d41[_0xa38b('0x1c')][_0xa38b('0x1e')]||null:null,'limit':_0x3a8d41['options']?_0x3a8d41['options'][_0xa38b('0x1f')]||null:null,'include':_0x3a8d41[_0xa38b('0x1c')]?_0x3a8d41['options']['include']?_[_0xa38b('0x20')](_0x3a8d41[_0xa38b('0x1c')][_0xa38b('0x21')],function(_0x5c75bd){return{'model':db[_0x5c75bd['model']],'as':_0x5c75bd['as'],'attributes':_0x5c75bd[_0xa38b('0x1e')],'include':_0x5c75bd['include']?_[_0xa38b('0x20')](_0x5c75bd[_0xa38b('0x21')],function(_0xb9bcbc){return{'model':db[_0xb9bcbc[_0xa38b('0x22')]],'as':_0xb9bcbc['as'],'attributes':_0xb9bcbc[_0xa38b('0x1e')],'include':_0xb9bcbc['include']?_['map'](_0xb9bcbc['include'],function(_0x103e39){return{'model':db[_0x103e39[_0xa38b('0x22')]],'as':_0x103e39['as'],'attributes':_0x103e39[_0xa38b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3aef0b){logger[_0xa38b('0xf')](_0xa38b('0x23'),_0x3a8d41);logger[_0xa38b('0x12')](_0xa38b('0x23'),_0x3a8d41,JSON[_0xa38b('0x14')](_0x3aef0b));_0x303f06(_0x3aef0b);})[_0xa38b('0x19')](function(_0x16b55a){logger[_0xa38b('0x15')](_0xa38b('0x23'),_0x16b55a[_0xa38b('0x18')],_0x3a8d41);_0x12523b(_0x487d9e['error'](0x1f4,_0x16b55a['message']));});});};exports[_0xa38b('0x24')]=function(_0x3f041e){var _0x3e2e70=this;return new Promise(function(_0x41e56b,_0x53c688){return db['MailAccount'][_0xa38b('0x25')]({'raw':_0x3f041e[_0xa38b('0x1c')]?_0x3f041e[_0xa38b('0x1c')][_0xa38b('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f041e['options']?_0x3f041e[_0xa38b('0x1c')][_0xa38b('0x26')]||null:null,'attributes':_0x3f041e[_0xa38b('0x1c')]?_0x3f041e[_0xa38b('0x1c')]['attributes']||null:null,'include':_0x3f041e['options']?_0x3f041e[_0xa38b('0x1c')]['include']?_['map'](_0x3f041e['options']['include'],function(_0x49c5fc){return{'model':db[_0x49c5fc[_0xa38b('0x22')]],'as':_0x49c5fc['as'],'attributes':_0x49c5fc[_0xa38b('0x1e')],'include':_0x49c5fc[_0xa38b('0x21')]?_['map'](_0x49c5fc[_0xa38b('0x21')],function(_0x31abe4){return{'model':db[_0x31abe4[_0xa38b('0x22')]],'as':_0x31abe4['as'],'attributes':_0x31abe4[_0xa38b('0x1e')],'include':_0x31abe4[_0xa38b('0x21')]?_[_0xa38b('0x20')](_0x31abe4[_0xa38b('0x21')],function(_0x43954b){return{'model':db[_0x43954b[_0xa38b('0x22')]],'as':_0x43954b['as'],'attributes':_0x43954b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa38b('0xe')](function(_0x2ce959){logger[_0xa38b('0xf')](_0xa38b('0x24'),_0x3f041e);logger['debug'](_0xa38b('0x24'),_0x3f041e,JSON[_0xa38b('0x14')](_0x2ce959));_0x41e56b(_0x2ce959);})[_0xa38b('0x19')](function(_0x500d08){logger[_0xa38b('0x15')](_0xa38b('0x24'),_0x500d08['message'],_0x3f041e);_0x53c688(_0x3e2e70[_0xa38b('0x15')](0x1f4,_0x500d08['message']));});});};exports[_0xa38b('0x27')]=function(_0x52eee9){var _0x19626e=this;return new Promise(function(_0x29fdc9,_0x3fb18a){var _0x286a9b={'body':_0x52eee9[_0xa38b('0x28')],'channel':_0xa38b('0x29')};var _0x2e4a90=_[_0xa38b('0x2a')](_['keys'](db[_0xa38b('0x2b')][_0xa38b('0x2c')]),[_0xa38b('0x2d'),_0xa38b('0x2e'),_0xa38b('0x2f'),_0xa38b('0x30')]);var _0x55ede4=![];if(_0x52eee9['body']['id']){delete _0x52eee9['body']['id'];}if(_[_0xa38b('0x31')](_0x52eee9[_0xa38b('0x28')][_0xa38b('0x32')])){return _0x3fb18a(_0x19626e[_0xa38b('0x15')](0x1f4,_0xa38b('0x33')));}if(_['isNil'](_0x52eee9[_0xa38b('0x28')][_0xa38b('0x28')])||_0x52eee9[_0xa38b('0x28')][_0xa38b('0x28')]===''){return _0x3fb18a(_0x19626e[_0xa38b('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa38b('0x31')](_0x52eee9[_0xa38b('0x28')][_0xa38b('0x34')])){return _0x3fb18a(_0x19626e['error'](0x1f4,_0xa38b('0x35')+_0x2e4a90));}if(!_[_0xa38b('0x36')](_0x2e4a90,_0x52eee9[_0xa38b('0x28')][_0xa38b('0x34')])){return _0x3fb18a(_0x19626e['error'](0x1f4,_0xa38b('0x37')+_0x2e4a90));}var _0x1c57ad={};_0x1c57ad[_0x52eee9[_0xa38b('0x28')]['mapKey']]=_0x52eee9[_0xa38b('0x28')]['from'];return db[_0xa38b('0x1a')][_0xa38b('0x25')]({'where':{'id':_0x52eee9[_0xa38b('0x38')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xa38b('0x39'),'where':_0x1c57ad,'limit':0x1,'order':[[_0xa38b('0x2e'),_0xa38b('0x3a')]]}]},{'model':db[_0xa38b('0x3b')],'as':_0xa38b('0x3c')},{'model':db[_0xa38b('0x3d')],'as':'Smtp'}]})[_0xa38b('0xe')](function(_0x109f29){if(_0x109f29&&_0x109f29['List']){var _0x56a79d=_0x109f29[_0xa38b('0x3e')]({'plain':!![]});_0x286a9b[_0xa38b('0x38')]=_[_0xa38b('0x3f')](_0x56a79d,[_0xa38b('0x3c'),_0xa38b('0x40')]);_0x286a9b[_0xa38b('0x41')]=_0x56a79d[_0xa38b('0x3c')];_0x286a9b['list']=_0x56a79d['List'];_0x286a9b[_0xa38b('0x41')]=_[_0xa38b('0x42')](_0x286a9b[_0xa38b('0x41')],[_0xa38b('0x43')],[_0xa38b('0x44')]);if(_0x286a9b[_0xa38b('0x38')]&&_0x286a9b[_0xa38b('0x38')][_0xa38b('0x45')]){_0x286a9b[_0xa38b('0x41')]['push']({'id':0x0,'priority':_0x286a9b['applications'][_0xa38b('0x46')]+0x1,'app':_0xa38b('0x47'),'appdata':'autoclose','interval':_0xa38b('0x48')});}if(_0x286a9b[_0xa38b('0x38')][_0xa38b('0x3c')]){delete _0x286a9b[_0xa38b('0x38')][_0xa38b('0x3c')];}if(_0x286a9b[_0xa38b('0x38')][_0xa38b('0x40')]){delete _0x286a9b[_0xa38b('0x38')][_0xa38b('0x40')];}if(_0x56a79d[_0xa38b('0x40')][_0xa38b('0x39')]['length']){return _0x56a79d[_0xa38b('0x40')][_0xa38b('0x39')][0x0];}var _0x436f11=_['defaults'](_0x52eee9[_0xa38b('0x28')],{'firstName':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x32')],'ListId':_0x56a79d[_0xa38b('0x30')]});_0x436f11[_0x52eee9['body']['mapKey']]=_0x52eee9['body'][_0xa38b('0x32')];return db[_0xa38b('0x2b')][_0xa38b('0x49')](_0x436f11);}else{throw new Error('List\x20not\x20found');}})[_0xa38b('0xe')](function(_0x2f83fc){_0x286a9b['contact']=_0x2f83fc;if(_0x2f83fc){if(!_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x4a')]){_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['messageId']=rs[_0xa38b('0x4b')]()+'\x20'+_0x52eee9[_0xa38b('0x28')]['message'][_0xa38b('0x32')];}var _0x407054={'ContactId':_0x2f83fc['id'],'MailAccountId':_0x52eee9[_0xa38b('0x38')]['id'],'inReplyTo':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['messageId'],'to':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['from'],'cc':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['cc'],'subject':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x4c')],'attach':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x4d')],'lastMsgAt':moment()[_0xa38b('0x4e')](_0xa38b('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x28')]};return db[_0xa38b('0x50')]['find']({'where':{'closed':![],'MailAccountId':_0x52eee9['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xa38b('0x51'),'attributes':[_0xa38b('0x4a')],'where':{'messageId':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['inReplyTo']}}]})[_0xa38b('0xe')](function(_0x1b677f){if(_0x1b677f){return[_0x1b677f,![]];}return db[_0xa38b('0x50')][_0xa38b('0x49')](_0x407054)[_0xa38b('0xe')](function(_0x4445ae){return[_0x4445ae,!![]];});});}else{throw new Error(_0xa38b('0x52'));}})['spread'](function(_0x289331,_0x1c5a4d){if(_0x289331){_0x55ede4=_0x1c5a4d;if(!_0x1c5a4d){return _0x289331[_0xa38b('0x53')]({'inReplyTo':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x4a')],'to':_0x52eee9['body'][_0xa38b('0x18')]['from'],'cc':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['cc'],'subject':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x4c')],'attach':_0x289331[_0xa38b('0x4d')]?_0x289331[_0xa38b('0x4d')]:_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0xa38b('0x4e')](_0xa38b('0x4f')),'lastMsgAt':moment()[_0xa38b('0x4e')](_0xa38b('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x28')]});}else{return _0x289331;}}})[_0xa38b('0xe')](function(_0x5ec53d){_0x286a9b[_0xa38b('0x54')]=_0x5ec53d[_0xa38b('0x3e')]({'plain':!![]});_0x286a9b['interaction'][_0xa38b('0x55')]=_0x55ede4;return db[_0xa38b('0x56')]['create']({'body':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x28')],'MailAccountId':_0x52eee9['account']['id'],'MailInteractionId':_0x5ec53d['id'],'direction':'in','ContactId':_0x286a9b[_0xa38b('0x57')]['id'],'messageId':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x4a')],'from':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x32')],'to':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['to'],'cc':_0x52eee9['body'][_0xa38b('0x18')]['cc'],'subject':_0x52eee9[_0xa38b('0x28')]['message']['subject'],'attach':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x4d')],'Attachments':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')][_0xa38b('0x58')],'originTo':_0x52eee9['body'][_0xa38b('0x18')]['originTo'],'originCc':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['originCc'],'bcc':_0x52eee9[_0xa38b('0x28')][_0xa38b('0x18')]['bcc']},{'include':[{'model':db[_0xa38b('0x59')],'as':'Attachments'}]});})[_0xa38b('0xe')](function(_0x120c67){_0x286a9b[_0xa38b('0x18')]=_0x120c67;if(_0x286a9b[_0xa38b('0x54')][_0xa38b('0x5a')]){return db['User'][_0xa38b('0x25')]({'attributes':['id',_0xa38b('0x5b')],'where':{'id':_0x286a9b['interaction']['UserId']}})[_0xa38b('0xe')](function(_0x277b44){if(_0x277b44){_0x286a9b[_0xa38b('0x41')][_0xa38b('0x5c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x277b44[_0xa38b('0x5b')]+','+(_0x286a9b[_0xa38b('0x38')][_0xa38b('0x5d')]||0xa),'interval':_0xa38b('0x48')});}return respondWithRpcPromise(_0xa38b('0x5e'),_0xa38b('0x5f'),_0x286a9b);});}return respondWithRpcPromise(_0xa38b('0x5e'),_0xa38b('0x5f'),_0x286a9b);})[_0xa38b('0xe')](function(_0x4ed20d){_0x29fdc9(_0x4ed20d);})[_0xa38b('0x19')](function(_0x23a745){_0x3fb18a(_0x19626e[_0xa38b('0x15')](0x1f4,_0x23a745['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 41a6df2..cb47d36 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 _0x64a6=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x568363,_0x2e79a7){var _0x47f0ed=function(_0x7d922b){while(--_0x7d922b){_0x568363['push'](_0x568363['shift']());}};_0x47f0ed(++_0x2e79a7);}(_0x64a6,0x76));var _0x664a=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x64a6[_0x413feb];return _0x40ee88;};'use strict';var MailAccountEvents=require(_0x664a('0x0'));var events=['save','remove',_0x664a('0x1')];function createListener(_0x541505,_0x55c40b){return function(_0xf18960){_0x55c40b[_0x664a('0x2')](_0x541505,_0xf18960);};}function removeListener(_0x886063,_0x39d1ca){return function(){MailAccountEvents[_0x664a('0x3')](_0x886063,_0x39d1ca);};}exports[_0x664a('0x4')]=function(_0x40a7c9){for(var _0x2ca027=0x0,_0x49f223=events[_0x664a('0x5')];_0x2ca027<_0x49f223;_0x2ca027++){var _0xff04d5=events[_0x2ca027];var _0x44ed9e=createListener(_0x664a('0x6')+_0xff04d5,_0x40a7c9);MailAccountEvents['on'](_0xff04d5,_0x44ed9e);}}; \ No newline at end of file +var _0xb3c3=['removeListener','length','mailAccount:','save','emit'];(function(_0x393edc,_0x1052cc){var _0x6295ef=function(_0x553dfe){while(--_0x553dfe){_0x393edc['push'](_0x393edc['shift']());}};_0x6295ef(++_0x1052cc);}(_0xb3c3,0x161));var _0x3b3c=function(_0x5cae25,_0x421bac){_0x5cae25=_0x5cae25-0x0;var _0x1972d0=_0xb3c3[_0x5cae25];return _0x1972d0;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x3b3c('0x0'),'remove','update'];function createListener(_0x394485,_0x10939f){return function(_0x160993){_0x10939f[_0x3b3c('0x1')](_0x394485,_0x160993);};}function removeListener(_0x2a3cbd,_0x3f9438){return function(){MailAccountEvents[_0x3b3c('0x2')](_0x2a3cbd,_0x3f9438);};}exports['register']=function(_0x2a61a3){for(var _0x13f4d7=0x0,_0xe00608=events[_0x3b3c('0x3')];_0x13f4d7<_0xe00608;_0x13f4d7++){var _0x5b6b8d=events[_0x13f4d7];var _0x54b61c=createListener(_0x3b3c('0x4')+_0x5b6b8d,_0x2a61a3);MailAccountEvents['on'](_0x5b6b8d,_0x54b61c);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2f92566..c8bf191 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 _0x9aea=['Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','update','delete','isAuthenticated','destroy','exports','multer','path','express'];(function(_0x3e5e34,_0xc22f9d){var _0x16999e=function(_0xf0c3be){while(--_0xf0c3be){_0x3e5e34['push'](_0x3e5e34['shift']());}};_0x16999e(++_0xc22f9d);}(_0x9aea,0xdd));var _0xa9ae=function(_0x506569,_0x423fe7){_0x506569=_0x506569-0x0;var _0x50a14c=_0x9aea[_0x506569];return _0x50a14c;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express[_0xa9ae('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa9ae('0x4'));var config=require(_0xa9ae('0x5'));var controller=require(_0xa9ae('0x6'));router[_0xa9ae('0x7')](_0xa9ae('0x8'),auth['isAuthenticated'](),controller[_0xa9ae('0x9')]);router[_0xa9ae('0xa')](_0xa9ae('0x8'),auth['isAuthenticated'](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0xc')](_0xa9ae('0x8'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0xe')]);module[_0xa9ae('0xf')]=router; \ No newline at end of file +var _0x22fb=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','path','express','Router'];(function(_0x1f1305,_0x2435f5){var _0x571a9d=function(_0x411dfc){while(--_0x411dfc){_0x1f1305['push'](_0x1f1305['shift']());}};_0x571a9d(++_0x2435f5);}(_0x22fb,0x192));var _0xb22f=function(_0x17dff1,_0x309649){_0x17dff1=_0x17dff1-0x0;var _0x4b60dc=_0x22fb[_0x17dff1];return _0x4b60dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var auth=require(_0xb22f('0x3'));var interaction=require(_0xb22f('0x4'));var config=require(_0xb22f('0x5'));var controller=require('./mailApplication.controller');router[_0xb22f('0x6')](_0xb22f('0x7'),auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0xa')](_0xb22f('0x7'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0xc')](_0xb22f('0x7'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);module[_0xb22f('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 4259ddd..78f9c72 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 _0xf9b7=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x20ecaf,_0x264364){var _0x2cbaf3=function(_0x1793ff){while(--_0x1793ff){_0x20ecaf['push'](_0x20ecaf['shift']());}};_0x2cbaf3(++_0x264364);}(_0xf9b7,0x91));var _0x7f9b=function(_0x367db5,_0x435a3a){_0x367db5=_0x367db5-0x0;var _0x23aee8=_0xf9b7[_0x367db5];return _0x23aee8;};'use strict';var Sequelize=require(_0x7f9b('0x0'));module[_0x7f9b('0x1')]={'priority':{'type':Sequelize[_0x7f9b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7f9b('0x3')],'allowNull':![],'defaultValue':_0x7f9b('0x4')},'appdata':{'type':Sequelize[_0x7f9b('0x5')]()},'description':{'type':Sequelize[_0x7f9b('0x3')]},'interval':{'type':Sequelize[_0x7f9b('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xfca0=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x498c78,_0x2eab48){var _0xb7697f=function(_0x1f6da7){while(--_0x1f6da7){_0x498c78['push'](_0x498c78['shift']());}};_0xb7697f(++_0x2eab48);}(_0xfca0,0x171));var _0x0fca=function(_0x3a9e02,_0x18f2d4){_0x3a9e02=_0x3a9e02-0x0;var _0x10e7d2=_0xfca0[_0x3a9e02];return _0x10e7d2;};'use strict';var Sequelize=require(_0x0fca('0x0'));module[_0x0fca('0x1')]={'priority':{'type':Sequelize[_0x0fca('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0fca('0x3')],'allowNull':![],'defaultValue':_0x0fca('0x4')},'appdata':{'type':Sequelize[_0x0fca('0x5')]()},'description':{'type':Sequelize[_0x0fca('0x3')]},'interval':{'type':Sequelize[_0x0fca('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 cda7352..f183b98 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 _0xa9e0=['Content-Range','apply','reject','save','then','error','stack','send','show','params','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','find','catch','body','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x227bfd,_0x17045b){var _0xdc1fed=function(_0x226979){while(--_0x226979){_0x227bfd['push'](_0x227bfd['shift']());}};_0xdc1fed(++_0x17045b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=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={'raw':!![],'where':{'id':_0x33161b[_0x0a9e('0x24')]['id']}},_0x479bc4={};_0x479bc4['model']=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x25')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['model'],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2b')]=_[_0x0a9e('0x2a')](_0x479bc4[_0x0a9e('0x2c')],qs['fields'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2b')]=_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x2e')]?_0x384319[_0x0a9e('0x2b')]:_0x479bc4[_0x0a9e('0x2c')];if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2f')]){_0x384319['include']=[{'all':!![]}];}_0x384319=_[_0x0a9e('0x30')]({},_0x384319,_0x33161b['options']);return db[_0x0a9e('0x26')][_0x0a9e('0x31')](_0x384319)[_0x0a9e('0x1f')](handleEntityNotFound(_0x526cf3,null))[_0x0a9e('0x1f')](respondWithResult(_0x526cf3,null))[_0x0a9e('0x32')](handleError(_0x526cf3,null));};exports['update']=function(_0x66c1d2,_0x46f0a5){if(_0x66c1d2[_0x0a9e('0x33')]['id']){delete _0x66c1d2[_0x0a9e('0x33')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x31')]({'where':{'id':_0x66c1d2[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x46f0a5,null))['then'](saveUpdates(_0x66c1d2[_0x0a9e('0x33')],null))['then'](respondWithResult(_0x46f0a5,null))[_0x0a9e('0x32')](handleError(_0x46f0a5,null));};exports[_0x0a9e('0x34')]=function(_0x2b7e7f,_0x3f3d41){return db['MailApplication'][_0x0a9e('0x31')]({'where':{'id':_0x2b7e7f[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x3f3d41,null))[_0x0a9e('0x1f')](removeEntity(_0x3f3d41,null))['catch'](handleError(_0x3f3d41,null));}; \ No newline at end of file +var _0xa9e0=['Content-Range','apply','reject','save','then','error','stack','send','show','params','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','find','catch','body','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x53b966,_0x274c28){var _0x3d2711=function(_0x2afbd4){while(--_0x2afbd4){_0x53b966['push'](_0x53b966['shift']());}};_0x3d2711(++_0x274c28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=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={'raw':!![],'where':{'id':_0x33161b[_0x0a9e('0x24')]['id']}},_0x479bc4={};_0x479bc4['model']=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x25')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['model'],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2b')]=_[_0x0a9e('0x2a')](_0x479bc4[_0x0a9e('0x2c')],qs['fields'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2b')]=_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x2e')]?_0x384319[_0x0a9e('0x2b')]:_0x479bc4[_0x0a9e('0x2c')];if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2f')]){_0x384319['include']=[{'all':!![]}];}_0x384319=_[_0x0a9e('0x30')]({},_0x384319,_0x33161b['options']);return db[_0x0a9e('0x26')][_0x0a9e('0x31')](_0x384319)[_0x0a9e('0x1f')](handleEntityNotFound(_0x526cf3,null))[_0x0a9e('0x1f')](respondWithResult(_0x526cf3,null))[_0x0a9e('0x32')](handleError(_0x526cf3,null));};exports['update']=function(_0x66c1d2,_0x46f0a5){if(_0x66c1d2[_0x0a9e('0x33')]['id']){delete _0x66c1d2[_0x0a9e('0x33')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x31')]({'where':{'id':_0x66c1d2[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x46f0a5,null))['then'](saveUpdates(_0x66c1d2[_0x0a9e('0x33')],null))['then'](respondWithResult(_0x46f0a5,null))[_0x0a9e('0x32')](handleError(_0x46f0a5,null));};exports[_0x0a9e('0x34')]=function(_0x2b7e7f,_0x3f3d41){return db['MailApplication'][_0x0a9e('0x31')]({'where':{'id':_0x2b7e7f[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x3f3d41,null))[_0x0a9e('0x1f')](removeEntity(_0x3f3d41,null))['catch'](handleError(_0x3f3d41,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index b9bc3d9..4aacf21 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 _0x6564=['MailApplication','mail_applications','util','../../config/logger','api','bluebird','request-promise','./mailApplication.attributes','exports','define'];(function(_0x2792ea,_0x4970cb){var _0x373e89=function(_0x892cd6){while(--_0x892cd6){_0x2792ea['push'](_0x2792ea['shift']());}};_0x373e89(++_0x4970cb);}(_0x6564,0x1a6));var _0x4656=function(_0x48c30e,_0x1cff95){_0x48c30e=_0x48c30e-0x0;var _0x388ed5=_0x6564[_0x48c30e];return _0x388ed5;};'use strict';var _=require('lodash');var util=require(_0x4656('0x0'));var logger=require(_0x4656('0x1'))(_0x4656('0x2'));var moment=require('moment');var BPromise=require(_0x4656('0x3'));var rp=require(_0x4656('0x4'));var attributes=require(_0x4656('0x5'));module[_0x4656('0x6')]=function(_0x13ee51,_0x5bb4dd){return _0x13ee51[_0x4656('0x7')](_0x4656('0x8'),attributes,{'tableName':_0x4656('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3fd=['define','MailApplication','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./mailApplication.attributes','exports'];(function(_0x16d8f0,_0x384f20){var _0x5c4ecc=function(_0x5f1c91){while(--_0x5f1c91){_0x16d8f0['push'](_0x16d8f0['shift']());}};_0x5c4ecc(++_0x384f20);}(_0xd3fd,0x1af));var _0xdd3f=function(_0x521aff,_0x35cebd){_0x521aff=_0x521aff-0x0;var _0x1838b9=_0xd3fd[_0x521aff];return _0x1838b9;};'use strict';var _=require(_0xdd3f('0x0'));var util=require(_0xdd3f('0x1'));var logger=require(_0xdd3f('0x2'))(_0xdd3f('0x3'));var moment=require(_0xdd3f('0x4'));var BPromise=require(_0xdd3f('0x5'));var rp=require(_0xdd3f('0x6'));var attributes=require(_0xdd3f('0x7'));module[_0xdd3f('0x8')]=function(_0x3c4b0f,_0x12616f){return _0x3c4b0f[_0xdd3f('0x9')](_0xdd3f('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 51c9820..99fa75c 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 _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3d085e,_0x22770f){var _0x49f193=function(_0x53e14a){while(--_0x53e14a){_0x3d085e['push'](_0x3d085e['shift']());}};_0x49f193(++_0x22770f);}(_0x7a54,0x106));var _0x47a5=function(_0x5320d3,_0x1aa77f){_0x5320d3=_0x5320d3-0x0;var _0x833c1b=_0x7a54[_0x5320d3];return _0x833c1b;};'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')]('MailApplication,\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['UpdateMailApplication']=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?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2f47f2,_0x1d6975){var _0x259a0c=function(_0x3e888c){while(--_0x3e888c){_0x2f47f2['push'](_0x2f47f2['shift']());}};_0x259a0c(++_0x1d6975);}(_0x7a54,0x106));var _0x47a5=function(_0x50de0f,_0x5b9ea2){_0x50de0f=_0x50de0f-0x0;var _0x775b7d=_0x7a54[_0x50de0f];return _0x775b7d;};'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')]('MailApplication,\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['UpdateMailApplication']=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?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 1134f42..802a28a 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 _0xc175=['removeTags','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy'];(function(_0x485d2f,_0x45faf6){var _0x2efaa2=function(_0x1848eb){while(--_0x1848eb){_0x485d2f['push'](_0x485d2f['shift']());}};_0x2efaa2(++_0x45faf6);}(_0xc175,0xe9));var _0x5c17=function(_0x3f2d13,_0x4a5982){_0x3f2d13=_0x3f2d13-0x0;var _0x1ca226=_0xc175[_0x3f2d13];return _0x1ca226;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c17('0x0'));var timeout=require(_0x5c17('0x1'));var express=require(_0x5c17('0x2'));var router=express[_0x5c17('0x3')]();var auth=require(_0x5c17('0x4'));var interaction=require(_0x5c17('0x5'));var config=require(_0x5c17('0x6'));var controller=require(_0x5c17('0x7'));router[_0x5c17('0x8')]('/',auth[_0x5c17('0x9')](),controller[_0x5c17('0xa')]);router[_0x5c17('0x8')](_0x5c17('0xb'),auth[_0x5c17('0x9')](),controller[_0x5c17('0xc')]);router['get'](_0x5c17('0xd'),auth[_0x5c17('0x9')](),controller[_0x5c17('0xe')]);router[_0x5c17('0x8')](_0x5c17('0xf'),auth[_0x5c17('0x9')](),controller[_0x5c17('0x10')]);router[_0x5c17('0x8')]('/:id/download',auth[_0x5c17('0x9')](),controller[_0x5c17('0x11')]);router[_0x5c17('0x12')]('/',auth[_0x5c17('0x9')](),controller[_0x5c17('0x13')]);router['post'](_0x5c17('0xf'),auth[_0x5c17('0x9')](),controller['addMessage']);router[_0x5c17('0x12')](_0x5c17('0x14'),auth[_0x5c17('0x9')](),interaction['tracked'](_0x5c17('0x15'),_0x5c17('0x16')),controller[_0x5c17('0x17')]);router[_0x5c17('0x18')](_0x5c17('0xd'),auth[_0x5c17('0x9')](),interaction[_0x5c17('0x19')](_0x5c17('0x15'),_0x5c17('0x1a')),controller[_0x5c17('0x1b')]);router[_0x5c17('0x1c')](_0x5c17('0xd'),auth[_0x5c17('0x9')](),interaction[_0x5c17('0x19')](_0x5c17('0x15'),_0x5c17('0x1d')),controller[_0x5c17('0x1e')]);router[_0x5c17('0x1c')](_0x5c17('0x14'),auth[_0x5c17('0x9')](),controller[_0x5c17('0x1f')]);module[_0x5c17('0x20')]=router; \ No newline at end of file +var _0xdfeb=['mailinteraction:update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','put','mail'];(function(_0x3e3123,_0x22c13c){var _0x755707=function(_0x2b62db){while(--_0x2b62db){_0x3e3123['push'](_0x3e3123['shift']());}};_0x755707(++_0x22c13c);}(_0xdfeb,0xcf));var _0xbdfe=function(_0x4b9654,_0x21b130){_0x4b9654=_0x4b9654-0x0;var _0xe2ebc3=_0xdfeb[_0x4b9654];return _0xe2ebc3;};'use strict';var multer=require('multer');var util=require(_0xbdfe('0x0'));var path=require(_0xbdfe('0x1'));var timeout=require(_0xbdfe('0x2'));var express=require(_0xbdfe('0x3'));var router=express[_0xbdfe('0x4')]();var auth=require(_0xbdfe('0x5'));var interaction=require(_0xbdfe('0x6'));var config=require(_0xbdfe('0x7'));var controller=require('./mailInteraction.controller');router[_0xbdfe('0x8')]('/',auth[_0xbdfe('0x9')](),controller[_0xbdfe('0xa')]);router[_0xbdfe('0x8')](_0xbdfe('0xb'),auth[_0xbdfe('0x9')](),controller['describe']);router[_0xbdfe('0x8')](_0xbdfe('0xc'),auth[_0xbdfe('0x9')](),controller[_0xbdfe('0xd')]);router[_0xbdfe('0x8')](_0xbdfe('0xe'),auth['isAuthenticated'](),controller[_0xbdfe('0xf')]);router[_0xbdfe('0x8')](_0xbdfe('0x10'),auth[_0xbdfe('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xbdfe('0x11')]);router[_0xbdfe('0x12')](_0xbdfe('0xe'),auth[_0xbdfe('0x9')](),controller[_0xbdfe('0x13')]);router['post'](_0xbdfe('0x14'),auth[_0xbdfe('0x9')](),interaction[_0xbdfe('0x15')]('mail',_0xbdfe('0x16')),controller['addTags']);router[_0xbdfe('0x17')]('/:id',auth[_0xbdfe('0x9')](),interaction['tracked'](_0xbdfe('0x18'),_0xbdfe('0x19')),controller['update']);router[_0xbdfe('0x1a')](_0xbdfe('0xc'),auth[_0xbdfe('0x9')](),interaction[_0xbdfe('0x15')](_0xbdfe('0x18'),'mailinteraction:destroy'),controller[_0xbdfe('0x1b')]);router['delete']('/:id/tags',auth[_0xbdfe('0x9')](),controller['removeTags']);module[_0xbdfe('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 5f534e3..ef5091c 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 _0x3e53=['ENUM','getDataValue','lastMsgBody','fromString','split','join','sequelize','html-to-text','iconv','exports','BOOLEAN','STRING','TEXT','long','DATE','out'];(function(_0x476c6c,_0x434db8){var _0xbb94db=function(_0x4be12){while(--_0x4be12){_0x476c6c['push'](_0x476c6c['shift']());}};_0xbb94db(++_0x434db8);}(_0x3e53,0x186));var _0x33e5=function(_0x5c2d7d,_0x5dae84){_0x5c2d7d=_0x5c2d7d-0x0;var _0x853687=_0x3e53[_0x5c2d7d];return _0x853687;};'use strict';var Sequelize=require(_0x33e5('0x0'));var htmlToText=require(_0x33e5('0x1'));var iconv=require(_0x33e5('0x2'));module[_0x33e5('0x3')]={'closed':{'type':Sequelize[_0x33e5('0x4')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x33e5('0x5')]},'note':{'type':Sequelize[_0x33e5('0x5')]},'inReplyTo':{'type':Sequelize[_0x33e5('0x5')](0x1fe)},'to':{'type':Sequelize[_0x33e5('0x5')]},'cc':{'type':Sequelize[_0x33e5('0x6')](_0x33e5('0x7'))},'subject':{'type':Sequelize[_0x33e5('0x6')]()},'attach':{'type':Sequelize[_0x33e5('0x4')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x33e5('0x8')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x33e5('0x8')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x33e5('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x33e5('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x33e5('0xa')]('in',_0x33e5('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x33e5('0x6')]('long'),'get':function(){try{return this[_0x33e5('0xb')](_0x33e5('0xc'))?htmlToText[_0x33e5('0xd')](this[_0x33e5('0xb')](_0x33e5('0xc')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0x33e5('0xe')]('\x0a')['slice'](0x0,0x6)[_0x33e5('0xf')]('\x0a'):null;}catch(_0x2c85e9){return null;}}}}; \ No newline at end of file +var _0x34ad=['out','fromString','getDataValue','lastMsgBody','sequelize','html-to-text','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0x15a8c1,_0x4711ff){var _0x33a182=function(_0x2cb1c5){while(--_0x2cb1c5){_0x15a8c1['push'](_0x15a8c1['shift']());}};_0x33a182(++_0x4711ff);}(_0x34ad,0x1b6));var _0xd34a=function(_0x8a217e,_0x450bfc){_0x8a217e=_0x8a217e-0x0;var _0x3fc350=_0x34ad[_0x8a217e];return _0x3fc350;};'use strict';var Sequelize=require(_0xd34a('0x0'));var htmlToText=require(_0xd34a('0x1'));var iconv=require(_0xd34a('0x2'));module[_0xd34a('0x3')]={'closed':{'type':Sequelize[_0xd34a('0x4')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd34a('0x5')]},'disposition':{'type':Sequelize[_0xd34a('0x6')]},'note':{'type':Sequelize[_0xd34a('0x6')]},'inReplyTo':{'type':Sequelize[_0xd34a('0x6')](0x1fe)},'to':{'type':Sequelize[_0xd34a('0x6')]},'cc':{'type':Sequelize[_0xd34a('0x7')](_0xd34a('0x8'))},'subject':{'type':Sequelize[_0xd34a('0x7')]()},'attach':{'type':Sequelize[_0xd34a('0x4')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd34a('0x5')]},'substatus':{'type':Sequelize[_0xd34a('0x6')](0x3c)},'substatusAt':{'type':Sequelize[_0xd34a('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xd34a('0x9')]('in',_0xd34a('0xa')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd34a('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xd34a('0x9')]('in',_0xd34a('0xa')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xd34a('0x7')](_0xd34a('0x8')),'get':function(){try{return this['getDataValue']('lastMsgBody')?htmlToText[_0xd34a('0xb')](this[_0xd34a('0xc')](_0xd34a('0xd')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})['split']('\x0a')['slice'](0x0,0x6)['join']('\x0a'):null;}catch(_0x1b8b8b){return null;}}}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 35551da..d1caa2d 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 _0xd6e1=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','options','tag','include','push','Tag','Tags','distinct','read','Messages','direction','includeAll','User','CmContact','Contact','Owner','fullname','internal','MailAccount','Account','email','MailMessage','createdAt','ThroughTags','color','rows','catch','show','params','rawAttributes','merge','find','body','update','describe','addMessage','ids','omit','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','mailInteractionTags:save','removeTags','unix','toString','join','root','server','files','attachments','interaction-%s.zip','getMessages','from','bcc','Attachments','mkdirSync','each','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','log','err','unlinkSync','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','MailInteraction','model'];(function(_0x7561a8,_0x2f5431){var _0x4edab6=function(_0x2b41e6){while(--_0x2b41e6){_0x7561a8['push'](_0x7561a8['shift']());}};_0x4edab6(++_0x2f5431);}(_0xd6e1,0x17a));var _0x1d6e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd6e1[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0x1d6e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1d6e('0x1'));var zipdir=require(_0x1d6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d6e('0x3'));var BPromise=require(_0x1d6e('0x4'));var Mustache=require(_0x1d6e('0x5'));var util=require(_0x1d6e('0x6'));var path=require(_0x1d6e('0x7'));var sox=require(_0x1d6e('0x8'));var csv=require('to-csv');var ejs=require(_0x1d6e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1d6e('0xa'));var crypto=require('crypto');var jsforce=require(_0x1d6e('0xb'));var deskjs=require(_0x1d6e('0xc'));var toCsv=require(_0x1d6e('0xd'));var querystring=require(_0x1d6e('0xe'));var Papa=require(_0x1d6e('0xf'));var authService=require(_0x1d6e('0x10'));var hardwareService=require(_0x1d6e('0x11'));var Redis=require('ioredis');var qs=require(_0x1d6e('0x12'));var logger=require(_0x1d6e('0x13'))(_0x1d6e('0x14'));var utils=require(_0x1d6e('0x15'));var config=require(_0x1d6e('0x16'));var db=require(_0x1d6e('0x17'))['db'];config['redis']=_[_0x1d6e('0x18')](config[_0x1d6e('0x19')],{'host':_0x1d6e('0x1a'),'port':0x18eb});var socket=require(_0x1d6e('0x1b'))(new Redis(config[_0x1d6e('0x19')]));require('./mailInteraction.socket')[_0x1d6e('0x1c')](socket);function respondWithStatusCode(_0x332744,_0x2c0405){_0x2c0405=_0x2c0405||0xcc;return function(_0x58dd36){if(_0x58dd36){return _0x332744[_0x1d6e('0x1d')](_0x2c0405);}return _0x332744['status'](_0x2c0405)['end']();};}function respondWithResult(_0x36bc0e,_0x56d46b){_0x56d46b=_0x56d46b||0xc8;return function(_0x38e3ac){if(_0x38e3ac){return _0x36bc0e[_0x1d6e('0x1e')](_0x56d46b)[_0x1d6e('0x1f')](_0x38e3ac);}};}function respondWithFilteredResult(_0x269861,_0x39144b){return function(_0x549540){if(_0x549540){var _0x4e07cf=_0x549540[_0x1d6e('0x20')],_0x1253bd=_0x39144b[_0x1d6e('0x21')],_0x4e8f5d=_0x39144b[_0x1d6e('0x21')]+_0x39144b['limit'],_0x26bdaa;if(_0x4e8f5d>=_0x4e07cf){_0x4e8f5d=_0x4e07cf;_0x26bdaa=0xc8;}else{_0x26bdaa=0xce;}_0x269861[_0x1d6e('0x1e')](_0x26bdaa);return _0x269861[_0x1d6e('0x22')](_0x1d6e('0x23'),_0x1253bd+'-'+_0x4e8f5d+'/'+_0x4e07cf)['json'](_0x549540);}return null;};}function patchUpdates(_0x1a6615){return function(_0xa317fa){try{jsonpatch[_0x1d6e('0x24')](_0xa317fa,_0x1a6615,!![]);}catch(_0x2e7e6e){return BPromise[_0x1d6e('0x25')](_0x2e7e6e);}return _0xa317fa[_0x1d6e('0x26')]();};}function saveUpdates(_0x35dcd8,_0x54b486){return function(_0x390811){if(_0x390811){return _0x390811['update'](_0x35dcd8)[_0x1d6e('0x27')](function(_0x227fe2){return _0x227fe2;});}return null;};}function removeEntity(_0x5110f4,_0x5a1e86){return function(_0x3cd4d3){if(_0x3cd4d3){return _0x3cd4d3[_0x1d6e('0x28')]()[_0x1d6e('0x27')](function(){_0x5110f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4633e0,_0x26e254){return function(_0x432008){if(!_0x432008){_0x4633e0[_0x1d6e('0x1d')](0x194);}return _0x432008;};}function handleError(_0x2094c0,_0x39fca6){_0x39fca6=_0x39fca6||0x1f4;return function(_0x4ff3f3){logger[_0x1d6e('0x29')](_0x4ff3f3[_0x1d6e('0x2a')]);if(_0x4ff3f3[_0x1d6e('0x2b')]){delete _0x4ff3f3[_0x1d6e('0x2b')];}_0x2094c0[_0x1d6e('0x1e')](_0x39fca6)[_0x1d6e('0x2c')](_0x4ff3f3);};}exports[_0x1d6e('0x2d')]=function(_0xea21d,_0x4d025a){var _0x78848={},_0x287feb={},_0x94980e={'count':0x0,'rows':[]};var _0xe40910=db[_0x1d6e('0x2e')]['rawAttributes'];_0x287feb[_0x1d6e('0x2f')]=_['keys'](_0xe40910);_0x287feb[_0x1d6e('0x30')]=_[_0x1d6e('0x31')](_0xea21d[_0x1d6e('0x30')]);_0x287feb[_0x1d6e('0x32')]=_[_0x1d6e('0x33')](_0x287feb[_0x1d6e('0x2f')],_0x287feb[_0x1d6e('0x30')]);_0x78848[_0x1d6e('0x34')]=_[_0x1d6e('0x33')](_0x287feb[_0x1d6e('0x2f')],qs[_0x1d6e('0x35')](_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x35')]));_0x78848[_0x1d6e('0x34')]=_0x78848[_0x1d6e('0x34')][_0x1d6e('0x36')]?_0x78848[_0x1d6e('0x34')]:_0x287feb['model'];if(!_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x37')](_0x1d6e('0x38'))){_0x78848['limit']=qs[_0x1d6e('0x39')](_0xea21d[_0x1d6e('0x30')]['limit']);_0x78848['offset']=qs['offset'](_0xea21d['query'][_0x1d6e('0x21')]);}_0x78848[_0x1d6e('0x3a')]=qs[_0x1d6e('0x3b')](_0xea21d['query'][_0x1d6e('0x3b')]);_0x78848[_0x1d6e('0x3c')]=qs[_0x1d6e('0x32')](_[_0x1d6e('0x3d')](_0xea21d[_0x1d6e('0x30')],_0x287feb[_0x1d6e('0x32')]));if(_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x3e')]){_0x78848[_0x1d6e('0x3c')]=_['merge'](_0x78848[_0x1d6e('0x3c')],{'$or':_[_0x1d6e('0x3f')](_0xe40910,function(_0x44bfc1){if(_0x44bfc1[_0x1d6e('0x40')][_0x1d6e('0x41')]!==_0x1d6e('0x42')){var _0x1e7246={};_0x1e7246[_0x44bfc1[_0x1d6e('0x43')]]={'$like':'%'+_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x3e')]+'%'};return _0x1e7246;}})});}_0x78848=_['merge']({},_0x78848,_0xea21d[_0x1d6e('0x44')]);var _0x10e4bd={'where':_0x78848[_0x1d6e('0x3c')]};_0x10e4bd['include']=[];if(_0xea21d['query'][_0x1d6e('0x45')]){_0x10e4bd[_0x1d6e('0x46')][_0x1d6e('0x47')]({'model':db[_0x1d6e('0x48')],'as':_0x1d6e('0x49'),'attributes':['id'],'where':{'id':_0xea21d['query'][_0x1d6e('0x45')]},'required':!![]});_0x10e4bd[_0x1d6e('0x4a')]=!![];}if(_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x4b')]){_0x10e4bd[_0x1d6e('0x46')][_0x1d6e('0x47')]({'model':db['MailMessage'],'as':_0x1d6e('0x4c'),'attributes':['id',_0x1d6e('0x4d'),'createdAt',_0x1d6e('0x4b')],'where':{'direction':'in','read':_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x4b')]||![]},'required':!![]});_0x10e4bd[_0x1d6e('0x4a')]=!![];}return db[_0x1d6e('0x2e')][_0x1d6e('0x20')](_0x10e4bd)['then'](function(_0x222158){_0x94980e[_0x1d6e('0x20')]=_0x222158;if(_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x4e')]){_0x78848[_0x1d6e('0x46')]=[{'model':db[_0x1d6e('0x4f')],'as':'Users','required':![],'attributes':['id',_0x1d6e('0x2b'),'fullname']},{'model':db[_0x1d6e('0x50')],'as':_0x1d6e('0x51'),'required':![]},{'model':db[_0x1d6e('0x4f')],'as':_0x1d6e('0x52'),'attributes':[_0x1d6e('0x2b'),_0x1d6e('0x53'),_0x1d6e('0x54')],'required':![]},{'model':db[_0x1d6e('0x55')],'as':_0x1d6e('0x56'),'attributes':[_0x1d6e('0x2b'),_0x1d6e('0x41'),_0x1d6e('0x57')],'required':![]},{'model':db[_0x1d6e('0x58')],'as':'Messages','attributes':['id',_0x1d6e('0x4d'),_0x1d6e('0x59'),_0x1d6e('0x4b')],'where':{'direction':'in','read':_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x4b')]||![]},'required':_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x4b')]||![]},{'model':db[_0x1d6e('0x48')],'as':_0x1d6e('0x49'),'attributes':['id',_0x1d6e('0x2b'),'color'],'required':_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x45')]?!![]:![]},{'model':db[_0x1d6e('0x48')],'as':_0x1d6e('0x5a'),'attributes':['id',_0x1d6e('0x2b'),_0x1d6e('0x5b')],'through':_0xea21d[_0x1d6e('0x30')]['tag']?{'attributes':[],'where':{'TagId':_0xea21d[_0x1d6e('0x30')][_0x1d6e('0x45')]||undefined}}:{},'required':_0xea21d[_0x1d6e('0x30')]['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x78848);})[_0x1d6e('0x27')](function(_0x56e6cd){_0x94980e[_0x1d6e('0x5c')]=_0x56e6cd;return _0x94980e;})[_0x1d6e('0x27')](respondWithFilteredResult(_0x4d025a,_0x78848))[_0x1d6e('0x5d')](handleError(_0x4d025a,null));};exports[_0x1d6e('0x5e')]=function(_0x5a581c,_0x21c583){var _0x26638e={'raw':![],'where':{'id':_0x5a581c[_0x1d6e('0x5f')]['id']}},_0x46c17e={};_0x46c17e['model']=_[_0x1d6e('0x31')](db[_0x1d6e('0x2e')][_0x1d6e('0x60')]);_0x46c17e[_0x1d6e('0x30')]=_[_0x1d6e('0x31')](_0x5a581c[_0x1d6e('0x30')]);_0x46c17e[_0x1d6e('0x32')]=_[_0x1d6e('0x33')](_0x46c17e[_0x1d6e('0x2f')],_0x46c17e[_0x1d6e('0x30')]);_0x26638e[_0x1d6e('0x34')]=_['intersection'](_0x46c17e['model'],qs[_0x1d6e('0x35')](_0x5a581c['query'][_0x1d6e('0x35')]));_0x26638e[_0x1d6e('0x34')]=_0x26638e['attributes']['length']?_0x26638e[_0x1d6e('0x34')]:_0x46c17e[_0x1d6e('0x2f')];if(_0x5a581c[_0x1d6e('0x30')][_0x1d6e('0x4e')]){_0x26638e['include']=[{'all':!![]}];}_0x26638e=_[_0x1d6e('0x61')]({},_0x26638e,_0x5a581c[_0x1d6e('0x44')]);return db[_0x1d6e('0x2e')][_0x1d6e('0x62')](_0x26638e)[_0x1d6e('0x27')](handleEntityNotFound(_0x21c583,null))['then'](respondWithResult(_0x21c583,null))[_0x1d6e('0x5d')](handleError(_0x21c583,null));};exports['create']=function(_0x381a62,_0x21bb6c){return db[_0x1d6e('0x2e')]['create'](_0x381a62[_0x1d6e('0x63')],{})['then'](respondWithResult(_0x21bb6c,0xc9))[_0x1d6e('0x5d')](handleError(_0x21bb6c,null));};exports[_0x1d6e('0x64')]=function(_0x30098d,_0x179511){if(_0x30098d[_0x1d6e('0x63')]['id']){delete _0x30098d[_0x1d6e('0x63')]['id'];}return db[_0x1d6e('0x2e')][_0x1d6e('0x62')]({'where':{'id':_0x30098d[_0x1d6e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x179511,null))[_0x1d6e('0x27')](saveUpdates(_0x30098d[_0x1d6e('0x63')],null))[_0x1d6e('0x27')](respondWithResult(_0x179511,null))[_0x1d6e('0x5d')](handleError(_0x179511,null));};exports[_0x1d6e('0x28')]=function(_0x35420b,_0x5ad24d){return db[_0x1d6e('0x2e')][_0x1d6e('0x62')]({'where':{'id':_0x35420b['params']['id']}})[_0x1d6e('0x27')](handleEntityNotFound(_0x5ad24d,null))[_0x1d6e('0x27')](removeEntity(_0x5ad24d,null))[_0x1d6e('0x5d')](handleError(_0x5ad24d,null));};exports['describe']=function(_0x22a8d5,_0x3816d3){return db[_0x1d6e('0x2e')][_0x1d6e('0x65')]()[_0x1d6e('0x27')](respondWithResult(_0x3816d3,null))[_0x1d6e('0x5d')](handleError(_0x3816d3,null));};exports[_0x1d6e('0x66')]=function(_0x11b95a,_0x2ad9ba,_0x116b1b){return db['MailMessage'][_0x1d6e('0x62')]({'where':{'id':_0x11b95a[_0x1d6e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2ad9ba,null))[_0x1d6e('0x27')](function(_0xc870fa){if(_0xc870fa){return _0xc870fa[_0x1d6e('0x66')](_0x11b95a[_0x1d6e('0x63')][_0x1d6e('0x67')],_[_0x1d6e('0x68')](_0x11b95a['body'],[_0x1d6e('0x67'),'id'])||{});}})['then'](respondWithResult(_0x2ad9ba,null))['catch'](handleError(_0x2ad9ba,null));};exports['getMessages']=function(_0x106a43,_0x7b02ad,_0x3424b4){var _0x242405={'raw':![],'where':{}};var _0x11a259={};var _0x141e3a={'count':0x0,'rows':[]};return db['MailInteraction'][_0x1d6e('0x69')]({'where':{'id':_0x106a43['params']['id']}})[_0x1d6e('0x27')](handleEntityNotFound(_0x7b02ad,null))[_0x1d6e('0x27')](function(_0x1d3505){if(_0x1d3505){_0x11a259['model']=_['keys'](db[_0x1d6e('0x58')][_0x1d6e('0x60')]);_0x11a259['query']=_[_0x1d6e('0x31')](_0x106a43[_0x1d6e('0x30')]);_0x11a259[_0x1d6e('0x32')]=_[_0x1d6e('0x33')](_0x11a259['model'],_0x11a259[_0x1d6e('0x30')]);_0x242405[_0x1d6e('0x34')]=_[_0x1d6e('0x33')](_0x11a259[_0x1d6e('0x2f')],qs['fields'](_0x106a43[_0x1d6e('0x30')][_0x1d6e('0x35')]));_0x242405[_0x1d6e('0x34')]=_0x242405['attributes'][_0x1d6e('0x36')]?_0x242405[_0x1d6e('0x34')]:_0x11a259[_0x1d6e('0x2f')];if(!_0x106a43[_0x1d6e('0x30')]['hasOwnProperty'](_0x1d6e('0x38'))){_0x242405['limit']=qs[_0x1d6e('0x39')](_0x106a43[_0x1d6e('0x30')][_0x1d6e('0x39')]);_0x242405[_0x1d6e('0x21')]=qs[_0x1d6e('0x21')](_0x106a43[_0x1d6e('0x30')][_0x1d6e('0x21')]);}_0x242405[_0x1d6e('0x3a')]=qs['sort'](_0x106a43['query'][_0x1d6e('0x3b')]);_0x242405[_0x1d6e('0x3c')]=qs[_0x1d6e('0x32')](_[_0x1d6e('0x3d')](_0x106a43[_0x1d6e('0x30')],_0x11a259[_0x1d6e('0x32')]));_0x242405['where']['MailInteractionId']=_0x1d3505['id'];if(_0x106a43[_0x1d6e('0x30')][_0x1d6e('0x3e')]){_0x242405[_0x1d6e('0x3c')]=_['merge'](_0x242405[_0x1d6e('0x3c')],{'$or':_['map'](_0x242405[_0x1d6e('0x34')],function(_0x444a85){var _0x654ce8={};_0x654ce8[_0x444a85]={'$like':'%'+_0x106a43[_0x1d6e('0x30')][_0x1d6e('0x3e')]+'%'};return _0x654ce8;})});}if(_0x106a43[_0x1d6e('0x30')][_0x1d6e('0x6a')]){var _0xf12ff3=_0x106a43['query'][_0x1d6e('0x6a')][_0x1d6e('0x6b')](',');var _0x3e71e8={};_0x3e71e8[_0xf12ff3[0x0]]={'$gte':moment(_0xf12ff3[0x1])[_0x1d6e('0x6c')](_0x1d6e('0x6d'))};_0x242405[_0x1d6e('0x3c')]=_[_0x1d6e('0x61')](_0x242405[_0x1d6e('0x3c')],_0x3e71e8);}_0x242405=_[_0x1d6e('0x61')]({},_0x242405,_0x106a43[_0x1d6e('0x44')]);return db[_0x1d6e('0x58')][_0x1d6e('0x20')]({'where':_0x242405[_0x1d6e('0x3c')]})[_0x1d6e('0x27')](function(_0x2131cd){_0x141e3a['count']=_0x2131cd;if(_0x106a43[_0x1d6e('0x30')][_0x1d6e('0x4e')]){_0x242405[_0x1d6e('0x46')]=[{'all':!![]}];}return db[_0x1d6e('0x58')][_0x1d6e('0x6e')](_0x242405);})[_0x1d6e('0x27')](function(_0x4fb0a4){_0x141e3a[_0x1d6e('0x5c')]=_0x4fb0a4;return _0x141e3a;});}})[_0x1d6e('0x27')](respondWithFilteredResult(_0x7b02ad,_0x242405))[_0x1d6e('0x5d')](handleError(_0x7b02ad,null));};exports[_0x1d6e('0x6f')]=function(_0x54edcd,_0x2c9a0c,_0xbb6957){return db[_0x1d6e('0x2e')][_0x1d6e('0x62')]({'where':{'id':_0x54edcd[_0x1d6e('0x5f')]['id']}})[_0x1d6e('0x27')](handleEntityNotFound(_0x2c9a0c,null))[_0x1d6e('0x27')](function(_0x3c7417){if(_0x3c7417){return _0x3c7417['setTags'](_0x54edcd[_0x1d6e('0x63')][_0x1d6e('0x67')],_[_0x1d6e('0x68')](_0x54edcd[_0x1d6e('0x63')],['ids','id'])||{})[_0x1d6e('0x70')](function(){return db[_0x1d6e('0x48')][_0x1d6e('0x6e')]({'attributes':['id','name','color'],'where':{'id':_0x54edcd[_0x1d6e('0x63')]['ids']}});})[_0x1d6e('0x27')](function(_0x7cae38){socket['emit'](_0x1d6e('0x71'),{'id':Number(_0x54edcd[_0x1d6e('0x5f')]['id']),'tags':_0x7cae38||[]});return{'id':Number(_0x54edcd[_0x1d6e('0x5f')]['id']),'tags':_0x7cae38||[]};});}})[_0x1d6e('0x27')](respondWithResult(_0x2c9a0c,null))[_0x1d6e('0x5d')](handleError(_0x2c9a0c,null));};exports[_0x1d6e('0x72')]=function(_0x1241bc,_0xe06faf,_0x474703){var _0x308d10;return db[_0x1d6e('0x2e')][_0x1d6e('0x62')]({'where':{'id':_0x1241bc[_0x1d6e('0x5f')]['id']}})[_0x1d6e('0x27')](handleEntityNotFound(_0xe06faf,null))[_0x1d6e('0x27')](function(_0x482f8d){if(_0x482f8d){return _0x482f8d[_0x1d6e('0x72')](_0x1241bc[_0x1d6e('0x30')][_0x1d6e('0x67')]);}})['then'](respondWithStatusCode(_0xe06faf,null))[_0x1d6e('0x5d')](handleError(_0xe06faf,null));};exports['download']=function(_0x501c57,_0xcf8efd){var _0x22c789=moment()[_0x1d6e('0x73')]()[_0x1d6e('0x74')]();var _0x48faa4=path[_0x1d6e('0x75')](config[_0x1d6e('0x76')],_0x1d6e('0x77'),_0x1d6e('0x78'),_0x1d6e('0x79'));var _0x510b35=path[_0x1d6e('0x75')](config[_0x1d6e('0x76')],_0x1d6e('0x77'),_0x1d6e('0x78'),'tmp');var _0x4494fc=path[_0x1d6e('0x75')](_0x510b35,_0x22c789);var _0x27489d=util['format'](_0x1d6e('0x7a'),_0x22c789);var _0x1e8544=path[_0x1d6e('0x75')](_0x510b35,_0x27489d);var _0x358326=![];return db['MailInteraction'][_0x1d6e('0x62')]({'where':{'id':_0x501c57[_0x1d6e('0x5f')]['id']}})[_0x1d6e('0x27')](handleEntityNotFound(_0xcf8efd,null))[_0x1d6e('0x27')](function(_0x1e2804){if(_0x1e2804){return _0x1e2804[_0x1d6e('0x7b')]({'attributes':['id','body',_0x1d6e('0x7c'),'to','cc',_0x1d6e('0x7d'),'subject','createdAt'],'where':{'secret':![]},'include':_0x501c57['query'][_0x1d6e('0x79')]?[{'model':db['Attachment'],'as':_0x1d6e('0x7e')}]:undefined,'order':qs[_0x1d6e('0x3b')]('id')});}return[];})[_0x1d6e('0x27')](function(_0x4db9ec){_0x358326=_0x4db9ec[_0x1d6e('0x36')];if(_0x4db9ec['length']){fs[_0x1d6e('0x7f')](_0x4494fc);return BPromise[_0x1d6e('0x80')](_0x4db9ec,function(_0x3877c0,_0x60dbca){var _0x1511ce=_0x3877c0;var _0x9794f1={'from':_0x1511ce[_0x1d6e('0x7c')],'to':_0x1511ce['to'],'subject':_0x1511ce[_0x1d6e('0x81')],'html':_0x1511ce['body'],'headers':{'Date':moment(_0x1511ce[_0x1d6e('0x59')])['format'](_0x1d6e('0x82'))},'attachments':[]};if(_0x3877c0['cc']){_0x9794f1['headers']['Cc']=_0x3877c0['cc'];}if(_0x3877c0[_0x1d6e('0x7d')]){_0x9794f1[_0x1d6e('0x83')][_0x1d6e('0x84')]=_0x3877c0[_0x1d6e('0x7d')];}return new BPromise(function(_0x35e08f,_0x3034c3){if(_0x3877c0['Attachments']){for(var _0x379fb1=0x0;_0x379fb1<_0x3877c0[_0x1d6e('0x7e')][_0x1d6e('0x36')];_0x379fb1++){var _0x537a47=_0x3877c0['Attachments'][_0x379fb1];var _0x491a4e=path['join'](_0x48faa4,_0x537a47['basename']);if(fs[_0x1d6e('0x85')](_0x491a4e)){_0x9794f1[_0x1d6e('0x79')][_0x1d6e('0x47')]({'name':_0x537a47[_0x1d6e('0x2b')],'contentType':_0x537a47[_0x1d6e('0x40')],'data':fs[_0x1d6e('0x86')](_0x491a4e)});}}}emlformat[_0x1d6e('0x87')](_0x9794f1,function(_0x532a05,_0x1143f2){if(_0x532a05)return _0x3034c3(_0x532a05);fs[_0x1d6e('0x88')](path[_0x1d6e('0x75')](_0x4494fc,util[_0x1d6e('0x6c')](_0x1d6e('0x89'),_0x60dbca)),_0x1143f2);return _0x35e08f(_0x1143f2);});});});}})[_0x1d6e('0x27')](function(){if(_0x358326){return new BPromise(function(_0x56f7b5,_0x4527e7){zipdir(_0x4494fc,{'saveTo':_0x1e8544},function(_0x58cd19,_0x1e48d1){if(_0x58cd19)return _0x4527e7(_0x58cd19);return _0x56f7b5(_0x1e48d1);});});}})[_0x1d6e('0x27')](function(){if(_0x358326){return new BPromise(function(_0x3a8ca3,_0x556c49){rimraf(_0x4494fc,function(_0x582482){if(_0x582482)_0x556c49(_0x582482);return _0x3a8ca3();});});}})[_0x1d6e('0x27')](function(){if(_0x358326){return _0xcf8efd[_0x1d6e('0x8a')](_0x1e8544,_0x27489d,function(_0x33b56e){if(_0x33b56e){console[_0x1d6e('0x8b')](_0x1d6e('0x8c'),_0x33b56e);}else{fs[_0x1d6e('0x8d')](_0x1e8544);}});}else{return _0xcf8efd['sendStatus'](0xc8);}})['catch'](handleError(_0xcf8efd,null));}; \ No newline at end of file +var _0x40b5=['attachments','Attachments','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','index','MailInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','map','type','key','VIRTUAL','field','filter','merge','include','push','Tag','tag','distinct','read','MailMessage','createdAt','includeAll','User','Users','fullname','Contact','Owner','MailAccount','Account','Messages','direction','Tags','color','ThroughTags','rows','show','params','options','find','catch','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','nolimit','sort','MailInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','unix','toString','server','files','tmp','join','format','from','bcc','subject'];(function(_0x199f7e,_0x361801){var _0xe0d2aa=function(_0x578e7c){while(--_0x578e7c){_0x199f7e['push'](_0x199f7e['shift']());}};_0xe0d2aa(++_0x361801);}(_0x40b5,0x12b));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x540b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x540b('0x1'));var zipdir=require(_0x540b('0x2'));var jsonpatch=require(_0x540b('0x3'));var rp=require(_0x540b('0x4'));var moment=require(_0x540b('0x5'));var BPromise=require(_0x540b('0x6'));var Mustache=require(_0x540b('0x7'));var util=require(_0x540b('0x8'));var path=require(_0x540b('0x9'));var sox=require(_0x540b('0xa'));var csv=require('to-csv');var ejs=require(_0x540b('0xb'));var fs=require('fs');var _=require(_0x540b('0xc'));var squel=require(_0x540b('0xd'));var crypto=require('crypto');var jsforce=require(_0x540b('0xe'));var deskjs=require(_0x540b('0xf'));var toCsv=require(_0x540b('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x540b('0x11'));var hardwareService=require(_0x540b('0x12'));var Redis=require('ioredis');var qs=require(_0x540b('0x13'));var logger=require(_0x540b('0x14'))(_0x540b('0x15'));var utils=require('../../config/utils');var config=require(_0x540b('0x16'));var db=require(_0x540b('0x17'))['db'];config[_0x540b('0x18')]=_[_0x540b('0x19')](config[_0x540b('0x18')],{'host':_0x540b('0x1a'),'port':0x18eb});var socket=require(_0x540b('0x1b'))(new Redis(config['redis']));require(_0x540b('0x1c'))[_0x540b('0x1d')](socket);function respondWithStatusCode(_0x4a36ad,_0x39e7f7){_0x39e7f7=_0x39e7f7||0xcc;return function(_0x5ce9ce){if(_0x5ce9ce){return _0x4a36ad[_0x540b('0x1e')](_0x39e7f7);}return _0x4a36ad['status'](_0x39e7f7)[_0x540b('0x1f')]();};}function respondWithResult(_0x58cd22,_0x56f592){_0x56f592=_0x56f592||0xc8;return function(_0x222ded){if(_0x222ded){return _0x58cd22[_0x540b('0x20')](_0x56f592)[_0x540b('0x21')](_0x222ded);}};}function respondWithFilteredResult(_0xa9fd14,_0x31ea63){return function(_0xb31c8f){if(_0xb31c8f){var _0x31556c=_0xb31c8f[_0x540b('0x22')],_0x4fff02=_0x31ea63[_0x540b('0x23')],_0x462cdb=_0x31ea63[_0x540b('0x23')]+_0x31ea63[_0x540b('0x24')],_0x42d02b;if(_0x462cdb>=_0x31556c){_0x462cdb=_0x31556c;_0x42d02b=0xc8;}else{_0x42d02b=0xce;}_0xa9fd14['status'](_0x42d02b);return _0xa9fd14[_0x540b('0x25')](_0x540b('0x26'),_0x4fff02+'-'+_0x462cdb+'/'+_0x31556c)[_0x540b('0x21')](_0xb31c8f);}return null;};}function patchUpdates(_0x22fc50){return function(_0x1fb9d1){try{jsonpatch[_0x540b('0x27')](_0x1fb9d1,_0x22fc50,!![]);}catch(_0x53035c){return BPromise['reject'](_0x53035c);}return _0x1fb9d1[_0x540b('0x28')]();};}function saveUpdates(_0x2930de,_0x3cb27a){return function(_0x656a8){if(_0x656a8){return _0x656a8[_0x540b('0x29')](_0x2930de)[_0x540b('0x2a')](function(_0x4b094f){return _0x4b094f;});}return null;};}function removeEntity(_0x1190c9,_0x49898a){return function(_0x19fbed){if(_0x19fbed){return _0x19fbed['destroy']()[_0x540b('0x2a')](function(){_0x1190c9[_0x540b('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5688d1,_0x505bb3){return function(_0x3f9c8c){if(!_0x3f9c8c){_0x5688d1[_0x540b('0x1e')](0x194);}return _0x3f9c8c;};}function handleError(_0xb582b,_0x3b1f5a){_0x3b1f5a=_0x3b1f5a||0x1f4;return function(_0x15ebcc){logger[_0x540b('0x2b')](_0x15ebcc[_0x540b('0x2c')]);if(_0x15ebcc[_0x540b('0x2d')]){delete _0x15ebcc['name'];}_0xb582b[_0x540b('0x20')](_0x3b1f5a)['send'](_0x15ebcc);};}exports[_0x540b('0x2e')]=function(_0x2ef191,_0xf3188d){var _0x1564e0={},_0x20fc14={},_0x196f98={'count':0x0,'rows':[]};var _0x466db8=db[_0x540b('0x2f')][_0x540b('0x30')];_0x20fc14[_0x540b('0x31')]=_[_0x540b('0x32')](_0x466db8);_0x20fc14[_0x540b('0x33')]=_[_0x540b('0x32')](_0x2ef191['query']);_0x20fc14[_0x540b('0x34')]=_[_0x540b('0x35')](_0x20fc14[_0x540b('0x31')],_0x20fc14['query']);_0x1564e0[_0x540b('0x36')]=_[_0x540b('0x35')](_0x20fc14[_0x540b('0x31')],qs['fields'](_0x2ef191[_0x540b('0x33')][_0x540b('0x37')]));_0x1564e0[_0x540b('0x36')]=_0x1564e0['attributes'][_0x540b('0x38')]?_0x1564e0[_0x540b('0x36')]:_0x20fc14[_0x540b('0x31')];if(!_0x2ef191[_0x540b('0x33')][_0x540b('0x39')]('nolimit')){_0x1564e0[_0x540b('0x24')]=qs[_0x540b('0x24')](_0x2ef191[_0x540b('0x33')][_0x540b('0x24')]);_0x1564e0['offset']=qs[_0x540b('0x23')](_0x2ef191[_0x540b('0x33')][_0x540b('0x23')]);}_0x1564e0[_0x540b('0x3a')]=qs['sort'](_0x2ef191[_0x540b('0x33')]['sort']);_0x1564e0[_0x540b('0x3b')]=qs['filters'](_[_0x540b('0x3c')](_0x2ef191[_0x540b('0x33')],_0x20fc14[_0x540b('0x34')]));if(_0x2ef191[_0x540b('0x33')]['filter']){_0x1564e0[_0x540b('0x3b')]=_['merge'](_0x1564e0[_0x540b('0x3b')],{'$or':_[_0x540b('0x3d')](_0x466db8,function(_0x866654){if(_0x866654[_0x540b('0x3e')][_0x540b('0x3f')]!==_0x540b('0x40')){var _0x3806b9={};_0x3806b9[_0x866654[_0x540b('0x41')]]={'$like':'%'+_0x2ef191['query'][_0x540b('0x42')]+'%'};return _0x3806b9;}})});}_0x1564e0=_[_0x540b('0x43')]({},_0x1564e0,_0x2ef191['options']);var _0x5f3a5f={'where':_0x1564e0[_0x540b('0x3b')]};_0x5f3a5f['include']=[];if(_0x2ef191['query']['tag']){_0x5f3a5f[_0x540b('0x44')][_0x540b('0x45')]({'model':db[_0x540b('0x46')],'as':'Tags','attributes':['id'],'where':{'id':_0x2ef191['query'][_0x540b('0x47')]},'required':!![]});_0x5f3a5f[_0x540b('0x48')]=!![];}if(_0x2ef191[_0x540b('0x33')][_0x540b('0x49')]){_0x5f3a5f[_0x540b('0x44')][_0x540b('0x45')]({'model':db[_0x540b('0x4a')],'as':'Messages','attributes':['id','direction',_0x540b('0x4b'),_0x540b('0x49')],'where':{'direction':'in','read':_0x2ef191[_0x540b('0x33')][_0x540b('0x49')]||![]},'required':!![]});_0x5f3a5f[_0x540b('0x48')]=!![];}return db[_0x540b('0x2f')][_0x540b('0x22')](_0x5f3a5f)[_0x540b('0x2a')](function(_0x273a7d){_0x196f98['count']=_0x273a7d;if(_0x2ef191['query'][_0x540b('0x4c')]){_0x1564e0[_0x540b('0x44')]=[{'model':db[_0x540b('0x4d')],'as':_0x540b('0x4e'),'required':![],'attributes':['id','name',_0x540b('0x4f')]},{'model':db['CmContact'],'as':_0x540b('0x50'),'required':![]},{'model':db[_0x540b('0x4d')],'as':_0x540b('0x51'),'attributes':[_0x540b('0x2d'),'fullname','internal'],'required':![]},{'model':db[_0x540b('0x52')],'as':_0x540b('0x53'),'attributes':[_0x540b('0x2d'),_0x540b('0x3f'),'email'],'required':![]},{'model':db[_0x540b('0x4a')],'as':_0x540b('0x54'),'attributes':['id',_0x540b('0x55'),_0x540b('0x4b'),_0x540b('0x49')],'where':{'direction':'in','read':_0x2ef191[_0x540b('0x33')][_0x540b('0x49')]||![]},'required':_0x2ef191['query']['read']||![]},{'model':db[_0x540b('0x46')],'as':_0x540b('0x56'),'attributes':['id',_0x540b('0x2d'),_0x540b('0x57')],'required':_0x2ef191[_0x540b('0x33')]['tag']?!![]:![]},{'model':db[_0x540b('0x46')],'as':_0x540b('0x58'),'attributes':['id','name',_0x540b('0x57')],'through':_0x2ef191[_0x540b('0x33')][_0x540b('0x47')]?{'attributes':[],'where':{'TagId':_0x2ef191[_0x540b('0x33')][_0x540b('0x47')]||undefined}}:{},'required':_0x2ef191[_0x540b('0x33')][_0x540b('0x47')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x1564e0);})['then'](function(_0x57e7cb){_0x196f98[_0x540b('0x59')]=_0x57e7cb;return _0x196f98;})[_0x540b('0x2a')](respondWithFilteredResult(_0xf3188d,_0x1564e0))['catch'](handleError(_0xf3188d,null));};exports[_0x540b('0x5a')]=function(_0x2c667d,_0x371446){var _0x169edb={'raw':![],'where':{'id':_0x2c667d[_0x540b('0x5b')]['id']}},_0x4763f7={};_0x4763f7[_0x540b('0x31')]=_[_0x540b('0x32')](db['MailInteraction']['rawAttributes']);_0x4763f7[_0x540b('0x33')]=_[_0x540b('0x32')](_0x2c667d[_0x540b('0x33')]);_0x4763f7['filters']=_[_0x540b('0x35')](_0x4763f7[_0x540b('0x31')],_0x4763f7[_0x540b('0x33')]);_0x169edb['attributes']=_[_0x540b('0x35')](_0x4763f7['model'],qs[_0x540b('0x37')](_0x2c667d['query'][_0x540b('0x37')]));_0x169edb[_0x540b('0x36')]=_0x169edb['attributes']['length']?_0x169edb[_0x540b('0x36')]:_0x4763f7[_0x540b('0x31')];if(_0x2c667d[_0x540b('0x33')]['includeAll']){_0x169edb[_0x540b('0x44')]=[{'all':!![]}];}_0x169edb=_['merge']({},_0x169edb,_0x2c667d[_0x540b('0x5c')]);return db[_0x540b('0x2f')][_0x540b('0x5d')](_0x169edb)[_0x540b('0x2a')](handleEntityNotFound(_0x371446,null))[_0x540b('0x2a')](respondWithResult(_0x371446,null))[_0x540b('0x5e')](handleError(_0x371446,null));};exports[_0x540b('0x5f')]=function(_0x1015c7,_0x35fbf6){return db[_0x540b('0x2f')][_0x540b('0x5f')](_0x1015c7[_0x540b('0x60')],{})[_0x540b('0x2a')](respondWithResult(_0x35fbf6,0xc9))[_0x540b('0x5e')](handleError(_0x35fbf6,null));};exports[_0x540b('0x29')]=function(_0x3e364f,_0xa08bb8){if(_0x3e364f[_0x540b('0x60')]['id']){delete _0x3e364f[_0x540b('0x60')]['id'];}return db[_0x540b('0x2f')][_0x540b('0x5d')]({'where':{'id':_0x3e364f[_0x540b('0x5b')]['id']}})[_0x540b('0x2a')](handleEntityNotFound(_0xa08bb8,null))[_0x540b('0x2a')](saveUpdates(_0x3e364f['body'],null))['then'](respondWithResult(_0xa08bb8,null))[_0x540b('0x5e')](handleError(_0xa08bb8,null));};exports[_0x540b('0x61')]=function(_0x29156c,_0x2ebb6e){return db[_0x540b('0x2f')]['find']({'where':{'id':_0x29156c[_0x540b('0x5b')]['id']}})[_0x540b('0x2a')](handleEntityNotFound(_0x2ebb6e,null))[_0x540b('0x2a')](removeEntity(_0x2ebb6e,null))[_0x540b('0x5e')](handleError(_0x2ebb6e,null));};exports[_0x540b('0x62')]=function(_0x472bac,_0x1ae707){return db['MailInteraction']['describe']()[_0x540b('0x2a')](respondWithResult(_0x1ae707,null))[_0x540b('0x5e')](handleError(_0x1ae707,null));};exports[_0x540b('0x63')]=function(_0x44bfe2,_0x55659d,_0xd72da1){return db[_0x540b('0x4a')]['find']({'where':{'id':_0x44bfe2[_0x540b('0x5b')]['id']}})[_0x540b('0x2a')](handleEntityNotFound(_0x55659d,null))['then'](function(_0x1ee303){if(_0x1ee303){return _0x1ee303[_0x540b('0x63')](_0x44bfe2[_0x540b('0x60')][_0x540b('0x64')],_[_0x540b('0x65')](_0x44bfe2[_0x540b('0x60')],[_0x540b('0x64'),'id'])||{});}})['then'](respondWithResult(_0x55659d,null))[_0x540b('0x5e')](handleError(_0x55659d,null));};exports[_0x540b('0x66')]=function(_0x39c5cc,_0x2d152c,_0x668c22){var _0x1aee6b={'raw':![],'where':{}};var _0x5c5b12={};var _0x558cba={'count':0x0,'rows':[]};return db[_0x540b('0x2f')][_0x540b('0x67')]({'where':{'id':_0x39c5cc[_0x540b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2d152c,null))[_0x540b('0x2a')](function(_0x307567){if(_0x307567){_0x5c5b12[_0x540b('0x31')]=_['keys'](db[_0x540b('0x4a')]['rawAttributes']);_0x5c5b12[_0x540b('0x33')]=_['keys'](_0x39c5cc[_0x540b('0x33')]);_0x5c5b12[_0x540b('0x34')]=_[_0x540b('0x35')](_0x5c5b12[_0x540b('0x31')],_0x5c5b12['query']);_0x1aee6b[_0x540b('0x36')]=_['intersection'](_0x5c5b12[_0x540b('0x31')],qs['fields'](_0x39c5cc[_0x540b('0x33')][_0x540b('0x37')]));_0x1aee6b[_0x540b('0x36')]=_0x1aee6b[_0x540b('0x36')]['length']?_0x1aee6b[_0x540b('0x36')]:_0x5c5b12[_0x540b('0x31')];if(!_0x39c5cc['query']['hasOwnProperty'](_0x540b('0x68'))){_0x1aee6b[_0x540b('0x24')]=qs[_0x540b('0x24')](_0x39c5cc[_0x540b('0x33')][_0x540b('0x24')]);_0x1aee6b[_0x540b('0x23')]=qs[_0x540b('0x23')](_0x39c5cc[_0x540b('0x33')]['offset']);}_0x1aee6b[_0x540b('0x3a')]=qs['sort'](_0x39c5cc[_0x540b('0x33')][_0x540b('0x69')]);_0x1aee6b[_0x540b('0x3b')]=qs[_0x540b('0x34')](_['pick'](_0x39c5cc[_0x540b('0x33')],_0x5c5b12['filters']));_0x1aee6b[_0x540b('0x3b')][_0x540b('0x6a')]=_0x307567['id'];if(_0x39c5cc[_0x540b('0x33')][_0x540b('0x42')]){_0x1aee6b['where']=_[_0x540b('0x43')](_0x1aee6b[_0x540b('0x3b')],{'$or':_['map'](_0x1aee6b[_0x540b('0x36')],function(_0x1b9cc6){var _0x4cd981={};_0x4cd981[_0x1b9cc6]={'$like':'%'+_0x39c5cc[_0x540b('0x33')]['filter']+'%'};return _0x4cd981;})});}if(_0x39c5cc['query'][_0x540b('0x6b')]){var _0x25f163=_0x39c5cc['query'][_0x540b('0x6b')][_0x540b('0x6c')](',');var _0xcdfa7f={};_0xcdfa7f[_0x25f163[0x0]]={'$gte':moment(_0x25f163[0x1])['format'](_0x540b('0x6d'))};_0x1aee6b[_0x540b('0x3b')]=_[_0x540b('0x43')](_0x1aee6b[_0x540b('0x3b')],_0xcdfa7f);}_0x1aee6b=_[_0x540b('0x43')]({},_0x1aee6b,_0x39c5cc[_0x540b('0x5c')]);return db[_0x540b('0x4a')][_0x540b('0x22')]({'where':_0x1aee6b['where']})[_0x540b('0x2a')](function(_0xf00d55){_0x558cba[_0x540b('0x22')]=_0xf00d55;if(_0x39c5cc[_0x540b('0x33')][_0x540b('0x4c')]){_0x1aee6b[_0x540b('0x44')]=[{'all':!![]}];}return db[_0x540b('0x4a')][_0x540b('0x6e')](_0x1aee6b);})[_0x540b('0x2a')](function(_0x5775a0){_0x558cba['rows']=_0x5775a0;return _0x558cba;});}})[_0x540b('0x2a')](respondWithFilteredResult(_0x2d152c,_0x1aee6b))[_0x540b('0x5e')](handleError(_0x2d152c,null));};exports[_0x540b('0x6f')]=function(_0x3cf667,_0x4fe314,_0x4ed2a5){return db[_0x540b('0x2f')][_0x540b('0x5d')]({'where':{'id':_0x3cf667[_0x540b('0x5b')]['id']}})[_0x540b('0x2a')](handleEntityNotFound(_0x4fe314,null))['then'](function(_0x4e7797){if(_0x4e7797){return _0x4e7797[_0x540b('0x70')](_0x3cf667['body'][_0x540b('0x64')],_[_0x540b('0x65')](_0x3cf667[_0x540b('0x60')],[_0x540b('0x64'),'id'])||{})[_0x540b('0x71')](function(){return db[_0x540b('0x46')][_0x540b('0x6e')]({'attributes':['id',_0x540b('0x2d'),_0x540b('0x57')],'where':{'id':_0x3cf667['body'][_0x540b('0x64')]}});})[_0x540b('0x2a')](function(_0x4cdd8f){socket[_0x540b('0x72')](_0x540b('0x73'),{'id':Number(_0x3cf667['params']['id']),'tags':_0x4cdd8f||[]});return{'id':Number(_0x3cf667[_0x540b('0x5b')]['id']),'tags':_0x4cdd8f||[]};});}})[_0x540b('0x2a')](respondWithResult(_0x4fe314,null))['catch'](handleError(_0x4fe314,null));};exports['removeTags']=function(_0x2691a8,_0x4b86f1,_0x543381){var _0x132b33;return db[_0x540b('0x2f')]['find']({'where':{'id':_0x2691a8['params']['id']}})[_0x540b('0x2a')](handleEntityNotFound(_0x4b86f1,null))['then'](function(_0x3e6c11){if(_0x3e6c11){return _0x3e6c11[_0x540b('0x74')](_0x2691a8[_0x540b('0x33')][_0x540b('0x64')]);}})[_0x540b('0x2a')](respondWithStatusCode(_0x4b86f1,null))[_0x540b('0x5e')](handleError(_0x4b86f1,null));};exports['download']=function(_0x4a8411,_0x2795ba){var _0x4a56e4=moment()[_0x540b('0x75')]()[_0x540b('0x76')]();var _0x4cf50b=path['join'](config['root'],_0x540b('0x77'),'files','attachments');var _0x295777=path['join'](config['root'],_0x540b('0x77'),_0x540b('0x78'),_0x540b('0x79'));var _0x4fea3e=path[_0x540b('0x7a')](_0x295777,_0x4a56e4);var _0x5f4315=util[_0x540b('0x7b')]('interaction-%s.zip',_0x4a56e4);var _0x559251=path['join'](_0x295777,_0x5f4315);var _0x3e1533=![];return db[_0x540b('0x2f')][_0x540b('0x5d')]({'where':{'id':_0x4a8411[_0x540b('0x5b')]['id']}})[_0x540b('0x2a')](handleEntityNotFound(_0x2795ba,null))[_0x540b('0x2a')](function(_0x47ebee){if(_0x47ebee){return _0x47ebee['getMessages']({'attributes':['id','body',_0x540b('0x7c'),'to','cc',_0x540b('0x7d'),_0x540b('0x7e'),_0x540b('0x4b')],'where':{'secret':![]},'include':_0x4a8411[_0x540b('0x33')][_0x540b('0x7f')]?[{'model':db['Attachment'],'as':_0x540b('0x80')}]:undefined,'order':qs[_0x540b('0x69')]('id')});}return[];})['then'](function(_0x80b3ef){_0x3e1533=_0x80b3ef[_0x540b('0x38')];if(_0x80b3ef[_0x540b('0x38')]){fs[_0x540b('0x81')](_0x4fea3e);return BPromise['each'](_0x80b3ef,function(_0x53cf13,_0x365e3d){var _0x39aa8a=_0x53cf13;var _0x592c18={'from':_0x39aa8a[_0x540b('0x7c')],'to':_0x39aa8a['to'],'subject':_0x39aa8a[_0x540b('0x7e')],'html':_0x39aa8a[_0x540b('0x60')],'headers':{'Date':moment(_0x39aa8a[_0x540b('0x4b')])[_0x540b('0x7b')](_0x540b('0x82'))},'attachments':[]};if(_0x53cf13['cc']){_0x592c18[_0x540b('0x83')]['Cc']=_0x53cf13['cc'];}if(_0x53cf13[_0x540b('0x7d')]){_0x592c18['headers'][_0x540b('0x84')]=_0x53cf13['bcc'];}return new BPromise(function(_0x2d95a5,_0x2521b3){if(_0x53cf13[_0x540b('0x80')]){for(var _0x416e2c=0x0;_0x416e2c<_0x53cf13['Attachments'][_0x540b('0x38')];_0x416e2c++){var _0x1d78e2=_0x53cf13[_0x540b('0x80')][_0x416e2c];var _0x8280fd=path[_0x540b('0x7a')](_0x4cf50b,_0x1d78e2[_0x540b('0x85')]);if(fs[_0x540b('0x86')](_0x8280fd)){_0x592c18[_0x540b('0x7f')][_0x540b('0x45')]({'name':_0x1d78e2[_0x540b('0x2d')],'contentType':_0x1d78e2['type'],'data':fs[_0x540b('0x87')](_0x8280fd)});}}}emlformat[_0x540b('0x88')](_0x592c18,function(_0x485328,_0x2b1a82){if(_0x485328)return _0x2521b3(_0x485328);fs[_0x540b('0x89')](path[_0x540b('0x7a')](_0x4fea3e,util[_0x540b('0x7b')](_0x540b('0x8a'),_0x365e3d)),_0x2b1a82);return _0x2d95a5(_0x2b1a82);});});});}})['then'](function(){if(_0x3e1533){return new BPromise(function(_0x2b0d5a,_0x1c58a2){zipdir(_0x4fea3e,{'saveTo':_0x559251},function(_0x1500ae,_0x52a388){if(_0x1500ae)return _0x1c58a2(_0x1500ae);return _0x2b0d5a(_0x52a388);});});}})[_0x540b('0x2a')](function(){if(_0x3e1533){return new BPromise(function(_0x20fb6a,_0x4150b0){rimraf(_0x4fea3e,function(_0x12397c){if(_0x12397c)_0x4150b0(_0x12397c);return _0x20fb6a();});});}})['then'](function(){if(_0x3e1533){return _0x2795ba[_0x540b('0x8b')](_0x559251,_0x5f4315,function(_0x58ed62){if(_0x58ed62){console[_0x540b('0x8c')]('err',_0x58ed62);}else{fs[_0x540b('0x8d')](_0x559251);}});}else{return _0x2795ba['sendStatus'](0xc8);}})[_0x540b('0x5e')](handleError(_0x2795ba,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index fe01ab1..4886217 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 _0x3bac=['remove','emit','hook','exports','../../mysqldb','MailInteraction','setMaxListeners','save','update'];(function(_0x496c03,_0x469a38){var _0x5eccc5=function(_0xc0138a){while(--_0xc0138a){_0x496c03['push'](_0x496c03['shift']());}};_0x5eccc5(++_0x469a38);}(_0x3bac,0x109));var _0xc3ba=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0x3bac[_0x421725];return _0x51b322;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xc3ba('0x0'))['db'][_0xc3ba('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc3ba('0x2')](0x0);var events={'afterCreate':_0xc3ba('0x3'),'afterUpdate':_0xc3ba('0x4'),'afterDestroy':_0xc3ba('0x5')};function emitEvent(_0x589840){return function(_0x49435d,_0x589564,_0x170356){MailInteractionEvents[_0xc3ba('0x6')](_0x589840+':'+_0x49435d['id'],_0x49435d);MailInteractionEvents[_0xc3ba('0x6')](_0x589840,_0x49435d);_0x170356(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xc3ba('0x7')](e,emitEvent(event));}}module[_0xc3ba('0x8')]=MailInteractionEvents; \ No newline at end of file +var _0x01f2=['MailInteraction','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x4f8dc0,_0x3bf019){var _0x13d0d7=function(_0x92e276){while(--_0x92e276){_0x4f8dc0['push'](_0x4f8dc0['shift']());}};_0x13d0d7(++_0x3bf019);}(_0x01f2,0xbd));var _0x201f=function(_0x5af1ce,_0x318f6e){_0x5af1ce=_0x5af1ce-0x0;var _0x4e7f4f=_0x01f2[_0x5af1ce];return _0x4e7f4f;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x201f('0x0')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x201f('0x1'),'afterUpdate':_0x201f('0x2'),'afterDestroy':_0x201f('0x3')};function emitEvent(_0x386eab){return function(_0x1c8172,_0x5c90ce,_0x13a2bf){MailInteractionEvents[_0x201f('0x4')](_0x386eab+':'+_0x1c8172['id'],_0x1c8172);MailInteractionEvents[_0x201f('0x4')](_0x386eab,_0x1c8172);_0x13a2bf(null);};}for(var e in events){if(events[_0x201f('0x5')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x201f('0x6')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index f665bb3..e0fa4a9 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 _0x8999=['substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','./mailInteraction.attributes','exports','MailInteraction'];(function(_0x398a23,_0x2dc537){var _0x300040=function(_0x3f7cdf){while(--_0x3f7cdf){_0x398a23['push'](_0x398a23['shift']());}};_0x300040(++_0x2dc537);}(_0x8999,0x117));var _0x9899=function(_0x277212,_0x1d0079){_0x277212=_0x277212-0x0;var _0x3caed0=_0x8999[_0x277212];return _0x3caed0;};'use strict';var _=require(_0x9899('0x0'));var util=require(_0x9899('0x1'));var logger=require(_0x9899('0x2'))(_0x9899('0x3'));var moment=require(_0x9899('0x4'));var BPromise=require(_0x9899('0x5'));var rp=require('request-promise');var attributes=require(_0x9899('0x6'));module[_0x9899('0x7')]=function(_0x513907,_0xdca230){return _0x513907['define'](_0x9899('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x9e0174,_0xc2ea0d,_0x22b404){if(_0x9e0174[_0x9899('0x9')]){_0x9e0174[_0x9899('0xa')]=moment()[_0x9899('0xb')](_0x9899('0xc'));}if(_0x9e0174[_0x9899('0xd')]){_0x9e0174[_0x9899('0xe')]=moment()['format'](_0x9899('0xc'));}_0x22b404(null,_0xc2ea0d);},'beforeUpdate':function(_0x72b17d,_0x33b7d6,_0x525869){if(_0x72b17d[_0x9899('0xf')](_0x9899('0x9'))){_0x72b17d[_0x9899('0xa')]=moment()['format'](_0x9899('0xc'));}if(_0x72b17d[_0x9899('0xf')](_0x9899('0xd'))){_0x72b17d[_0x9899('0xe')]=moment()[_0x9899('0xb')](_0x9899('0xc'));}_0x525869(null,_0x72b17d);}},'charset':_0x9899('0x10'),'collate':_0x9899('0x11')});}; \ No newline at end of file +var _0xfd2f=['./mailInteraction.attributes','exports','define','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','substatusAt','changed','closed','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x1091af,_0x30316e){var _0x1ecd56=function(_0x590112){while(--_0x590112){_0x1091af['push'](_0x1091af['shift']());}};_0x1ecd56(++_0x30316e);}(_0xfd2f,0x11c));var _0xffd2=function(_0x37d60e,_0x3c84fc){_0x37d60e=_0x37d60e-0x0;var _0x2ea63c=_0xfd2f[_0x37d60e];return _0x2ea63c;};'use strict';var _=require('lodash');var util=require(_0xffd2('0x0'));var logger=require(_0xffd2('0x1'))(_0xffd2('0x2'));var moment=require(_0xffd2('0x3'));var BPromise=require('bluebird');var rp=require(_0xffd2('0x4'));var attributes=require(_0xffd2('0x5'));module[_0xffd2('0x6')]=function(_0x236480,_0x3946b2){return _0x236480[_0xffd2('0x7')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x485566,_0xe95d40,_0x4a9e4f){if(_0x485566[_0xffd2('0x8')]){_0x485566['substatusAt']=moment()[_0xffd2('0x9')](_0xffd2('0xa'));}if(_0x485566['closed']){_0x485566[_0xffd2('0xb')]=moment()[_0xffd2('0x9')](_0xffd2('0xa'));}_0x4a9e4f(null,_0xe95d40);},'beforeUpdate':function(_0x3e7369,_0x4641fe,_0x3b6f97){if(_0x3e7369['changed']('substatus')){_0x3e7369[_0xffd2('0xc')]=moment()[_0xffd2('0x9')](_0xffd2('0xa'));}if(_0x3e7369[_0xffd2('0xd')](_0xffd2('0xe'))){_0x3e7369[_0xffd2('0xb')]=moment()[_0xffd2('0x9')](_0xffd2('0xa'));}_0x3b6f97(null,_0x3e7369);}},'charset':_0xffd2('0xf'),'collate':_0xffd2('0x10')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index abc5179..6edc391 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 _0xd072=['debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','update','body','options','raw','attributes','UpdateMailInteraction','AddTagsToMailInteraction','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd072,0x132));var _0x2d07=function(_0x48ec40,_0x5ef59d){_0x48ec40=_0x48ec40-0x0;var _0x18398f=_0xd072[_0x48ec40];return _0x18398f;};'use strict';var _=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var moment=require(_0x2d07('0x2'));var BPromise=require(_0x2d07('0x3'));var rs=require(_0x2d07('0x4'));var fs=require('fs');var Redis=require(_0x2d07('0x5'));var db=require(_0x2d07('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d07('0x7'))(_0x2d07('0x8'));var config=require(_0x2d07('0x9'));var jayson=require(_0x2d07('0xa'));var client=jayson[_0x2d07('0xb')]['http']({'port':0x232a});config[_0x2d07('0xc')]=_[_0x2d07('0xd')](config[_0x2d07('0xc')],{'host':_0x2d07('0xe'),'port':0x18eb});var socket=require(_0x2d07('0xf'))(new Redis(config[_0x2d07('0xc')]));require(_0x2d07('0x10'))['register'](socket);function respondWithRpcPromise(_0x12e4b4,_0x3288ea,_0xa67a15){return new BPromise(function(_0x46ddb1,_0x20ce98){return client[_0x2d07('0x11')](_0x12e4b4,_0xa67a15)[_0x2d07('0x12')](function(_0x3a679d){logger[_0x2d07('0x13')](_0x2d07('0x14'),_0x3288ea,_0x2d07('0x15'));logger[_0x2d07('0x16')](_0x2d07('0x17'),_0x3288ea,_0x2d07('0x15'),JSON[_0x2d07('0x18')](_0x3a679d));if(_0x3a679d[_0x2d07('0x19')]){if(_0x3a679d[_0x2d07('0x19')][_0x2d07('0x1a')]===0x1f4){logger[_0x2d07('0x19')](_0x2d07('0x14'),_0x3288ea,_0x3a679d[_0x2d07('0x19')][_0x2d07('0x1b')]);return _0x20ce98(_0x3a679d[_0x2d07('0x19')][_0x2d07('0x1b')]);}logger[_0x2d07('0x19')]('MailInteraction,\x20%s,\x20%s',_0x3288ea,_0x3a679d[_0x2d07('0x19')][_0x2d07('0x1b')]);return _0x46ddb1(_0x3a679d[_0x2d07('0x19')][_0x2d07('0x1b')]);}else{logger[_0x2d07('0x13')](_0x2d07('0x14'),_0x3288ea,_0x2d07('0x15'));_0x46ddb1(_0x3a679d[_0x2d07('0x1c')]['message']);}})[_0x2d07('0x1d')](function(_0x1c6300){logger[_0x2d07('0x19')](_0x2d07('0x14'),_0x3288ea,_0x1c6300);_0x20ce98(_0x1c6300);});});}exports['UpdateMailInteraction']=function(_0x112ac3){var _0x2a419f=this;return new Promise(function(_0xd0c5f8,_0xe56848){return db[_0x2d07('0x1e')][_0x2d07('0x1f')](_0x112ac3[_0x2d07('0x20')],{'raw':_0x112ac3[_0x2d07('0x21')]?_0x112ac3['options'][_0x2d07('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x112ac3[_0x2d07('0x21')]?_0x112ac3[_0x2d07('0x21')]['where']||null:null,'attributes':_0x112ac3[_0x2d07('0x21')]?_0x112ac3['options'][_0x2d07('0x23')]||null:null,'limit':_0x112ac3[_0x2d07('0x21')]?_0x112ac3[_0x2d07('0x21')]['limit']||null:null})[_0x2d07('0x12')](function(_0x16586e){logger['info'](_0x2d07('0x24'),_0x112ac3);logger['debug'](_0x2d07('0x24'),_0x112ac3,JSON[_0x2d07('0x18')](_0x16586e));_0xd0c5f8(_0x16586e);})[_0x2d07('0x1d')](function(_0x41574e){logger['error'](_0x2d07('0x24'),_0x41574e[_0x2d07('0x1b')],_0x112ac3);_0xe56848(_0x2a419f[_0x2d07('0x19')](0x1f4,_0x41574e['message']));});});};exports[_0x2d07('0x25')]=function(_0x550fc5){return new Promise(function(_0x550344,_0x16c5ed){return db[_0x2d07('0x1e')]['find']({'where':_0x550fc5[_0x2d07('0x21')]?_0x550fc5['options']['where']||null:null})[_0x2d07('0x12')](function(_0x15b337){if(_0x15b337){return _0x15b337['addTags'](_0x550fc5[_0x2d07('0x20')]['ids'],_[_0x2d07('0x26')](_0x550fc5[_0x2d07('0x20')],['ids','id'])||{});}})[_0x2d07('0x27')](function(_0x5ed058){logger['info'](_0x2d07('0x28'),_0x550fc5);logger['debug'](_0x2d07('0x28'),_0x550fc5,JSON[_0x2d07('0x18')](_0x5ed058));_0x550344(_0x5ed058);})[_0x2d07('0x1d')](function(_0x5ca32d){logger['error'](_0x2d07('0x28'),_0x5ca32d[_0x2d07('0x1b')],_0x550fc5);_0x16c5ed(_this[_0x2d07('0x19')](0x1f4,_0x5ca32d[_0x2d07('0x1b')]));});});}; \ No newline at end of file +var _0x5581=['ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateMailInteraction','update','body','options','raw','where','limit','find'];(function(_0x4ec5f9,_0x5aafeb){var _0x12e8ff=function(_0x195da7){while(--_0x195da7){_0x4ec5f9['push'](_0x4ec5f9['shift']());}};_0x12e8ff(++_0x5aafeb);}(_0x5581,0x115));var _0x1558=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x5581[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0x1558('0x0'));var util=require('util');var moment=require(_0x1558('0x1'));var BPromise=require(_0x1558('0x2'));var rs=require(_0x1558('0x3'));var fs=require('fs');var Redis=require(_0x1558('0x4'));var db=require(_0x1558('0x5'))['db'];var utils=require(_0x1558('0x6'));var logger=require('../../config/logger')(_0x1558('0x7'));var config=require(_0x1558('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1558('0x9')][_0x1558('0xa')]({'port':0x232a});config['redis']=_[_0x1558('0xb')](config[_0x1558('0xc')],{'host':_0x1558('0xd'),'port':0x18eb});var socket=require(_0x1558('0xe'))(new Redis(config[_0x1558('0xc')]));require('./mailInteraction.socket')[_0x1558('0xf')](socket);function respondWithRpcPromise(_0xe26278,_0x5f43a1,_0x296193){return new BPromise(function(_0x30f42b,_0x4e97c8){return client[_0x1558('0x10')](_0xe26278,_0x296193)[_0x1558('0x11')](function(_0x2bb578){logger[_0x1558('0x12')](_0x1558('0x13'),_0x5f43a1,_0x1558('0x14'));logger[_0x1558('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x5f43a1,_0x1558('0x14'),JSON[_0x1558('0x16')](_0x2bb578));if(_0x2bb578[_0x1558('0x17')]){if(_0x2bb578[_0x1558('0x17')][_0x1558('0x18')]===0x1f4){logger[_0x1558('0x17')](_0x1558('0x13'),_0x5f43a1,_0x2bb578[_0x1558('0x17')][_0x1558('0x19')]);return _0x4e97c8(_0x2bb578['error'][_0x1558('0x19')]);}logger[_0x1558('0x17')](_0x1558('0x13'),_0x5f43a1,_0x2bb578['error'][_0x1558('0x19')]);return _0x30f42b(_0x2bb578[_0x1558('0x17')][_0x1558('0x19')]);}else{logger[_0x1558('0x12')](_0x1558('0x13'),_0x5f43a1,'request\x20sent');_0x30f42b(_0x2bb578['result'][_0x1558('0x19')]);}})[_0x1558('0x1a')](function(_0xaa0a82){logger[_0x1558('0x17')](_0x1558('0x13'),_0x5f43a1,_0xaa0a82);_0x4e97c8(_0xaa0a82);});});}exports[_0x1558('0x1b')]=function(_0x47755f){var _0x33553=this;return new Promise(function(_0x5719fb,_0x5bb8b3){return db['MailInteraction'][_0x1558('0x1c')](_0x47755f[_0x1558('0x1d')],{'raw':_0x47755f[_0x1558('0x1e')]?_0x47755f[_0x1558('0x1e')][_0x1558('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47755f[_0x1558('0x1e')]?_0x47755f[_0x1558('0x1e')][_0x1558('0x20')]||null:null,'attributes':_0x47755f['options']?_0x47755f[_0x1558('0x1e')]['attributes']||null:null,'limit':_0x47755f[_0x1558('0x1e')]?_0x47755f[_0x1558('0x1e')][_0x1558('0x21')]||null:null})[_0x1558('0x11')](function(_0x327a30){logger[_0x1558('0x12')](_0x1558('0x1b'),_0x47755f);logger['debug'](_0x1558('0x1b'),_0x47755f,JSON[_0x1558('0x16')](_0x327a30));_0x5719fb(_0x327a30);})[_0x1558('0x1a')](function(_0x1ae7c4){logger[_0x1558('0x17')]('UpdateMailInteraction',_0x1ae7c4[_0x1558('0x19')],_0x47755f);_0x5bb8b3(_0x33553[_0x1558('0x17')](0x1f4,_0x1ae7c4[_0x1558('0x19')]));});});};exports['AddTagsToMailInteraction']=function(_0x9d0157){return new Promise(function(_0xfb1c7b,_0x417678){return db['MailInteraction'][_0x1558('0x22')]({'where':_0x9d0157['options']?_0x9d0157[_0x1558('0x1e')][_0x1558('0x20')]||null:null})['then'](function(_0xe8cd0e){if(_0xe8cd0e){return _0xe8cd0e['addTags'](_0x9d0157['body'][_0x1558('0x23')],_[_0x1558('0x24')](_0x9d0157[_0x1558('0x1d')],[_0x1558('0x23'),'id'])||{});}})[_0x1558('0x25')](function(_0x534480){logger['info'](_0x1558('0x26'),_0x9d0157);logger[_0x1558('0x15')](_0x1558('0x26'),_0x9d0157,JSON[_0x1558('0x16')](_0x534480));_0xfb1c7b(_0x534480);})[_0x1558('0x1a')](function(_0x378f21){logger['error'](_0x1558('0x26'),_0x378f21['message'],_0x9d0157);_0x417678(_this[_0x1558('0x17')](0x1f4,_0x378f21[_0x1558('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 381dc05..cee8064 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 _0xb592=['register','length','mailInteraction:','./mailInteraction.events','save','update','emit'];(function(_0x12bc54,_0x179cf9){var _0x1600c2=function(_0x5e11c1){while(--_0x5e11c1){_0x12bc54['push'](_0x12bc54['shift']());}};_0x1600c2(++_0x179cf9);}(_0xb592,0x199));var _0x2b59=function(_0xb27df3,_0x4063cc){_0xb27df3=_0xb27df3-0x0;var _0x3f3c63=_0xb592[_0xb27df3];return _0x3f3c63;};'use strict';var MailInteractionEvents=require(_0x2b59('0x0'));var events=[_0x2b59('0x1'),'remove',_0x2b59('0x2')];function createListener(_0x3d99c1,_0x49f4f5){return function(_0x2a8486){_0x49f4f5[_0x2b59('0x3')](_0x3d99c1,_0x2a8486);};}function removeListener(_0x1b2ac1,_0xecc87e){return function(){MailInteractionEvents['removeListener'](_0x1b2ac1,_0xecc87e);};}exports[_0x2b59('0x4')]=function(_0x42c014){for(var _0x5b92bf=0x0,_0x72db5e=events[_0x2b59('0x5')];_0x5b92bf<_0x72db5e;_0x5b92bf++){var _0x26b46d=events[_0x5b92bf];var _0x28d964=createListener(_0x2b59('0x6')+_0x26b46d,_0x42c014);MailInteractionEvents['on'](_0x26b46d,_0x28d964);}}; \ No newline at end of file +var _0x02e3=['mailInteraction:','./mailInteraction.events','save','remove','update','removeListener','register','length'];(function(_0x35f9cb,_0x313780){var _0x4cb0cd=function(_0x2cc18c){while(--_0x2cc18c){_0x35f9cb['push'](_0x35f9cb['shift']());}};_0x4cb0cd(++_0x313780);}(_0x02e3,0x109));var _0x302e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x02e3[_0x19950b];return _0x3c6b41;};'use strict';var MailInteractionEvents=require(_0x302e('0x0'));var events=[_0x302e('0x1'),_0x302e('0x2'),_0x302e('0x3')];function createListener(_0xa4fe24,_0x2a0a1c){return function(_0x15f266){_0x2a0a1c['emit'](_0xa4fe24,_0x15f266);};}function removeListener(_0x269953,_0x19cdde){return function(){MailInteractionEvents[_0x302e('0x4')](_0x269953,_0x19cdde);};}exports[_0x302e('0x5')]=function(_0x598c15){for(var _0x56fc55=0x0,_0x3434e6=events[_0x302e('0x6')];_0x56fc55<_0x3434e6;_0x56fc55++){var _0x28e2a9=events[_0x56fc55];var _0x5a7dc4=createListener(_0x302e('0x7')+_0x28e2a9,_0x598c15);MailInteractionEvents['on'](_0x28e2a9,_0x5a7dc4);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 0cb90c3..a7dc7e1 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 _0xafc4=['mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','mail'];(function(_0x5df6d5,_0x3d2297){var _0x651656=function(_0x46faa8){while(--_0x46faa8){_0x5df6d5['push'](_0x5df6d5['shift']());}};_0x651656(++_0x3d2297);}(_0xafc4,0x69));var _0x4afc=function(_0xdf314,_0x445029){_0xdf314=_0xdf314-0x0;var _0xd07445=_0xafc4[_0xdf314];return _0xd07445;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var auth=require(_0x4afc('0x4'));var interaction=require(_0x4afc('0x5'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router['get']('/',auth[_0x4afc('0x6')](),controller[_0x4afc('0x7')]);router[_0x4afc('0x8')](_0x4afc('0x9'),auth[_0x4afc('0x6')](),controller[_0x4afc('0xa')]);router['get'](_0x4afc('0xb'),auth[_0x4afc('0x6')](),controller[_0x4afc('0xc')]);router[_0x4afc('0x8')](_0x4afc('0xd'),auth[_0x4afc('0x6')](),controller['download']);router['post']('/',auth[_0x4afc('0x6')](),interaction['tracked'](_0x4afc('0xe'),_0x4afc('0xf')),controller['create']);router[_0x4afc('0x10')](_0x4afc('0xb'),auth[_0x4afc('0x6')](),controller[_0x4afc('0x11')]);router[_0x4afc('0x10')](_0x4afc('0x12'),auth[_0x4afc('0x6')](),controller[_0x4afc('0x13')]);router['put'](_0x4afc('0x14'),auth[_0x4afc('0x6')](),controller[_0x4afc('0x15')]);router[_0x4afc('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x4afc('0x17')]);module['exports']=router; \ No newline at end of file +var _0xdc97=['/describe','/:id','show','download','post','tracked','mail','mailmessage:create','update','put','accept','/:id/reject','reject','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5351c0,_0x39f9f9){_0x5351c0=_0x5351c0-0x0;var _0x4abf55=_0xdc97[_0x5351c0];return _0x4abf55;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var auth=require(_0x7dc9('0x4'));var interaction=require(_0x7dc9('0x5'));var config=require('../../config/environment');var controller=require(_0x7dc9('0x6'));router[_0x7dc9('0x7')]('/',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x9')]);router['get'](_0x7dc9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7dc9('0x7')](_0x7dc9('0xb'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0xc')]);router[_0x7dc9('0x7')]('/:id/download',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0xd')]);router[_0x7dc9('0xe')]('/',auth[_0x7dc9('0x8')](),interaction[_0x7dc9('0xf')](_0x7dc9('0x10'),_0x7dc9('0x11')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7dc9('0x12')]);router[_0x7dc9('0x13')]('/:id/accept',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x14')]);router[_0x7dc9('0x13')](_0x7dc9('0x15'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x16')]);router['delete'](_0x7dc9('0xb'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x17')]);module[_0x7dc9('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 279ff9e..4f1b507 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 _0x22dd=['INTEGER','sequelize','lodash','exports','TEXT','long','BOOLEAN','out','STRING','DATE'];(function(_0x14e083,_0x4f1134){var _0x565a19=function(_0x5d5a0c){while(--_0x5d5a0c){_0x14e083['push'](_0x14e083['shift']());}};_0x565a19(++_0x4f1134);}(_0x22dd,0x6f));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd22d('0x0'));var _=require(_0xd22d('0x1'));module[_0xd22d('0x2')]={'body':{'type':Sequelize[_0xd22d('0x3')](_0xd22d('0x4')),'allowNull':![]},'read':{'type':Sequelize[_0xd22d('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd22d('0x6')),'defaultValue':_0xd22d('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd22d('0x7')](0x1fe)},'from':{'type':Sequelize[_0xd22d('0x7')]},'to':{'type':Sequelize[_0xd22d('0x3')](_0xd22d('0x4'))},'cc':{'type':Sequelize[_0xd22d('0x3')]('long')},'bcc':{'type':Sequelize[_0xd22d('0x3')](_0xd22d('0x4'))},'subject':{'type':Sequelize[_0xd22d('0x3')]},'sentAt':{'type':Sequelize[_0xd22d('0x8')]},'attach':{'type':Sequelize[_0xd22d('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd22d('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xd22d('0x3')](_0xd22d('0x4'))},'originCc':{'type':Sequelize[_0xd22d('0x3')]('long')}}; \ No newline at end of file +var _0xc49b=['long','DATE','sequelize','lodash','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x23edcc,_0x27aae5){var _0x42b16c=function(_0x354085){while(--_0x354085){_0x23edcc['push'](_0x23edcc['shift']());}};_0x42b16c(++_0x27aae5);}(_0xc49b,0x138));var _0xbc49=function(_0x54a37f,_0x46b651){_0x54a37f=_0x54a37f-0x0;var _0x2e3cbe=_0xc49b[_0x54a37f];return _0x2e3cbe;};'use strict';var Sequelize=require(_0xbc49('0x0'));var _=require(_0xbc49('0x1'));module[_0xbc49('0x2')]={'body':{'type':Sequelize[_0xbc49('0x3')]('long'),'allowNull':![]},'read':{'type':Sequelize[_0xbc49('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbc49('0x5')]('in',_0xbc49('0x6')),'defaultValue':_0xbc49('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbc49('0x7')](0x1fe)},'from':{'type':Sequelize[_0xbc49('0x7')]},'to':{'type':Sequelize['TEXT'](_0xbc49('0x8'))},'cc':{'type':Sequelize[_0xbc49('0x3')](_0xbc49('0x8'))},'bcc':{'type':Sequelize[_0xbc49('0x3')]('long')},'subject':{'type':Sequelize[_0xbc49('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xbc49('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xbc49('0x9')]},'originTo':{'type':Sequelize[_0xbc49('0x3')](_0xbc49('0x8'))},'originCc':{'type':Sequelize[_0xbc49('0x3')](_0xbc49('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 6198d93..aaf525f 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 _0x9572=['files','server','from','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','basename','push','readFileSync','build','writeFileSync','download','log','err','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','count','limit','set','Content-Range','reject','save','update','stack','name','send','index','MailMessage','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','findAll','params','find','body','describe','create','direction','out','secret','findOne','MailAccountId','MailServerOut','isNil','Smtp','service','host','port','secure','authentication','auth','attachments','join','root','server/files/attachments','SendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail-interactions','accept','mail','read','readAt','UserId','user','CmContact','Contact','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','MailInteraction','RejectMessage','rejectMessage'];(function(_0x521ec3,_0x274b70){var _0x46cf26=function(_0x326c8d){while(--_0x326c8d){_0x521ec3['push'](_0x521ec3['shift']());}};_0x46cf26(++_0x274b70);}(_0x9572,0x141));var _0x2957=function(_0x4eaa76,_0x99730d){_0x4eaa76=_0x4eaa76-0x0;var _0x7cfdbe=_0x9572[_0x4eaa76];return _0x7cfdbe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2957('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2957('0x1'));var moment=require(_0x2957('0x2'));var BPromise=require(_0x2957('0x3'));var Mustache=require(_0x2957('0x4'));var util=require(_0x2957('0x5'));var path=require(_0x2957('0x6'));var sox=require('sox');var csv=require(_0x2957('0x7'));var ejs=require(_0x2957('0x8'));var fs=require('fs');var _=require(_0x2957('0x9'));var squel=require('squel');var crypto=require(_0x2957('0xa'));var jsforce=require(_0x2957('0xb'));var deskjs=require(_0x2957('0xc'));var toCsv=require(_0x2957('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x2957('0xd'));var hardwareService=require(_0x2957('0xe'));var Redis=require(_0x2957('0xf'));var qs=require(_0x2957('0x10'));var logger=require(_0x2957('0x11'))(_0x2957('0x12'));var utils=require('../../config/utils');var config=require(_0x2957('0x13'));var db=require(_0x2957('0x14'))['db'];config[_0x2957('0x15')]=_[_0x2957('0x16')](config[_0x2957('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x2957('0x17'))(new Redis(config['redis']));require(_0x2957('0x18'))[_0x2957('0x19')](socket);var jayson=require(_0x2957('0x1a'));var client=jayson[_0x2957('0x1b')][_0x2957('0x1c')]({'port':0x232c});var client9003=jayson[_0x2957('0x1b')][_0x2957('0x1c')]({'port':0x232b});var client9002=jayson[_0x2957('0x1b')][_0x2957('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2aeee5,_0x428595,_0x26b1ab,_0x3d67b4){return new BPromise(function(_0x3da7cd,_0x3baf24){var _0x1a2df0=_0x3d67b4||client;return _0x1a2df0['request'](_0x2aeee5,_0x26b1ab)[_0x2957('0x1d')](function(_0x482e42){logger['info'](_0x2957('0x1e'),_0x428595,_0x2957('0x1f'));logger['debug'](_0x2957('0x20'),_0x428595,_0x2957('0x1f'),JSON['stringify'](_0x482e42));if(_0x482e42[_0x2957('0x21')]){if(_0x482e42['error'][_0x2957('0x22')]===0x1f4){logger['error'](_0x2957('0x1e'),_0x428595,_0x482e42[_0x2957('0x21')]['message']);return _0x3baf24(_0x482e42[_0x2957('0x21')][_0x2957('0x23')]);}logger['error'](_0x2957('0x1e'),_0x428595,_0x482e42['error'][_0x2957('0x23')]);return _0x3da7cd(_0x482e42[_0x2957('0x21')][_0x2957('0x23')]);}else{logger[_0x2957('0x24')](_0x2957('0x1e'),_0x428595,_0x2957('0x1f'));_0x3da7cd(_0x482e42[_0x2957('0x25')][_0x2957('0x23')]);}})[_0x2957('0x26')](function(_0x474cfc){logger['error'](_0x2957('0x1e'),_0x428595,_0x474cfc);_0x3baf24(_0x474cfc);});});}function respondWithStatusCode(_0x4de814,_0x32c7a3){_0x32c7a3=_0x32c7a3||0xcc;return function(_0x12d36b){if(_0x12d36b){return _0x4de814[_0x2957('0x27')](_0x32c7a3);}return _0x4de814[_0x2957('0x28')](_0x32c7a3)[_0x2957('0x29')]();};}function respondWithResult(_0x15f5e9,_0x4cca90){_0x4cca90=_0x4cca90||0xc8;return function(_0x33a7bd){if(_0x33a7bd){return _0x15f5e9['status'](_0x4cca90)[_0x2957('0x2a')](_0x33a7bd);}};}function respondWithFilteredResult(_0x5ade53,_0x1d77d4){return function(_0x5cfdf0){if(_0x5cfdf0){var _0x34d241=_0x5cfdf0[_0x2957('0x2b')],_0x59a87e=_0x1d77d4['offset'],_0x401c86=_0x1d77d4['offset']+_0x1d77d4[_0x2957('0x2c')],_0x2578a4;if(_0x401c86>=_0x34d241){_0x401c86=_0x34d241;_0x2578a4=0xc8;}else{_0x2578a4=0xce;}_0x5ade53[_0x2957('0x28')](_0x2578a4);return _0x5ade53[_0x2957('0x2d')](_0x2957('0x2e'),_0x59a87e+'-'+_0x401c86+'/'+_0x34d241)['json'](_0x5cfdf0);}return null;};}function patchUpdates(_0x236c97){return function(_0x1115c3){try{jsonpatch['apply'](_0x1115c3,_0x236c97,!![]);}catch(_0x49231c){return BPromise[_0x2957('0x2f')](_0x49231c);}return _0x1115c3[_0x2957('0x30')]();};}function saveUpdates(_0x136256,_0x596d2d){return function(_0x54dbec){if(_0x54dbec){return _0x54dbec[_0x2957('0x31')](_0x136256)[_0x2957('0x1d')](function(_0x2a98e3){return _0x2a98e3;});}return null;};}function removeEntity(_0x55f8e9,_0x3e312e){return function(_0x3eee74){if(_0x3eee74){return _0x3eee74['destroy']()[_0x2957('0x1d')](function(){_0x55f8e9[_0x2957('0x28')](0xcc)[_0x2957('0x29')]();});}};}function handleEntityNotFound(_0x58abfd,_0x44be94){return function(_0x3b954c){if(!_0x3b954c){_0x58abfd[_0x2957('0x27')](0x194);}return _0x3b954c;};}function handleError(_0x509d5e,_0x2d346e){_0x2d346e=_0x2d346e||0x1f4;return function(_0x28306b){logger['error'](_0x28306b[_0x2957('0x32')]);if(_0x28306b[_0x2957('0x33')]){delete _0x28306b[_0x2957('0x33')];}_0x509d5e[_0x2957('0x28')](_0x2d346e)[_0x2957('0x34')](_0x28306b);};}exports[_0x2957('0x35')]=function(_0x2dba1d,_0x1a2105){var _0x4567aa={},_0x16509b={},_0x21433c={'count':0x0,'rows':[]};var _0x3332e5=db[_0x2957('0x36')][_0x2957('0x37')];_0x16509b[_0x2957('0x38')]=_['keys'](_0x3332e5);_0x16509b[_0x2957('0x39')]=_[_0x2957('0x3a')](_0x2dba1d[_0x2957('0x39')]);_0x16509b[_0x2957('0x3b')]=_[_0x2957('0x3c')](_0x16509b[_0x2957('0x38')],_0x16509b[_0x2957('0x39')]);_0x4567aa['attributes']=_[_0x2957('0x3c')](_0x16509b[_0x2957('0x38')],qs['fields'](_0x2dba1d['query'][_0x2957('0x3d')]));_0x4567aa[_0x2957('0x3e')]=_0x4567aa[_0x2957('0x3e')][_0x2957('0x3f')]?_0x4567aa[_0x2957('0x3e')]:_0x16509b[_0x2957('0x38')];if(!_0x2dba1d[_0x2957('0x39')][_0x2957('0x40')]('nolimit')){_0x4567aa[_0x2957('0x2c')]=qs[_0x2957('0x2c')](_0x2dba1d[_0x2957('0x39')]['limit']);_0x4567aa['offset']=qs['offset'](_0x2dba1d[_0x2957('0x39')][_0x2957('0x41')]);}_0x4567aa['order']=qs[_0x2957('0x42')](_0x2dba1d['query']['sort']);_0x4567aa[_0x2957('0x43')]=qs['filters'](_[_0x2957('0x44')](_0x2dba1d[_0x2957('0x39')],_0x16509b[_0x2957('0x3b')]));if(_0x2dba1d[_0x2957('0x39')][_0x2957('0x45')]){_0x4567aa['where']=_['merge'](_0x4567aa[_0x2957('0x43')],{'$or':_[_0x2957('0x46')](_0x3332e5,function(_0x315993){if(_0x315993[_0x2957('0x47')][_0x2957('0x48')]!==_0x2957('0x49')){var _0x87b548={};_0x87b548[_0x315993['field']]={'$like':'%'+_0x2dba1d['query'][_0x2957('0x45')]+'%'};return _0x87b548;}})});}_0x4567aa=_[_0x2957('0x4a')]({},_0x4567aa,_0x2dba1d[_0x2957('0x4b')]);var _0x4459c0={'where':_0x4567aa[_0x2957('0x43')]};return db[_0x2957('0x36')][_0x2957('0x2b')](_0x4459c0)[_0x2957('0x1d')](function(_0x2fa602){_0x21433c[_0x2957('0x2b')]=_0x2fa602;if(_0x2dba1d['query'][_0x2957('0x4c')]){_0x4567aa[_0x2957('0x4d')]=[{'all':!![]}];}return db[_0x2957('0x36')][_0x2957('0x4e')](_0x4567aa);})[_0x2957('0x1d')](function(_0x4800fa){_0x21433c['rows']=_0x4800fa;return _0x21433c;})[_0x2957('0x1d')](respondWithFilteredResult(_0x1a2105,_0x4567aa))[_0x2957('0x26')](handleError(_0x1a2105,null));};exports['show']=function(_0x5e211a,_0x3c64a8){var _0x14bc1f={'raw':!![],'where':{'id':_0x5e211a[_0x2957('0x4f')]['id']}},_0x2c348b={};_0x2c348b['model']=_[_0x2957('0x3a')](db[_0x2957('0x36')][_0x2957('0x37')]);_0x2c348b[_0x2957('0x39')]=_['keys'](_0x5e211a[_0x2957('0x39')]);_0x2c348b[_0x2957('0x3b')]=_[_0x2957('0x3c')](_0x2c348b[_0x2957('0x38')],_0x2c348b[_0x2957('0x39')]);_0x14bc1f[_0x2957('0x3e')]=_['intersection'](_0x2c348b[_0x2957('0x38')],qs['fields'](_0x5e211a[_0x2957('0x39')][_0x2957('0x3d')]));_0x14bc1f['attributes']=_0x14bc1f[_0x2957('0x3e')][_0x2957('0x3f')]?_0x14bc1f['attributes']:_0x2c348b[_0x2957('0x38')];if(_0x5e211a[_0x2957('0x39')][_0x2957('0x4c')]){_0x14bc1f[_0x2957('0x4d')]=[{'all':!![]}];}_0x14bc1f=_[_0x2957('0x4a')]({},_0x14bc1f,_0x5e211a['options']);return db[_0x2957('0x36')][_0x2957('0x50')](_0x14bc1f)[_0x2957('0x1d')](handleEntityNotFound(_0x3c64a8,null))['then'](respondWithResult(_0x3c64a8,null))[_0x2957('0x26')](handleError(_0x3c64a8,null));};exports['update']=function(_0x81acf8,_0x2a7b51){if(_0x81acf8['body']['id']){delete _0x81acf8[_0x2957('0x51')]['id'];}return db[_0x2957('0x36')][_0x2957('0x50')]({'where':{'id':_0x81acf8[_0x2957('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2a7b51,null))[_0x2957('0x1d')](saveUpdates(_0x81acf8[_0x2957('0x51')],null))['then'](respondWithResult(_0x2a7b51,null))['catch'](handleError(_0x2a7b51,null));};exports['destroy']=function(_0x10d43f,_0xc3e4f4){return db[_0x2957('0x36')][_0x2957('0x50')]({'where':{'id':_0x10d43f[_0x2957('0x4f')]['id']}})[_0x2957('0x1d')](handleEntityNotFound(_0xc3e4f4,null))[_0x2957('0x1d')](removeEntity(_0xc3e4f4,null))[_0x2957('0x26')](handleError(_0xc3e4f4,null));};exports[_0x2957('0x52')]=function(_0x865483,_0xaa7845){return db[_0x2957('0x36')][_0x2957('0x52')]()[_0x2957('0x1d')](respondWithResult(_0xaa7845,null))[_0x2957('0x26')](handleError(_0xaa7845,null));};exports[_0x2957('0x53')]=function(_0x5a981f,_0x5daeee){return db[_0x2957('0x36')][_0x2957('0x53')](_0x5a981f[_0x2957('0x51')])[_0x2957('0x1d')](function(_0x59177a){if(_0x59177a){if(_0x59177a[_0x2957('0x54')]===_0x2957('0x55')&&!_0x59177a[_0x2957('0x56')]){return db['MailAccount'][_0x2957('0x57')]({'where':{'id':_0x59177a[_0x2957('0x58')]},'include':[{'model':db[_0x2957('0x59')],'as':'Smtp','raw':!![]}]})['then'](function(_0x5d2db3){if(_0x5d2db3&&_0x5d2db3['Smtp']){var _0x2c29bf={'tls':{'rejectUnauthorized':![]}};if(_[_0x2957('0x5a')](_0x5d2db3[_0x2957('0x5b')][_0x2957('0x5c')])){_0x2c29bf[_0x2957('0x5d')]=_0x5d2db3[_0x2957('0x5b')][_0x2957('0x5d')];_0x2c29bf['port']=_0x5d2db3[_0x2957('0x5b')][_0x2957('0x5e')];_0x2c29bf[_0x2957('0x5f')]=_0x5d2db3[_0x2957('0x5b')][_0x2957('0x5f')];if(_0x5d2db3[_0x2957('0x5b')][_0x2957('0x60')]){_0x2c29bf['auth']={'user':_0x5d2db3[_0x2957('0x5b')]['user'],'pass':_0x5d2db3[_0x2957('0x5b')]['pass']};}}else{_0x2c29bf['service']=_0x5d2db3['Smtp']['service'];_0x2c29bf[_0x2957('0x61')]={'user':_0x5d2db3[_0x2957('0x5b')]['user'],'pass':_0x5d2db3[_0x2957('0x5b')]['pass']};_0x2c29bf[_0x2957('0x5f')]=_0x5d2db3[_0x2957('0x5b')][_0x2957('0x5f')];}if(_0x5a981f[_0x2957('0x51')][_0x2957('0x62')]&&_0x5a981f[_0x2957('0x51')]['attachments'][_0x2957('0x3f')]){for(var _0x5c3ecd=0x0;_0x5c3ecd<_0x5a981f[_0x2957('0x51')]['attachments'][_0x2957('0x3f')];_0x5c3ecd+=0x1){_0x5a981f[_0x2957('0x51')][_0x2957('0x62')][_0x5c3ecd]={'filename':_0x5a981f[_0x2957('0x51')][_0x2957('0x62')][_0x5c3ecd][_0x2957('0x33')],'path':path[_0x2957('0x63')](config[_0x2957('0x64')],_0x2957('0x65'),_0x5a981f[_0x2957('0x51')]['attachments'][_0x5c3ecd]['basename'])};}}return{'account':_0x2c29bf,'message':_0x5a981f[_0x2957('0x51')]};}})[_0x2957('0x1d')](function(_0xba739e){if(_0xba739e){return respondWithRpcPromise(_0x2957('0x66'),'sendMail',_0xba739e,client9003)[_0x2957('0x1d')](function(_0x167a67){return _0x59177a['update']({'read':!![],'messageId':_0x167a67['messageId'],'sentAt':moment()[_0x2957('0x67')](_0x2957('0x68'))});})[_0x2957('0x26')](function(_0x323261){logger[_0x2957('0x21')]('%s',JSON[_0x2957('0x69')](_0x323261));return _0x59177a;});}return _0x59177a;});}return _0x59177a;}})[_0x2957('0x1d')](respondWithResult(_0x5daeee,0xc9))['catch'](handleError(_0x5daeee,null));};var interaction_log=require(_0x2957('0x11'))(_0x2957('0x6a'));exports[_0x2957('0x6b')]=function(_0x1b20b2,_0x3811ce,_0xcf678b){var _0x984a34={'channel':_0x2957('0x6c')};if(_0x1b20b2[_0x2957('0x51')]['id']){delete _0x1b20b2[_0x2957('0x51')]['id'];}_0x1b20b2[_0x2957('0x51')][_0x2957('0x6d')]=!![];_0x1b20b2[_0x2957('0x51')][_0x2957('0x6e')]=moment()[_0x2957('0x67')](_0x2957('0x68'));_0x1b20b2[_0x2957('0x51')]['UserId']=_0x1b20b2[_0x2957('0x51')][_0x2957('0x6f')]||_0x1b20b2[_0x2957('0x70')]['id'];return db['MailMessage']['find']({'where':{'id':_0x1b20b2[_0x2957('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0x2957('0x71')],'as':_0x2957('0x72')}]})[_0x2957('0x1d')](handleEntityNotFound(_0x3811ce,null))[_0x2957('0x1d')](saveUpdates(_0x1b20b2['body'],null))[_0x2957('0x1d')](function(_0x223a15){if(_0x223a15){_0x984a34[_0x2957('0x23')]=_0x223a15['get']({'plain':!![]});return db['MailInteraction'][_0x2957('0x50')]({'where':{'id':_0x223a15['MailInteractionId']}});}return null;})[_0x2957('0x1d')](handleEntityNotFound(_0x3811ce,null))[_0x2957('0x1d')](function(_0x3a8e4){if(_0x3a8e4){return _0x3a8e4[_0x2957('0x31')]({'UserId':_0x1b20b2[_0x2957('0x51')]['UserId'],'read1stAt':_[_0x2957('0x5a')](_0x3a8e4[_0x2957('0x73')])?moment()[_0x2957('0x67')](_0x2957('0x68')):undefined});}return null;})[_0x2957('0x1d')](function(_0xa238e5){if(_0xa238e5){_0x984a34[_0x2957('0x74')]=_0xa238e5['get']({'plain':!![]});interaction_log['info'](_0x2957('0x75'),_0x1b20b2[_0x2957('0x70')]['id'],_0x1b20b2[_0x2957('0x70')][_0x2957('0x33')],_0x1b20b2[_0x2957('0x70')][_0x2957('0x76')],_0x984a34[_0x2957('0x74')]['id'],_0x1b20b2[_0x2957('0x51')]?JSON['stringify'](_0x1b20b2['body']):_0x2957('0x77'));return respondWithRpcPromise('AcceptMessage',_0x2957('0x78'),_0x984a34);}return null;})[_0x2957('0x1d')](function(_0x1b587b){if(_0x1b587b){if(_0x1b20b2[_0x2957('0x51')][_0x2957('0x79')]){_0x984a34['message'][_0x2957('0x7a')]=util[_0x2957('0x67')](_0x2957('0x7b'),_0x1b20b2['user'][_0x2957('0x33')]);_0x984a34[_0x2957('0x23')][_0x2957('0x7c')]=_0x984a34[_0x2957('0x7c')];_0x984a34[_0x2957('0x23')][_0x2957('0x7d')]=_0x2957('0x6b');return respondWithRpcPromise(_0x2957('0x7e'),_0x2957('0x7e'),{'event':_0x2957('0x7f'),'message':_0x984a34[_0x2957('0x23')]},client9002)['then'](function(){return _0x984a34;});}return _0x984a34;}return null;})[_0x2957('0x1d')](respondWithResult(_0x3811ce,null))[_0x2957('0x26')](handleError(_0x3811ce,null));};var interaction_log=require(_0x2957('0x11'))(_0x2957('0x6a'));exports[_0x2957('0x2f')]=function(_0x9b49bc,_0x10c601,_0x197cc5){var _0x118321={'agent':{},'channel':_0x2957('0x6c')};if(_0x9b49bc['body']['id']){delete _0x9b49bc['body']['id'];}_0x9b49bc[_0x2957('0x51')][_0x2957('0x6f')]=_0x9b49bc[_0x2957('0x51')][_0x2957('0x6f')]||_0x9b49bc[_0x2957('0x70')]['id'];_0x118321['agent']['id']=_0x9b49bc[_0x2957('0x51')]['UserId'];return db[_0x2957('0x36')][_0x2957('0x50')]({'where':{'id':_0x9b49bc[_0x2957('0x4f')]['id'],'UserId':null}})[_0x2957('0x1d')](handleEntityNotFound(_0x10c601,null))[_0x2957('0x1d')](function(_0x1ef2f9){if(_0x1ef2f9){_0x118321[_0x2957('0x23')]=_0x1ef2f9[_0x2957('0x80')]({'plain':!![]});return db[_0x2957('0x81')][_0x2957('0x50')]({'where':{'id':_0x1ef2f9['MailInteractionId']}});}return null;})[_0x2957('0x1d')](handleEntityNotFound(_0x10c601,null))[_0x2957('0x1d')](function(_0x540c49){if(_0x540c49){_0x118321['interaction']=_0x540c49[_0x2957('0x80')]({'plain':!![]});interaction_log[_0x2957('0x24')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x9b49bc['user']['id'],_0x9b49bc[_0x2957('0x70')][_0x2957('0x33')],_0x9b49bc[_0x2957('0x70')][_0x2957('0x76')],_0x118321[_0x2957('0x74')]['id'],_0x9b49bc[_0x2957('0x51')]?JSON[_0x2957('0x69')](_0x9b49bc[_0x2957('0x51')]):_0x2957('0x77'));return respondWithRpcPromise(_0x2957('0x82'),_0x2957('0x83'),_0x118321);}return null;})['then'](function(_0x32624f){if(_0x32624f){_0x32624f[_0x2957('0x23')][_0x2957('0x7a')]=util[_0x2957('0x67')]('SIP/%s',_0x9b49bc[_0x2957('0x70')][_0x2957('0x33')]);_0x32624f[_0x2957('0x23')][_0x2957('0x7c')]=_0x118321[_0x2957('0x7c')];_0x32624f[_0x2957('0x23')][_0x2957('0x7d')]=_0x2957('0x2f');respondWithRpcPromise(_0x2957('0x7e'),_0x2957('0x7e'),{'event':'rejectmessage','message':_0x32624f[_0x2957('0x23')]},client9002);return _0x118321;}return null;})[_0x2957('0x1d')](respondWithResult(_0x10c601,null))[_0x2957('0x26')](handleError(_0x10c601,null));};exports['download']=function(_0x477870,_0x27afa4){var _0x11f858=moment()['unix']()['toString']();var _0x1809c8=path['join'](config[_0x2957('0x64')],'server',_0x2957('0x84'),'tmp');var _0x5a34ec=path[_0x2957('0x63')](config['root'],_0x2957('0x85'),_0x2957('0x84'),_0x2957('0x62'));var _0x1e0040=util[_0x2957('0x67')]('message-%s.eml',_0x11f858);return db[_0x2957('0x36')][_0x2957('0x50')]({'where':{'id':_0x477870[_0x2957('0x4f')]['id']},'attributes':['id',_0x2957('0x51'),_0x2957('0x86'),'to','cc','bcc','subject',_0x2957('0x87')],'include':_0x477870[_0x2957('0x39')][_0x2957('0x62')]?[{'model':db[_0x2957('0x88')],'as':_0x2957('0x89')}]:undefined})['then'](handleEntityNotFound(_0x27afa4,null))[_0x2957('0x1d')](function(_0x17c515){if(_0x17c515){var _0x38ef80=_0x17c515;var _0x308a72={'from':_0x38ef80[_0x2957('0x86')],'to':_0x38ef80['to'],'subject':_0x38ef80[_0x2957('0x8a')],'html':_0x38ef80['body'],'headers':{'Date':moment(_0x38ef80['createdAt'])[_0x2957('0x67')](_0x2957('0x8b'))},'attachments':[]};if(_0x17c515['cc']){_0x308a72[_0x2957('0x8c')]['Cc']=_0x17c515['cc'];}if(_0x17c515['bcc']){_0x308a72['headers'][_0x2957('0x8d')]=_0x17c515[_0x2957('0x8e')];}return new BPromise(function(_0x3da631,_0x2c5fa3){if(_0x17c515['Attachments']){for(var _0x5bdb2f=0x0;_0x5bdb2f<_0x17c515[_0x2957('0x89')][_0x2957('0x3f')];_0x5bdb2f++){var _0x10f8db=_0x17c515[_0x2957('0x89')][_0x5bdb2f];var _0x39168e=path[_0x2957('0x63')](_0x5a34ec,_0x10f8db[_0x2957('0x8f')]);if(fs['existsSync'](_0x39168e)){_0x308a72[_0x2957('0x62')][_0x2957('0x90')]({'name':_0x10f8db[_0x2957('0x33')],'contentType':_0x10f8db[_0x2957('0x47')],'data':fs[_0x2957('0x91')](_0x39168e)});}}}emlformat[_0x2957('0x92')](_0x308a72,function(_0x5b5706,_0xb26864){if(_0x5b5706)return _0x2c5fa3(_0x5b5706);fs[_0x2957('0x93')](path[_0x2957('0x63')](_0x1809c8,_0x1e0040),_0xb26864);return _0x3da631(_0xb26864);});});}})[_0x2957('0x1d')](function(_0x1c2bfb){if(_0x1c2bfb){return _0x27afa4[_0x2957('0x94')](path['join'](_0x1809c8,_0x1e0040),_0x1e0040,function(_0x3b5622){if(_0x3b5622){console[_0x2957('0x95')](_0x2957('0x96'),_0x3b5622);}else{fs['unlinkSync'](path[_0x2957('0x63')](_0x1809c8,_0x1e0040));}});}})['catch'](handleError(_0x27afa4,null));}; \ No newline at end of file +var _0xe6dd=['attachments','join','server/files/attachments','basename','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','CmContact','Contact','get','MailInteraction','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','mail-interactions','reject','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','unix','root','files','tmp','server','from','subject','createdAt','headers','bcc','Bcc','Attachments','existsSync','type','readFileSync','writeFileSync','download','log','err','unlinkSync','html-pdf','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','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','field','MailMessage','count','includeAll','findAll','show','params','options','body','find','describe','create','out','secret','MailAccount','findOne','MailServerOut','Smtp','isNil','host','port','secure','auth','user','service','pass'];(function(_0x59dd7b,_0x51dd2f){var _0x26a63f=function(_0x89b894){while(--_0x89b894){_0x59dd7b['push'](_0x59dd7b['shift']());}};_0x26a63f(++_0x51dd2f);}(_0xe6dd,0x17e));var _0xde6d=function(_0xf1f9d1,_0x42caf7){_0xf1f9d1=_0xf1f9d1-0x0;var _0xd555d=_0xe6dd[_0xf1f9d1];return _0xd555d;};'use strict';var pdf=require(_0xde6d('0x0'));var emlformat=require(_0xde6d('0x1'));var rimraf=require(_0xde6d('0x2'));var zipdir=require(_0xde6d('0x3'));var jsonpatch=require(_0xde6d('0x4'));var rp=require(_0xde6d('0x5'));var moment=require(_0xde6d('0x6'));var BPromise=require(_0xde6d('0x7'));var Mustache=require(_0xde6d('0x8'));var util=require(_0xde6d('0x9'));var path=require(_0xde6d('0xa'));var sox=require(_0xde6d('0xb'));var csv=require(_0xde6d('0xc'));var ejs=require(_0xde6d('0xd'));var fs=require('fs');var _=require(_0xde6d('0xe'));var squel=require('squel');var crypto=require(_0xde6d('0xf'));var jsforce=require(_0xde6d('0x10'));var deskjs=require(_0xde6d('0x11'));var toCsv=require(_0xde6d('0xc'));var querystring=require(_0xde6d('0x12'));var Papa=require('papaparse');var authService=require(_0xde6d('0x13'));var hardwareService=require(_0xde6d('0x14'));var Redis=require('ioredis');var qs=require(_0xde6d('0x15'));var logger=require(_0xde6d('0x16'))(_0xde6d('0x17'));var utils=require(_0xde6d('0x18'));var config=require(_0xde6d('0x19'));var db=require(_0xde6d('0x1a'))['db'];config[_0xde6d('0x1b')]=_[_0xde6d('0x1c')](config[_0xde6d('0x1b')],{'host':_0xde6d('0x1d'),'port':0x18eb});var socket=require(_0xde6d('0x1e'))(new Redis(config['redis']));require(_0xde6d('0x1f'))[_0xde6d('0x20')](socket);var jayson=require(_0xde6d('0x21'));var client=jayson[_0xde6d('0x22')][_0xde6d('0x23')]({'port':0x232c});var client9003=jayson[_0xde6d('0x22')]['http']({'port':0x232b});var client9002=jayson[_0xde6d('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16d71b,_0x4e75c7,_0x5896e0,_0xc428d){return new BPromise(function(_0x570bfd,_0x337507){var _0x568caf=_0xc428d||client;return _0x568caf[_0xde6d('0x24')](_0x16d71b,_0x5896e0)['then'](function(_0x5bea14){logger[_0xde6d('0x25')](_0xde6d('0x26'),_0x4e75c7,_0xde6d('0x27'));logger[_0xde6d('0x28')](_0xde6d('0x29'),_0x4e75c7,_0xde6d('0x27'),JSON[_0xde6d('0x2a')](_0x5bea14));if(_0x5bea14['error']){if(_0x5bea14[_0xde6d('0x2b')]['code']===0x1f4){logger[_0xde6d('0x2b')](_0xde6d('0x26'),_0x4e75c7,_0x5bea14[_0xde6d('0x2b')]['message']);return _0x337507(_0x5bea14['error'][_0xde6d('0x2c')]);}logger[_0xde6d('0x2b')](_0xde6d('0x26'),_0x4e75c7,_0x5bea14['error']['message']);return _0x570bfd(_0x5bea14[_0xde6d('0x2b')][_0xde6d('0x2c')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x4e75c7,'request\x20sent');_0x570bfd(_0x5bea14[_0xde6d('0x2d')][_0xde6d('0x2c')]);}})[_0xde6d('0x2e')](function(_0x3bc8e8){logger['error'](_0xde6d('0x26'),_0x4e75c7,_0x3bc8e8);_0x337507(_0x3bc8e8);});});}function respondWithStatusCode(_0x55ef9f,_0x529ebb){_0x529ebb=_0x529ebb||0xcc;return function(_0x249fb0){if(_0x249fb0){return _0x55ef9f[_0xde6d('0x2f')](_0x529ebb);}return _0x55ef9f[_0xde6d('0x30')](_0x529ebb)['end']();};}function respondWithResult(_0xb7b736,_0x501a5d){_0x501a5d=_0x501a5d||0xc8;return function(_0xc08200){if(_0xc08200){return _0xb7b736[_0xde6d('0x30')](_0x501a5d)[_0xde6d('0x31')](_0xc08200);}};}function respondWithFilteredResult(_0x59b321,_0x5d8a5e){return function(_0x4ad429){if(_0x4ad429){var _0x92b952=_0x4ad429['count'],_0x4126cb=_0x5d8a5e[_0xde6d('0x32')],_0x3c6a48=_0x5d8a5e[_0xde6d('0x32')]+_0x5d8a5e[_0xde6d('0x33')],_0x23f5d5;if(_0x3c6a48>=_0x92b952){_0x3c6a48=_0x92b952;_0x23f5d5=0xc8;}else{_0x23f5d5=0xce;}_0x59b321[_0xde6d('0x30')](_0x23f5d5);return _0x59b321[_0xde6d('0x34')](_0xde6d('0x35'),_0x4126cb+'-'+_0x3c6a48+'/'+_0x92b952)['json'](_0x4ad429);}return null;};}function patchUpdates(_0x5218e9){return function(_0x28228f){try{jsonpatch[_0xde6d('0x36')](_0x28228f,_0x5218e9,!![]);}catch(_0x5a4167){return BPromise['reject'](_0x5a4167);}return _0x28228f['save']();};}function saveUpdates(_0x4fc816,_0x237554){return function(_0x1726f1){if(_0x1726f1){return _0x1726f1[_0xde6d('0x37')](_0x4fc816)[_0xde6d('0x38')](function(_0x173cbd){return _0x173cbd;});}return null;};}function removeEntity(_0x5d468e,_0x17eeba){return function(_0x5581dc){if(_0x5581dc){return _0x5581dc[_0xde6d('0x39')]()['then'](function(){_0x5d468e[_0xde6d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51aa8a,_0x5a40ad){return function(_0x37347e){if(!_0x37347e){_0x51aa8a[_0xde6d('0x2f')](0x194);}return _0x37347e;};}function handleError(_0x419dd9,_0x47f065){_0x47f065=_0x47f065||0x1f4;return function(_0x38ddf1){logger[_0xde6d('0x2b')](_0x38ddf1[_0xde6d('0x3a')]);if(_0x38ddf1[_0xde6d('0x3b')]){delete _0x38ddf1[_0xde6d('0x3b')];}_0x419dd9[_0xde6d('0x30')](_0x47f065)[_0xde6d('0x3c')](_0x38ddf1);};}exports[_0xde6d('0x3d')]=function(_0x53eceb,_0x3edc44){var _0x2196c9={},_0x44e832={},_0x1f91b4={'count':0x0,'rows':[]};var _0x5ecad6=db['MailMessage'][_0xde6d('0x3e')];_0x44e832['model']=_[_0xde6d('0x3f')](_0x5ecad6);_0x44e832[_0xde6d('0x40')]=_['keys'](_0x53eceb['query']);_0x44e832[_0xde6d('0x41')]=_[_0xde6d('0x42')](_0x44e832[_0xde6d('0x43')],_0x44e832[_0xde6d('0x40')]);_0x2196c9['attributes']=_[_0xde6d('0x42')](_0x44e832['model'],qs[_0xde6d('0x44')](_0x53eceb[_0xde6d('0x40')]['fields']));_0x2196c9[_0xde6d('0x45')]=_0x2196c9[_0xde6d('0x45')][_0xde6d('0x46')]?_0x2196c9[_0xde6d('0x45')]:_0x44e832['model'];if(!_0x53eceb[_0xde6d('0x40')][_0xde6d('0x47')](_0xde6d('0x48'))){_0x2196c9[_0xde6d('0x33')]=qs['limit'](_0x53eceb[_0xde6d('0x40')][_0xde6d('0x33')]);_0x2196c9[_0xde6d('0x32')]=qs['offset'](_0x53eceb[_0xde6d('0x40')][_0xde6d('0x32')]);}_0x2196c9[_0xde6d('0x49')]=qs[_0xde6d('0x4a')](_0x53eceb[_0xde6d('0x40')][_0xde6d('0x4a')]);_0x2196c9[_0xde6d('0x4b')]=qs['filters'](_['pick'](_0x53eceb[_0xde6d('0x40')],_0x44e832[_0xde6d('0x41')]));if(_0x53eceb[_0xde6d('0x40')][_0xde6d('0x4c')]){_0x2196c9[_0xde6d('0x4b')]=_[_0xde6d('0x4d')](_0x2196c9[_0xde6d('0x4b')],{'$or':_['map'](_0x5ecad6,function(_0x22207b){if(_0x22207b['type']['key']!=='VIRTUAL'){var _0xece60c={};_0xece60c[_0x22207b[_0xde6d('0x4e')]]={'$like':'%'+_0x53eceb[_0xde6d('0x40')][_0xde6d('0x4c')]+'%'};return _0xece60c;}})});}_0x2196c9=_['merge']({},_0x2196c9,_0x53eceb['options']);var _0x5e4ace={'where':_0x2196c9['where']};return db[_0xde6d('0x4f')][_0xde6d('0x50')](_0x5e4ace)['then'](function(_0xace84b){_0x1f91b4[_0xde6d('0x50')]=_0xace84b;if(_0x53eceb['query'][_0xde6d('0x51')]){_0x2196c9['include']=[{'all':!![]}];}return db[_0xde6d('0x4f')][_0xde6d('0x52')](_0x2196c9);})[_0xde6d('0x38')](function(_0xab9309){_0x1f91b4['rows']=_0xab9309;return _0x1f91b4;})['then'](respondWithFilteredResult(_0x3edc44,_0x2196c9))[_0xde6d('0x2e')](handleError(_0x3edc44,null));};exports[_0xde6d('0x53')]=function(_0x2ae020,_0x46a4c4){var _0x598b75={'raw':!![],'where':{'id':_0x2ae020[_0xde6d('0x54')]['id']}},_0x5bb4d8={};_0x5bb4d8[_0xde6d('0x43')]=_['keys'](db[_0xde6d('0x4f')][_0xde6d('0x3e')]);_0x5bb4d8['query']=_[_0xde6d('0x3f')](_0x2ae020[_0xde6d('0x40')]);_0x5bb4d8[_0xde6d('0x41')]=_[_0xde6d('0x42')](_0x5bb4d8[_0xde6d('0x43')],_0x5bb4d8[_0xde6d('0x40')]);_0x598b75[_0xde6d('0x45')]=_['intersection'](_0x5bb4d8[_0xde6d('0x43')],qs[_0xde6d('0x44')](_0x2ae020[_0xde6d('0x40')][_0xde6d('0x44')]));_0x598b75[_0xde6d('0x45')]=_0x598b75[_0xde6d('0x45')]['length']?_0x598b75[_0xde6d('0x45')]:_0x5bb4d8[_0xde6d('0x43')];if(_0x2ae020['query']['includeAll']){_0x598b75['include']=[{'all':!![]}];}_0x598b75=_[_0xde6d('0x4d')]({},_0x598b75,_0x2ae020[_0xde6d('0x55')]);return db[_0xde6d('0x4f')]['find'](_0x598b75)['then'](handleEntityNotFound(_0x46a4c4,null))['then'](respondWithResult(_0x46a4c4,null))[_0xde6d('0x2e')](handleError(_0x46a4c4,null));};exports[_0xde6d('0x37')]=function(_0x5d2710,_0x4299e3){if(_0x5d2710[_0xde6d('0x56')]['id']){delete _0x5d2710[_0xde6d('0x56')]['id'];}return db[_0xde6d('0x4f')][_0xde6d('0x57')]({'where':{'id':_0x5d2710[_0xde6d('0x54')]['id']}})[_0xde6d('0x38')](handleEntityNotFound(_0x4299e3,null))[_0xde6d('0x38')](saveUpdates(_0x5d2710[_0xde6d('0x56')],null))[_0xde6d('0x38')](respondWithResult(_0x4299e3,null))[_0xde6d('0x2e')](handleError(_0x4299e3,null));};exports['destroy']=function(_0x1038e6,_0x278b11){return db[_0xde6d('0x4f')][_0xde6d('0x57')]({'where':{'id':_0x1038e6['params']['id']}})[_0xde6d('0x38')](handleEntityNotFound(_0x278b11,null))[_0xde6d('0x38')](removeEntity(_0x278b11,null))[_0xde6d('0x2e')](handleError(_0x278b11,null));};exports[_0xde6d('0x58')]=function(_0x31ef37,_0x46e426){return db[_0xde6d('0x4f')]['describe']()[_0xde6d('0x38')](respondWithResult(_0x46e426,null))[_0xde6d('0x2e')](handleError(_0x46e426,null));};exports[_0xde6d('0x59')]=function(_0xe9de23,_0x591f72){return db[_0xde6d('0x4f')][_0xde6d('0x59')](_0xe9de23['body'])['then'](function(_0xfb88d9){if(_0xfb88d9){if(_0xfb88d9['direction']===_0xde6d('0x5a')&&!_0xfb88d9[_0xde6d('0x5b')]){return db[_0xde6d('0x5c')][_0xde6d('0x5d')]({'where':{'id':_0xfb88d9['MailAccountId']},'include':[{'model':db[_0xde6d('0x5e')],'as':_0xde6d('0x5f'),'raw':!![]}]})[_0xde6d('0x38')](function(_0x32968f){if(_0x32968f&&_0x32968f[_0xde6d('0x5f')]){var _0x3ac098={'tls':{'rejectUnauthorized':![]}};if(_[_0xde6d('0x60')](_0x32968f[_0xde6d('0x5f')]['service'])){_0x3ac098[_0xde6d('0x61')]=_0x32968f[_0xde6d('0x5f')]['host'];_0x3ac098[_0xde6d('0x62')]=_0x32968f['Smtp'][_0xde6d('0x62')];_0x3ac098[_0xde6d('0x63')]=_0x32968f['Smtp'][_0xde6d('0x63')];if(_0x32968f['Smtp']['authentication']){_0x3ac098[_0xde6d('0x64')]={'user':_0x32968f[_0xde6d('0x5f')][_0xde6d('0x65')],'pass':_0x32968f[_0xde6d('0x5f')]['pass']};}}else{_0x3ac098['service']=_0x32968f[_0xde6d('0x5f')][_0xde6d('0x66')];_0x3ac098[_0xde6d('0x64')]={'user':_0x32968f[_0xde6d('0x5f')][_0xde6d('0x65')],'pass':_0x32968f[_0xde6d('0x5f')][_0xde6d('0x67')]};_0x3ac098[_0xde6d('0x63')]=_0x32968f[_0xde6d('0x5f')]['secure'];}if(_0xe9de23[_0xde6d('0x56')]['attachments']&&_0xe9de23[_0xde6d('0x56')][_0xde6d('0x68')]['length']){for(var _0x3eb911=0x0;_0x3eb911<_0xe9de23[_0xde6d('0x56')][_0xde6d('0x68')][_0xde6d('0x46')];_0x3eb911+=0x1){_0xe9de23[_0xde6d('0x56')][_0xde6d('0x68')][_0x3eb911]={'filename':_0xe9de23['body'][_0xde6d('0x68')][_0x3eb911]['name'],'path':path[_0xde6d('0x69')](config['root'],_0xde6d('0x6a'),_0xe9de23[_0xde6d('0x56')]['attachments'][_0x3eb911][_0xde6d('0x6b')])};}}return{'account':_0x3ac098,'message':_0xe9de23[_0xde6d('0x56')]};}})['then'](function(_0x32d497){if(_0x32d497){return respondWithRpcPromise(_0xde6d('0x6c'),_0xde6d('0x6d'),_0x32d497,client9003)['then'](function(_0x539207){return _0xfb88d9['update']({'read':!![],'messageId':_0x539207[_0xde6d('0x6e')],'sentAt':moment()[_0xde6d('0x6f')](_0xde6d('0x70'))});})[_0xde6d('0x2e')](function(_0x4b595a){logger[_0xde6d('0x2b')]('%s',JSON['stringify'](_0x4b595a));return _0xfb88d9;});}return _0xfb88d9;});}return _0xfb88d9;}})[_0xde6d('0x38')](respondWithResult(_0x591f72,0xc9))[_0xde6d('0x2e')](handleError(_0x591f72,null));};var interaction_log=require(_0xde6d('0x16'))('mail-interactions');exports[_0xde6d('0x71')]=function(_0x3e8ee5,_0x220312,_0x212357){var _0xb19b98={'channel':_0xde6d('0x72')};if(_0x3e8ee5[_0xde6d('0x56')]['id']){delete _0x3e8ee5[_0xde6d('0x56')]['id'];}_0x3e8ee5[_0xde6d('0x56')][_0xde6d('0x73')]=!![];_0x3e8ee5[_0xde6d('0x56')][_0xde6d('0x74')]=moment()[_0xde6d('0x6f')](_0xde6d('0x70'));_0x3e8ee5['body']['UserId']=_0x3e8ee5[_0xde6d('0x56')][_0xde6d('0x75')]||_0x3e8ee5['user']['id'];return db[_0xde6d('0x4f')][_0xde6d('0x57')]({'where':{'id':_0x3e8ee5[_0xde6d('0x54')]['id'],'UserId':null},'include':[{'model':db[_0xde6d('0x76')],'as':_0xde6d('0x77')}]})['then'](handleEntityNotFound(_0x220312,null))[_0xde6d('0x38')](saveUpdates(_0x3e8ee5[_0xde6d('0x56')],null))[_0xde6d('0x38')](function(_0x572f8f){if(_0x572f8f){_0xb19b98[_0xde6d('0x2c')]=_0x572f8f[_0xde6d('0x78')]({'plain':!![]});return db[_0xde6d('0x79')]['find']({'where':{'id':_0x572f8f['MailInteractionId']}});}return null;})[_0xde6d('0x38')](handleEntityNotFound(_0x220312,null))[_0xde6d('0x38')](function(_0x482e5e){if(_0x482e5e){return _0x482e5e[_0xde6d('0x37')]({'UserId':_0x3e8ee5[_0xde6d('0x56')][_0xde6d('0x75')],'read1stAt':_[_0xde6d('0x60')](_0x482e5e['read1stAt'])?moment()[_0xde6d('0x6f')](_0xde6d('0x70')):undefined});}return null;})[_0xde6d('0x38')](function(_0x4aa7ef){if(_0x4aa7ef){_0xb19b98[_0xde6d('0x7a')]=_0x4aa7ef[_0xde6d('0x78')]({'plain':!![]});interaction_log[_0xde6d('0x25')](_0xde6d('0x7b'),_0x3e8ee5[_0xde6d('0x65')]['id'],_0x3e8ee5[_0xde6d('0x65')][_0xde6d('0x3b')],_0x3e8ee5['user'][_0xde6d('0x7c')],_0xb19b98[_0xde6d('0x7a')]['id'],_0x3e8ee5['body']?JSON[_0xde6d('0x2a')](_0x3e8ee5['body']):'null');return respondWithRpcPromise(_0xde6d('0x7d'),_0xde6d('0x7e'),_0xb19b98);}return null;})['then'](function(_0x187274){if(_0x187274){if(_0x3e8ee5['body'][_0xde6d('0x7f')]){_0xb19b98['message'][_0xde6d('0x80')]=util[_0xde6d('0x6f')](_0xde6d('0x81'),_0x3e8ee5[_0xde6d('0x65')][_0xde6d('0x3b')]);_0xb19b98[_0xde6d('0x2c')][_0xde6d('0x82')]=_0xb19b98[_0xde6d('0x82')];_0xb19b98[_0xde6d('0x2c')][_0xde6d('0x83')]='accept';return respondWithRpcPromise(_0xde6d('0x84'),_0xde6d('0x84'),{'event':_0xde6d('0x85'),'message':_0xb19b98['message']},client9002)[_0xde6d('0x38')](function(){return _0xb19b98;});}return _0xb19b98;}return null;})[_0xde6d('0x38')](respondWithResult(_0x220312,null))[_0xde6d('0x2e')](handleError(_0x220312,null));};var interaction_log=require(_0xde6d('0x16'))(_0xde6d('0x86'));exports[_0xde6d('0x87')]=function(_0x319814,_0x7ba5e2,_0x46bfd8){var _0x1489fd={'agent':{},'channel':_0xde6d('0x72')};if(_0x319814['body']['id']){delete _0x319814[_0xde6d('0x56')]['id'];}_0x319814['body']['UserId']=_0x319814[_0xde6d('0x56')][_0xde6d('0x75')]||_0x319814[_0xde6d('0x65')]['id'];_0x1489fd[_0xde6d('0x88')]['id']=_0x319814[_0xde6d('0x56')][_0xde6d('0x75')];return db[_0xde6d('0x4f')][_0xde6d('0x57')]({'where':{'id':_0x319814[_0xde6d('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7ba5e2,null))[_0xde6d('0x38')](function(_0x34dafd){if(_0x34dafd){_0x1489fd[_0xde6d('0x2c')]=_0x34dafd[_0xde6d('0x78')]({'plain':!![]});return db[_0xde6d('0x79')][_0xde6d('0x57')]({'where':{'id':_0x34dafd['MailInteractionId']}});}return null;})[_0xde6d('0x38')](handleEntityNotFound(_0x7ba5e2,null))['then'](function(_0x5562ae){if(_0x5562ae){_0x1489fd[_0xde6d('0x7a')]=_0x5562ae[_0xde6d('0x78')]({'plain':!![]});interaction_log[_0xde6d('0x25')](_0xde6d('0x89'),_0x319814[_0xde6d('0x65')]['id'],_0x319814['user'][_0xde6d('0x3b')],_0x319814[_0xde6d('0x65')]['role'],_0x1489fd['interaction']['id'],_0x319814['body']?JSON[_0xde6d('0x2a')](_0x319814[_0xde6d('0x56')]):_0xde6d('0x8a'));return respondWithRpcPromise(_0xde6d('0x8b'),_0xde6d('0x8c'),_0x1489fd);}return null;})[_0xde6d('0x38')](function(_0x3d82a1){if(_0x3d82a1){_0x3d82a1[_0xde6d('0x2c')]['interface']=util['format'](_0xde6d('0x81'),_0x319814[_0xde6d('0x65')][_0xde6d('0x3b')]);_0x3d82a1[_0xde6d('0x2c')]['channel']=_0x1489fd[_0xde6d('0x82')];_0x3d82a1[_0xde6d('0x2c')]['event']=_0xde6d('0x87');respondWithRpcPromise(_0xde6d('0x84'),_0xde6d('0x84'),{'event':_0xde6d('0x8d'),'message':_0x3d82a1[_0xde6d('0x2c')]},client9002);return _0x1489fd;}return null;})[_0xde6d('0x38')](respondWithResult(_0x7ba5e2,null))[_0xde6d('0x2e')](handleError(_0x7ba5e2,null));};exports['download']=function(_0x434f98,_0x232564){var _0x39ec7d=moment()[_0xde6d('0x8e')]()['toString']();var _0x1ae39a=path['join'](config[_0xde6d('0x8f')],'server',_0xde6d('0x90'),_0xde6d('0x91'));var _0x4d1524=path['join'](config[_0xde6d('0x8f')],_0xde6d('0x92'),_0xde6d('0x90'),_0xde6d('0x68'));var _0x2b989b=util[_0xde6d('0x6f')]('message-%s.eml',_0x39ec7d);return db[_0xde6d('0x4f')]['find']({'where':{'id':_0x434f98[_0xde6d('0x54')]['id']},'attributes':['id','body',_0xde6d('0x93'),'to','cc','bcc',_0xde6d('0x94'),_0xde6d('0x95')],'include':_0x434f98[_0xde6d('0x40')][_0xde6d('0x68')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0xde6d('0x38')](handleEntityNotFound(_0x232564,null))[_0xde6d('0x38')](function(_0x22dd42){if(_0x22dd42){var _0x2887c3=_0x22dd42;var _0x46c5fa={'from':_0x2887c3[_0xde6d('0x93')],'to':_0x2887c3['to'],'subject':_0x2887c3[_0xde6d('0x94')],'html':_0x2887c3[_0xde6d('0x56')],'headers':{'Date':moment(_0x2887c3['createdAt'])[_0xde6d('0x6f')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x22dd42['cc']){_0x46c5fa[_0xde6d('0x96')]['Cc']=_0x22dd42['cc'];}if(_0x22dd42[_0xde6d('0x97')]){_0x46c5fa['headers'][_0xde6d('0x98')]=_0x22dd42[_0xde6d('0x97')];}return new BPromise(function(_0x4f97f1,_0x850cab){if(_0x22dd42[_0xde6d('0x99')]){for(var _0xc4e8d2=0x0;_0xc4e8d2<_0x22dd42[_0xde6d('0x99')][_0xde6d('0x46')];_0xc4e8d2++){var _0x18faa0=_0x22dd42[_0xde6d('0x99')][_0xc4e8d2];var _0x56cf5f=path['join'](_0x4d1524,_0x18faa0[_0xde6d('0x6b')]);if(fs[_0xde6d('0x9a')](_0x56cf5f)){_0x46c5fa[_0xde6d('0x68')]['push']({'name':_0x18faa0['name'],'contentType':_0x18faa0[_0xde6d('0x9b')],'data':fs[_0xde6d('0x9c')](_0x56cf5f)});}}}emlformat['build'](_0x46c5fa,function(_0x35152a,_0x24bea){if(_0x35152a)return _0x850cab(_0x35152a);fs[_0xde6d('0x9d')](path[_0xde6d('0x69')](_0x1ae39a,_0x2b989b),_0x24bea);return _0x4f97f1(_0x24bea);});});}})[_0xde6d('0x38')](function(_0x52a904){if(_0x52a904){return _0x232564[_0xde6d('0x9e')](path[_0xde6d('0x69')](_0x1ae39a,_0x2b989b),_0x2b989b,function(_0x4dc34c){if(_0x4dc34c){console[_0xde6d('0x9f')](_0xde6d('0xa0'),_0x4dc34c);}else{fs[_0xde6d('0xa1')](path['join'](_0x1ae39a,_0x2b989b));}});}})[_0xde6d('0x2e')](handleError(_0x232564,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 93dc786..37dc430 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 _0x5e0c=['MailMessage','setMaxListeners','save','update','remove','emit','exports','../../mysqldb'];(function(_0x54a294,_0x3c9615){var _0x458711=function(_0x8f0efb){while(--_0x8f0efb){_0x54a294['push'](_0x54a294['shift']());}};_0x458711(++_0x3c9615);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x437339,_0x5ef32b){_0x437339=_0x437339-0x0;var _0x3b4c70=_0x5e0c[_0x437339];return _0x3b4c70;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xc5e0('0x0'))['db'][_0xc5e0('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc5e0('0x2')](0x0);var events={'afterCreate':_0xc5e0('0x3'),'afterUpdate':_0xc5e0('0x4'),'afterDestroy':_0xc5e0('0x5')};function emitEvent(_0x4adda8){return function(_0x60c6c3,_0x108ea2,_0x43f754){MailMessageEvents[_0xc5e0('0x6')](_0x4adda8+':'+_0x60c6c3['id'],_0x60c6c3);MailMessageEvents[_0xc5e0('0x6')](_0x4adda8,_0x60c6c3);_0x43f754(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xc5e0('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x6075=['hasOwnProperty','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6075,0x191));var _0x5607=function(_0x3c28c0,_0x1cb29d){_0x3c28c0=_0x3c28c0-0x0;var _0x12cc9f=_0x6075[_0x3c28c0];return _0x12cc9f;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x5607('0x0'))['db'][_0x5607('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5607('0x2')](0x0);var events={'afterCreate':_0x5607('0x3'),'afterUpdate':_0x5607('0x4'),'afterDestroy':_0x5607('0x5')};function emitEvent(_0xf96316){return function(_0x100852,_0x2a1c03,_0x4d333d){MailMessageEvents[_0x5607('0x6')](_0xf96316+':'+_0x100852['id'],_0x100852);MailMessageEvents[_0x5607('0x6')](_0xf96316,_0x100852);_0x4d333d(null);};}for(var e in events){if(events[_0x5607('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index bb1bf56..d7a99fa 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 _0x65fb=['utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','./mailMessage.attributes','exports','define','messageId','models','get','direction','toLowerCase','out','secret','isNil','findOne','MailInteractionId','then','body','catch','error'];(function(_0x21e76f,_0x4dba56){var _0x336351=function(_0x149429){while(--_0x149429){_0x21e76f['push'](_0x21e76f['shift']());}};_0x336351(++_0x4dba56);}(_0x65fb,0x12c));var _0xb65f=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x65fb[_0x470e67];return _0x28bbde;};'use strict';var _=require('lodash');var util=require(_0xb65f('0x0'));var logger=require('../../config/logger')(_0xb65f('0x1'));var moment=require(_0xb65f('0x2'));var BPromise=require(_0xb65f('0x3'));var rp=require(_0xb65f('0x4'));var attributes=require(_0xb65f('0x5'));module[_0xb65f('0x6')]=function(_0x381911,_0x57d115){return _0x381911[_0xb65f('0x7')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xb65f('0x8'),'fields':[_0xb65f('0x8')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3032c7,_0x5d44d9,_0x7b3de9){var _0x4e7a2a=_0x381911[_0xb65f('0x9')];var _0x24dc0a=_0x3032c7[_0xb65f('0xa')]({'plain':!![]});if(_0x24dc0a['direction']['toLowerCase']()==='in'||_0x24dc0a[_0xb65f('0xb')][_0xb65f('0xc')]()===_0xb65f('0xd')&&!_0x24dc0a[_0xb65f('0xe')]&&!_[_0xb65f('0xf')](_0x24dc0a['UserId'])){_0x4e7a2a['MailInteraction'][_0xb65f('0x10')]({'where':{'id':_0x24dc0a[_0xb65f('0x11')]}})[_0xb65f('0x12')](function(_0x315160){if(_0x315160){_0x315160['update']({'lastMsgAt':_0x24dc0a['createdAt'],'lastMsgDirection':_0x24dc0a[_0xb65f('0xb')][_0xb65f('0xc')](),'lastMsgBody':_0x24dc0a[_0xb65f('0x13')]});}})[_0xb65f('0x14')](function(_0x2677ab){console[_0xb65f('0x15')](_0x2677ab);});}_0x7b3de9();}},'charset':'utf8mb4','collate':_0xb65f('0x16')});}; \ No newline at end of file +var _0xa7b5=['out','secret','MailInteraction','MailInteractionId','then','update','body','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','exports','define','mail_messages','messageId','models','direction','toLowerCase'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0xa7b5,0xac));var _0x5a7b=function(_0xcfccde,_0x501478){_0xcfccde=_0xcfccde-0x0;var _0x2fc4cf=_0xa7b5[_0xcfccde];return _0x2fc4cf;};'use strict';var _=require(_0x5a7b('0x0'));var util=require(_0x5a7b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5a7b('0x2'));var BPromise=require(_0x5a7b('0x3'));var rp=require(_0x5a7b('0x4'));var attributes=require('./mailMessage.attributes');module[_0x5a7b('0x5')]=function(_0x3492c7,_0x9b340c){return _0x3492c7[_0x5a7b('0x6')]('MailMessage',attributes,{'tableName':_0x5a7b('0x7'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x5a7b('0x8')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5df4b8,_0x2abb3c,_0x2a53f5){var _0x2dbf23=_0x3492c7[_0x5a7b('0x9')];var _0x16abfb=_0x5df4b8['get']({'plain':!![]});if(_0x16abfb[_0x5a7b('0xa')]['toLowerCase']()==='in'||_0x16abfb[_0x5a7b('0xa')][_0x5a7b('0xb')]()===_0x5a7b('0xc')&&!_0x16abfb[_0x5a7b('0xd')]&&!_['isNil'](_0x16abfb['UserId'])){_0x2dbf23[_0x5a7b('0xe')]['findOne']({'where':{'id':_0x16abfb[_0x5a7b('0xf')]}})[_0x5a7b('0x10')](function(_0x19fc88){if(_0x19fc88){_0x19fc88[_0x5a7b('0x11')]({'lastMsgAt':_0x16abfb['createdAt'],'lastMsgDirection':_0x16abfb['direction'][_0x5a7b('0xb')](),'lastMsgBody':_0x16abfb[_0x5a7b('0x12')]});}})[_0x5a7b('0x13')](function(_0x27d16e){console[_0x5a7b('0x14')](_0x27d16e);});}_0x2a53f5();}},'charset':_0x5a7b('0x15'),'collate':_0x5a7b('0x16')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0570109..3d7b27c 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 _0x6753=['result','CreateMailMessage','MailMessage','body','options','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0x6753,0xa1));var _0x3675=function(_0x34cb71,_0xa5cf51){_0x34cb71=_0x34cb71-0x0;var _0x5bae6d=_0x6753[_0x34cb71];return _0x5bae6d;};'use strict';var _=require(_0x3675('0x0'));var util=require(_0x3675('0x1'));var moment=require(_0x3675('0x2'));var BPromise=require(_0x3675('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3675('0x4'));var db=require(_0x3675('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3675('0x6'))(_0x3675('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3675('0x8')]({'port':0x232a});config[_0x3675('0x9')]=_[_0x3675('0xa')](config[_0x3675('0x9')],{'host':_0x3675('0xb'),'port':0x18eb});var socket=require(_0x3675('0xc'))(new Redis(config[_0x3675('0x9')]));require(_0x3675('0xd'))[_0x3675('0xe')](socket);function respondWithRpcPromise(_0x1d5d32,_0xa191a5,_0x2a8748){return new BPromise(function(_0x4441b8,_0x420ffa){return client['request'](_0x1d5d32,_0x2a8748)[_0x3675('0xf')](function(_0x173473){logger['info'](_0x3675('0x10'),_0xa191a5,_0x3675('0x11'));logger[_0x3675('0x12')](_0x3675('0x13'),_0xa191a5,_0x3675('0x11'),JSON[_0x3675('0x14')](_0x173473));if(_0x173473[_0x3675('0x15')]){if(_0x173473['error'][_0x3675('0x16')]===0x1f4){logger[_0x3675('0x15')](_0x3675('0x10'),_0xa191a5,_0x173473[_0x3675('0x15')]['message']);return _0x420ffa(_0x173473[_0x3675('0x15')][_0x3675('0x17')]);}logger[_0x3675('0x15')](_0x3675('0x10'),_0xa191a5,_0x173473['error'][_0x3675('0x17')]);return _0x4441b8(_0x173473[_0x3675('0x15')][_0x3675('0x17')]);}else{logger[_0x3675('0x18')](_0x3675('0x10'),_0xa191a5,'request\x20sent');_0x4441b8(_0x173473[_0x3675('0x19')][_0x3675('0x17')]);}})['catch'](function(_0xe9f968){logger['error'](_0x3675('0x10'),_0xa191a5,_0xe9f968);_0x420ffa(_0xe9f968);});});}exports[_0x3675('0x1a')]=function(_0x54d793){var _0x54ec46=this;return new Promise(function(_0x3d1067,_0x2f2faf){return db[_0x3675('0x1b')]['create'](_0x54d793[_0x3675('0x1c')],{'raw':_0x54d793[_0x3675('0x1d')]?_0x54d793['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x129078){logger[_0x3675('0x18')](_0x3675('0x1a'),_0x54d793);logger[_0x3675('0x12')](_0x3675('0x1a'),_0x54d793,JSON[_0x3675('0x14')](_0x129078));_0x3d1067(_0x129078);})[_0x3675('0x1e')](function(_0x5ca335){logger[_0x3675('0x15')](_0x3675('0x1a'),_0x5ca335[_0x3675('0x17')],_0x54d793);_0x2f2faf(_0x54ec46['error'](0x1f4,_0x5ca335['message']));});});}; \ No newline at end of file +var _0x5162=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateMailMessage','MailMessage','create','body','options','catch','lodash','ioredis'];(function(_0x18e3a1,_0xd51faa){var _0x69b4a1=function(_0x2509a8){while(--_0x2509a8){_0x18e3a1['push'](_0x18e3a1['shift']());}};_0x69b4a1(++_0xd51faa);}(_0x5162,0x103));var _0x2516=function(_0x1cf6dd,_0x5bd0c4){_0x1cf6dd=_0x1cf6dd-0x0;var _0x566408=_0x5162[_0x1cf6dd];return _0x566408;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2516('0x1'));var db=require(_0x2516('0x2'))['db'];var utils=require(_0x2516('0x3'));var logger=require(_0x2516('0x4'))(_0x2516('0x5'));var config=require(_0x2516('0x6'));var jayson=require(_0x2516('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2516('0x8')](config[_0x2516('0x9')],{'host':_0x2516('0xa'),'port':0x18eb});var socket=require(_0x2516('0xb'))(new Redis(config[_0x2516('0x9')]));require(_0x2516('0xc'))[_0x2516('0xd')](socket);function respondWithRpcPromise(_0x590875,_0x409550,_0x3f7e71){return new BPromise(function(_0x18bfd3,_0x5dda21){return client['request'](_0x590875,_0x3f7e71)['then'](function(_0x4ceaa1){logger[_0x2516('0xe')](_0x2516('0xf'),_0x409550,_0x2516('0x10'));logger[_0x2516('0x11')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x409550,_0x2516('0x10'),JSON[_0x2516('0x12')](_0x4ceaa1));if(_0x4ceaa1[_0x2516('0x13')]){if(_0x4ceaa1[_0x2516('0x13')][_0x2516('0x14')]===0x1f4){logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);return _0x5dda21(_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);}logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);return _0x18bfd3(_0x4ceaa1['error'][_0x2516('0x15')]);}else{logger[_0x2516('0xe')](_0x2516('0xf'),_0x409550,'request\x20sent');_0x18bfd3(_0x4ceaa1[_0x2516('0x16')]['message']);}})['catch'](function(_0x31a817){logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x31a817);_0x5dda21(_0x31a817);});});}exports[_0x2516('0x17')]=function(_0x198b93){var _0x42ba50=this;return new Promise(function(_0x2bf0ee,_0x113616){return db[_0x2516('0x18')][_0x2516('0x19')](_0x198b93[_0x2516('0x1a')],{'raw':_0x198b93[_0x2516('0x1b')]?_0x198b93[_0x2516('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x12db4d){logger[_0x2516('0xe')](_0x2516('0x17'),_0x198b93);logger[_0x2516('0x11')](_0x2516('0x17'),_0x198b93,JSON[_0x2516('0x12')](_0x12db4d));_0x2bf0ee(_0x12db4d);})[_0x2516('0x1c')](function(_0x950477){logger['error'](_0x2516('0x17'),_0x950477[_0x2516('0x15')],_0x198b93);_0x113616(_0x42ba50[_0x2516('0x13')](0x1f4,_0x950477[_0x2516('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 440ac5e..3de548f 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 _0x0565=['register','length','mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener'];(function(_0x5f0ff3,_0xf76a10){var _0x2955e5=function(_0x3e20aa){while(--_0x3e20aa){_0x5f0ff3['push'](_0x5f0ff3['shift']());}};_0x2955e5(++_0xf76a10);}(_0x0565,0xae));var _0x5056=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0565[_0x20a584];return _0x4b41a8;};'use strict';var MailMessageEvents=require(_0x5056('0x0'));var events=[_0x5056('0x1'),_0x5056('0x2'),_0x5056('0x3')];function createListener(_0x1d20d2,_0x4c9a57){return function(_0x193c1d){_0x4c9a57[_0x5056('0x4')](_0x1d20d2,_0x193c1d);};}function removeListener(_0x34553c,_0x31fbca){return function(){MailMessageEvents[_0x5056('0x5')](_0x34553c,_0x31fbca);};}exports[_0x5056('0x6')]=function(_0x4589f0){for(var _0x135cf9=0x0,_0x51636b=events[_0x5056('0x7')];_0x135cf9<_0x51636b;_0x135cf9++){var _0x50754a=events[_0x135cf9];var _0x23eed4=createListener(_0x5056('0x8')+_0x50754a,_0x4589f0);MailMessageEvents['on'](_0x50754a,_0x23eed4);}}; \ No newline at end of file +var _0x5d89=['mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x109f9e,_0x49fef9){var _0x40a3ab=function(_0x2c52eb){while(--_0x2c52eb){_0x109f9e['push'](_0x109f9e['shift']());}};_0x40a3ab(++_0x49fef9);}(_0x5d89,0x1b1));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require(_0x95d8('0x0'));var events=[_0x95d8('0x1'),_0x95d8('0x2'),_0x95d8('0x3')];function createListener(_0x23fea5,_0x2602f0){return function(_0x983b0b){_0x2602f0[_0x95d8('0x4')](_0x23fea5,_0x983b0b);};}function removeListener(_0x175213,_0x23aec5){return function(){MailMessageEvents[_0x95d8('0x5')](_0x175213,_0x23aec5);};}exports[_0x95d8('0x6')]=function(_0x515bfb){for(var _0x5b764f=0x0,_0x391f66=events[_0x95d8('0x7')];_0x5b764f<_0x391f66;_0x5b764f++){var _0x989a72=events[_0x5b764f];var _0x2f93a9=createListener(_0x95d8('0x8')+_0x989a72,_0x515bfb);MailMessageEvents['on'](_0x989a72,_0x2f93a9);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6970d75..8d61e68 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 _0xec46=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x470300,_0x4ebcbd){var _0x4a950e=function(_0x4aaf7b){while(--_0x4aaf7b){_0x470300['push'](_0x470300['shift']());}};_0x4a950e(++_0x4ebcbd);}(_0xec46,0x1c5));var _0x6ec4=function(_0x3ce76a,_0x465d60){_0x3ce76a=_0x3ce76a-0x0;var _0x3b3bef=_0xec46[_0x3ce76a];return _0x3b3bef;};'use strict';var multer=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var path=require(_0x6ec4('0x2'));var timeout=require(_0x6ec4('0x3'));var express=require(_0x6ec4('0x4'));var router=express[_0x6ec4('0x5')]();var auth=require(_0x6ec4('0x6'));var interaction=require(_0x6ec4('0x7'));var config=require(_0x6ec4('0x8'));var controller=require('./mailQueue.controller');router[_0x6ec4('0x9')]('/',auth['isAuthenticated'](),controller[_0x6ec4('0xa')]);router[_0x6ec4('0x9')](_0x6ec4('0xb'),auth[_0x6ec4('0xc')](),controller[_0x6ec4('0xd')]);router[_0x6ec4('0x9')]('/:id',auth[_0x6ec4('0xc')](),controller[_0x6ec4('0xe')]);router[_0x6ec4('0x9')](_0x6ec4('0xf'),auth[_0x6ec4('0xc')](),controller[_0x6ec4('0x10')]);router[_0x6ec4('0x9')](_0x6ec4('0x11'),auth['isAuthenticated'](),controller[_0x6ec4('0x12')]);router[_0x6ec4('0x9')](_0x6ec4('0x13'),auth['isAuthenticated'](),controller[_0x6ec4('0x14')]);router[_0x6ec4('0x15')]('/',auth[_0x6ec4('0xc')](),controller['create']);router[_0x6ec4('0x15')]('/:id/teams',auth[_0x6ec4('0xc')](),controller[_0x6ec4('0x16')]);router['post'](_0x6ec4('0x13'),auth[_0x6ec4('0xc')](),controller[_0x6ec4('0x17')]);router[_0x6ec4('0x18')]('/:id',auth[_0x6ec4('0xc')](),controller[_0x6ec4('0x19')]);router[_0x6ec4('0x1a')]('/:id',auth[_0x6ec4('0xc')](),controller['destroy']);router[_0x6ec4('0x1a')](_0x6ec4('0x11'),auth[_0x6ec4('0xc')](),controller['removeTeams']);router['delete'](_0x6ec4('0x13'),auth[_0x6ec4('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x22df=['update','removeTeams','delete','/:id/users','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','/describe','get','/:id','show','getMembers','/:id/teams','getTeams','getAgents','create','addTeams','post'];(function(_0x2d46a4,_0x4d76c9){var _0x460231=function(_0x19445c){while(--_0x19445c){_0x2d46a4['push'](_0x2d46a4['shift']());}};_0x460231(++_0x4d76c9);}(_0x22df,0x6d));var _0xf22d=function(_0x212803,_0x16c59f){_0x212803=_0x212803-0x0;var _0x2c243f=_0x22df[_0x212803];return _0x2c243f;};'use strict';var multer=require('multer');var util=require(_0xf22d('0x0'));var path=require(_0xf22d('0x1'));var timeout=require(_0xf22d('0x2'));var express=require(_0xf22d('0x3'));var router=express[_0xf22d('0x4')]();var auth=require(_0xf22d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf22d('0x6'));var controller=require(_0xf22d('0x7'));router['get']('/',auth[_0xf22d('0x8')](),controller[_0xf22d('0x9')]);router['get'](_0xf22d('0xa'),auth[_0xf22d('0x8')](),controller['describe']);router[_0xf22d('0xb')](_0xf22d('0xc'),auth['isAuthenticated'](),controller[_0xf22d('0xd')]);router[_0xf22d('0xb')]('/:id/members',auth[_0xf22d('0x8')](),controller[_0xf22d('0xe')]);router[_0xf22d('0xb')](_0xf22d('0xf'),auth[_0xf22d('0x8')](),controller[_0xf22d('0x10')]);router[_0xf22d('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0xf22d('0x11')]);router['post']('/',auth[_0xf22d('0x8')](),controller[_0xf22d('0x12')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0xf22d('0x13')]);router[_0xf22d('0x14')]('/:id/users',auth[_0xf22d('0x8')](),controller['addAgents']);router['put'](_0xf22d('0xc'),auth[_0xf22d('0x8')](),controller[_0xf22d('0x15')]);router['delete'](_0xf22d('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xf22d('0xf'),auth[_0xf22d('0x8')](),controller[_0xf22d('0x16')]);router[_0xf22d('0x17')](_0xf22d('0x18'),auth[_0xf22d('0x8')](),controller['removeAgents']);module[_0xf22d('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 003ed0a..9330921 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 _0x714b=['roundrobin','sequelize','exports','name','STRING','ENUM','beepall'];(function(_0x58df01,_0x30e266){var _0x353616=function(_0x26c56b){while(--_0x26c56b){_0x58df01['push'](_0x58df01['shift']());}};_0x353616(++_0x30e266);}(_0x714b,0x1c8));var _0xb714=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x714b[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xb714('0x0'));module[_0xb714('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb714('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb714('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb714('0x4')]('rrmemory',_0xb714('0x5'),_0xb714('0x6'))}}; \ No newline at end of file +var _0x8b93=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x599bc8,_0x585db7){var _0x11e65c=function(_0xab889a){while(--_0xab889a){_0x599bc8['push'](_0x599bc8['shift']());}};_0x11e65c(++_0x585db7);}(_0x8b93,0xaa));var _0x38b9=function(_0x29d3d9,_0x15d144){_0x29d3d9=_0x29d3d9-0x0;var _0x1c77db=_0x8b93[_0x29d3d9];return _0x1c77db;};'use strict';var Sequelize=require(_0x38b9('0x0'));module[_0x38b9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x38b9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x38b9('0x3')]},'timeout':{'type':Sequelize[_0x38b9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x38b9('0x5')](_0x38b9('0x6'),_0x38b9('0x7'),_0x38b9('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a42b0f1..00c0942 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 _0xa9e0=['stack','name','index','MailQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','pick','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','union','addAgents','penalty','ids','removeTeams','omit','emit','removeAgents','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error'];(function(_0x69b5e3,_0x2f39af){var _0x114d3b=function(_0x4bc35d){while(--_0x4bc35d){_0x69b5e3['push'](_0x69b5e3['shift']());}};_0x114d3b(++_0x2f39af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./mailQueue.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='MailQueues';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':!![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['MailQueue'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['MailQueue'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931){return db['MailQueue'][_0x0a9e('0x4f')]()['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x42')](handleError(_0x145931,null));};exports['getMembers']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={'raw':!![],'where':{}},_0x2f7092={},_0x65432;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x5da27d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x23')](function(_0x28d814){if(_0x28d814){_0x65432=_0x28d814['get']({'plain':!![]});_0x2f7092[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x51')][_0x0a9e('0x2b')]);_0x2f7092[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x2e')]);_0x47de4c['attributes']=_[_0x0a9e('0x2f')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x31')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x47de4c[_0x0a9e('0x30')]:_0x2f7092[_0x0a9e('0x2c')];if(!_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x47de4c[_0x0a9e('0x1d')]=qs['limit'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x47de4c[_0x0a9e('0x1c')]=qs['offset'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}_0x47de4c[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x5da27d['query'][_0x0a9e('0x35')]);_0x47de4c[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x52')](_0x5da27d[_0x0a9e('0x2e')],_0x2f7092[_0x0a9e('0x36')]));_0x47de4c[_0x0a9e('0x39')][_0x0a9e('0x53')]=_0x28d814['id'];if(_0x5da27d['query'][_0x0a9e('0x37')]){_0x47de4c[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x3a')](_0x47de4c['attributes'],function(_0x5211e3){var _0x242745={};_0x242745[_0x5211e3]={'$like':'%'+_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x242745;})});}_0x47de4c=_[_0x0a9e('0x38')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x3e')]);return db[_0x0a9e('0x51')][_0x0a9e('0x54')](_0x47de4c);}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){return db[_0x0a9e('0x55')][_0x0a9e('0x56')]({'where':{'id':_[_0x0a9e('0x3a')](_0x2d7205,_0x0a9e('0x57')),'role':_0x0a9e('0x58')},'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x59'),_0x0a9e('0x5a'),_0x0a9e('0x5b')]});}})['then'](function(_0x1b0b98){if(_0x1b0b98){return{'count':_0x1b0b98[_0x0a9e('0x1b')],'rows':_[_0x0a9e('0x3a')](_0x1b0b98['rows'],function(_0x1148a1){return{'membername':_0x1148a1[_0x0a9e('0x28')],'UserId':_0x1148a1['id'],'queue_name':_0x65432['name'],'MailQueueId':_0x65432['id'],'interface':util[_0x0a9e('0x5c')](_0x0a9e('0x5d'),_0x0a9e('0x5e'),_0x1148a1[_0x0a9e('0x28')]),'penalty':0x0,'paused':_0x1148a1[_0x0a9e('0x59')],'createdAt':_0x1148a1['createdAt'],'updatedAt':_0x1148a1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5df0ad,_0x47de4c))[_0x0a9e('0x42')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x5f')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x1104ad[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x23')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db['Team'][_0x0a9e('0x2b')]);_0xeef20[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x1104ad[_0x0a9e('0x2e')]);_0xeef20['filters']=_[_0x0a9e('0x2f')](_0xeef20[_0x0a9e('0x2c')],_0xeef20[_0x0a9e('0x2e')]);_0x380ab3[_0x0a9e('0x30')]=_['intersection'](_0xeef20[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x380ab3[_0x0a9e('0x30')]:_0xeef20[_0x0a9e('0x2c')];_0x380ab3[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x380ab3[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x1104ad[_0x0a9e('0x2e')],_0xeef20[_0x0a9e('0x36')]));if(_0x1104ad[_0x0a9e('0x2e')]['filter']){_0x380ab3[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x380ab3[_0x0a9e('0x39')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x30')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2e')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x3e')]);return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x380ab3[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x380ab3[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x1104ad[_0x0a9e('0x2e')]['offset']);}return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})[_0x0a9e('0x23')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x60')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){var _0x5b7940=[];var _0x163710;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0xf0db1[_0x0a9e('0x47')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x94dcf5){if(_0x94dcf5){for(var _0x5ac73d=0x0;_0x5ac73d<_0x94dcf5[_0x0a9e('0x32')];_0x5ac73d+=0x1){for(var _0x36e975=0x0;_0x36e975<_0x94dcf5[_0x5ac73d]['Agents']['length'];_0x36e975+=0x1){_0x5b7940=_[_0x0a9e('0x63')](_0x5b7940,[_0x94dcf5[_0x5ac73d]['Agents'][_0x36e975]['id']]);}}return _0x5b7940;}})['then'](function(_0x4dc6b3){if(_0x4dc6b3){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0xf0db1[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3c6dd6){if(_0x3c6dd6){_0x163710=_0x3c6dd6;return _0x163710[_0x0a9e('0x64')](_0x5b7940,{'penalty':_0xf0db1['body'][_0x0a9e('0x65')]});}})['then'](function(_0x2871c1){if(_0x2871c1){return _0x163710[_0x0a9e('0x60')](_0xf0db1[_0x0a9e('0x47')][_0x0a9e('0x66')]);}})['then'](handleEntityNotFound(_0x4bf3a5,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x4bf3a5,null))[_0x0a9e('0x42')](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x67')]=function(_0x5b74c3,_0xb6e411,_0x21e592){var _0x2a563d=[];var _0x22063c;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){for(var _0x40e0f0=0x0;_0x40e0f0<_0x589ff3[_0x0a9e('0x32')];_0x40e0f0+=0x1){for(var _0x3a1974=0x0;_0x3a1974<_0x589ff3[_0x40e0f0]['Agents'][_0x0a9e('0x32')];_0x3a1974+=0x1){_0x2a563d=_['union'](_0x2a563d,[_0x589ff3[_0x40e0f0][_0x0a9e('0x62')][_0x3a1974]['id']]);}}return _0x2a563d;}})[_0x0a9e('0x23')](function(_0x558a87){if(_0x558a87){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x5b74c3[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3a9a85){if(_0x3a9a85){_0x22063c=_0x3a9a85;return _0x22063c['removeAgents'](_0x2a563d);}})[_0x0a9e('0x23')](function(_0x31d25a){if(_0x22063c){return _0x22063c[_0x0a9e('0x67')](_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]);}})[_0x0a9e('0x23')](handleEntityNotFound(_0xb6e411,null))[_0x0a9e('0x23')](respondWithStatusCode(_0xb6e411,null))[_0x0a9e('0x42')](handleError(_0xb6e411,null));};exports[_0x0a9e('0x64')]=function(_0x31af8c,_0x151956,_0x3754e2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x31af8c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x151956,null))[_0x0a9e('0x23')](function(_0x2ed526){if(_0x2ed526){return _0x2ed526[_0x0a9e('0x64')](_0x31af8c['body'][_0x0a9e('0x66')],_[_0x0a9e('0x68')](_0x31af8c['body'],[_0x0a9e('0x66'),'id'])||{})['spread'](function(_0x45d113){for(var _0x27041d=0x0;_0x27041d<_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')]['length'];_0x27041d+=0x1){socket[_0x0a9e('0x69')]('userMailQueue:save',{'UserId':_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')][_0x27041d],'MailQueueId':_0x31af8c['params']['id']});}return _0x45d113;});}})[_0x0a9e('0x23')](respondWithResult(_0x151956,null))[_0x0a9e('0x42')](handleError(_0x151956,null));};exports[_0x0a9e('0x6a')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4ab276[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4c788f,null))[_0x0a9e('0x23')](function(_0x3c75b9){if(_0x3c75b9){return _0x3c75b9[_0x0a9e('0x6a')](_0x4ab276['query'][_0x0a9e('0x66')])['then'](function(_0x287324){if(_[_0x0a9e('0x6b')](_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')])){for(var _0x1b61d5=0x0;_0x1b61d5<_0x4ab276['query'][_0x0a9e('0x66')][_0x0a9e('0x32')];_0x1b61d5+=0x1){socket[_0x0a9e('0x69')](_0x0a9e('0x6c'),{'UserId':_0x4ab276[_0x0a9e('0x2e')]['ids'][_0x1b61d5],'MailQueueId':_0x4ab276['params']['id']});}}else{socket[_0x0a9e('0x69')]('userMailQueue:remove',{'UserId':_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')],'MailQueueId':_0x4ab276[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x4c788f,null))[_0x0a9e('0x42')](handleError(_0x4c788f,null));};exports[_0x0a9e('0x6d')]=function(_0x596312,_0x4db918,_0x1889ed){var _0x5dfbe2={};var _0x2469d1={};var _0x5c689c;var _0x427ccc;return db['MailQueue']['findOne']({'where':{'id':_0x596312[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4db918,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c=_0x170af6;_0x2469d1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x55')][_0x0a9e('0x2b')]);_0x2469d1['query']=_['keys'](_0x596312[_0x0a9e('0x2e')]);_0x2469d1[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],_0x2469d1[_0x0a9e('0x2e')]);_0x5dfbe2['attributes']=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],qs['fields'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5dfbe2[_0x0a9e('0x30')]=_0x5dfbe2[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5dfbe2[_0x0a9e('0x30')]:_0x2469d1[_0x0a9e('0x2c')];_0x5dfbe2[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x596312[_0x0a9e('0x2e')]['sort']);_0x5dfbe2[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x596312[_0x0a9e('0x2e')],_0x2469d1[_0x0a9e('0x36')]));if(_0x596312['query']['filter']){_0x5dfbe2[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x5dfbe2[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x5dfbe2[_0x0a9e('0x30')],function(_0x59e46f){var _0x1339d0={};_0x1339d0[_0x59e46f]={'$like':'%'+_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x1339d0;})});}_0x5dfbe2=_['merge']({},_0x5dfbe2,_0x596312[_0x0a9e('0x3e')]);return _0x5c689c['getAgents'](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x4799d4){if(_0x4799d4){_0x427ccc=_0x4799d4[_0x0a9e('0x32')];if(!_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x5dfbe2[_0x0a9e('0x1d')]=qs['limit'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5dfbe2[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x5c689c[_0x0a9e('0x6d')](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x2aaf07){if(_0x2aaf07){return _0x2aaf07?{'count':_0x427ccc,'rows':_0x2aaf07}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x4db918,null))[_0x0a9e('0x42')](handleError(_0x4db918,null));}; \ No newline at end of file +var _0xa9e0=['stack','name','index','MailQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','pick','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','union','addAgents','penalty','ids','removeTeams','omit','emit','removeAgents','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error'];(function(_0x5ecbf8,_0xf6ee69){var _0x283d64=function(_0x34d6d0){while(--_0x34d6d0){_0x5ecbf8['push'](_0x5ecbf8['shift']());}};_0x283d64(++_0xf6ee69);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./mailQueue.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='MailQueues';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':!![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['MailQueue'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['MailQueue'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931){return db['MailQueue'][_0x0a9e('0x4f')]()['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x42')](handleError(_0x145931,null));};exports['getMembers']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={'raw':!![],'where':{}},_0x2f7092={},_0x65432;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x5da27d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x23')](function(_0x28d814){if(_0x28d814){_0x65432=_0x28d814['get']({'plain':!![]});_0x2f7092[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x51')][_0x0a9e('0x2b')]);_0x2f7092[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x2e')]);_0x47de4c['attributes']=_[_0x0a9e('0x2f')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x31')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x47de4c[_0x0a9e('0x30')]:_0x2f7092[_0x0a9e('0x2c')];if(!_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x47de4c[_0x0a9e('0x1d')]=qs['limit'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x47de4c[_0x0a9e('0x1c')]=qs['offset'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}_0x47de4c[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x5da27d['query'][_0x0a9e('0x35')]);_0x47de4c[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x52')](_0x5da27d[_0x0a9e('0x2e')],_0x2f7092[_0x0a9e('0x36')]));_0x47de4c[_0x0a9e('0x39')][_0x0a9e('0x53')]=_0x28d814['id'];if(_0x5da27d['query'][_0x0a9e('0x37')]){_0x47de4c[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x3a')](_0x47de4c['attributes'],function(_0x5211e3){var _0x242745={};_0x242745[_0x5211e3]={'$like':'%'+_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x242745;})});}_0x47de4c=_[_0x0a9e('0x38')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x3e')]);return db[_0x0a9e('0x51')][_0x0a9e('0x54')](_0x47de4c);}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){return db[_0x0a9e('0x55')][_0x0a9e('0x56')]({'where':{'id':_[_0x0a9e('0x3a')](_0x2d7205,_0x0a9e('0x57')),'role':_0x0a9e('0x58')},'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x59'),_0x0a9e('0x5a'),_0x0a9e('0x5b')]});}})['then'](function(_0x1b0b98){if(_0x1b0b98){return{'count':_0x1b0b98[_0x0a9e('0x1b')],'rows':_[_0x0a9e('0x3a')](_0x1b0b98['rows'],function(_0x1148a1){return{'membername':_0x1148a1[_0x0a9e('0x28')],'UserId':_0x1148a1['id'],'queue_name':_0x65432['name'],'MailQueueId':_0x65432['id'],'interface':util[_0x0a9e('0x5c')](_0x0a9e('0x5d'),_0x0a9e('0x5e'),_0x1148a1[_0x0a9e('0x28')]),'penalty':0x0,'paused':_0x1148a1[_0x0a9e('0x59')],'createdAt':_0x1148a1['createdAt'],'updatedAt':_0x1148a1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5df0ad,_0x47de4c))[_0x0a9e('0x42')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x5f')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x1104ad[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x23')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db['Team'][_0x0a9e('0x2b')]);_0xeef20[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x1104ad[_0x0a9e('0x2e')]);_0xeef20['filters']=_[_0x0a9e('0x2f')](_0xeef20[_0x0a9e('0x2c')],_0xeef20[_0x0a9e('0x2e')]);_0x380ab3[_0x0a9e('0x30')]=_['intersection'](_0xeef20[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x380ab3[_0x0a9e('0x30')]:_0xeef20[_0x0a9e('0x2c')];_0x380ab3[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x380ab3[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x1104ad[_0x0a9e('0x2e')],_0xeef20[_0x0a9e('0x36')]));if(_0x1104ad[_0x0a9e('0x2e')]['filter']){_0x380ab3[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x380ab3[_0x0a9e('0x39')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x30')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2e')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x3e')]);return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x380ab3[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x380ab3[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x1104ad[_0x0a9e('0x2e')]['offset']);}return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})[_0x0a9e('0x23')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x60')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){var _0x5b7940=[];var _0x163710;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0xf0db1[_0x0a9e('0x47')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x94dcf5){if(_0x94dcf5){for(var _0x5ac73d=0x0;_0x5ac73d<_0x94dcf5[_0x0a9e('0x32')];_0x5ac73d+=0x1){for(var _0x36e975=0x0;_0x36e975<_0x94dcf5[_0x5ac73d]['Agents']['length'];_0x36e975+=0x1){_0x5b7940=_[_0x0a9e('0x63')](_0x5b7940,[_0x94dcf5[_0x5ac73d]['Agents'][_0x36e975]['id']]);}}return _0x5b7940;}})['then'](function(_0x4dc6b3){if(_0x4dc6b3){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0xf0db1[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3c6dd6){if(_0x3c6dd6){_0x163710=_0x3c6dd6;return _0x163710[_0x0a9e('0x64')](_0x5b7940,{'penalty':_0xf0db1['body'][_0x0a9e('0x65')]});}})['then'](function(_0x2871c1){if(_0x2871c1){return _0x163710[_0x0a9e('0x60')](_0xf0db1[_0x0a9e('0x47')][_0x0a9e('0x66')]);}})['then'](handleEntityNotFound(_0x4bf3a5,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x4bf3a5,null))[_0x0a9e('0x42')](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x67')]=function(_0x5b74c3,_0xb6e411,_0x21e592){var _0x2a563d=[];var _0x22063c;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){for(var _0x40e0f0=0x0;_0x40e0f0<_0x589ff3[_0x0a9e('0x32')];_0x40e0f0+=0x1){for(var _0x3a1974=0x0;_0x3a1974<_0x589ff3[_0x40e0f0]['Agents'][_0x0a9e('0x32')];_0x3a1974+=0x1){_0x2a563d=_['union'](_0x2a563d,[_0x589ff3[_0x40e0f0][_0x0a9e('0x62')][_0x3a1974]['id']]);}}return _0x2a563d;}})[_0x0a9e('0x23')](function(_0x558a87){if(_0x558a87){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x5b74c3[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3a9a85){if(_0x3a9a85){_0x22063c=_0x3a9a85;return _0x22063c['removeAgents'](_0x2a563d);}})[_0x0a9e('0x23')](function(_0x31d25a){if(_0x22063c){return _0x22063c[_0x0a9e('0x67')](_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]);}})[_0x0a9e('0x23')](handleEntityNotFound(_0xb6e411,null))[_0x0a9e('0x23')](respondWithStatusCode(_0xb6e411,null))[_0x0a9e('0x42')](handleError(_0xb6e411,null));};exports[_0x0a9e('0x64')]=function(_0x31af8c,_0x151956,_0x3754e2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x31af8c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x151956,null))[_0x0a9e('0x23')](function(_0x2ed526){if(_0x2ed526){return _0x2ed526[_0x0a9e('0x64')](_0x31af8c['body'][_0x0a9e('0x66')],_[_0x0a9e('0x68')](_0x31af8c['body'],[_0x0a9e('0x66'),'id'])||{})['spread'](function(_0x45d113){for(var _0x27041d=0x0;_0x27041d<_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')]['length'];_0x27041d+=0x1){socket[_0x0a9e('0x69')]('userMailQueue:save',{'UserId':_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')][_0x27041d],'MailQueueId':_0x31af8c['params']['id']});}return _0x45d113;});}})[_0x0a9e('0x23')](respondWithResult(_0x151956,null))[_0x0a9e('0x42')](handleError(_0x151956,null));};exports[_0x0a9e('0x6a')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4ab276[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4c788f,null))[_0x0a9e('0x23')](function(_0x3c75b9){if(_0x3c75b9){return _0x3c75b9[_0x0a9e('0x6a')](_0x4ab276['query'][_0x0a9e('0x66')])['then'](function(_0x287324){if(_[_0x0a9e('0x6b')](_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')])){for(var _0x1b61d5=0x0;_0x1b61d5<_0x4ab276['query'][_0x0a9e('0x66')][_0x0a9e('0x32')];_0x1b61d5+=0x1){socket[_0x0a9e('0x69')](_0x0a9e('0x6c'),{'UserId':_0x4ab276[_0x0a9e('0x2e')]['ids'][_0x1b61d5],'MailQueueId':_0x4ab276['params']['id']});}}else{socket[_0x0a9e('0x69')]('userMailQueue:remove',{'UserId':_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')],'MailQueueId':_0x4ab276[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x4c788f,null))[_0x0a9e('0x42')](handleError(_0x4c788f,null));};exports[_0x0a9e('0x6d')]=function(_0x596312,_0x4db918,_0x1889ed){var _0x5dfbe2={};var _0x2469d1={};var _0x5c689c;var _0x427ccc;return db['MailQueue']['findOne']({'where':{'id':_0x596312[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4db918,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c=_0x170af6;_0x2469d1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x55')][_0x0a9e('0x2b')]);_0x2469d1['query']=_['keys'](_0x596312[_0x0a9e('0x2e')]);_0x2469d1[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],_0x2469d1[_0x0a9e('0x2e')]);_0x5dfbe2['attributes']=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],qs['fields'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5dfbe2[_0x0a9e('0x30')]=_0x5dfbe2[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5dfbe2[_0x0a9e('0x30')]:_0x2469d1[_0x0a9e('0x2c')];_0x5dfbe2[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x596312[_0x0a9e('0x2e')]['sort']);_0x5dfbe2[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x596312[_0x0a9e('0x2e')],_0x2469d1[_0x0a9e('0x36')]));if(_0x596312['query']['filter']){_0x5dfbe2[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x5dfbe2[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x5dfbe2[_0x0a9e('0x30')],function(_0x59e46f){var _0x1339d0={};_0x1339d0[_0x59e46f]={'$like':'%'+_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x1339d0;})});}_0x5dfbe2=_['merge']({},_0x5dfbe2,_0x596312[_0x0a9e('0x3e')]);return _0x5c689c['getAgents'](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x4799d4){if(_0x4799d4){_0x427ccc=_0x4799d4[_0x0a9e('0x32')];if(!_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x5dfbe2[_0x0a9e('0x1d')]=qs['limit'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5dfbe2[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x5c689c[_0x0a9e('0x6d')](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x2aaf07){if(_0x2aaf07){return _0x2aaf07?{'count':_0x427ccc,'rows':_0x2aaf07}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x4db918,null))[_0x0a9e('0x42')](handleError(_0x4db918,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index bb8ced8..ac27da3 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 _0xafc7=['events','MailQueue','setMaxListeners','save','update','emit','hook'];(function(_0x4437ae,_0x133fb2){var _0x2a03db=function(_0x587f90){while(--_0x587f90){_0x4437ae['push'](_0x4437ae['shift']());}};_0x2a03db(++_0x133fb2);}(_0xafc7,0xb6));var _0x7afc=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xafc7[_0x2bf141];return _0x48277b;};'use strict';var EventEmitter=require(_0x7afc('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x7afc('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7afc('0x2')](0x0);var events={'afterCreate':_0x7afc('0x3'),'afterUpdate':_0x7afc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x28cf60){return function(_0x255a73,_0x3c37dd,_0x268703){MailQueueEvents[_0x7afc('0x5')](_0x28cf60+':'+_0x255a73['id'],_0x255a73);MailQueueEvents[_0x7afc('0x5')](_0x28cf60,_0x255a73);_0x268703(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x7afc('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xe2f2=['exports','events','../../mysqldb','MailQueue','save','remove','emit','hasOwnProperty'];(function(_0x344de6,_0x3a858b){var _0x31380=function(_0x51c524){while(--_0x51c524){_0x344de6['push'](_0x344de6['shift']());}};_0x31380(++_0x3a858b);}(_0xe2f2,0x79));var _0x2e2f=function(_0x49d37f,_0x1c1d9e){_0x49d37f=_0x49d37f-0x0;var _0x508b07=_0xe2f2[_0x49d37f];return _0x508b07;};'use strict';var EventEmitter=require(_0x2e2f('0x0'));var MailQueue=require(_0x2e2f('0x1'))['db'][_0x2e2f('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e2f('0x3'),'afterUpdate':'update','afterDestroy':_0x2e2f('0x4')};function emitEvent(_0x451da0){return function(_0x527b57,_0x4148de,_0x35d84c){MailQueueEvents[_0x2e2f('0x5')](_0x451da0+':'+_0x527b57['id'],_0x527b57);MailQueueEvents['emit'](_0x451da0,_0x527b57);_0x35d84c(null);};}for(var e in events){if(events[_0x2e2f('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x2e2f('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f7f375e..4adaef6 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 _0x05aa=['../../config/logger','api','moment','bluebird','request-promise','exports','define','MailQueue','mail_queues'];(function(_0x48a07c,_0x596430){var _0x1f6a06=function(_0x44b73f){while(--_0x44b73f){_0x48a07c['push'](_0x48a07c['shift']());}};_0x1f6a06(++_0x596430);}(_0x05aa,0x1dd));var _0xa05a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x05aa[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa05a('0x0'))(_0xa05a('0x1'));var moment=require(_0xa05a('0x2'));var BPromise=require(_0xa05a('0x3'));var rp=require(_0xa05a('0x4'));var attributes=require('./mailQueue.attributes');module[_0xa05a('0x5')]=function(_0x44a5b9,_0x3c408b){return _0x44a5b9[_0xa05a('0x6')](_0xa05a('0x7'),attributes,{'tableName':_0xa05a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8dfc=['define','MailQueue','mail_queues','lodash','util','api','moment','request-promise','./mailQueue.attributes','exports'];(function(_0x1a9b94,_0x4d763e){var _0x379102=function(_0x1d9e7c){while(--_0x1d9e7c){_0x1a9b94['push'](_0x1a9b94['shift']());}};_0x379102(++_0x4d763e);}(_0x8dfc,0x1c5));var _0xc8df=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x8dfc[_0x215e65];return _0xa85842;};'use strict';var _=require(_0xc8df('0x0'));var util=require(_0xc8df('0x1'));var logger=require('../../config/logger')(_0xc8df('0x2'));var moment=require(_0xc8df('0x3'));var BPromise=require('bluebird');var rp=require(_0xc8df('0x4'));var attributes=require(_0xc8df('0x5'));module[_0xc8df('0x6')]=function(_0x3df450,_0x2de6bc){return _0x3df450[_0xc8df('0x7')](_0xc8df('0x8'),attributes,{'tableName':_0xc8df('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index c28c3ed..219bddf 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 _0xb1bd=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','stringify','where','ShowMailQueue','moment'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xb1bd,0x13a));var _0xdb1b=function(_0x35053d,_0x320bf3){_0x35053d=_0x35053d-0x0;var _0x34f386=_0xb1bd[_0x35053d];return _0x34f386;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb1b('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb1b('0x1'));var db=require(_0xdb1b('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb1b('0x3'))(_0xdb1b('0x4'));var config=require(_0xdb1b('0x5'));var jayson=require(_0xdb1b('0x6'));var client=jayson['client'][_0xdb1b('0x7')]({'port':0x232a});config[_0xdb1b('0x8')]=_[_0xdb1b('0x9')](config['redis'],{'host':_0xdb1b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdb1b('0xb'))['register'](socket);function respondWithRpcPromise(_0x2148bd,_0xfbf138,_0x301689){return new BPromise(function(_0x2a3d9e,_0xccc412){return client[_0xdb1b('0xc')](_0x2148bd,_0x301689)[_0xdb1b('0xd')](function(_0xd00e9){logger[_0xdb1b('0xe')](_0xdb1b('0xf'),_0xfbf138,'request\x20sent');logger[_0xdb1b('0x10')]('MailQueue,\x20%s,\x20%s,\x20%s',_0xfbf138,_0xdb1b('0x11'),JSON['stringify'](_0xd00e9));if(_0xd00e9[_0xdb1b('0x12')]){if(_0xd00e9[_0xdb1b('0x12')][_0xdb1b('0x13')]===0x1f4){logger[_0xdb1b('0x12')](_0xdb1b('0xf'),_0xfbf138,_0xd00e9[_0xdb1b('0x12')][_0xdb1b('0x14')]);return _0xccc412(_0xd00e9[_0xdb1b('0x12')]['message']);}logger[_0xdb1b('0x12')](_0xdb1b('0xf'),_0xfbf138,_0xd00e9[_0xdb1b('0x12')][_0xdb1b('0x14')]);return _0x2a3d9e(_0xd00e9[_0xdb1b('0x12')][_0xdb1b('0x14')]);}else{logger[_0xdb1b('0xe')](_0xdb1b('0xf'),_0xfbf138,'request\x20sent');_0x2a3d9e(_0xd00e9['result'][_0xdb1b('0x14')]);}})[_0xdb1b('0x15')](function(_0x2f6849){logger[_0xdb1b('0x12')](_0xdb1b('0xf'),_0xfbf138,_0x2f6849);_0xccc412(_0x2f6849);});});}exports[_0xdb1b('0x16')]=function(_0x64afb9){var _0x2f85a1=this;return new Promise(function(_0x5ece9e,_0x3d5c6c){return db[_0xdb1b('0x17')][_0xdb1b('0x18')]({'raw':_0x64afb9['options']?_0x64afb9[_0xdb1b('0x19')][_0xdb1b('0x1a')]===undefined?!![]:![]:!![],'where':_0x64afb9[_0xdb1b('0x19')]?_0x64afb9[_0xdb1b('0x19')]['where']||null:null,'attributes':_0x64afb9[_0xdb1b('0x19')]?_0x64afb9[_0xdb1b('0x19')][_0xdb1b('0x1b')]||null:null,'limit':_0x64afb9[_0xdb1b('0x19')]?_0x64afb9[_0xdb1b('0x19')][_0xdb1b('0x1c')]||null:null,'include':_0x64afb9[_0xdb1b('0x19')]?_0x64afb9[_0xdb1b('0x19')][_0xdb1b('0x1d')]?_['map'](_0x64afb9[_0xdb1b('0x19')][_0xdb1b('0x1d')],function(_0xcb15ff){return{'model':db[_0xcb15ff['model']],'as':_0xcb15ff['as'],'attributes':_0xcb15ff['attributes'],'include':_0xcb15ff[_0xdb1b('0x1d')]?_[_0xdb1b('0x1e')](_0xcb15ff[_0xdb1b('0x1d')],function(_0x190564){return{'model':db[_0x190564[_0xdb1b('0x1f')]],'as':_0x190564['as'],'attributes':_0x190564[_0xdb1b('0x1b')],'include':_0x190564['include']?_[_0xdb1b('0x1e')](_0x190564['include'],function(_0x1105b7){return{'model':db[_0x1105b7[_0xdb1b('0x1f')]],'as':_0x1105b7['as'],'attributes':_0x1105b7[_0xdb1b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdb1b('0xd')](function(_0x5bf78e){logger[_0xdb1b('0xe')](_0xdb1b('0x16'),_0x64afb9);logger[_0xdb1b('0x10')]('GetMailQueue',_0x64afb9,JSON[_0xdb1b('0x20')](_0x5bf78e));_0x5ece9e(_0x5bf78e);})[_0xdb1b('0x15')](function(_0x310a9c){logger[_0xdb1b('0x12')](_0xdb1b('0x16'),_0x310a9c[_0xdb1b('0x14')],_0x64afb9);_0x3d5c6c(_0x2f85a1[_0xdb1b('0x12')](0x1f4,_0x310a9c['message']));});});};exports['ShowMailQueue']=function(_0x436d5f){var _0x52833e=this;return new Promise(function(_0x52034e,_0x11d5e1){return db[_0xdb1b('0x17')]['find']({'raw':_0x436d5f[_0xdb1b('0x19')]?_0x436d5f[_0xdb1b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x436d5f[_0xdb1b('0x19')]?_0x436d5f['options'][_0xdb1b('0x21')]||null:null,'attributes':_0x436d5f[_0xdb1b('0x19')]?_0x436d5f[_0xdb1b('0x19')][_0xdb1b('0x1b')]||null:null,'include':_0x436d5f[_0xdb1b('0x19')]?_0x436d5f[_0xdb1b('0x19')][_0xdb1b('0x1d')]?_[_0xdb1b('0x1e')](_0x436d5f[_0xdb1b('0x19')]['include'],function(_0x251d98){return{'model':db[_0x251d98[_0xdb1b('0x1f')]],'as':_0x251d98['as'],'attributes':_0x251d98['attributes'],'include':_0x251d98[_0xdb1b('0x1d')]?_['map'](_0x251d98[_0xdb1b('0x1d')],function(_0x83db03){return{'model':db[_0x83db03[_0xdb1b('0x1f')]],'as':_0x83db03['as'],'attributes':_0x83db03[_0xdb1b('0x1b')],'include':_0x83db03[_0xdb1b('0x1d')]?_[_0xdb1b('0x1e')](_0x83db03[_0xdb1b('0x1d')],function(_0x29ff6f){return{'model':db[_0x29ff6f[_0xdb1b('0x1f')]],'as':_0x29ff6f['as'],'attributes':_0x29ff6f['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb1b('0xd')](function(_0x2ba527){logger[_0xdb1b('0xe')](_0xdb1b('0x22'),_0x436d5f);logger[_0xdb1b('0x10')](_0xdb1b('0x22'),_0x436d5f,JSON[_0xdb1b('0x20')](_0x2ba527));_0x52034e(_0x2ba527);})[_0xdb1b('0x15')](function(_0x487beb){logger[_0xdb1b('0x12')]('ShowMailQueue',_0x487beb['message'],_0x436d5f);_0x11d5e1(_0x52833e['error'](0x1f4,_0x487beb[_0xdb1b('0x14')]));});});}; \ No newline at end of file +var _0x0f11=['raw','attributes','limit','include','map','model','ShowMailQueue','MailQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailQueue','findAll','options'];(function(_0x5aff02,_0x17fb96){var _0x41b451=function(_0x4d8fb1){while(--_0x4d8fb1){_0x5aff02['push'](_0x5aff02['shift']());}};_0x41b451(++_0x17fb96);}(_0x0f11,0x190));var _0x10f1=function(_0x6ecd20,_0x24f72d){_0x6ecd20=_0x6ecd20-0x0;var _0x38205e=_0x0f11[_0x6ecd20];return _0x38205e;};'use strict';var _=require(_0x10f1('0x0'));var util=require('util');var moment=require(_0x10f1('0x1'));var BPromise=require(_0x10f1('0x2'));var rs=require(_0x10f1('0x3'));var fs=require('fs');var Redis=require(_0x10f1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x10f1('0x5'));var logger=require(_0x10f1('0x6'))(_0x10f1('0x7'));var config=require(_0x10f1('0x8'));var jayson=require(_0x10f1('0x9'));var client=jayson[_0x10f1('0xa')]['http']({'port':0x232a});config[_0x10f1('0xb')]=_['defaults'](config[_0x10f1('0xb')],{'host':_0x10f1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10f1('0xb')]));require(_0x10f1('0xd'))[_0x10f1('0xe')](socket);function respondWithRpcPromise(_0x352db0,_0x425285,_0x4c9967){return new BPromise(function(_0x561a01,_0x50558d){return client[_0x10f1('0xf')](_0x352db0,_0x4c9967)[_0x10f1('0x10')](function(_0x142a40){logger[_0x10f1('0x11')](_0x10f1('0x12'),_0x425285,_0x10f1('0x13'));logger[_0x10f1('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x425285,_0x10f1('0x13'),JSON[_0x10f1('0x15')](_0x142a40));if(_0x142a40[_0x10f1('0x16')]){if(_0x142a40[_0x10f1('0x16')][_0x10f1('0x17')]===0x1f4){logger[_0x10f1('0x16')](_0x10f1('0x12'),_0x425285,_0x142a40[_0x10f1('0x16')][_0x10f1('0x18')]);return _0x50558d(_0x142a40[_0x10f1('0x16')][_0x10f1('0x18')]);}logger[_0x10f1('0x16')](_0x10f1('0x12'),_0x425285,_0x142a40['error'][_0x10f1('0x18')]);return _0x561a01(_0x142a40[_0x10f1('0x16')][_0x10f1('0x18')]);}else{logger[_0x10f1('0x11')](_0x10f1('0x12'),_0x425285,_0x10f1('0x13'));_0x561a01(_0x142a40['result']['message']);}})[_0x10f1('0x19')](function(_0x47e645){logger[_0x10f1('0x16')](_0x10f1('0x12'),_0x425285,_0x47e645);_0x50558d(_0x47e645);});});}exports[_0x10f1('0x1a')]=function(_0x30ca68){var _0x289615=this;return new Promise(function(_0x49de75,_0x878c65){return db['MailQueue'][_0x10f1('0x1b')]({'raw':_0x30ca68[_0x10f1('0x1c')]?_0x30ca68[_0x10f1('0x1c')][_0x10f1('0x1d')]===undefined?!![]:![]:!![],'where':_0x30ca68['options']?_0x30ca68[_0x10f1('0x1c')]['where']||null:null,'attributes':_0x30ca68[_0x10f1('0x1c')]?_0x30ca68[_0x10f1('0x1c')][_0x10f1('0x1e')]||null:null,'limit':_0x30ca68[_0x10f1('0x1c')]?_0x30ca68[_0x10f1('0x1c')][_0x10f1('0x1f')]||null:null,'include':_0x30ca68[_0x10f1('0x1c')]?_0x30ca68['options'][_0x10f1('0x20')]?_[_0x10f1('0x21')](_0x30ca68[_0x10f1('0x1c')][_0x10f1('0x20')],function(_0x54ef8b){return{'model':db[_0x54ef8b['model']],'as':_0x54ef8b['as'],'attributes':_0x54ef8b[_0x10f1('0x1e')],'include':_0x54ef8b[_0x10f1('0x20')]?_[_0x10f1('0x21')](_0x54ef8b[_0x10f1('0x20')],function(_0x5e8f31){return{'model':db[_0x5e8f31['model']],'as':_0x5e8f31['as'],'attributes':_0x5e8f31[_0x10f1('0x1e')],'include':_0x5e8f31['include']?_[_0x10f1('0x21')](_0x5e8f31[_0x10f1('0x20')],function(_0x4bc5d6){return{'model':db[_0x4bc5d6[_0x10f1('0x22')]],'as':_0x4bc5d6['as'],'attributes':_0x4bc5d6[_0x10f1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x10f1('0x10')](function(_0x31e096){logger['info'](_0x10f1('0x1a'),_0x30ca68);logger['debug'](_0x10f1('0x1a'),_0x30ca68,JSON[_0x10f1('0x15')](_0x31e096));_0x49de75(_0x31e096);})[_0x10f1('0x19')](function(_0x3ffa2d){logger[_0x10f1('0x16')](_0x10f1('0x1a'),_0x3ffa2d[_0x10f1('0x18')],_0x30ca68);_0x878c65(_0x289615[_0x10f1('0x16')](0x1f4,_0x3ffa2d[_0x10f1('0x18')]));});});};exports[_0x10f1('0x23')]=function(_0x51736d){var _0x525f8e=this;return new Promise(function(_0x2dab23,_0x4db8ca){return db[_0x10f1('0x24')][_0x10f1('0x25')]({'raw':_0x51736d['options']?_0x51736d[_0x10f1('0x1c')][_0x10f1('0x1d')]===undefined?!![]:![]:!![],'where':_0x51736d[_0x10f1('0x1c')]?_0x51736d[_0x10f1('0x1c')][_0x10f1('0x26')]||null:null,'attributes':_0x51736d[_0x10f1('0x1c')]?_0x51736d[_0x10f1('0x1c')][_0x10f1('0x1e')]||null:null,'include':_0x51736d[_0x10f1('0x1c')]?_0x51736d['options'][_0x10f1('0x20')]?_[_0x10f1('0x21')](_0x51736d[_0x10f1('0x1c')]['include'],function(_0x43c16f){return{'model':db[_0x43c16f[_0x10f1('0x22')]],'as':_0x43c16f['as'],'attributes':_0x43c16f['attributes'],'include':_0x43c16f[_0x10f1('0x20')]?_[_0x10f1('0x21')](_0x43c16f[_0x10f1('0x20')],function(_0x1d9542){return{'model':db[_0x1d9542[_0x10f1('0x22')]],'as':_0x1d9542['as'],'attributes':_0x1d9542[_0x10f1('0x1e')],'include':_0x1d9542[_0x10f1('0x20')]?_[_0x10f1('0x21')](_0x1d9542[_0x10f1('0x20')],function(_0x398cb5){return{'model':db[_0x398cb5[_0x10f1('0x22')]],'as':_0x398cb5['as'],'attributes':_0x398cb5[_0x10f1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x10f1('0x10')](function(_0x4471ac){logger[_0x10f1('0x11')]('ShowMailQueue',_0x51736d);logger[_0x10f1('0x14')](_0x10f1('0x23'),_0x51736d,JSON[_0x10f1('0x15')](_0x4471ac));_0x2dab23(_0x4471ac);})[_0x10f1('0x19')](function(_0x30c124){logger['error'](_0x10f1('0x23'),_0x30c124[_0x10f1('0x18')],_0x51736d);_0x4db8ca(_0x525f8e['error'](0x1f4,_0x30c124[_0x10f1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 947aa42..319c2f0 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 _0x20b1=['emit','removeListener','length','./mailQueue.events','remove','update'];(function(_0x258509,_0x48a441){var _0x22ec27=function(_0x235914){while(--_0x235914){_0x258509['push'](_0x258509['shift']());}};_0x22ec27(++_0x48a441);}(_0x20b1,0x1bf));var _0x120b=function(_0x46fdfd,_0x3eaa32){_0x46fdfd=_0x46fdfd-0x0;var _0x855be1=_0x20b1[_0x46fdfd];return _0x855be1;};'use strict';var MailQueueEvents=require(_0x120b('0x0'));var events=['save',_0x120b('0x1'),_0x120b('0x2')];function createListener(_0x5d5989,_0x47254d){return function(_0x481347){_0x47254d[_0x120b('0x3')](_0x5d5989,_0x481347);};}function removeListener(_0x4588d1,_0x42a23d){return function(){MailQueueEvents[_0x120b('0x4')](_0x4588d1,_0x42a23d);};}exports['register']=function(_0x461a0d){for(var _0x18bfd6=0x0,_0x1543ba=events[_0x120b('0x5')];_0x18bfd6<_0x1543ba;_0x18bfd6++){var _0x306375=events[_0x18bfd6];var _0x2783cd=createListener('mailQueue:'+_0x306375,_0x461a0d);MailQueueEvents['on'](_0x306375,_0x2783cd);}}; \ No newline at end of file +var _0xbe73=['update','emit','removeListener','length','mailQueue:','./mailQueue.events','save','remove'];(function(_0x40b2d7,_0x4daf34){var _0x11c68f=function(_0x506214){while(--_0x506214){_0x40b2d7['push'](_0x40b2d7['shift']());}};_0x11c68f(++_0x4daf34);}(_0xbe73,0x75));var _0x3be7=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xbe73[_0x4aba15];return _0x1c8122;};'use strict';var MailQueueEvents=require(_0x3be7('0x0'));var events=[_0x3be7('0x1'),_0x3be7('0x2'),_0x3be7('0x3')];function createListener(_0x5e38ae,_0x281af2){return function(_0x128365){_0x281af2[_0x3be7('0x4')](_0x5e38ae,_0x128365);};}function removeListener(_0x592f4e,_0x41ac68){return function(){MailQueueEvents[_0x3be7('0x5')](_0x592f4e,_0x41ac68);};}exports['register']=function(_0x766a22){for(var _0x34ca50=0x0,_0x5acb41=events[_0x3be7('0x6')];_0x34ca50<_0x5acb41;_0x34ca50++){var _0x1984c7=events[_0x34ca50];var _0x58be3b=createListener(_0x3be7('0x7')+_0x1984c7,_0x766a22);MailQueueEvents['on'](_0x1984c7,_0x58be3b);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f351660..6d3dd13 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 _0x6cc7=['util','path','connect-timeout','express','Router','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x4e1739,_0xee7c0d){var _0x294110=function(_0x3f9fb6){while(--_0x3f9fb6){_0x4e1739['push'](_0x4e1739['shift']());}};_0x294110(++_0xee7c0d);}(_0x6cc7,0xc8));var _0x76cc=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0x6cc7[_0x56138f];return _0x1acaf7;};'use strict';var multer=require('multer');var util=require(_0x76cc('0x0'));var path=require(_0x76cc('0x1'));var timeout=require(_0x76cc('0x2'));var express=require(_0x76cc('0x3'));var router=express[_0x76cc('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x76cc('0x5'));var controller=require(_0x76cc('0x6'));router[_0x76cc('0x7')]('/',auth['isAuthenticated'](),controller[_0x76cc('0x8')]);router['get'](_0x76cc('0x9'),auth[_0x76cc('0xa')](),controller[_0x76cc('0xb')]);router[_0x76cc('0x7')](_0x76cc('0xc'),auth['isAuthenticated'](),controller[_0x76cc('0xd')]);router[_0x76cc('0xe')]('/',auth[_0x76cc('0xa')](),controller[_0x76cc('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x76cc('0x10')]);router[_0x76cc('0x11')]('/:id',auth[_0x76cc('0xa')](),controller[_0x76cc('0x12')]);module[_0x76cc('0x13')]=router; \ No newline at end of file +var _0xf2ea=['put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create'];(function(_0x1123b1,_0x12ef81){var _0x28f035=function(_0x15b179){while(--_0x15b179){_0x1123b1['push'](_0x1123b1['shift']());}};_0x28f035(++_0x12ef81);}(_0xf2ea,0x9d));var _0xaf2e=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xf2ea[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require('multer');var util=require(_0xaf2e('0x0'));var path=require('path');var timeout=require(_0xaf2e('0x1'));var express=require('express');var router=express[_0xaf2e('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xaf2e('0x3'));var config=require(_0xaf2e('0x4'));var controller=require(_0xaf2e('0x5'));router['get']('/',auth[_0xaf2e('0x6')](),controller[_0xaf2e('0x7')]);router[_0xaf2e('0x8')](_0xaf2e('0x9'),auth[_0xaf2e('0x6')](),controller[_0xaf2e('0xa')]);router[_0xaf2e('0x8')](_0xaf2e('0xb'),auth[_0xaf2e('0x6')](),controller[_0xaf2e('0xc')]);router['post']('/',auth[_0xaf2e('0x6')](),controller[_0xaf2e('0xd')]);router[_0xaf2e('0xe')]('/:id',auth[_0xaf2e('0x6')](),controller[_0xaf2e('0xf')]);router[_0xaf2e('0x10')](_0xaf2e('0xb'),auth[_0xaf2e('0x6')](),controller[_0xaf2e('0x11')]);module[_0xaf2e('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index f963956..303fc72 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 _0x5db0=['STRING','moment','DATE'];(function(_0x1c0962,_0x4442c2){var _0x41db7c=function(_0xec9266){while(--_0xec9266){_0x1c0962['push'](_0x1c0962['shift']());}};_0x41db7c(++_0x4442c2);}(_0x5db0,0x15a));var _0x05db=function(_0x1e217c,_0xef5281){_0x1e217c=_0x1e217c-0x0;var _0x1dfa91=_0x5db0[_0x1e217c];return _0x1dfa91;};'use strict';var moment=require(_0x05db('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x05db('0x1')]},'leaveAt':{'type':Sequelize[_0x05db('0x1')]},'acceptAt':{'type':Sequelize[_0x05db('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x05db('0x2')]}}; \ No newline at end of file +var _0x9927=['exports','STRING','DATE','moment','sequelize'];(function(_0x26514b,_0xecf99){var _0x4bf507=function(_0x3eb531){while(--_0x3eb531){_0x26514b['push'](_0x26514b['shift']());}};_0x4bf507(++_0xecf99);}(_0x9927,0xda));var _0x7992=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x9927[_0x13d07a];return _0x5ee0ee;};'use strict';var moment=require(_0x7992('0x0'));var Sequelize=require(_0x7992('0x1'));module[_0x7992('0x2')]={'uniqueid':{'type':Sequelize[_0x7992('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7992('0x3')]},'joinAt':{'type':Sequelize[_0x7992('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7992('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index a185988..3a7f069 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 _0x6507=['body','update','params','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','then','destroy','error','stack','send','index','rawAttributes','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','MailQueueReport','findAll','show','find','create'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0x6507,0x125));var _0x7650=function(_0xbbac6f,_0x11c270){_0xbbac6f=_0xbbac6f-0x0;var _0x2047d3=_0x6507[_0xbbac6f];return _0x2047d3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7650('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7650('0x1'));var jsonpatch=require(_0x7650('0x2'));var rp=require(_0x7650('0x3'));var moment=require(_0x7650('0x4'));var BPromise=require(_0x7650('0x5'));var Mustache=require('mustache');var util=require(_0x7650('0x6'));var path=require(_0x7650('0x7'));var sox=require(_0x7650('0x8'));var csv=require('to-csv');var ejs=require(_0x7650('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7650('0xa'));var crypto=require(_0x7650('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7650('0xc'));var toCsv=require(_0x7650('0xd'));var querystring=require(_0x7650('0xe'));var Papa=require('papaparse');var authService=require(_0x7650('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7650('0x10'));var qs=require(_0x7650('0x11'));var logger=require(_0x7650('0x12'))(_0x7650('0x13'));var utils=require(_0x7650('0x14'));var config=require(_0x7650('0x15'));var db=require(_0x7650('0x16'))['db'];function respondWithStatusCode(_0x554156,_0x53bc33){_0x53bc33=_0x53bc33||0xcc;return function(_0x24cc5c){if(_0x24cc5c){return _0x554156[_0x7650('0x17')](_0x53bc33);}return _0x554156[_0x7650('0x18')](_0x53bc33)[_0x7650('0x19')]();};}function respondWithResult(_0x3ea6e7,_0x3a7f46){_0x3a7f46=_0x3a7f46||0xc8;return function(_0x57e0e5){if(_0x57e0e5){return _0x3ea6e7[_0x7650('0x18')](_0x3a7f46)[_0x7650('0x1a')](_0x57e0e5);}};}function respondWithFilteredResult(_0x4d0a7a,_0x3c5f65){return function(_0x2b855f){if(_0x2b855f){var _0x4b6a0e=_0x2b855f['count'],_0x3d9fad=_0x3c5f65[_0x7650('0x1b')],_0x2a972d=_0x3c5f65['offset']+_0x3c5f65[_0x7650('0x1c')],_0x2876c5;if(_0x2a972d>=_0x4b6a0e){_0x2a972d=_0x4b6a0e;_0x2876c5=0xc8;}else{_0x2876c5=0xce;}_0x4d0a7a[_0x7650('0x18')](_0x2876c5);return _0x4d0a7a[_0x7650('0x1d')](_0x7650('0x1e'),_0x3d9fad+'-'+_0x2a972d+'/'+_0x4b6a0e)[_0x7650('0x1a')](_0x2b855f);}return null;};}function patchUpdates(_0x84380a){return function(_0x1007ba){try{jsonpatch[_0x7650('0x1f')](_0x1007ba,_0x84380a,!![]);}catch(_0x36c9bf){return BPromise['reject'](_0x36c9bf);}return _0x1007ba['save']();};}function saveUpdates(_0x4369c8,_0x4dfa97){return function(_0x55b3f6){if(_0x55b3f6){return _0x55b3f6['update'](_0x4369c8)[_0x7650('0x20')](function(_0x3d32b7){return _0x3d32b7;});}return null;};}function removeEntity(_0x4cfc3b,_0x423b92){return function(_0x154bcd){if(_0x154bcd){return _0x154bcd[_0x7650('0x21')]()[_0x7650('0x20')](function(){_0x4cfc3b[_0x7650('0x18')](0xcc)[_0x7650('0x19')]();});}};}function handleEntityNotFound(_0x3e9bfb,_0x5296c7){return function(_0x2b3828){if(!_0x2b3828){_0x3e9bfb[_0x7650('0x17')](0x194);}return _0x2b3828;};}function handleError(_0x3724c9,_0x13502d){_0x13502d=_0x13502d||0x1f4;return function(_0x22f90d){logger[_0x7650('0x22')](_0x22f90d[_0x7650('0x23')]);if(_0x22f90d['name']){delete _0x22f90d['name'];}_0x3724c9[_0x7650('0x18')](_0x13502d)[_0x7650('0x24')](_0x22f90d);};}exports[_0x7650('0x25')]=function(_0x2f454a,_0x37fdf6){var _0x4176ff={},_0x5348c1={},_0x9c36c9={'count':0x0,'rows':[]};var _0x46aad7=db['MailQueueReport'][_0x7650('0x26')];_0x5348c1['model']=_[_0x7650('0x27')](_0x46aad7);_0x5348c1[_0x7650('0x28')]=_[_0x7650('0x27')](_0x2f454a[_0x7650('0x28')]);_0x5348c1['filters']=_[_0x7650('0x29')](_0x5348c1['model'],_0x5348c1[_0x7650('0x28')]);_0x4176ff['attributes']=_[_0x7650('0x29')](_0x5348c1[_0x7650('0x2a')],qs[_0x7650('0x2b')](_0x2f454a['query']['fields']));_0x4176ff['attributes']=_0x4176ff[_0x7650('0x2c')][_0x7650('0x2d')]?_0x4176ff[_0x7650('0x2c')]:_0x5348c1['model'];if(!_0x2f454a[_0x7650('0x28')]['hasOwnProperty'](_0x7650('0x2e'))){_0x4176ff[_0x7650('0x1c')]=qs['limit'](_0x2f454a[_0x7650('0x28')]['limit']);_0x4176ff[_0x7650('0x1b')]=qs['offset'](_0x2f454a[_0x7650('0x28')]['offset']);}_0x4176ff[_0x7650('0x2f')]=qs[_0x7650('0x30')](_0x2f454a[_0x7650('0x28')][_0x7650('0x30')]);_0x4176ff[_0x7650('0x31')]=qs[_0x7650('0x32')](_[_0x7650('0x33')](_0x2f454a['query'],_0x5348c1[_0x7650('0x32')]));if(_0x2f454a[_0x7650('0x28')][_0x7650('0x34')]){_0x4176ff['where']=_[_0x7650('0x35')](_0x4176ff[_0x7650('0x31')],{'$or':_['map'](_0x46aad7,function(_0x6b3f4c){if(_0x6b3f4c[_0x7650('0x36')][_0x7650('0x37')]!==_0x7650('0x38')){var _0x35ffd8={};_0x35ffd8[_0x6b3f4c[_0x7650('0x39')]]={'$like':'%'+_0x2f454a['query'][_0x7650('0x34')]+'%'};return _0x35ffd8;}})});}_0x4176ff=_[_0x7650('0x35')]({},_0x4176ff,_0x2f454a[_0x7650('0x3a')]);var _0x76dda1={'where':_0x4176ff[_0x7650('0x31')]};return db['MailQueueReport'][_0x7650('0x3b')](_0x76dda1)[_0x7650('0x20')](function(_0x856f9){_0x9c36c9[_0x7650('0x3b')]=_0x856f9;if(_0x2f454a['query'][_0x7650('0x3c')]){_0x4176ff[_0x7650('0x3d')]=[{'all':!![]}];}return db[_0x7650('0x3e')][_0x7650('0x3f')](_0x4176ff);})[_0x7650('0x20')](function(_0x1a478e){_0x9c36c9['rows']=_0x1a478e;return _0x9c36c9;})[_0x7650('0x20')](respondWithFilteredResult(_0x37fdf6,_0x4176ff))['catch'](handleError(_0x37fdf6,null));};exports[_0x7650('0x40')]=function(_0xda2a27,_0x478451){var _0x5b0756={'raw':!![],'where':{'id':_0xda2a27['params']['id']}},_0x2904f9={};_0x2904f9['model']=_['keys'](db['MailQueueReport']['rawAttributes']);_0x2904f9[_0x7650('0x28')]=_['keys'](_0xda2a27['query']);_0x2904f9[_0x7650('0x32')]=_['intersection'](_0x2904f9[_0x7650('0x2a')],_0x2904f9['query']);_0x5b0756[_0x7650('0x2c')]=_[_0x7650('0x29')](_0x2904f9['model'],qs['fields'](_0xda2a27[_0x7650('0x28')][_0x7650('0x2b')]));_0x5b0756[_0x7650('0x2c')]=_0x5b0756[_0x7650('0x2c')]['length']?_0x5b0756[_0x7650('0x2c')]:_0x2904f9[_0x7650('0x2a')];if(_0xda2a27[_0x7650('0x28')]['includeAll']){_0x5b0756['include']=[{'all':!![]}];}_0x5b0756=_['merge']({},_0x5b0756,_0xda2a27['options']);return db[_0x7650('0x3e')][_0x7650('0x41')](_0x5b0756)[_0x7650('0x20')](handleEntityNotFound(_0x478451,null))[_0x7650('0x20')](respondWithResult(_0x478451,null))['catch'](handleError(_0x478451,null));};exports[_0x7650('0x42')]=function(_0x1fa66a,_0x6aba06){return db[_0x7650('0x3e')][_0x7650('0x42')](_0x1fa66a[_0x7650('0x43')],{})[_0x7650('0x20')](respondWithResult(_0x6aba06,0xc9))['catch'](handleError(_0x6aba06,null));};exports[_0x7650('0x44')]=function(_0x1a7501,_0x29f171){if(_0x1a7501['body']['id']){delete _0x1a7501[_0x7650('0x43')]['id'];}return db[_0x7650('0x3e')][_0x7650('0x41')]({'where':{'id':_0x1a7501[_0x7650('0x45')]['id']}})[_0x7650('0x20')](handleEntityNotFound(_0x29f171,null))['then'](saveUpdates(_0x1a7501[_0x7650('0x43')],null))[_0x7650('0x20')](respondWithResult(_0x29f171,null))[_0x7650('0x46')](handleError(_0x29f171,null));};exports[_0x7650('0x21')]=function(_0x5bedfd,_0x4abaaf){return db[_0x7650('0x3e')]['find']({'where':{'id':_0x5bedfd['params']['id']}})[_0x7650('0x20')](handleEntityNotFound(_0x4abaaf,null))[_0x7650('0x20')](removeEntity(_0x4abaaf,null))[_0x7650('0x46')](handleError(_0x4abaaf,null));};exports[_0x7650('0x47')]=function(_0x51ebbf,_0x1cc1c1){return db['MailQueueReport'][_0x7650('0x47')]()[_0x7650('0x20')](respondWithResult(_0x1cc1c1,null))[_0x7650('0x46')](handleError(_0x1cc1c1,null));}; \ No newline at end of file +var _0x8f77=['../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','reject','save','then','end','error','name','index','MailQueueReport','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','update','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api'];(function(_0x3ffa53,_0x3ede30){var _0x1cdce6=function(_0x3f8e9e){while(--_0x3f8e9e){_0x3ffa53['push'](_0x3ffa53['shift']());}};_0x1cdce6(++_0x3ede30);}(_0x8f77,0x7b));var _0x78f7=function(_0x44e00a,_0x248bbc){_0x44e00a=_0x44e00a-0x0;var _0x2bdfba=_0x8f77[_0x44e00a];return _0x2bdfba;};'use strict';var pdf=require(_0x78f7('0x0'));var emlformat=require(_0x78f7('0x1'));var rimraf=require(_0x78f7('0x2'));var zipdir=require(_0x78f7('0x3'));var jsonpatch=require(_0x78f7('0x4'));var rp=require(_0x78f7('0x5'));var moment=require(_0x78f7('0x6'));var BPromise=require(_0x78f7('0x7'));var Mustache=require(_0x78f7('0x8'));var util=require(_0x78f7('0x9'));var path=require(_0x78f7('0xa'));var sox=require('sox');var csv=require(_0x78f7('0xb'));var ejs=require(_0x78f7('0xc'));var fs=require('fs');var _=require(_0x78f7('0xd'));var squel=require('squel');var crypto=require(_0x78f7('0xe'));var jsforce=require(_0x78f7('0xf'));var deskjs=require(_0x78f7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x78f7('0x11'));var Papa=require(_0x78f7('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x78f7('0x13'));var Redis=require('ioredis');var qs=require(_0x78f7('0x14'));var logger=require(_0x78f7('0x15'))(_0x78f7('0x16'));var utils=require(_0x78f7('0x17'));var config=require(_0x78f7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x452a17,_0x16a3eb){_0x16a3eb=_0x16a3eb||0xcc;return function(_0x35b791){if(_0x35b791){return _0x452a17[_0x78f7('0x19')](_0x16a3eb);}return _0x452a17[_0x78f7('0x1a')](_0x16a3eb)['end']();};}function respondWithResult(_0x458704,_0x784960){_0x784960=_0x784960||0xc8;return function(_0x44116d){if(_0x44116d){return _0x458704[_0x78f7('0x1a')](_0x784960)[_0x78f7('0x1b')](_0x44116d);}};}function respondWithFilteredResult(_0x2e1bbe,_0x4f9cab){return function(_0xc459db){if(_0xc459db){var _0x4dda5a=_0xc459db[_0x78f7('0x1c')],_0x18df62=_0x4f9cab[_0x78f7('0x1d')],_0x2ceb33=_0x4f9cab['offset']+_0x4f9cab[_0x78f7('0x1e')],_0x551096;if(_0x2ceb33>=_0x4dda5a){_0x2ceb33=_0x4dda5a;_0x551096=0xc8;}else{_0x551096=0xce;}_0x2e1bbe['status'](_0x551096);return _0x2e1bbe[_0x78f7('0x1f')]('Content-Range',_0x18df62+'-'+_0x2ceb33+'/'+_0x4dda5a)[_0x78f7('0x1b')](_0xc459db);}return null;};}function patchUpdates(_0x5455e4){return function(_0x3110d9){try{jsonpatch['apply'](_0x3110d9,_0x5455e4,!![]);}catch(_0x6e1020){return BPromise[_0x78f7('0x20')](_0x6e1020);}return _0x3110d9[_0x78f7('0x21')]();};}function saveUpdates(_0x5c1bbf,_0xe8039a){return function(_0x38e2d4){if(_0x38e2d4){return _0x38e2d4['update'](_0x5c1bbf)[_0x78f7('0x22')](function(_0x5460de){return _0x5460de;});}return null;};}function removeEntity(_0x39efb3,_0x361eee){return function(_0x5b53a2){if(_0x5b53a2){return _0x5b53a2['destroy']()[_0x78f7('0x22')](function(){_0x39efb3[_0x78f7('0x1a')](0xcc)[_0x78f7('0x23')]();});}};}function handleEntityNotFound(_0x20acf8,_0xc100a6){return function(_0x1489eb){if(!_0x1489eb){_0x20acf8[_0x78f7('0x19')](0x194);}return _0x1489eb;};}function handleError(_0x447a39,_0x171e81){_0x171e81=_0x171e81||0x1f4;return function(_0x22a57e){logger[_0x78f7('0x24')](_0x22a57e['stack']);if(_0x22a57e['name']){delete _0x22a57e[_0x78f7('0x25')];}_0x447a39['status'](_0x171e81)['send'](_0x22a57e);};}exports[_0x78f7('0x26')]=function(_0x55daed,_0x198a4b){var _0x36ef56={},_0x60da39={},_0x2add42={'count':0x0,'rows':[]};var _0x166291=db[_0x78f7('0x27')][_0x78f7('0x28')];_0x60da39['model']=_[_0x78f7('0x29')](_0x166291);_0x60da39[_0x78f7('0x2a')]=_[_0x78f7('0x29')](_0x55daed[_0x78f7('0x2a')]);_0x60da39[_0x78f7('0x2b')]=_[_0x78f7('0x2c')](_0x60da39[_0x78f7('0x2d')],_0x60da39['query']);_0x36ef56[_0x78f7('0x2e')]=_['intersection'](_0x60da39['model'],qs['fields'](_0x55daed[_0x78f7('0x2a')]['fields']));_0x36ef56[_0x78f7('0x2e')]=_0x36ef56[_0x78f7('0x2e')][_0x78f7('0x2f')]?_0x36ef56[_0x78f7('0x2e')]:_0x60da39[_0x78f7('0x2d')];if(!_0x55daed[_0x78f7('0x2a')][_0x78f7('0x30')](_0x78f7('0x31'))){_0x36ef56[_0x78f7('0x1e')]=qs['limit'](_0x55daed[_0x78f7('0x2a')]['limit']);_0x36ef56[_0x78f7('0x1d')]=qs[_0x78f7('0x1d')](_0x55daed[_0x78f7('0x2a')][_0x78f7('0x1d')]);}_0x36ef56['order']=qs[_0x78f7('0x32')](_0x55daed['query']['sort']);_0x36ef56[_0x78f7('0x33')]=qs[_0x78f7('0x2b')](_[_0x78f7('0x34')](_0x55daed['query'],_0x60da39[_0x78f7('0x2b')]));if(_0x55daed['query'][_0x78f7('0x35')]){_0x36ef56['where']=_[_0x78f7('0x36')](_0x36ef56[_0x78f7('0x33')],{'$or':_[_0x78f7('0x37')](_0x166291,function(_0x20eb26){if(_0x20eb26[_0x78f7('0x38')][_0x78f7('0x39')]!==_0x78f7('0x3a')){var _0x406e00={};_0x406e00[_0x20eb26['field']]={'$like':'%'+_0x55daed[_0x78f7('0x2a')][_0x78f7('0x35')]+'%'};return _0x406e00;}})});}_0x36ef56=_[_0x78f7('0x36')]({},_0x36ef56,_0x55daed[_0x78f7('0x3b')]);var _0x48953c={'where':_0x36ef56['where']};return db[_0x78f7('0x27')][_0x78f7('0x1c')](_0x48953c)[_0x78f7('0x22')](function(_0x1033dc){_0x2add42[_0x78f7('0x1c')]=_0x1033dc;if(_0x55daed['query']['includeAll']){_0x36ef56[_0x78f7('0x3c')]=[{'all':!![]}];}return db[_0x78f7('0x27')][_0x78f7('0x3d')](_0x36ef56);})['then'](function(_0x3caff7){_0x2add42[_0x78f7('0x3e')]=_0x3caff7;return _0x2add42;})[_0x78f7('0x22')](respondWithFilteredResult(_0x198a4b,_0x36ef56))[_0x78f7('0x3f')](handleError(_0x198a4b,null));};exports[_0x78f7('0x40')]=function(_0x5f0fc8,_0x9c3493){var _0x591de2={'raw':!![],'where':{'id':_0x5f0fc8[_0x78f7('0x41')]['id']}},_0x34b6ca={};_0x34b6ca['model']=_[_0x78f7('0x29')](db[_0x78f7('0x27')][_0x78f7('0x28')]);_0x34b6ca[_0x78f7('0x2a')]=_[_0x78f7('0x29')](_0x5f0fc8[_0x78f7('0x2a')]);_0x34b6ca[_0x78f7('0x2b')]=_[_0x78f7('0x2c')](_0x34b6ca['model'],_0x34b6ca['query']);_0x591de2[_0x78f7('0x2e')]=_[_0x78f7('0x2c')](_0x34b6ca[_0x78f7('0x2d')],qs['fields'](_0x5f0fc8[_0x78f7('0x2a')][_0x78f7('0x42')]));_0x591de2[_0x78f7('0x2e')]=_0x591de2[_0x78f7('0x2e')][_0x78f7('0x2f')]?_0x591de2[_0x78f7('0x2e')]:_0x34b6ca[_0x78f7('0x2d')];if(_0x5f0fc8[_0x78f7('0x2a')][_0x78f7('0x43')]){_0x591de2[_0x78f7('0x3c')]=[{'all':!![]}];}_0x591de2=_['merge']({},_0x591de2,_0x5f0fc8[_0x78f7('0x3b')]);return db[_0x78f7('0x27')][_0x78f7('0x44')](_0x591de2)[_0x78f7('0x22')](handleEntityNotFound(_0x9c3493,null))[_0x78f7('0x22')](respondWithResult(_0x9c3493,null))[_0x78f7('0x3f')](handleError(_0x9c3493,null));};exports[_0x78f7('0x45')]=function(_0x41d904,_0x578b51){return db['MailQueueReport'][_0x78f7('0x45')](_0x41d904[_0x78f7('0x46')],{})[_0x78f7('0x22')](respondWithResult(_0x578b51,0xc9))[_0x78f7('0x3f')](handleError(_0x578b51,null));};exports[_0x78f7('0x47')]=function(_0x4871ea,_0xbeb9f8){if(_0x4871ea[_0x78f7('0x46')]['id']){delete _0x4871ea[_0x78f7('0x46')]['id'];}return db[_0x78f7('0x27')][_0x78f7('0x44')]({'where':{'id':_0x4871ea[_0x78f7('0x41')]['id']}})['then'](handleEntityNotFound(_0xbeb9f8,null))['then'](saveUpdates(_0x4871ea[_0x78f7('0x46')],null))['then'](respondWithResult(_0xbeb9f8,null))['catch'](handleError(_0xbeb9f8,null));};exports[_0x78f7('0x48')]=function(_0x113f08,_0x439da4){return db[_0x78f7('0x27')][_0x78f7('0x44')]({'where':{'id':_0x113f08[_0x78f7('0x41')]['id']}})[_0x78f7('0x22')](handleEntityNotFound(_0x439da4,null))[_0x78f7('0x22')](removeEntity(_0x439da4,null))[_0x78f7('0x3f')](handleError(_0x439da4,null));};exports['describe']=function(_0x2654c2,_0xee3951){return db[_0x78f7('0x27')]['describe']()[_0x78f7('0x22')](respondWithResult(_0xee3951,null))[_0x78f7('0x3f')](handleError(_0xee3951,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index f7a7946..e7d1141 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 _0x6d62=['report_mail_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','./mailQueueReport.attributes','exports'];(function(_0x549b05,_0x50782b){var _0x2c69e4=function(_0x24a523){while(--_0x24a523){_0x549b05['push'](_0x549b05['shift']());}};_0x2c69e4(++_0x50782b);}(_0x6d62,0x1ce));var _0x26d6=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0x6d62[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0x26d6('0x0'));var util=require(_0x26d6('0x1'));var logger=require('../../config/logger')(_0x26d6('0x2'));var moment=require(_0x26d6('0x3'));var BPromise=require(_0x26d6('0x4'));var rp=require(_0x26d6('0x5'));var attributes=require(_0x26d6('0x6'));module[_0x26d6('0x7')]=function(_0x4585c8,_0x57aeb3){return _0x4585c8['define']('MailQueueReport',attributes,{'tableName':_0x26d6('0x8'),'paranoid':![],'indexes':[{'name':_0x26d6('0x9'),'fields':[_0x26d6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ab2=['exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','bluebird','request-promise','./mailQueueReport.attributes'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x1ab2,0xae));var _0x21ab=function(_0x4663fe,_0x1f31f1){_0x4663fe=_0x4663fe-0x0;var _0x4f3420=_0x1ab2[_0x4663fe];return _0x4f3420;};'use strict';var _=require(_0x21ab('0x0'));var util=require(_0x21ab('0x1'));var logger=require('../../config/logger')(_0x21ab('0x2'));var moment=require('moment');var BPromise=require(_0x21ab('0x3'));var rp=require(_0x21ab('0x4'));var attributes=require(_0x21ab('0x5'));module[_0x21ab('0x6')]=function(_0x139a86,_0x41775f){return _0x139a86['define'](_0x21ab('0x7'),attributes,{'tableName':_0x21ab('0x8'),'paranoid':![],'indexes':[{'name':_0x21ab('0x9'),'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 9f508ef..e1f026a 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 _0x145f=['error','code','MailQueueReport,\x20%s,\x20%s','message','result','catch','CreateMailQueueReport','create','body','options','raw','stringify','UpdateMailQueueReport','MailQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x49a9e6,_0x7ce597){var _0x1fd2f5=function(_0x1a7f47){while(--_0x1a7f47){_0x49a9e6['push'](_0x49a9e6['shift']());}};_0x1fd2f5(++_0x7ce597);}(_0x145f,0x9e));var _0xf145=function(_0x40cd40,_0x288624){_0x40cd40=_0x40cd40-0x0;var _0x1daf66=_0x145f[_0x40cd40];return _0x1daf66;};'use strict';var _=require(_0xf145('0x0'));var util=require('util');var moment=require(_0xf145('0x1'));var BPromise=require(_0xf145('0x2'));var rs=require(_0xf145('0x3'));var fs=require('fs');var Redis=require(_0xf145('0x4'));var db=require(_0xf145('0x5'))['db'];var utils=require(_0xf145('0x6'));var logger=require(_0xf145('0x7'))(_0xf145('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf145('0x9')][_0xf145('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x80e620,_0x2d5408,_0x558a37){return new BPromise(function(_0x25097c,_0x55a664){return client[_0xf145('0xb')](_0x80e620,_0x558a37)[_0xf145('0xc')](function(_0x8bbfbe){logger[_0xf145('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x2d5408,_0xf145('0xe'));logger[_0xf145('0xf')](_0xf145('0x10'),_0x2d5408,_0xf145('0xe'),JSON['stringify'](_0x8bbfbe));if(_0x8bbfbe[_0xf145('0x11')]){if(_0x8bbfbe[_0xf145('0x11')][_0xf145('0x12')]===0x1f4){logger['error'](_0xf145('0x13'),_0x2d5408,_0x8bbfbe['error'][_0xf145('0x14')]);return _0x55a664(_0x8bbfbe[_0xf145('0x11')][_0xf145('0x14')]);}logger[_0xf145('0x11')](_0xf145('0x13'),_0x2d5408,_0x8bbfbe[_0xf145('0x11')][_0xf145('0x14')]);return _0x25097c(_0x8bbfbe[_0xf145('0x11')][_0xf145('0x14')]);}else{logger[_0xf145('0xd')](_0xf145('0x13'),_0x2d5408,_0xf145('0xe'));_0x25097c(_0x8bbfbe[_0xf145('0x15')][_0xf145('0x14')]);}})[_0xf145('0x16')](function(_0xe52f59){logger[_0xf145('0x11')](_0xf145('0x13'),_0x2d5408,_0xe52f59);_0x55a664(_0xe52f59);});});}exports[_0xf145('0x17')]=function(_0x1cc52a){var _0x31fec2=this;return new Promise(function(_0x5896f3,_0x1dd5aa){return db['MailQueueReport'][_0xf145('0x18')](_0x1cc52a[_0xf145('0x19')],{'raw':_0x1cc52a[_0xf145('0x1a')]?_0x1cc52a[_0xf145('0x1a')][_0xf145('0x1b')]===undefined?!![]:![]:!![]})[_0xf145('0xc')](function(_0x5d340a){logger[_0xf145('0xd')](_0xf145('0x17'),_0x1cc52a);logger['debug'](_0xf145('0x17'),_0x1cc52a,JSON[_0xf145('0x1c')](_0x5d340a));_0x5896f3(_0x5d340a);})[_0xf145('0x16')](function(_0x3a95c2){logger[_0xf145('0x11')]('CreateMailQueueReport',_0x3a95c2[_0xf145('0x14')],_0x1cc52a);_0x1dd5aa(_0x31fec2[_0xf145('0x11')](0x1f4,_0x3a95c2['message']));});});};exports[_0xf145('0x1d')]=function(_0x17e0e9){var _0x18f498=this;return new Promise(function(_0x277f55,_0x1204ef){return db[_0xf145('0x1e')][_0xf145('0x1f')](_0x17e0e9[_0xf145('0x19')],{'raw':_0x17e0e9[_0xf145('0x1a')]?_0x17e0e9['options'][_0xf145('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e0e9['options']?_0x17e0e9[_0xf145('0x1a')][_0xf145('0x20')]||null:null,'attributes':_0x17e0e9['options']?_0x17e0e9['options'][_0xf145('0x21')]||null:null,'limit':_0x17e0e9[_0xf145('0x1a')]?_0x17e0e9['options'][_0xf145('0x22')]||null:null})[_0xf145('0xc')](function(_0x1d16ca){logger['info'](_0xf145('0x1d'),_0x17e0e9);logger[_0xf145('0xf')](_0xf145('0x1d'),_0x17e0e9,JSON[_0xf145('0x1c')](_0x1d16ca));_0x277f55(_0x1d16ca);})[_0xf145('0x16')](function(_0xe66b60){logger[_0xf145('0x11')]('UpdateMailQueueReport',_0xe66b60['message'],_0x17e0e9);_0x1204ef(_0x18f498[_0xf145('0x11')](0x1f4,_0xe66b60[_0xf145('0x14')]));});});}; \ No newline at end of file +var _0xa406=['stringify','UpdateMailQueueReport','MailQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','MailQueueReport,\x20%s,\x20%s','message','result','catch','create','body','options','raw','CreateMailQueueReport'];(function(_0xe51757,_0x1337e1){var _0x14401e=function(_0x36f7e4){while(--_0x36f7e4){_0xe51757['push'](_0xe51757['shift']());}};_0x14401e(++_0x1337e1);}(_0xa406,0x11e));var _0x6a40=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa406[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6a40('0x0'));var util=require(_0x6a40('0x1'));var moment=require(_0x6a40('0x2'));var BPromise=require(_0x6a40('0x3'));var rs=require(_0x6a40('0x4'));var fs=require('fs');var Redis=require(_0x6a40('0x5'));var db=require(_0x6a40('0x6'))['db'];var utils=require(_0x6a40('0x7'));var logger=require(_0x6a40('0x8'))(_0x6a40('0x9'));var config=require(_0x6a40('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6a40('0xb')][_0x6a40('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe939fb,_0xce909c,_0x34426e){return new BPromise(function(_0x21d1c4,_0x1a67ed){return client[_0x6a40('0xd')](_0xe939fb,_0x34426e)[_0x6a40('0xe')](function(_0x44741f){logger[_0x6a40('0xf')]('MailQueueReport,\x20%s,\x20%s',_0xce909c,_0x6a40('0x10'));logger[_0x6a40('0x11')](_0x6a40('0x12'),_0xce909c,_0x6a40('0x10'),JSON['stringify'](_0x44741f));if(_0x44741f[_0x6a40('0x13')]){if(_0x44741f[_0x6a40('0x13')]['code']===0x1f4){logger[_0x6a40('0x13')](_0x6a40('0x14'),_0xce909c,_0x44741f[_0x6a40('0x13')][_0x6a40('0x15')]);return _0x1a67ed(_0x44741f['error'][_0x6a40('0x15')]);}logger[_0x6a40('0x13')](_0x6a40('0x14'),_0xce909c,_0x44741f[_0x6a40('0x13')]['message']);return _0x21d1c4(_0x44741f[_0x6a40('0x13')][_0x6a40('0x15')]);}else{logger[_0x6a40('0xf')](_0x6a40('0x14'),_0xce909c,'request\x20sent');_0x21d1c4(_0x44741f[_0x6a40('0x16')][_0x6a40('0x15')]);}})[_0x6a40('0x17')](function(_0x3e3d03){logger[_0x6a40('0x13')](_0x6a40('0x14'),_0xce909c,_0x3e3d03);_0x1a67ed(_0x3e3d03);});});}exports['CreateMailQueueReport']=function(_0xeebe1f){var _0x262d75=this;return new Promise(function(_0x4689a6,_0xe9a43c){return db['MailQueueReport'][_0x6a40('0x18')](_0xeebe1f[_0x6a40('0x19')],{'raw':_0xeebe1f[_0x6a40('0x1a')]?_0xeebe1f[_0x6a40('0x1a')][_0x6a40('0x1b')]===undefined?!![]:![]:!![]})[_0x6a40('0xe')](function(_0x1ece55){logger[_0x6a40('0xf')](_0x6a40('0x1c'),_0xeebe1f);logger[_0x6a40('0x11')]('CreateMailQueueReport',_0xeebe1f,JSON[_0x6a40('0x1d')](_0x1ece55));_0x4689a6(_0x1ece55);})[_0x6a40('0x17')](function(_0x5ca84e){logger[_0x6a40('0x13')]('CreateMailQueueReport',_0x5ca84e[_0x6a40('0x15')],_0xeebe1f);_0xe9a43c(_0x262d75[_0x6a40('0x13')](0x1f4,_0x5ca84e[_0x6a40('0x15')]));});});};exports[_0x6a40('0x1e')]=function(_0x129b71){var _0xef0492=this;return new Promise(function(_0x237b6f,_0xe102f6){return db[_0x6a40('0x1f')]['update'](_0x129b71['body'],{'raw':_0x129b71[_0x6a40('0x1a')]?_0x129b71[_0x6a40('0x1a')][_0x6a40('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x129b71[_0x6a40('0x1a')]?_0x129b71[_0x6a40('0x1a')][_0x6a40('0x20')]||null:null,'attributes':_0x129b71[_0x6a40('0x1a')]?_0x129b71[_0x6a40('0x1a')][_0x6a40('0x21')]||null:null,'limit':_0x129b71['options']?_0x129b71[_0x6a40('0x1a')][_0x6a40('0x22')]||null:null})[_0x6a40('0xe')](function(_0x49f900){logger[_0x6a40('0xf')](_0x6a40('0x1e'),_0x129b71);logger['debug'](_0x6a40('0x1e'),_0x129b71,JSON[_0x6a40('0x1d')](_0x49f900));_0x237b6f(_0x49f900);})[_0x6a40('0x17')](function(_0x8cab2){logger['error'](_0x6a40('0x1e'),_0x8cab2['message'],_0x129b71);_0xe102f6(_0xef0492['error'](0x1f4,_0x8cab2[_0x6a40('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index ee5355a..e763ff6 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 _0xae30=['../../components/interaction/service','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xae30,0x10a));var _0x0ae3=function(_0x337651,_0x2af690){_0x337651=_0x337651-0x0;var _0x20893c=_0xae30[_0x337651];return _0x20893c;};'use strict';var multer=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var path=require(_0x0ae3('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae3('0x3'));var router=express[_0x0ae3('0x4')]();var auth=require(_0x0ae3('0x5'));var interaction=require(_0x0ae3('0x6'));var config=require('../../config/environment');module[_0x0ae3('0x7')]=router; \ No newline at end of file +var _0x8506=['Router','../../components/interaction/service','../../config/environment','exports','util','connect-timeout'];(function(_0x56e5e3,_0x4fd872){var _0x242922=function(_0x430f6a){while(--_0x430f6a){_0x56e5e3['push'](_0x56e5e3['shift']());}};_0x242922(++_0x4fd872);}(_0x8506,0xe8));var _0x6850=function(_0x447bbd,_0x56c23c){_0x447bbd=_0x447bbd-0x0;var _0x2ba14e=_0x8506[_0x447bbd];return _0x2ba14e;};'use strict';var multer=require('multer');var util=require(_0x6850('0x0'));var path=require('path');var timeout=require(_0x6850('0x1'));var express=require('express');var router=express[_0x6850('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x6850('0x3'));var config=require(_0x6850('0x4'));module[_0x6850('0x5')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 7835232..ca1e801 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 _0x96cc=['BOOLEAN','username','INTEGER','INBOX','sequelize','STRING'];(function(_0x26ce56,_0x20c231){var _0x1e9f60=function(_0x2a469d){while(--_0x2a469d){_0x26ce56['push'](_0x26ce56['shift']());}};_0x1e9f60(++_0x20c231);}(_0x96cc,0x16c));var _0xc96c=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0x96cc[_0x34b87f];return _0x449805;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'description':{'type':Sequelize[_0xc96c('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xc96c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc96c('0x1')],'unique':_0xc96c('0x3')},'password':{'type':Sequelize[_0xc96c('0x1')]},'port':{'type':Sequelize[_0xc96c('0x4')]},'tls':{'type':Sequelize[_0xc96c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc96c('0x1')],'defaultValue':_0xc96c('0x5')},'connTimeout':{'type':Sequelize[_0xc96c('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xc96c('0x1')]}}; \ No newline at end of file +var _0xf109=['INTEGER','BOOLEAN','INBOX','sequelize','exports','STRING','username'];(function(_0x1c0601,_0x5d493f){var _0x232be=function(_0x512155){while(--_0x512155){_0x1c0601['push'](_0x1c0601['shift']());}};_0x232be(++_0x5d493f);}(_0xf109,0xce));var _0x9f10=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xf109[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'description':{'type':Sequelize[_0x9f10('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0x9f10('0x3')},'password':{'type':Sequelize[_0x9f10('0x2')]},'port':{'type':Sequelize[_0x9f10('0x4')]},'tls':{'type':Sequelize[_0x9f10('0x5')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9f10('0x2')],'defaultValue':_0x9f10('0x6')},'connTimeout':{'type':Sequelize[_0x9f10('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9f10('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9f10('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index dae43d7..b0d5227 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 _0xd9dc=['moment','bluebird','request-promise','exports','define','MailServerIn','util','../../config/logger'];(function(_0x24a1f6,_0x14b093){var _0x82df9b=function(_0x5b9827){while(--_0x5b9827){_0x24a1f6['push'](_0x24a1f6['shift']());}};_0x82df9b(++_0x14b093);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x11c510,_0x37ecc3){_0x11c510=_0x11c510-0x0;var _0x2f23a8=_0xd9dc[_0x11c510];return _0x2f23a8;};'use strict';var _=require('lodash');var util=require(_0xcd9d('0x0'));var logger=require(_0xcd9d('0x1'))('api');var moment=require(_0xcd9d('0x2'));var BPromise=require(_0xcd9d('0x3'));var rp=require(_0xcd9d('0x4'));var attributes=require('./mailServerIn.attributes');module[_0xcd9d('0x5')]=function(_0x12aae1,_0x2c0be0){return _0x12aae1[_0xcd9d('0x6')](_0xcd9d('0x7'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf194=['../../config/logger','api','bluebird','define','mail_servers_in','lodash','util'];(function(_0x3a0863,_0x4cd5ef){var _0x85c557=function(_0x3011cb){while(--_0x3011cb){_0x3a0863['push'](_0x3a0863['shift']());}};_0x85c557(++_0x4cd5ef);}(_0xf194,0x91));var _0x4f19=function(_0x415326,_0x29e069){_0x415326=_0x415326-0x0;var _0x4b3f2c=_0xf194[_0x415326];return _0x4b3f2c;};'use strict';var _=require(_0x4f19('0x0'));var util=require(_0x4f19('0x1'));var logger=require(_0x4f19('0x2'))(_0x4f19('0x3'));var moment=require('moment');var BPromise=require(_0x4f19('0x4'));var rp=require('request-promise');var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x2db75c,_0x2d3b11){return _0x2db75c[_0x4f19('0x5')]('MailServerIn',attributes,{'tableName':_0x4f19('0x6'),'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 00d2a4f..0984e02 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 _0xea32=['../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','attributes','limit','include','map','model','GetMailServerIn','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x393700,_0x603c8c){var _0x2e4c3d=function(_0x2bfa0c){while(--_0x2bfa0c){_0x393700['push'](_0x393700['shift']());}};_0x2e4c3d(++_0x603c8c);}(_0xea32,0xf8));var _0x2ea3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2ea3('0x0'));var util=require('util');var moment=require(_0x2ea3('0x1'));var BPromise=require(_0x2ea3('0x2'));var rs=require(_0x2ea3('0x3'));var fs=require('fs');var Redis=require(_0x2ea3('0x4'));var db=require(_0x2ea3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ea3('0x6'))(_0x2ea3('0x7'));var config=require(_0x2ea3('0x8'));var jayson=require(_0x2ea3('0x9'));var client=jayson[_0x2ea3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x594b03,_0x7198ac,_0x53249d){return new BPromise(function(_0x11edeb,_0x558c09){return client[_0x2ea3('0xb')](_0x594b03,_0x53249d)[_0x2ea3('0xc')](function(_0x7bd7fb){logger[_0x2ea3('0xd')](_0x2ea3('0xe'),_0x7198ac,_0x2ea3('0xf'));logger[_0x2ea3('0x10')](_0x2ea3('0x11'),_0x7198ac,'request\x20sent',JSON[_0x2ea3('0x12')](_0x7bd7fb));if(_0x7bd7fb['error']){if(_0x7bd7fb[_0x2ea3('0x13')][_0x2ea3('0x14')]===0x1f4){logger[_0x2ea3('0x13')]('MailServerIn,\x20%s,\x20%s',_0x7198ac,_0x7bd7fb[_0x2ea3('0x13')][_0x2ea3('0x15')]);return _0x558c09(_0x7bd7fb[_0x2ea3('0x13')][_0x2ea3('0x15')]);}logger[_0x2ea3('0x13')]('MailServerIn,\x20%s,\x20%s',_0x7198ac,_0x7bd7fb['error']['message']);return _0x11edeb(_0x7bd7fb[_0x2ea3('0x13')]['message']);}else{logger[_0x2ea3('0xd')]('MailServerIn,\x20%s,\x20%s',_0x7198ac,_0x2ea3('0xf'));_0x11edeb(_0x7bd7fb[_0x2ea3('0x16')][_0x2ea3('0x15')]);}})['catch'](function(_0x25f1b8){logger[_0x2ea3('0x13')](_0x2ea3('0xe'),_0x7198ac,_0x25f1b8);_0x558c09(_0x25f1b8);});});}exports['GetMailServerIn']=function(_0x499852){var _0x24b0eb=this;return new Promise(function(_0x2a3d10,_0x1de717){return db['MailServerIn'][_0x2ea3('0x17')]({'raw':_0x499852[_0x2ea3('0x18')]?_0x499852[_0x2ea3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x499852[_0x2ea3('0x18')]?_0x499852[_0x2ea3('0x18')]['where']||null:null,'attributes':_0x499852[_0x2ea3('0x18')]?_0x499852[_0x2ea3('0x18')][_0x2ea3('0x19')]||null:null,'limit':_0x499852[_0x2ea3('0x18')]?_0x499852[_0x2ea3('0x18')][_0x2ea3('0x1a')]||null:null,'include':_0x499852[_0x2ea3('0x18')]?_0x499852[_0x2ea3('0x18')][_0x2ea3('0x1b')]?_[_0x2ea3('0x1c')](_0x499852[_0x2ea3('0x18')][_0x2ea3('0x1b')],function(_0x7b7950){return{'model':db[_0x7b7950['model']],'as':_0x7b7950['as'],'attributes':_0x7b7950[_0x2ea3('0x19')],'include':_0x7b7950[_0x2ea3('0x1b')]?_[_0x2ea3('0x1c')](_0x7b7950[_0x2ea3('0x1b')],function(_0x311af5){return{'model':db[_0x311af5[_0x2ea3('0x1d')]],'as':_0x311af5['as'],'attributes':_0x311af5[_0x2ea3('0x19')],'include':_0x311af5[_0x2ea3('0x1b')]?_[_0x2ea3('0x1c')](_0x311af5['include'],function(_0xd602){return{'model':db[_0xd602[_0x2ea3('0x1d')]],'as':_0xd602['as'],'attributes':_0xd602['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x405599){logger[_0x2ea3('0xd')](_0x2ea3('0x1e'),_0x499852);logger['debug'](_0x2ea3('0x1e'),_0x499852,JSON[_0x2ea3('0x12')](_0x405599));_0x2a3d10(_0x405599);})[_0x2ea3('0x1f')](function(_0x46c823){logger[_0x2ea3('0x13')](_0x2ea3('0x1e'),_0x46c823[_0x2ea3('0x15')],_0x499852);_0x1de717(_0x24b0eb['error'](0x1f4,_0x46c823[_0x2ea3('0x15')]));});});}; \ No newline at end of file +var _0x4a10=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMailServerIn','options','raw','where','attributes','limit','include','map','model','then','stringify'];(function(_0x4732bc,_0x58c12c){var _0x4838bd=function(_0x551f4f){while(--_0x551f4f){_0x4732bc['push'](_0x4732bc['shift']());}};_0x4838bd(++_0x58c12c);}(_0x4a10,0x1e0));var _0x04a1=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4a10[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x04a1('0x0'));var util=require('util');var moment=require(_0x04a1('0x1'));var BPromise=require('bluebird');var rs=require(_0x04a1('0x2'));var fs=require('fs');var Redis=require(_0x04a1('0x3'));var db=require(_0x04a1('0x4'))['db'];var utils=require(_0x04a1('0x5'));var logger=require(_0x04a1('0x6'))(_0x04a1('0x7'));var config=require(_0x04a1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04a1('0x9')][_0x04a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bf719,_0x1b5d21,_0x560853){return new BPromise(function(_0x170f04,_0x76d6a6){return client['request'](_0x4bf719,_0x560853)['then'](function(_0x33652c){logger[_0x04a1('0xb')](_0x04a1('0xc'),_0x1b5d21,_0x04a1('0xd'));logger['debug'](_0x04a1('0xe'),_0x1b5d21,_0x04a1('0xd'),JSON['stringify'](_0x33652c));if(_0x33652c[_0x04a1('0xf')]){if(_0x33652c['error'][_0x04a1('0x10')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x1b5d21,_0x33652c['error'][_0x04a1('0x11')]);return _0x76d6a6(_0x33652c[_0x04a1('0xf')]['message']);}logger[_0x04a1('0xf')]('MailServerIn,\x20%s,\x20%s',_0x1b5d21,_0x33652c[_0x04a1('0xf')][_0x04a1('0x11')]);return _0x170f04(_0x33652c['error'][_0x04a1('0x11')]);}else{logger['info'](_0x04a1('0xc'),_0x1b5d21,_0x04a1('0xd'));_0x170f04(_0x33652c[_0x04a1('0x12')][_0x04a1('0x11')]);}})['catch'](function(_0x48c858){logger[_0x04a1('0xf')]('MailServerIn,\x20%s,\x20%s',_0x1b5d21,_0x48c858);_0x76d6a6(_0x48c858);});});}exports[_0x04a1('0x13')]=function(_0x9fb1db){var _0x30dfa6=this;return new Promise(function(_0x2c99c4,_0x12e91d){return db['MailServerIn']['findAll']({'raw':_0x9fb1db[_0x04a1('0x14')]?_0x9fb1db[_0x04a1('0x14')][_0x04a1('0x15')]===undefined?!![]:![]:!![],'where':_0x9fb1db[_0x04a1('0x14')]?_0x9fb1db['options'][_0x04a1('0x16')]||null:null,'attributes':_0x9fb1db[_0x04a1('0x14')]?_0x9fb1db[_0x04a1('0x14')][_0x04a1('0x17')]||null:null,'limit':_0x9fb1db[_0x04a1('0x14')]?_0x9fb1db[_0x04a1('0x14')][_0x04a1('0x18')]||null:null,'include':_0x9fb1db['options']?_0x9fb1db[_0x04a1('0x14')][_0x04a1('0x19')]?_[_0x04a1('0x1a')](_0x9fb1db[_0x04a1('0x14')][_0x04a1('0x19')],function(_0x2af89b){return{'model':db[_0x2af89b[_0x04a1('0x1b')]],'as':_0x2af89b['as'],'attributes':_0x2af89b[_0x04a1('0x17')],'include':_0x2af89b[_0x04a1('0x19')]?_[_0x04a1('0x1a')](_0x2af89b['include'],function(_0x464e7f){return{'model':db[_0x464e7f[_0x04a1('0x1b')]],'as':_0x464e7f['as'],'attributes':_0x464e7f[_0x04a1('0x17')],'include':_0x464e7f['include']?_[_0x04a1('0x1a')](_0x464e7f[_0x04a1('0x19')],function(_0x2d0174){return{'model':db[_0x2d0174['model']],'as':_0x2d0174['as'],'attributes':_0x2d0174[_0x04a1('0x17')]};}):[]};}):[]};}):[]:[]})[_0x04a1('0x1c')](function(_0x45bf71){logger[_0x04a1('0xb')](_0x04a1('0x13'),_0x9fb1db);logger['debug']('GetMailServerIn',_0x9fb1db,JSON[_0x04a1('0x1d')](_0x45bf71));_0x2c99c4(_0x45bf71);})['catch'](function(_0x2c3aca){logger[_0x04a1('0xf')](_0x04a1('0x13'),_0x2c3aca[_0x04a1('0x11')],_0x9fb1db);_0x12e91d(_0x30dfa6[_0x04a1('0xf')](0x1f4,_0x2c3aca[_0x04a1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index c925e56..4b66970 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 _0xf4b6=['isAuthenticated','create','put','/:id','update','delete','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','index'];(function(_0x4adf06,_0x23beb5){var _0x42d1eb=function(_0x371bb6){while(--_0x371bb6){_0x4adf06['push'](_0x4adf06['shift']());}};_0x42d1eb(++_0x23beb5);}(_0xf4b6,0x197));var _0x6f4b=function(_0x3dc04d,_0x3ba51c){_0x3dc04d=_0x3dc04d-0x0;var _0x55fef3=_0xf4b6[_0x3dc04d];return _0x55fef3;};'use strict';var multer=require('multer');var util=require(_0x6f4b('0x0'));var path=require(_0x6f4b('0x1'));var timeout=require('connect-timeout');var express=require(_0x6f4b('0x2'));var router=express['Router']();var auth=require(_0x6f4b('0x3'));var interaction=require(_0x6f4b('0x4'));var config=require(_0x6f4b('0x5'));var controller=require(_0x6f4b('0x6'));router[_0x6f4b('0x7')]('/',auth['isAuthenticated'](),controller[_0x6f4b('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6f4b('0x9')](),controller[_0x6f4b('0xa')]);router[_0x6f4b('0xb')](_0x6f4b('0xc'),auth[_0x6f4b('0x9')](),controller[_0x6f4b('0xd')]);router[_0x6f4b('0xe')](_0x6f4b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6f4b('0xf')]=router; \ No newline at end of file +var _0xef34=['../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','put','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x3fa20f,_0x2de419){var _0x58857b=function(_0x36916a){while(--_0x36916a){_0x3fa20f['push'](_0x3fa20f['shift']());}};_0x58857b(++_0x2de419);}(_0xef34,0xdd));var _0x4ef3=function(_0x1d0fec,_0x7fa1d6){_0x1d0fec=_0x1d0fec-0x0;var _0x309ce1=_0xef34[_0x1d0fec];return _0x309ce1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ef3('0x0'));var timeout=require(_0x4ef3('0x1'));var express=require(_0x4ef3('0x2'));var router=express[_0x4ef3('0x3')]();var auth=require(_0x4ef3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4ef3('0x5'));var controller=require(_0x4ef3('0x6'));router[_0x4ef3('0x7')]('/',auth[_0x4ef3('0x8')](),controller[_0x4ef3('0x9')]);router['get'](_0x4ef3('0xa'),auth[_0x4ef3('0x8')](),controller['show']);router['post']('/',auth[_0x4ef3('0x8')](),controller['create']);router[_0x4ef3('0xb')](_0x4ef3('0xa'),auth[_0x4ef3('0x8')](),controller[_0x4ef3('0xc')]);router[_0x4ef3('0xd')](_0x4ef3('0xa'),auth[_0x4ef3('0x8')](),controller[_0x4ef3('0xe')]);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 23eb3cb..2f16067 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 _0x8103=['STRING','INTEGER','sequelize'];(function(_0x1ce6c,_0x432755){var _0x890d94=function(_0xa36694){while(--_0xa36694){_0x1ce6c['push'](_0x1ce6c['shift']());}};_0x890d94(++_0x432755);}(_0x8103,0x74));var _0x3810=function(_0x323c1a,_0x3da6dd){_0x323c1a=_0x323c1a-0x0;var _0x499252=_0x8103[_0x323c1a];return _0x499252;};'use strict';var Sequelize=require(_0x3810('0x0'));module['exports']={'description':{'type':Sequelize[_0x3810('0x1')]},'host':{'type':Sequelize[_0x3810('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x3810('0x1')]},'port':{'type':Sequelize[_0x3810('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xa869=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x4abe77,_0x52a8a0){var _0xdab871=function(_0x1b7500){while(--_0x1b7500){_0x4abe77['push'](_0x4abe77['shift']());}};_0xdab871(++_0x52a8a0);}(_0xa869,0x7f));var _0x9a86=function(_0x4ab74d,_0x231e40){_0x4ab74d=_0x4ab74d-0x0;var _0x352f6d=_0xa869[_0x4ab74d];return _0x352f6d;};'use strict';var Sequelize=require(_0x9a86('0x0'));module[_0x9a86('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9a86('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9a86('0x3')]},'secure':{'type':Sequelize[_0x9a86('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x9a86('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 7630147..cdcbb73 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 _0x70e0=['error','name','send','index','MailServerOut','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','offset','sort','where','filter','merge','map','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x70e0,0x17b));var _0x070e=function(_0x3ffd26,_0x1e8003){_0x3ffd26=_0x3ffd26-0x0;var _0x35e393=_0x70e0[_0x3ffd26];return _0x35e393;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var authService=require(_0x070e('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x070e('0xf'));var logger=require(_0x070e('0x10'))(_0x070e('0x11'));var utils=require(_0x070e('0x12'));var config=require(_0x070e('0x13'));var db=require(_0x070e('0x14'))['db'];function respondWithStatusCode(_0x25cfe1,_0x1baa12){_0x1baa12=_0x1baa12||0xcc;return function(_0x39d2b9){if(_0x39d2b9){return _0x25cfe1[_0x070e('0x15')](_0x1baa12);}return _0x25cfe1[_0x070e('0x16')](_0x1baa12)['end']();};}function respondWithResult(_0x5dca0f,_0x24baba){_0x24baba=_0x24baba||0xc8;return function(_0x56c7ba){if(_0x56c7ba){return _0x5dca0f['status'](_0x24baba)['json'](_0x56c7ba);}};}function respondWithFilteredResult(_0x11d2ce,_0x14c3fd){return function(_0x51d14d){if(_0x51d14d){var _0x5d3a38=_0x51d14d[_0x070e('0x17')],_0x373d86=_0x14c3fd['offset'],_0xeae1a5=_0x14c3fd['offset']+_0x14c3fd[_0x070e('0x18')],_0x180897;if(_0xeae1a5>=_0x5d3a38){_0xeae1a5=_0x5d3a38;_0x180897=0xc8;}else{_0x180897=0xce;}_0x11d2ce[_0x070e('0x16')](_0x180897);return _0x11d2ce[_0x070e('0x19')](_0x070e('0x1a'),_0x373d86+'-'+_0xeae1a5+'/'+_0x5d3a38)[_0x070e('0x1b')](_0x51d14d);}return null;};}function patchUpdates(_0x5037eb){return function(_0x3938b5){try{jsonpatch[_0x070e('0x1c')](_0x3938b5,_0x5037eb,!![]);}catch(_0x1ad3de){return BPromise[_0x070e('0x1d')](_0x1ad3de);}return _0x3938b5[_0x070e('0x1e')]();};}function saveUpdates(_0x5c16fd,_0x5b2f48){return function(_0x4e958f){if(_0x4e958f){return _0x4e958f[_0x070e('0x1f')](_0x5c16fd)[_0x070e('0x20')](function(_0x20dc60){return _0x20dc60;});}return null;};}function removeEntity(_0x4be0d7,_0x5b184){return function(_0x5dc5d2){if(_0x5dc5d2){return _0x5dc5d2[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x4be0d7[_0x070e('0x16')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0x28a1c3,_0xa86797){return function(_0xe405e){if(!_0xe405e){_0x28a1c3[_0x070e('0x15')](0x194);}return _0xe405e;};}function handleError(_0x595c7e,_0x2f8055){_0x2f8055=_0x2f8055||0x1f4;return function(_0x270061){logger[_0x070e('0x23')](_0x270061['stack']);if(_0x270061[_0x070e('0x24')]){delete _0x270061['name'];}_0x595c7e['status'](_0x2f8055)[_0x070e('0x25')](_0x270061);};}exports[_0x070e('0x26')]=function(_0x41deb1,_0x1743cc){var _0x4763c6={},_0x497f58={},_0x374c54={'count':0x0,'rows':[]};var _0x219e48=db[_0x070e('0x27')][_0x070e('0x28')];_0x497f58[_0x070e('0x29')]=_[_0x070e('0x2a')](_0x219e48);_0x497f58[_0x070e('0x2b')]=_[_0x070e('0x2a')](_0x41deb1['query']);_0x497f58[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x497f58[_0x070e('0x29')],_0x497f58['query']);_0x4763c6['attributes']=_[_0x070e('0x2d')](_0x497f58[_0x070e('0x29')],qs[_0x070e('0x2e')](_0x41deb1['query'][_0x070e('0x2e')]));_0x4763c6[_0x070e('0x2f')]=_0x4763c6[_0x070e('0x2f')][_0x070e('0x30')]?_0x4763c6['attributes']:_0x497f58['model'];if(!_0x41deb1['query']['hasOwnProperty'](_0x070e('0x31'))){_0x4763c6['limit']=qs[_0x070e('0x18')](_0x41deb1[_0x070e('0x2b')]['limit']);_0x4763c6['offset']=qs[_0x070e('0x32')](_0x41deb1[_0x070e('0x2b')]['offset']);}_0x4763c6['order']=qs[_0x070e('0x33')](_0x41deb1[_0x070e('0x2b')][_0x070e('0x33')]);_0x4763c6[_0x070e('0x34')]=qs[_0x070e('0x2c')](_['pick'](_0x41deb1['query'],_0x497f58[_0x070e('0x2c')]));if(_0x41deb1[_0x070e('0x2b')][_0x070e('0x35')]){_0x4763c6[_0x070e('0x34')]=_[_0x070e('0x36')](_0x4763c6['where'],{'$or':_[_0x070e('0x37')](_0x219e48,function(_0x1927f4){if(_0x1927f4['type'][_0x070e('0x38')]!==_0x070e('0x39')){var _0x4ba6f0={};_0x4ba6f0[_0x1927f4['field']]={'$like':'%'+_0x41deb1['query'][_0x070e('0x35')]+'%'};return _0x4ba6f0;}})});}_0x4763c6=_[_0x070e('0x36')]({},_0x4763c6,_0x41deb1[_0x070e('0x3a')]);var _0x334733={'where':_0x4763c6[_0x070e('0x34')]};return db['MailServerOut'][_0x070e('0x17')](_0x334733)[_0x070e('0x20')](function(_0xb53332){_0x374c54['count']=_0xb53332;if(_0x41deb1[_0x070e('0x2b')][_0x070e('0x3b')]){_0x4763c6[_0x070e('0x3c')]=[{'all':!![]}];}return db['MailServerOut'][_0x070e('0x3d')](_0x4763c6);})[_0x070e('0x20')](function(_0x4800a9){_0x374c54[_0x070e('0x3e')]=_0x4800a9;return _0x374c54;})['then'](respondWithFilteredResult(_0x1743cc,_0x4763c6))[_0x070e('0x3f')](handleError(_0x1743cc,null));};exports[_0x070e('0x40')]=function(_0x3462d3,_0x30319c){var _0xd03404={'raw':!![],'where':{'id':_0x3462d3[_0x070e('0x41')]['id']}},_0x47b929={};_0x47b929['model']=_['keys'](db[_0x070e('0x27')][_0x070e('0x28')]);_0x47b929[_0x070e('0x2b')]=_['keys'](_0x3462d3[_0x070e('0x2b')]);_0x47b929[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x47b929[_0x070e('0x29')],_0x47b929['query']);_0xd03404[_0x070e('0x2f')]=_['intersection'](_0x47b929['model'],qs['fields'](_0x3462d3[_0x070e('0x2b')][_0x070e('0x2e')]));_0xd03404[_0x070e('0x2f')]=_0xd03404[_0x070e('0x2f')][_0x070e('0x30')]?_0xd03404['attributes']:_0x47b929[_0x070e('0x29')];if(_0x3462d3['query'][_0x070e('0x3b')]){_0xd03404[_0x070e('0x3c')]=[{'all':!![]}];}_0xd03404=_[_0x070e('0x36')]({},_0xd03404,_0x3462d3['options']);return db['MailServerOut'][_0x070e('0x42')](_0xd03404)['then'](handleEntityNotFound(_0x30319c,null))[_0x070e('0x20')](respondWithResult(_0x30319c,null))[_0x070e('0x3f')](handleError(_0x30319c,null));};exports[_0x070e('0x43')]=function(_0x5f5675,_0x7c15f9){return db[_0x070e('0x27')]['create'](_0x5f5675['body'],{})[_0x070e('0x20')](respondWithResult(_0x7c15f9,0xc9))[_0x070e('0x3f')](handleError(_0x7c15f9,null));};exports[_0x070e('0x1f')]=function(_0x1fc7c4,_0x253e11){if(_0x1fc7c4['body']['id']){delete _0x1fc7c4[_0x070e('0x44')]['id'];}return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x1fc7c4[_0x070e('0x41')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x253e11,null))[_0x070e('0x20')](saveUpdates(_0x1fc7c4[_0x070e('0x44')],null))[_0x070e('0x20')](respondWithResult(_0x253e11,null))[_0x070e('0x3f')](handleError(_0x253e11,null));};exports[_0x070e('0x21')]=function(_0x210c4d,_0x3be553){return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x210c4d[_0x070e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3be553,null))[_0x070e('0x20')](removeEntity(_0x3be553,null))[_0x070e('0x3f')](handleError(_0x3be553,null));}; \ No newline at end of file +var _0xe706=['includeAll','include','findAll','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','MailServerOut','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options'];(function(_0x171668,_0x27b0ac){var _0x158e79=function(_0x2e05f3){while(--_0x2e05f3){_0x171668['push'](_0x171668['shift']());}};_0x158e79(++_0x27b0ac);}(_0xe706,0xa3));var _0x6e70=function(_0x2d580b,_0x2b11f3){_0x2d580b=_0x2d580b-0x0;var _0x7c1374=_0xe706[_0x2d580b];return _0x7c1374;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var authService=require(_0x6e70('0x14'));var hardwareService=require(_0x6e70('0x15'));var Redis=require(_0x6e70('0x16'));var qs=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];function respondWithStatusCode(_0x15a1a5,_0x18cf27){_0x18cf27=_0x18cf27||0xcc;return function(_0x27dd9b){if(_0x27dd9b){return _0x15a1a5[_0x6e70('0x1b')](_0x18cf27);}return _0x15a1a5[_0x6e70('0x1c')](_0x18cf27)[_0x6e70('0x1d')]();};}function respondWithResult(_0x181005,_0x5dfbaa){_0x5dfbaa=_0x5dfbaa||0xc8;return function(_0x52737e){if(_0x52737e){return _0x181005['status'](_0x5dfbaa)[_0x6e70('0x1e')](_0x52737e);}};}function respondWithFilteredResult(_0x5a37a6,_0x53aed0){return function(_0x304716){if(_0x304716){var _0x22c50c=_0x304716[_0x6e70('0x1f')],_0x5d9263=_0x53aed0[_0x6e70('0x20')],_0x24f3ac=_0x53aed0['offset']+_0x53aed0['limit'],_0x5c3fe7;if(_0x24f3ac>=_0x22c50c){_0x24f3ac=_0x22c50c;_0x5c3fe7=0xc8;}else{_0x5c3fe7=0xce;}_0x5a37a6[_0x6e70('0x1c')](_0x5c3fe7);return _0x5a37a6['set'](_0x6e70('0x21'),_0x5d9263+'-'+_0x24f3ac+'/'+_0x22c50c)[_0x6e70('0x1e')](_0x304716);}return null;};}function patchUpdates(_0x53acdc){return function(_0x497d61){try{jsonpatch[_0x6e70('0x22')](_0x497d61,_0x53acdc,!![]);}catch(_0x208e21){return BPromise[_0x6e70('0x23')](_0x208e21);}return _0x497d61[_0x6e70('0x24')]();};}function saveUpdates(_0x3af484,_0xcdf9f2){return function(_0x1b2453){if(_0x1b2453){return _0x1b2453[_0x6e70('0x25')](_0x3af484)[_0x6e70('0x26')](function(_0xb29a2a){return _0xb29a2a;});}return null;};}function removeEntity(_0x4a0cfe,_0x228350){return function(_0x344b65){if(_0x344b65){return _0x344b65[_0x6e70('0x27')]()['then'](function(){_0x4a0cfe[_0x6e70('0x1c')](0xcc)[_0x6e70('0x1d')]();});}};}function handleEntityNotFound(_0x3337a6,_0x50da2c){return function(_0x10fc91){if(!_0x10fc91){_0x3337a6['sendStatus'](0x194);}return _0x10fc91;};}function handleError(_0x50aec2,_0x4e97c7){_0x4e97c7=_0x4e97c7||0x1f4;return function(_0x41e352){logger[_0x6e70('0x28')](_0x41e352['stack']);if(_0x41e352[_0x6e70('0x29')]){delete _0x41e352[_0x6e70('0x29')];}_0x50aec2['status'](_0x4e97c7)[_0x6e70('0x2a')](_0x41e352);};}exports[_0x6e70('0x2b')]=function(_0x2bb231,_0x4a67ac){var _0x54a5fe={},_0x2c4d37={},_0x3af17f={'count':0x0,'rows':[]};var _0x83c836=db[_0x6e70('0x2c')][_0x6e70('0x2d')];_0x2c4d37['model']=_[_0x6e70('0x2e')](_0x83c836);_0x2c4d37[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x2bb231[_0x6e70('0x2f')]);_0x2c4d37[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x2c4d37[_0x6e70('0x32')],_0x2c4d37[_0x6e70('0x2f')]);_0x54a5fe[_0x6e70('0x33')]=_[_0x6e70('0x31')](_0x2c4d37['model'],qs[_0x6e70('0x34')](_0x2bb231['query'][_0x6e70('0x34')]));_0x54a5fe['attributes']=_0x54a5fe[_0x6e70('0x33')][_0x6e70('0x35')]?_0x54a5fe[_0x6e70('0x33')]:_0x2c4d37['model'];if(!_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x36')]('nolimit')){_0x54a5fe[_0x6e70('0x37')]=qs[_0x6e70('0x37')](_0x2bb231['query'][_0x6e70('0x37')]);_0x54a5fe[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x20')]);}_0x54a5fe[_0x6e70('0x38')]=qs[_0x6e70('0x39')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x39')]);_0x54a5fe[_0x6e70('0x3a')]=qs['filters'](_[_0x6e70('0x3b')](_0x2bb231['query'],_0x2c4d37[_0x6e70('0x30')]));if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x3c')]){_0x54a5fe[_0x6e70('0x3a')]=_[_0x6e70('0x3d')](_0x54a5fe[_0x6e70('0x3a')],{'$or':_[_0x6e70('0x3e')](_0x83c836,function(_0xdd0bee){if(_0xdd0bee[_0x6e70('0x3f')][_0x6e70('0x40')]!==_0x6e70('0x41')){var _0x23d5e2={};_0x23d5e2[_0xdd0bee[_0x6e70('0x42')]]={'$like':'%'+_0x2bb231['query']['filter']+'%'};return _0x23d5e2;}})});}_0x54a5fe=_['merge']({},_0x54a5fe,_0x2bb231[_0x6e70('0x43')]);var _0x3841a0={'where':_0x54a5fe[_0x6e70('0x3a')]};return db[_0x6e70('0x2c')][_0x6e70('0x1f')](_0x3841a0)[_0x6e70('0x26')](function(_0x572a71){_0x3af17f[_0x6e70('0x1f')]=_0x572a71;if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x44')]){_0x54a5fe[_0x6e70('0x45')]=[{'all':!![]}];}return db[_0x6e70('0x2c')][_0x6e70('0x46')](_0x54a5fe);})[_0x6e70('0x26')](function(_0x16fc7d){_0x3af17f['rows']=_0x16fc7d;return _0x3af17f;})[_0x6e70('0x26')](respondWithFilteredResult(_0x4a67ac,_0x54a5fe))[_0x6e70('0x47')](handleError(_0x4a67ac,null));};exports[_0x6e70('0x48')]=function(_0x31cad2,_0x201da9){var _0x1de947={'raw':!![],'where':{'id':_0x31cad2['params']['id']}},_0x21b0e7={};_0x21b0e7['model']=_['keys'](db[_0x6e70('0x2c')][_0x6e70('0x2d')]);_0x21b0e7[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x31cad2[_0x6e70('0x2f')]);_0x21b0e7['filters']=_[_0x6e70('0x31')](_0x21b0e7[_0x6e70('0x32')],_0x21b0e7[_0x6e70('0x2f')]);_0x1de947['attributes']=_['intersection'](_0x21b0e7['model'],qs[_0x6e70('0x34')](_0x31cad2['query'][_0x6e70('0x34')]));_0x1de947[_0x6e70('0x33')]=_0x1de947[_0x6e70('0x33')][_0x6e70('0x35')]?_0x1de947['attributes']:_0x21b0e7[_0x6e70('0x32')];if(_0x31cad2['query'][_0x6e70('0x44')]){_0x1de947[_0x6e70('0x45')]=[{'all':!![]}];}_0x1de947=_[_0x6e70('0x3d')]({},_0x1de947,_0x31cad2[_0x6e70('0x43')]);return db['MailServerOut'][_0x6e70('0x49')](_0x1de947)[_0x6e70('0x26')](handleEntityNotFound(_0x201da9,null))[_0x6e70('0x26')](respondWithResult(_0x201da9,null))[_0x6e70('0x47')](handleError(_0x201da9,null));};exports[_0x6e70('0x4a')]=function(_0x3fcb2d,_0x3d9c5){return db['MailServerOut'][_0x6e70('0x4a')](_0x3fcb2d[_0x6e70('0x4b')],{})[_0x6e70('0x26')](respondWithResult(_0x3d9c5,0xc9))[_0x6e70('0x47')](handleError(_0x3d9c5,null));};exports[_0x6e70('0x25')]=function(_0x172e8a,_0x1e2095){if(_0x172e8a['body']['id']){delete _0x172e8a[_0x6e70('0x4b')]['id'];}return db['MailServerOut'][_0x6e70('0x49')]({'where':{'id':_0x172e8a[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e2095,null))['then'](saveUpdates(_0x172e8a[_0x6e70('0x4b')],null))[_0x6e70('0x26')](respondWithResult(_0x1e2095,null))[_0x6e70('0x47')](handleError(_0x1e2095,null));};exports['destroy']=function(_0x4af9b1,_0x238ebb){return db[_0x6e70('0x2c')][_0x6e70('0x49')]({'where':{'id':_0x4af9b1[_0x6e70('0x4c')]['id']}})[_0x6e70('0x26')](handleEntityNotFound(_0x238ebb,null))[_0x6e70('0x26')](removeEntity(_0x238ebb,null))['catch'](handleError(_0x238ebb,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6cc7984..1ea57b1 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 _0x27a0=['../../config/logger','api','moment','bluebird','define','MailServerOut','mail_servers_out','util'];(function(_0x5948ce,_0x339ee0){var _0x365f8f=function(_0x1f24ea){while(--_0x1f24ea){_0x5948ce['push'](_0x5948ce['shift']());}};_0x365f8f(++_0x339ee0);}(_0x27a0,0xbf));var _0x027a=function(_0x2cffa2,_0x582a51){_0x2cffa2=_0x2cffa2-0x0;var _0x5c64b7=_0x27a0[_0x2cffa2];return _0x5c64b7;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('0x4'));var rp=require('request-promise');var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x47cd65,_0x30a54d){return _0x47cd65[_0x027a('0x5')](_0x027a('0x6'),attributes,{'tableName':_0x027a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90ec=['lodash','util','api','moment','bluebird','request-promise','./mailServerOut.attributes','define','mail_servers_out'];(function(_0x51a005,_0x4dda0b){var _0x139711=function(_0x413ace){while(--_0x413ace){_0x51a005['push'](_0x51a005['shift']());}};_0x139711(++_0x4dda0b);}(_0x90ec,0x1d4));var _0xc90e=function(_0x425992,_0x3b99d2){_0x425992=_0x425992-0x0;var _0x5e3670=_0x90ec[_0x425992];return _0x5e3670;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var logger=require('../../config/logger')(_0xc90e('0x2'));var moment=require(_0xc90e('0x3'));var BPromise=require(_0xc90e('0x4'));var rp=require(_0xc90e('0x5'));var attributes=require(_0xc90e('0x6'));module['exports']=function(_0x1c13c4,_0x207b98){return _0x1c13c4[_0xc90e('0x7')]('MailServerOut',attributes,{'tableName':_0xc90e('0x8'),'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 91bed12..0c74f05 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 _0x71ee=['message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x18f051,_0x54da43){var _0x813a75=function(_0x312bf0){while(--_0x312bf0){_0x18f051['push'](_0x18f051['shift']());}};_0x813a75(++_0x54da43);}(_0x71ee,0x12f));var _0xe71e=function(_0x3d9cfa,_0x596edc){_0x3d9cfa=_0x3d9cfa-0x0;var _0x21d89d=_0x71ee[_0x3d9cfa];return _0x21d89d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe71e('0x0'));var rs=require(_0xe71e('0x1'));var fs=require('fs');var Redis=require(_0xe71e('0x2'));var db=require(_0xe71e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe71e('0x4'))(_0xe71e('0x5'));var config=require(_0xe71e('0x6'));var jayson=require(_0xe71e('0x7'));var client=jayson[_0xe71e('0x8')][_0xe71e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x255e12,_0x4ff698,_0x52968a){return new BPromise(function(_0x3459e8,_0x7ee051){return client['request'](_0x255e12,_0x52968a)[_0xe71e('0xa')](function(_0x3faba7){logger[_0xe71e('0xb')](_0xe71e('0xc'),_0x4ff698,_0xe71e('0xd'));logger[_0xe71e('0xe')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x4ff698,_0xe71e('0xd'),JSON[_0xe71e('0xf')](_0x3faba7));if(_0x3faba7['error']){if(_0x3faba7[_0xe71e('0x10')]['code']===0x1f4){logger[_0xe71e('0x10')]('MailServerOut,\x20%s,\x20%s',_0x4ff698,_0x3faba7[_0xe71e('0x10')]['message']);return _0x7ee051(_0x3faba7['error']['message']);}logger[_0xe71e('0x10')](_0xe71e('0xc'),_0x4ff698,_0x3faba7[_0xe71e('0x10')][_0xe71e('0x11')]);return _0x3459e8(_0x3faba7[_0xe71e('0x10')]['message']);}else{logger['info'](_0xe71e('0xc'),_0x4ff698,'request\x20sent');_0x3459e8(_0x3faba7[_0xe71e('0x12')][_0xe71e('0x11')]);}})[_0xe71e('0x13')](function(_0x154d2c){logger['error'](_0xe71e('0xc'),_0x4ff698,_0x154d2c);_0x7ee051(_0x154d2c);});});} \ No newline at end of file +var _0xb947=['rpc','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb947,0x167));var _0x7b94=function(_0x57edf1,_0x3cb802){_0x57edf1=_0x57edf1-0x0;var _0x281ee8=_0xb947[_0x57edf1];return _0x281ee8;};'use strict';var _=require(_0x7b94('0x0'));var util=require(_0x7b94('0x1'));var moment=require(_0x7b94('0x2'));var BPromise=require(_0x7b94('0x3'));var rs=require(_0x7b94('0x4'));var fs=require('fs');var Redis=require(_0x7b94('0x5'));var db=require(_0x7b94('0x6'))['db'];var utils=require(_0x7b94('0x7'));var logger=require(_0x7b94('0x8'))(_0x7b94('0x9'));var config=require('../../config/environment');var jayson=require(_0x7b94('0xa'));var client=jayson[_0x7b94('0xb')][_0x7b94('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49c90a,_0x58cbc0,_0x128ebe){return new BPromise(function(_0x137319,_0x55293c){return client[_0x7b94('0xd')](_0x49c90a,_0x128ebe)['then'](function(_0xb6aec1){logger[_0x7b94('0xe')](_0x7b94('0xf'),_0x58cbc0,_0x7b94('0x10'));logger[_0x7b94('0x11')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x58cbc0,'request\x20sent',JSON[_0x7b94('0x12')](_0xb6aec1));if(_0xb6aec1['error']){if(_0xb6aec1[_0x7b94('0x13')][_0x7b94('0x14')]===0x1f4){logger['error'](_0x7b94('0xf'),_0x58cbc0,_0xb6aec1[_0x7b94('0x13')][_0x7b94('0x15')]);return _0x55293c(_0xb6aec1[_0x7b94('0x13')][_0x7b94('0x15')]);}logger[_0x7b94('0x13')]('MailServerOut,\x20%s,\x20%s',_0x58cbc0,_0xb6aec1[_0x7b94('0x13')]['message']);return _0x137319(_0xb6aec1[_0x7b94('0x13')][_0x7b94('0x15')]);}else{logger['info']('MailServerOut,\x20%s,\x20%s',_0x58cbc0,_0x7b94('0x10'));_0x137319(_0xb6aec1['result'][_0x7b94('0x15')]);}})[_0x7b94('0x16')](function(_0x5255ca){logger[_0x7b94('0x13')](_0x7b94('0xf'),_0x58cbc0,_0x5255ca);_0x55293c(_0x5255ca);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index d14770f..302977f 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 _0xd7a6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x508516,_0x4dcd85){var _0x49fcc9=function(_0x29bfa0){while(--_0x29bfa0){_0x508516['push'](_0x508516['shift']());}};_0x49fcc9(++_0x4dcd85);}(_0xd7a6,0x1de));var _0x6d7a=function(_0xb4cfe3,_0xe84344){_0xb4cfe3=_0xb4cfe3-0x0;var _0x2200e2=_0xd7a6[_0xb4cfe3];return _0x2200e2;};'use strict';var multer=require(_0x6d7a('0x0'));var util=require(_0x6d7a('0x1'));var path=require(_0x6d7a('0x2'));var timeout=require(_0x6d7a('0x3'));var express=require(_0x6d7a('0x4'));var router=express[_0x6d7a('0x5')]();var auth=require(_0x6d7a('0x6'));var interaction=require(_0x6d7a('0x7'));var config=require(_0x6d7a('0x8'));var controller=require(_0x6d7a('0x9'));router[_0x6d7a('0xa')]('/',auth[_0x6d7a('0xb')](),controller[_0x6d7a('0xc')]);router[_0x6d7a('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x6d7a('0xd')]);router[_0x6d7a('0xa')](_0x6d7a('0xe'),auth[_0x6d7a('0xb')](),controller[_0x6d7a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6d7a('0x10')]);router[_0x6d7a('0x11')](_0x6d7a('0xe'),auth['isAuthenticated'](),controller[_0x6d7a('0x12')]);router['delete']('/:id',auth[_0x6d7a('0xb')](),controller[_0x6d7a('0x13')]);module[_0x6d7a('0x14')]=router; \ No newline at end of file +var _0xc8cb=['show','post','put','update','delete','exports','multer','path','connect-timeout','express','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3e8c6a,_0x22e8b3){var _0xd90d97=function(_0x91cb75){while(--_0x91cb75){_0x3e8c6a['push'](_0x3e8c6a['shift']());}};_0xd90d97(++_0x22e8b3);}(_0xc8cb,0x1a4));var _0xbc8c=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xc8cb[_0x3132e8];return _0x43eb8c;};'use strict';var multer=require(_0xbc8c('0x0'));var util=require('util');var path=require(_0xbc8c('0x1'));var timeout=require(_0xbc8c('0x2'));var express=require(_0xbc8c('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbc8c('0x4'));var controller=require(_0xbc8c('0x5'));router[_0xbc8c('0x6')]('/',auth[_0xbc8c('0x7')](),controller[_0xbc8c('0x8')]);router['get'](_0xbc8c('0x9'),auth[_0xbc8c('0x7')](),controller[_0xbc8c('0xa')]);router[_0xbc8c('0x6')](_0xbc8c('0xb'),auth[_0xbc8c('0x7')](),controller[_0xbc8c('0xc')]);router[_0xbc8c('0xd')]('/',auth[_0xbc8c('0x7')](),controller['create']);router[_0xbc8c('0xe')](_0xbc8c('0xb'),auth[_0xbc8c('0x7')](),controller[_0xbc8c('0xf')]);router[_0xbc8c('0x10')]('/:id',auth[_0xbc8c('0x7')](),controller['destroy']);module[_0xbc8c('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 0e5da55..edc2ba7 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 _0xb2af=['STRING','name','sequelize','exports'];(function(_0x1126df,_0x5984a4){var _0x40b8e9=function(_0x17579b){while(--_0x17579b){_0x1126df['push'](_0x1126df['shift']());}};_0x40b8e9(++_0x5984a4);}(_0xb2af,0xd2));var _0xfb2a=function(_0x2d42b5,_0x3cd880){_0x2d42b5=_0x2d42b5-0x0;var _0x38aec2=_0xb2af[_0x2d42b5];return _0x38aec2;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'name':{'type':Sequelize[_0xfb2a('0x2')],'unique':_0xfb2a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa866=['STRING','name','sequelize','exports'];(function(_0x565eeb,_0x6f4a81){var _0x3a6766=function(_0x37bc18){while(--_0x37bc18){_0x565eeb['push'](_0x565eeb['shift']());}};_0x3a6766(++_0x6f4a81);}(_0xa866,0x6a));var _0x6a86=function(_0x4e156d,_0x3fb120){_0x4e156d=_0x4e156d-0x0;var _0x33d670=_0xa866[_0x4e156d];return _0x33d670;};'use strict';var Sequelize=require(_0x6a86('0x0'));module[_0x6a86('0x1')]={'name':{'type':Sequelize[_0x6a86('0x2')],'unique':_0x6a86('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6a86('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d7d601d..a4d9eb8 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 _0x5a9e=['json','offset','limit','set','Content-Range','reject','save','destroy','then','end','error','stack','name','send','index','MailSubstatus','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','include','findAll','rows','catch','params','includeAll','create','update','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x388169,_0x32241b){var _0x27ae4a=function(_0xad17a1){while(--_0xad17a1){_0x388169['push'](_0x388169['shift']());}};_0x27ae4a(++_0x32241b);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x5a9e[_0x49052b];return _0x48c045;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe5a9('0x0'));var rimraf=require(_0xe5a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe5a9('0x2'));var moment=require(_0xe5a9('0x3'));var BPromise=require(_0xe5a9('0x4'));var Mustache=require(_0xe5a9('0x5'));var util=require(_0xe5a9('0x6'));var path=require('path');var sox=require(_0xe5a9('0x7'));var csv=require('to-csv');var ejs=require(_0xe5a9('0x8'));var fs=require('fs');var _=require(_0xe5a9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe5a9('0xa'));var deskjs=require(_0xe5a9('0xb'));var toCsv=require(_0xe5a9('0xc'));var querystring=require(_0xe5a9('0xd'));var Papa=require(_0xe5a9('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xe5a9('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xe5a9('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xe5a9('0x11'));var db=require(_0xe5a9('0x12'))['db'];function respondWithStatusCode(_0x40e8c1,_0x1c4dda){_0x1c4dda=_0x1c4dda||0xcc;return function(_0x2e36e6){if(_0x2e36e6){return _0x40e8c1[_0xe5a9('0x13')](_0x1c4dda);}return _0x40e8c1[_0xe5a9('0x14')](_0x1c4dda)['end']();};}function respondWithResult(_0x6b00bd,_0xc38407){_0xc38407=_0xc38407||0xc8;return function(_0x1e5577){if(_0x1e5577){return _0x6b00bd[_0xe5a9('0x14')](_0xc38407)[_0xe5a9('0x15')](_0x1e5577);}};}function respondWithFilteredResult(_0x3f0f69,_0x32a98d){return function(_0x56a2ba){if(_0x56a2ba){var _0x3aac0b=_0x56a2ba['count'],_0x3fe6f0=_0x32a98d[_0xe5a9('0x16')],_0x1e313e=_0x32a98d[_0xe5a9('0x16')]+_0x32a98d[_0xe5a9('0x17')],_0x59dd4e;if(_0x1e313e>=_0x3aac0b){_0x1e313e=_0x3aac0b;_0x59dd4e=0xc8;}else{_0x59dd4e=0xce;}_0x3f0f69[_0xe5a9('0x14')](_0x59dd4e);return _0x3f0f69[_0xe5a9('0x18')](_0xe5a9('0x19'),_0x3fe6f0+'-'+_0x1e313e+'/'+_0x3aac0b)['json'](_0x56a2ba);}return null;};}function patchUpdates(_0x2ca0f3){return function(_0x4bff6e){try{jsonpatch['apply'](_0x4bff6e,_0x2ca0f3,!![]);}catch(_0x9e77e0){return BPromise[_0xe5a9('0x1a')](_0x9e77e0);}return _0x4bff6e[_0xe5a9('0x1b')]();};}function saveUpdates(_0x1142d2,_0x2fc629){return function(_0x17479d){if(_0x17479d){return _0x17479d['update'](_0x1142d2)['then'](function(_0x3c417b){return _0x3c417b;});}return null;};}function removeEntity(_0x1b412f,_0x37947b){return function(_0x374879){if(_0x374879){return _0x374879[_0xe5a9('0x1c')]()[_0xe5a9('0x1d')](function(){_0x1b412f['status'](0xcc)[_0xe5a9('0x1e')]();});}};}function handleEntityNotFound(_0xdc93eb,_0x5de2dc){return function(_0x1c15d3){if(!_0x1c15d3){_0xdc93eb[_0xe5a9('0x13')](0x194);}return _0x1c15d3;};}function handleError(_0x562331,_0x40108c){_0x40108c=_0x40108c||0x1f4;return function(_0x527c12){logger[_0xe5a9('0x1f')](_0x527c12[_0xe5a9('0x20')]);if(_0x527c12[_0xe5a9('0x21')]){delete _0x527c12[_0xe5a9('0x21')];}_0x562331['status'](_0x40108c)[_0xe5a9('0x22')](_0x527c12);};}exports[_0xe5a9('0x23')]=function(_0x20e1a1,_0x127ca0){var _0x3dd3da={},_0x3ba459={},_0x25355f={'count':0x0,'rows':[]};var _0xfe8914=db[_0xe5a9('0x24')]['rawAttributes'];_0x3ba459[_0xe5a9('0x25')]=_[_0xe5a9('0x26')](_0xfe8914);_0x3ba459['query']=_[_0xe5a9('0x26')](_0x20e1a1['query']);_0x3ba459[_0xe5a9('0x27')]=_[_0xe5a9('0x28')](_0x3ba459[_0xe5a9('0x25')],_0x3ba459[_0xe5a9('0x29')]);_0x3dd3da[_0xe5a9('0x2a')]=_[_0xe5a9('0x28')](_0x3ba459[_0xe5a9('0x25')],qs[_0xe5a9('0x2b')](_0x20e1a1[_0xe5a9('0x29')][_0xe5a9('0x2b')]));_0x3dd3da['attributes']=_0x3dd3da[_0xe5a9('0x2a')][_0xe5a9('0x2c')]?_0x3dd3da[_0xe5a9('0x2a')]:_0x3ba459[_0xe5a9('0x25')];if(!_0x20e1a1[_0xe5a9('0x29')][_0xe5a9('0x2d')]('nolimit')){_0x3dd3da[_0xe5a9('0x17')]=qs['limit'](_0x20e1a1[_0xe5a9('0x29')][_0xe5a9('0x17')]);_0x3dd3da[_0xe5a9('0x16')]=qs[_0xe5a9('0x16')](_0x20e1a1[_0xe5a9('0x29')][_0xe5a9('0x16')]);}_0x3dd3da[_0xe5a9('0x2e')]=qs['sort'](_0x20e1a1[_0xe5a9('0x29')][_0xe5a9('0x2f')]);_0x3dd3da[_0xe5a9('0x30')]=qs[_0xe5a9('0x27')](_[_0xe5a9('0x31')](_0x20e1a1[_0xe5a9('0x29')],_0x3ba459['filters']));if(_0x20e1a1[_0xe5a9('0x29')][_0xe5a9('0x32')]){_0x3dd3da[_0xe5a9('0x30')]=_['merge'](_0x3dd3da[_0xe5a9('0x30')],{'$or':_[_0xe5a9('0x33')](_0xfe8914,function(_0x2e814f){if(_0x2e814f[_0xe5a9('0x34')][_0xe5a9('0x35')]!==_0xe5a9('0x36')){var _0x1b0662={};_0x1b0662[_0x2e814f[_0xe5a9('0x37')]]={'$like':'%'+_0x20e1a1[_0xe5a9('0x29')][_0xe5a9('0x32')]+'%'};return _0x1b0662;}})});}_0x3dd3da=_[_0xe5a9('0x38')]({},_0x3dd3da,_0x20e1a1[_0xe5a9('0x39')]);var _0x2d6263={'where':_0x3dd3da['where']};return db['MailSubstatus'][_0xe5a9('0x3a')](_0x2d6263)[_0xe5a9('0x1d')](function(_0x1d6af7){_0x25355f[_0xe5a9('0x3a')]=_0x1d6af7;if(_0x20e1a1[_0xe5a9('0x29')]['includeAll']){_0x3dd3da[_0xe5a9('0x3b')]=[{'all':!![]}];}return db['MailSubstatus'][_0xe5a9('0x3c')](_0x3dd3da);})[_0xe5a9('0x1d')](function(_0x248c4c){_0x25355f[_0xe5a9('0x3d')]=_0x248c4c;return _0x25355f;})[_0xe5a9('0x1d')](respondWithFilteredResult(_0x127ca0,_0x3dd3da))[_0xe5a9('0x3e')](handleError(_0x127ca0,null));};exports['show']=function(_0x30357b,_0x193ddb){var _0x5d49ed={'raw':!![],'where':{'id':_0x30357b[_0xe5a9('0x3f')]['id']}},_0x24b0ce={};_0x24b0ce[_0xe5a9('0x25')]=_[_0xe5a9('0x26')](db['MailSubstatus']['rawAttributes']);_0x24b0ce[_0xe5a9('0x29')]=_[_0xe5a9('0x26')](_0x30357b[_0xe5a9('0x29')]);_0x24b0ce[_0xe5a9('0x27')]=_['intersection'](_0x24b0ce[_0xe5a9('0x25')],_0x24b0ce[_0xe5a9('0x29')]);_0x5d49ed['attributes']=_[_0xe5a9('0x28')](_0x24b0ce[_0xe5a9('0x25')],qs[_0xe5a9('0x2b')](_0x30357b[_0xe5a9('0x29')][_0xe5a9('0x2b')]));_0x5d49ed[_0xe5a9('0x2a')]=_0x5d49ed['attributes'][_0xe5a9('0x2c')]?_0x5d49ed[_0xe5a9('0x2a')]:_0x24b0ce[_0xe5a9('0x25')];if(_0x30357b[_0xe5a9('0x29')][_0xe5a9('0x40')]){_0x5d49ed[_0xe5a9('0x3b')]=[{'all':!![]}];}_0x5d49ed=_[_0xe5a9('0x38')]({},_0x5d49ed,_0x30357b[_0xe5a9('0x39')]);return db[_0xe5a9('0x24')]['find'](_0x5d49ed)[_0xe5a9('0x1d')](handleEntityNotFound(_0x193ddb,null))[_0xe5a9('0x1d')](respondWithResult(_0x193ddb,null))['catch'](handleError(_0x193ddb,null));};exports[_0xe5a9('0x41')]=function(_0x30ff85,_0x14f585){return db['MailSubstatus'][_0xe5a9('0x41')](_0x30ff85['body'],{})[_0xe5a9('0x1d')](respondWithResult(_0x14f585,0xc9))[_0xe5a9('0x3e')](handleError(_0x14f585,null));};exports[_0xe5a9('0x42')]=function(_0x377e16,_0x4df251){if(_0x377e16[_0xe5a9('0x43')]['id']){delete _0x377e16[_0xe5a9('0x43')]['id'];}return db[_0xe5a9('0x24')][_0xe5a9('0x44')]({'where':{'id':_0x377e16[_0xe5a9('0x3f')]['id']}})[_0xe5a9('0x1d')](handleEntityNotFound(_0x4df251,null))[_0xe5a9('0x1d')](saveUpdates(_0x377e16[_0xe5a9('0x43')],null))[_0xe5a9('0x1d')](respondWithResult(_0x4df251,null))[_0xe5a9('0x3e')](handleError(_0x4df251,null));};exports[_0xe5a9('0x1c')]=function(_0x3637a3,_0x2b9a03){return db[_0xe5a9('0x24')][_0xe5a9('0x44')]({'where':{'id':_0x3637a3[_0xe5a9('0x3f')]['id']}})[_0xe5a9('0x1d')](handleEntityNotFound(_0x2b9a03,null))[_0xe5a9('0x1d')](removeEntity(_0x2b9a03,null))[_0xe5a9('0x3e')](handleError(_0x2b9a03,null));};exports[_0xe5a9('0x45')]=function(_0x4213eb,_0x26b8c4){return db[_0xe5a9('0x24')][_0xe5a9('0x45')]()[_0xe5a9('0x1d')](respondWithResult(_0x26b8c4,null))[_0xe5a9('0x3e')](handleError(_0x26b8c4,null));}; \ No newline at end of file +var _0xf40b=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','key','field','filter','options','MailSubstatus','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection'];(function(_0x29fd70,_0x4ff2c2){var _0x2d1193=function(_0x68e43e){while(--_0x68e43e){_0x29fd70['push'](_0x29fd70['shift']());}};_0x2d1193(++_0x4ff2c2);}(_0xf40b,0xb0));var _0xbf40=function(_0x3ed98d,_0x2f4af7){_0x3ed98d=_0x3ed98d-0x0;var _0x2b81e0=_0xf40b[_0x3ed98d];return _0x2b81e0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbf40('0x0'));var rimraf=require(_0xbf40('0x1'));var zipdir=require(_0xbf40('0x2'));var jsonpatch=require(_0xbf40('0x3'));var rp=require('request-promise');var moment=require(_0xbf40('0x4'));var BPromise=require(_0xbf40('0x5'));var Mustache=require(_0xbf40('0x6'));var util=require(_0xbf40('0x7'));var path=require(_0xbf40('0x8'));var sox=require('sox');var csv=require(_0xbf40('0x9'));var ejs=require(_0xbf40('0xa'));var fs=require('fs');var _=require(_0xbf40('0xb'));var squel=require(_0xbf40('0xc'));var crypto=require(_0xbf40('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbf40('0xe'));var toCsv=require(_0xbf40('0x9'));var querystring=require(_0xbf40('0xf'));var Papa=require(_0xbf40('0x10'));var authService=require(_0xbf40('0x11'));var hardwareService=require(_0xbf40('0x12'));var Redis=require(_0xbf40('0x13'));var qs=require(_0xbf40('0x14'));var logger=require('../../config/logger')(_0xbf40('0x15'));var utils=require(_0xbf40('0x16'));var config=require(_0xbf40('0x17'));var db=require(_0xbf40('0x18'))['db'];function respondWithStatusCode(_0x380a1e,_0x1eef4c){_0x1eef4c=_0x1eef4c||0xcc;return function(_0x2417ae){if(_0x2417ae){return _0x380a1e[_0xbf40('0x19')](_0x1eef4c);}return _0x380a1e['status'](_0x1eef4c)['end']();};}function respondWithResult(_0x6e3496,_0x3f86b5){_0x3f86b5=_0x3f86b5||0xc8;return function(_0x2cecca){if(_0x2cecca){return _0x6e3496[_0xbf40('0x1a')](_0x3f86b5)['json'](_0x2cecca);}};}function respondWithFilteredResult(_0xb61909,_0x3c9329){return function(_0x3965f6){if(_0x3965f6){var _0x347473=_0x3965f6[_0xbf40('0x1b')],_0x39a323=_0x3c9329['offset'],_0x203056=_0x3c9329[_0xbf40('0x1c')]+_0x3c9329[_0xbf40('0x1d')],_0x128f7d;if(_0x203056>=_0x347473){_0x203056=_0x347473;_0x128f7d=0xc8;}else{_0x128f7d=0xce;}_0xb61909[_0xbf40('0x1a')](_0x128f7d);return _0xb61909[_0xbf40('0x1e')](_0xbf40('0x1f'),_0x39a323+'-'+_0x203056+'/'+_0x347473)[_0xbf40('0x20')](_0x3965f6);}return null;};}function patchUpdates(_0x325545){return function(_0x3cca3c){try{jsonpatch['apply'](_0x3cca3c,_0x325545,!![]);}catch(_0x2c8af5){return BPromise[_0xbf40('0x21')](_0x2c8af5);}return _0x3cca3c[_0xbf40('0x22')]();};}function saveUpdates(_0x2d6492,_0x5540a6){return function(_0x46a864){if(_0x46a864){return _0x46a864[_0xbf40('0x23')](_0x2d6492)[_0xbf40('0x24')](function(_0x1922c8){return _0x1922c8;});}return null;};}function removeEntity(_0x2db94f,_0x23fc5b){return function(_0x275ff1){if(_0x275ff1){return _0x275ff1[_0xbf40('0x25')]()[_0xbf40('0x24')](function(){_0x2db94f[_0xbf40('0x1a')](0xcc)[_0xbf40('0x26')]();});}};}function handleEntityNotFound(_0x1487d0,_0x17fa9a){return function(_0x1471ee){if(!_0x1471ee){_0x1487d0[_0xbf40('0x19')](0x194);}return _0x1471ee;};}function handleError(_0xadf34b,_0x5c5e6d){_0x5c5e6d=_0x5c5e6d||0x1f4;return function(_0x2df7a8){logger[_0xbf40('0x27')](_0x2df7a8[_0xbf40('0x28')]);if(_0x2df7a8[_0xbf40('0x29')]){delete _0x2df7a8[_0xbf40('0x29')];}_0xadf34b[_0xbf40('0x1a')](_0x5c5e6d)[_0xbf40('0x2a')](_0x2df7a8);};}exports[_0xbf40('0x2b')]=function(_0x40f563,_0x266468){var _0x2faef5={},_0x2528f2={},_0x2af9ce={'count':0x0,'rows':[]};var _0x3db5e7=db['MailSubstatus'][_0xbf40('0x2c')];_0x2528f2['model']=_[_0xbf40('0x2d')](_0x3db5e7);_0x2528f2[_0xbf40('0x2e')]=_[_0xbf40('0x2d')](_0x40f563['query']);_0x2528f2[_0xbf40('0x2f')]=_[_0xbf40('0x30')](_0x2528f2[_0xbf40('0x31')],_0x2528f2['query']);_0x2faef5[_0xbf40('0x32')]=_['intersection'](_0x2528f2[_0xbf40('0x31')],qs[_0xbf40('0x33')](_0x40f563[_0xbf40('0x2e')]['fields']));_0x2faef5[_0xbf40('0x32')]=_0x2faef5[_0xbf40('0x32')][_0xbf40('0x34')]?_0x2faef5[_0xbf40('0x32')]:_0x2528f2[_0xbf40('0x31')];if(!_0x40f563[_0xbf40('0x2e')][_0xbf40('0x35')](_0xbf40('0x36'))){_0x2faef5[_0xbf40('0x1d')]=qs['limit'](_0x40f563[_0xbf40('0x2e')][_0xbf40('0x1d')]);_0x2faef5[_0xbf40('0x1c')]=qs[_0xbf40('0x1c')](_0x40f563['query'][_0xbf40('0x1c')]);}_0x2faef5['order']=qs[_0xbf40('0x37')](_0x40f563[_0xbf40('0x2e')][_0xbf40('0x37')]);_0x2faef5['where']=qs[_0xbf40('0x2f')](_[_0xbf40('0x38')](_0x40f563[_0xbf40('0x2e')],_0x2528f2[_0xbf40('0x2f')]));if(_0x40f563[_0xbf40('0x2e')]['filter']){_0x2faef5[_0xbf40('0x39')]=_[_0xbf40('0x3a')](_0x2faef5[_0xbf40('0x39')],{'$or':_['map'](_0x3db5e7,function(_0x38511f){if(_0x38511f[_0xbf40('0x3b')][_0xbf40('0x3c')]!=='VIRTUAL'){var _0x408ec9={};_0x408ec9[_0x38511f[_0xbf40('0x3d')]]={'$like':'%'+_0x40f563[_0xbf40('0x2e')][_0xbf40('0x3e')]+'%'};return _0x408ec9;}})});}_0x2faef5=_[_0xbf40('0x3a')]({},_0x2faef5,_0x40f563[_0xbf40('0x3f')]);var _0xb24d88={'where':_0x2faef5[_0xbf40('0x39')]};return db[_0xbf40('0x40')][_0xbf40('0x1b')](_0xb24d88)[_0xbf40('0x24')](function(_0x41aaff){_0x2af9ce[_0xbf40('0x1b')]=_0x41aaff;if(_0x40f563[_0xbf40('0x2e')]['includeAll']){_0x2faef5[_0xbf40('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_0xbf40('0x42')](_0x2faef5);})[_0xbf40('0x24')](function(_0x322c32){_0x2af9ce[_0xbf40('0x43')]=_0x322c32;return _0x2af9ce;})[_0xbf40('0x24')](respondWithFilteredResult(_0x266468,_0x2faef5))['catch'](handleError(_0x266468,null));};exports[_0xbf40('0x44')]=function(_0xfd6710,_0x51aa33){var _0x14f87c={'raw':!![],'where':{'id':_0xfd6710[_0xbf40('0x45')]['id']}},_0x58bd28={};_0x58bd28[_0xbf40('0x31')]=_[_0xbf40('0x2d')](db[_0xbf40('0x40')][_0xbf40('0x2c')]);_0x58bd28[_0xbf40('0x2e')]=_[_0xbf40('0x2d')](_0xfd6710['query']);_0x58bd28[_0xbf40('0x2f')]=_[_0xbf40('0x30')](_0x58bd28[_0xbf40('0x31')],_0x58bd28[_0xbf40('0x2e')]);_0x14f87c[_0xbf40('0x32')]=_[_0xbf40('0x30')](_0x58bd28[_0xbf40('0x31')],qs[_0xbf40('0x33')](_0xfd6710['query'][_0xbf40('0x33')]));_0x14f87c['attributes']=_0x14f87c[_0xbf40('0x32')][_0xbf40('0x34')]?_0x14f87c[_0xbf40('0x32')]:_0x58bd28[_0xbf40('0x31')];if(_0xfd6710['query']['includeAll']){_0x14f87c[_0xbf40('0x41')]=[{'all':!![]}];}_0x14f87c=_[_0xbf40('0x3a')]({},_0x14f87c,_0xfd6710[_0xbf40('0x3f')]);return db['MailSubstatus']['find'](_0x14f87c)[_0xbf40('0x24')](handleEntityNotFound(_0x51aa33,null))['then'](respondWithResult(_0x51aa33,null))[_0xbf40('0x46')](handleError(_0x51aa33,null));};exports['create']=function(_0x18758d,_0x420cd9){return db['MailSubstatus'][_0xbf40('0x47')](_0x18758d[_0xbf40('0x48')],{})['then'](respondWithResult(_0x420cd9,0xc9))['catch'](handleError(_0x420cd9,null));};exports[_0xbf40('0x23')]=function(_0x17dc02,_0x518794){if(_0x17dc02[_0xbf40('0x48')]['id']){delete _0x17dc02[_0xbf40('0x48')]['id'];}return db[_0xbf40('0x40')][_0xbf40('0x49')]({'where':{'id':_0x17dc02[_0xbf40('0x45')]['id']}})['then'](handleEntityNotFound(_0x518794,null))[_0xbf40('0x24')](saveUpdates(_0x17dc02[_0xbf40('0x48')],null))[_0xbf40('0x24')](respondWithResult(_0x518794,null))[_0xbf40('0x46')](handleError(_0x518794,null));};exports[_0xbf40('0x25')]=function(_0x105387,_0x2d0a27){return db['MailSubstatus']['find']({'where':{'id':_0x105387[_0xbf40('0x45')]['id']}})[_0xbf40('0x24')](handleEntityNotFound(_0x2d0a27,null))['then'](removeEntity(_0x2d0a27,null))[_0xbf40('0x46')](handleError(_0x2d0a27,null));};exports[_0xbf40('0x4a')]=function(_0xc10f3a,_0x51a8c3){return db[_0xbf40('0x40')][_0xbf40('0x4a')]()[_0xbf40('0x24')](respondWithResult(_0x51a8c3,null))['catch'](handleError(_0x51a8c3,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 37f236d..b4d88e7 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 _0xe265=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./mailSubstatus.attributes','exports','MailSubstatus'];(function(_0x38c160,_0x1318fa){var _0x780b56=function(_0x51c44e){while(--_0x51c44e){_0x38c160['push'](_0x38c160['shift']());}};_0x780b56(++_0x1318fa);}(_0xe265,0x6e));var _0x5e26=function(_0x4b939a,_0x2aa0c1){_0x4b939a=_0x4b939a-0x0;var _0x5773f4=_0xe265[_0x4b939a];return _0x5773f4;};'use strict';var _=require(_0x5e26('0x0'));var util=require(_0x5e26('0x1'));var logger=require(_0x5e26('0x2'))(_0x5e26('0x3'));var moment=require(_0x5e26('0x4'));var BPromise=require(_0x5e26('0x5'));var rp=require(_0x5e26('0x6'));var attributes=require(_0x5e26('0x7'));module[_0x5e26('0x8')]=function(_0x457d3a,_0x1c5d84){return _0x457d3a['define'](_0x5e26('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x210b=['moment','bluebird','request-promise','./mailSubstatus.attributes','define','mail_substatuses','lodash','util','../../config/logger','api'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x210b,0x11e));var _0xb210=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x210b[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xb210('0x0'));var util=require(_0xb210('0x1'));var logger=require(_0xb210('0x2'))(_0xb210('0x3'));var moment=require(_0xb210('0x4'));var BPromise=require(_0xb210('0x5'));var rp=require(_0xb210('0x6'));var attributes=require(_0xb210('0x7'));module['exports']=function(_0x4468a3,_0x3e923c){return _0x4468a3[_0xb210('0x8')]('MailSubstatus',attributes,{'tableName':_0xb210('0x9'),'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 9f81b97..5908135 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 _0x5b5d=['stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x4ca402,_0x316def){var _0x5926af=function(_0x3a58ea){while(--_0x3a58ea){_0x4ca402['push'](_0x4ca402['shift']());}};_0x5926af(++_0x316def);}(_0x5b5d,0x1a7));var _0xd5b5=function(_0x11066c,_0x3a12ae){_0x11066c=_0x11066c-0x0;var _0x4d3ab9=_0x5b5d[_0x11066c];return _0x4d3ab9;};'use strict';var _=require(_0xd5b5('0x0'));var util=require(_0xd5b5('0x1'));var moment=require('moment');var BPromise=require(_0xd5b5('0x2'));var rs=require(_0xd5b5('0x3'));var fs=require('fs');var Redis=require(_0xd5b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5b5('0x5'));var logger=require('../../config/logger')(_0xd5b5('0x6'));var config=require('../../config/environment');var jayson=require(_0xd5b5('0x7'));var client=jayson['client'][_0xd5b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x259672,_0x18772d,_0x48b451){return new BPromise(function(_0xb8bfa,_0x2d3c18){return client[_0xd5b5('0x9')](_0x259672,_0x48b451)[_0xd5b5('0xa')](function(_0x378028){logger[_0xd5b5('0xb')](_0xd5b5('0xc'),_0x18772d,'request\x20sent');logger['debug'](_0xd5b5('0xd'),_0x18772d,'request\x20sent',JSON[_0xd5b5('0xe')](_0x378028));if(_0x378028[_0xd5b5('0xf')]){if(_0x378028[_0xd5b5('0xf')]['code']===0x1f4){logger[_0xd5b5('0xf')](_0xd5b5('0xc'),_0x18772d,_0x378028[_0xd5b5('0xf')][_0xd5b5('0x10')]);return _0x2d3c18(_0x378028[_0xd5b5('0xf')]['message']);}logger[_0xd5b5('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x18772d,_0x378028[_0xd5b5('0xf')][_0xd5b5('0x10')]);return _0xb8bfa(_0x378028[_0xd5b5('0xf')][_0xd5b5('0x10')]);}else{logger[_0xd5b5('0xb')](_0xd5b5('0xc'),_0x18772d,'request\x20sent');_0xb8bfa(_0x378028[_0xd5b5('0x11')][_0xd5b5('0x10')]);}})[_0xd5b5('0x12')](function(_0x18814d){logger['error'](_0xd5b5('0xc'),_0x18772d,_0x18814d);_0x2d3c18(_0x18814d);});});} \ No newline at end of file +var _0x1c80=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x1c80,0xda));var _0x01c8=function(_0x541cd8,_0x43f9ef){_0x541cd8=_0x541cd8-0x0;var _0x3f233a=_0x1c80[_0x541cd8];return _0x3f233a;};'use strict';var _=require('lodash');var util=require(_0x01c8('0x0'));var moment=require(_0x01c8('0x1'));var BPromise=require(_0x01c8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01c8('0x3'))['db'];var utils=require(_0x01c8('0x4'));var logger=require(_0x01c8('0x5'))(_0x01c8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x01c8('0x7')][_0x01c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x67dbde,_0x42ac02,_0x5b9f83){return new BPromise(function(_0x4e01bf,_0x2f3470){return client[_0x01c8('0x9')](_0x67dbde,_0x5b9f83)[_0x01c8('0xa')](function(_0x37a956){logger[_0x01c8('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x42ac02,_0x01c8('0xc'));logger['debug'](_0x01c8('0xd'),_0x42ac02,'request\x20sent',JSON[_0x01c8('0xe')](_0x37a956));if(_0x37a956[_0x01c8('0xf')]){if(_0x37a956[_0x01c8('0xf')][_0x01c8('0x10')]===0x1f4){logger[_0x01c8('0xf')](_0x01c8('0x11'),_0x42ac02,_0x37a956[_0x01c8('0xf')][_0x01c8('0x12')]);return _0x2f3470(_0x37a956[_0x01c8('0xf')][_0x01c8('0x12')]);}logger[_0x01c8('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x42ac02,_0x37a956[_0x01c8('0xf')]['message']);return _0x4e01bf(_0x37a956['error']['message']);}else{logger[_0x01c8('0xb')](_0x01c8('0x11'),_0x42ac02,_0x01c8('0xc'));_0x4e01bf(_0x37a956[_0x01c8('0x13')][_0x01c8('0x12')]);}})[_0x01c8('0x14')](function(_0x12264b){logger[_0x01c8('0xf')](_0x01c8('0x11'),_0x42ac02,_0x12264b);_0x2f3470(_0x12264b);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 28389bf..b7fb5d8 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 _0x1115=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','index','get','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports','util','path'];(function(_0x2378ef,_0x1b182e){var _0x9dc6fb=function(_0x4ce9e0){while(--_0x4ce9e0){_0x2378ef['push'](_0x2378ef['shift']());}};_0x9dc6fb(++_0x1b182e);}(_0x1115,0x1b6));var _0x5111=function(_0x693cc0,_0xff873f){_0x693cc0=_0x693cc0-0x0;var _0xbf8ea=_0x1115[_0x693cc0];return _0xbf8ea;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var auth=require(_0x5111('0x5'));var interaction=require(_0x5111('0x6'));var config=require(_0x5111('0x7'));var controller=require(_0x5111('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5111('0x9')]);router[_0x5111('0xa')]('/describe',auth[_0x5111('0xb')](),controller[_0x5111('0xc')]);router['get'](_0x5111('0xd'),auth['isAuthenticated'](),controller[_0x5111('0xe')]);router[_0x5111('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5111('0x10')]('/:id',auth[_0x5111('0xb')](),controller['update']);router[_0x5111('0x11')](_0x5111('0xd'),auth[_0x5111('0xb')](),controller[_0x5111('0x12')]);module[_0x5111('0x13')]=router; \ No newline at end of file +var _0x1cb9=['isAuthenticated','index','/describe','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x278948,_0x85b993){var _0x59fecb=function(_0x49141d){while(--_0x49141d){_0x278948['push'](_0x278948['shift']());}};_0x59fecb(++_0x85b993);}(_0x1cb9,0x14e));var _0x91cb=function(_0xf5d8d3,_0x2eca8b){_0xf5d8d3=_0xf5d8d3-0x0;var _0x4cee10=_0x1cb9[_0xf5d8d3];return _0x4cee10;};'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('./mailTransferReport.controller');router[_0x91cb('0x7')]('/',auth[_0x91cb('0x8')](),controller[_0x91cb('0x9')]);router[_0x91cb('0x7')](_0x91cb('0xa'),auth[_0x91cb('0x8')](),controller['describe']);router[_0x91cb('0x7')]('/:id',auth[_0x91cb('0x8')](),controller['show']);router[_0x91cb('0xb')]('/',auth[_0x91cb('0x8')](),controller[_0x91cb('0xc')]);router[_0x91cb('0xd')](_0x91cb('0xe'),auth[_0x91cb('0x8')](),controller[_0x91cb('0xf')]);router[_0x91cb('0x10')](_0x91cb('0xe'),auth[_0x91cb('0x8')](),controller['destroy']);module[_0x91cb('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 42a3240..6d0de99 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 _0x6295=['account','queue','DATE','NOW','exports'];(function(_0x3dd012,_0x5e96ca){var _0x101667=function(_0x1b43bb){while(--_0x1b43bb){_0x3dd012['push'](_0x3dd012['shift']());}};_0x101667(++_0x5e96ca);}(_0x6295,0x1a3));var _0x5629=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6295[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5629('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5629('0x1'),'agent',_0x5629('0x2')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x5629('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x5629('0x4')]}}; \ No newline at end of file +var _0x7e75=['account','agent','queue','DATE','NOW','moment','sequelize','exports','ENUM'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7e75,0xef));var _0x57e7=function(_0x18379e,_0x5be24e){_0x18379e=_0x18379e-0x0;var _0x3c0620=_0x7e75[_0x18379e];return _0x3c0620;};'use strict';var moment=require(_0x57e7('0x0'));var Sequelize=require(_0x57e7('0x1'));module[_0x57e7('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x57e7('0x3')](_0x57e7('0x4'),_0x57e7('0x5'),_0x57e7('0x6')),'allowNull':![],'defaultValue':_0x57e7('0x6')},'transferredAt':{'type':Sequelize[_0x57e7('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x57e7('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index cd89981..e848d8e 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 _0xe706=['catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','MailTransferReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0xe706,0xa3));var _0x6e70=function(_0x5d08e4,_0x1c1ba6){_0x5d08e4=_0x5d08e4-0x0;var _0x1c7d40=_0xe706[_0x5d08e4];return _0x1c7d40;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var authService=require(_0x6e70('0x14'));var hardwareService=require(_0x6e70('0x15'));var Redis=require(_0x6e70('0x16'));var qs=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];function respondWithStatusCode(_0x15a1a5,_0x18cf27){_0x18cf27=_0x18cf27||0xcc;return function(_0x27dd9b){if(_0x27dd9b){return _0x15a1a5[_0x6e70('0x1b')](_0x18cf27);}return _0x15a1a5[_0x6e70('0x1c')](_0x18cf27)[_0x6e70('0x1d')]();};}function respondWithResult(_0x181005,_0x5dfbaa){_0x5dfbaa=_0x5dfbaa||0xc8;return function(_0x52737e){if(_0x52737e){return _0x181005['status'](_0x5dfbaa)[_0x6e70('0x1e')](_0x52737e);}};}function respondWithFilteredResult(_0x5a37a6,_0x53aed0){return function(_0x304716){if(_0x304716){var _0x22c50c=_0x304716[_0x6e70('0x1f')],_0x5d9263=_0x53aed0[_0x6e70('0x20')],_0x24f3ac=_0x53aed0['offset']+_0x53aed0['limit'],_0x5c3fe7;if(_0x24f3ac>=_0x22c50c){_0x24f3ac=_0x22c50c;_0x5c3fe7=0xc8;}else{_0x5c3fe7=0xce;}_0x5a37a6[_0x6e70('0x1c')](_0x5c3fe7);return _0x5a37a6['set'](_0x6e70('0x21'),_0x5d9263+'-'+_0x24f3ac+'/'+_0x22c50c)[_0x6e70('0x1e')](_0x304716);}return null;};}function patchUpdates(_0x53acdc){return function(_0x497d61){try{jsonpatch[_0x6e70('0x22')](_0x497d61,_0x53acdc,!![]);}catch(_0x208e21){return BPromise[_0x6e70('0x23')](_0x208e21);}return _0x497d61[_0x6e70('0x24')]();};}function saveUpdates(_0x3af484,_0xcdf9f2){return function(_0x1b2453){if(_0x1b2453){return _0x1b2453[_0x6e70('0x25')](_0x3af484)[_0x6e70('0x26')](function(_0xb29a2a){return _0xb29a2a;});}return null;};}function removeEntity(_0x4a0cfe,_0x228350){return function(_0x344b65){if(_0x344b65){return _0x344b65[_0x6e70('0x27')]()['then'](function(){_0x4a0cfe[_0x6e70('0x1c')](0xcc)[_0x6e70('0x1d')]();});}};}function handleEntityNotFound(_0x3337a6,_0x50da2c){return function(_0x10fc91){if(!_0x10fc91){_0x3337a6['sendStatus'](0x194);}return _0x10fc91;};}function handleError(_0x50aec2,_0x4e97c7){_0x4e97c7=_0x4e97c7||0x1f4;return function(_0x41e352){logger[_0x6e70('0x28')](_0x41e352['stack']);if(_0x41e352[_0x6e70('0x29')]){delete _0x41e352[_0x6e70('0x29')];}_0x50aec2['status'](_0x4e97c7)[_0x6e70('0x2a')](_0x41e352);};}exports[_0x6e70('0x2b')]=function(_0x2bb231,_0x4a67ac){var _0x54a5fe={},_0x2c4d37={},_0x3af17f={'count':0x0,'rows':[]};var _0x83c836=db[_0x6e70('0x2c')][_0x6e70('0x2d')];_0x2c4d37['model']=_[_0x6e70('0x2e')](_0x83c836);_0x2c4d37[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x2bb231[_0x6e70('0x2f')]);_0x2c4d37[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x2c4d37[_0x6e70('0x32')],_0x2c4d37[_0x6e70('0x2f')]);_0x54a5fe[_0x6e70('0x33')]=_[_0x6e70('0x31')](_0x2c4d37['model'],qs[_0x6e70('0x34')](_0x2bb231['query'][_0x6e70('0x34')]));_0x54a5fe['attributes']=_0x54a5fe[_0x6e70('0x33')][_0x6e70('0x35')]?_0x54a5fe[_0x6e70('0x33')]:_0x2c4d37['model'];if(!_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x36')]('nolimit')){_0x54a5fe[_0x6e70('0x37')]=qs[_0x6e70('0x37')](_0x2bb231['query'][_0x6e70('0x37')]);_0x54a5fe[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x20')]);}_0x54a5fe[_0x6e70('0x38')]=qs[_0x6e70('0x39')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x39')]);_0x54a5fe[_0x6e70('0x3a')]=qs['filters'](_[_0x6e70('0x3b')](_0x2bb231['query'],_0x2c4d37[_0x6e70('0x30')]));if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x3c')]){_0x54a5fe[_0x6e70('0x3a')]=_[_0x6e70('0x3d')](_0x54a5fe[_0x6e70('0x3a')],{'$or':_[_0x6e70('0x3e')](_0x83c836,function(_0xdd0bee){if(_0xdd0bee[_0x6e70('0x3f')][_0x6e70('0x40')]!==_0x6e70('0x41')){var _0x23d5e2={};_0x23d5e2[_0xdd0bee[_0x6e70('0x42')]]={'$like':'%'+_0x2bb231['query']['filter']+'%'};return _0x23d5e2;}})});}_0x54a5fe=_['merge']({},_0x54a5fe,_0x2bb231[_0x6e70('0x43')]);var _0x3841a0={'where':_0x54a5fe[_0x6e70('0x3a')]};return db[_0x6e70('0x2c')][_0x6e70('0x1f')](_0x3841a0)[_0x6e70('0x26')](function(_0x572a71){_0x3af17f[_0x6e70('0x1f')]=_0x572a71;if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x44')]){_0x54a5fe[_0x6e70('0x45')]=[{'all':!![]}];}return db[_0x6e70('0x2c')][_0x6e70('0x46')](_0x54a5fe);})[_0x6e70('0x26')](function(_0x16fc7d){_0x3af17f['rows']=_0x16fc7d;return _0x3af17f;})[_0x6e70('0x26')](respondWithFilteredResult(_0x4a67ac,_0x54a5fe))[_0x6e70('0x47')](handleError(_0x4a67ac,null));};exports[_0x6e70('0x48')]=function(_0x31cad2,_0x201da9){var _0x1de947={'raw':!![],'where':{'id':_0x31cad2['params']['id']}},_0x21b0e7={};_0x21b0e7['model']=_['keys'](db[_0x6e70('0x2c')][_0x6e70('0x2d')]);_0x21b0e7[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x31cad2[_0x6e70('0x2f')]);_0x21b0e7['filters']=_[_0x6e70('0x31')](_0x21b0e7[_0x6e70('0x32')],_0x21b0e7[_0x6e70('0x2f')]);_0x1de947['attributes']=_['intersection'](_0x21b0e7['model'],qs[_0x6e70('0x34')](_0x31cad2['query'][_0x6e70('0x34')]));_0x1de947[_0x6e70('0x33')]=_0x1de947[_0x6e70('0x33')][_0x6e70('0x35')]?_0x1de947['attributes']:_0x21b0e7[_0x6e70('0x32')];if(_0x31cad2['query'][_0x6e70('0x44')]){_0x1de947[_0x6e70('0x45')]=[{'all':!![]}];}_0x1de947=_[_0x6e70('0x3d')]({},_0x1de947,_0x31cad2[_0x6e70('0x43')]);return db['MailTransferReport'][_0x6e70('0x49')](_0x1de947)[_0x6e70('0x26')](handleEntityNotFound(_0x201da9,null))[_0x6e70('0x26')](respondWithResult(_0x201da9,null))[_0x6e70('0x47')](handleError(_0x201da9,null));};exports[_0x6e70('0x4a')]=function(_0x3fcb2d,_0x3d9c5){return db['MailTransferReport'][_0x6e70('0x4a')](_0x3fcb2d[_0x6e70('0x4b')],{})[_0x6e70('0x26')](respondWithResult(_0x3d9c5,0xc9))[_0x6e70('0x47')](handleError(_0x3d9c5,null));};exports[_0x6e70('0x25')]=function(_0x172e8a,_0x1e2095){if(_0x172e8a['body']['id']){delete _0x172e8a[_0x6e70('0x4b')]['id'];}return db['MailTransferReport'][_0x6e70('0x49')]({'where':{'id':_0x172e8a[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e2095,null))['then'](saveUpdates(_0x172e8a[_0x6e70('0x4b')],null))[_0x6e70('0x26')](respondWithResult(_0x1e2095,null))[_0x6e70('0x47')](handleError(_0x1e2095,null));};exports['destroy']=function(_0x4af9b1,_0x238ebb){return db[_0x6e70('0x2c')][_0x6e70('0x49')]({'where':{'id':_0x4af9b1[_0x6e70('0x4c')]['id']}})[_0x6e70('0x26')](handleEntityNotFound(_0x238ebb,null))[_0x6e70('0x26')](removeEntity(_0x238ebb,null))['catch'](handleError(_0x238ebb,null));};exports[_0x6e70('0x4d')]=function(_0x3aa1a6,_0x219f4){return db[_0x6e70('0x2c')][_0x6e70('0x4d')]()['then'](respondWithResult(_0x219f4,null))['catch'](handleError(_0x219f4,null));}; \ No newline at end of file +var _0xf4eb=['../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','end','status','json','count','offset','apply','update','then','destroy','sendStatus','stack','name','send','MailTransferReport','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','filter','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1a47c8,_0x3af6d0){_0x1a47c8=_0x1a47c8-0x0;var _0x4c0517=_0xf4eb[_0x1a47c8];return _0x4c0517;};'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 authService=require(_0xbf4e('0xc'));var hardwareService=require(_0xbf4e('0xd'));var Redis=require(_0xbf4e('0xe'));var qs=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'];function respondWithStatusCode(_0xcf6ba8,_0x54a96e){_0x54a96e=_0x54a96e||0xcc;return function(_0x17fd01){if(_0x17fd01){return _0xcf6ba8['sendStatus'](_0x54a96e);}return _0xcf6ba8['status'](_0x54a96e)[_0xbf4e('0x12')]();};}function respondWithResult(_0x46c79c,_0x1e029b){_0x1e029b=_0x1e029b||0xc8;return function(_0x302841){if(_0x302841){return _0x46c79c[_0xbf4e('0x13')](_0x1e029b)[_0xbf4e('0x14')](_0x302841);}};}function respondWithFilteredResult(_0x4984b4,_0x59fb15){return function(_0x180432){if(_0x180432){var _0x1735ae=_0x180432[_0xbf4e('0x15')],_0x28fc6b=_0x59fb15[_0xbf4e('0x16')],_0x542909=_0x59fb15[_0xbf4e('0x16')]+_0x59fb15['limit'],_0x14110b;if(_0x542909>=_0x1735ae){_0x542909=_0x1735ae;_0x14110b=0xc8;}else{_0x14110b=0xce;}_0x4984b4[_0xbf4e('0x13')](_0x14110b);return _0x4984b4['set']('Content-Range',_0x28fc6b+'-'+_0x542909+'/'+_0x1735ae)['json'](_0x180432);}return null;};}function patchUpdates(_0x4f8762){return function(_0x35992b){try{jsonpatch[_0xbf4e('0x17')](_0x35992b,_0x4f8762,!![]);}catch(_0x1fc800){return BPromise['reject'](_0x1fc800);}return _0x35992b['save']();};}function saveUpdates(_0x3d1aa7,_0x9a46ee){return function(_0x3be138){if(_0x3be138){return _0x3be138[_0xbf4e('0x18')](_0x3d1aa7)[_0xbf4e('0x19')](function(_0x1e2a68){return _0x1e2a68;});}return null;};}function removeEntity(_0x415963,_0x3d642a){return function(_0xd09e12){if(_0xd09e12){return _0xd09e12[_0xbf4e('0x1a')]()[_0xbf4e('0x19')](function(){_0x415963['status'](0xcc)[_0xbf4e('0x12')]();});}};}function handleEntityNotFound(_0x2e7673,_0x51648c){return function(_0x31e3f5){if(!_0x31e3f5){_0x2e7673[_0xbf4e('0x1b')](0x194);}return _0x31e3f5;};}function handleError(_0x114412,_0x1bda8b){_0x1bda8b=_0x1bda8b||0x1f4;return function(_0x3a5d72){logger['error'](_0x3a5d72[_0xbf4e('0x1c')]);if(_0x3a5d72[_0xbf4e('0x1d')]){delete _0x3a5d72[_0xbf4e('0x1d')];}_0x114412['status'](_0x1bda8b)[_0xbf4e('0x1e')](_0x3a5d72);};}exports['index']=function(_0x5bcf71,_0x2bfccf){var _0x5a0a9b={},_0x38c923={},_0x315df3={'count':0x0,'rows':[]};var _0x4021a9=db[_0xbf4e('0x1f')]['rawAttributes'];_0x38c923[_0xbf4e('0x20')]=_[_0xbf4e('0x21')](_0x4021a9);_0x38c923[_0xbf4e('0x22')]=_['keys'](_0x5bcf71[_0xbf4e('0x22')]);_0x38c923['filters']=_[_0xbf4e('0x23')](_0x38c923[_0xbf4e('0x20')],_0x38c923[_0xbf4e('0x22')]);_0x5a0a9b['attributes']=_[_0xbf4e('0x23')](_0x38c923[_0xbf4e('0x20')],qs[_0xbf4e('0x24')](_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x24')]));_0x5a0a9b[_0xbf4e('0x25')]=_0x5a0a9b['attributes'][_0xbf4e('0x26')]?_0x5a0a9b[_0xbf4e('0x25')]:_0x38c923['model'];if(!_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x27')]('nolimit')){_0x5a0a9b[_0xbf4e('0x28')]=qs['limit'](_0x5bcf71[_0xbf4e('0x22')]['limit']);_0x5a0a9b[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0x5bcf71[_0xbf4e('0x22')]['offset']);}_0x5a0a9b[_0xbf4e('0x29')]=qs[_0xbf4e('0x2a')](_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x2a')]);_0x5a0a9b[_0xbf4e('0x2b')]=qs[_0xbf4e('0x2c')](_['pick'](_0x5bcf71[_0xbf4e('0x22')],_0x38c923[_0xbf4e('0x2c')]));if(_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x2d')]){_0x5a0a9b[_0xbf4e('0x2b')]=_['merge'](_0x5a0a9b['where'],{'$or':_['map'](_0x4021a9,function(_0x4be59a){if(_0x4be59a[_0xbf4e('0x2e')][_0xbf4e('0x2f')]!==_0xbf4e('0x30')){var _0x2693ba={};_0x2693ba[_0x4be59a[_0xbf4e('0x31')]]={'$like':'%'+_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x2d')]+'%'};return _0x2693ba;}})});}_0x5a0a9b=_[_0xbf4e('0x32')]({},_0x5a0a9b,_0x5bcf71[_0xbf4e('0x33')]);var _0x54527d={'where':_0x5a0a9b['where']};return db[_0xbf4e('0x1f')][_0xbf4e('0x15')](_0x54527d)[_0xbf4e('0x19')](function(_0x4ae676){_0x315df3[_0xbf4e('0x15')]=_0x4ae676;if(_0x5bcf71['query'][_0xbf4e('0x34')]){_0x5a0a9b[_0xbf4e('0x35')]=[{'all':!![]}];}return db[_0xbf4e('0x1f')][_0xbf4e('0x36')](_0x5a0a9b);})['then'](function(_0x31d8dc){_0x315df3[_0xbf4e('0x37')]=_0x31d8dc;return _0x315df3;})[_0xbf4e('0x19')](respondWithFilteredResult(_0x2bfccf,_0x5a0a9b))[_0xbf4e('0x38')](handleError(_0x2bfccf,null));};exports['show']=function(_0x3d08d5,_0x44e96b){var _0x148d94={'raw':!![],'where':{'id':_0x3d08d5[_0xbf4e('0x39')]['id']}},_0x29fe9d={};_0x29fe9d[_0xbf4e('0x20')]=_[_0xbf4e('0x21')](db['MailTransferReport'][_0xbf4e('0x3a')]);_0x29fe9d[_0xbf4e('0x22')]=_['keys'](_0x3d08d5['query']);_0x29fe9d[_0xbf4e('0x2c')]=_[_0xbf4e('0x23')](_0x29fe9d['model'],_0x29fe9d['query']);_0x148d94[_0xbf4e('0x25')]=_[_0xbf4e('0x23')](_0x29fe9d[_0xbf4e('0x20')],qs[_0xbf4e('0x24')](_0x3d08d5[_0xbf4e('0x22')][_0xbf4e('0x24')]));_0x148d94['attributes']=_0x148d94[_0xbf4e('0x25')][_0xbf4e('0x26')]?_0x148d94['attributes']:_0x29fe9d['model'];if(_0x3d08d5['query']['includeAll']){_0x148d94[_0xbf4e('0x35')]=[{'all':!![]}];}_0x148d94=_['merge']({},_0x148d94,_0x3d08d5[_0xbf4e('0x33')]);return db[_0xbf4e('0x1f')]['find'](_0x148d94)['then'](handleEntityNotFound(_0x44e96b,null))[_0xbf4e('0x19')](respondWithResult(_0x44e96b,null))[_0xbf4e('0x38')](handleError(_0x44e96b,null));};exports[_0xbf4e('0x3b')]=function(_0x40c147,_0x8ab634){return db['MailTransferReport'][_0xbf4e('0x3b')](_0x40c147[_0xbf4e('0x3c')],{})[_0xbf4e('0x19')](respondWithResult(_0x8ab634,0xc9))[_0xbf4e('0x38')](handleError(_0x8ab634,null));};exports[_0xbf4e('0x18')]=function(_0x1bc421,_0x4060c7){if(_0x1bc421[_0xbf4e('0x3c')]['id']){delete _0x1bc421['body']['id'];}return db[_0xbf4e('0x1f')][_0xbf4e('0x3d')]({'where':{'id':_0x1bc421[_0xbf4e('0x39')]['id']}})[_0xbf4e('0x19')](handleEntityNotFound(_0x4060c7,null))[_0xbf4e('0x19')](saveUpdates(_0x1bc421[_0xbf4e('0x3c')],null))[_0xbf4e('0x19')](respondWithResult(_0x4060c7,null))[_0xbf4e('0x38')](handleError(_0x4060c7,null));};exports[_0xbf4e('0x1a')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x1f')][_0xbf4e('0x3d')]({'where':{'id':_0x3447ab[_0xbf4e('0x39')]['id']}})[_0xbf4e('0x19')](handleEntityNotFound(_0x2fdba9,null))[_0xbf4e('0x19')](removeEntity(_0x2fdba9,null))[_0xbf4e('0x38')](handleError(_0x2fdba9,null));};exports['describe']=function(_0x22d8ef,_0x17a7be){return db[_0xbf4e('0x1f')]['describe']()[_0xbf4e('0x19')](respondWithResult(_0x17a7be,null))['catch'](handleError(_0x17a7be,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index a2a56c5..bcdf830 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 _0x68df=['request-promise','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x400e0f,_0x3af578){var _0x24ca6f=function(_0x2c909f){while(--_0x2c909f){_0x400e0f['push'](_0x400e0f['shift']());}};_0x24ca6f(++_0x3af578);}(_0x68df,0xcd));var _0xf68d=function(_0xe38e0c,_0x5884ea){_0xe38e0c=_0xe38e0c-0x0;var _0x2c6987=_0x68df[_0xe38e0c];return _0x2c6987;};'use strict';var _=require(_0xf68d('0x0'));var util=require(_0xf68d('0x1'));var logger=require(_0xf68d('0x2'))('api');var moment=require(_0xf68d('0x3'));var BPromise=require(_0xf68d('0x4'));var rp=require(_0xf68d('0x5'));var attributes=require(_0xf68d('0x6'));module[_0xf68d('0x7')]=function(_0x24a70e,_0x2ce506){return _0x24a70e['define'](_0xf68d('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xf68d('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x868c=['api','moment','bluebird','request-promise','MailTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x21c001,_0xb01b9c){var _0x2ee97b=function(_0xb26016){while(--_0xb26016){_0x21c001['push'](_0x21c001['shift']());}};_0x2ee97b(++_0xb01b9c);}(_0x868c,0x16e));var _0xc868=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x868c[_0x215e65];return _0xa85842;};'use strict';var _=require(_0xc868('0x0'));var util=require(_0xc868('0x1'));var logger=require(_0xc868('0x2'))(_0xc868('0x3'));var moment=require(_0xc868('0x4'));var BPromise=require(_0xc868('0x5'));var rp=require(_0xc868('0x6'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x40292e,_0x3fd0bb){return _0x40292e['define'](_0xc868('0x7'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xc868('0x8'),'fields':[_0xc868('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index e07aabf..d0fd7ba 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 _0x36eb=['error','code','message','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e9a27,_0x571c93){var _0x2eb5ab=function(_0x5859c8){while(--_0x5859c8){_0x1e9a27['push'](_0x1e9a27['shift']());}};_0x2eb5ab(++_0x571c93);}(_0x36eb,0x1e3));var _0xb36e=function(_0x47b1be,_0x3a04cb){_0x47b1be=_0x47b1be-0x0;var _0x457c9e=_0x36eb[_0x47b1be];return _0x457c9e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xb36e('0x1'));var fs=require('fs');var Redis=require(_0xb36e('0x2'));var db=require(_0xb36e('0x3'))['db'];var utils=require(_0xb36e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb36e('0x5'));var jayson=require(_0xb36e('0x6'));var client=jayson[_0xb36e('0x7')][_0xb36e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ea211,_0xfb95fc,_0x821598){return new BPromise(function(_0x12981b,_0x1ee55c){return client[_0xb36e('0x9')](_0x1ea211,_0x821598)[_0xb36e('0xa')](function(_0x409e6a){logger[_0xb36e('0xb')](_0xb36e('0xc'),_0xfb95fc,_0xb36e('0xd'));logger[_0xb36e('0xe')](_0xb36e('0xf'),_0xfb95fc,_0xb36e('0xd'),JSON[_0xb36e('0x10')](_0x409e6a));if(_0x409e6a[_0xb36e('0x11')]){if(_0x409e6a[_0xb36e('0x11')][_0xb36e('0x12')]===0x1f4){logger['error'](_0xb36e('0xc'),_0xfb95fc,_0x409e6a[_0xb36e('0x11')][_0xb36e('0x13')]);return _0x1ee55c(_0x409e6a[_0xb36e('0x11')]['message']);}logger[_0xb36e('0x11')]('MailTransferReport,\x20%s,\x20%s',_0xfb95fc,_0x409e6a[_0xb36e('0x11')]['message']);return _0x12981b(_0x409e6a[_0xb36e('0x11')][_0xb36e('0x13')]);}else{logger[_0xb36e('0xb')](_0xb36e('0xc'),_0xfb95fc,_0xb36e('0xd'));_0x12981b(_0x409e6a['result'][_0xb36e('0x13')]);}})['catch'](function(_0x5c2145){logger[_0xb36e('0x11')](_0xb36e('0xc'),_0xfb95fc,_0x5c2145);_0x1ee55c(_0x5c2145);});});} \ No newline at end of file +var _0xf46d=['error','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf46d,0x11a));var _0xdf46=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xf46d[_0x54edc9];return _0x2ae7a9;};'use strict';var _=require(_0xdf46('0x0'));var util=require(_0xdf46('0x1'));var moment=require(_0xdf46('0x2'));var BPromise=require('bluebird');var rs=require(_0xdf46('0x3'));var fs=require('fs');var Redis=require(_0xdf46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf46('0x5'));var logger=require(_0xdf46('0x6'))(_0xdf46('0x7'));var config=require(_0xdf46('0x8'));var jayson=require(_0xdf46('0x9'));var client=jayson['client'][_0xdf46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3622ba,_0x470d2e,_0x4e7600){return new BPromise(function(_0x1d06d7,_0x33ddb6){return client[_0xdf46('0xb')](_0x3622ba,_0x4e7600)['then'](function(_0x17ff6e){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x470d2e,_0xdf46('0xc'));logger[_0xdf46('0xd')](_0xdf46('0xe'),_0x470d2e,_0xdf46('0xc'),JSON[_0xdf46('0xf')](_0x17ff6e));if(_0x17ff6e['error']){if(_0x17ff6e['error'][_0xdf46('0x10')]===0x1f4){logger[_0xdf46('0x11')](_0xdf46('0x12'),_0x470d2e,_0x17ff6e[_0xdf46('0x11')]['message']);return _0x33ddb6(_0x17ff6e[_0xdf46('0x11')][_0xdf46('0x13')]);}logger[_0xdf46('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x470d2e,_0x17ff6e['error'][_0xdf46('0x13')]);return _0x1d06d7(_0x17ff6e[_0xdf46('0x11')][_0xdf46('0x13')]);}else{logger[_0xdf46('0x14')](_0xdf46('0x12'),_0x470d2e,_0xdf46('0xc'));_0x1d06d7(_0x17ff6e[_0xdf46('0x15')]['message']);}})[_0xdf46('0x16')](function(_0x4d7d19){logger['error'](_0xdf46('0x12'),_0x470d2e,_0x4d7d19);_0x33ddb6(_0x4d7d19);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6fd732e..e8ede1b 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 _0xdb06=['post','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5125a7,_0x3f27ea){var _0x224ffb=function(_0x9a91ad){while(--_0x9a91ad){_0x5125a7['push'](_0x5125a7['shift']());}};_0x224ffb(++_0x3f27ea);}(_0xdb06,0x192));var _0x6db0=function(_0x22fd9e,_0x3f4ca5){_0x22fd9e=_0x22fd9e-0x0;var _0x283e53=_0xdb06[_0x22fd9e];return _0x283e53;};'use strict';var multer=require(_0x6db0('0x0'));var util=require(_0x6db0('0x1'));var path=require('path');var timeout=require(_0x6db0('0x2'));var express=require(_0x6db0('0x3'));var router=express[_0x6db0('0x4')]();var auth=require(_0x6db0('0x5'));var interaction=require(_0x6db0('0x6'));var config=require(_0x6db0('0x7'));var controller=require(_0x6db0('0x8'));router['get']('/',auth[_0x6db0('0x9')](),controller[_0x6db0('0xa')]);router['get'](_0x6db0('0xb'),auth[_0x6db0('0x9')](),controller[_0x6db0('0xc')]);router['get'](_0x6db0('0xd'),auth[_0x6db0('0x9')](),controller['show']);router[_0x6db0('0xe')]('/',auth[_0x6db0('0x9')](),controller['create']);router['put'](_0x6db0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6db0('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa900=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3e6072,_0x2decde){var _0x5353bd=function(_0x4d7c43){while(--_0x4d7c43){_0x3e6072['push'](_0x3e6072['shift']());}};_0x5353bd(++_0x2decde);}(_0xa900,0x1c5));var _0x0a90=function(_0x4b49c9,_0x290d55){_0x4b49c9=_0x4b49c9-0x0;var _0xab2d67=_0xa900[_0x4b49c9];return _0xab2d67;};'use strict';var multer=require(_0x0a90('0x0'));var util=require('util');var path=require(_0x0a90('0x1'));var timeout=require(_0x0a90('0x2'));var express=require(_0x0a90('0x3'));var router=express[_0x0a90('0x4')]();var auth=require(_0x0a90('0x5'));var interaction=require(_0x0a90('0x6'));var config=require(_0x0a90('0x7'));var controller=require(_0x0a90('0x8'));router[_0x0a90('0x9')]('/',auth[_0x0a90('0xa')](),controller[_0x0a90('0xb')]);router[_0x0a90('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x0a90('0xc')]);router[_0x0a90('0x9')](_0x0a90('0xd'),auth[_0x0a90('0xa')](),controller[_0x0a90('0xe')]);router[_0x0a90('0xf')]('/',auth[_0x0a90('0xa')](),controller['create']);router[_0x0a90('0x10')](_0x0a90('0xd'),auth[_0x0a90('0xa')](),controller[_0x0a90('0x11')]);router[_0x0a90('0x12')](_0x0a90('0xd'),auth[_0x0a90('0xa')](),controller[_0x0a90('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index abfe4c6..4f7fd4c 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 _0x1005=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt'];(function(_0x3ae0b1,_0x4add74){var _0x5a43d0=function(_0x36ea7b){while(--_0x36ea7b){_0x3ae0b1['push'](_0x3ae0b1['shift']());}};_0x5a43d0(++_0x4add74);}(_0x1005,0xc5));var _0x5100=function(_0x43ca6d,_0x931e7f){_0x43ca6d=_0x43ca6d-0x0;var _0x20536c=_0x1005[_0x43ca6d];return _0x20536c;};'use strict';var Sequelize=require(_0x5100('0x0'));var moment=require('moment');module[_0x5100('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5100('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x5100('0x3')},'duration':{'type':Sequelize[_0x5100('0x4')]},'enterAt':{'type':Sequelize[_0x5100('0x5')]},'exitAt':{'type':Sequelize[_0x5100('0x5')],'set':function(_0x4215e4){var _0x547b8d=moment(_0x4215e4);var _0x3dee19=moment(this[_0x5100('0x6')](_0x5100('0x7')));var _0x4d45aa=_0x547b8d[_0x5100('0x8')](_0x3dee19,'seconds');this[_0x5100('0x9')](_0x5100('0xa'),_0x4215e4);this[_0x5100('0x9')](_0x5100('0xb'),_0x4d45aa||null);}},'data1':{'type':Sequelize[_0x5100('0x2')],'comment':_0x5100('0xc')},'data2':{'type':Sequelize[_0x5100('0x2')],'comment':_0x5100('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x5100('0xe')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x5100('0x2')],'comment':_0x5100('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x5100('0x4')]},'uniqueid':{'type':Sequelize[_0x5100('0x2')]}}; \ No newline at end of file +var _0x3799=['DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x260fb9,_0x2bc9da){var _0x5326af=function(_0x3f00ae){while(--_0x3f00ae){_0x260fb9['push'](_0x260fb9['shift']());}};_0x5326af(++_0x2bc9da);}(_0x3799,0x163));var _0x9379=function(_0x243ac3,_0x4507de){_0x243ac3=_0x243ac3-0x0;var _0x440a9c=_0x3799[_0x243ac3];return _0x440a9c;};'use strict';var Sequelize=require(_0x9379('0x0'));var moment=require(_0x9379('0x1'));module[_0x9379('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9379('0x3')]},'interface':{'type':Sequelize[_0x9379('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x9379('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x9379('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x82e705){var _0x3a3e9d=moment(_0x82e705);var _0x4797a8=moment(this[_0x9379('0x6')](_0x9379('0x7')));var _0x3635b7=_0x3a3e9d[_0x9379('0x8')](_0x4797a8,'seconds');this[_0x9379('0x9')](_0x9379('0xa'),_0x82e705);this[_0x9379('0x9')](_0x9379('0xb'),_0x3635b7||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x9379('0xc')},'data2':{'type':Sequelize[_0x9379('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x9379('0xd')},'data4':{'type':Sequelize[_0x9379('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x9379('0xe')},'role':{'type':Sequelize[_0x9379('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9379('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 46fd0eb..0ffe1f9 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 _0x7887=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','map','type','key','field','options','MemberReport','includeAll','include','rows','catch','show','params','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x393bb8,_0x3dbc0e){var _0x5bcf1c=function(_0x1cee43){while(--_0x1cee43){_0x393bb8['push'](_0x393bb8['shift']());}};_0x5bcf1c(++_0x3dbc0e);}(_0x7887,0x1b3));var _0x7788=function(_0x1b6b80,_0x4ae79e){_0x1b6b80=_0x1b6b80-0x0;var _0xe224e9=_0x7887[_0x1b6b80];return _0xe224e9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7788('0x0'));var zipdir=require(_0x7788('0x1'));var jsonpatch=require(_0x7788('0x2'));var rp=require(_0x7788('0x3'));var moment=require(_0x7788('0x4'));var BPromise=require(_0x7788('0x5'));var Mustache=require('mustache');var util=require(_0x7788('0x6'));var path=require('path');var sox=require(_0x7788('0x7'));var csv=require(_0x7788('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7788('0x9'));var squel=require(_0x7788('0xa'));var crypto=require(_0x7788('0xb'));var jsforce=require(_0x7788('0xc'));var deskjs=require(_0x7788('0xd'));var toCsv=require(_0x7788('0x8'));var querystring=require(_0x7788('0xe'));var Papa=require(_0x7788('0xf'));var authService=require(_0x7788('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x7788('0x11'));var logger=require(_0x7788('0x12'))(_0x7788('0x13'));var utils=require(_0x7788('0x14'));var config=require(_0x7788('0x15'));var db=require(_0x7788('0x16'))['db'];function respondWithStatusCode(_0x55b5dc,_0x1bf1d4){_0x1bf1d4=_0x1bf1d4||0xcc;return function(_0x24a692){if(_0x24a692){return _0x55b5dc[_0x7788('0x17')](_0x1bf1d4);}return _0x55b5dc[_0x7788('0x18')](_0x1bf1d4)[_0x7788('0x19')]();};}function respondWithResult(_0xa56ac8,_0x30daae){_0x30daae=_0x30daae||0xc8;return function(_0x4f5e04){if(_0x4f5e04){return _0xa56ac8[_0x7788('0x18')](_0x30daae)[_0x7788('0x1a')](_0x4f5e04);}};}function respondWithFilteredResult(_0x18b7aa,_0x4e06cb){return function(_0x32fea6){if(_0x32fea6){var _0x4b8dc6=_0x32fea6[_0x7788('0x1b')],_0x317a73=_0x4e06cb[_0x7788('0x1c')],_0x2d5425=_0x4e06cb[_0x7788('0x1c')]+_0x4e06cb[_0x7788('0x1d')],_0x2f2c3f;if(_0x2d5425>=_0x4b8dc6){_0x2d5425=_0x4b8dc6;_0x2f2c3f=0xc8;}else{_0x2f2c3f=0xce;}_0x18b7aa[_0x7788('0x18')](_0x2f2c3f);return _0x18b7aa[_0x7788('0x1e')](_0x7788('0x1f'),_0x317a73+'-'+_0x2d5425+'/'+_0x4b8dc6)[_0x7788('0x1a')](_0x32fea6);}return null;};}function patchUpdates(_0x259436){return function(_0x558052){try{jsonpatch[_0x7788('0x20')](_0x558052,_0x259436,!![]);}catch(_0x4abd68){return BPromise[_0x7788('0x21')](_0x4abd68);}return _0x558052[_0x7788('0x22')]();};}function saveUpdates(_0x2ec029,_0x5ce940){return function(_0x5ea7cc){if(_0x5ea7cc){return _0x5ea7cc[_0x7788('0x23')](_0x2ec029)[_0x7788('0x24')](function(_0x3f3040){return _0x3f3040;});}return null;};}function removeEntity(_0xeed0e9,_0x4c1299){return function(_0x246ba2){if(_0x246ba2){return _0x246ba2[_0x7788('0x25')]()[_0x7788('0x24')](function(){_0xeed0e9[_0x7788('0x18')](0xcc)[_0x7788('0x19')]();});}};}function handleEntityNotFound(_0x1f7076,_0x2443d2){return function(_0x34a046){if(!_0x34a046){_0x1f7076['sendStatus'](0x194);}return _0x34a046;};}function handleError(_0xef21af,_0x4b5a95){_0x4b5a95=_0x4b5a95||0x1f4;return function(_0x4840d6){logger[_0x7788('0x26')](_0x4840d6[_0x7788('0x27')]);if(_0x4840d6['name']){delete _0x4840d6[_0x7788('0x28')];}_0xef21af[_0x7788('0x18')](_0x4b5a95)[_0x7788('0x29')](_0x4840d6);};}exports[_0x7788('0x2a')]=function(_0x4aa7d1,_0x3ec697){var _0x6d97cf={},_0x5eb7e5={},_0x2a4557={'count':0x0,'rows':[]};var _0x9d80f5=db['MemberReport'][_0x7788('0x2b')];_0x5eb7e5[_0x7788('0x2c')]=_[_0x7788('0x2d')](_0x9d80f5);_0x5eb7e5[_0x7788('0x2e')]=_[_0x7788('0x2d')](_0x4aa7d1[_0x7788('0x2e')]);_0x5eb7e5[_0x7788('0x2f')]=_[_0x7788('0x30')](_0x5eb7e5['model'],_0x5eb7e5['query']);_0x6d97cf['attributes']=_[_0x7788('0x30')](_0x5eb7e5[_0x7788('0x2c')],qs[_0x7788('0x31')](_0x4aa7d1[_0x7788('0x2e')]['fields']));_0x6d97cf[_0x7788('0x32')]=_0x6d97cf[_0x7788('0x32')][_0x7788('0x33')]?_0x6d97cf[_0x7788('0x32')]:_0x5eb7e5[_0x7788('0x2c')];if(!_0x4aa7d1[_0x7788('0x2e')]['hasOwnProperty'](_0x7788('0x34'))){_0x6d97cf[_0x7788('0x1d')]=qs[_0x7788('0x1d')](_0x4aa7d1[_0x7788('0x2e')][_0x7788('0x1d')]);_0x6d97cf[_0x7788('0x1c')]=qs[_0x7788('0x1c')](_0x4aa7d1[_0x7788('0x2e')]['offset']);}_0x6d97cf['order']=qs['sort'](_0x4aa7d1[_0x7788('0x2e')][_0x7788('0x35')]);_0x6d97cf[_0x7788('0x36')]=qs['filters'](_[_0x7788('0x37')](_0x4aa7d1[_0x7788('0x2e')],_0x5eb7e5['filters']));if(_0x4aa7d1[_0x7788('0x2e')][_0x7788('0x38')]){_0x6d97cf['where']=_['merge'](_0x6d97cf[_0x7788('0x36')],{'$or':_[_0x7788('0x39')](_0x9d80f5,function(_0x1dcc2e){if(_0x1dcc2e[_0x7788('0x3a')][_0x7788('0x3b')]!=='VIRTUAL'){var _0x574279={};_0x574279[_0x1dcc2e[_0x7788('0x3c')]]={'$like':'%'+_0x4aa7d1['query'][_0x7788('0x38')]+'%'};return _0x574279;}})});}_0x6d97cf=_['merge']({},_0x6d97cf,_0x4aa7d1[_0x7788('0x3d')]);var _0x3d8a97={'where':_0x6d97cf[_0x7788('0x36')]};return db[_0x7788('0x3e')][_0x7788('0x1b')](_0x3d8a97)['then'](function(_0x4cf6a1){_0x2a4557[_0x7788('0x1b')]=_0x4cf6a1;if(_0x4aa7d1[_0x7788('0x2e')][_0x7788('0x3f')]){_0x6d97cf[_0x7788('0x40')]=[{'all':!![]}];}return db[_0x7788('0x3e')]['findAll'](_0x6d97cf);})[_0x7788('0x24')](function(_0x53af85){_0x2a4557[_0x7788('0x41')]=_0x53af85;return _0x2a4557;})['then'](respondWithFilteredResult(_0x3ec697,_0x6d97cf))[_0x7788('0x42')](handleError(_0x3ec697,null));};exports[_0x7788('0x43')]=function(_0x5abff2,_0x91731f){var _0x4a620c={'raw':!![],'where':{'id':_0x5abff2[_0x7788('0x44')]['id']}},_0x1f1af0={};_0x1f1af0[_0x7788('0x2c')]=_[_0x7788('0x2d')](db[_0x7788('0x3e')][_0x7788('0x2b')]);_0x1f1af0[_0x7788('0x2e')]=_[_0x7788('0x2d')](_0x5abff2[_0x7788('0x2e')]);_0x1f1af0['filters']=_[_0x7788('0x30')](_0x1f1af0[_0x7788('0x2c')],_0x1f1af0[_0x7788('0x2e')]);_0x4a620c[_0x7788('0x32')]=_[_0x7788('0x30')](_0x1f1af0[_0x7788('0x2c')],qs['fields'](_0x5abff2[_0x7788('0x2e')][_0x7788('0x31')]));_0x4a620c['attributes']=_0x4a620c[_0x7788('0x32')][_0x7788('0x33')]?_0x4a620c[_0x7788('0x32')]:_0x1f1af0[_0x7788('0x2c')];if(_0x5abff2[_0x7788('0x2e')][_0x7788('0x3f')]){_0x4a620c[_0x7788('0x40')]=[{'all':!![]}];}_0x4a620c=_[_0x7788('0x45')]({},_0x4a620c,_0x5abff2[_0x7788('0x3d')]);return db['MemberReport'][_0x7788('0x46')](_0x4a620c)[_0x7788('0x24')](handleEntityNotFound(_0x91731f,null))['then'](respondWithResult(_0x91731f,null))[_0x7788('0x42')](handleError(_0x91731f,null));};exports['create']=function(_0x261e9b,_0x967faa){return db[_0x7788('0x3e')][_0x7788('0x47')](_0x261e9b[_0x7788('0x48')],{})[_0x7788('0x24')](respondWithResult(_0x967faa,0xc9))[_0x7788('0x42')](handleError(_0x967faa,null));};exports[_0x7788('0x23')]=function(_0x3fcca9,_0x251923){if(_0x3fcca9['body']['id']){delete _0x3fcca9[_0x7788('0x48')]['id'];}return db[_0x7788('0x3e')][_0x7788('0x46')]({'where':{'id':_0x3fcca9[_0x7788('0x44')]['id']}})['then'](handleEntityNotFound(_0x251923,null))['then'](saveUpdates(_0x3fcca9[_0x7788('0x48')],null))['then'](respondWithResult(_0x251923,null))[_0x7788('0x42')](handleError(_0x251923,null));};exports[_0x7788('0x25')]=function(_0x478c23,_0x19b790){return db['MemberReport'][_0x7788('0x46')]({'where':{'id':_0x478c23[_0x7788('0x44')]['id']}})[_0x7788('0x24')](handleEntityNotFound(_0x19b790,null))[_0x7788('0x24')](removeEntity(_0x19b790,null))[_0x7788('0x42')](handleError(_0x19b790,null));};exports[_0x7788('0x49')]=function(_0x11aa3f,_0x1b4ee6){return db[_0x7788('0x3e')][_0x7788('0x49')]()['then'](respondWithResult(_0x1b4ee6,null))[_0x7788('0x42')](handleError(_0x1b4ee6,null));}; \ No newline at end of file +var _0xb03e=['attributes','intersection','length','hasOwnProperty','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','merge','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','MemberReport','model','keys','query'];(function(_0x4af2cd,_0x2cc3fa){var _0x21f036=function(_0x49c175){while(--_0x49c175){_0x4af2cd['push'](_0x4af2cd['shift']());}};_0x21f036(++_0x2cc3fa);}(_0xb03e,0x1eb));var _0xeb03=function(_0x2c4772,_0x234800){_0x2c4772=_0x2c4772-0x0;var _0x44c314=_0xb03e[_0x2c4772];return _0x44c314;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeb03('0x0'));var rimraf=require(_0xeb03('0x1'));var zipdir=require(_0xeb03('0x2'));var jsonpatch=require(_0xeb03('0x3'));var rp=require(_0xeb03('0x4'));var moment=require(_0xeb03('0x5'));var BPromise=require(_0xeb03('0x6'));var Mustache=require(_0xeb03('0x7'));var util=require(_0xeb03('0x8'));var path=require(_0xeb03('0x9'));var sox=require(_0xeb03('0xa'));var csv=require(_0xeb03('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xb'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var authService=require(_0xeb03('0x12'));var hardwareService=require(_0xeb03('0x13'));var Redis=require('ioredis');var qs=require(_0xeb03('0x14'));var logger=require('../../config/logger')(_0xeb03('0x15'));var utils=require(_0xeb03('0x16'));var config=require(_0xeb03('0x17'));var db=require(_0xeb03('0x18'))['db'];function respondWithStatusCode(_0x2cf152,_0x45481b){_0x45481b=_0x45481b||0xcc;return function(_0x367d36){if(_0x367d36){return _0x2cf152[_0xeb03('0x19')](_0x45481b);}return _0x2cf152[_0xeb03('0x1a')](_0x45481b)[_0xeb03('0x1b')]();};}function respondWithResult(_0x39ab62,_0x3bebc6){_0x3bebc6=_0x3bebc6||0xc8;return function(_0x4d9c8e){if(_0x4d9c8e){return _0x39ab62[_0xeb03('0x1a')](_0x3bebc6)[_0xeb03('0x1c')](_0x4d9c8e);}};}function respondWithFilteredResult(_0x372c71,_0x33f9ba){return function(_0x52be5b){if(_0x52be5b){var _0x15f4fe=_0x52be5b[_0xeb03('0x1d')],_0x36f5d8=_0x33f9ba[_0xeb03('0x1e')],_0x3f26ef=_0x33f9ba[_0xeb03('0x1e')]+_0x33f9ba[_0xeb03('0x1f')],_0x478989;if(_0x3f26ef>=_0x15f4fe){_0x3f26ef=_0x15f4fe;_0x478989=0xc8;}else{_0x478989=0xce;}_0x372c71[_0xeb03('0x1a')](_0x478989);return _0x372c71[_0xeb03('0x20')](_0xeb03('0x21'),_0x36f5d8+'-'+_0x3f26ef+'/'+_0x15f4fe)[_0xeb03('0x1c')](_0x52be5b);}return null;};}function patchUpdates(_0x177f9c){return function(_0x469d25){try{jsonpatch[_0xeb03('0x22')](_0x469d25,_0x177f9c,!![]);}catch(_0x2c238d){return BPromise[_0xeb03('0x23')](_0x2c238d);}return _0x469d25[_0xeb03('0x24')]();};}function saveUpdates(_0x4d307c,_0x1bea3f){return function(_0x3855dd){if(_0x3855dd){return _0x3855dd[_0xeb03('0x25')](_0x4d307c)[_0xeb03('0x26')](function(_0xe5a1c2){return _0xe5a1c2;});}return null;};}function removeEntity(_0x31e406,_0xb98dc1){return function(_0x2c795b){if(_0x2c795b){return _0x2c795b[_0xeb03('0x27')]()['then'](function(){_0x31e406[_0xeb03('0x1a')](0xcc)[_0xeb03('0x1b')]();});}};}function handleEntityNotFound(_0x11ea85,_0x300dc0){return function(_0x2f99e6){if(!_0x2f99e6){_0x11ea85['sendStatus'](0x194);}return _0x2f99e6;};}function handleError(_0x638353,_0x406864){_0x406864=_0x406864||0x1f4;return function(_0x16cd4){logger[_0xeb03('0x28')](_0x16cd4[_0xeb03('0x29')]);if(_0x16cd4[_0xeb03('0x2a')]){delete _0x16cd4[_0xeb03('0x2a')];}_0x638353[_0xeb03('0x1a')](_0x406864)[_0xeb03('0x2b')](_0x16cd4);};}exports['index']=function(_0x832372,_0x1b2c7b){var _0x2683f9={},_0x1ada2e={},_0x4cdea6={'count':0x0,'rows':[]};var _0x581685=db[_0xeb03('0x2c')]['rawAttributes'];_0x1ada2e[_0xeb03('0x2d')]=_[_0xeb03('0x2e')](_0x581685);_0x1ada2e[_0xeb03('0x2f')]=_['keys'](_0x832372[_0xeb03('0x2f')]);_0x1ada2e['filters']=_['intersection'](_0x1ada2e['model'],_0x1ada2e['query']);_0x2683f9[_0xeb03('0x30')]=_[_0xeb03('0x31')](_0x1ada2e['model'],qs['fields'](_0x832372['query']['fields']));_0x2683f9[_0xeb03('0x30')]=_0x2683f9[_0xeb03('0x30')][_0xeb03('0x32')]?_0x2683f9[_0xeb03('0x30')]:_0x1ada2e[_0xeb03('0x2d')];if(!_0x832372['query'][_0xeb03('0x33')]('nolimit')){_0x2683f9[_0xeb03('0x1f')]=qs[_0xeb03('0x1f')](_0x832372[_0xeb03('0x2f')][_0xeb03('0x1f')]);_0x2683f9[_0xeb03('0x1e')]=qs[_0xeb03('0x1e')](_0x832372[_0xeb03('0x2f')][_0xeb03('0x1e')]);}_0x2683f9['order']=qs[_0xeb03('0x34')](_0x832372['query'][_0xeb03('0x34')]);_0x2683f9[_0xeb03('0x35')]=qs[_0xeb03('0x36')](_[_0xeb03('0x37')](_0x832372[_0xeb03('0x2f')],_0x1ada2e[_0xeb03('0x36')]));if(_0x832372['query'][_0xeb03('0x38')]){_0x2683f9['where']=_['merge'](_0x2683f9['where'],{'$or':_[_0xeb03('0x39')](_0x581685,function(_0x452868){if(_0x452868[_0xeb03('0x3a')][_0xeb03('0x3b')]!==_0xeb03('0x3c')){var _0x575ef1={};_0x575ef1[_0x452868[_0xeb03('0x3d')]]={'$like':'%'+_0x832372[_0xeb03('0x2f')][_0xeb03('0x38')]+'%'};return _0x575ef1;}})});}_0x2683f9=_['merge']({},_0x2683f9,_0x832372['options']);var _0xac05c4={'where':_0x2683f9[_0xeb03('0x35')]};return db[_0xeb03('0x2c')]['count'](_0xac05c4)[_0xeb03('0x26')](function(_0x392729){_0x4cdea6['count']=_0x392729;if(_0x832372['query'][_0xeb03('0x3e')]){_0x2683f9[_0xeb03('0x3f')]=[{'all':!![]}];}return db['MemberReport'][_0xeb03('0x40')](_0x2683f9);})[_0xeb03('0x26')](function(_0x3fa3de){_0x4cdea6[_0xeb03('0x41')]=_0x3fa3de;return _0x4cdea6;})[_0xeb03('0x26')](respondWithFilteredResult(_0x1b2c7b,_0x2683f9))[_0xeb03('0x42')](handleError(_0x1b2c7b,null));};exports[_0xeb03('0x43')]=function(_0x3c1c21,_0x20ebe8){var _0x286f48={'raw':!![],'where':{'id':_0x3c1c21[_0xeb03('0x44')]['id']}},_0x367d19={};_0x367d19[_0xeb03('0x2d')]=_[_0xeb03('0x2e')](db[_0xeb03('0x2c')][_0xeb03('0x45')]);_0x367d19[_0xeb03('0x2f')]=_[_0xeb03('0x2e')](_0x3c1c21[_0xeb03('0x2f')]);_0x367d19[_0xeb03('0x36')]=_[_0xeb03('0x31')](_0x367d19[_0xeb03('0x2d')],_0x367d19[_0xeb03('0x2f')]);_0x286f48['attributes']=_['intersection'](_0x367d19[_0xeb03('0x2d')],qs[_0xeb03('0x46')](_0x3c1c21[_0xeb03('0x2f')][_0xeb03('0x46')]));_0x286f48[_0xeb03('0x30')]=_0x286f48[_0xeb03('0x30')][_0xeb03('0x32')]?_0x286f48[_0xeb03('0x30')]:_0x367d19['model'];if(_0x3c1c21[_0xeb03('0x2f')][_0xeb03('0x3e')]){_0x286f48[_0xeb03('0x3f')]=[{'all':!![]}];}_0x286f48=_[_0xeb03('0x47')]({},_0x286f48,_0x3c1c21[_0xeb03('0x48')]);return db['MemberReport']['find'](_0x286f48)[_0xeb03('0x26')](handleEntityNotFound(_0x20ebe8,null))['then'](respondWithResult(_0x20ebe8,null))['catch'](handleError(_0x20ebe8,null));};exports['create']=function(_0xe8ed69,_0x28b92c){return db[_0xeb03('0x2c')][_0xeb03('0x49')](_0xe8ed69[_0xeb03('0x4a')],{})[_0xeb03('0x26')](respondWithResult(_0x28b92c,0xc9))['catch'](handleError(_0x28b92c,null));};exports[_0xeb03('0x25')]=function(_0x4bf739,_0x5c4fac){if(_0x4bf739[_0xeb03('0x4a')]['id']){delete _0x4bf739[_0xeb03('0x4a')]['id'];}return db[_0xeb03('0x2c')]['find']({'where':{'id':_0x4bf739[_0xeb03('0x44')]['id']}})[_0xeb03('0x26')](handleEntityNotFound(_0x5c4fac,null))[_0xeb03('0x26')](saveUpdates(_0x4bf739[_0xeb03('0x4a')],null))[_0xeb03('0x26')](respondWithResult(_0x5c4fac,null))['catch'](handleError(_0x5c4fac,null));};exports[_0xeb03('0x27')]=function(_0x4dc1f6,_0x13c295){return db[_0xeb03('0x2c')][_0xeb03('0x4b')]({'where':{'id':_0x4dc1f6[_0xeb03('0x44')]['id']}})[_0xeb03('0x26')](handleEntityNotFound(_0x13c295,null))[_0xeb03('0x26')](removeEntity(_0x13c295,null))[_0xeb03('0x42')](handleError(_0x13c295,null));};exports[_0xeb03('0x4c')]=function(_0x38c993,_0x2fe435){return db[_0xeb03('0x2c')][_0xeb03('0x4c')]()[_0xeb03('0x26')](respondWithResult(_0x2fe435,null))[_0xeb03('0x42')](handleError(_0x2fe435,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 2e60cd2..e9dd6e2 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 _0xa8bb=['exports','report_member','membername','interface','lodash','util','api','bluebird','request-promise'];(function(_0xd56eec,_0x29c137){var _0x5c1861=function(_0x5ec334){while(--_0x5ec334){_0xd56eec['push'](_0xd56eec['shift']());}};_0x5c1861(++_0x29c137);}(_0xa8bb,0x1ea));var _0xba8b=function(_0x151cf7,_0x44ec05){_0x151cf7=_0x151cf7-0x0;var _0x2e9b26=_0xa8bb[_0x151cf7];return _0x2e9b26;};'use strict';var _=require(_0xba8b('0x0'));var util=require(_0xba8b('0x1'));var logger=require('../../config/logger')(_0xba8b('0x2'));var moment=require('moment');var BPromise=require(_0xba8b('0x3'));var rp=require(_0xba8b('0x4'));var attributes=require('./memberReport.attributes');module[_0xba8b('0x5')]=function(_0x210564,_0x56ef8c){return _0x210564['define']('MemberReport',attributes,{'tableName':_0xba8b('0x6'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xba8b('0x7'),_0xba8b('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd159=['./memberReport.attributes','exports','MemberReport','membername_interface','interface','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2fa9ab,_0x1fc306){var _0x223c37=function(_0x318595){while(--_0x318595){_0x2fa9ab['push'](_0x2fa9ab['shift']());}};_0x223c37(++_0x1fc306);}(_0xd159,0x87));var _0x9d15=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd159[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x9d15('0x0'));var util=require('util');var logger=require(_0x9d15('0x1'))('api');var moment=require(_0x9d15('0x2'));var BPromise=require(_0x9d15('0x3'));var rp=require(_0x9d15('0x4'));var attributes=require(_0x9d15('0x5'));module[_0x9d15('0x6')]=function(_0x5cef61,_0x57f740){return _0x5cef61['define'](_0x9d15('0x7'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x9d15('0x8'),'fields':['membername',_0x9d15('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 7aa2833..67a0716 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 _0xcc8d=['body','then','debug','UpdateMemberReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','MemberReport','findAll','options','raw','where','attributes','map','model','include','GetMemberReport','CreateMemberReport','create'];(function(_0x3c918a,_0x5ef50e){var _0x480bf3=function(_0x8294df){while(--_0x8294df){_0x3c918a['push'](_0x3c918a['shift']());}};_0x480bf3(++_0x5ef50e);}(_0xcc8d,0x1e5));var _0xdcc8=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0xcc8d[_0x571a17];return _0x3ef337;};'use strict';var _=require('lodash');var util=require(_0xdcc8('0x0'));var moment=require(_0xdcc8('0x1'));var BPromise=require(_0xdcc8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcc8('0x3'));var db=require(_0xdcc8('0x4'))['db'];var utils=require(_0xdcc8('0x5'));var logger=require('../../config/logger')(_0xdcc8('0x6'));var config=require(_0xdcc8('0x7'));var jayson=require(_0xdcc8('0x8'));var client=jayson[_0xdcc8('0x9')][_0xdcc8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33405b,_0x58777b,_0x1118b0){return new BPromise(function(_0x3615fa,_0xf06ceb){return client['request'](_0x33405b,_0x1118b0)['then'](function(_0x55cc95){logger[_0xdcc8('0xb')](_0xdcc8('0xc'),_0x58777b,'request\x20sent');logger['debug'](_0xdcc8('0xd'),_0x58777b,_0xdcc8('0xe'),JSON[_0xdcc8('0xf')](_0x55cc95));if(_0x55cc95['error']){if(_0x55cc95['error'][_0xdcc8('0x10')]===0x1f4){logger[_0xdcc8('0x11')]('MemberReport,\x20%s,\x20%s',_0x58777b,_0x55cc95[_0xdcc8('0x11')][_0xdcc8('0x12')]);return _0xf06ceb(_0x55cc95[_0xdcc8('0x11')][_0xdcc8('0x12')]);}logger[_0xdcc8('0x11')](_0xdcc8('0xc'),_0x58777b,_0x55cc95[_0xdcc8('0x11')][_0xdcc8('0x12')]);return _0x3615fa(_0x55cc95[_0xdcc8('0x11')][_0xdcc8('0x12')]);}else{logger['info'](_0xdcc8('0xc'),_0x58777b,_0xdcc8('0xe'));_0x3615fa(_0x55cc95[_0xdcc8('0x13')]['message']);}})[_0xdcc8('0x14')](function(_0x4e1c05){logger[_0xdcc8('0x11')](_0xdcc8('0xc'),_0x58777b,_0x4e1c05);_0xf06ceb(_0x4e1c05);});});}exports['GetMemberReport']=function(_0x5d74ac){var _0x2152f1=this;return new Promise(function(_0xf1fe82,_0x209960){return db[_0xdcc8('0x15')][_0xdcc8('0x16')]({'raw':_0x5d74ac[_0xdcc8('0x17')]?_0x5d74ac[_0xdcc8('0x17')][_0xdcc8('0x18')]===undefined?!![]:![]:!![],'where':_0x5d74ac[_0xdcc8('0x17')]?_0x5d74ac['options'][_0xdcc8('0x19')]||null:null,'attributes':_0x5d74ac[_0xdcc8('0x17')]?_0x5d74ac[_0xdcc8('0x17')][_0xdcc8('0x1a')]||null:null,'limit':_0x5d74ac['options']?_0x5d74ac[_0xdcc8('0x17')]['limit']||null:null,'include':_0x5d74ac[_0xdcc8('0x17')]?_0x5d74ac[_0xdcc8('0x17')]['include']?_[_0xdcc8('0x1b')](_0x5d74ac[_0xdcc8('0x17')]['include'],function(_0x43996c){return{'model':db[_0x43996c[_0xdcc8('0x1c')]],'as':_0x43996c['as'],'attributes':_0x43996c['attributes'],'include':_0x43996c['include']?_[_0xdcc8('0x1b')](_0x43996c['include'],function(_0x558956){return{'model':db[_0x558956[_0xdcc8('0x1c')]],'as':_0x558956['as'],'attributes':_0x558956[_0xdcc8('0x1a')],'include':_0x558956[_0xdcc8('0x1d')]?_[_0xdcc8('0x1b')](_0x558956[_0xdcc8('0x1d')],function(_0xcfa03){return{'model':db[_0xcfa03[_0xdcc8('0x1c')]],'as':_0xcfa03['as'],'attributes':_0xcfa03[_0xdcc8('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a3c4e){logger[_0xdcc8('0xb')](_0xdcc8('0x1e'),_0x5d74ac);logger['debug'](_0xdcc8('0x1e'),_0x5d74ac,JSON[_0xdcc8('0xf')](_0x5a3c4e));_0xf1fe82(_0x5a3c4e);})['catch'](function(_0x2a2231){logger[_0xdcc8('0x11')](_0xdcc8('0x1e'),_0x2a2231[_0xdcc8('0x12')],_0x5d74ac);_0x209960(_0x2152f1[_0xdcc8('0x11')](0x1f4,_0x2a2231[_0xdcc8('0x12')]));});});};exports[_0xdcc8('0x1f')]=function(_0x40bbca){var _0x16fec5=this;return new Promise(function(_0x44334f,_0x1484f4){return db['MemberReport'][_0xdcc8('0x20')](_0x40bbca[_0xdcc8('0x21')],{'raw':_0x40bbca['options']?_0x40bbca[_0xdcc8('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xdcc8('0x22')](function(_0x5b0de4){logger[_0xdcc8('0xb')](_0xdcc8('0x1f'),_0x40bbca);logger[_0xdcc8('0x23')](_0xdcc8('0x1f'),_0x40bbca,JSON[_0xdcc8('0xf')](_0x5b0de4));_0x44334f(_0x5b0de4);})[_0xdcc8('0x14')](function(_0x2c6f42){logger['error'](_0xdcc8('0x1f'),_0x2c6f42[_0xdcc8('0x12')],_0x40bbca);_0x1484f4(_0x16fec5['error'](0x1f4,_0x2c6f42[_0xdcc8('0x12')]));});});};exports[_0xdcc8('0x24')]=function(_0xa1b8da){var _0x24836f=this;return new Promise(function(_0x2901c8,_0x7ecbaf){return db[_0xdcc8('0x15')]['update'](_0xa1b8da[_0xdcc8('0x21')],{'raw':_0xa1b8da[_0xdcc8('0x17')]?_0xa1b8da['options'][_0xdcc8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa1b8da[_0xdcc8('0x17')]?_0xa1b8da[_0xdcc8('0x17')]['where']||null:null,'attributes':_0xa1b8da['options']?_0xa1b8da[_0xdcc8('0x17')][_0xdcc8('0x1a')]||null:null,'limit':_0xa1b8da[_0xdcc8('0x17')]?_0xa1b8da['options']['limit']||null:null})[_0xdcc8('0x22')](function(_0xd039ef){logger[_0xdcc8('0xb')](_0xdcc8('0x24'),_0xa1b8da);logger[_0xdcc8('0x23')](_0xdcc8('0x24'),_0xa1b8da,JSON[_0xdcc8('0xf')](_0xd039ef));_0x2901c8(_0xd039ef);})[_0xdcc8('0x14')](function(_0x3f3c7e){logger[_0xdcc8('0x11')](_0xdcc8('0x24'),_0x3f3c7e['message'],_0xa1b8da);_0x7ecbaf(_0x24836f[_0xdcc8('0x11')](0x1f4,_0x3f3c7e[_0xdcc8('0x12')]));});});}; \ No newline at end of file +var _0xf1e7=['include','map','attributes','model','catch','CreateMemberReport','create','body','UpdateMemberReport','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','options','raw','limit'];(function(_0x53f4a3,_0x56fefa){var _0x2cf238=function(_0x3db664){while(--_0x3db664){_0x53f4a3['push'](_0x53f4a3['shift']());}};_0x2cf238(++_0x56fefa);}(_0xf1e7,0x1e5));var _0x7f1e=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xf1e7[_0x243b59];return _0x3e1676;};'use strict';var _=require('lodash');var util=require(_0x7f1e('0x0'));var moment=require('moment');var BPromise=require(_0x7f1e('0x1'));var rs=require(_0x7f1e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f1e('0x3'))['db'];var utils=require(_0x7f1e('0x4'));var logger=require(_0x7f1e('0x5'))(_0x7f1e('0x6'));var config=require(_0x7f1e('0x7'));var jayson=require(_0x7f1e('0x8'));var client=jayson[_0x7f1e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2507d7,_0x5041ab,_0xf82a3d){return new BPromise(function(_0x302e49,_0x562d4d){return client['request'](_0x2507d7,_0xf82a3d)['then'](function(_0x1778b8){logger[_0x7f1e('0xa')](_0x7f1e('0xb'),_0x5041ab,_0x7f1e('0xc'));logger[_0x7f1e('0xd')](_0x7f1e('0xe'),_0x5041ab,'request\x20sent',JSON[_0x7f1e('0xf')](_0x1778b8));if(_0x1778b8[_0x7f1e('0x10')]){if(_0x1778b8[_0x7f1e('0x10')][_0x7f1e('0x11')]===0x1f4){logger[_0x7f1e('0x10')](_0x7f1e('0xb'),_0x5041ab,_0x1778b8[_0x7f1e('0x10')][_0x7f1e('0x12')]);return _0x562d4d(_0x1778b8[_0x7f1e('0x10')][_0x7f1e('0x12')]);}logger[_0x7f1e('0x10')](_0x7f1e('0xb'),_0x5041ab,_0x1778b8[_0x7f1e('0x10')][_0x7f1e('0x12')]);return _0x302e49(_0x1778b8[_0x7f1e('0x10')][_0x7f1e('0x12')]);}else{logger[_0x7f1e('0xa')](_0x7f1e('0xb'),_0x5041ab,'request\x20sent');_0x302e49(_0x1778b8[_0x7f1e('0x13')]['message']);}})['catch'](function(_0x101fc2){logger['error'](_0x7f1e('0xb'),_0x5041ab,_0x101fc2);_0x562d4d(_0x101fc2);});});}exports[_0x7f1e('0x14')]=function(_0x54fca0){var _0x86b229=this;return new Promise(function(_0x5f2172,_0x387797){return db[_0x7f1e('0x15')]['findAll']({'raw':_0x54fca0[_0x7f1e('0x16')]?_0x54fca0[_0x7f1e('0x16')][_0x7f1e('0x17')]===undefined?!![]:![]:!![],'where':_0x54fca0[_0x7f1e('0x16')]?_0x54fca0[_0x7f1e('0x16')]['where']||null:null,'attributes':_0x54fca0['options']?_0x54fca0['options']['attributes']||null:null,'limit':_0x54fca0[_0x7f1e('0x16')]?_0x54fca0['options'][_0x7f1e('0x18')]||null:null,'include':_0x54fca0[_0x7f1e('0x16')]?_0x54fca0[_0x7f1e('0x16')][_0x7f1e('0x19')]?_[_0x7f1e('0x1a')](_0x54fca0['options']['include'],function(_0x286196){return{'model':db[_0x286196['model']],'as':_0x286196['as'],'attributes':_0x286196[_0x7f1e('0x1b')],'include':_0x286196[_0x7f1e('0x19')]?_[_0x7f1e('0x1a')](_0x286196[_0x7f1e('0x19')],function(_0x2e5f70){return{'model':db[_0x2e5f70[_0x7f1e('0x1c')]],'as':_0x2e5f70['as'],'attributes':_0x2e5f70[_0x7f1e('0x1b')],'include':_0x2e5f70[_0x7f1e('0x19')]?_[_0x7f1e('0x1a')](_0x2e5f70[_0x7f1e('0x19')],function(_0x2146d8){return{'model':db[_0x2146d8[_0x7f1e('0x1c')]],'as':_0x2146d8['as'],'attributes':_0x2146d8[_0x7f1e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x437a7a){logger[_0x7f1e('0xa')](_0x7f1e('0x14'),_0x54fca0);logger[_0x7f1e('0xd')]('GetMemberReport',_0x54fca0,JSON[_0x7f1e('0xf')](_0x437a7a));_0x5f2172(_0x437a7a);})[_0x7f1e('0x1d')](function(_0x574a1f){logger[_0x7f1e('0x10')]('GetMemberReport',_0x574a1f[_0x7f1e('0x12')],_0x54fca0);_0x387797(_0x86b229['error'](0x1f4,_0x574a1f[_0x7f1e('0x12')]));});});};exports[_0x7f1e('0x1e')]=function(_0xef2a85){var _0x2d7890=this;return new Promise(function(_0x1ed695,_0x358691){return db[_0x7f1e('0x15')][_0x7f1e('0x1f')](_0xef2a85[_0x7f1e('0x20')],{'raw':_0xef2a85[_0x7f1e('0x16')]?_0xef2a85['options'][_0x7f1e('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3fba0c){logger[_0x7f1e('0xa')]('CreateMemberReport',_0xef2a85);logger[_0x7f1e('0xd')](_0x7f1e('0x1e'),_0xef2a85,JSON['stringify'](_0x3fba0c));_0x1ed695(_0x3fba0c);})['catch'](function(_0x4f3173){logger[_0x7f1e('0x10')](_0x7f1e('0x1e'),_0x4f3173[_0x7f1e('0x12')],_0xef2a85);_0x358691(_0x2d7890[_0x7f1e('0x10')](0x1f4,_0x4f3173[_0x7f1e('0x12')]));});});};exports[_0x7f1e('0x21')]=function(_0x31665b){var _0x39f6bd=this;return new Promise(function(_0x5556f9,_0x4450c7){return db[_0x7f1e('0x15')]['update'](_0x31665b['body'],{'raw':_0x31665b[_0x7f1e('0x16')]?_0x31665b[_0x7f1e('0x16')][_0x7f1e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31665b[_0x7f1e('0x16')]?_0x31665b[_0x7f1e('0x16')]['where']||null:null,'attributes':_0x31665b['options']?_0x31665b[_0x7f1e('0x16')][_0x7f1e('0x1b')]||null:null,'limit':_0x31665b['options']?_0x31665b[_0x7f1e('0x16')][_0x7f1e('0x18')]||null:null})['then'](function(_0x230dcd){logger[_0x7f1e('0xa')](_0x7f1e('0x21'),_0x31665b);logger[_0x7f1e('0xd')](_0x7f1e('0x21'),_0x31665b,JSON[_0x7f1e('0xf')](_0x230dcd));_0x5556f9(_0x230dcd);})['catch'](function(_0x47c7a5){logger[_0x7f1e('0x10')](_0x7f1e('0x21'),_0x47c7a5[_0x7f1e('0x12')],_0x31665b);_0x4450c7(_0x39f6bd[_0x7f1e('0x10')](0x1f4,_0x47c7a5[_0x7f1e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 21eccba..3f75b56 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 _0x554f=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','exports','multer','util','path'];(function(_0x36d955,_0x2a6d31){var _0x1a9a6b=function(_0x3189d5){while(--_0x3189d5){_0x36d955['push'](_0x36d955['shift']());}};_0x1a9a6b(++_0x2a6d31);}(_0x554f,0x1d3));var _0xf554=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x554f[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0xf554('0x0'));var util=require(_0xf554('0x1'));var path=require(_0xf554('0x2'));var timeout=require(_0xf554('0x3'));var express=require('express');var router=express[_0xf554('0x4')]();var auth=require(_0xf554('0x5'));var interaction=require(_0xf554('0x6'));var config=require(_0xf554('0x7'));var controller=require('./migration.controller');router[_0xf554('0x8')]('/',controller['index']);module[_0xf554('0x9')]=router; \ No newline at end of file +var _0x53ae=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./migration.controller','index','exports','util'];(function(_0x66f4c4,_0x1b9d68){var _0xdce1cc=function(_0x3da21e){while(--_0x3da21e){_0x66f4c4['push'](_0x66f4c4['shift']());}};_0xdce1cc(++_0x1b9d68);}(_0x53ae,0x7d));var _0xe53a=function(_0x20c1cd,_0x44dcc6){_0x20c1cd=_0x20c1cd-0x0;var _0x11473c=_0x53ae[_0x20c1cd];return _0x11473c;};'use strict';var multer=require('multer');var util=require(_0xe53a('0x0'));var path=require(_0xe53a('0x1'));var timeout=require(_0xe53a('0x2'));var express=require('express');var router=express[_0xe53a('0x3')]();var auth=require(_0xe53a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe53a('0x5'));var controller=require(_0xe53a('0x6'));router['get']('/',controller[_0xe53a('0x7')]);module[_0xe53a('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index bfef877..477b19c 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 _0xd9f4=['sequelize','exports','STRING'];(function(_0x1882a5,_0x9b73dc){var _0x3e8c99=function(_0x54690d){while(--_0x54690d){_0x1882a5['push'](_0x1882a5['shift']());}};_0x3e8c99(++_0x9b73dc);}(_0xd9f4,0x7b));var _0x4d9f=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xd9f4[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require(_0x4d9f('0x0'));module[_0x4d9f('0x1')]={'version':{'type':Sequelize[_0x4d9f('0x2')],'primaryKey':!![],'autoIncrement':![]}}; \ No newline at end of file +var _0xd1bf=['sequelize','exports','STRING'];(function(_0x2bc49d,_0xd43ced){var _0x2ca459=function(_0x4e9196){while(--_0x4e9196){_0x2bc49d['push'](_0x2bc49d['shift']());}};_0x2ca459(++_0xd43ced);}(_0xd1bf,0x162));var _0xfd1b=function(_0x30c754,_0x3d223a){_0x30c754=_0x30c754-0x0;var _0x454d1c=_0xd1bf[_0x30c754];return _0x454d1c;};'use strict';var Sequelize=require(_0xfd1b('0x0'));module[_0xfd1b('0x1')]={'version':{'type':Sequelize[_0xfd1b('0x2')],'primaryKey':!![],'autoIncrement':![]}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index a982383..73d1c8c 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 _0x0866=['count','offset','limit','Content-Range','reject','save','update','then','destroy','end','error','name','model','keys','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','Migration','includeAll','include','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','json'];(function(_0x8dac63,_0x511c52){var _0x2dd029=function(_0x2cf4f7){while(--_0x2cf4f7){_0x8dac63['push'](_0x8dac63['shift']());}};_0x2dd029(++_0x511c52);}(_0x0866,0xe1));var _0x6086=function(_0x3e58e6,_0x1c5676){_0x3e58e6=_0x3e58e6-0x0;var _0xf68f3a=_0x0866[_0x3e58e6];return _0xf68f3a;};'use strict';var pdf=require(_0x6086('0x0'));var emlformat=require(_0x6086('0x1'));var rimraf=require(_0x6086('0x2'));var zipdir=require(_0x6086('0x3'));var jsonpatch=require(_0x6086('0x4'));var rp=require(_0x6086('0x5'));var moment=require(_0x6086('0x6'));var BPromise=require(_0x6086('0x7'));var Mustache=require(_0x6086('0x8'));var util=require('util');var path=require(_0x6086('0x9'));var sox=require('sox');var csv=require(_0x6086('0xa'));var ejs=require(_0x6086('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6086('0xc'));var crypto=require(_0x6086('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6086('0xe'));var toCsv=require(_0x6086('0xa'));var querystring=require(_0x6086('0xf'));var Papa=require(_0x6086('0x10'));var authService=require(_0x6086('0x11'));var hardwareService=require(_0x6086('0x12'));var Redis=require(_0x6086('0x13'));var qs=require(_0x6086('0x14'));var logger=require(_0x6086('0x15'))(_0x6086('0x16'));var utils=require('../../config/utils');var config=require(_0x6086('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c837e,_0x575106){_0x575106=_0x575106||0xcc;return function(_0x22bdc5){if(_0x22bdc5){return _0x1c837e[_0x6086('0x18')](_0x575106);}return _0x1c837e[_0x6086('0x19')](_0x575106)['end']();};}function respondWithResult(_0x1b7c8e,_0x2941f2){_0x2941f2=_0x2941f2||0xc8;return function(_0x45a0e0){if(_0x45a0e0){return _0x1b7c8e[_0x6086('0x19')](_0x2941f2)[_0x6086('0x1a')](_0x45a0e0);}};}function respondWithFilteredResult(_0x4fdffc,_0x567706){return function(_0x3de91f){if(_0x3de91f){var _0x5d979e=_0x3de91f[_0x6086('0x1b')],_0x5b9360=_0x567706[_0x6086('0x1c')],_0x2e7619=_0x567706[_0x6086('0x1c')]+_0x567706[_0x6086('0x1d')],_0x16e8e7;if(_0x2e7619>=_0x5d979e){_0x2e7619=_0x5d979e;_0x16e8e7=0xc8;}else{_0x16e8e7=0xce;}_0x4fdffc[_0x6086('0x19')](_0x16e8e7);return _0x4fdffc['set'](_0x6086('0x1e'),_0x5b9360+'-'+_0x2e7619+'/'+_0x5d979e)[_0x6086('0x1a')](_0x3de91f);}return null;};}function patchUpdates(_0x191ee1){return function(_0x2148f0){try{jsonpatch['apply'](_0x2148f0,_0x191ee1,!![]);}catch(_0x38a6fa){return BPromise[_0x6086('0x1f')](_0x38a6fa);}return _0x2148f0[_0x6086('0x20')]();};}function saveUpdates(_0x16eb4f,_0x44b869){return function(_0x30ddc2){if(_0x30ddc2){return _0x30ddc2[_0x6086('0x21')](_0x16eb4f)[_0x6086('0x22')](function(_0x11f84d){return _0x11f84d;});}return null;};}function removeEntity(_0x6a922d,_0x1004a0){return function(_0x67ac2f){if(_0x67ac2f){return _0x67ac2f[_0x6086('0x23')]()[_0x6086('0x22')](function(){_0x6a922d[_0x6086('0x19')](0xcc)[_0x6086('0x24')]();});}};}function handleEntityNotFound(_0x404739,_0x2b23d2){return function(_0x926705){if(!_0x926705){_0x404739[_0x6086('0x18')](0x194);}return _0x926705;};}function handleError(_0x274935,_0x5196f9){_0x5196f9=_0x5196f9||0x1f4;return function(_0x244d06){logger[_0x6086('0x25')](_0x244d06['stack']);if(_0x244d06[_0x6086('0x26')]){delete _0x244d06[_0x6086('0x26')];}_0x274935[_0x6086('0x19')](_0x5196f9)['send'](_0x244d06);};}exports['index']=function(_0x5da432,_0x33a3e3){var _0x1816bf={},_0x2852aa={},_0x134527={'count':0x0,'rows':[]};var _0x2d168f=db['Migration']['rawAttributes'];_0x2852aa[_0x6086('0x27')]=_[_0x6086('0x28')](_0x2d168f);_0x2852aa[_0x6086('0x29')]=_['keys'](_0x5da432[_0x6086('0x29')]);_0x2852aa['filters']=_['intersection'](_0x2852aa[_0x6086('0x27')],_0x2852aa['query']);_0x1816bf[_0x6086('0x2a')]=_['intersection'](_0x2852aa['model'],qs[_0x6086('0x2b')](_0x5da432[_0x6086('0x29')][_0x6086('0x2b')]));_0x1816bf[_0x6086('0x2a')]=_0x1816bf[_0x6086('0x2a')][_0x6086('0x2c')]?_0x1816bf['attributes']:_0x2852aa[_0x6086('0x27')];if(!_0x5da432['query'][_0x6086('0x2d')]('nolimit')){_0x1816bf[_0x6086('0x1d')]=qs[_0x6086('0x1d')](_0x5da432[_0x6086('0x29')][_0x6086('0x1d')]);_0x1816bf['offset']=qs[_0x6086('0x1c')](_0x5da432[_0x6086('0x29')][_0x6086('0x1c')]);}_0x1816bf[_0x6086('0x2e')]=qs[_0x6086('0x2f')](_0x5da432['query'][_0x6086('0x2f')]);_0x1816bf['where']=qs['filters'](_[_0x6086('0x30')](_0x5da432[_0x6086('0x29')],_0x2852aa['filters']));if(_0x5da432[_0x6086('0x29')][_0x6086('0x31')]){_0x1816bf[_0x6086('0x32')]=_[_0x6086('0x33')](_0x1816bf[_0x6086('0x32')],{'$or':_[_0x6086('0x34')](_0x2d168f,function(_0x24ba48){if(_0x24ba48[_0x6086('0x35')][_0x6086('0x36')]!==_0x6086('0x37')){var _0xa7e587={};_0xa7e587[_0x24ba48[_0x6086('0x38')]]={'$like':'%'+_0x5da432[_0x6086('0x29')][_0x6086('0x31')]+'%'};return _0xa7e587;}})});}_0x1816bf=_[_0x6086('0x33')]({},_0x1816bf,_0x5da432['options']);var _0x256ffd={'where':_0x1816bf['where']};return db[_0x6086('0x39')][_0x6086('0x1b')](_0x256ffd)[_0x6086('0x22')](function(_0x4d90a4){_0x134527[_0x6086('0x1b')]=_0x4d90a4;if(_0x5da432[_0x6086('0x29')][_0x6086('0x3a')]){_0x1816bf[_0x6086('0x3b')]=[{'all':!![]}];}return db[_0x6086('0x39')][_0x6086('0x3c')](_0x1816bf);})[_0x6086('0x22')](function(_0x1f5bd2){_0x134527[_0x6086('0x3d')]=_0x1f5bd2;return _0x134527;})[_0x6086('0x22')](respondWithFilteredResult(_0x33a3e3,_0x1816bf))[_0x6086('0x3e')](handleError(_0x33a3e3,null));}; \ No newline at end of file +var _0xb519=['sendStatus','error','stack','name','index','rawAttributes','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','field','Migration','includeAll','include','findAll','catch','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','status','json','count','offset','limit','reject','save','update','then','destroy','end'];(function(_0x4dda2f,_0x23c55d){var _0x38a1c9=function(_0x39ff51){while(--_0x39ff51){_0x4dda2f['push'](_0x4dda2f['shift']());}};_0x38a1c9(++_0x23c55d);}(_0xb519,0x1df));var _0x9b51=function(_0x228350,_0x1b6872){_0x228350=_0x228350-0x0;var _0x5dc5d3=_0xb519[_0x228350];return _0x5dc5d3;};'use strict';var pdf=require(_0x9b51('0x0'));var emlformat=require(_0x9b51('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9b51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b51('0x3'));var moment=require(_0x9b51('0x4'));var BPromise=require(_0x9b51('0x5'));var Mustache=require(_0x9b51('0x6'));var util=require('util');var path=require(_0x9b51('0x7'));var sox=require(_0x9b51('0x8'));var csv=require(_0x9b51('0x9'));var ejs=require(_0x9b51('0xa'));var fs=require('fs');var _=require(_0x9b51('0xb'));var squel=require('squel');var crypto=require(_0x9b51('0xc'));var jsforce=require(_0x9b51('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9b51('0x9'));var querystring=require(_0x9b51('0xe'));var Papa=require(_0x9b51('0xf'));var authService=require(_0x9b51('0x10'));var hardwareService=require(_0x9b51('0x11'));var Redis=require(_0x9b51('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x9b51('0x13'))(_0x9b51('0x14'));var utils=require('../../config/utils');var config=require(_0x9b51('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x427d82,_0x5eb7d4){_0x5eb7d4=_0x5eb7d4||0xcc;return function(_0x46858a){if(_0x46858a){return _0x427d82['sendStatus'](_0x5eb7d4);}return _0x427d82[_0x9b51('0x16')](_0x5eb7d4)['end']();};}function respondWithResult(_0x5812dc,_0x3c8ee9){_0x3c8ee9=_0x3c8ee9||0xc8;return function(_0x5e1d9a){if(_0x5e1d9a){return _0x5812dc['status'](_0x3c8ee9)[_0x9b51('0x17')](_0x5e1d9a);}};}function respondWithFilteredResult(_0x10eb96,_0x12ed21){return function(_0x3747d0){if(_0x3747d0){var _0x20d282=_0x3747d0[_0x9b51('0x18')],_0x2b774d=_0x12ed21['offset'],_0x4c539c=_0x12ed21[_0x9b51('0x19')]+_0x12ed21[_0x9b51('0x1a')],_0x17c1b7;if(_0x4c539c>=_0x20d282){_0x4c539c=_0x20d282;_0x17c1b7=0xc8;}else{_0x17c1b7=0xce;}_0x10eb96[_0x9b51('0x16')](_0x17c1b7);return _0x10eb96['set']('Content-Range',_0x2b774d+'-'+_0x4c539c+'/'+_0x20d282)[_0x9b51('0x17')](_0x3747d0);}return null;};}function patchUpdates(_0x758751){return function(_0x1631f5){try{jsonpatch['apply'](_0x1631f5,_0x758751,!![]);}catch(_0xbaa34f){return BPromise[_0x9b51('0x1b')](_0xbaa34f);}return _0x1631f5[_0x9b51('0x1c')]();};}function saveUpdates(_0xe3cf9,_0x3378b8){return function(_0x111e36){if(_0x111e36){return _0x111e36[_0x9b51('0x1d')](_0xe3cf9)[_0x9b51('0x1e')](function(_0x4a5b75){return _0x4a5b75;});}return null;};}function removeEntity(_0x1b417d,_0x29d978){return function(_0x462e5e){if(_0x462e5e){return _0x462e5e[_0x9b51('0x1f')]()[_0x9b51('0x1e')](function(){_0x1b417d['status'](0xcc)[_0x9b51('0x20')]();});}};}function handleEntityNotFound(_0x4d2c0b,_0x322d01){return function(_0x1310fe){if(!_0x1310fe){_0x4d2c0b[_0x9b51('0x21')](0x194);}return _0x1310fe;};}function handleError(_0x5880b4,_0x4f4e12){_0x4f4e12=_0x4f4e12||0x1f4;return function(_0x1c4ce6){logger[_0x9b51('0x22')](_0x1c4ce6[_0x9b51('0x23')]);if(_0x1c4ce6[_0x9b51('0x24')]){delete _0x1c4ce6[_0x9b51('0x24')];}_0x5880b4[_0x9b51('0x16')](_0x4f4e12)['send'](_0x1c4ce6);};}exports[_0x9b51('0x25')]=function(_0x2ae2ac,_0x38c8de){var _0x2cd1fc={},_0x3c7fb0={},_0x3c6c54={'count':0x0,'rows':[]};var _0xb13995=db['Migration'][_0x9b51('0x26')];_0x3c7fb0['model']=_['keys'](_0xb13995);_0x3c7fb0[_0x9b51('0x27')]=_[_0x9b51('0x28')](_0x2ae2ac[_0x9b51('0x27')]);_0x3c7fb0['filters']=_[_0x9b51('0x29')](_0x3c7fb0[_0x9b51('0x2a')],_0x3c7fb0['query']);_0x2cd1fc['attributes']=_[_0x9b51('0x29')](_0x3c7fb0['model'],qs[_0x9b51('0x2b')](_0x2ae2ac[_0x9b51('0x27')][_0x9b51('0x2b')]));_0x2cd1fc[_0x9b51('0x2c')]=_0x2cd1fc[_0x9b51('0x2c')][_0x9b51('0x2d')]?_0x2cd1fc[_0x9b51('0x2c')]:_0x3c7fb0['model'];if(!_0x2ae2ac['query'][_0x9b51('0x2e')](_0x9b51('0x2f'))){_0x2cd1fc[_0x9b51('0x1a')]=qs[_0x9b51('0x1a')](_0x2ae2ac[_0x9b51('0x27')][_0x9b51('0x1a')]);_0x2cd1fc['offset']=qs[_0x9b51('0x19')](_0x2ae2ac[_0x9b51('0x27')][_0x9b51('0x19')]);}_0x2cd1fc[_0x9b51('0x30')]=qs[_0x9b51('0x31')](_0x2ae2ac[_0x9b51('0x27')][_0x9b51('0x31')]);_0x2cd1fc[_0x9b51('0x32')]=qs['filters'](_[_0x9b51('0x33')](_0x2ae2ac[_0x9b51('0x27')],_0x3c7fb0[_0x9b51('0x34')]));if(_0x2ae2ac[_0x9b51('0x27')][_0x9b51('0x35')]){_0x2cd1fc[_0x9b51('0x32')]=_[_0x9b51('0x36')](_0x2cd1fc[_0x9b51('0x32')],{'$or':_[_0x9b51('0x37')](_0xb13995,function(_0x512cfa){if(_0x512cfa[_0x9b51('0x38')]['key']!==_0x9b51('0x39')){var _0x5a0b2d={};_0x5a0b2d[_0x512cfa[_0x9b51('0x3a')]]={'$like':'%'+_0x2ae2ac[_0x9b51('0x27')][_0x9b51('0x35')]+'%'};return _0x5a0b2d;}})});}_0x2cd1fc=_[_0x9b51('0x36')]({},_0x2cd1fc,_0x2ae2ac['options']);var _0x58417d={'where':_0x2cd1fc[_0x9b51('0x32')]};return db[_0x9b51('0x3b')][_0x9b51('0x18')](_0x58417d)[_0x9b51('0x1e')](function(_0x3c366d){_0x3c6c54[_0x9b51('0x18')]=_0x3c366d;if(_0x2ae2ac[_0x9b51('0x27')][_0x9b51('0x3c')]){_0x2cd1fc[_0x9b51('0x3d')]=[{'all':!![]}];}return db[_0x9b51('0x3b')][_0x9b51('0x3e')](_0x2cd1fc);})[_0x9b51('0x1e')](function(_0x1a98d9){_0x3c6c54['rows']=_0x1a98d9;return _0x3c6c54;})[_0x9b51('0x1e')](respondWithFilteredResult(_0x38c8de,_0x2cd1fc))[_0x9b51('0x3f')](handleError(_0x38c8de,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index cec2bef..f6fe8a9 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 _0x110e=['lodash','util','api','moment','bluebird','request-promise','./migration.attributes','Migration'];(function(_0x1757a4,_0x49b813){var _0x4c38c6=function(_0x212537){while(--_0x212537){_0x1757a4['push'](_0x1757a4['shift']());}};_0x4c38c6(++_0x49b813);}(_0x110e,0x68));var _0xe110=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x110e[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var logger=require('../../config/logger')(_0xe110('0x2'));var moment=require(_0xe110('0x3'));var BPromise=require(_0xe110('0x4'));var rp=require(_0xe110('0x5'));var attributes=require(_0xe110('0x6'));module['exports']=function(_0x563977,_0x5032de){return _0x563977['define'](_0xe110('0x7'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':![]});}; \ No newline at end of file +var _0x2525=['exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./migration.attributes'];(function(_0x27a5bb,_0x3f4cfb){var _0x2e17ea=function(_0x22912d){while(--_0x22912d){_0x27a5bb['push'](_0x27a5bb['shift']());}};_0x2e17ea(++_0x3f4cfb);}(_0x2525,0x1f0));var _0x5252=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2525[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x5252('0x0'));var util=require(_0x5252('0x1'));var logger=require(_0x5252('0x2'))(_0x5252('0x3'));var moment=require(_0x5252('0x4'));var BPromise=require(_0x5252('0x5'));var rp=require(_0x5252('0x6'));var attributes=require(_0x5252('0x7'));module[_0x5252('0x8')]=function(_0x4907eb,_0x4a73a2){return _0x4907eb[_0x5252('0x9')](_0x5252('0xa'),attributes,{'tableName':_0x5252('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 b41bcd1..0cfe699 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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4abb65,_0xb50d2e){var _0x41b948=function(_0x31c6f6){while(--_0x31c6f6){_0x4abb65['push'](_0x4abb65['shift']());}};_0x41b948(++_0xb50d2e);}(_0x8ef6,0xf2));var _0x68ef=function(_0x22ac22,_0x5d2d46){_0x22ac22=_0x22ac22-0x0;var _0x17e0cf=_0x8ef6[_0x22ac22];return _0x17e0cf;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Migration,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Migration,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x512bb2,_0x863309){var _0x1296f6=function(_0x5af97a){while(--_0x5af97a){_0x512bb2['push'](_0x512bb2['shift']());}};_0x1296f6(++_0x863309);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x00bb[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7f27722..bcdfa59 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 _0xe6cd=['multer','util','path','connect-timeout','Router','../../config/environment','./network.controller','get','isAuthenticated','index','show','put','update','/:id','exports'];(function(_0x4ec747,_0x44a0e4){var _0x3deaf1=function(_0x5238db){while(--_0x5238db){_0x4ec747['push'](_0x4ec747['shift']());}};_0x3deaf1(++_0x44a0e4);}(_0xe6cd,0x159));var _0xde6c=function(_0x53d0ab,_0x32774c){_0x53d0ab=_0x53d0ab-0x0;var _0x3eae64=_0xe6cd[_0x53d0ab];return _0x3eae64;};'use strict';var multer=require(_0xde6c('0x0'));var util=require(_0xde6c('0x1'));var path=require(_0xde6c('0x2'));var timeout=require(_0xde6c('0x3'));var express=require('express');var router=express[_0xde6c('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde6c('0x5'));var controller=require(_0xde6c('0x6'));router[_0xde6c('0x7')]('/',auth[_0xde6c('0x8')](),controller[_0xde6c('0x9')]);router[_0xde6c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xde6c('0xa')]);router['post']('/',auth[_0xde6c('0x8')](),controller['create']);router[_0xde6c('0xb')]('/:id',auth[_0xde6c('0x8')](),controller[_0xde6c('0xc')]);router['delete'](_0xde6c('0xd'),auth[_0xde6c('0x8')](),controller['destroy']);module[_0xde6c('0xe')]=router; \ No newline at end of file +var _0xcb83=['../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3a2689,_0x1ec923){var _0x1327d1=function(_0x194689){while(--_0x194689){_0x3a2689['push'](_0x3a2689['shift']());}};_0x1327d1(++_0x1ec923);}(_0xcb83,0x1c5));var _0x3cb8=function(_0x20f232,_0x44fa71){_0x20f232=_0x20f232-0x0;var _0xcefce9=_0xcb83[_0x20f232];return _0xcefce9;};'use strict';var multer=require(_0x3cb8('0x0'));var util=require('util');var path=require(_0x3cb8('0x1'));var timeout=require(_0x3cb8('0x2'));var express=require(_0x3cb8('0x3'));var router=express[_0x3cb8('0x4')]();var auth=require(_0x3cb8('0x5'));var interaction=require(_0x3cb8('0x6'));var config=require(_0x3cb8('0x7'));var controller=require(_0x3cb8('0x8'));router[_0x3cb8('0x9')]('/',auth[_0x3cb8('0xa')](),controller['index']);router[_0x3cb8('0x9')](_0x3cb8('0xb'),auth[_0x3cb8('0xa')](),controller['show']);router[_0x3cb8('0xc')]('/',auth[_0x3cb8('0xa')](),controller[_0x3cb8('0xd')]);router[_0x3cb8('0xe')](_0x3cb8('0xb'),auth[_0x3cb8('0xa')](),controller['update']);router['delete'](_0x3cb8('0xb'),auth['isAuthenticated'](),controller[_0x3cb8('0xf')]);module[_0x3cb8('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index b520bc9..13cf3dd 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 _0xd26e=['STRING','sequelize','exports','ENUM','externip'];(function(_0x560184,_0x49cb0a){var _0x595aa1=function(_0x44a3fa){while(--_0x44a3fa){_0x560184['push'](_0x560184['shift']());}};_0x595aa1(++_0x49cb0a);}(_0xd26e,0x74));var _0xed26=function(_0x4d8524,_0x1e8925){_0x4d8524=_0x4d8524-0x0;var _0xbdb413=_0xd26e[_0x4d8524];return _0xbdb413;};'use strict';var Sequelize=require(_0xed26('0x0'));module[_0xed26('0x1')]={'type':{'type':Sequelize[_0xed26('0x2')]('localnet',_0xed26('0x3'))},'value':{'type':Sequelize[_0xed26('0x4')]}}; \ No newline at end of file +var _0xa49b=['sequelize','exports','ENUM','localnet','externip','STRING'];(function(_0x3dd0b9,_0x1d6c92){var _0x4c0351=function(_0x2cf6a8){while(--_0x2cf6a8){_0x3dd0b9['push'](_0x3dd0b9['shift']());}};_0x4c0351(++_0x1d6c92);}(_0xa49b,0x84));var _0xba49=function(_0x1a7386,_0x571938){_0x1a7386=_0x1a7386-0x0;var _0x10b8f8=_0xa49b[_0x1a7386];return _0x10b8f8;};'use strict';var Sequelize=require(_0xba49('0x0'));module[_0xba49('0x1')]={'type':{'type':Sequelize[_0xba49('0x2')](_0xba49('0x3'),_0xba49('0x4'))},'value':{'type':Sequelize[_0xba49('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index db6728f..c2d135a 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 _0xd101=['papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','Network','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','findAll','show','params','includeAll','options','find','catch','create','sequelize','transaction','readFileSync','join','root','server/files/templates/network.ejs','utf8','writeFileSync','format','toLowerCase','chan_sip.so','body','Reload','render','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd101,0x1b8));var _0x1d10=function(_0x32d4f5,_0x2a8a17){_0x32d4f5=_0x32d4f5-0x0;var _0x5c1ab7=_0xd101[_0x32d4f5];return _0x5c1ab7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1d10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d10('0x1'));var jsonpatch=require(_0x1d10('0x2'));var rp=require(_0x1d10('0x3'));var moment=require('moment');var BPromise=require(_0x1d10('0x4'));var Mustache=require(_0x1d10('0x5'));var util=require(_0x1d10('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1d10('0x7'));var ejs=require(_0x1d10('0x8'));var fs=require('fs');var _=require(_0x1d10('0x9'));var squel=require(_0x1d10('0xa'));var crypto=require(_0x1d10('0xb'));var jsforce=require(_0x1d10('0xc'));var deskjs=require(_0x1d10('0xd'));var toCsv=require(_0x1d10('0x7'));var querystring=require(_0x1d10('0xe'));var Papa=require(_0x1d10('0xf'));var authService=require(_0x1d10('0x10'));var hardwareService=require(_0x1d10('0x11'));var Redis=require(_0x1d10('0x12'));var qs=require(_0x1d10('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1d10('0x14'));var db=require(_0x1d10('0x15'))['db'];var jayson=require(_0x1d10('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d895e,_0x23ded2,_0x1c720e,_0x2077a4){return new BPromise(function(_0x339436,_0x321637){var _0x30c704=_0x2077a4||client;return _0x30c704['request'](_0x1d895e,_0x1c720e)['then'](function(_0xac63e7){logger['info'](_0x1d10('0x17'),_0x23ded2,'request\x20sent');logger[_0x1d10('0x18')](_0x1d10('0x19'),_0x23ded2,_0x1d10('0x1a'),JSON[_0x1d10('0x1b')](_0xac63e7));if(_0xac63e7['error']){if(_0xac63e7[_0x1d10('0x1c')]['code']===0x1f4){logger[_0x1d10('0x1c')](_0x1d10('0x17'),_0x23ded2,_0xac63e7[_0x1d10('0x1c')][_0x1d10('0x1d')]);return _0x321637(_0xac63e7['error'][_0x1d10('0x1d')]);}logger[_0x1d10('0x1c')](_0x1d10('0x17'),_0x23ded2,_0xac63e7['error'][_0x1d10('0x1d')]);return _0x339436(_0xac63e7['error']['message']);}else{logger['info'](_0x1d10('0x17'),_0x23ded2,_0x1d10('0x1a'));_0x339436(_0xac63e7[_0x1d10('0x1e')][_0x1d10('0x1d')]);}})['catch'](function(_0x5a6f61){logger['error']('Network,\x20%s,\x20%s',_0x23ded2,_0x5a6f61);_0x321637(_0x5a6f61);});});}function respondWithStatusCode(_0x4c5723,_0x2d296f){_0x2d296f=_0x2d296f||0xcc;return function(_0x4d12a8){if(_0x4d12a8){return _0x4c5723[_0x1d10('0x1f')](_0x2d296f);}return _0x4c5723[_0x1d10('0x20')](_0x2d296f)[_0x1d10('0x21')]();};}function respondWithResult(_0x23bdac,_0x5df07a){_0x5df07a=_0x5df07a||0xc8;return function(_0x269bc4){if(_0x269bc4){return _0x23bdac['status'](_0x5df07a)[_0x1d10('0x22')](_0x269bc4);}};}function respondWithFilteredResult(_0xeff0fd,_0x13b83b){return function(_0x908be){if(_0x908be){var _0xf2b535=_0x908be[_0x1d10('0x23')],_0x43943b=_0x13b83b[_0x1d10('0x24')],_0x385baa=_0x13b83b[_0x1d10('0x24')]+_0x13b83b[_0x1d10('0x25')],_0x2bae8b;if(_0x385baa>=_0xf2b535){_0x385baa=_0xf2b535;_0x2bae8b=0xc8;}else{_0x2bae8b=0xce;}_0xeff0fd[_0x1d10('0x20')](_0x2bae8b);return _0xeff0fd['set'](_0x1d10('0x26'),_0x43943b+'-'+_0x385baa+'/'+_0xf2b535)['json'](_0x908be);}return null;};}function patchUpdates(_0x1968fa){return function(_0x3f78d7){try{jsonpatch[_0x1d10('0x27')](_0x3f78d7,_0x1968fa,!![]);}catch(_0x178ac1){return BPromise[_0x1d10('0x28')](_0x178ac1);}return _0x3f78d7[_0x1d10('0x29')]();};}function saveUpdates(_0x466cbc,_0xde96e6){return function(_0x28050b){if(_0x28050b){return _0x28050b[_0x1d10('0x2a')](_0x466cbc)[_0x1d10('0x2b')](function(_0x470272){return _0x470272;});}return null;};}function removeEntity(_0x25ae82,_0x43af37){return function(_0x55a142){if(_0x55a142){return _0x55a142[_0x1d10('0x2c')]()[_0x1d10('0x2b')](function(){_0x25ae82[_0x1d10('0x20')](0xcc)[_0x1d10('0x21')]();});}};}function handleEntityNotFound(_0x2f2e30,_0x404160){return function(_0x214f7e){if(!_0x214f7e){_0x2f2e30[_0x1d10('0x1f')](0x194);}return _0x214f7e;};}function handleError(_0x216076,_0x1585c2){_0x1585c2=_0x1585c2||0x1f4;return function(_0x26be74){logger[_0x1d10('0x1c')](_0x26be74[_0x1d10('0x2d')]);if(_0x26be74[_0x1d10('0x2e')]){delete _0x26be74[_0x1d10('0x2e')];}_0x216076['status'](_0x1585c2)['send'](_0x26be74);};}exports[_0x1d10('0x2f')]=function(_0x2c4db6,_0x2a8420){var _0x4eb85d={},_0x2bbbb0={},_0x2bea39={'count':0x0,'rows':[]};var _0x3e5c4a=db[_0x1d10('0x30')][_0x1d10('0x31')];_0x2bbbb0[_0x1d10('0x32')]=_[_0x1d10('0x33')](_0x3e5c4a);_0x2bbbb0[_0x1d10('0x34')]=_['keys'](_0x2c4db6[_0x1d10('0x34')]);_0x2bbbb0[_0x1d10('0x35')]=_[_0x1d10('0x36')](_0x2bbbb0[_0x1d10('0x32')],_0x2bbbb0[_0x1d10('0x34')]);_0x4eb85d[_0x1d10('0x37')]=_[_0x1d10('0x36')](_0x2bbbb0[_0x1d10('0x32')],qs[_0x1d10('0x38')](_0x2c4db6[_0x1d10('0x34')][_0x1d10('0x38')]));_0x4eb85d[_0x1d10('0x37')]=_0x4eb85d[_0x1d10('0x37')][_0x1d10('0x39')]?_0x4eb85d[_0x1d10('0x37')]:_0x2bbbb0[_0x1d10('0x32')];if(!_0x2c4db6[_0x1d10('0x34')]['hasOwnProperty'](_0x1d10('0x3a'))){_0x4eb85d[_0x1d10('0x25')]=qs[_0x1d10('0x25')](_0x2c4db6['query'][_0x1d10('0x25')]);_0x4eb85d[_0x1d10('0x24')]=qs[_0x1d10('0x24')](_0x2c4db6['query'][_0x1d10('0x24')]);}_0x4eb85d[_0x1d10('0x3b')]=qs[_0x1d10('0x3c')](_0x2c4db6[_0x1d10('0x34')][_0x1d10('0x3c')]);_0x4eb85d[_0x1d10('0x3d')]=qs[_0x1d10('0x35')](_['pick'](_0x2c4db6[_0x1d10('0x34')],_0x2bbbb0[_0x1d10('0x35')]));if(_0x2c4db6[_0x1d10('0x34')][_0x1d10('0x3e')]){_0x4eb85d[_0x1d10('0x3d')]=_[_0x1d10('0x3f')](_0x4eb85d[_0x1d10('0x3d')],{'$or':_[_0x1d10('0x40')](_0x3e5c4a,function(_0x42af1e){if(_0x42af1e[_0x1d10('0x41')][_0x1d10('0x42')]!==_0x1d10('0x43')){var _0x1ed319={};_0x1ed319[_0x42af1e[_0x1d10('0x44')]]={'$like':'%'+_0x2c4db6['query'][_0x1d10('0x3e')]+'%'};return _0x1ed319;}})});}_0x4eb85d=_[_0x1d10('0x3f')]({},_0x4eb85d,_0x2c4db6['options']);var _0x2d5b0d={'where':_0x4eb85d[_0x1d10('0x3d')]};return db['Network'][_0x1d10('0x23')](_0x2d5b0d)[_0x1d10('0x2b')](function(_0x45d08b){_0x2bea39[_0x1d10('0x23')]=_0x45d08b;if(_0x2c4db6[_0x1d10('0x34')]['includeAll']){_0x4eb85d['include']=[{'all':!![]}];}return db[_0x1d10('0x30')][_0x1d10('0x45')](_0x4eb85d);})[_0x1d10('0x2b')](function(_0x19a1fe){_0x2bea39['rows']=_0x19a1fe;return _0x2bea39;})['then'](respondWithFilteredResult(_0x2a8420,_0x4eb85d))['catch'](handleError(_0x2a8420,null));};exports[_0x1d10('0x46')]=function(_0x5b91e8,_0x55790e){var _0x1ebf6f={'raw':!![],'where':{'id':_0x5b91e8[_0x1d10('0x47')]['id']}},_0x5a2936={};_0x5a2936[_0x1d10('0x32')]=_[_0x1d10('0x33')](db[_0x1d10('0x30')][_0x1d10('0x31')]);_0x5a2936[_0x1d10('0x34')]=_['keys'](_0x5b91e8[_0x1d10('0x34')]);_0x5a2936[_0x1d10('0x35')]=_['intersection'](_0x5a2936['model'],_0x5a2936[_0x1d10('0x34')]);_0x1ebf6f[_0x1d10('0x37')]=_[_0x1d10('0x36')](_0x5a2936[_0x1d10('0x32')],qs[_0x1d10('0x38')](_0x5b91e8[_0x1d10('0x34')][_0x1d10('0x38')]));_0x1ebf6f['attributes']=_0x1ebf6f['attributes'][_0x1d10('0x39')]?_0x1ebf6f[_0x1d10('0x37')]:_0x5a2936[_0x1d10('0x32')];if(_0x5b91e8[_0x1d10('0x34')][_0x1d10('0x48')]){_0x1ebf6f['include']=[{'all':!![]}];}_0x1ebf6f=_['merge']({},_0x1ebf6f,_0x5b91e8[_0x1d10('0x49')]);return db[_0x1d10('0x30')][_0x1d10('0x4a')](_0x1ebf6f)[_0x1d10('0x2b')](handleEntityNotFound(_0x55790e,null))['then'](respondWithResult(_0x55790e,null))[_0x1d10('0x4b')](handleError(_0x55790e,null));};exports[_0x1d10('0x4c')]=function(_0xc897cb,_0x227d72,_0x29eed8){var _0xefacc6;return db[_0x1d10('0x4d')][_0x1d10('0x4e')](function(_0x2125a7){return db['Network']['create'](_0xc897cb['body'],{'raw':!![]})[_0x1d10('0x2b')](function(_0x29fd68){_0xefacc6=_0x29fd68;return db[_0x1d10('0x30')][_0x1d10('0x45')]({'where':{'type':_0xc897cb['body']['type']},'raw':!![]});})[_0x1d10('0x2b')](function(_0x3b8b5c){var _0x2ee6fa=fs[_0x1d10('0x4f')](path[_0x1d10('0x50')](config[_0x1d10('0x51')],_0x1d10('0x52')),_0x1d10('0x53'));var _0x880865=ejs['render'](_0x2ee6fa,{'networks':_0x3b8b5c||[]});fs[_0x1d10('0x54')](util[_0x1d10('0x55')]('/etc/asterisk/sip_xcally_%s.conf',_0xc897cb['body'][_0x1d10('0x41')][_0x1d10('0x56')]()),_0x880865);})[_0x1d10('0x2b')](function(){return respondWithRpcPromise('Reload',_0x1d10('0x4c'),{'module':_0x1d10('0x57')});})[_0x1d10('0x2b')](function(){return _0xefacc6;});})[_0x1d10('0x2b')](respondWithResult(_0x227d72,0xc9))['catch'](handleError(_0x227d72,null));};exports[_0x1d10('0x2a')]=function(_0x56a6b8,_0x594000,_0x488aae){var _0x567763;return db[_0x1d10('0x4d')][_0x1d10('0x4e')](function(_0x3b5677){return db[_0x1d10('0x30')][_0x1d10('0x4a')]({'where':{'id':_0x56a6b8[_0x1d10('0x47')]['id']}})['then'](handleEntityNotFound(_0x594000,null))[_0x1d10('0x2b')](saveUpdates(_0x56a6b8[_0x1d10('0x58')],null))[_0x1d10('0x2b')](function(_0x5a4144){if(_0x5a4144){_0x567763=_0x5a4144;return db['Network'][_0x1d10('0x45')]({'where':{'type':_0x567763[_0x1d10('0x41')]},'raw':!![]});}return null;})[_0x1d10('0x2b')](function(_0x3634a6){if(_0x3634a6){var _0x6a4a68=fs['readFileSync'](path['join'](config[_0x1d10('0x51')],_0x1d10('0x52')),'utf8');var _0x5426d1=ejs['render'](_0x6a4a68,{'networks':_0x3634a6||[]});fs[_0x1d10('0x54')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x567763[_0x1d10('0x41')][_0x1d10('0x56')]()),_0x5426d1);return respondWithRpcPromise(_0x1d10('0x59'),_0x1d10('0x2a'),{'module':_0x1d10('0x57')});}return null;})[_0x1d10('0x2b')](function(_0x12fdce){if(_0x12fdce){return _0x567763;}return null;});})[_0x1d10('0x2b')](respondWithResult(_0x594000,null))[_0x1d10('0x4b')](handleError(_0x594000,null));};exports[_0x1d10('0x2c')]=function(_0xcb4fea,_0x1ec49e,_0xa1bf82){var _0x1c6fbe;return db[_0x1d10('0x30')][_0x1d10('0x4a')]({'where':{'id':_0xcb4fea[_0x1d10('0x47')]['id']}})['then'](function(_0xc24e80){_0x1c6fbe=_0xc24e80;return _0xc24e80;})['then'](handleEntityNotFound(_0x1ec49e,null))['then'](removeEntity(_0x1ec49e,null))[_0x1d10('0x2b')](function(){if(_0x1c6fbe){return db[_0x1d10('0x30')][_0x1d10('0x45')]({'where':{'type':_0x1c6fbe[_0x1d10('0x41')]},'raw':!![]});}})['then'](function(_0x1fa9e2){if(_0x1fa9e2){var _0xd82b6b=fs[_0x1d10('0x4f')](path['join'](config[_0x1d10('0x51')],_0x1d10('0x52')),'utf8');var _0x58a3bf=ejs[_0x1d10('0x5a')](_0xd82b6b,{'networks':_0x1fa9e2||[]});fs[_0x1d10('0x54')](util[_0x1d10('0x55')]('/etc/asterisk/sip_xcally_%s.conf',_0x1c6fbe[_0x1d10('0x41')]['toLowerCase']()),_0x58a3bf);return respondWithRpcPromise(_0x1d10('0x59'),_0x1d10('0x2c'),{'module':_0x1d10('0x57')});}})['catch'](handleError(_0x1ec49e,null));}; \ No newline at end of file +var _0x2114=['root','server/files/templates/network.ejs','utf8','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','update','writeFileSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','Content-Range','apply','reject','then','destroy','end','stack','name','send','index','Network','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','VIRTUAL','field','includeAll','include','findAll','rows','params','options','find','create','sequelize','transaction','body','readFileSync','join'];(function(_0x42b3a6,_0x1037d5){var _0x4b5012=function(_0x55536d){while(--_0x55536d){_0x42b3a6['push'](_0x42b3a6['shift']());}};_0x4b5012(++_0x1037d5);}(_0x2114,0x17f));var _0x4211=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x2114[_0x22b39b];return _0x280e1d;};'use strict';var pdf=require(_0x4211('0x0'));var emlformat=require(_0x4211('0x1'));var rimraf=require(_0x4211('0x2'));var zipdir=require(_0x4211('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4211('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4211('0x5'));var csv=require(_0x4211('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4211('0x7'));var squel=require(_0x4211('0x8'));var crypto=require(_0x4211('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4211('0x6'));var querystring=require(_0x4211('0xa'));var Papa=require(_0x4211('0xb'));var authService=require(_0x4211('0xc'));var hardwareService=require(_0x4211('0xd'));var Redis=require(_0x4211('0xe'));var qs=require(_0x4211('0xf'));var logger=require(_0x4211('0x10'))(_0x4211('0x11'));var utils=require(_0x4211('0x12'));var config=require(_0x4211('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4211('0x14'));var client=jayson[_0x4211('0x15')][_0x4211('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x89528c,_0x1f9d98,_0x188904,_0xa9abc8){return new BPromise(function(_0x167ba2,_0x15dd36){var _0x1b6674=_0xa9abc8||client;return _0x1b6674[_0x4211('0x17')](_0x89528c,_0x188904)['then'](function(_0x352066){logger[_0x4211('0x18')](_0x4211('0x19'),_0x1f9d98,_0x4211('0x1a'));logger['debug'](_0x4211('0x1b'),_0x1f9d98,_0x4211('0x1a'),JSON[_0x4211('0x1c')](_0x352066));if(_0x352066[_0x4211('0x1d')]){if(_0x352066[_0x4211('0x1d')][_0x4211('0x1e')]===0x1f4){logger[_0x4211('0x1d')](_0x4211('0x19'),_0x1f9d98,_0x352066['error']['message']);return _0x15dd36(_0x352066[_0x4211('0x1d')]['message']);}logger[_0x4211('0x1d')](_0x4211('0x19'),_0x1f9d98,_0x352066['error'][_0x4211('0x1f')]);return _0x167ba2(_0x352066[_0x4211('0x1d')][_0x4211('0x1f')]);}else{logger[_0x4211('0x18')](_0x4211('0x19'),_0x1f9d98,_0x4211('0x1a'));_0x167ba2(_0x352066[_0x4211('0x20')][_0x4211('0x1f')]);}})[_0x4211('0x21')](function(_0x4a4dad){logger[_0x4211('0x1d')]('Network,\x20%s,\x20%s',_0x1f9d98,_0x4a4dad);_0x15dd36(_0x4a4dad);});});}function respondWithStatusCode(_0x1a9e3a,_0x2b4b1a){_0x2b4b1a=_0x2b4b1a||0xcc;return function(_0x604419){if(_0x604419){return _0x1a9e3a['sendStatus'](_0x2b4b1a);}return _0x1a9e3a[_0x4211('0x22')](_0x2b4b1a)['end']();};}function respondWithResult(_0x4f8be4,_0x2d1a1b){_0x2d1a1b=_0x2d1a1b||0xc8;return function(_0x1a0d1a){if(_0x1a0d1a){return _0x4f8be4['status'](_0x2d1a1b)[_0x4211('0x23')](_0x1a0d1a);}};}function respondWithFilteredResult(_0x26f62e,_0x53fb6){return function(_0x26de74){if(_0x26de74){var _0x1b218f=_0x26de74[_0x4211('0x24')],_0x530066=_0x53fb6['offset'],_0x3f292f=_0x53fb6[_0x4211('0x25')]+_0x53fb6['limit'],_0x298b1a;if(_0x3f292f>=_0x1b218f){_0x3f292f=_0x1b218f;_0x298b1a=0xc8;}else{_0x298b1a=0xce;}_0x26f62e[_0x4211('0x22')](_0x298b1a);return _0x26f62e['set'](_0x4211('0x26'),_0x530066+'-'+_0x3f292f+'/'+_0x1b218f)['json'](_0x26de74);}return null;};}function patchUpdates(_0xc0371){return function(_0x4765e2){try{jsonpatch[_0x4211('0x27')](_0x4765e2,_0xc0371,!![]);}catch(_0x63439c){return BPromise[_0x4211('0x28')](_0x63439c);}return _0x4765e2['save']();};}function saveUpdates(_0x2ef21f,_0x1fc25e){return function(_0xcef3ba){if(_0xcef3ba){return _0xcef3ba['update'](_0x2ef21f)[_0x4211('0x29')](function(_0x2f9fc0){return _0x2f9fc0;});}return null;};}function removeEntity(_0x1f3055,_0x16dc4c){return function(_0x789ac6){if(_0x789ac6){return _0x789ac6[_0x4211('0x2a')]()[_0x4211('0x29')](function(){_0x1f3055[_0x4211('0x22')](0xcc)[_0x4211('0x2b')]();});}};}function handleEntityNotFound(_0x1a4dd5,_0xfec60d){return function(_0x258090){if(!_0x258090){_0x1a4dd5['sendStatus'](0x194);}return _0x258090;};}function handleError(_0x1775d6,_0x28a40d){_0x28a40d=_0x28a40d||0x1f4;return function(_0x2ecc26){logger[_0x4211('0x1d')](_0x2ecc26[_0x4211('0x2c')]);if(_0x2ecc26['name']){delete _0x2ecc26[_0x4211('0x2d')];}_0x1775d6[_0x4211('0x22')](_0x28a40d)[_0x4211('0x2e')](_0x2ecc26);};}exports[_0x4211('0x2f')]=function(_0x4882d3,_0x3eb7f3){var _0x3ee4b8={},_0x1afa0c={},_0x2249a8={'count':0x0,'rows':[]};var _0x198cf3=db[_0x4211('0x30')][_0x4211('0x31')];_0x1afa0c[_0x4211('0x32')]=_[_0x4211('0x33')](_0x198cf3);_0x1afa0c[_0x4211('0x34')]=_['keys'](_0x4882d3[_0x4211('0x34')]);_0x1afa0c[_0x4211('0x35')]=_[_0x4211('0x36')](_0x1afa0c[_0x4211('0x32')],_0x1afa0c['query']);_0x3ee4b8[_0x4211('0x37')]=_[_0x4211('0x36')](_0x1afa0c[_0x4211('0x32')],qs[_0x4211('0x38')](_0x4882d3[_0x4211('0x34')][_0x4211('0x38')]));_0x3ee4b8[_0x4211('0x37')]=_0x3ee4b8['attributes'][_0x4211('0x39')]?_0x3ee4b8[_0x4211('0x37')]:_0x1afa0c[_0x4211('0x32')];if(!_0x4882d3[_0x4211('0x34')][_0x4211('0x3a')](_0x4211('0x3b'))){_0x3ee4b8['limit']=qs[_0x4211('0x3c')](_0x4882d3[_0x4211('0x34')][_0x4211('0x3c')]);_0x3ee4b8[_0x4211('0x25')]=qs[_0x4211('0x25')](_0x4882d3[_0x4211('0x34')][_0x4211('0x25')]);}_0x3ee4b8['order']=qs['sort'](_0x4882d3[_0x4211('0x34')][_0x4211('0x3d')]);_0x3ee4b8['where']=qs[_0x4211('0x35')](_[_0x4211('0x3e')](_0x4882d3['query'],_0x1afa0c['filters']));if(_0x4882d3[_0x4211('0x34')][_0x4211('0x3f')]){_0x3ee4b8[_0x4211('0x40')]=_[_0x4211('0x41')](_0x3ee4b8['where'],{'$or':_['map'](_0x198cf3,function(_0x3ee165){if(_0x3ee165[_0x4211('0x42')]['key']!==_0x4211('0x43')){var _0x1d557d={};_0x1d557d[_0x3ee165[_0x4211('0x44')]]={'$like':'%'+_0x4882d3['query'][_0x4211('0x3f')]+'%'};return _0x1d557d;}})});}_0x3ee4b8=_[_0x4211('0x41')]({},_0x3ee4b8,_0x4882d3['options']);var _0x589b62={'where':_0x3ee4b8[_0x4211('0x40')]};return db[_0x4211('0x30')][_0x4211('0x24')](_0x589b62)[_0x4211('0x29')](function(_0x4af11e){_0x2249a8[_0x4211('0x24')]=_0x4af11e;if(_0x4882d3[_0x4211('0x34')][_0x4211('0x45')]){_0x3ee4b8[_0x4211('0x46')]=[{'all':!![]}];}return db[_0x4211('0x30')][_0x4211('0x47')](_0x3ee4b8);})[_0x4211('0x29')](function(_0x5be6d8){_0x2249a8[_0x4211('0x48')]=_0x5be6d8;return _0x2249a8;})['then'](respondWithFilteredResult(_0x3eb7f3,_0x3ee4b8))['catch'](handleError(_0x3eb7f3,null));};exports['show']=function(_0x43a053,_0x41f0c0){var _0x2248ae={'raw':!![],'where':{'id':_0x43a053[_0x4211('0x49')]['id']}},_0x478e69={};_0x478e69[_0x4211('0x32')]=_[_0x4211('0x33')](db['Network'][_0x4211('0x31')]);_0x478e69['query']=_[_0x4211('0x33')](_0x43a053[_0x4211('0x34')]);_0x478e69['filters']=_[_0x4211('0x36')](_0x478e69[_0x4211('0x32')],_0x478e69[_0x4211('0x34')]);_0x2248ae[_0x4211('0x37')]=_[_0x4211('0x36')](_0x478e69[_0x4211('0x32')],qs[_0x4211('0x38')](_0x43a053[_0x4211('0x34')][_0x4211('0x38')]));_0x2248ae[_0x4211('0x37')]=_0x2248ae[_0x4211('0x37')][_0x4211('0x39')]?_0x2248ae[_0x4211('0x37')]:_0x478e69['model'];if(_0x43a053[_0x4211('0x34')][_0x4211('0x45')]){_0x2248ae[_0x4211('0x46')]=[{'all':!![]}];}_0x2248ae=_[_0x4211('0x41')]({},_0x2248ae,_0x43a053[_0x4211('0x4a')]);return db[_0x4211('0x30')][_0x4211('0x4b')](_0x2248ae)[_0x4211('0x29')](handleEntityNotFound(_0x41f0c0,null))[_0x4211('0x29')](respondWithResult(_0x41f0c0,null))[_0x4211('0x21')](handleError(_0x41f0c0,null));};exports[_0x4211('0x4c')]=function(_0x13a0c7,_0x472c4c,_0x56a9b5){var _0x26a27f;return db[_0x4211('0x4d')][_0x4211('0x4e')](function(_0x3cf577){return db[_0x4211('0x30')]['create'](_0x13a0c7[_0x4211('0x4f')],{'raw':!![]})[_0x4211('0x29')](function(_0x58eadf){_0x26a27f=_0x58eadf;return db[_0x4211('0x30')]['findAll']({'where':{'type':_0x13a0c7[_0x4211('0x4f')][_0x4211('0x42')]},'raw':!![]});})[_0x4211('0x29')](function(_0x42eb31){var _0x5c048a=fs[_0x4211('0x50')](path[_0x4211('0x51')](config[_0x4211('0x52')],_0x4211('0x53')),_0x4211('0x54'));var _0x4d0fd5=ejs[_0x4211('0x55')](_0x5c048a,{'networks':_0x42eb31||[]});fs['writeFileSync'](util[_0x4211('0x56')](_0x4211('0x57'),_0x13a0c7[_0x4211('0x4f')]['type'][_0x4211('0x58')]()),_0x4d0fd5);})['then'](function(){return respondWithRpcPromise(_0x4211('0x59'),_0x4211('0x4c'),{'module':_0x4211('0x5a')});})[_0x4211('0x29')](function(){return _0x26a27f;});})['then'](respondWithResult(_0x472c4c,0xc9))[_0x4211('0x21')](handleError(_0x472c4c,null));};exports[_0x4211('0x5b')]=function(_0x2fe727,_0x1572f6,_0x596ba5){var _0x512445;return db[_0x4211('0x4d')][_0x4211('0x4e')](function(_0x37b297){return db['Network']['find']({'where':{'id':_0x2fe727[_0x4211('0x49')]['id']}})[_0x4211('0x29')](handleEntityNotFound(_0x1572f6,null))[_0x4211('0x29')](saveUpdates(_0x2fe727[_0x4211('0x4f')],null))[_0x4211('0x29')](function(_0x33fc39){if(_0x33fc39){_0x512445=_0x33fc39;return db['Network'][_0x4211('0x47')]({'where':{'type':_0x512445[_0x4211('0x42')]},'raw':!![]});}return null;})[_0x4211('0x29')](function(_0x445f6c){if(_0x445f6c){var _0x2a038c=fs[_0x4211('0x50')](path['join'](config['root'],_0x4211('0x53')),_0x4211('0x54'));var _0x539a47=ejs[_0x4211('0x55')](_0x2a038c,{'networks':_0x445f6c||[]});fs[_0x4211('0x5c')](util[_0x4211('0x56')](_0x4211('0x57'),_0x512445['type'][_0x4211('0x58')]()),_0x539a47);return respondWithRpcPromise(_0x4211('0x59'),_0x4211('0x5b'),{'module':_0x4211('0x5a')});}return null;})['then'](function(_0x2d2871){if(_0x2d2871){return _0x512445;}return null;});})[_0x4211('0x29')](respondWithResult(_0x1572f6,null))[_0x4211('0x21')](handleError(_0x1572f6,null));};exports[_0x4211('0x2a')]=function(_0x2892b7,_0x4b78be,_0x2337f9){var _0xc25aa9;return db[_0x4211('0x30')][_0x4211('0x4b')]({'where':{'id':_0x2892b7[_0x4211('0x49')]['id']}})['then'](function(_0x23d448){_0xc25aa9=_0x23d448;return _0x23d448;})[_0x4211('0x29')](handleEntityNotFound(_0x4b78be,null))[_0x4211('0x29')](removeEntity(_0x4b78be,null))[_0x4211('0x29')](function(){if(_0xc25aa9){return db[_0x4211('0x30')][_0x4211('0x47')]({'where':{'type':_0xc25aa9[_0x4211('0x42')]},'raw':!![]});}})[_0x4211('0x29')](function(_0x4eb22a){if(_0x4eb22a){var _0x45b990=fs[_0x4211('0x50')](path[_0x4211('0x51')](config[_0x4211('0x52')],_0x4211('0x53')),_0x4211('0x54'));var _0x588840=ejs[_0x4211('0x55')](_0x45b990,{'networks':_0x4eb22a||[]});fs[_0x4211('0x5c')](util['format'](_0x4211('0x57'),_0xc25aa9[_0x4211('0x42')]['toLowerCase']()),_0x588840);return respondWithRpcPromise('Reload',_0x4211('0x2a'),{'module':_0x4211('0x5a')});}})[_0x4211('0x21')](handleError(_0x4b78be,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index a9df448..80a72d9 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 _0xcb22=['request-promise','exports','define','Network','network','lodash','../../config/logger','api'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xcb22,0x1bd));var _0x2cb2=function(_0x3ce9be,_0x3b5e77){_0x3ce9be=_0x3ce9be-0x0;var _0x4b7188=_0xcb22[_0x3ce9be];return _0x4b7188;};'use strict';var _=require(_0x2cb2('0x0'));var util=require('util');var logger=require(_0x2cb2('0x1'))(_0x2cb2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2cb2('0x3'));var attributes=require('./network.attributes');module[_0x2cb2('0x4')]=function(_0x3dd145,_0x48a9ae){return _0x3dd145[_0x2cb2('0x5')](_0x2cb2('0x6'),attributes,{'tableName':_0x2cb2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96e2=['./network.attributes','exports','define','Network','network','util','../../config/logger','moment','bluebird'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x96e2,0x17f));var _0x296e=function(_0x4a0411,_0x5a91d4){_0x4a0411=_0x4a0411-0x0;var _0x248d1f=_0x96e2[_0x4a0411];return _0x248d1f;};'use strict';var _=require('lodash');var util=require(_0x296e('0x0'));var logger=require(_0x296e('0x1'))('api');var moment=require(_0x296e('0x2'));var BPromise=require(_0x296e('0x3'));var rp=require('request-promise');var attributes=require(_0x296e('0x4'));module[_0x296e('0x5')]=function(_0x1f95d6,_0x5d4d3e){return _0x1f95d6[_0x296e('0x6')](_0x296e('0x7'),attributes,{'tableName':_0x296e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index a65d535..cd22181 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 _0x277c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird'];(function(_0x2e22fe,_0x5d5af1){var _0x435335=function(_0x5dc8e1){while(--_0x5dc8e1){_0x2e22fe['push'](_0x2e22fe['shift']());}};_0x435335(++_0x5d5af1);}(_0x277c,0x153));var _0xc277=function(_0x10fd45,_0x1cfde8){_0x10fd45=_0x10fd45-0x0;var _0x4b97a9=_0x277c[_0x10fd45];return _0x4b97a9;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var moment=require(_0xc277('0x1'));var BPromise=require(_0xc277('0x2'));var rs=require(_0xc277('0x3'));var fs=require('fs');var Redis=require(_0xc277('0x4'));var db=require(_0xc277('0x5'))['db'];var utils=require(_0xc277('0x6'));var logger=require(_0xc277('0x7'))(_0xc277('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc277('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x77e168,_0x54d634,_0x378158){return new BPromise(function(_0x17a2fe,_0x55be1f){return client[_0xc277('0xa')](_0x77e168,_0x378158)[_0xc277('0xb')](function(_0xfdf694){logger[_0xc277('0xc')](_0xc277('0xd'),_0x54d634,_0xc277('0xe'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x54d634,_0xc277('0xe'),JSON[_0xc277('0xf')](_0xfdf694));if(_0xfdf694[_0xc277('0x10')]){if(_0xfdf694[_0xc277('0x10')]['code']===0x1f4){logger[_0xc277('0x10')]('Network,\x20%s,\x20%s',_0x54d634,_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);return _0x55be1f(_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);}logger['error'](_0xc277('0xd'),_0x54d634,_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);return _0x17a2fe(_0xfdf694['error']['message']);}else{logger[_0xc277('0xc')]('Network,\x20%s,\x20%s',_0x54d634,_0xc277('0xe'));_0x17a2fe(_0xfdf694['result'][_0xc277('0x11')]);}})[_0xc277('0x12')](function(_0x15f560){logger['error']('Network,\x20%s,\x20%s',_0x54d634,_0x15f560);_0x55be1f(_0x15f560);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Network,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x68bdd2,_0xc797a1){var _0x2b4eb6=function(_0x425b99){while(--_0x425b99){_0x68bdd2['push'](_0x68bdd2['shift']());}};_0x2b4eb6(++_0xc797a1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x5fc3[_0x5774be];return _0x4914b4;};'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')]('Network,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Network,\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']('Network,\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/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index f8fe8e9..ee4be3c 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 _0xe024=['/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','create','/:id/dispositions','addDisposition','post','/:id/notify','addApplications','addAgents','send','put','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe024,0x14d));var _0x4e02=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0xe024[_0x154940];return _0x401409;};'use strict';var multer=require(_0x4e02('0x0'));var util=require(_0x4e02('0x1'));var path=require(_0x4e02('0x2'));var timeout=require(_0x4e02('0x3'));var express=require('express');var router=express[_0x4e02('0x4')]();var auth=require(_0x4e02('0x5'));var interaction=require(_0x4e02('0x6'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x4e02('0x7')]('/',auth[_0x4e02('0x8')](),controller[_0x4e02('0x9')]);router[_0x4e02('0x7')](_0x4e02('0xa'),auth['isAuthenticated'](),controller[_0x4e02('0xb')]);router[_0x4e02('0x7')](_0x4e02('0xc'),auth[_0x4e02('0x8')](),controller[_0x4e02('0xd')]);router[_0x4e02('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4e02('0xe')]);router[_0x4e02('0x7')](_0x4e02('0xf'),auth['isAuthenticated'](),controller[_0x4e02('0x10')]);router[_0x4e02('0x7')](_0x4e02('0x11'),auth[_0x4e02('0x8')](),controller['getApplications']);router[_0x4e02('0x7')](_0x4e02('0x12'),auth[_0x4e02('0x8')](),controller[_0x4e02('0x13')]);router[_0x4e02('0x7')](_0x4e02('0x14'),auth[_0x4e02('0x8')](),controller[_0x4e02('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4e02('0x16')]);router['post'](_0x4e02('0x17'),auth['isAuthenticated'](),controller[_0x4e02('0x18')]);router[_0x4e02('0x19')]('/:id/canned_answers',auth[_0x4e02('0x8')](),controller['addAnswer']);router[_0x4e02('0x19')](_0x4e02('0x1a'),controller['notify']);router[_0x4e02('0x19')](_0x4e02('0x11'),auth[_0x4e02('0x8')](),controller[_0x4e02('0x1b')]);router[_0x4e02('0x19')](_0x4e02('0x14'),auth[_0x4e02('0x8')](),controller[_0x4e02('0x1c')]);router[_0x4e02('0x19')]('/:id/send',auth[_0x4e02('0x8')](),controller[_0x4e02('0x1d')]);router[_0x4e02('0x1e')](_0x4e02('0xc'),auth[_0x4e02('0x8')](),controller[_0x4e02('0x1f')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x4e02('0x8')](),controller['removeDispositions']);router[_0x4e02('0x20')](_0x4e02('0xf'),auth[_0x4e02('0x8')](),controller[_0x4e02('0x21')]);router['delete'](_0x4e02('0x14'),auth[_0x4e02('0x8')](),controller[_0x4e02('0x22')]);module['exports']=router; \ No newline at end of file +var _0x5449=['util','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer'];(function(_0x2dfaf1,_0x5c0477){var _0x5e9264=function(_0x34a5d6){while(--_0x34a5d6){_0x2dfaf1['push'](_0x2dfaf1['shift']());}};_0x5e9264(++_0x5c0477);}(_0x5449,0x1bb));var _0x9544=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5449[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x9544('0x0'));var util=require(_0x9544('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9544('0x2'));var router=express[_0x9544('0x3')]();var auth=require(_0x9544('0x4'));var interaction=require(_0x9544('0x5'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x9544('0x6')]('/',auth[_0x9544('0x7')](),controller[_0x9544('0x8')]);router['get'](_0x9544('0x9'),auth[_0x9544('0x7')](),controller[_0x9544('0xa')]);router['get']('/:id',auth[_0x9544('0x7')](),controller['show']);router[_0x9544('0x6')](_0x9544('0xb'),auth[_0x9544('0x7')](),controller[_0x9544('0xc')]);router['get'](_0x9544('0xd'),auth[_0x9544('0x7')](),controller['getAnswers']);router[_0x9544('0x6')]('/:id/applications',auth[_0x9544('0x7')](),controller[_0x9544('0xe')]);router['get'](_0x9544('0xf'),auth[_0x9544('0x7')](),controller[_0x9544('0x10')]);router[_0x9544('0x6')](_0x9544('0x11'),auth['isAuthenticated'](),controller[_0x9544('0x12')]);router[_0x9544('0x13')]('/',auth[_0x9544('0x7')](),controller['create']);router[_0x9544('0x13')]('/:id/dispositions',auth[_0x9544('0x7')](),controller[_0x9544('0x14')]);router[_0x9544('0x13')](_0x9544('0xd'),auth['isAuthenticated'](),controller[_0x9544('0x15')]);router[_0x9544('0x13')](_0x9544('0x16'),controller[_0x9544('0x17')]);router['post'](_0x9544('0x18'),auth['isAuthenticated'](),controller[_0x9544('0x19')]);router['post'](_0x9544('0x11'),auth[_0x9544('0x7')](),controller[_0x9544('0x1a')]);router[_0x9544('0x13')](_0x9544('0x1b'),auth['isAuthenticated'](),controller[_0x9544('0x1c')]);router[_0x9544('0x1d')](_0x9544('0x1e'),auth['isAuthenticated'](),controller[_0x9544('0x1f')]);router[_0x9544('0x20')](_0x9544('0x1e'),auth[_0x9544('0x7')](),controller[_0x9544('0x21')]);router[_0x9544('0x20')](_0x9544('0xb'),auth[_0x9544('0x7')](),controller[_0x9544('0x22')]);router[_0x9544('0x20')](_0x9544('0xd'),auth[_0x9544('0x7')](),controller[_0x9544('0x23')]);router[_0x9544('0x20')](_0x9544('0x11'),auth[_0x9544('0x7')](),controller['removeAgents']);module[_0x9544('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 97ec7cb..5fa43b2 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 _0x5d07=['INTEGER','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x255dc4,_0x46c9cb){var _0x120dba=function(_0x22bf19){while(--_0x22bf19){_0x255dc4['push'](_0x255dc4['shift']());}};_0x120dba(++_0x46c9cb);}(_0x5d07,0x190));var _0x75d0=function(_0x89351e,_0x19d38d){_0x89351e=_0x89351e-0x0;var _0x3d1518=_0x5d07[_0x89351e];return _0x3d1518;};'use strict';var Sequelize=require(_0x75d0('0x0'));var rs=require(_0x75d0('0x1'));module['exports']={'name':{'type':Sequelize[_0x75d0('0x2')],'unique':_0x75d0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x75d0('0x2')]},'token':{'type':Sequelize[_0x75d0('0x2')],'defaultValue':function(){return rs[_0x75d0('0x4')]();}},'replyUri':{'type':Sequelize[_0x75d0('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x75d0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x75d0('0x5')],'defaultValue':function(){return _0x75d0('0x6');}},'notificationSound':{'type':Sequelize[_0x75d0('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x75d0('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x75d0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x75d0('0x2')]},'queueTransfer':{'type':Sequelize[_0x75d0('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x75d0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x75d0('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x75d0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x75d0('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x75d0('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d3c72){if(!_0x2d3c72)this['setDataValue'](_0x75d0('0x9'),null);this[_0x75d0('0xa')](_0x75d0('0xb'),_0x2d3c72);}}}; \ No newline at end of file +var _0x2f55=['STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports'];(function(_0x5b4d06,_0x3edc8d){var _0xad4053=function(_0x1e2748){while(--_0x1e2748){_0x5b4d06['push'](_0x5b4d06['shift']());}};_0xad4053(++_0x3edc8d);}(_0x2f55,0x112));var _0x52f5=function(_0x2feaf2,_0x329259){_0x2feaf2=_0x2feaf2-0x0;var _0x44a017=_0x2f55[_0x2feaf2];return _0x44a017;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x52f5('0x0'));module[_0x52f5('0x1')]={'name':{'type':Sequelize[_0x52f5('0x2')],'unique':_0x52f5('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x52f5('0x2')]},'token':{'type':Sequelize[_0x52f5('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x52f5('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x52f5('0x4')],'defaultValue':function(){return _0x52f5('0x5');}},'notificationSound':{'type':Sequelize[_0x52f5('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x52f5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x52f5('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x52f5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x52f5('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x52f5('0x6')],'defaultValue':![],'comment':_0x52f5('0x8'),'set':function(_0x14c655){if(!_0x14c655)this[_0x52f5('0x9')](_0x52f5('0xa'),null);this['setDataValue'](_0x52f5('0xb'),_0x14c655);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 520379c..383c51f 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 _0x7da7=['intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','OpenchannelAccountId','removeDispositions','addAnswer','CannedAnswer','notify','Sequelize','ValidationError','difference','updatedAt','createdAt','ListId','isNil','from','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','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','CmContact','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','push','close','unmanaged','OpenchannelMessage','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','Tag','color','tag','addAgents','ids','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./openchannelAccount.socket','jayson/promise','client','http','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x55043f,_0x2e6e99){var _0x5d810c=function(_0x3e45da){while(--_0x3e45da){_0x55043f['push'](_0x55043f['shift']());}};_0x5d810c(++_0x2e6e99);}(_0x7da7,0x10d));var _0x77da=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x7da7[_0x13f980];return _0x27153c;};'use strict';var pdf=require(_0x77da('0x0'));var emlformat=require(_0x77da('0x1'));var rimraf=require(_0x77da('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x77da('0x3'));var moment=require(_0x77da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77da('0x5'));var util=require(_0x77da('0x6'));var path=require('path');var sox=require(_0x77da('0x7'));var csv=require(_0x77da('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x8'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var authService=require(_0x77da('0xe'));var hardwareService=require(_0x77da('0xf'));var Redis=require(_0x77da('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x77da('0x11'))(_0x77da('0x12'));var utils=require(_0x77da('0x13'));var config=require(_0x77da('0x14'));var db=require('../../mysqldb')['db'];config[_0x77da('0x15')]=_[_0x77da('0x16')](config[_0x77da('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77da('0x15')]));require(_0x77da('0x17'))['register'](socket);var jayson=require(_0x77da('0x18'));var client=jayson[_0x77da('0x19')][_0x77da('0x1a')]({'port':0x232c});var client9002=jayson[_0x77da('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2172d0,_0x4e130c,_0x29cd7b,_0x366443){return new BPromise(function(_0x1b0e17,_0x4500c4){var _0x4ecd98=_0x366443||client;return _0x4ecd98['request'](_0x2172d0,_0x29cd7b)['then'](function(_0x482b87){logger[_0x77da('0x1b')](_0x77da('0x1c'),_0x4e130c,_0x77da('0x1d'));logger[_0x77da('0x1e')](_0x77da('0x1f'),_0x4e130c,_0x77da('0x1d'),JSON[_0x77da('0x20')](_0x482b87));if(_0x482b87[_0x77da('0x21')]){if(_0x482b87['error']['code']===0x1f4){logger[_0x77da('0x21')](_0x77da('0x1c'),_0x4e130c,_0x482b87['error'][_0x77da('0x22')]);return _0x4500c4(_0x482b87[_0x77da('0x21')][_0x77da('0x22')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4e130c,_0x482b87[_0x77da('0x21')]['message']);return _0x1b0e17(_0x482b87[_0x77da('0x21')][_0x77da('0x22')]);}else{logger[_0x77da('0x1b')](_0x77da('0x1c'),_0x4e130c,_0x77da('0x1d'));_0x1b0e17(_0x482b87[_0x77da('0x23')][_0x77da('0x22')]);}})['catch'](function(_0x4885ec){logger[_0x77da('0x21')](_0x77da('0x1c'),_0x4e130c,_0x4885ec);_0x4500c4(_0x4885ec);});});}function respondWithStatusCode(_0x835167,_0xbd06b7){_0xbd06b7=_0xbd06b7||0xcc;return function(_0x545654){if(_0x545654){return _0x835167[_0x77da('0x24')](_0xbd06b7);}return _0x835167[_0x77da('0x25')](_0xbd06b7)[_0x77da('0x26')]();};}function respondWithResult(_0x36115b,_0x446ae7){_0x446ae7=_0x446ae7||0xc8;return function(_0x5997b6){if(_0x5997b6){return _0x36115b[_0x77da('0x25')](_0x446ae7)[_0x77da('0x27')](_0x5997b6);}};}function respondWithFilteredResult(_0x1f2279,_0x2913f7){return function(_0x496ecd){if(_0x496ecd){var _0x5b4638=_0x496ecd[_0x77da('0x28')],_0x4d395a=_0x2913f7[_0x77da('0x29')],_0x2258e9=_0x2913f7[_0x77da('0x29')]+_0x2913f7['limit'],_0x30456a;if(_0x2258e9>=_0x5b4638){_0x2258e9=_0x5b4638;_0x30456a=0xc8;}else{_0x30456a=0xce;}_0x1f2279[_0x77da('0x25')](_0x30456a);return _0x1f2279[_0x77da('0x2a')](_0x77da('0x2b'),_0x4d395a+'-'+_0x2258e9+'/'+_0x5b4638)[_0x77da('0x27')](_0x496ecd);}return null;};}function patchUpdates(_0x1e7853){return function(_0x46e6b4){try{jsonpatch['apply'](_0x46e6b4,_0x1e7853,!![]);}catch(_0x165a7f){return BPromise[_0x77da('0x2c')](_0x165a7f);}return _0x46e6b4[_0x77da('0x2d')]();};}function saveUpdates(_0x38643a,_0x3c3c64){return function(_0x12ea16){if(_0x12ea16){return _0x12ea16[_0x77da('0x2e')](_0x38643a)[_0x77da('0x2f')](function(_0x5b9b05){return _0x5b9b05;});}return null;};}function removeEntity(_0x5e8d1e,_0x1366b4){return function(_0x8e6181){if(_0x8e6181){return _0x8e6181['destroy']()[_0x77da('0x2f')](function(){var _0x390399=_0x8e6181[_0x77da('0x30')]({'plain':!![]});var _0x10540a=_0x77da('0x31');return db[_0x77da('0x32')][_0x77da('0x33')]({'where':{'type':_0x10540a,'resourceId':_0x390399['id']}})['then'](function(){return _0x8e6181;});})[_0x77da('0x2f')](function(){_0x5e8d1e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x541696,_0x17d236){return function(_0x53543a){if(!_0x53543a){_0x541696[_0x77da('0x24')](0x194);}return _0x53543a;};}function handleError(_0xdac1a4,_0xce9df2){_0xce9df2=_0xce9df2||0x1f4;return function(_0x3cc78b){logger[_0x77da('0x21')](_0x3cc78b[_0x77da('0x34')]);if(_0x3cc78b[_0x77da('0x35')]){delete _0x3cc78b['name'];}_0xdac1a4[_0x77da('0x25')](_0xce9df2)[_0x77da('0x36')](_0x3cc78b);};}exports[_0x77da('0x37')]=function(_0x32785f,_0x166534){var _0x188284={'include':[{'model':db[_0x77da('0x38')],'as':_0x77da('0x39')}]},_0x48fccc={},_0x1e02bd={'count':0x0,'rows':[]};var _0x4d04cd=db[_0x77da('0x3a')]['rawAttributes'];_0x48fccc['model']=_['keys'](_0x4d04cd);_0x48fccc['query']=_[_0x77da('0x3b')](_0x32785f[_0x77da('0x3c')]);_0x48fccc[_0x77da('0x3d')]=_['intersection'](_0x48fccc[_0x77da('0x3e')],_0x48fccc['query']);_0x188284[_0x77da('0x3f')]=_['intersection'](_0x48fccc[_0x77da('0x3e')],qs[_0x77da('0x40')](_0x32785f[_0x77da('0x3c')][_0x77da('0x40')]));_0x188284[_0x77da('0x3f')]=_0x188284['attributes'][_0x77da('0x41')]?_0x188284[_0x77da('0x3f')]:_0x48fccc[_0x77da('0x3e')];if(!_0x32785f[_0x77da('0x3c')][_0x77da('0x42')](_0x77da('0x43'))){_0x188284['limit']=qs[_0x77da('0x44')](_0x32785f[_0x77da('0x3c')][_0x77da('0x44')]);_0x188284[_0x77da('0x29')]=qs[_0x77da('0x29')](_0x32785f[_0x77da('0x3c')]['offset']);}_0x188284[_0x77da('0x45')]=qs['sort'](_0x32785f[_0x77da('0x3c')][_0x77da('0x46')]);_0x188284[_0x77da('0x47')]=qs['filters'](_[_0x77da('0x48')](_0x32785f[_0x77da('0x3c')],_0x48fccc[_0x77da('0x3d')]));if(_0x32785f[_0x77da('0x3c')][_0x77da('0x49')]){_0x188284[_0x77da('0x47')]=_[_0x77da('0x4a')](_0x188284[_0x77da('0x47')],{'$or':_[_0x77da('0x4b')](_0x4d04cd,function(_0x5964da){if(_0x5964da[_0x77da('0x4c')][_0x77da('0x4d')]!==_0x77da('0x4e')){var _0x287cf0={};_0x287cf0[_0x5964da[_0x77da('0x4f')]]={'$like':'%'+_0x32785f[_0x77da('0x3c')]['filter']+'%'};return _0x287cf0;}})});}_0x188284=_['merge']({},_0x188284,_0x32785f[_0x77da('0x50')]);var _0x1597d8={'where':_0x188284[_0x77da('0x47')]};return db[_0x77da('0x3a')][_0x77da('0x28')](_0x1597d8)[_0x77da('0x2f')](function(_0x4e811e){_0x1e02bd[_0x77da('0x28')]=_0x4e811e;if(_0x32785f[_0x77da('0x3c')][_0x77da('0x51')]){_0x188284[_0x77da('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x77da('0x53')](_0x188284);})['then'](function(_0x518fd5){_0x1e02bd[_0x77da('0x54')]=_0x518fd5;return _0x1e02bd;})[_0x77da('0x2f')](respondWithFilteredResult(_0x166534,_0x188284))[_0x77da('0x55')](handleError(_0x166534,null));};exports[_0x77da('0x56')]=function(_0x57d866,_0x16bf4b){var _0x1e36ee={'raw':![],'where':{'id':_0x57d866[_0x77da('0x57')]['id']},'include':[{'model':db[_0x77da('0x38')],'as':'mandatoryDispositionPause'}]},_0x56a3d9={};_0x56a3d9[_0x77da('0x3e')]=_[_0x77da('0x3b')](db[_0x77da('0x3a')][_0x77da('0x58')]);_0x56a3d9[_0x77da('0x3c')]=_[_0x77da('0x3b')](_0x57d866[_0x77da('0x3c')]);_0x56a3d9[_0x77da('0x3d')]=_[_0x77da('0x59')](_0x56a3d9[_0x77da('0x3e')],_0x56a3d9['query']);_0x1e36ee[_0x77da('0x3f')]=_['intersection'](_0x56a3d9[_0x77da('0x3e')],qs[_0x77da('0x40')](_0x57d866[_0x77da('0x3c')][_0x77da('0x40')]));_0x1e36ee[_0x77da('0x3f')]=_0x1e36ee[_0x77da('0x3f')][_0x77da('0x41')]?_0x1e36ee['attributes']:_0x56a3d9[_0x77da('0x3e')];if(_0x57d866[_0x77da('0x3c')][_0x77da('0x51')]){_0x1e36ee[_0x77da('0x52')]=[{'all':!![]}];}_0x1e36ee=_['merge']({},_0x1e36ee,_0x57d866[_0x77da('0x50')]);return db[_0x77da('0x3a')][_0x77da('0x5a')](_0x1e36ee)['then'](handleEntityNotFound(_0x16bf4b,null))['then'](respondWithResult(_0x16bf4b,null))[_0x77da('0x55')](handleError(_0x16bf4b,null));};exports[_0x77da('0x5b')]=function(_0x42ea9e,_0x1d1ea2){return db[_0x77da('0x3a')]['create'](_0x42ea9e['body'],{})[_0x77da('0x2f')](function(_0x36f161){var _0x52d13d=_0x42ea9e[_0x77da('0x5c')][_0x77da('0x30')]({'plain':!![]});if(!_0x52d13d)throw new Error(_0x77da('0x5d'));if(_0x52d13d['role']===_0x77da('0x5c')){var _0x111260=_0x36f161['get']({'plain':!![]});var _0x3ae855=_0x77da('0x31');return db[_0x77da('0x5e')][_0x77da('0x5a')]({'where':{'name':_0x3ae855,'userProfileId':_0x52d13d[_0x77da('0x5f')]},'raw':!![]})[_0x77da('0x2f')](function(_0x1dc4ab){if(_0x1dc4ab&&_0x1dc4ab[_0x77da('0x60')]===0x0){return db[_0x77da('0x32')]['create']({'name':_0x111260[_0x77da('0x35')],'resourceId':_0x111260['id'],'type':_0x1dc4ab[_0x77da('0x35')],'sectionId':_0x1dc4ab['id']},{})[_0x77da('0x2f')](function(){return _0x36f161;});}else{return _0x36f161;}})[_0x77da('0x55')](function(_0x329c6b){logger[_0x77da('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x329c6b);throw _0x329c6b;});}return _0x36f161;})[_0x77da('0x2f')](respondWithResult(_0x1d1ea2,0xc9))[_0x77da('0x55')](handleError(_0x1d1ea2,null));};exports[_0x77da('0x2e')]=function(_0x5b9cf2,_0x3e5dd9){if(_0x5b9cf2[_0x77da('0x61')]['id']){delete _0x5b9cf2[_0x77da('0x61')]['id'];}return db[_0x77da('0x3a')][_0x77da('0x5a')]({'where':{'id':_0x5b9cf2[_0x77da('0x57')]['id']},'include':[{'model':db[_0x77da('0x38')],'as':'mandatoryDispositionPause'}]})[_0x77da('0x2f')](handleEntityNotFound(_0x3e5dd9,null))['then'](saveUpdates(_0x5b9cf2[_0x77da('0x61')],null))[_0x77da('0x2f')](respondWithResult(_0x3e5dd9,null))[_0x77da('0x55')](handleError(_0x3e5dd9,null));};exports['destroy']=function(_0x30c746,_0x3c4453){return db[_0x77da('0x3a')][_0x77da('0x5a')]({'where':{'id':_0x30c746['params']['id']}})['then'](handleEntityNotFound(_0x3c4453,null))['then'](removeEntity(_0x3c4453,null))[_0x77da('0x55')](handleError(_0x3c4453,null));};exports[_0x77da('0x62')]=function(_0x2c4d7c,_0x2c7c8e){return db[_0x77da('0x3a')][_0x77da('0x62')]()[_0x77da('0x2f')](respondWithResult(_0x2c7c8e,null))[_0x77da('0x55')](handleError(_0x2c7c8e,null));};exports[_0x77da('0x63')]=function(_0x14e067,_0x5afd7a,_0x3028ca){if(_0x14e067[_0x77da('0x61')]['id']){delete _0x14e067['body']['id'];}return db['OpenchannelAccount'][_0x77da('0x5a')]({'where':{'id':_0x14e067['params']['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x5afd7a,null))[_0x77da('0x2f')](function(_0x1ff554){if(_0x1ff554){_0x14e067['body'][_0x77da('0x64')]=_0x1ff554['id'];return db[_0x77da('0x65')][_0x77da('0x5b')](_0x14e067[_0x77da('0x61')]);}})[_0x77da('0x2f')](respondWithResult(_0x5afd7a,null))['catch'](handleError(_0x5afd7a,null));};exports[_0x77da('0x66')]=function(_0x20a636,_0x5f0938,_0x3fdde1){var _0x2936ac={'raw':![],'where':{}};var _0xd14296={};var _0xf9c7f2={'count':0x0,'rows':[]};return db[_0x77da('0x3a')][_0x77da('0x67')]({'where':{'id':_0x20a636[_0x77da('0x57')]['id']}})['then'](handleEntityNotFound(_0x5f0938,null))[_0x77da('0x2f')](function(_0x51bb29){if(_0x51bb29){_0xd14296[_0x77da('0x3e')]=_[_0x77da('0x3b')](db[_0x77da('0x65')][_0x77da('0x58')]);_0xd14296[_0x77da('0x3c')]=_[_0x77da('0x3b')](_0x20a636[_0x77da('0x3c')]);_0xd14296[_0x77da('0x3d')]=_[_0x77da('0x59')](_0xd14296[_0x77da('0x3e')],_0xd14296[_0x77da('0x3c')]);_0x2936ac[_0x77da('0x3f')]=_['intersection'](_0xd14296[_0x77da('0x3e')],qs[_0x77da('0x40')](_0x20a636[_0x77da('0x3c')][_0x77da('0x40')]));_0x2936ac['attributes']=_0x2936ac[_0x77da('0x3f')][_0x77da('0x41')]?_0x2936ac[_0x77da('0x3f')]:_0xd14296['model'];if(!_0x20a636[_0x77da('0x3c')]['hasOwnProperty']('nolimit')){_0x2936ac[_0x77da('0x44')]=qs[_0x77da('0x44')](_0x20a636[_0x77da('0x3c')][_0x77da('0x44')]);_0x2936ac[_0x77da('0x29')]=qs[_0x77da('0x29')](_0x20a636[_0x77da('0x3c')][_0x77da('0x29')]);}_0x2936ac[_0x77da('0x45')]=qs['sort'](_0x20a636[_0x77da('0x3c')][_0x77da('0x46')]);_0x2936ac[_0x77da('0x47')]=qs[_0x77da('0x3d')](_[_0x77da('0x48')](_0x20a636['query'],_0xd14296[_0x77da('0x3d')]));_0x2936ac[_0x77da('0x47')][_0x77da('0x68')]=_0x51bb29['id'];if(_0x20a636[_0x77da('0x3c')][_0x77da('0x49')]){_0x2936ac[_0x77da('0x47')]=_[_0x77da('0x4a')](_0x2936ac[_0x77da('0x47')],{'$or':_[_0x77da('0x4b')](_0x2936ac[_0x77da('0x3f')],function(_0x4df868){var _0x519e38={};_0x519e38[_0x4df868]={'$like':'%'+_0x20a636['query'][_0x77da('0x49')]+'%'};return _0x519e38;})});}_0x2936ac=_[_0x77da('0x4a')]({},_0x2936ac,_0x20a636[_0x77da('0x50')]);return db['Disposition']['count']({'where':_0x2936ac[_0x77da('0x47')]})[_0x77da('0x2f')](function(_0x17a2e6){_0xf9c7f2[_0x77da('0x28')]=_0x17a2e6;if(_0x20a636[_0x77da('0x3c')][_0x77da('0x51')]){_0x2936ac[_0x77da('0x52')]=[{'all':!![]}];}return db[_0x77da('0x65')][_0x77da('0x53')](_0x2936ac);})[_0x77da('0x2f')](function(_0x27a462){_0xf9c7f2[_0x77da('0x54')]=_0x27a462;return _0xf9c7f2;});}})[_0x77da('0x2f')](respondWithFilteredResult(_0x5f0938,_0x2936ac))['catch'](handleError(_0x5f0938,null));};exports['removeDispositions']=function(_0x1cdd40,_0x5c8859,_0x4f9121){var _0x22de60;return db[_0x77da('0x3a')][_0x77da('0x5a')]({'where':{'id':_0x1cdd40['params']['id']}})['then'](handleEntityNotFound(_0x5c8859,null))[_0x77da('0x2f')](function(_0x4f1ae0){if(_0x4f1ae0){return _0x4f1ae0[_0x77da('0x69')](_0x1cdd40[_0x77da('0x3c')]['ids']);}})[_0x77da('0x2f')](respondWithStatusCode(_0x5c8859,null))['catch'](handleError(_0x5c8859,null));};exports[_0x77da('0x6a')]=function(_0x45b0a5,_0x448ffd,_0x256ca9){if(_0x45b0a5['body']['id']){delete _0x45b0a5[_0x77da('0x61')]['id'];}return db[_0x77da('0x3a')][_0x77da('0x5a')]({'where':{'id':_0x45b0a5[_0x77da('0x57')]['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x448ffd,null))[_0x77da('0x2f')](function(_0x256855){if(_0x256855){_0x45b0a5['body']['OpenchannelAccountId']=_0x256855['id'];return db[_0x77da('0x6b')][_0x77da('0x5b')](_0x45b0a5[_0x77da('0x61')]);}})['then'](respondWithResult(_0x448ffd,null))['catch'](handleError(_0x448ffd,null));};exports['getAnswers']=function(_0x5aaafb,_0x1c5a86,_0xb5e5f6){var _0x395fb8={'raw':![],'where':{}};var _0x4d459d={};var _0x1636d6={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x77da('0x67')]({'where':{'id':_0x5aaafb['params']['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x1c5a86,null))['then'](function(_0x2577fb){if(_0x2577fb){_0x4d459d[_0x77da('0x3e')]=_['keys'](db[_0x77da('0x6b')][_0x77da('0x58')]);_0x4d459d[_0x77da('0x3c')]=_[_0x77da('0x3b')](_0x5aaafb[_0x77da('0x3c')]);_0x4d459d[_0x77da('0x3d')]=_[_0x77da('0x59')](_0x4d459d[_0x77da('0x3e')],_0x4d459d[_0x77da('0x3c')]);_0x395fb8['attributes']=_['intersection'](_0x4d459d['model'],qs[_0x77da('0x40')](_0x5aaafb[_0x77da('0x3c')][_0x77da('0x40')]));_0x395fb8['attributes']=_0x395fb8[_0x77da('0x3f')]['length']?_0x395fb8['attributes']:_0x4d459d[_0x77da('0x3e')];if(!_0x5aaafb[_0x77da('0x3c')]['hasOwnProperty']('nolimit')){_0x395fb8[_0x77da('0x44')]=qs[_0x77da('0x44')](_0x5aaafb[_0x77da('0x3c')]['limit']);_0x395fb8[_0x77da('0x29')]=qs['offset'](_0x5aaafb[_0x77da('0x3c')][_0x77da('0x29')]);}_0x395fb8[_0x77da('0x45')]=qs[_0x77da('0x46')](_0x5aaafb[_0x77da('0x3c')][_0x77da('0x46')]);_0x395fb8['where']=qs[_0x77da('0x3d')](_[_0x77da('0x48')](_0x5aaafb[_0x77da('0x3c')],_0x4d459d[_0x77da('0x3d')]));_0x395fb8['where'][_0x77da('0x68')]=_0x2577fb['id'];if(_0x5aaafb['query'][_0x77da('0x49')]){_0x395fb8[_0x77da('0x47')]=_[_0x77da('0x4a')](_0x395fb8[_0x77da('0x47')],{'$or':_[_0x77da('0x4b')](_0x395fb8[_0x77da('0x3f')],function(_0xdbbc0){var _0x3d0583={};_0x3d0583[_0xdbbc0]={'$like':'%'+_0x5aaafb['query'][_0x77da('0x49')]+'%'};return _0x3d0583;})});}_0x395fb8=_[_0x77da('0x4a')]({},_0x395fb8,_0x5aaafb[_0x77da('0x50')]);return db[_0x77da('0x6b')][_0x77da('0x28')]({'where':_0x395fb8[_0x77da('0x47')]})[_0x77da('0x2f')](function(_0x12299f){_0x1636d6['count']=_0x12299f;if(_0x5aaafb['query'][_0x77da('0x51')]){_0x395fb8[_0x77da('0x52')]=[{'all':!![]}];}return db[_0x77da('0x6b')]['findAll'](_0x395fb8);})[_0x77da('0x2f')](function(_0x52b999){_0x1636d6[_0x77da('0x54')]=_0x52b999;return _0x1636d6;});}})[_0x77da('0x2f')](respondWithFilteredResult(_0x1c5a86,_0x395fb8))[_0x77da('0x55')](handleError(_0x1c5a86,null));};exports['removeAnswers']=function(_0x4aff13,_0x20ae0a,_0x48bd19){var _0x517621;return db[_0x77da('0x3a')][_0x77da('0x5a')]({'where':{'id':_0x4aff13[_0x77da('0x57')]['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x20ae0a,null))['then'](function(_0xa0f53d){if(_0xa0f53d){return _0xa0f53d['removeAnswers'](_0x4aff13['query']['ids']);}})[_0x77da('0x2f')](respondWithStatusCode(_0x20ae0a,null))[_0x77da('0x55')](handleError(_0x20ae0a,null));};exports[_0x77da('0x6c')]=function(_0x36decd,_0x19d036,_0xb1c012){var _0xd8218e={'body':_0x36decd[_0x77da('0x61')],'channel':'openchannel'};var _0x91641b=[];var _0x461d88=[];var _0x5d32c5={};var _0x24029c=![];return db['CmContact'][_0x77da('0x62')]()[_0x77da('0x2f')](function(_0x17a937){if(!_0x17a937){throw new db[(_0x77da('0x6d'))][(_0x77da('0x6e'))]('no\x20available\x20attributes');}_0x91641b=_[_0x77da('0x6f')](_[_0x77da('0x3b')](_0x17a937),['createdAt',_0x77da('0x70')]);_0x461d88=_['difference'](_['keys'](_0x17a937),[_0x77da('0x71'),'updatedAt','CompanyId',_0x77da('0x72')]);if(_0x36decd[_0x77da('0x61')]['id']){delete _0x36decd[_0x77da('0x61')]['id'];}if(_[_0x77da('0x73')](_0x36decd['body'][_0x77da('0x74')])){throw new db['Sequelize'][(_0x77da('0x6e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x36decd[_0x77da('0x61')]['body'])||_0x36decd[_0x77da('0x61')][_0x77da('0x61')]===''){throw new db['Sequelize'][(_0x77da('0x6e'))](_0x77da('0x75'));}if(_[_0x77da('0x73')](_0x36decd['body'][_0x77da('0x76')])){throw new db[(_0x77da('0x6d'))][(_0x77da('0x6e'))](_0x77da('0x77')+_0x461d88);}if(!_['includes'](_0x461d88,_0x36decd[_0x77da('0x61')]['mapKey'])){throw new db[(_0x77da('0x6d'))][(_0x77da('0x6e'))](_0x77da('0x78')+_0x461d88);}_0x5d32c5[_0x36decd[_0x77da('0x61')][_0x77da('0x76')]]=_0x36decd[_0x77da('0x61')][_0x77da('0x74')];})[_0x77da('0x2f')](function(){return db[_0x77da('0x3a')][_0x77da('0x5a')]({'where':{'id':_0x36decd[_0x77da('0x57')]['id']},'include':[{'model':db[_0x77da('0x79')],'as':_0x77da('0x7a'),'include':[{'model':db['CmContact'],'as':_0x77da('0x7b'),'where':_0x5d32c5,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x77da('0x7c')],'as':'Applications'}]});})[_0x77da('0x2f')](handleEntityNotFound(_0x19d036,null))[_0x77da('0x2f')](function(_0x575613){if(_0x575613&&_0x575613[_0x77da('0x7a')]){_0xd8218e[_0x77da('0x7d')]=_0x575613;_0xd8218e[_0x77da('0x7e')]=_0x575613[_0x77da('0x7f')];_0xd8218e[_0x77da('0x80')]=_0x575613[_0x77da('0x7a')];_0xd8218e[_0x77da('0x7e')]=_[_0x77da('0x81')](_0xd8218e[_0x77da('0x7e')],[_0x77da('0x82')],[_0x77da('0x83')]);if(_0xd8218e[_0x77da('0x7d')][_0x77da('0x7f')]){delete _0xd8218e['account'][_0x77da('0x7f')];}if(_0xd8218e[_0x77da('0x7d')]['List']&&_0xd8218e['account'][_0x77da('0x7a')]['Contacts'][_0x77da('0x41')]){return _0xd8218e['account'][_0x77da('0x7a')]['Contacts'][0x0];}var _0x31a578=_[_0x77da('0x16')](_0x36decd[_0x77da('0x61')],{'firstName':_0x36decd['body']['from'],'ListId':_0x575613[_0x77da('0x72')]});_0x31a578[_0x36decd[_0x77da('0x61')]['mapKey']]=_0x36decd[_0x77da('0x61')][_0x77da('0x74')];return db[_0x77da('0x84')][_0x77da('0x5b')](_0x31a578,{'fields':_0x91641b,'raw':!![]});}})[_0x77da('0x2f')](handleEntityNotFound(_0x19d036,null))[_0x77da('0x2f')](function(_0x1e9dc2){_0xd8218e[_0x77da('0x85')]=_0x1e9dc2;if(_0x1e9dc2){var _0x254fdd={'ContactId':_0x1e9dc2['id'],'OpenchannelAccountId':_0x36decd[_0x77da('0x57')]['id'],'from':(_0x1e9dc2[_0x77da('0x86')]||'')+'\x20'+(_0x1e9dc2[_0x77da('0x87')]||'')};var _0x466cf5={'OpenchannelAccountId':_0x36decd['params']['id'],'closed':![]};if(_0x36decd[_0x77da('0x61')]['threadId']){_0x466cf5['threadId']=_0x36decd[_0x77da('0x61')][_0x77da('0x88')];return db[_0x77da('0x89')][_0x77da('0x5a')]({'where':_0x466cf5})['then'](function(_0x197b48){if(_0x197b48){return[_0x197b48,![]];}_0x254fdd[_0x77da('0x88')]=_0x36decd['body'][_0x77da('0x88')];_0x254fdd[_0x77da('0x8a')]=_0x36decd[_0x77da('0x61')][_0x77da('0x8a')];return db[_0x77da('0x89')][_0x77da('0x5b')](_0x254fdd)['then'](function(_0x17578e){return[_0x17578e,!![]];});});}else{_0x466cf5['threadId']=null;}_0x466cf5[_0x77da('0x8b')]=_0x1e9dc2['id'];return db[_0x77da('0x89')]['find']({'where':_0x466cf5})[_0x77da('0x2f')](function(_0x53ccba){if(_0x53ccba){return[_0x53ccba,![]];}return db['OpenchannelInteraction'][_0x77da('0x5b')](_0x254fdd)[_0x77da('0x2f')](function(_0x15e7bd){return[_0x15e7bd,!![]];});});}})['spread'](function(_0x4c3cbf,_0x54dcec){if(_0x4c3cbf){_0x24029c=_0x54dcec;if(!_0x54dcec){var _0x11d6ae={'from':(_0xd8218e[_0x77da('0x85')][_0x77da('0x86')]||'')+'\x20'+(_0xd8218e[_0x77da('0x85')][_0x77da('0x87')]||'')};if(_0x36decd[_0x77da('0x61')][_0x77da('0x88')]&&_0x36decd['body']['messageId']&&_0x36decd[_0x77da('0x61')][_0x77da('0x88')]!=_0x36decd[_0x77da('0x61')][_0x77da('0x8c')]){_0x11d6ae[_0x77da('0x88')]=_0x36decd[_0x77da('0x61')]['messageId'];}return _0x4c3cbf[_0x77da('0x2e')](_0x11d6ae);}else{return _0x4c3cbf;}}})['then'](function(_0x500150){_0xd8218e[_0x77da('0x8d')]=_0x500150[_0x77da('0x30')]({'plain':!![]});_0xd8218e[_0x77da('0x8d')][_0x77da('0x8e')]=_0x24029c;if(_0xd8218e[_0x77da('0x8d')][_0x77da('0x8e')]){if(_0xd8218e[_0x77da('0x7d')]['autoclose']){_0xd8218e[_0x77da('0x7e')][_0x77da('0x8f')]({'id':0x0,'priority':_0xd8218e[_0x77da('0x7e')][_0x77da('0x41')]+0x1,'app':_0x77da('0x90'),'appdata':_0x77da('0x91'),'interval':'*,*,*,*'});}}return db[_0x77da('0x92')][_0x77da('0x5b')]({'body':_0x36decd[_0x77da('0x61')]['body'],'OpenchannelAccountId':_0x36decd['params']['id'],'OpenchannelInteractionId':_0x500150['id'],'direction':'in','ContactId':_0xd8218e[_0x77da('0x85')]['id'],'AttachmentId':_0x36decd['body']['AttachmentId']});})[_0x77da('0x2f')](function(_0x2d329e){_0xd8218e[_0x77da('0x22')]=_0x2d329e;if(_0xd8218e['interaction']['UserId']){return db[_0x77da('0x93')]['find']({'attributes':['id',_0x77da('0x35')],'where':{'id':_0xd8218e[_0x77da('0x8d')]['UserId']}})['then'](function(_0x58cbae){if(_0x58cbae){_0xd8218e[_0x77da('0x7e')][_0x77da('0x94')]({'id':0x0,'priority':0x0,'app':_0x77da('0x95'),'appdata':_0x58cbae[_0x77da('0x35')]+','+(_0xd8218e[_0x77da('0x7d')]['waitForTheAssignedAgent']||0xa),'interval':_0x77da('0x96')});_0xd8218e[_0x77da('0x97')]=![];}return respondWithRpcPromise('Start','startRouting',_0xd8218e);});}return respondWithRpcPromise(_0x77da('0x98'),_0x77da('0x99'),_0xd8218e);})[_0x77da('0x2f')](function(_0x48fe91){respondWithRpcPromise(_0x77da('0x9a'),'EventManager',{'event':_0x77da('0x6c'),'message':_0x48fe91},client9002);return _0x48fe91;})['then'](respondWithResult(_0x19d036,null))['catch'](handleError(_0x19d036,null));};exports[_0x77da('0x9b')]=function(_0x44b1f7,_0x4590ed,_0x3e6805){return db[_0x77da('0x3a')][_0x77da('0x67')]({'where':{'id':_0x44b1f7[_0x77da('0x57')]['id']}})['then'](handleEntityNotFound(_0x4590ed,null))[_0x77da('0x2f')](function(_0x435861){if(_0x435861){return db[_0x77da('0x9c')]['transaction'](function(_0x15563d){return db[_0x77da('0x7c')][_0x77da('0x33')]({'where':{'OpenchannelAccountId':_0x44b1f7[_0x77da('0x57')]['id']},'transaction':_0x15563d})[_0x77da('0x2f')](function(_0x55df31){var _0x10ab37=_[_0x77da('0x4b')](_0x44b1f7[_0x77da('0x61')],function(_0x3d62a){_0x3d62a[_0x77da('0x68')]=_0x44b1f7['params']['id'];return _0x3d62a;});return db[_0x77da('0x7c')][_0x77da('0x9d')](_0x10ab37,{'transaction':_0x15563d});});})['then'](function(){return db[_0x77da('0x7c')][_0x77da('0x9e')]({'where':{'OpenchannelAccountId':_0x44b1f7[_0x77da('0x57')]['id']},'order':_0x77da('0x82')});});}})[_0x77da('0x2f')](respondWithResult(_0x4590ed,null))['catch'](handleError(_0x4590ed,null));};exports[_0x77da('0x9f')]=function(_0xd95edf,_0x594cd8,_0x1af660){var _0x34e0ee={};var _0x48b3ee={};var _0x59770f;var _0x54b20c;return db[_0x77da('0x3a')][_0x77da('0x67')]({'where':{'id':_0xd95edf[_0x77da('0x57')]['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x594cd8,null))['then'](function(_0x1bb7f1){if(_0x1bb7f1){_0x59770f=_0x1bb7f1;_0x48b3ee[_0x77da('0x3e')]=_[_0x77da('0x3b')](db[_0x77da('0x7c')][_0x77da('0x58')]);_0x48b3ee[_0x77da('0x3c')]=_[_0x77da('0x3b')](_0xd95edf[_0x77da('0x3c')]);_0x48b3ee[_0x77da('0x3d')]=_[_0x77da('0x59')](_0x48b3ee['model'],_0x48b3ee[_0x77da('0x3c')]);_0x34e0ee['attributes']=_[_0x77da('0x59')](_0x48b3ee[_0x77da('0x3e')],qs[_0x77da('0x40')](_0xd95edf[_0x77da('0x3c')][_0x77da('0x40')]));_0x34e0ee[_0x77da('0x3f')]=_0x34e0ee['attributes'][_0x77da('0x41')]?_0x34e0ee[_0x77da('0x3f')]:_0x48b3ee['model'];_0x34e0ee[_0x77da('0x45')]=qs['sort'](_0xd95edf['query'][_0x77da('0x46')]);_0x34e0ee[_0x77da('0x47')]=qs[_0x77da('0x3d')](_[_0x77da('0x48')](_0xd95edf[_0x77da('0x3c')],_0x48b3ee[_0x77da('0x3d')]));if(_0xd95edf['query']['filter']){_0x34e0ee[_0x77da('0x47')]=_[_0x77da('0x4a')](_0x34e0ee['where'],{'$or':_['map'](_0x34e0ee[_0x77da('0x3f')],function(_0x435ac4){var _0x550c43={};_0x550c43[_0x435ac4]={'$like':'%'+_0xd95edf['query']['filter']+'%'};return _0x550c43;})});}_0x34e0ee=_['merge']({},_0x34e0ee,_0xd95edf[_0x77da('0x50')]);return _0x59770f[_0x77da('0x9f')](_0x34e0ee);}})[_0x77da('0x2f')](function(_0x223ed4){if(_0x223ed4){_0x54b20c=_0x223ed4[_0x77da('0x41')];if(!_0xd95edf[_0x77da('0x3c')][_0x77da('0x42')]('nolimit')){_0x34e0ee[_0x77da('0x44')]=qs[_0x77da('0x44')](_0xd95edf[_0x77da('0x3c')][_0x77da('0x44')]);_0x34e0ee[_0x77da('0x29')]=qs[_0x77da('0x29')](_0xd95edf[_0x77da('0x3c')][_0x77da('0x29')]);}return _0x59770f[_0x77da('0x9f')](_0x34e0ee);}})[_0x77da('0x2f')](function(_0x3a3100){if(_0x3a3100){return _0x3a3100?{'count':_0x54b20c,'rows':_0x3a3100}:null;}})[_0x77da('0x2f')](respondWithResult(_0x594cd8,null))['catch'](handleError(_0x594cd8,null));};exports[_0x77da('0xa0')]=function(_0x299138,_0x1674cf,_0x213756){var _0x2ecb02={'raw':![],'where':{}};var _0x2458b3={};var _0x2d11cc={'count':0x0,'rows':[]};return db[_0x77da('0x3a')]['findOne']({'where':{'id':_0x299138[_0x77da('0x57')]['id']}})['then'](handleEntityNotFound(_0x1674cf,null))[_0x77da('0x2f')](function(_0x476590){if(_0x476590){_0x2458b3[_0x77da('0x3e')]=_[_0x77da('0x3b')](db['OpenchannelInteraction'][_0x77da('0x58')]);_0x2458b3[_0x77da('0x3c')]=_['keys'](_0x299138[_0x77da('0x3c')]);_0x2458b3[_0x77da('0x3d')]=_[_0x77da('0x59')](_0x2458b3[_0x77da('0x3e')],_0x2458b3[_0x77da('0x3c')]);_0x2ecb02[_0x77da('0x3f')]=_[_0x77da('0x59')](_0x2458b3[_0x77da('0x3e')],qs[_0x77da('0x40')](_0x299138[_0x77da('0x3c')][_0x77da('0x40')]));_0x2ecb02['attributes']=_0x2ecb02[_0x77da('0x3f')]['length']?_0x2ecb02[_0x77da('0x3f')]:_0x2458b3['model'];if(!_0x299138['query'][_0x77da('0x42')]('nolimit')){_0x2ecb02[_0x77da('0x44')]=qs[_0x77da('0x44')](_0x299138['query'][_0x77da('0x44')]);_0x2ecb02['offset']=qs[_0x77da('0x29')](_0x299138['query']['offset']);}_0x2ecb02['order']=qs['sort'](_0x299138['query'][_0x77da('0x46')]);_0x2ecb02['where']=qs[_0x77da('0x3d')](_[_0x77da('0x48')](_0x299138[_0x77da('0x3c')],_0x2458b3['filters']));_0x2ecb02[_0x77da('0x47')]['OpenchannelAccountId']=_0x476590['id'];if(_0x299138[_0x77da('0x3c')]['filter']){_0x2ecb02[_0x77da('0x47')]=_['merge'](_0x2ecb02[_0x77da('0x47')],{'$or':_['map'](_0x2ecb02[_0x77da('0x3f')],function(_0x13f25d){var _0x38175f={};_0x38175f[_0x13f25d]={'$like':'%'+_0x299138[_0x77da('0x3c')][_0x77da('0x49')]+'%'};return _0x38175f;})});}_0x2ecb02=_[_0x77da('0x4a')]({},_0x2ecb02,_0x299138[_0x77da('0x50')]);return db[_0x77da('0x89')][_0x77da('0x28')]({'where':_0x2ecb02[_0x77da('0x47')]})[_0x77da('0x2f')](function(_0x35b243){_0x2d11cc[_0x77da('0x28')]=_0x35b243;if(_0x299138[_0x77da('0x3c')]['includeAll']){_0x2ecb02['include']=[{'model':db[_0x77da('0x84')],'as':_0x77da('0xa1'),'required':![]},{'model':db[_0x77da('0x93')],'as':_0x77da('0xa2'),'attributes':[_0x77da('0x35'),_0x77da('0xa3'),'internal'],'required':![]},{'model':db[_0x77da('0xa4')],'as':'Tags','attributes':['id',_0x77da('0x35'),_0x77da('0xa5')],'where':_0x299138['query'][_0x77da('0xa6')]?{'id':_0x299138[_0x77da('0x3c')][_0x77da('0xa6')]}:undefined,'required':_0x299138[_0x77da('0x3c')]['tag']?!![]:![]}];}return db[_0x77da('0x89')][_0x77da('0x53')](_0x2ecb02);})[_0x77da('0x2f')](function(_0x2ac098){_0x2d11cc[_0x77da('0x54')]=_0x2ac098;return _0x2d11cc;});}})[_0x77da('0x2f')](respondWithFilteredResult(_0x1674cf,_0x2ecb02))[_0x77da('0x55')](handleError(_0x1674cf,null));};exports[_0x77da('0xa7')]=function(_0x1bc7b2,_0x267f42,_0x42fa44){return db['OpenchannelAccount'][_0x77da('0x5a')]({'where':{'id':_0x1bc7b2[_0x77da('0x57')]['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x267f42,null))[_0x77da('0x2f')](function(_0x24e34f){if(_0x24e34f){return _0x24e34f[_0x77da('0xa7')](_0x1bc7b2['body'][_0x77da('0xa8')],_[_0x77da('0xa9')](_0x1bc7b2[_0x77da('0x61')],['ids','id'])||{})['spread'](function(_0x5cbf60){for(var _0x31c916=0x0;_0x31c916<_0x1bc7b2[_0x77da('0x61')][_0x77da('0xa8')]['length'];_0x31c916+=0x1){socket[_0x77da('0xaa')]('userOpenchannelAccount:save',{'UserId':_0x1bc7b2[_0x77da('0x61')]['ids'][_0x31c916],'OpenchannelAccountId':_0x1bc7b2[_0x77da('0x57')]['id']});}return _0x5cbf60;});}})[_0x77da('0x2f')](respondWithResult(_0x267f42,null))[_0x77da('0x55')](handleError(_0x267f42,null));};exports[_0x77da('0xab')]=function(_0x44c92f,_0x1e2c7f,_0x56746a){var _0x439b2a;return db[_0x77da('0x3a')][_0x77da('0x5a')]({'where':{'id':_0x44c92f[_0x77da('0x57')]['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x1e2c7f,null))['then'](function(_0xd673fd){if(_0xd673fd){return _0xd673fd[_0x77da('0xab')](_0x44c92f[_0x77da('0x3c')][_0x77da('0xa8')])[_0x77da('0x2f')](function(_0x2c60a5){if(_[_0x77da('0xac')](_0x44c92f[_0x77da('0x3c')]['ids'])){for(var _0x1ddaf9=0x0;_0x1ddaf9<_0x44c92f[_0x77da('0x3c')][_0x77da('0xa8')][_0x77da('0x41')];_0x1ddaf9+=0x1){socket[_0x77da('0xaa')](_0x77da('0xad'),{'UserId':_0x44c92f[_0x77da('0x3c')]['ids'][_0x1ddaf9],'OpenchannelAccountId':_0x44c92f['params']['id']});}}else{socket[_0x77da('0xaa')](_0x77da('0xad'),{'UserId':_0x44c92f['query'][_0x77da('0xa8')],'OpenchannelAccountId':_0x44c92f[_0x77da('0x57')]['id']});}});}})[_0x77da('0x2f')](respondWithStatusCode(_0x1e2c7f,null))[_0x77da('0x55')](handleError(_0x1e2c7f,null));};exports[_0x77da('0xae')]=function(_0x50f819,_0x310841,_0x3c5ff9){var _0x195ddd={};var _0x42a46e={};var _0x1b6bda;var _0x548b5f;return db[_0x77da('0x3a')][_0x77da('0x67')]({'where':{'id':_0x50f819[_0x77da('0x57')]['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x310841,null))[_0x77da('0x2f')](function(_0x5834bc){if(_0x5834bc){_0x1b6bda=_0x5834bc;_0x42a46e['model']=_[_0x77da('0x3b')](db[_0x77da('0x93')]['rawAttributes']);_0x42a46e[_0x77da('0x3c')]=_[_0x77da('0x3b')](_0x50f819[_0x77da('0x3c')]);_0x42a46e[_0x77da('0x3d')]=_[_0x77da('0x59')](_0x42a46e['model'],_0x42a46e[_0x77da('0x3c')]);_0x195ddd['attributes']=_[_0x77da('0x59')](_0x42a46e[_0x77da('0x3e')],qs['fields'](_0x50f819[_0x77da('0x3c')][_0x77da('0x40')]));_0x195ddd[_0x77da('0x3f')]=_0x195ddd[_0x77da('0x3f')][_0x77da('0x41')]?_0x195ddd[_0x77da('0x3f')]:_0x42a46e[_0x77da('0x3e')];_0x195ddd[_0x77da('0x45')]=qs[_0x77da('0x46')](_0x50f819[_0x77da('0x3c')][_0x77da('0x46')]);_0x195ddd['where']=qs['filters'](_[_0x77da('0x48')](_0x50f819[_0x77da('0x3c')],_0x42a46e['filters']));if(_0x50f819[_0x77da('0x3c')][_0x77da('0x49')]){_0x195ddd[_0x77da('0x47')]=_[_0x77da('0x4a')](_0x195ddd[_0x77da('0x47')],{'$or':_[_0x77da('0x4b')](_0x195ddd[_0x77da('0x3f')],function(_0x40c4eb){var _0x20dd15={};_0x20dd15[_0x40c4eb]={'$like':'%'+_0x50f819[_0x77da('0x3c')][_0x77da('0x49')]+'%'};return _0x20dd15;})});}_0x195ddd=_[_0x77da('0x4a')]({},_0x195ddd,_0x50f819['options']);return _0x1b6bda['getAgents'](_0x195ddd);}})[_0x77da('0x2f')](function(_0x2a939a){if(_0x2a939a){_0x548b5f=_0x2a939a[_0x77da('0x41')];if(!_0x50f819[_0x77da('0x3c')][_0x77da('0x42')](_0x77da('0x43'))){_0x195ddd[_0x77da('0x44')]=qs[_0x77da('0x44')](_0x50f819[_0x77da('0x3c')]['limit']);_0x195ddd['offset']=qs[_0x77da('0x29')](_0x50f819[_0x77da('0x3c')][_0x77da('0x29')]);}return _0x1b6bda[_0x77da('0xae')](_0x195ddd);}})[_0x77da('0x2f')](function(_0x500805){if(_0x500805){return _0x500805?{'count':_0x548b5f,'rows':_0x500805}:null;}})['then'](respondWithResult(_0x310841,null))[_0x77da('0x55')](handleError(_0x310841,null));};exports[_0x77da('0x36')]=function(_0x408263,_0x4609aa,_0x45a39b){var _0x1af139,_0x2191f5,_0x21fc08;if(_[_0x77da('0x73')](_0x408263['body']['body'])||_0x408263['body']['body']===''){throw new db['Sequelize'][(_0x77da('0x6e'))](_0x77da('0x75'));}if(_[_0x77da('0x73')](_0x408263[_0x77da('0x61')]['to'])){}_0x1af139=_0x408263[_0x77da('0x61')]['to'];return db[_0x77da('0x3a')]['findOne']({'where':{'id':_0x408263[_0x77da('0x57')]['id']}})[_0x77da('0x2f')](handleEntityNotFound(_0x4609aa,null))[_0x77da('0x2f')](function(_0x4faa34){if(_0x4faa34){return db[_0x77da('0x3a')][_0x77da('0x5a')]({'where':{'id':_0x4faa34['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x77da('0x84')],'as':_0x77da('0x7b'),'where':{[_0x4faa34[_0x77da('0x76')]]:_0x1af139},'limit':0x1,'order':[[_0x77da('0x70'),_0x77da('0xaf')]]}]}]})[_0x77da('0x2f')](handleEntityNotFound(_0x4609aa,null))['then'](function(_0x3930fb){if(_0x3930fb&&_0x3930fb['List']){_0x2191f5=_0x3930fb['get']({'plain':!![]});if(_0x2191f5[_0x77da('0x7a')]&&_0x2191f5[_0x77da('0x7a')][_0x77da('0x7b')][_0x77da('0x41')]){return _0x2191f5[_0x77da('0x7a')][_0x77da('0x7b')][0x0];}return db[_0x77da('0x84')][_0x77da('0x5b')](_[_0x77da('0x16')](_0x408263['body'],{'firstName':_0x1af139,[_0x3930fb[_0x77da('0x76')]]:_0x1af139,'phone':_0x1af139,'ListId':_0x2191f5[_0x77da('0x72')]}));}})[_0x77da('0x2f')](handleEntityNotFound(_0x4609aa,null))[_0x77da('0x2f')](function(_0x36cfff){if(_0x36cfff){_0x21fc08=_0x36cfff;return db[_0x77da('0x89')][_0x77da('0x5a')]({'where':{'ContactId':_0x21fc08['id'],'closed':![],'OpenchannelAccountId':_0x2191f5['id']}})['then'](function(_0xee4b19){if(_0xee4b19){return[_0xee4b19,![]];}return db[_0x77da('0x89')][_0x77da('0x5b')]({'UserId':_0x408263['user']['id'],'ContactId':_0x21fc08['id'],'OpenchannelAccountId':_0x2191f5['id'],'lastMsgDirection':_0x77da('0xb0'),'Messages':[_[_0x77da('0x4a')](_0x408263[_0x77da('0x61')],{'read':![],'body':_0x408263[_0x77da('0x61')]['body'],'OpenchannelAccountId':_0x2191f5['id'],'UserId':_0x408263[_0x77da('0x5c')]['id'],'ContactId':_0x21fc08['id']})]},{'include':[{'model':db[_0x77da('0x92')],'as':_0x77da('0xb1')}]})[_0x77da('0x2f')](function(_0x10569b){return[_0x10569b,!![]];});});}})['spread'](function(_0x5b4905,_0x4dedfb){if(_0x4dedfb){return _0x5b4905;}return db['OpenchannelMessage'][_0x77da('0x5b')](_[_0x77da('0x4a')](_0x408263[_0x77da('0x61')],{'read':![],'body':_0x408263['body']['body'],'OpenchannelAccountId':_0x2191f5['id'],'OpenchannelInteractionId':_0x5b4905['id'],'UserId':_0x408263['user']['id'],'ContactId':_0x21fc08['id']}))[_0x77da('0x2f')](function(_0x41211e){_0x5b4905[_0x77da('0xb2')][_0x77da('0xb1')]=[];_0x5b4905['dataValues']['Messages'][_0x77da('0x8f')](_0x41211e['dataValues']);return _0x5b4905;});});}})[_0x77da('0x2f')](respondWithResult(_0x4609aa,null))['catch'](handleError(_0x4609aa,null));}; \ No newline at end of file +var _0x078c=['messageId','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','getAgents','out','Messages','dataValues','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','OpenchannelAccounts','stack','name','send','Pause','mandatoryDispositionPause','OpenchannelAccount','keys','filters','model','intersection','fields','attributes','length','query','hasOwnProperty','order','sort','filter','merge','where','map','key','VIRTUAL','field','includeAll','findAll','show','params','rawAttributes','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpnechannelAccountId','Disposition','findOne','nolimit','pick','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread'];(function(_0x3b5e9f,_0x29601e){var _0x1e9a49=function(_0x31cf02){while(--_0x31cf02){_0x3b5e9f['push'](_0x3b5e9f['shift']());}};_0x1e9a49(++_0x29601e);}(_0x078c,0x19f));var _0xc078=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x078c[_0x54d4fe];return _0x1ab5bb;};'use strict';var pdf=require(_0xc078('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc078('0x1'));var zipdir=require(_0xc078('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc078('0x3'));var moment=require(_0xc078('0x4'));var BPromise=require(_0xc078('0x5'));var Mustache=require(_0xc078('0x6'));var util=require('util');var path=require(_0xc078('0x7'));var sox=require(_0xc078('0x8'));var csv=require(_0xc078('0x9'));var ejs=require(_0xc078('0xa'));var fs=require('fs');var _=require(_0xc078('0xb'));var squel=require(_0xc078('0xc'));var crypto=require(_0xc078('0xd'));var jsforce=require(_0xc078('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc078('0xf'));var authService=require(_0xc078('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xc078('0x11'));var qs=require(_0xc078('0x12'));var logger=require(_0xc078('0x13'))(_0xc078('0x14'));var utils=require(_0xc078('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc078('0x16')]=_[_0xc078('0x17')](config[_0xc078('0x16')],{'host':_0xc078('0x18'),'port':0x18eb});var socket=require(_0xc078('0x19'))(new Redis(config[_0xc078('0x16')]));require(_0xc078('0x1a'))[_0xc078('0x1b')](socket);var jayson=require(_0xc078('0x1c'));var client=jayson[_0xc078('0x1d')][_0xc078('0x1e')]({'port':0x232c});var client9002=jayson[_0xc078('0x1d')][_0xc078('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x36b6b1,_0x404ab0,_0x5a1cbc,_0x39e242){return new BPromise(function(_0x113618,_0x1824c5){var _0x595b14=_0x39e242||client;return _0x595b14[_0xc078('0x1f')](_0x36b6b1,_0x5a1cbc)['then'](function(_0x5eb7c4){logger[_0xc078('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x404ab0,_0xc078('0x21'));logger['debug'](_0xc078('0x22'),_0x404ab0,_0xc078('0x21'),JSON[_0xc078('0x23')](_0x5eb7c4));if(_0x5eb7c4['error']){if(_0x5eb7c4[_0xc078('0x24')]['code']===0x1f4){logger[_0xc078('0x24')](_0xc078('0x25'),_0x404ab0,_0x5eb7c4[_0xc078('0x24')][_0xc078('0x26')]);return _0x1824c5(_0x5eb7c4[_0xc078('0x24')]['message']);}logger[_0xc078('0x24')](_0xc078('0x25'),_0x404ab0,_0x5eb7c4[_0xc078('0x24')][_0xc078('0x26')]);return _0x113618(_0x5eb7c4['error'][_0xc078('0x26')]);}else{logger[_0xc078('0x20')](_0xc078('0x25'),_0x404ab0,_0xc078('0x21'));_0x113618(_0x5eb7c4[_0xc078('0x27')][_0xc078('0x26')]);}})[_0xc078('0x28')](function(_0x1f4595){logger[_0xc078('0x24')](_0xc078('0x25'),_0x404ab0,_0x1f4595);_0x1824c5(_0x1f4595);});});}function respondWithStatusCode(_0x14f677,_0x531945){_0x531945=_0x531945||0xcc;return function(_0x5e7661){if(_0x5e7661){return _0x14f677[_0xc078('0x29')](_0x531945);}return _0x14f677['status'](_0x531945)['end']();};}function respondWithResult(_0x5bd980,_0x3c7843){_0x3c7843=_0x3c7843||0xc8;return function(_0x5edd0f){if(_0x5edd0f){return _0x5bd980[_0xc078('0x2a')](_0x3c7843)[_0xc078('0x2b')](_0x5edd0f);}};}function respondWithFilteredResult(_0x2d46c9,_0x22f7e9){return function(_0xd43338){if(_0xd43338){var _0x2b257c=_0xd43338[_0xc078('0x2c')],_0x7c965e=_0x22f7e9[_0xc078('0x2d')],_0x3c481f=_0x22f7e9['offset']+_0x22f7e9[_0xc078('0x2e')],_0x50e5d;if(_0x3c481f>=_0x2b257c){_0x3c481f=_0x2b257c;_0x50e5d=0xc8;}else{_0x50e5d=0xce;}_0x2d46c9['status'](_0x50e5d);return _0x2d46c9[_0xc078('0x2f')](_0xc078('0x30'),_0x7c965e+'-'+_0x3c481f+'/'+_0x2b257c)[_0xc078('0x2b')](_0xd43338);}return null;};}function patchUpdates(_0x15645d){return function(_0x49fa3d){try{jsonpatch[_0xc078('0x31')](_0x49fa3d,_0x15645d,!![]);}catch(_0x5814f4){return BPromise['reject'](_0x5814f4);}return _0x49fa3d[_0xc078('0x32')]();};}function saveUpdates(_0xd27c81,_0x5b0c5d){return function(_0x392cdc){if(_0x392cdc){return _0x392cdc[_0xc078('0x33')](_0xd27c81)[_0xc078('0x34')](function(_0x4d755e){return _0x4d755e;});}return null;};}function removeEntity(_0x48885c,_0x236b8e){return function(_0x4ff791){if(_0x4ff791){return _0x4ff791[_0xc078('0x35')]()[_0xc078('0x34')](function(){var _0x497d85=_0x4ff791[_0xc078('0x36')]({'plain':!![]});var _0x1429e0=_0xc078('0x37');return db['UserProfileResource'][_0xc078('0x35')]({'where':{'type':_0x1429e0,'resourceId':_0x497d85['id']}})[_0xc078('0x34')](function(){return _0x4ff791;});})[_0xc078('0x34')](function(){_0x48885c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f909e,_0x364d3c){return function(_0x5c672c){if(!_0x5c672c){_0x1f909e['sendStatus'](0x194);}return _0x5c672c;};}function handleError(_0x533246,_0x480f08){_0x480f08=_0x480f08||0x1f4;return function(_0x56083b){logger[_0xc078('0x24')](_0x56083b[_0xc078('0x38')]);if(_0x56083b[_0xc078('0x39')]){delete _0x56083b[_0xc078('0x39')];}_0x533246['status'](_0x480f08)[_0xc078('0x3a')](_0x56083b);};}exports['index']=function(_0x5247f6,_0x2b5cab){var _0x158583={'include':[{'model':db[_0xc078('0x3b')],'as':_0xc078('0x3c')}]},_0x1c256b={},_0x8b5f10={'count':0x0,'rows':[]};var _0x40835b=db[_0xc078('0x3d')]['rawAttributes'];_0x1c256b['model']=_['keys'](_0x40835b);_0x1c256b['query']=_[_0xc078('0x3e')](_0x5247f6['query']);_0x1c256b[_0xc078('0x3f')]=_['intersection'](_0x1c256b[_0xc078('0x40')],_0x1c256b['query']);_0x158583['attributes']=_[_0xc078('0x41')](_0x1c256b[_0xc078('0x40')],qs[_0xc078('0x42')](_0x5247f6['query'][_0xc078('0x42')]));_0x158583[_0xc078('0x43')]=_0x158583['attributes'][_0xc078('0x44')]?_0x158583[_0xc078('0x43')]:_0x1c256b[_0xc078('0x40')];if(!_0x5247f6[_0xc078('0x45')][_0xc078('0x46')]('nolimit')){_0x158583[_0xc078('0x2e')]=qs[_0xc078('0x2e')](_0x5247f6[_0xc078('0x45')]['limit']);_0x158583['offset']=qs[_0xc078('0x2d')](_0x5247f6['query']['offset']);}_0x158583[_0xc078('0x47')]=qs[_0xc078('0x48')](_0x5247f6['query'][_0xc078('0x48')]);_0x158583['where']=qs[_0xc078('0x3f')](_['pick'](_0x5247f6[_0xc078('0x45')],_0x1c256b[_0xc078('0x3f')]));if(_0x5247f6[_0xc078('0x45')][_0xc078('0x49')]){_0x158583['where']=_[_0xc078('0x4a')](_0x158583[_0xc078('0x4b')],{'$or':_[_0xc078('0x4c')](_0x40835b,function(_0x414dfc){if(_0x414dfc['type'][_0xc078('0x4d')]!==_0xc078('0x4e')){var _0x1416f9={};_0x1416f9[_0x414dfc[_0xc078('0x4f')]]={'$like':'%'+_0x5247f6[_0xc078('0x45')]['filter']+'%'};return _0x1416f9;}})});}_0x158583=_[_0xc078('0x4a')]({},_0x158583,_0x5247f6['options']);var _0x4de139={'where':_0x158583['where']};return db[_0xc078('0x3d')][_0xc078('0x2c')](_0x4de139)[_0xc078('0x34')](function(_0x4c3041){_0x8b5f10['count']=_0x4c3041;if(_0x5247f6[_0xc078('0x45')][_0xc078('0x50')]){_0x158583['include']=[{'all':!![]}];}return db[_0xc078('0x3d')][_0xc078('0x51')](_0x158583);})['then'](function(_0x2a846f){_0x8b5f10['rows']=_0x2a846f;return _0x8b5f10;})[_0xc078('0x34')](respondWithFilteredResult(_0x2b5cab,_0x158583))[_0xc078('0x28')](handleError(_0x2b5cab,null));};exports[_0xc078('0x52')]=function(_0x23e616,_0x53ff80){var _0x3fba4c={'raw':![],'where':{'id':_0x23e616[_0xc078('0x53')]['id']},'include':[{'model':db[_0xc078('0x3b')],'as':_0xc078('0x3c')}]},_0x59e9b9={};_0x59e9b9[_0xc078('0x40')]=_[_0xc078('0x3e')](db['OpenchannelAccount'][_0xc078('0x54')]);_0x59e9b9[_0xc078('0x45')]=_['keys'](_0x23e616[_0xc078('0x45')]);_0x59e9b9[_0xc078('0x3f')]=_[_0xc078('0x41')](_0x59e9b9['model'],_0x59e9b9[_0xc078('0x45')]);_0x3fba4c['attributes']=_[_0xc078('0x41')](_0x59e9b9[_0xc078('0x40')],qs[_0xc078('0x42')](_0x23e616[_0xc078('0x45')]['fields']));_0x3fba4c[_0xc078('0x43')]=_0x3fba4c[_0xc078('0x43')][_0xc078('0x44')]?_0x3fba4c[_0xc078('0x43')]:_0x59e9b9[_0xc078('0x40')];if(_0x23e616[_0xc078('0x45')][_0xc078('0x50')]){_0x3fba4c[_0xc078('0x55')]=[{'all':!![]}];}_0x3fba4c=_[_0xc078('0x4a')]({},_0x3fba4c,_0x23e616[_0xc078('0x56')]);return db[_0xc078('0x3d')]['find'](_0x3fba4c)[_0xc078('0x34')](handleEntityNotFound(_0x53ff80,null))[_0xc078('0x34')](respondWithResult(_0x53ff80,null))[_0xc078('0x28')](handleError(_0x53ff80,null));};exports[_0xc078('0x57')]=function(_0x4926be,_0x5cdc37){return db['OpenchannelAccount'][_0xc078('0x57')](_0x4926be[_0xc078('0x58')],{})[_0xc078('0x34')](function(_0xdb27db){var _0xf25499=_0x4926be[_0xc078('0x59')][_0xc078('0x36')]({'plain':!![]});if(!_0xf25499)throw new Error(_0xc078('0x5a'));if(_0xf25499[_0xc078('0x5b')]===_0xc078('0x59')){var _0x4f7877=_0xdb27db['get']({'plain':!![]});var _0x450adc=_0xc078('0x37');return db[_0xc078('0x5c')][_0xc078('0x5d')]({'where':{'name':_0x450adc,'userProfileId':_0xf25499[_0xc078('0x5e')]},'raw':!![]})[_0xc078('0x34')](function(_0x345b93){if(_0x345b93&&_0x345b93[_0xc078('0x5f')]===0x0){return db[_0xc078('0x60')][_0xc078('0x57')]({'name':_0x4f7877['name'],'resourceId':_0x4f7877['id'],'type':_0x345b93[_0xc078('0x39')],'sectionId':_0x345b93['id']},{})['then'](function(){return _0xdb27db;});}else{return _0xdb27db;}})[_0xc078('0x28')](function(_0x2df1ac){logger[_0xc078('0x24')](_0xc078('0x61'),_0x2df1ac);throw _0x2df1ac;});}return _0xdb27db;})[_0xc078('0x34')](respondWithResult(_0x5cdc37,0xc9))['catch'](handleError(_0x5cdc37,null));};exports[_0xc078('0x33')]=function(_0x4904a5,_0x20af79){if(_0x4904a5['body']['id']){delete _0x4904a5[_0xc078('0x58')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x4904a5[_0xc078('0x53')]['id']},'include':[{'model':db[_0xc078('0x3b')],'as':_0xc078('0x3c')}]})['then'](handleEntityNotFound(_0x20af79,null))[_0xc078('0x34')](saveUpdates(_0x4904a5[_0xc078('0x58')],null))[_0xc078('0x34')](respondWithResult(_0x20af79,null))[_0xc078('0x28')](handleError(_0x20af79,null));};exports[_0xc078('0x35')]=function(_0x29aaa2,_0x191c30){return db[_0xc078('0x3d')][_0xc078('0x5d')]({'where':{'id':_0x29aaa2[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x191c30,null))['then'](removeEntity(_0x191c30,null))['catch'](handleError(_0x191c30,null));};exports[_0xc078('0x62')]=function(_0x114858,_0x4705b5){return db[_0xc078('0x3d')][_0xc078('0x62')]()[_0xc078('0x34')](respondWithResult(_0x4705b5,null))[_0xc078('0x28')](handleError(_0x4705b5,null));};exports['addDisposition']=function(_0x989bef,_0x2a8705,_0x1368a1){if(_0x989bef[_0xc078('0x58')]['id']){delete _0x989bef[_0xc078('0x58')]['id'];}return db[_0xc078('0x3d')][_0xc078('0x5d')]({'where':{'id':_0x989bef[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x2a8705,null))[_0xc078('0x34')](function(_0x46480e){if(_0x46480e){_0x989bef[_0xc078('0x58')][_0xc078('0x63')]=_0x46480e['id'];return db[_0xc078('0x64')]['create'](_0x989bef[_0xc078('0x58')]);}})[_0xc078('0x34')](respondWithResult(_0x2a8705,null))[_0xc078('0x28')](handleError(_0x2a8705,null));};exports['getDispositions']=function(_0x26c0ce,_0x18df16,_0x5aa8cd){var _0x2301fc={'raw':![],'where':{}};var _0x5ba762={};var _0x2e7acf={'count':0x0,'rows':[]};return db[_0xc078('0x3d')][_0xc078('0x65')]({'where':{'id':_0x26c0ce[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x18df16,null))[_0xc078('0x34')](function(_0x210e35){if(_0x210e35){_0x5ba762[_0xc078('0x40')]=_[_0xc078('0x3e')](db['Disposition'][_0xc078('0x54')]);_0x5ba762[_0xc078('0x45')]=_[_0xc078('0x3e')](_0x26c0ce[_0xc078('0x45')]);_0x5ba762[_0xc078('0x3f')]=_[_0xc078('0x41')](_0x5ba762[_0xc078('0x40')],_0x5ba762[_0xc078('0x45')]);_0x2301fc[_0xc078('0x43')]=_[_0xc078('0x41')](_0x5ba762['model'],qs[_0xc078('0x42')](_0x26c0ce['query']['fields']));_0x2301fc[_0xc078('0x43')]=_0x2301fc[_0xc078('0x43')]['length']?_0x2301fc[_0xc078('0x43')]:_0x5ba762['model'];if(!_0x26c0ce['query'][_0xc078('0x46')](_0xc078('0x66'))){_0x2301fc[_0xc078('0x2e')]=qs[_0xc078('0x2e')](_0x26c0ce[_0xc078('0x45')]['limit']);_0x2301fc['offset']=qs[_0xc078('0x2d')](_0x26c0ce[_0xc078('0x45')][_0xc078('0x2d')]);}_0x2301fc['order']=qs['sort'](_0x26c0ce[_0xc078('0x45')][_0xc078('0x48')]);_0x2301fc[_0xc078('0x4b')]=qs['filters'](_[_0xc078('0x67')](_0x26c0ce[_0xc078('0x45')],_0x5ba762[_0xc078('0x3f')]));_0x2301fc[_0xc078('0x4b')][_0xc078('0x68')]=_0x210e35['id'];if(_0x26c0ce[_0xc078('0x45')][_0xc078('0x49')]){_0x2301fc['where']=_[_0xc078('0x4a')](_0x2301fc['where'],{'$or':_[_0xc078('0x4c')](_0x2301fc['attributes'],function(_0x4e5700){var _0x59638c={};_0x59638c[_0x4e5700]={'$like':'%'+_0x26c0ce[_0xc078('0x45')][_0xc078('0x49')]+'%'};return _0x59638c;})});}_0x2301fc=_[_0xc078('0x4a')]({},_0x2301fc,_0x26c0ce[_0xc078('0x56')]);return db['Disposition']['count']({'where':_0x2301fc[_0xc078('0x4b')]})['then'](function(_0x5f50d4){_0x2e7acf['count']=_0x5f50d4;if(_0x26c0ce[_0xc078('0x45')][_0xc078('0x50')]){_0x2301fc['include']=[{'all':!![]}];}return db[_0xc078('0x64')]['findAll'](_0x2301fc);})[_0xc078('0x34')](function(_0x1c4cd7){_0x2e7acf[_0xc078('0x69')]=_0x1c4cd7;return _0x2e7acf;});}})['then'](respondWithFilteredResult(_0x18df16,_0x2301fc))[_0xc078('0x28')](handleError(_0x18df16,null));};exports[_0xc078('0x6a')]=function(_0x1f1e0c,_0x3a1889,_0x392d37){var _0x501de0;return db[_0xc078('0x3d')][_0xc078('0x5d')]({'where':{'id':_0x1f1e0c[_0xc078('0x53')]['id']}})['then'](handleEntityNotFound(_0x3a1889,null))['then'](function(_0x589973){if(_0x589973){return _0x589973[_0xc078('0x6a')](_0x1f1e0c['query'][_0xc078('0x6b')]);}})[_0xc078('0x34')](respondWithStatusCode(_0x3a1889,null))['catch'](handleError(_0x3a1889,null));};exports[_0xc078('0x6c')]=function(_0x11b2ff,_0x5ad6b2,_0x2e97ca){if(_0x11b2ff[_0xc078('0x58')]['id']){delete _0x11b2ff[_0xc078('0x58')]['id'];}return db[_0xc078('0x3d')][_0xc078('0x5d')]({'where':{'id':_0x11b2ff[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x5ad6b2,null))[_0xc078('0x34')](function(_0x166962){if(_0x166962){_0x11b2ff[_0xc078('0x58')][_0xc078('0x68')]=_0x166962['id'];return db[_0xc078('0x6d')][_0xc078('0x57')](_0x11b2ff[_0xc078('0x58')]);}})[_0xc078('0x34')](respondWithResult(_0x5ad6b2,null))[_0xc078('0x28')](handleError(_0x5ad6b2,null));};exports[_0xc078('0x6e')]=function(_0x119b6c,_0x5d7d0a,_0x56a519){var _0x575f8b={'raw':![],'where':{}};var _0x1b7537={};var _0x2b444b={'count':0x0,'rows':[]};return db[_0xc078('0x3d')]['findOne']({'where':{'id':_0x119b6c[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x5d7d0a,null))[_0xc078('0x34')](function(_0x309394){if(_0x309394){_0x1b7537[_0xc078('0x40')]=_[_0xc078('0x3e')](db['CannedAnswer']['rawAttributes']);_0x1b7537[_0xc078('0x45')]=_[_0xc078('0x3e')](_0x119b6c[_0xc078('0x45')]);_0x1b7537[_0xc078('0x3f')]=_['intersection'](_0x1b7537['model'],_0x1b7537[_0xc078('0x45')]);_0x575f8b[_0xc078('0x43')]=_['intersection'](_0x1b7537[_0xc078('0x40')],qs[_0xc078('0x42')](_0x119b6c[_0xc078('0x45')]['fields']));_0x575f8b[_0xc078('0x43')]=_0x575f8b[_0xc078('0x43')][_0xc078('0x44')]?_0x575f8b[_0xc078('0x43')]:_0x1b7537[_0xc078('0x40')];if(!_0x119b6c[_0xc078('0x45')][_0xc078('0x46')](_0xc078('0x66'))){_0x575f8b[_0xc078('0x2e')]=qs['limit'](_0x119b6c[_0xc078('0x45')][_0xc078('0x2e')]);_0x575f8b[_0xc078('0x2d')]=qs[_0xc078('0x2d')](_0x119b6c[_0xc078('0x45')][_0xc078('0x2d')]);}_0x575f8b[_0xc078('0x47')]=qs['sort'](_0x119b6c[_0xc078('0x45')]['sort']);_0x575f8b[_0xc078('0x4b')]=qs['filters'](_['pick'](_0x119b6c['query'],_0x1b7537['filters']));_0x575f8b[_0xc078('0x4b')][_0xc078('0x68')]=_0x309394['id'];if(_0x119b6c['query'][_0xc078('0x49')]){_0x575f8b['where']=_[_0xc078('0x4a')](_0x575f8b[_0xc078('0x4b')],{'$or':_[_0xc078('0x4c')](_0x575f8b[_0xc078('0x43')],function(_0x50dd1e){var _0x4bad2a={};_0x4bad2a[_0x50dd1e]={'$like':'%'+_0x119b6c[_0xc078('0x45')]['filter']+'%'};return _0x4bad2a;})});}_0x575f8b=_[_0xc078('0x4a')]({},_0x575f8b,_0x119b6c['options']);return db[_0xc078('0x6d')]['count']({'where':_0x575f8b['where']})[_0xc078('0x34')](function(_0x1b56a7){_0x2b444b['count']=_0x1b56a7;if(_0x119b6c[_0xc078('0x45')][_0xc078('0x50')]){_0x575f8b['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc078('0x51')](_0x575f8b);})['then'](function(_0x16bc80){_0x2b444b['rows']=_0x16bc80;return _0x2b444b;});}})[_0xc078('0x34')](respondWithFilteredResult(_0x5d7d0a,_0x575f8b))['catch'](handleError(_0x5d7d0a,null));};exports['removeAnswers']=function(_0x2ddaf3,_0x582d33,_0x2e23ce){var _0x4d45fd;return db[_0xc078('0x3d')][_0xc078('0x5d')]({'where':{'id':_0x2ddaf3[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x582d33,null))[_0xc078('0x34')](function(_0x2ff27a){if(_0x2ff27a){return _0x2ff27a['removeAnswers'](_0x2ddaf3['query']['ids']);}})[_0xc078('0x34')](respondWithStatusCode(_0x582d33,null))[_0xc078('0x28')](handleError(_0x582d33,null));};exports[_0xc078('0x6f')]=function(_0x1e101f,_0x2d5350,_0x1c3b83){var _0x523ab3={'body':_0x1e101f['body'],'channel':_0xc078('0x70')};var _0x46e0b4=[];var _0x3ab760=[];var _0x127889={};var _0x461a56=![];return db[_0xc078('0x71')][_0xc078('0x62')]()[_0xc078('0x34')](function(_0x19da82){if(!_0x19da82){throw new db[(_0xc078('0x72'))][(_0xc078('0x73'))](_0xc078('0x74'));}_0x46e0b4=_[_0xc078('0x75')](_['keys'](_0x19da82),['createdAt',_0xc078('0x76')]);_0x3ab760=_[_0xc078('0x75')](_[_0xc078('0x3e')](_0x19da82),[_0xc078('0x77'),_0xc078('0x76'),_0xc078('0x78'),_0xc078('0x79')]);if(_0x1e101f['body']['id']){delete _0x1e101f[_0xc078('0x58')]['id'];}if(_[_0xc078('0x7a')](_0x1e101f[_0xc078('0x58')][_0xc078('0x7b')])){throw new db['Sequelize'][(_0xc078('0x73'))](_0xc078('0x7c'));}if(_[_0xc078('0x7a')](_0x1e101f[_0xc078('0x58')]['body'])||_0x1e101f[_0xc078('0x58')][_0xc078('0x58')]===''){throw new db[(_0xc078('0x72'))][(_0xc078('0x73'))](_0xc078('0x7d'));}if(_[_0xc078('0x7a')](_0x1e101f[_0xc078('0x58')][_0xc078('0x7e')])){throw new db[(_0xc078('0x72'))][(_0xc078('0x73'))](_0xc078('0x7f')+_0x3ab760);}if(!_[_0xc078('0x80')](_0x3ab760,_0x1e101f['body'][_0xc078('0x7e')])){throw new db['Sequelize']['ValidationError'](_0xc078('0x81')+_0x3ab760);}_0x127889[_0x1e101f[_0xc078('0x58')]['mapKey']]=_0x1e101f[_0xc078('0x58')]['from'];})[_0xc078('0x34')](function(){return db[_0xc078('0x3d')][_0xc078('0x5d')]({'where':{'id':_0x1e101f['params']['id']},'include':[{'model':db[_0xc078('0x82')],'as':_0xc078('0x83'),'include':[{'model':db[_0xc078('0x71')],'as':_0xc078('0x84'),'where':_0x127889,'limit':0x1,'order':[[_0xc078('0x76'),_0xc078('0x85')]]}]},{'model':db[_0xc078('0x86')],'as':_0xc078('0x87')}]});})[_0xc078('0x34')](handleEntityNotFound(_0x2d5350,null))['then'](function(_0x483b4a){if(_0x483b4a&&_0x483b4a[_0xc078('0x83')]){_0x523ab3[_0xc078('0x88')]=_0x483b4a;_0x523ab3['applications']=_0x483b4a['Applications'];_0x523ab3[_0xc078('0x89')]=_0x483b4a['List'];_0x523ab3[_0xc078('0x8a')]=_[_0xc078('0x8b')](_0x523ab3['applications'],[_0xc078('0x8c')],['asc']);if(_0x523ab3[_0xc078('0x88')][_0xc078('0x87')]){delete _0x523ab3[_0xc078('0x88')][_0xc078('0x87')];}if(_0x523ab3[_0xc078('0x88')][_0xc078('0x83')]&&_0x523ab3[_0xc078('0x88')]['List'][_0xc078('0x84')][_0xc078('0x44')]){return _0x523ab3[_0xc078('0x88')][_0xc078('0x83')][_0xc078('0x84')][0x0];}var _0x7a2dfe=_[_0xc078('0x17')](_0x1e101f['body'],{'firstName':_0x1e101f[_0xc078('0x58')][_0xc078('0x7b')],'ListId':_0x483b4a['ListId']});_0x7a2dfe[_0x1e101f['body'][_0xc078('0x7e')]]=_0x1e101f[_0xc078('0x58')]['from'];return db['CmContact']['create'](_0x7a2dfe,{'fields':_0x46e0b4,'raw':!![]});}})[_0xc078('0x34')](handleEntityNotFound(_0x2d5350,null))['then'](function(_0x41dc46){_0x523ab3[_0xc078('0x8d')]=_0x41dc46;if(_0x41dc46){var _0x2fcf46={'ContactId':_0x41dc46['id'],'OpenchannelAccountId':_0x1e101f[_0xc078('0x53')]['id'],'from':(_0x41dc46[_0xc078('0x8e')]||'')+'\x20'+(_0x41dc46[_0xc078('0x8f')]||'')};var _0x1a2335={'OpenchannelAccountId':_0x1e101f['params']['id'],'closed':![]};if(_0x1e101f[_0xc078('0x58')][_0xc078('0x90')]){_0x1a2335[_0xc078('0x90')]=_0x1e101f['body'][_0xc078('0x90')];return db[_0xc078('0x91')][_0xc078('0x5d')]({'where':_0x1a2335})[_0xc078('0x34')](function(_0x10e79d){if(_0x10e79d){return[_0x10e79d,![]];}_0x2fcf46[_0xc078('0x90')]=_0x1e101f['body']['threadId'];_0x2fcf46[_0xc078('0x92')]=_0x1e101f[_0xc078('0x58')][_0xc078('0x92')];return db[_0xc078('0x91')]['create'](_0x2fcf46)[_0xc078('0x34')](function(_0x3a91aa){return[_0x3a91aa,!![]];});});}else{_0x1a2335[_0xc078('0x90')]=null;}_0x1a2335[_0xc078('0x93')]=_0x41dc46['id'];return db['OpenchannelInteraction'][_0xc078('0x5d')]({'where':_0x1a2335})[_0xc078('0x34')](function(_0x31a331){if(_0x31a331){return[_0x31a331,![]];}return db[_0xc078('0x91')][_0xc078('0x57')](_0x2fcf46)['then'](function(_0x38f813){return[_0x38f813,!![]];});});}})[_0xc078('0x94')](function(_0x467f99,_0x3dd70a){if(_0x467f99){_0x461a56=_0x3dd70a;if(!_0x3dd70a){var _0x3d42c4={'from':(_0x523ab3[_0xc078('0x8d')][_0xc078('0x8e')]||'')+'\x20'+(_0x523ab3[_0xc078('0x8d')]['lastName']||'')};if(_0x1e101f[_0xc078('0x58')][_0xc078('0x90')]&&_0x1e101f['body'][_0xc078('0x95')]&&_0x1e101f['body']['threadId']!=_0x1e101f['body'][_0xc078('0x95')]){_0x3d42c4[_0xc078('0x90')]=_0x1e101f['body'][_0xc078('0x95')];}return _0x467f99[_0xc078('0x33')](_0x3d42c4);}else{return _0x467f99;}}})[_0xc078('0x34')](function(_0x39d06e){_0x523ab3[_0xc078('0x96')]=_0x39d06e['get']({'plain':!![]});_0x523ab3['interaction'][_0xc078('0x97')]=_0x461a56;if(_0x523ab3[_0xc078('0x96')][_0xc078('0x97')]){if(_0x523ab3[_0xc078('0x88')]['autoclose']){_0x523ab3[_0xc078('0x8a')]['push']({'id':0x0,'priority':_0x523ab3[_0xc078('0x8a')][_0xc078('0x44')]+0x1,'app':_0xc078('0x98'),'appdata':_0xc078('0x99'),'interval':_0xc078('0x9a')});}}return db[_0xc078('0x9b')][_0xc078('0x57')]({'body':_0x1e101f[_0xc078('0x58')][_0xc078('0x58')],'OpenchannelAccountId':_0x1e101f[_0xc078('0x53')]['id'],'OpenchannelInteractionId':_0x39d06e['id'],'direction':'in','ContactId':_0x523ab3[_0xc078('0x8d')]['id'],'AttachmentId':_0x1e101f['body'][_0xc078('0x9c')]});})[_0xc078('0x34')](function(_0x5d6764){_0x523ab3[_0xc078('0x26')]=_0x5d6764;if(_0x523ab3['interaction'][_0xc078('0x9d')]){return db[_0xc078('0x9e')][_0xc078('0x5d')]({'attributes':['id',_0xc078('0x39')],'where':{'id':_0x523ab3['interaction'][_0xc078('0x9d')]}})[_0xc078('0x34')](function(_0x5db5a2){if(_0x5db5a2){_0x523ab3[_0xc078('0x8a')][_0xc078('0x9f')]({'id':0x0,'priority':0x0,'app':_0xc078('0xa0'),'appdata':_0x5db5a2[_0xc078('0x39')]+','+(_0x523ab3['account'][_0xc078('0xa1')]||0xa),'interval':'*,*,*,*'});_0x523ab3[_0xc078('0xa2')]=![];}return respondWithRpcPromise(_0xc078('0xa3'),_0xc078('0xa4'),_0x523ab3);});}return respondWithRpcPromise('Start',_0xc078('0xa4'),_0x523ab3);})[_0xc078('0x34')](function(_0x29c51b){respondWithRpcPromise(_0xc078('0xa5'),'EventManager',{'event':_0xc078('0x6f'),'message':_0x29c51b},client9002);return _0x29c51b;})[_0xc078('0x34')](respondWithResult(_0x2d5350,null))[_0xc078('0x28')](handleError(_0x2d5350,null));};exports[_0xc078('0xa6')]=function(_0x2e3244,_0x280cc9,_0x425a09){return db[_0xc078('0x3d')]['findOne']({'where':{'id':_0x2e3244[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x280cc9,null))[_0xc078('0x34')](function(_0x126fe8){if(_0x126fe8){return db[_0xc078('0xa7')]['transaction'](function(_0xa7df90){return db[_0xc078('0x86')][_0xc078('0x35')]({'where':{'OpenchannelAccountId':_0x2e3244['params']['id']},'transaction':_0xa7df90})[_0xc078('0x34')](function(_0xf24d3){var _0x5e16a1=_[_0xc078('0x4c')](_0x2e3244[_0xc078('0x58')],function(_0x31ffb6){_0x31ffb6[_0xc078('0x68')]=_0x2e3244[_0xc078('0x53')]['id'];return _0x31ffb6;});return db[_0xc078('0x86')][_0xc078('0xa8')](_0x5e16a1,{'transaction':_0xa7df90});});})[_0xc078('0x34')](function(){return db[_0xc078('0x86')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2e3244[_0xc078('0x53')]['id']},'order':_0xc078('0x8c')});});}})['then'](respondWithResult(_0x280cc9,null))[_0xc078('0x28')](handleError(_0x280cc9,null));};exports[_0xc078('0xa9')]=function(_0x58e14d,_0x389bf6,_0x2a3d4c){var _0xf1986b={};var _0x26ac05={};var _0xe05047;var _0x4b3150;return db['OpenchannelAccount'][_0xc078('0x65')]({'where':{'id':_0x58e14d[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x389bf6,null))[_0xc078('0x34')](function(_0x13b2d7){if(_0x13b2d7){_0xe05047=_0x13b2d7;_0x26ac05[_0xc078('0x40')]=_[_0xc078('0x3e')](db[_0xc078('0x86')][_0xc078('0x54')]);_0x26ac05[_0xc078('0x45')]=_[_0xc078('0x3e')](_0x58e14d['query']);_0x26ac05['filters']=_[_0xc078('0x41')](_0x26ac05[_0xc078('0x40')],_0x26ac05['query']);_0xf1986b['attributes']=_[_0xc078('0x41')](_0x26ac05[_0xc078('0x40')],qs['fields'](_0x58e14d[_0xc078('0x45')][_0xc078('0x42')]));_0xf1986b[_0xc078('0x43')]=_0xf1986b[_0xc078('0x43')][_0xc078('0x44')]?_0xf1986b['attributes']:_0x26ac05[_0xc078('0x40')];_0xf1986b['order']=qs[_0xc078('0x48')](_0x58e14d[_0xc078('0x45')]['sort']);_0xf1986b['where']=qs[_0xc078('0x3f')](_['pick'](_0x58e14d[_0xc078('0x45')],_0x26ac05[_0xc078('0x3f')]));if(_0x58e14d['query'][_0xc078('0x49')]){_0xf1986b[_0xc078('0x4b')]=_[_0xc078('0x4a')](_0xf1986b[_0xc078('0x4b')],{'$or':_[_0xc078('0x4c')](_0xf1986b['attributes'],function(_0x25d1b2){var _0x26f695={};_0x26f695[_0x25d1b2]={'$like':'%'+_0x58e14d[_0xc078('0x45')]['filter']+'%'};return _0x26f695;})});}_0xf1986b=_[_0xc078('0x4a')]({},_0xf1986b,_0x58e14d[_0xc078('0x56')]);return _0xe05047['getApplications'](_0xf1986b);}})[_0xc078('0x34')](function(_0x57314a){if(_0x57314a){_0x4b3150=_0x57314a[_0xc078('0x44')];if(!_0x58e14d[_0xc078('0x45')][_0xc078('0x46')](_0xc078('0x66'))){_0xf1986b[_0xc078('0x2e')]=qs[_0xc078('0x2e')](_0x58e14d[_0xc078('0x45')]['limit']);_0xf1986b['offset']=qs[_0xc078('0x2d')](_0x58e14d[_0xc078('0x45')]['offset']);}return _0xe05047['getApplications'](_0xf1986b);}})[_0xc078('0x34')](function(_0x38f4db){if(_0x38f4db){return _0x38f4db?{'count':_0x4b3150,'rows':_0x38f4db}:null;}})[_0xc078('0x34')](respondWithResult(_0x389bf6,null))[_0xc078('0x28')](handleError(_0x389bf6,null));};exports[_0xc078('0xaa')]=function(_0x52dd92,_0x30a5ea,_0x2d30c9){var _0x1c5ffc={'raw':![],'where':{}};var _0x5eab3c={};var _0x1cfe74={'count':0x0,'rows':[]};return db[_0xc078('0x3d')][_0xc078('0x65')]({'where':{'id':_0x52dd92['params']['id']}})['then'](handleEntityNotFound(_0x30a5ea,null))[_0xc078('0x34')](function(_0x29a482){if(_0x29a482){_0x5eab3c[_0xc078('0x40')]=_['keys'](db[_0xc078('0x91')]['rawAttributes']);_0x5eab3c[_0xc078('0x45')]=_['keys'](_0x52dd92[_0xc078('0x45')]);_0x5eab3c[_0xc078('0x3f')]=_['intersection'](_0x5eab3c[_0xc078('0x40')],_0x5eab3c[_0xc078('0x45')]);_0x1c5ffc[_0xc078('0x43')]=_[_0xc078('0x41')](_0x5eab3c['model'],qs['fields'](_0x52dd92[_0xc078('0x45')]['fields']));_0x1c5ffc[_0xc078('0x43')]=_0x1c5ffc['attributes'][_0xc078('0x44')]?_0x1c5ffc[_0xc078('0x43')]:_0x5eab3c[_0xc078('0x40')];if(!_0x52dd92[_0xc078('0x45')]['hasOwnProperty'](_0xc078('0x66'))){_0x1c5ffc['limit']=qs['limit'](_0x52dd92[_0xc078('0x45')][_0xc078('0x2e')]);_0x1c5ffc[_0xc078('0x2d')]=qs[_0xc078('0x2d')](_0x52dd92[_0xc078('0x45')][_0xc078('0x2d')]);}_0x1c5ffc[_0xc078('0x47')]=qs[_0xc078('0x48')](_0x52dd92[_0xc078('0x45')]['sort']);_0x1c5ffc[_0xc078('0x4b')]=qs['filters'](_[_0xc078('0x67')](_0x52dd92[_0xc078('0x45')],_0x5eab3c[_0xc078('0x3f')]));_0x1c5ffc[_0xc078('0x4b')][_0xc078('0x68')]=_0x29a482['id'];if(_0x52dd92[_0xc078('0x45')][_0xc078('0x49')]){_0x1c5ffc[_0xc078('0x4b')]=_[_0xc078('0x4a')](_0x1c5ffc[_0xc078('0x4b')],{'$or':_['map'](_0x1c5ffc[_0xc078('0x43')],function(_0x25a5f4){var _0x1b9a1f={};_0x1b9a1f[_0x25a5f4]={'$like':'%'+_0x52dd92[_0xc078('0x45')][_0xc078('0x49')]+'%'};return _0x1b9a1f;})});}_0x1c5ffc=_[_0xc078('0x4a')]({},_0x1c5ffc,_0x52dd92[_0xc078('0x56')]);return db['OpenchannelInteraction'][_0xc078('0x2c')]({'where':_0x1c5ffc[_0xc078('0x4b')]})[_0xc078('0x34')](function(_0x3a061f){_0x1cfe74[_0xc078('0x2c')]=_0x3a061f;if(_0x52dd92[_0xc078('0x45')][_0xc078('0x50')]){_0x1c5ffc[_0xc078('0x55')]=[{'model':db[_0xc078('0x71')],'as':'Contact','required':![]},{'model':db[_0xc078('0x9e')],'as':_0xc078('0xab'),'attributes':['name',_0xc078('0xac'),_0xc078('0xad')],'required':![]},{'model':db[_0xc078('0xae')],'as':_0xc078('0xaf'),'attributes':['id',_0xc078('0x39'),_0xc078('0xb0')],'where':_0x52dd92[_0xc078('0x45')][_0xc078('0xb1')]?{'id':_0x52dd92[_0xc078('0x45')][_0xc078('0xb1')]}:undefined,'required':_0x52dd92[_0xc078('0x45')][_0xc078('0xb1')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xc078('0x51')](_0x1c5ffc);})[_0xc078('0x34')](function(_0xd7fcb6){_0x1cfe74['rows']=_0xd7fcb6;return _0x1cfe74;});}})[_0xc078('0x34')](respondWithFilteredResult(_0x30a5ea,_0x1c5ffc))[_0xc078('0x28')](handleError(_0x30a5ea,null));};exports[_0xc078('0xb2')]=function(_0xfbea24,_0x3807b6,_0x36055d){return db[_0xc078('0x3d')][_0xc078('0x5d')]({'where':{'id':_0xfbea24[_0xc078('0x53')]['id']}})['then'](handleEntityNotFound(_0x3807b6,null))['then'](function(_0x1188da){if(_0x1188da){return _0x1188da['addAgents'](_0xfbea24[_0xc078('0x58')][_0xc078('0x6b')],_[_0xc078('0xb3')](_0xfbea24[_0xc078('0x58')],['ids','id'])||{})[_0xc078('0x94')](function(_0x528bab){for(var _0x1dac3a=0x0;_0x1dac3a<_0xfbea24['body']['ids'][_0xc078('0x44')];_0x1dac3a+=0x1){socket['emit'](_0xc078('0xb4'),{'UserId':_0xfbea24[_0xc078('0x58')]['ids'][_0x1dac3a],'OpenchannelAccountId':_0xfbea24['params']['id']});}return _0x528bab;});}})[_0xc078('0x34')](respondWithResult(_0x3807b6,null))[_0xc078('0x28')](handleError(_0x3807b6,null));};exports[_0xc078('0xb5')]=function(_0x9b3d1c,_0x38b39c,_0x44c29e){var _0x39e08c;return db['OpenchannelAccount'][_0xc078('0x5d')]({'where':{'id':_0x9b3d1c[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x38b39c,null))['then'](function(_0x2755bf){if(_0x2755bf){return _0x2755bf['removeAgents'](_0x9b3d1c[_0xc078('0x45')][_0xc078('0x6b')])['then'](function(_0x4d1430){if(_[_0xc078('0xb6')](_0x9b3d1c[_0xc078('0x45')][_0xc078('0x6b')])){for(var _0x3a37d8=0x0;_0x3a37d8<_0x9b3d1c['query'][_0xc078('0x6b')][_0xc078('0x44')];_0x3a37d8+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':_0x9b3d1c['query']['ids'][_0x3a37d8],'OpenchannelAccountId':_0x9b3d1c['params']['id']});}}else{socket[_0xc078('0xb7')]('userOpenchannelAccount:remove',{'UserId':_0x9b3d1c['query'][_0xc078('0x6b')],'OpenchannelAccountId':_0x9b3d1c['params']['id']});}});}})['then'](respondWithStatusCode(_0x38b39c,null))[_0xc078('0x28')](handleError(_0x38b39c,null));};exports[_0xc078('0xb8')]=function(_0x355d25,_0x24d500,_0x4ae5e2){var _0x109e2b={};var _0x481853={};var _0x52ba99;var _0x31f8fa;return db[_0xc078('0x3d')][_0xc078('0x65')]({'where':{'id':_0x355d25[_0xc078('0x53')]['id']}})['then'](handleEntityNotFound(_0x24d500,null))['then'](function(_0x19d7ca){if(_0x19d7ca){_0x52ba99=_0x19d7ca;_0x481853[_0xc078('0x40')]=_[_0xc078('0x3e')](db[_0xc078('0x9e')][_0xc078('0x54')]);_0x481853[_0xc078('0x45')]=_[_0xc078('0x3e')](_0x355d25['query']);_0x481853[_0xc078('0x3f')]=_[_0xc078('0x41')](_0x481853['model'],_0x481853['query']);_0x109e2b['attributes']=_[_0xc078('0x41')](_0x481853['model'],qs[_0xc078('0x42')](_0x355d25[_0xc078('0x45')][_0xc078('0x42')]));_0x109e2b[_0xc078('0x43')]=_0x109e2b[_0xc078('0x43')][_0xc078('0x44')]?_0x109e2b[_0xc078('0x43')]:_0x481853[_0xc078('0x40')];_0x109e2b[_0xc078('0x47')]=qs[_0xc078('0x48')](_0x355d25[_0xc078('0x45')][_0xc078('0x48')]);_0x109e2b[_0xc078('0x4b')]=qs[_0xc078('0x3f')](_[_0xc078('0x67')](_0x355d25['query'],_0x481853[_0xc078('0x3f')]));if(_0x355d25[_0xc078('0x45')][_0xc078('0x49')]){_0x109e2b[_0xc078('0x4b')]=_[_0xc078('0x4a')](_0x109e2b[_0xc078('0x4b')],{'$or':_['map'](_0x109e2b['attributes'],function(_0xd9986e){var _0x27af83={};_0x27af83[_0xd9986e]={'$like':'%'+_0x355d25[_0xc078('0x45')][_0xc078('0x49')]+'%'};return _0x27af83;})});}_0x109e2b=_['merge']({},_0x109e2b,_0x355d25['options']);return _0x52ba99[_0xc078('0xb8')](_0x109e2b);}})[_0xc078('0x34')](function(_0x54887b){if(_0x54887b){_0x31f8fa=_0x54887b[_0xc078('0x44')];if(!_0x355d25['query'][_0xc078('0x46')](_0xc078('0x66'))){_0x109e2b[_0xc078('0x2e')]=qs['limit'](_0x355d25[_0xc078('0x45')][_0xc078('0x2e')]);_0x109e2b[_0xc078('0x2d')]=qs['offset'](_0x355d25[_0xc078('0x45')]['offset']);}return _0x52ba99[_0xc078('0xb8')](_0x109e2b);}})[_0xc078('0x34')](function(_0x3cf997){if(_0x3cf997){return _0x3cf997?{'count':_0x31f8fa,'rows':_0x3cf997}:null;}})[_0xc078('0x34')](respondWithResult(_0x24d500,null))[_0xc078('0x28')](handleError(_0x24d500,null));};exports[_0xc078('0x3a')]=function(_0x382aec,_0x4209a6,_0x133dcd){var _0x2ebf1c,_0x5aa9d1,_0x3e394e;if(_['isNil'](_0x382aec[_0xc078('0x58')][_0xc078('0x58')])||_0x382aec[_0xc078('0x58')][_0xc078('0x58')]===''){throw new db[(_0xc078('0x72'))][(_0xc078('0x73'))](_0xc078('0x7d'));}if(_[_0xc078('0x7a')](_0x382aec[_0xc078('0x58')]['to'])){}_0x2ebf1c=_0x382aec[_0xc078('0x58')]['to'];return db[_0xc078('0x3d')][_0xc078('0x65')]({'where':{'id':_0x382aec[_0xc078('0x53')]['id']}})[_0xc078('0x34')](handleEntityNotFound(_0x4209a6,null))[_0xc078('0x34')](function(_0x2a337d){if(_0x2a337d){return db[_0xc078('0x3d')][_0xc078('0x5d')]({'where':{'id':_0x2a337d['id']},'include':[{'model':db[_0xc078('0x82')],'as':_0xc078('0x83'),'include':[{'model':db[_0xc078('0x71')],'as':'Contacts','where':{[_0x2a337d[_0xc078('0x7e')]]:_0x2ebf1c},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xc078('0x34')](handleEntityNotFound(_0x4209a6,null))[_0xc078('0x34')](function(_0xea4d3){if(_0xea4d3&&_0xea4d3[_0xc078('0x83')]){_0x5aa9d1=_0xea4d3[_0xc078('0x36')]({'plain':!![]});if(_0x5aa9d1['List']&&_0x5aa9d1[_0xc078('0x83')][_0xc078('0x84')][_0xc078('0x44')]){return _0x5aa9d1[_0xc078('0x83')][_0xc078('0x84')][0x0];}return db[_0xc078('0x71')]['create'](_['defaults'](_0x382aec[_0xc078('0x58')],{'firstName':_0x2ebf1c,[_0xea4d3[_0xc078('0x7e')]]:_0x2ebf1c,'phone':_0x2ebf1c,'ListId':_0x5aa9d1[_0xc078('0x79')]}));}})[_0xc078('0x34')](handleEntityNotFound(_0x4209a6,null))['then'](function(_0x4baf27){if(_0x4baf27){_0x3e394e=_0x4baf27;return db[_0xc078('0x91')]['find']({'where':{'ContactId':_0x3e394e['id'],'closed':![],'OpenchannelAccountId':_0x5aa9d1['id']}})[_0xc078('0x34')](function(_0x22b364){if(_0x22b364){return[_0x22b364,![]];}return db[_0xc078('0x91')]['create']({'UserId':_0x382aec[_0xc078('0x59')]['id'],'ContactId':_0x3e394e['id'],'OpenchannelAccountId':_0x5aa9d1['id'],'lastMsgDirection':_0xc078('0xb9'),'Messages':[_['merge'](_0x382aec['body'],{'read':![],'body':_0x382aec[_0xc078('0x58')][_0xc078('0x58')],'OpenchannelAccountId':_0x5aa9d1['id'],'UserId':_0x382aec['user']['id'],'ContactId':_0x3e394e['id']})]},{'include':[{'model':db[_0xc078('0x9b')],'as':_0xc078('0xba')}]})[_0xc078('0x34')](function(_0x298327){return[_0x298327,!![]];});});}})[_0xc078('0x94')](function(_0x289077,_0x1016ca){if(_0x1016ca){return _0x289077;}return db['OpenchannelMessage'][_0xc078('0x57')](_[_0xc078('0x4a')](_0x382aec[_0xc078('0x58')],{'read':![],'body':_0x382aec[_0xc078('0x58')][_0xc078('0x58')],'OpenchannelAccountId':_0x5aa9d1['id'],'OpenchannelInteractionId':_0x289077['id'],'UserId':_0x382aec['user']['id'],'ContactId':_0x3e394e['id']}))[_0xc078('0x34')](function(_0x2ae8ff){_0x289077[_0xc078('0xbb')][_0xc078('0xba')]=[];_0x289077[_0xc078('0xbb')]['Messages']['push'](_0x2ae8ff[_0xc078('0xbb')]);return _0x289077;});});}})[_0xc078('0x34')](respondWithResult(_0x4209a6,null))[_0xc078('0x28')](handleError(_0x4209a6,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 32659ad..f1c7bc0 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 _0x3d7e=['save','update','remove','emit','hasOwnProperty','exports','events','OpenchannelAccount'];(function(_0x20236b,_0x4ed824){var _0x54943f=function(_0x5d7dc7){while(--_0x5d7dc7){_0x20236b['push'](_0x20236b['shift']());}};_0x54943f(++_0x4ed824);}(_0x3d7e,0x1ae));var _0xe3d7=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0x3d7e[_0x10e983];return _0x324138;};'use strict';var EventEmitter=require(_0xe3d7('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xe3d7('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe3d7('0x2'),'afterUpdate':_0xe3d7('0x3'),'afterDestroy':_0xe3d7('0x4')};function emitEvent(_0x3a97bf){return function(_0x492780,_0x2f0638,_0x551b1d){OpenchannelAccountEvents[_0xe3d7('0x5')](_0x3a97bf+':'+_0x492780['id'],_0x492780);OpenchannelAccountEvents[_0xe3d7('0x5')](_0x3a97bf,_0x492780);_0x551b1d(null);};}for(var e in events){if(events[_0xe3d7('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xe3d7('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x3fef=['remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners','update'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x3fef,0xbd));var _0xf3fe=function(_0x35f9da,_0xa746b3){_0x35f9da=_0x35f9da-0x0;var _0x1b38d6=_0x3fef[_0x35f9da];return _0x1b38d6;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xf3fe('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf3fe('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf3fe('0x2'),'afterDestroy':_0xf3fe('0x3')};function emitEvent(_0x1eae33){return function(_0x15a5a5,_0x6a3795,_0xc262c0){OpenchannelAccountEvents[_0xf3fe('0x4')](_0x1eae33+':'+_0x15a5a5['id'],_0x15a5a5);OpenchannelAccountEvents[_0xf3fe('0x4')](_0x1eae33,_0x15a5a5);_0xc262c0(null);};}for(var e in events){if(events[_0xf3fe('0x5')](e)){var event=events[e];OpenchannelAccount[_0xf3fe('0x6')](e,emitEvent(event));}}module[_0xf3fe('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 661d049..cdc6991 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 _0xda3f=['define','OpenchannelAccount','util','../../config/logger','request-promise','exports'];(function(_0x46b0ba,_0x5a767c){var _0x2e53e0=function(_0x124fb2){while(--_0x124fb2){_0x46b0ba['push'](_0x46b0ba['shift']());}};_0x2e53e0(++_0x5a767c);}(_0xda3f,0xec));var _0xfda3=function(_0x20c673,_0x38cbe2){_0x20c673=_0x20c673-0x0;var _0x338f25=_0xda3f[_0x20c673];return _0x338f25;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var attributes=require('./openchannelAccount.attributes');module[_0xfda3('0x3')]=function(_0x22187d,_0x516500){return _0x22187d[_0xfda3('0x4')](_0xfda3('0x5'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0x62c363,_0x56854f){var _0xb210d0=function(_0x2e7564){while(--_0x2e7564){_0x62c363['push'](_0x62c363['shift']());}};_0xb210d0(++_0x56854f);}(_0xe706,0xa3));var _0x6e70=function(_0x24403d,_0x94ebf1){_0x24403d=_0x24403d-0x0;var _0x3fabf3=_0xe706[_0x24403d];return _0x3fabf3;};'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 attributes=require(_0x6e70('0x6'));module[_0x6e70('0x7')]=function(_0x2164a4,_0x376a8d){return _0x2164a4[_0x6e70('0x8')](_0x6e70('0x9'),attributes,{'tableName':_0x6e70('0xa'),'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 81fce9a..a633faf 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(_0x245578,_0x317768){var _0x2d09d6=function(_0x53630a){while(--_0x53630a){_0x245578['push'](_0x245578['shift']());}};_0x2d09d6(++_0x317768);}(_0xe14b,0x93));var _0xbe14=function(_0x1838cf,_0x31d16a){_0x1838cf=_0x1838cf-0x0;var _0x4862d9=_0xe14b[_0x1838cf];return _0x4862d9;};'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 _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x121237,_0x156bd6){var _0x5b4514=function(_0x1cab4a){while(--_0x1cab4a){_0x121237['push'](_0x121237['shift']());}};_0x5b4514(++_0x156bd6);}(_0x814b,0x1a2));var _0xb814=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x814b[_0x28f32c];return _0x355402;};'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});config[_0xb814('0xc')]=_[_0xb814('0xd')](config['redis'],{'host':_0xb814('0xe'),'port':0x18eb});var socket=require(_0xb814('0xf'))(new Redis(config[_0xb814('0xc')]));require(_0xb814('0x10'))[_0xb814('0x11')](socket);function respondWithRpcPromise(_0x21d4a5,_0x1086f8,_0x19aad8){return new BPromise(function(_0x207dbc,_0x3450f2){return client[_0xb814('0x12')](_0x21d4a5,_0x19aad8)['then'](function(_0x43dfe6){logger['info'](_0xb814('0x13'),_0x1086f8,_0xb814('0x14'));logger[_0xb814('0x15')](_0xb814('0x16'),_0x1086f8,_0xb814('0x14'),JSON[_0xb814('0x17')](_0x43dfe6));if(_0x43dfe6[_0xb814('0x18')]){if(_0x43dfe6[_0xb814('0x18')][_0xb814('0x19')]===0x1f4){logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x3450f2(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x207dbc(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}else{logger['info'](_0xb814('0x13'),_0x1086f8,'request\x20sent');_0x207dbc(_0x43dfe6[_0xb814('0x1b')][_0xb814('0x1a')]);}})['catch'](function(_0x4b55a7){logger['error'](_0xb814('0x13'),_0x1086f8,_0x4b55a7);_0x3450f2(_0x4b55a7);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 7c6b433..592faa2 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 _0x1985=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit'];(function(_0x46d90a,_0x3b3e62){var _0x143941=function(_0x436098){while(--_0x436098){_0x46d90a['push'](_0x46d90a['shift']());}};_0x143941(++_0x3b3e62);}(_0x1985,0xd4));var _0x5198=function(_0x381cdb,_0x9cd80b){_0x381cdb=_0x381cdb-0x0;var _0x9e4dbd=_0x1985[_0x381cdb];return _0x9e4dbd;};'use strict';var OpenchannelAccountEvents=require(_0x5198('0x0'));var events=[_0x5198('0x1'),'remove',_0x5198('0x2')];function createListener(_0x499149,_0x12e54a){return function(_0xa73dcb){_0x12e54a[_0x5198('0x3')](_0x499149,_0xa73dcb);};}function removeListener(_0x1caa1b,_0x51faf7){return function(){OpenchannelAccountEvents[_0x5198('0x4')](_0x1caa1b,_0x51faf7);};}exports[_0x5198('0x5')]=function(_0x135de2){for(var _0x1b81d1=0x0,_0x5c1cf3=events[_0x5198('0x6')];_0x1b81d1<_0x5c1cf3;_0x1b81d1++){var _0x1b286e=events[_0x1b81d1];var _0x2498e7=createListener(_0x5198('0x7')+_0x1b286e,_0x135de2);OpenchannelAccountEvents['on'](_0x1b286e,_0x2498e7);}}; \ No newline at end of file +var _0xcd51=['remove','update','emit','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x328b9b,_0x13082a){var _0x3a2d51=function(_0x63002b){while(--_0x63002b){_0x328b9b['push'](_0x328b9b['shift']());}};_0x3a2d51(++_0x13082a);}(_0xcd51,0x102));var _0x1cd5=function(_0x40dc6f,_0x464eae){_0x40dc6f=_0x40dc6f-0x0;var _0x204db1=_0xcd51[_0x40dc6f];return _0x204db1;};'use strict';var OpenchannelAccountEvents=require(_0x1cd5('0x0'));var events=['save',_0x1cd5('0x1'),_0x1cd5('0x2')];function createListener(_0xd7b801,_0x2472bb){return function(_0x68999c){_0x2472bb[_0x1cd5('0x3')](_0xd7b801,_0x68999c);};}function removeListener(_0x14179e,_0x1e8d98){return function(){OpenchannelAccountEvents['removeListener'](_0x14179e,_0x1e8d98);};}exports[_0x1cd5('0x4')]=function(_0x7f2c9f){for(var _0x256bb7=0x0,_0x574d3f=events[_0x1cd5('0x5')];_0x256bb7<_0x574d3f;_0x256bb7++){var _0x505fcf=events[_0x256bb7];var _0x1fe8fe=createListener(_0x1cd5('0x6')+_0x505fcf,_0x7f2c9f);OpenchannelAccountEvents['on'](_0x505fcf,_0x1fe8fe);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index ec2a6dd..b22707e 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 _0xcb62=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','post','create','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x54a479,_0x1b321d){var _0x2474ab=function(_0x428755){while(--_0x428755){_0x54a479['push'](_0x54a479['shift']());}};_0x2474ab(++_0x1b321d);}(_0xcb62,0x186));var _0x2cb6=function(_0x24df26,_0x21beb2){_0x24df26=_0x24df26-0x0;var _0x4ed362=_0xcb62[_0x24df26];return _0x4ed362;};'use strict';var multer=require(_0x2cb6('0x0'));var util=require(_0x2cb6('0x1'));var path=require(_0x2cb6('0x2'));var timeout=require(_0x2cb6('0x3'));var express=require(_0x2cb6('0x4'));var router=express[_0x2cb6('0x5')]();var auth=require(_0x2cb6('0x6'));var interaction=require(_0x2cb6('0x7'));var config=require(_0x2cb6('0x8'));var controller=require(_0x2cb6('0x9'));router[_0x2cb6('0xa')]('/',auth['isAuthenticated'](),controller[_0x2cb6('0xb')]);router[_0x2cb6('0xa')](_0x2cb6('0xc'),auth[_0x2cb6('0xd')](),controller[_0x2cb6('0xe')]);router[_0x2cb6('0xf')]('/',auth[_0x2cb6('0xd')](),controller[_0x2cb6('0x10')]);router['put'](_0x2cb6('0xc'),auth[_0x2cb6('0xd')](),controller['update']);router[_0x2cb6('0x11')](_0x2cb6('0xc'),auth[_0x2cb6('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb90f=['index','/:id','post','create','put','destroy','exports','util','path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x266ddc,_0x45aa52){var _0x39c1d7=function(_0x4cd07c){while(--_0x4cd07c){_0x266ddc['push'](_0x266ddc['shift']());}};_0x39c1d7(++_0x45aa52);}(_0xb90f,0x157));var _0xfb90=function(_0x4aacc8,_0x10c6a2){_0x4aacc8=_0x4aacc8-0x0;var _0x5ce7fa=_0xb90f[_0x4aacc8];return _0x5ce7fa;};'use strict';var multer=require('multer');var util=require(_0xfb90('0x0'));var path=require(_0xfb90('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfb90('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xfb90('0x3'));var config=require(_0xfb90('0x4'));var controller=require('./openchannelApplication.controller');router[_0xfb90('0x5')]('/',auth[_0xfb90('0x6')](),controller[_0xfb90('0x7')]);router[_0xfb90('0x5')](_0xfb90('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xfb90('0x9')]('/',auth[_0xfb90('0x6')](),controller[_0xfb90('0xa')]);router[_0xfb90('0xb')](_0xfb90('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfb90('0x8'),auth[_0xfb90('0x6')](),controller[_0xfb90('0xc')]);module[_0xfb90('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 a0ba542..6378ff0 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 _0x129f=['STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x422a0e,_0x535aca){var _0x1c1e44=function(_0x6d835c){while(--_0x6d835c){_0x422a0e['push'](_0x422a0e['shift']());}};_0x1c1e44(++_0x535aca);}(_0x129f,0x13f));var _0xf129=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x129f[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0xf129('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf129('0x1')],'allowNull':![],'defaultValue':_0xf129('0x2')},'appdata':{'type':Sequelize[_0xf129('0x3')]()},'description':{'type':Sequelize[_0xf129('0x1')]},'interval':{'type':Sequelize[_0xf129('0x1')],'defaultValue':_0xf129('0x4')}}; \ No newline at end of file +var _0x0257=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x0257,0x1db));var _0x7025=function(_0xc8023,_0xd1912){_0xc8023=_0xc8023-0x0;var _0x448b50=_0x0257[_0xc8023];return _0x448b50;};'use strict';var Sequelize=require('sequelize');module[_0x7025('0x0')]={'priority':{'type':Sequelize[_0x7025('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7025('0x2')],'allowNull':![],'defaultValue':_0x7025('0x3')},'appdata':{'type':Sequelize[_0x7025('0x4')]()},'description':{'type':Sequelize[_0x7025('0x2')]},'interval':{'type':Sequelize[_0x7025('0x2')],'defaultValue':_0x7025('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 2050a13..c4bb09e 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 _0x30ec=['type','VIRTUAL','field','count','includeAll','include','params','keys','rawAttributes','options','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','OpenchannelApplication','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge'];(function(_0x5ba8a7,_0x2b90eb){var _0x2f748b=function(_0x1ccba6){while(--_0x1ccba6){_0x5ba8a7['push'](_0x5ba8a7['shift']());}};_0x2f748b(++_0x2b90eb);}(_0x30ec,0x96));var _0xc30e=function(_0x3896ea,_0x489972){_0x3896ea=_0x3896ea-0x0;var _0x3527bf=_0x30ec[_0x3896ea];return _0x3527bf;};'use strict';var pdf=require(_0xc30e('0x0'));var emlformat=require(_0xc30e('0x1'));var rimraf=require(_0xc30e('0x2'));var zipdir=require(_0xc30e('0x3'));var jsonpatch=require(_0xc30e('0x4'));var rp=require('request-promise');var moment=require(_0xc30e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc30e('0x6'));var path=require(_0xc30e('0x7'));var sox=require('sox');var csv=require(_0xc30e('0x8'));var ejs=require(_0xc30e('0x9'));var fs=require('fs');var _=require(_0xc30e('0xa'));var squel=require(_0xc30e('0xb'));var crypto=require(_0xc30e('0xc'));var jsforce=require(_0xc30e('0xd'));var deskjs=require(_0xc30e('0xe'));var toCsv=require(_0xc30e('0x8'));var querystring=require(_0xc30e('0xf'));var Papa=require(_0xc30e('0x10'));var authService=require(_0xc30e('0x11'));var hardwareService=require(_0xc30e('0x12'));var Redis=require(_0xc30e('0x13'));var qs=require(_0xc30e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc30e('0x15'));var config=require(_0xc30e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55f3e2,_0x1ac1a4){_0x1ac1a4=_0x1ac1a4||0xcc;return function(_0x53cd8d){if(_0x53cd8d){return _0x55f3e2[_0xc30e('0x17')](_0x1ac1a4);}return _0x55f3e2[_0xc30e('0x18')](_0x1ac1a4)[_0xc30e('0x19')]();};}function respondWithResult(_0xef3ddf,_0x418276){_0x418276=_0x418276||0xc8;return function(_0x2cf40c){if(_0x2cf40c){return _0xef3ddf[_0xc30e('0x18')](_0x418276)[_0xc30e('0x1a')](_0x2cf40c);}};}function respondWithFilteredResult(_0x4248ad,_0x4dabb9){return function(_0x355e23){if(_0x355e23){var _0x4ea6e9=_0x355e23['count'],_0x10ff8d=_0x4dabb9[_0xc30e('0x1b')],_0x32bcff=_0x4dabb9['offset']+_0x4dabb9['limit'],_0x28a5c8;if(_0x32bcff>=_0x4ea6e9){_0x32bcff=_0x4ea6e9;_0x28a5c8=0xc8;}else{_0x28a5c8=0xce;}_0x4248ad[_0xc30e('0x18')](_0x28a5c8);return _0x4248ad[_0xc30e('0x1c')](_0xc30e('0x1d'),_0x10ff8d+'-'+_0x32bcff+'/'+_0x4ea6e9)[_0xc30e('0x1a')](_0x355e23);}return null;};}function patchUpdates(_0x2723ca){return function(_0x2e8c94){try{jsonpatch[_0xc30e('0x1e')](_0x2e8c94,_0x2723ca,!![]);}catch(_0xbb357b){return BPromise[_0xc30e('0x1f')](_0xbb357b);}return _0x2e8c94[_0xc30e('0x20')]();};}function saveUpdates(_0x1070a5,_0x4f995c){return function(_0x517ca4){if(_0x517ca4){return _0x517ca4['update'](_0x1070a5)[_0xc30e('0x21')](function(_0x1ceba6){return _0x1ceba6;});}return null;};}function removeEntity(_0x455b1d,_0x1289c8){return function(_0x437740){if(_0x437740){return _0x437740[_0xc30e('0x22')]()[_0xc30e('0x21')](function(){_0x455b1d['status'](0xcc)[_0xc30e('0x19')]();});}};}function handleEntityNotFound(_0xe5e13,_0x141143){return function(_0x41d9ad){if(!_0x41d9ad){_0xe5e13[_0xc30e('0x17')](0x194);}return _0x41d9ad;};}function handleError(_0x4c8a09,_0x17d5eb){_0x17d5eb=_0x17d5eb||0x1f4;return function(_0x10b869){logger[_0xc30e('0x23')](_0x10b869[_0xc30e('0x24')]);if(_0x10b869[_0xc30e('0x25')]){delete _0x10b869[_0xc30e('0x25')];}_0x4c8a09[_0xc30e('0x18')](_0x17d5eb)['send'](_0x10b869);};}exports[_0xc30e('0x26')]=function(_0x559ace,_0x386e60){var _0x31c227={},_0x1efe4e={},_0x470bf4={'count':0x0,'rows':[]};var _0x26890e=db[_0xc30e('0x27')]['rawAttributes'];_0x1efe4e[_0xc30e('0x28')]=_['keys'](_0x26890e);_0x1efe4e[_0xc30e('0x29')]=_['keys'](_0x559ace[_0xc30e('0x29')]);_0x1efe4e[_0xc30e('0x2a')]=_[_0xc30e('0x2b')](_0x1efe4e['model'],_0x1efe4e[_0xc30e('0x29')]);_0x31c227[_0xc30e('0x2c')]=_[_0xc30e('0x2b')](_0x1efe4e['model'],qs[_0xc30e('0x2d')](_0x559ace['query'][_0xc30e('0x2d')]));_0x31c227[_0xc30e('0x2c')]=_0x31c227[_0xc30e('0x2c')][_0xc30e('0x2e')]?_0x31c227[_0xc30e('0x2c')]:_0x1efe4e[_0xc30e('0x28')];if(!_0x559ace['query'][_0xc30e('0x2f')](_0xc30e('0x30'))){_0x31c227[_0xc30e('0x31')]=qs[_0xc30e('0x31')](_0x559ace[_0xc30e('0x29')][_0xc30e('0x31')]);_0x31c227['offset']=qs[_0xc30e('0x1b')](_0x559ace[_0xc30e('0x29')][_0xc30e('0x1b')]);}_0x31c227[_0xc30e('0x32')]=qs['sort'](_0x559ace[_0xc30e('0x29')]['sort']);_0x31c227[_0xc30e('0x33')]=qs['filters'](_[_0xc30e('0x34')](_0x559ace[_0xc30e('0x29')],_0x1efe4e[_0xc30e('0x2a')]));if(_0x559ace[_0xc30e('0x29')]['filter']){_0x31c227[_0xc30e('0x33')]=_[_0xc30e('0x35')](_0x31c227['where'],{'$or':_['map'](_0x26890e,function(_0x3abac2){if(_0x3abac2[_0xc30e('0x36')]['key']!==_0xc30e('0x37')){var _0x185075={};_0x185075[_0x3abac2[_0xc30e('0x38')]]={'$like':'%'+_0x559ace['query']['filter']+'%'};return _0x185075;}})});}_0x31c227=_['merge']({},_0x31c227,_0x559ace['options']);var _0x776d4f={'where':_0x31c227['where']};return db[_0xc30e('0x27')][_0xc30e('0x39')](_0x776d4f)['then'](function(_0x516874){_0x470bf4[_0xc30e('0x39')]=_0x516874;if(_0x559ace['query'][_0xc30e('0x3a')]){_0x31c227[_0xc30e('0x3b')]=[{'all':!![]}];}return db[_0xc30e('0x27')]['findAll'](_0x31c227);})[_0xc30e('0x21')](function(_0x2c0773){_0x470bf4['rows']=_0x2c0773;return _0x470bf4;})[_0xc30e('0x21')](respondWithFilteredResult(_0x386e60,_0x31c227))['catch'](handleError(_0x386e60,null));};exports['show']=function(_0x363cc3,_0x19e321){var _0x1c3f12={'raw':!![],'where':{'id':_0x363cc3[_0xc30e('0x3c')]['id']}},_0x3f7a20={};_0x3f7a20[_0xc30e('0x28')]=_[_0xc30e('0x3d')](db['OpenchannelApplication'][_0xc30e('0x3e')]);_0x3f7a20[_0xc30e('0x29')]=_[_0xc30e('0x3d')](_0x363cc3[_0xc30e('0x29')]);_0x3f7a20[_0xc30e('0x2a')]=_[_0xc30e('0x2b')](_0x3f7a20[_0xc30e('0x28')],_0x3f7a20['query']);_0x1c3f12['attributes']=_[_0xc30e('0x2b')](_0x3f7a20[_0xc30e('0x28')],qs[_0xc30e('0x2d')](_0x363cc3[_0xc30e('0x29')][_0xc30e('0x2d')]));_0x1c3f12[_0xc30e('0x2c')]=_0x1c3f12[_0xc30e('0x2c')][_0xc30e('0x2e')]?_0x1c3f12[_0xc30e('0x2c')]:_0x3f7a20[_0xc30e('0x28')];if(_0x363cc3[_0xc30e('0x29')][_0xc30e('0x3a')]){_0x1c3f12[_0xc30e('0x3b')]=[{'all':!![]}];}_0x1c3f12=_[_0xc30e('0x35')]({},_0x1c3f12,_0x363cc3[_0xc30e('0x3f')]);return db[_0xc30e('0x27')]['find'](_0x1c3f12)[_0xc30e('0x21')](handleEntityNotFound(_0x19e321,null))[_0xc30e('0x21')](respondWithResult(_0x19e321,null))[_0xc30e('0x40')](handleError(_0x19e321,null));};exports[_0xc30e('0x41')]=function(_0x4c73b3,_0x20a3d8){return db[_0xc30e('0x27')][_0xc30e('0x41')](_0x4c73b3['body'],{})[_0xc30e('0x21')](respondWithResult(_0x20a3d8,0xc9))[_0xc30e('0x40')](handleError(_0x20a3d8,null));};exports['update']=function(_0x245408,_0x130e74){if(_0x245408['body']['id']){delete _0x245408[_0xc30e('0x42')]['id'];}return db['OpenchannelApplication'][_0xc30e('0x43')]({'where':{'id':_0x245408[_0xc30e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x130e74,null))[_0xc30e('0x21')](saveUpdates(_0x245408[_0xc30e('0x42')],null))[_0xc30e('0x21')](respondWithResult(_0x130e74,null))['catch'](handleError(_0x130e74,null));};exports[_0xc30e('0x22')]=function(_0x4b22fa,_0x4f174d){return db['OpenchannelApplication'][_0xc30e('0x43')]({'where':{'id':_0x4b22fa[_0xc30e('0x3c')]['id']}})[_0xc30e('0x21')](handleEntityNotFound(_0x4f174d,null))[_0xc30e('0x21')](removeEntity(_0x4f174d,null))[_0xc30e('0x40')](handleError(_0x4f174d,null));}; \ No newline at end of file +var _0x1913=['intersection','fields','attributes','nolimit','order','filters','pick','filter','where','merge','map','type','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','length','options','find','create','body','update','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','OpenchannelApplication','rawAttributes','model','keys','query'];(function(_0xc6db88,_0x47192c){var _0x614743=function(_0x4489f3){while(--_0x4489f3){_0xc6db88['push'](_0xc6db88['shift']());}};_0x614743(++_0x47192c);}(_0x1913,0xe0));var _0x3191=function(_0x55df92,_0x1e2b1b){_0x55df92=_0x55df92-0x0;var _0x2aa700=_0x1913[_0x55df92];return _0x2aa700;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3191('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3191('0x1'));var moment=require(_0x3191('0x2'));var BPromise=require(_0x3191('0x3'));var Mustache=require(_0x3191('0x4'));var util=require(_0x3191('0x5'));var path=require('path');var sox=require(_0x3191('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3191('0x7'));var squel=require(_0x3191('0x8'));var crypto=require(_0x3191('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3191('0xa'));var toCsv=require(_0x3191('0xb'));var querystring=require('querystring');var Papa=require(_0x3191('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x3191('0xd'));var Redis=require(_0x3191('0xe'));var qs=require(_0x3191('0xf'));var logger=require(_0x3191('0x10'))('api');var utils=require(_0x3191('0x11'));var config=require(_0x3191('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf9433a,_0x285a1b){_0x285a1b=_0x285a1b||0xcc;return function(_0x42e951){if(_0x42e951){return _0xf9433a['sendStatus'](_0x285a1b);}return _0xf9433a[_0x3191('0x13')](_0x285a1b)['end']();};}function respondWithResult(_0xaee9f6,_0xb5ba7b){_0xb5ba7b=_0xb5ba7b||0xc8;return function(_0xdd88f6){if(_0xdd88f6){return _0xaee9f6[_0x3191('0x13')](_0xb5ba7b)[_0x3191('0x14')](_0xdd88f6);}};}function respondWithFilteredResult(_0x37951e,_0xc55b70){return function(_0x5dc6a4){if(_0x5dc6a4){var _0x4d483f=_0x5dc6a4[_0x3191('0x15')],_0x1154ea=_0xc55b70[_0x3191('0x16')],_0xba4e28=_0xc55b70[_0x3191('0x16')]+_0xc55b70[_0x3191('0x17')],_0xa63cd6;if(_0xba4e28>=_0x4d483f){_0xba4e28=_0x4d483f;_0xa63cd6=0xc8;}else{_0xa63cd6=0xce;}_0x37951e[_0x3191('0x13')](_0xa63cd6);return _0x37951e[_0x3191('0x18')](_0x3191('0x19'),_0x1154ea+'-'+_0xba4e28+'/'+_0x4d483f)[_0x3191('0x14')](_0x5dc6a4);}return null;};}function patchUpdates(_0x2bdf03){return function(_0x185966){try{jsonpatch[_0x3191('0x1a')](_0x185966,_0x2bdf03,!![]);}catch(_0x1d6111){return BPromise[_0x3191('0x1b')](_0x1d6111);}return _0x185966['save']();};}function saveUpdates(_0xe62cef,_0x3aecaf){return function(_0x415348){if(_0x415348){return _0x415348['update'](_0xe62cef)['then'](function(_0x1f318e){return _0x1f318e;});}return null;};}function removeEntity(_0x1eb5ce,_0x5453eb){return function(_0x4e7bd0){if(_0x4e7bd0){return _0x4e7bd0[_0x3191('0x1c')]()[_0x3191('0x1d')](function(){_0x1eb5ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a2c1,_0x492974){return function(_0x44f67d){if(!_0x44f67d){_0x51a2c1[_0x3191('0x1e')](0x194);}return _0x44f67d;};}function handleError(_0xfe9601,_0xb4b112){_0xb4b112=_0xb4b112||0x1f4;return function(_0x5cb9f7){logger[_0x3191('0x1f')](_0x5cb9f7[_0x3191('0x20')]);if(_0x5cb9f7[_0x3191('0x21')]){delete _0x5cb9f7[_0x3191('0x21')];}_0xfe9601[_0x3191('0x13')](_0xb4b112)[_0x3191('0x22')](_0x5cb9f7);};}exports['index']=function(_0x3e9c7c,_0x2dc354){var _0x179940={},_0x292cfe={},_0x4c0244={'count':0x0,'rows':[]};var _0x1f59e6=db[_0x3191('0x23')][_0x3191('0x24')];_0x292cfe[_0x3191('0x25')]=_[_0x3191('0x26')](_0x1f59e6);_0x292cfe['query']=_[_0x3191('0x26')](_0x3e9c7c[_0x3191('0x27')]);_0x292cfe['filters']=_[_0x3191('0x28')](_0x292cfe[_0x3191('0x25')],_0x292cfe['query']);_0x179940['attributes']=_[_0x3191('0x28')](_0x292cfe[_0x3191('0x25')],qs[_0x3191('0x29')](_0x3e9c7c[_0x3191('0x27')][_0x3191('0x29')]));_0x179940[_0x3191('0x2a')]=_0x179940[_0x3191('0x2a')]['length']?_0x179940[_0x3191('0x2a')]:_0x292cfe[_0x3191('0x25')];if(!_0x3e9c7c['query']['hasOwnProperty'](_0x3191('0x2b'))){_0x179940[_0x3191('0x17')]=qs[_0x3191('0x17')](_0x3e9c7c[_0x3191('0x27')]['limit']);_0x179940['offset']=qs[_0x3191('0x16')](_0x3e9c7c[_0x3191('0x27')][_0x3191('0x16')]);}_0x179940[_0x3191('0x2c')]=qs['sort'](_0x3e9c7c['query']['sort']);_0x179940['where']=qs[_0x3191('0x2d')](_[_0x3191('0x2e')](_0x3e9c7c[_0x3191('0x27')],_0x292cfe[_0x3191('0x2d')]));if(_0x3e9c7c[_0x3191('0x27')][_0x3191('0x2f')]){_0x179940[_0x3191('0x30')]=_[_0x3191('0x31')](_0x179940[_0x3191('0x30')],{'$or':_[_0x3191('0x32')](_0x1f59e6,function(_0x49d6c2){if(_0x49d6c2[_0x3191('0x33')]['key']!==_0x3191('0x34')){var _0x3a91f2={};_0x3a91f2[_0x49d6c2[_0x3191('0x35')]]={'$like':'%'+_0x3e9c7c['query'][_0x3191('0x2f')]+'%'};return _0x3a91f2;}})});}_0x179940=_[_0x3191('0x31')]({},_0x179940,_0x3e9c7c['options']);var _0x56e4b2={'where':_0x179940[_0x3191('0x30')]};return db['OpenchannelApplication']['count'](_0x56e4b2)[_0x3191('0x1d')](function(_0xb17a4d){_0x4c0244['count']=_0xb17a4d;if(_0x3e9c7c['query'][_0x3191('0x36')]){_0x179940['include']=[{'all':!![]}];}return db[_0x3191('0x23')][_0x3191('0x37')](_0x179940);})[_0x3191('0x1d')](function(_0x2ead62){_0x4c0244[_0x3191('0x38')]=_0x2ead62;return _0x4c0244;})[_0x3191('0x1d')](respondWithFilteredResult(_0x2dc354,_0x179940))[_0x3191('0x39')](handleError(_0x2dc354,null));};exports[_0x3191('0x3a')]=function(_0x3e731f,_0x4d8873){var _0x41ab05={'raw':!![],'where':{'id':_0x3e731f[_0x3191('0x3b')]['id']}},_0x393c33={};_0x393c33[_0x3191('0x25')]=_[_0x3191('0x26')](db[_0x3191('0x23')][_0x3191('0x24')]);_0x393c33[_0x3191('0x27')]=_[_0x3191('0x26')](_0x3e731f[_0x3191('0x27')]);_0x393c33[_0x3191('0x2d')]=_['intersection'](_0x393c33[_0x3191('0x25')],_0x393c33[_0x3191('0x27')]);_0x41ab05[_0x3191('0x2a')]=_['intersection'](_0x393c33['model'],qs[_0x3191('0x29')](_0x3e731f['query'][_0x3191('0x29')]));_0x41ab05[_0x3191('0x2a')]=_0x41ab05['attributes'][_0x3191('0x3c')]?_0x41ab05[_0x3191('0x2a')]:_0x393c33[_0x3191('0x25')];if(_0x3e731f['query']['includeAll']){_0x41ab05['include']=[{'all':!![]}];}_0x41ab05=_[_0x3191('0x31')]({},_0x41ab05,_0x3e731f[_0x3191('0x3d')]);return db[_0x3191('0x23')][_0x3191('0x3e')](_0x41ab05)[_0x3191('0x1d')](handleEntityNotFound(_0x4d8873,null))[_0x3191('0x1d')](respondWithResult(_0x4d8873,null))[_0x3191('0x39')](handleError(_0x4d8873,null));};exports['create']=function(_0x50c475,_0x4337dd){return db[_0x3191('0x23')][_0x3191('0x3f')](_0x50c475[_0x3191('0x40')],{})[_0x3191('0x1d')](respondWithResult(_0x4337dd,0xc9))[_0x3191('0x39')](handleError(_0x4337dd,null));};exports[_0x3191('0x41')]=function(_0x5598a5,_0x1008ba){if(_0x5598a5[_0x3191('0x40')]['id']){delete _0x5598a5[_0x3191('0x40')]['id'];}return db[_0x3191('0x23')][_0x3191('0x3e')]({'where':{'id':_0x5598a5[_0x3191('0x3b')]['id']}})[_0x3191('0x1d')](handleEntityNotFound(_0x1008ba,null))[_0x3191('0x1d')](saveUpdates(_0x5598a5['body'],null))[_0x3191('0x1d')](respondWithResult(_0x1008ba,null))[_0x3191('0x39')](handleError(_0x1008ba,null));};exports[_0x3191('0x1c')]=function(_0x18dcae,_0x474e79){return db['OpenchannelApplication'][_0x3191('0x3e')]({'where':{'id':_0x18dcae[_0x3191('0x3b')]['id']}})['then'](handleEntityNotFound(_0x474e79,null))[_0x3191('0x1d')](removeEntity(_0x474e79,null))['catch'](handleError(_0x474e79,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 9a51078..499e4bb 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 _0x140f=['request-promise','./openchannelApplication.attributes','openchannel_applications','lodash','util','api'];(function(_0x4195dc,_0x3ec874){var _0x13281d=function(_0x18547f){while(--_0x18547f){_0x4195dc['push'](_0x4195dc['shift']());}};_0x13281d(++_0x3ec874);}(_0x140f,0x195));var _0xf140=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0x140f[_0x56daff];return _0x132c82;};'use strict';var _=require(_0xf140('0x0'));var util=require(_0xf140('0x1'));var logger=require('../../config/logger')(_0xf140('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf140('0x3'));var attributes=require(_0xf140('0x4'));module['exports']=function(_0x4b1309,_0x4c6cb7){return _0x4b1309['define']('OpenchannelApplication',attributes,{'tableName':_0xf140('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x349b=['bluebird','request-promise','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger'];(function(_0x248275,_0x112c0c){var _0x162183=function(_0x53c896){while(--_0x53c896){_0x248275['push'](_0x248275['shift']());}};_0x162183(++_0x112c0c);}(_0x349b,0x7f));var _0xb349=function(_0x5ea400,_0x1aec8e){_0x5ea400=_0x5ea400-0x0;var _0x258f8a=_0x349b[_0x5ea400];return _0x258f8a;};'use strict';var _=require(_0xb349('0x0'));var util=require(_0xb349('0x1'));var logger=require(_0xb349('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb349('0x3'));var rp=require(_0xb349('0x4'));var attributes=require(_0xb349('0x5'));module[_0xb349('0x6')]=function(_0x52a1ef,_0x2e22a0){return _0x52a1ef[_0xb349('0x7')](_0xb349('0x8'),attributes,{'tableName':_0xb349('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 26b7ae3..1ac5e20 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 _0x5328=['where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','options','raw'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x5328,0x12f));var _0x8532=function(_0x4c5a46,_0xcc68c){_0x4c5a46=_0x4c5a46-0x0;var _0x54da0d=_0x5328[_0x4c5a46];return _0x54da0d;};'use strict';var _=require(_0x8532('0x0'));var util=require(_0x8532('0x1'));var moment=require(_0x8532('0x2'));var BPromise=require(_0x8532('0x3'));var rs=require(_0x8532('0x4'));var fs=require('fs');var Redis=require(_0x8532('0x5'));var db=require(_0x8532('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8532('0x7'))(_0x8532('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8532('0x9')][_0x8532('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea926,_0x98897e,_0x33b1e9){return new BPromise(function(_0x44e328,_0x457bbf){return client[_0x8532('0xb')](_0x4ea926,_0x33b1e9)[_0x8532('0xc')](function(_0x51e25d){logger[_0x8532('0xd')](_0x8532('0xe'),_0x98897e,'request\x20sent');logger[_0x8532('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x98897e,_0x8532('0x10'),JSON[_0x8532('0x11')](_0x51e25d));if(_0x51e25d[_0x8532('0x12')]){if(_0x51e25d[_0x8532('0x12')][_0x8532('0x13')]===0x1f4){logger[_0x8532('0x12')](_0x8532('0xe'),_0x98897e,_0x51e25d['error'][_0x8532('0x14')]);return _0x457bbf(_0x51e25d[_0x8532('0x12')]['message']);}logger['error'](_0x8532('0xe'),_0x98897e,_0x51e25d[_0x8532('0x12')][_0x8532('0x14')]);return _0x44e328(_0x51e25d['error'][_0x8532('0x14')]);}else{logger[_0x8532('0xd')](_0x8532('0xe'),_0x98897e,_0x8532('0x10'));_0x44e328(_0x51e25d[_0x8532('0x15')][_0x8532('0x14')]);}})[_0x8532('0x16')](function(_0x55b429){logger[_0x8532('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x98897e,_0x55b429);_0x457bbf(_0x55b429);});});}exports[_0x8532('0x17')]=function(_0x385631){var _0x3d4a64=this;return new Promise(function(_0x2f3dba,_0x1cdb8e){return db[_0x8532('0x18')]['update'](_0x385631['body'],{'raw':_0x385631[_0x8532('0x19')]?_0x385631[_0x8532('0x19')][_0x8532('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x385631[_0x8532('0x19')]?_0x385631[_0x8532('0x19')][_0x8532('0x1b')]||null:null,'attributes':_0x385631['options']?_0x385631['options'][_0x8532('0x1c')]||null:null,'limit':_0x385631['options']?_0x385631[_0x8532('0x19')][_0x8532('0x1d')]||null:null})['then'](function(_0x457c14){logger['info'](_0x8532('0x17'),_0x385631);logger[_0x8532('0xf')]('UpdateOpenchannelApplication',_0x385631,JSON[_0x8532('0x11')](_0x457c14));_0x2f3dba(_0x457c14);})[_0x8532('0x16')](function(_0x4be0fc){logger[_0x8532('0x12')]('UpdateOpenchannelApplication',_0x4be0fc[_0x8532('0x14')],_0x385631);_0x1cdb8e(_0x3d4a64[_0x8532('0x12')](0x1f4,_0x4be0fc[_0x8532('0x14')]));});});}; \ No newline at end of file +var _0x3933=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','request\x20sent','debug'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x3933,0x83));var _0x3393=function(_0xc48af2,_0xd2c68b){_0xc48af2=_0xc48af2-0x0;var _0x5dc50a=_0x3933[_0xc48af2];return _0x5dc50a;};'use strict';var _=require(_0x3393('0x0'));var util=require(_0x3393('0x1'));var moment=require(_0x3393('0x2'));var BPromise=require(_0x3393('0x3'));var rs=require(_0x3393('0x4'));var fs=require('fs');var Redis=require(_0x3393('0x5'));var db=require(_0x3393('0x6'))['db'];var utils=require(_0x3393('0x7'));var logger=require('../../config/logger')(_0x3393('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3393('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x387a6b,_0x18c430,_0x481fdb){return new BPromise(function(_0xbfd1e7,_0x75cdca){return client[_0x3393('0xa')](_0x387a6b,_0x481fdb)[_0x3393('0xb')](function(_0x44f93a){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x18c430,_0x3393('0xc'));logger[_0x3393('0xd')](_0x3393('0xe'),_0x18c430,_0x3393('0xc'),JSON[_0x3393('0xf')](_0x44f93a));if(_0x44f93a[_0x3393('0x10')]){if(_0x44f93a[_0x3393('0x10')]['code']===0x1f4){logger[_0x3393('0x10')](_0x3393('0x11'),_0x18c430,_0x44f93a[_0x3393('0x10')][_0x3393('0x12')]);return _0x75cdca(_0x44f93a[_0x3393('0x10')]['message']);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x18c430,_0x44f93a[_0x3393('0x10')][_0x3393('0x12')]);return _0xbfd1e7(_0x44f93a[_0x3393('0x10')][_0x3393('0x12')]);}else{logger[_0x3393('0x13')](_0x3393('0x11'),_0x18c430,'request\x20sent');_0xbfd1e7(_0x44f93a['result'][_0x3393('0x12')]);}})[_0x3393('0x14')](function(_0xd1ff41){logger[_0x3393('0x10')](_0x3393('0x11'),_0x18c430,_0xd1ff41);_0x75cdca(_0xd1ff41);});});}exports[_0x3393('0x15')]=function(_0x4c7811){var _0x23aa20=this;return new Promise(function(_0x5bb3ef,_0x408f87){return db[_0x3393('0x16')][_0x3393('0x17')](_0x4c7811[_0x3393('0x18')],{'raw':_0x4c7811[_0x3393('0x19')]?_0x4c7811[_0x3393('0x19')][_0x3393('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c7811[_0x3393('0x19')]?_0x4c7811[_0x3393('0x19')][_0x3393('0x1b')]||null:null,'attributes':_0x4c7811['options']?_0x4c7811[_0x3393('0x19')]['attributes']||null:null,'limit':_0x4c7811[_0x3393('0x19')]?_0x4c7811[_0x3393('0x19')][_0x3393('0x1c')]||null:null})[_0x3393('0xb')](function(_0x3146e2){logger[_0x3393('0x13')](_0x3393('0x15'),_0x4c7811);logger[_0x3393('0xd')](_0x3393('0x15'),_0x4c7811,JSON[_0x3393('0xf')](_0x3146e2));_0x5bb3ef(_0x3146e2);})['catch'](function(_0x43dda6){logger['error']('UpdateOpenchannelApplication',_0x43dda6[_0x3393('0x12')],_0x4c7811);_0x408f87(_0x23aa20['error'](0x1f4,_0x43dda6[_0x3393('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 9ccdda3..455bd69 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 _0xa5d6=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','openchannelinteraction:addtags','addTags','put','/:id','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path'];(function(_0x561975,_0x1d64fc){var _0x15b7f5=function(_0x43bfc1){while(--_0x43bfc1){_0x561975['push'](_0x561975['shift']());}};_0x15b7f5(++_0x1d64fc);}(_0xa5d6,0x1ee));var _0x6a5d=function(_0x4f173b,_0x33a83e){_0x4f173b=_0x4f173b-0x0;var _0x3782d3=_0xa5d6[_0x4f173b];return _0x3782d3;};'use strict';var multer=require(_0x6a5d('0x0'));var util=require('util');var path=require(_0x6a5d('0x1'));var timeout=require(_0x6a5d('0x2'));var express=require(_0x6a5d('0x3'));var router=express[_0x6a5d('0x4')]();var auth=require(_0x6a5d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6a5d('0x6'));var controller=require(_0x6a5d('0x7'));router[_0x6a5d('0x8')]('/',auth[_0x6a5d('0x9')](),controller['index']);router[_0x6a5d('0x8')](_0x6a5d('0xa'),auth[_0x6a5d('0x9')](),controller['describe']);router[_0x6a5d('0x8')]('/:id',auth[_0x6a5d('0x9')](),controller[_0x6a5d('0xb')]);router[_0x6a5d('0x8')](_0x6a5d('0xc'),auth[_0x6a5d('0x9')](),controller[_0x6a5d('0xd')]);router[_0x6a5d('0x8')](_0x6a5d('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x6a5d('0xf')]('/',auth[_0x6a5d('0x9')](),controller[_0x6a5d('0x10')]);router[_0x6a5d('0xf')]('/:id/messages',auth[_0x6a5d('0x9')](),controller[_0x6a5d('0x11')]);router[_0x6a5d('0xf')](_0x6a5d('0x12'),auth[_0x6a5d('0x9')](),interaction['tracked']('openchannel',_0x6a5d('0x13')),controller[_0x6a5d('0x14')]);router[_0x6a5d('0x15')](_0x6a5d('0x16'),auth['isAuthenticated'](),interaction['tracked'](_0x6a5d('0x17'),_0x6a5d('0x18')),controller[_0x6a5d('0x19')]);router[_0x6a5d('0x1a')](_0x6a5d('0x16'),auth[_0x6a5d('0x9')](),interaction['tracked'](_0x6a5d('0x17'),_0x6a5d('0x1b')),controller[_0x6a5d('0x1c')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x6a5d('0x1d')]);module[_0x6a5d('0x1e')]=router; \ No newline at end of file +var _0x1bdb=['/describe','describe','/:id','/:id/messages','/:id/download','download','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','destroy','removeTags','exports','multer','util','Router','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','index'];(function(_0x4ae63d,_0x152404){var _0x4c1e01=function(_0x58cb7e){while(--_0x58cb7e){_0x4ae63d['push'](_0x4ae63d['shift']());}};_0x4c1e01(++_0x152404);}(_0x1bdb,0x121));var _0xb1bd=function(_0x347de1,_0x279167){_0x347de1=_0x347de1-0x0;var _0x4a7a53=_0x1bdb[_0x347de1];return _0x4a7a53;};'use strict';var multer=require(_0xb1bd('0x0'));var util=require(_0xb1bd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1bd('0x2')]();var auth=require(_0xb1bd('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb1bd('0x4'));router[_0xb1bd('0x5')]('/',auth[_0xb1bd('0x6')](),controller[_0xb1bd('0x7')]);router[_0xb1bd('0x5')](_0xb1bd('0x8'),auth[_0xb1bd('0x6')](),controller[_0xb1bd('0x9')]);router[_0xb1bd('0x5')](_0xb1bd('0xa'),auth[_0xb1bd('0x6')](),controller['show']);router[_0xb1bd('0x5')](_0xb1bd('0xb'),auth[_0xb1bd('0x6')](),controller['getMessages']);router[_0xb1bd('0x5')](_0xb1bd('0xc'),auth[_0xb1bd('0x6')](),controller[_0xb1bd('0xd')]);router[_0xb1bd('0xe')]('/',auth[_0xb1bd('0x6')](),controller['create']);router['post'](_0xb1bd('0xb'),auth[_0xb1bd('0x6')](),controller['addMessage']);router[_0xb1bd('0xe')](_0xb1bd('0xf'),auth[_0xb1bd('0x6')](),interaction[_0xb1bd('0x10')](_0xb1bd('0x11'),_0xb1bd('0x12')),controller[_0xb1bd('0x13')]);router[_0xb1bd('0x14')](_0xb1bd('0xa'),auth[_0xb1bd('0x6')](),interaction[_0xb1bd('0x10')](_0xb1bd('0x11'),_0xb1bd('0x15')),controller[_0xb1bd('0x16')]);router[_0xb1bd('0x17')](_0xb1bd('0xa'),auth[_0xb1bd('0x6')](),interaction[_0xb1bd('0x10')]('openchannel','openchannelinteraction:destroy'),controller[_0xb1bd('0x18')]);router[_0xb1bd('0x17')](_0xb1bd('0xf'),auth[_0xb1bd('0x6')](),controller[_0xb1bd('0x19')]);module[_0xb1bd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index e890ff7..bc7f7e5 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 _0x394e=['DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x394e,0x88));var _0xe394=function(_0x3a74c2,_0x282fb9){_0x3a74c2=_0x3a74c2-0x0;var _0x19d99c=_0x394e[_0x3a74c2];return _0x19d99c;};'use strict';var Sequelize=require(_0xe394('0x0'));module[_0xe394('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe394('0x2')]},'disposition':{'type':Sequelize[_0xe394('0x3')]},'note':{'type':Sequelize[_0xe394('0x3')]},'read1stAt':{'type':Sequelize[_0xe394('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xe394('0x3')]},'lastMsgAt':{'type':Sequelize[_0xe394('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xe394('0x4')]('in',_0xe394('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe394('0x3')]}}; \ No newline at end of file +var _0xc3d8=['BOOLEAN','DATE','STRING','out'];(function(_0x1b959e,_0x5b2d5f){var _0xa5ecea=function(_0x447b07){while(--_0x447b07){_0x1b959e['push'](_0x1b959e['shift']());}};_0xa5ecea(++_0x5b2d5f);}(_0xc3d8,0x70));var _0x8c3d=function(_0x24f642,_0x1a9661){_0x24f642=_0x24f642-0x0;var _0x9e566f=_0xc3d8[_0x24f642];return _0x9e566f;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x8c3d('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8c3d('0x1')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8c3d('0x2')]},'read1stAt':{'type':Sequelize[_0x8c3d('0x1')]},'threadId':{'type':Sequelize[_0x8c3d('0x2')]},'externalUrl':{'type':Sequelize[_0x8c3d('0x2')]},'lastMsgAt':{'type':Sequelize[_0x8c3d('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8c3d('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8c3d('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 0765f03..1204ff9 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 _0x8b2d=['name','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','map','type','key','VIRTUAL','field','options','include','tag','Tag','distinct','OpenchannelMessage','Messages','direction','read','User','fullname','CmContact','internal','OpenchannelAccount','Account','createdAt','Tags','color','ThroughTags','rows','catch','show','includeAll','find','create','body','params','addMessage','ids','omit','getMessages','findOne','order','pick','OpenchannelInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','format','Contact','Attachment','Letter','

Openchannel\x20Interaction:\x20#%d

','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','%s:\x20%s

','firstName','','basename','createReadStream','pipe','interaction-','.pdf','log','err','unlinkSync','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack'];(function(_0x24eedc,_0x10011b){var _0x44730c=function(_0xa186bf){while(--_0xa186bf){_0x24eedc['push'](_0x24eedc['shift']());}};_0x44730c(++_0x10011b);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0x8b2d[_0x522ae8];return _0x3189b9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd8b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8b2('0x1'));var rp=require(_0xd8b2('0x2'));var moment=require('moment');var BPromise=require(_0xd8b2('0x3'));var Mustache=require(_0xd8b2('0x4'));var util=require('util');var path=require(_0xd8b2('0x5'));var sox=require(_0xd8b2('0x6'));var csv=require(_0xd8b2('0x7'));var ejs=require(_0xd8b2('0x8'));var fs=require('fs');var _=require(_0xd8b2('0x9'));var squel=require(_0xd8b2('0xa'));var crypto=require(_0xd8b2('0xb'));var jsforce=require(_0xd8b2('0xc'));var deskjs=require(_0xd8b2('0xd'));var toCsv=require(_0xd8b2('0x7'));var querystring=require('querystring');var Papa=require(_0xd8b2('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xd8b2('0xf'));var Redis=require(_0xd8b2('0x10'));var qs=require(_0xd8b2('0x11'));var logger=require(_0xd8b2('0x12'))(_0xd8b2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd8b2('0x14')]=_[_0xd8b2('0x15')](config[_0xd8b2('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xd8b2('0x16'))(new Redis(config[_0xd8b2('0x14')]));require(_0xd8b2('0x17'))[_0xd8b2('0x18')](socket);function respondWithStatusCode(_0x4c7f60,_0x3ecff2){_0x3ecff2=_0x3ecff2||0xcc;return function(_0x4c4d97){if(_0x4c4d97){return _0x4c7f60['sendStatus'](_0x3ecff2);}return _0x4c7f60[_0xd8b2('0x19')](_0x3ecff2)[_0xd8b2('0x1a')]();};}function respondWithResult(_0x227f86,_0x2a0b6){_0x2a0b6=_0x2a0b6||0xc8;return function(_0x35cbed){if(_0x35cbed){return _0x227f86[_0xd8b2('0x19')](_0x2a0b6)[_0xd8b2('0x1b')](_0x35cbed);}};}function respondWithFilteredResult(_0x4bf135,_0x4c4493){return function(_0x573d24){if(_0x573d24){var _0x5b63a1=_0x573d24[_0xd8b2('0x1c')],_0x323c79=_0x4c4493[_0xd8b2('0x1d')],_0x44185b=_0x4c4493['offset']+_0x4c4493[_0xd8b2('0x1e')],_0x3ae3b7;if(_0x44185b>=_0x5b63a1){_0x44185b=_0x5b63a1;_0x3ae3b7=0xc8;}else{_0x3ae3b7=0xce;}_0x4bf135[_0xd8b2('0x19')](_0x3ae3b7);return _0x4bf135[_0xd8b2('0x1f')](_0xd8b2('0x20'),_0x323c79+'-'+_0x44185b+'/'+_0x5b63a1)['json'](_0x573d24);}return null;};}function patchUpdates(_0x449b11){return function(_0x4d355c){try{jsonpatch['apply'](_0x4d355c,_0x449b11,!![]);}catch(_0x23ff29){return BPromise['reject'](_0x23ff29);}return _0x4d355c['save']();};}function saveUpdates(_0x3880cb,_0x42ae8f){return function(_0x4b2992){if(_0x4b2992){return _0x4b2992[_0xd8b2('0x21')](_0x3880cb)[_0xd8b2('0x22')](function(_0x12e44b){return _0x12e44b;});}return null;};}function removeEntity(_0x563c96,_0x16d996){return function(_0x4a92d5){if(_0x4a92d5){return _0x4a92d5[_0xd8b2('0x23')]()[_0xd8b2('0x22')](function(){_0x563c96['status'](0xcc)[_0xd8b2('0x1a')]();});}};}function handleEntityNotFound(_0x1cee26,_0x520143){return function(_0x101e23){if(!_0x101e23){_0x1cee26[_0xd8b2('0x24')](0x194);}return _0x101e23;};}function handleError(_0x542f88,_0x4f6fd5){_0x4f6fd5=_0x4f6fd5||0x1f4;return function(_0x2f1f15){logger[_0xd8b2('0x25')](_0x2f1f15[_0xd8b2('0x26')]);if(_0x2f1f15[_0xd8b2('0x27')]){delete _0x2f1f15[_0xd8b2('0x27')];}_0x542f88['status'](_0x4f6fd5)['send'](_0x2f1f15);};}exports[_0xd8b2('0x28')]=function(_0x4d3141,_0x249565){var _0x22c3cf={},_0x39ef2f={},_0x2ef26c={'count':0x0,'rows':[]};var _0x51a745=db[_0xd8b2('0x29')][_0xd8b2('0x2a')];_0x39ef2f[_0xd8b2('0x2b')]=_[_0xd8b2('0x2c')](_0x51a745);_0x39ef2f[_0xd8b2('0x2d')]=_[_0xd8b2('0x2c')](_0x4d3141[_0xd8b2('0x2d')]);_0x39ef2f[_0xd8b2('0x2e')]=_[_0xd8b2('0x2f')](_0x39ef2f[_0xd8b2('0x2b')],_0x39ef2f[_0xd8b2('0x2d')]);_0x22c3cf['attributes']=_[_0xd8b2('0x2f')](_0x39ef2f['model'],qs[_0xd8b2('0x30')](_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x30')]));_0x22c3cf[_0xd8b2('0x31')]=_0x22c3cf[_0xd8b2('0x31')][_0xd8b2('0x32')]?_0x22c3cf[_0xd8b2('0x31')]:_0x39ef2f[_0xd8b2('0x2b')];if(!_0x4d3141['query'][_0xd8b2('0x33')](_0xd8b2('0x34'))){_0x22c3cf[_0xd8b2('0x1e')]=qs[_0xd8b2('0x1e')](_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x1e')]);_0x22c3cf[_0xd8b2('0x1d')]=qs[_0xd8b2('0x1d')](_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x1d')]);}_0x22c3cf['order']=qs[_0xd8b2('0x35')](_0x4d3141[_0xd8b2('0x2d')]['sort']);_0x22c3cf['where']=qs[_0xd8b2('0x2e')](_['pick'](_0x4d3141[_0xd8b2('0x2d')],_0x39ef2f['filters']));if(_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x36')]){_0x22c3cf[_0xd8b2('0x37')]=_[_0xd8b2('0x38')](_0x22c3cf[_0xd8b2('0x37')],{'$or':_[_0xd8b2('0x39')](_0x51a745,function(_0xc508fa){if(_0xc508fa[_0xd8b2('0x3a')][_0xd8b2('0x3b')]!==_0xd8b2('0x3c')){var _0x49b05a={};_0x49b05a[_0xc508fa[_0xd8b2('0x3d')]]={'$like':'%'+_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x36')]+'%'};return _0x49b05a;}})});}_0x22c3cf=_[_0xd8b2('0x38')]({},_0x22c3cf,_0x4d3141[_0xd8b2('0x3e')]);var _0x141f11={'where':_0x22c3cf[_0xd8b2('0x37')]};_0x141f11[_0xd8b2('0x3f')]=[];if(_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x40')]){_0x141f11[_0xd8b2('0x3f')]['push']({'model':db[_0xd8b2('0x41')],'as':'Tags','attributes':['id'],'where':{'id':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x40')]},'required':!![]});_0x141f11[_0xd8b2('0x42')]=!![];}if(_0x4d3141['query']['read']){_0x141f11['include']['push']({'model':db[_0xd8b2('0x43')],'as':_0xd8b2('0x44'),'attributes':['id',_0xd8b2('0x45'),'createdAt',_0xd8b2('0x46')],'where':{'direction':'in','read':_0x4d3141[_0xd8b2('0x2d')]['read']||![]},'required':!![]});_0x141f11[_0xd8b2('0x42')]=!![];}return db['OpenchannelInteraction']['count'](_0x141f11)[_0xd8b2('0x22')](function(_0x2d29df){_0x2ef26c[_0xd8b2('0x1c')]=_0x2d29df;if(_0x4d3141['query']['includeAll']){_0x22c3cf[_0xd8b2('0x3f')]=[{'model':db[_0xd8b2('0x47')],'as':'Users','required':![],'attributes':['id',_0xd8b2('0x27'),_0xd8b2('0x48')]},{'model':db[_0xd8b2('0x49')],'as':'Contact','required':![]},{'model':db[_0xd8b2('0x47')],'as':'Owner','attributes':[_0xd8b2('0x27'),_0xd8b2('0x48'),_0xd8b2('0x4a')],'required':![]},{'model':db[_0xd8b2('0x4b')],'as':_0xd8b2('0x4c'),'attributes':['name',_0xd8b2('0x3b')],'required':![]},{'model':db[_0xd8b2('0x43')],'as':_0xd8b2('0x44'),'attributes':['id',_0xd8b2('0x45'),_0xd8b2('0x4d'),_0xd8b2('0x46')],'where':{'direction':'in','read':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x46')]||![]},'required':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x46')]||![]},{'model':db['Tag'],'as':_0xd8b2('0x4e'),'attributes':['id','name',_0xd8b2('0x4f')],'required':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x40')]?!![]:![]},{'model':db[_0xd8b2('0x41')],'as':_0xd8b2('0x50'),'attributes':['id',_0xd8b2('0x27'),_0xd8b2('0x4f')],'through':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x40')]?{'attributes':[],'where':{'TagId':_0x4d3141[_0xd8b2('0x2d')]['tag']||undefined}}:{},'required':_0x4d3141['query'][_0xd8b2('0x40')]?!![]:![]}];}return db[_0xd8b2('0x29')]['findAll'](_0x22c3cf);})[_0xd8b2('0x22')](function(_0x2cb826){_0x2ef26c[_0xd8b2('0x51')]=_0x2cb826;return _0x2ef26c;})[_0xd8b2('0x22')](respondWithFilteredResult(_0x249565,_0x22c3cf))[_0xd8b2('0x52')](handleError(_0x249565,null));};exports[_0xd8b2('0x53')]=function(_0x306c52,_0x312249){var _0x3a1758={'raw':![],'where':{'id':_0x306c52['params']['id']}},_0x5cccf4={};_0x5cccf4[_0xd8b2('0x2b')]=_[_0xd8b2('0x2c')](db[_0xd8b2('0x29')][_0xd8b2('0x2a')]);_0x5cccf4['query']=_[_0xd8b2('0x2c')](_0x306c52[_0xd8b2('0x2d')]);_0x5cccf4[_0xd8b2('0x2e')]=_['intersection'](_0x5cccf4[_0xd8b2('0x2b')],_0x5cccf4[_0xd8b2('0x2d')]);_0x3a1758['attributes']=_[_0xd8b2('0x2f')](_0x5cccf4[_0xd8b2('0x2b')],qs[_0xd8b2('0x30')](_0x306c52[_0xd8b2('0x2d')]['fields']));_0x3a1758['attributes']=_0x3a1758[_0xd8b2('0x31')][_0xd8b2('0x32')]?_0x3a1758[_0xd8b2('0x31')]:_0x5cccf4[_0xd8b2('0x2b')];if(_0x306c52['query'][_0xd8b2('0x54')]){_0x3a1758['include']=[{'all':!![]}];}_0x3a1758=_[_0xd8b2('0x38')]({},_0x3a1758,_0x306c52[_0xd8b2('0x3e')]);return db['OpenchannelInteraction'][_0xd8b2('0x55')](_0x3a1758)[_0xd8b2('0x22')](handleEntityNotFound(_0x312249,null))[_0xd8b2('0x22')](respondWithResult(_0x312249,null))['catch'](handleError(_0x312249,null));};exports[_0xd8b2('0x56')]=function(_0x379d7f,_0x416110){return db[_0xd8b2('0x29')][_0xd8b2('0x56')](_0x379d7f['body'],{})[_0xd8b2('0x22')](respondWithResult(_0x416110,0xc9))[_0xd8b2('0x52')](handleError(_0x416110,null));};exports['update']=function(_0xd4d2ea,_0x11dc8d){if(_0xd4d2ea['body']['id']){delete _0xd4d2ea[_0xd8b2('0x57')]['id'];}return db[_0xd8b2('0x29')][_0xd8b2('0x55')]({'where':{'id':_0xd4d2ea[_0xd8b2('0x58')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x11dc8d,null))[_0xd8b2('0x22')](saveUpdates(_0xd4d2ea[_0xd8b2('0x57')],null))['then'](respondWithResult(_0x11dc8d,null))[_0xd8b2('0x52')](handleError(_0x11dc8d,null));};exports[_0xd8b2('0x23')]=function(_0x439e45,_0x318c20){return db[_0xd8b2('0x29')][_0xd8b2('0x55')]({'where':{'id':_0x439e45[_0xd8b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x318c20,null))[_0xd8b2('0x22')](removeEntity(_0x318c20,null))[_0xd8b2('0x52')](handleError(_0x318c20,null));};exports['describe']=function(_0x497ff9,_0x47ef81){return db[_0xd8b2('0x29')]['describe']()['then'](respondWithResult(_0x47ef81,null))[_0xd8b2('0x52')](handleError(_0x47ef81,null));};exports[_0xd8b2('0x59')]=function(_0x8d690b,_0x5f3802,_0x3f1755){return db['OpenchannelMessage'][_0xd8b2('0x55')]({'where':{'id':_0x8d690b['params']['id']}})['then'](handleEntityNotFound(_0x5f3802,null))[_0xd8b2('0x22')](function(_0x28d2d9){if(_0x28d2d9){return _0x28d2d9[_0xd8b2('0x59')](_0x8d690b['body'][_0xd8b2('0x5a')],_[_0xd8b2('0x5b')](_0x8d690b['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f3802,null))[_0xd8b2('0x52')](handleError(_0x5f3802,null));};exports[_0xd8b2('0x5c')]=function(_0x4d3120,_0x4c53e7,_0x1864d7){var _0x2f7ae3={'raw':![],'where':{}};var _0x29e833={};var _0x2844db={'count':0x0,'rows':[]};return db[_0xd8b2('0x29')][_0xd8b2('0x5d')]({'where':{'id':_0x4d3120[_0xd8b2('0x58')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x4c53e7,null))['then'](function(_0x14a7d0){if(_0x14a7d0){_0x29e833[_0xd8b2('0x2b')]=_[_0xd8b2('0x2c')](db[_0xd8b2('0x43')][_0xd8b2('0x2a')]);_0x29e833[_0xd8b2('0x2d')]=_[_0xd8b2('0x2c')](_0x4d3120['query']);_0x29e833[_0xd8b2('0x2e')]=_['intersection'](_0x29e833['model'],_0x29e833[_0xd8b2('0x2d')]);_0x2f7ae3['attributes']=_[_0xd8b2('0x2f')](_0x29e833[_0xd8b2('0x2b')],qs[_0xd8b2('0x30')](_0x4d3120[_0xd8b2('0x2d')]['fields']));_0x2f7ae3[_0xd8b2('0x31')]=_0x2f7ae3[_0xd8b2('0x31')][_0xd8b2('0x32')]?_0x2f7ae3['attributes']:_0x29e833['model'];if(!_0x4d3120[_0xd8b2('0x2d')]['hasOwnProperty'](_0xd8b2('0x34'))){_0x2f7ae3['limit']=qs[_0xd8b2('0x1e')](_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x1e')]);_0x2f7ae3[_0xd8b2('0x1d')]=qs['offset'](_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x1d')]);}_0x2f7ae3[_0xd8b2('0x5e')]=qs[_0xd8b2('0x35')](_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x35')]);_0x2f7ae3[_0xd8b2('0x37')]=qs[_0xd8b2('0x2e')](_[_0xd8b2('0x5f')](_0x4d3120[_0xd8b2('0x2d')],_0x29e833[_0xd8b2('0x2e')]));_0x2f7ae3['where'][_0xd8b2('0x60')]=_0x14a7d0['id'];if(_0x4d3120['query']['filter']){_0x2f7ae3[_0xd8b2('0x37')]=_[_0xd8b2('0x38')](_0x2f7ae3['where'],{'$or':_[_0xd8b2('0x39')](_0x2f7ae3[_0xd8b2('0x31')],function(_0x410d52){var _0x569d61={};_0x569d61[_0x410d52]={'$like':'%'+_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x36')]+'%'};return _0x569d61;})});}if(_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x61')]){var _0x1bbdc3=_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x61')][_0xd8b2('0x62')](',');var _0x2382ab={};_0x2382ab[_0x1bbdc3[0x0]]={'$gte':moment(_0x1bbdc3[0x1])['format'](_0xd8b2('0x63'))};_0x2f7ae3[_0xd8b2('0x37')]=_[_0xd8b2('0x38')](_0x2f7ae3[_0xd8b2('0x37')],_0x2382ab);}_0x2f7ae3=_[_0xd8b2('0x38')]({},_0x2f7ae3,_0x4d3120[_0xd8b2('0x3e')]);return db['OpenchannelMessage'][_0xd8b2('0x1c')]({'where':_0x2f7ae3[_0xd8b2('0x37')]})[_0xd8b2('0x22')](function(_0x412131){_0x2844db[_0xd8b2('0x1c')]=_0x412131;if(_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x54')]){_0x2f7ae3[_0xd8b2('0x3f')]=[{'all':!![]}];}return db[_0xd8b2('0x43')]['findAll'](_0x2f7ae3);})[_0xd8b2('0x22')](function(_0x3022f5){_0x2844db[_0xd8b2('0x51')]=_0x3022f5;return _0x2844db;});}})[_0xd8b2('0x22')](respondWithFilteredResult(_0x4c53e7,_0x2f7ae3))['catch'](handleError(_0x4c53e7,null));};exports[_0xd8b2('0x64')]=function(_0x321ea7,_0x969d08,_0x1f2aae){return db[_0xd8b2('0x29')][_0xd8b2('0x55')]({'where':{'id':_0x321ea7[_0xd8b2('0x58')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x969d08,null))[_0xd8b2('0x22')](function(_0x577471){if(_0x577471){return _0x577471[_0xd8b2('0x65')](_0x321ea7[_0xd8b2('0x57')]['ids'],_['omit'](_0x321ea7['body'],[_0xd8b2('0x5a'),'id'])||{})[_0xd8b2('0x66')](function(){return db[_0xd8b2('0x41')][_0xd8b2('0x67')]({'attributes':['id',_0xd8b2('0x27'),_0xd8b2('0x4f')],'where':{'id':_0x321ea7[_0xd8b2('0x57')][_0xd8b2('0x5a')]}});})[_0xd8b2('0x22')](function(_0x16135f){socket[_0xd8b2('0x68')](_0xd8b2('0x69'),{'id':Number(_0x321ea7['params']['id']),'tags':_0x16135f||[]});return{'id':Number(_0x321ea7[_0xd8b2('0x58')]['id']),'tags':_0x16135f||[]};});}})[_0xd8b2('0x22')](respondWithResult(_0x969d08,null))[_0xd8b2('0x52')](handleError(_0x969d08,null));};exports[_0xd8b2('0x6a')]=function(_0x192781,_0x5d4960,_0x2bb62a){var _0x277034;return db['OpenchannelInteraction'][_0xd8b2('0x55')]({'where':{'id':_0x192781[_0xd8b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x5d4960,null))[_0xd8b2('0x22')](function(_0x3fae45){if(_0x3fae45){return _0x3fae45[_0xd8b2('0x6a')](_0x192781[_0xd8b2('0x2d')][_0xd8b2('0x5a')]);}})['then'](respondWithStatusCode(_0x5d4960,null))[_0xd8b2('0x52')](handleError(_0x5d4960,null));};exports[_0xd8b2('0x6b')]=function(_0x220eb7,_0x53d7b4){var _0x2ed8f3=moment()[_0xd8b2('0x6c')]()[_0xd8b2('0x6d')]();var _0x1b06da=path[_0xd8b2('0x6e')](config[_0xd8b2('0x6f')],_0xd8b2('0x70'),_0xd8b2('0x71'),_0xd8b2('0x72'));var _0x23a9b4=path[_0xd8b2('0x6e')](config['root'],_0xd8b2('0x70'),_0xd8b2('0x71'),'attachments');var _0x11ce73=path[_0xd8b2('0x6e')](_0x1b06da,_0x2ed8f3);var _0x543bc5=util[_0xd8b2('0x73')]('interaction-%s.zip',_0x2ed8f3);var _0x5b7673=path[_0xd8b2('0x6e')](_0x1b06da,_0x543bc5);var _0x234634=![];return db[_0xd8b2('0x29')]['find']({'where':{'id':_0x220eb7['params']['id']},'include':[{'model':db[_0xd8b2('0x43')],'as':_0xd8b2('0x44'),'attributes':['id',_0xd8b2('0x57')],'include':[{'model':db['User'],'as':'User','attributes':['id',_0xd8b2('0x48')],'raw':!![]},{'model':db[_0xd8b2('0x49')],'as':_0xd8b2('0x74'),'attributes':['id','firstName'],'raw':!![]},{'model':db[_0xd8b2('0x75')],'as':_0xd8b2('0x75'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x53d7b4,null))[_0xd8b2('0x22')](function(_0x2aa007){if(_0x2aa007){_0x234634=!![];var _0x36af82='';var _0x40d054={'format':_0xd8b2('0x76'),'border':'1cm'};fs['mkdirSync'](_0x11ce73);_0x36af82+=util[_0xd8b2('0x73')](_0xd8b2('0x77'),_0x2aa007['id']);_0x36af82+=util[_0xd8b2('0x73')](_0xd8b2('0x78'),moment()[_0xd8b2('0x73')](_0xd8b2('0x79'))['toString']());_0x36af82+=_0xd8b2('0x7a');for(var _0x5394d2=0x0;_0x5394d2<_0x2aa007[_0xd8b2('0x44')]['length'];_0x5394d2++){var _0x22864f=_0x2aa007[_0xd8b2('0x44')][_0x5394d2];_0x36af82+='';_0x36af82+=util['format'](_0xd8b2('0x7b'),_0x22864f[_0xd8b2('0x47')]?_0x22864f[_0xd8b2('0x47')][_0xd8b2('0x48')]:_0x22864f[_0xd8b2('0x74')][_0xd8b2('0x7c')],_0x22864f[_0xd8b2('0x57')]);_0x36af82+=_0xd8b2('0x7d');if(_0x22864f['Attachment']){var _0x4f8de7=_0x22864f[_0xd8b2('0x75')];var _0x22d775=path['join'](_0x23a9b4,_0x4f8de7[_0xd8b2('0x7e')]);if(fs['existsSync'](_0x22d775)){fs[_0xd8b2('0x7f')](_0x22d775)[_0xd8b2('0x80')](fs['createWriteStream'](path[_0xd8b2('0x6e')](_0x11ce73,_0x4f8de7[_0xd8b2('0x7e')])));}}}return new BPromise(function(_0x1d3191,_0x447666){pdf['create'](_0x36af82,_0x40d054)['toFile'](path[_0xd8b2('0x6e')](_0x11ce73,_0xd8b2('0x81')+_0x2ed8f3+_0xd8b2('0x82')),function(_0x330ec0,_0x177226){if(_0x330ec0)return _0x447666(_0x330ec0);_0x1d3191(_0x177226);});});}})[_0xd8b2('0x22')](function(){if(_0x234634){return new BPromise(function(_0x180a3b,_0x10cb78){zipdir(_0x11ce73,{'saveTo':_0x5b7673},function(_0x1229a9,_0x864697){if(_0x1229a9)return _0x10cb78(_0x1229a9);return _0x180a3b(_0x864697);});});}})[_0xd8b2('0x22')](function(){if(_0x234634){return new BPromise(function(_0x2cbf01,_0x1e1800){rimraf(_0x11ce73,function(_0x27eb7e){if(_0x27eb7e)_0x1e1800(_0x27eb7e);return _0x2cbf01();});});}})[_0xd8b2('0x22')](function(){if(_0x234634){return _0x53d7b4[_0xd8b2('0x6b')](_0x5b7673,_0x543bc5,function(_0x44f6b2){if(_0x44f6b2){console[_0xd8b2('0x83')](_0xd8b2('0x84'),_0x44f6b2);}else{fs[_0xd8b2('0x85')](_0x5b7673);}});}else{return _0x53d7b4[_0xd8b2('0x24')](0xc8);}})[_0xd8b2('0x52')](handleError(_0x53d7b4,null));}; \ No newline at end of file +var _0x3fc6=['Tag','Tags','read','Messages','direction','createdAt','includeAll','User','Users','name','fullname','CmContact','Contact','Owner','internal','Account','key','color','findAll','rows','catch','params','options','find','create','body','describe','addMessage','omit','ids','getMessages','OpenchannelMessage','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','interaction-%s.zip','firstName','Attachment','1cm','mkdirSync','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','','','basename','existsSync','createReadStream','pipe','createWriteStream','toFile','interaction-','download','log','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','OpenchannelInteraction','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','type','field','filter','include','tag','push'];(function(_0x34e2ea,_0x3d85f8){var _0x5629fc=function(_0x2f8025){while(--_0x2f8025){_0x34e2ea['push'](_0x34e2ea['shift']());}};_0x5629fc(++_0x3d85f8);}(_0x3fc6,0x159));var _0x63fc=function(_0xd4b6f8,_0x12dc22){_0xd4b6f8=_0xd4b6f8-0x0;var _0x2cfb6f=_0x3fc6[_0xd4b6f8];return _0x2cfb6f;};'use strict';var pdf=require(_0x63fc('0x0'));var emlformat=require(_0x63fc('0x1'));var rimraf=require(_0x63fc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x63fc('0x3'));var rp=require(_0x63fc('0x4'));var moment=require(_0x63fc('0x5'));var BPromise=require(_0x63fc('0x6'));var Mustache=require(_0x63fc('0x7'));var util=require(_0x63fc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x63fc('0x9'));var ejs=require(_0x63fc('0xa'));var fs=require('fs');var _=require(_0x63fc('0xb'));var squel=require('squel');var crypto=require(_0x63fc('0xc'));var jsforce=require(_0x63fc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x63fc('0x9'));var querystring=require(_0x63fc('0xe'));var Papa=require(_0x63fc('0xf'));var authService=require(_0x63fc('0x10'));var hardwareService=require(_0x63fc('0x11'));var Redis=require(_0x63fc('0x12'));var qs=require(_0x63fc('0x13'));var logger=require(_0x63fc('0x14'))(_0x63fc('0x15'));var utils=require(_0x63fc('0x16'));var config=require('../../config/environment');var db=require(_0x63fc('0x17'))['db'];config[_0x63fc('0x18')]=_[_0x63fc('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x63fc('0x1a'))(new Redis(config[_0x63fc('0x18')]));require(_0x63fc('0x1b'))[_0x63fc('0x1c')](socket);function respondWithStatusCode(_0xed9cc1,_0x1bcf57){_0x1bcf57=_0x1bcf57||0xcc;return function(_0x4ebbbf){if(_0x4ebbbf){return _0xed9cc1[_0x63fc('0x1d')](_0x1bcf57);}return _0xed9cc1[_0x63fc('0x1e')](_0x1bcf57)[_0x63fc('0x1f')]();};}function respondWithResult(_0x337192,_0x5c4c72){_0x5c4c72=_0x5c4c72||0xc8;return function(_0x3cd826){if(_0x3cd826){return _0x337192['status'](_0x5c4c72)[_0x63fc('0x20')](_0x3cd826);}};}function respondWithFilteredResult(_0x35631f,_0x2db933){return function(_0x42ef5e){if(_0x42ef5e){var _0x1071d9=_0x42ef5e[_0x63fc('0x21')],_0x5e0630=_0x2db933['offset'],_0xebc93=_0x2db933['offset']+_0x2db933[_0x63fc('0x22')],_0x71ad1d;if(_0xebc93>=_0x1071d9){_0xebc93=_0x1071d9;_0x71ad1d=0xc8;}else{_0x71ad1d=0xce;}_0x35631f[_0x63fc('0x1e')](_0x71ad1d);return _0x35631f['set'](_0x63fc('0x23'),_0x5e0630+'-'+_0xebc93+'/'+_0x1071d9)['json'](_0x42ef5e);}return null;};}function patchUpdates(_0x1c2198){return function(_0x2c6d11){try{jsonpatch[_0x63fc('0x24')](_0x2c6d11,_0x1c2198,!![]);}catch(_0x40ae7a){return BPromise[_0x63fc('0x25')](_0x40ae7a);}return _0x2c6d11[_0x63fc('0x26')]();};}function saveUpdates(_0x3047cf,_0x57528b){return function(_0x2e991e){if(_0x2e991e){return _0x2e991e[_0x63fc('0x27')](_0x3047cf)[_0x63fc('0x28')](function(_0x1dcec0){return _0x1dcec0;});}return null;};}function removeEntity(_0x2dd713,_0x561c9b){return function(_0x4f6498){if(_0x4f6498){return _0x4f6498[_0x63fc('0x29')]()[_0x63fc('0x28')](function(){_0x2dd713[_0x63fc('0x1e')](0xcc)[_0x63fc('0x1f')]();});}};}function handleEntityNotFound(_0x59b130,_0x184b80){return function(_0x3af124){if(!_0x3af124){_0x59b130[_0x63fc('0x1d')](0x194);}return _0x3af124;};}function handleError(_0x2d1dc3,_0x3d7b61){_0x3d7b61=_0x3d7b61||0x1f4;return function(_0x390f41){logger[_0x63fc('0x2a')](_0x390f41[_0x63fc('0x2b')]);if(_0x390f41['name']){delete _0x390f41['name'];}_0x2d1dc3[_0x63fc('0x1e')](_0x3d7b61)[_0x63fc('0x2c')](_0x390f41);};}exports['index']=function(_0x53e3c6,_0x5ace6f){var _0x3bb029={},_0x17c0fd={},_0x41deb6={'count':0x0,'rows':[]};var _0x365653=db[_0x63fc('0x2d')][_0x63fc('0x2e')];_0x17c0fd[_0x63fc('0x2f')]=_['keys'](_0x365653);_0x17c0fd[_0x63fc('0x30')]=_[_0x63fc('0x31')](_0x53e3c6['query']);_0x17c0fd[_0x63fc('0x32')]=_[_0x63fc('0x33')](_0x17c0fd[_0x63fc('0x2f')],_0x17c0fd['query']);_0x3bb029[_0x63fc('0x34')]=_['intersection'](_0x17c0fd[_0x63fc('0x2f')],qs[_0x63fc('0x35')](_0x53e3c6[_0x63fc('0x30')]['fields']));_0x3bb029[_0x63fc('0x34')]=_0x3bb029[_0x63fc('0x34')][_0x63fc('0x36')]?_0x3bb029['attributes']:_0x17c0fd[_0x63fc('0x2f')];if(!_0x53e3c6['query'][_0x63fc('0x37')](_0x63fc('0x38'))){_0x3bb029[_0x63fc('0x22')]=qs['limit'](_0x53e3c6[_0x63fc('0x30')][_0x63fc('0x22')]);_0x3bb029[_0x63fc('0x39')]=qs['offset'](_0x53e3c6[_0x63fc('0x30')]['offset']);}_0x3bb029[_0x63fc('0x3a')]=qs[_0x63fc('0x3b')](_0x53e3c6['query'][_0x63fc('0x3b')]);_0x3bb029[_0x63fc('0x3c')]=qs['filters'](_[_0x63fc('0x3d')](_0x53e3c6['query'],_0x17c0fd['filters']));if(_0x53e3c6['query']['filter']){_0x3bb029[_0x63fc('0x3c')]=_[_0x63fc('0x3e')](_0x3bb029[_0x63fc('0x3c')],{'$or':_['map'](_0x365653,function(_0x25a838){if(_0x25a838[_0x63fc('0x3f')]['key']!=='VIRTUAL'){var _0x213b0e={};_0x213b0e[_0x25a838[_0x63fc('0x40')]]={'$like':'%'+_0x53e3c6['query'][_0x63fc('0x41')]+'%'};return _0x213b0e;}})});}_0x3bb029=_[_0x63fc('0x3e')]({},_0x3bb029,_0x53e3c6['options']);var _0x51cc35={'where':_0x3bb029[_0x63fc('0x3c')]};_0x51cc35[_0x63fc('0x42')]=[];if(_0x53e3c6[_0x63fc('0x30')][_0x63fc('0x43')]){_0x51cc35[_0x63fc('0x42')][_0x63fc('0x44')]({'model':db[_0x63fc('0x45')],'as':_0x63fc('0x46'),'attributes':['id'],'where':{'id':_0x53e3c6[_0x63fc('0x30')][_0x63fc('0x43')]},'required':!![]});_0x51cc35['distinct']=!![];}if(_0x53e3c6[_0x63fc('0x30')][_0x63fc('0x47')]){_0x51cc35[_0x63fc('0x42')][_0x63fc('0x44')]({'model':db['OpenchannelMessage'],'as':_0x63fc('0x48'),'attributes':['id',_0x63fc('0x49'),_0x63fc('0x4a'),_0x63fc('0x47')],'where':{'direction':'in','read':_0x53e3c6[_0x63fc('0x30')][_0x63fc('0x47')]||![]},'required':!![]});_0x51cc35['distinct']=!![];}return db[_0x63fc('0x2d')][_0x63fc('0x21')](_0x51cc35)[_0x63fc('0x28')](function(_0x40b9c0){_0x41deb6[_0x63fc('0x21')]=_0x40b9c0;if(_0x53e3c6['query'][_0x63fc('0x4b')]){_0x3bb029[_0x63fc('0x42')]=[{'model':db[_0x63fc('0x4c')],'as':_0x63fc('0x4d'),'required':![],'attributes':['id',_0x63fc('0x4e'),_0x63fc('0x4f')]},{'model':db[_0x63fc('0x50')],'as':_0x63fc('0x51'),'required':![]},{'model':db[_0x63fc('0x4c')],'as':_0x63fc('0x52'),'attributes':[_0x63fc('0x4e'),'fullname',_0x63fc('0x53')],'required':![]},{'model':db['OpenchannelAccount'],'as':_0x63fc('0x54'),'attributes':['name',_0x63fc('0x55')],'required':![]},{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','direction',_0x63fc('0x4a'),'read'],'where':{'direction':'in','read':_0x53e3c6['query'][_0x63fc('0x47')]||![]},'required':_0x53e3c6['query']['read']||![]},{'model':db['Tag'],'as':_0x63fc('0x46'),'attributes':['id',_0x63fc('0x4e'),'color'],'required':_0x53e3c6[_0x63fc('0x30')]['tag']?!![]:![]},{'model':db[_0x63fc('0x45')],'as':'ThroughTags','attributes':['id',_0x63fc('0x4e'),_0x63fc('0x56')],'through':_0x53e3c6[_0x63fc('0x30')][_0x63fc('0x43')]?{'attributes':[],'where':{'TagId':_0x53e3c6[_0x63fc('0x30')][_0x63fc('0x43')]||undefined}}:{},'required':_0x53e3c6['query'][_0x63fc('0x43')]?!![]:![]}];}return db[_0x63fc('0x2d')][_0x63fc('0x57')](_0x3bb029);})[_0x63fc('0x28')](function(_0x4a35bf){_0x41deb6[_0x63fc('0x58')]=_0x4a35bf;return _0x41deb6;})[_0x63fc('0x28')](respondWithFilteredResult(_0x5ace6f,_0x3bb029))[_0x63fc('0x59')](handleError(_0x5ace6f,null));};exports['show']=function(_0x109354,_0x5c1db3){var _0x2f6738={'raw':![],'where':{'id':_0x109354[_0x63fc('0x5a')]['id']}},_0x379c43={};_0x379c43[_0x63fc('0x2f')]=_[_0x63fc('0x31')](db[_0x63fc('0x2d')][_0x63fc('0x2e')]);_0x379c43[_0x63fc('0x30')]=_[_0x63fc('0x31')](_0x109354[_0x63fc('0x30')]);_0x379c43[_0x63fc('0x32')]=_[_0x63fc('0x33')](_0x379c43['model'],_0x379c43[_0x63fc('0x30')]);_0x2f6738[_0x63fc('0x34')]=_[_0x63fc('0x33')](_0x379c43['model'],qs[_0x63fc('0x35')](_0x109354[_0x63fc('0x30')][_0x63fc('0x35')]));_0x2f6738[_0x63fc('0x34')]=_0x2f6738[_0x63fc('0x34')][_0x63fc('0x36')]?_0x2f6738[_0x63fc('0x34')]:_0x379c43[_0x63fc('0x2f')];if(_0x109354[_0x63fc('0x30')][_0x63fc('0x4b')]){_0x2f6738['include']=[{'all':!![]}];}_0x2f6738=_[_0x63fc('0x3e')]({},_0x2f6738,_0x109354[_0x63fc('0x5b')]);return db[_0x63fc('0x2d')][_0x63fc('0x5c')](_0x2f6738)[_0x63fc('0x28')](handleEntityNotFound(_0x5c1db3,null))[_0x63fc('0x28')](respondWithResult(_0x5c1db3,null))[_0x63fc('0x59')](handleError(_0x5c1db3,null));};exports[_0x63fc('0x5d')]=function(_0x108ca5,_0x27e634){return db[_0x63fc('0x2d')][_0x63fc('0x5d')](_0x108ca5[_0x63fc('0x5e')],{})[_0x63fc('0x28')](respondWithResult(_0x27e634,0xc9))[_0x63fc('0x59')](handleError(_0x27e634,null));};exports[_0x63fc('0x27')]=function(_0x54ac75,_0x29de1d){if(_0x54ac75[_0x63fc('0x5e')]['id']){delete _0x54ac75['body']['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x54ac75['params']['id']}})[_0x63fc('0x28')](handleEntityNotFound(_0x29de1d,null))['then'](saveUpdates(_0x54ac75[_0x63fc('0x5e')],null))[_0x63fc('0x28')](respondWithResult(_0x29de1d,null))[_0x63fc('0x59')](handleError(_0x29de1d,null));};exports['destroy']=function(_0x3dd54,_0x323291){return db[_0x63fc('0x2d')][_0x63fc('0x5c')]({'where':{'id':_0x3dd54[_0x63fc('0x5a')]['id']}})[_0x63fc('0x28')](handleEntityNotFound(_0x323291,null))['then'](removeEntity(_0x323291,null))['catch'](handleError(_0x323291,null));};exports[_0x63fc('0x5f')]=function(_0x165576,_0x255864){return db[_0x63fc('0x2d')][_0x63fc('0x5f')]()['then'](respondWithResult(_0x255864,null))['catch'](handleError(_0x255864,null));};exports['addMessage']=function(_0x5ba0bc,_0x5ebfdc,_0x537bfe){return db['OpenchannelMessage'][_0x63fc('0x5c')]({'where':{'id':_0x5ba0bc['params']['id']}})[_0x63fc('0x28')](handleEntityNotFound(_0x5ebfdc,null))[_0x63fc('0x28')](function(_0x58ca38){if(_0x58ca38){return _0x58ca38[_0x63fc('0x60')](_0x5ba0bc[_0x63fc('0x5e')]['ids'],_[_0x63fc('0x61')](_0x5ba0bc[_0x63fc('0x5e')],[_0x63fc('0x62'),'id'])||{});}})[_0x63fc('0x28')](respondWithResult(_0x5ebfdc,null))[_0x63fc('0x59')](handleError(_0x5ebfdc,null));};exports[_0x63fc('0x63')]=function(_0x5af5bf,_0x39c5e9,_0xf37e17){var _0x4a853f={'raw':![],'where':{}};var _0xa9a49c={};var _0x12f4bf={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x5af5bf[_0x63fc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x39c5e9,null))[_0x63fc('0x28')](function(_0x8eac9a){if(_0x8eac9a){_0xa9a49c[_0x63fc('0x2f')]=_[_0x63fc('0x31')](db[_0x63fc('0x64')]['rawAttributes']);_0xa9a49c['query']=_[_0x63fc('0x31')](_0x5af5bf[_0x63fc('0x30')]);_0xa9a49c[_0x63fc('0x32')]=_[_0x63fc('0x33')](_0xa9a49c[_0x63fc('0x2f')],_0xa9a49c[_0x63fc('0x30')]);_0x4a853f[_0x63fc('0x34')]=_[_0x63fc('0x33')](_0xa9a49c[_0x63fc('0x2f')],qs[_0x63fc('0x35')](_0x5af5bf[_0x63fc('0x30')][_0x63fc('0x35')]));_0x4a853f[_0x63fc('0x34')]=_0x4a853f[_0x63fc('0x34')]['length']?_0x4a853f['attributes']:_0xa9a49c[_0x63fc('0x2f')];if(!_0x5af5bf[_0x63fc('0x30')][_0x63fc('0x37')](_0x63fc('0x38'))){_0x4a853f[_0x63fc('0x22')]=qs['limit'](_0x5af5bf[_0x63fc('0x30')][_0x63fc('0x22')]);_0x4a853f[_0x63fc('0x39')]=qs[_0x63fc('0x39')](_0x5af5bf['query'][_0x63fc('0x39')]);}_0x4a853f[_0x63fc('0x3a')]=qs[_0x63fc('0x3b')](_0x5af5bf[_0x63fc('0x30')][_0x63fc('0x3b')]);_0x4a853f['where']=qs[_0x63fc('0x32')](_[_0x63fc('0x3d')](_0x5af5bf[_0x63fc('0x30')],_0xa9a49c['filters']));_0x4a853f[_0x63fc('0x3c')]['OpenchannelInteractionId']=_0x8eac9a['id'];if(_0x5af5bf['query']['filter']){_0x4a853f[_0x63fc('0x3c')]=_[_0x63fc('0x3e')](_0x4a853f[_0x63fc('0x3c')],{'$or':_[_0x63fc('0x65')](_0x4a853f[_0x63fc('0x34')],function(_0x203d7c){var _0x20523e={};_0x20523e[_0x203d7c]={'$like':'%'+_0x5af5bf[_0x63fc('0x30')][_0x63fc('0x41')]+'%'};return _0x20523e;})});}if(_0x5af5bf['query'][_0x63fc('0x66')]){var _0x1c1305=_0x5af5bf['query'][_0x63fc('0x66')][_0x63fc('0x67')](',');var _0x505c7b={};_0x505c7b[_0x1c1305[0x0]]={'$gte':moment(_0x1c1305[0x1])[_0x63fc('0x68')](_0x63fc('0x69'))};_0x4a853f[_0x63fc('0x3c')]=_[_0x63fc('0x3e')](_0x4a853f[_0x63fc('0x3c')],_0x505c7b);}_0x4a853f=_[_0x63fc('0x3e')]({},_0x4a853f,_0x5af5bf[_0x63fc('0x5b')]);return db[_0x63fc('0x64')][_0x63fc('0x21')]({'where':_0x4a853f[_0x63fc('0x3c')]})[_0x63fc('0x28')](function(_0x1b8366){_0x12f4bf['count']=_0x1b8366;if(_0x5af5bf['query'][_0x63fc('0x4b')]){_0x4a853f[_0x63fc('0x42')]=[{'all':!![]}];}return db[_0x63fc('0x64')][_0x63fc('0x57')](_0x4a853f);})[_0x63fc('0x28')](function(_0x43ffc5){_0x12f4bf['rows']=_0x43ffc5;return _0x12f4bf;});}})[_0x63fc('0x28')](respondWithFilteredResult(_0x39c5e9,_0x4a853f))[_0x63fc('0x59')](handleError(_0x39c5e9,null));};exports[_0x63fc('0x6a')]=function(_0x493883,_0x21a7cf,_0x4bcf5c){return db[_0x63fc('0x2d')][_0x63fc('0x5c')]({'where':{'id':_0x493883[_0x63fc('0x5a')]['id']}})[_0x63fc('0x28')](handleEntityNotFound(_0x21a7cf,null))[_0x63fc('0x28')](function(_0x5719f7){if(_0x5719f7){return _0x5719f7[_0x63fc('0x6b')](_0x493883[_0x63fc('0x5e')]['ids'],_[_0x63fc('0x61')](_0x493883[_0x63fc('0x5e')],[_0x63fc('0x62'),'id'])||{})[_0x63fc('0x6c')](function(){return db[_0x63fc('0x45')][_0x63fc('0x57')]({'attributes':['id',_0x63fc('0x4e'),_0x63fc('0x56')],'where':{'id':_0x493883[_0x63fc('0x5e')][_0x63fc('0x62')]}});})[_0x63fc('0x28')](function(_0x594865){socket[_0x63fc('0x6d')](_0x63fc('0x6e'),{'id':Number(_0x493883[_0x63fc('0x5a')]['id']),'tags':_0x594865||[]});return{'id':Number(_0x493883['params']['id']),'tags':_0x594865||[]};});}})['then'](respondWithResult(_0x21a7cf,null))[_0x63fc('0x59')](handleError(_0x21a7cf,null));};exports[_0x63fc('0x6f')]=function(_0x15e10d,_0x491072,_0xee4a68){var _0x536b8d;return db[_0x63fc('0x2d')]['find']({'where':{'id':_0x15e10d['params']['id']}})[_0x63fc('0x28')](handleEntityNotFound(_0x491072,null))[_0x63fc('0x28')](function(_0x285392){if(_0x285392){return _0x285392['removeTags'](_0x15e10d[_0x63fc('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x491072,null))[_0x63fc('0x59')](handleError(_0x491072,null));};exports['download']=function(_0x440f33,_0x31eab9){var _0x318dae=moment()[_0x63fc('0x70')]()['toString']();var _0x7c9780=path[_0x63fc('0x71')](config[_0x63fc('0x72')],_0x63fc('0x73'),_0x63fc('0x74'),_0x63fc('0x75'));var _0x4c1c90=path[_0x63fc('0x71')](config['root'],_0x63fc('0x73'),_0x63fc('0x74'),'attachments');var _0x2342e9=path[_0x63fc('0x71')](_0x7c9780,_0x318dae);var _0xe11189=util[_0x63fc('0x68')](_0x63fc('0x76'),_0x318dae);var _0x14ccf5=path['join'](_0x7c9780,_0xe11189);var _0x185815=![];return db[_0x63fc('0x2d')][_0x63fc('0x5c')]({'where':{'id':_0x440f33[_0x63fc('0x5a')]['id']},'include':[{'model':db[_0x63fc('0x64')],'as':_0x63fc('0x48'),'attributes':['id','body'],'include':[{'model':db[_0x63fc('0x4c')],'as':_0x63fc('0x4c'),'attributes':['id',_0x63fc('0x4f')],'raw':!![]},{'model':db[_0x63fc('0x50')],'as':'Contact','attributes':['id',_0x63fc('0x77')],'raw':!![]},{'model':db[_0x63fc('0x78')],'as':_0x63fc('0x78'),'raw':!![]}]}]})[_0x63fc('0x28')](handleEntityNotFound(_0x31eab9,null))['then'](function(_0x4793c0){if(_0x4793c0){_0x185815=!![];var _0x5c6fac='';var _0x4b2cf8={'format':'Letter','border':_0x63fc('0x79')};fs[_0x63fc('0x7a')](_0x2342e9);_0x5c6fac+=util[_0x63fc('0x68')]('

Openchannel\x20Interaction:\x20#%d

',_0x4793c0['id']);_0x5c6fac+=util['format'](_0x63fc('0x7b'),moment()[_0x63fc('0x68')](_0x63fc('0x7c'))['toString']());_0x5c6fac+=_0x63fc('0x7d');for(var _0x3c0d7e=0x0;_0x3c0d7e<_0x4793c0[_0x63fc('0x48')]['length'];_0x3c0d7e++){var _0x7d1bbc=_0x4793c0[_0x63fc('0x48')][_0x3c0d7e];_0x5c6fac+=_0x63fc('0x7e');_0x5c6fac+=util[_0x63fc('0x68')]('%s:\x20%s

',_0x7d1bbc[_0x63fc('0x4c')]?_0x7d1bbc[_0x63fc('0x4c')]['fullname']:_0x7d1bbc[_0x63fc('0x51')][_0x63fc('0x77')],_0x7d1bbc[_0x63fc('0x5e')]);_0x5c6fac+=_0x63fc('0x7f');if(_0x7d1bbc[_0x63fc('0x78')]){var _0xc82af7=_0x7d1bbc[_0x63fc('0x78')];var _0x3cdcd1=path['join'](_0x4c1c90,_0xc82af7[_0x63fc('0x80')]);if(fs[_0x63fc('0x81')](_0x3cdcd1)){fs[_0x63fc('0x82')](_0x3cdcd1)[_0x63fc('0x83')](fs[_0x63fc('0x84')](path[_0x63fc('0x71')](_0x2342e9,_0xc82af7[_0x63fc('0x80')])));}}}return new BPromise(function(_0x2508fd,_0xdd6881){pdf[_0x63fc('0x5d')](_0x5c6fac,_0x4b2cf8)[_0x63fc('0x85')](path[_0x63fc('0x71')](_0x2342e9,_0x63fc('0x86')+_0x318dae+'.pdf'),function(_0x216186,_0x27419c){if(_0x216186)return _0xdd6881(_0x216186);_0x2508fd(_0x27419c);});});}})['then'](function(){if(_0x185815){return new BPromise(function(_0x1e7bbd,_0x4ed880){zipdir(_0x2342e9,{'saveTo':_0x14ccf5},function(_0x12629c,_0x21fab3){if(_0x12629c)return _0x4ed880(_0x12629c);return _0x1e7bbd(_0x21fab3);});});}})['then'](function(){if(_0x185815){return new BPromise(function(_0x387f19,_0x1cf264){rimraf(_0x2342e9,function(_0x4ce113){if(_0x4ce113)_0x1cf264(_0x4ce113);return _0x387f19();});});}})['then'](function(){if(_0x185815){return _0x31eab9[_0x63fc('0x87')](_0x14ccf5,_0xe11189,function(_0x33ef7c){if(_0x33ef7c){console[_0x63fc('0x88')](_0x63fc('0x89'),_0x33ef7c);}else{fs['unlinkSync'](_0x14ccf5);}});}else{return _0x31eab9[_0x63fc('0x1d')](0xc8);}})['catch'](handleError(_0x31eab9,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 4b9cf36..60b9775 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 _0x29ef=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelInteraction','setMaxListeners'];(function(_0x36db31,_0x2ba011){var _0x6e019f=function(_0x3ec851){while(--_0x3ec851){_0x36db31['push'](_0x36db31['shift']());}};_0x6e019f(++_0x2ba011);}(_0x29ef,0x192));var _0xf29e=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x29ef[_0x3b5ad9];return _0x611ae9;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xf29e('0x0'))['db'][_0xf29e('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf29e('0x2')](0x0);var events={'afterCreate':_0xf29e('0x3'),'afterUpdate':_0xf29e('0x4'),'afterDestroy':_0xf29e('0x5')};function emitEvent(_0x2828e4){return function(_0x1bc235,_0x4aac61,_0x1e1f4a){OpenchannelInteractionEvents[_0xf29e('0x6')](_0x2828e4+':'+_0x1bc235['id'],_0x1bc235);OpenchannelInteractionEvents[_0xf29e('0x6')](_0x2828e4,_0x1bc235);_0x1e1f4a(null);};}for(var e in events){if(events[_0xf29e('0x7')](e)){var event=events[e];OpenchannelInteraction[_0xf29e('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x7aee=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7aee,0x172));var _0xe7ae=function(_0x2d8fdb,_0x4f7b6a){_0x2d8fdb=_0x2d8fdb-0x0;var _0x5af120=_0x7aee[_0x2d8fdb];return _0x5af120;};'use strict';var EventEmitter=require(_0xe7ae('0x0'));var OpenchannelInteraction=require(_0xe7ae('0x1'))['db']['OpenchannelInteraction'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe7ae('0x2')](0x0);var events={'afterCreate':_0xe7ae('0x3'),'afterUpdate':_0xe7ae('0x4'),'afterDestroy':'remove'};function emitEvent(_0x368b67){return function(_0x58da17,_0x565324,_0x1833c0){OpenchannelInteractionEvents[_0xe7ae('0x5')](_0x368b67+':'+_0x58da17['id'],_0x58da17);OpenchannelInteractionEvents['emit'](_0x368b67,_0x58da17);_0x1833c0(null);};}for(var e in events){if(events[_0xe7ae('0x6')](e)){var event=events[e];OpenchannelInteraction[_0xe7ae('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 88f5889..f20ded3 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 _0x5bef=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','request-promise','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','changed'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x5bef,0x117));var _0xf5be=function(_0x44ebe8,_0x8a366){_0x44ebe8=_0x44ebe8-0x0;var _0x4920f5=_0x5bef[_0x44ebe8];return _0x4920f5;};'use strict';var _=require(_0xf5be('0x0'));var util=require(_0xf5be('0x1'));var logger=require(_0xf5be('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5be('0x3'));var attributes=require(_0xf5be('0x4'));module['exports']=function(_0x1f9da5,_0x5fef4d){return _0x1f9da5[_0xf5be('0x5')](_0xf5be('0x6'),attributes,{'tableName':_0xf5be('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5bafec,_0x378808,_0x1ac979){if(_0x5bafec[_0xf5be('0x8')]('closed')){_0x5bafec[_0xf5be('0x9')]=moment()[_0xf5be('0xa')](_0xf5be('0xb'));}_0x1ac979(null,_0x5bafec);}}});}; \ No newline at end of file +var _0x5213=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','bluebird','request-promise','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','changed'];(function(_0x56784e,_0x1785b3){var _0x3ab06b=function(_0x18f271){while(--_0x18f271){_0x56784e['push'](_0x56784e['shift']());}};_0x3ab06b(++_0x1785b3);}(_0x5213,0xc7));var _0x3521=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x5213[_0x459423];return _0x42ed14;};'use strict';var _=require('lodash');var util=require(_0x3521('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3521('0x1'));var BPromise=require(_0x3521('0x2'));var rp=require(_0x3521('0x3'));var attributes=require(_0x3521('0x4'));module['exports']=function(_0x15ad53,_0x45479f){return _0x15ad53[_0x3521('0x5')](_0x3521('0x6'),attributes,{'tableName':_0x3521('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x309530,_0x5d3a9b,_0x1c836c){if(_0x309530[_0x3521('0x8')](_0x3521('0x9'))){_0x309530[_0x3521('0xa')]=moment()[_0x3521('0xb')](_0x3521('0xc'));}_0x1c836c(null,_0x309530);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 2485414..97bcc8f 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 _0x4975=['result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','info','catch','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message'];(function(_0x577c50,_0x28aabd){var _0x33f3f1=function(_0x2452bd){while(--_0x2452bd){_0x577c50['push'](_0x577c50['shift']());}};_0x33f3f1(++_0x28aabd);}(_0x4975,0x86));var _0x5497=function(_0x252b98,_0x25678a){_0x252b98=_0x252b98-0x0;var _0x15ff63=_0x4975[_0x252b98];return _0x15ff63;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});config['redis']=_[_0x5497('0xc')](config[_0x5497('0xd')],{'host':_0x5497('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5497('0xd')]));require('./openchannelInteraction.socket')[_0x5497('0xf')](socket);function respondWithRpcPromise(_0x29c93f,_0x2ec5a4,_0x32a8a2){return new BPromise(function(_0x131627,_0x425288){return client[_0x5497('0x10')](_0x29c93f,_0x32a8a2)[_0x5497('0x11')](function(_0x50d716){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x2ec5a4,_0x5497('0x12'));logger[_0x5497('0x13')](_0x5497('0x14'),_0x2ec5a4,_0x5497('0x12'),JSON[_0x5497('0x15')](_0x50d716));if(_0x50d716[_0x5497('0x16')]){if(_0x50d716[_0x5497('0x16')][_0x5497('0x17')]===0x1f4){logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0x50d716['error'][_0x5497('0x19')]);return _0x425288(_0x50d716['error'][_0x5497('0x19')]);}logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0x50d716[_0x5497('0x16')][_0x5497('0x19')]);return _0x131627(_0x50d716[_0x5497('0x16')][_0x5497('0x19')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x2ec5a4,_0x5497('0x12'));_0x131627(_0x50d716[_0x5497('0x1a')][_0x5497('0x19')]);}})['catch'](function(_0xbf1ba7){logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0xbf1ba7);_0x425288(_0xbf1ba7);});});}exports[_0x5497('0x1b')]=function(_0x1b1b43){var _0x1f6f18=this;return new Promise(function(_0x16d378,_0x10226f){return db[_0x5497('0x1c')][_0x5497('0x1d')](_0x1b1b43[_0x5497('0x1e')],{'raw':_0x1b1b43['options']?_0x1b1b43[_0x5497('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b1b43[_0x5497('0x1f')]?_0x1b1b43[_0x5497('0x1f')][_0x5497('0x20')]||null:null,'attributes':_0x1b1b43[_0x5497('0x1f')]?_0x1b1b43[_0x5497('0x1f')][_0x5497('0x21')]||null:null,'limit':_0x1b1b43['options']?_0x1b1b43['options'][_0x5497('0x22')]||null:null})[_0x5497('0x11')](function(_0x24482a){logger[_0x5497('0x23')]('UpdateOpenchannelInteraction',_0x1b1b43);logger[_0x5497('0x13')]('UpdateOpenchannelInteraction',_0x1b1b43,JSON[_0x5497('0x15')](_0x24482a));_0x16d378(_0x24482a);})[_0x5497('0x24')](function(_0x429d36){logger[_0x5497('0x16')](_0x5497('0x1b'),_0x429d36[_0x5497('0x19')],_0x1b1b43);_0x10226f(_0x1f6f18['error'](0x1f4,_0x429d36[_0x5497('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x583d06){return new Promise(function(_0x498f15,_0x39a2b7){return db['OpenchannelInteraction']['find']({'where':_0x583d06[_0x5497('0x1f')]?_0x583d06[_0x5497('0x1f')][_0x5497('0x20')]||null:null})['then'](function(_0x59380f){if(_0x59380f){return _0x59380f['addTags'](_0x583d06[_0x5497('0x1e')][_0x5497('0x25')],_[_0x5497('0x26')](_0x583d06['body'],['ids','id'])||{});}})['spread'](function(_0xa28dd8){logger['info'](_0x5497('0x27'),_0x583d06);logger[_0x5497('0x13')](_0x5497('0x27'),_0x583d06,JSON['stringify'](_0xa28dd8));_0x498f15(_0xa28dd8);})[_0x5497('0x24')](function(_0x32aba1){logger['error'](_0x5497('0x27'),_0x32aba1[_0x5497('0x19')],_0x583d06);_0x39a2b7(_this[_0x5497('0x16')](0x1f4,_0x32aba1['message']));});});}; \ No newline at end of file +var _0xcb66=['result','OpenchannelInteraction','update','options','raw','then','UpdateOpenchannelInteraction','catch','AddTagsToOpenchannelInteraction','where','addTags','body','omit','ids','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x27fa65,_0x4e02ee){var _0x456594=function(_0x43b6da){while(--_0x43b6da){_0x27fa65['push'](_0x27fa65['shift']());}};_0x456594(++_0x4e02ee);}(_0xcb66,0x19f));var _0x6cb6=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xcb66[_0x3c504b];return _0x2e5354;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var moment=require(_0x6cb6('0x1'));var BPromise=require(_0x6cb6('0x2'));var rs=require(_0x6cb6('0x3'));var fs=require('fs');var Redis=require(_0x6cb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cb6('0x5'));var logger=require(_0x6cb6('0x6'))(_0x6cb6('0x7'));var config=require(_0x6cb6('0x8'));var jayson=require(_0x6cb6('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x6cb6('0xa')]=_[_0x6cb6('0xb')](config[_0x6cb6('0xa')],{'host':_0x6cb6('0xc'),'port':0x18eb});var socket=require(_0x6cb6('0xd'))(new Redis(config[_0x6cb6('0xa')]));require(_0x6cb6('0xe'))[_0x6cb6('0xf')](socket);function respondWithRpcPromise(_0x332bce,_0x357ada,_0x3aa2b5){return new BPromise(function(_0xb7e9e,_0x1828f6){return client['request'](_0x332bce,_0x3aa2b5)['then'](function(_0x576aea){logger['info'](_0x6cb6('0x10'),_0x357ada,_0x6cb6('0x11'));logger[_0x6cb6('0x12')](_0x6cb6('0x13'),_0x357ada,'request\x20sent',JSON[_0x6cb6('0x14')](_0x576aea));if(_0x576aea[_0x6cb6('0x15')]){if(_0x576aea['error'][_0x6cb6('0x16')]===0x1f4){logger[_0x6cb6('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x357ada,_0x576aea[_0x6cb6('0x15')][_0x6cb6('0x17')]);return _0x1828f6(_0x576aea['error']['message']);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x357ada,_0x576aea[_0x6cb6('0x15')][_0x6cb6('0x17')]);return _0xb7e9e(_0x576aea[_0x6cb6('0x15')][_0x6cb6('0x17')]);}else{logger[_0x6cb6('0x18')](_0x6cb6('0x10'),_0x357ada,'request\x20sent');_0xb7e9e(_0x576aea[_0x6cb6('0x19')][_0x6cb6('0x17')]);}})['catch'](function(_0x4b9da5){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x357ada,_0x4b9da5);_0x1828f6(_0x4b9da5);});});}exports['UpdateOpenchannelInteraction']=function(_0x5e5349){var _0x390c9b=this;return new Promise(function(_0xcd1afa,_0x407455){return db[_0x6cb6('0x1a')][_0x6cb6('0x1b')](_0x5e5349['body'],{'raw':_0x5e5349['options']?_0x5e5349[_0x6cb6('0x1c')][_0x6cb6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e5349[_0x6cb6('0x1c')]?_0x5e5349[_0x6cb6('0x1c')]['where']||null:null,'attributes':_0x5e5349[_0x6cb6('0x1c')]?_0x5e5349[_0x6cb6('0x1c')]['attributes']||null:null,'limit':_0x5e5349['options']?_0x5e5349[_0x6cb6('0x1c')]['limit']||null:null})[_0x6cb6('0x1e')](function(_0x457865){logger[_0x6cb6('0x18')](_0x6cb6('0x1f'),_0x5e5349);logger[_0x6cb6('0x12')](_0x6cb6('0x1f'),_0x5e5349,JSON[_0x6cb6('0x14')](_0x457865));_0xcd1afa(_0x457865);})[_0x6cb6('0x20')](function(_0x1cc1ed){logger[_0x6cb6('0x15')]('UpdateOpenchannelInteraction',_0x1cc1ed['message'],_0x5e5349);_0x407455(_0x390c9b['error'](0x1f4,_0x1cc1ed[_0x6cb6('0x17')]));});});};exports[_0x6cb6('0x21')]=function(_0xf07150){return new Promise(function(_0x151c69,_0x1f8c9d){return db[_0x6cb6('0x1a')]['find']({'where':_0xf07150[_0x6cb6('0x1c')]?_0xf07150['options'][_0x6cb6('0x22')]||null:null})['then'](function(_0x13126c){if(_0x13126c){return _0x13126c[_0x6cb6('0x23')](_0xf07150[_0x6cb6('0x24')]['ids'],_[_0x6cb6('0x25')](_0xf07150[_0x6cb6('0x24')],[_0x6cb6('0x26'),'id'])||{});}})['spread'](function(_0x1c4942){logger[_0x6cb6('0x18')](_0x6cb6('0x27'),_0xf07150);logger['debug'](_0x6cb6('0x27'),_0xf07150,JSON[_0x6cb6('0x14')](_0x1c4942));_0x151c69(_0x1c4942);})['catch'](function(_0x2a8ae0){logger[_0x6cb6('0x15')](_0x6cb6('0x27'),_0x2a8ae0[_0x6cb6('0x17')],_0xf07150);_0x1f8c9d(_this[_0x6cb6('0x15')](0x1f4,_0x2a8ae0[_0x6cb6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index b5b1b53..1a4a2d2 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 _0xceef=['./openchannelInteraction.events','remove','update','emit','removeListener','register','openchannelInteraction:'];(function(_0x46cb35,_0x2b92ab){var _0x847507=function(_0x29b091){while(--_0x29b091){_0x46cb35['push'](_0x46cb35['shift']());}};_0x847507(++_0x2b92ab);}(_0xceef,0x134));var _0xfcee=function(_0x8b3778,_0x4453db){_0x8b3778=_0x8b3778-0x0;var _0x53bdc8=_0xceef[_0x8b3778];return _0x53bdc8;};'use strict';var OpenchannelInteractionEvents=require(_0xfcee('0x0'));var events=['save',_0xfcee('0x1'),_0xfcee('0x2')];function createListener(_0x427259,_0x258b2f){return function(_0x8b18ec){_0x258b2f[_0xfcee('0x3')](_0x427259,_0x8b18ec);};}function removeListener(_0x5cb513,_0x386140){return function(){OpenchannelInteractionEvents[_0xfcee('0x4')](_0x5cb513,_0x386140);};}exports[_0xfcee('0x5')]=function(_0x15d617){for(var _0x14f8ae=0x0,_0x3fa3e0=events['length'];_0x14f8ae<_0x3fa3e0;_0x14f8ae++){var _0x2aa361=events[_0x14f8ae];var _0x899673=createListener(_0xfcee('0x6')+_0x2aa361,_0x15d617);OpenchannelInteractionEvents['on'](_0x2aa361,_0x899673);}}; \ No newline at end of file +var _0x2cac=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5c8d53,_0x5dfe5d){var _0x484f1c=function(_0x5dd86f){while(--_0x5dd86f){_0x5c8d53['push'](_0x5c8d53['shift']());}};_0x484f1c(++_0x5dfe5d);}(_0x2cac,0x157));var _0xc2ca=function(_0x1e62b8,_0x5eed4c){_0x1e62b8=_0x1e62b8-0x0;var _0x2ab271=_0x2cac[_0x1e62b8];return _0x2ab271;};'use strict';var OpenchannelInteractionEvents=require(_0xc2ca('0x0'));var events=[_0xc2ca('0x1'),_0xc2ca('0x2'),_0xc2ca('0x3')];function createListener(_0x1ec20f,_0x335645){return function(_0x5ddd5a){_0x335645[_0xc2ca('0x4')](_0x1ec20f,_0x5ddd5a);};}function removeListener(_0xbc985d,_0x352bfe){return function(){OpenchannelInteractionEvents[_0xc2ca('0x5')](_0xbc985d,_0x352bfe);};}exports[_0xc2ca('0x6')]=function(_0x406a0d){for(var _0x5a2634=0x0,_0x22b30e=events[_0xc2ca('0x7')];_0x5a2634<_0x22b30e;_0x5a2634++){var _0x177b35=events[_0x5a2634];var _0x3cb92f=createListener(_0xc2ca('0x8')+_0x177b35,_0x406a0d);OpenchannelInteractionEvents['on'](_0x177b35,_0x3cb92f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 0260a25..f08cae1 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 _0xea7b=['post','tracked','openchannel','create','put','/:id/reject','reject','delete','exports','multer','util','path','express','Router','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x17a74e,_0x4fa575){var _0x1fbe39=function(_0x40eb0d){while(--_0x40eb0d){_0x17a74e['push'](_0x17a74e['shift']());}};_0x1fbe39(++_0x4fa575);}(_0xea7b,0x169));var _0xbea7=function(_0x1a3c7b,_0x1ea75b){_0x1a3c7b=_0x1a3c7b-0x0;var _0x547ba4=_0xea7b[_0x1a3c7b];return _0x547ba4;};'use strict';var multer=require(_0xbea7('0x0'));var util=require(_0xbea7('0x1'));var path=require(_0xbea7('0x2'));var timeout=require('connect-timeout');var express=require(_0xbea7('0x3'));var router=express[_0xbea7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbea7('0x5'));var config=require('../../config/environment');var controller=require(_0xbea7('0x6'));router[_0xbea7('0x7')]('/',auth[_0xbea7('0x8')](),controller[_0xbea7('0x9')]);router[_0xbea7('0x7')]('/describe',auth[_0xbea7('0x8')](),controller[_0xbea7('0xa')]);router[_0xbea7('0x7')](_0xbea7('0xb'),auth[_0xbea7('0x8')](),controller[_0xbea7('0xc')]);router[_0xbea7('0xd')]('/',auth[_0xbea7('0x8')](),interaction[_0xbea7('0xe')](_0xbea7('0xf'),'openchannelmessage:create'),controller[_0xbea7('0x10')]);router[_0xbea7('0x11')](_0xbea7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xbea7('0x11')]('/:id/accept',auth[_0xbea7('0x8')](),controller['accept']);router['put'](_0xbea7('0x12'),auth[_0xbea7('0x8')](),controller[_0xbea7('0x13')]);router[_0xbea7('0x14')](_0xbea7('0xb'),auth[_0xbea7('0x8')](),controller['destroy']);module[_0xbea7('0x15')]=router; \ No newline at end of file +var _0x9dbd=['express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','/describe','isAuthenticated','describe','post','tracked','create','put','update','/:id/accept','accept','reject','delete','/:id','destroy','exports','path','connect-timeout'];(function(_0x21c21d,_0x5569f7){var _0x4101fb=function(_0x40e527){while(--_0x40e527){_0x21c21d['push'](_0x21c21d['shift']());}};_0x4101fb(++_0x5569f7);}(_0x9dbd,0xa6));var _0xd9db=function(_0x4e5f73,_0x5dd5d7){_0x4e5f73=_0x4e5f73-0x0;var _0x1235ce=_0x9dbd[_0x4e5f73];return _0x1235ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd9db('0x0'));var timeout=require(_0xd9db('0x1'));var express=require(_0xd9db('0x2'));var router=express[_0xd9db('0x3')]();var auth=require(_0xd9db('0x4'));var interaction=require(_0xd9db('0x5'));var config=require('../../config/environment');var controller=require(_0xd9db('0x6'));router[_0xd9db('0x7')]('/',auth['isAuthenticated'](),controller[_0xd9db('0x8')]);router[_0xd9db('0x7')](_0xd9db('0x9'),auth[_0xd9db('0xa')](),controller[_0xd9db('0xb')]);router['get']('/:id',auth[_0xd9db('0xa')](),controller['show']);router[_0xd9db('0xc')]('/',auth['isAuthenticated'](),interaction[_0xd9db('0xd')]('openchannel','openchannelmessage:create'),controller[_0xd9db('0xe')]);router[_0xd9db('0xf')]('/:id',auth[_0xd9db('0xa')](),controller[_0xd9db('0x10')]);router[_0xd9db('0xf')](_0xd9db('0x11'),auth[_0xd9db('0xa')](),controller[_0xd9db('0x12')]);router[_0xd9db('0xf')]('/:id/reject',auth[_0xd9db('0xa')](),controller[_0xd9db('0x13')]);router[_0xd9db('0x14')](_0xd9db('0x15'),auth[_0xd9db('0xa')](),controller[_0xd9db('0x16')]);module[_0xd9db('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 024b94f..2724500 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 _0xb556=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1dbd5c,_0x3b12c3){var _0x253e32=function(_0x9a4027){while(--_0x9a4027){_0x1dbd5c['push'](_0x1dbd5c['shift']());}};_0x253e32(++_0x3b12c3);}(_0xb556,0xcd));var _0x6b55=function(_0x12a7a1,_0x23ecdf){_0x12a7a1=_0x12a7a1-0x0;var _0x25ffb7=_0xb556[_0x12a7a1];return _0x25ffb7;};'use strict';var Sequelize=require(_0x6b55('0x0'));module['exports']={'body':{'type':Sequelize[_0x6b55('0x1')](_0x6b55('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6b55('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6b55('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6b55('0x4')]('in',_0x6b55('0x5')),'defaultValue':_0x6b55('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6b55('0x6')]}}; \ No newline at end of file +var _0x6f24=['medium','ENUM','out','exports'];(function(_0x58c09f,_0x4675de){var _0x461ba4=function(_0x3da780){while(--_0x3da780){_0x58c09f['push'](_0x58c09f['shift']());}};_0x461ba4(++_0x4675de);}(_0x6f24,0x8b));var _0x46f2=function(_0x414655,_0x79d916){_0x414655=_0x414655-0x0;var _0x237884=_0x6f24[_0x414655];return _0x237884;};'use strict';var Sequelize=require('sequelize');module[_0x46f2('0x0')]={'body':{'type':Sequelize['TEXT'](_0x46f2('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x46f2('0x2')]('in',_0x46f2('0x3')),'defaultValue':_0x46f2('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 92b273b..9dade3c 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 _0x1fc9=['querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','OpenchannelMessage','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','show','rawAttributes','length','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','read1stAt','interaction','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x3f55de,_0x3ae98f){var _0x2698de=function(_0x48f021){while(--_0x48f021){_0x3f55de['push'](_0x3f55de['shift']());}};_0x2698de(++_0x3ae98f);}(_0x1fc9,0x1c5));var _0x91fc=function(_0x1d40ff,_0x2aa09b){_0x1d40ff=_0x1d40ff-0x0;var _0x5b4e88=_0x1fc9[_0x1d40ff];return _0x5b4e88;};'use strict';var pdf=require(_0x91fc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91fc('0x1'));var zipdir=require(_0x91fc('0x2'));var jsonpatch=require(_0x91fc('0x3'));var rp=require('request-promise');var moment=require(_0x91fc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91fc('0x5'));var util=require(_0x91fc('0x6'));var path=require(_0x91fc('0x7'));var sox=require(_0x91fc('0x8'));var csv=require(_0x91fc('0x9'));var ejs=require(_0x91fc('0xa'));var fs=require('fs');var _=require(_0x91fc('0xb'));var squel=require(_0x91fc('0xc'));var crypto=require('crypto');var jsforce=require(_0x91fc('0xd'));var deskjs=require(_0x91fc('0xe'));var toCsv=require(_0x91fc('0x9'));var querystring=require(_0x91fc('0xf'));var Papa=require(_0x91fc('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x91fc('0x11'))(_0x91fc('0x12'));var utils=require(_0x91fc('0x13'));var config=require(_0x91fc('0x14'));var db=require(_0x91fc('0x15'))['db'];config[_0x91fc('0x16')]=_['defaults'](config[_0x91fc('0x16')],{'host':_0x91fc('0x17'),'port':0x18eb});var socket=require(_0x91fc('0x18'))(new Redis(config[_0x91fc('0x16')]));require('./openchannelMessage.socket')[_0x91fc('0x19')](socket);var jayson=require(_0x91fc('0x1a'));var client=jayson[_0x91fc('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x91fc('0x1b')][_0x91fc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x39c937,_0x5f18aa,_0x3548a7,_0x4911b9){return new BPromise(function(_0x3c0147,_0xce833d){var _0x14a4e8=_0x4911b9||client;return _0x14a4e8[_0x91fc('0x1d')](_0x39c937,_0x3548a7)[_0x91fc('0x1e')](function(_0x4000be){logger[_0x91fc('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x5f18aa,_0x91fc('0x20'));logger[_0x91fc('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x5f18aa,_0x91fc('0x20'),JSON[_0x91fc('0x22')](_0x4000be));if(_0x4000be[_0x91fc('0x23')]){if(_0x4000be[_0x91fc('0x23')][_0x91fc('0x24')]===0x1f4){logger[_0x91fc('0x23')](_0x91fc('0x25'),_0x5f18aa,_0x4000be[_0x91fc('0x23')][_0x91fc('0x26')]);return _0xce833d(_0x4000be['error'][_0x91fc('0x26')]);}logger['error'](_0x91fc('0x25'),_0x5f18aa,_0x4000be['error'][_0x91fc('0x26')]);return _0x3c0147(_0x4000be['error'][_0x91fc('0x26')]);}else{logger[_0x91fc('0x1f')](_0x91fc('0x25'),_0x5f18aa,'request\x20sent');_0x3c0147(_0x4000be[_0x91fc('0x27')][_0x91fc('0x26')]);}})[_0x91fc('0x28')](function(_0x470405){logger[_0x91fc('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x5f18aa,_0x470405);_0xce833d(_0x470405);});});}function respondWithStatusCode(_0x47a40f,_0x4360aa){_0x4360aa=_0x4360aa||0xcc;return function(_0x19d0e8){if(_0x19d0e8){return _0x47a40f['sendStatus'](_0x4360aa);}return _0x47a40f[_0x91fc('0x29')](_0x4360aa)[_0x91fc('0x2a')]();};}function respondWithResult(_0x2df35c,_0x416af1){_0x416af1=_0x416af1||0xc8;return function(_0x496bd7){if(_0x496bd7){return _0x2df35c['status'](_0x416af1)[_0x91fc('0x2b')](_0x496bd7);}};}function respondWithFilteredResult(_0x37ffd6,_0x198811){return function(_0x17b045){if(_0x17b045){var _0x54a589=_0x17b045[_0x91fc('0x2c')],_0x5a44a7=_0x198811['offset'],_0x50675d=_0x198811[_0x91fc('0x2d')]+_0x198811[_0x91fc('0x2e')],_0x3aa0e0;if(_0x50675d>=_0x54a589){_0x50675d=_0x54a589;_0x3aa0e0=0xc8;}else{_0x3aa0e0=0xce;}_0x37ffd6['status'](_0x3aa0e0);return _0x37ffd6[_0x91fc('0x2f')](_0x91fc('0x30'),_0x5a44a7+'-'+_0x50675d+'/'+_0x54a589)[_0x91fc('0x2b')](_0x17b045);}return null;};}function patchUpdates(_0x80f29b){return function(_0x2f86bd){try{jsonpatch[_0x91fc('0x31')](_0x2f86bd,_0x80f29b,!![]);}catch(_0x3881a1){return BPromise[_0x91fc('0x32')](_0x3881a1);}return _0x2f86bd[_0x91fc('0x33')]();};}function saveUpdates(_0x383e8a,_0xcd3272){return function(_0xf2edb){if(_0xf2edb){return _0xf2edb[_0x91fc('0x34')](_0x383e8a)[_0x91fc('0x1e')](function(_0x14ec59){return _0x14ec59;});}return null;};}function removeEntity(_0x31ee32,_0x26f961){return function(_0x1e4442){if(_0x1e4442){return _0x1e4442[_0x91fc('0x35')]()[_0x91fc('0x1e')](function(){_0x31ee32[_0x91fc('0x29')](0xcc)[_0x91fc('0x2a')]();});}};}function handleEntityNotFound(_0x58dada,_0x562988){return function(_0x550ee4){if(!_0x550ee4){_0x58dada[_0x91fc('0x36')](0x194);}return _0x550ee4;};}function handleError(_0x23e91a,_0x440ca6){_0x440ca6=_0x440ca6||0x1f4;return function(_0x582665){logger[_0x91fc('0x23')](_0x582665[_0x91fc('0x37')]);if(_0x582665['name']){delete _0x582665[_0x91fc('0x38')];}_0x23e91a[_0x91fc('0x29')](_0x440ca6)['send'](_0x582665);};}exports[_0x91fc('0x39')]=function(_0x72fae4,_0x31f405){var _0xbcd31={},_0x204a5a={},_0x21f99e={'count':0x0,'rows':[]};var _0x561c04=db[_0x91fc('0x3a')]['rawAttributes'];_0x204a5a[_0x91fc('0x3b')]=_[_0x91fc('0x3c')](_0x561c04);_0x204a5a[_0x91fc('0x3d')]=_[_0x91fc('0x3c')](_0x72fae4['query']);_0x204a5a[_0x91fc('0x3e')]=_[_0x91fc('0x3f')](_0x204a5a['model'],_0x204a5a[_0x91fc('0x3d')]);_0xbcd31[_0x91fc('0x40')]=_['intersection'](_0x204a5a['model'],qs[_0x91fc('0x41')](_0x72fae4[_0x91fc('0x3d')][_0x91fc('0x41')]));_0xbcd31[_0x91fc('0x40')]=_0xbcd31[_0x91fc('0x40')]['length']?_0xbcd31[_0x91fc('0x40')]:_0x204a5a[_0x91fc('0x3b')];if(!_0x72fae4['query'][_0x91fc('0x42')](_0x91fc('0x43'))){_0xbcd31[_0x91fc('0x2e')]=qs[_0x91fc('0x2e')](_0x72fae4['query'][_0x91fc('0x2e')]);_0xbcd31[_0x91fc('0x2d')]=qs['offset'](_0x72fae4[_0x91fc('0x3d')][_0x91fc('0x2d')]);}_0xbcd31[_0x91fc('0x44')]=qs['sort'](_0x72fae4[_0x91fc('0x3d')][_0x91fc('0x45')]);_0xbcd31[_0x91fc('0x46')]=qs['filters'](_[_0x91fc('0x47')](_0x72fae4[_0x91fc('0x3d')],_0x204a5a[_0x91fc('0x3e')]));if(_0x72fae4[_0x91fc('0x3d')][_0x91fc('0x48')]){_0xbcd31[_0x91fc('0x46')]=_['merge'](_0xbcd31[_0x91fc('0x46')],{'$or':_[_0x91fc('0x49')](_0x561c04,function(_0x3b9fc9){if(_0x3b9fc9['type'][_0x91fc('0x4a')]!==_0x91fc('0x4b')){var _0x1a9961={};_0x1a9961[_0x3b9fc9[_0x91fc('0x4c')]]={'$like':'%'+_0x72fae4[_0x91fc('0x3d')][_0x91fc('0x48')]+'%'};return _0x1a9961;}})});}_0xbcd31=_[_0x91fc('0x4d')]({},_0xbcd31,_0x72fae4[_0x91fc('0x4e')]);var _0x3fb906={'where':_0xbcd31[_0x91fc('0x46')]};return db[_0x91fc('0x3a')][_0x91fc('0x2c')](_0x3fb906)[_0x91fc('0x1e')](function(_0xd81364){_0x21f99e[_0x91fc('0x2c')]=_0xd81364;if(_0x72fae4[_0x91fc('0x3d')][_0x91fc('0x4f')]){_0xbcd31[_0x91fc('0x50')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x91fc('0x51')](_0xbcd31);})['then'](function(_0x4c5885){_0x21f99e['rows']=_0x4c5885;return _0x21f99e;})[_0x91fc('0x1e')](respondWithFilteredResult(_0x31f405,_0xbcd31))['catch'](handleError(_0x31f405,null));};exports[_0x91fc('0x52')]=function(_0x8d21e9,_0x1de726){var _0x198437={'raw':!![],'where':{'id':_0x8d21e9['params']['id']}},_0x10d5d0={};_0x10d5d0[_0x91fc('0x3b')]=_[_0x91fc('0x3c')](db[_0x91fc('0x3a')][_0x91fc('0x53')]);_0x10d5d0[_0x91fc('0x3d')]=_[_0x91fc('0x3c')](_0x8d21e9[_0x91fc('0x3d')]);_0x10d5d0[_0x91fc('0x3e')]=_[_0x91fc('0x3f')](_0x10d5d0[_0x91fc('0x3b')],_0x10d5d0[_0x91fc('0x3d')]);_0x198437[_0x91fc('0x40')]=_[_0x91fc('0x3f')](_0x10d5d0[_0x91fc('0x3b')],qs[_0x91fc('0x41')](_0x8d21e9[_0x91fc('0x3d')]['fields']));_0x198437[_0x91fc('0x40')]=_0x198437[_0x91fc('0x40')][_0x91fc('0x54')]?_0x198437[_0x91fc('0x40')]:_0x10d5d0['model'];if(_0x8d21e9[_0x91fc('0x3d')][_0x91fc('0x4f')]){_0x198437[_0x91fc('0x50')]=[{'all':!![]}];}_0x198437=_[_0x91fc('0x4d')]({},_0x198437,_0x8d21e9[_0x91fc('0x4e')]);return db['OpenchannelMessage'][_0x91fc('0x55')](_0x198437)['then'](handleEntityNotFound(_0x1de726,null))['then'](respondWithResult(_0x1de726,null))[_0x91fc('0x28')](handleError(_0x1de726,null));};exports[_0x91fc('0x56')]=function(_0x38e0bd,_0x5adbda){return db[_0x91fc('0x3a')]['create'](_0x38e0bd[_0x91fc('0x57')],{})['then'](respondWithResult(_0x5adbda,0xc9))[_0x91fc('0x28')](handleError(_0x5adbda,null));};exports['update']=function(_0x2f0906,_0x53dca0){if(_0x2f0906[_0x91fc('0x57')]['id']){delete _0x2f0906['body']['id'];}return db[_0x91fc('0x3a')]['find']({'where':{'id':_0x2f0906[_0x91fc('0x58')]['id']}})[_0x91fc('0x1e')](handleEntityNotFound(_0x53dca0,null))[_0x91fc('0x1e')](saveUpdates(_0x2f0906[_0x91fc('0x57')],null))[_0x91fc('0x1e')](respondWithResult(_0x53dca0,null))['catch'](handleError(_0x53dca0,null));};exports[_0x91fc('0x35')]=function(_0x22dbc8,_0x1835c1){return db[_0x91fc('0x3a')][_0x91fc('0x55')]({'where':{'id':_0x22dbc8[_0x91fc('0x58')]['id']}})[_0x91fc('0x1e')](handleEntityNotFound(_0x1835c1,null))[_0x91fc('0x1e')](removeEntity(_0x1835c1,null))[_0x91fc('0x28')](handleError(_0x1835c1,null));};exports[_0x91fc('0x59')]=function(_0x38e979,_0x35161d){return db[_0x91fc('0x3a')][_0x91fc('0x59')]()['then'](respondWithResult(_0x35161d,null))[_0x91fc('0x28')](handleError(_0x35161d,null));};var interaction_log=require(_0x91fc('0x11'))(_0x91fc('0x5a'));exports[_0x91fc('0x5b')]=function(_0x4d07d8,_0x81a7,_0x58218c){var _0x18b735={'channel':_0x91fc('0x5c')};if(_0x4d07d8[_0x91fc('0x57')]['id']){delete _0x4d07d8['body']['id'];}_0x4d07d8[_0x91fc('0x57')][_0x91fc('0x5d')]=!![];_0x4d07d8['body'][_0x91fc('0x5e')]=moment()[_0x91fc('0x5f')](_0x91fc('0x60'));_0x4d07d8[_0x91fc('0x57')][_0x91fc('0x61')]=_0x4d07d8[_0x91fc('0x57')][_0x91fc('0x61')]||_0x4d07d8[_0x91fc('0x62')]['id'];return db['OpenchannelMessage'][_0x91fc('0x55')]({'where':{'id':_0x4d07d8[_0x91fc('0x58')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x91fc('0x63')}]})['then'](handleEntityNotFound(_0x81a7,null))[_0x91fc('0x1e')](saveUpdates(_0x4d07d8[_0x91fc('0x57')],null))[_0x91fc('0x1e')](function(_0xdd1653){if(_0xdd1653){_0x18b735[_0x91fc('0x26')]=_0xdd1653[_0x91fc('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x91fc('0x55')]({'where':{'id':_0xdd1653['OpenchannelInteractionId']}});}return null;})[_0x91fc('0x1e')](handleEntityNotFound(_0x81a7,null))[_0x91fc('0x1e')](function(_0x159b7b){if(_0x159b7b){return _0x159b7b[_0x91fc('0x34')]({'UserId':_0x4d07d8[_0x91fc('0x57')][_0x91fc('0x61')],'read1stAt':_['isNil'](_0x159b7b[_0x91fc('0x65')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x91fc('0x1e')](function(_0x448061){if(_0x448061){_0x18b735[_0x91fc('0x66')]=_0x448061['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d07d8[_0x91fc('0x62')]['id'],_0x4d07d8[_0x91fc('0x62')][_0x91fc('0x38')],_0x4d07d8[_0x91fc('0x62')]['role'],_0x18b735[_0x91fc('0x66')]['id'],_0x4d07d8[_0x91fc('0x57')]?JSON[_0x91fc('0x22')](_0x4d07d8['body']):'null');return respondWithRpcPromise(_0x91fc('0x67'),'acceptMessage',_0x18b735);}return null;})[_0x91fc('0x1e')](function(_0x13aa5a){if(_0x13aa5a){if(_0x4d07d8[_0x91fc('0x57')][_0x91fc('0x68')]){_0x18b735['message'][_0x91fc('0x69')]=util[_0x91fc('0x5f')](_0x91fc('0x6a'),_0x4d07d8['user'][_0x91fc('0x38')]);_0x18b735[_0x91fc('0x26')][_0x91fc('0x6b')]=_0x18b735['channel'];_0x18b735[_0x91fc('0x26')][_0x91fc('0x6c')]=_0x91fc('0x5b');return respondWithRpcPromise('EventManager',_0x91fc('0x6d'),{'event':_0x91fc('0x6e'),'message':_0x18b735[_0x91fc('0x26')]},client9002)[_0x91fc('0x1e')](function(){return _0x18b735;});}return _0x18b735;}return null;})[_0x91fc('0x1e')](respondWithResult(_0x81a7,null))[_0x91fc('0x28')](handleError(_0x81a7,null));};var interaction_log=require(_0x91fc('0x11'))('openchannel-interactions');exports[_0x91fc('0x32')]=function(_0x4304b1,_0x2425d8,_0x3a19b2){var _0x349624={'agent':{},'channel':_0x91fc('0x5c')};if(_0x4304b1[_0x91fc('0x57')]['id']){delete _0x4304b1[_0x91fc('0x57')]['id'];}_0x4304b1[_0x91fc('0x57')][_0x91fc('0x61')]=_0x4304b1['body'][_0x91fc('0x61')]||_0x4304b1['user']['id'];_0x349624['agent']['id']=_0x4304b1[_0x91fc('0x57')][_0x91fc('0x61')];return db[_0x91fc('0x3a')][_0x91fc('0x55')]({'where':{'id':_0x4304b1[_0x91fc('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2425d8,null))[_0x91fc('0x1e')](function(_0x190353){if(_0x190353){_0x349624[_0x91fc('0x26')]=_0x190353[_0x91fc('0x64')]({'plain':!![]});return db[_0x91fc('0x6f')]['find']({'where':{'id':_0x190353[_0x91fc('0x70')]}});}return null;})[_0x91fc('0x1e')](handleEntityNotFound(_0x2425d8,null))[_0x91fc('0x1e')](function(_0x3e1029){if(_0x3e1029){_0x349624[_0x91fc('0x66')]=_0x3e1029[_0x91fc('0x64')]({'plain':!![]});interaction_log['info'](_0x91fc('0x71'),_0x4304b1[_0x91fc('0x62')]['id'],_0x4304b1[_0x91fc('0x62')][_0x91fc('0x38')],_0x4304b1[_0x91fc('0x62')][_0x91fc('0x72')],_0x349624[_0x91fc('0x66')]['id'],_0x4304b1[_0x91fc('0x57')]?JSON[_0x91fc('0x22')](_0x4304b1[_0x91fc('0x57')]):_0x91fc('0x73'));return respondWithRpcPromise(_0x91fc('0x74'),'rejectMessage',_0x349624);}return null;})[_0x91fc('0x1e')](function(_0x23ce9b){if(_0x23ce9b){_0x23ce9b[_0x91fc('0x26')][_0x91fc('0x69')]=util[_0x91fc('0x5f')](_0x91fc('0x6a'),_0x4304b1[_0x91fc('0x62')]['name']);_0x23ce9b['message']['channel']=_0x349624[_0x91fc('0x6b')];_0x23ce9b[_0x91fc('0x26')][_0x91fc('0x6c')]=_0x91fc('0x32');respondWithRpcPromise('EventManager',_0x91fc('0x6d'),{'event':'rejectmessage','message':_0x23ce9b[_0x91fc('0x26')]},client9002);return _0x349624;}return null;})['then'](respondWithResult(_0x2425d8,null))[_0x91fc('0x28')](handleError(_0x2425d8,null));}; \ No newline at end of file +var _0xb985=['model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','OpenchannelMessage','count','includeAll','include','findAll','rows','show','params','fields','find','create','body','describe','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','event','EventManager','acceptmessage','agent','rejectMessage','SIP/%s','rejectmessage','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes'];(function(_0x4fd957,_0x41650d){var _0x402ba5=function(_0x373733){while(--_0x373733){_0x4fd957['push'](_0x4fd957['shift']());}};_0x402ba5(++_0x41650d);}(_0xb985,0xb8));var _0x5b98=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0xb985[_0x537c37];return _0x241f84;};'use strict';var pdf=require(_0x5b98('0x0'));var emlformat=require(_0x5b98('0x1'));var rimraf=require(_0x5b98('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5b98('0x3'));var moment=require(_0x5b98('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b98('0x5'));var util=require(_0x5b98('0x6'));var path=require(_0x5b98('0x7'));var sox=require(_0x5b98('0x8'));var csv=require(_0x5b98('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5b98('0xa'));var squel=require(_0x5b98('0xb'));var crypto=require(_0x5b98('0xc'));var jsforce=require(_0x5b98('0xd'));var deskjs=require(_0x5b98('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b98('0xf'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x5b98('0x10'));var Redis=require(_0x5b98('0x11'));var qs=require(_0x5b98('0x12'));var logger=require(_0x5b98('0x13'))(_0x5b98('0x14'));var utils=require('../../config/utils');var config=require(_0x5b98('0x15'));var db=require('../../mysqldb')['db'];config[_0x5b98('0x16')]=_[_0x5b98('0x17')](config[_0x5b98('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b98('0x18'))(new Redis(config[_0x5b98('0x16')]));require(_0x5b98('0x19'))[_0x5b98('0x1a')](socket);var jayson=require(_0x5b98('0x1b'));var client=jayson[_0x5b98('0x1c')][_0x5b98('0x1d')]({'port':0x232c});var client9002=jayson[_0x5b98('0x1c')][_0x5b98('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x39a703,_0x1acffd,_0x11894a,_0x131c32){return new BPromise(function(_0x20a93c,_0x310223){var _0x45eb50=_0x131c32||client;return _0x45eb50[_0x5b98('0x1e')](_0x39a703,_0x11894a)[_0x5b98('0x1f')](function(_0x20e6f6){logger[_0x5b98('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x1acffd,_0x5b98('0x21'));logger[_0x5b98('0x22')](_0x5b98('0x23'),_0x1acffd,_0x5b98('0x21'),JSON[_0x5b98('0x24')](_0x20e6f6));if(_0x20e6f6[_0x5b98('0x25')]){if(_0x20e6f6[_0x5b98('0x25')]['code']===0x1f4){logger[_0x5b98('0x25')](_0x5b98('0x26'),_0x1acffd,_0x20e6f6[_0x5b98('0x25')][_0x5b98('0x27')]);return _0x310223(_0x20e6f6[_0x5b98('0x25')]['message']);}logger[_0x5b98('0x25')](_0x5b98('0x26'),_0x1acffd,_0x20e6f6[_0x5b98('0x25')]['message']);return _0x20a93c(_0x20e6f6[_0x5b98('0x25')]['message']);}else{logger[_0x5b98('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x1acffd,_0x5b98('0x21'));_0x20a93c(_0x20e6f6[_0x5b98('0x28')][_0x5b98('0x27')]);}})[_0x5b98('0x29')](function(_0x86e9d2){logger[_0x5b98('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x1acffd,_0x86e9d2);_0x310223(_0x86e9d2);});});}function respondWithStatusCode(_0x2e150c,_0x2a06e6){_0x2a06e6=_0x2a06e6||0xcc;return function(_0x5201bb){if(_0x5201bb){return _0x2e150c[_0x5b98('0x2a')](_0x2a06e6);}return _0x2e150c[_0x5b98('0x2b')](_0x2a06e6)[_0x5b98('0x2c')]();};}function respondWithResult(_0x2f0e0b,_0x5a264b){_0x5a264b=_0x5a264b||0xc8;return function(_0x21dfa3){if(_0x21dfa3){return _0x2f0e0b[_0x5b98('0x2b')](_0x5a264b)['json'](_0x21dfa3);}};}function respondWithFilteredResult(_0x3faf9f,_0x384536){return function(_0x3d7567){if(_0x3d7567){var _0x52f2d9=_0x3d7567['count'],_0x172a5f=_0x384536[_0x5b98('0x2d')],_0x544e54=_0x384536[_0x5b98('0x2d')]+_0x384536['limit'],_0xecc0b1;if(_0x544e54>=_0x52f2d9){_0x544e54=_0x52f2d9;_0xecc0b1=0xc8;}else{_0xecc0b1=0xce;}_0x3faf9f[_0x5b98('0x2b')](_0xecc0b1);return _0x3faf9f['set'](_0x5b98('0x2e'),_0x172a5f+'-'+_0x544e54+'/'+_0x52f2d9)[_0x5b98('0x2f')](_0x3d7567);}return null;};}function patchUpdates(_0x275b24){return function(_0x41c310){try{jsonpatch[_0x5b98('0x30')](_0x41c310,_0x275b24,!![]);}catch(_0x574215){return BPromise[_0x5b98('0x31')](_0x574215);}return _0x41c310[_0x5b98('0x32')]();};}function saveUpdates(_0x1a8430,_0x54cec4){return function(_0x7d3606){if(_0x7d3606){return _0x7d3606[_0x5b98('0x33')](_0x1a8430)[_0x5b98('0x1f')](function(_0x37a341){return _0x37a341;});}return null;};}function removeEntity(_0x12b122,_0x61b90f){return function(_0x223215){if(_0x223215){return _0x223215[_0x5b98('0x34')]()[_0x5b98('0x1f')](function(){_0x12b122['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x474594,_0x28b9af){return function(_0x2ce6ca){if(!_0x2ce6ca){_0x474594[_0x5b98('0x2a')](0x194);}return _0x2ce6ca;};}function handleError(_0x5df510,_0x37b72){_0x37b72=_0x37b72||0x1f4;return function(_0xa0ee07){logger[_0x5b98('0x25')](_0xa0ee07[_0x5b98('0x35')]);if(_0xa0ee07[_0x5b98('0x36')]){delete _0xa0ee07[_0x5b98('0x36')];}_0x5df510[_0x5b98('0x2b')](_0x37b72)[_0x5b98('0x37')](_0xa0ee07);};}exports[_0x5b98('0x38')]=function(_0x41e19a,_0x2b6f05){var _0x16e86b={},_0xfa1c37={},_0x1b093f={'count':0x0,'rows':[]};var _0x38a73d=db['OpenchannelMessage'][_0x5b98('0x39')];_0xfa1c37[_0x5b98('0x3a')]=_[_0x5b98('0x3b')](_0x38a73d);_0xfa1c37['query']=_[_0x5b98('0x3b')](_0x41e19a[_0x5b98('0x3c')]);_0xfa1c37[_0x5b98('0x3d')]=_[_0x5b98('0x3e')](_0xfa1c37[_0x5b98('0x3a')],_0xfa1c37[_0x5b98('0x3c')]);_0x16e86b[_0x5b98('0x3f')]=_[_0x5b98('0x3e')](_0xfa1c37[_0x5b98('0x3a')],qs['fields'](_0x41e19a[_0x5b98('0x3c')]['fields']));_0x16e86b[_0x5b98('0x3f')]=_0x16e86b[_0x5b98('0x3f')][_0x5b98('0x40')]?_0x16e86b[_0x5b98('0x3f')]:_0xfa1c37[_0x5b98('0x3a')];if(!_0x41e19a[_0x5b98('0x3c')][_0x5b98('0x41')](_0x5b98('0x42'))){_0x16e86b[_0x5b98('0x43')]=qs[_0x5b98('0x43')](_0x41e19a['query'][_0x5b98('0x43')]);_0x16e86b['offset']=qs[_0x5b98('0x2d')](_0x41e19a[_0x5b98('0x3c')][_0x5b98('0x2d')]);}_0x16e86b[_0x5b98('0x44')]=qs[_0x5b98('0x45')](_0x41e19a['query'][_0x5b98('0x45')]);_0x16e86b[_0x5b98('0x46')]=qs[_0x5b98('0x3d')](_[_0x5b98('0x47')](_0x41e19a['query'],_0xfa1c37[_0x5b98('0x3d')]));if(_0x41e19a[_0x5b98('0x3c')][_0x5b98('0x48')]){_0x16e86b[_0x5b98('0x46')]=_[_0x5b98('0x49')](_0x16e86b[_0x5b98('0x46')],{'$or':_[_0x5b98('0x4a')](_0x38a73d,function(_0xb5a99f){if(_0xb5a99f[_0x5b98('0x4b')]['key']!==_0x5b98('0x4c')){var _0x5174b3={};_0x5174b3[_0xb5a99f[_0x5b98('0x4d')]]={'$like':'%'+_0x41e19a[_0x5b98('0x3c')]['filter']+'%'};return _0x5174b3;}})});}_0x16e86b=_[_0x5b98('0x49')]({},_0x16e86b,_0x41e19a[_0x5b98('0x4e')]);var _0x1cefdf={'where':_0x16e86b[_0x5b98('0x46')]};return db[_0x5b98('0x4f')][_0x5b98('0x50')](_0x1cefdf)[_0x5b98('0x1f')](function(_0x197dbe){_0x1b093f[_0x5b98('0x50')]=_0x197dbe;if(_0x41e19a[_0x5b98('0x3c')][_0x5b98('0x51')]){_0x16e86b[_0x5b98('0x52')]=[{'all':!![]}];}return db[_0x5b98('0x4f')][_0x5b98('0x53')](_0x16e86b);})['then'](function(_0x3c672c){_0x1b093f[_0x5b98('0x54')]=_0x3c672c;return _0x1b093f;})[_0x5b98('0x1f')](respondWithFilteredResult(_0x2b6f05,_0x16e86b))['catch'](handleError(_0x2b6f05,null));};exports[_0x5b98('0x55')]=function(_0x5030f1,_0x1c0bbc){var _0x3e2d55={'raw':!![],'where':{'id':_0x5030f1[_0x5b98('0x56')]['id']}},_0x24a421={};_0x24a421[_0x5b98('0x3a')]=_[_0x5b98('0x3b')](db[_0x5b98('0x4f')][_0x5b98('0x39')]);_0x24a421[_0x5b98('0x3c')]=_[_0x5b98('0x3b')](_0x5030f1[_0x5b98('0x3c')]);_0x24a421[_0x5b98('0x3d')]=_[_0x5b98('0x3e')](_0x24a421['model'],_0x24a421[_0x5b98('0x3c')]);_0x3e2d55[_0x5b98('0x3f')]=_[_0x5b98('0x3e')](_0x24a421['model'],qs[_0x5b98('0x57')](_0x5030f1['query']['fields']));_0x3e2d55['attributes']=_0x3e2d55[_0x5b98('0x3f')][_0x5b98('0x40')]?_0x3e2d55[_0x5b98('0x3f')]:_0x24a421['model'];if(_0x5030f1[_0x5b98('0x3c')]['includeAll']){_0x3e2d55['include']=[{'all':!![]}];}_0x3e2d55=_[_0x5b98('0x49')]({},_0x3e2d55,_0x5030f1[_0x5b98('0x4e')]);return db[_0x5b98('0x4f')][_0x5b98('0x58')](_0x3e2d55)[_0x5b98('0x1f')](handleEntityNotFound(_0x1c0bbc,null))['then'](respondWithResult(_0x1c0bbc,null))[_0x5b98('0x29')](handleError(_0x1c0bbc,null));};exports[_0x5b98('0x59')]=function(_0x465d90,_0x10dcf5){return db['OpenchannelMessage'][_0x5b98('0x59')](_0x465d90['body'],{})[_0x5b98('0x1f')](respondWithResult(_0x10dcf5,0xc9))[_0x5b98('0x29')](handleError(_0x10dcf5,null));};exports[_0x5b98('0x33')]=function(_0x3a075b,_0x9fe2e0){if(_0x3a075b['body']['id']){delete _0x3a075b[_0x5b98('0x5a')]['id'];}return db['OpenchannelMessage'][_0x5b98('0x58')]({'where':{'id':_0x3a075b['params']['id']}})[_0x5b98('0x1f')](handleEntityNotFound(_0x9fe2e0,null))[_0x5b98('0x1f')](saveUpdates(_0x3a075b[_0x5b98('0x5a')],null))[_0x5b98('0x1f')](respondWithResult(_0x9fe2e0,null))[_0x5b98('0x29')](handleError(_0x9fe2e0,null));};exports[_0x5b98('0x34')]=function(_0x370938,_0x583bc6){return db['OpenchannelMessage'][_0x5b98('0x58')]({'where':{'id':_0x370938['params']['id']}})[_0x5b98('0x1f')](handleEntityNotFound(_0x583bc6,null))['then'](removeEntity(_0x583bc6,null))[_0x5b98('0x29')](handleError(_0x583bc6,null));};exports[_0x5b98('0x5b')]=function(_0x403654,_0x28ee8c){return db[_0x5b98('0x4f')][_0x5b98('0x5b')]()[_0x5b98('0x1f')](respondWithResult(_0x28ee8c,null))[_0x5b98('0x29')](handleError(_0x28ee8c,null));};var interaction_log=require(_0x5b98('0x13'))(_0x5b98('0x5c'));exports[_0x5b98('0x5d')]=function(_0x261368,_0x277d73,_0x3f06e9){var _0x275f26={'channel':_0x5b98('0x5e')};if(_0x261368[_0x5b98('0x5a')]['id']){delete _0x261368[_0x5b98('0x5a')]['id'];}_0x261368['body']['read']=!![];_0x261368[_0x5b98('0x5a')]['readAt']=moment()[_0x5b98('0x5f')](_0x5b98('0x60'));_0x261368[_0x5b98('0x5a')][_0x5b98('0x61')]=_0x261368[_0x5b98('0x5a')][_0x5b98('0x61')]||_0x261368[_0x5b98('0x62')]['id'];return db['OpenchannelMessage'][_0x5b98('0x58')]({'where':{'id':_0x261368['params']['id'],'UserId':null},'include':[{'model':db[_0x5b98('0x63')],'as':_0x5b98('0x64')}]})[_0x5b98('0x1f')](handleEntityNotFound(_0x277d73,null))[_0x5b98('0x1f')](saveUpdates(_0x261368['body'],null))['then'](function(_0x222b1a){if(_0x222b1a){_0x275f26[_0x5b98('0x27')]=_0x222b1a[_0x5b98('0x65')]({'plain':!![]});return db[_0x5b98('0x66')][_0x5b98('0x58')]({'where':{'id':_0x222b1a[_0x5b98('0x67')]}});}return null;})[_0x5b98('0x1f')](handleEntityNotFound(_0x277d73,null))['then'](function(_0x2d0dff){if(_0x2d0dff){return _0x2d0dff[_0x5b98('0x33')]({'UserId':_0x261368[_0x5b98('0x5a')][_0x5b98('0x61')],'read1stAt':_[_0x5b98('0x68')](_0x2d0dff[_0x5b98('0x69')])?moment()[_0x5b98('0x5f')](_0x5b98('0x60')):undefined});}return null;})[_0x5b98('0x1f')](function(_0x593085){if(_0x593085){_0x275f26[_0x5b98('0x6a')]=_0x593085['get']({'plain':!![]});interaction_log['info'](_0x5b98('0x6b'),_0x261368['user']['id'],_0x261368[_0x5b98('0x62')][_0x5b98('0x36')],_0x261368[_0x5b98('0x62')][_0x5b98('0x6c')],_0x275f26['interaction']['id'],_0x261368[_0x5b98('0x5a')]?JSON[_0x5b98('0x24')](_0x261368['body']):_0x5b98('0x6d'));return respondWithRpcPromise(_0x5b98('0x6e'),'acceptMessage',_0x275f26);}return null;})[_0x5b98('0x1f')](function(_0x3b25e2){if(_0x3b25e2){if(_0x261368[_0x5b98('0x5a')][_0x5b98('0x6f')]){_0x275f26[_0x5b98('0x27')][_0x5b98('0x70')]=util['format']('SIP/%s',_0x261368[_0x5b98('0x62')]['name']);_0x275f26['message'][_0x5b98('0x71')]=_0x275f26[_0x5b98('0x71')];_0x275f26[_0x5b98('0x27')][_0x5b98('0x72')]='accept';return respondWithRpcPromise(_0x5b98('0x73'),_0x5b98('0x73'),{'event':_0x5b98('0x74'),'message':_0x275f26[_0x5b98('0x27')]},client9002)['then'](function(){return _0x275f26;});}return _0x275f26;}return null;})['then'](respondWithResult(_0x277d73,null))[_0x5b98('0x29')](handleError(_0x277d73,null));};var interaction_log=require(_0x5b98('0x13'))(_0x5b98('0x5c'));exports[_0x5b98('0x31')]=function(_0x48f9d2,_0x2a159f,_0x2183e6){var _0x1b2dfa={'agent':{},'channel':_0x5b98('0x5e')};if(_0x48f9d2['body']['id']){delete _0x48f9d2[_0x5b98('0x5a')]['id'];}_0x48f9d2['body'][_0x5b98('0x61')]=_0x48f9d2['body'][_0x5b98('0x61')]||_0x48f9d2[_0x5b98('0x62')]['id'];_0x1b2dfa[_0x5b98('0x75')]['id']=_0x48f9d2[_0x5b98('0x5a')][_0x5b98('0x61')];return db[_0x5b98('0x4f')][_0x5b98('0x58')]({'where':{'id':_0x48f9d2[_0x5b98('0x56')]['id'],'UserId':null}})[_0x5b98('0x1f')](handleEntityNotFound(_0x2a159f,null))[_0x5b98('0x1f')](function(_0x2a0de6){if(_0x2a0de6){_0x1b2dfa['message']=_0x2a0de6[_0x5b98('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0x5b98('0x58')]({'where':{'id':_0x2a0de6['OpenchannelInteractionId']}});}return null;})[_0x5b98('0x1f')](handleEntityNotFound(_0x2a159f,null))[_0x5b98('0x1f')](function(_0x1b1df7){if(_0x1b1df7){_0x1b2dfa[_0x5b98('0x6a')]=_0x1b1df7[_0x5b98('0x65')]({'plain':!![]});interaction_log[_0x5b98('0x20')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48f9d2['user']['id'],_0x48f9d2[_0x5b98('0x62')][_0x5b98('0x36')],_0x48f9d2['user'][_0x5b98('0x6c')],_0x1b2dfa[_0x5b98('0x6a')]['id'],_0x48f9d2[_0x5b98('0x5a')]?JSON['stringify'](_0x48f9d2[_0x5b98('0x5a')]):'null');return respondWithRpcPromise('RejectMessage',_0x5b98('0x76'),_0x1b2dfa);}return null;})['then'](function(_0x127a51){if(_0x127a51){_0x127a51[_0x5b98('0x27')][_0x5b98('0x70')]=util[_0x5b98('0x5f')](_0x5b98('0x77'),_0x48f9d2['user'][_0x5b98('0x36')]);_0x127a51[_0x5b98('0x27')][_0x5b98('0x71')]=_0x1b2dfa[_0x5b98('0x71')];_0x127a51['message']['event']=_0x5b98('0x31');respondWithRpcPromise(_0x5b98('0x73'),'EventManager',{'event':_0x5b98('0x78'),'message':_0x127a51[_0x5b98('0x27')]},client9002);return _0x1b2dfa;}return null;})[_0x5b98('0x1f')](respondWithResult(_0x2a159f,null))[_0x5b98('0x29')](handleError(_0x2a159f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 86d8066..42c1314 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 _0xfad1=['hook','events','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfad1,0x12a));var _0x1fad=function(_0x4b88e0,_0x3b3266){_0x4b88e0=_0x4b88e0-0x0;var _0x1103c0=_0xfad1[_0x4b88e0];return _0x1103c0;};'use strict';var EventEmitter=require(_0x1fad('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x1fad('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1fad('0x2')](0x0);var events={'afterCreate':_0x1fad('0x3'),'afterUpdate':_0x1fad('0x4'),'afterDestroy':_0x1fad('0x5')};function emitEvent(_0x473159){return function(_0x5d5ba1,_0x1f2d54,_0x4d0d6b){OpenchannelMessageEvents['emit'](_0x473159+':'+_0x5d5ba1['id'],_0x5d5ba1);OpenchannelMessageEvents[_0x1fad('0x6')](_0x473159,_0x5d5ba1);_0x4d0d6b(null);};}for(var e in events){if(events[_0x1fad('0x7')](e)){var event=events[e];OpenchannelMessage[_0x1fad('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xc932=['setMaxListeners','save','remove','emit','events'];(function(_0x2f4aa0,_0x152d87){var _0x246be0=function(_0xbcb0e1){while(--_0xbcb0e1){_0x2f4aa0['push'](_0x2f4aa0['shift']());}};_0x246be0(++_0x152d87);}(_0xc932,0x18f));var _0x2c93=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0xc932[_0x176317];return _0xef2759;};'use strict';var EventEmitter=require(_0x2c93('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2c93('0x1')](0x0);var events={'afterCreate':_0x2c93('0x2'),'afterUpdate':'update','afterDestroy':_0x2c93('0x3')};function emitEvent(_0x5743b1){return function(_0x1687b1,_0x3e695a,_0x53a5ed){OpenchannelMessageEvents[_0x2c93('0x4')](_0x5743b1+':'+_0x1687b1['id'],_0x1687b1);OpenchannelMessageEvents['emit'](_0x5743b1,_0x1687b1);_0x53a5ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 5dca0b8..c75b03e 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 _0x7576=['request-promise','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','models','toLowerCase','direction','out','secret','UserId','OpenchannelInteraction','findOne','update','catch','error','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','POST','method','GET','body','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x30cbf0,_0x11a5cf){var _0x1d7003=function(_0x562d6f){while(--_0x562d6f){_0x30cbf0['push'](_0x30cbf0['shift']());}};_0x1d7003(++_0x11a5cf);}(_0x7576,0xc3));var _0x6757=function(_0x2c78ab,_0x6c0273){_0x2c78ab=_0x2c78ab-0x0;var _0x2bce93=_0x7576[_0x2c78ab];return _0x2bce93;};'use strict';var _=require(_0x6757('0x0'));var util=require('util');var logger=require(_0x6757('0x1'))(_0x6757('0x2'));var moment=require(_0x6757('0x3'));var BPromise=require(_0x6757('0x4'));var rp=require(_0x6757('0x5'));var attributes=require(_0x6757('0x6'));module[_0x6757('0x7')]=function(_0x4feb86,_0x5b1811){return _0x4feb86[_0x6757('0x8')](_0x6757('0x9'),attributes,{'tableName':_0x6757('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4527c7,_0x32176e,_0x50b081){var _0x8780f9=_0x4feb86[_0x6757('0xb')];var _0x28c3a5=_0x4527c7['get']({'plain':!![]});if(_0x28c3a5['direction'][_0x6757('0xc')]()==='in'||_0x28c3a5[_0x6757('0xd')]['toLowerCase']()===_0x6757('0xe')&&!_0x28c3a5[_0x6757('0xf')]&&!_['isNil'](_0x28c3a5[_0x6757('0x10')])){_0x8780f9[_0x6757('0x11')][_0x6757('0x12')]({'where':{'id':_0x28c3a5['OpenchannelInteractionId']}})['then'](function(_0x37ca08){if(_0x37ca08){_0x37ca08[_0x6757('0x13')]({'lastMsgAt':_0x28c3a5['createdAt'],'lastMsgDirection':_0x28c3a5[_0x6757('0xd')][_0x6757('0xc')](),'lastMsgBody':_0x28c3a5['body']});}})[_0x6757('0x14')](function(_0x1e47ea){console[_0x6757('0x15')](_0x1e47ea);});}if(_0x28c3a5['direction']===_0x6757('0xe')&&!_0x28c3a5[_0x6757('0xf')]){var _0x4b0779;_0x8780f9[_0x6757('0x16')][_0x6757('0x17')]()[_0x6757('0x18')](function(_0x57a4e0){return _0x8780f9[_0x6757('0x19')][_0x6757('0x1a')]({'where':{'id':_0x28c3a5[_0x6757('0x1b')]},'include':[{'model':_0x8780f9[_0x6757('0x11')],'as':_0x6757('0x1c'),'where':{'id':_0x28c3a5[_0x6757('0x1d')]},'limit':0x1,'include':[{'model':_0x8780f9[_0x6757('0x16')],'as':_0x6757('0x1e'),'attributes':_[_0x6757('0x1f')](_0x57a4e0)}]}]});})[_0x6757('0x18')](function(_0x531073){_0x4b0779=_0x531073['get']({'plain':!![]});if(_0x4b0779&&_0x4b0779['replyUri']){logger[_0x6757('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x6757('0x21'),util['format'](_0x6757('0x22'),_0x28c3a5['id'],_0x4b0779[_0x6757('0x23')]));if(_0x4b0779[_0x6757('0x1c')]&&_0x4b0779[_0x6757('0x1c')][_0x6757('0x24')]){_0x28c3a5[_0x6757('0x25')]=_[_0x6757('0x26')](_0x4b0779[_0x6757('0x1c')][0x0],_0x6757('0x1e'));_0x28c3a5[_0x6757('0x1e')]=_0x4b0779['Interactions'][0x0][_0x6757('0x1e')];}var _0x32176e={'method':_0x6757('0x27'),'uri':encodeURI(_0x4b0779['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x32176e[_0x6757('0x28')]){case _0x6757('0x29'):_0x32176e['qs']=_0x28c3a5;break;case'POST':_0x32176e[_0x6757('0x2a')]=_0x28c3a5;break;}return rp(_0x32176e)[_0x6757('0x18')](function(_0x4ecd7e){logger['info'](_0x6757('0x2b'),_0x6757('0x21'),util[_0x6757('0x2c')](_0x6757('0x2d'),_0x28c3a5['id'],_0x4b0779['replyUri']));if(_0x4ecd7e[_0x6757('0x2a')][_0x6757('0x2e')]&&_0x4ecd7e[_0x6757('0x2a')][_0x6757('0x2e')]!=_0x28c3a5[_0x6757('0x25')][_0x6757('0x2e')]){return _0x8780f9['OpenchannelInteraction']['update']({'threadId':_0x4ecd7e[_0x6757('0x2a')][_0x6757('0x2e')]},{'logging':!![],'where':{'id':_0x28c3a5[_0x6757('0x25')]['id']}});}else{return;}})['then'](function(){return _0x4527c7[_0x6757('0x13')]({'read':!![]});})['catch'](function(_0x2e20e7){logger[_0x6757('0x15')](_0x6757('0x2b'),'afterCreate',util[_0x6757('0x2f')](_0x2e20e7,{'showHidden':![],'depth':null}));_0x50b081();});}else{_0x50b081();}})[_0x6757('0x30')](function(){_0x50b081();});}else{_0x50b081();}}},'charset':'utf8mb4','collate':_0x6757('0x31')});}; \ No newline at end of file +var _0xacee=['keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','body','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','exports','define','OpenchannelMessage','direction','toLowerCase','isNil','UserId','then','update','createdAt','catch','error','out','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','OpenchannelInteractionId','Contact'];(function(_0x1e2bbe,_0x4df37d){var _0x435438=function(_0x26da9a){while(--_0x26da9a){_0x1e2bbe['push'](_0x1e2bbe['shift']());}};_0x435438(++_0x4df37d);}(_0xacee,0x195));var _0xeace=function(_0x3fc16b,_0x57bebd){_0x3fc16b=_0x3fc16b-0x0;var _0x438b7c=_0xacee[_0x3fc16b];return _0x438b7c;};'use strict';var _=require(_0xeace('0x0'));var util=require('util');var logger=require(_0xeace('0x1'))('api');var moment=require(_0xeace('0x2'));var BPromise=require('bluebird');var rp=require(_0xeace('0x3'));var attributes=require('./openchannelMessage.attributes');module[_0xeace('0x4')]=function(_0x347c2b,_0x5d113a){return _0x347c2b[_0xeace('0x5')](_0xeace('0x6'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5945ab,_0x489c0d,_0x2504e9){var _0x51fdb3=_0x347c2b['models'];var _0x24064c=_0x5945ab['get']({'plain':!![]});if(_0x24064c[_0xeace('0x7')][_0xeace('0x8')]()==='in'||_0x24064c['direction'][_0xeace('0x8')]()==='out'&&!_0x24064c['secret']&&!_[_0xeace('0x9')](_0x24064c[_0xeace('0xa')])){_0x51fdb3['OpenchannelInteraction']['findOne']({'where':{'id':_0x24064c['OpenchannelInteractionId']}})[_0xeace('0xb')](function(_0x510fa5){if(_0x510fa5){_0x510fa5[_0xeace('0xc')]({'lastMsgAt':_0x24064c[_0xeace('0xd')],'lastMsgDirection':_0x24064c[_0xeace('0x7')]['toLowerCase'](),'lastMsgBody':_0x24064c['body']});}})[_0xeace('0xe')](function(_0x4f31e6){console[_0xeace('0xf')](_0x4f31e6);});}if(_0x24064c['direction']===_0xeace('0x10')&&!_0x24064c['secret']){var _0x27dc8b;_0x51fdb3[_0xeace('0x11')][_0xeace('0x12')]()[_0xeace('0xb')](function(_0x21e790){return _0x51fdb3[_0xeace('0x13')][_0xeace('0x14')]({'where':{'id':_0x24064c[_0xeace('0x15')]},'include':[{'model':_0x51fdb3[_0xeace('0x16')],'as':'Interactions','where':{'id':_0x24064c[_0xeace('0x17')]},'limit':0x1,'include':[{'model':_0x51fdb3[_0xeace('0x11')],'as':_0xeace('0x18'),'attributes':_[_0xeace('0x19')](_0x21e790)}]}]});})[_0xeace('0xb')](function(_0x4daabb){_0x27dc8b=_0x4daabb['get']({'plain':!![]});if(_0x27dc8b&&_0x27dc8b[_0xeace('0x1a')]){logger[_0xeace('0x1b')](_0xeace('0x1c'),_0xeace('0x1d'),util[_0xeace('0x1e')](_0xeace('0x1f'),_0x24064c['id'],_0x27dc8b['replyUri']));if(_0x27dc8b[_0xeace('0x20')]&&_0x27dc8b[_0xeace('0x20')][_0xeace('0x21')]){_0x24064c[_0xeace('0x22')]=_[_0xeace('0x23')](_0x27dc8b[_0xeace('0x20')][0x0],_0xeace('0x18'));_0x24064c[_0xeace('0x18')]=_0x27dc8b[_0xeace('0x20')][0x0]['Contact'];}var _0x489c0d={'method':_0xeace('0x24'),'uri':encodeURI(_0x27dc8b[_0xeace('0x1a')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x489c0d['method']){case'GET':_0x489c0d['qs']=_0x24064c;break;case _0xeace('0x24'):_0x489c0d[_0xeace('0x25')]=_0x24064c;break;}return rp(_0x489c0d)[_0xeace('0xb')](function(_0x10bda4){logger[_0xeace('0x1b')](_0xeace('0x1c'),_0xeace('0x1d'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x24064c['id'],_0x27dc8b[_0xeace('0x1a')]));if(_0x10bda4[_0xeace('0x25')]['threadId']&&_0x10bda4[_0xeace('0x25')][_0xeace('0x26')]!=_0x24064c[_0xeace('0x22')][_0xeace('0x26')]){return _0x51fdb3[_0xeace('0x16')][_0xeace('0xc')]({'threadId':_0x10bda4[_0xeace('0x25')][_0xeace('0x26')]},{'logging':!![],'where':{'id':_0x24064c[_0xeace('0x22')]['id']}});}else{return;}})[_0xeace('0xb')](function(){return _0x5945ab['update']({'read':!![]});})[_0xeace('0xe')](function(_0x597f58){logger[_0xeace('0xf')](_0xeace('0x1c'),_0xeace('0x1d'),util[_0xeace('0x27')](_0x597f58,{'showHidden':![],'depth':null}));_0x2504e9();});}else{_0x2504e9();}})[_0xeace('0x28')](function(){_0x2504e9();});}else{_0x2504e9();}}},'charset':_0xeace('0x29'),'collate':_0xeace('0x2a')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 0199850..3124ea1 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 _0x6588=['OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','CreateOpenchannelMessage','create','options','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info'];(function(_0x59475c,_0x434ab7){var _0x44aaf0=function(_0x5aaef7){while(--_0x5aaef7){_0x59475c['push'](_0x59475c['shift']());}};_0x44aaf0(++_0x434ab7);}(_0x6588,0x110));var _0x8658=function(_0x39c084,_0xbc0456){_0x39c084=_0x39c084-0x0;var _0x5e6575=_0x6588[_0x39c084];return _0x5e6575;};'use strict';var _=require(_0x8658('0x0'));var util=require('util');var moment=require(_0x8658('0x1'));var BPromise=require('bluebird');var rs=require(_0x8658('0x2'));var fs=require('fs');var Redis=require(_0x8658('0x3'));var db=require(_0x8658('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8658('0x5'))('rpc');var config=require(_0x8658('0x6'));var jayson=require(_0x8658('0x7'));var client=jayson['client'][_0x8658('0x8')]({'port':0x232a});config['redis']=_[_0x8658('0x9')](config[_0x8658('0xa')],{'host':_0x8658('0xb'),'port':0x18eb});var socket=require(_0x8658('0xc'))(new Redis(config[_0x8658('0xa')]));require(_0x8658('0xd'))[_0x8658('0xe')](socket);function respondWithRpcPromise(_0xfc0410,_0x2fd2d6,_0x29a7dc){return new BPromise(function(_0x311639,_0x5a4cfd){return client[_0x8658('0xf')](_0xfc0410,_0x29a7dc)[_0x8658('0x10')](function(_0x1024ba){logger[_0x8658('0x11')](_0x8658('0x12'),_0x2fd2d6,_0x8658('0x13'));logger[_0x8658('0x14')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2fd2d6,'request\x20sent',JSON[_0x8658('0x15')](_0x1024ba));if(_0x1024ba['error']){if(_0x1024ba['error'][_0x8658('0x16')]===0x1f4){logger[_0x8658('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x2fd2d6,_0x1024ba[_0x8658('0x17')][_0x8658('0x18')]);return _0x5a4cfd(_0x1024ba['error'][_0x8658('0x18')]);}logger[_0x8658('0x17')](_0x8658('0x12'),_0x2fd2d6,_0x1024ba[_0x8658('0x17')][_0x8658('0x18')]);return _0x311639(_0x1024ba[_0x8658('0x17')]['message']);}else{logger[_0x8658('0x11')](_0x8658('0x12'),_0x2fd2d6,'request\x20sent');_0x311639(_0x1024ba['result'][_0x8658('0x18')]);}})['catch'](function(_0x975021){logger[_0x8658('0x17')](_0x8658('0x12'),_0x2fd2d6,_0x975021);_0x5a4cfd(_0x975021);});});}exports[_0x8658('0x19')]=function(_0x5cfaff){var _0x5c7025=this;return new Promise(function(_0x52aafb,_0x1cc64e){return db['OpenchannelMessage'][_0x8658('0x1a')](_0x5cfaff['body'],{'raw':_0x5cfaff[_0x8658('0x1b')]?_0x5cfaff[_0x8658('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8658('0x10')](function(_0x56f78e){logger[_0x8658('0x11')](_0x8658('0x19'),_0x5cfaff);logger[_0x8658('0x14')](_0x8658('0x19'),_0x5cfaff,JSON[_0x8658('0x15')](_0x56f78e));_0x52aafb(_0x56f78e);})[_0x8658('0x1c')](function(_0x54d834){logger['error'](_0x8658('0x19'),_0x54d834[_0x8658('0x18')],_0x5cfaff);_0x1cc64e(_0x5c7025[_0x8658('0x17')](0x1f4,_0x54d834['message']));});});}; \ No newline at end of file +var _0x0a6c=['OpenchannelMessage','create','body','options','raw','stringify','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','CreateOpenchannelMessage'];(function(_0x168b3b,_0x2c7b77){var _0xdc79b6=function(_0x4d8af1){while(--_0x4d8af1){_0x168b3b['push'](_0x168b3b['shift']());}};_0xdc79b6(++_0x2c7b77);}(_0x0a6c,0xe6));var _0xc0a6=function(_0x220524,_0x5bd28c){_0x220524=_0x220524-0x0;var _0x33336a=_0x0a6c[_0x220524];return _0x33336a;};'use strict';var _=require('lodash');var util=require(_0xc0a6('0x0'));var moment=require(_0xc0a6('0x1'));var BPromise=require('bluebird');var rs=require(_0xc0a6('0x2'));var fs=require('fs');var Redis=require(_0xc0a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0a6('0x4'));var logger=require('../../config/logger')(_0xc0a6('0x5'));var config=require(_0xc0a6('0x6'));var jayson=require(_0xc0a6('0x7'));var client=jayson[_0xc0a6('0x8')][_0xc0a6('0x9')]({'port':0x232a});config[_0xc0a6('0xa')]=_[_0xc0a6('0xb')](config['redis'],{'host':_0xc0a6('0xc'),'port':0x18eb});var socket=require(_0xc0a6('0xd'))(new Redis(config[_0xc0a6('0xa')]));require(_0xc0a6('0xe'))[_0xc0a6('0xf')](socket);function respondWithRpcPromise(_0x47cdf2,_0x333993,_0x1b5235){return new BPromise(function(_0x24eb0c,_0x1f5832){return client['request'](_0x47cdf2,_0x1b5235)[_0xc0a6('0x10')](function(_0x2d445a){logger[_0xc0a6('0x11')](_0xc0a6('0x12'),_0x333993,'request\x20sent');logger[_0xc0a6('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x333993,_0xc0a6('0x14'),JSON['stringify'](_0x2d445a));if(_0x2d445a[_0xc0a6('0x15')]){if(_0x2d445a[_0xc0a6('0x15')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x333993,_0x2d445a[_0xc0a6('0x15')]['message']);return _0x1f5832(_0x2d445a[_0xc0a6('0x15')][_0xc0a6('0x16')]);}logger[_0xc0a6('0x15')](_0xc0a6('0x12'),_0x333993,_0x2d445a[_0xc0a6('0x15')][_0xc0a6('0x16')]);return _0x24eb0c(_0x2d445a[_0xc0a6('0x15')][_0xc0a6('0x16')]);}else{logger['info'](_0xc0a6('0x12'),_0x333993,'request\x20sent');_0x24eb0c(_0x2d445a[_0xc0a6('0x17')][_0xc0a6('0x16')]);}})[_0xc0a6('0x18')](function(_0x3a6866){logger[_0xc0a6('0x15')](_0xc0a6('0x12'),_0x333993,_0x3a6866);_0x1f5832(_0x3a6866);});});}exports[_0xc0a6('0x19')]=function(_0x268595){var _0x4da898=this;return new Promise(function(_0x16d3ea,_0xe71484){return db[_0xc0a6('0x1a')][_0xc0a6('0x1b')](_0x268595[_0xc0a6('0x1c')],{'raw':_0x268595[_0xc0a6('0x1d')]?_0x268595[_0xc0a6('0x1d')][_0xc0a6('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1acdf9){logger[_0xc0a6('0x11')](_0xc0a6('0x19'),_0x268595);logger['debug'](_0xc0a6('0x19'),_0x268595,JSON[_0xc0a6('0x1f')](_0x1acdf9));_0x16d3ea(_0x1acdf9);})[_0xc0a6('0x18')](function(_0x5210f8){logger[_0xc0a6('0x15')](_0xc0a6('0x19'),_0x5210f8[_0xc0a6('0x16')],_0x268595);_0xe71484(_0x4da898[_0xc0a6('0x15')](0x1f4,_0x5210f8['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index f1e0e77..4666c35 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 _0x5c12=['removeListener','openchannelMessage:','save','remove','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5c12,0x188));var _0x25c1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x5c12[_0x5f309e];return _0x487b5e;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x25c1('0x0'),_0x25c1('0x1'),'update'];function createListener(_0x44bc2e,_0x1991e5){return function(_0x4042fe){_0x1991e5[_0x25c1('0x2')](_0x44bc2e,_0x4042fe);};}function removeListener(_0x2c5df0,_0x21ec20){return function(){OpenchannelMessageEvents[_0x25c1('0x3')](_0x2c5df0,_0x21ec20);};}exports['register']=function(_0x204287){for(var _0x42ac16=0x0,_0x382922=events['length'];_0x42ac16<_0x382922;_0x42ac16++){var _0x5c69b1=events[_0x42ac16];var _0x24981c=createListener(_0x25c1('0x4')+_0x5c69b1,_0x204287);OpenchannelMessageEvents['on'](_0x5c69b1,_0x24981c);}}; \ No newline at end of file +var _0x33c5=['remove','emit','removeListener','register','length','openchannelMessage:','save'];(function(_0x390b37,_0x23ed18){var _0x265e6e=function(_0x2a06b9){while(--_0x2a06b9){_0x390b37['push'](_0x390b37['shift']());}};_0x265e6e(++_0x23ed18);}(_0x33c5,0xe6));var _0x533c=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0x33c5[_0x7a3247];return _0x1bfde5;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x533c('0x0'),_0x533c('0x1'),'update'];function createListener(_0x9dafa,_0x26b916){return function(_0x221e43){_0x26b916[_0x533c('0x2')](_0x9dafa,_0x221e43);};}function removeListener(_0x358127,_0x49609e){return function(){OpenchannelMessageEvents[_0x533c('0x3')](_0x358127,_0x49609e);};}exports[_0x533c('0x4')]=function(_0x31d912){for(var _0x151732=0x0,_0x34ca89=events[_0x533c('0x5')];_0x151732<_0x34ca89;_0x151732++){var _0x3a009b=events[_0x151732];var _0x36d74e=createListener(_0x533c('0x6')+_0x3a009b,_0x31d912);OpenchannelMessageEvents['on'](_0x3a009b,_0x36d74e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 4d653ab..3f38119 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 _0x62cb=['exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','delete','destroy'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x62cb,0xc1));var _0xb62c=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x62cb[_0x2c7dc6];return _0x10002b;};'use strict';var multer=require('multer');var util=require(_0xb62c('0x0'));var path=require(_0xb62c('0x1'));var timeout=require(_0xb62c('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb62c('0x3'));var config=require(_0xb62c('0x4'));var controller=require(_0xb62c('0x5'));router[_0xb62c('0x6')]('/',auth[_0xb62c('0x7')](),controller[_0xb62c('0x8')]);router[_0xb62c('0x6')](_0xb62c('0x9'),auth[_0xb62c('0x7')](),controller[_0xb62c('0xa')]);router['get'](_0xb62c('0xb'),auth['isAuthenticated'](),controller[_0xb62c('0xc')]);router[_0xb62c('0x6')]('/:id/members',auth[_0xb62c('0x7')](),controller['getMembers']);router[_0xb62c('0x6')](_0xb62c('0xd'),auth[_0xb62c('0x7')](),controller[_0xb62c('0xe')]);router[_0xb62c('0x6')](_0xb62c('0xf'),auth[_0xb62c('0x7')](),controller['getAgents']);router['post']('/',auth[_0xb62c('0x7')](),controller[_0xb62c('0x10')]);router[_0xb62c('0x11')](_0xb62c('0xd'),auth[_0xb62c('0x7')](),controller[_0xb62c('0x12')]);router[_0xb62c('0x11')](_0xb62c('0xf'),auth[_0xb62c('0x7')](),controller[_0xb62c('0x13')]);router[_0xb62c('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb62c('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xb62c('0x16')]);router['delete'](_0xb62c('0xd'),auth[_0xb62c('0x7')](),controller['removeTeams']);router[_0xb62c('0x15')](_0xb62c('0xf'),auth[_0xb62c('0x7')](),controller['removeAgents']);module[_0xb62c('0x17')]=router; \ No newline at end of file +var _0x8eea=['delete','removeTeams','exports','path','connect-timeout','express','Router','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put'];(function(_0x540970,_0x35de8e){var _0x2693f4=function(_0x30e2da){while(--_0x30e2da){_0x540970['push'](_0x540970['shift']());}};_0x2693f4(++_0x35de8e);}(_0x8eea,0x1d7));var _0xa8ee=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x8eea[_0x725a4c];return _0x37b2cc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa8ee('0x0'));var timeout=require(_0xa8ee('0x1'));var express=require(_0xa8ee('0x2'));var router=express[_0xa8ee('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa8ee('0x4'));var config=require('../../config/environment');var controller=require(_0xa8ee('0x5'));router[_0xa8ee('0x6')]('/',auth['isAuthenticated'](),controller[_0xa8ee('0x7')]);router['get'](_0xa8ee('0x8'),auth[_0xa8ee('0x9')](),controller[_0xa8ee('0xa')]);router[_0xa8ee('0x6')](_0xa8ee('0xb'),auth[_0xa8ee('0x9')](),controller['show']);router['get'](_0xa8ee('0xc'),auth[_0xa8ee('0x9')](),controller[_0xa8ee('0xd')]);router[_0xa8ee('0x6')](_0xa8ee('0xe'),auth['isAuthenticated'](),controller[_0xa8ee('0xf')]);router[_0xa8ee('0x6')]('/:id/users',auth[_0xa8ee('0x9')](),controller[_0xa8ee('0x10')]);router[_0xa8ee('0x11')]('/',auth['isAuthenticated'](),controller[_0xa8ee('0x12')]);router[_0xa8ee('0x11')](_0xa8ee('0xe'),auth[_0xa8ee('0x9')](),controller[_0xa8ee('0x13')]);router['post'](_0xa8ee('0x14'),auth[_0xa8ee('0x9')](),controller[_0xa8ee('0x15')]);router[_0xa8ee('0x16')](_0xa8ee('0xb'),auth[_0xa8ee('0x9')](),controller['update']);router[_0xa8ee('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xa8ee('0x17')]('/:id/teams',auth[_0xa8ee('0x9')](),controller[_0xa8ee('0x18')]);router[_0xa8ee('0x17')]('/:id/users',auth[_0xa8ee('0x9')](),controller['removeAgents']);module[_0xa8ee('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index b605ba2..eeb2092 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 _0x10ad=['beepall','exports','name','INTEGER','ENUM'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x10ad,0xec));var _0xd10a=function(_0x1adc98,_0x572f08){_0x1adc98=_0x1adc98-0x0;var _0x37a14d=_0x10ad[_0x1adc98];return _0x37a14d;};'use strict';var Sequelize=require('sequelize');module[_0xd10a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd10a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd10a('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd10a('0x3')]('rrmemory',_0xd10a('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x1962=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x344b74,_0x3621df){var _0x39c592=function(_0x14df91){while(--_0x14df91){_0x344b74['push'](_0x344b74['shift']());}};_0x39c592(++_0x3621df);}(_0x1962,0x111));var _0x2196=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x1962[_0x128450];return _0x4d80ed;};'use strict';var Sequelize=require(_0x2196('0x0'));module[_0x2196('0x1')]={'name':{'type':Sequelize[_0x2196('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2196('0x2')]},'timeout':{'type':Sequelize[_0x2196('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2196('0x4')](_0x2196('0x5'),_0x2196('0x6'),_0x2196('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c2815be..494e287 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 _0xd8b0=['length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','OpenchannelQueue','findAll','rows','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','describe','getMembers','UserOpenchannelQueue','pick','OpenchannelQueueId','map','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','union','addAgents','removeTeams','omit','spread','emit','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','OpenchannelQueues','end','error','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields'];(function(_0x5a7003,_0x544bac){var _0x28bf83=function(_0x2d67fd){while(--_0x2d67fd){_0x5a7003['push'](_0x5a7003['shift']());}};_0x28bf83(++_0x544bac);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var authService=require(_0x0d8b('0xe'));var hardwareService=require(_0x0d8b('0xf'));var Redis=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];config[_0x0d8b('0x15')]=_[_0x0d8b('0x16')](config[_0x0d8b('0x15')],{'host':_0x0d8b('0x17'),'port':0x18eb});var socket=require(_0x0d8b('0x18'))(new Redis(config[_0x0d8b('0x15')]));require(_0x0d8b('0x19'))[_0x0d8b('0x1a')](socket);function respondWithStatusCode(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xcc;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x1b')](_0x5ad086);}return _0x2ce75e[_0x0d8b('0x1c')](_0x5ad086)['end']();};}function respondWithResult(_0x23eb7b,_0xa86349){_0xa86349=_0xa86349||0xc8;return function(_0x17f7df){if(_0x17f7df){return _0x23eb7b[_0x0d8b('0x1c')](_0xa86349)[_0x0d8b('0x1d')](_0x17f7df);}};}function respondWithFilteredResult(_0x5cd485,_0x106a01){return function(_0x4586c2){if(_0x4586c2){var _0x2fd0fc=_0x4586c2[_0x0d8b('0x1e')],_0x5fecbd=_0x106a01[_0x0d8b('0x1f')],_0x333674=_0x106a01['offset']+_0x106a01[_0x0d8b('0x20')],_0x18dd2d;if(_0x333674>=_0x2fd0fc){_0x333674=_0x2fd0fc;_0x18dd2d=0xc8;}else{_0x18dd2d=0xce;}_0x5cd485[_0x0d8b('0x1c')](_0x18dd2d);return _0x5cd485[_0x0d8b('0x21')](_0x0d8b('0x22'),_0x5fecbd+'-'+_0x333674+'/'+_0x2fd0fc)[_0x0d8b('0x1d')](_0x4586c2);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x23')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x24')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x25')](_0x54a9a7)[_0x0d8b('0x26')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x27')]()[_0x0d8b('0x26')](function(){var _0x27b695=_0x2c64e2['get']({'plain':!![]});var _0xe8bbee=_0x0d8b('0x28');return db['UserProfileResource'][_0x0d8b('0x27')]({'where':{'type':_0xe8bbee,'resourceId':_0x27b695['id']}})['then'](function(){return _0x2c64e2;});})[_0x0d8b('0x26')](function(){_0x38efc8[_0x0d8b('0x1c')](0xcc)[_0x0d8b('0x29')]();});}};}function handleEntityNotFound(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(!_0x28f639){_0x4fe6f9[_0x0d8b('0x1b')](0x194);}return _0x28f639;};}function handleError(_0x4c05ee,_0xcbc4ac){_0xcbc4ac=_0xcbc4ac||0x1f4;return function(_0x59aa83){logger[_0x0d8b('0x2a')](_0x59aa83['stack']);if(_0x59aa83[_0x0d8b('0x2b')]){delete _0x59aa83['name'];}_0x4c05ee[_0x0d8b('0x1c')](_0xcbc4ac)['send'](_0x59aa83);};}exports[_0x0d8b('0x2c')]=function(_0x544735,_0x3c8887){var _0x106e4c={},_0x2c058d={},_0x56120a={'count':0x0,'rows':[]};var _0x4c80a2=db['OpenchannelQueue'][_0x0d8b('0x2d')];_0x2c058d['model']=_[_0x0d8b('0x2e')](_0x4c80a2);_0x2c058d['query']=_['keys'](_0x544735[_0x0d8b('0x2f')]);_0x2c058d[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x32')],_0x2c058d[_0x0d8b('0x2f')]);_0x106e4c[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x32')],qs['fields'](_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x106e4c['attributes']=_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x106e4c[_0x0d8b('0x33')]:_0x2c058d['model'];if(!_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x106e4c[_0x0d8b('0x20')]=qs[_0x0d8b('0x20')](_0x544735['query'][_0x0d8b('0x20')]);_0x106e4c[_0x0d8b('0x1f')]=qs['offset'](_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}_0x106e4c[_0x0d8b('0x38')]=qs[_0x0d8b('0x39')](_0x544735[_0x0d8b('0x2f')]['sort']);_0x106e4c['where']=qs[_0x0d8b('0x30')](_['pick'](_0x544735['query'],_0x2c058d[_0x0d8b('0x30')]));if(_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x106e4c[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x106e4c[_0x0d8b('0x3b')],{'$or':_['map'](_0x4c80a2,function(_0x6e5bab){if(_0x6e5bab[_0x0d8b('0x3d')][_0x0d8b('0x3e')]!==_0x0d8b('0x3f')){var _0x338ed3={};_0x338ed3[_0x6e5bab[_0x0d8b('0x40')]]={'$like':'%'+_0x544735[_0x0d8b('0x2f')]['filter']+'%'};return _0x338ed3;}})});}_0x106e4c=_[_0x0d8b('0x3c')]({},_0x106e4c,_0x544735[_0x0d8b('0x41')]);var _0x3fa955={'where':_0x106e4c[_0x0d8b('0x3b')]};return db['OpenchannelQueue'][_0x0d8b('0x1e')](_0x3fa955)['then'](function(_0x37b26c){_0x56120a[_0x0d8b('0x1e')]=_0x37b26c;if(_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x42')]){_0x106e4c[_0x0d8b('0x43')]=[{'all':!![]}];}return db[_0x0d8b('0x44')][_0x0d8b('0x45')](_0x106e4c);})[_0x0d8b('0x26')](function(_0x89ab0d){_0x56120a[_0x0d8b('0x46')]=_0x89ab0d;return _0x56120a;})['then'](respondWithFilteredResult(_0x3c8887,_0x106e4c))['catch'](handleError(_0x3c8887,null));};exports['show']=function(_0x4d0811,_0x524d79){var _0x1a46f6={'raw':!![],'where':{'id':_0x4d0811[_0x0d8b('0x47')]['id']}},_0x402fe0={};_0x402fe0['model']=_['keys'](db[_0x0d8b('0x44')][_0x0d8b('0x2d')]);_0x402fe0[_0x0d8b('0x2f')]=_['keys'](_0x4d0811[_0x0d8b('0x2f')]);_0x402fe0[_0x0d8b('0x30')]=_['intersection'](_0x402fe0['model'],_0x402fe0[_0x0d8b('0x2f')]);_0x1a46f6['attributes']=_[_0x0d8b('0x31')](_0x402fe0['model'],qs['fields'](_0x4d0811[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x1a46f6['attributes']=_0x1a46f6['attributes']['length']?_0x1a46f6['attributes']:_0x402fe0[_0x0d8b('0x32')];if(_0x4d0811[_0x0d8b('0x2f')][_0x0d8b('0x42')]){_0x1a46f6['include']=[{'all':!![]}];}_0x1a46f6=_[_0x0d8b('0x3c')]({},_0x1a46f6,_0x4d0811[_0x0d8b('0x41')]);return db[_0x0d8b('0x44')][_0x0d8b('0x48')](_0x1a46f6)[_0x0d8b('0x26')](handleEntityNotFound(_0x524d79,null))[_0x0d8b('0x26')](respondWithResult(_0x524d79,null))[_0x0d8b('0x49')](handleError(_0x524d79,null));};exports[_0x0d8b('0x4a')]=function(_0x384a5e,_0x1f2077){return db[_0x0d8b('0x44')][_0x0d8b('0x4a')](_0x384a5e[_0x0d8b('0x4b')],{})[_0x0d8b('0x26')](function(_0x570af8){var _0xdfcf32=_0x384a5e[_0x0d8b('0x4c')][_0x0d8b('0x4d')]({'plain':!![]});if(!_0xdfcf32)throw new Error(_0x0d8b('0x4e'));if(_0xdfcf32['role']===_0x0d8b('0x4c')){var _0x4d8850=_0x570af8['get']({'plain':!![]});var _0x39a31d=_0x0d8b('0x28');return db[_0x0d8b('0x4f')][_0x0d8b('0x48')]({'where':{'name':_0x39a31d,'userProfileId':_0xdfcf32['userProfileId']},'raw':!![]})[_0x0d8b('0x26')](function(_0x1106d6){if(_0x1106d6&&_0x1106d6[_0x0d8b('0x50')]===0x0){return db[_0x0d8b('0x51')][_0x0d8b('0x4a')]({'name':_0x4d8850['name'],'resourceId':_0x4d8850['id'],'type':_0x1106d6['name'],'sectionId':_0x1106d6['id']},{})['then'](function(){return _0x570af8;});}else{return _0x570af8;}})['catch'](function(_0x368ede){logger[_0x0d8b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368ede);throw _0x368ede;});}return _0x570af8;})['then'](respondWithResult(_0x1f2077,0xc9))[_0x0d8b('0x49')](handleError(_0x1f2077,null));};exports[_0x0d8b('0x25')]=function(_0x5c5bd7,_0x5ef6c3){if(_0x5c5bd7[_0x0d8b('0x4b')]['id']){delete _0x5c5bd7[_0x0d8b('0x4b')]['id'];}return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x5c5bd7[_0x0d8b('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ef6c3,null))[_0x0d8b('0x26')](saveUpdates(_0x5c5bd7[_0x0d8b('0x4b')],null))['then'](respondWithResult(_0x5ef6c3,null))['catch'](handleError(_0x5ef6c3,null));};exports[_0x0d8b('0x27')]=function(_0x3f2d95,_0x546fef){return db['OpenchannelQueue'][_0x0d8b('0x48')]({'where':{'id':_0x3f2d95[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x546fef,null))[_0x0d8b('0x26')](removeEntity(_0x546fef,null))['catch'](handleError(_0x546fef,null));};exports[_0x0d8b('0x52')]=function(_0x598e03,_0x5c271c){return db[_0x0d8b('0x44')][_0x0d8b('0x52')]()['then'](respondWithResult(_0x5c271c,null))['catch'](handleError(_0x5c271c,null));};exports[_0x0d8b('0x53')]=function(_0x3d7161,_0xccc2a9,_0x2c1eb0){var _0x3afc3a={'raw':!![],'where':{}},_0xb66e76={},_0x3978e5;return db[_0x0d8b('0x44')]['findOne']({'where':{'id':_0x3d7161[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0xccc2a9,null))[_0x0d8b('0x26')](function(_0x3c7efb){if(_0x3c7efb){_0x3978e5=_0x3c7efb[_0x0d8b('0x4d')]({'plain':!![]});_0xb66e76[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db[_0x0d8b('0x54')][_0x0d8b('0x2d')]);_0xb66e76['query']=_[_0x0d8b('0x2e')](_0x3d7161[_0x0d8b('0x2f')]);_0xb66e76[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0xb66e76[_0x0d8b('0x32')],_0xb66e76['query']);_0x3afc3a[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0xb66e76[_0x0d8b('0x32')],qs[_0x0d8b('0x34')](_0x3d7161[_0x0d8b('0x2f')]['fields']));_0x3afc3a['attributes']=_0x3afc3a[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x3afc3a[_0x0d8b('0x33')]:_0xb66e76[_0x0d8b('0x32')];if(!_0x3d7161['query'][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x3afc3a[_0x0d8b('0x20')]=qs['limit'](_0x3d7161[_0x0d8b('0x2f')]['limit']);_0x3afc3a[_0x0d8b('0x1f')]=qs[_0x0d8b('0x1f')](_0x3d7161[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}_0x3afc3a[_0x0d8b('0x38')]=qs[_0x0d8b('0x39')](_0x3d7161['query'][_0x0d8b('0x39')]);_0x3afc3a['where']=qs[_0x0d8b('0x30')](_[_0x0d8b('0x55')](_0x3d7161[_0x0d8b('0x2f')],_0xb66e76[_0x0d8b('0x30')]));_0x3afc3a['where'][_0x0d8b('0x56')]=_0x3c7efb['id'];if(_0x3d7161[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x3afc3a[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x3afc3a[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x3afc3a[_0x0d8b('0x33')],function(_0x2ce282){var _0x34affb={};_0x34affb[_0x2ce282]={'$like':'%'+_0x3d7161['query']['filter']+'%'};return _0x34affb;})});}_0x3afc3a=_[_0x0d8b('0x3c')]({},_0x3afc3a,_0x3d7161[_0x0d8b('0x41')]);return db['UserOpenchannelQueue'][_0x0d8b('0x45')](_0x3afc3a);}})['then'](function(_0x5cc960){if(_0x5cc960){return db[_0x0d8b('0x58')][_0x0d8b('0x59')]({'where':{'id':_['map'](_0x5cc960,'UserId'),'role':_0x0d8b('0x5a')},'attributes':['id',_0x0d8b('0x2b'),_0x0d8b('0x5b'),_0x0d8b('0x5c'),_0x0d8b('0x5d')]});}})[_0x0d8b('0x26')](function(_0x40d265){if(_0x40d265){return{'count':_0x40d265['count'],'rows':_[_0x0d8b('0x57')](_0x40d265['rows'],function(_0x1a203e){return{'membername':_0x1a203e[_0x0d8b('0x2b')],'UserId':_0x1a203e['id'],'queue_name':_0x3978e5[_0x0d8b('0x2b')],'OpenchannelQueueId':_0x3978e5['id'],'interface':util[_0x0d8b('0x5e')]('%s/%s',_0x0d8b('0x5f'),_0x1a203e['name']),'penalty':0x0,'paused':_0x1a203e[_0x0d8b('0x5b')],'createdAt':_0x1a203e[_0x0d8b('0x5d')],'updatedAt':_0x1a203e[_0x0d8b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d8b('0x26')](respondWithFilteredResult(_0xccc2a9,_0x3afc3a))[_0x0d8b('0x49')](handleError(_0xccc2a9,null));};exports[_0x0d8b('0x60')]=function(_0x3e927c,_0x91aa89,_0x266a69){var _0x44aa74={};var _0x4eb07e={};var _0x1436b3;var _0x54c28b;return db[_0x0d8b('0x44')][_0x0d8b('0x61')]({'where':{'id':_0x3e927c['params']['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x91aa89,null))['then'](function(_0x10c318){if(_0x10c318){_0x1436b3=_0x10c318;_0x4eb07e[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db[_0x0d8b('0x62')][_0x0d8b('0x2d')]);_0x4eb07e[_0x0d8b('0x2f')]=_[_0x0d8b('0x2e')](_0x3e927c[_0x0d8b('0x2f')]);_0x4eb07e['filters']=_[_0x0d8b('0x31')](_0x4eb07e[_0x0d8b('0x32')],_0x4eb07e['query']);_0x44aa74[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x4eb07e[_0x0d8b('0x32')],qs[_0x0d8b('0x34')](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x44aa74[_0x0d8b('0x33')]=_0x44aa74[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x44aa74[_0x0d8b('0x33')]:_0x4eb07e[_0x0d8b('0x32')];_0x44aa74[_0x0d8b('0x38')]=qs['sort'](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x39')]);_0x44aa74[_0x0d8b('0x3b')]=qs['filters'](_['pick'](_0x3e927c[_0x0d8b('0x2f')],_0x4eb07e[_0x0d8b('0x30')]));if(_0x3e927c[_0x0d8b('0x2f')]['filter']){_0x44aa74['where']=_[_0x0d8b('0x3c')](_0x44aa74[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x44aa74[_0x0d8b('0x33')],function(_0x2a2b58){var _0x3f7895={};_0x3f7895[_0x2a2b58]={'$like':'%'+_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x3a')]+'%'};return _0x3f7895;})});}_0x44aa74=_[_0x0d8b('0x3c')]({},_0x44aa74,_0x3e927c[_0x0d8b('0x41')]);return _0x1436b3[_0x0d8b('0x60')](_0x44aa74);}})[_0x0d8b('0x26')](function(_0x3b060e){if(_0x3b060e){_0x54c28b=_0x3b060e['length'];if(!_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x36')]('nolimit')){_0x44aa74['limit']=qs[_0x0d8b('0x20')](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x20')]);_0x44aa74[_0x0d8b('0x1f')]=qs[_0x0d8b('0x1f')](_0x3e927c[_0x0d8b('0x2f')]['offset']);}return _0x1436b3['getTeams'](_0x44aa74);}})['then'](function(_0x1f1eae){if(_0x1f1eae){return _0x1f1eae?{'count':_0x54c28b,'rows':_0x1f1eae}:null;}})[_0x0d8b('0x26')](respondWithResult(_0x91aa89,null))[_0x0d8b('0x49')](handleError(_0x91aa89,null));};exports[_0x0d8b('0x63')]=function(_0x3f1eee,_0x21d620,_0x5ef461){var _0x302426=[];var _0x1d173f;return db['Team'][_0x0d8b('0x45')]({'where':{'id':_0x3f1eee['body'][_0x0d8b('0x64')]},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x58')],'as':_0x0d8b('0x65'),'attributes':['id'],'raw':!![]}]})[_0x0d8b('0x26')](function(_0x10c7ab){if(_0x10c7ab){for(var _0x8fae7f=0x0;_0x8fae7f<_0x10c7ab[_0x0d8b('0x35')];_0x8fae7f+=0x1){for(var _0xb73e32=0x0;_0xb73e32<_0x10c7ab[_0x8fae7f][_0x0d8b('0x65')][_0x0d8b('0x35')];_0xb73e32+=0x1){_0x302426=_[_0x0d8b('0x66')](_0x302426,[_0x10c7ab[_0x8fae7f][_0x0d8b('0x65')][_0xb73e32]['id']]);}}return _0x302426;}})['then'](function(_0x4dd64b){if(_0x4dd64b){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x3f1eee[_0x0d8b('0x47')]['id']}});}})[_0x0d8b('0x26')](function(_0xf91ecd){if(_0xf91ecd){_0x1d173f=_0xf91ecd;return _0x1d173f[_0x0d8b('0x67')](_0x302426,{'penalty':_0x3f1eee[_0x0d8b('0x4b')]['penalty']});}})[_0x0d8b('0x26')](function(_0x4c3948){if(_0x4c3948){return _0x1d173f[_0x0d8b('0x63')](_0x3f1eee['body']['ids']);}})[_0x0d8b('0x26')](handleEntityNotFound(_0x21d620,null))[_0x0d8b('0x26')](respondWithStatusCode(_0x21d620,null))[_0x0d8b('0x49')](handleError(_0x21d620,null));};exports[_0x0d8b('0x68')]=function(_0x2cf02c,_0x2eece2,_0x3c7b9b){var _0x180eda=[];var _0x35267a;return db[_0x0d8b('0x62')][_0x0d8b('0x45')]({'where':{'id':_0x2cf02c[_0x0d8b('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x58')],'as':_0x0d8b('0x65'),'attributes':['id'],'raw':!![]}]})[_0x0d8b('0x26')](function(_0x5eba19){if(_0x5eba19){for(var _0x4ce443=0x0;_0x4ce443<_0x5eba19[_0x0d8b('0x35')];_0x4ce443+=0x1){for(var _0x671705=0x0;_0x671705<_0x5eba19[_0x4ce443][_0x0d8b('0x65')][_0x0d8b('0x35')];_0x671705+=0x1){_0x180eda=_[_0x0d8b('0x66')](_0x180eda,[_0x5eba19[_0x4ce443][_0x0d8b('0x65')][_0x671705]['id']]);}}return _0x180eda;}})['then'](function(_0x1a96ce){if(_0x1a96ce){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x2cf02c[_0x0d8b('0x47')]['id']}});}})[_0x0d8b('0x26')](function(_0x55ea97){if(_0x55ea97){_0x35267a=_0x55ea97;return _0x35267a['removeAgents'](_0x180eda);}})[_0x0d8b('0x26')](function(_0x41ea29){if(_0x35267a){return _0x35267a[_0x0d8b('0x68')](_0x2cf02c['query'][_0x0d8b('0x64')]);}})[_0x0d8b('0x26')](handleEntityNotFound(_0x2eece2,null))[_0x0d8b('0x26')](respondWithStatusCode(_0x2eece2,null))['catch'](handleError(_0x2eece2,null));};exports[_0x0d8b('0x67')]=function(_0x3bc6d5,_0xeca283,_0x9ec9bc){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x3bc6d5[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0xeca283,null))[_0x0d8b('0x26')](function(_0x4bb4c7){if(_0x4bb4c7){return _0x4bb4c7[_0x0d8b('0x67')](_0x3bc6d5[_0x0d8b('0x4b')][_0x0d8b('0x64')],_[_0x0d8b('0x69')](_0x3bc6d5[_0x0d8b('0x4b')],[_0x0d8b('0x64'),'id'])||{})[_0x0d8b('0x6a')](function(_0x673201){for(var _0x35ebba=0x0;_0x35ebba<_0x3bc6d5['body']['ids'][_0x0d8b('0x35')];_0x35ebba+=0x1){socket[_0x0d8b('0x6b')](_0x0d8b('0x6c'),{'UserId':_0x3bc6d5[_0x0d8b('0x4b')]['ids'][_0x35ebba],'OpenchannelQueueId':_0x3bc6d5[_0x0d8b('0x47')]['id']});}return _0x673201;});}})[_0x0d8b('0x26')](respondWithResult(_0xeca283,null))['catch'](handleError(_0xeca283,null));};exports[_0x0d8b('0x6d')]=function(_0x4e1b5b,_0x4fb226,_0x2e5f7a){var _0x33965a;return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x4e1b5b[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x4fb226,null))[_0x0d8b('0x26')](function(_0x4ceb3a){if(_0x4ceb3a){return _0x4ceb3a[_0x0d8b('0x6d')](_0x4e1b5b['query']['ids'])[_0x0d8b('0x26')](function(_0x5c50f2){if(_[_0x0d8b('0x6e')](_0x4e1b5b[_0x0d8b('0x2f')]['ids'])){for(var _0x12f2bb=0x0;_0x12f2bb<_0x4e1b5b['query']['ids'][_0x0d8b('0x35')];_0x12f2bb+=0x1){socket[_0x0d8b('0x6b')](_0x0d8b('0x6f'),{'UserId':_0x4e1b5b[_0x0d8b('0x2f')][_0x0d8b('0x64')][_0x12f2bb],'OpenchannelQueueId':_0x4e1b5b['params']['id']});}}else{socket['emit'](_0x0d8b('0x6f'),{'UserId':_0x4e1b5b[_0x0d8b('0x2f')][_0x0d8b('0x64')],'OpenchannelQueueId':_0x4e1b5b[_0x0d8b('0x47')]['id']});}});}})[_0x0d8b('0x26')](respondWithStatusCode(_0x4fb226,null))[_0x0d8b('0x49')](handleError(_0x4fb226,null));};exports[_0x0d8b('0x70')]=function(_0x21bfd1,_0x4e3dd1,_0x5ab046){var _0x3582d3={};var _0x2640a6={};var _0x4a453b;var _0x551995;return db['OpenchannelQueue'][_0x0d8b('0x61')]({'where':{'id':_0x21bfd1[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x4e3dd1,null))['then'](function(_0x21643d){if(_0x21643d){_0x4a453b=_0x21643d;_0x2640a6[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db['User'][_0x0d8b('0x2d')]);_0x2640a6['query']=_[_0x0d8b('0x2e')](_0x21bfd1['query']);_0x2640a6[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0x2640a6[_0x0d8b('0x32')],_0x2640a6[_0x0d8b('0x2f')]);_0x3582d3[_0x0d8b('0x33')]=_['intersection'](_0x2640a6[_0x0d8b('0x32')],qs['fields'](_0x21bfd1[_0x0d8b('0x2f')]['fields']));_0x3582d3[_0x0d8b('0x33')]=_0x3582d3['attributes']['length']?_0x3582d3[_0x0d8b('0x33')]:_0x2640a6[_0x0d8b('0x32')];_0x3582d3['order']=qs[_0x0d8b('0x39')](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x39')]);_0x3582d3['where']=qs['filters'](_['pick'](_0x21bfd1[_0x0d8b('0x2f')],_0x2640a6[_0x0d8b('0x30')]));if(_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x3582d3[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x3582d3[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x3582d3[_0x0d8b('0x33')],function(_0xba602f){var _0x4dc5bd={};_0x4dc5bd[_0xba602f]={'$like':'%'+_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x3a')]+'%'};return _0x4dc5bd;})});}_0x3582d3=_[_0x0d8b('0x3c')]({},_0x3582d3,_0x21bfd1['options']);return _0x4a453b[_0x0d8b('0x70')](_0x3582d3);}})[_0x0d8b('0x26')](function(_0x13bce2){if(_0x13bce2){_0x551995=_0x13bce2[_0x0d8b('0x35')];if(!_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x3582d3[_0x0d8b('0x20')]=qs[_0x0d8b('0x20')](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x20')]);_0x3582d3[_0x0d8b('0x1f')]=qs['offset'](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}return _0x4a453b[_0x0d8b('0x70')](_0x3582d3);}})[_0x0d8b('0x26')](function(_0x590889){if(_0x590889){return _0x590889?{'count':_0x551995,'rows':_0x590889}:null;}})['then'](respondWithResult(_0x4e3dd1,null))[_0x0d8b('0x49')](handleError(_0x4e3dd1,null));}; \ No newline at end of file +var _0x5f2f=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','OpenchannelQueues','UserProfileResource','destroy','stack','name','index','OpenchannelQueue','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','role','UserProfileSection','error','update','body','describe','getMembers','UserOpenchannelQueue','pick','OpenchannelQueueId','map','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','SIP','getTeams','findOne','hasOwnProperty','addTeams','Team','ids','User','Agents','union','addAgents','penalty','removeTeams','removeAgents','omit','spread','userOpenchannelQueue:save','isArray','emit','userOpenchannelQueue:remove','getAgents'];(function(_0x5cd0fd,_0x222903){var _0x19ce56=function(_0x47a549){while(--_0x47a549){_0x5cd0fd['push'](_0x5cd0fd['shift']());}};_0x19ce56(++_0x222903);}(_0x5f2f,0x73));var _0xf5f2=function(_0x34ca41,_0xe7d9dd){_0x34ca41=_0x34ca41-0x0;var _0x15d7aa=_0x5f2f[_0x34ca41];return _0x15d7aa;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var authService=require(_0xf5f2('0x11'));var hardwareService=require(_0xf5f2('0x12'));var Redis=require('ioredis');var qs=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];config[_0xf5f2('0x16')]=_[_0xf5f2('0x17')](config[_0xf5f2('0x16')],{'host':_0xf5f2('0x18'),'port':0x18eb});var socket=require(_0xf5f2('0x19'))(new Redis(config[_0xf5f2('0x16')]));require('./openchannelQueue.socket')[_0xf5f2('0x1a')](socket);function respondWithStatusCode(_0xea612c,_0x269909){_0x269909=_0x269909||0xcc;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1b')](_0x269909);}return _0xea612c['status'](_0x269909)[_0xf5f2('0x1c')]();};}function respondWithResult(_0x286197,_0x17d656){_0x17d656=_0x17d656||0xc8;return function(_0x1b6dd2){if(_0x1b6dd2){return _0x286197[_0xf5f2('0x1d')](_0x17d656)[_0xf5f2('0x1e')](_0x1b6dd2);}};}function respondWithFilteredResult(_0xdb61b3,_0x395a5a){return function(_0x11f702){if(_0x11f702){var _0x228ace=_0x11f702[_0xf5f2('0x1f')],_0x20fccd=_0x395a5a[_0xf5f2('0x20')],_0x28e097=_0x395a5a[_0xf5f2('0x20')]+_0x395a5a[_0xf5f2('0x21')],_0x4ff59b;if(_0x28e097>=_0x228ace){_0x28e097=_0x228ace;_0x4ff59b=0xc8;}else{_0x4ff59b=0xce;}_0xdb61b3['status'](_0x4ff59b);return _0xdb61b3[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x20fccd+'-'+_0x28e097+'/'+_0x228ace)['json'](_0x11f702);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x24')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x25')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x26')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x27')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){var _0x5f1124=_0x287ad5[_0xf5f2('0x28')]({'plain':!![]});var _0x13da6f=_0xf5f2('0x29');return db[_0xf5f2('0x2a')][_0xf5f2('0x2b')]({'where':{'type':_0x13da6f,'resourceId':_0x5f1124['id']}})[_0xf5f2('0x27')](function(){return _0x287ad5;});})[_0xf5f2('0x27')](function(){_0x4e8bda[_0xf5f2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa2602,_0x102449){return function(_0x375ca8){if(!_0x375ca8){_0xaa2602[_0xf5f2('0x1b')](0x194);}return _0x375ca8;};}function handleError(_0x198c73,_0x477604){_0x477604=_0x477604||0x1f4;return function(_0x5b6672){logger['error'](_0x5b6672[_0xf5f2('0x2c')]);if(_0x5b6672[_0xf5f2('0x2d')]){delete _0x5b6672[_0xf5f2('0x2d')];}_0x198c73['status'](_0x477604)['send'](_0x5b6672);};}exports[_0xf5f2('0x2e')]=function(_0x50b8a2,_0x17394a){var _0x153924={},_0x1b381e={},_0x54c0c8={'count':0x0,'rows':[]};var _0x52e959=db[_0xf5f2('0x2f')]['rawAttributes'];_0x1b381e[_0xf5f2('0x30')]=_['keys'](_0x52e959);_0x1b381e[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x50b8a2[_0xf5f2('0x31')]);_0x1b381e[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x1b381e[_0xf5f2('0x30')],_0x1b381e[_0xf5f2('0x31')]);_0x153924[_0xf5f2('0x35')]=_['intersection'](_0x1b381e[_0xf5f2('0x30')],qs[_0xf5f2('0x36')](_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x153924[_0xf5f2('0x35')]=_0x153924[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x153924['attributes']:_0x1b381e[_0xf5f2('0x30')];if(!_0x50b8a2[_0xf5f2('0x31')]['hasOwnProperty'](_0xf5f2('0x38'))){_0x153924['limit']=qs[_0xf5f2('0x21')](_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x21')]);_0x153924[_0xf5f2('0x20')]=qs['offset'](_0x50b8a2['query'][_0xf5f2('0x20')]);}_0x153924[_0xf5f2('0x39')]=qs[_0xf5f2('0x3a')](_0x50b8a2['query'][_0xf5f2('0x3a')]);_0x153924['where']=qs[_0xf5f2('0x33')](_['pick'](_0x50b8a2[_0xf5f2('0x31')],_0x1b381e[_0xf5f2('0x33')]));if(_0x50b8a2['query'][_0xf5f2('0x3b')]){_0x153924[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0x153924[_0xf5f2('0x3c')],{'$or':_['map'](_0x52e959,function(_0x5d2d82){if(_0x5d2d82[_0xf5f2('0x3e')][_0xf5f2('0x3f')]!==_0xf5f2('0x40')){var _0x2d4400={};_0x2d4400[_0x5d2d82[_0xf5f2('0x41')]]={'$like':'%'+_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0x2d4400;}})});}_0x153924=_['merge']({},_0x153924,_0x50b8a2[_0xf5f2('0x42')]);var _0x3b4ea6={'where':_0x153924['where']};return db[_0xf5f2('0x2f')][_0xf5f2('0x1f')](_0x3b4ea6)[_0xf5f2('0x27')](function(_0x85b6d0){_0x54c0c8[_0xf5f2('0x1f')]=_0x85b6d0;if(_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x43')]){_0x153924[_0xf5f2('0x44')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xf5f2('0x45')](_0x153924);})[_0xf5f2('0x27')](function(_0x17a78e){_0x54c0c8['rows']=_0x17a78e;return _0x54c0c8;})['then'](respondWithFilteredResult(_0x17394a,_0x153924))['catch'](handleError(_0x17394a,null));};exports[_0xf5f2('0x46')]=function(_0x2ad13c,_0x4c8d8e){var _0x106272={'raw':!![],'where':{'id':_0x2ad13c[_0xf5f2('0x47')]['id']}},_0xeed03d={};_0xeed03d[_0xf5f2('0x30')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x2f')][_0xf5f2('0x48')]);_0xeed03d[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x2ad13c[_0xf5f2('0x31')]);_0xeed03d[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0xeed03d[_0xf5f2('0x30')],_0xeed03d[_0xf5f2('0x31')]);_0x106272['attributes']=_[_0xf5f2('0x34')](_0xeed03d['model'],qs[_0xf5f2('0x36')](_0x2ad13c[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x106272[_0xf5f2('0x35')]=_0x106272[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x106272['attributes']:_0xeed03d[_0xf5f2('0x30')];if(_0x2ad13c[_0xf5f2('0x31')][_0xf5f2('0x43')]){_0x106272[_0xf5f2('0x44')]=[{'all':!![]}];}_0x106272=_[_0xf5f2('0x3d')]({},_0x106272,_0x2ad13c[_0xf5f2('0x42')]);return db[_0xf5f2('0x2f')][_0xf5f2('0x49')](_0x106272)['then'](handleEntityNotFound(_0x4c8d8e,null))[_0xf5f2('0x27')](respondWithResult(_0x4c8d8e,null))[_0xf5f2('0x4a')](handleError(_0x4c8d8e,null));};exports[_0xf5f2('0x4b')]=function(_0x492eea,_0x1177ba){return db[_0xf5f2('0x2f')][_0xf5f2('0x4b')](_0x492eea['body'],{})['then'](function(_0x7bb942){var _0x27c472=_0x492eea['user'][_0xf5f2('0x28')]({'plain':!![]});if(!_0x27c472)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c472[_0xf5f2('0x4c')]==='user'){var _0x2cbd9d=_0x7bb942['get']({'plain':!![]});var _0x2d9017=_0xf5f2('0x29');return db[_0xf5f2('0x4d')][_0xf5f2('0x49')]({'where':{'name':_0x2d9017,'userProfileId':_0x27c472['userProfileId']},'raw':!![]})[_0xf5f2('0x27')](function(_0x2b782f){if(_0x2b782f&&_0x2b782f['autoAssociation']===0x0){return db['UserProfileResource'][_0xf5f2('0x4b')]({'name':_0x2cbd9d[_0xf5f2('0x2d')],'resourceId':_0x2cbd9d['id'],'type':_0x2b782f['name'],'sectionId':_0x2b782f['id']},{})[_0xf5f2('0x27')](function(){return _0x7bb942;});}else{return _0x7bb942;}})[_0xf5f2('0x4a')](function(_0x29c9b6){logger[_0xf5f2('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29c9b6);throw _0x29c9b6;});}return _0x7bb942;})['then'](respondWithResult(_0x1177ba,0xc9))[_0xf5f2('0x4a')](handleError(_0x1177ba,null));};exports[_0xf5f2('0x4f')]=function(_0x4b62fc,_0x40eef){if(_0x4b62fc[_0xf5f2('0x50')]['id']){delete _0x4b62fc[_0xf5f2('0x50')]['id'];}return db[_0xf5f2('0x2f')][_0xf5f2('0x49')]({'where':{'id':_0x4b62fc[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x40eef,null))['then'](saveUpdates(_0x4b62fc['body'],null))[_0xf5f2('0x27')](respondWithResult(_0x40eef,null))[_0xf5f2('0x4a')](handleError(_0x40eef,null));};exports[_0xf5f2('0x2b')]=function(_0x46a905,_0x21b0d3){return db['OpenchannelQueue'][_0xf5f2('0x49')]({'where':{'id':_0x46a905[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x21b0d3,null))['then'](removeEntity(_0x21b0d3,null))[_0xf5f2('0x4a')](handleError(_0x21b0d3,null));};exports['describe']=function(_0x78f1d2,_0x1a8d33){return db[_0xf5f2('0x2f')][_0xf5f2('0x51')]()['then'](respondWithResult(_0x1a8d33,null))['catch'](handleError(_0x1a8d33,null));};exports[_0xf5f2('0x52')]=function(_0x4de303,_0xa39c65,_0x1f1916){var _0x572ec1={'raw':!![],'where':{}},_0x3f0579={},_0xa4c0be;return db[_0xf5f2('0x2f')]['findOne']({'where':{'id':_0x4de303[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0xa39c65,null))[_0xf5f2('0x27')](function(_0x4579f4){if(_0x4579f4){_0xa4c0be=_0x4579f4['get']({'plain':!![]});_0x3f0579[_0xf5f2('0x30')]=_['keys'](db[_0xf5f2('0x53')][_0xf5f2('0x48')]);_0x3f0579[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x4de303[_0xf5f2('0x31')]);_0x3f0579['filters']=_[_0xf5f2('0x34')](_0x3f0579[_0xf5f2('0x30')],_0x3f0579[_0xf5f2('0x31')]);_0x572ec1[_0xf5f2('0x35')]=_[_0xf5f2('0x34')](_0x3f0579['model'],qs[_0xf5f2('0x36')](_0x4de303['query']['fields']));_0x572ec1[_0xf5f2('0x35')]=_0x572ec1['attributes'][_0xf5f2('0x37')]?_0x572ec1[_0xf5f2('0x35')]:_0x3f0579[_0xf5f2('0x30')];if(!_0x4de303[_0xf5f2('0x31')]['hasOwnProperty'](_0xf5f2('0x38'))){_0x572ec1[_0xf5f2('0x21')]=qs[_0xf5f2('0x21')](_0x4de303[_0xf5f2('0x31')][_0xf5f2('0x21')]);_0x572ec1[_0xf5f2('0x20')]=qs[_0xf5f2('0x20')](_0x4de303['query'][_0xf5f2('0x20')]);}_0x572ec1[_0xf5f2('0x39')]=qs[_0xf5f2('0x3a')](_0x4de303[_0xf5f2('0x31')]['sort']);_0x572ec1[_0xf5f2('0x3c')]=qs['filters'](_[_0xf5f2('0x54')](_0x4de303[_0xf5f2('0x31')],_0x3f0579['filters']));_0x572ec1[_0xf5f2('0x3c')][_0xf5f2('0x55')]=_0x4579f4['id'];if(_0x4de303[_0xf5f2('0x31')][_0xf5f2('0x3b')]){_0x572ec1[_0xf5f2('0x3c')]=_['merge'](_0x572ec1[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x56')](_0x572ec1[_0xf5f2('0x35')],function(_0xbf9f55){var _0x41606a={};_0x41606a[_0xbf9f55]={'$like':'%'+_0x4de303[_0xf5f2('0x31')]['filter']+'%'};return _0x41606a;})});}_0x572ec1=_[_0xf5f2('0x3d')]({},_0x572ec1,_0x4de303[_0xf5f2('0x42')]);return db['UserOpenchannelQueue'][_0xf5f2('0x45')](_0x572ec1);}})[_0xf5f2('0x27')](function(_0x377aad){if(_0x377aad){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x377aad,_0xf5f2('0x57')),'role':_0xf5f2('0x58')},'attributes':['id',_0xf5f2('0x2d'),_0xf5f2('0x59'),_0xf5f2('0x5a'),'createdAt']});}})[_0xf5f2('0x27')](function(_0x3a98b4){if(_0x3a98b4){return{'count':_0x3a98b4[_0xf5f2('0x1f')],'rows':_[_0xf5f2('0x56')](_0x3a98b4[_0xf5f2('0x5b')],function(_0x1cbe86){return{'membername':_0x1cbe86[_0xf5f2('0x2d')],'UserId':_0x1cbe86['id'],'queue_name':_0xa4c0be[_0xf5f2('0x2d')],'OpenchannelQueueId':_0xa4c0be['id'],'interface':util[_0xf5f2('0x5c')](_0xf5f2('0x5d'),_0xf5f2('0x5e'),_0x1cbe86['name']),'penalty':0x0,'paused':_0x1cbe86['openchannelPause'],'createdAt':_0x1cbe86['createdAt'],'updatedAt':_0x1cbe86[_0xf5f2('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x27')](respondWithFilteredResult(_0xa39c65,_0x572ec1))[_0xf5f2('0x4a')](handleError(_0xa39c65,null));};exports[_0xf5f2('0x5f')]=function(_0x1bb752,_0x5c6959,_0x9d943f){var _0x43c732={};var _0x301006={};var _0x28ac67;var _0x44d119;return db['OpenchannelQueue'][_0xf5f2('0x60')]({'where':{'id':_0x1bb752[_0xf5f2('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c6959,null))[_0xf5f2('0x27')](function(_0x2b0b30){if(_0x2b0b30){_0x28ac67=_0x2b0b30;_0x301006[_0xf5f2('0x30')]=_[_0xf5f2('0x32')](db['Team'][_0xf5f2('0x48')]);_0x301006[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x1bb752[_0xf5f2('0x31')]);_0x301006[_0xf5f2('0x33')]=_['intersection'](_0x301006['model'],_0x301006[_0xf5f2('0x31')]);_0x43c732[_0xf5f2('0x35')]=_[_0xf5f2('0x34')](_0x301006[_0xf5f2('0x30')],qs['fields'](_0x1bb752['query'][_0xf5f2('0x36')]));_0x43c732['attributes']=_0x43c732['attributes']['length']?_0x43c732['attributes']:_0x301006[_0xf5f2('0x30')];_0x43c732[_0xf5f2('0x39')]=qs[_0xf5f2('0x3a')](_0x1bb752[_0xf5f2('0x31')][_0xf5f2('0x3a')]);_0x43c732[_0xf5f2('0x3c')]=qs[_0xf5f2('0x33')](_[_0xf5f2('0x54')](_0x1bb752[_0xf5f2('0x31')],_0x301006[_0xf5f2('0x33')]));if(_0x1bb752[_0xf5f2('0x31')][_0xf5f2('0x3b')]){_0x43c732[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0x43c732[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x56')](_0x43c732[_0xf5f2('0x35')],function(_0x2778ed){var _0x4a39c0={};_0x4a39c0[_0x2778ed]={'$like':'%'+_0x1bb752[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0x4a39c0;})});}_0x43c732=_[_0xf5f2('0x3d')]({},_0x43c732,_0x1bb752[_0xf5f2('0x42')]);return _0x28ac67[_0xf5f2('0x5f')](_0x43c732);}})[_0xf5f2('0x27')](function(_0x16491c){if(_0x16491c){_0x44d119=_0x16491c[_0xf5f2('0x37')];if(!_0x1bb752['query'][_0xf5f2('0x61')]('nolimit')){_0x43c732['limit']=qs['limit'](_0x1bb752['query']['limit']);_0x43c732['offset']=qs[_0xf5f2('0x20')](_0x1bb752[_0xf5f2('0x31')][_0xf5f2('0x20')]);}return _0x28ac67[_0xf5f2('0x5f')](_0x43c732);}})[_0xf5f2('0x27')](function(_0x3cf857){if(_0x3cf857){return _0x3cf857?{'count':_0x44d119,'rows':_0x3cf857}:null;}})['then'](respondWithResult(_0x5c6959,null))['catch'](handleError(_0x5c6959,null));};exports[_0xf5f2('0x62')]=function(_0x578a22,_0x418ece,_0x186fdd){var _0x59161c=[];var _0x4f3ad4;return db[_0xf5f2('0x63')][_0xf5f2('0x45')]({'where':{'id':_0x578a22['body'][_0xf5f2('0x64')]},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5f2('0x27')](function(_0x3131b3){if(_0x3131b3){for(var _0x27de4d=0x0;_0x27de4d<_0x3131b3['length'];_0x27de4d+=0x1){for(var _0x33e9ad=0x0;_0x33e9ad<_0x3131b3[_0x27de4d][_0xf5f2('0x66')][_0xf5f2('0x37')];_0x33e9ad+=0x1){_0x59161c=_[_0xf5f2('0x67')](_0x59161c,[_0x3131b3[_0x27de4d][_0xf5f2('0x66')][_0x33e9ad]['id']]);}}return _0x59161c;}})[_0xf5f2('0x27')](function(_0x25974b){if(_0x25974b){return db[_0xf5f2('0x2f')][_0xf5f2('0x49')]({'where':{'id':_0x578a22[_0xf5f2('0x47')]['id']}});}})[_0xf5f2('0x27')](function(_0x2601aa){if(_0x2601aa){_0x4f3ad4=_0x2601aa;return _0x4f3ad4[_0xf5f2('0x68')](_0x59161c,{'penalty':_0x578a22[_0xf5f2('0x50')][_0xf5f2('0x69')]});}})[_0xf5f2('0x27')](function(_0x1902c6){if(_0x1902c6){return _0x4f3ad4[_0xf5f2('0x62')](_0x578a22[_0xf5f2('0x50')][_0xf5f2('0x64')]);}})[_0xf5f2('0x27')](handleEntityNotFound(_0x418ece,null))['then'](respondWithStatusCode(_0x418ece,null))[_0xf5f2('0x4a')](handleError(_0x418ece,null));};exports[_0xf5f2('0x6a')]=function(_0x5d6c6e,_0x2e49ce,_0x3aa832){var _0x4e0a34=[];var _0xb56304;return db[_0xf5f2('0x63')][_0xf5f2('0x45')]({'where':{'id':_0x5d6c6e['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x65')],'as':_0xf5f2('0x66'),'attributes':['id'],'raw':!![]}]})[_0xf5f2('0x27')](function(_0x5ba275){if(_0x5ba275){for(var _0x596958=0x0;_0x596958<_0x5ba275[_0xf5f2('0x37')];_0x596958+=0x1){for(var _0xcdc6fd=0x0;_0xcdc6fd<_0x5ba275[_0x596958][_0xf5f2('0x66')]['length'];_0xcdc6fd+=0x1){_0x4e0a34=_['union'](_0x4e0a34,[_0x5ba275[_0x596958]['Agents'][_0xcdc6fd]['id']]);}}return _0x4e0a34;}})['then'](function(_0x560b39){if(_0x560b39){return db[_0xf5f2('0x2f')]['find']({'where':{'id':_0x5d6c6e[_0xf5f2('0x47')]['id']}});}})[_0xf5f2('0x27')](function(_0xec3c35){if(_0xec3c35){_0xb56304=_0xec3c35;return _0xb56304[_0xf5f2('0x6b')](_0x4e0a34);}})[_0xf5f2('0x27')](function(_0x398f2b){if(_0xb56304){return _0xb56304[_0xf5f2('0x6a')](_0x5d6c6e[_0xf5f2('0x31')][_0xf5f2('0x64')]);}})[_0xf5f2('0x27')](handleEntityNotFound(_0x2e49ce,null))[_0xf5f2('0x27')](respondWithStatusCode(_0x2e49ce,null))[_0xf5f2('0x4a')](handleError(_0x2e49ce,null));};exports[_0xf5f2('0x68')]=function(_0x5e69a2,_0x29f40b,_0x2a4fed){return db['OpenchannelQueue'][_0xf5f2('0x49')]({'where':{'id':_0x5e69a2[_0xf5f2('0x47')]['id']}})['then'](handleEntityNotFound(_0x29f40b,null))[_0xf5f2('0x27')](function(_0xfe9cf5){if(_0xfe9cf5){return _0xfe9cf5[_0xf5f2('0x68')](_0x5e69a2['body'][_0xf5f2('0x64')],_[_0xf5f2('0x6c')](_0x5e69a2['body'],[_0xf5f2('0x64'),'id'])||{})[_0xf5f2('0x6d')](function(_0x41bf8c){for(var _0x517aa8=0x0;_0x517aa8<_0x5e69a2[_0xf5f2('0x50')]['ids'][_0xf5f2('0x37')];_0x517aa8+=0x1){socket['emit'](_0xf5f2('0x6e'),{'UserId':_0x5e69a2[_0xf5f2('0x50')][_0xf5f2('0x64')][_0x517aa8],'OpenchannelQueueId':_0x5e69a2[_0xf5f2('0x47')]['id']});}return _0x41bf8c;});}})['then'](respondWithResult(_0x29f40b,null))[_0xf5f2('0x4a')](handleError(_0x29f40b,null));};exports['removeAgents']=function(_0x52e037,_0x4b4d7f,_0x2a253a){var _0x3c47a6;return db['OpenchannelQueue'][_0xf5f2('0x49')]({'where':{'id':_0x52e037[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x4b4d7f,null))[_0xf5f2('0x27')](function(_0x28873e){if(_0x28873e){return _0x28873e[_0xf5f2('0x6b')](_0x52e037['query'][_0xf5f2('0x64')])[_0xf5f2('0x27')](function(_0x4c0a2f){if(_[_0xf5f2('0x6f')](_0x52e037[_0xf5f2('0x31')]['ids'])){for(var _0x32301a=0x0;_0x32301a<_0x52e037[_0xf5f2('0x31')][_0xf5f2('0x64')][_0xf5f2('0x37')];_0x32301a+=0x1){socket[_0xf5f2('0x70')](_0xf5f2('0x71'),{'UserId':_0x52e037['query'][_0xf5f2('0x64')][_0x32301a],'OpenchannelQueueId':_0x52e037[_0xf5f2('0x47')]['id']});}}else{socket[_0xf5f2('0x70')](_0xf5f2('0x71'),{'UserId':_0x52e037[_0xf5f2('0x31')][_0xf5f2('0x64')],'OpenchannelQueueId':_0x52e037[_0xf5f2('0x47')]['id']});}});}})[_0xf5f2('0x27')](respondWithStatusCode(_0x4b4d7f,null))[_0xf5f2('0x4a')](handleError(_0x4b4d7f,null));};exports['getAgents']=function(_0x35408a,_0x3d3b9b,_0xdbb2cd){var _0x934a7d={};var _0x35fe1a={};var _0x37c1a1;var _0x35e855;return db[_0xf5f2('0x2f')][_0xf5f2('0x60')]({'where':{'id':_0x35408a[_0xf5f2('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d3b9b,null))['then'](function(_0x2076c7){if(_0x2076c7){_0x37c1a1=_0x2076c7;_0x35fe1a[_0xf5f2('0x30')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x65')]['rawAttributes']);_0x35fe1a[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x35408a[_0xf5f2('0x31')]);_0x35fe1a[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x35fe1a['model'],_0x35fe1a[_0xf5f2('0x31')]);_0x934a7d[_0xf5f2('0x35')]=_['intersection'](_0x35fe1a[_0xf5f2('0x30')],qs[_0xf5f2('0x36')](_0x35408a[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x934a7d['attributes']=_0x934a7d[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x934a7d[_0xf5f2('0x35')]:_0x35fe1a['model'];_0x934a7d['order']=qs[_0xf5f2('0x3a')](_0x35408a[_0xf5f2('0x31')][_0xf5f2('0x3a')]);_0x934a7d[_0xf5f2('0x3c')]=qs[_0xf5f2('0x33')](_[_0xf5f2('0x54')](_0x35408a['query'],_0x35fe1a[_0xf5f2('0x33')]));if(_0x35408a['query'][_0xf5f2('0x3b')]){_0x934a7d[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0x934a7d[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x56')](_0x934a7d[_0xf5f2('0x35')],function(_0x4a586c){var _0x13321d={};_0x13321d[_0x4a586c]={'$like':'%'+_0x35408a[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0x13321d;})});}_0x934a7d=_[_0xf5f2('0x3d')]({},_0x934a7d,_0x35408a[_0xf5f2('0x42')]);return _0x37c1a1[_0xf5f2('0x72')](_0x934a7d);}})[_0xf5f2('0x27')](function(_0x54b095){if(_0x54b095){_0x35e855=_0x54b095[_0xf5f2('0x37')];if(!_0x35408a['query']['hasOwnProperty']('nolimit')){_0x934a7d[_0xf5f2('0x21')]=qs[_0xf5f2('0x21')](_0x35408a['query'][_0xf5f2('0x21')]);_0x934a7d[_0xf5f2('0x20')]=qs[_0xf5f2('0x20')](_0x35408a[_0xf5f2('0x31')]['offset']);}return _0x37c1a1[_0xf5f2('0x72')](_0x934a7d);}})[_0xf5f2('0x27')](function(_0x10ac11){if(_0x10ac11){return _0x10ac11?{'count':_0x35e855,'rows':_0x10ac11}:null;}})['then'](respondWithResult(_0x3d3b9b,null))[_0xf5f2('0x4a')](handleError(_0x3d3b9b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5d91ff7..aa914e1 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 _0x4a7d=['update','remove','emit','hasOwnProperty','hook','events','save'];(function(_0xd7f265,_0x4b8f3b){var _0x2c5e98=function(_0x113125){while(--_0x113125){_0xd7f265['push'](_0xd7f265['shift']());}};_0x2c5e98(++_0x4b8f3b);}(_0x4a7d,0x116));var _0xd4a7=function(_0x3bf1fe,_0x26b1b7){_0x3bf1fe=_0x3bf1fe-0x0;var _0x33509e=_0x4a7d[_0x3bf1fe];return _0x33509e;};'use strict';var EventEmitter=require(_0xd4a7('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4a7('0x1'),'afterUpdate':_0xd4a7('0x2'),'afterDestroy':_0xd4a7('0x3')};function emitEvent(_0x28c9af){return function(_0xd06657,_0x39e76b,_0x146f4f){OpenchannelQueueEvents[_0xd4a7('0x4')](_0x28c9af+':'+_0xd06657['id'],_0xd06657);OpenchannelQueueEvents[_0xd4a7('0x4')](_0x28c9af,_0xd06657);_0x146f4f(null);};}for(var e in events){if(events[_0xd4a7('0x5')](e)){var event=events[e];OpenchannelQueue[_0xd4a7('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x8d3b=['OpenchannelQueue','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4e188e,_0x34d8e7){var _0x4db0ff=function(_0x499672){while(--_0x499672){_0x4e188e['push'](_0x4e188e['shift']());}};_0x4db0ff(++_0x34d8e7);}(_0x8d3b,0x16f));var _0xb8d3=function(_0x104d9e,_0x231a61){_0x104d9e=_0x104d9e-0x0;var _0x5b055f=_0x8d3b[_0x104d9e];return _0x5b055f;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xb8d3('0x0'))['db'][_0xb8d3('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8d3('0x2'),'afterUpdate':_0xb8d3('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd401c1){return function(_0x2f4af8,_0x147155,_0x36dbd4){OpenchannelQueueEvents[_0xb8d3('0x4')](_0xd401c1+':'+_0x2f4af8['id'],_0x2f4af8);OpenchannelQueueEvents['emit'](_0xd401c1,_0x2f4af8);_0x36dbd4(null);};}for(var e in events){if(events[_0xb8d3('0x5')](e)){var event=events[e];OpenchannelQueue[_0xb8d3('0x6')](e,emitEvent(event));}}module[_0xb8d3('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 3facac8..dc85929 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 _0x5ff3=['define','OpenchannelQueue','openchannel_queues','util','api','bluebird','request-promise','./openchannelQueue.attributes','exports'];(function(_0x52db6e,_0x2aea70){var _0x5be45d=function(_0x31699e){while(--_0x31699e){_0x52db6e['push'](_0x52db6e['shift']());}};_0x5be45d(++_0x2aea70);}(_0x5ff3,0x17d));var _0x35ff=function(_0x5de88a,_0x465f00){_0x5de88a=_0x5de88a-0x0;var _0x226145=_0x5ff3[_0x5de88a];return _0x226145;};'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 attributes=require(_0x35ff('0x4'));module[_0x35ff('0x5')]=function(_0x551514,_0x2fcb74){return _0x551514[_0x35ff('0x6')](_0x35ff('0x7'),attributes,{'tableName':_0x35ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['openchannel_queues','../../config/logger','api','moment','bluebird','request-promise','exports','define','OpenchannelQueue'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var attributes=require('./openchannelQueue.attributes');module[_0x3071('0x5')]=function(_0x7b18a4,_0x33a70c){return _0x7b18a4[_0x3071('0x6')](_0x3071('0x7'),attributes,{'tableName':_0x3071('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 4a3bdfb..1237b94 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 _0xd737=['socket.io-emitter','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelQueue','options','raw','where','limit','include','map','model','attributes','GetOpenchannelQueue','debug','find','ShowOpenchannelQueue','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','redis','defaults','localhost'];(function(_0x240b4d,_0x3199ee){var _0x595b25=function(_0x3c1597){while(--_0x3c1597){_0x240b4d['push'](_0x240b4d['shift']());}};_0x595b25(++_0x3199ee);}(_0xd737,0x85));var _0x7d73=function(_0x109e39,_0x27f91c){_0x109e39=_0x109e39-0x0;var _0x3b142f=_0xd737[_0x109e39];return _0x3b142f;};'use strict';var _=require(_0x7d73('0x0'));var util=require('util');var moment=require(_0x7d73('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d73('0x2'));var fs=require('fs');var Redis=require(_0x7d73('0x3'));var db=require(_0x7d73('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d73('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d73('0x6')][_0x7d73('0x7')]({'port':0x232a});config[_0x7d73('0x8')]=_[_0x7d73('0x9')](config[_0x7d73('0x8')],{'host':_0x7d73('0xa'),'port':0x18eb});var socket=require(_0x7d73('0xb'))(new Redis(config[_0x7d73('0x8')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x964570,_0x3252fc,_0x5c6f19){return new BPromise(function(_0x1c1d21,_0x589ee7){return client[_0x7d73('0xc')](_0x964570,_0x5c6f19)[_0x7d73('0xd')](function(_0x2c65ba){logger['info'](_0x7d73('0xe'),_0x3252fc,_0x7d73('0xf'));logger['debug'](_0x7d73('0x10'),_0x3252fc,_0x7d73('0xf'),JSON[_0x7d73('0x11')](_0x2c65ba));if(_0x2c65ba[_0x7d73('0x12')]){if(_0x2c65ba['error'][_0x7d73('0x13')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x3252fc,_0x2c65ba[_0x7d73('0x12')][_0x7d73('0x14')]);return _0x589ee7(_0x2c65ba[_0x7d73('0x12')]['message']);}logger[_0x7d73('0x12')](_0x7d73('0xe'),_0x3252fc,_0x2c65ba[_0x7d73('0x12')][_0x7d73('0x14')]);return _0x1c1d21(_0x2c65ba[_0x7d73('0x12')][_0x7d73('0x14')]);}else{logger[_0x7d73('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x3252fc,_0x7d73('0xf'));_0x1c1d21(_0x2c65ba['result']['message']);}})[_0x7d73('0x16')](function(_0xc62766){logger[_0x7d73('0x12')](_0x7d73('0xe'),_0x3252fc,_0xc62766);_0x589ee7(_0xc62766);});});}exports['GetOpenchannelQueue']=function(_0x58d859){var _0x35b3db=this;return new Promise(function(_0x159a94,_0x80cd9c){return db[_0x7d73('0x17')]['findAll']({'raw':_0x58d859[_0x7d73('0x18')]?_0x58d859[_0x7d73('0x18')][_0x7d73('0x19')]===undefined?!![]:![]:!![],'where':_0x58d859[_0x7d73('0x18')]?_0x58d859[_0x7d73('0x18')][_0x7d73('0x1a')]||null:null,'attributes':_0x58d859[_0x7d73('0x18')]?_0x58d859['options']['attributes']||null:null,'limit':_0x58d859[_0x7d73('0x18')]?_0x58d859['options'][_0x7d73('0x1b')]||null:null,'include':_0x58d859[_0x7d73('0x18')]?_0x58d859[_0x7d73('0x18')][_0x7d73('0x1c')]?_[_0x7d73('0x1d')](_0x58d859[_0x7d73('0x18')]['include'],function(_0x3c14bf){return{'model':db[_0x3c14bf['model']],'as':_0x3c14bf['as'],'attributes':_0x3c14bf['attributes'],'include':_0x3c14bf[_0x7d73('0x1c')]?_['map'](_0x3c14bf[_0x7d73('0x1c')],function(_0xe43c38){return{'model':db[_0xe43c38[_0x7d73('0x1e')]],'as':_0xe43c38['as'],'attributes':_0xe43c38[_0x7d73('0x1f')],'include':_0xe43c38['include']?_[_0x7d73('0x1d')](_0xe43c38['include'],function(_0x4e37b2){return{'model':db[_0x4e37b2[_0x7d73('0x1e')]],'as':_0x4e37b2['as'],'attributes':_0x4e37b2[_0x7d73('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7d73('0xd')](function(_0xe233e8){logger[_0x7d73('0x15')](_0x7d73('0x20'),_0x58d859);logger[_0x7d73('0x21')](_0x7d73('0x20'),_0x58d859,JSON[_0x7d73('0x11')](_0xe233e8));_0x159a94(_0xe233e8);})[_0x7d73('0x16')](function(_0x32757a){logger[_0x7d73('0x12')](_0x7d73('0x20'),_0x32757a[_0x7d73('0x14')],_0x58d859);_0x80cd9c(_0x35b3db['error'](0x1f4,_0x32757a[_0x7d73('0x14')]));});});};exports['ShowOpenchannelQueue']=function(_0x141fb5){var _0xa19cca=this;return new Promise(function(_0x43e707,_0x21a8ce){return db[_0x7d73('0x17')][_0x7d73('0x22')]({'raw':_0x141fb5['options']?_0x141fb5[_0x7d73('0x18')][_0x7d73('0x19')]===undefined?!![]:![]:!![],'where':_0x141fb5[_0x7d73('0x18')]?_0x141fb5[_0x7d73('0x18')]['where']||null:null,'attributes':_0x141fb5[_0x7d73('0x18')]?_0x141fb5['options'][_0x7d73('0x1f')]||null:null,'include':_0x141fb5[_0x7d73('0x18')]?_0x141fb5[_0x7d73('0x18')][_0x7d73('0x1c')]?_[_0x7d73('0x1d')](_0x141fb5[_0x7d73('0x18')]['include'],function(_0x32e5a9){return{'model':db[_0x32e5a9[_0x7d73('0x1e')]],'as':_0x32e5a9['as'],'attributes':_0x32e5a9[_0x7d73('0x1f')],'include':_0x32e5a9['include']?_[_0x7d73('0x1d')](_0x32e5a9[_0x7d73('0x1c')],function(_0x1c0364){return{'model':db[_0x1c0364['model']],'as':_0x1c0364['as'],'attributes':_0x1c0364[_0x7d73('0x1f')],'include':_0x1c0364[_0x7d73('0x1c')]?_[_0x7d73('0x1d')](_0x1c0364[_0x7d73('0x1c')],function(_0x5907b6){return{'model':db[_0x5907b6['model']],'as':_0x5907b6['as'],'attributes':_0x5907b6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x324ecd){logger[_0x7d73('0x15')](_0x7d73('0x23'),_0x141fb5);logger[_0x7d73('0x21')](_0x7d73('0x23'),_0x141fb5,JSON[_0x7d73('0x11')](_0x324ecd));_0x43e707(_0x324ecd);})[_0x7d73('0x16')](function(_0x11935e){logger['error'](_0x7d73('0x23'),_0x11935e[_0x7d73('0x14')],_0x141fb5);_0x21a8ce(_0xa19cca[_0x7d73('0x12')](0x1f4,_0x11935e[_0x7d73('0x14')]));});});}; \ No newline at end of file +var _0x6726=['GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','stringify','ShowOpenchannelQueue','find','raw','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4646b6,_0x33ab4a){var _0x21b435=function(_0x442f7e){while(--_0x442f7e){_0x4646b6['push'](_0x4646b6['shift']());}};_0x21b435(++_0x33ab4a);}(_0x6726,0xdb));var _0x6672=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0x6726[_0x55ef8b];return _0x359c84;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var moment=require(_0x6672('0x1'));var BPromise=require('bluebird');var rs=require(_0x6672('0x2'));var fs=require('fs');var Redis=require(_0x6672('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6672('0x4'));var logger=require('../../config/logger')(_0x6672('0x5'));var config=require(_0x6672('0x6'));var jayson=require(_0x6672('0x7'));var client=jayson[_0x6672('0x8')]['http']({'port':0x232a});config[_0x6672('0x9')]=_[_0x6672('0xa')](config[_0x6672('0x9')],{'host':_0x6672('0xb'),'port':0x18eb});var socket=require(_0x6672('0xc'))(new Redis(config[_0x6672('0x9')]));require(_0x6672('0xd'))[_0x6672('0xe')](socket);function respondWithRpcPromise(_0x7357d1,_0x5cb17a,_0x32a0d6){return new BPromise(function(_0x327c71,_0x502ee3){return client[_0x6672('0xf')](_0x7357d1,_0x32a0d6)[_0x6672('0x10')](function(_0x43cbfd){logger[_0x6672('0x11')](_0x6672('0x12'),_0x5cb17a,_0x6672('0x13'));logger[_0x6672('0x14')](_0x6672('0x15'),_0x5cb17a,_0x6672('0x13'),JSON['stringify'](_0x43cbfd));if(_0x43cbfd[_0x6672('0x16')]){if(_0x43cbfd[_0x6672('0x16')][_0x6672('0x17')]===0x1f4){logger[_0x6672('0x16')](_0x6672('0x12'),_0x5cb17a,_0x43cbfd[_0x6672('0x16')][_0x6672('0x18')]);return _0x502ee3(_0x43cbfd['error'][_0x6672('0x18')]);}logger[_0x6672('0x16')](_0x6672('0x12'),_0x5cb17a,_0x43cbfd[_0x6672('0x16')][_0x6672('0x18')]);return _0x327c71(_0x43cbfd[_0x6672('0x16')][_0x6672('0x18')]);}else{logger[_0x6672('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x5cb17a,_0x6672('0x13'));_0x327c71(_0x43cbfd[_0x6672('0x19')][_0x6672('0x18')]);}})[_0x6672('0x1a')](function(_0x5d401b){logger[_0x6672('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x5cb17a,_0x5d401b);_0x502ee3(_0x5d401b);});});}exports[_0x6672('0x1b')]=function(_0x4ab968){var _0x467ead=this;return new Promise(function(_0xf7f0d0,_0x50e8c2){return db[_0x6672('0x1c')][_0x6672('0x1d')]({'raw':_0x4ab968[_0x6672('0x1e')]?_0x4ab968['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ab968[_0x6672('0x1e')]?_0x4ab968[_0x6672('0x1e')][_0x6672('0x1f')]||null:null,'attributes':_0x4ab968[_0x6672('0x1e')]?_0x4ab968[_0x6672('0x1e')][_0x6672('0x20')]||null:null,'limit':_0x4ab968[_0x6672('0x1e')]?_0x4ab968[_0x6672('0x1e')][_0x6672('0x21')]||null:null,'include':_0x4ab968[_0x6672('0x1e')]?_0x4ab968[_0x6672('0x1e')][_0x6672('0x22')]?_[_0x6672('0x23')](_0x4ab968[_0x6672('0x1e')][_0x6672('0x22')],function(_0x37e76e){return{'model':db[_0x37e76e[_0x6672('0x24')]],'as':_0x37e76e['as'],'attributes':_0x37e76e[_0x6672('0x20')],'include':_0x37e76e[_0x6672('0x22')]?_['map'](_0x37e76e[_0x6672('0x22')],function(_0x5e3d9c){return{'model':db[_0x5e3d9c[_0x6672('0x24')]],'as':_0x5e3d9c['as'],'attributes':_0x5e3d9c['attributes'],'include':_0x5e3d9c[_0x6672('0x22')]?_['map'](_0x5e3d9c['include'],function(_0x4fcd14){return{'model':db[_0x4fcd14[_0x6672('0x24')]],'as':_0x4fcd14['as'],'attributes':_0x4fcd14[_0x6672('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6672('0x10')](function(_0x1d4262){logger['info'](_0x6672('0x1b'),_0x4ab968);logger['debug'](_0x6672('0x1b'),_0x4ab968,JSON[_0x6672('0x25')](_0x1d4262));_0xf7f0d0(_0x1d4262);})[_0x6672('0x1a')](function(_0x5d2831){logger[_0x6672('0x16')]('GetOpenchannelQueue',_0x5d2831[_0x6672('0x18')],_0x4ab968);_0x50e8c2(_0x467ead['error'](0x1f4,_0x5d2831['message']));});});};exports[_0x6672('0x26')]=function(_0x18e84c){var _0x408265=this;return new Promise(function(_0x225ad0,_0x747cbb){return db[_0x6672('0x1c')][_0x6672('0x27')]({'raw':_0x18e84c[_0x6672('0x1e')]?_0x18e84c[_0x6672('0x1e')][_0x6672('0x28')]===undefined?!![]:![]:!![],'where':_0x18e84c[_0x6672('0x1e')]?_0x18e84c['options'][_0x6672('0x1f')]||null:null,'attributes':_0x18e84c['options']?_0x18e84c[_0x6672('0x1e')][_0x6672('0x20')]||null:null,'include':_0x18e84c[_0x6672('0x1e')]?_0x18e84c['options'][_0x6672('0x22')]?_[_0x6672('0x23')](_0x18e84c['options']['include'],function(_0x4fbe1a){return{'model':db[_0x4fbe1a['model']],'as':_0x4fbe1a['as'],'attributes':_0x4fbe1a['attributes'],'include':_0x4fbe1a['include']?_['map'](_0x4fbe1a[_0x6672('0x22')],function(_0x28e5ac){return{'model':db[_0x28e5ac[_0x6672('0x24')]],'as':_0x28e5ac['as'],'attributes':_0x28e5ac[_0x6672('0x20')],'include':_0x28e5ac[_0x6672('0x22')]?_['map'](_0x28e5ac[_0x6672('0x22')],function(_0x22301a){return{'model':db[_0x22301a['model']],'as':_0x22301a['as'],'attributes':_0x22301a[_0x6672('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1927e9){logger['info']('ShowOpenchannelQueue',_0x18e84c);logger[_0x6672('0x14')](_0x6672('0x26'),_0x18e84c,JSON['stringify'](_0x1927e9));_0x225ad0(_0x1927e9);})[_0x6672('0x1a')](function(_0x4d74c3){logger[_0x6672('0x16')](_0x6672('0x26'),_0x4d74c3[_0x6672('0x18')],_0x18e84c);_0x747cbb(_0x408265['error'](0x1f4,_0x4d74c3['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index a5ed9cf..d093cd0 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 d8e8a8e..2f6f0cb 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 _0xb10b=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2ea174,_0xb3181){var _0x5987c7=function(_0x3f7c44){while(--_0x3f7c44){_0x2ea174['push'](_0x2ea174['shift']());}};_0x5987c7(++_0xb3181);}(_0xb10b,0x12a));var _0xbb10=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0xb10b[_0xf55e73];return _0x116b99;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=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(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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 db99939..ff1047c 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 _0x299d=['sequelize','exports','STRING','DATE','moment'];(function(_0x4e2c5b,_0x55cb19){var _0x545264=function(_0x550b40){while(--_0x550b40){_0x4e2c5b['push'](_0x4e2c5b['shift']());}};_0x545264(++_0x55cb19);}(_0x299d,0x108));var _0xd299=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x299d[_0x15bc81];return _0x59440e;};'use strict';var moment=require(_0xd299('0x0'));var Sequelize=require(_0xd299('0x1'));module[_0xd299('0x2')]={'uniqueid':{'type':Sequelize[_0xd299('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd299('0x3')]},'joinAt':{'type':Sequelize[_0xd299('0x4')]},'leaveAt':{'type':Sequelize[_0xd299('0x4')]},'acceptAt':{'type':Sequelize[_0xd299('0x4')]},'exitAt':{'type':Sequelize[_0xd299('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc25e=['moment','sequelize','exports','DATE','STRING'];(function(_0x3c098d,_0x32ae5f){var _0x1241a8=function(_0x4aa4a5){while(--_0x4aa4a5){_0x3c098d['push'](_0x3c098d['shift']());}};_0x1241a8(++_0x32ae5f);}(_0xc25e,0x131));var _0xec25=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc25e[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require(_0xec25('0x0'));var Sequelize=require(_0xec25('0x1'));module[_0xec25('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xec25('0x3')]},'leaveAt':{'type':Sequelize[_0xec25('0x3')]},'acceptAt':{'type':Sequelize[_0xec25('0x3')]},'exitAt':{'type':Sequelize[_0xec25('0x3')]},'reason':{'type':Sequelize[_0xec25('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 720a15c..9c172ff 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 _0x818a=['mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','OpenchannelQueueReport','rawAttributes','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','rows','catch','params','keys','options','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x487b37,_0x1c6aa0){var _0x44cdaa=function(_0x34a41b){while(--_0x34a41b){_0x487b37['push'](_0x487b37['shift']());}};_0x44cdaa(++_0x1c6aa0);}(_0x818a,0x15e));var _0xa818=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x818a[_0x53f37f];return _0x2fe5f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa818('0x0'));var rimraf=require(_0xa818('0x1'));var zipdir=require(_0xa818('0x2'));var jsonpatch=require(_0xa818('0x3'));var rp=require('request-promise');var moment=require(_0xa818('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa818('0x5'));var util=require(_0xa818('0x6'));var path=require(_0xa818('0x7'));var sox=require('sox');var csv=require(_0xa818('0x8'));var ejs=require(_0xa818('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa818('0xa'));var crypto=require(_0xa818('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa818('0xc'));var toCsv=require(_0xa818('0x8'));var querystring=require('querystring');var Papa=require(_0xa818('0xd'));var authService=require(_0xa818('0xe'));var hardwareService=require(_0xa818('0xf'));var Redis=require(_0xa818('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xa818('0x11'))(_0xa818('0x12'));var utils=require('../../config/utils');var config=require(_0xa818('0x13'));var db=require(_0xa818('0x14'))['db'];function respondWithStatusCode(_0x3339f0,_0x57592b){_0x57592b=_0x57592b||0xcc;return function(_0x4c1feb){if(_0x4c1feb){return _0x3339f0[_0xa818('0x15')](_0x57592b);}return _0x3339f0[_0xa818('0x16')](_0x57592b)[_0xa818('0x17')]();};}function respondWithResult(_0x10c513,_0x277c7f){_0x277c7f=_0x277c7f||0xc8;return function(_0x54c794){if(_0x54c794){return _0x10c513[_0xa818('0x16')](_0x277c7f)[_0xa818('0x18')](_0x54c794);}};}function respondWithFilteredResult(_0x23a5d8,_0x595c0d){return function(_0x7bde4b){if(_0x7bde4b){var _0x400a49=_0x7bde4b[_0xa818('0x19')],_0x2a0612=_0x595c0d[_0xa818('0x1a')],_0x25a8ed=_0x595c0d['offset']+_0x595c0d[_0xa818('0x1b')],_0x4f396c;if(_0x25a8ed>=_0x400a49){_0x25a8ed=_0x400a49;_0x4f396c=0xc8;}else{_0x4f396c=0xce;}_0x23a5d8[_0xa818('0x16')](_0x4f396c);return _0x23a5d8[_0xa818('0x1c')](_0xa818('0x1d'),_0x2a0612+'-'+_0x25a8ed+'/'+_0x400a49)[_0xa818('0x18')](_0x7bde4b);}return null;};}function patchUpdates(_0x266149){return function(_0x130009){try{jsonpatch[_0xa818('0x1e')](_0x130009,_0x266149,!![]);}catch(_0x5dce92){return BPromise[_0xa818('0x1f')](_0x5dce92);}return _0x130009[_0xa818('0x20')]();};}function saveUpdates(_0x30dcb6,_0x488bfc){return function(_0x5ed143){if(_0x5ed143){return _0x5ed143[_0xa818('0x21')](_0x30dcb6)[_0xa818('0x22')](function(_0x397259){return _0x397259;});}return null;};}function removeEntity(_0x34b2fa,_0x1ad88a){return function(_0x4a31ec){if(_0x4a31ec){return _0x4a31ec[_0xa818('0x23')]()[_0xa818('0x22')](function(){_0x34b2fa['status'](0xcc)[_0xa818('0x17')]();});}};}function handleEntityNotFound(_0x3df1fb,_0x3b8836){return function(_0x25edae){if(!_0x25edae){_0x3df1fb['sendStatus'](0x194);}return _0x25edae;};}function handleError(_0x4feb00,_0x33ec89){_0x33ec89=_0x33ec89||0x1f4;return function(_0x3d2469){logger[_0xa818('0x24')](_0x3d2469[_0xa818('0x25')]);if(_0x3d2469[_0xa818('0x26')]){delete _0x3d2469[_0xa818('0x26')];}_0x4feb00['status'](_0x33ec89)[_0xa818('0x27')](_0x3d2469);};}exports['index']=function(_0x52d5f0,_0x2fc522){var _0x1f4a6a={},_0x23cd07={},_0x3937bc={'count':0x0,'rows':[]};var _0x40c763=db[_0xa818('0x28')][_0xa818('0x29')];_0x23cd07['model']=_['keys'](_0x40c763);_0x23cd07[_0xa818('0x2a')]=_['keys'](_0x52d5f0[_0xa818('0x2a')]);_0x23cd07['filters']=_[_0xa818('0x2b')](_0x23cd07['model'],_0x23cd07[_0xa818('0x2a')]);_0x1f4a6a['attributes']=_[_0xa818('0x2b')](_0x23cd07[_0xa818('0x2c')],qs[_0xa818('0x2d')](_0x52d5f0[_0xa818('0x2a')][_0xa818('0x2d')]));_0x1f4a6a[_0xa818('0x2e')]=_0x1f4a6a[_0xa818('0x2e')][_0xa818('0x2f')]?_0x1f4a6a['attributes']:_0x23cd07[_0xa818('0x2c')];if(!_0x52d5f0[_0xa818('0x2a')][_0xa818('0x30')]('nolimit')){_0x1f4a6a[_0xa818('0x1b')]=qs[_0xa818('0x1b')](_0x52d5f0[_0xa818('0x2a')]['limit']);_0x1f4a6a[_0xa818('0x1a')]=qs['offset'](_0x52d5f0[_0xa818('0x2a')][_0xa818('0x1a')]);}_0x1f4a6a[_0xa818('0x31')]=qs['sort'](_0x52d5f0[_0xa818('0x2a')][_0xa818('0x32')]);_0x1f4a6a[_0xa818('0x33')]=qs[_0xa818('0x34')](_[_0xa818('0x35')](_0x52d5f0[_0xa818('0x2a')],_0x23cd07[_0xa818('0x34')]));if(_0x52d5f0[_0xa818('0x2a')][_0xa818('0x36')]){_0x1f4a6a[_0xa818('0x33')]=_[_0xa818('0x37')](_0x1f4a6a[_0xa818('0x33')],{'$or':_[_0xa818('0x38')](_0x40c763,function(_0x5375f5){if(_0x5375f5[_0xa818('0x39')]['key']!==_0xa818('0x3a')){var _0xa662b1={};_0xa662b1[_0x5375f5[_0xa818('0x3b')]]={'$like':'%'+_0x52d5f0[_0xa818('0x2a')][_0xa818('0x36')]+'%'};return _0xa662b1;}})});}_0x1f4a6a=_[_0xa818('0x37')]({},_0x1f4a6a,_0x52d5f0['options']);var _0x455d16={'where':_0x1f4a6a[_0xa818('0x33')]};return db[_0xa818('0x28')][_0xa818('0x19')](_0x455d16)['then'](function(_0x18ddc6){_0x3937bc[_0xa818('0x19')]=_0x18ddc6;if(_0x52d5f0[_0xa818('0x2a')][_0xa818('0x3c')]){_0x1f4a6a[_0xa818('0x3d')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xa818('0x3e')](_0x1f4a6a);})['then'](function(_0x21e635){_0x3937bc[_0xa818('0x3f')]=_0x21e635;return _0x3937bc;})[_0xa818('0x22')](respondWithFilteredResult(_0x2fc522,_0x1f4a6a))[_0xa818('0x40')](handleError(_0x2fc522,null));};exports['show']=function(_0x22f4c5,_0x187144){var _0x45127f={'raw':!![],'where':{'id':_0x22f4c5[_0xa818('0x41')]['id']}},_0x827b14={};_0x827b14[_0xa818('0x2c')]=_['keys'](db[_0xa818('0x28')][_0xa818('0x29')]);_0x827b14[_0xa818('0x2a')]=_[_0xa818('0x42')](_0x22f4c5[_0xa818('0x2a')]);_0x827b14[_0xa818('0x34')]=_[_0xa818('0x2b')](_0x827b14[_0xa818('0x2c')],_0x827b14['query']);_0x45127f[_0xa818('0x2e')]=_[_0xa818('0x2b')](_0x827b14['model'],qs['fields'](_0x22f4c5['query'][_0xa818('0x2d')]));_0x45127f[_0xa818('0x2e')]=_0x45127f[_0xa818('0x2e')][_0xa818('0x2f')]?_0x45127f[_0xa818('0x2e')]:_0x827b14[_0xa818('0x2c')];if(_0x22f4c5[_0xa818('0x2a')][_0xa818('0x3c')]){_0x45127f[_0xa818('0x3d')]=[{'all':!![]}];}_0x45127f=_[_0xa818('0x37')]({},_0x45127f,_0x22f4c5[_0xa818('0x43')]);return db[_0xa818('0x28')]['find'](_0x45127f)[_0xa818('0x22')](handleEntityNotFound(_0x187144,null))[_0xa818('0x22')](respondWithResult(_0x187144,null))[_0xa818('0x40')](handleError(_0x187144,null));};exports[_0xa818('0x44')]=function(_0xc2cd92,_0x18adbb){return db[_0xa818('0x28')][_0xa818('0x44')](_0xc2cd92[_0xa818('0x45')],{})[_0xa818('0x22')](respondWithResult(_0x18adbb,0xc9))['catch'](handleError(_0x18adbb,null));};exports[_0xa818('0x21')]=function(_0x213e85,_0x2a6bc0){if(_0x213e85['body']['id']){delete _0x213e85[_0xa818('0x45')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x213e85[_0xa818('0x41')]['id']}})[_0xa818('0x22')](handleEntityNotFound(_0x2a6bc0,null))[_0xa818('0x22')](saveUpdates(_0x213e85[_0xa818('0x45')],null))[_0xa818('0x22')](respondWithResult(_0x2a6bc0,null))[_0xa818('0x40')](handleError(_0x2a6bc0,null));};exports[_0xa818('0x23')]=function(_0x2fa84e,_0xe6207f){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x2fa84e[_0xa818('0x41')]['id']}})[_0xa818('0x22')](handleEntityNotFound(_0xe6207f,null))[_0xa818('0x22')](removeEntity(_0xe6207f,null))[_0xa818('0x40')](handleError(_0xe6207f,null));};exports[_0xa818('0x46')]=function(_0x5bd747,_0x239938){return db[_0xa818('0x28')]['describe']()['then'](respondWithResult(_0x239938,null))[_0xa818('0x40')](handleError(_0x239938,null));}; \ No newline at end of file +var _0x7ec4=['limit','set','Content-Range','apply','reject','save','update','then','end','stack','name','index','OpenchannelQueueReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','key','field','include','findAll','rows','catch','includeAll','options','find','create','params','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x7ec4,0xbe));var _0x47ec=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7ec4[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require(_0x47ec('0x0'));var emlformat=require(_0x47ec('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x47ec('0x2'));var jsonpatch=require(_0x47ec('0x3'));var rp=require(_0x47ec('0x4'));var moment=require(_0x47ec('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x47ec('0x6'));var util=require('util');var path=require(_0x47ec('0x7'));var sox=require(_0x47ec('0x8'));var csv=require(_0x47ec('0x9'));var ejs=require(_0x47ec('0xa'));var fs=require('fs');var _=require(_0x47ec('0xb'));var squel=require(_0x47ec('0xc'));var crypto=require(_0x47ec('0xd'));var jsforce=require(_0x47ec('0xe'));var deskjs=require(_0x47ec('0xf'));var toCsv=require(_0x47ec('0x9'));var querystring=require(_0x47ec('0x10'));var Papa=require('papaparse');var authService=require(_0x47ec('0x11'));var hardwareService=require(_0x47ec('0x12'));var Redis=require(_0x47ec('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x47ec('0x14'))(_0x47ec('0x15'));var utils=require(_0x47ec('0x16'));var config=require(_0x47ec('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ed8b2,_0x1af564){_0x1af564=_0x1af564||0xcc;return function(_0x122c03){if(_0x122c03){return _0x5ed8b2[_0x47ec('0x18')](_0x1af564);}return _0x5ed8b2[_0x47ec('0x19')](_0x1af564)['end']();};}function respondWithResult(_0x9e8653,_0x3632c9){_0x3632c9=_0x3632c9||0xc8;return function(_0x5ceba0){if(_0x5ceba0){return _0x9e8653[_0x47ec('0x19')](_0x3632c9)[_0x47ec('0x1a')](_0x5ceba0);}};}function respondWithFilteredResult(_0x259365,_0x33978e){return function(_0x452d67){if(_0x452d67){var _0x338ae8=_0x452d67[_0x47ec('0x1b')],_0xad942a=_0x33978e['offset'],_0x3fc8b3=_0x33978e[_0x47ec('0x1c')]+_0x33978e[_0x47ec('0x1d')],_0x164a46;if(_0x3fc8b3>=_0x338ae8){_0x3fc8b3=_0x338ae8;_0x164a46=0xc8;}else{_0x164a46=0xce;}_0x259365[_0x47ec('0x19')](_0x164a46);return _0x259365[_0x47ec('0x1e')](_0x47ec('0x1f'),_0xad942a+'-'+_0x3fc8b3+'/'+_0x338ae8)[_0x47ec('0x1a')](_0x452d67);}return null;};}function patchUpdates(_0x4865ac){return function(_0x14805e){try{jsonpatch[_0x47ec('0x20')](_0x14805e,_0x4865ac,!![]);}catch(_0x500d91){return BPromise[_0x47ec('0x21')](_0x500d91);}return _0x14805e[_0x47ec('0x22')]();};}function saveUpdates(_0x25f2d9,_0x423b12){return function(_0x1af926){if(_0x1af926){return _0x1af926[_0x47ec('0x23')](_0x25f2d9)[_0x47ec('0x24')](function(_0xd585aa){return _0xd585aa;});}return null;};}function removeEntity(_0x41b163,_0x1f2277){return function(_0xb6bc0c){if(_0xb6bc0c){return _0xb6bc0c['destroy']()[_0x47ec('0x24')](function(){_0x41b163['status'](0xcc)[_0x47ec('0x25')]();});}};}function handleEntityNotFound(_0x432550,_0xbb17e7){return function(_0x3d19c0){if(!_0x3d19c0){_0x432550[_0x47ec('0x18')](0x194);}return _0x3d19c0;};}function handleError(_0x2981bc,_0x323f68){_0x323f68=_0x323f68||0x1f4;return function(_0xd0a6d6){logger['error'](_0xd0a6d6[_0x47ec('0x26')]);if(_0xd0a6d6[_0x47ec('0x27')]){delete _0xd0a6d6['name'];}_0x2981bc['status'](_0x323f68)['send'](_0xd0a6d6);};}exports[_0x47ec('0x28')]=function(_0x2665b6,_0x3c22b6){var _0x3ed321={},_0x27e9dc={},_0x43b0dd={'count':0x0,'rows':[]};var _0x4eabd6=db[_0x47ec('0x29')][_0x47ec('0x2a')];_0x27e9dc[_0x47ec('0x2b')]=_['keys'](_0x4eabd6);_0x27e9dc[_0x47ec('0x2c')]=_[_0x47ec('0x2d')](_0x2665b6[_0x47ec('0x2c')]);_0x27e9dc[_0x47ec('0x2e')]=_[_0x47ec('0x2f')](_0x27e9dc[_0x47ec('0x2b')],_0x27e9dc[_0x47ec('0x2c')]);_0x3ed321[_0x47ec('0x30')]=_[_0x47ec('0x2f')](_0x27e9dc[_0x47ec('0x2b')],qs[_0x47ec('0x31')](_0x2665b6[_0x47ec('0x2c')]['fields']));_0x3ed321['attributes']=_0x3ed321['attributes'][_0x47ec('0x32')]?_0x3ed321['attributes']:_0x27e9dc[_0x47ec('0x2b')];if(!_0x2665b6[_0x47ec('0x2c')][_0x47ec('0x33')](_0x47ec('0x34'))){_0x3ed321[_0x47ec('0x1d')]=qs[_0x47ec('0x1d')](_0x2665b6[_0x47ec('0x2c')][_0x47ec('0x1d')]);_0x3ed321['offset']=qs['offset'](_0x2665b6[_0x47ec('0x2c')][_0x47ec('0x1c')]);}_0x3ed321[_0x47ec('0x35')]=qs[_0x47ec('0x36')](_0x2665b6[_0x47ec('0x2c')]['sort']);_0x3ed321[_0x47ec('0x37')]=qs[_0x47ec('0x2e')](_['pick'](_0x2665b6['query'],_0x27e9dc['filters']));if(_0x2665b6[_0x47ec('0x2c')][_0x47ec('0x38')]){_0x3ed321[_0x47ec('0x37')]=_[_0x47ec('0x39')](_0x3ed321[_0x47ec('0x37')],{'$or':_[_0x47ec('0x3a')](_0x4eabd6,function(_0x1637ad){if(_0x1637ad['type'][_0x47ec('0x3b')]!=='VIRTUAL'){var _0x1eb631={};_0x1eb631[_0x1637ad[_0x47ec('0x3c')]]={'$like':'%'+_0x2665b6[_0x47ec('0x2c')][_0x47ec('0x38')]+'%'};return _0x1eb631;}})});}_0x3ed321=_[_0x47ec('0x39')]({},_0x3ed321,_0x2665b6['options']);var _0x592d8c={'where':_0x3ed321[_0x47ec('0x37')]};return db[_0x47ec('0x29')][_0x47ec('0x1b')](_0x592d8c)[_0x47ec('0x24')](function(_0x12f5df){_0x43b0dd[_0x47ec('0x1b')]=_0x12f5df;if(_0x2665b6[_0x47ec('0x2c')]['includeAll']){_0x3ed321[_0x47ec('0x3d')]=[{'all':!![]}];}return db[_0x47ec('0x29')][_0x47ec('0x3e')](_0x3ed321);})[_0x47ec('0x24')](function(_0x17c391){_0x43b0dd[_0x47ec('0x3f')]=_0x17c391;return _0x43b0dd;})[_0x47ec('0x24')](respondWithFilteredResult(_0x3c22b6,_0x3ed321))[_0x47ec('0x40')](handleError(_0x3c22b6,null));};exports['show']=function(_0x5ddfc5,_0x21f1f0){var _0x73d76={'raw':!![],'where':{'id':_0x5ddfc5['params']['id']}},_0x1d9df1={};_0x1d9df1['model']=_[_0x47ec('0x2d')](db[_0x47ec('0x29')][_0x47ec('0x2a')]);_0x1d9df1[_0x47ec('0x2c')]=_[_0x47ec('0x2d')](_0x5ddfc5['query']);_0x1d9df1['filters']=_['intersection'](_0x1d9df1[_0x47ec('0x2b')],_0x1d9df1[_0x47ec('0x2c')]);_0x73d76[_0x47ec('0x30')]=_[_0x47ec('0x2f')](_0x1d9df1['model'],qs[_0x47ec('0x31')](_0x5ddfc5[_0x47ec('0x2c')][_0x47ec('0x31')]));_0x73d76[_0x47ec('0x30')]=_0x73d76[_0x47ec('0x30')][_0x47ec('0x32')]?_0x73d76[_0x47ec('0x30')]:_0x1d9df1[_0x47ec('0x2b')];if(_0x5ddfc5[_0x47ec('0x2c')][_0x47ec('0x41')]){_0x73d76['include']=[{'all':!![]}];}_0x73d76=_[_0x47ec('0x39')]({},_0x73d76,_0x5ddfc5[_0x47ec('0x42')]);return db[_0x47ec('0x29')][_0x47ec('0x43')](_0x73d76)['then'](handleEntityNotFound(_0x21f1f0,null))['then'](respondWithResult(_0x21f1f0,null))['catch'](handleError(_0x21f1f0,null));};exports[_0x47ec('0x44')]=function(_0x1ba23c,_0x4690e4){return db[_0x47ec('0x29')][_0x47ec('0x44')](_0x1ba23c['body'],{})['then'](respondWithResult(_0x4690e4,0xc9))['catch'](handleError(_0x4690e4,null));};exports[_0x47ec('0x23')]=function(_0x1f87cf,_0x4f1377){if(_0x1f87cf['body']['id']){delete _0x1f87cf['body']['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x1f87cf[_0x47ec('0x45')]['id']}})[_0x47ec('0x24')](handleEntityNotFound(_0x4f1377,null))[_0x47ec('0x24')](saveUpdates(_0x1f87cf[_0x47ec('0x46')],null))['then'](respondWithResult(_0x4f1377,null))[_0x47ec('0x40')](handleError(_0x4f1377,null));};exports[_0x47ec('0x47')]=function(_0x2b5fef,_0x32d2af){return db['OpenchannelQueueReport'][_0x47ec('0x43')]({'where':{'id':_0x2b5fef[_0x47ec('0x45')]['id']}})[_0x47ec('0x24')](handleEntityNotFound(_0x32d2af,null))[_0x47ec('0x24')](removeEntity(_0x32d2af,null))[_0x47ec('0x40')](handleError(_0x32d2af,null));};exports[_0x47ec('0x48')]=function(_0x4f60ea,_0x385a4d){return db['OpenchannelQueueReport'][_0x47ec('0x48')]()[_0x47ec('0x24')](respondWithResult(_0x385a4d,null))[_0x47ec('0x40')](handleError(_0x385a4d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index e9c382f..b9296c9 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 _0x5c12=['report_openchannel_queue','uniqueid','util','../../config/logger','moment','bluebird','request-promise','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x2f485e,_0x1ce4ff){var _0x1ca654=function(_0x1fee68){while(--_0x1fee68){_0x2f485e['push'](_0x2f485e['shift']());}};_0x1ca654(++_0x1ce4ff);}(_0x5c12,0x188));var _0x25c1=function(_0x502953,_0x28de83){_0x502953=_0x502953-0x0;var _0x2fa32d=_0x5c12[_0x502953];return _0x2fa32d;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var logger=require(_0x25c1('0x1'))('api');var moment=require(_0x25c1('0x2'));var BPromise=require(_0x25c1('0x3'));var rp=require(_0x25c1('0x4'));var attributes=require(_0x25c1('0x5'));module[_0x25c1('0x6')]=function(_0x21ec20,_0x3f0f35){return _0x21ec20['define'](_0x25c1('0x7'),attributes,{'tableName':_0x25c1('0x8'),'paranoid':![],'indexes':[{'name':_0x25c1('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9275=['exports','define','report_openchannel_queue','uniqueid','util','../../config/logger','api','bluebird','request-promise','./openchannelQueueReport.attributes'];(function(_0x189ff7,_0x346b65){var _0x153e20=function(_0x5eaa60){while(--_0x5eaa60){_0x189ff7['push'](_0x189ff7['shift']());}};_0x153e20(++_0x346b65);}(_0x9275,0x130));var _0x5927=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x9275[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var util=require(_0x5927('0x0'));var logger=require(_0x5927('0x1'))(_0x5927('0x2'));var moment=require('moment');var BPromise=require(_0x5927('0x3'));var rp=require(_0x5927('0x4'));var attributes=require(_0x5927('0x5'));module[_0x5927('0x6')]=function(_0x3140af,_0x5200e6){return _0x3140af[_0x5927('0x7')]('OpenchannelQueueReport',attributes,{'tableName':_0x5927('0x8'),'paranoid':![],'indexes':[{'name':_0x5927('0x9'),'fields':[_0x5927('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0398028..f97c520 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 _0x57ae=['then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','update','attributes','UpdateOpenchannelQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x494e9e,_0x5bf4c9){var _0x5aca28=function(_0x3259bd){while(--_0x3259bd){_0x494e9e['push'](_0x494e9e['shift']());}};_0x5aca28(++_0x5bf4c9);}(_0x57ae,0x90));var _0xe57a=function(_0x53a983,_0x49e57a){_0x53a983=_0x53a983-0x0;var _0x25b457=_0x57ae[_0x53a983];return _0x25b457;};'use strict';var _=require('lodash');var util=require(_0xe57a('0x0'));var moment=require(_0xe57a('0x1'));var BPromise=require(_0xe57a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe57a('0x3'));var db=require(_0xe57a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe57a('0x5'))(_0xe57a('0x6'));var config=require(_0xe57a('0x7'));var jayson=require(_0xe57a('0x8'));var client=jayson['client'][_0xe57a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aded9,_0x644af2,_0x4d6097){return new BPromise(function(_0x439937,_0x445906){return client[_0xe57a('0xa')](_0x1aded9,_0x4d6097)[_0xe57a('0xb')](function(_0x1b19f4){logger[_0xe57a('0xc')](_0xe57a('0xd'),_0x644af2,_0xe57a('0xe'));logger[_0xe57a('0xf')](_0xe57a('0x10'),_0x644af2,_0xe57a('0xe'),JSON[_0xe57a('0x11')](_0x1b19f4));if(_0x1b19f4[_0xe57a('0x12')]){if(_0x1b19f4[_0xe57a('0x12')]['code']===0x1f4){logger[_0xe57a('0x12')](_0xe57a('0xd'),_0x644af2,_0x1b19f4[_0xe57a('0x12')][_0xe57a('0x13')]);return _0x445906(_0x1b19f4[_0xe57a('0x12')]['message']);}logger[_0xe57a('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x644af2,_0x1b19f4[_0xe57a('0x12')]['message']);return _0x439937(_0x1b19f4[_0xe57a('0x12')][_0xe57a('0x13')]);}else{logger[_0xe57a('0xc')](_0xe57a('0xd'),_0x644af2,'request\x20sent');_0x439937(_0x1b19f4[_0xe57a('0x14')][_0xe57a('0x13')]);}})[_0xe57a('0x15')](function(_0x6d6491){logger[_0xe57a('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x644af2,_0x6d6491);_0x445906(_0x6d6491);});});}exports['CreateOpenchannelQueueReport']=function(_0x166b12){var _0x512c3e=this;return new Promise(function(_0x5d773f,_0x1a5f67){return db[_0xe57a('0x16')][_0xe57a('0x17')](_0x166b12[_0xe57a('0x18')],{'raw':_0x166b12[_0xe57a('0x19')]?_0x166b12[_0xe57a('0x19')][_0xe57a('0x1a')]===undefined?!![]:![]:!![]})[_0xe57a('0xb')](function(_0x5b32d5){logger[_0xe57a('0xc')](_0xe57a('0x1b'),_0x166b12);logger[_0xe57a('0xf')](_0xe57a('0x1b'),_0x166b12,JSON[_0xe57a('0x11')](_0x5b32d5));_0x5d773f(_0x5b32d5);})['catch'](function(_0xc91bb7){logger[_0xe57a('0x12')](_0xe57a('0x1b'),_0xc91bb7[_0xe57a('0x13')],_0x166b12);_0x1a5f67(_0x512c3e[_0xe57a('0x12')](0x1f4,_0xc91bb7[_0xe57a('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x5ce979){var _0x3902a1=this;return new Promise(function(_0x2ffb4a,_0x25f39b){return db[_0xe57a('0x16')][_0xe57a('0x1c')](_0x5ce979[_0xe57a('0x18')],{'raw':_0x5ce979['options']?_0x5ce979['options'][_0xe57a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ce979['options']?_0x5ce979[_0xe57a('0x19')]['where']||null:null,'attributes':_0x5ce979[_0xe57a('0x19')]?_0x5ce979['options'][_0xe57a('0x1d')]||null:null,'limit':_0x5ce979['options']?_0x5ce979['options']['limit']||null:null})[_0xe57a('0xb')](function(_0x38f627){logger[_0xe57a('0xc')]('UpdateOpenchannelQueueReport',_0x5ce979);logger[_0xe57a('0xf')](_0xe57a('0x1e'),_0x5ce979,JSON[_0xe57a('0x11')](_0x38f627));_0x2ffb4a(_0x38f627);})['catch'](function(_0x4694ea){logger[_0xe57a('0x12')](_0xe57a('0x1e'),_0x4694ea[_0xe57a('0x13')],_0x5ce979);_0x25f39b(_0x3902a1[_0xe57a('0x12')](0x1f4,_0x4694ea[_0xe57a('0x13')]));});});}; \ No newline at end of file +var _0x5344=['stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','body','attributes','UpdateOpenchannelQueueReport','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x5821fb,_0x5f1f53){var _0x468067=function(_0xe062ca){while(--_0xe062ca){_0x5821fb['push'](_0x5821fb['shift']());}};_0x468067(++_0x5f1f53);}(_0x5344,0x185));var _0x4534=function(_0x2ef691,_0x2807e2){_0x2ef691=_0x2ef691-0x0;var _0x4e0a85=_0x5344[_0x2ef691];return _0x4e0a85;};'use strict';var _=require(_0x4534('0x0'));var util=require(_0x4534('0x1'));var moment=require(_0x4534('0x2'));var BPromise=require(_0x4534('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4534('0x4'))['db'];var utils=require(_0x4534('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4534('0x6'));var jayson=require(_0x4534('0x7'));var client=jayson[_0x4534('0x8')][_0x4534('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55405f,_0xdf9d1f,_0x3ffdfd){return new BPromise(function(_0x5c27dc,_0xb168b4){return client[_0x4534('0xa')](_0x55405f,_0x3ffdfd)[_0x4534('0xb')](function(_0x282757){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0xdf9d1f,_0x4534('0xc'));logger['debug'](_0x4534('0xd'),_0xdf9d1f,'request\x20sent',JSON[_0x4534('0xe')](_0x282757));if(_0x282757[_0x4534('0xf')]){if(_0x282757[_0x4534('0xf')][_0x4534('0x10')]===0x1f4){logger[_0x4534('0xf')](_0x4534('0x11'),_0xdf9d1f,_0x282757['error']['message']);return _0xb168b4(_0x282757['error'][_0x4534('0x12')]);}logger['error'](_0x4534('0x11'),_0xdf9d1f,_0x282757['error'][_0x4534('0x12')]);return _0x5c27dc(_0x282757[_0x4534('0xf')][_0x4534('0x12')]);}else{logger[_0x4534('0x13')](_0x4534('0x11'),_0xdf9d1f,_0x4534('0xc'));_0x5c27dc(_0x282757[_0x4534('0x14')][_0x4534('0x12')]);}})[_0x4534('0x15')](function(_0x6aac28){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xdf9d1f,_0x6aac28);_0xb168b4(_0x6aac28);});});}exports[_0x4534('0x16')]=function(_0x53b42f){var _0x5d5332=this;return new Promise(function(_0x16f685,_0x16373a){return db[_0x4534('0x17')][_0x4534('0x18')](_0x53b42f['body'],{'raw':_0x53b42f[_0x4534('0x19')]?_0x53b42f[_0x4534('0x19')][_0x4534('0x1a')]===undefined?!![]:![]:!![]})[_0x4534('0xb')](function(_0x266c70){logger['info']('CreateOpenchannelQueueReport',_0x53b42f);logger['debug'](_0x4534('0x16'),_0x53b42f,JSON[_0x4534('0xe')](_0x266c70));_0x16f685(_0x266c70);})[_0x4534('0x15')](function(_0x4bb598){logger[_0x4534('0xf')](_0x4534('0x16'),_0x4bb598[_0x4534('0x12')],_0x53b42f);_0x16373a(_0x5d5332['error'](0x1f4,_0x4bb598[_0x4534('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0xca0daf){var _0x200fc0=this;return new Promise(function(_0x3f9503,_0x24af1a){return db[_0x4534('0x17')]['update'](_0xca0daf[_0x4534('0x1b')],{'raw':_0xca0daf['options']?_0xca0daf[_0x4534('0x19')][_0x4534('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xca0daf[_0x4534('0x19')]?_0xca0daf[_0x4534('0x19')]['where']||null:null,'attributes':_0xca0daf[_0x4534('0x19')]?_0xca0daf[_0x4534('0x19')][_0x4534('0x1c')]||null:null,'limit':_0xca0daf['options']?_0xca0daf['options']['limit']||null:null})[_0x4534('0xb')](function(_0x2f5ba7){logger[_0x4534('0x13')](_0x4534('0x1d'),_0xca0daf);logger[_0x4534('0x1e')]('UpdateOpenchannelQueueReport',_0xca0daf,JSON[_0x4534('0xe')](_0x2f5ba7));_0x3f9503(_0x2f5ba7);})[_0x4534('0x15')](function(_0x34f291){logger[_0x4534('0xf')]('UpdateOpenchannelQueueReport',_0x34f291[_0x4534('0x12')],_0xca0daf);_0x24af1a(_0x200fc0[_0x4534('0xf')](0x1f4,_0x34f291[_0x4534('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 150ae7c..068b9c7 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 _0x5ab2=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xec3ae2,_0x51873d){var _0x134fa1=function(_0xef5060){while(--_0xef5060){_0xec3ae2['push'](_0xec3ae2['shift']());}};_0x134fa1(++_0x51873d);}(_0x5ab2,0xc0));var _0x25ab=function(_0x343c91,_0x19a2d9){_0x343c91=_0x343c91-0x0;var _0x10c40e=_0x5ab2[_0x343c91];return _0x10c40e;};'use strict';var multer=require(_0x25ab('0x0'));var util=require(_0x25ab('0x1'));var path=require('path');var timeout=require(_0x25ab('0x2'));var express=require('express');var router=express[_0x25ab('0x3')]();var auth=require(_0x25ab('0x4'));var interaction=require(_0x25ab('0x5'));var config=require(_0x25ab('0x6'));var controller=require(_0x25ab('0x7'));router[_0x25ab('0x8')]('/',auth[_0x25ab('0x9')](),controller[_0x25ab('0xa')]);router[_0x25ab('0x8')]('/describe',auth[_0x25ab('0x9')](),controller['describe']);router[_0x25ab('0x8')](_0x25ab('0xb'),auth[_0x25ab('0x9')](),controller[_0x25ab('0xc')]);router[_0x25ab('0xd')]('/',auth[_0x25ab('0x9')](),controller['create']);router[_0x25ab('0xe')](_0x25ab('0xb'),auth[_0x25ab('0x9')](),controller['update']);router[_0x25ab('0xf')](_0x25ab('0xb'),auth[_0x25ab('0x9')](),controller[_0x25ab('0x10')]);module[_0x25ab('0x11')]=router; \ No newline at end of file +var _0x890f=['destroy','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','show','create','/:id','update'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0x890f,0x1a1));var _0xf890=function(_0x558e1e,_0x3fd803){_0x558e1e=_0x558e1e-0x0;var _0x5ba193=_0x890f[_0x558e1e];return _0x5ba193;};'use strict';var multer=require('multer');var util=require(_0xf890('0x0'));var path=require(_0xf890('0x1'));var timeout=require('connect-timeout');var express=require(_0xf890('0x2'));var router=express['Router']();var auth=require(_0xf890('0x3'));var interaction=require(_0xf890('0x4'));var config=require(_0xf890('0x5'));var controller=require(_0xf890('0x6'));router[_0xf890('0x7')]('/',auth[_0xf890('0x8')](),controller[_0xf890('0x9')]);router[_0xf890('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xf890('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf890('0xb')]);router['post']('/',auth[_0xf890('0x8')](),controller[_0xf890('0xc')]);router['put'](_0xf890('0xd'),auth[_0xf890('0x8')](),controller[_0xf890('0xe')]);router['delete'](_0xf890('0xd'),auth['isAuthenticated'](),controller[_0xf890('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8ba8629..8c937b5 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 _0xd634=['exports','ENUM','queue','DATE','NOW','sequelize'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xd634,0x1cd));var _0x4d63=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0xd634[_0x547456];return _0xc1fd7b;};'use strict';var moment=require('moment');var Sequelize=require(_0x4d63('0x0'));module[_0x4d63('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4d63('0x2')]('account','agent',_0x4d63('0x3')),'allowNull':![],'defaultValue':_0x4d63('0x3')},'transferredAt':{'type':Sequelize[_0x4d63('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x4d63('0x5')]}}; \ No newline at end of file +var _0xbe27=['DATE','NOW','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x255f99,_0x690858){var _0x98c254=function(_0x81f48e){while(--_0x81f48e){_0x255f99['push'](_0x255f99['shift']());}};_0x98c254(++_0x690858);}(_0xbe27,0x65));var _0x7be2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbe27[_0x1facfa];return _0x9ec701;};'use strict';var moment=require('moment');var Sequelize=require(_0x7be2('0x0'));module[_0x7be2('0x1')]={'uniqueid':{'type':Sequelize[_0x7be2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7be2('0x3')](_0x7be2('0x4'),_0x7be2('0x5'),_0x7be2('0x6')),'allowNull':![],'defaultValue':_0x7be2('0x6')},'transferredAt':{'type':Sequelize[_0x7be2('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x7be2('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 53ab4f8..889fb12 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 _0x00bb=['moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','count','offset','limit','set','json','reject','update','then','error','stack','name','send','OpenchannelTransferReport','rawAttributes','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','options','includeAll','include','catch','show','params','keys','length','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x2f441b,_0x22a6b8){var _0x5b1738=function(_0x3722d1){while(--_0x3722d1){_0x2f441b['push'](_0x2f441b['shift']());}};_0x5b1738(++_0x22a6b8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x00bb[_0x4fc9e6];return _0x551d28;};'use strict';var pdf=require(_0xb00b('0x0'));var emlformat=require(_0xb00b('0x1'));var rimraf=require(_0xb00b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb00b('0x3'));var rp=require('request-promise');var moment=require(_0xb00b('0x4'));var BPromise=require(_0xb00b('0x5'));var Mustache=require('mustache');var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xb00b('0xe'));var hardwareService=require(_0xb00b('0xf'));var Redis=require(_0xb00b('0x10'));var qs=require(_0xb00b('0x11'));var logger=require(_0xb00b('0x12'))('api');var utils=require(_0xb00b('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x594075,_0x4ff792){_0x4ff792=_0x4ff792||0xcc;return function(_0x2d8ddf){if(_0x2d8ddf){return _0x594075[_0xb00b('0x14')](_0x4ff792);}return _0x594075[_0xb00b('0x15')](_0x4ff792)[_0xb00b('0x16')]();};}function respondWithResult(_0x1f1c1d,_0x4ada81){_0x4ada81=_0x4ada81||0xc8;return function(_0x218de2){if(_0x218de2){return _0x1f1c1d[_0xb00b('0x15')](_0x4ada81)['json'](_0x218de2);}};}function respondWithFilteredResult(_0x88d95e,_0x1084a6){return function(_0x540b79){if(_0x540b79){var _0x5da36b=_0x540b79[_0xb00b('0x17')],_0x9b471e=_0x1084a6[_0xb00b('0x18')],_0x4dcd45=_0x1084a6[_0xb00b('0x18')]+_0x1084a6[_0xb00b('0x19')],_0x51d136;if(_0x4dcd45>=_0x5da36b){_0x4dcd45=_0x5da36b;_0x51d136=0xc8;}else{_0x51d136=0xce;}_0x88d95e['status'](_0x51d136);return _0x88d95e[_0xb00b('0x1a')]('Content-Range',_0x9b471e+'-'+_0x4dcd45+'/'+_0x5da36b)[_0xb00b('0x1b')](_0x540b79);}return null;};}function patchUpdates(_0x5aa9a0){return function(_0x25d7a0){try{jsonpatch['apply'](_0x25d7a0,_0x5aa9a0,!![]);}catch(_0xb26ebb){return BPromise[_0xb00b('0x1c')](_0xb26ebb);}return _0x25d7a0['save']();};}function saveUpdates(_0x55770c,_0x2b0da1){return function(_0x4a334b){if(_0x4a334b){return _0x4a334b[_0xb00b('0x1d')](_0x55770c)[_0xb00b('0x1e')](function(_0x2fe48d){return _0x2fe48d;});}return null;};}function removeEntity(_0x3501af,_0x56c189){return function(_0x362ee0){if(_0x362ee0){return _0x362ee0['destroy']()[_0xb00b('0x1e')](function(){_0x3501af[_0xb00b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x231293,_0x2896d1){return function(_0x520444){if(!_0x520444){_0x231293[_0xb00b('0x14')](0x194);}return _0x520444;};}function handleError(_0x1f04d3,_0x5568bb){_0x5568bb=_0x5568bb||0x1f4;return function(_0x44efe5){logger[_0xb00b('0x1f')](_0x44efe5[_0xb00b('0x20')]);if(_0x44efe5[_0xb00b('0x21')]){delete _0x44efe5['name'];}_0x1f04d3['status'](_0x5568bb)[_0xb00b('0x22')](_0x44efe5);};}exports['index']=function(_0x550587,_0x4a635e){var _0x16ac55={},_0x73b6b0={},_0x2592cf={'count':0x0,'rows':[]};var _0x3825af=db[_0xb00b('0x23')][_0xb00b('0x24')];_0x73b6b0[_0xb00b('0x25')]=_['keys'](_0x3825af);_0x73b6b0[_0xb00b('0x26')]=_['keys'](_0x550587[_0xb00b('0x26')]);_0x73b6b0[_0xb00b('0x27')]=_[_0xb00b('0x28')](_0x73b6b0['model'],_0x73b6b0[_0xb00b('0x26')]);_0x16ac55[_0xb00b('0x29')]=_[_0xb00b('0x28')](_0x73b6b0[_0xb00b('0x25')],qs[_0xb00b('0x2a')](_0x550587[_0xb00b('0x26')][_0xb00b('0x2a')]));_0x16ac55[_0xb00b('0x29')]=_0x16ac55[_0xb00b('0x29')]['length']?_0x16ac55[_0xb00b('0x29')]:_0x73b6b0[_0xb00b('0x25')];if(!_0x550587['query'][_0xb00b('0x2b')](_0xb00b('0x2c'))){_0x16ac55['limit']=qs[_0xb00b('0x19')](_0x550587['query'][_0xb00b('0x19')]);_0x16ac55[_0xb00b('0x18')]=qs[_0xb00b('0x18')](_0x550587[_0xb00b('0x26')][_0xb00b('0x18')]);}_0x16ac55[_0xb00b('0x2d')]=qs[_0xb00b('0x2e')](_0x550587['query']['sort']);_0x16ac55['where']=qs[_0xb00b('0x27')](_[_0xb00b('0x2f')](_0x550587[_0xb00b('0x26')],_0x73b6b0[_0xb00b('0x27')]));if(_0x550587['query'][_0xb00b('0x30')]){_0x16ac55[_0xb00b('0x31')]=_[_0xb00b('0x32')](_0x16ac55[_0xb00b('0x31')],{'$or':_[_0xb00b('0x33')](_0x3825af,function(_0x39da49){if(_0x39da49[_0xb00b('0x34')][_0xb00b('0x35')]!=='VIRTUAL'){var _0x55451e={};_0x55451e[_0x39da49[_0xb00b('0x36')]]={'$like':'%'+_0x550587['query'][_0xb00b('0x30')]+'%'};return _0x55451e;}})});}_0x16ac55=_[_0xb00b('0x32')]({},_0x16ac55,_0x550587[_0xb00b('0x37')]);var _0x45ca74={'where':_0x16ac55[_0xb00b('0x31')]};return db[_0xb00b('0x23')][_0xb00b('0x17')](_0x45ca74)['then'](function(_0x35f1ca){_0x2592cf[_0xb00b('0x17')]=_0x35f1ca;if(_0x550587[_0xb00b('0x26')][_0xb00b('0x38')]){_0x16ac55[_0xb00b('0x39')]=[{'all':!![]}];}return db[_0xb00b('0x23')]['findAll'](_0x16ac55);})[_0xb00b('0x1e')](function(_0x3beb8f){_0x2592cf['rows']=_0x3beb8f;return _0x2592cf;})[_0xb00b('0x1e')](respondWithFilteredResult(_0x4a635e,_0x16ac55))[_0xb00b('0x3a')](handleError(_0x4a635e,null));};exports[_0xb00b('0x3b')]=function(_0x2d8620,_0x2954e8){var _0x5636b1={'raw':!![],'where':{'id':_0x2d8620[_0xb00b('0x3c')]['id']}},_0x14ff6a={};_0x14ff6a[_0xb00b('0x25')]=_[_0xb00b('0x3d')](db['OpenchannelTransferReport']['rawAttributes']);_0x14ff6a[_0xb00b('0x26')]=_[_0xb00b('0x3d')](_0x2d8620[_0xb00b('0x26')]);_0x14ff6a[_0xb00b('0x27')]=_[_0xb00b('0x28')](_0x14ff6a[_0xb00b('0x25')],_0x14ff6a[_0xb00b('0x26')]);_0x5636b1['attributes']=_[_0xb00b('0x28')](_0x14ff6a[_0xb00b('0x25')],qs[_0xb00b('0x2a')](_0x2d8620[_0xb00b('0x26')][_0xb00b('0x2a')]));_0x5636b1[_0xb00b('0x29')]=_0x5636b1[_0xb00b('0x29')][_0xb00b('0x3e')]?_0x5636b1[_0xb00b('0x29')]:_0x14ff6a[_0xb00b('0x25')];if(_0x2d8620[_0xb00b('0x26')][_0xb00b('0x38')]){_0x5636b1['include']=[{'all':!![]}];}_0x5636b1=_[_0xb00b('0x32')]({},_0x5636b1,_0x2d8620[_0xb00b('0x37')]);return db[_0xb00b('0x23')][_0xb00b('0x3f')](_0x5636b1)[_0xb00b('0x1e')](handleEntityNotFound(_0x2954e8,null))[_0xb00b('0x1e')](respondWithResult(_0x2954e8,null))[_0xb00b('0x3a')](handleError(_0x2954e8,null));};exports[_0xb00b('0x40')]=function(_0x10ba60,_0x103320){return db[_0xb00b('0x23')][_0xb00b('0x40')](_0x10ba60['body'],{})['then'](respondWithResult(_0x103320,0xc9))['catch'](handleError(_0x103320,null));};exports[_0xb00b('0x1d')]=function(_0x23d858,_0x481154){if(_0x23d858[_0xb00b('0x41')]['id']){delete _0x23d858[_0xb00b('0x41')]['id'];}return db[_0xb00b('0x23')][_0xb00b('0x3f')]({'where':{'id':_0x23d858['params']['id']}})['then'](handleEntityNotFound(_0x481154,null))[_0xb00b('0x1e')](saveUpdates(_0x23d858[_0xb00b('0x41')],null))['then'](respondWithResult(_0x481154,null))['catch'](handleError(_0x481154,null));};exports[_0xb00b('0x42')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x23')]['find']({'where':{'id':_0x3a205d['params']['id']}})['then'](handleEntityNotFound(_0x4e0be4,null))[_0xb00b('0x1e')](removeEntity(_0x4e0be4,null))['catch'](handleError(_0x4e0be4,null));};exports[_0xb00b('0x43')]=function(_0x3178aa,_0x4b6482){return db[_0xb00b('0x23')][_0xb00b('0x43')]()[_0xb00b('0x1e')](respondWithResult(_0x4b6482,null))['catch'](handleError(_0x4b6482,null));}; \ No newline at end of file +var _0x032e=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','map','key','VIRTUAL','field','filter','options','includeAll','rows','catch','params','include','find','create','body','describe','html-pdf','rimraf','zip-dir','moment'];(function(_0x46254d,_0x455829){var _0x3442c4=function(_0x57499e){while(--_0x57499e){_0x46254d['push'](_0x46254d['shift']());}};_0x3442c4(++_0x455829);}(_0x032e,0x124));var _0xe032=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x032e[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0xe032('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe032('0x1'));var zipdir=require(_0xe032('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe032('0x3'));var BPromise=require(_0xe032('0x4'));var Mustache=require(_0xe032('0x5'));var util=require(_0xe032('0x6'));var path=require(_0xe032('0x7'));var sox=require(_0xe032('0x8'));var csv=require(_0xe032('0x9'));var ejs=require(_0xe032('0xa'));var fs=require('fs');var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x9'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var authService=require(_0xe032('0x12'));var hardwareService=require(_0xe032('0x13'));var Redis=require('ioredis');var qs=require(_0xe032('0x14'));var logger=require(_0xe032('0x15'))(_0xe032('0x16'));var utils=require(_0xe032('0x17'));var config=require(_0xe032('0x18'));var db=require(_0xe032('0x19'))['db'];function respondWithStatusCode(_0x2194fc,_0x5bcb5b){_0x5bcb5b=_0x5bcb5b||0xcc;return function(_0x646979){if(_0x646979){return _0x2194fc[_0xe032('0x1a')](_0x5bcb5b);}return _0x2194fc[_0xe032('0x1b')](_0x5bcb5b)[_0xe032('0x1c')]();};}function respondWithResult(_0x4aee44,_0x311592){_0x311592=_0x311592||0xc8;return function(_0x2e267b){if(_0x2e267b){return _0x4aee44[_0xe032('0x1b')](_0x311592)[_0xe032('0x1d')](_0x2e267b);}};}function respondWithFilteredResult(_0x17b3aa,_0x3d92cb){return function(_0x2bf528){if(_0x2bf528){var _0x4da5b7=_0x2bf528[_0xe032('0x1e')],_0x231c35=_0x3d92cb[_0xe032('0x1f')],_0x749018=_0x3d92cb[_0xe032('0x1f')]+_0x3d92cb['limit'],_0x36fb7c;if(_0x749018>=_0x4da5b7){_0x749018=_0x4da5b7;_0x36fb7c=0xc8;}else{_0x36fb7c=0xce;}_0x17b3aa[_0xe032('0x1b')](_0x36fb7c);return _0x17b3aa[_0xe032('0x20')](_0xe032('0x21'),_0x231c35+'-'+_0x749018+'/'+_0x4da5b7)[_0xe032('0x1d')](_0x2bf528);}return null;};}function patchUpdates(_0x208c47){return function(_0x5721ce){try{jsonpatch['apply'](_0x5721ce,_0x208c47,!![]);}catch(_0x484e6c){return BPromise[_0xe032('0x22')](_0x484e6c);}return _0x5721ce['save']();};}function saveUpdates(_0x46dc27,_0x4608e4){return function(_0x3f0257){if(_0x3f0257){return _0x3f0257[_0xe032('0x23')](_0x46dc27)[_0xe032('0x24')](function(_0x256f71){return _0x256f71;});}return null;};}function removeEntity(_0x136f5d,_0x5a7b53){return function(_0x32f8b6){if(_0x32f8b6){return _0x32f8b6[_0xe032('0x25')]()[_0xe032('0x24')](function(){_0x136f5d[_0xe032('0x1b')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x33d89a,_0x22831a){return function(_0xe89aa7){if(!_0xe89aa7){_0x33d89a['sendStatus'](0x194);}return _0xe89aa7;};}function handleError(_0x4f1aa3,_0x4d8ded){_0x4d8ded=_0x4d8ded||0x1f4;return function(_0x4ef536){logger[_0xe032('0x26')](_0x4ef536[_0xe032('0x27')]);if(_0x4ef536[_0xe032('0x28')]){delete _0x4ef536[_0xe032('0x28')];}_0x4f1aa3[_0xe032('0x1b')](_0x4d8ded)[_0xe032('0x29')](_0x4ef536);};}exports[_0xe032('0x2a')]=function(_0x4dcbf1,_0x1ac20b){var _0x5bb36a={},_0x189ed4={},_0x1af097={'count':0x0,'rows':[]};var _0x3106aa=db[_0xe032('0x2b')]['rawAttributes'];_0x189ed4['model']=_[_0xe032('0x2c')](_0x3106aa);_0x189ed4[_0xe032('0x2d')]=_[_0xe032('0x2c')](_0x4dcbf1[_0xe032('0x2d')]);_0x189ed4['filters']=_['intersection'](_0x189ed4['model'],_0x189ed4[_0xe032('0x2d')]);_0x5bb36a[_0xe032('0x2e')]=_[_0xe032('0x2f')](_0x189ed4[_0xe032('0x30')],qs['fields'](_0x4dcbf1[_0xe032('0x2d')][_0xe032('0x31')]));_0x5bb36a[_0xe032('0x2e')]=_0x5bb36a[_0xe032('0x2e')][_0xe032('0x32')]?_0x5bb36a['attributes']:_0x189ed4[_0xe032('0x30')];if(!_0x4dcbf1[_0xe032('0x2d')][_0xe032('0x33')](_0xe032('0x34'))){_0x5bb36a['limit']=qs[_0xe032('0x35')](_0x4dcbf1['query'][_0xe032('0x35')]);_0x5bb36a['offset']=qs[_0xe032('0x1f')](_0x4dcbf1['query'][_0xe032('0x1f')]);}_0x5bb36a['order']=qs[_0xe032('0x36')](_0x4dcbf1[_0xe032('0x2d')]['sort']);_0x5bb36a[_0xe032('0x37')]=qs[_0xe032('0x38')](_[_0xe032('0x39')](_0x4dcbf1[_0xe032('0x2d')],_0x189ed4['filters']));if(_0x4dcbf1[_0xe032('0x2d')]['filter']){_0x5bb36a[_0xe032('0x37')]=_[_0xe032('0x3a')](_0x5bb36a['where'],{'$or':_[_0xe032('0x3b')](_0x3106aa,function(_0x23b790){if(_0x23b790['type'][_0xe032('0x3c')]!==_0xe032('0x3d')){var _0x3cc437={};_0x3cc437[_0x23b790[_0xe032('0x3e')]]={'$like':'%'+_0x4dcbf1[_0xe032('0x2d')][_0xe032('0x3f')]+'%'};return _0x3cc437;}})});}_0x5bb36a=_[_0xe032('0x3a')]({},_0x5bb36a,_0x4dcbf1[_0xe032('0x40')]);var _0x22651f={'where':_0x5bb36a[_0xe032('0x37')]};return db[_0xe032('0x2b')][_0xe032('0x1e')](_0x22651f)[_0xe032('0x24')](function(_0x28ba5d){_0x1af097[_0xe032('0x1e')]=_0x28ba5d;if(_0x4dcbf1[_0xe032('0x2d')][_0xe032('0x41')]){_0x5bb36a['include']=[{'all':!![]}];}return db[_0xe032('0x2b')]['findAll'](_0x5bb36a);})[_0xe032('0x24')](function(_0x2bcfb4){_0x1af097[_0xe032('0x42')]=_0x2bcfb4;return _0x1af097;})[_0xe032('0x24')](respondWithFilteredResult(_0x1ac20b,_0x5bb36a))[_0xe032('0x43')](handleError(_0x1ac20b,null));};exports['show']=function(_0x132d25,_0x55688b){var _0x46ea84={'raw':!![],'where':{'id':_0x132d25[_0xe032('0x44')]['id']}},_0x590be2={};_0x590be2[_0xe032('0x30')]=_[_0xe032('0x2c')](db[_0xe032('0x2b')]['rawAttributes']);_0x590be2[_0xe032('0x2d')]=_['keys'](_0x132d25[_0xe032('0x2d')]);_0x590be2[_0xe032('0x38')]=_[_0xe032('0x2f')](_0x590be2[_0xe032('0x30')],_0x590be2['query']);_0x46ea84['attributes']=_[_0xe032('0x2f')](_0x590be2[_0xe032('0x30')],qs['fields'](_0x132d25[_0xe032('0x2d')][_0xe032('0x31')]));_0x46ea84[_0xe032('0x2e')]=_0x46ea84[_0xe032('0x2e')][_0xe032('0x32')]?_0x46ea84['attributes']:_0x590be2[_0xe032('0x30')];if(_0x132d25[_0xe032('0x2d')][_0xe032('0x41')]){_0x46ea84[_0xe032('0x45')]=[{'all':!![]}];}_0x46ea84=_[_0xe032('0x3a')]({},_0x46ea84,_0x132d25[_0xe032('0x40')]);return db[_0xe032('0x2b')][_0xe032('0x46')](_0x46ea84)['then'](handleEntityNotFound(_0x55688b,null))['then'](respondWithResult(_0x55688b,null))[_0xe032('0x43')](handleError(_0x55688b,null));};exports['create']=function(_0x30b1a9,_0x277207){return db[_0xe032('0x2b')][_0xe032('0x47')](_0x30b1a9[_0xe032('0x48')],{})[_0xe032('0x24')](respondWithResult(_0x277207,0xc9))[_0xe032('0x43')](handleError(_0x277207,null));};exports[_0xe032('0x23')]=function(_0x26206e,_0x5a4a19){if(_0x26206e[_0xe032('0x48')]['id']){delete _0x26206e['body']['id'];}return db['OpenchannelTransferReport'][_0xe032('0x46')]({'where':{'id':_0x26206e[_0xe032('0x44')]['id']}})[_0xe032('0x24')](handleEntityNotFound(_0x5a4a19,null))[_0xe032('0x24')](saveUpdates(_0x26206e['body'],null))[_0xe032('0x24')](respondWithResult(_0x5a4a19,null))[_0xe032('0x43')](handleError(_0x5a4a19,null));};exports[_0xe032('0x25')]=function(_0x39ffb7,_0x1b3172){return db[_0xe032('0x2b')][_0xe032('0x46')]({'where':{'id':_0x39ffb7['params']['id']}})[_0xe032('0x24')](handleEntityNotFound(_0x1b3172,null))[_0xe032('0x24')](removeEntity(_0x1b3172,null))['catch'](handleError(_0x1b3172,null));};exports[_0xe032('0x49')]=function(_0x421d04,_0x15b27f){return db[_0xe032('0x2b')][_0xe032('0x49')]()[_0xe032('0x24')](respondWithResult(_0x15b27f,null))[_0xe032('0x43')](handleError(_0x15b27f,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 949814d..9aaa546 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 _0x7a54=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','./openchannelTransferReport.attributes','exports','define'];(function(_0x16c087,_0x42715d){var _0xd56012=function(_0x4df29c){while(--_0x4df29c){_0x16c087['push'](_0x16c087['shift']());}};_0xd56012(++_0x42715d);}(_0x7a54,0x106));var _0x47a5=function(_0x51e06a,_0x4ad058){_0x51e06a=_0x51e06a-0x0;var _0x32056e=_0x7a54[_0x51e06a];return _0x32056e;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['bluebird','request-promise','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2bee61,_0x4d0a8b){var _0x401764=function(_0x2656bc){while(--_0x2656bc){_0x2bee61['push'](_0x2bee61['shift']());}};_0x401764(++_0x4d0a8b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2e273e,_0x4e2328){_0x2e273e=_0x2e273e-0x0;var _0x155c8a=_0x5f2f[_0x2e273e];return _0x155c8a;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var attributes=require(_0xf5f2('0x7'));module['exports']=function(_0x4854b6,_0x1665c7){return _0x4854b6[_0xf5f2('0x8')](_0xf5f2('0x9'),attributes,{'tableName':_0xf5f2('0xa'),'paranoid':![],'indexes':[{'name':_0xf5f2('0xb'),'fields':[_0xf5f2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4beceaf..cebf0a9 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 _0x13bb=['jayson/promise','http','request','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x41bb55,_0x4c3152){var _0x594771=function(_0x29bfe1){while(--_0x29bfe1){_0x41bb55['push'](_0x41bb55['shift']());}};_0x594771(++_0x4c3152);}(_0x13bb,0x19b));var _0xb13b=function(_0x118ab8,_0x37d745){_0x118ab8=_0x118ab8-0x0;var _0x1c73b7=_0x13bb[_0x118ab8];return _0x1c73b7;};'use strict';var _=require('lodash');var util=require(_0xb13b('0x0'));var moment=require(_0xb13b('0x1'));var BPromise=require(_0xb13b('0x2'));var rs=require(_0xb13b('0x3'));var fs=require('fs');var Redis=require(_0xb13b('0x4'));var db=require(_0xb13b('0x5'))['db'];var utils=require(_0xb13b('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb13b('0x7'));var client=jayson['client'][_0xb13b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27eca3,_0x44a830,_0xc4f467){return new BPromise(function(_0x62107d,_0x22d913){return client[_0xb13b('0x9')](_0x27eca3,_0xc4f467)['then'](function(_0x28b114){logger['info'](_0xb13b('0xa'),_0x44a830,'request\x20sent');logger['debug'](_0xb13b('0xb'),_0x44a830,'request\x20sent',JSON[_0xb13b('0xc')](_0x28b114));if(_0x28b114[_0xb13b('0xd')]){if(_0x28b114[_0xb13b('0xd')][_0xb13b('0xe')]===0x1f4){logger[_0xb13b('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x44a830,_0x28b114[_0xb13b('0xd')]['message']);return _0x22d913(_0x28b114[_0xb13b('0xd')]['message']);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x44a830,_0x28b114['error'][_0xb13b('0xf')]);return _0x62107d(_0x28b114['error'][_0xb13b('0xf')]);}else{logger[_0xb13b('0x10')](_0xb13b('0xa'),_0x44a830,'request\x20sent');_0x62107d(_0x28b114[_0xb13b('0x11')][_0xb13b('0xf')]);}})[_0xb13b('0x12')](function(_0x2ada1f){logger['error'](_0xb13b('0xa'),_0x44a830,_0x2ada1f);_0x22d913(_0x2ada1f);});});} \ No newline at end of file +var _0x7a7c=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x1a86e9,_0x57a2a1){var _0x40ebfc=function(_0x503619){while(--_0x503619){_0x1a86e9['push'](_0x1a86e9['shift']());}};_0x40ebfc(++_0x57a2a1);}(_0x7a7c,0x170));var _0xc7a7=function(_0x5cc661,_0x190ce2){_0x5cc661=_0x5cc661-0x0;var _0xb001e1=_0x7a7c[_0x5cc661];return _0xb001e1;};'use strict';var _=require(_0xc7a7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc7a7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7a7('0x2'))['db'];var utils=require(_0xc7a7('0x3'));var logger=require(_0xc7a7('0x4'))(_0xc7a7('0x5'));var config=require(_0xc7a7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc7a7('0x7')][_0xc7a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4587c2,_0x104174,_0x3ea1f7){return new BPromise(function(_0x4ce996,_0x190fa3){return client[_0xc7a7('0x9')](_0x4587c2,_0x3ea1f7)['then'](function(_0x42daa6){logger[_0xc7a7('0xa')](_0xc7a7('0xb'),_0x104174,_0xc7a7('0xc'));logger[_0xc7a7('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x104174,_0xc7a7('0xc'),JSON[_0xc7a7('0xe')](_0x42daa6));if(_0x42daa6[_0xc7a7('0xf')]){if(_0x42daa6[_0xc7a7('0xf')][_0xc7a7('0x10')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x104174,_0x42daa6[_0xc7a7('0xf')]['message']);return _0x190fa3(_0x42daa6[_0xc7a7('0xf')][_0xc7a7('0x11')]);}logger[_0xc7a7('0xf')](_0xc7a7('0xb'),_0x104174,_0x42daa6['error']['message']);return _0x4ce996(_0x42daa6[_0xc7a7('0xf')][_0xc7a7('0x11')]);}else{logger[_0xc7a7('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x104174,'request\x20sent');_0x4ce996(_0x42daa6[_0xc7a7('0x12')][_0xc7a7('0x11')]);}})[_0xc7a7('0x13')](function(_0x381b78){logger[_0xc7a7('0xf')](_0xc7a7('0xb'),_0x104174,_0x381b78);_0x190fa3(_0x381b78);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2f9ffd9..d3f028a 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 _0x4b6c=['show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id'];(function(_0x3ea5b7,_0x3e2a74){var _0x3c6aa6=function(_0x350713){while(--_0x350713){_0x3ea5b7['push'](_0x3ea5b7['shift']());}};_0x3c6aa6(++_0x3e2a74);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc4b6('0x0'));var util=require(_0xc4b6('0x1'));var path=require('path');var timeout=require(_0xc4b6('0x2'));var express=require(_0xc4b6('0x3'));var router=express[_0xc4b6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc4b6('0x5'));var config=require(_0xc4b6('0x6'));var controller=require(_0xc4b6('0x7'));router['get']('/',auth[_0xc4b6('0x8')](),controller[_0xc4b6('0x9')]);router[_0xc4b6('0xa')](_0xc4b6('0xb'),auth['isAuthenticated'](),controller[_0xc4b6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc4b6('0xd')]);router[_0xc4b6('0xe')](_0xc4b6('0xb'),auth[_0xc4b6('0x8')](),controller[_0xc4b6('0xf')]);router[_0xc4b6('0x10')]('/:id',auth[_0xc4b6('0x8')](),controller[_0xc4b6('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3ce4=['../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','multer','path','express','Router','../../components/auth/service'];(function(_0x15d79b,_0x4a05c0){var _0xc787e5=function(_0x33ec21){while(--_0x33ec21){_0x15d79b['push'](_0x15d79b['shift']());}};_0xc787e5(++_0x4a05c0);}(_0x3ce4,0xcb));var _0x43ce=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x3ce4[_0x556bb1];return _0x45455f;};'use strict';var multer=require(_0x43ce('0x0'));var util=require('util');var path=require(_0x43ce('0x1'));var timeout=require('connect-timeout');var express=require(_0x43ce('0x2'));var router=express[_0x43ce('0x3')]();var auth=require(_0x43ce('0x4'));var interaction=require(_0x43ce('0x5'));var config=require(_0x43ce('0x6'));var controller=require('./pause.controller');router[_0x43ce('0x7')]('/',auth[_0x43ce('0x8')](),controller['index']);router[_0x43ce('0x7')]('/:id',auth[_0x43ce('0x8')](),controller[_0x43ce('0x9')]);router[_0x43ce('0xa')]('/',auth[_0x43ce('0x8')](),controller['create']);router[_0x43ce('0xb')](_0x43ce('0xc'),auth[_0x43ce('0x8')](),controller[_0x43ce('0xd')]);router[_0x43ce('0xe')](_0x43ce('0xc'),auth[_0x43ce('0x8')](),controller[_0x43ce('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 4254c61..e342126 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 _0xe8cf=['STRING','name','exports'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0xe8cf,0xa7));var _0xfe8c=function(_0x34edc6,_0x4a0b01){_0x34edc6=_0x34edc6-0x0;var _0x5788b1=_0xe8cf[_0x34edc6];return _0x5788b1;};'use strict';var Sequelize=require('sequelize');module[_0xfe8c('0x0')]={'name':{'type':Sequelize[_0xfe8c('0x1')],'unique':_0xfe8c('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x797e=['STRING','exports','name'];(function(_0x55f3ec,_0x1d947b){var _0x338075=function(_0x2ce4cc){while(--_0x2ce4cc){_0x55f3ec['push'](_0x55f3ec['shift']());}};_0x338075(++_0x1d947b);}(_0x797e,0x8b));var _0xe797=function(_0x4fc64d,_0x4b75d6){_0x4fc64d=_0x4fc64d-0x0;var _0x2cb388=_0x797e[_0x4fc64d];return _0x2cb388;};'use strict';var Sequelize=require('sequelize');module[_0xe797('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe797('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xe797('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index b27962e..f607bf5 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 _0x5b66=['eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','Pause','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','params','rawAttributes','find','role','user','Pauses','UserProfileSection','userProfileId','autoAssociation','html-pdf'];(function(_0x354df6,_0x4fb714){var _0x3b8676=function(_0x5a0296){while(--_0x5a0296){_0x354df6['push'](_0x354df6['shift']());}};_0x3b8676(++_0x4fb714);}(_0x5b66,0x1d3));var _0x65b6=function(_0x30f5b3,_0x47af5b){_0x30f5b3=_0x30f5b3-0x0;var _0x2832e4=_0x5b66[_0x30f5b3];return _0x2832e4;};'use strict';var pdf=require(_0x65b6('0x0'));var emlformat=require(_0x65b6('0x1'));var rimraf=require(_0x65b6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x65b6('0x3'));var moment=require(_0x65b6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65b6('0x5'));var util=require(_0x65b6('0x6'));var path=require(_0x65b6('0x7'));var sox=require(_0x65b6('0x8'));var csv=require('to-csv');var ejs=require(_0x65b6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x65b6('0xa'));var jsforce=require(_0x65b6('0xb'));var deskjs=require(_0x65b6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x65b6('0xd'));var Papa=require(_0x65b6('0xe'));var authService=require(_0x65b6('0xf'));var hardwareService=require(_0x65b6('0x10'));var Redis=require('ioredis');var qs=require(_0x65b6('0x11'));var logger=require(_0x65b6('0x12'))(_0x65b6('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65b6('0x14'))['db'];function respondWithStatusCode(_0x16a492,_0x571c76){_0x571c76=_0x571c76||0xcc;return function(_0x58a3f9){if(_0x58a3f9){return _0x16a492['sendStatus'](_0x571c76);}return _0x16a492[_0x65b6('0x15')](_0x571c76)[_0x65b6('0x16')]();};}function respondWithResult(_0x4164d8,_0x4c84a8){_0x4c84a8=_0x4c84a8||0xc8;return function(_0x55342e){if(_0x55342e){return _0x4164d8[_0x65b6('0x15')](_0x4c84a8)[_0x65b6('0x17')](_0x55342e);}};}function respondWithFilteredResult(_0x237641,_0xe9eaf7){return function(_0x5f3fd0){if(_0x5f3fd0){var _0x51a9f9=_0x5f3fd0['count'],_0x540360=_0xe9eaf7[_0x65b6('0x18')],_0x20df2b=_0xe9eaf7[_0x65b6('0x18')]+_0xe9eaf7[_0x65b6('0x19')],_0x2fa8dd;if(_0x20df2b>=_0x51a9f9){_0x20df2b=_0x51a9f9;_0x2fa8dd=0xc8;}else{_0x2fa8dd=0xce;}_0x237641[_0x65b6('0x15')](_0x2fa8dd);return _0x237641[_0x65b6('0x1a')](_0x65b6('0x1b'),_0x540360+'-'+_0x20df2b+'/'+_0x51a9f9)[_0x65b6('0x17')](_0x5f3fd0);}return null;};}function patchUpdates(_0x4a611d){return function(_0x5cf5bf){try{jsonpatch['apply'](_0x5cf5bf,_0x4a611d,!![]);}catch(_0x17fea0){return BPromise[_0x65b6('0x1c')](_0x17fea0);}return _0x5cf5bf[_0x65b6('0x1d')]();};}function saveUpdates(_0x19b3df,_0x476cf9){return function(_0x502f1f){if(_0x502f1f){return _0x502f1f[_0x65b6('0x1e')](_0x19b3df)[_0x65b6('0x1f')](function(_0x7c2183){return _0x7c2183;});}return null;};}function removeEntity(_0x3f3c58,_0x521bf2){return function(_0x10e848){if(_0x10e848){return _0x10e848[_0x65b6('0x20')]()[_0x65b6('0x1f')](function(){var _0x282ba2=_0x10e848[_0x65b6('0x21')]({'plain':!![]});var _0x43c6c0='Pauses';return db[_0x65b6('0x22')][_0x65b6('0x20')]({'where':{'type':_0x43c6c0,'resourceId':_0x282ba2['id']}})['then'](function(){return _0x10e848;});})[_0x65b6('0x1f')](function(){_0x3f3c58[_0x65b6('0x15')](0xcc)[_0x65b6('0x16')]();});}};}function handleEntityNotFound(_0x39a845,_0x4a8fbf){return function(_0xf747a){if(!_0xf747a){_0x39a845[_0x65b6('0x23')](0x194);}return _0xf747a;};}function handleError(_0x297f65,_0x41da9f){_0x41da9f=_0x41da9f||0x1f4;return function(_0x6479db){logger[_0x65b6('0x24')](_0x6479db[_0x65b6('0x25')]);if(_0x6479db[_0x65b6('0x26')]){delete _0x6479db[_0x65b6('0x26')];}_0x297f65[_0x65b6('0x15')](_0x41da9f)[_0x65b6('0x27')](_0x6479db);};}exports[_0x65b6('0x28')]=function(_0x55f306,_0x5243cb){var _0x4c439b={},_0x4bcb78={},_0x3b0d4f={'count':0x0,'rows':[]};var _0x51c2f0=db[_0x65b6('0x29')]['rawAttributes'];_0x4bcb78[_0x65b6('0x2a')]=_[_0x65b6('0x2b')](_0x51c2f0);_0x4bcb78[_0x65b6('0x2c')]=_[_0x65b6('0x2b')](_0x55f306[_0x65b6('0x2c')]);_0x4bcb78[_0x65b6('0x2d')]=_['intersection'](_0x4bcb78[_0x65b6('0x2a')],_0x4bcb78[_0x65b6('0x2c')]);_0x4c439b[_0x65b6('0x2e')]=_[_0x65b6('0x2f')](_0x4bcb78[_0x65b6('0x2a')],qs['fields'](_0x55f306[_0x65b6('0x2c')][_0x65b6('0x30')]));_0x4c439b['attributes']=_0x4c439b['attributes'][_0x65b6('0x31')]?_0x4c439b[_0x65b6('0x2e')]:_0x4bcb78['model'];if(!_0x55f306[_0x65b6('0x2c')][_0x65b6('0x32')](_0x65b6('0x33'))){_0x4c439b[_0x65b6('0x19')]=qs[_0x65b6('0x19')](_0x55f306[_0x65b6('0x2c')][_0x65b6('0x19')]);_0x4c439b[_0x65b6('0x18')]=qs[_0x65b6('0x18')](_0x55f306[_0x65b6('0x2c')]['offset']);}_0x4c439b[_0x65b6('0x34')]=qs[_0x65b6('0x35')](_0x55f306[_0x65b6('0x2c')][_0x65b6('0x35')]);_0x4c439b[_0x65b6('0x36')]=qs[_0x65b6('0x2d')](_['pick'](_0x55f306['query'],_0x4bcb78[_0x65b6('0x2d')]));if(_0x55f306['query'][_0x65b6('0x37')]){_0x4c439b[_0x65b6('0x36')]=_[_0x65b6('0x38')](_0x4c439b[_0x65b6('0x36')],{'$or':_[_0x65b6('0x39')](_0x51c2f0,function(_0x547d85){if(_0x547d85[_0x65b6('0x3a')][_0x65b6('0x3b')]!==_0x65b6('0x3c')){var _0x17a59b={};_0x17a59b[_0x547d85[_0x65b6('0x3d')]]={'$like':'%'+_0x55f306['query'][_0x65b6('0x37')]+'%'};return _0x17a59b;}})});}_0x4c439b=_['merge']({},_0x4c439b,_0x55f306[_0x65b6('0x3e')]);var _0x54d153={'where':_0x4c439b[_0x65b6('0x36')]};return db[_0x65b6('0x29')][_0x65b6('0x3f')](_0x54d153)[_0x65b6('0x1f')](function(_0x57746b){_0x3b0d4f['count']=_0x57746b;if(_0x55f306['query'][_0x65b6('0x40')]){_0x4c439b[_0x65b6('0x41')]=[{'all':!![]}];}return db[_0x65b6('0x29')]['findAll'](_0x4c439b);})[_0x65b6('0x1f')](function(_0x1e62fc){_0x3b0d4f[_0x65b6('0x42')]=_0x1e62fc;return _0x3b0d4f;})['then'](respondWithFilteredResult(_0x5243cb,_0x4c439b))[_0x65b6('0x43')](handleError(_0x5243cb,null));};exports[_0x65b6('0x44')]=function(_0x13c96d,_0x4a0aa8){var _0x9ee184={'raw':!![],'where':{'id':_0x13c96d[_0x65b6('0x45')]['id']}},_0x3bdd6e={};_0x3bdd6e[_0x65b6('0x2a')]=_[_0x65b6('0x2b')](db[_0x65b6('0x29')][_0x65b6('0x46')]);_0x3bdd6e['query']=_[_0x65b6('0x2b')](_0x13c96d[_0x65b6('0x2c')]);_0x3bdd6e['filters']=_[_0x65b6('0x2f')](_0x3bdd6e['model'],_0x3bdd6e[_0x65b6('0x2c')]);_0x9ee184['attributes']=_[_0x65b6('0x2f')](_0x3bdd6e[_0x65b6('0x2a')],qs['fields'](_0x13c96d[_0x65b6('0x2c')]['fields']));_0x9ee184['attributes']=_0x9ee184['attributes'][_0x65b6('0x31')]?_0x9ee184[_0x65b6('0x2e')]:_0x3bdd6e[_0x65b6('0x2a')];if(_0x13c96d[_0x65b6('0x2c')]['includeAll']){_0x9ee184[_0x65b6('0x41')]=[{'all':!![]}];}_0x9ee184=_['merge']({},_0x9ee184,_0x13c96d['options']);return db['Pause'][_0x65b6('0x47')](_0x9ee184)[_0x65b6('0x1f')](handleEntityNotFound(_0x4a0aa8,null))['then'](respondWithResult(_0x4a0aa8,null))[_0x65b6('0x43')](handleError(_0x4a0aa8,null));};exports['create']=function(_0x51d295,_0x51f82c){return db['Pause']['create'](_0x51d295['body'],{})[_0x65b6('0x1f')](function(_0x314c63){var _0x5f0330=_0x51d295['user']['get']({'plain':!![]});if(!_0x5f0330)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f0330[_0x65b6('0x48')]===_0x65b6('0x49')){var _0x1865f7=_0x314c63[_0x65b6('0x21')]({'plain':!![]});var _0x4789b8=_0x65b6('0x4a');return db[_0x65b6('0x4b')]['find']({'where':{'name':_0x4789b8,'userProfileId':_0x5f0330[_0x65b6('0x4c')]},'raw':!![]})[_0x65b6('0x1f')](function(_0x3f8c26){if(_0x3f8c26&&_0x3f8c26[_0x65b6('0x4d')]===0x0){return db[_0x65b6('0x22')]['create']({'name':_0x1865f7['name'],'resourceId':_0x1865f7['id'],'type':_0x3f8c26[_0x65b6('0x26')],'sectionId':_0x3f8c26['id']},{})['then'](function(){return _0x314c63;});}else{return _0x314c63;}})[_0x65b6('0x43')](function(_0xc62282){logger[_0x65b6('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc62282);throw _0xc62282;});}return _0x314c63;})[_0x65b6('0x1f')](respondWithResult(_0x51f82c,0xc9))['catch'](handleError(_0x51f82c,null));};exports[_0x65b6('0x1e')]=function(_0x503b09,_0x6cb28a){if(_0x503b09['body']['id']){delete _0x503b09['body']['id'];}return db[_0x65b6('0x29')]['find']({'where':{'id':_0x503b09[_0x65b6('0x45')]['id']}})['then'](handleEntityNotFound(_0x6cb28a,null))['then'](saveUpdates(_0x503b09['body'],null))[_0x65b6('0x1f')](respondWithResult(_0x6cb28a,null))[_0x65b6('0x43')](handleError(_0x6cb28a,null));};exports['destroy']=function(_0x4117e6,_0x3cb769){return db['Pause'][_0x65b6('0x47')]({'where':{'id':_0x4117e6[_0x65b6('0x45')]['id']}})[_0x65b6('0x1f')](handleEntityNotFound(_0x3cb769,null))[_0x65b6('0x1f')](removeEntity(_0x3cb769,null))['catch'](handleError(_0x3cb769,null));}; \ No newline at end of file +var _0x4357=['options','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','save','update','destroy','then','get','Pauses','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','map','type','key','field'];(function(_0x189f14,_0x3c0f2b){var _0x30c4e5=function(_0x4994e1){while(--_0x4994e1){_0x189f14['push'](_0x189f14['shift']());}};_0x30c4e5(++_0x3c0f2b);}(_0x4357,0x1de));var _0x7435=function(_0x5a03fa,_0xcf3275){_0x5a03fa=_0x5a03fa-0x0;var _0x29e6c2=_0x4357[_0x5a03fa];return _0x29e6c2;};'use strict';var pdf=require(_0x7435('0x0'));var emlformat=require(_0x7435('0x1'));var rimraf=require(_0x7435('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7435('0x3'));var rp=require('request-promise');var moment=require(_0x7435('0x4'));var BPromise=require(_0x7435('0x5'));var Mustache=require(_0x7435('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7435('0x7'));var fs=require('fs');var _=require(_0x7435('0x8'));var squel=require('squel');var crypto=require(_0x7435('0x9'));var jsforce=require(_0x7435('0xa'));var deskjs=require(_0x7435('0xb'));var toCsv=require(_0x7435('0xc'));var querystring=require(_0x7435('0xd'));var Papa=require(_0x7435('0xe'));var authService=require(_0x7435('0xf'));var hardwareService=require(_0x7435('0x10'));var Redis=require(_0x7435('0x11'));var qs=require(_0x7435('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7435('0x13'))['db'];function respondWithStatusCode(_0x450d70,_0x5160f1){_0x5160f1=_0x5160f1||0xcc;return function(_0x4ae139){if(_0x4ae139){return _0x450d70[_0x7435('0x14')](_0x5160f1);}return _0x450d70[_0x7435('0x15')](_0x5160f1)[_0x7435('0x16')]();};}function respondWithResult(_0x51802a,_0x58e49f){_0x58e49f=_0x58e49f||0xc8;return function(_0x32d3f7){if(_0x32d3f7){return _0x51802a['status'](_0x58e49f)['json'](_0x32d3f7);}};}function respondWithFilteredResult(_0x551c4b,_0x285827){return function(_0x2d6ec1){if(_0x2d6ec1){var _0x419f69=_0x2d6ec1[_0x7435('0x17')],_0x539fb3=_0x285827['offset'],_0x20ff9a=_0x285827[_0x7435('0x18')]+_0x285827['limit'],_0x3f17e0;if(_0x20ff9a>=_0x419f69){_0x20ff9a=_0x419f69;_0x3f17e0=0xc8;}else{_0x3f17e0=0xce;}_0x551c4b[_0x7435('0x15')](_0x3f17e0);return _0x551c4b['set'](_0x7435('0x19'),_0x539fb3+'-'+_0x20ff9a+'/'+_0x419f69)[_0x7435('0x1a')](_0x2d6ec1);}return null;};}function patchUpdates(_0x4ee9b2){return function(_0x164c83){try{jsonpatch[_0x7435('0x1b')](_0x164c83,_0x4ee9b2,!![]);}catch(_0x48b5d9){return BPromise['reject'](_0x48b5d9);}return _0x164c83[_0x7435('0x1c')]();};}function saveUpdates(_0x26d6bf,_0x4c3049){return function(_0xbc8815){if(_0xbc8815){return _0xbc8815[_0x7435('0x1d')](_0x26d6bf)['then'](function(_0xf3cbde){return _0xf3cbde;});}return null;};}function removeEntity(_0x8469d3,_0x50f260){return function(_0x13b59a){if(_0x13b59a){return _0x13b59a[_0x7435('0x1e')]()[_0x7435('0x1f')](function(){var _0x4a6cd8=_0x13b59a[_0x7435('0x20')]({'plain':!![]});var _0x309f20=_0x7435('0x21');return db[_0x7435('0x22')][_0x7435('0x1e')]({'where':{'type':_0x309f20,'resourceId':_0x4a6cd8['id']}})[_0x7435('0x1f')](function(){return _0x13b59a;});})[_0x7435('0x1f')](function(){_0x8469d3[_0x7435('0x15')](0xcc)[_0x7435('0x16')]();});}};}function handleEntityNotFound(_0xdcaae8,_0x4ec93a){return function(_0x4c8fae){if(!_0x4c8fae){_0xdcaae8[_0x7435('0x14')](0x194);}return _0x4c8fae;};}function handleError(_0x2e468f,_0x31093b){_0x31093b=_0x31093b||0x1f4;return function(_0xbacdf5){logger[_0x7435('0x23')](_0xbacdf5[_0x7435('0x24')]);if(_0xbacdf5['name']){delete _0xbacdf5[_0x7435('0x25')];}_0x2e468f[_0x7435('0x15')](_0x31093b)[_0x7435('0x26')](_0xbacdf5);};}exports[_0x7435('0x27')]=function(_0x151665,_0x411d69){var _0x5de9fd={},_0x5942ab={},_0x53249f={'count':0x0,'rows':[]};var _0x3163b2=db[_0x7435('0x28')][_0x7435('0x29')];_0x5942ab[_0x7435('0x2a')]=_[_0x7435('0x2b')](_0x3163b2);_0x5942ab[_0x7435('0x2c')]=_[_0x7435('0x2b')](_0x151665[_0x7435('0x2c')]);_0x5942ab[_0x7435('0x2d')]=_[_0x7435('0x2e')](_0x5942ab['model'],_0x5942ab[_0x7435('0x2c')]);_0x5de9fd[_0x7435('0x2f')]=_['intersection'](_0x5942ab['model'],qs[_0x7435('0x30')](_0x151665[_0x7435('0x2c')][_0x7435('0x30')]));_0x5de9fd['attributes']=_0x5de9fd[_0x7435('0x2f')][_0x7435('0x31')]?_0x5de9fd[_0x7435('0x2f')]:_0x5942ab[_0x7435('0x2a')];if(!_0x151665[_0x7435('0x2c')][_0x7435('0x32')]('nolimit')){_0x5de9fd[_0x7435('0x33')]=qs[_0x7435('0x33')](_0x151665[_0x7435('0x2c')][_0x7435('0x33')]);_0x5de9fd[_0x7435('0x18')]=qs['offset'](_0x151665[_0x7435('0x2c')][_0x7435('0x18')]);}_0x5de9fd['order']=qs[_0x7435('0x34')](_0x151665[_0x7435('0x2c')][_0x7435('0x34')]);_0x5de9fd[_0x7435('0x35')]=qs[_0x7435('0x2d')](_[_0x7435('0x36')](_0x151665[_0x7435('0x2c')],_0x5942ab[_0x7435('0x2d')]));if(_0x151665[_0x7435('0x2c')][_0x7435('0x37')]){_0x5de9fd['where']=_[_0x7435('0x38')](_0x5de9fd['where'],{'$or':_[_0x7435('0x39')](_0x3163b2,function(_0x277d75){if(_0x277d75[_0x7435('0x3a')][_0x7435('0x3b')]!=='VIRTUAL'){var _0x267ac7={};_0x267ac7[_0x277d75[_0x7435('0x3c')]]={'$like':'%'+_0x151665[_0x7435('0x2c')][_0x7435('0x37')]+'%'};return _0x267ac7;}})});}_0x5de9fd=_[_0x7435('0x38')]({},_0x5de9fd,_0x151665[_0x7435('0x3d')]);var _0x274116={'where':_0x5de9fd[_0x7435('0x35')]};return db[_0x7435('0x28')][_0x7435('0x17')](_0x274116)[_0x7435('0x1f')](function(_0x4f2649){_0x53249f[_0x7435('0x17')]=_0x4f2649;if(_0x151665[_0x7435('0x2c')]['includeAll']){_0x5de9fd['include']=[{'all':!![]}];}return db[_0x7435('0x28')][_0x7435('0x3e')](_0x5de9fd);})[_0x7435('0x1f')](function(_0x171f05){_0x53249f[_0x7435('0x3f')]=_0x171f05;return _0x53249f;})[_0x7435('0x1f')](respondWithFilteredResult(_0x411d69,_0x5de9fd))[_0x7435('0x40')](handleError(_0x411d69,null));};exports[_0x7435('0x41')]=function(_0x481ae5,_0x1bfefa){var _0x357974={'raw':!![],'where':{'id':_0x481ae5['params']['id']}},_0x285454={};_0x285454[_0x7435('0x2a')]=_[_0x7435('0x2b')](db[_0x7435('0x28')][_0x7435('0x29')]);_0x285454[_0x7435('0x2c')]=_['keys'](_0x481ae5['query']);_0x285454[_0x7435('0x2d')]=_['intersection'](_0x285454['model'],_0x285454['query']);_0x357974['attributes']=_[_0x7435('0x2e')](_0x285454[_0x7435('0x2a')],qs[_0x7435('0x30')](_0x481ae5['query'][_0x7435('0x30')]));_0x357974['attributes']=_0x357974[_0x7435('0x2f')]['length']?_0x357974[_0x7435('0x2f')]:_0x285454['model'];if(_0x481ae5['query'][_0x7435('0x42')]){_0x357974['include']=[{'all':!![]}];}_0x357974=_['merge']({},_0x357974,_0x481ae5[_0x7435('0x3d')]);return db['Pause']['find'](_0x357974)[_0x7435('0x1f')](handleEntityNotFound(_0x1bfefa,null))[_0x7435('0x1f')](respondWithResult(_0x1bfefa,null))['catch'](handleError(_0x1bfefa,null));};exports[_0x7435('0x43')]=function(_0x31c412,_0x279c58){return db['Pause'][_0x7435('0x43')](_0x31c412[_0x7435('0x44')],{})[_0x7435('0x1f')](function(_0x45e0af){var _0x292ba7=_0x31c412[_0x7435('0x45')][_0x7435('0x20')]({'plain':!![]});if(!_0x292ba7)throw new Error(_0x7435('0x46'));if(_0x292ba7[_0x7435('0x47')]===_0x7435('0x45')){var _0x52dcad=_0x45e0af[_0x7435('0x20')]({'plain':!![]});var _0x45ceec=_0x7435('0x21');return db[_0x7435('0x48')]['find']({'where':{'name':_0x45ceec,'userProfileId':_0x292ba7['userProfileId']},'raw':!![]})['then'](function(_0x4c59ff){if(_0x4c59ff&&_0x4c59ff[_0x7435('0x49')]===0x0){return db[_0x7435('0x22')]['create']({'name':_0x52dcad[_0x7435('0x25')],'resourceId':_0x52dcad['id'],'type':_0x4c59ff['name'],'sectionId':_0x4c59ff['id']},{})[_0x7435('0x1f')](function(){return _0x45e0af;});}else{return _0x45e0af;}})['catch'](function(_0x483b74){logger[_0x7435('0x23')](_0x7435('0x4a'),_0x483b74);throw _0x483b74;});}return _0x45e0af;})[_0x7435('0x1f')](respondWithResult(_0x279c58,0xc9))[_0x7435('0x40')](handleError(_0x279c58,null));};exports['update']=function(_0x5497ea,_0x3d190a){if(_0x5497ea[_0x7435('0x44')]['id']){delete _0x5497ea['body']['id'];}return db[_0x7435('0x28')]['find']({'where':{'id':_0x5497ea[_0x7435('0x4b')]['id']}})[_0x7435('0x1f')](handleEntityNotFound(_0x3d190a,null))['then'](saveUpdates(_0x5497ea[_0x7435('0x44')],null))['then'](respondWithResult(_0x3d190a,null))[_0x7435('0x40')](handleError(_0x3d190a,null));};exports['destroy']=function(_0x1012f8,_0x47252d){return db[_0x7435('0x28')][_0x7435('0x4c')]({'where':{'id':_0x1012f8['params']['id']}})[_0x7435('0x1f')](handleEntityNotFound(_0x47252d,null))[_0x7435('0x1f')](removeEntity(_0x47252d,null))['catch'](handleError(_0x47252d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index a5260d3..0a92c1c 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 _0xe16b=['Pause','tools_pauses','lodash','api','moment','bluebird','./pause.attributes','exports'];(function(_0x18b615,_0x19d318){var _0x1699e7=function(_0x31794){while(--_0x31794){_0x18b615['push'](_0x18b615['shift']());}};_0x1699e7(++_0x19d318);}(_0xe16b,0x1ca));var _0xbe16=function(_0x3fefc7,_0x20a7dc){_0x3fefc7=_0x3fefc7-0x0;var _0x1fe591=_0xe16b[_0x3fefc7];return _0x1fe591;};'use strict';var _=require(_0xbe16('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbe16('0x1'));var moment=require(_0xbe16('0x2'));var BPromise=require(_0xbe16('0x3'));var rp=require('request-promise');var attributes=require(_0xbe16('0x4'));module[_0xbe16('0x5')]=function(_0xa1b417,_0x33b92c){return _0xa1b417['define'](_0xbe16('0x6'),attributes,{'tableName':_0xbe16('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07bc=['./pause.attributes','exports','define','Pause','util','api','moment','bluebird'];(function(_0x40c76b,_0x2ff0a8){var _0x2156d6=function(_0x5ef89b){while(--_0x5ef89b){_0x40c76b['push'](_0x40c76b['shift']());}};_0x2156d6(++_0x2ff0a8);}(_0x07bc,0x15c));var _0xc07b=function(_0x2eced7,_0x51a63a){_0x2eced7=_0x2eced7-0x0;var _0x196009=_0x07bc[_0x2eced7];return _0x196009;};'use strict';var _=require('lodash');var util=require(_0xc07b('0x0'));var logger=require('../../config/logger')(_0xc07b('0x1'));var moment=require(_0xc07b('0x2'));var BPromise=require(_0xc07b('0x3'));var rp=require('request-promise');var attributes=require(_0xc07b('0x4'));module[_0xc07b('0x5')]=function(_0xbb64c2,_0x1f9acd){return _0xbb64c2[_0xc07b('0x6')](_0xc07b('0x7'),attributes,{'tableName':'tools_pauses','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 1ceb8d0..6c1ebc6 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 _0x7070=['map','model','attributes','ShowPause','stringify','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','error','code','message','result','Pause','find','options','raw','where','include'];(function(_0x168018,_0x48a279){var _0x4fe004=function(_0x2cf7fd){while(--_0x2cf7fd){_0x168018['push'](_0x168018['shift']());}};_0x4fe004(++_0x48a279);}(_0x7070,0x1d7));var _0x0707=function(_0x22f001,_0x53482b){_0x22f001=_0x22f001-0x0;var _0x58a701=_0x7070[_0x22f001];return _0x58a701;};'use strict';var _=require('lodash');var util=require(_0x0707('0x0'));var moment=require('moment');var BPromise=require(_0x0707('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0707('0x2'))['db'];var utils=require(_0x0707('0x3'));var logger=require(_0x0707('0x4'))(_0x0707('0x5'));var config=require('../../config/environment');var jayson=require(_0x0707('0x6'));var client=jayson[_0x0707('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49c759,_0x2e2dc0,_0x591e4c){return new BPromise(function(_0x5777eb,_0x170332){return client[_0x0707('0x8')](_0x49c759,_0x591e4c)[_0x0707('0x9')](function(_0x36cc62){logger[_0x0707('0xa')](_0x0707('0xb'),_0x2e2dc0,_0x0707('0xc'));logger[_0x0707('0xd')](_0x0707('0xe'),_0x2e2dc0,_0x0707('0xc'),JSON['stringify'](_0x36cc62));if(_0x36cc62[_0x0707('0xf')]){if(_0x36cc62['error'][_0x0707('0x10')]===0x1f4){logger['error'](_0x0707('0xb'),_0x2e2dc0,_0x36cc62[_0x0707('0xf')][_0x0707('0x11')]);return _0x170332(_0x36cc62[_0x0707('0xf')][_0x0707('0x11')]);}logger[_0x0707('0xf')](_0x0707('0xb'),_0x2e2dc0,_0x36cc62[_0x0707('0xf')][_0x0707('0x11')]);return _0x5777eb(_0x36cc62[_0x0707('0xf')]['message']);}else{logger['info'](_0x0707('0xb'),_0x2e2dc0,_0x0707('0xc'));_0x5777eb(_0x36cc62[_0x0707('0x12')][_0x0707('0x11')]);}})['catch'](function(_0x17b571){logger[_0x0707('0xf')](_0x0707('0xb'),_0x2e2dc0,_0x17b571);_0x170332(_0x17b571);});});}exports['ShowPause']=function(_0x13d5de){var _0x5e8489=this;return new Promise(function(_0x471431,_0x529363){return db[_0x0707('0x13')][_0x0707('0x14')]({'raw':_0x13d5de[_0x0707('0x15')]?_0x13d5de[_0x0707('0x15')][_0x0707('0x16')]===undefined?!![]:![]:!![],'where':_0x13d5de['options']?_0x13d5de[_0x0707('0x15')][_0x0707('0x17')]||null:null,'attributes':_0x13d5de[_0x0707('0x15')]?_0x13d5de['options']['attributes']||null:null,'include':_0x13d5de['options']?_0x13d5de[_0x0707('0x15')][_0x0707('0x18')]?_[_0x0707('0x19')](_0x13d5de['options']['include'],function(_0x228c33){return{'model':db[_0x228c33[_0x0707('0x1a')]],'as':_0x228c33['as'],'attributes':_0x228c33[_0x0707('0x1b')],'include':_0x228c33[_0x0707('0x18')]?_[_0x0707('0x19')](_0x228c33[_0x0707('0x18')],function(_0x16f659){return{'model':db[_0x16f659[_0x0707('0x1a')]],'as':_0x16f659['as'],'attributes':_0x16f659[_0x0707('0x1b')],'include':_0x16f659[_0x0707('0x18')]?_[_0x0707('0x19')](_0x16f659[_0x0707('0x18')],function(_0x5d72c7){return{'model':db[_0x5d72c7[_0x0707('0x1a')]],'as':_0x5d72c7['as'],'attributes':_0x5d72c7[_0x0707('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0707('0x9')](function(_0x3c6ee1){logger['info'](_0x0707('0x1c'),_0x13d5de);logger[_0x0707('0xd')](_0x0707('0x1c'),_0x13d5de,JSON[_0x0707('0x1d')](_0x3c6ee1));_0x471431(_0x3c6ee1);})[_0x0707('0x1e')](function(_0x599090){logger[_0x0707('0xf')](_0x0707('0x1c'),_0x599090[_0x0707('0x11')],_0x13d5de);_0x529363(_0x5e8489[_0x0707('0xf')](0x1f4,_0x599090['message']));});});}; \ No newline at end of file +var _0xd41f=['find','options','raw','attributes','include','map','model','ShowPause','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','Pause'];(function(_0x36f4d9,_0x82218c){var _0x3cecbc=function(_0x25fb4c){while(--_0x25fb4c){_0x36f4d9['push'](_0x36f4d9['shift']());}};_0x3cecbc(++_0x82218c);}(_0xd41f,0xf1));var _0xfd41=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd41f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xfd41('0x0'));var moment=require(_0xfd41('0x1'));var BPromise=require('bluebird');var rs=require(_0xfd41('0x2'));var fs=require('fs');var Redis=require(_0xfd41('0x3'));var db=require(_0xfd41('0x4'))['db'];var utils=require(_0xfd41('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfd41('0x6'));var client=jayson['client'][_0xfd41('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5a1f71,_0x3c4ba2,_0x289c13){return new BPromise(function(_0x5e9bf2,_0x898a79){return client[_0xfd41('0x8')](_0x5a1f71,_0x289c13)[_0xfd41('0x9')](function(_0x4fdd6f){logger[_0xfd41('0xa')](_0xfd41('0xb'),_0x3c4ba2,'request\x20sent');logger['debug']('Pause,\x20%s,\x20%s,\x20%s',_0x3c4ba2,'request\x20sent',JSON[_0xfd41('0xc')](_0x4fdd6f));if(_0x4fdd6f['error']){if(_0x4fdd6f['error'][_0xfd41('0xd')]===0x1f4){logger[_0xfd41('0xe')]('Pause,\x20%s,\x20%s',_0x3c4ba2,_0x4fdd6f[_0xfd41('0xe')]['message']);return _0x898a79(_0x4fdd6f['error'][_0xfd41('0xf')]);}logger[_0xfd41('0xe')]('Pause,\x20%s,\x20%s',_0x3c4ba2,_0x4fdd6f[_0xfd41('0xe')][_0xfd41('0xf')]);return _0x5e9bf2(_0x4fdd6f[_0xfd41('0xe')][_0xfd41('0xf')]);}else{logger[_0xfd41('0xa')](_0xfd41('0xb'),_0x3c4ba2,_0xfd41('0x10'));_0x5e9bf2(_0x4fdd6f[_0xfd41('0x11')][_0xfd41('0xf')]);}})[_0xfd41('0x12')](function(_0x5b9868){logger[_0xfd41('0xe')](_0xfd41('0xb'),_0x3c4ba2,_0x5b9868);_0x898a79(_0x5b9868);});});}exports['ShowPause']=function(_0x471da4){var _0x27c002=this;return new Promise(function(_0x1befad,_0x47f413){return db[_0xfd41('0x13')][_0xfd41('0x14')]({'raw':_0x471da4[_0xfd41('0x15')]?_0x471da4[_0xfd41('0x15')][_0xfd41('0x16')]===undefined?!![]:![]:!![],'where':_0x471da4[_0xfd41('0x15')]?_0x471da4[_0xfd41('0x15')]['where']||null:null,'attributes':_0x471da4[_0xfd41('0x15')]?_0x471da4['options'][_0xfd41('0x17')]||null:null,'include':_0x471da4[_0xfd41('0x15')]?_0x471da4['options'][_0xfd41('0x18')]?_[_0xfd41('0x19')](_0x471da4[_0xfd41('0x15')][_0xfd41('0x18')],function(_0x1fae45){return{'model':db[_0x1fae45[_0xfd41('0x1a')]],'as':_0x1fae45['as'],'attributes':_0x1fae45[_0xfd41('0x17')],'include':_0x1fae45[_0xfd41('0x18')]?_[_0xfd41('0x19')](_0x1fae45[_0xfd41('0x18')],function(_0x2ea394){return{'model':db[_0x2ea394[_0xfd41('0x1a')]],'as':_0x2ea394['as'],'attributes':_0x2ea394[_0xfd41('0x17')],'include':_0x2ea394[_0xfd41('0x18')]?_['map'](_0x2ea394['include'],function(_0x1c2246){return{'model':db[_0x1c2246['model']],'as':_0x1c2246['as'],'attributes':_0x1c2246[_0xfd41('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfd41('0x9')](function(_0x50bb3a){logger['info'](_0xfd41('0x1b'),_0x471da4);logger[_0xfd41('0x1c')]('ShowPause',_0x471da4,JSON['stringify'](_0x50bb3a));_0x1befad(_0x50bb3a);})[_0xfd41('0x12')](function(_0x59c5e3){logger['error'](_0xfd41('0x1b'),_0x59c5e3['message'],_0x471da4);_0x47f413(_0x27c002[_0xfd41('0xe')](0x1f4,_0x59c5e3['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 159aca7..7dc47df 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 _0x467f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','webhookGet','/:id','isAuthenticated','show','/:id/download','download','join','root','server/files/plugins','originalname','format','%s-%s%s','now','extname','post','single','file','upload','webhookPost','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x467f,0x11a));var _0xf467=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x467f[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0xf467('0x0'));var util=require(_0xf467('0x1'));var path=require(_0xf467('0x2'));var timeout=require(_0xf467('0x3'));var express=require(_0xf467('0x4'));var router=express[_0xf467('0x5')]();var auth=require(_0xf467('0x6'));var interaction=require(_0xf467('0x7'));var config=require(_0xf467('0x8'));var controller=require('./plugin.controller');router[_0xf467('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf467('0x9')]('/webhook',controller[_0xf467('0xa')]);router[_0xf467('0x9')](_0xf467('0xb'),auth[_0xf467('0xc')](),controller[_0xf467('0xd')]);router[_0xf467('0x9')](_0xf467('0xe'),auth[_0xf467('0xc')](),controller[_0xf467('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2542f2,_0x1a9954,_0x2da913){_0x2da913(null,path[_0xf467('0x10')](config[_0xf467('0x11')],_0xf467('0x12')));},'filename':function(_0x454af0,_0x2ab6d4,_0x431c57){_0x2ab6d4[_0xf467('0x13')]=_0x2ab6d4['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x431c57(null,util[_0xf467('0x14')](_0xf467('0x15'),path['basename'](_0x2ab6d4[_0xf467('0x13')],path['extname'](_0x2ab6d4[_0xf467('0x13')])),Date[_0xf467('0x16')](),path[_0xf467('0x17')](_0x2ab6d4[_0xf467('0x13')])));}})});router[_0xf467('0x18')]('/',upload[_0xf467('0x19')](_0xf467('0x1a')),controller[_0xf467('0x1b')]);router[_0xf467('0x18')]('/webhook',controller[_0xf467('0x1c')]);router[_0xf467('0x1d')]('/:id',auth[_0xf467('0xc')](),controller['update']);router[_0xf467('0x1e')](_0xf467('0xb'),auth[_0xf467('0xc')](),controller['delete']);module[_0xf467('0x1f')]=router; \ No newline at end of file +var _0xaefa=['format','basename','extname','single','file','upload','post','/webhook','put','/:id','update','delete','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','webhookGet','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0xaefa,0x1bf));var _0xaaef=function(_0x14595d,_0x371024){_0x14595d=_0x14595d-0x0;var _0x3bd77e=_0xaefa[_0x14595d];return _0x3bd77e;};'use strict';var multer=require('multer');var util=require(_0xaaef('0x0'));var path=require('path');var timeout=require(_0xaaef('0x1'));var express=require(_0xaaef('0x2'));var router=express[_0xaaef('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xaaef('0x4'));var config=require(_0xaaef('0x5'));var controller=require(_0xaaef('0x6'));router[_0xaaef('0x7')]('/',auth[_0xaaef('0x8')](),controller['index']);router['get']('/webhook',controller[_0xaaef('0x9')]);router[_0xaaef('0x7')]('/:id',auth[_0xaaef('0x8')](),controller['show']);router[_0xaaef('0x7')](_0xaaef('0xa'),auth[_0xaaef('0x8')](),controller[_0xaaef('0xb')]);var upload=multer({'storage':multer[_0xaaef('0xc')]({'destination':function(_0x599177,_0x14a2b0,_0x4d9696){_0x4d9696(null,path[_0xaaef('0xd')](config[_0xaaef('0xe')],_0xaaef('0xf')));},'filename':function(_0x8ce1a1,_0x1506c8,_0x202b56){_0x1506c8[_0xaaef('0x10')]=_0x1506c8[_0xaaef('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x202b56(null,util[_0xaaef('0x11')]('%s-%s%s',path[_0xaaef('0x12')](_0x1506c8[_0xaaef('0x10')],path[_0xaaef('0x13')](_0x1506c8[_0xaaef('0x10')])),Date['now'](),path[_0xaaef('0x13')](_0x1506c8[_0xaaef('0x10')])));}})});router['post']('/',upload[_0xaaef('0x14')](_0xaaef('0x15')),controller[_0xaaef('0x16')]);router[_0xaaef('0x17')](_0xaaef('0x18'),controller['webhookPost']);router[_0xaaef('0x19')](_0xaaef('0x1a'),auth[_0xaaef('0x8')](),controller[_0xaaef('0x1b')]);router[_0xaaef('0x1c')](_0xaaef('0x1a'),auth[_0xaaef('0x8')](),controller['delete']);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 a066132..30dc634 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 _0x2137=['STRING','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','adminOnly','agentOnly','never','always','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2137,0x134));var _0x7213=function(_0x5e49de,_0x1d3dd9){_0x5e49de=_0x5e49de-0x0;var _0x328849=_0x2137[_0x5e49de];return _0x328849;};'use strict';var Sequelize=require(_0x7213('0x0'));module[_0x7213('0x1')]={'name':{'type':Sequelize[_0x7213('0x2')]},'type':{'type':Sequelize['ENUM']('html',_0x7213('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x7213('0x4')]},'path':{'type':Sequelize[_0x7213('0x2')],'comment':_0x7213('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0x7213('0x6'),_0x7213('0x7'),'always',_0x7213('0x8')),'defaultValue':_0x7213('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x7213('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x7213('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2011=['STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0xb613f8,_0x50d8aa){var _0x2cbb4b=function(_0x2fa086){while(--_0x2fa086){_0xb613f8['push'](_0xb613f8['shift']());}};_0x2cbb4b(++_0x50d8aa);}(_0x2011,0x73));var _0x1201=function(_0x2d432f,_0x533510){_0x2d432f=_0x2d432f-0x0;var _0x4e9db3=_0x2011[_0x2d432f];return _0x4e9db3;};'use strict';var Sequelize=require(_0x1201('0x0'));module[_0x1201('0x1')]={'name':{'type':Sequelize[_0x1201('0x2')]},'type':{'type':Sequelize[_0x1201('0x3')](_0x1201('0x4'),_0x1201('0x5'))},'description':{'type':Sequelize[_0x1201('0x6')]},'version':{'type':Sequelize[_0x1201('0x6')]},'path':{'type':Sequelize[_0x1201('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x1201('0x7')],'defaultValue':0x0,'comment':_0x1201('0x8')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x1201('0x9'),_0x1201('0xa'),_0x1201('0xb')),'defaultValue':'always','comment':_0x1201('0xc')},'icon':{'type':Sequelize[_0x1201('0x2')]},'adminUrl':{'type':Sequelize[_0x1201('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x1201('0x2')]},'scriptPath':{'type':Sequelize[_0x1201('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 1c818e7..c04f320 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 _0x42cb=['manifest.json','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','endsWith','download','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','end','sendStatus','error','stack','name','send','index','Plugin','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','show','params','length','include','catch','find','join','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','root','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','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','isDirectory'];(function(_0x2dac04,_0x408ef4){var _0x45c2ff=function(_0x118a2e){while(--_0x118a2e){_0x2dac04['push'](_0x2dac04['shift']());}};_0x45c2ff(++_0x408ef4);}(_0x42cb,0x17d));var _0xb42c=function(_0x156c8f,_0x25510b){_0x156c8f=_0x156c8f-0x0;var _0x1d9cd2=_0x42cb[_0x156c8f];return _0x1d9cd2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb42c('0x0'));var zipdir=require(_0xb42c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb42c('0x2'));var moment=require('moment');var BPromise=require(_0xb42c('0x3'));var Mustache=require(_0xb42c('0x4'));var util=require(_0xb42c('0x5'));var path=require(_0xb42c('0x6'));var sox=require(_0xb42c('0x7'));var csv=require(_0xb42c('0x8'));var ejs=require(_0xb42c('0x9'));var fs=require('fs');var _=require(_0xb42c('0xa'));var squel=require('squel');var crypto=require(_0xb42c('0xb'));var jsforce=require(_0xb42c('0xc'));var deskjs=require(_0xb42c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb42c('0xe'));var Papa=require(_0xb42c('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xb42c('0x10'));var Redis=require('ioredis');var extract=require('extract-zip');var rimraf=require(_0xb42c('0x0'));var archiver=require('archiver');var qs=require(_0xb42c('0x11'));var logger=require(_0xb42c('0x12'))(_0xb42c('0x13'));var utils=require('../../config/utils');var config=require(_0xb42c('0x14'));var db=require(_0xb42c('0x15'))['db'];config[_0xb42c('0x16')]=_[_0xb42c('0x17')](config[_0xb42c('0x16')],{'host':_0xb42c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb42c('0x16')]));require('./plugin.socket')[_0xb42c('0x19')](socket);function respondWithStatusCode(_0xdffb1f,_0x70be38){_0x70be38=_0x70be38||0xcc;return function(_0x6df63e){if(_0x6df63e){return _0xdffb1f['sendStatus'](_0x70be38);}return _0xdffb1f[_0xb42c('0x1a')](_0x70be38)['end']();};}function respondWithResult(_0x4fa4e1,_0x153567){_0x153567=_0x153567||0xc8;return function(_0x415a6f){if(_0x415a6f){return _0x4fa4e1[_0xb42c('0x1a')](_0x153567)[_0xb42c('0x1b')](_0x415a6f);}};}function respondWithFilteredResult(_0x5e2686,_0x6e725b){return function(_0xcc1b3c){if(_0xcc1b3c){var _0x2b79e7=_0xcc1b3c[_0xb42c('0x1c')],_0x3769f6=_0x6e725b[_0xb42c('0x1d')],_0x18a401=_0x6e725b[_0xb42c('0x1d')]+_0x6e725b[_0xb42c('0x1e')],_0x363ae8;if(_0x18a401>=_0x2b79e7){_0x18a401=_0x2b79e7;_0x363ae8=0xc8;}else{_0x363ae8=0xce;}_0x5e2686[_0xb42c('0x1a')](_0x363ae8);return _0x5e2686[_0xb42c('0x1f')](_0xb42c('0x20'),_0x3769f6+'-'+_0x18a401+'/'+_0x2b79e7)['json'](_0xcc1b3c);}return null;};}function patchUpdates(_0x2850c7){return function(_0x3e3de3){try{jsonpatch[_0xb42c('0x21')](_0x3e3de3,_0x2850c7,!![]);}catch(_0x4c807c){return BPromise[_0xb42c('0x22')](_0x4c807c);}return _0x3e3de3[_0xb42c('0x23')]();};}function saveUpdates(_0x216c2e,_0x31b219){return function(_0x23bfd6){if(_0x23bfd6){return _0x23bfd6[_0xb42c('0x24')](_0x216c2e)[_0xb42c('0x25')](function(_0x3b8ff3){return _0x3b8ff3;});}return null;};}function removeEntity(_0x12c9c4,_0x458950){return function(_0x3e19ea){if(_0x3e19ea){return _0x3e19ea[_0xb42c('0x26')]()[_0xb42c('0x25')](function(){var _0x3d68a8=_0x3e19ea[_0xb42c('0x27')]({'plain':!![]});var _0x13bfa3=_0xb42c('0x28');return db['UserProfileResource'][_0xb42c('0x26')]({'where':{'type':_0x13bfa3,'resourceId':_0x3d68a8['id']}})[_0xb42c('0x25')](function(){return _0x3e19ea;});})['then'](function(){_0x12c9c4[_0xb42c('0x1a')](0xcc)[_0xb42c('0x29')]();});}};}function handleEntityNotFound(_0x3cb50d,_0xe61f8b){return function(_0x48c168){if(!_0x48c168){_0x3cb50d[_0xb42c('0x2a')](0x194);}return _0x48c168;};}function handleError(_0xb8ee07,_0x668ff5){_0x668ff5=_0x668ff5||0x1f4;return function(_0x14cd1a){logger[_0xb42c('0x2b')](_0x14cd1a[_0xb42c('0x2c')]);if(_0x14cd1a[_0xb42c('0x2d')]){delete _0x14cd1a[_0xb42c('0x2d')];}_0xb8ee07['status'](_0x668ff5)[_0xb42c('0x2e')](_0x14cd1a);};}exports[_0xb42c('0x2f')]=function(_0x57e65f,_0x18fff2){var _0x2742f4={},_0x31c1b3={},_0x1ed395={'count':0x0,'rows':[]};var _0x5051c0=db[_0xb42c('0x30')][_0xb42c('0x31')];_0x31c1b3[_0xb42c('0x32')]=_[_0xb42c('0x33')](_0x5051c0);_0x31c1b3[_0xb42c('0x34')]=_[_0xb42c('0x33')](_0x57e65f[_0xb42c('0x34')]);_0x31c1b3[_0xb42c('0x35')]=_[_0xb42c('0x36')](_0x31c1b3['model'],_0x31c1b3[_0xb42c('0x34')]);_0x2742f4[_0xb42c('0x37')]=_['intersection'](_0x31c1b3[_0xb42c('0x32')],qs['fields'](_0x57e65f['query'][_0xb42c('0x38')]));_0x2742f4[_0xb42c('0x37')]=_0x2742f4[_0xb42c('0x37')]['length']?_0x2742f4[_0xb42c('0x37')]:_0x31c1b3['model'];if(!_0x57e65f['query'][_0xb42c('0x39')](_0xb42c('0x3a'))){_0x2742f4[_0xb42c('0x1e')]=qs[_0xb42c('0x1e')](_0x57e65f[_0xb42c('0x34')][_0xb42c('0x1e')]);_0x2742f4[_0xb42c('0x1d')]=qs[_0xb42c('0x1d')](_0x57e65f[_0xb42c('0x34')][_0xb42c('0x1d')]);}_0x2742f4[_0xb42c('0x3b')]=qs['sort'](_0x57e65f['query']['sort']);_0x2742f4[_0xb42c('0x3c')]=qs[_0xb42c('0x35')](_['pick'](_0x57e65f[_0xb42c('0x34')],_0x31c1b3[_0xb42c('0x35')]));if(_0x57e65f[_0xb42c('0x34')][_0xb42c('0x3d')]){_0x2742f4[_0xb42c('0x3c')]=_[_0xb42c('0x3e')](_0x2742f4[_0xb42c('0x3c')],{'$or':_['map'](_0x5051c0,function(_0x56fd61){if(_0x56fd61[_0xb42c('0x3f')][_0xb42c('0x40')]!==_0xb42c('0x41')){var _0x588a3d={};_0x588a3d[_0x56fd61[_0xb42c('0x42')]]={'$like':'%'+_0x57e65f[_0xb42c('0x34')][_0xb42c('0x3d')]+'%'};return _0x588a3d;}})});}_0x2742f4=_[_0xb42c('0x3e')]({},_0x2742f4,_0x57e65f[_0xb42c('0x43')]);var _0x5449f6={'where':_0x2742f4[_0xb42c('0x3c')]};return db[_0xb42c('0x30')][_0xb42c('0x1c')](_0x5449f6)[_0xb42c('0x25')](function(_0x379e26){_0x1ed395[_0xb42c('0x1c')]=_0x379e26;if(_0x57e65f[_0xb42c('0x34')][_0xb42c('0x44')]){_0x2742f4['include']=[{'all':!![]}];}return db[_0xb42c('0x30')][_0xb42c('0x45')](_0x2742f4);})[_0xb42c('0x25')](function(_0x485702){_0x1ed395['rows']=_0x485702;return _0x1ed395;})[_0xb42c('0x25')](respondWithFilteredResult(_0x18fff2,_0x2742f4))['catch'](handleError(_0x18fff2,null));};exports[_0xb42c('0x46')]=function(_0xb7ec9f,_0x57c690){var _0x5b7042={'raw':!![],'where':{'id':_0xb7ec9f[_0xb42c('0x47')]['id']}},_0xad30f4={};_0xad30f4[_0xb42c('0x32')]=_[_0xb42c('0x33')](db[_0xb42c('0x30')][_0xb42c('0x31')]);_0xad30f4[_0xb42c('0x34')]=_['keys'](_0xb7ec9f[_0xb42c('0x34')]);_0xad30f4['filters']=_[_0xb42c('0x36')](_0xad30f4[_0xb42c('0x32')],_0xad30f4[_0xb42c('0x34')]);_0x5b7042[_0xb42c('0x37')]=_['intersection'](_0xad30f4[_0xb42c('0x32')],qs[_0xb42c('0x38')](_0xb7ec9f['query'][_0xb42c('0x38')]));_0x5b7042['attributes']=_0x5b7042[_0xb42c('0x37')][_0xb42c('0x48')]?_0x5b7042[_0xb42c('0x37')]:_0xad30f4[_0xb42c('0x32')];if(_0xb7ec9f[_0xb42c('0x34')][_0xb42c('0x44')]){_0x5b7042[_0xb42c('0x49')]=[{'all':!![]}];}_0x5b7042=_[_0xb42c('0x3e')]({},_0x5b7042,_0xb7ec9f[_0xb42c('0x43')]);return db[_0xb42c('0x30')]['find'](_0x5b7042)[_0xb42c('0x25')](handleEntityNotFound(_0x57c690,null))[_0xb42c('0x25')](respondWithResult(_0x57c690,null))[_0xb42c('0x4a')](handleError(_0x57c690,null));};exports['download']=function(_0x1d4c40,_0x22fc11,_0x2c50bf){return db[_0xb42c('0x30')][_0xb42c('0x4b')]({'where':{'id':_0x1d4c40['params']['id']},'attributes':[_0xb42c('0x2d'),_0xb42c('0x6')],'raw':!![]})[_0xb42c('0x25')](handleEntityNotFound(_0x22fc11,null))[_0xb42c('0x25')](function(_0x53166d){if(_0x53166d){var _0x5a6503=path[_0xb42c('0x4c')](config['root'],_0xb42c('0x4d'),util[_0xb42c('0x4e')](_0xb42c('0x4f'),path['basename'](_0x53166d[_0xb42c('0x6')])));var _0x404f3e=fs[_0xb42c('0x50')](_0x5a6503);var _0x1a35fd=archiver(_0xb42c('0x51'),{'zlib':{'level':0x9}});_0x1a35fd['on'](_0xb42c('0x52'),function(_0x312a84){if(_0x312a84[_0xb42c('0x53')]===_0xb42c('0x54')){logger[_0xb42c('0x2b')](_0x312a84);}else{throw new db[(_0xb42c('0x55'))]['Error'](_0xb42c('0x56'));}});_0x1a35fd['on'](_0xb42c('0x2b'),function(_0x58e634){throw new db[(_0xb42c('0x55'))][(_0xb42c('0x57'))](_0xb42c('0x56'));});_0x1a35fd['pipe'](_0x404f3e);_0x1a35fd[_0xb42c('0x58')](_0xb42c('0x59'),{'cwd':path['join'](config[_0xb42c('0x5a')],'server/files/plugins',path[_0xb42c('0x5b')](_0x53166d['path'])),'ignore':[path[_0xb42c('0x4c')](path[_0xb42c('0x5c')](_0x53166d[_0xb42c('0x6')]),_0xb42c('0x5d')),path[_0xb42c('0x4c')](path[_0xb42c('0x5c')](_0x53166d['path']),_0xb42c('0x5e'))],'nodir':!![]})[_0xb42c('0x5f')]();_0x404f3e['on'](_0xb42c('0x60'),function(){if(!fs[_0xb42c('0x61')](_0x5a6503)){throw new db[(_0xb42c('0x55'))][(_0xb42c('0x57'))](_0xb42c('0x62'));}return _0x22fc11['download'](_0x5a6503,util['format'](_0xb42c('0x4f'),path[_0xb42c('0x5c')](_0x53166d[_0xb42c('0x6')])),function(_0x3ef5b9){if(_0x3ef5b9){throw new db[(_0xb42c('0x55'))][(_0xb42c('0x57'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xb42c('0x63')](_0x5a6503);logger[_0xb42c('0x64')](_0xb42c('0x65'));logger[_0xb42c('0x64')](_0xb42c('0x66'));});});}return null;})[_0xb42c('0x4a')](handleError(_0x22fc11,null));};exports[_0xb42c('0x67')]=function(_0x1936f0,_0x28bfc4,_0x1cf299){var _0x379d20=path[_0xb42c('0x5c')](_0x1936f0[_0xb42c('0x68')]['filename'],path['extname'](_0x1936f0['file'][_0xb42c('0x69')]));var _0x37f09b=path[_0xb42c('0x4c')](config[_0xb42c('0x5a')],_0xb42c('0x4d'),_0x1936f0['file'][_0xb42c('0x69')]);var _0x2fd891=path['join'](config[_0xb42c('0x5a')],_0xb42c('0x4d'),_0x379d20);logger[_0xb42c('0x64')](_0xb42c('0x6a'),_0x37f09b);logger['info'](_0xb42c('0x6b'),_0x2fd891);try{fs[_0xb42c('0x6c')](_0x37f09b,parseInt(_0xb42c('0x6d'),0x8));extract(_0x37f09b,{'dir':_0x2fd891},function(_0x530bd3){if(_0x530bd3){logger[_0xb42c('0x2b')](_0x530bd3);handleError(_0x530bd3,!![]);};var _0x1effc6=fs[_0xb42c('0x6e')](_0x2fd891);if(_0x1effc6[_0xb42c('0x48')]>0x1){removeReferences(_0x37f09b,_0x2fd891);logger['error'](_0xb42c('0x6f'));return _0x1cf299(new Error(_0xb42c('0x6f')));}var _0x2c841a=fs[_0xb42c('0x70')](path[_0xb42c('0x4c')](_0x2fd891,_0x1effc6[0x0]));if(_0x2c841a['isFile']()){removeReferences(_0x37f09b,_0x2fd891);logger[_0xb42c('0x2b')]('Invalid\x20plugin\x20structure');return _0x1cf299(new Error(_0xb42c('0x6f')));}if(_0x2c841a[_0xb42c('0x71')]()){var _0x330d1b=fs[_0xb42c('0x6e')](path['join'](_0x2fd891,_0x1effc6[0x0]));if(_0x330d1b[_0xb42c('0x48')]===0x0){removeReferences(_0x37f09b,_0x2fd891);logger['error'](_0xb42c('0x6f'));return _0x1cf299(new Error('Invalid\x20plugin\x20structure'));}var _0x1d97fe=_0x330d1b['some'](function(_0x85ffb6){return _0x85ffb6===_0xb42c('0x72');});if(!_0x1d97fe){return _0x1cf299(new Error('Plugin\x20manifest\x20missing'));}var _0x5d9385=fs[_0xb42c('0x73')](path['join'](_0x2fd891,_0x1effc6[0x0],_0xb42c('0x72')));var _0x635771=JSON[_0xb42c('0x74')](_0x5d9385);if(_0xb42c('0x75')==typeof _0x635771[_0xb42c('0x2d')]){return _0x1cf299(new Error(_0xb42c('0x76')));}if(_0xb42c('0x75')==typeof _0x635771['type']){return _0x1cf299(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xb42c('0x75')==typeof _0x635771[_0xb42c('0x77')]){return _0x1cf299(new Error(_0xb42c('0x78')));}if(_0xb42c('0x75')==typeof _0x635771[_0xb42c('0x79')]){return _0x1cf299(new Error(_0xb42c('0x7a')));}if(_0x635771[_0xb42c('0x3f')]===_0xb42c('0x7b')){if('undefined'==typeof _0x635771[_0xb42c('0x79')][_0xb42c('0x7c')]){return _0x1cf299(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xb42c('0x75')==typeof _0x635771[_0xb42c('0x79')]['views'][_0xb42c('0x7d')]&&'undefined'==typeof _0x635771['parameters']['views'][_0xb42c('0x7e')]){return _0x1cf299(new Error(_0xb42c('0x7f')));}}else if(_0x635771[_0xb42c('0x3f')]===_0xb42c('0x80')){if(_0xb42c('0x75')==typeof _0x635771[_0xb42c('0x79')][_0xb42c('0x81')]){return _0x1cf299(new Error(_0xb42c('0x82')));}if(_0xb42c('0x75')==typeof _0x635771[_0xb42c('0x79')][_0xb42c('0x83')]){return _0x1cf299(new Error(_0xb42c('0x84')));}}else{return _0x1cf299(new Error(_0xb42c('0x85')));}var _0x346635=_0x635771['name'];var _0x496ebd=_0x635771['description'];var _0x5b7c9c=_0x635771[_0xb42c('0x3f')];var _0x4863f1=_0x635771[_0xb42c('0x86')]?_0x635771[_0xb42c('0x86')]:_0xb42c('0x87');var _0x29e2b7=_0x635771['icon']?_0x635771['icon']:_0xb42c('0x88');var _0x2c9bf8='';var _0x2e9149='';var _0x4e3107='';var _0xdf46f0='';var _0x1130fb=_0x635771['version'];if(_0x5b7c9c==='html'){if(_0xb42c('0x75')!=typeof _0x635771['parameters'][_0xb42c('0x7c')][_0xb42c('0x7d')]){var _0x3a0cbe=_0x635771['parameters'][_0xb42c('0x7c')][_0xb42c('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3a0cbe)){_0x2c9bf8=path[_0xb42c('0x4c')](_0xb42c('0x89'),_0x379d20,_0x1effc6[0x0],_0x3a0cbe);}else{_0x2c9bf8=_0x3a0cbe;}}else{logger[_0xb42c('0x64')](_0xb42c('0x8a'));}if(_0xb42c('0x75')!=typeof _0x635771['parameters'][_0xb42c('0x7c')]['agent']){var _0x115d20=_0x635771['parameters'][_0xb42c('0x7c')][_0xb42c('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xb42c('0x8b')](_0x115d20)){_0x2e9149=path['join'](_0xb42c('0x89'),_0x379d20,_0x1effc6[0x0],_0x115d20);}else{_0x2e9149=_0x115d20;}}else{logger['info'](_0xb42c('0x8c'));}}else if(_0x5b7c9c===_0xb42c('0x80')){_0x4e3107=_0x635771[_0xb42c('0x79')][_0xb42c('0x81')];_0xdf46f0=_0x635771[_0xb42c('0x79')]['scriptPath'];if(_0xb42c('0x75')!=typeof _0x635771['parameters'][_0xb42c('0x7c')]){if(_0xb42c('0x75')!=typeof _0x635771['parameters']['views'][_0xb42c('0x7d')]){var _0x3a0cbe=_0x635771[_0xb42c('0x79')][_0xb42c('0x7c')][_0xb42c('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0xb42c('0x8b')](_0x3a0cbe)){_0x2c9bf8=path[_0xb42c('0x4c')]('plugins',_0x379d20,_0x1effc6[0x0],_0x3a0cbe);}else{_0x2c9bf8=_0x3a0cbe;}}if('undefined'!=typeof _0x635771[_0xb42c('0x79')][_0xb42c('0x7c')][_0xb42c('0x7e')]){var _0x115d20=_0x635771[_0xb42c('0x79')][_0xb42c('0x7c')][_0xb42c('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xb42c('0x8b')](_0x115d20)){_0x2e9149=path[_0xb42c('0x4c')](_0xb42c('0x89'),_0x379d20,_0x1effc6[0x0],_0x115d20);}else{_0x2e9149=_0x115d20;}}}}var _0x375cb9={'name':_0x346635,'description':_0x496ebd,'path':path[_0xb42c('0x4c')](_0x379d20,_0x1effc6[0x0]),'type':_0x5b7c9c,'sidebar':_0x4863f1,'icon':_0x29e2b7,'adminUrl':_0x2c9bf8,'agentUrl':_0x2e9149,'scriptName':_0x4e3107,'scriptPath':_0xdf46f0,'version':_0x1130fb};removeReferences(_0x37f09b,null);return db[_0xb42c('0x30')][_0xb42c('0x8d')](_0x375cb9)[_0xb42c('0x25')](function(_0x398e0a){var _0x473cb3={'role':_0x1936f0['body'][_0xb42c('0x8e')],'userProfileId':_0x1936f0[_0xb42c('0x8f')]['userProfileId']};if(!_0x473cb3)throw new Error(_0xb42c('0x90'));if(_0x473cb3[_0xb42c('0x8e')]==='user'){var _0x23ca99=_0x398e0a['get']({'plain':!![]});return db[_0xb42c('0x91')][_0xb42c('0x4b')]({'where':{'name':'Plugins','userProfileId':_0x473cb3['userProfileId']},'raw':!![]})[_0xb42c('0x25')](function(_0x5b6ba5){if(_0x5b6ba5&&_0x5b6ba5[_0xb42c('0x92')]===0x0){return db[_0xb42c('0x93')]['create']({'name':_0x23ca99[_0xb42c('0x2d')],'resourceId':_0x23ca99['id'],'type':_0x5b6ba5[_0xb42c('0x2d')],'sectionId':_0x5b6ba5['id']},{})['then'](function(){return _0x398e0a;});}else{return _0x398e0a;}})[_0xb42c('0x4a')](function(_0x1cd0fc){logger[_0xb42c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cd0fc);throw _0x1cd0fc;});}return _0x398e0a;})[_0xb42c('0x25')](respondWithResult(_0x28bfc4,null))['catch'](handleError(_0x28bfc4,null));}});}catch(_0xee9345){_0x28bfc4[_0xb42c('0x1a')](0x1f4)[_0xb42c('0x2e')](_0xee9345);}};function removeReferences(_0x512108,_0x4d0ec4){try{if(_0x512108){fs['unlinkSync'](_0x512108);logger[_0xb42c('0x64')](_0xb42c('0x94'));}if(_0x4d0ec4){rimraf(_0x4d0ec4,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x53f44f){logger[_0xb42c('0x2b')](_0x53f44f);}}exports[_0xb42c('0x24')]=function(_0x72024b,_0x5ddb72,_0x1b3f22){return db['Plugin'][_0xb42c('0x4b')]({'where':{'id':_0x72024b[_0xb42c('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ddb72,null))[_0xb42c('0x25')](saveUpdates(_0x72024b[_0xb42c('0x8f')],null))[_0xb42c('0x25')](respondWithResult(_0x5ddb72,null))[_0xb42c('0x4a')](handleError(_0x5ddb72,null));};exports[_0xb42c('0x95')]=function(_0x1f674c,_0x461b96,_0x234965){return db[_0xb42c('0x30')]['find']({'where':{'id':_0x1f674c[_0xb42c('0x47')]['id']}})[_0xb42c('0x25')](function(_0x1d4641){if(_0x1d4641){return _0x1d4641['destroy']();}})[_0xb42c('0x25')](function(_0x5f156c){rimraf(path['join'](config['root'],'server/files/plugins',path[_0xb42c('0x5b')](_0x5f156c[_0xb42c('0x6')])),function(){});return _0x5f156c;})['then'](handleEntityNotFound(_0x461b96,null))[_0xb42c('0x25')](respondWithStatusCode(_0x461b96,null))['catch'](handleError(_0x461b96,null));};exports[_0xb42c('0x96')]=function(_0x575192,_0x322c94,_0x4f4d00){return BPromise[_0xb42c('0x97')]()[_0xb42c('0x25')](function(){if(!_0x575192[_0xb42c('0x34')][_0xb42c('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x575192[_0xb42c('0x34')]['port']){throw new Error(_0xb42c('0x98'));}var _0x313a85=_0x575192[_0xb42c('0x34')]['hostname']?_0x575192[_0xb42c('0x34')][_0xb42c('0x99')]+':'+_0x575192['query'][_0xb42c('0x9a')]:_0xb42c('0x9b')+_0x575192[_0xb42c('0x34')][_0xb42c('0x9a')];var _0x436167=_0x575192[_0xb42c('0x34')][_0xb42c('0x1b')]?_0x575192[_0xb42c('0x34')]['json']:!![];var _0x4a2a5d=_0x575192[_0xb42c('0x34')][_0xb42c('0x9c')]?_0x575192['query'][_0xb42c('0x9c')]:null;var _0x1f1a7e={'method':_0x575192[_0xb42c('0x9d')],'uri':util['format'](_0xb42c('0x9e'),_0x313a85,_0x575192[_0xb42c('0x34')][_0xb42c('0x6')]),'json':_0x436167,'resolveWithFullResponse':!![],'encoding':_0x4a2a5d,'qs':_0x575192[_0xb42c('0x34')]};if(_0x575192[_0xb42c('0x9f')]){_0x1f1a7e[_0xb42c('0x9f')]=_0x575192[_0xb42c('0x9f')];if(_0x1f1a7e[_0xb42c('0x9f')][_0xb42c('0xa0')]){delete _0x1f1a7e['headers']['content-length'];}}return rp(_0x1f1a7e);})[_0xb42c('0x25')](function(_0x13a522){if(_0x13a522){_0x322c94[_0xb42c('0x1f')](_0x13a522[_0xb42c('0x9f')]);logger[_0xb42c('0x64')](_0x13a522[_0xb42c('0x8f')]);if(_[_0xb42c('0xa1')](_0x575192['query'][_0xb42c('0x6')],_0xb42c('0xa2'))&&_0x13a522['statusCode']==0x1f4){return _0x322c94[_0xb42c('0x2a')](_0x13a522[_0xb42c('0xa3')]);}else{return _0x322c94[_0xb42c('0x1a')](_0x13a522['statusCode'])[_0xb42c('0x2e')](_0x13a522[_0xb42c('0x8f')]);}}else{return _0x322c94['sendStatus'](0xc8);}})['catch'](handleError(_0x322c94,null));};exports['webhookPost']=function(_0x554d7f,_0x5404a9,_0x247bf7){return BPromise[_0xb42c('0x97')]()['then'](function(){if(!_0x554d7f[_0xb42c('0x34')]['path']){throw new Error(_0xb42c('0xa4'));}if(!_0x554d7f[_0xb42c('0x34')][_0xb42c('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x46f47b=_0x554d7f[_0xb42c('0x34')]['hostname']?_0x554d7f[_0xb42c('0x34')][_0xb42c('0x99')]+':'+_0x554d7f['query'][_0xb42c('0x9a')]:_0xb42c('0x9b')+_0x554d7f['query'][_0xb42c('0x9a')];var _0x1522fa=_0x554d7f[_0xb42c('0x34')]['json']?_0x554d7f[_0xb42c('0x34')][_0xb42c('0x1b')]:!![];var _0xba815d=_0x554d7f[_0xb42c('0x34')]['encoding']?_0x554d7f['query'][_0xb42c('0x9c')]:null;var _0x1f86a8={'method':_0x554d7f['method'],'uri':util['format'](_0xb42c('0x9e'),_0x46f47b,_0x554d7f[_0xb42c('0x34')]['path']),'json':_0x1522fa,'resolveWithFullResponse':!![],'encoding':_0xba815d,'body':_0x554d7f[_0xb42c('0x8f')]};if(_0x554d7f[_0xb42c('0x9f')]){_0x1f86a8[_0xb42c('0x9f')]=_0x554d7f[_0xb42c('0x9f')];if(_0x1f86a8[_0xb42c('0x9f')][_0xb42c('0xa0')]){delete _0x1f86a8['headers'][_0xb42c('0xa0')];}}return rp(_0x1f86a8);})[_0xb42c('0x25')](function(_0x198d8c){if(_0x198d8c){_0x5404a9[_0xb42c('0x1f')](_0x198d8c[_0xb42c('0x9f')]);logger[_0xb42c('0x64')](_0x198d8c[_0xb42c('0x8f')]);return _0x5404a9[_0xb42c('0x1a')](_0x198d8c[_0xb42c('0xa3')])[_0xb42c('0x2e')](_0x198d8c[_0xb42c('0x8f')]);}else{return _0x5404a9[_0xb42c('0x2a')](0xc8);}})['catch'](handleError(_0x5404a9,null));}; \ No newline at end of file +var _0x2f73=['../../config/logger','../../mysqldb','redis','defaults','localhost','./plugin.socket','status','end','json','offset','limit','set','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','Plugin','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filters','pick','merge','map','VIRTUAL','field','filter','options','count','include','findAll','rows','params','length','includeAll','catch','download','find','server/files/plugins','format','%s.zip','createWriteStream','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','root','dirname','join','basename','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','type','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','scriptPath','body','role','userProfileId','user','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','extract-zip','../../components/parsers/qs'];(function(_0x2a7d76,_0x5be52e){var _0x170f41=function(_0x72e3bc){while(--_0x72e3bc){_0x2a7d76['push'](_0x2a7d76['shift']());}};_0x170f41(++_0x5be52e);}(_0x2f73,0x8c));var _0x32f7=function(_0x110292,_0x30298d){_0x110292=_0x110292-0x0;var _0xf334df=_0x2f73[_0x110292];return _0xf334df;};'use strict';var pdf=require(_0x32f7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x32f7('0x1'));var zipdir=require(_0x32f7('0x2'));var jsonpatch=require(_0x32f7('0x3'));var rp=require(_0x32f7('0x4'));var moment=require(_0x32f7('0x5'));var BPromise=require(_0x32f7('0x6'));var Mustache=require(_0x32f7('0x7'));var util=require('util');var path=require(_0x32f7('0x8'));var sox=require(_0x32f7('0x9'));var csv=require('to-csv');var ejs=require(_0x32f7('0xa'));var fs=require('fs');var _=require(_0x32f7('0xb'));var squel=require(_0x32f7('0xc'));var crypto=require(_0x32f7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x32f7('0xe'));var querystring=require(_0x32f7('0xf'));var Papa=require(_0x32f7('0x10'));var authService=require(_0x32f7('0x11'));var hardwareService=require(_0x32f7('0x12'));var Redis=require('ioredis');var extract=require(_0x32f7('0x13'));var rimraf=require('rimraf');var archiver=require('archiver');var qs=require(_0x32f7('0x14'));var logger=require(_0x32f7('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x32f7('0x16'))['db'];config[_0x32f7('0x17')]=_[_0x32f7('0x18')](config[_0x32f7('0x17')],{'host':_0x32f7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32f7('0x17')]));require(_0x32f7('0x1a'))['register'](socket);function respondWithStatusCode(_0x2caa19,_0x4e73dd){_0x4e73dd=_0x4e73dd||0xcc;return function(_0x54a7f8){if(_0x54a7f8){return _0x2caa19['sendStatus'](_0x4e73dd);}return _0x2caa19[_0x32f7('0x1b')](_0x4e73dd)[_0x32f7('0x1c')]();};}function respondWithResult(_0x5730f4,_0x179870){_0x179870=_0x179870||0xc8;return function(_0x5b7c25){if(_0x5b7c25){return _0x5730f4[_0x32f7('0x1b')](_0x179870)[_0x32f7('0x1d')](_0x5b7c25);}};}function respondWithFilteredResult(_0x311dd4,_0x2458c3){return function(_0x261451){if(_0x261451){var _0x274cab=_0x261451['count'],_0x3512f7=_0x2458c3[_0x32f7('0x1e')],_0x4d6583=_0x2458c3[_0x32f7('0x1e')]+_0x2458c3[_0x32f7('0x1f')],_0x3e7151;if(_0x4d6583>=_0x274cab){_0x4d6583=_0x274cab;_0x3e7151=0xc8;}else{_0x3e7151=0xce;}_0x311dd4[_0x32f7('0x1b')](_0x3e7151);return _0x311dd4[_0x32f7('0x20')]('Content-Range',_0x3512f7+'-'+_0x4d6583+'/'+_0x274cab)[_0x32f7('0x1d')](_0x261451);}return null;};}function patchUpdates(_0x1db777){return function(_0x160bad){try{jsonpatch[_0x32f7('0x21')](_0x160bad,_0x1db777,!![]);}catch(_0x9544e6){return BPromise[_0x32f7('0x22')](_0x9544e6);}return _0x160bad[_0x32f7('0x23')]();};}function saveUpdates(_0x315543,_0x4e7d9b){return function(_0xd69574){if(_0xd69574){return _0xd69574[_0x32f7('0x24')](_0x315543)['then'](function(_0x5b7a68){return _0x5b7a68;});}return null;};}function removeEntity(_0x2744a9,_0x307271){return function(_0x50f8b4){if(_0x50f8b4){return _0x50f8b4[_0x32f7('0x25')]()[_0x32f7('0x26')](function(){var _0x5efb12=_0x50f8b4[_0x32f7('0x27')]({'plain':!![]});var _0x5d0f57='Plugins';return db[_0x32f7('0x28')][_0x32f7('0x25')]({'where':{'type':_0x5d0f57,'resourceId':_0x5efb12['id']}})[_0x32f7('0x26')](function(){return _0x50f8b4;});})[_0x32f7('0x26')](function(){_0x2744a9['status'](0xcc)[_0x32f7('0x1c')]();});}};}function handleEntityNotFound(_0x55fd39,_0x9212ee){return function(_0x251f3b){if(!_0x251f3b){_0x55fd39[_0x32f7('0x29')](0x194);}return _0x251f3b;};}function handleError(_0x5a89c0,_0x56291f){_0x56291f=_0x56291f||0x1f4;return function(_0x4ab188){logger[_0x32f7('0x2a')](_0x4ab188[_0x32f7('0x2b')]);if(_0x4ab188[_0x32f7('0x2c')]){delete _0x4ab188[_0x32f7('0x2c')];}_0x5a89c0[_0x32f7('0x1b')](_0x56291f)[_0x32f7('0x2d')](_0x4ab188);};}exports['index']=function(_0x42f866,_0x51f214){var _0x442bdd={},_0xaba3eb={},_0xee0c77={'count':0x0,'rows':[]};var _0x6922de=db[_0x32f7('0x2e')][_0x32f7('0x2f')];_0xaba3eb[_0x32f7('0x30')]=_[_0x32f7('0x31')](_0x6922de);_0xaba3eb[_0x32f7('0x32')]=_[_0x32f7('0x31')](_0x42f866[_0x32f7('0x32')]);_0xaba3eb['filters']=_['intersection'](_0xaba3eb[_0x32f7('0x30')],_0xaba3eb[_0x32f7('0x32')]);_0x442bdd[_0x32f7('0x33')]=_[_0x32f7('0x34')](_0xaba3eb['model'],qs[_0x32f7('0x35')](_0x42f866[_0x32f7('0x32')][_0x32f7('0x35')]));_0x442bdd[_0x32f7('0x33')]=_0x442bdd[_0x32f7('0x33')]['length']?_0x442bdd['attributes']:_0xaba3eb[_0x32f7('0x30')];if(!_0x42f866['query'][_0x32f7('0x36')](_0x32f7('0x37'))){_0x442bdd[_0x32f7('0x1f')]=qs['limit'](_0x42f866[_0x32f7('0x32')]['limit']);_0x442bdd['offset']=qs[_0x32f7('0x1e')](_0x42f866[_0x32f7('0x32')][_0x32f7('0x1e')]);}_0x442bdd[_0x32f7('0x38')]=qs['sort'](_0x42f866[_0x32f7('0x32')]['sort']);_0x442bdd[_0x32f7('0x39')]=qs[_0x32f7('0x3a')](_[_0x32f7('0x3b')](_0x42f866[_0x32f7('0x32')],_0xaba3eb[_0x32f7('0x3a')]));if(_0x42f866[_0x32f7('0x32')]['filter']){_0x442bdd['where']=_[_0x32f7('0x3c')](_0x442bdd['where'],{'$or':_[_0x32f7('0x3d')](_0x6922de,function(_0x9a90cf){if(_0x9a90cf['type']['key']!==_0x32f7('0x3e')){var _0x5c6b26={};_0x5c6b26[_0x9a90cf[_0x32f7('0x3f')]]={'$like':'%'+_0x42f866[_0x32f7('0x32')][_0x32f7('0x40')]+'%'};return _0x5c6b26;}})});}_0x442bdd=_[_0x32f7('0x3c')]({},_0x442bdd,_0x42f866[_0x32f7('0x41')]);var _0x29830a={'where':_0x442bdd[_0x32f7('0x39')]};return db[_0x32f7('0x2e')]['count'](_0x29830a)[_0x32f7('0x26')](function(_0x4dc61e){_0xee0c77[_0x32f7('0x42')]=_0x4dc61e;if(_0x42f866[_0x32f7('0x32')]['includeAll']){_0x442bdd[_0x32f7('0x43')]=[{'all':!![]}];}return db['Plugin'][_0x32f7('0x44')](_0x442bdd);})['then'](function(_0x22bbab){_0xee0c77[_0x32f7('0x45')]=_0x22bbab;return _0xee0c77;})['then'](respondWithFilteredResult(_0x51f214,_0x442bdd))['catch'](handleError(_0x51f214,null));};exports['show']=function(_0x3f0b3f,_0x3f69a9){var _0x204eb5={'raw':!![],'where':{'id':_0x3f0b3f[_0x32f7('0x46')]['id']}},_0x360d55={};_0x360d55[_0x32f7('0x30')]=_[_0x32f7('0x31')](db[_0x32f7('0x2e')][_0x32f7('0x2f')]);_0x360d55[_0x32f7('0x32')]=_[_0x32f7('0x31')](_0x3f0b3f[_0x32f7('0x32')]);_0x360d55[_0x32f7('0x3a')]=_[_0x32f7('0x34')](_0x360d55[_0x32f7('0x30')],_0x360d55['query']);_0x204eb5['attributes']=_[_0x32f7('0x34')](_0x360d55['model'],qs[_0x32f7('0x35')](_0x3f0b3f[_0x32f7('0x32')]['fields']));_0x204eb5[_0x32f7('0x33')]=_0x204eb5[_0x32f7('0x33')][_0x32f7('0x47')]?_0x204eb5[_0x32f7('0x33')]:_0x360d55[_0x32f7('0x30')];if(_0x3f0b3f[_0x32f7('0x32')][_0x32f7('0x48')]){_0x204eb5['include']=[{'all':!![]}];}_0x204eb5=_[_0x32f7('0x3c')]({},_0x204eb5,_0x3f0b3f['options']);return db['Plugin']['find'](_0x204eb5)['then'](handleEntityNotFound(_0x3f69a9,null))[_0x32f7('0x26')](respondWithResult(_0x3f69a9,null))[_0x32f7('0x49')](handleError(_0x3f69a9,null));};exports[_0x32f7('0x4a')]=function(_0x3cd98d,_0x68b872,_0x3754bf){return db[_0x32f7('0x2e')][_0x32f7('0x4b')]({'where':{'id':_0x3cd98d['params']['id']},'attributes':[_0x32f7('0x2c'),'path'],'raw':!![]})[_0x32f7('0x26')](handleEntityNotFound(_0x68b872,null))[_0x32f7('0x26')](function(_0x4c367a){if(_0x4c367a){var _0x51bad0=path['join'](config['root'],_0x32f7('0x4c'),util[_0x32f7('0x4d')](_0x32f7('0x4e'),path['basename'](_0x4c367a['path'])));var _0x42c578=fs[_0x32f7('0x4f')](_0x51bad0);var _0x106219=archiver('zip',{'zlib':{'level':0x9}});_0x106219['on']('warning',function(_0x4027c1){if(_0x4027c1[_0x32f7('0x50')]===_0x32f7('0x51')){logger[_0x32f7('0x2a')](_0x4027c1);}else{throw new db[(_0x32f7('0x52'))][(_0x32f7('0x53'))](_0x32f7('0x54'));}});_0x106219['on'](_0x32f7('0x2a'),function(_0x44cb31){throw new db[(_0x32f7('0x52'))]['Error'](_0x32f7('0x54'));});_0x106219[_0x32f7('0x55')](_0x42c578);_0x106219[_0x32f7('0x56')]('**/*',{'cwd':path['join'](config[_0x32f7('0x57')],_0x32f7('0x4c'),path[_0x32f7('0x58')](_0x4c367a['path'])),'ignore':[path[_0x32f7('0x59')](path[_0x32f7('0x5a')](_0x4c367a[_0x32f7('0x8')]),_0x32f7('0x5b')),path[_0x32f7('0x59')](path[_0x32f7('0x5a')](_0x4c367a[_0x32f7('0x8')]),_0x32f7('0x5c'))],'nodir':!![]})['finalize']();_0x42c578['on'](_0x32f7('0x5d'),function(){if(!fs[_0x32f7('0x5e')](_0x51bad0)){throw new db[(_0x32f7('0x52'))][(_0x32f7('0x53'))](_0x32f7('0x5f'));}return _0x68b872[_0x32f7('0x4a')](_0x51bad0,util['format'](_0x32f7('0x4e'),path[_0x32f7('0x5a')](_0x4c367a['path'])),function(_0x4cc875){if(_0x4cc875){throw new db[(_0x32f7('0x52'))]['Error'](_0x32f7('0x60'));}fs['unlinkSync'](_0x51bad0);logger[_0x32f7('0x61')]('Download\x20completed');logger[_0x32f7('0x61')](_0x32f7('0x62'));});});}return null;})[_0x32f7('0x49')](handleError(_0x68b872,null));};exports[_0x32f7('0x63')]=function(_0x264455,_0x3524bc,_0x4bfa51){var _0x16253b=path['basename'](_0x264455[_0x32f7('0x64')][_0x32f7('0x65')],path['extname'](_0x264455[_0x32f7('0x64')][_0x32f7('0x65')]));var _0x517799=path[_0x32f7('0x59')](config[_0x32f7('0x57')],_0x32f7('0x4c'),_0x264455[_0x32f7('0x64')][_0x32f7('0x65')]);var _0x5e0556=path[_0x32f7('0x59')](config[_0x32f7('0x57')],'server/files/plugins',_0x16253b);logger[_0x32f7('0x61')]('Plugin\x20upload\x20filepath:\x20%s',_0x517799);logger[_0x32f7('0x61')](_0x32f7('0x66'),_0x5e0556);try{fs[_0x32f7('0x67')](_0x517799,parseInt(_0x32f7('0x68'),0x8));extract(_0x517799,{'dir':_0x5e0556},function(_0x5dfa14){if(_0x5dfa14){logger['error'](_0x5dfa14);handleError(_0x5dfa14,!![]);};var _0x3102b4=fs[_0x32f7('0x69')](_0x5e0556);if(_0x3102b4[_0x32f7('0x47')]>0x1){removeReferences(_0x517799,_0x5e0556);logger[_0x32f7('0x2a')](_0x32f7('0x6a'));return _0x4bfa51(new Error('Invalid\x20plugin\x20structure'));}var _0x1f2ba7=fs['lstatSync'](path['join'](_0x5e0556,_0x3102b4[0x0]));if(_0x1f2ba7[_0x32f7('0x6b')]()){removeReferences(_0x517799,_0x5e0556);logger[_0x32f7('0x2a')](_0x32f7('0x6a'));return _0x4bfa51(new Error(_0x32f7('0x6a')));}if(_0x1f2ba7[_0x32f7('0x6c')]()){var _0x4d4a67=fs[_0x32f7('0x69')](path[_0x32f7('0x59')](_0x5e0556,_0x3102b4[0x0]));if(_0x4d4a67[_0x32f7('0x47')]===0x0){removeReferences(_0x517799,_0x5e0556);logger[_0x32f7('0x2a')](_0x32f7('0x6a'));return _0x4bfa51(new Error('Invalid\x20plugin\x20structure'));}var _0x508483=_0x4d4a67['some'](function(_0x529fc5){return _0x529fc5==='manifest.json';});if(!_0x508483){return _0x4bfa51(new Error(_0x32f7('0x6d')));}var _0xba554=fs['readFileSync'](path['join'](_0x5e0556,_0x3102b4[0x0],'manifest.json'));var _0x55ed36=JSON[_0x32f7('0x6e')](_0xba554);if(_0x32f7('0x6f')==typeof _0x55ed36[_0x32f7('0x2c')]){return _0x4bfa51(new Error(_0x32f7('0x70')));}if(_0x32f7('0x6f')==typeof _0x55ed36['type']){return _0x4bfa51(new Error(_0x32f7('0x71')));}if('undefined'==typeof _0x55ed36['version']){return _0x4bfa51(new Error(_0x32f7('0x72')));}if(_0x32f7('0x6f')==typeof _0x55ed36[_0x32f7('0x73')]){return _0x4bfa51(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x55ed36[_0x32f7('0x74')]===_0x32f7('0x75')){if(_0x32f7('0x6f')==typeof _0x55ed36[_0x32f7('0x73')][_0x32f7('0x76')]){return _0x4bfa51(new Error(_0x32f7('0x77')));}if(_0x32f7('0x6f')==typeof _0x55ed36[_0x32f7('0x73')][_0x32f7('0x76')][_0x32f7('0x78')]&&_0x32f7('0x6f')==typeof _0x55ed36[_0x32f7('0x73')][_0x32f7('0x76')][_0x32f7('0x79')]){return _0x4bfa51(new Error(_0x32f7('0x7a')));}}else if(_0x55ed36[_0x32f7('0x74')]===_0x32f7('0x7b')){if(_0x32f7('0x6f')==typeof _0x55ed36[_0x32f7('0x73')]['scriptName']){return _0x4bfa51(new Error(_0x32f7('0x7c')));}if('undefined'==typeof _0x55ed36[_0x32f7('0x73')]['scriptPath']){return _0x4bfa51(new Error(_0x32f7('0x7d')));}}else{return _0x4bfa51(new Error(_0x32f7('0x7e')));}var _0x1c2be5=_0x55ed36[_0x32f7('0x2c')];var _0x5b978e=_0x55ed36[_0x32f7('0x7f')];var _0x19d182=_0x55ed36[_0x32f7('0x74')];var _0x5f468d=_0x55ed36[_0x32f7('0x80')]?_0x55ed36[_0x32f7('0x80')]:'always';var _0x13a28c=_0x55ed36[_0x32f7('0x81')]?_0x55ed36['icon']:_0x32f7('0x82');var _0x32d0a8='';var _0x4272f8='';var _0x44f0a4='';var _0x442244='';var _0x60dde6=_0x55ed36[_0x32f7('0x83')];if(_0x19d182===_0x32f7('0x75')){if(_0x32f7('0x6f')!=typeof _0x55ed36[_0x32f7('0x73')]['views'][_0x32f7('0x78')]){var _0x5e2351=_0x55ed36[_0x32f7('0x73')][_0x32f7('0x76')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x32f7('0x84')](_0x5e2351)){_0x32d0a8=path[_0x32f7('0x59')](_0x32f7('0x85'),_0x16253b,_0x3102b4[0x0],_0x5e2351);}else{_0x32d0a8=_0x5e2351;}}else{logger[_0x32f7('0x61')](_0x32f7('0x86'));}if(_0x32f7('0x6f')!=typeof _0x55ed36[_0x32f7('0x73')][_0x32f7('0x76')][_0x32f7('0x79')]){var _0x5788cf=_0x55ed36['parameters'][_0x32f7('0x76')][_0x32f7('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x32f7('0x84')](_0x5788cf)){_0x4272f8=path[_0x32f7('0x59')](_0x32f7('0x85'),_0x16253b,_0x3102b4[0x0],_0x5788cf);}else{_0x4272f8=_0x5788cf;}}else{logger[_0x32f7('0x61')](_0x32f7('0x87'));}}else if(_0x19d182===_0x32f7('0x7b')){_0x44f0a4=_0x55ed36[_0x32f7('0x73')][_0x32f7('0x88')];_0x442244=_0x55ed36[_0x32f7('0x73')][_0x32f7('0x89')];if(_0x32f7('0x6f')!=typeof _0x55ed36[_0x32f7('0x73')][_0x32f7('0x76')]){if('undefined'!=typeof _0x55ed36[_0x32f7('0x73')][_0x32f7('0x76')][_0x32f7('0x78')]){var _0x5e2351=_0x55ed36[_0x32f7('0x73')][_0x32f7('0x76')][_0x32f7('0x78')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e2351)){_0x32d0a8=path[_0x32f7('0x59')](_0x32f7('0x85'),_0x16253b,_0x3102b4[0x0],_0x5e2351);}else{_0x32d0a8=_0x5e2351;}}if(_0x32f7('0x6f')!=typeof _0x55ed36['parameters'][_0x32f7('0x76')]['agent']){var _0x5788cf=_0x55ed36['parameters'][_0x32f7('0x76')][_0x32f7('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x32f7('0x84')](_0x5788cf)){_0x4272f8=path[_0x32f7('0x59')]('plugins',_0x16253b,_0x3102b4[0x0],_0x5788cf);}else{_0x4272f8=_0x5788cf;}}}}var _0x3179b9={'name':_0x1c2be5,'description':_0x5b978e,'path':path[_0x32f7('0x59')](_0x16253b,_0x3102b4[0x0]),'type':_0x19d182,'sidebar':_0x5f468d,'icon':_0x13a28c,'adminUrl':_0x32d0a8,'agentUrl':_0x4272f8,'scriptName':_0x44f0a4,'scriptPath':_0x442244,'version':_0x60dde6};removeReferences(_0x517799,null);return db[_0x32f7('0x2e')]['create'](_0x3179b9)[_0x32f7('0x26')](function(_0x517c2d){var _0x253f12={'role':_0x264455[_0x32f7('0x8a')][_0x32f7('0x8b')],'userProfileId':_0x264455['body'][_0x32f7('0x8c')]};if(!_0x253f12)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x253f12[_0x32f7('0x8b')]===_0x32f7('0x8d')){var _0x234740=_0x517c2d[_0x32f7('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x32f7('0x4b')]({'where':{'name':'Plugins','userProfileId':_0x253f12[_0x32f7('0x8c')]},'raw':!![]})[_0x32f7('0x26')](function(_0x152891){if(_0x152891&&_0x152891['autoAssociation']===0x0){return db['UserProfileResource'][_0x32f7('0x8e')]({'name':_0x234740[_0x32f7('0x2c')],'resourceId':_0x234740['id'],'type':_0x152891['name'],'sectionId':_0x152891['id']},{})[_0x32f7('0x26')](function(){return _0x517c2d;});}else{return _0x517c2d;}})['catch'](function(_0xe4d163){logger[_0x32f7('0x2a')](_0x32f7('0x8f'),_0xe4d163);throw _0xe4d163;});}return _0x517c2d;})[_0x32f7('0x26')](respondWithResult(_0x3524bc,null))[_0x32f7('0x49')](handleError(_0x3524bc,null));}});}catch(_0x44f8d6){_0x3524bc[_0x32f7('0x1b')](0x1f4)[_0x32f7('0x2d')](_0x44f8d6);}};function removeReferences(_0x3f8b64,_0x20436c){try{if(_0x3f8b64){fs[_0x32f7('0x90')](_0x3f8b64);logger[_0x32f7('0x61')]('Zip\x20archive\x20removed');}if(_0x20436c){rimraf(_0x20436c,function(){});logger['info'](_0x32f7('0x91'));}}catch(_0x163b98){logger[_0x32f7('0x2a')](_0x163b98);}}exports[_0x32f7('0x24')]=function(_0x312631,_0x580452,_0x47518b){return db[_0x32f7('0x2e')][_0x32f7('0x4b')]({'where':{'id':_0x312631[_0x32f7('0x46')]['id']}})[_0x32f7('0x26')](handleEntityNotFound(_0x580452,null))[_0x32f7('0x26')](saveUpdates(_0x312631['body'],null))[_0x32f7('0x26')](respondWithResult(_0x580452,null))[_0x32f7('0x49')](handleError(_0x580452,null));};exports['delete']=function(_0x3a7db5,_0x71bea5,_0x4bc40c){return db[_0x32f7('0x2e')]['find']({'where':{'id':_0x3a7db5[_0x32f7('0x46')]['id']}})[_0x32f7('0x26')](function(_0x207612){if(_0x207612){return _0x207612[_0x32f7('0x25')]();}})[_0x32f7('0x26')](function(_0x5468fd){rimraf(path['join'](config['root'],_0x32f7('0x4c'),path['dirname'](_0x5468fd['path'])),function(){});return _0x5468fd;})[_0x32f7('0x26')](handleEntityNotFound(_0x71bea5,null))[_0x32f7('0x26')](respondWithStatusCode(_0x71bea5,null))[_0x32f7('0x49')](handleError(_0x71bea5,null));};exports[_0x32f7('0x92')]=function(_0xcec83c,_0x352149,_0x22aec7){return BPromise[_0x32f7('0x93')]()[_0x32f7('0x26')](function(){if(!_0xcec83c['query'][_0x32f7('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xcec83c[_0x32f7('0x32')][_0x32f7('0x94')]){throw new Error(_0x32f7('0x95'));}var _0x319a14=_0xcec83c[_0x32f7('0x32')]['hostname']?_0xcec83c[_0x32f7('0x32')]['hostname']+':'+_0xcec83c[_0x32f7('0x32')]['port']:_0x32f7('0x96')+_0xcec83c[_0x32f7('0x32')][_0x32f7('0x94')];var _0x526898=_0xcec83c[_0x32f7('0x32')][_0x32f7('0x1d')]?_0xcec83c[_0x32f7('0x32')][_0x32f7('0x1d')]:!![];var _0x93aedf=_0xcec83c[_0x32f7('0x32')][_0x32f7('0x97')]?_0xcec83c[_0x32f7('0x32')][_0x32f7('0x97')]:null;var _0x36f2b5={'method':_0xcec83c[_0x32f7('0x98')],'uri':util[_0x32f7('0x4d')](_0x32f7('0x99'),_0x319a14,_0xcec83c['query'][_0x32f7('0x8')]),'json':_0x526898,'resolveWithFullResponse':!![],'encoding':_0x93aedf,'qs':_0xcec83c[_0x32f7('0x32')]};if(_0xcec83c[_0x32f7('0x9a')]){_0x36f2b5[_0x32f7('0x9a')]=_0xcec83c[_0x32f7('0x9a')];if(_0x36f2b5['headers'][_0x32f7('0x9b')]){delete _0x36f2b5['headers'][_0x32f7('0x9b')];}}return rp(_0x36f2b5);})[_0x32f7('0x26')](function(_0x268ac1){if(_0x268ac1){_0x352149[_0x32f7('0x20')](_0x268ac1[_0x32f7('0x9a')]);logger[_0x32f7('0x61')](_0x268ac1[_0x32f7('0x8a')]);if(_[_0x32f7('0x9c')](_0xcec83c[_0x32f7('0x32')]['path'],_0x32f7('0x4a'))&&_0x268ac1[_0x32f7('0x9d')]==0x1f4){return _0x352149[_0x32f7('0x29')](_0x268ac1[_0x32f7('0x9d')]);}else{return _0x352149['status'](_0x268ac1[_0x32f7('0x9d')])['send'](_0x268ac1[_0x32f7('0x8a')]);}}else{return _0x352149[_0x32f7('0x29')](0xc8);}})['catch'](handleError(_0x352149,null));};exports[_0x32f7('0x9e')]=function(_0x1e2b68,_0x3326f9,_0x1259a9){return BPromise['resolve']()[_0x32f7('0x26')](function(){if(!_0x1e2b68[_0x32f7('0x32')][_0x32f7('0x8')]){throw new Error(_0x32f7('0x9f'));}if(!_0x1e2b68[_0x32f7('0x32')][_0x32f7('0x94')]){throw new Error(_0x32f7('0x95'));}var _0x136671=_0x1e2b68[_0x32f7('0x32')][_0x32f7('0xa0')]?_0x1e2b68[_0x32f7('0x32')]['hostname']+':'+_0x1e2b68[_0x32f7('0x32')][_0x32f7('0x94')]:_0x32f7('0x96')+_0x1e2b68[_0x32f7('0x32')][_0x32f7('0x94')];var _0x5e8b7e=_0x1e2b68[_0x32f7('0x32')][_0x32f7('0x1d')]?_0x1e2b68['query']['json']:!![];var _0xf1fe83=_0x1e2b68[_0x32f7('0x32')][_0x32f7('0x97')]?_0x1e2b68['query']['encoding']:null;var _0x386ef8={'method':_0x1e2b68[_0x32f7('0x98')],'uri':util['format'](_0x32f7('0x99'),_0x136671,_0x1e2b68[_0x32f7('0x32')][_0x32f7('0x8')]),'json':_0x5e8b7e,'resolveWithFullResponse':!![],'encoding':_0xf1fe83,'body':_0x1e2b68['body']};if(_0x1e2b68[_0x32f7('0x9a')]){_0x386ef8[_0x32f7('0x9a')]=_0x1e2b68[_0x32f7('0x9a')];if(_0x386ef8[_0x32f7('0x9a')][_0x32f7('0x9b')]){delete _0x386ef8['headers'][_0x32f7('0x9b')];}}return rp(_0x386ef8);})['then'](function(_0x1d14c5){if(_0x1d14c5){_0x3326f9[_0x32f7('0x20')](_0x1d14c5[_0x32f7('0x9a')]);logger[_0x32f7('0x61')](_0x1d14c5[_0x32f7('0x8a')]);return _0x3326f9[_0x32f7('0x1b')](_0x1d14c5[_0x32f7('0x9d')])[_0x32f7('0x2d')](_0x1d14c5[_0x32f7('0x8a')]);}else{return _0x3326f9[_0x32f7('0x29')](0xc8);}})[_0x32f7('0x49')](handleError(_0x3326f9,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0d33285..9ec91b8 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 _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x163ddd,_0x47f051){var _0x146d93=function(_0xe6485a){while(--_0xe6485a){_0x163ddd['push'](_0x163ddd['shift']());}};_0x146d93(++_0x47f051);}(_0xb10b,0x12a));var _0xbb10=function(_0xf65bf8,_0x494a66){_0xf65bf8=_0xf65bf8-0x0;var _0x2e4a66=_0xb10b[_0xf65bf8];return _0x2e4a66;};'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 +var _0x7a54=['Plugin','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2c9842,_0x3e7bb2){var _0x7d6617=function(_0x4faef1){while(--_0x4faef1){_0x2c9842['push'](_0x2c9842['shift']());}};_0x7d6617(++_0x3e7bb2);}(_0x7a54,0x106));var _0x47a5=function(_0x2536d0,_0x1adbdf){_0x2536d0=_0x2536d0-0x0;var _0x428a33=_0x7a54[_0x2536d0];return _0x428a33;};'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 diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 89a31a2..f7c75a4 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 _0x1782=['Plugin','plugins','../../config/logger','api','moment','exports','define'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x1782,0xb1));var _0x2178=function(_0x1fd8a6,_0x31ccb9){_0x1fd8a6=_0x1fd8a6-0x0;var _0x4558f9=_0x1782[_0x1fd8a6];return _0x4558f9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2178('0x0'))(_0x2178('0x1'));var moment=require(_0x2178('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./plugin.attributes');module[_0x2178('0x3')]=function(_0x466ff1,_0x45dc45){return _0x466ff1[_0x2178('0x4')](_0x2178('0x5'),attributes,{'tableName':_0x2178('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa88b=['./plugin.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3da51c,_0x111dc2){var _0x10ac68=function(_0x198b11){while(--_0x198b11){_0x3da51c['push'](_0x3da51c['shift']());}};_0x10ac68(++_0x111dc2);}(_0xa88b,0x157));var _0xba88=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0xa88b[_0x29632e];return _0x426e04;};'use strict';var _=require(_0xba88('0x0'));var util=require(_0xba88('0x1'));var logger=require(_0xba88('0x2'))(_0xba88('0x3'));var moment=require(_0xba88('0x4'));var BPromise=require(_0xba88('0x5'));var rp=require(_0xba88('0x6'));var attributes=require(_0xba88('0x7'));module[_0xba88('0x8')]=function(_0x31323b,_0x643c7){return _0x31323b[_0xba88('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 1e36539..f100e7a 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 _0x3784=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreatePlugin','create','options','lodash'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x3784,0x13f));var _0x4378=function(_0x196071,_0x43112e){_0x196071=_0x196071-0x0;var _0x5be580=_0x3784[_0x196071];return _0x5be580;};'use strict';var _=require(_0x4378('0x0'));var util=require(_0x4378('0x1'));var moment=require(_0x4378('0x2'));var BPromise=require(_0x4378('0x3'));var rs=require(_0x4378('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4378('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4378('0x6'))(_0x4378('0x7'));var config=require(_0x4378('0x8'));var jayson=require(_0x4378('0x9'));var client=jayson[_0x4378('0xa')]['http']({'port':0x232a});config[_0x4378('0xb')]=_['defaults'](config[_0x4378('0xb')],{'host':_0x4378('0xc'),'port':0x18eb});var socket=require(_0x4378('0xd'))(new Redis(config[_0x4378('0xb')]));require(_0x4378('0xe'))[_0x4378('0xf')](socket);function respondWithRpcPromise(_0x8fbd0c,_0x36f24e,_0xb9ba7a){return new BPromise(function(_0x4936c9,_0x2adfd9){return client[_0x4378('0x10')](_0x8fbd0c,_0xb9ba7a)[_0x4378('0x11')](function(_0x3e2d71){logger['info'](_0x4378('0x12'),_0x36f24e,_0x4378('0x13'));logger[_0x4378('0x14')](_0x4378('0x15'),_0x36f24e,_0x4378('0x13'),JSON[_0x4378('0x16')](_0x3e2d71));if(_0x3e2d71['error']){if(_0x3e2d71[_0x4378('0x17')][_0x4378('0x18')]===0x1f4){logger[_0x4378('0x17')](_0x4378('0x12'),_0x36f24e,_0x3e2d71['error'][_0x4378('0x19')]);return _0x2adfd9(_0x3e2d71[_0x4378('0x17')][_0x4378('0x19')]);}logger[_0x4378('0x17')](_0x4378('0x12'),_0x36f24e,_0x3e2d71[_0x4378('0x17')][_0x4378('0x19')]);return _0x4936c9(_0x3e2d71[_0x4378('0x17')][_0x4378('0x19')]);}else{logger[_0x4378('0x1a')]('Plugin,\x20%s,\x20%s',_0x36f24e,_0x4378('0x13'));_0x4936c9(_0x3e2d71[_0x4378('0x1b')][_0x4378('0x19')]);}})[_0x4378('0x1c')](function(_0x48036d){logger[_0x4378('0x17')](_0x4378('0x12'),_0x36f24e,_0x48036d);_0x2adfd9(_0x48036d);});});}exports[_0x4378('0x1d')]=function(_0x5bab3d){var _0x47bb4e=this;return new Promise(function(_0x48074f,_0x52e2eb){return db['Plugin'][_0x4378('0x1e')](_0x5bab3d['body'],{'raw':_0x5bab3d[_0x4378('0x1f')]?_0x5bab3d[_0x4378('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x4378('0x11')](function(_0x57a301){logger[_0x4378('0x1a')](_0x4378('0x1d'),_0x5bab3d);logger[_0x4378('0x14')](_0x4378('0x1d'),_0x5bab3d,JSON[_0x4378('0x16')](_0x57a301));_0x48074f(_0x57a301);})['catch'](function(_0x4e2208){logger[_0x4378('0x17')](_0x4378('0x1d'),_0x4e2208[_0x4378('0x19')],_0x5bab3d);_0x52e2eb(_0x47bb4e[_0x4378('0x17')](0x1f4,_0x4e2208['message']));});});}; \ No newline at end of file +var _0xa7b3=['then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','body','options','raw','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./plugin.socket','register','request'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xa7b3,0xe9));var _0x3a7b=function(_0x617139,_0x25c524){_0x617139=_0x617139-0x0;var _0xed0ad4=_0xa7b3[_0x617139];return _0xed0ad4;};'use strict';var _=require(_0x3a7b('0x0'));var util=require(_0x3a7b('0x1'));var moment=require(_0x3a7b('0x2'));var BPromise=require(_0x3a7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a7b('0x5'));var config=require(_0x3a7b('0x6'));var jayson=require(_0x3a7b('0x7'));var client=jayson[_0x3a7b('0x8')]['http']({'port':0x232a});config[_0x3a7b('0x9')]=_[_0x3a7b('0xa')](config[_0x3a7b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3a7b('0xb'))(new Redis(config[_0x3a7b('0x9')]));require(_0x3a7b('0xc'))[_0x3a7b('0xd')](socket);function respondWithRpcPromise(_0x473864,_0x73f3ce,_0x58ddd6){return new BPromise(function(_0x480e18,_0xe45c28){return client[_0x3a7b('0xe')](_0x473864,_0x58ddd6)[_0x3a7b('0xf')](function(_0x3e7616){logger[_0x3a7b('0x10')](_0x3a7b('0x11'),_0x73f3ce,_0x3a7b('0x12'));logger[_0x3a7b('0x13')](_0x3a7b('0x14'),_0x73f3ce,'request\x20sent',JSON[_0x3a7b('0x15')](_0x3e7616));if(_0x3e7616['error']){if(_0x3e7616[_0x3a7b('0x16')][_0x3a7b('0x17')]===0x1f4){logger['error'](_0x3a7b('0x11'),_0x73f3ce,_0x3e7616[_0x3a7b('0x16')]['message']);return _0xe45c28(_0x3e7616['error'][_0x3a7b('0x18')]);}logger[_0x3a7b('0x16')](_0x3a7b('0x11'),_0x73f3ce,_0x3e7616['error'][_0x3a7b('0x18')]);return _0x480e18(_0x3e7616[_0x3a7b('0x16')][_0x3a7b('0x18')]);}else{logger[_0x3a7b('0x10')](_0x3a7b('0x11'),_0x73f3ce,'request\x20sent');_0x480e18(_0x3e7616[_0x3a7b('0x19')]['message']);}})[_0x3a7b('0x1a')](function(_0x5467c2){logger['error'](_0x3a7b('0x11'),_0x73f3ce,_0x5467c2);_0xe45c28(_0x5467c2);});});}exports[_0x3a7b('0x1b')]=function(_0x58047d){var _0x5888a6=this;return new Promise(function(_0x1120af,_0x46824c){return db['Plugin']['create'](_0x58047d[_0x3a7b('0x1c')],{'raw':_0x58047d[_0x3a7b('0x1d')]?_0x58047d[_0x3a7b('0x1d')][_0x3a7b('0x1e')]===undefined?!![]:![]:!![]})[_0x3a7b('0xf')](function(_0xa5302a){logger['info'](_0x3a7b('0x1b'),_0x58047d);logger[_0x3a7b('0x13')]('CreatePlugin',_0x58047d,JSON[_0x3a7b('0x15')](_0xa5302a));_0x1120af(_0xa5302a);})[_0x3a7b('0x1a')](function(_0x1a75b8){logger[_0x3a7b('0x16')](_0x3a7b('0x1b'),_0x1a75b8[_0x3a7b('0x18')],_0x58047d);_0x46824c(_0x5888a6[_0x3a7b('0x16')](0x1f4,_0x1a75b8[_0x3a7b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 2392fa2..7915a77 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 _0x97f1=['plugin:','./plugin.events','remove','register','length'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0x97f1,0x1b4));var _0x197f=function(_0x472ac3,_0x1e0e15){_0x472ac3=_0x472ac3-0x0;var _0x21539c=_0x97f1[_0x472ac3];return _0x21539c;};'use strict';var PluginEvents=require(_0x197f('0x0'));var events=['save',_0x197f('0x1'),'update'];function createListener(_0x1986f6,_0x322062){return function(_0xf3c389){_0x322062['emit'](_0x1986f6,_0xf3c389);};}function removeListener(_0x395937,_0x57094b){return function(){PluginEvents['removeListener'](_0x395937,_0x57094b);};}exports[_0x197f('0x2')]=function(_0x5c37ff){for(var _0x3ee1dc=0x0,_0x2e8faf=events[_0x197f('0x3')];_0x3ee1dc<_0x2e8faf;_0x3ee1dc++){var _0x44628a=events[_0x3ee1dc];var _0x317eee=createListener(_0x197f('0x4')+_0x44628a,_0x5c37ff);PluginEvents['on'](_0x44628a,_0x317eee);}}; \ No newline at end of file +var _0x54d8=['length','plugin:','./plugin.events','remove','update','emit','removeListener'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x54d8,0x8e));var _0x854d=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x54d8[_0x255d5b];return _0x3e141a;};'use strict';var PluginEvents=require(_0x854d('0x0'));var events=['save',_0x854d('0x1'),_0x854d('0x2')];function createListener(_0x5cc6a4,_0x128517){return function(_0x2657c5){_0x128517[_0x854d('0x3')](_0x5cc6a4,_0x2657c5);};}function removeListener(_0x3cbd3d,_0x3dba36){return function(){PluginEvents[_0x854d('0x4')](_0x3cbd3d,_0x3dba36);};}exports['register']=function(_0x151410){for(var _0x356e1b=0x0,_0x159b9b=events[_0x854d('0x5')];_0x356e1b<_0x159b9b;_0x356e1b++){var _0x1e714e=events[_0x356e1b];var _0x5e4459=createListener(_0x854d('0x6')+_0x1e714e,_0x151410);PluginEvents['on'](_0x1e714e,_0x5e4459);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 9523d18..f86d720 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(_0x57ed94,_0x109a2a){var _0x404ceb=function(_0x32bca0){while(--_0x32bca0){_0x57ed94['push'](_0x57ed94['shift']());}};_0x404ceb(++_0x109a2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x4dd059,_0x10e631){var _0x886b52=function(_0x4b25bb){while(--_0x4b25bb){_0x4dd059['push'](_0x4dd059['shift']());}};_0x886b52(++_0x10e631);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 1db8b67..8c6402d 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 _0xf15b=['cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','status','send','npm\x20install','info','index','list','then','reject','name','express','motion2','show','describe','params','catch','create','body','script','join','../../files/plugins'];(function(_0x584e3e,_0x1b0ca1){var _0x5622fd=function(_0x4201d6){while(--_0x4201d6){_0x584e3e['push'](_0x584e3e['shift']());}};_0x5622fd(++_0x1b0ca1);}(_0xf15b,0x7f));var _0xbf15=function(_0x55933f,_0x33712b){_0x55933f=_0x55933f-0x0;var _0x588e8d=_0xf15b[_0x55933f];return _0x588e8d;};'use strict';var _=require(_0xbf15('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbf15('0x1'))(_0xbf15('0x2'));var path=require(_0xbf15('0x3'));var exec=require(_0xbf15('0x4'))[_0xbf15('0x5')];var BPromise=require(_0xbf15('0x6'));function handleEntityNotFound(_0x2f3542,_0x105221){return function(_0xeb8a3d){if(!_0xeb8a3d){_0x2f3542[_0xbf15('0x7')](0x194);;}return _0xeb8a3d;};}function respondWithResult(_0x501077,_0x4e2643){_0x4e2643=_0x4e2643||0xc8;return function(_0x5b46fa){if(_0x5b46fa){return _0x501077['status'](_0x4e2643)['json'](_0x5b46fa);}return null;};}function handleError(_0x220409,_0x2a54db){_0x2a54db=_0x2a54db||0x1f4;return function(_0x4e7d7f){logger[_0xbf15('0x8')](_0x4e7d7f['stack']);if(_0x4e7d7f['name']){delete _0x4e7d7f['name'];}_0x220409[_0xbf15('0x9')](_0x2a54db)[_0xbf15('0xa')](_0x4e7d7f);};}function execChildProcess(){return new BPromise(function(_0x3fc1db,_0x50c08c){exec(_0xbf15('0xb'),function(_0x54b1ef,_0x5769b9,_0xf1543e){logger[_0xbf15('0xc')](_0x5769b9);logger[_0xbf15('0xc')](_0xf1543e);if(_0x54b1ef){logger['error'](_0x54b1ef);return _0x50c08c(_0x54b1ef);}return _0x3fc1db(_0x5769b9);});});}exports[_0xbf15('0xd')]=function(_0x2bdcbf,_0x1db5f2){return pm2[_0xbf15('0xe')]()[_0xbf15('0xf')](function(_0x41bc6a){if(_0x41bc6a){var _0x412156=_[_0xbf15('0x10')](_0x41bc6a,function(_0x2f90e5){return _0x2f90e5[_0xbf15('0x11')]===_0xbf15('0x12')||_0x2f90e5[_0xbf15('0x11')]===_0xbf15('0x13');});return{'rows':_0x412156,'count':_0x412156['length']};}return null;})[_0xbf15('0xf')](respondWithResult(_0x1db5f2,null))['catch'](handleError(_0x1db5f2,null));};exports[_0xbf15('0x14')]=function(_0x18f862,_0x4fe053){return pm2[_0xbf15('0x15')](_0x18f862[_0xbf15('0x16')]['id'])[_0xbf15('0xf')](respondWithResult(_0x4fe053,null))['then'](handleEntityNotFound(_0x4fe053,null))[_0xbf15('0x17')](handleError(_0x4fe053,null));};exports[_0xbf15('0x18')]=function(_0xf7918e,_0x33b169){if(_0xf7918e[_0xbf15('0x19')][_0xbf15('0x11')]&&_0xf7918e['body'][_0xbf15('0x1a')]){var _0x2319c1=path[_0xbf15('0x1b')](__dirname,_0xbf15('0x1c'),_0xf7918e['body'][_0xbf15('0x1a')]);var _0x57431d=process[_0xbf15('0x1d')]();process[_0xbf15('0x1e')](path[_0xbf15('0x1f')](_0x2319c1));return execChildProcess()['then'](function(_0x471244){process[_0xbf15('0x1e')](_0x57431d);return pm2[_0xbf15('0x20')]({'name':_0xf7918e[_0xbf15('0x19')][_0xbf15('0x11')],'script':_0x2319c1});})['then'](function(_0x8fa2cd){pm2[_0xbf15('0x21')]();return _0x8fa2cd[0x0];})[_0xbf15('0xf')](respondWithResult(_0x33b169,0xc9))[_0xbf15('0x17')](handleError(_0x33b169,null));}else{return _0x33b169[_0xbf15('0x9')](0x1f4)[_0xbf15('0xa')]({'message':_0xbf15('0x22')});}};exports[_0xbf15('0x23')]=function(_0x39318b,_0x4d237e){if(_0x39318b[_0xbf15('0x19')]['id']){delete _0x39318b[_0xbf15('0x19')]['id'];}var _0x2119ad={'online':_0xbf15('0x24'),'stopped':_0xbf15('0x25')};if(_0x2119ad[_0xbf15('0x26')](_0x39318b[_0xbf15('0x19')][_0xbf15('0x9')])){return pm2[_0x2119ad[_0x39318b[_0xbf15('0x19')][_0xbf15('0x9')]]](_0x39318b[_0xbf15('0x16')]['id'])['then'](respondWithResult(_0x4d237e,0xc8))[_0xbf15('0x17')](handleError(_0x4d237e,null));}else{return _0x4d237e[_0xbf15('0x9')](0x1f4)[_0xbf15('0xa')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0xf390e,_0x1a798f){if(_0xf390e[_0xbf15('0x19')]['id']){delete _0xf390e['body']['id'];}if(_0xf390e[_0xbf15('0x16')]['id']){return pm2['delete'](_0xf390e[_0xbf15('0x16')]['id'])[_0xbf15('0xf')](function(_0x1c48a1){pm2[_0xbf15('0x21')]();return _0x1c48a1[0x0];})['then'](respondWithResult(_0x1a798f,null))[_0xbf15('0x17')](handleError(_0x1a798f,null));}else{return _0x1a798f[_0xbf15('0x9')](0x1f4)[_0xbf15('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x5f83=['motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','restart','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','bluebird','sendStatus','json','stack','name','status','npm\x20install','info','error','list','then','reject'];(function(_0x5e2240,_0x5b593c){var _0x4afdf9=function(_0x137f2d){while(--_0x137f2d){_0x5e2240['push'](_0x5e2240['shift']());}};_0x4afdf9(++_0x5b593c);}(_0x5f83,0x8f));var _0x35f8=function(_0x41e228,_0x302353){_0x41e228=_0x41e228-0x0;var _0x83426b=_0x5f83[_0x41e228];return _0x83426b;};'use strict';var _=require(_0x35f8('0x0'));var pm2=require(_0x35f8('0x1'));var logger=require('../../config/logger')(_0x35f8('0x2'));var path=require(_0x35f8('0x3'));var exec=require(_0x35f8('0x4'))['exec'];var BPromise=require(_0x35f8('0x5'));function handleEntityNotFound(_0x1d2ecf,_0x452604){return function(_0x5296da){if(!_0x5296da){_0x1d2ecf[_0x35f8('0x6')](0x194);;}return _0x5296da;};}function respondWithResult(_0x4d0406,_0x3a2e31){_0x3a2e31=_0x3a2e31||0xc8;return function(_0x2d30dc){if(_0x2d30dc){return _0x4d0406['status'](_0x3a2e31)[_0x35f8('0x7')](_0x2d30dc);}return null;};}function handleError(_0x240c0b,_0x261c6c){_0x261c6c=_0x261c6c||0x1f4;return function(_0x580bc1){logger['error'](_0x580bc1[_0x35f8('0x8')]);if(_0x580bc1[_0x35f8('0x9')]){delete _0x580bc1[_0x35f8('0x9')];}_0x240c0b[_0x35f8('0xa')](_0x261c6c)['send'](_0x580bc1);};}function execChildProcess(){return new BPromise(function(_0x8c1352,_0x1dbc41){exec(_0x35f8('0xb'),function(_0x19b06b,_0x2476f5,_0x29e9fb){logger[_0x35f8('0xc')](_0x2476f5);logger['info'](_0x29e9fb);if(_0x19b06b){logger[_0x35f8('0xd')](_0x19b06b);return _0x1dbc41(_0x19b06b);}return _0x8c1352(_0x2476f5);});});}exports['index']=function(_0x15bde1,_0x37dfc5){return pm2[_0x35f8('0xe')]()[_0x35f8('0xf')](function(_0x305b57){if(_0x305b57){var _0x1b512c=_[_0x35f8('0x10')](_0x305b57,function(_0x3bfbf0){return _0x3bfbf0[_0x35f8('0x9')]==='express'||_0x3bfbf0['name']===_0x35f8('0x11');});return{'rows':_0x1b512c,'count':_0x1b512c[_0x35f8('0x12')]};}return null;})[_0x35f8('0xf')](respondWithResult(_0x37dfc5,null))[_0x35f8('0x13')](handleError(_0x37dfc5,null));};exports[_0x35f8('0x14')]=function(_0x385b01,_0x317897){return pm2[_0x35f8('0x15')](_0x385b01['params']['id'])['then'](respondWithResult(_0x317897,null))[_0x35f8('0xf')](handleEntityNotFound(_0x317897,null))['catch'](handleError(_0x317897,null));};exports[_0x35f8('0x16')]=function(_0x59d37f,_0x392e40){if(_0x59d37f[_0x35f8('0x17')][_0x35f8('0x9')]&&_0x59d37f[_0x35f8('0x17')][_0x35f8('0x18')]){var _0x37fc3b=path[_0x35f8('0x19')](__dirname,_0x35f8('0x1a'),_0x59d37f['body']['script']);var _0x124776=process[_0x35f8('0x1b')]();process[_0x35f8('0x1c')](path[_0x35f8('0x1d')](_0x37fc3b));return execChildProcess()['then'](function(_0x24e48e){process[_0x35f8('0x1c')](_0x124776);return pm2[_0x35f8('0x1e')]({'name':_0x59d37f[_0x35f8('0x17')][_0x35f8('0x9')],'script':_0x37fc3b});})[_0x35f8('0xf')](function(_0x28dd2c){pm2[_0x35f8('0x1f')]();return _0x28dd2c[0x0];})[_0x35f8('0xf')](respondWithResult(_0x392e40,0xc9))[_0x35f8('0x13')](handleError(_0x392e40,null));}else{return _0x392e40[_0x35f8('0xa')](0x1f4)[_0x35f8('0x20')]({'message':_0x35f8('0x21')});}};exports['update']=function(_0x4d50dd,_0x597af7){if(_0x4d50dd[_0x35f8('0x17')]['id']){delete _0x4d50dd[_0x35f8('0x17')]['id'];}var _0x27c1a1={'online':_0x35f8('0x22'),'stopped':'stop'};if(_0x27c1a1['hasOwnProperty'](_0x4d50dd[_0x35f8('0x17')][_0x35f8('0xa')])){return pm2[_0x27c1a1[_0x4d50dd[_0x35f8('0x17')][_0x35f8('0xa')]]](_0x4d50dd[_0x35f8('0x23')]['id'])[_0x35f8('0xf')](respondWithResult(_0x597af7,0xc8))[_0x35f8('0x13')](handleError(_0x597af7,null));}else{return _0x597af7[_0x35f8('0xa')](0x1f4)[_0x35f8('0x20')]({'message':_0x35f8('0x24')});}};exports[_0x35f8('0x25')]=function(_0x5be791,_0x15d2c0){if(_0x5be791['body']['id']){delete _0x5be791[_0x35f8('0x17')]['id'];}if(_0x5be791[_0x35f8('0x23')]['id']){return pm2[_0x35f8('0x26')](_0x5be791[_0x35f8('0x23')]['id'])[_0x35f8('0xf')](function(_0xeb8dfc){pm2[_0x35f8('0x1f')]();return _0xeb8dfc[0x0];})[_0x35f8('0xf')](respondWithResult(_0x15d2c0,null))[_0x35f8('0x13')](handleError(_0x15d2c0,null));}else{return _0x15d2c0[_0x35f8('0xa')](0x1f4)[_0x35f8('0x20')]({'message':_0x35f8('0x27')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index b7d0999..fc201ed 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 _0x7676=['path','express','../../components/interaction/service','exports','multer','util'];(function(_0xb9e2bc,_0x1bb304){var _0x5cddae=function(_0x6a282e){while(--_0x6a282e){_0xb9e2bc['push'](_0xb9e2bc['shift']());}};_0x5cddae(++_0x1bb304);}(_0x7676,0xb8));var _0x6767=function(_0x302d2d,_0x539406){_0x302d2d=_0x302d2d-0x0;var _0x4c60c7=_0x7676[_0x302d2d];return _0x4c60c7;};'use strict';var multer=require(_0x6767('0x0'));var util=require(_0x6767('0x1'));var path=require(_0x6767('0x2'));var timeout=require('connect-timeout');var express=require(_0x6767('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6767('0x4'));var config=require('../../config/environment');module[_0x6767('0x5')]=router; \ No newline at end of file +var _0x15b2=['../../components/interaction/service','../../config/environment','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x3fbc6a,_0x1f1133){var _0x524a7c=function(_0x5d25c8){while(--_0x5d25c8){_0x3fbc6a['push'](_0x3fbc6a['shift']());}};_0x524a7c(++_0x1f1133);}(_0x15b2,0x145));var _0x215b=function(_0x1cfdcd,_0x1e2fbd){_0x1cfdcd=_0x1cfdcd-0x0;var _0x1ee13a=_0x15b2[_0x1cfdcd];return _0x1ee13a;};'use strict';var multer=require('multer');var util=require(_0x215b('0x0'));var path=require('path');var timeout=require(_0x215b('0x1'));var express=require(_0x215b('0x2'));var router=express['Router']();var auth=require(_0x215b('0x3'));var interaction=require(_0x215b('0x4'));var config=require(_0x215b('0x5'));module[_0x215b('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 94a0882..883a9e3 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 _0x700c=['exports','INTEGER','STRING','DATE'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x700c,0x16c));var _0xc700=function(_0x56b794,_0x50003f){_0x56b794=_0x56b794-0x0;var _0x80c80=_0x700c[_0x56b794];return _0x80c80;};'use strict';var Sequelize=require('sequelize');module[_0xc700('0x0')]={'state':{'type':Sequelize[_0xc700('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc700('0x2')]},'scheduledat':{'type':Sequelize[_0xc700('0x3')]},'uniqueid':{'type':Sequelize[_0xc700('0x2')]},'starttime':{'type':Sequelize[_0xc700('0x3')]},'responsetime':{'type':Sequelize[_0xc700('0x3')]},'ringtime':{'type':Sequelize[_0xc700('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc700('0x2')]},'campaigntype':{'type':Sequelize[_0xc700('0x2')]},'membername':{'type':Sequelize[_0xc700('0x2')]}}; \ No newline at end of file +var _0x7683=['STRING','DATE','sequelize','exports'];(function(_0x1507a4,_0x46d753){var _0x573866=function(_0x101738){while(--_0x101738){_0x1507a4['push'](_0x1507a4['shift']());}};_0x573866(++_0x46d753);}(_0x7683,0x1a6));var _0x3768=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0x7683[_0x52f159];return _0x156799;};'use strict';var Sequelize=require(_0x3768('0x0'));module[_0x3768('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3768('0x2')]},'scheduledat':{'type':Sequelize[_0x3768('0x3')]},'uniqueid':{'type':Sequelize[_0x3768('0x2')]},'starttime':{'type':Sequelize[_0x3768('0x3')]},'responsetime':{'type':Sequelize[_0x3768('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3768('0x2')]},'campaigntype':{'type':Sequelize[_0x3768('0x2')]},'membername':{'type':Sequelize[_0x3768('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b55dc6f..1707165 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 _0xb064=['lodash','util','../../config/logger','request-promise','exports','define','ReportAgentPreview'];(function(_0x388933,_0x13eee6){var _0x66ef4d=function(_0x365f87){while(--_0x365f87){_0x388933['push'](_0x388933['shift']());}};_0x66ef4d(++_0x13eee6);}(_0xb064,0x69));var _0x4b06=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb064[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x4b06('0x0'));var util=require(_0x4b06('0x1'));var logger=require(_0x4b06('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b06('0x3'));var attributes=require('./reportAgentPreview.attributes');module[_0x4b06('0x4')]=function(_0x4bc315,_0x26bcaf){return _0x4bc315[_0x4b06('0x5')](_0x4b06('0x6'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e08=['exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger','request-promise','./reportAgentPreview.attributes'];(function(_0x37b9b5,_0xc36e5a){var _0x29ada3=function(_0x1b4e7f){while(--_0x1b4e7f){_0x37b9b5['push'](_0x37b9b5['shift']());}};_0x29ada3(++_0xc36e5a);}(_0x8e08,0xcc));var _0x88e0=function(_0x4f4a60,_0x2e43c7){_0x4f4a60=_0x4f4a60-0x0;var _0xf63e8b=_0x8e08[_0x4f4a60];return _0xf63e8b;};'use strict';var _=require('lodash');var util=require(_0x88e0('0x0'));var logger=require(_0x88e0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x88e0('0x2'));var attributes=require(_0x88e0('0x3'));module[_0x88e0('0x4')]=function(_0x456c03,_0x2ff75e){return _0x456c03[_0x88e0('0x5')](_0x88e0('0x6'),attributes,{'tableName':_0x88e0('0x7'),'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 6d9f4d6..bac176e 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 _0x39f5=['code','error','message','info','result','catch','ReportAgentPreview','options','raw','CreateReportAgentPreview','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2fc739,_0x4b81ee){var _0x33e730=function(_0x274f81){while(--_0x274f81){_0x2fc739['push'](_0x2fc739['shift']());}};_0x33e730(++_0x4b81ee);}(_0x39f5,0x6e));var _0x539f=function(_0x3623ad,_0x212b88){_0x3623ad=_0x3623ad-0x0;var _0x270bd5=_0x39f5[_0x3623ad];return _0x270bd5;};'use strict';var _=require(_0x539f('0x0'));var util=require('util');var moment=require(_0x539f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x539f('0x2'));var db=require(_0x539f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x539f('0x4'))(_0x539f('0x5'));var config=require(_0x539f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x539f('0x7')][_0x539f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46a8c2,_0x2e8d29,_0x3815f5){return new BPromise(function(_0x484a02,_0x3ce5a3){return client[_0x539f('0x9')](_0x46a8c2,_0x3815f5)['then'](function(_0x2eb1d1){logger['info'](_0x539f('0xa'),_0x2e8d29,_0x539f('0xb'));logger[_0x539f('0xc')](_0x539f('0xd'),_0x2e8d29,_0x539f('0xb'),JSON[_0x539f('0xe')](_0x2eb1d1));if(_0x2eb1d1['error']){if(_0x2eb1d1['error'][_0x539f('0xf')]===0x1f4){logger[_0x539f('0x10')](_0x539f('0xa'),_0x2e8d29,_0x2eb1d1[_0x539f('0x10')]['message']);return _0x3ce5a3(_0x2eb1d1[_0x539f('0x10')][_0x539f('0x11')]);}logger['error'](_0x539f('0xa'),_0x2e8d29,_0x2eb1d1[_0x539f('0x10')][_0x539f('0x11')]);return _0x484a02(_0x2eb1d1[_0x539f('0x10')][_0x539f('0x11')]);}else{logger[_0x539f('0x12')](_0x539f('0xa'),_0x2e8d29,_0x539f('0xb'));_0x484a02(_0x2eb1d1[_0x539f('0x13')]['message']);}})[_0x539f('0x14')](function(_0x349478){logger[_0x539f('0x10')](_0x539f('0xa'),_0x2e8d29,_0x349478);_0x3ce5a3(_0x349478);});});}exports['CreateReportAgentPreview']=function(_0x2037bc){var _0x54782c=this;return new Promise(function(_0x380062,_0x2a3d3c){return db[_0x539f('0x15')]['create'](_0x2037bc['body'],{'raw':_0x2037bc[_0x539f('0x16')]?_0x2037bc[_0x539f('0x16')][_0x539f('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x531ef3){logger['info'](_0x539f('0x18'),_0x2037bc);logger['debug'](_0x539f('0x18'),_0x2037bc,JSON['stringify'](_0x531ef3));_0x380062(_0x531ef3);})['catch'](function(_0x90148c){logger[_0x539f('0x10')](_0x539f('0x18'),_0x90148c['message'],_0x2037bc);_0x2a3d3c(_0x54782c['error'](0x1f4,_0x90148c['message']));});});}; \ No newline at end of file +var _0x4f72=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x4f72,0x16c));var _0x24f7=function(_0x5da897,_0x494d3b){_0x5da897=_0x5da897-0x0;var _0x48201e=_0x4f72[_0x5da897];return _0x48201e;};'use strict';var _=require(_0x24f7('0x0'));var util=require(_0x24f7('0x1'));var moment=require(_0x24f7('0x2'));var BPromise=require(_0x24f7('0x3'));var rs=require(_0x24f7('0x4'));var fs=require('fs');var Redis=require(_0x24f7('0x5'));var db=require(_0x24f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x24f7('0x7'));var client=jayson[_0x24f7('0x8')][_0x24f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1be81e,_0x30fac2,_0x45dc24){return new BPromise(function(_0x3341fe,_0x43f98e){return client['request'](_0x1be81e,_0x45dc24)[_0x24f7('0xa')](function(_0x279d48){logger[_0x24f7('0xb')](_0x24f7('0xc'),_0x30fac2,'request\x20sent');logger[_0x24f7('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x30fac2,_0x24f7('0xe'),JSON[_0x24f7('0xf')](_0x279d48));if(_0x279d48[_0x24f7('0x10')]){if(_0x279d48[_0x24f7('0x10')][_0x24f7('0x11')]===0x1f4){logger[_0x24f7('0x10')](_0x24f7('0xc'),_0x30fac2,_0x279d48[_0x24f7('0x10')][_0x24f7('0x12')]);return _0x43f98e(_0x279d48[_0x24f7('0x10')]['message']);}logger[_0x24f7('0x10')](_0x24f7('0xc'),_0x30fac2,_0x279d48[_0x24f7('0x10')][_0x24f7('0x12')]);return _0x3341fe(_0x279d48[_0x24f7('0x10')][_0x24f7('0x12')]);}else{logger[_0x24f7('0xb')](_0x24f7('0xc'),_0x30fac2,_0x24f7('0xe'));_0x3341fe(_0x279d48['result'][_0x24f7('0x12')]);}})[_0x24f7('0x13')](function(_0x33f058){logger[_0x24f7('0x10')](_0x24f7('0xc'),_0x30fac2,_0x33f058);_0x43f98e(_0x33f058);});});}exports[_0x24f7('0x14')]=function(_0xf2b56f){var _0x3c5118=this;return new Promise(function(_0x516f1f,_0x36d5dc){return db[_0x24f7('0x15')][_0x24f7('0x16')](_0xf2b56f[_0x24f7('0x17')],{'raw':_0xf2b56f[_0x24f7('0x18')]?_0xf2b56f[_0x24f7('0x18')][_0x24f7('0x19')]===undefined?!![]:![]:!![]})[_0x24f7('0xa')](function(_0x4985ea){logger['info'](_0x24f7('0x14'),_0xf2b56f);logger[_0x24f7('0xd')](_0x24f7('0x14'),_0xf2b56f,JSON[_0x24f7('0xf')](_0x4985ea));_0x516f1f(_0x4985ea);})['catch'](function(_0x49ec87){logger[_0x24f7('0x10')](_0x24f7('0x14'),_0x49ec87['message'],_0xf2b56f);_0x36d5dc(_0x3c5118['error'](0x1f4,_0x49ec87[_0x24f7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 82c738b..48918f8 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 _0x176a=['showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','/agents/:id/notify','exports','multer','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','agents','agentCapacity','telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/fax/queues/waitinginteractions','post','queueNotify','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id'];(function(_0x36d89e,_0x10798d){var _0x2ec585=function(_0x82bae2){while(--_0x82bae2){_0x36d89e['push'](_0x36d89e['shift']());}};_0x2ec585(++_0x10798d);}(_0x176a,0x8a));var _0xa176=function(_0x117146,_0x125f6b){_0x117146=_0x117146-0x0;var _0x1c74c6=_0x176a[_0x117146];return _0x1c74c6;};'use strict';var multer=require(_0xa176('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express[_0xa176('0x1')]();var auth=require(_0xa176('0x2'));var controller=require('./rpc.controller');router[_0xa176('0x3')](_0xa176('0x4'),auth[_0xa176('0x5')](),controller[_0xa176('0x6')]);router[_0xa176('0x3')](_0xa176('0x7'),auth[_0xa176('0x5')](),controller[_0xa176('0x8')]);router[_0xa176('0x3')](_0xa176('0x9'),auth[_0xa176('0x5')](),controller[_0xa176('0xa')]);router[_0xa176('0x3')](_0xa176('0xb'),auth['isAuthenticated'](),controller[_0xa176('0xc')]);router[_0xa176('0x3')](_0xa176('0xd'),auth[_0xa176('0x5')](),controller['chatQueues']);router[_0xa176('0x3')](_0xa176('0xe'),auth['isAuthenticated'](),controller['mailQueues']);router[_0xa176('0x3')](_0xa176('0xf'),auth[_0xa176('0x5')](),controller[_0xa176('0x10')]);router['get']('/openchannel/queues',auth[_0xa176('0x5')](),controller[_0xa176('0x11')]);router[_0xa176('0x3')](_0xa176('0x12'),auth['isAuthenticated'](),controller['smsQueues']);router[_0xa176('0x3')](_0xa176('0x13'),auth[_0xa176('0x5')](),controller[_0xa176('0x14')]);router['get'](_0xa176('0x15'),auth['isAuthenticated'](),controller[_0xa176('0x16')]);router[_0xa176('0x3')](_0xa176('0x17'),auth[_0xa176('0x5')](),controller[_0xa176('0x18')]);router['get'](_0xa176('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router['get'](_0xa176('0x1a'),auth[_0xa176('0x5')](),controller[_0xa176('0x1b')]);router['get'](_0xa176('0x1c'),auth[_0xa176('0x5')](),controller[_0xa176('0x1d')]);router[_0xa176('0x3')]('/voice/queues/:id',auth[_0xa176('0x5')](),controller[_0xa176('0x1e')]);router[_0xa176('0x3')](_0xa176('0x1f'),auth[_0xa176('0x5')](),controller['outbound']);router['get'](_0xa176('0x20'),auth['isAuthenticated'](),controller[_0xa176('0x21')]);router[_0xa176('0x3')]('/agents',auth[_0xa176('0x5')](),controller[_0xa176('0x22')]);router['put']('/agents/:id/capacity',auth[_0xa176('0x5')](),controller[_0xa176('0x23')]);router[_0xa176('0x3')]('/telephones',auth[_0xa176('0x5')](),controller[_0xa176('0x24')]);router[_0xa176('0x3')](_0xa176('0x25'),auth['isAuthenticated'](),controller[_0xa176('0x26')]);router[_0xa176('0x3')](_0xa176('0x27'),auth[_0xa176('0x5')](),controller['campaigns']);router['get'](_0xa176('0x28'),auth[_0xa176('0x5')](),controller['faxAccounts']);router[_0xa176('0x3')](_0xa176('0x29'),auth[_0xa176('0x5')](),controller[_0xa176('0x2a')]);router['get'](_0xa176('0x2b'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0xa176('0x3')](_0xa176('0x2c'),auth[_0xa176('0x5')](),controller['openchannelQueuesWaitingInteractions']);router['get']('/sms/queues/waitinginteractions',auth[_0xa176('0x5')](),controller['smsQueuesWaitingInteractions']);router[_0xa176('0x3')](_0xa176('0x2d'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xa176('0x2e')]('/mail/queues/:id/notify',auth[_0xa176('0x5')](),controller[_0xa176('0x2f')]('mail'));router[_0xa176('0x3')](_0xa176('0x30'),auth['isAuthenticated'](),controller['showMailQueues']);router['post'](_0xa176('0x31'),auth[_0xa176('0x5')](),controller[_0xa176('0x2f')](_0xa176('0x32')));router[_0xa176('0x3')](_0xa176('0x33'),auth[_0xa176('0x5')](),controller[_0xa176('0x34')]);router[_0xa176('0x2e')]('/fax/queues/:id/notify',auth[_0xa176('0x5')](),controller['queueNotify']('fax'));router[_0xa176('0x3')](_0xa176('0x35'),auth['isAuthenticated'](),controller[_0xa176('0x36')]);router[_0xa176('0x2e')](_0xa176('0x37'),auth[_0xa176('0x5')](),controller[_0xa176('0x2f')](_0xa176('0x38')));router[_0xa176('0x3')](_0xa176('0x39'),auth[_0xa176('0x5')](),controller[_0xa176('0x3a')]);router[_0xa176('0x2e')](_0xa176('0x3b'),auth[_0xa176('0x5')](),controller[_0xa176('0x2f')](_0xa176('0x3c')));router[_0xa176('0x3')](_0xa176('0x3d'),auth[_0xa176('0x5')](),controller['showSmsQueues']);router['post'](_0xa176('0x3e'),auth['isAuthenticated'](),controller['agentNotify']);module[_0xa176('0x3f')]=router; \ No newline at end of file +var _0xc6a2=['/voice/queues/:id','/outbound','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','showChatQueues','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','sms','/sms/queues/:id','/agents/:id/notify','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect'];(function(_0x34a22a,_0x4a3068){var _0x4f04d5=function(_0x2ac7d8){while(--_0x2ac7d8){_0x34a22a['push'](_0x34a22a['shift']());}};_0x4f04d5(++_0x4a3068);}(_0xc6a2,0x69));var _0x2c6a=function(_0x5778a1,_0x1a2357){_0x5778a1=_0x5778a1-0x0;var _0x495b7a=_0xc6a2[_0x5778a1];return _0x495b7a;};'use strict';var multer=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var path=require('path');var express=require(_0x2c6a('0x2'));var router=express[_0x2c6a('0x3')]();var auth=require(_0x2c6a('0x4'));var controller=require(_0x2c6a('0x5'));router[_0x2c6a('0x6')](_0x2c6a('0x7'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x9')]);router[_0x2c6a('0x6')](_0x2c6a('0xa'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0xb')]);router[_0x2c6a('0x6')](_0x2c6a('0xc'),auth['isAuthenticated'](),controller[_0x2c6a('0xd')]);router[_0x2c6a('0x6')](_0x2c6a('0xe'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0xf')]);router[_0x2c6a('0x6')](_0x2c6a('0x10'),auth[_0x2c6a('0x8')](),controller['chatQueues']);router['get'](_0x2c6a('0x11'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x12')]);router[_0x2c6a('0x6')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x2c6a('0x13')]);router[_0x2c6a('0x6')](_0x2c6a('0x14'),auth['isAuthenticated'](),controller['openchannelQueues']);router['get'](_0x2c6a('0x15'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x16')]);router[_0x2c6a('0x6')](_0x2c6a('0x17'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x18')]);router[_0x2c6a('0x6')](_0x2c6a('0x19'),auth['isAuthenticated'](),controller[_0x2c6a('0x1a')]);router[_0x2c6a('0x6')]('/voice/queues/channels',auth[_0x2c6a('0x8')](),controller['voiceQueuesChannels']);router['get'](_0x2c6a('0x1b'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x1c')]);router[_0x2c6a('0x6')](_0x2c6a('0x1d'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x1e')]);router['get'](_0x2c6a('0x1f'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x20')]);router[_0x2c6a('0x6')](_0x2c6a('0x21'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x2c6a('0x6')](_0x2c6a('0x22'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x23')]);router['get']('/outbound/channels',auth['isAuthenticated'](),controller[_0x2c6a('0x24')]);router[_0x2c6a('0x6')](_0x2c6a('0x25'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x26')]);router[_0x2c6a('0x27')](_0x2c6a('0x28'),auth['isAuthenticated'](),controller[_0x2c6a('0x29')]);router['get'](_0x2c6a('0x2a'),auth['isAuthenticated'](),controller[_0x2c6a('0x2b')]);router[_0x2c6a('0x6')](_0x2c6a('0x2c'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x2d')]);router['get'](_0x2c6a('0x2e'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x2f')]);router[_0x2c6a('0x6')]('/fax/accounts',auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x30')]);router[_0x2c6a('0x6')](_0x2c6a('0x31'),auth['isAuthenticated'](),controller[_0x2c6a('0x32')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x2c6a('0x33')]);router[_0x2c6a('0x6')](_0x2c6a('0x34'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x35')]);router[_0x2c6a('0x6')]('/sms/queues/waitinginteractions',auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x36')]);router[_0x2c6a('0x6')]('/fax/queues/waitinginteractions',auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x37')]);router[_0x2c6a('0x38')](_0x2c6a('0x39'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x3a')](_0x2c6a('0x3b')));router[_0x2c6a('0x6')]('/mail/queues/:id',auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x3c')]);router[_0x2c6a('0x38')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x2c6a('0x3a')]('chat'));router[_0x2c6a('0x6')]('/chat/queues/:id',auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x3d')]);router[_0x2c6a('0x38')]('/fax/queues/:id/notify',auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x3a')]('fax'));router[_0x2c6a('0x6')](_0x2c6a('0x3e'),auth[_0x2c6a('0x8')](),controller[_0x2c6a('0x3f')]);router[_0x2c6a('0x38')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x2c6a('0x40')));router[_0x2c6a('0x6')](_0x2c6a('0x41'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x2c6a('0x38')]('/sms/queues/:id/notify',auth[_0x2c6a('0x8')](),controller['queueNotify'](_0x2c6a('0x42')));router[_0x2c6a('0x6')](_0x2c6a('0x43'),auth[_0x2c6a('0x8')](),controller['showSmsQueues']);router['post'](_0x2c6a('0x44'),auth[_0x2c6a('0x8')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 1fa1171..a4ac908 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 _0xe008=['create','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','agent','Agent\x20not\x20found','Message','update','From','Start','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','catch','sendStatus','stack','name','status','send','isNil','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','messageId','Interaction','\x20Message\x20not\x20found','queue','InteractionId','QueueId','TransferReport'];(function(_0x3afa1b,_0x57ec8c){var _0x33f1d7=function(_0x9a6190){while(--_0x9a6190){_0x3afa1b['push'](_0x3afa1b['shift']());}};_0x33f1d7(++_0x57ec8c);}(_0xe008,0xe9));var _0x8e00=function(_0xa4040,_0x32119b){_0xa4040=_0xa4040-0x0;var _0x405c12=_0xe008[_0xa4040];return _0x405c12;};'use strict';var BPromise=require(_0x8e00('0x0'));var moment=require(_0x8e00('0x1'));var _=require(_0x8e00('0x2'));var util=require(_0x8e00('0x3'));var db=require(_0x8e00('0x4'))['db'];var logger=require(_0x8e00('0x5'))(_0x8e00('0x6'));var jayson=require(_0x8e00('0x7'));var amiClient=jayson[_0x8e00('0x8')]['http']({'port':0x232a});var mailClient=jayson['client'][_0x8e00('0x9')]({'port':0x232b});var routingClient=jayson[_0x8e00('0x8')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2a8faf,_0x4e3588,_0xe4952d){return new BPromise(function(_0x129979,_0x5a308b){var _0x40a23d=_0xe4952d?_0xe4952d:amiClient;return _0x40a23d[_0x8e00('0xa')](_0x2a8faf,_0x4e3588)[_0x8e00('0xb')](function(_0x5ba207){if(_0x5ba207[_0x8e00('0xc')]){if(_0x5ba207[_0x8e00('0xc')][_0x8e00('0xd')]===0x1f4){return _0x5a308b(_0x5ba207[_0x8e00('0xc')]['message']);}return _0x129979(_0x5ba207[_0x8e00('0xc')]['message']);}else{_0x129979(_0x5ba207['result']);}})[_0x8e00('0xe')](function(_0x1fad24){_0x5a308b(_0x1fad24);});});}function respondWithResult(_0x558001,_0x4fd068){_0x4fd068=_0x4fd068||0xc8;return function(_0x2bee07){if(_0x2bee07){return _0x558001['status'](_0x4fd068)['json'](_0x2bee07);}return _0x558001[_0x8e00('0xf')](0x194);};}function handleError(_0x4704c2,_0x1ec79a){_0x1ec79a=_0x1ec79a||0x1f4;return function(_0x4e5697){logger[_0x8e00('0xc')](_0x4e5697[_0x8e00('0x10')]);if(_0x4e5697[_0x8e00('0x11')]){delete _0x4e5697[_0x8e00('0x11')];}_0x4704c2[_0x8e00('0x12')](_0x1ec79a)[_0x8e00('0x13')](_0x4e5697);};}function findById(_0x13cccb){return function(_0x15c3ed){if(!_[_0x8e00('0x14')](_0x13cccb)&&!_[_0x8e00('0x14')](_0x15c3ed)&&!_[_0x8e00('0x14')](_0x15c3ed['rows'])){return _['find'](_0x15c3ed['rows'],function(_0x4bb39b){return _0x4bb39b['id']==_0x13cccb;});}return null;};}exports['voiceChannels']=function(_0x2f18f6,_0x4f804f){return respondWithRpcPromise('VoiceChannels',_0x2f18f6['query'])[_0x8e00('0xb')](respondWithResult(_0x4f804f,null))[_0x8e00('0xe')](handleError(_0x4f804f,null));};exports[_0x8e00('0x15')]=function(_0x8420b3,_0x5291d3){return respondWithRpcPromise(_0x8e00('0x16'),_[_0x8e00('0x17')](_0x8420b3[_0x8e00('0x18')],_0x8420b3[_0x8e00('0x19')]))[_0x8e00('0xb')](respondWithResult(_0x5291d3,null))[_0x8e00('0xe')](handleError(_0x5291d3,null));};exports['voiceChannelStopMixMonitor']=function(_0xca6e95,_0x292b26){return respondWithRpcPromise(_0x8e00('0x1a'),_['merge'](_0xca6e95[_0x8e00('0x18')],_0xca6e95['params']))[_0x8e00('0xb')](respondWithResult(_0x292b26,null))['catch'](handleError(_0x292b26,null));};exports[_0x8e00('0x1b')]=function(_0x1825dd,_0x4850be){return respondWithRpcPromise(_0x8e00('0x1c'),_0x1825dd[_0x8e00('0x18')])[_0x8e00('0xb')](respondWithResult(_0x4850be,null))[_0x8e00('0xe')](handleError(_0x4850be,null));};exports[_0x8e00('0x1d')]=function(_0x373d0b,_0x10856f){return respondWithRpcPromise(_0x8e00('0x1c'),_0x373d0b[_0x8e00('0x18')])[_0x8e00('0xb')](findById(_0x373d0b[_0x8e00('0x19')]['id']))[_0x8e00('0xb')](respondWithResult(_0x10856f,null))[_0x8e00('0xe')](handleError(_0x10856f,null));};exports[_0x8e00('0x1e')]=function(_0x52ee52,_0x31fbcd){return respondWithRpcPromise(_0x8e00('0x1f'),_[_0x8e00('0x17')](_0x52ee52['query'],_0x52ee52[_0x8e00('0x19')]))[_0x8e00('0xb')](respondWithResult(_0x31fbcd,null))[_0x8e00('0xe')](handleError(_0x31fbcd,null));};exports[_0x8e00('0x20')]=function(_0x2076d0,_0x5c2e5c){return respondWithRpcPromise(_0x8e00('0x21'),_0x2076d0[_0x8e00('0x18')])[_0x8e00('0xb')](respondWithResult(_0x5c2e5c,null))[_0x8e00('0xe')](handleError(_0x5c2e5c,null));};exports[_0x8e00('0x22')]=function(_0x5ae38d,_0x124d56){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x8e00('0x17')](_0x5ae38d['query'],_0x5ae38d['params']))['then'](respondWithResult(_0x124d56,null))[_0x8e00('0xe')](handleError(_0x124d56,null));};exports['voiceQueuesChannelHangup']=function(_0x2426c2,_0x4cd76a){return respondWithRpcPromise(_0x8e00('0x23'),_['merge'](_0x2426c2[_0x8e00('0x18')],_0x2426c2['params']))[_0x8e00('0xb')](respondWithResult(_0x4cd76a,null))[_0x8e00('0xe')](handleError(_0x4cd76a,null));};exports[_0x8e00('0x24')]=function(_0x76f005,_0x1dc6dd){return respondWithRpcPromise(_0x8e00('0x25'),_[_0x8e00('0x17')](_0x76f005[_0x8e00('0x18')],_0x76f005[_0x8e00('0x19')]))['then'](respondWithResult(_0x1dc6dd,null))[_0x8e00('0xe')](handleError(_0x1dc6dd,null));};exports[_0x8e00('0x26')]=function(_0x1009e4,_0xbec57c){return respondWithRpcPromise(_0x8e00('0x27'),_0x1009e4[_0x8e00('0x18')])['then'](respondWithResult(_0xbec57c,null))[_0x8e00('0xe')](handleError(_0xbec57c,null));};exports[_0x8e00('0x28')]=function(_0x359be4,_0x10cd8e){return respondWithRpcPromise(_0x8e00('0x29'),_0x359be4[_0x8e00('0x18')])[_0x8e00('0xb')](respondWithResult(_0x10cd8e,null))[_0x8e00('0xe')](handleError(_0x10cd8e,null));};exports[_0x8e00('0x2a')]=function(_0x290a35,_0x1b15b4){var _0x4f882b;return respondWithRpcPromise(_0x8e00('0x2b'),_0x290a35['query'])[_0x8e00('0xb')](function(_0x36703a){_0x4f882b=_0x36703a;return respondWithRpcPromise('Agents',_0x290a35[_0x8e00('0x18')],routingClient);})['then'](function(_0x3fb3a3){return _['merge']({},_0x3fb3a3,_0x4f882b);})['then'](respondWithResult(_0x1b15b4,null))[_0x8e00('0xe')](handleError(_0x1b15b4,null));};exports[_0x8e00('0x2c')]=function(_0xcec92c,_0x3c29e7){if(_0xcec92c['body']&&_0xcec92c[_0x8e00('0x2d')][_0x8e00('0x2e')]&&_0xcec92c[_0x8e00('0x2f')]&&_0xcec92c[_0x8e00('0x2f')][_0x8e00('0x11')]){for(var _0x251946 in _0xcec92c['body']['interaction']){if(_0xcec92c[_0x8e00('0x2d')][_0x8e00('0x2e')]['hasOwnProperty'](_0x251946)){db[_0x8e00('0x30')][_0x8e00('0x31')]({'where':{'channel':_0x251946,'membername':_0xcec92c[_0x8e00('0x2f')]['name'],'type':_0x8e00('0x32'),'exitAt':null,'uniqueid':_0xcec92c[_0x8e00('0x2d')][_0x8e00('0x2e')][_0x251946]&&_0xcec92c[_0x8e00('0x2d')][_0x8e00('0x2e')][_0x251946][_0x8e00('0x33')]?{'$notIn':_0xcec92c[_0x8e00('0x2d')][_0x8e00('0x2e')][_0x251946]}:{'$ne':null}}})[_0x8e00('0xb')](function(_0x29a139){var _0x3721ac=moment()[_0x8e00('0x34')](_0x8e00('0x35'));for(var _0x6aeeb=0x0,_0x575700=_0x29a139[_0x8e00('0x33')];_0x6aeeb<_0x575700;_0x6aeeb+=0x1){_0x29a139[_0x6aeeb][_0x8e00('0x36')]({'exitAt':_0x3721ac});}});for(var _0x10398f=0x0;_0x10398f<_0xcec92c['body'][_0x8e00('0x2e')][_0x251946][_0x8e00('0x33')];_0x10398f+=0x1){db[_0x8e00('0x30')][_0x8e00('0x37')]({'where':{'channel':_0x251946,'membername':_0xcec92c[_0x8e00('0x2f')]['name'],'type':_0x8e00('0x32'),'uniqueid':_0xcec92c[_0x8e00('0x2d')][_0x8e00('0x2e')][_0x251946][_0x10398f],'exitAt':null},'defaults':{'channel':_0x251946,'membername':_0xcec92c[_0x8e00('0x2f')]['name'],'interface':_[_0x8e00('0x14')](_0xcec92c[_0x8e00('0x2f')][_0x8e00('0x38')])?util['format']('SIP/%s',_0xcec92c[_0x8e00('0x2f')]['name']):_0xcec92c['user'][_0x8e00('0x38')],'type':_0x8e00('0x32'),'enterAt':moment()[_0x8e00('0x34')](_0x8e00('0x35')),'role':'agent','internal':_0xcec92c[_0x8e00('0x2f')][_0x8e00('0x39')],'uniqueid':_0xcec92c[_0x8e00('0x2d')][_0x8e00('0x2e')][_0x251946][_0x10398f]}});}}}}return respondWithRpcPromise(_0x8e00('0x3a'),{'id':_0xcec92c[_0x8e00('0x19')]['id'],'capacity':_0xcec92c[_0x8e00('0x2d')][_0x8e00('0x3b')]},routingClient)[_0x8e00('0xb')](respondWithResult(_0x3c29e7,null))['catch'](handleError(_0x3c29e7,null));};exports[_0x8e00('0x3c')]=function(_0x198115,_0x3ba36e){return respondWithRpcPromise(_0x8e00('0x3d'),_0x198115[_0x8e00('0x18')])['then'](respondWithResult(_0x3ba36e,null))['catch'](handleError(_0x3ba36e,null));};exports[_0x8e00('0x3e')]=function(_0x374cf3,_0x204519){return respondWithRpcPromise(_0x8e00('0x3f'),_0x374cf3[_0x8e00('0x18')])[_0x8e00('0xb')](respondWithResult(_0x204519,null))[_0x8e00('0xe')](handleError(_0x204519,null));};exports[_0x8e00('0x40')]=function(_0x5bd1c0,_0x5e5d0e){return respondWithRpcPromise(_0x8e00('0x41'),_0x5bd1c0[_0x8e00('0x18')])['then'](respondWithResult(_0x5e5d0e,null))[_0x8e00('0xe')](handleError(_0x5e5d0e,null));};exports['chatQueues']=function(_0x2dee53,_0x1c880e){return respondWithRpcPromise(_0x8e00('0x42'),_0x2dee53['query'],routingClient)[_0x8e00('0xb')](respondWithResult(_0x1c880e,null))[_0x8e00('0xe')](handleError(_0x1c880e,null));};exports[_0x8e00('0x43')]=function(_0x5dbea9,_0x5415bb){return respondWithRpcPromise(_0x8e00('0x42'),_0x5dbea9[_0x8e00('0x18')],routingClient)[_0x8e00('0xb')](findById(_0x5dbea9[_0x8e00('0x19')]['id']))[_0x8e00('0xb')](respondWithResult(_0x5415bb,null))[_0x8e00('0xe')](handleError(_0x5415bb,null));};exports[_0x8e00('0x44')]=function(_0x508a73,_0x13e57a){return respondWithRpcPromise('MailQueues',_0x508a73['query'],routingClient)[_0x8e00('0xb')](respondWithResult(_0x13e57a,null))[_0x8e00('0xe')](handleError(_0x13e57a,null));};exports[_0x8e00('0x45')]=function(_0x157fb1,_0x514226){return respondWithRpcPromise(_0x8e00('0x46'),_0x157fb1[_0x8e00('0x18')],routingClient)[_0x8e00('0xb')](findById(_0x157fb1['params']['id']))[_0x8e00('0xb')](respondWithResult(_0x514226,null))['catch'](handleError(_0x514226,null));};exports[_0x8e00('0x47')]=function(_0x51f669,_0x4ec475){return respondWithRpcPromise(_0x8e00('0x48'),_0x51f669[_0x8e00('0x18')],mailClient)['then'](respondWithResult(_0x4ec475,null))[_0x8e00('0xe')](handleError(_0x4ec475,null));};exports['openchannelQueues']=function(_0x1409b5,_0x314dfe){return respondWithRpcPromise(_0x8e00('0x49'),_0x1409b5[_0x8e00('0x18')],routingClient)[_0x8e00('0xb')](respondWithResult(_0x314dfe,null))[_0x8e00('0xe')](handleError(_0x314dfe,null));};exports['showOpenchannelQueues']=function(_0x3aad7d,_0x2f2e55){return respondWithRpcPromise(_0x8e00('0x49'),_0x3aad7d[_0x8e00('0x18')],routingClient)['then'](findById(_0x3aad7d[_0x8e00('0x19')]['id']))[_0x8e00('0xb')](respondWithResult(_0x2f2e55,null))[_0x8e00('0xe')](handleError(_0x2f2e55,null));};exports['smsQueues']=function(_0x46c138,_0x22cda1){return respondWithRpcPromise(_0x8e00('0x4a'),_0x46c138['query'],routingClient)['then'](respondWithResult(_0x22cda1,null))[_0x8e00('0xe')](handleError(_0x22cda1,null));};exports[_0x8e00('0x4b')]=function(_0x112489,_0x3ee2a2){return respondWithRpcPromise('SmsQueues',_0x112489[_0x8e00('0x18')],routingClient)['then'](findById(_0x112489['params']['id']))['then'](respondWithResult(_0x3ee2a2,null))[_0x8e00('0xe')](handleError(_0x3ee2a2,null));};exports[_0x8e00('0x4c')]=function(_0x14a92f,_0xc65719){return respondWithRpcPromise(_0x8e00('0x4d'),_0x14a92f[_0x8e00('0x18')],routingClient)[_0x8e00('0xb')](respondWithResult(_0xc65719,null))['catch'](handleError(_0xc65719,null));};exports[_0x8e00('0x4e')]=function(_0x427183,_0x2cd222){return respondWithRpcPromise(_0x8e00('0x4d'),_0x427183[_0x8e00('0x18')],routingClient)[_0x8e00('0xb')](findById(_0x427183[_0x8e00('0x19')]['id']))[_0x8e00('0xb')](respondWithResult(_0x2cd222,null))[_0x8e00('0xe')](handleError(_0x2cd222,null));};exports[_0x8e00('0x4f')]=function(_0x5e9c0b,_0x2b6315){return respondWithRpcPromise(_0x8e00('0x50'),_0x5e9c0b[_0x8e00('0x18')])[_0x8e00('0xb')](respondWithResult(_0x2b6315,null))['catch'](handleError(_0x2b6315,null));};exports[_0x8e00('0x51')]=function(_0x193388,_0x3c4fa9){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x193388['query'],routingClient)[_0x8e00('0xb')](respondWithResult(_0x3c4fa9,null))['catch'](handleError(_0x3c4fa9,null));};exports[_0x8e00('0x52')]=function(_0x146338,_0x497b4d){return respondWithRpcPromise(_0x8e00('0x53'),_0x146338[_0x8e00('0x18')],routingClient)[_0x8e00('0xb')](respondWithResult(_0x497b4d,null))[_0x8e00('0xe')](handleError(_0x497b4d,null));};exports[_0x8e00('0x54')]=function(_0x272f68,_0x58d9cf){return respondWithRpcPromise(_0x8e00('0x55'),_0x272f68[_0x8e00('0x18')],routingClient)[_0x8e00('0xb')](respondWithResult(_0x58d9cf,null))[_0x8e00('0xe')](handleError(_0x58d9cf,null));};exports[_0x8e00('0x56')]=function(_0xeacd2b,_0x1dfedb){return respondWithRpcPromise(_0x8e00('0x57'),_0xeacd2b['query'],routingClient)[_0x8e00('0xb')](respondWithResult(_0x1dfedb,null))[_0x8e00('0xe')](handleError(_0x1dfedb,null));};exports['faxQueuesWaitingInteractions']=function(_0x5c4a41,_0x4dcb36){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x5c4a41['query'],routingClient)[_0x8e00('0xb')](respondWithResult(_0x4dcb36,null))[_0x8e00('0xe')](handleError(_0x4dcb36,null));};exports[_0x8e00('0x58')]=function(_0x3acaef){return function(_0x1ead60,_0x1770f0){var _0x87f1f5,_0x3f74e4;var _0x4c09d6=_[_0x8e00('0x59')](_0x3acaef);var _0xcb0de9=_0x3acaef===_0x8e00('0x5a')?_0x8e00('0x5b'):_0x8e00('0x5c');return db[_0x4c09d6+'Queue']['findOne']({'raw':!![],'where':{'id':_0x1ead60['params']['id']}})[_0x8e00('0xb')](function(_0x5f4961){if(_['isNil'](_0x5f4961)){throw new Error(_0x4c09d6+'\x20Queue\x20not\x20found');}_0x87f1f5=_0x5f4961;return db[_0x4c09d6+'Message']['findOne']({'where':{'id':_0x1ead60[_0x8e00('0x2d')][_0x8e00('0x5d')]},'include':[{'model':db[_0x4c09d6+'Interaction'],'as':_0x8e00('0x5e')},{'model':db[_0x4c09d6+_0xcb0de9],'as':'Account'}]});})[_0x8e00('0xb')](function(_0x4e92e2){if(_[_0x8e00('0x14')](_0x4e92e2)){throw new Error(_0x4c09d6+_0x8e00('0x5f'));}_0x3f74e4=_0x4e92e2;return _0x4e92e2['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x8e00('0xb')](function(){var _0x44cf37={'uniqueid':_0x3acaef+'.'+_0x3f74e4['id']+'.'+_0x3f74e4['Interaction']['id'],'FromUserId':_0x1ead60[_0x8e00('0x2f')]['id'],'type':_0x8e00('0x60')};_0x44cf37[_0x4c09d6+'MessageId']=_0x3f74e4['id'];_0x44cf37[_0x4c09d6+_0x8e00('0x61')]=_0x3f74e4['Interaction']['id'];_0x44cf37['From'+_0x4c09d6+_0xcb0de9+'Id']=_0x3f74e4[_0x8e00('0x5c')]['id'];_0x44cf37['To'+_0x4c09d6+_0x8e00('0x62')]=_0x87f1f5['id'];return db[_0x4c09d6+_0x8e00('0x63')][_0x8e00('0x64')](_0x44cf37);})[_0x8e00('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x3acaef,'interaction':_0x3f74e4[_0x8e00('0x5e')],'message':_0x3f74e4,'account':_0x3f74e4[_0x8e00('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8e00('0x60'),'appdata':_0x87f1f5[_0x8e00('0x11')]+','+(_0x3f74e4['Account']['queueTransferTimeout']||0x12c),'interval':_0x8e00('0x65')}]},routingClient);})['then'](respondWithResult(_0x1770f0,null))[_0x8e00('0xe')](handleError(_0x1770f0,null));};};exports['agentNotify']=function(_0x43e6ea,_0x320e91){var _0xf2a891,_0x225bfb;if(_[_0x8e00('0x14')](_0x43e6ea[_0x8e00('0x2d')][_0x8e00('0x66')])){throw new Error(_0x8e00('0x67'));}var _0x1c99ed=_0x43e6ea[_0x8e00('0x2d')][_0x8e00('0x66')];var _0x5f49e1=_[_0x8e00('0x59')](_0x1c99ed);var _0xc009fd=_0x1c99ed===_0x8e00('0x5a')?_0x8e00('0x5b'):_0x8e00('0x5c');return db[_0x8e00('0x68')]['findOne']({'raw':!![],'where':{'id':_0x43e6ea[_0x8e00('0x19')]['id'],'role':_0x8e00('0x69')}})[_0x8e00('0xb')](function(_0x113664){if(_[_0x8e00('0x14')](_0x113664)){throw new Error(_0x8e00('0x6a'));}_0xf2a891=_0x113664;return db[_0x5f49e1+_0x8e00('0x6b')]['findOne']({'where':{'id':_0x43e6ea[_0x8e00('0x2d')]['messageId']},'include':[{'model':db[_0x5f49e1+'Interaction'],'as':_0x8e00('0x5e')},{'model':db[_0x5f49e1+_0xc009fd],'as':_0x8e00('0x5c')}]});})[_0x8e00('0xb')](function(_0x464d1b){if(_[_0x8e00('0x14')](_0x464d1b)){throw new Error(_0x5f49e1+_0x8e00('0x5f'));}_0x225bfb=_0x464d1b;return _0x464d1b[_0x8e00('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8e00('0xb')](function(){var _0x50836f={'uniqueid':_0x1c99ed+'.'+_0x225bfb['id']+'.'+_0x225bfb['Interaction']['id'],'FromUserId':_0x43e6ea[_0x8e00('0x2f')]['id'],'type':_0x8e00('0x60'),'ToUserId':_0xf2a891['id']};_0x50836f[_0x5f49e1+'MessageId']=_0x225bfb['id'];_0x50836f[_0x5f49e1+_0x8e00('0x61')]=_0x225bfb[_0x8e00('0x5e')]['id'];_0x50836f[_0x8e00('0x6d')+_0x5f49e1+_0xc009fd+'Id']=_0x225bfb[_0x8e00('0x5c')]['id'];return db[_0x5f49e1+'TransferReport'][_0x8e00('0x64')](_0x50836f);})[_0x8e00('0xb')](function(){return respondWithRpcPromise(_0x8e00('0x6e'),{'channel':_0x1c99ed,'interaction':_0x225bfb[_0x8e00('0x5e')],'message':_0x225bfb,'account':_0x225bfb[_0x8e00('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8e00('0x69'),'appdata':_0xf2a891['name']+','+(_0x225bfb['Account']['agentTransferTimeout']||0x12c),'interval':_0x8e00('0x65')}]},routingClient);})[_0x8e00('0xb')](respondWithResult(_0x320e91,null))[_0x8e00('0xe')](handleError(_0x320e91,null));}; \ No newline at end of file +var _0x4399=['agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','api','jayson/promise','client','http','request','then','error','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','TransferReport','create','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Message','messageId','queue','Start'];(function(_0x441548,_0x12eed5){var _0xe1300=function(_0x859aad){while(--_0x859aad){_0x441548['push'](_0x441548['shift']());}};_0xe1300(++_0x12eed5);}(_0x4399,0x14f));var _0x9439=function(_0x5eddc0,_0x57fede){_0x5eddc0=_0x5eddc0-0x0;var _0x317152=_0x4399[_0x5eddc0];return _0x317152;};'use strict';var BPromise=require(_0x9439('0x0'));var moment=require(_0x9439('0x1'));var _=require(_0x9439('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x9439('0x3'));var jayson=require(_0x9439('0x4'));var amiClient=jayson[_0x9439('0x5')][_0x9439('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x9439('0x6')]({'port':0x232b});var routingClient=jayson[_0x9439('0x5')][_0x9439('0x6')]({'port':0x232c});function respondWithRpcPromise(_0xee89b4,_0x58682c,_0x3d9313){return new BPromise(function(_0x4c66f4,_0x58c2f4){var _0x4f68d0=_0x3d9313?_0x3d9313:amiClient;return _0x4f68d0[_0x9439('0x7')](_0xee89b4,_0x58682c)[_0x9439('0x8')](function(_0x83a8df){if(_0x83a8df[_0x9439('0x9')]){if(_0x83a8df[_0x9439('0x9')]['code']===0x1f4){return _0x58c2f4(_0x83a8df[_0x9439('0x9')][_0x9439('0xa')]);}return _0x4c66f4(_0x83a8df[_0x9439('0x9')][_0x9439('0xa')]);}else{_0x4c66f4(_0x83a8df[_0x9439('0xb')]);}})[_0x9439('0xc')](function(_0x2e4f59){_0x58c2f4(_0x2e4f59);});});}function respondWithResult(_0x4a520d,_0x5095e2){_0x5095e2=_0x5095e2||0xc8;return function(_0x411dda){if(_0x411dda){return _0x4a520d[_0x9439('0xd')](_0x5095e2)['json'](_0x411dda);}return _0x4a520d[_0x9439('0xe')](0x194);};}function handleError(_0x49ce37,_0x2c9ca){_0x2c9ca=_0x2c9ca||0x1f4;return function(_0x313521){logger[_0x9439('0x9')](_0x313521[_0x9439('0xf')]);if(_0x313521['name']){delete _0x313521[_0x9439('0x10')];}_0x49ce37['status'](_0x2c9ca)[_0x9439('0x11')](_0x313521);};}function findById(_0x346393){return function(_0x179b4b){if(!_['isNil'](_0x346393)&&!_[_0x9439('0x12')](_0x179b4b)&&!_[_0x9439('0x12')](_0x179b4b[_0x9439('0x13')])){return _[_0x9439('0x14')](_0x179b4b['rows'],function(_0x26e80f){return _0x26e80f['id']==_0x346393;});}return null;};}exports[_0x9439('0x15')]=function(_0x30de5c,_0x1077be){return respondWithRpcPromise('VoiceChannels',_0x30de5c[_0x9439('0x16')])['then'](respondWithResult(_0x1077be,null))[_0x9439('0xc')](handleError(_0x1077be,null));};exports[_0x9439('0x17')]=function(_0x13e271,_0x236904){return respondWithRpcPromise(_0x9439('0x18'),_[_0x9439('0x19')](_0x13e271['query'],_0x13e271[_0x9439('0x1a')]))['then'](respondWithResult(_0x236904,null))[_0x9439('0xc')](handleError(_0x236904,null));};exports[_0x9439('0x1b')]=function(_0x424a12,_0x2bfdb9){return respondWithRpcPromise(_0x9439('0x1c'),_[_0x9439('0x19')](_0x424a12['query'],_0x424a12['params']))[_0x9439('0x8')](respondWithResult(_0x2bfdb9,null))[_0x9439('0xc')](handleError(_0x2bfdb9,null));};exports['voiceQueues']=function(_0x3dde16,_0x49f905){return respondWithRpcPromise(_0x9439('0x1d'),_0x3dde16['query'])[_0x9439('0x8')](respondWithResult(_0x49f905,null))[_0x9439('0xc')](handleError(_0x49f905,null));};exports[_0x9439('0x1e')]=function(_0x534fea,_0x3d6c78){return respondWithRpcPromise(_0x9439('0x1d'),_0x534fea[_0x9439('0x16')])[_0x9439('0x8')](findById(_0x534fea[_0x9439('0x1a')]['id']))[_0x9439('0x8')](respondWithResult(_0x3d6c78,null))[_0x9439('0xc')](handleError(_0x3d6c78,null));};exports[_0x9439('0x1f')]=function(_0x3b2f9d,_0x3a2b52){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x9439('0x19')](_0x3b2f9d[_0x9439('0x16')],_0x3b2f9d[_0x9439('0x1a')]))[_0x9439('0x8')](respondWithResult(_0x3a2b52,null))['catch'](handleError(_0x3a2b52,null));};exports[_0x9439('0x20')]=function(_0x2ea4e4,_0xa6959b){return respondWithRpcPromise('VoiceQueuesChannels',_0x2ea4e4['query'])[_0x9439('0x8')](respondWithResult(_0xa6959b,null))[_0x9439('0xc')](handleError(_0xa6959b,null));};exports[_0x9439('0x21')]=function(_0x33f03a,_0x1411a2){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x9439('0x19')](_0x33f03a[_0x9439('0x16')],_0x33f03a['params']))[_0x9439('0x8')](respondWithResult(_0x1411a2,null))[_0x9439('0xc')](handleError(_0x1411a2,null));};exports[_0x9439('0x22')]=function(_0x4ec8a9,_0x43abb9){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x9439('0x19')](_0x4ec8a9[_0x9439('0x16')],_0x4ec8a9[_0x9439('0x1a')]))[_0x9439('0x8')](respondWithResult(_0x43abb9,null))[_0x9439('0xc')](handleError(_0x43abb9,null));};exports[_0x9439('0x23')]=function(_0x55c6ac,_0xb94359){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x9439('0x19')](_0x55c6ac[_0x9439('0x16')],_0x55c6ac[_0x9439('0x1a')]))[_0x9439('0x8')](respondWithResult(_0xb94359,null))[_0x9439('0xc')](handleError(_0xb94359,null));};exports['outbound']=function(_0x54bfec,_0x5e28c9){return respondWithRpcPromise(_0x9439('0x24'),_0x54bfec['query'])[_0x9439('0x8')](respondWithResult(_0x5e28c9,null))['catch'](handleError(_0x5e28c9,null));};exports['outboundChannels']=function(_0x8703b9,_0x2f76e9){return respondWithRpcPromise(_0x9439('0x25'),_0x8703b9['query'])['then'](respondWithResult(_0x2f76e9,null))['catch'](handleError(_0x2f76e9,null));};exports[_0x9439('0x26')]=function(_0xd241c6,_0x4d870d){var _0x350ca8;return respondWithRpcPromise(_0x9439('0x27'),_0xd241c6[_0x9439('0x16')])[_0x9439('0x8')](function(_0x281921){_0x350ca8=_0x281921;return respondWithRpcPromise(_0x9439('0x27'),_0xd241c6[_0x9439('0x16')],routingClient);})[_0x9439('0x8')](function(_0xa2126e){return _['merge']({},_0xa2126e,_0x350ca8);})['then'](respondWithResult(_0x4d870d,null))['catch'](handleError(_0x4d870d,null));};exports[_0x9439('0x28')]=function(_0x1e7cf5,_0x47c452){if(_0x1e7cf5[_0x9439('0x29')]&&_0x1e7cf5[_0x9439('0x29')][_0x9439('0x2a')]&&_0x1e7cf5['user']&&_0x1e7cf5[_0x9439('0x2b')]['name']){for(var _0xa4395d in _0x1e7cf5[_0x9439('0x29')]['interaction']){if(_0x1e7cf5[_0x9439('0x29')][_0x9439('0x2a')]['hasOwnProperty'](_0xa4395d)){db[_0x9439('0x2c')][_0x9439('0x2d')]({'where':{'channel':_0xa4395d,'membername':_0x1e7cf5['user']['name'],'type':_0x9439('0x2e'),'exitAt':null,'uniqueid':_0x1e7cf5['body'][_0x9439('0x2a')][_0xa4395d]&&_0x1e7cf5[_0x9439('0x29')][_0x9439('0x2a')][_0xa4395d][_0x9439('0x2f')]?{'$notIn':_0x1e7cf5[_0x9439('0x29')][_0x9439('0x2a')][_0xa4395d]}:{'$ne':null}}})['then'](function(_0x14258c){var _0x1283e1=moment()[_0x9439('0x30')](_0x9439('0x31'));for(var _0x3df2c8=0x0,_0x120a1a=_0x14258c[_0x9439('0x2f')];_0x3df2c8<_0x120a1a;_0x3df2c8+=0x1){_0x14258c[_0x3df2c8][_0x9439('0x32')]({'exitAt':_0x1283e1});}});for(var _0x50043b=0x0;_0x50043b<_0x1e7cf5[_0x9439('0x29')][_0x9439('0x2a')][_0xa4395d][_0x9439('0x2f')];_0x50043b+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0xa4395d,'membername':_0x1e7cf5['user']['name'],'type':_0x9439('0x2e'),'uniqueid':_0x1e7cf5[_0x9439('0x29')][_0x9439('0x2a')][_0xa4395d][_0x50043b],'exitAt':null},'defaults':{'channel':_0xa4395d,'membername':_0x1e7cf5['user']['name'],'interface':_[_0x9439('0x12')](_0x1e7cf5[_0x9439('0x2b')][_0x9439('0x33')])?util[_0x9439('0x30')](_0x9439('0x34'),_0x1e7cf5[_0x9439('0x2b')]['name']):_0x1e7cf5[_0x9439('0x2b')][_0x9439('0x33')],'type':_0x9439('0x2e'),'enterAt':moment()[_0x9439('0x30')](_0x9439('0x31')),'role':_0x9439('0x35'),'internal':_0x1e7cf5[_0x9439('0x2b')][_0x9439('0x36')],'uniqueid':_0x1e7cf5['body']['interaction'][_0xa4395d][_0x50043b]}});}}}}return respondWithRpcPromise(_0x9439('0x37'),{'id':_0x1e7cf5[_0x9439('0x1a')]['id'],'capacity':_0x1e7cf5[_0x9439('0x29')]['capacity']},routingClient)[_0x9439('0x8')](respondWithResult(_0x47c452,null))[_0x9439('0xc')](handleError(_0x47c452,null));};exports[_0x9439('0x38')]=function(_0x310dcb,_0x84dfe0){return respondWithRpcPromise('Telephones',_0x310dcb[_0x9439('0x16')])[_0x9439('0x8')](respondWithResult(_0x84dfe0,null))[_0x9439('0xc')](handleError(_0x84dfe0,null));};exports[_0x9439('0x39')]=function(_0x44fa13,_0x468675){return respondWithRpcPromise(_0x9439('0x3a'),_0x44fa13[_0x9439('0x16')])[_0x9439('0x8')](respondWithResult(_0x468675,null))[_0x9439('0xc')](handleError(_0x468675,null));};exports['campaigns']=function(_0x173a3f,_0x1e48c7){return respondWithRpcPromise(_0x9439('0x3b'),_0x173a3f[_0x9439('0x16')])['then'](respondWithResult(_0x1e48c7,null))[_0x9439('0xc')](handleError(_0x1e48c7,null));};exports[_0x9439('0x3c')]=function(_0x170a2b,_0x484f80){return respondWithRpcPromise(_0x9439('0x3d'),_0x170a2b[_0x9439('0x16')],routingClient)['then'](respondWithResult(_0x484f80,null))[_0x9439('0xc')](handleError(_0x484f80,null));};exports[_0x9439('0x3e')]=function(_0x10f0ef,_0x16e867){return respondWithRpcPromise(_0x9439('0x3d'),_0x10f0ef[_0x9439('0x16')],routingClient)['then'](findById(_0x10f0ef[_0x9439('0x1a')]['id']))['then'](respondWithResult(_0x16e867,null))[_0x9439('0xc')](handleError(_0x16e867,null));};exports['mailQueues']=function(_0x1763a5,_0x187e17){return respondWithRpcPromise(_0x9439('0x3f'),_0x1763a5[_0x9439('0x16')],routingClient)[_0x9439('0x8')](respondWithResult(_0x187e17,null))[_0x9439('0xc')](handleError(_0x187e17,null));};exports[_0x9439('0x40')]=function(_0x18284f,_0x52d3c1){return respondWithRpcPromise('MailQueues',_0x18284f[_0x9439('0x16')],routingClient)[_0x9439('0x8')](findById(_0x18284f[_0x9439('0x1a')]['id']))[_0x9439('0x8')](respondWithResult(_0x52d3c1,null))[_0x9439('0xc')](handleError(_0x52d3c1,null));};exports[_0x9439('0x41')]=function(_0x27befe,_0x57fbf6){return respondWithRpcPromise('MailAccounts',_0x27befe['query'],mailClient)['then'](respondWithResult(_0x57fbf6,null))[_0x9439('0xc')](handleError(_0x57fbf6,null));};exports[_0x9439('0x42')]=function(_0xd14376,_0x15fc67){return respondWithRpcPromise(_0x9439('0x43'),_0xd14376[_0x9439('0x16')],routingClient)[_0x9439('0x8')](respondWithResult(_0x15fc67,null))[_0x9439('0xc')](handleError(_0x15fc67,null));};exports[_0x9439('0x44')]=function(_0x1dcdfb,_0x1c73e1){return respondWithRpcPromise(_0x9439('0x43'),_0x1dcdfb[_0x9439('0x16')],routingClient)[_0x9439('0x8')](findById(_0x1dcdfb[_0x9439('0x1a')]['id']))[_0x9439('0x8')](respondWithResult(_0x1c73e1,null))[_0x9439('0xc')](handleError(_0x1c73e1,null));};exports[_0x9439('0x45')]=function(_0x9ca983,_0x1b2a3e){return respondWithRpcPromise(_0x9439('0x46'),_0x9ca983[_0x9439('0x16')],routingClient)[_0x9439('0x8')](respondWithResult(_0x1b2a3e,null))[_0x9439('0xc')](handleError(_0x1b2a3e,null));};exports[_0x9439('0x47')]=function(_0x38e13f,_0x4a2d3c){return respondWithRpcPromise(_0x9439('0x46'),_0x38e13f['query'],routingClient)['then'](findById(_0x38e13f[_0x9439('0x1a')]['id']))[_0x9439('0x8')](respondWithResult(_0x4a2d3c,null))['catch'](handleError(_0x4a2d3c,null));};exports[_0x9439('0x48')]=function(_0x367156,_0xc77853){return respondWithRpcPromise(_0x9439('0x49'),_0x367156['query'],routingClient)[_0x9439('0x8')](respondWithResult(_0xc77853,null))[_0x9439('0xc')](handleError(_0xc77853,null));};exports[_0x9439('0x4a')]=function(_0x563153,_0x3535d9){return respondWithRpcPromise(_0x9439('0x49'),_0x563153['query'],routingClient)[_0x9439('0x8')](findById(_0x563153[_0x9439('0x1a')]['id']))[_0x9439('0x8')](respondWithResult(_0x3535d9,null))[_0x9439('0xc')](handleError(_0x3535d9,null));};exports[_0x9439('0x4b')]=function(_0x40d0a4,_0x584d5d){return respondWithRpcPromise(_0x9439('0x4c'),_0x40d0a4[_0x9439('0x16')])[_0x9439('0x8')](respondWithResult(_0x584d5d,null))['catch'](handleError(_0x584d5d,null));};exports[_0x9439('0x4d')]=function(_0x3fcd78,_0x13c683){return respondWithRpcPromise(_0x9439('0x4e'),_0x3fcd78[_0x9439('0x16')],routingClient)[_0x9439('0x8')](respondWithResult(_0x13c683,null))[_0x9439('0xc')](handleError(_0x13c683,null));};exports[_0x9439('0x4f')]=function(_0x54128e,_0x1310bb){return respondWithRpcPromise(_0x9439('0x50'),_0x54128e[_0x9439('0x16')],routingClient)[_0x9439('0x8')](respondWithResult(_0x1310bb,null))['catch'](handleError(_0x1310bb,null));};exports[_0x9439('0x51')]=function(_0x197233,_0x471696){return respondWithRpcPromise(_0x9439('0x52'),_0x197233['query'],routingClient)[_0x9439('0x8')](respondWithResult(_0x471696,null))[_0x9439('0xc')](handleError(_0x471696,null));};exports['smsQueuesWaitingInteractions']=function(_0x36ec54,_0x431bf2){return respondWithRpcPromise(_0x9439('0x53'),_0x36ec54['query'],routingClient)[_0x9439('0x8')](respondWithResult(_0x431bf2,null))[_0x9439('0xc')](handleError(_0x431bf2,null));};exports['faxQueuesWaitingInteractions']=function(_0x33e62d,_0x3b1726){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x33e62d[_0x9439('0x16')],routingClient)['then'](respondWithResult(_0x3b1726,null))[_0x9439('0xc')](handleError(_0x3b1726,null));};exports[_0x9439('0x54')]=function(_0x4c070b){return function(_0x5c3139,_0x464901){var _0x50d234,_0x26f06c;var _0x1c20da=_[_0x9439('0x55')](_0x4c070b);var _0x342812=_0x4c070b===_0x9439('0x56')?_0x9439('0x57'):_0x9439('0x58');return db[_0x1c20da+_0x9439('0x59')][_0x9439('0x5a')]({'raw':!![],'where':{'id':_0x5c3139[_0x9439('0x1a')]['id']}})[_0x9439('0x8')](function(_0x142fcb){if(_['isNil'](_0x142fcb)){throw new Error(_0x1c20da+_0x9439('0x5b'));}_0x50d234=_0x142fcb;return db[_0x1c20da+'Message'][_0x9439('0x5a')]({'where':{'id':_0x5c3139['body']['messageId']},'include':[{'model':db[_0x1c20da+_0x9439('0x5c')],'as':'Interaction'},{'model':db[_0x1c20da+_0x342812],'as':_0x9439('0x58')}]});})[_0x9439('0x8')](function(_0x25cb10){if(_[_0x9439('0x12')](_0x25cb10)){throw new Error(_0x1c20da+_0x9439('0x5d'));}_0x26f06c=_0x25cb10;return _0x25cb10[_0x9439('0x5e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9439('0x8')](function(){var _0x3f215b={'uniqueid':_0x4c070b+'.'+_0x26f06c['id']+'.'+_0x26f06c[_0x9439('0x5c')]['id'],'FromUserId':_0x5c3139[_0x9439('0x2b')]['id'],'type':'queue'};_0x3f215b[_0x1c20da+_0x9439('0x5f')]=_0x26f06c['id'];_0x3f215b[_0x1c20da+_0x9439('0x60')]=_0x26f06c[_0x9439('0x5c')]['id'];_0x3f215b[_0x9439('0x61')+_0x1c20da+_0x342812+'Id']=_0x26f06c[_0x9439('0x58')]['id'];_0x3f215b['To'+_0x1c20da+'QueueId']=_0x50d234['id'];return db[_0x1c20da+_0x9439('0x62')][_0x9439('0x63')](_0x3f215b);})[_0x9439('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x4c070b,'interaction':_0x26f06c[_0x9439('0x5c')],'message':_0x26f06c,'account':_0x26f06c[_0x9439('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x50d234[_0x9439('0x10')]+','+(_0x26f06c[_0x9439('0x58')][_0x9439('0x64')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x9439('0x8')](respondWithResult(_0x464901,null))[_0x9439('0xc')](handleError(_0x464901,null));};};exports[_0x9439('0x65')]=function(_0x2d1793,_0x1f8b0e){var _0x9c7876,_0x13464e;if(_[_0x9439('0x12')](_0x2d1793[_0x9439('0x29')][_0x9439('0x66')])){throw new Error(_0x9439('0x67'));}var _0x37bfb3=_0x2d1793[_0x9439('0x29')]['channel'];var _0x57ee6b=_[_0x9439('0x55')](_0x37bfb3);var _0x546ebd=_0x37bfb3===_0x9439('0x56')?'Website':'Account';return db[_0x9439('0x68')][_0x9439('0x5a')]({'raw':!![],'where':{'id':_0x2d1793[_0x9439('0x1a')]['id'],'role':_0x9439('0x35')}})[_0x9439('0x8')](function(_0x484ea2){if(_[_0x9439('0x12')](_0x484ea2)){throw new Error('Agent\x20not\x20found');}_0x9c7876=_0x484ea2;return db[_0x57ee6b+_0x9439('0x69')]['findOne']({'where':{'id':_0x2d1793[_0x9439('0x29')][_0x9439('0x6a')]},'include':[{'model':db[_0x57ee6b+_0x9439('0x5c')],'as':_0x9439('0x5c')},{'model':db[_0x57ee6b+_0x546ebd],'as':'Account'}]});})['then'](function(_0x2161ce){if(_[_0x9439('0x12')](_0x2161ce)){throw new Error(_0x57ee6b+_0x9439('0x5d'));}_0x13464e=_0x2161ce;return _0x2161ce[_0x9439('0x5e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9439('0x8')](function(){var _0x540bdd={'uniqueid':_0x37bfb3+'.'+_0x13464e['id']+'.'+_0x13464e['Interaction']['id'],'FromUserId':_0x2d1793[_0x9439('0x2b')]['id'],'type':_0x9439('0x6b'),'ToUserId':_0x9c7876['id']};_0x540bdd[_0x57ee6b+'MessageId']=_0x13464e['id'];_0x540bdd[_0x57ee6b+_0x9439('0x60')]=_0x13464e['Interaction']['id'];_0x540bdd[_0x9439('0x61')+_0x57ee6b+_0x546ebd+'Id']=_0x13464e[_0x9439('0x58')]['id'];return db[_0x57ee6b+_0x9439('0x62')]['create'](_0x540bdd);})['then'](function(){return respondWithRpcPromise(_0x9439('0x6c'),{'channel':_0x37bfb3,'interaction':_0x13464e[_0x9439('0x5c')],'message':_0x13464e,'account':_0x13464e[_0x9439('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x9c7876[_0x9439('0x10')]+','+(_0x13464e[_0x9439('0x58')][_0x9439('0x6d')]||0x12c),'interval':_0x9439('0x6e')}]},routingClient);})[_0x9439('0x8')](respondWithResult(_0x1f8b0e,null))['catch'](handleError(_0x1f8b0e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 244c955..d1d26c8 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 _0x059b=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','run','create','put'];(function(_0x2f7a44,_0x2d4dd8){var _0x21b370=function(_0x3842ae){while(--_0x3842ae){_0x2f7a44['push'](_0x2f7a44['shift']());}};_0x21b370(++_0x2d4dd8);}(_0x059b,0x193));var _0xb059=function(_0x4be958,_0x12055c){_0x4be958=_0x4be958-0x0;var _0x50834b=_0x059b[_0x4be958];return _0x50834b;};'use strict';var multer=require(_0xb059('0x0'));var util=require('util');var path=require(_0xb059('0x1'));var timeout=require(_0xb059('0x2'));var express=require(_0xb059('0x3'));var router=express[_0xb059('0x4')]();var auth=require(_0xb059('0x5'));var interaction=require(_0xb059('0x6'));var config=require(_0xb059('0x7'));var controller=require(_0xb059('0x8'));router[_0xb059('0x9')]('/',auth[_0xb059('0xa')](),controller[_0xb059('0xb')]);router[_0xb059('0x9')](_0xb059('0xc'),auth[_0xb059('0xa')](),controller[_0xb059('0xd')]);router[_0xb059('0x9')]('/:id/run',auth[_0xb059('0xa')](),controller[_0xb059('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb059('0xf')]);router[_0xb059('0x10')](_0xb059('0xc'),auth['isAuthenticated'](),controller[_0xb059('0x11')]);router[_0xb059('0x12')](_0xb059('0xc'),auth[_0xb059('0xa')](),controller['destroy']);module[_0xb059('0x13')]=router; \ No newline at end of file +var _0x68df=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','update','delete','destroy'];(function(_0x25a711,_0x205f18){var _0x2f1f53=function(_0x54d872){while(--_0x54d872){_0x25a711['push'](_0x25a711['shift']());}};_0x2f1f53(++_0x205f18);}(_0x68df,0xb1));var _0xf68d=function(_0x5391ef,_0x3c8788){_0x5391ef=_0x5391ef-0x0;var _0x136499=_0x68df[_0x5391ef];return _0x136499;};'use strict';var multer=require(_0xf68d('0x0'));var util=require('util');var path=require(_0xf68d('0x1'));var timeout=require(_0xf68d('0x2'));var express=require(_0xf68d('0x3'));var router=express[_0xf68d('0x4')]();var auth=require(_0xf68d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf68d('0x6'));var controller=require(_0xf68d('0x7'));router[_0xf68d('0x8')]('/',auth[_0xf68d('0x9')](),controller[_0xf68d('0xa')]);router['get'](_0xf68d('0xb'),auth['isAuthenticated'](),controller[_0xf68d('0xc')]);router[_0xf68d('0x8')](_0xf68d('0xd'),auth[_0xf68d('0x9')](),controller[_0xf68d('0xe')]);router[_0xf68d('0xf')]('/',auth[_0xf68d('0x9')](),controller[_0xf68d('0x10')]);router[_0xf68d('0x11')](_0xf68d('0xb'),auth[_0xf68d('0x9')](),controller[_0xf68d('0x12')]);router[_0xf68d('0x13')](_0xf68d('0xb'),auth[_0xf68d('0x9')](),controller[_0xf68d('0x14')]);module[_0xf68d('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index b5f2e8e..2a266cb 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 _0xff15=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','hours','days','csv','pdf','xlsx','custom','default','sequelize','exports','STRING','BOOLEAN'];(function(_0x4539b6,_0x1643c9){var _0x5bb0c4=function(_0x1cc83d){while(--_0x1cc83d){_0x4539b6['push'](_0x4539b6['shift']());}};_0x5bb0c4(++_0x1643c9);}(_0xff15,0x8c));var _0x5ff1=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0xff15[_0x6c0123];return _0x5a87d2;};'use strict';var Sequelize=require(_0x5ff1('0x0'));module[_0x5ff1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5ff1('0x2')]},'active':{'type':Sequelize[_0x5ff1('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5ff1('0x4')},'startAt':{'type':Sequelize[_0x5ff1('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x5ff1('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5ff1('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5ff1('0x7')](_0x5ff1('0x8'),_0x5ff1('0x9'),_0x5ff1('0xa'),'weeks','days',_0x5ff1('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x5ff1('0xc')},'output':{'type':Sequelize['ENUM'](_0x5ff1('0xd'),_0x5ff1('0xe'),_0x5ff1('0xf')),'allowNull':![],'defaultValue':_0x5ff1('0xd')},'type':{'type':Sequelize[_0x5ff1('0x7')](_0x5ff1('0x10'),_0x5ff1('0x11')),'allowNull':![],'defaultValue':_0x5ff1('0x10')},'sendMail':{'type':Sequelize[_0x5ff1('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5ff1('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x5ff1('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0607=['INTEGER','years','quarters','months','days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0x0607,0x1d5));var _0x7060=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0607[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7060('0x0'));module[_0x7060('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7060('0x2')]},'active':{'type':Sequelize[_0x7060('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7060('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x7060('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7060('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x7060('0x7'),_0x7060('0x8'),_0x7060('0x9'),'weeks',_0x7060('0xa'),_0x7060('0xb'),_0x7060('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x7060('0xd'),_0x7060('0xe'),_0x7060('0xf')),'allowNull':![],'defaultValue':_0x7060('0xd')},'type':{'type':Sequelize['ENUM'](_0x7060('0x10'),_0x7060('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x7060('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x7060('0x2')]},'cc':{'type':Sequelize[_0x7060('0x12')]},'bcc':{'type':Sequelize[_0x7060('0x12')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 4e1542d..dcc3580 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 _0x0452=['path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','Schedule','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','count','includeAll','findAll','rows','catch','show','params','include','merge','options','find','create','role','user','get','Scheduler','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','../../config/schedule','run','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util'];(function(_0x188352,_0x53c522){var _0x4e0825=function(_0x5ecf96){while(--_0x5ecf96){_0x188352['push'](_0x188352['shift']());}};_0x4e0825(++_0x53c522);}(_0x0452,0xf2));var _0x2045=function(_0x32fe52,_0x321580){_0x32fe52=_0x32fe52-0x0;var _0x5103d0=_0x0452[_0x32fe52];return _0x5103d0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2045('0x0'));var rimraf=require(_0x2045('0x1'));var zipdir=require(_0x2045('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2045('0x3'));var BPromise=require(_0x2045('0x4'));var Mustache=require(_0x2045('0x5'));var util=require(_0x2045('0x6'));var path=require(_0x2045('0x7'));var sox=require(_0x2045('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2045('0x9'));var crypto=require(_0x2045('0xa'));var jsforce=require(_0x2045('0xb'));var deskjs=require(_0x2045('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2045('0xd'));var Papa=require(_0x2045('0xe'));var authService=require(_0x2045('0xf'));var hardwareService=require(_0x2045('0x10'));var Redis=require('ioredis');var qs=require(_0x2045('0x11'));var logger=require(_0x2045('0x12'))(_0x2045('0x13'));var utils=require(_0x2045('0x14'));var config=require(_0x2045('0x15'));var db=require(_0x2045('0x16'))['db'];function respondWithStatusCode(_0x76f317,_0x86a88c){_0x86a88c=_0x86a88c||0xcc;return function(_0x32c2b8){if(_0x32c2b8){return _0x76f317['sendStatus'](_0x86a88c);}return _0x76f317[_0x2045('0x17')](_0x86a88c)[_0x2045('0x18')]();};}function respondWithResult(_0x5bc9bc,_0x435f29){_0x435f29=_0x435f29||0xc8;return function(_0x341798){if(_0x341798){return _0x5bc9bc[_0x2045('0x17')](_0x435f29)[_0x2045('0x19')](_0x341798);}};}function respondWithFilteredResult(_0x13b72e,_0xa4350e){return function(_0x3da81c){if(_0x3da81c){var _0x3a286f=_0x3da81c['count'],_0x3be5d3=_0xa4350e['offset'],_0x21fbab=_0xa4350e[_0x2045('0x1a')]+_0xa4350e[_0x2045('0x1b')],_0x1d0c1d;if(_0x21fbab>=_0x3a286f){_0x21fbab=_0x3a286f;_0x1d0c1d=0xc8;}else{_0x1d0c1d=0xce;}_0x13b72e[_0x2045('0x17')](_0x1d0c1d);return _0x13b72e[_0x2045('0x1c')]('Content-Range',_0x3be5d3+'-'+_0x21fbab+'/'+_0x3a286f)['json'](_0x3da81c);}return null;};}function patchUpdates(_0x38c978){return function(_0x455814){try{jsonpatch[_0x2045('0x1d')](_0x455814,_0x38c978,!![]);}catch(_0x55debe){return BPromise[_0x2045('0x1e')](_0x55debe);}return _0x455814[_0x2045('0x1f')]();};}function saveUpdates(_0x4775ff,_0x23a384){return function(_0xb5f15c){if(_0xb5f15c){return _0xb5f15c[_0x2045('0x20')](_0x4775ff)[_0x2045('0x21')](function(_0x133328){return _0x133328;});}return null;};}function removeEntity(_0x4ffe0e,_0x320320){return function(_0x43ff90){if(_0x43ff90){return _0x43ff90[_0x2045('0x22')]()[_0x2045('0x21')](function(){var _0x20bc0f=_0x43ff90['get']({'plain':!![]});var _0x2d1b21='Scheduler';return db['UserProfileResource'][_0x2045('0x22')]({'where':{'type':_0x2d1b21,'resourceId':_0x20bc0f['id']}})['then'](function(){return _0x43ff90;});})[_0x2045('0x21')](function(){_0x4ffe0e[_0x2045('0x17')](0xcc)[_0x2045('0x18')]();});}};}function handleEntityNotFound(_0x11bcb1,_0x36ff3d){return function(_0x56a640){if(!_0x56a640){_0x11bcb1[_0x2045('0x23')](0x194);}return _0x56a640;};}function handleError(_0x42b6f6,_0x49d26a){_0x49d26a=_0x49d26a||0x1f4;return function(_0x1211f8){logger[_0x2045('0x24')](_0x1211f8['stack']);if(_0x1211f8[_0x2045('0x25')]){delete _0x1211f8['name'];}_0x42b6f6[_0x2045('0x17')](_0x49d26a)[_0x2045('0x26')](_0x1211f8);};}exports[_0x2045('0x27')]=function(_0x5ef5e6,_0x5ea9f3){var _0x2c921f={},_0x120720={},_0x16ecf4={'count':0x0,'rows':[]};var _0x26e65e=db[_0x2045('0x28')]['rawAttributes'];_0x120720['model']=_[_0x2045('0x29')](_0x26e65e);_0x120720[_0x2045('0x2a')]=_['keys'](_0x5ef5e6['query']);_0x120720[_0x2045('0x2b')]=_[_0x2045('0x2c')](_0x120720[_0x2045('0x2d')],_0x120720['query']);_0x2c921f[_0x2045('0x2e')]=_[_0x2045('0x2c')](_0x120720[_0x2045('0x2d')],qs[_0x2045('0x2f')](_0x5ef5e6[_0x2045('0x2a')][_0x2045('0x2f')]));_0x2c921f[_0x2045('0x2e')]=_0x2c921f[_0x2045('0x2e')][_0x2045('0x30')]?_0x2c921f[_0x2045('0x2e')]:_0x120720[_0x2045('0x2d')];if(!_0x5ef5e6['query']['hasOwnProperty'](_0x2045('0x31'))){_0x2c921f[_0x2045('0x1b')]=qs['limit'](_0x5ef5e6[_0x2045('0x2a')]['limit']);_0x2c921f['offset']=qs[_0x2045('0x1a')](_0x5ef5e6[_0x2045('0x2a')][_0x2045('0x1a')]);}_0x2c921f[_0x2045('0x32')]=qs[_0x2045('0x33')](_0x5ef5e6['query'][_0x2045('0x33')]);_0x2c921f[_0x2045('0x34')]=qs[_0x2045('0x2b')](_[_0x2045('0x35')](_0x5ef5e6[_0x2045('0x2a')],_0x120720[_0x2045('0x2b')]));if(_0x5ef5e6[_0x2045('0x2a')]['filter']){_0x2c921f[_0x2045('0x34')]=_['merge'](_0x2c921f[_0x2045('0x34')],{'$or':_[_0x2045('0x36')](_0x26e65e,function(_0x4f7257){if(_0x4f7257[_0x2045('0x37')][_0x2045('0x38')]!==_0x2045('0x39')){var _0x3723ee={};_0x3723ee[_0x4f7257[_0x2045('0x3a')]]={'$like':'%'+_0x5ef5e6[_0x2045('0x2a')][_0x2045('0x3b')]+'%'};return _0x3723ee;}})});}_0x2c921f=_['merge']({},_0x2c921f,_0x5ef5e6['options']);var _0x2bb2c3={'where':_0x2c921f['where']};return db[_0x2045('0x28')][_0x2045('0x3c')](_0x2bb2c3)['then'](function(_0x4e1d91){_0x16ecf4[_0x2045('0x3c')]=_0x4e1d91;if(_0x5ef5e6[_0x2045('0x2a')][_0x2045('0x3d')]){_0x2c921f['include']=[{'all':!![]}];}return db['Schedule'][_0x2045('0x3e')](_0x2c921f);})['then'](function(_0x42b12b){_0x16ecf4[_0x2045('0x3f')]=_0x42b12b;return _0x16ecf4;})[_0x2045('0x21')](respondWithFilteredResult(_0x5ea9f3,_0x2c921f))[_0x2045('0x40')](handleError(_0x5ea9f3,null));};exports[_0x2045('0x41')]=function(_0x34903a,_0x3da219){var _0x1a69b6={'raw':![],'where':{'id':_0x34903a[_0x2045('0x42')]['id']}},_0xa4015f={};_0xa4015f[_0x2045('0x2d')]=_[_0x2045('0x29')](db[_0x2045('0x28')]['rawAttributes']);_0xa4015f[_0x2045('0x2a')]=_[_0x2045('0x29')](_0x34903a['query']);_0xa4015f['filters']=_[_0x2045('0x2c')](_0xa4015f[_0x2045('0x2d')],_0xa4015f[_0x2045('0x2a')]);_0x1a69b6[_0x2045('0x2e')]=_[_0x2045('0x2c')](_0xa4015f[_0x2045('0x2d')],qs[_0x2045('0x2f')](_0x34903a[_0x2045('0x2a')][_0x2045('0x2f')]));_0x1a69b6['attributes']=_0x1a69b6[_0x2045('0x2e')][_0x2045('0x30')]?_0x1a69b6[_0x2045('0x2e')]:_0xa4015f[_0x2045('0x2d')];if(_0x34903a[_0x2045('0x2a')][_0x2045('0x3d')]){_0x1a69b6[_0x2045('0x43')]=[{'all':!![]}];}_0x1a69b6=_[_0x2045('0x44')]({},_0x1a69b6,_0x34903a[_0x2045('0x45')]);return db[_0x2045('0x28')][_0x2045('0x46')](_0x1a69b6)[_0x2045('0x21')](handleEntityNotFound(_0x3da219,null))['then'](respondWithResult(_0x3da219,null))['catch'](handleError(_0x3da219,null));};exports[_0x2045('0x47')]=function(_0x49fc3a,_0x5aaf6e){return db[_0x2045('0x28')][_0x2045('0x47')](_0x49fc3a['body'],{})[_0x2045('0x21')](function(_0x47034f){var _0x3a696e=_0x49fc3a['user']['get']({'plain':!![]});if(!_0x3a696e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a696e[_0x2045('0x48')]===_0x2045('0x49')){var _0x5a79aa=_0x47034f[_0x2045('0x4a')]({'plain':!![]});var _0x429b46=_0x2045('0x4b');return db[_0x2045('0x4c')][_0x2045('0x46')]({'where':{'name':_0x429b46,'userProfileId':_0x3a696e[_0x2045('0x4d')]},'raw':!![]})[_0x2045('0x21')](function(_0x200145){if(_0x200145&&_0x200145[_0x2045('0x4e')]===0x0){return db['UserProfileResource'][_0x2045('0x47')]({'name':_0x5a79aa[_0x2045('0x25')],'resourceId':_0x5a79aa['id'],'type':_0x200145['name'],'sectionId':_0x200145['id']},{})[_0x2045('0x21')](function(){return _0x47034f;});}else{return _0x47034f;}})[_0x2045('0x40')](function(_0x2fafa8){logger[_0x2045('0x24')](_0x2045('0x4f'),_0x2fafa8);throw _0x2fafa8;});}return _0x47034f;})['then'](respondWithResult(_0x5aaf6e,0xc9))['catch'](handleError(_0x5aaf6e,null));};exports[_0x2045('0x20')]=function(_0x48099e,_0x18d126){if(_0x48099e[_0x2045('0x50')]['id']){delete _0x48099e[_0x2045('0x50')]['id'];}return db['Schedule'][_0x2045('0x46')]({'where':{'id':_0x48099e[_0x2045('0x42')]['id']}})[_0x2045('0x21')](handleEntityNotFound(_0x18d126,null))['then'](saveUpdates(_0x48099e[_0x2045('0x50')],null))[_0x2045('0x21')](respondWithResult(_0x18d126,null))[_0x2045('0x40')](handleError(_0x18d126,null));};exports[_0x2045('0x22')]=function(_0x31f193,_0x4cad29){return db['Schedule']['find']({'where':{'id':_0x31f193[_0x2045('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cad29,null))[_0x2045('0x21')](removeEntity(_0x4cad29,null))[_0x2045('0x40')](handleError(_0x4cad29,null));};exports['run']=function(_0x2aa48b,_0x430121,_0x1cd598){var _0x57fa81=require(_0x2045('0x51'));return db['Schedule'][_0x2045('0x46')]({'where':{'id':_0x2aa48b[_0x2045('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x430121,null))['then'](function(){_0x57fa81[_0x2045('0x52')](_0x2aa48b[_0x2045('0x42')]['id']);})[_0x2045('0x21')](respondWithStatusCode(_0x430121,null))['catch'](handleError(_0x430121,null));}; \ No newline at end of file +var _0xae66=['key','VIRTUAL','field','options','count','include','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','run','../../config/schedule','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','end','stack','send','index','Schedule','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xae66,0x110));var _0x6ae6=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xae66[_0x1e4360];return _0x31e6b4;};'use strict';var pdf=require(_0x6ae6('0x0'));var emlformat=require(_0x6ae6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6ae6('0x2'));var jsonpatch=require(_0x6ae6('0x3'));var rp=require('request-promise');var moment=require(_0x6ae6('0x4'));var BPromise=require(_0x6ae6('0x5'));var Mustache=require(_0x6ae6('0x6'));var util=require(_0x6ae6('0x7'));var path=require(_0x6ae6('0x8'));var sox=require(_0x6ae6('0x9'));var csv=require(_0x6ae6('0xa'));var ejs=require(_0x6ae6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6ae6('0xc'));var crypto=require('crypto');var jsforce=require(_0x6ae6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6ae6('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x6ae6('0xe'));var hardwareService=require(_0x6ae6('0xf'));var Redis=require(_0x6ae6('0x10'));var qs=require(_0x6ae6('0x11'));var logger=require(_0x6ae6('0x12'))(_0x6ae6('0x13'));var utils=require(_0x6ae6('0x14'));var config=require(_0x6ae6('0x15'));var db=require(_0x6ae6('0x16'))['db'];function respondWithStatusCode(_0x27641d,_0x5a0cfc){_0x5a0cfc=_0x5a0cfc||0xcc;return function(_0x475bb9){if(_0x475bb9){return _0x27641d[_0x6ae6('0x17')](_0x5a0cfc);}return _0x27641d[_0x6ae6('0x18')](_0x5a0cfc)['end']();};}function respondWithResult(_0x4f1f71,_0x41ae16){_0x41ae16=_0x41ae16||0xc8;return function(_0x40d816){if(_0x40d816){return _0x4f1f71[_0x6ae6('0x18')](_0x41ae16)['json'](_0x40d816);}};}function respondWithFilteredResult(_0x209d12,_0x478252){return function(_0x4b2263){if(_0x4b2263){var _0x347150=_0x4b2263['count'],_0x13257f=_0x478252[_0x6ae6('0x19')],_0x54025b=_0x478252['offset']+_0x478252[_0x6ae6('0x1a')],_0x5a27a8;if(_0x54025b>=_0x347150){_0x54025b=_0x347150;_0x5a27a8=0xc8;}else{_0x5a27a8=0xce;}_0x209d12[_0x6ae6('0x18')](_0x5a27a8);return _0x209d12['set'](_0x6ae6('0x1b'),_0x13257f+'-'+_0x54025b+'/'+_0x347150)['json'](_0x4b2263);}return null;};}function patchUpdates(_0xf04428){return function(_0x3c0f7a){try{jsonpatch[_0x6ae6('0x1c')](_0x3c0f7a,_0xf04428,!![]);}catch(_0x28bea4){return BPromise[_0x6ae6('0x1d')](_0x28bea4);}return _0x3c0f7a[_0x6ae6('0x1e')]();};}function saveUpdates(_0x150dd5,_0x576d09){return function(_0x5999be){if(_0x5999be){return _0x5999be[_0x6ae6('0x1f')](_0x150dd5)['then'](function(_0x245a96){return _0x245a96;});}return null;};}function removeEntity(_0x460eae,_0xc36497){return function(_0x20fcbb){if(_0x20fcbb){return _0x20fcbb[_0x6ae6('0x20')]()[_0x6ae6('0x21')](function(){var _0x396ba1=_0x20fcbb[_0x6ae6('0x22')]({'plain':!![]});var _0x5b0769=_0x6ae6('0x23');return db[_0x6ae6('0x24')]['destroy']({'where':{'type':_0x5b0769,'resourceId':_0x396ba1['id']}})[_0x6ae6('0x21')](function(){return _0x20fcbb;});})[_0x6ae6('0x21')](function(){_0x460eae['status'](0xcc)[_0x6ae6('0x25')]();});}};}function handleEntityNotFound(_0x11cca5,_0x1a75b1){return function(_0x2dd773){if(!_0x2dd773){_0x11cca5[_0x6ae6('0x17')](0x194);}return _0x2dd773;};}function handleError(_0xc74348,_0x1f2707){_0x1f2707=_0x1f2707||0x1f4;return function(_0x177fe5){logger['error'](_0x177fe5[_0x6ae6('0x26')]);if(_0x177fe5['name']){delete _0x177fe5['name'];}_0xc74348[_0x6ae6('0x18')](_0x1f2707)[_0x6ae6('0x27')](_0x177fe5);};}exports[_0x6ae6('0x28')]=function(_0x28b911,_0x137a4a){var _0x39a2be={},_0x5c76c7={},_0x52d405={'count':0x0,'rows':[]};var _0x49472a=db[_0x6ae6('0x29')][_0x6ae6('0x2a')];_0x5c76c7['model']=_[_0x6ae6('0x2b')](_0x49472a);_0x5c76c7[_0x6ae6('0x2c')]=_['keys'](_0x28b911[_0x6ae6('0x2c')]);_0x5c76c7[_0x6ae6('0x2d')]=_['intersection'](_0x5c76c7['model'],_0x5c76c7[_0x6ae6('0x2c')]);_0x39a2be[_0x6ae6('0x2e')]=_[_0x6ae6('0x2f')](_0x5c76c7[_0x6ae6('0x30')],qs[_0x6ae6('0x31')](_0x28b911[_0x6ae6('0x2c')][_0x6ae6('0x31')]));_0x39a2be[_0x6ae6('0x2e')]=_0x39a2be[_0x6ae6('0x2e')][_0x6ae6('0x32')]?_0x39a2be[_0x6ae6('0x2e')]:_0x5c76c7['model'];if(!_0x28b911[_0x6ae6('0x2c')][_0x6ae6('0x33')](_0x6ae6('0x34'))){_0x39a2be[_0x6ae6('0x1a')]=qs[_0x6ae6('0x1a')](_0x28b911[_0x6ae6('0x2c')][_0x6ae6('0x1a')]);_0x39a2be[_0x6ae6('0x19')]=qs['offset'](_0x28b911[_0x6ae6('0x2c')][_0x6ae6('0x19')]);}_0x39a2be['order']=qs[_0x6ae6('0x35')](_0x28b911[_0x6ae6('0x2c')][_0x6ae6('0x35')]);_0x39a2be[_0x6ae6('0x36')]=qs[_0x6ae6('0x2d')](_[_0x6ae6('0x37')](_0x28b911[_0x6ae6('0x2c')],_0x5c76c7[_0x6ae6('0x2d')]));if(_0x28b911[_0x6ae6('0x2c')][_0x6ae6('0x38')]){_0x39a2be[_0x6ae6('0x36')]=_[_0x6ae6('0x39')](_0x39a2be['where'],{'$or':_[_0x6ae6('0x3a')](_0x49472a,function(_0x2030dc){if(_0x2030dc[_0x6ae6('0x3b')][_0x6ae6('0x3c')]!==_0x6ae6('0x3d')){var _0x26cb20={};_0x26cb20[_0x2030dc[_0x6ae6('0x3e')]]={'$like':'%'+_0x28b911[_0x6ae6('0x2c')][_0x6ae6('0x38')]+'%'};return _0x26cb20;}})});}_0x39a2be=_['merge']({},_0x39a2be,_0x28b911[_0x6ae6('0x3f')]);var _0x3d132c={'where':_0x39a2be['where']};return db[_0x6ae6('0x29')]['count'](_0x3d132c)[_0x6ae6('0x21')](function(_0x22d1f3){_0x52d405[_0x6ae6('0x40')]=_0x22d1f3;if(_0x28b911['query']['includeAll']){_0x39a2be[_0x6ae6('0x41')]=[{'all':!![]}];}return db[_0x6ae6('0x29')]['findAll'](_0x39a2be);})[_0x6ae6('0x21')](function(_0x1b4ba0){_0x52d405['rows']=_0x1b4ba0;return _0x52d405;})[_0x6ae6('0x21')](respondWithFilteredResult(_0x137a4a,_0x39a2be))[_0x6ae6('0x42')](handleError(_0x137a4a,null));};exports[_0x6ae6('0x43')]=function(_0x56d3df,_0x4fec97){var _0x215a6f={'raw':![],'where':{'id':_0x56d3df[_0x6ae6('0x44')]['id']}},_0x3eb24a={};_0x3eb24a['model']=_[_0x6ae6('0x2b')](db['Schedule'][_0x6ae6('0x2a')]);_0x3eb24a[_0x6ae6('0x2c')]=_[_0x6ae6('0x2b')](_0x56d3df['query']);_0x3eb24a[_0x6ae6('0x2d')]=_[_0x6ae6('0x2f')](_0x3eb24a[_0x6ae6('0x30')],_0x3eb24a[_0x6ae6('0x2c')]);_0x215a6f[_0x6ae6('0x2e')]=_[_0x6ae6('0x2f')](_0x3eb24a[_0x6ae6('0x30')],qs[_0x6ae6('0x31')](_0x56d3df[_0x6ae6('0x2c')]['fields']));_0x215a6f['attributes']=_0x215a6f['attributes'][_0x6ae6('0x32')]?_0x215a6f[_0x6ae6('0x2e')]:_0x3eb24a[_0x6ae6('0x30')];if(_0x56d3df[_0x6ae6('0x2c')][_0x6ae6('0x45')]){_0x215a6f[_0x6ae6('0x41')]=[{'all':!![]}];}_0x215a6f=_[_0x6ae6('0x39')]({},_0x215a6f,_0x56d3df[_0x6ae6('0x3f')]);return db['Schedule']['find'](_0x215a6f)[_0x6ae6('0x21')](handleEntityNotFound(_0x4fec97,null))['then'](respondWithResult(_0x4fec97,null))[_0x6ae6('0x42')](handleError(_0x4fec97,null));};exports['create']=function(_0x335850,_0xe08ecd){return db['Schedule'][_0x6ae6('0x46')](_0x335850['body'],{})[_0x6ae6('0x21')](function(_0x1d5d30){var _0x57dceb=_0x335850[_0x6ae6('0x47')][_0x6ae6('0x22')]({'plain':!![]});if(!_0x57dceb)throw new Error(_0x6ae6('0x48'));if(_0x57dceb[_0x6ae6('0x49')]==='user'){var _0x4b7639=_0x1d5d30[_0x6ae6('0x22')]({'plain':!![]});var _0x465fd9=_0x6ae6('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x465fd9,'userProfileId':_0x57dceb[_0x6ae6('0x4a')]},'raw':!![]})[_0x6ae6('0x21')](function(_0x198bbf){if(_0x198bbf&&_0x198bbf[_0x6ae6('0x4b')]===0x0){return db[_0x6ae6('0x24')]['create']({'name':_0x4b7639['name'],'resourceId':_0x4b7639['id'],'type':_0x198bbf[_0x6ae6('0x4c')],'sectionId':_0x198bbf['id']},{})[_0x6ae6('0x21')](function(){return _0x1d5d30;});}else{return _0x1d5d30;}})[_0x6ae6('0x42')](function(_0x47120c){logger[_0x6ae6('0x4d')](_0x6ae6('0x4e'),_0x47120c);throw _0x47120c;});}return _0x1d5d30;})[_0x6ae6('0x21')](respondWithResult(_0xe08ecd,0xc9))[_0x6ae6('0x42')](handleError(_0xe08ecd,null));};exports[_0x6ae6('0x1f')]=function(_0x36b829,_0x312f28){if(_0x36b829['body']['id']){delete _0x36b829[_0x6ae6('0x4f')]['id'];}return db['Schedule'][_0x6ae6('0x50')]({'where':{'id':_0x36b829[_0x6ae6('0x44')]['id']}})[_0x6ae6('0x21')](handleEntityNotFound(_0x312f28,null))['then'](saveUpdates(_0x36b829[_0x6ae6('0x4f')],null))['then'](respondWithResult(_0x312f28,null))['catch'](handleError(_0x312f28,null));};exports[_0x6ae6('0x20')]=function(_0x2f3741,_0x969a40){return db[_0x6ae6('0x29')][_0x6ae6('0x50')]({'where':{'id':_0x2f3741[_0x6ae6('0x44')]['id']}})[_0x6ae6('0x21')](handleEntityNotFound(_0x969a40,null))[_0x6ae6('0x21')](removeEntity(_0x969a40,null))[_0x6ae6('0x42')](handleError(_0x969a40,null));};exports[_0x6ae6('0x51')]=function(_0x388fe2,_0x355df4,_0x4cd7a3){var _0x495cf7=require(_0x6ae6('0x52'));return db[_0x6ae6('0x29')][_0x6ae6('0x50')]({'where':{'id':_0x388fe2['params']['id']},'raw':!![]})[_0x6ae6('0x21')](handleEntityNotFound(_0x355df4,null))['then'](function(){_0x495cf7[_0x6ae6('0x51')](_0x388fe2[_0x6ae6('0x44')]['id']);})[_0x6ae6('0x21')](respondWithStatusCode(_0x355df4,null))[_0x6ae6('0x42')](handleError(_0x355df4,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 138013c..2793904 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 _0xbcc8=['./schedule.attributes','define','tools_schedules','util','api','moment','bluebird','request-promise'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xbcc8,0x9b));var _0x8bcc=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xbcc8[_0x599f41];return _0x2e4d58;};'use strict';var _=require('lodash');var util=require(_0x8bcc('0x0'));var logger=require('../../config/logger')(_0x8bcc('0x1'));var moment=require(_0x8bcc('0x2'));var BPromise=require(_0x8bcc('0x3'));var rp=require(_0x8bcc('0x4'));var attributes=require(_0x8bcc('0x5'));module['exports']=function(_0x4a0f57,_0x3bab70){return _0x4a0f57[_0x8bcc('0x6')]('Schedule',attributes,{'tableName':_0x8bcc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x937e=['bluebird','./schedule.attributes','exports','define','Schedule','lodash'];(function(_0x4fb701,_0x209cf5){var _0x5d272a=function(_0x32bcd8){while(--_0x32bcd8){_0x4fb701['push'](_0x4fb701['shift']());}};_0x5d272a(++_0x209cf5);}(_0x937e,0xe3));var _0xe937=function(_0x52eafc,_0x26e770){_0x52eafc=_0x52eafc-0x0;var _0x9858fe=_0x937e[_0x52eafc];return _0x9858fe;};'use strict';var _=require(_0xe937('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe937('0x1'));var rp=require('request-promise');var attributes=require(_0xe937('0x2'));module[_0xe937('0x3')]=function(_0x4db22b,_0x2d2321){return _0x4db22b[_0xe937('0x4')](_0xe937('0x5'),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 a6e4f85..9e5d63f 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 _0x9af6=['message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3b8a26,_0x168cc4){var _0x31bafd=function(_0x3e8667){while(--_0x3e8667){_0x3b8a26['push'](_0x3b8a26['shift']());}};_0x31bafd(++_0x168cc4);}(_0x9af6,0x132));var _0x69af=function(_0xfaeb48,_0x35e639){_0xfaeb48=_0xfaeb48-0x0;var _0x2a6290=_0x9af6[_0xfaeb48];return _0x2a6290;};'use strict';var _=require(_0x69af('0x0'));var util=require('util');var moment=require(_0x69af('0x1'));var BPromise=require('bluebird');var rs=require(_0x69af('0x2'));var fs=require('fs');var Redis=require(_0x69af('0x3'));var db=require(_0x69af('0x4'))['db'];var utils=require(_0x69af('0x5'));var logger=require(_0x69af('0x6'))(_0x69af('0x7'));var config=require(_0x69af('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16c9f7,_0x3818e3,_0x3d0b8b){return new BPromise(function(_0x13e92c,_0x308f96){return client[_0x69af('0x9')](_0x16c9f7,_0x3d0b8b)['then'](function(_0x15794e){logger[_0x69af('0xa')](_0x69af('0xb'),_0x3818e3,'request\x20sent');logger['debug'](_0x69af('0xc'),_0x3818e3,_0x69af('0xd'),JSON[_0x69af('0xe')](_0x15794e));if(_0x15794e[_0x69af('0xf')]){if(_0x15794e[_0x69af('0xf')][_0x69af('0x10')]===0x1f4){logger[_0x69af('0xf')](_0x69af('0xb'),_0x3818e3,_0x15794e[_0x69af('0xf')][_0x69af('0x11')]);return _0x308f96(_0x15794e[_0x69af('0xf')][_0x69af('0x11')]);}logger['error'](_0x69af('0xb'),_0x3818e3,_0x15794e[_0x69af('0xf')][_0x69af('0x11')]);return _0x13e92c(_0x15794e[_0x69af('0xf')][_0x69af('0x11')]);}else{logger[_0x69af('0xa')](_0x69af('0xb'),_0x3818e3,_0x69af('0xd'));_0x13e92c(_0x15794e[_0x69af('0x12')]['message']);}})['catch'](function(_0x2930f8){logger[_0x69af('0xf')]('Schedule,\x20%s,\x20%s',_0x3818e3,_0x2930f8);_0x308f96(_0x2930f8);});});} \ No newline at end of file +var _0xf471=['Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf471,0x1a6));var _0x1f47=function(_0xde449,_0x225cde){_0xde449=_0xde449-0x0;var _0x22a302=_0xf471[_0xde449];return _0x22a302;};'use strict';var _=require(_0x1f47('0x0'));var util=require(_0x1f47('0x1'));var moment=require(_0x1f47('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f47('0x3'));var db=require(_0x1f47('0x4'))['db'];var utils=require(_0x1f47('0x5'));var logger=require(_0x1f47('0x6'))(_0x1f47('0x7'));var config=require(_0x1f47('0x8'));var jayson=require(_0x1f47('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19844e,_0x5062e4,_0x26db15){return new BPromise(function(_0x503025,_0x4bb935){return client[_0x1f47('0xa')](_0x19844e,_0x26db15)[_0x1f47('0xb')](function(_0x3ded50){logger[_0x1f47('0xc')]('Schedule,\x20%s,\x20%s',_0x5062e4,_0x1f47('0xd'));logger[_0x1f47('0xe')](_0x1f47('0xf'),_0x5062e4,_0x1f47('0xd'),JSON[_0x1f47('0x10')](_0x3ded50));if(_0x3ded50[_0x1f47('0x11')]){if(_0x3ded50[_0x1f47('0x11')]['code']===0x1f4){logger[_0x1f47('0x11')](_0x1f47('0x12'),_0x5062e4,_0x3ded50[_0x1f47('0x11')][_0x1f47('0x13')]);return _0x4bb935(_0x3ded50['error']['message']);}logger[_0x1f47('0x11')](_0x1f47('0x12'),_0x5062e4,_0x3ded50[_0x1f47('0x11')]['message']);return _0x503025(_0x3ded50[_0x1f47('0x11')][_0x1f47('0x13')]);}else{logger[_0x1f47('0xc')](_0x1f47('0x12'),_0x5062e4,_0x1f47('0xd'));_0x503025(_0x3ded50[_0x1f47('0x14')]['message']);}})[_0x1f47('0x15')](function(_0x430f20){logger[_0x1f47('0x11')](_0x1f47('0x12'),_0x5062e4,_0x430f20);_0x4bb935(_0x430f20);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index bdd7553..a4724b9 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 _0x0836=['../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','diskStorage','root','format','%s%s','logo','originalname','post','single','addLogo','join','server/files/images/logos/','logologin','extname','preferred','/:id/preferred','file','addPreferred','put','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x277212,_0x1d0079){var _0x3caed0=function(_0x28d6c2){while(--_0x28d6c2){_0x277212['push'](_0x277212['shift']());}};_0x3caed0(++_0x1d0079);}(_0x0836,0x159));var _0x6083=function(_0x4efa44,_0x1501e7){_0x4efa44=_0x4efa44-0x0;var _0x107cf7=_0x0836[_0x4efa44];return _0x107cf7;};'use strict';var multer=require(_0x6083('0x0'));var util=require(_0x6083('0x1'));var path=require(_0x6083('0x2'));var timeout=require(_0x6083('0x3'));var express=require(_0x6083('0x4'));var router=express[_0x6083('0x5')]();var auth=require(_0x6083('0x6'));var interaction=require(_0x6083('0x7'));var config=require(_0x6083('0x8'));var controller=require(_0x6083('0x9'));router[_0x6083('0xa')]('/',auth[_0x6083('0xb')](),controller[_0x6083('0xc')]);router[_0x6083('0xa')](_0x6083('0xd'),controller[_0x6083('0xe')]);router['get'](_0x6083('0xf'),controller['getLogo']);router[_0x6083('0xa')](_0x6083('0x10'),controller[_0x6083('0x11')]);router['get'](_0x6083('0x12'),controller['gdpr']);router['get']('/:id/preferred',controller[_0x6083('0x13')]);var upload=multer({'storage':multer[_0x6083('0x14')]({'destination':function(_0x21eee8,_0x5c06c5,_0x29f84e){_0x29f84e(null,path['join'](config[_0x6083('0x15')],'server/files/images/logos/'));},'filename':function(_0x24b8a4,_0x10acbe,_0x2eec38){_0x2eec38(null,util[_0x6083('0x16')](_0x6083('0x17'),_0x6083('0x18'),path['extname'](_0x10acbe[_0x6083('0x19')])));}})});router[_0x6083('0x1a')](_0x6083('0xf'),upload[_0x6083('0x1b')]('file'),controller[_0x6083('0x1c')]);var upload=multer({'storage':multer[_0x6083('0x14')]({'destination':function(_0x575376,_0xa8663e,_0x1bfe66){_0x1bfe66(null,path[_0x6083('0x1d')](config[_0x6083('0x15')],_0x6083('0x1e')));},'filename':function(_0x5f17ed,_0x277a59,_0x5ee37f){_0x5ee37f(null,util[_0x6083('0x16')](_0x6083('0x17'),_0x6083('0x1f'),path[_0x6083('0x20')](_0x277a59[_0x6083('0x19')])));}})});router[_0x6083('0x1a')](_0x6083('0x10'),upload[_0x6083('0x1b')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x8f2e19,_0x5267dc,_0x29fd61){_0x29fd61(null,path['join'](config[_0x6083('0x15')],_0x6083('0x1e')));},'filename':function(_0x327b79,_0x11607b,_0x510a2c){_0x510a2c(null,util['format'](_0x6083('0x17'),_0x6083('0x21'),path['extname'](_0x11607b[_0x6083('0x19')])));}})});router[_0x6083('0x1a')](_0x6083('0x22'),upload[_0x6083('0x1b')](_0x6083('0x23')),controller[_0x6083('0x24')]);router[_0x6083('0x25')](_0x6083('0xd'),auth['isAuthenticated'](),controller['update']);module[_0x6083('0x26')]=router; \ No newline at end of file +var _0xc205=['logologin','post','file','addLogoLogin','preferred','addPreferred','put','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xc205,0x77));var _0x5c20=function(_0x1aecc6,_0x2d05a6){_0x1aecc6=_0x1aecc6-0x0;var _0x5bcc48=_0xc205[_0x1aecc6];return _0x5bcc48;};'use strict';var multer=require(_0x5c20('0x0'));var util=require(_0x5c20('0x1'));var path=require(_0x5c20('0x2'));var timeout=require(_0x5c20('0x3'));var express=require('express');var router=express[_0x5c20('0x4')]();var auth=require(_0x5c20('0x5'));var interaction=require(_0x5c20('0x6'));var config=require(_0x5c20('0x7'));var controller=require('./setting.controller');router[_0x5c20('0x8')]('/',auth[_0x5c20('0x9')](),controller[_0x5c20('0xa')]);router[_0x5c20('0x8')](_0x5c20('0xb'),controller['show']);router['get'](_0x5c20('0xc'),controller[_0x5c20('0xd')]);router[_0x5c20('0x8')](_0x5c20('0xe'),controller[_0x5c20('0xf')]);router[_0x5c20('0x8')](_0x5c20('0x10'),controller['gdpr']);router[_0x5c20('0x8')](_0x5c20('0x11'),controller[_0x5c20('0x12')]);var upload=multer({'storage':multer[_0x5c20('0x13')]({'destination':function(_0x28d5b0,_0x37141b,_0x32859d){_0x32859d(null,path[_0x5c20('0x14')](config[_0x5c20('0x15')],_0x5c20('0x16')));},'filename':function(_0x5d345e,_0x53c895,_0x58499e){_0x58499e(null,util[_0x5c20('0x17')](_0x5c20('0x18'),_0x5c20('0x19'),path[_0x5c20('0x1a')](_0x53c895[_0x5c20('0x1b')])));}})});router['post']('/:id/logo',upload[_0x5c20('0x1c')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x5c20('0x13')]({'destination':function(_0x400b00,_0x3f805d,_0x6ba484){_0x6ba484(null,path[_0x5c20('0x14')](config[_0x5c20('0x15')],'server/files/images/logos/'));},'filename':function(_0x23742f,_0x509934,_0xcc1489){_0xcc1489(null,util[_0x5c20('0x17')](_0x5c20('0x18'),_0x5c20('0x1d'),path[_0x5c20('0x1a')](_0x509934[_0x5c20('0x1b')])));}})});router[_0x5c20('0x1e')](_0x5c20('0xe'),upload[_0x5c20('0x1c')](_0x5c20('0x1f')),controller[_0x5c20('0x20')]);var upload=multer({'storage':multer[_0x5c20('0x13')]({'destination':function(_0x59e207,_0xcc1bd9,_0x135c93){_0x135c93(null,path[_0x5c20('0x14')](config[_0x5c20('0x15')],'server/files/images/logos/'));},'filename':function(_0x44e91f,_0x13147d,_0x42f75f){_0x42f75f(null,util[_0x5c20('0x17')](_0x5c20('0x18'),_0x5c20('0x21'),path[_0x5c20('0x1a')](_0x13147d[_0x5c20('0x1b')])));}})});router[_0x5c20('0x1e')]('/:id/preferred',upload['single'](_0x5c20('0x1f')),controller[_0x5c20('0x22')]);router[_0x5c20('0x23')]('/:id',auth[_0x5c20('0x9')](),controller['update']);module[_0x5c20('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 67dff05..57e56a0 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 _0xe1d1=['/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','min_internal','INTEGER','min_mailbox'];(function(_0x259a98,_0x8d3d1){var _0x2f538a=function(_0x4240a6){while(--_0x4240a6){_0x259a98['push'](_0x259a98['shift']());}};_0x2f538a(++_0x8d3d1);}(_0xe1d1,0x131));var _0x1e1d=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xe1d1[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require(_0x1e1d('0x0'));module[_0x1e1d('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x1e1d('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1e1d('0x3')](0xb),'unique':_0x1e1d('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1e1d('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x1e1d('0x5')},'logo':{'type':Sequelize[_0x1e1d('0x6')]},'defaultLogo':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x1e1d('0x6')]},'defaultLoginLogo':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1e1d('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1e1d('0x6')]},'turnaddr':{'type':Sequelize[_0x1e1d('0x6')]},'turnusername':{'type':Sequelize[_0x1e1d('0x6')]},'turnpassword':{'type':Sequelize[_0x1e1d('0x6')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1e1d('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1e1d('0x6')],'defaultValue':_0x1e1d('0x8')},'enableEmailPreview':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x1e1d('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1e1d('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1e1d('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1e1d('0x6')],'defaultValue':_0x1e1d('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1e1d('0x6')]},'defaultPreferred':{'type':Sequelize[_0x1e1d('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x032a=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','INTEGER','min_internal'];(function(_0xefb4e,_0xe56689){var _0x36c78c=function(_0x158fe3){while(--_0x158fe3){_0xefb4e['push'](_0xefb4e['shift']());}};_0x36c78c(++_0xe56689);}(_0x032a,0x18d));var _0xa032=function(_0x5a91a5,_0x1eb099){_0x5a91a5=_0x5a91a5-0x0;var _0x8f99de=_0x032a[_0x5a91a5];return _0x8f99de;};'use strict';var Sequelize=require(_0xa032('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xa032('0x1')](0xb),'unique':_0xa032('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xa032('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xa032('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xa032('0x3')],'defaultValue':_0xa032('0x4')},'logo':{'type':Sequelize[_0xa032('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xa032('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xa032('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xa032('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xa032('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xa032('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xa032('0x3')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xa032('0x3')]},'turnpassword':{'type':Sequelize[_0xa032('0x3')]},'pageTitle':{'type':Sequelize[_0xa032('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xa032('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xa032('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xa032('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xa032('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xa032('0x6')},'enableEmailPreview':{'type':Sequelize[_0xa032('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xa032('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xa032('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xa032('0x7')},'chatTimeout':{'type':Sequelize[_0xa032('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xa032('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xa032('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 06d5f23..200af5c 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 _0xda2d=['defaultLogo','defaultPreferred','logo','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','download','default_loginLogo.png','Logo\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','getLicense','default_preferred.png','default','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','stack','name','send','Setting','keys','query','intersection','model','attributes','fields','length','nolimit','sort','filters','pick','filter','merge','map','type','key','VIRTUAL','field','where','includeAll','include','findAll','catch','show','options','find','params','body','get','join','root','server/files/templates/stun.ejs','render','readFileSync','server/files/templates/turn.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xda2d,0x102));var _0xdda2=function(_0x3ece07,_0x17c164){_0x3ece07=_0x3ece07-0x0;var _0x46bd80=_0xda2d[_0x3ece07];return _0x46bd80;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdda2('0x0'));var rimraf=require(_0xdda2('0x1'));var zipdir=require(_0xdda2('0x2'));var jsonpatch=require(_0xdda2('0x3'));var rp=require(_0xdda2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdda2('0x5'));var path=require(_0xdda2('0x6'));var sox=require(_0xdda2('0x7'));var csv=require(_0xdda2('0x8'));var ejs=require(_0xdda2('0x9'));var fs=require('fs');var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xdda2('0x11'));var Redis=require(_0xdda2('0x12'));var qs=require(_0xdda2('0x13'));var logger=require(_0xdda2('0x14'))(_0xdda2('0x15'));var utils=require(_0xdda2('0x16'));var config=require(_0xdda2('0x17'));var db=require(_0xdda2('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa6446b,_0x320f73,_0x3518b9,_0x1503a7){return new BPromise(function(_0x2e4132,_0x475222){var _0x3490f1=_0x1503a7||client;return _0x3490f1['request'](_0xa6446b,_0x3518b9)[_0xdda2('0x19')](function(_0x4b0220){logger[_0xdda2('0x1a')](_0xdda2('0x1b'),_0x320f73,_0xdda2('0x1c'));logger[_0xdda2('0x1d')](_0xdda2('0x1e'),_0x320f73,'request\x20sent',JSON['stringify'](_0x4b0220));if(_0x4b0220[_0xdda2('0x1f')]){if(_0x4b0220['error'][_0xdda2('0x20')]===0x1f4){logger[_0xdda2('0x1f')](_0xdda2('0x1b'),_0x320f73,_0x4b0220[_0xdda2('0x1f')][_0xdda2('0x21')]);return _0x475222(_0x4b0220[_0xdda2('0x1f')][_0xdda2('0x21')]);}logger[_0xdda2('0x1f')](_0xdda2('0x1b'),_0x320f73,_0x4b0220[_0xdda2('0x1f')][_0xdda2('0x21')]);return _0x2e4132(_0x4b0220[_0xdda2('0x1f')]['message']);}else{logger[_0xdda2('0x1a')]('Setting,\x20%s,\x20%s',_0x320f73,_0xdda2('0x1c'));_0x2e4132(_0x4b0220[_0xdda2('0x22')][_0xdda2('0x21')]);}})['catch'](function(_0x347ee6){logger['error'](_0xdda2('0x1b'),_0x320f73,_0x347ee6);_0x475222(_0x347ee6);});});}function respondWithStatusCode(_0x107ee4,_0x4ac3eb){_0x4ac3eb=_0x4ac3eb||0xcc;return function(_0x144f1e){if(_0x144f1e){return _0x107ee4[_0xdda2('0x23')](_0x4ac3eb);}return _0x107ee4[_0xdda2('0x24')](_0x4ac3eb)[_0xdda2('0x25')]();};}function respondWithResult(_0x45ee9d,_0x5739ad){_0x5739ad=_0x5739ad||0xc8;return function(_0x38cdf){if(_0x38cdf){return _0x45ee9d[_0xdda2('0x24')](_0x5739ad)[_0xdda2('0x26')](_0x38cdf);}};}function respondWithFilteredResult(_0x31d48b,_0x5436d1){return function(_0x4e97dc){if(_0x4e97dc){var _0x28da54=_0x4e97dc[_0xdda2('0x27')],_0x4567e7=_0x5436d1[_0xdda2('0x28')],_0x2e8591=_0x5436d1[_0xdda2('0x28')]+_0x5436d1[_0xdda2('0x29')],_0x5e9e74;if(_0x2e8591>=_0x28da54){_0x2e8591=_0x28da54;_0x5e9e74=0xc8;}else{_0x5e9e74=0xce;}_0x31d48b[_0xdda2('0x24')](_0x5e9e74);return _0x31d48b[_0xdda2('0x2a')]('Content-Range',_0x4567e7+'-'+_0x2e8591+'/'+_0x28da54)[_0xdda2('0x26')](_0x4e97dc);}return null;};}function patchUpdates(_0x255bbc){return function(_0x53acb5){try{jsonpatch[_0xdda2('0x2b')](_0x53acb5,_0x255bbc,!![]);}catch(_0x2cfaca){return BPromise[_0xdda2('0x2c')](_0x2cfaca);}return _0x53acb5[_0xdda2('0x2d')]();};}function saveUpdates(_0x5540e5,_0x129eba){return function(_0x5e107f){if(_0x5e107f){return _0x5e107f['update'](_0x5540e5)[_0xdda2('0x19')](function(_0x5edf7e){return _0x5edf7e;});}return null;};}function removeEntity(_0x2b8cd6,_0x55809a){return function(_0x53ff76){if(_0x53ff76){return _0x53ff76['destroy']()[_0xdda2('0x19')](function(){_0x2b8cd6['status'](0xcc)[_0xdda2('0x25')]();});}};}function handleEntityNotFound(_0x508664,_0x5cba58){return function(_0x52a509){if(!_0x52a509){_0x508664[_0xdda2('0x23')](0x194);}return _0x52a509;};}function handleError(_0x567717,_0xca6046){_0xca6046=_0xca6046||0x1f4;return function(_0x2fd592){logger[_0xdda2('0x1f')](_0x2fd592[_0xdda2('0x2e')]);if(_0x2fd592[_0xdda2('0x2f')]){delete _0x2fd592[_0xdda2('0x2f')];}_0x567717[_0xdda2('0x24')](_0xca6046)[_0xdda2('0x30')](_0x2fd592);};}exports['index']=function(_0x461621,_0x4212da){var _0x2f8674={},_0x3d510c={},_0x392373={'count':0x0,'rows':[]};var _0x33c4b0=db[_0xdda2('0x31')]['rawAttributes'];_0x3d510c['model']=_[_0xdda2('0x32')](_0x33c4b0);_0x3d510c[_0xdda2('0x33')]=_[_0xdda2('0x32')](_0x461621['query']);_0x3d510c['filters']=_[_0xdda2('0x34')](_0x3d510c[_0xdda2('0x35')],_0x3d510c[_0xdda2('0x33')]);_0x2f8674[_0xdda2('0x36')]=_[_0xdda2('0x34')](_0x3d510c['model'],qs[_0xdda2('0x37')](_0x461621[_0xdda2('0x33')]['fields']));_0x2f8674['attributes']=_0x2f8674[_0xdda2('0x36')][_0xdda2('0x38')]?_0x2f8674[_0xdda2('0x36')]:_0x3d510c[_0xdda2('0x35')];if(!_0x461621[_0xdda2('0x33')]['hasOwnProperty'](_0xdda2('0x39'))){_0x2f8674[_0xdda2('0x29')]=qs[_0xdda2('0x29')](_0x461621[_0xdda2('0x33')]['limit']);_0x2f8674['offset']=qs[_0xdda2('0x28')](_0x461621[_0xdda2('0x33')][_0xdda2('0x28')]);}_0x2f8674['order']=qs[_0xdda2('0x3a')](_0x461621['query'][_0xdda2('0x3a')]);_0x2f8674['where']=qs[_0xdda2('0x3b')](_[_0xdda2('0x3c')](_0x461621[_0xdda2('0x33')],_0x3d510c[_0xdda2('0x3b')]));if(_0x461621['query'][_0xdda2('0x3d')]){_0x2f8674['where']=_[_0xdda2('0x3e')](_0x2f8674['where'],{'$or':_[_0xdda2('0x3f')](_0x33c4b0,function(_0x12589b){if(_0x12589b[_0xdda2('0x40')][_0xdda2('0x41')]!==_0xdda2('0x42')){var _0x5acbb8={};_0x5acbb8[_0x12589b[_0xdda2('0x43')]]={'$like':'%'+_0x461621[_0xdda2('0x33')]['filter']+'%'};return _0x5acbb8;}})});}_0x2f8674=_[_0xdda2('0x3e')]({},_0x2f8674,_0x461621['options']);var _0x292e70={'where':_0x2f8674[_0xdda2('0x44')]};return db[_0xdda2('0x31')][_0xdda2('0x27')](_0x292e70)[_0xdda2('0x19')](function(_0x6718ea){_0x392373[_0xdda2('0x27')]=_0x6718ea;if(_0x461621[_0xdda2('0x33')][_0xdda2('0x45')]){_0x2f8674[_0xdda2('0x46')]=[{'all':!![]}];}return db[_0xdda2('0x31')][_0xdda2('0x47')](_0x2f8674);})[_0xdda2('0x19')](function(_0x4d22b3){_0x392373['rows']=_0x4d22b3;return _0x392373;})['then'](respondWithFilteredResult(_0x4212da,_0x2f8674))[_0xdda2('0x48')](handleError(_0x4212da,null));};exports[_0xdda2('0x49')]=function(_0x57b7b0,_0x2c41dc){var _0x18f229={'raw':![],'where':{'id':_0x57b7b0['params']['id']}},_0x22a99e={};_0x22a99e[_0xdda2('0x35')]=_[_0xdda2('0x32')](db['Setting']['rawAttributes']);_0x22a99e[_0xdda2('0x33')]=_['keys'](_0x57b7b0[_0xdda2('0x33')]);_0x22a99e['filters']=_[_0xdda2('0x34')](_0x22a99e[_0xdda2('0x35')],_0x22a99e['query']);_0x18f229['attributes']=_[_0xdda2('0x34')](_0x22a99e[_0xdda2('0x35')],qs[_0xdda2('0x37')](_0x57b7b0[_0xdda2('0x33')]['fields']));_0x18f229[_0xdda2('0x36')]=_0x18f229[_0xdda2('0x36')][_0xdda2('0x38')]?_0x18f229[_0xdda2('0x36')]:_0x22a99e[_0xdda2('0x35')];if(_0x57b7b0['query'][_0xdda2('0x45')]){_0x18f229[_0xdda2('0x46')]=[{'all':!![]}];}_0x18f229=_['merge']({},_0x18f229,_0x57b7b0[_0xdda2('0x4a')]);return db[_0xdda2('0x31')][_0xdda2('0x4b')](_0x18f229)[_0xdda2('0x19')](handleEntityNotFound(_0x2c41dc,null))[_0xdda2('0x19')](respondWithResult(_0x2c41dc,null))[_0xdda2('0x48')](handleError(_0x2c41dc,null));};exports['update']=function(_0x2c58c7,_0x4a9814,_0x361038){var _0x4a70ff;return db[_0xdda2('0x31')]['find']({'where':{'id':_0x2c58c7[_0xdda2('0x4c')]['id']}})[_0xdda2('0x19')](handleEntityNotFound(_0x4a9814,null))[_0xdda2('0x19')](saveUpdates(_0x2c58c7[_0xdda2('0x4d')],null))[_0xdda2('0x19')](function(_0x2b45f3){if(_0x2b45f3){_0x4a70ff=_0x2b45f3[_0xdda2('0x4e')]({'plain':!![]});var _0x40655d=fs['readFileSync'](path[_0xdda2('0x4f')](config[_0xdda2('0x50')],_0xdda2('0x51')),'utf8');var _0xf380b0=ejs[_0xdda2('0x52')](_0x40655d,_0x4a70ff);var _0x56ddf2=fs[_0xdda2('0x53')](path['join'](config[_0xdda2('0x50')],_0xdda2('0x54')),_0xdda2('0x55'));var _0xbfab73=ejs[_0xdda2('0x52')](_0x56ddf2,_0x4a70ff);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0xf380b0);fs['writeFileSync'](_0xdda2('0x56'),_0xbfab73);return respondWithRpcPromise(_0xdda2('0x57'),'update',{'module':_0xdda2('0x58')});}})[_0xdda2('0x19')](function(){return respondWithRpcPromise(_0xdda2('0x57'),'update',{'module':_0xdda2('0x59')});})[_0xdda2('0x19')](function(){return _0x4a70ff||null;})[_0xdda2('0x19')](respondWithResult(_0x4a9814,null))['catch'](handleError(_0x4a9814,null));};exports[_0xdda2('0x5a')]=function(_0x4495e5,_0x7eb83f,_0x25c9a9){if(_0x4495e5['file']&&_0x4495e5[_0xdda2('0x5b')]['filename']){_0x4495e5['body']['logo']=_0x4495e5[_0xdda2('0x5b')][_0xdda2('0x5c')];}return db[_0xdda2('0x31')][_0xdda2('0x4b')]({'where':{'id':_0x4495e5[_0xdda2('0x4c')]['id']}})[_0xdda2('0x19')](handleEntityNotFound(_0x7eb83f,null))[_0xdda2('0x19')](saveUpdates(_0x4495e5[_0xdda2('0x4d')],null))[_0xdda2('0x19')](respondWithResult(_0x7eb83f,null))[_0xdda2('0x48')](handleError(_0x7eb83f,null));};exports[_0xdda2('0x5d')]=function(_0x5e6dcf,_0x215e2a,_0x173022){if(_0x5e6dcf[_0xdda2('0x5b')]&&_0x5e6dcf[_0xdda2('0x5b')][_0xdda2('0x5c')]){_0x5e6dcf[_0xdda2('0x4d')][_0xdda2('0x5e')]=_0x5e6dcf['file'][_0xdda2('0x5c')];}return db[_0xdda2('0x31')][_0xdda2('0x4b')]({'where':{'id':_0x5e6dcf[_0xdda2('0x4c')]['id']}})[_0xdda2('0x19')](handleEntityNotFound(_0x215e2a,null))['then'](saveUpdates(_0x5e6dcf[_0xdda2('0x4d')],null))[_0xdda2('0x19')](respondWithResult(_0x215e2a,null))[_0xdda2('0x48')](handleError(_0x215e2a,null));};var utilLicense=require(_0xdda2('0x5f'));exports[_0xdda2('0x60')]=function(_0x4a6f28,_0x17aaab,_0x18d251){var _0x3d49e8=_0xdda2('0x61');var _0x1ac15a={'custom':![]};return utilLicense['getLicense']()[_0xdda2('0x19')](function(_0x3d7951){if(_0x3d7951){_0x1ac15a=_0x3d7951;}return db[_0xdda2('0x31')]['find']({'where':{'id':_0x4a6f28[_0xdda2('0x4c')]['id']},'attributes':['logo',_0xdda2('0x5e'),_0xdda2('0x62'),_0xdda2('0x63'),'defaultLoginLogo',_0xdda2('0x64')],'raw':!![]});})[_0xdda2('0x19')](handleEntityNotFound(_0x17aaab,null))['then'](function(_0x13c0d9){if(_0x13c0d9){var _0x5adab5=_0x13c0d9[_0xdda2('0x65')]&&fs[_0xdda2('0x66')](path[_0xdda2('0x4f')](config[_0xdda2('0x50')],_0x3d49e8,_[_0xdda2('0x67')](_0x13c0d9['logo'])))?path['join'](config[_0xdda2('0x50')],_0x3d49e8,_[_0xdda2('0x67')](_0x13c0d9['logo'])):path['join'](config[_0xdda2('0x50')],_0x3d49e8,_['toLower'](_0xdda2('0x68')));var _0x1a33ba='default'+_[_0xdda2('0x69')](_0xdda2('0x65'));if(_0x13c0d9[_0x1a33ba]||!_0x1ac15a[_0xdda2('0x6a')]){_0x5adab5=path[_0xdda2('0x4f')](config[_0xdda2('0x50')],_0x3d49e8,_[_0xdda2('0x67')]('default_logo.png'));}if(!fs[_0xdda2('0x66')](_0x5adab5)){throw new db[(_0xdda2('0x6b'))][(_0xdda2('0x6c'))]('Logo\x20not\x20found');}return _0x17aaab[_0xdda2('0x6d')](_0x5adab5);}})[_0xdda2('0x48')](handleError(_0x17aaab,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x375921,_0x232823,_0x2f03b9){var _0x5b8382='server/files/images/logos';var _0x30be55={'custom':![]};return utilLicense['getLicense']()[_0xdda2('0x19')](function(_0x150dcd){if(_0x150dcd){_0x30be55=_0x150dcd;}return db[_0xdda2('0x31')][_0xdda2('0x4b')]({'where':{'id':_0x375921[_0xdda2('0x4c')]['id']},'attributes':[_0xdda2('0x65'),'loginLogo','preferred',_0xdda2('0x63'),'defaultLoginLogo',_0xdda2('0x64')],'raw':!![]});})[_0xdda2('0x19')](handleEntityNotFound(_0x232823,null))[_0xdda2('0x19')](function(_0x19d210){if(_0x19d210){var _0x79ed7=_0x19d210[_0xdda2('0x5e')]&&fs[_0xdda2('0x66')](path[_0xdda2('0x4f')](config[_0xdda2('0x50')],_0x5b8382,_['toLower'](_0x19d210[_0xdda2('0x5e')])))?path[_0xdda2('0x4f')](config[_0xdda2('0x50')],_0x5b8382,_[_0xdda2('0x67')](_0x19d210['loginLogo'])):path[_0xdda2('0x4f')](config[_0xdda2('0x50')],_0x5b8382,_[_0xdda2('0x67')](_0xdda2('0x6e')));var _0x595c84='default'+_[_0xdda2('0x69')](_0xdda2('0x5e'));if(_0x19d210[_0x595c84]||!_0x30be55[_0xdda2('0x6a')]){_0x79ed7=path[_0xdda2('0x4f')](config['root'],_0x5b8382,_[_0xdda2('0x67')](_0xdda2('0x6e')));}if(!fs[_0xdda2('0x66')](_0x79ed7)){throw new db[(_0xdda2('0x6b'))][(_0xdda2('0x6c'))](_0xdda2('0x6f'));}return _0x232823[_0xdda2('0x6d')](_0x79ed7);}})[_0xdda2('0x48')](handleError(_0x232823,null));};exports[_0xdda2('0x70')]=function(_0x10bc49,_0x12ff97){return db[_0xdda2('0x31')][_0xdda2('0x4b')]({'where':{'id':_0x10bc49[_0xdda2('0x4c')]['id']},'attributes':[_0xdda2('0x71')]})['then'](respondWithResult(_0x12ff97,null))[_0xdda2('0x48')](handleError(_0x12ff97,null));};exports[_0xdda2('0x72')]=function(_0x58fcea,_0x50f7f6,_0x3cb641){if(_0x58fcea[_0xdda2('0x5b')]&&_0x58fcea[_0xdda2('0x5b')][_0xdda2('0x5c')]){_0x58fcea[_0xdda2('0x4d')][_0xdda2('0x62')]=_0x58fcea['file'][_0xdda2('0x5c')];}return db[_0xdda2('0x31')][_0xdda2('0x4b')]({'where':{'id':_0x58fcea[_0xdda2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x50f7f6,null))[_0xdda2('0x19')](saveUpdates(_0x58fcea['body'],null))[_0xdda2('0x19')](respondWithResult(_0x50f7f6,null))[_0xdda2('0x48')](handleError(_0x50f7f6,null));};var utilLicense=require('../../config/license/util');exports[_0xdda2('0x73')]=function(_0x3d50fc,_0x1dcc02,_0x1dfe6d){var _0x222099=_0xdda2('0x61');var _0x1c6ef1={'custom':![]};return utilLicense[_0xdda2('0x74')]()[_0xdda2('0x19')](function(_0x3e82bb){if(_0x3e82bb){_0x1c6ef1=_0x3e82bb;}return db[_0xdda2('0x31')]['find']({'where':{'id':_0x3d50fc[_0xdda2('0x4c')]['id']},'attributes':[_0xdda2('0x65'),_0xdda2('0x5e'),_0xdda2('0x62'),_0xdda2('0x63'),'defaultLoginLogo',_0xdda2('0x64')],'raw':!![]});})[_0xdda2('0x19')](handleEntityNotFound(_0x1dcc02,null))['then'](function(_0x319af4){if(_0x319af4){var _0x2df7eb=_0x319af4['preferred']&&fs['existsSync'](path[_0xdda2('0x4f')](config[_0xdda2('0x50')],_0x222099,_[_0xdda2('0x67')](_0x319af4[_0xdda2('0x62')])))?path[_0xdda2('0x4f')](config[_0xdda2('0x50')],_0x222099,_['toLower'](_0x319af4[_0xdda2('0x62')])):path[_0xdda2('0x4f')](config['root'],_0x222099,_[_0xdda2('0x67')](_0xdda2('0x75')));var _0x4b57df=_0xdda2('0x76')+_[_0xdda2('0x69')](_0xdda2('0x62'));if(_0x319af4[_0x4b57df]||!_0x1c6ef1['custom']||!_0x1c6ef1[_0xdda2('0x62')]){_0x2df7eb=path['join'](config[_0xdda2('0x50')],_0x222099,_[_0xdda2('0x67')](_0xdda2('0x75')));}if(!fs[_0xdda2('0x66')](_0x2df7eb)){throw new db['Sequelize']['ValidationError'](_0xdda2('0x6f'));}return _0x1dcc02[_0xdda2('0x6d')](_0x2df7eb);}})['catch'](handleError(_0x1dcc02,null));}; \ No newline at end of file +var _0x7382=['join','server/files/templates/turn.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','upperFirst','ValidationError','Logo\x20not\x20found','download','getLogoLogin','preferred','defaultLogo','default_loginLogo.png','custom','gdpr','securePassword','getPreferred','default_preferred.png','Sequelize','eml-format','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../mysqldb','jayson/promise','client','http','then','Setting,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','send','Setting','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','length','find','body','get','readFileSync','root','utf8'];(function(_0x1b2527,_0x8607e8){var _0x9dbad8=function(_0x231955){while(--_0x231955){_0x1b2527['push'](_0x1b2527['shift']());}};_0x9dbad8(++_0x8607e8);}(_0x7382,0x111));var _0x2738=function(_0x131e7e,_0x386a1e){_0x131e7e=_0x131e7e-0x0;var _0x144154=_0x7382[_0x131e7e];return _0x144154;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2738('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2738('0x1'));var Mustache=require(_0x2738('0x2'));var util=require(_0x2738('0x3'));var path=require(_0x2738('0x4'));var sox=require(_0x2738('0x5'));var csv=require('to-csv');var ejs=require(_0x2738('0x6'));var fs=require('fs');var _=require(_0x2738('0x7'));var squel=require(_0x2738('0x8'));var crypto=require('crypto');var jsforce=require(_0x2738('0x9'));var deskjs=require(_0x2738('0xa'));var toCsv=require(_0x2738('0xb'));var querystring=require('querystring');var Papa=require(_0x2738('0xc'));var authService=require(_0x2738('0xd'));var hardwareService=require(_0x2738('0xe'));var Redis=require('ioredis');var qs=require(_0x2738('0xf'));var logger=require(_0x2738('0x10'))(_0x2738('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2738('0x12'))['db'];var jayson=require(_0x2738('0x13'));var client=jayson[_0x2738('0x14')][_0x2738('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x15dcde,_0x39214a,_0x144fb2,_0x26af9d){return new BPromise(function(_0x3d43cb,_0x3ccb48){var _0x384fd3=_0x26af9d||client;return _0x384fd3['request'](_0x15dcde,_0x144fb2)[_0x2738('0x16')](function(_0x2c6cfa){logger['info'](_0x2738('0x17'),_0x39214a,'request\x20sent');logger[_0x2738('0x18')]('Setting,\x20%s,\x20%s,\x20%s',_0x39214a,_0x2738('0x19'),JSON['stringify'](_0x2c6cfa));if(_0x2c6cfa[_0x2738('0x1a')]){if(_0x2c6cfa[_0x2738('0x1a')][_0x2738('0x1b')]===0x1f4){logger[_0x2738('0x1a')](_0x2738('0x17'),_0x39214a,_0x2c6cfa[_0x2738('0x1a')][_0x2738('0x1c')]);return _0x3ccb48(_0x2c6cfa[_0x2738('0x1a')]['message']);}logger[_0x2738('0x1a')]('Setting,\x20%s,\x20%s',_0x39214a,_0x2c6cfa[_0x2738('0x1a')][_0x2738('0x1c')]);return _0x3d43cb(_0x2c6cfa['error']['message']);}else{logger[_0x2738('0x1d')](_0x2738('0x17'),_0x39214a,_0x2738('0x19'));_0x3d43cb(_0x2c6cfa[_0x2738('0x1e')][_0x2738('0x1c')]);}})[_0x2738('0x1f')](function(_0x18e1d8){logger[_0x2738('0x1a')](_0x2738('0x17'),_0x39214a,_0x18e1d8);_0x3ccb48(_0x18e1d8);});});}function respondWithStatusCode(_0x20ddae,_0x2ea043){_0x2ea043=_0x2ea043||0xcc;return function(_0x502fcb){if(_0x502fcb){return _0x20ddae[_0x2738('0x20')](_0x2ea043);}return _0x20ddae['status'](_0x2ea043)['end']();};}function respondWithResult(_0x3e3b2d,_0x2d8c5b){_0x2d8c5b=_0x2d8c5b||0xc8;return function(_0x218bbe){if(_0x218bbe){return _0x3e3b2d[_0x2738('0x21')](_0x2d8c5b)[_0x2738('0x22')](_0x218bbe);}};}function respondWithFilteredResult(_0x2ea92a,_0x19d6c6){return function(_0x20b347){if(_0x20b347){var _0x4ec0e1=_0x20b347[_0x2738('0x23')],_0x24c8b9=_0x19d6c6['offset'],_0x556d58=_0x19d6c6[_0x2738('0x24')]+_0x19d6c6[_0x2738('0x25')],_0x159183;if(_0x556d58>=_0x4ec0e1){_0x556d58=_0x4ec0e1;_0x159183=0xc8;}else{_0x159183=0xce;}_0x2ea92a['status'](_0x159183);return _0x2ea92a['set']('Content-Range',_0x24c8b9+'-'+_0x556d58+'/'+_0x4ec0e1)['json'](_0x20b347);}return null;};}function patchUpdates(_0x926abd){return function(_0x36444b){try{jsonpatch[_0x2738('0x26')](_0x36444b,_0x926abd,!![]);}catch(_0x40b9ff){return BPromise[_0x2738('0x27')](_0x40b9ff);}return _0x36444b[_0x2738('0x28')]();};}function saveUpdates(_0x53562a,_0x351f46){return function(_0x57c313){if(_0x57c313){return _0x57c313[_0x2738('0x29')](_0x53562a)[_0x2738('0x16')](function(_0x1a6118){return _0x1a6118;});}return null;};}function removeEntity(_0x4e9254,_0xe549ec){return function(_0x401024){if(_0x401024){return _0x401024[_0x2738('0x2a')]()[_0x2738('0x16')](function(){_0x4e9254[_0x2738('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8bc885,_0x55b1ac){return function(_0x5539c2){if(!_0x5539c2){_0x8bc885[_0x2738('0x20')](0x194);}return _0x5539c2;};}function handleError(_0x2214e6,_0x2845af){_0x2845af=_0x2845af||0x1f4;return function(_0x3b5ae0){logger['error'](_0x3b5ae0[_0x2738('0x2b')]);if(_0x3b5ae0[_0x2738('0x2c')]){delete _0x3b5ae0[_0x2738('0x2c')];}_0x2214e6[_0x2738('0x21')](_0x2845af)[_0x2738('0x2d')](_0x3b5ae0);};}exports['index']=function(_0x48413e,_0x151cdd){var _0x47ce59={},_0x138805={},_0x3b2926={'count':0x0,'rows':[]};var _0x152455=db[_0x2738('0x2e')][_0x2738('0x2f')];_0x138805[_0x2738('0x30')]=_[_0x2738('0x31')](_0x152455);_0x138805[_0x2738('0x32')]=_[_0x2738('0x31')](_0x48413e[_0x2738('0x32')]);_0x138805[_0x2738('0x33')]=_[_0x2738('0x34')](_0x138805[_0x2738('0x30')],_0x138805[_0x2738('0x32')]);_0x47ce59[_0x2738('0x35')]=_['intersection'](_0x138805[_0x2738('0x30')],qs[_0x2738('0x36')](_0x48413e[_0x2738('0x32')][_0x2738('0x36')]));_0x47ce59[_0x2738('0x35')]=_0x47ce59[_0x2738('0x35')]['length']?_0x47ce59[_0x2738('0x35')]:_0x138805[_0x2738('0x30')];if(!_0x48413e[_0x2738('0x32')]['hasOwnProperty'](_0x2738('0x37'))){_0x47ce59[_0x2738('0x25')]=qs['limit'](_0x48413e['query'][_0x2738('0x25')]);_0x47ce59['offset']=qs[_0x2738('0x24')](_0x48413e[_0x2738('0x32')][_0x2738('0x24')]);}_0x47ce59[_0x2738('0x38')]=qs[_0x2738('0x39')](_0x48413e[_0x2738('0x32')][_0x2738('0x39')]);_0x47ce59[_0x2738('0x3a')]=qs['filters'](_[_0x2738('0x3b')](_0x48413e[_0x2738('0x32')],_0x138805[_0x2738('0x33')]));if(_0x48413e[_0x2738('0x32')][_0x2738('0x3c')]){_0x47ce59[_0x2738('0x3a')]=_[_0x2738('0x3d')](_0x47ce59[_0x2738('0x3a')],{'$or':_[_0x2738('0x3e')](_0x152455,function(_0x1ac73e){if(_0x1ac73e[_0x2738('0x3f')][_0x2738('0x40')]!==_0x2738('0x41')){var _0xdd668f={};_0xdd668f[_0x1ac73e[_0x2738('0x42')]]={'$like':'%'+_0x48413e[_0x2738('0x32')][_0x2738('0x3c')]+'%'};return _0xdd668f;}})});}_0x47ce59=_['merge']({},_0x47ce59,_0x48413e[_0x2738('0x43')]);var _0x5d1bb8={'where':_0x47ce59['where']};return db[_0x2738('0x2e')][_0x2738('0x23')](_0x5d1bb8)['then'](function(_0x3c4488){_0x3b2926[_0x2738('0x23')]=_0x3c4488;if(_0x48413e[_0x2738('0x32')][_0x2738('0x44')]){_0x47ce59[_0x2738('0x45')]=[{'all':!![]}];}return db['Setting'][_0x2738('0x46')](_0x47ce59);})[_0x2738('0x16')](function(_0x1c93bc){_0x3b2926[_0x2738('0x47')]=_0x1c93bc;return _0x3b2926;})[_0x2738('0x16')](respondWithFilteredResult(_0x151cdd,_0x47ce59))[_0x2738('0x1f')](handleError(_0x151cdd,null));};exports[_0x2738('0x48')]=function(_0x43b6d2,_0x3173e1){var _0x4e6416={'raw':![],'where':{'id':_0x43b6d2[_0x2738('0x49')]['id']}},_0x1bb65f={};_0x1bb65f['model']=_['keys'](db['Setting'][_0x2738('0x2f')]);_0x1bb65f[_0x2738('0x32')]=_[_0x2738('0x31')](_0x43b6d2[_0x2738('0x32')]);_0x1bb65f[_0x2738('0x33')]=_[_0x2738('0x34')](_0x1bb65f[_0x2738('0x30')],_0x1bb65f[_0x2738('0x32')]);_0x4e6416['attributes']=_[_0x2738('0x34')](_0x1bb65f[_0x2738('0x30')],qs[_0x2738('0x36')](_0x43b6d2[_0x2738('0x32')]['fields']));_0x4e6416['attributes']=_0x4e6416[_0x2738('0x35')][_0x2738('0x4a')]?_0x4e6416['attributes']:_0x1bb65f[_0x2738('0x30')];if(_0x43b6d2[_0x2738('0x32')][_0x2738('0x44')]){_0x4e6416[_0x2738('0x45')]=[{'all':!![]}];}_0x4e6416=_[_0x2738('0x3d')]({},_0x4e6416,_0x43b6d2[_0x2738('0x43')]);return db[_0x2738('0x2e')]['find'](_0x4e6416)[_0x2738('0x16')](handleEntityNotFound(_0x3173e1,null))[_0x2738('0x16')](respondWithResult(_0x3173e1,null))[_0x2738('0x1f')](handleError(_0x3173e1,null));};exports[_0x2738('0x29')]=function(_0x30b34d,_0x540afc,_0x6105d2){var _0x30e4f7;return db[_0x2738('0x2e')][_0x2738('0x4b')]({'where':{'id':_0x30b34d[_0x2738('0x49')]['id']}})[_0x2738('0x16')](handleEntityNotFound(_0x540afc,null))[_0x2738('0x16')](saveUpdates(_0x30b34d[_0x2738('0x4c')],null))[_0x2738('0x16')](function(_0x22150a){if(_0x22150a){_0x30e4f7=_0x22150a[_0x2738('0x4d')]({'plain':!![]});var _0x2276fe=fs[_0x2738('0x4e')](path['join'](config[_0x2738('0x4f')],'server/files/templates/stun.ejs'),_0x2738('0x50'));var _0x43fcd0=ejs['render'](_0x2276fe,_0x30e4f7);var _0x8bd5c8=fs[_0x2738('0x4e')](path[_0x2738('0x51')](config['root'],_0x2738('0x52')),_0x2738('0x50'));var _0x4b2928=ejs[_0x2738('0x53')](_0x8bd5c8,_0x30e4f7);fs[_0x2738('0x54')](_0x2738('0x55'),_0x43fcd0);fs[_0x2738('0x54')](_0x2738('0x56'),_0x4b2928);return respondWithRpcPromise(_0x2738('0x57'),'update',{'module':_0x2738('0x58')});}})['then'](function(){return respondWithRpcPromise(_0x2738('0x57'),_0x2738('0x29'),{'module':_0x2738('0x59')});})[_0x2738('0x16')](function(){return _0x30e4f7||null;})[_0x2738('0x16')](respondWithResult(_0x540afc,null))[_0x2738('0x1f')](handleError(_0x540afc,null));};exports['addLogo']=function(_0xd6e643,_0x4f00ee,_0x5800c3){if(_0xd6e643[_0x2738('0x5a')]&&_0xd6e643[_0x2738('0x5a')][_0x2738('0x5b')]){_0xd6e643[_0x2738('0x4c')][_0x2738('0x5c')]=_0xd6e643[_0x2738('0x5a')][_0x2738('0x5b')];}return db[_0x2738('0x2e')]['find']({'where':{'id':_0xd6e643[_0x2738('0x49')]['id']}})[_0x2738('0x16')](handleEntityNotFound(_0x4f00ee,null))[_0x2738('0x16')](saveUpdates(_0xd6e643['body'],null))[_0x2738('0x16')](respondWithResult(_0x4f00ee,null))[_0x2738('0x1f')](handleError(_0x4f00ee,null));};exports[_0x2738('0x5d')]=function(_0x489fa4,_0x45f9e5,_0x580a80){if(_0x489fa4[_0x2738('0x5a')]&&_0x489fa4['file']['filename']){_0x489fa4[_0x2738('0x4c')][_0x2738('0x5e')]=_0x489fa4[_0x2738('0x5a')][_0x2738('0x5b')];}return db[_0x2738('0x2e')][_0x2738('0x4b')]({'where':{'id':_0x489fa4[_0x2738('0x49')]['id']}})[_0x2738('0x16')](handleEntityNotFound(_0x45f9e5,null))[_0x2738('0x16')](saveUpdates(_0x489fa4['body'],null))[_0x2738('0x16')](respondWithResult(_0x45f9e5,null))['catch'](handleError(_0x45f9e5,null));};var utilLicense=require(_0x2738('0x5f'));exports['getLogo']=function(_0x569af5,_0x273c9a,_0x529561){var _0x29e784=_0x2738('0x60');var _0x4a1028={'custom':![]};return utilLicense[_0x2738('0x61')]()[_0x2738('0x16')](function(_0x21b7e5){if(_0x21b7e5){_0x4a1028=_0x21b7e5;}return db[_0x2738('0x2e')]['find']({'where':{'id':_0x569af5[_0x2738('0x49')]['id']},'attributes':[_0x2738('0x5c'),_0x2738('0x5e'),'preferred','defaultLogo',_0x2738('0x62'),_0x2738('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x273c9a,null))[_0x2738('0x16')](function(_0x4c38f8){if(_0x4c38f8){var _0x42ded3=_0x4c38f8[_0x2738('0x5c')]&&fs[_0x2738('0x64')](path['join'](config['root'],_0x29e784,_[_0x2738('0x65')](_0x4c38f8[_0x2738('0x5c')])))?path[_0x2738('0x51')](config[_0x2738('0x4f')],_0x29e784,_[_0x2738('0x65')](_0x4c38f8[_0x2738('0x5c')])):path['join'](config[_0x2738('0x4f')],_0x29e784,_[_0x2738('0x65')](_0x2738('0x66')));var _0x2c5682=_0x2738('0x67')+_[_0x2738('0x68')](_0x2738('0x5c'));if(_0x4c38f8[_0x2c5682]||!_0x4a1028['custom']){_0x42ded3=path[_0x2738('0x51')](config[_0x2738('0x4f')],_0x29e784,_[_0x2738('0x65')](_0x2738('0x66')));}if(!fs['existsSync'](_0x42ded3)){throw new db['Sequelize'][(_0x2738('0x69'))](_0x2738('0x6a'));}return _0x273c9a[_0x2738('0x6b')](_0x42ded3);}})[_0x2738('0x1f')](handleError(_0x273c9a,null));};var utilLicense=require('../../config/license/util');exports[_0x2738('0x6c')]=function(_0x36bc62,_0x3321ad,_0x4c56b4){var _0x371f63=_0x2738('0x60');var _0x12e7f2={'custom':![]};return utilLicense[_0x2738('0x61')]()[_0x2738('0x16')](function(_0x8c3f7){if(_0x8c3f7){_0x12e7f2=_0x8c3f7;}return db[_0x2738('0x2e')][_0x2738('0x4b')]({'where':{'id':_0x36bc62[_0x2738('0x49')]['id']},'attributes':[_0x2738('0x5c'),_0x2738('0x5e'),_0x2738('0x6d'),_0x2738('0x6e'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x3321ad,null))['then'](function(_0x1cd3a5){if(_0x1cd3a5){var _0xf55fd9=_0x1cd3a5['loginLogo']&&fs[_0x2738('0x64')](path[_0x2738('0x51')](config[_0x2738('0x4f')],_0x371f63,_['toLower'](_0x1cd3a5[_0x2738('0x5e')])))?path[_0x2738('0x51')](config[_0x2738('0x4f')],_0x371f63,_[_0x2738('0x65')](_0x1cd3a5['loginLogo'])):path[_0x2738('0x51')](config['root'],_0x371f63,_[_0x2738('0x65')](_0x2738('0x6f')));var _0x36b7d0='default'+_[_0x2738('0x68')](_0x2738('0x5e'));if(_0x1cd3a5[_0x36b7d0]||!_0x12e7f2[_0x2738('0x70')]){_0xf55fd9=path[_0x2738('0x51')](config['root'],_0x371f63,_[_0x2738('0x65')](_0x2738('0x6f')));}if(!fs[_0x2738('0x64')](_0xf55fd9)){throw new db['Sequelize'][(_0x2738('0x69'))]('Logo\x20not\x20found');}return _0x3321ad[_0x2738('0x6b')](_0xf55fd9);}})['catch'](handleError(_0x3321ad,null));};exports[_0x2738('0x71')]=function(_0x543059,_0x1d6b34){return db[_0x2738('0x2e')][_0x2738('0x4b')]({'where':{'id':_0x543059[_0x2738('0x49')]['id']},'attributes':[_0x2738('0x72')]})[_0x2738('0x16')](respondWithResult(_0x1d6b34,null))[_0x2738('0x1f')](handleError(_0x1d6b34,null));};exports['addPreferred']=function(_0x3de720,_0x3a962f,_0x50d848){if(_0x3de720['file']&&_0x3de720[_0x2738('0x5a')][_0x2738('0x5b')]){_0x3de720[_0x2738('0x4c')][_0x2738('0x6d')]=_0x3de720[_0x2738('0x5a')]['filename'];}return db[_0x2738('0x2e')][_0x2738('0x4b')]({'where':{'id':_0x3de720['params']['id']}})['then'](handleEntityNotFound(_0x3a962f,null))[_0x2738('0x16')](saveUpdates(_0x3de720[_0x2738('0x4c')],null))[_0x2738('0x16')](respondWithResult(_0x3a962f,null))[_0x2738('0x1f')](handleError(_0x3a962f,null));};var utilLicense=require(_0x2738('0x5f'));exports[_0x2738('0x73')]=function(_0x333b3f,_0x47dd6e,_0x25f46a){var _0x1efddc=_0x2738('0x60');var _0x2e0a64={'custom':![]};return utilLicense[_0x2738('0x61')]()[_0x2738('0x16')](function(_0x28021f){if(_0x28021f){_0x2e0a64=_0x28021f;}return db[_0x2738('0x2e')][_0x2738('0x4b')]({'where':{'id':_0x333b3f[_0x2738('0x49')]['id']},'attributes':[_0x2738('0x5c'),_0x2738('0x5e'),'preferred',_0x2738('0x6e'),_0x2738('0x62'),_0x2738('0x63')],'raw':!![]});})[_0x2738('0x16')](handleEntityNotFound(_0x47dd6e,null))[_0x2738('0x16')](function(_0x5f199b){if(_0x5f199b){var _0x9ce8d=_0x5f199b[_0x2738('0x6d')]&&fs[_0x2738('0x64')](path[_0x2738('0x51')](config['root'],_0x1efddc,_[_0x2738('0x65')](_0x5f199b[_0x2738('0x6d')])))?path[_0x2738('0x51')](config['root'],_0x1efddc,_[_0x2738('0x65')](_0x5f199b[_0x2738('0x6d')])):path[_0x2738('0x51')](config['root'],_0x1efddc,_[_0x2738('0x65')](_0x2738('0x74')));var _0x487f8e=_0x2738('0x67')+_[_0x2738('0x68')](_0x2738('0x6d'));if(_0x5f199b[_0x487f8e]||!_0x2e0a64[_0x2738('0x70')]||!_0x2e0a64[_0x2738('0x6d')]){_0x9ce8d=path['join'](config[_0x2738('0x4f')],_0x1efddc,_[_0x2738('0x65')]('default_preferred.png'));}if(!fs[_0x2738('0x64')](_0x9ce8d)){throw new db[(_0x2738('0x75'))]['ValidationError'](_0x2738('0x6a'));}return _0x47dd6e[_0x2738('0x6b')](_0x9ce8d);}})[_0x2738('0x1f')](handleError(_0x47dd6e,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 01a777c..92b07a1 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 _0x04f9=['../../config/logger','api','moment','bluebird','request-promise','exports','define','Setting','settings','lodash','util'];(function(_0x127eee,_0x4ffc1c){var _0x5df898=function(_0xe8076){while(--_0xe8076){_0x127eee['push'](_0x127eee['shift']());}};_0x5df898(++_0x4ffc1c);}(_0x04f9,0x127));var _0x904f=function(_0x63bc8f,_0x552679){_0x63bc8f=_0x63bc8f-0x0;var _0x503fbd=_0x04f9[_0x63bc8f];return _0x503fbd;};'use strict';var _=require(_0x904f('0x0'));var util=require(_0x904f('0x1'));var logger=require(_0x904f('0x2'))(_0x904f('0x3'));var moment=require(_0x904f('0x4'));var BPromise=require(_0x904f('0x5'));var rp=require(_0x904f('0x6'));var attributes=require('./setting.attributes');module[_0x904f('0x7')]=function(_0x95bb07,_0x29bfa0){return _0x95bb07[_0x904f('0x8')](_0x904f('0x9'),attributes,{'tableName':_0x904f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa284=['bluebird','request-promise','exports','define','Setting','settings','../../config/logger','api','moment'];(function(_0x14f788,_0x1e0031){var _0xbae5de=function(_0xe3cccb){while(--_0xe3cccb){_0x14f788['push'](_0x14f788['shift']());}};_0xbae5de(++_0x1e0031);}(_0xa284,0x1da));var _0x4a28=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa284[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4a28('0x0'))(_0x4a28('0x1'));var moment=require(_0x4a28('0x2'));var BPromise=require(_0x4a28('0x3'));var rp=require(_0x4a28('0x4'));var attributes=require('./setting.attributes');module[_0x4a28('0x5')]=function(_0x31cbcc,_0x3b0135){return _0x31cbcc[_0x4a28('0x6')](_0x4a28('0x7'),attributes,{'tableName':_0x4a28('0x8'),'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 fa167b8..d07ab0c 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 _0x0b18=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Setting,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x389fb1,_0x431673){var _0x3d3520=function(_0x2dcab7){while(--_0x2dcab7){_0x389fb1['push'](_0x389fb1['shift']());}};_0x3d3520(++_0x431673);}(_0x0b18,0x122));var _0x80b1=function(_0x779496,_0x9b0b0b){_0x779496=_0x779496-0x0;var _0x472493=_0x0b18[_0x779496];return _0x472493;};'use strict';var _=require(_0x80b1('0x0'));var util=require(_0x80b1('0x1'));var moment=require(_0x80b1('0x2'));var BPromise=require(_0x80b1('0x3'));var rs=require(_0x80b1('0x4'));var fs=require('fs');var Redis=require(_0x80b1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x80b1('0x6'));var logger=require(_0x80b1('0x7'))(_0x80b1('0x8'));var config=require('../../config/environment');var jayson=require(_0x80b1('0x9'));var client=jayson['client'][_0x80b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a54c4,_0x5773a8,_0xe1a215){return new BPromise(function(_0x1cbd5a,_0x404579){return client[_0x80b1('0xb')](_0x3a54c4,_0xe1a215)[_0x80b1('0xc')](function(_0x14b85e){logger[_0x80b1('0xd')]('Setting,\x20%s,\x20%s',_0x5773a8,'request\x20sent');logger['debug'](_0x80b1('0xe'),_0x5773a8,_0x80b1('0xf'),JSON[_0x80b1('0x10')](_0x14b85e));if(_0x14b85e['error']){if(_0x14b85e[_0x80b1('0x11')]['code']===0x1f4){logger[_0x80b1('0x11')](_0x80b1('0x12'),_0x5773a8,_0x14b85e[_0x80b1('0x11')]['message']);return _0x404579(_0x14b85e[_0x80b1('0x11')][_0x80b1('0x13')]);}logger['error'](_0x80b1('0x12'),_0x5773a8,_0x14b85e['error'][_0x80b1('0x13')]);return _0x1cbd5a(_0x14b85e[_0x80b1('0x11')][_0x80b1('0x13')]);}else{logger[_0x80b1('0xd')](_0x80b1('0x12'),_0x5773a8,_0x80b1('0xf'));_0x1cbd5a(_0x14b85e['result'][_0x80b1('0x13')]);}})[_0x80b1('0x14')](function(_0x1416b1){logger['error']('Setting,\x20%s,\x20%s',_0x5773a8,_0x1416b1);_0x404579(_0x1416b1);});});} \ No newline at end of file +var _0xf386=['catch','lodash','util','moment','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xf386,0xdd));var _0x6f38=function(_0x41f20b,_0xbe0461){_0x41f20b=_0x41f20b-0x0;var _0x324346=_0xf386[_0x41f20b];return _0x324346;};'use strict';var _=require(_0x6f38('0x0'));var util=require(_0x6f38('0x1'));var moment=require(_0x6f38('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f38('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f38('0x4'))('rpc');var config=require(_0x6f38('0x5'));var jayson=require(_0x6f38('0x6'));var client=jayson[_0x6f38('0x7')][_0x6f38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5781b2,_0x35d6a6,_0x70132a){return new BPromise(function(_0x409df4,_0xfc5171){return client[_0x6f38('0x9')](_0x5781b2,_0x70132a)[_0x6f38('0xa')](function(_0x37605c){logger[_0x6f38('0xb')](_0x6f38('0xc'),_0x35d6a6,_0x6f38('0xd'));logger[_0x6f38('0xe')](_0x6f38('0xf'),_0x35d6a6,_0x6f38('0xd'),JSON[_0x6f38('0x10')](_0x37605c));if(_0x37605c['error']){if(_0x37605c[_0x6f38('0x11')][_0x6f38('0x12')]===0x1f4){logger[_0x6f38('0x11')](_0x6f38('0xc'),_0x35d6a6,_0x37605c[_0x6f38('0x11')][_0x6f38('0x13')]);return _0xfc5171(_0x37605c[_0x6f38('0x11')]['message']);}logger[_0x6f38('0x11')]('Setting,\x20%s,\x20%s',_0x35d6a6,_0x37605c[_0x6f38('0x11')]['message']);return _0x409df4(_0x37605c['error']['message']);}else{logger[_0x6f38('0xb')](_0x6f38('0xc'),_0x35d6a6,_0x6f38('0xd'));_0x409df4(_0x37605c[_0x6f38('0x14')]['message']);}})[_0x6f38('0x15')](function(_0x515480){logger[_0x6f38('0x11')]('Setting,\x20%s,\x20%s',_0x35d6a6,_0x515480);_0xfc5171(_0x515480);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index be0ea55..2f1984d 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 _0x3423=['/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','post','create','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0xa119e4,_0x29953b){var _0x459dc0=function(_0x1450a6){while(--_0x1450a6){_0xa119e4['push'](_0xa119e4['shift']());}};_0x459dc0(++_0x29953b);}(_0x3423,0x127));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3342('0x0'));var util=require(_0x3342('0x1'));var path=require('path');var timeout=require(_0x3342('0x2'));var express=require(_0x3342('0x3'));var router=express[_0x3342('0x4')]();var auth=require(_0x3342('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3342('0x6'));var controller=require(_0x3342('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3342('0x8')]);router[_0x3342('0x9')](_0x3342('0xa'),auth[_0x3342('0xb')](),controller[_0x3342('0xc')]);router[_0x3342('0x9')](_0x3342('0xd'),auth[_0x3342('0xb')](),controller[_0x3342('0xe')]);router[_0x3342('0x9')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x10')]);router['get'](_0x3342('0x11'),auth[_0x3342('0xb')](),controller[_0x3342('0x12')]);router[_0x3342('0x9')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x14')]);router[_0x3342('0x9')]('/:id/interactions',auth[_0x3342('0xb')](),controller[_0x3342('0x15')]);router[_0x3342('0x9')](_0x3342('0x16'),controller['statusGet']);router[_0x3342('0x9')]('/:id/users',auth[_0x3342('0xb')](),controller['getAgents']);router[_0x3342('0x17')]('/',auth['isAuthenticated'](),controller[_0x3342('0x18')]);router[_0x3342('0x17')]('/:id/dispositions',auth[_0x3342('0xb')](),controller['addDisposition']);router[_0x3342('0x17')](_0x3342('0x11'),auth[_0x3342('0xb')](),controller[_0x3342('0x19')]);router['post'](_0x3342('0x1a'),controller['notify']);router[_0x3342('0x17')](_0x3342('0x13'),auth['isAuthenticated'](),controller['addApplications']);router[_0x3342('0x17')](_0x3342('0x1b'),auth[_0x3342('0xb')](),controller[_0x3342('0x1c')]);router[_0x3342('0x17')](_0x3342('0x16'),controller[_0x3342('0x1d')]);router[_0x3342('0x17')](_0x3342('0x1e'),auth[_0x3342('0xb')](),controller[_0x3342('0x1f')]);router[_0x3342('0x20')](_0x3342('0xd'),auth[_0x3342('0xb')](),controller[_0x3342('0x21')]);router[_0x3342('0x22')](_0x3342('0xd'),auth[_0x3342('0xb')](),controller['destroy']);router[_0x3342('0x22')](_0x3342('0xf'),auth[_0x3342('0xb')](),controller[_0x3342('0x23')]);router['delete'](_0x3342('0x11'),auth['isAuthenticated'](),controller[_0x3342('0x24')]);router[_0x3342('0x22')](_0x3342('0x1e'),auth[_0x3342('0xb')](),controller[_0x3342('0x25')]);module[_0x3342('0x26')]=router; \ No newline at end of file +var _0x25ef=['statusGet','getAgents','post','create','addDisposition','/:id/canned_answers','notify','addApplications','send','status','addAgents','put','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x25ef,0xf7));var _0xf25e=function(_0x4a1a98,_0x41e977){_0x4a1a98=_0x4a1a98-0x0;var _0x55d5f5=_0x25ef[_0x4a1a98];return _0x55d5f5;};'use strict';var multer=require(_0xf25e('0x0'));var util=require('util');var path=require(_0xf25e('0x1'));var timeout=require(_0xf25e('0x2'));var express=require(_0xf25e('0x3'));var router=express['Router']();var auth=require(_0xf25e('0x4'));var interaction=require(_0xf25e('0x5'));var config=require(_0xf25e('0x6'));var controller=require('./smsAccount.controller');router[_0xf25e('0x7')]('/',auth[_0xf25e('0x8')](),controller[_0xf25e('0x9')]);router['get'](_0xf25e('0xa'),auth[_0xf25e('0x8')](),controller[_0xf25e('0xb')]);router[_0xf25e('0x7')](_0xf25e('0xc'),auth[_0xf25e('0x8')](),controller['show']);router[_0xf25e('0x7')](_0xf25e('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xf25e('0x8')](),controller['getAnswers']);router[_0xf25e('0x7')](_0xf25e('0xe'),auth[_0xf25e('0x8')](),controller[_0xf25e('0xf')]);router[_0xf25e('0x7')](_0xf25e('0x10'),auth[_0xf25e('0x8')](),controller[_0xf25e('0x11')]);router[_0xf25e('0x7')](_0xf25e('0x12'),controller[_0xf25e('0x13')]);router[_0xf25e('0x7')]('/:id/users',auth[_0xf25e('0x8')](),controller[_0xf25e('0x14')]);router[_0xf25e('0x15')]('/',auth[_0xf25e('0x8')](),controller[_0xf25e('0x16')]);router['post'](_0xf25e('0xd'),auth[_0xf25e('0x8')](),controller[_0xf25e('0x17')]);router[_0xf25e('0x15')](_0xf25e('0x18'),auth[_0xf25e('0x8')](),controller['addAnswer']);router[_0xf25e('0x15')]('/:id/notify',controller[_0xf25e('0x19')]);router[_0xf25e('0x15')](_0xf25e('0xe'),auth['isAuthenticated'](),controller[_0xf25e('0x1a')]);router[_0xf25e('0x15')]('/:id/send',auth[_0xf25e('0x8')](),controller[_0xf25e('0x1b')]);router[_0xf25e('0x15')](_0xf25e('0x12'),controller[_0xf25e('0x1c')]);router[_0xf25e('0x15')]('/:id/users',auth[_0xf25e('0x8')](),controller[_0xf25e('0x1d')]);router[_0xf25e('0x1e')]('/:id',auth[_0xf25e('0x8')](),controller['update']);router[_0xf25e('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xf25e('0x20')]);router[_0xf25e('0x1f')]('/:id/dispositions',auth[_0xf25e('0x8')](),controller[_0xf25e('0x21')]);router[_0xf25e('0x1f')](_0xf25e('0x18'),auth[_0xf25e('0x8')](),controller[_0xf25e('0x22')]);router[_0xf25e('0x1f')](_0xf25e('0x23'),auth['isAuthenticated'](),controller[_0xf25e('0x24')]);module[_0xf25e('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index f5e9de5..28a7359 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 _0x0fda=['infobip','intelepeer','ENUM','BOOLEAN','TEXT','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','generate','twilio','skebby','connectel','clicksend','plivo','clickatell','csc'];(function(_0xa2bc44,_0x37fc46){var _0x36437e=function(_0x43053b){while(--_0x43053b){_0xa2bc44['push'](_0xa2bc44['shift']());}};_0x36437e(++_0x37fc46);}(_0x0fda,0xb1));var _0xa0fd=function(_0xadcac8,_0x5267ab){_0xadcac8=_0xadcac8-0x0;var _0x28ced9=_0x0fda[_0xadcac8];return _0x28ced9;};'use strict';var Sequelize=require(_0xa0fd('0x0'));var rs=require('randomstring');module[_0xa0fd('0x1')]={'name':{'type':Sequelize[_0xa0fd('0x2')],'unique':_0xa0fd('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa0fd('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa0fd('0x4')]();}},'phone':{'type':Sequelize[_0xa0fd('0x2')]},'type':{'type':Sequelize['ENUM'](_0xa0fd('0x5'),_0xa0fd('0x6'),_0xa0fd('0x7'),_0xa0fd('0x8'),_0xa0fd('0x9'),_0xa0fd('0xa'),_0xa0fd('0xb'),_0xa0fd('0xc'),_0xa0fd('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xa0fd('0x2')]},'authToken':{'type':Sequelize[_0xa0fd('0x2')]},'smsMethod':{'type':Sequelize[_0xa0fd('0xe')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xa0fd('0x2')]},'senderString':{'type':Sequelize[_0xa0fd('0x2')]},'deliveryReport':{'type':Sequelize[_0xa0fd('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xa0fd('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa0fd('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa0fd('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa0fd('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa0fd('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa0fd('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa0fd('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa0fd('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa0fd('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa0fd('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa0fd('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa0fd('0xf')],'defaultValue':![],'comment':_0xa0fd('0x12'),'set':function(_0x3019c5){if(!_0x3019c5)this[_0xa0fd('0x13')](_0xa0fd('0x14'),null);this[_0xa0fd('0x13')]('mandatoryDisposition',_0x3019c5);}}}; \ No newline at end of file +var _0x4091=['clickatell','csc','infobip','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x4091,0x74));var _0x1409=function(_0x36587e,_0x4fdd5e){_0x36587e=_0x36587e-0x0;var _0x73e98d=_0x4091[_0x36587e];return _0x73e98d;};'use strict';var Sequelize=require(_0x1409('0x0'));var rs=require('randomstring');module[_0x1409('0x1')]={'name':{'type':Sequelize[_0x1409('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x1409('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x1409('0x2')],'defaultValue':function(){return rs[_0x1409('0x3')]();}},'phone':{'type':Sequelize[_0x1409('0x2')]},'type':{'type':Sequelize[_0x1409('0x4')](_0x1409('0x5'),_0x1409('0x6'),_0x1409('0x7'),_0x1409('0x8'),_0x1409('0x9'),_0x1409('0xa'),_0x1409('0xb'),_0x1409('0xc'),_0x1409('0xd'))},'accountSid':{'type':Sequelize[_0x1409('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x1409('0x2')]},'smsMethod':{'type':Sequelize[_0x1409('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x1409('0x2')]},'password':{'type':Sequelize[_0x1409('0x2')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x1409('0x2')]},'deliveryReport':{'type':Sequelize[_0x1409('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x1409('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1409('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1409('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1409('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1409('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1409('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x1409('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1409('0x10')],'comment':_0x1409('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x1409('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x328734){if(!_0x328734)this[_0x1409('0x12')](_0x1409('0x13'),null);this[_0x1409('0x12')](_0x1409('0x14'),_0x328734);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index dbb0657..af5d51d 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 _0xc0a7=['inspect','skebby_dispatch_id','statusInt','requestid','message_id','status_code','groupName','DELIVERED','redif','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','csc','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','status','end','json','count','Content-Range','apply','save','update','destroy','get','SmsAccounts','stack','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','include','catch','show','params','includeAll','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','create','name','body','describe','SmsAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','notify','sms','account','applications','orderBy','Applications','priority','asc','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','plivo','From','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','push','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','text/xml','addApplications','SmsApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','send','to\x20is\x20mandatory','CmList','List','Messages','dataValues','log','received\x20delivery\x20report\x20from'];(function(_0x363842,_0x369636){var _0x257bc2=function(_0x2516cf){while(--_0x2516cf){_0x363842['push'](_0x363842['shift']());}};_0x257bc2(++_0x369636);}(_0xc0a7,0xee));var _0x7c0a=function(_0x3e266b,_0x2d2fcd){_0x3e266b=_0x3e266b-0x0;var _0x3d6c5a=_0xc0a7[_0x3e266b];return _0x3d6c5a;};'use strict';var pdf=require(_0x7c0a('0x0'));var emlformat=require(_0x7c0a('0x1'));var rimraf=require(_0x7c0a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c0a('0x3'));var rp=require(_0x7c0a('0x4'));var moment=require(_0x7c0a('0x5'));var BPromise=require(_0x7c0a('0x6'));var Mustache=require('mustache');var util=require(_0x7c0a('0x7'));var path=require(_0x7c0a('0x8'));var sox=require(_0x7c0a('0x9'));var csv=require(_0x7c0a('0xa'));var ejs=require(_0x7c0a('0xb'));var fs=require('fs');var _=require(_0x7c0a('0xc'));var squel=require(_0x7c0a('0xd'));var crypto=require(_0x7c0a('0xe'));var jsforce=require(_0x7c0a('0xf'));var deskjs=require(_0x7c0a('0x10'));var toCsv=require(_0x7c0a('0xa'));var querystring=require(_0x7c0a('0x11'));var Papa=require(_0x7c0a('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x7c0a('0x13'));var Redis=require(_0x7c0a('0x14'));var qs=require(_0x7c0a('0x15'));var logger=require(_0x7c0a('0x16'))(_0x7c0a('0x17'));var utils=require(_0x7c0a('0x18'));var config=require(_0x7c0a('0x19'));var db=require(_0x7c0a('0x1a'))['db'];config[_0x7c0a('0x1b')]=_[_0x7c0a('0x1c')](config[_0x7c0a('0x1b')],{'host':_0x7c0a('0x1d'),'port':0x18eb});var socket=require(_0x7c0a('0x1e'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x7c0a('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7c0a('0x20')][_0x7c0a('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x80b70e,_0x119594,_0x1c4579,_0x5e2d33){return new BPromise(function(_0x1db595,_0x7828fb){var _0xcb7e63=_0x5e2d33||client;return _0xcb7e63[_0x7c0a('0x22')](_0x80b70e,_0x1c4579)[_0x7c0a('0x23')](function(_0x17be51){logger['info']('SmsAccount,\x20%s,\x20%s',_0x119594,_0x7c0a('0x24'));logger[_0x7c0a('0x25')](_0x7c0a('0x26'),_0x119594,_0x7c0a('0x24'),JSON[_0x7c0a('0x27')](_0x17be51));if(_0x17be51['error']){if(_0x17be51[_0x7c0a('0x28')][_0x7c0a('0x29')]===0x1f4){logger['error'](_0x7c0a('0x2a'),_0x119594,_0x17be51['error']['message']);return _0x7828fb(_0x17be51[_0x7c0a('0x28')]['message']);}logger[_0x7c0a('0x28')]('SmsAccount,\x20%s,\x20%s',_0x119594,_0x17be51[_0x7c0a('0x28')][_0x7c0a('0x2b')]);return _0x1db595(_0x17be51[_0x7c0a('0x28')][_0x7c0a('0x2b')]);}else{logger['info'](_0x7c0a('0x2a'),_0x119594,_0x7c0a('0x24'));_0x1db595(_0x17be51['result']['message']);}})['catch'](function(_0x1eaea9){logger[_0x7c0a('0x28')](_0x7c0a('0x2a'),_0x119594,_0x1eaea9);_0x7828fb(_0x1eaea9);});});}function respondWithStatusCode(_0x26e780,_0x3ddbe0){_0x3ddbe0=_0x3ddbe0||0xcc;return function(_0x15bc46){if(_0x15bc46){return _0x26e780['sendStatus'](_0x3ddbe0);}return _0x26e780[_0x7c0a('0x2c')](_0x3ddbe0)[_0x7c0a('0x2d')]();};}function respondWithResult(_0x408175,_0x247fed){_0x247fed=_0x247fed||0xc8;return function(_0x2a04e7){if(_0x2a04e7){return _0x408175[_0x7c0a('0x2c')](_0x247fed)[_0x7c0a('0x2e')](_0x2a04e7);}};}function respondWithFilteredResult(_0x257176,_0x38273f){return function(_0x42747c){if(_0x42747c){var _0x245db4=_0x42747c[_0x7c0a('0x2f')],_0x4dd12e=_0x38273f['offset'],_0x4561c2=_0x38273f['offset']+_0x38273f['limit'],_0x351af1;if(_0x4561c2>=_0x245db4){_0x4561c2=_0x245db4;_0x351af1=0xc8;}else{_0x351af1=0xce;}_0x257176['status'](_0x351af1);return _0x257176['set'](_0x7c0a('0x30'),_0x4dd12e+'-'+_0x4561c2+'/'+_0x245db4)[_0x7c0a('0x2e')](_0x42747c);}return null;};}function patchUpdates(_0x33c8e9){return function(_0x100f78){try{jsonpatch[_0x7c0a('0x31')](_0x100f78,_0x33c8e9,!![]);}catch(_0x5e8338){return BPromise['reject'](_0x5e8338);}return _0x100f78[_0x7c0a('0x32')]();};}function saveUpdates(_0x22de87,_0x484145){return function(_0x4d03d8){if(_0x4d03d8){return _0x4d03d8[_0x7c0a('0x33')](_0x22de87)[_0x7c0a('0x23')](function(_0x67aaf6){return _0x67aaf6;});}return null;};}function removeEntity(_0x48c5e6,_0x1a6f03){return function(_0x506a7a){if(_0x506a7a){return _0x506a7a[_0x7c0a('0x34')]()[_0x7c0a('0x23')](function(){var _0x51d825=_0x506a7a[_0x7c0a('0x35')]({'plain':!![]});var _0x9b79ac=_0x7c0a('0x36');return db['UserProfileResource'][_0x7c0a('0x34')]({'where':{'type':_0x9b79ac,'resourceId':_0x51d825['id']}})[_0x7c0a('0x23')](function(){return _0x506a7a;});})[_0x7c0a('0x23')](function(){_0x48c5e6[_0x7c0a('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x87e1db,_0x560563){return function(_0x6629f8){if(!_0x6629f8){_0x87e1db['sendStatus'](0x194);}return _0x6629f8;};}function handleError(_0x51766a,_0x800a5e){_0x800a5e=_0x800a5e||0x1f4;return function(_0x2aa865){logger[_0x7c0a('0x28')](_0x2aa865[_0x7c0a('0x37')]);if(_0x2aa865['name']){delete _0x2aa865['name'];}_0x51766a[_0x7c0a('0x2c')](_0x800a5e)['send'](_0x2aa865);};}exports['index']=function(_0x17e00e,_0x1a1d8e){var _0x44648b={'include':[{'model':db[_0x7c0a('0x38')],'as':_0x7c0a('0x39')}]},_0x3d5056={},_0x1dead9={'count':0x0,'rows':[]};var _0x3cee96=db[_0x7c0a('0x3a')][_0x7c0a('0x3b')];_0x3d5056['model']=_[_0x7c0a('0x3c')](_0x3cee96);_0x3d5056['query']=_['keys'](_0x17e00e[_0x7c0a('0x3d')]);_0x3d5056[_0x7c0a('0x3e')]=_[_0x7c0a('0x3f')](_0x3d5056[_0x7c0a('0x40')],_0x3d5056[_0x7c0a('0x3d')]);_0x44648b['attributes']=_[_0x7c0a('0x3f')](_0x3d5056['model'],qs[_0x7c0a('0x41')](_0x17e00e[_0x7c0a('0x3d')][_0x7c0a('0x41')]));_0x44648b[_0x7c0a('0x42')]=_0x44648b['attributes'][_0x7c0a('0x43')]?_0x44648b[_0x7c0a('0x42')]:_0x3d5056[_0x7c0a('0x40')];if(!_0x17e00e[_0x7c0a('0x3d')][_0x7c0a('0x44')](_0x7c0a('0x45'))){_0x44648b[_0x7c0a('0x46')]=qs[_0x7c0a('0x46')](_0x17e00e['query'][_0x7c0a('0x46')]);_0x44648b[_0x7c0a('0x47')]=qs[_0x7c0a('0x47')](_0x17e00e[_0x7c0a('0x3d')][_0x7c0a('0x47')]);}_0x44648b[_0x7c0a('0x48')]=qs[_0x7c0a('0x49')](_0x17e00e[_0x7c0a('0x3d')][_0x7c0a('0x49')]);_0x44648b[_0x7c0a('0x4a')]=qs[_0x7c0a('0x3e')](_[_0x7c0a('0x4b')](_0x17e00e[_0x7c0a('0x3d')],_0x3d5056[_0x7c0a('0x3e')]));if(_0x17e00e[_0x7c0a('0x3d')][_0x7c0a('0x4c')]){_0x44648b['where']=_[_0x7c0a('0x4d')](_0x44648b[_0x7c0a('0x4a')],{'$or':_[_0x7c0a('0x4e')](_0x3cee96,function(_0x360eef){if(_0x360eef[_0x7c0a('0x4f')]['key']!==_0x7c0a('0x50')){var _0x393f3f={};_0x393f3f[_0x360eef['field']]={'$like':'%'+_0x17e00e[_0x7c0a('0x3d')]['filter']+'%'};return _0x393f3f;}})});}_0x44648b=_['merge']({},_0x44648b,_0x17e00e[_0x7c0a('0x51')]);var _0x4d8737={'where':_0x44648b[_0x7c0a('0x4a')]};return db['SmsAccount'][_0x7c0a('0x2f')](_0x4d8737)[_0x7c0a('0x23')](function(_0x1d596d){_0x1dead9[_0x7c0a('0x2f')]=_0x1d596d;if(_0x17e00e[_0x7c0a('0x3d')]['includeAll']){_0x44648b[_0x7c0a('0x52')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x44648b);})[_0x7c0a('0x23')](function(_0x53e2ed){_0x1dead9['rows']=_0x53e2ed;return _0x1dead9;})[_0x7c0a('0x23')](respondWithFilteredResult(_0x1a1d8e,_0x44648b))[_0x7c0a('0x53')](handleError(_0x1a1d8e,null));};exports[_0x7c0a('0x54')]=function(_0x10a500,_0x401434){var _0x590293={'raw':![],'where':{'id':_0x10a500[_0x7c0a('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x32a526={};_0x32a526[_0x7c0a('0x40')]=_['keys'](db[_0x7c0a('0x3a')]['rawAttributes']);_0x32a526[_0x7c0a('0x3d')]=_['keys'](_0x10a500[_0x7c0a('0x3d')]);_0x32a526[_0x7c0a('0x3e')]=_[_0x7c0a('0x3f')](_0x32a526[_0x7c0a('0x40')],_0x32a526[_0x7c0a('0x3d')]);_0x590293[_0x7c0a('0x42')]=_[_0x7c0a('0x3f')](_0x32a526[_0x7c0a('0x40')],qs[_0x7c0a('0x41')](_0x10a500[_0x7c0a('0x3d')][_0x7c0a('0x41')]));_0x590293['attributes']=_0x590293['attributes'][_0x7c0a('0x43')]?_0x590293['attributes']:_0x32a526['model'];if(_0x10a500[_0x7c0a('0x3d')][_0x7c0a('0x56')]){_0x590293[_0x7c0a('0x52')]=[{'all':!![]}];}_0x590293=_['merge']({},_0x590293,_0x10a500[_0x7c0a('0x51')]);return db[_0x7c0a('0x3a')][_0x7c0a('0x57')](_0x590293)[_0x7c0a('0x23')](handleEntityNotFound(_0x401434,null))[_0x7c0a('0x23')](respondWithResult(_0x401434,null))[_0x7c0a('0x53')](handleError(_0x401434,null));};exports['create']=function(_0x539d42,_0x2071a5){return db[_0x7c0a('0x3a')]['create'](_0x539d42['body'],{})['then'](function(_0x3a119a){var _0x308af7=_0x539d42['user'][_0x7c0a('0x35')]({'plain':!![]});if(!_0x308af7)throw new Error(_0x7c0a('0x58'));if(_0x308af7['role']===_0x7c0a('0x59')){var _0x12b5af=_0x3a119a[_0x7c0a('0x35')]({'plain':!![]});var _0x4fb49f=_0x7c0a('0x36');return db[_0x7c0a('0x5a')][_0x7c0a('0x57')]({'where':{'name':_0x4fb49f,'userProfileId':_0x308af7['userProfileId']},'raw':!![]})[_0x7c0a('0x23')](function(_0x53b72a){if(_0x53b72a&&_0x53b72a[_0x7c0a('0x5b')]===0x0){return db[_0x7c0a('0x5c')][_0x7c0a('0x5d')]({'name':_0x12b5af[_0x7c0a('0x5e')],'resourceId':_0x12b5af['id'],'type':_0x53b72a[_0x7c0a('0x5e')],'sectionId':_0x53b72a['id']},{})[_0x7c0a('0x23')](function(){return _0x3a119a;});}else{return _0x3a119a;}})[_0x7c0a('0x53')](function(_0xabbe3d){logger[_0x7c0a('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xabbe3d);throw _0xabbe3d;});}return _0x3a119a;})[_0x7c0a('0x23')](respondWithResult(_0x2071a5,0xc9))[_0x7c0a('0x53')](handleError(_0x2071a5,null));};exports[_0x7c0a('0x33')]=function(_0x58e3cd,_0x20be42){if(_0x58e3cd['body']['id']){delete _0x58e3cd['body']['id'];}return db['SmsAccount'][_0x7c0a('0x57')]({'where':{'id':_0x58e3cd['params']['id']},'include':[{'model':db[_0x7c0a('0x38')],'as':'mandatoryDispositionPause'}]})[_0x7c0a('0x23')](handleEntityNotFound(_0x20be42,null))[_0x7c0a('0x23')](saveUpdates(_0x58e3cd[_0x7c0a('0x5f')],null))[_0x7c0a('0x23')](respondWithResult(_0x20be42,null))[_0x7c0a('0x53')](handleError(_0x20be42,null));};exports[_0x7c0a('0x34')]=function(_0x5b2bc9,_0x3b88f9){return db[_0x7c0a('0x3a')]['find']({'where':{'id':_0x5b2bc9[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x3b88f9,null))[_0x7c0a('0x23')](removeEntity(_0x3b88f9,null))[_0x7c0a('0x53')](handleError(_0x3b88f9,null));};exports['describe']=function(_0x53830d,_0xd83133){return db[_0x7c0a('0x3a')][_0x7c0a('0x60')]()[_0x7c0a('0x23')](respondWithResult(_0xd83133,null))[_0x7c0a('0x53')](handleError(_0xd83133,null));};exports['addDisposition']=function(_0x2ad14c,_0x1027cd,_0x492248){if(_0x2ad14c[_0x7c0a('0x5f')]['id']){delete _0x2ad14c[_0x7c0a('0x5f')]['id'];}return db[_0x7c0a('0x3a')][_0x7c0a('0x57')]({'where':{'id':_0x2ad14c[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x1027cd,null))['then'](function(_0x4b5f38){if(_0x4b5f38){_0x2ad14c[_0x7c0a('0x5f')][_0x7c0a('0x61')]=_0x4b5f38['id'];return db[_0x7c0a('0x62')]['create'](_0x2ad14c[_0x7c0a('0x5f')]);}})[_0x7c0a('0x23')](respondWithResult(_0x1027cd,null))[_0x7c0a('0x53')](handleError(_0x1027cd,null));};exports[_0x7c0a('0x63')]=function(_0x3938ae,_0x5d91bb,_0x11765f){var _0x5efe92={'raw':![],'where':{}};var _0x19366b={};var _0x3a4815={'count':0x0,'rows':[]};return db[_0x7c0a('0x3a')][_0x7c0a('0x64')]({'where':{'id':_0x3938ae[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x5d91bb,null))[_0x7c0a('0x23')](function(_0x1482fe){if(_0x1482fe){_0x19366b[_0x7c0a('0x40')]=_['keys'](db[_0x7c0a('0x62')][_0x7c0a('0x3b')]);_0x19366b[_0x7c0a('0x3d')]=_[_0x7c0a('0x3c')](_0x3938ae[_0x7c0a('0x3d')]);_0x19366b[_0x7c0a('0x3e')]=_[_0x7c0a('0x3f')](_0x19366b['model'],_0x19366b['query']);_0x5efe92[_0x7c0a('0x42')]=_[_0x7c0a('0x3f')](_0x19366b[_0x7c0a('0x40')],qs['fields'](_0x3938ae[_0x7c0a('0x3d')][_0x7c0a('0x41')]));_0x5efe92[_0x7c0a('0x42')]=_0x5efe92[_0x7c0a('0x42')][_0x7c0a('0x43')]?_0x5efe92[_0x7c0a('0x42')]:_0x19366b[_0x7c0a('0x40')];if(!_0x3938ae[_0x7c0a('0x3d')][_0x7c0a('0x44')](_0x7c0a('0x45'))){_0x5efe92[_0x7c0a('0x46')]=qs[_0x7c0a('0x46')](_0x3938ae[_0x7c0a('0x3d')][_0x7c0a('0x46')]);_0x5efe92[_0x7c0a('0x47')]=qs[_0x7c0a('0x47')](_0x3938ae['query'][_0x7c0a('0x47')]);}_0x5efe92['order']=qs[_0x7c0a('0x49')](_0x3938ae[_0x7c0a('0x3d')]['sort']);_0x5efe92['where']=qs[_0x7c0a('0x3e')](_[_0x7c0a('0x4b')](_0x3938ae[_0x7c0a('0x3d')],_0x19366b[_0x7c0a('0x3e')]));_0x5efe92[_0x7c0a('0x4a')]['SmsAccountId']=_0x1482fe['id'];if(_0x3938ae[_0x7c0a('0x3d')][_0x7c0a('0x4c')]){_0x5efe92[_0x7c0a('0x4a')]=_[_0x7c0a('0x4d')](_0x5efe92[_0x7c0a('0x4a')],{'$or':_[_0x7c0a('0x4e')](_0x5efe92[_0x7c0a('0x42')],function(_0x2ca5a1){var _0x30f03f={};_0x30f03f[_0x2ca5a1]={'$like':'%'+_0x3938ae[_0x7c0a('0x3d')]['filter']+'%'};return _0x30f03f;})});}_0x5efe92=_['merge']({},_0x5efe92,_0x3938ae['options']);return db[_0x7c0a('0x62')][_0x7c0a('0x2f')]({'where':_0x5efe92[_0x7c0a('0x4a')]})[_0x7c0a('0x23')](function(_0x3ef7b5){_0x3a4815[_0x7c0a('0x2f')]=_0x3ef7b5;if(_0x3938ae['query'][_0x7c0a('0x56')]){_0x5efe92[_0x7c0a('0x52')]=[{'all':!![]}];}return db[_0x7c0a('0x62')][_0x7c0a('0x65')](_0x5efe92);})[_0x7c0a('0x23')](function(_0x5043f1){_0x3a4815['rows']=_0x5043f1;return _0x3a4815;});}})['then'](respondWithFilteredResult(_0x5d91bb,_0x5efe92))['catch'](handleError(_0x5d91bb,null));};exports[_0x7c0a('0x66')]=function(_0x397f1f,_0x3f7a92,_0xf2de97){var _0x49ee80;return db[_0x7c0a('0x3a')]['find']({'where':{'id':_0x397f1f[_0x7c0a('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f7a92,null))['then'](function(_0x1eb99b){if(_0x1eb99b){return _0x1eb99b[_0x7c0a('0x66')](_0x397f1f[_0x7c0a('0x3d')][_0x7c0a('0x67')]);}})[_0x7c0a('0x23')](respondWithStatusCode(_0x3f7a92,null))['catch'](handleError(_0x3f7a92,null));};exports[_0x7c0a('0x68')]=function(_0x39a95f,_0x296b04,_0x2b14f6){if(_0x39a95f['body']['id']){delete _0x39a95f[_0x7c0a('0x5f')]['id'];}return db[_0x7c0a('0x3a')]['find']({'where':{'id':_0x39a95f['params']['id']}})['then'](handleEntityNotFound(_0x296b04,null))[_0x7c0a('0x23')](function(_0x261c10){if(_0x261c10){_0x39a95f[_0x7c0a('0x5f')][_0x7c0a('0x61')]=_0x261c10['id'];return db[_0x7c0a('0x69')][_0x7c0a('0x5d')](_0x39a95f[_0x7c0a('0x5f')]);}})[_0x7c0a('0x23')](respondWithResult(_0x296b04,null))['catch'](handleError(_0x296b04,null));};exports[_0x7c0a('0x6a')]=function(_0x49b4b6,_0x2a8936,_0x56040){var _0x2e83dc={'raw':![],'where':{}};var _0x2a41fb={};var _0x528930={'count':0x0,'rows':[]};return db[_0x7c0a('0x3a')][_0x7c0a('0x64')]({'where':{'id':_0x49b4b6[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x2a8936,null))[_0x7c0a('0x23')](function(_0x4db357){if(_0x4db357){_0x2a41fb[_0x7c0a('0x40')]=_['keys'](db[_0x7c0a('0x69')][_0x7c0a('0x3b')]);_0x2a41fb[_0x7c0a('0x3d')]=_[_0x7c0a('0x3c')](_0x49b4b6[_0x7c0a('0x3d')]);_0x2a41fb[_0x7c0a('0x3e')]=_[_0x7c0a('0x3f')](_0x2a41fb['model'],_0x2a41fb[_0x7c0a('0x3d')]);_0x2e83dc[_0x7c0a('0x42')]=_[_0x7c0a('0x3f')](_0x2a41fb[_0x7c0a('0x40')],qs['fields'](_0x49b4b6['query'][_0x7c0a('0x41')]));_0x2e83dc['attributes']=_0x2e83dc[_0x7c0a('0x42')][_0x7c0a('0x43')]?_0x2e83dc[_0x7c0a('0x42')]:_0x2a41fb[_0x7c0a('0x40')];if(!_0x49b4b6[_0x7c0a('0x3d')][_0x7c0a('0x44')]('nolimit')){_0x2e83dc[_0x7c0a('0x46')]=qs[_0x7c0a('0x46')](_0x49b4b6[_0x7c0a('0x3d')][_0x7c0a('0x46')]);_0x2e83dc[_0x7c0a('0x47')]=qs[_0x7c0a('0x47')](_0x49b4b6[_0x7c0a('0x3d')][_0x7c0a('0x47')]);}_0x2e83dc[_0x7c0a('0x48')]=qs[_0x7c0a('0x49')](_0x49b4b6['query'][_0x7c0a('0x49')]);_0x2e83dc[_0x7c0a('0x4a')]=qs['filters'](_[_0x7c0a('0x4b')](_0x49b4b6[_0x7c0a('0x3d')],_0x2a41fb[_0x7c0a('0x3e')]));_0x2e83dc[_0x7c0a('0x4a')][_0x7c0a('0x61')]=_0x4db357['id'];if(_0x49b4b6[_0x7c0a('0x3d')]['filter']){_0x2e83dc[_0x7c0a('0x4a')]=_[_0x7c0a('0x4d')](_0x2e83dc[_0x7c0a('0x4a')],{'$or':_[_0x7c0a('0x4e')](_0x2e83dc[_0x7c0a('0x42')],function(_0x4ba03c){var _0x2d6376={};_0x2d6376[_0x4ba03c]={'$like':'%'+_0x49b4b6['query'][_0x7c0a('0x4c')]+'%'};return _0x2d6376;})});}_0x2e83dc=_['merge']({},_0x2e83dc,_0x49b4b6[_0x7c0a('0x51')]);return db[_0x7c0a('0x69')][_0x7c0a('0x2f')]({'where':_0x2e83dc['where']})[_0x7c0a('0x23')](function(_0x18f830){_0x528930[_0x7c0a('0x2f')]=_0x18f830;if(_0x49b4b6[_0x7c0a('0x3d')][_0x7c0a('0x56')]){_0x2e83dc[_0x7c0a('0x52')]=[{'all':!![]}];}return db[_0x7c0a('0x69')][_0x7c0a('0x65')](_0x2e83dc);})[_0x7c0a('0x23')](function(_0x565246){_0x528930['rows']=_0x565246;return _0x528930;});}})[_0x7c0a('0x23')](respondWithFilteredResult(_0x2a8936,_0x2e83dc))[_0x7c0a('0x53')](handleError(_0x2a8936,null));};exports['removeAnswers']=function(_0x4b1887,_0x22565e,_0x3567c9){var _0x1cdfaa;return db['SmsAccount'][_0x7c0a('0x57')]({'where':{'id':_0x4b1887[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x22565e,null))['then'](function(_0x3c337b){if(_0x3c337b){return _0x3c337b['removeAnswers'](_0x4b1887[_0x7c0a('0x3d')]['ids']);}})[_0x7c0a('0x23')](respondWithStatusCode(_0x22565e,null))[_0x7c0a('0x53')](handleError(_0x22565e,null));};exports[_0x7c0a('0x6b')]=function(_0x491325,_0x2da9a1,_0x352c74){var _0x5b5504={'channel':_0x7c0a('0x6c')};var _0x44c5d7=[];var _0x59b298=[];var _0x1a6cc4={};return db[_0x7c0a('0x3a')]['find']({'where':{'id':_0x491325['params']['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x7c0a('0x23')](handleEntityNotFound(_0x2da9a1,null))[_0x7c0a('0x23')](function(_0x3294fa){_0x5b5504[_0x7c0a('0x6d')]=_0x3294fa;_0x5b5504[_0x7c0a('0x6e')]=_[_0x7c0a('0x6f')](_0x3294fa[_0x7c0a('0x70')],[_0x7c0a('0x71')],[_0x7c0a('0x72')]);if(_0x5b5504[_0x7c0a('0x6d')][_0x7c0a('0x70')]){delete _0x5b5504[_0x7c0a('0x6d')][_0x7c0a('0x70')];}return db['CmContact'][_0x7c0a('0x60')]();})[_0x7c0a('0x23')](function(_0x111894){if(!_0x111894){throw new db[(_0x7c0a('0x73'))][(_0x7c0a('0x74'))]('no\x20available\x20attributes');}_0x44c5d7=_[_0x7c0a('0x75')](_[_0x7c0a('0x3c')](_0x111894),['createdAt','updatedAt']);_0x59b298=_[_0x7c0a('0x75')](_[_0x7c0a('0x3c')](_0x111894),[_0x7c0a('0x76'),_0x7c0a('0x77'),_0x7c0a('0x78'),_0x7c0a('0x79')]);_0x5b5504[_0x7c0a('0x5f')]={'mapKey':_0x7c0a('0x7a')};if(_0x5b5504[_0x7c0a('0x6d')][_0x7c0a('0x4f')]){switch(_0x5b5504[_0x7c0a('0x6d')][_0x7c0a('0x4f')]){case _0x7c0a('0x7b'):_0x5b5504['body'][_0x7c0a('0x7c')]=_0x491325[_0x7c0a('0x5f')]['From'];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x5f')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x7d')];_0x5b5504['body'][_0x7c0a('0x7e')]=_0x491325['body'][_0x7c0a('0x7f')];break;case _0x7c0a('0x80'):_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')]='+'+_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x81')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x5f')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x82')];break;case _0x7c0a('0x83'):_0x5b5504[_0x7c0a('0x5f')]['from']=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x7c')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x5f')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x2b')];break;case _0x7c0a('0x84'):_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')]=_0x491325['body'][_0x7c0a('0x7c')];_0x5b5504['body'][_0x7c0a('0x5f')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x5f')];_0x5b5504['body'][_0x7c0a('0x7e')]=_0x491325[_0x7c0a('0x5f')]['message_id'];break;case _0x7c0a('0x85'):_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x86')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x5f')]=_0x491325['body']['Text'];_0x5b5504[_0x7c0a('0x5f')]['messageId']=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x87')];break;case _0x7c0a('0x88'):_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')]='+'+_0x491325['body'][_0x7c0a('0x89')][0x0][_0x7c0a('0x7c')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x5f')]=_0x491325[_0x7c0a('0x5f')]['results'][0x0][_0x7c0a('0x82')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7e')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x89')][0x0]['messageId'];break;case'csc':_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')]=_0x491325['body'][_0x7c0a('0x8a')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x5f')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x8b')]['message'];break;case _0x7c0a('0x8c'):_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x8d')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x5f')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x82')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7e')]=_0x491325['body'][_0x7c0a('0x8e')];break;case _0x7c0a('0x8f'):_0x5b5504[_0x7c0a('0x5f')]['from']=_0x491325['body'][_0x7c0a('0x7c')];_0x5b5504['body'][_0x7c0a('0x5f')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x2b')];_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7e')]=_0x491325[_0x7c0a('0x5f')][_0x7c0a('0x90')];break;}}if(_0x5b5504['body']['id']){delete _0x5b5504['body']['id'];}if(_['isNil'](_0x5b5504['body'][_0x7c0a('0x7c')])){throw new db[(_0x7c0a('0x73'))][(_0x7c0a('0x74'))](_0x7c0a('0x91'));}if(_[_0x7c0a('0x92')](_0x5b5504['body'][_0x7c0a('0x5f')])||_0x5b5504[_0x7c0a('0x5f')]['body']===''){throw new db[(_0x7c0a('0x73'))][(_0x7c0a('0x74'))](_0x7c0a('0x93'));}if(_[_0x7c0a('0x92')](_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x94')])){throw new db['Sequelize'][(_0x7c0a('0x74'))](_0x7c0a('0x95')+_0x59b298);}if(!_['includes'](_0x59b298,_0x5b5504['body'][_0x7c0a('0x94')])){throw new db[(_0x7c0a('0x73'))][(_0x7c0a('0x74'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x59b298);}_0x1a6cc4[_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x94')]]=_0x5b5504['body'][_0x7c0a('0x7c')];return db['CmList'][_0x7c0a('0x57')]({'where':{'id':_0x5b5504[_0x7c0a('0x6d')][_0x7c0a('0x79')]},'include':[{'model':db[_0x7c0a('0x96')],'as':'Contacts','where':_0x1a6cc4,'limit':0x1,'order':[['updatedAt',_0x7c0a('0x97')]]}]});})['then'](handleEntityNotFound(_0x2da9a1,null))[_0x7c0a('0x23')](function(_0x3f4063){if(_0x3f4063){_0x5b5504[_0x7c0a('0x98')]=_[_0x7c0a('0x99')](_0x3f4063,[_0x7c0a('0x9a')]);if(_0x3f4063[_0x7c0a('0x9a')][_0x7c0a('0x43')]){return _0x3f4063[_0x7c0a('0x9a')][0x0];}var _0x8c2851=_[_0x7c0a('0x1c')](_0x5b5504[_0x7c0a('0x5f')],{'firstName':_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')],'ListId':_0x3f4063['id']});_0x8c2851[_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x94')]]=_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')];return db['CmContact'][_0x7c0a('0x5d')](_0x8c2851,{'fields':_0x44c5d7,'raw':!![]});}})[_0x7c0a('0x23')](handleEntityNotFound(_0x2da9a1,null))[_0x7c0a('0x23')](function(_0x58e6ac){if(_0x58e6ac){_0x5b5504[_0x7c0a('0x9b')]=_0x58e6ac;var _0x22b7cd={'ContactId':_0x58e6ac['id'],'phone':_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7c')],'SmsAccountId':_0x491325['params']['id']};var _0x47bbf8={'ContactId':_0x58e6ac['id'],'SmsAccountId':_0x491325[_0x7c0a('0x55')]['id'],'closed':![]};return db[_0x7c0a('0x9c')][_0x7c0a('0x57')]({'where':_0x47bbf8})['then'](function(_0x5bc38b){if(_0x5bc38b){return[_0x5bc38b,![]];}return db[_0x7c0a('0x9c')][_0x7c0a('0x5d')](_0x22b7cd)[_0x7c0a('0x23')](function(_0xf9ec01){return[_0xf9ec01,!![]];});});}})[_0x7c0a('0x9d')](function(_0x3804f9,_0x1c6a3e){_0x5b5504[_0x7c0a('0x9e')]=_0x3804f9[_0x7c0a('0x35')]({'plain':!![]});_0x5b5504['interaction']['created']=![];if(_0x1c6a3e){if(_0x5b5504['account']['autoclose']){_0x5b5504[_0x7c0a('0x6e')][_0x7c0a('0x9f')]({'id':0x0,'priority':_0x5b5504[_0x7c0a('0x6e')][_0x7c0a('0x43')]+0x1,'app':'close','appdata':_0x7c0a('0xa0'),'interval':_0x7c0a('0xa1')});}_0x5b5504['interaction'][_0x7c0a('0xa2')]=!![];}return db[_0x7c0a('0xa3')][_0x7c0a('0x5d')]({'phone':_0x5b5504['body']['from'],'messageId':_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x7e')],'body':_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0x5f')],'SmsAccountId':_0x491325['params']['id'],'SmsInteractionId':_0x3804f9['id'],'direction':'in','ContactId':_0x3804f9[_0x7c0a('0xa4')],'AttachmentId':_0x5b5504[_0x7c0a('0x5f')][_0x7c0a('0xa5')]});})[_0x7c0a('0x23')](function(_0x1a0d84){_0x5b5504['message']=_0x1a0d84;if(_0x5b5504['interaction']['UserId']){return db[_0x7c0a('0xa6')][_0x7c0a('0x57')]({'attributes':['id','name'],'where':{'id':_0x5b5504[_0x7c0a('0x9e')]['UserId']}})[_0x7c0a('0x23')](function(_0x1f7594){if(_0x1f7594){_0x5b5504[_0x7c0a('0x6e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7c0a('0xa7'),'appdata':_0x1f7594[_0x7c0a('0x5e')]+','+(_0x5b5504[_0x7c0a('0x6d')][_0x7c0a('0xa8')]||0xa),'interval':_0x7c0a('0xa1')});}return respondWithRpcPromise(_0x7c0a('0xa9'),'startRouting',_0x5b5504);});}return respondWithRpcPromise(_0x7c0a('0xa9'),_0x7c0a('0xaa'),_0x5b5504);})['then'](function(_0x4925fb){if(_0x4925fb){var _0x14797b=0xc8;var _0x1eb0fb=_0x7c0a('0xab');logger['info'](_0x7c0a('0x26'),_0x1eb0fb,_0x14797b,'entity\x20found');logger[_0x7c0a('0x25')](_0x7c0a('0xac'),_0x1eb0fb,_0x14797b,_0x7c0a('0xad'),JSON['stringify'](_0x4925fb));if(_0x5b5504[_0x7c0a('0x6d')][_0x7c0a('0x4f')]===_0x7c0a('0x7b')){return _0x2da9a1['status'](_0x14797b)['set']('Content-Type',_0x7c0a('0xae'))['send']('\x0a');}else{return _0x2da9a1['status'](_0x14797b)[_0x7c0a('0x2e')](_0x4925fb);}}})[_0x7c0a('0x53')](handleError(_0x2da9a1,null));};exports[_0x7c0a('0xaf')]=function(_0x44dc6f,_0x3e57ec,_0x261153){return db[_0x7c0a('0x3a')]['findOne']({'where':{'id':_0x44dc6f[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x3e57ec,null))[_0x7c0a('0x23')](function(_0x311aaf){if(_0x311aaf){return db['sequelize']['transaction'](function(_0x51f45b){return db[_0x7c0a('0xb0')]['destroy']({'where':{'SmsAccountId':_0x44dc6f[_0x7c0a('0x55')]['id']},'transaction':_0x51f45b})[_0x7c0a('0x23')](function(_0x27225f){var _0x52fca7=_['map'](_0x44dc6f[_0x7c0a('0x5f')],function(_0x2338dc){_0x2338dc[_0x7c0a('0x61')]=_0x44dc6f['params']['id'];return _0x2338dc;});return db[_0x7c0a('0xb0')][_0x7c0a('0xb1')](_0x52fca7,{'transaction':_0x51f45b});});})['then'](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x44dc6f[_0x7c0a('0x55')]['id']},'order':_0x7c0a('0x71')});});}})[_0x7c0a('0x23')](respondWithResult(_0x3e57ec,null))[_0x7c0a('0x53')](handleError(_0x3e57ec,null));};exports['getApplications']=function(_0x4bd9e2,_0xf88ca5,_0x1a9696){var _0x3daa61={};var _0x4e9abd={};var _0x1fdf61;var _0x1d4bfa;return db[_0x7c0a('0x3a')][_0x7c0a('0x64')]({'where':{'id':_0x4bd9e2[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0xf88ca5,null))['then'](function(_0x289fb2){if(_0x289fb2){_0x1fdf61=_0x289fb2;_0x4e9abd[_0x7c0a('0x40')]=_[_0x7c0a('0x3c')](db[_0x7c0a('0xb0')][_0x7c0a('0x3b')]);_0x4e9abd[_0x7c0a('0x3d')]=_[_0x7c0a('0x3c')](_0x4bd9e2[_0x7c0a('0x3d')]);_0x4e9abd[_0x7c0a('0x3e')]=_[_0x7c0a('0x3f')](_0x4e9abd[_0x7c0a('0x40')],_0x4e9abd[_0x7c0a('0x3d')]);_0x3daa61[_0x7c0a('0x42')]=_[_0x7c0a('0x3f')](_0x4e9abd[_0x7c0a('0x40')],qs[_0x7c0a('0x41')](_0x4bd9e2[_0x7c0a('0x3d')][_0x7c0a('0x41')]));_0x3daa61['attributes']=_0x3daa61['attributes'][_0x7c0a('0x43')]?_0x3daa61[_0x7c0a('0x42')]:_0x4e9abd['model'];_0x3daa61[_0x7c0a('0x48')]=qs['sort'](_0x4bd9e2[_0x7c0a('0x3d')][_0x7c0a('0x49')]);_0x3daa61[_0x7c0a('0x4a')]=qs[_0x7c0a('0x3e')](_[_0x7c0a('0x4b')](_0x4bd9e2[_0x7c0a('0x3d')],_0x4e9abd['filters']));if(_0x4bd9e2[_0x7c0a('0x3d')][_0x7c0a('0x4c')]){_0x3daa61[_0x7c0a('0x4a')]=_['merge'](_0x3daa61[_0x7c0a('0x4a')],{'$or':_['map'](_0x3daa61[_0x7c0a('0x42')],function(_0x542c4d){var _0x268f10={};_0x268f10[_0x542c4d]={'$like':'%'+_0x4bd9e2[_0x7c0a('0x3d')][_0x7c0a('0x4c')]+'%'};return _0x268f10;})});}_0x3daa61=_['merge']({},_0x3daa61,_0x4bd9e2[_0x7c0a('0x51')]);return _0x1fdf61[_0x7c0a('0xb2')](_0x3daa61);}})[_0x7c0a('0x23')](function(_0x302014){if(_0x302014){_0x1d4bfa=_0x302014[_0x7c0a('0x43')];if(!_0x4bd9e2[_0x7c0a('0x3d')]['hasOwnProperty']('nolimit')){_0x3daa61[_0x7c0a('0x46')]=qs[_0x7c0a('0x46')](_0x4bd9e2[_0x7c0a('0x3d')]['limit']);_0x3daa61['offset']=qs['offset'](_0x4bd9e2['query'][_0x7c0a('0x47')]);}return _0x1fdf61[_0x7c0a('0xb2')](_0x3daa61);}})[_0x7c0a('0x23')](function(_0x4c4b81){if(_0x4c4b81){return _0x4c4b81?{'count':_0x1d4bfa,'rows':_0x4c4b81}:null;}})[_0x7c0a('0x23')](respondWithResult(_0xf88ca5,null))['catch'](handleError(_0xf88ca5,null));};exports[_0x7c0a('0xb3')]=function(_0x393c4e,_0x306ddd,_0x46448c){var _0x462c06={'raw':![],'where':{}};var _0x23c286={};var _0x5da184={'count':0x0,'rows':[]};return db[_0x7c0a('0x3a')][_0x7c0a('0x64')]({'where':{'id':_0x393c4e[_0x7c0a('0x55')]['id']}})['then'](handleEntityNotFound(_0x306ddd,null))['then'](function(_0x57b42d){if(_0x57b42d){_0x23c286[_0x7c0a('0x40')]=_[_0x7c0a('0x3c')](db['SmsInteraction']['rawAttributes']);_0x23c286[_0x7c0a('0x3d')]=_[_0x7c0a('0x3c')](_0x393c4e['query']);_0x23c286[_0x7c0a('0x3e')]=_[_0x7c0a('0x3f')](_0x23c286[_0x7c0a('0x40')],_0x23c286[_0x7c0a('0x3d')]);_0x462c06[_0x7c0a('0x42')]=_[_0x7c0a('0x3f')](_0x23c286[_0x7c0a('0x40')],qs[_0x7c0a('0x41')](_0x393c4e[_0x7c0a('0x3d')]['fields']));_0x462c06[_0x7c0a('0x42')]=_0x462c06[_0x7c0a('0x42')][_0x7c0a('0x43')]?_0x462c06[_0x7c0a('0x42')]:_0x23c286[_0x7c0a('0x40')];if(!_0x393c4e[_0x7c0a('0x3d')][_0x7c0a('0x44')]('nolimit')){_0x462c06[_0x7c0a('0x46')]=qs[_0x7c0a('0x46')](_0x393c4e[_0x7c0a('0x3d')]['limit']);_0x462c06[_0x7c0a('0x47')]=qs[_0x7c0a('0x47')](_0x393c4e[_0x7c0a('0x3d')]['offset']);}_0x462c06[_0x7c0a('0x48')]=qs[_0x7c0a('0x49')](_0x393c4e['query'][_0x7c0a('0x49')]);_0x462c06[_0x7c0a('0x4a')]=qs[_0x7c0a('0x3e')](_[_0x7c0a('0x4b')](_0x393c4e['query'],_0x23c286[_0x7c0a('0x3e')]));_0x462c06[_0x7c0a('0x4a')][_0x7c0a('0x61')]=_0x57b42d['id'];if(_0x393c4e[_0x7c0a('0x3d')][_0x7c0a('0x4c')]){_0x462c06[_0x7c0a('0x4a')]=_['merge'](_0x462c06[_0x7c0a('0x4a')],{'$or':_['map'](_0x462c06[_0x7c0a('0x42')],function(_0x1eb59e){var _0x5d8140={};_0x5d8140[_0x1eb59e]={'$like':'%'+_0x393c4e[_0x7c0a('0x3d')][_0x7c0a('0x4c')]+'%'};return _0x5d8140;})});}_0x462c06=_[_0x7c0a('0x4d')]({},_0x462c06,_0x393c4e[_0x7c0a('0x51')]);return db[_0x7c0a('0x9c')][_0x7c0a('0x2f')]({'where':_0x462c06['where']})[_0x7c0a('0x23')](function(_0x7cfa3e){_0x5da184[_0x7c0a('0x2f')]=_0x7cfa3e;if(_0x393c4e[_0x7c0a('0x3d')][_0x7c0a('0x56')]){_0x462c06[_0x7c0a('0x52')]=[{'model':db[_0x7c0a('0x96')],'as':_0x7c0a('0xb4'),'required':![]},{'model':db[_0x7c0a('0xa6')],'as':_0x7c0a('0xb5'),'attributes':[_0x7c0a('0x5e'),_0x7c0a('0xb6'),_0x7c0a('0xb7')],'required':![]},{'model':db[_0x7c0a('0xb8')],'as':_0x7c0a('0xb9'),'attributes':['id',_0x7c0a('0x5e'),_0x7c0a('0xba')],'where':_0x393c4e['query'][_0x7c0a('0xbb')]?{'id':_0x393c4e[_0x7c0a('0x3d')][_0x7c0a('0xbb')]}:undefined,'required':_0x393c4e['query'][_0x7c0a('0xbb')]?!![]:![]}];}return db[_0x7c0a('0x9c')]['findAll'](_0x462c06);})[_0x7c0a('0x23')](function(_0x3335be){_0x5da184['rows']=_0x3335be;return _0x5da184;});}})['then'](respondWithFilteredResult(_0x306ddd,_0x462c06))['catch'](handleError(_0x306ddd,null));};exports[_0x7c0a('0xbc')]=function(_0x34f868,_0xfdc604,_0x1c31b1){var _0xe7edf8,_0x46716c,_0x24ef9a;if(_[_0x7c0a('0x92')](_0x34f868[_0x7c0a('0x5f')][_0x7c0a('0x5f')])||_0x34f868[_0x7c0a('0x5f')][_0x7c0a('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0x7c0a('0x93'));}if(_['isNil'](_0x34f868[_0x7c0a('0x5f')]['to'])){throw new db[(_0x7c0a('0x73'))][(_0x7c0a('0x74'))](_0x7c0a('0xbd'));}_0xe7edf8=_0x34f868[_0x7c0a('0x5f')]['to'];return db['SmsAccount'][_0x7c0a('0x57')]({'where':{'id':_0x34f868[_0x7c0a('0x55')]['id']},'include':[{'model':db[_0x7c0a('0xbe')],'as':_0x7c0a('0xbf'),'include':[{'model':db[_0x7c0a('0x96')],'as':_0x7c0a('0x9a'),'where':{'mobile':_0xe7edf8},'limit':0x1,'order':[[_0x7c0a('0x77'),_0x7c0a('0x97')]]}]}]})[_0x7c0a('0x23')](handleEntityNotFound(_0xfdc604,null))[_0x7c0a('0x23')](function(_0x382543){if(_0x382543&&_0x382543[_0x7c0a('0xbf')]){_0x46716c=_0x382543[_0x7c0a('0x35')]({'plain':!![]});if(_0x46716c[_0x7c0a('0xbf')]&&_0x46716c[_0x7c0a('0xbf')]['Contacts'][_0x7c0a('0x43')]){return _0x46716c[_0x7c0a('0xbf')][_0x7c0a('0x9a')][0x0];}return db['CmContact'][_0x7c0a('0x5d')](_[_0x7c0a('0x1c')](_0x34f868[_0x7c0a('0x5f')],{'firstName':_0xe7edf8,'mobile':_0xe7edf8,'phone':_0xe7edf8,'ListId':_0x46716c[_0x7c0a('0x79')]}));}})[_0x7c0a('0x23')](handleEntityNotFound(_0xfdc604,null))[_0x7c0a('0x23')](function(_0x35007c){if(_0x35007c){_0x24ef9a=_0x35007c;return db[_0x7c0a('0x9c')][_0x7c0a('0x57')]({'where':{'ContactId':_0x24ef9a['id'],'closed':![],'SmsAccountId':_0x46716c['id']}})['then'](function(_0x343ba0){if(_0x343ba0){return[_0x343ba0,![]];}return db[_0x7c0a('0x9c')][_0x7c0a('0x5d')]({'UserId':_0x34f868[_0x7c0a('0x59')]['id'],'ContactId':_0x24ef9a['id'],'SmsAccountId':_0x46716c['id'],'phone':_0xe7edf8,'firstMsgDirection':'out','Messages':[_[_0x7c0a('0x4d')](_0x34f868['body'],{'read':![],'body':_0x34f868[_0x7c0a('0x5f')][_0x7c0a('0x5f')],'phone':_0xe7edf8,'SmsAccountId':_0x46716c['id'],'UserId':_0x34f868[_0x7c0a('0x59')]['id'],'ContactId':_0x24ef9a['id']})]},{'include':[{'model':db[_0x7c0a('0xa3')],'as':_0x7c0a('0xc0')}]})[_0x7c0a('0x23')](function(_0x571444){return[_0x571444,!![]];});});}})[_0x7c0a('0x9d')](function(_0x877832,_0x59ebe4){if(_0x59ebe4){return _0x877832;}return db[_0x7c0a('0xa3')]['create'](_['merge'](_0x34f868[_0x7c0a('0x5f')],{'read':![],'body':_0x34f868[_0x7c0a('0x5f')][_0x7c0a('0x5f')],'phone':_0xe7edf8,'SmsAccountId':_0x46716c['id'],'SmsInteractionId':_0x877832['id'],'UserId':_0x34f868['user']['id'],'ContactId':_0x24ef9a['id']}))[_0x7c0a('0x23')](function(_0x48358e){_0x877832['dataValues']['Messages']=[];_0x877832[_0x7c0a('0xc1')]['Messages'][_0x7c0a('0x9f')](_0x48358e['dataValues']);return _0x877832;});})[_0x7c0a('0x23')](respondWithResult(_0xfdc604,null))[_0x7c0a('0x53')](handleError(_0xfdc604,null));};exports[_0x7c0a('0x2c')]=function(_0x4b1bca,_0x4639a6,_0x29006f){if(_0x4b1bca[_0x7c0a('0x5f')]['id']){delete _0x4b1bca[_0x7c0a('0x5f')]['id'];}console[_0x7c0a('0xc2')]('endpoint\x20/status\x20POST\x20/',_0x4b1bca[_0x7c0a('0x5f')]);var _0x5b1d80,_0x286f16,_0xf2e480;return db[_0x7c0a('0x3a')][_0x7c0a('0x57')]({'where':{'id':_0x4b1bca['params']['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x4639a6,null))['then'](function(_0x5aa2ef){if(_0x5aa2ef){_0xf2e480=_0x5aa2ef;logger[_0x7c0a('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7c0a('0x2c'),_0x7c0a('0xc3'),_0x5aa2ef['type'],util[_0x7c0a('0xc4')](_0x4b1bca[_0x7c0a('0x5f')],{'showHidden':![],'depth':null}));switch(_0x5aa2ef[_0x7c0a('0x4f')]){case _0x7c0a('0x80'):if(_0x4b1bca['body'][_0x7c0a('0xc5')]&&_0x4b1bca[_0x7c0a('0x5f')]['status']){_0x286f16=_0x4b1bca['body']['status'];return db['SmsMessage'][_0x7c0a('0x57')]({'where':{'messageId':_0x4b1bca[_0x7c0a('0x5f')]['skebby_dispatch_id']}});}break;case _0x7c0a('0x83'):if(_0x4b1bca['body']['requestid']&&_0x4b1bca[_0x7c0a('0x5f')][_0x7c0a('0xc6')]){_0x286f16=_0x4b1bca[_0x7c0a('0x5f')][_0x7c0a('0xc6')];return db[_0x7c0a('0xa3')]['find']({'where':{'messageId':_0x4b1bca['body'][_0x7c0a('0xc7')]}});}break;case _0x7c0a('0x84'):if(_0x4b1bca['body'][_0x7c0a('0xc8')]&&_0x4b1bca[_0x7c0a('0x5f')][_0x7c0a('0xc9')]){_0x286f16=_0x4b1bca[_0x7c0a('0x5f')]['status_code'];return db['SmsMessage'][_0x7c0a('0x57')]({'where':{'messageId':_0x4b1bca['body'][_0x7c0a('0xc8')]}});}break;case _0x7c0a('0x88'):var _0x33826b=_0x4b1bca[_0x7c0a('0x5f')][_0x7c0a('0x89')][0x0];if(_0x33826b[_0x7c0a('0x7e')]&&_0x33826b[_0x7c0a('0x2c')][_0x7c0a('0xca')]===_0x7c0a('0xcb')){_0x286f16=_0x33826b[_0x7c0a('0x2c')][_0x7c0a('0xca')];return db[_0x7c0a('0xa3')]['find']({'where':{'messageId':_0x33826b[_0x7c0a('0x7e')]}});}break;case _0x7c0a('0x8c'):if(_0x4b1bca[_0x7c0a('0x5f')][_0x7c0a('0x7e')]&&_0x4b1bca['body'][_0x7c0a('0x2c')]){_0x286f16=_0x4b1bca['body'][_0x7c0a('0x2c')];return db[_0x7c0a('0xa3')][_0x7c0a('0x57')]({'where':{'messageId':_0x4b1bca[_0x7c0a('0x5f')][_0x7c0a('0x7e')]}});}break;case'intelepeer':if(_0x4b1bca['body'][_0x7c0a('0xcc')]&&_0x4b1bca[_0x7c0a('0x5f')][_0x7c0a('0x2c')]){_0x286f16=_0x4b1bca['body']['status'];return db[_0x7c0a('0xa3')][_0x7c0a('0x57')]({'where':{'messageId':_0x4b1bca[_0x7c0a('0x5f')][_0x7c0a('0xcc')]}});}break;}}})['then'](handleEntityNotFound(_0x4639a6,null))['then'](function(_0xf1f28f){if(_0xf1f28f){_0x5b1d80=_0xf1f28f;switch(_0xf2e480[_0x7c0a('0x4f')]){case _0x7c0a('0x80'):if(_0x286f16===_0x7c0a('0xcb')){return _0x5b1d80[_0x7c0a('0x33')]({'read':!![]});}else{logger['error'](_0x7c0a('0x26'),_0x7c0a('0x2c'),_0x7c0a('0x80'),util['inspect'](_0x4b1bca['body'],{'showHidden':![],'depth':null}));}break;case _0x7c0a('0x83'):if(_0x286f16==='1'){return _0x5b1d80[_0x7c0a('0x33')]({'read':!![]});}else{logger[_0x7c0a('0x28')](_0x7c0a('0x26'),_0x7c0a('0x2c'),_0x7c0a('0x80'),util[_0x7c0a('0xc4')](_0x4b1bca[_0x7c0a('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7c0a('0x84'):if(!_0x4b1bca['body']['error_code']&&_0x286f16>=0xc8&&_0x286f16<=0xce){return _0x5b1d80[_0x7c0a('0x33')]({'read':!![]});}else{logger[_0x7c0a('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x7c0a('0x84'),util[_0x7c0a('0xc4')](_0x4b1bca['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2e4e01=_0x4b1bca[_0x7c0a('0x5f')]['results'][0x0];if(_0x2e4e01['status'][_0x7c0a('0xca')]==='DELIVERED'){return _0x5b1d80[_0x7c0a('0x33')]({'read':!![]});}else{logger[_0x7c0a('0x28')](_0x7c0a('0x26'),_0x7c0a('0x2c'),'infobip',util[_0x7c0a('0xc4')](_0x4b1bca[_0x7c0a('0x5f')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x286f16=='DELIVERED_TO_GATEWAY'||_0x286f16==_0x7c0a('0xcd')){return _0x5b1d80[_0x7c0a('0x33')]({'read':!![]});}else{logger[_0x7c0a('0x28')](_0x7c0a('0x26'),_0x7c0a('0x2c'),_0x7c0a('0x8c'),util[_0x7c0a('0xc4')](_0x4b1bca[_0x7c0a('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7c0a('0x8f'):if(_0x286f16===_0x7c0a('0xce')||_0x286f16==='ACCEPTD'){return _0x5b1d80[_0x7c0a('0x33')]({'read':!![]});}else{logger[_0x7c0a('0x28')](_0x7c0a('0x26'),_0x7c0a('0x2c'),_0x7c0a('0x8f'),util[_0x7c0a('0xc4')](_0x4b1bca[_0x7c0a('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x5b1d80;}})['then'](respondWithResult(_0x4639a6,null))[_0x7c0a('0x53')](handleError(_0x4639a6,null));};exports[_0x7c0a('0xcf')]=function(_0xd01e50,_0x1d33c9,_0x2cb80e){var _0x2dbaaa,_0x4f8b03,_0xb1bd2e;return db['SmsAccount'][_0x7c0a('0x57')]({'where':{'id':_0xd01e50[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x1d33c9,null))['then'](function(_0x43ead8){if(_0x43ead8){_0xb1bd2e=_0x43ead8;logger[_0x7c0a('0x25')](_0x7c0a('0x26'),_0x7c0a('0x2c'),_0x7c0a('0xc3'),_0x43ead8[_0x7c0a('0x4f')],util[_0x7c0a('0xc4')](_0xd01e50[_0x7c0a('0x3d')],{'showHidden':![],'depth':null}));switch(_0x43ead8['type']){case _0x7c0a('0xd0'):if(_0xd01e50[_0x7c0a('0x3d')][_0x7c0a('0xd1')]&&_0xd01e50[_0x7c0a('0x3d')][_0x7c0a('0xd2')]){_0x4f8b03=_0xd01e50[_0x7c0a('0x3d')][_0x7c0a('0xd2')];return db[_0x7c0a('0xa3')]['find']({'where':{'messageId':_0xd01e50[_0x7c0a('0x3d')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x1d33c9,null))['then'](function(_0x21e6b5){if(_0x21e6b5){_0x2dbaaa=_0x21e6b5;switch(_0xb1bd2e[_0x7c0a('0x4f')]){case _0x7c0a('0xd0'):if(_0x4f8b03==='2'||_0x4f8b03==='6'){return _0x2dbaaa[_0x7c0a('0x33')]({'read':!![]});}else{logger[_0x7c0a('0x28')](_0x7c0a('0x26'),_0x7c0a('0x2c'),_0x7c0a('0xd0'),util['inspect'](_0xd01e50[_0x7c0a('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x2dbaaa;}})[_0x7c0a('0x23')](respondWithResult(_0x1d33c9,null))['catch'](handleError(_0x1d33c9,null));};exports[_0x7c0a('0xd3')]=function(_0x2399cb,_0x514760,_0x5e19e0){return db[_0x7c0a('0x3a')][_0x7c0a('0x57')]({'where':{'id':_0x2399cb['params']['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x514760,null))['then'](function(_0x39a6f0){if(_0x39a6f0){return _0x39a6f0[_0x7c0a('0xd3')](_0x2399cb[_0x7c0a('0x5f')][_0x7c0a('0x67')],_[_0x7c0a('0x99')](_0x2399cb[_0x7c0a('0x5f')],[_0x7c0a('0x67'),'id'])||{})[_0x7c0a('0x9d')](function(_0x43e3ee){for(var _0x3db521=0x0;_0x3db521<_0x2399cb[_0x7c0a('0x5f')][_0x7c0a('0x67')][_0x7c0a('0x43')];_0x3db521+=0x1){socket[_0x7c0a('0xd4')]('userSmsAccount:save',{'UserId':_0x2399cb[_0x7c0a('0x5f')][_0x7c0a('0x67')][_0x3db521],'SmsAccountId':_0x2399cb['params']['id']});}return _0x43e3ee;});}})[_0x7c0a('0x23')](respondWithResult(_0x514760,null))[_0x7c0a('0x53')](handleError(_0x514760,null));};exports[_0x7c0a('0xd5')]=function(_0x5bf4c6,_0x494cf2,_0x4601c9){var _0x32362d;return db[_0x7c0a('0x3a')][_0x7c0a('0x57')]({'where':{'id':_0x5bf4c6[_0x7c0a('0x55')]['id']}})['then'](handleEntityNotFound(_0x494cf2,null))[_0x7c0a('0x23')](function(_0x378a94){if(_0x378a94){return _0x378a94[_0x7c0a('0xd5')](_0x5bf4c6[_0x7c0a('0x3d')]['ids'])['then'](function(_0x4105e8){if(_[_0x7c0a('0xd6')](_0x5bf4c6[_0x7c0a('0x3d')][_0x7c0a('0x67')])){for(var _0x50870e=0x0;_0x50870e<_0x5bf4c6[_0x7c0a('0x3d')][_0x7c0a('0x67')][_0x7c0a('0x43')];_0x50870e+=0x1){socket[_0x7c0a('0xd4')](_0x7c0a('0xd7'),{'UserId':_0x5bf4c6[_0x7c0a('0x3d')][_0x7c0a('0x67')][_0x50870e],'SmsAccountId':_0x5bf4c6['params']['id']});}}else{socket[_0x7c0a('0xd4')](_0x7c0a('0xd7'),{'UserId':_0x5bf4c6[_0x7c0a('0x3d')][_0x7c0a('0x67')],'SmsAccountId':_0x5bf4c6[_0x7c0a('0x55')]['id']});}});}})[_0x7c0a('0x23')](respondWithStatusCode(_0x494cf2,null))['catch'](handleError(_0x494cf2,null));};exports[_0x7c0a('0xd8')]=function(_0x543ee9,_0x1a5b70,_0x1d592d){var _0x5471f8={};var _0x535b49={};var _0x5ab2b8;var _0x4ab16f;return db[_0x7c0a('0x3a')][_0x7c0a('0x64')]({'where':{'id':_0x543ee9[_0x7c0a('0x55')]['id']}})[_0x7c0a('0x23')](handleEntityNotFound(_0x1a5b70,null))['then'](function(_0x23c4f1){if(_0x23c4f1){_0x5ab2b8=_0x23c4f1;_0x535b49[_0x7c0a('0x40')]=_[_0x7c0a('0x3c')](db[_0x7c0a('0xa6')][_0x7c0a('0x3b')]);_0x535b49['query']=_[_0x7c0a('0x3c')](_0x543ee9[_0x7c0a('0x3d')]);_0x535b49[_0x7c0a('0x3e')]=_[_0x7c0a('0x3f')](_0x535b49[_0x7c0a('0x40')],_0x535b49[_0x7c0a('0x3d')]);_0x5471f8[_0x7c0a('0x42')]=_[_0x7c0a('0x3f')](_0x535b49[_0x7c0a('0x40')],qs[_0x7c0a('0x41')](_0x543ee9[_0x7c0a('0x3d')]['fields']));_0x5471f8[_0x7c0a('0x42')]=_0x5471f8[_0x7c0a('0x42')][_0x7c0a('0x43')]?_0x5471f8['attributes']:_0x535b49[_0x7c0a('0x40')];_0x5471f8[_0x7c0a('0x48')]=qs[_0x7c0a('0x49')](_0x543ee9['query']['sort']);_0x5471f8[_0x7c0a('0x4a')]=qs[_0x7c0a('0x3e')](_[_0x7c0a('0x4b')](_0x543ee9[_0x7c0a('0x3d')],_0x535b49[_0x7c0a('0x3e')]));if(_0x543ee9[_0x7c0a('0x3d')]['filter']){_0x5471f8[_0x7c0a('0x4a')]=_[_0x7c0a('0x4d')](_0x5471f8[_0x7c0a('0x4a')],{'$or':_[_0x7c0a('0x4e')](_0x5471f8['attributes'],function(_0x1906bb){var _0x17cd3d={};_0x17cd3d[_0x1906bb]={'$like':'%'+_0x543ee9[_0x7c0a('0x3d')][_0x7c0a('0x4c')]+'%'};return _0x17cd3d;})});}_0x5471f8=_[_0x7c0a('0x4d')]({},_0x5471f8,_0x543ee9[_0x7c0a('0x51')]);return _0x5ab2b8[_0x7c0a('0xd8')](_0x5471f8);}})[_0x7c0a('0x23')](function(_0x143be8){if(_0x143be8){_0x4ab16f=_0x143be8[_0x7c0a('0x43')];if(!_0x543ee9[_0x7c0a('0x3d')][_0x7c0a('0x44')](_0x7c0a('0x45'))){_0x5471f8[_0x7c0a('0x46')]=qs['limit'](_0x543ee9[_0x7c0a('0x3d')]['limit']);_0x5471f8['offset']=qs['offset'](_0x543ee9[_0x7c0a('0x3d')][_0x7c0a('0x47')]);}return _0x5ab2b8['getAgents'](_0x5471f8);}})[_0x7c0a('0x23')](function(_0x5f5368){if(_0x5f5368){return _0x5f5368?{'count':_0x4ab16f,'rows':_0x5f5368}:null;}})[_0x7c0a('0x23')](respondWithResult(_0x1a5b70,null))[_0x7c0a('0x53')](handleError(_0x1a5b70,null));}; \ No newline at end of file +var _0x85e6=['pick','map','type','key','field','merge','options','count','includeAll','include','findAll','rows','params','intersection','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','hasOwnProperty','nolimit','filter','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','SmsApplication','Applications','account','applications','orderBy','priority','asc','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','plivo','From','Text','infobip','results','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','ContactId','unshift','waitForTheAssignedAgent','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','addApplications','sequelize','transaction','bulkCreate','getApplications','Contact','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','message_id','status_code','DELIVERED','redif','error_code','groupName','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','statusGet','csc','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','sendStatus','status','end','json','set','Content-Range','reject','save','destroy','SmsAccounts','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','keys','query','filters','fields','attributes','model','limit','offset','order','sort','where'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x85e6,0x171));var _0x685e=function(_0x2fbf98,_0x34069f){_0x2fbf98=_0x2fbf98-0x0;var _0x404969=_0x85e6[_0x2fbf98];return _0x404969;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x685e('0x0'));var rimraf=require(_0x685e('0x1'));var zipdir=require(_0x685e('0x2'));var jsonpatch=require(_0x685e('0x3'));var rp=require('request-promise');var moment=require(_0x685e('0x4'));var BPromise=require(_0x685e('0x5'));var Mustache=require(_0x685e('0x6'));var util=require('util');var path=require(_0x685e('0x7'));var sox=require(_0x685e('0x8'));var csv=require(_0x685e('0x9'));var ejs=require(_0x685e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x685e('0xb'));var jsforce=require(_0x685e('0xc'));var deskjs=require(_0x685e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x685e('0xe'));var authService=require(_0x685e('0xf'));var hardwareService=require(_0x685e('0x10'));var Redis=require('ioredis');var qs=require(_0x685e('0x11'));var logger=require(_0x685e('0x12'))(_0x685e('0x13'));var utils=require(_0x685e('0x14'));var config=require(_0x685e('0x15'));var db=require(_0x685e('0x16'))['db'];config[_0x685e('0x17')]=_['defaults'](config[_0x685e('0x17')],{'host':_0x685e('0x18'),'port':0x18eb});var socket=require(_0x685e('0x19'))(new Redis(config[_0x685e('0x17')]));require(_0x685e('0x1a'))[_0x685e('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x685e('0x1c')][_0x685e('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x31d3f9,_0x129c1a,_0x218664,_0x3c2bd3){return new BPromise(function(_0x4ab6f3,_0x3db7be){var _0x58232b=_0x3c2bd3||client;return _0x58232b[_0x685e('0x1e')](_0x31d3f9,_0x218664)[_0x685e('0x1f')](function(_0x526da6){logger[_0x685e('0x20')](_0x685e('0x21'),_0x129c1a,_0x685e('0x22'));logger[_0x685e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x129c1a,_0x685e('0x22'),JSON['stringify'](_0x526da6));if(_0x526da6[_0x685e('0x24')]){if(_0x526da6['error']['code']===0x1f4){logger[_0x685e('0x24')]('SmsAccount,\x20%s,\x20%s',_0x129c1a,_0x526da6[_0x685e('0x24')][_0x685e('0x25')]);return _0x3db7be(_0x526da6[_0x685e('0x24')][_0x685e('0x25')]);}logger[_0x685e('0x24')](_0x685e('0x21'),_0x129c1a,_0x526da6[_0x685e('0x24')][_0x685e('0x25')]);return _0x4ab6f3(_0x526da6[_0x685e('0x24')][_0x685e('0x25')]);}else{logger[_0x685e('0x20')](_0x685e('0x21'),_0x129c1a,'request\x20sent');_0x4ab6f3(_0x526da6['result'][_0x685e('0x25')]);}})[_0x685e('0x26')](function(_0x5b6185){logger['error'](_0x685e('0x21'),_0x129c1a,_0x5b6185);_0x3db7be(_0x5b6185);});});}function respondWithStatusCode(_0x454cd1,_0x498178){_0x498178=_0x498178||0xcc;return function(_0x1e5c7d){if(_0x1e5c7d){return _0x454cd1[_0x685e('0x27')](_0x498178);}return _0x454cd1[_0x685e('0x28')](_0x498178)[_0x685e('0x29')]();};}function respondWithResult(_0x41a7ee,_0x503fd5){_0x503fd5=_0x503fd5||0xc8;return function(_0x48020e){if(_0x48020e){return _0x41a7ee['status'](_0x503fd5)[_0x685e('0x2a')](_0x48020e);}};}function respondWithFilteredResult(_0x343fec,_0x243abe){return function(_0x47abae){if(_0x47abae){var _0x131764=_0x47abae['count'],_0x11f06a=_0x243abe['offset'],_0x929b63=_0x243abe['offset']+_0x243abe['limit'],_0x1d2186;if(_0x929b63>=_0x131764){_0x929b63=_0x131764;_0x1d2186=0xc8;}else{_0x1d2186=0xce;}_0x343fec[_0x685e('0x28')](_0x1d2186);return _0x343fec[_0x685e('0x2b')](_0x685e('0x2c'),_0x11f06a+'-'+_0x929b63+'/'+_0x131764)[_0x685e('0x2a')](_0x47abae);}return null;};}function patchUpdates(_0x309434){return function(_0x2d4bcc){try{jsonpatch['apply'](_0x2d4bcc,_0x309434,!![]);}catch(_0x554d3c){return BPromise[_0x685e('0x2d')](_0x554d3c);}return _0x2d4bcc[_0x685e('0x2e')]();};}function saveUpdates(_0x4d8789,_0x5ad76e){return function(_0x4b15b8){if(_0x4b15b8){return _0x4b15b8['update'](_0x4d8789)['then'](function(_0x68da19){return _0x68da19;});}return null;};}function removeEntity(_0x59033,_0x2d13d7){return function(_0x5caf6b){if(_0x5caf6b){return _0x5caf6b[_0x685e('0x2f')]()[_0x685e('0x1f')](function(){var _0x3151be=_0x5caf6b['get']({'plain':!![]});var _0x1183a1=_0x685e('0x30');return db['UserProfileResource'][_0x685e('0x2f')]({'where':{'type':_0x1183a1,'resourceId':_0x3151be['id']}})[_0x685e('0x1f')](function(){return _0x5caf6b;});})[_0x685e('0x1f')](function(){_0x59033[_0x685e('0x28')](0xcc)[_0x685e('0x29')]();});}};}function handleEntityNotFound(_0x58c92c,_0x133793){return function(_0xd692c7){if(!_0xd692c7){_0x58c92c[_0x685e('0x27')](0x194);}return _0xd692c7;};}function handleError(_0x3ad115,_0x23c845){_0x23c845=_0x23c845||0x1f4;return function(_0x1e4d46){logger[_0x685e('0x24')](_0x1e4d46[_0x685e('0x31')]);if(_0x1e4d46[_0x685e('0x32')]){delete _0x1e4d46[_0x685e('0x32')];}_0x3ad115['status'](_0x23c845)[_0x685e('0x33')](_0x1e4d46);};}exports['index']=function(_0x2885e6,_0xf82ee7){var _0x1ce1b6={'include':[{'model':db[_0x685e('0x34')],'as':_0x685e('0x35')}]},_0x15fdc3={},_0x42cfef={'count':0x0,'rows':[]};var _0x3077a2=db[_0x685e('0x36')][_0x685e('0x37')];_0x15fdc3['model']=_[_0x685e('0x38')](_0x3077a2);_0x15fdc3[_0x685e('0x39')]=_[_0x685e('0x38')](_0x2885e6[_0x685e('0x39')]);_0x15fdc3[_0x685e('0x3a')]=_['intersection'](_0x15fdc3['model'],_0x15fdc3[_0x685e('0x39')]);_0x1ce1b6['attributes']=_['intersection'](_0x15fdc3['model'],qs[_0x685e('0x3b')](_0x2885e6[_0x685e('0x39')]['fields']));_0x1ce1b6[_0x685e('0x3c')]=_0x1ce1b6[_0x685e('0x3c')]['length']?_0x1ce1b6['attributes']:_0x15fdc3[_0x685e('0x3d')];if(!_0x2885e6['query']['hasOwnProperty']('nolimit')){_0x1ce1b6[_0x685e('0x3e')]=qs[_0x685e('0x3e')](_0x2885e6[_0x685e('0x39')][_0x685e('0x3e')]);_0x1ce1b6['offset']=qs[_0x685e('0x3f')](_0x2885e6[_0x685e('0x39')]['offset']);}_0x1ce1b6[_0x685e('0x40')]=qs['sort'](_0x2885e6[_0x685e('0x39')][_0x685e('0x41')]);_0x1ce1b6[_0x685e('0x42')]=qs['filters'](_[_0x685e('0x43')](_0x2885e6[_0x685e('0x39')],_0x15fdc3['filters']));if(_0x2885e6[_0x685e('0x39')]['filter']){_0x1ce1b6[_0x685e('0x42')]=_['merge'](_0x1ce1b6[_0x685e('0x42')],{'$or':_[_0x685e('0x44')](_0x3077a2,function(_0x3e96a8){if(_0x3e96a8[_0x685e('0x45')][_0x685e('0x46')]!=='VIRTUAL'){var _0x5151a3={};_0x5151a3[_0x3e96a8[_0x685e('0x47')]]={'$like':'%'+_0x2885e6[_0x685e('0x39')]['filter']+'%'};return _0x5151a3;}})});}_0x1ce1b6=_[_0x685e('0x48')]({},_0x1ce1b6,_0x2885e6[_0x685e('0x49')]);var _0x1f4366={'where':_0x1ce1b6[_0x685e('0x42')]};return db[_0x685e('0x36')]['count'](_0x1f4366)[_0x685e('0x1f')](function(_0x56aa70){_0x42cfef[_0x685e('0x4a')]=_0x56aa70;if(_0x2885e6[_0x685e('0x39')][_0x685e('0x4b')]){_0x1ce1b6[_0x685e('0x4c')]=[{'all':!![]}];}return db[_0x685e('0x36')][_0x685e('0x4d')](_0x1ce1b6);})[_0x685e('0x1f')](function(_0x1e040b){_0x42cfef[_0x685e('0x4e')]=_0x1e040b;return _0x42cfef;})['then'](respondWithFilteredResult(_0xf82ee7,_0x1ce1b6))[_0x685e('0x26')](handleError(_0xf82ee7,null));};exports['show']=function(_0x4a9340,_0x719bea){var _0x4fac48={'raw':![],'where':{'id':_0x4a9340[_0x685e('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0x685e('0x35')}]},_0x2322cf={};_0x2322cf['model']=_[_0x685e('0x38')](db[_0x685e('0x36')][_0x685e('0x37')]);_0x2322cf[_0x685e('0x39')]=_['keys'](_0x4a9340[_0x685e('0x39')]);_0x2322cf['filters']=_[_0x685e('0x50')](_0x2322cf[_0x685e('0x3d')],_0x2322cf[_0x685e('0x39')]);_0x4fac48[_0x685e('0x3c')]=_['intersection'](_0x2322cf['model'],qs[_0x685e('0x3b')](_0x4a9340[_0x685e('0x39')]['fields']));_0x4fac48[_0x685e('0x3c')]=_0x4fac48['attributes'][_0x685e('0x51')]?_0x4fac48['attributes']:_0x2322cf[_0x685e('0x3d')];if(_0x4a9340[_0x685e('0x39')][_0x685e('0x4b')]){_0x4fac48['include']=[{'all':!![]}];}_0x4fac48=_['merge']({},_0x4fac48,_0x4a9340['options']);return db['SmsAccount']['find'](_0x4fac48)[_0x685e('0x1f')](handleEntityNotFound(_0x719bea,null))[_0x685e('0x1f')](respondWithResult(_0x719bea,null))['catch'](handleError(_0x719bea,null));};exports[_0x685e('0x52')]=function(_0x4a9a7f,_0xe90fbc){return db[_0x685e('0x36')][_0x685e('0x52')](_0x4a9a7f[_0x685e('0x53')],{})[_0x685e('0x1f')](function(_0x6d6c81){var _0x33c726=_0x4a9a7f[_0x685e('0x54')][_0x685e('0x55')]({'plain':!![]});if(!_0x33c726)throw new Error(_0x685e('0x56'));if(_0x33c726['role']===_0x685e('0x54')){var _0x243335=_0x6d6c81['get']({'plain':!![]});var _0x57f03d=_0x685e('0x30');return db[_0x685e('0x57')][_0x685e('0x58')]({'where':{'name':_0x57f03d,'userProfileId':_0x33c726[_0x685e('0x59')]},'raw':!![]})[_0x685e('0x1f')](function(_0x1b3b84){if(_0x1b3b84&&_0x1b3b84[_0x685e('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x243335[_0x685e('0x32')],'resourceId':_0x243335['id'],'type':_0x1b3b84[_0x685e('0x32')],'sectionId':_0x1b3b84['id']},{})[_0x685e('0x1f')](function(){return _0x6d6c81;});}else{return _0x6d6c81;}})[_0x685e('0x26')](function(_0x2f35c5){logger[_0x685e('0x24')](_0x685e('0x5b'),_0x2f35c5);throw _0x2f35c5;});}return _0x6d6c81;})['then'](respondWithResult(_0xe90fbc,0xc9))[_0x685e('0x26')](handleError(_0xe90fbc,null));};exports[_0x685e('0x5c')]=function(_0x5801fb,_0x5c6484){if(_0x5801fb[_0x685e('0x53')]['id']){delete _0x5801fb[_0x685e('0x53')]['id'];}return db[_0x685e('0x36')]['find']({'where':{'id':_0x5801fb[_0x685e('0x4f')]['id']},'include':[{'model':db[_0x685e('0x34')],'as':_0x685e('0x35')}]})[_0x685e('0x1f')](handleEntityNotFound(_0x5c6484,null))[_0x685e('0x1f')](saveUpdates(_0x5801fb[_0x685e('0x53')],null))[_0x685e('0x1f')](respondWithResult(_0x5c6484,null))[_0x685e('0x26')](handleError(_0x5c6484,null));};exports[_0x685e('0x2f')]=function(_0x581601,_0x3922fa){return db[_0x685e('0x36')][_0x685e('0x58')]({'where':{'id':_0x581601[_0x685e('0x4f')]['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x3922fa,null))[_0x685e('0x1f')](removeEntity(_0x3922fa,null))[_0x685e('0x26')](handleError(_0x3922fa,null));};exports[_0x685e('0x5d')]=function(_0x4cc12b,_0x123d7e){return db[_0x685e('0x36')]['describe']()[_0x685e('0x1f')](respondWithResult(_0x123d7e,null))[_0x685e('0x26')](handleError(_0x123d7e,null));};exports[_0x685e('0x5e')]=function(_0x1a4701,_0x54787f,_0x1048ba){if(_0x1a4701['body']['id']){delete _0x1a4701[_0x685e('0x53')]['id'];}return db[_0x685e('0x36')][_0x685e('0x58')]({'where':{'id':_0x1a4701['params']['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x54787f,null))['then'](function(_0x398135){if(_0x398135){_0x1a4701['body'][_0x685e('0x5f')]=_0x398135['id'];return db['Disposition']['create'](_0x1a4701[_0x685e('0x53')]);}})[_0x685e('0x1f')](respondWithResult(_0x54787f,null))[_0x685e('0x26')](handleError(_0x54787f,null));};exports[_0x685e('0x60')]=function(_0x2f734f,_0x3c5d73,_0x545d67){var _0x5a0843={'raw':![],'where':{}};var _0x2b2eb0={};var _0x3eac6c={'count':0x0,'rows':[]};return db['SmsAccount'][_0x685e('0x61')]({'where':{'id':_0x2f734f['params']['id']}})['then'](handleEntityNotFound(_0x3c5d73,null))['then'](function(_0x5beced){if(_0x5beced){_0x2b2eb0[_0x685e('0x3d')]=_[_0x685e('0x38')](db[_0x685e('0x62')][_0x685e('0x37')]);_0x2b2eb0[_0x685e('0x39')]=_[_0x685e('0x38')](_0x2f734f['query']);_0x2b2eb0[_0x685e('0x3a')]=_[_0x685e('0x50')](_0x2b2eb0[_0x685e('0x3d')],_0x2b2eb0['query']);_0x5a0843[_0x685e('0x3c')]=_['intersection'](_0x2b2eb0['model'],qs[_0x685e('0x3b')](_0x2f734f['query'][_0x685e('0x3b')]));_0x5a0843[_0x685e('0x3c')]=_0x5a0843[_0x685e('0x3c')][_0x685e('0x51')]?_0x5a0843[_0x685e('0x3c')]:_0x2b2eb0[_0x685e('0x3d')];if(!_0x2f734f['query'][_0x685e('0x63')](_0x685e('0x64'))){_0x5a0843[_0x685e('0x3e')]=qs[_0x685e('0x3e')](_0x2f734f[_0x685e('0x39')][_0x685e('0x3e')]);_0x5a0843[_0x685e('0x3f')]=qs['offset'](_0x2f734f['query'][_0x685e('0x3f')]);}_0x5a0843[_0x685e('0x40')]=qs[_0x685e('0x41')](_0x2f734f['query'][_0x685e('0x41')]);_0x5a0843['where']=qs['filters'](_[_0x685e('0x43')](_0x2f734f['query'],_0x2b2eb0[_0x685e('0x3a')]));_0x5a0843['where'][_0x685e('0x5f')]=_0x5beced['id'];if(_0x2f734f[_0x685e('0x39')]['filter']){_0x5a0843[_0x685e('0x42')]=_[_0x685e('0x48')](_0x5a0843[_0x685e('0x42')],{'$or':_[_0x685e('0x44')](_0x5a0843[_0x685e('0x3c')],function(_0x488e52){var _0x42688c={};_0x42688c[_0x488e52]={'$like':'%'+_0x2f734f['query'][_0x685e('0x65')]+'%'};return _0x42688c;})});}_0x5a0843=_[_0x685e('0x48')]({},_0x5a0843,_0x2f734f[_0x685e('0x49')]);return db[_0x685e('0x62')][_0x685e('0x4a')]({'where':_0x5a0843[_0x685e('0x42')]})['then'](function(_0x40d835){_0x3eac6c[_0x685e('0x4a')]=_0x40d835;if(_0x2f734f[_0x685e('0x39')][_0x685e('0x4b')]){_0x5a0843[_0x685e('0x4c')]=[{'all':!![]}];}return db[_0x685e('0x62')][_0x685e('0x4d')](_0x5a0843);})[_0x685e('0x1f')](function(_0x4a6bb2){_0x3eac6c[_0x685e('0x4e')]=_0x4a6bb2;return _0x3eac6c;});}})[_0x685e('0x1f')](respondWithFilteredResult(_0x3c5d73,_0x5a0843))[_0x685e('0x26')](handleError(_0x3c5d73,null));};exports['removeDispositions']=function(_0x3df08f,_0x550b35,_0x50024f){var _0x1277a9;return db['SmsAccount']['find']({'where':{'id':_0x3df08f['params']['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x550b35,null))['then'](function(_0x2abcb3){if(_0x2abcb3){return _0x2abcb3[_0x685e('0x66')](_0x3df08f[_0x685e('0x39')][_0x685e('0x67')]);}})['then'](respondWithStatusCode(_0x550b35,null))[_0x685e('0x26')](handleError(_0x550b35,null));};exports[_0x685e('0x68')]=function(_0x1b8e0e,_0x42730e,_0x582a80){if(_0x1b8e0e[_0x685e('0x53')]['id']){delete _0x1b8e0e[_0x685e('0x53')]['id'];}return db[_0x685e('0x36')][_0x685e('0x58')]({'where':{'id':_0x1b8e0e['params']['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x42730e,null))['then'](function(_0x276022){if(_0x276022){_0x1b8e0e[_0x685e('0x53')][_0x685e('0x5f')]=_0x276022['id'];return db['CannedAnswer']['create'](_0x1b8e0e[_0x685e('0x53')]);}})[_0x685e('0x1f')](respondWithResult(_0x42730e,null))[_0x685e('0x26')](handleError(_0x42730e,null));};exports[_0x685e('0x69')]=function(_0x169d97,_0x15422e,_0x5b3976){var _0x4f83d4={'raw':![],'where':{}};var _0x4ea02f={};var _0x339b43={'count':0x0,'rows':[]};return db[_0x685e('0x36')][_0x685e('0x61')]({'where':{'id':_0x169d97[_0x685e('0x4f')]['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x15422e,null))[_0x685e('0x1f')](function(_0x3313f0){if(_0x3313f0){_0x4ea02f[_0x685e('0x3d')]=_[_0x685e('0x38')](db['CannedAnswer'][_0x685e('0x37')]);_0x4ea02f['query']=_[_0x685e('0x38')](_0x169d97[_0x685e('0x39')]);_0x4ea02f['filters']=_[_0x685e('0x50')](_0x4ea02f[_0x685e('0x3d')],_0x4ea02f[_0x685e('0x39')]);_0x4f83d4[_0x685e('0x3c')]=_[_0x685e('0x50')](_0x4ea02f[_0x685e('0x3d')],qs[_0x685e('0x3b')](_0x169d97[_0x685e('0x39')][_0x685e('0x3b')]));_0x4f83d4['attributes']=_0x4f83d4['attributes'][_0x685e('0x51')]?_0x4f83d4[_0x685e('0x3c')]:_0x4ea02f['model'];if(!_0x169d97[_0x685e('0x39')][_0x685e('0x63')](_0x685e('0x64'))){_0x4f83d4[_0x685e('0x3e')]=qs[_0x685e('0x3e')](_0x169d97[_0x685e('0x39')][_0x685e('0x3e')]);_0x4f83d4[_0x685e('0x3f')]=qs[_0x685e('0x3f')](_0x169d97[_0x685e('0x39')][_0x685e('0x3f')]);}_0x4f83d4[_0x685e('0x40')]=qs[_0x685e('0x41')](_0x169d97[_0x685e('0x39')][_0x685e('0x41')]);_0x4f83d4[_0x685e('0x42')]=qs[_0x685e('0x3a')](_[_0x685e('0x43')](_0x169d97['query'],_0x4ea02f[_0x685e('0x3a')]));_0x4f83d4[_0x685e('0x42')][_0x685e('0x5f')]=_0x3313f0['id'];if(_0x169d97[_0x685e('0x39')][_0x685e('0x65')]){_0x4f83d4[_0x685e('0x42')]=_[_0x685e('0x48')](_0x4f83d4[_0x685e('0x42')],{'$or':_[_0x685e('0x44')](_0x4f83d4[_0x685e('0x3c')],function(_0x23c9e5){var _0x21bc18={};_0x21bc18[_0x23c9e5]={'$like':'%'+_0x169d97[_0x685e('0x39')][_0x685e('0x65')]+'%'};return _0x21bc18;})});}_0x4f83d4=_['merge']({},_0x4f83d4,_0x169d97[_0x685e('0x49')]);return db[_0x685e('0x6a')][_0x685e('0x4a')]({'where':_0x4f83d4[_0x685e('0x42')]})['then'](function(_0x374654){_0x339b43[_0x685e('0x4a')]=_0x374654;if(_0x169d97[_0x685e('0x39')][_0x685e('0x4b')]){_0x4f83d4[_0x685e('0x4c')]=[{'all':!![]}];}return db[_0x685e('0x6a')]['findAll'](_0x4f83d4);})['then'](function(_0x4cc608){_0x339b43[_0x685e('0x4e')]=_0x4cc608;return _0x339b43;});}})[_0x685e('0x1f')](respondWithFilteredResult(_0x15422e,_0x4f83d4))[_0x685e('0x26')](handleError(_0x15422e,null));};exports['removeAnswers']=function(_0x2c11d1,_0xb61a99,_0x466cf4){var _0x1cf631;return db['SmsAccount'][_0x685e('0x58')]({'where':{'id':_0x2c11d1[_0x685e('0x4f')]['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0xb61a99,null))[_0x685e('0x1f')](function(_0x2c122f){if(_0x2c122f){return _0x2c122f['removeAnswers'](_0x2c11d1['query'][_0x685e('0x67')]);}})[_0x685e('0x1f')](respondWithStatusCode(_0xb61a99,null))['catch'](handleError(_0xb61a99,null));};exports['notify']=function(_0x18c313,_0xa53d1c,_0x1ea7bb){var _0x203006={'channel':'sms'};var _0x1a1075=[];var _0x2880a7=[];var _0x28352d={};return db['SmsAccount']['find']({'where':{'id':_0x18c313[_0x685e('0x4f')]['id']},'include':[{'model':db[_0x685e('0x6b')],'as':_0x685e('0x6c')}]})['then'](handleEntityNotFound(_0xa53d1c,null))['then'](function(_0x45ac1a){_0x203006[_0x685e('0x6d')]=_0x45ac1a;_0x203006[_0x685e('0x6e')]=_[_0x685e('0x6f')](_0x45ac1a[_0x685e('0x6c')],[_0x685e('0x70')],[_0x685e('0x71')]);if(_0x203006[_0x685e('0x6d')]['Applications']){delete _0x203006[_0x685e('0x6d')]['Applications'];}return db['CmContact'][_0x685e('0x5d')]();})[_0x685e('0x1f')](function(_0x4d69e8){if(!_0x4d69e8){throw new db['Sequelize'][(_0x685e('0x72'))](_0x685e('0x73'));}_0x1a1075=_[_0x685e('0x74')](_[_0x685e('0x38')](_0x4d69e8),[_0x685e('0x75'),'updatedAt']);_0x2880a7=_[_0x685e('0x74')](_['keys'](_0x4d69e8),[_0x685e('0x75'),_0x685e('0x76'),_0x685e('0x77'),_0x685e('0x78')]);_0x203006[_0x685e('0x53')]={'mapKey':'mobile'};if(_0x203006[_0x685e('0x6d')][_0x685e('0x45')]){switch(_0x203006[_0x685e('0x6d')]['type']){case _0x685e('0x79'):_0x203006[_0x685e('0x53')][_0x685e('0x7a')]=_0x18c313['body']['From'];_0x203006[_0x685e('0x53')]['body']=_0x18c313[_0x685e('0x53')][_0x685e('0x7b')];_0x203006[_0x685e('0x53')][_0x685e('0x7c')]=_0x18c313['body'][_0x685e('0x7d')];break;case _0x685e('0x7e'):_0x203006[_0x685e('0x53')][_0x685e('0x7a')]='+'+_0x18c313['body'][_0x685e('0x7f')];_0x203006[_0x685e('0x53')][_0x685e('0x53')]=_0x18c313[_0x685e('0x53')][_0x685e('0x80')];break;case _0x685e('0x81'):_0x203006[_0x685e('0x53')][_0x685e('0x7a')]=_0x18c313['body'][_0x685e('0x7a')];_0x203006[_0x685e('0x53')][_0x685e('0x53')]=_0x18c313[_0x685e('0x53')][_0x685e('0x25')];break;case'clicksend':_0x203006['body'][_0x685e('0x7a')]=_0x18c313[_0x685e('0x53')][_0x685e('0x7a')];_0x203006[_0x685e('0x53')][_0x685e('0x53')]=_0x18c313[_0x685e('0x53')][_0x685e('0x53')];_0x203006[_0x685e('0x53')][_0x685e('0x7c')]=_0x18c313['body']['message_id'];break;case _0x685e('0x82'):_0x203006[_0x685e('0x53')]['from']=_0x18c313['body'][_0x685e('0x83')];_0x203006[_0x685e('0x53')][_0x685e('0x53')]=_0x18c313[_0x685e('0x53')][_0x685e('0x84')];_0x203006[_0x685e('0x53')]['messageId']=_0x18c313['body']['MessageUUID'];break;case _0x685e('0x85'):_0x203006['body'][_0x685e('0x7a')]='+'+_0x18c313[_0x685e('0x53')]['results'][0x0][_0x685e('0x7a')];_0x203006[_0x685e('0x53')][_0x685e('0x53')]=_0x18c313[_0x685e('0x53')][_0x685e('0x86')][0x0][_0x685e('0x80')];_0x203006['body'][_0x685e('0x7c')]=_0x18c313[_0x685e('0x53')]['results'][0x0][_0x685e('0x7c')];break;case'csc':_0x203006['body'][_0x685e('0x7a')]=_0x18c313[_0x685e('0x53')]['originatingAddress'];_0x203006[_0x685e('0x53')][_0x685e('0x53')]=_0x18c313['body'][_0x685e('0x87')]['message'];break;case _0x685e('0x88'):_0x203006[_0x685e('0x53')][_0x685e('0x7a')]=_0x18c313[_0x685e('0x53')][_0x685e('0x89')];_0x203006[_0x685e('0x53')][_0x685e('0x53')]=_0x18c313[_0x685e('0x53')][_0x685e('0x80')];_0x203006[_0x685e('0x53')]['messageId']=_0x18c313['body'][_0x685e('0x8a')];break;case _0x685e('0x8b'):_0x203006[_0x685e('0x53')][_0x685e('0x7a')]=_0x18c313['body'][_0x685e('0x7a')];_0x203006[_0x685e('0x53')][_0x685e('0x53')]=_0x18c313[_0x685e('0x53')][_0x685e('0x25')];_0x203006[_0x685e('0x53')]['messageId']=_0x18c313['body'][_0x685e('0x8c')];break;}}if(_0x203006['body']['id']){delete _0x203006[_0x685e('0x53')]['id'];}if(_[_0x685e('0x8d')](_0x203006[_0x685e('0x53')][_0x685e('0x7a')])){throw new db[(_0x685e('0x8e'))][(_0x685e('0x72'))](_0x685e('0x8f'));}if(_[_0x685e('0x8d')](_0x203006[_0x685e('0x53')]['body'])||_0x203006[_0x685e('0x53')][_0x685e('0x53')]===''){throw new db['Sequelize']['ValidationError'](_0x685e('0x90'));}if(_[_0x685e('0x8d')](_0x203006[_0x685e('0x53')][_0x685e('0x91')])){throw new db[(_0x685e('0x8e'))][(_0x685e('0x72'))](_0x685e('0x92')+_0x2880a7);}if(!_[_0x685e('0x93')](_0x2880a7,_0x203006['body'][_0x685e('0x91')])){throw new db[(_0x685e('0x8e'))][(_0x685e('0x72'))](_0x685e('0x94')+_0x2880a7);}_0x28352d[_0x203006[_0x685e('0x53')][_0x685e('0x91')]]=_0x203006[_0x685e('0x53')][_0x685e('0x7a')];return db[_0x685e('0x95')][_0x685e('0x58')]({'where':{'id':_0x203006['account'][_0x685e('0x78')]},'include':[{'model':db[_0x685e('0x96')],'as':_0x685e('0x97'),'where':_0x28352d,'limit':0x1,'order':[[_0x685e('0x76'),_0x685e('0x98')]]}]});})[_0x685e('0x1f')](handleEntityNotFound(_0xa53d1c,null))[_0x685e('0x1f')](function(_0x16b413){if(_0x16b413){_0x203006[_0x685e('0x99')]=_[_0x685e('0x9a')](_0x16b413,[_0x685e('0x97')]);if(_0x16b413[_0x685e('0x97')]['length']){return _0x16b413[_0x685e('0x97')][0x0];}var _0x1a52ab=_[_0x685e('0x9b')](_0x203006[_0x685e('0x53')],{'firstName':_0x203006[_0x685e('0x53')]['from'],'ListId':_0x16b413['id']});_0x1a52ab[_0x203006['body'][_0x685e('0x91')]]=_0x203006[_0x685e('0x53')]['from'];return db[_0x685e('0x96')][_0x685e('0x52')](_0x1a52ab,{'fields':_0x1a1075,'raw':!![]});}})[_0x685e('0x1f')](handleEntityNotFound(_0xa53d1c,null))[_0x685e('0x1f')](function(_0x546f72){if(_0x546f72){_0x203006[_0x685e('0x9c')]=_0x546f72;var _0x1ede6e={'ContactId':_0x546f72['id'],'phone':_0x203006[_0x685e('0x53')]['from'],'SmsAccountId':_0x18c313[_0x685e('0x4f')]['id']};var _0x226c3b={'ContactId':_0x546f72['id'],'SmsAccountId':_0x18c313[_0x685e('0x4f')]['id'],'closed':![]};return db[_0x685e('0x9d')][_0x685e('0x58')]({'where':_0x226c3b})[_0x685e('0x1f')](function(_0x293279){if(_0x293279){return[_0x293279,![]];}return db[_0x685e('0x9d')][_0x685e('0x52')](_0x1ede6e)[_0x685e('0x1f')](function(_0x116155){return[_0x116155,!![]];});});}})[_0x685e('0x9e')](function(_0x1cc325,_0x1168b1){_0x203006[_0x685e('0x9f')]=_0x1cc325['get']({'plain':!![]});_0x203006[_0x685e('0x9f')][_0x685e('0xa0')]=![];if(_0x1168b1){if(_0x203006[_0x685e('0x6d')][_0x685e('0xa1')]){_0x203006[_0x685e('0x6e')]['push']({'id':0x0,'priority':_0x203006[_0x685e('0x6e')][_0x685e('0x51')]+0x1,'app':_0x685e('0xa2'),'appdata':_0x685e('0xa3'),'interval':'*,*,*,*'});}_0x203006['interaction'][_0x685e('0xa0')]=!![];}return db['SmsMessage'][_0x685e('0x52')]({'phone':_0x203006[_0x685e('0x53')][_0x685e('0x7a')],'messageId':_0x203006[_0x685e('0x53')][_0x685e('0x7c')],'body':_0x203006[_0x685e('0x53')][_0x685e('0x53')],'SmsAccountId':_0x18c313[_0x685e('0x4f')]['id'],'SmsInteractionId':_0x1cc325['id'],'direction':'in','ContactId':_0x1cc325[_0x685e('0xa4')],'AttachmentId':_0x203006[_0x685e('0x53')]['AttachmentId']});})[_0x685e('0x1f')](function(_0x96294d){_0x203006[_0x685e('0x25')]=_0x96294d;if(_0x203006['interaction']['UserId']){return db['User'][_0x685e('0x58')]({'attributes':['id',_0x685e('0x32')],'where':{'id':_0x203006['interaction']['UserId']}})[_0x685e('0x1f')](function(_0x4f90d8){if(_0x4f90d8){_0x203006['applications'][_0x685e('0xa5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4f90d8[_0x685e('0x32')]+','+(_0x203006[_0x685e('0x6d')][_0x685e('0xa6')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x685e('0xa7'),_0x203006);});}return respondWithRpcPromise('Start',_0x685e('0xa7'),_0x203006);})['then'](function(_0x51630d){if(_0x51630d){var _0x56b909=0xc8;var _0x6c3e15=_0x685e('0xa8');logger['info'](_0x685e('0xa9'),_0x6c3e15,_0x56b909,_0x685e('0xaa'));logger[_0x685e('0x23')](_0x685e('0xab'),_0x6c3e15,_0x56b909,_0x685e('0xaa'),JSON[_0x685e('0xac')](_0x51630d));if(_0x203006[_0x685e('0x6d')][_0x685e('0x45')]==='twilio'){return _0xa53d1c[_0x685e('0x28')](_0x56b909)[_0x685e('0x2b')](_0x685e('0xad'),_0x685e('0xae'))[_0x685e('0x33')]('\x0a');}else{return _0xa53d1c[_0x685e('0x28')](_0x56b909)['json'](_0x51630d);}}})[_0x685e('0x26')](handleError(_0xa53d1c,null));};exports[_0x685e('0xaf')]=function(_0x326956,_0x5a3fa6,_0x4f40fd){return db[_0x685e('0x36')][_0x685e('0x61')]({'where':{'id':_0x326956[_0x685e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5a3fa6,null))[_0x685e('0x1f')](function(_0x14cb92){if(_0x14cb92){return db[_0x685e('0xb0')][_0x685e('0xb1')](function(_0x57196c){return db[_0x685e('0x6b')]['destroy']({'where':{'SmsAccountId':_0x326956[_0x685e('0x4f')]['id']},'transaction':_0x57196c})[_0x685e('0x1f')](function(_0x24ac0f){var _0x255332=_[_0x685e('0x44')](_0x326956[_0x685e('0x53')],function(_0x56f041){_0x56f041[_0x685e('0x5f')]=_0x326956[_0x685e('0x4f')]['id'];return _0x56f041;});return db[_0x685e('0x6b')][_0x685e('0xb2')](_0x255332,{'transaction':_0x57196c});});})[_0x685e('0x1f')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x326956['params']['id']},'order':_0x685e('0x70')});});}})[_0x685e('0x1f')](respondWithResult(_0x5a3fa6,null))[_0x685e('0x26')](handleError(_0x5a3fa6,null));};exports[_0x685e('0xb3')]=function(_0x381934,_0x2ce498,_0x4eeca6){var _0x4951bd={};var _0xc1a04a={};var _0x238e87;var _0x16b34e;return db[_0x685e('0x36')][_0x685e('0x61')]({'where':{'id':_0x381934[_0x685e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2ce498,null))[_0x685e('0x1f')](function(_0x391579){if(_0x391579){_0x238e87=_0x391579;_0xc1a04a[_0x685e('0x3d')]=_[_0x685e('0x38')](db['SmsApplication'][_0x685e('0x37')]);_0xc1a04a['query']=_[_0x685e('0x38')](_0x381934[_0x685e('0x39')]);_0xc1a04a[_0x685e('0x3a')]=_[_0x685e('0x50')](_0xc1a04a['model'],_0xc1a04a[_0x685e('0x39')]);_0x4951bd[_0x685e('0x3c')]=_[_0x685e('0x50')](_0xc1a04a[_0x685e('0x3d')],qs['fields'](_0x381934[_0x685e('0x39')][_0x685e('0x3b')]));_0x4951bd[_0x685e('0x3c')]=_0x4951bd[_0x685e('0x3c')][_0x685e('0x51')]?_0x4951bd[_0x685e('0x3c')]:_0xc1a04a['model'];_0x4951bd[_0x685e('0x40')]=qs[_0x685e('0x41')](_0x381934[_0x685e('0x39')]['sort']);_0x4951bd[_0x685e('0x42')]=qs[_0x685e('0x3a')](_['pick'](_0x381934[_0x685e('0x39')],_0xc1a04a[_0x685e('0x3a')]));if(_0x381934[_0x685e('0x39')]['filter']){_0x4951bd[_0x685e('0x42')]=_[_0x685e('0x48')](_0x4951bd[_0x685e('0x42')],{'$or':_[_0x685e('0x44')](_0x4951bd[_0x685e('0x3c')],function(_0x222566){var _0x379998={};_0x379998[_0x222566]={'$like':'%'+_0x381934['query'][_0x685e('0x65')]+'%'};return _0x379998;})});}_0x4951bd=_[_0x685e('0x48')]({},_0x4951bd,_0x381934[_0x685e('0x49')]);return _0x238e87[_0x685e('0xb3')](_0x4951bd);}})[_0x685e('0x1f')](function(_0x174c24){if(_0x174c24){_0x16b34e=_0x174c24[_0x685e('0x51')];if(!_0x381934[_0x685e('0x39')][_0x685e('0x63')](_0x685e('0x64'))){_0x4951bd[_0x685e('0x3e')]=qs[_0x685e('0x3e')](_0x381934['query'][_0x685e('0x3e')]);_0x4951bd['offset']=qs[_0x685e('0x3f')](_0x381934[_0x685e('0x39')][_0x685e('0x3f')]);}return _0x238e87['getApplications'](_0x4951bd);}})[_0x685e('0x1f')](function(_0x557358){if(_0x557358){return _0x557358?{'count':_0x16b34e,'rows':_0x557358}:null;}})[_0x685e('0x1f')](respondWithResult(_0x2ce498,null))[_0x685e('0x26')](handleError(_0x2ce498,null));};exports['getInteractions']=function(_0x90c5ec,_0x2fa3e2,_0x1fe5cd){var _0x4e0c85={'raw':![],'where':{}};var _0x59571b={};var _0x6797ac={'count':0x0,'rows':[]};return db[_0x685e('0x36')][_0x685e('0x61')]({'where':{'id':_0x90c5ec['params']['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x2fa3e2,null))[_0x685e('0x1f')](function(_0x9cd457){if(_0x9cd457){_0x59571b[_0x685e('0x3d')]=_['keys'](db[_0x685e('0x9d')][_0x685e('0x37')]);_0x59571b[_0x685e('0x39')]=_[_0x685e('0x38')](_0x90c5ec[_0x685e('0x39')]);_0x59571b[_0x685e('0x3a')]=_[_0x685e('0x50')](_0x59571b[_0x685e('0x3d')],_0x59571b[_0x685e('0x39')]);_0x4e0c85['attributes']=_['intersection'](_0x59571b[_0x685e('0x3d')],qs[_0x685e('0x3b')](_0x90c5ec['query']['fields']));_0x4e0c85[_0x685e('0x3c')]=_0x4e0c85[_0x685e('0x3c')][_0x685e('0x51')]?_0x4e0c85[_0x685e('0x3c')]:_0x59571b[_0x685e('0x3d')];if(!_0x90c5ec[_0x685e('0x39')][_0x685e('0x63')]('nolimit')){_0x4e0c85[_0x685e('0x3e')]=qs[_0x685e('0x3e')](_0x90c5ec['query'][_0x685e('0x3e')]);_0x4e0c85[_0x685e('0x3f')]=qs[_0x685e('0x3f')](_0x90c5ec[_0x685e('0x39')]['offset']);}_0x4e0c85['order']=qs[_0x685e('0x41')](_0x90c5ec[_0x685e('0x39')][_0x685e('0x41')]);_0x4e0c85['where']=qs[_0x685e('0x3a')](_[_0x685e('0x43')](_0x90c5ec[_0x685e('0x39')],_0x59571b[_0x685e('0x3a')]));_0x4e0c85[_0x685e('0x42')][_0x685e('0x5f')]=_0x9cd457['id'];if(_0x90c5ec[_0x685e('0x39')][_0x685e('0x65')]){_0x4e0c85[_0x685e('0x42')]=_[_0x685e('0x48')](_0x4e0c85['where'],{'$or':_[_0x685e('0x44')](_0x4e0c85[_0x685e('0x3c')],function(_0x375710){var _0x43887b={};_0x43887b[_0x375710]={'$like':'%'+_0x90c5ec[_0x685e('0x39')][_0x685e('0x65')]+'%'};return _0x43887b;})});}_0x4e0c85=_['merge']({},_0x4e0c85,_0x90c5ec['options']);return db[_0x685e('0x9d')][_0x685e('0x4a')]({'where':_0x4e0c85[_0x685e('0x42')]})['then'](function(_0x1f7f46){_0x6797ac['count']=_0x1f7f46;if(_0x90c5ec[_0x685e('0x39')][_0x685e('0x4b')]){_0x4e0c85[_0x685e('0x4c')]=[{'model':db['CmContact'],'as':_0x685e('0xb4'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x685e('0x32'),_0x685e('0xb5'),_0x685e('0xb6')],'required':![]},{'model':db[_0x685e('0xb7')],'as':_0x685e('0xb8'),'attributes':['id',_0x685e('0x32'),'color'],'where':_0x90c5ec[_0x685e('0x39')][_0x685e('0xb9')]?{'id':_0x90c5ec['query'][_0x685e('0xb9')]}:undefined,'required':_0x90c5ec[_0x685e('0x39')][_0x685e('0xb9')]?!![]:![]}];}return db['SmsInteraction'][_0x685e('0x4d')](_0x4e0c85);})[_0x685e('0x1f')](function(_0x55cad9){_0x6797ac[_0x685e('0x4e')]=_0x55cad9;return _0x6797ac;});}})[_0x685e('0x1f')](respondWithFilteredResult(_0x2fa3e2,_0x4e0c85))[_0x685e('0x26')](handleError(_0x2fa3e2,null));};exports[_0x685e('0x33')]=function(_0x5e91bd,_0x52f043,_0x1a62b5){var _0x3f3404,_0x246e1a,_0x8145c7;if(_[_0x685e('0x8d')](_0x5e91bd[_0x685e('0x53')][_0x685e('0x53')])||_0x5e91bd[_0x685e('0x53')][_0x685e('0x53')]===''){throw new db[(_0x685e('0x8e'))][(_0x685e('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x685e('0x8d')](_0x5e91bd[_0x685e('0x53')]['to'])){throw new db['Sequelize'][(_0x685e('0x72'))](_0x685e('0xba'));}_0x3f3404=_0x5e91bd[_0x685e('0x53')]['to'];return db[_0x685e('0x36')][_0x685e('0x58')]({'where':{'id':_0x5e91bd[_0x685e('0x4f')]['id']},'include':[{'model':db[_0x685e('0x95')],'as':_0x685e('0xbb'),'include':[{'model':db[_0x685e('0x96')],'as':_0x685e('0x97'),'where':{'mobile':_0x3f3404},'limit':0x1,'order':[[_0x685e('0x76'),_0x685e('0x98')]]}]}]})['then'](handleEntityNotFound(_0x52f043,null))[_0x685e('0x1f')](function(_0x43e362){if(_0x43e362&&_0x43e362[_0x685e('0xbb')]){_0x246e1a=_0x43e362[_0x685e('0x55')]({'plain':!![]});if(_0x246e1a[_0x685e('0xbb')]&&_0x246e1a[_0x685e('0xbb')][_0x685e('0x97')][_0x685e('0x51')]){return _0x246e1a[_0x685e('0xbb')][_0x685e('0x97')][0x0];}return db[_0x685e('0x96')][_0x685e('0x52')](_[_0x685e('0x9b')](_0x5e91bd['body'],{'firstName':_0x3f3404,'mobile':_0x3f3404,'phone':_0x3f3404,'ListId':_0x246e1a[_0x685e('0x78')]}));}})[_0x685e('0x1f')](handleEntityNotFound(_0x52f043,null))['then'](function(_0xd4771d){if(_0xd4771d){_0x8145c7=_0xd4771d;return db['SmsInteraction'][_0x685e('0x58')]({'where':{'ContactId':_0x8145c7['id'],'closed':![],'SmsAccountId':_0x246e1a['id']}})[_0x685e('0x1f')](function(_0xe5b586){if(_0xe5b586){return[_0xe5b586,![]];}return db[_0x685e('0x9d')][_0x685e('0x52')]({'UserId':_0x5e91bd[_0x685e('0x54')]['id'],'ContactId':_0x8145c7['id'],'SmsAccountId':_0x246e1a['id'],'phone':_0x3f3404,'firstMsgDirection':_0x685e('0xbc'),'Messages':[_[_0x685e('0x48')](_0x5e91bd[_0x685e('0x53')],{'read':![],'body':_0x5e91bd[_0x685e('0x53')][_0x685e('0x53')],'phone':_0x3f3404,'SmsAccountId':_0x246e1a['id'],'UserId':_0x5e91bd[_0x685e('0x54')]['id'],'ContactId':_0x8145c7['id']})]},{'include':[{'model':db[_0x685e('0xbd')],'as':_0x685e('0xbe')}]})[_0x685e('0x1f')](function(_0x1f973a){return[_0x1f973a,!![]];});});}})[_0x685e('0x9e')](function(_0x4d5fbe,_0x218295){if(_0x218295){return _0x4d5fbe;}return db[_0x685e('0xbd')][_0x685e('0x52')](_['merge'](_0x5e91bd[_0x685e('0x53')],{'read':![],'body':_0x5e91bd['body'][_0x685e('0x53')],'phone':_0x3f3404,'SmsAccountId':_0x246e1a['id'],'SmsInteractionId':_0x4d5fbe['id'],'UserId':_0x5e91bd[_0x685e('0x54')]['id'],'ContactId':_0x8145c7['id']}))[_0x685e('0x1f')](function(_0x503559){_0x4d5fbe[_0x685e('0xbf')][_0x685e('0xbe')]=[];_0x4d5fbe[_0x685e('0xbf')][_0x685e('0xbe')][_0x685e('0xc0')](_0x503559['dataValues']);return _0x4d5fbe;});})[_0x685e('0x1f')](respondWithResult(_0x52f043,null))[_0x685e('0x26')](handleError(_0x52f043,null));};exports['status']=function(_0x1d7d57,_0x4c4f22,_0x55f81c){if(_0x1d7d57[_0x685e('0x53')]['id']){delete _0x1d7d57['body']['id'];}console['log']('endpoint\x20/status\x20POST\x20/',_0x1d7d57[_0x685e('0x53')]);var _0x43c776,_0x4c3850,_0x5bf07e;return db[_0x685e('0x36')][_0x685e('0x58')]({'where':{'id':_0x1d7d57['params']['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x4c4f22,null))['then'](function(_0x5860bc){if(_0x5860bc){_0x5bf07e=_0x5860bc;logger[_0x685e('0x23')](_0x685e('0xa9'),_0x685e('0x28'),_0x685e('0xc1'),_0x5860bc['type'],util[_0x685e('0xc2')](_0x1d7d57[_0x685e('0x53')],{'showHidden':![],'depth':null}));switch(_0x5860bc['type']){case'skebby':if(_0x1d7d57[_0x685e('0x53')][_0x685e('0xc3')]&&_0x1d7d57[_0x685e('0x53')][_0x685e('0x28')]){_0x4c3850=_0x1d7d57[_0x685e('0x53')][_0x685e('0x28')];return db[_0x685e('0xbd')][_0x685e('0x58')]({'where':{'messageId':_0x1d7d57[_0x685e('0x53')]['skebby_dispatch_id']}});}break;case _0x685e('0x81'):if(_0x1d7d57['body'][_0x685e('0xc4')]&&_0x1d7d57['body']['statusInt']){_0x4c3850=_0x1d7d57[_0x685e('0x53')][_0x685e('0xc5')];return db[_0x685e('0xbd')]['find']({'where':{'messageId':_0x1d7d57[_0x685e('0x53')]['requestid']}});}break;case _0x685e('0xc6'):if(_0x1d7d57['body'][_0x685e('0xc7')]&&_0x1d7d57[_0x685e('0x53')][_0x685e('0xc8')]){_0x4c3850=_0x1d7d57[_0x685e('0x53')][_0x685e('0xc8')];return db[_0x685e('0xbd')][_0x685e('0x58')]({'where':{'messageId':_0x1d7d57['body'][_0x685e('0xc7')]}});}break;case _0x685e('0x85'):var _0x1938bc=_0x1d7d57['body'][_0x685e('0x86')][0x0];if(_0x1938bc[_0x685e('0x7c')]&&_0x1938bc[_0x685e('0x28')]['groupName']===_0x685e('0xc9')){_0x4c3850=_0x1938bc[_0x685e('0x28')]['groupName'];return db[_0x685e('0xbd')][_0x685e('0x58')]({'where':{'messageId':_0x1938bc[_0x685e('0x7c')]}});}break;case'clickatell':if(_0x1d7d57['body'][_0x685e('0x7c')]&&_0x1d7d57[_0x685e('0x53')][_0x685e('0x28')]){_0x4c3850=_0x1d7d57['body'][_0x685e('0x28')];return db[_0x685e('0xbd')][_0x685e('0x58')]({'where':{'messageId':_0x1d7d57[_0x685e('0x53')][_0x685e('0x7c')]}});}break;case'intelepeer':if(_0x1d7d57[_0x685e('0x53')][_0x685e('0xca')]&&_0x1d7d57['body']['status']){_0x4c3850=_0x1d7d57[_0x685e('0x53')][_0x685e('0x28')];return db[_0x685e('0xbd')][_0x685e('0x58')]({'where':{'messageId':_0x1d7d57[_0x685e('0x53')][_0x685e('0xca')]}});}break;}}})['then'](handleEntityNotFound(_0x4c4f22,null))[_0x685e('0x1f')](function(_0x476bc9){if(_0x476bc9){_0x43c776=_0x476bc9;switch(_0x5bf07e[_0x685e('0x45')]){case _0x685e('0x7e'):if(_0x4c3850===_0x685e('0xc9')){return _0x43c776['update']({'read':!![]});}else{logger[_0x685e('0x24')](_0x685e('0xa9'),_0x685e('0x28'),_0x685e('0x7e'),util[_0x685e('0xc2')](_0x1d7d57[_0x685e('0x53')],{'showHidden':![],'depth':null}));}break;case _0x685e('0x81'):if(_0x4c3850==='1'){return _0x43c776[_0x685e('0x5c')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x685e('0x28'),_0x685e('0x7e'),util[_0x685e('0xc2')](_0x1d7d57['body'],{'showHidden':![],'depth':null}));}break;case _0x685e('0xc6'):if(!_0x1d7d57[_0x685e('0x53')][_0x685e('0xcb')]&&_0x4c3850>=0xc8&&_0x4c3850<=0xce){return _0x43c776['update']({'read':!![]});}else{logger['error'](_0x685e('0xa9'),_0x685e('0x28'),_0x685e('0xc6'),util[_0x685e('0xc2')](_0x1d7d57[_0x685e('0x53')],{'showHidden':![],'depth':null}));}break;case _0x685e('0x85'):var _0x1ba058=_0x1d7d57[_0x685e('0x53')][_0x685e('0x86')][0x0];if(_0x1ba058[_0x685e('0x28')][_0x685e('0xcc')]===_0x685e('0xc9')){return _0x43c776[_0x685e('0x5c')]({'read':!![]});}else{logger['error'](_0x685e('0xa9'),_0x685e('0x28'),'infobip',util[_0x685e('0xc2')](_0x1d7d57['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c3850==_0x685e('0xcd')||_0x4c3850==_0x685e('0xce')){return _0x43c776['update']({'read':!![]});}else{logger['error'](_0x685e('0xa9'),_0x685e('0x28'),_0x685e('0x88'),util['inspect'](_0x1d7d57[_0x685e('0x53')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4c3850==='DELIVRD'||_0x4c3850==='ACCEPTD'){return _0x43c776[_0x685e('0x5c')]({'read':!![]});}else{logger[_0x685e('0x24')](_0x685e('0xa9'),_0x685e('0x28'),_0x685e('0x8b'),util[_0x685e('0xc2')](_0x1d7d57[_0x685e('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x43c776;}})[_0x685e('0x1f')](respondWithResult(_0x4c4f22,null))[_0x685e('0x26')](handleError(_0x4c4f22,null));};exports[_0x685e('0xcf')]=function(_0x586d1c,_0x34a1ba,_0x15fc8e){var _0x350773,_0x31baa9,_0x5af1ae;return db[_0x685e('0x36')][_0x685e('0x58')]({'where':{'id':_0x586d1c[_0x685e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x34a1ba,null))['then'](function(_0xbe5722){if(_0xbe5722){_0x5af1ae=_0xbe5722;logger[_0x685e('0x23')](_0x685e('0xa9'),_0x685e('0x28'),_0x685e('0xc1'),_0xbe5722[_0x685e('0x45')],util['inspect'](_0x586d1c['query'],{'showHidden':![],'depth':null}));switch(_0xbe5722['type']){case _0x685e('0xd0'):if(_0x586d1c[_0x685e('0x39')][_0x685e('0xd1')]&&_0x586d1c[_0x685e('0x39')]['state']){_0x31baa9=_0x586d1c[_0x685e('0x39')]['state'];return db['SmsMessage'][_0x685e('0x58')]({'where':{'messageId':_0x586d1c[_0x685e('0x39')][_0x685e('0xd1')]}});}break;}}})[_0x685e('0x1f')](handleEntityNotFound(_0x34a1ba,null))[_0x685e('0x1f')](function(_0x254870){if(_0x254870){_0x350773=_0x254870;switch(_0x5af1ae['type']){case _0x685e('0xd0'):if(_0x31baa9==='2'||_0x31baa9==='6'){return _0x350773['update']({'read':!![]});}else{logger[_0x685e('0x24')](_0x685e('0xa9'),_0x685e('0x28'),_0x685e('0xd0'),util[_0x685e('0xc2')](_0x586d1c[_0x685e('0x39')],{'showHidden':![],'depth':null}));};break;}return _0x350773;}})['then'](respondWithResult(_0x34a1ba,null))[_0x685e('0x26')](handleError(_0x34a1ba,null));};exports[_0x685e('0xd2')]=function(_0x1dba6e,_0x21a9b7,_0x2cbf7f){return db[_0x685e('0x36')][_0x685e('0x58')]({'where':{'id':_0x1dba6e[_0x685e('0x4f')]['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x21a9b7,null))[_0x685e('0x1f')](function(_0x5e30c8){if(_0x5e30c8){return _0x5e30c8[_0x685e('0xd2')](_0x1dba6e['body'][_0x685e('0x67')],_[_0x685e('0x9a')](_0x1dba6e[_0x685e('0x53')],['ids','id'])||{})[_0x685e('0x9e')](function(_0x52766b){for(var _0x54f283=0x0;_0x54f283<_0x1dba6e[_0x685e('0x53')][_0x685e('0x67')][_0x685e('0x51')];_0x54f283+=0x1){socket[_0x685e('0xd3')](_0x685e('0xd4'),{'UserId':_0x1dba6e[_0x685e('0x53')]['ids'][_0x54f283],'SmsAccountId':_0x1dba6e[_0x685e('0x4f')]['id']});}return _0x52766b;});}})['then'](respondWithResult(_0x21a9b7,null))[_0x685e('0x26')](handleError(_0x21a9b7,null));};exports[_0x685e('0xd5')]=function(_0x324920,_0x4a87b8,_0x1e5b3b){var _0x4fc0cb;return db['SmsAccount'][_0x685e('0x58')]({'where':{'id':_0x324920['params']['id']}})['then'](handleEntityNotFound(_0x4a87b8,null))['then'](function(_0x2c9bfe){if(_0x2c9bfe){return _0x2c9bfe[_0x685e('0xd5')](_0x324920[_0x685e('0x39')][_0x685e('0x67')])['then'](function(_0x3bd6ad){if(_[_0x685e('0xd6')](_0x324920[_0x685e('0x39')][_0x685e('0x67')])){for(var _0x265e7d=0x0;_0x265e7d<_0x324920['query'][_0x685e('0x67')][_0x685e('0x51')];_0x265e7d+=0x1){socket['emit'](_0x685e('0xd7'),{'UserId':_0x324920[_0x685e('0x39')][_0x685e('0x67')][_0x265e7d],'SmsAccountId':_0x324920[_0x685e('0x4f')]['id']});}}else{socket[_0x685e('0xd3')](_0x685e('0xd7'),{'UserId':_0x324920[_0x685e('0x39')][_0x685e('0x67')],'SmsAccountId':_0x324920[_0x685e('0x4f')]['id']});}});}})['then'](respondWithStatusCode(_0x4a87b8,null))['catch'](handleError(_0x4a87b8,null));};exports['getAgents']=function(_0x4af368,_0x2f2cd7,_0x56280f){var _0x1c109b={};var _0x4e3d6a={};var _0x3af727;var _0x3eca24;return db['SmsAccount']['findOne']({'where':{'id':_0x4af368[_0x685e('0x4f')]['id']}})[_0x685e('0x1f')](handleEntityNotFound(_0x2f2cd7,null))[_0x685e('0x1f')](function(_0x55bf35){if(_0x55bf35){_0x3af727=_0x55bf35;_0x4e3d6a['model']=_[_0x685e('0x38')](db[_0x685e('0xd8')][_0x685e('0x37')]);_0x4e3d6a[_0x685e('0x39')]=_[_0x685e('0x38')](_0x4af368[_0x685e('0x39')]);_0x4e3d6a[_0x685e('0x3a')]=_[_0x685e('0x50')](_0x4e3d6a[_0x685e('0x3d')],_0x4e3d6a['query']);_0x1c109b[_0x685e('0x3c')]=_[_0x685e('0x50')](_0x4e3d6a[_0x685e('0x3d')],qs['fields'](_0x4af368['query']['fields']));_0x1c109b['attributes']=_0x1c109b['attributes']['length']?_0x1c109b[_0x685e('0x3c')]:_0x4e3d6a['model'];_0x1c109b['order']=qs[_0x685e('0x41')](_0x4af368[_0x685e('0x39')][_0x685e('0x41')]);_0x1c109b[_0x685e('0x42')]=qs[_0x685e('0x3a')](_[_0x685e('0x43')](_0x4af368[_0x685e('0x39')],_0x4e3d6a['filters']));if(_0x4af368[_0x685e('0x39')]['filter']){_0x1c109b[_0x685e('0x42')]=_[_0x685e('0x48')](_0x1c109b[_0x685e('0x42')],{'$or':_[_0x685e('0x44')](_0x1c109b[_0x685e('0x3c')],function(_0x476538){var _0x535977={};_0x535977[_0x476538]={'$like':'%'+_0x4af368['query'][_0x685e('0x65')]+'%'};return _0x535977;})});}_0x1c109b=_[_0x685e('0x48')]({},_0x1c109b,_0x4af368['options']);return _0x3af727[_0x685e('0xd9')](_0x1c109b);}})['then'](function(_0x3d6a48){if(_0x3d6a48){_0x3eca24=_0x3d6a48['length'];if(!_0x4af368['query'][_0x685e('0x63')]('nolimit')){_0x1c109b[_0x685e('0x3e')]=qs[_0x685e('0x3e')](_0x4af368[_0x685e('0x39')]['limit']);_0x1c109b[_0x685e('0x3f')]=qs[_0x685e('0x3f')](_0x4af368['query']['offset']);}return _0x3af727[_0x685e('0xd9')](_0x1c109b);}})[_0x685e('0x1f')](function(_0x52287c){if(_0x52287c){return _0x52287c?{'count':_0x3eca24,'rows':_0x52287c}:null;}})[_0x685e('0x1f')](respondWithResult(_0x2f2cd7,null))['catch'](handleError(_0x2f2cd7,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 53e0558..1adde81 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 _0xfce7=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','save','update','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfce7,0x13a));var _0x7fce=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0xfce7[_0x2b9e8a];return _0x520e67;};'use strict';var EventEmitter=require(_0x7fce('0x0'));var SmsAccount=require(_0x7fce('0x1'))['db'][_0x7fce('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7fce('0x3'),'afterUpdate':_0x7fce('0x4'),'afterDestroy':_0x7fce('0x5')};function emitEvent(_0x1c8a75){return function(_0x3c1d6a,_0x2b6960,_0x2ccc3a){SmsAccountEvents[_0x7fce('0x6')](_0x1c8a75+':'+_0x3c1d6a['id'],_0x3c1d6a);SmsAccountEvents['emit'](_0x1c8a75,_0x3c1d6a);_0x2ccc3a(null);};}for(var e in events){if(events[_0x7fce('0x7')](e)){var event=events[e];SmsAccount[_0x7fce('0x8')](e,emitEvent(event));}}module[_0x7fce('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x1504=['../../mysqldb','SmsAccount','setMaxListeners','save','emit','hook','exports','events'];(function(_0x58597f,_0x475a35){var _0xaae07=function(_0x297813){while(--_0x297813){_0x58597f['push'](_0x58597f['shift']());}};_0xaae07(++_0x475a35);}(_0x1504,0x17f));var _0x4150=function(_0x4edac5,_0x41d853){_0x4edac5=_0x4edac5-0x0;var _0x572b3b=_0x1504[_0x4edac5];return _0x572b3b;};'use strict';var EventEmitter=require(_0x4150('0x0'));var SmsAccount=require(_0x4150('0x1'))['db'][_0x4150('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4150('0x3')](0x0);var events={'afterCreate':_0x4150('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb35d29){return function(_0x1eb9a2,_0x20473f,_0x169d15){SmsAccountEvents['emit'](_0xb35d29+':'+_0x1eb9a2['id'],_0x1eb9a2);SmsAccountEvents[_0x4150('0x5')](_0xb35d29,_0x1eb9a2);_0x169d15(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x4150('0x6')](e,emitEvent(event));}}module[_0x4150('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 23c80ac..5db9ef8 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 _0xb4c2=['define','sms_accounts','util','../../config/logger','api','moment','bluebird','request-promise','./smsAccount.attributes','exports'];(function(_0x32431d,_0x5d8320){var _0x11efea=function(_0x7adca5){while(--_0x7adca5){_0x32431d['push'](_0x32431d['shift']());}};_0x11efea(++_0x5d8320);}(_0xb4c2,0x19c));var _0x2b4c=function(_0x3ce422,_0x170bef){_0x3ce422=_0x3ce422-0x0;var _0x39e306=_0xb4c2[_0x3ce422];return _0x39e306;};'use strict';var _=require('lodash');var util=require(_0x2b4c('0x0'));var logger=require(_0x2b4c('0x1'))(_0x2b4c('0x2'));var moment=require(_0x2b4c('0x3'));var BPromise=require(_0x2b4c('0x4'));var rp=require(_0x2b4c('0x5'));var attributes=require(_0x2b4c('0x6'));module[_0x2b4c('0x7')]=function(_0x11a289,_0x682899){return _0x11a289[_0x2b4c('0x8')]('SmsAccount',attributes,{'tableName':_0x2b4c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x047f=['define','sms_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','./smsAccount.attributes','exports'];(function(_0x4b4b06,_0x27f28b){var _0x477a49=function(_0x4e8300){while(--_0x4e8300){_0x4b4b06['push'](_0x4b4b06['shift']());}};_0x477a49(++_0x27f28b);}(_0x047f,0xfc));var _0xf047=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x047f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf047('0x0'));var util=require(_0xf047('0x1'));var logger=require(_0xf047('0x2'))(_0xf047('0x3'));var moment=require('moment');var BPromise=require(_0xf047('0x4'));var rp=require(_0xf047('0x5'));var attributes=require(_0xf047('0x6'));module[_0xf047('0x7')]=function(_0x872078,_0x59fbc3){return _0x872078[_0xf047('0x8')]('SmsAccount',attributes,{'tableName':_0xf047('0x9'),'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 0c5b3b5..73eb88c 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 _0x9312=['request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','attributes','include','map','model','then','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','info'];(function(_0x277c93,_0x33a8bb){var _0x1bc988=function(_0x4c1ffb){while(--_0x4c1ffb){_0x277c93['push'](_0x277c93['shift']());}};_0x1bc988(++_0x33a8bb);}(_0x9312,0x122));var _0x2931=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x9312[_0x174ef5];return _0x1cc379;};'use strict';var _=require('lodash');var util=require(_0x2931('0x0'));var moment=require('moment');var BPromise=require(_0x2931('0x1'));var rs=require(_0x2931('0x2'));var fs=require('fs');var Redis=require(_0x2931('0x3'));var db=require(_0x2931('0x4'))['db'];var utils=require(_0x2931('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2931('0x6'));var jayson=require(_0x2931('0x7'));var client=jayson[_0x2931('0x8')][_0x2931('0x9')]({'port':0x232a});config[_0x2931('0xa')]=_['defaults'](config[_0x2931('0xa')],{'host':_0x2931('0xb'),'port':0x18eb});var socket=require(_0x2931('0xc'))(new Redis(config[_0x2931('0xa')]));require(_0x2931('0xd'))[_0x2931('0xe')](socket);function respondWithRpcPromise(_0xa92a2e,_0x13539f,_0xc049f4){return new BPromise(function(_0x382d92,_0x155307){return client['request'](_0xa92a2e,_0xc049f4)['then'](function(_0x106ad1){logger[_0x2931('0xf')]('SmsAccount,\x20%s,\x20%s',_0x13539f,'request\x20sent');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x13539f,_0x2931('0x10'),JSON[_0x2931('0x11')](_0x106ad1));if(_0x106ad1[_0x2931('0x12')]){if(_0x106ad1['error'][_0x2931('0x13')]===0x1f4){logger[_0x2931('0x12')](_0x2931('0x14'),_0x13539f,_0x106ad1[_0x2931('0x12')][_0x2931('0x15')]);return _0x155307(_0x106ad1[_0x2931('0x12')][_0x2931('0x15')]);}logger[_0x2931('0x12')](_0x2931('0x14'),_0x13539f,_0x106ad1[_0x2931('0x12')][_0x2931('0x15')]);return _0x382d92(_0x106ad1[_0x2931('0x12')]['message']);}else{logger['info'](_0x2931('0x14'),_0x13539f,'request\x20sent');_0x382d92(_0x106ad1[_0x2931('0x16')][_0x2931('0x15')]);}})[_0x2931('0x17')](function(_0x3e31d4){logger[_0x2931('0x12')](_0x2931('0x14'),_0x13539f,_0x3e31d4);_0x155307(_0x3e31d4);});});}exports[_0x2931('0x18')]=function(_0x39c262){var _0x32dc7a=this;return new Promise(function(_0x52c98d,_0x20869b){return db[_0x2931('0x19')][_0x2931('0x1a')]({'raw':_0x39c262[_0x2931('0x1b')]?_0x39c262[_0x2931('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x39c262['options']?_0x39c262[_0x2931('0x1b')]['where']||null:null,'attributes':_0x39c262[_0x2931('0x1b')]?_0x39c262[_0x2931('0x1b')][_0x2931('0x1c')]||null:null,'include':_0x39c262[_0x2931('0x1b')]?_0x39c262[_0x2931('0x1b')][_0x2931('0x1d')]?_[_0x2931('0x1e')](_0x39c262[_0x2931('0x1b')][_0x2931('0x1d')],function(_0x24e7df){return{'model':db[_0x24e7df[_0x2931('0x1f')]],'as':_0x24e7df['as'],'attributes':_0x24e7df[_0x2931('0x1c')],'include':_0x24e7df[_0x2931('0x1d')]?_[_0x2931('0x1e')](_0x24e7df['include'],function(_0x1bb862){return{'model':db[_0x1bb862[_0x2931('0x1f')]],'as':_0x1bb862['as'],'attributes':_0x1bb862[_0x2931('0x1c')],'include':_0x1bb862[_0x2931('0x1d')]?_[_0x2931('0x1e')](_0x1bb862[_0x2931('0x1d')],function(_0xa57e35){return{'model':db[_0xa57e35[_0x2931('0x1f')]],'as':_0xa57e35['as'],'attributes':_0xa57e35[_0x2931('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2931('0x20')](function(_0x25d561){logger['info'](_0x2931('0x18'),_0x39c262);logger[_0x2931('0x21')](_0x2931('0x18'),_0x39c262,JSON['stringify'](_0x25d561));_0x52c98d(_0x25d561);})[_0x2931('0x17')](function(_0x2c0ff7){logger[_0x2931('0x12')](_0x2931('0x18'),_0x2c0ff7[_0x2931('0x15')],_0x39c262);_0x20869b(_0x32dc7a['error'](0x1f4,_0x2c0ff7[_0x2931('0x15')]));});});}; \ No newline at end of file +var _0x22cd=['where','attributes','include','model','map','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','options'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x22cd,0x115));var _0xd22c=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x22cd[_0x282a1f];return _0x296ea7;};'use strict';var _=require(_0xd22c('0x0'));var util=require('util');var moment=require(_0xd22c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd22c('0x2'));var db=require(_0xd22c('0x3'))['db'];var utils=require(_0xd22c('0x4'));var logger=require(_0xd22c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd22c('0x6'));var client=jayson[_0xd22c('0x7')][_0xd22c('0x8')]({'port':0x232a});config[_0xd22c('0x9')]=_[_0xd22c('0xa')](config[_0xd22c('0x9')],{'host':_0xd22c('0xb'),'port':0x18eb});var socket=require(_0xd22c('0xc'))(new Redis(config[_0xd22c('0x9')]));require(_0xd22c('0xd'))['register'](socket);function respondWithRpcPromise(_0x45c5f5,_0x26a526,_0x1e661e){return new BPromise(function(_0x142fd3,_0x287c6e){return client['request'](_0x45c5f5,_0x1e661e)[_0xd22c('0xe')](function(_0x20c996){logger['info'](_0xd22c('0xf'),_0x26a526,_0xd22c('0x10'));logger[_0xd22c('0x11')](_0xd22c('0x12'),_0x26a526,_0xd22c('0x10'),JSON[_0xd22c('0x13')](_0x20c996));if(_0x20c996['error']){if(_0x20c996[_0xd22c('0x14')][_0xd22c('0x15')]===0x1f4){logger['error'](_0xd22c('0xf'),_0x26a526,_0x20c996[_0xd22c('0x14')][_0xd22c('0x16')]);return _0x287c6e(_0x20c996[_0xd22c('0x14')][_0xd22c('0x16')]);}logger['error'](_0xd22c('0xf'),_0x26a526,_0x20c996[_0xd22c('0x14')][_0xd22c('0x16')]);return _0x142fd3(_0x20c996[_0xd22c('0x14')][_0xd22c('0x16')]);}else{logger[_0xd22c('0x17')]('SmsAccount,\x20%s,\x20%s',_0x26a526,_0xd22c('0x10'));_0x142fd3(_0x20c996[_0xd22c('0x18')][_0xd22c('0x16')]);}})[_0xd22c('0x19')](function(_0xbdedbf){logger[_0xd22c('0x14')](_0xd22c('0xf'),_0x26a526,_0xbdedbf);_0x287c6e(_0xbdedbf);});});}exports[_0xd22c('0x1a')]=function(_0x2178fc){var _0x182d23=this;return new Promise(function(_0x1374a8,_0x2ea988){return db[_0xd22c('0x1b')]['find']({'raw':_0x2178fc[_0xd22c('0x1c')]?_0x2178fc[_0xd22c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2178fc[_0xd22c('0x1c')]?_0x2178fc['options'][_0xd22c('0x1d')]||null:null,'attributes':_0x2178fc[_0xd22c('0x1c')]?_0x2178fc[_0xd22c('0x1c')][_0xd22c('0x1e')]||null:null,'include':_0x2178fc['options']?_0x2178fc['options'][_0xd22c('0x1f')]?_['map'](_0x2178fc[_0xd22c('0x1c')][_0xd22c('0x1f')],function(_0x336325){return{'model':db[_0x336325[_0xd22c('0x20')]],'as':_0x336325['as'],'attributes':_0x336325[_0xd22c('0x1e')],'include':_0x336325[_0xd22c('0x1f')]?_[_0xd22c('0x21')](_0x336325['include'],function(_0x1dc2c7){return{'model':db[_0x1dc2c7[_0xd22c('0x20')]],'as':_0x1dc2c7['as'],'attributes':_0x1dc2c7[_0xd22c('0x1e')],'include':_0x1dc2c7[_0xd22c('0x1f')]?_[_0xd22c('0x21')](_0x1dc2c7['include'],function(_0x2f5202){return{'model':db[_0x2f5202[_0xd22c('0x20')]],'as':_0x2f5202['as'],'attributes':_0x2f5202['attributes']};}):[]};}):[]};}):[]:[]})[_0xd22c('0xe')](function(_0xd103bb){logger[_0xd22c('0x17')](_0xd22c('0x1a'),_0x2178fc);logger['debug']('ShowSmsAccount',_0x2178fc,JSON[_0xd22c('0x13')](_0xd103bb));_0x1374a8(_0xd103bb);})[_0xd22c('0x19')](function(_0x849162){logger[_0xd22c('0x14')](_0xd22c('0x1a'),_0x849162[_0xd22c('0x16')],_0x2178fc);_0x2ea988(_0x182d23[_0xd22c('0x14')](0x1f4,_0x849162[_0xd22c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7e4f541..e31cb9b 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 _0xb8d5=['length','smsAccount:','remove','update','emit','removeListener','register'];(function(_0x4f364e,_0x578486){var _0xbc70ac=function(_0x1b2d38){while(--_0x1b2d38){_0x4f364e['push'](_0x4f364e['shift']());}};_0xbc70ac(++_0x578486);}(_0xb8d5,0x12f));var _0x5b8d=function(_0xfb6e10,_0x3c3c4c){_0xfb6e10=_0xfb6e10-0x0;var _0x5cf224=_0xb8d5[_0xfb6e10];return _0x5cf224;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save',_0x5b8d('0x0'),_0x5b8d('0x1')];function createListener(_0x2aa1d5,_0x3d0d9d){return function(_0x32fe75){_0x3d0d9d[_0x5b8d('0x2')](_0x2aa1d5,_0x32fe75);};}function removeListener(_0xc982a4,_0x3635cd){return function(){SmsAccountEvents[_0x5b8d('0x3')](_0xc982a4,_0x3635cd);};}exports[_0x5b8d('0x4')]=function(_0x4f92b9){for(var _0x47ee5e=0x0,_0x3b59a7=events[_0x5b8d('0x5')];_0x47ee5e<_0x3b59a7;_0x47ee5e++){var _0xf7598a=events[_0x47ee5e];var _0xaf24bd=createListener(_0x5b8d('0x6')+_0xf7598a,_0x4f92b9);SmsAccountEvents['on'](_0xf7598a,_0xaf24bd);}}; \ No newline at end of file +var _0xa51b=['remove','emit','length','save'];(function(_0x46c9d9,_0x2737da){var _0x26c27a=function(_0x2d3a9b){while(--_0x2d3a9b){_0x46c9d9['push'](_0x46c9d9['shift']());}};_0x26c27a(++_0x2737da);}(_0xa51b,0x1b3));var _0xba51=function(_0x172ffc,_0x54d3d4){_0x172ffc=_0x172ffc-0x0;var _0x2eb5cb=_0xa51b[_0x172ffc];return _0x2eb5cb;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0xba51('0x0'),_0xba51('0x1'),'update'];function createListener(_0x1253e6,_0x995373){return function(_0x31ce1f){_0x995373[_0xba51('0x2')](_0x1253e6,_0x31ce1f);};}function removeListener(_0x2d521d,_0x1d382a){return function(){SmsAccountEvents['removeListener'](_0x2d521d,_0x1d382a);};}exports['register']=function(_0x5ecf27){for(var _0x1d664c=0x0,_0x491fdd=events[_0xba51('0x3')];_0x1d664c<_0x491fdd;_0x1d664c++){var _0xa91d16=events[_0x1d664c];var _0x31633c=createListener('smsAccount:'+_0xa91d16,_0x5ecf27);SmsAccountEvents['on'](_0xa91d16,_0x31633c);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index eeb80a4..f8a418e 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 _0xe3b6=['show','post','create','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xe3b6,0x16e));var _0x6e3b=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xe3b6[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x6e3b('0x0'));var util=require(_0x6e3b('0x1'));var path=require('path');var timeout=require(_0x6e3b('0x2'));var express=require('express');var router=express[_0x6e3b('0x3')]();var auth=require(_0x6e3b('0x4'));var interaction=require(_0x6e3b('0x5'));var config=require(_0x6e3b('0x6'));var controller=require(_0x6e3b('0x7'));router[_0x6e3b('0x8')]('/',auth[_0x6e3b('0x9')](),controller[_0x6e3b('0xa')]);router['get'](_0x6e3b('0xb'),auth[_0x6e3b('0x9')](),controller[_0x6e3b('0xc')]);router[_0x6e3b('0xd')]('/',auth['isAuthenticated'](),controller[_0x6e3b('0xe')]);router['put'](_0x6e3b('0xb'),auth[_0x6e3b('0x9')](),controller[_0x6e3b('0xf')]);router[_0x6e3b('0x10')](_0x6e3b('0xb'),auth[_0x6e3b('0x9')](),controller[_0x6e3b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x41f6=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x5d76ad,_0x26158d){var _0x4f7937=function(_0x1a4e92){while(--_0x1a4e92){_0x5d76ad['push'](_0x5d76ad['shift']());}};_0x4f7937(++_0x26158d);}(_0x41f6,0x15c));var _0x641f=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x41f6[_0x264545];return _0x114d10;};'use strict';var multer=require(_0x641f('0x0'));var util=require(_0x641f('0x1'));var path=require('path');var timeout=require(_0x641f('0x2'));var express=require(_0x641f('0x3'));var router=express['Router']();var auth=require(_0x641f('0x4'));var interaction=require(_0x641f('0x5'));var config=require(_0x641f('0x6'));var controller=require('./smsApplication.controller');router['get']('/',auth[_0x641f('0x7')](),controller[_0x641f('0x8')]);router[_0x641f('0x9')](_0x641f('0xa'),auth[_0x641f('0x7')](),controller[_0x641f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x641f('0xc')]);router[_0x641f('0xd')](_0x641f('0xa'),auth[_0x641f('0x7')](),controller[_0x641f('0xe')]);router[_0x641f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x641f('0x10')]);module[_0x641f('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 1981c42..59ddd2c 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 _0xdc7b=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0xdc7b,0x153));var _0xbdc7=function(_0x33bdbc,_0x4f10bf){_0x33bdbc=_0x33bdbc-0x0;var _0x2926fa=_0xdc7b[_0x33bdbc];return _0x2926fa;};'use strict';var Sequelize=require(_0xbdc7('0x0'));module[_0xbdc7('0x1')]={'priority':{'type':Sequelize[_0xbdc7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbdc7('0x3')],'allowNull':![],'defaultValue':_0xbdc7('0x4')},'appdata':{'type':Sequelize[_0xbdc7('0x5')]()},'description':{'type':Sequelize[_0xbdc7('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbdc7('0x6')}}; \ No newline at end of file +var _0x11d3=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x11d3,0x1ac));var _0x311d=function(_0x1ce1e2,_0x296780){_0x1ce1e2=_0x1ce1e2-0x0;var _0x33e818=_0x11d3[_0x1ce1e2];return _0x33e818;};'use strict';var Sequelize=require(_0x311d('0x0'));module[_0x311d('0x1')]={'priority':{'type':Sequelize[_0x311d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x311d('0x3')],'allowNull':![],'defaultValue':_0x311d('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x311d('0x3')],'defaultValue':_0x311d('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9bb9cb3..0ea6c94 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 _0xf89c=['papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','reject','update','then','destroy','stack','name','index','SmsApplication','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','map','type','key','VIRTUAL','field','options','count','include','rows','catch','show','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x41e2af,_0x3662f8){var _0x41df19=function(_0x3b307e){while(--_0x3b307e){_0x41e2af['push'](_0x41e2af['shift']());}};_0x41df19(++_0x3662f8);}(_0xf89c,0x7d));var _0xcf89=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf89c[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcf89('0x0'));var rimraf=require(_0xcf89('0x1'));var zipdir=require(_0xcf89('0x2'));var jsonpatch=require(_0xcf89('0x3'));var rp=require('request-promise');var moment=require(_0xcf89('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcf89('0x5'));var path=require(_0xcf89('0x6'));var sox=require('sox');var csv=require(_0xcf89('0x7'));var ejs=require(_0xcf89('0x8'));var fs=require('fs');var _=require(_0xcf89('0x9'));var squel=require(_0xcf89('0xa'));var crypto=require(_0xcf89('0xb'));var jsforce=require(_0xcf89('0xc'));var deskjs=require(_0xcf89('0xd'));var toCsv=require(_0xcf89('0x7'));var querystring=require(_0xcf89('0xe'));var Papa=require(_0xcf89('0xf'));var authService=require(_0xcf89('0x10'));var hardwareService=require(_0xcf89('0x11'));var Redis=require(_0xcf89('0x12'));var qs=require(_0xcf89('0x13'));var logger=require(_0xcf89('0x14'))(_0xcf89('0x15'));var utils=require('../../config/utils');var config=require(_0xcf89('0x16'));var db=require(_0xcf89('0x17'))['db'];function respondWithStatusCode(_0x4257c7,_0x3fcb39){_0x3fcb39=_0x3fcb39||0xcc;return function(_0x5216c8){if(_0x5216c8){return _0x4257c7[_0xcf89('0x18')](_0x3fcb39);}return _0x4257c7['status'](_0x3fcb39)[_0xcf89('0x19')]();};}function respondWithResult(_0x1d10b6,_0x41922b){_0x41922b=_0x41922b||0xc8;return function(_0x4c50df){if(_0x4c50df){return _0x1d10b6[_0xcf89('0x1a')](_0x41922b)[_0xcf89('0x1b')](_0x4c50df);}};}function respondWithFilteredResult(_0x15aa11,_0x56acb6){return function(_0x522f4c){if(_0x522f4c){var _0x2bf1b5=_0x522f4c['count'],_0x5a6ace=_0x56acb6[_0xcf89('0x1c')],_0x46b186=_0x56acb6['offset']+_0x56acb6[_0xcf89('0x1d')],_0x1a9053;if(_0x46b186>=_0x2bf1b5){_0x46b186=_0x2bf1b5;_0x1a9053=0xc8;}else{_0x1a9053=0xce;}_0x15aa11[_0xcf89('0x1a')](_0x1a9053);return _0x15aa11[_0xcf89('0x1e')]('Content-Range',_0x5a6ace+'-'+_0x46b186+'/'+_0x2bf1b5)[_0xcf89('0x1b')](_0x522f4c);}return null;};}function patchUpdates(_0x46cb07){return function(_0x2f33b2){try{jsonpatch['apply'](_0x2f33b2,_0x46cb07,!![]);}catch(_0x974a23){return BPromise[_0xcf89('0x1f')](_0x974a23);}return _0x2f33b2['save']();};}function saveUpdates(_0x113269,_0x2bdeec){return function(_0x3fc0ea){if(_0x3fc0ea){return _0x3fc0ea[_0xcf89('0x20')](_0x113269)[_0xcf89('0x21')](function(_0xb03b84){return _0xb03b84;});}return null;};}function removeEntity(_0x545641,_0xab3ad3){return function(_0x5025ac){if(_0x5025ac){return _0x5025ac[_0xcf89('0x22')]()[_0xcf89('0x21')](function(){_0x545641[_0xcf89('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x294c22,_0x2e4d3f){return function(_0x2dd2cf){if(!_0x2dd2cf){_0x294c22['sendStatus'](0x194);}return _0x2dd2cf;};}function handleError(_0x649542,_0x5bcfad){_0x5bcfad=_0x5bcfad||0x1f4;return function(_0x41c12d){logger['error'](_0x41c12d[_0xcf89('0x23')]);if(_0x41c12d['name']){delete _0x41c12d[_0xcf89('0x24')];}_0x649542['status'](_0x5bcfad)['send'](_0x41c12d);};}exports[_0xcf89('0x25')]=function(_0x46ec45,_0x6f258d){var _0x33298d={},_0x21b6a5={},_0x4d2983={'count':0x0,'rows':[]};var _0x87fb12=db[_0xcf89('0x26')][_0xcf89('0x27')];_0x21b6a5[_0xcf89('0x28')]=_[_0xcf89('0x29')](_0x87fb12);_0x21b6a5['query']=_[_0xcf89('0x29')](_0x46ec45['query']);_0x21b6a5[_0xcf89('0x2a')]=_[_0xcf89('0x2b')](_0x21b6a5[_0xcf89('0x28')],_0x21b6a5[_0xcf89('0x2c')]);_0x33298d[_0xcf89('0x2d')]=_[_0xcf89('0x2b')](_0x21b6a5[_0xcf89('0x28')],qs[_0xcf89('0x2e')](_0x46ec45[_0xcf89('0x2c')][_0xcf89('0x2e')]));_0x33298d[_0xcf89('0x2d')]=_0x33298d['attributes'][_0xcf89('0x2f')]?_0x33298d[_0xcf89('0x2d')]:_0x21b6a5['model'];if(!_0x46ec45[_0xcf89('0x2c')][_0xcf89('0x30')](_0xcf89('0x31'))){_0x33298d['limit']=qs[_0xcf89('0x1d')](_0x46ec45['query'][_0xcf89('0x1d')]);_0x33298d[_0xcf89('0x1c')]=qs[_0xcf89('0x1c')](_0x46ec45['query']['offset']);}_0x33298d['order']=qs[_0xcf89('0x32')](_0x46ec45[_0xcf89('0x2c')][_0xcf89('0x32')]);_0x33298d['where']=qs['filters'](_['pick'](_0x46ec45['query'],_0x21b6a5[_0xcf89('0x2a')]));if(_0x46ec45[_0xcf89('0x2c')][_0xcf89('0x33')]){_0x33298d[_0xcf89('0x34')]=_[_0xcf89('0x35')](_0x33298d[_0xcf89('0x34')],{'$or':_[_0xcf89('0x36')](_0x87fb12,function(_0x4c4b0c){if(_0x4c4b0c[_0xcf89('0x37')][_0xcf89('0x38')]!==_0xcf89('0x39')){var _0x5148ac={};_0x5148ac[_0x4c4b0c[_0xcf89('0x3a')]]={'$like':'%'+_0x46ec45['query'][_0xcf89('0x33')]+'%'};return _0x5148ac;}})});}_0x33298d=_[_0xcf89('0x35')]({},_0x33298d,_0x46ec45[_0xcf89('0x3b')]);var _0x37ca18={'where':_0x33298d['where']};return db[_0xcf89('0x26')][_0xcf89('0x3c')](_0x37ca18)[_0xcf89('0x21')](function(_0x11abdf){_0x4d2983[_0xcf89('0x3c')]=_0x11abdf;if(_0x46ec45[_0xcf89('0x2c')]['includeAll']){_0x33298d[_0xcf89('0x3d')]=[{'all':!![]}];}return db[_0xcf89('0x26')]['findAll'](_0x33298d);})['then'](function(_0x8580e){_0x4d2983[_0xcf89('0x3e')]=_0x8580e;return _0x4d2983;})[_0xcf89('0x21')](respondWithFilteredResult(_0x6f258d,_0x33298d))[_0xcf89('0x3f')](handleError(_0x6f258d,null));};exports[_0xcf89('0x40')]=function(_0x1b84b1,_0x13c358){var _0x561e51={'raw':!![],'where':{'id':_0x1b84b1['params']['id']}},_0x59e039={};_0x59e039['model']=_['keys'](db[_0xcf89('0x26')][_0xcf89('0x27')]);_0x59e039['query']=_['keys'](_0x1b84b1['query']);_0x59e039['filters']=_[_0xcf89('0x2b')](_0x59e039[_0xcf89('0x28')],_0x59e039[_0xcf89('0x2c')]);_0x561e51[_0xcf89('0x2d')]=_['intersection'](_0x59e039['model'],qs[_0xcf89('0x2e')](_0x1b84b1[_0xcf89('0x2c')][_0xcf89('0x2e')]));_0x561e51['attributes']=_0x561e51[_0xcf89('0x2d')][_0xcf89('0x2f')]?_0x561e51[_0xcf89('0x2d')]:_0x59e039[_0xcf89('0x28')];if(_0x1b84b1[_0xcf89('0x2c')][_0xcf89('0x41')]){_0x561e51[_0xcf89('0x3d')]=[{'all':!![]}];}_0x561e51=_['merge']({},_0x561e51,_0x1b84b1['options']);return db['SmsApplication'][_0xcf89('0x42')](_0x561e51)[_0xcf89('0x21')](handleEntityNotFound(_0x13c358,null))[_0xcf89('0x21')](respondWithResult(_0x13c358,null))[_0xcf89('0x3f')](handleError(_0x13c358,null));};exports[_0xcf89('0x43')]=function(_0x2a3f53,_0x3adc50){return db[_0xcf89('0x26')][_0xcf89('0x43')](_0x2a3f53[_0xcf89('0x44')],{})['then'](respondWithResult(_0x3adc50,0xc9))['catch'](handleError(_0x3adc50,null));};exports['update']=function(_0x5cf168,_0x46b986){if(_0x5cf168['body']['id']){delete _0x5cf168[_0xcf89('0x44')]['id'];}return db['SmsApplication'][_0xcf89('0x42')]({'where':{'id':_0x5cf168['params']['id']}})[_0xcf89('0x21')](handleEntityNotFound(_0x46b986,null))[_0xcf89('0x21')](saveUpdates(_0x5cf168[_0xcf89('0x44')],null))[_0xcf89('0x21')](respondWithResult(_0x46b986,null))[_0xcf89('0x3f')](handleError(_0x46b986,null));};exports[_0xcf89('0x22')]=function(_0x4d1aec,_0x1c76d2){return db[_0xcf89('0x26')]['find']({'where':{'id':_0x4d1aec[_0xcf89('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c76d2,null))[_0xcf89('0x21')](removeEntity(_0x1c76d2,null))[_0xcf89('0x3f')](handleError(_0x1c76d2,null));}; \ No newline at end of file +var _0x205a=['json','reject','save','update','then','destroy','end','error','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','SmsApplication','includeAll','include','findAll','catch','show','length','create','body','find','params','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x205a,0x6f));var _0xa205=function(_0x4dd519,_0x477885){_0x4dd519=_0x4dd519-0x0;var _0x1cf139=_0x205a[_0x4dd519];return _0x1cf139;};'use strict';var pdf=require(_0xa205('0x0'));var emlformat=require(_0xa205('0x1'));var rimraf=require(_0xa205('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa205('0x3'));var moment=require('moment');var BPromise=require(_0xa205('0x4'));var Mustache=require(_0xa205('0x5'));var util=require(_0xa205('0x6'));var path=require(_0xa205('0x7'));var sox=require(_0xa205('0x8'));var csv=require(_0xa205('0x9'));var ejs=require(_0xa205('0xa'));var fs=require('fs');var _=require(_0xa205('0xb'));var squel=require(_0xa205('0xc'));var crypto=require(_0xa205('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa205('0xe'));var toCsv=require(_0xa205('0x9'));var querystring=require(_0xa205('0xf'));var Papa=require('papaparse');var authService=require(_0xa205('0x10'));var hardwareService=require(_0xa205('0x11'));var Redis=require(_0xa205('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xa205('0x13'))('api');var utils=require(_0xa205('0x14'));var config=require(_0xa205('0x15'));var db=require(_0xa205('0x16'))['db'];function respondWithStatusCode(_0x325def,_0x4bab7b){_0x4bab7b=_0x4bab7b||0xcc;return function(_0x2a501c){if(_0x2a501c){return _0x325def[_0xa205('0x17')](_0x4bab7b);}return _0x325def['status'](_0x4bab7b)['end']();};}function respondWithResult(_0x1ef8f3,_0x1ffe4a){_0x1ffe4a=_0x1ffe4a||0xc8;return function(_0x410e54){if(_0x410e54){return _0x1ef8f3[_0xa205('0x18')](_0x1ffe4a)['json'](_0x410e54);}};}function respondWithFilteredResult(_0x5975e3,_0x318ca4){return function(_0x2b12d1){if(_0x2b12d1){var _0x3a593c=_0x2b12d1[_0xa205('0x19')],_0x20d2ca=_0x318ca4['offset'],_0x325fe0=_0x318ca4[_0xa205('0x1a')]+_0x318ca4[_0xa205('0x1b')],_0x50862a;if(_0x325fe0>=_0x3a593c){_0x325fe0=_0x3a593c;_0x50862a=0xc8;}else{_0x50862a=0xce;}_0x5975e3[_0xa205('0x18')](_0x50862a);return _0x5975e3[_0xa205('0x1c')]('Content-Range',_0x20d2ca+'-'+_0x325fe0+'/'+_0x3a593c)[_0xa205('0x1d')](_0x2b12d1);}return null;};}function patchUpdates(_0x3fcafd){return function(_0x34351b){try{jsonpatch['apply'](_0x34351b,_0x3fcafd,!![]);}catch(_0x5518ef){return BPromise[_0xa205('0x1e')](_0x5518ef);}return _0x34351b[_0xa205('0x1f')]();};}function saveUpdates(_0x4f51d8,_0x4796e0){return function(_0x5b6905){if(_0x5b6905){return _0x5b6905[_0xa205('0x20')](_0x4f51d8)[_0xa205('0x21')](function(_0x1ead24){return _0x1ead24;});}return null;};}function removeEntity(_0x3c9d0f,_0xefe726){return function(_0x70cd9){if(_0x70cd9){return _0x70cd9[_0xa205('0x22')]()[_0xa205('0x21')](function(){_0x3c9d0f[_0xa205('0x18')](0xcc)[_0xa205('0x23')]();});}};}function handleEntityNotFound(_0x153f2a,_0x3a802b){return function(_0xb7d644){if(!_0xb7d644){_0x153f2a[_0xa205('0x17')](0x194);}return _0xb7d644;};}function handleError(_0x4386d9,_0x1159a5){_0x1159a5=_0x1159a5||0x1f4;return function(_0x34f6f){logger[_0xa205('0x24')](_0x34f6f['stack']);if(_0x34f6f[_0xa205('0x25')]){delete _0x34f6f[_0xa205('0x25')];}_0x4386d9[_0xa205('0x18')](_0x1159a5)['send'](_0x34f6f);};}exports['index']=function(_0x196833,_0x30b79b){var _0x5cfb5d={},_0x3d85b4={},_0x46a95b={'count':0x0,'rows':[]};var _0x71231d=db['SmsApplication'][_0xa205('0x26')];_0x3d85b4[_0xa205('0x27')]=_[_0xa205('0x28')](_0x71231d);_0x3d85b4[_0xa205('0x29')]=_[_0xa205('0x28')](_0x196833[_0xa205('0x29')]);_0x3d85b4[_0xa205('0x2a')]=_[_0xa205('0x2b')](_0x3d85b4[_0xa205('0x27')],_0x3d85b4[_0xa205('0x29')]);_0x5cfb5d['attributes']=_['intersection'](_0x3d85b4[_0xa205('0x27')],qs[_0xa205('0x2c')](_0x196833[_0xa205('0x29')][_0xa205('0x2c')]));_0x5cfb5d[_0xa205('0x2d')]=_0x5cfb5d['attributes']['length']?_0x5cfb5d[_0xa205('0x2d')]:_0x3d85b4['model'];if(!_0x196833[_0xa205('0x29')][_0xa205('0x2e')](_0xa205('0x2f'))){_0x5cfb5d[_0xa205('0x1b')]=qs['limit'](_0x196833['query'][_0xa205('0x1b')]);_0x5cfb5d[_0xa205('0x1a')]=qs[_0xa205('0x1a')](_0x196833[_0xa205('0x29')][_0xa205('0x1a')]);}_0x5cfb5d[_0xa205('0x30')]=qs[_0xa205('0x31')](_0x196833[_0xa205('0x29')][_0xa205('0x31')]);_0x5cfb5d[_0xa205('0x32')]=qs[_0xa205('0x2a')](_[_0xa205('0x33')](_0x196833[_0xa205('0x29')],_0x3d85b4[_0xa205('0x2a')]));if(_0x196833[_0xa205('0x29')][_0xa205('0x34')]){_0x5cfb5d[_0xa205('0x32')]=_[_0xa205('0x35')](_0x5cfb5d[_0xa205('0x32')],{'$or':_[_0xa205('0x36')](_0x71231d,function(_0x7cee5e){if(_0x7cee5e[_0xa205('0x37')][_0xa205('0x38')]!==_0xa205('0x39')){var _0x5a74d7={};_0x5a74d7[_0x7cee5e[_0xa205('0x3a')]]={'$like':'%'+_0x196833['query'][_0xa205('0x34')]+'%'};return _0x5a74d7;}})});}_0x5cfb5d=_[_0xa205('0x35')]({},_0x5cfb5d,_0x196833['options']);var _0x91892d={'where':_0x5cfb5d[_0xa205('0x32')]};return db[_0xa205('0x3b')][_0xa205('0x19')](_0x91892d)['then'](function(_0x3076ae){_0x46a95b['count']=_0x3076ae;if(_0x196833[_0xa205('0x29')][_0xa205('0x3c')]){_0x5cfb5d[_0xa205('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0xa205('0x3e')](_0x5cfb5d);})[_0xa205('0x21')](function(_0x32e431){_0x46a95b['rows']=_0x32e431;return _0x46a95b;})[_0xa205('0x21')](respondWithFilteredResult(_0x30b79b,_0x5cfb5d))[_0xa205('0x3f')](handleError(_0x30b79b,null));};exports[_0xa205('0x40')]=function(_0x25bc65,_0x25ebf0){var _0x45c8b4={'raw':!![],'where':{'id':_0x25bc65['params']['id']}},_0x3dd136={};_0x3dd136[_0xa205('0x27')]=_['keys'](db[_0xa205('0x3b')][_0xa205('0x26')]);_0x3dd136[_0xa205('0x29')]=_[_0xa205('0x28')](_0x25bc65['query']);_0x3dd136[_0xa205('0x2a')]=_[_0xa205('0x2b')](_0x3dd136[_0xa205('0x27')],_0x3dd136[_0xa205('0x29')]);_0x45c8b4['attributes']=_[_0xa205('0x2b')](_0x3dd136[_0xa205('0x27')],qs[_0xa205('0x2c')](_0x25bc65[_0xa205('0x29')][_0xa205('0x2c')]));_0x45c8b4[_0xa205('0x2d')]=_0x45c8b4['attributes'][_0xa205('0x41')]?_0x45c8b4[_0xa205('0x2d')]:_0x3dd136[_0xa205('0x27')];if(_0x25bc65[_0xa205('0x29')][_0xa205('0x3c')]){_0x45c8b4[_0xa205('0x3d')]=[{'all':!![]}];}_0x45c8b4=_[_0xa205('0x35')]({},_0x45c8b4,_0x25bc65['options']);return db['SmsApplication']['find'](_0x45c8b4)['then'](handleEntityNotFound(_0x25ebf0,null))[_0xa205('0x21')](respondWithResult(_0x25ebf0,null))[_0xa205('0x3f')](handleError(_0x25ebf0,null));};exports[_0xa205('0x42')]=function(_0x353970,_0x2b38cf){return db['SmsApplication']['create'](_0x353970[_0xa205('0x43')],{})[_0xa205('0x21')](respondWithResult(_0x2b38cf,0xc9))[_0xa205('0x3f')](handleError(_0x2b38cf,null));};exports[_0xa205('0x20')]=function(_0x30e3d5,_0x511e5b){if(_0x30e3d5[_0xa205('0x43')]['id']){delete _0x30e3d5[_0xa205('0x43')]['id'];}return db['SmsApplication'][_0xa205('0x44')]({'where':{'id':_0x30e3d5[_0xa205('0x45')]['id']}})['then'](handleEntityNotFound(_0x511e5b,null))[_0xa205('0x21')](saveUpdates(_0x30e3d5['body'],null))[_0xa205('0x21')](respondWithResult(_0x511e5b,null))['catch'](handleError(_0x511e5b,null));};exports[_0xa205('0x22')]=function(_0x44462a,_0x3072b6){return db[_0xa205('0x3b')][_0xa205('0x44')]({'where':{'id':_0x44462a[_0xa205('0x45')]['id']}})['then'](handleEntityNotFound(_0x3072b6,null))[_0xa205('0x21')](removeEntity(_0x3072b6,null))[_0xa205('0x3f')](handleError(_0x3072b6,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 817f8c2..ec5973f 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 _0xb02d=['SmsApplication','sms_applications','lodash','../../config/logger','api','moment','bluebird','./smsApplication.attributes','exports','define'];(function(_0x5ac7d7,_0x109040){var _0x23955f=function(_0x52a2ac){while(--_0x52a2ac){_0x5ac7d7['push'](_0x5ac7d7['shift']());}};_0x23955f(++_0x109040);}(_0xb02d,0x98));var _0xdb02=function(_0xb2a530,_0x2b320e){_0xb2a530=_0xb2a530-0x0;var _0x104c8a=_0xb02d[_0xb2a530];return _0x104c8a;};'use strict';var _=require(_0xdb02('0x0'));var util=require('util');var logger=require(_0xdb02('0x1'))(_0xdb02('0x2'));var moment=require(_0xdb02('0x3'));var BPromise=require(_0xdb02('0x4'));var rp=require('request-promise');var attributes=require(_0xdb02('0x5'));module[_0xdb02('0x6')]=function(_0x465be7,_0x5ddbc5){return _0x465be7[_0xdb02('0x7')](_0xdb02('0x8'),attributes,{'tableName':_0xdb02('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ace=['../../config/logger','moment','bluebird','request-promise','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util'];(function(_0x4ee897,_0x4ab877){var _0x7c5813=function(_0x592160){while(--_0x592160){_0x4ee897['push'](_0x4ee897['shift']());}};_0x7c5813(++_0x4ab877);}(_0x9ace,0x1b6));var _0xe9ac=function(_0x2ccd33,_0x575657){_0x2ccd33=_0x2ccd33-0x0;var _0x13430e=_0x9ace[_0x2ccd33];return _0x13430e;};'use strict';var _=require(_0xe9ac('0x0'));var util=require(_0xe9ac('0x1'));var logger=require(_0xe9ac('0x2'))('api');var moment=require(_0xe9ac('0x3'));var BPromise=require(_0xe9ac('0x4'));var rp=require(_0xe9ac('0x5'));var attributes=require(_0xe9ac('0x6'));module[_0xe9ac('0x7')]=function(_0x219c2a,_0x330e44){return _0x219c2a[_0xe9ac('0x8')](_0xe9ac('0x9'),attributes,{'tableName':_0xe9ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index bf58a6e..6397ec7 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 _0xe09f=['code','message','SmsApplication,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','stringify','error'];(function(_0x39681e,_0x3109ba){var _0x79eb6e=function(_0x1e6522){while(--_0x1e6522){_0x39681e['push'](_0x39681e['shift']());}};_0x79eb6e(++_0x3109ba);}(_0xe09f,0x191));var _0xfe09=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe09f[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xfe09('0x0'));var util=require(_0xfe09('0x1'));var moment=require('moment');var BPromise=require(_0xfe09('0x2'));var rs=require(_0xfe09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfe09('0x4'));var config=require(_0xfe09('0x5'));var jayson=require(_0xfe09('0x6'));var client=jayson[_0xfe09('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53f979,_0x18d33f,_0x111508){return new BPromise(function(_0x5ecb12,_0x1da9cc){return client['request'](_0x53f979,_0x111508)[_0xfe09('0x8')](function(_0x1c0759){logger[_0xfe09('0x9')]('SmsApplication,\x20%s,\x20%s',_0x18d33f,_0xfe09('0xa'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x18d33f,_0xfe09('0xa'),JSON[_0xfe09('0xb')](_0x1c0759));if(_0x1c0759[_0xfe09('0xc')]){if(_0x1c0759[_0xfe09('0xc')][_0xfe09('0xd')]===0x1f4){logger[_0xfe09('0xc')]('SmsApplication,\x20%s,\x20%s',_0x18d33f,_0x1c0759[_0xfe09('0xc')][_0xfe09('0xe')]);return _0x1da9cc(_0x1c0759[_0xfe09('0xc')]['message']);}logger[_0xfe09('0xc')]('SmsApplication,\x20%s,\x20%s',_0x18d33f,_0x1c0759[_0xfe09('0xc')][_0xfe09('0xe')]);return _0x5ecb12(_0x1c0759[_0xfe09('0xc')][_0xfe09('0xe')]);}else{logger[_0xfe09('0x9')](_0xfe09('0xf'),_0x18d33f,'request\x20sent');_0x5ecb12(_0x1c0759[_0xfe09('0x10')][_0xfe09('0xe')]);}})[_0xfe09('0x11')](function(_0x286922){logger[_0xfe09('0xc')](_0xfe09('0xf'),_0x18d33f,_0x286922);_0x1da9cc(_0x286922);});});} \ No newline at end of file +var _0x6a73=['SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SmsApplication,\x20%s,\x20%s'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0x6a73,0x184));var _0x36a7=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x6a73[_0xfbdff6];return _0x4cb9be;};'use strict';var _=require('lodash');var util=require(_0x36a7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x36a7('0x1'));var fs=require('fs');var Redis=require(_0x36a7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x36a7('0x3'));var logger=require(_0x36a7('0x4'))(_0x36a7('0x5'));var config=require(_0x36a7('0x6'));var jayson=require(_0x36a7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7a521f,_0x5299d3,_0x33a23e){return new BPromise(function(_0xff7a42,_0x32249f){return client[_0x36a7('0x8')](_0x7a521f,_0x33a23e)['then'](function(_0x380e6d){logger[_0x36a7('0x9')](_0x36a7('0xa'),_0x5299d3,'request\x20sent');logger['debug'](_0x36a7('0xb'),_0x5299d3,_0x36a7('0xc'),JSON[_0x36a7('0xd')](_0x380e6d));if(_0x380e6d[_0x36a7('0xe')]){if(_0x380e6d[_0x36a7('0xe')][_0x36a7('0xf')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5299d3,_0x380e6d[_0x36a7('0xe')][_0x36a7('0x10')]);return _0x32249f(_0x380e6d['error'][_0x36a7('0x10')]);}logger['error'](_0x36a7('0xa'),_0x5299d3,_0x380e6d[_0x36a7('0xe')][_0x36a7('0x10')]);return _0xff7a42(_0x380e6d[_0x36a7('0xe')][_0x36a7('0x10')]);}else{logger[_0x36a7('0x9')]('SmsApplication,\x20%s,\x20%s',_0x5299d3,_0x36a7('0xc'));_0xff7a42(_0x380e6d[_0x36a7('0x11')][_0x36a7('0x10')]);}})[_0x36a7('0x12')](function(_0x5c5388){logger[_0x36a7('0xe')](_0x36a7('0xa'),_0x5299d3,_0x5c5388);_0x32249f(_0x5c5388);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index e8f45f7..335bfd5 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 _0x8b5e=['sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/messages','download','post','create','addMessage','tracked'];(function(_0x3953a9,_0x41e8f5){var _0x5508aa=function(_0x5934a8){while(--_0x5934a8){_0x3953a9['push'](_0x3953a9['shift']());}};_0x5508aa(++_0x41e8f5);}(_0x8b5e,0x16b));var _0xe8b5=function(_0x144feb,_0x45090b){_0x144feb=_0x144feb-0x0;var _0x2a1f77=_0x8b5e[_0x144feb];return _0x2a1f77;};'use strict';var multer=require(_0xe8b5('0x0'));var util=require(_0xe8b5('0x1'));var path=require(_0xe8b5('0x2'));var timeout=require('connect-timeout');var express=require(_0xe8b5('0x3'));var router=express[_0xe8b5('0x4')]();var auth=require(_0xe8b5('0x5'));var interaction=require(_0xe8b5('0x6'));var config=require('../../config/environment');var controller=require(_0xe8b5('0x7'));router['get']('/',auth[_0xe8b5('0x8')](),controller[_0xe8b5('0x9')]);router['get'](_0xe8b5('0xa'),auth[_0xe8b5('0x8')](),controller[_0xe8b5('0xb')]);router[_0xe8b5('0xc')](_0xe8b5('0xd'),auth[_0xe8b5('0x8')](),controller[_0xe8b5('0xe')]);router[_0xe8b5('0xc')](_0xe8b5('0xf'),auth[_0xe8b5('0x8')](),controller['getMessages']);router['get']('/:id/download',auth[_0xe8b5('0x8')](),controller[_0xe8b5('0x10')]);router[_0xe8b5('0x11')]('/',auth['isAuthenticated'](),controller[_0xe8b5('0x12')]);router[_0xe8b5('0x11')](_0xe8b5('0xf'),auth[_0xe8b5('0x8')](),controller[_0xe8b5('0x13')]);router[_0xe8b5('0x11')]('/:id/tags',auth[_0xe8b5('0x8')](),interaction[_0xe8b5('0x14')](_0xe8b5('0x15'),_0xe8b5('0x16')),controller[_0xe8b5('0x17')]);router[_0xe8b5('0x18')]('/:id',auth[_0xe8b5('0x8')](),interaction['tracked'](_0xe8b5('0x15'),'smsinteraction:update'),controller[_0xe8b5('0x19')]);router[_0xe8b5('0x1a')](_0xe8b5('0xd'),auth[_0xe8b5('0x8')](),interaction[_0xe8b5('0x14')](_0xe8b5('0x15'),_0xe8b5('0x1b')),controller[_0xe8b5('0x1c')]);router[_0xe8b5('0x1a')](_0xe8b5('0x1d'),auth[_0xe8b5('0x8')](),controller[_0xe8b5('0x1e')]);module[_0xe8b5('0x1f')]=router; \ No newline at end of file +var _0x0c73=['describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','sms','put','smsinteraction:update','update','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x0c73,0x17e));var _0x30c7=function(_0x400f42,_0x459457){_0x400f42=_0x400f42-0x0;var _0x3868c5=_0x0c73[_0x400f42];return _0x3868c5;};'use strict';var multer=require(_0x30c7('0x0'));var util=require('util');var path=require(_0x30c7('0x1'));var timeout=require(_0x30c7('0x2'));var express=require('express');var router=express[_0x30c7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x30c7('0x4'));var config=require(_0x30c7('0x5'));var controller=require(_0x30c7('0x6'));router[_0x30c7('0x7')]('/',auth[_0x30c7('0x8')](),controller[_0x30c7('0x9')]);router[_0x30c7('0x7')]('/describe',auth[_0x30c7('0x8')](),controller[_0x30c7('0xa')]);router['get'](_0x30c7('0xb'),auth[_0x30c7('0x8')](),controller[_0x30c7('0xc')]);router[_0x30c7('0x7')](_0x30c7('0xd'),auth[_0x30c7('0x8')](),controller[_0x30c7('0xe')]);router[_0x30c7('0x7')](_0x30c7('0xf'),auth[_0x30c7('0x8')](),controller[_0x30c7('0x10')]);router[_0x30c7('0x11')]('/',auth[_0x30c7('0x8')](),controller[_0x30c7('0x12')]);router[_0x30c7('0x11')](_0x30c7('0xd'),auth[_0x30c7('0x8')](),controller[_0x30c7('0x13')]);router['post']('/:id/tags',auth[_0x30c7('0x8')](),interaction['tracked'](_0x30c7('0x14'),'smsinteraction:addtags'),controller['addTags']);router[_0x30c7('0x15')]('/:id',auth[_0x30c7('0x8')](),interaction['tracked']('sms',_0x30c7('0x16')),controller[_0x30c7('0x17')]);router['delete'](_0x30c7('0xb'),auth[_0x30c7('0x8')](),interaction['tracked'](_0x30c7('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x30c7('0x18')](_0x30c7('0x19'),auth['isAuthenticated'](),controller[_0x30c7('0x1a')]);module[_0x30c7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 7ad38e5..59a2d0d 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 _0xeac7=['sequelize','moment','exports','DATE','STRING','ENUM','out'];(function(_0x40b797,_0xcfaf1f){var _0x53ca4b=function(_0x418758){while(--_0x418758){_0x40b797['push'](_0x40b797['shift']());}};_0x53ca4b(++_0xcfaf1f);}(_0xeac7,0x118));var _0x7eac=function(_0x1eebd6,_0x2a97a6){_0x1eebd6=_0x1eebd6-0x0;var _0x3ecd57=_0xeac7[_0x1eebd6];return _0x3ecd57;};'use strict';var Sequelize=require(_0x7eac('0x0'));var moment=require(_0x7eac('0x1'));module[_0x7eac('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7eac('0x3')]},'disposition':{'type':Sequelize[_0x7eac('0x4')]},'note':{'type':Sequelize[_0x7eac('0x4')]},'phone':{'type':Sequelize[_0x7eac('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7eac('0x5')]('in',_0x7eac('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7eac('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7eac('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7663=['STRING','DATE','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0xa7fe3f,_0x4d5b4c){var _0x213637=function(_0x3c7134){while(--_0x3c7134){_0xa7fe3f['push'](_0xa7fe3f['shift']());}};_0x213637(++_0x4d5b4c);}(_0x7663,0x1c4));var _0x3766=function(_0x92c1d9,_0x21838a){_0x92c1d9=_0x92c1d9-0x0;var _0x4bdcd0=_0x7663[_0x92c1d9];return _0x4bdcd0;};'use strict';var Sequelize=require(_0x3766('0x0'));var moment=require(_0x3766('0x1'));module['exports']={'closed':{'type':Sequelize[_0x3766('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3766('0x3')]},'note':{'type':Sequelize[_0x3766('0x3')]},'phone':{'type':Sequelize[_0x3766('0x3')]},'read1stAt':{'type':Sequelize[_0x3766('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3766('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3766('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3766('0x6')),'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 fa52dbe..3f14d93 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 _0x279d=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','include','push','Tag','Tags','tag','read','direction','createdAt','includeAll','User','Users','fullname','CmContact','Contact','Owner','internal','Account','SmsMessage','color','ThroughTags','findAll','rows','catch','show','create','body','params','describe','addMessage','find','ids','getMessages','findOne','$gte','split','format','setTags','omit','spread','smsInteractionTags:save','removeTags','download','unix','root','server','files','join','attachments','interaction-%s.zip','mkdirSync','

Sms\x20Interaction:\x20#%d

','
','Messages','','%s:\x20%s

','firstName','','toFile','.pdf','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./smsInteraction.socket','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','SmsInteraction','rawAttributes'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x279d,0x1d8));var _0xd279=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x279d[_0x2faddb];return _0x273c05;};'use strict';var pdf=require(_0xd279('0x0'));var emlformat=require(_0xd279('0x1'));var rimraf=require(_0xd279('0x2'));var zipdir=require(_0xd279('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd279('0x4'));var BPromise=require(_0xd279('0x5'));var Mustache=require('mustache');var util=require(_0xd279('0x6'));var path=require(_0xd279('0x7'));var sox=require(_0xd279('0x8'));var csv=require(_0xd279('0x9'));var ejs=require(_0xd279('0xa'));var fs=require('fs');var _=require(_0xd279('0xb'));var squel=require(_0xd279('0xc'));var crypto=require('crypto');var jsforce=require(_0xd279('0xd'));var deskjs=require(_0xd279('0xe'));var toCsv=require(_0xd279('0x9'));var querystring=require(_0xd279('0xf'));var Papa=require(_0xd279('0x10'));var authService=require(_0xd279('0x11'));var hardwareService=require(_0xd279('0x12'));var Redis=require(_0xd279('0x13'));var qs=require(_0xd279('0x14'));var logger=require(_0xd279('0x15'))(_0xd279('0x16'));var utils=require('../../config/utils');var config=require(_0xd279('0x17'));var db=require('../../mysqldb')['db'];config[_0xd279('0x18')]=_[_0xd279('0x19')](config['redis'],{'host':_0xd279('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd279('0x1b'))['register'](socket);function respondWithStatusCode(_0x426d48,_0x5c3b48){_0x5c3b48=_0x5c3b48||0xcc;return function(_0x2bf8e3){if(_0x2bf8e3){return _0x426d48[_0xd279('0x1c')](_0x5c3b48);}return _0x426d48[_0xd279('0x1d')](_0x5c3b48)[_0xd279('0x1e')]();};}function respondWithResult(_0x5c1c0f,_0x55b3c5){_0x55b3c5=_0x55b3c5||0xc8;return function(_0x20db5d){if(_0x20db5d){return _0x5c1c0f[_0xd279('0x1d')](_0x55b3c5)[_0xd279('0x1f')](_0x20db5d);}};}function respondWithFilteredResult(_0x347f8b,_0x540695){return function(_0x5701c0){if(_0x5701c0){var _0x591f5f=_0x5701c0[_0xd279('0x20')],_0x5a52fd=_0x540695['offset'],_0x544e01=_0x540695[_0xd279('0x21')]+_0x540695[_0xd279('0x22')],_0x1394bb;if(_0x544e01>=_0x591f5f){_0x544e01=_0x591f5f;_0x1394bb=0xc8;}else{_0x1394bb=0xce;}_0x347f8b[_0xd279('0x1d')](_0x1394bb);return _0x347f8b[_0xd279('0x23')]('Content-Range',_0x5a52fd+'-'+_0x544e01+'/'+_0x591f5f)[_0xd279('0x1f')](_0x5701c0);}return null;};}function patchUpdates(_0x2be01c){return function(_0x5577fc){try{jsonpatch[_0xd279('0x24')](_0x5577fc,_0x2be01c,!![]);}catch(_0x395762){return BPromise[_0xd279('0x25')](_0x395762);}return _0x5577fc[_0xd279('0x26')]();};}function saveUpdates(_0x533ceb,_0x36fd44){return function(_0x2716f4){if(_0x2716f4){return _0x2716f4[_0xd279('0x27')](_0x533ceb)['then'](function(_0x7683bc){return _0x7683bc;});}return null;};}function removeEntity(_0x1a06e7,_0x3a9e73){return function(_0x307599){if(_0x307599){return _0x307599[_0xd279('0x28')]()[_0xd279('0x29')](function(){_0x1a06e7[_0xd279('0x1d')](0xcc)[_0xd279('0x1e')]();});}};}function handleEntityNotFound(_0x440293,_0x48f1b1){return function(_0x53e0f6){if(!_0x53e0f6){_0x440293[_0xd279('0x1c')](0x194);}return _0x53e0f6;};}function handleError(_0x299c67,_0x563637){_0x563637=_0x563637||0x1f4;return function(_0x46a162){logger[_0xd279('0x2a')](_0x46a162[_0xd279('0x2b')]);if(_0x46a162[_0xd279('0x2c')]){delete _0x46a162['name'];}_0x299c67[_0xd279('0x1d')](_0x563637)[_0xd279('0x2d')](_0x46a162);};}exports['index']=function(_0x43aacd,_0x577102){var _0x159ea4={},_0x2347ed={},_0x3e64f6={'count':0x0,'rows':[]};var _0x47175a=db[_0xd279('0x2e')][_0xd279('0x2f')];_0x2347ed[_0xd279('0x30')]=_[_0xd279('0x31')](_0x47175a);_0x2347ed[_0xd279('0x32')]=_['keys'](_0x43aacd[_0xd279('0x32')]);_0x2347ed[_0xd279('0x33')]=_[_0xd279('0x34')](_0x2347ed[_0xd279('0x30')],_0x2347ed[_0xd279('0x32')]);_0x159ea4[_0xd279('0x35')]=_[_0xd279('0x34')](_0x2347ed[_0xd279('0x30')],qs[_0xd279('0x36')](_0x43aacd['query']['fields']));_0x159ea4[_0xd279('0x35')]=_0x159ea4[_0xd279('0x35')][_0xd279('0x37')]?_0x159ea4[_0xd279('0x35')]:_0x2347ed['model'];if(!_0x43aacd[_0xd279('0x32')][_0xd279('0x38')](_0xd279('0x39'))){_0x159ea4[_0xd279('0x22')]=qs['limit'](_0x43aacd[_0xd279('0x32')][_0xd279('0x22')]);_0x159ea4[_0xd279('0x21')]=qs['offset'](_0x43aacd[_0xd279('0x32')]['offset']);}_0x159ea4[_0xd279('0x3a')]=qs['sort'](_0x43aacd[_0xd279('0x32')][_0xd279('0x3b')]);_0x159ea4['where']=qs[_0xd279('0x33')](_[_0xd279('0x3c')](_0x43aacd[_0xd279('0x32')],_0x2347ed['filters']));if(_0x43aacd[_0xd279('0x32')][_0xd279('0x3d')]){_0x159ea4[_0xd279('0x3e')]=_[_0xd279('0x3f')](_0x159ea4[_0xd279('0x3e')],{'$or':_[_0xd279('0x40')](_0x47175a,function(_0x4b27df){if(_0x4b27df['type'][_0xd279('0x41')]!==_0xd279('0x42')){var _0x3ba1ee={};_0x3ba1ee[_0x4b27df[_0xd279('0x43')]]={'$like':'%'+_0x43aacd[_0xd279('0x32')][_0xd279('0x3d')]+'%'};return _0x3ba1ee;}})});}_0x159ea4=_['merge']({},_0x159ea4,_0x43aacd[_0xd279('0x44')]);var _0x5c41d9={'where':_0x159ea4[_0xd279('0x3e')]};_0x5c41d9[_0xd279('0x45')]=[];if(_0x43aacd['query']['tag']){_0x5c41d9[_0xd279('0x45')][_0xd279('0x46')]({'model':db[_0xd279('0x47')],'as':_0xd279('0x48'),'attributes':['id'],'where':{'id':_0x43aacd['query'][_0xd279('0x49')]},'required':!![]});_0x5c41d9['distinct']=!![];}if(_0x43aacd[_0xd279('0x32')][_0xd279('0x4a')]){_0x5c41d9[_0xd279('0x45')][_0xd279('0x46')]({'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0xd279('0x4b'),_0xd279('0x4c'),_0xd279('0x4a')],'where':{'direction':'in','read':_0x43aacd[_0xd279('0x32')][_0xd279('0x4a')]||![]},'required':!![]});_0x5c41d9['distinct']=!![];}return db['SmsInteraction'][_0xd279('0x20')](_0x5c41d9)[_0xd279('0x29')](function(_0x3353d8){_0x3e64f6['count']=_0x3353d8;if(_0x43aacd['query'][_0xd279('0x4d')]){_0x159ea4['include']=[{'model':db[_0xd279('0x4e')],'as':_0xd279('0x4f'),'required':![],'attributes':['id','name',_0xd279('0x50')]},{'model':db[_0xd279('0x51')],'as':_0xd279('0x52'),'required':![]},{'model':db[_0xd279('0x4e')],'as':_0xd279('0x53'),'attributes':[_0xd279('0x2c'),_0xd279('0x50'),_0xd279('0x54')],'required':![]},{'model':db['SmsAccount'],'as':_0xd279('0x55'),'attributes':[_0xd279('0x2c'),_0xd279('0x41')],'required':![]},{'model':db[_0xd279('0x56')],'as':'Messages','attributes':['id',_0xd279('0x4b'),_0xd279('0x4c'),_0xd279('0x4a')],'where':{'direction':'in','read':_0x43aacd[_0xd279('0x32')][_0xd279('0x4a')]||![]},'required':_0x43aacd[_0xd279('0x32')][_0xd279('0x4a')]||![]},{'model':db[_0xd279('0x47')],'as':_0xd279('0x48'),'attributes':['id',_0xd279('0x2c'),_0xd279('0x57')],'required':_0x43aacd['query']['tag']?!![]:![]},{'model':db['Tag'],'as':_0xd279('0x58'),'attributes':['id',_0xd279('0x2c'),_0xd279('0x57')],'through':_0x43aacd[_0xd279('0x32')][_0xd279('0x49')]?{'attributes':[],'where':{'TagId':_0x43aacd[_0xd279('0x32')][_0xd279('0x49')]||undefined}}:{},'required':_0x43aacd['query'][_0xd279('0x49')]?!![]:![]}];}return db[_0xd279('0x2e')][_0xd279('0x59')](_0x159ea4);})[_0xd279('0x29')](function(_0x3e95b9){_0x3e64f6[_0xd279('0x5a')]=_0x3e95b9;return _0x3e64f6;})[_0xd279('0x29')](respondWithFilteredResult(_0x577102,_0x159ea4))[_0xd279('0x5b')](handleError(_0x577102,null));};exports[_0xd279('0x5c')]=function(_0x3f43d6,_0x302c33){var _0x81278c={'raw':![],'where':{'id':_0x3f43d6['params']['id']}},_0x341d92={};_0x341d92[_0xd279('0x30')]=_['keys'](db[_0xd279('0x2e')][_0xd279('0x2f')]);_0x341d92[_0xd279('0x32')]=_[_0xd279('0x31')](_0x3f43d6['query']);_0x341d92[_0xd279('0x33')]=_[_0xd279('0x34')](_0x341d92[_0xd279('0x30')],_0x341d92[_0xd279('0x32')]);_0x81278c[_0xd279('0x35')]=_[_0xd279('0x34')](_0x341d92[_0xd279('0x30')],qs[_0xd279('0x36')](_0x3f43d6[_0xd279('0x32')][_0xd279('0x36')]));_0x81278c['attributes']=_0x81278c[_0xd279('0x35')][_0xd279('0x37')]?_0x81278c[_0xd279('0x35')]:_0x341d92['model'];if(_0x3f43d6['query'][_0xd279('0x4d')]){_0x81278c[_0xd279('0x45')]=[{'all':!![]}];}_0x81278c=_[_0xd279('0x3f')]({},_0x81278c,_0x3f43d6[_0xd279('0x44')]);return db[_0xd279('0x2e')]['find'](_0x81278c)[_0xd279('0x29')](handleEntityNotFound(_0x302c33,null))[_0xd279('0x29')](respondWithResult(_0x302c33,null))[_0xd279('0x5b')](handleError(_0x302c33,null));};exports[_0xd279('0x5d')]=function(_0x5df5ab,_0x1cf7ef){return db[_0xd279('0x2e')][_0xd279('0x5d')](_0x5df5ab[_0xd279('0x5e')],{})['then'](respondWithResult(_0x1cf7ef,0xc9))[_0xd279('0x5b')](handleError(_0x1cf7ef,null));};exports[_0xd279('0x27')]=function(_0x568376,_0x45ad2b){if(_0x568376[_0xd279('0x5e')]['id']){delete _0x568376[_0xd279('0x5e')]['id'];}return db[_0xd279('0x2e')]['find']({'where':{'id':_0x568376[_0xd279('0x5f')]['id']}})[_0xd279('0x29')](handleEntityNotFound(_0x45ad2b,null))[_0xd279('0x29')](saveUpdates(_0x568376[_0xd279('0x5e')],null))[_0xd279('0x29')](respondWithResult(_0x45ad2b,null))[_0xd279('0x5b')](handleError(_0x45ad2b,null));};exports[_0xd279('0x28')]=function(_0x384416,_0x30d8e1){return db[_0xd279('0x2e')]['find']({'where':{'id':_0x384416[_0xd279('0x5f')]['id']}})[_0xd279('0x29')](handleEntityNotFound(_0x30d8e1,null))[_0xd279('0x29')](removeEntity(_0x30d8e1,null))[_0xd279('0x5b')](handleError(_0x30d8e1,null));};exports[_0xd279('0x60')]=function(_0x5c4c29,_0x17477d){return db['SmsInteraction'][_0xd279('0x60')]()['then'](respondWithResult(_0x17477d,null))[_0xd279('0x5b')](handleError(_0x17477d,null));};exports[_0xd279('0x61')]=function(_0x54ebb7,_0x23fab9,_0x7577d9){return db['SmsMessage'][_0xd279('0x62')]({'where':{'id':_0x54ebb7[_0xd279('0x5f')]['id']}})[_0xd279('0x29')](handleEntityNotFound(_0x23fab9,null))['then'](function(_0x1ea931){if(_0x1ea931){return _0x1ea931[_0xd279('0x61')](_0x54ebb7['body'][_0xd279('0x63')],_['omit'](_0x54ebb7['body'],[_0xd279('0x63'),'id'])||{});}})[_0xd279('0x29')](respondWithResult(_0x23fab9,null))[_0xd279('0x5b')](handleError(_0x23fab9,null));};exports[_0xd279('0x64')]=function(_0x2758da,_0x3b0bb6,_0x53d77e){var _0x2cbd79={'raw':![],'where':{}};var _0x4868dd={};var _0x43d60f={'count':0x0,'rows':[]};return db[_0xd279('0x2e')][_0xd279('0x65')]({'where':{'id':_0x2758da[_0xd279('0x5f')]['id']}})[_0xd279('0x29')](handleEntityNotFound(_0x3b0bb6,null))[_0xd279('0x29')](function(_0x436000){if(_0x436000){_0x4868dd['model']=_[_0xd279('0x31')](db[_0xd279('0x56')]['rawAttributes']);_0x4868dd['query']=_[_0xd279('0x31')](_0x2758da['query']);_0x4868dd[_0xd279('0x33')]=_[_0xd279('0x34')](_0x4868dd[_0xd279('0x30')],_0x4868dd[_0xd279('0x32')]);_0x2cbd79['attributes']=_[_0xd279('0x34')](_0x4868dd[_0xd279('0x30')],qs[_0xd279('0x36')](_0x2758da['query'][_0xd279('0x36')]));_0x2cbd79[_0xd279('0x35')]=_0x2cbd79[_0xd279('0x35')][_0xd279('0x37')]?_0x2cbd79[_0xd279('0x35')]:_0x4868dd[_0xd279('0x30')];if(!_0x2758da[_0xd279('0x32')]['hasOwnProperty'](_0xd279('0x39'))){_0x2cbd79[_0xd279('0x22')]=qs[_0xd279('0x22')](_0x2758da[_0xd279('0x32')][_0xd279('0x22')]);_0x2cbd79[_0xd279('0x21')]=qs[_0xd279('0x21')](_0x2758da['query'][_0xd279('0x21')]);}_0x2cbd79['order']=qs[_0xd279('0x3b')](_0x2758da[_0xd279('0x32')]['sort']);_0x2cbd79['where']=qs['filters'](_[_0xd279('0x3c')](_0x2758da[_0xd279('0x32')],_0x4868dd['filters']));_0x2cbd79[_0xd279('0x3e')]['SmsInteractionId']=_0x436000['id'];if(_0x2758da[_0xd279('0x32')][_0xd279('0x3d')]){_0x2cbd79[_0xd279('0x3e')]=_[_0xd279('0x3f')](_0x2cbd79['where'],{'$or':_[_0xd279('0x40')](_0x2cbd79[_0xd279('0x35')],function(_0x4e3320){var _0x5aef5d={};_0x5aef5d[_0x4e3320]={'$like':'%'+_0x2758da[_0xd279('0x32')][_0xd279('0x3d')]+'%'};return _0x5aef5d;})});}if(_0x2758da[_0xd279('0x32')][_0xd279('0x66')]){var _0x5efa9d=_0x2758da['query'][_0xd279('0x66')][_0xd279('0x67')](',');var _0x23cd93={};_0x23cd93[_0x5efa9d[0x0]]={'$gte':moment(_0x5efa9d[0x1])[_0xd279('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2cbd79[_0xd279('0x3e')]=_[_0xd279('0x3f')](_0x2cbd79[_0xd279('0x3e')],_0x23cd93);}_0x2cbd79=_['merge']({},_0x2cbd79,_0x2758da['options']);return db['SmsMessage'][_0xd279('0x20')]({'where':_0x2cbd79[_0xd279('0x3e')]})[_0xd279('0x29')](function(_0x4ba16c){_0x43d60f['count']=_0x4ba16c;if(_0x2758da[_0xd279('0x32')][_0xd279('0x4d')]){_0x2cbd79[_0xd279('0x45')]=[{'all':!![]}];}return db['SmsMessage'][_0xd279('0x59')](_0x2cbd79);})[_0xd279('0x29')](function(_0x18f19a){_0x43d60f[_0xd279('0x5a')]=_0x18f19a;return _0x43d60f;});}})[_0xd279('0x29')](respondWithFilteredResult(_0x3b0bb6,_0x2cbd79))['catch'](handleError(_0x3b0bb6,null));};exports['addTags']=function(_0x4d1f43,_0x35cd3c,_0x6f6c0b){return db['SmsInteraction'][_0xd279('0x62')]({'where':{'id':_0x4d1f43[_0xd279('0x5f')]['id']}})[_0xd279('0x29')](handleEntityNotFound(_0x35cd3c,null))[_0xd279('0x29')](function(_0x54e82d){if(_0x54e82d){return _0x54e82d[_0xd279('0x69')](_0x4d1f43[_0xd279('0x5e')]['ids'],_[_0xd279('0x6a')](_0x4d1f43[_0xd279('0x5e')],[_0xd279('0x63'),'id'])||{})[_0xd279('0x6b')](function(){return db['Tag']['findAll']({'attributes':['id',_0xd279('0x2c'),_0xd279('0x57')],'where':{'id':_0x4d1f43['body']['ids']}});})[_0xd279('0x29')](function(_0x3c22e1){socket['emit'](_0xd279('0x6c'),{'id':Number(_0x4d1f43[_0xd279('0x5f')]['id']),'tags':_0x3c22e1||[]});return{'id':Number(_0x4d1f43[_0xd279('0x5f')]['id']),'tags':_0x3c22e1||[]};});}})[_0xd279('0x29')](respondWithResult(_0x35cd3c,null))['catch'](handleError(_0x35cd3c,null));};exports[_0xd279('0x6d')]=function(_0x4033d9,_0x39f5ce,_0x23865d){var _0x4109f1;return db[_0xd279('0x2e')][_0xd279('0x62')]({'where':{'id':_0x4033d9[_0xd279('0x5f')]['id']}})[_0xd279('0x29')](handleEntityNotFound(_0x39f5ce,null))['then'](function(_0x35407d){if(_0x35407d){return _0x35407d[_0xd279('0x6d')](_0x4033d9[_0xd279('0x32')][_0xd279('0x63')]);}})[_0xd279('0x29')](respondWithStatusCode(_0x39f5ce,null))[_0xd279('0x5b')](handleError(_0x39f5ce,null));};exports[_0xd279('0x6e')]=function(_0x8fcabe,_0x56339d){var _0xea4003=moment()[_0xd279('0x6f')]()['toString']();var _0x1de303=path['join'](config[_0xd279('0x70')],_0xd279('0x71'),_0xd279('0x72'),'tmp');var _0x1949cf=path[_0xd279('0x73')](config[_0xd279('0x70')],'server',_0xd279('0x72'),_0xd279('0x74'));var _0xaf3a29=path[_0xd279('0x73')](_0x1de303,_0xea4003);var _0x4bb51d=util[_0xd279('0x68')](_0xd279('0x75'),_0xea4003);var _0x3673c5=path[_0xd279('0x73')](_0x1de303,_0x4bb51d);var _0x56c1c5=![];return db[_0xd279('0x2e')][_0xd279('0x62')]({'where':{'id':_0x8fcabe[_0xd279('0x5f')]['id']},'include':[{'model':db[_0xd279('0x56')],'as':'Messages','attributes':['id',_0xd279('0x5e')],'include':[{'model':db[_0xd279('0x4e')],'as':_0xd279('0x4e'),'attributes':['id',_0xd279('0x50')],'raw':!![]},{'model':db[_0xd279('0x51')],'as':'Contact','attributes':['id','firstName'],'raw':!![]}]}]})[_0xd279('0x29')](handleEntityNotFound(_0x56339d,null))[_0xd279('0x29')](function(_0x236482){if(_0x236482){_0x56c1c5=!![];var _0x17ea9d='';var _0xbde294={'format':'Letter','border':'1cm'};fs[_0xd279('0x76')](_0xaf3a29);_0x17ea9d+=util[_0xd279('0x68')](_0xd279('0x77'),_0x236482['id']);_0x17ea9d+=util[_0xd279('0x68')]('

Date:\x20%s

',moment()['format']('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')['toString']());_0x17ea9d+=_0xd279('0x78');for(var _0x2db666=0x0;_0x2db666<_0x236482[_0xd279('0x79')]['length'];_0x2db666++){var _0xe8fb97=_0x236482[_0xd279('0x79')][_0x2db666];_0x17ea9d+=_0xd279('0x7a');_0x17ea9d+=util[_0xd279('0x68')](_0xd279('0x7b'),_0xe8fb97[_0xd279('0x4e')]?_0xe8fb97['User']['fullname']:_0xe8fb97[_0xd279('0x52')][_0xd279('0x7c')],_0xe8fb97['body']);_0x17ea9d+=_0xd279('0x7d');}return new BPromise(function(_0x46bdc2,_0x4642c0){pdf[_0xd279('0x5d')](_0x17ea9d,_0xbde294)[_0xd279('0x7e')](path[_0xd279('0x73')](_0xaf3a29,'interaction-'+_0xea4003+_0xd279('0x7f')),function(_0x4ab7f1,_0x30eb34){if(_0x4ab7f1)return _0x4642c0(_0x4ab7f1);_0x46bdc2(_0x30eb34);});});}})[_0xd279('0x29')](function(){if(_0x56c1c5){return new BPromise(function(_0x260111,_0x1dcd2a){zipdir(_0xaf3a29,{'saveTo':_0x3673c5},function(_0x12b7e1,_0x572171){if(_0x12b7e1)return _0x1dcd2a(_0x12b7e1);return _0x260111(_0x572171);});});}})[_0xd279('0x29')](function(){if(_0x56c1c5){return new BPromise(function(_0xfa401d,_0x1c90fb){rimraf(_0xaf3a29,function(_0x161afe){if(_0x161afe)_0x1c90fb(_0x161afe);return _0xfa401d();});});}})[_0xd279('0x29')](function(){if(_0x56c1c5){return _0x56339d[_0xd279('0x6e')](_0x3673c5,_0x4bb51d,function(_0x21c429){if(_0x21c429){console['log'](_0xd279('0x80'),_0x21c429);}else{fs[_0xd279('0x81')](_0x3673c5);}});}else{return _0x56339d['sendStatus'](0xc8);}})['catch'](handleError(_0x56339d,null));}; \ No newline at end of file +var _0xc7e9=['ioredis','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','index','SmsInteraction','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','map','type','key','VIRTUAL','merge','options','include','Tag','Tags','tag','read','push','SmsMessage','Messages','direction','createdAt','distinct','includeAll','User','CmContact','Owner','fullname','internal','color','findAll','rows','params','rawAttributes','length','find','catch','create','body','describe','addMessage','omit','ids','getMessages','pick','SmsInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','smsInteractionTags:save','download','unix','toString','join','root','files','tmp','server','interaction-%s.zip','Contact','firstName','Letter','1cm','

Sms\x20Interaction:\x20#%d

','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','','%s:\x20%s

','','toFile','interaction-','.pdf','log','err','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../config/license/hardware'];(function(_0x57a6df,_0x100bc1){var _0x4daea7=function(_0x2c3491){while(--_0x2c3491){_0x57a6df['push'](_0x57a6df['shift']());}};_0x4daea7(++_0x100bc1);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xc7e9[_0x725b8e];return _0x43ac45;};'use strict';var pdf=require(_0x9c7e('0x0'));var emlformat=require(_0x9c7e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9c7e('0x2'));var jsonpatch=require(_0x9c7e('0x3'));var rp=require(_0x9c7e('0x4'));var moment=require('moment');var BPromise=require(_0x9c7e('0x5'));var Mustache=require(_0x9c7e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9c7e('0x7'));var csv=require('to-csv');var ejs=require(_0x9c7e('0x8'));var fs=require('fs');var _=require(_0x9c7e('0x9'));var squel=require(_0x9c7e('0xa'));var crypto=require(_0x9c7e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c7e('0xc'));var toCsv=require(_0x9c7e('0xd'));var querystring=require(_0x9c7e('0xe'));var Papa=require(_0x9c7e('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x9c7e('0x10'));var Redis=require(_0x9c7e('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x9c7e('0x12'))('api');var utils=require(_0x9c7e('0x13'));var config=require(_0x9c7e('0x14'));var db=require('../../mysqldb')['db'];config[_0x9c7e('0x15')]=_['defaults'](config[_0x9c7e('0x15')],{'host':_0x9c7e('0x16'),'port':0x18eb});var socket=require(_0x9c7e('0x17'))(new Redis(config[_0x9c7e('0x15')]));require(_0x9c7e('0x18'))['register'](socket);function respondWithStatusCode(_0xd474b7,_0x77e81c){_0x77e81c=_0x77e81c||0xcc;return function(_0x322d98){if(_0x322d98){return _0xd474b7[_0x9c7e('0x19')](_0x77e81c);}return _0xd474b7[_0x9c7e('0x1a')](_0x77e81c)[_0x9c7e('0x1b')]();};}function respondWithResult(_0x4b26a8,_0x438a38){_0x438a38=_0x438a38||0xc8;return function(_0x161f74){if(_0x161f74){return _0x4b26a8[_0x9c7e('0x1a')](_0x438a38)[_0x9c7e('0x1c')](_0x161f74);}};}function respondWithFilteredResult(_0x26871f,_0x48d03d){return function(_0x192f86){if(_0x192f86){var _0x412b17=_0x192f86[_0x9c7e('0x1d')],_0x5af216=_0x48d03d[_0x9c7e('0x1e')],_0x164412=_0x48d03d[_0x9c7e('0x1e')]+_0x48d03d['limit'],_0x26dd66;if(_0x164412>=_0x412b17){_0x164412=_0x412b17;_0x26dd66=0xc8;}else{_0x26dd66=0xce;}_0x26871f[_0x9c7e('0x1a')](_0x26dd66);return _0x26871f['set'](_0x9c7e('0x1f'),_0x5af216+'-'+_0x164412+'/'+_0x412b17)['json'](_0x192f86);}return null;};}function patchUpdates(_0x52abd4){return function(_0x2ee013){try{jsonpatch[_0x9c7e('0x20')](_0x2ee013,_0x52abd4,!![]);}catch(_0x2f67d1){return BPromise[_0x9c7e('0x21')](_0x2f67d1);}return _0x2ee013[_0x9c7e('0x22')]();};}function saveUpdates(_0x5350a5,_0x49689d){return function(_0x14696f){if(_0x14696f){return _0x14696f[_0x9c7e('0x23')](_0x5350a5)[_0x9c7e('0x24')](function(_0x44b96a){return _0x44b96a;});}return null;};}function removeEntity(_0x28f031,_0x376e0c){return function(_0x1ce4d2){if(_0x1ce4d2){return _0x1ce4d2[_0x9c7e('0x25')]()[_0x9c7e('0x24')](function(){_0x28f031[_0x9c7e('0x1a')](0xcc)[_0x9c7e('0x1b')]();});}};}function handleEntityNotFound(_0x4a8a46,_0x9780f8){return function(_0x2eaebb){if(!_0x2eaebb){_0x4a8a46[_0x9c7e('0x19')](0x194);}return _0x2eaebb;};}function handleError(_0x467918,_0x17779b){_0x17779b=_0x17779b||0x1f4;return function(_0x224056){logger['error'](_0x224056['stack']);if(_0x224056[_0x9c7e('0x26')]){delete _0x224056[_0x9c7e('0x26')];}_0x467918[_0x9c7e('0x1a')](_0x17779b)[_0x9c7e('0x27')](_0x224056);};}exports[_0x9c7e('0x28')]=function(_0x33d696,_0x324691){var _0xc02abf={},_0x531544={},_0x339e21={'count':0x0,'rows':[]};var _0x48dc1f=db[_0x9c7e('0x29')]['rawAttributes'];_0x531544['model']=_[_0x9c7e('0x2a')](_0x48dc1f);_0x531544[_0x9c7e('0x2b')]=_[_0x9c7e('0x2a')](_0x33d696[_0x9c7e('0x2b')]);_0x531544[_0x9c7e('0x2c')]=_[_0x9c7e('0x2d')](_0x531544[_0x9c7e('0x2e')],_0x531544[_0x9c7e('0x2b')]);_0xc02abf[_0x9c7e('0x2f')]=_[_0x9c7e('0x2d')](_0x531544[_0x9c7e('0x2e')],qs[_0x9c7e('0x30')](_0x33d696[_0x9c7e('0x2b')]['fields']));_0xc02abf[_0x9c7e('0x2f')]=_0xc02abf[_0x9c7e('0x2f')]['length']?_0xc02abf[_0x9c7e('0x2f')]:_0x531544[_0x9c7e('0x2e')];if(!_0x33d696['query'][_0x9c7e('0x31')](_0x9c7e('0x32'))){_0xc02abf[_0x9c7e('0x33')]=qs['limit'](_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x33')]);_0xc02abf[_0x9c7e('0x1e')]=qs[_0x9c7e('0x1e')](_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x1e')]);}_0xc02abf[_0x9c7e('0x34')]=qs['sort'](_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x35')]);_0xc02abf['where']=qs[_0x9c7e('0x2c')](_['pick'](_0x33d696[_0x9c7e('0x2b')],_0x531544[_0x9c7e('0x2c')]));if(_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x36')]){_0xc02abf[_0x9c7e('0x37')]=_['merge'](_0xc02abf['where'],{'$or':_[_0x9c7e('0x38')](_0x48dc1f,function(_0x12ea03){if(_0x12ea03[_0x9c7e('0x39')][_0x9c7e('0x3a')]!==_0x9c7e('0x3b')){var _0x58c867={};_0x58c867[_0x12ea03['field']]={'$like':'%'+_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x36')]+'%'};return _0x58c867;}})});}_0xc02abf=_[_0x9c7e('0x3c')]({},_0xc02abf,_0x33d696[_0x9c7e('0x3d')]);var _0xc51a1f={'where':_0xc02abf[_0x9c7e('0x37')]};_0xc51a1f[_0x9c7e('0x3e')]=[];if(_0x33d696['query']['tag']){_0xc51a1f[_0x9c7e('0x3e')]['push']({'model':db[_0x9c7e('0x3f')],'as':_0x9c7e('0x40'),'attributes':['id'],'where':{'id':_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x41')]},'required':!![]});_0xc51a1f['distinct']=!![];}if(_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x42')]){_0xc51a1f[_0x9c7e('0x3e')][_0x9c7e('0x43')]({'model':db[_0x9c7e('0x44')],'as':_0x9c7e('0x45'),'attributes':['id',_0x9c7e('0x46'),_0x9c7e('0x47'),'read'],'where':{'direction':'in','read':_0x33d696[_0x9c7e('0x2b')]['read']||![]},'required':!![]});_0xc51a1f[_0x9c7e('0x48')]=!![];}return db[_0x9c7e('0x29')][_0x9c7e('0x1d')](_0xc51a1f)[_0x9c7e('0x24')](function(_0x1ab75a){_0x339e21[_0x9c7e('0x1d')]=_0x1ab75a;if(_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x49')]){_0xc02abf['include']=[{'model':db[_0x9c7e('0x4a')],'as':'Users','required':![],'attributes':['id','name','fullname']},{'model':db[_0x9c7e('0x4b')],'as':'Contact','required':![]},{'model':db[_0x9c7e('0x4a')],'as':_0x9c7e('0x4c'),'attributes':['name',_0x9c7e('0x4d'),_0x9c7e('0x4e')],'required':![]},{'model':db['SmsAccount'],'as':'Account','attributes':[_0x9c7e('0x26'),_0x9c7e('0x3a')],'required':![]},{'model':db[_0x9c7e('0x44')],'as':_0x9c7e('0x45'),'attributes':['id',_0x9c7e('0x46'),_0x9c7e('0x47'),_0x9c7e('0x42')],'where':{'direction':'in','read':_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x42')]||![]},'required':_0x33d696[_0x9c7e('0x2b')]['read']||![]},{'model':db[_0x9c7e('0x3f')],'as':_0x9c7e('0x40'),'attributes':['id',_0x9c7e('0x26'),_0x9c7e('0x4f')],'required':_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x41')]?!![]:![]},{'model':db[_0x9c7e('0x3f')],'as':'ThroughTags','attributes':['id',_0x9c7e('0x26'),_0x9c7e('0x4f')],'through':_0x33d696[_0x9c7e('0x2b')]['tag']?{'attributes':[],'where':{'TagId':_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x41')]||undefined}}:{},'required':_0x33d696[_0x9c7e('0x2b')][_0x9c7e('0x41')]?!![]:![]}];}return db['SmsInteraction'][_0x9c7e('0x50')](_0xc02abf);})[_0x9c7e('0x24')](function(_0x3b2780){_0x339e21[_0x9c7e('0x51')]=_0x3b2780;return _0x339e21;})[_0x9c7e('0x24')](respondWithFilteredResult(_0x324691,_0xc02abf))['catch'](handleError(_0x324691,null));};exports['show']=function(_0x4e75a0,_0x2e76e8){var _0x11f836={'raw':![],'where':{'id':_0x4e75a0[_0x9c7e('0x52')]['id']}},_0x44ad2f={};_0x44ad2f[_0x9c7e('0x2e')]=_[_0x9c7e('0x2a')](db[_0x9c7e('0x29')][_0x9c7e('0x53')]);_0x44ad2f[_0x9c7e('0x2b')]=_[_0x9c7e('0x2a')](_0x4e75a0[_0x9c7e('0x2b')]);_0x44ad2f[_0x9c7e('0x2c')]=_[_0x9c7e('0x2d')](_0x44ad2f[_0x9c7e('0x2e')],_0x44ad2f[_0x9c7e('0x2b')]);_0x11f836['attributes']=_[_0x9c7e('0x2d')](_0x44ad2f[_0x9c7e('0x2e')],qs[_0x9c7e('0x30')](_0x4e75a0[_0x9c7e('0x2b')][_0x9c7e('0x30')]));_0x11f836[_0x9c7e('0x2f')]=_0x11f836[_0x9c7e('0x2f')][_0x9c7e('0x54')]?_0x11f836[_0x9c7e('0x2f')]:_0x44ad2f['model'];if(_0x4e75a0[_0x9c7e('0x2b')][_0x9c7e('0x49')]){_0x11f836[_0x9c7e('0x3e')]=[{'all':!![]}];}_0x11f836=_[_0x9c7e('0x3c')]({},_0x11f836,_0x4e75a0[_0x9c7e('0x3d')]);return db[_0x9c7e('0x29')][_0x9c7e('0x55')](_0x11f836)[_0x9c7e('0x24')](handleEntityNotFound(_0x2e76e8,null))[_0x9c7e('0x24')](respondWithResult(_0x2e76e8,null))[_0x9c7e('0x56')](handleError(_0x2e76e8,null));};exports[_0x9c7e('0x57')]=function(_0x298eab,_0x4692c2){return db[_0x9c7e('0x29')][_0x9c7e('0x57')](_0x298eab['body'],{})[_0x9c7e('0x24')](respondWithResult(_0x4692c2,0xc9))['catch'](handleError(_0x4692c2,null));};exports['update']=function(_0x13a517,_0x4c09e2){if(_0x13a517[_0x9c7e('0x58')]['id']){delete _0x13a517[_0x9c7e('0x58')]['id'];}return db[_0x9c7e('0x29')][_0x9c7e('0x55')]({'where':{'id':_0x13a517[_0x9c7e('0x52')]['id']}})[_0x9c7e('0x24')](handleEntityNotFound(_0x4c09e2,null))['then'](saveUpdates(_0x13a517['body'],null))['then'](respondWithResult(_0x4c09e2,null))['catch'](handleError(_0x4c09e2,null));};exports[_0x9c7e('0x25')]=function(_0x2c7aff,_0x3f1bda){return db[_0x9c7e('0x29')]['find']({'where':{'id':_0x2c7aff[_0x9c7e('0x52')]['id']}})[_0x9c7e('0x24')](handleEntityNotFound(_0x3f1bda,null))[_0x9c7e('0x24')](removeEntity(_0x3f1bda,null))[_0x9c7e('0x56')](handleError(_0x3f1bda,null));};exports[_0x9c7e('0x59')]=function(_0x28df55,_0x923964){return db[_0x9c7e('0x29')][_0x9c7e('0x59')]()[_0x9c7e('0x24')](respondWithResult(_0x923964,null))[_0x9c7e('0x56')](handleError(_0x923964,null));};exports['addMessage']=function(_0x218035,_0x429b2b,_0x110c75){return db[_0x9c7e('0x44')][_0x9c7e('0x55')]({'where':{'id':_0x218035['params']['id']}})[_0x9c7e('0x24')](handleEntityNotFound(_0x429b2b,null))[_0x9c7e('0x24')](function(_0x1ec84a){if(_0x1ec84a){return _0x1ec84a[_0x9c7e('0x5a')](_0x218035['body']['ids'],_[_0x9c7e('0x5b')](_0x218035[_0x9c7e('0x58')],[_0x9c7e('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x429b2b,null))['catch'](handleError(_0x429b2b,null));};exports[_0x9c7e('0x5d')]=function(_0x1824b7,_0x36312a,_0x341326){var _0x3732ca={'raw':![],'where':{}};var _0xc7cbaa={};var _0x352fd9={'count':0x0,'rows':[]};return db[_0x9c7e('0x29')]['findOne']({'where':{'id':_0x1824b7[_0x9c7e('0x52')]['id']}})[_0x9c7e('0x24')](handleEntityNotFound(_0x36312a,null))[_0x9c7e('0x24')](function(_0x302b88){if(_0x302b88){_0xc7cbaa[_0x9c7e('0x2e')]=_[_0x9c7e('0x2a')](db[_0x9c7e('0x44')][_0x9c7e('0x53')]);_0xc7cbaa[_0x9c7e('0x2b')]=_[_0x9c7e('0x2a')](_0x1824b7[_0x9c7e('0x2b')]);_0xc7cbaa[_0x9c7e('0x2c')]=_[_0x9c7e('0x2d')](_0xc7cbaa[_0x9c7e('0x2e')],_0xc7cbaa[_0x9c7e('0x2b')]);_0x3732ca[_0x9c7e('0x2f')]=_[_0x9c7e('0x2d')](_0xc7cbaa[_0x9c7e('0x2e')],qs['fields'](_0x1824b7[_0x9c7e('0x2b')][_0x9c7e('0x30')]));_0x3732ca['attributes']=_0x3732ca[_0x9c7e('0x2f')][_0x9c7e('0x54')]?_0x3732ca['attributes']:_0xc7cbaa[_0x9c7e('0x2e')];if(!_0x1824b7['query'][_0x9c7e('0x31')](_0x9c7e('0x32'))){_0x3732ca[_0x9c7e('0x33')]=qs[_0x9c7e('0x33')](_0x1824b7[_0x9c7e('0x2b')][_0x9c7e('0x33')]);_0x3732ca[_0x9c7e('0x1e')]=qs[_0x9c7e('0x1e')](_0x1824b7[_0x9c7e('0x2b')][_0x9c7e('0x1e')]);}_0x3732ca['order']=qs[_0x9c7e('0x35')](_0x1824b7[_0x9c7e('0x2b')][_0x9c7e('0x35')]);_0x3732ca[_0x9c7e('0x37')]=qs[_0x9c7e('0x2c')](_[_0x9c7e('0x5e')](_0x1824b7['query'],_0xc7cbaa[_0x9c7e('0x2c')]));_0x3732ca[_0x9c7e('0x37')][_0x9c7e('0x5f')]=_0x302b88['id'];if(_0x1824b7[_0x9c7e('0x2b')][_0x9c7e('0x36')]){_0x3732ca[_0x9c7e('0x37')]=_[_0x9c7e('0x3c')](_0x3732ca['where'],{'$or':_['map'](_0x3732ca[_0x9c7e('0x2f')],function(_0x34b7cc){var _0x3dca41={};_0x3dca41[_0x34b7cc]={'$like':'%'+_0x1824b7[_0x9c7e('0x2b')][_0x9c7e('0x36')]+'%'};return _0x3dca41;})});}if(_0x1824b7['query']['$gte']){var _0x303103=_0x1824b7[_0x9c7e('0x2b')][_0x9c7e('0x60')][_0x9c7e('0x61')](',');var _0x39cbf5={};_0x39cbf5[_0x303103[0x0]]={'$gte':moment(_0x303103[0x1])[_0x9c7e('0x62')](_0x9c7e('0x63'))};_0x3732ca['where']=_['merge'](_0x3732ca[_0x9c7e('0x37')],_0x39cbf5);}_0x3732ca=_[_0x9c7e('0x3c')]({},_0x3732ca,_0x1824b7[_0x9c7e('0x3d')]);return db[_0x9c7e('0x44')][_0x9c7e('0x1d')]({'where':_0x3732ca['where']})[_0x9c7e('0x24')](function(_0x3784cb){_0x352fd9[_0x9c7e('0x1d')]=_0x3784cb;if(_0x1824b7[_0x9c7e('0x2b')]['includeAll']){_0x3732ca[_0x9c7e('0x3e')]=[{'all':!![]}];}return db[_0x9c7e('0x44')]['findAll'](_0x3732ca);})[_0x9c7e('0x24')](function(_0x20e72b){_0x352fd9[_0x9c7e('0x51')]=_0x20e72b;return _0x352fd9;});}})['then'](respondWithFilteredResult(_0x36312a,_0x3732ca))[_0x9c7e('0x56')](handleError(_0x36312a,null));};exports[_0x9c7e('0x64')]=function(_0x87bbc,_0x3aa077,_0x49c8d2){return db[_0x9c7e('0x29')]['find']({'where':{'id':_0x87bbc[_0x9c7e('0x52')]['id']}})[_0x9c7e('0x24')](handleEntityNotFound(_0x3aa077,null))['then'](function(_0x1e8345){if(_0x1e8345){return _0x1e8345[_0x9c7e('0x65')](_0x87bbc[_0x9c7e('0x58')][_0x9c7e('0x5c')],_[_0x9c7e('0x5b')](_0x87bbc['body'],['ids','id'])||{})['spread'](function(){return db[_0x9c7e('0x3f')][_0x9c7e('0x50')]({'attributes':['id','name','color'],'where':{'id':_0x87bbc[_0x9c7e('0x58')][_0x9c7e('0x5c')]}});})[_0x9c7e('0x24')](function(_0x5a5189){socket['emit'](_0x9c7e('0x66'),{'id':Number(_0x87bbc[_0x9c7e('0x52')]['id']),'tags':_0x5a5189||[]});return{'id':Number(_0x87bbc[_0x9c7e('0x52')]['id']),'tags':_0x5a5189||[]};});}})[_0x9c7e('0x24')](respondWithResult(_0x3aa077,null))[_0x9c7e('0x56')](handleError(_0x3aa077,null));};exports['removeTags']=function(_0x199359,_0x1b4698,_0x2cc41a){var _0xe9dda3;return db[_0x9c7e('0x29')]['find']({'where':{'id':_0x199359[_0x9c7e('0x52')]['id']}})[_0x9c7e('0x24')](handleEntityNotFound(_0x1b4698,null))['then'](function(_0x4a2cbd){if(_0x4a2cbd){return _0x4a2cbd['removeTags'](_0x199359[_0x9c7e('0x2b')][_0x9c7e('0x5c')]);}})[_0x9c7e('0x24')](respondWithStatusCode(_0x1b4698,null))[_0x9c7e('0x56')](handleError(_0x1b4698,null));};exports[_0x9c7e('0x67')]=function(_0x59e670,_0x35c248){var _0x2f591a=moment()[_0x9c7e('0x68')]()[_0x9c7e('0x69')]();var _0x39ea58=path[_0x9c7e('0x6a')](config[_0x9c7e('0x6b')],'server',_0x9c7e('0x6c'),_0x9c7e('0x6d'));var _0x177970=path[_0x9c7e('0x6a')](config[_0x9c7e('0x6b')],_0x9c7e('0x6e'),_0x9c7e('0x6c'),'attachments');var _0x32a069=path[_0x9c7e('0x6a')](_0x39ea58,_0x2f591a);var _0x40c8a6=util[_0x9c7e('0x62')](_0x9c7e('0x6f'),_0x2f591a);var _0x3fe112=path[_0x9c7e('0x6a')](_0x39ea58,_0x40c8a6);var _0x19a766=![];return db[_0x9c7e('0x29')][_0x9c7e('0x55')]({'where':{'id':_0x59e670[_0x9c7e('0x52')]['id']},'include':[{'model':db[_0x9c7e('0x44')],'as':_0x9c7e('0x45'),'attributes':['id',_0x9c7e('0x58')],'include':[{'model':db[_0x9c7e('0x4a')],'as':_0x9c7e('0x4a'),'attributes':['id',_0x9c7e('0x4d')],'raw':!![]},{'model':db['CmContact'],'as':_0x9c7e('0x70'),'attributes':['id',_0x9c7e('0x71')],'raw':!![]}]}]})[_0x9c7e('0x24')](handleEntityNotFound(_0x35c248,null))[_0x9c7e('0x24')](function(_0x48033a){if(_0x48033a){_0x19a766=!![];var _0x200ac0='';var _0x498c37={'format':_0x9c7e('0x72'),'border':_0x9c7e('0x73')};fs['mkdirSync'](_0x32a069);_0x200ac0+=util['format'](_0x9c7e('0x74'),_0x48033a['id']);_0x200ac0+=util['format'](_0x9c7e('0x75'),moment()[_0x9c7e('0x62')](_0x9c7e('0x76'))[_0x9c7e('0x69')]());_0x200ac0+=_0x9c7e('0x77');for(var _0x4cdae9=0x0;_0x4cdae9<_0x48033a[_0x9c7e('0x45')][_0x9c7e('0x54')];_0x4cdae9++){var _0x1f7bff=_0x48033a[_0x9c7e('0x45')][_0x4cdae9];_0x200ac0+=_0x9c7e('0x78');_0x200ac0+=util[_0x9c7e('0x62')](_0x9c7e('0x79'),_0x1f7bff['User']?_0x1f7bff[_0x9c7e('0x4a')]['fullname']:_0x1f7bff[_0x9c7e('0x70')]['firstName'],_0x1f7bff[_0x9c7e('0x58')]);_0x200ac0+=_0x9c7e('0x7a');}return new BPromise(function(_0x28d950,_0x1e3c3a){pdf['create'](_0x200ac0,_0x498c37)[_0x9c7e('0x7b')](path[_0x9c7e('0x6a')](_0x32a069,_0x9c7e('0x7c')+_0x2f591a+_0x9c7e('0x7d')),function(_0x524422,_0x1cf300){if(_0x524422)return _0x1e3c3a(_0x524422);_0x28d950(_0x1cf300);});});}})[_0x9c7e('0x24')](function(){if(_0x19a766){return new BPromise(function(_0x1133ca,_0x1c1d30){zipdir(_0x32a069,{'saveTo':_0x3fe112},function(_0x463917,_0x37171d){if(_0x463917)return _0x1c1d30(_0x463917);return _0x1133ca(_0x37171d);});});}})[_0x9c7e('0x24')](function(){if(_0x19a766){return new BPromise(function(_0x4f0a20,_0x2e8909){rimraf(_0x32a069,function(_0xc1da46){if(_0xc1da46)_0x2e8909(_0xc1da46);return _0x4f0a20();});});}})['then'](function(){if(_0x19a766){return _0x35c248[_0x9c7e('0x67')](_0x3fe112,_0x40c8a6,function(_0xae206c){if(_0xae206c){console[_0x9c7e('0x7e')](_0x9c7e('0x7f'),_0xae206c);}else{fs['unlinkSync'](_0x3fe112);}});}else{return _0x35c248['sendStatus'](0xc8);}})[_0x9c7e('0x56')](handleError(_0x35c248,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 80bd015..673c3b1 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 _0x0037=['../../mysqldb','setMaxListeners','save','remove','emit','hook','events'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x0037,0x14f));var _0x7003=function(_0x42981c,_0x4b81a2){_0x42981c=_0x42981c-0x0;var _0x55749b=_0x0037[_0x42981c];return _0x55749b;};'use strict';var EventEmitter=require(_0x7003('0x0'));var SmsInteraction=require(_0x7003('0x1'))['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7003('0x2')](0x0);var events={'afterCreate':_0x7003('0x3'),'afterUpdate':'update','afterDestroy':_0x7003('0x4')};function emitEvent(_0x4d55d3){return function(_0xa42228,_0x3518f6,_0x2a8125){SmsInteractionEvents['emit'](_0x4d55d3+':'+_0xa42228['id'],_0xa42228);SmsInteractionEvents[_0x7003('0x5')](_0x4d55d3,_0xa42228);_0x2a8125(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x7003('0x6')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x6ac9=['../../mysqldb','SmsInteraction','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0x6ac9,0x6d));var _0x96ac=function(_0x3badab,_0x15aa01){_0x3badab=_0x3badab-0x0;var _0x2908f2=_0x6ac9[_0x3badab];return _0x2908f2;};'use strict';var EventEmitter=require(_0x96ac('0x0'));var SmsInteraction=require(_0x96ac('0x1'))['db'][_0x96ac('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x96ac('0x3'),'afterUpdate':_0x96ac('0x4'),'afterDestroy':_0x96ac('0x5')};function emitEvent(_0x1770f5){return function(_0xd62c1c,_0x19af13,_0xafa087){SmsInteractionEvents[_0x96ac('0x6')](_0x1770f5+':'+_0xd62c1c['id'],_0xd62c1c);SmsInteractionEvents[_0x96ac('0x6')](_0x1770f5,_0xd62c1c);_0xafa087(null);};}for(var e in events){if(events[_0x96ac('0x7')](e)){var event=events[e];SmsInteraction[_0x96ac('0x8')](e,emitEvent(event));}}module[_0x96ac('0x9')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 7f237ab..47e7a92 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 _0x48a7=['SmsInteraction','sms_interactions','changed','closedAt','format','util','../../config/logger','api','moment','request-promise','./smsInteraction.attributes','define'];(function(_0x3b69f9,_0x53443c){var _0x2caded=function(_0x5c18b3){while(--_0x5c18b3){_0x3b69f9['push'](_0x3b69f9['shift']());}};_0x2caded(++_0x53443c);}(_0x48a7,0x13d));var _0x748a=function(_0x4a6b97,_0x3f0f48){_0x4a6b97=_0x4a6b97-0x0;var _0x4a4d58=_0x48a7[_0x4a6b97];return _0x4a4d58;};'use strict';var _=require('lodash');var util=require(_0x748a('0x0'));var logger=require(_0x748a('0x1'))(_0x748a('0x2'));var moment=require(_0x748a('0x3'));var BPromise=require('bluebird');var rp=require(_0x748a('0x4'));var attributes=require(_0x748a('0x5'));module['exports']=function(_0x2ba071,_0x5e809c){return _0x2ba071[_0x748a('0x6')](_0x748a('0x7'),attributes,{'tableName':_0x748a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x307cc1,_0x3e0366,_0x43d6bc){if(_0x307cc1[_0x748a('0x9')]('closed')){_0x307cc1[_0x748a('0xa')]=moment()[_0x748a('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x43d6bc(null,_0x307cc1);}}});}; \ No newline at end of file +var _0x614f=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed'];(function(_0x534179,_0x369793){var _0x16be3a=function(_0x4e924a){while(--_0x4e924a){_0x534179['push'](_0x534179['shift']());}};_0x16be3a(++_0x369793);}(_0x614f,0x1c5));var _0xf614=function(_0x471a5a,_0x34c233){_0x471a5a=_0x471a5a-0x0;var _0x1b1af2=_0x614f[_0x471a5a];return _0x1b1af2;};'use strict';var _=require(_0xf614('0x0'));var util=require(_0xf614('0x1'));var logger=require(_0xf614('0x2'))(_0xf614('0x3'));var moment=require(_0xf614('0x4'));var BPromise=require(_0xf614('0x5'));var rp=require(_0xf614('0x6'));var attributes=require(_0xf614('0x7'));module[_0xf614('0x8')]=function(_0x3fa146,_0x42f080){return _0x3fa146['define'](_0xf614('0x9'),attributes,{'tableName':_0xf614('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x127f7b,_0x550a9e,_0x557a64){if(_0x127f7b[_0xf614('0xb')](_0xf614('0xc'))){_0x127f7b['closedAt']=moment()[_0xf614('0xd')](_0xf614('0xe'));}_0x557a64(null,_0x127f7b);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 57867bd..8b90ff1 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 _0xc3f6=['message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','then','debug','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0xc3f6,0x181));var _0x6c3f=function(_0x2a5ed,_0x19e228){_0x2a5ed=_0x2a5ed-0x0;var _0x4bf105=_0xc3f6[_0x2a5ed];return _0x4bf105;};'use strict';var _=require(_0x6c3f('0x0'));var util=require(_0x6c3f('0x1'));var moment=require(_0x6c3f('0x2'));var BPromise=require(_0x6c3f('0x3'));var rs=require(_0x6c3f('0x4'));var fs=require('fs');var Redis=require(_0x6c3f('0x5'));var db=require(_0x6c3f('0x6'))['db'];var utils=require(_0x6c3f('0x7'));var logger=require(_0x6c3f('0x8'))('rpc');var config=require(_0x6c3f('0x9'));var jayson=require(_0x6c3f('0xa'));var client=jayson[_0x6c3f('0xb')][_0x6c3f('0xc')]({'port':0x232a});config[_0x6c3f('0xd')]=_[_0x6c3f('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c3f('0xd')]));require(_0x6c3f('0xf'))[_0x6c3f('0x10')](socket);function respondWithRpcPromise(_0x5b73ca,_0x519a02,_0x4aad51){return new BPromise(function(_0x446b20,_0x36fb30){return client[_0x6c3f('0x11')](_0x5b73ca,_0x4aad51)['then'](function(_0x42e9d7){logger[_0x6c3f('0x12')](_0x6c3f('0x13'),_0x519a02,'request\x20sent');logger['debug'](_0x6c3f('0x14'),_0x519a02,_0x6c3f('0x15'),JSON[_0x6c3f('0x16')](_0x42e9d7));if(_0x42e9d7['error']){if(_0x42e9d7[_0x6c3f('0x17')][_0x6c3f('0x18')]===0x1f4){logger[_0x6c3f('0x17')](_0x6c3f('0x13'),_0x519a02,_0x42e9d7[_0x6c3f('0x17')][_0x6c3f('0x19')]);return _0x36fb30(_0x42e9d7[_0x6c3f('0x17')][_0x6c3f('0x19')]);}logger[_0x6c3f('0x17')](_0x6c3f('0x13'),_0x519a02,_0x42e9d7[_0x6c3f('0x17')][_0x6c3f('0x19')]);return _0x446b20(_0x42e9d7[_0x6c3f('0x17')][_0x6c3f('0x19')]);}else{logger[_0x6c3f('0x12')](_0x6c3f('0x13'),_0x519a02,_0x6c3f('0x15'));_0x446b20(_0x42e9d7['result'][_0x6c3f('0x19')]);}})[_0x6c3f('0x1a')](function(_0x3fa392){logger['error'](_0x6c3f('0x13'),_0x519a02,_0x3fa392);_0x36fb30(_0x3fa392);});});}exports[_0x6c3f('0x1b')]=function(_0x2ba657){var _0x20cd0a=this;return new Promise(function(_0x38f5c5,_0x56504e){return db[_0x6c3f('0x1c')][_0x6c3f('0x1d')](_0x2ba657[_0x6c3f('0x1e')],{'raw':_0x2ba657[_0x6c3f('0x1f')]?_0x2ba657[_0x6c3f('0x1f')][_0x6c3f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ba657['options']?_0x2ba657[_0x6c3f('0x1f')][_0x6c3f('0x21')]||null:null,'attributes':_0x2ba657['options']?_0x2ba657[_0x6c3f('0x1f')][_0x6c3f('0x22')]||null:null,'limit':_0x2ba657[_0x6c3f('0x1f')]?_0x2ba657['options']['limit']||null:null})[_0x6c3f('0x23')](function(_0x5d8472){logger[_0x6c3f('0x12')](_0x6c3f('0x1b'),_0x2ba657);logger[_0x6c3f('0x24')](_0x6c3f('0x1b'),_0x2ba657,JSON[_0x6c3f('0x16')](_0x5d8472));_0x38f5c5(_0x5d8472);})[_0x6c3f('0x1a')](function(_0x7c636d){logger[_0x6c3f('0x17')](_0x6c3f('0x1b'),_0x7c636d[_0x6c3f('0x19')],_0x2ba657);_0x56504e(_0x20cd0a['error'](0x1f4,_0x7c636d[_0x6c3f('0x19')]));});});};exports['AddTagsToSmsInteraction']=function(_0xcdb9b6){return new Promise(function(_0x4e9d46,_0x5bfac3){return db[_0x6c3f('0x1c')]['find']({'where':_0xcdb9b6[_0x6c3f('0x1f')]?_0xcdb9b6[_0x6c3f('0x1f')][_0x6c3f('0x21')]||null:null})[_0x6c3f('0x23')](function(_0xe8086){if(_0xe8086){return _0xe8086[_0x6c3f('0x25')](_0xcdb9b6[_0x6c3f('0x1e')]['ids'],_[_0x6c3f('0x26')](_0xcdb9b6[_0x6c3f('0x1e')],[_0x6c3f('0x27'),'id'])||{});}})['spread'](function(_0x2ceeab){logger[_0x6c3f('0x12')](_0x6c3f('0x28'),_0xcdb9b6);logger[_0x6c3f('0x24')]('AddTags',_0xcdb9b6,JSON[_0x6c3f('0x16')](_0x2ceeab));_0x4e9d46(_0x2ceeab);})[_0x6c3f('0x1a')](function(_0x51c594){logger[_0x6c3f('0x17')](_0x6c3f('0x28'),_0x51c594[_0x6c3f('0x19')],_0xcdb9b6);_0x5bfac3(_this[_0x6c3f('0x17')](0x1f4,_0x51c594[_0x6c3f('0x19')]));});});}; \ No newline at end of file +var _0xadf5=['error','code','message','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','stringify','catch','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x53579e,_0x12dff0){var _0x451010=function(_0x298801){while(--_0x298801){_0x53579e['push'](_0x53579e['shift']());}};_0x451010(++_0x12dff0);}(_0xadf5,0x1ee));var _0x5adf=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0xadf5[_0x18afca];return _0x11603f;};'use strict';var _=require('lodash');var util=require(_0x5adf('0x0'));var moment=require('moment');var BPromise=require(_0x5adf('0x1'));var rs=require(_0x5adf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5adf('0x3'))['db'];var utils=require(_0x5adf('0x4'));var logger=require('../../config/logger')(_0x5adf('0x5'));var config=require(_0x5adf('0x6'));var jayson=require(_0x5adf('0x7'));var client=jayson[_0x5adf('0x8')][_0x5adf('0x9')]({'port':0x232a});config['redis']=_[_0x5adf('0xa')](config[_0x5adf('0xb')],{'host':_0x5adf('0xc'),'port':0x18eb});var socket=require(_0x5adf('0xd'))(new Redis(config[_0x5adf('0xb')]));require(_0x5adf('0xe'))[_0x5adf('0xf')](socket);function respondWithRpcPromise(_0x14e3b4,_0xb5affa,_0x481ad0){return new BPromise(function(_0x3b1dc6,_0x362735){return client['request'](_0x14e3b4,_0x481ad0)[_0x5adf('0x10')](function(_0x2f062e){logger[_0x5adf('0x11')](_0x5adf('0x12'),_0xb5affa,_0x5adf('0x13'));logger[_0x5adf('0x14')](_0x5adf('0x15'),_0xb5affa,_0x5adf('0x13'),JSON['stringify'](_0x2f062e));if(_0x2f062e[_0x5adf('0x16')]){if(_0x2f062e[_0x5adf('0x16')][_0x5adf('0x17')]===0x1f4){logger['error'](_0x5adf('0x12'),_0xb5affa,_0x2f062e[_0x5adf('0x16')][_0x5adf('0x18')]);return _0x362735(_0x2f062e[_0x5adf('0x16')][_0x5adf('0x18')]);}logger[_0x5adf('0x16')]('SmsInteraction,\x20%s,\x20%s',_0xb5affa,_0x2f062e[_0x5adf('0x16')]['message']);return _0x3b1dc6(_0x2f062e[_0x5adf('0x16')][_0x5adf('0x18')]);}else{logger[_0x5adf('0x11')](_0x5adf('0x12'),_0xb5affa,_0x5adf('0x13'));_0x3b1dc6(_0x2f062e[_0x5adf('0x19')]['message']);}})['catch'](function(_0x3c6837){logger[_0x5adf('0x16')](_0x5adf('0x12'),_0xb5affa,_0x3c6837);_0x362735(_0x3c6837);});});}exports[_0x5adf('0x1a')]=function(_0x1ed951){var _0x27bbbf=this;return new Promise(function(_0x45e359,_0x1c1b92){return db[_0x5adf('0x1b')]['update'](_0x1ed951[_0x5adf('0x1c')],{'raw':_0x1ed951[_0x5adf('0x1d')]?_0x1ed951[_0x5adf('0x1d')][_0x5adf('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed951[_0x5adf('0x1d')]?_0x1ed951[_0x5adf('0x1d')][_0x5adf('0x1f')]||null:null,'attributes':_0x1ed951[_0x5adf('0x1d')]?_0x1ed951['options'][_0x5adf('0x20')]||null:null,'limit':_0x1ed951[_0x5adf('0x1d')]?_0x1ed951[_0x5adf('0x1d')][_0x5adf('0x21')]||null:null})[_0x5adf('0x10')](function(_0x2de340){logger['info'](_0x5adf('0x1a'),_0x1ed951);logger['debug'](_0x5adf('0x1a'),_0x1ed951,JSON[_0x5adf('0x22')](_0x2de340));_0x45e359(_0x2de340);})[_0x5adf('0x23')](function(_0x4b82f7){logger[_0x5adf('0x16')](_0x5adf('0x1a'),_0x4b82f7[_0x5adf('0x18')],_0x1ed951);_0x1c1b92(_0x27bbbf[_0x5adf('0x16')](0x1f4,_0x4b82f7[_0x5adf('0x18')]));});});};exports[_0x5adf('0x24')]=function(_0x28115b){return new Promise(function(_0x1f6f53,_0x47c81d){return db[_0x5adf('0x1b')][_0x5adf('0x25')]({'where':_0x28115b[_0x5adf('0x1d')]?_0x28115b['options']['where']||null:null})[_0x5adf('0x10')](function(_0x351fe4){if(_0x351fe4){return _0x351fe4[_0x5adf('0x26')](_0x28115b['body'][_0x5adf('0x27')],_[_0x5adf('0x28')](_0x28115b[_0x5adf('0x1c')],['ids','id'])||{});}})[_0x5adf('0x29')](function(_0x3aff95){logger['info'](_0x5adf('0x2a'),_0x28115b);logger[_0x5adf('0x14')]('AddTags',_0x28115b,JSON['stringify'](_0x3aff95));_0x1f6f53(_0x3aff95);})['catch'](function(_0x59b6e4){logger[_0x5adf('0x16')](_0x5adf('0x2a'),_0x59b6e4[_0x5adf('0x18')],_0x28115b);_0x47c81d(_this[_0x5adf('0x16')](0x1f4,_0x59b6e4[_0x5adf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 5d170fa..5ee41d1 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 _0x0a16=['./smsInteraction.events','save','remove','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x3de690,_0x156120){var _0x1ea832=function(_0x4ec7f){while(--_0x4ec7f){_0x3de690['push'](_0x3de690['shift']());}};_0x1ea832(++_0x156120);}(_0x0a16,0x10e));var _0x60a1=function(_0x2d5c8f,_0x1be1e3){_0x2d5c8f=_0x2d5c8f-0x0;var _0x205919=_0x0a16[_0x2d5c8f];return _0x205919;};'use strict';var SmsInteractionEvents=require(_0x60a1('0x0'));var events=[_0x60a1('0x1'),_0x60a1('0x2'),_0x60a1('0x3')];function createListener(_0x152028,_0x5751ea){return function(_0x28ca4c){_0x5751ea[_0x60a1('0x4')](_0x152028,_0x28ca4c);};}function removeListener(_0x461532,_0x1b4ba4){return function(){SmsInteractionEvents[_0x60a1('0x5')](_0x461532,_0x1b4ba4);};}exports[_0x60a1('0x6')]=function(_0x170ea6){for(var _0x537fb7=0x0,_0x4f7998=events[_0x60a1('0x7')];_0x537fb7<_0x4f7998;_0x537fb7++){var _0x282ade=events[_0x537fb7];var _0x425439=createListener(_0x60a1('0x8')+_0x282ade,_0x170ea6);SmsInteractionEvents['on'](_0x282ade,_0x425439);}}; \ No newline at end of file +var _0x7aba=['emit','removeListener','length','smsInteraction:','remove','update'];(function(_0x476f99,_0x1c9224){var _0x248f96=function(_0xe1e1b9){while(--_0xe1e1b9){_0x476f99['push'](_0x476f99['shift']());}};_0x248f96(++_0x1c9224);}(_0x7aba,0x1ba));var _0xa7ab=function(_0x5336a9,_0x2cc7c3){_0x5336a9=_0x5336a9-0x0;var _0x4aa638=_0x7aba[_0x5336a9];return _0x4aa638;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xa7ab('0x0'),_0xa7ab('0x1')];function createListener(_0x45cd77,_0x480538){return function(_0x18606a){_0x480538[_0xa7ab('0x2')](_0x45cd77,_0x18606a);};}function removeListener(_0x41de9c,_0x562628){return function(){SmsInteractionEvents[_0xa7ab('0x3')](_0x41de9c,_0x562628);};}exports['register']=function(_0xc6e6b2){for(var _0x2323f2=0x0,_0x2805f4=events[_0xa7ab('0x4')];_0x2323f2<_0x2805f4;_0x2323f2++){var _0x51613f=events[_0x2323f2];var _0x1a8734=createListener(_0xa7ab('0x5')+_0x51613f,_0xc6e6b2);SmsInteractionEvents['on'](_0x51613f,_0x1a8734);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 88b41ef..2842d1b 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 _0x795e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','status','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x795e,0x177));var _0xe795=function(_0x6b763a,_0x3975fe){_0x6b763a=_0x6b763a-0x0;var _0x54d2a3=_0x795e[_0x6b763a];return _0x54d2a3;};'use strict';var multer=require(_0xe795('0x0'));var util=require(_0xe795('0x1'));var path=require(_0xe795('0x2'));var timeout=require(_0xe795('0x3'));var express=require(_0xe795('0x4'));var router=express[_0xe795('0x5')]();var auth=require(_0xe795('0x6'));var interaction=require(_0xe795('0x7'));var config=require('../../config/environment');var controller=require(_0xe795('0x8'));router[_0xe795('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe795('0x9')]('/describe',auth[_0xe795('0xa')](),controller[_0xe795('0xb')]);router[_0xe795('0x9')](_0xe795('0xc'),auth[_0xe795('0xa')](),controller[_0xe795('0xd')]);router[_0xe795('0xe')]('/',auth['isAuthenticated'](),interaction[_0xe795('0xf')](_0xe795('0x10'),_0xe795('0x11')),controller[_0xe795('0x12')]);router['post']('/:id/status',controller[_0xe795('0x13')]);router[_0xe795('0x14')](_0xe795('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe795('0x14')](_0xe795('0x15'),auth['isAuthenticated'](),controller[_0xe795('0x16')]);router['put'](_0xe795('0x17'),auth['isAuthenticated'](),controller[_0xe795('0x18')]);router['delete'](_0xe795('0xc'),auth[_0xe795('0xa')](),controller[_0xe795('0x19')]);module[_0xe795('0x1a')]=router; \ No newline at end of file +var _0x2a78=['get','index','/describe','isAuthenticated','/:id','show','sms','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./smsMessage.controller'];(function(_0x5ba513,_0x459c3b){var _0x1132a0=function(_0x2fe943){while(--_0x2fe943){_0x5ba513['push'](_0x5ba513['shift']());}};_0x1132a0(++_0x459c3b);}(_0x2a78,0x1e7));var _0x82a7=function(_0x411a57,_0x569f06){_0x411a57=_0x411a57-0x0;var _0x482ac9=_0x2a78[_0x411a57];return _0x482ac9;};'use strict';var multer=require(_0x82a7('0x0'));var util=require(_0x82a7('0x1'));var path=require('path');var timeout=require(_0x82a7('0x2'));var express=require(_0x82a7('0x3'));var router=express['Router']();var auth=require(_0x82a7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x82a7('0x5'));var controller=require(_0x82a7('0x6'));router[_0x82a7('0x7')]('/',auth['isAuthenticated'](),controller[_0x82a7('0x8')]);router[_0x82a7('0x7')](_0x82a7('0x9'),auth[_0x82a7('0xa')](),controller['describe']);router['get'](_0x82a7('0xb'),auth[_0x82a7('0xa')](),controller[_0x82a7('0xc')]);router['post']('/',auth[_0x82a7('0xa')](),interaction['tracked'](_0x82a7('0xd'),_0x82a7('0xe')),controller[_0x82a7('0xf')]);router[_0x82a7('0x10')](_0x82a7('0x11'),controller[_0x82a7('0x12')]);router[_0x82a7('0x13')]('/:id',auth[_0x82a7('0xa')](),controller[_0x82a7('0x14')]);router[_0x82a7('0x13')](_0x82a7('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0x82a7('0x13')](_0x82a7('0x16'),auth[_0x82a7('0xa')](),controller['reject']);router[_0x82a7('0x17')](_0x82a7('0xb'),auth[_0x82a7('0xa')](),controller[_0x82a7('0x18')]);module[_0x82a7('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 05750f9..e8e60b2 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 _0x56da=['BOOLEAN','sequelize','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x156e60,_0x18ef4b){var _0xe8a8e3=function(_0x3960ea){while(--_0x3960ea){_0x156e60['push'](_0x156e60['shift']());}};_0xe8a8e3(++_0x18ef4b);}(_0x56da,0x119));var _0xa56d=function(_0x57bb3a,_0x237ede){_0x57bb3a=_0x57bb3a-0x0;var _0x5decaa=_0x56da[_0x57bb3a];return _0x5decaa;};'use strict';var Sequelize=require(_0xa56d('0x0'));module['exports']={'body':{'type':Sequelize[_0xa56d('0x1')](_0xa56d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa56d('0x3')]('in',_0xa56d('0x4')),'defaultValue':_0xa56d('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa56d('0x5')](0xbe)},'phone':{'type':Sequelize[_0xa56d('0x5')]},'readAt':{'type':Sequelize[_0xa56d('0x6')]},'secret':{'type':Sequelize[_0xa56d('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x8efc=['BOOLEAN','out','DATE','TEXT'];(function(_0x3e25bc,_0x1b01f3){var _0x345958=function(_0x289e7e){while(--_0x289e7e){_0x3e25bc['push'](_0x3e25bc['shift']());}};_0x345958(++_0x1b01f3);}(_0x8efc,0x8f));var _0xc8ef=function(_0x6622a2,_0x401a17){_0x6622a2=_0x6622a2-0x0;var _0x52252e=_0x8efc[_0x6622a2];return _0x52252e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xc8ef('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc8ef('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc8ef('0x2')),'defaultValue':_0xc8ef('0x2'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xc8ef('0x3')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index b57b0d9..ae3087b 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 _0x187d=['received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','plivio','results','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','register','jayson/promise','http','client','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','sendStatus','name','SmsMessage','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','update','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','rejectMessage','interface','event','rejectmessage','SmsAccountId'];(function(_0x27e5be,_0x44ec00){var _0x29465e=function(_0x5292f0){while(--_0x5292f0){_0x27e5be['push'](_0x27e5be['shift']());}};_0x29465e(++_0x44ec00);}(_0x187d,0x93));var _0xd187=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x187d[_0x45e98e];return _0x374dba;};'use strict';var pdf=require(_0xd187('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd187('0x1'));var zipdir=require(_0xd187('0x2'));var jsonpatch=require(_0xd187('0x3'));var rp=require(_0xd187('0x4'));var moment=require(_0xd187('0x5'));var BPromise=require(_0xd187('0x6'));var Mustache=require('mustache');var util=require(_0xd187('0x7'));var path=require(_0xd187('0x8'));var sox=require('sox');var csv=require(_0xd187('0x9'));var ejs=require(_0xd187('0xa'));var fs=require('fs');var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x9'));var querystring=require('querystring');var Papa=require(_0xd187('0x10'));var authService=require(_0xd187('0x11'));var hardwareService=require(_0xd187('0x12'));var Redis=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var logger=require(_0xd187('0x15'))('api');var utils=require(_0xd187('0x16'));var config=require(_0xd187('0x17'));var db=require(_0xd187('0x18'))['db'];config['redis']=_[_0xd187('0x19')](config[_0xd187('0x1a')],{'host':_0xd187('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd187('0x1a')]));require(_0xd187('0x1c'))[_0xd187('0x1d')](socket);var jayson=require(_0xd187('0x1e'));var client=jayson['client'][_0xd187('0x1f')]({'port':0x232c});var client9002=jayson[_0xd187('0x20')][_0xd187('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x188cfe,_0x4c8f68,_0x245d3e,_0x52a208){return new BPromise(function(_0x5cf218,_0x40ed84){var _0x5a4986=_0x52a208||client;return _0x5a4986['request'](_0x188cfe,_0x245d3e)[_0xd187('0x21')](function(_0x2b3290){logger[_0xd187('0x22')](_0xd187('0x23'),_0x4c8f68,_0xd187('0x24'));logger[_0xd187('0x25')](_0xd187('0x26'),_0x4c8f68,_0xd187('0x24'),JSON[_0xd187('0x27')](_0x2b3290));if(_0x2b3290[_0xd187('0x28')]){if(_0x2b3290[_0xd187('0x28')][_0xd187('0x29')]===0x1f4){logger[_0xd187('0x28')]('SmsMessage,\x20%s,\x20%s',_0x4c8f68,_0x2b3290[_0xd187('0x28')][_0xd187('0x2a')]);return _0x40ed84(_0x2b3290[_0xd187('0x28')]['message']);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x4c8f68,_0x2b3290[_0xd187('0x28')][_0xd187('0x2a')]);return _0x5cf218(_0x2b3290[_0xd187('0x28')]['message']);}else{logger[_0xd187('0x22')]('SmsMessage,\x20%s,\x20%s',_0x4c8f68,_0xd187('0x24'));_0x5cf218(_0x2b3290['result'][_0xd187('0x2a')]);}})['catch'](function(_0x4f3879){logger[_0xd187('0x28')]('SmsMessage,\x20%s,\x20%s',_0x4c8f68,_0x4f3879);_0x40ed84(_0x4f3879);});});}function respondWithStatusCode(_0x12da33,_0x598aa4){_0x598aa4=_0x598aa4||0xcc;return function(_0x4ace17){if(_0x4ace17){return _0x12da33['sendStatus'](_0x598aa4);}return _0x12da33[_0xd187('0x2b')](_0x598aa4)[_0xd187('0x2c')]();};}function respondWithResult(_0x43079f,_0x4a7f6f){_0x4a7f6f=_0x4a7f6f||0xc8;return function(_0x5cf19a){if(_0x5cf19a){return _0x43079f[_0xd187('0x2b')](_0x4a7f6f)[_0xd187('0x2d')](_0x5cf19a);}};}function respondWithFilteredResult(_0x5c8e52,_0x3e9971){return function(_0x1c87ee){if(_0x1c87ee){var _0x34febe=_0x1c87ee[_0xd187('0x2e')],_0x4c50a5=_0x3e9971[_0xd187('0x2f')],_0x15e2e8=_0x3e9971[_0xd187('0x2f')]+_0x3e9971[_0xd187('0x30')],_0x56e292;if(_0x15e2e8>=_0x34febe){_0x15e2e8=_0x34febe;_0x56e292=0xc8;}else{_0x56e292=0xce;}_0x5c8e52['status'](_0x56e292);return _0x5c8e52[_0xd187('0x31')](_0xd187('0x32'),_0x4c50a5+'-'+_0x15e2e8+'/'+_0x34febe)['json'](_0x1c87ee);}return null;};}function patchUpdates(_0x4cc587){return function(_0x1a1922){try{jsonpatch[_0xd187('0x33')](_0x1a1922,_0x4cc587,!![]);}catch(_0x13f285){return BPromise[_0xd187('0x34')](_0x13f285);}return _0x1a1922[_0xd187('0x35')]();};}function saveUpdates(_0x2d8843,_0x3dc7f2){return function(_0x4713df){if(_0x4713df){return _0x4713df['update'](_0x2d8843)[_0xd187('0x21')](function(_0x9e5b1){return _0x9e5b1;});}return null;};}function removeEntity(_0x21cd12,_0x5e2f2e){return function(_0x22d84b){if(_0x22d84b){return _0x22d84b['destroy']()[_0xd187('0x21')](function(){_0x21cd12[_0xd187('0x2b')](0xcc)[_0xd187('0x2c')]();});}};}function handleEntityNotFound(_0x4d9d97,_0x49cf57){return function(_0x236ca4){if(!_0x236ca4){_0x4d9d97[_0xd187('0x36')](0x194);}return _0x236ca4;};}function handleError(_0x549c6a,_0x4591e0){_0x4591e0=_0x4591e0||0x1f4;return function(_0xa54b9e){logger[_0xd187('0x28')](_0xa54b9e['stack']);if(_0xa54b9e['name']){delete _0xa54b9e[_0xd187('0x37')];}_0x549c6a[_0xd187('0x2b')](_0x4591e0)['send'](_0xa54b9e);};}exports['index']=function(_0x57d10e,_0x31d7f4){var _0x578f87={},_0x28c252={},_0x35c381={'count':0x0,'rows':[]};var _0x5728be=db[_0xd187('0x38')]['rawAttributes'];_0x28c252[_0xd187('0x39')]=_[_0xd187('0x3a')](_0x5728be);_0x28c252['query']=_[_0xd187('0x3a')](_0x57d10e[_0xd187('0x3b')]);_0x28c252['filters']=_[_0xd187('0x3c')](_0x28c252['model'],_0x28c252['query']);_0x578f87[_0xd187('0x3d')]=_[_0xd187('0x3c')](_0x28c252[_0xd187('0x39')],qs[_0xd187('0x3e')](_0x57d10e[_0xd187('0x3b')]['fields']));_0x578f87[_0xd187('0x3d')]=_0x578f87[_0xd187('0x3d')][_0xd187('0x3f')]?_0x578f87['attributes']:_0x28c252['model'];if(!_0x57d10e['query']['hasOwnProperty'](_0xd187('0x40'))){_0x578f87[_0xd187('0x30')]=qs[_0xd187('0x30')](_0x57d10e[_0xd187('0x3b')][_0xd187('0x30')]);_0x578f87[_0xd187('0x2f')]=qs[_0xd187('0x2f')](_0x57d10e[_0xd187('0x3b')]['offset']);}_0x578f87[_0xd187('0x41')]=qs[_0xd187('0x42')](_0x57d10e[_0xd187('0x3b')]['sort']);_0x578f87[_0xd187('0x43')]=qs['filters'](_[_0xd187('0x44')](_0x57d10e[_0xd187('0x3b')],_0x28c252[_0xd187('0x45')]));if(_0x57d10e[_0xd187('0x3b')][_0xd187('0x46')]){_0x578f87['where']=_[_0xd187('0x47')](_0x578f87[_0xd187('0x43')],{'$or':_[_0xd187('0x48')](_0x5728be,function(_0x3fa19c){if(_0x3fa19c['type'][_0xd187('0x49')]!==_0xd187('0x4a')){var _0x5e765b={};_0x5e765b[_0x3fa19c[_0xd187('0x4b')]]={'$like':'%'+_0x57d10e[_0xd187('0x3b')]['filter']+'%'};return _0x5e765b;}})});}_0x578f87=_['merge']({},_0x578f87,_0x57d10e[_0xd187('0x4c')]);var _0x5b5d25={'where':_0x578f87['where']};return db['SmsMessage']['count'](_0x5b5d25)[_0xd187('0x21')](function(_0x358a72){_0x35c381[_0xd187('0x2e')]=_0x358a72;if(_0x57d10e[_0xd187('0x3b')][_0xd187('0x4d')]){_0x578f87[_0xd187('0x4e')]=[{'all':!![]}];}return db[_0xd187('0x38')]['findAll'](_0x578f87);})[_0xd187('0x21')](function(_0x12784c){_0x35c381[_0xd187('0x4f')]=_0x12784c;return _0x35c381;})[_0xd187('0x21')](respondWithFilteredResult(_0x31d7f4,_0x578f87))[_0xd187('0x50')](handleError(_0x31d7f4,null));};exports[_0xd187('0x51')]=function(_0x10c0f5,_0x3400a0){var _0x4e4a32={'raw':!![],'where':{'id':_0x10c0f5[_0xd187('0x52')]['id']}},_0x368348={};_0x368348[_0xd187('0x39')]=_[_0xd187('0x3a')](db[_0xd187('0x38')]['rawAttributes']);_0x368348[_0xd187('0x3b')]=_[_0xd187('0x3a')](_0x10c0f5['query']);_0x368348[_0xd187('0x45')]=_[_0xd187('0x3c')](_0x368348['model'],_0x368348['query']);_0x4e4a32['attributes']=_['intersection'](_0x368348[_0xd187('0x39')],qs[_0xd187('0x3e')](_0x10c0f5[_0xd187('0x3b')][_0xd187('0x3e')]));_0x4e4a32[_0xd187('0x3d')]=_0x4e4a32[_0xd187('0x3d')][_0xd187('0x3f')]?_0x4e4a32['attributes']:_0x368348[_0xd187('0x39')];if(_0x10c0f5[_0xd187('0x3b')][_0xd187('0x4d')]){_0x4e4a32[_0xd187('0x4e')]=[{'all':!![]}];}_0x4e4a32=_['merge']({},_0x4e4a32,_0x10c0f5[_0xd187('0x4c')]);return db['SmsMessage']['find'](_0x4e4a32)[_0xd187('0x21')](handleEntityNotFound(_0x3400a0,null))['then'](respondWithResult(_0x3400a0,null))[_0xd187('0x50')](handleError(_0x3400a0,null));};exports[_0xd187('0x53')]=function(_0x260be7,_0x4430b8){return db[_0xd187('0x38')][_0xd187('0x53')](_0x260be7[_0xd187('0x54')],{})[_0xd187('0x21')](respondWithResult(_0x4430b8,0xc9))[_0xd187('0x50')](handleError(_0x4430b8,null));};exports['update']=function(_0x247583,_0x298a34){if(_0x247583['body']['id']){delete _0x247583[_0xd187('0x54')]['id'];}return db[_0xd187('0x38')][_0xd187('0x55')]({'where':{'id':_0x247583['params']['id']}})[_0xd187('0x21')](handleEntityNotFound(_0x298a34,null))[_0xd187('0x21')](saveUpdates(_0x247583['body'],null))[_0xd187('0x21')](respondWithResult(_0x298a34,null))[_0xd187('0x50')](handleError(_0x298a34,null));};exports['destroy']=function(_0x456abb,_0x588f4b){return db[_0xd187('0x38')][_0xd187('0x55')]({'where':{'id':_0x456abb[_0xd187('0x52')]['id']}})[_0xd187('0x21')](handleEntityNotFound(_0x588f4b,null))[_0xd187('0x21')](removeEntity(_0x588f4b,null))[_0xd187('0x50')](handleError(_0x588f4b,null));};exports[_0xd187('0x56')]=function(_0x4eddd5,_0xcef6ca){return db[_0xd187('0x38')][_0xd187('0x56')]()['then'](respondWithResult(_0xcef6ca,null))[_0xd187('0x50')](handleError(_0xcef6ca,null));};var interaction_log=require(_0xd187('0x15'))(_0xd187('0x57'));exports[_0xd187('0x58')]=function(_0x236c51,_0x2c4f4d,_0x10ebf4){var _0x202f73={'channel':_0xd187('0x59')};if(_0x236c51[_0xd187('0x54')]['id']){delete _0x236c51[_0xd187('0x54')]['id'];}_0x236c51[_0xd187('0x54')][_0xd187('0x5a')]=!![];_0x236c51[_0xd187('0x54')][_0xd187('0x5b')]=moment()[_0xd187('0x5c')](_0xd187('0x5d'));_0x236c51[_0xd187('0x54')][_0xd187('0x5e')]=_0x236c51[_0xd187('0x54')]['UserId']||_0x236c51[_0xd187('0x5f')]['id'];return db['SmsMessage'][_0xd187('0x55')]({'where':{'id':_0x236c51[_0xd187('0x52')]['id'],'UserId':null},'include':[{'model':db[_0xd187('0x60')],'as':_0xd187('0x61')}]})['then'](handleEntityNotFound(_0x2c4f4d,null))[_0xd187('0x21')](saveUpdates(_0x236c51[_0xd187('0x54')],null))['then'](function(_0x509815){if(_0x509815){_0x202f73[_0xd187('0x2a')]=_0x509815[_0xd187('0x62')]({'plain':!![]});return db[_0xd187('0x63')][_0xd187('0x55')]({'where':{'id':_0x509815['SmsInteractionId']}});}return null;})[_0xd187('0x21')](handleEntityNotFound(_0x2c4f4d,null))['then'](function(_0x1971b2){if(_0x1971b2){return _0x1971b2[_0xd187('0x64')]({'UserId':_0x236c51[_0xd187('0x54')][_0xd187('0x5e')],'read1stAt':_['isNil'](_0x1971b2[_0xd187('0x65')])?moment()[_0xd187('0x5c')](_0xd187('0x5d')):undefined});}return null;})[_0xd187('0x21')](function(_0x151f3c){if(_0x151f3c){_0x202f73['interaction']=_0x151f3c['get']({'plain':!![]});interaction_log[_0xd187('0x22')](_0xd187('0x66'),_0x236c51[_0xd187('0x5f')]['id'],_0x236c51[_0xd187('0x5f')][_0xd187('0x37')],_0x236c51[_0xd187('0x5f')][_0xd187('0x67')],_0x202f73[_0xd187('0x68')]['id'],_0x236c51[_0xd187('0x54')]?JSON[_0xd187('0x27')](_0x236c51[_0xd187('0x54')]):_0xd187('0x69'));return respondWithRpcPromise('AcceptMessage',_0xd187('0x6a'),_0x202f73);}return null;})[_0xd187('0x21')](function(_0x54e908){if(_0x54e908){if(_0x236c51[_0xd187('0x54')][_0xd187('0x6b')]){_0x202f73['message']['interface']=util[_0xd187('0x5c')](_0xd187('0x6c'),_0x236c51[_0xd187('0x5f')][_0xd187('0x37')]);_0x202f73['message'][_0xd187('0x6d')]=_0x202f73[_0xd187('0x6d')];_0x202f73['message']['event']=_0xd187('0x58');return respondWithRpcPromise('EventManager',_0xd187('0x6e'),{'event':_0xd187('0x6f'),'message':_0x202f73['message']},client9002)[_0xd187('0x21')](function(){return _0x202f73;});}return _0x202f73;}return null;})['then'](respondWithResult(_0x2c4f4d,null))[_0xd187('0x50')](handleError(_0x2c4f4d,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports['reject']=function(_0x16d9ea,_0x243063,_0x421585){var _0x216829={'agent':{},'channel':_0xd187('0x59')};if(_0x16d9ea[_0xd187('0x54')]['id']){delete _0x16d9ea[_0xd187('0x54')]['id'];}_0x16d9ea[_0xd187('0x54')]['UserId']=_0x16d9ea[_0xd187('0x54')][_0xd187('0x5e')]||_0x16d9ea[_0xd187('0x5f')]['id'];_0x216829['agent']['id']=_0x16d9ea[_0xd187('0x54')][_0xd187('0x5e')];return db[_0xd187('0x38')][_0xd187('0x55')]({'where':{'id':_0x16d9ea['params']['id'],'UserId':null}})[_0xd187('0x21')](handleEntityNotFound(_0x243063,null))[_0xd187('0x21')](function(_0x4c3255){if(_0x4c3255){_0x216829[_0xd187('0x2a')]=_0x4c3255[_0xd187('0x62')]({'plain':!![]});return db[_0xd187('0x63')][_0xd187('0x55')]({'where':{'id':_0x4c3255['SmsInteractionId']}});}return null;})[_0xd187('0x21')](handleEntityNotFound(_0x243063,null))[_0xd187('0x21')](function(_0x4e9338){if(_0x4e9338){_0x216829[_0xd187('0x68')]=_0x4e9338['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x16d9ea[_0xd187('0x5f')]['id'],_0x16d9ea[_0xd187('0x5f')][_0xd187('0x37')],_0x16d9ea[_0xd187('0x5f')][_0xd187('0x67')],_0x216829[_0xd187('0x68')]['id'],_0x16d9ea['body']?JSON[_0xd187('0x27')](_0x16d9ea[_0xd187('0x54')]):'null');return respondWithRpcPromise('RejectMessage',_0xd187('0x70'),_0x216829);}return null;})[_0xd187('0x21')](function(_0xaf156f){if(_0xaf156f){_0xaf156f[_0xd187('0x2a')][_0xd187('0x71')]=util[_0xd187('0x5c')]('SIP/%s',_0x16d9ea[_0xd187('0x5f')][_0xd187('0x37')]);_0xaf156f[_0xd187('0x2a')][_0xd187('0x6d')]=_0x216829[_0xd187('0x6d')];_0xaf156f[_0xd187('0x2a')][_0xd187('0x72')]=_0xd187('0x34');respondWithRpcPromise(_0xd187('0x6e'),_0xd187('0x6e'),{'event':_0xd187('0x73'),'message':_0xaf156f[_0xd187('0x2a')]},client9002);return _0x216829;}return null;})['then'](respondWithResult(_0x243063,null))['catch'](handleError(_0x243063,null));};exports[_0xd187('0x2b')]=function(_0x2b2c64,_0x3c611d,_0x147c96){if(_0x2b2c64[_0xd187('0x54')]['id']){delete _0x2b2c64[_0xd187('0x54')]['id'];}var _0x4dc675;return db[_0xd187('0x38')]['find']({'where':{'id':_0x2b2c64[_0xd187('0x52')]['id']}})['then'](handleEntityNotFound(_0x3c611d,null))['then'](function(_0x304117){if(_0x304117){_0x4dc675=_0x304117;return db['SmsAccount'][_0xd187('0x55')]({'where':{'id':_0x304117[_0xd187('0x74')]}});}})[_0xd187('0x21')](handleEntityNotFound(_0x3c611d,null))[_0xd187('0x21')](function(_0x1b93db){if(_0x1b93db){logger[_0xd187('0x25')](_0xd187('0x26'),_0xd187('0x2b'),_0xd187('0x75'),_0x1b93db[_0xd187('0x76')],util[_0xd187('0x77')](_0x2b2c64[_0xd187('0x54')],{'showHidden':![],'depth':null}));switch(_0x1b93db[_0xd187('0x76')]){case _0xd187('0x78'):if(_0x2b2c64[_0xd187('0x54')]['MessageSid']&&_0x2b2c64[_0xd187('0x54')][_0xd187('0x79')]===_0x4dc675[_0xd187('0x7a')]){return _0x4dc675[_0xd187('0x64')]({'read':!![]});}else{logger['error'](_0xd187('0x7b'),_0xd187('0x2b'),'twilio',util['inspect'](_0x2b2c64[_0xd187('0x54')],{'showHidden':![],'depth':null}));}break;case _0xd187('0x7c'):if(_0x2b2c64[_0xd187('0x54')][_0xd187('0x7d')]&&_0x2b2c64[_0xd187('0x54')][_0xd187('0x7d')]===_0x4dc675['messageId']&&_[_0xd187('0x7e')]([_0xd187('0x7f'),'delivered'],_0x2b2c64[_0xd187('0x54')][_0xd187('0x80')])>=0x0){return _0x4dc675[_0xd187('0x64')]({'read':!![]});}else{logger[_0xd187('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd187('0x81'),util[_0xd187('0x77')](_0x2b2c64[_0xd187('0x54')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1d9420=_0x2b2c64[_0xd187('0x54')][_0xd187('0x82')][0x0];if(_0x1d9420[_0xd187('0x2b')]['groupName']===_0xd187('0x83')){return _0x4dc675['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util['inspect'](_0x2b2c64['body'],{'showHidden':![],'depth':null}));}break;}return _0x4dc675;}})[_0xd187('0x21')](respondWithResult(_0x3c611d,null))[_0xd187('0x50')](handleError(_0x3c611d,null));}; \ No newline at end of file +var _0x524e=['attributes','fields','length','hasOwnProperty','order','sort','where','map','key','VIRTUAL','field','merge','options','includeAll','include','SmsMessage','findAll','rows','catch','show','params','create','body','update','find','destroy','describe','sms-interactions','accept','sms','read','readAt','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','type','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','plivio','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','apply','reject','then','stack','name','send','rawAttributes','model','keys','query','filters','intersection'];(function(_0x49365d,_0x227a7c){var _0x508eaa=function(_0x4c4464){while(--_0x4c4464){_0x49365d['push'](_0x49365d['shift']());}};_0x508eaa(++_0x227a7c);}(_0x524e,0x15e));var _0xe524=function(_0x3e43a9,_0x1a70e3){_0x3e43a9=_0x3e43a9-0x0;var _0x55fe64=_0x524e[_0x3e43a9];return _0x55fe64;};'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 authService=require(_0xe524('0x12'));var hardwareService=require(_0xe524('0x13'));var Redis=require(_0xe524('0x14'));var qs=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'];config[_0xe524('0x1b')]=_[_0xe524('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe524('0x1d'))(new Redis(config[_0xe524('0x1b')]));require(_0xe524('0x1e'))[_0xe524('0x1f')](socket);var jayson=require(_0xe524('0x20'));var client=jayson['client'][_0xe524('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xe524('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1b0af6,_0x48165e,_0x569660,_0x488fce){return new BPromise(function(_0x109795,_0x538754){var _0x29a031=_0x488fce||client;return _0x29a031['request'](_0x1b0af6,_0x569660)['then'](function(_0x5a5c0d){logger[_0xe524('0x22')]('SmsMessage,\x20%s,\x20%s',_0x48165e,_0xe524('0x23'));logger[_0xe524('0x24')](_0xe524('0x25'),_0x48165e,_0xe524('0x23'),JSON['stringify'](_0x5a5c0d));if(_0x5a5c0d[_0xe524('0x26')]){if(_0x5a5c0d[_0xe524('0x26')]['code']===0x1f4){logger[_0xe524('0x26')](_0xe524('0x27'),_0x48165e,_0x5a5c0d[_0xe524('0x26')][_0xe524('0x28')]);return _0x538754(_0x5a5c0d[_0xe524('0x26')][_0xe524('0x28')]);}logger[_0xe524('0x26')](_0xe524('0x27'),_0x48165e,_0x5a5c0d[_0xe524('0x26')]['message']);return _0x109795(_0x5a5c0d[_0xe524('0x26')]['message']);}else{logger['info'](_0xe524('0x27'),_0x48165e,_0xe524('0x23'));_0x109795(_0x5a5c0d[_0xe524('0x29')][_0xe524('0x28')]);}})['catch'](function(_0x158f07){logger['error'](_0xe524('0x27'),_0x48165e,_0x158f07);_0x538754(_0x158f07);});});}function respondWithStatusCode(_0xcf5db,_0xd62772){_0xd62772=_0xd62772||0xcc;return function(_0x3cd922){if(_0x3cd922){return _0xcf5db[_0xe524('0x2a')](_0xd62772);}return _0xcf5db[_0xe524('0x2b')](_0xd62772)[_0xe524('0x2c')]();};}function respondWithResult(_0x583cc3,_0x58a896){_0x58a896=_0x58a896||0xc8;return function(_0x283f18){if(_0x283f18){return _0x583cc3[_0xe524('0x2b')](_0x58a896)[_0xe524('0x2d')](_0x283f18);}};}function respondWithFilteredResult(_0x109a96,_0x359c8b){return function(_0x5405e4){if(_0x5405e4){var _0x52f140=_0x5405e4[_0xe524('0x2e')],_0x4b1ff=_0x359c8b[_0xe524('0x2f')],_0x25e7a7=_0x359c8b['offset']+_0x359c8b[_0xe524('0x30')],_0x3aedd9;if(_0x25e7a7>=_0x52f140){_0x25e7a7=_0x52f140;_0x3aedd9=0xc8;}else{_0x3aedd9=0xce;}_0x109a96[_0xe524('0x2b')](_0x3aedd9);return _0x109a96['set']('Content-Range',_0x4b1ff+'-'+_0x25e7a7+'/'+_0x52f140)[_0xe524('0x2d')](_0x5405e4);}return null;};}function patchUpdates(_0x376324){return function(_0x5b2fc3){try{jsonpatch[_0xe524('0x31')](_0x5b2fc3,_0x376324,!![]);}catch(_0x535354){return BPromise[_0xe524('0x32')](_0x535354);}return _0x5b2fc3['save']();};}function saveUpdates(_0x315e56,_0x330162){return function(_0x403809){if(_0x403809){return _0x403809['update'](_0x315e56)[_0xe524('0x33')](function(_0x5238c9){return _0x5238c9;});}return null;};}function removeEntity(_0xdbdf53,_0x16eff9){return function(_0x276343){if(_0x276343){return _0x276343['destroy']()[_0xe524('0x33')](function(){_0xdbdf53[_0xe524('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27817e,_0x2852b9){return function(_0x10408e){if(!_0x10408e){_0x27817e[_0xe524('0x2a')](0x194);}return _0x10408e;};}function handleError(_0x53560d,_0x415450){_0x415450=_0x415450||0x1f4;return function(_0xcf8060){logger[_0xe524('0x26')](_0xcf8060[_0xe524('0x34')]);if(_0xcf8060[_0xe524('0x35')]){delete _0xcf8060[_0xe524('0x35')];}_0x53560d[_0xe524('0x2b')](_0x415450)[_0xe524('0x36')](_0xcf8060);};}exports['index']=function(_0x150a9f,_0x56f371){var _0x1d463b={},_0x53eeee={},_0x51cafc={'count':0x0,'rows':[]};var _0x1a6b9c=db['SmsMessage'][_0xe524('0x37')];_0x53eeee[_0xe524('0x38')]=_[_0xe524('0x39')](_0x1a6b9c);_0x53eeee[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x150a9f[_0xe524('0x3a')]);_0x53eeee[_0xe524('0x3b')]=_[_0xe524('0x3c')](_0x53eeee['model'],_0x53eeee[_0xe524('0x3a')]);_0x1d463b[_0xe524('0x3d')]=_[_0xe524('0x3c')](_0x53eeee[_0xe524('0x38')],qs[_0xe524('0x3e')](_0x150a9f[_0xe524('0x3a')][_0xe524('0x3e')]));_0x1d463b[_0xe524('0x3d')]=_0x1d463b['attributes'][_0xe524('0x3f')]?_0x1d463b[_0xe524('0x3d')]:_0x53eeee[_0xe524('0x38')];if(!_0x150a9f['query'][_0xe524('0x40')]('nolimit')){_0x1d463b[_0xe524('0x30')]=qs[_0xe524('0x30')](_0x150a9f[_0xe524('0x3a')][_0xe524('0x30')]);_0x1d463b[_0xe524('0x2f')]=qs[_0xe524('0x2f')](_0x150a9f[_0xe524('0x3a')]['offset']);}_0x1d463b[_0xe524('0x41')]=qs[_0xe524('0x42')](_0x150a9f[_0xe524('0x3a')][_0xe524('0x42')]);_0x1d463b[_0xe524('0x43')]=qs[_0xe524('0x3b')](_['pick'](_0x150a9f[_0xe524('0x3a')],_0x53eeee[_0xe524('0x3b')]));if(_0x150a9f[_0xe524('0x3a')]['filter']){_0x1d463b[_0xe524('0x43')]=_['merge'](_0x1d463b['where'],{'$or':_[_0xe524('0x44')](_0x1a6b9c,function(_0x33906d){if(_0x33906d['type'][_0xe524('0x45')]!==_0xe524('0x46')){var _0x302605={};_0x302605[_0x33906d[_0xe524('0x47')]]={'$like':'%'+_0x150a9f['query']['filter']+'%'};return _0x302605;}})});}_0x1d463b=_[_0xe524('0x48')]({},_0x1d463b,_0x150a9f[_0xe524('0x49')]);var _0x53c204={'where':_0x1d463b[_0xe524('0x43')]};return db['SmsMessage'][_0xe524('0x2e')](_0x53c204)[_0xe524('0x33')](function(_0x462b87){_0x51cafc[_0xe524('0x2e')]=_0x462b87;if(_0x150a9f[_0xe524('0x3a')][_0xe524('0x4a')]){_0x1d463b[_0xe524('0x4b')]=[{'all':!![]}];}return db[_0xe524('0x4c')][_0xe524('0x4d')](_0x1d463b);})[_0xe524('0x33')](function(_0x400d3d){_0x51cafc[_0xe524('0x4e')]=_0x400d3d;return _0x51cafc;})[_0xe524('0x33')](respondWithFilteredResult(_0x56f371,_0x1d463b))[_0xe524('0x4f')](handleError(_0x56f371,null));};exports[_0xe524('0x50')]=function(_0x4dff40,_0x53be1f){var _0x4c06f0={'raw':!![],'where':{'id':_0x4dff40[_0xe524('0x51')]['id']}},_0x539f90={};_0x539f90['model']=_[_0xe524('0x39')](db[_0xe524('0x4c')]['rawAttributes']);_0x539f90[_0xe524('0x3a')]=_['keys'](_0x4dff40['query']);_0x539f90[_0xe524('0x3b')]=_[_0xe524('0x3c')](_0x539f90[_0xe524('0x38')],_0x539f90['query']);_0x4c06f0['attributes']=_['intersection'](_0x539f90['model'],qs['fields'](_0x4dff40['query'][_0xe524('0x3e')]));_0x4c06f0[_0xe524('0x3d')]=_0x4c06f0['attributes'][_0xe524('0x3f')]?_0x4c06f0[_0xe524('0x3d')]:_0x539f90[_0xe524('0x38')];if(_0x4dff40[_0xe524('0x3a')][_0xe524('0x4a')]){_0x4c06f0['include']=[{'all':!![]}];}_0x4c06f0=_[_0xe524('0x48')]({},_0x4c06f0,_0x4dff40[_0xe524('0x49')]);return db[_0xe524('0x4c')]['find'](_0x4c06f0)[_0xe524('0x33')](handleEntityNotFound(_0x53be1f,null))['then'](respondWithResult(_0x53be1f,null))[_0xe524('0x4f')](handleError(_0x53be1f,null));};exports[_0xe524('0x52')]=function(_0x248e0f,_0x2dbaa1){return db[_0xe524('0x4c')][_0xe524('0x52')](_0x248e0f[_0xe524('0x53')],{})[_0xe524('0x33')](respondWithResult(_0x2dbaa1,0xc9))[_0xe524('0x4f')](handleError(_0x2dbaa1,null));};exports[_0xe524('0x54')]=function(_0x43bc04,_0x429497){if(_0x43bc04['body']['id']){delete _0x43bc04['body']['id'];}return db['SmsMessage'][_0xe524('0x55')]({'where':{'id':_0x43bc04[_0xe524('0x51')]['id']}})[_0xe524('0x33')](handleEntityNotFound(_0x429497,null))[_0xe524('0x33')](saveUpdates(_0x43bc04[_0xe524('0x53')],null))[_0xe524('0x33')](respondWithResult(_0x429497,null))[_0xe524('0x4f')](handleError(_0x429497,null));};exports[_0xe524('0x56')]=function(_0x1e9006,_0x22136b){return db[_0xe524('0x4c')]['find']({'where':{'id':_0x1e9006[_0xe524('0x51')]['id']}})[_0xe524('0x33')](handleEntityNotFound(_0x22136b,null))['then'](removeEntity(_0x22136b,null))['catch'](handleError(_0x22136b,null));};exports['describe']=function(_0x5c4056,_0x31b1db){return db[_0xe524('0x4c')][_0xe524('0x57')]()[_0xe524('0x33')](respondWithResult(_0x31b1db,null))['catch'](handleError(_0x31b1db,null));};var interaction_log=require(_0xe524('0x16'))(_0xe524('0x58'));exports[_0xe524('0x59')]=function(_0x22f051,_0x5712e0,_0x5d603b){var _0x590443={'channel':_0xe524('0x5a')};if(_0x22f051['body']['id']){delete _0x22f051[_0xe524('0x53')]['id'];}_0x22f051[_0xe524('0x53')][_0xe524('0x5b')]=!![];_0x22f051[_0xe524('0x53')][_0xe524('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x22f051[_0xe524('0x53')][_0xe524('0x5d')]=_0x22f051[_0xe524('0x53')][_0xe524('0x5d')]||_0x22f051[_0xe524('0x5e')]['id'];return db[_0xe524('0x4c')]['find']({'where':{'id':_0x22f051[_0xe524('0x51')]['id'],'UserId':null},'include':[{'model':db[_0xe524('0x5f')],'as':_0xe524('0x60')}]})['then'](handleEntityNotFound(_0x5712e0,null))[_0xe524('0x33')](saveUpdates(_0x22f051[_0xe524('0x53')],null))[_0xe524('0x33')](function(_0x580d71){if(_0x580d71){_0x590443['message']=_0x580d71[_0xe524('0x61')]({'plain':!![]});return db[_0xe524('0x62')][_0xe524('0x55')]({'where':{'id':_0x580d71[_0xe524('0x63')]}});}return null;})[_0xe524('0x33')](handleEntityNotFound(_0x5712e0,null))['then'](function(_0xe102a0){if(_0xe102a0){return _0xe102a0[_0xe524('0x54')]({'UserId':_0x22f051[_0xe524('0x53')][_0xe524('0x5d')],'read1stAt':_[_0xe524('0x64')](_0xe102a0[_0xe524('0x65')])?moment()[_0xe524('0x66')](_0xe524('0x67')):undefined});}return null;})[_0xe524('0x33')](function(_0x7e5992){if(_0x7e5992){_0x590443[_0xe524('0x68')]=_0x7e5992['get']({'plain':!![]});interaction_log[_0xe524('0x22')](_0xe524('0x69'),_0x22f051[_0xe524('0x5e')]['id'],_0x22f051[_0xe524('0x5e')][_0xe524('0x35')],_0x22f051['user'][_0xe524('0x6a')],_0x590443[_0xe524('0x68')]['id'],_0x22f051[_0xe524('0x53')]?JSON[_0xe524('0x6b')](_0x22f051[_0xe524('0x53')]):_0xe524('0x6c'));return respondWithRpcPromise(_0xe524('0x6d'),'acceptMessage',_0x590443);}return null;})[_0xe524('0x33')](function(_0x245501){if(_0x245501){if(_0x22f051[_0xe524('0x53')][_0xe524('0x6e')]){_0x590443['message'][_0xe524('0x6f')]=util['format'](_0xe524('0x70'),_0x22f051[_0xe524('0x5e')][_0xe524('0x35')]);_0x590443['message'][_0xe524('0x71')]=_0x590443[_0xe524('0x71')];_0x590443[_0xe524('0x28')][_0xe524('0x72')]=_0xe524('0x59');return respondWithRpcPromise('EventManager',_0xe524('0x73'),{'event':_0xe524('0x74'),'message':_0x590443[_0xe524('0x28')]},client9002)[_0xe524('0x33')](function(){return _0x590443;});}return _0x590443;}return null;})[_0xe524('0x33')](respondWithResult(_0x5712e0,null))['catch'](handleError(_0x5712e0,null));};var interaction_log=require(_0xe524('0x16'))(_0xe524('0x58'));exports[_0xe524('0x32')]=function(_0x7be00c,_0x60cc2,_0x1bde09){var _0x54a1e1={'agent':{},'channel':_0xe524('0x5a')};if(_0x7be00c[_0xe524('0x53')]['id']){delete _0x7be00c[_0xe524('0x53')]['id'];}_0x7be00c['body'][_0xe524('0x5d')]=_0x7be00c[_0xe524('0x53')]['UserId']||_0x7be00c[_0xe524('0x5e')]['id'];_0x54a1e1[_0xe524('0x75')]['id']=_0x7be00c[_0xe524('0x53')][_0xe524('0x5d')];return db[_0xe524('0x4c')][_0xe524('0x55')]({'where':{'id':_0x7be00c['params']['id'],'UserId':null}})[_0xe524('0x33')](handleEntityNotFound(_0x60cc2,null))[_0xe524('0x33')](function(_0x410bd3){if(_0x410bd3){_0x54a1e1[_0xe524('0x28')]=_0x410bd3[_0xe524('0x61')]({'plain':!![]});return db[_0xe524('0x62')][_0xe524('0x55')]({'where':{'id':_0x410bd3[_0xe524('0x63')]}});}return null;})[_0xe524('0x33')](handleEntityNotFound(_0x60cc2,null))[_0xe524('0x33')](function(_0x2e9636){if(_0x2e9636){_0x54a1e1[_0xe524('0x68')]=_0x2e9636[_0xe524('0x61')]({'plain':!![]});interaction_log[_0xe524('0x22')](_0xe524('0x76'),_0x7be00c['user']['id'],_0x7be00c[_0xe524('0x5e')][_0xe524('0x35')],_0x7be00c[_0xe524('0x5e')]['role'],_0x54a1e1[_0xe524('0x68')]['id'],_0x7be00c[_0xe524('0x53')]?JSON['stringify'](_0x7be00c['body']):_0xe524('0x6c'));return respondWithRpcPromise('RejectMessage',_0xe524('0x77'),_0x54a1e1);}return null;})['then'](function(_0x22b3fd){if(_0x22b3fd){_0x22b3fd[_0xe524('0x28')][_0xe524('0x6f')]=util[_0xe524('0x66')]('SIP/%s',_0x7be00c['user'][_0xe524('0x35')]);_0x22b3fd[_0xe524('0x28')]['channel']=_0x54a1e1[_0xe524('0x71')];_0x22b3fd[_0xe524('0x28')][_0xe524('0x72')]='reject';respondWithRpcPromise(_0xe524('0x73'),_0xe524('0x73'),{'event':_0xe524('0x78'),'message':_0x22b3fd[_0xe524('0x28')]},client9002);return _0x54a1e1;}return null;})[_0xe524('0x33')](respondWithResult(_0x60cc2,null))[_0xe524('0x4f')](handleError(_0x60cc2,null));};exports['status']=function(_0x521c3f,_0x212a97,_0x47e678){if(_0x521c3f[_0xe524('0x53')]['id']){delete _0x521c3f[_0xe524('0x53')]['id'];}var _0x11bbda;return db['SmsMessage'][_0xe524('0x55')]({'where':{'id':_0x521c3f['params']['id']}})[_0xe524('0x33')](handleEntityNotFound(_0x212a97,null))[_0xe524('0x33')](function(_0xfc62e5){if(_0xfc62e5){_0x11bbda=_0xfc62e5;return db[_0xe524('0x79')][_0xe524('0x55')]({'where':{'id':_0xfc62e5[_0xe524('0x7a')]}});}})['then'](handleEntityNotFound(_0x212a97,null))[_0xe524('0x33')](function(_0x35d0f4){if(_0x35d0f4){logger[_0xe524('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe524('0x2b'),_0xe524('0x7b'),_0x35d0f4['type'],util[_0xe524('0x7c')](_0x521c3f[_0xe524('0x53')],{'showHidden':![],'depth':null}));switch(_0x35d0f4[_0xe524('0x7d')]){case _0xe524('0x7e'):if(_0x521c3f['body'][_0xe524('0x7f')]&&_0x521c3f[_0xe524('0x53')][_0xe524('0x7f')]===_0x11bbda['messageId']){return _0x11bbda[_0xe524('0x54')]({'read':!![]});}else{logger['error'](_0xe524('0x80'),_0xe524('0x2b'),_0xe524('0x7e'),util['inspect'](_0x521c3f[_0xe524('0x53')],{'showHidden':![],'depth':null}));}break;case _0xe524('0x81'):if(_0x521c3f[_0xe524('0x53')]['MessageUUID']&&_0x521c3f['body'][_0xe524('0x82')]===_0x11bbda['messageId']&&_[_0xe524('0x83')](['sent',_0xe524('0x84')],_0x521c3f[_0xe524('0x53')]['Status'])>=0x0){return _0x11bbda[_0xe524('0x54')]({'read':!![]});}else{logger[_0xe524('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe524('0x85'),util[_0xe524('0x7c')](_0x521c3f[_0xe524('0x53')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x302f9a=_0x521c3f[_0xe524('0x53')][_0xe524('0x86')][0x0];if(_0x302f9a[_0xe524('0x2b')][_0xe524('0x87')]===_0xe524('0x88')){return _0x11bbda['update']({'read':!![]});}else{logger[_0xe524('0x26')](_0xe524('0x80'),'status','infobip',util[_0xe524('0x7c')](_0x521c3f[_0xe524('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x11bbda;}})[_0xe524('0x33')](respondWithResult(_0x212a97,null))[_0xe524('0x4f')](handleError(_0x212a97,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 3f235aa..b08ba3d 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 _0xc324=['emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x365e31,_0x1b0af0){var _0x4b266b=function(_0x229a2c){while(--_0x229a2c){_0x365e31['push'](_0x365e31['shift']());}};_0x4b266b(++_0x1b0af0);}(_0xc324,0x67));var _0x4c32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc324[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4c32('0x0'));var SmsMessage=require(_0x4c32('0x1'))['db'][_0x4c32('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4c32('0x3')](0x0);var events={'afterCreate':_0x4c32('0x4'),'afterUpdate':_0x4c32('0x5'),'afterDestroy':_0x4c32('0x6')};function emitEvent(_0x2a8086){return function(_0x4dc9dd,_0x519ad0,_0x27e11){SmsMessageEvents[_0x4c32('0x7')](_0x2a8086+':'+_0x4dc9dd['id'],_0x4dc9dd);SmsMessageEvents[_0x4c32('0x7')](_0x2a8086,_0x4dc9dd);_0x27e11(null);};}for(var e in events){if(events[_0x4c32('0x8')](e)){var event=events[e];SmsMessage[_0x4c32('0x9')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x4fde=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4f6ecb,_0x2b4c06){var _0x3787ed=function(_0x31b14f){while(--_0x31b14f){_0x4f6ecb['push'](_0x4f6ecb['shift']());}};_0x3787ed(++_0x2b4c06);}(_0x4fde,0xfb));var _0xe4fd=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x4fde[_0x3da832];return _0xe602f2;};'use strict';var EventEmitter=require(_0xe4fd('0x0'));var SmsMessage=require(_0xe4fd('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe4fd('0x2')](0x0);var events={'afterCreate':_0xe4fd('0x3'),'afterUpdate':_0xe4fd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15f19b){return function(_0x479d75,_0x2b7c18,_0x4ef8f0){SmsMessageEvents[_0xe4fd('0x5')](_0x15f19b+':'+_0x479d75['id'],_0x479d75);SmsMessageEvents[_0xe4fd('0x5')](_0x15f19b,_0x479d75);_0x4ef8f0(null);};}for(var e in events){if(events[_0xe4fd('0x6')](e)){var event=events[e];SmsMessage[_0xe4fd('0x7')](e,emitEvent(event));}}module[_0xe4fd('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 1922313..aa63295 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 _0x9001=['baseUrl','/auth/1/session','/sms/2/text/advanced','/status?token=','application/json','IBSSO\x20','infobip','crypto','login','sender','text','timestamp','keys','sort','apiKey','createHash','md5','digest','hex','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','define','sms_messages','messageId','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','then','update','body','catch','error','SmsAccount','find','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','password','GET','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','base64','http_code','data','queued_count','head','clickSend','plivo','senderString','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken'];(function(_0x334afb,_0x2d13d9){var _0xf65e2=function(_0x46509a){while(--_0x46509a){_0x334afb['push'](_0x334afb['shift']());}};_0xf65e2(++_0x2d13d9);}(_0x9001,0x170));var _0x1900=function(_0x4eb99e,_0x8759ee){_0x4eb99e=_0x4eb99e-0x0;var _0x2a3a07=_0x9001[_0x4eb99e];return _0x2a3a07;};'use strict';var _=require(_0x1900('0x0'));var util=require(_0x1900('0x1'));var logger=require('../../config/logger')(_0x1900('0x2'));var moment=require(_0x1900('0x3'));var BPromise=require(_0x1900('0x4'));var rp=require('request-promise');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x40d3e0,_0x187614){return _0x40d3e0[_0x1900('0x5')]('SmsMessage',attributes,{'tableName':_0x1900('0x6'),'paranoid':![],'indexes':[{'name':_0x1900('0x7'),'fields':[_0x1900('0x7')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x95318,_0x5e56d2,_0x1daf3d){var _0x551ddb=_0x40d3e0[_0x1900('0x8')];var _0x21ea2d=_0x95318[_0x1900('0x9')]({'plain':!![]});if(_0x21ea2d['direction'][_0x1900('0xa')]()==='in'||_0x21ea2d[_0x1900('0xb')][_0x1900('0xa')]()===_0x1900('0xc')&&!_0x21ea2d[_0x1900('0xd')]&&!_[_0x1900('0xe')](_0x21ea2d[_0x1900('0xf')])){_0x551ddb['SmsInteraction'][_0x1900('0x10')]({'where':{'id':_0x21ea2d['SmsInteractionId']}})[_0x1900('0x11')](function(_0x5b2a0e){if(_0x5b2a0e){_0x5b2a0e[_0x1900('0x12')]({'lastMsgAt':_0x21ea2d['createdAt'],'lastMsgDirection':_0x21ea2d[_0x1900('0xb')][_0x1900('0xa')](),'lastMsgBody':_0x21ea2d[_0x1900('0x13')]});}})[_0x1900('0x14')](function(_0x1c18f4){console[_0x1900('0x15')](_0x1c18f4);});}if(_0x21ea2d[_0x1900('0xb')]===_0x1900('0xc')&&!_0x21ea2d[_0x1900('0xd')]){var _0x3ecb51;_0x551ddb[_0x1900('0x16')][_0x1900('0x17')]({'where':{'id':_0x21ea2d['SmsAccountId']},'raw':!![]})[_0x1900('0x11')](function(_0x4095ac){_0x3ecb51=_0x4095ac;if(_0x3ecb51&&_0x3ecb51[_0x1900('0x18')]){switch(_0x3ecb51[_0x1900('0x18')]){case _0x1900('0x19'):var _0x173e08=require(_0x1900('0x19'));if(_0x3ecb51[_0x1900('0x1a')]&&_0x3ecb51[_0x1900('0x1b')]&&_0x3ecb51['phone']){var _0x558cba=new _0x173e08(_0x3ecb51[_0x1900('0x1a')],_0x3ecb51['authToken']);_0x558cba[_0x1900('0x1c')][_0x1900('0x1d')]({'body':_0x21ea2d['body'],'to':_0x21ea2d[_0x1900('0x1e')],'from':_0x3ecb51[_0x1900('0x1e')],'statusCallback':_0x3ecb51[_0x1900('0x1f')]+_0x1900('0x20')+_0x21ea2d['id']+'/status?token='+_0x3ecb51[_0x1900('0x21')]})[_0x1900('0x11')](function(_0x32efc9){if(_0x32efc9[_0x1900('0x22')]){return _0x95318[_0x1900('0x12')]({'messageId':_0x32efc9[_0x1900('0x22')]});}})[_0x1900('0x14')](function(_0x305917){logger['error'](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x19'),util[_0x1900('0x25')](_0x305917,{'showHidden':![],'depth':null}));});}else{logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x19'),_0x1900('0x26'));}break;case _0x1900('0x27'):var _0x3a3ed1=_0x1900('0x28');if(_0x3ecb51[_0x1900('0x29')]&&_0x3ecb51['password']){var _0x36dc9b={'recipient':[_0x21ea2d['phone']],'message':_0x21ea2d['body'],'message_type':_0x3ecb51[_0x1900('0x2a')]};var _0x45cebe={'url':_0x3a3ed1+_0x1900('0x2b')+_0x3ecb51['username']+_0x1900('0x2c')+_0x3ecb51[_0x1900('0x2d')],'method':_0x1900('0x2e')};rp(_0x45cebe)['then'](function(_0x2c586e){var _0x4fd70a=_0x2c586e[_0x1900('0x2f')](';');var _0x7165bc={'user_key':_0x4fd70a[0x0],'session_key':_0x4fd70a[0x1]};_0x45cebe={'url':_0x3a3ed1+_0x1900('0x30'),'method':_0x1900('0x31'),'headers':{'user_key':_0x7165bc[_0x1900('0x32')],'Session_key':_0x7165bc[_0x1900('0x33')]},'json':!![],'body':_0x36dc9b};return rp(_0x45cebe);})[_0x1900('0x11')](function(_0x4c1416){if(_0x4c1416[_0x1900('0x34')]>=0x1){var _0x221f81={'messageId':_0x4c1416['internal_order_id']};if(_0x3ecb51['smsMethod']!=='GP'||!_0x3ecb51[_0x1900('0x35')]){_0x221f81[_0x1900('0x36')]=!![];}return _0x95318['update'](_0x221f81);}else{return logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x27'),util[_0x1900('0x25')](_0x4c1416,{'showHidden':![],'depth':null}));}})[_0x1900('0x14')](function(_0x330223){return logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),'skebby',util[_0x1900('0x25')](_0x330223,{'showHidden':![],'depth':null}));});}else{logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x27'),_0x1900('0x37'));}break;case _0x1900('0x38'):if(_0x3ecb51[_0x1900('0x1b')]){var _0x7a4463={'recipient':_0x21ea2d[_0x1900('0x1e')],'message':_0x21ea2d['body'],'sender':_0x3ecb51['senderString']||_0x3ecb51[_0x1900('0x1e')],'authorization':_0x3ecb51['authToken']};var _0x5e56d2={'method':_0x1900('0x31'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x7a4463,'json':!![]};rp(_0x5e56d2)['then'](function(_0x2a1431){var _0x20e2bd={'messageId':_0x2a1431[_0x1900('0x39')]};if(!_0x3ecb51['deliveryReport']){_0x20e2bd[_0x1900('0x36')]=!![];}return _0x95318['update'](_0x20e2bd);})['catch'](function(_0x35a831){logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x38'),util['inspect'](_0x35a831,{'showHidden':![],'depth':null}));});}else{logger[_0x1900('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1900('0x24'),_0x1900('0x38'),'Missing\x20parameters:\x20authToken');}break;case _0x1900('0x3a'):if(_0x3ecb51[_0x1900('0x29')]&&_0x3ecb51[_0x1900('0x2d')]){var _0x7a4463={'messages':[{'source':_0x1900('0x3b'),'to':_0x21ea2d[_0x1900('0x1e')],'body':_0x21ea2d[_0x1900('0x13')],'from':_0x3ecb51['senderString']||_0x3ecb51['phone']}]};var _0x254c49=util[_0x1900('0x3c')](_0x1900('0x3d'),_0x3ecb51[_0x1900('0x29')],_0x3ecb51['password']);var _0x5e56d2={'method':_0x1900('0x31'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x7a4463,'headers':{'Authorization':util[_0x1900('0x3c')]('Basic\x20%s',new Buffer(_0x254c49)['toString'](_0x1900('0x3e')))},'json':!![]};rp(_0x5e56d2)['then'](function(_0x14f011){if(_0x14f011['http_code']>=0xc8&&_0x14f011[_0x1900('0x3f')]<=0xce){if(_0x14f011[_0x1900('0x40')]&&_0x14f011[_0x1900('0x40')][_0x1900('0x41')]>0x0){var _0x33962e=_[_0x1900('0x42')](_0x14f011['data']['messages']);var _0x55099f={'messageId':_0x33962e['message_id']};if(!_0x3ecb51[_0x1900('0x35')]){_0x55099f[_0x1900('0x36')]=!![];}return _0x95318[_0x1900('0x12')](_0x55099f);}else{logger['error'](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x43'),util[_0x1900('0x25')](_0x14f011,{'showHidden':![],'depth':null}));}}else{logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x43'),util[_0x1900('0x25')](_0x14f011,{'showHidden':![],'depth':null}));}})[_0x1900('0x14')](function(_0x1fa171){logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),'clickSend',util[_0x1900('0x25')](_0x1fa171,{'showHidden':![],'depth':null}));});}else{logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),'clickSend',_0x1900('0x37'));}break;case _0x1900('0x44'):if(_0x3ecb51['authId']&&_0x3ecb51[_0x1900('0x1b')]){var _0x7a4463={'dst':_0x21ea2d['phone'],'text':_0x21ea2d['body'],'src':_0x3ecb51[_0x1900('0x45')]||_0x3ecb51[_0x1900('0x1e')],'url':_0x3ecb51[_0x1900('0x1f')]+'/api/sms/messages/'+_0x21ea2d['id']+'/status?token='+_0x3ecb51[_0x1900('0x21')]};var _0x254c49=util[_0x1900('0x3c')](_0x1900('0x3d'),_0x3ecb51[_0x1900('0x46')],_0x3ecb51[_0x1900('0x1b')]);var _0x5e56d2={'method':_0x1900('0x31'),'uri':util[_0x1900('0x3c')](_0x1900('0x47'),_0x3ecb51[_0x1900('0x46')]),'body':_0x7a4463,'headers':{'Authorization':util['format'](_0x1900('0x48'),new Buffer(_0x254c49)[_0x1900('0x49')]('base64'))},'json':!![]};rp(_0x5e56d2)[_0x1900('0x11')](function(_0x5e5cb7){var _0x4db185={'messageId':_0x5e5cb7[_0x1900('0x4a')][0x0]};return _0x95318['update'](_0x4db185);})['catch'](function(_0x2b2608){logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x44'),util[_0x1900('0x25')](_0x2b2608,{'showHidden':![],'depth':null}));});}else{logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x44'),_0x1900('0x4b'));}break;case'infobip':if(_0x3ecb51['username']&&_0x3ecb51['password']){if(_0x3ecb51['baseUrl']){var _0x38c9c1={'method':_0x1900('0x31'),'uri':_0x3ecb51[_0x1900('0x4c')]+_0x1900('0x4d'),'body':{'username':_0x3ecb51['username'],'password':_0x3ecb51[_0x1900('0x2d')]},'json':!![]};return rp(_0x38c9c1)['then'](function(_0x50f527){var _0x19ed28={'method':_0x1900('0x31'),'uri':_0x3ecb51['baseUrl']+_0x1900('0x4e'),'body':{'messages':[{'from':_0x3ecb51[_0x1900('0x1e')],'destinations':[{'to':_0x21ea2d[_0x1900('0x1e')]}],'text':_0x21ea2d[_0x1900('0x13')],'notifyUrl':_0x3ecb51[_0x1900('0x1f')]+_0x1900('0x20')+_0x21ea2d['id']+_0x1900('0x4f')+_0x3ecb51['token'],'notifyContentType':_0x1900('0x50'),'callbackData':_0x3ecb51['phone']+';'+_0x21ea2d[_0x1900('0x13')]}]},'headers':{'Authorization':_0x1900('0x51')+_0x50f527[_0x1900('0x21')]},'json':!![]};return rp(_0x19ed28)[_0x1900('0x11')](function(_0x3e2098){if(_0x3e2098[_0x1900('0x1c')]){var _0x48a630={'messageId':_0x3e2098[_0x1900('0x1c')][0x0][_0x1900('0x7')]};if(!_0x3ecb51[_0x1900('0x35')]){_0x48a630[_0x1900('0x36')]=!![];}return _0x95318[_0x1900('0x12')](_0x48a630);}else{return logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x52'),util[_0x1900('0x25')](_0x3e2098,{'showHidden':![],'depth':null}));}});})[_0x1900('0x14')](function(_0x3f9bbc){return logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x52'),util[_0x1900('0x25')](_0x3f9bbc,{'showHidden':![],'depth':null}));});}else{logger[_0x1900('0x15')](_0x1900('0x23'),'afterCreate','infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x1900('0x15')](_0x1900('0x23'),'afterCreate',_0x1900('0x52'),_0x1900('0x37'));}break;case'csc':var _0x317c78=require(_0x1900('0x53'));if(_0x3ecb51['apiKey']){var _0x49db72={};_0x49db72[_0x1900('0x54')]=_0x3ecb51[_0x1900('0x29')];_0x49db72[_0x1900('0x1e')]=_0x21ea2d['phone'];_0x49db72[_0x1900('0x55')]=_0x3ecb51[_0x1900('0x1e')];_0x49db72[_0x1900('0x56')]=_0x21ea2d['body'];_0x49db72[_0x1900('0x57')]=+new Date();var _0x59e6a7='';var _0x1a8b61='';var _0x1424d6=Object[_0x1900('0x58')](_0x49db72);_0x1424d6[_0x1900('0x59')]();for(var _0x102c18=0x0;_0x102c18<_0x1424d6['length'];_0x102c18++){if(_0x59e6a7!=''){_0x59e6a7+='&';}_0x59e6a7+=_0x1424d6[_0x102c18]+'='+encodeURIComponent(_0x49db72[_0x1424d6[_0x102c18]]);_0x1a8b61+=_0x49db72[_0x1424d6[_0x102c18]];}_0x1a8b61+=_0x3ecb51[_0x1900('0x5a')];_0x1a8b61=_0x317c78[_0x1900('0x5b')](_0x1900('0x5c'))[_0x1900('0x12')](_0x1a8b61)[_0x1900('0x5d')](_0x1900('0x5e'));if(_0x59e6a7!==''){_0x59e6a7+='&';}_0x59e6a7+='signature='+_0x1a8b61;var _0x45cebe={'method':_0x1900('0x2e'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x59e6a7,'json':!![]};return rp(_0x45cebe)[_0x1900('0x11')](function(_0x23204a){var _0x4bd4ed=Object[_0x1900('0x58')](_0x23204a);if(_0x23204a[_0x4bd4ed[0x0]][_0x1900('0x15')]&&parseInt(_0x23204a[_0x4bd4ed[0x0]][_0x1900('0x15')])===0x0){var _0x43dd01={'messageId':_0x23204a[_0x4bd4ed[0x0]]['id_sms']};if(!_0x3ecb51['deliveryReport']){_0x43dd01['read']=!![];}return _0x95318[_0x1900('0x12')](_0x43dd01);}else{return logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x5f'),util[_0x1900('0x25')](_0x23204a[_0x1900('0x15')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2dbfe4){return logger[_0x1900('0x15')](_0x1900('0x23'),'afterCreate',_0x1900('0x5f'),util[_0x1900('0x25')](_0x2dbfe4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x5f'),_0x1900('0x60'));}break;case'clickatell':if(_0x3ecb51['apiKey']){var _0x3d53b8={'method':'POST','uri':_0x1900('0x61'),'headers':{'Authorization':_0x3ecb51['apiKey']},'body':{'content':_0x21ea2d[_0x1900('0x13')],'to':[_0x21ea2d[_0x1900('0x1e')]],'from':_0x3ecb51['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x1900('0x62')},'json':!![]};rp(_0x3d53b8)[_0x1900('0x11')](function(_0x31288b){if(!_0x31288b[_0x1900('0x15')]){var _0x480e26={'messageId':_0x31288b[_0x1900('0x1c')][0x0][_0x1900('0x63')]};if(!_0x3ecb51['deliveryReport']){_0x480e26[_0x1900('0x36')]=!![];}return _0x95318[_0x1900('0x12')](_0x480e26);}else{return logger['error'](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x64'),util['inspect'](_0x31288b[_0x1900('0x15')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x50f3e1){return logger[_0x1900('0x15')](_0x1900('0x23'),'afterCreate',_0x1900('0x64'),util['inspect'](_0x50f3e1,{'showHidden':![],'depth':null}));});}else{logger[_0x1900('0x15')](_0x1900('0x23'),'afterCreate',_0x1900('0x64'),_0x1900('0x60'));}break;case'intelepeer':if(_0x3ecb51[_0x1900('0x5a')]){var _0x423aee={};var _0x45cebe={'method':_0x1900('0x31'),'uri':_0x1900('0x65'),'headers':{'Authorization':_0x1900('0x66')+_0x3ecb51[_0x1900('0x5a')],'Content-Type':'application/json'},'body':{'from':_0x3ecb51['phone'],'to':_0x21ea2d[_0x1900('0x1e')],'text':_0x21ea2d[_0x1900('0x13')]},'json':!![]};return rp(_0x45cebe)[_0x1900('0x11')](function(_0x33ca4c){if(_0x33ca4c[_0x1900('0x67')]==0xca){_0x423aee[_0x1900('0x68')]=_0x33ca4c;var _0x497e59={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x1900('0x66')+_0x3ecb51[_0x1900('0x5a')],'Content-Type':_0x1900('0x50')},'body':{'refid':_0x423aee['message'][_0x1900('0x69')]},'json':!![]};return rp(_0x497e59)['then'](function(_0x152cf4){_0x423aee['status']=_0x152cf4;var _0x45a62c={'messageId':_0x423aee[_0x1900('0x68')][_0x1900('0x69')],'read':!![]};return _0x95318[_0x1900('0x12')](_0x45a62c);});}else{return logger[_0x1900('0x15')](_0x1900('0x23'),_0x1900('0x24'),_0x1900('0x6a'),util[_0x1900('0x25')](_0x33ca4c,{'showHidden':![],'depth':null}));}})[_0x1900('0x14')](function(_0xe8443){return logger['error'](_0x1900('0x23'),_0x1900('0x24'),'intelepeer',util[_0x1900('0x25')](_0xe8443,{'showHidden':![],'depth':null}));});}else{return logger[_0x1900('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1900('0x6a'),_0x1900('0x6b'));}break;}}})[_0x1900('0x6c')](function(){_0x1daf3d();});}else{_0x1daf3d();}}},'charset':_0x1900('0x6d'),'collate':_0x1900('0x6e')});}; \ No newline at end of file +var _0x97d0=['csc','apiKey','login','sender','text','timestamp','sort','length','createHash','md5','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','body','catch','error','out','find','type','twilio','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','http_code','data','queued_count','clickSend','plivo','authId','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','infobip'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x97d0,0x172));var _0x097d=function(_0x5ef87b,_0x2dbb27){_0x5ef87b=_0x5ef87b-0x0;var _0x21446c=_0x97d0[_0x5ef87b];return _0x21446c;};'use strict';var _=require('lodash');var util=require(_0x097d('0x0'));var logger=require(_0x097d('0x1'))(_0x097d('0x2'));var moment=require('moment');var BPromise=require(_0x097d('0x3'));var rp=require(_0x097d('0x4'));var attributes=require(_0x097d('0x5'));module['exports']=function(_0x521a37,_0x4cd227){return _0x521a37[_0x097d('0x6')](_0x097d('0x7'),attributes,{'tableName':_0x097d('0x8'),'paranoid':![],'indexes':[{'name':_0x097d('0x9'),'fields':[_0x097d('0x9')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b6225,_0x2974cc,_0x2b29d3){var _0x2218ff=_0x521a37[_0x097d('0xa')];var _0x5ab163=_0x3b6225[_0x097d('0xb')]({'plain':!![]});if(_0x5ab163[_0x097d('0xc')][_0x097d('0xd')]()==='in'||_0x5ab163[_0x097d('0xc')][_0x097d('0xd')]()==='out'&&!_0x5ab163[_0x097d('0xe')]&&!_[_0x097d('0xf')](_0x5ab163[_0x097d('0x10')])){_0x2218ff[_0x097d('0x11')][_0x097d('0x12')]({'where':{'id':_0x5ab163[_0x097d('0x13')]}})[_0x097d('0x14')](function(_0x360259){if(_0x360259){_0x360259['update']({'lastMsgAt':_0x5ab163['createdAt'],'lastMsgDirection':_0x5ab163[_0x097d('0xc')]['toLowerCase'](),'lastMsgBody':_0x5ab163[_0x097d('0x15')]});}})[_0x097d('0x16')](function(_0x375460){console[_0x097d('0x17')](_0x375460);});}if(_0x5ab163[_0x097d('0xc')]===_0x097d('0x18')&&!_0x5ab163[_0x097d('0xe')]){var _0x1fb35d;_0x2218ff['SmsAccount'][_0x097d('0x19')]({'where':{'id':_0x5ab163['SmsAccountId']},'raw':!![]})[_0x097d('0x14')](function(_0x543232){_0x1fb35d=_0x543232;if(_0x1fb35d&&_0x1fb35d[_0x097d('0x1a')]){switch(_0x1fb35d[_0x097d('0x1a')]){case'twilio':var _0x6af66b=require(_0x097d('0x1b'));if(_0x1fb35d['accountSid']&&_0x1fb35d[_0x097d('0x1c')]&&_0x1fb35d[_0x097d('0x1d')]){var _0x4e1224=new _0x6af66b(_0x1fb35d['accountSid'],_0x1fb35d[_0x097d('0x1c')]);_0x4e1224[_0x097d('0x1e')][_0x097d('0x1f')]({'body':_0x5ab163['body'],'to':_0x5ab163[_0x097d('0x1d')],'from':_0x1fb35d['phone'],'statusCallback':_0x1fb35d[_0x097d('0x20')]+_0x097d('0x21')+_0x5ab163['id']+_0x097d('0x22')+_0x1fb35d[_0x097d('0x23')]})[_0x097d('0x14')](function(_0x4c8741){if(_0x4c8741[_0x097d('0x24')]){return _0x3b6225[_0x097d('0x25')]({'messageId':_0x4c8741[_0x097d('0x24')]});}})[_0x097d('0x16')](function(_0x3356db){logger[_0x097d('0x17')](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x1b'),util[_0x097d('0x28')](_0x3356db,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x1b'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x097d('0x29'):var _0x378414=_0x097d('0x2a');if(_0x1fb35d['username']&&_0x1fb35d[_0x097d('0x2b')]){var _0x431d64={'recipient':[_0x5ab163[_0x097d('0x1d')]],'message':_0x5ab163[_0x097d('0x15')],'message_type':_0x1fb35d[_0x097d('0x2c')]};var _0x16d4ef={'url':_0x378414+_0x097d('0x2d')+_0x1fb35d[_0x097d('0x2e')]+_0x097d('0x2f')+_0x1fb35d[_0x097d('0x2b')],'method':_0x097d('0x30')};rp(_0x16d4ef)[_0x097d('0x14')](function(_0xdb4beb){var _0x21f084=_0xdb4beb[_0x097d('0x31')](';');var _0x1857b4={'user_key':_0x21f084[0x0],'session_key':_0x21f084[0x1]};_0x16d4ef={'url':_0x378414+_0x097d('0x32'),'method':_0x097d('0x33'),'headers':{'user_key':_0x1857b4[_0x097d('0x34')],'Session_key':_0x1857b4[_0x097d('0x35')]},'json':!![],'body':_0x431d64};return rp(_0x16d4ef);})['then'](function(_0x17a856){if(_0x17a856[_0x097d('0x36')]>=0x1){var _0x3f22c0={'messageId':_0x17a856[_0x097d('0x37')]};if(_0x1fb35d[_0x097d('0x2c')]!=='GP'||!_0x1fb35d['deliveryReport']){_0x3f22c0[_0x097d('0x38')]=!![];}return _0x3b6225[_0x097d('0x25')](_0x3f22c0);}else{return logger[_0x097d('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x097d('0x27'),'skebby',util[_0x097d('0x28')](_0x17a856,{'showHidden':![],'depth':null}));}})[_0x097d('0x16')](function(_0x55b03c){return logger['error'](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x29'),util[_0x097d('0x28')](_0x55b03c,{'showHidden':![],'depth':null}));});}else{logger[_0x097d('0x17')](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x29'),_0x097d('0x39'));}break;case _0x097d('0x3a'):if(_0x1fb35d['authToken']){var _0x3e9392={'recipient':_0x5ab163[_0x097d('0x1d')],'message':_0x5ab163[_0x097d('0x15')],'sender':_0x1fb35d[_0x097d('0x3b')]||_0x1fb35d[_0x097d('0x1d')],'authorization':_0x1fb35d[_0x097d('0x1c')]};var _0x2974cc={'method':_0x097d('0x33'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x3e9392,'json':!![]};rp(_0x2974cc)[_0x097d('0x14')](function(_0x4f5cf6){var _0x38a886={'messageId':_0x4f5cf6[_0x097d('0x3c')]};if(!_0x1fb35d[_0x097d('0x3d')]){_0x38a886[_0x097d('0x38')]=!![];}return _0x3b6225[_0x097d('0x25')](_0x38a886);})[_0x097d('0x16')](function(_0x32feab){logger[_0x097d('0x17')](_0x097d('0x26'),'afterCreate','connectel',util[_0x097d('0x28')](_0x32feab,{'showHidden':![],'depth':null}));});}else{logger[_0x097d('0x17')](_0x097d('0x26'),'afterCreate','connectel',_0x097d('0x3e'));}break;case _0x097d('0x3f'):if(_0x1fb35d[_0x097d('0x2e')]&&_0x1fb35d[_0x097d('0x2b')]){var _0x3e9392={'messages':[{'source':_0x097d('0x40'),'to':_0x5ab163[_0x097d('0x1d')],'body':_0x5ab163[_0x097d('0x15')],'from':_0x1fb35d[_0x097d('0x3b')]||_0x1fb35d[_0x097d('0x1d')]}]};var _0x461b79=util[_0x097d('0x41')](_0x097d('0x42'),_0x1fb35d[_0x097d('0x2e')],_0x1fb35d[_0x097d('0x2b')]);var _0x2974cc={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x3e9392,'headers':{'Authorization':util[_0x097d('0x41')](_0x097d('0x43'),new Buffer(_0x461b79)[_0x097d('0x44')]('base64'))},'json':!![]};rp(_0x2974cc)[_0x097d('0x14')](function(_0x526703){if(_0x526703[_0x097d('0x45')]>=0xc8&&_0x526703[_0x097d('0x45')]<=0xce){if(_0x526703[_0x097d('0x46')]&&_0x526703[_0x097d('0x46')][_0x097d('0x47')]>0x0){var _0x3b3962=_['head'](_0x526703[_0x097d('0x46')][_0x097d('0x1e')]);var _0x1b736c={'messageId':_0x3b3962['message_id']};if(!_0x1fb35d[_0x097d('0x3d')]){_0x1b736c[_0x097d('0x38')]=!![];}return _0x3b6225[_0x097d('0x25')](_0x1b736c);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x097d('0x27'),_0x097d('0x48'),util[_0x097d('0x28')](_0x526703,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x097d('0x27'),_0x097d('0x48'),util[_0x097d('0x28')](_0x526703,{'showHidden':![],'depth':null}));}})[_0x097d('0x16')](function(_0x1adbff){logger[_0x097d('0x17')](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x48'),util['inspect'](_0x1adbff,{'showHidden':![],'depth':null}));});}else{logger[_0x097d('0x17')](_0x097d('0x26'),'afterCreate',_0x097d('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x097d('0x49'):if(_0x1fb35d[_0x097d('0x4a')]&&_0x1fb35d['authToken']){var _0x3e9392={'dst':_0x5ab163[_0x097d('0x1d')],'text':_0x5ab163[_0x097d('0x15')],'src':_0x1fb35d[_0x097d('0x3b')]||_0x1fb35d[_0x097d('0x1d')],'url':_0x1fb35d[_0x097d('0x20')]+_0x097d('0x21')+_0x5ab163['id']+_0x097d('0x22')+_0x1fb35d['token']};var _0x461b79=util[_0x097d('0x41')](_0x097d('0x42'),_0x1fb35d['authId'],_0x1fb35d[_0x097d('0x1c')]);var _0x2974cc={'method':_0x097d('0x33'),'uri':util[_0x097d('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1fb35d[_0x097d('0x4a')]),'body':_0x3e9392,'headers':{'Authorization':util[_0x097d('0x41')](_0x097d('0x43'),new Buffer(_0x461b79)[_0x097d('0x44')]('base64'))},'json':!![]};rp(_0x2974cc)['then'](function(_0x204994){var _0xa6ee20={'messageId':_0x204994[_0x097d('0x4b')][0x0]};return _0x3b6225[_0x097d('0x25')](_0xa6ee20);})[_0x097d('0x16')](function(_0x34adfa){logger[_0x097d('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x097d('0x49'),util[_0x097d('0x28')](_0x34adfa,{'showHidden':![],'depth':null}));});}else{logger[_0x097d('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x097d('0x27'),'plivo',_0x097d('0x4c'));}break;case'infobip':if(_0x1fb35d[_0x097d('0x2e')]&&_0x1fb35d[_0x097d('0x2b')]){if(_0x1fb35d[_0x097d('0x4d')]){var _0x51876b={'method':_0x097d('0x33'),'uri':_0x1fb35d[_0x097d('0x4d')]+_0x097d('0x4e'),'body':{'username':_0x1fb35d[_0x097d('0x2e')],'password':_0x1fb35d['password']},'json':!![]};return rp(_0x51876b)[_0x097d('0x14')](function(_0x511fed){var _0x1fbe6a={'method':'POST','uri':_0x1fb35d['baseUrl']+_0x097d('0x4f'),'body':{'messages':[{'from':_0x1fb35d[_0x097d('0x1d')],'destinations':[{'to':_0x5ab163[_0x097d('0x1d')]}],'text':_0x5ab163[_0x097d('0x15')],'notifyUrl':_0x1fb35d[_0x097d('0x20')]+_0x097d('0x21')+_0x5ab163['id']+_0x097d('0x22')+_0x1fb35d[_0x097d('0x23')],'notifyContentType':'application/json','callbackData':_0x1fb35d['phone']+';'+_0x5ab163[_0x097d('0x15')]}]},'headers':{'Authorization':_0x097d('0x50')+_0x511fed['token']},'json':!![]};return rp(_0x1fbe6a)[_0x097d('0x14')](function(_0x2a9a4d){if(_0x2a9a4d[_0x097d('0x1e')]){var _0xa31ba9={'messageId':_0x2a9a4d[_0x097d('0x1e')][0x0]['messageId']};if(!_0x1fb35d[_0x097d('0x3d')]){_0xa31ba9[_0x097d('0x38')]=!![];}return _0x3b6225[_0x097d('0x25')](_0xa31ba9);}else{return logger[_0x097d('0x17')](_0x097d('0x26'),'afterCreate',_0x097d('0x51'),util['inspect'](_0x2a9a4d,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x6175f){return logger[_0x097d('0x17')](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x51'),util[_0x097d('0x28')](_0x6175f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x097d('0x26'),'afterCreate',_0x097d('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x097d('0x17')](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x51'),_0x097d('0x39'));}break;case _0x097d('0x52'):var _0x511921=require('crypto');if(_0x1fb35d[_0x097d('0x53')]){var _0x78e420={};_0x78e420[_0x097d('0x54')]=_0x1fb35d[_0x097d('0x2e')];_0x78e420[_0x097d('0x1d')]=_0x5ab163[_0x097d('0x1d')];_0x78e420[_0x097d('0x55')]=_0x1fb35d['phone'];_0x78e420[_0x097d('0x56')]=_0x5ab163[_0x097d('0x15')];_0x78e420[_0x097d('0x57')]=+new Date();var _0x20de92='';var _0x5e9306='';var _0x26efc7=Object['keys'](_0x78e420);_0x26efc7[_0x097d('0x58')]();for(var _0x2f6a87=0x0;_0x2f6a87<_0x26efc7[_0x097d('0x59')];_0x2f6a87++){if(_0x20de92!=''){_0x20de92+='&';}_0x20de92+=_0x26efc7[_0x2f6a87]+'='+encodeURIComponent(_0x78e420[_0x26efc7[_0x2f6a87]]);_0x5e9306+=_0x78e420[_0x26efc7[_0x2f6a87]];}_0x5e9306+=_0x1fb35d[_0x097d('0x53')];_0x5e9306=_0x511921[_0x097d('0x5a')](_0x097d('0x5b'))['update'](_0x5e9306)['digest'](_0x097d('0x5c'));if(_0x20de92!==''){_0x20de92+='&';}_0x20de92+=_0x097d('0x5d')+_0x5e9306;var _0x16d4ef={'method':_0x097d('0x30'),'uri':_0x097d('0x5e')+_0x20de92,'json':!![]};return rp(_0x16d4ef)[_0x097d('0x14')](function(_0x4a204f){var _0x217c4e=Object['keys'](_0x4a204f);if(_0x4a204f[_0x217c4e[0x0]][_0x097d('0x17')]&&parseInt(_0x4a204f[_0x217c4e[0x0]]['error'])===0x0){var _0x27bcbc={'messageId':_0x4a204f[_0x217c4e[0x0]][_0x097d('0x5f')]};if(!_0x1fb35d[_0x097d('0x3d')]){_0x27bcbc[_0x097d('0x38')]=!![];}return _0x3b6225[_0x097d('0x25')](_0x27bcbc);}else{return logger[_0x097d('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x097d('0x27'),_0x097d('0x52'),util[_0x097d('0x28')](_0x4a204f[_0x097d('0x17')],{'showHidden':![],'depth':null}));}})[_0x097d('0x16')](function(_0x3853e6){return logger[_0x097d('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x097d('0x27'),'csc',util[_0x097d('0x28')](_0x3853e6,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x097d('0x27'),_0x097d('0x52'),_0x097d('0x60'));}break;case _0x097d('0x61'):if(_0x1fb35d[_0x097d('0x53')]){var _0x2b3cf2={'method':_0x097d('0x33'),'uri':_0x097d('0x62'),'headers':{'Authorization':_0x1fb35d[_0x097d('0x53')]},'body':{'content':_0x5ab163['body'],'to':[_0x5ab163[_0x097d('0x1d')]],'from':_0x1fb35d[_0x097d('0x1d')],'binary':![],'clientMessageId':_0x097d('0x63'),'charset':_0x097d('0x64')},'json':!![]};rp(_0x2b3cf2)[_0x097d('0x14')](function(_0x95dc9){if(!_0x95dc9[_0x097d('0x17')]){var _0x41c301={'messageId':_0x95dc9[_0x097d('0x1e')][0x0][_0x097d('0x65')]};if(!_0x1fb35d[_0x097d('0x3d')]){_0x41c301[_0x097d('0x38')]=!![];}return _0x3b6225['update'](_0x41c301);}else{return logger['error'](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x61'),util['inspect'](_0x95dc9['error'],{'showHidden':![],'depth':null}));}})[_0x097d('0x16')](function(_0x327f1d){return logger['error'](_0x097d('0x26'),'afterCreate',_0x097d('0x61'),util['inspect'](_0x327f1d,{'showHidden':![],'depth':null}));});}else{logger[_0x097d('0x17')](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x61'),_0x097d('0x60'));}break;case'intelepeer':if(_0x1fb35d[_0x097d('0x53')]){var _0x3d9a1e={};var _0x16d4ef={'method':_0x097d('0x33'),'uri':_0x097d('0x66'),'headers':{'Authorization':_0x097d('0x67')+_0x1fb35d[_0x097d('0x53')],'Content-Type':_0x097d('0x68')},'body':{'from':_0x1fb35d['phone'],'to':_0x5ab163['phone'],'text':_0x5ab163['body']},'json':!![]};return rp(_0x16d4ef)[_0x097d('0x14')](function(_0x4e6eef){if(_0x4e6eef['code']==0xca){_0x3d9a1e[_0x097d('0x69')]=_0x4e6eef;var _0x24f252={'method':_0x097d('0x33'),'uri':_0x097d('0x6a'),'headers':{'Authorization':_0x097d('0x67')+_0x1fb35d[_0x097d('0x53')],'Content-Type':'application/json'},'body':{'refid':_0x3d9a1e[_0x097d('0x69')][_0x097d('0x6b')]},'json':!![]};return rp(_0x24f252)['then'](function(_0x49ac9a){_0x3d9a1e['status']=_0x49ac9a;var _0x18f812={'messageId':_0x3d9a1e[_0x097d('0x69')][_0x097d('0x6b')],'read':!![]};return _0x3b6225['update'](_0x18f812);});}else{return logger['error'](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x6c'),util[_0x097d('0x28')](_0x4e6eef,{'showHidden':![],'depth':null}));}})[_0x097d('0x16')](function(_0x2be928){return logger['error'](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x6c'),util[_0x097d('0x28')](_0x2be928,{'showHidden':![],'depth':null}));});}else{return logger[_0x097d('0x17')](_0x097d('0x26'),_0x097d('0x27'),_0x097d('0x6c'),_0x097d('0x6d'));}break;}}})[_0x097d('0x6e')](function(){_0x2b29d3();});}else{_0x2b29d3();}}},'charset':_0x097d('0x6f'),'collate':_0x097d('0x70')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 3fe7187..2519150 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 _0xcec7=['error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xb4df18,_0x4e4aec){var _0x1ca097=function(_0x206669){while(--_0x206669){_0xb4df18['push'](_0xb4df18['shift']());}};_0x1ca097(++_0x4e4aec);}(_0xcec7,0x14a));var _0x7cec=function(_0x585748,_0x4a86fb){_0x585748=_0x585748-0x0;var _0x35816e=_0xcec7[_0x585748];return _0x35816e;};'use strict';var _=require(_0x7cec('0x0'));var util=require(_0x7cec('0x1'));var moment=require('moment');var BPromise=require(_0x7cec('0x2'));var rs=require(_0x7cec('0x3'));var fs=require('fs');var Redis=require(_0x7cec('0x4'));var db=require(_0x7cec('0x5'))['db'];var utils=require(_0x7cec('0x6'));var logger=require(_0x7cec('0x7'))(_0x7cec('0x8'));var config=require(_0x7cec('0x9'));var jayson=require(_0x7cec('0xa'));var client=jayson[_0x7cec('0xb')][_0x7cec('0xc')]({'port':0x232a});config[_0x7cec('0xd')]=_[_0x7cec('0xe')](config[_0x7cec('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7cec('0xf'))(new Redis(config[_0x7cec('0xd')]));require(_0x7cec('0x10'))['register'](socket);function respondWithRpcPromise(_0x54e02d,_0x5b4c77,_0x5d62c1){return new BPromise(function(_0x5e60cd,_0x3d37e4){return client['request'](_0x54e02d,_0x5d62c1)[_0x7cec('0x11')](function(_0x5f07f2){logger[_0x7cec('0x12')](_0x7cec('0x13'),_0x5b4c77,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5b4c77,_0x7cec('0x14'),JSON[_0x7cec('0x15')](_0x5f07f2));if(_0x5f07f2[_0x7cec('0x16')]){if(_0x5f07f2['error'][_0x7cec('0x17')]===0x1f4){logger[_0x7cec('0x16')](_0x7cec('0x13'),_0x5b4c77,_0x5f07f2[_0x7cec('0x16')][_0x7cec('0x18')]);return _0x3d37e4(_0x5f07f2[_0x7cec('0x16')][_0x7cec('0x18')]);}logger['error'](_0x7cec('0x13'),_0x5b4c77,_0x5f07f2[_0x7cec('0x16')][_0x7cec('0x18')]);return _0x5e60cd(_0x5f07f2[_0x7cec('0x16')][_0x7cec('0x18')]);}else{logger[_0x7cec('0x12')](_0x7cec('0x13'),_0x5b4c77,_0x7cec('0x14'));_0x5e60cd(_0x5f07f2[_0x7cec('0x19')][_0x7cec('0x18')]);}})[_0x7cec('0x1a')](function(_0x1550f3){logger['error'](_0x7cec('0x13'),_0x5b4c77,_0x1550f3);_0x3d37e4(_0x1550f3);});});}exports[_0x7cec('0x1b')]=function(_0x5863fb){var _0x24c950=this;return new Promise(function(_0x139d54,_0xd7054d){return db[_0x7cec('0x1c')][_0x7cec('0x1d')](_0x5863fb[_0x7cec('0x1e')],{'raw':_0x5863fb['options']?_0x5863fb[_0x7cec('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x7cec('0x11')](function(_0x10f446){logger['info'](_0x7cec('0x1b'),_0x5863fb);logger['debug'](_0x7cec('0x1b'),_0x5863fb,JSON[_0x7cec('0x15')](_0x10f446));_0x139d54(_0x10f446);})[_0x7cec('0x1a')](function(_0xbcc2d4){logger['error']('CreateSmsMessage',_0xbcc2d4[_0x7cec('0x18')],_0x5863fb);_0xd7054d(_0x24c950[_0x7cec('0x16')](0x1f4,_0xbcc2d4[_0x7cec('0x18')]));});});}; \ No newline at end of file +var _0x46ab=['message','info','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x46ab,0xd6));var _0xb46a=function(_0x589c76,_0x57afa1){_0x589c76=_0x589c76-0x0;var _0x220943=_0x46ab[_0x589c76];return _0x220943;};'use strict';var _=require(_0xb46a('0x0'));var util=require(_0xb46a('0x1'));var moment=require(_0xb46a('0x2'));var BPromise=require(_0xb46a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb46a('0x4'));var db=require(_0xb46a('0x5'))['db'];var utils=require(_0xb46a('0x6'));var logger=require(_0xb46a('0x7'))(_0xb46a('0x8'));var config=require(_0xb46a('0x9'));var jayson=require(_0xb46a('0xa'));var client=jayson[_0xb46a('0xb')][_0xb46a('0xc')]({'port':0x232a});config[_0xb46a('0xd')]=_[_0xb46a('0xe')](config[_0xb46a('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb46a('0xf'))['register'](socket);function respondWithRpcPromise(_0xafa8e4,_0xb6630b,_0x4922a9){return new BPromise(function(_0x27e5ea,_0x40cdc3){return client[_0xb46a('0x10')](_0xafa8e4,_0x4922a9)[_0xb46a('0x11')](function(_0x30f820){logger['info'](_0xb46a('0x12'),_0xb6630b,'request\x20sent');logger[_0xb46a('0x13')](_0xb46a('0x14'),_0xb6630b,_0xb46a('0x15'),JSON['stringify'](_0x30f820));if(_0x30f820[_0xb46a('0x16')]){if(_0x30f820['error'][_0xb46a('0x17')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0xb6630b,_0x30f820['error'][_0xb46a('0x18')]);return _0x40cdc3(_0x30f820[_0xb46a('0x16')][_0xb46a('0x18')]);}logger[_0xb46a('0x16')](_0xb46a('0x12'),_0xb6630b,_0x30f820[_0xb46a('0x16')][_0xb46a('0x18')]);return _0x27e5ea(_0x30f820[_0xb46a('0x16')][_0xb46a('0x18')]);}else{logger[_0xb46a('0x19')](_0xb46a('0x12'),_0xb6630b,'request\x20sent');_0x27e5ea(_0x30f820[_0xb46a('0x1a')]['message']);}})[_0xb46a('0x1b')](function(_0x1b4387){logger[_0xb46a('0x16')](_0xb46a('0x12'),_0xb6630b,_0x1b4387);_0x40cdc3(_0x1b4387);});});}exports[_0xb46a('0x1c')]=function(_0x2622b3){var _0x365bf2=this;return new Promise(function(_0x1de829,_0x3dcf40){return db[_0xb46a('0x1d')][_0xb46a('0x1e')](_0x2622b3[_0xb46a('0x1f')],{'raw':_0x2622b3['options']?_0x2622b3[_0xb46a('0x20')][_0xb46a('0x21')]===undefined?!![]:![]:!![]})[_0xb46a('0x11')](function(_0x2fcb11){logger[_0xb46a('0x19')](_0xb46a('0x1c'),_0x2622b3);logger['debug'](_0xb46a('0x1c'),_0x2622b3,JSON['stringify'](_0x2fcb11));_0x1de829(_0x2fcb11);})[_0xb46a('0x1b')](function(_0x215e4b){logger['error']('CreateSmsMessage',_0x215e4b[_0xb46a('0x18')],_0x2622b3);_0x3dcf40(_0x365bf2[_0xb46a('0x16')](0x1f4,_0x215e4b['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index fbadd4a..cc6aac0 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 _0x836b=['removeListener','register','length','./smsMessage.events','save','remove','update','emit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x836b,0x1ab));var _0xb836=function(_0x4268f5,_0x4d47d3){_0x4268f5=_0x4268f5-0x0;var _0x2379d0=_0x836b[_0x4268f5];return _0x2379d0;};'use strict';var SmsMessageEvents=require(_0xb836('0x0'));var events=[_0xb836('0x1'),_0xb836('0x2'),_0xb836('0x3')];function createListener(_0xf01742,_0x571968){return function(_0x420e01){_0x571968[_0xb836('0x4')](_0xf01742,_0x420e01);};}function removeListener(_0x4b5f94,_0x3cc8be){return function(){SmsMessageEvents[_0xb836('0x5')](_0x4b5f94,_0x3cc8be);};}exports[_0xb836('0x6')]=function(_0x15ca19){for(var _0x3a1679=0x0,_0x36861e=events[_0xb836('0x7')];_0x3a1679<_0x36861e;_0x3a1679++){var _0x58fc70=events[_0x3a1679];var _0x39d7ec=createListener('smsMessage:'+_0x58fc70,_0x15ca19);SmsMessageEvents['on'](_0x58fc70,_0x39d7ec);}}; \ No newline at end of file +var _0x5058=['smsMessage:','./smsMessage.events','save','remove','update','register','length'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x5058,0x10b));var _0x8505=function(_0x232ec0,_0x45fdd0){_0x232ec0=_0x232ec0-0x0;var _0x356705=_0x5058[_0x232ec0];return _0x356705;};'use strict';var SmsMessageEvents=require(_0x8505('0x0'));var events=[_0x8505('0x1'),_0x8505('0x2'),_0x8505('0x3')];function createListener(_0x252769,_0x254193){return function(_0x25f358){_0x254193['emit'](_0x252769,_0x25f358);};}function removeListener(_0x1254d1,_0xef981b){return function(){SmsMessageEvents['removeListener'](_0x1254d1,_0xef981b);};}exports[_0x8505('0x4')]=function(_0x4ba05e){for(var _0x26616c=0x0,_0x15ed1f=events[_0x8505('0x5')];_0x26616c<_0x15ed1f;_0x26616c++){var _0xc49909=events[_0x26616c];var _0x418e2d=createListener(_0x8505('0x6')+_0xc49909,_0x4ba05e);SmsMessageEvents['on'](_0xc49909,_0x418e2d);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 992c57f..eba0048 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 _0xe17f=['getAgents','post','create','/:id','update','delete','destroy','removeTeams','removeAgents','exports','connect-timeout','express','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0xe17f,0x104));var _0xfe17=function(_0x345f0b,_0x47219e){_0x345f0b=_0x345f0b-0x0;var _0x5528ec=_0xe17f[_0x345f0b];return _0x5528ec;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfe17('0x0'));var express=require(_0xfe17('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfe17('0x2'));var config=require('../../config/environment');var controller=require(_0xfe17('0x3'));router[_0xfe17('0x4')]('/',auth[_0xfe17('0x5')](),controller[_0xfe17('0x6')]);router['get'](_0xfe17('0x7'),auth['isAuthenticated'](),controller[_0xfe17('0x8')]);router[_0xfe17('0x4')]('/:id',auth[_0xfe17('0x5')](),controller[_0xfe17('0x9')]);router[_0xfe17('0x4')](_0xfe17('0xa'),auth[_0xfe17('0x5')](),controller[_0xfe17('0xb')]);router[_0xfe17('0x4')](_0xfe17('0xc'),auth['isAuthenticated'](),controller[_0xfe17('0xd')]);router['get'](_0xfe17('0xe'),auth['isAuthenticated'](),controller[_0xfe17('0xf')]);router[_0xfe17('0x10')]('/',auth[_0xfe17('0x5')](),controller[_0xfe17('0x11')]);router[_0xfe17('0x10')](_0xfe17('0xc'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xfe17('0xe'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xfe17('0x12'),auth[_0xfe17('0x5')](),controller[_0xfe17('0x13')]);router[_0xfe17('0x14')](_0xfe17('0x12'),auth[_0xfe17('0x5')](),controller[_0xfe17('0x15')]);router[_0xfe17('0x14')](_0xfe17('0xc'),auth[_0xfe17('0x5')](),controller[_0xfe17('0x16')]);router[_0xfe17('0x14')]('/:id/users',auth[_0xfe17('0x5')](),controller[_0xfe17('0x17')]);module[_0xfe17('0x18')]=router; \ No newline at end of file +var _0x66ac=['describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66ac,0x1e2));var _0xc66a=function(_0x1ab16e,_0x51b93d){_0x1ab16e=_0x1ab16e-0x0;var _0x3fa067=_0x66ac[_0x1ab16e];return _0x3fa067;};'use strict';var multer=require(_0xc66a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc66a('0x1'));var express=require(_0xc66a('0x2'));var router=express['Router']();var auth=require(_0xc66a('0x3'));var interaction=require(_0xc66a('0x4'));var config=require(_0xc66a('0x5'));var controller=require(_0xc66a('0x6'));router[_0xc66a('0x7')]('/',auth[_0xc66a('0x8')](),controller[_0xc66a('0x9')]);router[_0xc66a('0x7')](_0xc66a('0xa'),auth['isAuthenticated'](),controller[_0xc66a('0xb')]);router[_0xc66a('0x7')](_0xc66a('0xc'),auth[_0xc66a('0x8')](),controller[_0xc66a('0xd')]);router[_0xc66a('0x7')]('/:id/members',auth[_0xc66a('0x8')](),controller[_0xc66a('0xe')]);router[_0xc66a('0x7')](_0xc66a('0xf'),auth[_0xc66a('0x8')](),controller[_0xc66a('0x10')]);router[_0xc66a('0x7')](_0xc66a('0x11'),auth[_0xc66a('0x8')](),controller[_0xc66a('0x12')]);router[_0xc66a('0x13')]('/',auth[_0xc66a('0x8')](),controller[_0xc66a('0x14')]);router[_0xc66a('0x13')](_0xc66a('0xf'),auth[_0xc66a('0x8')](),controller[_0xc66a('0x15')]);router[_0xc66a('0x13')]('/:id/users',auth[_0xc66a('0x8')](),controller[_0xc66a('0x16')]);router[_0xc66a('0x17')](_0xc66a('0xc'),auth[_0xc66a('0x8')](),controller['update']);router[_0xc66a('0x18')](_0xc66a('0xc'),auth[_0xc66a('0x8')](),controller[_0xc66a('0x19')]);router[_0xc66a('0x18')](_0xc66a('0xf'),auth[_0xc66a('0x8')](),controller[_0xc66a('0x1a')]);router[_0xc66a('0x18')](_0xc66a('0x11'),auth[_0xc66a('0x8')](),controller[_0xc66a('0x1b')]);module[_0xc66a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 901f4d0..3ad19f1 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 _0xf13f=['STRING','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x14dc8a,_0x4fe14d){var _0xc2be12=function(_0x3201d7){while(--_0x3201d7){_0x14dc8a['push'](_0x14dc8a['shift']());}};_0xc2be12(++_0x4fe14d);}(_0xf13f,0xb2));var _0xff13=function(_0x5baf49,_0x4d3996){_0x5baf49=_0x5baf49-0x0;var _0x1afae8=_0xf13f[_0x5baf49];return _0x1afae8;};'use strict';var Sequelize=require(_0xff13('0x0'));module[_0xff13('0x1')]={'name':{'type':Sequelize[_0xff13('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xff13('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff13('0x3')](_0xff13('0x4'),'beepall',_0xff13('0x5'))}}; \ No newline at end of file +var _0x4b7f=['sequelize','exports','STRING','INTEGER','rrmemory','roundrobin'];(function(_0x3f391d,_0x107e27){var _0x1c4105=function(_0x132068){while(--_0x132068){_0x3f391d['push'](_0x3f391d['shift']());}};_0x1c4105(++_0x107e27);}(_0x4b7f,0x1d4));var _0xf4b7=function(_0x43ed27,_0xf281ea){_0x43ed27=_0x43ed27-0x0;var _0x4580f7=_0x4b7f[_0x43ed27];return _0x4580f7;};'use strict';var Sequelize=require(_0xf4b7('0x0'));module[_0xf4b7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf4b7('0x2')]},'timeout':{'type':Sequelize[_0xf4b7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf4b7('0x4'),'beepall',_0xf4b7('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b6aa377..400a55a 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 _0x22b8=['filters','pick','filter','map','type','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','keys','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','update','body','params','describe','getMembers','UserSmsQueue','length','SmsQueueId','User','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','options','hasOwnProperty','addTeams','addAgents','penalty','ids','Agents','union','removeAgents','removeTeams','spread','emit','isArray','userSmsQueue:remove','getAgents','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','get','end','error','name','send','SmsQueue','query','model','attributes','intersection','fields','nolimit','limit','order','sort','where'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x22b8,0xab));var _0x822b=function(_0x5f2098,_0x47308b){_0x5f2098=_0x5f2098-0x0;var _0x18af32=_0x22b8[_0x5f2098];return _0x18af32;};'use strict';var pdf=require(_0x822b('0x0'));var emlformat=require(_0x822b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x822b('0x2'));var jsonpatch=require(_0x822b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x822b('0x4'));var Mustache=require(_0x822b('0x5'));var util=require('util');var path=require(_0x822b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x822b('0x7'));var fs=require('fs');var _=require(_0x822b('0x8'));var squel=require('squel');var crypto=require(_0x822b('0x9'));var jsforce=require(_0x822b('0xa'));var deskjs=require(_0x822b('0xb'));var toCsv=require(_0x822b('0xc'));var querystring=require(_0x822b('0xd'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x822b('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x822b('0xf'))(_0x822b('0x10'));var utils=require(_0x822b('0x11'));var config=require(_0x822b('0x12'));var db=require(_0x822b('0x13'))['db'];config[_0x822b('0x14')]=_['defaults'](config[_0x822b('0x14')],{'host':_0x822b('0x15'),'port':0x18eb});var socket=require(_0x822b('0x16'))(new Redis(config[_0x822b('0x14')]));require(_0x822b('0x17'))[_0x822b('0x18')](socket);function respondWithStatusCode(_0x4428bc,_0x3fffad){_0x3fffad=_0x3fffad||0xcc;return function(_0x3a478b){if(_0x3a478b){return _0x4428bc[_0x822b('0x19')](_0x3fffad);}return _0x4428bc[_0x822b('0x1a')](_0x3fffad)['end']();};}function respondWithResult(_0xfc436,_0x4818f2){_0x4818f2=_0x4818f2||0xc8;return function(_0xc3f9e5){if(_0xc3f9e5){return _0xfc436[_0x822b('0x1a')](_0x4818f2)['json'](_0xc3f9e5);}};}function respondWithFilteredResult(_0x374467,_0x7bc690){return function(_0xad419a){if(_0xad419a){var _0x36c475=_0xad419a[_0x822b('0x1b')],_0x41d67f=_0x7bc690[_0x822b('0x1c')],_0xe510cc=_0x7bc690[_0x822b('0x1c')]+_0x7bc690['limit'],_0x5735f0;if(_0xe510cc>=_0x36c475){_0xe510cc=_0x36c475;_0x5735f0=0xc8;}else{_0x5735f0=0xce;}_0x374467[_0x822b('0x1a')](_0x5735f0);return _0x374467[_0x822b('0x1d')](_0x822b('0x1e'),_0x41d67f+'-'+_0xe510cc+'/'+_0x36c475)[_0x822b('0x1f')](_0xad419a);}return null;};}function patchUpdates(_0x3bf6de){return function(_0xd71b5c){try{jsonpatch[_0x822b('0x20')](_0xd71b5c,_0x3bf6de,!![]);}catch(_0x2a0f73){return BPromise[_0x822b('0x21')](_0x2a0f73);}return _0xd71b5c[_0x822b('0x22')]();};}function saveUpdates(_0x31cd3c,_0x4be384){return function(_0x5b3523){if(_0x5b3523){return _0x5b3523['update'](_0x31cd3c)[_0x822b('0x23')](function(_0x245544){return _0x245544;});}return null;};}function removeEntity(_0x515acb,_0x4a2156){return function(_0x388406){if(_0x388406){return _0x388406[_0x822b('0x24')]()[_0x822b('0x23')](function(){var _0x23bf61=_0x388406[_0x822b('0x25')]({'plain':!![]});var _0x5d19be='SmsQueues';return db['UserProfileResource'][_0x822b('0x24')]({'where':{'type':_0x5d19be,'resourceId':_0x23bf61['id']}})[_0x822b('0x23')](function(){return _0x388406;});})[_0x822b('0x23')](function(){_0x515acb[_0x822b('0x1a')](0xcc)[_0x822b('0x26')]();});}};}function handleEntityNotFound(_0x4f2e4d,_0x4eef3b){return function(_0x2027be){if(!_0x2027be){_0x4f2e4d[_0x822b('0x19')](0x194);}return _0x2027be;};}function handleError(_0x416386,_0x4a06d5){_0x4a06d5=_0x4a06d5||0x1f4;return function(_0x59281d){logger[_0x822b('0x27')](_0x59281d['stack']);if(_0x59281d['name']){delete _0x59281d[_0x822b('0x28')];}_0x416386[_0x822b('0x1a')](_0x4a06d5)[_0x822b('0x29')](_0x59281d);};}exports['index']=function(_0x35cd33,_0x4aa312){var _0x522f2c={},_0x4a98a0={},_0x4cb0f9={'count':0x0,'rows':[]};var _0x29b359=db[_0x822b('0x2a')]['rawAttributes'];_0x4a98a0['model']=_['keys'](_0x29b359);_0x4a98a0[_0x822b('0x2b')]=_['keys'](_0x35cd33[_0x822b('0x2b')]);_0x4a98a0['filters']=_['intersection'](_0x4a98a0[_0x822b('0x2c')],_0x4a98a0['query']);_0x522f2c[_0x822b('0x2d')]=_[_0x822b('0x2e')](_0x4a98a0[_0x822b('0x2c')],qs[_0x822b('0x2f')](_0x35cd33[_0x822b('0x2b')][_0x822b('0x2f')]));_0x522f2c[_0x822b('0x2d')]=_0x522f2c[_0x822b('0x2d')]['length']?_0x522f2c[_0x822b('0x2d')]:_0x4a98a0[_0x822b('0x2c')];if(!_0x35cd33[_0x822b('0x2b')]['hasOwnProperty'](_0x822b('0x30'))){_0x522f2c[_0x822b('0x31')]=qs[_0x822b('0x31')](_0x35cd33[_0x822b('0x2b')][_0x822b('0x31')]);_0x522f2c[_0x822b('0x1c')]=qs['offset'](_0x35cd33[_0x822b('0x2b')][_0x822b('0x1c')]);}_0x522f2c[_0x822b('0x32')]=qs[_0x822b('0x33')](_0x35cd33[_0x822b('0x2b')][_0x822b('0x33')]);_0x522f2c[_0x822b('0x34')]=qs[_0x822b('0x35')](_[_0x822b('0x36')](_0x35cd33[_0x822b('0x2b')],_0x4a98a0['filters']));if(_0x35cd33[_0x822b('0x2b')][_0x822b('0x37')]){_0x522f2c[_0x822b('0x34')]=_['merge'](_0x522f2c[_0x822b('0x34')],{'$or':_[_0x822b('0x38')](_0x29b359,function(_0x343006){if(_0x343006[_0x822b('0x39')]['key']!==_0x822b('0x3a')){var _0x16ea32={};_0x16ea32[_0x343006[_0x822b('0x3b')]]={'$like':'%'+_0x35cd33[_0x822b('0x2b')][_0x822b('0x37')]+'%'};return _0x16ea32;}})});}_0x522f2c=_[_0x822b('0x3c')]({},_0x522f2c,_0x35cd33['options']);var _0x3d080d={'where':_0x522f2c['where']};return db[_0x822b('0x2a')][_0x822b('0x1b')](_0x3d080d)[_0x822b('0x23')](function(_0x32123c){_0x4cb0f9[_0x822b('0x1b')]=_0x32123c;if(_0x35cd33[_0x822b('0x2b')][_0x822b('0x3d')]){_0x522f2c[_0x822b('0x3e')]=[{'all':!![]}];}return db[_0x822b('0x2a')][_0x822b('0x3f')](_0x522f2c);})['then'](function(_0x2d1d4a){_0x4cb0f9[_0x822b('0x40')]=_0x2d1d4a;return _0x4cb0f9;})['then'](respondWithFilteredResult(_0x4aa312,_0x522f2c))[_0x822b('0x41')](handleError(_0x4aa312,null));};exports['show']=function(_0x1c9cdf,_0x207882){var _0xbd3c73={'raw':!![],'where':{'id':_0x1c9cdf['params']['id']}},_0x191d54={};_0x191d54[_0x822b('0x2c')]=_[_0x822b('0x42')](db[_0x822b('0x2a')][_0x822b('0x43')]);_0x191d54[_0x822b('0x2b')]=_[_0x822b('0x42')](_0x1c9cdf[_0x822b('0x2b')]);_0x191d54['filters']=_[_0x822b('0x2e')](_0x191d54['model'],_0x191d54[_0x822b('0x2b')]);_0xbd3c73['attributes']=_[_0x822b('0x2e')](_0x191d54[_0x822b('0x2c')],qs[_0x822b('0x2f')](_0x1c9cdf[_0x822b('0x2b')]['fields']));_0xbd3c73['attributes']=_0xbd3c73[_0x822b('0x2d')]['length']?_0xbd3c73['attributes']:_0x191d54[_0x822b('0x2c')];if(_0x1c9cdf[_0x822b('0x2b')]['includeAll']){_0xbd3c73['include']=[{'all':!![]}];}_0xbd3c73=_[_0x822b('0x3c')]({},_0xbd3c73,_0x1c9cdf['options']);return db[_0x822b('0x2a')]['find'](_0xbd3c73)['then'](handleEntityNotFound(_0x207882,null))[_0x822b('0x23')](respondWithResult(_0x207882,null))[_0x822b('0x41')](handleError(_0x207882,null));};exports[_0x822b('0x44')]=function(_0x2d58cd,_0x2fe8ce){return db['SmsQueue'][_0x822b('0x44')](_0x2d58cd['body'],{})[_0x822b('0x23')](function(_0x5425ec){var _0x3ba132=_0x2d58cd[_0x822b('0x45')][_0x822b('0x25')]({'plain':!![]});if(!_0x3ba132)throw new Error(_0x822b('0x46'));if(_0x3ba132[_0x822b('0x47')]===_0x822b('0x45')){var _0x3b750e=_0x5425ec[_0x822b('0x25')]({'plain':!![]});var _0x34572f=_0x822b('0x48');return db[_0x822b('0x49')][_0x822b('0x4a')]({'where':{'name':_0x34572f,'userProfileId':_0x3ba132[_0x822b('0x4b')]},'raw':!![]})[_0x822b('0x23')](function(_0x39f41f){if(_0x39f41f&&_0x39f41f[_0x822b('0x4c')]===0x0){return db[_0x822b('0x4d')][_0x822b('0x44')]({'name':_0x3b750e[_0x822b('0x28')],'resourceId':_0x3b750e['id'],'type':_0x39f41f[_0x822b('0x28')],'sectionId':_0x39f41f['id']},{})[_0x822b('0x23')](function(){return _0x5425ec;});}else{return _0x5425ec;}})[_0x822b('0x41')](function(_0xcf2edf){logger[_0x822b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcf2edf);throw _0xcf2edf;});}return _0x5425ec;})[_0x822b('0x23')](respondWithResult(_0x2fe8ce,0xc9))['catch'](handleError(_0x2fe8ce,null));};exports[_0x822b('0x4e')]=function(_0xd0ccb2,_0x2177ce){if(_0xd0ccb2['body']['id']){delete _0xd0ccb2[_0x822b('0x4f')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0xd0ccb2[_0x822b('0x50')]['id']}})[_0x822b('0x23')](handleEntityNotFound(_0x2177ce,null))['then'](saveUpdates(_0xd0ccb2['body'],null))[_0x822b('0x23')](respondWithResult(_0x2177ce,null))[_0x822b('0x41')](handleError(_0x2177ce,null));};exports['destroy']=function(_0x66df52,_0x26b193){return db['SmsQueue'][_0x822b('0x4a')]({'where':{'id':_0x66df52['params']['id']}})['then'](handleEntityNotFound(_0x26b193,null))[_0x822b('0x23')](removeEntity(_0x26b193,null))['catch'](handleError(_0x26b193,null));};exports[_0x822b('0x51')]=function(_0x263f0a,_0x88efe3){return db[_0x822b('0x2a')][_0x822b('0x51')]()[_0x822b('0x23')](respondWithResult(_0x88efe3,null))['catch'](handleError(_0x88efe3,null));};exports[_0x822b('0x52')]=function(_0x106aa2,_0x342367,_0x15bc0f){var _0x53dfd1={'raw':!![],'where':{}},_0x4cf854={},_0x3b001a;return db[_0x822b('0x2a')]['findOne']({'where':{'id':_0x106aa2['params']['id']}})[_0x822b('0x23')](handleEntityNotFound(_0x342367,null))[_0x822b('0x23')](function(_0x180518){if(_0x180518){_0x3b001a=_0x180518[_0x822b('0x25')]({'plain':!![]});_0x4cf854[_0x822b('0x2c')]=_[_0x822b('0x42')](db[_0x822b('0x53')][_0x822b('0x43')]);_0x4cf854[_0x822b('0x2b')]=_[_0x822b('0x42')](_0x106aa2[_0x822b('0x2b')]);_0x4cf854['filters']=_['intersection'](_0x4cf854[_0x822b('0x2c')],_0x4cf854[_0x822b('0x2b')]);_0x53dfd1[_0x822b('0x2d')]=_[_0x822b('0x2e')](_0x4cf854['model'],qs[_0x822b('0x2f')](_0x106aa2[_0x822b('0x2b')][_0x822b('0x2f')]));_0x53dfd1[_0x822b('0x2d')]=_0x53dfd1[_0x822b('0x2d')][_0x822b('0x54')]?_0x53dfd1[_0x822b('0x2d')]:_0x4cf854[_0x822b('0x2c')];if(!_0x106aa2[_0x822b('0x2b')]['hasOwnProperty']('nolimit')){_0x53dfd1[_0x822b('0x31')]=qs[_0x822b('0x31')](_0x106aa2['query'][_0x822b('0x31')]);_0x53dfd1[_0x822b('0x1c')]=qs[_0x822b('0x1c')](_0x106aa2[_0x822b('0x2b')][_0x822b('0x1c')]);}_0x53dfd1[_0x822b('0x32')]=qs[_0x822b('0x33')](_0x106aa2[_0x822b('0x2b')][_0x822b('0x33')]);_0x53dfd1[_0x822b('0x34')]=qs[_0x822b('0x35')](_['pick'](_0x106aa2['query'],_0x4cf854[_0x822b('0x35')]));_0x53dfd1['where'][_0x822b('0x55')]=_0x180518['id'];if(_0x106aa2[_0x822b('0x2b')][_0x822b('0x37')]){_0x53dfd1['where']=_[_0x822b('0x3c')](_0x53dfd1[_0x822b('0x34')],{'$or':_[_0x822b('0x38')](_0x53dfd1[_0x822b('0x2d')],function(_0x3653b0){var _0x40a7d8={};_0x40a7d8[_0x3653b0]={'$like':'%'+_0x106aa2[_0x822b('0x2b')][_0x822b('0x37')]+'%'};return _0x40a7d8;})});}_0x53dfd1=_[_0x822b('0x3c')]({},_0x53dfd1,_0x106aa2['options']);return db['UserSmsQueue'][_0x822b('0x3f')](_0x53dfd1);}})['then'](function(_0x292246){if(_0x292246){return db[_0x822b('0x56')]['findAndCountAll']({'where':{'id':_[_0x822b('0x38')](_0x292246,'UserId'),'role':_0x822b('0x57')},'attributes':['id',_0x822b('0x28'),_0x822b('0x58'),_0x822b('0x59'),_0x822b('0x5a')]});}})[_0x822b('0x23')](function(_0x4fb0c1){if(_0x4fb0c1){return{'count':_0x4fb0c1['count'],'rows':_['map'](_0x4fb0c1[_0x822b('0x40')],function(_0x20d69d){return{'membername':_0x20d69d[_0x822b('0x28')],'UserId':_0x20d69d['id'],'queue_name':_0x3b001a[_0x822b('0x28')],'SmsQueueId':_0x3b001a['id'],'interface':util[_0x822b('0x5b')](_0x822b('0x5c'),_0x822b('0x5d'),_0x20d69d[_0x822b('0x28')]),'penalty':0x0,'paused':_0x20d69d[_0x822b('0x58')],'createdAt':_0x20d69d['createdAt'],'updatedAt':_0x20d69d[_0x822b('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x822b('0x23')](respondWithFilteredResult(_0x342367,_0x53dfd1))[_0x822b('0x41')](handleError(_0x342367,null));};exports[_0x822b('0x5e')]=function(_0x41c580,_0x49cef5,_0x50e899){var _0x323d99={};var _0x30deb2={};var _0x4bdbef;var _0xe34764;return db['SmsQueue']['findOne']({'where':{'id':_0x41c580['params']['id']}})[_0x822b('0x23')](handleEntityNotFound(_0x49cef5,null))['then'](function(_0x43dd47){if(_0x43dd47){_0x4bdbef=_0x43dd47;_0x30deb2[_0x822b('0x2c')]=_[_0x822b('0x42')](db[_0x822b('0x5f')][_0x822b('0x43')]);_0x30deb2[_0x822b('0x2b')]=_[_0x822b('0x42')](_0x41c580[_0x822b('0x2b')]);_0x30deb2[_0x822b('0x35')]=_[_0x822b('0x2e')](_0x30deb2[_0x822b('0x2c')],_0x30deb2[_0x822b('0x2b')]);_0x323d99['attributes']=_[_0x822b('0x2e')](_0x30deb2[_0x822b('0x2c')],qs[_0x822b('0x2f')](_0x41c580[_0x822b('0x2b')][_0x822b('0x2f')]));_0x323d99[_0x822b('0x2d')]=_0x323d99[_0x822b('0x2d')]['length']?_0x323d99[_0x822b('0x2d')]:_0x30deb2[_0x822b('0x2c')];_0x323d99[_0x822b('0x32')]=qs['sort'](_0x41c580[_0x822b('0x2b')]['sort']);_0x323d99[_0x822b('0x34')]=qs['filters'](_[_0x822b('0x36')](_0x41c580[_0x822b('0x2b')],_0x30deb2[_0x822b('0x35')]));if(_0x41c580[_0x822b('0x2b')][_0x822b('0x37')]){_0x323d99[_0x822b('0x34')]=_[_0x822b('0x3c')](_0x323d99[_0x822b('0x34')],{'$or':_[_0x822b('0x38')](_0x323d99[_0x822b('0x2d')],function(_0xd02092){var _0x229c70={};_0x229c70[_0xd02092]={'$like':'%'+_0x41c580['query'][_0x822b('0x37')]+'%'};return _0x229c70;})});}_0x323d99=_[_0x822b('0x3c')]({},_0x323d99,_0x41c580[_0x822b('0x60')]);return _0x4bdbef[_0x822b('0x5e')](_0x323d99);}})[_0x822b('0x23')](function(_0x16926c){if(_0x16926c){_0xe34764=_0x16926c['length'];if(!_0x41c580['query'][_0x822b('0x61')](_0x822b('0x30'))){_0x323d99['limit']=qs[_0x822b('0x31')](_0x41c580['query'][_0x822b('0x31')]);_0x323d99['offset']=qs['offset'](_0x41c580[_0x822b('0x2b')]['offset']);}return _0x4bdbef[_0x822b('0x5e')](_0x323d99);}})[_0x822b('0x23')](function(_0x3694b9){if(_0x3694b9){return _0x3694b9?{'count':_0xe34764,'rows':_0x3694b9}:null;}})[_0x822b('0x23')](respondWithResult(_0x49cef5,null))[_0x822b('0x41')](handleError(_0x49cef5,null));};exports[_0x822b('0x62')]=function(_0x1a3f07,_0x170c0a,_0x594a9b){var _0x39189c=[];var _0x215661;return db['Team'][_0x822b('0x3f')]({'where':{'id':_0x1a3f07[_0x822b('0x4f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x822b('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x822b('0x23')](function(_0x3fb3d1){if(_0x3fb3d1){for(var _0x5383a9=0x0;_0x5383a9<_0x3fb3d1['length'];_0x5383a9+=0x1){for(var _0x5dd76d=0x0;_0x5dd76d<_0x3fb3d1[_0x5383a9]['Agents']['length'];_0x5dd76d+=0x1){_0x39189c=_['union'](_0x39189c,[_0x3fb3d1[_0x5383a9]['Agents'][_0x5dd76d]['id']]);}}return _0x39189c;}})[_0x822b('0x23')](function(_0x2ce142){if(_0x2ce142){return db[_0x822b('0x2a')][_0x822b('0x4a')]({'where':{'id':_0x1a3f07[_0x822b('0x50')]['id']}});}})['then'](function(_0x2d1b1b){if(_0x2d1b1b){_0x215661=_0x2d1b1b;return _0x215661[_0x822b('0x63')](_0x39189c,{'penalty':_0x1a3f07[_0x822b('0x4f')][_0x822b('0x64')]});}})[_0x822b('0x23')](function(_0x490c35){if(_0x490c35){return _0x215661[_0x822b('0x62')](_0x1a3f07[_0x822b('0x4f')][_0x822b('0x65')]);}})[_0x822b('0x23')](handleEntityNotFound(_0x170c0a,null))[_0x822b('0x23')](respondWithStatusCode(_0x170c0a,null))['catch'](handleError(_0x170c0a,null));};exports['removeTeams']=function(_0x4d493a,_0x3fe7a4,_0x3a8b1e){var _0x5dbedf=[];var _0x2e9f47;return db['Team'][_0x822b('0x3f')]({'where':{'id':_0x4d493a[_0x822b('0x2b')][_0x822b('0x65')]},'attributes':['id'],'include':[{'model':db[_0x822b('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x822b('0x23')](function(_0x6bffa0){if(_0x6bffa0){for(var _0x149f80=0x0;_0x149f80<_0x6bffa0[_0x822b('0x54')];_0x149f80+=0x1){for(var _0x5d0b7e=0x0;_0x5d0b7e<_0x6bffa0[_0x149f80][_0x822b('0x66')]['length'];_0x5d0b7e+=0x1){_0x5dbedf=_[_0x822b('0x67')](_0x5dbedf,[_0x6bffa0[_0x149f80][_0x822b('0x66')][_0x5d0b7e]['id']]);}}return _0x5dbedf;}})[_0x822b('0x23')](function(_0x1e4b15){if(_0x1e4b15){return db[_0x822b('0x2a')][_0x822b('0x4a')]({'where':{'id':_0x4d493a[_0x822b('0x50')]['id']}});}})[_0x822b('0x23')](function(_0x1a3663){if(_0x1a3663){_0x2e9f47=_0x1a3663;return _0x2e9f47[_0x822b('0x68')](_0x5dbedf);}})[_0x822b('0x23')](function(_0xfb1cc8){if(_0x2e9f47){return _0x2e9f47[_0x822b('0x69')](_0x4d493a['query'][_0x822b('0x65')]);}})['then'](handleEntityNotFound(_0x3fe7a4,null))[_0x822b('0x23')](respondWithStatusCode(_0x3fe7a4,null))['catch'](handleError(_0x3fe7a4,null));};exports[_0x822b('0x63')]=function(_0x537996,_0x702b63,_0x4f252d){return db['SmsQueue'][_0x822b('0x4a')]({'where':{'id':_0x537996[_0x822b('0x50')]['id']}})[_0x822b('0x23')](handleEntityNotFound(_0x702b63,null))[_0x822b('0x23')](function(_0x15370b){if(_0x15370b){return _0x15370b[_0x822b('0x63')](_0x537996[_0x822b('0x4f')][_0x822b('0x65')],_['omit'](_0x537996['body'],[_0x822b('0x65'),'id'])||{})[_0x822b('0x6a')](function(_0x584b2f){for(var _0x2c8351=0x0;_0x2c8351<_0x537996[_0x822b('0x4f')]['ids'][_0x822b('0x54')];_0x2c8351+=0x1){socket[_0x822b('0x6b')]('userSmsQueue:save',{'UserId':_0x537996[_0x822b('0x4f')][_0x822b('0x65')][_0x2c8351],'SmsQueueId':_0x537996['params']['id']});}return _0x584b2f;});}})[_0x822b('0x23')](respondWithResult(_0x702b63,null))['catch'](handleError(_0x702b63,null));};exports['removeAgents']=function(_0x919220,_0x5467ce,_0x4a9dc1){var _0x321d62;return db[_0x822b('0x2a')]['find']({'where':{'id':_0x919220['params']['id']}})[_0x822b('0x23')](handleEntityNotFound(_0x5467ce,null))[_0x822b('0x23')](function(_0x152353){if(_0x152353){return _0x152353[_0x822b('0x68')](_0x919220[_0x822b('0x2b')][_0x822b('0x65')])[_0x822b('0x23')](function(_0x452162){if(_[_0x822b('0x6c')](_0x919220[_0x822b('0x2b')]['ids'])){for(var _0x44512e=0x0;_0x44512e<_0x919220['query']['ids'][_0x822b('0x54')];_0x44512e+=0x1){socket[_0x822b('0x6b')](_0x822b('0x6d'),{'UserId':_0x919220['query'][_0x822b('0x65')][_0x44512e],'SmsQueueId':_0x919220[_0x822b('0x50')]['id']});}}else{socket[_0x822b('0x6b')](_0x822b('0x6d'),{'UserId':_0x919220[_0x822b('0x2b')]['ids'],'SmsQueueId':_0x919220[_0x822b('0x50')]['id']});}});}})[_0x822b('0x23')](respondWithStatusCode(_0x5467ce,null))[_0x822b('0x41')](handleError(_0x5467ce,null));};exports[_0x822b('0x6e')]=function(_0x497fef,_0x5796f7,_0x537e17){var _0x3b9d74={};var _0x1efaf0={};var _0x11b438;var _0x12488c;return db[_0x822b('0x2a')][_0x822b('0x6f')]({'where':{'id':_0x497fef['params']['id']}})['then'](handleEntityNotFound(_0x5796f7,null))[_0x822b('0x23')](function(_0x3b9a91){if(_0x3b9a91){_0x11b438=_0x3b9a91;_0x1efaf0['model']=_[_0x822b('0x42')](db[_0x822b('0x56')][_0x822b('0x43')]);_0x1efaf0[_0x822b('0x2b')]=_[_0x822b('0x42')](_0x497fef['query']);_0x1efaf0[_0x822b('0x35')]=_[_0x822b('0x2e')](_0x1efaf0[_0x822b('0x2c')],_0x1efaf0[_0x822b('0x2b')]);_0x3b9d74['attributes']=_[_0x822b('0x2e')](_0x1efaf0[_0x822b('0x2c')],qs['fields'](_0x497fef[_0x822b('0x2b')][_0x822b('0x2f')]));_0x3b9d74[_0x822b('0x2d')]=_0x3b9d74['attributes'][_0x822b('0x54')]?_0x3b9d74['attributes']:_0x1efaf0[_0x822b('0x2c')];_0x3b9d74[_0x822b('0x32')]=qs[_0x822b('0x33')](_0x497fef[_0x822b('0x2b')][_0x822b('0x33')]);_0x3b9d74[_0x822b('0x34')]=qs['filters'](_['pick'](_0x497fef['query'],_0x1efaf0[_0x822b('0x35')]));if(_0x497fef[_0x822b('0x2b')]['filter']){_0x3b9d74['where']=_['merge'](_0x3b9d74[_0x822b('0x34')],{'$or':_['map'](_0x3b9d74['attributes'],function(_0x5e4c46){var _0x31a09e={};_0x31a09e[_0x5e4c46]={'$like':'%'+_0x497fef[_0x822b('0x2b')][_0x822b('0x37')]+'%'};return _0x31a09e;})});}_0x3b9d74=_['merge']({},_0x3b9d74,_0x497fef[_0x822b('0x60')]);return _0x11b438[_0x822b('0x6e')](_0x3b9d74);}})['then'](function(_0x1bca7f){if(_0x1bca7f){_0x12488c=_0x1bca7f['length'];if(!_0x497fef['query']['hasOwnProperty'](_0x822b('0x30'))){_0x3b9d74[_0x822b('0x31')]=qs[_0x822b('0x31')](_0x497fef['query'][_0x822b('0x31')]);_0x3b9d74[_0x822b('0x1c')]=qs[_0x822b('0x1c')](_0x497fef[_0x822b('0x2b')][_0x822b('0x1c')]);}return _0x11b438['getAgents'](_0x3b9d74);}})[_0x822b('0x23')](function(_0x5a234c){if(_0x5a234c){return _0x5a234c?{'count':_0x12488c,'rows':_0x5a234c}:null;}})[_0x822b('0x23')](respondWithResult(_0x5796f7,null))['catch'](handleError(_0x5796f7,null));}; \ No newline at end of file +var _0xc197=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','SmsQueue','includeAll','findAll','rows','show','params','rawAttributes','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','getTeams','findOne','Team','addTeams','ids','Agents','union','penalty','removeAgents','removeTeams','omit','spread','emit','userSmsQueue:save','isArray','getAgents','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','SmsQueues','UserProfileResource','end','stack','name','send','index','keys','query','filters','intersection'];(function(_0x256080,_0x485298){var _0x32ce47=function(_0x139892){while(--_0x139892){_0x256080['push'](_0x256080['shift']());}};_0x32ce47(++_0x485298);}(_0xc197,0xac));var _0x7c19=function(_0x207c32,_0x2d1858){_0x207c32=_0x207c32-0x0;var _0x4c0b06=_0xc197[_0x207c32];return _0x4c0b06;};'use strict';var pdf=require(_0x7c19('0x0'));var emlformat=require(_0x7c19('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7c19('0x2'));var moment=require(_0x7c19('0x3'));var BPromise=require(_0x7c19('0x4'));var Mustache=require(_0x7c19('0x5'));var util=require(_0x7c19('0x6'));var path=require(_0x7c19('0x7'));var sox=require(_0x7c19('0x8'));var csv=require('to-csv');var ejs=require(_0x7c19('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7c19('0xa'));var crypto=require(_0x7c19('0xb'));var jsforce=require(_0x7c19('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x7c19('0xd'));var hardwareService=require(_0x7c19('0xe'));var Redis=require(_0x7c19('0xf'));var qs=require(_0x7c19('0x10'));var logger=require(_0x7c19('0x11'))(_0x7c19('0x12'));var utils=require(_0x7c19('0x13'));var config=require(_0x7c19('0x14'));var db=require('../../mysqldb')['db'];config[_0x7c19('0x15')]=_[_0x7c19('0x16')](config[_0x7c19('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c19('0x17'))(new Redis(config[_0x7c19('0x15')]));require('./smsQueue.socket')[_0x7c19('0x18')](socket);function respondWithStatusCode(_0x48ba73,_0x1f6b4b){_0x1f6b4b=_0x1f6b4b||0xcc;return function(_0x1665c0){if(_0x1665c0){return _0x48ba73[_0x7c19('0x19')](_0x1f6b4b);}return _0x48ba73[_0x7c19('0x1a')](_0x1f6b4b)['end']();};}function respondWithResult(_0x101ad3,_0x3b07f1){_0x3b07f1=_0x3b07f1||0xc8;return function(_0x1fbda9){if(_0x1fbda9){return _0x101ad3['status'](_0x3b07f1)[_0x7c19('0x1b')](_0x1fbda9);}};}function respondWithFilteredResult(_0x541c5e,_0x5b39dc){return function(_0x533a7c){if(_0x533a7c){var _0x347700=_0x533a7c[_0x7c19('0x1c')],_0x4e52e3=_0x5b39dc['offset'],_0x24d8cb=_0x5b39dc[_0x7c19('0x1d')]+_0x5b39dc[_0x7c19('0x1e')],_0x5592b6;if(_0x24d8cb>=_0x347700){_0x24d8cb=_0x347700;_0x5592b6=0xc8;}else{_0x5592b6=0xce;}_0x541c5e['status'](_0x5592b6);return _0x541c5e['set'](_0x7c19('0x1f'),_0x4e52e3+'-'+_0x24d8cb+'/'+_0x347700)[_0x7c19('0x1b')](_0x533a7c);}return null;};}function patchUpdates(_0x493a46){return function(_0x5d78e){try{jsonpatch[_0x7c19('0x20')](_0x5d78e,_0x493a46,!![]);}catch(_0x135482){return BPromise[_0x7c19('0x21')](_0x135482);}return _0x5d78e[_0x7c19('0x22')]();};}function saveUpdates(_0x3aac2b,_0xe483a4){return function(_0x12243f){if(_0x12243f){return _0x12243f[_0x7c19('0x23')](_0x3aac2b)['then'](function(_0x55e113){return _0x55e113;});}return null;};}function removeEntity(_0x43e695,_0x4cff2c){return function(_0x6ca4f3){if(_0x6ca4f3){return _0x6ca4f3['destroy']()[_0x7c19('0x24')](function(){var _0x54a5c3=_0x6ca4f3['get']({'plain':!![]});var _0x2d56fc=_0x7c19('0x25');return db[_0x7c19('0x26')]['destroy']({'where':{'type':_0x2d56fc,'resourceId':_0x54a5c3['id']}})[_0x7c19('0x24')](function(){return _0x6ca4f3;});})['then'](function(){_0x43e695[_0x7c19('0x1a')](0xcc)[_0x7c19('0x27')]();});}};}function handleEntityNotFound(_0x411068,_0x2c26d4){return function(_0x3a42fc){if(!_0x3a42fc){_0x411068[_0x7c19('0x19')](0x194);}return _0x3a42fc;};}function handleError(_0x3f8a70,_0x5786f9){_0x5786f9=_0x5786f9||0x1f4;return function(_0x268970){logger['error'](_0x268970[_0x7c19('0x28')]);if(_0x268970[_0x7c19('0x29')]){delete _0x268970[_0x7c19('0x29')];}_0x3f8a70['status'](_0x5786f9)[_0x7c19('0x2a')](_0x268970);};}exports[_0x7c19('0x2b')]=function(_0x4d8cde,_0x334274){var _0x253c18={},_0x19920a={},_0x504496={'count':0x0,'rows':[]};var _0x2b6ee3=db['SmsQueue']['rawAttributes'];_0x19920a['model']=_[_0x7c19('0x2c')](_0x2b6ee3);_0x19920a[_0x7c19('0x2d')]=_[_0x7c19('0x2c')](_0x4d8cde[_0x7c19('0x2d')]);_0x19920a[_0x7c19('0x2e')]=_[_0x7c19('0x2f')](_0x19920a[_0x7c19('0x30')],_0x19920a['query']);_0x253c18[_0x7c19('0x31')]=_['intersection'](_0x19920a[_0x7c19('0x30')],qs['fields'](_0x4d8cde[_0x7c19('0x2d')][_0x7c19('0x32')]));_0x253c18[_0x7c19('0x31')]=_0x253c18[_0x7c19('0x31')][_0x7c19('0x33')]?_0x253c18['attributes']:_0x19920a['model'];if(!_0x4d8cde['query'][_0x7c19('0x34')](_0x7c19('0x35'))){_0x253c18['limit']=qs[_0x7c19('0x1e')](_0x4d8cde[_0x7c19('0x2d')][_0x7c19('0x1e')]);_0x253c18[_0x7c19('0x1d')]=qs[_0x7c19('0x1d')](_0x4d8cde[_0x7c19('0x2d')][_0x7c19('0x1d')]);}_0x253c18[_0x7c19('0x36')]=qs[_0x7c19('0x37')](_0x4d8cde['query'][_0x7c19('0x37')]);_0x253c18[_0x7c19('0x38')]=qs[_0x7c19('0x2e')](_[_0x7c19('0x39')](_0x4d8cde[_0x7c19('0x2d')],_0x19920a[_0x7c19('0x2e')]));if(_0x4d8cde[_0x7c19('0x2d')][_0x7c19('0x3a')]){_0x253c18['where']=_[_0x7c19('0x3b')](_0x253c18['where'],{'$or':_[_0x7c19('0x3c')](_0x2b6ee3,function(_0x29287f){if(_0x29287f['type']['key']!==_0x7c19('0x3d')){var _0x3c551a={};_0x3c551a[_0x29287f[_0x7c19('0x3e')]]={'$like':'%'+_0x4d8cde[_0x7c19('0x2d')][_0x7c19('0x3a')]+'%'};return _0x3c551a;}})});}_0x253c18=_[_0x7c19('0x3b')]({},_0x253c18,_0x4d8cde[_0x7c19('0x3f')]);var _0x3697a0={'where':_0x253c18['where']};return db[_0x7c19('0x40')][_0x7c19('0x1c')](_0x3697a0)[_0x7c19('0x24')](function(_0x194648){_0x504496[_0x7c19('0x1c')]=_0x194648;if(_0x4d8cde[_0x7c19('0x2d')][_0x7c19('0x41')]){_0x253c18['include']=[{'all':!![]}];}return db['SmsQueue'][_0x7c19('0x42')](_0x253c18);})[_0x7c19('0x24')](function(_0x3c8b2e){_0x504496[_0x7c19('0x43')]=_0x3c8b2e;return _0x504496;})[_0x7c19('0x24')](respondWithFilteredResult(_0x334274,_0x253c18))['catch'](handleError(_0x334274,null));};exports[_0x7c19('0x44')]=function(_0x1641f1,_0x196005){var _0x39330d={'raw':!![],'where':{'id':_0x1641f1[_0x7c19('0x45')]['id']}},_0x38f4ec={};_0x38f4ec[_0x7c19('0x30')]=_[_0x7c19('0x2c')](db[_0x7c19('0x40')][_0x7c19('0x46')]);_0x38f4ec[_0x7c19('0x2d')]=_[_0x7c19('0x2c')](_0x1641f1[_0x7c19('0x2d')]);_0x38f4ec[_0x7c19('0x2e')]=_[_0x7c19('0x2f')](_0x38f4ec[_0x7c19('0x30')],_0x38f4ec[_0x7c19('0x2d')]);_0x39330d[_0x7c19('0x31')]=_[_0x7c19('0x2f')](_0x38f4ec[_0x7c19('0x30')],qs[_0x7c19('0x32')](_0x1641f1[_0x7c19('0x2d')]['fields']));_0x39330d['attributes']=_0x39330d['attributes'][_0x7c19('0x33')]?_0x39330d[_0x7c19('0x31')]:_0x38f4ec[_0x7c19('0x30')];if(_0x1641f1[_0x7c19('0x2d')][_0x7c19('0x41')]){_0x39330d['include']=[{'all':!![]}];}_0x39330d=_['merge']({},_0x39330d,_0x1641f1[_0x7c19('0x3f')]);return db[_0x7c19('0x40')]['find'](_0x39330d)['then'](handleEntityNotFound(_0x196005,null))['then'](respondWithResult(_0x196005,null))[_0x7c19('0x47')](handleError(_0x196005,null));};exports[_0x7c19('0x48')]=function(_0x262ad3,_0x243421){return db[_0x7c19('0x40')][_0x7c19('0x48')](_0x262ad3[_0x7c19('0x49')],{})[_0x7c19('0x24')](function(_0xf523ff){var _0x27c197=_0x262ad3[_0x7c19('0x4a')][_0x7c19('0x4b')]({'plain':!![]});if(!_0x27c197)throw new Error(_0x7c19('0x4c'));if(_0x27c197[_0x7c19('0x4d')]==='user'){var _0x2aae6b=_0xf523ff[_0x7c19('0x4b')]({'plain':!![]});var _0x573b0c=_0x7c19('0x25');return db[_0x7c19('0x4e')]['find']({'where':{'name':_0x573b0c,'userProfileId':_0x27c197[_0x7c19('0x4f')]},'raw':!![]})[_0x7c19('0x24')](function(_0x246350){if(_0x246350&&_0x246350[_0x7c19('0x50')]===0x0){return db['UserProfileResource'][_0x7c19('0x48')]({'name':_0x2aae6b['name'],'resourceId':_0x2aae6b['id'],'type':_0x246350[_0x7c19('0x29')],'sectionId':_0x246350['id']},{})[_0x7c19('0x24')](function(){return _0xf523ff;});}else{return _0xf523ff;}})[_0x7c19('0x47')](function(_0xf0d977){logger[_0x7c19('0x51')](_0x7c19('0x52'),_0xf0d977);throw _0xf0d977;});}return _0xf523ff;})[_0x7c19('0x24')](respondWithResult(_0x243421,0xc9))[_0x7c19('0x47')](handleError(_0x243421,null));};exports['update']=function(_0x142320,_0x417756){if(_0x142320['body']['id']){delete _0x142320[_0x7c19('0x49')]['id'];}return db[_0x7c19('0x40')][_0x7c19('0x53')]({'where':{'id':_0x142320[_0x7c19('0x45')]['id']}})[_0x7c19('0x24')](handleEntityNotFound(_0x417756,null))[_0x7c19('0x24')](saveUpdates(_0x142320[_0x7c19('0x49')],null))[_0x7c19('0x24')](respondWithResult(_0x417756,null))[_0x7c19('0x47')](handleError(_0x417756,null));};exports['destroy']=function(_0x25529e,_0x4131f1){return db['SmsQueue'][_0x7c19('0x53')]({'where':{'id':_0x25529e['params']['id']}})[_0x7c19('0x24')](handleEntityNotFound(_0x4131f1,null))[_0x7c19('0x24')](removeEntity(_0x4131f1,null))[_0x7c19('0x47')](handleError(_0x4131f1,null));};exports[_0x7c19('0x54')]=function(_0x5a318a,_0x50cc09){return db[_0x7c19('0x40')][_0x7c19('0x54')]()['then'](respondWithResult(_0x50cc09,null))[_0x7c19('0x47')](handleError(_0x50cc09,null));};exports['getMembers']=function(_0x3a179f,_0x20fbcf,_0x1d681e){var _0x5ae707={'raw':!![],'where':{}},_0x75ece9={},_0x53797a;return db[_0x7c19('0x40')]['findOne']({'where':{'id':_0x3a179f[_0x7c19('0x45')]['id']}})[_0x7c19('0x24')](handleEntityNotFound(_0x20fbcf,null))['then'](function(_0x38aa04){if(_0x38aa04){_0x53797a=_0x38aa04[_0x7c19('0x4b')]({'plain':!![]});_0x75ece9[_0x7c19('0x30')]=_[_0x7c19('0x2c')](db['UserSmsQueue'][_0x7c19('0x46')]);_0x75ece9[_0x7c19('0x2d')]=_[_0x7c19('0x2c')](_0x3a179f[_0x7c19('0x2d')]);_0x75ece9[_0x7c19('0x2e')]=_[_0x7c19('0x2f')](_0x75ece9[_0x7c19('0x30')],_0x75ece9['query']);_0x5ae707[_0x7c19('0x31')]=_['intersection'](_0x75ece9['model'],qs[_0x7c19('0x32')](_0x3a179f['query'][_0x7c19('0x32')]));_0x5ae707[_0x7c19('0x31')]=_0x5ae707[_0x7c19('0x31')][_0x7c19('0x33')]?_0x5ae707['attributes']:_0x75ece9['model'];if(!_0x3a179f['query']['hasOwnProperty']('nolimit')){_0x5ae707[_0x7c19('0x1e')]=qs['limit'](_0x3a179f[_0x7c19('0x2d')]['limit']);_0x5ae707['offset']=qs[_0x7c19('0x1d')](_0x3a179f['query'][_0x7c19('0x1d')]);}_0x5ae707['order']=qs[_0x7c19('0x37')](_0x3a179f[_0x7c19('0x2d')][_0x7c19('0x37')]);_0x5ae707[_0x7c19('0x38')]=qs[_0x7c19('0x2e')](_[_0x7c19('0x39')](_0x3a179f[_0x7c19('0x2d')],_0x75ece9[_0x7c19('0x2e')]));_0x5ae707[_0x7c19('0x38')]['SmsQueueId']=_0x38aa04['id'];if(_0x3a179f[_0x7c19('0x2d')][_0x7c19('0x3a')]){_0x5ae707[_0x7c19('0x38')]=_[_0x7c19('0x3b')](_0x5ae707[_0x7c19('0x38')],{'$or':_['map'](_0x5ae707['attributes'],function(_0x435dc6){var _0x1e0df9={};_0x1e0df9[_0x435dc6]={'$like':'%'+_0x3a179f[_0x7c19('0x2d')]['filter']+'%'};return _0x1e0df9;})});}_0x5ae707=_[_0x7c19('0x3b')]({},_0x5ae707,_0x3a179f['options']);return db[_0x7c19('0x55')][_0x7c19('0x42')](_0x5ae707);}})['then'](function(_0xc06f1b){if(_0xc06f1b){return db[_0x7c19('0x56')][_0x7c19('0x57')]({'where':{'id':_['map'](_0xc06f1b,_0x7c19('0x58')),'role':_0x7c19('0x59')},'attributes':['id','name',_0x7c19('0x5a'),_0x7c19('0x5b'),_0x7c19('0x5c')]});}})['then'](function(_0x576527){if(_0x576527){return{'count':_0x576527[_0x7c19('0x1c')],'rows':_[_0x7c19('0x3c')](_0x576527['rows'],function(_0x1aba96){return{'membername':_0x1aba96['name'],'UserId':_0x1aba96['id'],'queue_name':_0x53797a['name'],'SmsQueueId':_0x53797a['id'],'interface':util['format'](_0x7c19('0x5d'),'SIP',_0x1aba96['name']),'penalty':0x0,'paused':_0x1aba96[_0x7c19('0x5a')],'createdAt':_0x1aba96[_0x7c19('0x5c')],'updatedAt':_0x1aba96[_0x7c19('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7c19('0x24')](respondWithFilteredResult(_0x20fbcf,_0x5ae707))['catch'](handleError(_0x20fbcf,null));};exports[_0x7c19('0x5e')]=function(_0x9acbb5,_0x56310e,_0x51ba0b){var _0x220669={};var _0x20d682={};var _0x223833;var _0x38b0a4;return db[_0x7c19('0x40')][_0x7c19('0x5f')]({'where':{'id':_0x9acbb5[_0x7c19('0x45')]['id']}})[_0x7c19('0x24')](handleEntityNotFound(_0x56310e,null))[_0x7c19('0x24')](function(_0x269a84){if(_0x269a84){_0x223833=_0x269a84;_0x20d682['model']=_['keys'](db[_0x7c19('0x60')][_0x7c19('0x46')]);_0x20d682[_0x7c19('0x2d')]=_[_0x7c19('0x2c')](_0x9acbb5[_0x7c19('0x2d')]);_0x20d682[_0x7c19('0x2e')]=_[_0x7c19('0x2f')](_0x20d682[_0x7c19('0x30')],_0x20d682[_0x7c19('0x2d')]);_0x220669[_0x7c19('0x31')]=_[_0x7c19('0x2f')](_0x20d682[_0x7c19('0x30')],qs[_0x7c19('0x32')](_0x9acbb5['query'][_0x7c19('0x32')]));_0x220669[_0x7c19('0x31')]=_0x220669[_0x7c19('0x31')]['length']?_0x220669['attributes']:_0x20d682[_0x7c19('0x30')];_0x220669[_0x7c19('0x36')]=qs[_0x7c19('0x37')](_0x9acbb5[_0x7c19('0x2d')][_0x7c19('0x37')]);_0x220669['where']=qs[_0x7c19('0x2e')](_[_0x7c19('0x39')](_0x9acbb5[_0x7c19('0x2d')],_0x20d682[_0x7c19('0x2e')]));if(_0x9acbb5['query'][_0x7c19('0x3a')]){_0x220669['where']=_[_0x7c19('0x3b')](_0x220669[_0x7c19('0x38')],{'$or':_[_0x7c19('0x3c')](_0x220669[_0x7c19('0x31')],function(_0x550672){var _0x5f25f3={};_0x5f25f3[_0x550672]={'$like':'%'+_0x9acbb5[_0x7c19('0x2d')]['filter']+'%'};return _0x5f25f3;})});}_0x220669=_[_0x7c19('0x3b')]({},_0x220669,_0x9acbb5[_0x7c19('0x3f')]);return _0x223833[_0x7c19('0x5e')](_0x220669);}})['then'](function(_0x2dfee7){if(_0x2dfee7){_0x38b0a4=_0x2dfee7['length'];if(!_0x9acbb5[_0x7c19('0x2d')]['hasOwnProperty']('nolimit')){_0x220669[_0x7c19('0x1e')]=qs['limit'](_0x9acbb5[_0x7c19('0x2d')][_0x7c19('0x1e')]);_0x220669[_0x7c19('0x1d')]=qs[_0x7c19('0x1d')](_0x9acbb5[_0x7c19('0x2d')]['offset']);}return _0x223833[_0x7c19('0x5e')](_0x220669);}})['then'](function(_0x1362f4){if(_0x1362f4){return _0x1362f4?{'count':_0x38b0a4,'rows':_0x1362f4}:null;}})[_0x7c19('0x24')](respondWithResult(_0x56310e,null))[_0x7c19('0x47')](handleError(_0x56310e,null));};exports[_0x7c19('0x61')]=function(_0x588c61,_0x2b900f,_0x5efb26){var _0x59ebdc=[];var _0xd5faaf;return db[_0x7c19('0x60')][_0x7c19('0x42')]({'where':{'id':_0x588c61[_0x7c19('0x49')][_0x7c19('0x62')]},'attributes':['id'],'include':[{'model':db[_0x7c19('0x56')],'as':_0x7c19('0x63'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3ba7df){if(_0x3ba7df){for(var _0x15ad90=0x0;_0x15ad90<_0x3ba7df[_0x7c19('0x33')];_0x15ad90+=0x1){for(var _0xb33e5b=0x0;_0xb33e5b<_0x3ba7df[_0x15ad90][_0x7c19('0x63')][_0x7c19('0x33')];_0xb33e5b+=0x1){_0x59ebdc=_[_0x7c19('0x64')](_0x59ebdc,[_0x3ba7df[_0x15ad90][_0x7c19('0x63')][_0xb33e5b]['id']]);}}return _0x59ebdc;}})[_0x7c19('0x24')](function(_0x414d25){if(_0x414d25){return db['SmsQueue'][_0x7c19('0x53')]({'where':{'id':_0x588c61['params']['id']}});}})[_0x7c19('0x24')](function(_0xa744aa){if(_0xa744aa){_0xd5faaf=_0xa744aa;return _0xd5faaf['addAgents'](_0x59ebdc,{'penalty':_0x588c61[_0x7c19('0x49')][_0x7c19('0x65')]});}})[_0x7c19('0x24')](function(_0xb8646a){if(_0xb8646a){return _0xd5faaf[_0x7c19('0x61')](_0x588c61[_0x7c19('0x49')][_0x7c19('0x62')]);}})['then'](handleEntityNotFound(_0x2b900f,null))[_0x7c19('0x24')](respondWithStatusCode(_0x2b900f,null))[_0x7c19('0x47')](handleError(_0x2b900f,null));};exports['removeTeams']=function(_0x29bd7c,_0x257681,_0xcd85ad){var _0x11334e=[];var _0x556b0d;return db[_0x7c19('0x60')]['findAll']({'where':{'id':_0x29bd7c[_0x7c19('0x2d')][_0x7c19('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7c19('0x24')](function(_0x5a82e4){if(_0x5a82e4){for(var _0x1cbba8=0x0;_0x1cbba8<_0x5a82e4[_0x7c19('0x33')];_0x1cbba8+=0x1){for(var _0xde44c2=0x0;_0xde44c2<_0x5a82e4[_0x1cbba8][_0x7c19('0x63')][_0x7c19('0x33')];_0xde44c2+=0x1){_0x11334e=_[_0x7c19('0x64')](_0x11334e,[_0x5a82e4[_0x1cbba8]['Agents'][_0xde44c2]['id']]);}}return _0x11334e;}})[_0x7c19('0x24')](function(_0x4cbf0b){if(_0x4cbf0b){return db[_0x7c19('0x40')][_0x7c19('0x53')]({'where':{'id':_0x29bd7c['params']['id']}});}})['then'](function(_0x1606c4){if(_0x1606c4){_0x556b0d=_0x1606c4;return _0x556b0d[_0x7c19('0x66')](_0x11334e);}})[_0x7c19('0x24')](function(_0x538b81){if(_0x556b0d){return _0x556b0d[_0x7c19('0x67')](_0x29bd7c['query'][_0x7c19('0x62')]);}})['then'](handleEntityNotFound(_0x257681,null))['then'](respondWithStatusCode(_0x257681,null))['catch'](handleError(_0x257681,null));};exports['addAgents']=function(_0x478891,_0x28f6f6,_0x5cd9b3){return db[_0x7c19('0x40')]['find']({'where':{'id':_0x478891[_0x7c19('0x45')]['id']}})[_0x7c19('0x24')](handleEntityNotFound(_0x28f6f6,null))[_0x7c19('0x24')](function(_0x53d6bc){if(_0x53d6bc){return _0x53d6bc['addAgents'](_0x478891['body'][_0x7c19('0x62')],_[_0x7c19('0x68')](_0x478891[_0x7c19('0x49')],[_0x7c19('0x62'),'id'])||{})[_0x7c19('0x69')](function(_0xb4e0b5){for(var _0x26d098=0x0;_0x26d098<_0x478891[_0x7c19('0x49')][_0x7c19('0x62')][_0x7c19('0x33')];_0x26d098+=0x1){socket[_0x7c19('0x6a')](_0x7c19('0x6b'),{'UserId':_0x478891[_0x7c19('0x49')]['ids'][_0x26d098],'SmsQueueId':_0x478891[_0x7c19('0x45')]['id']});}return _0xb4e0b5;});}})[_0x7c19('0x24')](respondWithResult(_0x28f6f6,null))[_0x7c19('0x47')](handleError(_0x28f6f6,null));};exports[_0x7c19('0x66')]=function(_0xd7d3e8,_0x350d69,_0x12b6fb){var _0x1bf613;return db[_0x7c19('0x40')]['find']({'where':{'id':_0xd7d3e8['params']['id']}})['then'](handleEntityNotFound(_0x350d69,null))[_0x7c19('0x24')](function(_0x299290){if(_0x299290){return _0x299290[_0x7c19('0x66')](_0xd7d3e8[_0x7c19('0x2d')][_0x7c19('0x62')])[_0x7c19('0x24')](function(_0x361386){if(_[_0x7c19('0x6c')](_0xd7d3e8['query'][_0x7c19('0x62')])){for(var _0x3f76c6=0x0;_0x3f76c6<_0xd7d3e8[_0x7c19('0x2d')][_0x7c19('0x62')][_0x7c19('0x33')];_0x3f76c6+=0x1){socket[_0x7c19('0x6a')]('userSmsQueue:remove',{'UserId':_0xd7d3e8[_0x7c19('0x2d')]['ids'][_0x3f76c6],'SmsQueueId':_0xd7d3e8['params']['id']});}}else{socket['emit']('userSmsQueue:remove',{'UserId':_0xd7d3e8['query'][_0x7c19('0x62')],'SmsQueueId':_0xd7d3e8['params']['id']});}});}})[_0x7c19('0x24')](respondWithStatusCode(_0x350d69,null))['catch'](handleError(_0x350d69,null));};exports[_0x7c19('0x6d')]=function(_0x2e53a4,_0x29d83e,_0x1a7c41){var _0x54a940={};var _0x381685={};var _0x2dc945;var _0x20e2a0;return db[_0x7c19('0x40')][_0x7c19('0x5f')]({'where':{'id':_0x2e53a4[_0x7c19('0x45')]['id']}})[_0x7c19('0x24')](handleEntityNotFound(_0x29d83e,null))[_0x7c19('0x24')](function(_0x3c9d61){if(_0x3c9d61){_0x2dc945=_0x3c9d61;_0x381685[_0x7c19('0x30')]=_[_0x7c19('0x2c')](db[_0x7c19('0x56')][_0x7c19('0x46')]);_0x381685[_0x7c19('0x2d')]=_[_0x7c19('0x2c')](_0x2e53a4['query']);_0x381685[_0x7c19('0x2e')]=_[_0x7c19('0x2f')](_0x381685[_0x7c19('0x30')],_0x381685[_0x7c19('0x2d')]);_0x54a940[_0x7c19('0x31')]=_[_0x7c19('0x2f')](_0x381685[_0x7c19('0x30')],qs[_0x7c19('0x32')](_0x2e53a4[_0x7c19('0x2d')][_0x7c19('0x32')]));_0x54a940['attributes']=_0x54a940[_0x7c19('0x31')][_0x7c19('0x33')]?_0x54a940[_0x7c19('0x31')]:_0x381685[_0x7c19('0x30')];_0x54a940[_0x7c19('0x36')]=qs[_0x7c19('0x37')](_0x2e53a4[_0x7c19('0x2d')][_0x7c19('0x37')]);_0x54a940[_0x7c19('0x38')]=qs[_0x7c19('0x2e')](_['pick'](_0x2e53a4['query'],_0x381685[_0x7c19('0x2e')]));if(_0x2e53a4[_0x7c19('0x2d')]['filter']){_0x54a940[_0x7c19('0x38')]=_[_0x7c19('0x3b')](_0x54a940[_0x7c19('0x38')],{'$or':_['map'](_0x54a940['attributes'],function(_0x1c2fb3){var _0x1e09bb={};_0x1e09bb[_0x1c2fb3]={'$like':'%'+_0x2e53a4[_0x7c19('0x2d')][_0x7c19('0x3a')]+'%'};return _0x1e09bb;})});}_0x54a940=_[_0x7c19('0x3b')]({},_0x54a940,_0x2e53a4[_0x7c19('0x3f')]);return _0x2dc945[_0x7c19('0x6d')](_0x54a940);}})[_0x7c19('0x24')](function(_0x58afa6){if(_0x58afa6){_0x20e2a0=_0x58afa6[_0x7c19('0x33')];if(!_0x2e53a4['query'][_0x7c19('0x34')](_0x7c19('0x35'))){_0x54a940[_0x7c19('0x1e')]=qs[_0x7c19('0x1e')](_0x2e53a4[_0x7c19('0x2d')][_0x7c19('0x1e')]);_0x54a940['offset']=qs[_0x7c19('0x1d')](_0x2e53a4[_0x7c19('0x2d')][_0x7c19('0x1d')]);}return _0x2dc945[_0x7c19('0x6d')](_0x54a940);}})['then'](function(_0x1d7600){if(_0x1d7600){return _0x1d7600?{'count':_0x20e2a0,'rows':_0x1d7600}:null;}})['then'](respondWithResult(_0x29d83e,null))[_0x7c19('0x47')](handleError(_0x29d83e,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 08de9b5..303f94e 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 _0x5f8d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue'];(function(_0x1a809b,_0x4c15e3){var _0x5d90e6=function(_0x5dd2e1){while(--_0x5dd2e1){_0x1a809b['push'](_0x1a809b['shift']());}};_0x5d90e6(++_0x4c15e3);}(_0x5f8d,0xf7));var _0xd5f8=function(_0xf19845,_0x50b9bf){_0xf19845=_0xf19845-0x0;var _0x49e934=_0x5f8d[_0xf19845];return _0x49e934;};'use strict';var EventEmitter=require(_0xd5f8('0x0'));var SmsQueue=require(_0xd5f8('0x1'))['db'][_0xd5f8('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd5f8('0x3')](0x0);var events={'afterCreate':_0xd5f8('0x4'),'afterUpdate':'update','afterDestroy':_0xd5f8('0x5')};function emitEvent(_0x239f2f){return function(_0x147d63,_0xa7b32c,_0xcde876){SmsQueueEvents[_0xd5f8('0x6')](_0x239f2f+':'+_0x147d63['id'],_0x147d63);SmsQueueEvents[_0xd5f8('0x6')](_0x239f2f,_0x147d63);_0xcde876(null);};}for(var e in events){if(events[_0xd5f8('0x7')](e)){var event=events[e];SmsQueue[_0xd5f8('0x8')](e,emitEvent(event));}}module[_0xd5f8('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x63ad=['events','../../mysqldb','remove','emit','hasOwnProperty','exports'];(function(_0xdde021,_0x3f2a18){var _0x3aa870=function(_0x1442ad){while(--_0x1442ad){_0xdde021['push'](_0xdde021['shift']());}};_0x3aa870(++_0x3f2a18);}(_0x63ad,0x120));var _0xd63a=function(_0x43550c,_0x4f8ddf){_0x43550c=_0x43550c-0x0;var _0x375cc8=_0x63ad[_0x43550c];return _0x375cc8;};'use strict';var EventEmitter=require(_0xd63a('0x0'));var SmsQueue=require(_0xd63a('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd63a('0x2')};function emitEvent(_0x17fe90){return function(_0x3d86e8,_0x49751f,_0xd2fd6f){SmsQueueEvents[_0xd63a('0x3')](_0x17fe90+':'+_0x3d86e8['id'],_0x3d86e8);SmsQueueEvents[_0xd63a('0x3')](_0x17fe90,_0x3d86e8);_0xd2fd6f(null);};}for(var e in events){if(events[_0xd63a('0x4')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xd63a('0x5')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 7906132..3e16804 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 _0x2cb2=['./smsQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x53c04e,_0x441911){var _0x273722=function(_0x476739){while(--_0x476739){_0x53c04e['push'](_0x53c04e['shift']());}};_0x273722(++_0x441911);}(_0x2cb2,0x162));var _0x22cb=function(_0x5b29e1,_0x2ed6a4){_0x5b29e1=_0x5b29e1-0x0;var _0x4314b2=_0x2cb2[_0x5b29e1];return _0x4314b2;};'use strict';var _=require(_0x22cb('0x0'));var util=require(_0x22cb('0x1'));var logger=require(_0x22cb('0x2'))(_0x22cb('0x3'));var moment=require(_0x22cb('0x4'));var BPromise=require('bluebird');var rp=require(_0x22cb('0x5'));var attributes=require(_0x22cb('0x6'));module[_0x22cb('0x7')]=function(_0x37c1c0,_0x36d974){return _0x37c1c0[_0x22cb('0x8')]('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6682=['SmsQueue','sms_queues','lodash','util','api','moment','bluebird','request-promise','./smsQueue.attributes','exports','define'];(function(_0x549fa9,_0x5e23ab){var _0x1d3611=function(_0x4ada67){while(--_0x4ada67){_0x549fa9['push'](_0x549fa9['shift']());}};_0x1d3611(++_0x5e23ab);}(_0x6682,0xc8));var _0x2668=function(_0xcfed91,_0x29b51b){_0xcfed91=_0xcfed91-0x0;var _0x42e245=_0x6682[_0xcfed91];return _0x42e245;};'use strict';var _=require(_0x2668('0x0'));var util=require(_0x2668('0x1'));var logger=require('../../config/logger')(_0x2668('0x2'));var moment=require(_0x2668('0x3'));var BPromise=require(_0x2668('0x4'));var rp=require(_0x2668('0x5'));var attributes=require(_0x2668('0x6'));module[_0x2668('0x7')]=function(_0x3364ff,_0xcb0699){return _0x3364ff[_0x2668('0x8')](_0x2668('0x9'),attributes,{'tableName':_0x2668('0xa'),'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 191f06d..74a84f5 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 _0x85d8=['rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','options','raw','where','limit','include','map','model','attributes','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfc0206,_0x4df746){var _0x9d03c3=function(_0x345aa5){while(--_0x345aa5){_0xfc0206['push'](_0xfc0206['shift']());}};_0x9d03c3(++_0x4df746);}(_0x85d8,0x1b0));var _0x885d=function(_0x179d07,_0x38411f){_0x179d07=_0x179d07-0x0;var _0x122aad=_0x85d8[_0x179d07];return _0x122aad;};'use strict';var _=require(_0x885d('0x0'));var util=require(_0x885d('0x1'));var moment=require(_0x885d('0x2'));var BPromise=require(_0x885d('0x3'));var rs=require(_0x885d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x885d('0x5'))['db'];var utils=require(_0x885d('0x6'));var logger=require(_0x885d('0x7'))(_0x885d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x885d('0x9')][_0x885d('0xa')]({'port':0x232a});config[_0x885d('0xb')]=_[_0x885d('0xc')](config[_0x885d('0xb')],{'host':_0x885d('0xd'),'port':0x18eb});var socket=require(_0x885d('0xe'))(new Redis(config[_0x885d('0xb')]));require(_0x885d('0xf'))[_0x885d('0x10')](socket);function respondWithRpcPromise(_0x11e4e7,_0x125db6,_0x3ce28f){return new BPromise(function(_0x1e5761,_0x19c903){return client[_0x885d('0x11')](_0x11e4e7,_0x3ce28f)[_0x885d('0x12')](function(_0x2c680b){logger[_0x885d('0x13')]('SmsQueue,\x20%s,\x20%s',_0x125db6,'request\x20sent');logger[_0x885d('0x14')](_0x885d('0x15'),_0x125db6,'request\x20sent',JSON[_0x885d('0x16')](_0x2c680b));if(_0x2c680b[_0x885d('0x17')]){if(_0x2c680b['error']['code']===0x1f4){logger[_0x885d('0x17')](_0x885d('0x18'),_0x125db6,_0x2c680b[_0x885d('0x17')][_0x885d('0x19')]);return _0x19c903(_0x2c680b[_0x885d('0x17')][_0x885d('0x19')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x125db6,_0x2c680b[_0x885d('0x17')][_0x885d('0x19')]);return _0x1e5761(_0x2c680b[_0x885d('0x17')][_0x885d('0x19')]);}else{logger[_0x885d('0x13')](_0x885d('0x18'),_0x125db6,_0x885d('0x1a'));_0x1e5761(_0x2c680b[_0x885d('0x1b')]['message']);}})[_0x885d('0x1c')](function(_0x35dfcc){logger[_0x885d('0x17')](_0x885d('0x18'),_0x125db6,_0x35dfcc);_0x19c903(_0x35dfcc);});});}exports[_0x885d('0x1d')]=function(_0x5a72b8){var _0x1326a9=this;return new Promise(function(_0xb1c8de,_0x55738d){return db[_0x885d('0x1e')]['findAll']({'raw':_0x5a72b8[_0x885d('0x1f')]?_0x5a72b8[_0x885d('0x1f')][_0x885d('0x20')]===undefined?!![]:![]:!![],'where':_0x5a72b8[_0x885d('0x1f')]?_0x5a72b8[_0x885d('0x1f')][_0x885d('0x21')]||null:null,'attributes':_0x5a72b8[_0x885d('0x1f')]?_0x5a72b8[_0x885d('0x1f')]['attributes']||null:null,'limit':_0x5a72b8[_0x885d('0x1f')]?_0x5a72b8[_0x885d('0x1f')][_0x885d('0x22')]||null:null,'include':_0x5a72b8['options']?_0x5a72b8[_0x885d('0x1f')][_0x885d('0x23')]?_[_0x885d('0x24')](_0x5a72b8[_0x885d('0x1f')][_0x885d('0x23')],function(_0x3f0955){return{'model':db[_0x3f0955[_0x885d('0x25')]],'as':_0x3f0955['as'],'attributes':_0x3f0955[_0x885d('0x26')],'include':_0x3f0955[_0x885d('0x23')]?_['map'](_0x3f0955['include'],function(_0x13948c){return{'model':db[_0x13948c['model']],'as':_0x13948c['as'],'attributes':_0x13948c[_0x885d('0x26')],'include':_0x13948c[_0x885d('0x23')]?_[_0x885d('0x24')](_0x13948c[_0x885d('0x23')],function(_0x16f4c1){return{'model':db[_0x16f4c1[_0x885d('0x25')]],'as':_0x16f4c1['as'],'attributes':_0x16f4c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x885d('0x12')](function(_0x3b139b){logger['info'](_0x885d('0x1d'),_0x5a72b8);logger['debug']('GetSmsQueue',_0x5a72b8,JSON[_0x885d('0x16')](_0x3b139b));_0xb1c8de(_0x3b139b);})['catch'](function(_0x3baf94){logger[_0x885d('0x17')](_0x885d('0x1d'),_0x3baf94[_0x885d('0x19')],_0x5a72b8);_0x55738d(_0x1326a9[_0x885d('0x17')](0x1f4,_0x3baf94[_0x885d('0x19')]));});});};exports['ShowSmsQueue']=function(_0x3347da){var _0x197c27=this;return new Promise(function(_0x3aab64,_0x151fb7){return db[_0x885d('0x1e')]['find']({'raw':_0x3347da[_0x885d('0x1f')]?_0x3347da[_0x885d('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3347da[_0x885d('0x1f')]?_0x3347da[_0x885d('0x1f')][_0x885d('0x21')]||null:null,'attributes':_0x3347da[_0x885d('0x1f')]?_0x3347da[_0x885d('0x1f')][_0x885d('0x26')]||null:null,'include':_0x3347da[_0x885d('0x1f')]?_0x3347da[_0x885d('0x1f')]['include']?_['map'](_0x3347da['options']['include'],function(_0x3d6ce7){return{'model':db[_0x3d6ce7[_0x885d('0x25')]],'as':_0x3d6ce7['as'],'attributes':_0x3d6ce7['attributes'],'include':_0x3d6ce7[_0x885d('0x23')]?_['map'](_0x3d6ce7[_0x885d('0x23')],function(_0x37e541){return{'model':db[_0x37e541[_0x885d('0x25')]],'as':_0x37e541['as'],'attributes':_0x37e541[_0x885d('0x26')],'include':_0x37e541[_0x885d('0x23')]?_[_0x885d('0x24')](_0x37e541[_0x885d('0x23')],function(_0x4ee55d){return{'model':db[_0x4ee55d['model']],'as':_0x4ee55d['as'],'attributes':_0x4ee55d[_0x885d('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xca172e){logger['info']('ShowSmsQueue',_0x3347da);logger[_0x885d('0x14')](_0x885d('0x27'),_0x3347da,JSON[_0x885d('0x16')](_0xca172e));_0x3aab64(_0xca172e);})[_0x885d('0x1c')](function(_0x3e2c0a){logger[_0x885d('0x17')](_0x885d('0x27'),_0x3e2c0a[_0x885d('0x19')],_0x3347da);_0x151fb7(_0x197c27[_0x885d('0x17')](0x1f4,_0x3e2c0a[_0x885d('0x19')]));});});}; \ No newline at end of file +var _0xa540=['result','GetSmsQueue','findAll','raw','options','where','attributes','limit','model','include','map','stringify','SmsQueue','find','ShowSmsQueue','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','SmsQueue,\x20%s,\x20%s'];(function(_0x72c71e,_0x3ef857){var _0x92512e=function(_0xdc0310){while(--_0xdc0310){_0x72c71e['push'](_0x72c71e['shift']());}};_0x92512e(++_0x3ef857);}(_0xa540,0xd3));var _0x0a54=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0xa540[_0x590b61];return _0x1a14dc;};'use strict';var _=require(_0x0a54('0x0'));var util=require('util');var moment=require(_0x0a54('0x1'));var BPromise=require(_0x0a54('0x2'));var rs=require(_0x0a54('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0a54('0x4'))(_0x0a54('0x5'));var config=require('../../config/environment');var jayson=require(_0x0a54('0x6'));var client=jayson[_0x0a54('0x7')][_0x0a54('0x8')]({'port':0x232a});config[_0x0a54('0x9')]=_[_0x0a54('0xa')](config['redis'],{'host':_0x0a54('0xb'),'port':0x18eb});var socket=require(_0x0a54('0xc'))(new Redis(config['redis']));require(_0x0a54('0xd'))['register'](socket);function respondWithRpcPromise(_0x1d2257,_0xb02b0f,_0x390fb1){return new BPromise(function(_0x2b368c,_0x56b0d8){return client['request'](_0x1d2257,_0x390fb1)[_0x0a54('0xe')](function(_0x184617){logger[_0x0a54('0xf')]('SmsQueue,\x20%s,\x20%s',_0xb02b0f,_0x0a54('0x10'));logger[_0x0a54('0x11')](_0x0a54('0x12'),_0xb02b0f,_0x0a54('0x10'),JSON['stringify'](_0x184617));if(_0x184617[_0x0a54('0x13')]){if(_0x184617['error'][_0x0a54('0x14')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0xb02b0f,_0x184617[_0x0a54('0x13')][_0x0a54('0x15')]);return _0x56b0d8(_0x184617['error'][_0x0a54('0x15')]);}logger[_0x0a54('0x13')](_0x0a54('0x16'),_0xb02b0f,_0x184617[_0x0a54('0x13')][_0x0a54('0x15')]);return _0x2b368c(_0x184617[_0x0a54('0x13')][_0x0a54('0x15')]);}else{logger[_0x0a54('0xf')]('SmsQueue,\x20%s,\x20%s',_0xb02b0f,'request\x20sent');_0x2b368c(_0x184617[_0x0a54('0x17')]['message']);}})['catch'](function(_0x37d2d1){logger[_0x0a54('0x13')](_0x0a54('0x16'),_0xb02b0f,_0x37d2d1);_0x56b0d8(_0x37d2d1);});});}exports[_0x0a54('0x18')]=function(_0x46a291){var _0x34afbb=this;return new Promise(function(_0x1a36df,_0x39ad1d){return db['SmsQueue'][_0x0a54('0x19')]({'raw':_0x46a291['options']?_0x46a291['options'][_0x0a54('0x1a')]===undefined?!![]:![]:!![],'where':_0x46a291['options']?_0x46a291[_0x0a54('0x1b')][_0x0a54('0x1c')]||null:null,'attributes':_0x46a291[_0x0a54('0x1b')]?_0x46a291[_0x0a54('0x1b')][_0x0a54('0x1d')]||null:null,'limit':_0x46a291[_0x0a54('0x1b')]?_0x46a291['options'][_0x0a54('0x1e')]||null:null,'include':_0x46a291[_0x0a54('0x1b')]?_0x46a291[_0x0a54('0x1b')]['include']?_['map'](_0x46a291[_0x0a54('0x1b')]['include'],function(_0x533741){return{'model':db[_0x533741[_0x0a54('0x1f')]],'as':_0x533741['as'],'attributes':_0x533741['attributes'],'include':_0x533741[_0x0a54('0x20')]?_[_0x0a54('0x21')](_0x533741['include'],function(_0x2e0cfc){return{'model':db[_0x2e0cfc[_0x0a54('0x1f')]],'as':_0x2e0cfc['as'],'attributes':_0x2e0cfc[_0x0a54('0x1d')],'include':_0x2e0cfc[_0x0a54('0x20')]?_[_0x0a54('0x21')](_0x2e0cfc['include'],function(_0x10e6ee){return{'model':db[_0x10e6ee[_0x0a54('0x1f')]],'as':_0x10e6ee['as'],'attributes':_0x10e6ee[_0x0a54('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0a54('0xe')](function(_0x517583){logger[_0x0a54('0xf')](_0x0a54('0x18'),_0x46a291);logger[_0x0a54('0x11')](_0x0a54('0x18'),_0x46a291,JSON[_0x0a54('0x22')](_0x517583));_0x1a36df(_0x517583);})['catch'](function(_0x57349c){logger[_0x0a54('0x13')](_0x0a54('0x18'),_0x57349c[_0x0a54('0x15')],_0x46a291);_0x39ad1d(_0x34afbb['error'](0x1f4,_0x57349c[_0x0a54('0x15')]));});});};exports['ShowSmsQueue']=function(_0x47178e){var _0x3ed108=this;return new Promise(function(_0x2e4ace,_0x288610){return db[_0x0a54('0x23')][_0x0a54('0x24')]({'raw':_0x47178e[_0x0a54('0x1b')]?_0x47178e[_0x0a54('0x1b')][_0x0a54('0x1a')]===undefined?!![]:![]:!![],'where':_0x47178e[_0x0a54('0x1b')]?_0x47178e['options']['where']||null:null,'attributes':_0x47178e[_0x0a54('0x1b')]?_0x47178e[_0x0a54('0x1b')][_0x0a54('0x1d')]||null:null,'include':_0x47178e[_0x0a54('0x1b')]?_0x47178e[_0x0a54('0x1b')][_0x0a54('0x20')]?_['map'](_0x47178e[_0x0a54('0x1b')][_0x0a54('0x20')],function(_0x2aeaac){return{'model':db[_0x2aeaac[_0x0a54('0x1f')]],'as':_0x2aeaac['as'],'attributes':_0x2aeaac['attributes'],'include':_0x2aeaac[_0x0a54('0x20')]?_[_0x0a54('0x21')](_0x2aeaac[_0x0a54('0x20')],function(_0x16a402){return{'model':db[_0x16a402['model']],'as':_0x16a402['as'],'attributes':_0x16a402[_0x0a54('0x1d')],'include':_0x16a402['include']?_[_0x0a54('0x21')](_0x16a402['include'],function(_0x5efcd7){return{'model':db[_0x5efcd7[_0x0a54('0x1f')]],'as':_0x5efcd7['as'],'attributes':_0x5efcd7['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a54('0xe')](function(_0x10fe9f){logger['info'](_0x0a54('0x25'),_0x47178e);logger[_0x0a54('0x11')](_0x0a54('0x25'),_0x47178e,JSON[_0x0a54('0x22')](_0x10fe9f));_0x2e4ace(_0x10fe9f);})[_0x0a54('0x26')](function(_0x569e4a){logger[_0x0a54('0x13')](_0x0a54('0x25'),_0x569e4a[_0x0a54('0x15')],_0x47178e);_0x288610(_0x3ed108[_0x0a54('0x13')](0x1f4,_0x569e4a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5f04a5d..c56bc85 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 _0xa2c8=['register','length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x55e649,_0x3263af){var _0x1319f0=function(_0x5eba06){while(--_0x5eba06){_0x55e649['push'](_0x55e649['shift']());}};_0x1319f0(++_0x3263af);}(_0xa2c8,0x81));var _0x8a2c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa2c8[_0x20a584];return _0x4b41a8;};'use strict';var SmsQueueEvents=require(_0x8a2c('0x0'));var events=[_0x8a2c('0x1'),_0x8a2c('0x2'),_0x8a2c('0x3')];function createListener(_0x585bf1,_0x3c458b){return function(_0x4952ce){_0x3c458b[_0x8a2c('0x4')](_0x585bf1,_0x4952ce);};}function removeListener(_0x443df3,_0x1ebdd9){return function(){SmsQueueEvents[_0x8a2c('0x5')](_0x443df3,_0x1ebdd9);};}exports[_0x8a2c('0x6')]=function(_0x161ae4){for(var _0x47cace=0x0,_0x3481c4=events[_0x8a2c('0x7')];_0x47cace<_0x3481c4;_0x47cace++){var _0x4688af=events[_0x47cace];var _0x589f71=createListener(_0x8a2c('0x8')+_0x4688af,_0x161ae4);SmsQueueEvents['on'](_0x4688af,_0x589f71);}}; \ No newline at end of file +var _0x289c=['save','remove','update','removeListener','length','smsQueue:','./smsQueue.events'];(function(_0x29e4e0,_0x272570){var _0x2cafd8=function(_0x4de8d2){while(--_0x4de8d2){_0x29e4e0['push'](_0x29e4e0['shift']());}};_0x2cafd8(++_0x272570);}(_0x289c,0x110));var _0xc289=function(_0x27d14d,_0xc45f9){_0x27d14d=_0x27d14d-0x0;var _0x30aa5d=_0x289c[_0x27d14d];return _0x30aa5d;};'use strict';var SmsQueueEvents=require(_0xc289('0x0'));var events=[_0xc289('0x1'),_0xc289('0x2'),_0xc289('0x3')];function createListener(_0x550b7b,_0x46a6a3){return function(_0x401de3){_0x46a6a3['emit'](_0x550b7b,_0x401de3);};}function removeListener(_0x10c62c,_0xf802f0){return function(){SmsQueueEvents[_0xc289('0x4')](_0x10c62c,_0xf802f0);};}exports['register']=function(_0x17573e){for(var _0x15145c=0x0,_0x207eca=events[_0xc289('0x5')];_0x15145c<_0x207eca;_0x15145c++){var _0x116c7b=events[_0x15145c];var _0x420e9c=createListener(_0xc289('0x6')+_0x116c7b,_0x17573e);SmsQueueEvents['on'](_0x116c7b,_0x420e9c);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f8b92a9..570d06f 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 _0xd0c9=['isAuthenticated','describe','get','/:id','post','create','put','update','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','index','/describe'];(function(_0x1bb29c,_0x297df2){var _0x7262c6=function(_0x53057e){while(--_0x53057e){_0x1bb29c['push'](_0x1bb29c['shift']());}};_0x7262c6(++_0x297df2);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xd0c9[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0x9d0c('0x0'));var util=require(_0x9d0c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9d0c('0x2')]();var auth=require(_0x9d0c('0x3'));var interaction=require(_0x9d0c('0x4'));var config=require('../../config/environment');var controller=require(_0x9d0c('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x9d0c('0x6')]);router['get'](_0x9d0c('0x7'),auth[_0x9d0c('0x8')](),controller[_0x9d0c('0x9')]);router[_0x9d0c('0xa')](_0x9d0c('0xb'),auth[_0x9d0c('0x8')](),controller['show']);router[_0x9d0c('0xc')]('/',auth['isAuthenticated'](),controller[_0x9d0c('0xd')]);router[_0x9d0c('0xe')](_0x9d0c('0xb'),auth['isAuthenticated'](),controller[_0x9d0c('0xf')]);router[_0x9d0c('0x10')](_0x9d0c('0xb'),auth[_0x9d0c('0x8')](),controller['destroy']);module[_0x9d0c('0x11')]=router; \ No newline at end of file +var _0x5a99=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get'];(function(_0x20c72d,_0x52fe1c){var _0xec7469=function(_0x236667){while(--_0x236667){_0x20c72d['push'](_0x20c72d['shift']());}};_0xec7469(++_0x52fe1c);}(_0x5a99,0xc9));var _0x95a9=function(_0x2ff76b,_0x4a1c31){_0x2ff76b=_0x2ff76b-0x0;var _0x234448=_0x5a99[_0x2ff76b];return _0x234448;};'use strict';var multer=require(_0x95a9('0x0'));var util=require(_0x95a9('0x1'));var path=require(_0x95a9('0x2'));var timeout=require('connect-timeout');var express=require(_0x95a9('0x3'));var router=express[_0x95a9('0x4')]();var auth=require(_0x95a9('0x5'));var interaction=require(_0x95a9('0x6'));var config=require('../../config/environment');var controller=require(_0x95a9('0x7'));router[_0x95a9('0x8')]('/',auth[_0x95a9('0x9')](),controller[_0x95a9('0xa')]);router['get'](_0x95a9('0xb'),auth[_0x95a9('0x9')](),controller[_0x95a9('0xc')]);router['get'](_0x95a9('0xd'),auth['isAuthenticated'](),controller[_0x95a9('0xe')]);router[_0x95a9('0xf')]('/',auth[_0x95a9('0x9')](),controller[_0x95a9('0x10')]);router[_0x95a9('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x95a9('0x12')]);router[_0x95a9('0x13')]('/:id',auth[_0x95a9('0x9')](),controller['destroy']);module[_0x95a9('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 5065f49..b941f5c 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 _0x68eb=['DATE','exports','STRING'];(function(_0x125b16,_0x1058f8){var _0x45d2a4=function(_0x5b8a9c){while(--_0x5b8a9c){_0x125b16['push'](_0x125b16['shift']());}};_0x45d2a4(++_0x1058f8);}(_0x68eb,0x196));var _0xb68e=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0x68eb[_0x16dbcd];return _0x34706e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xb68e('0x0')]={'uniqueid':{'type':Sequelize[_0xb68e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb68e('0x1')]},'joinAt':{'type':Sequelize[_0xb68e('0x2')]},'leaveAt':{'type':Sequelize[_0xb68e('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb68e('0x2')]},'reason':{'type':Sequelize[_0xb68e('0x1')]}}; \ No newline at end of file +var _0x5987=['DATE','moment','exports','STRING'];(function(_0x2c7fa7,_0x5793ea){var _0x5aa311=function(_0x4282df){while(--_0x4282df){_0x2c7fa7['push'](_0x2c7fa7['shift']());}};_0x5aa311(++_0x5793ea);}(_0x5987,0x155));var _0x7598=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5987[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x7598('0x0'));var Sequelize=require('sequelize');module[_0x7598('0x1')]={'uniqueid':{'type':Sequelize[_0x7598('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7598('0x2')]},'joinAt':{'type':Sequelize[_0x7598('0x3')]},'leaveAt':{'type':Sequelize[_0x7598('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7598('0x3')]},'reason':{'type':Sequelize[_0x7598('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 59191e8..f149458 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 _0xec85=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','reject','save','update','destroy','then','error','name','send','index','SmsQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0xec85,0x94));var _0x5ec8=function(_0x1b52b7,_0x10bcae){_0x1b52b7=_0x1b52b7-0x0;var _0x11e5f5=_0xec85[_0x1b52b7];return _0x11e5f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ec8('0x0'));var rimraf=require(_0x5ec8('0x1'));var zipdir=require(_0x5ec8('0x2'));var jsonpatch=require(_0x5ec8('0x3'));var rp=require(_0x5ec8('0x4'));var moment=require(_0x5ec8('0x5'));var BPromise=require(_0x5ec8('0x6'));var Mustache=require(_0x5ec8('0x7'));var util=require(_0x5ec8('0x8'));var path=require(_0x5ec8('0x9'));var sox=require(_0x5ec8('0xa'));var csv=require(_0x5ec8('0xb'));var ejs=require(_0x5ec8('0xc'));var fs=require('fs');var _=require(_0x5ec8('0xd'));var squel=require(_0x5ec8('0xe'));var crypto=require(_0x5ec8('0xf'));var jsforce=require(_0x5ec8('0x10'));var deskjs=require(_0x5ec8('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5ec8('0x12'));var Papa=require(_0x5ec8('0x13'));var authService=require('../../components/auth/service');var hardwareService=require(_0x5ec8('0x14'));var Redis=require(_0x5ec8('0x15'));var qs=require(_0x5ec8('0x16'));var logger=require(_0x5ec8('0x17'))(_0x5ec8('0x18'));var utils=require('../../config/utils');var config=require(_0x5ec8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a8dbf,_0x41e5c0){_0x41e5c0=_0x41e5c0||0xcc;return function(_0x22a795){if(_0x22a795){return _0x4a8dbf[_0x5ec8('0x1a')](_0x41e5c0);}return _0x4a8dbf['status'](_0x41e5c0)[_0x5ec8('0x1b')]();};}function respondWithResult(_0x377c6d,_0x32398a){_0x32398a=_0x32398a||0xc8;return function(_0x31e581){if(_0x31e581){return _0x377c6d[_0x5ec8('0x1c')](_0x32398a)[_0x5ec8('0x1d')](_0x31e581);}};}function respondWithFilteredResult(_0x422845,_0x246a16){return function(_0x701a8a){if(_0x701a8a){var _0x1e69e5=_0x701a8a[_0x5ec8('0x1e')],_0x32f7da=_0x246a16[_0x5ec8('0x1f')],_0x242a4c=_0x246a16['offset']+_0x246a16[_0x5ec8('0x20')],_0x492531;if(_0x242a4c>=_0x1e69e5){_0x242a4c=_0x1e69e5;_0x492531=0xc8;}else{_0x492531=0xce;}_0x422845[_0x5ec8('0x1c')](_0x492531);return _0x422845[_0x5ec8('0x21')]('Content-Range',_0x32f7da+'-'+_0x242a4c+'/'+_0x1e69e5)[_0x5ec8('0x1d')](_0x701a8a);}return null;};}function patchUpdates(_0x2783d1){return function(_0x24ad18){try{jsonpatch['apply'](_0x24ad18,_0x2783d1,!![]);}catch(_0x4cff4a){return BPromise[_0x5ec8('0x22')](_0x4cff4a);}return _0x24ad18[_0x5ec8('0x23')]();};}function saveUpdates(_0x5a6153,_0xdc771a){return function(_0x12bc4a){if(_0x12bc4a){return _0x12bc4a[_0x5ec8('0x24')](_0x5a6153)['then'](function(_0x388f9f){return _0x388f9f;});}return null;};}function removeEntity(_0x1a675b,_0x36db67){return function(_0x298a15){if(_0x298a15){return _0x298a15[_0x5ec8('0x25')]()[_0x5ec8('0x26')](function(){_0x1a675b[_0x5ec8('0x1c')](0xcc)[_0x5ec8('0x1b')]();});}};}function handleEntityNotFound(_0x588e61,_0x112215){return function(_0x232307){if(!_0x232307){_0x588e61[_0x5ec8('0x1a')](0x194);}return _0x232307;};}function handleError(_0x38fdf7,_0x4b9446){_0x4b9446=_0x4b9446||0x1f4;return function(_0x463069){logger[_0x5ec8('0x27')](_0x463069['stack']);if(_0x463069[_0x5ec8('0x28')]){delete _0x463069[_0x5ec8('0x28')];}_0x38fdf7[_0x5ec8('0x1c')](_0x4b9446)[_0x5ec8('0x29')](_0x463069);};}exports[_0x5ec8('0x2a')]=function(_0x39266a,_0x429b66){var _0x1a6b07={},_0x38849c={},_0x192165={'count':0x0,'rows':[]};var _0x42a6c7=db[_0x5ec8('0x2b')][_0x5ec8('0x2c')];_0x38849c[_0x5ec8('0x2d')]=_[_0x5ec8('0x2e')](_0x42a6c7);_0x38849c[_0x5ec8('0x2f')]=_['keys'](_0x39266a[_0x5ec8('0x2f')]);_0x38849c[_0x5ec8('0x30')]=_['intersection'](_0x38849c['model'],_0x38849c[_0x5ec8('0x2f')]);_0x1a6b07['attributes']=_[_0x5ec8('0x31')](_0x38849c['model'],qs[_0x5ec8('0x32')](_0x39266a[_0x5ec8('0x2f')]['fields']));_0x1a6b07['attributes']=_0x1a6b07[_0x5ec8('0x33')][_0x5ec8('0x34')]?_0x1a6b07[_0x5ec8('0x33')]:_0x38849c['model'];if(!_0x39266a['query'][_0x5ec8('0x35')](_0x5ec8('0x36'))){_0x1a6b07['limit']=qs['limit'](_0x39266a[_0x5ec8('0x2f')]['limit']);_0x1a6b07[_0x5ec8('0x1f')]=qs[_0x5ec8('0x1f')](_0x39266a[_0x5ec8('0x2f')][_0x5ec8('0x1f')]);}_0x1a6b07[_0x5ec8('0x37')]=qs[_0x5ec8('0x38')](_0x39266a[_0x5ec8('0x2f')][_0x5ec8('0x38')]);_0x1a6b07[_0x5ec8('0x39')]=qs[_0x5ec8('0x30')](_[_0x5ec8('0x3a')](_0x39266a[_0x5ec8('0x2f')],_0x38849c['filters']));if(_0x39266a['query'][_0x5ec8('0x3b')]){_0x1a6b07[_0x5ec8('0x39')]=_[_0x5ec8('0x3c')](_0x1a6b07[_0x5ec8('0x39')],{'$or':_[_0x5ec8('0x3d')](_0x42a6c7,function(_0x5c2ca4){if(_0x5c2ca4[_0x5ec8('0x3e')][_0x5ec8('0x3f')]!==_0x5ec8('0x40')){var _0x27bd8d={};_0x27bd8d[_0x5c2ca4[_0x5ec8('0x41')]]={'$like':'%'+_0x39266a['query'][_0x5ec8('0x3b')]+'%'};return _0x27bd8d;}})});}_0x1a6b07=_[_0x5ec8('0x3c')]({},_0x1a6b07,_0x39266a[_0x5ec8('0x42')]);var _0x2c3daa={'where':_0x1a6b07['where']};return db[_0x5ec8('0x2b')][_0x5ec8('0x1e')](_0x2c3daa)[_0x5ec8('0x26')](function(_0x47956b){_0x192165[_0x5ec8('0x1e')]=_0x47956b;if(_0x39266a['query'][_0x5ec8('0x43')]){_0x1a6b07[_0x5ec8('0x44')]=[{'all':!![]}];}return db[_0x5ec8('0x2b')][_0x5ec8('0x45')](_0x1a6b07);})[_0x5ec8('0x26')](function(_0x5db9e0){_0x192165[_0x5ec8('0x46')]=_0x5db9e0;return _0x192165;})[_0x5ec8('0x26')](respondWithFilteredResult(_0x429b66,_0x1a6b07))[_0x5ec8('0x47')](handleError(_0x429b66,null));};exports[_0x5ec8('0x48')]=function(_0x115e1f,_0x5d12bd){var _0x5115d3={'raw':!![],'where':{'id':_0x115e1f[_0x5ec8('0x49')]['id']}},_0x1699cc={};_0x1699cc[_0x5ec8('0x2d')]=_[_0x5ec8('0x2e')](db[_0x5ec8('0x2b')][_0x5ec8('0x2c')]);_0x1699cc[_0x5ec8('0x2f')]=_[_0x5ec8('0x2e')](_0x115e1f[_0x5ec8('0x2f')]);_0x1699cc[_0x5ec8('0x30')]=_[_0x5ec8('0x31')](_0x1699cc[_0x5ec8('0x2d')],_0x1699cc['query']);_0x5115d3['attributes']=_['intersection'](_0x1699cc['model'],qs[_0x5ec8('0x32')](_0x115e1f[_0x5ec8('0x2f')][_0x5ec8('0x32')]));_0x5115d3['attributes']=_0x5115d3[_0x5ec8('0x33')][_0x5ec8('0x34')]?_0x5115d3[_0x5ec8('0x33')]:_0x1699cc[_0x5ec8('0x2d')];if(_0x115e1f[_0x5ec8('0x2f')][_0x5ec8('0x43')]){_0x5115d3[_0x5ec8('0x44')]=[{'all':!![]}];}_0x5115d3=_[_0x5ec8('0x3c')]({},_0x5115d3,_0x115e1f[_0x5ec8('0x42')]);return db[_0x5ec8('0x2b')]['find'](_0x5115d3)[_0x5ec8('0x26')](handleEntityNotFound(_0x5d12bd,null))[_0x5ec8('0x26')](respondWithResult(_0x5d12bd,null))[_0x5ec8('0x47')](handleError(_0x5d12bd,null));};exports[_0x5ec8('0x4a')]=function(_0x5a25ae,_0x37508f){return db[_0x5ec8('0x2b')][_0x5ec8('0x4a')](_0x5a25ae[_0x5ec8('0x4b')],{})['then'](respondWithResult(_0x37508f,0xc9))['catch'](handleError(_0x37508f,null));};exports[_0x5ec8('0x24')]=function(_0x58e632,_0x483878){if(_0x58e632[_0x5ec8('0x4b')]['id']){delete _0x58e632['body']['id'];}return db[_0x5ec8('0x2b')][_0x5ec8('0x4c')]({'where':{'id':_0x58e632[_0x5ec8('0x49')]['id']}})[_0x5ec8('0x26')](handleEntityNotFound(_0x483878,null))[_0x5ec8('0x26')](saveUpdates(_0x58e632[_0x5ec8('0x4b')],null))['then'](respondWithResult(_0x483878,null))[_0x5ec8('0x47')](handleError(_0x483878,null));};exports['destroy']=function(_0x4a24bf,_0x308bb6){return db[_0x5ec8('0x2b')][_0x5ec8('0x4c')]({'where':{'id':_0x4a24bf[_0x5ec8('0x49')]['id']}})[_0x5ec8('0x26')](handleEntityNotFound(_0x308bb6,null))[_0x5ec8('0x26')](removeEntity(_0x308bb6,null))[_0x5ec8('0x47')](handleError(_0x308bb6,null));};exports['describe']=function(_0x37141,_0x4a3d85){return db[_0x5ec8('0x2b')][_0x5ec8('0x4d')]()[_0x5ec8('0x26')](respondWithResult(_0x4a3d85,null))['catch'](handleError(_0x4a3d85,null));}; \ No newline at end of file +var _0xeae6=['filter','merge','SmsQueueReport','includeAll','include','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','map','VIRTUAL'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xeae6,0xe1));var _0x6eae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeae6[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x6eae('0x0'));var emlformat=require(_0x6eae('0x1'));var rimraf=require(_0x6eae('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6eae('0x3'));var rp=require(_0x6eae('0x4'));var moment=require(_0x6eae('0x5'));var BPromise=require(_0x6eae('0x6'));var Mustache=require(_0x6eae('0x7'));var util=require(_0x6eae('0x8'));var path=require(_0x6eae('0x9'));var sox=require(_0x6eae('0xa'));var csv=require(_0x6eae('0xb'));var ejs=require(_0x6eae('0xc'));var fs=require('fs');var _=require(_0x6eae('0xd'));var squel=require('squel');var crypto=require(_0x6eae('0xe'));var jsforce=require(_0x6eae('0xf'));var deskjs=require(_0x6eae('0x10'));var toCsv=require(_0x6eae('0xb'));var querystring=require(_0x6eae('0x11'));var Papa=require(_0x6eae('0x12'));var authService=require(_0x6eae('0x13'));var hardwareService=require(_0x6eae('0x14'));var Redis=require(_0x6eae('0x15'));var qs=require(_0x6eae('0x16'));var logger=require(_0x6eae('0x17'))(_0x6eae('0x18'));var utils=require(_0x6eae('0x19'));var config=require('../../config/environment');var db=require(_0x6eae('0x1a'))['db'];function respondWithStatusCode(_0xcde490,_0x50d0d9){_0x50d0d9=_0x50d0d9||0xcc;return function(_0xfab814){if(_0xfab814){return _0xcde490[_0x6eae('0x1b')](_0x50d0d9);}return _0xcde490[_0x6eae('0x1c')](_0x50d0d9)['end']();};}function respondWithResult(_0x2ed519,_0x48a2f5){_0x48a2f5=_0x48a2f5||0xc8;return function(_0x3b6c6f){if(_0x3b6c6f){return _0x2ed519['status'](_0x48a2f5)[_0x6eae('0x1d')](_0x3b6c6f);}};}function respondWithFilteredResult(_0xf3d3d9,_0x146595){return function(_0x3b32b9){if(_0x3b32b9){var _0x2d6478=_0x3b32b9[_0x6eae('0x1e')],_0x28765d=_0x146595['offset'],_0x5b4f3d=_0x146595[_0x6eae('0x1f')]+_0x146595[_0x6eae('0x20')],_0x3b5819;if(_0x5b4f3d>=_0x2d6478){_0x5b4f3d=_0x2d6478;_0x3b5819=0xc8;}else{_0x3b5819=0xce;}_0xf3d3d9[_0x6eae('0x1c')](_0x3b5819);return _0xf3d3d9[_0x6eae('0x21')]('Content-Range',_0x28765d+'-'+_0x5b4f3d+'/'+_0x2d6478)[_0x6eae('0x1d')](_0x3b32b9);}return null;};}function patchUpdates(_0x1b2291){return function(_0x15cea8){try{jsonpatch[_0x6eae('0x22')](_0x15cea8,_0x1b2291,!![]);}catch(_0x4faeb5){return BPromise[_0x6eae('0x23')](_0x4faeb5);}return _0x15cea8[_0x6eae('0x24')]();};}function saveUpdates(_0x1f9527,_0x432caf){return function(_0x1407bf){if(_0x1407bf){return _0x1407bf[_0x6eae('0x25')](_0x1f9527)['then'](function(_0x5a4871){return _0x5a4871;});}return null;};}function removeEntity(_0x218365,_0x568c9e){return function(_0x4756a4){if(_0x4756a4){return _0x4756a4[_0x6eae('0x26')]()[_0x6eae('0x27')](function(){_0x218365[_0x6eae('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdd560e,_0x18d7d8){return function(_0xe0fd6e){if(!_0xe0fd6e){_0xdd560e[_0x6eae('0x1b')](0x194);}return _0xe0fd6e;};}function handleError(_0x5a0c2e,_0x13e951){_0x13e951=_0x13e951||0x1f4;return function(_0x4aeb8c){logger[_0x6eae('0x28')](_0x4aeb8c[_0x6eae('0x29')]);if(_0x4aeb8c[_0x6eae('0x2a')]){delete _0x4aeb8c['name'];}_0x5a0c2e['status'](_0x13e951)[_0x6eae('0x2b')](_0x4aeb8c);};}exports[_0x6eae('0x2c')]=function(_0x15e096,_0x35357e){var _0x34d63a={},_0x652837={},_0x1b9827={'count':0x0,'rows':[]};var _0x295447=db['SmsQueueReport']['rawAttributes'];_0x652837['model']=_['keys'](_0x295447);_0x652837[_0x6eae('0x2d')]=_[_0x6eae('0x2e')](_0x15e096['query']);_0x652837[_0x6eae('0x2f')]=_[_0x6eae('0x30')](_0x652837[_0x6eae('0x31')],_0x652837[_0x6eae('0x2d')]);_0x34d63a['attributes']=_[_0x6eae('0x30')](_0x652837[_0x6eae('0x31')],qs[_0x6eae('0x32')](_0x15e096[_0x6eae('0x2d')][_0x6eae('0x32')]));_0x34d63a[_0x6eae('0x33')]=_0x34d63a[_0x6eae('0x33')][_0x6eae('0x34')]?_0x34d63a[_0x6eae('0x33')]:_0x652837[_0x6eae('0x31')];if(!_0x15e096['query']['hasOwnProperty'](_0x6eae('0x35'))){_0x34d63a[_0x6eae('0x20')]=qs[_0x6eae('0x20')](_0x15e096[_0x6eae('0x2d')][_0x6eae('0x20')]);_0x34d63a[_0x6eae('0x1f')]=qs['offset'](_0x15e096[_0x6eae('0x2d')][_0x6eae('0x1f')]);}_0x34d63a['order']=qs['sort'](_0x15e096[_0x6eae('0x2d')][_0x6eae('0x36')]);_0x34d63a[_0x6eae('0x37')]=qs[_0x6eae('0x2f')](_[_0x6eae('0x38')](_0x15e096[_0x6eae('0x2d')],_0x652837[_0x6eae('0x2f')]));if(_0x15e096[_0x6eae('0x2d')]['filter']){_0x34d63a[_0x6eae('0x37')]=_['merge'](_0x34d63a['where'],{'$or':_[_0x6eae('0x39')](_0x295447,function(_0x307433){if(_0x307433['type']['key']!==_0x6eae('0x3a')){var _0xfa86ae={};_0xfa86ae[_0x307433['field']]={'$like':'%'+_0x15e096[_0x6eae('0x2d')][_0x6eae('0x3b')]+'%'};return _0xfa86ae;}})});}_0x34d63a=_[_0x6eae('0x3c')]({},_0x34d63a,_0x15e096['options']);var _0x3cd441={'where':_0x34d63a[_0x6eae('0x37')]};return db[_0x6eae('0x3d')][_0x6eae('0x1e')](_0x3cd441)[_0x6eae('0x27')](function(_0x599b26){_0x1b9827[_0x6eae('0x1e')]=_0x599b26;if(_0x15e096[_0x6eae('0x2d')][_0x6eae('0x3e')]){_0x34d63a[_0x6eae('0x3f')]=[{'all':!![]}];}return db[_0x6eae('0x3d')]['findAll'](_0x34d63a);})['then'](function(_0x4e0cbf){_0x1b9827[_0x6eae('0x40')]=_0x4e0cbf;return _0x1b9827;})[_0x6eae('0x27')](respondWithFilteredResult(_0x35357e,_0x34d63a))[_0x6eae('0x41')](handleError(_0x35357e,null));};exports['show']=function(_0x8faa46,_0x4f4246){var _0x5c1616={'raw':!![],'where':{'id':_0x8faa46[_0x6eae('0x42')]['id']}},_0x7e7ec7={};_0x7e7ec7[_0x6eae('0x31')]=_[_0x6eae('0x2e')](db[_0x6eae('0x3d')]['rawAttributes']);_0x7e7ec7['query']=_[_0x6eae('0x2e')](_0x8faa46['query']);_0x7e7ec7[_0x6eae('0x2f')]=_[_0x6eae('0x30')](_0x7e7ec7[_0x6eae('0x31')],_0x7e7ec7[_0x6eae('0x2d')]);_0x5c1616[_0x6eae('0x33')]=_['intersection'](_0x7e7ec7[_0x6eae('0x31')],qs[_0x6eae('0x32')](_0x8faa46[_0x6eae('0x2d')]['fields']));_0x5c1616[_0x6eae('0x33')]=_0x5c1616[_0x6eae('0x33')][_0x6eae('0x34')]?_0x5c1616[_0x6eae('0x33')]:_0x7e7ec7[_0x6eae('0x31')];if(_0x8faa46['query'][_0x6eae('0x3e')]){_0x5c1616[_0x6eae('0x3f')]=[{'all':!![]}];}_0x5c1616=_[_0x6eae('0x3c')]({},_0x5c1616,_0x8faa46['options']);return db[_0x6eae('0x3d')][_0x6eae('0x43')](_0x5c1616)[_0x6eae('0x27')](handleEntityNotFound(_0x4f4246,null))['then'](respondWithResult(_0x4f4246,null))[_0x6eae('0x41')](handleError(_0x4f4246,null));};exports['create']=function(_0x161c9d,_0x4a3f02){return db[_0x6eae('0x3d')][_0x6eae('0x44')](_0x161c9d[_0x6eae('0x45')],{})[_0x6eae('0x27')](respondWithResult(_0x4a3f02,0xc9))[_0x6eae('0x41')](handleError(_0x4a3f02,null));};exports[_0x6eae('0x25')]=function(_0x32a76f,_0x56995b){if(_0x32a76f['body']['id']){delete _0x32a76f[_0x6eae('0x45')]['id'];}return db[_0x6eae('0x3d')][_0x6eae('0x43')]({'where':{'id':_0x32a76f[_0x6eae('0x42')]['id']}})[_0x6eae('0x27')](handleEntityNotFound(_0x56995b,null))[_0x6eae('0x27')](saveUpdates(_0x32a76f[_0x6eae('0x45')],null))['then'](respondWithResult(_0x56995b,null))['catch'](handleError(_0x56995b,null));};exports[_0x6eae('0x26')]=function(_0x581596,_0x559046){return db[_0x6eae('0x3d')][_0x6eae('0x43')]({'where':{'id':_0x581596['params']['id']}})['then'](handleEntityNotFound(_0x559046,null))[_0x6eae('0x27')](removeEntity(_0x559046,null))[_0x6eae('0x41')](handleError(_0x559046,null));};exports['describe']=function(_0x36ff1f,_0x27402b){return db[_0x6eae('0x3d')][_0x6eae('0x46')]()[_0x6eae('0x27')](respondWithResult(_0x27402b,null))[_0x6eae('0x41')](handleError(_0x27402b,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 120e6ff..16acc82 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 _0x0c92=['util','api','moment','bluebird','./smsQueueReport.attributes','exports','uniqueid','lodash'];(function(_0x8a912d,_0x53c52b){var _0x4fb44b=function(_0xb62428){while(--_0xb62428){_0x8a912d['push'](_0x8a912d['shift']());}};_0x4fb44b(++_0x53c52b);}(_0x0c92,0x1af));var _0x20c9=function(_0x3a723e,_0x59d99a){_0x3a723e=_0x3a723e-0x0;var _0x3e9c03=_0x0c92[_0x3a723e];return _0x3e9c03;};'use strict';var _=require(_0x20c9('0x0'));var util=require(_0x20c9('0x1'));var logger=require('../../config/logger')(_0x20c9('0x2'));var moment=require(_0x20c9('0x3'));var BPromise=require(_0x20c9('0x4'));var rp=require('request-promise');var attributes=require(_0x20c9('0x5'));module[_0x20c9('0x6')]=function(_0x5d89f9,_0x25a5c2){return _0x5d89f9['define']('SmsQueueReport',attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x20c9('0x7'),'fields':[_0x20c9('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6fb8=['../../config/logger','api','bluebird','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash'];(function(_0x4147ff,_0x154530){var _0x1e71e6=function(_0x21f992){while(--_0x21f992){_0x4147ff['push'](_0x4147ff['shift']());}};_0x1e71e6(++_0x154530);}(_0x6fb8,0x104));var _0x86fb=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0x6fb8[_0x35e92e];return _0x1205a8;};'use strict';var _=require(_0x86fb('0x0'));var util=require('util');var logger=require(_0x86fb('0x1'))(_0x86fb('0x2'));var moment=require('moment');var BPromise=require(_0x86fb('0x3'));var rp=require('request-promise');var attributes=require('./smsQueueReport.attributes');module[_0x86fb('0x4')]=function(_0x3838ac,_0x141f20){return _0x3838ac[_0x86fb('0x5')](_0x86fb('0x6'),attributes,{'tableName':_0x86fb('0x7'),'paranoid':![],'indexes':[{'name':_0x86fb('0x8'),'fields':[_0x86fb('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b67db3c..801a89d 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 _0xff39=['create','body','options','raw','SmsQueueReport','attributes','limit','UpdateSmsQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport'];(function(_0x29131f,_0x226727){var _0x299226=function(_0x2b9e4e){while(--_0x2b9e4e){_0x29131f['push'](_0x29131f['shift']());}};_0x299226(++_0x226727);}(_0xff39,0x19b));var _0x9ff3=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0xff39[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require('lodash');var util=require(_0x9ff3('0x0'));var moment=require(_0x9ff3('0x1'));var BPromise=require(_0x9ff3('0x2'));var rs=require(_0x9ff3('0x3'));var fs=require('fs');var Redis=require(_0x9ff3('0x4'));var db=require(_0x9ff3('0x5'))['db'];var utils=require(_0x9ff3('0x6'));var logger=require(_0x9ff3('0x7'))('rpc');var config=require(_0x9ff3('0x8'));var jayson=require(_0x9ff3('0x9'));var client=jayson[_0x9ff3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ac98b,_0x5b4182,_0x19b30d){return new BPromise(function(_0x158d7c,_0x199ff1){return client['request'](_0x2ac98b,_0x19b30d)[_0x9ff3('0xb')](function(_0x1b91f5){logger[_0x9ff3('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x5b4182,_0x9ff3('0xd'));logger['debug'](_0x9ff3('0xe'),_0x5b4182,'request\x20sent',JSON[_0x9ff3('0xf')](_0x1b91f5));if(_0x1b91f5[_0x9ff3('0x10')]){if(_0x1b91f5['error'][_0x9ff3('0x11')]===0x1f4){logger['error'](_0x9ff3('0x12'),_0x5b4182,_0x1b91f5[_0x9ff3('0x10')]['message']);return _0x199ff1(_0x1b91f5[_0x9ff3('0x10')][_0x9ff3('0x13')]);}logger[_0x9ff3('0x10')](_0x9ff3('0x12'),_0x5b4182,_0x1b91f5[_0x9ff3('0x10')]['message']);return _0x158d7c(_0x1b91f5[_0x9ff3('0x10')][_0x9ff3('0x13')]);}else{logger[_0x9ff3('0xc')](_0x9ff3('0x12'),_0x5b4182,'request\x20sent');_0x158d7c(_0x1b91f5[_0x9ff3('0x14')]['message']);}})[_0x9ff3('0x15')](function(_0x1e5d25){logger[_0x9ff3('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x5b4182,_0x1e5d25);_0x199ff1(_0x1e5d25);});});}exports[_0x9ff3('0x16')]=function(_0x4e80b2){var _0xc05141=this;return new Promise(function(_0x2b7352,_0x50ec08){return db['SmsQueueReport'][_0x9ff3('0x17')](_0x4e80b2[_0x9ff3('0x18')],{'raw':_0x4e80b2[_0x9ff3('0x19')]?_0x4e80b2[_0x9ff3('0x19')][_0x9ff3('0x1a')]===undefined?!![]:![]:!![]})[_0x9ff3('0xb')](function(_0x3fca55){logger[_0x9ff3('0xc')](_0x9ff3('0x16'),_0x4e80b2);logger['debug'](_0x9ff3('0x16'),_0x4e80b2,JSON[_0x9ff3('0xf')](_0x3fca55));_0x2b7352(_0x3fca55);})['catch'](function(_0x5a3547){logger['error'](_0x9ff3('0x16'),_0x5a3547[_0x9ff3('0x13')],_0x4e80b2);_0x50ec08(_0xc05141[_0x9ff3('0x10')](0x1f4,_0x5a3547['message']));});});};exports['UpdateSmsQueueReport']=function(_0x1126cf){var _0x582441=this;return new Promise(function(_0x346dc4,_0x1c2aac){return db[_0x9ff3('0x1b')]['update'](_0x1126cf['body'],{'raw':_0x1126cf[_0x9ff3('0x19')]?_0x1126cf[_0x9ff3('0x19')][_0x9ff3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1126cf['options']?_0x1126cf[_0x9ff3('0x19')]['where']||null:null,'attributes':_0x1126cf['options']?_0x1126cf[_0x9ff3('0x19')][_0x9ff3('0x1c')]||null:null,'limit':_0x1126cf[_0x9ff3('0x19')]?_0x1126cf[_0x9ff3('0x19')][_0x9ff3('0x1d')]||null:null})['then'](function(_0x3dc768){logger['info']('UpdateSmsQueueReport',_0x1126cf);logger['debug'](_0x9ff3('0x1e'),_0x1126cf,JSON[_0x9ff3('0xf')](_0x3dc768));_0x346dc4(_0x3dc768);})[_0x9ff3('0x15')](function(_0x5993b1){logger[_0x9ff3('0x10')](_0x9ff3('0x1e'),_0x5993b1[_0x9ff3('0x13')],_0x1126cf);_0x1c2aac(_0x582441[_0x9ff3('0x10')](0x1f4,_0x5993b1['message']));});});}; \ No newline at end of file +var _0xda98=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsQueueReport','create','body','options','raw','then','catch','UpdateSmsQueueReport','SmsQueueReport','where','attributes','lodash'];(function(_0x571168,_0x53b80b){var _0x15840e=function(_0x1ab95f){while(--_0x1ab95f){_0x571168['push'](_0x571168['shift']());}};_0x15840e(++_0x53b80b);}(_0xda98,0x1b9));var _0x8da9=function(_0x35a779,_0x27f8fb){_0x35a779=_0x35a779-0x0;var _0xca723b=_0xda98[_0x35a779];return _0xca723b;};'use strict';var _=require(_0x8da9('0x0'));var util=require('util');var moment=require(_0x8da9('0x1'));var BPromise=require(_0x8da9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8da9('0x3'));var db=require(_0x8da9('0x4'))['db'];var utils=require(_0x8da9('0x5'));var logger=require(_0x8da9('0x6'))(_0x8da9('0x7'));var config=require(_0x8da9('0x8'));var jayson=require(_0x8da9('0x9'));var client=jayson[_0x8da9('0xa')][_0x8da9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9dbc71,_0x564aa8,_0x7205d1){return new BPromise(function(_0x1db99b,_0x2545c0){return client[_0x8da9('0xc')](_0x9dbc71,_0x7205d1)['then'](function(_0x38685b){logger[_0x8da9('0xd')](_0x8da9('0xe'),_0x564aa8,_0x8da9('0xf'));logger[_0x8da9('0x10')](_0x8da9('0x11'),_0x564aa8,'request\x20sent',JSON[_0x8da9('0x12')](_0x38685b));if(_0x38685b[_0x8da9('0x13')]){if(_0x38685b[_0x8da9('0x13')][_0x8da9('0x14')]===0x1f4){logger[_0x8da9('0x13')](_0x8da9('0xe'),_0x564aa8,_0x38685b[_0x8da9('0x13')][_0x8da9('0x15')]);return _0x2545c0(_0x38685b[_0x8da9('0x13')]['message']);}logger['error'](_0x8da9('0xe'),_0x564aa8,_0x38685b[_0x8da9('0x13')][_0x8da9('0x15')]);return _0x1db99b(_0x38685b['error'][_0x8da9('0x15')]);}else{logger[_0x8da9('0xd')](_0x8da9('0xe'),_0x564aa8,_0x8da9('0xf'));_0x1db99b(_0x38685b[_0x8da9('0x16')]['message']);}})['catch'](function(_0xf0954b){logger['error'](_0x8da9('0xe'),_0x564aa8,_0xf0954b);_0x2545c0(_0xf0954b);});});}exports[_0x8da9('0x17')]=function(_0x302b83){var _0x3e5266=this;return new Promise(function(_0x4ff39a,_0x403f5c){return db['SmsQueueReport'][_0x8da9('0x18')](_0x302b83[_0x8da9('0x19')],{'raw':_0x302b83[_0x8da9('0x1a')]?_0x302b83[_0x8da9('0x1a')][_0x8da9('0x1b')]===undefined?!![]:![]:!![]})[_0x8da9('0x1c')](function(_0x3def0c){logger[_0x8da9('0xd')]('CreateSmsQueueReport',_0x302b83);logger['debug'](_0x8da9('0x17'),_0x302b83,JSON['stringify'](_0x3def0c));_0x4ff39a(_0x3def0c);})[_0x8da9('0x1d')](function(_0x161944){logger[_0x8da9('0x13')](_0x8da9('0x17'),_0x161944[_0x8da9('0x15')],_0x302b83);_0x403f5c(_0x3e5266[_0x8da9('0x13')](0x1f4,_0x161944[_0x8da9('0x15')]));});});};exports[_0x8da9('0x1e')]=function(_0x17e57e){var _0x4bfe0e=this;return new Promise(function(_0x199352,_0x57e1ed){return db[_0x8da9('0x1f')]['update'](_0x17e57e[_0x8da9('0x19')],{'raw':_0x17e57e[_0x8da9('0x1a')]?_0x17e57e[_0x8da9('0x1a')][_0x8da9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e57e[_0x8da9('0x1a')]?_0x17e57e['options'][_0x8da9('0x20')]||null:null,'attributes':_0x17e57e[_0x8da9('0x1a')]?_0x17e57e[_0x8da9('0x1a')][_0x8da9('0x21')]||null:null,'limit':_0x17e57e[_0x8da9('0x1a')]?_0x17e57e['options']['limit']||null:null})[_0x8da9('0x1c')](function(_0x2c0a8f){logger['info'](_0x8da9('0x1e'),_0x17e57e);logger[_0x8da9('0x10')](_0x8da9('0x1e'),_0x17e57e,JSON[_0x8da9('0x12')](_0x2c0a8f));_0x199352(_0x2c0a8f);})[_0x8da9('0x1d')](function(_0x2bdaae){logger[_0x8da9('0x13')](_0x8da9('0x1e'),_0x2bdaae['message'],_0x17e57e);_0x57e1ed(_0x4bfe0e['error'](0x1f4,_0x2bdaae['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b401653..9c967ba 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 _0xb5e9=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xe0b953,_0x46a717){var _0x1ef934=function(_0x528603){while(--_0x528603){_0xe0b953['push'](_0xe0b953['shift']());}};_0x1ef934(++_0x46a717);}(_0xb5e9,0x1c7));var _0x9b5e=function(_0x3f0d76,_0x378fed){_0x3f0d76=_0x3f0d76-0x0;var _0x12c12e=_0xb5e9[_0x3f0d76];return _0x12c12e;};'use strict';var multer=require(_0x9b5e('0x0'));var util=require(_0x9b5e('0x1'));var path=require('path');var timeout=require(_0x9b5e('0x2'));var express=require(_0x9b5e('0x3'));var router=express[_0x9b5e('0x4')]();var auth=require(_0x9b5e('0x5'));var interaction=require(_0x9b5e('0x6'));var config=require(_0x9b5e('0x7'));var controller=require(_0x9b5e('0x8'));router[_0x9b5e('0x9')]('/',auth[_0x9b5e('0xa')](),controller[_0x9b5e('0xb')]);router['get'](_0x9b5e('0xc'),auth[_0x9b5e('0xa')](),controller[_0x9b5e('0xd')]);router[_0x9b5e('0x9')](_0x9b5e('0xe'),auth[_0x9b5e('0xa')](),controller['show']);router[_0x9b5e('0xf')]('/',auth[_0x9b5e('0xa')](),controller[_0x9b5e('0x10')]);router[_0x9b5e('0x11')](_0x9b5e('0xe'),auth[_0x9b5e('0xa')](),controller[_0x9b5e('0x12')]);router[_0x9b5e('0x13')](_0x9b5e('0xe'),auth[_0x9b5e('0xa')](),controller[_0x9b5e('0x14')]);module['exports']=router; \ No newline at end of file +var _0x0081=['isAuthenticated','index','/:id','show','post','create','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./smsTransferReport.controller','get'];(function(_0x484cac,_0x30ad3a){var _0x1d6e77=function(_0x4f5f16){while(--_0x4f5f16){_0x484cac['push'](_0x484cac['shift']());}};_0x1d6e77(++_0x30ad3a);}(_0x0081,0x17e));var _0x1008=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x0081[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require(_0x1008('0x0'));var util=require(_0x1008('0x1'));var path=require(_0x1008('0x2'));var timeout=require(_0x1008('0x3'));var express=require(_0x1008('0x4'));var router=express[_0x1008('0x5')]();var auth=require(_0x1008('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1008('0x7'));router[_0x1008('0x8')]('/',auth[_0x1008('0x9')](),controller[_0x1008('0xa')]);router[_0x1008('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x1008('0x8')](_0x1008('0xb'),auth[_0x1008('0x9')](),controller[_0x1008('0xc')]);router[_0x1008('0xd')]('/',auth['isAuthenticated'](),controller[_0x1008('0xe')]);router['put'](_0x1008('0xb'),auth['isAuthenticated'](),controller[_0x1008('0xf')]);router[_0x1008('0x10')](_0x1008('0xb'),auth[_0x1008('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index b05c939..52c3e2d 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 _0x6ee3=['ENUM','account','agent','queue','DATE','moment','sequelize','exports','STRING'];(function(_0x5dff26,_0x2a2f10){var _0x4b2734=function(_0x2834f1){while(--_0x2834f1){_0x5dff26['push'](_0x5dff26['shift']());}};_0x4b2734(++_0x2a2f10);}(_0x6ee3,0x12e));var _0x36ee=function(_0x406017,_0x5d7fba){_0x406017=_0x406017-0x0;var _0x4d4ed7=_0x6ee3[_0x406017];return _0x4d4ed7;};'use strict';var moment=require(_0x36ee('0x0'));var Sequelize=require(_0x36ee('0x1'));module[_0x36ee('0x2')]={'uniqueid':{'type':Sequelize[_0x36ee('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x36ee('0x4')](_0x36ee('0x5'),_0x36ee('0x6'),_0x36ee('0x7')),'allowNull':![],'defaultValue':_0x36ee('0x7')},'transferredAt':{'type':Sequelize[_0x36ee('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x42b6=['ENUM','agent','queue','DATE','moment','sequelize','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x42b6,0x9e));var _0x642b=function(_0x2b65fa,_0x21cadf){_0x2b65fa=_0x2b65fa-0x0;var _0x32b643=_0x42b6[_0x2b65fa];return _0x32b643;};'use strict';var moment=require(_0x642b('0x0'));var Sequelize=require(_0x642b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x642b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x642b('0x3')]('account',_0x642b('0x4'),_0x642b('0x5')),'allowNull':![],'defaultValue':_0x642b('0x5')},'transferredAt':{'type':Sequelize[_0x642b('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index d033c41..03366b8 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 _0x6b06=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','status','json','count','offset','limit','Content-Range','apply','save','update','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','type','VIRTUAL','filter','options','SmsTransferReport','then','includeAll','include','findAll','rows','catch','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','crypto'];(function(_0x38d542,_0x200971){var _0x2dc026=function(_0x183238){while(--_0x183238){_0x38d542['push'](_0x38d542['shift']());}};_0x2dc026(++_0x200971);}(_0x6b06,0x7f));var _0x66b0=function(_0x5859d4,_0x557f6f){_0x5859d4=_0x5859d4-0x0;var _0xa5f2f7=_0x6b06[_0x5859d4];return _0xa5f2f7;};'use strict';var pdf=require(_0x66b0('0x0'));var emlformat=require(_0x66b0('0x1'));var rimraf=require(_0x66b0('0x2'));var zipdir=require(_0x66b0('0x3'));var jsonpatch=require(_0x66b0('0x4'));var rp=require('request-promise');var moment=require(_0x66b0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x66b0('0x6'));var util=require(_0x66b0('0x7'));var path=require('path');var sox=require(_0x66b0('0x8'));var csv=require(_0x66b0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x66b0('0xa'));var jsforce=require(_0x66b0('0xb'));var deskjs=require(_0x66b0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x66b0('0xd'));var Papa=require(_0x66b0('0xe'));var authService=require(_0x66b0('0xf'));var hardwareService=require(_0x66b0('0x10'));var Redis=require(_0x66b0('0x11'));var qs=require(_0x66b0('0x12'));var logger=require(_0x66b0('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x66b0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37041b,_0x4c1a00){_0x4c1a00=_0x4c1a00||0xcc;return function(_0x5ab6ca){if(_0x5ab6ca){return _0x37041b['sendStatus'](_0x4c1a00);}return _0x37041b['status'](_0x4c1a00)['end']();};}function respondWithResult(_0x341fc1,_0x462c72){_0x462c72=_0x462c72||0xc8;return function(_0x230d7a){if(_0x230d7a){return _0x341fc1[_0x66b0('0x15')](_0x462c72)[_0x66b0('0x16')](_0x230d7a);}};}function respondWithFilteredResult(_0x551f19,_0x2318c9){return function(_0x5af567){if(_0x5af567){var _0x3e9a44=_0x5af567[_0x66b0('0x17')],_0x4b5be3=_0x2318c9['offset'],_0x1a7204=_0x2318c9[_0x66b0('0x18')]+_0x2318c9[_0x66b0('0x19')],_0x2d47ef;if(_0x1a7204>=_0x3e9a44){_0x1a7204=_0x3e9a44;_0x2d47ef=0xc8;}else{_0x2d47ef=0xce;}_0x551f19[_0x66b0('0x15')](_0x2d47ef);return _0x551f19['set'](_0x66b0('0x1a'),_0x4b5be3+'-'+_0x1a7204+'/'+_0x3e9a44)['json'](_0x5af567);}return null;};}function patchUpdates(_0x125513){return function(_0x2b18fa){try{jsonpatch[_0x66b0('0x1b')](_0x2b18fa,_0x125513,!![]);}catch(_0xe82e4c){return BPromise['reject'](_0xe82e4c);}return _0x2b18fa[_0x66b0('0x1c')]();};}function saveUpdates(_0x4a2fb6,_0x22d856){return function(_0x396667){if(_0x396667){return _0x396667[_0x66b0('0x1d')](_0x4a2fb6)['then'](function(_0x1c05b2){return _0x1c05b2;});}return null;};}function removeEntity(_0x2be666,_0x225b67){return function(_0x5df420){if(_0x5df420){return _0x5df420[_0x66b0('0x1e')]()['then'](function(){_0x2be666['status'](0xcc)[_0x66b0('0x1f')]();});}};}function handleEntityNotFound(_0x44f466,_0x440352){return function(_0x22656e){if(!_0x22656e){_0x44f466[_0x66b0('0x20')](0x194);}return _0x22656e;};}function handleError(_0x231127,_0x3b677d){_0x3b677d=_0x3b677d||0x1f4;return function(_0x3d9ac4){logger[_0x66b0('0x21')](_0x3d9ac4[_0x66b0('0x22')]);if(_0x3d9ac4[_0x66b0('0x23')]){delete _0x3d9ac4[_0x66b0('0x23')];}_0x231127[_0x66b0('0x15')](_0x3b677d)[_0x66b0('0x24')](_0x3d9ac4);};}exports[_0x66b0('0x25')]=function(_0x296cc0,_0x58daf9){var _0x5e92a9={},_0x1e1ddc={},_0x45c84c={'count':0x0,'rows':[]};var _0x193fd0=db['SmsTransferReport'][_0x66b0('0x26')];_0x1e1ddc[_0x66b0('0x27')]=_['keys'](_0x193fd0);_0x1e1ddc[_0x66b0('0x28')]=_[_0x66b0('0x29')](_0x296cc0[_0x66b0('0x28')]);_0x1e1ddc['filters']=_[_0x66b0('0x2a')](_0x1e1ddc[_0x66b0('0x27')],_0x1e1ddc[_0x66b0('0x28')]);_0x5e92a9[_0x66b0('0x2b')]=_[_0x66b0('0x2a')](_0x1e1ddc['model'],qs[_0x66b0('0x2c')](_0x296cc0[_0x66b0('0x28')]['fields']));_0x5e92a9[_0x66b0('0x2b')]=_0x5e92a9['attributes'][_0x66b0('0x2d')]?_0x5e92a9[_0x66b0('0x2b')]:_0x1e1ddc['model'];if(!_0x296cc0[_0x66b0('0x28')][_0x66b0('0x2e')](_0x66b0('0x2f'))){_0x5e92a9['limit']=qs['limit'](_0x296cc0[_0x66b0('0x28')][_0x66b0('0x19')]);_0x5e92a9[_0x66b0('0x18')]=qs[_0x66b0('0x18')](_0x296cc0[_0x66b0('0x28')][_0x66b0('0x18')]);}_0x5e92a9['order']=qs[_0x66b0('0x30')](_0x296cc0[_0x66b0('0x28')]['sort']);_0x5e92a9[_0x66b0('0x31')]=qs[_0x66b0('0x32')](_[_0x66b0('0x33')](_0x296cc0[_0x66b0('0x28')],_0x1e1ddc[_0x66b0('0x32')]));if(_0x296cc0[_0x66b0('0x28')]['filter']){_0x5e92a9[_0x66b0('0x31')]=_[_0x66b0('0x34')](_0x5e92a9[_0x66b0('0x31')],{'$or':_[_0x66b0('0x35')](_0x193fd0,function(_0x1b2c59){if(_0x1b2c59[_0x66b0('0x36')]['key']!==_0x66b0('0x37')){var _0x412bff={};_0x412bff[_0x1b2c59['field']]={'$like':'%'+_0x296cc0[_0x66b0('0x28')][_0x66b0('0x38')]+'%'};return _0x412bff;}})});}_0x5e92a9=_[_0x66b0('0x34')]({},_0x5e92a9,_0x296cc0[_0x66b0('0x39')]);var _0x5d7233={'where':_0x5e92a9[_0x66b0('0x31')]};return db[_0x66b0('0x3a')][_0x66b0('0x17')](_0x5d7233)[_0x66b0('0x3b')](function(_0x24f882){_0x45c84c[_0x66b0('0x17')]=_0x24f882;if(_0x296cc0['query'][_0x66b0('0x3c')]){_0x5e92a9[_0x66b0('0x3d')]=[{'all':!![]}];}return db[_0x66b0('0x3a')][_0x66b0('0x3e')](_0x5e92a9);})[_0x66b0('0x3b')](function(_0x17e306){_0x45c84c[_0x66b0('0x3f')]=_0x17e306;return _0x45c84c;})[_0x66b0('0x3b')](respondWithFilteredResult(_0x58daf9,_0x5e92a9))[_0x66b0('0x40')](handleError(_0x58daf9,null));};exports['show']=function(_0x43c050,_0xc453e9){var _0x2104a0={'raw':!![],'where':{'id':_0x43c050['params']['id']}},_0x4fea73={};_0x4fea73[_0x66b0('0x27')]=_['keys'](db[_0x66b0('0x3a')][_0x66b0('0x26')]);_0x4fea73[_0x66b0('0x28')]=_[_0x66b0('0x29')](_0x43c050[_0x66b0('0x28')]);_0x4fea73['filters']=_['intersection'](_0x4fea73[_0x66b0('0x27')],_0x4fea73[_0x66b0('0x28')]);_0x2104a0['attributes']=_['intersection'](_0x4fea73[_0x66b0('0x27')],qs[_0x66b0('0x2c')](_0x43c050['query'][_0x66b0('0x2c')]));_0x2104a0[_0x66b0('0x2b')]=_0x2104a0[_0x66b0('0x2b')]['length']?_0x2104a0[_0x66b0('0x2b')]:_0x4fea73['model'];if(_0x43c050[_0x66b0('0x28')]['includeAll']){_0x2104a0[_0x66b0('0x3d')]=[{'all':!![]}];}_0x2104a0=_[_0x66b0('0x34')]({},_0x2104a0,_0x43c050[_0x66b0('0x39')]);return db['SmsTransferReport'][_0x66b0('0x41')](_0x2104a0)[_0x66b0('0x3b')](handleEntityNotFound(_0xc453e9,null))[_0x66b0('0x3b')](respondWithResult(_0xc453e9,null))['catch'](handleError(_0xc453e9,null));};exports['create']=function(_0x5c11d4,_0x3efb08){return db[_0x66b0('0x3a')][_0x66b0('0x42')](_0x5c11d4['body'],{})[_0x66b0('0x3b')](respondWithResult(_0x3efb08,0xc9))[_0x66b0('0x40')](handleError(_0x3efb08,null));};exports[_0x66b0('0x1d')]=function(_0x323f28,_0x135da7){if(_0x323f28[_0x66b0('0x43')]['id']){delete _0x323f28[_0x66b0('0x43')]['id'];}return db[_0x66b0('0x3a')][_0x66b0('0x41')]({'where':{'id':_0x323f28[_0x66b0('0x44')]['id']}})[_0x66b0('0x3b')](handleEntityNotFound(_0x135da7,null))[_0x66b0('0x3b')](saveUpdates(_0x323f28['body'],null))[_0x66b0('0x3b')](respondWithResult(_0x135da7,null))[_0x66b0('0x40')](handleError(_0x135da7,null));};exports[_0x66b0('0x1e')]=function(_0x1c9bba,_0x5f0a25){return db[_0x66b0('0x3a')][_0x66b0('0x41')]({'where':{'id':_0x1c9bba[_0x66b0('0x44')]['id']}})[_0x66b0('0x3b')](handleEntityNotFound(_0x5f0a25,null))[_0x66b0('0x3b')](removeEntity(_0x5f0a25,null))[_0x66b0('0x40')](handleError(_0x5f0a25,null));};exports['describe']=function(_0x4de297,_0xc6576b){return db[_0x66b0('0x3a')]['describe']()['then'](respondWithResult(_0xc6576b,null))[_0x66b0('0x40')](handleError(_0xc6576b,null));}; \ No newline at end of file +var _0xed1b=['zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','count','offset','limit','status','set','apply','update','then','destroy','error','stack','name','send','SmsTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','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','rimraf'];(function(_0x289480,_0xc3df5d){var _0x29bd8a=function(_0x54c0c8){while(--_0x54c0c8){_0x289480['push'](_0x289480['shift']());}};_0x29bd8a(++_0xc3df5d);}(_0xed1b,0x125));var _0xbed1=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0xed1b[_0x2fb87c];return _0x43038b;};'use strict';var pdf=require(_0xbed1('0x0'));var emlformat=require(_0xbed1('0x1'));var rimraf=require(_0xbed1('0x2'));var zipdir=require(_0xbed1('0x3'));var jsonpatch=require(_0xbed1('0x4'));var rp=require(_0xbed1('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbed1('0x6'));var util=require(_0xbed1('0x7'));var path=require(_0xbed1('0x8'));var sox=require(_0xbed1('0x9'));var csv=require(_0xbed1('0xa'));var ejs=require(_0xbed1('0xb'));var fs=require('fs');var _=require(_0xbed1('0xc'));var squel=require('squel');var crypto=require(_0xbed1('0xd'));var jsforce=require(_0xbed1('0xe'));var deskjs=require(_0xbed1('0xf'));var toCsv=require(_0xbed1('0xa'));var querystring=require(_0xbed1('0x10'));var Papa=require(_0xbed1('0x11'));var authService=require(_0xbed1('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xbed1('0x13'));var qs=require(_0xbed1('0x14'));var logger=require(_0xbed1('0x15'))(_0xbed1('0x16'));var utils=require(_0xbed1('0x17'));var config=require('../../config/environment');var db=require(_0xbed1('0x18'))['db'];function respondWithStatusCode(_0x843517,_0x4341a9){_0x4341a9=_0x4341a9||0xcc;return function(_0x5cb727){if(_0x5cb727){return _0x843517[_0xbed1('0x19')](_0x4341a9);}return _0x843517['status'](_0x4341a9)['end']();};}function respondWithResult(_0x567c6a,_0x7acc78){_0x7acc78=_0x7acc78||0xc8;return function(_0x5832f9){if(_0x5832f9){return _0x567c6a['status'](_0x7acc78)[_0xbed1('0x1a')](_0x5832f9);}};}function respondWithFilteredResult(_0x46210d,_0x2ad1b6){return function(_0x33f0e0){if(_0x33f0e0){var _0x49384f=_0x33f0e0[_0xbed1('0x1b')],_0x1d57f3=_0x2ad1b6[_0xbed1('0x1c')],_0x4ed015=_0x2ad1b6[_0xbed1('0x1c')]+_0x2ad1b6[_0xbed1('0x1d')],_0xd7d789;if(_0x4ed015>=_0x49384f){_0x4ed015=_0x49384f;_0xd7d789=0xc8;}else{_0xd7d789=0xce;}_0x46210d[_0xbed1('0x1e')](_0xd7d789);return _0x46210d[_0xbed1('0x1f')]('Content-Range',_0x1d57f3+'-'+_0x4ed015+'/'+_0x49384f)['json'](_0x33f0e0);}return null;};}function patchUpdates(_0x5721c0){return function(_0x4dd517){try{jsonpatch[_0xbed1('0x20')](_0x4dd517,_0x5721c0,!![]);}catch(_0x128ffa){return BPromise['reject'](_0x128ffa);}return _0x4dd517['save']();};}function saveUpdates(_0x159e2f,_0xb124fa){return function(_0x25a464){if(_0x25a464){return _0x25a464[_0xbed1('0x21')](_0x159e2f)[_0xbed1('0x22')](function(_0x34ad0a){return _0x34ad0a;});}return null;};}function removeEntity(_0xe45e86,_0x25b823){return function(_0x2f7929){if(_0x2f7929){return _0x2f7929[_0xbed1('0x23')]()[_0xbed1('0x22')](function(){_0xe45e86[_0xbed1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5177e7,_0x5d29fe){return function(_0x132beb){if(!_0x132beb){_0x5177e7[_0xbed1('0x19')](0x194);}return _0x132beb;};}function handleError(_0x5224ed,_0x193016){_0x193016=_0x193016||0x1f4;return function(_0xb4e36e){logger[_0xbed1('0x24')](_0xb4e36e[_0xbed1('0x25')]);if(_0xb4e36e['name']){delete _0xb4e36e[_0xbed1('0x26')];}_0x5224ed[_0xbed1('0x1e')](_0x193016)[_0xbed1('0x27')](_0xb4e36e);};}exports['index']=function(_0x436ec7,_0x43643f){var _0x49b5e6={},_0x481fa6={},_0x5180d2={'count':0x0,'rows':[]};var _0x19150b=db[_0xbed1('0x28')][_0xbed1('0x29')];_0x481fa6[_0xbed1('0x2a')]=_[_0xbed1('0x2b')](_0x19150b);_0x481fa6['query']=_['keys'](_0x436ec7[_0xbed1('0x2c')]);_0x481fa6[_0xbed1('0x2d')]=_[_0xbed1('0x2e')](_0x481fa6['model'],_0x481fa6[_0xbed1('0x2c')]);_0x49b5e6['attributes']=_['intersection'](_0x481fa6[_0xbed1('0x2a')],qs[_0xbed1('0x2f')](_0x436ec7[_0xbed1('0x2c')][_0xbed1('0x2f')]));_0x49b5e6[_0xbed1('0x30')]=_0x49b5e6[_0xbed1('0x30')][_0xbed1('0x31')]?_0x49b5e6[_0xbed1('0x30')]:_0x481fa6[_0xbed1('0x2a')];if(!_0x436ec7[_0xbed1('0x2c')][_0xbed1('0x32')](_0xbed1('0x33'))){_0x49b5e6[_0xbed1('0x1d')]=qs['limit'](_0x436ec7['query'][_0xbed1('0x1d')]);_0x49b5e6['offset']=qs['offset'](_0x436ec7['query'][_0xbed1('0x1c')]);}_0x49b5e6[_0xbed1('0x34')]=qs['sort'](_0x436ec7[_0xbed1('0x2c')][_0xbed1('0x35')]);_0x49b5e6[_0xbed1('0x36')]=qs[_0xbed1('0x2d')](_[_0xbed1('0x37')](_0x436ec7[_0xbed1('0x2c')],_0x481fa6['filters']));if(_0x436ec7[_0xbed1('0x2c')][_0xbed1('0x38')]){_0x49b5e6['where']=_[_0xbed1('0x39')](_0x49b5e6[_0xbed1('0x36')],{'$or':_[_0xbed1('0x3a')](_0x19150b,function(_0x545f7a){if(_0x545f7a[_0xbed1('0x3b')][_0xbed1('0x3c')]!==_0xbed1('0x3d')){var _0x446eb3={};_0x446eb3[_0x545f7a[_0xbed1('0x3e')]]={'$like':'%'+_0x436ec7[_0xbed1('0x2c')][_0xbed1('0x38')]+'%'};return _0x446eb3;}})});}_0x49b5e6=_[_0xbed1('0x39')]({},_0x49b5e6,_0x436ec7[_0xbed1('0x3f')]);var _0x5e0b72={'where':_0x49b5e6[_0xbed1('0x36')]};return db['SmsTransferReport'][_0xbed1('0x1b')](_0x5e0b72)['then'](function(_0x2bfa4d){_0x5180d2[_0xbed1('0x1b')]=_0x2bfa4d;if(_0x436ec7['query'][_0xbed1('0x40')]){_0x49b5e6[_0xbed1('0x41')]=[{'all':!![]}];}return db[_0xbed1('0x28')][_0xbed1('0x42')](_0x49b5e6);})[_0xbed1('0x22')](function(_0x28df1b){_0x5180d2[_0xbed1('0x43')]=_0x28df1b;return _0x5180d2;})[_0xbed1('0x22')](respondWithFilteredResult(_0x43643f,_0x49b5e6))[_0xbed1('0x44')](handleError(_0x43643f,null));};exports['show']=function(_0x141ab1,_0x597a1f){var _0x423aa5={'raw':!![],'where':{'id':_0x141ab1[_0xbed1('0x45')]['id']}},_0x4909d1={};_0x4909d1[_0xbed1('0x2a')]=_[_0xbed1('0x2b')](db['SmsTransferReport']['rawAttributes']);_0x4909d1[_0xbed1('0x2c')]=_[_0xbed1('0x2b')](_0x141ab1[_0xbed1('0x2c')]);_0x4909d1[_0xbed1('0x2d')]=_[_0xbed1('0x2e')](_0x4909d1[_0xbed1('0x2a')],_0x4909d1[_0xbed1('0x2c')]);_0x423aa5[_0xbed1('0x30')]=_[_0xbed1('0x2e')](_0x4909d1[_0xbed1('0x2a')],qs['fields'](_0x141ab1[_0xbed1('0x2c')][_0xbed1('0x2f')]));_0x423aa5['attributes']=_0x423aa5[_0xbed1('0x30')]['length']?_0x423aa5[_0xbed1('0x30')]:_0x4909d1[_0xbed1('0x2a')];if(_0x141ab1[_0xbed1('0x2c')]['includeAll']){_0x423aa5['include']=[{'all':!![]}];}_0x423aa5=_[_0xbed1('0x39')]({},_0x423aa5,_0x141ab1['options']);return db[_0xbed1('0x28')][_0xbed1('0x46')](_0x423aa5)[_0xbed1('0x22')](handleEntityNotFound(_0x597a1f,null))['then'](respondWithResult(_0x597a1f,null))[_0xbed1('0x44')](handleError(_0x597a1f,null));};exports[_0xbed1('0x47')]=function(_0x250e99,_0x42f03f){return db[_0xbed1('0x28')][_0xbed1('0x47')](_0x250e99[_0xbed1('0x48')],{})[_0xbed1('0x22')](respondWithResult(_0x42f03f,0xc9))['catch'](handleError(_0x42f03f,null));};exports[_0xbed1('0x21')]=function(_0xc8cdba,_0x389a8b){if(_0xc8cdba[_0xbed1('0x48')]['id']){delete _0xc8cdba[_0xbed1('0x48')]['id'];}return db[_0xbed1('0x28')][_0xbed1('0x46')]({'where':{'id':_0xc8cdba[_0xbed1('0x45')]['id']}})[_0xbed1('0x22')](handleEntityNotFound(_0x389a8b,null))[_0xbed1('0x22')](saveUpdates(_0xc8cdba[_0xbed1('0x48')],null))[_0xbed1('0x22')](respondWithResult(_0x389a8b,null))['catch'](handleError(_0x389a8b,null));};exports[_0xbed1('0x23')]=function(_0x3215eb,_0x34e109){return db[_0xbed1('0x28')][_0xbed1('0x46')]({'where':{'id':_0x3215eb['params']['id']}})[_0xbed1('0x22')](handleEntityNotFound(_0x34e109,null))[_0xbed1('0x22')](removeEntity(_0x34e109,null))[_0xbed1('0x44')](handleError(_0x34e109,null));};exports[_0xbed1('0x49')]=function(_0x3ba2e0,_0x55567b){return db[_0xbed1('0x28')][_0xbed1('0x49')]()[_0xbed1('0x22')](respondWithResult(_0x55567b,null))[_0xbed1('0x44')](handleError(_0x55567b,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index da09765..c5fec2b 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 _0x9c44=['moment','bluebird','request-promise','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger','api'];(function(_0x4811c5,_0x2a5982){var _0x2950f8=function(_0x1c996e){while(--_0x1c996e){_0x4811c5['push'](_0x4811c5['shift']());}};_0x2950f8(++_0x2a5982);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var attributes=require(_0x49c4('0x5'));module['exports']=function(_0x4941f1,_0x41a183){return _0x4941f1['define'](_0x49c4('0x6'),attributes,{'tableName':_0x49c4('0x7'),'paranoid':![],'indexes':[{'name':_0x49c4('0x8'),'fields':[_0x49c4('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['moment','bluebird','request-promise','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger','api'];(function(_0x1f3064,_0x3dd054){var _0x27f32f=function(_0x3a19c2){while(--_0x3a19c2){_0x1f3064['push'](_0x1f3064['shift']());}};_0x27f32f(++_0x3dd054);}(_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 attributes=require(_0x49c4('0x5'));module['exports']=function(_0x4941f1,_0x41a183){return _0x4941f1['define'](_0x49c4('0x6'),attributes,{'tableName':_0x49c4('0x7'),'paranoid':![],'indexes':[{'name':_0x49c4('0x8'),'fields':[_0x49c4('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 9095981..e3a572e 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 _0x117c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','catch','bluebird'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x117c,0x71));var _0xc117=function(_0x56fd29,_0x17790b){_0x56fd29=_0x56fd29-0x0;var _0x2a0bf7=_0x117c[_0x56fd29];return _0x2a0bf7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc117('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc117('0x1'))['db'];var utils=require(_0xc117('0x2'));var logger=require(_0xc117('0x3'))(_0xc117('0x4'));var config=require(_0xc117('0x5'));var jayson=require(_0xc117('0x6'));var client=jayson['client'][_0xc117('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x389734,_0x48efbb,_0x181a70){return new BPromise(function(_0x56c9bd,_0x451447){return client[_0xc117('0x8')](_0x389734,_0x181a70)[_0xc117('0x9')](function(_0x39e33f){logger[_0xc117('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x48efbb,_0xc117('0xb'));logger['debug'](_0xc117('0xc'),_0x48efbb,'request\x20sent',JSON[_0xc117('0xd')](_0x39e33f));if(_0x39e33f[_0xc117('0xe')]){if(_0x39e33f['error'][_0xc117('0xf')]===0x1f4){logger['error'](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x451447(_0x39e33f[_0xc117('0xe')]['message']);}logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x56c9bd(_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);}else{logger[_0xc117('0xa')](_0xc117('0x10'),_0x48efbb,_0xc117('0xb'));_0x56c9bd(_0x39e33f['result']['message']);}})[_0xc117('0x12')](function(_0x241ee7){logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x241ee7);_0x451447(_0x241ee7);});});} \ No newline at end of file +var _0x48ac=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis'];(function(_0x43cd22,_0xee20e){var _0x427d93=function(_0x1d20f6){while(--_0x1d20f6){_0x43cd22['push'](_0x43cd22['shift']());}};_0x427d93(++_0xee20e);}(_0x48ac,0xe0));var _0xc48a=function(_0x463127,_0x444e21){_0x463127=_0x463127-0x0;var _0x52ba18=_0x48ac[_0x463127];return _0x52ba18;};'use strict';var _=require('lodash');var util=require(_0xc48a('0x0'));var moment=require('moment');var BPromise=require(_0xc48a('0x1'));var rs=require(_0xc48a('0x2'));var fs=require('fs');var Redis=require(_0xc48a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc48a('0x4'));var logger=require(_0xc48a('0x5'))(_0xc48a('0x6'));var config=require(_0xc48a('0x7'));var jayson=require(_0xc48a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5df462,_0x5cffd4,_0x1e1e1a){return new BPromise(function(_0xf0c31b,_0x2c3285){return client['request'](_0x5df462,_0x1e1e1a)[_0xc48a('0x9')](function(_0x43461a){logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,_0xc48a('0xc'));logger[_0xc48a('0xd')](_0xc48a('0xe'),_0x5cffd4,_0xc48a('0xc'),JSON[_0xc48a('0xf')](_0x43461a));if(_0x43461a[_0xc48a('0x10')]){if(_0x43461a[_0xc48a('0x10')]['code']===0x1f4){logger[_0xc48a('0x10')](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')]['message']);return _0x2c3285(_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);}logger['error'](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);return _0xf0c31b(_0x43461a['error'][_0xc48a('0x11')]);}else{logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,'request\x20sent');_0xf0c31b(_0x43461a[_0xc48a('0x12')][_0xc48a('0x11')]);}})['catch'](function(_0x5c319b){logger[_0xc48a('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x5cffd4,_0x5c319b);_0x2c3285(_0x5c319b);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 3705476..520fd5f 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 _0x3472=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage','root','originalname','replace','format','basename','now','extname','post','single','file','put','/:id','update','delete','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3472,0x15d));var _0x2347=function(_0x21cb50,_0x3a5e8a){_0x21cb50=_0x21cb50-0x0;var _0x36ecca=_0x3472[_0x21cb50];return _0x36ecca;};'use strict';var multer=require(_0x2347('0x0'));var util=require(_0x2347('0x1'));var path=require(_0x2347('0x2'));var timeout=require(_0x2347('0x3'));var express=require(_0x2347('0x4'));var router=express[_0x2347('0x5')]();var auth=require(_0x2347('0x6'));var interaction=require(_0x2347('0x7'));var config=require(_0x2347('0x8'));var controller=require(_0x2347('0x9'));router[_0x2347('0xa')]('/',auth[_0x2347('0xb')](),controller[_0x2347('0xc')]);router[_0x2347('0xa')]('/:id',auth[_0x2347('0xb')](),controller[_0x2347('0xd')]);router[_0x2347('0xa')](_0x2347('0xe'),auth[_0x2347('0xb')](),controller[_0x2347('0xf')]);var upload=multer({'storage':multer[_0x2347('0x10')]({'destination':function(_0x445172,_0x3d680f,_0x2e8c3d){_0x2e8c3d(null,path['join'](config[_0x2347('0x11')],'server/files/sounds/original/'));},'filename':function(_0x4ced93,_0x52b609,_0x12f7fb){_0x52b609[_0x2347('0x12')]=_0x52b609[_0x2347('0x12')][_0x2347('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x12f7fb(null,util[_0x2347('0x14')]('%s-%s%s',path[_0x2347('0x15')](_0x52b609[_0x2347('0x12')],path['extname'](_0x52b609[_0x2347('0x12')])),Date[_0x2347('0x16')](),path[_0x2347('0x17')](_0x52b609['originalname'])));}})});router[_0x2347('0x18')]('/',upload[_0x2347('0x19')](_0x2347('0x1a')),controller['create']);router[_0x2347('0x1b')](_0x2347('0x1c'),auth[_0x2347('0xb')](),controller[_0x2347('0x1d')]);router['delete'](_0x2347('0x1c'),auth['isAuthenticated'](),controller[_0x2347('0x1e')]);module[_0x2347('0x1f')]=router; \ No newline at end of file +var _0x7247=['./sound.controller','index','get','isAuthenticated','show','/:id/download','diskStorage','join','originalname','replace','format','%s-%s%s','extname','now','post','create','put','/:id','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x101116,_0xe71b75){var _0x25d117=function(_0x37b252){while(--_0x37b252){_0x101116['push'](_0x101116['shift']());}};_0x25d117(++_0xe71b75);}(_0x7247,0x7f));var _0x7724=function(_0x4c2537,_0x20afdf){_0x4c2537=_0x4c2537-0x0;var _0x94fb5c=_0x7247[_0x4c2537];return _0x94fb5c;};'use strict';var multer=require(_0x7724('0x0'));var util=require(_0x7724('0x1'));var path=require(_0x7724('0x2'));var timeout=require('connect-timeout');var express=require(_0x7724('0x3'));var router=express[_0x7724('0x4')]();var auth=require(_0x7724('0x5'));var interaction=require(_0x7724('0x6'));var config=require(_0x7724('0x7'));var controller=require(_0x7724('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7724('0x9')]);router[_0x7724('0xa')]('/:id',auth[_0x7724('0xb')](),controller[_0x7724('0xc')]);router['get'](_0x7724('0xd'),auth[_0x7724('0xb')](),controller['download']);var upload=multer({'storage':multer[_0x7724('0xe')]({'destination':function(_0x4a97a1,_0x3fb643,_0x2c3838){_0x2c3838(null,path[_0x7724('0xf')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x31b878,_0x2c5a97,_0x2c6618){_0x2c5a97[_0x7724('0x10')]=_0x2c5a97[_0x7724('0x10')][_0x7724('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2c6618(null,util[_0x7724('0x12')](_0x7724('0x13'),path['basename'](_0x2c5a97[_0x7724('0x10')],path[_0x7724('0x14')](_0x2c5a97[_0x7724('0x10')])),Date[_0x7724('0x15')](),path[_0x7724('0x14')](_0x2c5a97[_0x7724('0x10')])));}})});router[_0x7724('0x16')]('/',upload['single']('file'),controller[_0x7724('0x17')]);router[_0x7724('0x18')]('/:id',auth[_0x7724('0xb')](),controller['update']);router['delete'](_0x7724('0x19'),auth[_0x7724('0xb')](),controller['delete']);module[_0x7724('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index d140842..a1f629d 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 _0x411d=['INTEGER','sequelize','exports','STRING','name','FLOAT','BIGINT'];(function(_0x4e17eb,_0x59cd5a){var _0x1d7f0a=function(_0xed3cd){while(--_0xed3cd){_0x4e17eb['push'](_0x4e17eb['shift']());}};_0x1d7f0a(++_0x59cd5a);}(_0x411d,0xb7));var _0xd411=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x411d[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xd411('0x0'));module[_0xd411('0x1')]={'name':{'type':Sequelize[_0xd411('0x2')],'unique':_0xd411('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd411('0x2')]},'display_name':{'type':Sequelize[_0xd411('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xd411('0x2')]},'original_format':{'type':Sequelize[_0xd411('0x2')]},'original_duration':{'type':Sequelize[_0xd411('0x4')]},'original_sampleCount':{'type':Sequelize[_0xd411('0x5')]},'original_channelCount':{'type':Sequelize[_0xd411('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xd411('0x6')]},'converted_format':{'type':Sequelize[_0xd411('0x2')]},'converted_duration':{'type':Sequelize[_0xd411('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xd411('0x5')]},'converted_channelCount':{'type':Sequelize[_0xd411('0x6')]},'converted_bitRate':{'type':Sequelize[_0xd411('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe77c=['STRING','BIGINT','INTEGER','sequelize'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0xe77c,0x1ef));var _0xce77=function(_0x47e6b5,_0x3f4de4){_0x47e6b5=_0x47e6b5-0x0;var _0x536cee=_0xe77c[_0x47e6b5];return _0x536cee;};'use strict';var Sequelize=require(_0xce77('0x0'));module['exports']={'name':{'type':Sequelize[_0xce77('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xce77('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xce77('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xce77('0x2')]},'original_channelCount':{'type':Sequelize[_0xce77('0x3')]},'original_bitRate':{'type':Sequelize[_0xce77('0x2')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xce77('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xce77('0x2')]},'converted_channelCount':{'type':Sequelize[_0xce77('0x3')]},'converted_bitRate':{'type':Sequelize[_0xce77('0x2')]},'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 65523fb..6ce3434 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 _0x6d38=['original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','server/files/sounds/original','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','../../config/license/hardware','ioredis','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','Sounds','UserProfileResource','stack','name','send','index','Sound','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','duration'];(function(_0x4f1c49,_0x12b1e7){var _0x2a467a=function(_0x558a8b){while(--_0x558a8b){_0x4f1c49['push'](_0x4f1c49['shift']());}};_0x2a467a(++_0x12b1e7);}(_0x6d38,0x1ef));var _0x86d3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6d38[_0x5f0089];return _0x193892;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x86d3('0x0'));var rimraf=require(_0x86d3('0x1'));var zipdir=require(_0x86d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86d3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x86d3('0x4'));var util=require(_0x86d3('0x5'));var path=require(_0x86d3('0x6'));var sox=require('sox');var csv=require(_0x86d3('0x7'));var ejs=require(_0x86d3('0x8'));var fs=require('fs');var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0x7'));var querystring=require(_0x86d3('0xc'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x86d3('0xd'));var Redis=require(_0x86d3('0xe'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x86d3('0xf'));var utils=require(_0x86d3('0x10'));var config=require('../../config/environment');var db=require(_0x86d3('0x11'))['db'];function respondWithStatusCode(_0x5e9606,_0x1a98e8){_0x1a98e8=_0x1a98e8||0xcc;return function(_0x7d4d2e){if(_0x7d4d2e){return _0x5e9606[_0x86d3('0x12')](_0x1a98e8);}return _0x5e9606[_0x86d3('0x13')](_0x1a98e8)[_0x86d3('0x14')]();};}function respondWithResult(_0x1b8d0a,_0xbbca86){_0xbbca86=_0xbbca86||0xc8;return function(_0x12ef4a){if(_0x12ef4a){return _0x1b8d0a['status'](_0xbbca86)[_0x86d3('0x15')](_0x12ef4a);}};}function respondWithFilteredResult(_0x1f35cf,_0x356e7d){return function(_0x207f6f){if(_0x207f6f){var _0x1ea535=_0x207f6f['count'],_0x34fb3b=_0x356e7d[_0x86d3('0x16')],_0x1ff008=_0x356e7d[_0x86d3('0x16')]+_0x356e7d[_0x86d3('0x17')],_0x44436d;if(_0x1ff008>=_0x1ea535){_0x1ff008=_0x1ea535;_0x44436d=0xc8;}else{_0x44436d=0xce;}_0x1f35cf[_0x86d3('0x13')](_0x44436d);return _0x1f35cf[_0x86d3('0x18')](_0x86d3('0x19'),_0x34fb3b+'-'+_0x1ff008+'/'+_0x1ea535)[_0x86d3('0x15')](_0x207f6f);}return null;};}function patchUpdates(_0x32dee7){return function(_0x9b76f2){try{jsonpatch['apply'](_0x9b76f2,_0x32dee7,!![]);}catch(_0x191ba5){return BPromise['reject'](_0x191ba5);}return _0x9b76f2[_0x86d3('0x1a')]();};}function saveUpdates(_0x5c4d55,_0x52293e){return function(_0x41486a){if(_0x41486a){return _0x41486a[_0x86d3('0x1b')](_0x5c4d55)[_0x86d3('0x1c')](function(_0x1720ae){return _0x1720ae;});}return null;};}function removeEntity(_0x5654ab,_0x2901de){return function(_0x55e1c3){if(_0x55e1c3){return _0x55e1c3[_0x86d3('0x1d')]()[_0x86d3('0x1c')](function(){var _0x1ce849=_0x55e1c3['get']({'plain':!![]});var _0x39d819=_0x86d3('0x1e');return db[_0x86d3('0x1f')]['destroy']({'where':{'type':_0x39d819,'resourceId':_0x1ce849['id']}})['then'](function(){return _0x55e1c3;});})[_0x86d3('0x1c')](function(){_0x5654ab['status'](0xcc)[_0x86d3('0x14')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x20')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x21')];}_0x481077[_0x86d3('0x13')](_0x3359e4)[_0x86d3('0x22')](_0x611764);};}exports[_0x86d3('0x23')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=db[_0x86d3('0x24')][_0x86d3('0x25')];_0x35d708[_0x86d3('0x26')]=_[_0x86d3('0x27')](_0x44dacf);_0x35d708['query']=_[_0x86d3('0x27')](_0x11a6fd[_0x86d3('0x28')]);_0x35d708[_0x86d3('0x29')]=_[_0x86d3('0x2a')](_0x35d708[_0x86d3('0x26')],_0x35d708[_0x86d3('0x28')]);_0x1f203e['attributes']=_[_0x86d3('0x2a')](_0x35d708['model'],qs['fields'](_0x11a6fd[_0x86d3('0x28')][_0x86d3('0x2b')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e['attributes'][_0x86d3('0x2d')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708['model'];if(!_0x11a6fd[_0x86d3('0x28')][_0x86d3('0x2e')](_0x86d3('0x2f'))){_0x1f203e[_0x86d3('0x17')]=qs[_0x86d3('0x17')](_0x11a6fd[_0x86d3('0x28')][_0x86d3('0x17')]);_0x1f203e[_0x86d3('0x16')]=qs['offset'](_0x11a6fd['query']['offset']);}_0x1f203e[_0x86d3('0x30')]=qs['sort'](_0x11a6fd[_0x86d3('0x28')]['sort']);_0x1f203e[_0x86d3('0x31')]=qs[_0x86d3('0x29')](_[_0x86d3('0x32')](_0x11a6fd[_0x86d3('0x28')],_0x35d708[_0x86d3('0x29')]));if(_0x11a6fd[_0x86d3('0x28')][_0x86d3('0x33')]){_0x1f203e['where']=_[_0x86d3('0x34')](_0x1f203e[_0x86d3('0x31')],{'$or':_['map'](_0x44dacf,function(_0x178fc6){if(_0x178fc6[_0x86d3('0x35')][_0x86d3('0x36')]!==_0x86d3('0x37')){var _0x53f549={};_0x53f549[_0x178fc6[_0x86d3('0x38')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x28')][_0x86d3('0x33')]+'%'};return _0x53f549;}})});}_0x1f203e=_['merge']({},_0x1f203e,_0x11a6fd[_0x86d3('0x39')]);var _0x15987d={'where':_0x1f203e[_0x86d3('0x31')]};return db[_0x86d3('0x24')][_0x86d3('0x3a')](_0x15987d)[_0x86d3('0x1c')](function(_0x3666fc){_0x303f13[_0x86d3('0x3a')]=_0x3666fc;if(_0x11a6fd['query'][_0x86d3('0x3b')]){_0x1f203e[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x24')][_0x86d3('0x3d')](_0x1f203e);})['then'](function(_0x1231ee){_0x303f13[_0x86d3('0x3e')]=_0x1231ee;return _0x303f13;})[_0x86d3('0x1c')](respondWithFilteredResult(_0x14c9ff,_0x1f203e))[_0x86d3('0x3f')](handleError(_0x14c9ff,null));};exports['show']=function(_0x587747,_0x10978b){var _0x4f422b={'raw':!![],'where':{'id':_0x587747[_0x86d3('0x40')]['id']}},_0x53545a={};_0x53545a[_0x86d3('0x26')]=_[_0x86d3('0x27')](db[_0x86d3('0x24')][_0x86d3('0x25')]);_0x53545a['query']=_[_0x86d3('0x27')](_0x587747[_0x86d3('0x28')]);_0x53545a[_0x86d3('0x29')]=_['intersection'](_0x53545a[_0x86d3('0x26')],_0x53545a[_0x86d3('0x28')]);_0x4f422b['attributes']=_[_0x86d3('0x2a')](_0x53545a[_0x86d3('0x26')],qs['fields'](_0x587747['query']['fields']));_0x4f422b[_0x86d3('0x2c')]=_0x4f422b[_0x86d3('0x2c')][_0x86d3('0x2d')]?_0x4f422b[_0x86d3('0x2c')]:_0x53545a[_0x86d3('0x26')];if(_0x587747[_0x86d3('0x28')]['includeAll']){_0x4f422b[_0x86d3('0x3c')]=[{'all':!![]}];}_0x4f422b=_[_0x86d3('0x34')]({},_0x4f422b,_0x587747['options']);return db[_0x86d3('0x24')][_0x86d3('0x41')](_0x4f422b)[_0x86d3('0x1c')](handleEntityNotFound(_0x10978b,null))[_0x86d3('0x1c')](respondWithResult(_0x10978b,null))[_0x86d3('0x3f')](handleError(_0x10978b,null));};exports[_0x86d3('0x42')]=function(_0x4e2cf6,_0x318e1a,_0x474310){return db['Sound'][_0x86d3('0x41')]({'where':{'id':_0x4e2cf6[_0x86d3('0x40')]['id']},'attributes':[_0x86d3('0x21'),_0x86d3('0x43'),_0x86d3('0x44')],'raw':!![]})['then'](handleEntityNotFound(_0x318e1a,null))[_0x86d3('0x1c')](function(_0x3e6620){if(_0x3e6620){if(!fs[_0x86d3('0x45')](path[_0x86d3('0x46')](config[_0x86d3('0x47')],_0x86d3('0x48'),_0x3e6620[_0x86d3('0x43')]+'.'+_0x3e6620[_0x86d3('0x44')]))){throw new db[(_0x86d3('0x49'))][(_0x86d3('0x4a'))](_0x86d3('0x4b'));}return _0x318e1a[_0x86d3('0x42')](path['join'](config[_0x86d3('0x47')],_0x86d3('0x48'),util['format'](_0x86d3('0x4c'),_0x3e6620[_0x86d3('0x43')],_0x3e6620[_0x86d3('0x44')])),util[_0x86d3('0x4d')](_0x86d3('0x4c'),_0x3e6620[_0x86d3('0x21')],_0x3e6620['converted_format']));}return null;})['catch'](handleError(_0x318e1a,null));};exports['create']=function(_0x5bedc6,_0x159253,_0x3636ae){var _0x2ca2a4={'name':path[_0x86d3('0x4e')](_0x5bedc6[_0x86d3('0x4f')][_0x86d3('0x50')],path[_0x86d3('0x51')](_0x5bedc6['file'][_0x86d3('0x50')])),'save_name':path[_0x86d3('0x4e')](_0x5bedc6[_0x86d3('0x4f')][_0x86d3('0x52')],path[_0x86d3('0x51')](_0x5bedc6[_0x86d3('0x4f')][_0x86d3('0x52')])),'original_format':path['extname'](_0x5bedc6[_0x86d3('0x4f')]['originalname'])[_0x86d3('0x53')](0x1),'converted_format':_0x86d3('0x54')};var _0xd072f2=path[_0x86d3('0x46')](config[_0x86d3('0x47')],'server/files/sounds/original',_0x5bedc6[_0x86d3('0x4f')][_0x86d3('0x52')]);var _0x1908ff=path['join'](config['root'],'server/files/sounds/converted',util[_0x86d3('0x4d')]('%s.%s',path[_0x86d3('0x4e')](_0x5bedc6[_0x86d3('0x4f')][_0x86d3('0x52')],path[_0x86d3('0x51')](_0x5bedc6['file']['filename'])),_0x2ca2a4['converted_format']));logger[_0x86d3('0x55')](_0x86d3('0x56'),_0xd072f2);logger['info'](_0x86d3('0x57'),_0x1908ff);try{fs[_0x86d3('0x58')](_0xd072f2,parseInt(_0x86d3('0x59'),0x8));var _0x4584e5=sox[_0x86d3('0x5a')](_0xd072f2,_0x1908ff,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4584e5['on'](_0x86d3('0x5b'),function(_0x1c134b){fs[_0x86d3('0x5c')](_0xd072f2);_0x159253[_0x86d3('0x13')](0x1f4)['send'](_0x1c134b);});_0x4584e5['on'](_0x86d3('0x5d'),function(_0x41fad7){_0x2ca2a4['original_duration']=isNaN(_0x41fad7[_0x86d3('0x5e')])?null:_0x41fad7[_0x86d3('0x5e')]*0x3e8;_0x2ca2a4[_0x86d3('0x5f')]=isNaN(_0x41fad7[_0x86d3('0x60')])?null:_0x41fad7[_0x86d3('0x60')];_0x2ca2a4[_0x86d3('0x61')]=isNaN(_0x41fad7[_0x86d3('0x62')])?null:_0x41fad7['channelCount'];_0x2ca2a4['original_bitRate']=isNaN(_0x41fad7[_0x86d3('0x63')])?null:_0x41fad7['bitRate'];_0x2ca2a4['original_sampleRate']=isNaN(_0x41fad7['sampleRate'])?null:_0x41fad7[_0x86d3('0x64')];});_0x4584e5['on']('dest',function(_0x254ac3){_0x2ca2a4['converted_duration']=isNaN(_0x254ac3[_0x86d3('0x5e')])?null:_0x254ac3[_0x86d3('0x5e')]*0x3e8;_0x2ca2a4[_0x86d3('0x65')]=isNaN(_0x254ac3['sampleCount'])?null:_0x254ac3['sampleCount'];_0x2ca2a4[_0x86d3('0x66')]=isNaN(_0x254ac3[_0x86d3('0x62')])?null:_0x254ac3[_0x86d3('0x62')];_0x2ca2a4[_0x86d3('0x67')]=isNaN(_0x254ac3[_0x86d3('0x63')])?null:_0x254ac3[_0x86d3('0x63')];_0x2ca2a4[_0x86d3('0x68')]=isNaN(_0x254ac3[_0x86d3('0x64')])?null:_0x254ac3[_0x86d3('0x64')];});_0x4584e5['on'](_0x86d3('0x14'),function(){fs[_0x86d3('0x58')](_0x1908ff,parseInt(_0x86d3('0x59'),0x8));return db[_0x86d3('0x24')][_0x86d3('0x69')](_0x2ca2a4)[_0x86d3('0x1c')](function(_0x5e1835){var _0x1cd730={'role':_0x5bedc6[_0x86d3('0x6a')]['role'],'userProfileId':_0x5bedc6[_0x86d3('0x6a')][_0x86d3('0x6b')]};if(!_0x1cd730)throw new Error(_0x86d3('0x6c'));if(_0x1cd730['role']===_0x86d3('0x6d')){var _0x307baf=_0x5e1835[_0x86d3('0x6e')]({'plain':!![]});return db[_0x86d3('0x6f')]['find']({'where':{'name':_0x86d3('0x1e'),'userProfileId':_0x1cd730['userProfileId']},'raw':!![]})[_0x86d3('0x1c')](function(_0x42bb6f){if(_0x42bb6f&&_0x42bb6f[_0x86d3('0x70')]===0x0){return db[_0x86d3('0x1f')][_0x86d3('0x69')]({'name':_0x307baf['name'],'resourceId':_0x307baf['id'],'type':_0x42bb6f[_0x86d3('0x21')],'sectionId':_0x42bb6f['id']},{})['then'](function(){return _0x5e1835;});}else{return _0x5e1835;}})[_0x86d3('0x3f')](function(_0x11a01a){logger['error'](_0x86d3('0x71'),_0x11a01a);throw _0x11a01a;});}return _0x5e1835;})[_0x86d3('0x1c')](respondWithResult(_0x159253,null))[_0x86d3('0x3f')](handleError(_0x159253,null));});_0x4584e5[_0x86d3('0x72')]();}catch(_0x308fed){_0x159253[_0x86d3('0x13')](0x1f4)[_0x86d3('0x22')](_0x308fed);}};exports['update']=function(_0x19f9e1,_0x1a1a3e,_0x279951){return db[_0x86d3('0x24')][_0x86d3('0x41')]({'where':{'id':_0x19f9e1['params']['id']}})[_0x86d3('0x1c')](handleEntityNotFound(_0x1a1a3e,null))[_0x86d3('0x1c')](saveUpdates(_['pick'](_0x19f9e1[_0x86d3('0x6a')],[_0x86d3('0x21'),_0x86d3('0x73')]),null))[_0x86d3('0x1c')](respondWithResult(_0x1a1a3e,null))[_0x86d3('0x3f')](handleError(_0x1a1a3e,null));};exports[_0x86d3('0x74')]=function(_0x1bf5ba,_0x447ae6,_0x2be56e){return db[_0x86d3('0x24')][_0x86d3('0x41')]({'where':{'id':_0x1bf5ba[_0x86d3('0x40')]['id']}})[_0x86d3('0x1c')](function(_0xab8a80){if(_0xab8a80){return _0xab8a80['destroy']();}})[_0x86d3('0x1c')](function(_0x3fa37c){var _0xc14014=path[_0x86d3('0x46')](config['root'],_0x86d3('0x75'),util[_0x86d3('0x4d')](_0x86d3('0x4c'),_0x3fa37c[_0x86d3('0x43')],_0x3fa37c['original_format']));var _0x507e32=path[_0x86d3('0x46')](config['root'],_0x86d3('0x48'),util['format']('%s.%s',_0x3fa37c[_0x86d3('0x43')],_0x3fa37c[_0x86d3('0x44')]));fs[_0x86d3('0x5c')](_0xc14014);fs[_0x86d3('0x5c')](_0x507e32);return _0x3fa37c;})[_0x86d3('0x1c')](function(_0x5841d6){if(_0x5841d6){return _0x447ae6[_0x86d3('0x13')](0xcc)[_0x86d3('0x14')]();}})['then'](handleEntityNotFound(_0x447ae6,null))[_0x86d3('0x3f')](handleError(_0x447ae6,null));}; \ No newline at end of file +var _0xd117=['dest','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','then','get','Sounds','UserProfileResource','destroy','error','stack','name','send','rawAttributes','keys','query','intersection','model','attributes','hasOwnProperty','filters','pick','filter','where','merge','map','type','VIRTUAL','field','Sound','include','findAll','catch','params','fields','length','includeAll','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','extname','originalname','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate'];(function(_0x18d431,_0x1412f5){var _0x265a6b=function(_0x33db86){while(--_0x33db86){_0x18d431['push'](_0x18d431['shift']());}};_0x265a6b(++_0x1412f5);}(_0xd117,0x182));var _0x7d11=function(_0x32a884,_0x183853){_0x32a884=_0x32a884-0x0;var _0x242f9b=_0xd117[_0x32a884];return _0x242f9b;};'use strict';var pdf=require(_0x7d11('0x0'));var emlformat=require(_0x7d11('0x1'));var rimraf=require(_0x7d11('0x2'));var zipdir=require(_0x7d11('0x3'));var jsonpatch=require(_0x7d11('0x4'));var rp=require(_0x7d11('0x5'));var moment=require(_0x7d11('0x6'));var BPromise=require(_0x7d11('0x7'));var Mustache=require(_0x7d11('0x8'));var util=require(_0x7d11('0x9'));var path=require(_0x7d11('0xa'));var sox=require(_0x7d11('0xb'));var csv=require(_0x7d11('0xc'));var ejs=require(_0x7d11('0xd'));var fs=require('fs');var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xc'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var authService=require(_0x7d11('0x13'));var hardwareService=require(_0x7d11('0x14'));var Redis=require('ioredis');var qs=require(_0x7d11('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7d11('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc52a95,_0x48f576){_0x48f576=_0x48f576||0xcc;return function(_0x4767d5){if(_0x4767d5){return _0xc52a95[_0x7d11('0x17')](_0x48f576);}return _0xc52a95['status'](_0x48f576)[_0x7d11('0x18')]();};}function respondWithResult(_0x20f519,_0x4cda5d){_0x4cda5d=_0x4cda5d||0xc8;return function(_0x324de5){if(_0x324de5){return _0x20f519[_0x7d11('0x19')](_0x4cda5d)[_0x7d11('0x1a')](_0x324de5);}};}function respondWithFilteredResult(_0x2978da,_0x417e2d){return function(_0xeae744){if(_0xeae744){var _0x2a269e=_0xeae744[_0x7d11('0x1b')],_0xb1669e=_0x417e2d[_0x7d11('0x1c')],_0x4aa795=_0x417e2d[_0x7d11('0x1c')]+_0x417e2d[_0x7d11('0x1d')],_0x1db0df;if(_0x4aa795>=_0x2a269e){_0x4aa795=_0x2a269e;_0x1db0df=0xc8;}else{_0x1db0df=0xce;}_0x2978da['status'](_0x1db0df);return _0x2978da[_0x7d11('0x1e')](_0x7d11('0x1f'),_0xb1669e+'-'+_0x4aa795+'/'+_0x2a269e)['json'](_0xeae744);}return null;};}function patchUpdates(_0x5459df){return function(_0x2ca3a2){try{jsonpatch['apply'](_0x2ca3a2,_0x5459df,!![]);}catch(_0x1f9990){return BPromise['reject'](_0x1f9990);}return _0x2ca3a2[_0x7d11('0x20')]();};}function saveUpdates(_0x17e539,_0x328f8e){return function(_0x46f662){if(_0x46f662){return _0x46f662[_0x7d11('0x21')](_0x17e539)[_0x7d11('0x22')](function(_0x4297f8){return _0x4297f8;});}return null;};}function removeEntity(_0x3d2574,_0x5680cb){return function(_0x441917){if(_0x441917){return _0x441917['destroy']()['then'](function(){var _0x5c3898=_0x441917[_0x7d11('0x23')]({'plain':!![]});var _0x3545dc=_0x7d11('0x24');return db[_0x7d11('0x25')][_0x7d11('0x26')]({'where':{'type':_0x3545dc,'resourceId':_0x5c3898['id']}})[_0x7d11('0x22')](function(){return _0x441917;});})[_0x7d11('0x22')](function(){_0x3d2574[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x27')](_0x180e1e[_0x7d11('0x28')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x29')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x2a')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=db['Sound'][_0x7d11('0x2b')];_0x38f1be['model']=_[_0x7d11('0x2c')](_0x1a7745);_0x38f1be[_0x7d11('0x2d')]=_[_0x7d11('0x2c')](_0x601650['query']);_0x38f1be['filters']=_[_0x7d11('0x2e')](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049[_0x7d11('0x30')]=_[_0x7d11('0x2e')](_0x38f1be[_0x7d11('0x2f')],qs['fields'](_0x601650[_0x7d11('0x2d')]['fields']));_0x18c049['attributes']=_0x18c049[_0x7d11('0x30')]['length']?_0x18c049[_0x7d11('0x30')]:_0x38f1be[_0x7d11('0x2f')];if(!_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]('nolimit')){_0x18c049[_0x7d11('0x1d')]=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1c')]=qs[_0x7d11('0x1c')](_0x601650['query'][_0x7d11('0x1c')]);}_0x18c049['order']=qs['sort'](_0x601650[_0x7d11('0x2d')]['sort']);_0x18c049['where']=qs[_0x7d11('0x32')](_[_0x7d11('0x33')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x32')]));if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x34')]){_0x18c049[_0x7d11('0x35')]=_[_0x7d11('0x36')](_0x18c049[_0x7d11('0x35')],{'$or':_[_0x7d11('0x37')](_0x1a7745,function(_0x1a9f18){if(_0x1a9f18[_0x7d11('0x38')]['key']!==_0x7d11('0x39')){var _0x49d16b={};_0x49d16b[_0x1a9f18[_0x7d11('0x3a')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x34')]+'%'};return _0x49d16b;}})});}_0x18c049=_[_0x7d11('0x36')]({},_0x18c049,_0x601650['options']);var _0xd36cd3={'where':_0x18c049[_0x7d11('0x35')]};return db[_0x7d11('0x3b')][_0x7d11('0x1b')](_0xd36cd3)['then'](function(_0x22730e){_0x4c7d6a['count']=_0x22730e;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049[_0x7d11('0x3c')]=[{'all':!![]}];}return db[_0x7d11('0x3b')][_0x7d11('0x3d')](_0x18c049);})[_0x7d11('0x22')](function(_0x52c28b){_0x4c7d6a['rows']=_0x52c28b;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x3e')](handleError(_0x35a789,null));};exports['show']=function(_0x1caef9,_0x28c4ce){var _0x3563e7={'raw':!![],'where':{'id':_0x1caef9[_0x7d11('0x3f')]['id']}},_0x77e1e8={};_0x77e1e8[_0x7d11('0x2f')]=_['keys'](db[_0x7d11('0x3b')]['rawAttributes']);_0x77e1e8[_0x7d11('0x2d')]=_[_0x7d11('0x2c')](_0x1caef9[_0x7d11('0x2d')]);_0x77e1e8[_0x7d11('0x32')]=_[_0x7d11('0x2e')](_0x77e1e8[_0x7d11('0x2f')],_0x77e1e8['query']);_0x3563e7['attributes']=_['intersection'](_0x77e1e8[_0x7d11('0x2f')],qs[_0x7d11('0x40')](_0x1caef9[_0x7d11('0x2d')][_0x7d11('0x40')]));_0x3563e7[_0x7d11('0x30')]=_0x3563e7['attributes'][_0x7d11('0x41')]?_0x3563e7[_0x7d11('0x30')]:_0x77e1e8['model'];if(_0x1caef9[_0x7d11('0x2d')][_0x7d11('0x42')]){_0x3563e7[_0x7d11('0x3c')]=[{'all':!![]}];}_0x3563e7=_['merge']({},_0x3563e7,_0x1caef9[_0x7d11('0x43')]);return db[_0x7d11('0x3b')][_0x7d11('0x44')](_0x3563e7)['then'](handleEntityNotFound(_0x28c4ce,null))[_0x7d11('0x22')](respondWithResult(_0x28c4ce,null))['catch'](handleError(_0x28c4ce,null));};exports[_0x7d11('0x45')]=function(_0x69dbd1,_0x3f33d9,_0xbe357){return db[_0x7d11('0x3b')][_0x7d11('0x44')]({'where':{'id':_0x69dbd1[_0x7d11('0x3f')]['id']},'attributes':[_0x7d11('0x29'),_0x7d11('0x46'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x3f33d9,null))['then'](function(_0x10c0e9){if(_0x10c0e9){if(!fs[_0x7d11('0x47')](path[_0x7d11('0x48')](config[_0x7d11('0x49')],_0x7d11('0x4a'),_0x10c0e9[_0x7d11('0x46')]+'.'+_0x10c0e9[_0x7d11('0x4b')]))){throw new db[(_0x7d11('0x4c'))][(_0x7d11('0x4d'))](_0x7d11('0x4e'));}return _0x3f33d9[_0x7d11('0x45')](path[_0x7d11('0x48')](config['root'],_0x7d11('0x4a'),util[_0x7d11('0x4f')](_0x7d11('0x50'),_0x10c0e9['save_name'],_0x10c0e9['converted_format'])),util[_0x7d11('0x4f')](_0x7d11('0x50'),_0x10c0e9[_0x7d11('0x29')],_0x10c0e9['converted_format']));}return null;})['catch'](handleError(_0x3f33d9,null));};exports[_0x7d11('0x51')]=function(_0x36af2b,_0x5e6234,_0x3a2102){var _0x29dfad={'name':path[_0x7d11('0x52')](_0x36af2b[_0x7d11('0x53')]['originalname'],path[_0x7d11('0x54')](_0x36af2b[_0x7d11('0x53')][_0x7d11('0x55')])),'save_name':path['basename'](_0x36af2b['file'][_0x7d11('0x56')],path[_0x7d11('0x54')](_0x36af2b[_0x7d11('0x53')][_0x7d11('0x56')])),'original_format':path[_0x7d11('0x54')](_0x36af2b['file'][_0x7d11('0x55')])[_0x7d11('0x57')](0x1),'converted_format':_0x7d11('0x58')};var _0x932878=path['join'](config['root'],_0x7d11('0x59'),_0x36af2b[_0x7d11('0x53')][_0x7d11('0x56')]);var _0x471367=path[_0x7d11('0x48')](config[_0x7d11('0x49')],_0x7d11('0x4a'),util[_0x7d11('0x4f')](_0x7d11('0x50'),path[_0x7d11('0x52')](_0x36af2b['file']['filename'],path['extname'](_0x36af2b[_0x7d11('0x53')][_0x7d11('0x56')])),_0x29dfad[_0x7d11('0x4b')]));logger['info'](_0x7d11('0x5a'),_0x932878);logger[_0x7d11('0x5b')](_0x7d11('0x5c'),_0x471367);try{fs[_0x7d11('0x5d')](_0x932878,parseInt(_0x7d11('0x5e'),0x8));var _0x178a3a=sox['transcode'](_0x932878,_0x471367,{'sampleRate':0x1f40,'format':_0x7d11('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x178a3a['on'](_0x7d11('0x27'),function(_0x3c01d6){fs['unlinkSync'](_0x932878);_0x5e6234['status'](0x1f4)['send'](_0x3c01d6);});_0x178a3a['on']('src',function(_0x3ce636){_0x29dfad['original_duration']=isNaN(_0x3ce636['duration'])?null:_0x3ce636['duration']*0x3e8;_0x29dfad[_0x7d11('0x5f')]=isNaN(_0x3ce636[_0x7d11('0x60')])?null:_0x3ce636[_0x7d11('0x60')];_0x29dfad[_0x7d11('0x61')]=isNaN(_0x3ce636[_0x7d11('0x62')])?null:_0x3ce636[_0x7d11('0x62')];_0x29dfad['original_bitRate']=isNaN(_0x3ce636[_0x7d11('0x63')])?null:_0x3ce636['bitRate'];_0x29dfad[_0x7d11('0x64')]=isNaN(_0x3ce636['sampleRate'])?null:_0x3ce636[_0x7d11('0x65')];});_0x178a3a['on'](_0x7d11('0x66'),function(_0x4ce8f2){_0x29dfad[_0x7d11('0x67')]=isNaN(_0x4ce8f2[_0x7d11('0x68')])?null:_0x4ce8f2[_0x7d11('0x68')]*0x3e8;_0x29dfad[_0x7d11('0x69')]=isNaN(_0x4ce8f2['sampleCount'])?null:_0x4ce8f2['sampleCount'];_0x29dfad[_0x7d11('0x6a')]=isNaN(_0x4ce8f2[_0x7d11('0x62')])?null:_0x4ce8f2[_0x7d11('0x62')];_0x29dfad[_0x7d11('0x6b')]=isNaN(_0x4ce8f2[_0x7d11('0x63')])?null:_0x4ce8f2['bitRate'];_0x29dfad[_0x7d11('0x6c')]=isNaN(_0x4ce8f2['sampleRate'])?null:_0x4ce8f2[_0x7d11('0x65')];});_0x178a3a['on'](_0x7d11('0x18'),function(){fs[_0x7d11('0x5d')](_0x471367,parseInt(_0x7d11('0x5e'),0x8));return db['Sound'][_0x7d11('0x51')](_0x29dfad)['then'](function(_0x2258dc){var _0x366f5e={'role':_0x36af2b[_0x7d11('0x6d')][_0x7d11('0x6e')],'userProfileId':_0x36af2b[_0x7d11('0x6d')][_0x7d11('0x6f')]};if(!_0x366f5e)throw new Error(_0x7d11('0x70'));if(_0x366f5e[_0x7d11('0x6e')]===_0x7d11('0x71')){var _0x3f8512=_0x2258dc[_0x7d11('0x23')]({'plain':!![]});return db[_0x7d11('0x72')][_0x7d11('0x44')]({'where':{'name':_0x7d11('0x24'),'userProfileId':_0x366f5e['userProfileId']},'raw':!![]})[_0x7d11('0x22')](function(_0x489121){if(_0x489121&&_0x489121[_0x7d11('0x73')]===0x0){return db['UserProfileResource'][_0x7d11('0x51')]({'name':_0x3f8512[_0x7d11('0x29')],'resourceId':_0x3f8512['id'],'type':_0x489121[_0x7d11('0x29')],'sectionId':_0x489121['id']},{})[_0x7d11('0x22')](function(){return _0x2258dc;});}else{return _0x2258dc;}})['catch'](function(_0x529db8){logger[_0x7d11('0x27')](_0x7d11('0x74'),_0x529db8);throw _0x529db8;});}return _0x2258dc;})[_0x7d11('0x22')](respondWithResult(_0x5e6234,null))['catch'](handleError(_0x5e6234,null));});_0x178a3a[_0x7d11('0x75')]();}catch(_0x3c656b){_0x5e6234[_0x7d11('0x19')](0x1f4)[_0x7d11('0x2a')](_0x3c656b);}};exports[_0x7d11('0x21')]=function(_0x241895,_0x59f63f,_0xc63022){return db['Sound'][_0x7d11('0x44')]({'where':{'id':_0x241895['params']['id']}})['then'](handleEntityNotFound(_0x59f63f,null))[_0x7d11('0x22')](saveUpdates(_[_0x7d11('0x33')](_0x241895[_0x7d11('0x6d')],[_0x7d11('0x29'),_0x7d11('0x76')]),null))[_0x7d11('0x22')](respondWithResult(_0x59f63f,null))[_0x7d11('0x3e')](handleError(_0x59f63f,null));};exports[_0x7d11('0x77')]=function(_0x109aa2,_0x1b8993,_0xee8fb0){return db['Sound'][_0x7d11('0x44')]({'where':{'id':_0x109aa2['params']['id']}})[_0x7d11('0x22')](function(_0x239901){if(_0x239901){return _0x239901[_0x7d11('0x26')]();}})[_0x7d11('0x22')](function(_0x3af18d){var _0x3a7f06=path[_0x7d11('0x48')](config['root'],'server/files/sounds/original',util[_0x7d11('0x4f')](_0x7d11('0x50'),_0x3af18d[_0x7d11('0x46')],_0x3af18d[_0x7d11('0x78')]));var _0x7edc36=path['join'](config[_0x7d11('0x49')],'server/files/sounds/converted',util[_0x7d11('0x4f')](_0x7d11('0x50'),_0x3af18d[_0x7d11('0x46')],_0x3af18d[_0x7d11('0x4b')]));fs[_0x7d11('0x79')](_0x3a7f06);fs[_0x7d11('0x79')](_0x7edc36);return _0x3af18d;})[_0x7d11('0x22')](function(_0x342ebe){if(_0x342ebe){return _0x1b8993['status'](0xcc)['end']();}})[_0x7d11('0x22')](handleEntityNotFound(_0x1b8993,null))[_0x7d11('0x3e')](handleError(_0x1b8993,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 47461ac..df1b922 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 _0xb7a2=['api','bluebird','request-promise','./sound.attributes','exports','Sound','tools_sounds','lodash','../../config/logger'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xb7a2,0x1c9));var _0x2b7a=function(_0x280430,_0x1b119a){_0x280430=_0x280430-0x0;var _0x5c8a68=_0xb7a2[_0x280430];return _0x5c8a68;};'use strict';var _=require(_0x2b7a('0x0'));var util=require('util');var logger=require(_0x2b7a('0x1'))(_0x2b7a('0x2'));var moment=require('moment');var BPromise=require(_0x2b7a('0x3'));var rp=require(_0x2b7a('0x4'));var attributes=require(_0x2b7a('0x5'));module[_0x2b7a('0x6')]=function(_0x2366db,_0x4a5ee4){return _0x2366db['define'](_0x2b7a('0x7'),attributes,{'tableName':_0x2b7a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11c1=['Sound','tools_sounds','util','../../config/logger','api','moment','bluebird','request-promise','./sound.attributes','exports','define'];(function(_0x2fd2e2,_0x4a03d3){var _0x4d9933=function(_0x19261c){while(--_0x19261c){_0x2fd2e2['push'](_0x2fd2e2['shift']());}};_0x4d9933(++_0x4a03d3);}(_0x11c1,0x1db));var _0x111c=function(_0x1e307b,_0x3d5df7){_0x1e307b=_0x1e307b-0x0;var _0x3b2798=_0x11c1[_0x1e307b];return _0x3b2798;};'use strict';var _=require('lodash');var util=require(_0x111c('0x0'));var logger=require(_0x111c('0x1'))(_0x111c('0x2'));var moment=require(_0x111c('0x3'));var BPromise=require(_0x111c('0x4'));var rp=require(_0x111c('0x5'));var attributes=require(_0x111c('0x6'));module[_0x111c('0x7')]=function(_0x1afa65,_0x59c5dc){return _0x1afa65[_0x111c('0x8')](_0x111c('0x9'),attributes,{'tableName':_0x111c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index d8624cd..55df000 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 _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x54b06d,_0x7c11b3){var _0x56c87a=function(_0x575b67){while(--_0x575b67){_0x54b06d['push'](_0x54b06d['shift']());}};_0x56c87a(++_0x7c11b3);}(_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);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x439a76,_0x15dbfa){var _0x4d48a7=function(_0x62b4a0){while(--_0x62b4a0){_0x439a76['push'](_0x439a76['shift']());}};_0x4d48a7(++_0x15dbfa);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index b22a582..78b9fc0 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 _0x4a65=['post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3a812f,_0x18deb1){var _0x404b9e=function(_0x2302a1){while(--_0x2302a1){_0x3a812f['push'](_0x3a812f['shift']());}};_0x404b9e(++_0x18deb1);}(_0x4a65,0x16f));var _0x54a6=function(_0x2ca8d2,_0x202783){_0x2ca8d2=_0x2ca8d2-0x0;var _0x565c9d=_0x4a65[_0x2ca8d2];return _0x565c9d;};'use strict';var multer=require('multer');var util=require(_0x54a6('0x0'));var path=require(_0x54a6('0x1'));var timeout=require(_0x54a6('0x2'));var express=require(_0x54a6('0x3'));var router=express[_0x54a6('0x4')]();var auth=require(_0x54a6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x54a6('0x6'));var controller=require(_0x54a6('0x7'));router[_0x54a6('0x8')]('/',auth[_0x54a6('0x9')](),controller[_0x54a6('0xa')]);router[_0x54a6('0x8')](_0x54a6('0xb'),auth[_0x54a6('0x9')](),controller[_0x54a6('0xc')]);router[_0x54a6('0xd')]('/',auth[_0x54a6('0x9')](),controller['create']);router[_0x54a6('0xe')](_0x54a6('0xb'),auth['isAuthenticated'](),controller[_0x54a6('0xf')]);router[_0x54a6('0x10')](_0x54a6('0xb'),auth[_0x54a6('0x9')](),controller[_0x54a6('0x11')]);module[_0x54a6('0x12')]=router; \ No newline at end of file +var _0xc0d6=['put','update','/:id','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','show','post','create'];(function(_0x43f74e,_0x12fd7e){var _0x1e904e=function(_0x310861){while(--_0x310861){_0x43f74e['push'](_0x43f74e['shift']());}};_0x1e904e(++_0x12fd7e);}(_0xc0d6,0x1ce));var _0x6c0d=function(_0x558c94,_0x116dda){_0x558c94=_0x558c94-0x0;var _0x535a26=_0xc0d6[_0x558c94];return _0x535a26;};'use strict';var multer=require('multer');var util=require(_0x6c0d('0x0'));var path=require('path');var timeout=require(_0x6c0d('0x1'));var express=require(_0x6c0d('0x2'));var router=express[_0x6c0d('0x3')]();var auth=require(_0x6c0d('0x4'));var interaction=require(_0x6c0d('0x5'));var config=require(_0x6c0d('0x6'));var controller=require(_0x6c0d('0x7'));router[_0x6c0d('0x8')]('/',auth[_0x6c0d('0x9')](),controller[_0x6c0d('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6c0d('0xb')]);router[_0x6c0d('0xc')]('/',auth[_0x6c0d('0x9')](),controller[_0x6c0d('0xd')]);router[_0x6c0d('0xe')]('/:id',auth[_0x6c0d('0x9')](),controller[_0x6c0d('0xf')]);router['delete'](_0x6c0d('0x10'),auth[_0x6c0d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 981f251..04cdae3 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 _0xaac7=['sequelize','exports','STRING','TEXT','out'];(function(_0x443829,_0x1b113e){var _0x13fc83=function(_0x24002b){while(--_0x24002b){_0x443829['push'](_0x443829['shift']());}};_0x13fc83(++_0x1b113e);}(_0xaac7,0x186));var _0x7aac=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xaac7[_0x2341c6];return _0x54c34d;};'use strict';var Sequelize=require(_0x7aac('0x0'));module[_0x7aac('0x1')]={'uniqueid':{'type':Sequelize[_0x7aac('0x2')]},'body':{'type':Sequelize[_0x7aac('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7aac('0x4')),'defaultValue':_0x7aac('0x4'),'allowNull':![]}}; \ No newline at end of file +var _0x25a8=['exports','STRING','out'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x25a8,0x12f));var _0x825a=function(_0x2a6251,_0x5dea6b){_0x2a6251=_0x2a6251-0x0;var _0x5a68c5=_0x25a8[_0x2a6251];return _0x5a68c5;};'use strict';var Sequelize=require('sequelize');module[_0x825a('0x0')]={'uniqueid':{'type':Sequelize[_0x825a('0x1')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x825a('0x2')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 7aaa9da..076b731 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 _0xbf00=['count','offset','limit','set','apply','save','then','destroy','error','stack','name','send','index','SquareMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','json'];(function(_0x1e117b,_0x5e0e9e){var _0x5ea37e=function(_0x118bb4){while(--_0x118bb4){_0x1e117b['push'](_0x1e117b['shift']());}};_0x5ea37e(++_0x5e0e9e);}(_0xbf00,0xbe));var _0x0bf0=function(_0x146cb9,_0x349d0b){_0x146cb9=_0x146cb9-0x0;var _0x2dbc9a=_0xbf00[_0x146cb9];return _0x2dbc9a;};'use strict';var pdf=require(_0x0bf0('0x0'));var emlformat=require(_0x0bf0('0x1'));var rimraf=require(_0x0bf0('0x2'));var zipdir=require(_0x0bf0('0x3'));var jsonpatch=require(_0x0bf0('0x4'));var rp=require(_0x0bf0('0x5'));var moment=require(_0x0bf0('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x0bf0('0x7'));var util=require(_0x0bf0('0x8'));var path=require('path');var sox=require(_0x0bf0('0x9'));var csv=require('to-csv');var ejs=require(_0x0bf0('0xa'));var fs=require('fs');var _=require(_0x0bf0('0xb'));var squel=require(_0x0bf0('0xc'));var crypto=require(_0x0bf0('0xd'));var jsforce=require(_0x0bf0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0bf0('0xf'));var querystring=require(_0x0bf0('0x10'));var Papa=require('papaparse');var authService=require(_0x0bf0('0x11'));var hardwareService=require(_0x0bf0('0x12'));var Redis=require(_0x0bf0('0x13'));var qs=require(_0x0bf0('0x14'));var logger=require('../../config/logger')(_0x0bf0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0bf0('0x16'))['db'];function respondWithStatusCode(_0x2c562d,_0x14f026){_0x14f026=_0x14f026||0xcc;return function(_0x23b96c){if(_0x23b96c){return _0x2c562d[_0x0bf0('0x17')](_0x14f026);}return _0x2c562d['status'](_0x14f026)['end']();};}function respondWithResult(_0x4cc538,_0x419e8a){_0x419e8a=_0x419e8a||0xc8;return function(_0x1460db){if(_0x1460db){return _0x4cc538[_0x0bf0('0x18')](_0x419e8a)[_0x0bf0('0x19')](_0x1460db);}};}function respondWithFilteredResult(_0x33e320,_0x3bd7cd){return function(_0x491da2){if(_0x491da2){var _0x40c3f9=_0x491da2[_0x0bf0('0x1a')],_0x30e244=_0x3bd7cd[_0x0bf0('0x1b')],_0x707087=_0x3bd7cd[_0x0bf0('0x1b')]+_0x3bd7cd[_0x0bf0('0x1c')],_0x3678d5;if(_0x707087>=_0x40c3f9){_0x707087=_0x40c3f9;_0x3678d5=0xc8;}else{_0x3678d5=0xce;}_0x33e320[_0x0bf0('0x18')](_0x3678d5);return _0x33e320[_0x0bf0('0x1d')]('Content-Range',_0x30e244+'-'+_0x707087+'/'+_0x40c3f9)[_0x0bf0('0x19')](_0x491da2);}return null;};}function patchUpdates(_0x21b744){return function(_0x2c19fe){try{jsonpatch[_0x0bf0('0x1e')](_0x2c19fe,_0x21b744,!![]);}catch(_0x2777d9){return BPromise['reject'](_0x2777d9);}return _0x2c19fe[_0x0bf0('0x1f')]();};}function saveUpdates(_0x3e68e9,_0x4de653){return function(_0x168db6){if(_0x168db6){return _0x168db6['update'](_0x3e68e9)[_0x0bf0('0x20')](function(_0xb38a1f){return _0xb38a1f;});}return null;};}function removeEntity(_0x4504fa,_0x722523){return function(_0x44f860){if(_0x44f860){return _0x44f860[_0x0bf0('0x21')]()[_0x0bf0('0x20')](function(){_0x4504fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc3f863,_0x5a2650){return function(_0x400071){if(!_0x400071){_0xc3f863[_0x0bf0('0x17')](0x194);}return _0x400071;};}function handleError(_0x318ca9,_0x338762){_0x338762=_0x338762||0x1f4;return function(_0x461ce7){logger[_0x0bf0('0x22')](_0x461ce7[_0x0bf0('0x23')]);if(_0x461ce7[_0x0bf0('0x24')]){delete _0x461ce7[_0x0bf0('0x24')];}_0x318ca9[_0x0bf0('0x18')](_0x338762)[_0x0bf0('0x25')](_0x461ce7);};}exports[_0x0bf0('0x26')]=function(_0xf9e380,_0xffa53e){var _0x566798={},_0x791deb={},_0x18fd61={'count':0x0,'rows':[]};var _0x4e0e69=db[_0x0bf0('0x27')][_0x0bf0('0x28')];_0x791deb[_0x0bf0('0x29')]=_[_0x0bf0('0x2a')](_0x4e0e69);_0x791deb['query']=_['keys'](_0xf9e380[_0x0bf0('0x2b')]);_0x791deb['filters']=_[_0x0bf0('0x2c')](_0x791deb[_0x0bf0('0x29')],_0x791deb[_0x0bf0('0x2b')]);_0x566798[_0x0bf0('0x2d')]=_[_0x0bf0('0x2c')](_0x791deb[_0x0bf0('0x29')],qs[_0x0bf0('0x2e')](_0xf9e380['query'][_0x0bf0('0x2e')]));_0x566798[_0x0bf0('0x2d')]=_0x566798[_0x0bf0('0x2d')][_0x0bf0('0x2f')]?_0x566798['attributes']:_0x791deb[_0x0bf0('0x29')];if(!_0xf9e380[_0x0bf0('0x2b')][_0x0bf0('0x30')](_0x0bf0('0x31'))){_0x566798['limit']=qs[_0x0bf0('0x1c')](_0xf9e380[_0x0bf0('0x2b')][_0x0bf0('0x1c')]);_0x566798[_0x0bf0('0x1b')]=qs[_0x0bf0('0x1b')](_0xf9e380[_0x0bf0('0x2b')]['offset']);}_0x566798[_0x0bf0('0x32')]=qs[_0x0bf0('0x33')](_0xf9e380[_0x0bf0('0x2b')][_0x0bf0('0x33')]);_0x566798[_0x0bf0('0x34')]=qs[_0x0bf0('0x35')](_[_0x0bf0('0x36')](_0xf9e380[_0x0bf0('0x2b')],_0x791deb[_0x0bf0('0x35')]));if(_0xf9e380[_0x0bf0('0x2b')][_0x0bf0('0x37')]){_0x566798[_0x0bf0('0x34')]=_['merge'](_0x566798[_0x0bf0('0x34')],{'$or':_[_0x0bf0('0x38')](_0x4e0e69,function(_0x51c099){if(_0x51c099['type'][_0x0bf0('0x39')]!==_0x0bf0('0x3a')){var _0x2b0edb={};_0x2b0edb[_0x51c099[_0x0bf0('0x3b')]]={'$like':'%'+_0xf9e380[_0x0bf0('0x2b')][_0x0bf0('0x37')]+'%'};return _0x2b0edb;}})});}_0x566798=_[_0x0bf0('0x3c')]({},_0x566798,_0xf9e380[_0x0bf0('0x3d')]);var _0x1aa598={'where':_0x566798['where']};return db[_0x0bf0('0x27')][_0x0bf0('0x1a')](_0x1aa598)['then'](function(_0x282940){_0x18fd61[_0x0bf0('0x1a')]=_0x282940;if(_0xf9e380[_0x0bf0('0x2b')][_0x0bf0('0x3e')]){_0x566798['include']=[{'all':!![]}];}return db[_0x0bf0('0x27')][_0x0bf0('0x3f')](_0x566798);})[_0x0bf0('0x20')](function(_0x4c6513){_0x18fd61[_0x0bf0('0x40')]=_0x4c6513;return _0x18fd61;})[_0x0bf0('0x20')](respondWithFilteredResult(_0xffa53e,_0x566798))[_0x0bf0('0x41')](handleError(_0xffa53e,null));};exports['show']=function(_0x441f99,_0x1c8bbf){var _0x2e9e2f={'raw':!![],'where':{'id':_0x441f99[_0x0bf0('0x42')]['id']}},_0x2fa5bd={};_0x2fa5bd[_0x0bf0('0x29')]=_[_0x0bf0('0x2a')](db[_0x0bf0('0x27')][_0x0bf0('0x28')]);_0x2fa5bd['query']=_[_0x0bf0('0x2a')](_0x441f99[_0x0bf0('0x2b')]);_0x2fa5bd[_0x0bf0('0x35')]=_['intersection'](_0x2fa5bd['model'],_0x2fa5bd[_0x0bf0('0x2b')]);_0x2e9e2f['attributes']=_['intersection'](_0x2fa5bd[_0x0bf0('0x29')],qs['fields'](_0x441f99[_0x0bf0('0x2b')]['fields']));_0x2e9e2f['attributes']=_0x2e9e2f[_0x0bf0('0x2d')][_0x0bf0('0x2f')]?_0x2e9e2f['attributes']:_0x2fa5bd[_0x0bf0('0x29')];if(_0x441f99[_0x0bf0('0x2b')][_0x0bf0('0x3e')]){_0x2e9e2f[_0x0bf0('0x43')]=[{'all':!![]}];}_0x2e9e2f=_[_0x0bf0('0x3c')]({},_0x2e9e2f,_0x441f99[_0x0bf0('0x3d')]);return db[_0x0bf0('0x27')][_0x0bf0('0x44')](_0x2e9e2f)[_0x0bf0('0x20')](handleEntityNotFound(_0x1c8bbf,null))[_0x0bf0('0x20')](respondWithResult(_0x1c8bbf,null))['catch'](handleError(_0x1c8bbf,null));};exports[_0x0bf0('0x45')]=function(_0x3df063,_0x45cc40){return db[_0x0bf0('0x27')]['create'](_0x3df063[_0x0bf0('0x46')],{})[_0x0bf0('0x20')](respondWithResult(_0x45cc40,0xc9))[_0x0bf0('0x41')](handleError(_0x45cc40,null));};exports[_0x0bf0('0x47')]=function(_0x372d8e,_0x4f6e79){if(_0x372d8e[_0x0bf0('0x46')]['id']){delete _0x372d8e[_0x0bf0('0x46')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x372d8e[_0x0bf0('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f6e79,null))['then'](saveUpdates(_0x372d8e[_0x0bf0('0x46')],null))[_0x0bf0('0x20')](respondWithResult(_0x4f6e79,null))[_0x0bf0('0x41')](handleError(_0x4f6e79,null));};exports['destroy']=function(_0xd192e6,_0x253b32){return db[_0x0bf0('0x27')][_0x0bf0('0x44')]({'where':{'id':_0xd192e6[_0x0bf0('0x42')]['id']}})['then'](handleEntityNotFound(_0x253b32,null))[_0x0bf0('0x20')](removeEntity(_0x253b32,null))[_0x0bf0('0x41')](handleError(_0x253b32,null));}; \ No newline at end of file +var _0x01ad=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SquareMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x01ad,0x8c));var _0xd01a=function(_0x3517d9,_0x1e6703){_0x3517d9=_0x3517d9-0x0;var _0x29a2f4=_0x01ad[_0x3517d9];return _0x29a2f4;};'use strict';var pdf=require(_0xd01a('0x0'));var emlformat=require(_0xd01a('0x1'));var rimraf=require(_0xd01a('0x2'));var zipdir=require(_0xd01a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd01a('0x4'));var moment=require('moment');var BPromise=require(_0xd01a('0x5'));var Mustache=require('mustache');var util=require(_0xd01a('0x6'));var path=require(_0xd01a('0x7'));var sox=require(_0xd01a('0x8'));var csv=require('to-csv');var ejs=require(_0xd01a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd01a('0xa'));var crypto=require(_0xd01a('0xb'));var jsforce=require(_0xd01a('0xc'));var deskjs=require(_0xd01a('0xd'));var toCsv=require(_0xd01a('0xe'));var querystring=require(_0xd01a('0xf'));var Papa=require(_0xd01a('0x10'));var authService=require(_0xd01a('0x11'));var hardwareService=require(_0xd01a('0x12'));var Redis=require(_0xd01a('0x13'));var qs=require(_0xd01a('0x14'));var logger=require(_0xd01a('0x15'))('api');var utils=require(_0xd01a('0x16'));var config=require(_0xd01a('0x17'));var db=require(_0xd01a('0x18'))['db'];function respondWithStatusCode(_0x55ffd6,_0x10a7f5){_0x10a7f5=_0x10a7f5||0xcc;return function(_0x543cfc){if(_0x543cfc){return _0x55ffd6[_0xd01a('0x19')](_0x10a7f5);}return _0x55ffd6[_0xd01a('0x1a')](_0x10a7f5)[_0xd01a('0x1b')]();};}function respondWithResult(_0x29aeb0,_0x33d0e4){_0x33d0e4=_0x33d0e4||0xc8;return function(_0x565c18){if(_0x565c18){return _0x29aeb0[_0xd01a('0x1a')](_0x33d0e4)[_0xd01a('0x1c')](_0x565c18);}};}function respondWithFilteredResult(_0x5cea34,_0x242956){return function(_0x562d68){if(_0x562d68){var _0x11a0d6=_0x562d68['count'],_0x3192ae=_0x242956[_0xd01a('0x1d')],_0x40fc0d=_0x242956[_0xd01a('0x1d')]+_0x242956[_0xd01a('0x1e')],_0x1d2648;if(_0x40fc0d>=_0x11a0d6){_0x40fc0d=_0x11a0d6;_0x1d2648=0xc8;}else{_0x1d2648=0xce;}_0x5cea34[_0xd01a('0x1a')](_0x1d2648);return _0x5cea34[_0xd01a('0x1f')](_0xd01a('0x20'),_0x3192ae+'-'+_0x40fc0d+'/'+_0x11a0d6)[_0xd01a('0x1c')](_0x562d68);}return null;};}function patchUpdates(_0x486a91){return function(_0x235a97){try{jsonpatch[_0xd01a('0x21')](_0x235a97,_0x486a91,!![]);}catch(_0xfdd4ec){return BPromise[_0xd01a('0x22')](_0xfdd4ec);}return _0x235a97[_0xd01a('0x23')]();};}function saveUpdates(_0x58e4b0,_0x131e1f){return function(_0x4d7372){if(_0x4d7372){return _0x4d7372[_0xd01a('0x24')](_0x58e4b0)[_0xd01a('0x25')](function(_0x5ddea7){return _0x5ddea7;});}return null;};}function removeEntity(_0xb9bf29,_0x342b09){return function(_0x17d6b5){if(_0x17d6b5){return _0x17d6b5[_0xd01a('0x26')]()[_0xd01a('0x25')](function(){_0xb9bf29[_0xd01a('0x1a')](0xcc)[_0xd01a('0x1b')]();});}};}function handleEntityNotFound(_0xffe5c6,_0x42322b){return function(_0x42b26e){if(!_0x42b26e){_0xffe5c6[_0xd01a('0x19')](0x194);}return _0x42b26e;};}function handleError(_0x1e1d32,_0x4572ad){_0x4572ad=_0x4572ad||0x1f4;return function(_0x3d760f){logger[_0xd01a('0x27')](_0x3d760f['stack']);if(_0x3d760f[_0xd01a('0x28')]){delete _0x3d760f['name'];}_0x1e1d32[_0xd01a('0x1a')](_0x4572ad)[_0xd01a('0x29')](_0x3d760f);};}exports[_0xd01a('0x2a')]=function(_0x2d4135,_0x2da674){var _0x2cd644={},_0x197109={},_0x409ff6={'count':0x0,'rows':[]};var _0x759f90=db[_0xd01a('0x2b')][_0xd01a('0x2c')];_0x197109[_0xd01a('0x2d')]=_['keys'](_0x759f90);_0x197109[_0xd01a('0x2e')]=_[_0xd01a('0x2f')](_0x2d4135[_0xd01a('0x2e')]);_0x197109[_0xd01a('0x30')]=_[_0xd01a('0x31')](_0x197109['model'],_0x197109['query']);_0x2cd644[_0xd01a('0x32')]=_[_0xd01a('0x31')](_0x197109[_0xd01a('0x2d')],qs[_0xd01a('0x33')](_0x2d4135[_0xd01a('0x2e')][_0xd01a('0x33')]));_0x2cd644['attributes']=_0x2cd644[_0xd01a('0x32')][_0xd01a('0x34')]?_0x2cd644[_0xd01a('0x32')]:_0x197109[_0xd01a('0x2d')];if(!_0x2d4135['query'][_0xd01a('0x35')]('nolimit')){_0x2cd644[_0xd01a('0x1e')]=qs[_0xd01a('0x1e')](_0x2d4135[_0xd01a('0x2e')][_0xd01a('0x1e')]);_0x2cd644[_0xd01a('0x1d')]=qs[_0xd01a('0x1d')](_0x2d4135[_0xd01a('0x2e')]['offset']);}_0x2cd644['order']=qs['sort'](_0x2d4135[_0xd01a('0x2e')][_0xd01a('0x36')]);_0x2cd644[_0xd01a('0x37')]=qs['filters'](_[_0xd01a('0x38')](_0x2d4135[_0xd01a('0x2e')],_0x197109[_0xd01a('0x30')]));if(_0x2d4135[_0xd01a('0x2e')][_0xd01a('0x39')]){_0x2cd644[_0xd01a('0x37')]=_[_0xd01a('0x3a')](_0x2cd644[_0xd01a('0x37')],{'$or':_[_0xd01a('0x3b')](_0x759f90,function(_0x138813){if(_0x138813[_0xd01a('0x3c')][_0xd01a('0x3d')]!==_0xd01a('0x3e')){var _0x7c3519={};_0x7c3519[_0x138813[_0xd01a('0x3f')]]={'$like':'%'+_0x2d4135['query']['filter']+'%'};return _0x7c3519;}})});}_0x2cd644=_[_0xd01a('0x3a')]({},_0x2cd644,_0x2d4135[_0xd01a('0x40')]);var _0x588b6b={'where':_0x2cd644[_0xd01a('0x37')]};return db[_0xd01a('0x2b')][_0xd01a('0x41')](_0x588b6b)[_0xd01a('0x25')](function(_0x44c5d5){_0x409ff6[_0xd01a('0x41')]=_0x44c5d5;if(_0x2d4135[_0xd01a('0x2e')][_0xd01a('0x42')]){_0x2cd644[_0xd01a('0x43')]=[{'all':!![]}];}return db[_0xd01a('0x2b')][_0xd01a('0x44')](_0x2cd644);})['then'](function(_0x278f82){_0x409ff6[_0xd01a('0x45')]=_0x278f82;return _0x409ff6;})['then'](respondWithFilteredResult(_0x2da674,_0x2cd644))[_0xd01a('0x46')](handleError(_0x2da674,null));};exports[_0xd01a('0x47')]=function(_0xac2295,_0x4ff5cd){var _0x5454a7={'raw':!![],'where':{'id':_0xac2295[_0xd01a('0x48')]['id']}},_0xe768a8={};_0xe768a8['model']=_[_0xd01a('0x2f')](db[_0xd01a('0x2b')]['rawAttributes']);_0xe768a8[_0xd01a('0x2e')]=_[_0xd01a('0x2f')](_0xac2295[_0xd01a('0x2e')]);_0xe768a8[_0xd01a('0x30')]=_['intersection'](_0xe768a8[_0xd01a('0x2d')],_0xe768a8[_0xd01a('0x2e')]);_0x5454a7[_0xd01a('0x32')]=_[_0xd01a('0x31')](_0xe768a8[_0xd01a('0x2d')],qs['fields'](_0xac2295[_0xd01a('0x2e')]['fields']));_0x5454a7[_0xd01a('0x32')]=_0x5454a7[_0xd01a('0x32')][_0xd01a('0x34')]?_0x5454a7[_0xd01a('0x32')]:_0xe768a8[_0xd01a('0x2d')];if(_0xac2295[_0xd01a('0x2e')]['includeAll']){_0x5454a7[_0xd01a('0x43')]=[{'all':!![]}];}_0x5454a7=_[_0xd01a('0x3a')]({},_0x5454a7,_0xac2295[_0xd01a('0x40')]);return db[_0xd01a('0x2b')][_0xd01a('0x49')](_0x5454a7)[_0xd01a('0x25')](handleEntityNotFound(_0x4ff5cd,null))[_0xd01a('0x25')](respondWithResult(_0x4ff5cd,null))[_0xd01a('0x46')](handleError(_0x4ff5cd,null));};exports['create']=function(_0x18104b,_0x129e87){return db[_0xd01a('0x2b')]['create'](_0x18104b['body'],{})[_0xd01a('0x25')](respondWithResult(_0x129e87,0xc9))['catch'](handleError(_0x129e87,null));};exports['update']=function(_0x259d17,_0x20a3c8){if(_0x259d17[_0xd01a('0x4a')]['id']){delete _0x259d17[_0xd01a('0x4a')]['id'];}return db[_0xd01a('0x2b')][_0xd01a('0x49')]({'where':{'id':_0x259d17[_0xd01a('0x48')]['id']}})[_0xd01a('0x25')](handleEntityNotFound(_0x20a3c8,null))[_0xd01a('0x25')](saveUpdates(_0x259d17['body'],null))['then'](respondWithResult(_0x20a3c8,null))['catch'](handleError(_0x20a3c8,null));};exports[_0xd01a('0x26')]=function(_0x5399d2,_0x57dc39){return db[_0xd01a('0x2b')][_0xd01a('0x49')]({'where':{'id':_0x5399d2['params']['id']}})[_0xd01a('0x25')](handleEntityNotFound(_0x57dc39,null))['then'](removeEntity(_0x57dc39,null))[_0xd01a('0x46')](handleError(_0x57dc39,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 11366a4..9c83f4e 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 _0x6feb=['util','api','moment','bluebird','./squareMessage.attributes','define','square_messages','lodash'];(function(_0xb58eec,_0xbc604d){var _0xaa3bd6=function(_0x760caf){while(--_0x760caf){_0xb58eec['push'](_0xb58eec['shift']());}};_0xaa3bd6(++_0xbc604d);}(_0x6feb,0x147));var _0xb6fe=function(_0x1d4ac5,_0x30d83e){_0x1d4ac5=_0x1d4ac5-0x0;var _0x136507=_0x6feb[_0x1d4ac5];return _0x136507;};'use strict';var _=require(_0xb6fe('0x0'));var util=require(_0xb6fe('0x1'));var logger=require('../../config/logger')(_0xb6fe('0x2'));var moment=require(_0xb6fe('0x3'));var BPromise=require(_0xb6fe('0x4'));var rp=require('request-promise');var attributes=require(_0xb6fe('0x5'));module['exports']=function(_0x92d09b,_0x242b89){return _0x92d09b[_0xb6fe('0x6')]('SquareMessage',attributes,{'tableName':_0xb6fe('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd011=['SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define'];(function(_0x5a3998,_0xc1c924){var _0x59a799=function(_0x196b2f){while(--_0x196b2f){_0x5a3998['push'](_0x5a3998['shift']());}};_0x59a799(++_0xc1c924);}(_0xd011,0x91));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1d01('0x0'));var util=require(_0x1d01('0x1'));var logger=require(_0x1d01('0x2'))(_0x1d01('0x3'));var moment=require(_0x1d01('0x4'));var BPromise=require(_0x1d01('0x5'));var rp=require(_0x1d01('0x6'));var attributes=require('./squareMessage.attributes');module[_0x1d01('0x7')]=function(_0xec8bf2,_0x13a4e6){return _0xec8bf2[_0x1d01('0x8')](_0x1d01('0x9'),attributes,{'tableName':_0x1d01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 7431123..feaf3b3 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 _0x5c25=['SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareMessage','create','body','options','raw','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xc411d0,_0x118c9c){var _0xf9f573=function(_0x4145d5){while(--_0x4145d5){_0xc411d0['push'](_0xc411d0['shift']());}};_0xf9f573(++_0x118c9c);}(_0x5c25,0x113));var _0x55c2=function(_0x12949b,_0x3a8a51){_0x12949b=_0x12949b-0x0;var _0x5795f7=_0x5c25[_0x12949b];return _0x5795f7;};'use strict';var _=require('lodash');var util=require(_0x55c2('0x0'));var moment=require('moment');var BPromise=require(_0x55c2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55c2('0x2'))['db'];var utils=require(_0x55c2('0x3'));var logger=require(_0x55c2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x55c2('0x5'));var client=jayson[_0x55c2('0x6')][_0x55c2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf475ca,_0x491ac3,_0x5b155f){return new BPromise(function(_0x3d166f,_0x3b8fb4){return client[_0x55c2('0x8')](_0xf475ca,_0x5b155f)['then'](function(_0x5828aa){logger[_0x55c2('0x9')](_0x55c2('0xa'),_0x491ac3,_0x55c2('0xb'));logger[_0x55c2('0xc')](_0x55c2('0xd'),_0x491ac3,_0x55c2('0xb'),JSON[_0x55c2('0xe')](_0x5828aa));if(_0x5828aa[_0x55c2('0xf')]){if(_0x5828aa['error'][_0x55c2('0x10')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x491ac3,_0x5828aa['error'][_0x55c2('0x11')]);return _0x3b8fb4(_0x5828aa[_0x55c2('0xf')][_0x55c2('0x11')]);}logger[_0x55c2('0xf')](_0x55c2('0xa'),_0x491ac3,_0x5828aa[_0x55c2('0xf')][_0x55c2('0x11')]);return _0x3d166f(_0x5828aa[_0x55c2('0xf')][_0x55c2('0x11')]);}else{logger[_0x55c2('0x9')](_0x55c2('0xa'),_0x491ac3,'request\x20sent');_0x3d166f(_0x5828aa['result']['message']);}})[_0x55c2('0x12')](function(_0x2933b0){logger[_0x55c2('0xf')](_0x55c2('0xa'),_0x491ac3,_0x2933b0);_0x3b8fb4(_0x2933b0);});});}exports[_0x55c2('0x13')]=function(_0x3b9e23){var _0x3dba94=this;return new Promise(function(_0x1df3bd,_0x550972){return db['SquareMessage'][_0x55c2('0x14')](_0x3b9e23[_0x55c2('0x15')],{'raw':_0x3b9e23[_0x55c2('0x16')]?_0x3b9e23['options'][_0x55c2('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3199ce){logger['info'](_0x55c2('0x13'),_0x3b9e23);logger[_0x55c2('0xc')](_0x55c2('0x13'),_0x3b9e23,JSON['stringify'](_0x3199ce));_0x1df3bd(_0x3199ce);})[_0x55c2('0x12')](function(_0x5cd0c9){logger[_0x55c2('0xf')](_0x55c2('0x13'),_0x5cd0c9[_0x55c2('0x11')],_0x3b9e23);_0x550972(_0x3dba94[_0x55c2('0xf')](0x1f4,_0x5cd0c9['message']));});});}; \ No newline at end of file +var _0x436b=['request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareMessage','body','options','info','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0xd0f745,_0xb96d8d){var _0x194501=function(_0x462882){while(--_0x462882){_0xd0f745['push'](_0xd0f745['shift']());}};_0x194501(++_0xb96d8d);}(_0x436b,0x12e));var _0xb436=function(_0x45a3d3,_0x168455){_0x45a3d3=_0x45a3d3-0x0;var _0x589c83=_0x436b[_0x45a3d3];return _0x589c83;};'use strict';var _=require(_0xb436('0x0'));var util=require('util');var moment=require(_0xb436('0x1'));var BPromise=require('bluebird');var rs=require(_0xb436('0x2'));var fs=require('fs');var Redis=require(_0xb436('0x3'));var db=require(_0xb436('0x4'))['db'];var utils=require(_0xb436('0x5'));var logger=require(_0xb436('0x6'))(_0xb436('0x7'));var config=require(_0xb436('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb436('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf02bb6,_0x32f184,_0x5990e5){return new BPromise(function(_0x2e45c8,_0x1b1ebd){return client[_0xb436('0xa')](_0xf02bb6,_0x5990e5)[_0xb436('0xb')](function(_0x4d6450){logger['info'](_0xb436('0xc'),_0x32f184,_0xb436('0xd'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x32f184,_0xb436('0xd'),JSON['stringify'](_0x4d6450));if(_0x4d6450[_0xb436('0xe')]){if(_0x4d6450[_0xb436('0xe')][_0xb436('0xf')]===0x1f4){logger[_0xb436('0xe')](_0xb436('0xc'),_0x32f184,_0x4d6450['error'][_0xb436('0x10')]);return _0x1b1ebd(_0x4d6450['error'][_0xb436('0x10')]);}logger[_0xb436('0xe')](_0xb436('0xc'),_0x32f184,_0x4d6450[_0xb436('0xe')][_0xb436('0x10')]);return _0x2e45c8(_0x4d6450[_0xb436('0xe')][_0xb436('0x10')]);}else{logger['info'](_0xb436('0xc'),_0x32f184,_0xb436('0xd'));_0x2e45c8(_0x4d6450[_0xb436('0x11')]['message']);}})[_0xb436('0x12')](function(_0x4a81d4){logger[_0xb436('0xe')](_0xb436('0xc'),_0x32f184,_0x4a81d4);_0x1b1ebd(_0x4a81d4);});});}exports[_0xb436('0x13')]=function(_0x3cc311){var _0x15c917=this;return new Promise(function(_0x5e0b7e,_0x3fdbee){return db['SquareMessage']['create'](_0x3cc311[_0xb436('0x14')],{'raw':_0x3cc311[_0xb436('0x15')]?_0x3cc311[_0xb436('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xb436('0xb')](function(_0x4a0f92){logger[_0xb436('0x16')](_0xb436('0x13'),_0x3cc311);logger[_0xb436('0x17')](_0xb436('0x13'),_0x3cc311,JSON['stringify'](_0x4a0f92));_0x5e0b7e(_0x4a0f92);})[_0xb436('0x12')](function(_0x53ab61){logger['error'](_0xb436('0x13'),_0x53ab61[_0xb436('0x10')],_0x3cc311);_0x3fdbee(_0x15c917['error'](0x1f4,_0x53ab61['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 18b4d6d..c12563d 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 _0x45ea=['../../config/environment','./squareOdbc.controller','get','index','/:id/test','isAuthenticated','15s','test','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x355ae9,_0x402604){var _0x36c01a=function(_0x48f30c){while(--_0x48f30c){_0x355ae9['push'](_0x355ae9['shift']());}};_0x36c01a(++_0x402604);}(_0x45ea,0x1f0));var _0xa45e=function(_0x1e9321,_0x3fc317){_0x1e9321=_0x1e9321-0x0;var _0x1ce020=_0x45ea[_0x1e9321];return _0x1ce020;};'use strict';var multer=require(_0xa45e('0x0'));var util=require(_0xa45e('0x1'));var path=require(_0xa45e('0x2'));var timeout=require(_0xa45e('0x3'));var express=require(_0xa45e('0x4'));var router=express[_0xa45e('0x5')]();var auth=require(_0xa45e('0x6'));var interaction=require(_0xa45e('0x7'));var config=require(_0xa45e('0x8'));var controller=require(_0xa45e('0x9'));router[_0xa45e('0xa')]('/',auth['isAuthenticated'](),controller[_0xa45e('0xb')]);router[_0xa45e('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa45e('0xa')](_0xa45e('0xc'),auth[_0xa45e('0xd')](),timeout(_0xa45e('0xe')),controller[_0xa45e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa45e('0x10')]);router[_0xa45e('0x11')](_0xa45e('0x12'),auth[_0xa45e('0xd')](),controller['update']);router[_0xa45e('0x13')]('/:id',auth[_0xa45e('0xd')](),controller[_0xa45e('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2a41=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','show','/:id/test','isAuthenticated','15s','test','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a41,0x126));var _0x12a4=function(_0x5071bf,_0x82000e){_0x5071bf=_0x5071bf-0x0;var _0xc68643=_0x2a41[_0x5071bf];return _0xc68643;};'use strict';var multer=require(_0x12a4('0x0'));var util=require('util');var path=require(_0x12a4('0x1'));var timeout=require(_0x12a4('0x2'));var express=require(_0x12a4('0x3'));var router=express[_0x12a4('0x4')]();var auth=require(_0x12a4('0x5'));var interaction=require(_0x12a4('0x6'));var config=require(_0x12a4('0x7'));var controller=require(_0x12a4('0x8'));router[_0x12a4('0x9')]('/',auth['isAuthenticated'](),controller[_0x12a4('0xa')]);router[_0x12a4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x12a4('0xb')]);router['get'](_0x12a4('0xc'),auth[_0x12a4('0xd')](),timeout(_0x12a4('0xe')),controller[_0x12a4('0xf')]);router[_0x12a4('0x10')]('/',auth['isAuthenticated'](),controller[_0x12a4('0x11')]);router[_0x12a4('0x12')](_0x12a4('0x13'),auth[_0x12a4('0xd')](),controller[_0x12a4('0x14')]);router[_0x12a4('0x15')](_0x12a4('0x13'),auth[_0x12a4('0xd')](),controller[_0x12a4('0x16')]);module[_0x12a4('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 0d9dbb9..6a9b164 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 _0x2825=['sequelize','exports','name','STRING'];(function(_0x108cc9,_0x7efc4b){var _0x2cf9d1=function(_0x59ccd4){while(--_0x59ccd4){_0x108cc9['push'](_0x108cc9['shift']());}};_0x2cf9d1(++_0x7efc4b);}(_0x2825,0xd0));var _0x5282=function(_0x411d86,_0x5e8d6f){_0x411d86=_0x411d86-0x0;var _0x43f52c=_0x2825[_0x411d86];return _0x43f52c;};'use strict';var Sequelize=require(_0x5282('0x0'));module[_0x5282('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5282('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x5282('0x3')]},'description':{'type':Sequelize[_0x5282('0x3')]}}; \ No newline at end of file +var _0x61aa=['STRING','sequelize','exports','name'];(function(_0x3ba527,_0x12e799){var _0x4b8a05=function(_0x282d60){while(--_0x282d60){_0x3ba527['push'](_0x3ba527['shift']());}};_0x4b8a05(++_0x12e799);}(_0x61aa,0xc9));var _0xa61a=function(_0x1a07d4,_0x37eca0){_0x1a07d4=_0x1a07d4-0x0;var _0x26d1dc=_0x61aa[_0x1a07d4];return _0x26d1dc;};'use strict';var Sequelize=require(_0xa61a('0x0'));module[_0xa61a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa61a('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa61a('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index cf6c73e..ddf12e1 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 _0x8e19=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','then','destroy','get','ODBC','end','error','stack','name','send','index','SquareOdbc','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','test','dsn','odbc','openSync','closeSync','html-pdf','rimraf','zip-dir'];(function(_0x492300,_0x27ab49){var _0x232087=function(_0x2d2300){while(--_0x2d2300){_0x492300['push'](_0x492300['shift']());}};_0x232087(++_0x27ab49);}(_0x8e19,0x141));var _0x98e1=function(_0x2f9e2b,_0x34620f){_0x2f9e2b=_0x2f9e2b-0x0;var _0x42179d=_0x8e19[_0x2f9e2b];return _0x42179d;};'use strict';var pdf=require(_0x98e1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x98e1('0x1'));var zipdir=require(_0x98e1('0x2'));var jsonpatch=require(_0x98e1('0x3'));var rp=require(_0x98e1('0x4'));var moment=require('moment');var BPromise=require(_0x98e1('0x5'));var Mustache=require(_0x98e1('0x6'));var util=require(_0x98e1('0x7'));var path=require(_0x98e1('0x8'));var sox=require(_0x98e1('0x9'));var csv=require(_0x98e1('0xa'));var ejs=require(_0x98e1('0xb'));var fs=require('fs');var _=require(_0x98e1('0xc'));var squel=require(_0x98e1('0xd'));var crypto=require(_0x98e1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x98e1('0xf'));var Papa=require('papaparse');var authService=require(_0x98e1('0x10'));var hardwareService=require(_0x98e1('0x11'));var Redis=require(_0x98e1('0x12'));var qs=require(_0x98e1('0x13'));var logger=require(_0x98e1('0x14'))(_0x98e1('0x15'));var utils=require(_0x98e1('0x16'));var config=require('../../config/environment');var db=require(_0x98e1('0x17'))['db'];function respondWithStatusCode(_0x2c96b2,_0x19466c){_0x19466c=_0x19466c||0xcc;return function(_0x1a7549){if(_0x1a7549){return _0x2c96b2[_0x98e1('0x18')](_0x19466c);}return _0x2c96b2[_0x98e1('0x19')](_0x19466c)['end']();};}function respondWithResult(_0x5acbc5,_0x508400){_0x508400=_0x508400||0xc8;return function(_0x183663){if(_0x183663){return _0x5acbc5['status'](_0x508400)['json'](_0x183663);}};}function respondWithFilteredResult(_0x3dbeca,_0x255e1b){return function(_0x393c5c){if(_0x393c5c){var _0x2e8739=_0x393c5c[_0x98e1('0x1a')],_0x4e27d5=_0x255e1b[_0x98e1('0x1b')],_0x498ebb=_0x255e1b[_0x98e1('0x1b')]+_0x255e1b[_0x98e1('0x1c')],_0xadc74f;if(_0x498ebb>=_0x2e8739){_0x498ebb=_0x2e8739;_0xadc74f=0xc8;}else{_0xadc74f=0xce;}_0x3dbeca[_0x98e1('0x19')](_0xadc74f);return _0x3dbeca['set'](_0x98e1('0x1d'),_0x4e27d5+'-'+_0x498ebb+'/'+_0x2e8739)[_0x98e1('0x1e')](_0x393c5c);}return null;};}function patchUpdates(_0x1d28cb){return function(_0x2a3d5b){try{jsonpatch[_0x98e1('0x1f')](_0x2a3d5b,_0x1d28cb,!![]);}catch(_0xd2e193){return BPromise[_0x98e1('0x20')](_0xd2e193);}return _0x2a3d5b['save']();};}function saveUpdates(_0x1ba1c8,_0x425d81){return function(_0x138711){if(_0x138711){return _0x138711['update'](_0x1ba1c8)[_0x98e1('0x21')](function(_0x4ad22f){return _0x4ad22f;});}return null;};}function removeEntity(_0xbed67b,_0x6997cf){return function(_0x5da9a0){if(_0x5da9a0){return _0x5da9a0[_0x98e1('0x22')]()[_0x98e1('0x21')](function(){var _0x116295=_0x5da9a0[_0x98e1('0x23')]({'plain':!![]});var _0x1cc93b=_0x98e1('0x24');return db['UserProfileResource'][_0x98e1('0x22')]({'where':{'type':_0x1cc93b,'resourceId':_0x116295['id']}})[_0x98e1('0x21')](function(){return _0x5da9a0;});})['then'](function(){_0xbed67b[_0x98e1('0x19')](0xcc)[_0x98e1('0x25')]();});}};}function handleEntityNotFound(_0x5fe345,_0x389935){return function(_0x4dcf91){if(!_0x4dcf91){_0x5fe345[_0x98e1('0x18')](0x194);}return _0x4dcf91;};}function handleError(_0x56ae26,_0x555b8d){_0x555b8d=_0x555b8d||0x1f4;return function(_0x46063d){logger[_0x98e1('0x26')](_0x46063d[_0x98e1('0x27')]);if(_0x46063d['name']){delete _0x46063d[_0x98e1('0x28')];}_0x56ae26[_0x98e1('0x19')](_0x555b8d)[_0x98e1('0x29')](_0x46063d);};}exports[_0x98e1('0x2a')]=function(_0x332d60,_0x1ac0b4){var _0x363e76={},_0x104e9b={},_0x3d04e7={'count':0x0,'rows':[]};var _0x514ef2=db[_0x98e1('0x2b')]['rawAttributes'];_0x104e9b[_0x98e1('0x2c')]=_[_0x98e1('0x2d')](_0x514ef2);_0x104e9b[_0x98e1('0x2e')]=_['keys'](_0x332d60[_0x98e1('0x2e')]);_0x104e9b[_0x98e1('0x2f')]=_[_0x98e1('0x30')](_0x104e9b[_0x98e1('0x2c')],_0x104e9b[_0x98e1('0x2e')]);_0x363e76[_0x98e1('0x31')]=_[_0x98e1('0x30')](_0x104e9b['model'],qs[_0x98e1('0x32')](_0x332d60[_0x98e1('0x2e')][_0x98e1('0x32')]));_0x363e76[_0x98e1('0x31')]=_0x363e76[_0x98e1('0x31')][_0x98e1('0x33')]?_0x363e76[_0x98e1('0x31')]:_0x104e9b[_0x98e1('0x2c')];if(!_0x332d60[_0x98e1('0x2e')]['hasOwnProperty'](_0x98e1('0x34'))){_0x363e76[_0x98e1('0x1c')]=qs['limit'](_0x332d60['query'][_0x98e1('0x1c')]);_0x363e76[_0x98e1('0x1b')]=qs[_0x98e1('0x1b')](_0x332d60['query'][_0x98e1('0x1b')]);}_0x363e76['order']=qs[_0x98e1('0x35')](_0x332d60['query']['sort']);_0x363e76[_0x98e1('0x36')]=qs[_0x98e1('0x2f')](_[_0x98e1('0x37')](_0x332d60[_0x98e1('0x2e')],_0x104e9b[_0x98e1('0x2f')]));if(_0x332d60['query'][_0x98e1('0x38')]){_0x363e76[_0x98e1('0x36')]=_[_0x98e1('0x39')](_0x363e76['where'],{'$or':_[_0x98e1('0x3a')](_0x514ef2,function(_0x44b1c6){if(_0x44b1c6['type']['key']!==_0x98e1('0x3b')){var _0x1c6ab0={};_0x1c6ab0[_0x44b1c6['field']]={'$like':'%'+_0x332d60[_0x98e1('0x2e')][_0x98e1('0x38')]+'%'};return _0x1c6ab0;}})});}_0x363e76=_['merge']({},_0x363e76,_0x332d60[_0x98e1('0x3c')]);var _0x10d572={'where':_0x363e76[_0x98e1('0x36')]};return db[_0x98e1('0x2b')]['count'](_0x10d572)['then'](function(_0xe561c1){_0x3d04e7['count']=_0xe561c1;if(_0x332d60[_0x98e1('0x2e')][_0x98e1('0x3d')]){_0x363e76['include']=[{'all':!![]}];}return db[_0x98e1('0x2b')][_0x98e1('0x3e')](_0x363e76);})['then'](function(_0x4c5151){_0x3d04e7[_0x98e1('0x3f')]=_0x4c5151;return _0x3d04e7;})[_0x98e1('0x21')](respondWithFilteredResult(_0x1ac0b4,_0x363e76))[_0x98e1('0x40')](handleError(_0x1ac0b4,null));};exports['show']=function(_0x491cfd,_0x246533){var _0x40c383={'raw':!![],'where':{'id':_0x491cfd[_0x98e1('0x41')]['id']}},_0x44edfe={};_0x44edfe['model']=_[_0x98e1('0x2d')](db[_0x98e1('0x2b')][_0x98e1('0x42')]);_0x44edfe[_0x98e1('0x2e')]=_[_0x98e1('0x2d')](_0x491cfd[_0x98e1('0x2e')]);_0x44edfe[_0x98e1('0x2f')]=_[_0x98e1('0x30')](_0x44edfe['model'],_0x44edfe[_0x98e1('0x2e')]);_0x40c383[_0x98e1('0x31')]=_[_0x98e1('0x30')](_0x44edfe[_0x98e1('0x2c')],qs[_0x98e1('0x32')](_0x491cfd['query'][_0x98e1('0x32')]));_0x40c383['attributes']=_0x40c383[_0x98e1('0x31')][_0x98e1('0x33')]?_0x40c383[_0x98e1('0x31')]:_0x44edfe[_0x98e1('0x2c')];if(_0x491cfd[_0x98e1('0x2e')][_0x98e1('0x3d')]){_0x40c383['include']=[{'all':!![]}];}_0x40c383=_[_0x98e1('0x39')]({},_0x40c383,_0x491cfd['options']);return db['SquareOdbc'][_0x98e1('0x43')](_0x40c383)[_0x98e1('0x21')](handleEntityNotFound(_0x246533,null))[_0x98e1('0x21')](respondWithResult(_0x246533,null))['catch'](handleError(_0x246533,null));};exports[_0x98e1('0x44')]=function(_0x4cfebb,_0xbbdfe9){return db[_0x98e1('0x2b')][_0x98e1('0x44')](_0x4cfebb[_0x98e1('0x45')],{})[_0x98e1('0x21')](function(_0x44176d){var _0x4ae934=_0x4cfebb[_0x98e1('0x46')][_0x98e1('0x23')]({'plain':!![]});if(!_0x4ae934)throw new Error(_0x98e1('0x47'));if(_0x4ae934[_0x98e1('0x48')]===_0x98e1('0x46')){var _0x43ad6c=_0x44176d[_0x98e1('0x23')]({'plain':!![]});var _0x24a48e=_0x98e1('0x24');return db[_0x98e1('0x49')][_0x98e1('0x43')]({'where':{'name':_0x24a48e,'userProfileId':_0x4ae934['userProfileId']},'raw':!![]})[_0x98e1('0x21')](function(_0x22c97d){if(_0x22c97d&&_0x22c97d[_0x98e1('0x4a')]===0x0){return db['UserProfileResource'][_0x98e1('0x44')]({'name':_0x43ad6c['name'],'resourceId':_0x43ad6c['id'],'type':_0x22c97d['name'],'sectionId':_0x22c97d['id']},{})[_0x98e1('0x21')](function(){return _0x44176d;});}else{return _0x44176d;}})[_0x98e1('0x40')](function(_0x334be2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x334be2);throw _0x334be2;});}return _0x44176d;})['then'](respondWithResult(_0xbbdfe9,0xc9))[_0x98e1('0x40')](handleError(_0xbbdfe9,null));};exports[_0x98e1('0x4b')]=function(_0x399ee7,_0x29a7a7){if(_0x399ee7[_0x98e1('0x45')]['id']){delete _0x399ee7[_0x98e1('0x45')]['id'];}return db[_0x98e1('0x2b')]['find']({'where':{'id':_0x399ee7[_0x98e1('0x41')]['id']}})[_0x98e1('0x21')](handleEntityNotFound(_0x29a7a7,null))[_0x98e1('0x21')](saveUpdates(_0x399ee7[_0x98e1('0x45')],null))[_0x98e1('0x21')](respondWithResult(_0x29a7a7,null))[_0x98e1('0x40')](handleError(_0x29a7a7,null));};exports[_0x98e1('0x22')]=function(_0x41b2f5,_0x3f4f7e){return db[_0x98e1('0x2b')][_0x98e1('0x43')]({'where':{'id':_0x41b2f5[_0x98e1('0x41')]['id']}})[_0x98e1('0x21')](handleEntityNotFound(_0x3f4f7e,null))[_0x98e1('0x21')](removeEntity(_0x3f4f7e,null))[_0x98e1('0x40')](handleError(_0x3f4f7e,null));};exports[_0x98e1('0x4c')]=function(_0x25f442,_0x4b085b,_0x168137){var _0x4cc230;return db[_0x98e1('0x2b')][_0x98e1('0x43')]({'where':{'id':_0x25f442['params']['id']},'attributes':['id',_0x98e1('0x4d')]})[_0x98e1('0x21')](handleEntityNotFound(_0x4b085b,null))['then'](function(_0x103cd9){if(_0x103cd9){var _0x5948f6=require(_0x98e1('0x4e'))();_0x5948f6[_0x98e1('0x4f')](_0x103cd9[_0x98e1('0x4d')]);_0x5948f6[_0x98e1('0x50')]();return _0x103cd9;}})[_0x98e1('0x21')](respondWithResult(_0x4b085b,null))['catch'](handleError(_0x4b085b,null));}; \ No newline at end of file +var _0x67c3=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','then','destroy','get','stack','name','send','index','SquareOdbc','rawAttributes','model','query','filters','intersection','attributes','fields','order','where','pick','filter','merge','type','key','options','count','include','findAll','rows','catch','show','params','includeAll','create','body','role','user','ODBC','find','error','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x3bd7b0,_0x33255f){var _0xb1353c=function(_0x26865b){while(--_0x26865b){_0x3bd7b0['push'](_0x3bd7b0['shift']());}};_0xb1353c(++_0x33255f);}(_0x67c3,0xde));var _0x367c=function(_0x30e4c0,_0x58fed1){_0x30e4c0=_0x30e4c0-0x0;var _0x30b6d0=_0x67c3[_0x30e4c0];return _0x30b6d0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x367c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x367c('0x1'));var jsonpatch=require(_0x367c('0x2'));var rp=require('request-promise');var moment=require(_0x367c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x367c('0x4'));var util=require(_0x367c('0x5'));var path=require(_0x367c('0x6'));var sox=require(_0x367c('0x7'));var csv=require('to-csv');var ejs=require(_0x367c('0x8'));var fs=require('fs');var _=require(_0x367c('0x9'));var squel=require(_0x367c('0xa'));var crypto=require(_0x367c('0xb'));var jsforce=require(_0x367c('0xc'));var deskjs=require(_0x367c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x367c('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x367c('0xf'));var Redis=require(_0x367c('0x10'));var qs=require(_0x367c('0x11'));var logger=require(_0x367c('0x12'))(_0x367c('0x13'));var utils=require(_0x367c('0x14'));var config=require('../../config/environment');var db=require(_0x367c('0x15'))['db'];function respondWithStatusCode(_0x35e3f3,_0x4b13a9){_0x4b13a9=_0x4b13a9||0xcc;return function(_0x5426a6){if(_0x5426a6){return _0x35e3f3[_0x367c('0x16')](_0x4b13a9);}return _0x35e3f3[_0x367c('0x17')](_0x4b13a9)[_0x367c('0x18')]();};}function respondWithResult(_0x532d5a,_0x9898d){_0x9898d=_0x9898d||0xc8;return function(_0x43c444){if(_0x43c444){return _0x532d5a['status'](_0x9898d)['json'](_0x43c444);}};}function respondWithFilteredResult(_0x48dfc2,_0x46e9a6){return function(_0x3a6903){if(_0x3a6903){var _0x358971=_0x3a6903['count'],_0x4afe30=_0x46e9a6[_0x367c('0x19')],_0x225020=_0x46e9a6[_0x367c('0x19')]+_0x46e9a6[_0x367c('0x1a')],_0xee602d;if(_0x225020>=_0x358971){_0x225020=_0x358971;_0xee602d=0xc8;}else{_0xee602d=0xce;}_0x48dfc2[_0x367c('0x17')](_0xee602d);return _0x48dfc2[_0x367c('0x1b')]('Content-Range',_0x4afe30+'-'+_0x225020+'/'+_0x358971)[_0x367c('0x1c')](_0x3a6903);}return null;};}function patchUpdates(_0x4e36c8){return function(_0x33adde){try{jsonpatch[_0x367c('0x1d')](_0x33adde,_0x4e36c8,!![]);}catch(_0x6b4b04){return BPromise[_0x367c('0x1e')](_0x6b4b04);}return _0x33adde[_0x367c('0x1f')]();};}function saveUpdates(_0x1e3799,_0x876255){return function(_0x383064){if(_0x383064){return _0x383064[_0x367c('0x20')](_0x1e3799)[_0x367c('0x21')](function(_0x5b87b0){return _0x5b87b0;});}return null;};}function removeEntity(_0x5d0d95,_0x26f62d){return function(_0x2d749c){if(_0x2d749c){return _0x2d749c[_0x367c('0x22')]()[_0x367c('0x21')](function(){var _0x143acf=_0x2d749c[_0x367c('0x23')]({'plain':!![]});var _0x5a7d17='ODBC';return db['UserProfileResource'][_0x367c('0x22')]({'where':{'type':_0x5a7d17,'resourceId':_0x143acf['id']}})[_0x367c('0x21')](function(){return _0x2d749c;});})[_0x367c('0x21')](function(){_0x5d0d95['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41c8f8,_0x1cecbd){return function(_0x40a4eb){if(!_0x40a4eb){_0x41c8f8[_0x367c('0x16')](0x194);}return _0x40a4eb;};}function handleError(_0x2c23cc,_0x39cadd){_0x39cadd=_0x39cadd||0x1f4;return function(_0x4184f7){logger['error'](_0x4184f7[_0x367c('0x24')]);if(_0x4184f7['name']){delete _0x4184f7[_0x367c('0x25')];}_0x2c23cc[_0x367c('0x17')](_0x39cadd)[_0x367c('0x26')](_0x4184f7);};}exports[_0x367c('0x27')]=function(_0xbf6e6e,_0x3f89f5){var _0x4feaf0={},_0x28bc3c={},_0x4d9152={'count':0x0,'rows':[]};var _0x1b8328=db[_0x367c('0x28')][_0x367c('0x29')];_0x28bc3c[_0x367c('0x2a')]=_['keys'](_0x1b8328);_0x28bc3c[_0x367c('0x2b')]=_['keys'](_0xbf6e6e[_0x367c('0x2b')]);_0x28bc3c[_0x367c('0x2c')]=_[_0x367c('0x2d')](_0x28bc3c[_0x367c('0x2a')],_0x28bc3c[_0x367c('0x2b')]);_0x4feaf0[_0x367c('0x2e')]=_[_0x367c('0x2d')](_0x28bc3c['model'],qs[_0x367c('0x2f')](_0xbf6e6e[_0x367c('0x2b')][_0x367c('0x2f')]));_0x4feaf0[_0x367c('0x2e')]=_0x4feaf0[_0x367c('0x2e')]['length']?_0x4feaf0[_0x367c('0x2e')]:_0x28bc3c['model'];if(!_0xbf6e6e['query']['hasOwnProperty']('nolimit')){_0x4feaf0[_0x367c('0x1a')]=qs[_0x367c('0x1a')](_0xbf6e6e[_0x367c('0x2b')][_0x367c('0x1a')]);_0x4feaf0[_0x367c('0x19')]=qs[_0x367c('0x19')](_0xbf6e6e[_0x367c('0x2b')][_0x367c('0x19')]);}_0x4feaf0[_0x367c('0x30')]=qs['sort'](_0xbf6e6e[_0x367c('0x2b')]['sort']);_0x4feaf0[_0x367c('0x31')]=qs[_0x367c('0x2c')](_[_0x367c('0x32')](_0xbf6e6e[_0x367c('0x2b')],_0x28bc3c['filters']));if(_0xbf6e6e[_0x367c('0x2b')][_0x367c('0x33')]){_0x4feaf0[_0x367c('0x31')]=_[_0x367c('0x34')](_0x4feaf0[_0x367c('0x31')],{'$or':_['map'](_0x1b8328,function(_0x30a068){if(_0x30a068[_0x367c('0x35')][_0x367c('0x36')]!=='VIRTUAL'){var _0x372062={};_0x372062[_0x30a068['field']]={'$like':'%'+_0xbf6e6e[_0x367c('0x2b')][_0x367c('0x33')]+'%'};return _0x372062;}})});}_0x4feaf0=_[_0x367c('0x34')]({},_0x4feaf0,_0xbf6e6e[_0x367c('0x37')]);var _0x53ce11={'where':_0x4feaf0[_0x367c('0x31')]};return db['SquareOdbc'][_0x367c('0x38')](_0x53ce11)[_0x367c('0x21')](function(_0x5901da){_0x4d9152[_0x367c('0x38')]=_0x5901da;if(_0xbf6e6e[_0x367c('0x2b')]['includeAll']){_0x4feaf0[_0x367c('0x39')]=[{'all':!![]}];}return db[_0x367c('0x28')][_0x367c('0x3a')](_0x4feaf0);})[_0x367c('0x21')](function(_0x2f214f){_0x4d9152[_0x367c('0x3b')]=_0x2f214f;return _0x4d9152;})['then'](respondWithFilteredResult(_0x3f89f5,_0x4feaf0))[_0x367c('0x3c')](handleError(_0x3f89f5,null));};exports[_0x367c('0x3d')]=function(_0x59bed2,_0x5a38cb){var _0x114d10={'raw':!![],'where':{'id':_0x59bed2[_0x367c('0x3e')]['id']}},_0x195c0a={};_0x195c0a[_0x367c('0x2a')]=_['keys'](db[_0x367c('0x28')][_0x367c('0x29')]);_0x195c0a[_0x367c('0x2b')]=_['keys'](_0x59bed2[_0x367c('0x2b')]);_0x195c0a[_0x367c('0x2c')]=_[_0x367c('0x2d')](_0x195c0a[_0x367c('0x2a')],_0x195c0a[_0x367c('0x2b')]);_0x114d10[_0x367c('0x2e')]=_[_0x367c('0x2d')](_0x195c0a['model'],qs[_0x367c('0x2f')](_0x59bed2[_0x367c('0x2b')][_0x367c('0x2f')]));_0x114d10[_0x367c('0x2e')]=_0x114d10['attributes']['length']?_0x114d10[_0x367c('0x2e')]:_0x195c0a[_0x367c('0x2a')];if(_0x59bed2[_0x367c('0x2b')][_0x367c('0x3f')]){_0x114d10[_0x367c('0x39')]=[{'all':!![]}];}_0x114d10=_[_0x367c('0x34')]({},_0x114d10,_0x59bed2[_0x367c('0x37')]);return db[_0x367c('0x28')]['find'](_0x114d10)[_0x367c('0x21')](handleEntityNotFound(_0x5a38cb,null))[_0x367c('0x21')](respondWithResult(_0x5a38cb,null))['catch'](handleError(_0x5a38cb,null));};exports[_0x367c('0x40')]=function(_0x53d16a,_0x4050d4){return db[_0x367c('0x28')][_0x367c('0x40')](_0x53d16a[_0x367c('0x41')],{})[_0x367c('0x21')](function(_0x2bc996){var _0x41d45d=_0x53d16a['user'][_0x367c('0x23')]({'plain':!![]});if(!_0x41d45d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41d45d[_0x367c('0x42')]===_0x367c('0x43')){var _0x5b1ca8=_0x2bc996[_0x367c('0x23')]({'plain':!![]});var _0x1b18d9=_0x367c('0x44');return db['UserProfileSection'][_0x367c('0x45')]({'where':{'name':_0x1b18d9,'userProfileId':_0x41d45d['userProfileId']},'raw':!![]})[_0x367c('0x21')](function(_0x1e7a57){if(_0x1e7a57&&_0x1e7a57['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5b1ca8[_0x367c('0x25')],'resourceId':_0x5b1ca8['id'],'type':_0x1e7a57['name'],'sectionId':_0x1e7a57['id']},{})[_0x367c('0x21')](function(){return _0x2bc996;});}else{return _0x2bc996;}})[_0x367c('0x3c')](function(_0x20b927){logger[_0x367c('0x46')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20b927);throw _0x20b927;});}return _0x2bc996;})['then'](respondWithResult(_0x4050d4,0xc9))['catch'](handleError(_0x4050d4,null));};exports[_0x367c('0x20')]=function(_0x28158c,_0x3b9615){if(_0x28158c[_0x367c('0x41')]['id']){delete _0x28158c[_0x367c('0x41')]['id'];}return db[_0x367c('0x28')][_0x367c('0x45')]({'where':{'id':_0x28158c[_0x367c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3b9615,null))[_0x367c('0x21')](saveUpdates(_0x28158c[_0x367c('0x41')],null))[_0x367c('0x21')](respondWithResult(_0x3b9615,null))[_0x367c('0x3c')](handleError(_0x3b9615,null));};exports['destroy']=function(_0x33cf2e,_0xc24642){return db[_0x367c('0x28')]['find']({'where':{'id':_0x33cf2e['params']['id']}})[_0x367c('0x21')](handleEntityNotFound(_0xc24642,null))[_0x367c('0x21')](removeEntity(_0xc24642,null))[_0x367c('0x3c')](handleError(_0xc24642,null));};exports[_0x367c('0x47')]=function(_0x15dacc,_0x4e9837,_0x4954c9){var _0x4bc32c;return db[_0x367c('0x28')][_0x367c('0x45')]({'where':{'id':_0x15dacc['params']['id']},'attributes':['id','dsn']})[_0x367c('0x21')](handleEntityNotFound(_0x4e9837,null))[_0x367c('0x21')](function(_0x58f4b6){if(_0x58f4b6){var _0x255b67=require(_0x367c('0x48'))();_0x255b67[_0x367c('0x49')](_0x58f4b6[_0x367c('0x4a')]);_0x255b67[_0x367c('0x4b')]();return _0x58f4b6;}})[_0x367c('0x21')](respondWithResult(_0x4e9837,null))['catch'](handleError(_0x4e9837,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9a420c1..a58f686 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 _0xb4e6=['lodash','../../config/logger','api','moment','bluebird','request-promise','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x14b097,_0x2d6b02){var _0x37ae63=function(_0x40395e){while(--_0x40395e){_0x14b097['push'](_0x14b097['shift']());}};_0x37ae63(++_0x2d6b02);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xb4e6[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var attributes=require(_0x6b4e('0x6'));module[_0x6b4e('0x7')]=function(_0x52313b,_0x40da90){return _0x52313b[_0x6b4e('0x8')](_0x6b4e('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['define','SquareOdbc','square_odbc','../../config/logger','api','moment','bluebird','request-promise','./squareOdbc.attributes','exports'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x1339,0x1ed));var _0x9133=function(_0x143335,_0x1164e8){_0x143335=_0x143335-0x0;var _0x245710=_0x1339[_0x143335];return _0x245710;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var attributes=require(_0x9133('0x5'));module[_0x9133('0x6')]=function(_0x110c51,_0x558345){return _0x110c51[_0x9133('0x7')](_0x9133('0x8'),attributes,{'tableName':_0x9133('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 3411929..9691311 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 _0x6029=['then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','catch','SquareOdbc','find','options','raw','where','attributes','include','model','map','ShowSquareOdbc','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request'];(function(_0xf93b19,_0x1881f4){var _0x53cf20=function(_0x4a2340){while(--_0x4a2340){_0xf93b19['push'](_0xf93b19['shift']());}};_0x53cf20(++_0x1881f4);}(_0x6029,0xee));var _0x9602=function(_0x3e89d0,_0x487173){_0x3e89d0=_0x3e89d0-0x0;var _0x263a8a=_0x6029[_0x3e89d0];return _0x263a8a;};'use strict';var _=require(_0x9602('0x0'));var util=require(_0x9602('0x1'));var moment=require('moment');var BPromise=require(_0x9602('0x2'));var rs=require(_0x9602('0x3'));var fs=require('fs');var Redis=require(_0x9602('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9602('0x5'));var logger=require('../../config/logger')(_0x9602('0x6'));var config=require('../../config/environment');var jayson=require(_0x9602('0x7'));var client=jayson[_0x9602('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14da49,_0xa43e57,_0x5df6c9){return new BPromise(function(_0x5d934b,_0x1cada0){return client[_0x9602('0x9')](_0x14da49,_0x5df6c9)[_0x9602('0xa')](function(_0x363f7e){logger[_0x9602('0xb')]('SquareOdbc,\x20%s,\x20%s',_0xa43e57,_0x9602('0xc'));logger[_0x9602('0xd')](_0x9602('0xe'),_0xa43e57,_0x9602('0xc'),JSON[_0x9602('0xf')](_0x363f7e));if(_0x363f7e[_0x9602('0x10')]){if(_0x363f7e[_0x9602('0x10')][_0x9602('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0xa43e57,_0x363f7e[_0x9602('0x10')][_0x9602('0x12')]);return _0x1cada0(_0x363f7e[_0x9602('0x10')][_0x9602('0x12')]);}logger[_0x9602('0x10')](_0x9602('0x13'),_0xa43e57,_0x363f7e[_0x9602('0x10')]['message']);return _0x5d934b(_0x363f7e[_0x9602('0x10')][_0x9602('0x12')]);}else{logger[_0x9602('0xb')](_0x9602('0x13'),_0xa43e57,_0x9602('0xc'));_0x5d934b(_0x363f7e['result']['message']);}})[_0x9602('0x14')](function(_0x121423){logger[_0x9602('0x10')](_0x9602('0x13'),_0xa43e57,_0x121423);_0x1cada0(_0x121423);});});}exports['ShowSquareOdbc']=function(_0x160ef9){var _0x4021c1=this;return new Promise(function(_0x4fe7a6,_0x14a08b){return db[_0x9602('0x15')][_0x9602('0x16')]({'raw':_0x160ef9[_0x9602('0x17')]?_0x160ef9['options'][_0x9602('0x18')]===undefined?!![]:![]:!![],'where':_0x160ef9[_0x9602('0x17')]?_0x160ef9[_0x9602('0x17')][_0x9602('0x19')]||null:null,'attributes':_0x160ef9[_0x9602('0x17')]?_0x160ef9[_0x9602('0x17')][_0x9602('0x1a')]||null:null,'include':_0x160ef9[_0x9602('0x17')]?_0x160ef9[_0x9602('0x17')][_0x9602('0x1b')]?_['map'](_0x160ef9[_0x9602('0x17')][_0x9602('0x1b')],function(_0x54b1bf){return{'model':db[_0x54b1bf[_0x9602('0x1c')]],'as':_0x54b1bf['as'],'attributes':_0x54b1bf['attributes'],'include':_0x54b1bf['include']?_[_0x9602('0x1d')](_0x54b1bf[_0x9602('0x1b')],function(_0x1caf45){return{'model':db[_0x1caf45[_0x9602('0x1c')]],'as':_0x1caf45['as'],'attributes':_0x1caf45[_0x9602('0x1a')],'include':_0x1caf45[_0x9602('0x1b')]?_['map'](_0x1caf45[_0x9602('0x1b')],function(_0x40d6b9){return{'model':db[_0x40d6b9[_0x9602('0x1c')]],'as':_0x40d6b9['as'],'attributes':_0x40d6b9[_0x9602('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9602('0xa')](function(_0x21e87b){logger[_0x9602('0xb')](_0x9602('0x1e'),_0x160ef9);logger['debug'](_0x9602('0x1e'),_0x160ef9,JSON[_0x9602('0xf')](_0x21e87b));_0x4fe7a6(_0x21e87b);})[_0x9602('0x14')](function(_0x3aabe7){logger[_0x9602('0x10')](_0x9602('0x1e'),_0x3aabe7[_0x9602('0x12')],_0x160ef9);_0x14a08b(_0x4021c1[_0x9602('0x10')](0x1f4,_0x3aabe7[_0x9602('0x12')]));});});}; \ No newline at end of file +var _0x7521=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','map','include','model','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x7521,0x1bf));var _0x1752=function(_0x15779b,_0x526743){_0x15779b=_0x15779b-0x0;var _0x23dbb5=_0x7521[_0x15779b];return _0x23dbb5;};'use strict';var _=require('lodash');var util=require(_0x1752('0x0'));var moment=require(_0x1752('0x1'));var BPromise=require(_0x1752('0x2'));var rs=require(_0x1752('0x3'));var fs=require('fs');var Redis=require(_0x1752('0x4'));var db=require(_0x1752('0x5'))['db'];var utils=require(_0x1752('0x6'));var logger=require(_0x1752('0x7'))('rpc');var config=require(_0x1752('0x8'));var jayson=require(_0x1752('0x9'));var client=jayson[_0x1752('0xa')][_0x1752('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x300b2a,_0x9880d6,_0x79b7ed){return new BPromise(function(_0x1da77f,_0x20fa96){return client[_0x1752('0xc')](_0x300b2a,_0x79b7ed)[_0x1752('0xd')](function(_0x11984c){logger[_0x1752('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x9880d6,_0x1752('0xf'));logger[_0x1752('0x10')](_0x1752('0x11'),_0x9880d6,_0x1752('0xf'),JSON[_0x1752('0x12')](_0x11984c));if(_0x11984c[_0x1752('0x13')]){if(_0x11984c[_0x1752('0x13')][_0x1752('0x14')]===0x1f4){logger[_0x1752('0x13')](_0x1752('0x15'),_0x9880d6,_0x11984c[_0x1752('0x13')][_0x1752('0x16')]);return _0x20fa96(_0x11984c['error'][_0x1752('0x16')]);}logger[_0x1752('0x13')](_0x1752('0x15'),_0x9880d6,_0x11984c[_0x1752('0x13')][_0x1752('0x16')]);return _0x1da77f(_0x11984c[_0x1752('0x13')][_0x1752('0x16')]);}else{logger[_0x1752('0xe')](_0x1752('0x15'),_0x9880d6,'request\x20sent');_0x1da77f(_0x11984c['result'][_0x1752('0x16')]);}})['catch'](function(_0x11a460){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x9880d6,_0x11a460);_0x20fa96(_0x11a460);});});}exports[_0x1752('0x17')]=function(_0x2bcfd1){var _0x129412=this;return new Promise(function(_0x3bea6a,_0x45e626){return db[_0x1752('0x18')][_0x1752('0x19')]({'raw':_0x2bcfd1[_0x1752('0x1a')]?_0x2bcfd1[_0x1752('0x1a')][_0x1752('0x1b')]===undefined?!![]:![]:!![],'where':_0x2bcfd1['options']?_0x2bcfd1[_0x1752('0x1a')]['where']||null:null,'attributes':_0x2bcfd1[_0x1752('0x1a')]?_0x2bcfd1[_0x1752('0x1a')][_0x1752('0x1c')]||null:null,'include':_0x2bcfd1[_0x1752('0x1a')]?_0x2bcfd1[_0x1752('0x1a')]['include']?_[_0x1752('0x1d')](_0x2bcfd1[_0x1752('0x1a')][_0x1752('0x1e')],function(_0x264db1){return{'model':db[_0x264db1[_0x1752('0x1f')]],'as':_0x264db1['as'],'attributes':_0x264db1[_0x1752('0x1c')],'include':_0x264db1[_0x1752('0x1e')]?_[_0x1752('0x1d')](_0x264db1['include'],function(_0xf75843){return{'model':db[_0xf75843[_0x1752('0x1f')]],'as':_0xf75843['as'],'attributes':_0xf75843[_0x1752('0x1c')],'include':_0xf75843[_0x1752('0x1e')]?_[_0x1752('0x1d')](_0xf75843[_0x1752('0x1e')],function(_0xd43814){return{'model':db[_0xd43814[_0x1752('0x1f')]],'as':_0xd43814['as'],'attributes':_0xd43814[_0x1752('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a0baa){logger[_0x1752('0xe')](_0x1752('0x17'),_0x2bcfd1);logger[_0x1752('0x10')](_0x1752('0x17'),_0x2bcfd1,JSON['stringify'](_0x3a0baa));_0x3bea6a(_0x3a0baa);})[_0x1752('0x20')](function(_0x3b3a6e){logger[_0x1752('0x13')](_0x1752('0x17'),_0x3b3a6e[_0x1752('0x16')],_0x2bcfd1);_0x45e626(_0x129412['error'](0x1f4,_0x3b3a6e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 2858e22..164f38c 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 _0x5066=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','index','get','/:id','show','/:id/users','getUsers','post','create','isAuthenticated','addUsers','put','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x5066,0x1be));var _0x6506=function(_0x4d3a9b,_0x20b47d){_0x4d3a9b=_0x4d3a9b-0x0;var _0x1b5471=_0x5066[_0x4d3a9b];return _0x1b5471;};'use strict';var multer=require(_0x6506('0x0'));var util=require(_0x6506('0x1'));var path=require(_0x6506('0x2'));var timeout=require(_0x6506('0x3'));var express=require(_0x6506('0x4'));var router=express[_0x6506('0x5')]();var auth=require(_0x6506('0x6'));var interaction=require(_0x6506('0x7'));var config=require(_0x6506('0x8'));var controller=require(_0x6506('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x6506('0xa')]);router[_0x6506('0xb')](_0x6506('0xc'),auth['isAuthenticated'](),controller[_0x6506('0xd')]);router[_0x6506('0xb')](_0x6506('0xe'),auth['isAuthenticated'](),controller[_0x6506('0xf')]);router[_0x6506('0x10')]('/',auth['isAuthenticated'](),controller[_0x6506('0x11')]);router[_0x6506('0x10')]('/:id/users',auth[_0x6506('0x12')](),controller[_0x6506('0x13')]);router[_0x6506('0x14')](_0x6506('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6506('0x15')](_0x6506('0xc'),auth[_0x6506('0x12')](),controller[_0x6506('0x16')]);router[_0x6506('0x15')](_0x6506('0xe'),auth[_0x6506('0x12')](),controller[_0x6506('0x17')]);module[_0x6506('0x18')]=router; \ No newline at end of file +var _0xff88=['isAuthenticated','/:id','/:id/users','getUsers','post','create','put','destroy','delete','removeUsers','multer','path','connect-timeout','express','Router','../../components/interaction/service','./squareProject.controller','get'];(function(_0xbdff4b,_0x5c7c0f){var _0x45b7c0=function(_0x298802){while(--_0x298802){_0xbdff4b['push'](_0xbdff4b['shift']());}};_0x45b7c0(++_0x5c7c0f);}(_0xff88,0x1f0));var _0x8ff8=function(_0x2a275f,_0x3904b5){_0x2a275f=_0x2a275f-0x0;var _0x34da7b=_0xff88[_0x2a275f];return _0x34da7b;};'use strict';var multer=require(_0x8ff8('0x0'));var util=require('util');var path=require(_0x8ff8('0x1'));var timeout=require(_0x8ff8('0x2'));var express=require(_0x8ff8('0x3'));var router=express[_0x8ff8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8ff8('0x5'));var config=require('../../config/environment');var controller=require(_0x8ff8('0x6'));router[_0x8ff8('0x7')]('/',auth[_0x8ff8('0x8')](),controller['index']);router[_0x8ff8('0x7')](_0x8ff8('0x9'),auth[_0x8ff8('0x8')](),controller['show']);router[_0x8ff8('0x7')](_0x8ff8('0xa'),auth[_0x8ff8('0x8')](),controller[_0x8ff8('0xb')]);router[_0x8ff8('0xc')]('/',auth['isAuthenticated'](),controller[_0x8ff8('0xd')]);router['post']('/:id/users',auth[_0x8ff8('0x8')](),controller['addUsers']);router[_0x8ff8('0xe')](_0x8ff8('0x9'),auth[_0x8ff8('0x8')](),controller['update']);router['delete'](_0x8ff8('0x9'),auth[_0x8ff8('0x8')](),controller[_0x8ff8('0xf')]);router[_0x8ff8('0x10')](_0x8ff8('0xa'),auth[_0x8ff8('0x8')](),controller[_0x8ff8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 3f6d8de..79a80a6 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 _0x8ca9=['sequelize','exports','STRING','name','TEXT','BLOB','preproduction','utf8','long','getDataValue','production','toString'];(function(_0x3463fb,_0x18f39a){var _0x3787bc=function(_0x1ae005){while(--_0x1ae005){_0x3463fb['push'](_0x3463fb['shift']());}};_0x3787bc(++_0x18f39a);}(_0x8ca9,0x9c));var _0x98ca=function(_0x304589,_0x4b9d0f){_0x304589=_0x304589-0x0;var _0x2a8d05=_0x8ca9[_0x304589];return _0x2a8d05;};'use strict';var Sequelize=require(_0x98ca('0x0'));module[_0x98ca('0x1')]={'name':{'type':Sequelize[_0x98ca('0x2')],'unique':_0x98ca('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x98ca('0x2')]},'notes':{'type':Sequelize[_0x98ca('0x4')]},'preproduction':{'type':Sequelize[_0x98ca('0x5')]('long'),'get':function(){if(this['getDataValue'](_0x98ca('0x6'))){return this['getDataValue'](_0x98ca('0x6'))['toString'](_0x98ca('0x7'));}}},'production':{'type':Sequelize[_0x98ca('0x5')](_0x98ca('0x8')),'get':function(){if(this[_0x98ca('0x9')](_0x98ca('0xa'))){return this[_0x98ca('0x9')](_0x98ca('0xa'))[_0x98ca('0xb')](_0x98ca('0x7'));}}}}; \ No newline at end of file +var _0x4f0d=['getDataValue','utf8','TEXT','BLOB','long','preproduction','toString','production'];(function(_0x581b48,_0x2f792b){var _0x3bacdb=function(_0x3a5f73){while(--_0x3a5f73){_0x581b48['push'](_0x581b48['shift']());}};_0x3bacdb(++_0x2f792b);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x2c699e,_0x5e9d6c){_0x2c699e=_0x2c699e-0x0;var _0x5844e3=_0x4f0d[_0x2c699e];return _0x5844e3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xd4f0('0x0')]},'preproduction':{'type':Sequelize[_0xd4f0('0x1')](_0xd4f0('0x2')),'get':function(){if(this['getDataValue'](_0xd4f0('0x3'))){return this['getDataValue']('preproduction')[_0xd4f0('0x4')]('utf8');}}},'production':{'type':Sequelize[_0xd4f0('0x1')](_0xd4f0('0x2')),'get':function(){if(this['getDataValue'](_0xd4f0('0x5'))){return this[_0xd4f0('0x6')](_0xd4f0('0x5'))[_0xd4f0('0x4')](_0xd4f0('0x7'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index dd23786..95e5175 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 _0x5f2f=['field','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','role','UserProfileSection','error','update','body','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','SquareProjects','UserProfileResource','destroy','stack','name','index','SquareProject','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14cb95,_0x41d1ba){_0x14cb95=_0x14cb95-0x0;var _0x4585b6=_0x5f2f[_0x14cb95];return _0x4585b6;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var authService=require(_0xf5f2('0x11'));var hardwareService=require(_0xf5f2('0x12'));var Redis=require('ioredis');var qs=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];config[_0xf5f2('0x16')]=_[_0xf5f2('0x17')](config[_0xf5f2('0x16')],{'host':_0xf5f2('0x18'),'port':0x18eb});var socket=require(_0xf5f2('0x19'))(new Redis(config[_0xf5f2('0x16')]));require('./squareProject.socket')[_0xf5f2('0x1a')](socket);function respondWithStatusCode(_0xea612c,_0x269909){_0x269909=_0x269909||0xcc;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1b')](_0x269909);}return _0xea612c['status'](_0x269909)[_0xf5f2('0x1c')]();};}function respondWithResult(_0x286197,_0x17d656){_0x17d656=_0x17d656||0xc8;return function(_0x1b6dd2){if(_0x1b6dd2){return _0x286197[_0xf5f2('0x1d')](_0x17d656)[_0xf5f2('0x1e')](_0x1b6dd2);}};}function respondWithFilteredResult(_0xdb61b3,_0x395a5a){return function(_0x11f702){if(_0x11f702){var _0x228ace=_0x11f702[_0xf5f2('0x1f')],_0x20fccd=_0x395a5a[_0xf5f2('0x20')],_0x28e097=_0x395a5a[_0xf5f2('0x20')]+_0x395a5a[_0xf5f2('0x21')],_0x4ff59b;if(_0x28e097>=_0x228ace){_0x28e097=_0x228ace;_0x4ff59b=0xc8;}else{_0x4ff59b=0xce;}_0xdb61b3['status'](_0x4ff59b);return _0xdb61b3[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x20fccd+'-'+_0x28e097+'/'+_0x228ace)['json'](_0x11f702);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x24')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x25')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x26')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x27')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){var _0x5f1124=_0x287ad5[_0xf5f2('0x28')]({'plain':!![]});var _0x13da6f=_0xf5f2('0x29');return db[_0xf5f2('0x2a')][_0xf5f2('0x2b')]({'where':{'type':_0x13da6f,'resourceId':_0x5f1124['id']}})[_0xf5f2('0x27')](function(){return _0x287ad5;});})[_0xf5f2('0x27')](function(){_0x4e8bda[_0xf5f2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa2602,_0x102449){return function(_0x375ca8){if(!_0x375ca8){_0xaa2602[_0xf5f2('0x1b')](0x194);}return _0x375ca8;};}function handleError(_0x198c73,_0x477604){_0x477604=_0x477604||0x1f4;return function(_0x5b6672){logger['error'](_0x5b6672[_0xf5f2('0x2c')]);if(_0x5b6672[_0xf5f2('0x2d')]){delete _0x5b6672[_0xf5f2('0x2d')];}_0x198c73['status'](_0x477604)['send'](_0x5b6672);};}exports[_0xf5f2('0x2e')]=function(_0x50b8a2,_0x17394a){var _0x153924={},_0x1b381e={},_0x54c0c8={'count':0x0,'rows':[]};var _0x52e959=db[_0xf5f2('0x2f')]['rawAttributes'];_0x1b381e[_0xf5f2('0x30')]=_['keys'](_0x52e959);_0x1b381e[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x50b8a2[_0xf5f2('0x31')]);_0x1b381e[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x1b381e[_0xf5f2('0x30')],_0x1b381e[_0xf5f2('0x31')]);_0x153924[_0xf5f2('0x35')]=_['intersection'](_0x1b381e[_0xf5f2('0x30')],qs[_0xf5f2('0x36')](_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x153924[_0xf5f2('0x35')]=_0x153924[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x153924['attributes']:_0x1b381e[_0xf5f2('0x30')];if(!_0x50b8a2[_0xf5f2('0x31')]['hasOwnProperty'](_0xf5f2('0x38'))){_0x153924['limit']=qs[_0xf5f2('0x21')](_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x21')]);_0x153924[_0xf5f2('0x20')]=qs['offset'](_0x50b8a2['query'][_0xf5f2('0x20')]);}_0x153924[_0xf5f2('0x39')]=qs[_0xf5f2('0x3a')](_0x50b8a2['query'][_0xf5f2('0x3a')]);_0x153924['where']=qs[_0xf5f2('0x33')](_['pick'](_0x50b8a2[_0xf5f2('0x31')],_0x1b381e[_0xf5f2('0x33')]));if(_0x50b8a2['query'][_0xf5f2('0x3b')]){_0x153924[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0x153924[_0xf5f2('0x3c')],{'$or':_['map'](_0x52e959,function(_0x5d2d82){if(_0x5d2d82[_0xf5f2('0x3e')][_0xf5f2('0x3f')]!==_0xf5f2('0x40')){var _0x2d4400={};_0x2d4400[_0x5d2d82[_0xf5f2('0x41')]]={'$like':'%'+_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0x2d4400;}})});}_0x153924=_['merge']({},_0x153924,_0x50b8a2[_0xf5f2('0x42')]);var _0x3b4ea6={'where':_0x153924['where']};return db[_0xf5f2('0x2f')][_0xf5f2('0x1f')](_0x3b4ea6)[_0xf5f2('0x27')](function(_0x85b6d0){_0x54c0c8[_0xf5f2('0x1f')]=_0x85b6d0;if(_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x43')]){_0x153924[_0xf5f2('0x44')]=[{'all':!![]}];}return db['SquareProject'][_0xf5f2('0x45')](_0x153924);})[_0xf5f2('0x27')](function(_0x17a78e){_0x54c0c8['rows']=_0x17a78e;return _0x54c0c8;})['then'](respondWithFilteredResult(_0x17394a,_0x153924))['catch'](handleError(_0x17394a,null));};exports[_0xf5f2('0x46')]=function(_0x2ad13c,_0x4c8d8e){var _0x106272={'raw':![],'where':{'id':_0x2ad13c[_0xf5f2('0x47')]['id']}},_0xeed03d={};_0xeed03d[_0xf5f2('0x30')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x2f')][_0xf5f2('0x48')]);_0xeed03d[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x2ad13c[_0xf5f2('0x31')]);_0xeed03d[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0xeed03d[_0xf5f2('0x30')],_0xeed03d[_0xf5f2('0x31')]);_0x106272['attributes']=_[_0xf5f2('0x34')](_0xeed03d['model'],qs[_0xf5f2('0x36')](_0x2ad13c[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x106272[_0xf5f2('0x35')]=_0x106272[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x106272['attributes']:_0xeed03d[_0xf5f2('0x30')];if(_0x2ad13c[_0xf5f2('0x31')][_0xf5f2('0x43')]){_0x106272[_0xf5f2('0x44')]=[{'all':!![]}];}_0x106272=_[_0xf5f2('0x3d')]({},_0x106272,_0x2ad13c[_0xf5f2('0x42')]);return db[_0xf5f2('0x2f')][_0xf5f2('0x49')](_0x106272)['then'](handleEntityNotFound(_0x4c8d8e,null))[_0xf5f2('0x27')](respondWithResult(_0x4c8d8e,null))[_0xf5f2('0x4a')](handleError(_0x4c8d8e,null));};exports[_0xf5f2('0x4b')]=function(_0x492eea,_0x1177ba){return db[_0xf5f2('0x2f')][_0xf5f2('0x4b')](_0x492eea['body'],{})['then'](function(_0x7bb942){var _0x27c472=_0x492eea['user'][_0xf5f2('0x28')]({'plain':!![]});if(!_0x27c472)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c472[_0xf5f2('0x4c')]==='user'){var _0x2cbd9d=_0x7bb942['get']({'plain':!![]});var _0x2d9017=_0xf5f2('0x29');return db[_0xf5f2('0x4d')][_0xf5f2('0x49')]({'where':{'name':_0x2d9017,'userProfileId':_0x27c472['userProfileId']},'raw':!![]})[_0xf5f2('0x27')](function(_0x2b782f){if(_0x2b782f&&_0x2b782f['autoAssociation']===0x0){return db['UserProfileResource'][_0xf5f2('0x4b')]({'name':_0x2cbd9d[_0xf5f2('0x2d')],'resourceId':_0x2cbd9d['id'],'type':_0x2b782f['name'],'sectionId':_0x2b782f['id']},{})[_0xf5f2('0x27')](function(){return _0x7bb942;});}else{return _0x7bb942;}})[_0xf5f2('0x4a')](function(_0x29c9b6){logger[_0xf5f2('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29c9b6);throw _0x29c9b6;});}return _0x7bb942;})['then'](respondWithResult(_0x1177ba,0xc9))[_0xf5f2('0x4a')](handleError(_0x1177ba,null));};exports[_0xf5f2('0x4f')]=function(_0x4b62fc,_0x40eef){if(_0x4b62fc[_0xf5f2('0x50')]['id']){delete _0x4b62fc[_0xf5f2('0x50')]['id'];}return db[_0xf5f2('0x2f')][_0xf5f2('0x49')]({'where':{'id':_0x4b62fc[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x40eef,null))['then'](saveUpdates(_0x4b62fc['body'],null))[_0xf5f2('0x27')](respondWithResult(_0x40eef,null))[_0xf5f2('0x4a')](handleError(_0x40eef,null));};exports[_0xf5f2('0x2b')]=function(_0x46a905,_0x21b0d3){return db['SquareProject'][_0xf5f2('0x49')]({'where':{'id':_0x46a905[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x21b0d3,null))['then'](removeEntity(_0x21b0d3,null))[_0xf5f2('0x4a')](handleError(_0x21b0d3,null));};exports['addUsers']=function(_0x78f1d2,_0x1a8d33,_0x28cce5){return db[_0xf5f2('0x2f')]['find']({'where':{'id':_0x78f1d2['params']['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x1a8d33,null))['then'](function(_0xa39c65){if(_0xa39c65){return _0xa39c65[_0xf5f2('0x51')](_0x78f1d2['body'][_0xf5f2('0x52')],_[_0xf5f2('0x53')](_0x78f1d2[_0xf5f2('0x50')],['ids','id'])||{});}})[_0xf5f2('0x27')](respondWithResult(_0x1a8d33,null))[_0xf5f2('0x4a')](handleError(_0x1a8d33,null));};exports[_0xf5f2('0x54')]=function(_0x4579f4,_0x51fa7e,_0x421692){var _0x506fe5;return db[_0xf5f2('0x2f')][_0xf5f2('0x49')]({'where':{'id':_0x4579f4[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x51fa7e,null))[_0xf5f2('0x27')](function(_0x5583c2){if(_0x5583c2){return _0x5583c2[_0xf5f2('0x54')](_0x4579f4[_0xf5f2('0x31')][_0xf5f2('0x52')])[_0xf5f2('0x27')](function(_0x2c5733){if(_['isArray'](_0x4579f4[_0xf5f2('0x31')]['ids'])){for(var _0x4c96ee=0x0;_0x4c96ee<_0x4579f4[_0xf5f2('0x31')]['ids'][_0xf5f2('0x37')];_0x4c96ee+=0x1){socket[_0xf5f2('0x55')](_0xf5f2('0x56'),{'UserId':_0x4579f4[_0xf5f2('0x31')]['ids'][_0x4c96ee],'SquareProjectId':_0x4579f4[_0xf5f2('0x47')]['id']});}}else{socket[_0xf5f2('0x55')](_0xf5f2('0x56'),{'UserId':_0x4579f4[_0xf5f2('0x31')][_0xf5f2('0x52')],'SquareProjectId':_0x4579f4[_0xf5f2('0x47')]['id']});}});}})[_0xf5f2('0x27')](respondWithStatusCode(_0x51fa7e,null))['catch'](handleError(_0x51fa7e,null));};exports[_0xf5f2('0x57')]=function(_0x2d171d,_0xb39a6e,_0x45c7c1){var _0x5a5b2b={};var _0x1de396={};var _0x4cce08;var _0x410866;return db[_0xf5f2('0x2f')]['findOne']({'where':{'id':_0x2d171d[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0xb39a6e,null))[_0xf5f2('0x27')](function(_0x138c55){if(_0x138c55){_0x4cce08=_0x138c55;_0x1de396[_0xf5f2('0x30')]=_['keys'](db[_0xf5f2('0x58')][_0xf5f2('0x48')]);_0x1de396[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x2d171d[_0xf5f2('0x31')]);_0x1de396[_0xf5f2('0x33')]=_['intersection'](_0x1de396[_0xf5f2('0x30')],_0x1de396[_0xf5f2('0x31')]);_0x5a5b2b['attributes']=_[_0xf5f2('0x34')](_0x1de396[_0xf5f2('0x30')],qs[_0xf5f2('0x36')](_0x2d171d['query']['fields']));_0x5a5b2b['attributes']=_0x5a5b2b[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x5a5b2b[_0xf5f2('0x35')]:_0x1de396[_0xf5f2('0x30')];_0x5a5b2b[_0xf5f2('0x39')]=qs['sort'](_0x2d171d[_0xf5f2('0x31')][_0xf5f2('0x3a')]);_0x5a5b2b[_0xf5f2('0x3c')]=qs[_0xf5f2('0x33')](_[_0xf5f2('0x59')](_0x2d171d[_0xf5f2('0x31')],_0x1de396[_0xf5f2('0x33')]));if(_0x2d171d[_0xf5f2('0x31')][_0xf5f2('0x3b')]){_0x5a5b2b[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0x5a5b2b['where'],{'$or':_['map'](_0x5a5b2b['attributes'],function(_0x40f362){var _0xafba8e={};_0xafba8e[_0x40f362]={'$like':'%'+_0x2d171d[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0xafba8e;})});}_0x5a5b2b=_[_0xf5f2('0x3d')]({},_0x5a5b2b,_0x2d171d['options']);return _0x4cce08[_0xf5f2('0x57')](_0x5a5b2b);}})[_0xf5f2('0x27')](function(_0x301006){if(_0x301006){_0x410866=_0x301006[_0xf5f2('0x37')];if(!_0x2d171d[_0xf5f2('0x31')]['hasOwnProperty'](_0xf5f2('0x38'))){_0x5a5b2b[_0xf5f2('0x21')]=qs['limit'](_0x2d171d[_0xf5f2('0x31')][_0xf5f2('0x21')]);_0x5a5b2b[_0xf5f2('0x20')]=qs[_0xf5f2('0x20')](_0x2d171d['query'][_0xf5f2('0x20')]);}return _0x4cce08[_0xf5f2('0x57')](_0x5a5b2b);}})[_0xf5f2('0x27')](function(_0x2adeb4){if(_0x2adeb4){return _0x2adeb4?{'count':_0x410866,'rows':_0x2adeb4}:null;}})[_0xf5f2('0x27')](respondWithResult(_0xb39a6e,null))['catch'](handleError(_0xb39a6e,null));}; \ No newline at end of file +var _0x5f2f=['field','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','role','UserProfileSection','error','update','body','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','SquareProjects','UserProfileResource','destroy','stack','name','index','SquareProject','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5677a5,_0x1889bc){_0x5677a5=_0x5677a5-0x0;var _0x54ab3b=_0x5f2f[_0x5677a5];return _0x54ab3b;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var authService=require(_0xf5f2('0x11'));var hardwareService=require(_0xf5f2('0x12'));var Redis=require('ioredis');var qs=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];config[_0xf5f2('0x16')]=_[_0xf5f2('0x17')](config[_0xf5f2('0x16')],{'host':_0xf5f2('0x18'),'port':0x18eb});var socket=require(_0xf5f2('0x19'))(new Redis(config[_0xf5f2('0x16')]));require('./squareProject.socket')[_0xf5f2('0x1a')](socket);function respondWithStatusCode(_0xea612c,_0x269909){_0x269909=_0x269909||0xcc;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1b')](_0x269909);}return _0xea612c['status'](_0x269909)[_0xf5f2('0x1c')]();};}function respondWithResult(_0x286197,_0x17d656){_0x17d656=_0x17d656||0xc8;return function(_0x1b6dd2){if(_0x1b6dd2){return _0x286197[_0xf5f2('0x1d')](_0x17d656)[_0xf5f2('0x1e')](_0x1b6dd2);}};}function respondWithFilteredResult(_0xdb61b3,_0x395a5a){return function(_0x11f702){if(_0x11f702){var _0x228ace=_0x11f702[_0xf5f2('0x1f')],_0x20fccd=_0x395a5a[_0xf5f2('0x20')],_0x28e097=_0x395a5a[_0xf5f2('0x20')]+_0x395a5a[_0xf5f2('0x21')],_0x4ff59b;if(_0x28e097>=_0x228ace){_0x28e097=_0x228ace;_0x4ff59b=0xc8;}else{_0x4ff59b=0xce;}_0xdb61b3['status'](_0x4ff59b);return _0xdb61b3[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x20fccd+'-'+_0x28e097+'/'+_0x228ace)['json'](_0x11f702);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x24')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x25')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x26')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x27')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){var _0x5f1124=_0x287ad5[_0xf5f2('0x28')]({'plain':!![]});var _0x13da6f=_0xf5f2('0x29');return db[_0xf5f2('0x2a')][_0xf5f2('0x2b')]({'where':{'type':_0x13da6f,'resourceId':_0x5f1124['id']}})[_0xf5f2('0x27')](function(){return _0x287ad5;});})[_0xf5f2('0x27')](function(){_0x4e8bda[_0xf5f2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa2602,_0x102449){return function(_0x375ca8){if(!_0x375ca8){_0xaa2602[_0xf5f2('0x1b')](0x194);}return _0x375ca8;};}function handleError(_0x198c73,_0x477604){_0x477604=_0x477604||0x1f4;return function(_0x5b6672){logger['error'](_0x5b6672[_0xf5f2('0x2c')]);if(_0x5b6672[_0xf5f2('0x2d')]){delete _0x5b6672[_0xf5f2('0x2d')];}_0x198c73['status'](_0x477604)['send'](_0x5b6672);};}exports[_0xf5f2('0x2e')]=function(_0x50b8a2,_0x17394a){var _0x153924={},_0x1b381e={},_0x54c0c8={'count':0x0,'rows':[]};var _0x52e959=db[_0xf5f2('0x2f')]['rawAttributes'];_0x1b381e[_0xf5f2('0x30')]=_['keys'](_0x52e959);_0x1b381e[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x50b8a2[_0xf5f2('0x31')]);_0x1b381e[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x1b381e[_0xf5f2('0x30')],_0x1b381e[_0xf5f2('0x31')]);_0x153924[_0xf5f2('0x35')]=_['intersection'](_0x1b381e[_0xf5f2('0x30')],qs[_0xf5f2('0x36')](_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x153924[_0xf5f2('0x35')]=_0x153924[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x153924['attributes']:_0x1b381e[_0xf5f2('0x30')];if(!_0x50b8a2[_0xf5f2('0x31')]['hasOwnProperty'](_0xf5f2('0x38'))){_0x153924['limit']=qs[_0xf5f2('0x21')](_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x21')]);_0x153924[_0xf5f2('0x20')]=qs['offset'](_0x50b8a2['query'][_0xf5f2('0x20')]);}_0x153924[_0xf5f2('0x39')]=qs[_0xf5f2('0x3a')](_0x50b8a2['query'][_0xf5f2('0x3a')]);_0x153924['where']=qs[_0xf5f2('0x33')](_['pick'](_0x50b8a2[_0xf5f2('0x31')],_0x1b381e[_0xf5f2('0x33')]));if(_0x50b8a2['query'][_0xf5f2('0x3b')]){_0x153924[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0x153924[_0xf5f2('0x3c')],{'$or':_['map'](_0x52e959,function(_0x5d2d82){if(_0x5d2d82[_0xf5f2('0x3e')][_0xf5f2('0x3f')]!==_0xf5f2('0x40')){var _0x2d4400={};_0x2d4400[_0x5d2d82[_0xf5f2('0x41')]]={'$like':'%'+_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0x2d4400;}})});}_0x153924=_['merge']({},_0x153924,_0x50b8a2[_0xf5f2('0x42')]);var _0x3b4ea6={'where':_0x153924['where']};return db[_0xf5f2('0x2f')][_0xf5f2('0x1f')](_0x3b4ea6)[_0xf5f2('0x27')](function(_0x85b6d0){_0x54c0c8[_0xf5f2('0x1f')]=_0x85b6d0;if(_0x50b8a2[_0xf5f2('0x31')][_0xf5f2('0x43')]){_0x153924[_0xf5f2('0x44')]=[{'all':!![]}];}return db['SquareProject'][_0xf5f2('0x45')](_0x153924);})[_0xf5f2('0x27')](function(_0x17a78e){_0x54c0c8['rows']=_0x17a78e;return _0x54c0c8;})['then'](respondWithFilteredResult(_0x17394a,_0x153924))['catch'](handleError(_0x17394a,null));};exports[_0xf5f2('0x46')]=function(_0x2ad13c,_0x4c8d8e){var _0x106272={'raw':![],'where':{'id':_0x2ad13c[_0xf5f2('0x47')]['id']}},_0xeed03d={};_0xeed03d[_0xf5f2('0x30')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x2f')][_0xf5f2('0x48')]);_0xeed03d[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x2ad13c[_0xf5f2('0x31')]);_0xeed03d[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0xeed03d[_0xf5f2('0x30')],_0xeed03d[_0xf5f2('0x31')]);_0x106272['attributes']=_[_0xf5f2('0x34')](_0xeed03d['model'],qs[_0xf5f2('0x36')](_0x2ad13c[_0xf5f2('0x31')][_0xf5f2('0x36')]));_0x106272[_0xf5f2('0x35')]=_0x106272[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x106272['attributes']:_0xeed03d[_0xf5f2('0x30')];if(_0x2ad13c[_0xf5f2('0x31')][_0xf5f2('0x43')]){_0x106272[_0xf5f2('0x44')]=[{'all':!![]}];}_0x106272=_[_0xf5f2('0x3d')]({},_0x106272,_0x2ad13c[_0xf5f2('0x42')]);return db[_0xf5f2('0x2f')][_0xf5f2('0x49')](_0x106272)['then'](handleEntityNotFound(_0x4c8d8e,null))[_0xf5f2('0x27')](respondWithResult(_0x4c8d8e,null))[_0xf5f2('0x4a')](handleError(_0x4c8d8e,null));};exports[_0xf5f2('0x4b')]=function(_0x492eea,_0x1177ba){return db[_0xf5f2('0x2f')][_0xf5f2('0x4b')](_0x492eea['body'],{})['then'](function(_0x7bb942){var _0x27c472=_0x492eea['user'][_0xf5f2('0x28')]({'plain':!![]});if(!_0x27c472)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c472[_0xf5f2('0x4c')]==='user'){var _0x2cbd9d=_0x7bb942['get']({'plain':!![]});var _0x2d9017=_0xf5f2('0x29');return db[_0xf5f2('0x4d')][_0xf5f2('0x49')]({'where':{'name':_0x2d9017,'userProfileId':_0x27c472['userProfileId']},'raw':!![]})[_0xf5f2('0x27')](function(_0x2b782f){if(_0x2b782f&&_0x2b782f['autoAssociation']===0x0){return db['UserProfileResource'][_0xf5f2('0x4b')]({'name':_0x2cbd9d[_0xf5f2('0x2d')],'resourceId':_0x2cbd9d['id'],'type':_0x2b782f['name'],'sectionId':_0x2b782f['id']},{})[_0xf5f2('0x27')](function(){return _0x7bb942;});}else{return _0x7bb942;}})[_0xf5f2('0x4a')](function(_0x29c9b6){logger[_0xf5f2('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29c9b6);throw _0x29c9b6;});}return _0x7bb942;})['then'](respondWithResult(_0x1177ba,0xc9))[_0xf5f2('0x4a')](handleError(_0x1177ba,null));};exports[_0xf5f2('0x4f')]=function(_0x4b62fc,_0x40eef){if(_0x4b62fc[_0xf5f2('0x50')]['id']){delete _0x4b62fc[_0xf5f2('0x50')]['id'];}return db[_0xf5f2('0x2f')][_0xf5f2('0x49')]({'where':{'id':_0x4b62fc[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x40eef,null))['then'](saveUpdates(_0x4b62fc['body'],null))[_0xf5f2('0x27')](respondWithResult(_0x40eef,null))[_0xf5f2('0x4a')](handleError(_0x40eef,null));};exports[_0xf5f2('0x2b')]=function(_0x46a905,_0x21b0d3){return db['SquareProject'][_0xf5f2('0x49')]({'where':{'id':_0x46a905[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x21b0d3,null))['then'](removeEntity(_0x21b0d3,null))[_0xf5f2('0x4a')](handleError(_0x21b0d3,null));};exports['addUsers']=function(_0x78f1d2,_0x1a8d33,_0x28cce5){return db[_0xf5f2('0x2f')]['find']({'where':{'id':_0x78f1d2['params']['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x1a8d33,null))['then'](function(_0xa39c65){if(_0xa39c65){return _0xa39c65[_0xf5f2('0x51')](_0x78f1d2['body'][_0xf5f2('0x52')],_[_0xf5f2('0x53')](_0x78f1d2[_0xf5f2('0x50')],['ids','id'])||{});}})[_0xf5f2('0x27')](respondWithResult(_0x1a8d33,null))[_0xf5f2('0x4a')](handleError(_0x1a8d33,null));};exports[_0xf5f2('0x54')]=function(_0x4579f4,_0x51fa7e,_0x421692){var _0x506fe5;return db[_0xf5f2('0x2f')][_0xf5f2('0x49')]({'where':{'id':_0x4579f4[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x51fa7e,null))[_0xf5f2('0x27')](function(_0x5583c2){if(_0x5583c2){return _0x5583c2[_0xf5f2('0x54')](_0x4579f4[_0xf5f2('0x31')][_0xf5f2('0x52')])[_0xf5f2('0x27')](function(_0x2c5733){if(_['isArray'](_0x4579f4[_0xf5f2('0x31')]['ids'])){for(var _0x4c96ee=0x0;_0x4c96ee<_0x4579f4[_0xf5f2('0x31')]['ids'][_0xf5f2('0x37')];_0x4c96ee+=0x1){socket[_0xf5f2('0x55')](_0xf5f2('0x56'),{'UserId':_0x4579f4[_0xf5f2('0x31')]['ids'][_0x4c96ee],'SquareProjectId':_0x4579f4[_0xf5f2('0x47')]['id']});}}else{socket[_0xf5f2('0x55')](_0xf5f2('0x56'),{'UserId':_0x4579f4[_0xf5f2('0x31')][_0xf5f2('0x52')],'SquareProjectId':_0x4579f4[_0xf5f2('0x47')]['id']});}});}})[_0xf5f2('0x27')](respondWithStatusCode(_0x51fa7e,null))['catch'](handleError(_0x51fa7e,null));};exports[_0xf5f2('0x57')]=function(_0x2d171d,_0xb39a6e,_0x45c7c1){var _0x5a5b2b={};var _0x1de396={};var _0x4cce08;var _0x410866;return db[_0xf5f2('0x2f')]['findOne']({'where':{'id':_0x2d171d[_0xf5f2('0x47')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0xb39a6e,null))[_0xf5f2('0x27')](function(_0x138c55){if(_0x138c55){_0x4cce08=_0x138c55;_0x1de396[_0xf5f2('0x30')]=_['keys'](db[_0xf5f2('0x58')][_0xf5f2('0x48')]);_0x1de396[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](_0x2d171d[_0xf5f2('0x31')]);_0x1de396[_0xf5f2('0x33')]=_['intersection'](_0x1de396[_0xf5f2('0x30')],_0x1de396[_0xf5f2('0x31')]);_0x5a5b2b['attributes']=_[_0xf5f2('0x34')](_0x1de396[_0xf5f2('0x30')],qs[_0xf5f2('0x36')](_0x2d171d['query']['fields']));_0x5a5b2b['attributes']=_0x5a5b2b[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x5a5b2b[_0xf5f2('0x35')]:_0x1de396[_0xf5f2('0x30')];_0x5a5b2b[_0xf5f2('0x39')]=qs['sort'](_0x2d171d[_0xf5f2('0x31')][_0xf5f2('0x3a')]);_0x5a5b2b[_0xf5f2('0x3c')]=qs[_0xf5f2('0x33')](_[_0xf5f2('0x59')](_0x2d171d[_0xf5f2('0x31')],_0x1de396[_0xf5f2('0x33')]));if(_0x2d171d[_0xf5f2('0x31')][_0xf5f2('0x3b')]){_0x5a5b2b[_0xf5f2('0x3c')]=_[_0xf5f2('0x3d')](_0x5a5b2b['where'],{'$or':_['map'](_0x5a5b2b['attributes'],function(_0x40f362){var _0xafba8e={};_0xafba8e[_0x40f362]={'$like':'%'+_0x2d171d[_0xf5f2('0x31')][_0xf5f2('0x3b')]+'%'};return _0xafba8e;})});}_0x5a5b2b=_[_0xf5f2('0x3d')]({},_0x5a5b2b,_0x2d171d['options']);return _0x4cce08[_0xf5f2('0x57')](_0x5a5b2b);}})[_0xf5f2('0x27')](function(_0x301006){if(_0x301006){_0x410866=_0x301006[_0xf5f2('0x37')];if(!_0x2d171d[_0xf5f2('0x31')]['hasOwnProperty'](_0xf5f2('0x38'))){_0x5a5b2b[_0xf5f2('0x21')]=qs['limit'](_0x2d171d[_0xf5f2('0x31')][_0xf5f2('0x21')]);_0x5a5b2b[_0xf5f2('0x20')]=qs[_0xf5f2('0x20')](_0x2d171d['query'][_0xf5f2('0x20')]);}return _0x4cce08[_0xf5f2('0x57')](_0x5a5b2b);}})[_0xf5f2('0x27')](function(_0x2adeb4){if(_0x2adeb4){return _0x2adeb4?{'count':_0x410866,'rows':_0x2adeb4}:null;}})[_0xf5f2('0x27')](respondWithResult(_0xb39a6e,null))['catch'](handleError(_0xb39a6e,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 0d06051..60dbaf3 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 _0x47cb=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject'];(function(_0x4c0998,_0x165050){var _0x1110e2=function(_0x7cb8c3){while(--_0x7cb8c3){_0x4c0998['push'](_0x4c0998['shift']());}};_0x1110e2(++_0x165050);}(_0x47cb,0x10c));var _0xb47c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x47cb[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb47c('0x0'))['db'][_0xb47c('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb47c('0x2')](0x0);var events={'afterCreate':_0xb47c('0x3'),'afterUpdate':_0xb47c('0x4'),'afterDestroy':_0xb47c('0x5')};function emitEvent(_0x4e75e2){return function(_0x3817e5,_0x164052,_0xeb57ee){SquareProjectEvents[_0xb47c('0x6')](_0x4e75e2+':'+_0x3817e5['id'],_0x3817e5);SquareProjectEvents[_0xb47c('0x6')](_0x4e75e2,_0x3817e5);_0xeb57ee(null);};}for(var e in events){if(events[_0xb47c('0x7')](e)){var event=events[e];SquareProject[_0xb47c('0x8')](e,emitEvent(event));}}module[_0xb47c('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x7f97=['SquareProject','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x269f10,_0x37325f){var _0x4301af=function(_0x12e059){while(--_0x12e059){_0x269f10['push'](_0x269f10['shift']());}};_0x4301af(++_0x37325f);}(_0x7f97,0x157));var _0x77f9=function(_0x229f53,_0x48a1da){_0x229f53=_0x229f53-0x0;var _0x5053a6=_0x7f97[_0x229f53];return _0x5053a6;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x77f9('0x0'))['db'][_0x77f9('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x77f9('0x2'),'afterUpdate':_0x77f9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2606d3){return function(_0x541d69,_0x5da58d,_0x30c1b6){SquareProjectEvents[_0x77f9('0x4')](_0x2606d3+':'+_0x541d69['id'],_0x541d69);SquareProjectEvents['emit'](_0x2606d3,_0x541d69);_0x30c1b6(null);};}for(var e in events){if(events[_0x77f9('0x5')](e)){var event=events[e];SquareProject[_0x77f9('0x6')](e,emitEvent(event));}}module[_0x77f9('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 0e0880c..80d70a7 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 _0xddc4=['moment','bluebird','request-promise','./squareProject.attributes','exports','define','square_projects','util','../../config/logger','api'];(function(_0x48cb2a,_0xef57e3){var _0x52a1a0=function(_0x303f2f){while(--_0x303f2f){_0x48cb2a['push'](_0x48cb2a['shift']());}};_0x52a1a0(++_0xef57e3);}(_0xddc4,0xa7));var _0x4ddc=function(_0x429b63,_0x3ff026){_0x429b63=_0x429b63-0x0;var _0x703972=_0xddc4[_0x429b63];return _0x703972;};'use strict';var _=require('lodash');var util=require(_0x4ddc('0x0'));var logger=require(_0x4ddc('0x1'))(_0x4ddc('0x2'));var moment=require(_0x4ddc('0x3'));var BPromise=require(_0x4ddc('0x4'));var rp=require(_0x4ddc('0x5'));var attributes=require(_0x4ddc('0x6'));module[_0x4ddc('0x7')]=function(_0x3f0d2c,_0x26da6d){return _0x3f0d2c[_0x4ddc('0x8')]('SquareProject',attributes,{'tableName':_0x4ddc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4562=['util','../../config/logger','api','bluebird','request-promise','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4562,0x8c));var _0x2456=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4562[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2456('0x0'));var logger=require(_0x2456('0x1'))(_0x2456('0x2'));var moment=require('moment');var BPromise=require(_0x2456('0x3'));var rp=require(_0x2456('0x4'));var attributes=require(_0x2456('0x5'));module[_0x2456('0x6')]=function(_0x493d3c,_0x275a6b){return _0x493d3c[_0x2456('0x7')](_0x2456('0x8'),attributes,{'tableName':_0x2456('0x9'),'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 e109248..d82c38b 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(_0x21ed98,_0x4a4209){var _0x4012bf=function(_0x46a9df){while(--_0x46a9df){_0x21ed98['push'](_0x21ed98['shift']());}};_0x4012bf(++_0x4a4209);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x2bed50,_0x3f9526){var _0x384471=function(_0x576ec6){while(--_0x576ec6){_0x2bed50['push'](_0x2bed50['shift']());}};_0x384471(++_0x3f9526);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 94bb038..331bd6d 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 _0x720c=['removeListener','register','length','squareProject:','./squareProject.events','remove','update','emit'];(function(_0x29deb,_0x5669e3){var _0xf1667=function(_0x462361){while(--_0x462361){_0x29deb['push'](_0x29deb['shift']());}};_0xf1667(++_0x5669e3);}(_0x720c,0x154));var _0xc720=function(_0x4bc984,_0xd65bdd){_0x4bc984=_0x4bc984-0x0;var _0x500594=_0x720c[_0x4bc984];return _0x500594;};'use strict';var SquareProjectEvents=require(_0xc720('0x0'));var events=['save',_0xc720('0x1'),_0xc720('0x2')];function createListener(_0x304440,_0x127edb){return function(_0x5e0261){_0x127edb[_0xc720('0x3')](_0x304440,_0x5e0261);};}function removeListener(_0x2336e6,_0x3e4155){return function(){SquareProjectEvents[_0xc720('0x4')](_0x2336e6,_0x3e4155);};}exports[_0xc720('0x5')]=function(_0x6f8d9f){for(var _0x7d6830=0x0,_0x5bc8b0=events[_0xc720('0x6')];_0x7d6830<_0x5bc8b0;_0x7d6830++){var _0x8a01fc=events[_0x7d6830];var _0x10a2c8=createListener(_0xc720('0x7')+_0x8a01fc,_0x6f8d9f);SquareProjectEvents['on'](_0x8a01fc,_0x10a2c8);}}; \ No newline at end of file +var _0x7ee1=['length','./squareProject.events','remove','update','register'];(function(_0x7d1b2c,_0x2d2bde){var _0x5a2136=function(_0x4fff78){while(--_0x4fff78){_0x7d1b2c['push'](_0x7d1b2c['shift']());}};_0x5a2136(++_0x2d2bde);}(_0x7ee1,0xab));var _0x17ee=function(_0xa63da5,_0x548bb5){_0xa63da5=_0xa63da5-0x0;var _0x5e5034=_0x7ee1[_0xa63da5];return _0x5e5034;};'use strict';var SquareProjectEvents=require(_0x17ee('0x0'));var events=['save',_0x17ee('0x1'),_0x17ee('0x2')];function createListener(_0x455623,_0xe08ab1){return function(_0x45c9e3){_0xe08ab1['emit'](_0x455623,_0x45c9e3);};}function removeListener(_0x3a5743,_0x5172f0){return function(){SquareProjectEvents['removeListener'](_0x3a5743,_0x5172f0);};}exports[_0x17ee('0x3')]=function(_0x2e4db0){for(var _0x2efefb=0x0,_0x3e6b4c=events[_0x17ee('0x4')];_0x2efefb<_0x3e6b4c;_0x2efefb++){var _0x59b876=events[_0x2efefb];var _0x314088=createListener('squareProject:'+_0x59b876,_0x2e4db0);SquareProjectEvents['on'](_0x59b876,_0x314088);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index dbe6502..df4a1cd 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 _0x56fe=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','create','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x56fe,0x19b));var _0xe56f=function(_0x2f2230,_0x3d5f55){_0x2f2230=_0x2f2230-0x0;var _0x3f9712=_0x56fe[_0x2f2230];return _0x3f9712;};'use strict';var multer=require('multer');var util=require(_0xe56f('0x0'));var path=require(_0xe56f('0x1'));var timeout=require(_0xe56f('0x2'));var express=require('express');var router=express[_0xe56f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe56f('0x4'));var config=require(_0xe56f('0x5'));var controller=require('./squareRecording.controller');router[_0xe56f('0x6')]('/',auth[_0xe56f('0x7')](),controller[_0xe56f('0x8')]);router[_0xe56f('0x6')](_0xe56f('0x9'),auth[_0xe56f('0x7')](),controller['show']);router['get'](_0xe56f('0xa'),auth['isAuthenticated'](),controller[_0xe56f('0xb')]);router[_0xe56f('0xc')]('/',auth[_0xe56f('0x7')](),controller[_0xe56f('0xd')]);router['put'](_0xe56f('0x9'),auth[_0xe56f('0x7')](),controller[_0xe56f('0xe')]);router[_0xe56f('0xf')](_0xe56f('0x9'),auth[_0xe56f('0x7')](),controller[_0xe56f('0x10')]);module[_0xe56f('0x11')]=router; \ No newline at end of file +var _0x7639=['get','isAuthenticated','index','/:id','show','/:id/download','download','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller'];(function(_0x26c49b,_0x1316d2){var _0xa8ea6f=function(_0x1ca6e9){while(--_0x1ca6e9){_0x26c49b['push'](_0x26c49b['shift']());}};_0xa8ea6f(++_0x1316d2);}(_0x7639,0x14b));var _0x9763=function(_0x56853e,_0x39262a){_0x56853e=_0x56853e-0x0;var _0x5d7b8b=_0x7639[_0x56853e];return _0x5d7b8b;};'use strict';var multer=require(_0x9763('0x0'));var util=require('util');var path=require(_0x9763('0x1'));var timeout=require(_0x9763('0x2'));var express=require(_0x9763('0x3'));var router=express[_0x9763('0x4')]();var auth=require(_0x9763('0x5'));var interaction=require(_0x9763('0x6'));var config=require(_0x9763('0x7'));var controller=require(_0x9763('0x8'));router[_0x9763('0x9')]('/',auth[_0x9763('0xa')](),controller[_0x9763('0xb')]);router[_0x9763('0x9')](_0x9763('0xc'),auth[_0x9763('0xa')](),controller[_0x9763('0xd')]);router[_0x9763('0x9')](_0x9763('0xe'),auth['isAuthenticated'](),controller[_0x9763('0xf')]);router['post']('/',auth[_0x9763('0xa')](),controller['create']);router[_0x9763('0x10')](_0x9763('0xc'),auth[_0x9763('0xa')](),controller[_0x9763('0x11')]);router['delete']('/:id',auth[_0x9763('0xa')](),controller[_0x9763('0x12')]);module[_0x9763('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 2d214e6..74383d3 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 _0xfb02=['exports','STRING','sequelize'];(function(_0xa8a539,_0x3f6c33){var _0xa56b53=function(_0x51ab31){while(--_0x51ab31){_0xa8a539['push'](_0xa8a539['shift']());}};_0xa56b53(++_0x3f6c33);}(_0xfb02,0x182));var _0x2fb0=function(_0x27c0f8,_0xd1bd2f){_0x27c0f8=_0x27c0f8-0x0;var _0x426b4e=_0xfb02[_0x27c0f8];return _0x426b4e;};'use strict';var Sequelize=require(_0x2fb0('0x0'));module[_0x2fb0('0x1')]={'uniqueid':{'type':Sequelize[_0x2fb0('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2fb0('0x2')]},'context':{'type':Sequelize[_0x2fb0('0x2')]},'extension':{'type':Sequelize[_0x2fb0('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x2fb0('0x2')]},'dnid':{'type':Sequelize[_0x2fb0('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x2fb0('0x2')]},'filename':{'type':Sequelize[_0x2fb0('0x2')]},'savePath':{'type':Sequelize[_0x2fb0('0x2')]}}; \ No newline at end of file +var _0x0b78=['STRING','sequelize'];(function(_0x405c34,_0x5dd4ca){var _0xe35fb7=function(_0x5f175c){while(--_0x5f175c){_0x405c34['push'](_0x405c34['shift']());}};_0xe35fb7(++_0x5dd4ca);}(_0x0b78,0x69));var _0x80b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0b78[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x80b7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x80b7('0x1')]},'callerid':{'type':Sequelize[_0x80b7('0x1')]},'calleridname':{'type':Sequelize[_0x80b7('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x80b7('0x1')]},'accountcode':{'type':Sequelize[_0x80b7('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x80b7('0x1')]},'filename':{'type':Sequelize[_0x80b7('0x1')]},'savePath':{'type':Sequelize[_0x80b7('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 75d239b..8b6da09 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 _0x7a98=['type','VIRTUAL','field','merge','count','includeAll','include','rows','show','options','find','catch','create','body','download','../../components/encryptor','uniqueid','params','filename','format','%s.cypher','value','existsSync','decryptFile','savePath','secrets','ValidationError','SquareRecording\x20not\x20found','extname','unlink','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','send','index','SquareRecording','rawAttributes','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x7a98,0xc4));var _0x87a9=function(_0x2563a3,_0x2863fc){_0x2563a3=_0x2563a3-0x0;var _0x1b7e81=_0x7a98[_0x2563a3];return _0x1b7e81;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x87a9('0x0'));var rp=require(_0x87a9('0x1'));var moment=require(_0x87a9('0x2'));var BPromise=require(_0x87a9('0x3'));var Mustache=require('mustache');var util=require(_0x87a9('0x4'));var path=require(_0x87a9('0x5'));var sox=require(_0x87a9('0x6'));var csv=require(_0x87a9('0x7'));var ejs=require(_0x87a9('0x8'));var fs=require('fs');var _=require(_0x87a9('0x9'));var squel=require(_0x87a9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87a9('0xb'));var toCsv=require(_0x87a9('0x7'));var querystring=require('querystring');var Papa=require(_0x87a9('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x87a9('0xd'));var Redis=require(_0x87a9('0xe'));var qs=require(_0x87a9('0xf'));var logger=require(_0x87a9('0x10'))(_0x87a9('0x11'));var utils=require(_0x87a9('0x12'));var config=require(_0x87a9('0x13'));var db=require(_0x87a9('0x14'))['db'];function respondWithStatusCode(_0x19021a,_0x5c18d7){_0x5c18d7=_0x5c18d7||0xcc;return function(_0x30d8e4){if(_0x30d8e4){return _0x19021a['sendStatus'](_0x5c18d7);}return _0x19021a[_0x87a9('0x15')](_0x5c18d7)[_0x87a9('0x16')]();};}function respondWithResult(_0x3303b0,_0x3e4d67){_0x3e4d67=_0x3e4d67||0xc8;return function(_0x1639c3){if(_0x1639c3){return _0x3303b0[_0x87a9('0x15')](_0x3e4d67)[_0x87a9('0x17')](_0x1639c3);}};}function respondWithFilteredResult(_0x5ba95f,_0x412f4f){return function(_0x229d9a){if(_0x229d9a){var _0x9d5e7a=_0x229d9a['count'],_0x17ce7d=_0x412f4f[_0x87a9('0x18')],_0x11a454=_0x412f4f[_0x87a9('0x18')]+_0x412f4f[_0x87a9('0x19')],_0x359a04;if(_0x11a454>=_0x9d5e7a){_0x11a454=_0x9d5e7a;_0x359a04=0xc8;}else{_0x359a04=0xce;}_0x5ba95f[_0x87a9('0x15')](_0x359a04);return _0x5ba95f[_0x87a9('0x1a')](_0x87a9('0x1b'),_0x17ce7d+'-'+_0x11a454+'/'+_0x9d5e7a)[_0x87a9('0x17')](_0x229d9a);}return null;};}function patchUpdates(_0x5a343c){return function(_0x5062e6){try{jsonpatch['apply'](_0x5062e6,_0x5a343c,!![]);}catch(_0x1a5128){return BPromise['reject'](_0x1a5128);}return _0x5062e6['save']();};}function saveUpdates(_0x21b3fc,_0x581346){return function(_0x5c8802){if(_0x5c8802){return _0x5c8802[_0x87a9('0x1c')](_0x21b3fc)[_0x87a9('0x1d')](function(_0x43c03d){return _0x43c03d;});}return null;};}function removeEntity(_0x43af30,_0xfe63fc){return function(_0xfc3be0){if(_0xfc3be0){return _0xfc3be0[_0x87a9('0x1e')]()['then'](function(){_0x43af30[_0x87a9('0x15')](0xcc)[_0x87a9('0x16')]();});}};}function handleEntityNotFound(_0x3c5e0e,_0x4b7e9e){return function(_0x4a261b){if(!_0x4a261b){_0x3c5e0e[_0x87a9('0x1f')](0x194);}return _0x4a261b;};}function handleError(_0x1a7b95,_0x131a1f){_0x131a1f=_0x131a1f||0x1f4;return function(_0xa58469){logger[_0x87a9('0x20')](_0xa58469[_0x87a9('0x21')]);if(_0xa58469['name']){delete _0xa58469['name'];}_0x1a7b95[_0x87a9('0x15')](_0x131a1f)[_0x87a9('0x22')](_0xa58469);};}exports[_0x87a9('0x23')]=function(_0x3384a6,_0x530d23){var _0x3e85ff={},_0x1d5467={},_0x506d85={'count':0x0,'rows':[]};var _0x5d767c=db[_0x87a9('0x24')][_0x87a9('0x25')];_0x1d5467[_0x87a9('0x26')]=_[_0x87a9('0x27')](_0x5d767c);_0x1d5467[_0x87a9('0x28')]=_[_0x87a9('0x27')](_0x3384a6[_0x87a9('0x28')]);_0x1d5467['filters']=_['intersection'](_0x1d5467[_0x87a9('0x26')],_0x1d5467[_0x87a9('0x28')]);_0x3e85ff[_0x87a9('0x29')]=_[_0x87a9('0x2a')](_0x1d5467[_0x87a9('0x26')],qs['fields'](_0x3384a6[_0x87a9('0x28')]['fields']));_0x3e85ff[_0x87a9('0x29')]=_0x3e85ff[_0x87a9('0x29')][_0x87a9('0x2b')]?_0x3e85ff['attributes']:_0x1d5467['model'];if(!_0x3384a6[_0x87a9('0x28')][_0x87a9('0x2c')](_0x87a9('0x2d'))){_0x3e85ff[_0x87a9('0x19')]=qs[_0x87a9('0x19')](_0x3384a6[_0x87a9('0x28')]['limit']);_0x3e85ff['offset']=qs[_0x87a9('0x18')](_0x3384a6[_0x87a9('0x28')][_0x87a9('0x18')]);}_0x3e85ff[_0x87a9('0x2e')]=qs[_0x87a9('0x2f')](_0x3384a6[_0x87a9('0x28')][_0x87a9('0x2f')]);_0x3e85ff[_0x87a9('0x30')]=qs[_0x87a9('0x31')](_[_0x87a9('0x32')](_0x3384a6[_0x87a9('0x28')],_0x1d5467[_0x87a9('0x31')]));if(_0x3384a6['query'][_0x87a9('0x33')]){_0x3e85ff[_0x87a9('0x30')]=_['merge'](_0x3e85ff[_0x87a9('0x30')],{'$or':_[_0x87a9('0x34')](_0x5d767c,function(_0x40b80e){if(_0x40b80e[_0x87a9('0x35')]['key']!==_0x87a9('0x36')){var _0x5d0f14={};_0x5d0f14[_0x40b80e[_0x87a9('0x37')]]={'$like':'%'+_0x3384a6[_0x87a9('0x28')][_0x87a9('0x33')]+'%'};return _0x5d0f14;}})});}_0x3e85ff=_[_0x87a9('0x38')]({},_0x3e85ff,_0x3384a6['options']);var _0x21b205={'where':_0x3e85ff['where']};return db[_0x87a9('0x24')][_0x87a9('0x39')](_0x21b205)[_0x87a9('0x1d')](function(_0x310a49){_0x506d85[_0x87a9('0x39')]=_0x310a49;if(_0x3384a6[_0x87a9('0x28')][_0x87a9('0x3a')]){_0x3e85ff[_0x87a9('0x3b')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x3e85ff);})[_0x87a9('0x1d')](function(_0x5dc7b5){_0x506d85[_0x87a9('0x3c')]=_0x5dc7b5;return _0x506d85;})['then'](respondWithFilteredResult(_0x530d23,_0x3e85ff))['catch'](handleError(_0x530d23,null));};exports[_0x87a9('0x3d')]=function(_0x223b9d,_0x242aff){var _0x3d4f94={'raw':!![],'where':{'id':_0x223b9d['params']['id']}},_0x48d907={};_0x48d907[_0x87a9('0x26')]=_[_0x87a9('0x27')](db[_0x87a9('0x24')][_0x87a9('0x25')]);_0x48d907[_0x87a9('0x28')]=_[_0x87a9('0x27')](_0x223b9d[_0x87a9('0x28')]);_0x48d907[_0x87a9('0x31')]=_['intersection'](_0x48d907[_0x87a9('0x26')],_0x48d907[_0x87a9('0x28')]);_0x3d4f94['attributes']=_['intersection'](_0x48d907[_0x87a9('0x26')],qs['fields'](_0x223b9d[_0x87a9('0x28')]['fields']));_0x3d4f94[_0x87a9('0x29')]=_0x3d4f94[_0x87a9('0x29')]['length']?_0x3d4f94[_0x87a9('0x29')]:_0x48d907[_0x87a9('0x26')];if(_0x223b9d[_0x87a9('0x28')][_0x87a9('0x3a')]){_0x3d4f94[_0x87a9('0x3b')]=[{'all':!![]}];}_0x3d4f94=_[_0x87a9('0x38')]({},_0x3d4f94,_0x223b9d[_0x87a9('0x3e')]);return db[_0x87a9('0x24')][_0x87a9('0x3f')](_0x3d4f94)[_0x87a9('0x1d')](handleEntityNotFound(_0x242aff,null))[_0x87a9('0x1d')](respondWithResult(_0x242aff,null))[_0x87a9('0x40')](handleError(_0x242aff,null));};exports['create']=function(_0x5173c5,_0x3179e0){return db[_0x87a9('0x24')][_0x87a9('0x41')](_0x5173c5[_0x87a9('0x42')],{})[_0x87a9('0x1d')](respondWithResult(_0x3179e0,0xc9))[_0x87a9('0x40')](handleError(_0x3179e0,null));};exports[_0x87a9('0x1c')]=function(_0x2f5726,_0x10944b){if(_0x2f5726[_0x87a9('0x42')]['id']){delete _0x2f5726['body']['id'];}return db[_0x87a9('0x24')]['find']({'where':{'id':_0x2f5726['params']['id']}})[_0x87a9('0x1d')](handleEntityNotFound(_0x10944b,null))[_0x87a9('0x1d')](saveUpdates(_0x2f5726['body'],null))[_0x87a9('0x1d')](respondWithResult(_0x10944b,null))[_0x87a9('0x40')](handleError(_0x10944b,null));};exports[_0x87a9('0x1e')]=function(_0x2e54be,_0x19c88b){return db[_0x87a9('0x24')]['find']({'where':{'id':_0x2e54be['params']['id']}})[_0x87a9('0x1d')](handleEntityNotFound(_0x19c88b,null))['then'](removeEntity(_0x19c88b,null))[_0x87a9('0x40')](handleError(_0x19c88b,null));};exports[_0x87a9('0x43')]=function(_0x21a946,_0x5c94e0,_0x4ae42b){var _0x258fed=require(_0x87a9('0x44'));var _0x54e8ca=![];var _0x4266a5={};if(_0x21a946['query']['type']&&_0x21a946[_0x87a9('0x28')][_0x87a9('0x35')]===_0x87a9('0x45')){_0x4266a5[_0x87a9('0x45')]=_0x21a946[_0x87a9('0x46')]['id'];}else{_0x4266a5['id']=_0x21a946[_0x87a9('0x46')]['id'];}return db['SquareRecording'][_0x87a9('0x3f')]({'where':_0x4266a5,'attributes':['id','savePath',_0x87a9('0x47')],'raw':!![]})[_0x87a9('0x1d')](handleEntityNotFound(_0x5c94e0,null))[_0x87a9('0x1d')](function(_0x4fb396){if(_0x4fb396){var _0x2425b8=util[_0x87a9('0x48')](_0x87a9('0x49'),_0x4fb396[_0x87a9('0x4a')]);if(fs[_0x87a9('0x4b')](_0x2425b8)){_0x54e8ca=!![];return _0x258fed[_0x87a9('0x4c')](_0x2425b8,_0x4fb396[_0x87a9('0x4d')],config[_0x87a9('0x4e')]['recording'])['then'](function(){return _0x4fb396;});}return _0x4fb396;}})[_0x87a9('0x1d')](function(_0x3d844a){if(_0x3d844a){if(!fs[_0x87a9('0x4b')](_0x3d844a['savePath'])){throw new db['Sequelize'][(_0x87a9('0x4f'))](_0x87a9('0x50'));}if(_0x3d844a[_0x87a9('0x47')]){return _0x5c94e0['download'](_0x3d844a['savePath'],_0x3d844a[_0x87a9('0x47')]+path[_0x87a9('0x51')](_0x3d844a[_0x87a9('0x4d')]),function(){if(_0x54e8ca){fs[_0x87a9('0x52')](_0x3d844a[_0x87a9('0x4d')]);}});}else{return _0x5c94e0[_0x87a9('0x43')](_0x3d844a['savePath'],function(_0x5d2431){if(_0x54e8ca){fs[_0x87a9('0x52')](_0x3d844a[_0x87a9('0x4d')]);}});}}})[_0x87a9('0x40')](handleError(_0x5c94e0,null));}; \ No newline at end of file +var _0x9f28=['update','destroy','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','SquareRecording','then','includeAll','findAll','rows','show','rawAttributes','include','catch','create','body','find','params','download','../../components/encryptor','type','uniqueid','savePath','filename','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','apply','reject','save'];(function(_0x1bfe02,_0x4d908a){var _0xaf656a=function(_0x318773){while(--_0x318773){_0x1bfe02['push'](_0x1bfe02['shift']());}};_0xaf656a(++_0x4d908a);}(_0x9f28,0x197));var _0x89f2=function(_0x55120d,_0x2bed40){_0x55120d=_0x55120d-0x0;var _0x5e08d7=_0x9f28[_0x55120d];return _0x5e08d7;};'use strict';var pdf=require(_0x89f2('0x0'));var emlformat=require(_0x89f2('0x1'));var rimraf=require(_0x89f2('0x2'));var zipdir=require(_0x89f2('0x3'));var jsonpatch=require(_0x89f2('0x4'));var rp=require('request-promise');var moment=require(_0x89f2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x89f2('0x6'));var util=require(_0x89f2('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x89f2('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x89f2('0x9'));var squel=require(_0x89f2('0xa'));var crypto=require(_0x89f2('0xb'));var jsforce=require(_0x89f2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x89f2('0x8'));var querystring=require(_0x89f2('0xd'));var Papa=require(_0x89f2('0xe'));var authService=require(_0x89f2('0xf'));var hardwareService=require(_0x89f2('0x10'));var Redis=require(_0x89f2('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x89f2('0x12'))(_0x89f2('0x13'));var utils=require(_0x89f2('0x14'));var config=require(_0x89f2('0x15'));var db=require(_0x89f2('0x16'))['db'];function respondWithStatusCode(_0x3044f0,_0x18e01d){_0x18e01d=_0x18e01d||0xcc;return function(_0x93d236){if(_0x93d236){return _0x3044f0[_0x89f2('0x17')](_0x18e01d);}return _0x3044f0['status'](_0x18e01d)[_0x89f2('0x18')]();};}function respondWithResult(_0x3d7e46,_0x13386b){_0x13386b=_0x13386b||0xc8;return function(_0x143eeb){if(_0x143eeb){return _0x3d7e46[_0x89f2('0x19')](_0x13386b)[_0x89f2('0x1a')](_0x143eeb);}};}function respondWithFilteredResult(_0x3a3ec3,_0x5da44f){return function(_0x25d2a6){if(_0x25d2a6){var _0x27e710=_0x25d2a6[_0x89f2('0x1b')],_0x1e5274=_0x5da44f[_0x89f2('0x1c')],_0x350737=_0x5da44f[_0x89f2('0x1c')]+_0x5da44f[_0x89f2('0x1d')],_0x5a1eab;if(_0x350737>=_0x27e710){_0x350737=_0x27e710;_0x5a1eab=0xc8;}else{_0x5a1eab=0xce;}_0x3a3ec3['status'](_0x5a1eab);return _0x3a3ec3['set']('Content-Range',_0x1e5274+'-'+_0x350737+'/'+_0x27e710)[_0x89f2('0x1a')](_0x25d2a6);}return null;};}function patchUpdates(_0xbd594c){return function(_0x86c32b){try{jsonpatch[_0x89f2('0x1e')](_0x86c32b,_0xbd594c,!![]);}catch(_0x15b79f){return BPromise[_0x89f2('0x1f')](_0x15b79f);}return _0x86c32b[_0x89f2('0x20')]();};}function saveUpdates(_0x324579,_0x42cd1e){return function(_0x3b2d80){if(_0x3b2d80){return _0x3b2d80[_0x89f2('0x21')](_0x324579)['then'](function(_0x4d3cfa){return _0x4d3cfa;});}return null;};}function removeEntity(_0x471326,_0x1b872a){return function(_0xe1fc22){if(_0xe1fc22){return _0xe1fc22[_0x89f2('0x22')]()['then'](function(){_0x471326[_0x89f2('0x19')](0xcc)[_0x89f2('0x18')]();});}};}function handleEntityNotFound(_0x222e22,_0x5a0ed1){return function(_0x532216){if(!_0x532216){_0x222e22[_0x89f2('0x17')](0x194);}return _0x532216;};}function handleError(_0x445b94,_0xa2a638){_0xa2a638=_0xa2a638||0x1f4;return function(_0x50ad45){logger['error'](_0x50ad45[_0x89f2('0x23')]);if(_0x50ad45[_0x89f2('0x24')]){delete _0x50ad45[_0x89f2('0x24')];}_0x445b94[_0x89f2('0x19')](_0xa2a638)[_0x89f2('0x25')](_0x50ad45);};}exports[_0x89f2('0x26')]=function(_0x13d2bb,_0x215a3a){var _0x16ae1c={},_0x6acd01={},_0x4b0ba4={'count':0x0,'rows':[]};var _0x3af587=db['SquareRecording']['rawAttributes'];_0x6acd01[_0x89f2('0x27')]=_[_0x89f2('0x28')](_0x3af587);_0x6acd01[_0x89f2('0x29')]=_['keys'](_0x13d2bb[_0x89f2('0x29')]);_0x6acd01[_0x89f2('0x2a')]=_['intersection'](_0x6acd01[_0x89f2('0x27')],_0x6acd01[_0x89f2('0x29')]);_0x16ae1c['attributes']=_[_0x89f2('0x2b')](_0x6acd01[_0x89f2('0x27')],qs[_0x89f2('0x2c')](_0x13d2bb['query'][_0x89f2('0x2c')]));_0x16ae1c[_0x89f2('0x2d')]=_0x16ae1c[_0x89f2('0x2d')][_0x89f2('0x2e')]?_0x16ae1c['attributes']:_0x6acd01[_0x89f2('0x27')];if(!_0x13d2bb[_0x89f2('0x29')][_0x89f2('0x2f')](_0x89f2('0x30'))){_0x16ae1c[_0x89f2('0x1d')]=qs[_0x89f2('0x1d')](_0x13d2bb[_0x89f2('0x29')][_0x89f2('0x1d')]);_0x16ae1c[_0x89f2('0x1c')]=qs[_0x89f2('0x1c')](_0x13d2bb['query'][_0x89f2('0x1c')]);}_0x16ae1c[_0x89f2('0x31')]=qs[_0x89f2('0x32')](_0x13d2bb[_0x89f2('0x29')]['sort']);_0x16ae1c[_0x89f2('0x33')]=qs[_0x89f2('0x2a')](_[_0x89f2('0x34')](_0x13d2bb[_0x89f2('0x29')],_0x6acd01[_0x89f2('0x2a')]));if(_0x13d2bb[_0x89f2('0x29')][_0x89f2('0x35')]){_0x16ae1c[_0x89f2('0x33')]=_[_0x89f2('0x36')](_0x16ae1c[_0x89f2('0x33')],{'$or':_[_0x89f2('0x37')](_0x3af587,function(_0x550940){if(_0x550940['type'][_0x89f2('0x38')]!==_0x89f2('0x39')){var _0x3932cd={};_0x3932cd[_0x550940['field']]={'$like':'%'+_0x13d2bb[_0x89f2('0x29')][_0x89f2('0x35')]+'%'};return _0x3932cd;}})});}_0x16ae1c=_['merge']({},_0x16ae1c,_0x13d2bb[_0x89f2('0x3a')]);var _0x1f9d12={'where':_0x16ae1c['where']};return db[_0x89f2('0x3b')][_0x89f2('0x1b')](_0x1f9d12)[_0x89f2('0x3c')](function(_0x2fd0e5){_0x4b0ba4[_0x89f2('0x1b')]=_0x2fd0e5;if(_0x13d2bb[_0x89f2('0x29')][_0x89f2('0x3d')]){_0x16ae1c['include']=[{'all':!![]}];}return db[_0x89f2('0x3b')][_0x89f2('0x3e')](_0x16ae1c);})[_0x89f2('0x3c')](function(_0x53269b){_0x4b0ba4[_0x89f2('0x3f')]=_0x53269b;return _0x4b0ba4;})[_0x89f2('0x3c')](respondWithFilteredResult(_0x215a3a,_0x16ae1c))['catch'](handleError(_0x215a3a,null));};exports[_0x89f2('0x40')]=function(_0x2fd92a,_0x4ba639){var _0x3e98aa={'raw':!![],'where':{'id':_0x2fd92a['params']['id']}},_0x33ffeb={};_0x33ffeb[_0x89f2('0x27')]=_[_0x89f2('0x28')](db[_0x89f2('0x3b')][_0x89f2('0x41')]);_0x33ffeb[_0x89f2('0x29')]=_[_0x89f2('0x28')](_0x2fd92a[_0x89f2('0x29')]);_0x33ffeb['filters']=_['intersection'](_0x33ffeb[_0x89f2('0x27')],_0x33ffeb[_0x89f2('0x29')]);_0x3e98aa[_0x89f2('0x2d')]=_[_0x89f2('0x2b')](_0x33ffeb[_0x89f2('0x27')],qs['fields'](_0x2fd92a[_0x89f2('0x29')]['fields']));_0x3e98aa['attributes']=_0x3e98aa[_0x89f2('0x2d')][_0x89f2('0x2e')]?_0x3e98aa[_0x89f2('0x2d')]:_0x33ffeb[_0x89f2('0x27')];if(_0x2fd92a['query'][_0x89f2('0x3d')]){_0x3e98aa[_0x89f2('0x42')]=[{'all':!![]}];}_0x3e98aa=_[_0x89f2('0x36')]({},_0x3e98aa,_0x2fd92a[_0x89f2('0x3a')]);return db['SquareRecording']['find'](_0x3e98aa)[_0x89f2('0x3c')](handleEntityNotFound(_0x4ba639,null))[_0x89f2('0x3c')](respondWithResult(_0x4ba639,null))[_0x89f2('0x43')](handleError(_0x4ba639,null));};exports[_0x89f2('0x44')]=function(_0x4ca040,_0x2c74dd){return db['SquareRecording'][_0x89f2('0x44')](_0x4ca040[_0x89f2('0x45')],{})[_0x89f2('0x3c')](respondWithResult(_0x2c74dd,0xc9))[_0x89f2('0x43')](handleError(_0x2c74dd,null));};exports[_0x89f2('0x21')]=function(_0x4c6e95,_0x244250){if(_0x4c6e95['body']['id']){delete _0x4c6e95[_0x89f2('0x45')]['id'];}return db['SquareRecording'][_0x89f2('0x46')]({'where':{'id':_0x4c6e95[_0x89f2('0x47')]['id']}})[_0x89f2('0x3c')](handleEntityNotFound(_0x244250,null))[_0x89f2('0x3c')](saveUpdates(_0x4c6e95[_0x89f2('0x45')],null))['then'](respondWithResult(_0x244250,null))[_0x89f2('0x43')](handleError(_0x244250,null));};exports['destroy']=function(_0x408fd8,_0x25519b){return db[_0x89f2('0x3b')][_0x89f2('0x46')]({'where':{'id':_0x408fd8['params']['id']}})[_0x89f2('0x3c')](handleEntityNotFound(_0x25519b,null))[_0x89f2('0x3c')](removeEntity(_0x25519b,null))[_0x89f2('0x43')](handleError(_0x25519b,null));};exports[_0x89f2('0x48')]=function(_0x30c209,_0x10767f,_0x174aee){var _0x4fdaf7=require(_0x89f2('0x49'));var _0x4ad34f=![];var _0x1279d8={};if(_0x30c209['query']['type']&&_0x30c209[_0x89f2('0x29')][_0x89f2('0x4a')]===_0x89f2('0x4b')){_0x1279d8['uniqueid']=_0x30c209['params']['id'];}else{_0x1279d8['id']=_0x30c209[_0x89f2('0x47')]['id'];}return db['SquareRecording']['find']({'where':_0x1279d8,'attributes':['id',_0x89f2('0x4c'),_0x89f2('0x4d')],'raw':!![]})[_0x89f2('0x3c')](handleEntityNotFound(_0x10767f,null))['then'](function(_0x197a7c){if(_0x197a7c){var _0xcd6c79=util['format']('%s.cypher',_0x197a7c[_0x89f2('0x4e')]);if(fs[_0x89f2('0x4f')](_0xcd6c79)){_0x4ad34f=!![];return _0x4fdaf7[_0x89f2('0x50')](_0xcd6c79,_0x197a7c['savePath'],config[_0x89f2('0x51')][_0x89f2('0x52')])['then'](function(){return _0x197a7c;});}return _0x197a7c;}})[_0x89f2('0x3c')](function(_0x383085){if(_0x383085){if(!fs[_0x89f2('0x4f')](_0x383085[_0x89f2('0x4c')])){throw new db[(_0x89f2('0x53'))][(_0x89f2('0x54'))](_0x89f2('0x55'));}if(_0x383085[_0x89f2('0x4d')]){return _0x10767f[_0x89f2('0x48')](_0x383085[_0x89f2('0x4c')],_0x383085[_0x89f2('0x4d')]+path[_0x89f2('0x56')](_0x383085[_0x89f2('0x4c')]),function(){if(_0x4ad34f){fs[_0x89f2('0x57')](_0x383085[_0x89f2('0x4c')]);}});}else{return _0x10767f['download'](_0x383085['savePath'],function(_0xde8ef5){if(_0x4ad34f){fs[_0x89f2('0x57')](_0x383085[_0x89f2('0x4c')]);}});}}})['catch'](handleError(_0x10767f,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index af97520..fd8e2cc 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 _0x96aa=['request-promise','./squareRecording.attributes','SquareRecording','square_recordings','lodash','util','api','moment','bluebird'];(function(_0x4e76da,_0x291b71){var _0x5f14e8=function(_0x30ad0f){while(--_0x30ad0f){_0x4e76da['push'](_0x4e76da['shift']());}};_0x5f14e8(++_0x291b71);}(_0x96aa,0x67));var _0xa96a=function(_0x37df27,_0x4174f2){_0x37df27=_0x37df27-0x0;var _0x583292=_0x96aa[_0x37df27];return _0x583292;};'use strict';var _=require(_0xa96a('0x0'));var util=require(_0xa96a('0x1'));var logger=require('../../config/logger')(_0xa96a('0x2'));var moment=require(_0xa96a('0x3'));var BPromise=require(_0xa96a('0x4'));var rp=require(_0xa96a('0x5'));var attributes=require(_0xa96a('0x6'));module['exports']=function(_0x1ce4a1,_0x1079a5){return _0x1ce4a1['define'](_0xa96a('0x7'),attributes,{'tableName':_0xa96a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd68=['square_recordings','lodash','../../config/logger','api','moment','bluebird','./squareRecording.attributes','exports','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd68,0x196));var _0x8dd6=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0xdd68[_0x514260];return _0x4ac81b;};'use strict';var _=require(_0x8dd6('0x0'));var util=require('util');var logger=require(_0x8dd6('0x1'))(_0x8dd6('0x2'));var moment=require(_0x8dd6('0x3'));var BPromise=require(_0x8dd6('0x4'));var rp=require('request-promise');var attributes=require(_0x8dd6('0x5'));module[_0x8dd6('0x6')]=function(_0x5c7c72,_0x310895){return _0x5c7c72[_0x8dd6('0x7')]('SquareRecording',attributes,{'tableName':_0x8dd6('0x8'),'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 35b7a04..8395662 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 _0x5199=['client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateSquareRecording','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x337ef2,_0x242de8){var _0x1ba8bf=function(_0x59eca5){while(--_0x59eca5){_0x337ef2['push'](_0x337ef2['shift']());}};_0x1ba8bf(++_0x242de8);}(_0x5199,0x15e));var _0x9519=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5199[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x9519('0x0'));var util=require(_0x9519('0x1'));var moment=require(_0x9519('0x2'));var BPromise=require('bluebird');var rs=require(_0x9519('0x3'));var fs=require('fs');var Redis=require(_0x9519('0x4'));var db=require(_0x9519('0x5'))['db'];var utils=require(_0x9519('0x6'));var logger=require(_0x9519('0x7'))('rpc');var config=require(_0x9519('0x8'));var jayson=require(_0x9519('0x9'));var client=jayson[_0x9519('0xa')][_0x9519('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3dd02e,_0xf5eb12,_0x11cd82){return new BPromise(function(_0xce482b,_0x50701e){return client[_0x9519('0xc')](_0x3dd02e,_0x11cd82)[_0x9519('0xd')](function(_0x489e6c){logger[_0x9519('0xe')](_0x9519('0xf'),_0xf5eb12,_0x9519('0x10'));logger[_0x9519('0x11')](_0x9519('0x12'),_0xf5eb12,'request\x20sent',JSON[_0x9519('0x13')](_0x489e6c));if(_0x489e6c[_0x9519('0x14')]){if(_0x489e6c['error'][_0x9519('0x15')]===0x1f4){logger['error'](_0x9519('0xf'),_0xf5eb12,_0x489e6c[_0x9519('0x14')][_0x9519('0x16')]);return _0x50701e(_0x489e6c[_0x9519('0x14')][_0x9519('0x16')]);}logger[_0x9519('0x14')](_0x9519('0xf'),_0xf5eb12,_0x489e6c[_0x9519('0x14')][_0x9519('0x16')]);return _0xce482b(_0x489e6c[_0x9519('0x14')][_0x9519('0x16')]);}else{logger[_0x9519('0xe')](_0x9519('0xf'),_0xf5eb12,_0x9519('0x10'));_0xce482b(_0x489e6c[_0x9519('0x17')][_0x9519('0x16')]);}})[_0x9519('0x18')](function(_0x539520){logger['error']('SquareRecording,\x20%s,\x20%s',_0xf5eb12,_0x539520);_0x50701e(_0x539520);});});}exports['CreateSquareRecording']=function(_0x1da20a){var _0x40d7c6=this;return new Promise(function(_0xbd0e18,_0x493266){return db['SquareRecording'][_0x9519('0x19')](_0x1da20a[_0x9519('0x1a')],{'raw':_0x1da20a[_0x9519('0x1b')]?_0x1da20a[_0x9519('0x1b')][_0x9519('0x1c')]===undefined?!![]:![]:!![]})[_0x9519('0xd')](function(_0x3f053a){logger[_0x9519('0xe')](_0x9519('0x1d'),_0x1da20a);logger[_0x9519('0x11')]('CreateSquareRecording',_0x1da20a,JSON[_0x9519('0x13')](_0x3f053a));_0xbd0e18(_0x3f053a);})[_0x9519('0x18')](function(_0x393786){logger[_0x9519('0x14')]('CreateSquareRecording',_0x393786['message'],_0x1da20a);_0x493266(_0x40d7c6[_0x9519('0x14')](0x1f4,_0x393786['message']));});});}; \ No newline at end of file +var _0xb848=['code','message','result','CreateSquareRecording','SquareRecording','create','body','options','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x326b87,_0x55a6c0){var _0x63c10b=function(_0x3a24ef){while(--_0x3a24ef){_0x326b87['push'](_0x326b87['shift']());}};_0x63c10b(++_0x55a6c0);}(_0xb848,0x1c9));var _0x8b84=function(_0x34d172,_0x5426cb){_0x34d172=_0x34d172-0x0;var _0x379f05=_0xb848[_0x34d172];return _0x379f05;};'use strict';var _=require('lodash');var util=require(_0x8b84('0x0'));var moment=require('moment');var BPromise=require(_0x8b84('0x1'));var rs=require(_0x8b84('0x2'));var fs=require('fs');var Redis=require(_0x8b84('0x3'));var db=require(_0x8b84('0x4'))['db'];var utils=require(_0x8b84('0x5'));var logger=require(_0x8b84('0x6'))(_0x8b84('0x7'));var config=require(_0x8b84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b84('0x9')][_0x8b84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1aa5de,_0xdab3b1,_0x524ea8){return new BPromise(function(_0x258813,_0x47a965){return client[_0x8b84('0xb')](_0x1aa5de,_0x524ea8)[_0x8b84('0xc')](function(_0x3dc347){logger[_0x8b84('0xd')](_0x8b84('0xe'),_0xdab3b1,_0x8b84('0xf'));logger[_0x8b84('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0xdab3b1,_0x8b84('0xf'),JSON[_0x8b84('0x11')](_0x3dc347));if(_0x3dc347['error']){if(_0x3dc347[_0x8b84('0x12')][_0x8b84('0x13')]===0x1f4){logger[_0x8b84('0x12')](_0x8b84('0xe'),_0xdab3b1,_0x3dc347['error'][_0x8b84('0x14')]);return _0x47a965(_0x3dc347['error']['message']);}logger[_0x8b84('0x12')](_0x8b84('0xe'),_0xdab3b1,_0x3dc347[_0x8b84('0x12')]['message']);return _0x258813(_0x3dc347[_0x8b84('0x12')][_0x8b84('0x14')]);}else{logger[_0x8b84('0xd')](_0x8b84('0xe'),_0xdab3b1,_0x8b84('0xf'));_0x258813(_0x3dc347[_0x8b84('0x15')][_0x8b84('0x14')]);}})['catch'](function(_0x3d683d){logger[_0x8b84('0x12')](_0x8b84('0xe'),_0xdab3b1,_0x3d683d);_0x47a965(_0x3d683d);});});}exports[_0x8b84('0x16')]=function(_0x2de400){var _0xc2aef7=this;return new Promise(function(_0x365edb,_0x58b4a0){return db[_0x8b84('0x17')][_0x8b84('0x18')](_0x2de400[_0x8b84('0x19')],{'raw':_0x2de400[_0x8b84('0x1a')]?_0x2de400[_0x8b84('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8b84('0xc')](function(_0x46d7bf){logger['info']('CreateSquareRecording',_0x2de400);logger['debug'](_0x8b84('0x16'),_0x2de400,JSON[_0x8b84('0x11')](_0x46d7bf));_0x365edb(_0x46d7bf);})[_0x8b84('0x1b')](function(_0x1cc779){logger[_0x8b84('0x12')]('CreateSquareRecording',_0x1cc779['message'],_0x2de400);_0x58b4a0(_0xc2aef7['error'](0x1f4,_0x1cc779['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 255cad9..b002e80 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 _0x6e26=['../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xb6a1fc,_0x270184){var _0x45269f=function(_0x4b7760){while(--_0x4b7760){_0xb6a1fc['push'](_0xb6a1fc['shift']());}};_0x45269f(++_0x270184);}(_0x6e26,0x99));var _0x66e2=function(_0x2b9162,_0x197861){_0x2b9162=_0x2b9162-0x0;var _0x9b2b89=_0x6e26[_0x2b9162];return _0x9b2b89;};'use strict';var multer=require(_0x66e2('0x0'));var util=require(_0x66e2('0x1'));var path=require(_0x66e2('0x2'));var timeout=require(_0x66e2('0x3'));var express=require('express');var router=express[_0x66e2('0x4')]();var auth=require(_0x66e2('0x5'));var interaction=require(_0x66e2('0x6'));var config=require(_0x66e2('0x7'));var controller=require(_0x66e2('0x8'));router[_0x66e2('0x9')]('/',auth[_0x66e2('0xa')](),controller[_0x66e2('0xb')]);router[_0x66e2('0x9')](_0x66e2('0xc'),auth[_0x66e2('0xa')](),controller[_0x66e2('0xd')]);router['get']('/:id',auth[_0x66e2('0xa')](),controller['show']);router['post']('/',auth[_0x66e2('0xa')](),controller['create']);router[_0x66e2('0xe')](_0x66e2('0xf'),auth[_0x66e2('0xa')](),controller[_0x66e2('0x10')]);router[_0x66e2('0x11')]('/:id',auth[_0x66e2('0xa')](),controller[_0x66e2('0x12')]);module[_0x66e2('0x13')]=router; \ No newline at end of file +var _0x9331=['Router','../../components/auth/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2135e6,_0x462678){var _0x4a6399=function(_0x5f3fbb){while(--_0x5f3fbb){_0x2135e6['push'](_0x2135e6['shift']());}};_0x4a6399(++_0x462678);}(_0x9331,0x18a));var _0x1933=function(_0x5a433c,_0x423be6){_0x5a433c=_0x5a433c-0x0;var _0x310003=_0x9331[_0x5a433c];return _0x310003;};'use strict';var multer=require(_0x1933('0x0'));var util=require(_0x1933('0x1'));var path=require(_0x1933('0x2'));var timeout=require(_0x1933('0x3'));var express=require(_0x1933('0x4'));var router=express[_0x1933('0x5')]();var auth=require(_0x1933('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1933('0x7'));var controller=require(_0x1933('0x8'));router[_0x1933('0x9')]('/',auth[_0x1933('0xa')](),controller[_0x1933('0xb')]);router[_0x1933('0x9')]('/describe',auth[_0x1933('0xa')](),controller['describe']);router['get']('/:id',auth[_0x1933('0xa')](),controller[_0x1933('0xc')]);router[_0x1933('0xd')]('/',auth[_0x1933('0xa')](),controller[_0x1933('0xe')]);router['put'](_0x1933('0xf'),auth[_0x1933('0xa')](),controller['update']);router[_0x1933('0x10')]('/:id',auth[_0x1933('0xa')](),controller[_0x1933('0x11')]);module[_0x1933('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 33287ec..e8c9fa6 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 _0x192f=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x192f,0xd6));var _0xf192=function(_0x51a97d,_0x2d18ab){_0x51a97d=_0x51a97d-0x0;var _0x348345=_0x192f[_0x51a97d];return _0x348345;};'use strict';var Sequelize=require(_0xf192('0x0'));module['exports']={'network':{'type':Sequelize[_0xf192('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xf192('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf192('0x1')]},'uniqueid':{'type':Sequelize[_0xf192('0x1')]},'version':{'type':Sequelize[_0xf192('0x1')]},'callerid':{'type':Sequelize[_0xf192('0x1')]},'calleridname':{'type':Sequelize[_0xf192('0x1')]},'callingpres':{'type':Sequelize[_0xf192('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xf192('0x1')]},'callingtns':{'type':Sequelize[_0xf192('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xf192('0x1')]},'context':{'type':Sequelize[_0xf192('0x1')]},'extension':{'type':Sequelize[_0xf192('0x1')]},'priority':{'type':Sequelize[_0xf192('0x1')]},'enhanced':{'type':Sequelize[_0xf192('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xf192('0x1')]},'joinAt':{'type':Sequelize[_0xf192('0x2')]},'leaveAt':{'type':Sequelize[_0xf192('0x2')]},'bot':{'type':Sequelize[_0xf192('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8f1f=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x31d291,_0x409b65){var _0x562a9f=function(_0x2f6a9e){while(--_0x2f6a9e){_0x31d291['push'](_0x31d291['shift']());}};_0x562a9f(++_0x409b65);}(_0x8f1f,0xe1));var _0xf8f1=function(_0x1299c9,_0x9873c9){_0x1299c9=_0x1299c9-0x0;var _0x2e73ad=_0x8f1f[_0x1299c9];return _0x2e73ad;};'use strict';var Sequelize=require(_0xf8f1('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xf8f1('0x1')]},'request':{'type':Sequelize[_0xf8f1('0x1')]},'channel':{'type':Sequelize[_0xf8f1('0x1')]},'language':{'type':Sequelize[_0xf8f1('0x1')]},'type':{'type':Sequelize[_0xf8f1('0x1')]},'uniqueid':{'type':Sequelize[_0xf8f1('0x1')]},'version':{'type':Sequelize[_0xf8f1('0x1')]},'callerid':{'type':Sequelize[_0xf8f1('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xf8f1('0x1')]},'callingani2':{'type':Sequelize[_0xf8f1('0x1')]},'callington':{'type':Sequelize[_0xf8f1('0x1')]},'callingtns':{'type':Sequelize[_0xf8f1('0x1')]},'dnid':{'type':Sequelize[_0xf8f1('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf8f1('0x1')]},'extension':{'type':Sequelize[_0xf8f1('0x1')]},'priority':{'type':Sequelize[_0xf8f1('0x1')]},'enhanced':{'type':Sequelize[_0xf8f1('0x1')]},'accountcode':{'type':Sequelize[_0xf8f1('0x1')]},'threadid':{'type':Sequelize[_0xf8f1('0x1')]},'project_name':{'type':Sequelize[_0xf8f1('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf8f1('0x2')]},'bot':{'type':Sequelize[_0xf8f1('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 15a11ef..4cc0028 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 _0xc2a2=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','save','update','then','end','error','stack','name','send','SquareReport','keys','filters','model','query','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','key','field','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','fields','find','body','destroy','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','lodash'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xc2a2,0x106));var _0x2c2a=function(_0x3a8dcc,_0x473ff5){_0x3a8dcc=_0x3a8dcc-0x0;var _0x446416=_0xc2a2[_0x3a8dcc];return _0x446416;};'use strict';var pdf=require(_0x2c2a('0x0'));var emlformat=require(_0x2c2a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2c2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c2a('0x3'));var moment=require(_0x2c2a('0x4'));var BPromise=require(_0x2c2a('0x5'));var Mustache=require('mustache');var util=require(_0x2c2a('0x6'));var path=require(_0x2c2a('0x7'));var sox=require(_0x2c2a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2c2a('0x9'));var squel=require(_0x2c2a('0xa'));var crypto=require(_0x2c2a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2c2a('0xc'));var toCsv=require(_0x2c2a('0xd'));var querystring=require(_0x2c2a('0xe'));var Papa=require(_0x2c2a('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x2c2a('0x10'));var qs=require(_0x2c2a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x2c2a('0x12'));var config=require(_0x2c2a('0x13'));var db=require(_0x2c2a('0x14'))['db'];function respondWithStatusCode(_0x2d7577,_0x20a60b){_0x20a60b=_0x20a60b||0xcc;return function(_0x11df26){if(_0x11df26){return _0x2d7577[_0x2c2a('0x15')](_0x20a60b);}return _0x2d7577['status'](_0x20a60b)['end']();};}function respondWithResult(_0x1a490a,_0x35bda4){_0x35bda4=_0x35bda4||0xc8;return function(_0x5090c8){if(_0x5090c8){return _0x1a490a[_0x2c2a('0x16')](_0x35bda4)[_0x2c2a('0x17')](_0x5090c8);}};}function respondWithFilteredResult(_0x52f872,_0x272954){return function(_0x318dc5){if(_0x318dc5){var _0x2ed3de=_0x318dc5[_0x2c2a('0x18')],_0x4e1833=_0x272954[_0x2c2a('0x19')],_0x174883=_0x272954[_0x2c2a('0x19')]+_0x272954['limit'],_0x3846fb;if(_0x174883>=_0x2ed3de){_0x174883=_0x2ed3de;_0x3846fb=0xc8;}else{_0x3846fb=0xce;}_0x52f872[_0x2c2a('0x16')](_0x3846fb);return _0x52f872[_0x2c2a('0x1a')](_0x2c2a('0x1b'),_0x4e1833+'-'+_0x174883+'/'+_0x2ed3de)[_0x2c2a('0x17')](_0x318dc5);}return null;};}function patchUpdates(_0x53fcf1){return function(_0x177836){try{jsonpatch['apply'](_0x177836,_0x53fcf1,!![]);}catch(_0x5cca32){return BPromise['reject'](_0x5cca32);}return _0x177836[_0x2c2a('0x1c')]();};}function saveUpdates(_0x33a3be,_0x150b12){return function(_0x11279b){if(_0x11279b){return _0x11279b[_0x2c2a('0x1d')](_0x33a3be)['then'](function(_0x54da3b){return _0x54da3b;});}return null;};}function removeEntity(_0x4999d2,_0x22c3bf){return function(_0x37e72e){if(_0x37e72e){return _0x37e72e['destroy']()[_0x2c2a('0x1e')](function(){_0x4999d2[_0x2c2a('0x16')](0xcc)[_0x2c2a('0x1f')]();});}};}function handleEntityNotFound(_0x5b7e1a,_0x1e2236){return function(_0x2f94e3){if(!_0x2f94e3){_0x5b7e1a[_0x2c2a('0x15')](0x194);}return _0x2f94e3;};}function handleError(_0x2b6d25,_0xeefb20){_0xeefb20=_0xeefb20||0x1f4;return function(_0x22ff40){logger[_0x2c2a('0x20')](_0x22ff40[_0x2c2a('0x21')]);if(_0x22ff40[_0x2c2a('0x22')]){delete _0x22ff40[_0x2c2a('0x22')];}_0x2b6d25[_0x2c2a('0x16')](_0xeefb20)[_0x2c2a('0x23')](_0x22ff40);};}exports['index']=function(_0x45a8ca,_0xf17d48){var _0x36a190={},_0x689547={},_0x295648={'count':0x0,'rows':[]};var _0x7055ea=db[_0x2c2a('0x24')]['rawAttributes'];_0x689547['model']=_[_0x2c2a('0x25')](_0x7055ea);_0x689547['query']=_[_0x2c2a('0x25')](_0x45a8ca['query']);_0x689547[_0x2c2a('0x26')]=_['intersection'](_0x689547[_0x2c2a('0x27')],_0x689547[_0x2c2a('0x28')]);_0x36a190['attributes']=_['intersection'](_0x689547[_0x2c2a('0x27')],qs['fields'](_0x45a8ca[_0x2c2a('0x28')]['fields']));_0x36a190['attributes']=_0x36a190[_0x2c2a('0x29')][_0x2c2a('0x2a')]?_0x36a190[_0x2c2a('0x29')]:_0x689547[_0x2c2a('0x27')];if(!_0x45a8ca[_0x2c2a('0x28')][_0x2c2a('0x2b')]('nolimit')){_0x36a190[_0x2c2a('0x2c')]=qs[_0x2c2a('0x2c')](_0x45a8ca[_0x2c2a('0x28')][_0x2c2a('0x2c')]);_0x36a190['offset']=qs[_0x2c2a('0x19')](_0x45a8ca[_0x2c2a('0x28')][_0x2c2a('0x19')]);}_0x36a190[_0x2c2a('0x2d')]=qs[_0x2c2a('0x2e')](_0x45a8ca[_0x2c2a('0x28')]['sort']);_0x36a190[_0x2c2a('0x2f')]=qs[_0x2c2a('0x26')](_[_0x2c2a('0x30')](_0x45a8ca['query'],_0x689547['filters']));if(_0x45a8ca[_0x2c2a('0x28')][_0x2c2a('0x31')]){_0x36a190[_0x2c2a('0x2f')]=_[_0x2c2a('0x32')](_0x36a190[_0x2c2a('0x2f')],{'$or':_['map'](_0x7055ea,function(_0x198609){if(_0x198609[_0x2c2a('0x33')][_0x2c2a('0x34')]!=='VIRTUAL'){var _0x48fbbd={};_0x48fbbd[_0x198609[_0x2c2a('0x35')]]={'$like':'%'+_0x45a8ca[_0x2c2a('0x28')][_0x2c2a('0x31')]+'%'};return _0x48fbbd;}})});}_0x36a190=_[_0x2c2a('0x32')]({},_0x36a190,_0x45a8ca['options']);var _0x23875a={'where':_0x36a190[_0x2c2a('0x2f')]};return db[_0x2c2a('0x24')]['count'](_0x23875a)['then'](function(_0x2770a4){_0x295648[_0x2c2a('0x18')]=_0x2770a4;if(_0x45a8ca[_0x2c2a('0x28')][_0x2c2a('0x36')]){_0x36a190[_0x2c2a('0x37')]=[{'all':!![]}];}return db[_0x2c2a('0x24')][_0x2c2a('0x38')](_0x36a190);})[_0x2c2a('0x1e')](function(_0x5c4682){_0x295648[_0x2c2a('0x39')]=_0x5c4682;return _0x295648;})[_0x2c2a('0x1e')](respondWithFilteredResult(_0xf17d48,_0x36a190))[_0x2c2a('0x3a')](handleError(_0xf17d48,null));};exports[_0x2c2a('0x3b')]=function(_0x4de64c,_0x422cc1){var _0x399262={'raw':!![],'where':{'id':_0x4de64c[_0x2c2a('0x3c')]['id']}},_0xa9a082={};_0xa9a082[_0x2c2a('0x27')]=_[_0x2c2a('0x25')](db[_0x2c2a('0x24')][_0x2c2a('0x3d')]);_0xa9a082['query']=_['keys'](_0x4de64c[_0x2c2a('0x28')]);_0xa9a082[_0x2c2a('0x26')]=_[_0x2c2a('0x3e')](_0xa9a082[_0x2c2a('0x27')],_0xa9a082['query']);_0x399262[_0x2c2a('0x29')]=_[_0x2c2a('0x3e')](_0xa9a082[_0x2c2a('0x27')],qs[_0x2c2a('0x3f')](_0x4de64c[_0x2c2a('0x28')][_0x2c2a('0x3f')]));_0x399262[_0x2c2a('0x29')]=_0x399262[_0x2c2a('0x29')][_0x2c2a('0x2a')]?_0x399262[_0x2c2a('0x29')]:_0xa9a082[_0x2c2a('0x27')];if(_0x4de64c[_0x2c2a('0x28')][_0x2c2a('0x36')]){_0x399262[_0x2c2a('0x37')]=[{'all':!![]}];}_0x399262=_[_0x2c2a('0x32')]({},_0x399262,_0x4de64c['options']);return db[_0x2c2a('0x24')][_0x2c2a('0x40')](_0x399262)[_0x2c2a('0x1e')](handleEntityNotFound(_0x422cc1,null))[_0x2c2a('0x1e')](respondWithResult(_0x422cc1,null))[_0x2c2a('0x3a')](handleError(_0x422cc1,null));};exports['create']=function(_0x44830f,_0x4166f3){return db[_0x2c2a('0x24')]['create'](_0x44830f[_0x2c2a('0x41')],{})['then'](respondWithResult(_0x4166f3,0xc9))['catch'](handleError(_0x4166f3,null));};exports[_0x2c2a('0x1d')]=function(_0x39901d,_0x1712f2){if(_0x39901d[_0x2c2a('0x41')]['id']){delete _0x39901d[_0x2c2a('0x41')]['id'];}return db[_0x2c2a('0x24')][_0x2c2a('0x40')]({'where':{'id':_0x39901d[_0x2c2a('0x3c')]['id']}})[_0x2c2a('0x1e')](handleEntityNotFound(_0x1712f2,null))[_0x2c2a('0x1e')](saveUpdates(_0x39901d[_0x2c2a('0x41')],null))[_0x2c2a('0x1e')](respondWithResult(_0x1712f2,null))['catch'](handleError(_0x1712f2,null));};exports[_0x2c2a('0x42')]=function(_0x52ece0,_0x10494b){return db['SquareReport'][_0x2c2a('0x40')]({'where':{'id':_0x52ece0[_0x2c2a('0x3c')]['id']}})[_0x2c2a('0x1e')](handleEntityNotFound(_0x10494b,null))[_0x2c2a('0x1e')](removeEntity(_0x10494b,null))['catch'](handleError(_0x10494b,null));};exports[_0x2c2a('0x43')]=function(_0x1ab211,_0x1de8d3){return db[_0x2c2a('0x24')]['describe']()[_0x2c2a('0x1e')](respondWithResult(_0x1de8d3,null))[_0x2c2a('0x3a')](handleError(_0x1de8d3,null));}; \ No newline at end of file +var _0xe1a9=['options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','key','VIRTUAL','field','include','SquareReport','findAll','rows','show','params','intersection'];(function(_0x102b13,_0x1efc03){var _0x192c42=function(_0x1b7be8){while(--_0x1b7be8){_0x102b13['push'](_0x102b13['shift']());}};_0x192c42(++_0x1efc03);}(_0xe1a9,0x1a4));var _0x9e1a=function(_0x4337f4,_0x5191cb){_0x4337f4=_0x4337f4-0x0;var _0x37b682=_0xe1a9[_0x4337f4];return _0x37b682;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9e1a('0x0'));var rimraf=require(_0x9e1a('0x1'));var zipdir=require(_0x9e1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e1a('0x3'));var moment=require(_0x9e1a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9e1a('0x5'));var util=require(_0x9e1a('0x6'));var path=require(_0x9e1a('0x7'));var sox=require(_0x9e1a('0x8'));var csv=require(_0x9e1a('0x9'));var ejs=require(_0x9e1a('0xa'));var fs=require('fs');var _=require(_0x9e1a('0xb'));var squel=require(_0x9e1a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9e1a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9e1a('0xe'));var Papa=require(_0x9e1a('0xf'));var authService=require(_0x9e1a('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x9e1a('0x11'));var logger=require(_0x9e1a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9e1a('0x13'));var db=require(_0x9e1a('0x14'))['db'];function respondWithStatusCode(_0x1956e8,_0x91a58d){_0x91a58d=_0x91a58d||0xcc;return function(_0x256485){if(_0x256485){return _0x1956e8['sendStatus'](_0x91a58d);}return _0x1956e8[_0x9e1a('0x15')](_0x91a58d)[_0x9e1a('0x16')]();};}function respondWithResult(_0x130e85,_0x320de1){_0x320de1=_0x320de1||0xc8;return function(_0x50c2cf){if(_0x50c2cf){return _0x130e85[_0x9e1a('0x15')](_0x320de1)['json'](_0x50c2cf);}};}function respondWithFilteredResult(_0x14e4ef,_0x183f5a){return function(_0x345af0){if(_0x345af0){var _0xbb1507=_0x345af0['count'],_0x3e8c5e=_0x183f5a['offset'],_0x26109d=_0x183f5a[_0x9e1a('0x17')]+_0x183f5a[_0x9e1a('0x18')],_0x238ef8;if(_0x26109d>=_0xbb1507){_0x26109d=_0xbb1507;_0x238ef8=0xc8;}else{_0x238ef8=0xce;}_0x14e4ef[_0x9e1a('0x15')](_0x238ef8);return _0x14e4ef[_0x9e1a('0x19')](_0x9e1a('0x1a'),_0x3e8c5e+'-'+_0x26109d+'/'+_0xbb1507)[_0x9e1a('0x1b')](_0x345af0);}return null;};}function patchUpdates(_0x3a134d){return function(_0x1a1a55){try{jsonpatch[_0x9e1a('0x1c')](_0x1a1a55,_0x3a134d,!![]);}catch(_0x20db1e){return BPromise['reject'](_0x20db1e);}return _0x1a1a55[_0x9e1a('0x1d')]();};}function saveUpdates(_0x5ea157,_0x4ab8b2){return function(_0x2f01b5){if(_0x2f01b5){return _0x2f01b5[_0x9e1a('0x1e')](_0x5ea157)[_0x9e1a('0x1f')](function(_0x58d293){return _0x58d293;});}return null;};}function removeEntity(_0xcbd66d,_0x2c2fc3){return function(_0x287b64){if(_0x287b64){return _0x287b64[_0x9e1a('0x20')]()[_0x9e1a('0x1f')](function(){_0xcbd66d[_0x9e1a('0x15')](0xcc)[_0x9e1a('0x16')]();});}};}function handleEntityNotFound(_0x33af4e,_0x50ac18){return function(_0x1062c8){if(!_0x1062c8){_0x33af4e['sendStatus'](0x194);}return _0x1062c8;};}function handleError(_0x5d5523,_0x414726){_0x414726=_0x414726||0x1f4;return function(_0x337fa8){logger['error'](_0x337fa8[_0x9e1a('0x21')]);if(_0x337fa8[_0x9e1a('0x22')]){delete _0x337fa8['name'];}_0x5d5523[_0x9e1a('0x15')](_0x414726)[_0x9e1a('0x23')](_0x337fa8);};}exports[_0x9e1a('0x24')]=function(_0x2e2ca4,_0x4667cb){var _0x351f41={},_0x53fb34={},_0x516143={'count':0x0,'rows':[]};var _0x1a104b=db['SquareReport'][_0x9e1a('0x25')];_0x53fb34[_0x9e1a('0x26')]=_[_0x9e1a('0x27')](_0x1a104b);_0x53fb34['query']=_[_0x9e1a('0x27')](_0x2e2ca4[_0x9e1a('0x28')]);_0x53fb34[_0x9e1a('0x29')]=_['intersection'](_0x53fb34[_0x9e1a('0x26')],_0x53fb34[_0x9e1a('0x28')]);_0x351f41[_0x9e1a('0x2a')]=_['intersection'](_0x53fb34[_0x9e1a('0x26')],qs[_0x9e1a('0x2b')](_0x2e2ca4[_0x9e1a('0x28')][_0x9e1a('0x2b')]));_0x351f41[_0x9e1a('0x2a')]=_0x351f41[_0x9e1a('0x2a')][_0x9e1a('0x2c')]?_0x351f41[_0x9e1a('0x2a')]:_0x53fb34['model'];if(!_0x2e2ca4[_0x9e1a('0x28')][_0x9e1a('0x2d')](_0x9e1a('0x2e'))){_0x351f41[_0x9e1a('0x18')]=qs[_0x9e1a('0x18')](_0x2e2ca4[_0x9e1a('0x28')][_0x9e1a('0x18')]);_0x351f41[_0x9e1a('0x17')]=qs['offset'](_0x2e2ca4[_0x9e1a('0x28')][_0x9e1a('0x17')]);}_0x351f41[_0x9e1a('0x2f')]=qs['sort'](_0x2e2ca4['query']['sort']);_0x351f41[_0x9e1a('0x30')]=qs[_0x9e1a('0x29')](_[_0x9e1a('0x31')](_0x2e2ca4[_0x9e1a('0x28')],_0x53fb34[_0x9e1a('0x29')]));if(_0x2e2ca4['query'][_0x9e1a('0x32')]){_0x351f41[_0x9e1a('0x30')]=_[_0x9e1a('0x33')](_0x351f41[_0x9e1a('0x30')],{'$or':_['map'](_0x1a104b,function(_0x476d3e){if(_0x476d3e[_0x9e1a('0x34')][_0x9e1a('0x35')]!==_0x9e1a('0x36')){var _0x19b3c7={};_0x19b3c7[_0x476d3e[_0x9e1a('0x37')]]={'$like':'%'+_0x2e2ca4[_0x9e1a('0x28')][_0x9e1a('0x32')]+'%'};return _0x19b3c7;}})});}_0x351f41=_['merge']({},_0x351f41,_0x2e2ca4['options']);var _0x5243c3={'where':_0x351f41['where']};return db['SquareReport']['count'](_0x5243c3)['then'](function(_0x6060f2){_0x516143['count']=_0x6060f2;if(_0x2e2ca4[_0x9e1a('0x28')]['includeAll']){_0x351f41[_0x9e1a('0x38')]=[{'all':!![]}];}return db[_0x9e1a('0x39')][_0x9e1a('0x3a')](_0x351f41);})['then'](function(_0x4113d5){_0x516143[_0x9e1a('0x3b')]=_0x4113d5;return _0x516143;})[_0x9e1a('0x1f')](respondWithFilteredResult(_0x4667cb,_0x351f41))['catch'](handleError(_0x4667cb,null));};exports[_0x9e1a('0x3c')]=function(_0x3eab9,_0x2d2719){var _0x543ec0={'raw':!![],'where':{'id':_0x3eab9[_0x9e1a('0x3d')]['id']}},_0x3622e1={};_0x3622e1[_0x9e1a('0x26')]=_['keys'](db[_0x9e1a('0x39')][_0x9e1a('0x25')]);_0x3622e1[_0x9e1a('0x28')]=_['keys'](_0x3eab9[_0x9e1a('0x28')]);_0x3622e1['filters']=_[_0x9e1a('0x3e')](_0x3622e1['model'],_0x3622e1[_0x9e1a('0x28')]);_0x543ec0['attributes']=_[_0x9e1a('0x3e')](_0x3622e1[_0x9e1a('0x26')],qs['fields'](_0x3eab9[_0x9e1a('0x28')][_0x9e1a('0x2b')]));_0x543ec0[_0x9e1a('0x2a')]=_0x543ec0[_0x9e1a('0x2a')][_0x9e1a('0x2c')]?_0x543ec0['attributes']:_0x3622e1[_0x9e1a('0x26')];if(_0x3eab9['query']['includeAll']){_0x543ec0['include']=[{'all':!![]}];}_0x543ec0=_[_0x9e1a('0x33')]({},_0x543ec0,_0x3eab9[_0x9e1a('0x3f')]);return db[_0x9e1a('0x39')][_0x9e1a('0x40')](_0x543ec0)['then'](handleEntityNotFound(_0x2d2719,null))[_0x9e1a('0x1f')](respondWithResult(_0x2d2719,null))['catch'](handleError(_0x2d2719,null));};exports['create']=function(_0x5d658f,_0x5bf18b){return db[_0x9e1a('0x39')][_0x9e1a('0x41')](_0x5d658f[_0x9e1a('0x42')],{})[_0x9e1a('0x1f')](respondWithResult(_0x5bf18b,0xc9))[_0x9e1a('0x43')](handleError(_0x5bf18b,null));};exports[_0x9e1a('0x1e')]=function(_0xd93e8,_0xc22cce){if(_0xd93e8[_0x9e1a('0x42')]['id']){delete _0xd93e8[_0x9e1a('0x42')]['id'];}return db[_0x9e1a('0x39')][_0x9e1a('0x40')]({'where':{'id':_0xd93e8['params']['id']}})[_0x9e1a('0x1f')](handleEntityNotFound(_0xc22cce,null))['then'](saveUpdates(_0xd93e8[_0x9e1a('0x42')],null))['then'](respondWithResult(_0xc22cce,null))[_0x9e1a('0x43')](handleError(_0xc22cce,null));};exports[_0x9e1a('0x20')]=function(_0x7aa916,_0x4f55fd){return db['SquareReport']['find']({'where':{'id':_0x7aa916[_0x9e1a('0x3d')]['id']}})[_0x9e1a('0x1f')](handleEntityNotFound(_0x4f55fd,null))[_0x9e1a('0x1f')](removeEntity(_0x4f55fd,null))[_0x9e1a('0x43')](handleError(_0x4f55fd,null));};exports['describe']=function(_0x4b8869,_0x298b1a){return db[_0x9e1a('0x39')][_0x9e1a('0x44')]()[_0x9e1a('0x1f')](respondWithResult(_0x298b1a,null))[_0x9e1a('0x43')](handleError(_0x298b1a,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 6b5b0eb..0686005 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 _0xeb68=['moment','bluebird','request-promise','./squareReport.attributes','exports','define','SquareReport','uniqueid','leaveAt','lodash','../../config/logger','api'];(function(_0x33a5ec,_0x10c014){var _0x38f89c=function(_0x15f7ee){while(--_0x15f7ee){_0x33a5ec['push'](_0x33a5ec['shift']());}};_0x38f89c(++_0x10c014);}(_0xeb68,0x189));var _0x8eb6=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0xeb68[_0x1f0724];return _0x253ffb;};'use strict';var _=require(_0x8eb6('0x0'));var util=require('util');var logger=require(_0x8eb6('0x1'))(_0x8eb6('0x2'));var moment=require(_0x8eb6('0x3'));var BPromise=require(_0x8eb6('0x4'));var rp=require(_0x8eb6('0x5'));var attributes=require(_0x8eb6('0x6'));module[_0x8eb6('0x7')]=function(_0x2bb290,_0x3c595c){return _0x2bb290[_0x8eb6('0x8')](_0x8eb6('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x8eb6('0xa'),'project_name']},{'name':_0x8eb6('0xb'),'fields':[_0x8eb6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8fd5=['moment','request-promise','exports','define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','util','../../config/logger'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x8fd5,0x1e2));var _0x58fd=function(_0x43d976,_0x36d079){_0x43d976=_0x43d976-0x0;var _0xba80ae=_0x8fd5[_0x43d976];return _0xba80ae;};'use strict';var _=require('lodash');var util=require(_0x58fd('0x0'));var logger=require(_0x58fd('0x1'))('api');var moment=require(_0x58fd('0x2'));var BPromise=require('bluebird');var rp=require(_0x58fd('0x3'));var attributes=require('./squareReport.attributes');module[_0x58fd('0x4')]=function(_0x547b73,_0x32a9a4){return _0x547b73[_0x58fd('0x5')](_0x58fd('0x6'),attributes,{'tableName':_0x58fd('0x7'),'paranoid':![],'indexes':[{'name':_0x58fd('0x8'),'fields':[_0x58fd('0x9'),'project_name']},{'name':'leaveAt','fields':[_0x58fd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 7174c85..53ba6a6 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 _0x2138=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareReport,\x20%s,\x20%s','result','catch','SquareReport','create','body','raw','CreateSquareReport','UpdateSquareReport','update','options','where','limit'];(function(_0x1329e9,_0x766087){var _0x3c800b=function(_0x1e962b){while(--_0x1e962b){_0x1329e9['push'](_0x1329e9['shift']());}};_0x3c800b(++_0x766087);}(_0x2138,0xee));var _0x8213=function(_0x4efd00,_0x98725d){_0x4efd00=_0x4efd00-0x0;var _0x292819=_0x2138[_0x4efd00];return _0x292819;};'use strict';var _=require('lodash');var util=require(_0x8213('0x0'));var moment=require(_0x8213('0x1'));var BPromise=require(_0x8213('0x2'));var rs=require(_0x8213('0x3'));var fs=require('fs');var Redis=require(_0x8213('0x4'));var db=require(_0x8213('0x5'))['db'];var utils=require(_0x8213('0x6'));var logger=require(_0x8213('0x7'))('rpc');var config=require(_0x8213('0x8'));var jayson=require(_0x8213('0x9'));var client=jayson['client'][_0x8213('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3b28a,_0x2dd5fd,_0x5557cf){return new BPromise(function(_0x40d1de,_0x27dab0){return client[_0x8213('0xb')](_0xc3b28a,_0x5557cf)[_0x8213('0xc')](function(_0x2f0abd){logger[_0x8213('0xd')]('SquareReport,\x20%s,\x20%s',_0x2dd5fd,_0x8213('0xe'));logger[_0x8213('0xf')](_0x8213('0x10'),_0x2dd5fd,_0x8213('0xe'),JSON[_0x8213('0x11')](_0x2f0abd));if(_0x2f0abd[_0x8213('0x12')]){if(_0x2f0abd[_0x8213('0x12')][_0x8213('0x13')]===0x1f4){logger[_0x8213('0x12')]('SquareReport,\x20%s,\x20%s',_0x2dd5fd,_0x2f0abd[_0x8213('0x12')][_0x8213('0x14')]);return _0x27dab0(_0x2f0abd[_0x8213('0x12')][_0x8213('0x14')]);}logger['error'](_0x8213('0x15'),_0x2dd5fd,_0x2f0abd[_0x8213('0x12')]['message']);return _0x40d1de(_0x2f0abd[_0x8213('0x12')][_0x8213('0x14')]);}else{logger[_0x8213('0xd')](_0x8213('0x15'),_0x2dd5fd,_0x8213('0xe'));_0x40d1de(_0x2f0abd[_0x8213('0x16')][_0x8213('0x14')]);}})[_0x8213('0x17')](function(_0x319c5c){logger[_0x8213('0x12')](_0x8213('0x15'),_0x2dd5fd,_0x319c5c);_0x27dab0(_0x319c5c);});});}exports['CreateSquareReport']=function(_0x5bb026){var _0x1d539f=this;return new Promise(function(_0x846d44,_0x3129d8){return db[_0x8213('0x18')][_0x8213('0x19')](_0x5bb026[_0x8213('0x1a')],{'raw':_0x5bb026['options']?_0x5bb026['options'][_0x8213('0x1b')]===undefined?!![]:![]:!![]})[_0x8213('0xc')](function(_0x467d33){logger[_0x8213('0xd')](_0x8213('0x1c'),_0x5bb026);logger[_0x8213('0xf')](_0x8213('0x1c'),_0x5bb026,JSON[_0x8213('0x11')](_0x467d33));_0x846d44(_0x467d33);})[_0x8213('0x17')](function(_0x555530){logger[_0x8213('0x12')]('CreateSquareReport',_0x555530[_0x8213('0x14')],_0x5bb026);_0x3129d8(_0x1d539f['error'](0x1f4,_0x555530['message']));});});};exports[_0x8213('0x1d')]=function(_0x1a756b){var _0xd4c3a1=this;return new Promise(function(_0x4a4bd5,_0x2c54cd){return db[_0x8213('0x18')][_0x8213('0x1e')](_0x1a756b['body'],{'raw':_0x1a756b[_0x8213('0x1f')]?_0x1a756b[_0x8213('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a756b[_0x8213('0x1f')]?_0x1a756b[_0x8213('0x1f')][_0x8213('0x20')]||null:null,'attributes':_0x1a756b['options']?_0x1a756b['options']['attributes']||null:null,'limit':_0x1a756b['options']?_0x1a756b['options'][_0x8213('0x21')]||null:null})[_0x8213('0xc')](function(_0x32723b){logger['info'](_0x8213('0x1d'),_0x1a756b);logger['debug']('UpdateSquareReport',_0x1a756b,JSON[_0x8213('0x11')](_0x32723b));_0x4a4bd5(_0x32723b);})[_0x8213('0x17')](function(_0x518f83){logger[_0x8213('0x12')](_0x8213('0x1d'),_0x518f83[_0x8213('0x14')],_0x1a756b);_0x2c54cd(_0xd4c3a1[_0x8213('0x12')](0x1f4,_0x518f83[_0x8213('0x14')]));});});}; \ No newline at end of file +var _0xb34f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','create','body','options','raw','debug','SquareReport','update','where','attributes','limit','UpdateSquareReport','lodash','util'];(function(_0x2be63e,_0xb273bf){var _0x4dcf92=function(_0x318f2f){while(--_0x318f2f){_0x2be63e['push'](_0x2be63e['shift']());}};_0x4dcf92(++_0xb273bf);}(_0xb34f,0xdc));var _0xfb34=function(_0x2a9780,_0x425318){_0x2a9780=_0x2a9780-0x0;var _0xe75135=_0xb34f[_0x2a9780];return _0xe75135;};'use strict';var _=require(_0xfb34('0x0'));var util=require(_0xfb34('0x1'));var moment=require(_0xfb34('0x2'));var BPromise=require(_0xfb34('0x3'));var rs=require(_0xfb34('0x4'));var fs=require('fs');var Redis=require(_0xfb34('0x5'));var db=require(_0xfb34('0x6'))['db'];var utils=require(_0xfb34('0x7'));var logger=require(_0xfb34('0x8'))(_0xfb34('0x9'));var config=require(_0xfb34('0xa'));var jayson=require(_0xfb34('0xb'));var client=jayson[_0xfb34('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1de53a,_0x2ed38e,_0x4c4e57){return new BPromise(function(_0x2c5dd6,_0x25b6ee){return client[_0xfb34('0xd')](_0x1de53a,_0x4c4e57)[_0xfb34('0xe')](function(_0x347b43){logger[_0xfb34('0xf')]('SquareReport,\x20%s,\x20%s',_0x2ed38e,_0xfb34('0x10'));logger['debug'](_0xfb34('0x11'),_0x2ed38e,_0xfb34('0x10'),JSON[_0xfb34('0x12')](_0x347b43));if(_0x347b43[_0xfb34('0x13')]){if(_0x347b43['error'][_0xfb34('0x14')]===0x1f4){logger['error'](_0xfb34('0x15'),_0x2ed38e,_0x347b43[_0xfb34('0x13')][_0xfb34('0x16')]);return _0x25b6ee(_0x347b43[_0xfb34('0x13')][_0xfb34('0x16')]);}logger[_0xfb34('0x13')]('SquareReport,\x20%s,\x20%s',_0x2ed38e,_0x347b43[_0xfb34('0x13')][_0xfb34('0x16')]);return _0x2c5dd6(_0x347b43[_0xfb34('0x13')][_0xfb34('0x16')]);}else{logger[_0xfb34('0xf')]('SquareReport,\x20%s,\x20%s',_0x2ed38e,_0xfb34('0x10'));_0x2c5dd6(_0x347b43[_0xfb34('0x17')]['message']);}})[_0xfb34('0x18')](function(_0x2fc7d5){logger['error'](_0xfb34('0x15'),_0x2ed38e,_0x2fc7d5);_0x25b6ee(_0x2fc7d5);});});}exports[_0xfb34('0x19')]=function(_0x4ce484){var _0x1db0fb=this;return new Promise(function(_0x44715a,_0xf0a83c){return db['SquareReport'][_0xfb34('0x1a')](_0x4ce484[_0xfb34('0x1b')],{'raw':_0x4ce484[_0xfb34('0x1c')]?_0x4ce484[_0xfb34('0x1c')][_0xfb34('0x1d')]===undefined?!![]:![]:!![]})[_0xfb34('0xe')](function(_0x4d67c0){logger[_0xfb34('0xf')](_0xfb34('0x19'),_0x4ce484);logger[_0xfb34('0x1e')]('CreateSquareReport',_0x4ce484,JSON[_0xfb34('0x12')](_0x4d67c0));_0x44715a(_0x4d67c0);})['catch'](function(_0x71f9f2){logger['error']('CreateSquareReport',_0x71f9f2[_0xfb34('0x16')],_0x4ce484);_0xf0a83c(_0x1db0fb['error'](0x1f4,_0x71f9f2['message']));});});};exports['UpdateSquareReport']=function(_0x4d26da){var _0x51ef91=this;return new Promise(function(_0x235f27,_0xce2f88){return db[_0xfb34('0x1f')][_0xfb34('0x20')](_0x4d26da[_0xfb34('0x1b')],{'raw':_0x4d26da['options']?_0x4d26da[_0xfb34('0x1c')][_0xfb34('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d26da[_0xfb34('0x1c')]?_0x4d26da['options'][_0xfb34('0x21')]||null:null,'attributes':_0x4d26da[_0xfb34('0x1c')]?_0x4d26da[_0xfb34('0x1c')][_0xfb34('0x22')]||null:null,'limit':_0x4d26da['options']?_0x4d26da['options'][_0xfb34('0x23')]||null:null})[_0xfb34('0xe')](function(_0x5791f8){logger['info'](_0xfb34('0x24'),_0x4d26da);logger[_0xfb34('0x1e')](_0xfb34('0x24'),_0x4d26da,JSON[_0xfb34('0x12')](_0x5791f8));_0x235f27(_0x5791f8);})['catch'](function(_0x577120){logger[_0xfb34('0x13')](_0xfb34('0x24'),_0x577120[_0xfb34('0x16')],_0x4d26da);_0xce2f88(_0x51ef91[_0xfb34('0x13')](0x1f4,_0x577120[_0xfb34('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4afe713..3dcfc95 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 _0x7cb4=['express','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','index','get','/describe','isAuthenticated','/:id','create','put','update','destroy','util','path','connect-timeout'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x7cb4,0x12d));var _0x47cb=function(_0x14d675,_0x1ec836){_0x14d675=_0x14d675-0x0;var _0x5d7ba4=_0x7cb4[_0x14d675];return _0x5d7ba4;};'use strict';var multer=require('multer');var util=require(_0x47cb('0x0'));var path=require(_0x47cb('0x1'));var timeout=require(_0x47cb('0x2'));var express=require(_0x47cb('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x47cb('0x4'));var config=require(_0x47cb('0x5'));var controller=require(_0x47cb('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x47cb('0x7')]);router[_0x47cb('0x8')](_0x47cb('0x9'),auth[_0x47cb('0xa')](),controller['describe']);router[_0x47cb('0x8')](_0x47cb('0xb'),auth[_0x47cb('0xa')](),controller['show']);router['post']('/',auth[_0x47cb('0xa')](),controller[_0x47cb('0xc')]);router[_0x47cb('0xd')]('/:id',auth[_0x47cb('0xa')](),controller[_0x47cb('0xe')]);router['delete'](_0x47cb('0xb'),auth[_0x47cb('0xa')](),controller[_0x47cb('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc29f=['../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0xc29f,0x1d5));var _0xfc29=function(_0xba1db,_0xe8eccc){_0xba1db=_0xba1db-0x0;var _0x5969ef=_0xc29f[_0xba1db];return _0x5969ef;};'use strict';var multer=require('multer');var util=require(_0xfc29('0x0'));var path=require(_0xfc29('0x1'));var timeout=require(_0xfc29('0x2'));var express=require(_0xfc29('0x3'));var router=express[_0xfc29('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfc29('0x5'));var config=require(_0xfc29('0x6'));var controller=require(_0xfc29('0x7'));router[_0xfc29('0x8')]('/',auth[_0xfc29('0x9')](),controller[_0xfc29('0xa')]);router['get']('/describe',auth[_0xfc29('0x9')](),controller[_0xfc29('0xb')]);router[_0xfc29('0x8')](_0xfc29('0xc'),auth[_0xfc29('0x9')](),controller[_0xfc29('0xd')]);router[_0xfc29('0xe')]('/',auth[_0xfc29('0x9')](),controller['create']);router[_0xfc29('0xf')](_0xfc29('0xc'),auth['isAuthenticated'](),controller[_0xfc29('0x10')]);router['delete'](_0xfc29('0xc'),auth['isAuthenticated'](),controller[_0xfc29('0x11')]);module[_0xfc29('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 6bce331..ea1c2c9 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 _0xb80a=['STRING','TEXT','sequelize','exports'];(function(_0x2d13c1,_0xed35ab){var _0x265229=function(_0x27ec74){while(--_0x27ec74){_0x2d13c1['push'](_0x2d13c1['shift']());}};_0x265229(++_0xed35ab);}(_0xb80a,0x196));var _0xab80=function(_0x57e88d,_0x3a0a0d){_0x57e88d=_0x57e88d-0x0;var _0x56c660=_0xb80a[_0x57e88d];return _0x56c660;};'use strict';var Sequelize=require(_0xab80('0x0'));module[_0xab80('0x1')]={'uniqueid':{'type':Sequelize[_0xab80('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xab80('0x2')]},'data':{'type':Sequelize[_0xab80('0x3')]},'project_name':{'type':Sequelize[_0xab80('0x2')]},'callerid':{'type':Sequelize[_0xab80('0x2')]}}; \ No newline at end of file +var _0x8516=['STRING','TEXT','sequelize','exports'];(function(_0x26aab3,_0x10f2f5){var _0xc04cb0=function(_0x5d6137){while(--_0x5d6137){_0x26aab3['push'](_0x26aab3['shift']());}};_0xc04cb0(++_0x10f2f5);}(_0x8516,0x15e));var _0x6851=function(_0x54e883,_0x3a19d1){_0x54e883=_0x54e883-0x0;var _0x15e4af=_0x8516[_0x54e883];return _0x15e4af;};'use strict';var Sequelize=require(_0x6851('0x0'));module[_0x6851('0x1')]={'uniqueid':{'type':Sequelize[_0x6851('0x2')]},'node':{'type':Sequelize[_0x6851('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x6851('0x3')]},'project_name':{'type':Sequelize[_0x6851('0x2')]},'callerid':{'type':Sequelize[_0x6851('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9c71c2d..82c91d0 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 _0x1685=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','send','index','SquareDetailsReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','key','VIRTUAL','field','options','includeAll','findAll','catch','params','rawAttributes','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x39075d,_0x2b8870){var _0x4b1154=function(_0x2a3a8b){while(--_0x2a3a8b){_0x39075d['push'](_0x39075d['shift']());}};_0x4b1154(++_0x2b8870);}(_0x1685,0x196));var _0x5168=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1685[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0x5168('0x0'));var emlformat=require(_0x5168('0x1'));var rimraf=require(_0x5168('0x2'));var zipdir=require(_0x5168('0x3'));var jsonpatch=require(_0x5168('0x4'));var rp=require(_0x5168('0x5'));var moment=require(_0x5168('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5168('0x7'));var util=require(_0x5168('0x8'));var path=require(_0x5168('0x9'));var sox=require(_0x5168('0xa'));var csv=require(_0x5168('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5168('0xc'));var squel=require(_0x5168('0xd'));var crypto=require(_0x5168('0xe'));var jsforce=require(_0x5168('0xf'));var deskjs=require(_0x5168('0x10'));var toCsv=require(_0x5168('0xb'));var querystring=require(_0x5168('0x11'));var Papa=require(_0x5168('0x12'));var authService=require(_0x5168('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5168('0x14'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5168('0x15'));var utils=require(_0x5168('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a468d,_0x1f9e29){_0x1f9e29=_0x1f9e29||0xcc;return function(_0x5e0526){if(_0x5e0526){return _0x2a468d[_0x5168('0x17')](_0x1f9e29);}return _0x2a468d[_0x5168('0x18')](_0x1f9e29)[_0x5168('0x19')]();};}function respondWithResult(_0x35b9d3,_0x5d67c4){_0x5d67c4=_0x5d67c4||0xc8;return function(_0x311f4c){if(_0x311f4c){return _0x35b9d3[_0x5168('0x18')](_0x5d67c4)[_0x5168('0x1a')](_0x311f4c);}};}function respondWithFilteredResult(_0xa119ca,_0x466fa9){return function(_0x7cc27d){if(_0x7cc27d){var _0x5ccb78=_0x7cc27d[_0x5168('0x1b')],_0x25152d=_0x466fa9[_0x5168('0x1c')],_0x33ae54=_0x466fa9[_0x5168('0x1c')]+_0x466fa9['limit'],_0x5915a1;if(_0x33ae54>=_0x5ccb78){_0x33ae54=_0x5ccb78;_0x5915a1=0xc8;}else{_0x5915a1=0xce;}_0xa119ca[_0x5168('0x18')](_0x5915a1);return _0xa119ca[_0x5168('0x1d')](_0x5168('0x1e'),_0x25152d+'-'+_0x33ae54+'/'+_0x5ccb78)[_0x5168('0x1a')](_0x7cc27d);}return null;};}function patchUpdates(_0x191b5f){return function(_0x4ef227){try{jsonpatch[_0x5168('0x1f')](_0x4ef227,_0x191b5f,!![]);}catch(_0x1837ce){return BPromise[_0x5168('0x20')](_0x1837ce);}return _0x4ef227['save']();};}function saveUpdates(_0xd10567,_0x96ecb){return function(_0x2d1a47){if(_0x2d1a47){return _0x2d1a47['update'](_0xd10567)['then'](function(_0x3fa7a9){return _0x3fa7a9;});}return null;};}function removeEntity(_0x5f8363,_0x40ddd0){return function(_0x14185e){if(_0x14185e){return _0x14185e[_0x5168('0x21')]()[_0x5168('0x22')](function(){_0x5f8363[_0x5168('0x18')](0xcc)[_0x5168('0x19')]();});}};}function handleEntityNotFound(_0x54a6b7,_0x34755f){return function(_0x540840){if(!_0x540840){_0x54a6b7[_0x5168('0x17')](0x194);}return _0x540840;};}function handleError(_0x555181,_0x49c60b){_0x49c60b=_0x49c60b||0x1f4;return function(_0xf69315){logger[_0x5168('0x23')](_0xf69315[_0x5168('0x24')]);if(_0xf69315['name']){delete _0xf69315['name'];}_0x555181[_0x5168('0x18')](_0x49c60b)[_0x5168('0x25')](_0xf69315);};}exports[_0x5168('0x26')]=function(_0x17f17f,_0x288485){var _0x58014e={},_0x4f2dce={},_0x3f104d={'count':0x0,'rows':[]};var _0x1fba80=db[_0x5168('0x27')]['rawAttributes'];_0x4f2dce[_0x5168('0x28')]=_[_0x5168('0x29')](_0x1fba80);_0x4f2dce[_0x5168('0x2a')]=_[_0x5168('0x29')](_0x17f17f[_0x5168('0x2a')]);_0x4f2dce[_0x5168('0x2b')]=_[_0x5168('0x2c')](_0x4f2dce[_0x5168('0x28')],_0x4f2dce[_0x5168('0x2a')]);_0x58014e[_0x5168('0x2d')]=_['intersection'](_0x4f2dce[_0x5168('0x28')],qs[_0x5168('0x2e')](_0x17f17f[_0x5168('0x2a')][_0x5168('0x2e')]));_0x58014e[_0x5168('0x2d')]=_0x58014e[_0x5168('0x2d')][_0x5168('0x2f')]?_0x58014e[_0x5168('0x2d')]:_0x4f2dce[_0x5168('0x28')];if(!_0x17f17f['query'][_0x5168('0x30')](_0x5168('0x31'))){_0x58014e[_0x5168('0x32')]=qs[_0x5168('0x32')](_0x17f17f['query']['limit']);_0x58014e[_0x5168('0x1c')]=qs[_0x5168('0x1c')](_0x17f17f['query']['offset']);}_0x58014e[_0x5168('0x33')]=qs[_0x5168('0x34')](_0x17f17f['query'][_0x5168('0x34')]);_0x58014e[_0x5168('0x35')]=qs['filters'](_['pick'](_0x17f17f[_0x5168('0x2a')],_0x4f2dce['filters']));if(_0x17f17f[_0x5168('0x2a')][_0x5168('0x36')]){_0x58014e['where']=_[_0x5168('0x37')](_0x58014e[_0x5168('0x35')],{'$or':_['map'](_0x1fba80,function(_0x47434a){if(_0x47434a['type'][_0x5168('0x38')]!==_0x5168('0x39')){var _0x590c94={};_0x590c94[_0x47434a[_0x5168('0x3a')]]={'$like':'%'+_0x17f17f['query']['filter']+'%'};return _0x590c94;}})});}_0x58014e=_[_0x5168('0x37')]({},_0x58014e,_0x17f17f[_0x5168('0x3b')]);var _0xc98b44={'where':_0x58014e[_0x5168('0x35')]};return db[_0x5168('0x27')]['count'](_0xc98b44)[_0x5168('0x22')](function(_0x4bc859){_0x3f104d['count']=_0x4bc859;if(_0x17f17f[_0x5168('0x2a')][_0x5168('0x3c')]){_0x58014e['include']=[{'all':!![]}];}return db[_0x5168('0x27')][_0x5168('0x3d')](_0x58014e);})[_0x5168('0x22')](function(_0x24b98f){_0x3f104d['rows']=_0x24b98f;return _0x3f104d;})[_0x5168('0x22')](respondWithFilteredResult(_0x288485,_0x58014e))[_0x5168('0x3e')](handleError(_0x288485,null));};exports['show']=function(_0x52ab8f,_0x3d3e1a){var _0x352e68={'raw':!![],'where':{'id':_0x52ab8f[_0x5168('0x3f')]['id']}},_0x52ca1a={};_0x52ca1a['model']=_['keys'](db['SquareDetailsReport'][_0x5168('0x40')]);_0x52ca1a[_0x5168('0x2a')]=_[_0x5168('0x29')](_0x52ab8f[_0x5168('0x2a')]);_0x52ca1a[_0x5168('0x2b')]=_[_0x5168('0x2c')](_0x52ca1a[_0x5168('0x28')],_0x52ca1a[_0x5168('0x2a')]);_0x352e68[_0x5168('0x2d')]=_['intersection'](_0x52ca1a['model'],qs[_0x5168('0x2e')](_0x52ab8f[_0x5168('0x2a')][_0x5168('0x2e')]));_0x352e68[_0x5168('0x2d')]=_0x352e68[_0x5168('0x2d')][_0x5168('0x2f')]?_0x352e68[_0x5168('0x2d')]:_0x52ca1a[_0x5168('0x28')];if(_0x52ab8f[_0x5168('0x2a')][_0x5168('0x3c')]){_0x352e68[_0x5168('0x41')]=[{'all':!![]}];}_0x352e68=_[_0x5168('0x37')]({},_0x352e68,_0x52ab8f[_0x5168('0x3b')]);return db[_0x5168('0x27')][_0x5168('0x42')](_0x352e68)[_0x5168('0x22')](handleEntityNotFound(_0x3d3e1a,null))[_0x5168('0x22')](respondWithResult(_0x3d3e1a,null))[_0x5168('0x3e')](handleError(_0x3d3e1a,null));};exports[_0x5168('0x43')]=function(_0x3c39f2,_0xcdf343){return db['SquareDetailsReport'][_0x5168('0x43')](_0x3c39f2['body'],{})[_0x5168('0x22')](respondWithResult(_0xcdf343,0xc9))[_0x5168('0x3e')](handleError(_0xcdf343,null));};exports['update']=function(_0x2b97e7,_0x3758c1){if(_0x2b97e7[_0x5168('0x44')]['id']){delete _0x2b97e7[_0x5168('0x44')]['id'];}return db['SquareDetailsReport'][_0x5168('0x42')]({'where':{'id':_0x2b97e7['params']['id']}})[_0x5168('0x22')](handleEntityNotFound(_0x3758c1,null))[_0x5168('0x22')](saveUpdates(_0x2b97e7[_0x5168('0x44')],null))[_0x5168('0x22')](respondWithResult(_0x3758c1,null))[_0x5168('0x3e')](handleError(_0x3758c1,null));};exports['destroy']=function(_0x46f0cb,_0xa4f680){return db[_0x5168('0x27')][_0x5168('0x42')]({'where':{'id':_0x46f0cb[_0x5168('0x3f')]['id']}})[_0x5168('0x22')](handleEntityNotFound(_0xa4f680,null))[_0x5168('0x22')](removeEntity(_0xa4f680,null))[_0x5168('0x3e')](handleError(_0xa4f680,null));};exports[_0x5168('0x45')]=function(_0x5f90cd,_0x11c317){return db[_0x5168('0x27')][_0x5168('0x45')]()[_0x5168('0x22')](respondWithResult(_0x11c317,null))['catch'](handleError(_0x11c317,null));}; \ No newline at end of file +var _0x34bb=['describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','SquareDetailsReport','keys','query','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','offset','order','sort','where','filters','merge','map','type','key','field','filter','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body'];(function(_0x5b4daa,_0xc385e4){var _0x9b569c=function(_0x76fdb6){while(--_0x76fdb6){_0x5b4daa['push'](_0x5b4daa['shift']());}};_0x9b569c(++_0xc385e4);}(_0x34bb,0x129));var _0xb34b=function(_0x18fe24,_0x47b56e){_0x18fe24=_0x18fe24-0x0;var _0x4d162e=_0x34bb[_0x18fe24];return _0x4d162e;};'use strict';var pdf=require(_0xb34b('0x0'));var emlformat=require(_0xb34b('0x1'));var rimraf=require(_0xb34b('0x2'));var zipdir=require(_0xb34b('0x3'));var jsonpatch=require(_0xb34b('0x4'));var rp=require(_0xb34b('0x5'));var moment=require(_0xb34b('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb34b('0x7'));var path=require(_0xb34b('0x8'));var sox=require(_0xb34b('0x9'));var csv=require(_0xb34b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb34b('0xb'));var crypto=require(_0xb34b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb34b('0xd'));var toCsv=require(_0xb34b('0xa'));var querystring=require(_0xb34b('0xe'));var Papa=require(_0xb34b('0xf'));var authService=require(_0xb34b('0x10'));var hardwareService=require(_0xb34b('0x11'));var Redis=require(_0xb34b('0x12'));var qs=require(_0xb34b('0x13'));var logger=require(_0xb34b('0x14'))(_0xb34b('0x15'));var utils=require(_0xb34b('0x16'));var config=require(_0xb34b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33f086,_0xd10ea6){_0xd10ea6=_0xd10ea6||0xcc;return function(_0x42354c){if(_0x42354c){return _0x33f086[_0xb34b('0x18')](_0xd10ea6);}return _0x33f086['status'](_0xd10ea6)[_0xb34b('0x19')]();};}function respondWithResult(_0x2eb9e0,_0x254a72){_0x254a72=_0x254a72||0xc8;return function(_0x47ee29){if(_0x47ee29){return _0x2eb9e0[_0xb34b('0x1a')](_0x254a72)[_0xb34b('0x1b')](_0x47ee29);}};}function respondWithFilteredResult(_0x175144,_0x4dc84b){return function(_0x32a454){if(_0x32a454){var _0x2d121e=_0x32a454['count'],_0x188659=_0x4dc84b['offset'],_0x22d360=_0x4dc84b['offset']+_0x4dc84b[_0xb34b('0x1c')],_0x2b3197;if(_0x22d360>=_0x2d121e){_0x22d360=_0x2d121e;_0x2b3197=0xc8;}else{_0x2b3197=0xce;}_0x175144['status'](_0x2b3197);return _0x175144[_0xb34b('0x1d')](_0xb34b('0x1e'),_0x188659+'-'+_0x22d360+'/'+_0x2d121e)['json'](_0x32a454);}return null;};}function patchUpdates(_0x49f0ac){return function(_0x326efc){try{jsonpatch[_0xb34b('0x1f')](_0x326efc,_0x49f0ac,!![]);}catch(_0x2f3700){return BPromise[_0xb34b('0x20')](_0x2f3700);}return _0x326efc[_0xb34b('0x21')]();};}function saveUpdates(_0xd5731a,_0x190149){return function(_0x159921){if(_0x159921){return _0x159921[_0xb34b('0x22')](_0xd5731a)['then'](function(_0x3b016c){return _0x3b016c;});}return null;};}function removeEntity(_0x23963,_0x156dbd){return function(_0x2aee6c){if(_0x2aee6c){return _0x2aee6c[_0xb34b('0x23')]()[_0xb34b('0x24')](function(){_0x23963[_0xb34b('0x1a')](0xcc)[_0xb34b('0x19')]();});}};}function handleEntityNotFound(_0x50f0ce,_0x36d2df){return function(_0x4731c9){if(!_0x4731c9){_0x50f0ce[_0xb34b('0x18')](0x194);}return _0x4731c9;};}function handleError(_0x4dc95f,_0x48c9a1){_0x48c9a1=_0x48c9a1||0x1f4;return function(_0x4cc4b4){logger[_0xb34b('0x25')](_0x4cc4b4[_0xb34b('0x26')]);if(_0x4cc4b4['name']){delete _0x4cc4b4[_0xb34b('0x27')];}_0x4dc95f[_0xb34b('0x1a')](_0x48c9a1)['send'](_0x4cc4b4);};}exports[_0xb34b('0x28')]=function(_0x2fb771,_0x23790c){var _0x3a2a71={},_0x46ddf7={},_0x5a5f51={'count':0x0,'rows':[]};var _0x382fa2=db[_0xb34b('0x29')]['rawAttributes'];_0x46ddf7['model']=_[_0xb34b('0x2a')](_0x382fa2);_0x46ddf7['query']=_['keys'](_0x2fb771[_0xb34b('0x2b')]);_0x46ddf7['filters']=_['intersection'](_0x46ddf7['model'],_0x46ddf7[_0xb34b('0x2b')]);_0x3a2a71[_0xb34b('0x2c')]=_[_0xb34b('0x2d')](_0x46ddf7['model'],qs[_0xb34b('0x2e')](_0x2fb771['query'][_0xb34b('0x2e')]));_0x3a2a71[_0xb34b('0x2c')]=_0x3a2a71[_0xb34b('0x2c')][_0xb34b('0x2f')]?_0x3a2a71[_0xb34b('0x2c')]:_0x46ddf7[_0xb34b('0x30')];if(!_0x2fb771[_0xb34b('0x2b')][_0xb34b('0x31')](_0xb34b('0x32'))){_0x3a2a71['limit']=qs[_0xb34b('0x1c')](_0x2fb771['query'][_0xb34b('0x1c')]);_0x3a2a71['offset']=qs['offset'](_0x2fb771['query'][_0xb34b('0x33')]);}_0x3a2a71[_0xb34b('0x34')]=qs[_0xb34b('0x35')](_0x2fb771['query'][_0xb34b('0x35')]);_0x3a2a71[_0xb34b('0x36')]=qs[_0xb34b('0x37')](_['pick'](_0x2fb771['query'],_0x46ddf7[_0xb34b('0x37')]));if(_0x2fb771['query']['filter']){_0x3a2a71['where']=_[_0xb34b('0x38')](_0x3a2a71['where'],{'$or':_[_0xb34b('0x39')](_0x382fa2,function(_0x1f3b75){if(_0x1f3b75[_0xb34b('0x3a')][_0xb34b('0x3b')]!=='VIRTUAL'){var _0x5121ee={};_0x5121ee[_0x1f3b75[_0xb34b('0x3c')]]={'$like':'%'+_0x2fb771['query'][_0xb34b('0x3d')]+'%'};return _0x5121ee;}})});}_0x3a2a71=_[_0xb34b('0x38')]({},_0x3a2a71,_0x2fb771[_0xb34b('0x3e')]);var _0x59b57={'where':_0x3a2a71[_0xb34b('0x36')]};return db['SquareDetailsReport']['count'](_0x59b57)[_0xb34b('0x24')](function(_0x5178f1){_0x5a5f51[_0xb34b('0x3f')]=_0x5178f1;if(_0x2fb771[_0xb34b('0x2b')][_0xb34b('0x40')]){_0x3a2a71[_0xb34b('0x41')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xb34b('0x42')](_0x3a2a71);})['then'](function(_0xf2a326){_0x5a5f51[_0xb34b('0x43')]=_0xf2a326;return _0x5a5f51;})[_0xb34b('0x24')](respondWithFilteredResult(_0x23790c,_0x3a2a71))[_0xb34b('0x44')](handleError(_0x23790c,null));};exports['show']=function(_0x1a101e,_0xb7a487){var _0x5f3eda={'raw':!![],'where':{'id':_0x1a101e[_0xb34b('0x45')]['id']}},_0x5714c5={};_0x5714c5[_0xb34b('0x30')]=_[_0xb34b('0x2a')](db[_0xb34b('0x29')][_0xb34b('0x46')]);_0x5714c5['query']=_[_0xb34b('0x2a')](_0x1a101e[_0xb34b('0x2b')]);_0x5714c5['filters']=_[_0xb34b('0x2d')](_0x5714c5[_0xb34b('0x30')],_0x5714c5['query']);_0x5f3eda[_0xb34b('0x2c')]=_[_0xb34b('0x2d')](_0x5714c5[_0xb34b('0x30')],qs[_0xb34b('0x2e')](_0x1a101e[_0xb34b('0x2b')][_0xb34b('0x2e')]));_0x5f3eda['attributes']=_0x5f3eda[_0xb34b('0x2c')]['length']?_0x5f3eda['attributes']:_0x5714c5[_0xb34b('0x30')];if(_0x1a101e[_0xb34b('0x2b')][_0xb34b('0x40')]){_0x5f3eda[_0xb34b('0x41')]=[{'all':!![]}];}_0x5f3eda=_[_0xb34b('0x38')]({},_0x5f3eda,_0x1a101e[_0xb34b('0x3e')]);return db[_0xb34b('0x29')]['find'](_0x5f3eda)[_0xb34b('0x24')](handleEntityNotFound(_0xb7a487,null))[_0xb34b('0x24')](respondWithResult(_0xb7a487,null))[_0xb34b('0x44')](handleError(_0xb7a487,null));};exports[_0xb34b('0x47')]=function(_0x2bf46a,_0x8bb079){return db[_0xb34b('0x29')]['create'](_0x2bf46a[_0xb34b('0x48')],{})[_0xb34b('0x24')](respondWithResult(_0x8bb079,0xc9))['catch'](handleError(_0x8bb079,null));};exports[_0xb34b('0x22')]=function(_0x3a50a2,_0x49efb6){if(_0x3a50a2[_0xb34b('0x48')]['id']){delete _0x3a50a2[_0xb34b('0x48')]['id'];}return db[_0xb34b('0x29')]['find']({'where':{'id':_0x3a50a2[_0xb34b('0x45')]['id']}})[_0xb34b('0x24')](handleEntityNotFound(_0x49efb6,null))[_0xb34b('0x24')](saveUpdates(_0x3a50a2[_0xb34b('0x48')],null))[_0xb34b('0x24')](respondWithResult(_0x49efb6,null))['catch'](handleError(_0x49efb6,null));};exports['destroy']=function(_0x322357,_0x3855dc){return db[_0xb34b('0x29')]['find']({'where':{'id':_0x322357['params']['id']}})[_0xb34b('0x24')](handleEntityNotFound(_0x3855dc,null))[_0xb34b('0x24')](removeEntity(_0x3855dc,null))[_0xb34b('0x44')](handleError(_0x3855dc,null));};exports['describe']=function(_0x411194,_0x2821ae){return db[_0xb34b('0x29')][_0xb34b('0x49')]()[_0xb34b('0x24')](respondWithResult(_0x2821ae,null))[_0xb34b('0x44')](handleError(_0x2821ae,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 82d1a74..02d6d05 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 _0x90ae=['SquareDetailsReport','report_square_details','../../config/logger','api','bluebird','./squareReportDetail.attributes','exports','define'];(function(_0x59d94c,_0x33f979){var _0x4a6d77=function(_0x473b6c){while(--_0x473b6c){_0x59d94c['push'](_0x59d94c['shift']());}};_0x4a6d77(++_0x33f979);}(_0x90ae,0x14a));var _0xe90a=function(_0x4e8957,_0x5f0149){_0x4e8957=_0x4e8957-0x0;var _0x1e3d91=_0x90ae[_0x4e8957];return _0x1e3d91;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe90a('0x0'))(_0xe90a('0x1'));var moment=require('moment');var BPromise=require(_0xe90a('0x2'));var rp=require('request-promise');var attributes=require(_0xe90a('0x3'));module[_0xe90a('0x4')]=function(_0x1e7bda,_0x524f42){return _0x1e7bda[_0xe90a('0x5')](_0xe90a('0x6'),attributes,{'tableName':_0xe90a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae32=['../../config/logger','api','moment','bluebird','request-promise','./squareReportDetail.attributes','exports','report_square_details','lodash'];(function(_0x4fb601,_0x429c8d){var _0x5a1fcd=function(_0x1239af){while(--_0x1239af){_0x4fb601['push'](_0x4fb601['shift']());}};_0x5a1fcd(++_0x429c8d);}(_0xae32,0xce));var _0x2ae3=function(_0x263cca,_0x3001a0){_0x263cca=_0x263cca-0x0;var _0x5745ea=_0xae32[_0x263cca];return _0x5745ea;};'use strict';var _=require(_0x2ae3('0x0'));var util=require('util');var logger=require(_0x2ae3('0x1'))(_0x2ae3('0x2'));var moment=require(_0x2ae3('0x3'));var BPromise=require(_0x2ae3('0x4'));var rp=require(_0x2ae3('0x5'));var attributes=require(_0x2ae3('0x6'));module[_0x2ae3('0x7')]=function(_0x3e0781,_0x31b8d1){return _0x3e0781['define']('SquareDetailsReport',attributes,{'tableName':_0x2ae3('0x8'),'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 5546620..44cfb5d 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 _0x7118=['message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','raw','debug','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x7118,0x159));var _0x8711=function(_0x3e7742,_0xd25b89){_0x3e7742=_0x3e7742-0x0;var _0x4e0a87=_0x7118[_0x3e7742];return _0x4e0a87;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8711('0x0'));var BPromise=require(_0x8711('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8711('0x2'));var db=require(_0x8711('0x3'))['db'];var utils=require(_0x8711('0x4'));var logger=require(_0x8711('0x5'))(_0x8711('0x6'));var config=require(_0x8711('0x7'));var jayson=require(_0x8711('0x8'));var client=jayson['client'][_0x8711('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2244c2,_0x1f23a9,_0x3d82f2){return new BPromise(function(_0x189349,_0xa46f29){return client[_0x8711('0xa')](_0x2244c2,_0x3d82f2)[_0x8711('0xb')](function(_0x32a826){logger[_0x8711('0xc')](_0x8711('0xd'),_0x1f23a9,'request\x20sent');logger['debug'](_0x8711('0xe'),_0x1f23a9,_0x8711('0xf'),JSON[_0x8711('0x10')](_0x32a826));if(_0x32a826['error']){if(_0x32a826['error'][_0x8711('0x11')]===0x1f4){logger[_0x8711('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1f23a9,_0x32a826['error'][_0x8711('0x13')]);return _0xa46f29(_0x32a826[_0x8711('0x12')][_0x8711('0x13')]);}logger[_0x8711('0x12')](_0x8711('0xd'),_0x1f23a9,_0x32a826[_0x8711('0x12')][_0x8711('0x13')]);return _0x189349(_0x32a826['error'][_0x8711('0x13')]);}else{logger[_0x8711('0xc')](_0x8711('0xd'),_0x1f23a9,_0x8711('0xf'));_0x189349(_0x32a826[_0x8711('0x14')][_0x8711('0x13')]);}})['catch'](function(_0x2f96a0){logger[_0x8711('0x12')](_0x8711('0xd'),_0x1f23a9,_0x2f96a0);_0xa46f29(_0x2f96a0);});});}exports[_0x8711('0x15')]=function(_0x19a157){var _0x47d18b=this;return new Promise(function(_0x5b2bf8,_0x569412){return db[_0x8711('0x16')][_0x8711('0x17')](_0x19a157[_0x8711('0x18')],{'raw':_0x19a157['options']?_0x19a157['options'][_0x8711('0x19')]===undefined?!![]:![]:!![]})[_0x8711('0xb')](function(_0x1209e0){logger[_0x8711('0xc')](_0x8711('0x15'),_0x19a157);logger[_0x8711('0x1a')](_0x8711('0x15'),_0x19a157,JSON[_0x8711('0x10')](_0x1209e0));_0x5b2bf8(_0x1209e0);})[_0x8711('0x1b')](function(_0x41369d){logger['error'](_0x8711('0x15'),_0x41369d[_0x8711('0x13')],_0x19a157);_0x569412(_0x47d18b[_0x8711('0x12')](0x1f4,_0x41369d[_0x8711('0x13')]));});});}; \ No newline at end of file +var _0x503a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','util','bluebird'];(function(_0x3c9bce,_0xda3d4f){var _0x3ced72=function(_0x3099f7){while(--_0x3099f7){_0x3c9bce['push'](_0x3c9bce['shift']());}};_0x3ced72(++_0xda3d4f);}(_0x503a,0x19d));var _0xa503=function(_0x1c206c,_0x30bdcf){_0x1c206c=_0x1c206c-0x0;var _0x188aaa=_0x503a[_0x1c206c];return _0x188aaa;};'use strict';var _=require(_0xa503('0x0'));var util=require(_0xa503('0x1'));var moment=require('moment');var BPromise=require(_0xa503('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa503('0x3'));var db=require(_0xa503('0x4'))['db'];var utils=require(_0xa503('0x5'));var logger=require(_0xa503('0x6'))(_0xa503('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa503('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1943d7,_0x5a1ead,_0x4428de){return new BPromise(function(_0x18a066,_0x35cca2){return client[_0xa503('0x9')](_0x1943d7,_0x4428de)[_0xa503('0xa')](function(_0x38bbff){logger[_0xa503('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x5a1ead,_0xa503('0xc'));logger[_0xa503('0xd')](_0xa503('0xe'),_0x5a1ead,'request\x20sent',JSON[_0xa503('0xf')](_0x38bbff));if(_0x38bbff['error']){if(_0x38bbff[_0xa503('0x10')]['code']===0x1f4){logger[_0xa503('0x10')](_0xa503('0x11'),_0x5a1ead,_0x38bbff['error']['message']);return _0x35cca2(_0x38bbff[_0xa503('0x10')][_0xa503('0x12')]);}logger[_0xa503('0x10')](_0xa503('0x11'),_0x5a1ead,_0x38bbff[_0xa503('0x10')][_0xa503('0x12')]);return _0x18a066(_0x38bbff[_0xa503('0x10')][_0xa503('0x12')]);}else{logger[_0xa503('0xb')](_0xa503('0x11'),_0x5a1ead,_0xa503('0xc'));_0x18a066(_0x38bbff[_0xa503('0x13')][_0xa503('0x12')]);}})[_0xa503('0x14')](function(_0x5d6641){logger[_0xa503('0x10')](_0xa503('0x11'),_0x5a1ead,_0x5d6641);_0x35cca2(_0x5d6641);});});}exports[_0xa503('0x15')]=function(_0x11e4a5){var _0xa3a50a=this;return new Promise(function(_0x5aae98,_0x401273){return db['SquareDetailsReport'][_0xa503('0x16')](_0x11e4a5[_0xa503('0x17')],{'raw':_0x11e4a5[_0xa503('0x18')]?_0x11e4a5[_0xa503('0x18')][_0xa503('0x19')]===undefined?!![]:![]:!![]})[_0xa503('0xa')](function(_0x207bfb){logger[_0xa503('0xb')](_0xa503('0x15'),_0x11e4a5);logger[_0xa503('0xd')](_0xa503('0x15'),_0x11e4a5,JSON[_0xa503('0xf')](_0x207bfb));_0x5aae98(_0x207bfb);})['catch'](function(_0x5d56e8){logger[_0xa503('0x10')](_0xa503('0x15'),_0x5d56e8[_0xa503('0x12')],_0x11e4a5);_0x401273(_0xa3a50a[_0xa503('0x10')](0x1f4,_0x5d56e8[_0xa503('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 5421b1d..4649a1f 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 _0x4689=['isAuthenticated','index','/process/:pid/kill','killProcess','exports','Router','./system.controller','get'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x4689,0xe5));var _0x9468=function(_0x1a8d9a,_0x53d5d9){_0x1a8d9a=_0x1a8d9a-0x0;var _0x449f41=_0x4689[_0x1a8d9a];return _0x449f41;};'use strict';var express=require('express');var router=express[_0x9468('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x9468('0x1'));router[_0x9468('0x2')]('/',auth[_0x9468('0x3')](),controller[_0x9468('0x4')]);router['get'](_0x9468('0x5'),auth[_0x9468('0x3')](),controller[_0x9468('0x6')]);module[_0x9468('0x7')]=router; \ No newline at end of file +var _0x54c5=['killProcess','exports','express','Router','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x387f6c,_0x1d11ea){var _0x210bf9=function(_0x529052){while(--_0x529052){_0x387f6c['push'](_0x387f6c['shift']());}};_0x210bf9(++_0x1d11ea);}(_0x54c5,0x92));var _0x554c=function(_0x18aa80,_0x1bf09a){_0x18aa80=_0x18aa80-0x0;var _0x281a46=_0x54c5[_0x18aa80];return _0x281a46;};'use strict';var express=require(_0x554c('0x0'));var router=express[_0x554c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x554c('0x2'));router[_0x554c('0x3')]('/',auth[_0x554c('0x4')](),controller[_0x554c('0x5')]);router[_0x554c('0x3')](_0x554c('0x6'),auth['isAuthenticated'](),controller[_0x554c('0x7')]);module[_0x554c('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 dba3f63..8f7164c 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 _0x7289=['index','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','bluebird','lodash','error','inspect','name','status','send'];(function(_0x26f00f,_0x26435a){var _0x2a070a=function(_0x38c6c2){while(--_0x38c6c2){_0x26f00f['push'](_0x26f00f['shift']());}};_0x2a070a(++_0x26435a);}(_0x7289,0xb2));var _0x9728=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7289[_0x4cf98e];return _0x1623ac;};'use strict';var info=require(_0x9728('0x0'));var exec=require(_0x9728('0x1'))[_0x9728('0x2')];var logger=require('../../config/logger')(_0x9728('0x3'));var util=require('util');var BPromise=require(_0x9728('0x4'));var _=require(_0x9728('0x5'));function handleError(_0x5c48de,_0x1439c5,_0x24e309){_0x1439c5=_0x1439c5||0x1f4;return function(_0xfd6c38){logger[_0x9728('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x24e309,_0x1439c5,util[_0x9728('0x7')](_0xfd6c38,{'showHidden':![],'depth':null}));delete _0xfd6c38[_0x9728('0x8')];_0x5c48de[_0x9728('0x9')](_0x1439c5)[_0x9728('0xa')](_0xfd6c38);};}exports[_0x9728('0xb')]=function(_0x50fd1d,_0x1851ca){return info['getAllData']()['then'](function(_0x31adf3){return _0x1851ca['status'](0xc8)[_0x9728('0xc')](_0x31adf3);})['catch'](function(_0x43ab78){return _0x1851ca[_0x9728('0x9')](0x1f4)[_0x9728('0xc')](_0x43ab78);});};exports[_0x9728('0xd')]=function(_0xcc1fa1,_0xcd5310){var _0xc8e95d=[_0x9728('0xe')];return new BPromise(function(_0x4f812f,_0xdc0d50){return exec(util[_0x9728('0xf')](_0x9728('0x10'),_0xcc1fa1[_0x9728('0x11')][_0x9728('0x12')]),function(_0x3a6e1e,_0x249834,_0x5dae31){if(_0x3a6e1e){return _0xdc0d50(_0x3a6e1e);}return _0x4f812f(_0x249834);});})[_0x9728('0x13')](function(_0x427bb4){var _0x173231=![];var _0x497f49=_0x427bb4[_0x9728('0x14')](/\n/);for(var _0x12ad85=0x0,_0x184beb=_0xc8e95d[_0x9728('0x15')];_0x12ad85<_0x184beb,_0x173231===![];_0x12ad85+=0x1){if(_0x427bb4[_0x9728('0x16')](_0xc8e95d[_0x12ad85])>=0x0){_0x173231=!![];}}if(!_0x173231){throw new Error(util[_0x9728('0xf')](_0x9728('0x17'),_0xcc1fa1['params'][_0x9728('0x12')]));}process[_0x9728('0x18')](_0xcc1fa1[_0x9728('0x11')]['pid'],_0x9728('0x19'));return _0xcd5310['status'](0xc8)[_0x9728('0xc')]({'message':util['format'](_0x9728('0x1a'),_0xcc1fa1[_0x9728('0x11')][_0x9728('0x12')])});})['catch'](handleError(_0xcd5310,null,_0x9728('0xd')));}; \ No newline at end of file +var _0x6838=['components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','error','inspect','name','status','send','index','getAllData','catch'];(function(_0xc1078,_0x87768b){var _0x1eb9bd=function(_0x5c35f9){while(--_0x5c35f9){_0xc1078['push'](_0xc1078['shift']());}};_0x1eb9bd(++_0x87768b);}(_0x6838,0xe4));var _0x8683=function(_0x49253a,_0x2c347d){_0x49253a=_0x49253a-0x0;var _0x749351=_0x6838[_0x49253a];return _0x749351;};'use strict';var info=require(_0x8683('0x0'));var exec=require(_0x8683('0x1'))[_0x8683('0x2')];var logger=require(_0x8683('0x3'))('api');var util=require(_0x8683('0x4'));var BPromise=require(_0x8683('0x5'));var _=require(_0x8683('0x6'));function handleError(_0x23a5c8,_0x49117c,_0x25adb8){_0x49117c=_0x49117c||0x1f4;return function(_0x55d923){logger[_0x8683('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x25adb8,_0x49117c,util[_0x8683('0x8')](_0x55d923,{'showHidden':![],'depth':null}));delete _0x55d923[_0x8683('0x9')];_0x23a5c8[_0x8683('0xa')](_0x49117c)[_0x8683('0xb')](_0x55d923);};}exports[_0x8683('0xc')]=function(_0x2613e8,_0x4ae3c8){return info[_0x8683('0xd')]()['then'](function(_0x29bed0){return _0x4ae3c8[_0x8683('0xa')](0xc8)['json'](_0x29bed0);})[_0x8683('0xe')](function(_0x4664bf){return _0x4ae3c8['status'](0x1f4)['json'](_0x4664bf);});};exports['killProcess']=function(_0x4edd0d,_0x5176f3){var _0xb62674=[_0x8683('0xf')];return new BPromise(function(_0xdcda32,_0x28cae2){return exec(util[_0x8683('0x10')](_0x8683('0x11'),_0x4edd0d[_0x8683('0x12')][_0x8683('0x13')]),function(_0x4eabdd,_0x451061,_0x56e1de){if(_0x4eabdd){return _0x28cae2(_0x4eabdd);}return _0xdcda32(_0x451061);});})[_0x8683('0x14')](function(_0xe5c2a){var _0x404962=![];var _0x3bb6c1=_0xe5c2a[_0x8683('0x15')](/\n/);for(var _0x458494=0x0,_0x18daff=_0xb62674[_0x8683('0x16')];_0x458494<_0x18daff,_0x404962===![];_0x458494+=0x1){if(_0xe5c2a[_0x8683('0x17')](_0xb62674[_0x458494])>=0x0){_0x404962=!![];}}if(!_0x404962){throw new Error(util['format'](_0x8683('0x18'),_0x4edd0d[_0x8683('0x12')][_0x8683('0x13')]));}process['kill'](_0x4edd0d[_0x8683('0x12')][_0x8683('0x13')],_0x8683('0x19'));return _0x5176f3[_0x8683('0xa')](0xc8)['json']({'message':util[_0x8683('0x10')](_0x8683('0x1a'),_0x4edd0d[_0x8683('0x12')]['pid'])});})['catch'](handleError(_0x5176f3,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index bed99d0..ed6f1cb 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 _0xbaf0=['get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x3b8363,_0x17bc8){var _0x4d8289=function(_0x520c1d){while(--_0x520c1d){_0x3b8363['push'](_0x3b8363['shift']());}};_0x4d8289(++_0x17bc8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['post']('/',auth[_0x0baf('0x9')](),controller['create']);router[_0x0baf('0xd')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);module[_0x0baf('0x11')]=router; \ No newline at end of file +var _0xbaf0=['get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x4402b6,_0x2c8543){var _0x1c9a9b=function(_0x3f2f80){while(--_0x3f2f80){_0x4402b6['push'](_0x4402b6['shift']());}};_0x1c9a9b(++_0x2c8543);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['post']('/',auth[_0x0baf('0x9')](),controller['create']);router[_0x0baf('0xd')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);module[_0x0baf('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 7fe85ce..aa9846c 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 _0x7ba5=['sequelize','STRING','name','#0091EA'];(function(_0x1d1653,_0x215cb5){var _0x5ed9ca=function(_0x478980){while(--_0x478980){_0x1d1653['push'](_0x1d1653['shift']());}};_0x5ed9ca(++_0x215cb5);}(_0x7ba5,0xe4));var _0x57ba=function(_0x29323b,_0x5ed75d){_0x29323b=_0x29323b-0x0;var _0x2a19e2=_0x7ba5[_0x29323b];return _0x2a19e2;};'use strict';var Sequelize=require(_0x57ba('0x0'));module['exports']={'name':{'type':Sequelize[_0x57ba('0x1')],'unique':_0x57ba('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x57ba('0x1')],'defaultValue':_0x57ba('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7b85=['STRING','sequelize','exports','name'];(function(_0x4f893a,_0x5ebd6b){var _0x4dd2d5=function(_0x4adbad){while(--_0x4adbad){_0x4f893a['push'](_0x4f893a['shift']());}};_0x4dd2d5(++_0x5ebd6b);}(_0x7b85,0x19d));var _0x57b8=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0x7b85[_0x1b6311];return _0x25aab6;};'use strict';var Sequelize=require(_0x57b8('0x0'));module[_0x57b8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x57b8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x57b8('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 6f71c42..0705e3a 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 _0x160f=['where','pick','filters','filter','map','type','key','VIRTUAL','field','merge','options','Tag','includeAll','include','findAll','rows','catch','show','params','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort'];(function(_0x43371b,_0x1cb4cf){var _0x19cd26=function(_0x5f43bf){while(--_0x5f43bf){_0x43371b['push'](_0x43371b['shift']());}};_0x19cd26(++_0x1cb4cf);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xf160('0x0'));var emlformat=require(_0xf160('0x1'));var rimraf=require(_0xf160('0x2'));var zipdir=require(_0xf160('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf160('0x4'));var moment=require(_0xf160('0x5'));var BPromise=require(_0xf160('0x6'));var Mustache=require(_0xf160('0x7'));var util=require(_0xf160('0x8'));var path=require(_0xf160('0x9'));var sox=require('sox');var csv=require(_0xf160('0xa'));var ejs=require(_0xf160('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var authService=require(_0xf160('0xf'));var hardwareService=require(_0xf160('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xf160('0x11'))(_0xf160('0x12'));var utils=require(_0xf160('0x13'));var config=require('../../config/environment');var db=require(_0xf160('0x14'))['db'];function respondWithStatusCode(_0x653d78,_0x25866c){_0x25866c=_0x25866c||0xcc;return function(_0x3b09ea){if(_0x3b09ea){return _0x653d78[_0xf160('0x15')](_0x25866c);}return _0x653d78['status'](_0x25866c)[_0xf160('0x16')]();};}function respondWithResult(_0x4f7cfe,_0x1496b6){_0x1496b6=_0x1496b6||0xc8;return function(_0x26951a){if(_0x26951a){return _0x4f7cfe[_0xf160('0x17')](_0x1496b6)[_0xf160('0x18')](_0x26951a);}};}function respondWithFilteredResult(_0x3a4faa,_0x31f7ae){return function(_0x2643ba){if(_0x2643ba){var _0x172337=_0x2643ba[_0xf160('0x19')],_0x1396ba=_0x31f7ae[_0xf160('0x1a')],_0x59ac02=_0x31f7ae[_0xf160('0x1a')]+_0x31f7ae['limit'],_0x477e4d;if(_0x59ac02>=_0x172337){_0x59ac02=_0x172337;_0x477e4d=0xc8;}else{_0x477e4d=0xce;}_0x3a4faa[_0xf160('0x17')](_0x477e4d);return _0x3a4faa['set'](_0xf160('0x1b'),_0x1396ba+'-'+_0x59ac02+'/'+_0x172337)[_0xf160('0x18')](_0x2643ba);}return null;};}function patchUpdates(_0x1e0c78){return function(_0x1e09f3){try{jsonpatch[_0xf160('0x1c')](_0x1e09f3,_0x1e0c78,!![]);}catch(_0x205afa){return BPromise[_0xf160('0x1d')](_0x205afa);}return _0x1e09f3[_0xf160('0x1e')]();};}function saveUpdates(_0x1fdb38,_0x4a58d9){return function(_0x40ccf0){if(_0x40ccf0){return _0x40ccf0[_0xf160('0x1f')](_0x1fdb38)[_0xf160('0x20')](function(_0x5ad173){return _0x5ad173;});}return null;};}function removeEntity(_0x435572,_0xff0491){return function(_0x454e63){if(_0x454e63){return _0x454e63[_0xf160('0x21')]()[_0xf160('0x20')](function(){var _0x1b0081=_0x454e63[_0xf160('0x22')]({'plain':!![]});var _0x5a72d1=_0xf160('0x23');return db[_0xf160('0x24')][_0xf160('0x21')]({'where':{'type':_0x5a72d1,'resourceId':_0x1b0081['id']}})[_0xf160('0x20')](function(){return _0x454e63;});})['then'](function(){_0x435572[_0xf160('0x17')](0xcc)[_0xf160('0x16')]();});}};}function handleEntityNotFound(_0x4a8003,_0x487c0c){return function(_0x168a09){if(!_0x168a09){_0x4a8003[_0xf160('0x15')](0x194);}return _0x168a09;};}function handleError(_0x39c0e3,_0x4c0c51){_0x4c0c51=_0x4c0c51||0x1f4;return function(_0xcfa9bd){logger[_0xf160('0x25')](_0xcfa9bd[_0xf160('0x26')]);if(_0xcfa9bd[_0xf160('0x27')]){delete _0xcfa9bd[_0xf160('0x27')];}_0x39c0e3[_0xf160('0x17')](_0x4c0c51)['send'](_0xcfa9bd);};}exports['index']=function(_0x48145e,_0x26e7b9){var _0x16a5fa={},_0xcaab39={},_0x26e06b={'count':0x0,'rows':[]};var _0x399cce=db['Tag']['rawAttributes'];_0xcaab39[_0xf160('0x28')]=_['keys'](_0x399cce);_0xcaab39['query']=_[_0xf160('0x29')](_0x48145e[_0xf160('0x2a')]);_0xcaab39['filters']=_[_0xf160('0x2b')](_0xcaab39[_0xf160('0x28')],_0xcaab39['query']);_0x16a5fa['attributes']=_['intersection'](_0xcaab39['model'],qs[_0xf160('0x2c')](_0x48145e[_0xf160('0x2a')][_0xf160('0x2c')]));_0x16a5fa[_0xf160('0x2d')]=_0x16a5fa[_0xf160('0x2d')][_0xf160('0x2e')]?_0x16a5fa['attributes']:_0xcaab39['model'];if(!_0x48145e['query'][_0xf160('0x2f')]('nolimit')){_0x16a5fa['limit']=qs[_0xf160('0x30')](_0x48145e[_0xf160('0x2a')]['limit']);_0x16a5fa[_0xf160('0x1a')]=qs[_0xf160('0x1a')](_0x48145e[_0xf160('0x2a')][_0xf160('0x1a')]);}_0x16a5fa[_0xf160('0x31')]=qs['sort'](_0x48145e[_0xf160('0x2a')][_0xf160('0x32')]);_0x16a5fa[_0xf160('0x33')]=qs['filters'](_[_0xf160('0x34')](_0x48145e[_0xf160('0x2a')],_0xcaab39[_0xf160('0x35')]));if(_0x48145e[_0xf160('0x2a')][_0xf160('0x36')]){_0x16a5fa[_0xf160('0x33')]=_['merge'](_0x16a5fa['where'],{'$or':_[_0xf160('0x37')](_0x399cce,function(_0x21c248){if(_0x21c248[_0xf160('0x38')][_0xf160('0x39')]!==_0xf160('0x3a')){var _0x24d668={};_0x24d668[_0x21c248[_0xf160('0x3b')]]={'$like':'%'+_0x48145e[_0xf160('0x2a')][_0xf160('0x36')]+'%'};return _0x24d668;}})});}_0x16a5fa=_[_0xf160('0x3c')]({},_0x16a5fa,_0x48145e[_0xf160('0x3d')]);var _0x275bd0={'where':_0x16a5fa[_0xf160('0x33')]};return db[_0xf160('0x3e')][_0xf160('0x19')](_0x275bd0)[_0xf160('0x20')](function(_0x161f06){_0x26e06b[_0xf160('0x19')]=_0x161f06;if(_0x48145e[_0xf160('0x2a')][_0xf160('0x3f')]){_0x16a5fa[_0xf160('0x40')]=[{'all':!![]}];}return db[_0xf160('0x3e')][_0xf160('0x41')](_0x16a5fa);})[_0xf160('0x20')](function(_0x494d76){_0x26e06b[_0xf160('0x42')]=_0x494d76;return _0x26e06b;})[_0xf160('0x20')](respondWithFilteredResult(_0x26e7b9,_0x16a5fa))[_0xf160('0x43')](handleError(_0x26e7b9,null));};exports[_0xf160('0x44')]=function(_0x3d273d,_0xed8784){var _0xcc3263={'raw':!![],'where':{'id':_0x3d273d[_0xf160('0x45')]['id']}},_0x4f65c9={};_0x4f65c9['model']=_[_0xf160('0x29')](db[_0xf160('0x3e')]['rawAttributes']);_0x4f65c9[_0xf160('0x2a')]=_[_0xf160('0x29')](_0x3d273d[_0xf160('0x2a')]);_0x4f65c9[_0xf160('0x35')]=_[_0xf160('0x2b')](_0x4f65c9[_0xf160('0x28')],_0x4f65c9[_0xf160('0x2a')]);_0xcc3263['attributes']=_[_0xf160('0x2b')](_0x4f65c9[_0xf160('0x28')],qs[_0xf160('0x2c')](_0x3d273d[_0xf160('0x2a')][_0xf160('0x2c')]));_0xcc3263[_0xf160('0x2d')]=_0xcc3263[_0xf160('0x2d')][_0xf160('0x2e')]?_0xcc3263[_0xf160('0x2d')]:_0x4f65c9[_0xf160('0x28')];if(_0x3d273d[_0xf160('0x2a')]['includeAll']){_0xcc3263['include']=[{'all':!![]}];}_0xcc3263=_[_0xf160('0x3c')]({},_0xcc3263,_0x3d273d[_0xf160('0x3d')]);return db[_0xf160('0x3e')][_0xf160('0x46')](_0xcc3263)[_0xf160('0x20')](handleEntityNotFound(_0xed8784,null))[_0xf160('0x20')](respondWithResult(_0xed8784,null))['catch'](handleError(_0xed8784,null));};exports[_0xf160('0x47')]=function(_0x5abc6a,_0x55ab52){return db[_0xf160('0x3e')][_0xf160('0x47')](_0x5abc6a['body'],{})['then'](function(_0x2f1648){var _0x2681f2=_0x5abc6a[_0xf160('0x48')][_0xf160('0x22')]({'plain':!![]});if(!_0x2681f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2681f2['role']==='user'){var _0x50a97d=_0x2f1648[_0xf160('0x22')]({'plain':!![]});var _0x57f5a9=_0xf160('0x23');return db[_0xf160('0x49')][_0xf160('0x46')]({'where':{'name':_0x57f5a9,'userProfileId':_0x2681f2[_0xf160('0x4a')]},'raw':!![]})['then'](function(_0x45af83){if(_0x45af83&&_0x45af83[_0xf160('0x4b')]===0x0){return db[_0xf160('0x24')]['create']({'name':_0x50a97d[_0xf160('0x27')],'resourceId':_0x50a97d['id'],'type':_0x45af83[_0xf160('0x27')],'sectionId':_0x45af83['id']},{})[_0xf160('0x20')](function(){return _0x2f1648;});}else{return _0x2f1648;}})['catch'](function(_0x2dba32){logger[_0xf160('0x25')](_0xf160('0x4c'),_0x2dba32);throw _0x2dba32;});}return _0x2f1648;})[_0xf160('0x20')](respondWithResult(_0x55ab52,0xc9))[_0xf160('0x43')](handleError(_0x55ab52,null));};exports['update']=function(_0x4c90ab,_0x3c8765){if(_0x4c90ab['body']['id']){delete _0x4c90ab[_0xf160('0x4d')]['id'];}return db[_0xf160('0x3e')]['find']({'where':{'id':_0x4c90ab['params']['id']}})[_0xf160('0x20')](handleEntityNotFound(_0x3c8765,null))[_0xf160('0x20')](saveUpdates(_0x4c90ab['body'],null))[_0xf160('0x20')](respondWithResult(_0x3c8765,null))[_0xf160('0x43')](handleError(_0x3c8765,null));};exports[_0xf160('0x21')]=function(_0x405d7e,_0x5f3ded){return db[_0xf160('0x3e')]['find']({'where':{'id':_0x405d7e[_0xf160('0x45')]['id']}})[_0xf160('0x20')](handleEntityNotFound(_0x5f3ded,null))[_0xf160('0x20')](removeEntity(_0x5f3ded,null))[_0xf160('0x43')](handleError(_0x5f3ded,null));}; \ No newline at end of file +var _0x3a6d=['sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','update','then','Tags','UserProfileResource','destroy','error','stack','name','send','index','Tag','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','map','type','key','filter','options','count','include','findAll','show','find','catch','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3a6d,0x143));var _0xd3a6=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x3a6d[_0x5d2803];return _0xdcad2c;};'use strict';var pdf=require(_0xd3a6('0x0'));var emlformat=require(_0xd3a6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd3a6('0x2'));var jsonpatch=require(_0xd3a6('0x3'));var rp=require(_0xd3a6('0x4'));var moment=require(_0xd3a6('0x5'));var BPromise=require(_0xd3a6('0x6'));var Mustache=require('mustache');var util=require(_0xd3a6('0x7'));var path=require(_0xd3a6('0x8'));var sox=require(_0xd3a6('0x9'));var csv=require(_0xd3a6('0xa'));var ejs=require(_0xd3a6('0xb'));var fs=require('fs');var _=require(_0xd3a6('0xc'));var squel=require('squel');var crypto=require(_0xd3a6('0xd'));var jsforce=require(_0xd3a6('0xe'));var deskjs=require(_0xd3a6('0xf'));var toCsv=require(_0xd3a6('0xa'));var querystring=require(_0xd3a6('0x10'));var Papa=require(_0xd3a6('0x11'));var authService=require(_0xd3a6('0x12'));var hardwareService=require(_0xd3a6('0x13'));var Redis=require(_0xd3a6('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xd3a6('0x15'))(_0xd3a6('0x16'));var utils=require(_0xd3a6('0x17'));var config=require(_0xd3a6('0x18'));var db=require(_0xd3a6('0x19'))['db'];function respondWithStatusCode(_0x517a3b,_0x5430c0){_0x5430c0=_0x5430c0||0xcc;return function(_0x4b0467){if(_0x4b0467){return _0x517a3b[_0xd3a6('0x1a')](_0x5430c0);}return _0x517a3b[_0xd3a6('0x1b')](_0x5430c0)[_0xd3a6('0x1c')]();};}function respondWithResult(_0x41eca8,_0x3ef56f){_0x3ef56f=_0x3ef56f||0xc8;return function(_0x2911a0){if(_0x2911a0){return _0x41eca8[_0xd3a6('0x1b')](_0x3ef56f)['json'](_0x2911a0);}};}function respondWithFilteredResult(_0x473a97,_0xf5ace5){return function(_0x171a8f){if(_0x171a8f){var _0x500a37=_0x171a8f['count'],_0x3c2399=_0xf5ace5[_0xd3a6('0x1d')],_0x305b61=_0xf5ace5['offset']+_0xf5ace5['limit'],_0x1781f6;if(_0x305b61>=_0x500a37){_0x305b61=_0x500a37;_0x1781f6=0xc8;}else{_0x1781f6=0xce;}_0x473a97[_0xd3a6('0x1b')](_0x1781f6);return _0x473a97[_0xd3a6('0x1e')](_0xd3a6('0x1f'),_0x3c2399+'-'+_0x305b61+'/'+_0x500a37)[_0xd3a6('0x20')](_0x171a8f);}return null;};}function patchUpdates(_0x22fb05){return function(_0x2e64d0){try{jsonpatch[_0xd3a6('0x21')](_0x2e64d0,_0x22fb05,!![]);}catch(_0x4ec27c){return BPromise[_0xd3a6('0x22')](_0x4ec27c);}return _0x2e64d0['save']();};}function saveUpdates(_0x6c6d21,_0x7fa2c0){return function(_0x12f2c1){if(_0x12f2c1){return _0x12f2c1[_0xd3a6('0x23')](_0x6c6d21)[_0xd3a6('0x24')](function(_0x6ecd88){return _0x6ecd88;});}return null;};}function removeEntity(_0x54c193,_0xe7d595){return function(_0x422f5c){if(_0x422f5c){return _0x422f5c['destroy']()['then'](function(){var _0x5846bc=_0x422f5c['get']({'plain':!![]});var _0x5c9075=_0xd3a6('0x25');return db[_0xd3a6('0x26')][_0xd3a6('0x27')]({'where':{'type':_0x5c9075,'resourceId':_0x5846bc['id']}})['then'](function(){return _0x422f5c;});})[_0xd3a6('0x24')](function(){_0x54c193['status'](0xcc)[_0xd3a6('0x1c')]();});}};}function handleEntityNotFound(_0x16afc8,_0x429079){return function(_0x4f6130){if(!_0x4f6130){_0x16afc8[_0xd3a6('0x1a')](0x194);}return _0x4f6130;};}function handleError(_0x3bc8d1,_0x1b09ac){_0x1b09ac=_0x1b09ac||0x1f4;return function(_0x219e32){logger[_0xd3a6('0x28')](_0x219e32[_0xd3a6('0x29')]);if(_0x219e32['name']){delete _0x219e32[_0xd3a6('0x2a')];}_0x3bc8d1[_0xd3a6('0x1b')](_0x1b09ac)[_0xd3a6('0x2b')](_0x219e32);};}exports[_0xd3a6('0x2c')]=function(_0x30abc2,_0x45c628){var _0x5c2186={},_0x535bd4={},_0x1f4859={'count':0x0,'rows':[]};var _0x210aa1=db[_0xd3a6('0x2d')][_0xd3a6('0x2e')];_0x535bd4['model']=_[_0xd3a6('0x2f')](_0x210aa1);_0x535bd4[_0xd3a6('0x30')]=_['keys'](_0x30abc2[_0xd3a6('0x30')]);_0x535bd4['filters']=_[_0xd3a6('0x31')](_0x535bd4[_0xd3a6('0x32')],_0x535bd4[_0xd3a6('0x30')]);_0x5c2186[_0xd3a6('0x33')]=_[_0xd3a6('0x31')](_0x535bd4[_0xd3a6('0x32')],qs[_0xd3a6('0x34')](_0x30abc2['query']['fields']));_0x5c2186[_0xd3a6('0x33')]=_0x5c2186[_0xd3a6('0x33')][_0xd3a6('0x35')]?_0x5c2186['attributes']:_0x535bd4[_0xd3a6('0x32')];if(!_0x30abc2[_0xd3a6('0x30')][_0xd3a6('0x36')](_0xd3a6('0x37'))){_0x5c2186[_0xd3a6('0x38')]=qs[_0xd3a6('0x38')](_0x30abc2[_0xd3a6('0x30')][_0xd3a6('0x38')]);_0x5c2186['offset']=qs[_0xd3a6('0x1d')](_0x30abc2[_0xd3a6('0x30')][_0xd3a6('0x1d')]);}_0x5c2186[_0xd3a6('0x39')]=qs[_0xd3a6('0x3a')](_0x30abc2[_0xd3a6('0x30')]['sort']);_0x5c2186[_0xd3a6('0x3b')]=qs['filters'](_[_0xd3a6('0x3c')](_0x30abc2[_0xd3a6('0x30')],_0x535bd4[_0xd3a6('0x3d')]));if(_0x30abc2[_0xd3a6('0x30')]['filter']){_0x5c2186['where']=_[_0xd3a6('0x3e')](_0x5c2186[_0xd3a6('0x3b')],{'$or':_[_0xd3a6('0x3f')](_0x210aa1,function(_0x5188e1){if(_0x5188e1[_0xd3a6('0x40')][_0xd3a6('0x41')]!=='VIRTUAL'){var _0x2f8e33={};_0x2f8e33[_0x5188e1['field']]={'$like':'%'+_0x30abc2[_0xd3a6('0x30')][_0xd3a6('0x42')]+'%'};return _0x2f8e33;}})});}_0x5c2186=_['merge']({},_0x5c2186,_0x30abc2[_0xd3a6('0x43')]);var _0x570fb4={'where':_0x5c2186[_0xd3a6('0x3b')]};return db[_0xd3a6('0x2d')]['count'](_0x570fb4)[_0xd3a6('0x24')](function(_0xfcef03){_0x1f4859[_0xd3a6('0x44')]=_0xfcef03;if(_0x30abc2[_0xd3a6('0x30')]['includeAll']){_0x5c2186[_0xd3a6('0x45')]=[{'all':!![]}];}return db[_0xd3a6('0x2d')][_0xd3a6('0x46')](_0x5c2186);})[_0xd3a6('0x24')](function(_0x11fb78){_0x1f4859['rows']=_0x11fb78;return _0x1f4859;})[_0xd3a6('0x24')](respondWithFilteredResult(_0x45c628,_0x5c2186))['catch'](handleError(_0x45c628,null));};exports[_0xd3a6('0x47')]=function(_0x1bc18a,_0x16764c){var _0x5469cc={'raw':!![],'where':{'id':_0x1bc18a['params']['id']}},_0x74242e={};_0x74242e[_0xd3a6('0x32')]=_['keys'](db[_0xd3a6('0x2d')][_0xd3a6('0x2e')]);_0x74242e[_0xd3a6('0x30')]=_[_0xd3a6('0x2f')](_0x1bc18a[_0xd3a6('0x30')]);_0x74242e[_0xd3a6('0x3d')]=_[_0xd3a6('0x31')](_0x74242e['model'],_0x74242e[_0xd3a6('0x30')]);_0x5469cc[_0xd3a6('0x33')]=_[_0xd3a6('0x31')](_0x74242e[_0xd3a6('0x32')],qs['fields'](_0x1bc18a[_0xd3a6('0x30')][_0xd3a6('0x34')]));_0x5469cc[_0xd3a6('0x33')]=_0x5469cc[_0xd3a6('0x33')][_0xd3a6('0x35')]?_0x5469cc[_0xd3a6('0x33')]:_0x74242e[_0xd3a6('0x32')];if(_0x1bc18a[_0xd3a6('0x30')]['includeAll']){_0x5469cc[_0xd3a6('0x45')]=[{'all':!![]}];}_0x5469cc=_[_0xd3a6('0x3e')]({},_0x5469cc,_0x1bc18a[_0xd3a6('0x43')]);return db[_0xd3a6('0x2d')][_0xd3a6('0x48')](_0x5469cc)['then'](handleEntityNotFound(_0x16764c,null))[_0xd3a6('0x24')](respondWithResult(_0x16764c,null))[_0xd3a6('0x49')](handleError(_0x16764c,null));};exports[_0xd3a6('0x4a')]=function(_0x34f1d0,_0x36b324){return db[_0xd3a6('0x2d')][_0xd3a6('0x4a')](_0x34f1d0[_0xd3a6('0x4b')],{})['then'](function(_0x7828c2){var _0x59b6ef=_0x34f1d0[_0xd3a6('0x4c')][_0xd3a6('0x4d')]({'plain':!![]});if(!_0x59b6ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59b6ef[_0xd3a6('0x4e')]===_0xd3a6('0x4c')){var _0x3cf99a=_0x7828c2[_0xd3a6('0x4d')]({'plain':!![]});var _0x1c48c3=_0xd3a6('0x25');return db[_0xd3a6('0x4f')][_0xd3a6('0x48')]({'where':{'name':_0x1c48c3,'userProfileId':_0x59b6ef[_0xd3a6('0x50')]},'raw':!![]})[_0xd3a6('0x24')](function(_0x4a2ad8){if(_0x4a2ad8&&_0x4a2ad8[_0xd3a6('0x51')]===0x0){return db[_0xd3a6('0x26')][_0xd3a6('0x4a')]({'name':_0x3cf99a[_0xd3a6('0x2a')],'resourceId':_0x3cf99a['id'],'type':_0x4a2ad8[_0xd3a6('0x2a')],'sectionId':_0x4a2ad8['id']},{})[_0xd3a6('0x24')](function(){return _0x7828c2;});}else{return _0x7828c2;}})[_0xd3a6('0x49')](function(_0x466f95){logger[_0xd3a6('0x28')](_0xd3a6('0x52'),_0x466f95);throw _0x466f95;});}return _0x7828c2;})['then'](respondWithResult(_0x36b324,0xc9))[_0xd3a6('0x49')](handleError(_0x36b324,null));};exports[_0xd3a6('0x23')]=function(_0x618b72,_0x4995b7){if(_0x618b72[_0xd3a6('0x4b')]['id']){delete _0x618b72['body']['id'];}return db['Tag']['find']({'where':{'id':_0x618b72['params']['id']}})[_0xd3a6('0x24')](handleEntityNotFound(_0x4995b7,null))[_0xd3a6('0x24')](saveUpdates(_0x618b72[_0xd3a6('0x4b')],null))[_0xd3a6('0x24')](respondWithResult(_0x4995b7,null))[_0xd3a6('0x49')](handleError(_0x4995b7,null));};exports[_0xd3a6('0x27')]=function(_0x33bfbb,_0x2a8b59){return db[_0xd3a6('0x2d')][_0xd3a6('0x48')]({'where':{'id':_0x33bfbb['params']['id']}})['then'](handleEntityNotFound(_0x2a8b59,null))[_0xd3a6('0x24')](removeEntity(_0x2a8b59,null))[_0xd3a6('0x49')](handleError(_0x2a8b59,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index aecbaf2..70de59f 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 _0xbfce=['./tag.attributes','Tag','tools_tags','api','moment','request-promise'];(function(_0x31c981,_0x18c6c0){var _0x44c461=function(_0xd0f6c2){while(--_0xd0f6c2){_0x31c981['push'](_0x31c981['shift']());}};_0x44c461(++_0x18c6c0);}(_0xbfce,0xe7));var _0xebfc=function(_0x4c062d,_0x13d802){_0x4c062d=_0x4c062d-0x0;var _0x30dcff=_0xbfce[_0x4c062d];return _0x30dcff;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xebfc('0x0'));var moment=require(_0xebfc('0x1'));var BPromise=require('bluebird');var rp=require(_0xebfc('0x2'));var attributes=require(_0xebfc('0x3'));module['exports']=function(_0x5807f5,_0x39ec31){return _0x5807f5['define'](_0xebfc('0x4'),attributes,{'tableName':_0xebfc('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2d3=['define','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','./tag.attributes','exports'];(function(_0x28f33b,_0x18490d){var _0x42b6d7=function(_0x4248fc){while(--_0x4248fc){_0x28f33b['push'](_0x28f33b['shift']());}};_0x42b6d7(++_0x18490d);}(_0xc2d3,0x1e7));var _0x3c2d=function(_0x336440,_0x3a5012){_0x336440=_0x336440-0x0;var _0x1cd343=_0xc2d3[_0x336440];return _0x1cd343;};'use strict';var _=require('lodash');var util=require(_0x3c2d('0x0'));var logger=require(_0x3c2d('0x1'))(_0x3c2d('0x2'));var moment=require(_0x3c2d('0x3'));var BPromise=require(_0x3c2d('0x4'));var rp=require(_0x3c2d('0x5'));var attributes=require(_0x3c2d('0x6'));module[_0x3c2d('0x7')]=function(_0x22b7b7,_0x4a5da9){return _0x22b7b7[_0x3c2d('0x8')](_0x3c2d('0x9'),attributes,{'tableName':_0x3c2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 59fc31e..2523bb9 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 _0xe533=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x5e3ff7,_0x552770){var _0x5815c8=function(_0xacf204){while(--_0xacf204){_0x5e3ff7['push'](_0x5e3ff7['shift']());}};_0x5815c8(++_0x552770);}(_0xe533,0x8f));var _0x3e53=function(_0x558d7d,_0x4eb721){_0x558d7d=_0x558d7d-0x0;var _0x49d96f=_0xe533[_0x558d7d];return _0x49d96f;};'use strict';var _=require(_0x3e53('0x0'));var util=require(_0x3e53('0x1'));var moment=require('moment');var BPromise=require(_0x3e53('0x2'));var rs=require(_0x3e53('0x3'));var fs=require('fs');var Redis=require(_0x3e53('0x4'));var db=require(_0x3e53('0x5'))['db'];var utils=require(_0x3e53('0x6'));var logger=require(_0x3e53('0x7'))(_0x3e53('0x8'));var config=require(_0x3e53('0x9'));var jayson=require(_0x3e53('0xa'));var client=jayson['client'][_0x3e53('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x518685,_0x191869,_0x4eee3d){return new BPromise(function(_0x16fd28,_0xed4170){return client[_0x3e53('0xc')](_0x518685,_0x4eee3d)[_0x3e53('0xd')](function(_0x4a3ca1){logger[_0x3e53('0xe')](_0x3e53('0xf'),_0x191869,_0x3e53('0x10'));logger[_0x3e53('0x11')](_0x3e53('0x12'),_0x191869,_0x3e53('0x10'),JSON[_0x3e53('0x13')](_0x4a3ca1));if(_0x4a3ca1['error']){if(_0x4a3ca1[_0x3e53('0x14')][_0x3e53('0x15')]===0x1f4){logger[_0x3e53('0x14')](_0x3e53('0xf'),_0x191869,_0x4a3ca1[_0x3e53('0x14')][_0x3e53('0x16')]);return _0xed4170(_0x4a3ca1[_0x3e53('0x14')][_0x3e53('0x16')]);}logger['error'](_0x3e53('0xf'),_0x191869,_0x4a3ca1[_0x3e53('0x14')]['message']);return _0x16fd28(_0x4a3ca1[_0x3e53('0x14')][_0x3e53('0x16')]);}else{logger[_0x3e53('0xe')](_0x3e53('0xf'),_0x191869,_0x3e53('0x10'));_0x16fd28(_0x4a3ca1['result']['message']);}})[_0x3e53('0x17')](function(_0x473eab){logger[_0x3e53('0x14')](_0x3e53('0xf'),_0x191869,_0x473eab);_0xed4170(_0x473eab);});});} \ No newline at end of file +var _0x9ce5=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ce5,0xc3));var _0x59ce=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x9ce5[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0x59ce('0x0'));var util=require(_0x59ce('0x1'));var moment=require(_0x59ce('0x2'));var BPromise=require('bluebird');var rs=require(_0x59ce('0x3'));var fs=require('fs');var Redis=require(_0x59ce('0x4'));var db=require(_0x59ce('0x5'))['db'];var utils=require(_0x59ce('0x6'));var logger=require(_0x59ce('0x7'))(_0x59ce('0x8'));var config=require(_0x59ce('0x9'));var jayson=require(_0x59ce('0xa'));var client=jayson[_0x59ce('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8d468b,_0x51499a,_0x52b304){return new BPromise(function(_0x2b4fc4,_0xa816bf){return client[_0x59ce('0xc')](_0x8d468b,_0x52b304)[_0x59ce('0xd')](function(_0x5e35de){logger[_0x59ce('0xe')](_0x59ce('0xf'),_0x51499a,'request\x20sent');logger[_0x59ce('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x51499a,_0x59ce('0x11'),JSON[_0x59ce('0x12')](_0x5e35de));if(_0x5e35de['error']){if(_0x5e35de['error'][_0x59ce('0x13')]===0x1f4){logger[_0x59ce('0x14')](_0x59ce('0xf'),_0x51499a,_0x5e35de[_0x59ce('0x14')][_0x59ce('0x15')]);return _0xa816bf(_0x5e35de[_0x59ce('0x14')][_0x59ce('0x15')]);}logger[_0x59ce('0x14')]('Tag,\x20%s,\x20%s',_0x51499a,_0x5e35de[_0x59ce('0x14')][_0x59ce('0x15')]);return _0x2b4fc4(_0x5e35de[_0x59ce('0x14')][_0x59ce('0x15')]);}else{logger[_0x59ce('0xe')](_0x59ce('0xf'),_0x51499a,_0x59ce('0x11'));_0x2b4fc4(_0x5e35de[_0x59ce('0x16')]['message']);}})[_0x59ce('0x17')](function(_0x4affce){logger[_0x59ce('0x14')]('Tag,\x20%s,\x20%s',_0x51499a,_0x4affce);_0xa816bf(_0x4affce);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 24a636c..1f007bf 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 _0x8616=['update','delete','/:id','destroy','removeQueues','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','put'];(function(_0x4ce2b5,_0x1248d1){var _0x389c65=function(_0x16698e){while(--_0x16698e){_0x4ce2b5['push'](_0x4ce2b5['shift']());}};_0x389c65(++_0x1248d1);}(_0x8616,0x165));var _0x6861=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x8616[_0x496333];return _0x44256e;};'use strict';var multer=require(_0x6861('0x0'));var util=require(_0x6861('0x1'));var path=require(_0x6861('0x2'));var timeout=require(_0x6861('0x3'));var express=require('express');var router=express[_0x6861('0x4')]();var auth=require(_0x6861('0x5'));var interaction=require(_0x6861('0x6'));var config=require(_0x6861('0x7'));var controller=require('./team.controller');router[_0x6861('0x8')]('/',auth[_0x6861('0x9')](),controller[_0x6861('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6861('0xb')]);router[_0x6861('0x8')](_0x6861('0xc'),auth[_0x6861('0x9')](),controller[_0x6861('0xd')]);router['get'](_0x6861('0xe'),auth['isAuthenticated'](),controller[_0x6861('0xf')]);router[_0x6861('0x10')]('/',auth[_0x6861('0x9')](),controller[_0x6861('0x11')]);router['post'](_0x6861('0xc'),auth[_0x6861('0x9')](),controller[_0x6861('0x12')]);router['post'](_0x6861('0xe'),auth['isAuthenticated'](),controller[_0x6861('0x13')]);router[_0x6861('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6861('0x15')]);router[_0x6861('0x16')](_0x6861('0x17'),auth[_0x6861('0x9')](),controller[_0x6861('0x18')]);router[_0x6861('0x16')]('/:id/queues',auth['isAuthenticated'](),controller[_0x6861('0x19')]);router[_0x6861('0x16')](_0x6861('0xe'),auth['isAuthenticated'](),controller[_0x6861('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x1476=['create','post','addQueues','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','/:id/users','getAgents'];(function(_0x34a513,_0x481dec){var _0x1765d9=function(_0x16ce11){while(--_0x16ce11){_0x34a513['push'](_0x34a513['shift']());}};_0x1765d9(++_0x481dec);}(_0x1476,0x133));var _0x6147=function(_0x5f0ec4,_0x1ca71c){_0x5f0ec4=_0x5f0ec4-0x0;var _0x4d48de=_0x1476[_0x5f0ec4];return _0x4d48de;};'use strict';var multer=require(_0x6147('0x0'));var util=require(_0x6147('0x1'));var path=require(_0x6147('0x2'));var timeout=require(_0x6147('0x3'));var express=require('express');var router=express[_0x6147('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6147('0x5'));var config=require(_0x6147('0x6'));var controller=require(_0x6147('0x7'));router[_0x6147('0x8')]('/',auth[_0x6147('0x9')](),controller[_0x6147('0xa')]);router[_0x6147('0x8')](_0x6147('0xb'),auth['isAuthenticated'](),controller[_0x6147('0xc')]);router[_0x6147('0x8')](_0x6147('0xd'),auth[_0x6147('0x9')](),controller[_0x6147('0xe')]);router[_0x6147('0x8')](_0x6147('0xf'),auth['isAuthenticated'](),controller[_0x6147('0x10')]);router['post']('/',auth[_0x6147('0x9')](),controller[_0x6147('0x11')]);router[_0x6147('0x12')]('/:id/queues',auth['isAuthenticated'](),controller[_0x6147('0x13')]);router[_0x6147('0x12')](_0x6147('0xf'),auth[_0x6147('0x9')](),controller['addAgents']);router[_0x6147('0x14')](_0x6147('0xb'),auth[_0x6147('0x9')](),controller[_0x6147('0x15')]);router[_0x6147('0x16')](_0x6147('0xb'),auth[_0x6147('0x9')](),controller[_0x6147('0x17')]);router['delete'](_0x6147('0xd'),auth[_0x6147('0x9')](),controller[_0x6147('0x18')]);router['delete']('/:id/users',auth[_0x6147('0x9')](),controller[_0x6147('0x19')]);module[_0x6147('0x1a')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 2ab46a9..c1d49f1 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 _0xc368=['sequelize','exports','name','STRING'];(function(_0xe1885b,_0x1f3ad7){var _0x3d2ab9=function(_0x43139c){while(--_0x43139c){_0xe1885b['push'](_0xe1885b['shift']());}};_0x3d2ab9(++_0x1f3ad7);}(_0xc368,0xd8));var _0x8c36=function(_0x23adca,_0x2d2e9d){_0x23adca=_0x23adca-0x0;var _0x477ddb=_0xc368[_0x23adca];return _0x477ddb;};'use strict';var Sequelize=require(_0x8c36('0x0'));module[_0x8c36('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8c36('0x2')},'description':{'type':Sequelize[_0x8c36('0x3')]}}; \ No newline at end of file +var _0x34aa=['name','sequelize','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x34aa,0x8d));var _0xa34a=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x34aa[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0xa34a('0x0'));module[_0xa34a('0x1')]={'name':{'type':Sequelize[_0xa34a('0x2')],'allowNull':![],'unique':_0xa34a('0x3')},'description':{'type':Sequelize[_0xa34a('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index e921566..89eb46e 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 _0xa9e0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','add','ids','removeQueues','remove','voice','chat','mail','sms','fax','openchannel','each','addAgents','User','findAll','loginInPause','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','removeAgents','isArray','emit','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){return BPromise['each']([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x40fc56){return _0x361b21[_0x0a9e('0x25')+_[_0x0a9e('0x55')](_0x40fc56)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x40fc56===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]});}})[_0x0a9e('0x23')](function(_0x53a6a1){if(_0x40fc56===_0x0a9e('0x60')){return BPromise[_0x0a9e('0x66')](_0x53a6a1,function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){var _0x9044fe;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x81d748,null))[_0x0a9e('0x23')](function(_0x5955f1){if(_0x5955f1){return BPromise[_0x0a9e('0x66')]([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),'sms',_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x1d4877){return _0x5955f1['get'+_[_0x0a9e('0x55')](_0x1d4877)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x255e49){return BPromise[_0x0a9e('0x66')](_0x255e49,function(_0x32b9bd){return _0x32b9bd[_0x0a9e('0x74')](_0x4dc6b3['query'][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_0x1d4877==='voice'){return db[_0x0a9e('0x6c')][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x32b9bd['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids']}});}});});})[_0x0a9e('0x23')](function(){return _0x5955f1;});})['then'](function(){return _0x5955f1;});}})[_0x0a9e('0x23')](function(_0x2b5148){if(_0x2b5148){return _0x2b5148[_0x0a9e('0x74')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(_0x16a039){if(_[_0x0a9e('0x75')](_0x4dc6b3['query'][_0x0a9e('0x5d')])){for(var _0x31d25a=0x0;_0x31d25a<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x31d25a+=0x1){socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x31d25a],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids'],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x78')]=function(_0xb0599a,_0x5d9ddb,_0x3afc8c){var _0x1756c7={};var _0x5ce99d={};var _0x23b447;var _0x5e725e;return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0xb0599a[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5d9ddb,null))['then'](function(_0x3ceba6){if(_0x3ceba6){_0x23b447=_0x3ceba6;_0x5ce99d['model']=_[_0x0a9e('0x2d')](db[_0x0a9e('0x68')]['rawAttributes']);_0x5ce99d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0xb0599a[_0x0a9e('0x2e')]);_0x5ce99d['filters']=_['intersection'](_0x5ce99d[_0x0a9e('0x2c')],_0x5ce99d[_0x0a9e('0x2e')]);_0x1756c7[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5ce99d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x1756c7[_0x0a9e('0x30')]=_0x1756c7['attributes'][_0x0a9e('0x32')]?_0x1756c7['attributes']:_0x5ce99d[_0x0a9e('0x2c')];_0x1756c7[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x1756c7['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0x58')](_0xb0599a[_0x0a9e('0x2e')],_0x5ce99d[_0x0a9e('0x36')]));if(_0xb0599a[_0x0a9e('0x2e')]['filter']){_0x1756c7['where']=_[_0x0a9e('0x38')](_0x1756c7['where'],{'$or':_[_0x0a9e('0x3a')](_0x1756c7[_0x0a9e('0x30')],function(_0x4672e1){var _0x16313e={};_0x16313e[_0x4672e1]={'$like':'%'+_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x16313e;})});}_0x1756c7=_['merge']({},_0x1756c7,_0xb0599a['options']);return _0x23b447[_0x0a9e('0x78')](_0x1756c7);}})['then'](function(_0x2469d1){if(_0x2469d1){_0x5e725e=_0x2469d1['length'];if(!_0xb0599a[_0x0a9e('0x2e')]['hasOwnProperty']('nolimit')){_0x1756c7[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0xb0599a['query'][_0x0a9e('0x1d')]);_0x1756c7[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x23b447['getAgents'](_0x1756c7);}})['then'](function(_0x16449b){if(_0x16449b){return _0x16449b?{'count':_0x5e725e,'rows':_0x16449b}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x5d9ddb,null))[_0x0a9e('0x42')](handleError(_0x5d9ddb,null));}; \ No newline at end of file +var _0xa9e0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','add','ids','removeQueues','remove','voice','chat','mail','sms','fax','openchannel','each','addAgents','User','findAll','loginInPause','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','removeAgents','isArray','emit','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){return BPromise['each']([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x40fc56){return _0x361b21[_0x0a9e('0x25')+_[_0x0a9e('0x55')](_0x40fc56)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x40fc56===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]});}})[_0x0a9e('0x23')](function(_0x53a6a1){if(_0x40fc56===_0x0a9e('0x60')){return BPromise[_0x0a9e('0x66')](_0x53a6a1,function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){var _0x9044fe;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x81d748,null))[_0x0a9e('0x23')](function(_0x5955f1){if(_0x5955f1){return BPromise[_0x0a9e('0x66')]([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),'sms',_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x1d4877){return _0x5955f1['get'+_[_0x0a9e('0x55')](_0x1d4877)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x255e49){return BPromise[_0x0a9e('0x66')](_0x255e49,function(_0x32b9bd){return _0x32b9bd[_0x0a9e('0x74')](_0x4dc6b3['query'][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_0x1d4877==='voice'){return db[_0x0a9e('0x6c')][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x32b9bd['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids']}});}});});})[_0x0a9e('0x23')](function(){return _0x5955f1;});})['then'](function(){return _0x5955f1;});}})[_0x0a9e('0x23')](function(_0x2b5148){if(_0x2b5148){return _0x2b5148[_0x0a9e('0x74')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(_0x16a039){if(_[_0x0a9e('0x75')](_0x4dc6b3['query'][_0x0a9e('0x5d')])){for(var _0x31d25a=0x0;_0x31d25a<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x31d25a+=0x1){socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x31d25a],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids'],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x78')]=function(_0xb0599a,_0x5d9ddb,_0x3afc8c){var _0x1756c7={};var _0x5ce99d={};var _0x23b447;var _0x5e725e;return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0xb0599a[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5d9ddb,null))['then'](function(_0x3ceba6){if(_0x3ceba6){_0x23b447=_0x3ceba6;_0x5ce99d['model']=_[_0x0a9e('0x2d')](db[_0x0a9e('0x68')]['rawAttributes']);_0x5ce99d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0xb0599a[_0x0a9e('0x2e')]);_0x5ce99d['filters']=_['intersection'](_0x5ce99d[_0x0a9e('0x2c')],_0x5ce99d[_0x0a9e('0x2e')]);_0x1756c7[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5ce99d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x1756c7[_0x0a9e('0x30')]=_0x1756c7['attributes'][_0x0a9e('0x32')]?_0x1756c7['attributes']:_0x5ce99d[_0x0a9e('0x2c')];_0x1756c7[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x1756c7['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0x58')](_0xb0599a[_0x0a9e('0x2e')],_0x5ce99d[_0x0a9e('0x36')]));if(_0xb0599a[_0x0a9e('0x2e')]['filter']){_0x1756c7['where']=_[_0x0a9e('0x38')](_0x1756c7['where'],{'$or':_[_0x0a9e('0x3a')](_0x1756c7[_0x0a9e('0x30')],function(_0x4672e1){var _0x16313e={};_0x16313e[_0x4672e1]={'$like':'%'+_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x16313e;})});}_0x1756c7=_['merge']({},_0x1756c7,_0xb0599a['options']);return _0x23b447[_0x0a9e('0x78')](_0x1756c7);}})['then'](function(_0x2469d1){if(_0x2469d1){_0x5e725e=_0x2469d1['length'];if(!_0xb0599a[_0x0a9e('0x2e')]['hasOwnProperty']('nolimit')){_0x1756c7[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0xb0599a['query'][_0x0a9e('0x1d')]);_0x1756c7[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x23b447['getAgents'](_0x1756c7);}})['then'](function(_0x16449b){if(_0x16449b){return _0x16449b?{'count':_0x5e725e,'rows':_0x16449b}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x5d9ddb,null))[_0x0a9e('0x42')](handleError(_0x5d9ddb,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 2c8c54b..3e016ae 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 _0x5b85=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b85,0x18a));var _0x55b8=function(_0x3be311,_0x28edc6){_0x3be311=_0x3be311-0x0;var _0x11a827=_0x5b85[_0x3be311];return _0x11a827;};'use strict';var EventEmitter=require(_0x55b8('0x0'));var Team=require(_0x55b8('0x1'))['db'][_0x55b8('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x55b8('0x3')](0x0);var events={'afterCreate':_0x55b8('0x4'),'afterUpdate':'update','afterDestroy':_0x55b8('0x5')};function emitEvent(_0x2b4052){return function(_0x3fcb42,_0x4b7b11,_0xc00fe0){TeamEvents[_0x55b8('0x6')](_0x2b4052+':'+_0x3fcb42['id'],_0x3fcb42);TeamEvents[_0x55b8('0x6')](_0x2b4052,_0x3fcb42);_0xc00fe0(null);};}for(var e in events){if(events[_0x55b8('0x7')](e)){var event=events[e];Team[_0x55b8('0x8')](e,emitEvent(event));}}module[_0x55b8('0x9')]=TeamEvents; \ No newline at end of file +var _0x6f54=['save','update','emit','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x6f54,0x13c));var _0x46f5=function(_0x3b7ccd,_0x32a340){_0x3b7ccd=_0x3b7ccd-0x0;var _0x558ce0=_0x6f54[_0x3b7ccd];return _0x558ce0;};'use strict';var EventEmitter=require(_0x46f5('0x0'));var Team=require(_0x46f5('0x1'))['db'][_0x46f5('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x46f5('0x3')](0x0);var events={'afterCreate':_0x46f5('0x4'),'afterUpdate':_0x46f5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x29c359){return function(_0x4e1aac,_0x4c4a3c,_0x23f1b9){TeamEvents[_0x46f5('0x6')](_0x29c359+':'+_0x4e1aac['id'],_0x4e1aac);TeamEvents[_0x46f5('0x6')](_0x29c359,_0x4e1aac);_0x23f1b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x46f5('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 49e31be..72fe45f 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 _0x34e8=['lodash','util','../../config/logger','api','bluebird','request-promise','./team.attributes','exports','define','teams'];(function(_0x11f561,_0x4935e0){var _0x5b9e60=function(_0x14e1b7){while(--_0x14e1b7){_0x11f561['push'](_0x11f561['shift']());}};_0x5b9e60(++_0x4935e0);}(_0x34e8,0x12c));var _0x834e=function(_0xac8de6,_0x1c7de3){_0xac8de6=_0xac8de6-0x0;var _0x190c25=_0x34e8[_0xac8de6];return _0x190c25;};'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 attributes=require(_0x834e('0x6'));module[_0x834e('0x7')]=function(_0x289ef2,_0x19a3e0){return _0x289ef2[_0x834e('0x8')]('Team',attributes,{'tableName':_0x834e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['moment','./team.attributes','define','Team','teams','lodash','../../config/logger','api'];(function(_0x4930a1,_0x48d1d4){var _0x183ecc=function(_0x224e0e){while(--_0x224e0e){_0x4930a1['push'](_0x4930a1['shift']());}};_0x183ecc(++_0x48d1d4);}(_0x3e74,0x175));var _0x43e7=function(_0x54570b,_0x2ce802){_0x54570b=_0x54570b-0x0;var _0x17870f=_0x3e74[_0x54570b];return _0x17870f;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x43e7('0x4'));module['exports']=function(_0x128b0f,_0xe838b4){return _0x128b0f[_0x43e7('0x5')](_0x43e7('0x6'),attributes,{'tableName':_0x43e7('0x7'),'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 5d9c5f9..c4313ea 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 _0x9ea7=['redis','localhost','./team.socket','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x85927e,_0x66206d){var _0x2a80b8=function(_0x2b2590){while(--_0x2b2590){_0x85927e['push'](_0x85927e['shift']());}};_0x2a80b8(++_0x66206d);}(_0x9ea7,0x6e));var _0x79ea=function(_0x3c43f6,_0x429058){_0x3c43f6=_0x3c43f6-0x0;var _0x5677a4=_0x9ea7[_0x3c43f6];return _0x5677a4;};'use strict';var _=require(_0x79ea('0x0'));var util=require('util');var moment=require(_0x79ea('0x1'));var BPromise=require(_0x79ea('0x2'));var rs=require(_0x79ea('0x3'));var fs=require('fs');var Redis=require(_0x79ea('0x4'));var db=require(_0x79ea('0x5'))['db'];var utils=require(_0x79ea('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x79ea('0x7'));var jayson=require(_0x79ea('0x8'));var client=jayson[_0x79ea('0x9')]['http']({'port':0x232a});config[_0x79ea('0xa')]=_['defaults'](config[_0x79ea('0xa')],{'host':_0x79ea('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x79ea('0xa')]));require(_0x79ea('0xc'))['register'](socket);function respondWithRpcPromise(_0xfdeee3,_0x2fef0d,_0xab86d0){return new BPromise(function(_0x512126,_0x1eab9b){return client[_0x79ea('0xd')](_0xfdeee3,_0xab86d0)['then'](function(_0x148f7a){logger[_0x79ea('0xe')](_0x79ea('0xf'),_0x2fef0d,_0x79ea('0x10'));logger[_0x79ea('0x11')]('Team,\x20%s,\x20%s,\x20%s',_0x2fef0d,_0x79ea('0x10'),JSON[_0x79ea('0x12')](_0x148f7a));if(_0x148f7a[_0x79ea('0x13')]){if(_0x148f7a[_0x79ea('0x13')][_0x79ea('0x14')]===0x1f4){logger[_0x79ea('0x13')](_0x79ea('0xf'),_0x2fef0d,_0x148f7a[_0x79ea('0x13')][_0x79ea('0x15')]);return _0x1eab9b(_0x148f7a[_0x79ea('0x13')]['message']);}logger[_0x79ea('0x13')](_0x79ea('0xf'),_0x2fef0d,_0x148f7a['error'][_0x79ea('0x15')]);return _0x512126(_0x148f7a[_0x79ea('0x13')][_0x79ea('0x15')]);}else{logger[_0x79ea('0xe')](_0x79ea('0xf'),_0x2fef0d,_0x79ea('0x10'));_0x512126(_0x148f7a[_0x79ea('0x16')][_0x79ea('0x15')]);}})[_0x79ea('0x17')](function(_0x221652){logger[_0x79ea('0x13')](_0x79ea('0xf'),_0x2fef0d,_0x221652);_0x1eab9b(_0x221652);});});} \ No newline at end of file +var _0x1ef3=['info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then'];(function(_0x42c349,_0x5576cb){var _0x11cdf5=function(_0x26a16b){while(--_0x26a16b){_0x42c349['push'](_0x42c349['shift']());}};_0x11cdf5(++_0x5576cb);}(_0x1ef3,0x68));var _0x31ef=function(_0x20eb87,_0x11ac2d){_0x20eb87=_0x20eb87-0x0;var _0x3a303d=_0x1ef3[_0x20eb87];return _0x3a303d;};'use strict';var _=require(_0x31ef('0x0'));var util=require(_0x31ef('0x1'));var moment=require('moment');var BPromise=require(_0x31ef('0x2'));var rs=require(_0x31ef('0x3'));var fs=require('fs');var Redis=require(_0x31ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x31ef('0x5'));var logger=require(_0x31ef('0x6'))(_0x31ef('0x7'));var config=require(_0x31ef('0x8'));var jayson=require(_0x31ef('0x9'));var client=jayson[_0x31ef('0xa')][_0x31ef('0xb')]({'port':0x232a});config[_0x31ef('0xc')]=_[_0x31ef('0xd')](config[_0x31ef('0xc')],{'host':_0x31ef('0xe'),'port':0x18eb});var socket=require(_0x31ef('0xf'))(new Redis(config[_0x31ef('0xc')]));require(_0x31ef('0x10'))[_0x31ef('0x11')](socket);function respondWithRpcPromise(_0x44db3a,_0x3da65b,_0x3267bf){return new BPromise(function(_0x196310,_0x5319e5){return client[_0x31ef('0x12')](_0x44db3a,_0x3267bf)[_0x31ef('0x13')](function(_0x166069){logger[_0x31ef('0x14')](_0x31ef('0x15'),_0x3da65b,'request\x20sent');logger[_0x31ef('0x16')](_0x31ef('0x17'),_0x3da65b,'request\x20sent',JSON[_0x31ef('0x18')](_0x166069));if(_0x166069['error']){if(_0x166069['error'][_0x31ef('0x19')]===0x1f4){logger[_0x31ef('0x1a')](_0x31ef('0x15'),_0x3da65b,_0x166069[_0x31ef('0x1a')]['message']);return _0x5319e5(_0x166069[_0x31ef('0x1a')][_0x31ef('0x1b')]);}logger[_0x31ef('0x1a')](_0x31ef('0x15'),_0x3da65b,_0x166069[_0x31ef('0x1a')][_0x31ef('0x1b')]);return _0x196310(_0x166069[_0x31ef('0x1a')]['message']);}else{logger[_0x31ef('0x14')](_0x31ef('0x15'),_0x3da65b,_0x31ef('0x1c'));_0x196310(_0x166069[_0x31ef('0x1d')][_0x31ef('0x1b')]);}})[_0x31ef('0x1e')](function(_0x50172a){logger['error']('Team,\x20%s,\x20%s',_0x3da65b,_0x50172a);_0x5319e5(_0x50172a);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index b3f9a2e..675c018 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 _0x4bf9=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0x103234,_0x4e4332){var _0x4a7b39=function(_0x451703){while(--_0x451703){_0x103234['push'](_0x103234['shift']());}};_0x4a7b39(++_0x4e4332);}(_0x4bf9,0x1e3));var _0x94bf=function(_0x431c1f,_0xc62e31){_0x431c1f=_0x431c1f-0x0;var _0xfeb0bf=_0x4bf9[_0x431c1f];return _0xfeb0bf;};'use strict';var TeamEvents=require(_0x94bf('0x0'));var events=[_0x94bf('0x1'),_0x94bf('0x2'),_0x94bf('0x3')];function createListener(_0x3f8e4f,_0x1bac83){return function(_0x57ec39){_0x1bac83[_0x94bf('0x4')](_0x3f8e4f,_0x57ec39);};}function removeListener(_0x2ac1b5,_0x3ed20a){return function(){TeamEvents[_0x94bf('0x5')](_0x2ac1b5,_0x3ed20a);};}exports[_0x94bf('0x6')]=function(_0xdf7b5c){for(var _0x204f23=0x0,_0x41194e=events[_0x94bf('0x7')];_0x204f23<_0x41194e;_0x204f23++){var _0x5d1c67=events[_0x204f23];var _0x44a1e7=createListener(_0x94bf('0x8')+_0x5d1c67,_0xdf7b5c);TeamEvents['on'](_0x5d1c67,_0x44a1e7);}}; \ No newline at end of file +var _0xa2d4=['save','remove','removeListener','register','length','team:','./team.events'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xa2d4,0xf4));var _0x4a2d=function(_0x457697,_0x2ec2dc){_0x457697=_0x457697-0x0;var _0x48e127=_0xa2d4[_0x457697];return _0x48e127;};'use strict';var TeamEvents=require(_0x4a2d('0x0'));var events=[_0x4a2d('0x1'),_0x4a2d('0x2'),'update'];function createListener(_0x243878,_0x595d9a){return function(_0x11c733){_0x595d9a['emit'](_0x243878,_0x11c733);};}function removeListener(_0x382628,_0x6777c4){return function(){TeamEvents[_0x4a2d('0x3')](_0x382628,_0x6777c4);};}exports[_0x4a2d('0x4')]=function(_0x4f04ab){for(var _0x50cc13=0x0,_0xf747d5=events[_0x4a2d('0x5')];_0x50cc13<_0xf747d5;_0x50cc13++){var _0x4e8fe9=events[_0x50cc13];var _0x3db2a1=createListener(_0x4a2d('0x6')+_0x4e8fe9,_0x4f04ab);TeamEvents['on'](_0x4e8fe9,_0x3db2a1);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9b63b8b..7f4e945 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 _0x3e95=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x427444,_0xf966d1){var _0x356dca=function(_0x28b183){while(--_0x28b183){_0x427444['push'](_0x427444['shift']());}};_0x356dca(++_0xf966d1);}(_0x3e95,0x172));var _0x53e9=function(_0x4626e9,_0x2f7148){_0x4626e9=_0x4626e9-0x0;var _0x3fc3a9=_0x3e95[_0x4626e9];return _0x3fc3a9;};'use strict';var multer=require(_0x53e9('0x0'));var util=require(_0x53e9('0x1'));var path=require('path');var timeout=require(_0x53e9('0x2'));var express=require(_0x53e9('0x3'));var router=express[_0x53e9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x53e9('0x5'));var config=require(_0x53e9('0x6'));var controller=require('./template.controller');router[_0x53e9('0x7')]('/',auth[_0x53e9('0x8')](),controller['index']);router[_0x53e9('0x7')](_0x53e9('0x9'),auth['isAuthenticated'](),controller[_0x53e9('0xa')]);router[_0x53e9('0xb')]('/',auth[_0x53e9('0x8')](),controller[_0x53e9('0xc')]);router[_0x53e9('0xd')](_0x53e9('0x9'),auth['isAuthenticated'](),controller[_0x53e9('0xe')]);router[_0x53e9('0xf')](_0x53e9('0x9'),auth[_0x53e9('0x8')](),controller[_0x53e9('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9164=['destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','post','create','put','/:id','update','delete'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x9164,0x68));var _0x4916=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9164[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4916('0x0'));var util=require('util');var path=require(_0x4916('0x1'));var timeout=require(_0x4916('0x2'));var express=require('express');var router=express[_0x4916('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4916('0x4'));var config=require(_0x4916('0x5'));var controller=require(_0x4916('0x6'));router['get']('/',auth[_0x4916('0x7')](),controller[_0x4916('0x8')]);router['get']('/:id',auth[_0x4916('0x7')](),controller['show']);router[_0x4916('0x9')]('/',auth[_0x4916('0x7')](),controller[_0x4916('0xa')]);router[_0x4916('0xb')](_0x4916('0xc'),auth[_0x4916('0x7')](),controller[_0x4916('0xd')]);router[_0x4916('0xe')]('/:id',auth[_0x4916('0x7')](),controller[_0x4916('0xf')]);module[_0x4916('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index aab7d7f..3ed26b5 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 _0xa861=['STRING','TEXT','sequelize'];(function(_0x2d1bf7,_0x27194c){var _0x59a33c=function(_0x31bb65){while(--_0x31bb65){_0x2d1bf7['push'](_0x2d1bf7['shift']());}};_0x59a33c(++_0x27194c);}(_0xa861,0xd7));var _0x1a86=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0xa861[_0x30cd7e];return _0x462a02;};'use strict';var Sequelize=require(_0x1a86('0x0'));module['exports']={'name':{'type':Sequelize[_0x1a86('0x1')]},'description':{'type':Sequelize[_0x1a86('0x1')]},'html':{'type':Sequelize[_0x1a86('0x2')]}}; \ No newline at end of file +var _0xabc0=['sequelize','exports','STRING','TEXT'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0xabc0,0xc0));var _0x0abc=function(_0x482ba9,_0x5b3640){_0x482ba9=_0x482ba9-0x0;var _0xbd2c4a=_0xabc0[_0x482ba9];return _0xbd2c4a;};'use strict';var Sequelize=require(_0x0abc('0x0'));module[_0x0abc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0abc('0x2')]},'html':{'type':Sequelize[_0x0abc('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index ab720bb..a11f389 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 _0x8195=['rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','Template','include','rows','show','params','length','find','catch','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','Templates','UserProfileResource','destroy','stack','name','send'];(function(_0x16520f,_0x3fab37){var _0x438d29=function(_0x2b28cc){while(--_0x2b28cc){_0x16520f['push'](_0x16520f['shift']());}};_0x438d29(++_0x3fab37);}(_0x8195,0x6d));var _0x5819=function(_0x2e370a,_0x25bcd2){_0x2e370a=_0x2e370a-0x0;var _0x36cff2=_0x8195[_0x2e370a];return _0x36cff2;};'use strict';var pdf=require(_0x5819('0x0'));var emlformat=require(_0x5819('0x1'));var rimraf=require(_0x5819('0x2'));var zipdir=require(_0x5819('0x3'));var jsonpatch=require(_0x5819('0x4'));var rp=require(_0x5819('0x5'));var moment=require(_0x5819('0x6'));var BPromise=require(_0x5819('0x7'));var Mustache=require('mustache');var util=require(_0x5819('0x8'));var path=require('path');var sox=require(_0x5819('0x9'));var csv=require(_0x5819('0xa'));var ejs=require(_0x5819('0xb'));var fs=require('fs');var _=require(_0x5819('0xc'));var squel=require('squel');var crypto=require(_0x5819('0xd'));var jsforce=require(_0x5819('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5819('0xf'));var Papa=require(_0x5819('0x10'));var authService=require(_0x5819('0x11'));var hardwareService=require(_0x5819('0x12'));var Redis=require(_0x5819('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x5819('0x14'))('api');var utils=require(_0x5819('0x15'));var config=require(_0x5819('0x16'));var db=require(_0x5819('0x17'))['db'];function respondWithStatusCode(_0x13832f,_0x1330e4){_0x1330e4=_0x1330e4||0xcc;return function(_0x271ca7){if(_0x271ca7){return _0x13832f['sendStatus'](_0x1330e4);}return _0x13832f['status'](_0x1330e4)[_0x5819('0x18')]();};}function respondWithResult(_0x3a1a3a,_0x445acc){_0x445acc=_0x445acc||0xc8;return function(_0x11447c){if(_0x11447c){return _0x3a1a3a[_0x5819('0x19')](_0x445acc)[_0x5819('0x1a')](_0x11447c);}};}function respondWithFilteredResult(_0x14682c,_0x51bceb){return function(_0x4e9ff5){if(_0x4e9ff5){var _0x6264b4=_0x4e9ff5[_0x5819('0x1b')],_0x1d7e7d=_0x51bceb['offset'],_0x159345=_0x51bceb[_0x5819('0x1c')]+_0x51bceb[_0x5819('0x1d')],_0x4ed536;if(_0x159345>=_0x6264b4){_0x159345=_0x6264b4;_0x4ed536=0xc8;}else{_0x4ed536=0xce;}_0x14682c[_0x5819('0x19')](_0x4ed536);return _0x14682c[_0x5819('0x1e')](_0x5819('0x1f'),_0x1d7e7d+'-'+_0x159345+'/'+_0x6264b4)[_0x5819('0x1a')](_0x4e9ff5);}return null;};}function patchUpdates(_0x42a9ee){return function(_0x3587f4){try{jsonpatch['apply'](_0x3587f4,_0x42a9ee,!![]);}catch(_0xd3bc25){return BPromise[_0x5819('0x20')](_0xd3bc25);}return _0x3587f4[_0x5819('0x21')]();};}function saveUpdates(_0x52ba12,_0x7b22ed){return function(_0x4b1dcf){if(_0x4b1dcf){return _0x4b1dcf[_0x5819('0x22')](_0x52ba12)[_0x5819('0x23')](function(_0x308c69){return _0x308c69;});}return null;};}function removeEntity(_0x200702,_0x2e1e76){return function(_0x2ea67a){if(_0x2ea67a){return _0x2ea67a['destroy']()[_0x5819('0x23')](function(){var _0x4ba91b=_0x2ea67a[_0x5819('0x24')]({'plain':!![]});var _0xfb286a=_0x5819('0x25');return db[_0x5819('0x26')][_0x5819('0x27')]({'where':{'type':_0xfb286a,'resourceId':_0x4ba91b['id']}})[_0x5819('0x23')](function(){return _0x2ea67a;});})[_0x5819('0x23')](function(){_0x200702[_0x5819('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9341,_0x2d32b7){return function(_0x36c4d6){if(!_0x36c4d6){_0x2d9341['sendStatus'](0x194);}return _0x36c4d6;};}function handleError(_0x449054,_0x1f6569){_0x1f6569=_0x1f6569||0x1f4;return function(_0xdf206a){logger['error'](_0xdf206a[_0x5819('0x28')]);if(_0xdf206a[_0x5819('0x29')]){delete _0xdf206a['name'];}_0x449054[_0x5819('0x19')](_0x1f6569)[_0x5819('0x2a')](_0xdf206a);};}exports['index']=function(_0x1cb72f,_0x26748c){var _0x2657a7={},_0x493a51={},_0x166555={'count':0x0,'rows':[]};var _0x24fe2e=db['Template'][_0x5819('0x2b')];_0x493a51[_0x5819('0x2c')]=_[_0x5819('0x2d')](_0x24fe2e);_0x493a51[_0x5819('0x2e')]=_[_0x5819('0x2d')](_0x1cb72f[_0x5819('0x2e')]);_0x493a51['filters']=_[_0x5819('0x2f')](_0x493a51[_0x5819('0x2c')],_0x493a51[_0x5819('0x2e')]);_0x2657a7[_0x5819('0x30')]=_['intersection'](_0x493a51[_0x5819('0x2c')],qs[_0x5819('0x31')](_0x1cb72f[_0x5819('0x2e')][_0x5819('0x31')]));_0x2657a7[_0x5819('0x30')]=_0x2657a7[_0x5819('0x30')]['length']?_0x2657a7[_0x5819('0x30')]:_0x493a51['model'];if(!_0x1cb72f[_0x5819('0x2e')][_0x5819('0x32')]('nolimit')){_0x2657a7['limit']=qs['limit'](_0x1cb72f[_0x5819('0x2e')][_0x5819('0x1d')]);_0x2657a7['offset']=qs[_0x5819('0x1c')](_0x1cb72f[_0x5819('0x2e')][_0x5819('0x1c')]);}_0x2657a7[_0x5819('0x33')]=qs[_0x5819('0x34')](_0x1cb72f['query'][_0x5819('0x34')]);_0x2657a7[_0x5819('0x35')]=qs[_0x5819('0x36')](_['pick'](_0x1cb72f[_0x5819('0x2e')],_0x493a51[_0x5819('0x36')]));if(_0x1cb72f[_0x5819('0x2e')][_0x5819('0x37')]){_0x2657a7['where']=_[_0x5819('0x38')](_0x2657a7[_0x5819('0x35')],{'$or':_[_0x5819('0x39')](_0x24fe2e,function(_0x194665){if(_0x194665[_0x5819('0x3a')][_0x5819('0x3b')]!==_0x5819('0x3c')){var _0x4a8292={};_0x4a8292[_0x194665['field']]={'$like':'%'+_0x1cb72f[_0x5819('0x2e')]['filter']+'%'};return _0x4a8292;}})});}_0x2657a7=_[_0x5819('0x38')]({},_0x2657a7,_0x1cb72f['options']);var _0x4d3af8={'where':_0x2657a7[_0x5819('0x35')]};return db[_0x5819('0x3d')]['count'](_0x4d3af8)[_0x5819('0x23')](function(_0x36760){_0x166555[_0x5819('0x1b')]=_0x36760;if(_0x1cb72f[_0x5819('0x2e')]['includeAll']){_0x2657a7[_0x5819('0x3e')]=[{'all':!![]}];}return db[_0x5819('0x3d')]['findAll'](_0x2657a7);})[_0x5819('0x23')](function(_0x30259a){_0x166555[_0x5819('0x3f')]=_0x30259a;return _0x166555;})['then'](respondWithFilteredResult(_0x26748c,_0x2657a7))['catch'](handleError(_0x26748c,null));};exports[_0x5819('0x40')]=function(_0x536408,_0x390ad5){var _0x1121d5={'raw':!![],'where':{'id':_0x536408[_0x5819('0x41')]['id']}},_0x2282d3={};_0x2282d3[_0x5819('0x2c')]=_[_0x5819('0x2d')](db[_0x5819('0x3d')]['rawAttributes']);_0x2282d3[_0x5819('0x2e')]=_[_0x5819('0x2d')](_0x536408['query']);_0x2282d3[_0x5819('0x36')]=_[_0x5819('0x2f')](_0x2282d3['model'],_0x2282d3[_0x5819('0x2e')]);_0x1121d5['attributes']=_[_0x5819('0x2f')](_0x2282d3[_0x5819('0x2c')],qs['fields'](_0x536408['query'][_0x5819('0x31')]));_0x1121d5[_0x5819('0x30')]=_0x1121d5['attributes'][_0x5819('0x42')]?_0x1121d5['attributes']:_0x2282d3[_0x5819('0x2c')];if(_0x536408[_0x5819('0x2e')]['includeAll']){_0x1121d5[_0x5819('0x3e')]=[{'all':!![]}];}_0x1121d5=_[_0x5819('0x38')]({},_0x1121d5,_0x536408['options']);return db[_0x5819('0x3d')][_0x5819('0x43')](_0x1121d5)[_0x5819('0x23')](handleEntityNotFound(_0x390ad5,null))[_0x5819('0x23')](respondWithResult(_0x390ad5,null))[_0x5819('0x44')](handleError(_0x390ad5,null));};exports['create']=function(_0x5e4a38,_0x301abf){return db['Template'][_0x5819('0x45')](_0x5e4a38[_0x5819('0x46')],{})[_0x5819('0x23')](function(_0x1ea3c9){var _0x298b18=_0x5e4a38['user']['get']({'plain':!![]});if(!_0x298b18)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x298b18[_0x5819('0x47')]===_0x5819('0x48')){var _0x265ea3=_0x1ea3c9[_0x5819('0x24')]({'plain':!![]});var _0x220e2a='Templates';return db[_0x5819('0x49')][_0x5819('0x43')]({'where':{'name':_0x220e2a,'userProfileId':_0x298b18[_0x5819('0x4a')]},'raw':!![]})['then'](function(_0x511411){if(_0x511411&&_0x511411['autoAssociation']===0x0){return db[_0x5819('0x26')][_0x5819('0x45')]({'name':_0x265ea3[_0x5819('0x29')],'resourceId':_0x265ea3['id'],'type':_0x511411[_0x5819('0x29')],'sectionId':_0x511411['id']},{})['then'](function(){return _0x1ea3c9;});}else{return _0x1ea3c9;}})[_0x5819('0x44')](function(_0x5616e8){logger['error'](_0x5819('0x4b'),_0x5616e8);throw _0x5616e8;});}return _0x1ea3c9;})[_0x5819('0x23')](respondWithResult(_0x301abf,0xc9))[_0x5819('0x44')](handleError(_0x301abf,null));};exports[_0x5819('0x22')]=function(_0x21db49,_0x542133){if(_0x21db49['body']['id']){delete _0x21db49[_0x5819('0x46')]['id'];}return db['Template'][_0x5819('0x43')]({'where':{'id':_0x21db49[_0x5819('0x41')]['id']}})['then'](handleEntityNotFound(_0x542133,null))[_0x5819('0x23')](saveUpdates(_0x21db49[_0x5819('0x46')],null))[_0x5819('0x23')](respondWithResult(_0x542133,null))[_0x5819('0x44')](handleError(_0x542133,null));};exports['destroy']=function(_0x3db1d6,_0x293159){return db[_0x5819('0x3d')][_0x5819('0x43')]({'where':{'id':_0x3db1d6[_0x5819('0x41')]['id']}})[_0x5819('0x23')](handleEntityNotFound(_0x293159,null))[_0x5819('0x23')](removeEntity(_0x293159,null))['catch'](handleError(_0x293159,null));}; \ No newline at end of file +var _0xedca=['get','Templates','UserProfileResource','error','stack','name','send','index','Template','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy'];(function(_0x1cd826,_0x487a46){var _0x130e53=function(_0x312f27){while(--_0x312f27){_0x1cd826['push'](_0x1cd826['shift']());}};_0x130e53(++_0x487a46);}(_0xedca,0x79));var _0xaedc=function(_0x233f22,_0x554676){_0x233f22=_0x233f22-0x0;var _0x3a6ebe=_0xedca[_0x233f22];return _0x3a6ebe;};'use strict';var pdf=require(_0xaedc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaedc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaedc('0x2'));var rp=require(_0xaedc('0x3'));var moment=require('moment');var BPromise=require(_0xaedc('0x4'));var Mustache=require(_0xaedc('0x5'));var util=require('util');var path=require(_0xaedc('0x6'));var sox=require(_0xaedc('0x7'));var csv=require(_0xaedc('0x8'));var ejs=require(_0xaedc('0x9'));var fs=require('fs');var _=require(_0xaedc('0xa'));var squel=require(_0xaedc('0xb'));var crypto=require(_0xaedc('0xc'));var jsforce=require(_0xaedc('0xd'));var deskjs=require(_0xaedc('0xe'));var toCsv=require(_0xaedc('0x8'));var querystring=require(_0xaedc('0xf'));var Papa=require(_0xaedc('0x10'));var authService=require(_0xaedc('0x11'));var hardwareService=require(_0xaedc('0x12'));var Redis=require('ioredis');var qs=require(_0xaedc('0x13'));var logger=require('../../config/logger')(_0xaedc('0x14'));var utils=require(_0xaedc('0x15'));var config=require(_0xaedc('0x16'));var db=require(_0xaedc('0x17'))['db'];function respondWithStatusCode(_0x2d5275,_0x253bc0){_0x253bc0=_0x253bc0||0xcc;return function(_0x272b66){if(_0x272b66){return _0x2d5275[_0xaedc('0x18')](_0x253bc0);}return _0x2d5275[_0xaedc('0x19')](_0x253bc0)[_0xaedc('0x1a')]();};}function respondWithResult(_0x2b630d,_0x67624){_0x67624=_0x67624||0xc8;return function(_0x4d8f32){if(_0x4d8f32){return _0x2b630d[_0xaedc('0x19')](_0x67624)[_0xaedc('0x1b')](_0x4d8f32);}};}function respondWithFilteredResult(_0x313467,_0xb3c742){return function(_0x356295){if(_0x356295){var _0x44fcb0=_0x356295[_0xaedc('0x1c')],_0x11d460=_0xb3c742[_0xaedc('0x1d')],_0x5cedfd=_0xb3c742[_0xaedc('0x1d')]+_0xb3c742[_0xaedc('0x1e')],_0x10b773;if(_0x5cedfd>=_0x44fcb0){_0x5cedfd=_0x44fcb0;_0x10b773=0xc8;}else{_0x10b773=0xce;}_0x313467[_0xaedc('0x19')](_0x10b773);return _0x313467[_0xaedc('0x1f')](_0xaedc('0x20'),_0x11d460+'-'+_0x5cedfd+'/'+_0x44fcb0)[_0xaedc('0x1b')](_0x356295);}return null;};}function patchUpdates(_0x57f1ad){return function(_0x12e1a9){try{jsonpatch['apply'](_0x12e1a9,_0x57f1ad,!![]);}catch(_0xa98aa5){return BPromise[_0xaedc('0x21')](_0xa98aa5);}return _0x12e1a9[_0xaedc('0x22')]();};}function saveUpdates(_0x39726d,_0x31e563){return function(_0xea43d3){if(_0xea43d3){return _0xea43d3['update'](_0x39726d)[_0xaedc('0x23')](function(_0x3c2a6e){return _0x3c2a6e;});}return null;};}function removeEntity(_0xbf4726,_0x17deba){return function(_0x4a9d56){if(_0x4a9d56){return _0x4a9d56[_0xaedc('0x24')]()[_0xaedc('0x23')](function(){var _0x3c52cd=_0x4a9d56[_0xaedc('0x25')]({'plain':!![]});var _0x2a5250=_0xaedc('0x26');return db[_0xaedc('0x27')]['destroy']({'where':{'type':_0x2a5250,'resourceId':_0x3c52cd['id']}})[_0xaedc('0x23')](function(){return _0x4a9d56;});})[_0xaedc('0x23')](function(){_0xbf4726['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8be18e,_0x25f3bf){return function(_0x128c44){if(!_0x128c44){_0x8be18e[_0xaedc('0x18')](0x194);}return _0x128c44;};}function handleError(_0x4df619,_0x58f9d3){_0x58f9d3=_0x58f9d3||0x1f4;return function(_0x2574a3){logger[_0xaedc('0x28')](_0x2574a3[_0xaedc('0x29')]);if(_0x2574a3['name']){delete _0x2574a3[_0xaedc('0x2a')];}_0x4df619['status'](_0x58f9d3)[_0xaedc('0x2b')](_0x2574a3);};}exports[_0xaedc('0x2c')]=function(_0x55185d,_0x275f29){var _0x331701={},_0x327202={},_0x5a139f={'count':0x0,'rows':[]};var _0x592bdb=db[_0xaedc('0x2d')][_0xaedc('0x2e')];_0x327202[_0xaedc('0x2f')]=_[_0xaedc('0x30')](_0x592bdb);_0x327202[_0xaedc('0x31')]=_[_0xaedc('0x30')](_0x55185d[_0xaedc('0x31')]);_0x327202['filters']=_[_0xaedc('0x32')](_0x327202['model'],_0x327202['query']);_0x331701[_0xaedc('0x33')]=_[_0xaedc('0x32')](_0x327202[_0xaedc('0x2f')],qs['fields'](_0x55185d[_0xaedc('0x31')][_0xaedc('0x34')]));_0x331701['attributes']=_0x331701[_0xaedc('0x33')][_0xaedc('0x35')]?_0x331701[_0xaedc('0x33')]:_0x327202[_0xaedc('0x2f')];if(!_0x55185d[_0xaedc('0x31')][_0xaedc('0x36')](_0xaedc('0x37'))){_0x331701['limit']=qs[_0xaedc('0x1e')](_0x55185d[_0xaedc('0x31')][_0xaedc('0x1e')]);_0x331701[_0xaedc('0x1d')]=qs['offset'](_0x55185d[_0xaedc('0x31')][_0xaedc('0x1d')]);}_0x331701[_0xaedc('0x38')]=qs[_0xaedc('0x39')](_0x55185d[_0xaedc('0x31')][_0xaedc('0x39')]);_0x331701[_0xaedc('0x3a')]=qs[_0xaedc('0x3b')](_[_0xaedc('0x3c')](_0x55185d['query'],_0x327202[_0xaedc('0x3b')]));if(_0x55185d[_0xaedc('0x31')]['filter']){_0x331701[_0xaedc('0x3a')]=_['merge'](_0x331701['where'],{'$or':_[_0xaedc('0x3d')](_0x592bdb,function(_0x365ddc){if(_0x365ddc['type']['key']!==_0xaedc('0x3e')){var _0xffc29c={};_0xffc29c[_0x365ddc['field']]={'$like':'%'+_0x55185d[_0xaedc('0x31')]['filter']+'%'};return _0xffc29c;}})});}_0x331701=_[_0xaedc('0x3f')]({},_0x331701,_0x55185d[_0xaedc('0x40')]);var _0x5dec76={'where':_0x331701[_0xaedc('0x3a')]};return db[_0xaedc('0x2d')][_0xaedc('0x1c')](_0x5dec76)[_0xaedc('0x23')](function(_0x23f63c){_0x5a139f[_0xaedc('0x1c')]=_0x23f63c;if(_0x55185d[_0xaedc('0x31')][_0xaedc('0x41')]){_0x331701[_0xaedc('0x42')]=[{'all':!![]}];}return db[_0xaedc('0x2d')][_0xaedc('0x43')](_0x331701);})[_0xaedc('0x23')](function(_0x3f92ee){_0x5a139f[_0xaedc('0x44')]=_0x3f92ee;return _0x5a139f;})['then'](respondWithFilteredResult(_0x275f29,_0x331701))[_0xaedc('0x45')](handleError(_0x275f29,null));};exports['show']=function(_0x4f0e3a,_0x2a4748){var _0x1a6ffd={'raw':!![],'where':{'id':_0x4f0e3a[_0xaedc('0x46')]['id']}},_0x3c429a={};_0x3c429a['model']=_[_0xaedc('0x30')](db['Template']['rawAttributes']);_0x3c429a['query']=_['keys'](_0x4f0e3a[_0xaedc('0x31')]);_0x3c429a['filters']=_[_0xaedc('0x32')](_0x3c429a[_0xaedc('0x2f')],_0x3c429a['query']);_0x1a6ffd[_0xaedc('0x33')]=_[_0xaedc('0x32')](_0x3c429a['model'],qs['fields'](_0x4f0e3a[_0xaedc('0x31')][_0xaedc('0x34')]));_0x1a6ffd['attributes']=_0x1a6ffd[_0xaedc('0x33')]['length']?_0x1a6ffd[_0xaedc('0x33')]:_0x3c429a[_0xaedc('0x2f')];if(_0x4f0e3a[_0xaedc('0x31')][_0xaedc('0x41')]){_0x1a6ffd[_0xaedc('0x42')]=[{'all':!![]}];}_0x1a6ffd=_[_0xaedc('0x3f')]({},_0x1a6ffd,_0x4f0e3a[_0xaedc('0x40')]);return db[_0xaedc('0x2d')][_0xaedc('0x47')](_0x1a6ffd)[_0xaedc('0x23')](handleEntityNotFound(_0x2a4748,null))[_0xaedc('0x23')](respondWithResult(_0x2a4748,null))[_0xaedc('0x45')](handleError(_0x2a4748,null));};exports[_0xaedc('0x48')]=function(_0x36a10c,_0x247c7c){return db['Template']['create'](_0x36a10c[_0xaedc('0x49')],{})[_0xaedc('0x23')](function(_0x10ea8d){var _0x4bca19=_0x36a10c[_0xaedc('0x4a')][_0xaedc('0x25')]({'plain':!![]});if(!_0x4bca19)throw new Error(_0xaedc('0x4b'));if(_0x4bca19[_0xaedc('0x4c')]===_0xaedc('0x4a')){var _0x260d1a=_0x10ea8d[_0xaedc('0x25')]({'plain':!![]});var _0x4f6d26=_0xaedc('0x26');return db[_0xaedc('0x4d')][_0xaedc('0x47')]({'where':{'name':_0x4f6d26,'userProfileId':_0x4bca19['userProfileId']},'raw':!![]})['then'](function(_0x21008a){if(_0x21008a&&_0x21008a[_0xaedc('0x4e')]===0x0){return db[_0xaedc('0x27')][_0xaedc('0x48')]({'name':_0x260d1a[_0xaedc('0x2a')],'resourceId':_0x260d1a['id'],'type':_0x21008a[_0xaedc('0x2a')],'sectionId':_0x21008a['id']},{})['then'](function(){return _0x10ea8d;});}else{return _0x10ea8d;}})[_0xaedc('0x45')](function(_0x1425ed){logger[_0xaedc('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1425ed);throw _0x1425ed;});}return _0x10ea8d;})['then'](respondWithResult(_0x247c7c,0xc9))[_0xaedc('0x45')](handleError(_0x247c7c,null));};exports['update']=function(_0x4ad092,_0x12d2a6){if(_0x4ad092[_0xaedc('0x49')]['id']){delete _0x4ad092[_0xaedc('0x49')]['id'];}return db['Template'][_0xaedc('0x47')]({'where':{'id':_0x4ad092[_0xaedc('0x46')]['id']}})[_0xaedc('0x23')](handleEntityNotFound(_0x12d2a6,null))[_0xaedc('0x23')](saveUpdates(_0x4ad092['body'],null))['then'](respondWithResult(_0x12d2a6,null))[_0xaedc('0x45')](handleError(_0x12d2a6,null));};exports[_0xaedc('0x24')]=function(_0x23421b,_0x376b17){return db[_0xaedc('0x2d')]['find']({'where':{'id':_0x23421b[_0xaedc('0x46')]['id']}})[_0xaedc('0x23')](handleEntityNotFound(_0x376b17,null))['then'](removeEntity(_0x376b17,null))['catch'](handleError(_0x376b17,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index bae0a8e..b42d9e5 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 _0x2e73=['./template.attributes','exports','Template','tools_templates','util','../../config/logger','request-promise'];(function(_0x3bdec9,_0x434ef0){var _0x2ea187=function(_0x219ce6){while(--_0x219ce6){_0x3bdec9['push'](_0x3bdec9['shift']());}};_0x2ea187(++_0x434ef0);}(_0x2e73,0x169));var _0x32e7=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x2e73[_0x249e96];return _0x17444c;};'use strict';var _=require('lodash');var util=require(_0x32e7('0x0'));var logger=require(_0x32e7('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x32e7('0x2'));var attributes=require(_0x32e7('0x3'));module[_0x32e7('0x4')]=function(_0x2a0dcd,_0x3a9b19){return _0x2a0dcd['define'](_0x32e7('0x5'),attributes,{'tableName':_0x32e7('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bf2=['moment','bluebird','request-promise','exports','define','Template','util','../../config/logger','api'];(function(_0x3fbe05,_0x2e38f3){var _0x5f4d04=function(_0x25232e){while(--_0x25232e){_0x3fbe05['push'](_0x3fbe05['shift']());}};_0x5f4d04(++_0x2e38f3);}(_0x6bf2,0x153));var _0x26bf=function(_0x4ab830,_0x47921f){_0x4ab830=_0x4ab830-0x0;var _0x49c499=_0x6bf2[_0x4ab830];return _0x49c499;};'use strict';var _=require('lodash');var util=require(_0x26bf('0x0'));var logger=require(_0x26bf('0x1'))(_0x26bf('0x2'));var moment=require(_0x26bf('0x3'));var BPromise=require(_0x26bf('0x4'));var rp=require(_0x26bf('0x5'));var attributes=require('./template.attributes');module[_0x26bf('0x6')]=function(_0x2e1964,_0x3afd75){return _0x2e1964[_0x26bf('0x7')](_0x26bf('0x8'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 556f6bc..17ac204 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 _0x64d4=['jayson/promise','http','request','then','info','request\x20sent','debug','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','options','where','attributes','limit','include','map','model','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x185974,_0x1deaf9){var _0xf91fa7=function(_0x3814a7){while(--_0x3814a7){_0x185974['push'](_0x185974['shift']());}};_0xf91fa7(++_0x1deaf9);}(_0x64d4,0x12d));var _0x464d=function(_0x1f79bb,_0x402fb7){_0x1f79bb=_0x1f79bb-0x0;var _0x4ad987=_0x64d4[_0x1f79bb];return _0x4ad987;};'use strict';var _=require('lodash');var util=require(_0x464d('0x0'));var moment=require('moment');var BPromise=require(_0x464d('0x1'));var rs=require(_0x464d('0x2'));var fs=require('fs');var Redis=require(_0x464d('0x3'));var db=require(_0x464d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x464d('0x5'));var config=require(_0x464d('0x6'));var jayson=require(_0x464d('0x7'));var client=jayson['client'][_0x464d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a56ea,_0x36ca94,_0x40290f){return new BPromise(function(_0x4fc89b,_0xd1fdec){return client[_0x464d('0x9')](_0x5a56ea,_0x40290f)[_0x464d('0xa')](function(_0x14c14f){logger[_0x464d('0xb')]('Template,\x20%s,\x20%s',_0x36ca94,_0x464d('0xc'));logger[_0x464d('0xd')]('Template,\x20%s,\x20%s,\x20%s',_0x36ca94,_0x464d('0xc'),JSON['stringify'](_0x14c14f));if(_0x14c14f[_0x464d('0xe')]){if(_0x14c14f['error']['code']===0x1f4){logger['error'](_0x464d('0xf'),_0x36ca94,_0x14c14f[_0x464d('0xe')][_0x464d('0x10')]);return _0xd1fdec(_0x14c14f['error'][_0x464d('0x10')]);}logger['error'](_0x464d('0xf'),_0x36ca94,_0x14c14f[_0x464d('0xe')][_0x464d('0x10')]);return _0x4fc89b(_0x14c14f['error'][_0x464d('0x10')]);}else{logger[_0x464d('0xb')](_0x464d('0xf'),_0x36ca94,_0x464d('0xc'));_0x4fc89b(_0x14c14f[_0x464d('0x11')][_0x464d('0x10')]);}})[_0x464d('0x12')](function(_0x5ea734){logger['error'](_0x464d('0xf'),_0x36ca94,_0x5ea734);_0xd1fdec(_0x5ea734);});});}exports[_0x464d('0x13')]=function(_0x5407d0){var _0x1ac848=this;return new Promise(function(_0xa47e1e,_0x23f467){return db['Template']['findAll']({'raw':_0x5407d0[_0x464d('0x14')]?_0x5407d0[_0x464d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5407d0[_0x464d('0x14')]?_0x5407d0[_0x464d('0x14')][_0x464d('0x15')]||null:null,'attributes':_0x5407d0['options']?_0x5407d0['options'][_0x464d('0x16')]||null:null,'limit':_0x5407d0['options']?_0x5407d0['options'][_0x464d('0x17')]||null:null,'include':_0x5407d0[_0x464d('0x14')]?_0x5407d0[_0x464d('0x14')][_0x464d('0x18')]?_['map'](_0x5407d0[_0x464d('0x14')]['include'],function(_0x378319){return{'model':db[_0x378319['model']],'as':_0x378319['as'],'attributes':_0x378319[_0x464d('0x16')],'include':_0x378319[_0x464d('0x18')]?_[_0x464d('0x19')](_0x378319['include'],function(_0xf672c5){return{'model':db[_0xf672c5[_0x464d('0x1a')]],'as':_0xf672c5['as'],'attributes':_0xf672c5[_0x464d('0x16')],'include':_0xf672c5[_0x464d('0x18')]?_['map'](_0xf672c5[_0x464d('0x18')],function(_0x3fa738){return{'model':db[_0x3fa738[_0x464d('0x1a')]],'as':_0x3fa738['as'],'attributes':_0x3fa738['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59e190){logger[_0x464d('0xb')](_0x464d('0x13'),_0x5407d0);logger['debug'](_0x464d('0x13'),_0x5407d0,JSON[_0x464d('0x1b')](_0x59e190));_0xa47e1e(_0x59e190);})[_0x464d('0x12')](function(_0x3aa93b){logger[_0x464d('0xe')](_0x464d('0x13'),_0x3aa93b[_0x464d('0x10')],_0x5407d0);_0x23f467(_0x1ac848['error'](0x1f4,_0x3aa93b[_0x464d('0x10')]));});});}; \ No newline at end of file +var _0x6b96=['GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','Template','options','where','include','attributes','map','model'];(function(_0x898dfb,_0x4ccba9){var _0x1e927a=function(_0x5cc2ba){while(--_0x5cc2ba){_0x898dfb['push'](_0x898dfb['shift']());}};_0x1e927a(++_0x4ccba9);}(_0x6b96,0x1f0));var _0x66b9=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6b96[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x66b9('0x0'));var util=require(_0x66b9('0x1'));var moment=require(_0x66b9('0x2'));var BPromise=require(_0x66b9('0x3'));var rs=require(_0x66b9('0x4'));var fs=require('fs');var Redis=require(_0x66b9('0x5'));var db=require(_0x66b9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x66b9('0x7'))(_0x66b9('0x8'));var config=require(_0x66b9('0x9'));var jayson=require(_0x66b9('0xa'));var client=jayson[_0x66b9('0xb')][_0x66b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23f9cd,_0x3a782d,_0x5b12ea){return new BPromise(function(_0x5ea51e,_0x1de6df){return client[_0x66b9('0xd')](_0x23f9cd,_0x5b12ea)[_0x66b9('0xe')](function(_0x5db1d2){logger['info'](_0x66b9('0xf'),_0x3a782d,_0x66b9('0x10'));logger[_0x66b9('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x3a782d,_0x66b9('0x10'),JSON[_0x66b9('0x12')](_0x5db1d2));if(_0x5db1d2['error']){if(_0x5db1d2[_0x66b9('0x13')][_0x66b9('0x14')]===0x1f4){logger[_0x66b9('0x13')]('Template,\x20%s,\x20%s',_0x3a782d,_0x5db1d2[_0x66b9('0x13')][_0x66b9('0x15')]);return _0x1de6df(_0x5db1d2[_0x66b9('0x13')][_0x66b9('0x15')]);}logger[_0x66b9('0x13')](_0x66b9('0xf'),_0x3a782d,_0x5db1d2[_0x66b9('0x13')][_0x66b9('0x15')]);return _0x5ea51e(_0x5db1d2[_0x66b9('0x13')][_0x66b9('0x15')]);}else{logger[_0x66b9('0x16')]('Template,\x20%s,\x20%s',_0x3a782d,_0x66b9('0x10'));_0x5ea51e(_0x5db1d2[_0x66b9('0x17')][_0x66b9('0x15')]);}})[_0x66b9('0x18')](function(_0x527760){logger[_0x66b9('0x13')]('Template,\x20%s,\x20%s',_0x3a782d,_0x527760);_0x1de6df(_0x527760);});});}exports['GetTemplate']=function(_0xc533a0){var _0x121bb8=this;return new Promise(function(_0x2dd13f,_0x2a32a5){return db[_0x66b9('0x19')]['findAll']({'raw':_0xc533a0[_0x66b9('0x1a')]?_0xc533a0[_0x66b9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xc533a0[_0x66b9('0x1a')]?_0xc533a0['options'][_0x66b9('0x1b')]||null:null,'attributes':_0xc533a0[_0x66b9('0x1a')]?_0xc533a0[_0x66b9('0x1a')]['attributes']||null:null,'limit':_0xc533a0[_0x66b9('0x1a')]?_0xc533a0[_0x66b9('0x1a')]['limit']||null:null,'include':_0xc533a0[_0x66b9('0x1a')]?_0xc533a0['options'][_0x66b9('0x1c')]?_['map'](_0xc533a0['options'][_0x66b9('0x1c')],function(_0x29bbb5){return{'model':db[_0x29bbb5['model']],'as':_0x29bbb5['as'],'attributes':_0x29bbb5[_0x66b9('0x1d')],'include':_0x29bbb5[_0x66b9('0x1c')]?_[_0x66b9('0x1e')](_0x29bbb5['include'],function(_0x169250){return{'model':db[_0x169250[_0x66b9('0x1f')]],'as':_0x169250['as'],'attributes':_0x169250['attributes'],'include':_0x169250['include']?_[_0x66b9('0x1e')](_0x169250[_0x66b9('0x1c')],function(_0x1f3c97){return{'model':db[_0x1f3c97[_0x66b9('0x1f')]],'as':_0x1f3c97['as'],'attributes':_0x1f3c97[_0x66b9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x66b9('0xe')](function(_0x297df5){logger[_0x66b9('0x16')](_0x66b9('0x20'),_0xc533a0);logger[_0x66b9('0x11')](_0x66b9('0x20'),_0xc533a0,JSON['stringify'](_0x297df5));_0x2dd13f(_0x297df5);})['catch'](function(_0x22784f){logger['error']('GetTemplate',_0x22784f['message'],_0xc533a0);_0x2a32a5(_0x121bb8[_0x66b9('0x13')](0x1f4,_0x22784f[_0x66b9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 6812ca8..d8bf355 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 _0xcbfb=['isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','post','create','addAnyCondition','addAction','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbfb,0xb0));var _0xbcbf=function(_0x34c71c,_0xa5ea4d){_0x34c71c=_0x34c71c-0x0;var _0x470b01=_0xcbfb[_0x34c71c];return _0x470b01;};'use strict';var multer=require(_0xbcbf('0x0'));var util=require(_0xbcbf('0x1'));var path=require(_0xbcbf('0x2'));var timeout=require('connect-timeout');var express=require(_0xbcbf('0x3'));var router=express[_0xbcbf('0x4')]();var auth=require(_0xbcbf('0x5'));var interaction=require(_0xbcbf('0x6'));var config=require(_0xbcbf('0x7'));var controller=require('./trigger.controller');router['get']('/',auth[_0xbcbf('0x8')](),controller[_0xbcbf('0x9')]);router[_0xbcbf('0xa')](_0xbcbf('0xb'),auth[_0xbcbf('0x8')](),controller[_0xbcbf('0xc')]);router[_0xbcbf('0xa')](_0xbcbf('0xd'),auth[_0xbcbf('0x8')](),controller[_0xbcbf('0xe')]);router[_0xbcbf('0xa')](_0xbcbf('0xf'),auth[_0xbcbf('0x8')](),controller['getAnyConditions']);router[_0xbcbf('0xa')]('/:id/actions',auth[_0xbcbf('0x8')](),controller['getActions']);router[_0xbcbf('0x10')]('/',auth[_0xbcbf('0x8')](),controller[_0xbcbf('0x11')]);router['post'](_0xbcbf('0xd'),auth[_0xbcbf('0x8')](),controller['addAllCondition']);router[_0xbcbf('0x10')](_0xbcbf('0xf'),auth[_0xbcbf('0x8')](),controller[_0xbcbf('0x12')]);router[_0xbcbf('0x10')]('/:id/actions',auth[_0xbcbf('0x8')](),controller[_0xbcbf('0x13')]);router['put'](_0xbcbf('0xb'),auth[_0xbcbf('0x8')](),controller['update']);router[_0xbcbf('0x14')](_0xbcbf('0xb'),auth[_0xbcbf('0x8')](),controller[_0xbcbf('0x15')]);module[_0xbcbf('0x16')]=router; \ No newline at end of file +var _0xe3b0=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition'];(function(_0xb113d7,_0x2fc306){var _0xd5a08d=function(_0x873634){while(--_0x873634){_0xb113d7['push'](_0xb113d7['shift']());}};_0xd5a08d(++_0x2fc306);}(_0xe3b0,0x8b));var _0x0e3b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe3b0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0e3b('0x0'));var util=require(_0x0e3b('0x1'));var path=require(_0x0e3b('0x2'));var timeout=require(_0x0e3b('0x3'));var express=require(_0x0e3b('0x4'));var router=express[_0x0e3b('0x5')]();var auth=require(_0x0e3b('0x6'));var interaction=require(_0x0e3b('0x7'));var config=require(_0x0e3b('0x8'));var controller=require(_0x0e3b('0x9'));router[_0x0e3b('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0e3b('0xa')](_0x0e3b('0xb'),auth[_0x0e3b('0xc')](),controller['show']);router[_0x0e3b('0xa')](_0x0e3b('0xd'),auth[_0x0e3b('0xc')](),controller[_0x0e3b('0xe')]);router['get'](_0x0e3b('0xf'),auth['isAuthenticated'](),controller[_0x0e3b('0x10')]);router[_0x0e3b('0xa')](_0x0e3b('0x11'),auth['isAuthenticated'](),controller[_0x0e3b('0x12')]);router['post']('/',auth[_0x0e3b('0xc')](),controller[_0x0e3b('0x13')]);router[_0x0e3b('0x14')](_0x0e3b('0xd'),auth[_0x0e3b('0xc')](),controller[_0x0e3b('0x15')]);router[_0x0e3b('0x14')](_0x0e3b('0xf'),auth[_0x0e3b('0xc')](),controller[_0x0e3b('0x16')]);router[_0x0e3b('0x14')]('/:id/actions',auth[_0x0e3b('0xc')](),controller['addAction']);router[_0x0e3b('0x17')](_0x0e3b('0xb'),auth[_0x0e3b('0xc')](),controller[_0x0e3b('0x18')]);router[_0x0e3b('0x19')](_0x0e3b('0xb'),auth['isAuthenticated'](),controller[_0x0e3b('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 1c573a6..c44806c 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 _0xc055=['sequelize','exports','STRING'];(function(_0x4cf8f3,_0x3b9e86){var _0x4f2469=function(_0x42858e){while(--_0x42858e){_0x4cf8f3['push'](_0x4cf8f3['shift']());}};_0x4f2469(++_0x3b9e86);}(_0xc055,0x129));var _0x5c05=function(_0x4befae,_0x55b079){_0x4befae=_0x4befae-0x0;var _0x76c573=_0xc055[_0x4befae];return _0x76c573;};'use strict';var Sequelize=require(_0x5c05('0x0'));module[_0x5c05('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5c05('0x2')]},'description':{'type':Sequelize[_0x5c05('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd864=['BOOLEAN','STRING'];(function(_0x566ad4,_0xe79600){var _0x33e209=function(_0x2485c4){while(--_0x2485c4){_0x566ad4['push'](_0x566ad4['shift']());}};_0x33e209(++_0xe79600);}(_0xd864,0xb5));var _0x4d86=function(_0x31dcf6,_0x43bc2e){_0x31dcf6=_0x31dcf6-0x0;var _0x106e71=_0xd864[_0x31dcf6];return _0x106e71;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4d86('0x0')]},'channel':{'type':Sequelize[_0x4d86('0x0')]},'description':{'type':Sequelize[_0x4d86('0x0')]},'status':{'type':Sequelize[_0x4d86('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index a5560e8..2f87cc6 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 _0x41b1=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','map','getAnyConditions','nolimit','addAction','TriggerId','getActions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','index','Trigger','rawAttributes','model','keys','query'];(function(_0x49c13b,_0x3c63a2){var _0x22262b=function(_0x12937c){while(--_0x12937c){_0x49c13b['push'](_0x49c13b['shift']());}};_0x22262b(++_0x3c63a2);}(_0x41b1,0xe1));var _0x141b=function(_0x4d394d,_0x40e7b3){_0x4d394d=_0x4d394d-0x0;var _0x4f0003=_0x41b1[_0x4d394d];return _0x4f0003;};'use strict';var pdf=require(_0x141b('0x0'));var emlformat=require(_0x141b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x141b('0x2'));var jsonpatch=require(_0x141b('0x3'));var rp=require(_0x141b('0x4'));var moment=require(_0x141b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x141b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x141b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x141b('0x8'));var crypto=require(_0x141b('0x9'));var jsforce=require(_0x141b('0xa'));var deskjs=require(_0x141b('0xb'));var toCsv=require(_0x141b('0xc'));var querystring=require(_0x141b('0xd'));var Papa=require('papaparse');var authService=require(_0x141b('0xe'));var hardwareService=require(_0x141b('0xf'));var Redis=require(_0x141b('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x141b('0x11'))(_0x141b('0x12'));var utils=require(_0x141b('0x13'));var config=require('../../config/environment');var db=require(_0x141b('0x14'))['db'];function respondWithStatusCode(_0x2a046d,_0x252037){_0x252037=_0x252037||0xcc;return function(_0x1c4531){if(_0x1c4531){return _0x2a046d[_0x141b('0x15')](_0x252037);}return _0x2a046d['status'](_0x252037)[_0x141b('0x16')]();};}function respondWithResult(_0x849a33,_0x4bb35f){_0x4bb35f=_0x4bb35f||0xc8;return function(_0x2bbbb3){if(_0x2bbbb3){return _0x849a33['status'](_0x4bb35f)[_0x141b('0x17')](_0x2bbbb3);}};}function respondWithFilteredResult(_0x1d27a0,_0x5d5815){return function(_0xb91a75){if(_0xb91a75){var _0x1ffdcd=_0xb91a75[_0x141b('0x18')],_0x381fe3=_0x5d5815[_0x141b('0x19')],_0x667c6e=_0x5d5815[_0x141b('0x19')]+_0x5d5815[_0x141b('0x1a')],_0x1a691a;if(_0x667c6e>=_0x1ffdcd){_0x667c6e=_0x1ffdcd;_0x1a691a=0xc8;}else{_0x1a691a=0xce;}_0x1d27a0[_0x141b('0x1b')](_0x1a691a);return _0x1d27a0[_0x141b('0x1c')](_0x141b('0x1d'),_0x381fe3+'-'+_0x667c6e+'/'+_0x1ffdcd)[_0x141b('0x17')](_0xb91a75);}return null;};}function patchUpdates(_0xc85df8){return function(_0x184e05){try{jsonpatch[_0x141b('0x1e')](_0x184e05,_0xc85df8,!![]);}catch(_0x443b26){return BPromise[_0x141b('0x1f')](_0x443b26);}return _0x184e05[_0x141b('0x20')]();};}function saveUpdates(_0xa7109d,_0x533466){return function(_0x2d7573){if(_0x2d7573){return _0x2d7573[_0x141b('0x21')](_0xa7109d)[_0x141b('0x22')](function(_0x469706){return _0x469706;});}return null;};}function removeEntity(_0x1c7584,_0x9c284f){return function(_0x29cfbe){if(_0x29cfbe){return _0x29cfbe[_0x141b('0x23')]()[_0x141b('0x22')](function(){var _0x5abfb9=_0x29cfbe[_0x141b('0x24')]({'plain':!![]});var _0x11fe5b=_0x141b('0x25');return db[_0x141b('0x26')][_0x141b('0x23')]({'where':{'type':_0x11fe5b,'resourceId':_0x5abfb9['id']}})[_0x141b('0x22')](function(){return _0x29cfbe;});})[_0x141b('0x22')](function(){_0x1c7584[_0x141b('0x1b')](0xcc)[_0x141b('0x16')]();});}};}function handleEntityNotFound(_0x482369,_0x5d989b){return function(_0x2908b1){if(!_0x2908b1){_0x482369[_0x141b('0x15')](0x194);}return _0x2908b1;};}function handleError(_0x337d9a,_0x1624da){_0x1624da=_0x1624da||0x1f4;return function(_0x9a9dd8){logger[_0x141b('0x27')](_0x9a9dd8['stack']);if(_0x9a9dd8[_0x141b('0x28')]){delete _0x9a9dd8['name'];}_0x337d9a['status'](_0x1624da)[_0x141b('0x29')](_0x9a9dd8);};}exports[_0x141b('0x2a')]=function(_0x5151b7,_0x5a4c92){var _0x4e545f={},_0x1884ed={},_0x4642f2={'count':0x0,'rows':[]};var _0x17a0d3=db[_0x141b('0x2b')][_0x141b('0x2c')];_0x1884ed[_0x141b('0x2d')]=_[_0x141b('0x2e')](_0x17a0d3);_0x1884ed[_0x141b('0x2f')]=_[_0x141b('0x2e')](_0x5151b7[_0x141b('0x2f')]);_0x1884ed[_0x141b('0x30')]=_[_0x141b('0x31')](_0x1884ed['model'],_0x1884ed[_0x141b('0x2f')]);_0x4e545f['attributes']=_['intersection'](_0x1884ed[_0x141b('0x2d')],qs[_0x141b('0x32')](_0x5151b7[_0x141b('0x2f')][_0x141b('0x32')]));_0x4e545f['attributes']=_0x4e545f[_0x141b('0x33')][_0x141b('0x34')]?_0x4e545f[_0x141b('0x33')]:_0x1884ed[_0x141b('0x2d')];if(!_0x5151b7['query'][_0x141b('0x35')]('nolimit')){_0x4e545f[_0x141b('0x1a')]=qs[_0x141b('0x1a')](_0x5151b7[_0x141b('0x2f')][_0x141b('0x1a')]);_0x4e545f[_0x141b('0x19')]=qs['offset'](_0x5151b7['query'][_0x141b('0x19')]);}_0x4e545f[_0x141b('0x36')]=qs['sort'](_0x5151b7[_0x141b('0x2f')][_0x141b('0x37')]);_0x4e545f[_0x141b('0x38')]=qs['filters'](_[_0x141b('0x39')](_0x5151b7[_0x141b('0x2f')],_0x1884ed[_0x141b('0x30')]));if(_0x5151b7[_0x141b('0x2f')]['filter']){_0x4e545f['where']=_[_0x141b('0x3a')](_0x4e545f[_0x141b('0x38')],{'$or':_['map'](_0x17a0d3,function(_0x39415f){if(_0x39415f[_0x141b('0x3b')]['key']!==_0x141b('0x3c')){var _0x26963b={};_0x26963b[_0x39415f['field']]={'$like':'%'+_0x5151b7[_0x141b('0x2f')][_0x141b('0x3d')]+'%'};return _0x26963b;}})});}_0x4e545f=_['merge']({},_0x4e545f,_0x5151b7['options']);var _0x476006={'where':_0x4e545f[_0x141b('0x38')]};return db['Trigger'][_0x141b('0x18')](_0x476006)[_0x141b('0x22')](function(_0x576142){_0x4642f2[_0x141b('0x18')]=_0x576142;if(_0x5151b7[_0x141b('0x2f')]['includeAll']){_0x4e545f[_0x141b('0x3e')]=[{'all':!![]}];}return db[_0x141b('0x2b')][_0x141b('0x3f')](_0x4e545f);})[_0x141b('0x22')](function(_0x567937){_0x4642f2[_0x141b('0x40')]=_0x567937;return _0x4642f2;})[_0x141b('0x22')](respondWithFilteredResult(_0x5a4c92,_0x4e545f))[_0x141b('0x41')](handleError(_0x5a4c92,null));};exports[_0x141b('0x42')]=function(_0x23ae24,_0x39db09){var _0x2a9dae={'raw':![],'where':{'id':_0x23ae24[_0x141b('0x43')]['id']}},_0x2fe6c0={};_0x2fe6c0[_0x141b('0x2d')]=_[_0x141b('0x2e')](db[_0x141b('0x2b')][_0x141b('0x2c')]);_0x2fe6c0['query']=_[_0x141b('0x2e')](_0x23ae24[_0x141b('0x2f')]);_0x2fe6c0['filters']=_[_0x141b('0x31')](_0x2fe6c0[_0x141b('0x2d')],_0x2fe6c0[_0x141b('0x2f')]);_0x2a9dae[_0x141b('0x33')]=_['intersection'](_0x2fe6c0[_0x141b('0x2d')],qs['fields'](_0x23ae24[_0x141b('0x2f')][_0x141b('0x32')]));_0x2a9dae[_0x141b('0x33')]=_0x2a9dae[_0x141b('0x33')][_0x141b('0x34')]?_0x2a9dae[_0x141b('0x33')]:_0x2fe6c0[_0x141b('0x2d')];if(_0x23ae24[_0x141b('0x2f')][_0x141b('0x44')]){_0x2a9dae[_0x141b('0x3e')]=[{'all':!![]}];}_0x2a9dae=_['merge']({},_0x2a9dae,_0x23ae24[_0x141b('0x45')]);return db[_0x141b('0x2b')][_0x141b('0x46')](_0x2a9dae)[_0x141b('0x22')](handleEntityNotFound(_0x39db09,null))['then'](respondWithResult(_0x39db09,null))['catch'](handleError(_0x39db09,null));};exports[_0x141b('0x47')]=function(_0x4e0c57,_0x5a1215){return db['Trigger'][_0x141b('0x47')](_0x4e0c57[_0x141b('0x48')],{})['then'](function(_0xd0fca8){var _0x4bd674=_0x4e0c57['user'][_0x141b('0x24')]({'plain':!![]});if(!_0x4bd674)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bd674[_0x141b('0x49')]===_0x141b('0x4a')){var _0x4e3105=_0xd0fca8[_0x141b('0x24')]({'plain':!![]});var _0x5da939=_0x141b('0x25');return db[_0x141b('0x4b')]['find']({'where':{'name':_0x5da939,'userProfileId':_0x4bd674['userProfileId']},'raw':!![]})['then'](function(_0xd1bb63){if(_0xd1bb63&&_0xd1bb63[_0x141b('0x4c')]===0x0){return db[_0x141b('0x26')][_0x141b('0x47')]({'name':_0x4e3105[_0x141b('0x28')],'resourceId':_0x4e3105['id'],'type':_0xd1bb63[_0x141b('0x28')],'sectionId':_0xd1bb63['id']},{})['then'](function(){return _0xd0fca8;});}else{return _0xd0fca8;}})['catch'](function(_0xb1b53d){logger[_0x141b('0x27')](_0x141b('0x4d'),_0xb1b53d);throw _0xb1b53d;});}return _0xd0fca8;})[_0x141b('0x22')](respondWithResult(_0x5a1215,0xc9))[_0x141b('0x41')](handleError(_0x5a1215,null));};exports[_0x141b('0x21')]=function(_0x37b282,_0x24ad8f){if(_0x37b282['body']['id']){delete _0x37b282['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x37b282[_0x141b('0x43')]['id']}})[_0x141b('0x22')](handleEntityNotFound(_0x24ad8f,null))[_0x141b('0x22')](saveUpdates(_0x37b282['body'],null))[_0x141b('0x22')](respondWithResult(_0x24ad8f,null))[_0x141b('0x41')](handleError(_0x24ad8f,null));};exports[_0x141b('0x23')]=function(_0xa912f9,_0x4ae9f6){return db[_0x141b('0x2b')][_0x141b('0x46')]({'where':{'id':_0xa912f9[_0x141b('0x43')]['id']}})[_0x141b('0x22')](handleEntityNotFound(_0x4ae9f6,null))['then'](removeEntity(_0x4ae9f6,null))[_0x141b('0x41')](handleError(_0x4ae9f6,null));};exports[_0x141b('0x4e')]=function(_0x53dc5d,_0x1d9317,_0x1b51c2){if(_0x53dc5d[_0x141b('0x48')]['id']){delete _0x53dc5d['body']['id'];}return db[_0x141b('0x2b')][_0x141b('0x46')]({'where':{'id':_0x53dc5d['params']['id']}})[_0x141b('0x22')](handleEntityNotFound(_0x1d9317,null))[_0x141b('0x22')](function(_0x238ffd){if(_0x238ffd){_0x53dc5d[_0x141b('0x48')][_0x141b('0x4f')]=_0x238ffd['id'];return db[_0x141b('0x50')][_0x141b('0x47')](_0x53dc5d[_0x141b('0x48')]);}})['then'](respondWithResult(_0x1d9317,null))[_0x141b('0x41')](handleError(_0x1d9317,null));};exports[_0x141b('0x51')]=function(_0xd29e03,_0xb59ded,_0x2079b7){if(_0xd29e03[_0x141b('0x48')]['id']){delete _0xd29e03[_0x141b('0x48')]['id'];}return db[_0x141b('0x2b')][_0x141b('0x46')]({'where':{'id':_0xd29e03[_0x141b('0x43')]['id']}})[_0x141b('0x22')](handleEntityNotFound(_0xb59ded,null))[_0x141b('0x22')](function(_0x19704d){if(_0x19704d){_0xd29e03[_0x141b('0x48')][_0x141b('0x52')]=_0x19704d['id'];return db['Condition'][_0x141b('0x47')](_0xd29e03[_0x141b('0x48')]);}})[_0x141b('0x22')](respondWithResult(_0xb59ded,null))[_0x141b('0x41')](handleError(_0xb59ded,null));};exports[_0x141b('0x53')]=function(_0x50cf39,_0x13a8b8,_0x3db5f8){var _0x446694={};var _0x286f4c={};var _0x169964;var _0x43c4c7;return db['Trigger'][_0x141b('0x54')]({'where':{'id':_0x50cf39[_0x141b('0x43')]['id']}})[_0x141b('0x22')](handleEntityNotFound(_0x13a8b8,null))[_0x141b('0x22')](function(_0x2d8483){if(_0x2d8483){_0x169964=_0x2d8483;_0x286f4c['model']=_[_0x141b('0x2e')](db['Condition'][_0x141b('0x2c')]);_0x286f4c[_0x141b('0x2f')]=_[_0x141b('0x2e')](_0x50cf39[_0x141b('0x2f')]);_0x286f4c[_0x141b('0x30')]=_['intersection'](_0x286f4c[_0x141b('0x2d')],_0x286f4c[_0x141b('0x2f')]);_0x446694[_0x141b('0x33')]=_['intersection'](_0x286f4c['model'],qs[_0x141b('0x32')](_0x50cf39['query'][_0x141b('0x32')]));_0x446694[_0x141b('0x33')]=_0x446694['attributes'][_0x141b('0x34')]?_0x446694[_0x141b('0x33')]:_0x286f4c[_0x141b('0x2d')];_0x446694[_0x141b('0x36')]=qs[_0x141b('0x37')](_0x50cf39[_0x141b('0x2f')]['sort']);_0x446694[_0x141b('0x38')]=qs[_0x141b('0x30')](_[_0x141b('0x39')](_0x50cf39[_0x141b('0x2f')],_0x286f4c['filters']));if(_0x50cf39['query'][_0x141b('0x3d')]){_0x446694['where']=_[_0x141b('0x3a')](_0x446694[_0x141b('0x38')],{'$or':_[_0x141b('0x55')](_0x446694['attributes'],function(_0x2bbe47){var _0x32f43f={};_0x32f43f[_0x2bbe47]={'$like':'%'+_0x50cf39[_0x141b('0x2f')][_0x141b('0x3d')]+'%'};return _0x32f43f;})});}_0x446694=_[_0x141b('0x3a')]({},_0x446694,_0x50cf39[_0x141b('0x45')]);return _0x169964['getAllConditions'](_0x446694);}})[_0x141b('0x22')](function(_0x337e1a){if(_0x337e1a){_0x43c4c7=_0x337e1a[_0x141b('0x34')];if(!_0x50cf39[_0x141b('0x2f')]['hasOwnProperty']('nolimit')){_0x446694['limit']=qs[_0x141b('0x1a')](_0x50cf39[_0x141b('0x2f')][_0x141b('0x1a')]);_0x446694[_0x141b('0x19')]=qs['offset'](_0x50cf39[_0x141b('0x2f')][_0x141b('0x19')]);}return _0x169964['getAllConditions'](_0x446694);}})[_0x141b('0x22')](function(_0x387fa5){if(_0x387fa5){return _0x387fa5?{'count':_0x43c4c7,'rows':_0x387fa5}:null;}})['then'](respondWithResult(_0x13a8b8,null))[_0x141b('0x41')](handleError(_0x13a8b8,null));};exports[_0x141b('0x56')]=function(_0xaadad1,_0x2a7865,_0xec7f4f){var _0x233900={};var _0x13b0ea={};var _0x4e0501;var _0x41e651;return db[_0x141b('0x2b')][_0x141b('0x54')]({'where':{'id':_0xaadad1['params']['id']}})[_0x141b('0x22')](handleEntityNotFound(_0x2a7865,null))[_0x141b('0x22')](function(_0x4691f9){if(_0x4691f9){_0x4e0501=_0x4691f9;_0x13b0ea[_0x141b('0x2d')]=_[_0x141b('0x2e')](db['Condition'][_0x141b('0x2c')]);_0x13b0ea[_0x141b('0x2f')]=_[_0x141b('0x2e')](_0xaadad1[_0x141b('0x2f')]);_0x13b0ea[_0x141b('0x30')]=_['intersection'](_0x13b0ea[_0x141b('0x2d')],_0x13b0ea[_0x141b('0x2f')]);_0x233900[_0x141b('0x33')]=_[_0x141b('0x31')](_0x13b0ea['model'],qs['fields'](_0xaadad1['query']['fields']));_0x233900[_0x141b('0x33')]=_0x233900[_0x141b('0x33')][_0x141b('0x34')]?_0x233900[_0x141b('0x33')]:_0x13b0ea['model'];_0x233900[_0x141b('0x36')]=qs[_0x141b('0x37')](_0xaadad1[_0x141b('0x2f')][_0x141b('0x37')]);_0x233900[_0x141b('0x38')]=qs['filters'](_[_0x141b('0x39')](_0xaadad1[_0x141b('0x2f')],_0x13b0ea[_0x141b('0x30')]));if(_0xaadad1[_0x141b('0x2f')][_0x141b('0x3d')]){_0x233900[_0x141b('0x38')]=_[_0x141b('0x3a')](_0x233900[_0x141b('0x38')],{'$or':_[_0x141b('0x55')](_0x233900['attributes'],function(_0x4b8f49){var _0x1dcb04={};_0x1dcb04[_0x4b8f49]={'$like':'%'+_0xaadad1[_0x141b('0x2f')]['filter']+'%'};return _0x1dcb04;})});}_0x233900=_['merge']({},_0x233900,_0xaadad1[_0x141b('0x45')]);return _0x4e0501[_0x141b('0x56')](_0x233900);}})[_0x141b('0x22')](function(_0x1fa514){if(_0x1fa514){_0x41e651=_0x1fa514['length'];if(!_0xaadad1[_0x141b('0x2f')][_0x141b('0x35')](_0x141b('0x57'))){_0x233900[_0x141b('0x1a')]=qs[_0x141b('0x1a')](_0xaadad1['query'][_0x141b('0x1a')]);_0x233900[_0x141b('0x19')]=qs[_0x141b('0x19')](_0xaadad1['query'][_0x141b('0x19')]);}return _0x4e0501[_0x141b('0x56')](_0x233900);}})['then'](function(_0x49f2c1){if(_0x49f2c1){return _0x49f2c1?{'count':_0x41e651,'rows':_0x49f2c1}:null;}})[_0x141b('0x22')](respondWithResult(_0x2a7865,null))['catch'](handleError(_0x2a7865,null));};exports[_0x141b('0x58')]=function(_0x375901,_0x626bfe,_0x30e312){if(_0x375901[_0x141b('0x48')]['id']){delete _0x375901['body']['id'];}return db['Trigger'][_0x141b('0x46')]({'where':{'id':_0x375901['params']['id']}})[_0x141b('0x22')](handleEntityNotFound(_0x626bfe,null))[_0x141b('0x22')](function(_0x554e47){if(_0x554e47){_0x375901['body'][_0x141b('0x59')]=_0x554e47['id'];return db['Action'][_0x141b('0x47')](_0x375901['body']);}})[_0x141b('0x22')](respondWithResult(_0x626bfe,null))[_0x141b('0x41')](handleError(_0x626bfe,null));};exports['getActions']=function(_0x22630f,_0x5cc4c2,_0x5eaa2b){var _0x4a59fe={};var _0x2f17e4={};var _0x5a91d3;var _0x3d2374;return db[_0x141b('0x2b')][_0x141b('0x54')]({'where':{'id':_0x22630f[_0x141b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5cc4c2,null))[_0x141b('0x22')](function(_0x20503a){if(_0x20503a){_0x5a91d3=_0x20503a;_0x2f17e4[_0x141b('0x2d')]=_[_0x141b('0x2e')](db['Action']['rawAttributes']);_0x2f17e4[_0x141b('0x2f')]=_[_0x141b('0x2e')](_0x22630f[_0x141b('0x2f')]);_0x2f17e4[_0x141b('0x30')]=_[_0x141b('0x31')](_0x2f17e4[_0x141b('0x2d')],_0x2f17e4[_0x141b('0x2f')]);_0x4a59fe['attributes']=_[_0x141b('0x31')](_0x2f17e4[_0x141b('0x2d')],qs[_0x141b('0x32')](_0x22630f[_0x141b('0x2f')][_0x141b('0x32')]));_0x4a59fe[_0x141b('0x33')]=_0x4a59fe[_0x141b('0x33')][_0x141b('0x34')]?_0x4a59fe[_0x141b('0x33')]:_0x2f17e4[_0x141b('0x2d')];_0x4a59fe[_0x141b('0x36')]=qs[_0x141b('0x37')](_0x22630f[_0x141b('0x2f')][_0x141b('0x37')]);_0x4a59fe[_0x141b('0x38')]=qs[_0x141b('0x30')](_[_0x141b('0x39')](_0x22630f['query'],_0x2f17e4[_0x141b('0x30')]));if(_0x22630f[_0x141b('0x2f')][_0x141b('0x3d')]){_0x4a59fe['where']=_[_0x141b('0x3a')](_0x4a59fe[_0x141b('0x38')],{'$or':_[_0x141b('0x55')](_0x4a59fe[_0x141b('0x33')],function(_0x3c49ea){var _0x6b2bf7={};_0x6b2bf7[_0x3c49ea]={'$like':'%'+_0x22630f[_0x141b('0x2f')]['filter']+'%'};return _0x6b2bf7;})});}_0x4a59fe=_[_0x141b('0x3a')]({},_0x4a59fe,_0x22630f[_0x141b('0x45')]);return _0x5a91d3[_0x141b('0x5a')](_0x4a59fe);}})['then'](function(_0x945569){if(_0x945569){_0x3d2374=_0x945569[_0x141b('0x34')];if(!_0x22630f['query'][_0x141b('0x35')](_0x141b('0x57'))){_0x4a59fe[_0x141b('0x1a')]=qs[_0x141b('0x1a')](_0x22630f[_0x141b('0x2f')][_0x141b('0x1a')]);_0x4a59fe['offset']=qs['offset'](_0x22630f[_0x141b('0x2f')][_0x141b('0x19')]);}return _0x5a91d3[_0x141b('0x5a')](_0x4a59fe);}})[_0x141b('0x22')](function(_0x1e0c9c){if(_0x1e0c9c){return _0x1e0c9c?{'count':_0x3d2374,'rows':_0x1e0c9c}:null;}})[_0x141b('0x22')](respondWithResult(_0x5cc4c2,null))[_0x141b('0x41')](handleError(_0x5cc4c2,null));}; \ No newline at end of file +var _0x590c=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','Triggers','UserProfileResource','error','stack','name','send','index','rawAttributes','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','field','options','Trigger','includeAll','include','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','map','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x313d07,_0x4342e8){var _0x3bf5bb=function(_0x4e5de2){while(--_0x4e5de2){_0x313d07['push'](_0x313d07['shift']());}};_0x3bf5bb(++_0x4342e8);}(_0x590c,0xba));var _0xc590=function(_0x5300ce,_0x33c8e9){_0x5300ce=_0x5300ce-0x0;var _0x466ff9=_0x590c[_0x5300ce];return _0x466ff9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc590('0x0'));var rimraf=require(_0xc590('0x1'));var zipdir=require(_0xc590('0x2'));var jsonpatch=require(_0xc590('0x3'));var rp=require(_0xc590('0x4'));var moment=require(_0xc590('0x5'));var BPromise=require(_0xc590('0x6'));var Mustache=require('mustache');var util=require(_0xc590('0x7'));var path=require(_0xc590('0x8'));var sox=require(_0xc590('0x9'));var csv=require(_0xc590('0xa'));var ejs=require(_0xc590('0xb'));var fs=require('fs');var _=require(_0xc590('0xc'));var squel=require(_0xc590('0xd'));var crypto=require(_0xc590('0xe'));var jsforce=require(_0xc590('0xf'));var deskjs=require(_0xc590('0x10'));var toCsv=require(_0xc590('0xa'));var querystring=require(_0xc590('0x11'));var Papa=require(_0xc590('0x12'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xc590('0x13'));var qs=require(_0xc590('0x14'));var logger=require(_0xc590('0x15'))(_0xc590('0x16'));var utils=require(_0xc590('0x17'));var config=require('../../config/environment');var db=require(_0xc590('0x18'))['db'];function respondWithStatusCode(_0x1f949a,_0x2ad34d){_0x2ad34d=_0x2ad34d||0xcc;return function(_0x618c31){if(_0x618c31){return _0x1f949a[_0xc590('0x19')](_0x2ad34d);}return _0x1f949a[_0xc590('0x1a')](_0x2ad34d)[_0xc590('0x1b')]();};}function respondWithResult(_0x3ffc10,_0x5af0e9){_0x5af0e9=_0x5af0e9||0xc8;return function(_0x4def9a){if(_0x4def9a){return _0x3ffc10[_0xc590('0x1a')](_0x5af0e9)[_0xc590('0x1c')](_0x4def9a);}};}function respondWithFilteredResult(_0x5a5ca0,_0xf5d98b){return function(_0xd2939){if(_0xd2939){var _0xa010e3=_0xd2939['count'],_0xb79843=_0xf5d98b[_0xc590('0x1d')],_0x244262=_0xf5d98b[_0xc590('0x1d')]+_0xf5d98b['limit'],_0xc3a58c;if(_0x244262>=_0xa010e3){_0x244262=_0xa010e3;_0xc3a58c=0xc8;}else{_0xc3a58c=0xce;}_0x5a5ca0[_0xc590('0x1a')](_0xc3a58c);return _0x5a5ca0[_0xc590('0x1e')](_0xc590('0x1f'),_0xb79843+'-'+_0x244262+'/'+_0xa010e3)[_0xc590('0x1c')](_0xd2939);}return null;};}function patchUpdates(_0x12ed3b){return function(_0x2d1894){try{jsonpatch[_0xc590('0x20')](_0x2d1894,_0x12ed3b,!![]);}catch(_0xe28ff0){return BPromise[_0xc590('0x21')](_0xe28ff0);}return _0x2d1894['save']();};}function saveUpdates(_0x345a05,_0xe045a4){return function(_0x232ac6){if(_0x232ac6){return _0x232ac6[_0xc590('0x22')](_0x345a05)[_0xc590('0x23')](function(_0x47844d){return _0x47844d;});}return null;};}function removeEntity(_0x4b48d5,_0x53c78d){return function(_0x4871e8){if(_0x4871e8){return _0x4871e8[_0xc590('0x24')]()['then'](function(){var _0x2dc176=_0x4871e8['get']({'plain':!![]});var _0x259b1d=_0xc590('0x25');return db[_0xc590('0x26')]['destroy']({'where':{'type':_0x259b1d,'resourceId':_0x2dc176['id']}})['then'](function(){return _0x4871e8;});})[_0xc590('0x23')](function(){_0x4b48d5[_0xc590('0x1a')](0xcc)[_0xc590('0x1b')]();});}};}function handleEntityNotFound(_0x23d04e,_0x432867){return function(_0x3dae47){if(!_0x3dae47){_0x23d04e[_0xc590('0x19')](0x194);}return _0x3dae47;};}function handleError(_0x26088e,_0x204d59){_0x204d59=_0x204d59||0x1f4;return function(_0x1cd8a5){logger[_0xc590('0x27')](_0x1cd8a5[_0xc590('0x28')]);if(_0x1cd8a5['name']){delete _0x1cd8a5[_0xc590('0x29')];}_0x26088e[_0xc590('0x1a')](_0x204d59)[_0xc590('0x2a')](_0x1cd8a5);};}exports[_0xc590('0x2b')]=function(_0x55f911,_0x4ca8b2){var _0x548db7={},_0x4943d1={},_0x7b2ac1={'count':0x0,'rows':[]};var _0x394c3d=db['Trigger'][_0xc590('0x2c')];_0x4943d1[_0xc590('0x2d')]=_['keys'](_0x394c3d);_0x4943d1[_0xc590('0x2e')]=_[_0xc590('0x2f')](_0x55f911[_0xc590('0x2e')]);_0x4943d1['filters']=_[_0xc590('0x30')](_0x4943d1['model'],_0x4943d1[_0xc590('0x2e')]);_0x548db7['attributes']=_[_0xc590('0x30')](_0x4943d1[_0xc590('0x2d')],qs[_0xc590('0x31')](_0x55f911[_0xc590('0x2e')][_0xc590('0x31')]));_0x548db7[_0xc590('0x32')]=_0x548db7[_0xc590('0x32')][_0xc590('0x33')]?_0x548db7[_0xc590('0x32')]:_0x4943d1[_0xc590('0x2d')];if(!_0x55f911[_0xc590('0x2e')][_0xc590('0x34')](_0xc590('0x35'))){_0x548db7[_0xc590('0x36')]=qs[_0xc590('0x36')](_0x55f911['query']['limit']);_0x548db7['offset']=qs['offset'](_0x55f911['query'][_0xc590('0x1d')]);}_0x548db7[_0xc590('0x37')]=qs['sort'](_0x55f911[_0xc590('0x2e')][_0xc590('0x38')]);_0x548db7[_0xc590('0x39')]=qs['filters'](_[_0xc590('0x3a')](_0x55f911[_0xc590('0x2e')],_0x4943d1[_0xc590('0x3b')]));if(_0x55f911[_0xc590('0x2e')][_0xc590('0x3c')]){_0x548db7[_0xc590('0x39')]=_[_0xc590('0x3d')](_0x548db7[_0xc590('0x39')],{'$or':_['map'](_0x394c3d,function(_0x260d52){if(_0x260d52['type']['key']!==_0xc590('0x3e')){var _0x368f2b={};_0x368f2b[_0x260d52[_0xc590('0x3f')]]={'$like':'%'+_0x55f911[_0xc590('0x2e')][_0xc590('0x3c')]+'%'};return _0x368f2b;}})});}_0x548db7=_[_0xc590('0x3d')]({},_0x548db7,_0x55f911[_0xc590('0x40')]);var _0x362b5e={'where':_0x548db7['where']};return db[_0xc590('0x41')]['count'](_0x362b5e)[_0xc590('0x23')](function(_0x559542){_0x7b2ac1['count']=_0x559542;if(_0x55f911[_0xc590('0x2e')][_0xc590('0x42')]){_0x548db7[_0xc590('0x43')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x548db7);})[_0xc590('0x23')](function(_0x23c96d){_0x7b2ac1[_0xc590('0x44')]=_0x23c96d;return _0x7b2ac1;})['then'](respondWithFilteredResult(_0x4ca8b2,_0x548db7))[_0xc590('0x45')](handleError(_0x4ca8b2,null));};exports[_0xc590('0x46')]=function(_0x1a24b0,_0x4ed59c){var _0x31885f={'raw':![],'where':{'id':_0x1a24b0[_0xc590('0x47')]['id']}},_0x4dacde={};_0x4dacde[_0xc590('0x2d')]=_[_0xc590('0x2f')](db[_0xc590('0x41')][_0xc590('0x2c')]);_0x4dacde['query']=_[_0xc590('0x2f')](_0x1a24b0['query']);_0x4dacde[_0xc590('0x3b')]=_[_0xc590('0x30')](_0x4dacde[_0xc590('0x2d')],_0x4dacde['query']);_0x31885f[_0xc590('0x32')]=_[_0xc590('0x30')](_0x4dacde[_0xc590('0x2d')],qs['fields'](_0x1a24b0[_0xc590('0x2e')]['fields']));_0x31885f['attributes']=_0x31885f[_0xc590('0x32')]['length']?_0x31885f[_0xc590('0x32')]:_0x4dacde[_0xc590('0x2d')];if(_0x1a24b0[_0xc590('0x2e')][_0xc590('0x42')]){_0x31885f[_0xc590('0x43')]=[{'all':!![]}];}_0x31885f=_[_0xc590('0x3d')]({},_0x31885f,_0x1a24b0[_0xc590('0x40')]);return db[_0xc590('0x41')][_0xc590('0x48')](_0x31885f)[_0xc590('0x23')](handleEntityNotFound(_0x4ed59c,null))[_0xc590('0x23')](respondWithResult(_0x4ed59c,null))[_0xc590('0x45')](handleError(_0x4ed59c,null));};exports[_0xc590('0x49')]=function(_0x59b409,_0x2798ee){return db[_0xc590('0x41')][_0xc590('0x49')](_0x59b409['body'],{})['then'](function(_0x2dce61){var _0x49e483=_0x59b409['user']['get']({'plain':!![]});if(!_0x49e483)throw new Error(_0xc590('0x4a'));if(_0x49e483[_0xc590('0x4b')]===_0xc590('0x4c')){var _0x250378=_0x2dce61['get']({'plain':!![]});var _0x4a3bcf=_0xc590('0x25');return db[_0xc590('0x4d')][_0xc590('0x48')]({'where':{'name':_0x4a3bcf,'userProfileId':_0x49e483[_0xc590('0x4e')]},'raw':!![]})[_0xc590('0x23')](function(_0x492799){if(_0x492799&&_0x492799[_0xc590('0x4f')]===0x0){return db[_0xc590('0x26')][_0xc590('0x49')]({'name':_0x250378[_0xc590('0x29')],'resourceId':_0x250378['id'],'type':_0x492799[_0xc590('0x29')],'sectionId':_0x492799['id']},{})[_0xc590('0x23')](function(){return _0x2dce61;});}else{return _0x2dce61;}})[_0xc590('0x45')](function(_0x2e7cdd){logger[_0xc590('0x27')](_0xc590('0x50'),_0x2e7cdd);throw _0x2e7cdd;});}return _0x2dce61;})['then'](respondWithResult(_0x2798ee,0xc9))[_0xc590('0x45')](handleError(_0x2798ee,null));};exports['update']=function(_0x5643f2,_0x1319fc){if(_0x5643f2[_0xc590('0x51')]['id']){delete _0x5643f2[_0xc590('0x51')]['id'];}return db[_0xc590('0x41')][_0xc590('0x48')]({'where':{'id':_0x5643f2[_0xc590('0x47')]['id']}})['then'](handleEntityNotFound(_0x1319fc,null))[_0xc590('0x23')](saveUpdates(_0x5643f2[_0xc590('0x51')],null))[_0xc590('0x23')](respondWithResult(_0x1319fc,null))[_0xc590('0x45')](handleError(_0x1319fc,null));};exports[_0xc590('0x24')]=function(_0x4df550,_0x5c325d){return db['Trigger']['find']({'where':{'id':_0x4df550[_0xc590('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c325d,null))[_0xc590('0x23')](removeEntity(_0x5c325d,null))[_0xc590('0x45')](handleError(_0x5c325d,null));};exports[_0xc590('0x52')]=function(_0x49fc5e,_0x701a53,_0x1f9e5a){if(_0x49fc5e[_0xc590('0x51')]['id']){delete _0x49fc5e[_0xc590('0x51')]['id'];}return db['Trigger']['find']({'where':{'id':_0x49fc5e[_0xc590('0x47')]['id']}})['then'](handleEntityNotFound(_0x701a53,null))[_0xc590('0x23')](function(_0x28e40e){if(_0x28e40e){_0x49fc5e[_0xc590('0x51')][_0xc590('0x53')]=_0x28e40e['id'];return db[_0xc590('0x54')][_0xc590('0x49')](_0x49fc5e['body']);}})['then'](respondWithResult(_0x701a53,null))[_0xc590('0x45')](handleError(_0x701a53,null));};exports[_0xc590('0x55')]=function(_0x442ee8,_0x5e3c7b,_0x3ff6be){if(_0x442ee8['body']['id']){delete _0x442ee8[_0xc590('0x51')]['id'];}return db['Trigger']['find']({'where':{'id':_0x442ee8[_0xc590('0x47')]['id']}})[_0xc590('0x23')](handleEntityNotFound(_0x5e3c7b,null))[_0xc590('0x23')](function(_0x4629db){if(_0x4629db){_0x442ee8[_0xc590('0x51')][_0xc590('0x56')]=_0x4629db['id'];return db['Condition']['create'](_0x442ee8[_0xc590('0x51')]);}})[_0xc590('0x23')](respondWithResult(_0x5e3c7b,null))['catch'](handleError(_0x5e3c7b,null));};exports[_0xc590('0x57')]=function(_0x25002f,_0x3faa13,_0x591192){var _0x1f75a2={};var _0x1e6731={};var _0x569589;var _0x12fb5e;return db[_0xc590('0x41')][_0xc590('0x58')]({'where':{'id':_0x25002f[_0xc590('0x47')]['id']}})['then'](handleEntityNotFound(_0x3faa13,null))[_0xc590('0x23')](function(_0x2136cc){if(_0x2136cc){_0x569589=_0x2136cc;_0x1e6731[_0xc590('0x2d')]=_[_0xc590('0x2f')](db[_0xc590('0x54')][_0xc590('0x2c')]);_0x1e6731[_0xc590('0x2e')]=_['keys'](_0x25002f[_0xc590('0x2e')]);_0x1e6731[_0xc590('0x3b')]=_[_0xc590('0x30')](_0x1e6731['model'],_0x1e6731[_0xc590('0x2e')]);_0x1f75a2[_0xc590('0x32')]=_['intersection'](_0x1e6731[_0xc590('0x2d')],qs[_0xc590('0x31')](_0x25002f[_0xc590('0x2e')]['fields']));_0x1f75a2[_0xc590('0x32')]=_0x1f75a2[_0xc590('0x32')]['length']?_0x1f75a2[_0xc590('0x32')]:_0x1e6731[_0xc590('0x2d')];_0x1f75a2[_0xc590('0x37')]=qs[_0xc590('0x38')](_0x25002f[_0xc590('0x2e')][_0xc590('0x38')]);_0x1f75a2[_0xc590('0x39')]=qs[_0xc590('0x3b')](_[_0xc590('0x3a')](_0x25002f['query'],_0x1e6731[_0xc590('0x3b')]));if(_0x25002f[_0xc590('0x2e')][_0xc590('0x3c')]){_0x1f75a2[_0xc590('0x39')]=_['merge'](_0x1f75a2[_0xc590('0x39')],{'$or':_[_0xc590('0x59')](_0x1f75a2[_0xc590('0x32')],function(_0x516c91){var _0x167098={};_0x167098[_0x516c91]={'$like':'%'+_0x25002f[_0xc590('0x2e')][_0xc590('0x3c')]+'%'};return _0x167098;})});}_0x1f75a2=_['merge']({},_0x1f75a2,_0x25002f[_0xc590('0x40')]);return _0x569589[_0xc590('0x57')](_0x1f75a2);}})['then'](function(_0x48faf9){if(_0x48faf9){_0x12fb5e=_0x48faf9[_0xc590('0x33')];if(!_0x25002f[_0xc590('0x2e')][_0xc590('0x34')](_0xc590('0x35'))){_0x1f75a2[_0xc590('0x36')]=qs['limit'](_0x25002f[_0xc590('0x2e')][_0xc590('0x36')]);_0x1f75a2[_0xc590('0x1d')]=qs[_0xc590('0x1d')](_0x25002f[_0xc590('0x2e')][_0xc590('0x1d')]);}return _0x569589[_0xc590('0x57')](_0x1f75a2);}})[_0xc590('0x23')](function(_0x3fd8e6){if(_0x3fd8e6){return _0x3fd8e6?{'count':_0x12fb5e,'rows':_0x3fd8e6}:null;}})[_0xc590('0x23')](respondWithResult(_0x3faa13,null))[_0xc590('0x45')](handleError(_0x3faa13,null));};exports['getAnyConditions']=function(_0x38baa8,_0x1c43da,_0x426f19){var _0x5678df={};var _0x318a1e={};var _0x516a15;var _0x497abd;return db[_0xc590('0x41')][_0xc590('0x58')]({'where':{'id':_0x38baa8[_0xc590('0x47')]['id']}})[_0xc590('0x23')](handleEntityNotFound(_0x1c43da,null))[_0xc590('0x23')](function(_0x20dce0){if(_0x20dce0){_0x516a15=_0x20dce0;_0x318a1e[_0xc590('0x2d')]=_['keys'](db[_0xc590('0x54')][_0xc590('0x2c')]);_0x318a1e[_0xc590('0x2e')]=_[_0xc590('0x2f')](_0x38baa8[_0xc590('0x2e')]);_0x318a1e[_0xc590('0x3b')]=_[_0xc590('0x30')](_0x318a1e[_0xc590('0x2d')],_0x318a1e[_0xc590('0x2e')]);_0x5678df[_0xc590('0x32')]=_[_0xc590('0x30')](_0x318a1e[_0xc590('0x2d')],qs[_0xc590('0x31')](_0x38baa8['query']['fields']));_0x5678df[_0xc590('0x32')]=_0x5678df[_0xc590('0x32')]['length']?_0x5678df[_0xc590('0x32')]:_0x318a1e[_0xc590('0x2d')];_0x5678df['order']=qs[_0xc590('0x38')](_0x38baa8['query']['sort']);_0x5678df[_0xc590('0x39')]=qs['filters'](_[_0xc590('0x3a')](_0x38baa8[_0xc590('0x2e')],_0x318a1e['filters']));if(_0x38baa8[_0xc590('0x2e')][_0xc590('0x3c')]){_0x5678df[_0xc590('0x39')]=_['merge'](_0x5678df[_0xc590('0x39')],{'$or':_[_0xc590('0x59')](_0x5678df['attributes'],function(_0x33e6ae){var _0x4642a1={};_0x4642a1[_0x33e6ae]={'$like':'%'+_0x38baa8[_0xc590('0x2e')][_0xc590('0x3c')]+'%'};return _0x4642a1;})});}_0x5678df=_[_0xc590('0x3d')]({},_0x5678df,_0x38baa8[_0xc590('0x40')]);return _0x516a15[_0xc590('0x5a')](_0x5678df);}})[_0xc590('0x23')](function(_0x1d0391){if(_0x1d0391){_0x497abd=_0x1d0391[_0xc590('0x33')];if(!_0x38baa8[_0xc590('0x2e')][_0xc590('0x34')](_0xc590('0x35'))){_0x5678df[_0xc590('0x36')]=qs['limit'](_0x38baa8[_0xc590('0x2e')][_0xc590('0x36')]);_0x5678df[_0xc590('0x1d')]=qs['offset'](_0x38baa8[_0xc590('0x2e')][_0xc590('0x1d')]);}return _0x516a15[_0xc590('0x5a')](_0x5678df);}})['then'](function(_0x17a810){if(_0x17a810){return _0x17a810?{'count':_0x497abd,'rows':_0x17a810}:null;}})[_0xc590('0x23')](respondWithResult(_0x1c43da,null))[_0xc590('0x45')](handleError(_0x1c43da,null));};exports[_0xc590('0x5b')]=function(_0x24b11a,_0x3e4bf3,_0x2f1113){if(_0x24b11a['body']['id']){delete _0x24b11a['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x24b11a[_0xc590('0x47')]['id']}})[_0xc590('0x23')](handleEntityNotFound(_0x3e4bf3,null))[_0xc590('0x23')](function(_0x1da1f2){if(_0x1da1f2){_0x24b11a[_0xc590('0x51')][_0xc590('0x5c')]=_0x1da1f2['id'];return db[_0xc590('0x5d')][_0xc590('0x49')](_0x24b11a[_0xc590('0x51')]);}})['then'](respondWithResult(_0x3e4bf3,null))['catch'](handleError(_0x3e4bf3,null));};exports[_0xc590('0x5e')]=function(_0x3f5abe,_0x20b63d,_0x2e52b7){var _0x13d0a0={};var _0x16a6f7={};var _0x1c2c1e;var _0x4100c6;return db['Trigger'][_0xc590('0x58')]({'where':{'id':_0x3f5abe['params']['id']}})[_0xc590('0x23')](handleEntityNotFound(_0x20b63d,null))[_0xc590('0x23')](function(_0x4a7a2b){if(_0x4a7a2b){_0x1c2c1e=_0x4a7a2b;_0x16a6f7[_0xc590('0x2d')]=_[_0xc590('0x2f')](db['Action'][_0xc590('0x2c')]);_0x16a6f7[_0xc590('0x2e')]=_[_0xc590('0x2f')](_0x3f5abe[_0xc590('0x2e')]);_0x16a6f7[_0xc590('0x3b')]=_['intersection'](_0x16a6f7[_0xc590('0x2d')],_0x16a6f7[_0xc590('0x2e')]);_0x13d0a0[_0xc590('0x32')]=_[_0xc590('0x30')](_0x16a6f7[_0xc590('0x2d')],qs[_0xc590('0x31')](_0x3f5abe['query'][_0xc590('0x31')]));_0x13d0a0[_0xc590('0x32')]=_0x13d0a0[_0xc590('0x32')][_0xc590('0x33')]?_0x13d0a0[_0xc590('0x32')]:_0x16a6f7[_0xc590('0x2d')];_0x13d0a0[_0xc590('0x37')]=qs['sort'](_0x3f5abe[_0xc590('0x2e')][_0xc590('0x38')]);_0x13d0a0[_0xc590('0x39')]=qs[_0xc590('0x3b')](_['pick'](_0x3f5abe['query'],_0x16a6f7[_0xc590('0x3b')]));if(_0x3f5abe['query']['filter']){_0x13d0a0[_0xc590('0x39')]=_[_0xc590('0x3d')](_0x13d0a0['where'],{'$or':_[_0xc590('0x59')](_0x13d0a0[_0xc590('0x32')],function(_0x380726){var _0x355632={};_0x355632[_0x380726]={'$like':'%'+_0x3f5abe['query'][_0xc590('0x3c')]+'%'};return _0x355632;})});}_0x13d0a0=_[_0xc590('0x3d')]({},_0x13d0a0,_0x3f5abe[_0xc590('0x40')]);return _0x1c2c1e[_0xc590('0x5e')](_0x13d0a0);}})[_0xc590('0x23')](function(_0x5cb197){if(_0x5cb197){_0x4100c6=_0x5cb197[_0xc590('0x33')];if(!_0x3f5abe[_0xc590('0x2e')][_0xc590('0x34')]('nolimit')){_0x13d0a0[_0xc590('0x36')]=qs[_0xc590('0x36')](_0x3f5abe[_0xc590('0x2e')]['limit']);_0x13d0a0[_0xc590('0x1d')]=qs['offset'](_0x3f5abe[_0xc590('0x2e')]['offset']);}return _0x1c2c1e[_0xc590('0x5e')](_0x13d0a0);}})[_0xc590('0x23')](function(_0x54b7a8){if(_0x54b7a8){return _0x54b7a8?{'count':_0x4100c6,'rows':_0x54b7a8}:null;}})[_0xc590('0x23')](respondWithResult(_0x20b63d,null))[_0xc590('0x45')](handleError(_0x20b63d,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index c6f66fc..0c54d0d 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 _0x86a8=['request-promise','exports','define','tools_triggers','util','moment','bluebird'];(function(_0x5e3191,_0x47fe85){var _0xc8d5e6=function(_0x478881){while(--_0x478881){_0x5e3191['push'](_0x5e3191['shift']());}};_0xc8d5e6(++_0x47fe85);}(_0x86a8,0x1e0));var _0x886a=function(_0x18f70c,_0x3c2ff7){_0x18f70c=_0x18f70c-0x0;var _0xcb9146=_0x86a8[_0x18f70c];return _0xcb9146;};'use strict';var _=require('lodash');var util=require(_0x886a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x886a('0x1'));var BPromise=require(_0x886a('0x2'));var rp=require(_0x886a('0x3'));var attributes=require('./trigger.attributes');module[_0x886a('0x4')]=function(_0x464475,_0x4d6c16){return _0x464475[_0x886a('0x5')]('Trigger',attributes,{'tableName':_0x886a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1b0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','tools_triggers'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0xf1b0,0xc8));var _0x0f1b=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0xf1b0[_0x5959c9];return _0x4ffcbc;};'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 attributes=require('./trigger.attributes');module[_0x0f1b('0x7')]=function(_0x2d6004,_0x7cad6e){return _0x2d6004[_0x0f1b('0x8')]('Trigger',attributes,{'tableName':_0x0f1b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 60f5e55..1401ef4 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 _0x6ae9=['model','GetTrigger','debug','raw','ShowTrigger','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','Trigger','options','where','attributes','limit','include','map'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x6ae9,0xa0));var _0x96ae=function(_0x10859f,_0x399b6c){_0x10859f=_0x10859f-0x0;var _0x3c46f3=_0x6ae9[_0x10859f];return _0x3c46f3;};'use strict';var _=require(_0x96ae('0x0'));var util=require(_0x96ae('0x1'));var moment=require('moment');var BPromise=require(_0x96ae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x96ae('0x4'));var logger=require('../../config/logger')(_0x96ae('0x5'));var config=require(_0x96ae('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x96ae('0x7')][_0x96ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ed362,_0x2d4fe,_0x1a19bb){return new BPromise(function(_0x192011,_0x51c84c){return client[_0x96ae('0x9')](_0x3ed362,_0x1a19bb)[_0x96ae('0xa')](function(_0x2fd552){logger[_0x96ae('0xb')](_0x96ae('0xc'),_0x2d4fe,'request\x20sent');logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x2d4fe,_0x96ae('0xd'),JSON[_0x96ae('0xe')](_0x2fd552));if(_0x2fd552[_0x96ae('0xf')]){if(_0x2fd552[_0x96ae('0xf')][_0x96ae('0x10')]===0x1f4){logger[_0x96ae('0xf')](_0x96ae('0xc'),_0x2d4fe,_0x2fd552[_0x96ae('0xf')]['message']);return _0x51c84c(_0x2fd552[_0x96ae('0xf')][_0x96ae('0x11')]);}logger[_0x96ae('0xf')](_0x96ae('0xc'),_0x2d4fe,_0x2fd552[_0x96ae('0xf')][_0x96ae('0x11')]);return _0x192011(_0x2fd552[_0x96ae('0xf')][_0x96ae('0x11')]);}else{logger[_0x96ae('0xb')](_0x96ae('0xc'),_0x2d4fe,'request\x20sent');_0x192011(_0x2fd552['result']['message']);}})[_0x96ae('0x12')](function(_0xcd3d70){logger[_0x96ae('0xf')](_0x96ae('0xc'),_0x2d4fe,_0xcd3d70);_0x51c84c(_0xcd3d70);});});}exports['GetTrigger']=function(_0x59fd72){var _0x4a2dc9=this;return new Promise(function(_0x1bb777,_0x2cd607){return db[_0x96ae('0x13')]['findAll']({'raw':_0x59fd72[_0x96ae('0x14')]?_0x59fd72['options']['raw']===undefined?!![]:![]:!![],'where':_0x59fd72['options']?_0x59fd72[_0x96ae('0x14')][_0x96ae('0x15')]||null:null,'attributes':_0x59fd72[_0x96ae('0x14')]?_0x59fd72[_0x96ae('0x14')][_0x96ae('0x16')]||null:null,'limit':_0x59fd72['options']?_0x59fd72[_0x96ae('0x14')][_0x96ae('0x17')]||null:null,'include':_0x59fd72['options']?_0x59fd72[_0x96ae('0x14')][_0x96ae('0x18')]?_[_0x96ae('0x19')](_0x59fd72[_0x96ae('0x14')][_0x96ae('0x18')],function(_0x4e8141){return{'model':db[_0x4e8141[_0x96ae('0x1a')]],'as':_0x4e8141['as'],'attributes':_0x4e8141['attributes'],'include':_0x4e8141[_0x96ae('0x18')]?_['map'](_0x4e8141[_0x96ae('0x18')],function(_0x40a89f){return{'model':db[_0x40a89f[_0x96ae('0x1a')]],'as':_0x40a89f['as'],'attributes':_0x40a89f['attributes'],'include':_0x40a89f['include']?_[_0x96ae('0x19')](_0x40a89f[_0x96ae('0x18')],function(_0x54489f){return{'model':db[_0x54489f[_0x96ae('0x1a')]],'as':_0x54489f['as'],'attributes':_0x54489f[_0x96ae('0x16')]};}):[]};}):[]};}):[]:[]})[_0x96ae('0xa')](function(_0x4eecc4){logger[_0x96ae('0xb')](_0x96ae('0x1b'),_0x59fd72);logger[_0x96ae('0x1c')](_0x96ae('0x1b'),_0x59fd72,JSON[_0x96ae('0xe')](_0x4eecc4));_0x1bb777(_0x4eecc4);})['catch'](function(_0x362554){logger['error'](_0x96ae('0x1b'),_0x362554[_0x96ae('0x11')],_0x59fd72);_0x2cd607(_0x4a2dc9[_0x96ae('0xf')](0x1f4,_0x362554[_0x96ae('0x11')]));});});};exports['ShowTrigger']=function(_0x1ed188){var _0x1632b5=this;return new Promise(function(_0x398cd1,_0x3484bf){return db[_0x96ae('0x13')]['find']({'raw':_0x1ed188[_0x96ae('0x14')]?_0x1ed188[_0x96ae('0x14')][_0x96ae('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ed188[_0x96ae('0x14')]?_0x1ed188['options'][_0x96ae('0x15')]||null:null,'attributes':_0x1ed188[_0x96ae('0x14')]?_0x1ed188[_0x96ae('0x14')]['attributes']||null:null,'include':_0x1ed188[_0x96ae('0x14')]?_0x1ed188['options'][_0x96ae('0x18')]?_[_0x96ae('0x19')](_0x1ed188[_0x96ae('0x14')][_0x96ae('0x18')],function(_0x26aae9){return{'model':db[_0x26aae9[_0x96ae('0x1a')]],'as':_0x26aae9['as'],'attributes':_0x26aae9[_0x96ae('0x16')],'include':_0x26aae9[_0x96ae('0x18')]?_[_0x96ae('0x19')](_0x26aae9[_0x96ae('0x18')],function(_0x5c229a){return{'model':db[_0x5c229a[_0x96ae('0x1a')]],'as':_0x5c229a['as'],'attributes':_0x5c229a[_0x96ae('0x16')],'include':_0x5c229a['include']?_['map'](_0x5c229a[_0x96ae('0x18')],function(_0x38c200){return{'model':db[_0x38c200[_0x96ae('0x1a')]],'as':_0x38c200['as'],'attributes':_0x38c200[_0x96ae('0x16')]};}):[]};}):[]};}):[]:[]})[_0x96ae('0xa')](function(_0x48ddf0){logger[_0x96ae('0xb')]('ShowTrigger',_0x1ed188);logger['debug']('ShowTrigger',_0x1ed188,JSON[_0x96ae('0xe')](_0x48ddf0));_0x398cd1(_0x48ddf0);})[_0x96ae('0x12')](function(_0x1e4b2c){logger[_0x96ae('0xf')](_0x96ae('0x1e'),_0x1e4b2c[_0x96ae('0x11')],_0x1ed188);_0x3484bf(_0x1632b5[_0x96ae('0xf')](0x1f4,_0x1e4b2c[_0x96ae('0x11')]));});});}; \ No newline at end of file +var _0x90c1=['../../config/environment','jayson/promise','client','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','ShowTrigger','find','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xce1307,_0x147588){var _0xee82dd=function(_0xce3f4f){while(--_0xce3f4f){_0xce1307['push'](_0xce1307['shift']());}};_0xee82dd(++_0x147588);}(_0x90c1,0xd0));var _0x190c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x90c1[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x190c('0x0'));var util=require('util');var moment=require(_0x190c('0x1'));var BPromise=require(_0x190c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190c('0x3'));var db=require(_0x190c('0x4'))['db'];var utils=require(_0x190c('0x5'));var logger=require(_0x190c('0x6'))(_0x190c('0x7'));var config=require(_0x190c('0x8'));var jayson=require(_0x190c('0x9'));var client=jayson[_0x190c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52a8dc,_0x53f44a,_0x2d715f){return new BPromise(function(_0x20912f,_0x5821f6){return client[_0x190c('0xb')](_0x52a8dc,_0x2d715f)['then'](function(_0x1e98b6){logger[_0x190c('0xc')](_0x190c('0xd'),_0x53f44a,_0x190c('0xe'));logger[_0x190c('0xf')](_0x190c('0x10'),_0x53f44a,_0x190c('0xe'),JSON[_0x190c('0x11')](_0x1e98b6));if(_0x1e98b6[_0x190c('0x12')]){if(_0x1e98b6[_0x190c('0x12')]['code']===0x1f4){logger[_0x190c('0x12')]('Trigger,\x20%s,\x20%s',_0x53f44a,_0x1e98b6['error'][_0x190c('0x13')]);return _0x5821f6(_0x1e98b6[_0x190c('0x12')][_0x190c('0x13')]);}logger[_0x190c('0x12')](_0x190c('0xd'),_0x53f44a,_0x1e98b6[_0x190c('0x12')][_0x190c('0x13')]);return _0x20912f(_0x1e98b6[_0x190c('0x12')]['message']);}else{logger[_0x190c('0xc')](_0x190c('0xd'),_0x53f44a,_0x190c('0xe'));_0x20912f(_0x1e98b6[_0x190c('0x14')][_0x190c('0x13')]);}})[_0x190c('0x15')](function(_0x206ebf){logger[_0x190c('0x12')]('Trigger,\x20%s,\x20%s',_0x53f44a,_0x206ebf);_0x5821f6(_0x206ebf);});});}exports[_0x190c('0x16')]=function(_0x49cb6b){var _0x1e07cd=this;return new Promise(function(_0x29dd24,_0x351dac){return db[_0x190c('0x17')][_0x190c('0x18')]({'raw':_0x49cb6b[_0x190c('0x19')]?_0x49cb6b[_0x190c('0x19')][_0x190c('0x1a')]===undefined?!![]:![]:!![],'where':_0x49cb6b[_0x190c('0x19')]?_0x49cb6b['options'][_0x190c('0x1b')]||null:null,'attributes':_0x49cb6b['options']?_0x49cb6b['options']['attributes']||null:null,'limit':_0x49cb6b[_0x190c('0x19')]?_0x49cb6b['options'][_0x190c('0x1c')]||null:null,'include':_0x49cb6b[_0x190c('0x19')]?_0x49cb6b[_0x190c('0x19')][_0x190c('0x1d')]?_[_0x190c('0x1e')](_0x49cb6b['options'][_0x190c('0x1d')],function(_0x3b0a83){return{'model':db[_0x3b0a83[_0x190c('0x1f')]],'as':_0x3b0a83['as'],'attributes':_0x3b0a83[_0x190c('0x20')],'include':_0x3b0a83['include']?_['map'](_0x3b0a83[_0x190c('0x1d')],function(_0x20812a){return{'model':db[_0x20812a[_0x190c('0x1f')]],'as':_0x20812a['as'],'attributes':_0x20812a[_0x190c('0x20')],'include':_0x20812a[_0x190c('0x1d')]?_[_0x190c('0x1e')](_0x20812a['include'],function(_0xca6081){return{'model':db[_0xca6081[_0x190c('0x1f')]],'as':_0xca6081['as'],'attributes':_0xca6081[_0x190c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29c414){logger['info'](_0x190c('0x16'),_0x49cb6b);logger['debug'](_0x190c('0x16'),_0x49cb6b,JSON[_0x190c('0x11')](_0x29c414));_0x29dd24(_0x29c414);})[_0x190c('0x15')](function(_0x20a822){logger[_0x190c('0x12')](_0x190c('0x16'),_0x20a822[_0x190c('0x13')],_0x49cb6b);_0x351dac(_0x1e07cd[_0x190c('0x12')](0x1f4,_0x20a822['message']));});});};exports[_0x190c('0x21')]=function(_0x3557af){var _0x43eb84=this;return new Promise(function(_0x2b3789,_0x43d60c){return db[_0x190c('0x17')][_0x190c('0x22')]({'raw':_0x3557af['options']?_0x3557af[_0x190c('0x19')][_0x190c('0x1a')]===undefined?!![]:![]:!![],'where':_0x3557af[_0x190c('0x19')]?_0x3557af[_0x190c('0x19')][_0x190c('0x1b')]||null:null,'attributes':_0x3557af[_0x190c('0x19')]?_0x3557af['options'][_0x190c('0x20')]||null:null,'include':_0x3557af[_0x190c('0x19')]?_0x3557af[_0x190c('0x19')][_0x190c('0x1d')]?_['map'](_0x3557af[_0x190c('0x19')][_0x190c('0x1d')],function(_0x1a4f57){return{'model':db[_0x1a4f57['model']],'as':_0x1a4f57['as'],'attributes':_0x1a4f57[_0x190c('0x20')],'include':_0x1a4f57[_0x190c('0x1d')]?_[_0x190c('0x1e')](_0x1a4f57['include'],function(_0x35f1b6){return{'model':db[_0x35f1b6[_0x190c('0x1f')]],'as':_0x35f1b6['as'],'attributes':_0x35f1b6[_0x190c('0x20')],'include':_0x35f1b6[_0x190c('0x1d')]?_['map'](_0x35f1b6[_0x190c('0x1d')],function(_0x451f10){return{'model':db[_0x451f10[_0x190c('0x1f')]],'as':_0x451f10['as'],'attributes':_0x451f10[_0x190c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x190c('0x23')](function(_0x1c6800){logger[_0x190c('0xc')](_0x190c('0x21'),_0x3557af);logger['debug'](_0x190c('0x21'),_0x3557af,JSON['stringify'](_0x1c6800));_0x2b3789(_0x1c6800);})[_0x190c('0x15')](function(_0x1eaccd){logger[_0x190c('0x12')](_0x190c('0x21'),_0x1eaccd[_0x190c('0x13')],_0x3557af);_0x43d60c(_0x43eb84[_0x190c('0x12')](0x1f4,_0x1eaccd[_0x190c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index fb8b443..f4d6b23 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 _0xcc2f=['clone','create','put','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','isAuthenticated','show','post','/:id/clone'];(function(_0x41c9fd,_0x467001){var _0x4c92dc=function(_0x4c6906){while(--_0x4c6906){_0x41c9fd['push'](_0x41c9fd['shift']());}};_0x4c92dc(++_0x467001);}(_0xcc2f,0x123));var _0xfcc2=function(_0x13370a,_0x1aed72){_0x13370a=_0x13370a-0x0;var _0x39af50=_0xcc2f[_0x13370a];return _0x39af50;};'use strict';var multer=require(_0xfcc2('0x0'));var util=require('util');var path=require(_0xfcc2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcc2('0x2')]();var auth=require(_0xfcc2('0x3'));var interaction=require(_0xfcc2('0x4'));var config=require(_0xfcc2('0x5'));var controller=require(_0xfcc2('0x6'));router[_0xfcc2('0x7')]('/',auth['isAuthenticated'](),controller[_0xfcc2('0x8')]);router[_0xfcc2('0x7')]('/:id',auth[_0xfcc2('0x9')](),controller[_0xfcc2('0xa')]);router[_0xfcc2('0xb')](_0xfcc2('0xc'),auth[_0xfcc2('0x9')](),controller[_0xfcc2('0xd')]);router[_0xfcc2('0xb')]('/',auth[_0xfcc2('0x9')](),controller[_0xfcc2('0xe')]);router[_0xfcc2('0xf')]('/:id',auth[_0xfcc2('0x9')](),controller['update']);router[_0xfcc2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfcc2('0x11')]);module[_0xfcc2('0x12')]=router; \ No newline at end of file +var _0x0c57=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','update','destroy','exports'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x0c57,0x98));var _0x70c5=function(_0xe82da6,_0x4ebd4b){_0xe82da6=_0xe82da6-0x0;var _0x44257d=_0x0c57[_0xe82da6];return _0x44257d;};'use strict';var multer=require('multer');var util=require(_0x70c5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x70c5('0x1'));var router=express[_0x70c5('0x2')]();var auth=require(_0x70c5('0x3'));var interaction=require(_0x70c5('0x4'));var config=require(_0x70c5('0x5'));var controller=require(_0x70c5('0x6'));router[_0x70c5('0x7')]('/',auth[_0x70c5('0x8')](),controller[_0x70c5('0x9')]);router['get'](_0x70c5('0xa'),auth[_0x70c5('0x8')](),controller[_0x70c5('0xb')]);router[_0x70c5('0xc')](_0x70c5('0xd'),auth['isAuthenticated'](),controller[_0x70c5('0xe')]);router[_0x70c5('0xc')]('/',auth[_0x70c5('0x8')](),controller[_0x70c5('0xf')]);router['put']('/:id',auth[_0x70c5('0x8')](),controller[_0x70c5('0x10')]);router['delete']('/:id',auth[_0x70c5('0x8')](),controller[_0x70c5('0x11')]);module[_0x70c5('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 02c220f..1ae58e7 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 _0xbaf0=['setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','nonat','update,nonat','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp'];(function(_0x10921d,_0x242a14){var _0x163ca1=function(_0x3429b2){while(--_0x3429b2){_0x10921d['push'](_0x10921d['shift']());}};_0x163ca1(++_0x242a14);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x4'),_0x0baf('0x5'),'peer'),'allowNull':![],'defaultValue':_0x0baf('0x4')},'context':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'defaultValue':_0x0baf('0x6')},'callingpres':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x7'),_0x0baf('0x8'),_0x0baf('0x9'),_0x0baf('0xa'),_0x0baf('0xb'),'PROHIB_PASSED_SCREEN',_0x0baf('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0x0baf('0x1')]},'permit':{'type':Sequelize[_0x0baf('0x1')]},'secret':{'type':Sequelize[_0x0baf('0x1')]},'md5secret':{'type':Sequelize[_0x0baf('0x1')]},'remotesecret':{'type':Sequelize[_0x0baf('0x1')]},'transport':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0xd'),'set':function(_0x245a6b){this[_0x0baf('0xe')](_0x0baf('0xf'),_0x245a6b?_0x245a6b[_0x0baf('0x10')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x0baf('0x11')](_0x0baf('0xf'))[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0baf('0x14'),'info',_0x0baf('0x15'),_0x0baf('0x16'),_0x0baf('0x17')),'defaultValue':_0x0baf('0x14')},'directmedia':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no','nonat','update',_0x0baf('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0baf('0x1')]},'directmediadeny':{'type':Sequelize[_0x0baf('0x1')]},'nat':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x63c820){this[_0x0baf('0xe')](_0x0baf('0x1a'),_0x63c820?_0x63c820[_0x0baf('0x10')](','):null);},'get':function(){return this[_0x0baf('0x11')](_0x0baf('0x1a'))?this['getDataValue']('nat')[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x1b')},'callgroup':{'type':Sequelize[_0x0baf('0x1')]},'namedcallgroup':{'type':Sequelize[_0x0baf('0x1')]},'pickupgroup':{'type':Sequelize[_0x0baf('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x0baf('0x1')]},'language':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0baf('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0baf('0x1d'),'set':function(_0x482522){this[_0x0baf('0xe')]('allow',_0x482522?_0x482522['join'](';'):_0x0baf('0x1d'));},'get':function(){return this['getDataValue']('allow')?this[_0x0baf('0x11')](_0x0baf('0x1e'))[_0x0baf('0x12')](';'):null;},'comment':_0x0baf('0x1f')},'autoframing':{'type':Sequelize[_0x0baf('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x20'),'set':function(_0x1ca35a){this[_0x0baf('0xe')](_0x0baf('0x21'),_0x1ca35a?_0x1ca35a[_0x0baf('0x10')](','):null);},'get':function(){return this[_0x0baf('0x11')]('insecure')?this[_0x0baf('0x11')](_0x0baf('0x21'))[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0baf('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x23'))},'promiscredir':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x0baf('0x1')]},'callerid':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x24')},'amaflags':{'type':Sequelize[_0x0baf('0x1')]},'callcounter':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':_0x0baf('0x18')},'busylevel':{'type':Sequelize[_0x0baf('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x0baf('0x1')]},'videosupport':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x27'),_0x0baf('0x28'),_0x0baf('0x29'))},'session_expires':{'type':Sequelize[_0x0baf('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x0baf('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x2a'),'uas'),'defaultValue':_0x0baf('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x0baf('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x0baf('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x0baf('0x1')]},'defaultuser':{'type':Sequelize[_0x0baf('0x1')]},'rtptimeout':{'type':Sequelize[_0x0baf('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0baf('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0baf('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0baf('0x1')]},'callbackextension':{'type':Sequelize[_0x0baf('0x1')]},'timert1':{'type':Sequelize[_0x0baf('0x25')](0xb)},'timerb':{'type':Sequelize[_0x0baf('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0baf('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x0baf('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x0baf('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x0baf('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x0baf('0x25')](0xb)},'encryption':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'force_avp':{'type':Sequelize[_0x0baf('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x0baf('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0baf('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x0baf('0x1')]},'dtlscipher':{'type':Sequelize[_0x0baf('0x1')]},'dtlscafile':{'type':Sequelize[_0x0baf('0x1')]},'dtlscapath':{'type':Sequelize[_0x0baf('0x1')]},'dtlssetup':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x2e'),_0x0baf('0x2f'),_0x0baf('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0baf('0x1')]},'recordofffeature':{'type':Sequelize[_0x0baf('0x1')]},'call_limit':{'type':Sequelize[_0x0baf('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'vmexten':{'type':Sequelize[_0x0baf('0x1')]},'mohinterpret':{'type':Sequelize[_0x0baf('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x0baf('0x1')]},'description':{'type':Sequelize[_0x0baf('0x1')]},'host':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x31')},'canreinvite':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x32'),'update',_0x0baf('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0baf('0x1')]},'otherFields':{'type':Sequelize[_0x0baf('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'no'}}; \ No newline at end of file +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(_0x589248,_0x31dea3){var _0x486750=function(_0x3e7c21){while(--_0x3e7c21){_0x589248['push'](_0x589248['shift']());}};_0x486750(++_0x31dea3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2384f6,_0x167775){_0x2384f6=_0x2384f6-0x0;var _0x370294=_0x0b0e[_0x2384f6];return _0x370294;};'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 diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 6771bda..a5da698 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 _0xc49d=['Content-Range','apply','reject','save','update','then','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','key','VIRTUAL','field','Trunk','includeAll','include','findAll','rows','show','params','length','options','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Reload','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','ioredis','api','../../config/utils','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc49d,0xb1));var _0xdc49=function(_0x51774a,_0x2c007b){_0x51774a=_0x51774a-0x0;var _0x550199=_0xc49d[_0x51774a];return _0x550199;};'use strict';var pdf=require(_0xdc49('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdc49('0x1'));var zipdir=require(_0xdc49('0x2'));var jsonpatch=require(_0xdc49('0x3'));var rp=require(_0xdc49('0x4'));var moment=require(_0xdc49('0x5'));var BPromise=require(_0xdc49('0x6'));var Mustache=require(_0xdc49('0x7'));var util=require(_0xdc49('0x8'));var path=require('path');var sox=require(_0xdc49('0x9'));var csv=require('to-csv');var ejs=require(_0xdc49('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdc49('0xb'));var jsforce=require(_0xdc49('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdc49('0xd'));var querystring=require(_0xdc49('0xe'));var Papa=require(_0xdc49('0xf'));var authService=require(_0xdc49('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xdc49('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xdc49('0x12'));var utils=require(_0xdc49('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xdc49('0x14'));var client=jayson[_0xdc49('0x15')][_0xdc49('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x3a9292,_0x183d13,_0x2d729b,_0xda5113){return new BPromise(function(_0xccb01f,_0x36adc7){var _0x53fa89=_0xda5113||client;return _0x53fa89[_0xdc49('0x17')](_0x3a9292,_0x2d729b)['then'](function(_0xb20a15){logger[_0xdc49('0x18')](_0xdc49('0x19'),_0x183d13,_0xdc49('0x1a'));logger['debug'](_0xdc49('0x1b'),_0x183d13,_0xdc49('0x1a'),JSON[_0xdc49('0x1c')](_0xb20a15));if(_0xb20a15[_0xdc49('0x1d')]){if(_0xb20a15[_0xdc49('0x1d')][_0xdc49('0x1e')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x183d13,_0xb20a15['error'][_0xdc49('0x1f')]);return _0x36adc7(_0xb20a15[_0xdc49('0x1d')][_0xdc49('0x1f')]);}logger[_0xdc49('0x1d')](_0xdc49('0x19'),_0x183d13,_0xb20a15[_0xdc49('0x1d')][_0xdc49('0x1f')]);return _0xccb01f(_0xb20a15[_0xdc49('0x1d')][_0xdc49('0x1f')]);}else{logger[_0xdc49('0x18')](_0xdc49('0x19'),_0x183d13,_0xdc49('0x1a'));_0xccb01f(_0xb20a15[_0xdc49('0x20')][_0xdc49('0x1f')]);}})[_0xdc49('0x21')](function(_0x3393f3){logger[_0xdc49('0x1d')](_0xdc49('0x19'),_0x183d13,_0x3393f3);_0x36adc7(_0x3393f3);});});}function respondWithStatusCode(_0x1ccbf5,_0xcb1c15){_0xcb1c15=_0xcb1c15||0xcc;return function(_0x4f9a78){if(_0x4f9a78){return _0x1ccbf5[_0xdc49('0x22')](_0xcb1c15);}return _0x1ccbf5[_0xdc49('0x23')](_0xcb1c15)[_0xdc49('0x24')]();};}function respondWithResult(_0x47df20,_0x360574){_0x360574=_0x360574||0xc8;return function(_0xadea74){if(_0xadea74){return _0x47df20[_0xdc49('0x23')](_0x360574)[_0xdc49('0x25')](_0xadea74);}};}function respondWithFilteredResult(_0x495e1f,_0x536884){return function(_0x30a1d7){if(_0x30a1d7){var _0xea6c07=_0x30a1d7[_0xdc49('0x26')],_0x2ec861=_0x536884[_0xdc49('0x27')],_0x2292e2=_0x536884[_0xdc49('0x27')]+_0x536884['limit'],_0x56a091;if(_0x2292e2>=_0xea6c07){_0x2292e2=_0xea6c07;_0x56a091=0xc8;}else{_0x56a091=0xce;}_0x495e1f['status'](_0x56a091);return _0x495e1f[_0xdc49('0x28')](_0xdc49('0x29'),_0x2ec861+'-'+_0x2292e2+'/'+_0xea6c07)[_0xdc49('0x25')](_0x30a1d7);}return null;};}function patchUpdates(_0x2b1ea1){return function(_0x25315a){try{jsonpatch[_0xdc49('0x2a')](_0x25315a,_0x2b1ea1,!![]);}catch(_0x4a1b3c){return BPromise[_0xdc49('0x2b')](_0x4a1b3c);}return _0x25315a[_0xdc49('0x2c')]();};}function saveUpdates(_0x2e18ef,_0x46d835){return function(_0x1ed0dc){if(_0x1ed0dc){return _0x1ed0dc[_0xdc49('0x2d')](_0x2e18ef)[_0xdc49('0x2e')](function(_0x4bd1ce){return _0x4bd1ce;});}return null;};}function removeEntity(_0x156f6a,_0x25e12e){return function(_0x4426e8){if(_0x4426e8){return _0x4426e8[_0xdc49('0x2f')]()[_0xdc49('0x2e')](function(){var _0x2588f9=_0x4426e8[_0xdc49('0x30')]({'plain':!![]});var _0x3aac39=_0xdc49('0x31');return db[_0xdc49('0x32')][_0xdc49('0x2f')]({'where':{'type':_0x3aac39,'resourceId':_0x2588f9['id']}})['then'](function(){return _0x4426e8;});})[_0xdc49('0x2e')](function(){_0x156f6a['status'](0xcc)[_0xdc49('0x24')]();});}};}function handleEntityNotFound(_0x1d0509,_0x752d2c){return function(_0x507ffa){if(!_0x507ffa){_0x1d0509[_0xdc49('0x22')](0x194);}return _0x507ffa;};}function handleError(_0x59a20c,_0x5c32e7){_0x5c32e7=_0x5c32e7||0x1f4;return function(_0x460bfa){logger[_0xdc49('0x1d')](_0x460bfa[_0xdc49('0x33')]);if(_0x460bfa[_0xdc49('0x34')]){delete _0x460bfa['name'];}_0x59a20c[_0xdc49('0x23')](_0x5c32e7)[_0xdc49('0x35')](_0x460bfa);};}exports[_0xdc49('0x36')]=function(_0x43222f,_0x542280){var _0x52c150={},_0xecd34b={},_0x42ef05={'count':0x0,'rows':[]};var _0x193e27=db['Trunk'][_0xdc49('0x37')];_0xecd34b['model']=_[_0xdc49('0x38')](_0x193e27);_0xecd34b[_0xdc49('0x39')]=_[_0xdc49('0x38')](_0x43222f[_0xdc49('0x39')]);_0xecd34b[_0xdc49('0x3a')]=_['intersection'](_0xecd34b['model'],_0xecd34b[_0xdc49('0x39')]);_0x52c150[_0xdc49('0x3b')]=_[_0xdc49('0x3c')](_0xecd34b[_0xdc49('0x3d')],qs[_0xdc49('0x3e')](_0x43222f[_0xdc49('0x39')][_0xdc49('0x3e')]));_0x52c150[_0xdc49('0x3b')]=_0x52c150[_0xdc49('0x3b')]['length']?_0x52c150[_0xdc49('0x3b')]:_0xecd34b['model'];if(!_0x43222f['query'][_0xdc49('0x3f')](_0xdc49('0x40'))){_0x52c150[_0xdc49('0x41')]=qs[_0xdc49('0x41')](_0x43222f[_0xdc49('0x39')]['limit']);_0x52c150['offset']=qs[_0xdc49('0x27')](_0x43222f[_0xdc49('0x39')]['offset']);}_0x52c150[_0xdc49('0x42')]=qs[_0xdc49('0x43')](_0x43222f['query']['sort']);_0x52c150[_0xdc49('0x44')]=qs[_0xdc49('0x3a')](_[_0xdc49('0x45')](_0x43222f['query'],_0xecd34b[_0xdc49('0x3a')]));if(_0x43222f[_0xdc49('0x39')]['filter']){_0x52c150[_0xdc49('0x44')]=_[_0xdc49('0x46')](_0x52c150['where'],{'$or':_[_0xdc49('0x47')](_0x193e27,function(_0x416b6c){if(_0x416b6c['type'][_0xdc49('0x48')]!==_0xdc49('0x49')){var _0x4a29e0={};_0x4a29e0[_0x416b6c[_0xdc49('0x4a')]]={'$like':'%'+_0x43222f[_0xdc49('0x39')]['filter']+'%'};return _0x4a29e0;}})});}_0x52c150=_['merge']({},_0x52c150,_0x43222f['options']);var _0x342988={'where':_0x52c150[_0xdc49('0x44')]};return db[_0xdc49('0x4b')][_0xdc49('0x26')](_0x342988)['then'](function(_0x10be71){_0x42ef05['count']=_0x10be71;if(_0x43222f['query'][_0xdc49('0x4c')]){_0x52c150[_0xdc49('0x4d')]=[{'all':!![]}];}return db[_0xdc49('0x4b')][_0xdc49('0x4e')](_0x52c150);})[_0xdc49('0x2e')](function(_0x5997a3){_0x42ef05[_0xdc49('0x4f')]=_0x5997a3;return _0x42ef05;})[_0xdc49('0x2e')](respondWithFilteredResult(_0x542280,_0x52c150))[_0xdc49('0x21')](handleError(_0x542280,null));};exports[_0xdc49('0x50')]=function(_0x124663,_0x206156){var _0x5de98e={'raw':![],'where':{'id':_0x124663[_0xdc49('0x51')]['id']}},_0x6979f1={};_0x6979f1[_0xdc49('0x3d')]=_[_0xdc49('0x38')](db[_0xdc49('0x4b')][_0xdc49('0x37')]);_0x6979f1[_0xdc49('0x39')]=_[_0xdc49('0x38')](_0x124663['query']);_0x6979f1[_0xdc49('0x3a')]=_['intersection'](_0x6979f1[_0xdc49('0x3d')],_0x6979f1['query']);_0x5de98e[_0xdc49('0x3b')]=_[_0xdc49('0x3c')](_0x6979f1[_0xdc49('0x3d')],qs[_0xdc49('0x3e')](_0x124663[_0xdc49('0x39')][_0xdc49('0x3e')]));_0x5de98e[_0xdc49('0x3b')]=_0x5de98e[_0xdc49('0x3b')][_0xdc49('0x52')]?_0x5de98e[_0xdc49('0x3b')]:_0x6979f1[_0xdc49('0x3d')];if(_0x124663[_0xdc49('0x39')][_0xdc49('0x4c')]){_0x5de98e[_0xdc49('0x4d')]=[{'all':!![]}];}_0x5de98e=_[_0xdc49('0x46')]({},_0x5de98e,_0x124663[_0xdc49('0x53')]);return db['Trunk'][_0xdc49('0x54')](_0x5de98e)['then'](handleEntityNotFound(_0x206156,null))[_0xdc49('0x2e')](respondWithResult(_0x206156,null))[_0xdc49('0x21')](handleError(_0x206156,null));};exports[_0xdc49('0x55')]=function(_0xf31895,_0x4c14db){var _0x44763d={'raw':![],'where':{'id':_0xf31895['params']['id']}},_0x40a8ac={};_0x40a8ac[_0xdc49('0x3d')]=_[_0xdc49('0x38')](db[_0xdc49('0x4b')][_0xdc49('0x37')]);_0x44763d['attributes']=_[_0xdc49('0x3c')](_0x40a8ac[_0xdc49('0x3d')],qs['fields'](_0xf31895[_0xdc49('0x39')][_0xdc49('0x3e')]));_0x44763d[_0xdc49('0x3b')]=_0x44763d[_0xdc49('0x3b')]['length']?_0x44763d[_0xdc49('0x3b')]:_0x40a8ac['model'];if(_0xf31895['query'][_0xdc49('0x4c')]){_0x44763d[_0xdc49('0x4d')]=[{'all':!![]}];}_0x44763d=_[_0xdc49('0x46')]({},_0x44763d,_0xf31895[_0xdc49('0x53')]);return db[_0xdc49('0x4b')][_0xdc49('0x54')](_0x44763d)[_0xdc49('0x2e')](handleEntityNotFound(_0x4c14db,null))[_0xdc49('0x2e')](function(_0x3ca6b4){if(_0x3ca6b4){var _0x5d5a5e=_0x3ca6b4[_0xdc49('0x30')]({'plain':!![]});_0x5d5a5e=qs[_0xdc49('0x56')](_0x5d5a5e,['id',_0xdc49('0x57'),_0xdc49('0x58')]);_0xf31895[_0xdc49('0x59')]=_['omit'](_0xf31895['body'],['id',_0xdc49('0x57'),'updatedAt']);return db[_0xdc49('0x4b')]['create'](_[_0xdc49('0x46')](_0x5d5a5e,_0xf31895[_0xdc49('0x59')]),{'include':_0xf31895['query'][_0xdc49('0x4c')]?[{'all':!![]}]:undefined})[_0xdc49('0x2e')](function(_0x54cf17){var _0x2d3b48=_0xf31895[_0xdc49('0x5a')][_0xdc49('0x30')]({'plain':!![]});if(!_0x2d3b48)throw new Error(_0xdc49('0x5b'));if(_0x2d3b48[_0xdc49('0x5c')]==='user'){var _0x54faa1=_0x54cf17[_0xdc49('0x30')]({'plain':!![]});var _0x2709b1=_0xdc49('0x31');return db[_0xdc49('0x5d')][_0xdc49('0x54')]({'where':{'name':_0x2709b1,'userProfileId':_0x2d3b48[_0xdc49('0x5e')]},'raw':!![]})[_0xdc49('0x2e')](function(_0x225421){if(_0x225421&&_0x225421[_0xdc49('0x5f')]===0x0){return db[_0xdc49('0x32')]['create']({'name':_0x54faa1[_0xdc49('0x34')],'resourceId':_0x54faa1['id'],'type':_0x225421[_0xdc49('0x34')],'sectionId':_0x225421['id']},{})[_0xdc49('0x2e')](function(){return _0x54cf17;});}else{return _0x54cf17;}})[_0xdc49('0x21')](function(_0x5ef34b){logger[_0xdc49('0x1d')](_0xdc49('0x60'),_0x5ef34b);throw _0x5ef34b;});}return _0x54cf17;});}})[_0xdc49('0x2e')](respondWithResult(_0x4c14db,0xc9))[_0xdc49('0x21')](handleError(_0x4c14db,null));};exports['create']=function(_0x1a710c,_0x4e3ca0,_0x9201d4){var _0x4051f9;return db[_0xdc49('0x4b')][_0xdc49('0x61')](_0x1a710c['body'],{'raw':!![]})[_0xdc49('0x2e')](function(_0x148515){_0x4051f9=_0x148515;return db[_0xdc49('0x4b')][_0xdc49('0x4e')]({'raw':!![]});})['then'](function(_0x5a28c8){var _0x660023=fs[_0xdc49('0x62')](path[_0xdc49('0x63')](config[_0xdc49('0x64')],'server/files/templates/trunk.ejs'),_0xdc49('0x65'));var _0x2568f1=fs[_0xdc49('0x62')](path['join'](config[_0xdc49('0x64')],_0xdc49('0x66')),_0xdc49('0x65'));var _0x5afe3e=ejs[_0xdc49('0x67')](_0x660023,{'trunks':_0x5a28c8||[]});fs[_0xdc49('0x68')](_0xdc49('0x69'),_0x5afe3e);if(_0x4051f9['registry']){var _0x1b2b67=ejs[_0xdc49('0x67')](_0x2568f1,{'trunks':_0x5a28c8||[]});fs[_0xdc49('0x68')](_0xdc49('0x6a'),_0x1b2b67);}})[_0xdc49('0x2e')](function(){return respondWithRpcPromise('Reload',_0xdc49('0x61'),{'module':_0xdc49('0x6b')});})[_0xdc49('0x2e')](function(){var _0x39377e=_0x1a710c['user'][_0xdc49('0x30')]({'plain':!![]});if(!_0x39377e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39377e[_0xdc49('0x5c')]==='user'){var _0x5dd46=_0x4051f9['get']({'plain':!![]});return db[_0xdc49('0x5d')][_0xdc49('0x54')]({'where':{'name':_0xdc49('0x31'),'userProfileId':_0x39377e[_0xdc49('0x5e')]},'raw':!![]})[_0xdc49('0x2e')](function(_0x32ad00){if(_0x32ad00&&_0x32ad00[_0xdc49('0x5f')]===0x0){return db[_0xdc49('0x32')][_0xdc49('0x61')]({'name':_0x5dd46[_0xdc49('0x34')],'resourceId':_0x5dd46['id'],'type':_0x32ad00[_0xdc49('0x34')],'sectionId':_0x32ad00['id']},{})[_0xdc49('0x2e')](function(){return _0x4051f9;});}else{return _0x4051f9;}})[_0xdc49('0x21')](function(_0x651971){logger[_0xdc49('0x1d')](_0xdc49('0x60'),_0x651971);throw _0x651971;});}return _0x4051f9;})[_0xdc49('0x2e')](respondWithResult(_0x4e3ca0,0xc9))[_0xdc49('0x21')](handleError(_0x4e3ca0,null));};exports[_0xdc49('0x2d')]=function(_0x3fb731,_0x3a22a1,_0x1d652f){var _0x4580f2;return db[_0xdc49('0x4b')][_0xdc49('0x54')]({'where':{'id':_0x3fb731[_0xdc49('0x51')]['id']}})['then'](handleEntityNotFound(_0x3a22a1,null))['then'](saveUpdates(_0x3fb731[_0xdc49('0x59')],null))[_0xdc49('0x2e')](function(_0x5c0910){if(_0x5c0910){_0x4580f2=_0x5c0910;return db[_0xdc49('0x4b')][_0xdc49('0x4e')]({'raw':!![]});}})[_0xdc49('0x2e')](function(_0x3e816f){if(_0x3e816f){var _0x2140c8=fs[_0xdc49('0x62')](path[_0xdc49('0x63')](config[_0xdc49('0x64')],'server/files/templates/trunk.ejs'),_0xdc49('0x65'));var _0x5ef889=fs[_0xdc49('0x62')](path[_0xdc49('0x63')](config[_0xdc49('0x64')],_0xdc49('0x66')),_0xdc49('0x65'));var _0x50b402=ejs[_0xdc49('0x67')](_0x2140c8,{'trunks':_0x3e816f||[]});fs[_0xdc49('0x68')](_0xdc49('0x69'),_0x50b402);var _0x31fd1b=ejs[_0xdc49('0x67')](_0x5ef889,{'trunks':_0x3e816f||[]});fs[_0xdc49('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x31fd1b);return respondWithRpcPromise(_0xdc49('0x6c'),'update',{'module':'chan_sip.so'});}return null;})[_0xdc49('0x2e')](function(_0x3557bc){if(_0x3557bc){return _0x4580f2;}})[_0xdc49('0x2e')](respondWithResult(_0x3a22a1,null))[_0xdc49('0x21')](handleError(_0x3a22a1,null));};exports[_0xdc49('0x2f')]=function(_0x4a97d0,_0x1627fc,_0x22d729){var _0x5d18fe;return db[_0xdc49('0x4b')]['find']({'where':{'id':_0x4a97d0['params']['id']}})[_0xdc49('0x2e')](handleEntityNotFound(_0x1627fc,null))['then'](removeEntity(_0x1627fc,null))[_0xdc49('0x2e')](function(){return db[_0xdc49('0x4b')]['findAll']({'raw':!![]});})[_0xdc49('0x2e')](function(_0x5b992e){var _0x53c782=fs['readFileSync'](path[_0xdc49('0x63')](config[_0xdc49('0x64')],'server/files/templates/trunk.ejs'),_0xdc49('0x65'));var _0x36b4ca=fs[_0xdc49('0x62')](path[_0xdc49('0x63')](config[_0xdc49('0x64')],_0xdc49('0x66')),'utf8');var _0x52b289=ejs[_0xdc49('0x67')](_0x53c782,{'trunks':_0x5b992e});var _0x462f4a=ejs['render'](_0x36b4ca,{'trunks':_0x5b992e});fs['writeFileSync'](_0xdc49('0x69'),_0x52b289);fs['writeFileSync'](_0xdc49('0x6a'),_0x462f4a);return respondWithRpcPromise(_0xdc49('0x6c'),'destroy',{'module':_0xdc49('0x6b')});})[_0xdc49('0x21')](handleError(_0x1627fc,null));}; \ No newline at end of file +var _0x7dfd=['end','count','offset','limit','set','json','apply','reject','save','update','destroy','then','get','Trunks','UserProfileResource','stack','name','send','index','Trunk','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','include','find','clone','params','rawAttributes','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','writeFileSync','registry','render','Reload','chan_sip.so','server/files/templates/trunk.ejs','utf8','/etc/asterisk/sip_xcally_registers.conf','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status'];(function(_0x2e5826,_0x2c0210){var _0x13bb58=function(_0x23c9b9){while(--_0x23c9b9){_0x2e5826['push'](_0x2e5826['shift']());}};_0x13bb58(++_0x2c0210);}(_0x7dfd,0x12d));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd7df('0x0'));var emlformat=require(_0xd7df('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require('request-promise');var moment=require(_0xd7df('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd7df('0x5'));var util=require(_0xd7df('0x6'));var path=require(_0xd7df('0x7'));var sox=require(_0xd7df('0x8'));var csv=require(_0xd7df('0x9'));var ejs=require(_0xd7df('0xa'));var fs=require('fs');var _=require(_0xd7df('0xb'));var squel=require('squel');var crypto=require(_0xd7df('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd7df('0x9'));var querystring=require('querystring');var Papa=require(_0xd7df('0xd'));var authService=require(_0xd7df('0xe'));var hardwareService=require(_0xd7df('0xf'));var Redis=require(_0xd7df('0x10'));var qs=require(_0xd7df('0x11'));var logger=require(_0xd7df('0x12'))(_0xd7df('0x13'));var utils=require(_0xd7df('0x14'));var config=require(_0xd7df('0x15'));var db=require(_0xd7df('0x16'))['db'];var jayson=require(_0xd7df('0x17'));var client=jayson[_0xd7df('0x18')][_0xd7df('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2b8f53,_0x3158ca,_0x53b59f,_0x177743){return new BPromise(function(_0x471f5e,_0x4216ed){var _0xa6936d=_0x177743||client;return _0xa6936d[_0xd7df('0x1a')](_0x2b8f53,_0x53b59f)['then'](function(_0x491c52){logger[_0xd7df('0x1b')](_0xd7df('0x1c'),_0x3158ca,_0xd7df('0x1d'));logger[_0xd7df('0x1e')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3158ca,'request\x20sent',JSON['stringify'](_0x491c52));if(_0x491c52[_0xd7df('0x1f')]){if(_0x491c52[_0xd7df('0x1f')][_0xd7df('0x20')]===0x1f4){logger[_0xd7df('0x1f')]('Trunk,\x20%s,\x20%s',_0x3158ca,_0x491c52['error']['message']);return _0x4216ed(_0x491c52[_0xd7df('0x1f')][_0xd7df('0x21')]);}logger[_0xd7df('0x1f')](_0xd7df('0x1c'),_0x3158ca,_0x491c52[_0xd7df('0x1f')][_0xd7df('0x21')]);return _0x471f5e(_0x491c52[_0xd7df('0x1f')]['message']);}else{logger[_0xd7df('0x1b')](_0xd7df('0x1c'),_0x3158ca,'request\x20sent');_0x471f5e(_0x491c52[_0xd7df('0x22')][_0xd7df('0x21')]);}})[_0xd7df('0x23')](function(_0x1968ec){logger[_0xd7df('0x1f')](_0xd7df('0x1c'),_0x3158ca,_0x1968ec);_0x4216ed(_0x1968ec);});});}function respondWithStatusCode(_0x17515c,_0x22fba2){_0x22fba2=_0x22fba2||0xcc;return function(_0xea016d){if(_0xea016d){return _0x17515c[_0xd7df('0x24')](_0x22fba2);}return _0x17515c[_0xd7df('0x25')](_0x22fba2)[_0xd7df('0x26')]();};}function respondWithResult(_0x5e0762,_0x31e0a7){_0x31e0a7=_0x31e0a7||0xc8;return function(_0x334533){if(_0x334533){return _0x5e0762[_0xd7df('0x25')](_0x31e0a7)['json'](_0x334533);}};}function respondWithFilteredResult(_0x34d8a3,_0x3cb38a){return function(_0x28d2e1){if(_0x28d2e1){var _0x480f75=_0x28d2e1[_0xd7df('0x27')],_0x45bdd3=_0x3cb38a[_0xd7df('0x28')],_0x3c85fc=_0x3cb38a[_0xd7df('0x28')]+_0x3cb38a[_0xd7df('0x29')],_0xfdfdea;if(_0x3c85fc>=_0x480f75){_0x3c85fc=_0x480f75;_0xfdfdea=0xc8;}else{_0xfdfdea=0xce;}_0x34d8a3[_0xd7df('0x25')](_0xfdfdea);return _0x34d8a3[_0xd7df('0x2a')]('Content-Range',_0x45bdd3+'-'+_0x3c85fc+'/'+_0x480f75)[_0xd7df('0x2b')](_0x28d2e1);}return null;};}function patchUpdates(_0x24cef9){return function(_0x43ba16){try{jsonpatch[_0xd7df('0x2c')](_0x43ba16,_0x24cef9,!![]);}catch(_0x353cf8){return BPromise[_0xd7df('0x2d')](_0x353cf8);}return _0x43ba16[_0xd7df('0x2e')]();};}function saveUpdates(_0x18d347,_0x3da1e0){return function(_0x3ca004){if(_0x3ca004){return _0x3ca004[_0xd7df('0x2f')](_0x18d347)['then'](function(_0x1839a3){return _0x1839a3;});}return null;};}function removeEntity(_0x50e9ce,_0xc74139){return function(_0x275ca7){if(_0x275ca7){return _0x275ca7[_0xd7df('0x30')]()[_0xd7df('0x31')](function(){var _0x4f39ee=_0x275ca7[_0xd7df('0x32')]({'plain':!![]});var _0x10c6e3=_0xd7df('0x33');return db[_0xd7df('0x34')][_0xd7df('0x30')]({'where':{'type':_0x10c6e3,'resourceId':_0x4f39ee['id']}})[_0xd7df('0x31')](function(){return _0x275ca7;});})[_0xd7df('0x31')](function(){_0x50e9ce[_0xd7df('0x25')](0xcc)[_0xd7df('0x26')]();});}};}function handleEntityNotFound(_0x4959ac,_0x51ea2f){return function(_0x26ca5f){if(!_0x26ca5f){_0x4959ac[_0xd7df('0x24')](0x194);}return _0x26ca5f;};}function handleError(_0x5d6780,_0x5c6757){_0x5c6757=_0x5c6757||0x1f4;return function(_0x5590b7){logger[_0xd7df('0x1f')](_0x5590b7[_0xd7df('0x35')]);if(_0x5590b7[_0xd7df('0x36')]){delete _0x5590b7[_0xd7df('0x36')];}_0x5d6780[_0xd7df('0x25')](_0x5c6757)[_0xd7df('0x37')](_0x5590b7);};}exports[_0xd7df('0x38')]=function(_0x59ba92,_0x19701f){var _0xc383eb={},_0x5ac42c={},_0x5e0e12={'count':0x0,'rows':[]};var _0x9f4954=db[_0xd7df('0x39')]['rawAttributes'];_0x5ac42c[_0xd7df('0x3a')]=_[_0xd7df('0x3b')](_0x9f4954);_0x5ac42c['query']=_['keys'](_0x59ba92[_0xd7df('0x3c')]);_0x5ac42c[_0xd7df('0x3d')]=_[_0xd7df('0x3e')](_0x5ac42c[_0xd7df('0x3a')],_0x5ac42c[_0xd7df('0x3c')]);_0xc383eb[_0xd7df('0x3f')]=_[_0xd7df('0x3e')](_0x5ac42c[_0xd7df('0x3a')],qs[_0xd7df('0x40')](_0x59ba92['query']['fields']));_0xc383eb[_0xd7df('0x3f')]=_0xc383eb['attributes'][_0xd7df('0x41')]?_0xc383eb[_0xd7df('0x3f')]:_0x5ac42c[_0xd7df('0x3a')];if(!_0x59ba92[_0xd7df('0x3c')][_0xd7df('0x42')](_0xd7df('0x43'))){_0xc383eb[_0xd7df('0x29')]=qs[_0xd7df('0x29')](_0x59ba92[_0xd7df('0x3c')][_0xd7df('0x29')]);_0xc383eb[_0xd7df('0x28')]=qs[_0xd7df('0x28')](_0x59ba92[_0xd7df('0x3c')][_0xd7df('0x28')]);}_0xc383eb[_0xd7df('0x44')]=qs[_0xd7df('0x45')](_0x59ba92[_0xd7df('0x3c')][_0xd7df('0x45')]);_0xc383eb[_0xd7df('0x46')]=qs[_0xd7df('0x3d')](_[_0xd7df('0x47')](_0x59ba92[_0xd7df('0x3c')],_0x5ac42c['filters']));if(_0x59ba92['query'][_0xd7df('0x48')]){_0xc383eb[_0xd7df('0x46')]=_[_0xd7df('0x49')](_0xc383eb[_0xd7df('0x46')],{'$or':_[_0xd7df('0x4a')](_0x9f4954,function(_0x24c3f3){if(_0x24c3f3[_0xd7df('0x4b')][_0xd7df('0x4c')]!==_0xd7df('0x4d')){var _0x452a52={};_0x452a52[_0x24c3f3[_0xd7df('0x4e')]]={'$like':'%'+_0x59ba92['query'][_0xd7df('0x48')]+'%'};return _0x452a52;}})});}_0xc383eb=_[_0xd7df('0x49')]({},_0xc383eb,_0x59ba92[_0xd7df('0x4f')]);var _0x5985ad={'where':_0xc383eb[_0xd7df('0x46')]};return db[_0xd7df('0x39')][_0xd7df('0x27')](_0x5985ad)[_0xd7df('0x31')](function(_0x54ed04){_0x5e0e12[_0xd7df('0x27')]=_0x54ed04;if(_0x59ba92['query'][_0xd7df('0x50')]){_0xc383eb['include']=[{'all':!![]}];}return db[_0xd7df('0x39')][_0xd7df('0x51')](_0xc383eb);})[_0xd7df('0x31')](function(_0x2239b5){_0x5e0e12[_0xd7df('0x52')]=_0x2239b5;return _0x5e0e12;})[_0xd7df('0x31')](respondWithFilteredResult(_0x19701f,_0xc383eb))['catch'](handleError(_0x19701f,null));};exports[_0xd7df('0x53')]=function(_0xf16290,_0x2bb47d){var _0xe2abef={'raw':![],'where':{'id':_0xf16290['params']['id']}},_0x19aaa4={};_0x19aaa4[_0xd7df('0x3a')]=_[_0xd7df('0x3b')](db[_0xd7df('0x39')]['rawAttributes']);_0x19aaa4[_0xd7df('0x3c')]=_[_0xd7df('0x3b')](_0xf16290[_0xd7df('0x3c')]);_0x19aaa4['filters']=_['intersection'](_0x19aaa4['model'],_0x19aaa4['query']);_0xe2abef[_0xd7df('0x3f')]=_[_0xd7df('0x3e')](_0x19aaa4[_0xd7df('0x3a')],qs[_0xd7df('0x40')](_0xf16290[_0xd7df('0x3c')][_0xd7df('0x40')]));_0xe2abef[_0xd7df('0x3f')]=_0xe2abef['attributes'][_0xd7df('0x41')]?_0xe2abef[_0xd7df('0x3f')]:_0x19aaa4[_0xd7df('0x3a')];if(_0xf16290['query'][_0xd7df('0x50')]){_0xe2abef[_0xd7df('0x54')]=[{'all':!![]}];}_0xe2abef=_[_0xd7df('0x49')]({},_0xe2abef,_0xf16290['options']);return db[_0xd7df('0x39')][_0xd7df('0x55')](_0xe2abef)[_0xd7df('0x31')](handleEntityNotFound(_0x2bb47d,null))[_0xd7df('0x31')](respondWithResult(_0x2bb47d,null))['catch'](handleError(_0x2bb47d,null));};exports[_0xd7df('0x56')]=function(_0x338739,_0x46914f){var _0x40ec51={'raw':![],'where':{'id':_0x338739[_0xd7df('0x57')]['id']}},_0x43564b={};_0x43564b[_0xd7df('0x3a')]=_['keys'](db[_0xd7df('0x39')][_0xd7df('0x58')]);_0x40ec51[_0xd7df('0x3f')]=_[_0xd7df('0x3e')](_0x43564b[_0xd7df('0x3a')],qs[_0xd7df('0x40')](_0x338739[_0xd7df('0x3c')][_0xd7df('0x40')]));_0x40ec51[_0xd7df('0x3f')]=_0x40ec51[_0xd7df('0x3f')]['length']?_0x40ec51[_0xd7df('0x3f')]:_0x43564b[_0xd7df('0x3a')];if(_0x338739[_0xd7df('0x3c')]['includeAll']){_0x40ec51[_0xd7df('0x54')]=[{'all':!![]}];}_0x40ec51=_[_0xd7df('0x49')]({},_0x40ec51,_0x338739[_0xd7df('0x4f')]);return db[_0xd7df('0x39')][_0xd7df('0x55')](_0x40ec51)['then'](handleEntityNotFound(_0x46914f,null))['then'](function(_0x479b53){if(_0x479b53){var _0x6ac9dd=_0x479b53['get']({'plain':!![]});_0x6ac9dd=qs[_0xd7df('0x59')](_0x6ac9dd,['id',_0xd7df('0x5a'),_0xd7df('0x5b')]);_0x338739[_0xd7df('0x5c')]=_[_0xd7df('0x59')](_0x338739['body'],['id','createdAt',_0xd7df('0x5b')]);return db[_0xd7df('0x39')][_0xd7df('0x5d')](_[_0xd7df('0x49')](_0x6ac9dd,_0x338739[_0xd7df('0x5c')]),{'include':_0x338739[_0xd7df('0x3c')][_0xd7df('0x50')]?[{'all':!![]}]:undefined})[_0xd7df('0x31')](function(_0x46d489){var _0x47eccc=_0x338739[_0xd7df('0x5e')][_0xd7df('0x32')]({'plain':!![]});if(!_0x47eccc)throw new Error(_0xd7df('0x5f'));if(_0x47eccc[_0xd7df('0x60')]==='user'){var _0x349e6c=_0x46d489[_0xd7df('0x32')]({'plain':!![]});var _0x25dae9=_0xd7df('0x33');return db[_0xd7df('0x61')]['find']({'where':{'name':_0x25dae9,'userProfileId':_0x47eccc[_0xd7df('0x62')]},'raw':!![]})[_0xd7df('0x31')](function(_0x558076){if(_0x558076&&_0x558076[_0xd7df('0x63')]===0x0){return db[_0xd7df('0x34')]['create']({'name':_0x349e6c[_0xd7df('0x36')],'resourceId':_0x349e6c['id'],'type':_0x558076[_0xd7df('0x36')],'sectionId':_0x558076['id']},{})['then'](function(){return _0x46d489;});}else{return _0x46d489;}})[_0xd7df('0x23')](function(_0x20950f){logger[_0xd7df('0x1f')](_0xd7df('0x64'),_0x20950f);throw _0x20950f;});}return _0x46d489;});}})[_0xd7df('0x31')](respondWithResult(_0x46914f,0xc9))['catch'](handleError(_0x46914f,null));};exports[_0xd7df('0x5d')]=function(_0x4a4ebe,_0x107bba,_0x3ebf4c){var _0x5a226c;return db[_0xd7df('0x39')][_0xd7df('0x5d')](_0x4a4ebe[_0xd7df('0x5c')],{'raw':!![]})[_0xd7df('0x31')](function(_0x5781aa){_0x5a226c=_0x5781aa;return db['Trunk'][_0xd7df('0x51')]({'raw':!![]});})[_0xd7df('0x31')](function(_0x2120fa){var _0x5c1742=fs[_0xd7df('0x65')](path[_0xd7df('0x66')](config[_0xd7df('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x13d800=fs[_0xd7df('0x65')](path['join'](config[_0xd7df('0x67')],_0xd7df('0x68')),'utf8');var _0x5f0aa1=ejs['render'](_0x5c1742,{'trunks':_0x2120fa||[]});fs[_0xd7df('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5f0aa1);if(_0x5a226c[_0xd7df('0x6a')]){var _0xb98d1d=ejs[_0xd7df('0x6b')](_0x13d800,{'trunks':_0x2120fa||[]});fs[_0xd7df('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0xb98d1d);}})[_0xd7df('0x31')](function(){return respondWithRpcPromise(_0xd7df('0x6c'),_0xd7df('0x5d'),{'module':_0xd7df('0x6d')});})[_0xd7df('0x31')](function(){var _0x15e834=_0x4a4ebe[_0xd7df('0x5e')]['get']({'plain':!![]});if(!_0x15e834)throw new Error(_0xd7df('0x5f'));if(_0x15e834[_0xd7df('0x60')]===_0xd7df('0x5e')){var _0x13e280=_0x5a226c[_0xd7df('0x32')]({'plain':!![]});return db[_0xd7df('0x61')][_0xd7df('0x55')]({'where':{'name':_0xd7df('0x33'),'userProfileId':_0x15e834[_0xd7df('0x62')]},'raw':!![]})[_0xd7df('0x31')](function(_0x520e9d){if(_0x520e9d&&_0x520e9d[_0xd7df('0x63')]===0x0){return db['UserProfileResource'][_0xd7df('0x5d')]({'name':_0x13e280[_0xd7df('0x36')],'resourceId':_0x13e280['id'],'type':_0x520e9d[_0xd7df('0x36')],'sectionId':_0x520e9d['id']},{})['then'](function(){return _0x5a226c;});}else{return _0x5a226c;}})['catch'](function(_0x18f9e8){logger['error'](_0xd7df('0x64'),_0x18f9e8);throw _0x18f9e8;});}return _0x5a226c;})['then'](respondWithResult(_0x107bba,0xc9))['catch'](handleError(_0x107bba,null));};exports[_0xd7df('0x2f')]=function(_0x5d4282,_0x2c0991,_0x30372d){var _0x56c610;return db[_0xd7df('0x39')][_0xd7df('0x55')]({'where':{'id':_0x5d4282[_0xd7df('0x57')]['id']}})[_0xd7df('0x31')](handleEntityNotFound(_0x2c0991,null))['then'](saveUpdates(_0x5d4282[_0xd7df('0x5c')],null))[_0xd7df('0x31')](function(_0x558f4e){if(_0x558f4e){_0x56c610=_0x558f4e;return db[_0xd7df('0x39')]['findAll']({'raw':!![]});}})['then'](function(_0x22287d){if(_0x22287d){var _0x2b0be0=fs[_0xd7df('0x65')](path['join'](config['root'],_0xd7df('0x6e')),'utf8');var _0x16df58=fs['readFileSync'](path['join'](config['root'],_0xd7df('0x68')),_0xd7df('0x6f'));var _0x2b3231=ejs[_0xd7df('0x6b')](_0x2b0be0,{'trunks':_0x22287d||[]});fs[_0xd7df('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x2b3231);var _0x34dff7=ejs['render'](_0x16df58,{'trunks':_0x22287d||[]});fs[_0xd7df('0x69')](_0xd7df('0x70'),_0x34dff7);return respondWithRpcPromise(_0xd7df('0x6c'),'update',{'module':'chan_sip.so'});}return null;})[_0xd7df('0x31')](function(_0x3336c7){if(_0x3336c7){return _0x56c610;}})['then'](respondWithResult(_0x2c0991,null))['catch'](handleError(_0x2c0991,null));};exports['destroy']=function(_0x1025fe,_0x3e09f0,_0x3ed773){var _0x22a26b;return db[_0xd7df('0x39')][_0xd7df('0x55')]({'where':{'id':_0x1025fe[_0xd7df('0x57')]['id']}})['then'](handleEntityNotFound(_0x3e09f0,null))[_0xd7df('0x31')](removeEntity(_0x3e09f0,null))['then'](function(){return db[_0xd7df('0x39')][_0xd7df('0x51')]({'raw':!![]});})[_0xd7df('0x31')](function(_0x1ae671){var _0x9ac802=fs[_0xd7df('0x65')](path[_0xd7df('0x66')](config[_0xd7df('0x67')],_0xd7df('0x6e')),_0xd7df('0x6f'));var _0x163578=fs[_0xd7df('0x65')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xd7df('0x6f'));var _0x5de56f=ejs[_0xd7df('0x6b')](_0x9ac802,{'trunks':_0x1ae671});var _0x4f2a54=ejs[_0xd7df('0x6b')](_0x163578,{'trunks':_0x1ae671});fs[_0xd7df('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5de56f);fs[_0xd7df('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x4f2a54);return respondWithRpcPromise(_0xd7df('0x6c'),_0xd7df('0x30'),{'module':_0xd7df('0x6d')});})[_0xd7df('0x23')](handleError(_0x3e09f0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 0733ba6..dac6be7 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 _0x3992=['api','moment','bluebird','request-promise','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger'];(function(_0x41af74,_0x3707cc){var _0x17f66d=function(_0x41c554){while(--_0x41c554){_0x41af74['push'](_0x41af74['shift']());}};_0x17f66d(++_0x3707cc);}(_0x3992,0xef));var _0x2399=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x3992[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x2399('0x0'));var util=require(_0x2399('0x1'));var logger=require(_0x2399('0x2'))(_0x2399('0x3'));var moment=require(_0x2399('0x4'));var BPromise=require(_0x2399('0x5'));var rp=require(_0x2399('0x6'));var attributes=require('./trunk.attributes');module[_0x2399('0x7')]=function(_0x4bb284,_0x5b13e5){return _0x4bb284[_0x2399('0x8')](_0x2399('0x9'),attributes,{'tableName':_0x2399('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f08=['./trunk.attributes','exports','define','tools_trunks','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x3f08,0x109));var _0x83f0=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x3f08[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x83f0('0x0'));var util=require('util');var logger=require(_0x83f0('0x1'))(_0x83f0('0x2'));var moment=require('moment');var BPromise=require(_0x83f0('0x3'));var rp=require(_0x83f0('0x4'));var attributes=require(_0x83f0('0x5'));module[_0x83f0('0x6')]=function(_0x3d42bb,_0x4e7be5){return _0x3d42bb[_0x83f0('0x7')]('Trunk',attributes,{'tableName':_0x83f0('0x8'),'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 2ed9a24..fa477f9 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 _0x1091=['client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTrunk','Trunk','findAll','options','raw','limit','include','map','model','attributes','then','stringify','ShowTrunk','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1df806,_0x12df9b){var _0x7a0c81=function(_0x3ffe1b){while(--_0x3ffe1b){_0x1df806['push'](_0x1df806['shift']());}};_0x7a0c81(++_0x12df9b);}(_0x1091,0x19b));var _0x1109=function(_0x38b551,_0x272fbd){_0x38b551=_0x38b551-0x0;var _0x2ee2e6=_0x1091[_0x38b551];return _0x2ee2e6;};'use strict';var _=require('lodash');var util=require(_0x1109('0x0'));var moment=require('moment');var BPromise=require(_0x1109('0x1'));var rs=require(_0x1109('0x2'));var fs=require('fs');var Redis=require(_0x1109('0x3'));var db=require(_0x1109('0x4'))['db'];var utils=require(_0x1109('0x5'));var logger=require(_0x1109('0x6'))(_0x1109('0x7'));var config=require('../../config/environment');var jayson=require(_0x1109('0x8'));var client=jayson[_0x1109('0x9')][_0x1109('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32d603,_0x1bc912,_0x431206){return new BPromise(function(_0x1f7b27,_0x3fd852){return client[_0x1109('0xb')](_0x32d603,_0x431206)['then'](function(_0x2a0a70){logger[_0x1109('0xc')](_0x1109('0xd'),_0x1bc912,_0x1109('0xe'));logger[_0x1109('0xf')](_0x1109('0x10'),_0x1bc912,_0x1109('0xe'),JSON['stringify'](_0x2a0a70));if(_0x2a0a70[_0x1109('0x11')]){if(_0x2a0a70[_0x1109('0x11')][_0x1109('0x12')]===0x1f4){logger[_0x1109('0x11')](_0x1109('0xd'),_0x1bc912,_0x2a0a70[_0x1109('0x11')][_0x1109('0x13')]);return _0x3fd852(_0x2a0a70[_0x1109('0x11')]['message']);}logger[_0x1109('0x11')](_0x1109('0xd'),_0x1bc912,_0x2a0a70[_0x1109('0x11')][_0x1109('0x13')]);return _0x1f7b27(_0x2a0a70['error'][_0x1109('0x13')]);}else{logger[_0x1109('0xc')](_0x1109('0xd'),_0x1bc912,_0x1109('0xe'));_0x1f7b27(_0x2a0a70['result'][_0x1109('0x13')]);}})[_0x1109('0x14')](function(_0x552a37){logger['error'](_0x1109('0xd'),_0x1bc912,_0x552a37);_0x3fd852(_0x552a37);});});}exports[_0x1109('0x15')]=function(_0x17c79a){var _0x1b1d25=this;return new Promise(function(_0x50b5a0,_0x243033){return db[_0x1109('0x16')][_0x1109('0x17')]({'raw':_0x17c79a[_0x1109('0x18')]?_0x17c79a['options'][_0x1109('0x19')]===undefined?!![]:![]:!![],'where':_0x17c79a['options']?_0x17c79a[_0x1109('0x18')]['where']||null:null,'attributes':_0x17c79a[_0x1109('0x18')]?_0x17c79a[_0x1109('0x18')]['attributes']||null:null,'limit':_0x17c79a[_0x1109('0x18')]?_0x17c79a['options'][_0x1109('0x1a')]||null:null,'include':_0x17c79a[_0x1109('0x18')]?_0x17c79a[_0x1109('0x18')][_0x1109('0x1b')]?_[_0x1109('0x1c')](_0x17c79a['options'][_0x1109('0x1b')],function(_0x4b127e){return{'model':db[_0x4b127e[_0x1109('0x1d')]],'as':_0x4b127e['as'],'attributes':_0x4b127e[_0x1109('0x1e')],'include':_0x4b127e[_0x1109('0x1b')]?_[_0x1109('0x1c')](_0x4b127e[_0x1109('0x1b')],function(_0x300163){return{'model':db[_0x300163[_0x1109('0x1d')]],'as':_0x300163['as'],'attributes':_0x300163[_0x1109('0x1e')],'include':_0x300163[_0x1109('0x1b')]?_['map'](_0x300163[_0x1109('0x1b')],function(_0x3dbada){return{'model':db[_0x3dbada[_0x1109('0x1d')]],'as':_0x3dbada['as'],'attributes':_0x3dbada[_0x1109('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1109('0x1f')](function(_0x22c752){logger['info'](_0x1109('0x15'),_0x17c79a);logger[_0x1109('0xf')](_0x1109('0x15'),_0x17c79a,JSON[_0x1109('0x20')](_0x22c752));_0x50b5a0(_0x22c752);})[_0x1109('0x14')](function(_0x4ece39){logger[_0x1109('0x11')](_0x1109('0x15'),_0x4ece39['message'],_0x17c79a);_0x243033(_0x1b1d25[_0x1109('0x11')](0x1f4,_0x4ece39[_0x1109('0x13')]));});});};exports[_0x1109('0x21')]=function(_0x3152ee){var _0x29d830=this;return new Promise(function(_0x721197,_0x5c2f38){return db[_0x1109('0x16')][_0x1109('0x22')]({'raw':_0x3152ee['options']?_0x3152ee['options'][_0x1109('0x19')]===undefined?!![]:![]:!![],'where':_0x3152ee[_0x1109('0x18')]?_0x3152ee[_0x1109('0x18')]['where']||null:null,'attributes':_0x3152ee[_0x1109('0x18')]?_0x3152ee[_0x1109('0x18')]['attributes']||null:null,'include':_0x3152ee['options']?_0x3152ee[_0x1109('0x18')][_0x1109('0x1b')]?_[_0x1109('0x1c')](_0x3152ee[_0x1109('0x18')][_0x1109('0x1b')],function(_0x28d62){return{'model':db[_0x28d62[_0x1109('0x1d')]],'as':_0x28d62['as'],'attributes':_0x28d62[_0x1109('0x1e')],'include':_0x28d62[_0x1109('0x1b')]?_['map'](_0x28d62['include'],function(_0xc3da37){return{'model':db[_0xc3da37[_0x1109('0x1d')]],'as':_0xc3da37['as'],'attributes':_0xc3da37[_0x1109('0x1e')],'include':_0xc3da37[_0x1109('0x1b')]?_[_0x1109('0x1c')](_0xc3da37[_0x1109('0x1b')],function(_0x2c95b8){return{'model':db[_0x2c95b8['model']],'as':_0x2c95b8['as'],'attributes':_0x2c95b8[_0x1109('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1109('0x1f')](function(_0x358efa){logger[_0x1109('0xc')](_0x1109('0x21'),_0x3152ee);logger[_0x1109('0xf')](_0x1109('0x21'),_0x3152ee,JSON['stringify'](_0x358efa));_0x721197(_0x358efa);})['catch'](function(_0x3e93c1){logger[_0x1109('0x11')](_0x1109('0x21'),_0x3e93c1[_0x1109('0x13')],_0x3152ee);_0x5c2f38(_0x29d830[_0x1109('0x11')](0x1f4,_0x3e93c1[_0x1109('0x13')]));});});}; \ No newline at end of file +var _0xb1d6=['include','model','map','GetTrunk','stringify','ShowTrunk','find','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Trunk','options','attributes'];(function(_0x503a94,_0x4f225a){var _0x80a002=function(_0x108911){while(--_0x108911){_0x503a94['push'](_0x503a94['shift']());}};_0x80a002(++_0x4f225a);}(_0xb1d6,0x19b));var _0x6b1d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb1d6[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x6b1d('0x0'));var util=require(_0x6b1d('0x1'));var moment=require('moment');var BPromise=require(_0x6b1d('0x2'));var rs=require(_0x6b1d('0x3'));var fs=require('fs');var Redis=require(_0x6b1d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b1d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6b1d('0x6'));var jayson=require(_0x6b1d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b4a53,_0x511738,_0x33125d){return new BPromise(function(_0x451130,_0x583334){return client[_0x6b1d('0x8')](_0x2b4a53,_0x33125d)[_0x6b1d('0x9')](function(_0x25a4d9){logger[_0x6b1d('0xa')](_0x6b1d('0xb'),_0x511738,_0x6b1d('0xc'));logger[_0x6b1d('0xd')](_0x6b1d('0xe'),_0x511738,_0x6b1d('0xc'),JSON['stringify'](_0x25a4d9));if(_0x25a4d9[_0x6b1d('0xf')]){if(_0x25a4d9['error'][_0x6b1d('0x10')]===0x1f4){logger[_0x6b1d('0xf')](_0x6b1d('0xb'),_0x511738,_0x25a4d9['error'][_0x6b1d('0x11')]);return _0x583334(_0x25a4d9[_0x6b1d('0xf')][_0x6b1d('0x11')]);}logger[_0x6b1d('0xf')](_0x6b1d('0xb'),_0x511738,_0x25a4d9[_0x6b1d('0xf')]['message']);return _0x451130(_0x25a4d9[_0x6b1d('0xf')][_0x6b1d('0x11')]);}else{logger[_0x6b1d('0xa')](_0x6b1d('0xb'),_0x511738,_0x6b1d('0xc'));_0x451130(_0x25a4d9[_0x6b1d('0x12')][_0x6b1d('0x11')]);}})[_0x6b1d('0x13')](function(_0x24c2c4){logger[_0x6b1d('0xf')]('Trunk,\x20%s,\x20%s',_0x511738,_0x24c2c4);_0x583334(_0x24c2c4);});});}exports['GetTrunk']=function(_0x464db7){var _0xd1b9b=this;return new Promise(function(_0x4e4591,_0x26ab1d){return db[_0x6b1d('0x14')]['findAll']({'raw':_0x464db7[_0x6b1d('0x15')]?_0x464db7[_0x6b1d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x464db7[_0x6b1d('0x15')]?_0x464db7[_0x6b1d('0x15')]['where']||null:null,'attributes':_0x464db7[_0x6b1d('0x15')]?_0x464db7[_0x6b1d('0x15')][_0x6b1d('0x16')]||null:null,'limit':_0x464db7['options']?_0x464db7[_0x6b1d('0x15')]['limit']||null:null,'include':_0x464db7[_0x6b1d('0x15')]?_0x464db7[_0x6b1d('0x15')][_0x6b1d('0x17')]?_['map'](_0x464db7[_0x6b1d('0x15')]['include'],function(_0x5cdc73){return{'model':db[_0x5cdc73[_0x6b1d('0x18')]],'as':_0x5cdc73['as'],'attributes':_0x5cdc73[_0x6b1d('0x16')],'include':_0x5cdc73['include']?_['map'](_0x5cdc73[_0x6b1d('0x17')],function(_0x2900ec){return{'model':db[_0x2900ec[_0x6b1d('0x18')]],'as':_0x2900ec['as'],'attributes':_0x2900ec['attributes'],'include':_0x2900ec[_0x6b1d('0x17')]?_[_0x6b1d('0x19')](_0x2900ec[_0x6b1d('0x17')],function(_0x2ac0be){return{'model':db[_0x2ac0be[_0x6b1d('0x18')]],'as':_0x2ac0be['as'],'attributes':_0x2ac0be[_0x6b1d('0x16')]};}):[]};}):[]};}):[]:[]})[_0x6b1d('0x9')](function(_0x468401){logger[_0x6b1d('0xa')](_0x6b1d('0x1a'),_0x464db7);logger[_0x6b1d('0xd')](_0x6b1d('0x1a'),_0x464db7,JSON[_0x6b1d('0x1b')](_0x468401));_0x4e4591(_0x468401);})[_0x6b1d('0x13')](function(_0x72f869){logger[_0x6b1d('0xf')](_0x6b1d('0x1a'),_0x72f869[_0x6b1d('0x11')],_0x464db7);_0x26ab1d(_0xd1b9b[_0x6b1d('0xf')](0x1f4,_0x72f869[_0x6b1d('0x11')]));});});};exports[_0x6b1d('0x1c')]=function(_0x123f18){var _0x5192e4=this;return new Promise(function(_0x4b674f,_0x559aa3){return db['Trunk'][_0x6b1d('0x1d')]({'raw':_0x123f18['options']?_0x123f18['options']['raw']===undefined?!![]:![]:!![],'where':_0x123f18[_0x6b1d('0x15')]?_0x123f18[_0x6b1d('0x15')][_0x6b1d('0x1e')]||null:null,'attributes':_0x123f18[_0x6b1d('0x15')]?_0x123f18[_0x6b1d('0x15')]['attributes']||null:null,'include':_0x123f18['options']?_0x123f18[_0x6b1d('0x15')][_0x6b1d('0x17')]?_[_0x6b1d('0x19')](_0x123f18[_0x6b1d('0x15')]['include'],function(_0x414afa){return{'model':db[_0x414afa[_0x6b1d('0x18')]],'as':_0x414afa['as'],'attributes':_0x414afa['attributes'],'include':_0x414afa[_0x6b1d('0x17')]?_['map'](_0x414afa[_0x6b1d('0x17')],function(_0x3f56ae){return{'model':db[_0x3f56ae['model']],'as':_0x3f56ae['as'],'attributes':_0x3f56ae[_0x6b1d('0x16')],'include':_0x3f56ae[_0x6b1d('0x17')]?_[_0x6b1d('0x19')](_0x3f56ae[_0x6b1d('0x17')],function(_0x58184d){return{'model':db[_0x58184d[_0x6b1d('0x18')]],'as':_0x58184d['as'],'attributes':_0x58184d['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b1d('0x9')](function(_0x15ced0){logger[_0x6b1d('0xa')](_0x6b1d('0x1c'),_0x123f18);logger[_0x6b1d('0xd')](_0x6b1d('0x1c'),_0x123f18,JSON[_0x6b1d('0x1b')](_0x15ced0));_0x4b674f(_0x15ced0);})[_0x6b1d('0x13')](function(_0xd0dff1){logger[_0x6b1d('0xf')](_0x6b1d('0x1c'),_0xd0dff1[_0x6b1d('0x11')],_0x123f18);_0x559aa3(_0x5192e4['error'](0x1f4,_0xd0dff1[_0x6b1d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index e9ef102..93a39ab 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 _0x6516=['addChatWebsites','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','getVoiceQueuesRt','/:id/groups','/:id/recordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getScheduledCalls','/:id/api_key','getApiKey','bulkCreate','post','addContacts','create','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts'];(function(_0x145e84,_0x124991){var _0x52d753=function(_0x2492d4){while(--_0x2492d4){_0x145e84['push'](_0x145e84['shift']());}};_0x52d753(++_0x124991);}(_0x6516,0x156));var _0x6651=function(_0x103110,_0x9a30ea){_0x103110=_0x103110-0x0;var _0x59d228=_0x6516[_0x103110];return _0x59d228;};'use strict';var multer=require(_0x6651('0x0'));var util=require(_0x6651('0x1'));var path=require(_0x6651('0x2'));var timeout=require(_0x6651('0x3'));var express=require('express');var router=express[_0x6651('0x4')]();var auth=require(_0x6651('0x5'));var interaction=require(_0x6651('0x6'));var config=require(_0x6651('0x7'));var controller=require(_0x6651('0x8'));router[_0x6651('0x9')]('/',auth[_0x6651('0xa')](),controller[_0x6651('0xb')]);router[_0x6651('0x9')](_0x6651('0xc'),auth[_0x6651('0xa')](),controller[_0x6651('0xd')]);router[_0x6651('0x9')](_0x6651('0xe'),auth[_0x6651('0xa')](),controller[_0x6651('0xf')]);router['get'](_0x6651('0x10'),controller[_0x6651('0x11')]);router[_0x6651('0x9')](_0x6651('0x12'),auth[_0x6651('0xa')](),controller[_0x6651('0x13')]);router[_0x6651('0x9')]('/:id/queues',auth[_0x6651('0xa')](),controller['getQueues']);router['get']('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x6651('0x14')]);router[_0x6651('0x9')](_0x6651('0x15'),auth[_0x6651('0xa')](),controller['getGroups']);router[_0x6651('0x9')](_0x6651('0x16'),auth[_0x6651('0xa')](),controller['getRecordings']);router['get']('/:id/chat/interactions',auth[_0x6651('0xa')](),controller[_0x6651('0x17')]);router[_0x6651('0x9')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x6651('0x18')]);router[_0x6651('0x9')](_0x6651('0x19'),auth['isAuthenticated'](),controller[_0x6651('0x1a')]);router['get']('/:id/sms/interactions',auth[_0x6651('0xa')](),controller[_0x6651('0x1b')]);router[_0x6651('0x9')](_0x6651('0x1c'),auth[_0x6651('0xa')](),controller[_0x6651('0x1d')]);router['get'](_0x6651('0x1e'),auth['isAuthenticated'](),controller['getTeams']);router[_0x6651('0x9')](_0x6651('0x1f'),auth[_0x6651('0xa')](),controller[_0x6651('0x20')]);router[_0x6651('0x9')](_0x6651('0x21'),auth[_0x6651('0xa')](),controller[_0x6651('0x22')]);router[_0x6651('0x9')](_0x6651('0x23'),auth['isAuthenticated'](),controller[_0x6651('0x24')]);router[_0x6651('0x9')](_0x6651('0x25'),auth[_0x6651('0xa')](),controller[_0x6651('0x26')]);router[_0x6651('0x9')](_0x6651('0x27'),auth[_0x6651('0xa')](),controller[_0x6651('0x28')]);router['get'](_0x6651('0x29'),auth[_0x6651('0xa')](),controller[_0x6651('0x2a')]);router[_0x6651('0x9')](_0x6651('0x2b'),auth[_0x6651('0xa')](),controller[_0x6651('0x2c')]);router[_0x6651('0x9')](_0x6651('0x2d'),auth['isAuthenticated'](),controller[_0x6651('0x2e')]);router[_0x6651('0x9')](_0x6651('0x2f'),auth[_0x6651('0xa')](),controller['getSquareProjects']);router[_0x6651('0x9')]('/:id/scheduled_calls',auth[_0x6651('0xa')](),controller[_0x6651('0x30')]);router[_0x6651('0x9')](_0x6651('0x31'),auth[_0x6651('0xa')](),controller[_0x6651('0x32')]);router['post']('/create_many',auth[_0x6651('0xa')](),controller[_0x6651('0x33')]);router[_0x6651('0x34')]('/:id/contacts',auth[_0x6651('0xa')](),controller[_0x6651('0x35')]);router['post']('/',auth[_0x6651('0xa')](),controller[_0x6651('0x36')]);router[_0x6651('0x34')](_0x6651('0x37'),auth[_0x6651('0xa')](),controller[_0x6651('0x38')]);var upload=multer({'storage':multer[_0x6651('0x39')]({'destination':function(_0x71745b,_0x423268,_0xfe13d4){_0xfe13d4(null,path[_0x6651('0x3a')](config[_0x6651('0x3b')],_0x6651('0x3c')));},'filename':function(_0x2f8925,_0x5aa4f6,_0x3fee34){_0x3fee34(null,util[_0x6651('0x3d')](_0x6651('0x3e'),Date[_0x6651('0x3f')](),_0x5aa4f6[_0x6651('0x40')]));}})});router[_0x6651('0x34')]('/:id/avatar',upload[_0x6651('0x41')](_0x6651('0x42')),controller[_0x6651('0x43')]);router[_0x6651('0x34')](_0x6651('0x44'),auth['isAuthenticated'](),controller[_0x6651('0x45')]);router['post'](_0x6651('0x46'),auth['isAuthenticated'](),controller['logout']);router['post']('/:id/pause',auth[_0x6651('0xa')](),controller['pause']);router[_0x6651('0x34')](_0x6651('0x47'),auth[_0x6651('0xa')](),controller[_0x6651('0x48')]);router[_0x6651('0x34')](_0x6651('0x1e'),auth[_0x6651('0xa')](),controller['addTeams']);router['post'](_0x6651('0x49'),auth[_0x6651('0xa')](),controller[_0x6651('0x4a')]);router[_0x6651('0x34')](_0x6651('0x4b'),auth[_0x6651('0xa')](),controller[_0x6651('0x4c')]);router[_0x6651('0x34')](_0x6651('0x4d'),auth[_0x6651('0xa')](),controller[_0x6651('0x4e')]);router['post']('/:id/sms_interactions',auth[_0x6651('0xa')](),controller[_0x6651('0x4f')]);router[_0x6651('0x34')](_0x6651('0x50'),auth[_0x6651('0xa')](),controller[_0x6651('0x51')]);router[_0x6651('0x34')]('/:id/fax_accounts',auth[_0x6651('0xa')](),controller[_0x6651('0x52')]);router[_0x6651('0x34')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x6651('0x53')]);router[_0x6651('0x34')](_0x6651('0x29'),auth[_0x6651('0xa')](),controller[_0x6651('0x54')]);router['post'](_0x6651('0x2b'),auth[_0x6651('0xa')](),controller[_0x6651('0x55')]);router['post']('/:id/chat_websites',auth[_0x6651('0xa')](),controller[_0x6651('0x56')]);router[_0x6651('0x34')](_0x6651('0x2f'),auth[_0x6651('0xa')](),controller[_0x6651('0x57')]);router[_0x6651('0x34')]('/:id/api_key',auth[_0x6651('0xa')](),controller[_0x6651('0x58')]);router[_0x6651('0x59')](_0x6651('0xe'),auth[_0x6651('0xa')](),controller[_0x6651('0x5a')]);router[_0x6651('0x59')](_0x6651('0x5b'),auth['isAuthenticated'](),controller[_0x6651('0x5c')]);router[_0x6651('0x5d')](_0x6651('0x37'),auth[_0x6651('0xa')](),controller[_0x6651('0x5e')]);router[_0x6651('0x5d')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6651('0x5f')]);router[_0x6651('0x5d')](_0x6651('0xe'),auth[_0x6651('0xa')](),controller['destroy']);router['delete'](_0x6651('0x49'),auth[_0x6651('0xa')](),controller[_0x6651('0x60')]);router[_0x6651('0x5d')](_0x6651('0x4b'),auth[_0x6651('0xa')](),controller[_0x6651('0x61')]);router[_0x6651('0x5d')](_0x6651('0x4d'),auth[_0x6651('0xa')](),controller[_0x6651('0x62')]);router['delete']('/:id/sms_interactions',auth[_0x6651('0xa')](),controller['removeSmsInteractions']);router[_0x6651('0x5d')](_0x6651('0x50'),auth[_0x6651('0xa')](),controller[_0x6651('0x63')]);router[_0x6651('0x5d')](_0x6651('0x25'),auth[_0x6651('0xa')](),controller[_0x6651('0x64')]);router[_0x6651('0x5d')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x6651('0x65')]);router[_0x6651('0x5d')](_0x6651('0x29'),auth[_0x6651('0xa')](),controller[_0x6651('0x66')]);router[_0x6651('0x5d')](_0x6651('0x2b'),auth[_0x6651('0xa')](),controller['removeSmsAccounts']);router['delete'](_0x6651('0x2d'),auth[_0x6651('0xa')](),controller[_0x6651('0x67')]);router['delete']('/:id/square_projects',auth['isAuthenticated'](),controller[_0x6651('0x68')]);router[_0x6651('0x5d')](_0x6651('0x31'),auth['isAuthenticated'](),controller[_0x6651('0x69')]);module[_0x6651('0x6a')]=router; \ No newline at end of file +var _0xfaf6=['/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','/create_many','bulkCreate','post','create','addQueues','diskStorage','join','root','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addOpenchannelInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./user.controller','index','get','isAuthenticated','describe','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','/:id/fax/interactions','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects'];(function(_0x3350f2,_0x149aa7){var _0xc9493a=function(_0x251d25){while(--_0x251d25){_0x3350f2['push'](_0x3350f2['shift']());}};_0xc9493a(++_0x149aa7);}(_0xfaf6,0x111));var _0x6faf=function(_0x5e22cf,_0x81a4c8){_0x5e22cf=_0x5e22cf-0x0;var _0x5bc61b=_0xfaf6[_0x5e22cf];return _0x5bc61b;};'use strict';var multer=require(_0x6faf('0x0'));var util=require(_0x6faf('0x1'));var path=require('path');var timeout=require(_0x6faf('0x2'));var express=require(_0x6faf('0x3'));var router=express[_0x6faf('0x4')]();var auth=require(_0x6faf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6faf('0x6'));var controller=require(_0x6faf('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6faf('0x8')]);router[_0x6faf('0x9')]('/describe',auth[_0x6faf('0xa')](),controller[_0x6faf('0xb')]);router[_0x6faf('0x9')](_0x6faf('0xc'),auth['isAuthenticated'](),controller[_0x6faf('0xd')]);router[_0x6faf('0x9')](_0x6faf('0xe'),controller[_0x6faf('0xf')]);router[_0x6faf('0x9')](_0x6faf('0x10'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x11')]);router[_0x6faf('0x9')](_0x6faf('0x12'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x13')]);router[_0x6faf('0x9')](_0x6faf('0x14'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x15')]);router[_0x6faf('0x9')]('/:id/groups',auth[_0x6faf('0xa')](),controller[_0x6faf('0x16')]);router[_0x6faf('0x9')](_0x6faf('0x17'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x18')]);router[_0x6faf('0x9')](_0x6faf('0x19'),auth['isAuthenticated'](),controller[_0x6faf('0x1a')]);router[_0x6faf('0x9')](_0x6faf('0x1b'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x1c')]);router[_0x6faf('0x9')](_0x6faf('0x1d'),auth[_0x6faf('0xa')](),controller['getMailInteractions']);router[_0x6faf('0x9')]('/:id/sms/interactions',auth[_0x6faf('0xa')](),controller[_0x6faf('0x1e')]);router[_0x6faf('0x9')](_0x6faf('0x1f'),auth[_0x6faf('0xa')](),controller['getFaxInteractions']);router[_0x6faf('0x9')]('/:id/teams',auth[_0x6faf('0xa')](),controller[_0x6faf('0x20')]);router['get'](_0x6faf('0x21'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x22')]);router[_0x6faf('0x9')](_0x6faf('0x23'),auth[_0x6faf('0xa')](),controller['getAgents']);router['get'](_0x6faf('0x24'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x25')]);router[_0x6faf('0x9')](_0x6faf('0x26'),auth[_0x6faf('0xa')](),controller['getFaxAccounts']);router[_0x6faf('0x9')](_0x6faf('0x27'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x28')]);router[_0x6faf('0x9')](_0x6faf('0x29'),auth['isAuthenticated'](),controller[_0x6faf('0x2a')]);router[_0x6faf('0x9')](_0x6faf('0x2b'),auth[_0x6faf('0xa')](),controller['getSmsAccounts']);router['get'](_0x6faf('0x2c'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x2d')]);router['get'](_0x6faf('0x2e'),auth['isAuthenticated'](),controller[_0x6faf('0x2f')]);router[_0x6faf('0x9')](_0x6faf('0x30'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x31')]);router[_0x6faf('0x9')](_0x6faf('0x32'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x33')]);router['post'](_0x6faf('0x34'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x35')]);router[_0x6faf('0x36')]('/:id/contacts',auth[_0x6faf('0xa')](),controller['addContacts']);router[_0x6faf('0x36')]('/',auth['isAuthenticated'](),controller[_0x6faf('0x37')]);router[_0x6faf('0x36')](_0x6faf('0x12'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x38')]);var upload=multer({'storage':multer[_0x6faf('0x39')]({'destination':function(_0x56ff64,_0x105c35,_0x54ceb3){_0x54ceb3(null,path[_0x6faf('0x3a')](config[_0x6faf('0x3b')],'server/files/images/'));},'filename':function(_0x2a73f1,_0x12d039,_0x2a8dd5){_0x2a8dd5(null,util['format'](_0x6faf('0x3c'),Date[_0x6faf('0x3d')](),_0x12d039[_0x6faf('0x3e')]));}})});router['post'](_0x6faf('0xe'),upload[_0x6faf('0x3f')](_0x6faf('0x40')),controller[_0x6faf('0x41')]);router['post'](_0x6faf('0x42'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x43')]);router['post']('/:id/logout',auth['isAuthenticated'](),controller[_0x6faf('0x44')]);router['post'](_0x6faf('0x45'),auth['isAuthenticated'](),controller[_0x6faf('0x46')]);router[_0x6faf('0x36')](_0x6faf('0x47'),auth[_0x6faf('0xa')](),controller['unpause']);router['post'](_0x6faf('0x48'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x49')]);router['post'](_0x6faf('0x4a'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x4b')]);router[_0x6faf('0x36')](_0x6faf('0x4c'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x4d')]);router[_0x6faf('0x36')]('/:id/fax_interactions',auth[_0x6faf('0xa')](),controller[_0x6faf('0x4e')]);router[_0x6faf('0x36')]('/:id/sms_interactions',auth[_0x6faf('0xa')](),controller['addSmsInteractions']);router['post']('/:id/openchannel_interactions',auth[_0x6faf('0xa')](),controller[_0x6faf('0x4f')]);router[_0x6faf('0x36')](_0x6faf('0x26'),auth[_0x6faf('0xa')](),controller['addFaxAccounts']);router[_0x6faf('0x36')](_0x6faf('0x27'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x50')]);router[_0x6faf('0x36')](_0x6faf('0x29'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x51')]);router[_0x6faf('0x36')](_0x6faf('0x2b'),auth['isAuthenticated'](),controller[_0x6faf('0x52')]);router[_0x6faf('0x36')](_0x6faf('0x2c'),auth['isAuthenticated'](),controller[_0x6faf('0x53')]);router[_0x6faf('0x36')](_0x6faf('0x2e'),auth['isAuthenticated'](),controller['addSquareProjects']);router[_0x6faf('0x36')](_0x6faf('0x32'),auth['isAuthenticated'](),controller[_0x6faf('0x54')]);router[_0x6faf('0x55')]('/:id',auth[_0x6faf('0xa')](),controller[_0x6faf('0x56')]);router[_0x6faf('0x55')](_0x6faf('0x57'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x58')]);router[_0x6faf('0x59')]('/:id/queues',auth['isAuthenticated'](),controller[_0x6faf('0x5a')]);router[_0x6faf('0x59')](_0x6faf('0x48'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x5b')]);router[_0x6faf('0x59')](_0x6faf('0xc'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x5c')]);router['delete'](_0x6faf('0x4a'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x5d')]);router[_0x6faf('0x59')](_0x6faf('0x4c'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x6faf('0x59')](_0x6faf('0x5e'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x5f')]);router['delete'](_0x6faf('0x60'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x61')]);router[_0x6faf('0x59')](_0x6faf('0x62'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x63')]);router[_0x6faf('0x59')](_0x6faf('0x26'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x64')]);router[_0x6faf('0x59')]('/:id/mail_accounts',auth[_0x6faf('0xa')](),controller[_0x6faf('0x65')]);router[_0x6faf('0x59')](_0x6faf('0x29'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x6faf('0x59')]('/:id/sms_accounts',auth[_0x6faf('0xa')](),controller[_0x6faf('0x66')]);router[_0x6faf('0x59')](_0x6faf('0x2c'),auth['isAuthenticated'](),controller[_0x6faf('0x67')]);router[_0x6faf('0x59')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x6faf('0x68')]);router['delete']('/:id/api_key',auth[_0x6faf('0xa')](),controller[_0x6faf('0x69')]);module[_0x6faf('0x6a')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index f15fa30..68c3aec 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 _0x4d14=['PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','update','outgoing','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','internal','email','toLowerCase','ENUM','user','agent','telephone','local','INTEGER','format','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED'];(function(_0x3db724,_0x2f0426){var _0x17b55a=function(_0x2d45c0){while(--_0x2d45c0){_0x3db724['push'](_0x3db724['shift']());}};_0x17b55a(++_0x2f0426);}(_0x4d14,0x1d7));var _0x44d1=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x4d14[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0x44d1('0x0'));var moment=require(_0x44d1('0x1'));var util=require(_0x44d1('0x2'));var _=require(_0x44d1('0x3'));module[_0x44d1('0x4')]={'name':{'type':Sequelize[_0x44d1('0x5')],'allowNull':![],'unique':_0x44d1('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e0651){this[_0x44d1('0x7')]('name',_0x3e0651);this[_0x44d1('0x7')]('defaultuser',_0x3e0651);},'comment':_0x44d1('0x8')},'fullname':{'type':Sequelize[_0x44d1('0x5')],'allowNull':![],'set':function(_0x708d4e){this[_0x44d1('0x7')](_0x44d1('0x9'),_0x708d4e);this[_0x44d1('0x7')](_0x44d1('0xa'),util['format']('\x22%s\x22\x20<%s>',_0x708d4e,this['getDataValue'](_0x44d1('0xb'))));}},'alias':{'type':Sequelize[_0x44d1('0x5')]},'email':{'type':Sequelize[_0x44d1('0x5')],'allowNull':![],'unique':_0x44d1('0xc'),'validate':{'isEmail':!![]},'set':function(_0x43c4e2){if(_0x43c4e2){this[_0x44d1('0x7')](_0x44d1('0xc'),_0x43c4e2[_0x44d1('0xd')]());}}},'role':{'type':Sequelize[_0x44d1('0xe')]('admin',_0x44d1('0xf'),_0x44d1('0x10'),_0x44d1('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x44d1('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x44d1('0x12')},'internal':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':![],'unique':_0x44d1('0xb'),'set':function(_0x1727d5){this['setDataValue'](_0x44d1('0xb'),_0x1727d5);this['setDataValue']('accountcode',_0x1727d5);this[_0x44d1('0x7')]('callerid',util[_0x44d1('0x14')](_0x44d1('0x15'),this['getDataValue'](_0x44d1('0x9')),_0x1727d5));}},'salt':{'type':Sequelize[_0x44d1('0x5')]},'phone':{'type':Sequelize[_0x44d1('0x5')]},'mobile':{'type':Sequelize[_0x44d1('0x5')]},'address':{'type':Sequelize[_0x44d1('0x5')]},'zipcode':{'type':Sequelize[_0x44d1('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x44d1('0x17')]},'voicePause':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x44d1('0x5')],'defaultValue':_0x44d1('0x18')},'lastPauseAt':{'type':Sequelize[_0x44d1('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x44d1('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x44d1('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x44d1('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x44d1('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x44d1('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![],'defaultValue':_0x44d1('0x19')},'ipaddr':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x44d1('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x44d1('0xe')]('friend','user',_0x44d1('0x1a')),'allowNull':!![],'defaultValue':_0x44d1('0x1b')},'context':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![],'defaultValue':_0x44d1('0x1c')},'callingpres':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x1d'),_0x44d1('0x1e'),_0x44d1('0x1f'),_0x44d1('0x20'),_0x44d1('0x21'),'PROHIB_PASSED_SCREEN',_0x44d1('0x22'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![],'defaultValue':_0x44d1('0x23'),'set':function(_0x442b12){this[_0x44d1('0x7')]('transport',_0x442b12?_0x442b12['join'](','):null);},'get':function(){return this[_0x44d1('0x24')](_0x44d1('0x25'))?this['getDataValue'](_0x44d1('0x25'))[_0x44d1('0x26')](','):null;},'comment':_0x44d1('0x27')},'dtmfmode':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x28'),_0x44d1('0x29'),_0x44d1('0x2a'),'inband',_0x44d1('0x2b')),'allowNull':!![],'defaultValue':_0x44d1('0x28')},'directmedia':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no',_0x44d1('0x2d'),_0x44d1('0x2e'),_0x44d1('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x44b211){this['setDataValue'](_0x44d1('0x30'),_0x44b211?_0x44b211[_0x44d1('0x31')](','):null);},'get':function(){return this['getDataValue'](_0x44d1('0x30'))?this['getDataValue']('nat')[_0x44d1('0x26')](','):null;},'comment':_0x44d1('0x32')},'callgroup':{'type':Sequelize[_0x44d1('0x5')]},'namedcallgroup':{'type':Sequelize[_0x44d1('0x5')]},'pickupgroup':{'type':Sequelize[_0x44d1('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x44d1('0x5')]},'language':{'type':Sequelize[_0x44d1('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x44d1('0x5')]},'disallow':{'type':Sequelize[_0x44d1('0x5')],'allowNull':![],'defaultValue':_0x44d1('0x33')},'allow':{'type':Sequelize[_0x44d1('0x5')],'allowNull':![],'defaultValue':_0x44d1('0x34'),'set':function(_0x5d9da4){this[_0x44d1('0x7')](_0x44d1('0x35'),_0x5d9da4?_0x5d9da4[_0x44d1('0x31')](';'):_0x44d1('0x34'));},'get':function(){return this[_0x44d1('0x24')]('allow')?this[_0x44d1('0x24')](_0x44d1('0x35'))[_0x44d1('0x26')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x44d1('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![],'set':function(_0x18d274){this[_0x44d1('0x7')](_0x44d1('0x36'),_0x18d274?_0x18d274[_0x44d1('0x31')](','):null);},'get':function(){return this[_0x44d1('0x24')](_0x44d1('0x36'))?this['getDataValue'](_0x44d1('0x36'))[_0x44d1('0x26')](','):null;},'comment':_0x44d1('0x37')},'trustrpid':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x44d1('0xe')]('yes','no',_0x44d1('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x44d1('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![],'defaultValue':_0x44d1('0x39')},'amaflags':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x44d1('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0x44d1('0x2c')},'busylevel':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x44d1('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x44d1('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x3b'),_0x44d1('0x3c'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x3d'),_0x44d1('0x3e')),'allowNull':!![],'defaultValue':_0x44d1('0x3e')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x44d1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x44d1('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x44d1('0xe')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x44d1('0xe')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x44d1('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x44d1('0x2c'),'no',_0x44d1('0x3f'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x44d1('0xe')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x44d1('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x44d1('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x44d1('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no','nonat','update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x44d1('0x17')]},'showWebBar':{'type':Sequelize[_0x44d1('0x13')],'defaultValue':0x0,'set':function(_0x5bac74){this[_0x44d1('0x7')](_0x44d1('0x40'),_0x5bac74);var _0x157c25=this[_0x44d1('0x41')]({'plain':!![]});switch(_0x5bac74){case 0x0:case 0x1:var _0x323170=_0x157c25[_0x44d1('0x25')]?_[_0x44d1('0x42')](_0x157c25['transport'])?_0x157c25[_0x44d1('0x25')][_0x44d1('0x31')]():_0x157c25[_0x44d1('0x25')]:'udp';if(_0x323170===_0x44d1('0x43')){_0x323170='udp';}this[_0x44d1('0x7')](_0x44d1('0x25'),_0x323170);this[_0x44d1('0x7')](_0x44d1('0x44'),'no');this[_0x44d1('0x7')](_0x44d1('0x45'),null);this['setDataValue'](_0x44d1('0x46'),null);this[_0x44d1('0x7')](_0x44d1('0x47'),null);this[_0x44d1('0x7')](_0x44d1('0x48'),null);this[_0x44d1('0x7')](_0x44d1('0x49'),null);this['setDataValue'](_0x44d1('0x4a'),null);this[_0x44d1('0x7')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this['setDataValue'](_0x44d1('0x4b'),'no');break;case 0x2:this[_0x44d1('0x7')]('transport',_0x44d1('0x43'));this[_0x44d1('0x7')](_0x44d1('0x44'),_0x44d1('0x2c'));this['setDataValue'](_0x44d1('0x45'),'yes');this[_0x44d1('0x7')](_0x44d1('0x46'),_0x44d1('0x2c'));this[_0x44d1('0x7')]('icesupport','yes');this[_0x44d1('0x7')](_0x44d1('0x48'),_0x44d1('0x2c'));this[_0x44d1('0x7')](_0x44d1('0x49'),'no');this[_0x44d1('0x7')](_0x44d1('0x4a'),_0x44d1('0x4c'));this[_0x44d1('0x7')](_0x44d1('0x4d'),_0x157c25[_0x44d1('0x4d')]||_0x44d1('0x4e'));this[_0x44d1('0x7')](_0x44d1('0x4f'),_0x157c25[_0x44d1('0x4f')]||_0x44d1('0x50'));this[_0x44d1('0x7')]('rtcp_mux',_0x44d1('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0x44d1('0x51')],'set':function(_0x220986){this[_0x44d1('0x7')](_0x44d1('0x52'),_0x220986?_0x220986[_0x44d1('0x31')](','):[]);},'get':function(){return this['getDataValue'](_0x44d1('0x52'))?_[_0x44d1('0x53')](this['getDataValue'](_0x44d1('0x52'))['split'](','),function(_0x527adf){return parseInt(_0x527adf,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x44d1('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x44d1('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x44d1('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x44d1('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x44d1('0xe')](_0x44d1('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x44d1('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x44d1('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x44d1('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x44d1('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xa45c=['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]','all','ulaw;alaw;gsm','allow','split','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<>','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlsenable','dtlscertfile','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','map','permissions','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','admin','user','agent','local','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','ENUM','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','rfc2833'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0xa45c,0x171));var _0xca45=function(_0x47d39e,_0x653eb2){_0x47d39e=_0x47d39e-0x0;var _0x5b2260=_0xa45c[_0x47d39e];return _0x5b2260;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var _=require(_0xca45('0x2'));module['exports']={'name':{'type':Sequelize[_0xca45('0x3')],'allowNull':![],'unique':_0xca45('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3de0ca){this[_0xca45('0x5')](_0xca45('0x4'),_0x3de0ca);this[_0xca45('0x5')](_0xca45('0x6'),_0x3de0ca);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xca45('0x3')],'allowNull':![],'set':function(_0x333e00){this[_0xca45('0x5')](_0xca45('0x7'),_0x333e00);this[_0xca45('0x5')](_0xca45('0x8'),util[_0xca45('0x9')](_0xca45('0xa'),_0x333e00,this[_0xca45('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xca45('0x3')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x17c30c){if(_0x17c30c){this[_0xca45('0x5')]('email',_0x17c30c['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0xca45('0xc'),_0xca45('0xd'),_0xca45('0xe'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xca45('0x3')],'defaultValue':_0xca45('0xf')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xca45('0x10'),'set':function(_0x84b167){this[_0xca45('0x5')](_0xca45('0x10'),_0x84b167);this[_0xca45('0x5')](_0xca45('0x11'),_0x84b167);this[_0xca45('0x5')](_0xca45('0x8'),util['format'](_0xca45('0xa'),this[_0xca45('0xb')](_0xca45('0x7')),_0x84b167));}},'salt':{'type':Sequelize[_0xca45('0x3')]},'phone':{'type':Sequelize[_0xca45('0x3')]},'mobile':{'type':Sequelize[_0xca45('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xca45('0x3')]},'userpic':{'type':Sequelize[_0xca45('0x3')]},'city':{'type':Sequelize[_0xca45('0x3')]},'country':{'type':Sequelize[_0xca45('0x3')]},'online':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xca45('0x13')]},'voicePause':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xca45('0x3')],'defaultValue':_0xca45('0x14')},'lastPauseAt':{'type':Sequelize[_0xca45('0x13')]},'chatCapacity':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xca45('0x16')},'ipaddr':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xca45('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x18'),_0xca45('0xd'),'peer'),'allowNull':!![],'defaultValue':_0xca45('0x18')},'context':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x19'),_0xca45('0x1a'),_0xca45('0x1b'),_0xca45('0x1c'),_0xca45('0x1d'),_0xca45('0x1e'),_0xca45('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xca45('0x20'),'set':function(_0xd41111){this[_0xca45('0x5')](_0xca45('0x21'),_0xd41111?_0xd41111[_0xca45('0x22')](','):null);},'get':function(){return this[_0xca45('0xb')](_0xca45('0x21'))?this[_0xca45('0xb')](_0xca45('0x21'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x23'),'info','shortinfo',_0xca45('0x24'),_0xca45('0x25')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no',_0xca45('0x27'),_0xca45('0x28'),_0xca45('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![],'defaultValue':_0xca45('0x2a'),'set':function(_0x7c5eb6){this[_0xca45('0x5')](_0xca45('0x2b'),_0x7c5eb6?_0x7c5eb6[_0xca45('0x22')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xca45('0xb')](_0xca45('0x2b'))['split'](','):null;},'comment':_0xca45('0x2c')},'callgroup':{'type':Sequelize[_0xca45('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xca45('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xca45('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xca45('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca45('0x2d')},'allow':{'type':Sequelize[_0xca45('0x3')],'allowNull':![],'defaultValue':_0xca45('0x2e'),'set':function(_0x4f6973){this[_0xca45('0x5')](_0xca45('0x2f'),_0x4f6973?_0x4f6973['join'](';'):_0xca45('0x2e'));},'get':function(){return this[_0xca45('0xb')]('allow')?this[_0xca45('0xb')](_0xca45('0x2f'))[_0xca45('0x30')](';'):null;},'comment':_0xca45('0x31')},'autoframing':{'type':Sequelize['ENUM'](_0xca45('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![],'set':function(_0x26ee3b){this[_0xca45('0x5')](_0xca45('0x32'),_0x26ee3b?_0x26ee3b['join'](','):null);},'get':function(){return this[_0xca45('0xb')](_0xca45('0x32'))?this['getDataValue'](_0xca45('0x32'))[_0xca45('0x30')](','):null;},'comment':_0xca45('0x33')},'trustrpid':{'type':Sequelize['ENUM'](_0xca45('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xca45('0x17')]('yes','no',_0xca45('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xca45('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xca45('0x35')},'amaflags':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xca45('0x26'),'no'),'allowNull':!![],'defaultValue':_0xca45('0x26')},'busylevel':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xca45('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xca45('0x36'),_0xca45('0x37'),_0xca45('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xca45('0x39'),_0xca45('0x3a')),'allowNull':!![],'defaultValue':_0xca45('0x3a')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![],'defaultValue':_0xca45('0x26')},'keepalive':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xca45('0x17')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xca45('0x17')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xca45('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xca45('0x17')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xca45('0x17')]('yes','no',_0xca45('0x3b'),_0xca45('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xca45('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xca45('0x17')]('active',_0xca45('0x3d'),_0xca45('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xca45('0x17')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xca45('0x17')](_0xca45('0x26'),'no','nonat',_0xca45('0x28'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xca45('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x0,'set':function(_0x4bbdea){this[_0xca45('0x5')](_0xca45('0x3f'),_0x4bbdea);var _0x2d991d=this[_0xca45('0x40')]({'plain':!![]});switch(_0x4bbdea){case 0x0:case 0x1:var _0x98a427=_0x2d991d[_0xca45('0x21')]?_[_0xca45('0x41')](_0x2d991d[_0xca45('0x21')])?_0x2d991d[_0xca45('0x21')][_0xca45('0x22')]():_0x2d991d[_0xca45('0x21')]:'udp';if(_0x98a427===_0xca45('0x42')){_0x98a427='udp';}this['setDataValue'](_0xca45('0x21'),_0x98a427);this[_0xca45('0x5')](_0xca45('0x43'),'no');this[_0xca45('0x5')](_0xca45('0x44'),null);this['setDataValue'](_0xca45('0x45'),null);this[_0xca45('0x5')](_0xca45('0x46'),null);this[_0xca45('0x5')]('dtlsenable',null);this['setDataValue'](_0xca45('0x47'),null);this['setDataValue'](_0xca45('0x48'),null);this[_0xca45('0x5')]('dtlscertfile',null);this[_0xca45('0x5')]('dtlsprivatekey',null);this[_0xca45('0x5')]('rtcp_mux','no');break;case 0x2:this[_0xca45('0x5')](_0xca45('0x21'),_0xca45('0x42'));this[_0xca45('0x5')](_0xca45('0x43'),'yes');this[_0xca45('0x5')](_0xca45('0x44'),'yes');this[_0xca45('0x5')](_0xca45('0x45'),_0xca45('0x26'));this['setDataValue']('icesupport',_0xca45('0x26'));this[_0xca45('0x5')](_0xca45('0x49'),_0xca45('0x26'));this[_0xca45('0x5')](_0xca45('0x47'),'no');this[_0xca45('0x5')]('dtlssetup','actpass');this[_0xca45('0x5')]('dtlscertfile',_0x2d991d[_0xca45('0x4a')]||'/etc/pki/tls/certs/motion.crt');this[_0xca45('0x5')](_0xca45('0x4b'),_0x2d991d[_0xca45('0x4b')]||_0xca45('0x4c'));this[_0xca45('0x5')](_0xca45('0x4d'),_0xca45('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xca45('0x4e')],'set':function(_0x1298fb){this[_0xca45('0x5')]('permissions',_0x1298fb?_0x1298fb[_0xca45('0x22')](','):[]);},'get':function(){return this[_0xca45('0xb')]('permissions')?_[_0xca45('0x4f')](this[_0xca45('0xb')](_0xca45('0x50'))[_0xca45('0x30')](','),function(_0x4d2420){return parseInt(_0x4d2420,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xca45('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xca45('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xca45('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xca45('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xca45('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xca45('0x17')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xca45('0x3')]},'passwordResetAt':{'type':Sequelize[_0xca45('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0xca45('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xca45('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xca45('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index ab23ddb..95ffb10 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 _0x6d6d=['user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$or','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','apiKeyNonce','apiKeyIat','removeApiKey','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','count','offset','limit','set','update','destroy','get','user','agent','Telephones','telephone','filter','ignore','map','value','includes','role','name','UserProfileResource','stack','index','User','rawAttributes','differenceBy','password','salt','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','where','col','field','lower','merge','options','includeAll','include','findAll','rows','catch','show','params','find','bulkCreate','body','describe','addContacts','ids','omit','agent\x20role','admin','../../config/license/util','getLicense','telephones','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','findById','max','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','voicemail','VoiceMail','fullname','email','permissions','101','110','104','105','106','107','109','100','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Sequelize','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','loginInPause','voicePause','interface','isValidChannel','channel','add','capitalize','penalty','spread','toLowerCase','QueueId','emit','voice','VoiceQueue','each','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','Queues','Queue:remove','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','findOne','CmContact','getContacts','Tag','tag','nolimit','Queue','pick','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','login','phone','mobile','intrf','SIP/%s','user:%s','user:forcelogout','x-forwarded-for','socket','remoteAddress','connection','getVoiceQueues','push','forEach','all','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','concat','YYYY-MM-DD\x20HH:mm:ss','logout','pause','QueuePause','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','lastPauseAt','mail','chat','sms','manual','Pause','getTeams','addTeams','removeTeams','getLists','CmList','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions'];(function(_0x17a5fd,_0x2ab66b){var _0x2567ae=function(_0x55951b){while(--_0x55951b){_0x17a5fd['push'](_0x17a5fd['shift']());}};_0x2567ae(++_0x2ab66b);}(_0x6d6d,0x170));var _0xd6d6=function(_0x2985fd,_0x2d0438){_0x2985fd=_0x2985fd-0x0;var _0x308971=_0x6d6d[_0x2985fd];return _0x308971;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd6d6('0x0'));var rimraf=require(_0xd6d6('0x1'));var zipdir=require(_0xd6d6('0x2'));var jsonpatch=require(_0xd6d6('0x3'));var rp=require('request-promise');var moment=require(_0xd6d6('0x4'));var BPromise=require(_0xd6d6('0x5'));var Mustache=require('mustache');var util=require(_0xd6d6('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd6d6('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd6d6('0x8'));var crypto=require(_0xd6d6('0x9'));var jsforce=require(_0xd6d6('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6d6('0xb'));var authService=require(_0xd6d6('0xc'));var hardwareService=require(_0xd6d6('0xd'));var Redis=require('ioredis');var qs=require(_0xd6d6('0xe'));var logger=require(_0xd6d6('0xf'))('api');var utils=require(_0xd6d6('0x10'));var config=require(_0xd6d6('0x11'));var db=require('../../mysqldb')['db'];config[_0xd6d6('0x12')]=_[_0xd6d6('0x13')](config['redis'],{'host':_0xd6d6('0x14'),'port':0x18eb});var socket=require(_0xd6d6('0x15'))(new Redis(config[_0xd6d6('0x12')]));require('./user.socket')[_0xd6d6('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd6d6('0x17')][_0xd6d6('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2bc3d3,_0x26865a,_0x2670d0,_0x27ac35){return new BPromise(function(_0x172eb1,_0x51e7e8){var _0x567f09=_0x27ac35||client;return _0x567f09[_0xd6d6('0x19')](_0x2bc3d3,_0x2670d0)[_0xd6d6('0x1a')](function(_0x256b49){logger[_0xd6d6('0x1b')](_0xd6d6('0x1c'),_0x26865a,_0xd6d6('0x1d'));logger['debug'](_0xd6d6('0x1e'),_0x26865a,'request\x20sent',JSON[_0xd6d6('0x1f')](_0x256b49));if(_0x256b49[_0xd6d6('0x20')]){if(_0x256b49[_0xd6d6('0x20')][_0xd6d6('0x21')]===0x1f4){logger[_0xd6d6('0x20')](_0xd6d6('0x1c'),_0x26865a,_0x256b49[_0xd6d6('0x20')]['message']);return _0x51e7e8(_0x256b49['error'][_0xd6d6('0x22')]);}logger[_0xd6d6('0x20')]('User,\x20%s,\x20%s',_0x26865a,_0x256b49[_0xd6d6('0x20')][_0xd6d6('0x22')]);return _0x172eb1(_0x256b49[_0xd6d6('0x20')][_0xd6d6('0x22')]);}else{logger[_0xd6d6('0x1b')](_0xd6d6('0x1c'),_0x26865a,_0xd6d6('0x1d'));_0x172eb1(_0x256b49[_0xd6d6('0x23')][_0xd6d6('0x22')]);}})['catch'](function(_0xa90f2b){logger[_0xd6d6('0x20')](_0xd6d6('0x1c'),_0x26865a,_0xa90f2b);_0x51e7e8(_0xa90f2b);});});}function respondWithStatusCode(_0x426d2f,_0x3bd1ff){_0x3bd1ff=_0x3bd1ff||0xcc;return function(_0x5c65a2){if(_0x5c65a2){return _0x426d2f['sendStatus'](_0x3bd1ff);}return _0x426d2f[_0xd6d6('0x24')](_0x3bd1ff)[_0xd6d6('0x25')]();};}function respondWithResult(_0x5c4cd7,_0x478ac3){_0x478ac3=_0x478ac3||0xc8;return function(_0x477b57){if(_0x477b57){return _0x5c4cd7[_0xd6d6('0x24')](_0x478ac3)[_0xd6d6('0x26')](_0x477b57);}};}function respondWithFilteredResult(_0x25a9b4,_0x6c23d9){return function(_0x3c327c){if(_0x3c327c){var _0x18d5f3=_0x3c327c[_0xd6d6('0x27')],_0x233a54=_0x6c23d9[_0xd6d6('0x28')],_0x54bb28=_0x6c23d9[_0xd6d6('0x28')]+_0x6c23d9[_0xd6d6('0x29')],_0x40664e;if(_0x54bb28>=_0x18d5f3){_0x54bb28=_0x18d5f3;_0x40664e=0xc8;}else{_0x40664e=0xce;}_0x25a9b4[_0xd6d6('0x24')](_0x40664e);return _0x25a9b4[_0xd6d6('0x2a')]('Content-Range',_0x233a54+'-'+_0x54bb28+'/'+_0x18d5f3)['json'](_0x3c327c);}return null;};}function patchUpdates(_0x181531){return function(_0x15f46e){try{jsonpatch['apply'](_0x15f46e,_0x181531,!![]);}catch(_0x259855){return BPromise['reject'](_0x259855);}return _0x15f46e['save']();};}function saveUpdates(_0x585a4e,_0x4db44b){return function(_0x550c30){if(_0x550c30){return _0x550c30[_0xd6d6('0x2b')](_0x585a4e)['then'](function(_0xcd9f94){return _0xcd9f94;});}return null;};}function removeEntity(_0x39e2aa,_0x4f8e2b){return function(_0x3c64fa){if(_0x3c64fa){return _0x3c64fa[_0xd6d6('0x2c')]()[_0xd6d6('0x1a')](function(){var _0x5b8829=_0x3c64fa[_0xd6d6('0x2d')]({'plain':!![]});var _0x33fdda=[{'name':'Users','value':_0xd6d6('0x2e'),'ignore':!![]},{'name':'Agents','value':_0xd6d6('0x2f'),'ignore':![]},{'name':_0xd6d6('0x30'),'value':_0xd6d6('0x31'),'ignore':![]}];var _0x51b524=_(_0x33fdda)[_0xd6d6('0x32')](_0xd6d6('0x33'))[_0xd6d6('0x34')](_0xd6d6('0x35'))[_0xd6d6('0x35')]();if(_[_0xd6d6('0x36')](_0x51b524,_0x5b8829[_0xd6d6('0x37')])){return;}var _0x1faf23=_['find'](_0x33fdda,[_0xd6d6('0x35'),_0x5b8829[_0xd6d6('0x37')]])[_0xd6d6('0x38')];return db[_0xd6d6('0x39')][_0xd6d6('0x2c')]({'where':{'type':_0x1faf23,'resourceId':_0x5b8829['id']}})[_0xd6d6('0x1a')](function(){return _0x3c64fa;});})[_0xd6d6('0x1a')](function(){_0x39e2aa[_0xd6d6('0x24')](0xcc)[_0xd6d6('0x25')]();});}};}function handleEntityNotFound(_0x5d09f3,_0x2b9ae1){return function(_0xd89978){if(!_0xd89978){_0x5d09f3['sendStatus'](0x194);}return _0xd89978;};}function handleError(_0x1e644e,_0x200574){_0x200574=_0x200574||0x1f4;return function(_0x41be3f){logger[_0xd6d6('0x20')](_0x41be3f[_0xd6d6('0x3a')]);if(_0x41be3f[_0xd6d6('0x38')]){delete _0x41be3f[_0xd6d6('0x38')];}_0x1e644e[_0xd6d6('0x24')](_0x200574)['send'](_0x41be3f);};}exports[_0xd6d6('0x3b')]=function(_0x5cd90d,_0x52071e){var _0x177052={},_0x4270ed={},_0xf5759e={'count':0x0,'rows':[]};var _0x1873f1=db[_0xd6d6('0x3c')][_0xd6d6('0x3d')];_0x4270ed['model']=_[_0xd6d6('0x3e')](_['keys'](_0x1873f1),[_0xd6d6('0x3f'),_0xd6d6('0x40')]);_0x4270ed[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0x5cd90d['query']);_0x4270ed['filters']=_[_0xd6d6('0x43')](_0x4270ed[_0xd6d6('0x44')],_0x4270ed['query']);_0x177052[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x4270ed['model'],qs[_0xd6d6('0x46')](_0x5cd90d[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0x177052[_0xd6d6('0x45')]=_0x177052[_0xd6d6('0x45')][_0xd6d6('0x47')]?_0x177052[_0xd6d6('0x45')]:_0x4270ed['model'];if(!_0x5cd90d[_0xd6d6('0x41')][_0xd6d6('0x48')]('nolimit')){_0x177052['limit']=qs[_0xd6d6('0x29')](_0x5cd90d[_0xd6d6('0x41')][_0xd6d6('0x29')]);_0x177052[_0xd6d6('0x28')]=qs['offset'](_0x5cd90d[_0xd6d6('0x41')][_0xd6d6('0x28')]);}_0x177052[_0xd6d6('0x49')]=qs[_0xd6d6('0x4a')](_0x5cd90d[_0xd6d6('0x41')]['sort']);_0x177052['where']=qs['filters'](_['pick'](_0x5cd90d[_0xd6d6('0x41')],_0x4270ed[_0xd6d6('0x4b')]));if(_0x5cd90d[_0xd6d6('0x41')]['filter']){_0x177052[_0xd6d6('0x4c')]=_['merge'](_0x177052['where'],{'$or':_[_0xd6d6('0x34')](_0x1873f1,function(_0x32c8df){return db['sequelize'][_0xd6d6('0x4c')](db['sequelize']['fn']('lower',db['sequelize'][_0xd6d6('0x4d')](_0x32c8df[_0xd6d6('0x4e')])),{'$like':db['sequelize']['fn'](_0xd6d6('0x4f'),'%'+_0x5cd90d[_0xd6d6('0x41')]['filter']+'%')});})});}_0x177052=_[_0xd6d6('0x50')]({},_0x177052,_0x5cd90d[_0xd6d6('0x51')]);var _0x3e123c={'where':_0x177052['where']};return db[_0xd6d6('0x3c')][_0xd6d6('0x27')](_0x3e123c)[_0xd6d6('0x1a')](function(_0x560f9f){_0xf5759e[_0xd6d6('0x27')]=_0x560f9f;if(_0x5cd90d[_0xd6d6('0x41')][_0xd6d6('0x52')]){_0x177052[_0xd6d6('0x53')]=[{'all':!![]}];}return db[_0xd6d6('0x3c')][_0xd6d6('0x54')](_0x177052);})[_0xd6d6('0x1a')](function(_0x2d0dfe){_0xf5759e[_0xd6d6('0x55')]=_0x2d0dfe;return _0xf5759e;})[_0xd6d6('0x1a')](respondWithFilteredResult(_0x52071e,_0x177052))[_0xd6d6('0x56')](handleError(_0x52071e,null));};exports[_0xd6d6('0x57')]=function(_0xb413e4,_0x2d5aec){var _0x14ee8c={'raw':![],'where':{'id':_0xb413e4[_0xd6d6('0x58')]['id']}},_0x4139df={};_0x4139df[_0xd6d6('0x44')]=_['differenceBy'](_[_0xd6d6('0x42')](db[_0xd6d6('0x3c')][_0xd6d6('0x3d')]),['password','salt']);_0x4139df['query']=_[_0xd6d6('0x42')](_0xb413e4['query']);_0x4139df[_0xd6d6('0x4b')]=_['intersection'](_0x4139df[_0xd6d6('0x44')],_0x4139df[_0xd6d6('0x41')]);_0x14ee8c[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x4139df[_0xd6d6('0x44')],qs[_0xd6d6('0x46')](_0xb413e4['query'][_0xd6d6('0x46')]));_0x14ee8c[_0xd6d6('0x45')]=_0x14ee8c['attributes'][_0xd6d6('0x47')]?_0x14ee8c[_0xd6d6('0x45')]:_0x4139df[_0xd6d6('0x44')];if(_0xb413e4['query'][_0xd6d6('0x52')]){_0x14ee8c['include']=[{'all':!![]}];}_0x14ee8c=_[_0xd6d6('0x50')]({},_0x14ee8c,_0xb413e4['options']);return db[_0xd6d6('0x3c')][_0xd6d6('0x59')](_0x14ee8c)['then'](handleEntityNotFound(_0x2d5aec,null))['then'](respondWithResult(_0x2d5aec,null))['catch'](handleError(_0x2d5aec,null));};exports[_0xd6d6('0x5a')]=function(_0x5ee5d7,_0x3b39b6){return db[_0xd6d6('0x3c')][_0xd6d6('0x5a')](_0x5ee5d7[_0xd6d6('0x5b')],{'raw':![],'individualHooks':!![]})[_0xd6d6('0x1a')](respondWithResult(_0x3b39b6,0xc9))['catch'](handleError(_0x3b39b6,null));};exports[_0xd6d6('0x2b')]=function(_0x871906,_0x1e32a9){if(_0x871906[_0xd6d6('0x5b')]['id']){delete _0x871906[_0xd6d6('0x5b')]['id'];}delete _0x871906['body'][_0xd6d6('0x37')];return db['User'][_0xd6d6('0x59')]({'where':{'id':_0x871906['params']['id']}})['then'](handleEntityNotFound(_0x1e32a9,null))['then'](saveUpdates(_0x871906[_0xd6d6('0x5b')],null))['then'](respondWithResult(_0x1e32a9,null))[_0xd6d6('0x56')](handleError(_0x1e32a9,null));};exports[_0xd6d6('0x5c')]=function(_0x4e5e18,_0x408aa1){return db['User'][_0xd6d6('0x5c')]()[_0xd6d6('0x1a')](respondWithResult(_0x408aa1,null))[_0xd6d6('0x56')](handleError(_0x408aa1,null));};exports[_0xd6d6('0x5d')]=function(_0x5f2bb4,_0x6f0212,_0x3080a6){return db[_0xd6d6('0x3c')]['find']({'where':{'id':_0x5f2bb4['params']['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x6f0212,null))[_0xd6d6('0x1a')](function(_0x28a080){if(_0x28a080){return _0x28a080[_0xd6d6('0x5d')](_0x5f2bb4[_0xd6d6('0x5b')][_0xd6d6('0x5e')],_[_0xd6d6('0x5f')](_0x5f2bb4[_0xd6d6('0x5b')],[_0xd6d6('0x5e'),'id'])||{});}})[_0xd6d6('0x1a')](respondWithResult(_0x6f0212,null))[_0xd6d6('0x56')](handleError(_0x6f0212,null));};var getLicense=function(_0x239063){return new BPromise(function(_0x58fa6e,_0x49096d){var _0x18eb0c=0x0;_0x239063['body'][_0xd6d6('0x37')]==='agent'&&_0x58fa6e(_0xd6d6('0x60'));return db[_0xd6d6('0x3c')][_0xd6d6('0x27')]({'where':{'$or':[{'role':_0x239063[_0xd6d6('0x5b')]['role']===_0xd6d6('0x31')?_0xd6d6('0x31'):[_0xd6d6('0x61'),'user']}]}})['then'](function(_0x482695){_0x18eb0c=_0x482695;return require(_0xd6d6('0x62'))[_0xd6d6('0x63')]();})[_0xd6d6('0x1a')](function(_0x3d1f0a){var _0x110c23=_0x239063[_0xd6d6('0x5b')]['role']===_0xd6d6('0x31')?_0xd6d6('0x64'):_0xd6d6('0x65');if(!_[_0xd6d6('0x66')](_0x3d1f0a[_0x110c23])&&_0x18eb0c>=_0x3d1f0a[_0x110c23]){return _0x49096d({'message':_0xd6d6('0x67')});}return _0x58fa6e(util[_0xd6d6('0x68')](_0xd6d6('0x69'),_0x110c23,_0x18eb0c));})[_0xd6d6('0x56')](function(_0x385dde){return _0x49096d(_0x385dde);});});};exports[_0xd6d6('0x6a')]=function(_0x447611,_0x44dcd5){return getLicense(_0x447611)[_0xd6d6('0x1a')](function(_0x44e9cd){if(!_0x447611['body'][_0xd6d6('0x6b')]){var _0x25f3eb;return db['Setting'][_0xd6d6('0x6c')](0x1)[_0xd6d6('0x1a')](function(_0x3864e9){_0x25f3eb=_0x3864e9['min_internal'];return db[_0xd6d6('0x3c')][_0xd6d6('0x6d')](_0xd6d6('0x6b'));})[_0xd6d6('0x1a')](function(_0x455755){if(_[_0xd6d6('0x66')](_0x455755)){if(_0x25f3eb){_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x6b')]=_0x25f3eb;}else{_0x447611[_0xd6d6('0x5b')]['internal']=0x1;}}else{if(_[_0xd6d6('0x66')](_0x25f3eb)||_0x25f3eb==_0x455755){_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x6b')]=_0x455755+0x1;}else if(_0x25f3eb>_0x455755){_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x6b')]=_0x25f3eb;}else{return db[_0xd6d6('0x6e')][_0xd6d6('0x41')](_0xd6d6('0x6f'),{'type':db[_0xd6d6('0x6e')][_0xd6d6('0x70')]['SELECT']})['then'](function(_0x6cd583){if(_0x6cd583&&_0x6cd583[_0xd6d6('0x47')]){for(var _0x29f3ea=0x0,_0x61a62e=_0x6cd583[_0xd6d6('0x47')];_0x29f3ea<_0x61a62e&&_[_0xd6d6('0x66')](_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x6b')]);_0x29f3ea++){if(_0x25f3eb<=_0x6cd583[_0x29f3ea]['from']){_0x447611[_0xd6d6('0x5b')]['internal']=_0x6cd583[_0x29f3ea][_0xd6d6('0x71')];}else if(_0x25f3eb>_0x6cd583[_0x29f3ea][_0xd6d6('0x71')]&&_0x25f3eb<=_0x6cd583[_0x29f3ea]['to']){_0x447611['body'][_0xd6d6('0x6b')]=_0x25f3eb;}}}if(_[_0xd6d6('0x66')](_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x6b')])){_0x447611[_0xd6d6('0x5b')]['internal']=_0x455755+0x1;}});}}});}})[_0xd6d6('0x1a')](function(){if(_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x72')]){_0x447611[_0xd6d6('0x5b')]['mailbox']=_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x6b')];_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x73')]={'mailbox':_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x6b')],'password':_0x447611['body'][_0xd6d6('0x3f')],'fullname':_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x74')],'email':_0x447611['body'][_0xd6d6('0x75')]};}if(_0x447611[_0xd6d6('0x5b')]&&_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x37')]===_0xd6d6('0x2f')){_0x447611[_0xd6d6('0x5b')][_0xd6d6('0x76')]=[_0xd6d6('0x77'),'102','103',_0xd6d6('0x78'),_0xd6d6('0x79'),_0xd6d6('0x7a'),_0xd6d6('0x7b'),_0xd6d6('0x7c'),'108',_0xd6d6('0x7d'),_0xd6d6('0x7e'),_0xd6d6('0x7f')];}return db[_0xd6d6('0x3c')][_0xd6d6('0x6a')](_0x447611['body'],{'include':[{'model':db['VoiceMail'],'as':_0xd6d6('0x73')}]});})[_0xd6d6('0x1a')](function(_0x26a9da){if(_0x447611['body']['role']===_0xd6d6('0x2e'))return _0x26a9da;var _0x107c55=_0x447611['user'][_0xd6d6('0x2d')]({'plain':!![]});if(!_0x107c55)throw new Error(_0xd6d6('0x80'));if(_0x107c55[_0xd6d6('0x37')]===_0xd6d6('0x2e')){var _0x3e586b=_0x26a9da['get']({'plain':!![]});var _0x1edc9b=[{'name':_0xd6d6('0x81'),'value':_0xd6d6('0x2f')},{'name':_0xd6d6('0x30'),'value':'telephone'}];var _0x417434=_[_0xd6d6('0x59')](_0x1edc9b,['value',_0x3e586b[_0xd6d6('0x37')]])[_0xd6d6('0x38')];return db['UserProfileSection'][_0xd6d6('0x59')]({'where':{'name':_0x417434,'userProfileId':_0x107c55['userProfileId']},'raw':!![]})['then'](function(_0x53d004){if(_0x53d004&&_0x53d004[_0xd6d6('0x82')]===0x0){return db['UserProfileResource'][_0xd6d6('0x6a')]({'name':_0x3e586b[_0xd6d6('0x38')],'resourceId':_0x3e586b['id'],'type':_0x53d004['name'],'sectionId':_0x53d004['id']},{})[_0xd6d6('0x1a')](function(){return _0x26a9da;});}else{return _0x26a9da;}})[_0xd6d6('0x56')](function(_0x2bca08){logger['error'](_0xd6d6('0x83'),_0x2bca08);throw _0x2bca08;});}return _0x26a9da;})[_0xd6d6('0x1a')](respondWithResult(_0x44dcd5,0xc9))[_0xd6d6('0x56')](handleError(_0x44dcd5,null));};exports[_0xd6d6('0x84')]=function(_0x80b6a5,_0x1b90f7,_0x39d1d9){if(_0x80b6a5[_0xd6d6('0x5b')]['id']){delete _0x80b6a5[_0xd6d6('0x5b')]['id'];}return db['User'][_0xd6d6('0x59')]({'where':{'id':_0x80b6a5['params']['id']}})[_0xd6d6('0x1a')](function(_0x3d0b8e){if(_0x3d0b8e){if(_0x3d0b8e['id']==_0x80b6a5[_0xd6d6('0x2e')]['id']){if(!_0x80b6a5[_0xd6d6('0x5b')][_0xd6d6('0x85')]||!_0x80b6a5[_0xd6d6('0x5b')][_0xd6d6('0x86')]){throw new db['Sequelize']['ValidationError'](_0xd6d6('0x87'));}if(!_0x3d0b8e[_0xd6d6('0x88')](_0x80b6a5[_0xd6d6('0x5b')][_0xd6d6('0x85')])){throw new db[(_0xd6d6('0x89'))][(_0xd6d6('0x8a'))]('Wrong\x20credentials');}if(_0x80b6a5[_0xd6d6('0x5b')][_0xd6d6('0x85')]==_0x80b6a5[_0xd6d6('0x5b')][_0xd6d6('0x86')]){throw new db[(_0xd6d6('0x89'))][(_0xd6d6('0x8a'))](_0xd6d6('0x8b'));}return _0x3d0b8e;}else if(_0x80b6a5[_0xd6d6('0x2e')][_0xd6d6('0x37')]==_0xd6d6('0x61')){if(!_0x80b6a5[_0xd6d6('0x5b')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0xd6d6('0x8c'));}return _0x3d0b8e;}else if(_0x80b6a5[_0xd6d6('0x2e')]['role']==_0xd6d6('0x2e')){if(!_0x80b6a5[_0xd6d6('0x5b')]['newPassword']){throw new db[(_0xd6d6('0x89'))][(_0xd6d6('0x8a'))](_0xd6d6('0x8c'));}if(_0x3d0b8e[_0xd6d6('0x37')]!=_0xd6d6('0x2f')){throw new db[(_0xd6d6('0x89'))]['ValidationError'](_0xd6d6('0x8d'));}return _0x3d0b8e;}else{throw new db[(_0xd6d6('0x89'))][(_0xd6d6('0x8a'))](_0xd6d6('0x8d'));}}return null;})[_0xd6d6('0x1a')](handleEntityNotFound(_0x1b90f7,null))[_0xd6d6('0x1a')](saveUpdates({'password':_0x80b6a5[_0xd6d6('0x5b')][_0xd6d6('0x86')],'passwordResetAt':_0x80b6a5[_0xd6d6('0x2e')]['id']==_0x80b6a5[_0xd6d6('0x58')]['id']?moment():null},null))[_0xd6d6('0x1a')](respondWithResult(_0x1b90f7,null))[_0xd6d6('0x56')](handleError(_0x1b90f7,null));};exports[_0xd6d6('0x8e')]=function(_0x17218d,_0x26fe42,_0x4e8684){var _0x300744;return db[_0xd6d6('0x3c')][_0xd6d6('0x59')]({'where':{'id':_0x17218d[_0xd6d6('0x58')]['id']},'attributes':['id',_0xd6d6('0x38'),'role',_0xd6d6('0x8f'),_0xd6d6('0x90'),_0xd6d6('0x91')]})[_0xd6d6('0x1a')](handleEntityNotFound(_0x26fe42,null))[_0xd6d6('0x1a')](function(_0x406ec7){if(_0x406ec7){_0x300744=_0x406ec7;if(!utils[_0xd6d6('0x92')](_0x17218d[_0xd6d6('0x5b')][_0xd6d6('0x93')])){throw new db[(_0xd6d6('0x89'))][(_0xd6d6('0x8a'))]('Unknown\x20channel');}return _0x406ec7[_0xd6d6('0x94')+_[_0xd6d6('0x95')](_0x17218d[_0xd6d6('0x5b')][_0xd6d6('0x93')]['toLowerCase']())+'Queues'](_0x17218d[_0xd6d6('0x5b')][_0xd6d6('0x5e')],{'penalty':_0x17218d['body'][_0xd6d6('0x96')]||0x0});}})[_0xd6d6('0x97')](function(_0x852e78){for(var _0x1b87a9=0x0;_0x1b87a9<_0x17218d['body'][_0xd6d6('0x5e')]['length'];_0x1b87a9+=0x1){var _0x8c459={'UserId':_0x17218d[_0xd6d6('0x58')]['id']};_0x8c459[_['capitalize'](_0x17218d[_0xd6d6('0x5b')][_0xd6d6('0x93')][_0xd6d6('0x98')]())+_0xd6d6('0x99')]=_0x17218d['body'][_0xd6d6('0x5e')][_0x1b87a9];socket[_0xd6d6('0x9a')](_0xd6d6('0x2e')+_['capitalize'](_0x17218d[_0xd6d6('0x5b')]['channel'][_0xd6d6('0x98')]())+'Queue:save',_0x8c459);}return _0x852e78;})[_0xd6d6('0x1a')](function(){if(_0x17218d[_0xd6d6('0x5b')]['channel']===_0xd6d6('0x9b')){return db[_0xd6d6('0x9c')]['findAll']({'where':{'id':_0x17218d[_0xd6d6('0x5b')][_0xd6d6('0x5e')]||[]},'raw':!![],'attributes':['id',_0xd6d6('0x38')]});}})[_0xd6d6('0x1a')](function(_0x3a224c){var _0x594818=[];if(_0x17218d[_0xd6d6('0x5b')][_0xd6d6('0x93')]===_0xd6d6('0x9b')&&_0x300744[_0xd6d6('0x37')]==='agent'){for(var _0x253285=0x0;_0x253285<_0x3a224c[_0xd6d6('0x47')];_0x253285+=0x1){_0x594818['push']({'membername':_0x300744[_0xd6d6('0x38')],'UserId':_0x300744['id'],'queue_name':_0x3a224c[_0x253285][_0xd6d6('0x38')],'VoiceQueueId':_0x3a224c[_0x253285]['id'],'interface':_[_0xd6d6('0x66')](_0x300744[_0xd6d6('0x91')])?util[_0xd6d6('0x68')]('SIP/%s',_0x300744['name']):_0x300744[_0xd6d6('0x91')],'paused':_0x300744[_0xd6d6('0x90')]||![],'penalty':_0x17218d[_0xd6d6('0x5b')][_0xd6d6('0x96')]||0x0});}return BPromise[_0xd6d6('0x9d')](_0x594818,function(_0x54469f){return db[_0xd6d6('0x9e')][_0xd6d6('0x9f')](_0x54469f);});}return _0x300744;})[_0xd6d6('0x1a')](respondWithStatusCode(_0x26fe42,null))['catch'](handleError(_0x26fe42,null));};exports[_0xd6d6('0xa0')]=function(_0x3926ac,_0x3b7472,_0x12fe5d){var _0x678240;return db[_0xd6d6('0x3c')][_0xd6d6('0x59')]({'where':{'id':_0x3926ac[_0xd6d6('0x58')]['id']},'attributes':['id',_0xd6d6('0x38'),_0xd6d6('0x37')]})[_0xd6d6('0x1a')](handleEntityNotFound(_0x3b7472,null))[_0xd6d6('0x1a')](function(_0x21df63){if(_0x21df63){_0x678240=_0x21df63;if(!_0x3926ac[_0xd6d6('0x41')]['channel']||!utils[_0xd6d6('0x92')](_0x3926ac[_0xd6d6('0x41')][_0xd6d6('0x93')])){throw new db[(_0xd6d6('0x89'))][(_0xd6d6('0x8a'))](_0xd6d6('0xa1'));}return _0x21df63[_0xd6d6('0xa2')+_[_0xd6d6('0x95')](_0x3926ac[_0xd6d6('0x41')][_0xd6d6('0x93')][_0xd6d6('0x98')]())+_0xd6d6('0xa3')](_0x3926ac['query'][_0xd6d6('0x5e')]);}})[_0xd6d6('0x1a')](function(_0x1ba007){for(var _0x48ad9d=0x0;_0x48ad9d<_0x3926ac[_0xd6d6('0x41')][_0xd6d6('0x5e')][_0xd6d6('0x47')];_0x48ad9d+=0x1){var _0x302193={'UserId':_0x3926ac[_0xd6d6('0x58')]['id']};_0x302193[_[_0xd6d6('0x95')](_0x3926ac[_0xd6d6('0x41')][_0xd6d6('0x93')][_0xd6d6('0x98')]())+_0xd6d6('0x99')]=_0x3926ac[_0xd6d6('0x41')]['ids'][_0x48ad9d];socket[_0xd6d6('0x9a')](_0xd6d6('0x2e')+_['capitalize'](_0x3926ac['query'][_0xd6d6('0x93')][_0xd6d6('0x98')]())+_0xd6d6('0xa4'),_0x302193);}return _0x1ba007;})[_0xd6d6('0x1a')](function(){if(_0x3926ac[_0xd6d6('0x41')]['channel']===_0xd6d6('0x9b')){return db[_0xd6d6('0x9e')][_0xd6d6('0x2c')]({'where':{'UserId':_0x3926ac[_0xd6d6('0x58')]['id'],'VoiceQueueId':_0x3926ac['query']['ids']},'individualHooks':!![]})['then'](function(){return _0x678240;});}return _0x678240;})[_0xd6d6('0x1a')](respondWithStatusCode(_0x3b7472,null))[_0xd6d6('0x56')](handleError(_0x3b7472,null));};exports['addAvatar']=function(_0x2042f8,_0x26c6e7,_0x5d3d70){_0x2042f8['body'][_0xd6d6('0xa5')]=_0x2042f8[_0xd6d6('0xa6')][_0xd6d6('0xa7')];return db[_0xd6d6('0x3c')][_0xd6d6('0x59')]({'where':{'id':_0x2042f8['params']['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x26c6e7,null))[_0xd6d6('0x1a')](saveUpdates(_0x2042f8[_0xd6d6('0x5b')],null))[_0xd6d6('0x1a')](respondWithResult(_0x26c6e7,null))[_0xd6d6('0x56')](handleError(_0x26c6e7,null));};exports['getAvatar']=function(_0x18e23c,_0x1d14b4,_0x558189){var _0x17d6c3=path[_0xd6d6('0xa8')](config[_0xd6d6('0xa9')],_0xd6d6('0xaa'));return db['User'][_0xd6d6('0x59')]({'where':{'id':_0x18e23c[_0xd6d6('0x58')]['id']},'attributes':['id',_0xd6d6('0xa5')],'raw':!![]})[_0xd6d6('0x1a')](handleEntityNotFound(_0x1d14b4,null))['then'](function(_0x45095c){if(_0x45095c){if(_['isNil'](_0x45095c[_0xd6d6('0xa5')])){return _0x1d14b4[_0xd6d6('0xab')](_0x17d6c3);}else{if(!fs[_0xd6d6('0xac')](path[_0xd6d6('0xa8')](config['root'],_0xd6d6('0xad'),_0x45095c[_0xd6d6('0xa5')]))){return _0x1d14b4[_0xd6d6('0xab')](_0x17d6c3);}return _0x1d14b4[_0xd6d6('0xab')](path[_0xd6d6('0xa8')](config[_0xd6d6('0xa9')],_0xd6d6('0xad'),_0x45095c[_0xd6d6('0xa5')]));}}})[_0xd6d6('0x56')](handleError(_0x1d14b4,null));};exports['getContacts']=function(_0x3c8062,_0x179a1d,_0x58d829){var _0xf8421f={};var _0x4f5bf3={};var _0x3763d8;var _0x5b95de;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0x3c8062[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x179a1d,null))[_0xd6d6('0x1a')](function(_0x148e25){if(_0x148e25){_0x3763d8=_0x148e25;_0x4f5bf3[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db[_0xd6d6('0xaf')][_0xd6d6('0x3d')]);_0x4f5bf3[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0x3c8062[_0xd6d6('0x41')]);_0x4f5bf3['filters']=_[_0xd6d6('0x43')](_0x4f5bf3['model'],_0x4f5bf3['query']);_0xf8421f[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x4f5bf3[_0xd6d6('0x44')],qs[_0xd6d6('0x46')](_0x3c8062[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0xf8421f[_0xd6d6('0x45')]=_0xf8421f[_0xd6d6('0x45')]['length']?_0xf8421f[_0xd6d6('0x45')]:_0x4f5bf3[_0xd6d6('0x44')];_0xf8421f['order']=qs['sort'](_0x3c8062['query']['sort']);_0xf8421f[_0xd6d6('0x4c')]=qs[_0xd6d6('0x4b')](_['pick'](_0x3c8062[_0xd6d6('0x41')],_0x4f5bf3['filters']));if(_0x3c8062['query']['filter']){_0xf8421f[_0xd6d6('0x4c')]=_[_0xd6d6('0x50')](_0xf8421f[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0xf8421f['attributes'],function(_0x39f372){var _0x22dcff={};_0x22dcff[_0x39f372]={'$like':'%'+_0x3c8062['query'][_0xd6d6('0x32')]+'%'};return _0x22dcff;})});}_0xf8421f=_[_0xd6d6('0x50')]({},_0xf8421f,_0x3c8062[_0xd6d6('0x51')]);return _0x3763d8[_0xd6d6('0xb0')](_0xf8421f);}})['then'](function(_0x3aa022){if(_0x3aa022){_0x5b95de=_0x3aa022[_0xd6d6('0x47')];if(_0x3c8062[_0xd6d6('0x41')][_0xd6d6('0x48')](_0xd6d6('0x52'))){_0xf8421f[_0xd6d6('0x53')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xd6d6('0xb1')],'as':'Tags','attributes':['id',_0xd6d6('0x38'),'color'],'where':_0x3c8062['query']['tag']?{'id':_0x3c8062[_0xd6d6('0x41')][_0xd6d6('0xb2')]}:undefined,'required':_0x3c8062['query'][_0xd6d6('0xb2')]?!![]:![]}];}if(!_0x3c8062[_0xd6d6('0x41')][_0xd6d6('0x48')](_0xd6d6('0xb3'))){_0xf8421f['limit']=qs['limit'](_0x3c8062['query'][_0xd6d6('0x29')]);_0xf8421f[_0xd6d6('0x28')]=qs[_0xd6d6('0x28')](_0x3c8062[_0xd6d6('0x41')][_0xd6d6('0x28')]);}return _0x3763d8[_0xd6d6('0xb0')](_0xf8421f);}})[_0xd6d6('0x1a')](function(_0x31108f){if(_0x31108f){return _0x31108f?{'count':_0x5b95de,'rows':_0x31108f}:null;}})['then'](respondWithResult(_0x179a1d,null))[_0xd6d6('0x56')](handleError(_0x179a1d,null));};exports['getQueues']=function(_0xf5e3dc,_0x56ae90,_0x59dd3f){var _0xbb71d9;var _0x53a014;var _0x124218={};var _0x1361f9;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0xf5e3dc[_0xd6d6('0x58')]['id']},'attributes':['id','name',_0xd6d6('0x37')]})['then'](handleEntityNotFound(_0x56ae90,null))['then'](function(_0x469ce4){if(!utils[_0xd6d6('0x92')](_0xf5e3dc[_0xd6d6('0x41')]['channel'])){throw new db[(_0xd6d6('0x89'))]['ValidationError'](_0xd6d6('0xa1'));}_0xbb71d9=_0x469ce4;var _0x2f18bb={};_0x2f18bb[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db[_[_0xd6d6('0x95')](_0xf5e3dc[_0xd6d6('0x41')][_0xd6d6('0x93')])+_0xd6d6('0xb4')][_0xd6d6('0x3d')]);_0x2f18bb['query']=_['keys'](_0xf5e3dc[_0xd6d6('0x41')]);_0x2f18bb[_0xd6d6('0x4b')]=_[_0xd6d6('0x43')](_0x2f18bb['model'],_0x2f18bb[_0xd6d6('0x41')]);_0x124218[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x2f18bb[_0xd6d6('0x44')],qs[_0xd6d6('0x46')](_0xf5e3dc[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0x124218[_0xd6d6('0x45')]=_0x124218['attributes'][_0xd6d6('0x47')]?_0x124218[_0xd6d6('0x45')]:_0x2f18bb[_0xd6d6('0x44')];_0x124218[_0xd6d6('0x49')]=qs['sort'](_0xf5e3dc['query']['sort']);_0x124218[_0xd6d6('0x4c')]=qs[_0xd6d6('0x4b')](_[_0xd6d6('0xb5')](_0xf5e3dc[_0xd6d6('0x41')],_0x2f18bb['filters']));if(_0xf5e3dc[_0xd6d6('0x41')][_0xd6d6('0x32')]){_0x124218[_0xd6d6('0x4c')]=_[_0xd6d6('0x50')](_0x124218[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0x124218[_0xd6d6('0x45')],function(_0x26864e){var _0x352e8f={};_0x352e8f[_0x26864e]={'$like':'%'+_0xf5e3dc['query'][_0xd6d6('0x32')]+'%'};return _0x352e8f;})});}_0x124218=_[_0xd6d6('0x50')]({},_0x124218,_0xf5e3dc[_0xd6d6('0x51')]);switch(_0xbb71d9['role']){case'admin':return db[_[_0xd6d6('0x95')](_0xf5e3dc['query'][_0xd6d6('0x93')])+_0xd6d6('0xb4')]['findAll'](_0x124218);case _0xd6d6('0x2e'):case'agent':return _0xbb71d9[_0xd6d6('0x2d')+_[_0xd6d6('0x95')](_0xf5e3dc[_0xd6d6('0x41')][_0xd6d6('0x93')])+_0xd6d6('0xa3')](_0x124218);default:throw new db[(_0xd6d6('0x89'))][(_0xd6d6('0x8a'))]('Unknown\x20role');}})[_0xd6d6('0x1a')](function(_0x400ef7){_0x1361f9=_0x400ef7[_0xd6d6('0x47')];if(!_0xf5e3dc[_0xd6d6('0x41')][_0xd6d6('0x48')](_0xd6d6('0xb3'))){_0x124218[_0xd6d6('0x29')]=qs[_0xd6d6('0x29')](_0xf5e3dc[_0xd6d6('0x41')]['limit']);_0x124218[_0xd6d6('0x28')]=qs['offset'](_0xf5e3dc['query'][_0xd6d6('0x28')]);}switch(_0xbb71d9[_0xd6d6('0x37')]){case'admin':return db[_[_0xd6d6('0x95')](_0xf5e3dc['query'][_0xd6d6('0x93')])+_0xd6d6('0xb4')][_0xd6d6('0x54')](_0x124218);case _0xd6d6('0x2e'):case _0xd6d6('0x2f'):return _0xbb71d9[_0xd6d6('0x2d')+_[_0xd6d6('0x95')](_0xf5e3dc[_0xd6d6('0x41')][_0xd6d6('0x93')])+_0xd6d6('0xa3')](_0x124218);}})[_0xd6d6('0x1a')](function(_0x4f7b8d){return{'count':_0x1361f9,'rows':_0x4f7b8d};})['then'](respondWithResult(_0x56ae90,null))[_0xd6d6('0x56')](handleError(_0x56ae90,null));};exports[_0xd6d6('0xb6')]=function(_0xff3dba,_0x40222e,_0x717e7e){var _0x3fe636={};var _0x1bb749={};var _0x19440e;var _0x331c16;return db[_0xd6d6('0x3c')]['findOne']({'where':{'id':_0xff3dba[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x40222e,null))[_0xd6d6('0x1a')](function(_0x3b06a4){if(_0x3b06a4){_0x19440e=_0x3b06a4;_0x1bb749[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db[_0xd6d6('0x9e')][_0xd6d6('0x3d')]);_0x1bb749[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0xff3dba[_0xd6d6('0x41')]);_0x1bb749['filters']=_[_0xd6d6('0x43')](_0x1bb749[_0xd6d6('0x44')],_0x1bb749[_0xd6d6('0x41')]);_0x3fe636[_0xd6d6('0x45')]=_['intersection'](_0x1bb749['model'],qs['fields'](_0xff3dba['query'][_0xd6d6('0x46')]));_0x3fe636[_0xd6d6('0x45')]=_0x3fe636[_0xd6d6('0x45')][_0xd6d6('0x47')]?_0x3fe636[_0xd6d6('0x45')]:_0x1bb749[_0xd6d6('0x44')];_0x3fe636[_0xd6d6('0x49')]=qs['sort'](_0xff3dba[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0x3fe636[_0xd6d6('0x4c')]=qs['filters'](_[_0xd6d6('0xb5')](_0xff3dba['query'],_0x1bb749[_0xd6d6('0x4b')]));if(_0xff3dba[_0xd6d6('0x41')]['filter']){_0x3fe636[_0xd6d6('0x4c')]=_['merge'](_0x3fe636[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0x3fe636['attributes'],function(_0x4fd031){var _0x190972={};_0x190972[_0x4fd031]={'$like':'%'+_0xff3dba[_0xd6d6('0x41')][_0xd6d6('0x32')]+'%'};return _0x190972;})});}_0x3fe636=_['merge']({},_0x3fe636,_0xff3dba['options']);return _0x19440e[_0xd6d6('0xb6')](_0x3fe636);}})[_0xd6d6('0x1a')](function(_0x4ff89c){if(_0x4ff89c){_0x331c16=_0x4ff89c[_0xd6d6('0x47')];if(!_0xff3dba['query'][_0xd6d6('0x48')](_0xd6d6('0xb3'))){_0x3fe636[_0xd6d6('0x29')]=qs[_0xd6d6('0x29')](_0xff3dba[_0xd6d6('0x41')][_0xd6d6('0x29')]);_0x3fe636[_0xd6d6('0x28')]=qs['offset'](_0xff3dba['query'][_0xd6d6('0x28')]);}return _0x19440e[_0xd6d6('0xb6')](_0x3fe636);}})[_0xd6d6('0x1a')](function(_0x6eb1bd){if(_0x6eb1bd){return _0x6eb1bd?{'count':_0x331c16,'rows':_0x6eb1bd}:null;}})[_0xd6d6('0x1a')](respondWithResult(_0x40222e,null))[_0xd6d6('0x56')](handleError(_0x40222e,null));};exports[_0xd6d6('0xb7')]=function(_0x2e5543,_0x2b343f,_0x5f364f){var _0x160064={};var _0x3cc7cd={};var _0x5bd656;var _0x25b371;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0x2e5543[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x2b343f,null))['then'](function(_0x1ebd6f){if(_0x1ebd6f){_0x5bd656=_0x1ebd6f;_0x3cc7cd[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db['ChatGroup'][_0xd6d6('0x3d')]);_0x3cc7cd[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0x2e5543[_0xd6d6('0x41')]);_0x3cc7cd['filters']=_[_0xd6d6('0x43')](_0x3cc7cd[_0xd6d6('0x44')],_0x3cc7cd['query']);_0x160064['attributes']=_['intersection'](_0x3cc7cd['model'],qs['fields'](_0x2e5543[_0xd6d6('0x41')]['fields']));_0x160064[_0xd6d6('0x45')]=_0x160064['attributes'][_0xd6d6('0x47')]?_0x160064[_0xd6d6('0x45')]:_0x3cc7cd[_0xd6d6('0x44')];_0x160064[_0xd6d6('0x49')]=qs[_0xd6d6('0x4a')](_0x2e5543[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0x160064[_0xd6d6('0x4c')]=qs[_0xd6d6('0x4b')](_[_0xd6d6('0xb5')](_0x2e5543['query'],_0x3cc7cd[_0xd6d6('0x4b')]));if(_0x2e5543[_0xd6d6('0x41')]['filter']){_0x160064[_0xd6d6('0x4c')]=_[_0xd6d6('0x50')](_0x160064[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0x160064[_0xd6d6('0x45')],function(_0x5ea025){var _0x1272a6={};_0x1272a6[_0x5ea025]={'$like':'%'+_0x2e5543[_0xd6d6('0x41')][_0xd6d6('0x32')]+'%'};return _0x1272a6;})});}_0x160064=_[_0xd6d6('0x50')]({},_0x160064,_0x2e5543[_0xd6d6('0x51')]);return _0x5bd656['getGroups'](_0x160064);}})[_0xd6d6('0x1a')](function(_0x5a9146){if(_0x5a9146){_0x25b371=_0x5a9146[_0xd6d6('0x47')];if(!_0x2e5543[_0xd6d6('0x41')][_0xd6d6('0x48')]('nolimit')){_0x160064[_0xd6d6('0x29')]=qs[_0xd6d6('0x29')](_0x2e5543['query'][_0xd6d6('0x29')]);_0x160064['offset']=qs[_0xd6d6('0x28')](_0x2e5543[_0xd6d6('0x41')][_0xd6d6('0x28')]);}return _0x5bd656[_0xd6d6('0xb7')](_0x160064);}})[_0xd6d6('0x1a')](function(_0x5b0bed){if(_0x5b0bed){return _0x5b0bed?{'count':_0x25b371,'rows':_0x5b0bed}:null;}})[_0xd6d6('0x1a')](respondWithResult(_0x2b343f,null))[_0xd6d6('0x56')](handleError(_0x2b343f,null));};exports[_0xd6d6('0xb8')]=function(_0xb8364f,_0xd95d0a,_0x160035){var _0x476a1c={'raw':!![],'where':{}};var _0x383240={};var _0x5e9279={'count':0x0,'rows':[]};return db['User'][_0xd6d6('0xae')]({'where':{'id':_0xb8364f[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0xd95d0a,null))['then'](function(_0x4d7df1){if(_0x4d7df1){_0x383240[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db['VoiceRecording'][_0xd6d6('0x3d')]);_0x383240[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0xb8364f[_0xd6d6('0x41')]);_0x383240[_0xd6d6('0x4b')]=_[_0xd6d6('0x43')](_0x383240['model'],_0x383240[_0xd6d6('0x41')]);_0x476a1c['attributes']=_[_0xd6d6('0x43')](_0x383240[_0xd6d6('0x44')],qs[_0xd6d6('0x46')](_0xb8364f[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0x476a1c[_0xd6d6('0x45')]=_0x476a1c[_0xd6d6('0x45')]['length']?_0x476a1c['attributes']:_0x383240[_0xd6d6('0x44')];if(!_0xb8364f[_0xd6d6('0x41')][_0xd6d6('0x48')](_0xd6d6('0xb3'))){_0x476a1c[_0xd6d6('0x29')]=qs[_0xd6d6('0x29')](_0xb8364f['query'][_0xd6d6('0x29')]);_0x476a1c[_0xd6d6('0x28')]=qs['offset'](_0xb8364f[_0xd6d6('0x41')]['offset']);}_0x476a1c[_0xd6d6('0x49')]=qs[_0xd6d6('0x4a')](_0xb8364f[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0x476a1c[_0xd6d6('0x4c')]=qs['filters'](_[_0xd6d6('0xb5')](_0xb8364f[_0xd6d6('0x41')],_0x383240[_0xd6d6('0x4b')]));_0x476a1c[_0xd6d6('0x4c')][_0xd6d6('0xb9')]=_0x4d7df1['id'];if(_0xb8364f[_0xd6d6('0x41')][_0xd6d6('0x32')]){_0x476a1c[_0xd6d6('0x4c')]=_[_0xd6d6('0x50')](_0x476a1c[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0x476a1c[_0xd6d6('0x45')],function(_0x3b56b5){var _0x237483={};_0x237483[_0x3b56b5]={'$like':'%'+_0xb8364f[_0xd6d6('0x41')]['filter']+'%'};return _0x237483;})});}_0x476a1c=_['merge']({},_0x476a1c,_0xb8364f['options']);return db[_0xd6d6('0xba')][_0xd6d6('0x27')]({'where':_0x476a1c['where']})['then'](function(_0x256fc9){_0x5e9279[_0xd6d6('0x27')]=_0x256fc9;if(_0xb8364f[_0xd6d6('0x41')][_0xd6d6('0x52')]){_0x476a1c['include']=[{'all':!![]}];}return db[_0xd6d6('0xba')][_0xd6d6('0x54')](_0x476a1c);})[_0xd6d6('0x1a')](function(_0x43ad2b){_0x5e9279[_0xd6d6('0x55')]=_0x43ad2b;return _0x5e9279;});}})[_0xd6d6('0x1a')](respondWithFilteredResult(_0xd95d0a,_0x476a1c))[_0xd6d6('0x56')](handleError(_0xd95d0a,null));};exports[_0xd6d6('0xbb')]=function(_0xd298fe,_0x1c5b83,_0x17592e){var _0x591e27={};var _0x4ef0dd={};var _0x2a1441;var _0x48f265;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0xd298fe[_0xd6d6('0x58')]['id']}})['then'](handleEntityNotFound(_0x1c5b83,null))[_0xd6d6('0x1a')](function(_0x37b622){if(_0x37b622){_0x2a1441=_0x37b622;_0x4ef0dd[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db[_0xd6d6('0xbc')][_0xd6d6('0x3d')]);_0x4ef0dd[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0xd298fe[_0xd6d6('0x41')]);_0x4ef0dd[_0xd6d6('0x4b')]=_[_0xd6d6('0x43')](_0x4ef0dd[_0xd6d6('0x44')],_0x4ef0dd[_0xd6d6('0x41')]);_0x591e27[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x4ef0dd[_0xd6d6('0x44')],qs[_0xd6d6('0x46')](_0xd298fe[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0x591e27[_0xd6d6('0x45')]=_0x591e27[_0xd6d6('0x45')][_0xd6d6('0x47')]?_0x591e27[_0xd6d6('0x45')]:_0x4ef0dd[_0xd6d6('0x44')];_0x591e27[_0xd6d6('0x49')]=qs['sort'](_0xd298fe[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0x591e27[_0xd6d6('0x4c')]=qs[_0xd6d6('0x4b')](_[_0xd6d6('0xb5')](_0xd298fe[_0xd6d6('0x41')],_0x4ef0dd[_0xd6d6('0x4b')]));if(_0xd298fe[_0xd6d6('0x41')][_0xd6d6('0x32')]){_0x591e27[_0xd6d6('0x4c')]=_['merge'](_0x591e27[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0x591e27[_0xd6d6('0x45')],function(_0x3c8be4){var _0x1e001e={};_0x1e001e[_0x3c8be4]={'$like':'%'+_0xd298fe[_0xd6d6('0x41')][_0xd6d6('0x32')]+'%'};return _0x1e001e;})});}_0x591e27=_[_0xd6d6('0x50')]({},_0x591e27,_0xd298fe[_0xd6d6('0x51')]);return _0x2a1441[_0xd6d6('0xbb')](_0x591e27);}})[_0xd6d6('0x1a')](function(_0x4912ca){if(_0x4912ca){_0x48f265=_0x4912ca[_0xd6d6('0x47')];if(!_0xd298fe['query'][_0xd6d6('0x48')](_0xd6d6('0xb3'))){_0x591e27[_0xd6d6('0x29')]=qs['limit'](_0xd298fe[_0xd6d6('0x41')][_0xd6d6('0x29')]);_0x591e27[_0xd6d6('0x28')]=qs['offset'](_0xd298fe['query']['offset']);}return _0x2a1441[_0xd6d6('0xbb')](_0x591e27);}})[_0xd6d6('0x1a')](function(_0x37f30b){if(_0x37f30b){return _0x37f30b?{'count':_0x48f265,'rows':_0x37f30b}:null;}})[_0xd6d6('0x1a')](respondWithResult(_0x1c5b83,null))[_0xd6d6('0x56')](handleError(_0x1c5b83,null));};exports[_0xd6d6('0xbd')]=function(_0x58e409,_0x78cd40,_0x1df7a9){var _0x1ed9a2={};var _0x27a6d0={};var _0x539751;var _0xec6853;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0x58e409[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x78cd40,null))['then'](function(_0x4ab0ca){if(_0x4ab0ca){_0x539751=_0x4ab0ca;_0x27a6d0['model']=_[_0xd6d6('0x42')](db[_0xd6d6('0xbe')][_0xd6d6('0x3d')]);_0x27a6d0[_0xd6d6('0x41')]=_['keys'](_0x58e409[_0xd6d6('0x41')]);_0x27a6d0['filters']=_[_0xd6d6('0x43')](_0x27a6d0[_0xd6d6('0x44')],_0x27a6d0[_0xd6d6('0x41')]);_0x1ed9a2[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x27a6d0['model'],qs[_0xd6d6('0x46')](_0x58e409[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0x1ed9a2[_0xd6d6('0x45')]=_0x1ed9a2[_0xd6d6('0x45')][_0xd6d6('0x47')]?_0x1ed9a2[_0xd6d6('0x45')]:_0x27a6d0['model'];_0x1ed9a2[_0xd6d6('0x49')]=qs[_0xd6d6('0x4a')](_0x58e409['query'][_0xd6d6('0x4a')]);_0x1ed9a2[_0xd6d6('0x4c')]=qs[_0xd6d6('0x4b')](_[_0xd6d6('0xb5')](_0x58e409['query'],_0x27a6d0[_0xd6d6('0x4b')]));if(_0x58e409[_0xd6d6('0x41')][_0xd6d6('0x32')]){_0x1ed9a2['where']=_[_0xd6d6('0x50')](_0x1ed9a2[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0x1ed9a2[_0xd6d6('0x45')],function(_0x459bfb){var _0x10157c={};_0x10157c[_0x459bfb]={'$like':'%'+_0x58e409[_0xd6d6('0x41')][_0xd6d6('0x32')]+'%'};return _0x10157c;})});}_0x1ed9a2=_[_0xd6d6('0x50')]({},_0x1ed9a2,_0x58e409[_0xd6d6('0x51')]);return _0x539751['getOpenchannelInteractions'](_0x1ed9a2);}})[_0xd6d6('0x1a')](function(_0x5119be){if(_0x5119be){_0xec6853=_0x5119be['length'];if(!_0x58e409['query'][_0xd6d6('0x48')](_0xd6d6('0xb3'))){_0x1ed9a2[_0xd6d6('0x29')]=qs[_0xd6d6('0x29')](_0x58e409[_0xd6d6('0x41')][_0xd6d6('0x29')]);_0x1ed9a2[_0xd6d6('0x28')]=qs[_0xd6d6('0x28')](_0x58e409['query'][_0xd6d6('0x28')]);}return _0x539751[_0xd6d6('0xbd')](_0x1ed9a2);}})[_0xd6d6('0x1a')](function(_0x205039){if(_0x205039){return _0x205039?{'count':_0xec6853,'rows':_0x205039}:null;}})[_0xd6d6('0x1a')](respondWithResult(_0x78cd40,null))[_0xd6d6('0x56')](handleError(_0x78cd40,null));};exports[_0xd6d6('0xbf')]=function(_0x1e1e56,_0xb961c,_0x51a48b){var _0x5ea544={'raw':!![],'where':{}};var _0x4854b7={};var _0x384cb2={'count':0x0,'rows':[]};return db['User'][_0xd6d6('0xae')]({'where':{'id':_0x1e1e56[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0xb961c,null))[_0xd6d6('0x1a')](function(_0x26336c){if(_0x26336c){_0x4854b7[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db[_0xd6d6('0xc0')]['rawAttributes']);_0x4854b7[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0x1e1e56[_0xd6d6('0x41')]);_0x4854b7[_0xd6d6('0x4b')]=_[_0xd6d6('0x43')](_0x4854b7[_0xd6d6('0x44')],_0x4854b7[_0xd6d6('0x41')]);_0x5ea544['attributes']=_[_0xd6d6('0x43')](_0x4854b7[_0xd6d6('0x44')],qs['fields'](_0x1e1e56[_0xd6d6('0x41')]['fields']));_0x5ea544[_0xd6d6('0x45')]=_0x5ea544[_0xd6d6('0x45')][_0xd6d6('0x47')]?_0x5ea544['attributes']:_0x4854b7[_0xd6d6('0x44')];if(!_0x1e1e56[_0xd6d6('0x41')]['hasOwnProperty'](_0xd6d6('0xb3'))){_0x5ea544[_0xd6d6('0x29')]=qs[_0xd6d6('0x29')](_0x1e1e56['query'][_0xd6d6('0x29')]);_0x5ea544[_0xd6d6('0x28')]=qs['offset'](_0x1e1e56[_0xd6d6('0x41')][_0xd6d6('0x28')]);}_0x5ea544[_0xd6d6('0x49')]=qs['sort'](_0x1e1e56[_0xd6d6('0x41')]['sort']);_0x5ea544['where']=qs[_0xd6d6('0x4b')](_[_0xd6d6('0xb5')](_0x1e1e56[_0xd6d6('0x41')],_0x4854b7[_0xd6d6('0x4b')]));_0x5ea544[_0xd6d6('0x4c')][_0xd6d6('0xb9')]=_0x26336c['id'];if(_0x1e1e56[_0xd6d6('0x41')][_0xd6d6('0x32')]){_0x5ea544[_0xd6d6('0x4c')]=_[_0xd6d6('0x50')](_0x5ea544['where'],{'$or':_[_0xd6d6('0x34')](_0x5ea544[_0xd6d6('0x45')],function(_0x14d09e){var _0x196f96={};_0x196f96[_0x14d09e]={'$like':'%'+_0x1e1e56[_0xd6d6('0x41')][_0xd6d6('0x32')]+'%'};return _0x196f96;})});}_0x5ea544=_[_0xd6d6('0x50')]({},_0x5ea544,_0x1e1e56[_0xd6d6('0x51')]);return db[_0xd6d6('0xc0')][_0xd6d6('0x27')]({'where':_0x5ea544[_0xd6d6('0x4c')]})[_0xd6d6('0x1a')](function(_0x2feca9){_0x384cb2[_0xd6d6('0x27')]=_0x2feca9;if(_0x1e1e56['query']['includeAll']){_0x5ea544[_0xd6d6('0x53')]=[{'all':!![]}];}return db['MailInteraction'][_0xd6d6('0x54')](_0x5ea544);})[_0xd6d6('0x1a')](function(_0x3cb271){_0x384cb2['rows']=_0x3cb271;return _0x384cb2;});}})[_0xd6d6('0x1a')](respondWithFilteredResult(_0xb961c,_0x5ea544))[_0xd6d6('0x56')](handleError(_0xb961c,null));};exports['getSmsInteractions']=function(_0x2d2e91,_0x343773,_0x32598c){var _0x1454f4={};var _0x4edb64={};var _0x2c495a;var _0x332cd3;return db['User'][_0xd6d6('0xae')]({'where':{'id':_0x2d2e91[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x343773,null))['then'](function(_0x36bb39){if(_0x36bb39){_0x2c495a=_0x36bb39;_0x4edb64[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db['SmsInteraction'][_0xd6d6('0x3d')]);_0x4edb64[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0x2d2e91[_0xd6d6('0x41')]);_0x4edb64[_0xd6d6('0x4b')]=_[_0xd6d6('0x43')](_0x4edb64[_0xd6d6('0x44')],_0x4edb64[_0xd6d6('0x41')]);_0x1454f4[_0xd6d6('0x45')]=_['intersection'](_0x4edb64[_0xd6d6('0x44')],qs['fields'](_0x2d2e91[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0x1454f4[_0xd6d6('0x45')]=_0x1454f4[_0xd6d6('0x45')]['length']?_0x1454f4[_0xd6d6('0x45')]:_0x4edb64['model'];_0x1454f4[_0xd6d6('0x49')]=qs['sort'](_0x2d2e91[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0x1454f4[_0xd6d6('0x4c')]=qs[_0xd6d6('0x4b')](_[_0xd6d6('0xb5')](_0x2d2e91[_0xd6d6('0x41')],_0x4edb64['filters']));if(_0x2d2e91[_0xd6d6('0x41')][_0xd6d6('0x32')]){_0x1454f4['where']=_['merge'](_0x1454f4['where'],{'$or':_['map'](_0x1454f4[_0xd6d6('0x45')],function(_0x2778c9){var _0x490695={};_0x490695[_0x2778c9]={'$like':'%'+_0x2d2e91['query'][_0xd6d6('0x32')]+'%'};return _0x490695;})});}_0x1454f4=_[_0xd6d6('0x50')]({},_0x1454f4,_0x2d2e91[_0xd6d6('0x51')]);return _0x2c495a[_0xd6d6('0xc1')](_0x1454f4);}})[_0xd6d6('0x1a')](function(_0x10966d){if(_0x10966d){_0x332cd3=_0x10966d[_0xd6d6('0x47')];if(!_0x2d2e91[_0xd6d6('0x41')][_0xd6d6('0x48')](_0xd6d6('0xb3'))){_0x1454f4[_0xd6d6('0x29')]=qs[_0xd6d6('0x29')](_0x2d2e91[_0xd6d6('0x41')][_0xd6d6('0x29')]);_0x1454f4['offset']=qs[_0xd6d6('0x28')](_0x2d2e91[_0xd6d6('0x41')]['offset']);}return _0x2c495a[_0xd6d6('0xc1')](_0x1454f4);}})['then'](function(_0x143386){if(_0x143386){return _0x143386?{'count':_0x332cd3,'rows':_0x143386}:null;}})[_0xd6d6('0x1a')](respondWithResult(_0x343773,null))['catch'](handleError(_0x343773,null));};exports[_0xd6d6('0xc2')]=function(_0x4c6e46,_0x524ee3,_0x272acf){var _0xed8bc2={};var _0x5e5b1b={};var _0x1c78b1;var _0x4f0090;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0x4c6e46['params']['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x524ee3,null))['then'](function(_0x27c6ca){if(_0x27c6ca){_0x1c78b1=_0x27c6ca;_0x5e5b1b[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db[_0xd6d6('0xc3')][_0xd6d6('0x3d')]);_0x5e5b1b[_0xd6d6('0x41')]=_[_0xd6d6('0x42')](_0x4c6e46[_0xd6d6('0x41')]);_0x5e5b1b[_0xd6d6('0x4b')]=_['intersection'](_0x5e5b1b['model'],_0x5e5b1b[_0xd6d6('0x41')]);_0xed8bc2[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x5e5b1b['model'],qs[_0xd6d6('0x46')](_0x4c6e46[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0xed8bc2[_0xd6d6('0x45')]=_0xed8bc2[_0xd6d6('0x45')][_0xd6d6('0x47')]?_0xed8bc2[_0xd6d6('0x45')]:_0x5e5b1b[_0xd6d6('0x44')];_0xed8bc2[_0xd6d6('0x49')]=qs[_0xd6d6('0x4a')](_0x4c6e46[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0xed8bc2[_0xd6d6('0x4c')]=qs[_0xd6d6('0x4b')](_[_0xd6d6('0xb5')](_0x4c6e46[_0xd6d6('0x41')],_0x5e5b1b[_0xd6d6('0x4b')]));if(_0x4c6e46['query'][_0xd6d6('0x32')]){_0xed8bc2[_0xd6d6('0x4c')]=_[_0xd6d6('0x50')](_0xed8bc2['where'],{'$or':_[_0xd6d6('0x34')](_0xed8bc2[_0xd6d6('0x45')],function(_0x18404a){var _0x36b81a={};_0x36b81a[_0x18404a]={'$like':'%'+_0x4c6e46[_0xd6d6('0x41')][_0xd6d6('0x32')]+'%'};return _0x36b81a;})});}_0xed8bc2=_[_0xd6d6('0x50')]({},_0xed8bc2,_0x4c6e46[_0xd6d6('0x51')]);return _0x1c78b1[_0xd6d6('0xc2')](_0xed8bc2);}})[_0xd6d6('0x1a')](function(_0x301add){if(_0x301add){_0x4f0090=_0x301add[_0xd6d6('0x47')];if(!_0x4c6e46[_0xd6d6('0x41')]['hasOwnProperty'](_0xd6d6('0xb3'))){_0xed8bc2['limit']=qs[_0xd6d6('0x29')](_0x4c6e46['query'][_0xd6d6('0x29')]);_0xed8bc2[_0xd6d6('0x28')]=qs[_0xd6d6('0x28')](_0x4c6e46[_0xd6d6('0x41')][_0xd6d6('0x28')]);}return _0x1c78b1[_0xd6d6('0xc2')](_0xed8bc2);}})['then'](function(_0x923210){if(_0x923210){return _0x923210?{'count':_0x4f0090,'rows':_0x923210}:null;}})[_0xd6d6('0x1a')](respondWithResult(_0x524ee3,null))[_0xd6d6('0x56')](handleError(_0x524ee3,null));};exports[_0xd6d6('0xc4')]=function(_0x12aa38,_0xd44283,_0x658932){var _0x23223e;var _0x375667;var _0x56f06e;return db[_0xd6d6('0x3c')][_0xd6d6('0x59')]({'where':{'id':_0x12aa38['params']['id'],'role':_0xd6d6('0x2f')},'attributes':['id',_0xd6d6('0x38'),_0xd6d6('0xc5'),_0xd6d6('0xc6'),_0xd6d6('0x37'),_0xd6d6('0x6b'),_0xd6d6('0x8f')]})[_0xd6d6('0x1a')](handleEntityNotFound(_0xd44283,null))[_0xd6d6('0x1a')](function(_0x251646){if(_0x251646){_0x23223e=_0x251646;if(_0x12aa38[_0xd6d6('0x5b')][_0xd6d6('0x91')]){_0x56f06e=util['format']('LOCAL/%s@from-sip/n',_0x23223e[_0x12aa38[_0xd6d6('0x5b')][_0xd6d6('0x91')]]);}else if(_0x12aa38[_0xd6d6('0x5b')][_0xd6d6('0xc7')]){_0x56f06e=util[_0xd6d6('0x68')](_0xd6d6('0xc8'),_0x12aa38['body'][_0xd6d6('0xc7')]);}else{_0x56f06e=util['format'](_0xd6d6('0xc8'),_0x23223e[_0xd6d6('0x38')]);}socket['to'](util['format'](_0xd6d6('0xc9'),_0x23223e[_0xd6d6('0x38')]))['emit'](_0xd6d6('0xca'),{'ip':_0x12aa38['headers'][_0xd6d6('0xcb')]||_0x12aa38['connection']['remoteAddress']||_0x12aa38[_0xd6d6('0xcc')][_0xd6d6('0xcd')]||_0x12aa38[_0xd6d6('0xce')][_0xd6d6('0xcc')][_0xd6d6('0xcd')]});return db[_0xd6d6('0x9e')]['destroy']({'where':{'membername':_0x23223e[_0xd6d6('0x38')]},'individualHooks':!![]});}})[_0xd6d6('0x1a')](function(_0x1c0847){if(_0x23223e){return _0x23223e[_0xd6d6('0xcf')]({'raw':!![]});}})[_0xd6d6('0x1a')](function(_0x112ef3){var _0x149dd9=[];if(_0x112ef3){_0x375667=_0x112ef3;if(_0x375667[_0xd6d6('0x47')]){for(var _0x5539e4=0x0;_0x5539e4<_0x375667[_0xd6d6('0x47')];_0x5539e4++){_0x149dd9[_0xd6d6('0xd0')]({'membername':_0x23223e[_0xd6d6('0x38')],'UserId':_0x23223e['id'],'queue_name':_0x375667[_0x5539e4][_0xd6d6('0x38')],'VoiceQueueId':_0x375667[_0x5539e4]['id'],'interface':_0x56f06e,'paused':_0x23223e[_0xd6d6('0x8f')]||![],'penalty':_0x375667[_0x5539e4]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x149dd9,function(_0x32c179){return db[_0xd6d6('0x9e')][_0xd6d6('0x9f')](_0x32c179);});}}})['then'](function(){return db['MemberReport'][_0xd6d6('0x54')]({'where':{'membername':_0x23223e['name'],'exitAt':null}});})['then'](function(_0x10941d){var _0x8c579a=[];_0x10941d[_0xd6d6('0xd1')](function(_0x37f773){_0x8c579a['push'](_0x37f773[_0xd6d6('0x2b')]({'exitAt':moment()[_0xd6d6('0x68')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xd6d6('0xd2')](_0x8c579a);})[_0xd6d6('0x1a')](function(){var _0x3062f8=[];var _0x4724e1=[];var _0x38db48=utils[_0xd6d6('0xd3')]();var _0x450e5={'membername':_0x23223e[_0xd6d6('0x38')],'interface':_0x56f06e,'enterAt':moment()[_0xd6d6('0x68')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x23223e[_0xd6d6('0x37')],'internal':_0x23223e[_0xd6d6('0x6b')]};_0x38db48[_0xd6d6('0xd1')](function(_0x23e244){_0x3062f8[_0xd6d6('0xd0')](_['merge']({'channel':_0x23e244,'type':_0xd6d6('0xd4'),'data1':_0x12aa38['body'][_0xd6d6('0xd5')],'data2':_0x56f06e},_0x450e5));if(_0x23223e['loginInPause']){_0x4724e1[_0xd6d6('0xd0')](_['merge']({'channel':_0x23e244,'type':_0xd6d6('0xd6'),'data1':_0xd6d6('0xd7')},_0x450e5));}});return db[_0xd6d6('0xd8')][_0xd6d6('0x5a')](_0x3062f8[_0xd6d6('0xd9')](_0x4724e1),{'individualHooks':!![]});})[_0xd6d6('0x1a')](function(){return _0x23223e[_0xd6d6('0x2b')]({'online':!![],'lastLoginAt':moment()[_0xd6d6('0x68')](_0xd6d6('0xda')),'voicePause':_0x23223e['loginInPause']||![],'mailPause':_0x23223e['loginInPause']||![],'chatPause':_0x23223e['loginInPause']||![],'faxPause':_0x23223e[_0xd6d6('0x8f')]||![],'smsPause':_0x23223e['loginInPause']||![],'openchannelPause':_0x23223e[_0xd6d6('0x8f')]||![],'pauseType':_0x23223e['loginInPause']?'LOGININPAUSE':null,'interface':_0x56f06e,'lastPauseAt':moment()[_0xd6d6('0x68')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xd6d6('0x1a')](respondWithResult(_0xd44283,null))[_0xd6d6('0x56')](handleError(_0xd44283,null));};exports[_0xd6d6('0xdb')]=function(_0x1f8cf6,_0xd514c0,_0x516147){var _0xa63c9;return db['User'][_0xd6d6('0x59')]({'where':{'id':_0x1f8cf6[_0xd6d6('0x58')]['id'],'role':_0xd6d6('0x2f')},'attributes':['id',_0xd6d6('0x38'),'role']})[_0xd6d6('0x1a')](handleEntityNotFound(_0xd514c0,null))[_0xd6d6('0x1a')](function(_0x523052){if(_0x523052){_0xa63c9=_0x523052;return db[_0xd6d6('0x9e')]['destroy']({'where':{'membername':_0xa63c9[_0xd6d6('0x38')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0xd6d6('0x54')]({'where':{'membername':_0xa63c9[_0xd6d6('0x38')],'exitAt':null}});})[_0xd6d6('0x1a')](function(_0x225002){var _0x391926=[];_0x225002['forEach'](function(_0x48af9c){_0x391926[_0xd6d6('0xd0')](_0x48af9c[_0xd6d6('0x2b')]({'exitAt':moment()[_0xd6d6('0x68')](_0xd6d6('0xda'))}));});return BPromise[_0xd6d6('0xd2')](_0x391926);})[_0xd6d6('0x1a')](function(){return _0xa63c9['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xd6d6('0x1a')](respondWithResult(_0xd514c0,null))[_0xd6d6('0x56')](handleError(_0xd514c0,null));};exports[_0xd6d6('0xdc')]=function(_0x2cb795,_0x29e121,_0x2038a9){var _0x5b4223;return db[_0xd6d6('0x9e')]['update']({'paused':0x1},{'where':{'UserId':_0x2cb795['params']['id']},'individualHooks':!![]})[_0xd6d6('0x1a')](function(){return db['User'][_0xd6d6('0x59')]({'where':{'id':_0x2cb795[_0xd6d6('0x58')]['id'],'role':_0xd6d6('0x2f')},'attributes':['id',_0xd6d6('0x38'),_0xd6d6('0x37'),_0xd6d6('0x6b'),'interface']});})[_0xd6d6('0x1a')](handleEntityNotFound(_0x29e121,null))[_0xd6d6('0x1a')](function(_0x46c663){if(_0x46c663){_0x5b4223=_0x46c663;return respondWithRpcPromise(_0xd6d6('0xdd'),'pause',{'id':_0x5b4223['id'],'name':_0x5b4223['name'],'pause':!![]});}})['then'](function(){if(_0x5b4223){return db['MemberReport'][_0xd6d6('0x54')]({'where':{'membername':_0x5b4223[_0xd6d6('0x38')],'type':_0xd6d6('0xd6'),'exitAt':null}});}})['then'](function(_0x5c245b){if(_0x5c245b['length']){var _0x2f4851=moment()[_0xd6d6('0x68')](_0xd6d6('0xda'));for(var _0x3fd1d4=0x0,_0x531976=_0x5c245b[_0xd6d6('0x47')];_0x3fd1d4<_0x531976;_0x3fd1d4++){_0x5c245b[_0x3fd1d4]['updateAttributes']({'exitAt':_0x2f4851});}}})[_0xd6d6('0x1a')](function(){var _0x3c8da1=[];var _0x5a9734=utils['getChannels']();_0x5a9734[_0xd6d6('0xd1')](function(_0x114d7f){_0x3c8da1[_0xd6d6('0xd0')]({'channel':_0x114d7f,'membername':_0x5b4223[_0xd6d6('0x38')],'interface':_[_0xd6d6('0x66')](_0x5b4223[_0xd6d6('0x91')])?util[_0xd6d6('0x68')](_0xd6d6('0xc8'),_0x5b4223['name']):_0x5b4223['interface'],'type':_0xd6d6('0xd6'),'enterAt':moment()['format'](_0xd6d6('0xda')),'data1':_0x2cb795[_0xd6d6('0x5b')][_0xd6d6('0xde')]||_0xd6d6('0xdf'),'role':_0x5b4223[_0xd6d6('0x37')],'internal':_0x5b4223['internal']});});return db[_0xd6d6('0xd8')][_0xd6d6('0x5a')](_0x3c8da1,{'individualHooks':!![]});})['then'](function(){return _0x5b4223[_0xd6d6('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2cb795[_0xd6d6('0x5b')][_0xd6d6('0xde')]||_0xd6d6('0xdf'),'lastPauseAt':moment()['format'](_0xd6d6('0xda'))});})[_0xd6d6('0x1a')](respondWithResult(_0x29e121,null))['catch'](handleError(_0x29e121,null));};exports[_0xd6d6('0xe0')]=function(_0x3ce7d3,_0x2ee8cf,_0x2f3bed){var _0x8cf5f5;return db[_0xd6d6('0x3c')]['find']({'where':{'id':_0x3ce7d3['params']['id']},'attributes':['id',_0xd6d6('0x38'),_0xd6d6('0x37'),_0xd6d6('0x90'),_0xd6d6('0xe1'),_0xd6d6('0xe2'),'faxPause',_0xd6d6('0xe3'),'smsPause','pauseType',_0xd6d6('0xe4')]})[_0xd6d6('0x1a')](handleEntityNotFound(_0x2ee8cf,null))[_0xd6d6('0x1a')](function(_0x834221){if(_0x834221){_0x8cf5f5=_0x834221;if(_0x3ce7d3[_0xd6d6('0x5b')][_0xd6d6('0x93')]&&!utils['isValidChannel'](_0x3ce7d3[_0xd6d6('0x5b')][_0xd6d6('0x93')])){throw new db['Sequelize'][(_0xd6d6('0x8a'))](_0xd6d6('0xa1'));}switch(_0x3ce7d3[_0xd6d6('0x5b')]['channel']){case _0xd6d6('0x9b'):return respondWithRpcPromise(_0xd6d6('0xdd'),_0xd6d6('0xe0'),{'id':_0x8cf5f5['id'],'name':_0x8cf5f5[_0xd6d6('0x38')],'pause':![]})['then'](function(){return db[_0xd6d6('0x9e')][_0xd6d6('0x2b')]({'paused':0x0},{'where':{'UserId':_0x8cf5f5['id']},'individualHooks':!![]});})[_0xd6d6('0x1a')](function(){return db[_0xd6d6('0xd8')][_0xd6d6('0x59')]({'where':{'channel':_0x3ce7d3[_0xd6d6('0x5b')]['channel'],'membername':_0x8cf5f5[_0xd6d6('0x38')],'type':_0xd6d6('0xd6'),'exitAt':null}});})[_0xd6d6('0x1a')](function(_0x4260e8){if(_0x4260e8){return _0x4260e8[_0xd6d6('0x2b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xd6d6('0x1a')](function(){return _0x8cf5f5[_0xd6d6('0x2b')]({'voicePause':![]});});case _0xd6d6('0xe5'):case _0xd6d6('0xe6'):case'fax':case _0xd6d6('0xe7'):case'openchannel':return db[_0xd6d6('0xd8')]['find']({'where':{'channel':_0x3ce7d3[_0xd6d6('0x5b')][_0xd6d6('0x93')],'membername':_0x8cf5f5['name'],'type':_0xd6d6('0xd6'),'exitAt':null}})['then'](function(_0x52a873){if(_0x52a873){return _0x52a873[_0xd6d6('0x2b')]({'exitAt':moment()[_0xd6d6('0x68')](_0xd6d6('0xda')),'data2':_0xd6d6('0xe8')},{'individualHooks':!![]});}return null;})[_0xd6d6('0x1a')](function(){var _0xba988e={};_[_0xd6d6('0x2a')](_0xba988e,util['format']('%s%s',_0x3ce7d3['body'][_0xd6d6('0x93')],_0xd6d6('0xe9')),![]);return _0x8cf5f5[_0xd6d6('0x2b')](_0xba988e);});default:return respondWithRpcPromise(_0xd6d6('0xdd'),'unpause',{'id':_0x8cf5f5['id'],'name':_0x8cf5f5[_0xd6d6('0x38')],'pause':![]})['then'](function(){return db[_0xd6d6('0x9e')]['update']({'paused':0x0},{'where':{'UserId':_0x8cf5f5['id']}});})[_0xd6d6('0x1a')](function(){return db[_0xd6d6('0xd8')]['findAll']({'where':{'membername':_0x8cf5f5[_0xd6d6('0x38')],'type':_0xd6d6('0xd6'),'exitAt':null}});})[_0xd6d6('0x1a')](function(_0x30ffca){var _0x29cf0c=[];_0x30ffca[_0xd6d6('0xd1')](function(_0x449530){_0x29cf0c[_0xd6d6('0xd0')](_0x449530[_0xd6d6('0x2b')]({'exitAt':moment()[_0xd6d6('0x68')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd6d6('0xe8')}));});return BPromise['all'](_0x29cf0c);})[_0xd6d6('0x1a')](function(){return _0x8cf5f5['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xd6d6('0x1a')](respondWithResult(_0x2ee8cf,null))[_0xd6d6('0x56')](handleError(_0x2ee8cf,null));};exports['getTeams']=function(_0x556218,_0xa304dc,_0x23c546){var _0xe46172={};var _0x1dc5ce={};var _0x2bea23;var _0x3058c3;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0x556218[_0xd6d6('0x58')]['id']}})['then'](handleEntityNotFound(_0xa304dc,null))['then'](function(_0x5d6c10){if(_0x5d6c10){_0x2bea23=_0x5d6c10;_0x1dc5ce[_0xd6d6('0x44')]=_[_0xd6d6('0x42')](db['Team']['rawAttributes']);_0x1dc5ce['query']=_['keys'](_0x556218[_0xd6d6('0x41')]);_0x1dc5ce['filters']=_['intersection'](_0x1dc5ce[_0xd6d6('0x44')],_0x1dc5ce[_0xd6d6('0x41')]);_0xe46172[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x1dc5ce['model'],qs['fields'](_0x556218['query'][_0xd6d6('0x46')]));_0xe46172['attributes']=_0xe46172[_0xd6d6('0x45')][_0xd6d6('0x47')]?_0xe46172[_0xd6d6('0x45')]:_0x1dc5ce[_0xd6d6('0x44')];_0xe46172[_0xd6d6('0x49')]=qs[_0xd6d6('0x4a')](_0x556218[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0xe46172[_0xd6d6('0x4c')]=qs['filters'](_[_0xd6d6('0xb5')](_0x556218['query'],_0x1dc5ce[_0xd6d6('0x4b')]));if(_0x556218['query'][_0xd6d6('0x32')]){_0xe46172[_0xd6d6('0x4c')]=_[_0xd6d6('0x50')](_0xe46172[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0xe46172[_0xd6d6('0x45')],function(_0x4d5b9b){var _0x3f4448={};_0x3f4448[_0x4d5b9b]={'$like':'%'+_0x556218[_0xd6d6('0x41')][_0xd6d6('0x32')]+'%'};return _0x3f4448;})});}_0xe46172=_[_0xd6d6('0x50')]({},_0xe46172,_0x556218[_0xd6d6('0x51')]);return _0x2bea23[_0xd6d6('0xea')](_0xe46172);}})['then'](function(_0x13a7d2){if(_0x13a7d2){_0x3058c3=_0x13a7d2[_0xd6d6('0x47')];if(!_0x556218[_0xd6d6('0x41')]['hasOwnProperty']('nolimit')){_0xe46172[_0xd6d6('0x29')]=qs['limit'](_0x556218[_0xd6d6('0x41')]['limit']);_0xe46172[_0xd6d6('0x28')]=qs[_0xd6d6('0x28')](_0x556218['query'][_0xd6d6('0x28')]);}return _0x2bea23['getTeams'](_0xe46172);}})[_0xd6d6('0x1a')](function(_0x48b285){if(_0x48b285){return _0x48b285?{'count':_0x3058c3,'rows':_0x48b285}:null;}})[_0xd6d6('0x1a')](respondWithResult(_0xa304dc,null))[_0xd6d6('0x56')](handleError(_0xa304dc,null));};exports[_0xd6d6('0xeb')]=function(_0x3e48c8,_0x2f4fde,_0x19d26f){return db['User']['find']({'where':{'id':_0x3e48c8[_0xd6d6('0x58')]['id']}})['then'](handleEntityNotFound(_0x2f4fde,null))[_0xd6d6('0x1a')](function(_0x794314){if(_0x794314){return _0x794314[_0xd6d6('0xeb')](_0x3e48c8['body'][_0xd6d6('0x5e')],_[_0xd6d6('0x5f')](_0x3e48c8[_0xd6d6('0x5b')],[_0xd6d6('0x5e'),'id'])||{});}})[_0xd6d6('0x1a')](respondWithResult(_0x2f4fde,null))['catch'](handleError(_0x2f4fde,null));};exports[_0xd6d6('0xec')]=function(_0x3777a9,_0x117df5,_0x186fca){var _0x22ddf6;return db[_0xd6d6('0x3c')][_0xd6d6('0x59')]({'where':{'id':_0x3777a9[_0xd6d6('0x58')]['id']}})['then'](handleEntityNotFound(_0x117df5,null))[_0xd6d6('0x1a')](function(_0x5f0509){if(_0x5f0509){return _0x5f0509[_0xd6d6('0xec')](_0x3777a9[_0xd6d6('0x41')][_0xd6d6('0x5e')]);}})[_0xd6d6('0x1a')](respondWithStatusCode(_0x117df5,null))['catch'](handleError(_0x117df5,null));};exports[_0xd6d6('0xed')]=function(_0x4eec65,_0x269854,_0x240188){var _0x543cba={};var _0x12e4d8={};var _0x5ba33e;var _0x237092;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0x4eec65[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x269854,null))[_0xd6d6('0x1a')](function(_0x2c639b){if(_0x2c639b){_0x5ba33e=_0x2c639b;_0x12e4d8['model']=_[_0xd6d6('0x42')](db[_0xd6d6('0xee')][_0xd6d6('0x3d')]);_0x12e4d8['query']=_['keys'](_0x4eec65[_0xd6d6('0x41')]);_0x12e4d8[_0xd6d6('0x4b')]=_['intersection'](_0x12e4d8[_0xd6d6('0x44')],_0x12e4d8['query']);_0x543cba[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x12e4d8['model'],qs['fields'](_0x4eec65[_0xd6d6('0x41')][_0xd6d6('0x46')]));_0x543cba[_0xd6d6('0x45')]=_0x543cba[_0xd6d6('0x45')]['length']?_0x543cba[_0xd6d6('0x45')]:_0x12e4d8[_0xd6d6('0x44')];_0x543cba[_0xd6d6('0x49')]=qs[_0xd6d6('0x4a')](_0x4eec65[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0x543cba['where']=qs[_0xd6d6('0x4b')](_['pick'](_0x4eec65['query'],_0x12e4d8[_0xd6d6('0x4b')]));if(_0x4eec65[_0xd6d6('0x41')]['filter']){_0x543cba['where']=_[_0xd6d6('0x50')](_0x543cba['where'],{'$or':_[_0xd6d6('0x34')](_0x543cba['attributes'],function(_0x415511){var _0x29079e={};_0x29079e[_0x415511]={'$like':'%'+_0x4eec65['query'][_0xd6d6('0x32')]+'%'};return _0x29079e;})});}_0x543cba=_[_0xd6d6('0x50')]({},_0x543cba,_0x4eec65[_0xd6d6('0x51')]);return _0x5ba33e['getLists'](_0x543cba);}})[_0xd6d6('0x1a')](function(_0x3088d7){if(_0x3088d7){_0x237092=_0x3088d7[_0xd6d6('0x47')];if(!_0x4eec65[_0xd6d6('0x41')]['hasOwnProperty'](_0xd6d6('0xb3'))){_0x543cba['limit']=qs[_0xd6d6('0x29')](_0x4eec65[_0xd6d6('0x41')][_0xd6d6('0x29')]);_0x543cba[_0xd6d6('0x28')]=qs[_0xd6d6('0x28')](_0x4eec65['query'][_0xd6d6('0x28')]);}return _0x5ba33e[_0xd6d6('0xed')](_0x543cba);}})[_0xd6d6('0x1a')](function(_0x619b5a){if(_0x619b5a){return _0x619b5a?{'count':_0x237092,'rows':_0x619b5a}:null;}})[_0xd6d6('0x1a')](respondWithResult(_0x269854,null))[_0xd6d6('0x56')](handleError(_0x269854,null));};exports['getAgents']=function(_0x146596,_0x57a095,_0x3c47ed){var _0x21214a={};var _0x2130b6={};var _0x4efd81;var _0x2950b4;return db[_0xd6d6('0x3c')][_0xd6d6('0xae')]({'where':{'id':_0x146596[_0xd6d6('0x58')]['id']}})[_0xd6d6('0x1a')](handleEntityNotFound(_0x57a095,null))[_0xd6d6('0x1a')](function(_0x13b884){if(_0x13b884){_0x4efd81=_0x13b884;_0x2130b6[_0xd6d6('0x44')]=_['keys'](db['User']['rawAttributes']);_0x2130b6['query']=_[_0xd6d6('0x42')](_0x146596['query']);_0x2130b6[_0xd6d6('0x4b')]=_[_0xd6d6('0x43')](_0x2130b6[_0xd6d6('0x44')],_0x2130b6[_0xd6d6('0x41')]);_0x21214a[_0xd6d6('0x45')]=_[_0xd6d6('0x43')](_0x2130b6['model'],qs[_0xd6d6('0x46')](_0x146596[_0xd6d6('0x41')]['fields']));_0x21214a[_0xd6d6('0x45')]=_0x21214a['attributes'][_0xd6d6('0x47')]?_0x21214a[_0xd6d6('0x45')]:_0x2130b6[_0xd6d6('0x44')];_0x21214a['order']=qs[_0xd6d6('0x4a')](_0x146596[_0xd6d6('0x41')][_0xd6d6('0x4a')]);_0x21214a['where']=qs[_0xd6d6('0x4b')](_[_0xd6d6('0xb5')](_0x146596[_0xd6d6('0x41')],_0x2130b6[_0xd6d6('0x4b')]));if(_0x146596['query']['filter']){_0x21214a[_0xd6d6('0x4c')]=_[_0xd6d6('0x50')](_0x21214a[_0xd6d6('0x4c')],{'$or':_[_0xd6d6('0x34')](_0x21214a[_0xd6d6('0x45')],function(_0x486d87){var _0xe189cf={};_0xe189cf[_0x486d87]={'$like':'%'+_0x146596[_0xd6d6('0x41')][_0xd6d6('0x32')]+'%'};return _0xe189cf;})});}_0x21214a['model']=db[_0xd6d6('0x3c')];_0x21214a['as']='Agents';_0x21214a=_[_0xd6d6('0x50')]({},_0x21214a,_0x146596[_0xd6d6('0x51')]);return _0x4efd81[_0xd6d6('0xcf')]({'include':[_0x21214a]});}})['then'](function(_0x5c347d){if(_0x5c347d){var _0x43aa48={},_0xa0dece=[],_0x215727=0x0;for(var _0x48fd25=0x0;_0x48fd25<_0x5c347d[_0xd6d6('0x47')];_0x48fd25+=0x1){for(var _0x19961e=0x0,_0x2fb834;_0x19961e<_0x5c347d[_0x48fd25][_0xd6d6('0x81')][_0xd6d6('0x47')];_0x19961e+=0x1){_0x2fb834=_0x5c347d[_0x48fd25][_0xd6d6('0x81')][_0x19961e]['get']({'plain':!![]});_0x43aa48[_0x2fb834['id']]=_0x2fb834;}}_0x43aa48=_['values'](_0x43aa48);for(var _0x172792=qs[_0xd6d6('0x28')](_0x146596['query'][_0xd6d6('0x28')]);_0x172792<_0x43aa48[_0xd6d6('0x47')]&&_0xa0dece[_0xd6d6('0x47')]=_0x1415e6){_0x532dab=_0x1415e6;_0x359eb4=0xc8;}else{_0x359eb4=0xce;}_0x67cf80[_0x25cd('0x2b')](_0x359eb4);return _0x67cf80[_0x25cd('0x30')]('Content-Range',_0x2fea41+'-'+_0x532dab+'/'+_0x1415e6)[_0x25cd('0x2d')](_0x3bc06e);}return null;};}function patchUpdates(_0x4e4e76){return function(_0x1ce186){try{jsonpatch['apply'](_0x1ce186,_0x4e4e76,!![]);}catch(_0x367a29){return BPromise['reject'](_0x367a29);}return _0x1ce186['save']();};}function saveUpdates(_0x428b44,_0x5ea4fd){return function(_0x46b7bb){if(_0x46b7bb){return _0x46b7bb['update'](_0x428b44)['then'](function(_0x4aa6a4){return _0x4aa6a4;});}return null;};}function removeEntity(_0x2e9c12,_0x4f34c6){return function(_0x3fbba3){if(_0x3fbba3){return _0x3fbba3[_0x25cd('0x31')]()[_0x25cd('0x1f')](function(){var _0x2f3b6f=_0x3fbba3[_0x25cd('0x32')]({'plain':!![]});var _0x161bbe=[{'name':'Users','value':_0x25cd('0x33'),'ignore':!![]},{'name':_0x25cd('0x34'),'value':'agent','ignore':![]},{'name':_0x25cd('0x35'),'value':_0x25cd('0x36'),'ignore':![]}];var _0x414d7d=_(_0x161bbe)['filter'](_0x25cd('0x37'))[_0x25cd('0x38')](_0x25cd('0x39'))['value']();if(_[_0x25cd('0x3a')](_0x414d7d,_0x2f3b6f[_0x25cd('0x3b')])){return;}var _0x17e907=_[_0x25cd('0x3c')](_0x161bbe,[_0x25cd('0x39'),_0x2f3b6f[_0x25cd('0x3b')]])['name'];return db[_0x25cd('0x3d')]['destroy']({'where':{'type':_0x17e907,'resourceId':_0x2f3b6f['id']}})[_0x25cd('0x1f')](function(){return _0x3fbba3;});})[_0x25cd('0x1f')](function(){_0x2e9c12[_0x25cd('0x2b')](0xcc)[_0x25cd('0x2c')]();});}};}function handleEntityNotFound(_0x54e783,_0x2b742f){return function(_0x4e1789){if(!_0x4e1789){_0x54e783[_0x25cd('0x2a')](0x194);}return _0x4e1789;};}function handleError(_0xf070a2,_0x32cdee){_0x32cdee=_0x32cdee||0x1f4;return function(_0x5cd632){logger[_0x25cd('0x25')](_0x5cd632[_0x25cd('0x3e')]);if(_0x5cd632[_0x25cd('0x3f')]){delete _0x5cd632[_0x25cd('0x3f')];}_0xf070a2['status'](_0x32cdee)['send'](_0x5cd632);};}exports[_0x25cd('0x40')]=function(_0x31c9da,_0x2f1b23){var _0x489092={},_0x2549ee={},_0x46b4c2={'count':0x0,'rows':[]};var _0x30b7b0=db[_0x25cd('0x41')][_0x25cd('0x42')];_0x2549ee[_0x25cd('0x43')]=_[_0x25cd('0x44')](_['keys'](_0x30b7b0),[_0x25cd('0x45'),_0x25cd('0x46')]);_0x2549ee[_0x25cd('0x47')]=_['keys'](_0x31c9da['query']);_0x2549ee[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x2549ee[_0x25cd('0x43')],_0x2549ee[_0x25cd('0x47')]);_0x489092['attributes']=_[_0x25cd('0x49')](_0x2549ee[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x31c9da[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x489092[_0x25cd('0x4b')]=_0x489092['attributes']['length']?_0x489092[_0x25cd('0x4b')]:_0x2549ee['model'];if(!_0x31c9da['query'][_0x25cd('0x4c')](_0x25cd('0x4d'))){_0x489092[_0x25cd('0x4e')]=qs['limit'](_0x31c9da[_0x25cd('0x47')][_0x25cd('0x4e')]);_0x489092[_0x25cd('0x2f')]=qs['offset'](_0x31c9da['query'][_0x25cd('0x2f')]);}_0x489092[_0x25cd('0x4f')]=qs[_0x25cd('0x50')](_0x31c9da[_0x25cd('0x47')]['sort']);_0x489092[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_['pick'](_0x31c9da['query'],_0x2549ee[_0x25cd('0x48')]));if(_0x31c9da[_0x25cd('0x47')][_0x25cd('0x52')]){_0x489092['where']=_[_0x25cd('0x53')](_0x489092['where'],{'$or':_[_0x25cd('0x38')](_0x30b7b0,function(_0x265fe0){return db['sequelize'][_0x25cd('0x51')](db[_0x25cd('0x54')]['fn'](_0x25cd('0x55'),db[_0x25cd('0x54')][_0x25cd('0x56')](_0x265fe0[_0x25cd('0x57')])),{'$like':db[_0x25cd('0x54')]['fn'](_0x25cd('0x55'),'%'+_0x31c9da[_0x25cd('0x47')][_0x25cd('0x52')]+'%')});})});}_0x489092=_[_0x25cd('0x53')]({},_0x489092,_0x31c9da[_0x25cd('0x58')]);var _0x4088d5={'where':_0x489092[_0x25cd('0x51')]};return db[_0x25cd('0x41')][_0x25cd('0x2e')](_0x4088d5)[_0x25cd('0x1f')](function(_0x4110d5){_0x46b4c2['count']=_0x4110d5;if(_0x31c9da[_0x25cd('0x47')][_0x25cd('0x59')]){_0x489092['include']=[{'all':!![]}];}return db[_0x25cd('0x41')][_0x25cd('0x5a')](_0x489092);})['then'](function(_0x4ed96d){_0x46b4c2['rows']=_0x4ed96d;return _0x46b4c2;})[_0x25cd('0x1f')](respondWithFilteredResult(_0x2f1b23,_0x489092))[_0x25cd('0x29')](handleError(_0x2f1b23,null));};exports['show']=function(_0x545986,_0x548890){var _0x2559b9={'raw':![],'where':{'id':_0x545986[_0x25cd('0x5b')]['id']}},_0x3048bb={};_0x3048bb['model']=_['differenceBy'](_[_0x25cd('0x5c')](db[_0x25cd('0x41')][_0x25cd('0x42')]),[_0x25cd('0x45'),_0x25cd('0x46')]);_0x3048bb[_0x25cd('0x47')]=_[_0x25cd('0x5c')](_0x545986[_0x25cd('0x47')]);_0x3048bb[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x3048bb[_0x25cd('0x43')],_0x3048bb[_0x25cd('0x47')]);_0x2559b9[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0x3048bb['model'],qs['fields'](_0x545986[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x2559b9[_0x25cd('0x4b')]=_0x2559b9[_0x25cd('0x4b')][_0x25cd('0x5d')]?_0x2559b9[_0x25cd('0x4b')]:_0x3048bb[_0x25cd('0x43')];if(_0x545986[_0x25cd('0x47')][_0x25cd('0x59')]){_0x2559b9['include']=[{'all':!![]}];}_0x2559b9=_[_0x25cd('0x53')]({},_0x2559b9,_0x545986[_0x25cd('0x58')]);return db[_0x25cd('0x41')][_0x25cd('0x3c')](_0x2559b9)[_0x25cd('0x1f')](handleEntityNotFound(_0x548890,null))['then'](respondWithResult(_0x548890,null))[_0x25cd('0x29')](handleError(_0x548890,null));};exports['bulkCreate']=function(_0x5000b0,_0x94a362){return db['User'][_0x25cd('0x5e')](_0x5000b0[_0x25cd('0x5f')],{'raw':![],'individualHooks':!![]})[_0x25cd('0x1f')](respondWithResult(_0x94a362,0xc9))[_0x25cd('0x29')](handleError(_0x94a362,null));};exports[_0x25cd('0x60')]=function(_0x17f1bb,_0x3437f7){if(_0x17f1bb[_0x25cd('0x5f')]['id']){delete _0x17f1bb[_0x25cd('0x5f')]['id'];}delete _0x17f1bb[_0x25cd('0x5f')][_0x25cd('0x3b')];return db[_0x25cd('0x41')]['find']({'where':{'id':_0x17f1bb['params']['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x3437f7,null))['then'](saveUpdates(_0x17f1bb['body'],null))[_0x25cd('0x1f')](respondWithResult(_0x3437f7,null))[_0x25cd('0x29')](handleError(_0x3437f7,null));};exports['describe']=function(_0x4791e0,_0x3795f4){return db[_0x25cd('0x41')][_0x25cd('0x61')]()[_0x25cd('0x1f')](respondWithResult(_0x3795f4,null))[_0x25cd('0x29')](handleError(_0x3795f4,null));};exports[_0x25cd('0x62')]=function(_0x5279b9,_0x2ebd9d,_0x1a81fc){return db[_0x25cd('0x41')][_0x25cd('0x3c')]({'where':{'id':_0x5279b9[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x2ebd9d,null))['then'](function(_0x2219da){if(_0x2219da){return _0x2219da[_0x25cd('0x62')](_0x5279b9[_0x25cd('0x5f')][_0x25cd('0x63')],_[_0x25cd('0x64')](_0x5279b9[_0x25cd('0x5f')],[_0x25cd('0x63'),'id'])||{});}})[_0x25cd('0x1f')](respondWithResult(_0x2ebd9d,null))['catch'](handleError(_0x2ebd9d,null));};var getLicense=function(_0x31b881){return new BPromise(function(_0x3b59f6,_0x42659f){var _0x286d1d=0x0;_0x31b881[_0x25cd('0x5f')][_0x25cd('0x3b')]==='agent'&&_0x3b59f6('agent\x20role');return db[_0x25cd('0x41')]['count']({'where':{'$or':[{'role':_0x31b881[_0x25cd('0x5f')][_0x25cd('0x3b')]===_0x25cd('0x36')?_0x25cd('0x36'):[_0x25cd('0x65'),_0x25cd('0x33')]}]}})[_0x25cd('0x1f')](function(_0x35021c){_0x286d1d=_0x35021c;return require(_0x25cd('0x66'))['getLicense']();})['then'](function(_0x8d46c4){var _0x5a1977=_0x31b881[_0x25cd('0x5f')][_0x25cd('0x3b')]===_0x25cd('0x36')?'telephones':_0x25cd('0x67');if(!_[_0x25cd('0x68')](_0x8d46c4[_0x5a1977])&&_0x286d1d>=_0x8d46c4[_0x5a1977]){return _0x42659f({'message':_0x25cd('0x69')});}return _0x3b59f6(util[_0x25cd('0x6a')](_0x25cd('0x6b'),_0x5a1977,_0x286d1d));})[_0x25cd('0x29')](function(_0x1c8b54){return _0x42659f(_0x1c8b54);});});};exports[_0x25cd('0x6c')]=function(_0x293a3a,_0x573b32){return getLicense(_0x293a3a)[_0x25cd('0x1f')](function(_0x7cae38){if(!_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x6d')]){var _0x4759a8;return db['Setting']['findById'](0x1)[_0x25cd('0x1f')](function(_0x2ed746){_0x4759a8=_0x2ed746['min_internal'];return db[_0x25cd('0x41')][_0x25cd('0x6e')]('internal');})[_0x25cd('0x1f')](function(_0x3b01f7){if(_[_0x25cd('0x68')](_0x3b01f7)){if(_0x4759a8){_0x293a3a['body'][_0x25cd('0x6d')]=_0x4759a8;}else{_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x6d')]=0x1;}}else{if(_[_0x25cd('0x68')](_0x4759a8)||_0x4759a8==_0x3b01f7){_0x293a3a[_0x25cd('0x5f')]['internal']=_0x3b01f7+0x1;}else if(_0x4759a8>_0x3b01f7){_0x293a3a['body'][_0x25cd('0x6d')]=_0x4759a8;}else{return db[_0x25cd('0x54')]['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[_0x25cd('0x54')][_0x25cd('0x6f')][_0x25cd('0x70')]})[_0x25cd('0x1f')](function(_0x595669){if(_0x595669&&_0x595669[_0x25cd('0x5d')]){for(var _0x955599=0x0,_0x383e14=_0x595669[_0x25cd('0x5d')];_0x955599<_0x383e14&&_[_0x25cd('0x68')](_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x6d')]);_0x955599++){if(_0x4759a8<=_0x595669[_0x955599][_0x25cd('0x71')]){_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x6d')]=_0x595669[_0x955599][_0x25cd('0x71')];}else if(_0x4759a8>_0x595669[_0x955599][_0x25cd('0x71')]&&_0x4759a8<=_0x595669[_0x955599]['to']){_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x6d')]=_0x4759a8;}}}if(_[_0x25cd('0x68')](_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x6d')])){_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x6d')]=_0x3b01f7+0x1;}});}}});}})[_0x25cd('0x1f')](function(){if(_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x72')]){_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x73')]=_0x293a3a[_0x25cd('0x5f')]['internal'];_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x74')]={'mailbox':_0x293a3a[_0x25cd('0x5f')]['internal'],'password':_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x45')],'fullname':_0x293a3a[_0x25cd('0x5f')]['fullname'],'email':_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x75')]};}if(_0x293a3a[_0x25cd('0x5f')]&&_0x293a3a[_0x25cd('0x5f')]['role']===_0x25cd('0x76')){_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x77')]=[_0x25cd('0x78'),_0x25cd('0x79'),_0x25cd('0x7a'),'110',_0x25cd('0x7b'),_0x25cd('0x7c'),_0x25cd('0x7d'),'107',_0x25cd('0x7e'),'109',_0x25cd('0x7f'),_0x25cd('0x80')];}return db[_0x25cd('0x41')][_0x25cd('0x6c')](_0x293a3a[_0x25cd('0x5f')],{'include':[{'model':db[_0x25cd('0x74')],'as':_0x25cd('0x74')}]});})[_0x25cd('0x1f')](function(_0x1dd110){if(_0x293a3a[_0x25cd('0x5f')][_0x25cd('0x3b')]===_0x25cd('0x33'))return _0x1dd110;var _0x7ccf55=_0x293a3a[_0x25cd('0x33')][_0x25cd('0x32')]({'plain':!![]});if(!_0x7ccf55)throw new Error(_0x25cd('0x81'));if(_0x7ccf55[_0x25cd('0x3b')]===_0x25cd('0x33')){var _0x2ee002=_0x1dd110[_0x25cd('0x32')]({'plain':!![]});var _0x20360f=[{'name':_0x25cd('0x34'),'value':'agent'},{'name':'Telephones','value':'telephone'}];var _0x1d2d32=_[_0x25cd('0x3c')](_0x20360f,[_0x25cd('0x39'),_0x2ee002[_0x25cd('0x3b')]])[_0x25cd('0x3f')];return db[_0x25cd('0x82')][_0x25cd('0x3c')]({'where':{'name':_0x1d2d32,'userProfileId':_0x7ccf55[_0x25cd('0x83')]},'raw':!![]})['then'](function(_0x34c08a){if(_0x34c08a&&_0x34c08a[_0x25cd('0x84')]===0x0){return db[_0x25cd('0x3d')][_0x25cd('0x6c')]({'name':_0x2ee002[_0x25cd('0x3f')],'resourceId':_0x2ee002['id'],'type':_0x34c08a[_0x25cd('0x3f')],'sectionId':_0x34c08a['id']},{})['then'](function(){return _0x1dd110;});}else{return _0x1dd110;}})['catch'](function(_0x330720){logger['error'](_0x25cd('0x85'),_0x330720);throw _0x330720;});}return _0x1dd110;})[_0x25cd('0x1f')](respondWithResult(_0x573b32,0xc9))[_0x25cd('0x29')](handleError(_0x573b32,null));};exports[_0x25cd('0x86')]=function(_0x18a41a,_0x3a666f,_0x1f0cae){if(_0x18a41a['body']['id']){delete _0x18a41a[_0x25cd('0x5f')]['id'];}return db[_0x25cd('0x41')][_0x25cd('0x3c')]({'where':{'id':_0x18a41a[_0x25cd('0x5b')]['id']}})['then'](function(_0x38761f){if(_0x38761f){if(_0x38761f['id']==_0x18a41a['user']['id']){if(!_0x18a41a[_0x25cd('0x5f')][_0x25cd('0x87')]||!_0x18a41a[_0x25cd('0x5f')]['newPassword']){throw new db['Sequelize'][(_0x25cd('0x88'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x38761f[_0x25cd('0x89')](_0x18a41a[_0x25cd('0x5f')][_0x25cd('0x87')])){throw new db[(_0x25cd('0x8a'))][(_0x25cd('0x88'))](_0x25cd('0x8b'));}if(_0x18a41a[_0x25cd('0x5f')][_0x25cd('0x87')]==_0x18a41a[_0x25cd('0x5f')]['newPassword']){throw new db[(_0x25cd('0x8a'))][(_0x25cd('0x88'))](_0x25cd('0x8c'));}return _0x38761f;}else if(_0x18a41a[_0x25cd('0x33')]['role']==_0x25cd('0x65')){if(!_0x18a41a['body'][_0x25cd('0x8d')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x38761f;}else if(_0x18a41a[_0x25cd('0x33')][_0x25cd('0x3b')]==_0x25cd('0x33')){if(!_0x18a41a['body'][_0x25cd('0x8d')]){throw new db[(_0x25cd('0x8a'))]['ValidationError'](_0x25cd('0x8e'));}if(_0x38761f[_0x25cd('0x3b')]!='agent'){throw new db[(_0x25cd('0x8a'))][(_0x25cd('0x88'))](_0x25cd('0x8f'));}return _0x38761f;}else{throw new db[(_0x25cd('0x8a'))][(_0x25cd('0x88'))](_0x25cd('0x8f'));}}return null;})['then'](handleEntityNotFound(_0x3a666f,null))[_0x25cd('0x1f')](saveUpdates({'password':_0x18a41a[_0x25cd('0x5f')][_0x25cd('0x8d')],'passwordResetAt':_0x18a41a['user']['id']==_0x18a41a[_0x25cd('0x5b')]['id']?moment():null},null))[_0x25cd('0x1f')](respondWithResult(_0x3a666f,null))[_0x25cd('0x29')](handleError(_0x3a666f,null));};exports[_0x25cd('0x90')]=function(_0x2f3253,_0x58cea1,_0xf4e395){var _0x382141;return db[_0x25cd('0x41')][_0x25cd('0x3c')]({'where':{'id':_0x2f3253[_0x25cd('0x5b')]['id']},'attributes':['id',_0x25cd('0x3f'),_0x25cd('0x3b'),_0x25cd('0x91'),_0x25cd('0x92'),_0x25cd('0x93')]})[_0x25cd('0x1f')](handleEntityNotFound(_0x58cea1,null))[_0x25cd('0x1f')](function(_0x51cca5){if(_0x51cca5){_0x382141=_0x51cca5;if(!utils[_0x25cd('0x94')](_0x2f3253['body']['channel'])){throw new db['Sequelize']['ValidationError'](_0x25cd('0x95'));}return _0x51cca5[_0x25cd('0x96')+_[_0x25cd('0x97')](_0x2f3253['body'][_0x25cd('0x98')][_0x25cd('0x99')]())+_0x25cd('0x9a')](_0x2f3253[_0x25cd('0x5f')][_0x25cd('0x63')],{'penalty':_0x2f3253[_0x25cd('0x5f')][_0x25cd('0x9b')]||0x0});}})[_0x25cd('0x9c')](function(_0x457830){for(var _0x288079=0x0;_0x288079<_0x2f3253[_0x25cd('0x5f')][_0x25cd('0x63')]['length'];_0x288079+=0x1){var _0x58cc6b={'UserId':_0x2f3253['params']['id']};_0x58cc6b[_[_0x25cd('0x97')](_0x2f3253['body'][_0x25cd('0x98')]['toLowerCase']())+_0x25cd('0x9d')]=_0x2f3253[_0x25cd('0x5f')]['ids'][_0x288079];socket[_0x25cd('0x9e')](_0x25cd('0x33')+_['capitalize'](_0x2f3253[_0x25cd('0x5f')][_0x25cd('0x98')]['toLowerCase']())+'Queue:save',_0x58cc6b);}return _0x457830;})['then'](function(){if(_0x2f3253['body']['channel']===_0x25cd('0x9f')){return db['VoiceQueue'][_0x25cd('0x5a')]({'where':{'id':_0x2f3253[_0x25cd('0x5f')][_0x25cd('0x63')]||[]},'raw':!![],'attributes':['id',_0x25cd('0x3f')]});}})[_0x25cd('0x1f')](function(_0x11de01){var _0x4669ff=[];if(_0x2f3253[_0x25cd('0x5f')][_0x25cd('0x98')]===_0x25cd('0x9f')&&_0x382141[_0x25cd('0x3b')]==='agent'){for(var _0x2585cd=0x0;_0x2585cd<_0x11de01[_0x25cd('0x5d')];_0x2585cd+=0x1){_0x4669ff[_0x25cd('0xa0')]({'membername':_0x382141[_0x25cd('0x3f')],'UserId':_0x382141['id'],'queue_name':_0x11de01[_0x2585cd][_0x25cd('0x3f')],'VoiceQueueId':_0x11de01[_0x2585cd]['id'],'interface':_['isNil'](_0x382141[_0x25cd('0x93')])?util[_0x25cd('0x6a')](_0x25cd('0xa1'),_0x382141[_0x25cd('0x3f')]):_0x382141[_0x25cd('0x93')],'paused':_0x382141[_0x25cd('0x92')]||![],'penalty':_0x2f3253[_0x25cd('0x5f')][_0x25cd('0x9b')]||0x0});}return BPromise[_0x25cd('0xa2')](_0x4669ff,function(_0x47c880){return db[_0x25cd('0xa3')][_0x25cd('0xa4')](_0x47c880);});}return _0x382141;})['then'](respondWithStatusCode(_0x58cea1,null))[_0x25cd('0x29')](handleError(_0x58cea1,null));};exports[_0x25cd('0xa5')]=function(_0x446998,_0x35cca8,_0x510f39){var _0xd53202;return db['User'][_0x25cd('0x3c')]({'where':{'id':_0x446998[_0x25cd('0x5b')]['id']},'attributes':['id',_0x25cd('0x3f'),_0x25cd('0x3b')]})['then'](handleEntityNotFound(_0x35cca8,null))['then'](function(_0x4bf701){if(_0x4bf701){_0xd53202=_0x4bf701;if(!_0x446998[_0x25cd('0x47')]['channel']||!utils[_0x25cd('0x94')](_0x446998[_0x25cd('0x47')][_0x25cd('0x98')])){throw new db[(_0x25cd('0x8a'))]['ValidationError']('Unknown\x20channel');}return _0x4bf701[_0x25cd('0xa6')+_[_0x25cd('0x97')](_0x446998[_0x25cd('0x47')][_0x25cd('0x98')]['toLowerCase']())+'Queues'](_0x446998[_0x25cd('0x47')][_0x25cd('0x63')]);}})[_0x25cd('0x1f')](function(_0x4e26eb){for(var _0x1cabc0=0x0;_0x1cabc0<_0x446998[_0x25cd('0x47')][_0x25cd('0x63')][_0x25cd('0x5d')];_0x1cabc0+=0x1){var _0x1ee573={'UserId':_0x446998['params']['id']};_0x1ee573[_[_0x25cd('0x97')](_0x446998[_0x25cd('0x47')][_0x25cd('0x98')][_0x25cd('0x99')]())+'QueueId']=_0x446998['query'][_0x25cd('0x63')][_0x1cabc0];socket[_0x25cd('0x9e')](_0x25cd('0x33')+_[_0x25cd('0x97')](_0x446998['query'][_0x25cd('0x98')][_0x25cd('0x99')]())+_0x25cd('0xa7'),_0x1ee573);}return _0x4e26eb;})[_0x25cd('0x1f')](function(){if(_0x446998['query'][_0x25cd('0x98')]===_0x25cd('0x9f')){return db[_0x25cd('0xa3')][_0x25cd('0x31')]({'where':{'UserId':_0x446998['params']['id'],'VoiceQueueId':_0x446998[_0x25cd('0x47')][_0x25cd('0x63')]},'individualHooks':!![]})['then'](function(){return _0xd53202;});}return _0xd53202;})['then'](respondWithStatusCode(_0x35cca8,null))[_0x25cd('0x29')](handleError(_0x35cca8,null));};exports['addAvatar']=function(_0x1b7159,_0x2c8e40,_0x4c8abb){_0x1b7159[_0x25cd('0x5f')]['userpic']=_0x1b7159['file'][_0x25cd('0xa8')];return db['User'][_0x25cd('0x3c')]({'where':{'id':_0x1b7159['params']['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x2c8e40,null))['then'](saveUpdates(_0x1b7159[_0x25cd('0x5f')],null))[_0x25cd('0x1f')](respondWithResult(_0x2c8e40,null))[_0x25cd('0x29')](handleError(_0x2c8e40,null));};exports['getAvatar']=function(_0x3d76c5,_0x49cf4d,_0x1120bf){var _0x478c5e=path[_0x25cd('0xa9')](config[_0x25cd('0xaa')],_0x25cd('0xab'));return db[_0x25cd('0x41')][_0x25cd('0x3c')]({'where':{'id':_0x3d76c5[_0x25cd('0x5b')]['id']},'attributes':['id',_0x25cd('0xac')],'raw':!![]})['then'](handleEntityNotFound(_0x49cf4d,null))['then'](function(_0x260814){if(_0x260814){if(_['isNil'](_0x260814[_0x25cd('0xac')])){return _0x49cf4d[_0x25cd('0xad')](_0x478c5e);}else{if(!fs[_0x25cd('0xae')](path[_0x25cd('0xa9')](config[_0x25cd('0xaa')],_0x25cd('0xaf'),_0x260814[_0x25cd('0xac')]))){return _0x49cf4d['download'](_0x478c5e);}return _0x49cf4d[_0x25cd('0xad')](path[_0x25cd('0xa9')](config[_0x25cd('0xaa')],'server/files/images/',_0x260814[_0x25cd('0xac')]));}}})[_0x25cd('0x29')](handleError(_0x49cf4d,null));};exports[_0x25cd('0xb0')]=function(_0x79f4e3,_0x303c32,_0x34a563){var _0x41eb0a={};var _0x174769={};var _0x2ab997;var _0x218b33;return db[_0x25cd('0x41')][_0x25cd('0xb1')]({'where':{'id':_0x79f4e3[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x303c32,null))['then'](function(_0x20f12c){if(_0x20f12c){_0x2ab997=_0x20f12c;_0x174769['model']=_[_0x25cd('0x5c')](db['CmContact']['rawAttributes']);_0x174769['query']=_[_0x25cd('0x5c')](_0x79f4e3[_0x25cd('0x47')]);_0x174769[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x174769[_0x25cd('0x43')],_0x174769[_0x25cd('0x47')]);_0x41eb0a['attributes']=_['intersection'](_0x174769[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x79f4e3[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x41eb0a[_0x25cd('0x4b')]=_0x41eb0a[_0x25cd('0x4b')]['length']?_0x41eb0a[_0x25cd('0x4b')]:_0x174769[_0x25cd('0x43')];_0x41eb0a['order']=qs['sort'](_0x79f4e3[_0x25cd('0x47')][_0x25cd('0x50')]);_0x41eb0a[_0x25cd('0x51')]=qs['filters'](_[_0x25cd('0xb2')](_0x79f4e3[_0x25cd('0x47')],_0x174769[_0x25cd('0x48')]));if(_0x79f4e3[_0x25cd('0x47')][_0x25cd('0x52')]){_0x41eb0a[_0x25cd('0x51')]=_[_0x25cd('0x53')](_0x41eb0a['where'],{'$or':_['map'](_0x41eb0a[_0x25cd('0x4b')],function(_0x5a204d){var _0x44b4c4={};_0x44b4c4[_0x5a204d]={'$like':'%'+_0x79f4e3['query'][_0x25cd('0x52')]+'%'};return _0x44b4c4;})});}_0x41eb0a=_[_0x25cd('0x53')]({},_0x41eb0a,_0x79f4e3['options']);return _0x2ab997['getContacts'](_0x41eb0a);}})[_0x25cd('0x1f')](function(_0x48d5b3){if(_0x48d5b3){_0x218b33=_0x48d5b3['length'];if(_0x79f4e3[_0x25cd('0x47')][_0x25cd('0x4c')](_0x25cd('0x59'))){_0x41eb0a['include']=[{'model':db[_0x25cd('0xb3')],'as':_0x25cd('0xb4'),'required':![]},{'model':db['Tag'],'as':_0x25cd('0xb5'),'attributes':['id',_0x25cd('0x3f'),_0x25cd('0xb6')],'where':_0x79f4e3[_0x25cd('0x47')][_0x25cd('0xb7')]?{'id':_0x79f4e3['query'][_0x25cd('0xb7')]}:undefined,'required':_0x79f4e3[_0x25cd('0x47')][_0x25cd('0xb7')]?!![]:![]}];}if(!_0x79f4e3[_0x25cd('0x47')][_0x25cd('0x4c')]('nolimit')){_0x41eb0a[_0x25cd('0x4e')]=qs[_0x25cd('0x4e')](_0x79f4e3['query'][_0x25cd('0x4e')]);_0x41eb0a[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x79f4e3[_0x25cd('0x47')][_0x25cd('0x2f')]);}return _0x2ab997['getContacts'](_0x41eb0a);}})['then'](function(_0x683218){if(_0x683218){return _0x683218?{'count':_0x218b33,'rows':_0x683218}:null;}})[_0x25cd('0x1f')](respondWithResult(_0x303c32,null))[_0x25cd('0x29')](handleError(_0x303c32,null));};exports[_0x25cd('0xb8')]=function(_0x5a7f14,_0x937acc,_0x1275bc){var _0x4d8869;var _0x38eef2;var _0x401105={};var _0x4cf1a1;return db['User'][_0x25cd('0xb1')]({'where':{'id':_0x5a7f14[_0x25cd('0x5b')]['id']},'attributes':['id',_0x25cd('0x3f'),_0x25cd('0x3b')]})[_0x25cd('0x1f')](handleEntityNotFound(_0x937acc,null))[_0x25cd('0x1f')](function(_0x5f2b59){if(!utils[_0x25cd('0x94')](_0x5a7f14[_0x25cd('0x47')][_0x25cd('0x98')])){throw new db[(_0x25cd('0x8a'))][(_0x25cd('0x88'))](_0x25cd('0x95'));}_0x4d8869=_0x5f2b59;var _0x4c0d30={};_0x4c0d30['model']=_[_0x25cd('0x5c')](db[_[_0x25cd('0x97')](_0x5a7f14[_0x25cd('0x47')][_0x25cd('0x98')])+_0x25cd('0xb9')]['rawAttributes']);_0x4c0d30['query']=_[_0x25cd('0x5c')](_0x5a7f14[_0x25cd('0x47')]);_0x4c0d30[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x4c0d30['model'],_0x4c0d30['query']);_0x401105['attributes']=_[_0x25cd('0x49')](_0x4c0d30[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x5a7f14[_0x25cd('0x47')]['fields']));_0x401105[_0x25cd('0x4b')]=_0x401105[_0x25cd('0x4b')][_0x25cd('0x5d')]?_0x401105[_0x25cd('0x4b')]:_0x4c0d30[_0x25cd('0x43')];_0x401105['order']=qs[_0x25cd('0x50')](_0x5a7f14['query'][_0x25cd('0x50')]);_0x401105[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_[_0x25cd('0xb2')](_0x5a7f14[_0x25cd('0x47')],_0x4c0d30['filters']));if(_0x5a7f14[_0x25cd('0x47')][_0x25cd('0x52')]){_0x401105['where']=_[_0x25cd('0x53')](_0x401105['where'],{'$or':_['map'](_0x401105[_0x25cd('0x4b')],function(_0x1130e5){var _0x41061c={};_0x41061c[_0x1130e5]={'$like':'%'+_0x5a7f14[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0x41061c;})});}_0x401105=_[_0x25cd('0x53')]({},_0x401105,_0x5a7f14[_0x25cd('0x58')]);switch(_0x4d8869[_0x25cd('0x3b')]){case _0x25cd('0x65'):return db[_[_0x25cd('0x97')](_0x5a7f14['query'][_0x25cd('0x98')])+_0x25cd('0xb9')][_0x25cd('0x5a')](_0x401105);case'user':case'agent':return _0x4d8869[_0x25cd('0x32')+_[_0x25cd('0x97')](_0x5a7f14[_0x25cd('0x47')]['channel'])+_0x25cd('0x9a')](_0x401105);default:throw new db[(_0x25cd('0x8a'))][(_0x25cd('0x88'))](_0x25cd('0xba'));}})[_0x25cd('0x1f')](function(_0x3939ed){_0x4cf1a1=_0x3939ed[_0x25cd('0x5d')];if(!_0x5a7f14[_0x25cd('0x47')][_0x25cd('0x4c')](_0x25cd('0x4d'))){_0x401105[_0x25cd('0x4e')]=qs['limit'](_0x5a7f14[_0x25cd('0x47')]['limit']);_0x401105[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x5a7f14[_0x25cd('0x47')][_0x25cd('0x2f')]);}switch(_0x4d8869[_0x25cd('0x3b')]){case _0x25cd('0x65'):return db[_['capitalize'](_0x5a7f14['query'][_0x25cd('0x98')])+'Queue'][_0x25cd('0x5a')](_0x401105);case _0x25cd('0x33'):case _0x25cd('0x76'):return _0x4d8869['get'+_[_0x25cd('0x97')](_0x5a7f14[_0x25cd('0x47')]['channel'])+_0x25cd('0x9a')](_0x401105);}})[_0x25cd('0x1f')](function(_0x1fb048){return{'count':_0x4cf1a1,'rows':_0x1fb048};})[_0x25cd('0x1f')](respondWithResult(_0x937acc,null))['catch'](handleError(_0x937acc,null));};exports[_0x25cd('0xbb')]=function(_0x496f78,_0x25809a,_0x34984d){var _0x4d9348={};var _0x170f55={};var _0x46d1c2;var _0x32bf9d;return db[_0x25cd('0x41')][_0x25cd('0xb1')]({'where':{'id':_0x496f78[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x25809a,null))[_0x25cd('0x1f')](function(_0x31cee8){if(_0x31cee8){_0x46d1c2=_0x31cee8;_0x170f55[_0x25cd('0x43')]=_[_0x25cd('0x5c')](db[_0x25cd('0xa3')][_0x25cd('0x42')]);_0x170f55['query']=_[_0x25cd('0x5c')](_0x496f78[_0x25cd('0x47')]);_0x170f55[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x170f55[_0x25cd('0x43')],_0x170f55[_0x25cd('0x47')]);_0x4d9348['attributes']=_[_0x25cd('0x49')](_0x170f55['model'],qs[_0x25cd('0x4a')](_0x496f78[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x4d9348[_0x25cd('0x4b')]=_0x4d9348[_0x25cd('0x4b')]['length']?_0x4d9348[_0x25cd('0x4b')]:_0x170f55[_0x25cd('0x43')];_0x4d9348[_0x25cd('0x4f')]=qs[_0x25cd('0x50')](_0x496f78[_0x25cd('0x47')][_0x25cd('0x50')]);_0x4d9348[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_[_0x25cd('0xb2')](_0x496f78[_0x25cd('0x47')],_0x170f55['filters']));if(_0x496f78[_0x25cd('0x47')]['filter']){_0x4d9348['where']=_['merge'](_0x4d9348[_0x25cd('0x51')],{'$or':_['map'](_0x4d9348[_0x25cd('0x4b')],function(_0x478ab1){var _0x52c6ef={};_0x52c6ef[_0x478ab1]={'$like':'%'+_0x496f78[_0x25cd('0x47')]['filter']+'%'};return _0x52c6ef;})});}_0x4d9348=_[_0x25cd('0x53')]({},_0x4d9348,_0x496f78[_0x25cd('0x58')]);return _0x46d1c2[_0x25cd('0xbb')](_0x4d9348);}})[_0x25cd('0x1f')](function(_0x25ec75){if(_0x25ec75){_0x32bf9d=_0x25ec75['length'];if(!_0x496f78[_0x25cd('0x47')][_0x25cd('0x4c')](_0x25cd('0x4d'))){_0x4d9348['limit']=qs['limit'](_0x496f78[_0x25cd('0x47')][_0x25cd('0x4e')]);_0x4d9348[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x496f78[_0x25cd('0x47')][_0x25cd('0x2f')]);}return _0x46d1c2[_0x25cd('0xbb')](_0x4d9348);}})[_0x25cd('0x1f')](function(_0x32fa7e){if(_0x32fa7e){return _0x32fa7e?{'count':_0x32bf9d,'rows':_0x32fa7e}:null;}})[_0x25cd('0x1f')](respondWithResult(_0x25809a,null))[_0x25cd('0x29')](handleError(_0x25809a,null));};exports[_0x25cd('0xbc')]=function(_0x1aed3a,_0x1e23f4,_0x40305b){var _0x563404={};var _0x5236bc={};var _0x1b27d7;var _0x5c09fd;return db['User'][_0x25cd('0xb1')]({'where':{'id':_0x1aed3a['params']['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x1e23f4,null))[_0x25cd('0x1f')](function(_0x195280){if(_0x195280){_0x1b27d7=_0x195280;_0x5236bc[_0x25cd('0x43')]=_[_0x25cd('0x5c')](db[_0x25cd('0xbd')]['rawAttributes']);_0x5236bc['query']=_['keys'](_0x1aed3a[_0x25cd('0x47')]);_0x5236bc[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x5236bc[_0x25cd('0x43')],_0x5236bc[_0x25cd('0x47')]);_0x563404[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0x5236bc[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x1aed3a['query'][_0x25cd('0x4a')]));_0x563404[_0x25cd('0x4b')]=_0x563404[_0x25cd('0x4b')][_0x25cd('0x5d')]?_0x563404[_0x25cd('0x4b')]:_0x5236bc['model'];_0x563404['order']=qs[_0x25cd('0x50')](_0x1aed3a[_0x25cd('0x47')][_0x25cd('0x50')]);_0x563404['where']=qs[_0x25cd('0x48')](_[_0x25cd('0xb2')](_0x1aed3a[_0x25cd('0x47')],_0x5236bc['filters']));if(_0x1aed3a['query']['filter']){_0x563404['where']=_[_0x25cd('0x53')](_0x563404[_0x25cd('0x51')],{'$or':_['map'](_0x563404[_0x25cd('0x4b')],function(_0x529192){var _0x4d9c68={};_0x4d9c68[_0x529192]={'$like':'%'+_0x1aed3a[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0x4d9c68;})});}_0x563404=_['merge']({},_0x563404,_0x1aed3a['options']);return _0x1b27d7[_0x25cd('0xbc')](_0x563404);}})[_0x25cd('0x1f')](function(_0x43915b){if(_0x43915b){_0x5c09fd=_0x43915b[_0x25cd('0x5d')];if(!_0x1aed3a[_0x25cd('0x47')][_0x25cd('0x4c')]('nolimit')){_0x563404['limit']=qs[_0x25cd('0x4e')](_0x1aed3a[_0x25cd('0x47')]['limit']);_0x563404[_0x25cd('0x2f')]=qs['offset'](_0x1aed3a['query'][_0x25cd('0x2f')]);}return _0x1b27d7[_0x25cd('0xbc')](_0x563404);}})[_0x25cd('0x1f')](function(_0x5ceecd){if(_0x5ceecd){return _0x5ceecd?{'count':_0x5c09fd,'rows':_0x5ceecd}:null;}})[_0x25cd('0x1f')](respondWithResult(_0x1e23f4,null))['catch'](handleError(_0x1e23f4,null));};exports[_0x25cd('0xbe')]=function(_0x51f087,_0x4bc0f4,_0x168ed6){var _0x47504a={'raw':!![],'where':{}};var _0x596515={};var _0x215198={'count':0x0,'rows':[]};return db['User'][_0x25cd('0xb1')]({'where':{'id':_0x51f087['params']['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x4bc0f4,null))[_0x25cd('0x1f')](function(_0x5f6b52){if(_0x5f6b52){_0x596515[_0x25cd('0x43')]=_[_0x25cd('0x5c')](db[_0x25cd('0xbf')][_0x25cd('0x42')]);_0x596515[_0x25cd('0x47')]=_['keys'](_0x51f087[_0x25cd('0x47')]);_0x596515[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x596515[_0x25cd('0x43')],_0x596515[_0x25cd('0x47')]);_0x47504a[_0x25cd('0x4b')]=_['intersection'](_0x596515[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x51f087[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x47504a[_0x25cd('0x4b')]=_0x47504a[_0x25cd('0x4b')]['length']?_0x47504a['attributes']:_0x596515[_0x25cd('0x43')];if(!_0x51f087[_0x25cd('0x47')][_0x25cd('0x4c')](_0x25cd('0x4d'))){_0x47504a[_0x25cd('0x4e')]=qs['limit'](_0x51f087[_0x25cd('0x47')][_0x25cd('0x4e')]);_0x47504a[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x51f087['query'][_0x25cd('0x2f')]);}_0x47504a[_0x25cd('0x4f')]=qs['sort'](_0x51f087[_0x25cd('0x47')][_0x25cd('0x50')]);_0x47504a[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_[_0x25cd('0xb2')](_0x51f087[_0x25cd('0x47')],_0x596515['filters']));_0x47504a[_0x25cd('0x51')][_0x25cd('0xc0')]=_0x5f6b52['id'];if(_0x51f087[_0x25cd('0x47')][_0x25cd('0x52')]){_0x47504a['where']=_[_0x25cd('0x53')](_0x47504a[_0x25cd('0x51')],{'$or':_['map'](_0x47504a[_0x25cd('0x4b')],function(_0x4b6050){var _0xb9853={};_0xb9853[_0x4b6050]={'$like':'%'+_0x51f087[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0xb9853;})});}_0x47504a=_[_0x25cd('0x53')]({},_0x47504a,_0x51f087[_0x25cd('0x58')]);return db['VoiceRecording'][_0x25cd('0x2e')]({'where':_0x47504a[_0x25cd('0x51')]})[_0x25cd('0x1f')](function(_0x5cdca5){_0x215198[_0x25cd('0x2e')]=_0x5cdca5;if(_0x51f087[_0x25cd('0x47')][_0x25cd('0x59')]){_0x47504a['include']=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x47504a);})[_0x25cd('0x1f')](function(_0x3e7eca){_0x215198['rows']=_0x3e7eca;return _0x215198;});}})[_0x25cd('0x1f')](respondWithFilteredResult(_0x4bc0f4,_0x47504a))['catch'](handleError(_0x4bc0f4,null));};exports['getChatInteractions']=function(_0x4eaf28,_0x2497a4,_0x218ea5){var _0x3270de={};var _0x151a67={};var _0x622858;var _0x552f87;return db[_0x25cd('0x41')][_0x25cd('0xb1')]({'where':{'id':_0x4eaf28[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x2497a4,null))['then'](function(_0x5f2863){if(_0x5f2863){_0x622858=_0x5f2863;_0x151a67[_0x25cd('0x43')]=_['keys'](db[_0x25cd('0xc1')][_0x25cd('0x42')]);_0x151a67[_0x25cd('0x47')]=_[_0x25cd('0x5c')](_0x4eaf28['query']);_0x151a67[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x151a67[_0x25cd('0x43')],_0x151a67[_0x25cd('0x47')]);_0x3270de[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0x151a67[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x4eaf28['query'][_0x25cd('0x4a')]));_0x3270de[_0x25cd('0x4b')]=_0x3270de['attributes'][_0x25cd('0x5d')]?_0x3270de[_0x25cd('0x4b')]:_0x151a67['model'];_0x3270de[_0x25cd('0x4f')]=qs[_0x25cd('0x50')](_0x4eaf28[_0x25cd('0x47')][_0x25cd('0x50')]);_0x3270de[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_[_0x25cd('0xb2')](_0x4eaf28['query'],_0x151a67['filters']));if(_0x4eaf28['query'][_0x25cd('0x52')]){_0x3270de[_0x25cd('0x51')]=_[_0x25cd('0x53')](_0x3270de['where'],{'$or':_['map'](_0x3270de[_0x25cd('0x4b')],function(_0x502696){var _0x391683={};_0x391683[_0x502696]={'$like':'%'+_0x4eaf28[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0x391683;})});}_0x3270de=_[_0x25cd('0x53')]({},_0x3270de,_0x4eaf28['options']);return _0x622858[_0x25cd('0xc2')](_0x3270de);}})[_0x25cd('0x1f')](function(_0x1604e9){if(_0x1604e9){_0x552f87=_0x1604e9[_0x25cd('0x5d')];if(!_0x4eaf28['query']['hasOwnProperty'](_0x25cd('0x4d'))){_0x3270de[_0x25cd('0x4e')]=qs['limit'](_0x4eaf28[_0x25cd('0x47')][_0x25cd('0x4e')]);_0x3270de[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x4eaf28['query'][_0x25cd('0x2f')]);}return _0x622858[_0x25cd('0xc2')](_0x3270de);}})[_0x25cd('0x1f')](function(_0x2ccd94){if(_0x2ccd94){return _0x2ccd94?{'count':_0x552f87,'rows':_0x2ccd94}:null;}})[_0x25cd('0x1f')](respondWithResult(_0x2497a4,null))[_0x25cd('0x29')](handleError(_0x2497a4,null));};exports['getOpenchannelInteractions']=function(_0x5b1ba2,_0x56770c,_0x495540){var _0x408119={};var _0xf079a6={};var _0x2e2013;var _0x3ac6d5;return db[_0x25cd('0x41')][_0x25cd('0xb1')]({'where':{'id':_0x5b1ba2[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x56770c,null))[_0x25cd('0x1f')](function(_0x41576f){if(_0x41576f){_0x2e2013=_0x41576f;_0xf079a6[_0x25cd('0x43')]=_[_0x25cd('0x5c')](db[_0x25cd('0xc3')][_0x25cd('0x42')]);_0xf079a6[_0x25cd('0x47')]=_['keys'](_0x5b1ba2[_0x25cd('0x47')]);_0xf079a6[_0x25cd('0x48')]=_['intersection'](_0xf079a6[_0x25cd('0x43')],_0xf079a6[_0x25cd('0x47')]);_0x408119[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0xf079a6[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x5b1ba2[_0x25cd('0x47')]['fields']));_0x408119[_0x25cd('0x4b')]=_0x408119[_0x25cd('0x4b')][_0x25cd('0x5d')]?_0x408119[_0x25cd('0x4b')]:_0xf079a6[_0x25cd('0x43')];_0x408119['order']=qs[_0x25cd('0x50')](_0x5b1ba2['query'][_0x25cd('0x50')]);_0x408119[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_[_0x25cd('0xb2')](_0x5b1ba2[_0x25cd('0x47')],_0xf079a6[_0x25cd('0x48')]));if(_0x5b1ba2[_0x25cd('0x47')]['filter']){_0x408119[_0x25cd('0x51')]=_[_0x25cd('0x53')](_0x408119['where'],{'$or':_[_0x25cd('0x38')](_0x408119['attributes'],function(_0x22c830){var _0x50e1af={};_0x50e1af[_0x22c830]={'$like':'%'+_0x5b1ba2[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0x50e1af;})});}_0x408119=_[_0x25cd('0x53')]({},_0x408119,_0x5b1ba2[_0x25cd('0x58')]);return _0x2e2013[_0x25cd('0xc4')](_0x408119);}})[_0x25cd('0x1f')](function(_0x487662){if(_0x487662){_0x3ac6d5=_0x487662[_0x25cd('0x5d')];if(!_0x5b1ba2[_0x25cd('0x47')][_0x25cd('0x4c')]('nolimit')){_0x408119[_0x25cd('0x4e')]=qs['limit'](_0x5b1ba2[_0x25cd('0x47')][_0x25cd('0x4e')]);_0x408119[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x5b1ba2[_0x25cd('0x47')][_0x25cd('0x2f')]);}return _0x2e2013['getOpenchannelInteractions'](_0x408119);}})[_0x25cd('0x1f')](function(_0x2e6567){if(_0x2e6567){return _0x2e6567?{'count':_0x3ac6d5,'rows':_0x2e6567}:null;}})[_0x25cd('0x1f')](respondWithResult(_0x56770c,null))[_0x25cd('0x29')](handleError(_0x56770c,null));};exports[_0x25cd('0xc5')]=function(_0x2e5bb9,_0x409ce1,_0x189526){var _0x57fa64={'raw':!![],'where':{}};var _0x4996cc={};var _0x53424c={'count':0x0,'rows':[]};return db['User'][_0x25cd('0xb1')]({'where':{'id':_0x2e5bb9[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x409ce1,null))[_0x25cd('0x1f')](function(_0x50089a){if(_0x50089a){_0x4996cc[_0x25cd('0x43')]=_[_0x25cd('0x5c')](db[_0x25cd('0xc6')][_0x25cd('0x42')]);_0x4996cc[_0x25cd('0x47')]=_[_0x25cd('0x5c')](_0x2e5bb9[_0x25cd('0x47')]);_0x4996cc['filters']=_[_0x25cd('0x49')](_0x4996cc[_0x25cd('0x43')],_0x4996cc[_0x25cd('0x47')]);_0x57fa64[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0x4996cc[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x2e5bb9['query'][_0x25cd('0x4a')]));_0x57fa64['attributes']=_0x57fa64[_0x25cd('0x4b')][_0x25cd('0x5d')]?_0x57fa64[_0x25cd('0x4b')]:_0x4996cc['model'];if(!_0x2e5bb9['query']['hasOwnProperty'](_0x25cd('0x4d'))){_0x57fa64[_0x25cd('0x4e')]=qs['limit'](_0x2e5bb9[_0x25cd('0x47')][_0x25cd('0x4e')]);_0x57fa64[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x2e5bb9[_0x25cd('0x47')][_0x25cd('0x2f')]);}_0x57fa64[_0x25cd('0x4f')]=qs[_0x25cd('0x50')](_0x2e5bb9[_0x25cd('0x47')]['sort']);_0x57fa64[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_[_0x25cd('0xb2')](_0x2e5bb9[_0x25cd('0x47')],_0x4996cc['filters']));_0x57fa64[_0x25cd('0x51')][_0x25cd('0xc0')]=_0x50089a['id'];if(_0x2e5bb9[_0x25cd('0x47')][_0x25cd('0x52')]){_0x57fa64[_0x25cd('0x51')]=_[_0x25cd('0x53')](_0x57fa64[_0x25cd('0x51')],{'$or':_['map'](_0x57fa64[_0x25cd('0x4b')],function(_0x37c002){var _0x1df496={};_0x1df496[_0x37c002]={'$like':'%'+_0x2e5bb9['query'][_0x25cd('0x52')]+'%'};return _0x1df496;})});}_0x57fa64=_['merge']({},_0x57fa64,_0x2e5bb9['options']);return db[_0x25cd('0xc6')][_0x25cd('0x2e')]({'where':_0x57fa64[_0x25cd('0x51')]})[_0x25cd('0x1f')](function(_0x2349f0){_0x53424c[_0x25cd('0x2e')]=_0x2349f0;if(_0x2e5bb9[_0x25cd('0x47')]['includeAll']){_0x57fa64[_0x25cd('0xc7')]=[{'all':!![]}];}return db['MailInteraction'][_0x25cd('0x5a')](_0x57fa64);})[_0x25cd('0x1f')](function(_0x138c74){_0x53424c[_0x25cd('0xc8')]=_0x138c74;return _0x53424c;});}})[_0x25cd('0x1f')](respondWithFilteredResult(_0x409ce1,_0x57fa64))[_0x25cd('0x29')](handleError(_0x409ce1,null));};exports[_0x25cd('0xc9')]=function(_0x2a0d80,_0x3e8af5,_0x504fba){var _0x47dac2={};var _0x4c34e6={};var _0x176956;var _0x28ad0f;return db[_0x25cd('0x41')][_0x25cd('0xb1')]({'where':{'id':_0x2a0d80[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x3e8af5,null))['then'](function(_0x3dfb56){if(_0x3dfb56){_0x176956=_0x3dfb56;_0x4c34e6['model']=_['keys'](db[_0x25cd('0xca')][_0x25cd('0x42')]);_0x4c34e6['query']=_[_0x25cd('0x5c')](_0x2a0d80['query']);_0x4c34e6[_0x25cd('0x48')]=_['intersection'](_0x4c34e6['model'],_0x4c34e6['query']);_0x47dac2[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0x4c34e6[_0x25cd('0x43')],qs['fields'](_0x2a0d80[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x47dac2['attributes']=_0x47dac2[_0x25cd('0x4b')][_0x25cd('0x5d')]?_0x47dac2[_0x25cd('0x4b')]:_0x4c34e6['model'];_0x47dac2[_0x25cd('0x4f')]=qs['sort'](_0x2a0d80[_0x25cd('0x47')][_0x25cd('0x50')]);_0x47dac2[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_['pick'](_0x2a0d80[_0x25cd('0x47')],_0x4c34e6[_0x25cd('0x48')]));if(_0x2a0d80[_0x25cd('0x47')][_0x25cd('0x52')]){_0x47dac2[_0x25cd('0x51')]=_['merge'](_0x47dac2[_0x25cd('0x51')],{'$or':_[_0x25cd('0x38')](_0x47dac2[_0x25cd('0x4b')],function(_0x797ef1){var _0x365f69={};_0x365f69[_0x797ef1]={'$like':'%'+_0x2a0d80['query'][_0x25cd('0x52')]+'%'};return _0x365f69;})});}_0x47dac2=_[_0x25cd('0x53')]({},_0x47dac2,_0x2a0d80[_0x25cd('0x58')]);return _0x176956[_0x25cd('0xc9')](_0x47dac2);}})[_0x25cd('0x1f')](function(_0xb20ede){if(_0xb20ede){_0x28ad0f=_0xb20ede[_0x25cd('0x5d')];if(!_0x2a0d80[_0x25cd('0x47')][_0x25cd('0x4c')](_0x25cd('0x4d'))){_0x47dac2[_0x25cd('0x4e')]=qs[_0x25cd('0x4e')](_0x2a0d80[_0x25cd('0x47')]['limit']);_0x47dac2[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x2a0d80['query'][_0x25cd('0x2f')]);}return _0x176956[_0x25cd('0xc9')](_0x47dac2);}})['then'](function(_0x256f87){if(_0x256f87){return _0x256f87?{'count':_0x28ad0f,'rows':_0x256f87}:null;}})[_0x25cd('0x1f')](respondWithResult(_0x3e8af5,null))[_0x25cd('0x29')](handleError(_0x3e8af5,null));};exports['getFaxInteractions']=function(_0x1bb6f8,_0x2dc4b6,_0x9c1e05){var _0xd21987={};var _0xe6cda3={};var _0x5ce588;var _0x213448;return db[_0x25cd('0x41')][_0x25cd('0xb1')]({'where':{'id':_0x1bb6f8[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x2dc4b6,null))[_0x25cd('0x1f')](function(_0x3dee57){if(_0x3dee57){_0x5ce588=_0x3dee57;_0xe6cda3[_0x25cd('0x43')]=_[_0x25cd('0x5c')](db[_0x25cd('0xcb')]['rawAttributes']);_0xe6cda3[_0x25cd('0x47')]=_[_0x25cd('0x5c')](_0x1bb6f8[_0x25cd('0x47')]);_0xe6cda3[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0xe6cda3[_0x25cd('0x43')],_0xe6cda3[_0x25cd('0x47')]);_0xd21987[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0xe6cda3[_0x25cd('0x43')],qs['fields'](_0x1bb6f8[_0x25cd('0x47')]['fields']));_0xd21987[_0x25cd('0x4b')]=_0xd21987[_0x25cd('0x4b')][_0x25cd('0x5d')]?_0xd21987['attributes']:_0xe6cda3[_0x25cd('0x43')];_0xd21987['order']=qs[_0x25cd('0x50')](_0x1bb6f8['query']['sort']);_0xd21987[_0x25cd('0x51')]=qs['filters'](_[_0x25cd('0xb2')](_0x1bb6f8[_0x25cd('0x47')],_0xe6cda3[_0x25cd('0x48')]));if(_0x1bb6f8[_0x25cd('0x47')][_0x25cd('0x52')]){_0xd21987['where']=_[_0x25cd('0x53')](_0xd21987[_0x25cd('0x51')],{'$or':_[_0x25cd('0x38')](_0xd21987['attributes'],function(_0x4ef001){var _0x5a8b0c={};_0x5a8b0c[_0x4ef001]={'$like':'%'+_0x1bb6f8[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0x5a8b0c;})});}_0xd21987=_[_0x25cd('0x53')]({},_0xd21987,_0x1bb6f8['options']);return _0x5ce588['getFaxInteractions'](_0xd21987);}})[_0x25cd('0x1f')](function(_0x446f2f){if(_0x446f2f){_0x213448=_0x446f2f[_0x25cd('0x5d')];if(!_0x1bb6f8[_0x25cd('0x47')]['hasOwnProperty'](_0x25cd('0x4d'))){_0xd21987['limit']=qs[_0x25cd('0x4e')](_0x1bb6f8[_0x25cd('0x47')][_0x25cd('0x4e')]);_0xd21987['offset']=qs[_0x25cd('0x2f')](_0x1bb6f8['query'][_0x25cd('0x2f')]);}return _0x5ce588[_0x25cd('0xcc')](_0xd21987);}})['then'](function(_0x46ecf6){if(_0x46ecf6){return _0x46ecf6?{'count':_0x213448,'rows':_0x46ecf6}:null;}})[_0x25cd('0x1f')](respondWithResult(_0x2dc4b6,null))[_0x25cd('0x29')](handleError(_0x2dc4b6,null));};exports[_0x25cd('0xcd')]=function(_0x32ecef,_0x217fcc,_0x2327b4){var _0x19dca6;var _0x2a4857;var _0x26c915;return db[_0x25cd('0x41')][_0x25cd('0x3c')]({'where':{'id':_0x32ecef['params']['id'],'role':_0x25cd('0x76')},'attributes':['id',_0x25cd('0x3f'),_0x25cd('0xce'),_0x25cd('0xcf'),_0x25cd('0x3b'),_0x25cd('0x6d'),_0x25cd('0x91')]})['then'](handleEntityNotFound(_0x217fcc,null))[_0x25cd('0x1f')](function(_0x1dc9b2){if(_0x1dc9b2){_0x19dca6=_0x1dc9b2;if(_0x32ecef[_0x25cd('0x5f')][_0x25cd('0x93')]){_0x26c915=util[_0x25cd('0x6a')](_0x25cd('0xd0'),_0x19dca6[_0x32ecef['body'][_0x25cd('0x93')]]);}else if(_0x32ecef[_0x25cd('0x5f')][_0x25cd('0xd1')]){_0x26c915=util[_0x25cd('0x6a')](_0x25cd('0xa1'),_0x32ecef[_0x25cd('0x5f')][_0x25cd('0xd1')]);}else{_0x26c915=util[_0x25cd('0x6a')](_0x25cd('0xa1'),_0x19dca6['name']);}socket['to'](util[_0x25cd('0x6a')](_0x25cd('0xd2'),_0x19dca6[_0x25cd('0x3f')]))[_0x25cd('0x9e')](_0x25cd('0xd3'),{'ip':_0x32ecef['headers'][_0x25cd('0xd4')]||_0x32ecef[_0x25cd('0xd5')][_0x25cd('0xd6')]||_0x32ecef[_0x25cd('0xd7')][_0x25cd('0xd6')]||_0x32ecef[_0x25cd('0xd5')][_0x25cd('0xd7')]['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x19dca6[_0x25cd('0x3f')]},'individualHooks':!![]});}})['then'](function(_0x1b7826){if(_0x19dca6){return _0x19dca6[_0x25cd('0xd8')]({'raw':!![]});}})[_0x25cd('0x1f')](function(_0x20df1d){var _0x4eaff1=[];if(_0x20df1d){_0x2a4857=_0x20df1d;if(_0x2a4857[_0x25cd('0x5d')]){for(var _0x2a3fb7=0x0;_0x2a3fb7<_0x2a4857[_0x25cd('0x5d')];_0x2a3fb7++){_0x4eaff1[_0x25cd('0xa0')]({'membername':_0x19dca6['name'],'UserId':_0x19dca6['id'],'queue_name':_0x2a4857[_0x2a3fb7]['name'],'VoiceQueueId':_0x2a4857[_0x2a3fb7]['id'],'interface':_0x26c915,'paused':_0x19dca6[_0x25cd('0x91')]||![],'penalty':_0x2a4857[_0x2a3fb7][_0x25cd('0xd9')]||0x0});}return BPromise['each'](_0x4eaff1,function(_0x49fbb6){return db['UserVoiceQueueRt'][_0x25cd('0xa4')](_0x49fbb6);});}}})[_0x25cd('0x1f')](function(){return db[_0x25cd('0xda')][_0x25cd('0x5a')]({'where':{'membername':_0x19dca6['name'],'exitAt':null}});})[_0x25cd('0x1f')](function(_0x5dad33){var _0x4edad7=[];_0x5dad33[_0x25cd('0xdb')](function(_0x1cd3f3){_0x4edad7[_0x25cd('0xa0')](_0x1cd3f3[_0x25cd('0x60')]({'exitAt':moment()[_0x25cd('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x25cd('0xdc')](_0x4edad7);})[_0x25cd('0x1f')](function(){var _0x5e5bc9=[];var _0x4e1f3c=[];var _0x6a543=utils[_0x25cd('0xdd')]();var _0x1b0350={'membername':_0x19dca6[_0x25cd('0x3f')],'interface':_0x26c915,'enterAt':moment()[_0x25cd('0x6a')](_0x25cd('0xde')),'role':_0x19dca6[_0x25cd('0x3b')],'internal':_0x19dca6[_0x25cd('0x6d')]};_0x6a543[_0x25cd('0xdb')](function(_0x194e5f){_0x5e5bc9['push'](_['merge']({'channel':_0x194e5f,'type':'LOGIN','data1':_0x32ecef[_0x25cd('0x5f')][_0x25cd('0xdf')],'data2':_0x26c915},_0x1b0350));if(_0x19dca6[_0x25cd('0x91')]){_0x4e1f3c['push'](_[_0x25cd('0x53')]({'channel':_0x194e5f,'type':_0x25cd('0xe0'),'data1':'LOGININPAUSE'},_0x1b0350));}});return db[_0x25cd('0xda')]['bulkCreate'](_0x5e5bc9['concat'](_0x4e1f3c),{'individualHooks':!![]});})[_0x25cd('0x1f')](function(){return _0x19dca6[_0x25cd('0x60')]({'online':!![],'lastLoginAt':moment()[_0x25cd('0x6a')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x19dca6[_0x25cd('0x91')]||![],'mailPause':_0x19dca6[_0x25cd('0x91')]||![],'chatPause':_0x19dca6['loginInPause']||![],'faxPause':_0x19dca6[_0x25cd('0x91')]||![],'smsPause':_0x19dca6[_0x25cd('0x91')]||![],'openchannelPause':_0x19dca6[_0x25cd('0x91')]||![],'pauseType':_0x19dca6[_0x25cd('0x91')]?'LOGININPAUSE':null,'interface':_0x26c915,'lastPauseAt':moment()[_0x25cd('0x6a')](_0x25cd('0xde'))});})[_0x25cd('0x1f')](respondWithResult(_0x217fcc,null))[_0x25cd('0x29')](handleError(_0x217fcc,null));};exports['logout']=function(_0x3895eb,_0x1ff6f9,_0x13ef8e){var _0x781992;return db[_0x25cd('0x41')][_0x25cd('0x3c')]({'where':{'id':_0x3895eb[_0x25cd('0x5b')]['id'],'role':'agent'},'attributes':['id','name',_0x25cd('0x3b')]})[_0x25cd('0x1f')](handleEntityNotFound(_0x1ff6f9,null))[_0x25cd('0x1f')](function(_0x3bccc0){if(_0x3bccc0){_0x781992=_0x3bccc0;return db[_0x25cd('0xa3')][_0x25cd('0x31')]({'where':{'membername':_0x781992[_0x25cd('0x3f')]},'individualHooks':!![]});}})[_0x25cd('0x1f')](function(){return db[_0x25cd('0xda')][_0x25cd('0x5a')]({'where':{'membername':_0x781992[_0x25cd('0x3f')],'exitAt':null}});})[_0x25cd('0x1f')](function(_0x597b76){var _0x2651a5=[];_0x597b76['forEach'](function(_0x195802){_0x2651a5[_0x25cd('0xa0')](_0x195802[_0x25cd('0x60')]({'exitAt':moment()['format'](_0x25cd('0xde'))}));});return BPromise[_0x25cd('0xdc')](_0x2651a5);})[_0x25cd('0x1f')](function(){return _0x781992[_0x25cd('0x60')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x25cd('0x1f')](respondWithResult(_0x1ff6f9,null))[_0x25cd('0x29')](handleError(_0x1ff6f9,null));};exports['pause']=function(_0x5c2758,_0x5f292a,_0x339725){var _0x34baa6;return db['UserVoiceQueueRt'][_0x25cd('0x60')]({'paused':0x1},{'where':{'UserId':_0x5c2758[_0x25cd('0x5b')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x25cd('0x41')][_0x25cd('0x3c')]({'where':{'id':_0x5c2758[_0x25cd('0x5b')]['id'],'role':_0x25cd('0x76')},'attributes':['id',_0x25cd('0x3f'),_0x25cd('0x3b'),_0x25cd('0x6d'),_0x25cd('0x93')]});})['then'](handleEntityNotFound(_0x5f292a,null))[_0x25cd('0x1f')](function(_0x595a29){if(_0x595a29){_0x34baa6=_0x595a29;return respondWithRpcPromise(_0x25cd('0xe1'),'pause',{'id':_0x34baa6['id'],'name':_0x34baa6[_0x25cd('0x3f')],'pause':!![]});}})[_0x25cd('0x1f')](function(){if(_0x34baa6){return db[_0x25cd('0xda')][_0x25cd('0x5a')]({'where':{'membername':_0x34baa6[_0x25cd('0x3f')],'type':_0x25cd('0xe0'),'exitAt':null}});}})[_0x25cd('0x1f')](function(_0x298c5f){if(_0x298c5f['length']){var _0x485b32=moment()[_0x25cd('0x6a')](_0x25cd('0xde'));for(var _0x1a3e8e=0x0,_0x362fd5=_0x298c5f[_0x25cd('0x5d')];_0x1a3e8e<_0x362fd5;_0x1a3e8e++){_0x298c5f[_0x1a3e8e][_0x25cd('0xe2')]({'exitAt':_0x485b32});}}})[_0x25cd('0x1f')](function(){var _0x2448a8=[];var _0x52eea3=utils['getChannels']();_0x52eea3[_0x25cd('0xdb')](function(_0x59efd9){_0x2448a8[_0x25cd('0xa0')]({'channel':_0x59efd9,'membername':_0x34baa6[_0x25cd('0x3f')],'interface':_[_0x25cd('0x68')](_0x34baa6[_0x25cd('0x93')])?util[_0x25cd('0x6a')](_0x25cd('0xa1'),_0x34baa6[_0x25cd('0x3f')]):_0x34baa6[_0x25cd('0x93')],'type':_0x25cd('0xe0'),'enterAt':moment()[_0x25cd('0x6a')](_0x25cd('0xde')),'data1':_0x5c2758['body']['type']||_0x25cd('0xe3'),'role':_0x34baa6['role'],'internal':_0x34baa6[_0x25cd('0x6d')]});});return db[_0x25cd('0xda')][_0x25cd('0x5e')](_0x2448a8,{'individualHooks':!![]});})[_0x25cd('0x1f')](function(){return _0x34baa6[_0x25cd('0x60')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x5c2758[_0x25cd('0x5f')][_0x25cd('0xe4')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x25cd('0x6a')](_0x25cd('0xde'))});})[_0x25cd('0x1f')](respondWithResult(_0x5f292a,null))['catch'](handleError(_0x5f292a,null));};exports[_0x25cd('0xe5')]=function(_0x46c0cd,_0x106aff,_0x89e49d){var _0x35b68b;return db[_0x25cd('0x41')]['find']({'where':{'id':_0x46c0cd[_0x25cd('0x5b')]['id']},'attributes':['id',_0x25cd('0x3f'),_0x25cd('0x3b'),_0x25cd('0x92'),_0x25cd('0xe6'),'chatPause',_0x25cd('0xe7'),_0x25cd('0xe8'),'smsPause',_0x25cd('0xe9'),_0x25cd('0xea')]})['then'](handleEntityNotFound(_0x106aff,null))[_0x25cd('0x1f')](function(_0x22db08){if(_0x22db08){_0x35b68b=_0x22db08;if(_0x46c0cd['body'][_0x25cd('0x98')]&&!utils[_0x25cd('0x94')](_0x46c0cd[_0x25cd('0x5f')][_0x25cd('0x98')])){throw new db[(_0x25cd('0x8a'))][(_0x25cd('0x88'))](_0x25cd('0x95'));}switch(_0x46c0cd[_0x25cd('0x5f')][_0x25cd('0x98')]){case _0x25cd('0x9f'):return respondWithRpcPromise(_0x25cd('0xe1'),_0x25cd('0xe5'),{'id':_0x35b68b['id'],'name':_0x35b68b['name'],'pause':![]})['then'](function(){return db[_0x25cd('0xa3')][_0x25cd('0x60')]({'paused':0x0},{'where':{'UserId':_0x35b68b['id']},'individualHooks':!![]});})[_0x25cd('0x1f')](function(){return db['MemberReport'][_0x25cd('0x3c')]({'where':{'channel':_0x46c0cd['body'][_0x25cd('0x98')],'membername':_0x35b68b[_0x25cd('0x3f')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x4d4016){if(_0x4d4016){return _0x4d4016[_0x25cd('0x60')]({'exitAt':moment()['format'](_0x25cd('0xde')),'data2':_0x25cd('0xeb')},{'individualHooks':!![]});}return null;})[_0x25cd('0x1f')](function(){return _0x35b68b['update']({'voicePause':![]});});case _0x25cd('0xec'):case _0x25cd('0xed'):case _0x25cd('0xee'):case _0x25cd('0xef'):case _0x25cd('0xf0'):return db[_0x25cd('0xda')][_0x25cd('0x3c')]({'where':{'channel':_0x46c0cd[_0x25cd('0x5f')][_0x25cd('0x98')],'membername':_0x35b68b[_0x25cd('0x3f')],'type':_0x25cd('0xe0'),'exitAt':null}})['then'](function(_0x123fc2){if(_0x123fc2){return _0x123fc2[_0x25cd('0x60')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x25cd('0xeb')},{'individualHooks':!![]});}return null;})[_0x25cd('0x1f')](function(){var _0x383e06={};_[_0x25cd('0x30')](_0x383e06,util['format'](_0x25cd('0xf1'),_0x46c0cd[_0x25cd('0x5f')]['channel'],_0x25cd('0xf2')),![]);return _0x35b68b[_0x25cd('0x60')](_0x383e06);});default:return respondWithRpcPromise(_0x25cd('0xe1'),_0x25cd('0xe5'),{'id':_0x35b68b['id'],'name':_0x35b68b['name'],'pause':![]})[_0x25cd('0x1f')](function(){return db[_0x25cd('0xa3')][_0x25cd('0x60')]({'paused':0x0},{'where':{'UserId':_0x35b68b['id']}});})[_0x25cd('0x1f')](function(){return db[_0x25cd('0xda')][_0x25cd('0x5a')]({'where':{'membername':_0x35b68b[_0x25cd('0x3f')],'type':_0x25cd('0xe0'),'exitAt':null}});})['then'](function(_0x384214){var _0x3f2372=[];_0x384214['forEach'](function(_0xb9396e){_0x3f2372['push'](_0xb9396e['update']({'exitAt':moment()[_0x25cd('0x6a')](_0x25cd('0xde')),'data2':_0x25cd('0xeb')}));});return BPromise[_0x25cd('0xdc')](_0x3f2372);})[_0x25cd('0x1f')](function(){return _0x35b68b[_0x25cd('0x60')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x25cd('0x1f')](respondWithResult(_0x106aff,null))[_0x25cd('0x29')](handleError(_0x106aff,null));};exports[_0x25cd('0xf3')]=function(_0x3c6113,_0x5bac13,_0x17d92c){var _0x42a1d8={};var _0x4f9d1b={};var _0x5dbaa3;var _0x4790a4;return db[_0x25cd('0x41')][_0x25cd('0xb1')]({'where':{'id':_0x3c6113[_0x25cd('0x5b')]['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x5bac13,null))[_0x25cd('0x1f')](function(_0x226d90){if(_0x226d90){_0x5dbaa3=_0x226d90;_0x4f9d1b['model']=_['keys'](db[_0x25cd('0xf4')]['rawAttributes']);_0x4f9d1b[_0x25cd('0x47')]=_[_0x25cd('0x5c')](_0x3c6113[_0x25cd('0x47')]);_0x4f9d1b[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x4f9d1b[_0x25cd('0x43')],_0x4f9d1b[_0x25cd('0x47')]);_0x42a1d8[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0x4f9d1b[_0x25cd('0x43')],qs['fields'](_0x3c6113[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x42a1d8[_0x25cd('0x4b')]=_0x42a1d8[_0x25cd('0x4b')]['length']?_0x42a1d8[_0x25cd('0x4b')]:_0x4f9d1b['model'];_0x42a1d8['order']=qs[_0x25cd('0x50')](_0x3c6113['query'][_0x25cd('0x50')]);_0x42a1d8[_0x25cd('0x51')]=qs['filters'](_[_0x25cd('0xb2')](_0x3c6113[_0x25cd('0x47')],_0x4f9d1b[_0x25cd('0x48')]));if(_0x3c6113[_0x25cd('0x47')][_0x25cd('0x52')]){_0x42a1d8['where']=_['merge'](_0x42a1d8['where'],{'$or':_[_0x25cd('0x38')](_0x42a1d8[_0x25cd('0x4b')],function(_0xc1bd54){var _0x37a791={};_0x37a791[_0xc1bd54]={'$like':'%'+_0x3c6113[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0x37a791;})});}_0x42a1d8=_['merge']({},_0x42a1d8,_0x3c6113[_0x25cd('0x58')]);return _0x5dbaa3[_0x25cd('0xf3')](_0x42a1d8);}})['then'](function(_0x17a849){if(_0x17a849){_0x4790a4=_0x17a849[_0x25cd('0x5d')];if(!_0x3c6113['query'][_0x25cd('0x4c')](_0x25cd('0x4d'))){_0x42a1d8[_0x25cd('0x4e')]=qs[_0x25cd('0x4e')](_0x3c6113[_0x25cd('0x47')][_0x25cd('0x4e')]);_0x42a1d8[_0x25cd('0x2f')]=qs[_0x25cd('0x2f')](_0x3c6113['query'][_0x25cd('0x2f')]);}return _0x5dbaa3[_0x25cd('0xf3')](_0x42a1d8);}})[_0x25cd('0x1f')](function(_0x3c4afd){if(_0x3c4afd){return _0x3c4afd?{'count':_0x4790a4,'rows':_0x3c4afd}:null;}})['then'](respondWithResult(_0x5bac13,null))[_0x25cd('0x29')](handleError(_0x5bac13,null));};exports['addTeams']=function(_0x13c453,_0x3eef2b,_0x30f6f2){return db['User'][_0x25cd('0x3c')]({'where':{'id':_0x13c453[_0x25cd('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3eef2b,null))[_0x25cd('0x1f')](function(_0x22e20a){if(_0x22e20a){return _0x22e20a[_0x25cd('0xf5')](_0x13c453[_0x25cd('0x5f')][_0x25cd('0x63')],_[_0x25cd('0x64')](_0x13c453[_0x25cd('0x5f')],[_0x25cd('0x63'),'id'])||{});}})[_0x25cd('0x1f')](respondWithResult(_0x3eef2b,null))[_0x25cd('0x29')](handleError(_0x3eef2b,null));};exports['removeTeams']=function(_0x7f9761,_0x3a0ceb,_0x2556b9){var _0x805949;return db[_0x25cd('0x41')][_0x25cd('0x3c')]({'where':{'id':_0x7f9761['params']['id']}})[_0x25cd('0x1f')](handleEntityNotFound(_0x3a0ceb,null))[_0x25cd('0x1f')](function(_0x43e28a){if(_0x43e28a){return _0x43e28a['removeTeams'](_0x7f9761[_0x25cd('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x3a0ceb,null))[_0x25cd('0x29')](handleError(_0x3a0ceb,null));};exports['getLists']=function(_0x21f0fb,_0x457148,_0x112a21){var _0x386f49={};var _0x377d3d={};var _0x411ed1;var _0xb7073a;return db['User']['findOne']({'where':{'id':_0x21f0fb['params']['id']}})['then'](handleEntityNotFound(_0x457148,null))['then'](function(_0x5defb3){if(_0x5defb3){_0x411ed1=_0x5defb3;_0x377d3d[_0x25cd('0x43')]=_[_0x25cd('0x5c')](db[_0x25cd('0xb3')][_0x25cd('0x42')]);_0x377d3d[_0x25cd('0x47')]=_[_0x25cd('0x5c')](_0x21f0fb[_0x25cd('0x47')]);_0x377d3d[_0x25cd('0x48')]=_[_0x25cd('0x49')](_0x377d3d['model'],_0x377d3d[_0x25cd('0x47')]);_0x386f49['attributes']=_[_0x25cd('0x49')](_0x377d3d[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x21f0fb[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x386f49[_0x25cd('0x4b')]=_0x386f49[_0x25cd('0x4b')]['length']?_0x386f49[_0x25cd('0x4b')]:_0x377d3d[_0x25cd('0x43')];_0x386f49[_0x25cd('0x4f')]=qs[_0x25cd('0x50')](_0x21f0fb['query'][_0x25cd('0x50')]);_0x386f49[_0x25cd('0x51')]=qs['filters'](_[_0x25cd('0xb2')](_0x21f0fb[_0x25cd('0x47')],_0x377d3d[_0x25cd('0x48')]));if(_0x21f0fb[_0x25cd('0x47')][_0x25cd('0x52')]){_0x386f49[_0x25cd('0x51')]=_[_0x25cd('0x53')](_0x386f49[_0x25cd('0x51')],{'$or':_[_0x25cd('0x38')](_0x386f49[_0x25cd('0x4b')],function(_0x4a2ac9){var _0x30485b={};_0x30485b[_0x4a2ac9]={'$like':'%'+_0x21f0fb[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0x30485b;})});}_0x386f49=_[_0x25cd('0x53')]({},_0x386f49,_0x21f0fb[_0x25cd('0x58')]);return _0x411ed1['getLists'](_0x386f49);}})[_0x25cd('0x1f')](function(_0x2664dd){if(_0x2664dd){_0xb7073a=_0x2664dd[_0x25cd('0x5d')];if(!_0x21f0fb[_0x25cd('0x47')]['hasOwnProperty'](_0x25cd('0x4d'))){_0x386f49['limit']=qs[_0x25cd('0x4e')](_0x21f0fb[_0x25cd('0x47')][_0x25cd('0x4e')]);_0x386f49['offset']=qs[_0x25cd('0x2f')](_0x21f0fb[_0x25cd('0x47')][_0x25cd('0x2f')]);}return _0x411ed1[_0x25cd('0xf6')](_0x386f49);}})[_0x25cd('0x1f')](function(_0x10158c){if(_0x10158c){return _0x10158c?{'count':_0xb7073a,'rows':_0x10158c}:null;}})[_0x25cd('0x1f')](respondWithResult(_0x457148,null))['catch'](handleError(_0x457148,null));};exports[_0x25cd('0xf7')]=function(_0x5f4560,_0x597dd4,_0x2225c4){var _0x59cc74={};var _0x33d50b={};var _0x1b68ee;var _0x47000c;return db[_0x25cd('0x41')]['findOne']({'where':{'id':_0x5f4560[_0x25cd('0x5b')]['id']}})['then'](handleEntityNotFound(_0x597dd4,null))[_0x25cd('0x1f')](function(_0x52e277){if(_0x52e277){_0x1b68ee=_0x52e277;_0x33d50b[_0x25cd('0x43')]=_[_0x25cd('0x5c')](db['User'][_0x25cd('0x42')]);_0x33d50b[_0x25cd('0x47')]=_[_0x25cd('0x5c')](_0x5f4560[_0x25cd('0x47')]);_0x33d50b['filters']=_[_0x25cd('0x49')](_0x33d50b[_0x25cd('0x43')],_0x33d50b[_0x25cd('0x47')]);_0x59cc74[_0x25cd('0x4b')]=_[_0x25cd('0x49')](_0x33d50b[_0x25cd('0x43')],qs[_0x25cd('0x4a')](_0x5f4560[_0x25cd('0x47')][_0x25cd('0x4a')]));_0x59cc74['attributes']=_0x59cc74[_0x25cd('0x4b')]['length']?_0x59cc74[_0x25cd('0x4b')]:_0x33d50b['model'];_0x59cc74[_0x25cd('0x4f')]=qs[_0x25cd('0x50')](_0x5f4560[_0x25cd('0x47')]['sort']);_0x59cc74[_0x25cd('0x51')]=qs[_0x25cd('0x48')](_['pick'](_0x5f4560[_0x25cd('0x47')],_0x33d50b['filters']));if(_0x5f4560['query'][_0x25cd('0x52')]){_0x59cc74['where']=_[_0x25cd('0x53')](_0x59cc74[_0x25cd('0x51')],{'$or':_[_0x25cd('0x38')](_0x59cc74[_0x25cd('0x4b')],function(_0x2eaf1a){var _0x2a55f0={};_0x2a55f0[_0x2eaf1a]={'$like':'%'+_0x5f4560[_0x25cd('0x47')][_0x25cd('0x52')]+'%'};return _0x2a55f0;})});}_0x59cc74[_0x25cd('0x43')]=db[_0x25cd('0x41')];_0x59cc74['as']=_0x25cd('0x34');_0x59cc74=_[_0x25cd('0x53')]({},_0x59cc74,_0x5f4560[_0x25cd('0x58')]);return _0x1b68ee[_0x25cd('0xd8')]({'include':[_0x59cc74]});}})['then'](function(_0x344e3b){if(_0x344e3b){var _0x26694b={},_0x141dbb=[],_0x5b487c=0x0;for(var _0x5859ab=0x0;_0x5859ab<_0x344e3b[_0x25cd('0x5d')];_0x5859ab+=0x1){for(var _0xf21dc1=0x0,_0x1a5a8b;_0xf21dc1<_0x344e3b[_0x5859ab]['Agents'][_0x25cd('0x5d')];_0xf21dc1+=0x1){_0x1a5a8b=_0x344e3b[_0x5859ab]['Agents'][_0xf21dc1][_0x25cd('0x32')]({'plain':!![]});_0x26694b[_0x1a5a8b['id']]=_0x1a5a8b;}}_0x26694b=_['values'](_0x26694b);for(var _0x51aa11=qs[_0x25cd('0x2f')](_0x5f4560['query'][_0x25cd('0x2f')]);_0x51aa11<_0x26694b[_0x25cd('0x5d')]&&_0x141dbb['length']=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});}; \ 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(_0x4bc896,_0x541068){var _0x1a22ce=function(_0x522eae){while(--_0x522eae){_0x4bc896['push'](_0x4bc896['shift']());}};_0x1a22ce(++_0x541068);}(_0xb10b,0x12a));var _0xbb10=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xb10b[_0x368587];return _0x42d33c;};'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 a4107fa..78844cf 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 _0xc196=['emit','length','user:','./user.events','save','remove','update'];(function(_0x5d1fdc,_0x21d3ef){var _0x43864e=function(_0x36e8c7){while(--_0x36e8c7){_0x5d1fdc['push'](_0x5d1fdc['shift']());}};_0x43864e(++_0x21d3ef);}(_0xc196,0xb2));var _0x6c19=function(_0x4f301a,_0x3b9d2c){_0x4f301a=_0x4f301a-0x0;var _0x50583b=_0xc196[_0x4f301a];return _0x50583b;};'use strict';var UserEvents=require(_0x6c19('0x0'));var events=[_0x6c19('0x1'),_0x6c19('0x2'),_0x6c19('0x3')];function createListener(_0x1cb649,_0x38a2d4){return function(_0x32d859){_0x38a2d4[_0x6c19('0x4')](_0x1cb649,_0x32d859);};}function removeListener(_0x53d72a,_0x3e600a){return function(){UserEvents['removeListener'](_0x53d72a,_0x3e600a);};}exports['register']=function(_0x3cbb79){for(var _0x49131d=0x0,_0x5edb30=events[_0x6c19('0x5')];_0x49131d<_0x5edb30;_0x49131d++){var _0x5d66c2=events[_0x49131d];var _0x21da91=createListener(_0x6c19('0x6')+_0x5d66c2,_0x3cbb79);UserEvents['on'](_0x5d66c2,_0x21da91);}}; \ No newline at end of file +var _0xa8cc=['update','emit','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x2361ce,_0x2c3ec0){var _0x35ece8=function(_0x253e2f){while(--_0x253e2f){_0x2361ce['push'](_0x2361ce['shift']());}};_0x35ece8(++_0x2c3ec0);}(_0xa8cc,0x84));var _0xca8c=function(_0x30fa89,_0x38b85e){_0x30fa89=_0x30fa89-0x0;var _0x5f401b=_0xa8cc[_0x30fa89];return _0x5f401b;};'use strict';var UserEvents=require(_0xca8c('0x0'));var events=[_0xca8c('0x1'),_0xca8c('0x2'),_0xca8c('0x3')];function createListener(_0xa64b6a,_0x146ff0){return function(_0x1e460d){_0x146ff0[_0xca8c('0x4')](_0xa64b6a,_0x1e460d);};}function removeListener(_0x50d12c,_0x45dd58){return function(){UserEvents[_0xca8c('0x5')](_0x50d12c,_0x45dd58);};}exports[_0xca8c('0x6')]=function(_0x45d7ac){for(var _0x2f5fdd=0x0,_0x4e6aaf=events[_0xca8c('0x7')];_0x2f5fdd<_0x4e6aaf;_0x2f5fdd++){var _0x48d28f=events[_0x2f5fdd];var _0x2f3623=createListener(_0xca8c('0x8')+_0x48d28f,_0x45d7ac);UserEvents['on'](_0x48d28f,_0x2f3623);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 7fcb9ab..ddcdb5f 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 _0xcde7=['exports','path','connect-timeout','express','../../components/interaction/service'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xcde7,0x65));var _0x7cde=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xcde7[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7cde('0x0'));var timeout=require(_0x7cde('0x1'));var express=require(_0x7cde('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7cde('0x3'));var config=require('../../config/environment');module[_0x7cde('0x4')]=router; \ No newline at end of file +var _0x23f4=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23f4,0x1ee));var _0x423f=function(_0x733cdf,_0x5ed339){_0x733cdf=_0x733cdf-0x0;var _0x42161d=_0x23f4[_0x733cdf];return _0x42161d;};'use strict';var multer=require('multer');var util=require(_0x423f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x423f('0x1'));var router=express[_0x423f('0x2')]();var auth=require(_0x423f('0x3'));var interaction=require(_0x423f('0x4'));var config=require(_0x423f('0x5'));module[_0x423f('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 9006424..e5a8818 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc910=['sequelize','INTEGER'];(function(_0x117417,_0x214c67){var _0x5ba86d=function(_0x35ad70){while(--_0x35ad70){_0x117417['push'](_0x117417['shift']());}};_0x5ba86d(++_0x214c67);}(_0xc910,0xcc));var _0x0c91=function(_0x142acf,_0x5dd68e){_0x142acf=_0x142acf-0x0;var _0x3715dc=_0xc910[_0x142acf];return _0x3715dc;};'use strict';var Sequelize=require(_0x0c91('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0c91('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 4951b06..fc3291a 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 _0x5423=['moment','request-promise','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5423,0xe3));var _0x3542=function(_0x3f6a16,_0x23e485){_0x3f6a16=_0x3f6a16-0x0;var _0x1e8cc5=_0x5423[_0x3f6a16];return _0x1e8cc5;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var attributes=require(_0x3542('0x5'));module[_0x3542('0x6')]=function(_0x2a1864,_0x54ea2f){return _0x2a1864[_0x3542('0x7')](_0x3542('0x8'),attributes,{'tableName':_0x3542('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6017=['../../config/logger','moment','bluebird','./userChatQueue.attributes','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x3ca5aa,_0x1b3b1d){var _0x52ae11=function(_0x36bb33){while(--_0x36bb33){_0x3ca5aa['push'](_0x3ca5aa['shift']());}};_0x52ae11(++_0x1b3b1d);}(_0x6017,0xae));var _0x7601=function(_0x3250f1,_0x971f6c){_0x3250f1=_0x3250f1-0x0;var _0x1cf531=_0x6017[_0x3250f1];return _0x1cf531;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var logger=require(_0x7601('0x2'))('api');var moment=require(_0x7601('0x3'));var BPromise=require(_0x7601('0x4'));var rp=require('request-promise');var attributes=require(_0x7601('0x5'));module['exports']=function(_0x1bec78,_0x558fa9){return _0x1bec78['define'](_0x7601('0x6'),attributes,{'tableName':_0x7601('0x7'),'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 5b03350..6a484ef 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 _0x5460=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x180331,_0x49aaa7){var _0x4eb417=function(_0xfd6856){while(--_0xfd6856){_0x180331['push'](_0x180331['shift']());}};_0x4eb417(++_0x49aaa7);}(_0x5460,0x1e5));var _0x0546=function(_0x46229a,_0x5b7fbc){_0x46229a=_0x46229a-0x0;var _0xd68564=_0x5460[_0x46229a];return _0xd68564;};'use strict';var _=require(_0x0546('0x0'));var util=require(_0x0546('0x1'));var moment=require(_0x0546('0x2'));var BPromise=require(_0x0546('0x3'));var rs=require(_0x0546('0x4'));var fs=require('fs');var Redis=require(_0x0546('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0546('0x6'));var logger=require('../../config/logger')(_0x0546('0x7'));var config=require(_0x0546('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0546('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37cb77,_0x1b88bb,_0x513b97){return new BPromise(function(_0x49b2b9,_0x1b26bc){return client[_0x0546('0xa')](_0x37cb77,_0x513b97)[_0x0546('0xb')](function(_0x11d55f){logger[_0x0546('0xc')](_0x0546('0xd'),_0x1b88bb,_0x0546('0xe'));logger[_0x0546('0xf')](_0x0546('0x10'),_0x1b88bb,_0x0546('0xe'),JSON['stringify'](_0x11d55f));if(_0x11d55f[_0x0546('0x11')]){if(_0x11d55f[_0x0546('0x11')][_0x0546('0x12')]===0x1f4){logger[_0x0546('0x11')](_0x0546('0xd'),_0x1b88bb,_0x11d55f['error'][_0x0546('0x13')]);return _0x1b26bc(_0x11d55f[_0x0546('0x11')][_0x0546('0x13')]);}logger['error'](_0x0546('0xd'),_0x1b88bb,_0x11d55f[_0x0546('0x11')]['message']);return _0x49b2b9(_0x11d55f[_0x0546('0x11')]['message']);}else{logger['info'](_0x0546('0xd'),_0x1b88bb,_0x0546('0xe'));_0x49b2b9(_0x11d55f['result']['message']);}})[_0x0546('0x14')](function(_0xd2f17d){logger[_0x0546('0x11')](_0x0546('0xd'),_0x1b88bb,_0xd2f17d);_0x1b26bc(_0xd2f17d);});});} \ No newline at end of file +var _0xa664=['request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0xdbfe11,_0x5cfa1e){var _0x28438d=function(_0x1e2235){while(--_0x1e2235){_0xdbfe11['push'](_0xdbfe11['shift']());}};_0x28438d(++_0x5cfa1e);}(_0xa664,0x1f0));var _0x4a66=function(_0x303131,_0x35a7da){_0x303131=_0x303131-0x0;var _0x52a74b=_0xa664[_0x303131];return _0x52a74b;};'use strict';var _=require(_0x4a66('0x0'));var util=require(_0x4a66('0x1'));var moment=require('moment');var BPromise=require(_0x4a66('0x2'));var rs=require(_0x4a66('0x3'));var fs=require('fs');var Redis=require(_0x4a66('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a66('0x5'));var logger=require('../../config/logger')(_0x4a66('0x6'));var config=require(_0x4a66('0x7'));var jayson=require(_0x4a66('0x8'));var client=jayson['client'][_0x4a66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e2943,_0x3cbd69,_0x5520ab){return new BPromise(function(_0x2d7bfa,_0x2c6430){return client[_0x4a66('0xa')](_0x5e2943,_0x5520ab)[_0x4a66('0xb')](function(_0x49e68d){logger[_0x4a66('0xc')](_0x4a66('0xd'),_0x3cbd69,_0x4a66('0xe'));logger[_0x4a66('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3cbd69,'request\x20sent',JSON[_0x4a66('0x10')](_0x49e68d));if(_0x49e68d[_0x4a66('0x11')]){if(_0x49e68d['error'][_0x4a66('0x12')]===0x1f4){logger[_0x4a66('0x11')](_0x4a66('0xd'),_0x3cbd69,_0x49e68d[_0x4a66('0x11')][_0x4a66('0x13')]);return _0x2c6430(_0x49e68d[_0x4a66('0x11')][_0x4a66('0x13')]);}logger[_0x4a66('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x3cbd69,_0x49e68d[_0x4a66('0x11')]['message']);return _0x2d7bfa(_0x49e68d[_0x4a66('0x11')][_0x4a66('0x13')]);}else{logger[_0x4a66('0xc')](_0x4a66('0xd'),_0x3cbd69,'request\x20sent');_0x2d7bfa(_0x49e68d[_0x4a66('0x14')][_0x4a66('0x13')]);}})[_0x4a66('0x15')](function(_0x4733a8){logger[_0x4a66('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x3cbd69,_0x4733a8);_0x2c6430(_0x4733a8);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 39378df..ca790d2 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 _0x90b1=['../../components/interaction/service','../../config/environment','multer','util','path','Router','../../components/auth/service'];(function(_0x73584,_0x1193f9){var _0x3de19f=function(_0x3f8d69){while(--_0x3f8d69){_0x73584['push'](_0x73584['shift']());}};_0x3de19f(++_0x1193f9);}(_0x90b1,0x1bb));var _0x190b=function(_0x443cdc,_0x1d1da7){_0x443cdc=_0x443cdc-0x0;var _0x13bd4b=_0x90b1[_0x443cdc];return _0x13bd4b;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var auth=require(_0x190b('0x4'));var interaction=require(_0x190b('0x5'));var config=require(_0x190b('0x6'));module['exports']=router; \ No newline at end of file +var _0xad5f=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x52a35c,_0x42a4f2){var _0x54f021=function(_0x3e944d){while(--_0x3e944d){_0x52a35c['push'](_0x52a35c['shift']());}};_0x54f021(++_0x42a4f2);}(_0xad5f,0x1a8));var _0xfad5=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0xad5f[_0x229128];return _0x1875b9;};'use strict';var multer=require(_0xfad5('0x0'));var util=require(_0xfad5('0x1'));var path=require(_0xfad5('0x2'));var timeout=require(_0xfad5('0x3'));var express=require(_0xfad5('0x4'));var router=express[_0xfad5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xfad5('0x6'));var config=require(_0xfad5('0x7'));module[_0xfad5('0x8')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 96b3bfe..7659e55 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 _0x40f6=['sequelize','exports','INTEGER','STRING'];(function(_0xaaa2c2,_0x236876){var _0x465914=function(_0x293962){while(--_0x293962){_0xaaa2c2['push'](_0xaaa2c2['shift']());}};_0x465914(++_0x236876);}(_0x40f6,0x1e8));var _0x640f=function(_0xfb2184,_0x186440){_0xfb2184=_0xfb2184-0x0;var _0x43a919=_0x40f6[_0xfb2184];return _0x43a919;};'use strict';var Sequelize=require(_0x640f('0x0'));module[_0x640f('0x1')]={'penalty':{'type':Sequelize[_0x640f('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x640f('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x640f('0x3')]}}; \ No newline at end of file +var _0x3f10=['INTEGER','STRING','sequelize'];(function(_0x3f689e,_0x471600){var _0x35313b=function(_0x414e8f){while(--_0x414e8f){_0x3f689e['push'](_0x3f689e['shift']());}};_0x35313b(++_0x471600);}(_0x3f10,0xe9));var _0x03f1=function(_0x7458fe,_0x21385c){_0x7458fe=_0x7458fe-0x0;var _0x2740fe=_0x3f10[_0x7458fe];return _0x2740fe;};'use strict';var Sequelize=require(_0x03f1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x03f1('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x03f1('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x03f1('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 3bb4811..3b444c0 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 _0x3e74=['moment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api'];(function(_0x5bf9de,_0x58c40f){var _0x25f66e=function(_0x54179d){while(--_0x54179d){_0x5bf9de['push'](_0x5bf9de['shift']());}};_0x25f66e(++_0x58c40f);}(_0x3e74,0x175));var _0x43e7=function(_0x1f675d,_0x37d313){_0x1f675d=_0x1f675d-0x0;var _0x2666fb=_0x3e74[_0x1f675d];return _0x2666fb;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x43e7('0x4'));module['exports']=function(_0x128b0f,_0xe838b4){return _0x128b0f[_0x43e7('0x5')](_0x43e7('0x6'),attributes,{'tableName':_0x43e7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca9e=['../../config/logger','api','moment','bluebird','request-promise','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x498c98,_0x50b9ac){var _0x5475ca=function(_0x376c1e){while(--_0x376c1e){_0x498c98['push'](_0x498c98['shift']());}};_0x5475ca(++_0x50b9ac);}(_0xca9e,0x136));var _0xeca9=function(_0x1ca3ab,_0x253da0){_0x1ca3ab=_0x1ca3ab-0x0;var _0x12b806=_0xca9e[_0x1ca3ab];return _0x12b806;};'use strict';var _=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var logger=require(_0xeca9('0x2'))(_0xeca9('0x3'));var moment=require(_0xeca9('0x4'));var BPromise=require(_0xeca9('0x5'));var rp=require(_0xeca9('0x6'));var attributes=require(_0xeca9('0x7'));module[_0xeca9('0x8')]=function(_0x1e0a18,_0x3aba81){return _0x1e0a18[_0xeca9('0x9')](_0xeca9('0xa'),attributes,{'tableName':_0xeca9('0xb'),'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 2f209c3..bcadc63 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 _0xa447=['../../mysqldb','rpc','../../config/environment','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x5b79ca,_0x50d700){var _0x5c4f90=function(_0x44b3cc){while(--_0x44b3cc){_0x5b79ca['push'](_0x5b79ca['shift']());}};_0x5c4f90(++_0x50d700);}(_0xa447,0x164));var _0x7a44=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xa447[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x7a44('0x0'));var util=require(_0x7a44('0x1'));var moment=require(_0x7a44('0x2'));var BPromise=require(_0x7a44('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a44('0x4'));var db=require(_0x7a44('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a44('0x6'));var config=require(_0x7a44('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x380213,_0x4dd18f,_0x509b1b){return new BPromise(function(_0x249bf0,_0x5dcc04){return client['request'](_0x380213,_0x509b1b)[_0x7a44('0x8')](function(_0x271801){logger[_0x7a44('0x9')](_0x7a44('0xa'),_0x4dd18f,_0x7a44('0xb'));logger[_0x7a44('0xc')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4dd18f,_0x7a44('0xb'),JSON[_0x7a44('0xd')](_0x271801));if(_0x271801['error']){if(_0x271801[_0x7a44('0xe')][_0x7a44('0xf')]===0x1f4){logger['error'](_0x7a44('0xa'),_0x4dd18f,_0x271801['error']['message']);return _0x5dcc04(_0x271801[_0x7a44('0xe')]['message']);}logger[_0x7a44('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4dd18f,_0x271801[_0x7a44('0xe')][_0x7a44('0x10')]);return _0x249bf0(_0x271801['error'][_0x7a44('0x10')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x4dd18f,'request\x20sent');_0x249bf0(_0x271801[_0x7a44('0x11')]['message']);}})[_0x7a44('0x12')](function(_0x1f0ed0){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4dd18f,_0x1f0ed0);_0x5dcc04(_0x1f0ed0);});});} \ No newline at end of file +var _0x8a4d=['info','debug','error','code','message','UserFaxQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','request'];(function(_0x8a13e2,_0x522feb){var _0x57e8ee=function(_0x53d5d3){while(--_0x53d5d3){_0x8a13e2['push'](_0x8a13e2['shift']());}};_0x57e8ee(++_0x522feb);}(_0x8a4d,0x188));var _0xd8a4=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x8a4d[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0xd8a4('0x0'));var util=require(_0xd8a4('0x1'));var moment=require(_0xd8a4('0x2'));var BPromise=require('bluebird');var rs=require(_0xd8a4('0x3'));var fs=require('fs');var Redis=require(_0xd8a4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd8a4('0x5'))('rpc');var config=require(_0xd8a4('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x583059,_0xaf731d,_0x288773){return new BPromise(function(_0xe30837,_0x1d22c0){return client[_0xd8a4('0x7')](_0x583059,_0x288773)['then'](function(_0x37be96){logger[_0xd8a4('0x8')]('UserFaxQueue,\x20%s,\x20%s',_0xaf731d,'request\x20sent');logger[_0xd8a4('0x9')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xaf731d,'request\x20sent',JSON['stringify'](_0x37be96));if(_0x37be96[_0xd8a4('0xa')]){if(_0x37be96['error'][_0xd8a4('0xb')]===0x1f4){logger[_0xd8a4('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0xaf731d,_0x37be96[_0xd8a4('0xa')][_0xd8a4('0xc')]);return _0x1d22c0(_0x37be96[_0xd8a4('0xa')][_0xd8a4('0xc')]);}logger[_0xd8a4('0xa')](_0xd8a4('0xd'),_0xaf731d,_0x37be96[_0xd8a4('0xa')][_0xd8a4('0xc')]);return _0xe30837(_0x37be96[_0xd8a4('0xa')]['message']);}else{logger[_0xd8a4('0x8')](_0xd8a4('0xd'),_0xaf731d,'request\x20sent');_0xe30837(_0x37be96[_0xd8a4('0xe')][_0xd8a4('0xc')]);}})[_0xd8a4('0xf')](function(_0x41e8da){logger['error'](_0xd8a4('0xd'),_0xaf731d,_0x41e8da);_0x1d22c0(_0x41e8da);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 5aae176..1256fac 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 _0x5fc3=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x127e65,_0x5aea47){var _0x4a3717=function(_0x43c6f6){while(--_0x43c6f6){_0x127e65['push'](_0x127e65['shift']());}};_0x4a3717(++_0x5aea47);}(_0x5fc3,0xa8));var _0x35fc=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0x5fc3[_0x46a3e8];return _0xf1442e;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');module[_0x35fc('0x7')]=router; \ No newline at end of file +var _0x13c5=['multer','../../components/interaction/service'];(function(_0x56e20a,_0x57d435){var _0x735d65=function(_0x208873){while(--_0x208873){_0x56e20a['push'](_0x56e20a['shift']());}};_0x735d65(++_0x57d435);}(_0x13c5,0x7a));var _0x513c=function(_0x953d82,_0x3859e9){_0x953d82=_0x953d82-0x0;var _0x362632=_0x13c5[_0x953d82];return _0x362632;};'use strict';var multer=require(_0x513c('0x0'));var util=require('util');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(_0x513c('0x1'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 5ae3572..42c644d 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 _0x14de=['exports','INTEGER','sequelize'];(function(_0x24681b,_0x31424e){var _0x10d992=function(_0x1c04bc){while(--_0x1c04bc){_0x24681b['push'](_0x24681b['shift']());}};_0x10d992(++_0x31424e);}(_0x14de,0xcb));var _0xe14d=function(_0x27275c,_0xcf0aba){_0x27275c=_0x27275c-0x0;var _0x58e795=_0x14de[_0x27275c];return _0x58e795;};'use strict';var Sequelize=require(_0xe14d('0x0'));module[_0xe14d('0x1')]={'penalty':{'type':Sequelize[_0xe14d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe2f6=['sequelize','INTEGER'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xe2f6,0xe8));var _0x6e2f=function(_0x23b901,_0x26264b){_0x23b901=_0x23b901-0x0;var _0x38d1f5=_0xe2f6[_0x23b901];return _0x38d1f5;};'use strict';var Sequelize=require(_0x6e2f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6e2f('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 3bb5b66..7e13b50 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 _0xb982=['api','moment','bluebird','request-promise','./userMailQueue.attributes','exports','define','user_has_mail_queues','../../config/logger'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xb982,0x15e));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b98('0x0'))(_0x2b98('0x1'));var moment=require(_0x2b98('0x2'));var BPromise=require(_0x2b98('0x3'));var rp=require(_0x2b98('0x4'));var attributes=require(_0x2b98('0x5'));module[_0x2b98('0x6')]=function(_0x1176d5,_0x2f9789){return _0x1176d5[_0x2b98('0x7')]('UserMailQueue',attributes,{'tableName':_0x2b98('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fad=['lodash','util','../../config/logger','api','moment','request-promise','exports','UserMailQueue','user_has_mail_queues'];(function(_0x3e257c,_0x5965b8){var _0x12fc84=function(_0x4e8351){while(--_0x4e8351){_0x3e257c['push'](_0x3e257c['shift']());}};_0x12fc84(++_0x5965b8);}(_0x6fad,0x17a));var _0xd6fa=function(_0x4a6fac,_0x398714){_0x4a6fac=_0x4a6fac-0x0;var _0x109bfa=_0x6fad[_0x4a6fac];return _0x109bfa;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var logger=require(_0xd6fa('0x2'))(_0xd6fa('0x3'));var moment=require(_0xd6fa('0x4'));var BPromise=require('bluebird');var rp=require(_0xd6fa('0x5'));var attributes=require('./userMailQueue.attributes');module[_0xd6fa('0x6')]=function(_0x542461,_0x40ac02){return _0x542461['define'](_0xd6fa('0x7'),attributes,{'tableName':_0xd6fa('0x8'),'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 b86ca76..3fa9fbd 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 _0x3034=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x4587fe,_0x4b740c){var _0x379355=function(_0x24247c){while(--_0x24247c){_0x4587fe['push'](_0x4587fe['shift']());}};_0x379355(++_0x4b740c);}(_0x3034,0x11f));var _0x4303=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3034[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x4303('0x0'));var util=require('util');var moment=require(_0x4303('0x1'));var BPromise=require(_0x4303('0x2'));var rs=require(_0x4303('0x3'));var fs=require('fs');var Redis=require(_0x4303('0x4'));var db=require(_0x4303('0x5'))['db'];var utils=require(_0x4303('0x6'));var logger=require(_0x4303('0x7'))(_0x4303('0x8'));var config=require(_0x4303('0x9'));var jayson=require(_0x4303('0xa'));var client=jayson['client'][_0x4303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12fd2d,_0x2c0461,_0x12f424){return new BPromise(function(_0x505c8c,_0x1b7d16){return client[_0x4303('0xc')](_0x12fd2d,_0x12f424)[_0x4303('0xd')](function(_0x47736b){logger[_0x4303('0xe')](_0x4303('0xf'),_0x2c0461,_0x4303('0x10'));logger['debug'](_0x4303('0x11'),_0x2c0461,_0x4303('0x10'),JSON['stringify'](_0x47736b));if(_0x47736b['error']){if(_0x47736b['error'][_0x4303('0x12')]===0x1f4){logger[_0x4303('0x13')](_0x4303('0xf'),_0x2c0461,_0x47736b[_0x4303('0x13')][_0x4303('0x14')]);return _0x1b7d16(_0x47736b[_0x4303('0x13')]['message']);}logger['error'](_0x4303('0xf'),_0x2c0461,_0x47736b[_0x4303('0x13')][_0x4303('0x14')]);return _0x505c8c(_0x47736b[_0x4303('0x13')][_0x4303('0x14')]);}else{logger[_0x4303('0xe')](_0x4303('0xf'),_0x2c0461,_0x4303('0x10'));_0x505c8c(_0x47736b['result'][_0x4303('0x14')]);}})[_0x4303('0x15')](function(_0x400a2d){logger[_0x4303('0x13')](_0x4303('0xf'),_0x2c0461,_0x400a2d);_0x1b7d16(_0x400a2d);});});} \ No newline at end of file +var _0xbd10=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xbd10,0xb9));var _0x0bd1=function(_0x11c75e,_0x499052){_0x11c75e=_0x11c75e-0x0;var _0x4887ff=_0xbd10[_0x11c75e];return _0x4887ff;};'use strict';var _=require(_0x0bd1('0x0'));var util=require(_0x0bd1('0x1'));var moment=require(_0x0bd1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bd1('0x3'));var db=require(_0x0bd1('0x4'))['db'];var utils=require(_0x0bd1('0x5'));var logger=require(_0x0bd1('0x6'))(_0x0bd1('0x7'));var config=require(_0x0bd1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0bd1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x514b7d,_0x21885a,_0x869cdc){return new BPromise(function(_0x2ad5e8,_0x354162){return client[_0x0bd1('0xa')](_0x514b7d,_0x869cdc)['then'](function(_0x20d13c){logger[_0x0bd1('0xb')](_0x0bd1('0xc'),_0x21885a,_0x0bd1('0xd'));logger['debug'](_0x0bd1('0xe'),_0x21885a,'request\x20sent',JSON[_0x0bd1('0xf')](_0x20d13c));if(_0x20d13c[_0x0bd1('0x10')]){if(_0x20d13c[_0x0bd1('0x10')][_0x0bd1('0x11')]===0x1f4){logger[_0x0bd1('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x21885a,_0x20d13c[_0x0bd1('0x10')]['message']);return _0x354162(_0x20d13c['error'][_0x0bd1('0x12')]);}logger[_0x0bd1('0x10')](_0x0bd1('0xc'),_0x21885a,_0x20d13c[_0x0bd1('0x10')][_0x0bd1('0x12')]);return _0x2ad5e8(_0x20d13c[_0x0bd1('0x10')][_0x0bd1('0x12')]);}else{logger[_0x0bd1('0xb')](_0x0bd1('0xc'),_0x21885a,_0x0bd1('0xd'));_0x2ad5e8(_0x20d13c[_0x0bd1('0x13')]['message']);}})['catch'](function(_0x17873b){logger[_0x0bd1('0x10')](_0x0bd1('0xc'),_0x21885a,_0x17873b);_0x354162(_0x17873b);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 80deb9b..9487562 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 _0xb4b6=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x2fb3fe,_0x3c9e51){var _0x1b489a=function(_0x3180b3){while(--_0x3180b3){_0x2fb3fe['push'](_0x2fb3fe['shift']());}};_0x1b489a(++_0x3c9e51);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x24119a,_0x3ea966){_0x24119a=_0x24119a-0x0;var _0x318223=_0xb4b6[_0x24119a];return _0x318223;};'use strict';var multer=require('multer');var util=require(_0x6b4b('0x0'));var path=require(_0x6b4b('0x1'));var timeout=require(_0x6b4b('0x2'));var express=require(_0x6b4b('0x3'));var router=express[_0x6b4b('0x4')]();var auth=require(_0x6b4b('0x5'));var interaction=require(_0x6b4b('0x6'));var config=require(_0x6b4b('0x7'));module[_0x6b4b('0x8')]=router; \ No newline at end of file +var _0x565f=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x565f,0x68));var _0xf565=function(_0x22d7a0,_0x15f545){_0x22d7a0=_0x22d7a0-0x0;var _0x277beb=_0x565f[_0x22d7a0];return _0x277beb;};'use strict';var multer=require('multer');var util=require(_0xf565('0x0'));var path=require(_0xf565('0x1'));var timeout=require(_0xf565('0x2'));var express=require('express');var router=express[_0xf565('0x3')]();var auth=require(_0xf565('0x4'));var interaction=require(_0xf565('0x5'));var config=require(_0xf565('0x6'));module[_0xf565('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 378b81b..0ebc2a6 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 _0xd87b=['sequelize','exports'];(function(_0x459c47,_0x46180e){var _0x9cc94b=function(_0x194add){while(--_0x194add){_0x459c47['push'](_0x459c47['shift']());}};_0x9cc94b(++_0x46180e);}(_0xd87b,0x7a));var _0xbd87=function(_0x2023ed,_0x4b39b3){_0x2023ed=_0x2023ed-0x0;var _0x9dbafa=_0xd87b[_0x2023ed];return _0x9dbafa;};'use strict';var Sequelize=require(_0xbd87('0x0'));module[_0xbd87('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3fdb=['INTEGER','sequelize','exports'];(function(_0x224721,_0x414074){var _0x3cb10e=function(_0x29b65e){while(--_0x29b65e){_0x224721['push'](_0x224721['shift']());}};_0x3cb10e(++_0x414074);}(_0x3fdb,0x88));var _0xb3fd=function(_0x4e6a8c,_0x5dff7a){_0x4e6a8c=_0x4e6a8c-0x0;var _0x32c767=_0x3fdb[_0x4e6a8c];return _0x32c767;};'use strict';var Sequelize=require(_0xb3fd('0x0'));module[_0xb3fd('0x1')]={'penalty':{'type':Sequelize[_0xb3fd('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index ace74b1..b5e089d 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 _0x64c7=['api','bluebird','request-promise','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x5038f6,_0x266e0e){var _0x6e4e37=function(_0x427b41){while(--_0x427b41){_0x5038f6['push'](_0x5038f6['shift']());}};_0x6e4e37(++_0x266e0e);}(_0x64c7,0x1b7));var _0x764c=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x64c7[_0x44216d];return _0xeca523;};'use strict';var _=require(_0x764c('0x0'));var util=require(_0x764c('0x1'));var logger=require('../../config/logger')(_0x764c('0x2'));var moment=require('moment');var BPromise=require(_0x764c('0x3'));var rp=require(_0x764c('0x4'));var attributes=require(_0x764c('0x5'));module['exports']=function(_0x34de17,_0x31b512){return _0x34de17[_0x764c('0x6')](_0x764c('0x7'),attributes,{'tableName':_0x764c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5cc=['define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./userOpenchannelQueue.attributes','exports'];(function(_0x183852,_0x2946dc){var _0x5df1c8=function(_0x1d5f03){while(--_0x1d5f03){_0x183852['push'](_0x183852['shift']());}};_0x5df1c8(++_0x2946dc);}(_0xf5cc,0x14c));var _0xcf5c=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0xf5cc[_0x200827];return _0x120047;};'use strict';var _=require(_0xcf5c('0x0'));var util=require(_0xcf5c('0x1'));var logger=require(_0xcf5c('0x2'))(_0xcf5c('0x3'));var moment=require(_0xcf5c('0x4'));var BPromise=require(_0xcf5c('0x5'));var rp=require(_0xcf5c('0x6'));var attributes=require(_0xcf5c('0x7'));module[_0xcf5c('0x8')]=function(_0x1d2838,_0x273073){return _0x1d2838[_0xcf5c('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0xcf5c('0xa'),'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 601dc2a..4525d06 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 _0xc8b5=['stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc8b5,0x1b6));var _0x5c8b=function(_0x55ec9b,_0x12ad19){_0x55ec9b=_0x55ec9b-0x0;var _0x32968c=_0xc8b5[_0x55ec9b];return _0x32968c;};'use strict';var _=require(_0x5c8b('0x0'));var util=require(_0x5c8b('0x1'));var moment=require(_0x5c8b('0x2'));var BPromise=require(_0x5c8b('0x3'));var rs=require(_0x5c8b('0x4'));var fs=require('fs');var Redis=require(_0x5c8b('0x5'));var db=require(_0x5c8b('0x6'))['db'];var utils=require(_0x5c8b('0x7'));var logger=require(_0x5c8b('0x8'))('rpc');var config=require(_0x5c8b('0x9'));var jayson=require(_0x5c8b('0xa'));var client=jayson[_0x5c8b('0xb')][_0x5c8b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31efff,_0x128661,_0x4d71b6){return new BPromise(function(_0x515691,_0x5254e6){return client[_0x5c8b('0xd')](_0x31efff,_0x4d71b6)[_0x5c8b('0xe')](function(_0x44d822){logger[_0x5c8b('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x128661,_0x5c8b('0x10'));logger[_0x5c8b('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x128661,'request\x20sent',JSON[_0x5c8b('0x12')](_0x44d822));if(_0x44d822[_0x5c8b('0x13')]){if(_0x44d822['error'][_0x5c8b('0x14')]===0x1f4){logger[_0x5c8b('0x13')](_0x5c8b('0x15'),_0x128661,_0x44d822[_0x5c8b('0x13')][_0x5c8b('0x16')]);return _0x5254e6(_0x44d822[_0x5c8b('0x13')][_0x5c8b('0x16')]);}logger[_0x5c8b('0x13')](_0x5c8b('0x15'),_0x128661,_0x44d822['error'][_0x5c8b('0x16')]);return _0x515691(_0x44d822['error'][_0x5c8b('0x16')]);}else{logger[_0x5c8b('0xf')](_0x5c8b('0x15'),_0x128661,_0x5c8b('0x10'));_0x515691(_0x44d822['result'][_0x5c8b('0x16')]);}})[_0x5c8b('0x17')](function(_0x4e4e49){logger[_0x5c8b('0x13')](_0x5c8b('0x15'),_0x128661,_0x4e4e49);_0x5254e6(_0x4e4e49);});});} \ No newline at end of file +var _0xdad5=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info'];(function(_0x45cb59,_0x23907b){var _0x9a4e0a=function(_0x1f65eb){while(--_0x1f65eb){_0x45cb59['push'](_0x45cb59['shift']());}};_0x9a4e0a(++_0x23907b);}(_0xdad5,0xa8));var _0x5dad=function(_0x5df708,_0x4de2d4){_0x5df708=_0x5df708-0x0;var _0x24aeda=_0xdad5[_0x5df708];return _0x24aeda;};'use strict';var _=require('lodash');var util=require(_0x5dad('0x0'));var moment=require(_0x5dad('0x1'));var BPromise=require(_0x5dad('0x2'));var rs=require(_0x5dad('0x3'));var fs=require('fs');var Redis=require(_0x5dad('0x4'));var db=require(_0x5dad('0x5'))['db'];var utils=require(_0x5dad('0x6'));var logger=require(_0x5dad('0x7'))(_0x5dad('0x8'));var config=require(_0x5dad('0x9'));var jayson=require(_0x5dad('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3737a2,_0x171a7f,_0x562843){return new BPromise(function(_0x37f88b,_0x330f9b){return client['request'](_0x3737a2,_0x562843)['then'](function(_0x2964f9){logger[_0x5dad('0xb')](_0x5dad('0xc'),_0x171a7f,_0x5dad('0xd'));logger[_0x5dad('0xe')](_0x5dad('0xf'),_0x171a7f,_0x5dad('0xd'),JSON[_0x5dad('0x10')](_0x2964f9));if(_0x2964f9[_0x5dad('0x11')]){if(_0x2964f9[_0x5dad('0x11')]['code']===0x1f4){logger[_0x5dad('0x11')](_0x5dad('0xc'),_0x171a7f,_0x2964f9['error']['message']);return _0x330f9b(_0x2964f9[_0x5dad('0x11')][_0x5dad('0x12')]);}logger[_0x5dad('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x171a7f,_0x2964f9[_0x5dad('0x11')][_0x5dad('0x12')]);return _0x37f88b(_0x2964f9['error'][_0x5dad('0x12')]);}else{logger[_0x5dad('0xb')](_0x5dad('0xc'),_0x171a7f,_0x5dad('0xd'));_0x37f88b(_0x2964f9[_0x5dad('0x13')][_0x5dad('0x12')]);}})['catch'](function(_0x3ce524){logger[_0x5dad('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x171a7f,_0x3ce524);_0x330f9b(_0x3ce524);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 5f89e8b..e137042 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 _0x36f6=['/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addResources','update','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','../../config/environment','./userProfile.controller','get','isAuthenticated','/:id'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x36f6,0x14f));var _0x636f=function(_0x44714c,_0x2ac454){_0x44714c=_0x44714c-0x0;var _0x57d4d5=_0x36f6[_0x44714c];return _0x57d4d5;};'use strict';var multer=require(_0x636f('0x0'));var util=require(_0x636f('0x1'));var path=require(_0x636f('0x2'));var timeout=require(_0x636f('0x3'));var express=require('express');var router=express[_0x636f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x636f('0x5'));var controller=require(_0x636f('0x6'));router[_0x636f('0x7')]('/',auth[_0x636f('0x8')](),controller['index']);router['get']('/describe',auth[_0x636f('0x8')](),controller['describe']);router['get'](_0x636f('0x9'),auth[_0x636f('0x8')](),controller['show']);router[_0x636f('0x7')](_0x636f('0xa'),auth[_0x636f('0x8')](),controller[_0x636f('0xb')]);router[_0x636f('0xc')]('/',auth[_0x636f('0x8')](),controller[_0x636f('0xd')]);router[_0x636f('0xc')](_0x636f('0xe'),auth['isAuthenticated'](),controller[_0x636f('0xf')]);router[_0x636f('0xc')](_0x636f('0x10'),auth[_0x636f('0x8')](),controller['addSections']);router['post'](_0x636f('0xa'),auth[_0x636f('0x8')](),controller[_0x636f('0x11')]);router['put'](_0x636f('0x9'),auth[_0x636f('0x8')](),controller[_0x636f('0x12')]);router[_0x636f('0x13')](_0x636f('0x9'),auth[_0x636f('0x8')](),controller['destroy']);router[_0x636f('0x13')]('/:id/sections',auth[_0x636f('0x8')](),controller[_0x636f('0x14')]);router[_0x636f('0x13')](_0x636f('0xa'),auth[_0x636f('0x8')](),controller[_0x636f('0x15')]);module[_0x636f('0x16')]=router; \ No newline at end of file +var _0x40a6=['index','/describe','describe','/:id','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','put','update','delete','destroy','/:id/sections','removeSections','removeResources','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x40a6,0xde));var _0x640a=function(_0x1846e9,_0xed629e){_0x1846e9=_0x1846e9-0x0;var _0x5f08aa=_0x40a6[_0x1846e9];return _0x5f08aa;};'use strict';var multer=require('multer');var util=require(_0x640a('0x0'));var path=require(_0x640a('0x1'));var timeout=require(_0x640a('0x2'));var express=require(_0x640a('0x3'));var router=express[_0x640a('0x4')]();var auth=require(_0x640a('0x5'));var interaction=require(_0x640a('0x6'));var config=require('../../config/environment');var controller=require(_0x640a('0x7'));router[_0x640a('0x8')]('/',auth[_0x640a('0x9')](),controller[_0x640a('0xa')]);router['get'](_0x640a('0xb'),auth[_0x640a('0x9')](),controller[_0x640a('0xc')]);router[_0x640a('0x8')](_0x640a('0xd'),auth[_0x640a('0x9')](),controller['show']);router['get'](_0x640a('0xe'),auth['isAuthenticated'](),controller[_0x640a('0xf')]);router[_0x640a('0x10')]('/',auth[_0x640a('0x9')](),controller[_0x640a('0x11')]);router[_0x640a('0x10')](_0x640a('0x12'),auth[_0x640a('0x9')](),controller[_0x640a('0x13')]);router[_0x640a('0x10')]('/:id/sections',auth[_0x640a('0x9')](),controller['addSections']);router[_0x640a('0x10')](_0x640a('0xe'),auth[_0x640a('0x9')](),controller[_0x640a('0x14')]);router[_0x640a('0x15')]('/:id',auth[_0x640a('0x9')](),controller[_0x640a('0x16')]);router[_0x640a('0x17')](_0x640a('0xd'),auth['isAuthenticated'](),controller[_0x640a('0x18')]);router[_0x640a('0x17')](_0x640a('0x19'),auth['isAuthenticated'](),controller[_0x640a('0x1a')]);router[_0x640a('0x17')](_0x640a('0xe'),auth[_0x640a('0x9')](),controller[_0x640a('0x1b')]);module[_0x640a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 92a408b..033b481 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 _0x1dd3=['sequelize','STRING','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x31e8a2,_0x157317){var _0x3fe467=function(_0x41d7db){while(--_0x41d7db){_0x31e8a2['push'](_0x31e8a2['shift']());}};_0x3fe467(++_0x157317);}(_0x1dd3,0x1f1));var _0x31dd=function(_0x4c3f13,_0x4c1782){_0x4c3f13=_0x4c3f13-0x0;var _0x74adc6=_0x1dd3[_0x4c3f13];return _0x74adc6;};'use strict';var Sequelize=require(_0x31dd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x31dd('0x1')],'set':function(_0xa5ca96){this[_0x31dd('0x2')](_0x31dd('0x3'),_0xa5ca96?_0xa5ca96[_0x31dd('0x4')](''):[]);},'get':function(){return this[_0x31dd('0x5')](_0x31dd('0x3'))?this[_0x31dd('0x5')](_0x31dd('0x3'))[_0x31dd('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x31dd('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x79c1=['crudPermissions','join','getDataValue','sequelize','STRING','setDataValue'];(function(_0x3b16e1,_0x3bda3e){var _0x311d1b=function(_0x2a979b){while(--_0x2a979b){_0x3b16e1['push'](_0x3b16e1['shift']());}};_0x311d1b(++_0x3bda3e);}(_0x79c1,0xab));var _0x179c=function(_0x8fb8e0,_0x32dd74){_0x8fb8e0=_0x8fb8e0-0x0;var _0xa0259d=_0x79c1[_0x8fb8e0];return _0xa0259d;};'use strict';var Sequelize=require(_0x179c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x179c('0x1')],'set':function(_0x782781){this[_0x179c('0x2')](_0x179c('0x3'),_0x782781?_0x782781[_0x179c('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x179c('0x3'))?this[_0x179c('0x5')](_0x179c('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x179c('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 9dc234b..38d5524 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 _0x6e06=['crypto','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./userProfile.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','rawAttributes','model','keys','filters','intersection','fields','attributes','length','query','hasOwnProperty','order','pick','filter','where','merge','map','type','VIRTUAL','field','options','UserProfile','includeAll','findAll','rows','catch','show','params','include','find','create','body','clone','get','omit','createdAt','updatedAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','transaction','push','ids','addResources','bulkCreate','removeResources','getResources','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','Invalid\x20section\x20\x27','isEmpty','findOne','all','ignore','union','nolimit','sort','foreignKey','associatedResources','forEach','AnalyticExtractedReport','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tags','Tag','ThroughTags','color','tag','value','resourceId','toLowerCase','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','projectName','projects','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','voicemails','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsAccount','teams','Team','voicequeues','users','agents','User','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','Pause','scheduler','Schedule','Sound','tags','templates','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x33132c,_0x34c8e0){var _0x1160bb=function(_0x403df9){while(--_0x403df9){_0x33132c['push'](_0x33132c['shift']());}};_0x1160bb(++_0x34c8e0);}(_0x6e06,0xd4));var _0x66e0=function(_0x51f1bf,_0x402d95){_0x51f1bf=_0x51f1bf-0x0;var _0x481842=_0x6e06[_0x51f1bf];return _0x481842;};'use strict';var pdf=require(_0x66e0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x66e0('0x1'));var zipdir=require(_0x66e0('0x2'));var jsonpatch=require(_0x66e0('0x3'));var rp=require(_0x66e0('0x4'));var moment=require(_0x66e0('0x5'));var BPromise=require(_0x66e0('0x6'));var Mustache=require(_0x66e0('0x7'));var util=require(_0x66e0('0x8'));var path=require(_0x66e0('0x9'));var sox=require(_0x66e0('0xa'));var csv=require(_0x66e0('0xb'));var ejs=require(_0x66e0('0xc'));var fs=require('fs');var _=require(_0x66e0('0xd'));var squel=require(_0x66e0('0xe'));var crypto=require(_0x66e0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x66e0('0x10'));var toCsv=require(_0x66e0('0xb'));var querystring=require('querystring');var Papa=require(_0x66e0('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x66e0('0x12'));var Redis=require(_0x66e0('0x13'));var qs=require(_0x66e0('0x14'));var logger=require('../../config/logger')(_0x66e0('0x15'));var utils=require(_0x66e0('0x16'));var config=require('../../config/environment');var db=require(_0x66e0('0x17'))['db'];config['redis']=_[_0x66e0('0x18')](config[_0x66e0('0x19')],{'host':_0x66e0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66e0('0x19')]));require(_0x66e0('0x1b'))[_0x66e0('0x1c')](socket);function respondWithStatusCode(_0x117a61,_0x397f6c){_0x397f6c=_0x397f6c||0xcc;return function(_0x1cd191){if(_0x1cd191){return _0x117a61[_0x66e0('0x1d')](_0x397f6c);}return _0x117a61[_0x66e0('0x1e')](_0x397f6c)[_0x66e0('0x1f')]();};}function respondWithResult(_0x5579da,_0x292106){_0x292106=_0x292106||0xc8;return function(_0x32a6ba){if(_0x32a6ba){return _0x5579da[_0x66e0('0x1e')](_0x292106)[_0x66e0('0x20')](_0x32a6ba);}};}function respondWithFilteredResult(_0x2319d3,_0xa12d39){return function(_0x2771af){if(_0x2771af){var _0x5d5988=_0x2771af[_0x66e0('0x21')],_0x3a7d38=_0xa12d39[_0x66e0('0x22')],_0x31a131=_0xa12d39[_0x66e0('0x22')]+_0xa12d39[_0x66e0('0x23')],_0x37a5ee;if(_0x31a131>=_0x5d5988){_0x31a131=_0x5d5988;_0x37a5ee=0xc8;}else{_0x37a5ee=0xce;}_0x2319d3[_0x66e0('0x1e')](_0x37a5ee);return _0x2319d3[_0x66e0('0x24')](_0x66e0('0x25'),_0x3a7d38+'-'+_0x31a131+'/'+_0x5d5988)[_0x66e0('0x20')](_0x2771af);}return null;};}function patchUpdates(_0x5321d1){return function(_0x2713f8){try{jsonpatch['apply'](_0x2713f8,_0x5321d1,!![]);}catch(_0x10a0e1){return BPromise[_0x66e0('0x26')](_0x10a0e1);}return _0x2713f8[_0x66e0('0x27')]();};}function saveUpdates(_0x3af5b1,_0x441218){return function(_0x52066a){if(_0x52066a){return _0x52066a['update'](_0x3af5b1)[_0x66e0('0x28')](function(_0x24ac34){return _0x24ac34;});}return null;};}function removeEntity(_0x4709b1,_0x6369a6){return function(_0x453faf){if(_0x453faf){return _0x453faf[_0x66e0('0x29')]()[_0x66e0('0x28')](function(){_0x4709b1[_0x66e0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x174d9b,_0x6b4ed7){return function(_0x48cb06){if(!_0x48cb06){_0x174d9b[_0x66e0('0x1d')](0x194);}return _0x48cb06;};}function handleError(_0x470d0e,_0x2ddc04){_0x2ddc04=_0x2ddc04||0x1f4;return function(_0x4f59d4){logger[_0x66e0('0x2a')](_0x4f59d4['stack']);if(_0x4f59d4[_0x66e0('0x2b')]){delete _0x4f59d4[_0x66e0('0x2b')];}_0x470d0e[_0x66e0('0x1e')](_0x2ddc04)[_0x66e0('0x2c')](_0x4f59d4);};}exports[_0x66e0('0x2d')]=function(_0x10572d,_0x559796){var _0x150044={},_0x3d8122={},_0x72b5e8={'count':0x0,'rows':[]};var _0x41c076=db['UserProfile'][_0x66e0('0x2e')];_0x3d8122[_0x66e0('0x2f')]=_[_0x66e0('0x30')](_0x41c076);_0x3d8122['query']=_[_0x66e0('0x30')](_0x10572d['query']);_0x3d8122[_0x66e0('0x31')]=_[_0x66e0('0x32')](_0x3d8122[_0x66e0('0x2f')],_0x3d8122['query']);_0x150044['attributes']=_[_0x66e0('0x32')](_0x3d8122[_0x66e0('0x2f')],qs[_0x66e0('0x33')](_0x10572d['query'][_0x66e0('0x33')]));_0x150044[_0x66e0('0x34')]=_0x150044['attributes'][_0x66e0('0x35')]?_0x150044[_0x66e0('0x34')]:_0x3d8122[_0x66e0('0x2f')];if(!_0x10572d[_0x66e0('0x36')][_0x66e0('0x37')]('nolimit')){_0x150044[_0x66e0('0x23')]=qs[_0x66e0('0x23')](_0x10572d[_0x66e0('0x36')][_0x66e0('0x23')]);_0x150044['offset']=qs[_0x66e0('0x22')](_0x10572d[_0x66e0('0x36')]['offset']);}_0x150044[_0x66e0('0x38')]=qs['sort'](_0x10572d['query']['sort']);_0x150044['where']=qs[_0x66e0('0x31')](_[_0x66e0('0x39')](_0x10572d[_0x66e0('0x36')],_0x3d8122[_0x66e0('0x31')]));if(_0x10572d[_0x66e0('0x36')][_0x66e0('0x3a')]){_0x150044[_0x66e0('0x3b')]=_[_0x66e0('0x3c')](_0x150044[_0x66e0('0x3b')],{'$or':_[_0x66e0('0x3d')](_0x41c076,function(_0x16f652){if(_0x16f652[_0x66e0('0x3e')]['key']!==_0x66e0('0x3f')){var _0x21dffd={};_0x21dffd[_0x16f652[_0x66e0('0x40')]]={'$like':'%'+_0x10572d[_0x66e0('0x36')][_0x66e0('0x3a')]+'%'};return _0x21dffd;}})});}_0x150044=_[_0x66e0('0x3c')]({},_0x150044,_0x10572d[_0x66e0('0x41')]);var _0xb60a53={'where':_0x150044[_0x66e0('0x3b')]};return db[_0x66e0('0x42')]['count'](_0xb60a53)[_0x66e0('0x28')](function(_0x21bc88){_0x72b5e8['count']=_0x21bc88;if(_0x10572d[_0x66e0('0x36')][_0x66e0('0x43')]){_0x150044['include']=[{'all':!![]}];}return db[_0x66e0('0x42')][_0x66e0('0x44')](_0x150044);})[_0x66e0('0x28')](function(_0x532ffa){_0x72b5e8[_0x66e0('0x45')]=_0x532ffa;return _0x72b5e8;})[_0x66e0('0x28')](respondWithFilteredResult(_0x559796,_0x150044))[_0x66e0('0x46')](handleError(_0x559796,null));};exports[_0x66e0('0x47')]=function(_0x3cda14,_0x232e19){var _0x582673={'raw':![],'where':{'id':_0x3cda14[_0x66e0('0x48')]['id']}},_0x29d746={};_0x29d746[_0x66e0('0x2f')]=_[_0x66e0('0x30')](db[_0x66e0('0x42')]['rawAttributes']);_0x29d746['query']=_['keys'](_0x3cda14[_0x66e0('0x36')]);_0x29d746[_0x66e0('0x31')]=_[_0x66e0('0x32')](_0x29d746['model'],_0x29d746[_0x66e0('0x36')]);_0x582673[_0x66e0('0x34')]=_[_0x66e0('0x32')](_0x29d746[_0x66e0('0x2f')],qs['fields'](_0x3cda14['query'][_0x66e0('0x33')]));_0x582673['attributes']=_0x582673[_0x66e0('0x34')][_0x66e0('0x35')]?_0x582673['attributes']:_0x29d746['model'];if(_0x3cda14[_0x66e0('0x36')][_0x66e0('0x43')]){_0x582673[_0x66e0('0x49')]=[{'all':!![]}];}_0x582673=_[_0x66e0('0x3c')]({},_0x582673,_0x3cda14[_0x66e0('0x41')]);return db['UserProfile'][_0x66e0('0x4a')](_0x582673)['then'](handleEntityNotFound(_0x232e19,null))[_0x66e0('0x28')](respondWithResult(_0x232e19,null))[_0x66e0('0x46')](handleError(_0x232e19,null));};exports[_0x66e0('0x4b')]=function(_0x19666e,_0x111879){return db[_0x66e0('0x42')][_0x66e0('0x4b')](_0x19666e[_0x66e0('0x4c')],{})['then'](respondWithResult(_0x111879,0xc9))[_0x66e0('0x46')](handleError(_0x111879,null));};exports[_0x66e0('0x4d')]=function(_0x4f441b,_0x557045){var _0x3af49a={'raw':![],'where':{'id':_0x4f441b[_0x66e0('0x48')]['id']}},_0x3e3862={};_0x3e3862[_0x66e0('0x2f')]=_[_0x66e0('0x30')](db['UserProfile'][_0x66e0('0x2e')]);_0x3af49a[_0x66e0('0x34')]=_[_0x66e0('0x32')](_0x3e3862[_0x66e0('0x2f')],qs[_0x66e0('0x33')](_0x4f441b[_0x66e0('0x36')][_0x66e0('0x33')]));_0x3af49a['attributes']=_0x3af49a['attributes']['length']?_0x3af49a[_0x66e0('0x34')]:_0x3e3862[_0x66e0('0x2f')];if(_0x4f441b[_0x66e0('0x36')][_0x66e0('0x43')]){_0x3af49a[_0x66e0('0x49')]=[{'all':!![]}];}_0x3af49a=_[_0x66e0('0x3c')]({},_0x3af49a,_0x4f441b['options']);return db[_0x66e0('0x42')]['find'](_0x3af49a)[_0x66e0('0x28')](handleEntityNotFound(_0x557045,null))['then'](function(_0x4becfb){if(_0x4becfb){var _0x1a4c51=_0x4becfb[_0x66e0('0x4e')]({'plain':!![]});_0x1a4c51=qs[_0x66e0('0x4f')](_0x1a4c51,['id',_0x66e0('0x50'),'updatedAt','crudPermissions']);_0x4f441b[_0x66e0('0x4c')]=_[_0x66e0('0x4f')](_0x4f441b[_0x66e0('0x4c')],['id',_0x66e0('0x50'),_0x66e0('0x51')]);return db[_0x66e0('0x52')]['transaction'](function(_0x3f39bb){return db[_0x66e0('0x42')][_0x66e0('0x4b')](_[_0x66e0('0x3c')](_0x1a4c51,_0x4f441b[_0x66e0('0x4c')]),{'include':_0x4f441b[_0x66e0('0x36')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3f39bb})['then'](function(_0x34018a){var _0x351e74=_0x34018a[_0x66e0('0x4e')]({'plain':!![]});return db[_0x66e0('0x53')][_0x66e0('0x44')]({'where':{'userProfileId':_0x4f441b['params']['id']},'raw':!![]})['then'](function(_0x8cedd9){if(_0x8cedd9){return BPromise[_0x66e0('0x54')](_0x8cedd9,function(_0x5b819a){return new BPromise(function(_0x38dbb6,_0x1aed6d){if(_0x5b819a[_0x66e0('0x55')]===null||_0x5b819a[_0x66e0('0x55')]===0x1)_0x38dbb6(null);return db[_0x66e0('0x56')][_0x66e0('0x44')]({'where':{'sectionId':_0x5b819a['id']},'raw':!![]})[_0x66e0('0x28')](function(_0x2ece8e){var _0x40ec0d=_[_0x66e0('0x3d')](_0x2ece8e,function(_0xedf6a6){return qs[_0x66e0('0x4f')](_0xedf6a6,['id',_0x66e0('0x50'),_0x66e0('0x51'),_0x66e0('0x57')]);});_0x38dbb6(_0x40ec0d);})[_0x66e0('0x46')](function(_0x370a65){_0x1aed6d(_0x370a65);});})[_0x66e0('0x28')](function(_0x32640){var _0x56b6bd=qs[_0x66e0('0x4f')](_0x5b819a,['id',_0x66e0('0x50'),'updatedAt']);_0x56b6bd[_0x66e0('0x58')]=_0x351e74['id'];if(_0x32640)_0x56b6bd[_0x66e0('0x59')]=_0x32640;return _0x56b6bd;})[_0x66e0('0x28')](function(_0x17a6af){return db[_0x66e0('0x53')][_0x66e0('0x4b')](_0x17a6af,{'include':[{'model':db[_0x66e0('0x56')],'as':_0x66e0('0x59')}],'raw':!![],'transaction':_0x3f39bb});});})[_0x66e0('0x28')](function(){return _0x351e74;});}});});});}})[_0x66e0('0x28')](respondWithResult(_0x557045,0xc9))['catch'](handleError(_0x557045,null));};exports[_0x66e0('0x5a')]=function(_0x1f33b8,_0x13f939){if(_0x1f33b8[_0x66e0('0x4c')]['id']){delete _0x1f33b8['body']['id'];}return db[_0x66e0('0x42')][_0x66e0('0x4a')]({'where':{'id':_0x1f33b8[_0x66e0('0x48')]['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x13f939,null))[_0x66e0('0x28')](saveUpdates(_0x1f33b8[_0x66e0('0x4c')],null))[_0x66e0('0x28')](respondWithResult(_0x13f939,null))['catch'](handleError(_0x13f939,null));};exports[_0x66e0('0x29')]=function(_0x2bc05b,_0x3c6125){return db[_0x66e0('0x42')][_0x66e0('0x4a')]({'where':{'id':_0x2bc05b[_0x66e0('0x48')]['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x3c6125,null))[_0x66e0('0x28')](removeEntity(_0x3c6125,null))[_0x66e0('0x46')](handleError(_0x3c6125,null));};exports[_0x66e0('0x5b')]=function(_0x4f5412,_0x33107b){return db[_0x66e0('0x42')][_0x66e0('0x5b')]()[_0x66e0('0x28')](respondWithResult(_0x33107b,null))['catch'](handleError(_0x33107b,null));};exports[_0x66e0('0x5c')]=function(_0x5148fb,_0x578300){var _0x65509d=_0x5148fb[_0x66e0('0x4c')];return db[_0x66e0('0x42')][_0x66e0('0x4a')]({'where':{'id':_0x5148fb['params']['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x578300,null))['then'](function(_0x48ae7f){if(_0x48ae7f){return db['sequelize'][_0x66e0('0x5d')](function(_0x1cd39f){return db[_0x66e0('0x53')][_0x66e0('0x29')]({'where':{'userProfileId':_0x5148fb[_0x66e0('0x48')]['id'],'sectionId':_['map'](_0x65509d,function(_0x510e6e){return _0x510e6e[_0x66e0('0x57')];})},'transaction':_0x1cd39f})[_0x66e0('0x28')](function(){var _0x2c0bc0=_[_0x66e0('0x3d')](_0x65509d,function(_0x536c88){_0x536c88[_0x66e0('0x58')]=_0x5148fb[_0x66e0('0x48')]['id'];return _0x536c88;});var _0x1442af=[];return BPromise[_0x66e0('0x54')](_0x2c0bc0,function(_0x5bbea8){return db[_0x66e0('0x53')]['create'](_0x5bbea8,{'include':[{'model':db[_0x66e0('0x56')],'as':_0x66e0('0x59')}],'raw':!![],'transaction':_0x1cd39f})[_0x66e0('0x28')](function(_0x291452){_0x1442af[_0x66e0('0x5e')](_0x291452['get']({'plain':!![]}));});})[_0x66e0('0x28')](function(){return _0x1442af;});});});}})[_0x66e0('0x28')](function(_0x21f7a6){return _0x21f7a6;})[_0x66e0('0x28')](respondWithResult(_0x578300,null))[_0x66e0('0x46')](handleError(_0x578300,null));};exports['removeSections']=function(_0x3ae8f4,_0x439727){var _0x574454;return db['UserProfile']['find']({'where':{'id':_0x3ae8f4[_0x66e0('0x48')]['id']},'attributes':['id',_0x66e0('0x2b')]})[_0x66e0('0x28')](handleEntityNotFound(_0x439727,null))['then'](function(_0x55a640){if(_0x55a640){_0x574454=_0x55a640;return db[_0x66e0('0x53')][_0x66e0('0x29')]({'where':{'userProfileId':_0x3ae8f4['params']['id'],'sectionId':_0x3ae8f4[_0x66e0('0x36')][_0x66e0('0x5f')]}});}})[_0x66e0('0x28')](function(){return _0x574454;})[_0x66e0('0x28')](respondWithStatusCode(_0x439727,null))[_0x66e0('0x46')](handleError(_0x439727,null));};exports[_0x66e0('0x60')]=function(_0x1a46b5,_0x481c3e){return db['UserProfile'][_0x66e0('0x4a')]({'where':{'id':_0x1a46b5[_0x66e0('0x48')]['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x481c3e,null))[_0x66e0('0x28')](function(_0x585c66){if(_0x585c66){return db[_0x66e0('0x52')]['transaction'](function(_0x4ea663){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1a46b5[_0x66e0('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x66e0('0x28')](function(_0x5d502f){if(_0x5d502f){return db[_0x66e0('0x53')][_0x66e0('0x29')]({'where':{'userProfileId':_0x1a46b5[_0x66e0('0x48')]['id'],'id':_[_0x66e0('0x3d')](_0x5d502f,function(_0x41b0aa){return _0x41b0aa['id'];})},'transaction':_0x4ea663});}})[_0x66e0('0x28')](function(_0x1cdf72){var _0x3e50c9=_[_0x66e0('0x3d')](_0x1a46b5[_0x66e0('0x4c')],function(_0x1dca17){_0x1dca17[_0x66e0('0x58')]=_0x1a46b5[_0x66e0('0x48')]['id'];return _0x1dca17;});return db[_0x66e0('0x53')][_0x66e0('0x61')](_0x3e50c9,{'raw':!![],'transaction':_0x4ea663});})[_0x66e0('0x28')](function(_0x570d3c){var _0x11eb72=_[_0x66e0('0x3a')](_[_0x66e0('0x3d')](_0x570d3c,function(_0x59b5cc){return _0x59b5cc['get']({'plain':!![]});}),{'includeAll':![]});if(_0x11eb72){return db[_0x66e0('0x53')][_0x66e0('0x44')]({'where':{'userProfileId':_0x1a46b5[_0x66e0('0x48')]['id'],'sectionId':_[_0x66e0('0x3d')](_0x11eb72,function(_0x50e513){return _0x50e513['sectionId'];})},'attributes':['id',_0x66e0('0x57')],'raw':!![]})[_0x66e0('0x28')](function(_0x530149){var _0x116b7a=_[_0x66e0('0x3d')](_0x1a46b5['body'],function(_0x28fa3c){_0x28fa3c[_0x66e0('0x58')]=_0x1a46b5[_0x66e0('0x48')]['id'];return _0x28fa3c;});return db['UserProfileResource'][_0x66e0('0x61')](_0x116b7a,{'raw':!![],'transaction':_0x4ea663});});}})['catch'](handleError(_0x481c3e,null));});}})['then'](function(_0x87ab3){var _0x40c1f5=_[_0x66e0('0x3d')](_0x87ab3,function(_0x4def53){return _0x4def53[_0x66e0('0x4e')]({'plain':!![]});});})[_0x66e0('0x28')](respondWithResult(_0x481c3e,null))[_0x66e0('0x46')](handleError(_0x481c3e,null));};exports[_0x66e0('0x62')]=function(_0x810b26,_0xd2996a,_0x5d1075){var _0x477717;return db[_0x66e0('0x42')][_0x66e0('0x4a')]({'where':{'id':_0x810b26[_0x66e0('0x48')]['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0xd2996a,null))[_0x66e0('0x28')](function(_0x43942){if(_0x43942){return _0x43942['removeResources'](_0x810b26[_0x66e0('0x36')]['ids']);}})[_0x66e0('0x28')](respondWithStatusCode(_0xd2996a,null))[_0x66e0('0x46')](handleError(_0xd2996a,null));};exports[_0x66e0('0x63')]=function(_0x5cc132,_0x94ddf9){var _0xe890c1={'raw':![],'where':{}};var _0x4ea465={};var _0x11b66a={'count':0x0,'rows':[]};var _0x4ba108=_0x5cc132['query']['section'];if(typeof _0x4ba108===_0x66e0('0x64')){throw new db[(_0x66e0('0x65'))][(_0x66e0('0x66'))](_0x66e0('0x67'));}var _0x206648=_0x5cc132[_0x66e0('0x36')]['mergeResources']||![];var _0x5f06ef=getQueryModels(_0x4ba108,_0x206648);if(typeof _0x5f06ef[_0x66e0('0x68')]===_0x66e0('0x64')){throw new db[(_0x66e0('0x65'))][(_0x66e0('0x66'))](_0x66e0('0x69')+_0x4ba108+'\x27');}var _0x20e52c=[];if(!_[_0x66e0('0x6a')](_0x5f06ef['parentSections'])){_0x20e52c=_0x5f06ef['parentSections'];}else{_0x20e52c=[{'name':_0x4ba108}];}return db[_0x66e0('0x42')][_0x66e0('0x6b')]({'where':{'id':_0x5cc132[_0x66e0('0x48')]['id']}})['then'](handleEntityNotFound(_0x94ddf9,null))[_0x66e0('0x28')](function(_0x50a29b){if(_0x50a29b){var _0x33aef6=[];for(var _0x26e516=0x0;_0x26e516<_0x20e52c[_0x66e0('0x35')];_0x26e516++){_0x33aef6[_0x66e0('0x5e')](db[_0x66e0('0x53')]['findOne']({'where':{'userProfileId':_0x50a29b['id'],'name':_0x20e52c[_0x26e516][_0x66e0('0x2b')]},'raw':!![]}));}return BPromise[_0x66e0('0x6c')](_0x33aef6);}})['then'](function(_0x3c87b1){var _0x2fb40b=_[_0x66e0('0x3a')](_0x3c87b1,function(_0x6beb0f){return _0x6beb0f?_0x6beb0f:undefined;});var _0x370f58=_[_0x66e0('0x3a')](_0x20e52c,[_0x66e0('0x6d'),!![]]);var _0x2912c5=_['isEmpty'](_0x2fb40b)&&_['isEmpty'](_0x370f58)?null:_[_0x66e0('0x6e')](_0x370f58,_0x2fb40b);if(_0x2912c5){var _0x2d1912=[];for(var _0x3c2dfe=0x0;_0x3c2dfe<_0x2912c5[_0x66e0('0x35')];_0x3c2dfe++){var _0x2ae578=_[_0x66e0('0x4a')](_0x20e52c,function(_0x15d332){return _0x2912c5[_0x3c2dfe]?_0x15d332[_0x66e0('0x2b')]===_0x2912c5[_0x3c2dfe]['name']:null;});if(_0x2ae578){if(_0x2912c5[_0x3c2dfe]['ignore']){_0x2d1912[_0x66e0('0x5e')](getAllResources(_0x5f06ef[_0x66e0('0x68')],_0x2912c5[_0x3c2dfe]));}else{if(!_0x2912c5[_0x3c2dfe]['autoAssociation']){_0x2d1912['push'](getAllowedResources(_0x2ae578,_0x2912c5[_0x3c2dfe]));}else{if(_0x2ae578['model']){_0x2d1912[_0x66e0('0x5e')](getAllFilteredResources(_0x2ae578,_0x2912c5[_0x3c2dfe]));}}}}}return BPromise['all'](_0x2d1912);}else{return null;}})[_0x66e0('0x28')](function(_0x469453){var _0x13b6a6=_0x469453;var _0x44b726=null;if(_0x13b6a6){_0x44b726=_0x13b6a6['length']===0x1?_0x13b6a6[0x0]:null;}if(_0x44b726||_0x13b6a6){var _0x5daccd=db[_0x5f06ef[_0x66e0('0x68')]][_0x66e0('0x2e')];_0x4ea465[_0x66e0('0x2f')]=_[_0x66e0('0x30')](_0x5daccd);_0x4ea465['query']=_[_0x66e0('0x30')](_0x5cc132[_0x66e0('0x36')]);_0x4ea465[_0x66e0('0x31')]=_['intersection'](_0x4ea465['model'],_0x4ea465[_0x66e0('0x36')]);_0xe890c1[_0x66e0('0x34')]=_[_0x66e0('0x32')](_0x4ea465['model'],qs['fields'](_0x5cc132[_0x66e0('0x36')][_0x66e0('0x33')]));_0xe890c1[_0x66e0('0x34')]=_0xe890c1[_0x66e0('0x34')]['length']?_0xe890c1[_0x66e0('0x34')]:_0x4ea465[_0x66e0('0x2f')];if(!_0x5cc132[_0x66e0('0x36')][_0x66e0('0x37')](_0x66e0('0x6f'))){_0xe890c1['limit']=qs[_0x66e0('0x23')](_0x5cc132[_0x66e0('0x36')][_0x66e0('0x23')]);_0xe890c1[_0x66e0('0x22')]=qs['offset'](_0x5cc132[_0x66e0('0x36')]['offset']);}_0xe890c1[_0x66e0('0x38')]=qs[_0x66e0('0x70')](_0x5cc132['query']['sort']);_0xe890c1[_0x66e0('0x3b')]=qs['filters'](_[_0x66e0('0x39')](_0x5cc132['query'],_0x4ea465[_0x66e0('0x31')]));if(_0x5cc132['query']['filter']){_0xe890c1['where']=_[_0x66e0('0x3c')](_0xe890c1[_0x66e0('0x3b')],{'$or':_[_0x66e0('0x3d')](_0x5daccd,function(_0x21e55b){if(_0x21e55b[_0x66e0('0x3e')]['key']!==_0x66e0('0x3f')){var _0x46d4bd={};_0x46d4bd[_0x21e55b['field']]={'$like':'%'+_0x5cc132['query'][_0x66e0('0x3a')]+'%'};return _0x46d4bd;}})});}var _0x259644=[];if(_0x44b726){var _0x43185f=_[_0x66e0('0x4a')](_0x20e52c,['name',_0x44b726['name']]);if(_0x43185f[_0x66e0('0x40')]){var _0x45ec3a={};_0x45ec3a[_0x43185f[_0x66e0('0x71')]]=_0x44b726[_0x66e0('0x72')];_0x259644[_0x66e0('0x5e')](_0x45ec3a);}else{_0xe890c1['where']['id']=_0x44b726[_0x66e0('0x72')];}}else{for(var _0x413ca1=0x0;_0x413ca1<_0x13b6a6['length'];_0x413ca1++){var _0x43185f=_[_0x66e0('0x4a')](_0x20e52c,[_0x66e0('0x2b'),_0x13b6a6[_0x413ca1][_0x66e0('0x2b')]]);if(_0x43185f[_0x66e0('0x40')]){var _0x45ec3a={};_0x45ec3a[_0x43185f['foreignKey']]=_0x13b6a6[_0x413ca1][_0x66e0('0x72')];_0x259644[_0x66e0('0x5e')](_0x45ec3a);}else{if(!_0xe890c1['where']['id'])_0xe890c1[_0x66e0('0x3b')]['id']=[];_0x13b6a6[_0x413ca1][_0x66e0('0x72')][_0x66e0('0x73')](function(_0x5014af){_0xe890c1[_0x66e0('0x3b')]['id'][_0x66e0('0x5e')](_0x5014af);});}}}if(!_[_0x66e0('0x6a')](_0x259644)){_0xe890c1[_0x66e0('0x3b')]=_['merge'](_0xe890c1[_0x66e0('0x3b')],{'$and':{'$or':_0x259644}});}_0xe890c1=_[_0x66e0('0x3c')]({},_0xe890c1,_0x5cc132[_0x66e0('0x41')]);if(_0x44b726&&!_0x44b726[_0x66e0('0x55')]&&_0x5f06ef[_0x66e0('0x68')]===_0x66e0('0x74')){if(_0x5cc132['query'][_0x66e0('0x43')]){_0xe890c1[_0x66e0('0x49')]=[{'all':!![]}];}return db[_0x5f06ef[_0x66e0('0x68')]][_0x66e0('0x44')](_0xe890c1)['then'](function(_0x4a16be){var _0x2d9526=[];_0x4a16be[_0x66e0('0x73')](function(_0xe291f3){var _0x2f8fa4;switch(_0xe291f3['reportType']){case _0x66e0('0x75'):_0x2f8fa4=_[_0x66e0('0x4a')](_0x44b726[_0x66e0('0x72')],function(_0x3ec1a5){return _0x3ec1a5['id']===_0xe291f3[_0x66e0('0x76')]&&_0x3ec1a5[_0x66e0('0x3e')]===_0x66e0('0x77');});break;case _0x66e0('0x78'):_0x2f8fa4=_[_0x66e0('0x4a')](_0x44b726['associatedResources'],function(_0x3b7b5a){return _0x3b7b5a['id']===_0xe291f3[_0x66e0('0x76')]&&_0x3b7b5a[_0x66e0('0x3e')]===_0x66e0('0x79');});break;}if(_0x2f8fa4)_0x2d9526[_0x66e0('0x5e')](_0xe291f3);});_0x11b66a[_0x66e0('0x21')]=_0x2d9526[_0x66e0('0x35')];_0x11b66a[_0x66e0('0x45')]=_0x2d9526;return _0x11b66a;});}else{return db[_0x5f06ef[_0x66e0('0x68')]][_0x66e0('0x21')]({'where':_0xe890c1[_0x66e0('0x3b')]})[_0x66e0('0x28')](function(_0x3cdc59){_0x11b66a[_0x66e0('0x21')]=_0x3cdc59;if(_0x5cc132[_0x66e0('0x36')][_0x66e0('0x43')]){if(_0x5f06ef['childModel']===_0x66e0('0x7a')){_0xe890c1[_0x66e0('0x49')]=[{'model':db['Tag'],'as':_0x66e0('0x7b'),'attributes':['id',_0x66e0('0x2b'),'color'],'required':_0x5cc132[_0x66e0('0x36')]['tag']?!![]:![]},{'model':db[_0x66e0('0x7c')],'as':_0x66e0('0x7d'),'attributes':['id','name',_0x66e0('0x7e')],'through':_0x5cc132['query']['tag']?{'attributes':[],'where':{'TagId':_0x5cc132[_0x66e0('0x36')][_0x66e0('0x7f')]||undefined}}:{},'required':_0x5cc132[_0x66e0('0x36')][_0x66e0('0x7f')]?!![]:![]}];}else{_0xe890c1[_0x66e0('0x49')]=[{'all':!![]}];}}return db[_0x5f06ef[_0x66e0('0x68')]][_0x66e0('0x44')](_0xe890c1);})[_0x66e0('0x28')](function(_0x59ddef){_0x11b66a[_0x66e0('0x45')]=_0x59ddef;return _0x11b66a;});}}else{return _0x11b66a;}})['then'](respondWithFilteredResult(_0x94ddf9,_0xe890c1))['catch'](handleError(_0x94ddf9,null));};function getAllResources(_0x351ed0,_0x16e3ba){return new BPromise(function(_0x15d0de,_0x4c51e4){if(_0x16e3ba){var _0x1f2163=_0x16e3ba[_0x66e0('0x3a')]?{[_0x16e3ba[_0x66e0('0x3a')][_0x66e0('0x40')]]:_0x16e3ba['filter'][_0x66e0('0x80')]}:undefined;return db[_0x351ed0][_0x66e0('0x44')]({'where':_0x1f2163,'raw':!![]})[_0x66e0('0x28')](function(_0x3fa4e0){_0x16e3ba['associatedResources']=_[_0x66e0('0x3d')](_0x3fa4e0,'id');_0x15d0de(_0x16e3ba);})[_0x66e0('0x46')](function(_0x571dc3){_0x4c51e4(_0x571dc3);});}else{_0x15d0de(null);}});}function getAllFilteredResources(_0x305129,_0x59e3ce){return new BPromise(function(_0xc7fa33,_0x91120f){var _0x588374=_0x305129[_0x66e0('0x3a')]?{[_0x305129['filter']['field']]:_0x305129[_0x66e0('0x3a')][_0x66e0('0x80')]}:undefined;return db[_0x305129['model']][_0x66e0('0x44')]({'where':_0x588374,'raw':!![]})[_0x66e0('0x28')](function(_0xa081a7){_0x59e3ce[_0x66e0('0x72')]=_['map'](_0xa081a7,function(_0x627bb4){return _0x627bb4['name'];});_0xc7fa33(_0x59e3ce);})[_0x66e0('0x46')](function(_0x56317c){_0x91120f(_0x56317c);});});}function getAllowedResources(_0x508575,_0x2534ee){return new BPromise(function(_0xae4e1f,_0x31e9c3){if(_0x2534ee){return db[_0x66e0('0x56')][_0x66e0('0x44')]({'where':{'sectionId':_0x2534ee['id']},'raw':!![]})[_0x66e0('0x28')](function(_0x2fa7d3){if(_0x508575[_0x66e0('0x40')]&&_0x508575[_0x66e0('0x40')]!=='id'){_0x2534ee[_0x66e0('0x72')]=_[_0x66e0('0x3d')](_0x2fa7d3,function(_0x1ae446){return _0x1ae446[_0x508575['field']];});}else{if(_0x508575[_0x66e0('0x68')]===_0x66e0('0x74')){_0x2534ee['associatedResources']=_[_0x66e0('0x3d')](_0x2fa7d3,function(_0x32520b){return{'id':_0x32520b[_0x66e0('0x81')],'type':_0x32520b[_0x66e0('0x3e')]};});}else{_0x2534ee[_0x66e0('0x72')]=_[_0x66e0('0x3d')](_0x2fa7d3,function(_0x196e75){return _0x196e75[_0x66e0('0x81')];});}}_0xae4e1f(_0x2534ee);})[_0x66e0('0x46')](function(_0x536b1b){_0x31e9c3(_0x536b1b);});}else{_0xae4e1f(null);}});}function getQueryModels(_0x6db138,_0x4dcce8){var _0x23efdf=_0x6db138[_0x66e0('0x82')]();var _0x56ac73={'childModel':undefined,'parentSections':[]};switch(_0x23efdf){case'squareprojects':_0x56ac73['childModel']=_0x66e0('0x83');break;case _0x66e0('0x84'):_0x56ac73[_0x66e0('0x68')]='SquareOdbc';break;case _0x66e0('0x85'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0x86');_0x56ac73[_0x66e0('0x87')]=[{'name':'SquareProjects','field':_0x66e0('0x2b'),'foreignKey':_0x66e0('0x88')}];break;case _0x66e0('0x89'):_0x56ac73[_0x66e0('0x68')]='JscriptyProject';break;case _0x66e0('0x8a'):_0x56ac73['childModel']=_0x66e0('0x7a');_0x56ac73[_0x66e0('0x87')]=[{'name':_0x66e0('0x8b'),'field':'id','foreignKey':'ListId'}];break;case _0x66e0('0x8c'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0x8d');break;case _0x66e0('0x8e'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0x8f');break;case _0x66e0('0x90'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0x91');break;case _0x66e0('0x92'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0x93');break;case _0x66e0('0x94'):_0x56ac73['childModel']='ChatWebsite';break;case _0x66e0('0x95'):_0x56ac73[_0x66e0('0x68')]='FaxQueue';break;case _0x66e0('0x96'):_0x56ac73['childModel']=_0x66e0('0x97');break;case _0x66e0('0x98'):case'internalroutes':case _0x66e0('0x99'):_0x56ac73[_0x66e0('0x68')]='VoiceExtension';break;case _0x66e0('0x9a'):_0x56ac73['childModel']='VoiceContext';break;case _0x66e0('0x9b'):_0x56ac73[_0x66e0('0x68')]='VoiceMail';break;case _0x66e0('0x9c'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0x9d');_0x56ac73[_0x66e0('0x87')]=[{'name':_0x66e0('0x9e'),'field':_0x66e0('0x2b'),'foreignKey':_0x66e0('0x9f'),'model':'User','filter':{'field':_0x66e0('0xa0'),'value':[_0x66e0('0xa1')]}},{'name':_0x66e0('0xa2'),'field':_0x66e0('0x2b'),'foreignKey':_0x66e0('0x9f'),'model':'User','filter':{'field':'role','value':[_0x66e0('0xa3')]}},{'name':_0x66e0('0xa4'),'field':_0x66e0('0x2b'),'foreignKey':'queue','model':_0x66e0('0xa5'),'filter':{'field':_0x66e0('0x3e'),'value':[_0x66e0('0xa6')]}},{'name':_0x66e0('0xa7'),'field':_0x66e0('0x2b'),'foreignKey':_0x66e0('0xa8'),'model':_0x66e0('0xa5'),'filter':{'field':_0x66e0('0x3e'),'value':[_0x66e0('0xa9')]}}];break;case _0x66e0('0xaa'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xab');break;case _0x66e0('0xac'):_0x56ac73[_0x66e0('0x68')]='VoiceChanSpy';break;case _0x66e0('0xad'):_0x56ac73['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xae');break;case _0x66e0('0xaf'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xb0');break;case _0x66e0('0xb1'):_0x56ac73[_0x66e0('0x68')]='MailAccount';break;case _0x66e0('0xb2'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xb3');break;case _0x66e0('0xb4'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xb5');break;case'openchannelaccounts':_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xb6');break;case _0x66e0('0xb7'):_0x56ac73[_0x66e0('0x68')]='SmsQueue';break;case'smsaccounts':_0x56ac73['childModel']=_0x66e0('0xb8');break;case _0x66e0('0xb9'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xba');break;case _0x66e0('0xbb'):case'queuecampaigns':_0x56ac73['childModel']='VoiceQueue';if(_0x4dcce8){_0x56ac73[_0x66e0('0x87')]=[{'name':_0x66e0('0xa4')},{'name':'QueueCampaigns'}];}break;case _0x66e0('0xbc'):case _0x66e0('0xbd'):case'telephones':_0x56ac73['childModel']=_0x66e0('0xbe');if(_0x4dcce8){_0x56ac73[_0x66e0('0x87')]=[{'name':_0x66e0('0xbf'),'filter':{'field':_0x66e0('0xa0'),'value':[_0x66e0('0xc0'),_0x66e0('0xc1')]},'ignore':!![]},{'name':_0x66e0('0x9e')},{'name':_0x66e0('0xa2')}];}break;case _0x66e0('0xc2'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xc3');break;case _0x66e0('0xc4'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xc5');break;case _0x66e0('0xc6'):_0x56ac73[_0x66e0('0x68')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x56ac73[_0x66e0('0x68')]='SugarcrmAccount';break;case _0x66e0('0xc7'):_0x56ac73['childModel']=_0x66e0('0xc8');break;case _0x66e0('0xc9'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xca');break;case _0x66e0('0xcb'):_0x56ac73['childModel']=_0x66e0('0xbe');break;case _0x66e0('0xcc'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xcd');break;case _0x66e0('0xce'):_0x56ac73['childModel']=_0x66e0('0xcf');break;case _0x66e0('0xd0'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xd1');break;case _0x66e0('0xd2'):_0x56ac73[_0x66e0('0x68')]='Interval';break;case _0x66e0('0xd3'):_0x56ac73['childModel']=_0x66e0('0xd4');break;case _0x66e0('0xd5'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xd6');break;case'sounds':_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xd7');break;case _0x66e0('0xd8'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0x7c');break;case _0x66e0('0xd9'):_0x56ac73[_0x66e0('0x68')]='Template';break;case _0x66e0('0xda'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xdb');break;case _0x66e0('0xdc'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xdd');break;case _0x66e0('0xde'):_0x56ac73['childModel']=_0x66e0('0xdf');break;case _0x66e0('0xe0'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0xe1');break;case _0x66e0('0xe2'):_0x56ac73[_0x66e0('0x68')]=_0x66e0('0x74');_0x56ac73[_0x66e0('0x87')]=[{'name':'Reports','field':'id','foreignKey':_0x66e0('0x76')}];break;case'metrics':_0x56ac73[_0x66e0('0x68')]='AnalyticMetric';break;default:return _0x56ac73;}return _0x56ac73;} \ No newline at end of file +var _0x6b23=['stack','name','index','rawAttributes','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','UserProfile','count','include','findAll','rows','catch','params','includeAll','options','find','create','body','clone','get','omit','createdAt','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','push','removeSections','addResources','bulkCreate','removeResources','ids','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','all','isEmpty','union','pick','type','key','field','foreignKey','associatedResources','forEach','AnalyticExtractedReport','reportType','default','DefaultReports','reportId','CustomReports','CmContact','Tags','tag','Tag','ThroughTags','color','value','resourceId','squareprojects','SquareProject','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','Agents','User','role','agent','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','Team','voicequeues','queuecampaigns','VoiceQueues','agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','Dashboard','Interval','pauses','Pause','scheduler','sounds','templates','triggers','Trigger','Trunk','variables','Variable','plugins','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./userProfile.socket','register','end','status','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x6b23,0xbb));var _0x36b2=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x6b23[_0x288f5e];return _0x476cc9;};'use strict';var pdf=require(_0x36b2('0x0'));var emlformat=require(_0x36b2('0x1'));var rimraf=require(_0x36b2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36b2('0x3'));var rp=require(_0x36b2('0x4'));var moment=require(_0x36b2('0x5'));var BPromise=require(_0x36b2('0x6'));var Mustache=require(_0x36b2('0x7'));var util=require('util');var path=require('path');var sox=require(_0x36b2('0x8'));var csv=require('to-csv');var ejs=require(_0x36b2('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x36b2('0xa'));var crypto=require(_0x36b2('0xb'));var jsforce=require(_0x36b2('0xc'));var deskjs=require(_0x36b2('0xd'));var toCsv=require(_0x36b2('0xe'));var querystring=require(_0x36b2('0xf'));var Papa=require(_0x36b2('0x10'));var authService=require(_0x36b2('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x36b2('0x12'));var logger=require(_0x36b2('0x13'))(_0x36b2('0x14'));var utils=require(_0x36b2('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x36b2('0x16')],{'host':_0x36b2('0x17'),'port':0x18eb});var socket=require(_0x36b2('0x18'))(new Redis(config[_0x36b2('0x16')]));require(_0x36b2('0x19'))[_0x36b2('0x1a')](socket);function respondWithStatusCode(_0x59bff0,_0x1d143a){_0x1d143a=_0x1d143a||0xcc;return function(_0x21bcc4){if(_0x21bcc4){return _0x59bff0['sendStatus'](_0x1d143a);}return _0x59bff0['status'](_0x1d143a)[_0x36b2('0x1b')]();};}function respondWithResult(_0x11a99d,_0x1a3913){_0x1a3913=_0x1a3913||0xc8;return function(_0x442026){if(_0x442026){return _0x11a99d[_0x36b2('0x1c')](_0x1a3913)['json'](_0x442026);}};}function respondWithFilteredResult(_0x493b6b,_0xdc95bc){return function(_0x54089c){if(_0x54089c){var _0x4cc89e=_0x54089c['count'],_0x51b9dd=_0xdc95bc[_0x36b2('0x1d')],_0x5099c9=_0xdc95bc[_0x36b2('0x1d')]+_0xdc95bc[_0x36b2('0x1e')],_0x17af88;if(_0x5099c9>=_0x4cc89e){_0x5099c9=_0x4cc89e;_0x17af88=0xc8;}else{_0x17af88=0xce;}_0x493b6b[_0x36b2('0x1c')](_0x17af88);return _0x493b6b[_0x36b2('0x1f')](_0x36b2('0x20'),_0x51b9dd+'-'+_0x5099c9+'/'+_0x4cc89e)[_0x36b2('0x21')](_0x54089c);}return null;};}function patchUpdates(_0x3b9d28){return function(_0x2392dd){try{jsonpatch[_0x36b2('0x22')](_0x2392dd,_0x3b9d28,!![]);}catch(_0x13ccb0){return BPromise[_0x36b2('0x23')](_0x13ccb0);}return _0x2392dd[_0x36b2('0x24')]();};}function saveUpdates(_0x385313,_0x41637b){return function(_0x177f3f){if(_0x177f3f){return _0x177f3f['update'](_0x385313)[_0x36b2('0x25')](function(_0x427bb2){return _0x427bb2;});}return null;};}function removeEntity(_0x3b76c4,_0x156f3a){return function(_0x4e1300){if(_0x4e1300){return _0x4e1300[_0x36b2('0x26')]()[_0x36b2('0x25')](function(){_0x3b76c4[_0x36b2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x345ac6,_0x53623a){return function(_0x20ec16){if(!_0x20ec16){_0x345ac6[_0x36b2('0x27')](0x194);}return _0x20ec16;};}function handleError(_0x47e17c,_0x578d4f){_0x578d4f=_0x578d4f||0x1f4;return function(_0x13be2b){logger['error'](_0x13be2b[_0x36b2('0x28')]);if(_0x13be2b[_0x36b2('0x29')]){delete _0x13be2b[_0x36b2('0x29')];}_0x47e17c['status'](_0x578d4f)['send'](_0x13be2b);};}exports[_0x36b2('0x2a')]=function(_0x32e957,_0x43d2ee){var _0x4fb761={},_0x484f79={},_0x1bb383={'count':0x0,'rows':[]};var _0xa8a007=db['UserProfile'][_0x36b2('0x2b')];_0x484f79[_0x36b2('0x2c')]=_['keys'](_0xa8a007);_0x484f79[_0x36b2('0x2d')]=_[_0x36b2('0x2e')](_0x32e957[_0x36b2('0x2d')]);_0x484f79['filters']=_['intersection'](_0x484f79[_0x36b2('0x2c')],_0x484f79['query']);_0x4fb761['attributes']=_[_0x36b2('0x2f')](_0x484f79[_0x36b2('0x2c')],qs[_0x36b2('0x30')](_0x32e957['query'][_0x36b2('0x30')]));_0x4fb761[_0x36b2('0x31')]=_0x4fb761[_0x36b2('0x31')][_0x36b2('0x32')]?_0x4fb761[_0x36b2('0x31')]:_0x484f79['model'];if(!_0x32e957[_0x36b2('0x2d')][_0x36b2('0x33')](_0x36b2('0x34'))){_0x4fb761[_0x36b2('0x1e')]=qs['limit'](_0x32e957[_0x36b2('0x2d')][_0x36b2('0x1e')]);_0x4fb761['offset']=qs[_0x36b2('0x1d')](_0x32e957['query'][_0x36b2('0x1d')]);}_0x4fb761[_0x36b2('0x35')]=qs[_0x36b2('0x36')](_0x32e957[_0x36b2('0x2d')][_0x36b2('0x36')]);_0x4fb761[_0x36b2('0x37')]=qs[_0x36b2('0x38')](_['pick'](_0x32e957[_0x36b2('0x2d')],_0x484f79['filters']));if(_0x32e957[_0x36b2('0x2d')][_0x36b2('0x39')]){_0x4fb761[_0x36b2('0x37')]=_[_0x36b2('0x3a')](_0x4fb761[_0x36b2('0x37')],{'$or':_[_0x36b2('0x3b')](_0xa8a007,function(_0x20770b){if(_0x20770b['type']['key']!==_0x36b2('0x3c')){var _0x5c054b={};_0x5c054b[_0x20770b['field']]={'$like':'%'+_0x32e957['query'][_0x36b2('0x39')]+'%'};return _0x5c054b;}})});}_0x4fb761=_[_0x36b2('0x3a')]({},_0x4fb761,_0x32e957['options']);var _0x3db20d={'where':_0x4fb761[_0x36b2('0x37')]};return db[_0x36b2('0x3d')][_0x36b2('0x3e')](_0x3db20d)['then'](function(_0x5a8074){_0x1bb383[_0x36b2('0x3e')]=_0x5a8074;if(_0x32e957[_0x36b2('0x2d')]['includeAll']){_0x4fb761[_0x36b2('0x3f')]=[{'all':!![]}];}return db[_0x36b2('0x3d')][_0x36b2('0x40')](_0x4fb761);})[_0x36b2('0x25')](function(_0x505636){_0x1bb383[_0x36b2('0x41')]=_0x505636;return _0x1bb383;})[_0x36b2('0x25')](respondWithFilteredResult(_0x43d2ee,_0x4fb761))[_0x36b2('0x42')](handleError(_0x43d2ee,null));};exports['show']=function(_0x5b64c7,_0xc2510d){var _0x22fbac={'raw':![],'where':{'id':_0x5b64c7[_0x36b2('0x43')]['id']}},_0x1d6f7a={};_0x1d6f7a['model']=_[_0x36b2('0x2e')](db[_0x36b2('0x3d')]['rawAttributes']);_0x1d6f7a[_0x36b2('0x2d')]=_[_0x36b2('0x2e')](_0x5b64c7['query']);_0x1d6f7a[_0x36b2('0x38')]=_['intersection'](_0x1d6f7a['model'],_0x1d6f7a['query']);_0x22fbac[_0x36b2('0x31')]=_[_0x36b2('0x2f')](_0x1d6f7a[_0x36b2('0x2c')],qs[_0x36b2('0x30')](_0x5b64c7[_0x36b2('0x2d')][_0x36b2('0x30')]));_0x22fbac[_0x36b2('0x31')]=_0x22fbac['attributes']['length']?_0x22fbac['attributes']:_0x1d6f7a['model'];if(_0x5b64c7[_0x36b2('0x2d')][_0x36b2('0x44')]){_0x22fbac['include']=[{'all':!![]}];}_0x22fbac=_['merge']({},_0x22fbac,_0x5b64c7[_0x36b2('0x45')]);return db[_0x36b2('0x3d')][_0x36b2('0x46')](_0x22fbac)['then'](handleEntityNotFound(_0xc2510d,null))[_0x36b2('0x25')](respondWithResult(_0xc2510d,null))[_0x36b2('0x42')](handleError(_0xc2510d,null));};exports[_0x36b2('0x47')]=function(_0x15b12a,_0x11d7ff){return db['UserProfile'][_0x36b2('0x47')](_0x15b12a[_0x36b2('0x48')],{})[_0x36b2('0x25')](respondWithResult(_0x11d7ff,0xc9))['catch'](handleError(_0x11d7ff,null));};exports[_0x36b2('0x49')]=function(_0x4b9cf4,_0x52256f){var _0xfebb1f={'raw':![],'where':{'id':_0x4b9cf4[_0x36b2('0x43')]['id']}},_0x1a3b6c={};_0x1a3b6c['model']=_[_0x36b2('0x2e')](db[_0x36b2('0x3d')][_0x36b2('0x2b')]);_0xfebb1f['attributes']=_[_0x36b2('0x2f')](_0x1a3b6c[_0x36b2('0x2c')],qs[_0x36b2('0x30')](_0x4b9cf4[_0x36b2('0x2d')][_0x36b2('0x30')]));_0xfebb1f['attributes']=_0xfebb1f[_0x36b2('0x31')][_0x36b2('0x32')]?_0xfebb1f['attributes']:_0x1a3b6c[_0x36b2('0x2c')];if(_0x4b9cf4[_0x36b2('0x2d')]['includeAll']){_0xfebb1f[_0x36b2('0x3f')]=[{'all':!![]}];}_0xfebb1f=_[_0x36b2('0x3a')]({},_0xfebb1f,_0x4b9cf4[_0x36b2('0x45')]);return db['UserProfile']['find'](_0xfebb1f)[_0x36b2('0x25')](handleEntityNotFound(_0x52256f,null))[_0x36b2('0x25')](function(_0x18e77e){if(_0x18e77e){var _0x5e087c=_0x18e77e[_0x36b2('0x4a')]({'plain':!![]});_0x5e087c=qs[_0x36b2('0x4b')](_0x5e087c,['id',_0x36b2('0x4c'),_0x36b2('0x4d'),'crudPermissions']);_0x4b9cf4[_0x36b2('0x48')]=_[_0x36b2('0x4b')](_0x4b9cf4[_0x36b2('0x48')],['id',_0x36b2('0x4c'),'updatedAt']);return db[_0x36b2('0x4e')][_0x36b2('0x4f')](function(_0xdf08dc){return db[_0x36b2('0x3d')][_0x36b2('0x47')](_['merge'](_0x5e087c,_0x4b9cf4[_0x36b2('0x48')]),{'include':_0x4b9cf4[_0x36b2('0x2d')][_0x36b2('0x44')]?[{'all':!![]}]:undefined,'transaction':_0xdf08dc})[_0x36b2('0x25')](function(_0x395ec7){var _0x283bf6=_0x395ec7['get']({'plain':!![]});return db[_0x36b2('0x50')][_0x36b2('0x40')]({'where':{'userProfileId':_0x4b9cf4['params']['id']},'raw':!![]})[_0x36b2('0x25')](function(_0x2d22c5){if(_0x2d22c5){return BPromise[_0x36b2('0x51')](_0x2d22c5,function(_0x5d3895){return new BPromise(function(_0x31ae2b,_0x1a8321){if(_0x5d3895[_0x36b2('0x52')]===null||_0x5d3895[_0x36b2('0x52')]===0x1)_0x31ae2b(null);return db[_0x36b2('0x53')]['findAll']({'where':{'sectionId':_0x5d3895['id']},'raw':!![]})[_0x36b2('0x25')](function(_0x257935){var _0xcb0bf4=_[_0x36b2('0x3b')](_0x257935,function(_0x14373f){return qs['omit'](_0x14373f,['id',_0x36b2('0x4c'),_0x36b2('0x4d'),_0x36b2('0x54')]);});_0x31ae2b(_0xcb0bf4);})[_0x36b2('0x42')](function(_0x4db606){_0x1a8321(_0x4db606);});})['then'](function(_0x10d74b){var _0x101d98=qs[_0x36b2('0x4b')](_0x5d3895,['id',_0x36b2('0x4c'),_0x36b2('0x4d')]);_0x101d98[_0x36b2('0x55')]=_0x283bf6['id'];if(_0x10d74b)_0x101d98[_0x36b2('0x56')]=_0x10d74b;return _0x101d98;})['then'](function(_0x5aad21){return db[_0x36b2('0x50')][_0x36b2('0x47')](_0x5aad21,{'include':[{'model':db[_0x36b2('0x53')],'as':'Resources'}],'raw':!![],'transaction':_0xdf08dc});});})[_0x36b2('0x25')](function(){return _0x283bf6;});}});});});}})['then'](respondWithResult(_0x52256f,0xc9))[_0x36b2('0x42')](handleError(_0x52256f,null));};exports[_0x36b2('0x57')]=function(_0x386c14,_0x4bdbdc){if(_0x386c14['body']['id']){delete _0x386c14[_0x36b2('0x48')]['id'];}return db['UserProfile'][_0x36b2('0x46')]({'where':{'id':_0x386c14[_0x36b2('0x43')]['id']}})[_0x36b2('0x25')](handleEntityNotFound(_0x4bdbdc,null))[_0x36b2('0x25')](saveUpdates(_0x386c14[_0x36b2('0x48')],null))[_0x36b2('0x25')](respondWithResult(_0x4bdbdc,null))['catch'](handleError(_0x4bdbdc,null));};exports[_0x36b2('0x26')]=function(_0x1b7aa0,_0x5c9709){return db['UserProfile'][_0x36b2('0x46')]({'where':{'id':_0x1b7aa0['params']['id']}})[_0x36b2('0x25')](handleEntityNotFound(_0x5c9709,null))[_0x36b2('0x25')](removeEntity(_0x5c9709,null))[_0x36b2('0x42')](handleError(_0x5c9709,null));};exports['describe']=function(_0x573db5,_0x52e214){return db['UserProfile'][_0x36b2('0x58')]()[_0x36b2('0x25')](respondWithResult(_0x52e214,null))[_0x36b2('0x42')](handleError(_0x52e214,null));};exports[_0x36b2('0x59')]=function(_0x5b4bc9,_0x4eb89a){var _0x4cbab1=_0x5b4bc9[_0x36b2('0x48')];return db[_0x36b2('0x3d')][_0x36b2('0x46')]({'where':{'id':_0x5b4bc9[_0x36b2('0x43')]['id']}})['then'](handleEntityNotFound(_0x4eb89a,null))[_0x36b2('0x25')](function(_0x20a887){if(_0x20a887){return db[_0x36b2('0x4e')][_0x36b2('0x4f')](function(_0x533fca){return db[_0x36b2('0x50')][_0x36b2('0x26')]({'where':{'userProfileId':_0x5b4bc9[_0x36b2('0x43')]['id'],'sectionId':_[_0x36b2('0x3b')](_0x4cbab1,function(_0x12d078){return _0x12d078[_0x36b2('0x54')];})},'transaction':_0x533fca})[_0x36b2('0x25')](function(){var _0x291ea8=_['map'](_0x4cbab1,function(_0x1f4a9e){_0x1f4a9e['userProfileId']=_0x5b4bc9[_0x36b2('0x43')]['id'];return _0x1f4a9e;});var _0xd85d2=[];return BPromise['each'](_0x291ea8,function(_0x23ed7c){return db[_0x36b2('0x50')][_0x36b2('0x47')](_0x23ed7c,{'include':[{'model':db[_0x36b2('0x53')],'as':'Resources'}],'raw':!![],'transaction':_0x533fca})[_0x36b2('0x25')](function(_0x1a8ed3){_0xd85d2[_0x36b2('0x5a')](_0x1a8ed3[_0x36b2('0x4a')]({'plain':!![]}));});})[_0x36b2('0x25')](function(){return _0xd85d2;});});});}})['then'](function(_0xdf9121){return _0xdf9121;})['then'](respondWithResult(_0x4eb89a,null))[_0x36b2('0x42')](handleError(_0x4eb89a,null));};exports[_0x36b2('0x5b')]=function(_0x5b911f,_0x20803c){var _0x5e1d71;return db[_0x36b2('0x3d')]['find']({'where':{'id':_0x5b911f[_0x36b2('0x43')]['id']},'attributes':['id','name']})[_0x36b2('0x25')](handleEntityNotFound(_0x20803c,null))[_0x36b2('0x25')](function(_0x526f31){if(_0x526f31){_0x5e1d71=_0x526f31;return db[_0x36b2('0x50')][_0x36b2('0x26')]({'where':{'userProfileId':_0x5b911f[_0x36b2('0x43')]['id'],'sectionId':_0x5b911f[_0x36b2('0x2d')]['ids']}});}})['then'](function(){return _0x5e1d71;})[_0x36b2('0x25')](respondWithStatusCode(_0x20803c,null))[_0x36b2('0x42')](handleError(_0x20803c,null));};exports[_0x36b2('0x5c')]=function(_0x42d5ff,_0x3b794a){return db[_0x36b2('0x3d')][_0x36b2('0x46')]({'where':{'id':_0x42d5ff[_0x36b2('0x43')]['id']}})[_0x36b2('0x25')](handleEntityNotFound(_0x3b794a,null))[_0x36b2('0x25')](function(_0x22530c){if(_0x22530c){return db['sequelize']['transaction'](function(_0x3d1421){return db['UserProfileSection'][_0x36b2('0x40')]({'where':{'userProfileId':_0x42d5ff[_0x36b2('0x43')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x58098d){if(_0x58098d){return db[_0x36b2('0x50')][_0x36b2('0x26')]({'where':{'userProfileId':_0x42d5ff[_0x36b2('0x43')]['id'],'id':_[_0x36b2('0x3b')](_0x58098d,function(_0x305ebe){return _0x305ebe['id'];})},'transaction':_0x3d1421});}})[_0x36b2('0x25')](function(_0x4f76c3){var _0x1e07d4=_['map'](_0x42d5ff[_0x36b2('0x48')],function(_0x11efb7){_0x11efb7[_0x36b2('0x55')]=_0x42d5ff[_0x36b2('0x43')]['id'];return _0x11efb7;});return db['UserProfileSection']['bulkCreate'](_0x1e07d4,{'raw':!![],'transaction':_0x3d1421});})['then'](function(_0x36712a){var _0x1a3cd9=_[_0x36b2('0x39')](_[_0x36b2('0x3b')](_0x36712a,function(_0x5de488){return _0x5de488[_0x36b2('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x1a3cd9){return db[_0x36b2('0x50')]['findAll']({'where':{'userProfileId':_0x42d5ff['params']['id'],'sectionId':_[_0x36b2('0x3b')](_0x1a3cd9,function(_0x3f0659){return _0x3f0659[_0x36b2('0x54')];})},'attributes':['id',_0x36b2('0x54')],'raw':!![]})[_0x36b2('0x25')](function(_0x3f214a){var _0x252c91=_[_0x36b2('0x3b')](_0x42d5ff['body'],function(_0x3f6048){_0x3f6048[_0x36b2('0x55')]=_0x42d5ff['params']['id'];return _0x3f6048;});return db[_0x36b2('0x53')][_0x36b2('0x5d')](_0x252c91,{'raw':!![],'transaction':_0x3d1421});});}})[_0x36b2('0x42')](handleError(_0x3b794a,null));});}})[_0x36b2('0x25')](function(_0x4a1efe){var _0x24870e=_[_0x36b2('0x3b')](_0x4a1efe,function(_0x2d9de9){return _0x2d9de9['get']({'plain':!![]});});})[_0x36b2('0x25')](respondWithResult(_0x3b794a,null))[_0x36b2('0x42')](handleError(_0x3b794a,null));};exports['removeResources']=function(_0x3c1577,_0x19cd56,_0x1ba5af){var _0x2eac5d;return db[_0x36b2('0x3d')][_0x36b2('0x46')]({'where':{'id':_0x3c1577[_0x36b2('0x43')]['id']}})[_0x36b2('0x25')](handleEntityNotFound(_0x19cd56,null))[_0x36b2('0x25')](function(_0x2a50f2){if(_0x2a50f2){return _0x2a50f2[_0x36b2('0x5e')](_0x3c1577[_0x36b2('0x2d')][_0x36b2('0x5f')]);}})[_0x36b2('0x25')](respondWithStatusCode(_0x19cd56,null))['catch'](handleError(_0x19cd56,null));};exports[_0x36b2('0x60')]=function(_0xfe80ee,_0x15b758){var _0x33e71b={'raw':![],'where':{}};var _0x4c77e5={};var _0x1572e0={'count':0x0,'rows':[]};var _0x57e772=_0xfe80ee[_0x36b2('0x2d')][_0x36b2('0x61')];if(typeof _0x57e772===_0x36b2('0x62')){throw new db[(_0x36b2('0x63'))][(_0x36b2('0x64'))](_0x36b2('0x65'));}var _0x55d9c6=_0xfe80ee[_0x36b2('0x2d')][_0x36b2('0x66')]||![];var _0x1c0e97=getQueryModels(_0x57e772,_0x55d9c6);if(typeof _0x1c0e97[_0x36b2('0x67')]===_0x36b2('0x62')){throw new db[(_0x36b2('0x63'))]['ValidationError'](_0x36b2('0x68')+_0x57e772+'\x27');}var _0x32f40c=[];if(!_['isEmpty'](_0x1c0e97[_0x36b2('0x69')])){_0x32f40c=_0x1c0e97[_0x36b2('0x69')];}else{_0x32f40c=[{'name':_0x57e772}];}return db[_0x36b2('0x3d')][_0x36b2('0x6a')]({'where':{'id':_0xfe80ee[_0x36b2('0x43')]['id']}})[_0x36b2('0x25')](handleEntityNotFound(_0x15b758,null))[_0x36b2('0x25')](function(_0x1ff082){if(_0x1ff082){var _0xa106a9=[];for(var _0x557d44=0x0;_0x557d44<_0x32f40c[_0x36b2('0x32')];_0x557d44++){_0xa106a9[_0x36b2('0x5a')](db[_0x36b2('0x50')][_0x36b2('0x6a')]({'where':{'userProfileId':_0x1ff082['id'],'name':_0x32f40c[_0x557d44][_0x36b2('0x29')]},'raw':!![]}));}return BPromise[_0x36b2('0x6b')](_0xa106a9);}})[_0x36b2('0x25')](function(_0x2f9997){var _0x3aa30a=_[_0x36b2('0x39')](_0x2f9997,function(_0x344653){return _0x344653?_0x344653:undefined;});var _0x33b1d3=_[_0x36b2('0x39')](_0x32f40c,['ignore',!![]]);var _0x3a3465=_[_0x36b2('0x6c')](_0x3aa30a)&&_[_0x36b2('0x6c')](_0x33b1d3)?null:_[_0x36b2('0x6d')](_0x33b1d3,_0x3aa30a);if(_0x3a3465){var _0x13c41b=[];for(var _0x2d4e36=0x0;_0x2d4e36<_0x3a3465[_0x36b2('0x32')];_0x2d4e36++){var _0x2386b3=_[_0x36b2('0x46')](_0x32f40c,function(_0x423630){return _0x3a3465[_0x2d4e36]?_0x423630[_0x36b2('0x29')]===_0x3a3465[_0x2d4e36][_0x36b2('0x29')]:null;});if(_0x2386b3){if(_0x3a3465[_0x2d4e36]['ignore']){_0x13c41b['push'](getAllResources(_0x1c0e97[_0x36b2('0x67')],_0x3a3465[_0x2d4e36]));}else{if(!_0x3a3465[_0x2d4e36][_0x36b2('0x52')]){_0x13c41b[_0x36b2('0x5a')](getAllowedResources(_0x2386b3,_0x3a3465[_0x2d4e36]));}else{if(_0x2386b3[_0x36b2('0x2c')]){_0x13c41b[_0x36b2('0x5a')](getAllFilteredResources(_0x2386b3,_0x3a3465[_0x2d4e36]));}}}}}return BPromise['all'](_0x13c41b);}else{return null;}})[_0x36b2('0x25')](function(_0x31bc59){var _0x428e0b=_0x31bc59;var _0x44b090=null;if(_0x428e0b){_0x44b090=_0x428e0b[_0x36b2('0x32')]===0x1?_0x428e0b[0x0]:null;}if(_0x44b090||_0x428e0b){var _0x17faf2=db[_0x1c0e97[_0x36b2('0x67')]]['rawAttributes'];_0x4c77e5[_0x36b2('0x2c')]=_[_0x36b2('0x2e')](_0x17faf2);_0x4c77e5[_0x36b2('0x2d')]=_[_0x36b2('0x2e')](_0xfe80ee[_0x36b2('0x2d')]);_0x4c77e5[_0x36b2('0x38')]=_[_0x36b2('0x2f')](_0x4c77e5['model'],_0x4c77e5[_0x36b2('0x2d')]);_0x33e71b[_0x36b2('0x31')]=_[_0x36b2('0x2f')](_0x4c77e5['model'],qs[_0x36b2('0x30')](_0xfe80ee[_0x36b2('0x2d')]['fields']));_0x33e71b[_0x36b2('0x31')]=_0x33e71b[_0x36b2('0x31')]['length']?_0x33e71b[_0x36b2('0x31')]:_0x4c77e5['model'];if(!_0xfe80ee[_0x36b2('0x2d')][_0x36b2('0x33')](_0x36b2('0x34'))){_0x33e71b[_0x36b2('0x1e')]=qs[_0x36b2('0x1e')](_0xfe80ee[_0x36b2('0x2d')][_0x36b2('0x1e')]);_0x33e71b[_0x36b2('0x1d')]=qs[_0x36b2('0x1d')](_0xfe80ee['query'][_0x36b2('0x1d')]);}_0x33e71b[_0x36b2('0x35')]=qs[_0x36b2('0x36')](_0xfe80ee['query'][_0x36b2('0x36')]);_0x33e71b['where']=qs[_0x36b2('0x38')](_[_0x36b2('0x6e')](_0xfe80ee['query'],_0x4c77e5[_0x36b2('0x38')]));if(_0xfe80ee['query'][_0x36b2('0x39')]){_0x33e71b[_0x36b2('0x37')]=_[_0x36b2('0x3a')](_0x33e71b[_0x36b2('0x37')],{'$or':_[_0x36b2('0x3b')](_0x17faf2,function(_0xc8a28d){if(_0xc8a28d[_0x36b2('0x6f')][_0x36b2('0x70')]!==_0x36b2('0x3c')){var _0x5375ff={};_0x5375ff[_0xc8a28d[_0x36b2('0x71')]]={'$like':'%'+_0xfe80ee[_0x36b2('0x2d')][_0x36b2('0x39')]+'%'};return _0x5375ff;}})});}var _0x24dbf5=[];if(_0x44b090){var _0x2619bb=_[_0x36b2('0x46')](_0x32f40c,[_0x36b2('0x29'),_0x44b090['name']]);if(_0x2619bb[_0x36b2('0x71')]){var _0x48aace={};_0x48aace[_0x2619bb[_0x36b2('0x72')]]=_0x44b090[_0x36b2('0x73')];_0x24dbf5['push'](_0x48aace);}else{_0x33e71b[_0x36b2('0x37')]['id']=_0x44b090[_0x36b2('0x73')];}}else{for(var _0x37338e=0x0;_0x37338e<_0x428e0b[_0x36b2('0x32')];_0x37338e++){var _0x2619bb=_[_0x36b2('0x46')](_0x32f40c,[_0x36b2('0x29'),_0x428e0b[_0x37338e][_0x36b2('0x29')]]);if(_0x2619bb[_0x36b2('0x71')]){var _0x48aace={};_0x48aace[_0x2619bb[_0x36b2('0x72')]]=_0x428e0b[_0x37338e][_0x36b2('0x73')];_0x24dbf5[_0x36b2('0x5a')](_0x48aace);}else{if(!_0x33e71b[_0x36b2('0x37')]['id'])_0x33e71b[_0x36b2('0x37')]['id']=[];_0x428e0b[_0x37338e][_0x36b2('0x73')][_0x36b2('0x74')](function(_0x11482f){_0x33e71b['where']['id'][_0x36b2('0x5a')](_0x11482f);});}}}if(!_[_0x36b2('0x6c')](_0x24dbf5)){_0x33e71b['where']=_[_0x36b2('0x3a')](_0x33e71b[_0x36b2('0x37')],{'$and':{'$or':_0x24dbf5}});}_0x33e71b=_[_0x36b2('0x3a')]({},_0x33e71b,_0xfe80ee[_0x36b2('0x45')]);if(_0x44b090&&!_0x44b090['autoAssociation']&&_0x1c0e97['childModel']===_0x36b2('0x75')){if(_0xfe80ee['query'][_0x36b2('0x44')]){_0x33e71b[_0x36b2('0x3f')]=[{'all':!![]}];}return db[_0x1c0e97['childModel']][_0x36b2('0x40')](_0x33e71b)['then'](function(_0x16a85d){var _0x5eaf4f=[];_0x16a85d[_0x36b2('0x74')](function(_0x550c5b){var _0x48044d;switch(_0x550c5b[_0x36b2('0x76')]){case _0x36b2('0x77'):_0x48044d=_[_0x36b2('0x46')](_0x44b090[_0x36b2('0x73')],function(_0x3ede26){return _0x3ede26['id']===_0x550c5b['reportId']&&_0x3ede26['type']===_0x36b2('0x78');});break;case'custom':_0x48044d=_['find'](_0x44b090[_0x36b2('0x73')],function(_0x4522cc){return _0x4522cc['id']===_0x550c5b[_0x36b2('0x79')]&&_0x4522cc[_0x36b2('0x6f')]===_0x36b2('0x7a');});break;}if(_0x48044d)_0x5eaf4f[_0x36b2('0x5a')](_0x550c5b);});_0x1572e0[_0x36b2('0x3e')]=_0x5eaf4f[_0x36b2('0x32')];_0x1572e0[_0x36b2('0x41')]=_0x5eaf4f;return _0x1572e0;});}else{return db[_0x1c0e97[_0x36b2('0x67')]][_0x36b2('0x3e')]({'where':_0x33e71b[_0x36b2('0x37')]})[_0x36b2('0x25')](function(_0xa9e3d){_0x1572e0[_0x36b2('0x3e')]=_0xa9e3d;if(_0xfe80ee[_0x36b2('0x2d')][_0x36b2('0x44')]){if(_0x1c0e97[_0x36b2('0x67')]===_0x36b2('0x7b')){_0x33e71b[_0x36b2('0x3f')]=[{'model':db['Tag'],'as':_0x36b2('0x7c'),'attributes':['id','name','color'],'required':_0xfe80ee['query'][_0x36b2('0x7d')]?!![]:![]},{'model':db[_0x36b2('0x7e')],'as':_0x36b2('0x7f'),'attributes':['id',_0x36b2('0x29'),_0x36b2('0x80')],'through':_0xfe80ee[_0x36b2('0x2d')]['tag']?{'attributes':[],'where':{'TagId':_0xfe80ee[_0x36b2('0x2d')][_0x36b2('0x7d')]||undefined}}:{},'required':_0xfe80ee[_0x36b2('0x2d')][_0x36b2('0x7d')]?!![]:![]}];}else{_0x33e71b[_0x36b2('0x3f')]=[{'all':!![]}];}}return db[_0x1c0e97[_0x36b2('0x67')]][_0x36b2('0x40')](_0x33e71b);})[_0x36b2('0x25')](function(_0x54c483){_0x1572e0[_0x36b2('0x41')]=_0x54c483;return _0x1572e0;});}}else{return _0x1572e0;}})[_0x36b2('0x25')](respondWithFilteredResult(_0x15b758,_0x33e71b))['catch'](handleError(_0x15b758,null));};function getAllResources(_0x1bbf78,_0x408b95){return new BPromise(function(_0x38d295,_0x594282){if(_0x408b95){var _0x4a1b87=_0x408b95['filter']?{[_0x408b95[_0x36b2('0x39')][_0x36b2('0x71')]]:_0x408b95[_0x36b2('0x39')][_0x36b2('0x81')]}:undefined;return db[_0x1bbf78]['findAll']({'where':_0x4a1b87,'raw':!![]})['then'](function(_0x226db2){_0x408b95['associatedResources']=_[_0x36b2('0x3b')](_0x226db2,'id');_0x38d295(_0x408b95);})[_0x36b2('0x42')](function(_0x32a027){_0x594282(_0x32a027);});}else{_0x38d295(null);}});}function getAllFilteredResources(_0x31325b,_0x54107b){return new BPromise(function(_0xac6e1a,_0x242b55){var _0x46161e=_0x31325b[_0x36b2('0x39')]?{[_0x31325b[_0x36b2('0x39')][_0x36b2('0x71')]]:_0x31325b['filter'][_0x36b2('0x81')]}:undefined;return db[_0x31325b[_0x36b2('0x2c')]][_0x36b2('0x40')]({'where':_0x46161e,'raw':!![]})[_0x36b2('0x25')](function(_0x199cab){_0x54107b[_0x36b2('0x73')]=_[_0x36b2('0x3b')](_0x199cab,function(_0x14778b){return _0x14778b[_0x36b2('0x29')];});_0xac6e1a(_0x54107b);})['catch'](function(_0x1eb7fc){_0x242b55(_0x1eb7fc);});});}function getAllowedResources(_0x25dd35,_0x3b41a7){return new BPromise(function(_0x2a6b86,_0x247733){if(_0x3b41a7){return db[_0x36b2('0x53')][_0x36b2('0x40')]({'where':{'sectionId':_0x3b41a7['id']},'raw':!![]})[_0x36b2('0x25')](function(_0x501f6c){if(_0x25dd35[_0x36b2('0x71')]&&_0x25dd35[_0x36b2('0x71')]!=='id'){_0x3b41a7[_0x36b2('0x73')]=_[_0x36b2('0x3b')](_0x501f6c,function(_0x330456){return _0x330456[_0x25dd35[_0x36b2('0x71')]];});}else{if(_0x25dd35[_0x36b2('0x67')]==='AnalyticExtractedReport'){_0x3b41a7[_0x36b2('0x73')]=_[_0x36b2('0x3b')](_0x501f6c,function(_0xb7cd8a){return{'id':_0xb7cd8a[_0x36b2('0x82')],'type':_0xb7cd8a[_0x36b2('0x6f')]};});}else{_0x3b41a7[_0x36b2('0x73')]=_['map'](_0x501f6c,function(_0x3f2c7e){return _0x3f2c7e[_0x36b2('0x82')];});}}_0x2a6b86(_0x3b41a7);})['catch'](function(_0xf00486){_0x247733(_0xf00486);});}else{_0x2a6b86(null);}});}function getQueryModels(_0x2f592d,_0x2a9618){var _0xd950ff=_0x2f592d['toLowerCase']();var _0x273d1a={'childModel':undefined,'parentSections':[]};switch(_0xd950ff){case _0x36b2('0x83'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x84');break;case'odbc':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x85');break;case'squarerecordings':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x86');_0x273d1a['parentSections']=[{'name':_0x36b2('0x87'),'field':_0x36b2('0x29'),'foreignKey':_0x36b2('0x88')}];break;case _0x36b2('0x89'):_0x273d1a['childModel']='JscriptyProject';break;case _0x36b2('0x8a'):_0x273d1a['childModel']='CmContact';_0x273d1a['parentSections']=[{'name':_0x36b2('0x8b'),'field':'id','foreignKey':'ListId'}];break;case _0x36b2('0x8c'):_0x273d1a['childModel']=_0x36b2('0x8d');break;case _0x36b2('0x8e'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x8f');break;case _0x36b2('0x90'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x91');break;case _0x36b2('0x92'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x93');break;case _0x36b2('0x94'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x95');break;case _0x36b2('0x96'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x97');break;case _0x36b2('0x98'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x99');break;case _0x36b2('0x9a'):case'internalroutes':case _0x36b2('0x9b'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x9c');break;case _0x36b2('0x9d'):_0x273d1a['childModel']=_0x36b2('0x9e');break;case _0x36b2('0x9f'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xa0');break;case'voicerecordings':_0x273d1a['childModel']='VoiceRecording';_0x273d1a['parentSections']=[{'name':_0x36b2('0xa1'),'field':_0x36b2('0x29'),'foreignKey':'membername','model':_0x36b2('0xa2'),'filter':{'field':_0x36b2('0xa3'),'value':[_0x36b2('0xa4')]}},{'name':'Telephones','field':_0x36b2('0x29'),'foreignKey':'membername','model':_0x36b2('0xa2'),'filter':{'field':'role','value':[_0x36b2('0xa5')]}},{'name':'VoiceQueues','field':'name','foreignKey':'queue','model':_0x36b2('0xa6'),'filter':{'field':_0x36b2('0x6f'),'value':[_0x36b2('0xa7')]}},{'name':_0x36b2('0xa8'),'field':_0x36b2('0x29'),'foreignKey':_0x36b2('0xa9'),'model':_0x36b2('0xa6'),'filter':{'field':_0x36b2('0x6f'),'value':[_0x36b2('0xaa')]}}];break;case _0x36b2('0xab'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xac');break;case'chanspies':_0x273d1a['childModel']=_0x36b2('0xad');break;case _0x36b2('0xae'):_0x273d1a['childModel']=_0x36b2('0xaf');break;case _0x36b2('0xb0'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xb1');break;case'mailqueues':_0x273d1a[_0x36b2('0x67')]='MailQueue';break;case'mailaccounts':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xb2');break;case _0x36b2('0xb3'):_0x273d1a[_0x36b2('0x67')]='MailSubstatus';break;case _0x36b2('0xb4'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xb5');break;case _0x36b2('0xb6'):_0x273d1a[_0x36b2('0x67')]='OpenchannelAccount';break;case _0x36b2('0xb7'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xb8');break;case _0x36b2('0xb9'):_0x273d1a['childModel']=_0x36b2('0xba');break;case'teams':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xbb');break;case _0x36b2('0xbc'):case _0x36b2('0xbd'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xa6');if(_0x2a9618){_0x273d1a[_0x36b2('0x69')]=[{'name':_0x36b2('0xbe')},{'name':'QueueCampaigns'}];}break;case'users':case _0x36b2('0xbf'):case _0x36b2('0xc0'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xa2');if(_0x2a9618){_0x273d1a['parentSections']=[{'name':_0x36b2('0xc1'),'filter':{'field':_0x36b2('0xa3'),'value':[_0x36b2('0xc2'),_0x36b2('0xc3')]},'ignore':!![]},{'name':'Agents'},{'name':_0x36b2('0xc4')}];}break;case _0x36b2('0xc5'):_0x273d1a['childModel']=_0x36b2('0xc6');break;case _0x36b2('0xc7'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xc8');break;case'freshdeskaccounts':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xc9');break;case _0x36b2('0xca'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xcb');break;case _0x36b2('0xcc'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xcd');break;case'zohoaccounts':_0x273d1a['childModel']=_0x36b2('0xce');break;case _0x36b2('0xcf'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xa2');break;case _0x36b2('0xd0'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xd1');break;case'dispositions':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xd2');break;case'customdashboards':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xd3');break;case'intervals':_0x273d1a['childModel']=_0x36b2('0xd4');break;case _0x36b2('0xd5'):_0x273d1a['childModel']=_0x36b2('0xd6');break;case _0x36b2('0xd7'):_0x273d1a[_0x36b2('0x67')]='Schedule';break;case _0x36b2('0xd8'):_0x273d1a[_0x36b2('0x67')]='Sound';break;case'tags':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0x7e');break;case _0x36b2('0xd9'):_0x273d1a[_0x36b2('0x67')]='Template';break;case _0x36b2('0xda'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xdb');break;case'trunks':_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xdc');break;case _0x36b2('0xdd'):_0x273d1a[_0x36b2('0x67')]=_0x36b2('0xde');break;case _0x36b2('0xdf'):_0x273d1a[_0x36b2('0x67')]='Plugin';break;case'extractedreports':_0x273d1a[_0x36b2('0x67')]='AnalyticExtractedReport';_0x273d1a['parentSections']=[{'name':_0x36b2('0xe0'),'field':'id','foreignKey':'reportId'}];break;case _0x36b2('0xe1'):_0x273d1a['childModel']=_0x36b2('0xe2');break;default:return _0x273d1a;}return _0x273d1a;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 4a32b17..a447861 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 _0xc0f9=['../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x14948a,_0x1a57ca){var _0x498ed9=function(_0x5d7417){while(--_0x5d7417){_0x14948a['push'](_0x14948a['shift']());}};_0x498ed9(++_0x1a57ca);}(_0xc0f9,0xc5));var _0x9c0f=function(_0x3d2b19,_0x349a5b){_0x3d2b19=_0x3d2b19-0x0;var _0x29769b=_0xc0f9[_0x3d2b19];return _0x29769b;};'use strict';var EventEmitter=require(_0x9c0f('0x0'));var UserProfile=require(_0x9c0f('0x1'))['db'][_0x9c0f('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9c0f('0x3')](0x0);var events={'afterCreate':_0x9c0f('0x4'),'afterUpdate':_0x9c0f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x79623d){return function(_0x273940,_0x154d45,_0x54b878){UserProfileEvents[_0x9c0f('0x6')](_0x79623d+':'+_0x273940['id'],_0x273940);UserProfileEvents[_0x9c0f('0x6')](_0x79623d,_0x273940);_0x54b878(null);};}for(var e in events){if(events[_0x9c0f('0x7')](e)){var event=events[e];UserProfile[_0x9c0f('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xb777=['UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x487c19,_0x2c07c4){var _0x5d37bc=function(_0x52d313){while(--_0x52d313){_0x487c19['push'](_0x487c19['shift']());}};_0x5d37bc(++_0x2c07c4);}(_0xb777,0x107));var _0x7b77=function(_0x5b2809,_0x48b226){_0x5b2809=_0x5b2809-0x0;var _0x572dee=_0xb777[_0x5b2809];return _0x572dee;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x7b77('0x0'))['db'][_0x7b77('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7b77('0x2')](0x0);var events={'afterCreate':_0x7b77('0x3'),'afterUpdate':'update','afterDestroy':_0x7b77('0x4')};function emitEvent(_0xd7aa10){return function(_0x3058ad,_0x6b10bf,_0x3644a4){UserProfileEvents[_0x7b77('0x5')](_0xd7aa10+':'+_0x3058ad['id'],_0x3058ad);UserProfileEvents[_0x7b77('0x5')](_0xd7aa10,_0x3058ad);_0x3644a4(null);};}for(var e in events){if(events[_0x7b77('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x7b77('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 0f55eae..d777032 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 _0x433a=['moment','bluebird','request-promise','exports','define','UserProfile','user_profiles','lodash','util','../../config/logger','api'];(function(_0x289874,_0x1b6752){var _0x2f8bbb=function(_0x23ee80){while(--_0x23ee80){_0x289874['push'](_0x289874['shift']());}};_0x2f8bbb(++_0x1b6752);}(_0x433a,0xd8));var _0xa433=function(_0x27801c,_0x24bc5c){_0x27801c=_0x27801c-0x0;var _0x2cb365=_0x433a[_0x27801c];return _0x2cb365;};'use strict';var _=require(_0xa433('0x0'));var util=require(_0xa433('0x1'));var logger=require(_0xa433('0x2'))(_0xa433('0x3'));var moment=require(_0xa433('0x4'));var BPromise=require(_0xa433('0x5'));var rp=require(_0xa433('0x6'));var attributes=require('./userProfile.attributes');module[_0xa433('0x7')]=function(_0x20704f,_0x3d13e2){return _0x20704f[_0xa433('0x8')](_0xa433('0x9'),attributes,{'tableName':_0xa433('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6de=['request-promise','./userProfile.attributes','exports','define','UserProfile','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xf6de,0xb5));var _0xef6d=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0xf6de[_0xf34109];return _0x570bfc;};'use strict';var _=require(_0xef6d('0x0'));var util=require(_0xef6d('0x1'));var logger=require(_0xef6d('0x2'))(_0xef6d('0x3'));var moment=require(_0xef6d('0x4'));var BPromise=require(_0xef6d('0x5'));var rp=require(_0xef6d('0x6'));var attributes=require(_0xef6d('0x7'));module[_0xef6d('0x8')]=function(_0x3fc63b,_0x14d094){return _0x3fc63b[_0xef6d('0x9')](_0xef6d('0xa'),attributes,{'tableName':'user_profiles','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 836edab..fc35bf2 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 _0xbdbd=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0xbdbd,0x1c3));var _0xdbdb=function(_0x42be26,_0x1fec74){_0x42be26=_0x42be26-0x0;var _0x7dcf9=_0xbdbd[_0x42be26];return _0x7dcf9;};'use strict';var _=require('lodash');var util=require(_0xdbdb('0x0'));var moment=require('moment');var BPromise=require(_0xdbdb('0x1'));var rs=require(_0xdbdb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdbdb('0x3'));var logger=require(_0xdbdb('0x4'))('rpc');var config=require(_0xdbdb('0x5'));var jayson=require(_0xdbdb('0x6'));var client=jayson[_0xdbdb('0x7')][_0xdbdb('0x8')]({'port':0x232a});config[_0xdbdb('0x9')]=_[_0xdbdb('0xa')](config[_0xdbdb('0x9')],{'host':_0xdbdb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdbdb('0x9')]));require('./userProfile.socket')[_0xdbdb('0xc')](socket);function respondWithRpcPromise(_0x2ca846,_0x180c7f,_0x58f414){return new BPromise(function(_0x492b3d,_0x1519be){return client['request'](_0x2ca846,_0x58f414)[_0xdbdb('0xd')](function(_0x316c09){logger['info'](_0xdbdb('0xe'),_0x180c7f,_0xdbdb('0xf'));logger[_0xdbdb('0x10')](_0xdbdb('0x11'),_0x180c7f,_0xdbdb('0xf'),JSON[_0xdbdb('0x12')](_0x316c09));if(_0x316c09[_0xdbdb('0x13')]){if(_0x316c09[_0xdbdb('0x13')][_0xdbdb('0x14')]===0x1f4){logger[_0xdbdb('0x13')](_0xdbdb('0xe'),_0x180c7f,_0x316c09[_0xdbdb('0x13')]['message']);return _0x1519be(_0x316c09[_0xdbdb('0x13')][_0xdbdb('0x15')]);}logger[_0xdbdb('0x13')](_0xdbdb('0xe'),_0x180c7f,_0x316c09[_0xdbdb('0x13')][_0xdbdb('0x15')]);return _0x492b3d(_0x316c09[_0xdbdb('0x13')]['message']);}else{logger['info'](_0xdbdb('0xe'),_0x180c7f,_0xdbdb('0xf'));_0x492b3d(_0x316c09[_0xdbdb('0x16')][_0xdbdb('0x15')]);}})[_0xdbdb('0x17')](function(_0x6a6540){logger['error'](_0xdbdb('0xe'),_0x180c7f,_0x6a6540);_0x1519be(_0x6a6540);});});} \ No newline at end of file +var _0xbe3e=['client','redis','defaults','localhost','socket.io-emitter','register','then','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x35c566,_0x1c50f7){var _0x514cf0=function(_0x42fdf9){while(--_0x42fdf9){_0x35c566['push'](_0x35c566['shift']());}};_0x514cf0(++_0x1c50f7);}(_0xbe3e,0x12e));var _0xebe3=function(_0x2af692,_0x30438e){_0x2af692=_0x2af692-0x0;var _0x26a3a8=_0xbe3e[_0x2af692];return _0x26a3a8;};'use strict';var _=require(_0xebe3('0x0'));var util=require(_0xebe3('0x1'));var moment=require(_0xebe3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xebe3('0x3'));var db=require(_0xebe3('0x4'))['db'];var utils=require(_0xebe3('0x5'));var logger=require(_0xebe3('0x6'))(_0xebe3('0x7'));var config=require(_0xebe3('0x8'));var jayson=require(_0xebe3('0x9'));var client=jayson[_0xebe3('0xa')]['http']({'port':0x232a});config[_0xebe3('0xb')]=_[_0xebe3('0xc')](config[_0xebe3('0xb')],{'host':_0xebe3('0xd'),'port':0x18eb});var socket=require(_0xebe3('0xe'))(new Redis(config['redis']));require('./userProfile.socket')[_0xebe3('0xf')](socket);function respondWithRpcPromise(_0x4b4bec,_0x10a1e7,_0x3ca5eb){return new BPromise(function(_0x4a154e,_0x3396f1){return client['request'](_0x4b4bec,_0x3ca5eb)[_0xebe3('0x10')](function(_0x35c548){logger['info'](_0xebe3('0x11'),_0x10a1e7,'request\x20sent');logger[_0xebe3('0x12')](_0xebe3('0x13'),_0x10a1e7,'request\x20sent',JSON[_0xebe3('0x14')](_0x35c548));if(_0x35c548[_0xebe3('0x15')]){if(_0x35c548[_0xebe3('0x15')][_0xebe3('0x16')]===0x1f4){logger['error'](_0xebe3('0x11'),_0x10a1e7,_0x35c548[_0xebe3('0x15')]['message']);return _0x3396f1(_0x35c548[_0xebe3('0x15')][_0xebe3('0x17')]);}logger[_0xebe3('0x15')]('UserProfile,\x20%s,\x20%s',_0x10a1e7,_0x35c548[_0xebe3('0x15')][_0xebe3('0x17')]);return _0x4a154e(_0x35c548[_0xebe3('0x15')]['message']);}else{logger['info'](_0xebe3('0x11'),_0x10a1e7,_0xebe3('0x18'));_0x4a154e(_0x35c548['result'][_0xebe3('0x17')]);}})[_0xebe3('0x19')](function(_0x2ab0ef){logger[_0xebe3('0x15')]('UserProfile,\x20%s,\x20%s',_0x10a1e7,_0x2ab0ef);_0x3396f1(_0x2ab0ef);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 6650595..fd47bd2 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 _0xfcbd=['length','userProfile:','./userProfile.events','update','emit','removeListener','register'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xfcbd,0x160));var _0xdfcb=function(_0x4a74e5,_0x108772){_0x4a74e5=_0x4a74e5-0x0;var _0x1339c6=_0xfcbd[_0x4a74e5];return _0x1339c6;};'use strict';var UserProfileEvents=require(_0xdfcb('0x0'));var events=['save','remove',_0xdfcb('0x1')];function createListener(_0x3df05b,_0x2785df){return function(_0x3ec4cc){_0x2785df[_0xdfcb('0x2')](_0x3df05b,_0x3ec4cc);};}function removeListener(_0xde9380,_0x545391){return function(){UserProfileEvents[_0xdfcb('0x3')](_0xde9380,_0x545391);};}exports[_0xdfcb('0x4')]=function(_0x4bdf76){for(var _0x5615a6=0x0,_0x46956c=events[_0xdfcb('0x5')];_0x5615a6<_0x46956c;_0x5615a6++){var _0xb8de95=events[_0x5615a6];var _0x3c5431=createListener(_0xdfcb('0x6')+_0xb8de95,_0x4bdf76);UserProfileEvents['on'](_0xb8de95,_0x3c5431);}}; \ No newline at end of file +var _0xa6bb=['save','remove','update','removeListener','register','length'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xa6bb,0x12c));var _0xba6b=function(_0x4fea83,_0x4c4618){_0x4fea83=_0x4fea83-0x0;var _0x136ec9=_0xa6bb[_0x4fea83];return _0x136ec9;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xba6b('0x0'),_0xba6b('0x1'),_0xba6b('0x2')];function createListener(_0x418373,_0x112efb){return function(_0x5f29e1){_0x112efb['emit'](_0x418373,_0x5f29e1);};}function removeListener(_0x5d1f87,_0x17e34b){return function(){UserProfileEvents[_0xba6b('0x3')](_0x5d1f87,_0x17e34b);};}exports[_0xba6b('0x4')]=function(_0x517d10){for(var _0x4cc381=0x0,_0x2a00d6=events[_0xba6b('0x5')];_0x4cc381<_0x2a00d6;_0x4cc381++){var _0x2f305e=events[_0x4cc381];var _0x5506d6=createListener('userProfile:'+_0x2f305e,_0x517d10);UserProfileEvents['on'](_0x2f305e,_0x5506d6);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0f1c931..e62bfa8 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 _0xdc91=['./userProfileResource.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xdc91,0x8b));var _0x1dc9=function(_0x46791f,_0x191d23){_0x46791f=_0x46791f-0x0;var _0x1fc2b1=_0xdc91[_0x46791f];return _0x1fc2b1;};'use strict';var multer=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1dc9('0x2'));var interaction=require(_0x1dc9('0x3'));var config=require(_0x1dc9('0x4'));var controller=require(_0x1dc9('0x5'));router[_0x1dc9('0x6')]('/',auth[_0x1dc9('0x7')](),controller[_0x1dc9('0x8')]);router[_0x1dc9('0x6')]('/describe',auth[_0x1dc9('0x7')](),controller[_0x1dc9('0x9')]);router[_0x1dc9('0x6')](_0x1dc9('0xa'),auth[_0x1dc9('0x7')](),controller[_0x1dc9('0xb')]);router[_0x1dc9('0xc')]('/',auth[_0x1dc9('0x7')](),controller[_0x1dc9('0xd')]);router[_0x1dc9('0xe')]('/:id',auth[_0x1dc9('0x7')](),controller['update']);router[_0x1dc9('0xf')]('/:id',auth[_0x1dc9('0x7')](),controller[_0x1dc9('0x10')]);module[_0x1dc9('0x11')]=router; \ No newline at end of file +var _0x9f37=['exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','create','put','/:id','delete'];(function(_0x37a0f1,_0x28edc6){var _0x5a785d=function(_0x48830c){while(--_0x48830c){_0x37a0f1['push'](_0x37a0f1['shift']());}};_0x5a785d(++_0x28edc6);}(_0x9f37,0xd1));var _0x79f3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9f37[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var path=require('path');var timeout=require(_0x79f3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x79f3('0x3'));var interaction=require(_0x79f3('0x4'));var config=require(_0x79f3('0x5'));var controller=require('./userProfileResource.controller');router[_0x79f3('0x6')]('/',auth[_0x79f3('0x7')](),controller['index']);router['get'](_0x79f3('0x8'),auth[_0x79f3('0x7')](),controller[_0x79f3('0x9')]);router[_0x79f3('0x6')]('/:id',auth[_0x79f3('0x7')](),controller[_0x79f3('0xa')]);router['post']('/',auth[_0x79f3('0x7')](),controller[_0x79f3('0xb')]);router[_0x79f3('0xc')](_0x79f3('0xd'),auth[_0x79f3('0x7')](),controller['update']);router[_0x79f3('0xe')](_0x79f3('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x79f3('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 b904599..843d7e3 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 _0xdf86=['STRING','INTEGER','sequelize','exports'];(function(_0x59711e,_0x10a234){var _0x36cea3=function(_0x1b12cd){while(--_0x1b12cd){_0x59711e['push'](_0x59711e['shift']());}};_0x36cea3(++_0x10a234);}(_0xdf86,0x126));var _0x6df8=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0xdf86[_0x79cd47];return _0x3b9484;};'use strict';var Sequelize=require(_0x6df8('0x0'));module[_0x6df8('0x1')]={'name':{'type':Sequelize[_0x6df8('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x6df8('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x6df8('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3fdc=['exports','STRING','INTEGER'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x3fdc,0x198));var _0xc3fd=function(_0x36a554,_0x27cbeb){_0x36a554=_0x36a554-0x0;var _0x313be3=_0x3fdc[_0x36a554];return _0x313be3;};'use strict';var Sequelize=require('sequelize');module[_0xc3fd('0x0')]={'name':{'type':Sequelize[_0xc3fd('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc3fd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc3fd('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 69e7fa5..77d61b0 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 _0xb10b=['includeAll','findAll','catch','params','model','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','UserProfileResource','rawAttributes','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count'];(function(_0x2a41f2,_0x227d5e){var _0x4c94ac=function(_0x3a81bf){while(--_0x3a81bf){_0x2a41f2['push'](_0x2a41f2['shift']());}};_0x4c94ac(++_0x227d5e);}(_0xb10b,0x12a));var _0xbb10=function(_0x7de33e,_0x46a873){_0x7de33e=_0x7de33e-0x0;var _0x9b0f8=_0xb10b[_0x7de33e];return _0x9b0f8;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var hardwareService=require(_0xbb10('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_0x1acce9);_0x6ed43b[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0x4e25ff[_0xbb10('0x2c')]);_0x6ed43b[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2c')]);_0x24d586['attributes']=_[_0xbb10('0x2e')](_0x6ed43b['model'],qs[_0xbb10('0x2f')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x24d586['attributes']=_0x24d586['attributes'][_0xbb10('0x30')]?_0x24d586[_0xbb10('0x31')]:_0x6ed43b['model'];if(!_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x32')](_0xbb10('0x33'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1d')]);_0x24d586['offset']=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x34')]=qs[_0xbb10('0x35')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x35')]);_0x24d586[_0xbb10('0x36')]=qs[_0xbb10('0x2d')](_['pick'](_0x4e25ff[_0xbb10('0x2c')],_0x6ed43b[_0xbb10('0x2d')]));if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x37')]){_0x24d586['where']=_[_0xbb10('0x38')](_0x24d586['where'],{'$or':_['map'](_0x1acce9,function(_0x3eb3cc){if(_0x3eb3cc[_0xbb10('0x39')][_0xbb10('0x3a')]!==_0xbb10('0x3b')){var _0x15d895={};_0x15d895[_0x3eb3cc[_0xbb10('0x3c')]]={'$like':'%'+_0x4e25ff['query'][_0xbb10('0x37')]+'%'};return _0x15d895;}})});}_0x24d586=_[_0xbb10('0x38')]({},_0x24d586,_0x4e25ff['options']);var _0x5e3fbd={'where':_0x24d586['where']};return db[_0xbb10('0x29')][_0xbb10('0x3d')](_0x5e3fbd)[_0xbb10('0x25')](function(_0x4d5a9b){_0x1d5e95[_0xbb10('0x3d')]=_0x4d5a9b;if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x24d586['include']=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x3f')](_0x24d586);})[_0xbb10('0x25')](function(_0x446f49){_0x1d5e95['rows']=_0x446f49;return _0x1d5e95;})[_0xbb10('0x25')](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x40')](handleError(_0x2fdde9,null));};exports['show']=function(_0xe2040f,_0x2e3214){var _0x44d6ae={'raw':![],'where':{'id':_0xe2040f[_0xbb10('0x41')]['id']}},_0x3a9934={};_0x3a9934[_0xbb10('0x42')]=_['keys'](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3a9934[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0xe2040f['query']);_0x3a9934[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],_0x3a9934[_0xbb10('0x2c')]);_0x44d6ae['attributes']=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],qs['fields'](_0xe2040f['query'][_0xbb10('0x2f')]));_0x44d6ae['attributes']=_0x44d6ae[_0xbb10('0x31')][_0xbb10('0x30')]?_0x44d6ae['attributes']:_0x3a9934[_0xbb10('0x42')];if(_0xe2040f[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x44d6ae['include']=[{'all':!![]}];}_0x44d6ae=_[_0xbb10('0x38')]({},_0x44d6ae,_0xe2040f[_0xbb10('0x43')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x44d6ae)[_0xbb10('0x25')](handleEntityNotFound(_0x2e3214,null))[_0xbb10('0x25')](respondWithResult(_0x2e3214,null))[_0xbb10('0x40')](handleError(_0x2e3214,null));};exports[_0xbb10('0x45')]=function(_0x205bb4,_0x43b948){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x205bb4['body'],{})[_0xbb10('0x25')](respondWithResult(_0x43b948,0xc9))[_0xbb10('0x40')](handleError(_0x43b948,null));};exports['update']=function(_0x14e1cb,_0x2f5027){if(_0x14e1cb[_0xbb10('0x46')]['id']){delete _0x14e1cb[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x14e1cb[_0xbb10('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f5027,null))['then'](saveUpdates(_0x14e1cb[_0xbb10('0x46')],null))[_0xbb10('0x25')](respondWithResult(_0x2f5027,null))[_0xbb10('0x40')](handleError(_0x2f5027,null));};exports['destroy']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x5f0c12[_0xbb10('0x41')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x25')](removeEntity(_0x3cd6f3,null))[_0xbb10('0x40')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x47')]=function(_0x2626d8,_0x3d7e7e){return db['UserProfileResource']['describe']()[_0xbb10('0x25')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x40')](handleError(_0x3d7e7e,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','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','UserProfileResource','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x47d615,_0x3c3a45){var _0x41295b=function(_0x4c3c3e){while(--_0x4c3c3e){_0x47d615['push'](_0x47d615['shift']());}};_0x41295b(++_0x3c3a45);}(_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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=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['UserProfileResource'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['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['UserProfileResource'][_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/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 1bf106c..39c526f 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 _0x6edb=['bluebird','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','util','api','moment'];(function(_0x27b6c3,_0x258fd0){var _0x12f3c0=function(_0x3042f6){while(--_0x3042f6){_0x27b6c3['push'](_0x27b6c3['shift']());}};_0x12f3c0(++_0x258fd0);}(_0x6edb,0xc3));var _0xb6ed=function(_0x30f69d,_0xc75fdb){_0x30f69d=_0x30f69d-0x0;var _0x2bc4d4=_0x6edb[_0x30f69d];return _0x2bc4d4;};'use strict';var _=require('lodash');var util=require(_0xb6ed('0x0'));var logger=require('../../config/logger')(_0xb6ed('0x1'));var moment=require(_0xb6ed('0x2'));var BPromise=require(_0xb6ed('0x3'));var rp=require('request-promise');var attributes=require(_0xb6ed('0x4'));module[_0xb6ed('0x5')]=function(_0x34b699,_0x37fba9){return _0x34b699[_0xb6ed('0x6')](_0xb6ed('0x7'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xb6ed('0x8'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d3e=['api','moment','bluebird','request-promise','exports','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x2d3e,0x176));var _0xe2d3=function(_0x21e163,_0x2daf3d){_0x21e163=_0x21e163-0x0;var _0x5a34b2=_0x2d3e[_0x21e163];return _0x5a34b2;};'use strict';var _=require(_0xe2d3('0x0'));var util=require(_0xe2d3('0x1'));var logger=require(_0xe2d3('0x2'))(_0xe2d3('0x3'));var moment=require(_0xe2d3('0x4'));var BPromise=require(_0xe2d3('0x5'));var rp=require(_0xe2d3('0x6'));var attributes=require('./userProfileResource.attributes');module[_0xe2d3('0x7')]=function(_0x123bb3,_0x5a2e81){return _0x123bb3[_0xe2d3('0x8')](_0xe2d3('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xe2d3('0xa'),'fields':[_0xe2d3('0xb'),_0xe2d3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index a4fcc02..21bc87a 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 _0x7096=['code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x56fb33,_0x37be08){var _0x435ee4=function(_0xa80804){while(--_0xa80804){_0x56fb33['push'](_0x56fb33['shift']());}};_0x435ee4(++_0x37be08);}(_0x7096,0x10c));var _0x6709=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7096[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});} \ No newline at end of file +var _0x9a5a=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x3ed880,_0x10b8ac){var _0x260d4f=function(_0x22c0ae){while(--_0x22c0ae){_0x3ed880['push'](_0x3ed880['shift']());}};_0x260d4f(++_0x10b8ac);}(_0x9a5a,0x194));var _0xa9a5=function(_0x3cce34,_0x49b246){_0x3cce34=_0x3cce34-0x0;var _0x3adb25=_0x9a5a[_0x3cce34];return _0x3adb25;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var moment=require(_0xa9a5('0x2'));var BPromise=require(_0xa9a5('0x3'));var rs=require(_0xa9a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a5('0x5'))['db'];var utils=require(_0xa9a5('0x6'));var logger=require(_0xa9a5('0x7'))(_0xa9a5('0x8'));var config=require(_0xa9a5('0x9'));var jayson=require(_0xa9a5('0xa'));var client=jayson['client'][_0xa9a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37e93b,_0x20bbe8,_0x1eafa6){return new BPromise(function(_0x24e1bd,_0x5f2e83){return client['request'](_0x37e93b,_0x1eafa6)['then'](function(_0xc95120){logger[_0xa9a5('0xc')](_0xa9a5('0xd'),_0x20bbe8,_0xa9a5('0xe'));logger[_0xa9a5('0xf')](_0xa9a5('0x10'),_0x20bbe8,_0xa9a5('0xe'),JSON['stringify'](_0xc95120));if(_0xc95120['error']){if(_0xc95120['error'][_0xa9a5('0x11')]===0x1f4){logger[_0xa9a5('0x12')](_0xa9a5('0xd'),_0x20bbe8,_0xc95120[_0xa9a5('0x12')][_0xa9a5('0x13')]);return _0x5f2e83(_0xc95120['error'][_0xa9a5('0x13')]);}logger[_0xa9a5('0x12')](_0xa9a5('0xd'),_0x20bbe8,_0xc95120[_0xa9a5('0x12')][_0xa9a5('0x13')]);return _0x24e1bd(_0xc95120[_0xa9a5('0x12')]['message']);}else{logger[_0xa9a5('0xc')](_0xa9a5('0xd'),_0x20bbe8,_0xa9a5('0xe'));_0x24e1bd(_0xc95120[_0xa9a5('0x14')]['message']);}})[_0xa9a5('0x15')](function(_0x106cbf){logger[_0xa9a5('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x20bbe8,_0x106cbf);_0x5f2e83(_0x106cbf);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 63bfe7c..aeae20c 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 _0x894d=['update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x894d,0xa5));var _0xd894=function(_0x375d6f,_0x2fb66e){_0x375d6f=_0x375d6f-0x0;var _0x2a74b6=_0x894d[_0x375d6f];return _0x2a74b6;};'use strict';var multer=require(_0xd894('0x0'));var util=require(_0xd894('0x1'));var path=require(_0xd894('0x2'));var timeout=require('connect-timeout');var express=require(_0xd894('0x3'));var router=express[_0xd894('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd894('0x5'));var config=require(_0xd894('0x6'));var controller=require('./userProfileSection.controller');router[_0xd894('0x7')]('/',auth[_0xd894('0x8')](),controller[_0xd894('0x9')]);router[_0xd894('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd894('0xa')]);router[_0xd894('0x7')](_0xd894('0xb'),auth[_0xd894('0x8')](),controller['show']);router[_0xd894('0xc')]('/',auth['isAuthenticated'](),controller[_0xd894('0xd')]);router[_0xd894('0xe')](_0xd894('0xb'),auth[_0xd894('0x8')](),controller[_0xd894('0xf')]);router[_0xd894('0x10')](_0xd894('0xb'),auth[_0xd894('0x8')](),controller[_0xd894('0x11')]);module['exports']=router; \ No newline at end of file +var _0x665c=['create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x4ce8e6,_0x3afa8f){var _0x480a45=function(_0x4f64c4){while(--_0x4f64c4){_0x4ce8e6['push'](_0x4ce8e6['shift']());}};_0x480a45(++_0x3afa8f);}(_0x665c,0x1a8));var _0xc665=function(_0x1f7038,_0x130349){_0x1f7038=_0x1f7038-0x0;var _0x3e7828=_0x665c[_0x1f7038];return _0x3e7828;};'use strict';var multer=require(_0xc665('0x0'));var util=require(_0xc665('0x1'));var path=require(_0xc665('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc665('0x3')]();var auth=require(_0xc665('0x4'));var interaction=require(_0xc665('0x5'));var config=require(_0xc665('0x6'));var controller=require(_0xc665('0x7'));router[_0xc665('0x8')]('/',auth[_0xc665('0x9')](),controller[_0xc665('0xa')]);router[_0xc665('0x8')](_0xc665('0xb'),auth['isAuthenticated'](),controller[_0xc665('0xc')]);router[_0xc665('0x8')](_0xc665('0xd'),auth[_0xc665('0x9')](),controller[_0xc665('0xe')]);router[_0xc665('0xf')]('/',auth[_0xc665('0x9')](),controller[_0xc665('0x10')]);router[_0xc665('0x11')](_0xc665('0xd'),auth[_0xc665('0x9')](),controller[_0xc665('0x12')]);router[_0xc665('0x13')](_0xc665('0xd'),auth[_0xc665('0x9')](),controller[_0xc665('0x14')]);module[_0xc665('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 2f07ed6..457f55f 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(_0x41b306,_0x43383d){var _0x3c185b=function(_0x5adc83){while(--_0x5adc83){_0x41b306['push'](_0x41b306['shift']());}};_0x3c185b(++_0x43383d);}(_0xedd9,0xfc));var _0x9edd=function(_0x3d38af,_0xdcd2d9){_0x3d38af=_0x3d38af-0x0;var _0x254573=_0xedd9[_0x3d38af];return _0x254573;};'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 _0x008c=['getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x008c,0x188));var _0xc008=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x008c[_0x95ac8b];return _0x5b0792;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xc008('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc008('0x2')],'set':function(_0x10b33c){this[_0xc008('0x5')](_0xc008('0x6'),_0x10b33c?_0x10b33c[_0xc008('0x7')](''):[]);},'get':function(){return this[_0xc008('0x8')](_0xc008('0x6'))?this[_0xc008('0x8')]('crudPermissions')[_0xc008('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index cfe8c27..c018f45 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 _0x56f8=['then','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','key','field','merge','UserProfileSection','includeAll','include','rows','catch','params','find','create','body','describe','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','json','reject'];(function(_0x2d68bf,_0x5712e7){var _0x55475c=function(_0x4683c5){while(--_0x4683c5){_0x2d68bf['push'](_0x2d68bf['shift']());}};_0x55475c(++_0x5712e7);}(_0x56f8,0x1f4));var _0x856f=function(_0x5687cb,_0x37dbfe){_0x5687cb=_0x5687cb-0x0;var _0x5df739=_0x56f8[_0x5687cb];return _0x5df739;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x856f('0x0'));var rp=require(_0x856f('0x1'));var moment=require('moment');var BPromise=require(_0x856f('0x2'));var Mustache=require(_0x856f('0x3'));var util=require(_0x856f('0x4'));var path=require('path');var sox=require(_0x856f('0x5'));var csv=require(_0x856f('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x856f('0x7'));var squel=require(_0x856f('0x8'));var crypto=require(_0x856f('0x9'));var jsforce=require(_0x856f('0xa'));var deskjs=require(_0x856f('0xb'));var toCsv=require(_0x856f('0x6'));var querystring=require('querystring');var Papa=require(_0x856f('0xc'));var authService=require(_0x856f('0xd'));var hardwareService=require(_0x856f('0xe'));var Redis=require(_0x856f('0xf'));var qs=require(_0x856f('0x10'));var logger=require(_0x856f('0x11'))('api');var utils=require(_0x856f('0x12'));var config=require(_0x856f('0x13'));var db=require(_0x856f('0x14'))['db'];function respondWithStatusCode(_0x55a1fe,_0x59ebdd){_0x59ebdd=_0x59ebdd||0xcc;return function(_0xebe862){if(_0xebe862){return _0x55a1fe[_0x856f('0x15')](_0x59ebdd);}return _0x55a1fe[_0x856f('0x16')](_0x59ebdd)['end']();};}function respondWithResult(_0x1071fa,_0x286680){_0x286680=_0x286680||0xc8;return function(_0x2f81f2){if(_0x2f81f2){return _0x1071fa[_0x856f('0x16')](_0x286680)['json'](_0x2f81f2);}};}function respondWithFilteredResult(_0x377514,_0x4bd905){return function(_0x2bbc5d){if(_0x2bbc5d){var _0x481e86=_0x2bbc5d[_0x856f('0x17')],_0x172fa4=_0x4bd905[_0x856f('0x18')],_0x4bf19e=_0x4bd905[_0x856f('0x18')]+_0x4bd905['limit'],_0x2f2cda;if(_0x4bf19e>=_0x481e86){_0x4bf19e=_0x481e86;_0x2f2cda=0xc8;}else{_0x2f2cda=0xce;}_0x377514[_0x856f('0x16')](_0x2f2cda);return _0x377514['set'](_0x856f('0x19'),_0x172fa4+'-'+_0x4bf19e+'/'+_0x481e86)[_0x856f('0x1a')](_0x2bbc5d);}return null;};}function patchUpdates(_0x2ce627){return function(_0x40001f){try{jsonpatch['apply'](_0x40001f,_0x2ce627,!![]);}catch(_0x428120){return BPromise[_0x856f('0x1b')](_0x428120);}return _0x40001f['save']();};}function saveUpdates(_0x326545,_0xc91a9e){return function(_0xe730b1){if(_0xe730b1){return _0xe730b1['update'](_0x326545)[_0x856f('0x1c')](function(_0xb06387){return _0xb06387;});}return null;};}function removeEntity(_0x108363,_0x1e219c){return function(_0xb75c70){if(_0xb75c70){return _0xb75c70[_0x856f('0x1d')]()[_0x856f('0x1c')](function(){_0x108363['status'](0xcc)[_0x856f('0x1e')]();});}};}function handleEntityNotFound(_0x4186f4,_0x44c7a5){return function(_0x4686e4){if(!_0x4686e4){_0x4186f4[_0x856f('0x15')](0x194);}return _0x4686e4;};}function handleError(_0x2a929d,_0x19f494){_0x19f494=_0x19f494||0x1f4;return function(_0x34b71d){logger['error'](_0x34b71d[_0x856f('0x1f')]);if(_0x34b71d[_0x856f('0x20')]){delete _0x34b71d[_0x856f('0x20')];}_0x2a929d[_0x856f('0x16')](_0x19f494)[_0x856f('0x21')](_0x34b71d);};}exports[_0x856f('0x22')]=function(_0x4e558f,_0x1e98a0){var _0x12d830={},_0x59a2f1={},_0x56bb76={'count':0x0,'rows':[]};var _0x6cdf7c=db['UserProfileSection'][_0x856f('0x23')];_0x59a2f1[_0x856f('0x24')]=_[_0x856f('0x25')](_0x6cdf7c);_0x59a2f1[_0x856f('0x26')]=_[_0x856f('0x25')](_0x4e558f[_0x856f('0x26')]);_0x59a2f1[_0x856f('0x27')]=_[_0x856f('0x28')](_0x59a2f1[_0x856f('0x24')],_0x59a2f1[_0x856f('0x26')]);_0x12d830['attributes']=_[_0x856f('0x28')](_0x59a2f1[_0x856f('0x24')],qs[_0x856f('0x29')](_0x4e558f['query'][_0x856f('0x29')]));_0x12d830[_0x856f('0x2a')]=_0x12d830['attributes'][_0x856f('0x2b')]?_0x12d830[_0x856f('0x2a')]:_0x59a2f1[_0x856f('0x24')];if(!_0x4e558f[_0x856f('0x26')][_0x856f('0x2c')](_0x856f('0x2d'))){_0x12d830[_0x856f('0x2e')]=qs[_0x856f('0x2e')](_0x4e558f['query']['limit']);_0x12d830[_0x856f('0x18')]=qs[_0x856f('0x18')](_0x4e558f[_0x856f('0x26')][_0x856f('0x18')]);}_0x12d830[_0x856f('0x2f')]=qs[_0x856f('0x30')](_0x4e558f[_0x856f('0x26')][_0x856f('0x30')]);_0x12d830[_0x856f('0x31')]=qs[_0x856f('0x27')](_[_0x856f('0x32')](_0x4e558f[_0x856f('0x26')],_0x59a2f1[_0x856f('0x27')]));if(_0x4e558f[_0x856f('0x26')][_0x856f('0x33')]){_0x12d830[_0x856f('0x31')]=_['merge'](_0x12d830[_0x856f('0x31')],{'$or':_['map'](_0x6cdf7c,function(_0x20f98e){if(_0x20f98e[_0x856f('0x34')][_0x856f('0x35')]!=='VIRTUAL'){var _0x5d6f16={};_0x5d6f16[_0x20f98e[_0x856f('0x36')]]={'$like':'%'+_0x4e558f[_0x856f('0x26')]['filter']+'%'};return _0x5d6f16;}})});}_0x12d830=_[_0x856f('0x37')]({},_0x12d830,_0x4e558f['options']);var _0x4e3677={'where':_0x12d830[_0x856f('0x31')]};return db[_0x856f('0x38')][_0x856f('0x17')](_0x4e3677)[_0x856f('0x1c')](function(_0x50e97c){_0x56bb76[_0x856f('0x17')]=_0x50e97c;if(_0x4e558f[_0x856f('0x26')][_0x856f('0x39')]){_0x12d830[_0x856f('0x3a')]=[{'all':!![]}];}return db[_0x856f('0x38')]['findAll'](_0x12d830);})[_0x856f('0x1c')](function(_0x1c50c3){_0x56bb76[_0x856f('0x3b')]=_0x1c50c3;return _0x56bb76;})[_0x856f('0x1c')](respondWithFilteredResult(_0x1e98a0,_0x12d830))[_0x856f('0x3c')](handleError(_0x1e98a0,null));};exports['show']=function(_0x5717d3,_0x34ebab){var _0x63376f={'raw':![],'where':{'id':_0x5717d3[_0x856f('0x3d')]['id']}},_0x38a8a9={};_0x38a8a9[_0x856f('0x24')]=_[_0x856f('0x25')](db[_0x856f('0x38')][_0x856f('0x23')]);_0x38a8a9[_0x856f('0x26')]=_['keys'](_0x5717d3['query']);_0x38a8a9['filters']=_[_0x856f('0x28')](_0x38a8a9[_0x856f('0x24')],_0x38a8a9[_0x856f('0x26')]);_0x63376f[_0x856f('0x2a')]=_[_0x856f('0x28')](_0x38a8a9['model'],qs[_0x856f('0x29')](_0x5717d3['query'][_0x856f('0x29')]));_0x63376f[_0x856f('0x2a')]=_0x63376f['attributes'][_0x856f('0x2b')]?_0x63376f['attributes']:_0x38a8a9['model'];if(_0x5717d3[_0x856f('0x26')][_0x856f('0x39')]){_0x63376f[_0x856f('0x3a')]=[{'all':!![]}];}_0x63376f=_[_0x856f('0x37')]({},_0x63376f,_0x5717d3['options']);return db[_0x856f('0x38')][_0x856f('0x3e')](_0x63376f)[_0x856f('0x1c')](handleEntityNotFound(_0x34ebab,null))[_0x856f('0x1c')](respondWithResult(_0x34ebab,null))[_0x856f('0x3c')](handleError(_0x34ebab,null));};exports[_0x856f('0x3f')]=function(_0xb41624,_0x7d9a84){return db[_0x856f('0x38')][_0x856f('0x3f')](_0xb41624[_0x856f('0x40')],{})[_0x856f('0x1c')](respondWithResult(_0x7d9a84,0xc9))['catch'](handleError(_0x7d9a84,null));};exports['update']=function(_0x1e950e,_0x441f76){if(_0x1e950e[_0x856f('0x40')]['id']){delete _0x1e950e['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x1e950e[_0x856f('0x3d')]['id']}})[_0x856f('0x1c')](handleEntityNotFound(_0x441f76,null))[_0x856f('0x1c')](saveUpdates(_0x1e950e[_0x856f('0x40')],null))['then'](respondWithResult(_0x441f76,null))[_0x856f('0x3c')](handleError(_0x441f76,null));};exports[_0x856f('0x1d')]=function(_0x32ffae,_0x404693){return db[_0x856f('0x38')]['find']({'where':{'id':_0x32ffae[_0x856f('0x3d')]['id']}})[_0x856f('0x1c')](handleEntityNotFound(_0x404693,null))[_0x856f('0x1c')](removeEntity(_0x404693,null))[_0x856f('0x3c')](handleError(_0x404693,null));};exports[_0x856f('0x41')]=function(_0x36ec62,_0x1c558f){return db[_0x856f('0x38')][_0x856f('0x41')]()[_0x856f('0x1c')](respondWithResult(_0x1c558f,null))[_0x856f('0x3c')](handleError(_0x1c558f,null));}; \ No newline at end of file +var _0xc655=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','map','type','key','VIRTUAL','field','filter','UserProfileSection','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xc655,0xc6));var _0x5c65=function(_0x3138ef,_0x4f15fb){_0x3138ef=_0x3138ef-0x0;var _0xdf6bf5=_0xc655[_0x3138ef];return _0xdf6bf5;};'use strict';var pdf=require(_0x5c65('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c65('0x1'));var jsonpatch=require(_0x5c65('0x2'));var rp=require(_0x5c65('0x3'));var moment=require(_0x5c65('0x4'));var BPromise=require(_0x5c65('0x5'));var Mustache=require(_0x5c65('0x6'));var util=require('util');var path=require(_0x5c65('0x7'));var sox=require(_0x5c65('0x8'));var csv=require(_0x5c65('0x9'));var ejs=require(_0x5c65('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c65('0xb'));var jsforce=require(_0x5c65('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5c65('0xd'));var Papa=require(_0x5c65('0xe'));var authService=require(_0x5c65('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x5c65('0x10'));var logger=require('../../config/logger')(_0x5c65('0x11'));var utils=require(_0x5c65('0x12'));var config=require(_0x5c65('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b7e8d,_0x46035e){_0x46035e=_0x46035e||0xcc;return function(_0x377d11){if(_0x377d11){return _0x1b7e8d[_0x5c65('0x14')](_0x46035e);}return _0x1b7e8d[_0x5c65('0x15')](_0x46035e)['end']();};}function respondWithResult(_0x3dcb3f,_0x2a6d37){_0x2a6d37=_0x2a6d37||0xc8;return function(_0x1e71b2){if(_0x1e71b2){return _0x3dcb3f[_0x5c65('0x15')](_0x2a6d37)[_0x5c65('0x16')](_0x1e71b2);}};}function respondWithFilteredResult(_0x309024,_0x8c4cd0){return function(_0x3b57a1){if(_0x3b57a1){var _0x59d45c=_0x3b57a1['count'],_0x1d618b=_0x8c4cd0[_0x5c65('0x17')],_0x41a159=_0x8c4cd0[_0x5c65('0x17')]+_0x8c4cd0[_0x5c65('0x18')],_0x1a5281;if(_0x41a159>=_0x59d45c){_0x41a159=_0x59d45c;_0x1a5281=0xc8;}else{_0x1a5281=0xce;}_0x309024[_0x5c65('0x15')](_0x1a5281);return _0x309024[_0x5c65('0x19')](_0x5c65('0x1a'),_0x1d618b+'-'+_0x41a159+'/'+_0x59d45c)[_0x5c65('0x16')](_0x3b57a1);}return null;};}function patchUpdates(_0x88b1fd){return function(_0x2cef82){try{jsonpatch[_0x5c65('0x1b')](_0x2cef82,_0x88b1fd,!![]);}catch(_0x37d094){return BPromise[_0x5c65('0x1c')](_0x37d094);}return _0x2cef82[_0x5c65('0x1d')]();};}function saveUpdates(_0x16acc4,_0x4c7cbc){return function(_0xfec195){if(_0xfec195){return _0xfec195[_0x5c65('0x1e')](_0x16acc4)[_0x5c65('0x1f')](function(_0x290dd9){return _0x290dd9;});}return null;};}function removeEntity(_0x321cb4,_0x8f0c1b){return function(_0x4c9f7c){if(_0x4c9f7c){return _0x4c9f7c['destroy']()[_0x5c65('0x1f')](function(){_0x321cb4[_0x5c65('0x15')](0xcc)[_0x5c65('0x20')]();});}};}function handleEntityNotFound(_0x525993,_0x33d127){return function(_0x5e15a9){if(!_0x5e15a9){_0x525993['sendStatus'](0x194);}return _0x5e15a9;};}function handleError(_0x5c45dd,_0x1fe47c){_0x1fe47c=_0x1fe47c||0x1f4;return function(_0x1bca23){logger[_0x5c65('0x21')](_0x1bca23['stack']);if(_0x1bca23[_0x5c65('0x22')]){delete _0x1bca23[_0x5c65('0x22')];}_0x5c45dd[_0x5c65('0x15')](_0x1fe47c)[_0x5c65('0x23')](_0x1bca23);};}exports[_0x5c65('0x24')]=function(_0x4de934,_0x544cb5){var _0x271734={},_0x61443f={},_0x444659={'count':0x0,'rows':[]};var _0x497d0c=db['UserProfileSection'][_0x5c65('0x25')];_0x61443f['model']=_[_0x5c65('0x26')](_0x497d0c);_0x61443f[_0x5c65('0x27')]=_[_0x5c65('0x26')](_0x4de934[_0x5c65('0x27')]);_0x61443f[_0x5c65('0x28')]=_['intersection'](_0x61443f['model'],_0x61443f[_0x5c65('0x27')]);_0x271734['attributes']=_[_0x5c65('0x29')](_0x61443f[_0x5c65('0x2a')],qs['fields'](_0x4de934[_0x5c65('0x27')][_0x5c65('0x2b')]));_0x271734['attributes']=_0x271734[_0x5c65('0x2c')][_0x5c65('0x2d')]?_0x271734[_0x5c65('0x2c')]:_0x61443f['model'];if(!_0x4de934[_0x5c65('0x27')][_0x5c65('0x2e')](_0x5c65('0x2f'))){_0x271734[_0x5c65('0x18')]=qs['limit'](_0x4de934[_0x5c65('0x27')][_0x5c65('0x18')]);_0x271734[_0x5c65('0x17')]=qs[_0x5c65('0x17')](_0x4de934['query']['offset']);}_0x271734['order']=qs['sort'](_0x4de934[_0x5c65('0x27')][_0x5c65('0x30')]);_0x271734[_0x5c65('0x31')]=qs[_0x5c65('0x28')](_['pick'](_0x4de934[_0x5c65('0x27')],_0x61443f[_0x5c65('0x28')]));if(_0x4de934[_0x5c65('0x27')]['filter']){_0x271734[_0x5c65('0x31')]=_[_0x5c65('0x32')](_0x271734[_0x5c65('0x31')],{'$or':_[_0x5c65('0x33')](_0x497d0c,function(_0x5f382b){if(_0x5f382b[_0x5c65('0x34')][_0x5c65('0x35')]!==_0x5c65('0x36')){var _0x4efbe8={};_0x4efbe8[_0x5f382b[_0x5c65('0x37')]]={'$like':'%'+_0x4de934['query'][_0x5c65('0x38')]+'%'};return _0x4efbe8;}})});}_0x271734=_['merge']({},_0x271734,_0x4de934['options']);var _0x172104={'where':_0x271734[_0x5c65('0x31')]};return db[_0x5c65('0x39')]['count'](_0x172104)[_0x5c65('0x1f')](function(_0x570443){_0x444659['count']=_0x570443;if(_0x4de934[_0x5c65('0x27')][_0x5c65('0x3a')]){_0x271734[_0x5c65('0x3b')]=[{'all':!![]}];}return db[_0x5c65('0x39')][_0x5c65('0x3c')](_0x271734);})[_0x5c65('0x1f')](function(_0x4cb758){_0x444659[_0x5c65('0x3d')]=_0x4cb758;return _0x444659;})[_0x5c65('0x1f')](respondWithFilteredResult(_0x544cb5,_0x271734))[_0x5c65('0x3e')](handleError(_0x544cb5,null));};exports[_0x5c65('0x3f')]=function(_0xa35a78,_0x3cf409){var _0x11d5e5={'raw':![],'where':{'id':_0xa35a78['params']['id']}},_0x66500={};_0x66500[_0x5c65('0x2a')]=_[_0x5c65('0x26')](db[_0x5c65('0x39')][_0x5c65('0x25')]);_0x66500[_0x5c65('0x27')]=_[_0x5c65('0x26')](_0xa35a78[_0x5c65('0x27')]);_0x66500['filters']=_[_0x5c65('0x29')](_0x66500['model'],_0x66500[_0x5c65('0x27')]);_0x11d5e5['attributes']=_[_0x5c65('0x29')](_0x66500[_0x5c65('0x2a')],qs[_0x5c65('0x2b')](_0xa35a78[_0x5c65('0x27')][_0x5c65('0x2b')]));_0x11d5e5['attributes']=_0x11d5e5[_0x5c65('0x2c')][_0x5c65('0x2d')]?_0x11d5e5[_0x5c65('0x2c')]:_0x66500[_0x5c65('0x2a')];if(_0xa35a78[_0x5c65('0x27')]['includeAll']){_0x11d5e5[_0x5c65('0x3b')]=[{'all':!![]}];}_0x11d5e5=_[_0x5c65('0x32')]({},_0x11d5e5,_0xa35a78['options']);return db[_0x5c65('0x39')][_0x5c65('0x40')](_0x11d5e5)[_0x5c65('0x1f')](handleEntityNotFound(_0x3cf409,null))[_0x5c65('0x1f')](respondWithResult(_0x3cf409,null))['catch'](handleError(_0x3cf409,null));};exports['create']=function(_0x48c584,_0x40ebdb){return db['UserProfileSection'][_0x5c65('0x41')](_0x48c584[_0x5c65('0x42')],{})['then'](respondWithResult(_0x40ebdb,0xc9))[_0x5c65('0x3e')](handleError(_0x40ebdb,null));};exports[_0x5c65('0x1e')]=function(_0x1f6919,_0x1e5c95){if(_0x1f6919[_0x5c65('0x42')]['id']){delete _0x1f6919[_0x5c65('0x42')]['id'];}return db[_0x5c65('0x39')]['find']({'where':{'id':_0x1f6919['params']['id']}})[_0x5c65('0x1f')](handleEntityNotFound(_0x1e5c95,null))['then'](saveUpdates(_0x1f6919[_0x5c65('0x42')],null))['then'](respondWithResult(_0x1e5c95,null))[_0x5c65('0x3e')](handleError(_0x1e5c95,null));};exports[_0x5c65('0x43')]=function(_0x213dfc,_0x2016d5){return db[_0x5c65('0x39')]['find']({'where':{'id':_0x213dfc[_0x5c65('0x44')]['id']}})['then'](handleEntityNotFound(_0x2016d5,null))['then'](removeEntity(_0x2016d5,null))[_0x5c65('0x3e')](handleError(_0x2016d5,null));};exports[_0x5c65('0x45')]=function(_0x241393,_0x2af8a1){return db[_0x5c65('0x39')]['describe']()[_0x5c65('0x1f')](respondWithResult(_0x2af8a1,null))[_0x5c65('0x3e')](handleError(_0x2af8a1,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index bd665ce..441a983 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 _0xf958=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','api','moment','bluebird','request-promise','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x5beb95,_0x12b81f){var _0x2b71a6=function(_0x4bcf18){while(--_0x4bcf18){_0x5beb95['push'](_0x5beb95['shift']());}};_0x2b71a6(++_0x12b81f);}(_0xf958,0x1c0));var _0x8f95=function(_0x361161,_0x45fdf3){_0x361161=_0x361161-0x0;var _0x4b48be=_0xf958[_0x361161];return _0x4b48be;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8f95('0x0'));var moment=require(_0x8f95('0x1'));var BPromise=require(_0x8f95('0x2'));var rp=require(_0x8f95('0x3'));var attributes=require(_0x8f95('0x4'));module[_0x8f95('0x5')]=function(_0x5e82fc,_0x2a4dcd){return _0x5e82fc[_0x8f95('0x6')](_0x8f95('0x7'),attributes,{'tableName':_0x8f95('0x8'),'paranoid':![],'indexes':[{'name':_0x8f95('0x9'),'fields':[_0x8f95('0xa'),_0x8f95('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2264=['bluebird','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','moment'];(function(_0x132d38,_0x5f1048){var _0x365083=function(_0x2f1905){while(--_0x2f1905){_0x132d38['push'](_0x132d38['shift']());}};_0x365083(++_0x5f1048);}(_0x2264,0x125));var _0x4226=function(_0x615cfc,_0xfc8dc9){_0x615cfc=_0x615cfc-0x0;var _0x217f5b=_0x2264[_0x615cfc];return _0x217f5b;};'use strict';var _=require(_0x4226('0x0'));var util=require(_0x4226('0x1'));var logger=require(_0x4226('0x2'))('api');var moment=require(_0x4226('0x3'));var BPromise=require(_0x4226('0x4'));var rp=require('request-promise');var attributes=require(_0x4226('0x5'));module['exports']=function(_0x476f76,_0x42f07a){return _0x476f76[_0x4226('0x6')](_0x4226('0x7'),attributes,{'tableName':_0x4226('0x8'),'paranoid':![],'indexes':[{'name':_0x4226('0x9'),'fields':['sectionId',_0x4226('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index cce6751..4d21177 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 _0x6cc1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x489fe3,_0x5ebb81){var _0x592190=function(_0x1612a7){while(--_0x1612a7){_0x489fe3['push'](_0x489fe3['shift']());}};_0x592190(++_0x5ebb81);}(_0x6cc1,0x126));var _0x16cc=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0x6cc1[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0x16cc('0x0'));var util=require(_0x16cc('0x1'));var moment=require(_0x16cc('0x2'));var BPromise=require(_0x16cc('0x3'));var rs=require(_0x16cc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x16cc('0x5'));var logger=require(_0x16cc('0x6'))(_0x16cc('0x7'));var config=require(_0x16cc('0x8'));var jayson=require(_0x16cc('0x9'));var client=jayson[_0x16cc('0xa')][_0x16cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44ed9c,_0x9a620b,_0x1c511a){return new BPromise(function(_0x2f3202,_0x10c8e1){return client[_0x16cc('0xc')](_0x44ed9c,_0x1c511a)[_0x16cc('0xd')](function(_0x4a8d2d){logger[_0x16cc('0xe')](_0x16cc('0xf'),_0x9a620b,_0x16cc('0x10'));logger[_0x16cc('0x11')](_0x16cc('0x12'),_0x9a620b,_0x16cc('0x10'),JSON['stringify'](_0x4a8d2d));if(_0x4a8d2d['error']){if(_0x4a8d2d[_0x16cc('0x13')]['code']===0x1f4){logger[_0x16cc('0x13')](_0x16cc('0xf'),_0x9a620b,_0x4a8d2d[_0x16cc('0x13')][_0x16cc('0x14')]);return _0x10c8e1(_0x4a8d2d[_0x16cc('0x13')][_0x16cc('0x14')]);}logger[_0x16cc('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x9a620b,_0x4a8d2d['error'][_0x16cc('0x14')]);return _0x2f3202(_0x4a8d2d[_0x16cc('0x13')]['message']);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x9a620b,_0x16cc('0x10'));_0x2f3202(_0x4a8d2d[_0x16cc('0x15')][_0x16cc('0x14')]);}})[_0x16cc('0x16')](function(_0x51539d){logger[_0x16cc('0x13')](_0x16cc('0xf'),_0x9a620b,_0x51539d);_0x10c8e1(_0x51539d);});});} \ No newline at end of file +var _0x6fb5=['../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','ioredis','../../config/logger','rpc'];(function(_0x26eca4,_0x5d017d){var _0x512271=function(_0x3f882a){while(--_0x3f882a){_0x26eca4['push'](_0x26eca4['shift']());}};_0x512271(++_0x5d017d);}(_0x6fb5,0x10c));var _0x56fb=function(_0x3c2cf2,_0x497b56){_0x3c2cf2=_0x3c2cf2-0x0;var _0x36cffa=_0x6fb5[_0x3c2cf2];return _0x36cffa;};'use strict';var _=require(_0x56fb('0x0'));var util=require('util');var moment=require(_0x56fb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56fb('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x56fb('0x3'))(_0x56fb('0x4'));var config=require(_0x56fb('0x5'));var jayson=require(_0x56fb('0x6'));var client=jayson[_0x56fb('0x7')][_0x56fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x216ec1,_0x7c837e,_0x36a42a){return new BPromise(function(_0x54bcfa,_0x623c59){return client[_0x56fb('0x9')](_0x216ec1,_0x36a42a)[_0x56fb('0xa')](function(_0x300340){logger[_0x56fb('0xb')](_0x56fb('0xc'),_0x7c837e,'request\x20sent');logger[_0x56fb('0xd')](_0x56fb('0xe'),_0x7c837e,_0x56fb('0xf'),JSON['stringify'](_0x300340));if(_0x300340[_0x56fb('0x10')]){if(_0x300340[_0x56fb('0x10')][_0x56fb('0x11')]===0x1f4){logger[_0x56fb('0x10')](_0x56fb('0xc'),_0x7c837e,_0x300340[_0x56fb('0x10')][_0x56fb('0x12')]);return _0x623c59(_0x300340[_0x56fb('0x10')][_0x56fb('0x12')]);}logger[_0x56fb('0x10')](_0x56fb('0xc'),_0x7c837e,_0x300340[_0x56fb('0x10')]['message']);return _0x54bcfa(_0x300340[_0x56fb('0x10')][_0x56fb('0x12')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x7c837e,_0x56fb('0xf'));_0x54bcfa(_0x300340[_0x56fb('0x13')]['message']);}})[_0x56fb('0x14')](function(_0x4e208e){logger[_0x56fb('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x7c837e,_0x4e208e);_0x623c59(_0x4e208e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index e542376..4f39021 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 _0xd916=['../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout','express'];(function(_0x4fbbee,_0x11debc){var _0x18b9c1=function(_0x362062){while(--_0x362062){_0x4fbbee['push'](_0x4fbbee['shift']());}};_0x18b9c1(++_0x11debc);}(_0xd916,0x18a));var _0x6d91=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xd916[_0x2d34d6];return _0x1d3d12;};'use strict';var multer=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var path=require(_0x6d91('0x2'));var timeout=require(_0x6d91('0x3'));var express=require(_0x6d91('0x4'));var router=express['Router']();var auth=require(_0x6d91('0x5'));var interaction=require(_0x6d91('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x0f4d=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x73d74,_0xb32b88){var _0x9441a=function(_0x329160){while(--_0x329160){_0x73d74['push'](_0x73d74['shift']());}};_0x9441a(++_0xb32b88);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x5a99c2,_0x4a248c){_0x5a99c2=_0x5a99c2-0x0;var _0x3fdc25=_0x0f4d[_0x5a99c2];return _0x3fdc25;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0f4('0x0'));var express=require('express');var router=express[_0xd0f4('0x1')]();var auth=require(_0xd0f4('0x2'));var interaction=require(_0xd0f4('0x3'));var config=require(_0xd0f4('0x4'));module[_0xd0f4('0x5')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 747178b..36fd936 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 _0x70f1=['sequelize','exports','INTEGER'];(function(_0x459f68,_0x194353){var _0x9f0cb2=function(_0x1b41a2){while(--_0x1b41a2){_0x459f68['push'](_0x459f68['shift']());}};_0x9f0cb2(++_0x194353);}(_0x70f1,0xa5));var _0x170f=function(_0x3b3c58,_0x5a1081){_0x3b3c58=_0x3b3c58-0x0;var _0x128e68=_0x70f1[_0x3b3c58];return _0x128e68;};'use strict';var Sequelize=require(_0x170f('0x0'));module[_0x170f('0x1')]={'penalty':{'type':Sequelize[_0x170f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1410=['INTEGER','exports'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x1410,0x10d));var _0x0141=function(_0x477757,_0x5b8df8){_0x477757=_0x477757-0x0;var _0x37dad5=_0x1410[_0x477757];return _0x37dad5;};'use strict';var Sequelize=require('sequelize');module[_0x0141('0x0')]={'penalty':{'type':Sequelize[_0x0141('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index d74987d..9114e84 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 _0xca2c=['moment','bluebird','request-promise','./userSmsQueue.attributes','lodash','../../config/logger','api'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xca2c,0x131));var _0xcca2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xca2c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcca2('0x0'));var util=require('util');var logger=require(_0xcca2('0x1'))(_0xcca2('0x2'));var moment=require(_0xcca2('0x3'));var BPromise=require(_0xcca2('0x4'));var rp=require(_0xcca2('0x5'));var attributes=require(_0xcca2('0x6'));module['exports']=function(_0x31a8eb,_0x225683){return _0x31a8eb['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7fb=['./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x28a3f8,_0x572263){var _0x1a12ab=function(_0xbfe42){while(--_0xbfe42){_0x28a3f8['push'](_0x28a3f8['shift']());}};_0x1a12ab(++_0x572263);}(_0xa7fb,0x170));var _0xba7f=function(_0x19b351,_0x547358){_0x19b351=_0x19b351-0x0;var _0x104803=_0xa7fb[_0x19b351];return _0x104803;};'use strict';var _=require(_0xba7f('0x0'));var util=require(_0xba7f('0x1'));var logger=require('../../config/logger')(_0xba7f('0x2'));var moment=require(_0xba7f('0x3'));var BPromise=require(_0xba7f('0x4'));var rp=require(_0xba7f('0x5'));var attributes=require(_0xba7f('0x6'));module[_0xba7f('0x7')]=function(_0x480233,_0x1737ca){return _0x480233[_0xba7f('0x8')](_0xba7f('0x9'),attributes,{'tableName':_0xba7f('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 a6adadd..c3b8bbb 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 _0x082b=['error','code','UserSmsQueue,\x20%s,\x20%s','message','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ac6e9,_0x2bc178){var _0x2c6b4c=function(_0x5e02c4){while(--_0x5e02c4){_0x4ac6e9['push'](_0x4ac6e9['shift']());}};_0x2c6b4c(++_0x2bc178);}(_0x082b,0xca));var _0xb082=function(_0x4d7cc4,_0x256991){_0x4d7cc4=_0x4d7cc4-0x0;var _0x24dd38=_0x082b[_0x4d7cc4];return _0x24dd38;};'use strict';var _=require(_0xb082('0x0'));var util=require('util');var moment=require(_0xb082('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb082('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb082('0x3'))(_0xb082('0x4'));var config=require(_0xb082('0x5'));var jayson=require(_0xb082('0x6'));var client=jayson[_0xb082('0x7')][_0xb082('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48aa04,_0x3870e9,_0x25eb70){return new BPromise(function(_0x5b48d8,_0xb32d63){return client[_0xb082('0x9')](_0x48aa04,_0x25eb70)['then'](function(_0x331405){logger[_0xb082('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x3870e9,_0xb082('0xb'));logger['debug'](_0xb082('0xc'),_0x3870e9,_0xb082('0xb'),JSON[_0xb082('0xd')](_0x331405));if(_0x331405['error']){if(_0x331405[_0xb082('0xe')][_0xb082('0xf')]===0x1f4){logger[_0xb082('0xe')](_0xb082('0x10'),_0x3870e9,_0x331405[_0xb082('0xe')][_0xb082('0x11')]);return _0xb32d63(_0x331405[_0xb082('0xe')][_0xb082('0x11')]);}logger[_0xb082('0xe')](_0xb082('0x10'),_0x3870e9,_0x331405['error'][_0xb082('0x11')]);return _0x5b48d8(_0x331405[_0xb082('0xe')][_0xb082('0x11')]);}else{logger[_0xb082('0xa')](_0xb082('0x10'),_0x3870e9,'request\x20sent');_0x5b48d8(_0x331405['result'][_0xb082('0x11')]);}})['catch'](function(_0x49b4b6){logger[_0xb082('0xe')](_0xb082('0x10'),_0x3870e9,_0x49b4b6);_0xb32d63(_0x49b4b6);});});} \ No newline at end of file +var _0xf85e=['client','http','request','info','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xac8e6c,_0x1ef2f9){var _0xe8f0f2=function(_0x5dd151){while(--_0x5dd151){_0xac8e6c['push'](_0xac8e6c['shift']());}};_0xe8f0f2(++_0x1ef2f9);}(_0xf85e,0x116));var _0xef85=function(_0x30585c,_0x56bda2){_0x30585c=_0x30585c-0x0;var _0x23a386=_0xf85e[_0x30585c];return _0x23a386;};'use strict';var _=require(_0xef85('0x0'));var util=require(_0xef85('0x1'));var moment=require(_0xef85('0x2'));var BPromise=require(_0xef85('0x3'));var rs=require(_0xef85('0x4'));var fs=require('fs');var Redis=require(_0xef85('0x5'));var db=require(_0xef85('0x6'))['db'];var utils=require(_0xef85('0x7'));var logger=require(_0xef85('0x8'))('rpc');var config=require(_0xef85('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xef85('0xa')][_0xef85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x577712,_0x553442,_0x31363e){return new BPromise(function(_0x2512d0,_0xd48e06){return client[_0xef85('0xc')](_0x577712,_0x31363e)['then'](function(_0x9d3a85){logger[_0xef85('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x553442,'request\x20sent');logger[_0xef85('0xe')](_0xef85('0xf'),_0x553442,'request\x20sent',JSON[_0xef85('0x10')](_0x9d3a85));if(_0x9d3a85[_0xef85('0x11')]){if(_0x9d3a85[_0xef85('0x11')][_0xef85('0x12')]===0x1f4){logger[_0xef85('0x11')](_0xef85('0x13'),_0x553442,_0x9d3a85[_0xef85('0x11')][_0xef85('0x14')]);return _0xd48e06(_0x9d3a85[_0xef85('0x11')][_0xef85('0x14')]);}logger[_0xef85('0x11')](_0xef85('0x13'),_0x553442,_0x9d3a85['error'][_0xef85('0x14')]);return _0x2512d0(_0x9d3a85[_0xef85('0x11')][_0xef85('0x14')]);}else{logger[_0xef85('0xd')](_0xef85('0x13'),_0x553442,_0xef85('0x15'));_0x2512d0(_0x9d3a85[_0xef85('0x16')][_0xef85('0x14')]);}})[_0xef85('0x17')](function(_0x41cbe0){logger[_0xef85('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x553442,_0x41cbe0);_0xd48e06(_0x41cbe0);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 9e5b79c..8a854eb 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 _0x7919=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4279e1,_0x39cda4){var _0x1e33ea=function(_0x5b00ea){while(--_0x5b00ea){_0x4279e1['push'](_0x4279e1['shift']());}};_0x1e33ea(++_0x39cda4);}(_0x7919,0xeb));var _0x9791=function(_0x439204,_0x402d9a){_0x439204=_0x439204-0x0;var _0x24bc7c=_0x7919[_0x439204];return _0x24bc7c;};'use strict';var multer=require(_0x9791('0x0'));var util=require(_0x9791('0x1'));var path=require(_0x9791('0x2'));var timeout=require(_0x9791('0x3'));var express=require(_0x9791('0x4'));var router=express[_0x9791('0x5')]();var auth=require(_0x9791('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9791('0x7'));module[_0x9791('0x8')]=router; \ No newline at end of file +var _0x6d19=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6d19,0x160));var _0x96d1=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x6d19[_0x31991b];return _0x307304;};'use strict';var multer=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var path=require(_0x96d1('0x2'));var timeout=require(_0x96d1('0x3'));var express=require(_0x96d1('0x4'));var router=express[_0x96d1('0x5')]();var auth=require(_0x96d1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x96d1('0x7'));module[_0x96d1('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 211a306..e2e637a 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 _0x65a2=['exports','INTEGER'];(function(_0xcde160,_0x3bb5bb){var _0x2034ec=function(_0xde461c){while(--_0xde461c){_0xcde160['push'](_0xcde160['shift']());}};_0x2034ec(++_0x3bb5bb);}(_0x65a2,0xfa));var _0x265a=function(_0x1d2b68,_0x30fc30){_0x1d2b68=_0x1d2b68-0x0;var _0x4ef516=_0x65a2[_0x1d2b68];return _0x4ef516;};'use strict';var Sequelize=require('sequelize');module[_0x265a('0x0')]={'penalty':{'type':Sequelize[_0x265a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x78fa=['INTEGER'];(function(_0x13af83,_0x157a98){var _0x2cdcd2=function(_0x4b9679){while(--_0x4b9679){_0x13af83['push'](_0x13af83['shift']());}};_0x2cdcd2(++_0x157a98);}(_0x78fa,0x19d));var _0xa78f=function(_0x179b43,_0x509e24){_0x179b43=_0x179b43-0x0;var _0x4583af=_0x78fa[_0x179b43];return _0x4583af;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xa78f('0x0')],'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 9cce0c3..338e54d 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 _0xea9a=['UserVoiceQueue','lodash','../../config/logger','api','moment','request-promise','./userVoiceQueue.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea9a,0xd9));var _0xaea9=function(_0x3925c8,_0x2594b6){_0x3925c8=_0x3925c8-0x0;var _0x4c2567=_0xea9a[_0x3925c8];return _0x4c2567;};'use strict';var _=require(_0xaea9('0x0'));var util=require('util');var logger=require(_0xaea9('0x1'))(_0xaea9('0x2'));var moment=require(_0xaea9('0x3'));var BPromise=require('bluebird');var rp=require(_0xaea9('0x4'));var attributes=require(_0xaea9('0x5'));module[_0xaea9('0x6')]=function(_0x317460,_0x3e7365){return _0x317460[_0xaea9('0x7')](_0xaea9('0x8'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x969e=['moment','bluebird','exports','define','user_has_voice_queues','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x969e,0x1b5));var _0xe969=function(_0xdc9d0a,_0x5db8eb){_0xdc9d0a=_0xdc9d0a-0x0;var _0x15dbcc=_0x969e[_0xdc9d0a];return _0x15dbcc;};'use strict';var _=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var logger=require('../../config/logger')(_0xe969('0x2'));var moment=require(_0xe969('0x3'));var BPromise=require(_0xe969('0x4'));var rp=require('request-promise');var attributes=require('./userVoiceQueue.attributes');module[_0xe969('0x5')]=function(_0xfe5e2d,_0x5f1711){return _0xfe5e2d[_0xe969('0x6')]('UserVoiceQueue',attributes,{'tableName':_0xe969('0x7'),'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 7f5406d..92db38d 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 _0xe478=['stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x27c2d0,_0x23ee15){var _0x5da5ed=function(_0x44d165){while(--_0x44d165){_0x27c2d0['push'](_0x27c2d0['shift']());}};_0x5da5ed(++_0x23ee15);}(_0xe478,0x19e));var _0x8e47=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xe478[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x8e47('0x0'));var util=require('util');var moment=require(_0x8e47('0x1'));var BPromise=require(_0x8e47('0x2'));var rs=require(_0x8e47('0x3'));var fs=require('fs');var Redis=require(_0x8e47('0x4'));var db=require(_0x8e47('0x5'))['db'];var utils=require(_0x8e47('0x6'));var logger=require(_0x8e47('0x7'))(_0x8e47('0x8'));var config=require(_0x8e47('0x9'));var jayson=require(_0x8e47('0xa'));var client=jayson[_0x8e47('0xb')][_0x8e47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34f242,_0x29cc4e,_0x24125e){return new BPromise(function(_0x1658e2,_0x4c6c3d){return client[_0x8e47('0xd')](_0x34f242,_0x24125e)[_0x8e47('0xe')](function(_0x3a69f0){logger[_0x8e47('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x29cc4e,'request\x20sent');logger['debug'](_0x8e47('0x10'),_0x29cc4e,_0x8e47('0x11'),JSON[_0x8e47('0x12')](_0x3a69f0));if(_0x3a69f0['error']){if(_0x3a69f0[_0x8e47('0x13')][_0x8e47('0x14')]===0x1f4){logger[_0x8e47('0x13')](_0x8e47('0x15'),_0x29cc4e,_0x3a69f0[_0x8e47('0x13')][_0x8e47('0x16')]);return _0x4c6c3d(_0x3a69f0['error'][_0x8e47('0x16')]);}logger[_0x8e47('0x13')](_0x8e47('0x15'),_0x29cc4e,_0x3a69f0[_0x8e47('0x13')]['message']);return _0x1658e2(_0x3a69f0[_0x8e47('0x13')][_0x8e47('0x16')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x29cc4e,_0x8e47('0x11'));_0x1658e2(_0x3a69f0[_0x8e47('0x17')][_0x8e47('0x16')]);}})['catch'](function(_0x2b18f6){logger[_0x8e47('0x13')](_0x8e47('0x15'),_0x29cc4e,_0x2b18f6);_0x4c6c3d(_0x2b18f6);});});} \ No newline at end of file +var _0xdc74=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message'];(function(_0x354275,_0x1f9c21){var _0x59378b=function(_0x3e5295){while(--_0x3e5295){_0x354275['push'](_0x354275['shift']());}};_0x59378b(++_0x1f9c21);}(_0xdc74,0x98));var _0x4dc7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc74[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4dc7('0x0'));var util=require(_0x4dc7('0x1'));var moment=require(_0x4dc7('0x2'));var BPromise=require(_0x4dc7('0x3'));var rs=require(_0x4dc7('0x4'));var fs=require('fs');var Redis=require(_0x4dc7('0x5'));var db=require(_0x4dc7('0x6'))['db'];var utils=require(_0x4dc7('0x7'));var logger=require(_0x4dc7('0x8'))(_0x4dc7('0x9'));var config=require(_0x4dc7('0xa'));var jayson=require(_0x4dc7('0xb'));var client=jayson[_0x4dc7('0xc')][_0x4dc7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x16fd3c,_0x209dd9,_0x303e18){return new BPromise(function(_0x82d6ab,_0x16323e){return client[_0x4dc7('0xe')](_0x16fd3c,_0x303e18)[_0x4dc7('0xf')](function(_0x248c63){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x209dd9,_0x4dc7('0x10'));logger['debug'](_0x4dc7('0x11'),_0x209dd9,_0x4dc7('0x10'),JSON[_0x4dc7('0x12')](_0x248c63));if(_0x248c63[_0x4dc7('0x13')]){if(_0x248c63[_0x4dc7('0x13')][_0x4dc7('0x14')]===0x1f4){logger[_0x4dc7('0x13')](_0x4dc7('0x15'),_0x209dd9,_0x248c63['error']['message']);return _0x16323e(_0x248c63[_0x4dc7('0x13')][_0x4dc7('0x16')]);}logger[_0x4dc7('0x13')](_0x4dc7('0x15'),_0x209dd9,_0x248c63[_0x4dc7('0x13')]['message']);return _0x82d6ab(_0x248c63[_0x4dc7('0x13')]['message']);}else{logger[_0x4dc7('0x17')](_0x4dc7('0x15'),_0x209dd9,'request\x20sent');_0x82d6ab(_0x248c63['result'][_0x4dc7('0x16')]);}})[_0x4dc7('0x18')](function(_0x1880f3){logger['error'](_0x4dc7('0x15'),_0x209dd9,_0x1880f3);_0x16323e(_0x1880f3);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 6afdc4f..a99d62e 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 _0x9576=['../../config/environment','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9576,0x182));var _0x6957=function(_0x1830ef,_0x356eab){_0x1830ef=_0x1830ef-0x0;var _0x144dc9=_0x9576[_0x1830ef];return _0x144dc9;};'use strict';var multer=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var path=require(_0x6957('0x2'));var timeout=require(_0x6957('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6957('0x4'));var interaction=require(_0x6957('0x5'));var config=require(_0x6957('0x6'));module[_0x6957('0x7')]=router; \ No newline at end of file +var _0xb511=['express','Router','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x2d4c4b,_0x1a6432){var _0x51d127=function(_0x3badcf){while(--_0x3badcf){_0x2d4c4b['push'](_0x2d4c4b['shift']());}};_0x51d127(++_0x1a6432);}(_0xb511,0x165));var _0x1b51=function(_0xc0876,_0x4af608){_0xc0876=_0xc0876-0x0;var _0x3e2a2e=_0xb511[_0xc0876];return _0x3e2a2e;};'use strict';var multer=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var path=require(_0x1b51('0x2'));var timeout=require('connect-timeout');var express=require(_0x1b51('0x3'));var router=express[_0x1b51('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1b51('0x5'));var config=require(_0x1b51('0x6'));module[_0x1b51('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index b852e51..4d6c87e 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 _0xa97e=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x13d46e,_0xb71980){var _0x30e59b=function(_0x239cfc){while(--_0x239cfc){_0x13d46e['push'](_0x13d46e['shift']());}};_0x30e59b(++_0xb71980);}(_0xa97e,0xca));var _0xea97=function(_0x210b58,_0x916516){_0x210b58=_0x210b58-0x0;var _0x1029ef=_0xa97e[_0x210b58];return _0x1029ef;};'use strict';var Sequelize=require(_0xea97('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xea97('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xea97('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xea97('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xea97('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xea97('0x2')},'VoiceQueueId':{'type':Sequelize[_0xea97('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xea97('0x3')],'allowNull':![],'unique':_0xea97('0x4'),'comment':_0xea97('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xea97('0x2')},'paused':{'type':Sequelize[_0xea97('0x1')](0xb),'defaultValue':0x0,'comment':_0xea97('0x2')}}; \ No newline at end of file +var _0x3097=['STRING','queue_interface','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x54adf9,_0x247dc0){var _0x4cbb65=function(_0xc3af00){while(--_0xc3af00){_0x54adf9['push'](_0x54adf9['shift']());}};_0x4cbb65(++_0x247dc0);}(_0x3097,0x66));var _0x7309=function(_0x11aaa1,_0x2ba002){_0x11aaa1=_0x11aaa1-0x0;var _0x300a0a=_0x3097[_0x11aaa1];return _0x300a0a;};'use strict';var Sequelize=require('sequelize');module[_0x7309('0x0')]={'uniqueid':{'type':Sequelize[_0x7309('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7309('0x2')},'membername':{'type':Sequelize[_0x7309('0x3')],'allowNull':![],'comment':_0x7309('0x2')},'UserId':{'type':Sequelize[_0x7309('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7309('0x3')],'allowNull':![],'unique':_0x7309('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x7309('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x7309('0x3')],'allowNull':![],'unique':_0x7309('0x4'),'comment':_0x7309('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x7309('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x7309('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index e75df55..45e4b35 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 _0x3521=['exports','events','../../mysqldb','UserVoiceQueueRt','save','remove','emit','hook'];(function(_0x2cc386,_0x105121){var _0x731ae4=function(_0x35cfad){while(--_0x35cfad){_0x2cc386['push'](_0x2cc386['shift']());}};_0x731ae4(++_0x105121);}(_0x3521,0x131));var _0x1352=function(_0x60cd1f,_0x4e555){_0x60cd1f=_0x60cd1f-0x0;var _0x31ceb4=_0x3521[_0x60cd1f];return _0x31ceb4;};'use strict';var EventEmitter=require(_0x1352('0x0'));var UserVoiceQueueRt=require(_0x1352('0x1'))['db'][_0x1352('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1352('0x3'),'afterUpdate':'update','afterDestroy':_0x1352('0x4')};function emitEvent(_0xd02411){return function(_0xa7510a,_0x4a9f34,_0x1c13b3){UserVoiceQueueRtEvents['emit'](_0xd02411+':'+_0xa7510a['id'],_0xa7510a);UserVoiceQueueRtEvents[_0x1352('0x5')](_0xd02411,_0xa7510a);_0x1c13b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x1352('0x6')](e,emitEvent(event));}}module[_0x1352('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x4b80=['hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','save','emit'];(function(_0x56ea2e,_0x47ae0d){var _0x4fc944=function(_0xa5f553){while(--_0xa5f553){_0x56ea2e['push'](_0x56ea2e['shift']());}};_0x4fc944(++_0x47ae0d);}(_0x4b80,0x13d));var _0x04b8=function(_0x344da8,_0x26cd98){_0x344da8=_0x344da8-0x0;var _0x3efa9c=_0x4b80[_0x344da8];return _0x3efa9c;};'use strict';var EventEmitter=require(_0x04b8('0x0'));var UserVoiceQueueRt=require(_0x04b8('0x1'))['db'][_0x04b8('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x04b8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49e4b2){return function(_0x54f4ae,_0x493520,_0x4c3282){UserVoiceQueueRtEvents[_0x04b8('0x4')](_0x49e4b2+':'+_0x54f4ae['id'],_0x54f4ae);UserVoiceQueueRtEvents[_0x04b8('0x4')](_0x49e4b2,_0x54f4ae);_0x4c3282(null);};}for(var e in events){if(events[_0x04b8('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x04b8('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index b4a8f72..f3b2c78 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 _0xcd2a=['lodash','util','../../config/logger','moment','request-promise','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x3dcd52,_0x2c151a){var _0x4fb1c2=function(_0x34081a){while(--_0x34081a){_0x3dcd52['push'](_0x3dcd52['shift']());}};_0x4fb1c2(++_0x2c151a);}(_0xcd2a,0x1ef));var _0xacd2=function(_0x3782f1,_0xdb9da7){_0x3782f1=_0x3782f1-0x0;var _0x59aa2c=_0xcd2a[_0x3782f1];return _0x59aa2c;};'use strict';var _=require(_0xacd2('0x0'));var util=require(_0xacd2('0x1'));var logger=require(_0xacd2('0x2'))('api');var moment=require(_0xacd2('0x3'));var BPromise=require('bluebird');var rp=require(_0xacd2('0x4'));var attributes=require(_0xacd2('0x5'));module[_0xacd2('0x6')]=function(_0x3e592e,_0x36ad97){return _0x3e592e['define'](_0xacd2('0x7'),attributes,{'tableName':_0xacd2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa06b=['lodash','util','../../config/logger','bluebird','request-promise','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x327813,_0x574dcd){var _0x1edfe1=function(_0x1db736){while(--_0x1db736){_0x327813['push'](_0x327813['shift']());}};_0x1edfe1(++_0x574dcd);}(_0xa06b,0xe1));var _0xba06=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa06b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xba06('0x0'));var util=require(_0xba06('0x1'));var logger=require(_0xba06('0x2'))('api');var moment=require('moment');var BPromise=require(_0xba06('0x3'));var rp=require(_0xba06('0x4'));var attributes=require(_0xba06('0x5'));module[_0xba06('0x6')]=function(_0x37ee80,_0x2185cb){return _0x37ee80['define'](_0xba06('0x7'),attributes,{'tableName':_0xba06('0x8'),'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 4dffcb9..0a9a4cb 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 _0x4476=['literal','stringify','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x4476,0x98));var _0x6447=function(_0x2aefff,_0x26a24b){_0x2aefff=_0x2aefff-0x0;var _0x4e4534=_0x4476[_0x2aefff];return _0x4e4534;};'use strict';var _=require('lodash');var util=require(_0x6447('0x0'));var moment=require('moment');var BPromise=require(_0x6447('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6447('0x2'));var logger=require(_0x6447('0x3'))(_0x6447('0x4'));var config=require(_0x6447('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6447('0x6')]['http']({'port':0x232a});config[_0x6447('0x7')]=_['defaults'](config[_0x6447('0x7')],{'host':_0x6447('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6447('0x7')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x184c35,_0x458fc9,_0x22c1f1){return new BPromise(function(_0x49313d,_0x37f682){return client[_0x6447('0x9')](_0x184c35,_0x22c1f1)[_0x6447('0xa')](function(_0x5c3851){logger[_0x6447('0xb')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x458fc9,_0x6447('0xc'));logger[_0x6447('0xd')](_0x6447('0xe'),_0x458fc9,_0x6447('0xc'),JSON['stringify'](_0x5c3851));if(_0x5c3851[_0x6447('0xf')]){if(_0x5c3851[_0x6447('0xf')]['code']===0x1f4){logger[_0x6447('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x458fc9,_0x5c3851[_0x6447('0xf')][_0x6447('0x10')]);return _0x37f682(_0x5c3851[_0x6447('0xf')]['message']);}logger['error'](_0x6447('0x11'),_0x458fc9,_0x5c3851[_0x6447('0xf')][_0x6447('0x10')]);return _0x49313d(_0x5c3851[_0x6447('0xf')][_0x6447('0x10')]);}else{logger['info'](_0x6447('0x11'),_0x458fc9,_0x6447('0xc'));_0x49313d(_0x5c3851[_0x6447('0x12')][_0x6447('0x10')]);}})[_0x6447('0x13')](function(_0x325558){logger['error'](_0x6447('0x11'),_0x458fc9,_0x325558);_0x37f682(_0x325558);});});}exports[_0x6447('0x14')]=function(_0x4d2032){var _0x142fb2=this;return new Promise(function(_0x170f4b,_0x1a5212){return db[_0x6447('0x15')][_0x6447('0x16')]({'raw':_0x4d2032['options']?_0x4d2032[_0x6447('0x17')][_0x6447('0x18')]===undefined?!![]:![]:!![],'where':_0x4d2032[_0x6447('0x17')]?_0x4d2032[_0x6447('0x17')][_0x6447('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0x6447('0x1a'),db[_0x6447('0x1b')]['fn']('IF',db['sequelize'][_0x6447('0x1c')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x6447('0xa')](function(_0x40a0f1){logger[_0x6447('0xb')](_0x6447('0x14'),_0x4d2032);logger['debug'](_0x6447('0x14'),_0x4d2032,JSON[_0x6447('0x1d')](_0x40a0f1));_0x170f4b(_0x40a0f1);})['catch'](function(_0xa83e5f){logger[_0x6447('0xf')](_0x6447('0x14'),_0xa83e5f[_0x6447('0x10')],_0x4d2032);_0x1a5212(_0x142fb2[_0x6447('0xf')](0x1f4,_0xa83e5f[_0x6447('0x10')]));});});}; \ No newline at end of file +var _0xadab=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x50a61a,_0x1d0684){var _0x5914d9=function(_0x42cb95){while(--_0x42cb95){_0x50a61a['push'](_0x50a61a['shift']());}};_0x5914d9(++_0x1d0684);}(_0xadab,0x18f));var _0xbada=function(_0x28e7e1,_0x45f235){_0x28e7e1=_0x28e7e1-0x0;var _0x1d8a9e=_0xadab[_0x28e7e1];return _0x1d8a9e;};'use strict';var _=require(_0xbada('0x0'));var util=require(_0xbada('0x1'));var moment=require(_0xbada('0x2'));var BPromise=require(_0xbada('0x3'));var rs=require(_0xbada('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbada('0x5'))(_0xbada('0x6'));var config=require(_0xbada('0x7'));var jayson=require(_0xbada('0x8'));var client=jayson[_0xbada('0x9')][_0xbada('0xa')]({'port':0x232a});config['redis']=_[_0xbada('0xb')](config[_0xbada('0xc')],{'host':_0xbada('0xd'),'port':0x18eb});var socket=require(_0xbada('0xe'))(new Redis(config[_0xbada('0xc')]));require(_0xbada('0xf'))['register'](socket);function respondWithRpcPromise(_0x1becb6,_0x17623b,_0x5b533b){return new BPromise(function(_0x2130f8,_0x43e9e9){return client[_0xbada('0x10')](_0x1becb6,_0x5b533b)[_0xbada('0x11')](function(_0x230c34){logger[_0xbada('0x12')](_0xbada('0x13'),_0x17623b,'request\x20sent');logger[_0xbada('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x17623b,_0xbada('0x15'),JSON[_0xbada('0x16')](_0x230c34));if(_0x230c34[_0xbada('0x17')]){if(_0x230c34[_0xbada('0x17')][_0xbada('0x18')]===0x1f4){logger[_0xbada('0x17')](_0xbada('0x13'),_0x17623b,_0x230c34[_0xbada('0x17')]['message']);return _0x43e9e9(_0x230c34[_0xbada('0x17')][_0xbada('0x19')]);}logger[_0xbada('0x17')](_0xbada('0x13'),_0x17623b,_0x230c34[_0xbada('0x17')][_0xbada('0x19')]);return _0x2130f8(_0x230c34[_0xbada('0x17')][_0xbada('0x19')]);}else{logger[_0xbada('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x17623b,_0xbada('0x15'));_0x2130f8(_0x230c34[_0xbada('0x1a')][_0xbada('0x19')]);}})[_0xbada('0x1b')](function(_0x5df5a7){logger['error'](_0xbada('0x13'),_0x17623b,_0x5df5a7);_0x43e9e9(_0x5df5a7);});});}exports['GetVoiceQueueRtPauses']=function(_0xdbd762){var _0x393e85=this;return new Promise(function(_0x5818b1,_0x26d211){return db[_0xbada('0x1c')][_0xbada('0x1d')]({'raw':_0xdbd762[_0xbada('0x1e')]?_0xdbd762[_0xbada('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xdbd762[_0xbada('0x1e')]?_0xdbd762[_0xbada('0x1e')][_0xbada('0x1f')]||null:null,'attributes':[[db[_0xbada('0x20')]['fn'](_0xbada('0x21'),db[_0xbada('0x20')]['fn']('IF',db[_0xbada('0x20')][_0xbada('0x22')](_0xbada('0x23')))),'outboundQueuePauses']]})[_0xbada('0x11')](function(_0x345641){logger[_0xbada('0x12')](_0xbada('0x24'),_0xdbd762);logger[_0xbada('0x14')](_0xbada('0x24'),_0xdbd762,JSON[_0xbada('0x16')](_0x345641));_0x5818b1(_0x345641);})[_0xbada('0x1b')](function(_0x30f158){logger['error'](_0xbada('0x24'),_0x30f158[_0xbada('0x19')],_0xdbd762);_0x26d211(_0x393e85[_0xbada('0x17')](0x1f4,_0x30f158['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index c91b5d4..259bfb2 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 _0x741c=['remove','update','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0xb2eacd,_0x22e053){var _0x230f98=function(_0x2181d0){while(--_0x2181d0){_0xb2eacd['push'](_0xb2eacd['shift']());}};_0x230f98(++_0x22e053);}(_0x741c,0x196));var _0xc741=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x741c[_0x321bb2];return _0x9c12ed;};'use strict';var UserVoiceQueueRtEvents=require(_0xc741('0x0'));var events=[_0xc741('0x1'),_0xc741('0x2'),_0xc741('0x3')];function createListener(_0x1241fd,_0x31de60){return function(_0x5c8d3b){_0x31de60['emit'](_0x1241fd,_0x5c8d3b);};}function removeListener(_0x4089bf,_0x4ccc27){return function(){UserVoiceQueueRtEvents[_0xc741('0x4')](_0x4089bf,_0x4ccc27);};}exports[_0xc741('0x5')]=function(_0x3708ae){for(var _0x133bc4=0x0,_0x3f3d82=events[_0xc741('0x6')];_0x133bc4<_0x3f3d82;_0x133bc4++){var _0x46b743=events[_0x133bc4];var _0x598ead=createListener(_0xc741('0x7')+_0x46b743,_0x3708ae);UserVoiceQueueRtEvents['on'](_0x46b743,_0x598ead);}}; \ No newline at end of file +var _0x723e=['remove','update','emit','removeListener','length','userVoiceQueueRt:','save'];(function(_0x14fd59,_0x5f36a4){var _0x42a419=function(_0x13043b){while(--_0x13043b){_0x14fd59['push'](_0x14fd59['shift']());}};_0x42a419(++_0x5f36a4);}(_0x723e,0x179));var _0xe723=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x723e[_0x121886];return _0x20ca01;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xe723('0x0'),_0xe723('0x1'),_0xe723('0x2')];function createListener(_0x161d6b,_0x2801c5){return function(_0xab58a8){_0x2801c5[_0xe723('0x3')](_0x161d6b,_0xab58a8);};}function removeListener(_0x1da20f,_0x8f78b2){return function(){UserVoiceQueueRtEvents[_0xe723('0x4')](_0x1da20f,_0x8f78b2);};}exports['register']=function(_0x32d689){for(var _0x20c13b=0x0,_0x1335cd=events[_0xe723('0x5')];_0x20c13b<_0x1335cd;_0x20c13b++){var _0x2aebbd=events[_0x20c13b];var _0xe50f7=createListener(_0xe723('0x6')+_0x2aebbd,_0x32d689);UserVoiceQueueRtEvents['on'](_0x2aebbd,_0xe50f7);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 1c5da8e..9be4cc0 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 _0x3c81=['destroy','exports','multer','util','connect-timeout','express','./variable.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x2af368,_0x5e8ae8){var _0x21fd6a=function(_0xfc34d7){while(--_0xfc34d7){_0x2af368['push'](_0x2af368['shift']());}};_0x21fd6a(++_0x5e8ae8);}(_0x3c81,0x102));var _0x13c8=function(_0x18686b,_0x22da76){_0x18686b=_0x18686b-0x0;var _0x819ff=_0x3c81[_0x18686b];return _0x819ff;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13c8('0x4'));router[_0x13c8('0x5')]('/',auth[_0x13c8('0x6')](),controller[_0x13c8('0x7')]);router[_0x13c8('0x5')](_0x13c8('0x8'),auth[_0x13c8('0x6')](),controller['show']);router[_0x13c8('0x9')]('/',auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router[_0x13c8('0xb')](_0x13c8('0x8'),auth[_0x13c8('0x6')](),controller[_0x13c8('0xc')]);router[_0x13c8('0xd')](_0x13c8('0x8'),auth[_0x13c8('0x6')](),controller[_0x13c8('0xe')]);module[_0x13c8('0xf')]=router; \ No newline at end of file +var _0xb7e7=['put','update','destroy','exports','multer','path','express','../../components/auth/service','../../config/environment','./variable.controller','get','/:id','isAuthenticated','post','create'];(function(_0x111686,_0x5523a4){var _0x2cd2b9=function(_0x49511d){while(--_0x49511d){_0x111686['push'](_0x111686['shift']());}};_0x2cd2b9(++_0x5523a4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xb7e7[_0x4e6ae6];return _0x23c108;};'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('0x9')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['delete'](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);module[_0x7b7e('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 6c63e8c..b0a9337 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 _0x0b06=['exports','STRING','name','sequelize'];(function(_0x2cbfcc,_0x41c929){var _0x46dd12=function(_0x519978){while(--_0x519978){_0x2cbfcc['push'](_0x2cbfcc['shift']());}};_0x46dd12(++_0x41c929);}(_0x0b06,0x11f));var _0x60b0=function(_0x5a262d,_0x5f0a1f){_0x5a262d=_0x5a262d-0x0;var _0x15b9b8=_0x0b06[_0x5a262d];return _0x15b9b8;};'use strict';var Sequelize=require(_0x60b0('0x0'));module[_0x60b0('0x1')]={'name':{'type':Sequelize[_0x60b0('0x2')],'unique':_0x60b0('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x60b0('0x2')]}}; \ No newline at end of file +var _0x1e89=['name','sequelize','exports'];(function(_0xf7abb1,_0x3d350e){var _0x17786c=function(_0x89a6a5){while(--_0x89a6a5){_0xf7abb1['push'](_0xf7abb1['shift']());}};_0x17786c(++_0x3d350e);}(_0x1e89,0x8b));var _0x91e8=function(_0x11a2df,_0x56503a){_0x11a2df=_0x11a2df-0x0;var _0x3e489e=_0x1e89[_0x11a2df];return _0x3e489e;};'use strict';var Sequelize=require(_0x91e8('0x0'));module[_0x91e8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x91e8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 9cd663b..03fd7f0 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 _0x6a47=['count','offset','set','apply','reject','update','then','destroy','get','Variables','error','send','index','Variable','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x5cadc0,_0x37194f){var _0x416a53=function(_0x3a91c9){while(--_0x3a91c9){_0x5cadc0['push'](_0x5cadc0['shift']());}};_0x416a53(++_0x37194f);}(_0x6a47,0x16d));var _0x76a4=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6a47[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0x76a4('0x0'));var emlformat=require(_0x76a4('0x1'));var rimraf=require(_0x76a4('0x2'));var zipdir=require(_0x76a4('0x3'));var jsonpatch=require(_0x76a4('0x4'));var rp=require(_0x76a4('0x5'));var moment=require(_0x76a4('0x6'));var BPromise=require(_0x76a4('0x7'));var Mustache=require('mustache');var util=require(_0x76a4('0x8'));var path=require('path');var sox=require(_0x76a4('0x9'));var csv=require(_0x76a4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x76a4('0xb'));var squel=require(_0x76a4('0xc'));var crypto=require(_0x76a4('0xd'));var jsforce=require(_0x76a4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x76a4('0xa'));var querystring=require(_0x76a4('0xf'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x76a4('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x76a4('0x11'))('api');var utils=require(_0x76a4('0x12'));var config=require(_0x76a4('0x13'));var db=require(_0x76a4('0x14'))['db'];function respondWithStatusCode(_0xafb2f3,_0x568a2d){_0x568a2d=_0x568a2d||0xcc;return function(_0x1d4183){if(_0x1d4183){return _0xafb2f3[_0x76a4('0x15')](_0x568a2d);}return _0xafb2f3[_0x76a4('0x16')](_0x568a2d)[_0x76a4('0x17')]();};}function respondWithResult(_0x35dd1e,_0x2cca40){_0x2cca40=_0x2cca40||0xc8;return function(_0x6403bd){if(_0x6403bd){return _0x35dd1e[_0x76a4('0x16')](_0x2cca40)[_0x76a4('0x18')](_0x6403bd);}};}function respondWithFilteredResult(_0x599d19,_0x1acb72){return function(_0x4125ce){if(_0x4125ce){var _0x4111a5=_0x4125ce[_0x76a4('0x19')],_0xe41842=_0x1acb72[_0x76a4('0x1a')],_0x2892f5=_0x1acb72[_0x76a4('0x1a')]+_0x1acb72['limit'],_0x25f8c1;if(_0x2892f5>=_0x4111a5){_0x2892f5=_0x4111a5;_0x25f8c1=0xc8;}else{_0x25f8c1=0xce;}_0x599d19[_0x76a4('0x16')](_0x25f8c1);return _0x599d19[_0x76a4('0x1b')]('Content-Range',_0xe41842+'-'+_0x2892f5+'/'+_0x4111a5)['json'](_0x4125ce);}return null;};}function patchUpdates(_0x476020){return function(_0x5a8067){try{jsonpatch[_0x76a4('0x1c')](_0x5a8067,_0x476020,!![]);}catch(_0x55ac7d){return BPromise[_0x76a4('0x1d')](_0x55ac7d);}return _0x5a8067['save']();};}function saveUpdates(_0x66ef61,_0x28b8fd){return function(_0x570feb){if(_0x570feb){return _0x570feb[_0x76a4('0x1e')](_0x66ef61)[_0x76a4('0x1f')](function(_0x492707){return _0x492707;});}return null;};}function removeEntity(_0x1249ff,_0x10bf11){return function(_0x1198f1){if(_0x1198f1){return _0x1198f1[_0x76a4('0x20')]()[_0x76a4('0x1f')](function(){var _0x29c6c2=_0x1198f1[_0x76a4('0x21')]({'plain':!![]});var _0x21fa46=_0x76a4('0x22');return db['UserProfileResource'][_0x76a4('0x20')]({'where':{'type':_0x21fa46,'resourceId':_0x29c6c2['id']}})[_0x76a4('0x1f')](function(){return _0x1198f1;});})[_0x76a4('0x1f')](function(){_0x1249ff[_0x76a4('0x16')](0xcc)[_0x76a4('0x17')]();});}};}function handleEntityNotFound(_0x55c1ed,_0x367131){return function(_0x88af9a){if(!_0x88af9a){_0x55c1ed[_0x76a4('0x15')](0x194);}return _0x88af9a;};}function handleError(_0x41cca0,_0x1d1735){_0x1d1735=_0x1d1735||0x1f4;return function(_0xa4a017){logger[_0x76a4('0x23')](_0xa4a017['stack']);if(_0xa4a017['name']){delete _0xa4a017['name'];}_0x41cca0['status'](_0x1d1735)[_0x76a4('0x24')](_0xa4a017);};}exports[_0x76a4('0x25')]=function(_0x500d99,_0x130093){var _0x256bef={},_0x4c4a70={},_0x5cdf40={'count':0x0,'rows':[]};var _0x57a26d=db[_0x76a4('0x26')][_0x76a4('0x27')];_0x4c4a70[_0x76a4('0x28')]=_['keys'](_0x57a26d);_0x4c4a70[_0x76a4('0x29')]=_['keys'](_0x500d99['query']);_0x4c4a70['filters']=_[_0x76a4('0x2a')](_0x4c4a70[_0x76a4('0x28')],_0x4c4a70[_0x76a4('0x29')]);_0x256bef['attributes']=_['intersection'](_0x4c4a70['model'],qs[_0x76a4('0x2b')](_0x500d99['query'][_0x76a4('0x2b')]));_0x256bef[_0x76a4('0x2c')]=_0x256bef[_0x76a4('0x2c')][_0x76a4('0x2d')]?_0x256bef['attributes']:_0x4c4a70[_0x76a4('0x28')];if(!_0x500d99[_0x76a4('0x29')][_0x76a4('0x2e')](_0x76a4('0x2f'))){_0x256bef[_0x76a4('0x30')]=qs[_0x76a4('0x30')](_0x500d99['query'][_0x76a4('0x30')]);_0x256bef[_0x76a4('0x1a')]=qs[_0x76a4('0x1a')](_0x500d99[_0x76a4('0x29')][_0x76a4('0x1a')]);}_0x256bef[_0x76a4('0x31')]=qs[_0x76a4('0x32')](_0x500d99[_0x76a4('0x29')][_0x76a4('0x32')]);_0x256bef['where']=qs[_0x76a4('0x33')](_['pick'](_0x500d99[_0x76a4('0x29')],_0x4c4a70['filters']));if(_0x500d99[_0x76a4('0x29')][_0x76a4('0x34')]){_0x256bef[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x256bef[_0x76a4('0x35')],{'$or':_[_0x76a4('0x37')](_0x57a26d,function(_0x1498b2){if(_0x1498b2[_0x76a4('0x38')][_0x76a4('0x39')]!==_0x76a4('0x3a')){var _0x4caeb0={};_0x4caeb0[_0x1498b2[_0x76a4('0x3b')]]={'$like':'%'+_0x500d99[_0x76a4('0x29')][_0x76a4('0x34')]+'%'};return _0x4caeb0;}})});}_0x256bef=_[_0x76a4('0x36')]({},_0x256bef,_0x500d99['options']);var _0x424bff={'where':_0x256bef[_0x76a4('0x35')]};return db[_0x76a4('0x26')][_0x76a4('0x19')](_0x424bff)['then'](function(_0x301662){_0x5cdf40[_0x76a4('0x19')]=_0x301662;if(_0x500d99[_0x76a4('0x29')][_0x76a4('0x3c')]){_0x256bef[_0x76a4('0x3d')]=[{'all':!![]}];}return db[_0x76a4('0x26')][_0x76a4('0x3e')](_0x256bef);})[_0x76a4('0x1f')](function(_0x1921d7){_0x5cdf40[_0x76a4('0x3f')]=_0x1921d7;return _0x5cdf40;})['then'](respondWithFilteredResult(_0x130093,_0x256bef))[_0x76a4('0x40')](handleError(_0x130093,null));};exports[_0x76a4('0x41')]=function(_0x2d0aff,_0x15f8e7){var _0x5c532b={'raw':!![],'where':{'id':_0x2d0aff['params']['id']}},_0x4f5f47={};_0x4f5f47[_0x76a4('0x28')]=_['keys'](db[_0x76a4('0x26')][_0x76a4('0x27')]);_0x4f5f47['query']=_[_0x76a4('0x42')](_0x2d0aff[_0x76a4('0x29')]);_0x4f5f47[_0x76a4('0x33')]=_[_0x76a4('0x2a')](_0x4f5f47[_0x76a4('0x28')],_0x4f5f47[_0x76a4('0x29')]);_0x5c532b[_0x76a4('0x2c')]=_['intersection'](_0x4f5f47[_0x76a4('0x28')],qs[_0x76a4('0x2b')](_0x2d0aff[_0x76a4('0x29')][_0x76a4('0x2b')]));_0x5c532b[_0x76a4('0x2c')]=_0x5c532b['attributes'][_0x76a4('0x2d')]?_0x5c532b[_0x76a4('0x2c')]:_0x4f5f47[_0x76a4('0x28')];if(_0x2d0aff[_0x76a4('0x29')][_0x76a4('0x3c')]){_0x5c532b['include']=[{'all':!![]}];}_0x5c532b=_[_0x76a4('0x36')]({},_0x5c532b,_0x2d0aff[_0x76a4('0x43')]);return db[_0x76a4('0x26')][_0x76a4('0x44')](_0x5c532b)[_0x76a4('0x1f')](handleEntityNotFound(_0x15f8e7,null))['then'](respondWithResult(_0x15f8e7,null))[_0x76a4('0x40')](handleError(_0x15f8e7,null));};exports[_0x76a4('0x45')]=function(_0x3a4ccd,_0x3b3f9b){return db['Variable'][_0x76a4('0x45')](_0x3a4ccd[_0x76a4('0x46')],{})[_0x76a4('0x1f')](function(_0x2cd84b){var _0xe781fa=_0x3a4ccd[_0x76a4('0x47')][_0x76a4('0x21')]({'plain':!![]});if(!_0xe781fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe781fa[_0x76a4('0x48')]===_0x76a4('0x47')){var _0x1f250c=_0x2cd84b[_0x76a4('0x21')]({'plain':!![]});var _0x521084='Variables';return db[_0x76a4('0x49')][_0x76a4('0x44')]({'where':{'name':_0x521084,'userProfileId':_0xe781fa[_0x76a4('0x4a')]},'raw':!![]})[_0x76a4('0x1f')](function(_0x4176ca){if(_0x4176ca&&_0x4176ca[_0x76a4('0x4b')]===0x0){return db[_0x76a4('0x4c')][_0x76a4('0x45')]({'name':_0x1f250c['name'],'resourceId':_0x1f250c['id'],'type':_0x4176ca['name'],'sectionId':_0x4176ca['id']},{})[_0x76a4('0x1f')](function(){return _0x2cd84b;});}else{return _0x2cd84b;}})['catch'](function(_0x4281a6){logger[_0x76a4('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4281a6);throw _0x4281a6;});}return _0x2cd84b;})[_0x76a4('0x1f')](respondWithResult(_0x3b3f9b,0xc9))[_0x76a4('0x40')](handleError(_0x3b3f9b,null));};exports[_0x76a4('0x1e')]=function(_0x176fed,_0x3da7c5){if(_0x176fed[_0x76a4('0x46')]['id']){delete _0x176fed[_0x76a4('0x46')]['id'];}return db[_0x76a4('0x26')][_0x76a4('0x44')]({'where':{'id':_0x176fed[_0x76a4('0x4d')]['id']}})[_0x76a4('0x1f')](handleEntityNotFound(_0x3da7c5,null))[_0x76a4('0x1f')](saveUpdates(_0x176fed['body'],null))[_0x76a4('0x1f')](respondWithResult(_0x3da7c5,null))['catch'](handleError(_0x3da7c5,null));};exports['destroy']=function(_0x2d7e39,_0xfc5ab5){return db[_0x76a4('0x26')][_0x76a4('0x44')]({'where':{'id':_0x2d7e39[_0x76a4('0x4d')]['id']}})[_0x76a4('0x1f')](handleEntityNotFound(_0xfc5ab5,null))[_0x76a4('0x1f')](removeEntity(_0xfc5ab5,null))[_0x76a4('0x40')](handleError(_0xfc5ab5,null));}; \ No newline at end of file +var _0x0927=['reject','save','update','destroy','Variables','UserProfileResource','then','end','error','stack','name','send','Variable','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','type','key','field','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','sendStatus','json','count','offset','status','set','apply'];(function(_0x35edae,_0xa3400e){var _0x6bf0b5=function(_0x5a66c3){while(--_0x5a66c3){_0x35edae['push'](_0x35edae['shift']());}};_0x6bf0b5(++_0xa3400e);}(_0x0927,0x1cb));var _0x7092=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0927[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x7092('0x0'));var emlformat=require(_0x7092('0x1'));var rimraf=require(_0x7092('0x2'));var zipdir=require(_0x7092('0x3'));var jsonpatch=require(_0x7092('0x4'));var rp=require(_0x7092('0x5'));var moment=require(_0x7092('0x6'));var BPromise=require(_0x7092('0x7'));var Mustache=require(_0x7092('0x8'));var util=require(_0x7092('0x9'));var path=require(_0x7092('0xa'));var sox=require(_0x7092('0xb'));var csv=require(_0x7092('0xc'));var ejs=require(_0x7092('0xd'));var fs=require('fs');var _=require(_0x7092('0xe'));var squel=require(_0x7092('0xf'));var crypto=require(_0x7092('0x10'));var jsforce=require(_0x7092('0x11'));var deskjs=require(_0x7092('0x12'));var toCsv=require(_0x7092('0xc'));var querystring=require(_0x7092('0x13'));var Papa=require('papaparse');var authService=require(_0x7092('0x14'));var hardwareService=require(_0x7092('0x15'));var Redis=require(_0x7092('0x16'));var qs=require('../../components/parsers/qs');var logger=require(_0x7092('0x17'))('api');var utils=require(_0x7092('0x18'));var config=require(_0x7092('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22cb05,_0xf5091b){_0xf5091b=_0xf5091b||0xcc;return function(_0x28238d){if(_0x28238d){return _0x22cb05[_0x7092('0x1a')](_0xf5091b);}return _0x22cb05['status'](_0xf5091b)['end']();};}function respondWithResult(_0x454df6,_0x50393f){_0x50393f=_0x50393f||0xc8;return function(_0x2d4a8e){if(_0x2d4a8e){return _0x454df6['status'](_0x50393f)[_0x7092('0x1b')](_0x2d4a8e);}};}function respondWithFilteredResult(_0xa0e622,_0x2011ba){return function(_0x21f2ae){if(_0x21f2ae){var _0x256a22=_0x21f2ae[_0x7092('0x1c')],_0x46b96c=_0x2011ba['offset'],_0x47e849=_0x2011ba[_0x7092('0x1d')]+_0x2011ba['limit'],_0x120d94;if(_0x47e849>=_0x256a22){_0x47e849=_0x256a22;_0x120d94=0xc8;}else{_0x120d94=0xce;}_0xa0e622[_0x7092('0x1e')](_0x120d94);return _0xa0e622[_0x7092('0x1f')]('Content-Range',_0x46b96c+'-'+_0x47e849+'/'+_0x256a22)[_0x7092('0x1b')](_0x21f2ae);}return null;};}function patchUpdates(_0x587e3b){return function(_0x447487){try{jsonpatch[_0x7092('0x20')](_0x447487,_0x587e3b,!![]);}catch(_0x5cc1fe){return BPromise[_0x7092('0x21')](_0x5cc1fe);}return _0x447487[_0x7092('0x22')]();};}function saveUpdates(_0x2bedf4,_0x1c862a){return function(_0x542bf6){if(_0x542bf6){return _0x542bf6[_0x7092('0x23')](_0x2bedf4)['then'](function(_0x4214d5){return _0x4214d5;});}return null;};}function removeEntity(_0x5b5952,_0x23b02c){return function(_0x2a8e43){if(_0x2a8e43){return _0x2a8e43[_0x7092('0x24')]()['then'](function(){var _0x90c0fb=_0x2a8e43['get']({'plain':!![]});var _0x5a08aa=_0x7092('0x25');return db[_0x7092('0x26')]['destroy']({'where':{'type':_0x5a08aa,'resourceId':_0x90c0fb['id']}})[_0x7092('0x27')](function(){return _0x2a8e43;});})['then'](function(){_0x5b5952['status'](0xcc)[_0x7092('0x28')]();});}};}function handleEntityNotFound(_0x3fe4bf,_0x4ab883){return function(_0x36fbbe){if(!_0x36fbbe){_0x3fe4bf[_0x7092('0x1a')](0x194);}return _0x36fbbe;};}function handleError(_0x3bdbd8,_0x113c5d){_0x113c5d=_0x113c5d||0x1f4;return function(_0x5d9026){logger[_0x7092('0x29')](_0x5d9026[_0x7092('0x2a')]);if(_0x5d9026[_0x7092('0x2b')]){delete _0x5d9026['name'];}_0x3bdbd8[_0x7092('0x1e')](_0x113c5d)[_0x7092('0x2c')](_0x5d9026);};}exports['index']=function(_0x3fe34d,_0x3d0da3){var _0x43856b={},_0x2bbfb7={},_0x38a31a={'count':0x0,'rows':[]};var _0x287d6b=db[_0x7092('0x2d')][_0x7092('0x2e')];_0x2bbfb7[_0x7092('0x2f')]=_[_0x7092('0x30')](_0x287d6b);_0x2bbfb7['query']=_['keys'](_0x3fe34d[_0x7092('0x31')]);_0x2bbfb7[_0x7092('0x32')]=_[_0x7092('0x33')](_0x2bbfb7[_0x7092('0x2f')],_0x2bbfb7[_0x7092('0x31')]);_0x43856b[_0x7092('0x34')]=_[_0x7092('0x33')](_0x2bbfb7[_0x7092('0x2f')],qs[_0x7092('0x35')](_0x3fe34d[_0x7092('0x31')][_0x7092('0x35')]));_0x43856b[_0x7092('0x34')]=_0x43856b[_0x7092('0x34')][_0x7092('0x36')]?_0x43856b['attributes']:_0x2bbfb7[_0x7092('0x2f')];if(!_0x3fe34d[_0x7092('0x31')][_0x7092('0x37')](_0x7092('0x38'))){_0x43856b[_0x7092('0x39')]=qs[_0x7092('0x39')](_0x3fe34d[_0x7092('0x31')]['limit']);_0x43856b[_0x7092('0x1d')]=qs[_0x7092('0x1d')](_0x3fe34d[_0x7092('0x31')][_0x7092('0x1d')]);}_0x43856b['order']=qs[_0x7092('0x3a')](_0x3fe34d[_0x7092('0x31')][_0x7092('0x3a')]);_0x43856b['where']=qs['filters'](_[_0x7092('0x3b')](_0x3fe34d[_0x7092('0x31')],_0x2bbfb7[_0x7092('0x32')]));if(_0x3fe34d[_0x7092('0x31')]['filter']){_0x43856b[_0x7092('0x3c')]=_[_0x7092('0x3d')](_0x43856b[_0x7092('0x3c')],{'$or':_['map'](_0x287d6b,function(_0x371b92){if(_0x371b92[_0x7092('0x3e')][_0x7092('0x3f')]!=='VIRTUAL'){var _0xd8922e={};_0xd8922e[_0x371b92[_0x7092('0x40')]]={'$like':'%'+_0x3fe34d[_0x7092('0x31')][_0x7092('0x41')]+'%'};return _0xd8922e;}})});}_0x43856b=_[_0x7092('0x3d')]({},_0x43856b,_0x3fe34d[_0x7092('0x42')]);var _0x4cbc94={'where':_0x43856b['where']};return db[_0x7092('0x2d')][_0x7092('0x1c')](_0x4cbc94)['then'](function(_0x4cf982){_0x38a31a['count']=_0x4cf982;if(_0x3fe34d['query'][_0x7092('0x43')]){_0x43856b[_0x7092('0x44')]=[{'all':!![]}];}return db[_0x7092('0x2d')][_0x7092('0x45')](_0x43856b);})[_0x7092('0x27')](function(_0x510a11){_0x38a31a['rows']=_0x510a11;return _0x38a31a;})[_0x7092('0x27')](respondWithFilteredResult(_0x3d0da3,_0x43856b))[_0x7092('0x46')](handleError(_0x3d0da3,null));};exports[_0x7092('0x47')]=function(_0xa80ffa,_0x10bd15){var _0x195a2a={'raw':!![],'where':{'id':_0xa80ffa[_0x7092('0x48')]['id']}},_0x25184f={};_0x25184f[_0x7092('0x2f')]=_[_0x7092('0x30')](db[_0x7092('0x2d')]['rawAttributes']);_0x25184f[_0x7092('0x31')]=_['keys'](_0xa80ffa[_0x7092('0x31')]);_0x25184f['filters']=_[_0x7092('0x33')](_0x25184f[_0x7092('0x2f')],_0x25184f[_0x7092('0x31')]);_0x195a2a[_0x7092('0x34')]=_[_0x7092('0x33')](_0x25184f[_0x7092('0x2f')],qs[_0x7092('0x35')](_0xa80ffa[_0x7092('0x31')][_0x7092('0x35')]));_0x195a2a[_0x7092('0x34')]=_0x195a2a['attributes'][_0x7092('0x36')]?_0x195a2a[_0x7092('0x34')]:_0x25184f[_0x7092('0x2f')];if(_0xa80ffa['query'][_0x7092('0x43')]){_0x195a2a['include']=[{'all':!![]}];}_0x195a2a=_[_0x7092('0x3d')]({},_0x195a2a,_0xa80ffa[_0x7092('0x42')]);return db['Variable'][_0x7092('0x49')](_0x195a2a)[_0x7092('0x27')](handleEntityNotFound(_0x10bd15,null))[_0x7092('0x27')](respondWithResult(_0x10bd15,null))['catch'](handleError(_0x10bd15,null));};exports[_0x7092('0x4a')]=function(_0x53eb26,_0x2910ee){return db[_0x7092('0x2d')][_0x7092('0x4a')](_0x53eb26[_0x7092('0x4b')],{})[_0x7092('0x27')](function(_0x4f1115){var _0x13c0a5=_0x53eb26[_0x7092('0x4c')][_0x7092('0x4d')]({'plain':!![]});if(!_0x13c0a5)throw new Error(_0x7092('0x4e'));if(_0x13c0a5[_0x7092('0x4f')]===_0x7092('0x4c')){var _0x2161ef=_0x4f1115[_0x7092('0x4d')]({'plain':!![]});var _0x1a37d5=_0x7092('0x25');return db['UserProfileSection'][_0x7092('0x49')]({'where':{'name':_0x1a37d5,'userProfileId':_0x13c0a5['userProfileId']},'raw':!![]})[_0x7092('0x27')](function(_0x15b7a9){if(_0x15b7a9&&_0x15b7a9[_0x7092('0x50')]===0x0){return db[_0x7092('0x26')][_0x7092('0x4a')]({'name':_0x2161ef[_0x7092('0x2b')],'resourceId':_0x2161ef['id'],'type':_0x15b7a9[_0x7092('0x2b')],'sectionId':_0x15b7a9['id']},{})['then'](function(){return _0x4f1115;});}else{return _0x4f1115;}})['catch'](function(_0x1c10af){logger[_0x7092('0x29')](_0x7092('0x51'),_0x1c10af);throw _0x1c10af;});}return _0x4f1115;})[_0x7092('0x27')](respondWithResult(_0x2910ee,0xc9))[_0x7092('0x46')](handleError(_0x2910ee,null));};exports[_0x7092('0x23')]=function(_0x38ff93,_0x3404ee){if(_0x38ff93[_0x7092('0x4b')]['id']){delete _0x38ff93[_0x7092('0x4b')]['id'];}return db[_0x7092('0x2d')][_0x7092('0x49')]({'where':{'id':_0x38ff93[_0x7092('0x48')]['id']}})[_0x7092('0x27')](handleEntityNotFound(_0x3404ee,null))[_0x7092('0x27')](saveUpdates(_0x38ff93[_0x7092('0x4b')],null))[_0x7092('0x27')](respondWithResult(_0x3404ee,null))[_0x7092('0x46')](handleError(_0x3404ee,null));};exports['destroy']=function(_0x358e9c,_0x3ddbe3){return db[_0x7092('0x2d')][_0x7092('0x49')]({'where':{'id':_0x358e9c[_0x7092('0x48')]['id']}})[_0x7092('0x27')](handleEntityNotFound(_0x3ddbe3,null))['then'](removeEntity(_0x3ddbe3,null))['catch'](handleError(_0x3ddbe3,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 52a7c43..0cfd2bc 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 _0x0295=['lodash','api','request-promise','./variable.attributes','exports','define','Variable','tools_variables'];(function(_0xd8d138,_0x2c83ec){var _0x1a618b=function(_0x4b7004){while(--_0x4b7004){_0xd8d138['push'](_0xd8d138['shift']());}};_0x1a618b(++_0x2c83ec);}(_0x0295,0x1f0));var _0x5029=function(_0x4f492c,_0x2f5d87){_0x4f492c=_0x4f492c-0x0;var _0x347ea5=_0x0295[_0x4f492c];return _0x347ea5;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var attributes=require(_0x5029('0x3'));module[_0x5029('0x4')]=function(_0x3d0af1,_0x170504){return _0x3d0af1[_0x5029('0x5')](_0x5029('0x6'),attributes,{'tableName':_0x5029('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0295=['lodash','api','request-promise','./variable.attributes','exports','define','Variable','tools_variables'];(function(_0x347287,_0x33b01c){var _0x59c36d=function(_0x1eb55c){while(--_0x1eb55c){_0x347287['push'](_0x347287['shift']());}};_0x59c36d(++_0x33b01c);}(_0x0295,0x1f0));var _0x5029=function(_0x166f43,_0x3bc8cb){_0x166f43=_0x166f43-0x0;var _0x43ae50=_0x0295[_0x166f43];return _0x43ae50;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var attributes=require(_0x5029('0x3'));module[_0x5029('0x4')]=function(_0x3d0af1,_0x170504){return _0x3d0af1[_0x5029('0x5')](_0x5029('0x6'),attributes,{'tableName':_0x5029('0x7'),'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 a7e3406..8cf4a6f 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 _0xd8cb=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','Variable,\x20%s,\x20%s','message','result','catch','ShowVariable','Variable','find','options','raw','where','map','model','attributes','include','lodash','bluebird','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd8cb,0x129));var _0xbd8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbd8c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbd8c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd8c('0x2'));var db=require(_0xbd8c('0x3'))['db'];var utils=require(_0xbd8c('0x4'));var logger=require(_0xbd8c('0x5'))(_0xbd8c('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd8c('0x7'));var client=jayson[_0xbd8c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52df63,_0x3c2f1d,_0xeceb47){return new BPromise(function(_0x32b8d9,_0x570562){return client[_0xbd8c('0x9')](_0x52df63,_0xeceb47)[_0xbd8c('0xa')](function(_0xe135e0){logger[_0xbd8c('0xb')]('Variable,\x20%s,\x20%s',_0x3c2f1d,_0xbd8c('0xc'));logger[_0xbd8c('0xd')]('Variable,\x20%s,\x20%s,\x20%s',_0x3c2f1d,_0xbd8c('0xc'),JSON[_0xbd8c('0xe')](_0xe135e0));if(_0xe135e0[_0xbd8c('0xf')]){if(_0xe135e0['error']['code']===0x1f4){logger[_0xbd8c('0xf')](_0xbd8c('0x10'),_0x3c2f1d,_0xe135e0[_0xbd8c('0xf')][_0xbd8c('0x11')]);return _0x570562(_0xe135e0[_0xbd8c('0xf')][_0xbd8c('0x11')]);}logger[_0xbd8c('0xf')](_0xbd8c('0x10'),_0x3c2f1d,_0xe135e0[_0xbd8c('0xf')]['message']);return _0x32b8d9(_0xe135e0[_0xbd8c('0xf')][_0xbd8c('0x11')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x3c2f1d,_0xbd8c('0xc'));_0x32b8d9(_0xe135e0[_0xbd8c('0x12')]['message']);}})[_0xbd8c('0x13')](function(_0x2bc549){logger['error']('Variable,\x20%s,\x20%s',_0x3c2f1d,_0x2bc549);_0x570562(_0x2bc549);});});}exports[_0xbd8c('0x14')]=function(_0x128f1f){var _0x16d260=this;return new Promise(function(_0x21e295,_0xcebbc2){return db[_0xbd8c('0x15')][_0xbd8c('0x16')]({'raw':_0x128f1f[_0xbd8c('0x17')]?_0x128f1f[_0xbd8c('0x17')][_0xbd8c('0x18')]===undefined?!![]:![]:!![],'where':_0x128f1f[_0xbd8c('0x17')]?_0x128f1f[_0xbd8c('0x17')][_0xbd8c('0x19')]||null:null,'attributes':_0x128f1f[_0xbd8c('0x17')]?_0x128f1f['options']['attributes']||null:null,'include':_0x128f1f['options']?_0x128f1f['options']['include']?_[_0xbd8c('0x1a')](_0x128f1f[_0xbd8c('0x17')]['include'],function(_0x2e30e7){return{'model':db[_0x2e30e7[_0xbd8c('0x1b')]],'as':_0x2e30e7['as'],'attributes':_0x2e30e7[_0xbd8c('0x1c')],'include':_0x2e30e7[_0xbd8c('0x1d')]?_[_0xbd8c('0x1a')](_0x2e30e7[_0xbd8c('0x1d')],function(_0x260ae1){return{'model':db[_0x260ae1[_0xbd8c('0x1b')]],'as':_0x260ae1['as'],'attributes':_0x260ae1[_0xbd8c('0x1c')],'include':_0x260ae1[_0xbd8c('0x1d')]?_[_0xbd8c('0x1a')](_0x260ae1[_0xbd8c('0x1d')],function(_0x368520){return{'model':db[_0x368520['model']],'as':_0x368520['as'],'attributes':_0x368520[_0xbd8c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34666f){logger[_0xbd8c('0xb')](_0xbd8c('0x14'),_0x128f1f);logger[_0xbd8c('0xd')](_0xbd8c('0x14'),_0x128f1f,JSON['stringify'](_0x34666f));_0x21e295(_0x34666f);})[_0xbd8c('0x13')](function(_0x1de9e0){logger[_0xbd8c('0xf')]('ShowVariable',_0x1de9e0['message'],_0x128f1f);_0xcebbc2(_0x16d260[_0xbd8c('0xf')](0x1f4,_0x1de9e0['message']));});});}; \ No newline at end of file +var _0xb9d1=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Variable','find','options','raw','where','attributes','include','model','map','ShowVariable','debug','catch','lodash','util','bluebird'];(function(_0x2f023d,_0x29dfe5){var _0x4ef240=function(_0x49f1ec){while(--_0x49f1ec){_0x2f023d['push'](_0x2f023d['shift']());}};_0x4ef240(++_0x29dfe5);}(_0xb9d1,0xfd));var _0x1b9d=function(_0x72a642,_0x270997){_0x72a642=_0x72a642-0x0;var _0x33573=_0xb9d1[_0x72a642];return _0x33573;};'use strict';var _=require(_0x1b9d('0x0'));var util=require(_0x1b9d('0x1'));var moment=require('moment');var BPromise=require(_0x1b9d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b9d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b9d('0x4'));var config=require(_0x1b9d('0x5'));var jayson=require(_0x1b9d('0x6'));var client=jayson[_0x1b9d('0x7')][_0x1b9d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57b9ab,_0x1c30b4,_0xf7631f){return new BPromise(function(_0x49158d,_0x4364aa){return client[_0x1b9d('0x9')](_0x57b9ab,_0xf7631f)[_0x1b9d('0xa')](function(_0x7f06b0){logger[_0x1b9d('0xb')](_0x1b9d('0xc'),_0x1c30b4,_0x1b9d('0xd'));logger['debug'](_0x1b9d('0xe'),_0x1c30b4,'request\x20sent',JSON[_0x1b9d('0xf')](_0x7f06b0));if(_0x7f06b0['error']){if(_0x7f06b0[_0x1b9d('0x10')][_0x1b9d('0x11')]===0x1f4){logger[_0x1b9d('0x10')](_0x1b9d('0xc'),_0x1c30b4,_0x7f06b0['error'][_0x1b9d('0x12')]);return _0x4364aa(_0x7f06b0[_0x1b9d('0x10')][_0x1b9d('0x12')]);}logger['error'](_0x1b9d('0xc'),_0x1c30b4,_0x7f06b0[_0x1b9d('0x10')][_0x1b9d('0x12')]);return _0x49158d(_0x7f06b0[_0x1b9d('0x10')][_0x1b9d('0x12')]);}else{logger[_0x1b9d('0xb')](_0x1b9d('0xc'),_0x1c30b4,_0x1b9d('0xd'));_0x49158d(_0x7f06b0[_0x1b9d('0x13')]['message']);}})['catch'](function(_0x3c55bd){logger[_0x1b9d('0x10')]('Variable,\x20%s,\x20%s',_0x1c30b4,_0x3c55bd);_0x4364aa(_0x3c55bd);});});}exports['ShowVariable']=function(_0x300eb9){var _0x4f16f1=this;return new Promise(function(_0x3ddf97,_0x4b1b6a){return db[_0x1b9d('0x14')][_0x1b9d('0x15')]({'raw':_0x300eb9[_0x1b9d('0x16')]?_0x300eb9[_0x1b9d('0x16')][_0x1b9d('0x17')]===undefined?!![]:![]:!![],'where':_0x300eb9['options']?_0x300eb9[_0x1b9d('0x16')][_0x1b9d('0x18')]||null:null,'attributes':_0x300eb9['options']?_0x300eb9['options'][_0x1b9d('0x19')]||null:null,'include':_0x300eb9[_0x1b9d('0x16')]?_0x300eb9['options'][_0x1b9d('0x1a')]?_['map'](_0x300eb9[_0x1b9d('0x16')][_0x1b9d('0x1a')],function(_0x2ec716){return{'model':db[_0x2ec716[_0x1b9d('0x1b')]],'as':_0x2ec716['as'],'attributes':_0x2ec716[_0x1b9d('0x19')],'include':_0x2ec716['include']?_[_0x1b9d('0x1c')](_0x2ec716['include'],function(_0x53734d){return{'model':db[_0x53734d[_0x1b9d('0x1b')]],'as':_0x53734d['as'],'attributes':_0x53734d[_0x1b9d('0x19')],'include':_0x53734d['include']?_[_0x1b9d('0x1c')](_0x53734d[_0x1b9d('0x1a')],function(_0x428ceb){return{'model':db[_0x428ceb['model']],'as':_0x428ceb['as'],'attributes':_0x428ceb['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b9d('0xa')](function(_0x2b7734){logger[_0x1b9d('0xb')](_0x1b9d('0x1d'),_0x300eb9);logger[_0x1b9d('0x1e')](_0x1b9d('0x1d'),_0x300eb9,JSON['stringify'](_0x2b7734));_0x3ddf97(_0x2b7734);})[_0x1b9d('0x1f')](function(_0x530ffc){logger['error'](_0x1b9d('0x1d'),_0x530ffc[_0x1b9d('0x12')],_0x300eb9);_0x4b1b6a(_0x4f16f1[_0x1b9d('0x10')](0x1f4,_0x530ffc[_0x1b9d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index c8fa135..5680cbe 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 _0x52b7=['restart','exports','Router','../../components/auth/service','get','index','isAuthenticated','fetch','/reset','reset','canUpdate','pull','/restart'];(function(_0x41e2d9,_0x1f0df0){var _0x4f9cfe=function(_0x51da59){while(--_0x51da59){_0x41e2d9['push'](_0x41e2d9['shift']());}};_0x4f9cfe(++_0x1f0df0);}(_0x52b7,0x154));var _0x752b=function(_0x518eaa,_0x466eda){_0x518eaa=_0x518eaa-0x0;var _0x175feb=_0x52b7[_0x518eaa];return _0x175feb;};'use strict';var express=require('express');var router=express[_0x752b('0x0')]();var auth=require(_0x752b('0x1'));var controller=require('./version.controller');router[_0x752b('0x2')]('/',controller[_0x752b('0x3')]);router[_0x752b('0x2')]('/fetch',auth[_0x752b('0x4')](),auth['canUpdate'](),controller[_0x752b('0x5')]);router[_0x752b('0x2')](_0x752b('0x6'),auth[_0x752b('0x4')](),auth['canUpdate'](),controller[_0x752b('0x7')]);router[_0x752b('0x2')]('/pull',auth['isAuthenticated'](),auth[_0x752b('0x8')](),controller[_0x752b('0x9')]);router['get'](_0x752b('0xa'),auth['isAuthenticated'](),controller[_0x752b('0xb')]);router[_0x752b('0x2')]('/migrations',controller['migrations']);module[_0x752b('0xc')]=router; \ No newline at end of file +var _0x3c4a=['index','/fetch','canUpdate','/reset','isAuthenticated','reset','/pull','/restart','restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get'];(function(_0x37bbd9,_0x2c2680){var _0x36150b=function(_0x214f18){while(--_0x214f18){_0x37bbd9['push'](_0x37bbd9['shift']());}};_0x36150b(++_0x2c2680);}(_0x3c4a,0xac));var _0xa3c4=function(_0x14a2de,_0xb6f4fa){_0x14a2de=_0x14a2de-0x0;var _0x5f2d6c=_0x3c4a[_0x14a2de];return _0x5f2d6c;};'use strict';var express=require(_0xa3c4('0x0'));var router=express['Router']();var auth=require(_0xa3c4('0x1'));var controller=require(_0xa3c4('0x2'));router[_0xa3c4('0x3')]('/',controller[_0xa3c4('0x4')]);router[_0xa3c4('0x3')](_0xa3c4('0x5'),auth['isAuthenticated'](),auth[_0xa3c4('0x6')](),controller['fetch']);router[_0xa3c4('0x3')](_0xa3c4('0x7'),auth[_0xa3c4('0x8')](),auth[_0xa3c4('0x6')](),controller[_0xa3c4('0x9')]);router['get'](_0xa3c4('0xa'),auth[_0xa3c4('0x8')](),auth['canUpdate'](),controller['pull']);router['get'](_0xa3c4('0xb'),auth[_0xa3c4('0x8')](),controller[_0xa3c4('0xc')]);router[_0xa3c4('0x3')](_0xa3c4('0xd'),controller[_0xa3c4('0xe')]);module[_0xa3c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index be7039d..0f525b4 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 _0xa9e0=['master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','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','server','exports','.js','catch','umzug','path','pkginfo','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','version','latest','fetch','tags','status','json','origin'];(function(_0x2d3aab,_0x41f603){var _0x596079=function(_0x21c47a){while(--_0x21c47a){_0x2d3aab['push'](_0x2d3aab['shift']());}};_0x596079(++_0x41f603);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Umzug=require(_0x0a9e('0x0'));var path=require(_0x0a9e('0x1'));var pkginfo=require(_0x0a9e('0x2'))(module,'version');var exec=require('child_process')[_0x0a9e('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0x0a9e('0x4'));var pm2=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var git=require(_0x0a9e('0x8'))(config['root']);exports[_0x0a9e('0x9')]=function(_0x441e3a,_0x2cc193){var _0x5f41ea={'current':module['exports'][_0x0a9e('0xa')],'phonebar':0x2};if(_0x441e3a['query']&&_0x441e3a['query'][_0x0a9e('0xb')]){return git[_0x0a9e('0xc')]()[_0x0a9e('0xd')](function(_0x3ab53f,_0xfeb75b){_0x5f41ea[_0x0a9e('0xb')]=(_0x3ab53f?module['exports']['version']:_0xfeb75b['latest'])||'2.0.0';return _0x2cc193[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')](_0x5f41ea);});}else{return _0x2cc193[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')](_0x5f41ea);}};exports[_0x0a9e('0xc')]=function(_0x69aeb7,_0x5db4b0){return git[_0x0a9e('0xc')]([_0x0a9e('0x10'),_0x0a9e('0x11')],function(_0x281129){if(_0x281129){logger[_0x0a9e('0x12')](_0x281129);return _0x5db4b0[_0x0a9e('0xe')](0x1f4)['json'](_0x281129);}logger[_0x0a9e('0x13')]('git\x20fetch');return _0x5db4b0[_0x0a9e('0xe')](0xc8)['json']({'output':_0x0a9e('0x14')});});};exports[_0x0a9e('0x15')]=function(_0x48f32d,_0x225616){return git['reset']([_0x0a9e('0x16'),_0x0a9e('0x17')],function(_0x106033){if(_0x106033){logger[_0x0a9e('0x12')](_0x106033);return _0x225616[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x106033);}logger[_0x0a9e('0x13')](_0x0a9e('0x18'));return _0x225616[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':_0x0a9e('0x19')});});};exports[_0x0a9e('0x1a')]=function(_0x4bb1e3,_0x2c3407){exec(_0x0a9e('0x1b'),function(_0x53682f,_0x20f109,_0x5a09ef){logger['info'](_0x20f109);logger[_0x0a9e('0x13')](_0x5a09ef);if(_0x53682f){logger[_0x0a9e('0x12')](_0x53682f);return _0x2c3407[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x53682f);}return _0x2c3407['status'](0xc8)[_0x0a9e('0xf')]({'output':_0x20f109});});};exports[_0x0a9e('0x1c')]=function(_0x3b45bc,_0x4d00e6){return pm2[_0x0a9e('0x1c')](_0x0a9e('0x1d'))[_0x0a9e('0x1e')](function(_0x5ea472){logger['info'](_0x0a9e('0x1f'),_0x5ea472);return _0x4d00e6[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':_0x0a9e('0x20')});})['catch'](function(_0x384319){logger['error'](_0x384319);return _0x4d00e6[_0x0a9e('0xe')](0x1f4)['json'](_0x384319);});};exports[_0x0a9e('0x21')]=function(_0x34dc65,_0x25fba9){var _0x14433c=new Umzug({'storage':_0x0a9e('0x22'),'storageOptions':{'model':db[_0x0a9e('0x23')],'modelName':_0x0a9e('0x23'),'columnName':_0x0a9e('0xa')},'migrations':{'params':[db['sequelize'][_0x0a9e('0x24')](),db[_0x0a9e('0x22')][_0x0a9e('0x25')],function(){throw new Error(_0x0a9e('0x26'));}],'path':path['join'](config[_0x0a9e('0x27')],_0x0a9e('0x28'),_0x0a9e('0x21')),'pattern':/\.js$/}});_0x14433c['up']({'from':module[_0x0a9e('0x29')][_0x0a9e('0xa')]+_0x0a9e('0x2a')})[_0x0a9e('0x1e')](function(){return _0x25fba9[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':'Database\x20Migration\x20Completed!'});})[_0x0a9e('0x2b')](function(_0x5d1e0e){return _0x25fba9[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x5d1e0e);});}; \ No newline at end of file +var _0x9957=['status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','.js','Database\x20Migration\x20Completed!','umzug','path','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x425b19,_0x2dcf14){var _0x15ecab=function(_0x317d46){while(--_0x317d46){_0x425b19['push'](_0x425b19['shift']());}};_0x15ecab(++_0x2dcf14);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Umzug=require(_0x7995('0x0'));var path=require(_0x7995('0x1'));var pkginfo=require(_0x7995('0x2'))(module,_0x7995('0x3'));var exec=require('child_process')[_0x7995('0x4')];var db=require(_0x7995('0x5'))['db'];var config=require(_0x7995('0x6'));var pm2=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var git=require(_0x7995('0x9'))(config[_0x7995('0xa')]);exports[_0x7995('0xb')]=function(_0xbda126,_0x326741){var _0x4996ca={'current':module[_0x7995('0xc')][_0x7995('0x3')],'phonebar':0x2};if(_0xbda126['query']&&_0xbda126[_0x7995('0xd')][_0x7995('0xe')]){return git[_0x7995('0xf')]()[_0x7995('0x10')](function(_0x3c1d19,_0x1e400a){_0x4996ca[_0x7995('0xe')]=(_0x3c1d19?module['exports'][_0x7995('0x3')]:_0x1e400a[_0x7995('0xe')])||'2.0.0';return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);});}else{return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);}};exports[_0x7995('0xf')]=function(_0x23999f,_0x2bbe7a){return git['fetch'](['origin',_0x7995('0x13')],function(_0x2233dd){if(_0x2233dd){logger[_0x7995('0x14')](_0x2233dd);return _0x2bbe7a[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x2233dd);}logger[_0x7995('0x15')](_0x7995('0x16'));return _0x2bbe7a[_0x7995('0x11')](0xc8)['json']({'output':_0x7995('0x17')});});};exports['reset']=function(_0x2f832e,_0x37f297){return git[_0x7995('0x18')]([_0x7995('0x19'),_0x7995('0x1a')],function(_0x37a7d4){if(_0x37a7d4){logger['error'](_0x37a7d4);return _0x37f297['status'](0x1f4)[_0x7995('0x12')](_0x37a7d4);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x37f297[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x7995('0x1b')]=function(_0x51f276,_0x4b1a8e){exec(_0x7995('0x1c'),function(_0x327b1f,_0x350fd9,_0x1a8568){logger[_0x7995('0x15')](_0x350fd9);logger[_0x7995('0x15')](_0x1a8568);if(_0x327b1f){logger['error'](_0x327b1f);return _0x4b1a8e[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x350fd9});});};exports[_0x7995('0x1d')]=function(_0x13bc35,_0x475351){return pm2[_0x7995('0x1d')]('motion2')[_0x7995('0x1e')](function(_0x34e70c){logger[_0x7995('0x15')](_0x7995('0x1f'),_0x34e70c);return _0x475351[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7995('0x20')](function(_0x5911c3){logger[_0x7995('0x14')](_0x5911c3);return _0x475351[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x5911c3);});};exports[_0x7995('0x21')]=function(_0x11c1eb,_0x4b6f99){var _0x9b2a15=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7995('0x22')],'modelName':_0x7995('0x22'),'columnName':_0x7995('0x3')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x7995('0x23')],function(){throw new Error(_0x7995('0x24'));}],'path':path[_0x7995('0x25')](config[_0x7995('0xa')],_0x7995('0x26'),_0x7995('0x21')),'pattern':/\.js$/}});_0x9b2a15['up']({'from':module['exports']['version']+_0x7995('0x27')})['then'](function(){return _0x4b6f99[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x7995('0x28')});})[_0x7995('0x20')](function(_0x1f7d27){return _0x4b6f99['status'](0x1f4)[_0x7995('0x12')](_0x1f7d27);});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 0a7e897..f0d1bb2 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 _0x0295=['exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','delete'];(function(_0xb836c0,_0x50e96c){var _0x42d89c=function(_0x3a063b){while(--_0x3a063b){_0xb836c0['push'](_0xb836c0['shift']());}};_0x42d89c(++_0x50e96c);}(_0x0295,0x1f0));var _0x5029=function(_0x1b7ad0,_0x25c5c3){_0x1b7ad0=_0x1b7ad0-0x0;var _0x424a5a=_0x0295[_0x1b7ad0];return _0x424a5a;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5029('0x2'));var interaction=require(_0x5029('0x3'));var config=require(_0x5029('0x4'));var controller=require(_0x5029('0x5'));router[_0x5029('0x6')]('/',auth[_0x5029('0x7')](),controller[_0x5029('0x8')]);router[_0x5029('0x6')](_0x5029('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x5029('0xa'),auth['isAuthenticated'](),controller[_0x5029('0xb')]);router['post']('/',auth[_0x5029('0x7')](),controller['create']);router[_0x5029('0xc')](_0x5029('0xa'),auth[_0x5029('0x7')](),controller['update']);router[_0x5029('0xd')](_0x5029('0xa'),auth[_0x5029('0x7')](),controller['destroy']);module[_0x5029('0xe')]=router; \ No newline at end of file +var _0x3f8a=['show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x31e516,_0x3d7d3d){var _0x419c27=function(_0x4e436c){while(--_0x4e436c){_0x31e516['push'](_0x31e516['shift']());}};_0x419c27(++_0x3d7d3d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x152ea8,_0x3fb53f){_0x152ea8=_0x152ea8-0x0;var _0x4c0ebe=_0x3f8a[_0x152ea8];return _0x4c0ebe;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0x9')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')]('/',auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller['update']);router[_0xa3f8('0x13')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x14')]);module[_0xa3f8('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index c782d75..b3e32f3 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 _0x754b=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x1fd29d,_0x1bd953){var _0x8d692c=function(_0x171162){while(--_0x171162){_0x1fd29d['push'](_0x1fd29d['shift']());}};_0x8d692c(++_0x1bd953);}(_0x754b,0x1ba));var _0xb754=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x754b[_0x308374];return _0x1f71e0;};'use strict';var Sequelize=require(_0xb754('0x0'));module[_0xb754('0x1')]={'type':{'type':Sequelize[_0xb754('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb754('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb754('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xb754('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xb754('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xb754('0x4')]},'agentcomplete':{'type':Sequelize[_0xb754('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb754('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb754('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb754('0x4')]},'agentacw':{'type':Sequelize[_0xb754('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb754('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xb754('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb754('0x2')]},'connectedlinename':{'type':Sequelize[_0xb754('0x2')]},'language':{'type':Sequelize[_0xb754('0x2')]},'accountcode':{'type':Sequelize[_0xb754('0x2')]},'context':{'type':Sequelize[_0xb754('0x2')]},'exten':{'type':Sequelize[_0xb754('0x2')]},'priority':{'type':Sequelize[_0xb754('0x2')]},'destchannel':{'type':Sequelize[_0xb754('0x2')]},'destchannelstate':{'type':Sequelize[_0xb754('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xb754('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb754('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb754('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb754('0x2')]},'destlanguage':{'type':Sequelize[_0xb754('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xb754('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xb754('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb754('0x2')],'comment':_0xb754('0x6')},'transferexten':{'type':Sequelize[_0xb754('0x2')]},'transferuniqueid':{'type':Sequelize[_0xb754('0x2')]},'agententerreason':{'type':Sequelize[_0xb754('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0992=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x212ea8,_0x1732aa){var _0x3f9290=function(_0x287dc0){while(--_0x287dc0){_0x212ea8['push'](_0x212ea8['shift']());}};_0x3f9290(++_0x1732aa);}(_0x0992,0x147));var _0x2099=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x0992[_0x3b3cc6];return _0x1161e4;};'use strict';var Sequelize=require('sequelize');module[_0x2099('0x0')]={'type':{'type':Sequelize[_0x2099('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2099('0x1')]},'calleridname':{'type':Sequelize[_0x2099('0x1')]},'queue':{'type':Sequelize[_0x2099('0x1')]},'interface':{'type':Sequelize[_0x2099('0x1')]},'membername':{'type':Sequelize[_0x2099('0x1')]},'agentcalledAt':{'type':Sequelize[_0x2099('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x2099('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x2099('0x2')]},'holdtime':{'type':Sequelize[_0x2099('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2099('0x3')]},'agentacw':{'type':Sequelize[_0x2099('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2099('0x3')]},'reason':{'type':Sequelize[_0x2099('0x1')]},'lastevent':{'type':Sequelize[_0x2099('0x1')]},'channel':{'type':Sequelize[_0x2099('0x1')]},'channelstate':{'type':Sequelize[_0x2099('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2099('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2099('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2099('0x1')]},'accountcode':{'type':Sequelize[_0x2099('0x1')]},'context':{'type':Sequelize[_0x2099('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x2099('0x1')]},'destchannel':{'type':Sequelize[_0x2099('0x1')]},'destchannelstate':{'type':Sequelize[_0x2099('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2099('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2099('0x1')]},'destcalleridname':{'type':Sequelize[_0x2099('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x2099('0x1')]},'destlanguage':{'type':Sequelize[_0x2099('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x2099('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x2099('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2099('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2099('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2099('0x1')],'comment':_0x2099('0x5')},'transferexten':{'type':Sequelize[_0x2099('0x1')]},'transferuniqueid':{'type':Sequelize[_0x2099('0x1')]},'agententerreason':{'type':Sequelize[_0x2099('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index f25d7f1..3540368 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 _0x28a0=['html-pdf','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','VoiceAgentReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','map','key','VIRTUAL','merge','includeAll','findAll','rows','catch','show','length','include','options','find','body','params','describe'];(function(_0x949616,_0x32abb3){var _0x3bcfdc=function(_0x2d66d1){while(--_0x2d66d1){_0x949616['push'](_0x949616['shift']());}};_0x3bcfdc(++_0x32abb3);}(_0x28a0,0x8a));var _0x028a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x28a0[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x028a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x028a('0x1'));var zipdir=require(_0x028a('0x2'));var jsonpatch=require(_0x028a('0x3'));var rp=require('request-promise');var moment=require(_0x028a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x028a('0x5'));var sox=require('sox');var csv=require(_0x028a('0x6'));var ejs=require(_0x028a('0x7'));var fs=require('fs');var _=require(_0x028a('0x8'));var squel=require(_0x028a('0x9'));var crypto=require(_0x028a('0xa'));var jsforce=require(_0x028a('0xb'));var deskjs=require(_0x028a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x028a('0xd'));var Papa=require(_0x028a('0xe'));var authService=require(_0x028a('0xf'));var hardwareService=require(_0x028a('0x10'));var Redis=require('ioredis');var qs=require(_0x028a('0x11'));var logger=require(_0x028a('0x12'))(_0x028a('0x13'));var utils=require(_0x028a('0x14'));var config=require('../../config/environment');var db=require(_0x028a('0x15'))['db'];function respondWithStatusCode(_0x352591,_0x2aa90c){_0x2aa90c=_0x2aa90c||0xcc;return function(_0x32a606){if(_0x32a606){return _0x352591[_0x028a('0x16')](_0x2aa90c);}return _0x352591[_0x028a('0x17')](_0x2aa90c)['end']();};}function respondWithResult(_0x178240,_0x5704b4){_0x5704b4=_0x5704b4||0xc8;return function(_0x572e74){if(_0x572e74){return _0x178240[_0x028a('0x17')](_0x5704b4)[_0x028a('0x18')](_0x572e74);}};}function respondWithFilteredResult(_0x5d2b0c,_0x9df638){return function(_0xe713cc){if(_0xe713cc){var _0x215d6b=_0xe713cc[_0x028a('0x19')],_0x5f2456=_0x9df638[_0x028a('0x1a')],_0x56e61c=_0x9df638[_0x028a('0x1a')]+_0x9df638[_0x028a('0x1b')],_0x4e7340;if(_0x56e61c>=_0x215d6b){_0x56e61c=_0x215d6b;_0x4e7340=0xc8;}else{_0x4e7340=0xce;}_0x5d2b0c[_0x028a('0x17')](_0x4e7340);return _0x5d2b0c[_0x028a('0x1c')](_0x028a('0x1d'),_0x5f2456+'-'+_0x56e61c+'/'+_0x215d6b)[_0x028a('0x18')](_0xe713cc);}return null;};}function patchUpdates(_0x4779cb){return function(_0x11beb8){try{jsonpatch['apply'](_0x11beb8,_0x4779cb,!![]);}catch(_0x1dc89c){return BPromise[_0x028a('0x1e')](_0x1dc89c);}return _0x11beb8[_0x028a('0x1f')]();};}function saveUpdates(_0x5373ae,_0x492844){return function(_0x14c203){if(_0x14c203){return _0x14c203[_0x028a('0x20')](_0x5373ae)[_0x028a('0x21')](function(_0x25deb0){return _0x25deb0;});}return null;};}function removeEntity(_0x5108d8,_0x6cda6){return function(_0x47b65d){if(_0x47b65d){return _0x47b65d[_0x028a('0x22')]()[_0x028a('0x21')](function(){_0x5108d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f0857,_0x55b652){return function(_0x112f8d){if(!_0x112f8d){_0x5f0857[_0x028a('0x16')](0x194);}return _0x112f8d;};}function handleError(_0x5a9655,_0x40b133){_0x40b133=_0x40b133||0x1f4;return function(_0x75e3b7){logger[_0x028a('0x23')](_0x75e3b7[_0x028a('0x24')]);if(_0x75e3b7[_0x028a('0x25')]){delete _0x75e3b7[_0x028a('0x25')];}_0x5a9655[_0x028a('0x17')](_0x40b133)[_0x028a('0x26')](_0x75e3b7);};}exports['index']=function(_0xe0ad26,_0x2422d8){var _0x105327={},_0x56a92b={},_0x40c0fd={'count':0x0,'rows':[]};var _0x36a06e=db[_0x028a('0x27')][_0x028a('0x28')];_0x56a92b[_0x028a('0x29')]=_['keys'](_0x36a06e);_0x56a92b[_0x028a('0x2a')]=_[_0x028a('0x2b')](_0xe0ad26[_0x028a('0x2a')]);_0x56a92b[_0x028a('0x2c')]=_[_0x028a('0x2d')](_0x56a92b[_0x028a('0x29')],_0x56a92b['query']);_0x105327[_0x028a('0x2e')]=_[_0x028a('0x2d')](_0x56a92b[_0x028a('0x29')],qs[_0x028a('0x2f')](_0xe0ad26[_0x028a('0x2a')][_0x028a('0x2f')]));_0x105327[_0x028a('0x2e')]=_0x105327['attributes']['length']?_0x105327[_0x028a('0x2e')]:_0x56a92b[_0x028a('0x29')];if(!_0xe0ad26['query']['hasOwnProperty']('nolimit')){_0x105327[_0x028a('0x1b')]=qs['limit'](_0xe0ad26[_0x028a('0x2a')][_0x028a('0x1b')]);_0x105327[_0x028a('0x1a')]=qs['offset'](_0xe0ad26['query'][_0x028a('0x1a')]);}_0x105327[_0x028a('0x30')]=qs[_0x028a('0x31')](_0xe0ad26[_0x028a('0x2a')][_0x028a('0x31')]);_0x105327[_0x028a('0x32')]=qs[_0x028a('0x2c')](_[_0x028a('0x33')](_0xe0ad26[_0x028a('0x2a')],_0x56a92b['filters']));if(_0xe0ad26['query'][_0x028a('0x34')]){_0x105327[_0x028a('0x32')]=_['merge'](_0x105327[_0x028a('0x32')],{'$or':_[_0x028a('0x35')](_0x36a06e,function(_0x18cc7a){if(_0x18cc7a['type'][_0x028a('0x36')]!==_0x028a('0x37')){var _0x257726={};_0x257726[_0x18cc7a['field']]={'$like':'%'+_0xe0ad26[_0x028a('0x2a')][_0x028a('0x34')]+'%'};return _0x257726;}})});}_0x105327=_[_0x028a('0x38')]({},_0x105327,_0xe0ad26['options']);var _0x5200b6={'where':_0x105327['where']};return db[_0x028a('0x27')]['count'](_0x5200b6)[_0x028a('0x21')](function(_0x2e8e21){_0x40c0fd[_0x028a('0x19')]=_0x2e8e21;if(_0xe0ad26[_0x028a('0x2a')][_0x028a('0x39')]){_0x105327['include']=[{'all':!![]}];}return db['VoiceAgentReport'][_0x028a('0x3a')](_0x105327);})['then'](function(_0x2d80d4){_0x40c0fd[_0x028a('0x3b')]=_0x2d80d4;return _0x40c0fd;})[_0x028a('0x21')](respondWithFilteredResult(_0x2422d8,_0x105327))[_0x028a('0x3c')](handleError(_0x2422d8,null));};exports[_0x028a('0x3d')]=function(_0x620048,_0x318881){var _0x43da8e={'raw':![],'where':{'id':_0x620048['params']['id']}},_0x3fee9a={};_0x3fee9a['model']=_['keys'](db[_0x028a('0x27')][_0x028a('0x28')]);_0x3fee9a['query']=_[_0x028a('0x2b')](_0x620048[_0x028a('0x2a')]);_0x3fee9a['filters']=_[_0x028a('0x2d')](_0x3fee9a[_0x028a('0x29')],_0x3fee9a[_0x028a('0x2a')]);_0x43da8e[_0x028a('0x2e')]=_[_0x028a('0x2d')](_0x3fee9a['model'],qs[_0x028a('0x2f')](_0x620048['query']['fields']));_0x43da8e[_0x028a('0x2e')]=_0x43da8e['attributes'][_0x028a('0x3e')]?_0x43da8e[_0x028a('0x2e')]:_0x3fee9a['model'];if(_0x620048[_0x028a('0x2a')][_0x028a('0x39')]){_0x43da8e[_0x028a('0x3f')]=[{'all':!![]}];}_0x43da8e=_[_0x028a('0x38')]({},_0x43da8e,_0x620048[_0x028a('0x40')]);return db[_0x028a('0x27')][_0x028a('0x41')](_0x43da8e)[_0x028a('0x21')](handleEntityNotFound(_0x318881,null))[_0x028a('0x21')](respondWithResult(_0x318881,null))[_0x028a('0x3c')](handleError(_0x318881,null));};exports['create']=function(_0x2a4399,_0x660d25){return db[_0x028a('0x27')]['create'](_0x2a4399[_0x028a('0x42')],{})[_0x028a('0x21')](respondWithResult(_0x660d25,0xc9))['catch'](handleError(_0x660d25,null));};exports[_0x028a('0x20')]=function(_0x5d5a10,_0x2d415c){if(_0x5d5a10['body']['id']){delete _0x5d5a10[_0x028a('0x42')]['id'];}return db['VoiceAgentReport'][_0x028a('0x41')]({'where':{'id':_0x5d5a10['params']['id']}})[_0x028a('0x21')](handleEntityNotFound(_0x2d415c,null))[_0x028a('0x21')](saveUpdates(_0x5d5a10['body'],null))['then'](respondWithResult(_0x2d415c,null))[_0x028a('0x3c')](handleError(_0x2d415c,null));};exports[_0x028a('0x22')]=function(_0x28c5f7,_0x499440){return db[_0x028a('0x27')][_0x028a('0x41')]({'where':{'id':_0x28c5f7[_0x028a('0x43')]['id']}})[_0x028a('0x21')](handleEntityNotFound(_0x499440,null))['then'](removeEntity(_0x499440,null))[_0x028a('0x3c')](handleError(_0x499440,null));};exports[_0x028a('0x44')]=function(_0x307936,_0x19c976){return db['VoiceAgentReport'][_0x028a('0x44')]()['then'](respondWithResult(_0x19c976,null))[_0x028a('0x3c')](handleError(_0x19c976,null));}; \ No newline at end of file +var _0xedd9=['then','destroy','error','stack','name','send','index','VoiceAgentReport','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save'];(function(_0x5ced30,_0x416aa0){var _0x4868b5=function(_0x2be55c){while(--_0x2be55c){_0x5ced30['push'](_0x5ced30['shift']());}};_0x4868b5(++_0x416aa0);}(_0xedd9,0xfc));var _0x9edd=function(_0x157186,_0x46de11){_0x157186=_0x157186-0x0;var _0x2b8110=_0xedd9[_0x157186];return _0x2b8110;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var authService=require(_0x9edd('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9edd('0x11'));var qs=require(_0x9edd('0x12'));var logger=require('../../config/logger')(_0x9edd('0x13'));var utils=require(_0x9edd('0x14'));var config=require('../../config/environment');var db=require(_0x9edd('0x15'))['db'];function respondWithStatusCode(_0x1b73d1,_0x25e64c){_0x25e64c=_0x25e64c||0xcc;return function(_0xfd544a){if(_0xfd544a){return _0x1b73d1[_0x9edd('0x16')](_0x25e64c);}return _0x1b73d1[_0x9edd('0x17')](_0x25e64c)[_0x9edd('0x18')]();};}function respondWithResult(_0xef5498,_0x47eb64){_0x47eb64=_0x47eb64||0xc8;return function(_0x176bfa){if(_0x176bfa){return _0xef5498[_0x9edd('0x17')](_0x47eb64)[_0x9edd('0x19')](_0x176bfa);}};}function respondWithFilteredResult(_0x4d9a7,_0x13b6b6){return function(_0x338f3c){if(_0x338f3c){var _0x1042aa=_0x338f3c[_0x9edd('0x1a')],_0x75a4ab=_0x13b6b6[_0x9edd('0x1b')],_0x4ea60f=_0x13b6b6['offset']+_0x13b6b6[_0x9edd('0x1c')],_0x5f5bf4;if(_0x4ea60f>=_0x1042aa){_0x4ea60f=_0x1042aa;_0x5f5bf4=0xc8;}else{_0x5f5bf4=0xce;}_0x4d9a7[_0x9edd('0x17')](_0x5f5bf4);return _0x4d9a7[_0x9edd('0x1d')]('Content-Range',_0x75a4ab+'-'+_0x4ea60f+'/'+_0x1042aa)[_0x9edd('0x19')](_0x338f3c);}return null;};}function patchUpdates(_0x5d879c){return function(_0x2cdcef){try{jsonpatch[_0x9edd('0x1e')](_0x2cdcef,_0x5d879c,!![]);}catch(_0x4bdb88){return BPromise['reject'](_0x4bdb88);}return _0x2cdcef[_0x9edd('0x1f')]();};}function saveUpdates(_0x50338f,_0x27a95a){return function(_0x54a03f){if(_0x54a03f){return _0x54a03f['update'](_0x50338f)[_0x9edd('0x20')](function(_0x1c46a8){return _0x1c46a8;});}return null;};}function removeEntity(_0x4fb7bf,_0x5823bc){return function(_0x341d67){if(_0x341d67){return _0x341d67[_0x9edd('0x21')]()[_0x9edd('0x20')](function(){_0x4fb7bf['status'](0xcc)[_0x9edd('0x18')]();});}};}function handleEntityNotFound(_0x1dca43,_0x44a6c1){return function(_0x2ca65f){if(!_0x2ca65f){_0x1dca43[_0x9edd('0x16')](0x194);}return _0x2ca65f;};}function handleError(_0x4c75d2,_0x46c383){_0x46c383=_0x46c383||0x1f4;return function(_0xeaf55a){logger[_0x9edd('0x22')](_0xeaf55a[_0x9edd('0x23')]);if(_0xeaf55a[_0x9edd('0x24')]){delete _0xeaf55a['name'];}_0x4c75d2['status'](_0x46c383)[_0x9edd('0x25')](_0xeaf55a);};}exports[_0x9edd('0x26')]=function(_0x8d67aa,_0x25e135){var _0x3c2227={},_0x4fe471={},_0x57a2cc={'count':0x0,'rows':[]};var _0x214d0a=db[_0x9edd('0x27')][_0x9edd('0x28')];_0x4fe471['model']=_[_0x9edd('0x29')](_0x214d0a);_0x4fe471[_0x9edd('0x2a')]=_[_0x9edd('0x29')](_0x8d67aa[_0x9edd('0x2a')]);_0x4fe471['filters']=_[_0x9edd('0x2b')](_0x4fe471[_0x9edd('0x2c')],_0x4fe471[_0x9edd('0x2a')]);_0x3c2227[_0x9edd('0x2d')]=_[_0x9edd('0x2b')](_0x4fe471[_0x9edd('0x2c')],qs[_0x9edd('0x2e')](_0x8d67aa[_0x9edd('0x2a')][_0x9edd('0x2e')]));_0x3c2227[_0x9edd('0x2d')]=_0x3c2227[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x3c2227[_0x9edd('0x2d')]:_0x4fe471[_0x9edd('0x2c')];if(!_0x8d67aa[_0x9edd('0x2a')]['hasOwnProperty'](_0x9edd('0x30'))){_0x3c2227[_0x9edd('0x1c')]=qs[_0x9edd('0x1c')](_0x8d67aa['query'][_0x9edd('0x1c')]);_0x3c2227[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0x8d67aa[_0x9edd('0x2a')][_0x9edd('0x1b')]);}_0x3c2227[_0x9edd('0x31')]=qs[_0x9edd('0x32')](_0x8d67aa[_0x9edd('0x2a')][_0x9edd('0x32')]);_0x3c2227[_0x9edd('0x33')]=qs[_0x9edd('0x34')](_[_0x9edd('0x35')](_0x8d67aa[_0x9edd('0x2a')],_0x4fe471[_0x9edd('0x34')]));if(_0x8d67aa['query'][_0x9edd('0x36')]){_0x3c2227['where']=_[_0x9edd('0x37')](_0x3c2227[_0x9edd('0x33')],{'$or':_[_0x9edd('0x38')](_0x214d0a,function(_0x434d26){if(_0x434d26[_0x9edd('0x39')]['key']!==_0x9edd('0x3a')){var _0x44dbfc={};_0x44dbfc[_0x434d26[_0x9edd('0x3b')]]={'$like':'%'+_0x8d67aa[_0x9edd('0x2a')][_0x9edd('0x36')]+'%'};return _0x44dbfc;}})});}_0x3c2227=_[_0x9edd('0x37')]({},_0x3c2227,_0x8d67aa[_0x9edd('0x3c')]);var _0x1cbbac={'where':_0x3c2227[_0x9edd('0x33')]};return db[_0x9edd('0x27')]['count'](_0x1cbbac)[_0x9edd('0x20')](function(_0x56a228){_0x57a2cc[_0x9edd('0x1a')]=_0x56a228;if(_0x8d67aa['query'][_0x9edd('0x3d')]){_0x3c2227[_0x9edd('0x3e')]=[{'all':!![]}];}return db[_0x9edd('0x27')]['findAll'](_0x3c2227);})[_0x9edd('0x20')](function(_0xcbd0ef){_0x57a2cc[_0x9edd('0x3f')]=_0xcbd0ef;return _0x57a2cc;})['then'](respondWithFilteredResult(_0x25e135,_0x3c2227))[_0x9edd('0x40')](handleError(_0x25e135,null));};exports['show']=function(_0x1fc4fb,_0xfbc492){var _0x50be2c={'raw':![],'where':{'id':_0x1fc4fb[_0x9edd('0x41')]['id']}},_0x315f52={};_0x315f52[_0x9edd('0x2c')]=_[_0x9edd('0x29')](db['VoiceAgentReport'][_0x9edd('0x28')]);_0x315f52['query']=_[_0x9edd('0x29')](_0x1fc4fb[_0x9edd('0x2a')]);_0x315f52['filters']=_[_0x9edd('0x2b')](_0x315f52['model'],_0x315f52['query']);_0x50be2c[_0x9edd('0x2d')]=_[_0x9edd('0x2b')](_0x315f52[_0x9edd('0x2c')],qs[_0x9edd('0x2e')](_0x1fc4fb[_0x9edd('0x2a')][_0x9edd('0x2e')]));_0x50be2c[_0x9edd('0x2d')]=_0x50be2c[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x50be2c[_0x9edd('0x2d')]:_0x315f52[_0x9edd('0x2c')];if(_0x1fc4fb[_0x9edd('0x2a')][_0x9edd('0x3d')]){_0x50be2c[_0x9edd('0x3e')]=[{'all':!![]}];}_0x50be2c=_[_0x9edd('0x37')]({},_0x50be2c,_0x1fc4fb['options']);return db[_0x9edd('0x27')][_0x9edd('0x42')](_0x50be2c)[_0x9edd('0x20')](handleEntityNotFound(_0xfbc492,null))[_0x9edd('0x20')](respondWithResult(_0xfbc492,null))[_0x9edd('0x40')](handleError(_0xfbc492,null));};exports[_0x9edd('0x43')]=function(_0x10d41e,_0x4e9ad1){return db['VoiceAgentReport']['create'](_0x10d41e[_0x9edd('0x44')],{})['then'](respondWithResult(_0x4e9ad1,0xc9))[_0x9edd('0x40')](handleError(_0x4e9ad1,null));};exports[_0x9edd('0x45')]=function(_0x2b06d3,_0x8db801){if(_0x2b06d3[_0x9edd('0x44')]['id']){delete _0x2b06d3['body']['id'];}return db[_0x9edd('0x27')][_0x9edd('0x42')]({'where':{'id':_0x2b06d3[_0x9edd('0x41')]['id']}})['then'](handleEntityNotFound(_0x8db801,null))[_0x9edd('0x20')](saveUpdates(_0x2b06d3[_0x9edd('0x44')],null))[_0x9edd('0x20')](respondWithResult(_0x8db801,null))[_0x9edd('0x40')](handleError(_0x8db801,null));};exports[_0x9edd('0x21')]=function(_0x35bdec,_0x4d4f33){return db[_0x9edd('0x27')][_0x9edd('0x42')]({'where':{'id':_0x35bdec['params']['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x20')](removeEntity(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x46')]=function(_0x8134cd,_0x468239){return db['VoiceAgentReport'][_0x9edd('0x46')]()[_0x9edd('0x20')](respondWithResult(_0x468239,null))[_0x9edd('0x40')](handleError(_0x468239,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index a14dcce..6a22506 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 _0xd800=['request-promise','./voiceAgentReport.attributes','exports','report_agent','destuniqueid','lodash','../../config/logger','api','moment'];(function(_0x3cc724,_0x470b13){var _0x4b72d4=function(_0x1276c4){while(--_0x1276c4){_0x3cc724['push'](_0x3cc724['shift']());}};_0x4b72d4(++_0x470b13);}(_0xd800,0x1ac));var _0x0d80=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xd800[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x0d80('0x0'));var util=require('util');var logger=require(_0x0d80('0x1'))(_0x0d80('0x2'));var moment=require(_0x0d80('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d80('0x4'));var attributes=require(_0x0d80('0x5'));module[_0x0d80('0x6')]=function(_0x269ee8,_0x436246){return _0x269ee8['define']('VoiceAgentReport',attributes,{'tableName':_0x0d80('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x0d80('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a20=['moment','bluebird','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api'];(function(_0x1b5631,_0x232b3b){var _0x18bda2=function(_0x1782fc){while(--_0x1782fc){_0x1b5631['push'](_0x1b5631['shift']());}};_0x18bda2(++_0x232b3b);}(_0x7a20,0x64));var _0x07a2=function(_0xb2070d,_0x1c9bf7){_0xb2070d=_0xb2070d-0x0;var _0x114fe8=_0x7a20[_0xb2070d];return _0x114fe8;};'use strict';var _=require(_0x07a2('0x0'));var util=require(_0x07a2('0x1'));var logger=require(_0x07a2('0x2'))(_0x07a2('0x3'));var moment=require(_0x07a2('0x4'));var BPromise=require(_0x07a2('0x5'));var rp=require('request-promise');var attributes=require(_0x07a2('0x6'));module[_0x07a2('0x7')]=function(_0x11e3c7,_0x32a52b){return _0x11e3c7[_0x07a2('0x8')](_0x07a2('0x9'),attributes,{'tableName':_0x07a2('0xa'),'paranoid':![],'indexes':[{'fields':[_0x07a2('0xb'),_0x07a2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 64c622a..4422ff2 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(_0x166f5f,_0x3a282b){var _0x2d2190=function(_0x249033){while(--_0x249033){_0x166f5f['push'](_0x166f5f['shift']());}};_0x2d2190(++_0x3a282b);}(_0x7a54,0x106));var _0x47a5=function(_0x5c8791,_0x1a27dd){_0x5c8791=_0x5c8791-0x0;var _0x1f57ac=_0x7a54[_0x5c8791];return _0x1f57ac;};'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 _0x9957=['catch','CreateVoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2bd0ad,_0x1d5726){var _0x1966b3=function(_0x58bd74){while(--_0x58bd74){_0x2bd0ad['push'](_0x2bd0ad['shift']());}};_0x1966b3(++_0x1d5726);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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']('VoiceAgentReport,\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['VoiceAgentReport'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3a9b54){logger['info']('CreateVoiceAgentReport',_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x3a9b54));_0x37a7d4(_0x3a9b54);})[_0x7995('0x17')](function(_0x460924){logger[_0x7995('0x13')]('CreateVoiceAgentReport',_0x460924[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x460924[_0x7995('0x15')]));});});};exports[_0x7995('0x1c')]=function(_0x563799){var _0x13bc35=this;return new Promise(function(_0x475351,_0x472195){return db['VoiceAgentReport'][_0x7995('0x1d')](_0x563799[_0x7995('0x1e')],{'raw':_0x563799[_0x7995('0x1a')]?_0x563799[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x563799[_0x7995('0x1a')]?_0x563799['options'][_0x7995('0x1f')]||null:null,'attributes':_0x563799['options']?_0x563799[_0x7995('0x1a')][_0x7995('0x20')]||null:null,'limit':_0x563799[_0x7995('0x1a')]?_0x563799[_0x7995('0x1a')][_0x7995('0x21')]||null:null})['then'](function(_0x9b2a15){logger['info'](_0x7995('0x1c'),_0x563799);logger[_0x7995('0x10')](_0x7995('0x1c'),_0x563799,JSON['stringify'](_0x9b2a15));_0x475351(_0x9b2a15);})['catch'](function(_0x48e573){logger[_0x7995('0x13')](_0x7995('0x1c'),_0x48e573[_0x7995('0x15')],_0x563799);_0x472195(_0x13bc35[_0x7995('0x13')](0x1f4,_0x48e573[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0cde835..50bf211 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 _0x0f96=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','post','create','put','update','delete','/:id','destroy','exports','util','connect-timeout','express'];(function(_0x12c263,_0x2d9bce){var _0x192cd7=function(_0x3a1fc0){while(--_0x3a1fc0){_0x12c263['push'](_0x12c263['shift']());}};_0x192cd7(++_0x2d9bce);}(_0x0f96,0x165));var _0x60f9=function(_0x1f2a8e,_0x33f70e){_0x1f2a8e=_0x1f2a8e-0x0;var _0x4800ab=_0x0f96[_0x1f2a8e];return _0x4800ab;};'use strict';var multer=require('multer');var util=require(_0x60f9('0x0'));var path=require('path');var timeout=require(_0x60f9('0x1'));var express=require(_0x60f9('0x2'));var router=express[_0x60f9('0x3')]();var auth=require(_0x60f9('0x4'));var interaction=require(_0x60f9('0x5'));var config=require(_0x60f9('0x6'));var controller=require(_0x60f9('0x7'));router[_0x60f9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x60f9('0x8')](_0x60f9('0x9'),auth[_0x60f9('0xa')](),controller[_0x60f9('0xb')]);router['get']('/:id',auth[_0x60f9('0xa')](),controller['show']);router[_0x60f9('0xc')]('/',auth[_0x60f9('0xa')](),controller[_0x60f9('0xd')]);router[_0x60f9('0xe')]('/:id',auth[_0x60f9('0xa')](),controller[_0x60f9('0xf')]);router[_0x60f9('0x10')](_0x60f9('0x11'),auth[_0x60f9('0xa')](),controller[_0x60f9('0x12')]);module[_0x60f9('0x13')]=router; \ No newline at end of file +var _0x4826=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x4826,0x114));var _0x6482=function(_0x238885,_0x1c2ec1){_0x238885=_0x238885-0x0;var _0x22af11=_0x4826[_0x238885];return _0x22af11;};'use strict';var multer=require(_0x6482('0x0'));var util=require(_0x6482('0x1'));var path=require('path');var timeout=require(_0x6482('0x2'));var express=require(_0x6482('0x3'));var router=express[_0x6482('0x4')]();var auth=require(_0x6482('0x5'));var interaction=require(_0x6482('0x6'));var config=require(_0x6482('0x7'));var controller=require(_0x6482('0x8'));router[_0x6482('0x9')]('/',auth[_0x6482('0xa')](),controller[_0x6482('0xb')]);router['get'](_0x6482('0xc'),auth[_0x6482('0xa')](),controller[_0x6482('0xd')]);router['get'](_0x6482('0xe'),auth[_0x6482('0xa')](),controller[_0x6482('0xf')]);router[_0x6482('0x10')]('/',auth[_0x6482('0xa')](),controller[_0x6482('0x11')]);router[_0x6482('0x12')](_0x6482('0xe'),auth['isAuthenticated'](),controller[_0x6482('0x13')]);router['delete'](_0x6482('0xe'),auth['isAuthenticated'](),controller[_0x6482('0x14')]);module[_0x6482('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index de63ca1..c0501b4 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 _0xbaf9=['INTEGER','sequelize','exports','STRING','inbound-fax','TEXT','DATE'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xbaf9,0x7f));var _0x9baf=function(_0x36b58d,_0x5ad279){_0x36b58d=_0x36b58d-0x0;var _0x4512bc=_0xbaf9[_0x36b58d];return _0x4512bc;};'use strict';var Sequelize=require(_0x9baf('0x0'));module[_0x9baf('0x1')]={'uniqueid':{'type':Sequelize[_0x9baf('0x2')]},'type':{'type':Sequelize['ENUM']('inbound','internal','outbound',_0x9baf('0x3'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x9baf('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x9baf('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x9baf('0x2')]},'lastapplication':{'type':Sequelize[_0x9baf('0x2')]},'lastdata':{'type':Sequelize[_0x9baf('0x4')]},'starttime':{'type':Sequelize[_0x9baf('0x5')]},'systemanswertime':{'type':Sequelize[_0x9baf('0x5')]},'answertime':{'type':Sequelize[_0x9baf('0x5')]},'endtime':{'type':Sequelize[_0x9baf('0x5')]},'duration':{'type':Sequelize[_0x9baf('0x6')]},'billableseconds':{'type':Sequelize[_0x9baf('0x6')]},'mohtime':{'type':Sequelize[_0x9baf('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9baf('0x2')]},'userfield':{'type':Sequelize[_0x9baf('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9baf('0x2')]},'prefix':{'type':Sequelize[_0x9baf('0x2')]},'routeid':{'type':Sequelize[_0x9baf('0x6')]},'sipcallid':{'type':Sequelize[_0x9baf('0x2')]}}; \ No newline at end of file +var _0x5a08=['outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound','outbound','inbound-fax'];(function(_0x58b3ca,_0x4183bc){var _0x1dfab9=function(_0xa24c69){while(--_0xa24c69){_0x58b3ca['push'](_0x58b3ca['shift']());}};_0x1dfab9(++_0x4183bc);}(_0x5a08,0x1c2));var _0x85a0=function(_0x3c695b,_0x456a6a){_0x3c695b=_0x3c695b-0x0;var _0x1a070e=_0x5a08[_0x3c695b];return _0x1a070e;};'use strict';var Sequelize=require(_0x85a0('0x0'));module[_0x85a0('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x85a0('0x2')](_0x85a0('0x3'),'internal',_0x85a0('0x4'),_0x85a0('0x5'),_0x85a0('0x6'),_0x85a0('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x85a0('0x8')]},'source':{'type':Sequelize[_0x85a0('0x8')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x85a0('0x8')]},'callerid':{'type':Sequelize[_0x85a0('0x8')]},'channel':{'type':Sequelize[_0x85a0('0x8')]},'destinationchannel':{'type':Sequelize[_0x85a0('0x8')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x85a0('0x9')]},'starttime':{'type':Sequelize[_0x85a0('0xa')]},'systemanswertime':{'type':Sequelize[_0x85a0('0xa')]},'answertime':{'type':Sequelize[_0x85a0('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x85a0('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x85a0('0x8')]},'userfield':{'type':Sequelize[_0x85a0('0x8')]},'userDisposition':{'type':Sequelize[_0x85a0('0x8')]},'note':{'type':Sequelize[_0x85a0('0x8')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x85a0('0xb')]},'sipcallid':{'type':Sequelize[_0x85a0('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 8a073f0..635c9a6 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 _0x622e=['request-promise','moment','bluebird','mustache','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','limit','set','Content-Range','apply','reject','save','update','then','status','error','stack','name','send','VoiceCallReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','map','VIRTUAL','field','options','include','fullname','alias','User','findAll','rows','show','params','includeAll','catch','create','body','destroy','describe','uniqueid','user','html-pdf','eml-format','fast-json-patch'];(function(_0x2bdebb,_0x4c906f){var _0x4ceea3=function(_0x3d0cf0){while(--_0x3d0cf0){_0x2bdebb['push'](_0x2bdebb['shift']());}};_0x4ceea3(++_0x4c906f);}(_0x622e,0x131));var _0xe622=function(_0x2cada4,_0x5007f8){_0x2cada4=_0x2cada4-0x0;var _0x9b6d2e=_0x622e[_0x2cada4];return _0x9b6d2e;};'use strict';var pdf=require(_0xe622('0x0'));var emlformat=require(_0xe622('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe622('0x2'));var rp=require(_0xe622('0x3'));var moment=require(_0xe622('0x4'));var BPromise=require(_0xe622('0x5'));var Mustache=require(_0xe622('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe622('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe622('0x8'));var squel=require(_0xe622('0x9'));var crypto=require(_0xe622('0xa'));var jsforce=require(_0xe622('0xb'));var deskjs=require(_0xe622('0xc'));var toCsv=require(_0xe622('0xd'));var querystring=require(_0xe622('0xe'));var Papa=require(_0xe622('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xe622('0x10'));var Redis=require(_0xe622('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xe622('0x12'))(_0xe622('0x13'));var utils=require(_0xe622('0x14'));var config=require(_0xe622('0x15'));var db=require(_0xe622('0x16'))['db'];function respondWithStatusCode(_0x47a25c,_0x1318b2){_0x1318b2=_0x1318b2||0xcc;return function(_0x550194){if(_0x550194){return _0x47a25c[_0xe622('0x17')](_0x1318b2);}return _0x47a25c['status'](_0x1318b2)[_0xe622('0x18')]();};}function respondWithResult(_0x4fa3bb,_0x10ac23){_0x10ac23=_0x10ac23||0xc8;return function(_0x33f105){if(_0x33f105){return _0x4fa3bb['status'](_0x10ac23)['json'](_0x33f105);}};}function respondWithFilteredResult(_0x45e6ea,_0x175e85){return function(_0x377d8a){if(_0x377d8a){var _0x1a2ab2=_0x377d8a[_0xe622('0x19')],_0x2ffca4=_0x175e85['offset'],_0x1d7bb6=_0x175e85['offset']+_0x175e85[_0xe622('0x1a')],_0x1f3a93;if(_0x1d7bb6>=_0x1a2ab2){_0x1d7bb6=_0x1a2ab2;_0x1f3a93=0xc8;}else{_0x1f3a93=0xce;}_0x45e6ea['status'](_0x1f3a93);return _0x45e6ea[_0xe622('0x1b')](_0xe622('0x1c'),_0x2ffca4+'-'+_0x1d7bb6+'/'+_0x1a2ab2)['json'](_0x377d8a);}return null;};}function patchUpdates(_0xbf1e86){return function(_0x587f26){try{jsonpatch[_0xe622('0x1d')](_0x587f26,_0xbf1e86,!![]);}catch(_0x23e9ad){return BPromise[_0xe622('0x1e')](_0x23e9ad);}return _0x587f26[_0xe622('0x1f')]();};}function saveUpdates(_0x4e0860,_0xb95b1a){return function(_0x13db6b){if(_0x13db6b){return _0x13db6b[_0xe622('0x20')](_0x4e0860)[_0xe622('0x21')](function(_0x55d3fa){return _0x55d3fa;});}return null;};}function removeEntity(_0x399dad,_0x50faed){return function(_0x34eba){if(_0x34eba){return _0x34eba['destroy']()[_0xe622('0x21')](function(){_0x399dad[_0xe622('0x22')](0xcc)[_0xe622('0x18')]();});}};}function handleEntityNotFound(_0x128277,_0x29d1db){return function(_0x53e79c){if(!_0x53e79c){_0x128277[_0xe622('0x17')](0x194);}return _0x53e79c;};}function handleError(_0x282c54,_0x563ad1){_0x563ad1=_0x563ad1||0x1f4;return function(_0x598d65){logger[_0xe622('0x23')](_0x598d65[_0xe622('0x24')]);if(_0x598d65[_0xe622('0x25')]){delete _0x598d65[_0xe622('0x25')];}_0x282c54[_0xe622('0x22')](_0x563ad1)[_0xe622('0x26')](_0x598d65);};}exports['index']=function(_0x4e1f56,_0x490ff0){var _0x9117e8={},_0x26ecd2={},_0x4e25cf={'count':0x0,'rows':[]};var _0x1d8d79=db[_0xe622('0x27')][_0xe622('0x28')];_0x26ecd2[_0xe622('0x29')]=_[_0xe622('0x2a')](_0x1d8d79);_0x26ecd2[_0xe622('0x2b')]=_[_0xe622('0x2a')](_0x4e1f56[_0xe622('0x2b')]);_0x26ecd2[_0xe622('0x2c')]=_[_0xe622('0x2d')](_0x26ecd2[_0xe622('0x29')],_0x26ecd2[_0xe622('0x2b')]);_0x9117e8[_0xe622('0x2e')]=_[_0xe622('0x2d')](_0x26ecd2[_0xe622('0x29')],qs[_0xe622('0x2f')](_0x4e1f56[_0xe622('0x2b')]['fields']));_0x9117e8['attributes']=_0x9117e8[_0xe622('0x2e')][_0xe622('0x30')]?_0x9117e8[_0xe622('0x2e')]:_0x26ecd2[_0xe622('0x29')];if(!_0x4e1f56[_0xe622('0x2b')][_0xe622('0x31')](_0xe622('0x32'))){_0x9117e8['limit']=qs[_0xe622('0x1a')](_0x4e1f56[_0xe622('0x2b')][_0xe622('0x1a')]);_0x9117e8[_0xe622('0x33')]=qs[_0xe622('0x33')](_0x4e1f56[_0xe622('0x2b')][_0xe622('0x33')]);}_0x9117e8['order']=qs[_0xe622('0x34')](_0x4e1f56[_0xe622('0x2b')]['sort']);_0x9117e8[_0xe622('0x35')]=qs[_0xe622('0x2c')](_[_0xe622('0x36')](_0x4e1f56[_0xe622('0x2b')],_0x26ecd2[_0xe622('0x2c')]));if(_0x4e1f56['query'][_0xe622('0x37')]){_0x9117e8[_0xe622('0x35')]=_[_0xe622('0x38')](_0x9117e8[_0xe622('0x35')],{'$or':_[_0xe622('0x39')](_0x1d8d79,function(_0x282ce5){if(_0x282ce5['type']['key']!==_0xe622('0x3a')){var _0x342c6b={};_0x342c6b[_0x282ce5[_0xe622('0x3b')]]={'$like':'%'+_0x4e1f56[_0xe622('0x2b')][_0xe622('0x37')]+'%'};return _0x342c6b;}})});}_0x9117e8=_['merge']({},_0x9117e8,_0x4e1f56[_0xe622('0x3c')]);var _0x2b80f9={'where':_0x9117e8[_0xe622('0x35')]};return db[_0xe622('0x27')][_0xe622('0x19')](_0x2b80f9)['then'](function(_0x4c059f){_0x4e25cf[_0xe622('0x19')]=_0x4c059f;if(_0x4e1f56[_0xe622('0x2b')]['includeAll']){_0x9117e8[_0xe622('0x3d')]=[{'attributes':['id','name',_0xe622('0x3e'),_0xe622('0x3f')],'model':db[_0xe622('0x40')],'as':_0xe622('0x40')}];}return db[_0xe622('0x27')][_0xe622('0x41')](_0x9117e8);})[_0xe622('0x21')](function(_0x25f1fe){_0x4e25cf[_0xe622('0x42')]=_0x25f1fe;return _0x4e25cf;})[_0xe622('0x21')](respondWithFilteredResult(_0x490ff0,_0x9117e8))['catch'](handleError(_0x490ff0,null));};exports[_0xe622('0x43')]=function(_0x3765a2,_0x3e9bd2){var _0xc01a9b={'raw':!![],'where':{'id':_0x3765a2[_0xe622('0x44')]['id']}},_0x1f6c54={};_0x1f6c54[_0xe622('0x29')]=_[_0xe622('0x2a')](db[_0xe622('0x27')]['rawAttributes']);_0x1f6c54[_0xe622('0x2b')]=_[_0xe622('0x2a')](_0x3765a2[_0xe622('0x2b')]);_0x1f6c54[_0xe622('0x2c')]=_['intersection'](_0x1f6c54['model'],_0x1f6c54['query']);_0xc01a9b[_0xe622('0x2e')]=_[_0xe622('0x2d')](_0x1f6c54[_0xe622('0x29')],qs[_0xe622('0x2f')](_0x3765a2[_0xe622('0x2b')][_0xe622('0x2f')]));_0xc01a9b[_0xe622('0x2e')]=_0xc01a9b['attributes'][_0xe622('0x30')]?_0xc01a9b['attributes']:_0x1f6c54[_0xe622('0x29')];if(_0x3765a2[_0xe622('0x2b')][_0xe622('0x45')]){_0xc01a9b[_0xe622('0x3d')]=[{'all':!![]}];}_0xc01a9b=_[_0xe622('0x38')]({},_0xc01a9b,_0x3765a2[_0xe622('0x3c')]);return db[_0xe622('0x27')]['find'](_0xc01a9b)[_0xe622('0x21')](handleEntityNotFound(_0x3e9bd2,null))[_0xe622('0x21')](respondWithResult(_0x3e9bd2,null))[_0xe622('0x46')](handleError(_0x3e9bd2,null));};exports[_0xe622('0x47')]=function(_0x1c4d5f,_0x2e7246){return db['VoiceCallReport'][_0xe622('0x47')](_0x1c4d5f[_0xe622('0x48')],{})[_0xe622('0x21')](respondWithResult(_0x2e7246,0xc9))[_0xe622('0x46')](handleError(_0x2e7246,null));};exports[_0xe622('0x49')]=function(_0x18e35f,_0x29e180){return db[_0xe622('0x27')]['find']({'where':{'id':_0x18e35f['params']['id']}})[_0xe622('0x21')](handleEntityNotFound(_0x29e180,null))['then'](removeEntity(_0x29e180,null))['catch'](handleError(_0x29e180,null));};exports[_0xe622('0x4a')]=function(_0x1c3d10,_0x5e800f){return db[_0xe622('0x27')]['describe']()[_0xe622('0x21')](respondWithResult(_0x5e800f,null))[_0xe622('0x46')](handleError(_0x5e800f,null));};exports[_0xe622('0x20')]=function(_0x8acce4,_0x379a72){if(_0x8acce4[_0xe622('0x48')][_0xe622('0x4b')]){delete _0x8acce4[_0xe622('0x48')][_0xe622('0x4b')];}return db[_0xe622('0x27')]['find']({'where':{'uniqueid':_0x8acce4[_0xe622('0x44')]['id'],'UserId':{'$or':[null,_0x8acce4[_0xe622('0x4c')]['id']]}}})['then'](handleEntityNotFound(_0x379a72,null))['then'](saveUpdates(_0x8acce4[_0xe622('0x48')],null))[_0xe622('0x21')](respondWithResult(_0x379a72,null))[_0xe622('0x46')](handleError(_0x379a72,null));}; \ No newline at end of file +var _0x4070=['key','VIRTUAL','field','includeAll','include','alias','User','findAll','catch','show','params','options','find','body','describe','uniqueid','user','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','VoiceCallReport','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type'];(function(_0x25dc7b,_0x445887){var _0x10e767=function(_0x52a457){while(--_0x52a457){_0x25dc7b['push'](_0x25dc7b['shift']());}};_0x10e767(++_0x445887);}(_0x4070,0x1d9));var _0x0407=function(_0x2380c9,_0xa58b4){_0x2380c9=_0x2380c9-0x0;var _0x58555a=_0x4070[_0x2380c9];return _0x58555a;};'use strict';var pdf=require(_0x0407('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0407('0x1'));var zipdir=require(_0x0407('0x2'));var jsonpatch=require(_0x0407('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0407('0x4'));var Mustache=require(_0x0407('0x5'));var util=require('util');var path=require(_0x0407('0x6'));var sox=require(_0x0407('0x7'));var csv=require(_0x0407('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0407('0x9'));var squel=require('squel');var crypto=require(_0x0407('0xa'));var jsforce=require(_0x0407('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0407('0x8'));var querystring=require(_0x0407('0xc'));var Papa=require(_0x0407('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x0407('0xe'));var Redis=require(_0x0407('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x0407('0x10'))(_0x0407('0x11'));var utils=require(_0x0407('0x12'));var config=require(_0x0407('0x13'));var db=require(_0x0407('0x14'))['db'];function respondWithStatusCode(_0x555dfd,_0x336eac){_0x336eac=_0x336eac||0xcc;return function(_0x38d0b0){if(_0x38d0b0){return _0x555dfd[_0x0407('0x15')](_0x336eac);}return _0x555dfd[_0x0407('0x16')](_0x336eac)[_0x0407('0x17')]();};}function respondWithResult(_0x1385aa,_0x3ded2e){_0x3ded2e=_0x3ded2e||0xc8;return function(_0x1c7522){if(_0x1c7522){return _0x1385aa[_0x0407('0x16')](_0x3ded2e)[_0x0407('0x18')](_0x1c7522);}};}function respondWithFilteredResult(_0x4a2d2f,_0x4122d0){return function(_0x128597){if(_0x128597){var _0x3d1da7=_0x128597[_0x0407('0x19')],_0x347b6b=_0x4122d0[_0x0407('0x1a')],_0x47cdcd=_0x4122d0[_0x0407('0x1a')]+_0x4122d0[_0x0407('0x1b')],_0x2924dc;if(_0x47cdcd>=_0x3d1da7){_0x47cdcd=_0x3d1da7;_0x2924dc=0xc8;}else{_0x2924dc=0xce;}_0x4a2d2f[_0x0407('0x16')](_0x2924dc);return _0x4a2d2f[_0x0407('0x1c')]('Content-Range',_0x347b6b+'-'+_0x47cdcd+'/'+_0x3d1da7)['json'](_0x128597);}return null;};}function patchUpdates(_0x44720f){return function(_0x247f76){try{jsonpatch[_0x0407('0x1d')](_0x247f76,_0x44720f,!![]);}catch(_0x5ae127){return BPromise['reject'](_0x5ae127);}return _0x247f76[_0x0407('0x1e')]();};}function saveUpdates(_0x2cd3a8,_0x4d9a8c){return function(_0x147798){if(_0x147798){return _0x147798[_0x0407('0x1f')](_0x2cd3a8)[_0x0407('0x20')](function(_0x24dc50){return _0x24dc50;});}return null;};}function removeEntity(_0x39d00f,_0x265efb){return function(_0x323240){if(_0x323240){return _0x323240[_0x0407('0x21')]()['then'](function(){_0x39d00f[_0x0407('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ae69,_0x13c249){return function(_0x3d5171){if(!_0x3d5171){_0x23ae69[_0x0407('0x15')](0x194);}return _0x3d5171;};}function handleError(_0x14389c,_0x889f85){_0x889f85=_0x889f85||0x1f4;return function(_0x3e48c4){logger[_0x0407('0x22')](_0x3e48c4[_0x0407('0x23')]);if(_0x3e48c4['name']){delete _0x3e48c4[_0x0407('0x24')];}_0x14389c[_0x0407('0x16')](_0x889f85)[_0x0407('0x25')](_0x3e48c4);};}exports[_0x0407('0x26')]=function(_0x3858a3,_0x1aadba){var _0x553c57={},_0x2aa537={},_0x5e0929={'count':0x0,'rows':[]};var _0x440819=db[_0x0407('0x27')][_0x0407('0x28')];_0x2aa537[_0x0407('0x29')]=_['keys'](_0x440819);_0x2aa537[_0x0407('0x2a')]=_[_0x0407('0x2b')](_0x3858a3[_0x0407('0x2a')]);_0x2aa537['filters']=_[_0x0407('0x2c')](_0x2aa537[_0x0407('0x29')],_0x2aa537[_0x0407('0x2a')]);_0x553c57[_0x0407('0x2d')]=_[_0x0407('0x2c')](_0x2aa537[_0x0407('0x29')],qs[_0x0407('0x2e')](_0x3858a3[_0x0407('0x2a')][_0x0407('0x2e')]));_0x553c57[_0x0407('0x2d')]=_0x553c57[_0x0407('0x2d')][_0x0407('0x2f')]?_0x553c57[_0x0407('0x2d')]:_0x2aa537[_0x0407('0x29')];if(!_0x3858a3['query'][_0x0407('0x30')](_0x0407('0x31'))){_0x553c57[_0x0407('0x1b')]=qs[_0x0407('0x1b')](_0x3858a3[_0x0407('0x2a')]['limit']);_0x553c57[_0x0407('0x1a')]=qs[_0x0407('0x1a')](_0x3858a3['query'][_0x0407('0x1a')]);}_0x553c57[_0x0407('0x32')]=qs[_0x0407('0x33')](_0x3858a3[_0x0407('0x2a')][_0x0407('0x33')]);_0x553c57[_0x0407('0x34')]=qs[_0x0407('0x35')](_[_0x0407('0x36')](_0x3858a3[_0x0407('0x2a')],_0x2aa537[_0x0407('0x35')]));if(_0x3858a3[_0x0407('0x2a')][_0x0407('0x37')]){_0x553c57[_0x0407('0x34')]=_[_0x0407('0x38')](_0x553c57[_0x0407('0x34')],{'$or':_[_0x0407('0x39')](_0x440819,function(_0x4ba400){if(_0x4ba400[_0x0407('0x3a')][_0x0407('0x3b')]!==_0x0407('0x3c')){var _0x234905={};_0x234905[_0x4ba400[_0x0407('0x3d')]]={'$like':'%'+_0x3858a3[_0x0407('0x2a')][_0x0407('0x37')]+'%'};return _0x234905;}})});}_0x553c57=_['merge']({},_0x553c57,_0x3858a3['options']);var _0x4d27ce={'where':_0x553c57[_0x0407('0x34')]};return db['VoiceCallReport'][_0x0407('0x19')](_0x4d27ce)[_0x0407('0x20')](function(_0x506478){_0x5e0929[_0x0407('0x19')]=_0x506478;if(_0x3858a3[_0x0407('0x2a')][_0x0407('0x3e')]){_0x553c57[_0x0407('0x3f')]=[{'attributes':['id',_0x0407('0x24'),'fullname',_0x0407('0x40')],'model':db[_0x0407('0x41')],'as':_0x0407('0x41')}];}return db[_0x0407('0x27')][_0x0407('0x42')](_0x553c57);})[_0x0407('0x20')](function(_0x5a021f){_0x5e0929['rows']=_0x5a021f;return _0x5e0929;})[_0x0407('0x20')](respondWithFilteredResult(_0x1aadba,_0x553c57))[_0x0407('0x43')](handleError(_0x1aadba,null));};exports[_0x0407('0x44')]=function(_0x5b2f6d,_0x440961){var _0x33a7a4={'raw':!![],'where':{'id':_0x5b2f6d[_0x0407('0x45')]['id']}},_0x32cb3a={};_0x32cb3a[_0x0407('0x29')]=_[_0x0407('0x2b')](db['VoiceCallReport'][_0x0407('0x28')]);_0x32cb3a[_0x0407('0x2a')]=_[_0x0407('0x2b')](_0x5b2f6d['query']);_0x32cb3a[_0x0407('0x35')]=_[_0x0407('0x2c')](_0x32cb3a[_0x0407('0x29')],_0x32cb3a[_0x0407('0x2a')]);_0x33a7a4['attributes']=_[_0x0407('0x2c')](_0x32cb3a[_0x0407('0x29')],qs[_0x0407('0x2e')](_0x5b2f6d[_0x0407('0x2a')][_0x0407('0x2e')]));_0x33a7a4[_0x0407('0x2d')]=_0x33a7a4[_0x0407('0x2d')][_0x0407('0x2f')]?_0x33a7a4[_0x0407('0x2d')]:_0x32cb3a[_0x0407('0x29')];if(_0x5b2f6d[_0x0407('0x2a')][_0x0407('0x3e')]){_0x33a7a4['include']=[{'all':!![]}];}_0x33a7a4=_[_0x0407('0x38')]({},_0x33a7a4,_0x5b2f6d[_0x0407('0x46')]);return db[_0x0407('0x27')][_0x0407('0x47')](_0x33a7a4)[_0x0407('0x20')](handleEntityNotFound(_0x440961,null))['then'](respondWithResult(_0x440961,null))[_0x0407('0x43')](handleError(_0x440961,null));};exports['create']=function(_0x349a2a,_0x166b69){return db['VoiceCallReport']['create'](_0x349a2a[_0x0407('0x48')],{})['then'](respondWithResult(_0x166b69,0xc9))[_0x0407('0x43')](handleError(_0x166b69,null));};exports['destroy']=function(_0x1f837b,_0x509dab){return db['VoiceCallReport'][_0x0407('0x47')]({'where':{'id':_0x1f837b[_0x0407('0x45')]['id']}})[_0x0407('0x20')](handleEntityNotFound(_0x509dab,null))[_0x0407('0x20')](removeEntity(_0x509dab,null))[_0x0407('0x43')](handleError(_0x509dab,null));};exports[_0x0407('0x49')]=function(_0x73a4ba,_0xf265ba){return db[_0x0407('0x27')][_0x0407('0x49')]()['then'](respondWithResult(_0xf265ba,null))[_0x0407('0x43')](handleError(_0xf265ba,null));};exports['update']=function(_0x29339d,_0x4eb50c){if(_0x29339d[_0x0407('0x48')][_0x0407('0x4a')]){delete _0x29339d[_0x0407('0x48')][_0x0407('0x4a')];}return db[_0x0407('0x27')]['find']({'where':{'uniqueid':_0x29339d[_0x0407('0x45')]['id'],'UserId':{'$or':[null,_0x29339d[_0x0407('0x4b')]['id']]}}})[_0x0407('0x20')](handleEntityNotFound(_0x4eb50c,null))[_0x0407('0x20')](saveUpdates(_0x29339d[_0x0407('0x48')],null))[_0x0407('0x20')](respondWithResult(_0x4eb50c,null))[_0x0407('0x43')](handleError(_0x4eb50c,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c5bd302..a3a946c 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 _0x73ac=['define','VoiceCallReport','report_call','uniqueid','util','bluebird','request-promise','./voiceCallReport.attributes','exports'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x73ac,0x12d));var _0xc73a=function(_0x32641c,_0x20e8b9){_0x32641c=_0x32641c-0x0;var _0x76cf9e=_0x73ac[_0x32641c];return _0x76cf9e;};'use strict';var _=require('lodash');var util=require(_0xc73a('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc73a('0x1'));var rp=require(_0xc73a('0x2'));var attributes=require(_0xc73a('0x3'));module[_0xc73a('0x4')]=function(_0x1df80f,_0x542eb6){return _0x1df80f[_0xc73a('0x5')](_0xc73a('0x6'),attributes,{'tableName':_0xc73a('0x7'),'paranoid':![],'indexes':[{'fields':[_0xc73a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x22ba=['define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','./voiceCallReport.attributes'];(function(_0x13e1cb,_0x5c0863){var _0x3e5c1c=function(_0x1fc2bd){while(--_0x1fc2bd){_0x13e1cb['push'](_0x13e1cb['shift']());}};_0x3e5c1c(++_0x5c0863);}(_0x22ba,0x17a));var _0xa22b=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x22ba[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0xa22b('0x0'));var util=require(_0xa22b('0x1'));var logger=require(_0xa22b('0x2'))('api');var moment=require(_0xa22b('0x3'));var BPromise=require(_0xa22b('0x4'));var rp=require(_0xa22b('0x5'));var attributes=require(_0xa22b('0x6'));module['exports']=function(_0x185a52,_0x64419e){return _0x185a52[_0xa22b('0x7')](_0xa22b('0x8'),attributes,{'tableName':_0xa22b('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa22b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 7c40188..a7d0f2f 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 _0x7d25=['../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','create','body','then','CreateVoiceCallReport','update','UpdateVoiceCallReport','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x194f9a,_0xe8ab5b){var _0x183bb2=function(_0x27737f){while(--_0x27737f){_0x194f9a['push'](_0x194f9a['shift']());}};_0x183bb2(++_0xe8ab5b);}(_0x7d25,0x177));var _0x57d2=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x7d25[_0x500419];return _0x241c1a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x57d2('0x0'));var BPromise=require('bluebird');var rs=require(_0x57d2('0x1'));var fs=require('fs');var Redis=require(_0x57d2('0x2'));var db=require(_0x57d2('0x3'))['db'];var utils=require(_0x57d2('0x4'));var logger=require(_0x57d2('0x5'))(_0x57d2('0x6'));var config=require(_0x57d2('0x7'));var jayson=require(_0x57d2('0x8'));var client=jayson['client'][_0x57d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f1dd8,_0x122d83,_0x352741){return new BPromise(function(_0x3e8ac9,_0x1632b6){return client['request'](_0x3f1dd8,_0x352741)['then'](function(_0x115d1d){logger[_0x57d2('0xa')](_0x57d2('0xb'),_0x122d83,_0x57d2('0xc'));logger['debug'](_0x57d2('0xd'),_0x122d83,'request\x20sent',JSON[_0x57d2('0xe')](_0x115d1d));if(_0x115d1d[_0x57d2('0xf')]){if(_0x115d1d[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger['error'](_0x57d2('0xb'),_0x122d83,_0x115d1d['error'][_0x57d2('0x11')]);return _0x1632b6(_0x115d1d[_0x57d2('0xf')]['message']);}logger[_0x57d2('0xf')](_0x57d2('0xb'),_0x122d83,_0x115d1d[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x3e8ac9(_0x115d1d[_0x57d2('0xf')]['message']);}else{logger[_0x57d2('0xa')](_0x57d2('0xb'),_0x122d83,_0x57d2('0xc'));_0x3e8ac9(_0x115d1d[_0x57d2('0x12')][_0x57d2('0x11')]);}})['catch'](function(_0x9cd2b2){logger['error'](_0x57d2('0xb'),_0x122d83,_0x9cd2b2);_0x1632b6(_0x9cd2b2);});});}exports[_0x57d2('0x13')]=function(_0x39c099){var _0x298e22=this;return new Promise(function(_0xe8b091,_0x128cc5){return db[_0x57d2('0x14')][_0x57d2('0x15')]({'raw':_0x39c099[_0x57d2('0x16')]?_0x39c099[_0x57d2('0x16')][_0x57d2('0x17')]===undefined?!![]:![]:!![],'where':_0x39c099['options']?_0x39c099['options'][_0x57d2('0x18')]||null:null,'attributes':_0x39c099[_0x57d2('0x16')]?_0x39c099[_0x57d2('0x16')][_0x57d2('0x19')]||null:null,'limit':_0x39c099['options']?_0x39c099[_0x57d2('0x16')][_0x57d2('0x1a')]||null:null,'include':_0x39c099[_0x57d2('0x16')]?_0x39c099[_0x57d2('0x16')][_0x57d2('0x1b')]?_[_0x57d2('0x1c')](_0x39c099['options'][_0x57d2('0x1b')],function(_0x5ea78a){return{'model':db[_0x5ea78a[_0x57d2('0x1d')]],'as':_0x5ea78a['as'],'attributes':_0x5ea78a[_0x57d2('0x19')],'include':_0x5ea78a[_0x57d2('0x1b')]?_[_0x57d2('0x1c')](_0x5ea78a[_0x57d2('0x1b')],function(_0x2766c1){return{'model':db[_0x2766c1[_0x57d2('0x1d')]],'as':_0x2766c1['as'],'attributes':_0x2766c1[_0x57d2('0x19')],'include':_0x2766c1[_0x57d2('0x1b')]?_['map'](_0x2766c1[_0x57d2('0x1b')],function(_0x337f41){return{'model':db[_0x337f41[_0x57d2('0x1d')]],'as':_0x337f41['as'],'attributes':_0x337f41[_0x57d2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x533868){logger['info'](_0x57d2('0x13'),_0x39c099);logger[_0x57d2('0x1e')](_0x57d2('0x13'),_0x39c099,JSON[_0x57d2('0xe')](_0x533868));_0xe8b091(_0x533868);})[_0x57d2('0x1f')](function(_0x3b473b){logger[_0x57d2('0xf')](_0x57d2('0x13'),_0x3b473b[_0x57d2('0x11')],_0x39c099);_0x128cc5(_0x298e22[_0x57d2('0xf')](0x1f4,_0x3b473b['message']));});});};exports['CreateVoiceCallReport']=function(_0xdd1e3f){var _0x12d23f=this;return new Promise(function(_0x28c3ee,_0x1e56fa){return db[_0x57d2('0x14')][_0x57d2('0x20')](_0xdd1e3f[_0x57d2('0x21')],{'raw':_0xdd1e3f[_0x57d2('0x16')]?_0xdd1e3f[_0x57d2('0x16')][_0x57d2('0x17')]===undefined?!![]:![]:!![]})[_0x57d2('0x22')](function(_0x271c5d){logger[_0x57d2('0xa')]('CreateVoiceCallReport',_0xdd1e3f);logger[_0x57d2('0x1e')](_0x57d2('0x23'),_0xdd1e3f,JSON[_0x57d2('0xe')](_0x271c5d));_0x28c3ee(_0x271c5d);})[_0x57d2('0x1f')](function(_0x234919){logger[_0x57d2('0xf')](_0x57d2('0x23'),_0x234919[_0x57d2('0x11')],_0xdd1e3f);_0x1e56fa(_0x12d23f[_0x57d2('0xf')](0x1f4,_0x234919[_0x57d2('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0x5f2f8e){var _0x22e810=this;return new Promise(function(_0x5aa4bd,_0x386bbd){return db['VoiceCallReport'][_0x57d2('0x24')](_0x5f2f8e['body'],{'raw':_0x5f2f8e[_0x57d2('0x16')]?_0x5f2f8e[_0x57d2('0x16')][_0x57d2('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f2f8e[_0x57d2('0x16')]?_0x5f2f8e[_0x57d2('0x16')]['where']||null:null,'attributes':_0x5f2f8e[_0x57d2('0x16')]?_0x5f2f8e[_0x57d2('0x16')][_0x57d2('0x19')]||null:null,'limit':_0x5f2f8e[_0x57d2('0x16')]?_0x5f2f8e['options'][_0x57d2('0x1a')]||null:null})['then'](function(_0x2f7ff4){logger[_0x57d2('0xa')](_0x57d2('0x25'),_0x5f2f8e);logger[_0x57d2('0x1e')](_0x57d2('0x25'),_0x5f2f8e,JSON[_0x57d2('0xe')](_0x2f7ff4));_0x5aa4bd(_0x2f7ff4);})[_0x57d2('0x1f')](function(_0x269aec){logger[_0x57d2('0xf')](_0x57d2('0x25'),_0x269aec[_0x57d2('0x11')],_0x5f2f8e);_0x386bbd(_0x22e810[_0x57d2('0xf')](0x1f4,_0x269aec[_0x57d2('0x11')]));});});}; \ No newline at end of file +var _0xc7a9=['CreateVoiceCallReport','create','UpdateVoiceCallReport','VoiceCallReport','update','body','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','info','result','findAll','raw','options','where','include','map','model','attributes','catch'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xc7a9,0x13f));var _0x9c7a=function(_0x13a6cb,_0x10946e){_0x13a6cb=_0x13a6cb-0x0;var _0x3f0458=_0xc7a9[_0x13a6cb];return _0x3f0458;};'use strict';var _=require('lodash');var util=require(_0x9c7a('0x0'));var moment=require(_0x9c7a('0x1'));var BPromise=require(_0x9c7a('0x2'));var rs=require(_0x9c7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c7a('0x4'))['db'];var utils=require(_0x9c7a('0x5'));var logger=require('../../config/logger')(_0x9c7a('0x6'));var config=require(_0x9c7a('0x7'));var jayson=require(_0x9c7a('0x8'));var client=jayson[_0x9c7a('0x9')][_0x9c7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x76c50d,_0x58f2f8,_0x31beaf){return new BPromise(function(_0x4ee3d7,_0xc11bb1){return client[_0x9c7a('0xb')](_0x76c50d,_0x31beaf)[_0x9c7a('0xc')](function(_0xb47407){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x58f2f8,_0x9c7a('0xd'));logger[_0x9c7a('0xe')](_0x9c7a('0xf'),_0x58f2f8,'request\x20sent',JSON[_0x9c7a('0x10')](_0xb47407));if(_0xb47407[_0x9c7a('0x11')]){if(_0xb47407['error'][_0x9c7a('0x12')]===0x1f4){logger['error'](_0x9c7a('0x13'),_0x58f2f8,_0xb47407[_0x9c7a('0x11')]['message']);return _0xc11bb1(_0xb47407['error'][_0x9c7a('0x14')]);}logger[_0x9c7a('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x58f2f8,_0xb47407[_0x9c7a('0x11')][_0x9c7a('0x14')]);return _0x4ee3d7(_0xb47407[_0x9c7a('0x11')]['message']);}else{logger[_0x9c7a('0x15')](_0x9c7a('0x13'),_0x58f2f8,'request\x20sent');_0x4ee3d7(_0xb47407[_0x9c7a('0x16')][_0x9c7a('0x14')]);}})['catch'](function(_0x599025){logger[_0x9c7a('0x11')](_0x9c7a('0x13'),_0x58f2f8,_0x599025);_0xc11bb1(_0x599025);});});}exports['GetVoiceCallReport']=function(_0x5479d8){var _0x636324=this;return new Promise(function(_0x50e0e1,_0x424181){return db['VoiceCallReport'][_0x9c7a('0x17')]({'raw':_0x5479d8['options']?_0x5479d8['options'][_0x9c7a('0x18')]===undefined?!![]:![]:!![],'where':_0x5479d8[_0x9c7a('0x19')]?_0x5479d8[_0x9c7a('0x19')][_0x9c7a('0x1a')]||null:null,'attributes':_0x5479d8[_0x9c7a('0x19')]?_0x5479d8[_0x9c7a('0x19')]['attributes']||null:null,'limit':_0x5479d8[_0x9c7a('0x19')]?_0x5479d8[_0x9c7a('0x19')]['limit']||null:null,'include':_0x5479d8[_0x9c7a('0x19')]?_0x5479d8['options'][_0x9c7a('0x1b')]?_[_0x9c7a('0x1c')](_0x5479d8['options'][_0x9c7a('0x1b')],function(_0x4c4486){return{'model':db[_0x4c4486[_0x9c7a('0x1d')]],'as':_0x4c4486['as'],'attributes':_0x4c4486[_0x9c7a('0x1e')],'include':_0x4c4486[_0x9c7a('0x1b')]?_[_0x9c7a('0x1c')](_0x4c4486[_0x9c7a('0x1b')],function(_0x2e9cdf){return{'model':db[_0x2e9cdf[_0x9c7a('0x1d')]],'as':_0x2e9cdf['as'],'attributes':_0x2e9cdf['attributes'],'include':_0x2e9cdf[_0x9c7a('0x1b')]?_[_0x9c7a('0x1c')](_0x2e9cdf[_0x9c7a('0x1b')],function(_0x249c4c){return{'model':db[_0x249c4c[_0x9c7a('0x1d')]],'as':_0x249c4c['as'],'attributes':_0x249c4c[_0x9c7a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9c7a('0xc')](function(_0x57d270){logger[_0x9c7a('0x15')]('GetVoiceCallReport',_0x5479d8);logger[_0x9c7a('0xe')]('GetVoiceCallReport',_0x5479d8,JSON['stringify'](_0x57d270));_0x50e0e1(_0x57d270);})[_0x9c7a('0x1f')](function(_0x418d3c){logger['error']('GetVoiceCallReport',_0x418d3c[_0x9c7a('0x14')],_0x5479d8);_0x424181(_0x636324[_0x9c7a('0x11')](0x1f4,_0x418d3c[_0x9c7a('0x14')]));});});};exports[_0x9c7a('0x20')]=function(_0x57cf89){var _0x581bfe=this;return new Promise(function(_0x26f43a,_0x1ea693){return db['VoiceCallReport'][_0x9c7a('0x21')](_0x57cf89['body'],{'raw':_0x57cf89['options']?_0x57cf89[_0x9c7a('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x9c7a('0xc')](function(_0x15796e){logger[_0x9c7a('0x15')](_0x9c7a('0x20'),_0x57cf89);logger[_0x9c7a('0xe')](_0x9c7a('0x20'),_0x57cf89,JSON[_0x9c7a('0x10')](_0x15796e));_0x26f43a(_0x15796e);})[_0x9c7a('0x1f')](function(_0x3dcbbf){logger['error'](_0x9c7a('0x20'),_0x3dcbbf[_0x9c7a('0x14')],_0x57cf89);_0x1ea693(_0x581bfe[_0x9c7a('0x11')](0x1f4,_0x3dcbbf[_0x9c7a('0x14')]));});});};exports[_0x9c7a('0x22')]=function(_0x4cac7e){var _0x2f0e8d=this;return new Promise(function(_0x591222,_0x343114){return db[_0x9c7a('0x23')][_0x9c7a('0x24')](_0x4cac7e[_0x9c7a('0x25')],{'raw':_0x4cac7e[_0x9c7a('0x19')]?_0x4cac7e[_0x9c7a('0x19')][_0x9c7a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cac7e[_0x9c7a('0x19')]?_0x4cac7e[_0x9c7a('0x19')][_0x9c7a('0x1a')]||null:null,'attributes':_0x4cac7e[_0x9c7a('0x19')]?_0x4cac7e[_0x9c7a('0x19')][_0x9c7a('0x1e')]||null:null,'limit':_0x4cac7e['options']?_0x4cac7e['options'][_0x9c7a('0x26')]||null:null})['then'](function(_0x2bb9ef){logger[_0x9c7a('0x15')]('UpdateVoiceCallReport',_0x4cac7e);logger[_0x9c7a('0xe')](_0x9c7a('0x22'),_0x4cac7e,JSON[_0x9c7a('0x10')](_0x2bb9ef));_0x591222(_0x2bb9ef);})['catch'](function(_0x474853){logger[_0x9c7a('0x11')]('UpdateVoiceCallReport',_0x474853[_0x9c7a('0x14')],_0x4cac7e);_0x343114(_0x2f0e8d['error'](0x1f4,_0x474853[_0x9c7a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index a1ba7a4..4a4d9c0 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 _0xa077=['isAuthenticated','index','/:id','show','post','create','put','update','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x26da5e,_0x2f4830){var _0x19932c=function(_0x681c95){while(--_0x681c95){_0x26da5e['push'](_0x26da5e['shift']());}};_0x19932c(++_0x2f4830);}(_0xa077,0xb8));var _0x7a07=function(_0x2d5c39,_0x1ae130){_0x2d5c39=_0x2d5c39-0x0;var _0x1a2a1a=_0xa077[_0x2d5c39];return _0x1a2a1a;};'use strict';var multer=require(_0x7a07('0x0'));var util=require('util');var path=require(_0x7a07('0x1'));var timeout=require(_0x7a07('0x2'));var express=require(_0x7a07('0x3'));var router=express[_0x7a07('0x4')]();var auth=require(_0x7a07('0x5'));var interaction=require(_0x7a07('0x6'));var config=require(_0x7a07('0x7'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x7a07('0x8')](),controller[_0x7a07('0x9')]);router['get'](_0x7a07('0xa'),auth[_0x7a07('0x8')](),controller[_0x7a07('0xb')]);router[_0x7a07('0xc')]('/',auth[_0x7a07('0x8')](),controller[_0x7a07('0xd')]);router[_0x7a07('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7a07('0xf')]);router['delete'](_0x7a07('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3c17=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x3c17,0x1b6));var _0x73c1=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x3c17[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x73c1('0x0'));var util=require(_0x73c1('0x1'));var path=require(_0x73c1('0x2'));var timeout=require(_0x73c1('0x3'));var express=require(_0x73c1('0x4'));var router=express[_0x73c1('0x5')]();var auth=require(_0x73c1('0x6'));var interaction=require(_0x73c1('0x7'));var config=require(_0x73c1('0x8'));var controller=require(_0x73c1('0x9'));router['get']('/',auth[_0x73c1('0xa')](),controller[_0x73c1('0xb')]);router[_0x73c1('0xc')](_0x73c1('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x73c1('0xa')](),controller['create']);router[_0x73c1('0xe')](_0x73c1('0xd'),auth[_0x73c1('0xa')](),controller['update']);router['delete'](_0x73c1('0xd'),auth[_0x73c1('0xa')](),controller[_0x73c1('0xf')]);module[_0x73c1('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index f1a950b..9f4beb7 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 _0xf29c=['setDataValue','getDataValue','options','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x3c6a3b,_0x362ae6){var _0x1c474e=function(_0x2d5cb6){while(--_0x2d5cb6){_0x3c6a3b['push'](_0x3c6a3b['shift']());}};_0x1c474e(++_0x362ae6);}(_0xf29c,0x64));var _0xcf29=function(_0x3f842f,_0x2cac87){_0x3f842f=_0x3f842f-0x0;var _0x4f4f30=_0xf29c[_0x3f842f];return _0x4f4f30;};'use strict';var Sequelize=require(_0xcf29('0x0'));module[_0xcf29('0x1')]={'name':{'type':Sequelize[_0xcf29('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xcf29('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xcf29('0x2')],'set':function(_0x40e922){this[_0xcf29('0x4')]('options',_0x40e922?_0x40e922['join'](''):[]);},'get':function(){return this[_0xcf29('0x5')](_0xcf29('0x6'))?this['getDataValue'](_0xcf29('0x6'))['split'](''):[];}},'auth':{'type':Sequelize[_0xcf29('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xcf29('0x2')]},'record':{'type':Sequelize[_0xcf29('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xcf29('0x2')]},'description':{'type':Sequelize[_0xcf29('0x2')]}}; \ No newline at end of file +var _0xc695=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xc695,0x11b));var _0x5c69=function(_0x4a1e96,_0x143e6b){_0x4a1e96=_0x4a1e96-0x0;var _0x5acea9=_0xc695[_0x4a1e96];return _0x5acea9;};'use strict';var Sequelize=require(_0x5c69('0x0'));module[_0x5c69('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5c69('0x2')],'unique':_0x5c69('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x5c69('0x2')],'set':function(_0x280d64){this[_0x5c69('0x4')](_0x5c69('0x5'),_0x280d64?_0x280d64[_0x5c69('0x6')](''):[]);},'get':function(){return this[_0x5c69('0x7')](_0x5c69('0x5'))?this[_0x5c69('0x7')](_0x5c69('0x5'))[_0x5c69('0x8')](''):[];}},'auth':{'type':Sequelize[_0x5c69('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x5c69('0x2')]},'record':{'type':Sequelize[_0x5c69('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5c69('0x2')]},'description':{'type':Sequelize[_0x5c69('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 7af91dc..64d904a 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 _0xa703=['model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','key','VIRTUAL','VoiceChanSpy','includeAll','rows','catch','params','keys','include','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','destroy','ChanSpies','UserProfileResource','error','stack','rawAttributes'];(function(_0x7d0425,_0x493c72){var _0x36a572=function(_0x23f3c5){while(--_0x23f3c5){_0x7d0425['push'](_0x7d0425['shift']());}};_0x36a572(++_0x493c72);}(_0xa703,0x194));var _0x3a70=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xa703[_0x487b0c];return _0x1adbdc;};'use strict';var pdf=require(_0x3a70('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3a70('0x1'));var zipdir=require(_0x3a70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a70('0x3'));var moment=require('moment');var BPromise=require(_0x3a70('0x4'));var Mustache=require(_0x3a70('0x5'));var util=require('util');var path=require(_0x3a70('0x6'));var sox=require(_0x3a70('0x7'));var csv=require(_0x3a70('0x8'));var ejs=require(_0x3a70('0x9'));var fs=require('fs');var _=require(_0x3a70('0xa'));var squel=require(_0x3a70('0xb'));var crypto=require(_0x3a70('0xc'));var jsforce=require(_0x3a70('0xd'));var deskjs=require(_0x3a70('0xe'));var toCsv=require(_0x3a70('0x8'));var querystring=require(_0x3a70('0xf'));var Papa=require(_0x3a70('0x10'));var authService=require(_0x3a70('0x11'));var hardwareService=require(_0x3a70('0x12'));var Redis=require('ioredis');var qs=require(_0x3a70('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3a70('0x14'));var config=require(_0x3a70('0x15'));var db=require(_0x3a70('0x16'))['db'];function respondWithStatusCode(_0x5c831e,_0x499c36){_0x499c36=_0x499c36||0xcc;return function(_0x5b1ade){if(_0x5b1ade){return _0x5c831e[_0x3a70('0x17')](_0x499c36);}return _0x5c831e[_0x3a70('0x18')](_0x499c36)[_0x3a70('0x19')]();};}function respondWithResult(_0x4fcb09,_0xa8d9c2){_0xa8d9c2=_0xa8d9c2||0xc8;return function(_0x39dd02){if(_0x39dd02){return _0x4fcb09[_0x3a70('0x18')](_0xa8d9c2)[_0x3a70('0x1a')](_0x39dd02);}};}function respondWithFilteredResult(_0x12338b,_0x3126f7){return function(_0x554bb1){if(_0x554bb1){var _0x4d4c87=_0x554bb1[_0x3a70('0x1b')],_0x1ea677=_0x3126f7[_0x3a70('0x1c')],_0x30536d=_0x3126f7[_0x3a70('0x1c')]+_0x3126f7[_0x3a70('0x1d')],_0x384ca3;if(_0x30536d>=_0x4d4c87){_0x30536d=_0x4d4c87;_0x384ca3=0xc8;}else{_0x384ca3=0xce;}_0x12338b[_0x3a70('0x18')](_0x384ca3);return _0x12338b['set'](_0x3a70('0x1e'),_0x1ea677+'-'+_0x30536d+'/'+_0x4d4c87)[_0x3a70('0x1a')](_0x554bb1);}return null;};}function patchUpdates(_0x10e1df){return function(_0x5dff03){try{jsonpatch['apply'](_0x5dff03,_0x10e1df,!![]);}catch(_0x541b5c){return BPromise[_0x3a70('0x1f')](_0x541b5c);}return _0x5dff03[_0x3a70('0x20')]();};}function saveUpdates(_0x2c8714,_0x4b5365){return function(_0x220609){if(_0x220609){return _0x220609['update'](_0x2c8714)[_0x3a70('0x21')](function(_0x1320e6){return _0x1320e6;});}return null;};}function removeEntity(_0x71941,_0x4dd6de){return function(_0x2ac678){if(_0x2ac678){return _0x2ac678[_0x3a70('0x22')]()[_0x3a70('0x21')](function(){var _0x592f62=_0x2ac678['get']({'plain':!![]});var _0x148e16=_0x3a70('0x23');return db[_0x3a70('0x24')][_0x3a70('0x22')]({'where':{'type':_0x148e16,'resourceId':_0x592f62['id']}})[_0x3a70('0x21')](function(){return _0x2ac678;});})[_0x3a70('0x21')](function(){_0x71941[_0x3a70('0x18')](0xcc)[_0x3a70('0x19')]();});}};}function handleEntityNotFound(_0x1ad53f,_0x1ceda1){return function(_0x992ade){if(!_0x992ade){_0x1ad53f[_0x3a70('0x17')](0x194);}return _0x992ade;};}function handleError(_0xc9ca4,_0x2d9a82){_0x2d9a82=_0x2d9a82||0x1f4;return function(_0x4a785d){logger[_0x3a70('0x25')](_0x4a785d[_0x3a70('0x26')]);if(_0x4a785d['name']){delete _0x4a785d['name'];}_0xc9ca4[_0x3a70('0x18')](_0x2d9a82)['send'](_0x4a785d);};}exports['index']=function(_0x117225,_0x1a84a4){var _0x1c4a6d={},_0x52e015={},_0x509779={'count':0x0,'rows':[]};var _0x5a2b51=db['VoiceChanSpy'][_0x3a70('0x27')];_0x52e015[_0x3a70('0x28')]=_['keys'](_0x5a2b51);_0x52e015[_0x3a70('0x29')]=_['keys'](_0x117225[_0x3a70('0x29')]);_0x52e015['filters']=_[_0x3a70('0x2a')](_0x52e015[_0x3a70('0x28')],_0x52e015[_0x3a70('0x29')]);_0x1c4a6d[_0x3a70('0x2b')]=_[_0x3a70('0x2a')](_0x52e015['model'],qs[_0x3a70('0x2c')](_0x117225['query'][_0x3a70('0x2c')]));_0x1c4a6d[_0x3a70('0x2b')]=_0x1c4a6d[_0x3a70('0x2b')][_0x3a70('0x2d')]?_0x1c4a6d['attributes']:_0x52e015[_0x3a70('0x28')];if(!_0x117225['query'][_0x3a70('0x2e')](_0x3a70('0x2f'))){_0x1c4a6d['limit']=qs[_0x3a70('0x1d')](_0x117225[_0x3a70('0x29')]['limit']);_0x1c4a6d['offset']=qs[_0x3a70('0x1c')](_0x117225[_0x3a70('0x29')][_0x3a70('0x1c')]);}_0x1c4a6d['order']=qs['sort'](_0x117225[_0x3a70('0x29')][_0x3a70('0x30')]);_0x1c4a6d[_0x3a70('0x31')]=qs[_0x3a70('0x32')](_[_0x3a70('0x33')](_0x117225['query'],_0x52e015[_0x3a70('0x32')]));if(_0x117225[_0x3a70('0x29')][_0x3a70('0x34')]){_0x1c4a6d[_0x3a70('0x31')]=_['merge'](_0x1c4a6d[_0x3a70('0x31')],{'$or':_[_0x3a70('0x35')](_0x5a2b51,function(_0x22ed9e){if(_0x22ed9e[_0x3a70('0x36')][_0x3a70('0x37')]!==_0x3a70('0x38')){var _0x18849d={};_0x18849d[_0x22ed9e['field']]={'$like':'%'+_0x117225[_0x3a70('0x29')][_0x3a70('0x34')]+'%'};return _0x18849d;}})});}_0x1c4a6d=_['merge']({},_0x1c4a6d,_0x117225['options']);var _0x149619={'where':_0x1c4a6d[_0x3a70('0x31')]};return db[_0x3a70('0x39')]['count'](_0x149619)[_0x3a70('0x21')](function(_0x414015){_0x509779[_0x3a70('0x1b')]=_0x414015;if(_0x117225['query'][_0x3a70('0x3a')]){_0x1c4a6d['include']=[{'all':!![]}];}return db[_0x3a70('0x39')]['findAll'](_0x1c4a6d);})[_0x3a70('0x21')](function(_0x3eb7c4){_0x509779[_0x3a70('0x3b')]=_0x3eb7c4;return _0x509779;})[_0x3a70('0x21')](respondWithFilteredResult(_0x1a84a4,_0x1c4a6d))[_0x3a70('0x3c')](handleError(_0x1a84a4,null));};exports['show']=function(_0x4558d7,_0x3f2904){var _0x29569e={'raw':![],'where':{'id':_0x4558d7[_0x3a70('0x3d')]['id']}},_0x3384d7={};_0x3384d7[_0x3a70('0x28')]=_[_0x3a70('0x3e')](db[_0x3a70('0x39')]['rawAttributes']);_0x3384d7[_0x3a70('0x29')]=_['keys'](_0x4558d7[_0x3a70('0x29')]);_0x3384d7[_0x3a70('0x32')]=_[_0x3a70('0x2a')](_0x3384d7[_0x3a70('0x28')],_0x3384d7[_0x3a70('0x29')]);_0x29569e[_0x3a70('0x2b')]=_[_0x3a70('0x2a')](_0x3384d7[_0x3a70('0x28')],qs[_0x3a70('0x2c')](_0x4558d7[_0x3a70('0x29')][_0x3a70('0x2c')]));_0x29569e[_0x3a70('0x2b')]=_0x29569e[_0x3a70('0x2b')][_0x3a70('0x2d')]?_0x29569e[_0x3a70('0x2b')]:_0x3384d7['model'];if(_0x4558d7[_0x3a70('0x29')][_0x3a70('0x3a')]){_0x29569e[_0x3a70('0x3f')]=[{'all':!![]}];}_0x29569e=_[_0x3a70('0x40')]({},_0x29569e,_0x4558d7['options']);return db[_0x3a70('0x39')][_0x3a70('0x41')](_0x29569e)[_0x3a70('0x21')](handleEntityNotFound(_0x3f2904,null))['then'](respondWithResult(_0x3f2904,null))[_0x3a70('0x3c')](handleError(_0x3f2904,null));};exports[_0x3a70('0x42')]=function(_0x3797ce,_0x3fdb97){return db[_0x3a70('0x39')][_0x3a70('0x42')](_0x3797ce['body'],{})[_0x3a70('0x21')](function(_0xb39d69){var _0x2e69cd=_0x3797ce['user']['get']({'plain':!![]});if(!_0x2e69cd)throw new Error(_0x3a70('0x43'));if(_0x2e69cd[_0x3a70('0x44')]==='user'){var _0x5f4509=_0xb39d69[_0x3a70('0x45')]({'plain':!![]});var _0x2392af=_0x3a70('0x23');return db[_0x3a70('0x46')]['find']({'where':{'name':_0x2392af,'userProfileId':_0x2e69cd['userProfileId']},'raw':!![]})['then'](function(_0x4787c3){if(_0x4787c3&&_0x4787c3[_0x3a70('0x47')]===0x0){return db[_0x3a70('0x24')][_0x3a70('0x42')]({'name':_0x5f4509['name'],'resourceId':_0x5f4509['id'],'type':_0x4787c3['name'],'sectionId':_0x4787c3['id']},{})[_0x3a70('0x21')](function(){return _0xb39d69;});}else{return _0xb39d69;}})['catch'](function(_0x494180){logger[_0x3a70('0x25')](_0x3a70('0x48'),_0x494180);throw _0x494180;});}return _0xb39d69;})['then'](respondWithResult(_0x3fdb97,0xc9))[_0x3a70('0x3c')](handleError(_0x3fdb97,null));};exports['update']=function(_0x3a8a28,_0x31d744){if(_0x3a8a28[_0x3a70('0x49')]['id']){delete _0x3a8a28[_0x3a70('0x49')]['id'];}return db[_0x3a70('0x39')][_0x3a70('0x41')]({'where':{'id':_0x3a8a28[_0x3a70('0x3d')]['id']}})[_0x3a70('0x21')](handleEntityNotFound(_0x31d744,null))[_0x3a70('0x21')](saveUpdates(_0x3a8a28[_0x3a70('0x49')],null))[_0x3a70('0x21')](respondWithResult(_0x31d744,null))[_0x3a70('0x3c')](handleError(_0x31d744,null));};exports[_0x3a70('0x22')]=function(_0x4ec770,_0x225d5d){return db[_0x3a70('0x39')][_0x3a70('0x41')]({'where':{'id':_0x4ec770[_0x3a70('0x3d')]['id']}})[_0x3a70('0x21')](handleEntityNotFound(_0x225d5d,null))[_0x3a70('0x21')](removeEntity(_0x225d5d,null))[_0x3a70('0x3c')](handleError(_0x225d5d,null));}; \ No newline at end of file +var _0x5652=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','field','VoiceChanSpy','includeAll','include','findAll','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x5ba9b6,_0x37cf9e){var _0x3732fe=function(_0x2b0924){while(--_0x2b0924){_0x5ba9b6['push'](_0x5ba9b6['shift']());}};_0x3732fe(++_0x37cf9e);}(_0x5652,0xea));var _0x2565=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x5652[_0x75f869];return _0x10af8b;};'use strict';var pdf=require(_0x2565('0x0'));var emlformat=require(_0x2565('0x1'));var rimraf=require(_0x2565('0x2'));var zipdir=require(_0x2565('0x3'));var jsonpatch=require(_0x2565('0x4'));var rp=require('request-promise');var moment=require(_0x2565('0x5'));var BPromise=require(_0x2565('0x6'));var Mustache=require(_0x2565('0x7'));var util=require('util');var path=require(_0x2565('0x8'));var sox=require(_0x2565('0x9'));var csv=require(_0x2565('0xa'));var ejs=require(_0x2565('0xb'));var fs=require('fs');var _=require(_0x2565('0xc'));var squel=require(_0x2565('0xd'));var crypto=require(_0x2565('0xe'));var jsforce=require(_0x2565('0xf'));var deskjs=require(_0x2565('0x10'));var toCsv=require(_0x2565('0xa'));var querystring=require(_0x2565('0x11'));var Papa=require('papaparse');var authService=require(_0x2565('0x12'));var hardwareService=require(_0x2565('0x13'));var Redis=require(_0x2565('0x14'));var qs=require(_0x2565('0x15'));var logger=require(_0x2565('0x16'))(_0x2565('0x17'));var utils=require('../../config/utils');var config=require(_0x2565('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x69ffbc,_0x5108b3){_0x5108b3=_0x5108b3||0xcc;return function(_0x367c1a){if(_0x367c1a){return _0x69ffbc[_0x2565('0x19')](_0x5108b3);}return _0x69ffbc[_0x2565('0x1a')](_0x5108b3)[_0x2565('0x1b')]();};}function respondWithResult(_0x5c8662,_0x18505b){_0x18505b=_0x18505b||0xc8;return function(_0x363a40){if(_0x363a40){return _0x5c8662[_0x2565('0x1a')](_0x18505b)[_0x2565('0x1c')](_0x363a40);}};}function respondWithFilteredResult(_0x5dd977,_0x457c9a){return function(_0x5cf2c5){if(_0x5cf2c5){var _0x2cdb82=_0x5cf2c5[_0x2565('0x1d')],_0x29f401=_0x457c9a['offset'],_0x4f0266=_0x457c9a[_0x2565('0x1e')]+_0x457c9a[_0x2565('0x1f')],_0x5a19c4;if(_0x4f0266>=_0x2cdb82){_0x4f0266=_0x2cdb82;_0x5a19c4=0xc8;}else{_0x5a19c4=0xce;}_0x5dd977[_0x2565('0x1a')](_0x5a19c4);return _0x5dd977[_0x2565('0x20')](_0x2565('0x21'),_0x29f401+'-'+_0x4f0266+'/'+_0x2cdb82)[_0x2565('0x1c')](_0x5cf2c5);}return null;};}function patchUpdates(_0x1a3891){return function(_0x17c33a){try{jsonpatch[_0x2565('0x22')](_0x17c33a,_0x1a3891,!![]);}catch(_0x43b7c1){return BPromise[_0x2565('0x23')](_0x43b7c1);}return _0x17c33a[_0x2565('0x24')]();};}function saveUpdates(_0x5b82d1,_0x58bda2){return function(_0x4d36f5){if(_0x4d36f5){return _0x4d36f5[_0x2565('0x25')](_0x5b82d1)[_0x2565('0x26')](function(_0x472318){return _0x472318;});}return null;};}function removeEntity(_0x337333,_0x17a683){return function(_0x1ecadb){if(_0x1ecadb){return _0x1ecadb[_0x2565('0x27')]()[_0x2565('0x26')](function(){var _0x30ae5f=_0x1ecadb[_0x2565('0x28')]({'plain':!![]});var _0x1a3207=_0x2565('0x29');return db[_0x2565('0x2a')]['destroy']({'where':{'type':_0x1a3207,'resourceId':_0x30ae5f['id']}})[_0x2565('0x26')](function(){return _0x1ecadb;});})[_0x2565('0x26')](function(){_0x337333['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a37b,_0x550f42){return function(_0x49eab0){if(!_0x49eab0){_0x15a37b[_0x2565('0x19')](0x194);}return _0x49eab0;};}function handleError(_0x471f17,_0x399fb6){_0x399fb6=_0x399fb6||0x1f4;return function(_0x4ff4ed){logger[_0x2565('0x2b')](_0x4ff4ed[_0x2565('0x2c')]);if(_0x4ff4ed[_0x2565('0x2d')]){delete _0x4ff4ed['name'];}_0x471f17[_0x2565('0x1a')](_0x399fb6)['send'](_0x4ff4ed);};}exports['index']=function(_0x4d97a7,_0x2dd610){var _0x26d683={},_0x15a52d={},_0x414ab7={'count':0x0,'rows':[]};var _0x589afa=db['VoiceChanSpy'][_0x2565('0x2e')];_0x15a52d[_0x2565('0x2f')]=_[_0x2565('0x30')](_0x589afa);_0x15a52d[_0x2565('0x31')]=_[_0x2565('0x30')](_0x4d97a7[_0x2565('0x31')]);_0x15a52d[_0x2565('0x32')]=_[_0x2565('0x33')](_0x15a52d[_0x2565('0x2f')],_0x15a52d[_0x2565('0x31')]);_0x26d683[_0x2565('0x34')]=_[_0x2565('0x33')](_0x15a52d[_0x2565('0x2f')],qs[_0x2565('0x35')](_0x4d97a7[_0x2565('0x31')][_0x2565('0x35')]));_0x26d683[_0x2565('0x34')]=_0x26d683[_0x2565('0x34')][_0x2565('0x36')]?_0x26d683[_0x2565('0x34')]:_0x15a52d[_0x2565('0x2f')];if(!_0x4d97a7[_0x2565('0x31')][_0x2565('0x37')](_0x2565('0x38'))){_0x26d683[_0x2565('0x1f')]=qs[_0x2565('0x1f')](_0x4d97a7['query']['limit']);_0x26d683[_0x2565('0x1e')]=qs['offset'](_0x4d97a7['query'][_0x2565('0x1e')]);}_0x26d683[_0x2565('0x39')]=qs['sort'](_0x4d97a7[_0x2565('0x31')][_0x2565('0x3a')]);_0x26d683[_0x2565('0x3b')]=qs[_0x2565('0x32')](_[_0x2565('0x3c')](_0x4d97a7[_0x2565('0x31')],_0x15a52d['filters']));if(_0x4d97a7[_0x2565('0x31')]['filter']){_0x26d683[_0x2565('0x3b')]=_[_0x2565('0x3d')](_0x26d683[_0x2565('0x3b')],{'$or':_['map'](_0x589afa,function(_0x323d04){if(_0x323d04[_0x2565('0x3e')][_0x2565('0x3f')]!==_0x2565('0x40')){var _0x56fc7b={};_0x56fc7b[_0x323d04[_0x2565('0x41')]]={'$like':'%'+_0x4d97a7[_0x2565('0x31')]['filter']+'%'};return _0x56fc7b;}})});}_0x26d683=_[_0x2565('0x3d')]({},_0x26d683,_0x4d97a7['options']);var _0x3d560c={'where':_0x26d683[_0x2565('0x3b')]};return db[_0x2565('0x42')]['count'](_0x3d560c)[_0x2565('0x26')](function(_0x8bb7e8){_0x414ab7[_0x2565('0x1d')]=_0x8bb7e8;if(_0x4d97a7[_0x2565('0x31')][_0x2565('0x43')]){_0x26d683[_0x2565('0x44')]=[{'all':!![]}];}return db[_0x2565('0x42')][_0x2565('0x45')](_0x26d683);})['then'](function(_0x5ed108){_0x414ab7['rows']=_0x5ed108;return _0x414ab7;})[_0x2565('0x26')](respondWithFilteredResult(_0x2dd610,_0x26d683))[_0x2565('0x46')](handleError(_0x2dd610,null));};exports[_0x2565('0x47')]=function(_0x2e56e7,_0x18f2c6){var _0x1d4a99={'raw':![],'where':{'id':_0x2e56e7[_0x2565('0x48')]['id']}},_0x472433={};_0x472433['model']=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x472433[_0x2565('0x31')]=_[_0x2565('0x30')](_0x2e56e7[_0x2565('0x31')]);_0x472433['filters']=_['intersection'](_0x472433[_0x2565('0x2f')],_0x472433['query']);_0x1d4a99['attributes']=_[_0x2565('0x33')](_0x472433['model'],qs[_0x2565('0x35')](_0x2e56e7[_0x2565('0x31')][_0x2565('0x35')]));_0x1d4a99[_0x2565('0x34')]=_0x1d4a99[_0x2565('0x34')]['length']?_0x1d4a99[_0x2565('0x34')]:_0x472433[_0x2565('0x2f')];if(_0x2e56e7['query']['includeAll']){_0x1d4a99['include']=[{'all':!![]}];}_0x1d4a99=_[_0x2565('0x3d')]({},_0x1d4a99,_0x2e56e7['options']);return db[_0x2565('0x42')][_0x2565('0x49')](_0x1d4a99)[_0x2565('0x26')](handleEntityNotFound(_0x18f2c6,null))[_0x2565('0x26')](respondWithResult(_0x18f2c6,null))['catch'](handleError(_0x18f2c6,null));};exports['create']=function(_0x31adf5,_0x483f44){return db[_0x2565('0x42')]['create'](_0x31adf5[_0x2565('0x4a')],{})['then'](function(_0x4220f4){var _0x2d23d5=_0x31adf5[_0x2565('0x4b')][_0x2565('0x28')]({'plain':!![]});if(!_0x2d23d5)throw new Error(_0x2565('0x4c'));if(_0x2d23d5[_0x2565('0x4d')]===_0x2565('0x4b')){var _0x502620=_0x4220f4[_0x2565('0x28')]({'plain':!![]});var _0x3f7fee=_0x2565('0x29');return db[_0x2565('0x4e')]['find']({'where':{'name':_0x3f7fee,'userProfileId':_0x2d23d5[_0x2565('0x4f')]},'raw':!![]})[_0x2565('0x26')](function(_0x22883c){if(_0x22883c&&_0x22883c[_0x2565('0x50')]===0x0){return db[_0x2565('0x2a')][_0x2565('0x51')]({'name':_0x502620[_0x2565('0x2d')],'resourceId':_0x502620['id'],'type':_0x22883c['name'],'sectionId':_0x22883c['id']},{})[_0x2565('0x26')](function(){return _0x4220f4;});}else{return _0x4220f4;}})['catch'](function(_0x4373c2){logger[_0x2565('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4373c2);throw _0x4373c2;});}return _0x4220f4;})[_0x2565('0x26')](respondWithResult(_0x483f44,0xc9))['catch'](handleError(_0x483f44,null));};exports[_0x2565('0x25')]=function(_0x5105a6,_0x51168c){if(_0x5105a6['body']['id']){delete _0x5105a6['body']['id'];}return db[_0x2565('0x42')]['find']({'where':{'id':_0x5105a6['params']['id']}})[_0x2565('0x26')](handleEntityNotFound(_0x51168c,null))[_0x2565('0x26')](saveUpdates(_0x5105a6[_0x2565('0x4a')],null))[_0x2565('0x26')](respondWithResult(_0x51168c,null))[_0x2565('0x46')](handleError(_0x51168c,null));};exports[_0x2565('0x27')]=function(_0x47ba08,_0x2a1c4a){return db[_0x2565('0x42')][_0x2565('0x49')]({'where':{'id':_0x47ba08[_0x2565('0x48')]['id']}})[_0x2565('0x26')](handleEntityNotFound(_0x2a1c4a,null))[_0x2565('0x26')](removeEntity(_0x2a1c4a,null))[_0x2565('0x46')](handleError(_0x2a1c4a,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 3d6d4db..c4bc61c 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 _0xc534=['StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','util','bluebird','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc534,0x1ca));var _0x4c53=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xc534[_0x5beda8];return _0x2aa042;};'use strict';var _=require('lodash');var util=require(_0x4c53('0x0'));var BPromise=require(_0x4c53('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3426ed,_0x1fb9d7,_0x1bb0cb){var _0x53bca0=0x1;var _0xd2f9d9=[];var _0x50f2d0={'context':_0x1fb9d7[_0x4c53('0x2')]||_0x4c53('0x3'),'exten':util[_0x4c53('0x4')](_0x4c53('0x5'),_0x3426ed[_0x4c53('0x6')],_0x1bb0cb),'type':_0x4c53('0x7'),'isApp':![],'ChanSpyId':_0x3426ed['id'],'UserId':_0x1fb9d7['id']};_0xd2f9d9[_0x4c53('0x8')](_[_0x4c53('0x9')]({'app':'Set','appdata':util[_0x4c53('0x4')](_0x4c53('0xa'),'chanspy'),'priority':_0x53bca0++},_0x50f2d0));if(_0x3426ed[_0x4c53('0xb')]){_0xd2f9d9[_0x4c53('0x8')](_[_0x4c53('0x9')]({'app':_0x4c53('0xc'),'appdata':util[_0x4c53('0x4')](_0x4c53('0xd'),_0x3426ed[_0x4c53('0xe')]),'priority':_0x53bca0++},_0x50f2d0));}if(_0x3426ed[_0x4c53('0xf')]){_0xd2f9d9[_0x4c53('0x8')](_[_0x4c53('0x9')]({'app':_0x4c53('0x10'),'appdata':_0x3426ed[_0x4c53('0x11')],'priority':_0x53bca0++},_0x50f2d0));}_0xd2f9d9[_0x4c53('0x8')](_[_0x4c53('0x9')]({'app':_0x4c53('0x12'),'appdata':util['format'](_0x4c53('0x13'),_0x1fb9d7['name'],_0x3426ed[_0x4c53('0x14')]?_0x3426ed[_0x4c53('0x14')][_0x4c53('0x15')](''):''),'priority':_0x53bca0++},_0x50f2d0));if(_0x3426ed[_0x4c53('0xb')]){_0xd2f9d9[_0x4c53('0x8')](_['merge']({'app':_0x4c53('0x16'),'priority':_0x53bca0++},_0x50f2d0));}return _0xd2f9d9;};var getChanSpyApplications=function(_0x199c42,_0x565f08){var _0x4705a3=[];for(var _0x880449=0x0,_0x19abd1=0x1;_0x880449<_0x565f08[_0x4c53('0x17')];_0x880449++,_0x19abd1=0x1){_0x4705a3=_0x4705a3[_0x4c53('0x18')](getUserApplications(_0x199c42,_0x565f08[_0x880449],_0x565f08[_0x880449][_0x4c53('0x19')]));if(_0x565f08[_0x880449][_0x4c53('0x19')]!=_0x565f08[_0x880449][_0x4c53('0x1a')]){_0x4705a3=_0x4705a3[_0x4c53('0x18')](getUserApplications(_0x199c42,_0x565f08[_0x880449],_0x565f08[_0x880449][_0x4c53('0x1a')]));}}return _0x4705a3;};var getChanSpyPromise=function(_0x3bf5a9,_0x50b4e1){return new BPromise(function(_0x8bf6a9,_0x48d72d){return _0x3bf5a9[_0x4c53('0x1b')][_0x4c53('0x1c')]({'attributes':['id',_0x4c53('0x1a'),_0x4c53('0x19')],'where':{'role':_0x4c53('0x1d'),'chanspy':!![]},'raw':!![]})[_0x4c53('0x1e')](function(_0x1fed39){if(_0x1fed39){return _0x8bf6a9(getChanSpyApplications(_0x50b4e1,_0x1fed39));}return _0x8bf6a9([]);})[_0x4c53('0x1f')](function(_0x4f139b){_0x48d72d(_0x4f139b);});});};module[_0x4c53('0x20')]=function(_0x1da82a,_0x2981e6){var _0xa620d7=_0x1da82a[_0x4c53('0x21')];return _0x1da82a[_0x4c53('0x22')](_0x4c53('0x23'),attributes,{'tableName':_0x4c53('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2700df,_0x107788,_0x14fde2){return getChanSpyPromise(_0xa620d7,_0x2700df)[_0x4c53('0x1e')](function(_0x3e3576){if(_0x3e3576&&_0x3e3576[_0x4c53('0x17')]){return _0xa620d7[_0x4c53('0x25')]['bulkCreate'](_0x3e3576);}})[_0x4c53('0x1e')](function(){_0x14fde2();})[_0x4c53('0x1f')](function(_0x29fd50){_0x14fde2(_0x29fd50);});},'afterUpdate':function(_0x5ecebd,_0xea2a5d,_0x3be0ba){return _0xa620d7['VoiceExtension'][_0x4c53('0x26')]({'where':{'ChanSpyId':_0x5ecebd['id']}})[_0x4c53('0x1e')](function(){return getChanSpyPromise(_0xa620d7,_0x5ecebd);})[_0x4c53('0x1e')](function(_0x467646){if(_0x467646&&_0x467646[_0x4c53('0x17')]){return _0xa620d7[_0x4c53('0x25')][_0x4c53('0x27')](_0x467646);}})[_0x4c53('0x1e')](function(){_0x3be0ba();})[_0x4c53('0x1f')](function(_0x92c41){_0x3be0ba(_0x92c41);});},'afterDestroy':function(_0x5220b0,_0x3393f6,_0xcecee3){return _0xa620d7[_0x4c53('0x25')][_0x4c53('0x26')]({'where':{'ChanSpyId':_0x5220b0['id']}})[_0x4c53('0x1e')](function(){_0xcecee3();})['catch'](function(_0xc94987){_0xcecee3(_0xc94987);});}}});}; \ No newline at end of file +var _0x24cd=['ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','destroy','VoiceExtension','bulkCreate','lodash','util','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','Set','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate'];(function(_0x4adff6,_0x2ad7c7){var _0x355da7=function(_0x5d5cb2){while(--_0x5d5cb2){_0x4adff6['push'](_0x4adff6['shift']());}};_0x355da7(++_0x2ad7c7);}(_0x24cd,0x83));var _0xd24c=function(_0x2753c2,_0x2fb7a2){_0x2753c2=_0x2753c2-0x0;var _0x9a6521=_0x24cd[_0x2753c2];return _0x9a6521;};'use strict';var _=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var BPromise=require('bluebird');var attributes=require(_0xd24c('0x2'));var getUserApplications=function(_0x4fcd89,_0x282e8f,_0x30398b){var _0x3bd534=0x1;var _0x4d515c=[];var _0x21a58c={'context':_0x282e8f[_0xd24c('0x3')]||'from-sip','exten':util[_0xd24c('0x4')](_0xd24c('0x5'),_0x4fcd89[_0xd24c('0x6')],_0x30398b),'type':_0xd24c('0x7'),'isApp':![],'ChanSpyId':_0x4fcd89['id'],'UserId':_0x282e8f['id']};_0x4d515c[_0xd24c('0x8')](_[_0xd24c('0x9')]({'app':_0xd24c('0xa'),'appdata':util[_0xd24c('0x4')]('CDR(type)=%s','chanspy'),'priority':_0x3bd534++},_0x21a58c));if(_0x4fcd89[_0xd24c('0xb')]){_0x4d515c[_0xd24c('0x8')](_[_0xd24c('0x9')]({'app':_0xd24c('0xc'),'appdata':util[_0xd24c('0x4')](_0xd24c('0xd'),_0x4fcd89[_0xd24c('0xe')]),'priority':_0x3bd534++},_0x21a58c));}if(_0x4fcd89[_0xd24c('0xf')]){_0x4d515c['push'](_[_0xd24c('0x9')]({'app':_0xd24c('0x10'),'appdata':_0x4fcd89['password'],'priority':_0x3bd534++},_0x21a58c));}_0x4d515c[_0xd24c('0x8')](_[_0xd24c('0x9')]({'app':_0xd24c('0x11'),'appdata':util[_0xd24c('0x4')](_0xd24c('0x12'),_0x282e8f[_0xd24c('0x13')],_0x4fcd89[_0xd24c('0x14')]?_0x4fcd89[_0xd24c('0x14')]['join'](''):''),'priority':_0x3bd534++},_0x21a58c));if(_0x4fcd89[_0xd24c('0xb')]){_0x4d515c[_0xd24c('0x8')](_['merge']({'app':_0xd24c('0x15'),'priority':_0x3bd534++},_0x21a58c));}return _0x4d515c;};var getChanSpyApplications=function(_0x3aa193,_0x1a1111){var _0x3221a8=[];for(var _0x509992=0x0,_0x5e14b8=0x1;_0x509992<_0x1a1111[_0xd24c('0x16')];_0x509992++,_0x5e14b8=0x1){_0x3221a8=_0x3221a8[_0xd24c('0x17')](getUserApplications(_0x3aa193,_0x1a1111[_0x509992],_0x1a1111[_0x509992][_0xd24c('0x18')]));if(_0x1a1111[_0x509992]['internal']!=_0x1a1111[_0x509992][_0xd24c('0x13')]){_0x3221a8=_0x3221a8[_0xd24c('0x17')](getUserApplications(_0x3aa193,_0x1a1111[_0x509992],_0x1a1111[_0x509992][_0xd24c('0x13')]));}}return _0x3221a8;};var getChanSpyPromise=function(_0x62e228,_0x478a0f){return new BPromise(function(_0x35de97,_0x56f8af){return _0x62e228[_0xd24c('0x19')][_0xd24c('0x1a')]({'attributes':['id',_0xd24c('0x13'),_0xd24c('0x18')],'where':{'role':_0xd24c('0x1b'),'chanspy':!![]},'raw':!![]})[_0xd24c('0x1c')](function(_0x2f7439){if(_0x2f7439){return _0x35de97(getChanSpyApplications(_0x478a0f,_0x2f7439));}return _0x35de97([]);})[_0xd24c('0x1d')](function(_0x17375b){_0x56f8af(_0x17375b);});});};module[_0xd24c('0x1e')]=function(_0x48fffd,_0x30c225){var _0x2c6c1a=_0x48fffd[_0xd24c('0x1f')];return _0x48fffd['define'](_0xd24c('0x20'),attributes,{'tableName':_0xd24c('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x317eb0,_0x5dac02,_0x4539e7){return getChanSpyPromise(_0x2c6c1a,_0x317eb0)[_0xd24c('0x1c')](function(_0x848e0e){if(_0x848e0e&&_0x848e0e[_0xd24c('0x16')]){return _0x2c6c1a['VoiceExtension']['bulkCreate'](_0x848e0e);}})[_0xd24c('0x1c')](function(){_0x4539e7();})['catch'](function(_0x13a9a7){_0x4539e7(_0x13a9a7);});},'afterUpdate':function(_0xaf8b16,_0x325fcc,_0x4c0d99){return _0x2c6c1a['VoiceExtension'][_0xd24c('0x22')]({'where':{'ChanSpyId':_0xaf8b16['id']}})[_0xd24c('0x1c')](function(){return getChanSpyPromise(_0x2c6c1a,_0xaf8b16);})[_0xd24c('0x1c')](function(_0x160f03){if(_0x160f03&&_0x160f03[_0xd24c('0x16')]){return _0x2c6c1a[_0xd24c('0x23')][_0xd24c('0x24')](_0x160f03);}})[_0xd24c('0x1c')](function(){_0x4c0d99();})[_0xd24c('0x1d')](function(_0x3b14c7){_0x4c0d99(_0x3b14c7);});},'afterDestroy':function(_0x2586d7,_0x59cbb6,_0x4e128b){return _0x2c6c1a[_0xd24c('0x23')][_0xd24c('0x22')]({'where':{'ChanSpyId':_0x2586d7['id']}})[_0xd24c('0x1c')](function(){_0x4e128b();})['catch'](function(_0x5e3391){_0x4e128b(_0x5e3391);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 554dd80..43204d3 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 _0xa794=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x131988,_0x5606dd){var _0x18d0f1=function(_0x57d3f8){while(--_0x57d3f8){_0x131988['push'](_0x131988['shift']());}};_0x18d0f1(++_0x5606dd);}(_0xa794,0x79));var _0x4a79=function(_0x287ecf,_0x104022){_0x287ecf=_0x287ecf-0x0;var _0xde9a29=_0xa794[_0x287ecf];return _0xde9a29;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4a79('0x0'));var rs=require(_0x4a79('0x1'));var fs=require('fs');var Redis=require(_0x4a79('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a79('0x3'));var logger=require(_0x4a79('0x4'))(_0x4a79('0x5'));var config=require(_0x4a79('0x6'));var jayson=require(_0x4a79('0x7'));var client=jayson['client'][_0x4a79('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aec8f,_0xe74f00,_0x3b8827){return new BPromise(function(_0x4624a0,_0x5a4518){return client[_0x4a79('0x9')](_0x3aec8f,_0x3b8827)['then'](function(_0x5a7522){logger['info'](_0x4a79('0xa'),_0xe74f00,_0x4a79('0xb'));logger[_0x4a79('0xc')](_0x4a79('0xd'),_0xe74f00,'request\x20sent',JSON['stringify'](_0x5a7522));if(_0x5a7522['error']){if(_0x5a7522['error'][_0x4a79('0xe')]===0x1f4){logger[_0x4a79('0xf')](_0x4a79('0xa'),_0xe74f00,_0x5a7522[_0x4a79('0xf')]['message']);return _0x5a4518(_0x5a7522[_0x4a79('0xf')][_0x4a79('0x10')]);}logger[_0x4a79('0xf')](_0x4a79('0xa'),_0xe74f00,_0x5a7522['error'][_0x4a79('0x10')]);return _0x4624a0(_0x5a7522['error'][_0x4a79('0x10')]);}else{logger['info'](_0x4a79('0xa'),_0xe74f00,_0x4a79('0xb'));_0x4624a0(_0x5a7522[_0x4a79('0x11')][_0x4a79('0x10')]);}})[_0x4a79('0x12')](function(_0x2828eb){logger['error'](_0x4a79('0xa'),_0xe74f00,_0x2828eb);_0x5a4518(_0x2828eb);});});} \ No newline at end of file +var _0x175f=['VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x400379,_0x17cb37){var _0x32424f=function(_0x1ce100){while(--_0x1ce100){_0x400379['push'](_0x400379['shift']());}};_0x32424f(++_0x17cb37);}(_0x175f,0x1ab));var _0xf175=function(_0x320fae,_0x228db8){_0x320fae=_0x320fae-0x0;var _0xe6d382=_0x175f[_0x320fae];return _0xe6d382;};'use strict';var _=require('lodash');var util=require(_0xf175('0x0'));var moment=require('moment');var BPromise=require(_0xf175('0x1'));var rs=require(_0xf175('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf175('0x3'))['db'];var utils=require(_0xf175('0x4'));var logger=require(_0xf175('0x5'))(_0xf175('0x6'));var config=require(_0xf175('0x7'));var jayson=require(_0xf175('0x8'));var client=jayson[_0xf175('0x9')][_0xf175('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35d935,_0x56ea06,_0x4dd3fc){return new BPromise(function(_0x34101b,_0x59dfc4){return client[_0xf175('0xb')](_0x35d935,_0x4dd3fc)['then'](function(_0x3975f5){logger[_0xf175('0xc')](_0xf175('0xd'),_0x56ea06,'request\x20sent');logger['debug'](_0xf175('0xe'),_0x56ea06,_0xf175('0xf'),JSON['stringify'](_0x3975f5));if(_0x3975f5[_0xf175('0x10')]){if(_0x3975f5[_0xf175('0x10')][_0xf175('0x11')]===0x1f4){logger[_0xf175('0x10')](_0xf175('0xd'),_0x56ea06,_0x3975f5[_0xf175('0x10')]['message']);return _0x59dfc4(_0x3975f5[_0xf175('0x10')]['message']);}logger[_0xf175('0x10')](_0xf175('0xd'),_0x56ea06,_0x3975f5[_0xf175('0x10')][_0xf175('0x12')]);return _0x34101b(_0x3975f5[_0xf175('0x10')][_0xf175('0x12')]);}else{logger['info'](_0xf175('0xd'),_0x56ea06,_0xf175('0xf'));_0x34101b(_0x3975f5[_0xf175('0x13')]['message']);}})['catch'](function(_0xdcf101){logger[_0xf175('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x56ea06,_0xdcf101);_0x59dfc4(_0xdcf101);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 3800785..2f7016d 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 _0xa5c1=['util','path','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','put','update','exports','multer'];(function(_0x32405b,_0x5027b5){var _0x3c0b87=function(_0x38737b){while(--_0x38737b){_0x32405b['push'](_0x32405b['shift']());}};_0x3c0b87(++_0x5027b5);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x22acb4,_0x2001bc){_0x22acb4=_0x22acb4-0x0;var _0x2665fb=_0xa5c1[_0x22acb4];return _0x2665fb;};'use strict';var multer=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var path=require(_0x1a5c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a5c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1a5c('0x4'));var config=require(_0x1a5c('0x5'));var controller=require(_0x1a5c('0x6'));router[_0x1a5c('0x7')]('/',auth[_0x1a5c('0x8')](),controller[_0x1a5c('0x9')]);router['get'](_0x1a5c('0xa'),auth['isAuthenticated'](),controller[_0x1a5c('0xb')]);router[_0x1a5c('0xc')]('/',auth[_0x1a5c('0x8')](),controller['create']);router[_0x1a5c('0xd')]('/:id',auth[_0x1a5c('0x8')](),controller[_0x1a5c('0xe')]);router['delete'](_0x1a5c('0xa'),auth[_0x1a5c('0x8')](),controller['destroy']);module[_0x1a5c('0xf')]=router; \ No newline at end of file +var _0x79a3=['connect-timeout','Router','./voiceContext.controller','get','isAuthenticated','index','post','create','put','/:id','update','multer','path'];(function(_0x1f5517,_0x20506c){var _0x3857ff=function(_0x2e9a14){while(--_0x2e9a14){_0x1f5517['push'](_0x1f5517['shift']());}};_0x3857ff(++_0x20506c);}(_0x79a3,0x80));var _0x379a=function(_0x75a9f6,_0xa04993){_0x75a9f6=_0x75a9f6-0x0;var _0x43283a=_0x79a3[_0x75a9f6];return _0x43283a;};'use strict';var multer=require(_0x379a('0x0'));var util=require('util');var path=require(_0x379a('0x1'));var timeout=require(_0x379a('0x2'));var express=require('express');var router=express[_0x379a('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x379a('0x4'));router[_0x379a('0x5')]('/',auth[_0x379a('0x6')](),controller[_0x379a('0x7')]);router[_0x379a('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x379a('0x8')]('/',auth[_0x379a('0x6')](),controller[_0x379a('0x9')]);router[_0x379a('0xa')](_0x379a('0xb'),auth[_0x379a('0x6')](),controller[_0x379a('0xc')]);router['delete']('/:id',auth[_0x379a('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index dd86689..961b51b 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 _0x57de=['sequelize','STRING','BOOLEAN'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x57de,0x108));var _0xe57d=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0x57de[_0x3a1ea5];return _0xfac9b2;};'use strict';var Sequelize=require(_0xe57d('0x0'));module['exports']={'name':{'type':Sequelize[_0xe57d('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xe57d('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xe57d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6831=['BOOLEAN','sequelize','STRING','name'];(function(_0x48716a,_0x215d00){var _0x62a0b8=function(_0x1f63b5){while(--_0x1f63b5){_0x48716a['push'](_0x48716a['shift']());}};_0x62a0b8(++_0x215d00);}(_0x6831,0x19d));var _0x1683=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6831[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x1683('0x0'));module['exports']={'name':{'type':Sequelize[_0x1683('0x1')],'unique':_0x1683('0x2')},'description':{'type':Sequelize[_0x1683('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1683('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 1280079..d8f9259 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 _0x5af4=['params','find','create','readFileSync','join','root','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Contexts','autoAssociation','body','Reload','server/files/templates/context.ejs','render','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','get','UserProfileResource','destroy','name','send','index','VoiceContext','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show'];(function(_0x2994f2,_0x464963){var _0x1e20f5=function(_0x52c32e){while(--_0x52c32e){_0x2994f2['push'](_0x2994f2['shift']());}};_0x1e20f5(++_0x464963);}(_0x5af4,0xd9));var _0x45af=function(_0x2c1df1,_0x5148f6){_0x2c1df1=_0x2c1df1-0x0;var _0x28e1f7=_0x5af4[_0x2c1df1];return _0x28e1f7;};'use strict';var pdf=require(_0x45af('0x0'));var emlformat=require(_0x45af('0x1'));var rimraf=require(_0x45af('0x2'));var zipdir=require(_0x45af('0x3'));var jsonpatch=require(_0x45af('0x4'));var rp=require('request-promise');var moment=require(_0x45af('0x5'));var BPromise=require(_0x45af('0x6'));var Mustache=require(_0x45af('0x7'));var util=require(_0x45af('0x8'));var path=require('path');var sox=require(_0x45af('0x9'));var csv=require(_0x45af('0xa'));var ejs=require(_0x45af('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x45af('0xc'));var crypto=require(_0x45af('0xd'));var jsforce=require(_0x45af('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x45af('0xa'));var querystring=require(_0x45af('0xf'));var Papa=require('papaparse');var authService=require(_0x45af('0x10'));var hardwareService=require(_0x45af('0x11'));var Redis=require('ioredis');var qs=require(_0x45af('0x12'));var logger=require('../../config/logger')(_0x45af('0x13'));var utils=require(_0x45af('0x14'));var config=require(_0x45af('0x15'));var db=require(_0x45af('0x16'))['db'];var jayson=require(_0x45af('0x17'));var client=jayson[_0x45af('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e71a2,_0x28c73b,_0x59ab24,_0x58a3a4){return new BPromise(function(_0x56db2c,_0x369cc4){var _0x23ff24=_0x58a3a4||client;return _0x23ff24[_0x45af('0x19')](_0x1e71a2,_0x59ab24)[_0x45af('0x1a')](function(_0x138617){logger[_0x45af('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x28c73b,_0x45af('0x1c'));logger[_0x45af('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x28c73b,_0x45af('0x1c'),JSON[_0x45af('0x1e')](_0x138617));if(_0x138617[_0x45af('0x1f')]){if(_0x138617[_0x45af('0x1f')][_0x45af('0x20')]===0x1f4){logger[_0x45af('0x1f')](_0x45af('0x21'),_0x28c73b,_0x138617[_0x45af('0x1f')][_0x45af('0x22')]);return _0x369cc4(_0x138617['error'][_0x45af('0x22')]);}logger[_0x45af('0x1f')](_0x45af('0x21'),_0x28c73b,_0x138617[_0x45af('0x1f')]['message']);return _0x56db2c(_0x138617[_0x45af('0x1f')][_0x45af('0x22')]);}else{logger[_0x45af('0x1b')](_0x45af('0x21'),_0x28c73b,_0x45af('0x1c'));_0x56db2c(_0x138617['result'][_0x45af('0x22')]);}})[_0x45af('0x23')](function(_0x1bdf68){logger['error'](_0x45af('0x21'),_0x28c73b,_0x1bdf68);_0x369cc4(_0x1bdf68);});});}function respondWithStatusCode(_0x1ee9e4,_0x1e9f2b){_0x1e9f2b=_0x1e9f2b||0xcc;return function(_0x55dbc1){if(_0x55dbc1){return _0x1ee9e4[_0x45af('0x24')](_0x1e9f2b);}return _0x1ee9e4[_0x45af('0x25')](_0x1e9f2b)[_0x45af('0x26')]();};}function respondWithResult(_0xd9df79,_0x4c73f9){_0x4c73f9=_0x4c73f9||0xc8;return function(_0x4482b5){if(_0x4482b5){return _0xd9df79['status'](_0x4c73f9)[_0x45af('0x27')](_0x4482b5);}};}function respondWithFilteredResult(_0x577fa4,_0x3390be){return function(_0x251294){if(_0x251294){var _0x3725f6=_0x251294[_0x45af('0x28')],_0x21a0cb=_0x3390be['offset'],_0x3fc125=_0x3390be[_0x45af('0x29')]+_0x3390be[_0x45af('0x2a')],_0x31e58d;if(_0x3fc125>=_0x3725f6){_0x3fc125=_0x3725f6;_0x31e58d=0xc8;}else{_0x31e58d=0xce;}_0x577fa4[_0x45af('0x25')](_0x31e58d);return _0x577fa4[_0x45af('0x2b')](_0x45af('0x2c'),_0x21a0cb+'-'+_0x3fc125+'/'+_0x3725f6)[_0x45af('0x27')](_0x251294);}return null;};}function patchUpdates(_0x4dbab9){return function(_0x5a0962){try{jsonpatch['apply'](_0x5a0962,_0x4dbab9,!![]);}catch(_0x5a49e0){return BPromise[_0x45af('0x2d')](_0x5a49e0);}return _0x5a0962['save']();};}function saveUpdates(_0x1b6cd8,_0x3eeeb4){return function(_0x2fd30b){if(_0x2fd30b){return _0x2fd30b[_0x45af('0x2e')](_0x1b6cd8)[_0x45af('0x1a')](function(_0xbdaef2){return _0xbdaef2;});}return null;};}function removeEntity(_0x313846,_0x356bc2){return function(_0x24e725){if(_0x24e725){return _0x24e725['destroy']()['then'](function(){var _0x38ca33=_0x24e725[_0x45af('0x2f')]({'plain':!![]});var _0x219456='Contexts';return db[_0x45af('0x30')][_0x45af('0x31')]({'where':{'type':_0x219456,'resourceId':_0x38ca33['id']}})[_0x45af('0x1a')](function(){return _0x24e725;});})['then'](function(){_0x313846['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2fea7,_0x36b4cc){return function(_0x2824c7){if(!_0x2824c7){_0xe2fea7['sendStatus'](0x194);}return _0x2824c7;};}function handleError(_0x7faa4f,_0xec57ee){_0xec57ee=_0xec57ee||0x1f4;return function(_0x81d8d1){logger[_0x45af('0x1f')](_0x81d8d1['stack']);if(_0x81d8d1[_0x45af('0x32')]){delete _0x81d8d1[_0x45af('0x32')];}_0x7faa4f[_0x45af('0x25')](_0xec57ee)[_0x45af('0x33')](_0x81d8d1);};}exports[_0x45af('0x34')]=function(_0x533b89,_0x4b3691){var _0xd39af7={},_0x211e4f={},_0x9ece06={'count':0x0,'rows':[]};var _0x4cd84e=db[_0x45af('0x35')][_0x45af('0x36')];_0x211e4f['model']=_[_0x45af('0x37')](_0x4cd84e);_0x211e4f[_0x45af('0x38')]=_[_0x45af('0x37')](_0x533b89[_0x45af('0x38')]);_0x211e4f[_0x45af('0x39')]=_['intersection'](_0x211e4f[_0x45af('0x3a')],_0x211e4f[_0x45af('0x38')]);_0xd39af7[_0x45af('0x3b')]=_[_0x45af('0x3c')](_0x211e4f[_0x45af('0x3a')],qs[_0x45af('0x3d')](_0x533b89[_0x45af('0x38')][_0x45af('0x3d')]));_0xd39af7[_0x45af('0x3b')]=_0xd39af7[_0x45af('0x3b')][_0x45af('0x3e')]?_0xd39af7[_0x45af('0x3b')]:_0x211e4f[_0x45af('0x3a')];if(!_0x533b89['query'][_0x45af('0x3f')]('nolimit')){_0xd39af7['limit']=qs[_0x45af('0x2a')](_0x533b89[_0x45af('0x38')]['limit']);_0xd39af7[_0x45af('0x29')]=qs['offset'](_0x533b89[_0x45af('0x38')][_0x45af('0x29')]);}_0xd39af7[_0x45af('0x40')]=qs[_0x45af('0x41')](_0x533b89['query'][_0x45af('0x41')]);_0xd39af7[_0x45af('0x42')]=qs[_0x45af('0x39')](_['pick'](_0x533b89[_0x45af('0x38')],_0x211e4f[_0x45af('0x39')]));if(_0x533b89[_0x45af('0x38')][_0x45af('0x43')]){_0xd39af7['where']=_['merge'](_0xd39af7[_0x45af('0x42')],{'$or':_[_0x45af('0x44')](_0x4cd84e,function(_0x29a412){if(_0x29a412[_0x45af('0x45')][_0x45af('0x46')]!==_0x45af('0x47')){var _0x322771={};_0x322771[_0x29a412[_0x45af('0x48')]]={'$like':'%'+_0x533b89[_0x45af('0x38')][_0x45af('0x43')]+'%'};return _0x322771;}})});}_0xd39af7=_[_0x45af('0x49')]({},_0xd39af7,_0x533b89[_0x45af('0x4a')]);var _0x48aa52={'where':_0xd39af7[_0x45af('0x42')]};return db[_0x45af('0x35')][_0x45af('0x28')](_0x48aa52)['then'](function(_0x50fe62){_0x9ece06[_0x45af('0x28')]=_0x50fe62;if(_0x533b89[_0x45af('0x38')][_0x45af('0x4b')]){_0xd39af7[_0x45af('0x4c')]=[{'all':!![]}];}return db['VoiceContext'][_0x45af('0x4d')](_0xd39af7);})[_0x45af('0x1a')](function(_0x30af79){_0x9ece06[_0x45af('0x4e')]=_0x30af79;return _0x9ece06;})[_0x45af('0x1a')](respondWithFilteredResult(_0x4b3691,_0xd39af7))[_0x45af('0x23')](handleError(_0x4b3691,null));};exports[_0x45af('0x4f')]=function(_0xfa52e,_0x4d41a0){var _0x4ac161={'raw':![],'where':{'id':_0xfa52e[_0x45af('0x50')]['id']}},_0x2fc131={};_0x2fc131[_0x45af('0x3a')]=_[_0x45af('0x37')](db[_0x45af('0x35')]['rawAttributes']);_0x2fc131[_0x45af('0x38')]=_[_0x45af('0x37')](_0xfa52e['query']);_0x2fc131['filters']=_['intersection'](_0x2fc131['model'],_0x2fc131[_0x45af('0x38')]);_0x4ac161[_0x45af('0x3b')]=_['intersection'](_0x2fc131['model'],qs[_0x45af('0x3d')](_0xfa52e[_0x45af('0x38')][_0x45af('0x3d')]));_0x4ac161[_0x45af('0x3b')]=_0x4ac161['attributes']['length']?_0x4ac161[_0x45af('0x3b')]:_0x2fc131['model'];if(_0xfa52e[_0x45af('0x38')][_0x45af('0x4b')]){_0x4ac161[_0x45af('0x4c')]=[{'all':!![]}];}_0x4ac161=_['merge']({},_0x4ac161,_0xfa52e['options']);return db[_0x45af('0x35')][_0x45af('0x51')](_0x4ac161)[_0x45af('0x1a')](handleEntityNotFound(_0x4d41a0,null))[_0x45af('0x1a')](respondWithResult(_0x4d41a0,null))[_0x45af('0x23')](handleError(_0x4d41a0,null));};exports['create']=function(_0x23e803,_0x34af05,_0x2347b6){var _0x208281;return db['VoiceContext'][_0x45af('0x52')](_0x23e803['body'],{'raw':!![]})[_0x45af('0x1a')](function(_0x57da12){_0x208281=_0x57da12;return db[_0x45af('0x35')][_0x45af('0x4d')]({'raw':!![]});})[_0x45af('0x1a')](function(_0x5c713c){var _0x1f3992=fs[_0x45af('0x53')](path[_0x45af('0x54')](config[_0x45af('0x55')],'server/files/templates/context.ejs'),_0x45af('0x56'));var _0x42d1c8=ejs['render'](_0x1f3992,{'contexts':_0x5c713c||[]});fs[_0x45af('0x57')](_0x45af('0x58'),_0x42d1c8);})[_0x45af('0x1a')](function(){return respondWithRpcPromise('Reload','create',{'module':_0x45af('0x59')});})['then'](function(){var _0x473269=_0x23e803[_0x45af('0x5a')][_0x45af('0x2f')]({'plain':!![]});if(!_0x473269)throw new Error(_0x45af('0x5b'));if(_0x473269['role']===_0x45af('0x5a')){var _0x56724f=_0x208281[_0x45af('0x2f')]({'plain':!![]});return db[_0x45af('0x5c')][_0x45af('0x51')]({'where':{'name':_0x45af('0x5d'),'userProfileId':_0x473269['userProfileId']},'raw':!![]})[_0x45af('0x1a')](function(_0x314614){if(_0x314614&&_0x314614[_0x45af('0x5e')]===0x0){return db['UserProfileResource'][_0x45af('0x52')]({'name':_0x56724f[_0x45af('0x32')],'resourceId':_0x56724f['id'],'type':_0x314614[_0x45af('0x32')],'sectionId':_0x314614['id']},{})[_0x45af('0x1a')](function(){return _0x208281;});}else{return _0x208281;}})[_0x45af('0x23')](function(_0x535265){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x535265);throw _0x535265;});}return _0x208281;})[_0x45af('0x1a')](respondWithResult(_0x34af05,0xc9))[_0x45af('0x23')](handleError(_0x34af05,null));};exports['update']=function(_0x4629ad,_0x163ad7,_0x36e6a0){var _0x30bfc3;return db[_0x45af('0x35')][_0x45af('0x51')]({'where':{'id':_0x4629ad[_0x45af('0x50')]['id']}})[_0x45af('0x1a')](handleEntityNotFound(_0x163ad7,null))[_0x45af('0x1a')](saveUpdates(_0x4629ad[_0x45af('0x5f')],null))[_0x45af('0x1a')](function(_0x720ca9){if(_0x720ca9){_0x30bfc3=_0x720ca9;return db[_0x45af('0x35')][_0x45af('0x4d')]({'raw':!![]});}})[_0x45af('0x1a')](function(_0x5e7669){var _0x1edae5=fs[_0x45af('0x53')](path['join'](config[_0x45af('0x55')],'server/files/templates/context.ejs'),_0x45af('0x56'));var _0x1f4e7d=ejs['render'](_0x1edae5,{'contexts':_0x5e7669||[]});fs[_0x45af('0x57')](_0x45af('0x58'),_0x1f4e7d);})[_0x45af('0x1a')](function(){return respondWithRpcPromise(_0x45af('0x60'),'update',{'module':'chan_sip.so'});})[_0x45af('0x1a')](function(){return _0x30bfc3;})[_0x45af('0x1a')](respondWithResult(_0x163ad7,null))[_0x45af('0x23')](handleError(_0x163ad7,null));};exports[_0x45af('0x31')]=function(_0x25a2af,_0x558260,_0x55019e){var _0x16a250;return db[_0x45af('0x35')][_0x45af('0x51')]({'where':{'id':_0x25a2af['params']['id']}})[_0x45af('0x1a')](handleEntityNotFound(_0x558260,null))['then'](removeEntity(_0x558260,null))[_0x45af('0x1a')](function(){return db[_0x45af('0x35')][_0x45af('0x4d')]({'raw':!![]});})[_0x45af('0x1a')](function(_0x54da77){var _0x328008=fs[_0x45af('0x53')](path[_0x45af('0x54')](config[_0x45af('0x55')],_0x45af('0x61')),_0x45af('0x56'));var _0x5500a1=ejs[_0x45af('0x62')](_0x328008,{'contexts':_0x54da77});fs[_0x45af('0x57')](_0x45af('0x58'),_0x5500a1);return respondWithRpcPromise('Reload',_0x45af('0x31'),{'module':_0x45af('0x59')});})[_0x45af('0x23')](handleError(_0x558260,null));}; \ No newline at end of file +var _0x043a=['api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send','VoiceContext','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','options','count','include','findAll','rows','rawAttributes','includeAll','find','create','body','readFileSync','join','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','user','role','UserProfileSection','userProfileId','autoAssociation','params','root','utf8','writeFileSync','Reload','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0xd55e73,_0x5074c6){var _0x5bd804=function(_0x4fabd3){while(--_0x4fabd3){_0xd55e73['push'](_0xd55e73['shift']());}};_0x5bd804(++_0x5074c6);}(_0x043a,0x1e4));var _0xa043=function(_0x18937c,_0x468789){_0x18937c=_0x18937c-0x0;var _0xb1505a=_0x043a[_0x18937c];return _0xb1505a;};'use strict';var pdf=require(_0xa043('0x0'));var emlformat=require(_0xa043('0x1'));var rimraf=require(_0xa043('0x2'));var zipdir=require(_0xa043('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa043('0x4'));var moment=require(_0xa043('0x5'));var BPromise=require(_0xa043('0x6'));var Mustache=require(_0xa043('0x7'));var util=require('util');var path=require(_0xa043('0x8'));var sox=require('sox');var csv=require(_0xa043('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa043('0xa'));var squel=require(_0xa043('0xb'));var crypto=require(_0xa043('0xc'));var jsforce=require(_0xa043('0xd'));var deskjs=require(_0xa043('0xe'));var toCsv=require(_0xa043('0x9'));var querystring=require(_0xa043('0xf'));var Papa=require(_0xa043('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xa043('0x11'));var Redis=require(_0xa043('0x12'));var qs=require(_0xa043('0x13'));var logger=require(_0xa043('0x14'))(_0xa043('0x15'));var utils=require(_0xa043('0x16'));var config=require(_0xa043('0x17'));var db=require(_0xa043('0x18'))['db'];var jayson=require(_0xa043('0x19'));var client=jayson[_0xa043('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c98bb,_0x5019e6,_0x273756,_0x3ef9ea){return new BPromise(function(_0x4976fb,_0x1b9a4b){var _0x3aa3b7=_0x3ef9ea||client;return _0x3aa3b7[_0xa043('0x1b')](_0x4c98bb,_0x273756)[_0xa043('0x1c')](function(_0x52f412){logger[_0xa043('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x5019e6,'request\x20sent');logger['debug'](_0xa043('0x1e'),_0x5019e6,_0xa043('0x1f'),JSON[_0xa043('0x20')](_0x52f412));if(_0x52f412['error']){if(_0x52f412[_0xa043('0x21')][_0xa043('0x22')]===0x1f4){logger[_0xa043('0x21')]('VoiceContext,\x20%s,\x20%s',_0x5019e6,_0x52f412['error']['message']);return _0x1b9a4b(_0x52f412['error'][_0xa043('0x23')]);}logger[_0xa043('0x21')](_0xa043('0x24'),_0x5019e6,_0x52f412[_0xa043('0x21')][_0xa043('0x23')]);return _0x4976fb(_0x52f412['error']['message']);}else{logger[_0xa043('0x1d')](_0xa043('0x24'),_0x5019e6,_0xa043('0x1f'));_0x4976fb(_0x52f412['result'][_0xa043('0x23')]);}})[_0xa043('0x25')](function(_0x595ab7){logger['error'](_0xa043('0x24'),_0x5019e6,_0x595ab7);_0x1b9a4b(_0x595ab7);});});}function respondWithStatusCode(_0x4cdba2,_0x4ac317){_0x4ac317=_0x4ac317||0xcc;return function(_0x3ba6f5){if(_0x3ba6f5){return _0x4cdba2['sendStatus'](_0x4ac317);}return _0x4cdba2[_0xa043('0x26')](_0x4ac317)[_0xa043('0x27')]();};}function respondWithResult(_0xe60274,_0x339f0b){_0x339f0b=_0x339f0b||0xc8;return function(_0x54f2b1){if(_0x54f2b1){return _0xe60274[_0xa043('0x26')](_0x339f0b)[_0xa043('0x28')](_0x54f2b1);}};}function respondWithFilteredResult(_0x2215b4,_0x465860){return function(_0x2f6a08){if(_0x2f6a08){var _0x295951=_0x2f6a08['count'],_0x2f9f20=_0x465860[_0xa043('0x29')],_0x18d2d9=_0x465860[_0xa043('0x29')]+_0x465860[_0xa043('0x2a')],_0x3f81f8;if(_0x18d2d9>=_0x295951){_0x18d2d9=_0x295951;_0x3f81f8=0xc8;}else{_0x3f81f8=0xce;}_0x2215b4[_0xa043('0x26')](_0x3f81f8);return _0x2215b4[_0xa043('0x2b')](_0xa043('0x2c'),_0x2f9f20+'-'+_0x18d2d9+'/'+_0x295951)[_0xa043('0x28')](_0x2f6a08);}return null;};}function patchUpdates(_0x5247a8){return function(_0x27f445){try{jsonpatch[_0xa043('0x2d')](_0x27f445,_0x5247a8,!![]);}catch(_0x26a472){return BPromise[_0xa043('0x2e')](_0x26a472);}return _0x27f445['save']();};}function saveUpdates(_0x3c5d2c,_0x3dd094){return function(_0x1c9ffb){if(_0x1c9ffb){return _0x1c9ffb[_0xa043('0x2f')](_0x3c5d2c)[_0xa043('0x1c')](function(_0x82a648){return _0x82a648;});}return null;};}function removeEntity(_0x4fd3fe,_0x3e4b36){return function(_0x14f95f){if(_0x14f95f){return _0x14f95f[_0xa043('0x30')]()['then'](function(){var _0x5a65de=_0x14f95f[_0xa043('0x31')]({'plain':!![]});var _0x3ef78e=_0xa043('0x32');return db[_0xa043('0x33')][_0xa043('0x30')]({'where':{'type':_0x3ef78e,'resourceId':_0x5a65de['id']}})[_0xa043('0x1c')](function(){return _0x14f95f;});})[_0xa043('0x1c')](function(){_0x4fd3fe['status'](0xcc)[_0xa043('0x27')]();});}};}function handleEntityNotFound(_0x1abb31,_0x2d47b9){return function(_0x481a4a){if(!_0x481a4a){_0x1abb31[_0xa043('0x34')](0x194);}return _0x481a4a;};}function handleError(_0x39baf4,_0x4270b6){_0x4270b6=_0x4270b6||0x1f4;return function(_0x1f94ba){logger['error'](_0x1f94ba[_0xa043('0x35')]);if(_0x1f94ba[_0xa043('0x36')]){delete _0x1f94ba[_0xa043('0x36')];}_0x39baf4[_0xa043('0x26')](_0x4270b6)[_0xa043('0x37')](_0x1f94ba);};}exports['index']=function(_0x56bf50,_0x50deca){var _0x160f17={},_0x5ab994={},_0x2dddd1={'count':0x0,'rows':[]};var _0x259592=db[_0xa043('0x38')]['rawAttributes'];_0x5ab994[_0xa043('0x39')]=_[_0xa043('0x3a')](_0x259592);_0x5ab994['query']=_[_0xa043('0x3a')](_0x56bf50[_0xa043('0x3b')]);_0x5ab994['filters']=_[_0xa043('0x3c')](_0x5ab994[_0xa043('0x39')],_0x5ab994[_0xa043('0x3b')]);_0x160f17['attributes']=_['intersection'](_0x5ab994[_0xa043('0x39')],qs[_0xa043('0x3d')](_0x56bf50[_0xa043('0x3b')]['fields']));_0x160f17[_0xa043('0x3e')]=_0x160f17[_0xa043('0x3e')][_0xa043('0x3f')]?_0x160f17[_0xa043('0x3e')]:_0x5ab994[_0xa043('0x39')];if(!_0x56bf50['query'][_0xa043('0x40')](_0xa043('0x41'))){_0x160f17[_0xa043('0x2a')]=qs[_0xa043('0x2a')](_0x56bf50[_0xa043('0x3b')][_0xa043('0x2a')]);_0x160f17[_0xa043('0x29')]=qs[_0xa043('0x29')](_0x56bf50['query'][_0xa043('0x29')]);}_0x160f17[_0xa043('0x42')]=qs[_0xa043('0x43')](_0x56bf50[_0xa043('0x3b')][_0xa043('0x43')]);_0x160f17[_0xa043('0x44')]=qs[_0xa043('0x45')](_[_0xa043('0x46')](_0x56bf50[_0xa043('0x3b')],_0x5ab994[_0xa043('0x45')]));if(_0x56bf50['query'][_0xa043('0x47')]){_0x160f17['where']=_[_0xa043('0x48')](_0x160f17[_0xa043('0x44')],{'$or':_[_0xa043('0x49')](_0x259592,function(_0x2bc97b){if(_0x2bc97b['type'][_0xa043('0x4a')]!==_0xa043('0x4b')){var _0x5132a7={};_0x5132a7[_0x2bc97b['field']]={'$like':'%'+_0x56bf50['query'][_0xa043('0x47')]+'%'};return _0x5132a7;}})});}_0x160f17=_['merge']({},_0x160f17,_0x56bf50[_0xa043('0x4c')]);var _0x207f57={'where':_0x160f17[_0xa043('0x44')]};return db['VoiceContext'][_0xa043('0x4d')](_0x207f57)[_0xa043('0x1c')](function(_0x16c5f2){_0x2dddd1['count']=_0x16c5f2;if(_0x56bf50[_0xa043('0x3b')]['includeAll']){_0x160f17[_0xa043('0x4e')]=[{'all':!![]}];}return db[_0xa043('0x38')][_0xa043('0x4f')](_0x160f17);})[_0xa043('0x1c')](function(_0x3b13f8){_0x2dddd1[_0xa043('0x50')]=_0x3b13f8;return _0x2dddd1;})['then'](respondWithFilteredResult(_0x50deca,_0x160f17))[_0xa043('0x25')](handleError(_0x50deca,null));};exports['show']=function(_0x20e21f,_0x2937bd){var _0x110ec7={'raw':![],'where':{'id':_0x20e21f['params']['id']}},_0x30e1de={};_0x30e1de[_0xa043('0x39')]=_['keys'](db['VoiceContext'][_0xa043('0x51')]);_0x30e1de[_0xa043('0x3b')]=_['keys'](_0x20e21f[_0xa043('0x3b')]);_0x30e1de[_0xa043('0x45')]=_['intersection'](_0x30e1de[_0xa043('0x39')],_0x30e1de[_0xa043('0x3b')]);_0x110ec7[_0xa043('0x3e')]=_[_0xa043('0x3c')](_0x30e1de[_0xa043('0x39')],qs[_0xa043('0x3d')](_0x20e21f['query']['fields']));_0x110ec7[_0xa043('0x3e')]=_0x110ec7['attributes'][_0xa043('0x3f')]?_0x110ec7[_0xa043('0x3e')]:_0x30e1de[_0xa043('0x39')];if(_0x20e21f[_0xa043('0x3b')][_0xa043('0x52')]){_0x110ec7['include']=[{'all':!![]}];}_0x110ec7=_[_0xa043('0x48')]({},_0x110ec7,_0x20e21f['options']);return db[_0xa043('0x38')][_0xa043('0x53')](_0x110ec7)[_0xa043('0x1c')](handleEntityNotFound(_0x2937bd,null))[_0xa043('0x1c')](respondWithResult(_0x2937bd,null))['catch'](handleError(_0x2937bd,null));};exports[_0xa043('0x54')]=function(_0x35829b,_0x25e363,_0x4b5b3a){var _0x216a52;return db['VoiceContext']['create'](_0x35829b[_0xa043('0x55')],{'raw':!![]})[_0xa043('0x1c')](function(_0xa1964){_0x216a52=_0xa1964;return db[_0xa043('0x38')][_0xa043('0x4f')]({'raw':!![]});})[_0xa043('0x1c')](function(_0x5e1d83){var _0x3a2cb3=fs[_0xa043('0x56')](path[_0xa043('0x57')](config['root'],_0xa043('0x58')),'utf8');var _0x4c72c0=ejs[_0xa043('0x59')](_0x3a2cb3,{'contexts':_0x5e1d83||[]});fs['writeFileSync'](_0xa043('0x5a'),_0x4c72c0);})[_0xa043('0x1c')](function(){return respondWithRpcPromise('Reload',_0xa043('0x54'),{'module':'chan_sip.so'});})[_0xa043('0x1c')](function(){var _0x766e6e=_0x35829b[_0xa043('0x5b')][_0xa043('0x31')]({'plain':!![]});if(!_0x766e6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x766e6e[_0xa043('0x5c')]===_0xa043('0x5b')){var _0x3ca215=_0x216a52[_0xa043('0x31')]({'plain':!![]});return db[_0xa043('0x5d')]['find']({'where':{'name':'Contexts','userProfileId':_0x766e6e[_0xa043('0x5e')]},'raw':!![]})[_0xa043('0x1c')](function(_0x562815){if(_0x562815&&_0x562815[_0xa043('0x5f')]===0x0){return db[_0xa043('0x33')][_0xa043('0x54')]({'name':_0x3ca215['name'],'resourceId':_0x3ca215['id'],'type':_0x562815['name'],'sectionId':_0x562815['id']},{})[_0xa043('0x1c')](function(){return _0x216a52;});}else{return _0x216a52;}})[_0xa043('0x25')](function(_0x2895ca){logger[_0xa043('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2895ca);throw _0x2895ca;});}return _0x216a52;})['then'](respondWithResult(_0x25e363,0xc9))[_0xa043('0x25')](handleError(_0x25e363,null));};exports[_0xa043('0x2f')]=function(_0x200656,_0xd52e72,_0x297680){var _0x4fa273;return db[_0xa043('0x38')]['find']({'where':{'id':_0x200656[_0xa043('0x60')]['id']}})[_0xa043('0x1c')](handleEntityNotFound(_0xd52e72,null))[_0xa043('0x1c')](saveUpdates(_0x200656[_0xa043('0x55')],null))[_0xa043('0x1c')](function(_0xb7bde2){if(_0xb7bde2){_0x4fa273=_0xb7bde2;return db[_0xa043('0x38')][_0xa043('0x4f')]({'raw':!![]});}})[_0xa043('0x1c')](function(_0x56214f){var _0x59b25a=fs[_0xa043('0x56')](path[_0xa043('0x57')](config[_0xa043('0x61')],_0xa043('0x58')),_0xa043('0x62'));var _0x11f637=ejs[_0xa043('0x59')](_0x59b25a,{'contexts':_0x56214f||[]});fs[_0xa043('0x63')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x11f637);})[_0xa043('0x1c')](function(){return respondWithRpcPromise(_0xa043('0x64'),'update',{'module':'chan_sip.so'});})[_0xa043('0x1c')](function(){return _0x4fa273;})[_0xa043('0x1c')](respondWithResult(_0xd52e72,null))['catch'](handleError(_0xd52e72,null));};exports['destroy']=function(_0x444e2e,_0x46957d,_0x28a0ea){var _0x4768b6;return db[_0xa043('0x38')][_0xa043('0x53')]({'where':{'id':_0x444e2e[_0xa043('0x60')]['id']}})[_0xa043('0x1c')](handleEntityNotFound(_0x46957d,null))['then'](removeEntity(_0x46957d,null))[_0xa043('0x1c')](function(){return db[_0xa043('0x38')][_0xa043('0x4f')]({'raw':!![]});})[_0xa043('0x1c')](function(_0x2bd25d){var _0x1ad848=fs[_0xa043('0x56')](path[_0xa043('0x57')](config[_0xa043('0x61')],_0xa043('0x58')),_0xa043('0x62'));var _0x568488=ejs[_0xa043('0x59')](_0x1ad848,{'contexts':_0x2bd25d});fs['writeFileSync'](_0xa043('0x5a'),_0x568488);return respondWithRpcPromise(_0xa043('0x64'),_0xa043('0x30'),{'module':'chan_sip.so'});})[_0xa043('0x25')](handleError(_0x46957d,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index b24267d..5e1b292 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 _0x9023=['../../config/logger','api','moment','bluebird','request-promise','./voiceContext.attributes','define','VoiceContext','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9023,0xa1));var _0x3902=function(_0x5e24a9,_0x53da0c){_0x5e24a9=_0x5e24a9-0x0;var _0x5be7ac=_0x9023[_0x5e24a9];return _0x5be7ac;};'use strict';var _=require('lodash');var util=require(_0x3902('0x0'));var logger=require(_0x3902('0x1'))(_0x3902('0x2'));var moment=require(_0x3902('0x3'));var BPromise=require(_0x3902('0x4'));var rp=require(_0x3902('0x5'));var attributes=require(_0x3902('0x6'));module['exports']=function(_0x1c99fd,_0x1c0f51){return _0x1c99fd[_0x3902('0x7')](_0x3902('0x8'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08b6=['api','moment','request-promise','exports','define','voice_contexts','lodash','util','../../config/logger'];(function(_0x56b878,_0x4be9aa){var _0x32b9ec=function(_0x1511ea){while(--_0x1511ea){_0x56b878['push'](_0x56b878['shift']());}};_0x32b9ec(++_0x4be9aa);}(_0x08b6,0x192));var _0x608b=function(_0x233c38,_0x4ed277){_0x233c38=_0x233c38-0x0;var _0xd2da32=_0x08b6[_0x233c38];return _0xd2da32;};'use strict';var _=require(_0x608b('0x0'));var util=require(_0x608b('0x1'));var logger=require(_0x608b('0x2'))(_0x608b('0x3'));var moment=require(_0x608b('0x4'));var BPromise=require('bluebird');var rp=require(_0x608b('0x5'));var attributes=require('./voiceContext.attributes');module[_0x608b('0x6')]=function(_0x1b0839,_0x7d7b22){return _0x1b0839[_0x608b('0x7')]('VoiceContext',attributes,{'tableName':_0x608b('0x8'),'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 9d9ecfb..189137b 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 _0x9e3a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x9e3a,0x107));var _0xa9e3=function(_0x43ac16,_0x435f99){_0x43ac16=_0x43ac16-0x0;var _0x156326=_0x9e3a[_0x43ac16];return _0x156326;};'use strict';var _=require(_0xa9e3('0x0'));var util=require(_0xa9e3('0x1'));var moment=require(_0xa9e3('0x2'));var BPromise=require(_0xa9e3('0x3'));var rs=require(_0xa9e3('0x4'));var fs=require('fs');var Redis=require(_0xa9e3('0x5'));var db=require(_0xa9e3('0x6'))['db'];var utils=require(_0xa9e3('0x7'));var logger=require(_0xa9e3('0x8'))(_0xa9e3('0x9'));var config=require(_0xa9e3('0xa'));var jayson=require(_0xa9e3('0xb'));var client=jayson[_0xa9e3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a5b17,_0xef0e52,_0x104fc0){return new BPromise(function(_0x7fdd31,_0x12076a){return client['request'](_0x5a5b17,_0x104fc0)[_0xa9e3('0xd')](function(_0x292d2c){logger['info'](_0xa9e3('0xe'),_0xef0e52,_0xa9e3('0xf'));logger[_0xa9e3('0x10')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xef0e52,'request\x20sent',JSON[_0xa9e3('0x11')](_0x292d2c));if(_0x292d2c[_0xa9e3('0x12')]){if(_0x292d2c[_0xa9e3('0x12')][_0xa9e3('0x13')]===0x1f4){logger[_0xa9e3('0x12')](_0xa9e3('0xe'),_0xef0e52,_0x292d2c[_0xa9e3('0x12')]['message']);return _0x12076a(_0x292d2c['error'][_0xa9e3('0x14')]);}logger[_0xa9e3('0x12')](_0xa9e3('0xe'),_0xef0e52,_0x292d2c['error'][_0xa9e3('0x14')]);return _0x7fdd31(_0x292d2c[_0xa9e3('0x12')]['message']);}else{logger[_0xa9e3('0x15')](_0xa9e3('0xe'),_0xef0e52,_0xa9e3('0xf'));_0x7fdd31(_0x292d2c[_0xa9e3('0x16')][_0xa9e3('0x14')]);}})[_0xa9e3('0x17')](function(_0x38b241){logger['error'](_0xa9e3('0xe'),_0xef0e52,_0x38b241);_0x12076a(_0x38b241);});});} \ No newline at end of file +var _0x522f=['error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0x522f,0x13f));var _0xf522=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x522f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf522('0x0'));var util=require('util');var moment=require(_0xf522('0x1'));var BPromise=require(_0xf522('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf522('0x3'));var db=require(_0xf522('0x4'))['db'];var utils=require(_0xf522('0x5'));var logger=require(_0xf522('0x6'))(_0xf522('0x7'));var config=require(_0xf522('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf522('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe9956,_0x47462a,_0xe16ce7){return new BPromise(function(_0x58ca0a,_0x39e8dd){return client[_0xf522('0xa')](_0xbe9956,_0xe16ce7)[_0xf522('0xb')](function(_0x2bcb3e){logger[_0xf522('0xc')](_0xf522('0xd'),_0x47462a,_0xf522('0xe'));logger['debug'](_0xf522('0xf'),_0x47462a,_0xf522('0xe'),JSON[_0xf522('0x10')](_0x2bcb3e));if(_0x2bcb3e[_0xf522('0x11')]){if(_0x2bcb3e['error']['code']===0x1f4){logger['error'](_0xf522('0xd'),_0x47462a,_0x2bcb3e[_0xf522('0x11')][_0xf522('0x12')]);return _0x39e8dd(_0x2bcb3e[_0xf522('0x11')][_0xf522('0x12')]);}logger[_0xf522('0x11')](_0xf522('0xd'),_0x47462a,_0x2bcb3e[_0xf522('0x11')][_0xf522('0x12')]);return _0x58ca0a(_0x2bcb3e[_0xf522('0x11')]['message']);}else{logger['info'](_0xf522('0xd'),_0x47462a,'request\x20sent');_0x58ca0a(_0x2bcb3e[_0xf522('0x13')]['message']);}})[_0xf522('0x14')](function(_0x355b28){logger[_0xf522('0x11')]('VoiceContext,\x20%s,\x20%s',_0x47462a,_0x355b28);_0x39e8dd(_0x355b28);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 2e69b7f..50d124e 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 _0x4301=['isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0x146710,_0x132d83){var _0x519583=function(_0x297e49){while(--_0x297e49){_0x146710['push'](_0x146710['shift']());}};_0x519583(++_0x132d83);}(_0x4301,0x1d9));var _0x1430=function(_0x100759,_0x2a88f2){_0x100759=_0x100759-0x0;var _0x5db8f0=_0x4301[_0x100759];return _0x5db8f0;};'use strict';var multer=require(_0x1430('0x0'));var util=require(_0x1430('0x1'));var path=require(_0x1430('0x2'));var timeout=require(_0x1430('0x3'));var express=require(_0x1430('0x4'));var router=express['Router']();var auth=require(_0x1430('0x5'));var interaction=require(_0x1430('0x6'));var config=require(_0x1430('0x7'));var controller=require(_0x1430('0x8'));router[_0x1430('0x9')]('/',auth[_0x1430('0xa')](),controller[_0x1430('0xb')]);router[_0x1430('0x9')](_0x1430('0xc'),auth[_0x1430('0xa')](),controller[_0x1430('0xd')]);router[_0x1430('0x9')](_0x1430('0xe'),auth['isAuthenticated'](),controller[_0x1430('0xf')]);router['post']('/',auth[_0x1430('0xa')](),controller['create']);router[_0x1430('0x10')](_0x1430('0xe'),auth[_0x1430('0xa')](),controller[_0x1430('0x11')]);router[_0x1430('0x12')](_0x1430('0xe'),auth[_0x1430('0xa')](),controller[_0x1430('0x13')]);module[_0x1430('0x14')]=router; \ No newline at end of file +var _0x8015=['post','create','put','delete','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x8015,0x122));var _0x5801=function(_0x354dc1,_0x4d6fd4){_0x354dc1=_0x354dc1-0x0;var _0x1dc992=_0x8015[_0x354dc1];return _0x1dc992;};'use strict';var multer=require('multer');var util=require(_0x5801('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5801('0x1'));var router=express['Router']();var auth=require(_0x5801('0x2'));var interaction=require(_0x5801('0x3'));var config=require(_0x5801('0x4'));var controller=require('./voiceDialReport.controller');router[_0x5801('0x5')]('/',auth['isAuthenticated'](),controller[_0x5801('0x6')]);router[_0x5801('0x5')]('/describe',auth[_0x5801('0x7')](),controller[_0x5801('0x8')]);router[_0x5801('0x5')](_0x5801('0x9'),auth[_0x5801('0x7')](),controller['show']);router[_0x5801('0xa')]('/',auth[_0x5801('0x7')](),controller[_0x5801('0xb')]);router[_0x5801('0xc')](_0x5801('0x9'),auth[_0x5801('0x7')](),controller['update']);router[_0x5801('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5801('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index fdf5ac2..8806850 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 _0x20b5=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x20b5,0x11a));var _0x520b=function(_0x21857e,_0x44af75){_0x21857e=_0x21857e-0x0;var _0x5886e8=_0x20b5[_0x21857e];return _0x5886e8;};'use strict';var Sequelize=require(_0x520b('0x0'));module[_0x520b('0x1')]={'privilege':{'type':Sequelize[_0x520b('0x2')]},'channel':{'type':Sequelize[_0x520b('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x520b('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x520b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x520b('0x2')]},'language':{'type':Sequelize[_0x520b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x520b('0x2')]},'exten':{'type':Sequelize[_0x520b('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x520b('0x2')]},'linkedid':{'type':Sequelize[_0x520b('0x2')]},'destchannel':{'type':Sequelize[_0x520b('0x2')]},'destchannelstate':{'type':Sequelize[_0x520b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x520b('0x2')]},'destcalleridnum':{'type':Sequelize[_0x520b('0x2')]},'destcalleridname':{'type':Sequelize[_0x520b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x520b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x520b('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x520b('0x2')]},'destcontext':{'type':Sequelize[_0x520b('0x2')]},'destexten':{'type':Sequelize[_0x520b('0x2')]},'destpriority':{'type':Sequelize[_0x520b('0x3')]},'destuniqueid':{'type':Sequelize[_0x520b('0x2')]},'destlinkedid':{'type':Sequelize[_0x520b('0x2')]},'dialstring':{'type':Sequelize[_0x520b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x520b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x520b('0x4')]},'lastevent':{'type':Sequelize[_0x520b('0x2')],'comment':_0x520b('0x5')},'routeId':{'type':Sequelize[_0x520b('0x3')]},'duration':{'type':Sequelize[_0x520b('0x3')]},'holdtime':{'type':Sequelize[_0x520b('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x60f2=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1da08f,_0x4c155d){var _0x35856b=function(_0xe6fb31){while(--_0xe6fb31){_0x1da08f['push'](_0x1da08f['shift']());}};_0x35856b(++_0x4c155d);}(_0x60f2,0x1bd));var _0x260f=function(_0x1a6cc8,_0x576287){_0x1a6cc8=_0x1a6cc8-0x0;var _0x2e8dad=_0x60f2[_0x1a6cc8];return _0x2e8dad;};'use strict';var Sequelize=require(_0x260f('0x0'));module[_0x260f('0x1')]={'privilege':{'type':Sequelize[_0x260f('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x260f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x260f('0x2')]},'calleridnum':{'type':Sequelize[_0x260f('0x2')]},'calleridname':{'type':Sequelize[_0x260f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x260f('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x260f('0x2')]},'accountcode':{'type':Sequelize[_0x260f('0x2')]},'context':{'type':Sequelize[_0x260f('0x2')]},'exten':{'type':Sequelize[_0x260f('0x2')]},'priority':{'type':Sequelize[_0x260f('0x3')]},'uniqueid':{'type':Sequelize[_0x260f('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x260f('0x2')]},'destchannelstate':{'type':Sequelize[_0x260f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x260f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x260f('0x2')]},'destcalleridname':{'type':Sequelize[_0x260f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x260f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x260f('0x2')]},'destlanguage':{'type':Sequelize[_0x260f('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x260f('0x2')]},'destexten':{'type':Sequelize[_0x260f('0x2')]},'destpriority':{'type':Sequelize[_0x260f('0x3')]},'destuniqueid':{'type':Sequelize[_0x260f('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x260f('0x2')]},'dialstatus':{'type':Sequelize[_0x260f('0x2')]},'starttime':{'type':Sequelize[_0x260f('0x4')]},'answertime':{'type':Sequelize[_0x260f('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x260f('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x260f('0x3')]},'holdtime':{'type':Sequelize[_0x260f('0x3')]},'billableseconds':{'type':Sequelize[_0x260f('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ec403ce..d7fc87e 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 _0xd6da=['hasOwnProperty','limit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','include','rows','show','filters','length','includeAll','catch','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','then','destroy','end','stack','name','send','index','VoiceDialReport','rawAttributes','model','keys','query','intersection','attributes','fields'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd6da,0x1c9));var _0xad6d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd6da[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xad6d('0x0'));var emlformat=require(_0xad6d('0x1'));var rimraf=require(_0xad6d('0x2'));var zipdir=require(_0xad6d('0x3'));var jsonpatch=require(_0xad6d('0x4'));var rp=require(_0xad6d('0x5'));var moment=require(_0xad6d('0x6'));var BPromise=require(_0xad6d('0x7'));var Mustache=require(_0xad6d('0x8'));var util=require('util');var path=require('path');var sox=require(_0xad6d('0x9'));var csv=require(_0xad6d('0xa'));var ejs=require(_0xad6d('0xb'));var fs=require('fs');var _=require(_0xad6d('0xc'));var squel=require(_0xad6d('0xd'));var crypto=require(_0xad6d('0xe'));var jsforce=require(_0xad6d('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad6d('0x10'));var authService=require(_0xad6d('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xad6d('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xad6d('0x13'))(_0xad6d('0x14'));var utils=require(_0xad6d('0x15'));var config=require(_0xad6d('0x16'));var db=require(_0xad6d('0x17'))['db'];function respondWithStatusCode(_0x2f4a26,_0x1e53ac){_0x1e53ac=_0x1e53ac||0xcc;return function(_0x21c845){if(_0x21c845){return _0x2f4a26[_0xad6d('0x18')](_0x1e53ac);}return _0x2f4a26[_0xad6d('0x19')](_0x1e53ac)['end']();};}function respondWithResult(_0x3d6f89,_0x13b702){_0x13b702=_0x13b702||0xc8;return function(_0x32955f){if(_0x32955f){return _0x3d6f89['status'](_0x13b702)['json'](_0x32955f);}};}function respondWithFilteredResult(_0x248e31,_0x51ebc3){return function(_0x459bbf){if(_0x459bbf){var _0x668487=_0x459bbf[_0xad6d('0x1a')],_0x26602d=_0x51ebc3[_0xad6d('0x1b')],_0xbca2b5=_0x51ebc3['offset']+_0x51ebc3['limit'],_0x902668;if(_0xbca2b5>=_0x668487){_0xbca2b5=_0x668487;_0x902668=0xc8;}else{_0x902668=0xce;}_0x248e31[_0xad6d('0x19')](_0x902668);return _0x248e31[_0xad6d('0x1c')](_0xad6d('0x1d'),_0x26602d+'-'+_0xbca2b5+'/'+_0x668487)[_0xad6d('0x1e')](_0x459bbf);}return null;};}function patchUpdates(_0x195828){return function(_0x1f8d93){try{jsonpatch[_0xad6d('0x1f')](_0x1f8d93,_0x195828,!![]);}catch(_0x3dabd9){return BPromise['reject'](_0x3dabd9);}return _0x1f8d93['save']();};}function saveUpdates(_0x5e72ef,_0x264119){return function(_0x161ebe){if(_0x161ebe){return _0x161ebe['update'](_0x5e72ef)[_0xad6d('0x20')](function(_0x520a31){return _0x520a31;});}return null;};}function removeEntity(_0x4e7d31,_0x36c4ae){return function(_0x16c2cb){if(_0x16c2cb){return _0x16c2cb[_0xad6d('0x21')]()['then'](function(){_0x4e7d31[_0xad6d('0x19')](0xcc)[_0xad6d('0x22')]();});}};}function handleEntityNotFound(_0x18dfe6,_0x58a86c){return function(_0x4f26a8){if(!_0x4f26a8){_0x18dfe6[_0xad6d('0x18')](0x194);}return _0x4f26a8;};}function handleError(_0x4c8b7f,_0x3f9a17){_0x3f9a17=_0x3f9a17||0x1f4;return function(_0x2f66b7){logger['error'](_0x2f66b7[_0xad6d('0x23')]);if(_0x2f66b7[_0xad6d('0x24')]){delete _0x2f66b7[_0xad6d('0x24')];}_0x4c8b7f[_0xad6d('0x19')](_0x3f9a17)[_0xad6d('0x25')](_0x2f66b7);};}exports[_0xad6d('0x26')]=function(_0x4b047b,_0x3c277a){var _0x4051b3={},_0x33f731={},_0x22278e={'count':0x0,'rows':[]};var _0x2744a6=db[_0xad6d('0x27')][_0xad6d('0x28')];_0x33f731[_0xad6d('0x29')]=_[_0xad6d('0x2a')](_0x2744a6);_0x33f731[_0xad6d('0x2b')]=_['keys'](_0x4b047b[_0xad6d('0x2b')]);_0x33f731['filters']=_[_0xad6d('0x2c')](_0x33f731[_0xad6d('0x29')],_0x33f731[_0xad6d('0x2b')]);_0x4051b3[_0xad6d('0x2d')]=_[_0xad6d('0x2c')](_0x33f731[_0xad6d('0x29')],qs[_0xad6d('0x2e')](_0x4b047b[_0xad6d('0x2b')]['fields']));_0x4051b3[_0xad6d('0x2d')]=_0x4051b3[_0xad6d('0x2d')]['length']?_0x4051b3[_0xad6d('0x2d')]:_0x33f731[_0xad6d('0x29')];if(!_0x4b047b[_0xad6d('0x2b')][_0xad6d('0x2f')]('nolimit')){_0x4051b3['limit']=qs[_0xad6d('0x30')](_0x4b047b['query'][_0xad6d('0x30')]);_0x4051b3['offset']=qs[_0xad6d('0x1b')](_0x4b047b['query'][_0xad6d('0x1b')]);}_0x4051b3[_0xad6d('0x31')]=qs[_0xad6d('0x32')](_0x4b047b[_0xad6d('0x2b')][_0xad6d('0x32')]);_0x4051b3[_0xad6d('0x33')]=qs['filters'](_[_0xad6d('0x34')](_0x4b047b[_0xad6d('0x2b')],_0x33f731['filters']));if(_0x4b047b[_0xad6d('0x2b')][_0xad6d('0x35')]){_0x4051b3[_0xad6d('0x33')]=_['merge'](_0x4051b3['where'],{'$or':_[_0xad6d('0x36')](_0x2744a6,function(_0x421ffe){if(_0x421ffe['type'][_0xad6d('0x37')]!==_0xad6d('0x38')){var _0x134a2a={};_0x134a2a[_0x421ffe[_0xad6d('0x39')]]={'$like':'%'+_0x4b047b[_0xad6d('0x2b')][_0xad6d('0x35')]+'%'};return _0x134a2a;}})});}_0x4051b3=_[_0xad6d('0x3a')]({},_0x4051b3,_0x4b047b[_0xad6d('0x3b')]);var _0x2c2bd4={'where':_0x4051b3[_0xad6d('0x33')]};return db['VoiceDialReport'][_0xad6d('0x1a')](_0x2c2bd4)['then'](function(_0x597a72){_0x22278e['count']=_0x597a72;if(_0x4b047b[_0xad6d('0x2b')]['includeAll']){_0x4051b3[_0xad6d('0x3c')]=[{'all':!![]}];}return db[_0xad6d('0x27')]['findAll'](_0x4051b3);})[_0xad6d('0x20')](function(_0x1621cb){_0x22278e[_0xad6d('0x3d')]=_0x1621cb;return _0x22278e;})[_0xad6d('0x20')](respondWithFilteredResult(_0x3c277a,_0x4051b3))['catch'](handleError(_0x3c277a,null));};exports[_0xad6d('0x3e')]=function(_0x5c30b2,_0xbfa624){var _0xe29c28={'raw':!![],'where':{'id':_0x5c30b2['params']['id']}},_0x37b489={};_0x37b489[_0xad6d('0x29')]=_[_0xad6d('0x2a')](db[_0xad6d('0x27')]['rawAttributes']);_0x37b489['query']=_[_0xad6d('0x2a')](_0x5c30b2[_0xad6d('0x2b')]);_0x37b489[_0xad6d('0x3f')]=_[_0xad6d('0x2c')](_0x37b489[_0xad6d('0x29')],_0x37b489[_0xad6d('0x2b')]);_0xe29c28[_0xad6d('0x2d')]=_['intersection'](_0x37b489['model'],qs[_0xad6d('0x2e')](_0x5c30b2[_0xad6d('0x2b')][_0xad6d('0x2e')]));_0xe29c28['attributes']=_0xe29c28[_0xad6d('0x2d')][_0xad6d('0x40')]?_0xe29c28[_0xad6d('0x2d')]:_0x37b489[_0xad6d('0x29')];if(_0x5c30b2[_0xad6d('0x2b')][_0xad6d('0x41')]){_0xe29c28[_0xad6d('0x3c')]=[{'all':!![]}];}_0xe29c28=_[_0xad6d('0x3a')]({},_0xe29c28,_0x5c30b2[_0xad6d('0x3b')]);return db[_0xad6d('0x27')]['find'](_0xe29c28)[_0xad6d('0x20')](handleEntityNotFound(_0xbfa624,null))[_0xad6d('0x20')](respondWithResult(_0xbfa624,null))[_0xad6d('0x42')](handleError(_0xbfa624,null));};exports[_0xad6d('0x43')]=function(_0x29a442,_0x5efc5f){return db[_0xad6d('0x27')]['create'](_0x29a442[_0xad6d('0x44')],{})[_0xad6d('0x20')](respondWithResult(_0x5efc5f,0xc9))[_0xad6d('0x42')](handleError(_0x5efc5f,null));};exports[_0xad6d('0x45')]=function(_0x32aa56,_0x1931ca){if(_0x32aa56[_0xad6d('0x44')]['id']){delete _0x32aa56[_0xad6d('0x44')]['id'];}return db[_0xad6d('0x27')][_0xad6d('0x46')]({'where':{'id':_0x32aa56['params']['id']}})['then'](handleEntityNotFound(_0x1931ca,null))[_0xad6d('0x20')](saveUpdates(_0x32aa56[_0xad6d('0x44')],null))[_0xad6d('0x20')](respondWithResult(_0x1931ca,null))[_0xad6d('0x42')](handleError(_0x1931ca,null));};exports[_0xad6d('0x21')]=function(_0x54ba3a,_0xd00342){return db[_0xad6d('0x27')][_0xad6d('0x46')]({'where':{'id':_0x54ba3a['params']['id']}})[_0xad6d('0x20')](handleEntityNotFound(_0xd00342,null))[_0xad6d('0x20')](removeEntity(_0xd00342,null))[_0xad6d('0x42')](handleError(_0xd00342,null));};exports['describe']=function(_0x17a71a,_0x357ce7){return db[_0xad6d('0x27')][_0xad6d('0x47')]()[_0xad6d('0x20')](respondWithResult(_0x357ce7,null))[_0xad6d('0x42')](handleError(_0x357ce7,null));}; \ No newline at end of file +var _0x8611=['destroy','then','error','send','index','VoiceDialReport','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x13bede,_0x2f74ef){var _0x39695e=function(_0x2e904d){while(--_0x2e904d){_0x13bede['push'](_0x13bede['shift']());}};_0x39695e(++_0x2f74ef);}(_0x8611,0x1e8));var _0x1861=function(_0x18dc4f,_0x198b20){_0x18dc4f=_0x18dc4f-0x0;var _0x2159c2=_0x8611[_0x18dc4f];return _0x2159c2;};'use strict';var pdf=require(_0x1861('0x0'));var emlformat=require(_0x1861('0x1'));var rimraf=require(_0x1861('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1861('0x3'));var rp=require(_0x1861('0x4'));var moment=require(_0x1861('0x5'));var BPromise=require(_0x1861('0x6'));var Mustache=require(_0x1861('0x7'));var util=require(_0x1861('0x8'));var path=require(_0x1861('0x9'));var sox=require(_0x1861('0xa'));var csv=require('to-csv');var ejs=require(_0x1861('0xb'));var fs=require('fs');var _=require(_0x1861('0xc'));var squel=require(_0x1861('0xd'));var crypto=require('crypto');var jsforce=require(_0x1861('0xe'));var deskjs=require(_0x1861('0xf'));var toCsv=require(_0x1861('0x10'));var querystring=require(_0x1861('0x11'));var Papa=require(_0x1861('0x12'));var authService=require(_0x1861('0x13'));var hardwareService=require(_0x1861('0x14'));var Redis=require(_0x1861('0x15'));var qs=require('../../components/parsers/qs');var logger=require(_0x1861('0x16'))(_0x1861('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1861('0x18'))['db'];function respondWithStatusCode(_0x2d5b52,_0x40b101){_0x40b101=_0x40b101||0xcc;return function(_0x40a8c6){if(_0x40a8c6){return _0x2d5b52['sendStatus'](_0x40b101);}return _0x2d5b52[_0x1861('0x19')](_0x40b101)[_0x1861('0x1a')]();};}function respondWithResult(_0x3e61cc,_0x3db8){_0x3db8=_0x3db8||0xc8;return function(_0x3af746){if(_0x3af746){return _0x3e61cc[_0x1861('0x19')](_0x3db8)[_0x1861('0x1b')](_0x3af746);}};}function respondWithFilteredResult(_0xe2587a,_0x3ffa69){return function(_0x19e378){if(_0x19e378){var _0x601e93=_0x19e378[_0x1861('0x1c')],_0x28a388=_0x3ffa69[_0x1861('0x1d')],_0x1be2ca=_0x3ffa69[_0x1861('0x1d')]+_0x3ffa69[_0x1861('0x1e')],_0x2500ad;if(_0x1be2ca>=_0x601e93){_0x1be2ca=_0x601e93;_0x2500ad=0xc8;}else{_0x2500ad=0xce;}_0xe2587a[_0x1861('0x19')](_0x2500ad);return _0xe2587a[_0x1861('0x1f')](_0x1861('0x20'),_0x28a388+'-'+_0x1be2ca+'/'+_0x601e93)[_0x1861('0x1b')](_0x19e378);}return null;};}function patchUpdates(_0xcebf8){return function(_0x5a7bab){try{jsonpatch[_0x1861('0x21')](_0x5a7bab,_0xcebf8,!![]);}catch(_0x10e302){return BPromise[_0x1861('0x22')](_0x10e302);}return _0x5a7bab[_0x1861('0x23')]();};}function saveUpdates(_0x3a9684,_0x4b00a5){return function(_0x111a4c){if(_0x111a4c){return _0x111a4c[_0x1861('0x24')](_0x3a9684)['then'](function(_0x32c3a2){return _0x32c3a2;});}return null;};}function removeEntity(_0xd3a727,_0x1279ba){return function(_0xabb4a4){if(_0xabb4a4){return _0xabb4a4[_0x1861('0x25')]()[_0x1861('0x26')](function(){_0xd3a727[_0x1861('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4dd0,_0x3b4e7e){return function(_0x41f989){if(!_0x41f989){_0x1a4dd0['sendStatus'](0x194);}return _0x41f989;};}function handleError(_0x3948ef,_0x217960){_0x217960=_0x217960||0x1f4;return function(_0x1ee86a){logger[_0x1861('0x27')](_0x1ee86a['stack']);if(_0x1ee86a['name']){delete _0x1ee86a['name'];}_0x3948ef['status'](_0x217960)[_0x1861('0x28')](_0x1ee86a);};}exports[_0x1861('0x29')]=function(_0x142e57,_0x2d29aa){var _0x13ce43={},_0x1f1bca={},_0x2f43cd={'count':0x0,'rows':[]};var _0x1c055d=db[_0x1861('0x2a')][_0x1861('0x2b')];_0x1f1bca[_0x1861('0x2c')]=_[_0x1861('0x2d')](_0x1c055d);_0x1f1bca[_0x1861('0x2e')]=_[_0x1861('0x2d')](_0x142e57['query']);_0x1f1bca['filters']=_['intersection'](_0x1f1bca[_0x1861('0x2c')],_0x1f1bca[_0x1861('0x2e')]);_0x13ce43[_0x1861('0x2f')]=_[_0x1861('0x30')](_0x1f1bca[_0x1861('0x2c')],qs['fields'](_0x142e57[_0x1861('0x2e')][_0x1861('0x31')]));_0x13ce43['attributes']=_0x13ce43[_0x1861('0x2f')]['length']?_0x13ce43['attributes']:_0x1f1bca[_0x1861('0x2c')];if(!_0x142e57[_0x1861('0x2e')][_0x1861('0x32')](_0x1861('0x33'))){_0x13ce43[_0x1861('0x1e')]=qs[_0x1861('0x1e')](_0x142e57['query'][_0x1861('0x1e')]);_0x13ce43['offset']=qs[_0x1861('0x1d')](_0x142e57['query'][_0x1861('0x1d')]);}_0x13ce43[_0x1861('0x34')]=qs[_0x1861('0x35')](_0x142e57[_0x1861('0x2e')][_0x1861('0x35')]);_0x13ce43[_0x1861('0x36')]=qs[_0x1861('0x37')](_[_0x1861('0x38')](_0x142e57[_0x1861('0x2e')],_0x1f1bca['filters']));if(_0x142e57[_0x1861('0x2e')][_0x1861('0x39')]){_0x13ce43[_0x1861('0x36')]=_['merge'](_0x13ce43['where'],{'$or':_[_0x1861('0x3a')](_0x1c055d,function(_0x4abb4e){if(_0x4abb4e[_0x1861('0x3b')][_0x1861('0x3c')]!==_0x1861('0x3d')){var _0x209d87={};_0x209d87[_0x4abb4e['field']]={'$like':'%'+_0x142e57['query'][_0x1861('0x39')]+'%'};return _0x209d87;}})});}_0x13ce43=_[_0x1861('0x3e')]({},_0x13ce43,_0x142e57[_0x1861('0x3f')]);var _0x1cc614={'where':_0x13ce43[_0x1861('0x36')]};return db[_0x1861('0x2a')]['count'](_0x1cc614)[_0x1861('0x26')](function(_0x1b8fd7){_0x2f43cd[_0x1861('0x1c')]=_0x1b8fd7;if(_0x142e57['query'][_0x1861('0x40')]){_0x13ce43[_0x1861('0x41')]=[{'all':!![]}];}return db[_0x1861('0x2a')][_0x1861('0x42')](_0x13ce43);})[_0x1861('0x26')](function(_0x451262){_0x2f43cd['rows']=_0x451262;return _0x2f43cd;})['then'](respondWithFilteredResult(_0x2d29aa,_0x13ce43))[_0x1861('0x43')](handleError(_0x2d29aa,null));};exports[_0x1861('0x44')]=function(_0x42ceee,_0x37ef40){var _0x206ef9={'raw':!![],'where':{'id':_0x42ceee[_0x1861('0x45')]['id']}},_0x204086={};_0x204086[_0x1861('0x2c')]=_[_0x1861('0x2d')](db[_0x1861('0x2a')][_0x1861('0x2b')]);_0x204086[_0x1861('0x2e')]=_[_0x1861('0x2d')](_0x42ceee[_0x1861('0x2e')]);_0x204086[_0x1861('0x37')]=_[_0x1861('0x30')](_0x204086[_0x1861('0x2c')],_0x204086['query']);_0x206ef9[_0x1861('0x2f')]=_['intersection'](_0x204086[_0x1861('0x2c')],qs[_0x1861('0x31')](_0x42ceee[_0x1861('0x2e')]['fields']));_0x206ef9[_0x1861('0x2f')]=_0x206ef9[_0x1861('0x2f')][_0x1861('0x46')]?_0x206ef9[_0x1861('0x2f')]:_0x204086['model'];if(_0x42ceee['query'][_0x1861('0x40')]){_0x206ef9[_0x1861('0x41')]=[{'all':!![]}];}_0x206ef9=_[_0x1861('0x3e')]({},_0x206ef9,_0x42ceee['options']);return db[_0x1861('0x2a')][_0x1861('0x47')](_0x206ef9)['then'](handleEntityNotFound(_0x37ef40,null))[_0x1861('0x26')](respondWithResult(_0x37ef40,null))[_0x1861('0x43')](handleError(_0x37ef40,null));};exports['create']=function(_0x1d83be,_0x1107ed){return db[_0x1861('0x2a')][_0x1861('0x48')](_0x1d83be[_0x1861('0x49')],{})['then'](respondWithResult(_0x1107ed,0xc9))['catch'](handleError(_0x1107ed,null));};exports[_0x1861('0x24')]=function(_0x400e18,_0x309e2a){if(_0x400e18[_0x1861('0x49')]['id']){delete _0x400e18['body']['id'];}return db[_0x1861('0x2a')][_0x1861('0x47')]({'where':{'id':_0x400e18[_0x1861('0x45')]['id']}})['then'](handleEntityNotFound(_0x309e2a,null))[_0x1861('0x26')](saveUpdates(_0x400e18[_0x1861('0x49')],null))[_0x1861('0x26')](respondWithResult(_0x309e2a,null))[_0x1861('0x43')](handleError(_0x309e2a,null));};exports[_0x1861('0x25')]=function(_0x4fa557,_0x3fb61f){return db['VoiceDialReport']['find']({'where':{'id':_0x4fa557[_0x1861('0x45')]['id']}})[_0x1861('0x26')](handleEntityNotFound(_0x3fb61f,null))['then'](removeEntity(_0x3fb61f,null))[_0x1861('0x43')](handleError(_0x3fb61f,null));};exports['describe']=function(_0x3a50bd,_0x13e2b8){return db[_0x1861('0x2a')][_0x1861('0x4a')]()['then'](respondWithResult(_0x13e2b8,null))['catch'](handleError(_0x13e2b8,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f1639f7..c8f9297 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 _0xfe37=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./voiceDialReport.attributes','define','VoiceDialReport','report_dial'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xfe37,0x1a2));var _0x7fe3=function(_0x5f21fb,_0xb6f747){_0x5f21fb=_0x5f21fb-0x0;var _0x52144a=_0xfe37[_0x5f21fb];return _0x52144a;};'use strict';var _=require(_0x7fe3('0x0'));var util=require(_0x7fe3('0x1'));var logger=require(_0x7fe3('0x2'))(_0x7fe3('0x3'));var moment=require(_0x7fe3('0x4'));var BPromise=require(_0x7fe3('0x5'));var rp=require(_0x7fe3('0x6'));var attributes=require(_0x7fe3('0x7'));module['exports']=function(_0x9e5afb,_0x41834e){return _0x9e5afb[_0x7fe3('0x8')](_0x7fe3('0x9'),attributes,{'tableName':_0x7fe3('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7bc=['moment','request-promise','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x539fea,_0x5e0837){var _0x1a86d0=function(_0x193bc8){while(--_0x193bc8){_0x539fea['push'](_0x539fea['shift']());}};_0x1a86d0(++_0x5e0837);}(_0xf7bc,0xb1));var _0xcf7b=function(_0x48bfa2,_0x2c7fe5){_0x48bfa2=_0x48bfa2-0x0;var _0x551640=_0xf7bc[_0x48bfa2];return _0x551640;};'use strict';var _=require(_0xcf7b('0x0'));var util=require(_0xcf7b('0x1'));var logger=require(_0xcf7b('0x2'))('api');var moment=require(_0xcf7b('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf7b('0x4'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x2f934c,_0x2f9fc2){return _0x2f934c[_0xcf7b('0x5')](_0xcf7b('0x6'),attributes,{'tableName':_0xcf7b('0x7'),'paranoid':![],'indexes':[{'fields':[_0xcf7b('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 393f44b..308b797 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 _0x1542=['message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','VoiceDialReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1542,0x116));var _0x2154=function(_0x21a7ff,_0x5d8291){_0x21a7ff=_0x21a7ff-0x0;var _0x1d60ea=_0x1542[_0x21a7ff];return _0x1d60ea;};'use strict';var _=require(_0x2154('0x0'));var util=require(_0x2154('0x1'));var moment=require(_0x2154('0x2'));var BPromise=require(_0x2154('0x3'));var rs=require(_0x2154('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2154('0x5'))['db'];var utils=require(_0x2154('0x6'));var logger=require(_0x2154('0x7'))('rpc');var config=require(_0x2154('0x8'));var jayson=require(_0x2154('0x9'));var client=jayson['client'][_0x2154('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23abb5,_0x257835,_0x791345){return new BPromise(function(_0x2e6295,_0x3696f3){return client[_0x2154('0xb')](_0x23abb5,_0x791345)[_0x2154('0xc')](function(_0x39f2c9){logger[_0x2154('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x257835,_0x2154('0xe'));logger[_0x2154('0xf')](_0x2154('0x10'),_0x257835,_0x2154('0xe'),JSON['stringify'](_0x39f2c9));if(_0x39f2c9[_0x2154('0x11')]){if(_0x39f2c9[_0x2154('0x11')]['code']===0x1f4){logger[_0x2154('0x11')](_0x2154('0x12'),_0x257835,_0x39f2c9[_0x2154('0x11')][_0x2154('0x13')]);return _0x3696f3(_0x39f2c9[_0x2154('0x11')][_0x2154('0x13')]);}logger[_0x2154('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x257835,_0x39f2c9['error'][_0x2154('0x13')]);return _0x2e6295(_0x39f2c9['error'][_0x2154('0x13')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x257835,'request\x20sent');_0x2e6295(_0x39f2c9[_0x2154('0x14')]['message']);}})[_0x2154('0x15')](function(_0x4f9308){logger[_0x2154('0x11')](_0x2154('0x12'),_0x257835,_0x4f9308);_0x3696f3(_0x4f9308);});});}exports[_0x2154('0x16')]=function(_0x35b468){var _0x14d29a=this;return new Promise(function(_0x46b72c,_0x15c197){return db[_0x2154('0x17')][_0x2154('0x18')](_0x35b468[_0x2154('0x19')],{'raw':_0x35b468['options']?_0x35b468[_0x2154('0x1a')][_0x2154('0x1b')]===undefined?!![]:![]:!![]})[_0x2154('0xc')](function(_0x57bc6a){logger[_0x2154('0xd')](_0x2154('0x16'),_0x35b468);logger[_0x2154('0xf')](_0x2154('0x16'),_0x35b468,JSON['stringify'](_0x57bc6a));_0x46b72c(_0x57bc6a);})[_0x2154('0x15')](function(_0xb10044){logger[_0x2154('0x11')]('CreateVoiceDialReport',_0xb10044['message'],_0x35b468);_0x15c197(_0x14d29a[_0x2154('0x11')](0x1f4,_0xb10044[_0x2154('0x13')]));});});};exports[_0x2154('0x1c')]=function(_0x4ef4f7){var _0x54ba3b=this;return new Promise(function(_0x177b33,_0x33f1a0){return db[_0x2154('0x17')][_0x2154('0x1d')](_0x4ef4f7['body'],{'raw':_0x4ef4f7[_0x2154('0x1a')]?_0x4ef4f7[_0x2154('0x1a')][_0x2154('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ef4f7['options']?_0x4ef4f7['options'][_0x2154('0x1e')]||null:null,'attributes':_0x4ef4f7[_0x2154('0x1a')]?_0x4ef4f7[_0x2154('0x1a')]['attributes']||null:null,'limit':_0x4ef4f7[_0x2154('0x1a')]?_0x4ef4f7[_0x2154('0x1a')][_0x2154('0x1f')]||null:null})[_0x2154('0xc')](function(_0x375a57){logger['info'](_0x2154('0x1c'),_0x4ef4f7);logger[_0x2154('0xf')](_0x2154('0x1c'),_0x4ef4f7,JSON[_0x2154('0x20')](_0x375a57));_0x177b33(_0x375a57);})[_0x2154('0x15')](function(_0x2dee3e){logger[_0x2154('0x11')]('UpdateVoiceDialReport',_0x2dee3e[_0x2154('0x13')],_0x4ef4f7);_0x33f1a0(_0x54ba3b[_0x2154('0x11')](0x1f4,_0x2dee3e['message']));});});}; \ No newline at end of file +var _0x5309=['../../config/logger','rpc','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceDialReport','create','options','raw','CreateVoiceDialReport','debug','UpdateVoiceDialReport','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x450ce8,_0x580110){var _0x423a2b=function(_0x1bf678){while(--_0x1bf678){_0x450ce8['push'](_0x450ce8['shift']());}};_0x423a2b(++_0x580110);}(_0x5309,0x1aa));var _0x9530=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0x5309[_0x17e771];return _0x1f3a6d;};'use strict';var _=require(_0x9530('0x0'));var util=require(_0x9530('0x1'));var moment=require(_0x9530('0x2'));var BPromise=require(_0x9530('0x3'));var rs=require(_0x9530('0x4'));var fs=require('fs');var Redis=require(_0x9530('0x5'));var db=require(_0x9530('0x6'))['db'];var utils=require(_0x9530('0x7'));var logger=require(_0x9530('0x8'))(_0x9530('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9530('0xa')][_0x9530('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1259cc,_0x5a4126,_0x5f5c1d){return new BPromise(function(_0x24f66b,_0x49deed){return client[_0x9530('0xc')](_0x1259cc,_0x5f5c1d)[_0x9530('0xd')](function(_0x449aa8){logger[_0x9530('0xe')](_0x9530('0xf'),_0x5a4126,_0x9530('0x10'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x5a4126,_0x9530('0x10'),JSON[_0x9530('0x11')](_0x449aa8));if(_0x449aa8[_0x9530('0x12')]){if(_0x449aa8[_0x9530('0x12')][_0x9530('0x13')]===0x1f4){logger[_0x9530('0x12')](_0x9530('0xf'),_0x5a4126,_0x449aa8[_0x9530('0x12')][_0x9530('0x14')]);return _0x49deed(_0x449aa8[_0x9530('0x12')][_0x9530('0x14')]);}logger['error'](_0x9530('0xf'),_0x5a4126,_0x449aa8['error'][_0x9530('0x14')]);return _0x24f66b(_0x449aa8[_0x9530('0x12')]['message']);}else{logger[_0x9530('0xe')](_0x9530('0xf'),_0x5a4126,'request\x20sent');_0x24f66b(_0x449aa8[_0x9530('0x15')][_0x9530('0x14')]);}})[_0x9530('0x16')](function(_0x14db25){logger[_0x9530('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x5a4126,_0x14db25);_0x49deed(_0x14db25);});});}exports['CreateVoiceDialReport']=function(_0x244c8f){var _0x1333b8=this;return new Promise(function(_0x5b2836,_0x1d50db){return db[_0x9530('0x17')][_0x9530('0x18')](_0x244c8f['body'],{'raw':_0x244c8f['options']?_0x244c8f[_0x9530('0x19')][_0x9530('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x117662){logger[_0x9530('0xe')](_0x9530('0x1b'),_0x244c8f);logger[_0x9530('0x1c')](_0x9530('0x1b'),_0x244c8f,JSON[_0x9530('0x11')](_0x117662));_0x5b2836(_0x117662);})[_0x9530('0x16')](function(_0x3b0732){logger[_0x9530('0x12')](_0x9530('0x1b'),_0x3b0732['message'],_0x244c8f);_0x1d50db(_0x1333b8[_0x9530('0x12')](0x1f4,_0x3b0732['message']));});});};exports[_0x9530('0x1d')]=function(_0x48cacf){var _0x1af5d8=this;return new Promise(function(_0x4c791e,_0x519864){return db[_0x9530('0x17')]['update'](_0x48cacf['body'],{'raw':_0x48cacf[_0x9530('0x19')]?_0x48cacf[_0x9530('0x19')][_0x9530('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48cacf[_0x9530('0x19')]?_0x48cacf[_0x9530('0x19')]['where']||null:null,'attributes':_0x48cacf[_0x9530('0x19')]?_0x48cacf[_0x9530('0x19')]['attributes']||null:null,'limit':_0x48cacf['options']?_0x48cacf['options'][_0x9530('0x1e')]||null:null})['then'](function(_0x3b0a14){logger[_0x9530('0xe')](_0x9530('0x1d'),_0x48cacf);logger[_0x9530('0x1c')](_0x9530('0x1d'),_0x48cacf,JSON[_0x9530('0x11')](_0x3b0a14));_0x4c791e(_0x3b0a14);})[_0x9530('0x16')](function(_0x2c64d6){logger[_0x9530('0x12')](_0x9530('0x1d'),_0x2c64d6[_0x9530('0x14')],_0x48cacf);_0x519864(_0x1af5d8[_0x9530('0x12')](0x1f4,_0x2c64d6['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ee4d462..18f49b8 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 _0x2c91=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','/:id/applications','addApplications'];(function(_0x31737a,_0x49f148){var _0x37c46e=function(_0x44bb7e){while(--_0x44bb7e){_0x31737a['push'](_0x31737a['shift']());}};_0x37c46e(++_0x49f148);}(_0x2c91,0x158));var _0x12c9=function(_0x58153e,_0x2f91cd){_0x58153e=_0x58153e-0x0;var _0x263984=_0x2c91[_0x58153e];return _0x263984;};'use strict';var multer=require(_0x12c9('0x0'));var util=require(_0x12c9('0x1'));var path=require(_0x12c9('0x2'));var timeout=require(_0x12c9('0x3'));var express=require(_0x12c9('0x4'));var router=express[_0x12c9('0x5')]();var auth=require(_0x12c9('0x6'));var interaction=require(_0x12c9('0x7'));var config=require('../../config/environment');var controller=require(_0x12c9('0x8'));router[_0x12c9('0x9')]('/',auth[_0x12c9('0xa')](),controller[_0x12c9('0xb')]);router[_0x12c9('0x9')](_0x12c9('0xc'),auth[_0x12c9('0xa')](),controller['show']);router[_0x12c9('0xd')]('/',auth[_0x12c9('0xa')](),controller['create']);router[_0x12c9('0xd')](_0x12c9('0xe'),auth['isAuthenticated'](),controller[_0x12c9('0xf')]);router[_0x12c9('0x10')]('/:id',auth[_0x12c9('0xa')](),controller[_0x12c9('0x11')]);router['delete'](_0x12c9('0xc'),auth[_0x12c9('0xa')](),controller[_0x12c9('0x12')]);module[_0x12c9('0x13')]=router; \ No newline at end of file +var _0x38b2=['util','path','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','create','post','/:id/applications','addApplications','put','update','delete','/:id','exports','multer'];(function(_0x26ecb,_0x57ad75){var _0x2ab0cb=function(_0x4c64ec){while(--_0x4c64ec){_0x26ecb['push'](_0x26ecb['shift']());}};_0x2ab0cb(++_0x57ad75);}(_0x38b2,0xf6));var _0x238b=function(_0x5b1f72,_0x2edd94){_0x5b1f72=_0x5b1f72-0x0;var _0x58fa63=_0x38b2[_0x5b1f72];return _0x58fa63;};'use strict';var multer=require(_0x238b('0x0'));var util=require(_0x238b('0x1'));var path=require(_0x238b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x238b('0x3')]();var auth=require(_0x238b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x238b('0x5'));var controller=require('./voiceExtension.controller');router[_0x238b('0x6')]('/',auth[_0x238b('0x7')](),controller[_0x238b('0x8')]);router[_0x238b('0x6')]('/:id',auth[_0x238b('0x7')](),controller[_0x238b('0x9')]);router['post']('/',auth[_0x238b('0x7')](),controller[_0x238b('0xa')]);router[_0x238b('0xb')](_0x238b('0xc'),auth[_0x238b('0x7')](),controller[_0x238b('0xd')]);router[_0x238b('0xe')]('/:id',auth[_0x238b('0x7')](),controller[_0x238b('0xf')]);router[_0x238b('0x10')](_0x238b('0x11'),auth[_0x238b('0x7')](),controller['destroy']);module[_0x238b('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 3318af4..8956a6e 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 _0x6f7a=['INTEGER','wav','BOOLEAN','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','system','any','*,*,*,*'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x441737,_0x158ac5){_0x441737=_0x441737-0x0;var _0x2a16b6=_0x6f7a[_0x441737];return _0x2a16b6;};'use strict';var Sequelize=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]={'context':{'type':Sequelize[_0xa6f7('0x2')],'allowNull':![],'unique':_0xa6f7('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa6f7('0x3')},'priority':{'type':Sequelize[_0xa6f7('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xa6f7('0x3')},'tag':{'type':Sequelize[_0xa6f7('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xa6f7('0x2')],'allowNull':![],'defaultValue':_0xa6f7('0x4')},'appdata':{'type':Sequelize[_0xa6f7('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xa6f7('0x5')](_0xa6f7('0x6'),_0xa6f7('0x7'),_0xa6f7('0x8'),'inbound-fax','outbound-fax',_0xa6f7('0x9'),_0xa6f7('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xa6f7('0x2')]},'interval':{'type':Sequelize[_0xa6f7('0x2')],'allowNull':![],'defaultValue':_0xa6f7('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa6f7('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xa6f7('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xa6f7('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0xd')},'answer':{'type':Sequelize[_0xa6f7('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xa6f7('0xf')],'get':function(_0xd5558b){return this['getDataValue'](_0xa6f7('0x10'));}}}; \ No newline at end of file +var _0xd3d1=['outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax'];(function(_0x3770f6,_0x23971c){var _0xea115f=function(_0x3e6495){while(--_0x3e6495){_0x3770f6['push'](_0x3770f6['shift']());}};_0xea115f(++_0x23971c);}(_0xd3d1,0x172));var _0x1d3d=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xd3d1[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x1d3d('0x0'));module[_0x1d3d('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1d3d('0x2')],'allowNull':![],'unique':_0x1d3d('0x3')},'priority':{'type':Sequelize[_0x1d3d('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x1d3d('0x3')},'tag':{'type':Sequelize[_0x1d3d('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x1d3d('0x2')],'allowNull':![],'defaultValue':_0x1d3d('0x4')},'appdata':{'type':Sequelize[_0x1d3d('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x1d3d('0x5')](_0x1d3d('0x6'),_0x1d3d('0x7'),_0x1d3d('0x8'),_0x1d3d('0x9'),_0x1d3d('0xa'),_0x1d3d('0xb'),_0x1d3d('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x1d3d('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1d3d('0xd')},'IntervalId':{'type':Sequelize[_0x1d3d('0xe')]},'isApp':{'type':Sequelize[_0x1d3d('0xf')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1d3d('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x1d3d('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x1d3d('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1d3d('0xe')]},'recordingFormat':{'type':Sequelize[_0x1d3d('0x2')],'defaultValue':_0x1d3d('0x10')},'answer':{'type':Sequelize[_0x1d3d('0xf')],'defaultValue':!![]},'name':{'type':Sequelize[_0x1d3d('0x11')],'get':function(_0x479216){return this[_0x1d3d('0x12')](_0x1d3d('0x13'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index a0858f5..e208fc5 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 _0xea81=['save','then','InboundRoutes','inbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','UserProfileResource','destroy','sendStatus','error','stack','index','rawAttributes','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','key','field','merge','VoiceExtension','includeAll','include','findAll','catch','show','params','intersection','options','find','create','body','outbound','startsWith','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','name','update','context','cutdigits','mandatoryDisposition','addApplications','findOne','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','count','offset','limit','set','json','apply','reject'];(function(_0x2da082,_0xb59d2b){var _0xc9b361=function(_0x41db5c){while(--_0x41db5c){_0x2da082['push'](_0x2da082['shift']());}};_0xc9b361(++_0xb59d2b);}(_0xea81,0x1ed));var _0x1ea8=function(_0x28a584,_0x53e1d5){_0x28a584=_0x28a584-0x0;var _0x1f121e=_0xea81[_0x28a584];return _0x1f121e;};'use strict';var pdf=require(_0x1ea8('0x0'));var emlformat=require(_0x1ea8('0x1'));var rimraf=require(_0x1ea8('0x2'));var zipdir=require(_0x1ea8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1ea8('0x4'));var BPromise=require(_0x1ea8('0x5'));var Mustache=require(_0x1ea8('0x6'));var util=require(_0x1ea8('0x7'));var path=require(_0x1ea8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1ea8('0x9'));var squel=require(_0x1ea8('0xa'));var crypto=require(_0x1ea8('0xb'));var jsforce=require(_0x1ea8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1ea8('0xd'));var querystring=require(_0x1ea8('0xe'));var Papa=require(_0x1ea8('0xf'));var authService=require(_0x1ea8('0x10'));var hardwareService=require(_0x1ea8('0x11'));var Redis=require('ioredis');var qs=require(_0x1ea8('0x12'));var logger=require('../../config/logger')(_0x1ea8('0x13'));var utils=require(_0x1ea8('0x14'));var config=require(_0x1ea8('0x15'));var db=require(_0x1ea8('0x16'))['db'];config[_0x1ea8('0x17')]=_['defaults'](config['redis'],{'host':_0x1ea8('0x18'),'port':0x18eb});var socket=require(_0x1ea8('0x19'))(new Redis(config['redis']));require(_0x1ea8('0x1a'))[_0x1ea8('0x1b')](socket);function respondWithStatusCode(_0x97d328,_0x184601){_0x184601=_0x184601||0xcc;return function(_0x122406){if(_0x122406){return _0x97d328['sendStatus'](_0x184601);}return _0x97d328[_0x1ea8('0x1c')](_0x184601)[_0x1ea8('0x1d')]();};}function respondWithResult(_0x3e072d,_0x4f1197){_0x4f1197=_0x4f1197||0xc8;return function(_0x2d5b07){if(_0x2d5b07){return _0x3e072d[_0x1ea8('0x1c')](_0x4f1197)['json'](_0x2d5b07);}};}function respondWithFilteredResult(_0x5c053a,_0x3292bc){return function(_0x4b80f9){if(_0x4b80f9){var _0x46c78a=_0x4b80f9[_0x1ea8('0x1e')],_0x4cf432=_0x3292bc[_0x1ea8('0x1f')],_0x239c3d=_0x3292bc[_0x1ea8('0x1f')]+_0x3292bc[_0x1ea8('0x20')],_0x228391;if(_0x239c3d>=_0x46c78a){_0x239c3d=_0x46c78a;_0x228391=0xc8;}else{_0x228391=0xce;}_0x5c053a[_0x1ea8('0x1c')](_0x228391);return _0x5c053a[_0x1ea8('0x21')]('Content-Range',_0x4cf432+'-'+_0x239c3d+'/'+_0x46c78a)[_0x1ea8('0x22')](_0x4b80f9);}return null;};}function patchUpdates(_0x2a3b4c){return function(_0x1b0148){try{jsonpatch[_0x1ea8('0x23')](_0x1b0148,_0x2a3b4c,!![]);}catch(_0x106f33){return BPromise[_0x1ea8('0x24')](_0x106f33);}return _0x1b0148[_0x1ea8('0x25')]();};}function saveUpdates(_0x13f554,_0xad7ad3){return function(_0x247a47){if(_0x247a47){return _0x247a47['update'](_0x13f554)[_0x1ea8('0x26')](function(_0x489180){return _0x489180;});}return null;};}function removeEntity(_0x4276f0,_0x4e03ee){return function(_0x311e2e){if(_0x311e2e){return _0x311e2e['destroy']()[_0x1ea8('0x26')](function(){var _0x5106f7=_0x311e2e['get']({'plain':!![]});var _0x2d7b5c=[{'name':_0x1ea8('0x27'),'value':_0x1ea8('0x28'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x1ea8('0x29'),'value':_0x1ea8('0x2a'),'ignore':![]}];var _0x34e04b=_(_0x2d7b5c)[_0x1ea8('0x2b')](_0x1ea8('0x2c'))[_0x1ea8('0x2d')](_0x1ea8('0x2e'))['value']();if(_[_0x1ea8('0x2f')](_0x34e04b,_0x5106f7['type'])){return;}var _0x6129d4=_['find'](_0x2d7b5c,[_0x1ea8('0x2e'),_0x5106f7[_0x1ea8('0x30')]])['name'];return db[_0x1ea8('0x31')][_0x1ea8('0x32')]({'where':{'type':_0x6129d4,'resourceId':_0x5106f7['id']}})[_0x1ea8('0x26')](function(){return _0x311e2e;});})[_0x1ea8('0x26')](function(){_0x4276f0[_0x1ea8('0x1c')](0xcc)[_0x1ea8('0x1d')]();});}};}function handleEntityNotFound(_0x37cac7,_0x33d7c8){return function(_0x1091c2){if(!_0x1091c2){_0x37cac7[_0x1ea8('0x33')](0x194);}return _0x1091c2;};}function handleError(_0x3e236e,_0x39eb2d){_0x39eb2d=_0x39eb2d||0x1f4;return function(_0x752060){logger[_0x1ea8('0x34')](_0x752060[_0x1ea8('0x35')]);if(_0x752060['name']){delete _0x752060['name'];}_0x3e236e[_0x1ea8('0x1c')](_0x39eb2d)['send'](_0x752060);};}exports[_0x1ea8('0x36')]=function(_0x27f9e8,_0x123790){var _0x5b81b8={},_0x485ab4={},_0x349f9c={'count':0x0,'rows':[]};var _0x4ea0c0=db['VoiceExtension'][_0x1ea8('0x37')];_0x485ab4[_0x1ea8('0x38')]=_[_0x1ea8('0x39')](_0x4ea0c0);_0x485ab4[_0x1ea8('0x3a')]=_[_0x1ea8('0x39')](_0x27f9e8[_0x1ea8('0x3a')]);_0x485ab4[_0x1ea8('0x3b')]=_['intersection'](_0x485ab4[_0x1ea8('0x38')],_0x485ab4[_0x1ea8('0x3a')]);_0x5b81b8[_0x1ea8('0x3c')]=_['intersection'](_0x485ab4['model'],qs[_0x1ea8('0x3d')](_0x27f9e8[_0x1ea8('0x3a')][_0x1ea8('0x3d')]));_0x5b81b8['attributes']=_0x5b81b8[_0x1ea8('0x3c')][_0x1ea8('0x3e')]?_0x5b81b8[_0x1ea8('0x3c')]:_0x485ab4[_0x1ea8('0x38')];if(!_0x27f9e8[_0x1ea8('0x3a')]['hasOwnProperty'](_0x1ea8('0x3f'))){_0x5b81b8[_0x1ea8('0x20')]=qs['limit'](_0x27f9e8[_0x1ea8('0x3a')][_0x1ea8('0x20')]);_0x5b81b8['offset']=qs[_0x1ea8('0x1f')](_0x27f9e8[_0x1ea8('0x3a')]['offset']);}_0x5b81b8[_0x1ea8('0x40')]=qs[_0x1ea8('0x41')](_0x27f9e8[_0x1ea8('0x3a')]['sort']);_0x5b81b8[_0x1ea8('0x42')]=qs[_0x1ea8('0x3b')](_[_0x1ea8('0x43')](_0x27f9e8['query'],_0x485ab4[_0x1ea8('0x3b')]));if(_0x27f9e8['query'][_0x1ea8('0x2b')]){_0x5b81b8[_0x1ea8('0x42')]=_['merge'](_0x5b81b8['where'],{'$or':_[_0x1ea8('0x2d')](_0x4ea0c0,function(_0x4118cf){if(_0x4118cf[_0x1ea8('0x30')][_0x1ea8('0x44')]!=='VIRTUAL'){var _0x51d606={};_0x51d606[_0x4118cf[_0x1ea8('0x45')]]={'$like':'%'+_0x27f9e8['query'][_0x1ea8('0x2b')]+'%'};return _0x51d606;}})});}_0x5b81b8=_[_0x1ea8('0x46')]({},_0x5b81b8,_0x27f9e8['options']);var _0x11fab9={'where':_0x5b81b8[_0x1ea8('0x42')]};return db[_0x1ea8('0x47')]['count'](_0x11fab9)[_0x1ea8('0x26')](function(_0x32c9a7){_0x349f9c[_0x1ea8('0x1e')]=_0x32c9a7;if(_0x27f9e8[_0x1ea8('0x3a')][_0x1ea8('0x48')]){_0x5b81b8[_0x1ea8('0x49')]=[{'all':!![]}];}return db[_0x1ea8('0x47')][_0x1ea8('0x4a')](_0x5b81b8);})[_0x1ea8('0x26')](function(_0x42077c){_0x349f9c['rows']=_0x42077c;return _0x349f9c;})[_0x1ea8('0x26')](respondWithFilteredResult(_0x123790,_0x5b81b8))[_0x1ea8('0x4b')](handleError(_0x123790,null));};exports[_0x1ea8('0x4c')]=function(_0x52ec28,_0x4547e8){var _0x55e869={'raw':![],'where':{'id':_0x52ec28[_0x1ea8('0x4d')]['id']}},_0x1e3011={};_0x1e3011[_0x1ea8('0x38')]=_[_0x1ea8('0x39')](db[_0x1ea8('0x47')][_0x1ea8('0x37')]);_0x1e3011[_0x1ea8('0x3a')]=_[_0x1ea8('0x39')](_0x52ec28[_0x1ea8('0x3a')]);_0x1e3011['filters']=_['intersection'](_0x1e3011[_0x1ea8('0x38')],_0x1e3011[_0x1ea8('0x3a')]);_0x55e869[_0x1ea8('0x3c')]=_[_0x1ea8('0x4e')](_0x1e3011[_0x1ea8('0x38')],qs['fields'](_0x52ec28[_0x1ea8('0x3a')][_0x1ea8('0x3d')]));_0x55e869[_0x1ea8('0x3c')]=_0x55e869[_0x1ea8('0x3c')][_0x1ea8('0x3e')]?_0x55e869[_0x1ea8('0x3c')]:_0x1e3011[_0x1ea8('0x38')];if(_0x52ec28[_0x1ea8('0x3a')]['includeAll']){_0x55e869[_0x1ea8('0x49')]=[{'all':!![]}];}_0x55e869=_['merge']({},_0x55e869,_0x52ec28[_0x1ea8('0x4f')]);return db[_0x1ea8('0x47')][_0x1ea8('0x50')](_0x55e869)['then'](handleEntityNotFound(_0x4547e8,null))['then'](respondWithResult(_0x4547e8,null))['catch'](handleError(_0x4547e8,null));};exports[_0x1ea8('0x32')]=function(_0x2a8bd7,_0x3bb40c){return db['VoiceExtension'][_0x1ea8('0x50')]({'where':{'id':_0x2a8bd7[_0x1ea8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3bb40c,null))[_0x1ea8('0x26')](removeEntity(_0x3bb40c,null))[_0x1ea8('0x4b')](handleError(_0x3bb40c,null));};exports[_0x1ea8('0x51')]=function(_0xed1cd5,_0x2df89b){if(_0xed1cd5[_0x1ea8('0x52')][_0x1ea8('0x30')]===_0x1ea8('0x53')&&!_[_0x1ea8('0x54')](_0xed1cd5[_0x1ea8('0x52')][_0x1ea8('0x55')],'_')){_0xed1cd5[_0x1ea8('0x52')][_0x1ea8('0x55')]='_'[_0x1ea8('0x56')](_0xed1cd5[_0x1ea8('0x52')]['exten']);}return db['VoiceExtension'][_0x1ea8('0x51')](_0xed1cd5['body'],{'raw':![]})[_0x1ea8('0x26')](function(_0x37dbfd){var _0x38d717=_0xed1cd5[_0x1ea8('0x57')][_0x1ea8('0x58')]({'plain':!![]});if(!_0x38d717)throw new Error(_0x1ea8('0x59'));if(_0x38d717[_0x1ea8('0x5a')]===_0x1ea8('0x57')){var _0x137509=_0x37dbfd[_0x1ea8('0x58')]({'plain':!![]});var _0x19f945=[{'name':'InboundRoutes','value':_0x1ea8('0x28')},{'name':_0x1ea8('0x5b'),'value':'outbound'},{'name':_0x1ea8('0x29'),'value':_0x1ea8('0x2a')}];var _0x288820=_['find'](_0x19f945,[_0x1ea8('0x2e'),_0x137509[_0x1ea8('0x30')]])['name'];return db[_0x1ea8('0x5c')][_0x1ea8('0x50')]({'where':{'name':_0x288820,'userProfileId':_0x38d717[_0x1ea8('0x5d')]},'raw':!![]})['then'](function(_0x4bde99){if(_0x4bde99&&_0x4bde99[_0x1ea8('0x5e')]===0x0){return db[_0x1ea8('0x31')][_0x1ea8('0x51')]({'name':_0x137509[_0x1ea8('0x5f')],'resourceId':_0x137509['id'],'type':_0x4bde99[_0x1ea8('0x5f')],'sectionId':_0x4bde99['id']},{})[_0x1ea8('0x26')](function(){return _0x37dbfd;});}else{return _0x37dbfd;}})[_0x1ea8('0x4b')](function(_0x468e88){logger[_0x1ea8('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x468e88);throw _0x468e88;});}return _0x37dbfd;})[_0x1ea8('0x26')](respondWithResult(_0x2df89b,0xc9))[_0x1ea8('0x4b')](handleError(_0x2df89b,null));};exports[_0x1ea8('0x60')]=function(_0x28e71b,_0x4227b8){if(_0x28e71b['body']['id']){delete _0x28e71b[_0x1ea8('0x52')]['id'];}return db['VoiceExtension'][_0x1ea8('0x50')]({'where':{'id':_0x28e71b[_0x1ea8('0x4d')]['id']}})[_0x1ea8('0x26')](handleEntityNotFound(_0x4227b8,null))[_0x1ea8('0x26')](function(_0x334895){if(_0x334895){return db[_0x1ea8('0x47')][_0x1ea8('0x60')](_['pick'](_0x28e71b[_0x1ea8('0x52')],[_0x1ea8('0x55'),_0x1ea8('0x61'),'description','recordingFormat',_0x1ea8('0x62'),_0x1ea8('0x63')]),{'where':{'context':_0x334895[_0x1ea8('0x61')],'exten':_0x334895[_0x1ea8('0x55')]},'individualHooks':!![]})[_0x1ea8('0x26')](function(_0x2e476a){return _0x2e476a;});}return null;})[_0x1ea8('0x26')](respondWithStatusCode(_0x4227b8,null))['catch'](handleError(_0x4227b8,null));};exports[_0x1ea8('0x64')]=function(_0x1c21c3,_0x5928c9,_0x1e4f60){return db[_0x1ea8('0x47')][_0x1ea8('0x65')]({'where':{'id':_0x1c21c3[_0x1ea8('0x4d')]['id']}})[_0x1ea8('0x26')](handleEntityNotFound(_0x5928c9,null))['then'](function(_0xa16cda){if(_0xa16cda){return db['sequelize'][_0x1ea8('0x66')](function(_0x5dad07){return db[_0x1ea8('0x47')][_0x1ea8('0x32')]({'where':{'VoiceExtensionId':_0x1c21c3[_0x1ea8('0x4d')]['id']},'transaction':_0x5dad07})[_0x1ea8('0x26')](function(_0x10c8f2){var _0x2f5bdf=_[_0x1ea8('0x2d')](_0x1c21c3[_0x1ea8('0x52')],function(_0x4bedfa){_0x4bedfa[_0x1ea8('0x67')]=_0x1c21c3['params']['id'];return _0x4bedfa;});return db[_0x1ea8('0x47')][_0x1ea8('0x68')](_0x2f5bdf,{'transaction':_0x5dad07});});})['then'](function(){return db[_0x1ea8('0x47')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x1c21c3[_0x1ea8('0x4d')]['id']},'order':_0x1ea8('0x69')});});}})[_0x1ea8('0x26')](respondWithResult(_0x5928c9,null))[_0x1ea8('0x4b')](handleError(_0x5928c9,null));}; \ No newline at end of file +var _0xbbbd=['params','keys','includeAll','create','outbound','startsWith','body','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','cutdigits','mandatoryDisposition','findOne','sequelize','transaction','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','inbound','OutboundRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','key','VIRTUAL','field','options','include','rows','catch','show'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xbbbd,0x86));var _0xdbbb=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xbbbd[_0x565ed7];return _0x183ad7;};'use strict';var pdf=require(_0xdbbb('0x0'));var emlformat=require(_0xdbbb('0x1'));var rimraf=require(_0xdbbb('0x2'));var zipdir=require(_0xdbbb('0x3'));var jsonpatch=require(_0xdbbb('0x4'));var rp=require(_0xdbbb('0x5'));var moment=require(_0xdbbb('0x6'));var BPromise=require(_0xdbbb('0x7'));var Mustache=require(_0xdbbb('0x8'));var util=require(_0xdbbb('0x9'));var path=require(_0xdbbb('0xa'));var sox=require(_0xdbbb('0xb'));var csv=require('to-csv');var ejs=require(_0xdbbb('0xc'));var fs=require('fs');var _=require(_0xdbbb('0xd'));var squel=require(_0xdbbb('0xe'));var crypto=require(_0xdbbb('0xf'));var jsforce=require(_0xdbbb('0x10'));var deskjs=require(_0xdbbb('0x11'));var toCsv=require(_0xdbbb('0x12'));var querystring=require(_0xdbbb('0x13'));var Papa=require(_0xdbbb('0x14'));var authService=require(_0xdbbb('0x15'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xdbbb('0x16'));var qs=require('../../components/parsers/qs');var logger=require(_0xdbbb('0x17'))('api');var utils=require(_0xdbbb('0x18'));var config=require(_0xdbbb('0x19'));var db=require(_0xdbbb('0x1a'))['db'];config[_0xdbbb('0x1b')]=_[_0xdbbb('0x1c')](config[_0xdbbb('0x1b')],{'host':_0xdbbb('0x1d'),'port':0x18eb});var socket=require(_0xdbbb('0x1e'))(new Redis(config[_0xdbbb('0x1b')]));require('./voiceExtension.socket')[_0xdbbb('0x1f')](socket);function respondWithStatusCode(_0x5a2c64,_0x21706f){_0x21706f=_0x21706f||0xcc;return function(_0x22713c){if(_0x22713c){return _0x5a2c64[_0xdbbb('0x20')](_0x21706f);}return _0x5a2c64[_0xdbbb('0x21')](_0x21706f)[_0xdbbb('0x22')]();};}function respondWithResult(_0x14eb3a,_0x2f0f91){_0x2f0f91=_0x2f0f91||0xc8;return function(_0xf4af5){if(_0xf4af5){return _0x14eb3a[_0xdbbb('0x21')](_0x2f0f91)[_0xdbbb('0x23')](_0xf4af5);}};}function respondWithFilteredResult(_0x203feb,_0x172098){return function(_0x4a18d9){if(_0x4a18d9){var _0x7d3d3a=_0x4a18d9[_0xdbbb('0x24')],_0xbbf0b4=_0x172098[_0xdbbb('0x25')],_0x50c9ec=_0x172098[_0xdbbb('0x25')]+_0x172098['limit'],_0x5c4b3d;if(_0x50c9ec>=_0x7d3d3a){_0x50c9ec=_0x7d3d3a;_0x5c4b3d=0xc8;}else{_0x5c4b3d=0xce;}_0x203feb[_0xdbbb('0x21')](_0x5c4b3d);return _0x203feb[_0xdbbb('0x26')]('Content-Range',_0xbbf0b4+'-'+_0x50c9ec+'/'+_0x7d3d3a)[_0xdbbb('0x23')](_0x4a18d9);}return null;};}function patchUpdates(_0x1c2e3f){return function(_0x128f93){try{jsonpatch[_0xdbbb('0x27')](_0x128f93,_0x1c2e3f,!![]);}catch(_0x4b0984){return BPromise[_0xdbbb('0x28')](_0x4b0984);}return _0x128f93[_0xdbbb('0x29')]();};}function saveUpdates(_0x6c7610,_0xe98d9e){return function(_0x29c9c6){if(_0x29c9c6){return _0x29c9c6[_0xdbbb('0x2a')](_0x6c7610)['then'](function(_0xf998f2){return _0xf998f2;});}return null;};}function removeEntity(_0x2de604,_0x537086){return function(_0x47df58){if(_0x47df58){return _0x47df58[_0xdbbb('0x2b')]()[_0xdbbb('0x2c')](function(){var _0x11b13a=_0x47df58['get']({'plain':!![]});var _0x371c0b=[{'name':'InboundRoutes','value':_0xdbbb('0x2d'),'ignore':![]},{'name':_0xdbbb('0x2e'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0xdbbb('0x2f'),'ignore':![]}];var _0x50fa66=_(_0x371c0b)['filter'](_0xdbbb('0x30'))[_0xdbbb('0x31')](_0xdbbb('0x32'))[_0xdbbb('0x32')]();if(_[_0xdbbb('0x33')](_0x50fa66,_0x11b13a[_0xdbbb('0x34')])){return;}var _0x452bea=_[_0xdbbb('0x35')](_0x371c0b,['value',_0x11b13a[_0xdbbb('0x34')]])[_0xdbbb('0x36')];return db[_0xdbbb('0x37')]['destroy']({'where':{'type':_0x452bea,'resourceId':_0x11b13a['id']}})[_0xdbbb('0x2c')](function(){return _0x47df58;});})[_0xdbbb('0x2c')](function(){_0x2de604[_0xdbbb('0x21')](0xcc)[_0xdbbb('0x22')]();});}};}function handleEntityNotFound(_0x5e0b4b,_0x2a98f9){return function(_0x5aae16){if(!_0x5aae16){_0x5e0b4b[_0xdbbb('0x20')](0x194);}return _0x5aae16;};}function handleError(_0x4e82b5,_0x2a34d8){_0x2a34d8=_0x2a34d8||0x1f4;return function(_0x1c842f){logger[_0xdbbb('0x38')](_0x1c842f[_0xdbbb('0x39')]);if(_0x1c842f[_0xdbbb('0x36')]){delete _0x1c842f[_0xdbbb('0x36')];}_0x4e82b5[_0xdbbb('0x21')](_0x2a34d8)[_0xdbbb('0x3a')](_0x1c842f);};}exports[_0xdbbb('0x3b')]=function(_0x89f9f4,_0x4ba8a9){var _0xaa4e6={},_0xb9d8f2={},_0x2a72ba={'count':0x0,'rows':[]};var _0x3c11b7=db[_0xdbbb('0x3c')][_0xdbbb('0x3d')];_0xb9d8f2[_0xdbbb('0x3e')]=_['keys'](_0x3c11b7);_0xb9d8f2[_0xdbbb('0x3f')]=_['keys'](_0x89f9f4[_0xdbbb('0x3f')]);_0xb9d8f2[_0xdbbb('0x40')]=_['intersection'](_0xb9d8f2[_0xdbbb('0x3e')],_0xb9d8f2[_0xdbbb('0x3f')]);_0xaa4e6[_0xdbbb('0x41')]=_[_0xdbbb('0x42')](_0xb9d8f2[_0xdbbb('0x3e')],qs['fields'](_0x89f9f4[_0xdbbb('0x3f')][_0xdbbb('0x43')]));_0xaa4e6['attributes']=_0xaa4e6[_0xdbbb('0x41')][_0xdbbb('0x44')]?_0xaa4e6[_0xdbbb('0x41')]:_0xb9d8f2[_0xdbbb('0x3e')];if(!_0x89f9f4[_0xdbbb('0x3f')][_0xdbbb('0x45')]('nolimit')){_0xaa4e6[_0xdbbb('0x46')]=qs[_0xdbbb('0x46')](_0x89f9f4[_0xdbbb('0x3f')][_0xdbbb('0x46')]);_0xaa4e6[_0xdbbb('0x25')]=qs[_0xdbbb('0x25')](_0x89f9f4['query'][_0xdbbb('0x25')]);}_0xaa4e6[_0xdbbb('0x47')]=qs[_0xdbbb('0x48')](_0x89f9f4[_0xdbbb('0x3f')][_0xdbbb('0x48')]);_0xaa4e6[_0xdbbb('0x49')]=qs[_0xdbbb('0x40')](_['pick'](_0x89f9f4['query'],_0xb9d8f2['filters']));if(_0x89f9f4[_0xdbbb('0x3f')][_0xdbbb('0x4a')]){_0xaa4e6['where']=_[_0xdbbb('0x4b')](_0xaa4e6[_0xdbbb('0x49')],{'$or':_[_0xdbbb('0x31')](_0x3c11b7,function(_0x215853){if(_0x215853[_0xdbbb('0x34')][_0xdbbb('0x4c')]!==_0xdbbb('0x4d')){var _0x43c7d8={};_0x43c7d8[_0x215853[_0xdbbb('0x4e')]]={'$like':'%'+_0x89f9f4[_0xdbbb('0x3f')][_0xdbbb('0x4a')]+'%'};return _0x43c7d8;}})});}_0xaa4e6=_['merge']({},_0xaa4e6,_0x89f9f4[_0xdbbb('0x4f')]);var _0x4a1cd6={'where':_0xaa4e6[_0xdbbb('0x49')]};return db['VoiceExtension'][_0xdbbb('0x24')](_0x4a1cd6)[_0xdbbb('0x2c')](function(_0x1f4a09){_0x2a72ba[_0xdbbb('0x24')]=_0x1f4a09;if(_0x89f9f4[_0xdbbb('0x3f')]['includeAll']){_0xaa4e6[_0xdbbb('0x50')]=[{'all':!![]}];}return db[_0xdbbb('0x3c')]['findAll'](_0xaa4e6);})['then'](function(_0x5f30d8){_0x2a72ba[_0xdbbb('0x51')]=_0x5f30d8;return _0x2a72ba;})['then'](respondWithFilteredResult(_0x4ba8a9,_0xaa4e6))[_0xdbbb('0x52')](handleError(_0x4ba8a9,null));};exports[_0xdbbb('0x53')]=function(_0x31a717,_0x4109b6){var _0x232c7b={'raw':![],'where':{'id':_0x31a717[_0xdbbb('0x54')]['id']}},_0x4956c3={};_0x4956c3['model']=_[_0xdbbb('0x55')](db['VoiceExtension']['rawAttributes']);_0x4956c3[_0xdbbb('0x3f')]=_[_0xdbbb('0x55')](_0x31a717[_0xdbbb('0x3f')]);_0x4956c3[_0xdbbb('0x40')]=_[_0xdbbb('0x42')](_0x4956c3[_0xdbbb('0x3e')],_0x4956c3[_0xdbbb('0x3f')]);_0x232c7b[_0xdbbb('0x41')]=_[_0xdbbb('0x42')](_0x4956c3[_0xdbbb('0x3e')],qs[_0xdbbb('0x43')](_0x31a717[_0xdbbb('0x3f')][_0xdbbb('0x43')]));_0x232c7b['attributes']=_0x232c7b['attributes'][_0xdbbb('0x44')]?_0x232c7b[_0xdbbb('0x41')]:_0x4956c3[_0xdbbb('0x3e')];if(_0x31a717[_0xdbbb('0x3f')][_0xdbbb('0x56')]){_0x232c7b[_0xdbbb('0x50')]=[{'all':!![]}];}_0x232c7b=_['merge']({},_0x232c7b,_0x31a717['options']);return db['VoiceExtension']['find'](_0x232c7b)[_0xdbbb('0x2c')](handleEntityNotFound(_0x4109b6,null))['then'](respondWithResult(_0x4109b6,null))[_0xdbbb('0x52')](handleError(_0x4109b6,null));};exports[_0xdbbb('0x2b')]=function(_0x1b8ab1,_0x39621e){return db[_0xdbbb('0x3c')][_0xdbbb('0x35')]({'where':{'id':_0x1b8ab1[_0xdbbb('0x54')]['id']}})[_0xdbbb('0x2c')](handleEntityNotFound(_0x39621e,null))[_0xdbbb('0x2c')](removeEntity(_0x39621e,null))[_0xdbbb('0x52')](handleError(_0x39621e,null));};exports[_0xdbbb('0x57')]=function(_0x387ae2,_0x527bc7){if(_0x387ae2['body'][_0xdbbb('0x34')]===_0xdbbb('0x58')&&!_[_0xdbbb('0x59')](_0x387ae2[_0xdbbb('0x5a')][_0xdbbb('0x5b')],'_')){_0x387ae2[_0xdbbb('0x5a')][_0xdbbb('0x5b')]='_'[_0xdbbb('0x5c')](_0x387ae2[_0xdbbb('0x5a')][_0xdbbb('0x5b')]);}return db[_0xdbbb('0x3c')][_0xdbbb('0x57')](_0x387ae2[_0xdbbb('0x5a')],{'raw':![]})[_0xdbbb('0x2c')](function(_0x5f5762){var _0x46c9db=_0x387ae2[_0xdbbb('0x5d')][_0xdbbb('0x5e')]({'plain':!![]});if(!_0x46c9db)throw new Error(_0xdbbb('0x5f'));if(_0x46c9db[_0xdbbb('0x60')]===_0xdbbb('0x5d')){var _0xbd301=_0x5f5762[_0xdbbb('0x5e')]({'plain':!![]});var _0x4bef5e=[{'name':'InboundRoutes','value':_0xdbbb('0x2d')},{'name':_0xdbbb('0x2e'),'value':_0xdbbb('0x58')},{'name':_0xdbbb('0x61'),'value':_0xdbbb('0x2f')}];var _0x1165dc=_[_0xdbbb('0x35')](_0x4bef5e,['value',_0xbd301[_0xdbbb('0x34')]])[_0xdbbb('0x36')];return db['UserProfileSection'][_0xdbbb('0x35')]({'where':{'name':_0x1165dc,'userProfileId':_0x46c9db[_0xdbbb('0x62')]},'raw':!![]})[_0xdbbb('0x2c')](function(_0x3c7839){if(_0x3c7839&&_0x3c7839['autoAssociation']===0x0){return db['UserProfileResource'][_0xdbbb('0x57')]({'name':_0xbd301[_0xdbbb('0x36')],'resourceId':_0xbd301['id'],'type':_0x3c7839[_0xdbbb('0x36')],'sectionId':_0x3c7839['id']},{})[_0xdbbb('0x2c')](function(){return _0x5f5762;});}else{return _0x5f5762;}})[_0xdbbb('0x52')](function(_0x468cba){logger[_0xdbbb('0x38')](_0xdbbb('0x63'),_0x468cba);throw _0x468cba;});}return _0x5f5762;})['then'](respondWithResult(_0x527bc7,0xc9))[_0xdbbb('0x52')](handleError(_0x527bc7,null));};exports['update']=function(_0x27aa5d,_0x1363bb){if(_0x27aa5d[_0xdbbb('0x5a')]['id']){delete _0x27aa5d[_0xdbbb('0x5a')]['id'];}return db[_0xdbbb('0x3c')][_0xdbbb('0x35')]({'where':{'id':_0x27aa5d[_0xdbbb('0x54')]['id']}})[_0xdbbb('0x2c')](handleEntityNotFound(_0x1363bb,null))[_0xdbbb('0x2c')](function(_0x5be090){if(_0x5be090){return db[_0xdbbb('0x3c')][_0xdbbb('0x2a')](_[_0xdbbb('0x64')](_0x27aa5d[_0xdbbb('0x5a')],['exten',_0xdbbb('0x65'),_0xdbbb('0x66'),'recordingFormat',_0xdbbb('0x67'),_0xdbbb('0x68')]),{'where':{'context':_0x5be090[_0xdbbb('0x65')],'exten':_0x5be090['exten']},'individualHooks':!![]})[_0xdbbb('0x2c')](function(_0x5275fa){return _0x5275fa;});}return null;})[_0xdbbb('0x2c')](respondWithStatusCode(_0x1363bb,null))[_0xdbbb('0x52')](handleError(_0x1363bb,null));};exports['addApplications']=function(_0x2cc08a,_0x164b33,_0x59304b){return db['VoiceExtension'][_0xdbbb('0x69')]({'where':{'id':_0x2cc08a[_0xdbbb('0x54')]['id']}})[_0xdbbb('0x2c')](handleEntityNotFound(_0x164b33,null))[_0xdbbb('0x2c')](function(_0x38974b){if(_0x38974b){return db[_0xdbbb('0x6a')][_0xdbbb('0x6b')](function(_0x4083aa){return db[_0xdbbb('0x3c')][_0xdbbb('0x2b')]({'where':{'VoiceExtensionId':_0x2cc08a[_0xdbbb('0x54')]['id']},'transaction':_0x4083aa})['then'](function(_0x239d69){var _0x315d8f=_[_0xdbbb('0x31')](_0x2cc08a[_0xdbbb('0x5a')],function(_0x1a1f70){_0x1a1f70['VoiceExtensionId']=_0x2cc08a[_0xdbbb('0x54')]['id'];return _0x1a1f70;});return db['VoiceExtension']['bulkCreate'](_0x315d8f,{'transaction':_0x4083aa});});})['then'](function(){return db[_0xdbbb('0x3c')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x2cc08a[_0xdbbb('0x54')]['id']},'order':_0xdbbb('0x6c')});});}})[_0xdbbb('0x2c')](respondWithResult(_0x164b33,null))[_0xdbbb('0x52')](handleError(_0x164b33,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index cf943a3..c1160bb 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 _0x7823=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x362046,_0x5cf93f){var _0x419ffe=function(_0x18cb42){while(--_0x18cb42){_0x362046['push'](_0x362046['shift']());}};_0x419ffe(++_0x5cf93f);}(_0x7823,0x1cf));var _0x3782=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7823[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x3782('0x0'));var VoiceExtension=require(_0x3782('0x1'))['db'][_0x3782('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3782('0x3')](0x0);var events={'afterCreate':_0x3782('0x4'),'afterUpdate':_0x3782('0x5'),'afterDestroy':_0x3782('0x6')};function emitEvent(_0x6b0609){return function(_0x30c4a1,_0x130585,_0x1ec752){VoiceExtensionEvents[_0x3782('0x7')](_0x6b0609+':'+_0x30c4a1['id'],_0x30c4a1);VoiceExtensionEvents['emit'](_0x6b0609,_0x30c4a1);_0x1ec752(null);};}for(var e in events){if(events[_0x3782('0x8')](e)){var event=events[e];VoiceExtension[_0x3782('0x9')](e,emitEvent(event));}}module[_0x3782('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0xa54c=['events','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x593ae0,_0x4af589){var _0x3fdb3e=function(_0x2f3ed6){while(--_0x2f3ed6){_0x593ae0['push'](_0x593ae0['shift']());}};_0x3fdb3e(++_0x4af589);}(_0xa54c,0x138));var _0xca54=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xa54c[_0x55abd9];return _0x3e5669;};'use strict';var EventEmitter=require(_0xca54('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca54('0x1'),'afterUpdate':_0xca54('0x2'),'afterDestroy':_0xca54('0x3')};function emitEvent(_0xde0378){return function(_0xbdf747,_0x5abfac,_0x860ddd){VoiceExtensionEvents[_0xca54('0x4')](_0xde0378+':'+_0xbdf747['id'],_0xbdf747);VoiceExtensionEvents['emit'](_0xde0378,_0xbdf747);_0x860ddd(null);};}for(var e in events){if(events[_0xca54('0x5')](e)){var event=events[e];VoiceExtension[_0xca54('0x6')](e,emitEvent(event));}}module[_0xca54('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f92003e..408a309 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 _0x94ad=['./voiceExtension.attributes','VoiceExtension','voice_extensions','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x94ad,0x13e));var _0xd94a=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x94ad[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require('lodash');var util=require(_0xd94a('0x0'));var logger=require(_0xd94a('0x1'))(_0xd94a('0x2'));var moment=require(_0xd94a('0x3'));var BPromise=require(_0xd94a('0x4'));var rp=require(_0xd94a('0x5'));var attributes=require(_0xd94a('0x6'));module['exports']=function(_0xeb6ada,_0x511422){return _0xeb6ada['define'](_0xd94a('0x7'),attributes,{'tableName':_0xd94a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf306=['request-promise','./voiceExtension.attributes','exports','define','VoiceExtension','lodash','util','../../config/logger','moment'];(function(_0x47b3ff,_0x2414fd){var _0xb23370=function(_0x3c6de6){while(--_0x3c6de6){_0x47b3ff['push'](_0x47b3ff['shift']());}};_0xb23370(++_0x2414fd);}(_0xf306,0xf8));var _0x6f30=function(_0x4479e0,_0x58c25b){_0x4479e0=_0x4479e0-0x0;var _0x972de8=_0xf306[_0x4479e0];return _0x972de8;};'use strict';var _=require(_0x6f30('0x0'));var util=require(_0x6f30('0x1'));var logger=require(_0x6f30('0x2'))('api');var moment=require(_0x6f30('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f30('0x4'));var attributes=require(_0x6f30('0x5'));module[_0x6f30('0x6')]=function(_0x34d230,_0x1adbee){return _0x34d230[_0x6f30('0x7')](_0x6f30('0x8'),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 fa9bd32..92eef8a 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 _0xa9e0=['map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include'];(function(_0x4e1549,_0x4da55c){var _0xe450c2=function(_0x5f4109){while(--_0x5f4109){_0x4e1549['push'](_0x4e1549['shift']());}};_0xe450c2(++_0x4da55c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceExtension.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')]('VoiceExtension,\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['VoiceExtension'][_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')]('GetVoiceExtension',_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')]));});});}; \ No newline at end of file +var _0x91a7=['then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','debug','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','request'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x91a7,0xe7));var _0x791a=function(_0x5569bc,_0x49387f){_0x5569bc=_0x5569bc-0x0;var _0x4a6211=_0x91a7[_0x5569bc];return _0x4a6211;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});config['redis']=_[_0x791a('0x8')](config[_0x791a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x791a('0xa'))(new Redis(config[_0x791a('0x9')]));require(_0x791a('0xb'))[_0x791a('0xc')](socket);function respondWithRpcPromise(_0x266e4b,_0x5249d5,_0x21f0e0){return new BPromise(function(_0x38f7c2,_0x57e99c){return client[_0x791a('0xd')](_0x266e4b,_0x21f0e0)[_0x791a('0xe')](function(_0x167bc4){logger[_0x791a('0xf')](_0x791a('0x10'),_0x5249d5,_0x791a('0x11'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x5249d5,_0x791a('0x11'),JSON[_0x791a('0x12')](_0x167bc4));if(_0x167bc4['error']){if(_0x167bc4[_0x791a('0x13')][_0x791a('0x14')]===0x1f4){logger['error'](_0x791a('0x10'),_0x5249d5,_0x167bc4[_0x791a('0x13')][_0x791a('0x15')]);return _0x57e99c(_0x167bc4[_0x791a('0x13')]['message']);}logger[_0x791a('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x5249d5,_0x167bc4[_0x791a('0x13')][_0x791a('0x15')]);return _0x38f7c2(_0x167bc4['error'][_0x791a('0x15')]);}else{logger['info'](_0x791a('0x10'),_0x5249d5,'request\x20sent');_0x38f7c2(_0x167bc4['result']['message']);}})[_0x791a('0x16')](function(_0x52fa43){logger['error'](_0x791a('0x10'),_0x5249d5,_0x52fa43);_0x57e99c(_0x52fa43);});});}exports[_0x791a('0x17')]=function(_0x3a31a3){var _0x364ca1=this;return new Promise(function(_0x5f3cec,_0x189c0d){return db[_0x791a('0x18')][_0x791a('0x19')]({'raw':_0x3a31a3[_0x791a('0x1a')]?_0x3a31a3['options'][_0x791a('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a31a3[_0x791a('0x1a')]?_0x3a31a3[_0x791a('0x1a')][_0x791a('0x1c')]||null:null,'attributes':_0x3a31a3[_0x791a('0x1a')]?_0x3a31a3[_0x791a('0x1a')][_0x791a('0x1d')]||null:null,'limit':_0x3a31a3[_0x791a('0x1a')]?_0x3a31a3[_0x791a('0x1a')][_0x791a('0x1e')]||null:null,'include':_0x3a31a3[_0x791a('0x1a')]?_0x3a31a3['options'][_0x791a('0x1f')]?_[_0x791a('0x20')](_0x3a31a3[_0x791a('0x1a')][_0x791a('0x1f')],function(_0x4d748a){return{'model':db[_0x4d748a[_0x791a('0x21')]],'as':_0x4d748a['as'],'attributes':_0x4d748a[_0x791a('0x1d')],'include':_0x4d748a['include']?_[_0x791a('0x20')](_0x4d748a[_0x791a('0x1f')],function(_0x16dbaf){return{'model':db[_0x16dbaf['model']],'as':_0x16dbaf['as'],'attributes':_0x16dbaf[_0x791a('0x1d')],'include':_0x16dbaf[_0x791a('0x1f')]?_[_0x791a('0x20')](_0x16dbaf[_0x791a('0x1f')],function(_0x4f423){return{'model':db[_0x4f423[_0x791a('0x21')]],'as':_0x4f423['as'],'attributes':_0x4f423[_0x791a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x791a('0xe')](function(_0x58bbc0){logger[_0x791a('0xf')](_0x791a('0x17'),_0x3a31a3);logger[_0x791a('0x22')]('GetVoiceExtension',_0x3a31a3,JSON[_0x791a('0x12')](_0x58bbc0));_0x5f3cec(_0x58bbc0);})['catch'](function(_0xc59f5e){logger[_0x791a('0x13')](_0x791a('0x17'),_0xc59f5e[_0x791a('0x15')],_0x3a31a3);_0x189c0d(_0x364ca1[_0x791a('0x13')](0x1f4,_0xc59f5e[_0x791a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b0f3490..80f9657 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 _0xd53c=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','register'];(function(_0x5dcaed,_0x1d7c10){var _0x28fff4=function(_0xa15b15){while(--_0xa15b15){_0x5dcaed['push'](_0x5dcaed['shift']());}};_0x28fff4(++_0x1d7c10);}(_0xd53c,0x1e2));var _0xcd53=function(_0x254175,_0x3a6fae){_0x254175=_0x254175-0x0;var _0x2ee652=_0xd53c[_0x254175];return _0x2ee652;};'use strict';var VoiceExtensionEvents=require(_0xcd53('0x0'));var events=[_0xcd53('0x1'),_0xcd53('0x2'),_0xcd53('0x3')];function createListener(_0x3268c7,_0x29f7f2){return function(_0x21ff68){_0x29f7f2[_0xcd53('0x4')](_0x3268c7,_0x21ff68);};}function removeListener(_0x15b37e,_0x1d57b7){return function(){VoiceExtensionEvents['removeListener'](_0x15b37e,_0x1d57b7);};}exports[_0xcd53('0x5')]=function(_0x22afcc){for(var _0x455930=0x0,_0x1cd0b8=events[_0xcd53('0x6')];_0x455930<_0x1cd0b8;_0x455930++){var _0x13dde2=events[_0x455930];var _0x29e2f8=createListener(_0xcd53('0x7')+_0x13dde2,_0x22afcc);VoiceExtensionEvents['on'](_0x13dde2,_0x29e2f8);}}; \ No newline at end of file +var _0x525c=['save','remove','update','emit','removeListener','length','voiceExtension:','./voiceExtension.events'];(function(_0xf39239,_0xbc1117){var _0x56d1b5=function(_0x53c1f0){while(--_0x53c1f0){_0xf39239['push'](_0xf39239['shift']());}};_0x56d1b5(++_0xbc1117);}(_0x525c,0x1bf));var _0xc525=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x525c[_0x1b7368];return _0x25d54c;};'use strict';var VoiceExtensionEvents=require(_0xc525('0x0'));var events=[_0xc525('0x1'),_0xc525('0x2'),_0xc525('0x3')];function createListener(_0x553ae3,_0x1babe4){return function(_0x505c0f){_0x1babe4[_0xc525('0x4')](_0x553ae3,_0x505c0f);};}function removeListener(_0x32006d,_0x47e241){return function(){VoiceExtensionEvents[_0xc525('0x5')](_0x32006d,_0x47e241);};}exports['register']=function(_0xda6bc7){for(var _0x2e7ab2=0x0,_0x50a3f7=events[_0xc525('0x6')];_0x2e7ab2<_0x50a3f7;_0x2e7ab2++){var _0x333804=events[_0x2e7ab2];var _0x38ccdb=createListener(_0xc525('0x7')+_0x333804,_0xda6bc7);VoiceExtensionEvents['on'](_0x333804,_0x38ccdb);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index c5edb20..acec3c1 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 _0xca06=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','post','put','update','delete'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xca06,0x74));var _0x6ca0=function(_0x1cc71f,_0x233689){_0x1cc71f=_0x1cc71f-0x0;var _0x33d0b5=_0xca06[_0x1cc71f];return _0x33d0b5;};'use strict';var multer=require(_0x6ca0('0x0'));var util=require(_0x6ca0('0x1'));var path=require(_0x6ca0('0x2'));var timeout=require(_0x6ca0('0x3'));var express=require(_0x6ca0('0x4'));var router=express[_0x6ca0('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6ca0('0x6'));var controller=require(_0x6ca0('0x7'));router[_0x6ca0('0x8')]('/',auth[_0x6ca0('0x9')](),controller[_0x6ca0('0xa')]);router[_0x6ca0('0x8')](_0x6ca0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6ca0('0x8')](_0x6ca0('0xc'),auth[_0x6ca0('0x9')](),controller['getMessages']);router[_0x6ca0('0xd')]('/',auth[_0x6ca0('0x9')](),controller['create']);router[_0x6ca0('0xe')](_0x6ca0('0xb'),auth[_0x6ca0('0x9')](),controller[_0x6ca0('0xf')]);router[_0x6ca0('0x10')](_0x6ca0('0xb'),auth['isAuthenticated'](),controller[_0x6ca0('0x11')]);module[_0x6ca0('0x12')]=router; \ No newline at end of file +var _0xa0d0=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages'];(function(_0x3e213d,_0x28697a){var _0x85b5af=function(_0x5aa678){while(--_0x5aa678){_0x3e213d['push'](_0x3e213d['shift']());}};_0x85b5af(++_0x28697a);}(_0xa0d0,0xaf));var _0x0a0d=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa0d0[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x0a0d('0x0'));var util=require(_0x0a0d('0x1'));var path=require(_0x0a0d('0x2'));var timeout=require(_0x0a0d('0x3'));var express=require(_0x0a0d('0x4'));var router=express[_0x0a0d('0x5')]();var auth=require(_0x0a0d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a0d('0x7'));router[_0x0a0d('0x8')]('/',auth[_0x0a0d('0x9')](),controller[_0x0a0d('0xa')]);router[_0x0a0d('0x8')](_0x0a0d('0xb'),auth[_0x0a0d('0x9')](),controller[_0x0a0d('0xc')]);router[_0x0a0d('0x8')]('/:id/messages',auth[_0x0a0d('0x9')](),controller[_0x0a0d('0xd')]);router[_0x0a0d('0xe')]('/',auth[_0x0a0d('0x9')](),controller[_0x0a0d('0xf')]);router[_0x0a0d('0x10')](_0x0a0d('0xb'),auth[_0x0a0d('0x9')](),controller[_0x0a0d('0x11')]);router[_0x0a0d('0x12')]('/:id',auth[_0x0a0d('0x9')](),controller[_0x0a0d('0x13')]);module[_0x0a0d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d373bab..ddf4318 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 _0x25b3=['exports','from-voicemail','contest_mailbox','STRING','trim','central','ENUM','yes','TIMESTAMP','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','sequelize'];(function(_0x13fbf3,_0x9d385d){var _0x3abe39=function(_0x8e8d2a){while(--_0x8e8d2a){_0x13fbf3['push'](_0x13fbf3['shift']());}};_0x3abe39(++_0x9d385d);}(_0x25b3,0x1a3));var _0x325b=function(_0x4114dd,_0x2ad862){_0x4114dd=_0x4114dd-0x0;var _0x26f44c=_0x25b3[_0x4114dd];return _0x26f44c;};'use strict';var Sequelize=require(_0x325b('0x0'));module[_0x325b('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x325b('0x2'),'unique':_0x325b('0x3')},'mailbox':{'type':Sequelize[_0x325b('0x4')],'defaultValue':'','allowNull':![],'unique':_0x325b('0x3')},'password':{'type':Sequelize[_0x325b('0x4')]},'fullname':{'type':Sequelize[_0x325b('0x4')]},'email':{'type':Sequelize[_0x325b('0x4')],'validate':{'isEmail':!![]},'set':function(_0x3de6c0){this['setDataValue']('email',typeof _0x3de6c0==='string'&&_0x3de6c0[_0x325b('0x5')]()?_0x3de6c0[_0x325b('0x5')]():null);}},'pager':{'type':Sequelize[_0x325b('0x4')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x325b('0x6')},'attach':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':_0x325b('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x325b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x325b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':_0x325b('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x325b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x325b('0x7')](_0x325b('0x8'),'no'),'defaultValue':_0x325b('0x8'),'allowNull':![]},'stamp':{'type':_0x325b('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x325b('0x4')]},'maxsecs':{'type':Sequelize[_0x325b('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x325b('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x325b('0xb'))+_0x325b('0xc')+this[_0x325b('0xd')](_0x325b('0xe'));}}}; \ No newline at end of file +var _0x8b41=['VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x4a74bc,_0xd8b778){var _0x456142=function(_0x382b7c){while(--_0x382b7c){_0x4a74bc['push'](_0x4a74bc['shift']());}};_0x456142(++_0xd8b778);}(_0x8b41,0x83));var _0x18b4=function(_0x3c7ce2,_0x4a9ec7){_0x3c7ce2=_0x3c7ce2-0x0;var _0x4ef0d9=_0x8b41[_0x3c7ce2];return _0x4ef0d9;};'use strict';var Sequelize=require(_0x18b4('0x0'));module[_0x18b4('0x1')]={'customer_id':{'type':Sequelize[_0x18b4('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x18b4('0x2')],'defaultValue':'','allowNull':![],'unique':_0x18b4('0x3')},'password':{'type':Sequelize[_0x18b4('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x18b4('0x2')],'validate':{'isEmail':!![]},'set':function(_0x498441){this[_0x18b4('0x4')](_0x18b4('0x5'),typeof _0x498441==='string'&&_0x498441[_0x18b4('0x6')]()?_0x498441[_0x18b4('0x6')]():null);}},'pager':{'type':Sequelize[_0x18b4('0x2')]},'tz':{'type':Sequelize[_0x18b4('0x2')],'defaultValue':_0x18b4('0x7')},'attach':{'type':Sequelize[_0x18b4('0x8')](_0x18b4('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x18b4('0x8')](_0x18b4('0x9'),'no'),'defaultValue':_0x18b4('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x18b4('0x2')]},'callback':{'type':Sequelize[_0x18b4('0x2')]},'review':{'type':Sequelize[_0x18b4('0x8')](_0x18b4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x18b4('0x8')](_0x18b4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x18b4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x18b4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x18b4('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x18b4('0x8')](_0x18b4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x18b4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x18b4('0x8')]('yes','no'),'defaultValue':_0x18b4('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x18b4('0x8')](_0x18b4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x18b4('0x8')](_0x18b4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x18b4('0x9'),'no'),'defaultValue':_0x18b4('0x9'),'allowNull':![]},'stamp':{'type':_0x18b4('0xb')},'emailsubject':{'type':Sequelize[_0x18b4('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x18b4('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x18b4('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x18b4('0xd')],'get':function(){return this[_0x18b4('0xe')](_0x18b4('0xf'))+_0x18b4('0x10')+this[_0x18b4('0xe')](_0x18b4('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 6868ea1..01befbb 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 _0xfdcb=['VoiceMail','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index'];(function(_0x4a5a5f,_0x282be6){var _0x4f8122=function(_0x2db965){while(--_0x2db965){_0x4a5a5f['push'](_0x4a5a5f['shift']());}};_0x4f8122(++_0x282be6);}(_0xfdcb,0xd4));var _0xbfdc=function(_0x3ec501,_0x1d035a){_0x3ec501=_0x3ec501-0x0;var _0x5a3037=_0xfdcb[_0x3ec501];return _0x5a3037;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbfdc('0x0'));var rimraf=require(_0xbfdc('0x1'));var zipdir=require(_0xbfdc('0x2'));var jsonpatch=require(_0xbfdc('0x3'));var rp=require(_0xbfdc('0x4'));var moment=require(_0xbfdc('0x5'));var BPromise=require(_0xbfdc('0x6'));var Mustache=require(_0xbfdc('0x7'));var util=require(_0xbfdc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xbfdc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbfdc('0xa'));var crypto=require(_0xbfdc('0xb'));var jsforce=require(_0xbfdc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbfdc('0x9'));var querystring=require(_0xbfdc('0xd'));var Papa=require(_0xbfdc('0xe'));var authService=require(_0xbfdc('0xf'));var hardwareService=require(_0xbfdc('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbfdc('0x11'))('api');var utils=require(_0xbfdc('0x12'));var config=require(_0xbfdc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20d435,_0x339c01){_0x339c01=_0x339c01||0xcc;return function(_0x47a906){if(_0x47a906){return _0x20d435[_0xbfdc('0x14')](_0x339c01);}return _0x20d435[_0xbfdc('0x15')](_0x339c01)['end']();};}function respondWithResult(_0x313618,_0x47fb83){_0x47fb83=_0x47fb83||0xc8;return function(_0x687758){if(_0x687758){return _0x313618['status'](_0x47fb83)[_0xbfdc('0x16')](_0x687758);}};}function respondWithFilteredResult(_0x4f30ab,_0x567544){return function(_0x56c866){if(_0x56c866){var _0x1e5e47=_0x56c866[_0xbfdc('0x17')],_0x281874=_0x567544[_0xbfdc('0x18')],_0xf64fc6=_0x567544['offset']+_0x567544[_0xbfdc('0x19')],_0xe3f5ab;if(_0xf64fc6>=_0x1e5e47){_0xf64fc6=_0x1e5e47;_0xe3f5ab=0xc8;}else{_0xe3f5ab=0xce;}_0x4f30ab[_0xbfdc('0x15')](_0xe3f5ab);return _0x4f30ab['set'](_0xbfdc('0x1a'),_0x281874+'-'+_0xf64fc6+'/'+_0x1e5e47)['json'](_0x56c866);}return null;};}function patchUpdates(_0x47702f){return function(_0x1cbc66){try{jsonpatch[_0xbfdc('0x1b')](_0x1cbc66,_0x47702f,!![]);}catch(_0xb75982){return BPromise[_0xbfdc('0x1c')](_0xb75982);}return _0x1cbc66[_0xbfdc('0x1d')]();};}function saveUpdates(_0x4dc116,_0x1856bd){return function(_0x4d541e){if(_0x4d541e){return _0x4d541e[_0xbfdc('0x1e')](_0x4dc116)[_0xbfdc('0x1f')](function(_0x26a766){return _0x26a766;});}return null;};}function removeEntity(_0x24cacc,_0x1bdae9){return function(_0x449a40){if(_0x449a40){return _0x449a40[_0xbfdc('0x20')]()[_0xbfdc('0x1f')](function(){var _0x1d0b6b=_0x449a40[_0xbfdc('0x21')]({'plain':!![]});var _0x135dab='Voicemails';return db['UserProfileResource'][_0xbfdc('0x20')]({'where':{'type':_0x135dab,'resourceId':_0x1d0b6b['id']}})[_0xbfdc('0x1f')](function(){return _0x449a40;});})['then'](function(){_0x24cacc[_0xbfdc('0x15')](0xcc)[_0xbfdc('0x22')]();});}};}function handleEntityNotFound(_0x5cd00c,_0x4cdcee){return function(_0x31f84b){if(!_0x31f84b){_0x5cd00c['sendStatus'](0x194);}return _0x31f84b;};}function handleError(_0x47fef6,_0x498689){_0x498689=_0x498689||0x1f4;return function(_0x2dc3f8){logger[_0xbfdc('0x23')](_0x2dc3f8[_0xbfdc('0x24')]);if(_0x2dc3f8[_0xbfdc('0x25')]){delete _0x2dc3f8[_0xbfdc('0x25')];}_0x47fef6['status'](_0x498689)[_0xbfdc('0x26')](_0x2dc3f8);};}exports[_0xbfdc('0x27')]=function(_0x214881,_0x36c68b){var _0x5cdf2f={},_0x639968={},_0x42fbcd={'count':0x0,'rows':[]};var _0xb4dec6=db[_0xbfdc('0x28')][_0xbfdc('0x29')];_0x639968[_0xbfdc('0x2a')]=_[_0xbfdc('0x2b')](_0xb4dec6);_0x639968[_0xbfdc('0x2c')]=_[_0xbfdc('0x2b')](_0x214881[_0xbfdc('0x2c')]);_0x639968[_0xbfdc('0x2d')]=_[_0xbfdc('0x2e')](_0x639968[_0xbfdc('0x2a')],_0x639968[_0xbfdc('0x2c')]);_0x5cdf2f['attributes']=_[_0xbfdc('0x2e')](_0x639968[_0xbfdc('0x2a')],qs[_0xbfdc('0x2f')](_0x214881['query'][_0xbfdc('0x2f')]));_0x5cdf2f[_0xbfdc('0x30')]=_0x5cdf2f['attributes'][_0xbfdc('0x31')]?_0x5cdf2f[_0xbfdc('0x30')]:_0x639968[_0xbfdc('0x2a')];if(!_0x214881[_0xbfdc('0x2c')][_0xbfdc('0x32')](_0xbfdc('0x33'))){_0x5cdf2f['limit']=qs[_0xbfdc('0x19')](_0x214881['query'][_0xbfdc('0x19')]);_0x5cdf2f['offset']=qs[_0xbfdc('0x18')](_0x214881[_0xbfdc('0x2c')]['offset']);}_0x5cdf2f[_0xbfdc('0x34')]=qs[_0xbfdc('0x35')](_0x214881[_0xbfdc('0x2c')]['sort']);_0x5cdf2f[_0xbfdc('0x36')]=qs['filters'](_[_0xbfdc('0x37')](_0x214881[_0xbfdc('0x2c')],_0x639968[_0xbfdc('0x2d')]));if(_0x214881[_0xbfdc('0x2c')][_0xbfdc('0x38')]){_0x5cdf2f[_0xbfdc('0x36')]=_[_0xbfdc('0x39')](_0x5cdf2f[_0xbfdc('0x36')],{'$or':_[_0xbfdc('0x3a')](_0xb4dec6,function(_0x1dae84){if(_0x1dae84['type']['key']!==_0xbfdc('0x3b')){var _0x3ba1d6={};_0x3ba1d6[_0x1dae84[_0xbfdc('0x3c')]]={'$like':'%'+_0x214881['query'][_0xbfdc('0x38')]+'%'};return _0x3ba1d6;}})});}_0x5cdf2f=_[_0xbfdc('0x39')]({},_0x5cdf2f,_0x214881['options']);var _0x38caa3={'where':_0x5cdf2f['where']};return db[_0xbfdc('0x28')][_0xbfdc('0x17')](_0x38caa3)[_0xbfdc('0x1f')](function(_0x387053){_0x42fbcd['count']=_0x387053;if(_0x214881[_0xbfdc('0x2c')][_0xbfdc('0x3d')]){_0x5cdf2f[_0xbfdc('0x3e')]=[{'all':!![]}];}return db[_0xbfdc('0x28')][_0xbfdc('0x3f')](_0x5cdf2f);})['then'](function(_0x17219e){_0x42fbcd[_0xbfdc('0x40')]=_0x17219e;return _0x42fbcd;})['then'](respondWithFilteredResult(_0x36c68b,_0x5cdf2f))['catch'](handleError(_0x36c68b,null));};exports[_0xbfdc('0x41')]=function(_0xf6227c,_0x18b94b){var _0xdcdb55={'raw':!![],'where':{'id':_0xf6227c[_0xbfdc('0x42')]['id']}},_0x5625a9={};_0x5625a9[_0xbfdc('0x2a')]=_[_0xbfdc('0x2b')](db['VoiceMail'][_0xbfdc('0x29')]);_0x5625a9['query']=_[_0xbfdc('0x2b')](_0xf6227c[_0xbfdc('0x2c')]);_0x5625a9['filters']=_[_0xbfdc('0x2e')](_0x5625a9['model'],_0x5625a9['query']);_0xdcdb55[_0xbfdc('0x30')]=_[_0xbfdc('0x2e')](_0x5625a9[_0xbfdc('0x2a')],qs[_0xbfdc('0x2f')](_0xf6227c['query']['fields']));_0xdcdb55[_0xbfdc('0x30')]=_0xdcdb55[_0xbfdc('0x30')][_0xbfdc('0x31')]?_0xdcdb55[_0xbfdc('0x30')]:_0x5625a9[_0xbfdc('0x2a')];if(_0xf6227c[_0xbfdc('0x2c')][_0xbfdc('0x3d')]){_0xdcdb55[_0xbfdc('0x3e')]=[{'all':!![]}];}_0xdcdb55=_[_0xbfdc('0x39')]({},_0xdcdb55,_0xf6227c['options']);return db[_0xbfdc('0x28')][_0xbfdc('0x43')](_0xdcdb55)['then'](handleEntityNotFound(_0x18b94b,null))['then'](respondWithResult(_0x18b94b,null))[_0xbfdc('0x44')](handleError(_0x18b94b,null));};exports[_0xbfdc('0x45')]=function(_0x581ef9,_0x5c5542){return db['VoiceMail']['create'](_0x581ef9[_0xbfdc('0x46')],{})['then'](function(_0x231d16){var _0x36a2b6=_0x581ef9[_0xbfdc('0x47')][_0xbfdc('0x21')]({'plain':!![]});if(!_0x36a2b6)throw new Error(_0xbfdc('0x48'));if(_0x36a2b6[_0xbfdc('0x49')]===_0xbfdc('0x47')){var _0x381f4d=_0x231d16['get']({'plain':!![]});var _0x3970b2='Voicemails';return db[_0xbfdc('0x4a')][_0xbfdc('0x43')]({'where':{'name':_0x3970b2,'userProfileId':_0x36a2b6[_0xbfdc('0x4b')]},'raw':!![]})[_0xbfdc('0x1f')](function(_0x538fdb){if(_0x538fdb&&_0x538fdb[_0xbfdc('0x4c')]===0x0){return db[_0xbfdc('0x4d')][_0xbfdc('0x45')]({'name':_0x381f4d[_0xbfdc('0x25')],'resourceId':_0x381f4d['id'],'type':_0x538fdb['name'],'sectionId':_0x538fdb['id']},{})['then'](function(){return _0x231d16;});}else{return _0x231d16;}})[_0xbfdc('0x44')](function(_0x4d5c24){logger[_0xbfdc('0x23')](_0xbfdc('0x4e'),_0x4d5c24);throw _0x4d5c24;});}return _0x231d16;})[_0xbfdc('0x1f')](respondWithResult(_0x5c5542,0xc9))[_0xbfdc('0x44')](handleError(_0x5c5542,null));};exports[_0xbfdc('0x1e')]=function(_0x2d2651,_0xb07cc2){if(_0x2d2651[_0xbfdc('0x46')]['id']){delete _0x2d2651[_0xbfdc('0x46')]['id'];}return db[_0xbfdc('0x28')][_0xbfdc('0x43')]({'where':{'id':_0x2d2651['params']['id']}})['then'](handleEntityNotFound(_0xb07cc2,null))[_0xbfdc('0x1f')](saveUpdates(_0x2d2651['body'],null))[_0xbfdc('0x1f')](respondWithResult(_0xb07cc2,null))['catch'](handleError(_0xb07cc2,null));};exports[_0xbfdc('0x20')]=function(_0x188769,_0x4be50d){return db[_0xbfdc('0x28')][_0xbfdc('0x43')]({'where':{'id':_0x188769['params']['id']}})[_0xbfdc('0x1f')](handleEntityNotFound(_0x4be50d,null))[_0xbfdc('0x1f')](removeEntity(_0x4be50d,null))[_0xbfdc('0x44')](handleError(_0x4be50d,null));};exports[_0xbfdc('0x4f')]=function(_0x4cff25,_0x528445,_0x1f0af9){return db[_0xbfdc('0x28')][_0xbfdc('0x50')]({'where':{'id':_0x4cff25['params']['id']}})[_0xbfdc('0x1f')](handleEntityNotFound(_0x528445,null))[_0xbfdc('0x1f')](function(_0x72f36d){var _0x48fe57;var _0x5a044f={},_0x348fe7={};_0x348fe7[_0xbfdc('0x2a')]=_[_0xbfdc('0x2b')](db[_0xbfdc('0x51')]['rawAttributes']);_0x348fe7[_0xbfdc('0x2c')]=_['keys'](_0x4cff25['query']);_0x348fe7[_0xbfdc('0x2d')]=_[_0xbfdc('0x2e')](_0x348fe7[_0xbfdc('0x2a')],_0x348fe7[_0xbfdc('0x2c')]);_0x5a044f[_0xbfdc('0x30')]=_[_0xbfdc('0x2e')](_0x348fe7[_0xbfdc('0x2a')],qs[_0xbfdc('0x2f')](_0x4cff25[_0xbfdc('0x2c')][_0xbfdc('0x2f')]));_0x5a044f[_0xbfdc('0x30')]=_0x5a044f[_0xbfdc('0x30')]['length']?_0x5a044f[_0xbfdc('0x30')]:_0x348fe7[_0xbfdc('0x2a')];if(!_0x4cff25[_0xbfdc('0x2c')][_0xbfdc('0x32')](_0xbfdc('0x33'))){_0x5a044f[_0xbfdc('0x19')]=qs['limit'](_0x4cff25[_0xbfdc('0x2c')][_0xbfdc('0x19')]);_0x5a044f[_0xbfdc('0x18')]=qs[_0xbfdc('0x18')](_0x4cff25['query']['offset']);}_0x5a044f[_0xbfdc('0x34')]=qs[_0xbfdc('0x35')](_0x4cff25[_0xbfdc('0x2c')]['sort']);_0x5a044f[_0xbfdc('0x36')]=qs[_0xbfdc('0x2d')](_[_0xbfdc('0x37')](_0x4cff25[_0xbfdc('0x2c')],_0x348fe7[_0xbfdc('0x2d')]));if(_0x4cff25[_0xbfdc('0x2c')][_0xbfdc('0x38')]){_0x5a044f[_0xbfdc('0x36')]=_[_0xbfdc('0x39')](_0x5a044f[_0xbfdc('0x36')],{'$or':_['map'](_0x5a044f['attributes'],function(_0x33f58a){var _0x5280d0={};_0x5280d0[_0x33f58a]={'$like':'%'+_0x4cff25[_0xbfdc('0x2c')][_0xbfdc('0x38')]+'%'};return _0x5280d0;})});}_0x5a044f[_0xbfdc('0x36')]=_[_0xbfdc('0x39')](_0x5a044f[_0xbfdc('0x36')],{'mailboxuser':_0x72f36d[_0xbfdc('0x52')]});_0x5a044f=_[_0xbfdc('0x39')]({},_0x5a044f,_0x4cff25['options']);return db[_0xbfdc('0x51')][_0xbfdc('0x53')](_0x5a044f)['then'](respondWithFilteredResult(_0x528445,_0x5a044f));})[_0xbfdc('0x44')](handleError(_0x528445,null));}; \ No newline at end of file +var _0x0595=['json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','Voicemails','sendStatus','error','stack','name','send','index','VoiceMail','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','order','mailbox','VoiceMailMessage','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../config/logger','../../config/environment','status','end'];(function(_0x19ca9f,_0x2e8f45){var _0x4da326=function(_0x43ce65){while(--_0x43ce65){_0x19ca9f['push'](_0x19ca9f['shift']());}};_0x4da326(++_0x2e8f45);}(_0x0595,0x8d));var _0x5059=function(_0x2b0ae1,_0x20bf34){_0x2b0ae1=_0x2b0ae1-0x0;var _0x168fb1=_0x0595[_0x2b0ae1];return _0x168fb1;};'use strict';var pdf=require(_0x5059('0x0'));var emlformat=require(_0x5059('0x1'));var rimraf=require(_0x5059('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5059('0x3'));var rp=require(_0x5059('0x4'));var moment=require('moment');var BPromise=require(_0x5059('0x5'));var Mustache=require(_0x5059('0x6'));var util=require(_0x5059('0x7'));var path=require('path');var sox=require(_0x5059('0x8'));var csv=require(_0x5059('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5059('0xa'));var squel=require(_0x5059('0xb'));var crypto=require(_0x5059('0xc'));var jsforce=require(_0x5059('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5059('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5059('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x5059('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x5059('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x164f1e,_0x23e94a){_0x23e94a=_0x23e94a||0xcc;return function(_0x3dc545){if(_0x3dc545){return _0x164f1e['sendStatus'](_0x23e94a);}return _0x164f1e[_0x5059('0x11')](_0x23e94a)[_0x5059('0x12')]();};}function respondWithResult(_0x41ff93,_0x42449b){_0x42449b=_0x42449b||0xc8;return function(_0x1c2ecf){if(_0x1c2ecf){return _0x41ff93[_0x5059('0x11')](_0x42449b)[_0x5059('0x13')](_0x1c2ecf);}};}function respondWithFilteredResult(_0x4433d5,_0x1a5c77){return function(_0x2fd69d){if(_0x2fd69d){var _0x29adab=_0x2fd69d['count'],_0x108e7a=_0x1a5c77[_0x5059('0x14')],_0x2021e9=_0x1a5c77[_0x5059('0x14')]+_0x1a5c77[_0x5059('0x15')],_0x5e2e56;if(_0x2021e9>=_0x29adab){_0x2021e9=_0x29adab;_0x5e2e56=0xc8;}else{_0x5e2e56=0xce;}_0x4433d5[_0x5059('0x11')](_0x5e2e56);return _0x4433d5['set'](_0x5059('0x16'),_0x108e7a+'-'+_0x2021e9+'/'+_0x29adab)[_0x5059('0x13')](_0x2fd69d);}return null;};}function patchUpdates(_0x72470d){return function(_0x187a9d){try{jsonpatch[_0x5059('0x17')](_0x187a9d,_0x72470d,!![]);}catch(_0xd58c87){return BPromise[_0x5059('0x18')](_0xd58c87);}return _0x187a9d[_0x5059('0x19')]();};}function saveUpdates(_0x2dd97f,_0x1cc9b7){return function(_0x3dbe6b){if(_0x3dbe6b){return _0x3dbe6b[_0x5059('0x1a')](_0x2dd97f)[_0x5059('0x1b')](function(_0x31f55a){return _0x31f55a;});}return null;};}function removeEntity(_0x47ac34,_0x15dfd7){return function(_0x108ba4){if(_0x108ba4){return _0x108ba4[_0x5059('0x1c')]()[_0x5059('0x1b')](function(){var _0x1e71bc=_0x108ba4['get']({'plain':!![]});var _0x5a8a28=_0x5059('0x1d');return db['UserProfileResource'][_0x5059('0x1c')]({'where':{'type':_0x5a8a28,'resourceId':_0x1e71bc['id']}})[_0x5059('0x1b')](function(){return _0x108ba4;});})[_0x5059('0x1b')](function(){_0x47ac34[_0x5059('0x11')](0xcc)[_0x5059('0x12')]();});}};}function handleEntityNotFound(_0x5387c2,_0x310c85){return function(_0x23f135){if(!_0x23f135){_0x5387c2[_0x5059('0x1e')](0x194);}return _0x23f135;};}function handleError(_0x342085,_0x50de9f){_0x50de9f=_0x50de9f||0x1f4;return function(_0x596695){logger[_0x5059('0x1f')](_0x596695[_0x5059('0x20')]);if(_0x596695['name']){delete _0x596695[_0x5059('0x21')];}_0x342085[_0x5059('0x11')](_0x50de9f)[_0x5059('0x22')](_0x596695);};}exports[_0x5059('0x23')]=function(_0x26fd4c,_0x4c082e){var _0x1a9cfd={},_0xa4343b={},_0xb3c022={'count':0x0,'rows':[]};var _0xb13c45=db[_0x5059('0x24')][_0x5059('0x25')];_0xa4343b[_0x5059('0x26')]=_['keys'](_0xb13c45);_0xa4343b[_0x5059('0x27')]=_['keys'](_0x26fd4c[_0x5059('0x27')]);_0xa4343b[_0x5059('0x28')]=_[_0x5059('0x29')](_0xa4343b[_0x5059('0x26')],_0xa4343b[_0x5059('0x27')]);_0x1a9cfd['attributes']=_[_0x5059('0x29')](_0xa4343b['model'],qs['fields'](_0x26fd4c['query'][_0x5059('0x2a')]));_0x1a9cfd[_0x5059('0x2b')]=_0x1a9cfd[_0x5059('0x2b')][_0x5059('0x2c')]?_0x1a9cfd[_0x5059('0x2b')]:_0xa4343b['model'];if(!_0x26fd4c[_0x5059('0x27')][_0x5059('0x2d')](_0x5059('0x2e'))){_0x1a9cfd[_0x5059('0x15')]=qs[_0x5059('0x15')](_0x26fd4c[_0x5059('0x27')][_0x5059('0x15')]);_0x1a9cfd[_0x5059('0x14')]=qs['offset'](_0x26fd4c[_0x5059('0x27')][_0x5059('0x14')]);}_0x1a9cfd['order']=qs['sort'](_0x26fd4c[_0x5059('0x27')][_0x5059('0x2f')]);_0x1a9cfd['where']=qs['filters'](_[_0x5059('0x30')](_0x26fd4c[_0x5059('0x27')],_0xa4343b[_0x5059('0x28')]));if(_0x26fd4c[_0x5059('0x27')]['filter']){_0x1a9cfd[_0x5059('0x31')]=_[_0x5059('0x32')](_0x1a9cfd[_0x5059('0x31')],{'$or':_[_0x5059('0x33')](_0xb13c45,function(_0x122255){if(_0x122255[_0x5059('0x34')][_0x5059('0x35')]!==_0x5059('0x36')){var _0x5bb8cb={};_0x5bb8cb[_0x122255[_0x5059('0x37')]]={'$like':'%'+_0x26fd4c[_0x5059('0x27')][_0x5059('0x38')]+'%'};return _0x5bb8cb;}})});}_0x1a9cfd=_['merge']({},_0x1a9cfd,_0x26fd4c[_0x5059('0x39')]);var _0x31a35b={'where':_0x1a9cfd[_0x5059('0x31')]};return db[_0x5059('0x24')][_0x5059('0x3a')](_0x31a35b)['then'](function(_0x568ad7){_0xb3c022[_0x5059('0x3a')]=_0x568ad7;if(_0x26fd4c['query'][_0x5059('0x3b')]){_0x1a9cfd[_0x5059('0x3c')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x1a9cfd);})['then'](function(_0x4c291c){_0xb3c022['rows']=_0x4c291c;return _0xb3c022;})[_0x5059('0x1b')](respondWithFilteredResult(_0x4c082e,_0x1a9cfd))[_0x5059('0x3d')](handleError(_0x4c082e,null));};exports[_0x5059('0x3e')]=function(_0x2f8987,_0x3baf6b){var _0x340705={'raw':!![],'where':{'id':_0x2f8987[_0x5059('0x3f')]['id']}},_0x37f45e={};_0x37f45e['model']=_[_0x5059('0x40')](db[_0x5059('0x24')][_0x5059('0x25')]);_0x37f45e[_0x5059('0x27')]=_[_0x5059('0x40')](_0x2f8987[_0x5059('0x27')]);_0x37f45e[_0x5059('0x28')]=_[_0x5059('0x29')](_0x37f45e[_0x5059('0x26')],_0x37f45e[_0x5059('0x27')]);_0x340705[_0x5059('0x2b')]=_[_0x5059('0x29')](_0x37f45e[_0x5059('0x26')],qs[_0x5059('0x2a')](_0x2f8987['query'][_0x5059('0x2a')]));_0x340705[_0x5059('0x2b')]=_0x340705[_0x5059('0x2b')][_0x5059('0x2c')]?_0x340705[_0x5059('0x2b')]:_0x37f45e[_0x5059('0x26')];if(_0x2f8987[_0x5059('0x27')][_0x5059('0x3b')]){_0x340705[_0x5059('0x3c')]=[{'all':!![]}];}_0x340705=_[_0x5059('0x32')]({},_0x340705,_0x2f8987[_0x5059('0x39')]);return db[_0x5059('0x24')][_0x5059('0x41')](_0x340705)[_0x5059('0x1b')](handleEntityNotFound(_0x3baf6b,null))[_0x5059('0x1b')](respondWithResult(_0x3baf6b,null))[_0x5059('0x3d')](handleError(_0x3baf6b,null));};exports['create']=function(_0x2dcd9e,_0x5e1626){return db[_0x5059('0x24')][_0x5059('0x42')](_0x2dcd9e['body'],{})[_0x5059('0x1b')](function(_0x4bf766){var _0x1b1e61=_0x2dcd9e[_0x5059('0x43')][_0x5059('0x44')]({'plain':!![]});if(!_0x1b1e61)throw new Error(_0x5059('0x45'));if(_0x1b1e61['role']===_0x5059('0x43')){var _0x297a9c=_0x4bf766[_0x5059('0x44')]({'plain':!![]});var _0x108b2c=_0x5059('0x1d');return db[_0x5059('0x46')][_0x5059('0x41')]({'where':{'name':_0x108b2c,'userProfileId':_0x1b1e61[_0x5059('0x47')]},'raw':!![]})[_0x5059('0x1b')](function(_0x5e3b34){if(_0x5e3b34&&_0x5e3b34[_0x5059('0x48')]===0x0){return db[_0x5059('0x49')]['create']({'name':_0x297a9c[_0x5059('0x21')],'resourceId':_0x297a9c['id'],'type':_0x5e3b34[_0x5059('0x21')],'sectionId':_0x5e3b34['id']},{})[_0x5059('0x1b')](function(){return _0x4bf766;});}else{return _0x4bf766;}})[_0x5059('0x3d')](function(_0x1117a7){logger[_0x5059('0x1f')](_0x5059('0x4a'),_0x1117a7);throw _0x1117a7;});}return _0x4bf766;})[_0x5059('0x1b')](respondWithResult(_0x5e1626,0xc9))[_0x5059('0x3d')](handleError(_0x5e1626,null));};exports[_0x5059('0x1a')]=function(_0x540da8,_0x4dad76){if(_0x540da8[_0x5059('0x4b')]['id']){delete _0x540da8[_0x5059('0x4b')]['id'];}return db[_0x5059('0x24')]['find']({'where':{'id':_0x540da8[_0x5059('0x3f')]['id']}})[_0x5059('0x1b')](handleEntityNotFound(_0x4dad76,null))[_0x5059('0x1b')](saveUpdates(_0x540da8['body'],null))[_0x5059('0x1b')](respondWithResult(_0x4dad76,null))[_0x5059('0x3d')](handleError(_0x4dad76,null));};exports['destroy']=function(_0x3e5d9e,_0xdd0cb4){return db[_0x5059('0x24')][_0x5059('0x41')]({'where':{'id':_0x3e5d9e['params']['id']}})[_0x5059('0x1b')](handleEntityNotFound(_0xdd0cb4,null))[_0x5059('0x1b')](removeEntity(_0xdd0cb4,null))['catch'](handleError(_0xdd0cb4,null));};exports['getMessages']=function(_0x1cf6b,_0x4f2caf,_0xc40098){return db['VoiceMail'][_0x5059('0x4c')]({'where':{'id':_0x1cf6b[_0x5059('0x3f')]['id']}})[_0x5059('0x1b')](handleEntityNotFound(_0x4f2caf,null))['then'](function(_0x3364cc){var _0x55f270;var _0x5427af={},_0x5a796a={};_0x5a796a[_0x5059('0x26')]=_[_0x5059('0x40')](db['VoiceMailMessage'][_0x5059('0x25')]);_0x5a796a[_0x5059('0x27')]=_[_0x5059('0x40')](_0x1cf6b[_0x5059('0x27')]);_0x5a796a['filters']=_[_0x5059('0x29')](_0x5a796a[_0x5059('0x26')],_0x5a796a[_0x5059('0x27')]);_0x5427af['attributes']=_[_0x5059('0x29')](_0x5a796a['model'],qs['fields'](_0x1cf6b['query'][_0x5059('0x2a')]));_0x5427af[_0x5059('0x2b')]=_0x5427af[_0x5059('0x2b')][_0x5059('0x2c')]?_0x5427af['attributes']:_0x5a796a[_0x5059('0x26')];if(!_0x1cf6b[_0x5059('0x27')][_0x5059('0x2d')]('nolimit')){_0x5427af[_0x5059('0x15')]=qs['limit'](_0x1cf6b[_0x5059('0x27')][_0x5059('0x15')]);_0x5427af[_0x5059('0x14')]=qs[_0x5059('0x14')](_0x1cf6b[_0x5059('0x27')][_0x5059('0x14')]);}_0x5427af[_0x5059('0x4d')]=qs[_0x5059('0x2f')](_0x1cf6b[_0x5059('0x27')]['sort']);_0x5427af['where']=qs[_0x5059('0x28')](_['pick'](_0x1cf6b[_0x5059('0x27')],_0x5a796a[_0x5059('0x28')]));if(_0x1cf6b['query'][_0x5059('0x38')]){_0x5427af[_0x5059('0x31')]=_[_0x5059('0x32')](_0x5427af['where'],{'$or':_[_0x5059('0x33')](_0x5427af[_0x5059('0x2b')],function(_0x102885){var _0x2af636={};_0x2af636[_0x102885]={'$like':'%'+_0x1cf6b['query'][_0x5059('0x38')]+'%'};return _0x2af636;})});}_0x5427af['where']=_[_0x5059('0x32')](_0x5427af[_0x5059('0x31')],{'mailboxuser':_0x3364cc[_0x5059('0x4e')]});_0x5427af=_[_0x5059('0x32')]({},_0x5427af,_0x1cf6b[_0x5059('0x39')]);return db[_0x5059('0x4f')]['findAndCountAll'](_0x5427af)[_0x5059('0x1b')](respondWithFilteredResult(_0x4f2caf,_0x5427af));})[_0x5059('0x3d')](handleError(_0x4f2caf,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 1a91ab9..9e5740c 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 _0x42cf=['api','moment','bluebird','request-promise','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','context','util','../../config/logger'];(function(_0x3d0500,_0x367a79){var _0x482fb0=function(_0xc9d543){while(--_0xc9d543){_0x3d0500['push'](_0x3d0500['shift']());}};_0x482fb0(++_0x367a79);}(_0x42cf,0x1df));var _0xf42c=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x42cf[_0x39096d];return _0x13da4f;};'use strict';var _=require('lodash');var util=require(_0xf42c('0x0'));var logger=require(_0xf42c('0x1'))(_0xf42c('0x2'));var moment=require(_0xf42c('0x3'));var BPromise=require(_0xf42c('0x4'));var rp=require(_0xf42c('0x5'));var attributes=require(_0xf42c('0x6'));module[_0xf42c('0x7')]=function(_0x199e1b,_0x418295){return _0x199e1b[_0xf42c('0x8')](_0xf42c('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xf42c('0xa'),'fields':[_0xf42c('0xb'),_0xf42c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f6d=['define','VoiceMail','voice_voicemail','context','lodash','util','../../config/logger','api','moment','bluebird','./voiceMail.attributes','exports'];(function(_0x5ab0f6,_0x147f72){var _0x3ce50c=function(_0x165c39){while(--_0x165c39){_0x5ab0f6['push'](_0x5ab0f6['shift']());}};_0x3ce50c(++_0x147f72);}(_0x9f6d,0x160));var _0xd9f6=function(_0x2efb49,_0x5cf738){_0x2efb49=_0x2efb49-0x0;var _0x3cd8bb=_0x9f6d[_0x2efb49];return _0x3cd8bb;};'use strict';var _=require(_0xd9f6('0x0'));var util=require(_0xd9f6('0x1'));var logger=require(_0xd9f6('0x2'))(_0xd9f6('0x3'));var moment=require(_0xd9f6('0x4'));var BPromise=require(_0xd9f6('0x5'));var rp=require('request-promise');var attributes=require(_0xd9f6('0x6'));module[_0xd9f6('0x7')]=function(_0x39d2d5,_0x3ebec3){return _0x39d2d5[_0xd9f6('0x8')](_0xd9f6('0x9'),attributes,{'tableName':_0xd9f6('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xd9f6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index bf4b742..6811f75 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 _0xc1fa=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMail,\x20%s,\x20%s'];(function(_0x59b889,_0x4b026c){var _0x470d3f=function(_0x52eeb2){while(--_0x52eeb2){_0x59b889['push'](_0x59b889['shift']());}};_0x470d3f(++_0x4b026c);}(_0xc1fa,0x17f));var _0xac1f=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xc1fa[_0x10291b];return _0x1d5fbe;};'use strict';var _=require(_0xac1f('0x0'));var util=require('util');var moment=require(_0xac1f('0x1'));var BPromise=require(_0xac1f('0x2'));var rs=require(_0xac1f('0x3'));var fs=require('fs');var Redis=require(_0xac1f('0x4'));var db=require(_0xac1f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac1f('0x6'));var config=require(_0xac1f('0x7'));var jayson=require(_0xac1f('0x8'));var client=jayson['client'][_0xac1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1001c0,_0x198279,_0x50c211){return new BPromise(function(_0x2af1c4,_0x47096a){return client['request'](_0x1001c0,_0x50c211)[_0xac1f('0xa')](function(_0x44bf32){logger[_0xac1f('0xb')]('VoiceMail,\x20%s,\x20%s',_0x198279,_0xac1f('0xc'));logger['debug'](_0xac1f('0xd'),_0x198279,_0xac1f('0xc'),JSON[_0xac1f('0xe')](_0x44bf32));if(_0x44bf32['error']){if(_0x44bf32[_0xac1f('0xf')]['code']===0x1f4){logger[_0xac1f('0xf')](_0xac1f('0x10'),_0x198279,_0x44bf32[_0xac1f('0xf')]['message']);return _0x47096a(_0x44bf32[_0xac1f('0xf')][_0xac1f('0x11')]);}logger[_0xac1f('0xf')](_0xac1f('0x10'),_0x198279,_0x44bf32[_0xac1f('0xf')]['message']);return _0x2af1c4(_0x44bf32[_0xac1f('0xf')]['message']);}else{logger[_0xac1f('0xb')](_0xac1f('0x10'),_0x198279,'request\x20sent');_0x2af1c4(_0x44bf32[_0xac1f('0x12')][_0xac1f('0x11')]);}})[_0xac1f('0x13')](function(_0x380204){logger['error'](_0xac1f('0x10'),_0x198279,_0x380204);_0x47096a(_0x380204);});});} \ No newline at end of file +var _0x475e=['jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x48fc30,_0x1a3383){var _0x1be531=function(_0x42ea75){while(--_0x42ea75){_0x48fc30['push'](_0x48fc30['shift']());}};_0x1be531(++_0x1a3383);}(_0x475e,0xd4));var _0xe475=function(_0x413a20,_0x9639e6){_0x413a20=_0x413a20-0x0;var _0x13032a=_0x475e[_0x413a20];return _0x13032a;};'use strict';var _=require(_0xe475('0x0'));var util=require(_0xe475('0x1'));var moment=require('moment');var BPromise=require(_0xe475('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe475('0x3'));var db=require(_0xe475('0x4'))['db'];var utils=require(_0xe475('0x5'));var logger=require('../../config/logger')(_0xe475('0x6'));var config=require(_0xe475('0x7'));var jayson=require(_0xe475('0x8'));var client=jayson['client'][_0xe475('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x275bfd,_0x2facd9,_0x133cb2){return new BPromise(function(_0x367c3f,_0x33b1dc){return client[_0xe475('0xa')](_0x275bfd,_0x133cb2)[_0xe475('0xb')](function(_0x2b37a0){logger[_0xe475('0xc')](_0xe475('0xd'),_0x2facd9,_0xe475('0xe'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x2facd9,_0xe475('0xe'),JSON['stringify'](_0x2b37a0));if(_0x2b37a0[_0xe475('0xf')]){if(_0x2b37a0[_0xe475('0xf')][_0xe475('0x10')]===0x1f4){logger[_0xe475('0xf')](_0xe475('0xd'),_0x2facd9,_0x2b37a0[_0xe475('0xf')][_0xe475('0x11')]);return _0x33b1dc(_0x2b37a0[_0xe475('0xf')][_0xe475('0x11')]);}logger['error'](_0xe475('0xd'),_0x2facd9,_0x2b37a0[_0xe475('0xf')]['message']);return _0x367c3f(_0x2b37a0[_0xe475('0xf')][_0xe475('0x11')]);}else{logger[_0xe475('0xc')]('VoiceMail,\x20%s,\x20%s',_0x2facd9,_0xe475('0xe'));_0x367c3f(_0x2b37a0[_0xe475('0x12')][_0xe475('0x11')]);}})[_0xe475('0x13')](function(_0x25182a){logger[_0xe475('0xf')](_0xe475('0xd'),_0x2facd9,_0x25182a);_0x33b1dc(_0x25182a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 38500db..0892a64 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 _0xfd8b=['util','path','connect-timeout','Router','../../components/auth/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','destroy','multer'];(function(_0x404cc7,_0x281967){var _0x554b04=function(_0x497a74){while(--_0x497a74){_0x404cc7['push'](_0x404cc7['shift']());}};_0x554b04(++_0x281967);}(_0xfd8b,0x131));var _0xbfd8=function(_0x5e586f,_0x4d823e){_0x5e586f=_0x5e586f-0x0;var _0x430f35=_0xfd8b[_0x5e586f];return _0x430f35;};'use strict';var multer=require(_0xbfd8('0x0'));var util=require(_0xbfd8('0x1'));var path=require(_0xbfd8('0x2'));var timeout=require(_0xbfd8('0x3'));var express=require('express');var router=express[_0xbfd8('0x4')]();var auth=require(_0xbfd8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbfd8('0x6'));router[_0xbfd8('0x7')]('/',auth[_0xbfd8('0x8')](),controller[_0xbfd8('0x9')]);router['get'](_0xbfd8('0xa'),auth[_0xbfd8('0x8')](),controller[_0xbfd8('0xb')]);router[_0xbfd8('0x7')](_0xbfd8('0xc'),auth['isAuthenticated'](),controller[_0xbfd8('0xd')]);router['post']('/',auth[_0xbfd8('0x8')](),controller[_0xbfd8('0xe')]);router['put'](_0xbfd8('0xa'),auth[_0xbfd8('0x8')](),controller[_0xbfd8('0xf')]);router['delete']('/:id',auth[_0xbfd8('0x8')](),controller[_0xbfd8('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc501=['show','/:id/download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc501,0x1ab));var _0x1c50=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0xc501[_0x9fb081];return _0x43f8b0;};'use strict';var multer=require(_0x1c50('0x0'));var util=require(_0x1c50('0x1'));var path=require(_0x1c50('0x2'));var timeout=require(_0x1c50('0x3'));var express=require(_0x1c50('0x4'));var router=express['Router']();var auth=require(_0x1c50('0x5'));var interaction=require(_0x1c50('0x6'));var config=require(_0x1c50('0x7'));var controller=require(_0x1c50('0x8'));router[_0x1c50('0x9')]('/',auth[_0x1c50('0xa')](),controller[_0x1c50('0xb')]);router['get'](_0x1c50('0xc'),auth[_0x1c50('0xa')](),controller[_0x1c50('0xd')]);router[_0x1c50('0x9')](_0x1c50('0xe'),auth[_0x1c50('0xa')](),controller['download']);router[_0x1c50('0xf')]('/',auth[_0x1c50('0xa')](),controller[_0x1c50('0x10')]);router[_0x1c50('0x11')](_0x1c50('0xc'),auth[_0x1c50('0xa')](),controller[_0x1c50('0x12')]);router[_0x1c50('0x13')](_0x1c50('0xc'),auth[_0x1c50('0xa')](),controller[_0x1c50('0x14')]);module[_0x1c50('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index a6d4e42..4c511bb 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 _0x1248=['INTEGER','STRING','long','exports','VIRTUAL','getDataValue'];(function(_0x32a582,_0x327807){var _0x3d3503=function(_0x260340){while(--_0x260340){_0x32a582['push'](_0x32a582['shift']());}};_0x3d3503(++_0x327807);}(_0x1248,0x19b));var _0x8124=function(_0x39f63f,_0x277e36){_0x39f63f=_0x39f63f-0x0;var _0x43b316=_0x1248[_0x39f63f];return _0x43b316;};'use strict';var Sequelize=require('sequelize');module[_0x8124('0x0')]={'name':{'type':Sequelize[_0x8124('0x1')],'get':function(_0x445e25){return this[_0x8124('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x8124('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x8124('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8124('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0x445b=['STRING','TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x445b,0x146));var _0xb445=function(_0x25bf2c,_0x5c13d){_0x25bf2c=_0x25bf2c-0x0;var _0x35cce0=_0x445b[_0x25bf2c];return _0x35cce0;};'use strict';var Sequelize=require(_0xb445('0x0'));module[_0xb445('0x1')]={'name':{'type':Sequelize[_0xb445('0x2')],'get':function(_0x1b0d63){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xb445('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb445('0x4')],'defaultValue':''},'stamp':{'type':_0xb445('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index ebca5bb..86fa923 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 _0x77d4=['filter','merge','map','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','status','end','count','offset','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','VoiceMailMessage','rawAttributes','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick'];(function(_0x47ad1a,_0x467d68){var _0x586211=function(_0x169364){while(--_0x169364){_0x47ad1a['push'](_0x47ad1a['shift']());}};_0x586211(++_0x467d68);}(_0x77d4,0x108));var _0x477d=function(_0x185d17,_0x36bb78){_0x185d17=_0x185d17-0x0;var _0x2debcb=_0x77d4[_0x185d17];return _0x2debcb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x477d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x477d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x477d('0x2'));var moment=require(_0x477d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x477d('0x4'));var path=require(_0x477d('0x5'));var sox=require(_0x477d('0x6'));var csv=require(_0x477d('0x7'));var ejs=require(_0x477d('0x8'));var fs=require('fs');var _=require(_0x477d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x477d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x477d('0xb'));var Papa=require(_0x477d('0xc'));var authService=require(_0x477d('0xd'));var hardwareService=require(_0x477d('0xe'));var Redis=require(_0x477d('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x477d('0x10'))('api');var utils=require(_0x477d('0x11'));var config=require(_0x477d('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x472012,_0x3d362a){_0x3d362a=_0x3d362a||0xcc;return function(_0x5a190c){if(_0x5a190c){return _0x472012['sendStatus'](_0x3d362a);}return _0x472012[_0x477d('0x13')](_0x3d362a)[_0x477d('0x14')]();};}function respondWithResult(_0x55bdfd,_0x290d46){_0x290d46=_0x290d46||0xc8;return function(_0x1d5699){if(_0x1d5699){return _0x55bdfd['status'](_0x290d46)['json'](_0x1d5699);}};}function respondWithFilteredResult(_0x38a0a8,_0x4bbfef){return function(_0x30481f){if(_0x30481f){var _0x234b99=_0x30481f[_0x477d('0x15')],_0x25fc02=_0x4bbfef[_0x477d('0x16')],_0x5985b5=_0x4bbfef[_0x477d('0x16')]+_0x4bbfef['limit'],_0x116aa7;if(_0x5985b5>=_0x234b99){_0x5985b5=_0x234b99;_0x116aa7=0xc8;}else{_0x116aa7=0xce;}_0x38a0a8[_0x477d('0x13')](_0x116aa7);return _0x38a0a8['set'](_0x477d('0x17'),_0x25fc02+'-'+_0x5985b5+'/'+_0x234b99)[_0x477d('0x18')](_0x30481f);}return null;};}function patchUpdates(_0x159beb){return function(_0x458489){try{jsonpatch[_0x477d('0x19')](_0x458489,_0x159beb,!![]);}catch(_0x2145ce){return BPromise['reject'](_0x2145ce);}return _0x458489[_0x477d('0x1a')]();};}function saveUpdates(_0x49c442,_0xe934a7){return function(_0x24a6d5){if(_0x24a6d5){return _0x24a6d5[_0x477d('0x1b')](_0x49c442)[_0x477d('0x1c')](function(_0x27b3aa){return _0x27b3aa;});}return null;};}function removeEntity(_0x3b3cda,_0x435a3b){return function(_0x17154d){if(_0x17154d){return _0x17154d[_0x477d('0x1d')]()[_0x477d('0x1c')](function(){_0x3b3cda[_0x477d('0x13')](0xcc)[_0x477d('0x14')]();});}};}function handleEntityNotFound(_0x43c845,_0x1f3868){return function(_0x4e6a44){if(!_0x4e6a44){_0x43c845[_0x477d('0x1e')](0x194);}return _0x4e6a44;};}function handleError(_0x583444,_0x239b56){_0x239b56=_0x239b56||0x1f4;return function(_0x2506d8){logger[_0x477d('0x1f')](_0x2506d8[_0x477d('0x20')]);if(_0x2506d8['name']){delete _0x2506d8[_0x477d('0x21')];}_0x583444[_0x477d('0x13')](_0x239b56)[_0x477d('0x22')](_0x2506d8);};}exports['index']=function(_0x585648,_0x198697){var _0x3c6270={},_0x386df5={},_0x5c8ef1={'count':0x0,'rows':[]};var _0x254141=db[_0x477d('0x23')][_0x477d('0x24')];_0x386df5[_0x477d('0x25')]=_[_0x477d('0x26')](_['keys'](_0x254141),[_0x477d('0x21')]);_0x386df5[_0x477d('0x27')]=_[_0x477d('0x28')](_0x585648[_0x477d('0x27')]);_0x386df5[_0x477d('0x29')]=_[_0x477d('0x2a')](_0x386df5[_0x477d('0x25')],_0x386df5[_0x477d('0x27')]);_0x3c6270[_0x477d('0x2b')]=_[_0x477d('0x2a')](_0x386df5[_0x477d('0x25')],qs[_0x477d('0x2c')](_0x585648[_0x477d('0x27')][_0x477d('0x2c')]));_0x3c6270[_0x477d('0x2b')]=_0x3c6270[_0x477d('0x2b')][_0x477d('0x2d')]?_0x3c6270[_0x477d('0x2b')]:_0x386df5[_0x477d('0x25')];if(!_0x585648[_0x477d('0x27')]['hasOwnProperty'](_0x477d('0x2e'))){_0x3c6270['limit']=qs[_0x477d('0x2f')](_0x585648[_0x477d('0x27')][_0x477d('0x2f')]);_0x3c6270['offset']=qs[_0x477d('0x16')](_0x585648[_0x477d('0x27')][_0x477d('0x16')]);}_0x3c6270[_0x477d('0x30')]=qs[_0x477d('0x31')](_0x585648[_0x477d('0x27')][_0x477d('0x31')]);_0x3c6270[_0x477d('0x32')]=qs[_0x477d('0x29')](_[_0x477d('0x33')](_0x585648['query'],_0x386df5[_0x477d('0x29')]));if(_0x585648[_0x477d('0x27')][_0x477d('0x34')]){_0x3c6270['where']=_[_0x477d('0x35')](_0x3c6270[_0x477d('0x32')],{'$or':_[_0x477d('0x36')](_0x254141,function(_0x53c996){if(_0x53c996['type'][_0x477d('0x37')]!==_0x477d('0x38')){var _0x260e14={};_0x260e14[_0x53c996[_0x477d('0x39')]]={'$like':'%'+_0x585648[_0x477d('0x27')]['filter']+'%'};return _0x260e14;}})});}_0x3c6270=_[_0x477d('0x35')]({},_0x3c6270,_0x585648['options']);var _0x7b73b9={'where':_0x3c6270[_0x477d('0x32')]};return db[_0x477d('0x23')]['count'](_0x7b73b9)['then'](function(_0x184d50){_0x5c8ef1[_0x477d('0x15')]=_0x184d50;if(_0x585648[_0x477d('0x27')][_0x477d('0x3a')]){_0x3c6270['include']=[{'all':!![]}];}return db[_0x477d('0x23')][_0x477d('0x3b')](_0x3c6270);})[_0x477d('0x1c')](function(_0x3b2972){_0x5c8ef1[_0x477d('0x3c')]=_0x3b2972;return _0x5c8ef1;})['then'](respondWithFilteredResult(_0x198697,_0x3c6270))[_0x477d('0x3d')](handleError(_0x198697,null));};exports[_0x477d('0x3e')]=function(_0x4d1c8e,_0x473962){var _0x5c814c={'raw':!![],'where':{'id':_0x4d1c8e[_0x477d('0x3f')]['id']}},_0xa43df8={};_0xa43df8[_0x477d('0x25')]=_[_0x477d('0x28')](db[_0x477d('0x23')][_0x477d('0x24')]);_0xa43df8[_0x477d('0x27')]=_[_0x477d('0x28')](_0x4d1c8e[_0x477d('0x27')]);_0xa43df8['filters']=_[_0x477d('0x2a')](_0xa43df8[_0x477d('0x25')],_0xa43df8[_0x477d('0x27')]);_0x5c814c[_0x477d('0x2b')]=_['intersection'](_0xa43df8['model'],qs[_0x477d('0x2c')](_0x4d1c8e[_0x477d('0x27')]['fields']));_0x5c814c[_0x477d('0x2b')]=_0x5c814c['attributes']['length']?_0x5c814c[_0x477d('0x2b')]:_0xa43df8[_0x477d('0x25')];if(_0x4d1c8e[_0x477d('0x27')][_0x477d('0x3a')]){_0x5c814c[_0x477d('0x40')]=[{'all':!![]}];}_0x5c814c=_[_0x477d('0x35')]({},_0x5c814c,_0x4d1c8e['options']);return db[_0x477d('0x23')][_0x477d('0x41')](_0x5c814c)[_0x477d('0x1c')](handleEntityNotFound(_0x473962,null))[_0x477d('0x1c')](respondWithResult(_0x473962,null))[_0x477d('0x3d')](handleError(_0x473962,null));};exports['create']=function(_0x4aad41,_0xf5084c){return db[_0x477d('0x23')][_0x477d('0x42')](_0x4aad41['body'],{})[_0x477d('0x1c')](respondWithResult(_0xf5084c,0xc9))[_0x477d('0x3d')](handleError(_0xf5084c,null));};exports[_0x477d('0x1b')]=function(_0x1ad4d1,_0x247b40){if(_0x1ad4d1[_0x477d('0x43')]['id']){delete _0x1ad4d1[_0x477d('0x43')]['id'];}return db['VoiceMailMessage'][_0x477d('0x41')]({'where':{'id':_0x1ad4d1[_0x477d('0x3f')]['id']}})[_0x477d('0x1c')](handleEntityNotFound(_0x247b40,null))[_0x477d('0x1c')](saveUpdates(_0x1ad4d1[_0x477d('0x43')],null))[_0x477d('0x1c')](respondWithResult(_0x247b40,null))[_0x477d('0x3d')](handleError(_0x247b40,null));};exports[_0x477d('0x1d')]=function(_0x113162,_0x33df7f){return db[_0x477d('0x23')][_0x477d('0x41')]({'where':{'id':_0x113162[_0x477d('0x3f')]['id']}})[_0x477d('0x1c')](handleEntityNotFound(_0x33df7f,null))[_0x477d('0x1c')](removeEntity(_0x33df7f,null))['catch'](handleError(_0x33df7f,null));};exports[_0x477d('0x44')]=function(_0x23d85f,_0x47ee38,_0x566ba0){return db['VoiceMailMessage'][_0x477d('0x41')]({'where':{'id':_0x23d85f[_0x477d('0x3f')]['id']},'attributes':['id',_0x477d('0x45'),_0x477d('0x46')]})[_0x477d('0x1c')](handleEntityNotFound(_0x47ee38,null))[_0x477d('0x1c')](function(_0x4257ab){if(_0x4257ab){if(!_0x4257ab[_0x477d('0x45')]){throw new db['Sequelize'][(_0x477d('0x47'))](_0x477d('0x48'));}var _0x2a303c={'Content-Type':_0x477d('0x49'),'Content-Disposition':_0x477d('0x4a')};if(_0x4257ab[_0x477d('0x46')]){_0x2a303c[_0x477d('0x4b')]=_0x477d('0x4c')+_0x4257ab['msg_id']+_0x477d('0x4d');}_0x47ee38[_0x477d('0x4e')](_0x2a303c);return _0x47ee38[_0x477d('0x22')](new Buffer(_0x4257ab[_0x477d('0x45')]));}})[_0x477d('0x3d')](handleError(_0x47ee38,null));}; \ No newline at end of file +var _0x0447=['offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','model','differenceBy','filters','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','includeAll','catch','show','params','keys','intersection','fields','length','include','find','create','body','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end'];(function(_0x105657,_0x54f858){var _0x3b3b4e=function(_0x21adb5){while(--_0x21adb5){_0x105657['push'](_0x105657['shift']());}};_0x3b3b4e(++_0x54f858);}(_0x0447,0x8b));var _0x7044=function(_0x38193f,_0x2c6649){_0x38193f=_0x38193f-0x0;var _0x283b66=_0x0447[_0x38193f];return _0x283b66;};'use strict';var pdf=require(_0x7044('0x0'));var emlformat=require(_0x7044('0x1'));var rimraf=require(_0x7044('0x2'));var zipdir=require(_0x7044('0x3'));var jsonpatch=require(_0x7044('0x4'));var rp=require('request-promise');var moment=require(_0x7044('0x5'));var BPromise=require(_0x7044('0x6'));var Mustache=require(_0x7044('0x7'));var util=require(_0x7044('0x8'));var path=require(_0x7044('0x9'));var sox=require(_0x7044('0xa'));var csv=require(_0x7044('0xb'));var ejs=require(_0x7044('0xc'));var fs=require('fs');var _=require(_0x7044('0xd'));var squel=require('squel');var crypto=require(_0x7044('0xe'));var jsforce=require(_0x7044('0xf'));var deskjs=require(_0x7044('0x10'));var toCsv=require(_0x7044('0xb'));var querystring=require('querystring');var Papa=require(_0x7044('0x11'));var authService=require(_0x7044('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7044('0x13'));var qs=require(_0x7044('0x14'));var logger=require(_0x7044('0x15'))(_0x7044('0x16'));var utils=require('../../config/utils');var config=require(_0x7044('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5198d1,_0x53f150){_0x53f150=_0x53f150||0xcc;return function(_0xe26cea){if(_0xe26cea){return _0x5198d1[_0x7044('0x18')](_0x53f150);}return _0x5198d1[_0x7044('0x19')](_0x53f150)[_0x7044('0x1a')]();};}function respondWithResult(_0x56044f,_0x5805f2){_0x5805f2=_0x5805f2||0xc8;return function(_0xd5ae12){if(_0xd5ae12){return _0x56044f[_0x7044('0x19')](_0x5805f2)['json'](_0xd5ae12);}};}function respondWithFilteredResult(_0x4d63a8,_0x798fe3){return function(_0x310535){if(_0x310535){var _0x79f418=_0x310535['count'],_0x35769e=_0x798fe3[_0x7044('0x1b')],_0x2fecb1=_0x798fe3[_0x7044('0x1b')]+_0x798fe3[_0x7044('0x1c')],_0x5cbec7;if(_0x2fecb1>=_0x79f418){_0x2fecb1=_0x79f418;_0x5cbec7=0xc8;}else{_0x5cbec7=0xce;}_0x4d63a8[_0x7044('0x19')](_0x5cbec7);return _0x4d63a8[_0x7044('0x1d')](_0x7044('0x1e'),_0x35769e+'-'+_0x2fecb1+'/'+_0x79f418)['json'](_0x310535);}return null;};}function patchUpdates(_0x1f300e){return function(_0x227bcd){try{jsonpatch[_0x7044('0x1f')](_0x227bcd,_0x1f300e,!![]);}catch(_0x4e7285){return BPromise['reject'](_0x4e7285);}return _0x227bcd['save']();};}function saveUpdates(_0xced6e4,_0x3292f8){return function(_0x2c5dcb){if(_0x2c5dcb){return _0x2c5dcb[_0x7044('0x20')](_0xced6e4)[_0x7044('0x21')](function(_0x4faffe){return _0x4faffe;});}return null;};}function removeEntity(_0x308603,_0x51a83f){return function(_0x4af476){if(_0x4af476){return _0x4af476[_0x7044('0x22')]()[_0x7044('0x21')](function(){_0x308603[_0x7044('0x19')](0xcc)[_0x7044('0x1a')]();});}};}function handleEntityNotFound(_0x39d85e,_0x105da8){return function(_0x41a079){if(!_0x41a079){_0x39d85e[_0x7044('0x18')](0x194);}return _0x41a079;};}function handleError(_0x4271b5,_0x5e2c9a){_0x5e2c9a=_0x5e2c9a||0x1f4;return function(_0x5d7d8a){logger[_0x7044('0x23')](_0x5d7d8a[_0x7044('0x24')]);if(_0x5d7d8a[_0x7044('0x25')]){delete _0x5d7d8a[_0x7044('0x25')];}_0x4271b5[_0x7044('0x19')](_0x5e2c9a)[_0x7044('0x26')](_0x5d7d8a);};}exports[_0x7044('0x27')]=function(_0x45ae52,_0x124671){var _0x2826bf={},_0x1eb4b0={},_0x115d5c={'count':0x0,'rows':[]};var _0x4c618d=db[_0x7044('0x28')][_0x7044('0x29')];_0x1eb4b0[_0x7044('0x2a')]=_[_0x7044('0x2b')](_['keys'](_0x4c618d),[_0x7044('0x25')]);_0x1eb4b0['query']=_['keys'](_0x45ae52['query']);_0x1eb4b0[_0x7044('0x2c')]=_['intersection'](_0x1eb4b0[_0x7044('0x2a')],_0x1eb4b0[_0x7044('0x2d')]);_0x2826bf['attributes']=_['intersection'](_0x1eb4b0[_0x7044('0x2a')],qs['fields'](_0x45ae52['query']['fields']));_0x2826bf[_0x7044('0x2e')]=_0x2826bf[_0x7044('0x2e')]['length']?_0x2826bf[_0x7044('0x2e')]:_0x1eb4b0[_0x7044('0x2a')];if(!_0x45ae52[_0x7044('0x2d')][_0x7044('0x2f')](_0x7044('0x30'))){_0x2826bf['limit']=qs[_0x7044('0x1c')](_0x45ae52[_0x7044('0x2d')][_0x7044('0x1c')]);_0x2826bf[_0x7044('0x1b')]=qs[_0x7044('0x1b')](_0x45ae52['query'][_0x7044('0x1b')]);}_0x2826bf[_0x7044('0x31')]=qs['sort'](_0x45ae52[_0x7044('0x2d')][_0x7044('0x32')]);_0x2826bf[_0x7044('0x33')]=qs[_0x7044('0x2c')](_[_0x7044('0x34')](_0x45ae52[_0x7044('0x2d')],_0x1eb4b0['filters']));if(_0x45ae52['query'][_0x7044('0x35')]){_0x2826bf[_0x7044('0x33')]=_['merge'](_0x2826bf[_0x7044('0x33')],{'$or':_[_0x7044('0x36')](_0x4c618d,function(_0x26acbd){if(_0x26acbd[_0x7044('0x37')][_0x7044('0x38')]!==_0x7044('0x39')){var _0x128e22={};_0x128e22[_0x26acbd[_0x7044('0x3a')]]={'$like':'%'+_0x45ae52['query']['filter']+'%'};return _0x128e22;}})});}_0x2826bf=_[_0x7044('0x3b')]({},_0x2826bf,_0x45ae52[_0x7044('0x3c')]);var _0xc9e572={'where':_0x2826bf[_0x7044('0x33')]};return db[_0x7044('0x28')][_0x7044('0x3d')](_0xc9e572)[_0x7044('0x21')](function(_0x4f6ca2){_0x115d5c[_0x7044('0x3d')]=_0x4f6ca2;if(_0x45ae52[_0x7044('0x2d')][_0x7044('0x3e')]){_0x2826bf['include']=[{'all':!![]}];}return db[_0x7044('0x28')]['findAll'](_0x2826bf);})['then'](function(_0x30c663){_0x115d5c['rows']=_0x30c663;return _0x115d5c;})[_0x7044('0x21')](respondWithFilteredResult(_0x124671,_0x2826bf))[_0x7044('0x3f')](handleError(_0x124671,null));};exports[_0x7044('0x40')]=function(_0x21ddd5,_0xd9cb9f){var _0x39e194={'raw':!![],'where':{'id':_0x21ddd5[_0x7044('0x41')]['id']}},_0x26938e={};_0x26938e[_0x7044('0x2a')]=_[_0x7044('0x42')](db['VoiceMailMessage']['rawAttributes']);_0x26938e['query']=_[_0x7044('0x42')](_0x21ddd5[_0x7044('0x2d')]);_0x26938e[_0x7044('0x2c')]=_[_0x7044('0x43')](_0x26938e['model'],_0x26938e['query']);_0x39e194['attributes']=_[_0x7044('0x43')](_0x26938e[_0x7044('0x2a')],qs[_0x7044('0x44')](_0x21ddd5[_0x7044('0x2d')][_0x7044('0x44')]));_0x39e194[_0x7044('0x2e')]=_0x39e194[_0x7044('0x2e')][_0x7044('0x45')]?_0x39e194[_0x7044('0x2e')]:_0x26938e['model'];if(_0x21ddd5['query']['includeAll']){_0x39e194[_0x7044('0x46')]=[{'all':!![]}];}_0x39e194=_[_0x7044('0x3b')]({},_0x39e194,_0x21ddd5[_0x7044('0x3c')]);return db[_0x7044('0x28')][_0x7044('0x47')](_0x39e194)[_0x7044('0x21')](handleEntityNotFound(_0xd9cb9f,null))[_0x7044('0x21')](respondWithResult(_0xd9cb9f,null))['catch'](handleError(_0xd9cb9f,null));};exports['create']=function(_0x41b367,_0x245960){return db[_0x7044('0x28')][_0x7044('0x48')](_0x41b367[_0x7044('0x49')],{})[_0x7044('0x21')](respondWithResult(_0x245960,0xc9))['catch'](handleError(_0x245960,null));};exports['update']=function(_0x52514c,_0x22cb89){if(_0x52514c[_0x7044('0x49')]['id']){delete _0x52514c[_0x7044('0x49')]['id'];}return db[_0x7044('0x28')]['find']({'where':{'id':_0x52514c[_0x7044('0x41')]['id']}})[_0x7044('0x21')](handleEntityNotFound(_0x22cb89,null))[_0x7044('0x21')](saveUpdates(_0x52514c['body'],null))[_0x7044('0x21')](respondWithResult(_0x22cb89,null))[_0x7044('0x3f')](handleError(_0x22cb89,null));};exports[_0x7044('0x22')]=function(_0x5d85bf,_0xb2c0ce){return db[_0x7044('0x28')][_0x7044('0x47')]({'where':{'id':_0x5d85bf[_0x7044('0x41')]['id']}})['then'](handleEntityNotFound(_0xb2c0ce,null))[_0x7044('0x21')](removeEntity(_0xb2c0ce,null))[_0x7044('0x3f')](handleError(_0xb2c0ce,null));};exports['download']=function(_0x342049,_0x4220ff,_0x1da055){return db[_0x7044('0x28')][_0x7044('0x47')]({'where':{'id':_0x342049['params']['id']},'attributes':['id',_0x7044('0x4a'),_0x7044('0x4b')]})['then'](handleEntityNotFound(_0x4220ff,null))['then'](function(_0x1e4b69){if(_0x1e4b69){if(!_0x1e4b69[_0x7044('0x4a')]){throw new db[(_0x7044('0x4c'))][(_0x7044('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x1ae35d={'Content-Type':_0x7044('0x4e'),'Content-Disposition':_0x7044('0x4f')};if(_0x1e4b69[_0x7044('0x4b')]){_0x1ae35d[_0x7044('0x50')]=_0x7044('0x51')+_0x1e4b69[_0x7044('0x4b')]+_0x7044('0x52');}_0x4220ff[_0x7044('0x1d')](_0x1ae35d);return _0x4220ff[_0x7044('0x26')](new Buffer(_0x1e4b69[_0x7044('0x4a')]));}})[_0x7044('0x3f')](handleError(_0x4220ff,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 64fe1e2..be8197d 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 _0x5e09=['bluebird','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','moment'];(function(_0x22440d,_0x5272c1){var _0x2f692e=function(_0x4d3ce2){while(--_0x4d3ce2){_0x22440d['push'](_0x22440d['shift']());}};_0x2f692e(++_0x5272c1);}(_0x5e09,0xee));var _0x95e0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5e09[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x95e0('0x0'));var logger=require(_0x95e0('0x1'))(_0x95e0('0x2'));var moment=require(_0x95e0('0x3'));var BPromise=require(_0x95e0('0x4'));var rp=require('request-promise');var attributes=require(_0x95e0('0x5'));module[_0x95e0('0x6')]=function(_0x30b66c,_0x123fa9){return _0x30b66c[_0x95e0('0x7')](_0x95e0('0x8'),attributes,{'tableName':_0x95e0('0x9'),'paranoid':![],'indexes':[{'name':_0x95e0('0xa'),'fields':[_0x95e0('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2346=['../../config/logger','api','moment','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','lodash','util'];(function(_0x5db6a8,_0x2193f7){var _0x2441ef=function(_0x131470){while(--_0x131470){_0x5db6a8['push'](_0x5db6a8['shift']());}};_0x2441ef(++_0x2193f7);}(_0x2346,0xc4));var _0x6234=function(_0xd256a1,_0x2aae80){_0xd256a1=_0xd256a1-0x0;var _0x2a11a4=_0x2346[_0xd256a1];return _0x2a11a4;};'use strict';var _=require(_0x6234('0x0'));var util=require(_0x6234('0x1'));var logger=require(_0x6234('0x2'))(_0x6234('0x3'));var moment=require(_0x6234('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x6234('0x5'));module[_0x6234('0x6')]=function(_0xb137b8,_0x21c63a){return _0xb137b8['define']('VoiceMailMessage',attributes,{'tableName':_0x6234('0x7'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x6234('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 388cb29..bbee75a 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 _0xcc53=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x55e28f,_0x20cedb){var _0xee48e9=function(_0x1de3df){while(--_0x1de3df){_0x55e28f['push'](_0x55e28f['shift']());}};_0xee48e9(++_0x20cedb);}(_0xcc53,0x184));var _0x3cc5=function(_0x1fbdd1,_0x11ebc7){_0x1fbdd1=_0x1fbdd1-0x0;var _0x4101c7=_0xcc53[_0x1fbdd1];return _0x4101c7;};'use strict';var _=require(_0x3cc5('0x0'));var util=require(_0x3cc5('0x1'));var moment=require(_0x3cc5('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cc5('0x3'));var fs=require('fs');var Redis=require(_0x3cc5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cc5('0x5'));var logger=require(_0x3cc5('0x6'))(_0x3cc5('0x7'));var config=require(_0x3cc5('0x8'));var jayson=require(_0x3cc5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x401afe,_0x572fd9,_0x4ab3ef){return new BPromise(function(_0x365f2a,_0x495f22){return client[_0x3cc5('0xa')](_0x401afe,_0x4ab3ef)[_0x3cc5('0xb')](function(_0x4da747){logger[_0x3cc5('0xc')](_0x3cc5('0xd'),_0x572fd9,_0x3cc5('0xe'));logger['debug'](_0x3cc5('0xf'),_0x572fd9,_0x3cc5('0xe'),JSON[_0x3cc5('0x10')](_0x4da747));if(_0x4da747[_0x3cc5('0x11')]){if(_0x4da747[_0x3cc5('0x11')]['code']===0x1f4){logger[_0x3cc5('0x11')](_0x3cc5('0xd'),_0x572fd9,_0x4da747[_0x3cc5('0x11')][_0x3cc5('0x12')]);return _0x495f22(_0x4da747[_0x3cc5('0x11')][_0x3cc5('0x12')]);}logger[_0x3cc5('0x11')](_0x3cc5('0xd'),_0x572fd9,_0x4da747[_0x3cc5('0x11')][_0x3cc5('0x12')]);return _0x365f2a(_0x4da747[_0x3cc5('0x11')][_0x3cc5('0x12')]);}else{logger[_0x3cc5('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x572fd9,_0x3cc5('0xe'));_0x365f2a(_0x4da747['result']['message']);}})[_0x3cc5('0x13')](function(_0x28b213){logger[_0x3cc5('0x11')](_0x3cc5('0xd'),_0x572fd9,_0x28b213);_0x495f22(_0x28b213);});});} \ No newline at end of file +var _0x05b6=['VoiceMailMessage,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x10e46d,_0x319cab){var _0x32a29e=function(_0x537930){while(--_0x537930){_0x10e46d['push'](_0x10e46d['shift']());}};_0x32a29e(++_0x319cab);}(_0x05b6,0x1bb));var _0x605b=function(_0x124d74,_0x18eda2){_0x124d74=_0x124d74-0x0;var _0x46418e=_0x05b6[_0x124d74];return _0x46418e;};'use strict';var _=require(_0x605b('0x0'));var util=require(_0x605b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x605b('0x2'));var fs=require('fs');var Redis=require(_0x605b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x605b('0x4'));var logger=require(_0x605b('0x5'))(_0x605b('0x6'));var config=require(_0x605b('0x7'));var jayson=require(_0x605b('0x8'));var client=jayson[_0x605b('0x9')][_0x605b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a7b2f,_0x319597,_0x3d8f70){return new BPromise(function(_0x2bb12f,_0x27cd5d){return client[_0x605b('0xb')](_0x3a7b2f,_0x3d8f70)[_0x605b('0xc')](function(_0x26f885){logger[_0x605b('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x319597,_0x605b('0xe'));logger[_0x605b('0xf')](_0x605b('0x10'),_0x319597,_0x605b('0xe'),JSON['stringify'](_0x26f885));if(_0x26f885[_0x605b('0x11')]){if(_0x26f885[_0x605b('0x11')][_0x605b('0x12')]===0x1f4){logger[_0x605b('0x11')](_0x605b('0x13'),_0x319597,_0x26f885[_0x605b('0x11')][_0x605b('0x14')]);return _0x27cd5d(_0x26f885[_0x605b('0x11')][_0x605b('0x14')]);}logger[_0x605b('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x319597,_0x26f885['error'][_0x605b('0x14')]);return _0x2bb12f(_0x26f885[_0x605b('0x11')][_0x605b('0x14')]);}else{logger['info'](_0x605b('0x13'),_0x319597,'request\x20sent');_0x2bb12f(_0x26f885[_0x605b('0x15')][_0x605b('0x14')]);}})['catch'](function(_0x3a2940){logger[_0x605b('0x11')](_0x605b('0x13'),_0x319597,_0x3a2940);_0x27cd5d(_0x3a2940);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 01151ba..4aba6cb 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 _0x9aea=['exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','create','addSound','update','delete','destroy','removeSound'];(function(_0x196995,_0x2575dd){var _0x1ff73a=function(_0x4b6aeb){while(--_0x4b6aeb){_0x196995['push'](_0x196995['shift']());}};_0x1ff73a(++_0x2575dd);}(_0x9aea,0xdd));var _0xa9ae=function(_0x2ebc59,_0x253204){_0x2ebc59=_0x2ebc59-0x0;var _0xd48ac3=_0x9aea[_0x2ebc59];return _0xd48ac3;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express[_0xa9ae('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa9ae('0x4'));var config=require(_0xa9ae('0x5'));var controller=require(_0xa9ae('0x6'));router[_0xa9ae('0x7')]('/',auth[_0xa9ae('0x8')](),controller['index']);router[_0xa9ae('0x7')](_0xa9ae('0x9'),auth[_0xa9ae('0x8')](),controller['show']);router[_0xa9ae('0x7')](_0xa9ae('0xa'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0xc')]('/',auth[_0xa9ae('0x8')](),controller[_0xa9ae('0xd')]);router[_0xa9ae('0xc')](_0xa9ae('0xa'),auth['isAuthenticated'](),controller[_0xa9ae('0xe')]);router['put'](_0xa9ae('0x9'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0xf')]);router[_0xa9ae('0x10')](_0xa9ae('0x9'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0x11')]);router[_0xa9ae('0x10')]('/:id/sounds/:id2',auth[_0xa9ae('0x8')](),controller[_0xa9ae('0x12')]);module[_0xa9ae('0x13')]=router; \ No newline at end of file +var _0x2bc6=['index','/:id','isAuthenticated','show','getSounds','post','/:id/sounds','put','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','../../components/interaction/service','./voiceMusicOnHold.controller','get'];(function(_0x5042bc,_0x4f80ff){var _0x5afc66=function(_0x16b85e){while(--_0x16b85e){_0x5042bc['push'](_0x5042bc['shift']());}};_0x5afc66(++_0x4f80ff);}(_0x2bc6,0x163));var _0x62bc=function(_0x24f9ec,_0xf66ebf){_0x24f9ec=_0x24f9ec-0x0;var _0x12ae0c=_0x2bc6[_0x24f9ec];return _0x12ae0c;};'use strict';var multer=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var path=require(_0x62bc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x62bc('0x3'));var config=require('../../config/environment');var controller=require(_0x62bc('0x4'));router[_0x62bc('0x5')]('/',auth['isAuthenticated'](),controller[_0x62bc('0x6')]);router[_0x62bc('0x5')](_0x62bc('0x7'),auth[_0x62bc('0x8')](),controller[_0x62bc('0x9')]);router[_0x62bc('0x5')]('/:id/sounds',auth[_0x62bc('0x8')](),controller[_0x62bc('0xa')]);router[_0x62bc('0xb')]('/',auth[_0x62bc('0x8')](),controller['create']);router[_0x62bc('0xb')](_0x62bc('0xc'),auth[_0x62bc('0x8')](),controller['addSound']);router[_0x62bc('0xd')](_0x62bc('0x7'),auth[_0x62bc('0x8')](),controller[_0x62bc('0xe')]);router[_0x62bc('0xf')](_0x62bc('0x7'),auth[_0x62bc('0x8')](),controller['destroy']);router[_0x62bc('0xf')](_0x62bc('0x10'),auth['isAuthenticated'](),controller[_0x62bc('0x11')]);module[_0x62bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index e96662f..2f61dc2 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 _0xc43e=['files','mp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','STRING','name','ENUM','custom'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xc43e,0x11e));var _0xec43=function(_0x275b0d,_0xfa6f31){_0x275b0d=_0x275b0d-0x0;var _0x2d1453=_0xc43e[_0x275b0d];return _0x2d1453;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xec43('0x0')],'allowNull':![],'unique':_0xec43('0x1')},'mode':{'type':Sequelize[_0xec43('0x2')](_0xec43('0x3'),_0xec43('0x4'),_0xec43('0x5'),'quietmp3nb',_0xec43('0x6'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xec43('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0xec43('0x0')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xec43('0x7')},'format':{'type':Sequelize[_0xec43('0x0')],'allowNull':!![]},'stamp':{'type':_0xec43('0x8')},'defaultEntry':{'type':Sequelize[_0xec43('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa47f=['BOOLEAN','sequelize','exports','STRING','name','ENUM','files','mp3','TIMESTAMP'];(function(_0x201d02,_0x16330b){var _0x549a99=function(_0x10066a){while(--_0x10066a){_0x201d02['push'](_0x201d02['shift']());}};_0x549a99(++_0x16330b);}(_0xa47f,0x14e));var _0xfa47=function(_0xbf87e3,_0x270502){_0xbf87e3=_0xbf87e3-0x0;var _0x9f1da4=_0xa47f[_0xbf87e3];return _0x9f1da4;};'use strict';var Sequelize=require(_0xfa47('0x0'));module[_0xfa47('0x1')]={'name':{'type':Sequelize[_0xfa47('0x2')],'allowNull':![],'unique':_0xfa47('0x3')},'mode':{'type':Sequelize[_0xfa47('0x4')]('custom',_0xfa47('0x5'),'mp3nb','quietmp3nb','quietmp3',_0xfa47('0x6')),'allowNull':!![],'defaultValue':_0xfa47('0x5')},'directory':{'type':Sequelize[_0xfa47('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xfa47('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xfa47('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xfa47('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xfa47('0x2')],'allowNull':!![]},'stamp':{'type':_0xfa47('0x7')},'defaultEntry':{'type':Sequelize[_0xfa47('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index a054d0d..bdcebd2 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 _0x68e2=['count','offset','limit','set','apply','reject','save','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','index','VoiceMusicOnHold','rawAttributes','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','map','type','VIRTUAL','field','options','includeAll','rows','show','params','intersection','include','find','catch','body','create','sequelize','files','join','root','server/files/moh','mode','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','unlinkSync','pick','getSounds','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0x124124,_0x2ba5a0){var _0x574a9f=function(_0x13678c){while(--_0x13678c){_0x124124['push'](_0x124124['shift']());}};_0x574a9f(++_0x2ba5a0);}(_0x68e2,0x131));var _0x268e=function(_0x29b147,_0x56339c){_0x29b147=_0x29b147-0x0;var _0x33efee=_0x68e2[_0x29b147];return _0x33efee;};'use strict';var pdf=require(_0x268e('0x0'));var emlformat=require(_0x268e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x268e('0x2'));var jsonpatch=require(_0x268e('0x3'));var rp=require(_0x268e('0x4'));var moment=require('moment');var BPromise=require(_0x268e('0x5'));var Mustache=require(_0x268e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x268e('0x7'));var csv=require(_0x268e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x268e('0x9'));var squel=require(_0x268e('0xa'));var crypto=require(_0x268e('0xb'));var jsforce=require(_0x268e('0xc'));var deskjs=require(_0x268e('0xd'));var toCsv=require(_0x268e('0x8'));var querystring=require(_0x268e('0xe'));var Papa=require(_0x268e('0xf'));var authService=require(_0x268e('0x10'));var hardwareService=require(_0x268e('0x11'));var Redis=require(_0x268e('0x12'));var qs=require(_0x268e('0x13'));var logger=require(_0x268e('0x14'))(_0x268e('0x15'));var utils=require(_0x268e('0x16'));var config=require('../../config/environment');var db=require(_0x268e('0x17'))['db'];function respondWithStatusCode(_0x37dce9,_0x1532fd){_0x1532fd=_0x1532fd||0xcc;return function(_0x1f478f){if(_0x1f478f){return _0x37dce9[_0x268e('0x18')](_0x1532fd);}return _0x37dce9[_0x268e('0x19')](_0x1532fd)[_0x268e('0x1a')]();};}function respondWithResult(_0x47f26f,_0x233f2e){_0x233f2e=_0x233f2e||0xc8;return function(_0x660dc0){if(_0x660dc0){return _0x47f26f[_0x268e('0x19')](_0x233f2e)[_0x268e('0x1b')](_0x660dc0);}};}function respondWithFilteredResult(_0x26f6d0,_0x3973c9){return function(_0x2192da){if(_0x2192da){var _0xf88209=_0x2192da[_0x268e('0x1c')],_0x5d7ab1=_0x3973c9[_0x268e('0x1d')],_0x52b6cf=_0x3973c9[_0x268e('0x1d')]+_0x3973c9[_0x268e('0x1e')],_0xcff47e;if(_0x52b6cf>=_0xf88209){_0x52b6cf=_0xf88209;_0xcff47e=0xc8;}else{_0xcff47e=0xce;}_0x26f6d0[_0x268e('0x19')](_0xcff47e);return _0x26f6d0[_0x268e('0x1f')]('Content-Range',_0x5d7ab1+'-'+_0x52b6cf+'/'+_0xf88209)[_0x268e('0x1b')](_0x2192da);}return null;};}function patchUpdates(_0x1713dc){return function(_0x937156){try{jsonpatch[_0x268e('0x20')](_0x937156,_0x1713dc,!![]);}catch(_0x2dd5be){return BPromise[_0x268e('0x21')](_0x2dd5be);}return _0x937156[_0x268e('0x22')]();};}function saveUpdates(_0x560b31,_0x3fb41a){return function(_0x838b2e){if(_0x838b2e){return _0x838b2e['update'](_0x560b31)['then'](function(_0x422347){return _0x422347;});}return null;};}function removeEntity(_0x606811,_0xf444e6){return function(_0x397d66){if(_0x397d66){return _0x397d66[_0x268e('0x23')]()[_0x268e('0x24')](function(){var _0x411ff5=_0x397d66[_0x268e('0x25')]({'plain':!![]});var _0x3932fc=_0x268e('0x26');return db[_0x268e('0x27')][_0x268e('0x23')]({'where':{'type':_0x3932fc,'resourceId':_0x411ff5['id']}})[_0x268e('0x24')](function(){return _0x397d66;});})[_0x268e('0x24')](function(){_0x606811[_0x268e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x382446,_0x52f85b){return function(_0x294984){if(!_0x294984){_0x382446[_0x268e('0x18')](0x194);}return _0x294984;};}function handleError(_0x2d482c,_0x11ee81){_0x11ee81=_0x11ee81||0x1f4;return function(_0x2bb44c){logger[_0x268e('0x28')](_0x2bb44c[_0x268e('0x29')]);if(_0x2bb44c[_0x268e('0x2a')]){delete _0x2bb44c[_0x268e('0x2a')];}_0x2d482c[_0x268e('0x19')](_0x11ee81)['send'](_0x2bb44c);};}exports[_0x268e('0x2b')]=function(_0x5c1b16,_0xe419d2){var _0x3a4c0a={},_0x59c75e={},_0x352412={'count':0x0,'rows':[]};var _0x240da9=db[_0x268e('0x2c')][_0x268e('0x2d')];_0x59c75e[_0x268e('0x2e')]=_['keys'](_0x240da9);_0x59c75e[_0x268e('0x2f')]=_[_0x268e('0x30')](_0x5c1b16[_0x268e('0x2f')]);_0x59c75e[_0x268e('0x31')]=_['intersection'](_0x59c75e[_0x268e('0x2e')],_0x59c75e[_0x268e('0x2f')]);_0x3a4c0a[_0x268e('0x32')]=_['intersection'](_0x59c75e['model'],qs[_0x268e('0x33')](_0x5c1b16['query'][_0x268e('0x33')]));_0x3a4c0a[_0x268e('0x32')]=_0x3a4c0a[_0x268e('0x32')][_0x268e('0x34')]?_0x3a4c0a[_0x268e('0x32')]:_0x59c75e['model'];if(!_0x5c1b16[_0x268e('0x2f')][_0x268e('0x35')]('nolimit')){_0x3a4c0a[_0x268e('0x1e')]=qs[_0x268e('0x1e')](_0x5c1b16[_0x268e('0x2f')][_0x268e('0x1e')]);_0x3a4c0a[_0x268e('0x1d')]=qs['offset'](_0x5c1b16[_0x268e('0x2f')][_0x268e('0x1d')]);}_0x3a4c0a['order']=qs['sort'](_0x5c1b16[_0x268e('0x2f')][_0x268e('0x36')]);_0x3a4c0a[_0x268e('0x37')]=qs[_0x268e('0x31')](_['pick'](_0x5c1b16[_0x268e('0x2f')],_0x59c75e[_0x268e('0x31')]));if(_0x5c1b16['query'][_0x268e('0x38')]){_0x3a4c0a[_0x268e('0x37')]=_[_0x268e('0x39')](_0x3a4c0a[_0x268e('0x37')],{'$or':_[_0x268e('0x3a')](_0x240da9,function(_0x1b8b47){if(_0x1b8b47[_0x268e('0x3b')]['key']!==_0x268e('0x3c')){var _0x198104={};_0x198104[_0x1b8b47[_0x268e('0x3d')]]={'$like':'%'+_0x5c1b16[_0x268e('0x2f')][_0x268e('0x38')]+'%'};return _0x198104;}})});}_0x3a4c0a=_[_0x268e('0x39')]({},_0x3a4c0a,_0x5c1b16[_0x268e('0x3e')]);var _0x1cfb83={'where':_0x3a4c0a[_0x268e('0x37')]};return db['VoiceMusicOnHold'][_0x268e('0x1c')](_0x1cfb83)[_0x268e('0x24')](function(_0x551ab7){_0x352412[_0x268e('0x1c')]=_0x551ab7;if(_0x5c1b16[_0x268e('0x2f')][_0x268e('0x3f')]){_0x3a4c0a['include']=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x3a4c0a);})[_0x268e('0x24')](function(_0x3e27b1){_0x352412[_0x268e('0x40')]=_0x3e27b1;return _0x352412;})[_0x268e('0x24')](respondWithFilteredResult(_0xe419d2,_0x3a4c0a))['catch'](handleError(_0xe419d2,null));};exports[_0x268e('0x41')]=function(_0x3defd1,_0x343fa7){var _0x5557b5={'raw':![],'where':{'id':_0x3defd1[_0x268e('0x42')]['id']}},_0x1f644f={};_0x1f644f[_0x268e('0x2e')]=_[_0x268e('0x30')](db[_0x268e('0x2c')][_0x268e('0x2d')]);_0x1f644f[_0x268e('0x2f')]=_[_0x268e('0x30')](_0x3defd1['query']);_0x1f644f['filters']=_[_0x268e('0x43')](_0x1f644f[_0x268e('0x2e')],_0x1f644f[_0x268e('0x2f')]);_0x5557b5[_0x268e('0x32')]=_[_0x268e('0x43')](_0x1f644f[_0x268e('0x2e')],qs[_0x268e('0x33')](_0x3defd1[_0x268e('0x2f')][_0x268e('0x33')]));_0x5557b5[_0x268e('0x32')]=_0x5557b5['attributes']['length']?_0x5557b5[_0x268e('0x32')]:_0x1f644f[_0x268e('0x2e')];if(_0x3defd1['query'][_0x268e('0x3f')]){_0x5557b5[_0x268e('0x44')]=[{'all':!![]}];}_0x5557b5=_['merge']({},_0x5557b5,_0x3defd1[_0x268e('0x3e')]);return db[_0x268e('0x2c')][_0x268e('0x45')](_0x5557b5)[_0x268e('0x24')](handleEntityNotFound(_0x343fa7,null))[_0x268e('0x24')](respondWithResult(_0x343fa7,null))[_0x268e('0x46')](handleError(_0x343fa7,null));};exports['update']=function(_0x5ce4a5,_0x2564eb){if(_0x5ce4a5[_0x268e('0x47')]['id']){delete _0x5ce4a5[_0x268e('0x47')]['id'];}return db[_0x268e('0x2c')]['find']({'where':{'id':_0x5ce4a5[_0x268e('0x42')]['id']}})[_0x268e('0x24')](handleEntityNotFound(_0x2564eb,null))['then'](saveUpdates(_0x5ce4a5[_0x268e('0x47')],null))[_0x268e('0x24')](respondWithResult(_0x2564eb,null))[_0x268e('0x46')](handleError(_0x2564eb,null));};exports[_0x268e('0x48')]=function(_0x1714e9,_0x11c4ff,_0x58f6b5){return db[_0x268e('0x49')]['transaction'](function(_0x304234){if(_0x1714e9[_0x268e('0x47')]['mode']===_0x268e('0x4a')){_0x1714e9[_0x268e('0x47')]['directory']=path[_0x268e('0x4b')](config[_0x268e('0x4c')],_0x268e('0x4d'),_0x1714e9[_0x268e('0x47')][_0x268e('0x2a')]);}return db[_0x268e('0x2c')][_0x268e('0x48')](_0x1714e9[_0x268e('0x47')],{'transaction':_0x304234})[_0x268e('0x24')](function(_0x572298){if(_0x1714e9['body'][_0x268e('0x4e')]==='files'){fs['mkdirSync'](_0x572298[_0x268e('0x4f')],parseInt(_0x268e('0x50'),0x8));}var _0x1d27d0=_0x1714e9[_0x268e('0x51')][_0x268e('0x25')]({'plain':!![]});if(!_0x1d27d0)throw new Error(_0x268e('0x52'));if(_0x1d27d0[_0x268e('0x53')]===_0x268e('0x51')){var _0x2c7c53=_0x572298['get']({'plain':!![]});return db[_0x268e('0x54')][_0x268e('0x45')]({'where':{'name':'MusicOnHolds','userProfileId':_0x1d27d0['userProfileId']},'raw':!![]})['then'](function(_0x232d35){if(_0x232d35&&_0x232d35[_0x268e('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x2c7c53[_0x268e('0x2a')],'resourceId':_0x2c7c53['id'],'type':_0x232d35[_0x268e('0x2a')],'sectionId':_0x232d35['id']},{})[_0x268e('0x24')](function(){return _0x572298;});}else{return _0x572298;}})['catch'](function(_0x45fb80){logger[_0x268e('0x28')](_0x268e('0x56'),_0x45fb80);});}return _0x572298;});})[_0x268e('0x24')](respondWithResult(_0x11c4ff,0xc9))[_0x268e('0x46')](handleError(_0x11c4ff,null));};exports['destroy']=function(_0x55925e,_0x584733,_0x5f047d){var _0x1ac120;return db[_0x268e('0x2c')]['find']({'where':{'id':_0x55925e['params']['id']}})['then'](function(_0x2ac9ca){if(_0x2ac9ca){return db[_0x268e('0x49')][_0x268e('0x57')](function(_0x816932){return _0x2ac9ca[_0x268e('0x23')]({'transaction':_0x816932,'raw':!![]})[_0x268e('0x24')](function(_0x564745){if(_0x564745[_0x268e('0x4f')]){fs['readdirSync'](_0x564745[_0x268e('0x4f')])[_0x268e('0x58')](function(_0x396462){fs['unlinkSync'](path[_0x268e('0x4b')](_0x564745[_0x268e('0x4f')],_0x396462));});fs[_0x268e('0x59')](_0x564745[_0x268e('0x4f')]);}return _0x564745;});})[_0x268e('0x46')](function(_0xb4b436){throw new db[(_0x268e('0x5a'))][(_0x268e('0x5b'))](_0xb4b436[_0x268e('0x5c')]);});}})[_0x268e('0x24')](handleEntityNotFound(_0x584733,null))[_0x268e('0x24')](removeEntity(_0x584733,null))[_0x268e('0x46')](handleError(_0x584733,null));};exports[_0x268e('0x5d')]=function(_0x5d2adf,_0x2d8c84,_0xcf110f){return db[_0x268e('0x49')][_0x268e('0x57')](function(_0x5ad6e2){var _0x45948e;return db[_0x268e('0x2c')][_0x268e('0x45')]({'where':{'id':_0x5d2adf[_0x268e('0x42')]['id']}})['then'](function(_0x175496){if(_0x175496){_0x45948e=_0x175496;return _0x175496[_0x268e('0x5d')](_0x5d2adf[_0x268e('0x47')]['id'],{'transaction':_0x5ad6e2});}})[_0x268e('0x24')](function(_0x53297f){if(_0x53297f){return db[_0x268e('0x5e')][_0x268e('0x5f')]({'where':{'id':_0x5d2adf[_0x268e('0x47')]['id']},'attributes':['id',_0x268e('0x2a'),_0x268e('0x60'),_0x268e('0x61'),_0x268e('0x62')],'raw':!![]});}})[_0x268e('0x24')](function(_0x5d1d36){if(_0x5d1d36){var _0x19aad4=path[_0x268e('0x4b')](config[_0x268e('0x4c')],_0x268e('0x63'),util[_0x268e('0x64')](_0x268e('0x65'),path[_0x268e('0x66')](_0x5d1d36['save_name'],path[_0x268e('0x67')](_0x5d1d36[_0x268e('0x60')])),_0x5d1d36[_0x268e('0x61')]));var _0x578873=path[_0x268e('0x4b')](config[_0x268e('0x4c')],_0x268e('0x4d'),_0x45948e[_0x268e('0x2a')],util[_0x268e('0x64')]('%s.%s',_0x5d1d36['name'],_0x5d1d36['converted_format']));fs[_0x268e('0x68')](_0x19aad4,_0x578873);return _0x5d1d36;}})[_0x268e('0x46')](function(_0x32a33a){throw new db[(_0x268e('0x5a'))][(_0x268e('0x5b'))](_0x32a33a[_0x268e('0x5c')]);});})[_0x268e('0x24')](handleEntityNotFound(_0x2d8c84,null))['then'](respondWithResult(_0x2d8c84,0xc9))[_0x268e('0x46')](handleError(_0x2d8c84,null));};exports[_0x268e('0x69')]=function(_0xa26f84,_0x9f0b06,_0x3a44e6){return db[_0x268e('0x49')][_0x268e('0x57')](function(_0x360bdf){var _0xf14b14;return db['VoiceMusicOnHold'][_0x268e('0x5f')]({'where':{'id':_0xa26f84['params']['id']}})[_0x268e('0x24')](handleEntityNotFound(_0x9f0b06,null))[_0x268e('0x24')](function(_0x1801a4){if(_0x1801a4){_0xf14b14=_0x1801a4;return _0x1801a4['removeSound'](_0xa26f84[_0x268e('0x42')][_0x268e('0x6a')]);}})['then'](function(_0x379a74){if(_0x379a74){return db[_0x268e('0x5e')][_0x268e('0x5f')]({'where':{'id':_0xa26f84['params']['id2']},'attributes':['id',_0x268e('0x2a'),_0x268e('0x60'),_0x268e('0x61'),'createdAt'],'raw':!![]});}})['then'](function(_0x51a604){if(_0x51a604){fs[_0x268e('0x6b')](path[_0x268e('0x4b')](_0xf14b14[_0x268e('0x4f')],util[_0x268e('0x64')](_0x268e('0x65'),_0x51a604[_0x268e('0x2a')],_0x51a604[_0x268e('0x61')])));return _0x51a604;}})[_0x268e('0x46')](function(_0x2eb5b6){throw new db[(_0x268e('0x5a'))][(_0x268e('0x5b'))](_0x2eb5b6['message']);});})[_0x268e('0x24')](handleEntityNotFound(_0x9f0b06,null))[_0x268e('0x24')](respondWithStatusCode(_0x9f0b06,0xcc))['catch'](handleError(_0x9f0b06,null));};exports['getSounds']=function(_0x291a52,_0x5b7708,_0x2b828e){var _0x2e2293={};var _0x185a32={};var _0x4b8fad;var _0x3b44bf;return db['VoiceMusicOnHold'][_0x268e('0x5f')]({'where':{'id':_0x291a52[_0x268e('0x42')]['id']}})[_0x268e('0x24')](handleEntityNotFound(_0x5b7708,null))['then'](function(_0x49f6c1){if(_0x49f6c1){_0x4b8fad=_0x49f6c1;_0x185a32[_0x268e('0x2e')]=_[_0x268e('0x30')](db[_0x268e('0x5e')][_0x268e('0x2d')]);_0x185a32['query']=_[_0x268e('0x30')](_0x291a52[_0x268e('0x2f')]);_0x185a32[_0x268e('0x31')]=_[_0x268e('0x43')](_0x185a32['model'],_0x185a32[_0x268e('0x2f')]);_0x2e2293['attributes']=_[_0x268e('0x43')](_0x185a32[_0x268e('0x2e')],qs['fields'](_0x291a52[_0x268e('0x2f')][_0x268e('0x33')]));_0x2e2293[_0x268e('0x32')]=_0x2e2293[_0x268e('0x32')][_0x268e('0x34')]?_0x2e2293[_0x268e('0x32')]:_0x185a32[_0x268e('0x2e')];_0x2e2293['order']=qs[_0x268e('0x36')](_0x291a52[_0x268e('0x2f')][_0x268e('0x36')]);_0x2e2293[_0x268e('0x37')]=qs[_0x268e('0x31')](_[_0x268e('0x6c')](_0x291a52[_0x268e('0x2f')],_0x185a32[_0x268e('0x31')]));if(_0x291a52[_0x268e('0x2f')]['filter']){_0x2e2293[_0x268e('0x37')]=_['merge'](_0x2e2293[_0x268e('0x37')],{'$or':_[_0x268e('0x3a')](_0x2e2293[_0x268e('0x32')],function(_0x303b12){var _0x5954e5={};_0x5954e5[_0x303b12]={'$like':'%'+_0x291a52[_0x268e('0x2f')]['filter']+'%'};return _0x5954e5;})});}_0x2e2293=_[_0x268e('0x39')]({},_0x2e2293,_0x291a52[_0x268e('0x3e')]);return _0x4b8fad[_0x268e('0x6d')](_0x2e2293);}})[_0x268e('0x24')](function(_0xc1d925){if(_0xc1d925){_0x3b44bf=_0xc1d925[_0x268e('0x34')];if(!_0x291a52[_0x268e('0x2f')][_0x268e('0x35')](_0x268e('0x6e'))){_0x2e2293['limit']=qs['limit'](_0x291a52['query'][_0x268e('0x1e')]);_0x2e2293[_0x268e('0x1d')]=qs[_0x268e('0x1d')](_0x291a52[_0x268e('0x2f')]['offset']);}return _0x4b8fad['getSounds'](_0x2e2293);}})[_0x268e('0x24')](function(_0x5d4056){if(_0x5d4056){return _0x5d4056?{'count':_0x3b44bf,'rows':_0x5d4056}:null;}})[_0x268e('0x24')](respondWithResult(_0x5b7708,null))[_0x268e('0x46')](handleError(_0x5b7708,null));}; \ No newline at end of file +var _0x65bd=['hasOwnProperty','nolimit','order','sort','where','filters','filter','map','key','VIRTUAL','field','options','VoiceMusicOnHold','includeAll','include','findAll','catch','show','params','merge','find','body','create','sequelize','transaction','mode','files','root','mkdirSync','directory','0777','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','join','server/files/sounds/converted','format','%s.%s','extname','server/files/moh','symlinkSync','removeSound','id2','unlinkSync','getSounds','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','save','destroy','get','UserProfileResource','then','error','stack','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','length'];(function(_0x57a6f1,_0x282078){var _0x3559ae=function(_0xff0a86){while(--_0xff0a86){_0x57a6f1['push'](_0x57a6f1['shift']());}};_0x3559ae(++_0x282078);}(_0x65bd,0x162));var _0xd65b=function(_0x364a68,_0xbdaf92){_0x364a68=_0x364a68-0x0;var _0x40db45=_0x65bd[_0x364a68];return _0x40db45;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd65b('0x0'));var rimraf=require(_0xd65b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd65b('0x2'));var rp=require(_0xd65b('0x3'));var moment=require(_0xd65b('0x4'));var BPromise=require(_0xd65b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd65b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd65b('0x7'));var fs=require('fs');var _=require(_0xd65b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd65b('0x9'));var deskjs=require(_0xd65b('0xa'));var toCsv=require(_0xd65b('0xb'));var querystring=require(_0xd65b('0xc'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xd65b('0xd'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xd65b('0xe'))(_0xd65b('0xf'));var utils=require(_0xd65b('0x10'));var config=require('../../config/environment');var db=require(_0xd65b('0x11'))['db'];function respondWithStatusCode(_0x3fa1ed,_0x1aef21){_0x1aef21=_0x1aef21||0xcc;return function(_0x5b883f){if(_0x5b883f){return _0x3fa1ed[_0xd65b('0x12')](_0x1aef21);}return _0x3fa1ed[_0xd65b('0x13')](_0x1aef21)['end']();};}function respondWithResult(_0x143fba,_0x2afc33){_0x2afc33=_0x2afc33||0xc8;return function(_0x3f8fb4){if(_0x3f8fb4){return _0x143fba[_0xd65b('0x13')](_0x2afc33)[_0xd65b('0x14')](_0x3f8fb4);}};}function respondWithFilteredResult(_0x2fd99d,_0x22d198){return function(_0x2a57fe){if(_0x2a57fe){var _0xd10dc2=_0x2a57fe[_0xd65b('0x15')],_0x27b9b6=_0x22d198[_0xd65b('0x16')],_0x12ed9a=_0x22d198[_0xd65b('0x16')]+_0x22d198[_0xd65b('0x17')],_0x4f86a9;if(_0x12ed9a>=_0xd10dc2){_0x12ed9a=_0xd10dc2;_0x4f86a9=0xc8;}else{_0x4f86a9=0xce;}_0x2fd99d['status'](_0x4f86a9);return _0x2fd99d['set']('Content-Range',_0x27b9b6+'-'+_0x12ed9a+'/'+_0xd10dc2)['json'](_0x2a57fe);}return null;};}function patchUpdates(_0x17d8aa){return function(_0x45e13b){try{jsonpatch[_0xd65b('0x18')](_0x45e13b,_0x17d8aa,!![]);}catch(_0x493edf){return BPromise['reject'](_0x493edf);}return _0x45e13b[_0xd65b('0x19')]();};}function saveUpdates(_0x38694d,_0x24f56d){return function(_0x396a2c){if(_0x396a2c){return _0x396a2c['update'](_0x38694d)['then'](function(_0x2b49cf){return _0x2b49cf;});}return null;};}function removeEntity(_0x45cafa,_0x2913db){return function(_0x400d29){if(_0x400d29){return _0x400d29[_0xd65b('0x1a')]()['then'](function(){var _0x58e0ec=_0x400d29[_0xd65b('0x1b')]({'plain':!![]});var _0x39e241='MusicOnHolds';return db[_0xd65b('0x1c')][_0xd65b('0x1a')]({'where':{'type':_0x39e241,'resourceId':_0x58e0ec['id']}})[_0xd65b('0x1d')](function(){return _0x400d29;});})[_0xd65b('0x1d')](function(){_0x45cafa[_0xd65b('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7e2a,_0x5cde8a){return function(_0x92f1b7){if(!_0x92f1b7){_0x3e7e2a[_0xd65b('0x12')](0x194);}return _0x92f1b7;};}function handleError(_0x32b86d,_0x5e2fe4){_0x5e2fe4=_0x5e2fe4||0x1f4;return function(_0x42c9b2){logger[_0xd65b('0x1e')](_0x42c9b2[_0xd65b('0x1f')]);if(_0x42c9b2[_0xd65b('0x20')]){delete _0x42c9b2[_0xd65b('0x20')];}_0x32b86d[_0xd65b('0x13')](_0x5e2fe4)[_0xd65b('0x21')](_0x42c9b2);};}exports['index']=function(_0x44a746,_0x110191){var _0x99ef23={},_0x1d234a={},_0x1e8b15={'count':0x0,'rows':[]};var _0x276a81=db['VoiceMusicOnHold'][_0xd65b('0x22')];_0x1d234a[_0xd65b('0x23')]=_[_0xd65b('0x24')](_0x276a81);_0x1d234a['query']=_[_0xd65b('0x24')](_0x44a746[_0xd65b('0x25')]);_0x1d234a['filters']=_[_0xd65b('0x26')](_0x1d234a[_0xd65b('0x23')],_0x1d234a[_0xd65b('0x25')]);_0x99ef23[_0xd65b('0x27')]=_[_0xd65b('0x26')](_0x1d234a[_0xd65b('0x23')],qs[_0xd65b('0x28')](_0x44a746[_0xd65b('0x25')][_0xd65b('0x28')]));_0x99ef23[_0xd65b('0x27')]=_0x99ef23[_0xd65b('0x27')][_0xd65b('0x29')]?_0x99ef23[_0xd65b('0x27')]:_0x1d234a[_0xd65b('0x23')];if(!_0x44a746[_0xd65b('0x25')][_0xd65b('0x2a')](_0xd65b('0x2b'))){_0x99ef23[_0xd65b('0x17')]=qs[_0xd65b('0x17')](_0x44a746[_0xd65b('0x25')][_0xd65b('0x17')]);_0x99ef23['offset']=qs['offset'](_0x44a746[_0xd65b('0x25')][_0xd65b('0x16')]);}_0x99ef23[_0xd65b('0x2c')]=qs[_0xd65b('0x2d')](_0x44a746[_0xd65b('0x25')][_0xd65b('0x2d')]);_0x99ef23[_0xd65b('0x2e')]=qs[_0xd65b('0x2f')](_['pick'](_0x44a746[_0xd65b('0x25')],_0x1d234a['filters']));if(_0x44a746[_0xd65b('0x25')][_0xd65b('0x30')]){_0x99ef23[_0xd65b('0x2e')]=_['merge'](_0x99ef23[_0xd65b('0x2e')],{'$or':_[_0xd65b('0x31')](_0x276a81,function(_0x226072){if(_0x226072['type'][_0xd65b('0x32')]!==_0xd65b('0x33')){var _0x4fcde1={};_0x4fcde1[_0x226072[_0xd65b('0x34')]]={'$like':'%'+_0x44a746[_0xd65b('0x25')][_0xd65b('0x30')]+'%'};return _0x4fcde1;}})});}_0x99ef23=_['merge']({},_0x99ef23,_0x44a746[_0xd65b('0x35')]);var _0x30b11c={'where':_0x99ef23[_0xd65b('0x2e')]};return db[_0xd65b('0x36')]['count'](_0x30b11c)[_0xd65b('0x1d')](function(_0x85a8e8){_0x1e8b15[_0xd65b('0x15')]=_0x85a8e8;if(_0x44a746[_0xd65b('0x25')][_0xd65b('0x37')]){_0x99ef23[_0xd65b('0x38')]=[{'all':!![]}];}return db[_0xd65b('0x36')][_0xd65b('0x39')](_0x99ef23);})[_0xd65b('0x1d')](function(_0x3894bc){_0x1e8b15['rows']=_0x3894bc;return _0x1e8b15;})[_0xd65b('0x1d')](respondWithFilteredResult(_0x110191,_0x99ef23))[_0xd65b('0x3a')](handleError(_0x110191,null));};exports[_0xd65b('0x3b')]=function(_0x2c798a,_0x390ce4){var _0x4f4a6e={'raw':![],'where':{'id':_0x2c798a[_0xd65b('0x3c')]['id']}},_0x4e2053={};_0x4e2053[_0xd65b('0x23')]=_['keys'](db[_0xd65b('0x36')][_0xd65b('0x22')]);_0x4e2053['query']=_[_0xd65b('0x24')](_0x2c798a['query']);_0x4e2053['filters']=_[_0xd65b('0x26')](_0x4e2053[_0xd65b('0x23')],_0x4e2053['query']);_0x4f4a6e['attributes']=_[_0xd65b('0x26')](_0x4e2053[_0xd65b('0x23')],qs[_0xd65b('0x28')](_0x2c798a['query'][_0xd65b('0x28')]));_0x4f4a6e[_0xd65b('0x27')]=_0x4f4a6e['attributes'][_0xd65b('0x29')]?_0x4f4a6e[_0xd65b('0x27')]:_0x4e2053['model'];if(_0x2c798a[_0xd65b('0x25')]['includeAll']){_0x4f4a6e[_0xd65b('0x38')]=[{'all':!![]}];}_0x4f4a6e=_[_0xd65b('0x3d')]({},_0x4f4a6e,_0x2c798a[_0xd65b('0x35')]);return db[_0xd65b('0x36')][_0xd65b('0x3e')](_0x4f4a6e)[_0xd65b('0x1d')](handleEntityNotFound(_0x390ce4,null))[_0xd65b('0x1d')](respondWithResult(_0x390ce4,null))[_0xd65b('0x3a')](handleError(_0x390ce4,null));};exports['update']=function(_0x4e2224,_0x53ee7a){if(_0x4e2224[_0xd65b('0x3f')]['id']){delete _0x4e2224[_0xd65b('0x3f')]['id'];}return db[_0xd65b('0x36')][_0xd65b('0x3e')]({'where':{'id':_0x4e2224[_0xd65b('0x3c')]['id']}})[_0xd65b('0x1d')](handleEntityNotFound(_0x53ee7a,null))[_0xd65b('0x1d')](saveUpdates(_0x4e2224[_0xd65b('0x3f')],null))[_0xd65b('0x1d')](respondWithResult(_0x53ee7a,null))[_0xd65b('0x3a')](handleError(_0x53ee7a,null));};exports[_0xd65b('0x40')]=function(_0xc5a426,_0x5abf9d,_0x4628d0){return db[_0xd65b('0x41')][_0xd65b('0x42')](function(_0x2df44c){if(_0xc5a426[_0xd65b('0x3f')][_0xd65b('0x43')]===_0xd65b('0x44')){_0xc5a426[_0xd65b('0x3f')]['directory']=path['join'](config[_0xd65b('0x45')],'server/files/moh',_0xc5a426[_0xd65b('0x3f')][_0xd65b('0x20')]);}return db['VoiceMusicOnHold'][_0xd65b('0x40')](_0xc5a426[_0xd65b('0x3f')],{'transaction':_0x2df44c})[_0xd65b('0x1d')](function(_0x11c191){if(_0xc5a426[_0xd65b('0x3f')]['mode']===_0xd65b('0x44')){fs[_0xd65b('0x46')](_0x11c191[_0xd65b('0x47')],parseInt(_0xd65b('0x48'),0x8));}var _0x31727a=_0xc5a426['user']['get']({'plain':!![]});if(!_0x31727a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31727a[_0xd65b('0x49')]==='user'){var _0x2a3bca=_0x11c191[_0xd65b('0x1b')]({'plain':!![]});return db['UserProfileSection'][_0xd65b('0x3e')]({'where':{'name':'MusicOnHolds','userProfileId':_0x31727a[_0xd65b('0x4a')]},'raw':!![]})[_0xd65b('0x1d')](function(_0x21e8e1){if(_0x21e8e1&&_0x21e8e1[_0xd65b('0x4b')]===0x0){return db[_0xd65b('0x1c')][_0xd65b('0x40')]({'name':_0x2a3bca[_0xd65b('0x20')],'resourceId':_0x2a3bca['id'],'type':_0x21e8e1[_0xd65b('0x20')],'sectionId':_0x21e8e1['id']},{})[_0xd65b('0x1d')](function(){return _0x11c191;});}else{return _0x11c191;}})[_0xd65b('0x3a')](function(_0x5e3ebc){logger[_0xd65b('0x1e')](_0xd65b('0x4c'),_0x5e3ebc);});}return _0x11c191;});})[_0xd65b('0x1d')](respondWithResult(_0x5abf9d,0xc9))[_0xd65b('0x3a')](handleError(_0x5abf9d,null));};exports[_0xd65b('0x1a')]=function(_0x52af0f,_0x50371e,_0x508799){var _0x2cc183;return db[_0xd65b('0x36')]['find']({'where':{'id':_0x52af0f[_0xd65b('0x3c')]['id']}})[_0xd65b('0x1d')](function(_0x2b4d90){if(_0x2b4d90){return db[_0xd65b('0x41')][_0xd65b('0x42')](function(_0x2ede97){return _0x2b4d90[_0xd65b('0x1a')]({'transaction':_0x2ede97,'raw':!![]})[_0xd65b('0x1d')](function(_0x550086){if(_0x550086['directory']){fs['readdirSync'](_0x550086[_0xd65b('0x47')])[_0xd65b('0x4d')](function(_0xaaedff){fs['unlinkSync'](path['join'](_0x550086[_0xd65b('0x47')],_0xaaedff));});fs[_0xd65b('0x4e')](_0x550086['directory']);}return _0x550086;});})[_0xd65b('0x3a')](function(_0x387f2d){throw new db[(_0xd65b('0x4f'))][(_0xd65b('0x50'))](_0x387f2d['message']);});}})[_0xd65b('0x1d')](handleEntityNotFound(_0x50371e,null))['then'](removeEntity(_0x50371e,null))['catch'](handleError(_0x50371e,null));};exports[_0xd65b('0x51')]=function(_0x379735,_0x8d9901,_0x6b1496){return db['sequelize'][_0xd65b('0x42')](function(_0x271911){var _0x48443b;return db[_0xd65b('0x36')][_0xd65b('0x3e')]({'where':{'id':_0x379735[_0xd65b('0x3c')]['id']}})[_0xd65b('0x1d')](function(_0x1918e4){if(_0x1918e4){_0x48443b=_0x1918e4;return _0x1918e4['addSound'](_0x379735[_0xd65b('0x3f')]['id'],{'transaction':_0x271911});}})[_0xd65b('0x1d')](function(_0x30f321){if(_0x30f321){return db[_0xd65b('0x52')][_0xd65b('0x53')]({'where':{'id':_0x379735[_0xd65b('0x3f')]['id']},'attributes':['id',_0xd65b('0x20'),_0xd65b('0x54'),_0xd65b('0x55'),_0xd65b('0x56')],'raw':!![]});}})[_0xd65b('0x1d')](function(_0x3dd6ae){if(_0x3dd6ae){var _0xfca994=path[_0xd65b('0x57')](config[_0xd65b('0x45')],_0xd65b('0x58'),util[_0xd65b('0x59')](_0xd65b('0x5a'),path['basename'](_0x3dd6ae['save_name'],path[_0xd65b('0x5b')](_0x3dd6ae[_0xd65b('0x54')])),_0x3dd6ae[_0xd65b('0x55')]));var _0x32136e=path[_0xd65b('0x57')](config[_0xd65b('0x45')],_0xd65b('0x5c'),_0x48443b[_0xd65b('0x20')],util[_0xd65b('0x59')]('%s.%s',_0x3dd6ae['name'],_0x3dd6ae[_0xd65b('0x55')]));fs[_0xd65b('0x5d')](_0xfca994,_0x32136e);return _0x3dd6ae;}})[_0xd65b('0x3a')](function(_0x224bbe){throw new db[(_0xd65b('0x4f'))][(_0xd65b('0x50'))](_0x224bbe['message']);});})[_0xd65b('0x1d')](handleEntityNotFound(_0x8d9901,null))['then'](respondWithResult(_0x8d9901,0xc9))['catch'](handleError(_0x8d9901,null));};exports['removeSound']=function(_0x109d4b,_0x52ce0b,_0x1e08a2){return db['sequelize'][_0xd65b('0x42')](function(_0x303dbd){var _0x4a581e;return db['VoiceMusicOnHold'][_0xd65b('0x53')]({'where':{'id':_0x109d4b[_0xd65b('0x3c')]['id']}})[_0xd65b('0x1d')](handleEntityNotFound(_0x52ce0b,null))['then'](function(_0x15a2f2){if(_0x15a2f2){_0x4a581e=_0x15a2f2;return _0x15a2f2[_0xd65b('0x5e')](_0x109d4b['params'][_0xd65b('0x5f')]);}})[_0xd65b('0x1d')](function(_0x54a8af){if(_0x54a8af){return db['Sound']['findOne']({'where':{'id':_0x109d4b[_0xd65b('0x3c')]['id2']},'attributes':['id',_0xd65b('0x20'),_0xd65b('0x54'),'converted_format',_0xd65b('0x56')],'raw':!![]});}})[_0xd65b('0x1d')](function(_0x236c3c){if(_0x236c3c){fs[_0xd65b('0x60')](path['join'](_0x4a581e[_0xd65b('0x47')],util[_0xd65b('0x59')]('%s.%s',_0x236c3c[_0xd65b('0x20')],_0x236c3c['converted_format'])));return _0x236c3c;}})[_0xd65b('0x3a')](function(_0x11cd93){throw new db[(_0xd65b('0x4f'))][(_0xd65b('0x50'))](_0x11cd93['message']);});})[_0xd65b('0x1d')](handleEntityNotFound(_0x52ce0b,null))[_0xd65b('0x1d')](respondWithStatusCode(_0x52ce0b,0xcc))['catch'](handleError(_0x52ce0b,null));};exports[_0xd65b('0x61')]=function(_0x220ca2,_0x144af1,_0x8d4241){var _0x5b7b95={};var _0x311885={};var _0x2a8789;var _0x376852;return db[_0xd65b('0x36')][_0xd65b('0x53')]({'where':{'id':_0x220ca2[_0xd65b('0x3c')]['id']}})[_0xd65b('0x1d')](handleEntityNotFound(_0x144af1,null))[_0xd65b('0x1d')](function(_0x9ebb68){if(_0x9ebb68){_0x2a8789=_0x9ebb68;_0x311885[_0xd65b('0x23')]=_[_0xd65b('0x24')](db['Sound'][_0xd65b('0x22')]);_0x311885[_0xd65b('0x25')]=_[_0xd65b('0x24')](_0x220ca2[_0xd65b('0x25')]);_0x311885['filters']=_[_0xd65b('0x26')](_0x311885[_0xd65b('0x23')],_0x311885[_0xd65b('0x25')]);_0x5b7b95[_0xd65b('0x27')]=_['intersection'](_0x311885[_0xd65b('0x23')],qs[_0xd65b('0x28')](_0x220ca2[_0xd65b('0x25')][_0xd65b('0x28')]));_0x5b7b95[_0xd65b('0x27')]=_0x5b7b95['attributes'][_0xd65b('0x29')]?_0x5b7b95[_0xd65b('0x27')]:_0x311885[_0xd65b('0x23')];_0x5b7b95[_0xd65b('0x2c')]=qs[_0xd65b('0x2d')](_0x220ca2[_0xd65b('0x25')][_0xd65b('0x2d')]);_0x5b7b95[_0xd65b('0x2e')]=qs[_0xd65b('0x2f')](_[_0xd65b('0x62')](_0x220ca2['query'],_0x311885['filters']));if(_0x220ca2['query'][_0xd65b('0x30')]){_0x5b7b95[_0xd65b('0x2e')]=_['merge'](_0x5b7b95[_0xd65b('0x2e')],{'$or':_[_0xd65b('0x31')](_0x5b7b95['attributes'],function(_0x1efdf2){var _0x3319d4={};_0x3319d4[_0x1efdf2]={'$like':'%'+_0x220ca2[_0xd65b('0x25')]['filter']+'%'};return _0x3319d4;})});}_0x5b7b95=_[_0xd65b('0x3d')]({},_0x5b7b95,_0x220ca2['options']);return _0x2a8789['getSounds'](_0x5b7b95);}})[_0xd65b('0x1d')](function(_0x65cdaa){if(_0x65cdaa){_0x376852=_0x65cdaa[_0xd65b('0x29')];if(!_0x220ca2['query'][_0xd65b('0x2a')](_0xd65b('0x2b'))){_0x5b7b95[_0xd65b('0x17')]=qs[_0xd65b('0x17')](_0x220ca2[_0xd65b('0x25')][_0xd65b('0x17')]);_0x5b7b95[_0xd65b('0x16')]=qs[_0xd65b('0x16')](_0x220ca2['query']['offset']);}return _0x2a8789[_0xd65b('0x61')](_0x5b7b95);}})[_0xd65b('0x1d')](function(_0x1efa5e){if(_0x1efa5e){return _0x1efa5e?{'count':_0x376852,'rows':_0x1efa5e}:null;}})[_0xd65b('0x1d')](respondWithResult(_0x144af1,null))[_0xd65b('0x3a')](handleError(_0x144af1,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 0a9da00..e6732d6 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 _0x3680=['bluebird','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment'];(function(_0x11b19b,_0x213234){var _0x1daac1=function(_0x516d3b){while(--_0x516d3b){_0x11b19b['push'](_0x11b19b['shift']());}};_0x1daac1(++_0x213234);}(_0x3680,0xcd));var _0x0368=function(_0x406960,_0x5104b5){_0x406960=_0x406960-0x0;var _0x461635=_0x3680[_0x406960];return _0x461635;};'use strict';var _=require(_0x0368('0x0'));var util=require(_0x0368('0x1'));var logger=require(_0x0368('0x2'))(_0x0368('0x3'));var moment=require(_0x0368('0x4'));var BPromise=require(_0x0368('0x5'));var rp=require('request-promise');var attributes=require(_0x0368('0x6'));module[_0x0368('0x7')]=function(_0x6ce660,_0x2b4363){return _0x6ce660['define'](_0x0368('0x8'),attributes,{'tableName':_0x0368('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf725=['request-promise','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x37c1c3,_0x1280f3){var _0x4edd49=function(_0x1c6a8f){while(--_0x1c6a8f){_0x37c1c3['push'](_0x37c1c3['shift']());}};_0x4edd49(++_0x1280f3);}(_0xf725,0x7e));var _0x5f72=function(_0x25de7b,_0x2d79b9){_0x25de7b=_0x25de7b-0x0;var _0x3be7f7=_0xf725[_0x25de7b];return _0x3be7f7;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var logger=require(_0x5f72('0x2'))(_0x5f72('0x3'));var moment=require(_0x5f72('0x4'));var BPromise=require(_0x5f72('0x5'));var rp=require(_0x5f72('0x6'));var attributes=require(_0x5f72('0x7'));module[_0x5f72('0x8')]=function(_0x17a5bc,_0x557be3){return _0x17a5bc[_0x5f72('0x9')](_0x5f72('0xa'),attributes,{'tableName':_0x5f72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 4df145e..1cf8346 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 _0xa204=['request\x20sent','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','error','code','message'];(function(_0x2d1a2b,_0x21c069){var _0x47f9d4=function(_0x494610){while(--_0x494610){_0x2d1a2b['push'](_0x2d1a2b['shift']());}};_0x47f9d4(++_0x21c069);}(_0xa204,0xb7));var _0x4a20=function(_0xca1091,_0x539dbf){_0xca1091=_0xca1091-0x0;var _0xd3019c=_0xa204[_0xca1091];return _0xd3019c;};'use strict';var _=require('lodash');var util=require(_0x4a20('0x0'));var moment=require(_0x4a20('0x1'));var BPromise=require(_0x4a20('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a20('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a20('0x4'));var logger=require(_0x4a20('0x5'))(_0x4a20('0x6'));var config=require(_0x4a20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a20('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x968beb,_0x1a9037,_0x4670a3){return new BPromise(function(_0xc08feb,_0x495162){return client[_0x4a20('0x9')](_0x968beb,_0x4670a3)[_0x4a20('0xa')](function(_0x4160cc){logger[_0x4a20('0xb')](_0x4a20('0xc'),_0x1a9037,'request\x20sent');logger[_0x4a20('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x1a9037,'request\x20sent',JSON['stringify'](_0x4160cc));if(_0x4160cc[_0x4a20('0xe')]){if(_0x4160cc[_0x4a20('0xe')][_0x4a20('0xf')]===0x1f4){logger[_0x4a20('0xe')](_0x4a20('0xc'),_0x1a9037,_0x4160cc[_0x4a20('0xe')][_0x4a20('0x10')]);return _0x495162(_0x4160cc[_0x4a20('0xe')]['message']);}logger[_0x4a20('0xe')](_0x4a20('0xc'),_0x1a9037,_0x4160cc[_0x4a20('0xe')][_0x4a20('0x10')]);return _0xc08feb(_0x4160cc[_0x4a20('0xe')][_0x4a20('0x10')]);}else{logger[_0x4a20('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x1a9037,_0x4a20('0x11'));_0xc08feb(_0x4160cc[_0x4a20('0x12')][_0x4a20('0x10')]);}})[_0x4a20('0x13')](function(_0x3e6c53){logger[_0x4a20('0xe')](_0x4a20('0xc'),_0x1a9037,_0x3e6c53);_0x495162(_0x3e6c53);});});} \ No newline at end of file +var _0xcf33=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xcf33,0x10d));var _0x3cf3=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xcf33[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x3cf3('0x0'));var util=require(_0x3cf3('0x1'));var moment=require(_0x3cf3('0x2'));var BPromise=require(_0x3cf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cf3('0x5'));var logger=require(_0x3cf3('0x6'))(_0x3cf3('0x7'));var config=require('../../config/environment');var jayson=require(_0x3cf3('0x8'));var client=jayson[_0x3cf3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x119edb,_0x19edd9,_0x508ebc){return new BPromise(function(_0x404308,_0x5b292f){return client[_0x3cf3('0xa')](_0x119edb,_0x508ebc)[_0x3cf3('0xb')](function(_0x351136){logger[_0x3cf3('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x19edd9,_0x3cf3('0xd'));logger['debug'](_0x3cf3('0xe'),_0x19edd9,'request\x20sent',JSON[_0x3cf3('0xf')](_0x351136));if(_0x351136[_0x3cf3('0x10')]){if(_0x351136[_0x3cf3('0x10')][_0x3cf3('0x11')]===0x1f4){logger['error'](_0x3cf3('0x12'),_0x19edd9,_0x351136['error'][_0x3cf3('0x13')]);return _0x5b292f(_0x351136['error'][_0x3cf3('0x13')]);}logger[_0x3cf3('0x10')](_0x3cf3('0x12'),_0x19edd9,_0x351136['error'][_0x3cf3('0x13')]);return _0x404308(_0x351136[_0x3cf3('0x10')][_0x3cf3('0x13')]);}else{logger[_0x3cf3('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x19edd9,_0x3cf3('0xd'));_0x404308(_0x351136[_0x3cf3('0x14')][_0x3cf3('0x13')]);}})['catch'](function(_0x3d8b12){logger[_0x3cf3('0x10')](_0x3cf3('0x12'),_0x19edd9,_0x3d8b12);_0x5b292f(_0x3d8b12);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 3a42992..5dd56c4 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 _0x3d5d=['multer','util','express','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','post','create','update','delete','destroy','removeAgents'];(function(_0x14785d,_0x16fa0c){var _0x1b6e9a=function(_0x1e6c87){while(--_0x1e6c87){_0x14785d['push'](_0x14785d['shift']());}};_0x1b6e9a(++_0x16fa0c);}(_0x3d5d,0x104));var _0xd3d5=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x3d5d[_0x49aa7d];return _0xdd0d26;};'use strict';var multer=require(_0xd3d5('0x0'));var util=require(_0xd3d5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd3d5('0x2'));var router=express[_0xd3d5('0x3')]();var auth=require(_0xd3d5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd3d5('0x5'));var controller=require(_0xd3d5('0x6'));router[_0xd3d5('0x7')]('/',auth[_0xd3d5('0x8')](),controller['index']);router[_0xd3d5('0x7')]('/describe',auth[_0xd3d5('0x8')](),controller[_0xd3d5('0x9')]);router[_0xd3d5('0x7')](_0xd3d5('0xa'),auth['isAuthenticated'](),controller[_0xd3d5('0xb')]);router[_0xd3d5('0x7')](_0xd3d5('0xc'),auth['isAuthenticated'](),controller[_0xd3d5('0xd')]);router[_0xd3d5('0xe')]('/',auth['isAuthenticated'](),controller[_0xd3d5('0xf')]);router[_0xd3d5('0xe')](_0xd3d5('0xc'),auth[_0xd3d5('0x8')](),controller['addAgents']);router['put'](_0xd3d5('0xa'),auth[_0xd3d5('0x8')](),controller[_0xd3d5('0x10')]);router[_0xd3d5('0x11')](_0xd3d5('0xa'),auth['isAuthenticated'](),controller[_0xd3d5('0x12')]);router[_0xd3d5('0x11')](_0xd3d5('0xc'),auth['isAuthenticated'](),controller[_0xd3d5('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa25c=['/:id','/:id/users','getAgents','post','addAgents','put','update','destroy','delete','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe'];(function(_0x1c0afb,_0x4067ce){var _0x5ea9e0=function(_0x3d41f8){while(--_0x3d41f8){_0x1c0afb['push'](_0x1c0afb['shift']());}};_0x5ea9e0(++_0x4067ce);}(_0xa25c,0x13f));var _0xca25=function(_0x2d42f4,_0x23bcb8){_0x2d42f4=_0x2d42f4-0x0;var _0x11485a=_0xa25c[_0x2d42f4];return _0x11485a;};'use strict';var multer=require('multer');var util=require(_0xca25('0x0'));var path=require(_0xca25('0x1'));var timeout=require(_0xca25('0x2'));var express=require(_0xca25('0x3'));var router=express[_0xca25('0x4')]();var auth=require(_0xca25('0x5'));var interaction=require(_0xca25('0x6'));var config=require(_0xca25('0x7'));var controller=require('./voicePrefix.controller');router[_0xca25('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xca25('0x8')]('/describe',auth[_0xca25('0x9')](),controller[_0xca25('0xa')]);router[_0xca25('0x8')](_0xca25('0xb'),auth[_0xca25('0x9')](),controller['show']);router['get'](_0xca25('0xc'),auth['isAuthenticated'](),controller[_0xca25('0xd')]);router[_0xca25('0xe')]('/',auth[_0xca25('0x9')](),controller['create']);router['post']('/:id/users',auth[_0xca25('0x9')](),controller[_0xca25('0xf')]);router[_0xca25('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xca25('0x11')]);router['delete'](_0xca25('0xb'),auth[_0xca25('0x9')](),controller[_0xca25('0x12')]);router[_0xca25('0x13')](_0xca25('0xc'),auth[_0xca25('0x9')](),controller[_0xca25('0x14')]);module[_0xca25('0x15')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 21b306c..608920e 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 _0x8436=['name','VIRTUAL','system-','getDataValue','INTEGER','exports','STRING'];(function(_0x5d93c7,_0x580b09){var _0x54a38b=function(_0x38c4c2){while(--_0x38c4c2){_0x5d93c7['push'](_0x5d93c7['shift']());}};_0x54a38b(++_0x580b09);}(_0x8436,0x1c5));var _0x6843=function(_0x1d6323,_0x52509f){_0x1d6323=_0x1d6323-0x0;var _0x43606b=_0x8436[_0x1d6323];return _0x43606b;};'use strict';var Sequelize=require('sequelize');module[_0x6843('0x0')]={'name':{'type':Sequelize[_0x6843('0x1')],'allowNull':![],'unique':_0x6843('0x2')},'prefix':{'type':Sequelize[_0x6843('0x3')],'get':function(_0x3d4e29){return _0x6843('0x4')+this[_0x6843('0x5')](_0x6843('0x2'))+'-';}},'description':{'type':Sequelize[_0x6843('0x1')]},'callerIdAll':{'type':Sequelize[_0x6843('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x6843('0x6')]}}; \ No newline at end of file +var _0xa9b1=['name','system-','INTEGER','sequelize','exports','STRING'];(function(_0x50a3ad,_0x4c5036){var _0x42286c=function(_0x5c66ee){while(--_0x5c66ee){_0x50a3ad['push'](_0x50a3ad['shift']());}};_0x42286c(++_0x4c5036);}(_0xa9b1,0x1b9));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1a9b('0x0'));module[_0x1a9b('0x1')]={'name':{'type':Sequelize[_0x1a9b('0x2')],'allowNull':![],'unique':_0x1a9b('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3c5a2c){return _0x1a9b('0x4')+this['getDataValue'](_0x1a9b('0x3'))+'-';}},'description':{'type':Sequelize[_0x1a9b('0x2')]},'callerIdAll':{'type':Sequelize[_0x1a9b('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x1a9b('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index afad36c..e247311 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 _0xa9e0=['includeAll','include','rows','catch','show','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','VoicePrefix','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options'];(function(_0x48ad1a,_0x432e4d){var _0xddc75a=function(_0x2ef529){while(--_0x2ef529){_0x48ad1a['push'](_0x48ad1a['shift']());}};_0xddc75a(++_0x432e4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voicePrefix.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='VoicePrefixes';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['VoicePrefix'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x24')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x562fb4[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x23')](removeEntity(_0x14bec2,null))[_0x0a9e('0x42')](handleError(_0x14bec2,null));};exports['describe']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')]()[_0x0a9e('0x23')](respondWithResult(_0x1bde3c,null))[_0x0a9e('0x42')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x47')]=function(_0x19383e,_0x34febd){var _0x58a5c2;return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x4f7240){return db['VoicePrefix']['create'](_0x19383e[_0x0a9e('0x4a')],{'transaction':_0x4f7240})[_0x0a9e('0x23')](function(_0x37edaa){_0x58a5c2=_0x37edaa[_0x0a9e('0x25')]({'plain':!![]});return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x58a5c2[_0x0a9e('0x4c')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x5d38ae){return createVoicePrefixExtensions(_0x58a5c2,_0x5d38ae,_0x4f7240);});});})['then'](function(){var _0x53975a=_0x19383e[_0x0a9e('0x4d')][_0x0a9e('0x25')]({'plain':!![]});if(!_0x53975a)throw new Error(_0x0a9e('0x4e'));if(_0x53975a['role']===_0x0a9e('0x4d')){var _0x161aa7=_0x58a5c2;return db['UserProfileSection']['find']({'where':{'name':_0x0a9e('0x4f'),'userProfileId':_0x53975a['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x4c3845){if(_0x4c3845&&_0x4c3845[_0x0a9e('0x50')]===0x0){return db[_0x0a9e('0x51')][_0x0a9e('0x47')]({'name':_0x161aa7['name'],'resourceId':_0x161aa7['id'],'type':_0x4c3845[_0x0a9e('0x28')],'sectionId':_0x4c3845['id']},{})[_0x0a9e('0x23')](function(){return _0x58a5c2;});}else{return _0x58a5c2;}})['catch'](function(_0x50f687){logger[_0x0a9e('0x26')](_0x0a9e('0x52'),_0x50f687);throw _0x50f687;});}return _0x58a5c2;})['then'](respondWithResult(_0x34febd,null))[_0x0a9e('0x42')](handleError(_0x34febd,null));};function Extension(_0x5ce9ac,_0x211ef9,_0x523cd2,_0xe22ccc){this['context']='from-sip';this['exten']=_0x5ce9ac;this[_0x0a9e('0x53')]=_0x523cd2;this['type']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x0a9e('0x56');this[_0x0a9e('0x57')]=_0x211ef9;this[_0x0a9e('0x58')]=_0xe22ccc;}function createVoicePrefixExtensions(_0x272738,_0xd10662,_0x28d814){return new BPromise(function(_0x4e67ab,_0x1c693e){var _0x121cef=new Extension(formatPrefixName(_0x272738[_0x0a9e('0x59')]),0x1,_0x0a9e('0x5a'),_0x0a9e('0x5b'));_0x121cef[_0x0a9e('0x5c')]=_0x272738['id'];return db['VoiceExtension'][_0x0a9e('0x47')](_0x121cef,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x5239ef){var _0x3649cc=_0x5239ef['get']({'plain':!![]});var _0x20c668=_['map'](addVoicePrefixExtensions(_0x272738,_0xd10662),function(_0x4b3c1a){_0x4b3c1a['VoiceExtensionId']=_0x3649cc['id'];_0x4b3c1a[_0x0a9e('0x5c')]=_0x272738['id'];return _0x4b3c1a;});return db['VoiceExtension'][_0x0a9e('0x5d')](_0x20c668,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x261adb){if(!_0x261adb){return _0x1c693e(_0x0a9e('0x5e'));}else{return _0x4e67ab(_0x261adb);}})[_0x0a9e('0x42')](function(_0x26d7db){return _0x1c693e(_0x26d7db);});});;});};function addVoicePrefixExtensions(_0x49eed0,_0x1627a7){var _0x5854cc=[];var _0xca4ade=formatPrefixName(_0x49eed0[_0x0a9e('0x59')]);_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x2,'Set',_0x0a9e('0x60')+_0x49eed0[_0x0a9e('0x28')]));if(_0x49eed0[_0x0a9e('0x61')]){_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x3,'Set',_0x0a9e('0x62')+_0x49eed0[_0x0a9e('0x61')]));}else{_0x5854cc['push'](new Extension(_0xca4ade,0x3,_0x0a9e('0x5a'),_0x0a9e('0x63')));}_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x4,_0x0a9e('0x64'),_0x1627a7[_0x0a9e('0x65')]+','+'${EXTEN:'+(0x8+_0x49eed0[_0x0a9e('0x28')][_0x0a9e('0x32')])+'}'+','+0x1));return _0x5854cc;}function formatPrefixName(_0x281c7d){var _0x47bb43='_';for(var _0x3528b7=0x0;_0x3528b7<_0x281c7d['length'];_0x3528b7++){if(_0x281c7d['charAt'](_0x3528b7)=='-'){_0x47bb43+=_0x281c7d[_0x0a9e('0x66')](_0x3528b7);}else{_0x47bb43+='['+_0x281c7d[_0x0a9e('0x66')](_0x3528b7)+']';}}_0x47bb43+='.';return _0x47bb43;}exports[_0x0a9e('0x22')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489=_0x19c995[_0x0a9e('0x4a')];_0x387489[_0x0a9e('0x59')]=_0x0a9e('0x67')+_0x387489[_0x0a9e('0x28')]+'-';return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x2b8192){return db[_0x0a9e('0x2a')][_0x0a9e('0x22')](_0x387489,{'where':{'id':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')]['destroy']({'where':{'VoicePrefixId':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x387489['VoiceExtensionId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x30944e){return createVoicePrefixExtensions(_0x387489,_0x30944e,_0x2b8192);});});});})['then'](function(){return db[_0x0a9e('0x2a')][_0x0a9e('0x68')](_0x387489['id']);})[_0x0a9e('0x23')](respondWithResult(_0x186f39,null))[_0x0a9e('0x42')](handleError(_0x186f39,null));};exports[_0x0a9e('0x69')]=function(_0x4a43a8,_0x50cdce,_0x4a2438){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4a43a8[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x50cdce,null))[_0x0a9e('0x23')](function(_0x380ab3){if(_0x380ab3){return _0x380ab3[_0x0a9e('0x69')](_0x4a43a8[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x6a')](_0x4a43a8[_0x0a9e('0x4a')],[_0x0a9e('0x6b'),'id'])||{})['spread'](function(_0x2bdc44){for(var _0x583b2e=0x0;_0x583b2e<_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')]['length'];_0x583b2e+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x6d'),{'UserId':_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')][_0x583b2e],'VoicePrefixId':_0x4a43a8['params']['id']});}return _0x2bdc44;});}})[_0x0a9e('0x23')](respondWithResult(_0x50cdce,null))[_0x0a9e('0x42')](handleError(_0x50cdce,null));};exports[_0x0a9e('0x6e')]=function(_0x278ab4,_0x5b7fc3,_0x109ccb){var _0x3d91db;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x278ab4['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5b7fc3,null))[_0x0a9e('0x23')](function(_0x30a4c7){if(_0x30a4c7){return _0x30a4c7[_0x0a9e('0x6e')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])[_0x0a9e('0x23')](function(_0x3df0e3){if(_[_0x0a9e('0x6f')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])){for(var _0x1f10ef=0x0;_0x1f10ef<_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')]['length'];_0x1f10ef+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'][_0x1f10ef],'VoicePrefixId':_0x278ab4[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'],'VoicePrefixId':_0x278ab4['params']['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x5b7fc3,null))[_0x0a9e('0x42')](handleError(_0x5b7fc3,null));};exports['getAgents']=function(_0x45108c,_0x53a6a1,_0x260f4b){var _0x8ebf02={};var _0x5637a1={};var _0x28a942;var _0x41cf12;return db[_0x0a9e('0x2a')][_0x0a9e('0x71')]({'where':{'id':_0x45108c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x53a6a1,null))[_0x0a9e('0x23')](function(_0x482ca2){if(_0x482ca2){_0x28a942=_0x482ca2;_0x5637a1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x72')][_0x0a9e('0x2b')]);_0x5637a1['query']=_[_0x0a9e('0x2d')](_0x45108c[_0x0a9e('0x2e')]);_0x5637a1['filters']=_[_0x0a9e('0x2f')](_0x5637a1['model'],_0x5637a1[_0x0a9e('0x2e')]);_0x8ebf02[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5637a1[_0x0a9e('0x2c')],qs['fields'](_0x45108c['query'][_0x0a9e('0x31')]));_0x8ebf02[_0x0a9e('0x30')]=_0x8ebf02[_0x0a9e('0x30')]['length']?_0x8ebf02[_0x0a9e('0x30')]:_0x5637a1[_0x0a9e('0x2c')];_0x8ebf02['order']=qs['sort'](_0x45108c[_0x0a9e('0x2e')]['sort']);_0x8ebf02['where']=qs['filters'](_[_0x0a9e('0x73')](_0x45108c[_0x0a9e('0x2e')],_0x5637a1[_0x0a9e('0x36')]));if(_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x8ebf02[_0x0a9e('0x39')]=_['merge'](_0x8ebf02[_0x0a9e('0x39')],{'$or':_['map'](_0x8ebf02[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x45108c[_0x0a9e('0x2e')]['filter']+'%'};return _0x18ad56;})});}_0x8ebf02=_[_0x0a9e('0x38')]({},_0x8ebf02,_0x45108c[_0x0a9e('0x3e')]);return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})['then'](function(_0xb6e411){if(_0xb6e411){_0x41cf12=_0xb6e411[_0x0a9e('0x32')];if(!_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x33')](_0x0a9e('0x75'))){_0x8ebf02[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x45108c[_0x0a9e('0x2e')]['limit']);_0x8ebf02[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x45108c['query'][_0x0a9e('0x1c')]);}return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})[_0x0a9e('0x23')](function(_0x5a26c8){if(_0x5a26c8){return _0x5a26c8?{'count':_0x41cf12,'rows':_0x5a26c8}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x53a6a1,null))['catch'](handleError(_0x53a6a1,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','include','rows','catch','show','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','VoicePrefix','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options'];(function(_0x2673b0,_0x2f3c03){var _0x40c90e=function(_0x406001){while(--_0x406001){_0x2673b0['push'](_0x2673b0['shift']());}};_0x40c90e(++_0x2f3c03);}(_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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voicePrefix.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='VoicePrefixes';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['VoicePrefix'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x24')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x562fb4[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x23')](removeEntity(_0x14bec2,null))[_0x0a9e('0x42')](handleError(_0x14bec2,null));};exports['describe']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')]()[_0x0a9e('0x23')](respondWithResult(_0x1bde3c,null))[_0x0a9e('0x42')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x47')]=function(_0x19383e,_0x34febd){var _0x58a5c2;return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x4f7240){return db['VoicePrefix']['create'](_0x19383e[_0x0a9e('0x4a')],{'transaction':_0x4f7240})[_0x0a9e('0x23')](function(_0x37edaa){_0x58a5c2=_0x37edaa[_0x0a9e('0x25')]({'plain':!![]});return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x58a5c2[_0x0a9e('0x4c')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x5d38ae){return createVoicePrefixExtensions(_0x58a5c2,_0x5d38ae,_0x4f7240);});});})['then'](function(){var _0x53975a=_0x19383e[_0x0a9e('0x4d')][_0x0a9e('0x25')]({'plain':!![]});if(!_0x53975a)throw new Error(_0x0a9e('0x4e'));if(_0x53975a['role']===_0x0a9e('0x4d')){var _0x161aa7=_0x58a5c2;return db['UserProfileSection']['find']({'where':{'name':_0x0a9e('0x4f'),'userProfileId':_0x53975a['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x4c3845){if(_0x4c3845&&_0x4c3845[_0x0a9e('0x50')]===0x0){return db[_0x0a9e('0x51')][_0x0a9e('0x47')]({'name':_0x161aa7['name'],'resourceId':_0x161aa7['id'],'type':_0x4c3845[_0x0a9e('0x28')],'sectionId':_0x4c3845['id']},{})[_0x0a9e('0x23')](function(){return _0x58a5c2;});}else{return _0x58a5c2;}})['catch'](function(_0x50f687){logger[_0x0a9e('0x26')](_0x0a9e('0x52'),_0x50f687);throw _0x50f687;});}return _0x58a5c2;})['then'](respondWithResult(_0x34febd,null))[_0x0a9e('0x42')](handleError(_0x34febd,null));};function Extension(_0x5ce9ac,_0x211ef9,_0x523cd2,_0xe22ccc){this['context']='from-sip';this['exten']=_0x5ce9ac;this[_0x0a9e('0x53')]=_0x523cd2;this['type']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x0a9e('0x56');this[_0x0a9e('0x57')]=_0x211ef9;this[_0x0a9e('0x58')]=_0xe22ccc;}function createVoicePrefixExtensions(_0x272738,_0xd10662,_0x28d814){return new BPromise(function(_0x4e67ab,_0x1c693e){var _0x121cef=new Extension(formatPrefixName(_0x272738[_0x0a9e('0x59')]),0x1,_0x0a9e('0x5a'),_0x0a9e('0x5b'));_0x121cef[_0x0a9e('0x5c')]=_0x272738['id'];return db['VoiceExtension'][_0x0a9e('0x47')](_0x121cef,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x5239ef){var _0x3649cc=_0x5239ef['get']({'plain':!![]});var _0x20c668=_['map'](addVoicePrefixExtensions(_0x272738,_0xd10662),function(_0x4b3c1a){_0x4b3c1a['VoiceExtensionId']=_0x3649cc['id'];_0x4b3c1a[_0x0a9e('0x5c')]=_0x272738['id'];return _0x4b3c1a;});return db['VoiceExtension'][_0x0a9e('0x5d')](_0x20c668,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x261adb){if(!_0x261adb){return _0x1c693e(_0x0a9e('0x5e'));}else{return _0x4e67ab(_0x261adb);}})[_0x0a9e('0x42')](function(_0x26d7db){return _0x1c693e(_0x26d7db);});});;});};function addVoicePrefixExtensions(_0x49eed0,_0x1627a7){var _0x5854cc=[];var _0xca4ade=formatPrefixName(_0x49eed0[_0x0a9e('0x59')]);_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x2,'Set',_0x0a9e('0x60')+_0x49eed0[_0x0a9e('0x28')]));if(_0x49eed0[_0x0a9e('0x61')]){_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x3,'Set',_0x0a9e('0x62')+_0x49eed0[_0x0a9e('0x61')]));}else{_0x5854cc['push'](new Extension(_0xca4ade,0x3,_0x0a9e('0x5a'),_0x0a9e('0x63')));}_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x4,_0x0a9e('0x64'),_0x1627a7[_0x0a9e('0x65')]+','+'${EXTEN:'+(0x8+_0x49eed0[_0x0a9e('0x28')][_0x0a9e('0x32')])+'}'+','+0x1));return _0x5854cc;}function formatPrefixName(_0x281c7d){var _0x47bb43='_';for(var _0x3528b7=0x0;_0x3528b7<_0x281c7d['length'];_0x3528b7++){if(_0x281c7d['charAt'](_0x3528b7)=='-'){_0x47bb43+=_0x281c7d[_0x0a9e('0x66')](_0x3528b7);}else{_0x47bb43+='['+_0x281c7d[_0x0a9e('0x66')](_0x3528b7)+']';}}_0x47bb43+='.';return _0x47bb43;}exports[_0x0a9e('0x22')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489=_0x19c995[_0x0a9e('0x4a')];_0x387489[_0x0a9e('0x59')]=_0x0a9e('0x67')+_0x387489[_0x0a9e('0x28')]+'-';return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x2b8192){return db[_0x0a9e('0x2a')][_0x0a9e('0x22')](_0x387489,{'where':{'id':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')]['destroy']({'where':{'VoicePrefixId':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x387489['VoiceExtensionId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x30944e){return createVoicePrefixExtensions(_0x387489,_0x30944e,_0x2b8192);});});});})['then'](function(){return db[_0x0a9e('0x2a')][_0x0a9e('0x68')](_0x387489['id']);})[_0x0a9e('0x23')](respondWithResult(_0x186f39,null))[_0x0a9e('0x42')](handleError(_0x186f39,null));};exports[_0x0a9e('0x69')]=function(_0x4a43a8,_0x50cdce,_0x4a2438){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4a43a8[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x50cdce,null))[_0x0a9e('0x23')](function(_0x380ab3){if(_0x380ab3){return _0x380ab3[_0x0a9e('0x69')](_0x4a43a8[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x6a')](_0x4a43a8[_0x0a9e('0x4a')],[_0x0a9e('0x6b'),'id'])||{})['spread'](function(_0x2bdc44){for(var _0x583b2e=0x0;_0x583b2e<_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')]['length'];_0x583b2e+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x6d'),{'UserId':_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')][_0x583b2e],'VoicePrefixId':_0x4a43a8['params']['id']});}return _0x2bdc44;});}})[_0x0a9e('0x23')](respondWithResult(_0x50cdce,null))[_0x0a9e('0x42')](handleError(_0x50cdce,null));};exports[_0x0a9e('0x6e')]=function(_0x278ab4,_0x5b7fc3,_0x109ccb){var _0x3d91db;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x278ab4['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5b7fc3,null))[_0x0a9e('0x23')](function(_0x30a4c7){if(_0x30a4c7){return _0x30a4c7[_0x0a9e('0x6e')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])[_0x0a9e('0x23')](function(_0x3df0e3){if(_[_0x0a9e('0x6f')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])){for(var _0x1f10ef=0x0;_0x1f10ef<_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')]['length'];_0x1f10ef+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'][_0x1f10ef],'VoicePrefixId':_0x278ab4[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'],'VoicePrefixId':_0x278ab4['params']['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x5b7fc3,null))[_0x0a9e('0x42')](handleError(_0x5b7fc3,null));};exports['getAgents']=function(_0x45108c,_0x53a6a1,_0x260f4b){var _0x8ebf02={};var _0x5637a1={};var _0x28a942;var _0x41cf12;return db[_0x0a9e('0x2a')][_0x0a9e('0x71')]({'where':{'id':_0x45108c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x53a6a1,null))[_0x0a9e('0x23')](function(_0x482ca2){if(_0x482ca2){_0x28a942=_0x482ca2;_0x5637a1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x72')][_0x0a9e('0x2b')]);_0x5637a1['query']=_[_0x0a9e('0x2d')](_0x45108c[_0x0a9e('0x2e')]);_0x5637a1['filters']=_[_0x0a9e('0x2f')](_0x5637a1['model'],_0x5637a1[_0x0a9e('0x2e')]);_0x8ebf02[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5637a1[_0x0a9e('0x2c')],qs['fields'](_0x45108c['query'][_0x0a9e('0x31')]));_0x8ebf02[_0x0a9e('0x30')]=_0x8ebf02[_0x0a9e('0x30')]['length']?_0x8ebf02[_0x0a9e('0x30')]:_0x5637a1[_0x0a9e('0x2c')];_0x8ebf02['order']=qs['sort'](_0x45108c[_0x0a9e('0x2e')]['sort']);_0x8ebf02['where']=qs['filters'](_[_0x0a9e('0x73')](_0x45108c[_0x0a9e('0x2e')],_0x5637a1[_0x0a9e('0x36')]));if(_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x8ebf02[_0x0a9e('0x39')]=_['merge'](_0x8ebf02[_0x0a9e('0x39')],{'$or':_['map'](_0x8ebf02[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x45108c[_0x0a9e('0x2e')]['filter']+'%'};return _0x18ad56;})});}_0x8ebf02=_[_0x0a9e('0x38')]({},_0x8ebf02,_0x45108c[_0x0a9e('0x3e')]);return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})['then'](function(_0xb6e411){if(_0xb6e411){_0x41cf12=_0xb6e411[_0x0a9e('0x32')];if(!_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x33')](_0x0a9e('0x75'))){_0x8ebf02[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x45108c[_0x0a9e('0x2e')]['limit']);_0x8ebf02[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x45108c['query'][_0x0a9e('0x1c')]);}return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})[_0x0a9e('0x23')](function(_0x5a26c8){if(_0x5a26c8){return _0x5a26c8?{'count':_0x41cf12,'rows':_0x5a26c8}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x53a6a1,null))['catch'](handleError(_0x53a6a1,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 289ea76..75370ed 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 _0x9f62=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x19ef90,_0x26f77b){var _0x825ce7=function(_0x3c0b67){while(--_0x3c0b67){_0x19ef90['push'](_0x19ef90['shift']());}};_0x825ce7(++_0x26f77b);}(_0x9f62,0x154));var _0x29f6=function(_0x3b2bbf,_0x5207fb){_0x3b2bbf=_0x3b2bbf-0x0;var _0x42ce97=_0x9f62[_0x3b2bbf];return _0x42ce97;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x29f6('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x29f6('0x1')](0x0);var events={'afterCreate':_0x29f6('0x2'),'afterUpdate':_0x29f6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54d164){return function(_0x258ddd,_0x2f0420,_0xefa26c){VoicePrefixEvents[_0x29f6('0x4')](_0x54d164+':'+_0x258ddd['id'],_0x258ddd);VoicePrefixEvents['emit'](_0x54d164,_0x258ddd);_0xefa26c(null);};}for(var e in events){if(events[_0x29f6('0x5')](e)){var event=events[e];VoicePrefix[_0x29f6('0x6')](e,emitEvent(event));}}module[_0x29f6('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xc978=['VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x107fb8,_0x1503dc){var _0x193322=function(_0x538e64){while(--_0x538e64){_0x107fb8['push'](_0x107fb8['shift']());}};_0x193322(++_0x1503dc);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x8c97('0x0'));var VoicePrefix=require(_0x8c97('0x1'))['db'][_0x8c97('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8c97('0x3')](0x0);var events={'afterCreate':_0x8c97('0x4'),'afterUpdate':_0x8c97('0x5'),'afterDestroy':'remove'};function emitEvent(_0x23f5e9){return function(_0x23c28d,_0x3ad972,_0x2f12fc){VoicePrefixEvents[_0x8c97('0x6')](_0x23f5e9+':'+_0x23c28d['id'],_0x23c28d);VoicePrefixEvents[_0x8c97('0x6')](_0x23f5e9,_0x23c28d);_0x2f12fc(null);};}for(var e in events){if(events[_0x8c97('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x8c97('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 fe23aeb..31215ae 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 _0x6439=['exports','VoicePrefix','voice_prefixes','lodash','api','moment','bluebird','request-promise','./voicePrefix.attributes'];(function(_0x4a2edc,_0x43aa13){var _0x2c84a7=function(_0x262f11){while(--_0x262f11){_0x4a2edc['push'](_0x4a2edc['shift']());}};_0x2c84a7(++_0x43aa13);}(_0x6439,0x1ce));var _0x9643=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x6439[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x9643('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9643('0x1'));var moment=require(_0x9643('0x2'));var BPromise=require(_0x9643('0x3'));var rp=require(_0x9643('0x4'));var attributes=require(_0x9643('0x5'));module[_0x9643('0x6')]=function(_0x52590b,_0xe4deb9){return _0x52590b['define'](_0x9643('0x7'),attributes,{'tableName':_0x9643('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16d8=['exports','define','voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','./voicePrefix.attributes'];(function(_0x506537,_0x285fa2){var _0x24756f=function(_0x8f1d5f){while(--_0x8f1d5f){_0x506537['push'](_0x506537['shift']());}};_0x24756f(++_0x285fa2);}(_0x16d8,0xa3));var _0x816d=function(_0x2cc943,_0x53dec1){_0x2cc943=_0x2cc943-0x0;var _0x3041eb=_0x16d8[_0x2cc943];return _0x3041eb;};'use strict';var _=require('lodash');var util=require(_0x816d('0x0'));var logger=require(_0x816d('0x1'))(_0x816d('0x2'));var moment=require(_0x816d('0x3'));var BPromise=require(_0x816d('0x4'));var rp=require(_0x816d('0x5'));var attributes=require(_0x816d('0x6'));module[_0x816d('0x7')]=function(_0x29b15c,_0x4fb0f2){return _0x29b15c[_0x816d('0x8')]('VoicePrefix',attributes,{'tableName':_0x816d('0x9'),'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 c6de8fe..d5d635b 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 _0x7ade=['client','http','redis','defaults','localhost','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0x7ade,0xd6));var _0xe7ad=function(_0x3804c3,_0x3a7c96){_0x3804c3=_0x3804c3-0x0;var _0x44d776=_0x7ade[_0x3804c3];return _0x44d776;};'use strict';var _=require('lodash');var util=require(_0xe7ad('0x0'));var moment=require(_0xe7ad('0x1'));var BPromise=require(_0xe7ad('0x2'));var rs=require(_0xe7ad('0x3'));var fs=require('fs');var Redis=require(_0xe7ad('0x4'));var db=require(_0xe7ad('0x5'))['db'];var utils=require(_0xe7ad('0x6'));var logger=require(_0xe7ad('0x7'))(_0xe7ad('0x8'));var config=require(_0xe7ad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe7ad('0xa')][_0xe7ad('0xb')]({'port':0x232a});config[_0xe7ad('0xc')]=_[_0xe7ad('0xd')](config['redis'],{'host':_0xe7ad('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe7ad('0xf'))['register'](socket);function respondWithRpcPromise(_0x5bef79,_0x4fe03d,_0x3ca751){return new BPromise(function(_0x20ca28,_0x194f5e){return client[_0xe7ad('0x10')](_0x5bef79,_0x3ca751)[_0xe7ad('0x11')](function(_0x1a32e6){logger[_0xe7ad('0x12')](_0xe7ad('0x13'),_0x4fe03d,'request\x20sent');logger['debug'](_0xe7ad('0x14'),_0x4fe03d,_0xe7ad('0x15'),JSON[_0xe7ad('0x16')](_0x1a32e6));if(_0x1a32e6[_0xe7ad('0x17')]){if(_0x1a32e6[_0xe7ad('0x17')][_0xe7ad('0x18')]===0x1f4){logger[_0xe7ad('0x17')](_0xe7ad('0x13'),_0x4fe03d,_0x1a32e6[_0xe7ad('0x17')][_0xe7ad('0x19')]);return _0x194f5e(_0x1a32e6[_0xe7ad('0x17')]['message']);}logger[_0xe7ad('0x17')](_0xe7ad('0x13'),_0x4fe03d,_0x1a32e6['error'][_0xe7ad('0x19')]);return _0x20ca28(_0x1a32e6['error'][_0xe7ad('0x19')]);}else{logger[_0xe7ad('0x12')](_0xe7ad('0x13'),_0x4fe03d,_0xe7ad('0x15'));_0x20ca28(_0x1a32e6[_0xe7ad('0x1a')][_0xe7ad('0x19')]);}})[_0xe7ad('0x1b')](function(_0x316b96){logger[_0xe7ad('0x17')](_0xe7ad('0x13'),_0x4fe03d,_0x316b96);_0x194f5e(_0x316b96);});});} \ No newline at end of file +var _0x8618=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','socket.io-emitter','redis','./voicePrefix.socket','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x1a663e,_0x357c47){var _0x4055ab=function(_0x3deb3c){while(--_0x3deb3c){_0x1a663e['push'](_0x1a663e['shift']());}};_0x4055ab(++_0x357c47);}(_0x8618,0x9f));var _0x8861=function(_0x103b86,_0x56d491){_0x103b86=_0x103b86-0x0;var _0x37af0f=_0x8618[_0x103b86];return _0x37af0f;};'use strict';var _=require(_0x8861('0x0'));var util=require(_0x8861('0x1'));var moment=require(_0x8861('0x2'));var BPromise=require(_0x8861('0x3'));var rs=require(_0x8861('0x4'));var fs=require('fs');var Redis=require(_0x8861('0x5'));var db=require(_0x8861('0x6'))['db'];var utils=require(_0x8861('0x7'));var logger=require('../../config/logger')(_0x8861('0x8'));var config=require(_0x8861('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8861('0xa')][_0x8861('0xb')]({'port':0x232a});config['redis']=_[_0x8861('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8861('0xd'))(new Redis(config[_0x8861('0xe')]));require(_0x8861('0xf'))['register'](socket);function respondWithRpcPromise(_0x243765,_0x391388,_0x2f5d94){return new BPromise(function(_0x5623aa,_0x3f2397){return client['request'](_0x243765,_0x2f5d94)['then'](function(_0x4d3073){logger['info'](_0x8861('0x10'),_0x391388,'request\x20sent');logger[_0x8861('0x11')](_0x8861('0x12'),_0x391388,_0x8861('0x13'),JSON[_0x8861('0x14')](_0x4d3073));if(_0x4d3073[_0x8861('0x15')]){if(_0x4d3073[_0x8861('0x15')][_0x8861('0x16')]===0x1f4){logger[_0x8861('0x15')](_0x8861('0x10'),_0x391388,_0x4d3073['error']['message']);return _0x3f2397(_0x4d3073[_0x8861('0x15')][_0x8861('0x17')]);}logger['error'](_0x8861('0x10'),_0x391388,_0x4d3073[_0x8861('0x15')]['message']);return _0x5623aa(_0x4d3073[_0x8861('0x15')]['message']);}else{logger[_0x8861('0x18')](_0x8861('0x10'),_0x391388,_0x8861('0x13'));_0x5623aa(_0x4d3073[_0x8861('0x19')]['message']);}})[_0x8861('0x1a')](function(_0x3683dd){logger[_0x8861('0x15')](_0x8861('0x10'),_0x391388,_0x3683dd);_0x3f2397(_0x3683dd);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index ba0adf2..7a21232 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 _0xe900=['register','length','voicePrefix:','./voicePrefix.events','save','update','emit','removeListener'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xe900,0x14b));var _0x0e90=function(_0x180c0e,_0x771256){_0x180c0e=_0x180c0e-0x0;var _0x4e5553=_0xe900[_0x180c0e];return _0x4e5553;};'use strict';var VoicePrefixEvents=require(_0x0e90('0x0'));var events=[_0x0e90('0x1'),'remove',_0x0e90('0x2')];function createListener(_0x2b1d08,_0x53848f){return function(_0x3fb190){_0x53848f[_0x0e90('0x3')](_0x2b1d08,_0x3fb190);};}function removeListener(_0x156de0,_0xb8f5ba){return function(){VoicePrefixEvents[_0x0e90('0x4')](_0x156de0,_0xb8f5ba);};}exports[_0x0e90('0x5')]=function(_0x284bcf){for(var _0x1ed3af=0x0,_0xf9e1bf=events[_0x0e90('0x6')];_0x1ed3af<_0xf9e1bf;_0x1ed3af++){var _0x163caa=events[_0x1ed3af];var _0x2df884=createListener(_0x0e90('0x7')+_0x163caa,_0x284bcf);VoicePrefixEvents['on'](_0x163caa,_0x2df884);}}; \ No newline at end of file +var _0xe286=['emit','removeListener','length','voicePrefix:','./voicePrefix.events','remove','update'];(function(_0x14b51b,_0x23707b){var _0x5957cb=function(_0xc91b86){while(--_0xc91b86){_0x14b51b['push'](_0x14b51b['shift']());}};_0x5957cb(++_0x23707b);}(_0xe286,0xcf));var _0x6e28=function(_0x408875,_0x3bb0f9){_0x408875=_0x408875-0x0;var _0x24fc7b=_0xe286[_0x408875];return _0x24fc7b;};'use strict';var VoicePrefixEvents=require(_0x6e28('0x0'));var events=['save',_0x6e28('0x1'),_0x6e28('0x2')];function createListener(_0x1f9640,_0x5e5e37){return function(_0x99f8f4){_0x5e5e37[_0x6e28('0x3')](_0x1f9640,_0x99f8f4);};}function removeListener(_0x284f98,_0x3fe566){return function(){VoicePrefixEvents[_0x6e28('0x4')](_0x284f98,_0x3fe566);};}exports['register']=function(_0x466f5c){for(var _0x41f962=0x0,_0x5f24b4=events[_0x6e28('0x5')];_0x41f962<_0x5f24b4;_0x41f962++){var _0x43e847=events[_0x41f962];var _0x118061=createListener(_0x6e28('0x6')+_0x43e847,_0x466f5c);VoicePrefixEvents['on'](_0x43e847,_0x118061);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index d930765..2efeefe 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 _0xb903=['/:id/blacklists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','show','/:id/hoppers','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getAgents','getMembers','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','clone','/:id/users','addAgents','addLists'];(function(_0x3e905d,_0x1e5aac){var _0x513e9b=function(_0x10595a){while(--_0x10595a){_0x3e905d['push'](_0x3e905d['shift']());}};_0x513e9b(++_0x1e5aac);}(_0xb903,0x185));var _0x3b90=function(_0x580e48,_0xbfa938){_0x580e48=_0x580e48-0x0;var _0x341033=_0xb903[_0x580e48];return _0x341033;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var auth=require(_0x3b90('0x5'));var interaction=require(_0x3b90('0x6'));var config=require(_0x3b90('0x7'));var controller=require(_0x3b90('0x8'));router[_0x3b90('0x9')]('/',auth[_0x3b90('0xa')](),controller['index']);router[_0x3b90('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router[_0x3b90('0x9')](_0x3b90('0xc'),auth[_0x3b90('0xa')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0x3b90('0xd'),auth[_0x3b90('0xa')](),controller['getHopperFinals']);router[_0x3b90('0x9')](_0x3b90('0xe'),auth['isAuthenticated'](),controller[_0x3b90('0xf')]);router[_0x3b90('0x9')](_0x3b90('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0x3b90('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x3b90('0x11')]);router[_0x3b90('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0x3b90('0x12')]);router[_0x3b90('0x9')](_0x3b90('0x13'),auth[_0x3b90('0xa')](),controller[_0x3b90('0x14')]);router['get']('/:id/blacklists',auth[_0x3b90('0xa')](),controller[_0x3b90('0x15')]);router['post']('/',auth[_0x3b90('0xa')](),controller[_0x3b90('0x16')]);router[_0x3b90('0x17')](_0x3b90('0x18'),auth['isAuthenticated'](),controller[_0x3b90('0x19')]);router['post'](_0x3b90('0x10'),auth[_0x3b90('0xa')](),controller['addTeams']);router[_0x3b90('0x17')](_0x3b90('0x1a'),auth[_0x3b90('0xa')](),controller[_0x3b90('0x1b')]);router[_0x3b90('0x17')](_0x3b90('0x13'),auth[_0x3b90('0xa')](),controller[_0x3b90('0x1c')]);router[_0x3b90('0x17')](_0x3b90('0x1d'),auth['isAuthenticated'](),controller[_0x3b90('0x1e')]);router[_0x3b90('0x1f')](_0x3b90('0x20'),auth[_0x3b90('0xa')](),controller[_0x3b90('0x21')]);router[_0x3b90('0x22')]('/:id',auth['isAuthenticated'](),controller[_0x3b90('0x23')]);router[_0x3b90('0x22')](_0x3b90('0x10'),auth[_0x3b90('0xa')](),controller['removeTeams']);router[_0x3b90('0x22')](_0x3b90('0x1a'),auth[_0x3b90('0xa')](),controller['removeAgents']);router[_0x3b90('0x22')](_0x3b90('0x13'),auth[_0x3b90('0xa')](),controller[_0x3b90('0x24')]);router[_0x3b90('0x22')](_0x3b90('0x1d'),auth['isAuthenticated'](),controller[_0x3b90('0x25')]);module['exports']=router; \ No newline at end of file +var _0x702d=['delete','destroy','removeTeams','removeAgents','/:id/lists','removeLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','get','/:id','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getTeams','/:id/users','getAgents','/:id/members','getLists','/:id/blacklists','getBlackLists','create','/:id/clone','clone','post','/:id/teams','addTeams','addAgents','put'];(function(_0x496d76,_0x18daab){var _0x1d8ebe=function(_0x1f814f){while(--_0x1f814f){_0x496d76['push'](_0x496d76['shift']());}};_0x1d8ebe(++_0x18daab);}(_0x702d,0x147));var _0xd702=function(_0x450034,_0x16514f){_0x450034=_0x450034-0x0;var _0x45f273=_0x702d[_0x450034];return _0x45f273;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var auth=require(_0xd702('0x5'));var interaction=require(_0xd702('0x6'));var config=require(_0xd702('0x7'));var controller=require(_0xd702('0x8'));router['get']('/',auth[_0xd702('0x9')](),controller['index']);router[_0xd702('0xa')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller['show']);router[_0xd702('0xa')]('/:id/hoppers',auth[_0xd702('0x9')](),controller[_0xd702('0xc')]);router[_0xd702('0xa')](_0xd702('0xd'),auth[_0xd702('0x9')](),controller[_0xd702('0xe')]);router[_0xd702('0xa')](_0xd702('0xf'),auth[_0xd702('0x9')](),controller[_0xd702('0x10')]);router['get']('/:id/hopper_black',auth[_0xd702('0x9')](),controller[_0xd702('0x11')]);router[_0xd702('0xa')]('/:id/teams',auth[_0xd702('0x9')](),controller[_0xd702('0x12')]);router[_0xd702('0xa')](_0xd702('0x13'),auth[_0xd702('0x9')](),controller[_0xd702('0x14')]);router['get'](_0xd702('0x15'),auth[_0xd702('0x9')](),controller['getMembers']);router[_0xd702('0xa')]('/:id/lists',auth[_0xd702('0x9')](),controller[_0xd702('0x16')]);router['get'](_0xd702('0x17'),auth[_0xd702('0x9')](),controller[_0xd702('0x18')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd702('0x19')]);router['post'](_0xd702('0x1a'),auth[_0xd702('0x9')](),controller[_0xd702('0x1b')]);router[_0xd702('0x1c')](_0xd702('0x1d'),auth[_0xd702('0x9')](),controller[_0xd702('0x1e')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xd702('0x1f')]);router[_0xd702('0x1c')]('/:id/lists',auth[_0xd702('0x9')](),controller['addLists']);router[_0xd702('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0xd702('0x20')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller['update']);router[_0xd702('0x21')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller[_0xd702('0x22')]);router[_0xd702('0x21')](_0xd702('0x1d'),auth[_0xd702('0x9')](),controller[_0xd702('0x23')]);router[_0xd702('0x21')]('/:id/users',auth[_0xd702('0x9')](),controller[_0xd702('0x24')]);router[_0xd702('0x21')](_0xd702('0x25'),auth[_0xd702('0x9')](),controller[_0xd702('0x26')]);router[_0xd702('0x21')](_0xd702('0x17'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xd702('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 25b92db..3996d9f 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 _0xb4b8=['wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','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)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','random','rrmemory','wrandom','rrordered','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','setDataValue','joinempty','leavewhenempty','acw'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xb4b8,0x1bb));var _0x8b4b=function(_0x117c29,_0x255ef4){_0x117c29=_0x117c29-0x0;var _0x190a80=_0xb4b8[_0x117c29];return _0x190a80;};'use strict';var Sequelize=require(_0x8b4b('0x0'));module[_0x8b4b('0x1')]={'name':{'type':Sequelize[_0x8b4b('0x2')],'allowNull':![],'unique':_0x8b4b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x5'),_0x8b4b('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8b4b('0x4')]('rr',_0x8b4b('0x7'),'leastrecent','fewestcalls',_0x8b4b('0x8'),_0x8b4b('0x9'),'linear',_0x8b4b('0xa'),_0x8b4b('0xb')),'allowNull':![],'defaultValue':_0x8b4b('0x7'),'set':function(_0x474ee3){this['setDataValue'](_0x8b4b('0xc'),_0x474ee3?_0x474ee3:_0x8b4b('0x9'));},'get':function(){var _0x1f9455=this[_0x8b4b('0xd')](_0x8b4b('0xe'));var _0x513cd4=this[_0x8b4b('0xd')](_0x8b4b('0xf'));var _0x147a2b=this[_0x8b4b('0xd')](_0x8b4b('0xc'));if(_0x1f9455===_0x8b4b('0x5')){return _0x147a2b;}if(_0x513cd4===_0x8b4b('0x10')&&_0x147a2b==='rrmemory'||_0x513cd4==='booked'&&_0x147a2b===_0x8b4b('0x11')){return _0x147a2b;}if(_0x513cd4===_0x8b4b('0x12')||_0x513cd4===_0x8b4b('0x13')||_0x513cd4===_0x8b4b('0x14')){return _0x147a2b;}return null;}},'servicelevel':{'type':Sequelize[_0x8b4b('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8b4b('0x15')](0xb)},'timeout':{'type':Sequelize[_0x8b4b('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8b4b('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8b4b('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8b4b('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no'),'defaultValue':_0x8b4b('0x16')},'autopause':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no',_0x8b4b('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x8b4b('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8b4b('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8b4b('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8b4b('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8b4b('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8b4b('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8b4b('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8b4b('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no'),'defaultValue':_0x8b4b('0x16')},'announce_holdtime':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no',_0x8b4b('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x8b4b('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8b4b('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8b4b('0x2')]},'queue_youarenext':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8b4b('0x2')]},'queue_quantity1':{'type':Sequelize[_0x8b4b('0x2')]},'queue_quantity2':{'type':Sequelize[_0x8b4b('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x8b4b('0x2')]},'periodic_announce':{'type':Sequelize[_0x8b4b('0x19')],'set':function(_0x1557e6){this['setDataValue'](_0x8b4b('0x1a'),_0x1557e6?_0x1557e6[_0x8b4b('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x8b4b('0x1a'))?this['getDataValue'](_0x8b4b('0x1a'))[_0x8b4b('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':'yes','set':function(_0x19696a){this[_0x8b4b('0x1d')]('joinempty',_0x19696a?_0x19696a[_0x8b4b('0x1b')](','):[]);},'get':function(){return this['getDataValue']('joinempty')?this[_0x8b4b('0xd')](_0x8b4b('0x1e'))[_0x8b4b('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':'no','set':function(_0x29229f){this['setDataValue'](_0x8b4b('0x1f'),_0x29229f?_0x29229f[_0x8b4b('0x1b')](','):[]);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x8b4b('0xd')](_0x8b4b('0x1f'))[_0x8b4b('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize['ENUM'](_0x8b4b('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x8b4b('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8b4b('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8b4b('0x2')]},'description':{'type':Sequelize[_0x8b4b('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x207b20){this['setDataValue'](_0x8b4b('0x20'),_0x207b20);if(_0x207b20){if(this[_0x8b4b('0xd')]('wrapuptime')<0x2){this[_0x8b4b('0x1d')](_0x8b4b('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8b4b('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8b4b('0x22')],'defaultValue':0x0,'comment':_0x8b4b('0x23')},'dialMethod':{'type':Sequelize[_0x8b4b('0x4')]('preview',_0x8b4b('0x12'),'power',_0x8b4b('0x13'),_0x8b4b('0x10')),'defaultValue':_0x8b4b('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x8b4b('0x15')](0x4)[_0x8b4b('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8b4b('0x25')},'dialLimitQueue':{'type':Sequelize[_0x8b4b('0x15')](0x4)[_0x8b4b('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x8b4b('0x26')](0x2)[_0x8b4b('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8b4b('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x28'),'dropRate'),'defaultValue':'dropRate','comment':_0x8b4b('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x8b4b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8b4b('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8b4b('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x8b4b('0x15')](0x3)[_0x8b4b('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8b4b('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':_0x8b4b('0x2d'),'comment':_0x8b4b('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8b4b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x8b4b('0x2')],'comment':_0x8b4b('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8b4b('0x15')](0x3)[_0x8b4b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8b4b('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8b4b('0x15')](0x5)[_0x8b4b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8b4b('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x8b4b('0x15')](0x3)[_0x8b4b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8b4b('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8b4b('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8b4b('0x24')],'defaultValue':0x3,'comment':_0x8b4b('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8b4b('0x15')](0x5)[_0x8b4b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8b4b('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8b4b('0x15')](0x3)[_0x8b4b('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8b4b('0x2')],'defaultValue':_0x8b4b('0x35')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8b4b('0x4')]('always','never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x8b4b('0x22')],'defaultValue':0x0,'comment':_0x8b4b('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x8b4b('0x15')](0x9)[_0x8b4b('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x8b4b('0x15')](0x9)[_0x8b4b('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8b4b('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8b4b('0x15')](0x9)[_0x8b4b('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8b4b('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8b4b('0x15')](0x9)[_0x8b4b('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x8b4b('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8b4b('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8b4b('0x15')](0x9)[_0x8b4b('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8b4b('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8b4b('0x15')](0x5)[_0x8b4b('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8b4b('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8b4b('0x3b')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x8b4b('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8b4b('0x3c')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8b4b('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8b4b('0x4')](_0x8b4b('0x3e'),_0x8b4b('0x3f')),'defaultValue':_0x8b4b('0x3e')},'dialQueueProject2':{'type':Sequelize[_0x8b4b('0x2')],'comment':_0x8b4b('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8b4b('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8b4b('0x15')](0x3)[_0x8b4b('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8b4b('0x40')},'dialCutDigit':{'type':Sequelize[_0x8b4b('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8b4b('0x41')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x8b4b('0x42')},'mandatoryDisposition':{'type':Sequelize[_0x8b4b('0x22')],'defaultValue':![],'comment':_0x8b4b('0x43'),'set':function(_0x2e330f){if(!_0x2e330f)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x8b4b('0x1d')]('mandatoryDisposition',_0x2e330f);}}}; \ No newline at end of file +var _0x2413=['FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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)','#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\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','inbound','outbound','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'];(function(_0x430f40,_0x505836){var _0x4a3f6c=function(_0x575f88){while(--_0x575f88){_0x430f40['push'](_0x430f40['shift']());}};_0x4a3f6c(++_0x505836);}(_0x2413,0x1a1));var _0x3241=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2413[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x3241('0x0'));module['exports']={'name':{'type':Sequelize[_0x3241('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x3'),_0x3241('0x4')),'allowNull':![],'defaultValue':_0x3241('0x3')},'musiconhold':{'type':Sequelize[_0x3241('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x3241('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x3241('0x5'),'leastrecent',_0x3241('0x6'),_0x3241('0x7'),_0x3241('0x8'),_0x3241('0x9'),_0x3241('0xa'),_0x3241('0xb')),'allowNull':![],'defaultValue':_0x3241('0x5'),'set':function(_0x1f2659){this[_0x3241('0xc')]('strategy',_0x1f2659?_0x1f2659:'rrmemory');},'get':function(){var _0x292fd4=this[_0x3241('0xd')](_0x3241('0xe'));var _0x2dce72=this[_0x3241('0xd')](_0x3241('0xf'));var _0x5041c4=this['getDataValue'](_0x3241('0x10'));if(_0x292fd4==='inbound'){return _0x5041c4;}if(_0x2dce72===_0x3241('0x11')&&_0x5041c4===_0x3241('0x8')||_0x2dce72===_0x3241('0x11')&&_0x5041c4==='roundrobin'){return _0x5041c4;}if(_0x2dce72==='progressive'||_0x2dce72===_0x3241('0x12')||_0x2dce72===_0x3241('0x13')){return _0x5041c4;}return null;}},'servicelevel':{'type':Sequelize[_0x3241('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3241('0x14')](0xb)},'timeout':{'type':Sequelize[_0x3241('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3241('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3241('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3241('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3241('0x2')]('yes','no'),'defaultValue':_0x3241('0x15')},'autopause':{'type':Sequelize[_0x3241('0x2')]('yes','no',_0x3241('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3241('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3241('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x3241('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x3241('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x3241('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3241('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3241('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3241('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3241('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x3241('0x15'),'no'),'defaultValue':_0x3241('0x15')},'announce_holdtime':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x15'),'no',_0x3241('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x3241('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x3241('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3241('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3241('0x1')]},'queue_youarenext':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3241('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3241('0x1')]},'queue_quantity1':{'type':Sequelize[_0x3241('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x3241('0x1')]},'queue_less_than':{'type':Sequelize[_0x3241('0x1')]},'periodic_announce':{'type':Sequelize[_0x3241('0x18')],'set':function(_0x367f67){this[_0x3241('0xc')](_0x3241('0x19'),_0x367f67?_0x367f67['join'](','):[]);},'get':function(){return this[_0x3241('0xd')](_0x3241('0x19'))?this[_0x3241('0xd')](_0x3241('0x19'))[_0x3241('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x3241('0x1')],'defaultValue':'yes','set':function(_0x2b1e85){this[_0x3241('0xc')](_0x3241('0x1b'),_0x2b1e85?_0x2b1e85[_0x3241('0x1c')](','):[]);},'get':function(){return this[_0x3241('0xd')]('joinempty')?this[_0x3241('0xd')]('joinempty')[_0x3241('0x1a')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x3241('0x1')],'defaultValue':'no','set':function(_0x550d54){this[_0x3241('0xc')](_0x3241('0x1d'),_0x550d54?_0x550d54[_0x3241('0x1c')](','):[]);},'get':function(){return this[_0x3241('0xd')](_0x3241('0x1d'))?this['getDataValue'](_0x3241('0x1d'))[_0x3241('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize[_0x3241('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3241('0x1')]},'description':{'type':Sequelize[_0x3241('0x1')]},'acw':{'type':Sequelize[_0x3241('0x1e')],'defaultValue':0x0,'set':function(_0x223d73){this[_0x3241('0xc')](_0x3241('0x1f'),_0x223d73);if(_0x223d73){if(this[_0x3241('0xd')](_0x3241('0x20'))<0x2){this[_0x3241('0xc')](_0x3241('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3241('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3241('0x1e')],'defaultValue':0x0,'comment':_0x3241('0x21')},'dialMethod':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x22'),_0x3241('0x23'),_0x3241('0x13'),_0x3241('0x12'),_0x3241('0x11')),'defaultValue':_0x3241('0x23'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x3241('0x14')](0x4)[_0x3241('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3241('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x3241('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3241('0x26')},'dialPowerLevel':{'type':Sequelize[_0x3241('0x27')](0x2)[_0x3241('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3241('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x29'),'dropRate'),'defaultValue':'dropRate','comment':_0x3241('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3241('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x3241('0x14')](0x3)[_0x3241('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x3241('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x3241('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3241('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x3241('0x1')],'defaultValue':_0x3241('0x2d'),'comment':_0x3241('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x3241('0x14')](0x3)[_0x3241('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3241('0x2f')},'dialQueueProject':{'type':Sequelize[_0x3241('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3241('0x14')](0x3)[_0x3241('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3241('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3241('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3241('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3241('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3241('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3241('0x14')](0x3)[_0x3241('0x24')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3241('0x14')](0x5)[_0x3241('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3241('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3241('0x14')](0x3)[_0x3241('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3241('0x34')},'dialTimezone':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x3241('0x35')},'dialPrefix':{'type':Sequelize[_0x3241('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x3241('0x36'),_0x3241('0x37'),_0x3241('0x38')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x3241('0x1e')],'defaultValue':0x0,'comment':_0x3241('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3241('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x3241('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3241('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3241('0x14')](0x9)[_0x3241('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3241('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x3241('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3241('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3241('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3241('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3241('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3241('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3241('0x14')](0x9)[_0x3241('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3241('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3241('0x14')](0x5)[_0x3241('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3241('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3241('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3241('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x3241('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3241('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x3241('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x3241('0x2')](_0x3241('0x44'),_0x3241('0x45')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x3241('0x1')],'comment':_0x3241('0x46')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3241('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3241('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3241('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3241('0x47')},'dialCutDigit':{'type':Sequelize[_0x3241('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3241('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3241('0x49'),'set':function(_0x3aa49f){if(!_0x3aa49f)this['setDataValue'](_0x3241('0x4a'),null);this['setDataValue'](_0x3241('0x4b'),_0x3aa49f);}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 2592e56..0900494 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 _0x3177=['hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','ids','User','Agents','addAgents','penalty','addTeams','union','removeTeams','spread','emit','userVoiceQueue:save','voicePause','interface','push','UserVoiceQueueRt','upsert','format','all','removeAgents','isArray','userVoiceQueue:remove','realtime','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ListId','select','NOW()','ContactId','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','insert','fromQuery','deletedAt\x20IS\x20NULL','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./voiceQueue.socket','register','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','value','includes','type','find','name','UserProfileResource','end','error','stack','send','index','VoiceQueue','rawAttributes','model','keys','query','intersection','fields','attributes','length'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x3177,0x66));var _0x7317=function(_0x304320,_0x232a69){_0x304320=_0x304320-0x0;var _0xe607da=_0x3177[_0x304320];return _0xe607da;};'use strict';var pdf=require(_0x7317('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7317('0x1'));var zipdir=require(_0x7317('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7317('0x3'));var moment=require(_0x7317('0x4'));var BPromise=require(_0x7317('0x5'));var Mustache=require(_0x7317('0x6'));var util=require(_0x7317('0x7'));var path=require(_0x7317('0x8'));var sox=require(_0x7317('0x9'));var csv=require(_0x7317('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7317('0xb'));var crypto=require('crypto');var jsforce=require(_0x7317('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7317('0xd'));var authService=require(_0x7317('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7317('0xf'));var qs=require(_0x7317('0x10'));var logger=require(_0x7317('0x11'))(_0x7317('0x12'));var utils=require(_0x7317('0x13'));var config=require(_0x7317('0x14'));var db=require(_0x7317('0x15'))['db'];config[_0x7317('0x16')]=_[_0x7317('0x17')](config[_0x7317('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7317('0x16')]));require(_0x7317('0x18'))[_0x7317('0x19')](socket);function respondWithStatusCode(_0x2a30e8,_0x41396d){_0x41396d=_0x41396d||0xcc;return function(_0x314026){if(_0x314026){return _0x2a30e8[_0x7317('0x1a')](_0x41396d);}return _0x2a30e8[_0x7317('0x1b')](_0x41396d)['end']();};}function respondWithResult(_0x53f017,_0x278936){_0x278936=_0x278936||0xc8;return function(_0x4bb396){if(_0x4bb396){return _0x53f017['status'](_0x278936)[_0x7317('0x1c')](_0x4bb396);}};}function respondWithFilteredResult(_0x3fd117,_0x369bdb){return function(_0x302596){if(_0x302596){var _0x45ac06=_0x302596[_0x7317('0x1d')],_0x35a6c0=_0x369bdb[_0x7317('0x1e')],_0x4d8416=_0x369bdb[_0x7317('0x1e')]+_0x369bdb['limit'],_0x12ed92;if(_0x4d8416>=_0x45ac06){_0x4d8416=_0x45ac06;_0x12ed92=0xc8;}else{_0x12ed92=0xce;}_0x3fd117['status'](_0x12ed92);return _0x3fd117[_0x7317('0x1f')](_0x7317('0x20'),_0x35a6c0+'-'+_0x4d8416+'/'+_0x45ac06)[_0x7317('0x1c')](_0x302596);}return null;};}function patchUpdates(_0x2dce4b){return function(_0x5ce20d){try{jsonpatch['apply'](_0x5ce20d,_0x2dce4b,!![]);}catch(_0x476fb3){return BPromise[_0x7317('0x21')](_0x476fb3);}return _0x5ce20d[_0x7317('0x22')]();};}function saveUpdates(_0x1d9923,_0x3d29a0){return function(_0x1268b7){if(_0x1268b7){return _0x1268b7[_0x7317('0x23')](_0x1d9923)[_0x7317('0x24')](function(_0x2ce710){return _0x2ce710;});}return null;};}function removeEntity(_0x32591c,_0x1e13f1){return function(_0x51b982){if(_0x51b982){return _0x51b982[_0x7317('0x25')]()['then'](function(){var _0x9cb868=_0x51b982[_0x7317('0x26')]({'plain':!![]});var _0x29c7a7=[{'name':_0x7317('0x27'),'value':_0x7317('0x28'),'ignore':![]},{'name':_0x7317('0x29'),'value':_0x7317('0x2a'),'ignore':![]}];var _0x14341b=_(_0x29c7a7)['filter'](_0x7317('0x2b'))['map']('value')[_0x7317('0x2c')]();if(_[_0x7317('0x2d')](_0x14341b,_0x9cb868[_0x7317('0x2e')])){return;}var _0x18336e=_[_0x7317('0x2f')](_0x29c7a7,[_0x7317('0x2c'),_0x9cb868[_0x7317('0x2e')]])[_0x7317('0x30')];return db[_0x7317('0x31')][_0x7317('0x25')]({'where':{'type':_0x18336e,'resourceId':_0x9cb868['id']}})[_0x7317('0x24')](function(){return _0x51b982;});})[_0x7317('0x24')](function(){_0x32591c[_0x7317('0x1b')](0xcc)[_0x7317('0x32')]();});}};}function handleEntityNotFound(_0x5bd085,_0x20252d){return function(_0x259c7f){if(!_0x259c7f){_0x5bd085['sendStatus'](0x194);}return _0x259c7f;};}function handleError(_0x3ba89d,_0x3a6bc4){_0x3a6bc4=_0x3a6bc4||0x1f4;return function(_0x40dce4){logger[_0x7317('0x33')](_0x40dce4[_0x7317('0x34')]);if(_0x40dce4[_0x7317('0x30')]){delete _0x40dce4[_0x7317('0x30')];}_0x3ba89d[_0x7317('0x1b')](_0x3a6bc4)[_0x7317('0x35')](_0x40dce4);};}exports[_0x7317('0x36')]=function(_0x13e44a,_0x155996){var _0x25e37a={},_0x7c55d={},_0x122bb9={'count':0x0,'rows':[]};var _0x1b84a6=db[_0x7317('0x37')][_0x7317('0x38')];_0x7c55d[_0x7317('0x39')]=_[_0x7317('0x3a')](_0x1b84a6);_0x7c55d[_0x7317('0x3b')]=_[_0x7317('0x3a')](_0x13e44a[_0x7317('0x3b')]);_0x7c55d['filters']=_['intersection'](_0x7c55d['model'],_0x7c55d[_0x7317('0x3b')]);_0x25e37a['attributes']=_[_0x7317('0x3c')](_0x7c55d[_0x7317('0x39')],qs[_0x7317('0x3d')](_0x13e44a['query'][_0x7317('0x3d')]));_0x25e37a['attributes']=_0x25e37a[_0x7317('0x3e')][_0x7317('0x3f')]?_0x25e37a['attributes']:_0x7c55d[_0x7317('0x39')];if(!_0x13e44a[_0x7317('0x3b')][_0x7317('0x40')]('nolimit')){_0x25e37a['limit']=qs[_0x7317('0x41')](_0x13e44a['query'][_0x7317('0x41')]);_0x25e37a[_0x7317('0x1e')]=qs[_0x7317('0x1e')](_0x13e44a[_0x7317('0x3b')][_0x7317('0x1e')]);}_0x25e37a[_0x7317('0x42')]=qs['sort'](_0x13e44a[_0x7317('0x3b')][_0x7317('0x43')]);_0x25e37a[_0x7317('0x44')]=qs[_0x7317('0x45')](_[_0x7317('0x46')](_0x13e44a[_0x7317('0x3b')],_0x7c55d['filters']));if(_0x13e44a[_0x7317('0x3b')][_0x7317('0x47')]){_0x25e37a[_0x7317('0x44')]=_[_0x7317('0x48')](_0x25e37a[_0x7317('0x44')],{'$or':_[_0x7317('0x49')](_0x1b84a6,function(_0xae5da5){if(_0xae5da5[_0x7317('0x2e')][_0x7317('0x4a')]!==_0x7317('0x4b')){var _0x2dec15={};_0x2dec15[_0xae5da5[_0x7317('0x4c')]]={'$like':'%'+_0x13e44a[_0x7317('0x3b')][_0x7317('0x47')]+'%'};return _0x2dec15;}})});}_0x25e37a=_[_0x7317('0x48')]({},_0x25e37a,_0x13e44a[_0x7317('0x4d')]);var _0x5ca780={'where':_0x25e37a['where']};return db[_0x7317('0x37')][_0x7317('0x1d')](_0x5ca780)['then'](function(_0x5a4a1d){_0x122bb9[_0x7317('0x1d')]=_0x5a4a1d;if(_0x13e44a['query'][_0x7317('0x4e')]){_0x25e37a[_0x7317('0x4f')]=[{'all':!![]}];}return db[_0x7317('0x37')][_0x7317('0x50')](_0x25e37a);})[_0x7317('0x24')](function(_0x97c722){_0x122bb9[_0x7317('0x51')]=_0x97c722;return _0x122bb9;})[_0x7317('0x24')](respondWithFilteredResult(_0x155996,_0x25e37a))[_0x7317('0x52')](handleError(_0x155996,null));};exports[_0x7317('0x53')]=function(_0x366025,_0x5e6adf){var _0x2dc506={'raw':![],'where':{'id':_0x366025[_0x7317('0x54')]['id']}},_0xb26125={};_0xb26125[_0x7317('0x39')]=_[_0x7317('0x3a')](db[_0x7317('0x37')][_0x7317('0x38')]);_0xb26125[_0x7317('0x3b')]=_['keys'](_0x366025[_0x7317('0x3b')]);_0xb26125['filters']=_[_0x7317('0x3c')](_0xb26125[_0x7317('0x39')],_0xb26125[_0x7317('0x3b')]);_0x2dc506[_0x7317('0x3e')]=_[_0x7317('0x3c')](_0xb26125['model'],qs['fields'](_0x366025[_0x7317('0x3b')]['fields']));_0x2dc506['attributes']=_0x2dc506[_0x7317('0x3e')][_0x7317('0x3f')]?_0x2dc506[_0x7317('0x3e')]:_0xb26125['model'];if(_0x366025[_0x7317('0x3b')][_0x7317('0x4e')]){_0x2dc506[_0x7317('0x4f')]=[{'all':!![]}];}_0x2dc506=_[_0x7317('0x48')]({},_0x2dc506,_0x366025[_0x7317('0x4d')]);return db[_0x7317('0x37')]['find'](_0x2dc506)[_0x7317('0x24')](handleEntityNotFound(_0x5e6adf,null))[_0x7317('0x24')](respondWithResult(_0x5e6adf,null))[_0x7317('0x52')](handleError(_0x5e6adf,null));};exports[_0x7317('0x55')]=function(_0x57325d,_0x550f00){return db[_0x7317('0x37')][_0x7317('0x55')](_0x57325d[_0x7317('0x56')],{})['then'](function(_0xfe6df3){var _0x353c5b=_0x57325d[_0x7317('0x57')][_0x7317('0x26')]({'plain':!![]});if(!_0x353c5b)throw new Error(_0x7317('0x58'));if(_0x353c5b[_0x7317('0x59')]===_0x7317('0x57')){var _0x520c52=_0xfe6df3[_0x7317('0x26')]({'plain':!![]});var _0x5f0f60=[{'name':_0x7317('0x27'),'value':'inbound'},{'name':_0x7317('0x29'),'value':'outbound'}];var _0x2f749a=_[_0x7317('0x2f')](_0x5f0f60,['value',_0x520c52[_0x7317('0x2e')]])[_0x7317('0x30')];return db[_0x7317('0x5a')][_0x7317('0x2f')]({'where':{'name':_0x2f749a,'userProfileId':_0x353c5b['userProfileId']},'raw':!![]})['then'](function(_0x51bd7f){if(_0x51bd7f&&_0x51bd7f['autoAssociation']===0x0){return db[_0x7317('0x31')]['create']({'name':_0x520c52[_0x7317('0x30')],'resourceId':_0x520c52['id'],'type':_0x51bd7f[_0x7317('0x30')],'sectionId':_0x51bd7f['id']},{})[_0x7317('0x24')](function(){return _0xfe6df3;});}else{return _0xfe6df3;}})['catch'](function(_0x42d198){logger[_0x7317('0x33')](_0x7317('0x5b'),_0x42d198);throw _0x42d198;});}return _0xfe6df3;})[_0x7317('0x24')](respondWithResult(_0x550f00,0xc9))[_0x7317('0x52')](handleError(_0x550f00,null));};exports[_0x7317('0x5c')]=function(_0x477eb4,_0x209f40){var _0x457e90={'raw':![],'where':{'id':_0x477eb4[_0x7317('0x54')]['id']}},_0x40a46d={};_0x40a46d[_0x7317('0x39')]=_['keys'](db[_0x7317('0x37')][_0x7317('0x38')]);_0x457e90[_0x7317('0x3e')]=_[_0x7317('0x3c')](_0x40a46d[_0x7317('0x39')],qs[_0x7317('0x3d')](_0x477eb4[_0x7317('0x3b')]['fields']));_0x457e90[_0x7317('0x3e')]=_0x457e90[_0x7317('0x3e')][_0x7317('0x3f')]?_0x457e90[_0x7317('0x3e')]:_0x40a46d['model'];if(_0x477eb4[_0x7317('0x3b')][_0x7317('0x4e')]){_0x457e90['include']=[{'all':!![]}];}_0x457e90=_[_0x7317('0x48')]({},_0x457e90,_0x477eb4[_0x7317('0x4d')]);return db[_0x7317('0x37')][_0x7317('0x2f')](_0x457e90)[_0x7317('0x24')](handleEntityNotFound(_0x209f40,null))[_0x7317('0x24')](function(_0x2d0e22){if(_0x2d0e22){var _0x52513d=_0x2d0e22[_0x7317('0x26')]({'plain':!![]});_0x52513d=qs[_0x7317('0x5d')](_0x52513d,['id','createdAt',_0x7317('0x5e')]);_0x477eb4[_0x7317('0x56')]=_['omit'](_0x477eb4[_0x7317('0x56')],['id',_0x7317('0x5f'),_0x7317('0x5e')]);return db[_0x7317('0x37')][_0x7317('0x55')](_['merge'](_0x52513d,_0x477eb4[_0x7317('0x56')]),{'include':_0x477eb4['query'][_0x7317('0x4e')]?[{'all':!![]}]:undefined})[_0x7317('0x24')](function(_0x5dcb34){var _0x1fdf46=_0x477eb4[_0x7317('0x57')]['get']({'plain':!![]});if(!_0x1fdf46)throw new Error(_0x7317('0x58'));if(_0x1fdf46[_0x7317('0x59')]===_0x7317('0x57')){var _0x38ccf6=_0x5dcb34[_0x7317('0x26')]({'plain':!![]});var _0x2daa13=[{'name':_0x7317('0x27'),'value':_0x7317('0x28')},{'name':'QueueCampaigns','value':_0x7317('0x2a')}];var _0x4ec522=_[_0x7317('0x2f')](_0x2daa13,[_0x7317('0x2c'),_0x38ccf6[_0x7317('0x2e')]])[_0x7317('0x30')];return db[_0x7317('0x5a')][_0x7317('0x2f')]({'where':{'name':_0x4ec522,'userProfileId':_0x1fdf46[_0x7317('0x60')]},'raw':!![]})['then'](function(_0x2f15a1){if(_0x2f15a1&&_0x2f15a1[_0x7317('0x61')]===0x0){return db[_0x7317('0x31')][_0x7317('0x55')]({'name':_0x38ccf6['name'],'resourceId':_0x38ccf6['id'],'type':_0x2f15a1[_0x7317('0x30')],'sectionId':_0x2f15a1['id']},{})[_0x7317('0x24')](function(){return _0x5dcb34;});}else{return _0x5dcb34;}})[_0x7317('0x52')](function(_0x3f682c){logger[_0x7317('0x33')](_0x7317('0x5b'),_0x3f682c);throw _0x3f682c;});}return _0x5dcb34;});}})['then'](respondWithResult(_0x209f40,0xc9))[_0x7317('0x52')](handleError(_0x209f40,null));};exports[_0x7317('0x23')]=function(_0x2d2234,_0x5939c0){if(_0x2d2234['body']['id']){delete _0x2d2234['body']['id'];}return db[_0x7317('0x37')][_0x7317('0x2f')]({'where':{'id':_0x2d2234[_0x7317('0x54')]['id']}})['then'](handleEntityNotFound(_0x5939c0,null))['then'](saveUpdates(_0x2d2234[_0x7317('0x56')],null))['then'](respondWithResult(_0x5939c0,null))[_0x7317('0x52')](handleError(_0x5939c0,null));};exports[_0x7317('0x25')]=function(_0x48192c,_0x475698){return db['VoiceQueue'][_0x7317('0x2f')]({'where':{'id':_0x48192c[_0x7317('0x54')]['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x475698,null))['then'](removeEntity(_0x475698,null))[_0x7317('0x52')](handleError(_0x475698,null));};exports[_0x7317('0x62')]=function(_0x597ed1,_0x139209,_0x555483){var _0x8487db={'raw':![],'where':{}};var _0x43d101={};var _0x432674={'count':0x0,'rows':[]};return db[_0x7317('0x37')][_0x7317('0x63')]({'where':{'id':_0x597ed1['params']['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x139209,null))[_0x7317('0x24')](function(_0x144bf1){if(_0x144bf1){_0x43d101[_0x7317('0x39')]=_[_0x7317('0x3a')](db[_0x7317('0x64')][_0x7317('0x38')]);_0x43d101[_0x7317('0x3b')]=_['keys'](_0x597ed1['query']);_0x43d101[_0x7317('0x45')]=_['intersection'](_0x43d101[_0x7317('0x39')],_0x43d101[_0x7317('0x3b')]);_0x8487db[_0x7317('0x3e')]=_[_0x7317('0x3c')](_0x43d101[_0x7317('0x39')],qs[_0x7317('0x3d')](_0x597ed1['query'][_0x7317('0x3d')]));_0x8487db['attributes']=_0x8487db[_0x7317('0x3e')][_0x7317('0x3f')]?_0x8487db['attributes']:_0x43d101[_0x7317('0x39')];if(!_0x597ed1['query'][_0x7317('0x40')](_0x7317('0x65'))){_0x8487db[_0x7317('0x41')]=qs['limit'](_0x597ed1['query']['limit']);_0x8487db['offset']=qs[_0x7317('0x1e')](_0x597ed1[_0x7317('0x3b')][_0x7317('0x1e')]);}_0x8487db[_0x7317('0x42')]=qs['sort'](_0x597ed1[_0x7317('0x3b')][_0x7317('0x43')]);_0x8487db[_0x7317('0x44')]=qs[_0x7317('0x45')](_[_0x7317('0x46')](_0x597ed1[_0x7317('0x3b')],_0x43d101[_0x7317('0x45')]));_0x8487db[_0x7317('0x44')][_0x7317('0x66')]=_0x144bf1['id'];if(_0x597ed1[_0x7317('0x3b')]['filter']){_0x8487db[_0x7317('0x44')]=_['merge'](_0x8487db[_0x7317('0x44')],{'$or':_[_0x7317('0x49')](_0x8487db[_0x7317('0x3e')],function(_0x59e1ea){var _0x2c7553={};_0x2c7553[_0x59e1ea]={'$like':'%'+_0x597ed1[_0x7317('0x3b')][_0x7317('0x47')]+'%'};return _0x2c7553;})});}_0x8487db=_['merge']({},_0x8487db,_0x597ed1[_0x7317('0x4d')]);return db['CmHopper'][_0x7317('0x1d')]({'where':_0x8487db[_0x7317('0x44')]})[_0x7317('0x24')](function(_0x2cd753){_0x432674[_0x7317('0x1d')]=_0x2cd753;if(_0x597ed1[_0x7317('0x3b')][_0x7317('0x4e')]){_0x8487db[_0x7317('0x4f')]=[{'all':!![]}];}return db[_0x7317('0x64')][_0x7317('0x50')](_0x8487db);})[_0x7317('0x24')](function(_0x5cf01b){_0x432674[_0x7317('0x51')]=_0x5cf01b;return _0x432674;});}})['then'](respondWithFilteredResult(_0x139209,_0x8487db))[_0x7317('0x52')](handleError(_0x139209,null));};exports[_0x7317('0x67')]=function(_0x2ed760,_0x44ee30,_0x441ff4){var _0x599063={'raw':!![],'where':{}};var _0x40bedd={};var _0x54637e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x7317('0x63')]({'where':{'id':_0x2ed760[_0x7317('0x54')]['id']}})['then'](handleEntityNotFound(_0x44ee30,null))[_0x7317('0x24')](function(_0x25c5d7){if(_0x25c5d7){_0x40bedd[_0x7317('0x39')]=_[_0x7317('0x3a')](db[_0x7317('0x68')][_0x7317('0x38')]);_0x40bedd[_0x7317('0x3b')]=_[_0x7317('0x3a')](_0x2ed760['query']);_0x40bedd[_0x7317('0x45')]=_[_0x7317('0x3c')](_0x40bedd['model'],_0x40bedd['query']);_0x599063[_0x7317('0x3e')]=_[_0x7317('0x3c')](_0x40bedd[_0x7317('0x39')],qs[_0x7317('0x3d')](_0x2ed760[_0x7317('0x3b')][_0x7317('0x3d')]));_0x599063[_0x7317('0x3e')]=_0x599063[_0x7317('0x3e')]['length']?_0x599063['attributes']:_0x40bedd[_0x7317('0x39')];if(!_0x2ed760[_0x7317('0x3b')]['hasOwnProperty'](_0x7317('0x65'))){_0x599063[_0x7317('0x41')]=qs[_0x7317('0x41')](_0x2ed760['query'][_0x7317('0x41')]);_0x599063[_0x7317('0x1e')]=qs[_0x7317('0x1e')](_0x2ed760[_0x7317('0x3b')][_0x7317('0x1e')]);}_0x599063[_0x7317('0x42')]=qs[_0x7317('0x43')](_0x2ed760[_0x7317('0x3b')][_0x7317('0x43')]);_0x599063['where']=qs['filters'](_['pick'](_0x2ed760[_0x7317('0x3b')],_0x40bedd['filters']));_0x599063['where'][_0x7317('0x66')]=_0x25c5d7['id'];if(_0x2ed760[_0x7317('0x3b')][_0x7317('0x47')]){_0x599063['where']=_[_0x7317('0x48')](_0x599063[_0x7317('0x44')],{'$or':_[_0x7317('0x49')](_0x599063[_0x7317('0x3e')],function(_0x38a0b9){var _0x4ee46e={};_0x4ee46e[_0x38a0b9]={'$like':'%'+_0x2ed760[_0x7317('0x3b')][_0x7317('0x47')]+'%'};return _0x4ee46e;})});}_0x599063=_[_0x7317('0x48')]({},_0x599063,_0x2ed760['options']);return db[_0x7317('0x68')]['count']({'where':_0x599063[_0x7317('0x44')]})[_0x7317('0x24')](function(_0x4b66e5){_0x54637e[_0x7317('0x1d')]=_0x4b66e5;if(_0x2ed760[_0x7317('0x3b')][_0x7317('0x4e')]){_0x599063['include']=[{'all':!![]}];}return db[_0x7317('0x68')][_0x7317('0x50')](_0x599063);})[_0x7317('0x24')](function(_0x461841){_0x54637e[_0x7317('0x51')]=_0x461841;return _0x54637e;});}})[_0x7317('0x24')](respondWithFilteredResult(_0x44ee30,_0x599063))[_0x7317('0x52')](handleError(_0x44ee30,null));};exports[_0x7317('0x69')]=function(_0x2fa08e,_0x167fb6,_0x4df0cf){var _0x175a35={'raw':!![],'where':{}};var _0x488632={};var _0x58b052={'count':0x0,'rows':[]};return db[_0x7317('0x37')][_0x7317('0x63')]({'where':{'id':_0x2fa08e[_0x7317('0x54')]['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x167fb6,null))['then'](function(_0x5e31db){if(_0x5e31db){_0x488632[_0x7317('0x39')]=_[_0x7317('0x3a')](db['CmHopperFinal'][_0x7317('0x38')]);_0x488632[_0x7317('0x3b')]=_[_0x7317('0x3a')](_0x2fa08e[_0x7317('0x3b')]);_0x488632[_0x7317('0x45')]=_[_0x7317('0x3c')](_0x488632['model'],_0x488632[_0x7317('0x3b')]);_0x175a35[_0x7317('0x3e')]=_[_0x7317('0x3c')](_0x488632['model'],qs[_0x7317('0x3d')](_0x2fa08e[_0x7317('0x3b')][_0x7317('0x3d')]));_0x175a35[_0x7317('0x3e')]=_0x175a35['attributes'][_0x7317('0x3f')]?_0x175a35[_0x7317('0x3e')]:_0x488632[_0x7317('0x39')];if(!_0x2fa08e[_0x7317('0x3b')]['hasOwnProperty'](_0x7317('0x65'))){_0x175a35[_0x7317('0x41')]=qs[_0x7317('0x41')](_0x2fa08e[_0x7317('0x3b')]['limit']);_0x175a35[_0x7317('0x1e')]=qs[_0x7317('0x1e')](_0x2fa08e[_0x7317('0x3b')][_0x7317('0x1e')]);}_0x175a35['order']=qs[_0x7317('0x43')](_0x2fa08e[_0x7317('0x3b')][_0x7317('0x43')]);_0x175a35[_0x7317('0x44')]=qs[_0x7317('0x45')](_['pick'](_0x2fa08e[_0x7317('0x3b')],_0x488632[_0x7317('0x45')]));_0x175a35['where'][_0x7317('0x66')]=_0x5e31db['id'];if(_0x2fa08e[_0x7317('0x3b')]['filter']){_0x175a35['where']=_[_0x7317('0x48')](_0x175a35[_0x7317('0x44')],{'$or':_[_0x7317('0x49')](_0x175a35[_0x7317('0x3e')],function(_0x39a79e){var _0x170380={};_0x170380[_0x39a79e]={'$like':'%'+_0x2fa08e['query'][_0x7317('0x47')]+'%'};return _0x170380;})});}_0x175a35=_[_0x7317('0x48')]({},_0x175a35,_0x2fa08e[_0x7317('0x4d')]);return db[_0x7317('0x6a')][_0x7317('0x1d')]({'where':_0x175a35['where']})[_0x7317('0x24')](function(_0x56dca1){_0x58b052[_0x7317('0x1d')]=_0x56dca1;if(_0x2fa08e[_0x7317('0x3b')][_0x7317('0x4e')]){_0x175a35[_0x7317('0x4f')]=[{'all':!![]}];}return db[_0x7317('0x6a')]['findAll'](_0x175a35);})[_0x7317('0x24')](function(_0x153a24){_0x58b052['rows']=_0x153a24;return _0x58b052;});}})[_0x7317('0x24')](respondWithFilteredResult(_0x167fb6,_0x175a35))[_0x7317('0x52')](handleError(_0x167fb6,null));};exports[_0x7317('0x6b')]=function(_0x267546,_0x11a6e3,_0xdae176){var _0x154526={'raw':!![],'where':{}};var _0x48c48e={};var _0x195d8e={'count':0x0,'rows':[]};return db[_0x7317('0x37')][_0x7317('0x63')]({'where':{'id':_0x267546[_0x7317('0x54')]['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x11a6e3,null))[_0x7317('0x24')](function(_0x27a2ea){if(_0x27a2ea){_0x48c48e['model']=_['keys'](db[_0x7317('0x6c')][_0x7317('0x38')]);_0x48c48e[_0x7317('0x3b')]=_['keys'](_0x267546[_0x7317('0x3b')]);_0x48c48e[_0x7317('0x45')]=_[_0x7317('0x3c')](_0x48c48e[_0x7317('0x39')],_0x48c48e[_0x7317('0x3b')]);_0x154526['attributes']=_[_0x7317('0x3c')](_0x48c48e[_0x7317('0x39')],qs['fields'](_0x267546[_0x7317('0x3b')]['fields']));_0x154526[_0x7317('0x3e')]=_0x154526[_0x7317('0x3e')][_0x7317('0x3f')]?_0x154526['attributes']:_0x48c48e[_0x7317('0x39')];if(!_0x267546[_0x7317('0x3b')][_0x7317('0x40')](_0x7317('0x65'))){_0x154526[_0x7317('0x41')]=qs['limit'](_0x267546[_0x7317('0x3b')]['limit']);_0x154526[_0x7317('0x1e')]=qs[_0x7317('0x1e')](_0x267546['query'][_0x7317('0x1e')]);}_0x154526[_0x7317('0x42')]=qs[_0x7317('0x43')](_0x267546[_0x7317('0x3b')][_0x7317('0x43')]);_0x154526['where']=qs[_0x7317('0x45')](_[_0x7317('0x46')](_0x267546[_0x7317('0x3b')],_0x48c48e['filters']));_0x154526[_0x7317('0x44')][_0x7317('0x66')]=_0x27a2ea['id'];if(_0x267546[_0x7317('0x3b')][_0x7317('0x47')]){_0x154526['where']=_[_0x7317('0x48')](_0x154526['where'],{'$or':_[_0x7317('0x49')](_0x154526[_0x7317('0x3e')],function(_0x55aaa1){var _0x38897d={};_0x38897d[_0x55aaa1]={'$like':'%'+_0x267546['query'][_0x7317('0x47')]+'%'};return _0x38897d;})});}_0x154526=_['merge']({},_0x154526,_0x267546['options']);return db[_0x7317('0x6c')][_0x7317('0x1d')]({'where':_0x154526['where']})['then'](function(_0x2f4026){_0x195d8e[_0x7317('0x1d')]=_0x2f4026;if(_0x267546[_0x7317('0x3b')][_0x7317('0x4e')]){_0x154526[_0x7317('0x4f')]=[{'all':!![]}];}return db[_0x7317('0x6c')]['findAll'](_0x154526);})[_0x7317('0x24')](function(_0x14d48f){_0x195d8e['rows']=_0x14d48f;return _0x195d8e;});}})[_0x7317('0x24')](respondWithFilteredResult(_0x11a6e3,_0x154526))['catch'](handleError(_0x11a6e3,null));};exports[_0x7317('0x6d')]=function(_0x5275b2,_0x2a8fd3,_0x1e6dee){var _0x165958={};var _0x328eb9={};var _0x332f4b;var _0x42c6a1;return db[_0x7317('0x37')][_0x7317('0x63')]({'where':{'id':_0x5275b2['params']['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x2a8fd3,null))[_0x7317('0x24')](function(_0x2bc129){if(_0x2bc129){_0x332f4b=_0x2bc129;_0x328eb9[_0x7317('0x39')]=_[_0x7317('0x3a')](db[_0x7317('0x6e')][_0x7317('0x38')]);_0x328eb9[_0x7317('0x3b')]=_[_0x7317('0x3a')](_0x5275b2[_0x7317('0x3b')]);_0x328eb9[_0x7317('0x45')]=_[_0x7317('0x3c')](_0x328eb9[_0x7317('0x39')],_0x328eb9[_0x7317('0x3b')]);_0x165958['attributes']=_[_0x7317('0x3c')](_0x328eb9[_0x7317('0x39')],qs[_0x7317('0x3d')](_0x5275b2[_0x7317('0x3b')][_0x7317('0x3d')]));_0x165958[_0x7317('0x3e')]=_0x165958[_0x7317('0x3e')][_0x7317('0x3f')]?_0x165958[_0x7317('0x3e')]:_0x328eb9[_0x7317('0x39')];_0x165958['order']=qs[_0x7317('0x43')](_0x5275b2[_0x7317('0x3b')][_0x7317('0x43')]);_0x165958[_0x7317('0x44')]=qs[_0x7317('0x45')](_[_0x7317('0x46')](_0x5275b2['query'],_0x328eb9[_0x7317('0x45')]));if(_0x5275b2[_0x7317('0x3b')][_0x7317('0x47')]){_0x165958[_0x7317('0x44')]=_[_0x7317('0x48')](_0x165958[_0x7317('0x44')],{'$or':_[_0x7317('0x49')](_0x165958[_0x7317('0x3e')],function(_0x4d631e){var _0x89d2e1={};_0x89d2e1[_0x4d631e]={'$like':'%'+_0x5275b2[_0x7317('0x3b')][_0x7317('0x47')]+'%'};return _0x89d2e1;})});}_0x165958=_[_0x7317('0x48')]({},_0x165958,_0x5275b2[_0x7317('0x4d')]);return _0x332f4b[_0x7317('0x6d')](_0x165958);}})[_0x7317('0x24')](function(_0x1f5f5e){if(_0x1f5f5e){_0x42c6a1=_0x1f5f5e['length'];if(!_0x5275b2['query']['hasOwnProperty'](_0x7317('0x65'))){_0x165958[_0x7317('0x41')]=qs[_0x7317('0x41')](_0x5275b2[_0x7317('0x3b')]['limit']);_0x165958['offset']=qs['offset'](_0x5275b2[_0x7317('0x3b')]['offset']);}return _0x332f4b[_0x7317('0x6d')](_0x165958);}})[_0x7317('0x24')](function(_0x17641f){if(_0x17641f){return _0x17641f?{'count':_0x42c6a1,'rows':_0x17641f}:null;}})[_0x7317('0x24')](respondWithResult(_0x2a8fd3,null))[_0x7317('0x52')](handleError(_0x2a8fd3,null));};exports['addTeams']=function(_0x289c15,_0x22c1a5,_0x2f9cc6){var _0x14d1a6=[];var _0x491250;return db[_0x7317('0x6e')]['findAll']({'where':{'id':_0x289c15[_0x7317('0x56')][_0x7317('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x7317('0x70')],'as':_0x7317('0x71'),'attributes':['id'],'raw':!![]}]})[_0x7317('0x24')](function(_0x56cdae){if(_0x56cdae){for(var _0x23cba8=0x0;_0x23cba8<_0x56cdae[_0x7317('0x3f')];_0x23cba8+=0x1){for(var _0x301c59=0x0;_0x301c59<_0x56cdae[_0x23cba8][_0x7317('0x71')][_0x7317('0x3f')];_0x301c59+=0x1){_0x14d1a6=_['union'](_0x14d1a6,[_0x56cdae[_0x23cba8]['Agents'][_0x301c59]['id']]);}}return _0x14d1a6;}})[_0x7317('0x24')](function(_0x38e30f){if(_0x38e30f){return db[_0x7317('0x37')][_0x7317('0x2f')]({'where':{'id':_0x289c15['params']['id']}});}})[_0x7317('0x24')](function(_0x136e3d){if(_0x136e3d){_0x491250=_0x136e3d;return _0x491250[_0x7317('0x72')](_0x14d1a6,{'penalty':_0x289c15[_0x7317('0x56')][_0x7317('0x73')]});}})[_0x7317('0x24')](function(_0x574b1f){if(_0x574b1f){return _0x491250[_0x7317('0x74')](_0x289c15['body'][_0x7317('0x6f')]);}})[_0x7317('0x24')](handleEntityNotFound(_0x22c1a5,null))[_0x7317('0x24')](respondWithStatusCode(_0x22c1a5,null))[_0x7317('0x52')](handleError(_0x22c1a5,null));};exports['removeTeams']=function(_0x16c4f5,_0x452407,_0x35ff28){var _0x28c51e=[];var _0xe9a10a;return db['Team'][_0x7317('0x50')]({'where':{'id':_0x16c4f5['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7317('0x24')](function(_0x2f37fb){if(_0x2f37fb){for(var _0x4ae5b0=0x0;_0x4ae5b0<_0x2f37fb[_0x7317('0x3f')];_0x4ae5b0+=0x1){for(var _0x270fc5=0x0;_0x270fc5<_0x2f37fb[_0x4ae5b0]['Agents'][_0x7317('0x3f')];_0x270fc5+=0x1){_0x28c51e=_[_0x7317('0x75')](_0x28c51e,[_0x2f37fb[_0x4ae5b0]['Agents'][_0x270fc5]['id']]);}}return _0x28c51e;}})[_0x7317('0x24')](function(_0x23d450){if(_0x23d450){return db[_0x7317('0x37')][_0x7317('0x2f')]({'where':{'id':_0x16c4f5[_0x7317('0x54')]['id']}});}})[_0x7317('0x24')](function(_0x34150f){if(_0x34150f){_0xe9a10a=_0x34150f;return _0xe9a10a['removeAgents'](_0x28c51e);}})['then'](function(_0x24d07c){if(_0xe9a10a){return _0xe9a10a[_0x7317('0x76')](_0x16c4f5[_0x7317('0x3b')][_0x7317('0x6f')]);}})[_0x7317('0x24')](handleEntityNotFound(_0x452407,null))[_0x7317('0x24')](respondWithStatusCode(_0x452407,null))[_0x7317('0x52')](handleError(_0x452407,null));};exports[_0x7317('0x72')]=function(_0x5c0927,_0x1ff619,_0x7be2b8){var _0x177481,_0x3dbb32;return db['VoiceQueue'][_0x7317('0x2f')]({'where':{'id':_0x5c0927['params']['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x1ff619,null))[_0x7317('0x24')](function(_0x1a5d21){if(_0x1a5d21){_0x3dbb32=_0x1a5d21;return _0x1a5d21['addAgents'](_0x5c0927[_0x7317('0x56')]['ids'],_[_0x7317('0x5d')](_0x5c0927['body'],[_0x7317('0x6f'),'id'])||{})[_0x7317('0x77')](function(_0x56cef3){for(var _0x3ec2aa=0x0;_0x3ec2aa<_0x5c0927[_0x7317('0x56')][_0x7317('0x6f')][_0x7317('0x3f')];_0x3ec2aa+=0x1){socket[_0x7317('0x78')](_0x7317('0x79'),{'UserId':_0x5c0927['body'][_0x7317('0x6f')][_0x3ec2aa],'VoiceQueueId':_0x5c0927[_0x7317('0x54')]['id']});}return _0x56cef3;});}})[_0x7317('0x24')](function(_0x33ecef){_0x177481=_0x33ecef||[];if(_0x3dbb32){return db[_0x7317('0x70')][_0x7317('0x50')]({'where':{'id':_0x5c0927[_0x7317('0x56')][_0x7317('0x6f')]},'attributes':['id',_0x7317('0x30'),'loginInPause',_0x7317('0x7a'),_0x7317('0x7b')],'raw':!![]});}})['then'](function(_0x24b5a1){if(_0x24b5a1&&_0x24b5a1[_0x7317('0x3f')]){var _0x1707a7=[];for(var _0x1aeb36=0x0;_0x1aeb36<_0x24b5a1[_0x7317('0x3f')];_0x1aeb36++){_0x1707a7[_0x7317('0x7c')](db[_0x7317('0x7d')][_0x7317('0x7e')]({'membername':_0x24b5a1[_0x1aeb36][_0x7317('0x30')],'UserId':_0x24b5a1[_0x1aeb36]['id'],'queue_name':_0x3dbb32[_0x7317('0x30')],'VoiceQueueId':_0x3dbb32['id'],'interface':_['isNil'](_0x24b5a1[_0x1aeb36]['interface'])?util[_0x7317('0x7f')]('SIP/%s',_0x24b5a1[_0x1aeb36][_0x7317('0x30')]):_0x24b5a1[_0x1aeb36][_0x7317('0x7b')],'paused':_0x24b5a1[_0x1aeb36][_0x7317('0x7a')]||![],'penalty':_0x5c0927[_0x7317('0x56')][_0x7317('0x73')]||0x0}));}return BPromise[_0x7317('0x80')](_0x1707a7);}})[_0x7317('0x24')](function(_0x45cf15){return _0x177481;})[_0x7317('0x24')](respondWithResult(_0x1ff619,null))[_0x7317('0x52')](handleError(_0x1ff619,null));};exports[_0x7317('0x81')]=function(_0x3f705c,_0x282af0,_0x1618a5){var _0x28f76b;return db[_0x7317('0x37')][_0x7317('0x2f')]({'where':{'id':_0x3f705c['params']['id']}})['then'](handleEntityNotFound(_0x282af0,null))[_0x7317('0x24')](function(_0x2186b2){if(_0x2186b2){return _0x2186b2['removeAgents'](_0x3f705c['query'][_0x7317('0x6f')])[_0x7317('0x24')](function(_0x243b94){if(_[_0x7317('0x82')](_0x3f705c[_0x7317('0x3b')]['ids'])){for(var _0x320b5c=0x0;_0x320b5c<_0x3f705c['query'][_0x7317('0x6f')][_0x7317('0x3f')];_0x320b5c+=0x1){socket[_0x7317('0x78')](_0x7317('0x83'),{'UserId':_0x3f705c[_0x7317('0x3b')][_0x7317('0x6f')][_0x320b5c],'VoiceQueueId':_0x3f705c[_0x7317('0x54')]['id']});}}else{socket[_0x7317('0x78')](_0x7317('0x83'),{'UserId':_0x3f705c[_0x7317('0x3b')][_0x7317('0x6f')],'VoiceQueueId':_0x3f705c[_0x7317('0x54')]['id']});}});}})[_0x7317('0x24')](function(_0x4d28a9){if(_0x3f705c['query'][_0x7317('0x84')]){_0x28f76b=_0x4d28a9;return db[_0x7317('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x3f705c[_0x7317('0x54')]['id'],'UserId':_0x3f705c[_0x7317('0x3b')]['ids']}})[_0x7317('0x24')](function(){return _0x28f76b;});}})['then'](respondWithStatusCode(_0x282af0,null))[_0x7317('0x52')](handleError(_0x282af0,null));};exports[_0x7317('0x85')]=function(_0x5df21c,_0x10fe84,_0x1dd627){var _0x131e72={};var _0x3b21a2={};var _0x3a4580;var _0x27640a;return db[_0x7317('0x37')][_0x7317('0x63')]({'where':{'id':_0x5df21c[_0x7317('0x54')]['id']}})['then'](handleEntityNotFound(_0x10fe84,null))[_0x7317('0x24')](function(_0x4a90fb){if(_0x4a90fb){_0x3a4580=_0x4a90fb;_0x3b21a2[_0x7317('0x39')]=_['keys'](db[_0x7317('0x70')][_0x7317('0x38')]);_0x3b21a2[_0x7317('0x3b')]=_[_0x7317('0x3a')](_0x5df21c[_0x7317('0x3b')]);_0x3b21a2['filters']=_[_0x7317('0x3c')](_0x3b21a2[_0x7317('0x39')],_0x3b21a2[_0x7317('0x3b')]);_0x131e72[_0x7317('0x3e')]=_['intersection'](_0x3b21a2[_0x7317('0x39')],qs['fields'](_0x5df21c[_0x7317('0x3b')][_0x7317('0x3d')]));_0x131e72[_0x7317('0x3e')]=_0x131e72[_0x7317('0x3e')][_0x7317('0x3f')]?_0x131e72[_0x7317('0x3e')]:_0x3b21a2['model'];_0x131e72[_0x7317('0x42')]=qs['sort'](_0x5df21c[_0x7317('0x3b')][_0x7317('0x43')]);_0x131e72[_0x7317('0x44')]=qs['filters'](_[_0x7317('0x46')](_0x5df21c['query'],_0x3b21a2[_0x7317('0x45')]));if(_0x5df21c['query'][_0x7317('0x47')]){_0x131e72[_0x7317('0x44')]=_[_0x7317('0x48')](_0x131e72[_0x7317('0x44')],{'$or':_[_0x7317('0x49')](_0x131e72[_0x7317('0x3e')],function(_0x38472a){var _0x23c889={};_0x23c889[_0x38472a]={'$like':'%'+_0x5df21c[_0x7317('0x3b')][_0x7317('0x47')]+'%'};return _0x23c889;})});}_0x131e72=_[_0x7317('0x48')]({},_0x131e72,_0x5df21c[_0x7317('0x4d')]);return _0x3a4580['getAgents'](_0x131e72);}})['then'](function(_0x48cfaa){if(_0x48cfaa){_0x27640a=_0x48cfaa[_0x7317('0x3f')];if(!_0x5df21c[_0x7317('0x3b')][_0x7317('0x40')]('nolimit')){_0x131e72[_0x7317('0x41')]=qs[_0x7317('0x41')](_0x5df21c[_0x7317('0x3b')][_0x7317('0x41')]);_0x131e72[_0x7317('0x1e')]=qs['offset'](_0x5df21c[_0x7317('0x3b')]['offset']);}return _0x3a4580['getAgents'](_0x131e72);}})['then'](function(_0x19ebaf){if(_0x19ebaf){return _0x19ebaf?{'count':_0x27640a,'rows':_0x19ebaf}:null;}})[_0x7317('0x24')](respondWithResult(_0x10fe84,null))[_0x7317('0x52')](handleError(_0x10fe84,null));};exports['getMembers']=function(_0x1a7f3b,_0x3b91c9,_0x361874){var _0x25ba75={};var _0x3aa9e7={};var _0x33b0c7;var _0x42f251;return db['VoiceQueue'][_0x7317('0x63')]({'where':{'id':_0x1a7f3b['params']['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x3b91c9,null))[_0x7317('0x24')](function(_0x588492){if(_0x588492){_0x33b0c7=_0x588492;_0x3aa9e7[_0x7317('0x39')]=_[_0x7317('0x3a')](db[_0x7317('0x7d')][_0x7317('0x38')]);_0x3aa9e7['query']=_[_0x7317('0x3a')](_0x1a7f3b[_0x7317('0x3b')]);_0x3aa9e7[_0x7317('0x45')]=_['intersection'](_0x3aa9e7[_0x7317('0x39')],_0x3aa9e7[_0x7317('0x3b')]);_0x25ba75['attributes']=_[_0x7317('0x3c')](_0x3aa9e7[_0x7317('0x39')],qs['fields'](_0x1a7f3b[_0x7317('0x3b')][_0x7317('0x3d')]));_0x25ba75[_0x7317('0x3e')]=_0x25ba75[_0x7317('0x3e')][_0x7317('0x3f')]?_0x25ba75[_0x7317('0x3e')]:_0x3aa9e7[_0x7317('0x39')];_0x25ba75[_0x7317('0x42')]=qs[_0x7317('0x43')](_0x1a7f3b[_0x7317('0x3b')][_0x7317('0x43')]);_0x25ba75[_0x7317('0x44')]=qs[_0x7317('0x45')](_[_0x7317('0x46')](_0x1a7f3b[_0x7317('0x3b')],_0x3aa9e7[_0x7317('0x45')]));if(_0x1a7f3b[_0x7317('0x3b')][_0x7317('0x47')]){_0x25ba75['where']=_[_0x7317('0x48')](_0x25ba75[_0x7317('0x44')],{'$or':_[_0x7317('0x49')](_0x25ba75[_0x7317('0x3e')],function(_0x39bdd6){var _0xd4419b={};_0xd4419b[_0x39bdd6]={'$like':'%'+_0x1a7f3b[_0x7317('0x3b')][_0x7317('0x47')]+'%'};return _0xd4419b;})});}_0x25ba75=_[_0x7317('0x48')]({},_0x25ba75,_0x1a7f3b[_0x7317('0x4d')]);return _0x33b0c7['getMembers'](_0x25ba75);}})[_0x7317('0x24')](function(_0x257b0e){if(_0x257b0e){_0x42f251=_0x257b0e[_0x7317('0x3f')];if(!_0x1a7f3b[_0x7317('0x3b')]['hasOwnProperty'](_0x7317('0x65'))){_0x25ba75[_0x7317('0x41')]=qs[_0x7317('0x41')](_0x1a7f3b[_0x7317('0x3b')][_0x7317('0x41')]);_0x25ba75['offset']=qs[_0x7317('0x1e')](_0x1a7f3b[_0x7317('0x3b')][_0x7317('0x1e')]);}return _0x33b0c7[_0x7317('0x86')](_0x25ba75);}})[_0x7317('0x24')](function(_0x5957d8){return _0x5957d8?{'count':_0x42f251,'rows':_0x5957d8}:null;})[_0x7317('0x24')](respondWithResult(_0x3b91c9,null))[_0x7317('0x52')](handleError(_0x3b91c9,null));};exports[_0x7317('0x87')]=function(_0x433022,_0x16e267,_0x290649){var _0x5a2568={};var _0xc163b0={};var _0x3e4ee0;var _0x2deef7;return db[_0x7317('0x37')][_0x7317('0x63')]({'where':{'id':_0x433022['params']['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x16e267,null))[_0x7317('0x24')](function(_0x30ae18){if(_0x30ae18){_0x3e4ee0=_0x30ae18;_0xc163b0[_0x7317('0x39')]=_[_0x7317('0x3a')](db[_0x7317('0x88')]['rawAttributes']);_0xc163b0[_0x7317('0x3b')]=_[_0x7317('0x3a')](_0x433022[_0x7317('0x3b')]);_0xc163b0[_0x7317('0x45')]=_['intersection'](_0xc163b0[_0x7317('0x39')],_0xc163b0['query']);_0x5a2568[_0x7317('0x3e')]=_[_0x7317('0x3c')](_0xc163b0[_0x7317('0x39')],qs['fields'](_0x433022['query'][_0x7317('0x3d')]));_0x5a2568[_0x7317('0x3e')]=_0x5a2568[_0x7317('0x3e')][_0x7317('0x3f')]?_0x5a2568[_0x7317('0x3e')]:_0xc163b0[_0x7317('0x39')];_0x5a2568[_0x7317('0x42')]=qs[_0x7317('0x43')](_0x433022[_0x7317('0x3b')][_0x7317('0x43')]);_0x5a2568['where']=qs[_0x7317('0x45')](_[_0x7317('0x46')](_0x433022[_0x7317('0x3b')],_0xc163b0[_0x7317('0x45')]));if(_0x433022[_0x7317('0x3b')][_0x7317('0x47')]){_0x5a2568[_0x7317('0x44')]=_[_0x7317('0x48')](_0x5a2568[_0x7317('0x44')],{'$or':_['map'](_0x5a2568[_0x7317('0x3e')],function(_0x16ea1e){var _0x5ead46={};_0x5ead46[_0x16ea1e]={'$like':'%'+_0x433022['query'][_0x7317('0x47')]+'%'};return _0x5ead46;})});}_0x5a2568=_[_0x7317('0x48')]({},_0x5a2568,_0x433022[_0x7317('0x4d')]);return _0x3e4ee0['getLists'](_0x5a2568);}})[_0x7317('0x24')](function(_0x32089b){if(_0x32089b){_0x2deef7=_0x32089b[_0x7317('0x3f')];if(!_0x433022[_0x7317('0x3b')][_0x7317('0x40')](_0x7317('0x65'))){_0x5a2568[_0x7317('0x41')]=qs[_0x7317('0x41')](_0x433022[_0x7317('0x3b')][_0x7317('0x41')]);_0x5a2568['offset']=qs[_0x7317('0x1e')](_0x433022[_0x7317('0x3b')][_0x7317('0x1e')]);}return _0x3e4ee0[_0x7317('0x87')](_0x5a2568);}})['then'](function(_0x15b8f6){if(_0x15b8f6){return _0x15b8f6?{'count':_0x2deef7,'rows':_0x15b8f6}:null;}})['then'](respondWithResult(_0x16e267,null))[_0x7317('0x52')](handleError(_0x16e267,null));};exports[_0x7317('0x89')]=function(_0x24bbc3,_0x4215f7,_0x4edb78){var _0x202ec8,_0x2d972a;return db[_0x7317('0x37')]['find']({'where':{'id':_0x24bbc3['params']['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x4215f7,null))[_0x7317('0x24')](function(_0x316d7f){if(_0x316d7f){_0x2d972a=_0x316d7f;return _0x316d7f[_0x7317('0x89')](_0x24bbc3['body']['ids'],_[_0x7317('0x5d')](_0x24bbc3[_0x7317('0x56')],[_0x7317('0x6f'),'id'])||{});}return null;})[_0x7317('0x77')](function(_0x3ced2f){var _0xcaed71;_0x202ec8=_0x3ced2f||[];var _0x2d6550=[];if(_0x3ced2f){for(var _0x2e6d9c=0x0;_0x2e6d9c<_0x3ced2f['length'];_0x2e6d9c+=0x1){var _0x160a97=_0x3ced2f[_0x2e6d9c][_0x7317('0x26')]({'plain':!![]});_0x2d972a['dialCheckDuplicateType']=_0x24bbc3[_0x7317('0x56')][_0x7317('0x8a')]?_0x24bbc3[_0x7317('0x56')]['dialCheckDuplicateType']:_0x2d972a[_0x7317('0x8a')];switch(_0x2d972a[_0x7317('0x8a')]){case _0x7317('0x8b'):_0xcaed71=squel['insert']()[_0x7317('0x8c')](_0x7317('0x8d'))['fromQuery']([_0x7317('0x8e'),_0x7317('0x8f'),'ContactId',_0x7317('0x90'),'VoiceQueueId',_0x7317('0x5f'),_0x7317('0x5e')],squel[_0x7317('0x91')]()[_0x7317('0x4c')]('phone',_0x7317('0x8e'))[_0x7317('0x4c')](_0x7317('0x92'),_0x7317('0x8f'))['field']('id',_0x7317('0x93'))['field'](_0x160a97[_0x7317('0x94')][_0x7317('0x95')](),_0x7317('0x90'))[_0x7317('0x4c')](_0x24bbc3['params']['id']['toString'](),_0x7317('0x66'))['field'](_0x7317('0x92'),_0x7317('0x5f'))[_0x7317('0x4c')](_0x7317('0x92'),_0x7317('0x5e'))[_0x7317('0x96')](_0x7317('0x97'))['where']('deletedAt\x20IS\x20NULL')[_0x7317('0x44')](_0x7317('0x98'),_0x160a97[_0x7317('0x94')][_0x7317('0x95')]())[_0x7317('0x44')](_0x7317('0x99'))[_0x7317('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7317('0x91')]()[_0x7317('0x4c')](_0x7317('0x9a'))['from']('cm_hopper_final')[_0x7317('0x44')](_0x7317('0x9b'),_0x24bbc3[_0x7317('0x54')]['id'][_0x7317('0x95')]()))[_0x7317('0x44')](_0x7317('0x9c'),squel[_0x7317('0x91')]()[_0x7317('0x4c')]('COALESCE(phone,\x27\x27)')[_0x7317('0x96')](_0x7317('0x8d'))[_0x7317('0x44')]('VoiceQueueId\x20=\x20?',_0x24bbc3['params']['id'][_0x7317('0x95')]())))[_0x7317('0x95')]();break;case'onlyIfOpen':_0xcaed71=squel[_0x7317('0x9d')]()[_0x7317('0x8c')]('cm_hopper')[_0x7317('0x9e')]([_0x7317('0x8e'),_0x7317('0x8f'),_0x7317('0x93'),_0x7317('0x90'),_0x7317('0x66'),'createdAt',_0x7317('0x5e')],squel[_0x7317('0x91')]()['field'](_0x7317('0x8e'),_0x7317('0x8e'))[_0x7317('0x4c')]('NOW()','scheduledAt')[_0x7317('0x4c')]('id','ContactId')[_0x7317('0x4c')](_0x160a97[_0x7317('0x94')][_0x7317('0x95')](),_0x7317('0x90'))[_0x7317('0x4c')](_0x24bbc3[_0x7317('0x54')]['id'][_0x7317('0x95')](),_0x7317('0x66'))[_0x7317('0x4c')](_0x7317('0x92'),_0x7317('0x5f'))['field'](_0x7317('0x92'),'updatedAt')[_0x7317('0x96')](_0x7317('0x97'))['where'](_0x7317('0x9f'))['where'](_0x7317('0x98'),_0x160a97['CmListId']['toString']())[_0x7317('0x44')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7317('0x4c')]('COALESCE(phone,\x27\x27)')[_0x7317('0x96')](_0x7317('0x8d'))[_0x7317('0x44')](_0x7317('0x9b'),_0x24bbc3['params']['id'][_0x7317('0x95')]())))[_0x7317('0x95')]();break;default:_0xcaed71=squel[_0x7317('0x9d')]()[_0x7317('0x8c')]('cm_hopper')[_0x7317('0x9e')]([_0x7317('0x8e'),_0x7317('0x8f'),_0x7317('0x93'),'ListId',_0x7317('0x66'),'createdAt',_0x7317('0x5e')],squel[_0x7317('0x91')]()[_0x7317('0x4c')](_0x7317('0x8e'),'phone')[_0x7317('0x4c')]('NOW()',_0x7317('0x8f'))[_0x7317('0x4c')]('id',_0x7317('0x93'))['field'](_0x160a97[_0x7317('0x94')]['toString'](),_0x7317('0x90'))['field'](_0x24bbc3[_0x7317('0x54')]['id']['toString'](),_0x7317('0x66'))['field'](_0x7317('0x92'),_0x7317('0x5f'))[_0x7317('0x4c')](_0x7317('0x92'),'updatedAt')[_0x7317('0x96')]('cm_contacts')[_0x7317('0x44')](_0x7317('0x9f'))['where'](_0x7317('0x98'),_0x160a97[_0x7317('0x94')]['toString']())[_0x7317('0x44')](_0x7317('0x99')))[_0x7317('0x95')]();}_0x2d6550[_0x7317('0x7c')](db[_0x7317('0xa0')][_0x7317('0x3b')](_0xcaed71));}return BPromise[_0x7317('0x80')](_0x2d6550);}})[_0x7317('0x24')](function(){return _0x202ec8;})[_0x7317('0x24')](respondWithResult(_0x4215f7,null))[_0x7317('0x52')](handleError(_0x4215f7,null));};exports[_0x7317('0xa1')]=function(_0x3da544,_0x292d09,_0x1628d0){var _0x396018;return db[_0x7317('0x37')][_0x7317('0x2f')]({'where':{'id':_0x3da544['params']['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x292d09,null))[_0x7317('0x24')](function(_0x9d427a){if(_0x9d427a){return _0x9d427a[_0x7317('0xa1')](_0x3da544[_0x7317('0x3b')][_0x7317('0x6f')]);}})[_0x7317('0x24')](function(_0x2a628a){if(_0x2a628a){_0x396018=_0x2a628a;return db[_0x7317('0x64')][_0x7317('0x25')]({'where':{'ListId':_0x3da544[_0x7317('0x3b')]['ids'],'VoiceQueueId':_0x3da544[_0x7317('0x54')]['id']}})['then'](function(){return _0x396018;});}})[_0x7317('0x24')](respondWithStatusCode(_0x292d09,null))[_0x7317('0x52')](handleError(_0x292d09,null));};exports[_0x7317('0xa2')]=function(_0xbfd485,_0x175c72,_0x55d875){var _0x1a65a7={};var _0x351431={};var _0x57c667;var _0x3075fa;return db[_0x7317('0x37')][_0x7317('0x63')]({'where':{'id':_0xbfd485[_0x7317('0x54')]['id']}})[_0x7317('0x24')](handleEntityNotFound(_0x175c72,null))[_0x7317('0x24')](function(_0x552e4f){if(_0x552e4f){_0x57c667=_0x552e4f;_0x351431[_0x7317('0x39')]=_[_0x7317('0x3a')](db[_0x7317('0x88')][_0x7317('0x38')]);_0x351431[_0x7317('0x3b')]=_[_0x7317('0x3a')](_0xbfd485[_0x7317('0x3b')]);_0x351431['filters']=_['intersection'](_0x351431[_0x7317('0x39')],_0x351431[_0x7317('0x3b')]);_0x1a65a7['attributes']=_[_0x7317('0x3c')](_0x351431[_0x7317('0x39')],qs[_0x7317('0x3d')](_0xbfd485[_0x7317('0x3b')]['fields']));_0x1a65a7[_0x7317('0x3e')]=_0x1a65a7[_0x7317('0x3e')][_0x7317('0x3f')]?_0x1a65a7['attributes']:_0x351431[_0x7317('0x39')];_0x1a65a7[_0x7317('0x42')]=qs['sort'](_0xbfd485[_0x7317('0x3b')][_0x7317('0x43')]);_0x1a65a7['where']=qs[_0x7317('0x45')](_[_0x7317('0x46')](_0xbfd485[_0x7317('0x3b')],_0x351431[_0x7317('0x45')]));if(_0xbfd485[_0x7317('0x3b')][_0x7317('0x47')]){_0x1a65a7[_0x7317('0x44')]=_['merge'](_0x1a65a7[_0x7317('0x44')],{'$or':_['map'](_0x1a65a7[_0x7317('0x3e')],function(_0x514427){var _0x565554={};_0x565554[_0x514427]={'$like':'%'+_0xbfd485['query'][_0x7317('0x47')]+'%'};return _0x565554;})});}_0x1a65a7=_[_0x7317('0x48')]({},_0x1a65a7,_0xbfd485[_0x7317('0x4d')]);return _0x57c667['getBlackLists'](_0x1a65a7);}})[_0x7317('0x24')](function(_0x594f92){if(_0x594f92){_0x3075fa=_0x594f92[_0x7317('0x3f')];if(!_0xbfd485[_0x7317('0x3b')][_0x7317('0x40')](_0x7317('0x65'))){_0x1a65a7[_0x7317('0x41')]=qs['limit'](_0xbfd485[_0x7317('0x3b')]['limit']);_0x1a65a7[_0x7317('0x1e')]=qs[_0x7317('0x1e')](_0xbfd485[_0x7317('0x3b')][_0x7317('0x1e')]);}return _0x57c667[_0x7317('0xa2')](_0x1a65a7);}})[_0x7317('0x24')](function(_0x26fbac){if(_0x26fbac){return _0x26fbac?{'count':_0x3075fa,'rows':_0x26fbac}:null;}})[_0x7317('0x24')](respondWithResult(_0x175c72,null))[_0x7317('0x52')](handleError(_0x175c72,null));};exports[_0x7317('0xa3')]=function(_0x9f5797,_0x4efd6d,_0x4e778d){var _0x496633,_0x489a0b;return db[_0x7317('0x37')][_0x7317('0x2f')]({'where':{'id':_0x9f5797[_0x7317('0x54')]['id']}})['then'](handleEntityNotFound(_0x4efd6d,null))[_0x7317('0x24')](function(_0x22ded4){if(_0x22ded4){_0x489a0b=_0x22ded4;return _0x22ded4[_0x7317('0xa3')](_0x9f5797[_0x7317('0x56')][_0x7317('0x6f')],_[_0x7317('0x5d')](_0x9f5797['body'],[_0x7317('0x6f'),'id'])||{});}return null;})['spread'](function(_0x36d5be){var _0x3c5d44;_0x496633=_0x36d5be||[];var _0x1ad6bd=[];if(_0x36d5be){for(var _0xafef07=0x0;_0xafef07<_0x36d5be[_0x7317('0x3f')];_0xafef07+=0x1){var _0x296c33=_0x36d5be[_0xafef07]['get']({'plain':!![]});_0x3c5d44=squel[_0x7317('0x9d')]()[_0x7317('0x8c')](_0x7317('0xa4'))[_0x7317('0x9e')]([_0x7317('0x8e'),'ContactId','ListId',_0x7317('0x66'),_0x7317('0x5f'),'updatedAt'],squel[_0x7317('0x91')]()[_0x7317('0x4c')](_0x7317('0x8e'),_0x7317('0x8e'))[_0x7317('0x4c')]('id',_0x7317('0x93'))[_0x7317('0x4c')](_0x296c33[_0x7317('0x94')][_0x7317('0x95')](),_0x7317('0x90'))[_0x7317('0x4c')](_0x9f5797[_0x7317('0x54')]['id'][_0x7317('0x95')](),'VoiceQueueId')['field'](_0x7317('0x92'),_0x7317('0x5f'))[_0x7317('0x4c')](_0x7317('0x92'),_0x7317('0x5e'))[_0x7317('0x96')](_0x7317('0x97'))['where'](_0x7317('0x9f'))[_0x7317('0x44')]('ListId\x20=\x20?',_0x296c33[_0x7317('0x94')][_0x7317('0x95')]())[_0x7317('0x44')](_0x7317('0x99')))[_0x7317('0x95')]();_0x1ad6bd[_0x7317('0x7c')](db[_0x7317('0xa0')][_0x7317('0x3b')](_0x3c5d44));}return BPromise[_0x7317('0x80')](_0x1ad6bd);}})[_0x7317('0x24')](function(){return _0x496633;})['then'](respondWithResult(_0x4efd6d,null))['catch'](handleError(_0x4efd6d,null));};exports[_0x7317('0xa5')]=function(_0x41422e,_0x21db30,_0x2c6336){var _0x4c5dd1;return db['VoiceQueue'][_0x7317('0x2f')]({'where':{'id':_0x41422e[_0x7317('0x54')]['id']}})['then'](handleEntityNotFound(_0x21db30,null))[_0x7317('0x24')](function(_0x58c944){if(_0x58c944){return _0x58c944[_0x7317('0xa5')](_0x41422e[_0x7317('0x3b')][_0x7317('0x6f')]);}})['then'](function(_0x3fa819){if(_0x3fa819){_0x4c5dd1=_0x3fa819;return db[_0x7317('0x6c')]['destroy']({'where':{'ListId':_0x41422e['query']['ids'],'VoiceQueueId':_0x41422e[_0x7317('0x54')]['id']}})['then'](function(){return _0x4c5dd1;});}})[_0x7317('0x24')](respondWithStatusCode(_0x21db30,null))['catch'](handleError(_0x21db30,null));}; \ No newline at end of file +var _0x56e9=['crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','set','reject','destroy','then','get','VoiceQueues','QueueCampaigns','outbound','value','type','name','error','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','includeAll','include','VoiceQueue','findAll','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','find','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','update','getHoppers','findOne','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','ids','User','Agents','union','addAgents','removeTeams','emit','userVoiceQueue:save','loginInPause','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','penalty','removeAgents','userVoiceQueue:remove','realtime','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','into','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','toString','from','cm_contacts','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','insert','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x56e9,0x1da));var _0x956e=function(_0x21c130,_0x225833){_0x21c130=_0x21c130-0x0;var _0x58f574=_0x56e9[_0x21c130];return _0x58f574;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x956e('0x0'));var rimraf=require(_0x956e('0x1'));var zipdir=require(_0x956e('0x2'));var jsonpatch=require(_0x956e('0x3'));var rp=require(_0x956e('0x4'));var moment=require(_0x956e('0x5'));var BPromise=require(_0x956e('0x6'));var Mustache=require(_0x956e('0x7'));var util=require(_0x956e('0x8'));var path=require('path');var sox=require(_0x956e('0x9'));var csv=require(_0x956e('0xa'));var ejs=require(_0x956e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x956e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x956e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x956e('0xe'));var hardwareService=require(_0x956e('0xf'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x956e('0x10'))(_0x956e('0x11'));var utils=require(_0x956e('0x12'));var config=require(_0x956e('0x13'));var db=require(_0x956e('0x14'))['db'];config[_0x956e('0x15')]=_[_0x956e('0x16')](config[_0x956e('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x956e('0x17'))(new Redis(config[_0x956e('0x15')]));require(_0x956e('0x18'))[_0x956e('0x19')](socket);function respondWithStatusCode(_0x35255b,_0xc7fd5f){_0xc7fd5f=_0xc7fd5f||0xcc;return function(_0x3857e6){if(_0x3857e6){return _0x35255b[_0x956e('0x1a')](_0xc7fd5f);}return _0x35255b[_0x956e('0x1b')](_0xc7fd5f)[_0x956e('0x1c')]();};}function respondWithResult(_0x2200b1,_0x261a57){_0x261a57=_0x261a57||0xc8;return function(_0x5543a1){if(_0x5543a1){return _0x2200b1['status'](_0x261a57)[_0x956e('0x1d')](_0x5543a1);}};}function respondWithFilteredResult(_0x31532a,_0x25c016){return function(_0x35be07){if(_0x35be07){var _0x28cb57=_0x35be07[_0x956e('0x1e')],_0x77460b=_0x25c016[_0x956e('0x1f')],_0x1a8261=_0x25c016[_0x956e('0x1f')]+_0x25c016['limit'],_0x3ece72;if(_0x1a8261>=_0x28cb57){_0x1a8261=_0x28cb57;_0x3ece72=0xc8;}else{_0x3ece72=0xce;}_0x31532a[_0x956e('0x1b')](_0x3ece72);return _0x31532a[_0x956e('0x20')]('Content-Range',_0x77460b+'-'+_0x1a8261+'/'+_0x28cb57)[_0x956e('0x1d')](_0x35be07);}return null;};}function patchUpdates(_0x404337){return function(_0x383b44){try{jsonpatch['apply'](_0x383b44,_0x404337,!![]);}catch(_0x2eddc0){return BPromise[_0x956e('0x21')](_0x2eddc0);}return _0x383b44['save']();};}function saveUpdates(_0xa89a5c,_0xdd2dad){return function(_0x2e0252){if(_0x2e0252){return _0x2e0252['update'](_0xa89a5c)['then'](function(_0x5ac137){return _0x5ac137;});}return null;};}function removeEntity(_0x42f565,_0x2ed936){return function(_0x3d27d8){if(_0x3d27d8){return _0x3d27d8[_0x956e('0x22')]()[_0x956e('0x23')](function(){var _0x18990d=_0x3d27d8[_0x956e('0x24')]({'plain':!![]});var _0x2b5b31=[{'name':_0x956e('0x25'),'value':'inbound','ignore':![]},{'name':_0x956e('0x26'),'value':_0x956e('0x27'),'ignore':![]}];var _0x6e3302=_(_0x2b5b31)['filter']('ignore')['map'](_0x956e('0x28'))[_0x956e('0x28')]();if(_['includes'](_0x6e3302,_0x18990d[_0x956e('0x29')])){return;}var _0x174d80=_['find'](_0x2b5b31,['value',_0x18990d[_0x956e('0x29')]])[_0x956e('0x2a')];return db['UserProfileResource']['destroy']({'where':{'type':_0x174d80,'resourceId':_0x18990d['id']}})[_0x956e('0x23')](function(){return _0x3d27d8;});})[_0x956e('0x23')](function(){_0x42f565[_0x956e('0x1b')](0xcc)[_0x956e('0x1c')]();});}};}function handleEntityNotFound(_0xe1efa3,_0x2f295e){return function(_0x2819b7){if(!_0x2819b7){_0xe1efa3[_0x956e('0x1a')](0x194);}return _0x2819b7;};}function handleError(_0x335428,_0x507b82){_0x507b82=_0x507b82||0x1f4;return function(_0x3aa316){logger[_0x956e('0x2b')](_0x3aa316['stack']);if(_0x3aa316['name']){delete _0x3aa316[_0x956e('0x2a')];}_0x335428[_0x956e('0x1b')](_0x507b82)[_0x956e('0x2c')](_0x3aa316);};}exports[_0x956e('0x2d')]=function(_0x1d86f5,_0xe7538f){var _0x23092a={},_0x5f20e9={},_0x3e47de={'count':0x0,'rows':[]};var _0x348bca=db['VoiceQueue'][_0x956e('0x2e')];_0x5f20e9[_0x956e('0x2f')]=_[_0x956e('0x30')](_0x348bca);_0x5f20e9[_0x956e('0x31')]=_[_0x956e('0x30')](_0x1d86f5[_0x956e('0x31')]);_0x5f20e9[_0x956e('0x32')]=_[_0x956e('0x33')](_0x5f20e9[_0x956e('0x2f')],_0x5f20e9[_0x956e('0x31')]);_0x23092a[_0x956e('0x34')]=_[_0x956e('0x33')](_0x5f20e9['model'],qs[_0x956e('0x35')](_0x1d86f5[_0x956e('0x31')][_0x956e('0x35')]));_0x23092a[_0x956e('0x34')]=_0x23092a[_0x956e('0x34')][_0x956e('0x36')]?_0x23092a[_0x956e('0x34')]:_0x5f20e9['model'];if(!_0x1d86f5[_0x956e('0x31')][_0x956e('0x37')](_0x956e('0x38'))){_0x23092a['limit']=qs[_0x956e('0x39')](_0x1d86f5['query']['limit']);_0x23092a['offset']=qs['offset'](_0x1d86f5[_0x956e('0x31')][_0x956e('0x1f')]);}_0x23092a[_0x956e('0x3a')]=qs['sort'](_0x1d86f5[_0x956e('0x31')][_0x956e('0x3b')]);_0x23092a[_0x956e('0x3c')]=qs[_0x956e('0x32')](_[_0x956e('0x3d')](_0x1d86f5['query'],_0x5f20e9['filters']));if(_0x1d86f5[_0x956e('0x31')]['filter']){_0x23092a[_0x956e('0x3c')]=_['merge'](_0x23092a[_0x956e('0x3c')],{'$or':_[_0x956e('0x3e')](_0x348bca,function(_0x442c48){if(_0x442c48[_0x956e('0x29')]['key']!==_0x956e('0x3f')){var _0x5c44ee={};_0x5c44ee[_0x442c48['field']]={'$like':'%'+_0x1d86f5[_0x956e('0x31')][_0x956e('0x40')]+'%'};return _0x5c44ee;}})});}_0x23092a=_[_0x956e('0x41')]({},_0x23092a,_0x1d86f5[_0x956e('0x42')]);var _0x3efa41={'where':_0x23092a[_0x956e('0x3c')]};return db['VoiceQueue'][_0x956e('0x1e')](_0x3efa41)[_0x956e('0x23')](function(_0x3586b6){_0x3e47de[_0x956e('0x1e')]=_0x3586b6;if(_0x1d86f5['query'][_0x956e('0x43')]){_0x23092a[_0x956e('0x44')]=[{'all':!![]}];}return db[_0x956e('0x45')][_0x956e('0x46')](_0x23092a);})['then'](function(_0x1655dd){_0x3e47de['rows']=_0x1655dd;return _0x3e47de;})[_0x956e('0x23')](respondWithFilteredResult(_0xe7538f,_0x23092a))['catch'](handleError(_0xe7538f,null));};exports['show']=function(_0x96d8d3,_0x47937c){var _0x38afbd={'raw':![],'where':{'id':_0x96d8d3[_0x956e('0x47')]['id']}},_0x4cfac1={};_0x4cfac1['model']=_['keys'](db[_0x956e('0x45')]['rawAttributes']);_0x4cfac1[_0x956e('0x31')]=_['keys'](_0x96d8d3[_0x956e('0x31')]);_0x4cfac1[_0x956e('0x32')]=_[_0x956e('0x33')](_0x4cfac1[_0x956e('0x2f')],_0x4cfac1[_0x956e('0x31')]);_0x38afbd[_0x956e('0x34')]=_[_0x956e('0x33')](_0x4cfac1[_0x956e('0x2f')],qs[_0x956e('0x35')](_0x96d8d3['query'][_0x956e('0x35')]));_0x38afbd[_0x956e('0x34')]=_0x38afbd[_0x956e('0x34')][_0x956e('0x36')]?_0x38afbd['attributes']:_0x4cfac1[_0x956e('0x2f')];if(_0x96d8d3[_0x956e('0x31')][_0x956e('0x43')]){_0x38afbd[_0x956e('0x44')]=[{'all':!![]}];}_0x38afbd=_['merge']({},_0x38afbd,_0x96d8d3[_0x956e('0x42')]);return db['VoiceQueue']['find'](_0x38afbd)[_0x956e('0x23')](handleEntityNotFound(_0x47937c,null))[_0x956e('0x23')](respondWithResult(_0x47937c,null))['catch'](handleError(_0x47937c,null));};exports['create']=function(_0xb40cb7,_0x50d12b){return db[_0x956e('0x45')]['create'](_0xb40cb7[_0x956e('0x48')],{})[_0x956e('0x23')](function(_0x216954){var _0x38ce16=_0xb40cb7[_0x956e('0x49')][_0x956e('0x24')]({'plain':!![]});if(!_0x38ce16)throw new Error(_0x956e('0x4a'));if(_0x38ce16['role']===_0x956e('0x49')){var _0x3291fb=_0x216954['get']({'plain':!![]});var _0x5088b0=[{'name':_0x956e('0x25'),'value':_0x956e('0x4b')},{'name':_0x956e('0x26'),'value':_0x956e('0x27')}];var _0x2d4d5d=_[_0x956e('0x4c')](_0x5088b0,[_0x956e('0x28'),_0x3291fb[_0x956e('0x29')]])['name'];return db[_0x956e('0x4d')][_0x956e('0x4c')]({'where':{'name':_0x2d4d5d,'userProfileId':_0x38ce16[_0x956e('0x4e')]},'raw':!![]})[_0x956e('0x23')](function(_0x17851a){if(_0x17851a&&_0x17851a[_0x956e('0x4f')]===0x0){return db[_0x956e('0x50')][_0x956e('0x51')]({'name':_0x3291fb[_0x956e('0x2a')],'resourceId':_0x3291fb['id'],'type':_0x17851a[_0x956e('0x2a')],'sectionId':_0x17851a['id']},{})[_0x956e('0x23')](function(){return _0x216954;});}else{return _0x216954;}})[_0x956e('0x52')](function(_0x19be7c){logger[_0x956e('0x2b')](_0x956e('0x53'),_0x19be7c);throw _0x19be7c;});}return _0x216954;})['then'](respondWithResult(_0x50d12b,0xc9))[_0x956e('0x52')](handleError(_0x50d12b,null));};exports[_0x956e('0x54')]=function(_0x561ef5,_0x340a15){var _0x90c35c={'raw':![],'where':{'id':_0x561ef5[_0x956e('0x47')]['id']}},_0x2182d9={};_0x2182d9[_0x956e('0x2f')]=_[_0x956e('0x30')](db[_0x956e('0x45')][_0x956e('0x2e')]);_0x90c35c['attributes']=_[_0x956e('0x33')](_0x2182d9['model'],qs[_0x956e('0x35')](_0x561ef5['query'][_0x956e('0x35')]));_0x90c35c['attributes']=_0x90c35c['attributes']['length']?_0x90c35c[_0x956e('0x34')]:_0x2182d9['model'];if(_0x561ef5[_0x956e('0x31')][_0x956e('0x43')]){_0x90c35c['include']=[{'all':!![]}];}_0x90c35c=_[_0x956e('0x41')]({},_0x90c35c,_0x561ef5[_0x956e('0x42')]);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x90c35c)[_0x956e('0x23')](handleEntityNotFound(_0x340a15,null))[_0x956e('0x23')](function(_0x2abced){if(_0x2abced){var _0x98c32d=_0x2abced['get']({'plain':!![]});_0x98c32d=qs[_0x956e('0x55')](_0x98c32d,['id',_0x956e('0x56'),'updatedAt']);_0x561ef5['body']=_['omit'](_0x561ef5[_0x956e('0x48')],['id',_0x956e('0x56'),_0x956e('0x57')]);return db[_0x956e('0x45')][_0x956e('0x51')](_['merge'](_0x98c32d,_0x561ef5['body']),{'include':_0x561ef5['query']['includeAll']?[{'all':!![]}]:undefined})[_0x956e('0x23')](function(_0x5329e6){var _0xfb2748=_0x561ef5[_0x956e('0x49')][_0x956e('0x24')]({'plain':!![]});if(!_0xfb2748)throw new Error(_0x956e('0x4a'));if(_0xfb2748[_0x956e('0x58')]===_0x956e('0x49')){var _0x2b690d=_0x5329e6[_0x956e('0x24')]({'plain':!![]});var _0x4d4197=[{'name':_0x956e('0x25'),'value':_0x956e('0x4b')},{'name':_0x956e('0x26'),'value':_0x956e('0x27')}];var _0x321108=_['find'](_0x4d4197,[_0x956e('0x28'),_0x2b690d[_0x956e('0x29')]])[_0x956e('0x2a')];return db[_0x956e('0x4d')]['find']({'where':{'name':_0x321108,'userProfileId':_0xfb2748['userProfileId']},'raw':!![]})[_0x956e('0x23')](function(_0x336326){if(_0x336326&&_0x336326[_0x956e('0x4f')]===0x0){return db[_0x956e('0x50')][_0x956e('0x51')]({'name':_0x2b690d[_0x956e('0x2a')],'resourceId':_0x2b690d['id'],'type':_0x336326['name'],'sectionId':_0x336326['id']},{})[_0x956e('0x23')](function(){return _0x5329e6;});}else{return _0x5329e6;}})[_0x956e('0x52')](function(_0x131853){logger[_0x956e('0x2b')](_0x956e('0x53'),_0x131853);throw _0x131853;});}return _0x5329e6;});}})[_0x956e('0x23')](respondWithResult(_0x340a15,0xc9))['catch'](handleError(_0x340a15,null));};exports[_0x956e('0x59')]=function(_0x1cff90,_0x2f7617){if(_0x1cff90['body']['id']){delete _0x1cff90['body']['id'];}return db['VoiceQueue'][_0x956e('0x4c')]({'where':{'id':_0x1cff90[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x2f7617,null))['then'](saveUpdates(_0x1cff90['body'],null))[_0x956e('0x23')](respondWithResult(_0x2f7617,null))[_0x956e('0x52')](handleError(_0x2f7617,null));};exports[_0x956e('0x22')]=function(_0xce08cd,_0x4eeb22){return db['VoiceQueue'][_0x956e('0x4c')]({'where':{'id':_0xce08cd[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x4eeb22,null))[_0x956e('0x23')](removeEntity(_0x4eeb22,null))[_0x956e('0x52')](handleError(_0x4eeb22,null));};exports[_0x956e('0x5a')]=function(_0x1c86f1,_0xb98b76,_0x3d93b0){var _0x461aff={'raw':![],'where':{}};var _0x516dd0={};var _0x52704d={'count':0x0,'rows':[]};return db[_0x956e('0x45')][_0x956e('0x5b')]({'where':{'id':_0x1c86f1[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0xb98b76,null))[_0x956e('0x23')](function(_0x3bcee0){if(_0x3bcee0){_0x516dd0[_0x956e('0x2f')]=_['keys'](db[_0x956e('0x5c')][_0x956e('0x2e')]);_0x516dd0[_0x956e('0x31')]=_[_0x956e('0x30')](_0x1c86f1[_0x956e('0x31')]);_0x516dd0[_0x956e('0x32')]=_[_0x956e('0x33')](_0x516dd0['model'],_0x516dd0[_0x956e('0x31')]);_0x461aff[_0x956e('0x34')]=_[_0x956e('0x33')](_0x516dd0[_0x956e('0x2f')],qs[_0x956e('0x35')](_0x1c86f1['query']['fields']));_0x461aff['attributes']=_0x461aff[_0x956e('0x34')]['length']?_0x461aff[_0x956e('0x34')]:_0x516dd0['model'];if(!_0x1c86f1['query'][_0x956e('0x37')](_0x956e('0x38'))){_0x461aff[_0x956e('0x39')]=qs[_0x956e('0x39')](_0x1c86f1['query'][_0x956e('0x39')]);_0x461aff[_0x956e('0x1f')]=qs['offset'](_0x1c86f1[_0x956e('0x31')][_0x956e('0x1f')]);}_0x461aff[_0x956e('0x3a')]=qs[_0x956e('0x3b')](_0x1c86f1[_0x956e('0x31')]['sort']);_0x461aff[_0x956e('0x3c')]=qs[_0x956e('0x32')](_['pick'](_0x1c86f1[_0x956e('0x31')],_0x516dd0[_0x956e('0x32')]));_0x461aff['where'][_0x956e('0x5d')]=_0x3bcee0['id'];if(_0x1c86f1[_0x956e('0x31')][_0x956e('0x40')]){_0x461aff[_0x956e('0x3c')]=_['merge'](_0x461aff[_0x956e('0x3c')],{'$or':_['map'](_0x461aff[_0x956e('0x34')],function(_0x475dd4){var _0x30f9e5={};_0x30f9e5[_0x475dd4]={'$like':'%'+_0x1c86f1['query'][_0x956e('0x40')]+'%'};return _0x30f9e5;})});}_0x461aff=_[_0x956e('0x41')]({},_0x461aff,_0x1c86f1[_0x956e('0x42')]);return db[_0x956e('0x5c')]['count']({'where':_0x461aff['where']})[_0x956e('0x23')](function(_0x47a7d8){_0x52704d[_0x956e('0x1e')]=_0x47a7d8;if(_0x1c86f1['query'][_0x956e('0x43')]){_0x461aff['include']=[{'all':!![]}];}return db[_0x956e('0x5c')]['findAll'](_0x461aff);})[_0x956e('0x23')](function(_0x2e8140){_0x52704d[_0x956e('0x5e')]=_0x2e8140;return _0x52704d;});}})[_0x956e('0x23')](respondWithFilteredResult(_0xb98b76,_0x461aff))['catch'](handleError(_0xb98b76,null));};exports[_0x956e('0x5f')]=function(_0x21e882,_0x396e0c,_0x2b4d34){var _0x5f5061={'raw':!![],'where':{}};var _0x381420={};var _0x6501c={'count':0x0,'rows':[]};return db[_0x956e('0x45')]['findOne']({'where':{'id':_0x21e882[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x396e0c,null))['then'](function(_0x48b6bd){if(_0x48b6bd){_0x381420[_0x956e('0x2f')]=_[_0x956e('0x30')](db[_0x956e('0x60')][_0x956e('0x2e')]);_0x381420[_0x956e('0x31')]=_[_0x956e('0x30')](_0x21e882['query']);_0x381420[_0x956e('0x32')]=_['intersection'](_0x381420['model'],_0x381420[_0x956e('0x31')]);_0x5f5061[_0x956e('0x34')]=_[_0x956e('0x33')](_0x381420[_0x956e('0x2f')],qs['fields'](_0x21e882[_0x956e('0x31')]['fields']));_0x5f5061[_0x956e('0x34')]=_0x5f5061['attributes']['length']?_0x5f5061[_0x956e('0x34')]:_0x381420[_0x956e('0x2f')];if(!_0x21e882[_0x956e('0x31')]['hasOwnProperty'](_0x956e('0x38'))){_0x5f5061['limit']=qs[_0x956e('0x39')](_0x21e882[_0x956e('0x31')]['limit']);_0x5f5061[_0x956e('0x1f')]=qs[_0x956e('0x1f')](_0x21e882[_0x956e('0x31')]['offset']);}_0x5f5061[_0x956e('0x3a')]=qs[_0x956e('0x3b')](_0x21e882[_0x956e('0x31')][_0x956e('0x3b')]);_0x5f5061[_0x956e('0x3c')]=qs[_0x956e('0x32')](_[_0x956e('0x3d')](_0x21e882[_0x956e('0x31')],_0x381420[_0x956e('0x32')]));_0x5f5061['where']['VoiceQueueId']=_0x48b6bd['id'];if(_0x21e882['query'][_0x956e('0x40')]){_0x5f5061[_0x956e('0x3c')]=_['merge'](_0x5f5061['where'],{'$or':_[_0x956e('0x3e')](_0x5f5061[_0x956e('0x34')],function(_0x20e446){var _0x59903f={};_0x59903f[_0x20e446]={'$like':'%'+_0x21e882[_0x956e('0x31')][_0x956e('0x40')]+'%'};return _0x59903f;})});}_0x5f5061=_[_0x956e('0x41')]({},_0x5f5061,_0x21e882[_0x956e('0x42')]);return db[_0x956e('0x60')][_0x956e('0x1e')]({'where':_0x5f5061[_0x956e('0x3c')]})[_0x956e('0x23')](function(_0x957f78){_0x6501c['count']=_0x957f78;if(_0x21e882[_0x956e('0x31')][_0x956e('0x43')]){_0x5f5061['include']=[{'all':!![]}];}return db[_0x956e('0x60')][_0x956e('0x46')](_0x5f5061);})['then'](function(_0x4430a1){_0x6501c[_0x956e('0x5e')]=_0x4430a1;return _0x6501c;});}})[_0x956e('0x23')](respondWithFilteredResult(_0x396e0c,_0x5f5061))[_0x956e('0x52')](handleError(_0x396e0c,null));};exports[_0x956e('0x61')]=function(_0xde810a,_0x5c5f27,_0x23f230){var _0x3208c9={'raw':!![],'where':{}};var _0x5f11c2={};var _0x56ca8b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x956e('0x5b')]({'where':{'id':_0xde810a[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x5c5f27,null))[_0x956e('0x23')](function(_0x578db2){if(_0x578db2){_0x5f11c2[_0x956e('0x2f')]=_['keys'](db[_0x956e('0x62')][_0x956e('0x2e')]);_0x5f11c2[_0x956e('0x31')]=_[_0x956e('0x30')](_0xde810a['query']);_0x5f11c2[_0x956e('0x32')]=_['intersection'](_0x5f11c2[_0x956e('0x2f')],_0x5f11c2[_0x956e('0x31')]);_0x3208c9[_0x956e('0x34')]=_['intersection'](_0x5f11c2[_0x956e('0x2f')],qs[_0x956e('0x35')](_0xde810a[_0x956e('0x31')][_0x956e('0x35')]));_0x3208c9['attributes']=_0x3208c9[_0x956e('0x34')][_0x956e('0x36')]?_0x3208c9['attributes']:_0x5f11c2[_0x956e('0x2f')];if(!_0xde810a[_0x956e('0x31')]['hasOwnProperty'](_0x956e('0x38'))){_0x3208c9[_0x956e('0x39')]=qs[_0x956e('0x39')](_0xde810a[_0x956e('0x31')][_0x956e('0x39')]);_0x3208c9[_0x956e('0x1f')]=qs[_0x956e('0x1f')](_0xde810a[_0x956e('0x31')][_0x956e('0x1f')]);}_0x3208c9['order']=qs[_0x956e('0x3b')](_0xde810a[_0x956e('0x31')][_0x956e('0x3b')]);_0x3208c9['where']=qs[_0x956e('0x32')](_[_0x956e('0x3d')](_0xde810a[_0x956e('0x31')],_0x5f11c2[_0x956e('0x32')]));_0x3208c9[_0x956e('0x3c')]['VoiceQueueId']=_0x578db2['id'];if(_0xde810a[_0x956e('0x31')][_0x956e('0x40')]){_0x3208c9[_0x956e('0x3c')]=_['merge'](_0x3208c9['where'],{'$or':_[_0x956e('0x3e')](_0x3208c9[_0x956e('0x34')],function(_0x482e6c){var _0x534598={};_0x534598[_0x482e6c]={'$like':'%'+_0xde810a[_0x956e('0x31')][_0x956e('0x40')]+'%'};return _0x534598;})});}_0x3208c9=_['merge']({},_0x3208c9,_0xde810a['options']);return db[_0x956e('0x62')]['count']({'where':_0x3208c9['where']})[_0x956e('0x23')](function(_0x3d4170){_0x56ca8b['count']=_0x3d4170;if(_0xde810a[_0x956e('0x31')][_0x956e('0x43')]){_0x3208c9[_0x956e('0x44')]=[{'all':!![]}];}return db[_0x956e('0x62')][_0x956e('0x46')](_0x3208c9);})[_0x956e('0x23')](function(_0x461bc7){_0x56ca8b[_0x956e('0x5e')]=_0x461bc7;return _0x56ca8b;});}})[_0x956e('0x23')](respondWithFilteredResult(_0x5c5f27,_0x3208c9))[_0x956e('0x52')](handleError(_0x5c5f27,null));};exports[_0x956e('0x63')]=function(_0x9923b8,_0x1168f1,_0x3aed86){var _0x21ec1b={'raw':!![],'where':{}};var _0x509698={};var _0x309240={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x956e('0x5b')]({'where':{'id':_0x9923b8[_0x956e('0x47')]['id']}})['then'](handleEntityNotFound(_0x1168f1,null))[_0x956e('0x23')](function(_0x232744){if(_0x232744){_0x509698[_0x956e('0x2f')]=_[_0x956e('0x30')](db[_0x956e('0x64')][_0x956e('0x2e')]);_0x509698[_0x956e('0x31')]=_[_0x956e('0x30')](_0x9923b8[_0x956e('0x31')]);_0x509698[_0x956e('0x32')]=_[_0x956e('0x33')](_0x509698[_0x956e('0x2f')],_0x509698[_0x956e('0x31')]);_0x21ec1b[_0x956e('0x34')]=_[_0x956e('0x33')](_0x509698[_0x956e('0x2f')],qs[_0x956e('0x35')](_0x9923b8['query'][_0x956e('0x35')]));_0x21ec1b[_0x956e('0x34')]=_0x21ec1b[_0x956e('0x34')]['length']?_0x21ec1b[_0x956e('0x34')]:_0x509698['model'];if(!_0x9923b8[_0x956e('0x31')]['hasOwnProperty'](_0x956e('0x38'))){_0x21ec1b[_0x956e('0x39')]=qs[_0x956e('0x39')](_0x9923b8['query']['limit']);_0x21ec1b['offset']=qs['offset'](_0x9923b8[_0x956e('0x31')][_0x956e('0x1f')]);}_0x21ec1b[_0x956e('0x3a')]=qs[_0x956e('0x3b')](_0x9923b8[_0x956e('0x31')][_0x956e('0x3b')]);_0x21ec1b[_0x956e('0x3c')]=qs[_0x956e('0x32')](_[_0x956e('0x3d')](_0x9923b8[_0x956e('0x31')],_0x509698[_0x956e('0x32')]));_0x21ec1b[_0x956e('0x3c')][_0x956e('0x5d')]=_0x232744['id'];if(_0x9923b8[_0x956e('0x31')][_0x956e('0x40')]){_0x21ec1b[_0x956e('0x3c')]=_[_0x956e('0x41')](_0x21ec1b['where'],{'$or':_['map'](_0x21ec1b[_0x956e('0x34')],function(_0x10c9e4){var _0x14f430={};_0x14f430[_0x10c9e4]={'$like':'%'+_0x9923b8[_0x956e('0x31')]['filter']+'%'};return _0x14f430;})});}_0x21ec1b=_['merge']({},_0x21ec1b,_0x9923b8[_0x956e('0x42')]);return db[_0x956e('0x64')]['count']({'where':_0x21ec1b['where']})[_0x956e('0x23')](function(_0x554130){_0x309240['count']=_0x554130;if(_0x9923b8[_0x956e('0x31')][_0x956e('0x43')]){_0x21ec1b[_0x956e('0x44')]=[{'all':!![]}];}return db[_0x956e('0x64')][_0x956e('0x46')](_0x21ec1b);})[_0x956e('0x23')](function(_0x594758){_0x309240[_0x956e('0x5e')]=_0x594758;return _0x309240;});}})[_0x956e('0x23')](respondWithFilteredResult(_0x1168f1,_0x21ec1b))[_0x956e('0x52')](handleError(_0x1168f1,null));};exports[_0x956e('0x65')]=function(_0x400d0b,_0x53ba44,_0x36c920){var _0x4fe0cc={};var _0x153d06={};var _0x2a55f3;var _0x2346e7;return db[_0x956e('0x45')][_0x956e('0x5b')]({'where':{'id':_0x400d0b[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x53ba44,null))['then'](function(_0x4fc55a){if(_0x4fc55a){_0x2a55f3=_0x4fc55a;_0x153d06[_0x956e('0x2f')]=_[_0x956e('0x30')](db['Team'][_0x956e('0x2e')]);_0x153d06[_0x956e('0x31')]=_['keys'](_0x400d0b[_0x956e('0x31')]);_0x153d06[_0x956e('0x32')]=_['intersection'](_0x153d06[_0x956e('0x2f')],_0x153d06[_0x956e('0x31')]);_0x4fe0cc[_0x956e('0x34')]=_[_0x956e('0x33')](_0x153d06[_0x956e('0x2f')],qs[_0x956e('0x35')](_0x400d0b[_0x956e('0x31')][_0x956e('0x35')]));_0x4fe0cc[_0x956e('0x34')]=_0x4fe0cc[_0x956e('0x34')][_0x956e('0x36')]?_0x4fe0cc[_0x956e('0x34')]:_0x153d06[_0x956e('0x2f')];_0x4fe0cc[_0x956e('0x3a')]=qs[_0x956e('0x3b')](_0x400d0b['query'][_0x956e('0x3b')]);_0x4fe0cc[_0x956e('0x3c')]=qs[_0x956e('0x32')](_[_0x956e('0x3d')](_0x400d0b[_0x956e('0x31')],_0x153d06[_0x956e('0x32')]));if(_0x400d0b[_0x956e('0x31')][_0x956e('0x40')]){_0x4fe0cc['where']=_[_0x956e('0x41')](_0x4fe0cc[_0x956e('0x3c')],{'$or':_[_0x956e('0x3e')](_0x4fe0cc['attributes'],function(_0x16f264){var _0x2ca4a8={};_0x2ca4a8[_0x16f264]={'$like':'%'+_0x400d0b[_0x956e('0x31')][_0x956e('0x40')]+'%'};return _0x2ca4a8;})});}_0x4fe0cc=_[_0x956e('0x41')]({},_0x4fe0cc,_0x400d0b[_0x956e('0x42')]);return _0x2a55f3[_0x956e('0x65')](_0x4fe0cc);}})[_0x956e('0x23')](function(_0x51fe1f){if(_0x51fe1f){_0x2346e7=_0x51fe1f[_0x956e('0x36')];if(!_0x400d0b['query'][_0x956e('0x37')](_0x956e('0x38'))){_0x4fe0cc[_0x956e('0x39')]=qs['limit'](_0x400d0b[_0x956e('0x31')][_0x956e('0x39')]);_0x4fe0cc[_0x956e('0x1f')]=qs[_0x956e('0x1f')](_0x400d0b[_0x956e('0x31')][_0x956e('0x1f')]);}return _0x2a55f3['getTeams'](_0x4fe0cc);}})[_0x956e('0x23')](function(_0x59e76e){if(_0x59e76e){return _0x59e76e?{'count':_0x2346e7,'rows':_0x59e76e}:null;}})[_0x956e('0x23')](respondWithResult(_0x53ba44,null))[_0x956e('0x52')](handleError(_0x53ba44,null));};exports[_0x956e('0x66')]=function(_0x3d4075,_0x5116a5,_0x4b13c5){var _0x45b152=[];var _0x278d29;return db[_0x956e('0x67')][_0x956e('0x46')]({'where':{'id':_0x3d4075['body'][_0x956e('0x68')]},'attributes':['id'],'include':[{'model':db[_0x956e('0x69')],'as':_0x956e('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x956e('0x23')](function(_0x4f0e57){if(_0x4f0e57){for(var _0xc2085e=0x0;_0xc2085e<_0x4f0e57[_0x956e('0x36')];_0xc2085e+=0x1){for(var _0x250704=0x0;_0x250704<_0x4f0e57[_0xc2085e][_0x956e('0x6a')][_0x956e('0x36')];_0x250704+=0x1){_0x45b152=_[_0x956e('0x6b')](_0x45b152,[_0x4f0e57[_0xc2085e][_0x956e('0x6a')][_0x250704]['id']]);}}return _0x45b152;}})[_0x956e('0x23')](function(_0x4e25f7){if(_0x4e25f7){return db[_0x956e('0x45')]['find']({'where':{'id':_0x3d4075[_0x956e('0x47')]['id']}});}})['then'](function(_0x2fe968){if(_0x2fe968){_0x278d29=_0x2fe968;return _0x278d29[_0x956e('0x6c')](_0x45b152,{'penalty':_0x3d4075['body']['penalty']});}})[_0x956e('0x23')](function(_0x15d1ee){if(_0x15d1ee){return _0x278d29[_0x956e('0x66')](_0x3d4075['body'][_0x956e('0x68')]);}})[_0x956e('0x23')](handleEntityNotFound(_0x5116a5,null))[_0x956e('0x23')](respondWithStatusCode(_0x5116a5,null))[_0x956e('0x52')](handleError(_0x5116a5,null));};exports['removeTeams']=function(_0x35cdc9,_0x4c548b,_0x364424){var _0x49f7d0=[];var _0x1076e3;return db[_0x956e('0x67')][_0x956e('0x46')]({'where':{'id':_0x35cdc9['query'][_0x956e('0x68')]},'attributes':['id'],'include':[{'model':db[_0x956e('0x69')],'as':_0x956e('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x956e('0x23')](function(_0x33596b){if(_0x33596b){for(var _0x357cb4=0x0;_0x357cb4<_0x33596b[_0x956e('0x36')];_0x357cb4+=0x1){for(var _0xaa91a1=0x0;_0xaa91a1<_0x33596b[_0x357cb4][_0x956e('0x6a')][_0x956e('0x36')];_0xaa91a1+=0x1){_0x49f7d0=_[_0x956e('0x6b')](_0x49f7d0,[_0x33596b[_0x357cb4]['Agents'][_0xaa91a1]['id']]);}}return _0x49f7d0;}})[_0x956e('0x23')](function(_0xd4e075){if(_0xd4e075){return db[_0x956e('0x45')][_0x956e('0x4c')]({'where':{'id':_0x35cdc9[_0x956e('0x47')]['id']}});}})[_0x956e('0x23')](function(_0x19f8d5){if(_0x19f8d5){_0x1076e3=_0x19f8d5;return _0x1076e3['removeAgents'](_0x49f7d0);}})[_0x956e('0x23')](function(_0x32df21){if(_0x1076e3){return _0x1076e3[_0x956e('0x6d')](_0x35cdc9[_0x956e('0x31')]['ids']);}})[_0x956e('0x23')](handleEntityNotFound(_0x4c548b,null))[_0x956e('0x23')](respondWithStatusCode(_0x4c548b,null))[_0x956e('0x52')](handleError(_0x4c548b,null));};exports[_0x956e('0x6c')]=function(_0x1f86f9,_0x22df59,_0x3bde47){var _0x42d36b,_0x2db1fa;return db['VoiceQueue'][_0x956e('0x4c')]({'where':{'id':_0x1f86f9[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x22df59,null))['then'](function(_0x11d1b9){if(_0x11d1b9){_0x2db1fa=_0x11d1b9;return _0x11d1b9[_0x956e('0x6c')](_0x1f86f9[_0x956e('0x48')][_0x956e('0x68')],_[_0x956e('0x55')](_0x1f86f9[_0x956e('0x48')],[_0x956e('0x68'),'id'])||{})['spread'](function(_0x5e08da){for(var _0x7f705=0x0;_0x7f705<_0x1f86f9[_0x956e('0x48')]['ids'][_0x956e('0x36')];_0x7f705+=0x1){socket[_0x956e('0x6e')](_0x956e('0x6f'),{'UserId':_0x1f86f9[_0x956e('0x48')][_0x956e('0x68')][_0x7f705],'VoiceQueueId':_0x1f86f9[_0x956e('0x47')]['id']});}return _0x5e08da;});}})['then'](function(_0x1fcc02){_0x42d36b=_0x1fcc02||[];if(_0x2db1fa){return db[_0x956e('0x69')][_0x956e('0x46')]({'where':{'id':_0x1f86f9[_0x956e('0x48')][_0x956e('0x68')]},'attributes':['id','name',_0x956e('0x70'),_0x956e('0x71'),_0x956e('0x72')],'raw':!![]});}})['then'](function(_0x52ed8f){if(_0x52ed8f&&_0x52ed8f['length']){var _0x5a1e43=[];for(var _0x3863b1=0x0;_0x3863b1<_0x52ed8f['length'];_0x3863b1++){_0x5a1e43['push'](db[_0x956e('0x73')][_0x956e('0x74')]({'membername':_0x52ed8f[_0x3863b1][_0x956e('0x2a')],'UserId':_0x52ed8f[_0x3863b1]['id'],'queue_name':_0x2db1fa[_0x956e('0x2a')],'VoiceQueueId':_0x2db1fa['id'],'interface':_[_0x956e('0x75')](_0x52ed8f[_0x3863b1]['interface'])?util[_0x956e('0x76')]('SIP/%s',_0x52ed8f[_0x3863b1][_0x956e('0x2a')]):_0x52ed8f[_0x3863b1][_0x956e('0x72')],'paused':_0x52ed8f[_0x3863b1][_0x956e('0x71')]||![],'penalty':_0x1f86f9[_0x956e('0x48')][_0x956e('0x77')]||0x0}));}return BPromise['all'](_0x5a1e43);}})[_0x956e('0x23')](function(_0x5d62ad){return _0x42d36b;})[_0x956e('0x23')](respondWithResult(_0x22df59,null))[_0x956e('0x52')](handleError(_0x22df59,null));};exports['removeAgents']=function(_0x48fe48,_0x523000,_0x510e4d){var _0x28198a;return db[_0x956e('0x45')][_0x956e('0x4c')]({'where':{'id':_0x48fe48[_0x956e('0x47')]['id']}})['then'](handleEntityNotFound(_0x523000,null))[_0x956e('0x23')](function(_0x5732e1){if(_0x5732e1){return _0x5732e1[_0x956e('0x78')](_0x48fe48[_0x956e('0x31')]['ids'])['then'](function(_0x1baacd){if(_['isArray'](_0x48fe48['query'][_0x956e('0x68')])){for(var _0x4ba18b=0x0;_0x4ba18b<_0x48fe48[_0x956e('0x31')][_0x956e('0x68')][_0x956e('0x36')];_0x4ba18b+=0x1){socket[_0x956e('0x6e')](_0x956e('0x79'),{'UserId':_0x48fe48[_0x956e('0x31')][_0x956e('0x68')][_0x4ba18b],'VoiceQueueId':_0x48fe48['params']['id']});}}else{socket[_0x956e('0x6e')](_0x956e('0x79'),{'UserId':_0x48fe48[_0x956e('0x31')][_0x956e('0x68')],'VoiceQueueId':_0x48fe48[_0x956e('0x47')]['id']});}});}})[_0x956e('0x23')](function(_0x505d3d){if(_0x48fe48['query'][_0x956e('0x7a')]){_0x28198a=_0x505d3d;return db[_0x956e('0x73')]['destroy']({'where':{'VoiceQueueId':_0x48fe48[_0x956e('0x47')]['id'],'UserId':_0x48fe48[_0x956e('0x31')][_0x956e('0x68')]}})[_0x956e('0x23')](function(){return _0x28198a;});}})[_0x956e('0x23')](respondWithStatusCode(_0x523000,null))['catch'](handleError(_0x523000,null));};exports[_0x956e('0x7b')]=function(_0x468eb3,_0x48493c,_0x5e1417){var _0x471f9e={};var _0x4e284e={};var _0x28dfc0;var _0x155c5b;return db[_0x956e('0x45')][_0x956e('0x5b')]({'where':{'id':_0x468eb3[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x48493c,null))[_0x956e('0x23')](function(_0x20bb46){if(_0x20bb46){_0x28dfc0=_0x20bb46;_0x4e284e[_0x956e('0x2f')]=_[_0x956e('0x30')](db[_0x956e('0x69')]['rawAttributes']);_0x4e284e[_0x956e('0x31')]=_['keys'](_0x468eb3[_0x956e('0x31')]);_0x4e284e[_0x956e('0x32')]=_['intersection'](_0x4e284e[_0x956e('0x2f')],_0x4e284e['query']);_0x471f9e[_0x956e('0x34')]=_[_0x956e('0x33')](_0x4e284e[_0x956e('0x2f')],qs['fields'](_0x468eb3[_0x956e('0x31')][_0x956e('0x35')]));_0x471f9e[_0x956e('0x34')]=_0x471f9e['attributes'][_0x956e('0x36')]?_0x471f9e['attributes']:_0x4e284e[_0x956e('0x2f')];_0x471f9e[_0x956e('0x3a')]=qs[_0x956e('0x3b')](_0x468eb3['query'][_0x956e('0x3b')]);_0x471f9e[_0x956e('0x3c')]=qs['filters'](_[_0x956e('0x3d')](_0x468eb3[_0x956e('0x31')],_0x4e284e[_0x956e('0x32')]));if(_0x468eb3[_0x956e('0x31')][_0x956e('0x40')]){_0x471f9e[_0x956e('0x3c')]=_[_0x956e('0x41')](_0x471f9e[_0x956e('0x3c')],{'$or':_[_0x956e('0x3e')](_0x471f9e['attributes'],function(_0x470e6c){var _0x430a28={};_0x430a28[_0x470e6c]={'$like':'%'+_0x468eb3[_0x956e('0x31')][_0x956e('0x40')]+'%'};return _0x430a28;})});}_0x471f9e=_[_0x956e('0x41')]({},_0x471f9e,_0x468eb3[_0x956e('0x42')]);return _0x28dfc0[_0x956e('0x7b')](_0x471f9e);}})[_0x956e('0x23')](function(_0xa12574){if(_0xa12574){_0x155c5b=_0xa12574[_0x956e('0x36')];if(!_0x468eb3[_0x956e('0x31')][_0x956e('0x37')]('nolimit')){_0x471f9e[_0x956e('0x39')]=qs[_0x956e('0x39')](_0x468eb3[_0x956e('0x31')][_0x956e('0x39')]);_0x471f9e[_0x956e('0x1f')]=qs[_0x956e('0x1f')](_0x468eb3[_0x956e('0x31')]['offset']);}return _0x28dfc0['getAgents'](_0x471f9e);}})[_0x956e('0x23')](function(_0x4e9abe){if(_0x4e9abe){return _0x4e9abe?{'count':_0x155c5b,'rows':_0x4e9abe}:null;}})['then'](respondWithResult(_0x48493c,null))['catch'](handleError(_0x48493c,null));};exports[_0x956e('0x7c')]=function(_0x33c1a3,_0x464067,_0x482abb){var _0x34050f={};var _0x276169={};var _0x10c450;var _0x239954;return db[_0x956e('0x45')][_0x956e('0x5b')]({'where':{'id':_0x33c1a3[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x464067,null))[_0x956e('0x23')](function(_0x172500){if(_0x172500){_0x10c450=_0x172500;_0x276169[_0x956e('0x2f')]=_[_0x956e('0x30')](db['UserVoiceQueueRt'][_0x956e('0x2e')]);_0x276169['query']=_[_0x956e('0x30')](_0x33c1a3['query']);_0x276169[_0x956e('0x32')]=_[_0x956e('0x33')](_0x276169[_0x956e('0x2f')],_0x276169[_0x956e('0x31')]);_0x34050f['attributes']=_[_0x956e('0x33')](_0x276169['model'],qs['fields'](_0x33c1a3[_0x956e('0x31')][_0x956e('0x35')]));_0x34050f[_0x956e('0x34')]=_0x34050f[_0x956e('0x34')][_0x956e('0x36')]?_0x34050f['attributes']:_0x276169['model'];_0x34050f[_0x956e('0x3a')]=qs[_0x956e('0x3b')](_0x33c1a3[_0x956e('0x31')]['sort']);_0x34050f[_0x956e('0x3c')]=qs[_0x956e('0x32')](_['pick'](_0x33c1a3[_0x956e('0x31')],_0x276169[_0x956e('0x32')]));if(_0x33c1a3[_0x956e('0x31')][_0x956e('0x40')]){_0x34050f[_0x956e('0x3c')]=_[_0x956e('0x41')](_0x34050f['where'],{'$or':_[_0x956e('0x3e')](_0x34050f[_0x956e('0x34')],function(_0x23ade8){var _0x5f08ff={};_0x5f08ff[_0x23ade8]={'$like':'%'+_0x33c1a3['query'][_0x956e('0x40')]+'%'};return _0x5f08ff;})});}_0x34050f=_['merge']({},_0x34050f,_0x33c1a3['options']);return _0x10c450[_0x956e('0x7c')](_0x34050f);}})[_0x956e('0x23')](function(_0x13783e){if(_0x13783e){_0x239954=_0x13783e[_0x956e('0x36')];if(!_0x33c1a3['query']['hasOwnProperty']('nolimit')){_0x34050f[_0x956e('0x39')]=qs[_0x956e('0x39')](_0x33c1a3['query'][_0x956e('0x39')]);_0x34050f[_0x956e('0x1f')]=qs[_0x956e('0x1f')](_0x33c1a3[_0x956e('0x31')][_0x956e('0x1f')]);}return _0x10c450['getMembers'](_0x34050f);}})[_0x956e('0x23')](function(_0x1491f4){return _0x1491f4?{'count':_0x239954,'rows':_0x1491f4}:null;})['then'](respondWithResult(_0x464067,null))[_0x956e('0x52')](handleError(_0x464067,null));};exports[_0x956e('0x7d')]=function(_0x2712b1,_0x49ac6b,_0x259631){var _0x2cec95={};var _0x1aabcb={};var _0x472c39;var _0xb3e26b;return db[_0x956e('0x45')][_0x956e('0x5b')]({'where':{'id':_0x2712b1[_0x956e('0x47')]['id']}})['then'](handleEntityNotFound(_0x49ac6b,null))[_0x956e('0x23')](function(_0x1b2fb9){if(_0x1b2fb9){_0x472c39=_0x1b2fb9;_0x1aabcb[_0x956e('0x2f')]=_[_0x956e('0x30')](db[_0x956e('0x7e')]['rawAttributes']);_0x1aabcb[_0x956e('0x31')]=_[_0x956e('0x30')](_0x2712b1[_0x956e('0x31')]);_0x1aabcb[_0x956e('0x32')]=_[_0x956e('0x33')](_0x1aabcb[_0x956e('0x2f')],_0x1aabcb[_0x956e('0x31')]);_0x2cec95[_0x956e('0x34')]=_[_0x956e('0x33')](_0x1aabcb['model'],qs['fields'](_0x2712b1[_0x956e('0x31')][_0x956e('0x35')]));_0x2cec95[_0x956e('0x34')]=_0x2cec95[_0x956e('0x34')]['length']?_0x2cec95[_0x956e('0x34')]:_0x1aabcb[_0x956e('0x2f')];_0x2cec95[_0x956e('0x3a')]=qs['sort'](_0x2712b1[_0x956e('0x31')][_0x956e('0x3b')]);_0x2cec95[_0x956e('0x3c')]=qs[_0x956e('0x32')](_[_0x956e('0x3d')](_0x2712b1[_0x956e('0x31')],_0x1aabcb[_0x956e('0x32')]));if(_0x2712b1[_0x956e('0x31')]['filter']){_0x2cec95[_0x956e('0x3c')]=_[_0x956e('0x41')](_0x2cec95['where'],{'$or':_[_0x956e('0x3e')](_0x2cec95[_0x956e('0x34')],function(_0xe6378d){var _0x237ff9={};_0x237ff9[_0xe6378d]={'$like':'%'+_0x2712b1[_0x956e('0x31')][_0x956e('0x40')]+'%'};return _0x237ff9;})});}_0x2cec95=_['merge']({},_0x2cec95,_0x2712b1[_0x956e('0x42')]);return _0x472c39[_0x956e('0x7d')](_0x2cec95);}})['then'](function(_0x38b40e){if(_0x38b40e){_0xb3e26b=_0x38b40e[_0x956e('0x36')];if(!_0x2712b1[_0x956e('0x31')][_0x956e('0x37')](_0x956e('0x38'))){_0x2cec95[_0x956e('0x39')]=qs[_0x956e('0x39')](_0x2712b1['query'][_0x956e('0x39')]);_0x2cec95[_0x956e('0x1f')]=qs[_0x956e('0x1f')](_0x2712b1[_0x956e('0x31')][_0x956e('0x1f')]);}return _0x472c39[_0x956e('0x7d')](_0x2cec95);}})[_0x956e('0x23')](function(_0x350457){if(_0x350457){return _0x350457?{'count':_0xb3e26b,'rows':_0x350457}:null;}})['then'](respondWithResult(_0x49ac6b,null))[_0x956e('0x52')](handleError(_0x49ac6b,null));};exports[_0x956e('0x7f')]=function(_0x19016d,_0x29cd77,_0x1083fd){var _0x52bce9,_0x544b04;return db[_0x956e('0x45')]['find']({'where':{'id':_0x19016d[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x29cd77,null))[_0x956e('0x23')](function(_0x546536){if(_0x546536){_0x544b04=_0x546536;return _0x546536['addLists'](_0x19016d['body']['ids'],_[_0x956e('0x55')](_0x19016d[_0x956e('0x48')],[_0x956e('0x68'),'id'])||{});}return null;})[_0x956e('0x80')](function(_0x969a54){var _0x203bed;_0x52bce9=_0x969a54||[];var _0x12fce2=[];if(_0x969a54){for(var _0x3d8789=0x0;_0x3d8789<_0x969a54[_0x956e('0x36')];_0x3d8789+=0x1){var _0x3b7ccb=_0x969a54[_0x3d8789][_0x956e('0x24')]({'plain':!![]});_0x544b04['dialCheckDuplicateType']=_0x19016d[_0x956e('0x48')][_0x956e('0x81')]?_0x19016d['body'][_0x956e('0x81')]:_0x544b04[_0x956e('0x81')];switch(_0x544b04[_0x956e('0x81')]){case'always':_0x203bed=squel['insert']()[_0x956e('0x82')]('cm_hopper')[_0x956e('0x83')](['phone',_0x956e('0x84'),_0x956e('0x85'),_0x956e('0x86'),_0x956e('0x5d'),_0x956e('0x56'),'updatedAt'],squel[_0x956e('0x87')]()['field'](_0x956e('0x88'),_0x956e('0x88'))[_0x956e('0x89')](_0x956e('0x8a'),_0x956e('0x84'))[_0x956e('0x89')]('id',_0x956e('0x85'))[_0x956e('0x89')](_0x3b7ccb['CmListId'][_0x956e('0x8b')](),'ListId')[_0x956e('0x89')](_0x19016d[_0x956e('0x47')]['id'][_0x956e('0x8b')](),_0x956e('0x5d'))['field']('NOW()',_0x956e('0x56'))['field'](_0x956e('0x8a'),_0x956e('0x57'))[_0x956e('0x8c')](_0x956e('0x8d'))[_0x956e('0x3c')](_0x956e('0x8e'))[_0x956e('0x3c')](_0x956e('0x8f'),_0x3b7ccb[_0x956e('0x90')][_0x956e('0x8b')]())[_0x956e('0x3c')](_0x956e('0x91'))[_0x956e('0x3c')](_0x956e('0x92'),squel[_0x956e('0x87')]()['field'](_0x956e('0x93'))['from'](_0x956e('0x94'))['where'](_0x956e('0x95'),_0x19016d[_0x956e('0x47')]['id'][_0x956e('0x8b')]()))[_0x956e('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x956e('0x89')](_0x956e('0x96'))['from'](_0x956e('0x97'))[_0x956e('0x3c')](_0x956e('0x95'),_0x19016d['params']['id']['toString']())))[_0x956e('0x8b')]();break;case _0x956e('0x98'):_0x203bed=squel[_0x956e('0x99')]()[_0x956e('0x82')]('cm_hopper')[_0x956e('0x83')]([_0x956e('0x88'),_0x956e('0x84'),'ContactId',_0x956e('0x86'),_0x956e('0x5d'),'createdAt','updatedAt'],squel[_0x956e('0x87')]()[_0x956e('0x89')](_0x956e('0x88'),_0x956e('0x88'))['field']('NOW()',_0x956e('0x84'))[_0x956e('0x89')]('id','ContactId')[_0x956e('0x89')](_0x3b7ccb[_0x956e('0x90')][_0x956e('0x8b')](),_0x956e('0x86'))[_0x956e('0x89')](_0x19016d['params']['id'][_0x956e('0x8b')](),_0x956e('0x5d'))[_0x956e('0x89')](_0x956e('0x8a'),_0x956e('0x56'))[_0x956e('0x89')](_0x956e('0x8a'),_0x956e('0x57'))[_0x956e('0x8c')](_0x956e('0x8d'))[_0x956e('0x3c')](_0x956e('0x8e'))[_0x956e('0x3c')](_0x956e('0x8f'),_0x3b7ccb[_0x956e('0x90')]['toString']())[_0x956e('0x3c')](_0x956e('0x91'))[_0x956e('0x3c')](_0x956e('0x92'),squel[_0x956e('0x87')]()[_0x956e('0x89')](_0x956e('0x96'))['from'](_0x956e('0x97'))['where'](_0x956e('0x95'),_0x19016d[_0x956e('0x47')]['id'][_0x956e('0x8b')]())))[_0x956e('0x8b')]();break;default:_0x203bed=squel['insert']()[_0x956e('0x82')](_0x956e('0x97'))[_0x956e('0x83')]([_0x956e('0x88'),_0x956e('0x84'),_0x956e('0x85'),_0x956e('0x86'),_0x956e('0x5d'),_0x956e('0x56'),_0x956e('0x57')],squel[_0x956e('0x87')]()['field'](_0x956e('0x88'),'phone')[_0x956e('0x89')](_0x956e('0x8a'),'scheduledAt')[_0x956e('0x89')]('id','ContactId')[_0x956e('0x89')](_0x3b7ccb[_0x956e('0x90')][_0x956e('0x8b')](),_0x956e('0x86'))[_0x956e('0x89')](_0x19016d['params']['id']['toString'](),'VoiceQueueId')['field'](_0x956e('0x8a'),'createdAt')['field'](_0x956e('0x8a'),_0x956e('0x57'))['from'](_0x956e('0x8d'))[_0x956e('0x3c')](_0x956e('0x8e'))[_0x956e('0x3c')](_0x956e('0x8f'),_0x3b7ccb['CmListId'][_0x956e('0x8b')]())['where'](_0x956e('0x91')))['toString']();}_0x12fce2[_0x956e('0x9a')](db[_0x956e('0x9b')][_0x956e('0x31')](_0x203bed));}return BPromise[_0x956e('0x9c')](_0x12fce2);}})['then'](function(){return _0x52bce9;})['then'](respondWithResult(_0x29cd77,null))[_0x956e('0x52')](handleError(_0x29cd77,null));};exports[_0x956e('0x9d')]=function(_0x4eeece,_0x2549f2,_0x2d63df){var _0x4134;return db['VoiceQueue'][_0x956e('0x4c')]({'where':{'id':_0x4eeece[_0x956e('0x47')]['id']}})['then'](handleEntityNotFound(_0x2549f2,null))[_0x956e('0x23')](function(_0x2b0aea){if(_0x2b0aea){return _0x2b0aea[_0x956e('0x9d')](_0x4eeece['query'][_0x956e('0x68')]);}})[_0x956e('0x23')](function(_0x41d84e){if(_0x41d84e){_0x4134=_0x41d84e;return db['CmHopper'][_0x956e('0x22')]({'where':{'ListId':_0x4eeece[_0x956e('0x31')]['ids'],'VoiceQueueId':_0x4eeece[_0x956e('0x47')]['id']}})[_0x956e('0x23')](function(){return _0x4134;});}})[_0x956e('0x23')](respondWithStatusCode(_0x2549f2,null))[_0x956e('0x52')](handleError(_0x2549f2,null));};exports[_0x956e('0x9e')]=function(_0x1ac62e,_0x4d4f0a,_0x3a9cce){var _0x77a371={};var _0x4c7c9c={};var _0x4b79be;var _0x36ce9c;return db[_0x956e('0x45')][_0x956e('0x5b')]({'where':{'id':_0x1ac62e[_0x956e('0x47')]['id']}})['then'](handleEntityNotFound(_0x4d4f0a,null))[_0x956e('0x23')](function(_0x3d327e){if(_0x3d327e){_0x4b79be=_0x3d327e;_0x4c7c9c['model']=_[_0x956e('0x30')](db['CmList'][_0x956e('0x2e')]);_0x4c7c9c[_0x956e('0x31')]=_[_0x956e('0x30')](_0x1ac62e['query']);_0x4c7c9c['filters']=_['intersection'](_0x4c7c9c[_0x956e('0x2f')],_0x4c7c9c[_0x956e('0x31')]);_0x77a371[_0x956e('0x34')]=_['intersection'](_0x4c7c9c[_0x956e('0x2f')],qs[_0x956e('0x35')](_0x1ac62e[_0x956e('0x31')][_0x956e('0x35')]));_0x77a371['attributes']=_0x77a371['attributes'][_0x956e('0x36')]?_0x77a371[_0x956e('0x34')]:_0x4c7c9c[_0x956e('0x2f')];_0x77a371['order']=qs[_0x956e('0x3b')](_0x1ac62e['query'][_0x956e('0x3b')]);_0x77a371[_0x956e('0x3c')]=qs[_0x956e('0x32')](_['pick'](_0x1ac62e['query'],_0x4c7c9c[_0x956e('0x32')]));if(_0x1ac62e[_0x956e('0x31')][_0x956e('0x40')]){_0x77a371[_0x956e('0x3c')]=_[_0x956e('0x41')](_0x77a371[_0x956e('0x3c')],{'$or':_[_0x956e('0x3e')](_0x77a371[_0x956e('0x34')],function(_0x235b61){var _0x43f250={};_0x43f250[_0x235b61]={'$like':'%'+_0x1ac62e[_0x956e('0x31')][_0x956e('0x40')]+'%'};return _0x43f250;})});}_0x77a371=_['merge']({},_0x77a371,_0x1ac62e[_0x956e('0x42')]);return _0x4b79be[_0x956e('0x9e')](_0x77a371);}})[_0x956e('0x23')](function(_0x5f0253){if(_0x5f0253){_0x36ce9c=_0x5f0253['length'];if(!_0x1ac62e[_0x956e('0x31')][_0x956e('0x37')](_0x956e('0x38'))){_0x77a371[_0x956e('0x39')]=qs['limit'](_0x1ac62e['query'][_0x956e('0x39')]);_0x77a371[_0x956e('0x1f')]=qs[_0x956e('0x1f')](_0x1ac62e[_0x956e('0x31')]['offset']);}return _0x4b79be[_0x956e('0x9e')](_0x77a371);}})[_0x956e('0x23')](function(_0xaca15f){if(_0xaca15f){return _0xaca15f?{'count':_0x36ce9c,'rows':_0xaca15f}:null;}})[_0x956e('0x23')](respondWithResult(_0x4d4f0a,null))[_0x956e('0x52')](handleError(_0x4d4f0a,null));};exports[_0x956e('0x9f')]=function(_0x164f15,_0x22fd9e,_0x417de7){var _0xddba7f,_0x3ffaa3;return db[_0x956e('0x45')]['find']({'where':{'id':_0x164f15[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x22fd9e,null))[_0x956e('0x23')](function(_0x10b419){if(_0x10b419){_0x3ffaa3=_0x10b419;return _0x10b419[_0x956e('0x9f')](_0x164f15['body']['ids'],_[_0x956e('0x55')](_0x164f15[_0x956e('0x48')],[_0x956e('0x68'),'id'])||{});}return null;})['spread'](function(_0x191c6b){var _0x180dc5;_0xddba7f=_0x191c6b||[];var _0x4b1beb=[];if(_0x191c6b){for(var _0x310b8e=0x0;_0x310b8e<_0x191c6b['length'];_0x310b8e+=0x1){var _0x453aeb=_0x191c6b[_0x310b8e][_0x956e('0x24')]({'plain':!![]});_0x180dc5=squel['insert']()[_0x956e('0x82')](_0x956e('0xa0'))['fromQuery'](['phone',_0x956e('0x85'),'ListId','VoiceQueueId',_0x956e('0x56'),'updatedAt'],squel[_0x956e('0x87')]()['field'](_0x956e('0x88'),_0x956e('0x88'))[_0x956e('0x89')]('id',_0x956e('0x85'))['field'](_0x453aeb[_0x956e('0x90')]['toString'](),_0x956e('0x86'))['field'](_0x164f15['params']['id'][_0x956e('0x8b')](),_0x956e('0x5d'))[_0x956e('0x89')]('NOW()','createdAt')[_0x956e('0x89')](_0x956e('0x8a'),_0x956e('0x57'))[_0x956e('0x8c')](_0x956e('0x8d'))[_0x956e('0x3c')](_0x956e('0x8e'))[_0x956e('0x3c')]('ListId\x20=\x20?',_0x453aeb[_0x956e('0x90')][_0x956e('0x8b')]())[_0x956e('0x3c')](_0x956e('0x91')))[_0x956e('0x8b')]();_0x4b1beb[_0x956e('0x9a')](db[_0x956e('0x9b')]['query'](_0x180dc5));}return BPromise[_0x956e('0x9c')](_0x4b1beb);}})['then'](function(){return _0xddba7f;})['then'](respondWithResult(_0x22fd9e,null))[_0x956e('0x52')](handleError(_0x22fd9e,null));};exports[_0x956e('0xa1')]=function(_0x184843,_0x1be470,_0x11b008){var _0x3e8271;return db[_0x956e('0x45')][_0x956e('0x4c')]({'where':{'id':_0x184843[_0x956e('0x47')]['id']}})[_0x956e('0x23')](handleEntityNotFound(_0x1be470,null))[_0x956e('0x23')](function(_0x4ccd0e){if(_0x4ccd0e){return _0x4ccd0e[_0x956e('0xa1')](_0x184843[_0x956e('0x31')]['ids']);}})[_0x956e('0x23')](function(_0x52f400){if(_0x52f400){_0x3e8271=_0x52f400;return db[_0x956e('0x64')][_0x956e('0x22')]({'where':{'ListId':_0x184843[_0x956e('0x31')][_0x956e('0x68')],'VoiceQueueId':_0x184843[_0x956e('0x47')]['id']}})[_0x956e('0x23')](function(){return _0x3e8271;});}})[_0x956e('0x23')](respondWithStatusCode(_0x1be470,null))[_0x956e('0x52')](handleError(_0x1be470,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index f213854..5365903 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 _0xac2c=['remove','emit','hasOwnProperty','VoiceQueue','setMaxListeners','save'];(function(_0x271539,_0x16796){var _0x46b336=function(_0x15a14d){while(--_0x15a14d){_0x271539['push'](_0x271539['shift']());}};_0x46b336(++_0x16796);}(_0xac2c,0x195));var _0xcac2=function(_0x19a028,_0x161bbc){_0x19a028=_0x19a028-0x0;var _0x2822b0=_0xac2c[_0x19a028];return _0x2822b0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0xcac2('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xcac2('0x1')](0x0);var events={'afterCreate':_0xcac2('0x2'),'afterUpdate':'update','afterDestroy':_0xcac2('0x3')};function emitEvent(_0x118d96){return function(_0x3ce04b,_0x4f9835,_0x5212e0){VoiceQueueEvents[_0xcac2('0x4')](_0x118d96+':'+_0x3ce04b['id'],_0x3ce04b);VoiceQueueEvents[_0xcac2('0x4')](_0x118d96,_0x3ce04b);_0x5212e0(null);};}for(var e in events){if(events[_0xcac2('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x41fc=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x57f9ab,_0x238378){var _0x385a96=function(_0x43ac57){while(--_0x43ac57){_0x57f9ab['push'](_0x57f9ab['shift']());}};_0x385a96(++_0x238378);}(_0x41fc,0x1c6));var _0xc41f=function(_0x5cfeb2,_0x28b867){_0x5cfeb2=_0x5cfeb2-0x0;var _0x1affe7=_0x41fc[_0x5cfeb2];return _0x1affe7;};'use strict';var EventEmitter=require(_0xc41f('0x0'));var VoiceQueue=require(_0xc41f('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc41f('0x2'),'afterUpdate':_0xc41f('0x3'),'afterDestroy':_0xc41f('0x4')};function emitEvent(_0x5f06ff){return function(_0x3a2e61,_0x1776af,_0x2e263d){VoiceQueueEvents['emit'](_0x5f06ff+':'+_0x3a2e61['id'],_0x3a2e61);VoiceQueueEvents[_0xc41f('0x5')](_0x5f06ff,_0x3a2e61);_0x2e263d(null);};}for(var e in events){if(events[_0xc41f('0x6')](e)){var event=events[e];VoiceQueue[_0xc41f('0x7')](e,emitEvent(event));}}module[_0xc41f('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 3f76527..7f0a8bd 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 _0x7e1b=['./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x7e1b,0xeb));var _0xb7e1=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x7e1b[_0x4a3898];return _0x25ceb0;};'use strict';var _=require('lodash');var util=require(_0xb7e1('0x0'));var logger=require(_0xb7e1('0x1'))('api');var moment=require(_0xb7e1('0x2'));var BPromise=require(_0xb7e1('0x3'));var rp=require(_0xb7e1('0x4'));var attributes=require(_0xb7e1('0x5'));module[_0xb7e1('0x6')]=function(_0x5db924,_0x5ee984){return _0x5db924[_0xb7e1('0x7')](_0xb7e1('0x8'),attributes,{'tableName':_0xb7e1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5108=['api','moment','bluebird','request-promise','./voiceQueue.attributes','define','VoiceQueue','voice_queues','lodash','util','../../config/logger'];(function(_0x3e9b1e,_0x1c6337){var _0x376d16=function(_0x5103fa){while(--_0x5103fa){_0x3e9b1e['push'](_0x3e9b1e['shift']());}};_0x376d16(++_0x1c6337);}(_0x5108,0x81));var _0x8510=function(_0x5165f1,_0x2411d7){_0x5165f1=_0x5165f1-0x0;var _0x381f9d=_0x5108[_0x5165f1];return _0x381f9d;};'use strict';var _=require(_0x8510('0x0'));var util=require(_0x8510('0x1'));var logger=require(_0x8510('0x2'))(_0x8510('0x3'));var moment=require(_0x8510('0x4'));var BPromise=require(_0x8510('0x5'));var rp=require(_0x8510('0x6'));var attributes=require(_0x8510('0x7'));module['exports']=function(_0x17bd52,_0x103035){return _0x17bd52[_0x8510('0x8')](_0x8510('0x9'),attributes,{'tableName':_0x8510('0xa'),'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 15d8fff..5501c09 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(_0x5d8104,_0x53906b){var _0x3aeb9a=function(_0x341388){while(--_0x341388){_0x5d8104['push'](_0x5d8104['shift']());}};_0x3aeb9a(++_0x53906b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x230949,_0x790da6){var _0x54a3dd=function(_0x510d0d){while(--_0x510d0d){_0x230949['push'](_0x230949['shift']());}};_0x54a3dd(++_0x790da6);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index cbe80ae..4369843 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 _0x2b27=['./voiceQueue.events','save','update','removeListener','register','length','voiceQueue:'];(function(_0x2ec26a,_0x48f9a2){var _0x56bffb=function(_0x364fa4){while(--_0x364fa4){_0x2ec26a['push'](_0x2ec26a['shift']());}};_0x56bffb(++_0x48f9a2);}(_0x2b27,0x134));var _0x72b2=function(_0x4c9d00,_0x5092d5){_0x4c9d00=_0x4c9d00-0x0;var _0x4a73f5=_0x2b27[_0x4c9d00];return _0x4a73f5;};'use strict';var VoiceQueueEvents=require(_0x72b2('0x0'));var events=[_0x72b2('0x1'),'remove',_0x72b2('0x2')];function createListener(_0xc92e25,_0x3805f6){return function(_0x361add){_0x3805f6['emit'](_0xc92e25,_0x361add);};}function removeListener(_0x3a7e8a,_0x45d841){return function(){VoiceQueueEvents[_0x72b2('0x3')](_0x3a7e8a,_0x45d841);};}exports[_0x72b2('0x4')]=function(_0x8d573d){for(var _0x3c2afc=0x0,_0x36b493=events[_0x72b2('0x5')];_0x3c2afc<_0x36b493;_0x3c2afc++){var _0x2ae41a=events[_0x3c2afc];var _0x544100=createListener(_0x72b2('0x6')+_0x2ae41a,_0x8d573d);VoiceQueueEvents['on'](_0x2ae41a,_0x544100);}}; \ No newline at end of file +var _0x04c0=['save','remove','update','emit','register','voiceQueue:','./voiceQueue.events'];(function(_0x4e7d4a,_0x35cdc8){var _0x235800=function(_0x59ff40){while(--_0x59ff40){_0x4e7d4a['push'](_0x4e7d4a['shift']());}};_0x235800(++_0x35cdc8);}(_0x04c0,0x76));var _0x004c=function(_0x14c37c,_0x68856d){_0x14c37c=_0x14c37c-0x0;var _0x4cf3df=_0x04c0[_0x14c37c];return _0x4cf3df;};'use strict';var VoiceQueueEvents=require(_0x004c('0x0'));var events=[_0x004c('0x1'),_0x004c('0x2'),_0x004c('0x3')];function createListener(_0x1bf98d,_0x4201b1){return function(_0x5a42ca){_0x4201b1[_0x004c('0x4')](_0x1bf98d,_0x5a42ca);};}function removeListener(_0x1d25e3,_0x58fe37){return function(){VoiceQueueEvents['removeListener'](_0x1d25e3,_0x58fe37);};}exports[_0x004c('0x5')]=function(_0x3c5973){for(var _0x5779d1=0x0,_0x430e69=events['length'];_0x5779d1<_0x430e69;_0x5779d1++){var _0x559029=events[_0x5779d1];var _0x32721f=createListener(_0x004c('0x6')+_0x559029,_0x3c5973);VoiceQueueEvents['on'](_0x559029,_0x32721f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 2544ce5..ed37e5a 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 _0xba8b=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','delete','destroy'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xba8b,0x121));var _0xbba8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xba8b[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0xbba8('0x0'));var util=require(_0xbba8('0x1'));var path=require(_0xbba8('0x2'));var timeout=require(_0xbba8('0x3'));var express=require(_0xbba8('0x4'));var router=express[_0xbba8('0x5')]();var auth=require(_0xbba8('0x6'));var interaction=require(_0xbba8('0x7'));var config=require(_0xbba8('0x8'));var controller=require(_0xbba8('0x9'));router[_0xbba8('0xa')]('/',auth[_0xbba8('0xb')](),controller['index']);router['get'](_0xbba8('0xc'),auth['isAuthenticated'](),controller[_0xbba8('0xd')]);router[_0xbba8('0xa')](_0xbba8('0xe'),auth[_0xbba8('0xb')](),controller[_0xbba8('0xf')]);router['get']('/:id',auth[_0xbba8('0xb')](),controller[_0xbba8('0x10')]);router[_0xbba8('0x11')]('/',auth[_0xbba8('0xb')](),controller[_0xbba8('0x12')]);router[_0xbba8('0x13')](_0xbba8('0x14'),auth[_0xbba8('0xb')](),controller['update']);router[_0xbba8('0x15')](_0xbba8('0x14'),auth['isAuthenticated'](),controller[_0xbba8('0x16')]);module[_0xbba8('0x17')]=router; \ No newline at end of file +var _0x9fce=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','show','create','/:id','update'];(function(_0x3c9a00,_0x7138c2){var _0x34e444=function(_0x2fd425){while(--_0x2fd425){_0x3c9a00['push'](_0x3c9a00['shift']());}};_0x34e444(++_0x7138c2);}(_0x9fce,0x18e));var _0xe9fc=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0x9fce[_0x254b22];return _0x1279db;};'use strict';var multer=require(_0xe9fc('0x0'));var util=require(_0xe9fc('0x1'));var path=require(_0xe9fc('0x2'));var timeout=require(_0xe9fc('0x3'));var express=require(_0xe9fc('0x4'));var router=express[_0xe9fc('0x5')]();var auth=require(_0xe9fc('0x6'));var interaction=require(_0xe9fc('0x7'));var config=require(_0xe9fc('0x8'));var controller=require(_0xe9fc('0x9'));router[_0xe9fc('0xa')]('/',auth[_0xe9fc('0xb')](),controller[_0xe9fc('0xc')]);router['get'](_0xe9fc('0xd'),auth['isAuthenticated'](),controller[_0xe9fc('0xe')]);router['get']('/index',auth[_0xe9fc('0xb')](),controller[_0xe9fc('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe9fc('0x10')]);router['post']('/',auth[_0xe9fc('0xb')](),controller[_0xe9fc('0x11')]);router['put'](_0xe9fc('0x12'),auth[_0xe9fc('0xb')](),controller[_0xe9fc('0x13')]);router[_0xe9fc('0x14')](_0xe9fc('0x12'),auth[_0xe9fc('0xb')](),controller[_0xe9fc('0x15')]);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 92416a0..8559956 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 _0x733a=['getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','exports','STRING','DATE'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x733a,0x176));var _0xa733=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x733a[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0xa733('0x0'));var moment=require('moment');module[_0xa733('0x1')]={'type':{'type':Sequelize[_0xa733('0x2')]},'uniqueid':{'type':Sequelize[_0xa733('0x2')]},'calleridnum':{'type':Sequelize[_0xa733('0x2')]},'calleridname':{'type':Sequelize[_0xa733('0x2')]},'queue':{'type':Sequelize[_0xa733('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xa733('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xa733('0x3')],'set':function(_0x6b7747){var _0x22ca5b=moment(_0x6b7747);var _0x48f922=moment(this[_0xa733('0x4')]('queuecallerjoinAt'))[_0xa733('0x5')](_0xa733('0x6'));var _0x391f75=_0x22ca5b['diff'](_0x48f922,_0xa733('0x7'));this[_0xa733('0x8')](_0xa733('0x9'),_0x6b7747);this[_0xa733('0x8')](_0xa733('0xa'),_0x391f75||null);}},'position':{'type':Sequelize[_0xa733('0xb')]},'count':{'type':Sequelize[_0xa733('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xa733('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa733('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa733('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xa733('0x2')],'comment':_0xa733('0xd')},'originalposition':{'type':Sequelize[_0xa733('0xb')]},'channel':{'type':Sequelize[_0xa733('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa733('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa733('0x2')]},'context':{'type':Sequelize[_0xa733('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa733('0x2')]},'holdtime':{'type':Sequelize[_0xa733('0xb')]},'mohtime':{'type':Sequelize[_0xa733('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa733('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xa733('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa733('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xa733('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa733('0x2')]},'disposition':{'type':Sequelize[_0xa733('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xa733('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf59b=['DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING'];(function(_0x3667a5,_0x3949c2){var _0x1589a0=function(_0x4cd33d){while(--_0x4cd33d){_0x3667a5['push'](_0x3667a5['shift']());}};_0x1589a0(++_0x3949c2);}(_0xf59b,0xd9));var _0xbf59=function(_0x24e3f0,_0x291458){_0x24e3f0=_0x24e3f0-0x0;var _0x36b770=_0xf59b[_0x24e3f0];return _0x36b770;};'use strict';var Sequelize=require(_0xbf59('0x0'));var moment=require(_0xbf59('0x1'));module[_0xbf59('0x2')]={'type':{'type':Sequelize[_0xbf59('0x3')]},'uniqueid':{'type':Sequelize[_0xbf59('0x3')]},'calleridnum':{'type':Sequelize[_0xbf59('0x3')]},'calleridname':{'type':Sequelize[_0xbf59('0x3')]},'queue':{'type':Sequelize[_0xbf59('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xbf59('0x4')],'set':function(_0x58199f){var _0x30e5c4=moment(_0x58199f);var _0x4a7db7=moment(this[_0xbf59('0x5')](_0xbf59('0x6')))[_0xbf59('0x7')](_0xbf59('0x8'));var _0x518eaa=_0x30e5c4[_0xbf59('0x9')](_0x4a7db7,'seconds');this[_0xbf59('0xa')](_0xbf59('0xb'),_0x58199f);this[_0xbf59('0xa')](_0xbf59('0xc'),_0x518eaa||null);}},'position':{'type':Sequelize[_0xbf59('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xbf59('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xbf59('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xbf59('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xbf59('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xbf59('0x3')],'comment':_0xbf59('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xbf59('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbf59('0x3')]},'accountcode':{'type':Sequelize[_0xbf59('0x3')]},'context':{'type':Sequelize[_0xbf59('0x3')]},'exten':{'type':Sequelize[_0xbf59('0x3')]},'priority':{'type':Sequelize[_0xbf59('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xbf59('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xbf59('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbf59('0x3')],'comment':_0xbf59('0x10')},'transferexten':{'type':Sequelize[_0xbf59('0x3')]},'transferuniqueid':{'type':Sequelize[_0xbf59('0x3')]},'disposition':{'type':Sequelize[_0xbf59('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xbf59('0xd')],'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 6629af0..ec7b109 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 _0xc469=['desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','options','include','VoiceQueueReport','findAll','rows','show','params','find','catch','create','body','describe','getVoiceQueuesReport','includeAll','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel'];(function(_0x3b0248,_0x3bff86){var _0x37e905=function(_0x2da122){while(--_0x2da122){_0x3b0248['push'](_0x3b0248['shift']());}};_0x37e905(++_0x3bff86);}(_0xc469,0xe5));var _0x9c46=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xc469[_0x548627];return _0x844a84;};'use strict';var pdf=require(_0x9c46('0x0'));var emlformat=require(_0x9c46('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9c46('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c46('0x3'));var moment=require(_0x9c46('0x4'));var BPromise=require(_0x9c46('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9c46('0x6'));var sox=require(_0x9c46('0x7'));var csv=require(_0x9c46('0x8'));var ejs=require(_0x9c46('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9c46('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9c46('0xb'));var toCsv=require(_0x9c46('0x8'));var querystring=require(_0x9c46('0xc'));var Papa=require('papaparse');var authService=require(_0x9c46('0xd'));var hardwareService=require(_0x9c46('0xe'));var Redis=require(_0x9c46('0xf'));var qs=require(_0x9c46('0x10'));var logger=require(_0x9c46('0x11'))(_0x9c46('0x12'));var utils=require('../../config/utils');var config=require(_0x9c46('0x13'));var db=require(_0x9c46('0x14'))['db'];config[_0x9c46('0x15')]=_[_0x9c46('0x16')](config[_0x9c46('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c46('0x17'))(new Redis(config[_0x9c46('0x15')]));require(_0x9c46('0x18'))[_0x9c46('0x19')](socket);function respondWithStatusCode(_0x3216e9,_0x160b09){_0x160b09=_0x160b09||0xcc;return function(_0x1d624d){if(_0x1d624d){return _0x3216e9['sendStatus'](_0x160b09);}return _0x3216e9[_0x9c46('0x1a')](_0x160b09)['end']();};}function respondWithResult(_0x41c299,_0x35d368){_0x35d368=_0x35d368||0xc8;return function(_0x1fe612){if(_0x1fe612){return _0x41c299[_0x9c46('0x1a')](_0x35d368)[_0x9c46('0x1b')](_0x1fe612);}};}function respondWithFilteredResult(_0x2c251e,_0x188e3f){return function(_0x3d1e9d){if(_0x3d1e9d){var _0xcf7f0d=_0x3d1e9d[_0x9c46('0x1c')],_0x2ba416=_0x188e3f[_0x9c46('0x1d')],_0x484702=_0x188e3f['offset']+_0x188e3f[_0x9c46('0x1e')],_0x256bce;if(_0x484702>=_0xcf7f0d){_0x484702=_0xcf7f0d;_0x256bce=0xc8;}else{_0x256bce=0xce;}_0x2c251e['status'](_0x256bce);return _0x2c251e[_0x9c46('0x1f')](_0x9c46('0x20'),_0x2ba416+'-'+_0x484702+'/'+_0xcf7f0d)['json'](_0x3d1e9d);}return null;};}function patchUpdates(_0x2d24d1){return function(_0x3f5d3c){try{jsonpatch['apply'](_0x3f5d3c,_0x2d24d1,!![]);}catch(_0x5c591f){return BPromise[_0x9c46('0x21')](_0x5c591f);}return _0x3f5d3c[_0x9c46('0x22')]();};}function saveUpdates(_0x373e78,_0x4a7e6f){return function(_0x52a233){if(_0x52a233){return _0x52a233[_0x9c46('0x23')](_0x373e78)[_0x9c46('0x24')](function(_0x3e1107){return _0x3e1107;});}return null;};}function removeEntity(_0x321999,_0x2a0c1a){return function(_0x10ff11){if(_0x10ff11){return _0x10ff11[_0x9c46('0x25')]()[_0x9c46('0x24')](function(){_0x321999[_0x9c46('0x1a')](0xcc)[_0x9c46('0x26')]();});}};}function handleEntityNotFound(_0x56f186,_0x45025a){return function(_0x14dcff){if(!_0x14dcff){_0x56f186[_0x9c46('0x27')](0x194);}return _0x14dcff;};}function handleError(_0xb33adb,_0x829da4){_0x829da4=_0x829da4||0x1f4;return function(_0xc385e6){logger[_0x9c46('0x28')](_0xc385e6[_0x9c46('0x29')]);if(_0xc385e6[_0x9c46('0x2a')]){delete _0xc385e6[_0x9c46('0x2a')];}_0xb33adb[_0x9c46('0x1a')](_0x829da4)[_0x9c46('0x2b')](_0xc385e6);};}exports[_0x9c46('0x2c')]=function(_0x4bc4ea,_0x19bb60){var _0x1c4970={},_0x14a1de={},_0x1831e8={'count':0x0,'rows':[]};var _0x1b3e3c=db['VoiceQueueReport'][_0x9c46('0x2d')];_0x14a1de[_0x9c46('0x2e')]=_['keys'](_0x1b3e3c);_0x14a1de[_0x9c46('0x2f')]=_[_0x9c46('0x30')](_0x4bc4ea[_0x9c46('0x2f')]);_0x14a1de[_0x9c46('0x31')]=_[_0x9c46('0x32')](_0x14a1de[_0x9c46('0x2e')],_0x14a1de['query']);_0x1c4970[_0x9c46('0x33')]=_['intersection'](_0x14a1de['model'],qs[_0x9c46('0x34')](_0x4bc4ea['query'][_0x9c46('0x34')]));_0x1c4970[_0x9c46('0x33')]=_0x1c4970[_0x9c46('0x33')][_0x9c46('0x35')]?_0x1c4970[_0x9c46('0x33')]:_0x14a1de[_0x9c46('0x2e')];if(!_0x4bc4ea[_0x9c46('0x2f')][_0x9c46('0x36')](_0x9c46('0x37'))){_0x1c4970[_0x9c46('0x1e')]=qs[_0x9c46('0x1e')](_0x4bc4ea['query'][_0x9c46('0x1e')]);_0x1c4970['offset']=qs['offset'](_0x4bc4ea[_0x9c46('0x2f')][_0x9c46('0x1d')]);}_0x1c4970[_0x9c46('0x38')]=qs[_0x9c46('0x39')](_0x4bc4ea[_0x9c46('0x2f')][_0x9c46('0x39')]);_0x1c4970['where']=qs[_0x9c46('0x31')](_[_0x9c46('0x3a')](_0x4bc4ea[_0x9c46('0x2f')],_0x14a1de['filters']));if(_0x4bc4ea['query'][_0x9c46('0x3b')]){_0x1c4970[_0x9c46('0x3c')]=_[_0x9c46('0x3d')](_0x1c4970[_0x9c46('0x3c')],{'$or':_[_0x9c46('0x3e')](_0x1b3e3c,function(_0x52f635){if(_0x52f635[_0x9c46('0x3f')][_0x9c46('0x40')]!==_0x9c46('0x41')){var _0x2905f5={};_0x2905f5[_0x52f635['field']]={'$like':'%'+_0x4bc4ea[_0x9c46('0x2f')][_0x9c46('0x3b')]+'%'};return _0x2905f5;}})});}_0x1c4970=_[_0x9c46('0x3d')]({},_0x1c4970,_0x4bc4ea[_0x9c46('0x42')]);var _0x5ada85={'where':_0x1c4970[_0x9c46('0x3c')]};return db['VoiceQueueReport'][_0x9c46('0x1c')](_0x5ada85)['then'](function(_0x450b97){_0x1831e8[_0x9c46('0x1c')]=_0x450b97;if(_0x4bc4ea['query']['includeAll']){_0x1c4970[_0x9c46('0x43')]=[{'all':!![]}];}return db[_0x9c46('0x44')][_0x9c46('0x45')](_0x1c4970);})['then'](function(_0x1b159c){_0x1831e8[_0x9c46('0x46')]=_0x1b159c;return _0x1831e8;})['then'](respondWithFilteredResult(_0x19bb60,_0x1c4970))['catch'](handleError(_0x19bb60,null));};exports[_0x9c46('0x47')]=function(_0x3ea26d,_0x431c86){var _0x25424b={'raw':![],'where':{'id':_0x3ea26d[_0x9c46('0x48')]['id']}},_0xd8b639={};_0xd8b639[_0x9c46('0x2e')]=_[_0x9c46('0x30')](db[_0x9c46('0x44')][_0x9c46('0x2d')]);_0xd8b639[_0x9c46('0x2f')]=_[_0x9c46('0x30')](_0x3ea26d[_0x9c46('0x2f')]);_0xd8b639[_0x9c46('0x31')]=_[_0x9c46('0x32')](_0xd8b639[_0x9c46('0x2e')],_0xd8b639[_0x9c46('0x2f')]);_0x25424b['attributes']=_['intersection'](_0xd8b639[_0x9c46('0x2e')],qs[_0x9c46('0x34')](_0x3ea26d['query']['fields']));_0x25424b[_0x9c46('0x33')]=_0x25424b[_0x9c46('0x33')][_0x9c46('0x35')]?_0x25424b[_0x9c46('0x33')]:_0xd8b639['model'];if(_0x3ea26d[_0x9c46('0x2f')]['includeAll']){_0x25424b[_0x9c46('0x43')]=[{'all':!![]}];}_0x25424b=_[_0x9c46('0x3d')]({},_0x25424b,_0x3ea26d[_0x9c46('0x42')]);return db[_0x9c46('0x44')][_0x9c46('0x49')](_0x25424b)[_0x9c46('0x24')](handleEntityNotFound(_0x431c86,null))[_0x9c46('0x24')](respondWithResult(_0x431c86,null))[_0x9c46('0x4a')](handleError(_0x431c86,null));};exports[_0x9c46('0x4b')]=function(_0x40eedf,_0x2554ce){return db[_0x9c46('0x44')][_0x9c46('0x4b')](_0x40eedf[_0x9c46('0x4c')],{})['then'](respondWithResult(_0x2554ce,0xc9))['catch'](handleError(_0x2554ce,null));};exports[_0x9c46('0x23')]=function(_0xfa1cf8,_0x2e4267){if(_0xfa1cf8[_0x9c46('0x4c')]['id']){delete _0xfa1cf8['body']['id'];}return db[_0x9c46('0x44')][_0x9c46('0x49')]({'where':{'id':_0xfa1cf8['params']['id']}})[_0x9c46('0x24')](handleEntityNotFound(_0x2e4267,null))[_0x9c46('0x24')](saveUpdates(_0xfa1cf8['body'],null))[_0x9c46('0x24')](respondWithResult(_0x2e4267,null))['catch'](handleError(_0x2e4267,null));};exports[_0x9c46('0x25')]=function(_0x19f9c2,_0x22ac3b){return db[_0x9c46('0x44')][_0x9c46('0x49')]({'where':{'id':_0x19f9c2['params']['id']}})[_0x9c46('0x24')](handleEntityNotFound(_0x22ac3b,null))[_0x9c46('0x24')](removeEntity(_0x22ac3b,null))[_0x9c46('0x4a')](handleError(_0x22ac3b,null));};exports[_0x9c46('0x4d')]=function(_0x203f6d,_0x18e8e4){return db[_0x9c46('0x44')][_0x9c46('0x4d')]()[_0x9c46('0x24')](respondWithResult(_0x18e8e4,null))[_0x9c46('0x4a')](handleError(_0x18e8e4,null));};exports[_0x9c46('0x4e')]=function(_0x26dad8,_0x56b5af){var _0x51c727={},_0x5cd25b={},_0x4a792a={'count':0x0,'rows':[]};_0x5cd25b[_0x9c46('0x2e')]=_['keys'](db['VoiceQueueReport'][_0x9c46('0x2d')]);_0x5cd25b[_0x9c46('0x2f')]=_[_0x9c46('0x30')](_0x26dad8[_0x9c46('0x2f')]);_0x5cd25b['filters']=_[_0x9c46('0x32')](_0x5cd25b[_0x9c46('0x2e')],_0x5cd25b[_0x9c46('0x2f')]);_0x51c727[_0x9c46('0x33')]=_[_0x9c46('0x32')](_0x5cd25b[_0x9c46('0x2e')],qs[_0x9c46('0x34')](_0x26dad8[_0x9c46('0x2f')]['fields']));_0x51c727[_0x9c46('0x33')]=_0x51c727[_0x9c46('0x33')][_0x9c46('0x35')]?_0x51c727[_0x9c46('0x33')]:_0x5cd25b[_0x9c46('0x2e')];if(!_0x26dad8[_0x9c46('0x2f')][_0x9c46('0x36')](_0x9c46('0x37'))){_0x51c727[_0x9c46('0x1e')]=qs[_0x9c46('0x1e')](_0x26dad8[_0x9c46('0x2f')][_0x9c46('0x1e')]);_0x51c727[_0x9c46('0x1d')]=qs[_0x9c46('0x1d')](_0x26dad8[_0x9c46('0x2f')][_0x9c46('0x1d')]);}_0x51c727[_0x9c46('0x38')]=qs['sort'](_0x26dad8[_0x9c46('0x2f')][_0x9c46('0x39')]);_0x51c727[_0x9c46('0x3c')]=qs[_0x9c46('0x31')](_[_0x9c46('0x3a')](_0x26dad8[_0x9c46('0x2f')],_0x5cd25b[_0x9c46('0x31')]));if(_0x26dad8[_0x9c46('0x2f')][_0x9c46('0x3b')]){_0x51c727['where']=_[_0x9c46('0x3d')](_0x51c727[_0x9c46('0x3c')],{'$or':_[_0x9c46('0x3e')](_0x51c727[_0x9c46('0x33')],function(_0x10d4b4){var _0x5c27b8={};_0x5c27b8[_0x10d4b4]={'$like':'%'+_0x26dad8[_0x9c46('0x2f')][_0x9c46('0x3b')]+'%'};return _0x5c27b8;})});}_0x51c727=_[_0x9c46('0x3d')]({},_0x51c727,_0x26dad8[_0x9c46('0x42')]);var _0x3989f7={'where':_0x51c727[_0x9c46('0x3c')]};return db[_0x9c46('0x44')][_0x9c46('0x1c')](_0x3989f7)['then'](function(_0x11e2f8){_0x4a792a[_0x9c46('0x1c')]=_0x11e2f8;if(_0x26dad8[_0x9c46('0x2f')][_0x9c46('0x4f')]){_0x51c727[_0x9c46('0x43')]=[{'all':!![]}];}return db[_0x9c46('0x44')][_0x9c46('0x45')](_0x51c727);})[_0x9c46('0x24')](function(_0x253348){_0x4a792a[_0x9c46('0x46')]=_0x253348;return _0x4a792a;})[_0x9c46('0x24')](respondWithFilteredResult(_0x56b5af,_0x51c727,_0x9c46('0x4e')))[_0x9c46('0x4a')](handleError(_0x56b5af,null,_0x9c46('0x4e')));}; \ No newline at end of file +var _0xa4f8=['hasOwnProperty','nolimit','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','keys','length','find','create','body','params','destroy','describe','getVoiceQueuesReport','order','sort','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','send','index','VoiceQueueReport','rawAttributes','model','query','filters','attributes','intersection','fields'];(function(_0x1ef6fa,_0x4fd8c6){var _0x54977d=function(_0x153699){while(--_0x153699){_0x1ef6fa['push'](_0x1ef6fa['shift']());}};_0x54977d(++_0x4fd8c6);}(_0xa4f8,0x119));var _0x8a4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4f8[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x8a4f('0x0'));var emlformat=require(_0x8a4f('0x1'));var rimraf=require(_0x8a4f('0x2'));var zipdir=require(_0x8a4f('0x3'));var jsonpatch=require(_0x8a4f('0x4'));var rp=require(_0x8a4f('0x5'));var moment=require(_0x8a4f('0x6'));var BPromise=require(_0x8a4f('0x7'));var Mustache=require(_0x8a4f('0x8'));var util=require(_0x8a4f('0x9'));var path=require('path');var sox=require(_0x8a4f('0xa'));var csv=require(_0x8a4f('0xb'));var ejs=require(_0x8a4f('0xc'));var fs=require('fs');var _=require(_0x8a4f('0xd'));var squel=require(_0x8a4f('0xe'));var crypto=require('crypto');var jsforce=require(_0x8a4f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8a4f('0xb'));var querystring=require(_0x8a4f('0x10'));var Papa=require(_0x8a4f('0x11'));var authService=require(_0x8a4f('0x12'));var hardwareService=require(_0x8a4f('0x13'));var Redis=require(_0x8a4f('0x14'));var qs=require(_0x8a4f('0x15'));var logger=require('../../config/logger')(_0x8a4f('0x16'));var utils=require(_0x8a4f('0x17'));var config=require(_0x8a4f('0x18'));var db=require(_0x8a4f('0x19'))['db'];config[_0x8a4f('0x1a')]=_[_0x8a4f('0x1b')](config['redis'],{'host':_0x8a4f('0x1c'),'port':0x18eb});var socket=require(_0x8a4f('0x1d'))(new Redis(config[_0x8a4f('0x1a')]));require('./voiceQueueReport.socket')[_0x8a4f('0x1e')](socket);function respondWithStatusCode(_0x558f83,_0x2a5fe5){_0x2a5fe5=_0x2a5fe5||0xcc;return function(_0x30b247){if(_0x30b247){return _0x558f83[_0x8a4f('0x1f')](_0x2a5fe5);}return _0x558f83[_0x8a4f('0x20')](_0x2a5fe5)[_0x8a4f('0x21')]();};}function respondWithResult(_0x423865,_0x2bfd0a){_0x2bfd0a=_0x2bfd0a||0xc8;return function(_0x1b1989){if(_0x1b1989){return _0x423865[_0x8a4f('0x20')](_0x2bfd0a)[_0x8a4f('0x22')](_0x1b1989);}};}function respondWithFilteredResult(_0x339975,_0x5dd85){return function(_0x15111b){if(_0x15111b){var _0x2208d7=_0x15111b['count'],_0x4a28f1=_0x5dd85[_0x8a4f('0x23')],_0x76db07=_0x5dd85['offset']+_0x5dd85[_0x8a4f('0x24')],_0x1d4c48;if(_0x76db07>=_0x2208d7){_0x76db07=_0x2208d7;_0x1d4c48=0xc8;}else{_0x1d4c48=0xce;}_0x339975['status'](_0x1d4c48);return _0x339975[_0x8a4f('0x25')](_0x8a4f('0x26'),_0x4a28f1+'-'+_0x76db07+'/'+_0x2208d7)[_0x8a4f('0x22')](_0x15111b);}return null;};}function patchUpdates(_0xadb6f1){return function(_0xf4d699){try{jsonpatch[_0x8a4f('0x27')](_0xf4d699,_0xadb6f1,!![]);}catch(_0xb65764){return BPromise[_0x8a4f('0x28')](_0xb65764);}return _0xf4d699['save']();};}function saveUpdates(_0x3a6548,_0x86c4ff){return function(_0x189b33){if(_0x189b33){return _0x189b33[_0x8a4f('0x29')](_0x3a6548)[_0x8a4f('0x2a')](function(_0x2096eb){return _0x2096eb;});}return null;};}function removeEntity(_0x5b6d4f,_0x135670){return function(_0x2a3d06){if(_0x2a3d06){return _0x2a3d06['destroy']()['then'](function(){_0x5b6d4f[_0x8a4f('0x20')](0xcc)[_0x8a4f('0x21')]();});}};}function handleEntityNotFound(_0x442f22,_0x137cd8){return function(_0x103d62){if(!_0x103d62){_0x442f22[_0x8a4f('0x1f')](0x194);}return _0x103d62;};}function handleError(_0x3cb104,_0x28448b){_0x28448b=_0x28448b||0x1f4;return function(_0x31a019){logger[_0x8a4f('0x2b')](_0x31a019[_0x8a4f('0x2c')]);if(_0x31a019['name']){delete _0x31a019['name'];}_0x3cb104[_0x8a4f('0x20')](_0x28448b)[_0x8a4f('0x2d')](_0x31a019);};}exports[_0x8a4f('0x2e')]=function(_0x3cfae0,_0x3bd981){var _0x39dcb8={},_0x43d4a9={},_0x1fa29f={'count':0x0,'rows':[]};var _0x1e5017=db[_0x8a4f('0x2f')][_0x8a4f('0x30')];_0x43d4a9[_0x8a4f('0x31')]=_['keys'](_0x1e5017);_0x43d4a9[_0x8a4f('0x32')]=_['keys'](_0x3cfae0[_0x8a4f('0x32')]);_0x43d4a9[_0x8a4f('0x33')]=_['intersection'](_0x43d4a9['model'],_0x43d4a9[_0x8a4f('0x32')]);_0x39dcb8[_0x8a4f('0x34')]=_[_0x8a4f('0x35')](_0x43d4a9[_0x8a4f('0x31')],qs[_0x8a4f('0x36')](_0x3cfae0['query']['fields']));_0x39dcb8['attributes']=_0x39dcb8[_0x8a4f('0x34')]['length']?_0x39dcb8[_0x8a4f('0x34')]:_0x43d4a9[_0x8a4f('0x31')];if(!_0x3cfae0[_0x8a4f('0x32')][_0x8a4f('0x37')](_0x8a4f('0x38'))){_0x39dcb8[_0x8a4f('0x24')]=qs[_0x8a4f('0x24')](_0x3cfae0[_0x8a4f('0x32')][_0x8a4f('0x24')]);_0x39dcb8[_0x8a4f('0x23')]=qs['offset'](_0x3cfae0[_0x8a4f('0x32')][_0x8a4f('0x23')]);}_0x39dcb8['order']=qs['sort'](_0x3cfae0['query']['sort']);_0x39dcb8[_0x8a4f('0x39')]=qs['filters'](_[_0x8a4f('0x3a')](_0x3cfae0[_0x8a4f('0x32')],_0x43d4a9['filters']));if(_0x3cfae0[_0x8a4f('0x32')][_0x8a4f('0x3b')]){_0x39dcb8[_0x8a4f('0x39')]=_[_0x8a4f('0x3c')](_0x39dcb8[_0x8a4f('0x39')],{'$or':_[_0x8a4f('0x3d')](_0x1e5017,function(_0x1036d1){if(_0x1036d1[_0x8a4f('0x3e')][_0x8a4f('0x3f')]!==_0x8a4f('0x40')){var _0x17c8a2={};_0x17c8a2[_0x1036d1[_0x8a4f('0x41')]]={'$like':'%'+_0x3cfae0['query'][_0x8a4f('0x3b')]+'%'};return _0x17c8a2;}})});}_0x39dcb8=_[_0x8a4f('0x3c')]({},_0x39dcb8,_0x3cfae0[_0x8a4f('0x42')]);var _0x52cdbd={'where':_0x39dcb8['where']};return db[_0x8a4f('0x2f')][_0x8a4f('0x43')](_0x52cdbd)[_0x8a4f('0x2a')](function(_0x4a2bb2){_0x1fa29f[_0x8a4f('0x43')]=_0x4a2bb2;if(_0x3cfae0[_0x8a4f('0x32')][_0x8a4f('0x44')]){_0x39dcb8[_0x8a4f('0x45')]=[{'all':!![]}];}return db[_0x8a4f('0x2f')][_0x8a4f('0x46')](_0x39dcb8);})[_0x8a4f('0x2a')](function(_0x24b2f4){_0x1fa29f[_0x8a4f('0x47')]=_0x24b2f4;return _0x1fa29f;})[_0x8a4f('0x2a')](respondWithFilteredResult(_0x3bd981,_0x39dcb8))[_0x8a4f('0x48')](handleError(_0x3bd981,null));};exports['show']=function(_0x455b00,_0x37f2a9){var _0x16e71f={'raw':![],'where':{'id':_0x455b00['params']['id']}},_0xd593ec={};_0xd593ec['model']=_[_0x8a4f('0x49')](db[_0x8a4f('0x2f')][_0x8a4f('0x30')]);_0xd593ec[_0x8a4f('0x32')]=_[_0x8a4f('0x49')](_0x455b00[_0x8a4f('0x32')]);_0xd593ec['filters']=_[_0x8a4f('0x35')](_0xd593ec[_0x8a4f('0x31')],_0xd593ec['query']);_0x16e71f[_0x8a4f('0x34')]=_['intersection'](_0xd593ec[_0x8a4f('0x31')],qs[_0x8a4f('0x36')](_0x455b00['query'][_0x8a4f('0x36')]));_0x16e71f[_0x8a4f('0x34')]=_0x16e71f[_0x8a4f('0x34')][_0x8a4f('0x4a')]?_0x16e71f[_0x8a4f('0x34')]:_0xd593ec[_0x8a4f('0x31')];if(_0x455b00[_0x8a4f('0x32')][_0x8a4f('0x44')]){_0x16e71f['include']=[{'all':!![]}];}_0x16e71f=_[_0x8a4f('0x3c')]({},_0x16e71f,_0x455b00['options']);return db[_0x8a4f('0x2f')][_0x8a4f('0x4b')](_0x16e71f)[_0x8a4f('0x2a')](handleEntityNotFound(_0x37f2a9,null))[_0x8a4f('0x2a')](respondWithResult(_0x37f2a9,null))[_0x8a4f('0x48')](handleError(_0x37f2a9,null));};exports['create']=function(_0x547bc8,_0x5c0027){return db['VoiceQueueReport'][_0x8a4f('0x4c')](_0x547bc8[_0x8a4f('0x4d')],{})[_0x8a4f('0x2a')](respondWithResult(_0x5c0027,0xc9))[_0x8a4f('0x48')](handleError(_0x5c0027,null));};exports['update']=function(_0x179cb4,_0x15964b){if(_0x179cb4[_0x8a4f('0x4d')]['id']){delete _0x179cb4[_0x8a4f('0x4d')]['id'];}return db[_0x8a4f('0x2f')]['find']({'where':{'id':_0x179cb4[_0x8a4f('0x4e')]['id']}})[_0x8a4f('0x2a')](handleEntityNotFound(_0x15964b,null))['then'](saveUpdates(_0x179cb4[_0x8a4f('0x4d')],null))[_0x8a4f('0x2a')](respondWithResult(_0x15964b,null))[_0x8a4f('0x48')](handleError(_0x15964b,null));};exports[_0x8a4f('0x4f')]=function(_0x17eed9,_0x51f38d){return db[_0x8a4f('0x2f')][_0x8a4f('0x4b')]({'where':{'id':_0x17eed9[_0x8a4f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x51f38d,null))[_0x8a4f('0x2a')](removeEntity(_0x51f38d,null))[_0x8a4f('0x48')](handleError(_0x51f38d,null));};exports[_0x8a4f('0x50')]=function(_0xed343,_0x5deae8){return db[_0x8a4f('0x2f')][_0x8a4f('0x50')]()[_0x8a4f('0x2a')](respondWithResult(_0x5deae8,null))['catch'](handleError(_0x5deae8,null));};exports[_0x8a4f('0x51')]=function(_0x2d4437,_0x357ea5){var _0x18b63c={},_0x20acab={},_0x4ae8cb={'count':0x0,'rows':[]};_0x20acab['model']=_[_0x8a4f('0x49')](db[_0x8a4f('0x2f')][_0x8a4f('0x30')]);_0x20acab['query']=_['keys'](_0x2d4437[_0x8a4f('0x32')]);_0x20acab[_0x8a4f('0x33')]=_[_0x8a4f('0x35')](_0x20acab['model'],_0x20acab[_0x8a4f('0x32')]);_0x18b63c['attributes']=_['intersection'](_0x20acab[_0x8a4f('0x31')],qs[_0x8a4f('0x36')](_0x2d4437[_0x8a4f('0x32')][_0x8a4f('0x36')]));_0x18b63c[_0x8a4f('0x34')]=_0x18b63c[_0x8a4f('0x34')][_0x8a4f('0x4a')]?_0x18b63c[_0x8a4f('0x34')]:_0x20acab['model'];if(!_0x2d4437['query'][_0x8a4f('0x37')](_0x8a4f('0x38'))){_0x18b63c['limit']=qs['limit'](_0x2d4437['query'][_0x8a4f('0x24')]);_0x18b63c[_0x8a4f('0x23')]=qs[_0x8a4f('0x23')](_0x2d4437[_0x8a4f('0x32')][_0x8a4f('0x23')]);}_0x18b63c[_0x8a4f('0x52')]=qs[_0x8a4f('0x53')](_0x2d4437[_0x8a4f('0x32')][_0x8a4f('0x53')]);_0x18b63c['where']=qs[_0x8a4f('0x33')](_['pick'](_0x2d4437['query'],_0x20acab[_0x8a4f('0x33')]));if(_0x2d4437[_0x8a4f('0x32')]['filter']){_0x18b63c[_0x8a4f('0x39')]=_[_0x8a4f('0x3c')](_0x18b63c[_0x8a4f('0x39')],{'$or':_[_0x8a4f('0x3d')](_0x18b63c[_0x8a4f('0x34')],function(_0x52747e){var _0xa9300d={};_0xa9300d[_0x52747e]={'$like':'%'+_0x2d4437[_0x8a4f('0x32')][_0x8a4f('0x3b')]+'%'};return _0xa9300d;})});}_0x18b63c=_[_0x8a4f('0x3c')]({},_0x18b63c,_0x2d4437[_0x8a4f('0x42')]);var _0x4acc1c={'where':_0x18b63c['where']};return db['VoiceQueueReport'][_0x8a4f('0x43')](_0x4acc1c)[_0x8a4f('0x2a')](function(_0x1ae873){_0x4ae8cb[_0x8a4f('0x43')]=_0x1ae873;if(_0x2d4437[_0x8a4f('0x32')][_0x8a4f('0x44')]){_0x18b63c[_0x8a4f('0x45')]=[{'all':!![]}];}return db[_0x8a4f('0x2f')][_0x8a4f('0x46')](_0x18b63c);})[_0x8a4f('0x2a')](function(_0xeb0ab6){_0x4ae8cb[_0x8a4f('0x47')]=_0xeb0ab6;return _0x4ae8cb;})[_0x8a4f('0x2a')](respondWithFilteredResult(_0x357ea5,_0x18b63c,_0x8a4f('0x51')))[_0x8a4f('0x48')](handleError(_0x357ea5,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 9dace13..a7feb46 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 _0x9ff7=['hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x3ee7e2,_0x15cf09){var _0x1c1f18=function(_0x3426e0){while(--_0x3426e0){_0x3ee7e2['push'](_0x3ee7e2['shift']());}};_0x1c1f18(++_0x15cf09);}(_0x9ff7,0x110));var _0x79ff=function(_0xa88412,_0x5dfc58){_0xa88412=_0xa88412-0x0;var _0x3e8001=_0x9ff7[_0xa88412];return _0x3e8001;};'use strict';var EventEmitter=require(_0x79ff('0x0'));var VoiceQueueReport=require(_0x79ff('0x1'))['db'][_0x79ff('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x79ff('0x3')](0x0);var events={'afterCreate':_0x79ff('0x4'),'afterUpdate':_0x79ff('0x5'),'afterDestroy':'remove'};function emitEvent(_0xa8cd18){return function(_0x494aef,_0x492c5c,_0x167691){VoiceQueueReportEvents[_0x79ff('0x6')](_0xa8cd18+':'+_0x494aef['id'],_0x494aef);VoiceQueueReportEvents[_0x79ff('0x6')](_0xa8cd18,_0x494aef);_0x167691(null);};}for(var e in events){if(events[_0x79ff('0x7')](e)){var event=events[e];VoiceQueueReport[_0x79ff('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x4532=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','exports','events'];(function(_0xf0d3b3,_0xdb0210){var _0x5c8866=function(_0x1795e7){while(--_0x1795e7){_0xf0d3b3['push'](_0xf0d3b3['shift']());}};_0x5c8866(++_0xdb0210);}(_0x4532,0x187));var _0x2453=function(_0x5b1639,_0xa164e9){_0x5b1639=_0x5b1639-0x0;var _0x2941ac=_0x4532[_0x5b1639];return _0x2941ac;};'use strict';var EventEmitter=require(_0x2453('0x0'));var VoiceQueueReport=require(_0x2453('0x1'))['db'][_0x2453('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2453('0x3')](0x0);var events={'afterCreate':_0x2453('0x4'),'afterUpdate':'update','afterDestroy':_0x2453('0x5')};function emitEvent(_0x55f0bd){return function(_0x2daa44,_0x3f2b5f,_0x12f67d){VoiceQueueReportEvents[_0x2453('0x6')](_0x55f0bd+':'+_0x2daa44['id'],_0x2daa44);VoiceQueueReportEvents[_0x2453('0x6')](_0x55f0bd,_0x2daa44);_0x12f67d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x2453('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 27fffd0..ea05a87 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 _0xe62a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','define','VoiceQueueReport','report_queue'];(function(_0x8014d8,_0x134a36){var _0x581b7b=function(_0x45c7ce){while(--_0x45c7ce){_0x8014d8['push'](_0x8014d8['shift']());}};_0x581b7b(++_0x134a36);}(_0xe62a,0x12c));var _0xae62=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe62a[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae62('0x0'));var util=require(_0xae62('0x1'));var logger=require(_0xae62('0x2'))(_0xae62('0x3'));var moment=require(_0xae62('0x4'));var BPromise=require(_0xae62('0x5'));var rp=require(_0xae62('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x189866,_0x30d17b){return _0x189866[_0xae62('0x7')](_0xae62('0x8'),attributes,{'tableName':_0xae62('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d76=['report_queue','calleridnum','lodash','util','api','bluebird','request-promise','./voiceQueueReport.attributes','exports','define','VoiceQueueReport'];(function(_0x4ec099,_0x27e8cc){var _0x47d097=function(_0x4be712){while(--_0x4be712){_0x4ec099['push'](_0x4ec099['shift']());}};_0x47d097(++_0x27e8cc);}(_0x5d76,0x1f1));var _0x65d7=function(_0x322b2e,_0x1f7b80){_0x322b2e=_0x322b2e-0x0;var _0x43a736=_0x5d76[_0x322b2e];return _0x43a736;};'use strict';var _=require(_0x65d7('0x0'));var util=require(_0x65d7('0x1'));var logger=require('../../config/logger')(_0x65d7('0x2'));var moment=require('moment');var BPromise=require(_0x65d7('0x3'));var rp=require(_0x65d7('0x4'));var attributes=require(_0x65d7('0x5'));module[_0x65d7('0x6')]=function(_0x22c006,_0xd27881){return _0x22c006[_0x65d7('0x7')](_0x65d7('0x8'),attributes,{'tableName':_0x65d7('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x65d7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 425b65d..21f9875 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 _0x70d0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','body','stringify','update','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis'];(function(_0x3cd83e,_0x45831b){var _0x581f3c=function(_0x24f6cd){while(--_0x24f6cd){_0x3cd83e['push'](_0x3cd83e['shift']());}};_0x581f3c(++_0x45831b);}(_0x70d0,0x79));var _0x070d=function(_0x3cf387,_0x31ed26){_0x3cf387=_0x3cf387-0x0;var _0x24425f=_0x70d0[_0x3cf387];return _0x24425f;};'use strict';var _=require('lodash');var util=require(_0x070d('0x0'));var moment=require(_0x070d('0x1'));var BPromise=require(_0x070d('0x2'));var rs=require(_0x070d('0x3'));var fs=require('fs');var Redis=require(_0x070d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x070d('0x5'))(_0x070d('0x6'));var config=require(_0x070d('0x7'));var jayson=require(_0x070d('0x8'));var client=jayson[_0x070d('0x9')][_0x070d('0xa')]({'port':0x232a});config['redis']=_[_0x070d('0xb')](config[_0x070d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x070d('0xd'))(new Redis(config['redis']));require(_0x070d('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e4f97,_0x3c70f3,_0x3058a1){return new BPromise(function(_0x19e84f,_0x810eb4){return client[_0x070d('0xf')](_0x2e4f97,_0x3058a1)[_0x070d('0x10')](function(_0x3df3cb){logger[_0x070d('0x11')](_0x070d('0x12'),_0x3c70f3,'request\x20sent');logger[_0x070d('0x13')](_0x070d('0x14'),_0x3c70f3,_0x070d('0x15'),JSON['stringify'](_0x3df3cb));if(_0x3df3cb[_0x070d('0x16')]){if(_0x3df3cb[_0x070d('0x16')][_0x070d('0x17')]===0x1f4){logger[_0x070d('0x16')](_0x070d('0x12'),_0x3c70f3,_0x3df3cb[_0x070d('0x16')][_0x070d('0x18')]);return _0x810eb4(_0x3df3cb[_0x070d('0x16')]['message']);}logger[_0x070d('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x3c70f3,_0x3df3cb[_0x070d('0x16')][_0x070d('0x18')]);return _0x19e84f(_0x3df3cb['error'][_0x070d('0x18')]);}else{logger[_0x070d('0x11')](_0x070d('0x12'),_0x3c70f3,_0x070d('0x15'));_0x19e84f(_0x3df3cb[_0x070d('0x19')]['message']);}})[_0x070d('0x1a')](function(_0x44672f){logger[_0x070d('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x3c70f3,_0x44672f);_0x810eb4(_0x44672f);});});}exports['GetVoiceQueueReport']=function(_0x401cfb){var _0x26dfc3=this;return new Promise(function(_0x2837e6,_0xa0a7aa){return db[_0x070d('0x1b')]['findAll']({'raw':_0x401cfb['options']?_0x401cfb[_0x070d('0x1c')][_0x070d('0x1d')]===undefined?!![]:![]:!![],'where':_0x401cfb[_0x070d('0x1c')]?_0x401cfb[_0x070d('0x1c')][_0x070d('0x1e')]||null:null,'attributes':_0x401cfb['options']?_0x401cfb[_0x070d('0x1c')][_0x070d('0x1f')]||null:null,'limit':_0x401cfb[_0x070d('0x1c')]?_0x401cfb[_0x070d('0x1c')][_0x070d('0x20')]||null:null,'include':_0x401cfb[_0x070d('0x1c')]?_0x401cfb[_0x070d('0x1c')][_0x070d('0x21')]?_[_0x070d('0x22')](_0x401cfb[_0x070d('0x1c')][_0x070d('0x21')],function(_0x189c90){return{'model':db[_0x189c90[_0x070d('0x23')]],'as':_0x189c90['as'],'attributes':_0x189c90['attributes'],'include':_0x189c90['include']?_[_0x070d('0x22')](_0x189c90[_0x070d('0x21')],function(_0x257042){return{'model':db[_0x257042[_0x070d('0x23')]],'as':_0x257042['as'],'attributes':_0x257042['attributes'],'include':_0x257042[_0x070d('0x21')]?_[_0x070d('0x22')](_0x257042[_0x070d('0x21')],function(_0x49f5d0){return{'model':db[_0x49f5d0[_0x070d('0x23')]],'as':_0x49f5d0['as'],'attributes':_0x49f5d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x070d('0x10')](function(_0x34bf4a){logger[_0x070d('0x11')](_0x070d('0x24'),_0x401cfb);logger[_0x070d('0x13')](_0x070d('0x24'),_0x401cfb,JSON['stringify'](_0x34bf4a));_0x2837e6(_0x34bf4a);})[_0x070d('0x1a')](function(_0x9113c9){logger[_0x070d('0x16')](_0x070d('0x24'),_0x9113c9[_0x070d('0x18')],_0x401cfb);_0xa0a7aa(_0x26dfc3['error'](0x1f4,_0x9113c9[_0x070d('0x18')]));});});};exports[_0x070d('0x25')]=function(_0x6d4ab6){var _0x44db2e=this;return new Promise(function(_0x514642,_0x54bbab){return db[_0x070d('0x1b')]['create'](_0x6d4ab6[_0x070d('0x26')],{'raw':_0x6d4ab6[_0x070d('0x1c')]?_0x6d4ab6[_0x070d('0x1c')][_0x070d('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x283c2b){logger[_0x070d('0x11')](_0x070d('0x25'),_0x6d4ab6);logger[_0x070d('0x13')]('CreateVoiceQueueReport',_0x6d4ab6,JSON[_0x070d('0x27')](_0x283c2b));_0x514642(_0x283c2b);})[_0x070d('0x1a')](function(_0xf86050){logger[_0x070d('0x16')](_0x070d('0x25'),_0xf86050[_0x070d('0x18')],_0x6d4ab6);_0x54bbab(_0x44db2e[_0x070d('0x16')](0x1f4,_0xf86050['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x16a778){var _0x2f708f=this;return new Promise(function(_0x108685,_0x1bc1de){return db['VoiceQueueReport'][_0x070d('0x28')](_0x16a778[_0x070d('0x26')],{'raw':_0x16a778[_0x070d('0x1c')]?_0x16a778[_0x070d('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16a778['options']?_0x16a778[_0x070d('0x1c')][_0x070d('0x1e')]||null:null,'attributes':_0x16a778[_0x070d('0x1c')]?_0x16a778[_0x070d('0x1c')][_0x070d('0x1f')]||null:null,'limit':_0x16a778['options']?_0x16a778['options'][_0x070d('0x20')]||null:null})['then'](function(_0x51e243){logger['info'](_0x070d('0x29'),_0x16a778);logger['debug'](_0x070d('0x29'),_0x16a778,JSON[_0x070d('0x27')](_0x51e243));_0x108685(_0x51e243);})[_0x070d('0x1a')](function(_0x6c741b){logger[_0x070d('0x16')]('UpdateVoiceQueueReport',_0x6c741b[_0x070d('0x18')],_0x16a778);_0x1bc1de(_0x2f708f[_0x070d('0x16')](0x1f4,_0x6c741b[_0x070d('0x18')]));});});}; \ No newline at end of file +var _0xd1ae=['where','attributes','include','map','model','then','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw'];(function(_0x30c2ae,_0x4c98a2){var _0x1ee1cc=function(_0x165922){while(--_0x165922){_0x30c2ae['push'](_0x30c2ae['shift']());}};_0x1ee1cc(++_0x4c98a2);}(_0xd1ae,0x8d));var _0xed1a=function(_0x32476c,_0xdf9c5c){_0x32476c=_0x32476c-0x0;var _0x33fb50=_0xd1ae[_0x32476c];return _0x33fb50;};'use strict';var _=require(_0xed1a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xed1a('0x1'));var fs=require('fs');var Redis=require(_0xed1a('0x2'));var db=require(_0xed1a('0x3'))['db'];var utils=require(_0xed1a('0x4'));var logger=require(_0xed1a('0x5'))(_0xed1a('0x6'));var config=require('../../config/environment');var jayson=require(_0xed1a('0x7'));var client=jayson[_0xed1a('0x8')][_0xed1a('0x9')]({'port':0x232a});config[_0xed1a('0xa')]=_[_0xed1a('0xb')](config[_0xed1a('0xa')],{'host':_0xed1a('0xc'),'port':0x18eb});var socket=require(_0xed1a('0xd'))(new Redis(config[_0xed1a('0xa')]));require(_0xed1a('0xe'))[_0xed1a('0xf')](socket);function respondWithRpcPromise(_0x3c42fd,_0x523a19,_0x5986ab){return new BPromise(function(_0x9343b1,_0x418243){return client[_0xed1a('0x10')](_0x3c42fd,_0x5986ab)['then'](function(_0x56f028){logger[_0xed1a('0x11')](_0xed1a('0x12'),_0x523a19,_0xed1a('0x13'));logger[_0xed1a('0x14')](_0xed1a('0x15'),_0x523a19,'request\x20sent',JSON[_0xed1a('0x16')](_0x56f028));if(_0x56f028[_0xed1a('0x17')]){if(_0x56f028[_0xed1a('0x17')][_0xed1a('0x18')]===0x1f4){logger['error'](_0xed1a('0x12'),_0x523a19,_0x56f028['error'][_0xed1a('0x19')]);return _0x418243(_0x56f028['error'][_0xed1a('0x19')]);}logger[_0xed1a('0x17')](_0xed1a('0x12'),_0x523a19,_0x56f028[_0xed1a('0x17')][_0xed1a('0x19')]);return _0x9343b1(_0x56f028[_0xed1a('0x17')][_0xed1a('0x19')]);}else{logger[_0xed1a('0x11')](_0xed1a('0x12'),_0x523a19,_0xed1a('0x13'));_0x9343b1(_0x56f028['result']['message']);}})[_0xed1a('0x1a')](function(_0x3f1c66){logger[_0xed1a('0x17')](_0xed1a('0x12'),_0x523a19,_0x3f1c66);_0x418243(_0x3f1c66);});});}exports[_0xed1a('0x1b')]=function(_0x3a9b99){var _0x5479e7=this;return new Promise(function(_0xcf0284,_0xb7354a){return db[_0xed1a('0x1c')]['findAll']({'raw':_0x3a9b99[_0xed1a('0x1d')]?_0x3a9b99[_0xed1a('0x1d')][_0xed1a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3a9b99[_0xed1a('0x1d')]?_0x3a9b99[_0xed1a('0x1d')][_0xed1a('0x1f')]||null:null,'attributes':_0x3a9b99[_0xed1a('0x1d')]?_0x3a9b99[_0xed1a('0x1d')][_0xed1a('0x20')]||null:null,'limit':_0x3a9b99['options']?_0x3a9b99[_0xed1a('0x1d')]['limit']||null:null,'include':_0x3a9b99[_0xed1a('0x1d')]?_0x3a9b99[_0xed1a('0x1d')][_0xed1a('0x21')]?_[_0xed1a('0x22')](_0x3a9b99[_0xed1a('0x1d')][_0xed1a('0x21')],function(_0x4c170a){return{'model':db[_0x4c170a[_0xed1a('0x23')]],'as':_0x4c170a['as'],'attributes':_0x4c170a['attributes'],'include':_0x4c170a['include']?_[_0xed1a('0x22')](_0x4c170a[_0xed1a('0x21')],function(_0x30fb5a){return{'model':db[_0x30fb5a[_0xed1a('0x23')]],'as':_0x30fb5a['as'],'attributes':_0x30fb5a['attributes'],'include':_0x30fb5a[_0xed1a('0x21')]?_[_0xed1a('0x22')](_0x30fb5a['include'],function(_0x10be68){return{'model':db[_0x10be68[_0xed1a('0x23')]],'as':_0x10be68['as'],'attributes':_0x10be68['attributes']};}):[]};}):[]};}):[]:[]})[_0xed1a('0x24')](function(_0x462467){logger[_0xed1a('0x11')](_0xed1a('0x1b'),_0x3a9b99);logger[_0xed1a('0x14')]('GetVoiceQueueReport',_0x3a9b99,JSON['stringify'](_0x462467));_0xcf0284(_0x462467);})[_0xed1a('0x1a')](function(_0x1ad05d){logger[_0xed1a('0x17')](_0xed1a('0x1b'),_0x1ad05d[_0xed1a('0x19')],_0x3a9b99);_0xb7354a(_0x5479e7[_0xed1a('0x17')](0x1f4,_0x1ad05d[_0xed1a('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0x318d0f){var _0x54f7e3=this;return new Promise(function(_0x218a9f,_0x9f2a29){return db[_0xed1a('0x1c')][_0xed1a('0x25')](_0x318d0f[_0xed1a('0x26')],{'raw':_0x318d0f[_0xed1a('0x1d')]?_0x318d0f[_0xed1a('0x1d')][_0xed1a('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x4673e9){logger['info'](_0xed1a('0x27'),_0x318d0f);logger[_0xed1a('0x14')]('CreateVoiceQueueReport',_0x318d0f,JSON[_0xed1a('0x16')](_0x4673e9));_0x218a9f(_0x4673e9);})[_0xed1a('0x1a')](function(_0x3c8373){logger[_0xed1a('0x17')](_0xed1a('0x27'),_0x3c8373[_0xed1a('0x19')],_0x318d0f);_0x9f2a29(_0x54f7e3[_0xed1a('0x17')](0x1f4,_0x3c8373['message']));});});};exports[_0xed1a('0x28')]=function(_0x5dde39){var _0x4cdd1f=this;return new Promise(function(_0x2aad20,_0x3c8b45){return db[_0xed1a('0x1c')][_0xed1a('0x29')](_0x5dde39[_0xed1a('0x26')],{'raw':_0x5dde39['options']?_0x5dde39[_0xed1a('0x1d')][_0xed1a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dde39[_0xed1a('0x1d')]?_0x5dde39['options'][_0xed1a('0x1f')]||null:null,'attributes':_0x5dde39[_0xed1a('0x1d')]?_0x5dde39[_0xed1a('0x1d')][_0xed1a('0x20')]||null:null,'limit':_0x5dde39['options']?_0x5dde39['options'][_0xed1a('0x2a')]||null:null})[_0xed1a('0x24')](function(_0x5aa639){logger['info'](_0xed1a('0x28'),_0x5dde39);logger[_0xed1a('0x14')](_0xed1a('0x28'),_0x5dde39,JSON[_0xed1a('0x16')](_0x5aa639));_0x2aad20(_0x5aa639);})[_0xed1a('0x1a')](function(_0x1da101){logger['error']('UpdateVoiceQueueReport',_0x1da101[_0xed1a('0x19')],_0x5dde39);_0x3c8b45(_0x4cdd1f[_0xed1a('0x17')](0x1f4,_0x1da101[_0xed1a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 3b2563a..b8b696d 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 _0xa8b1=['remove','update','emit','register','length','save'];(function(_0x236209,_0x51b840){var _0x2afd5b=function(_0x15b5d6){while(--_0x15b5d6){_0x236209['push'](_0x236209['shift']());}};_0x2afd5b(++_0x51b840);}(_0xa8b1,0xd7));var _0x1a8b=function(_0x3389a3,_0x34a8){_0x3389a3=_0x3389a3-0x0;var _0x3c1845=_0xa8b1[_0x3389a3];return _0x3c1845;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x1a8b('0x0'),_0x1a8b('0x1'),_0x1a8b('0x2')];function createListener(_0x45639d,_0x17cccf){return function(_0x366ce7){_0x17cccf[_0x1a8b('0x3')](_0x45639d,_0x366ce7);};}function removeListener(_0x2d7428,_0x1bd8cd){return function(){VoiceQueueReportEvents['removeListener'](_0x2d7428,_0x1bd8cd);};}exports[_0x1a8b('0x4')]=function(_0x1da8c6){for(var _0x51f893=0x0,_0x4d30f6=events[_0x1a8b('0x5')];_0x51f893<_0x4d30f6;_0x51f893++){var _0x16ea06=events[_0x51f893];var _0x5c12a0=createListener('voiceQueueReport:'+_0x16ea06,_0x1da8c6);VoiceQueueReportEvents['on'](_0x16ea06,_0x5c12a0);}}; \ No newline at end of file +var _0x1349=['emit','removeListener','./voiceQueueReport.events','save','remove','update'];(function(_0x129e8d,_0x1ede69){var _0x54e472=function(_0x64dbf5){while(--_0x64dbf5){_0x129e8d['push'](_0x129e8d['shift']());}};_0x54e472(++_0x1ede69);}(_0x1349,0x1ac));var _0x9134=function(_0x93bf39,_0x11ee0b){_0x93bf39=_0x93bf39-0x0;var _0x28782a=_0x1349[_0x93bf39];return _0x28782a;};'use strict';var VoiceQueueReportEvents=require(_0x9134('0x0'));var events=[_0x9134('0x1'),_0x9134('0x2'),_0x9134('0x3')];function createListener(_0x35d01f,_0x2ac8ca){return function(_0x45124a){_0x2ac8ca[_0x9134('0x4')](_0x35d01f,_0x45124a);};}function removeListener(_0x276239,_0x5e7f95){return function(){VoiceQueueReportEvents[_0x9134('0x5')](_0x276239,_0x5e7f95);};}exports['register']=function(_0x147fb6){for(var _0x16b31e=0x0,_0x23eb8e=events['length'];_0x16b31e<_0x23eb8e;_0x16b31e++){var _0x54ff29=events[_0x16b31e];var _0x17608f=createListener('voiceQueueReport:'+_0x54ff29,_0x147fb6);VoiceQueueReportEvents['on'](_0x54ff29,_0x17608f);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 8a12eef..2573a6e 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 _0x6209=['Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x49c3e4,_0x138882){var _0x26f6e2=function(_0x2b66e7){while(--_0x2b66e7){_0x49c3e4['push'](_0x49c3e4['shift']());}};_0x26f6e2(++_0x138882);}(_0x6209,0x1e8));var _0x9620=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6209[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x9620('0x0'));var util=require(_0x9620('0x1'));var path=require(_0x9620('0x2'));var timeout=require(_0x9620('0x3'));var express=require(_0x9620('0x4'));var router=express[_0x9620('0x5')]();var auth=require(_0x9620('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9620('0x7'));var controller=require(_0x9620('0x8'));router[_0x9620('0x9')]('/',auth['isAuthenticated'](),controller[_0x9620('0xa')]);router[_0x9620('0x9')](_0x9620('0xb'),auth[_0x9620('0xc')](),controller['show']);router['post']('/',auth[_0x9620('0xc')](),controller['create']);router[_0x9620('0xd')](_0x9620('0xb'),auth[_0x9620('0xc')](),controller[_0x9620('0xe')]);router[_0x9620('0xf')](_0x9620('0xb'),auth[_0x9620('0xc')](),controller['destroy']);module[_0x9620('0x10')]=router; \ No newline at end of file +var _0xc1fc=['../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2abd63,_0x5819bd){var _0x41d4f7=function(_0x502805){while(--_0x502805){_0x2abd63['push'](_0x2abd63['shift']());}};_0x41d4f7(++_0x5819bd);}(_0xc1fc,0x93));var _0xcc1f=function(_0x3a65ca,_0x394ec8){_0x3a65ca=_0x3a65ca-0x0;var _0x3d3d8a=_0xc1fc[_0x3a65ca];return _0x3d3d8a;};'use strict';var multer=require('multer');var util=require(_0xcc1f('0x0'));var path=require(_0xcc1f('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc1f('0x2'));var router=express[_0xcc1f('0x3')]();var auth=require(_0xcc1f('0x4'));var interaction=require(_0xcc1f('0x5'));var config=require(_0xcc1f('0x6'));var controller=require(_0xcc1f('0x7'));router[_0xcc1f('0x8')]('/',auth[_0xcc1f('0x9')](),controller['index']);router['get'](_0xcc1f('0xa'),auth[_0xcc1f('0x9')](),controller[_0xcc1f('0xb')]);router[_0xcc1f('0xc')]('/',auth[_0xcc1f('0x9')](),controller['create']);router['put']('/:id',auth[_0xcc1f('0x9')](),controller[_0xcc1f('0xd')]);router[_0xcc1f('0xe')](_0xcc1f('0xa'),auth[_0xcc1f('0x9')](),controller[_0xcc1f('0xf')]);module[_0xcc1f('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8704c35..83ad5c1 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 _0xae24=['format','sequelize','exports','STRING','DATE'];(function(_0x42070c,_0x2d9af3){var _0xcda4e3=function(_0x3be997){while(--_0x3be997){_0x42070c['push'](_0x42070c['shift']());}};_0xcda4e3(++_0x2d9af3);}(_0xae24,0x182));var _0x4ae2=function(_0x5172d4,_0x1f9714){_0x5172d4=_0x5172d4-0x0;var _0x219ef8=_0xae24[_0x5172d4];return _0x219ef8;};'use strict';var Sequelize=require(_0x4ae2('0x0'));var moment=require('moment');module[_0x4ae2('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x4ae2('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4ae2('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4ae2('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4ae2('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4ae2('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x4ae2('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4ae2('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4ae2('0x3')],'allowNull':![],'defaultValue':moment()[_0x4ae2('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x33c5=['format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x33c5,0xe6));var _0x533c=function(_0x5dafd0,_0x3bcbb6){_0x5dafd0=_0x5dafd0-0x0;var _0x364354=_0x33c5[_0x5dafd0];return _0x364354;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x533c('0x0'));module[_0x533c('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x533c('0x3')],'allowNull':![],'defaultValue':moment()[_0x533c('0x4')](_0x533c('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 3fc45dd..71f75a1 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 _0xb81b=['body','params','destroy','find','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','save','update','then','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','show','catch','create'];(function(_0x308106,_0x21dd2c){var _0x4eb491=function(_0xcf6b61){while(--_0xcf6b61){_0x308106['push'](_0x308106['shift']());}};_0x4eb491(++_0x21dd2c);}(_0xb81b,0x15d));var _0xbb81=function(_0x407e6b,_0x311190){_0x407e6b=_0x407e6b-0x0;var _0x528c08=_0xb81b[_0x407e6b];return _0x528c08;};'use strict';var pdf=require(_0xbb81('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbb81('0x1'));var jsonpatch=require(_0xbb81('0x2'));var rp=require(_0xbb81('0x3'));var moment=require('moment');var BPromise=require(_0xbb81('0x4'));var Mustache=require('mustache');var util=require(_0xbb81('0x5'));var path=require(_0xbb81('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb81('0x7'));var fs=require('fs');var _=require(_0xbb81('0x8'));var squel=require('squel');var crypto=require(_0xbb81('0x9'));var jsforce=require(_0xbb81('0xa'));var deskjs=require(_0xbb81('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbb81('0xc'));var Papa=require('papaparse');var authService=require(_0xbb81('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xbb81('0xe'));var logger=require('../../config/logger')(_0xbb81('0xf'));var utils=require(_0xbb81('0x10'));var config=require(_0xbb81('0x11'));var db=require(_0xbb81('0x12'))['db'];function respondWithStatusCode(_0x536451,_0x18a79d){_0x18a79d=_0x18a79d||0xcc;return function(_0x4e44e2){if(_0x4e44e2){return _0x536451[_0xbb81('0x13')](_0x18a79d);}return _0x536451[_0xbb81('0x14')](_0x18a79d)[_0xbb81('0x15')]();};}function respondWithResult(_0x4b8fba,_0xe3d1fc){_0xe3d1fc=_0xe3d1fc||0xc8;return function(_0x14869c){if(_0x14869c){return _0x4b8fba[_0xbb81('0x14')](_0xe3d1fc)['json'](_0x14869c);}};}function respondWithFilteredResult(_0x2564df,_0x42825d){return function(_0x27b3d8){if(_0x27b3d8){var _0x3d741d=_0x27b3d8['count'],_0x2dbccf=_0x42825d[_0xbb81('0x16')],_0x3c37a9=_0x42825d['offset']+_0x42825d[_0xbb81('0x17')],_0x3d59e7;if(_0x3c37a9>=_0x3d741d){_0x3c37a9=_0x3d741d;_0x3d59e7=0xc8;}else{_0x3d59e7=0xce;}_0x2564df[_0xbb81('0x14')](_0x3d59e7);return _0x2564df[_0xbb81('0x18')](_0xbb81('0x19'),_0x2dbccf+'-'+_0x3c37a9+'/'+_0x3d741d)[_0xbb81('0x1a')](_0x27b3d8);}return null;};}function patchUpdates(_0x2b603d){return function(_0x5b6a9f){try{jsonpatch['apply'](_0x5b6a9f,_0x2b603d,!![]);}catch(_0x516d3e){return BPromise['reject'](_0x516d3e);}return _0x5b6a9f[_0xbb81('0x1b')]();};}function saveUpdates(_0x57d3ca,_0x1a86ed){return function(_0x43801c){if(_0x43801c){return _0x43801c[_0xbb81('0x1c')](_0x57d3ca)['then'](function(_0x261895){return _0x261895;});}return null;};}function removeEntity(_0x15f229,_0x375a36){return function(_0xb434a3){if(_0xb434a3){return _0xb434a3['destroy']()[_0xbb81('0x1d')](function(){_0x15f229[_0xbb81('0x14')](0xcc)[_0xbb81('0x15')]();});}};}function handleEntityNotFound(_0x4973c6,_0xe65309){return function(_0x4d64e5){if(!_0x4d64e5){_0x4973c6[_0xbb81('0x13')](0x194);}return _0x4d64e5;};}function handleError(_0x5a2a49,_0x35cfb6){_0x35cfb6=_0x35cfb6||0x1f4;return function(_0x24b832){logger[_0xbb81('0x1e')](_0x24b832[_0xbb81('0x1f')]);if(_0x24b832[_0xbb81('0x20')]){delete _0x24b832['name'];}_0x5a2a49[_0xbb81('0x14')](_0x35cfb6)[_0xbb81('0x21')](_0x24b832);};}exports[_0xbb81('0x22')]=function(_0x4fdc6c,_0x3611c0){var _0xb8c16b={},_0x28ff7c={},_0xe03f85={'count':0x0,'rows':[]};var _0x498a63=db[_0xbb81('0x23')][_0xbb81('0x24')];_0x28ff7c[_0xbb81('0x25')]=_[_0xbb81('0x26')](_0x498a63);_0x28ff7c['query']=_[_0xbb81('0x26')](_0x4fdc6c[_0xbb81('0x27')]);_0x28ff7c[_0xbb81('0x28')]=_['intersection'](_0x28ff7c[_0xbb81('0x25')],_0x28ff7c['query']);_0xb8c16b[_0xbb81('0x29')]=_[_0xbb81('0x2a')](_0x28ff7c[_0xbb81('0x25')],qs[_0xbb81('0x2b')](_0x4fdc6c[_0xbb81('0x27')][_0xbb81('0x2b')]));_0xb8c16b[_0xbb81('0x29')]=_0xb8c16b[_0xbb81('0x29')][_0xbb81('0x2c')]?_0xb8c16b[_0xbb81('0x29')]:_0x28ff7c['model'];if(!_0x4fdc6c[_0xbb81('0x27')]['hasOwnProperty'](_0xbb81('0x2d'))){_0xb8c16b[_0xbb81('0x17')]=qs['limit'](_0x4fdc6c['query']['limit']);_0xb8c16b['offset']=qs['offset'](_0x4fdc6c['query'][_0xbb81('0x16')]);}_0xb8c16b[_0xbb81('0x2e')]=qs[_0xbb81('0x2f')](_0x4fdc6c[_0xbb81('0x27')][_0xbb81('0x2f')]);_0xb8c16b[_0xbb81('0x30')]=qs[_0xbb81('0x28')](_[_0xbb81('0x31')](_0x4fdc6c[_0xbb81('0x27')],_0x28ff7c['filters']));if(_0x4fdc6c['query'][_0xbb81('0x32')]){_0xb8c16b[_0xbb81('0x30')]=_['merge'](_0xb8c16b[_0xbb81('0x30')],{'$or':_[_0xbb81('0x33')](_0x498a63,function(_0x5afcd4){if(_0x5afcd4['type'][_0xbb81('0x34')]!==_0xbb81('0x35')){var _0x3122e3={};_0x3122e3[_0x5afcd4[_0xbb81('0x36')]]={'$like':'%'+_0x4fdc6c['query']['filter']+'%'};return _0x3122e3;}})});}_0xb8c16b=_[_0xbb81('0x37')]({},_0xb8c16b,_0x4fdc6c[_0xbb81('0x38')]);var _0xbb2447={'where':_0xb8c16b[_0xbb81('0x30')]};return db[_0xbb81('0x23')][_0xbb81('0x39')](_0xbb2447)['then'](function(_0x562493){_0xe03f85[_0xbb81('0x39')]=_0x562493;if(_0x4fdc6c['query'][_0xbb81('0x3a')]){_0xb8c16b[_0xbb81('0x3b')]=[{'all':!![]}];}return db[_0xbb81('0x23')][_0xbb81('0x3c')](_0xb8c16b);})['then'](function(_0x25455b){_0xe03f85[_0xbb81('0x3d')]=_0x25455b;return _0xe03f85;})[_0xbb81('0x1d')](respondWithFilteredResult(_0x3611c0,_0xb8c16b))['catch'](handleError(_0x3611c0,null));};exports[_0xbb81('0x3e')]=function(_0x4351f4,_0x22e524){var _0x37794d={'raw':!![],'where':{'id':_0x4351f4['params']['id']}},_0x1a9a4b={};_0x1a9a4b[_0xbb81('0x25')]=_[_0xbb81('0x26')](db[_0xbb81('0x23')][_0xbb81('0x24')]);_0x1a9a4b['query']=_[_0xbb81('0x26')](_0x4351f4[_0xbb81('0x27')]);_0x1a9a4b[_0xbb81('0x28')]=_[_0xbb81('0x2a')](_0x1a9a4b[_0xbb81('0x25')],_0x1a9a4b[_0xbb81('0x27')]);_0x37794d[_0xbb81('0x29')]=_[_0xbb81('0x2a')](_0x1a9a4b['model'],qs[_0xbb81('0x2b')](_0x4351f4['query']['fields']));_0x37794d['attributes']=_0x37794d[_0xbb81('0x29')][_0xbb81('0x2c')]?_0x37794d[_0xbb81('0x29')]:_0x1a9a4b['model'];if(_0x4351f4[_0xbb81('0x27')][_0xbb81('0x3a')]){_0x37794d['include']=[{'all':!![]}];}_0x37794d=_[_0xbb81('0x37')]({},_0x37794d,_0x4351f4[_0xbb81('0x38')]);return db[_0xbb81('0x23')]['find'](_0x37794d)['then'](handleEntityNotFound(_0x22e524,null))[_0xbb81('0x1d')](respondWithResult(_0x22e524,null))[_0xbb81('0x3f')](handleError(_0x22e524,null));};exports[_0xbb81('0x40')]=function(_0x5002d3,_0x30abd7){return db[_0xbb81('0x23')][_0xbb81('0x40')](_0x5002d3[_0xbb81('0x41')],{})[_0xbb81('0x1d')](respondWithResult(_0x30abd7,0xc9))[_0xbb81('0x3f')](handleError(_0x30abd7,null));};exports['update']=function(_0x1eb89f,_0x53178d){if(_0x1eb89f[_0xbb81('0x41')]['id']){delete _0x1eb89f[_0xbb81('0x41')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x1eb89f[_0xbb81('0x42')]['id']}})[_0xbb81('0x1d')](handleEntityNotFound(_0x53178d,null))['then'](saveUpdates(_0x1eb89f['body'],null))[_0xbb81('0x1d')](respondWithResult(_0x53178d,null))[_0xbb81('0x3f')](handleError(_0x53178d,null));};exports[_0xbb81('0x43')]=function(_0x4974ec,_0x58ebc1){return db['VoiceQueuesLog'][_0xbb81('0x44')]({'where':{'id':_0x4974ec[_0xbb81('0x42')]['id']}})[_0xbb81('0x1d')](handleEntityNotFound(_0x58ebc1,null))[_0xbb81('0x1d')](removeEntity(_0x58ebc1,null))[_0xbb81('0x3f')](handleError(_0x58ebc1,null));}; \ No newline at end of file +var _0x1a34=['reject','save','update','then','destroy','sendStatus','error','name','index','VoiceQueuesLog','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','field','options','count','findAll','catch','show','params','rawAttributes','includeAll','include','create','body','find','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply'];(function(_0x365831,_0x4976ea){var _0x2fc44d=function(_0x4e0342){while(--_0x4e0342){_0x365831['push'](_0x365831['shift']());}};_0x2fc44d(++_0x4976ea);}(_0x1a34,0x77));var _0x41a3=function(_0x168466,_0x5f37e5){_0x168466=_0x168466-0x0;var _0xcf8a4=_0x1a34[_0x168466];return _0xcf8a4;};'use strict';var pdf=require(_0x41a3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x41a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41a3('0x2'));var rp=require(_0x41a3('0x3'));var moment=require(_0x41a3('0x4'));var BPromise=require(_0x41a3('0x5'));var Mustache=require(_0x41a3('0x6'));var util=require(_0x41a3('0x7'));var path=require(_0x41a3('0x8'));var sox=require(_0x41a3('0x9'));var csv=require(_0x41a3('0xa'));var ejs=require(_0x41a3('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x41a3('0xc'));var crypto=require(_0x41a3('0xd'));var jsforce=require(_0x41a3('0xe'));var deskjs=require(_0x41a3('0xf'));var toCsv=require(_0x41a3('0xa'));var querystring=require(_0x41a3('0x10'));var Papa=require('papaparse');var authService=require(_0x41a3('0x11'));var hardwareService=require(_0x41a3('0x12'));var Redis=require(_0x41a3('0x13'));var qs=require(_0x41a3('0x14'));var logger=require(_0x41a3('0x15'))(_0x41a3('0x16'));var utils=require(_0x41a3('0x17'));var config=require(_0x41a3('0x18'));var db=require(_0x41a3('0x19'))['db'];function respondWithStatusCode(_0x302f13,_0x3d18ca){_0x3d18ca=_0x3d18ca||0xcc;return function(_0x53f5b5){if(_0x53f5b5){return _0x302f13['sendStatus'](_0x3d18ca);}return _0x302f13[_0x41a3('0x1a')](_0x3d18ca)[_0x41a3('0x1b')]();};}function respondWithResult(_0x3b4992,_0x51a5ef){_0x51a5ef=_0x51a5ef||0xc8;return function(_0x58b9a1){if(_0x58b9a1){return _0x3b4992['status'](_0x51a5ef)[_0x41a3('0x1c')](_0x58b9a1);}};}function respondWithFilteredResult(_0x349d52,_0x34568a){return function(_0x4bd4ba){if(_0x4bd4ba){var _0x255826=_0x4bd4ba['count'],_0x512e99=_0x34568a[_0x41a3('0x1d')],_0x2bb596=_0x34568a[_0x41a3('0x1d')]+_0x34568a['limit'],_0x1f165a;if(_0x2bb596>=_0x255826){_0x2bb596=_0x255826;_0x1f165a=0xc8;}else{_0x1f165a=0xce;}_0x349d52['status'](_0x1f165a);return _0x349d52[_0x41a3('0x1e')](_0x41a3('0x1f'),_0x512e99+'-'+_0x2bb596+'/'+_0x255826)[_0x41a3('0x1c')](_0x4bd4ba);}return null;};}function patchUpdates(_0x2202f0){return function(_0x4b5fd9){try{jsonpatch[_0x41a3('0x20')](_0x4b5fd9,_0x2202f0,!![]);}catch(_0x20fef4){return BPromise[_0x41a3('0x21')](_0x20fef4);}return _0x4b5fd9[_0x41a3('0x22')]();};}function saveUpdates(_0x2c79ad,_0xb20e9e){return function(_0x5300cc){if(_0x5300cc){return _0x5300cc[_0x41a3('0x23')](_0x2c79ad)[_0x41a3('0x24')](function(_0x2032a3){return _0x2032a3;});}return null;};}function removeEntity(_0x1ea5d7,_0x2c47f9){return function(_0x5a4675){if(_0x5a4675){return _0x5a4675[_0x41a3('0x25')]()[_0x41a3('0x24')](function(){_0x1ea5d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x299f5a,_0x534055){return function(_0x6d0ac3){if(!_0x6d0ac3){_0x299f5a[_0x41a3('0x26')](0x194);}return _0x6d0ac3;};}function handleError(_0x519057,_0x7932e2){_0x7932e2=_0x7932e2||0x1f4;return function(_0x48569b){logger[_0x41a3('0x27')](_0x48569b['stack']);if(_0x48569b[_0x41a3('0x28')]){delete _0x48569b[_0x41a3('0x28')];}_0x519057['status'](_0x7932e2)['send'](_0x48569b);};}exports[_0x41a3('0x29')]=function(_0x57fd28,_0x57dc0b){var _0x4a3245={},_0x14810e={},_0x306e4e={'count':0x0,'rows':[]};var _0x50f930=db[_0x41a3('0x2a')]['rawAttributes'];_0x14810e[_0x41a3('0x2b')]=_[_0x41a3('0x2c')](_0x50f930);_0x14810e[_0x41a3('0x2d')]=_[_0x41a3('0x2c')](_0x57fd28['query']);_0x14810e[_0x41a3('0x2e')]=_[_0x41a3('0x2f')](_0x14810e['model'],_0x14810e['query']);_0x4a3245[_0x41a3('0x30')]=_[_0x41a3('0x2f')](_0x14810e[_0x41a3('0x2b')],qs[_0x41a3('0x31')](_0x57fd28[_0x41a3('0x2d')][_0x41a3('0x31')]));_0x4a3245[_0x41a3('0x30')]=_0x4a3245[_0x41a3('0x30')][_0x41a3('0x32')]?_0x4a3245[_0x41a3('0x30')]:_0x14810e[_0x41a3('0x2b')];if(!_0x57fd28[_0x41a3('0x2d')][_0x41a3('0x33')](_0x41a3('0x34'))){_0x4a3245[_0x41a3('0x35')]=qs['limit'](_0x57fd28[_0x41a3('0x2d')]['limit']);_0x4a3245[_0x41a3('0x1d')]=qs['offset'](_0x57fd28[_0x41a3('0x2d')][_0x41a3('0x1d')]);}_0x4a3245[_0x41a3('0x36')]=qs[_0x41a3('0x37')](_0x57fd28[_0x41a3('0x2d')][_0x41a3('0x37')]);_0x4a3245['where']=qs[_0x41a3('0x2e')](_[_0x41a3('0x38')](_0x57fd28['query'],_0x14810e[_0x41a3('0x2e')]));if(_0x57fd28[_0x41a3('0x2d')][_0x41a3('0x39')]){_0x4a3245[_0x41a3('0x3a')]=_[_0x41a3('0x3b')](_0x4a3245[_0x41a3('0x3a')],{'$or':_[_0x41a3('0x3c')](_0x50f930,function(_0x244330){if(_0x244330[_0x41a3('0x3d')][_0x41a3('0x3e')]!=='VIRTUAL'){var _0x570c82={};_0x570c82[_0x244330[_0x41a3('0x3f')]]={'$like':'%'+_0x57fd28[_0x41a3('0x2d')]['filter']+'%'};return _0x570c82;}})});}_0x4a3245=_[_0x41a3('0x3b')]({},_0x4a3245,_0x57fd28[_0x41a3('0x40')]);var _0x360a7f={'where':_0x4a3245[_0x41a3('0x3a')]};return db[_0x41a3('0x2a')][_0x41a3('0x41')](_0x360a7f)['then'](function(_0x28d28b){_0x306e4e['count']=_0x28d28b;if(_0x57fd28[_0x41a3('0x2d')]['includeAll']){_0x4a3245['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x41a3('0x42')](_0x4a3245);})[_0x41a3('0x24')](function(_0x1cca37){_0x306e4e['rows']=_0x1cca37;return _0x306e4e;})['then'](respondWithFilteredResult(_0x57dc0b,_0x4a3245))[_0x41a3('0x43')](handleError(_0x57dc0b,null));};exports[_0x41a3('0x44')]=function(_0x29a7bc,_0x21958d){var _0xf95b71={'raw':!![],'where':{'id':_0x29a7bc[_0x41a3('0x45')]['id']}},_0x42a9b6={};_0x42a9b6[_0x41a3('0x2b')]=_[_0x41a3('0x2c')](db[_0x41a3('0x2a')][_0x41a3('0x46')]);_0x42a9b6[_0x41a3('0x2d')]=_['keys'](_0x29a7bc[_0x41a3('0x2d')]);_0x42a9b6[_0x41a3('0x2e')]=_[_0x41a3('0x2f')](_0x42a9b6[_0x41a3('0x2b')],_0x42a9b6[_0x41a3('0x2d')]);_0xf95b71[_0x41a3('0x30')]=_['intersection'](_0x42a9b6[_0x41a3('0x2b')],qs[_0x41a3('0x31')](_0x29a7bc[_0x41a3('0x2d')]['fields']));_0xf95b71[_0x41a3('0x30')]=_0xf95b71[_0x41a3('0x30')][_0x41a3('0x32')]?_0xf95b71[_0x41a3('0x30')]:_0x42a9b6[_0x41a3('0x2b')];if(_0x29a7bc['query'][_0x41a3('0x47')]){_0xf95b71[_0x41a3('0x48')]=[{'all':!![]}];}_0xf95b71=_[_0x41a3('0x3b')]({},_0xf95b71,_0x29a7bc[_0x41a3('0x40')]);return db[_0x41a3('0x2a')]['find'](_0xf95b71)[_0x41a3('0x24')](handleEntityNotFound(_0x21958d,null))[_0x41a3('0x24')](respondWithResult(_0x21958d,null))[_0x41a3('0x43')](handleError(_0x21958d,null));};exports[_0x41a3('0x49')]=function(_0x1f5203,_0x48e45f){return db[_0x41a3('0x2a')][_0x41a3('0x49')](_0x1f5203[_0x41a3('0x4a')],{})['then'](respondWithResult(_0x48e45f,0xc9))[_0x41a3('0x43')](handleError(_0x48e45f,null));};exports[_0x41a3('0x23')]=function(_0x30aeb9,_0x462618){if(_0x30aeb9[_0x41a3('0x4a')]['id']){delete _0x30aeb9[_0x41a3('0x4a')]['id'];}return db[_0x41a3('0x2a')][_0x41a3('0x4b')]({'where':{'id':_0x30aeb9[_0x41a3('0x45')]['id']}})['then'](handleEntityNotFound(_0x462618,null))['then'](saveUpdates(_0x30aeb9[_0x41a3('0x4a')],null))['then'](respondWithResult(_0x462618,null))['catch'](handleError(_0x462618,null));};exports[_0x41a3('0x25')]=function(_0x22c8ea,_0x57ec69){return db['VoiceQueuesLog'][_0x41a3('0x4b')]({'where':{'id':_0x22c8ea[_0x41a3('0x45')]['id']}})[_0x41a3('0x24')](handleEntityNotFound(_0x57ec69,null))[_0x41a3('0x24')](removeEntity(_0x57ec69,null))[_0x41a3('0x43')](handleError(_0x57ec69,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 3afbe7c..f515eae 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 _0x0f37=['exports','define','VoiceQueuesLog','event_dtm','event','util','api','moment','bluebird','request-promise','./voiceQueuesLog.attributes'];(function(_0x171791,_0x5b7869){var _0x24d011=function(_0x3e2ab5){while(--_0x3e2ab5){_0x171791['push'](_0x171791['shift']());}};_0x24d011(++_0x5b7869);}(_0x0f37,0x191));var _0x70f3=function(_0x313e3d,_0x2d149f){_0x313e3d=_0x313e3d-0x0;var _0x3989d0=_0x0f37[_0x313e3d];return _0x3989d0;};'use strict';var _=require('lodash');var util=require(_0x70f3('0x0'));var logger=require('../../config/logger')(_0x70f3('0x1'));var moment=require(_0x70f3('0x2'));var BPromise=require(_0x70f3('0x3'));var rp=require(_0x70f3('0x4'));var attributes=require(_0x70f3('0x5'));module[_0x70f3('0x6')]=function(_0x37cc2d,_0x394aa4){return _0x37cc2d[_0x70f3('0x7')](_0x70f3('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x70f3('0x9'),'fields':[_0x70f3('0xa'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x88de=['api','./voiceQueuesLog.attributes','exports','define','event_dtm','lodash','util'];(function(_0x117489,_0x5db7ac){var _0xace9=function(_0x51701c){while(--_0x51701c){_0x117489['push'](_0x117489['shift']());}};_0xace9(++_0x5db7ac);}(_0x88de,0xb4));var _0xe88d=function(_0x19b473,_0x260de9){_0x19b473=_0x19b473-0x0;var _0x3fbb14=_0x88de[_0x19b473];return _0x3fbb14;};'use strict';var _=require(_0xe88d('0x0'));var util=require(_0xe88d('0x1'));var logger=require('../../config/logger')(_0xe88d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xe88d('0x3'));module[_0xe88d('0x4')]=function(_0x12301c,_0x5916a3){return _0x12301c[_0xe88d('0x5')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xe88d('0x6'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 0d926e1..40ed3a8 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 _0x9414=['error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5eb9c1,_0x477c4b){var _0x371df6=function(_0x360e73){while(--_0x360e73){_0x5eb9c1['push'](_0x5eb9c1['shift']());}};_0x371df6(++_0x477c4b);}(_0x9414,0x90));var _0x4941=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x9414[_0x2067e9];return _0x280ce4;};'use strict';var _=require(_0x4941('0x0'));var util=require('util');var moment=require(_0x4941('0x1'));var BPromise=require('bluebird');var rs=require(_0x4941('0x2'));var fs=require('fs');var Redis=require(_0x4941('0x3'));var db=require(_0x4941('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4941('0x5'))(_0x4941('0x6'));var config=require(_0x4941('0x7'));var jayson=require(_0x4941('0x8'));var client=jayson[_0x4941('0x9')][_0x4941('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bd3fb,_0x48147a,_0x1bc90e){return new BPromise(function(_0x373246,_0x557583){return client[_0x4941('0xb')](_0x4bd3fb,_0x1bc90e)['then'](function(_0x2ed92a){logger[_0x4941('0xc')](_0x4941('0xd'),_0x48147a,_0x4941('0xe'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x48147a,'request\x20sent',JSON[_0x4941('0xf')](_0x2ed92a));if(_0x2ed92a['error']){if(_0x2ed92a[_0x4941('0x10')][_0x4941('0x11')]===0x1f4){logger[_0x4941('0x10')](_0x4941('0xd'),_0x48147a,_0x2ed92a['error'][_0x4941('0x12')]);return _0x557583(_0x2ed92a[_0x4941('0x10')]['message']);}logger[_0x4941('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x48147a,_0x2ed92a[_0x4941('0x10')][_0x4941('0x12')]);return _0x373246(_0x2ed92a[_0x4941('0x10')][_0x4941('0x12')]);}else{logger[_0x4941('0xc')](_0x4941('0xd'),_0x48147a,'request\x20sent');_0x373246(_0x2ed92a['result'][_0x4941('0x12')]);}})[_0x4941('0x13')](function(_0x495625){logger[_0x4941('0x10')](_0x4941('0xd'),_0x48147a,_0x495625);_0x557583(_0x495625);});});} \ No newline at end of file +var _0x9f17=['request','info','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xf37717,_0x5afacc){var _0x992835=function(_0x1d9e55){while(--_0x1d9e55){_0xf37717['push'](_0xf37717['shift']());}};_0x992835(++_0x5afacc);}(_0x9f17,0x73));var _0x79f1=function(_0x411fc1,_0x18dd55){_0x411fc1=_0x411fc1-0x0;var _0x2c8386=_0x9f17[_0x411fc1];return _0x2c8386;};'use strict';var _=require(_0x79f1('0x0'));var util=require('util');var moment=require(_0x79f1('0x1'));var BPromise=require(_0x79f1('0x2'));var rs=require(_0x79f1('0x3'));var fs=require('fs');var Redis=require(_0x79f1('0x4'));var db=require(_0x79f1('0x5'))['db'];var utils=require(_0x79f1('0x6'));var logger=require('../../config/logger')(_0x79f1('0x7'));var config=require(_0x79f1('0x8'));var jayson=require(_0x79f1('0x9'));var client=jayson[_0x79f1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b0d5,_0x12ce9e,_0x33a7bc){return new BPromise(function(_0x1804af,_0x3572e8){return client[_0x79f1('0xb')](_0x18b0d5,_0x33a7bc)['then'](function(_0x204f4f){logger[_0x79f1('0xc')](_0x79f1('0xd'),_0x12ce9e,'request\x20sent');logger[_0x79f1('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x12ce9e,_0x79f1('0xf'),JSON[_0x79f1('0x10')](_0x204f4f));if(_0x204f4f[_0x79f1('0x11')]){if(_0x204f4f[_0x79f1('0x11')]['code']===0x1f4){logger[_0x79f1('0x11')](_0x79f1('0xd'),_0x12ce9e,_0x204f4f['error'][_0x79f1('0x12')]);return _0x3572e8(_0x204f4f[_0x79f1('0x11')][_0x79f1('0x12')]);}logger[_0x79f1('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x12ce9e,_0x204f4f[_0x79f1('0x11')]['message']);return _0x1804af(_0x204f4f[_0x79f1('0x11')]['message']);}else{logger['info'](_0x79f1('0xd'),_0x12ce9e,_0x79f1('0xf'));_0x1804af(_0x204f4f[_0x79f1('0x13')][_0x79f1('0x12')]);}})[_0x79f1('0x14')](function(_0x1af602){logger[_0x79f1('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x12ce9e,_0x1af602);_0x3572e8(_0x1af602);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index fe42bf2..1e7ea3c 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 _0x1752=['express','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','downloads','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x122b00,_0x3ecf0b){var _0x1bc407=function(_0x935a39){while(--_0x935a39){_0x122b00['push'](_0x122b00['shift']());}};_0x1bc407(++_0x3ecf0b);}(_0x1752,0xa5));var _0x2175=function(_0x26a8c6,_0x177fde){_0x26a8c6=_0x26a8c6-0x0;var _0x24ca89=_0x1752[_0x26a8c6];return _0x24ca89;};'use strict';var multer=require('multer');var util=require(_0x2175('0x0'));var path=require(_0x2175('0x1'));var timeout=require(_0x2175('0x2'));var express=require(_0x2175('0x3'));var router=express[_0x2175('0x4')]();var auth=require(_0x2175('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2175('0x6'));var controller=require(_0x2175('0x7'));router[_0x2175('0x8')]('/',auth[_0x2175('0x9')](),controller[_0x2175('0xa')]);router[_0x2175('0x8')](_0x2175('0xb'),auth[_0x2175('0x9')](),controller[_0x2175('0xc')]);router[_0x2175('0x8')]('/:id',auth[_0x2175('0x9')](),controller[_0x2175('0xd')]);router[_0x2175('0x8')](_0x2175('0xe'),auth[_0x2175('0x9')](),controller['download']);router['get']('/:id/downloads',controller[_0x2175('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x2175('0x10'),auth['isAuthenticated'](),controller[_0x2175('0x11')]);router[_0x2175('0x12')]('/:id',auth[_0x2175('0x9')](),controller[_0x2175('0x13')]);module[_0x2175('0x14')]=router; \ No newline at end of file +var _0x68fc=['create','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','downloads','post'];(function(_0xbf19d7,_0x58b2bf){var _0x376e11=function(_0x5ab888){while(--_0x5ab888){_0xbf19d7['push'](_0xbf19d7['shift']());}};_0x376e11(++_0x58b2bf);}(_0x68fc,0xa5));var _0xc68f=function(_0x492b57,_0x3bd303){_0x492b57=_0x492b57-0x0;var _0x267b35=_0x68fc[_0x492b57];return _0x267b35;};'use strict';var multer=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var path=require(_0xc68f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc68f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc68f('0x4'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xc68f('0x5')]('/',auth[_0xc68f('0x6')](),controller[_0xc68f('0x7')]);router[_0xc68f('0x5')]('/describe',auth['isAuthenticated'](),controller[_0xc68f('0x8')]);router[_0xc68f('0x5')](_0xc68f('0x9'),auth[_0xc68f('0x6')](),controller[_0xc68f('0xa')]);router[_0xc68f('0x5')](_0xc68f('0xb'),auth[_0xc68f('0x6')](),controller[_0xc68f('0xc')]);router[_0xc68f('0x5')]('/:id/downloads',controller[_0xc68f('0xd')]);router[_0xc68f('0xe')]('/',auth[_0xc68f('0x6')](),controller[_0xc68f('0xf')]);router[_0xc68f('0x10')](_0xc68f('0x9'),auth[_0xc68f('0x6')](),controller[_0xc68f('0x11')]);router[_0xc68f('0x12')](_0xc68f('0x9'),auth[_0xc68f('0x6')](),controller['destroy']);module[_0xc68f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 8773b77..7fde221 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 _0x0a6a=['sequelize','VIRTUAL','getDataValue','extname','value','STRING','setDataValue','channel','membername','INTEGER','DATE','createdAt','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x0a6a,0x1dc));var _0xa0a6=function(_0x17e735,_0x328f40){_0x17e735=_0x17e735-0x0;var _0x1824d6=_0x0a6a[_0x17e735];return _0x1824d6;};'use strict';var Sequelize=require(_0xa0a6('0x0'));var moment=require('moment');var path=require('path');module['exports']={'format':{'type':Sequelize[_0xa0a6('0x1')],'get':function(){return this[_0xa0a6('0x2')]('value')?path[_0xa0a6('0x3')](this[_0xa0a6('0x2')](_0xa0a6('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0xa0a6('0x5')]},'channel':{'type':Sequelize[_0xa0a6('0x5')],'set':function(_0x214768){if(_0x214768){this[_0xa0a6('0x6')](_0xa0a6('0x7'),_0x214768);this['setDataValue'](_0xa0a6('0x8'),_0x214768['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xa0a6('0x5')]},'calleridnum':{'type':Sequelize[_0xa0a6('0x5')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa0a6('0x5')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa0a6('0x5')]},'context':{'type':Sequelize[_0xa0a6('0x5')]},'exten':{'type':Sequelize[_0xa0a6('0x5')]},'value':{'type':Sequelize[_0xa0a6('0x5')]},'type':{'type':Sequelize[_0xa0a6('0x5')]},'rating':{'type':Sequelize[_0xa0a6('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xa0a6('0x5')]},'userDisposition':{'type':Sequelize[_0xa0a6('0x5')]},'createdAt':{'type':Sequelize[_0xa0a6('0xa')],'get':function(){return moment(this[_0xa0a6('0x2')](_0xa0a6('0xb')))['format'](_0xa0a6('0xc'))[_0xa0a6('0xd')]();}},'updatedAt':{'type':Sequelize[_0xa0a6('0xa')],'get':function(){return moment(this[_0xa0a6('0x2')]('updatedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xa0a6('0xd')]();}}}; \ No newline at end of file +var _0xcc90=['setDataValue','channel','membername','split','INTEGER','format','toString','path','getDataValue','value','extname','STRING'];(function(_0x1081a3,_0x2ac784){var _0x5696a2=function(_0x23d2f6){while(--_0x23d2f6){_0x1081a3['push'](_0x1081a3['shift']());}};_0x5696a2(++_0x2ac784);}(_0xcc90,0x1f3));var _0x0cc9=function(_0xc6523e,_0x1792b5){_0xc6523e=_0xc6523e-0x0;var _0x376d40=_0xcc90[_0xc6523e];return _0x376d40;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0x0cc9('0x0'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0cc9('0x1')](_0x0cc9('0x2'))?path[_0x0cc9('0x3')](this[_0x0cc9('0x1')](_0x0cc9('0x2'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0cc9('0x4')],'set':function(_0x1f5433){if(_0x1f5433){this[_0x0cc9('0x5')](_0x0cc9('0x6'),_0x1f5433);this[_0x0cc9('0x5')](_0x0cc9('0x7'),_0x1f5433[_0x0cc9('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0cc9('0x4')]},'calleridname':{'type':Sequelize[_0x0cc9('0x4')]},'connectedlinenum':{'type':Sequelize[_0x0cc9('0x4')]},'connectedlinename':{'type':Sequelize[_0x0cc9('0x4')]},'accountcode':{'type':Sequelize[_0x0cc9('0x4')]},'context':{'type':Sequelize[_0x0cc9('0x4')]},'exten':{'type':Sequelize[_0x0cc9('0x4')]},'value':{'type':Sequelize[_0x0cc9('0x4')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x0cc9('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x0cc9('0x4')]},'userDisposition':{'type':Sequelize[_0x0cc9('0x4')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0cc9('0x1')]('createdAt'))[_0x0cc9('0xa')]('MM-DD-YYYY\x20HH:mm')[_0x0cc9('0xb')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x0cc9('0xa')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 1ae85c2..e6f0821 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 _0xe0fc=['rawAttributes','model','keys','format','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','unlink','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','decryptFile','extname','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','end','error','stack','name','index','VoiceRecording'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0xe0fc,0x98));var _0xce0f=function(_0x124096,_0xbb4341){_0x124096=_0x124096-0x0;var _0x123aed=_0xe0fc[_0x124096];return _0x123aed;};'use strict';var pdf=require(_0xce0f('0x0'));var emlformat=require(_0xce0f('0x1'));var rimraf=require(_0xce0f('0x2'));var zipdir=require(_0xce0f('0x3'));var jsonpatch=require(_0xce0f('0x4'));var rp=require(_0xce0f('0x5'));var moment=require('moment');var BPromise=require(_0xce0f('0x6'));var Mustache=require(_0xce0f('0x7'));var util=require(_0xce0f('0x8'));var path=require(_0xce0f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce0f('0xa'));var fs=require('fs');var _=require(_0xce0f('0xb'));var squel=require(_0xce0f('0xc'));var crypto=require(_0xce0f('0xd'));var jsforce=require(_0xce0f('0xe'));var deskjs=require(_0xce0f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xce0f('0x10'));var Papa=require('papaparse');var authService=require(_0xce0f('0x11'));var hardwareService=require(_0xce0f('0x12'));var Redis=require(_0xce0f('0x13'));var qs=require(_0xce0f('0x14'));var logger=require(_0xce0f('0x15'))(_0xce0f('0x16'));var utils=require(_0xce0f('0x17'));var config=require(_0xce0f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f3b20,_0x3c30e5){_0x3c30e5=_0x3c30e5||0xcc;return function(_0x533be7){if(_0x533be7){return _0x2f3b20[_0xce0f('0x19')](_0x3c30e5);}return _0x2f3b20['status'](_0x3c30e5)['end']();};}function respondWithResult(_0x4966fa,_0x19e0a1){_0x19e0a1=_0x19e0a1||0xc8;return function(_0x464b49){if(_0x464b49){return _0x4966fa[_0xce0f('0x1a')](_0x19e0a1)[_0xce0f('0x1b')](_0x464b49);}};}function respondWithFilteredResult(_0x5d5595,_0x3c274a){return function(_0x542fa7){if(_0x542fa7){var _0x35ca12=_0x542fa7[_0xce0f('0x1c')],_0x2e6c1f=_0x3c274a[_0xce0f('0x1d')],_0x4c71e4=_0x3c274a[_0xce0f('0x1d')]+_0x3c274a[_0xce0f('0x1e')],_0xbec7c3;if(_0x4c71e4>=_0x35ca12){_0x4c71e4=_0x35ca12;_0xbec7c3=0xc8;}else{_0xbec7c3=0xce;}_0x5d5595[_0xce0f('0x1a')](_0xbec7c3);return _0x5d5595['set'](_0xce0f('0x1f'),_0x2e6c1f+'-'+_0x4c71e4+'/'+_0x35ca12)[_0xce0f('0x1b')](_0x542fa7);}return null;};}function patchUpdates(_0x54c53a){return function(_0x41fd3e){try{jsonpatch[_0xce0f('0x20')](_0x41fd3e,_0x54c53a,!![]);}catch(_0x2f7cc0){return BPromise['reject'](_0x2f7cc0);}return _0x41fd3e['save']();};}function saveUpdates(_0x3489be,_0x3e38a4){return function(_0x3ad94c){if(_0x3ad94c){return _0x3ad94c[_0xce0f('0x21')](_0x3489be)[_0xce0f('0x22')](function(_0x55756a){return _0x55756a;});}return null;};}function removeEntity(_0x4d0d28,_0x779ec7){return function(_0x1c9791){if(_0x1c9791){return _0x1c9791[_0xce0f('0x23')]()[_0xce0f('0x22')](function(){_0x4d0d28[_0xce0f('0x1a')](0xcc)[_0xce0f('0x24')]();});}};}function handleEntityNotFound(_0x3579c7,_0x99bf6f){return function(_0x1c2ad6){if(!_0x1c2ad6){_0x3579c7[_0xce0f('0x19')](0x194);}return _0x1c2ad6;};}function handleError(_0x2b2577,_0x60a6e6){_0x60a6e6=_0x60a6e6||0x1f4;return function(_0x292a24){logger[_0xce0f('0x25')](_0x292a24[_0xce0f('0x26')]);if(_0x292a24[_0xce0f('0x27')]){delete _0x292a24[_0xce0f('0x27')];}_0x2b2577[_0xce0f('0x1a')](_0x60a6e6)['send'](_0x292a24);};}exports[_0xce0f('0x28')]=function(_0x239aea,_0x146e14){var _0x5521f8={},_0x4a1ca0={},_0x1cbb5a={'count':0x0,'rows':[]};var _0x19bb25=db[_0xce0f('0x29')][_0xce0f('0x2a')];_0x4a1ca0[_0xce0f('0x2b')]=_['differenceBy'](_[_0xce0f('0x2c')](_0x19bb25),[_0xce0f('0x2d')]);_0x4a1ca0[_0xce0f('0x2e')]=_[_0xce0f('0x2c')](_0x239aea['query']);_0x4a1ca0['filters']=_[_0xce0f('0x2f')](_0x4a1ca0['model'],_0x4a1ca0[_0xce0f('0x2e')]);_0x5521f8[_0xce0f('0x30')]=_[_0xce0f('0x2f')](_0x4a1ca0['model'],qs[_0xce0f('0x31')](_0x239aea[_0xce0f('0x2e')][_0xce0f('0x31')]));_0x5521f8[_0xce0f('0x30')]=_0x5521f8[_0xce0f('0x30')][_0xce0f('0x32')]?_0x5521f8['attributes']:_0x4a1ca0[_0xce0f('0x2b')];if(!_0x239aea['query']['hasOwnProperty'](_0xce0f('0x33'))){_0x5521f8[_0xce0f('0x1e')]=qs[_0xce0f('0x1e')](_0x239aea['query'][_0xce0f('0x1e')]);_0x5521f8[_0xce0f('0x1d')]=qs[_0xce0f('0x1d')](_0x239aea[_0xce0f('0x2e')][_0xce0f('0x1d')]);}_0x5521f8[_0xce0f('0x34')]=qs[_0xce0f('0x35')](_0x239aea[_0xce0f('0x2e')][_0xce0f('0x35')]);_0x5521f8[_0xce0f('0x36')]=qs[_0xce0f('0x37')](_[_0xce0f('0x38')](_0x239aea[_0xce0f('0x2e')],_0x4a1ca0[_0xce0f('0x37')]));if(_0x239aea[_0xce0f('0x2e')][_0xce0f('0x39')]){_0x5521f8[_0xce0f('0x36')]=_[_0xce0f('0x3a')](_0x5521f8[_0xce0f('0x36')],{'$or':_[_0xce0f('0x3b')](_0x19bb25,function(_0x21e0be){if(_0x21e0be[_0xce0f('0x3c')][_0xce0f('0x3d')]!==_0xce0f('0x3e')){var _0x20d2ef={};_0x20d2ef[_0x21e0be['field']]={'$like':'%'+_0x239aea[_0xce0f('0x2e')][_0xce0f('0x39')]+'%'};return _0x20d2ef;}})});}_0x5521f8=_[_0xce0f('0x3a')]({},_0x5521f8,_0x239aea[_0xce0f('0x3f')]);var _0x45bf43={'where':_0x5521f8['where']};return db[_0xce0f('0x29')]['count'](_0x45bf43)[_0xce0f('0x22')](function(_0x5a7f97){_0x1cbb5a['count']=_0x5a7f97;if(_0x239aea[_0xce0f('0x2e')][_0xce0f('0x40')]){_0x5521f8[_0xce0f('0x41')]=[{'all':!![]}];}return db[_0xce0f('0x29')][_0xce0f('0x42')](_0x5521f8);})['then'](function(_0x1dc7b0){_0x1cbb5a[_0xce0f('0x43')]=_0x1dc7b0;return _0x1cbb5a;})['then'](respondWithFilteredResult(_0x146e14,_0x5521f8))['catch'](handleError(_0x146e14,null));};exports[_0xce0f('0x44')]=function(_0x596742,_0x26e707){var _0x4d181f={'raw':![],'where':{'id':_0x596742['params']['id']}},_0x493968={};_0x493968[_0xce0f('0x2b')]=_[_0xce0f('0x2c')](db[_0xce0f('0x29')]['rawAttributes']);_0x493968['query']=_[_0xce0f('0x2c')](_0x596742[_0xce0f('0x2e')]);_0x493968['filters']=_[_0xce0f('0x2f')](_0x493968[_0xce0f('0x2b')],_0x493968['query']);_0x4d181f[_0xce0f('0x30')]=_[_0xce0f('0x2f')](_0x493968[_0xce0f('0x2b')],qs[_0xce0f('0x31')](_0x596742[_0xce0f('0x2e')]['fields']));_0x4d181f[_0xce0f('0x30')]=_0x4d181f[_0xce0f('0x30')]['length']?_0x4d181f[_0xce0f('0x30')]:_0x493968[_0xce0f('0x2b')];if(_0x596742[_0xce0f('0x2e')][_0xce0f('0x40')]){_0x4d181f[_0xce0f('0x41')]=[{'all':!![]}];}_0x4d181f=_['merge']({},_0x4d181f,_0x596742['options']);return db['VoiceRecording'][_0xce0f('0x45')](_0x4d181f)['then'](handleEntityNotFound(_0x26e707,null))[_0xce0f('0x22')](respondWithResult(_0x26e707,null))[_0xce0f('0x46')](handleError(_0x26e707,null));};exports[_0xce0f('0x47')]=function(_0x168d04,_0x1cf4f9){return db[_0xce0f('0x29')][_0xce0f('0x47')](_0x168d04[_0xce0f('0x48')],{})['then'](respondWithResult(_0x1cf4f9,0xc9))[_0xce0f('0x46')](handleError(_0x1cf4f9,null));};exports[_0xce0f('0x21')]=function(_0x15c35,_0x553d02){if(_0x15c35[_0xce0f('0x48')]['id']){delete _0x15c35[_0xce0f('0x48')]['id'];}return db[_0xce0f('0x29')][_0xce0f('0x45')]({'where':{'id':_0x15c35['params']['id']}})[_0xce0f('0x22')](handleEntityNotFound(_0x553d02,null))[_0xce0f('0x22')](saveUpdates(_0x15c35[_0xce0f('0x48')],null))[_0xce0f('0x22')](respondWithResult(_0x553d02,null))[_0xce0f('0x46')](handleError(_0x553d02,null));};exports[_0xce0f('0x23')]=function(_0x2c87c7,_0x31abb8){return db['VoiceRecording']['find']({'where':{'id':_0x2c87c7[_0xce0f('0x49')]['id']}})['then'](handleEntityNotFound(_0x31abb8,null))[_0xce0f('0x22')](removeEntity(_0x31abb8,null))[_0xce0f('0x46')](handleError(_0x31abb8,null));};exports[_0xce0f('0x4a')]=function(_0x308677,_0x37f6ac){return db['VoiceRecording'][_0xce0f('0x4a')]()[_0xce0f('0x22')](respondWithResult(_0x37f6ac,null))['catch'](handleError(_0x37f6ac,null));};exports['download']=function(_0x410d60,_0x23b3ca,_0x38e73b){var _0x539a79=require('../../components/encryptor');var _0x4927b1=![];var _0x4d80a2={};if(_0x410d60[_0xce0f('0x2e')][_0xce0f('0x3c')]&&_0x410d60['query']['type']===_0xce0f('0x4b')){_0x4d80a2[_0xce0f('0x4b')]=_0x410d60[_0xce0f('0x49')]['id'];}else{_0x4d80a2['id']=_0x410d60['params']['id'];}return db[_0xce0f('0x29')]['find']({'where':_0x4d80a2,'attributes':['id',_0xce0f('0x4c')],'raw':!![]})[_0xce0f('0x22')](handleEntityNotFound(_0x23b3ca,null))[_0xce0f('0x22')](function(_0x1ef7c2){if(_0x1ef7c2){var _0x825fd7=util[_0xce0f('0x2d')](_0xce0f('0x4d'),_0x1ef7c2[_0xce0f('0x4c')]);if(fs[_0xce0f('0x4e')](_0x825fd7)){_0x4927b1=!![];return _0x539a79['decryptFile'](_0x825fd7,_0x1ef7c2['value'],config[_0xce0f('0x4f')][_0xce0f('0x50')])[_0xce0f('0x22')](function(){return _0x1ef7c2;});}return _0x1ef7c2;}})[_0xce0f('0x22')](function(_0x20c127){if(_0x20c127){if(!fs[_0xce0f('0x4e')](_0x20c127[_0xce0f('0x4c')])){throw new db[(_0xce0f('0x51'))][(_0xce0f('0x52'))](_0xce0f('0x53'));}if(_0x20c127[_0xce0f('0x54')]){return _0x23b3ca[_0xce0f('0x55')](_0x20c127['value'],_0x20c127[_0xce0f('0x54')]+path['extname'](_0x20c127[_0xce0f('0x4c')]),function(){if(_0x4927b1){fs[_0xce0f('0x56')](_0x20c127[_0xce0f('0x4c')]);}});}else{return _0x23b3ca[_0xce0f('0x55')](_0x20c127[_0xce0f('0x4c')],function(_0xf279f2){if(_0x4927b1){fs[_0xce0f('0x56')](_0x20c127['value']);}});}}})[_0xce0f('0x46')](handleError(_0x23b3ca,null));};exports[_0xce0f('0x57')]=function(_0x25355f,_0x4fbf84,_0x13476d){var _0x50ceb1=require(_0xce0f('0x58'));var _0x355082=![];var _0x1de772={'$and':[db[_0xce0f('0x59')]['where'](db[_0xce0f('0x59')]['fn'](_0xce0f('0x5a'),db[_0xce0f('0x59')][_0xce0f('0x5b')]('uniqueid')),_0x25355f[_0xce0f('0x2e')][_0xce0f('0x5c')])]};if(_0x25355f[_0xce0f('0x2e')]['type']&&_0x25355f[_0xce0f('0x2e')][_0xce0f('0x3c')]==='uniqueid'){_0x1de772[_0xce0f('0x5d')]['push']({'uniqueid':_0x25355f[_0xce0f('0x49')]['id']});}else{_0x1de772['$and'][_0xce0f('0x5e')]({'id':_0x25355f['params']['id']});}return db[_0xce0f('0x29')]['find']({'where':_0x1de772,'attributes':['id','value'],'raw':!![]})[_0xce0f('0x22')](handleEntityNotFound(_0x4fbf84,null))['then'](function(_0x426c6d){if(_0x426c6d){var _0x37a063=util[_0xce0f('0x2d')]('%s.cypher',_0x426c6d['value']);if(fs[_0xce0f('0x4e')](_0x37a063)){_0x355082=!![];return _0x50ceb1[_0xce0f('0x5f')](_0x37a063,_0x426c6d[_0xce0f('0x4c')],config[_0xce0f('0x4f')][_0xce0f('0x50')])[_0xce0f('0x22')](function(){return _0x426c6d;});}return _0x426c6d;}})[_0xce0f('0x22')](function(_0x51a45c){if(_0x51a45c){if(!fs[_0xce0f('0x4e')](_0x51a45c['value'])){throw new db[(_0xce0f('0x51'))]['ValidationError'](_0xce0f('0x53'));}if(_0x51a45c[_0xce0f('0x54')]){return _0x4fbf84[_0xce0f('0x55')](_0x51a45c[_0xce0f('0x4c')],_0x51a45c[_0xce0f('0x54')]+path[_0xce0f('0x60')](_0x51a45c[_0xce0f('0x4c')]),function(){if(_0x355082){fs[_0xce0f('0x56')](_0x51a45c['value']);}});}else{return _0x4fbf84[_0xce0f('0x55')](_0x51a45c['value'],function(_0x2362ec){if(_0x355082){fs[_0xce0f('0x56')](_0x51a45c['value']);}});}}})[_0xce0f('0x46')](handleError(_0x4fbf84,null));}; \ No newline at end of file +var _0xa1c0=['existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','sequelize','MD5','token','push','$and','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','rawAttributes','differenceBy','keys','format','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','VoiceRecording','include','find','create','body','describe','download','../../components/encryptor','type','uniqueid','%s.cypher','value'];(function(_0x2b0f23,_0x152963){var _0x4e6ecb=function(_0x4802b1){while(--_0x4802b1){_0x2b0f23['push'](_0x2b0f23['shift']());}};_0x4e6ecb(++_0x152963);}(_0xa1c0,0x18b));var _0x0a1c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa1c0[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x0a1c('0x0'));var emlformat=require(_0x0a1c('0x1'));var rimraf=require(_0x0a1c('0x2'));var zipdir=require(_0x0a1c('0x3'));var jsonpatch=require(_0x0a1c('0x4'));var rp=require(_0x0a1c('0x5'));var moment=require(_0x0a1c('0x6'));var BPromise=require(_0x0a1c('0x7'));var Mustache=require(_0x0a1c('0x8'));var util=require(_0x0a1c('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x0a1c('0xa'));var ejs=require(_0x0a1c('0xb'));var fs=require('fs');var _=require(_0x0a1c('0xc'));var squel=require('squel');var crypto=require(_0x0a1c('0xd'));var jsforce=require(_0x0a1c('0xe'));var deskjs=require(_0x0a1c('0xf'));var toCsv=require(_0x0a1c('0xa'));var querystring=require(_0x0a1c('0x10'));var Papa=require(_0x0a1c('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x0a1c('0x12'));var Redis=require(_0x0a1c('0x13'));var qs=require(_0x0a1c('0x14'));var logger=require('../../config/logger')(_0x0a1c('0x15'));var utils=require(_0x0a1c('0x16'));var config=require(_0x0a1c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aeca6,_0x2d5409){_0x2d5409=_0x2d5409||0xcc;return function(_0x5dfac2){if(_0x5dfac2){return _0x5aeca6[_0x0a1c('0x18')](_0x2d5409);}return _0x5aeca6[_0x0a1c('0x19')](_0x2d5409)[_0x0a1c('0x1a')]();};}function respondWithResult(_0x1177e8,_0x35dace){_0x35dace=_0x35dace||0xc8;return function(_0x5073a4){if(_0x5073a4){return _0x1177e8[_0x0a1c('0x19')](_0x35dace)[_0x0a1c('0x1b')](_0x5073a4);}};}function respondWithFilteredResult(_0xab5a39,_0x1a2b5b){return function(_0x437476){if(_0x437476){var _0x40fcf7=_0x437476[_0x0a1c('0x1c')],_0x524748=_0x1a2b5b[_0x0a1c('0x1d')],_0x2390e8=_0x1a2b5b['offset']+_0x1a2b5b[_0x0a1c('0x1e')],_0x499271;if(_0x2390e8>=_0x40fcf7){_0x2390e8=_0x40fcf7;_0x499271=0xc8;}else{_0x499271=0xce;}_0xab5a39['status'](_0x499271);return _0xab5a39[_0x0a1c('0x1f')](_0x0a1c('0x20'),_0x524748+'-'+_0x2390e8+'/'+_0x40fcf7)[_0x0a1c('0x1b')](_0x437476);}return null;};}function patchUpdates(_0x1b603f){return function(_0x4d6256){try{jsonpatch[_0x0a1c('0x21')](_0x4d6256,_0x1b603f,!![]);}catch(_0x39b428){return BPromise['reject'](_0x39b428);}return _0x4d6256[_0x0a1c('0x22')]();};}function saveUpdates(_0xd57a07,_0x57b559){return function(_0x472243){if(_0x472243){return _0x472243[_0x0a1c('0x23')](_0xd57a07)[_0x0a1c('0x24')](function(_0x29eb9a){return _0x29eb9a;});}return null;};}function removeEntity(_0x6a16db,_0x17d7de){return function(_0x29a440){if(_0x29a440){return _0x29a440[_0x0a1c('0x25')]()[_0x0a1c('0x24')](function(){_0x6a16db[_0x0a1c('0x19')](0xcc)[_0x0a1c('0x1a')]();});}};}function handleEntityNotFound(_0x2d5d2f,_0x28103f){return function(_0x106d16){if(!_0x106d16){_0x2d5d2f[_0x0a1c('0x18')](0x194);}return _0x106d16;};}function handleError(_0x325d17,_0x7b278e){_0x7b278e=_0x7b278e||0x1f4;return function(_0x2157f3){logger['error'](_0x2157f3[_0x0a1c('0x26')]);if(_0x2157f3['name']){delete _0x2157f3[_0x0a1c('0x27')];}_0x325d17['status'](_0x7b278e)[_0x0a1c('0x28')](_0x2157f3);};}exports['index']=function(_0x58cb67,_0x33514c){var _0x28c4df={},_0x535a81={},_0x3e20d6={'count':0x0,'rows':[]};var _0x57382c=db['VoiceRecording'][_0x0a1c('0x29')];_0x535a81['model']=_[_0x0a1c('0x2a')](_[_0x0a1c('0x2b')](_0x57382c),[_0x0a1c('0x2c')]);_0x535a81[_0x0a1c('0x2d')]=_[_0x0a1c('0x2b')](_0x58cb67[_0x0a1c('0x2d')]);_0x535a81[_0x0a1c('0x2e')]=_[_0x0a1c('0x2f')](_0x535a81['model'],_0x535a81[_0x0a1c('0x2d')]);_0x28c4df[_0x0a1c('0x30')]=_[_0x0a1c('0x2f')](_0x535a81[_0x0a1c('0x31')],qs[_0x0a1c('0x32')](_0x58cb67['query'][_0x0a1c('0x32')]));_0x28c4df[_0x0a1c('0x30')]=_0x28c4df[_0x0a1c('0x30')][_0x0a1c('0x33')]?_0x28c4df[_0x0a1c('0x30')]:_0x535a81[_0x0a1c('0x31')];if(!_0x58cb67[_0x0a1c('0x2d')]['hasOwnProperty'](_0x0a1c('0x34'))){_0x28c4df[_0x0a1c('0x1e')]=qs[_0x0a1c('0x1e')](_0x58cb67[_0x0a1c('0x2d')][_0x0a1c('0x1e')]);_0x28c4df[_0x0a1c('0x1d')]=qs['offset'](_0x58cb67[_0x0a1c('0x2d')][_0x0a1c('0x1d')]);}_0x28c4df[_0x0a1c('0x35')]=qs[_0x0a1c('0x36')](_0x58cb67['query'][_0x0a1c('0x36')]);_0x28c4df[_0x0a1c('0x37')]=qs['filters'](_[_0x0a1c('0x38')](_0x58cb67[_0x0a1c('0x2d')],_0x535a81[_0x0a1c('0x2e')]));if(_0x58cb67[_0x0a1c('0x2d')][_0x0a1c('0x39')]){_0x28c4df[_0x0a1c('0x37')]=_[_0x0a1c('0x3a')](_0x28c4df[_0x0a1c('0x37')],{'$or':_['map'](_0x57382c,function(_0x11fabf){if(_0x11fabf['type']['key']!==_0x0a1c('0x3b')){var _0x3eef9b={};_0x3eef9b[_0x11fabf[_0x0a1c('0x3c')]]={'$like':'%'+_0x58cb67[_0x0a1c('0x2d')]['filter']+'%'};return _0x3eef9b;}})});}_0x28c4df=_[_0x0a1c('0x3a')]({},_0x28c4df,_0x58cb67[_0x0a1c('0x3d')]);var _0x22b148={'where':_0x28c4df[_0x0a1c('0x37')]};return db['VoiceRecording']['count'](_0x22b148)[_0x0a1c('0x24')](function(_0x4bcb1c){_0x3e20d6[_0x0a1c('0x1c')]=_0x4bcb1c;if(_0x58cb67[_0x0a1c('0x2d')][_0x0a1c('0x3e')]){_0x28c4df['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x0a1c('0x3f')](_0x28c4df);})[_0x0a1c('0x24')](function(_0x42f7fa){_0x3e20d6[_0x0a1c('0x40')]=_0x42f7fa;return _0x3e20d6;})[_0x0a1c('0x24')](respondWithFilteredResult(_0x33514c,_0x28c4df))[_0x0a1c('0x41')](handleError(_0x33514c,null));};exports[_0x0a1c('0x42')]=function(_0x5d0f78,_0x508893){var _0x2071df={'raw':![],'where':{'id':_0x5d0f78[_0x0a1c('0x43')]['id']}},_0x53b50f={};_0x53b50f[_0x0a1c('0x31')]=_[_0x0a1c('0x2b')](db[_0x0a1c('0x44')][_0x0a1c('0x29')]);_0x53b50f[_0x0a1c('0x2d')]=_['keys'](_0x5d0f78[_0x0a1c('0x2d')]);_0x53b50f['filters']=_[_0x0a1c('0x2f')](_0x53b50f[_0x0a1c('0x31')],_0x53b50f[_0x0a1c('0x2d')]);_0x2071df[_0x0a1c('0x30')]=_['intersection'](_0x53b50f['model'],qs[_0x0a1c('0x32')](_0x5d0f78['query'][_0x0a1c('0x32')]));_0x2071df[_0x0a1c('0x30')]=_0x2071df[_0x0a1c('0x30')][_0x0a1c('0x33')]?_0x2071df[_0x0a1c('0x30')]:_0x53b50f[_0x0a1c('0x31')];if(_0x5d0f78[_0x0a1c('0x2d')][_0x0a1c('0x3e')]){_0x2071df[_0x0a1c('0x45')]=[{'all':!![]}];}_0x2071df=_[_0x0a1c('0x3a')]({},_0x2071df,_0x5d0f78[_0x0a1c('0x3d')]);return db[_0x0a1c('0x44')][_0x0a1c('0x46')](_0x2071df)[_0x0a1c('0x24')](handleEntityNotFound(_0x508893,null))[_0x0a1c('0x24')](respondWithResult(_0x508893,null))[_0x0a1c('0x41')](handleError(_0x508893,null));};exports[_0x0a1c('0x47')]=function(_0x35c669,_0x116c40){return db[_0x0a1c('0x44')][_0x0a1c('0x47')](_0x35c669[_0x0a1c('0x48')],{})[_0x0a1c('0x24')](respondWithResult(_0x116c40,0xc9))[_0x0a1c('0x41')](handleError(_0x116c40,null));};exports[_0x0a1c('0x23')]=function(_0x535dd8,_0x13ddac){if(_0x535dd8[_0x0a1c('0x48')]['id']){delete _0x535dd8['body']['id'];}return db[_0x0a1c('0x44')][_0x0a1c('0x46')]({'where':{'id':_0x535dd8[_0x0a1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x13ddac,null))[_0x0a1c('0x24')](saveUpdates(_0x535dd8['body'],null))[_0x0a1c('0x24')](respondWithResult(_0x13ddac,null))[_0x0a1c('0x41')](handleError(_0x13ddac,null));};exports['destroy']=function(_0x54ad69,_0xf7c70e){return db[_0x0a1c('0x44')][_0x0a1c('0x46')]({'where':{'id':_0x54ad69['params']['id']}})[_0x0a1c('0x24')](handleEntityNotFound(_0xf7c70e,null))['then'](removeEntity(_0xf7c70e,null))['catch'](handleError(_0xf7c70e,null));};exports['describe']=function(_0x204968,_0x5710f7){return db['VoiceRecording'][_0x0a1c('0x49')]()[_0x0a1c('0x24')](respondWithResult(_0x5710f7,null))[_0x0a1c('0x41')](handleError(_0x5710f7,null));};exports[_0x0a1c('0x4a')]=function(_0x4a7dcc,_0x1663aa,_0x311a86){var _0x4767f1=require(_0x0a1c('0x4b'));var _0x2bb80f=![];var _0x3b8774={};if(_0x4a7dcc['query'][_0x0a1c('0x4c')]&&_0x4a7dcc[_0x0a1c('0x2d')]['type']==='uniqueid'){_0x3b8774[_0x0a1c('0x4d')]=_0x4a7dcc[_0x0a1c('0x43')]['id'];}else{_0x3b8774['id']=_0x4a7dcc[_0x0a1c('0x43')]['id'];}return db[_0x0a1c('0x44')][_0x0a1c('0x46')]({'where':_0x3b8774,'attributes':['id','value'],'raw':!![]})[_0x0a1c('0x24')](handleEntityNotFound(_0x1663aa,null))[_0x0a1c('0x24')](function(_0xadc398){if(_0xadc398){var _0x347e52=util[_0x0a1c('0x2c')](_0x0a1c('0x4e'),_0xadc398[_0x0a1c('0x4f')]);if(fs[_0x0a1c('0x50')](_0x347e52)){_0x2bb80f=!![];return _0x4767f1[_0x0a1c('0x51')](_0x347e52,_0xadc398[_0x0a1c('0x4f')],config[_0x0a1c('0x52')][_0x0a1c('0x53')])[_0x0a1c('0x24')](function(){return _0xadc398;});}return _0xadc398;}})[_0x0a1c('0x24')](function(_0x3707a4){if(_0x3707a4){if(!fs['existsSync'](_0x3707a4[_0x0a1c('0x4f')])){throw new db[(_0x0a1c('0x54'))][(_0x0a1c('0x55'))](_0x0a1c('0x56'));}if(_0x3707a4['filename']){return _0x1663aa[_0x0a1c('0x4a')](_0x3707a4['value'],_0x3707a4[_0x0a1c('0x57')]+path[_0x0a1c('0x58')](_0x3707a4[_0x0a1c('0x4f')]),function(){if(_0x2bb80f){fs[_0x0a1c('0x59')](_0x3707a4['value']);}});}else{return _0x1663aa[_0x0a1c('0x4a')](_0x3707a4['value'],function(_0x5bca73){if(_0x2bb80f){fs['unlink'](_0x3707a4[_0x0a1c('0x4f')]);}});}}})[_0x0a1c('0x41')](handleError(_0x1663aa,null));};exports['downloads']=function(_0x3eccba,_0x2f1236,_0x279f4d){var _0x1a21f2=require(_0x0a1c('0x4b'));var _0x31c31a=![];var _0x34e7cc={'$and':[db['sequelize'][_0x0a1c('0x37')](db[_0x0a1c('0x5a')]['fn'](_0x0a1c('0x5b'),db[_0x0a1c('0x5a')]['col']('uniqueid')),_0x3eccba['query'][_0x0a1c('0x5c')])]};if(_0x3eccba['query'][_0x0a1c('0x4c')]&&_0x3eccba[_0x0a1c('0x2d')][_0x0a1c('0x4c')]==='uniqueid'){_0x34e7cc['$and'][_0x0a1c('0x5d')]({'uniqueid':_0x3eccba['params']['id']});}else{_0x34e7cc[_0x0a1c('0x5e')][_0x0a1c('0x5d')]({'id':_0x3eccba['params']['id']});}return db[_0x0a1c('0x44')][_0x0a1c('0x46')]({'where':_0x34e7cc,'attributes':['id',_0x0a1c('0x4f')],'raw':!![]})[_0x0a1c('0x24')](handleEntityNotFound(_0x2f1236,null))[_0x0a1c('0x24')](function(_0x279101){if(_0x279101){var _0x4ac8d9=util[_0x0a1c('0x2c')](_0x0a1c('0x4e'),_0x279101[_0x0a1c('0x4f')]);if(fs[_0x0a1c('0x50')](_0x4ac8d9)){_0x31c31a=!![];return _0x1a21f2['decryptFile'](_0x4ac8d9,_0x279101[_0x0a1c('0x4f')],config['secrets'][_0x0a1c('0x53')])[_0x0a1c('0x24')](function(){return _0x279101;});}return _0x279101;}})[_0x0a1c('0x24')](function(_0x42a809){if(_0x42a809){if(!fs[_0x0a1c('0x50')](_0x42a809[_0x0a1c('0x4f')])){throw new db[(_0x0a1c('0x54'))][(_0x0a1c('0x55'))](_0x0a1c('0x56'));}if(_0x42a809[_0x0a1c('0x57')]){return _0x2f1236['download'](_0x42a809[_0x0a1c('0x4f')],_0x42a809['filename']+path[_0x0a1c('0x58')](_0x42a809[_0x0a1c('0x4f')]),function(){if(_0x31c31a){fs[_0x0a1c('0x59')](_0x42a809[_0x0a1c('0x4f')]);}});}else{return _0x2f1236[_0x0a1c('0x4a')](_0x42a809[_0x0a1c('0x4f')],function(_0x49a614){if(_0x31c31a){fs[_0x0a1c('0x59')](_0x42a809['value']);}});}}})[_0x0a1c('0x41')](handleError(_0x2f1236,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6d6feb5..2f53d7b 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 _0x0938=['exports','define','VoiceRecording','voice_recordings','uniqueid','util','moment','bluebird','request-promise','./voiceRecording.attributes'];(function(_0x2bb067,_0x30dcb9){var _0x65d9a3=function(_0x304000){while(--_0x304000){_0x2bb067['push'](_0x2bb067['shift']());}};_0x65d9a3(++_0x30dcb9);}(_0x0938,0x1d1));var _0x8093=function(_0x5717fa,_0x4c0526){_0x5717fa=_0x5717fa-0x0;var _0xcfcaa3=_0x0938[_0x5717fa];return _0xcfcaa3;};'use strict';var _=require('lodash');var util=require(_0x8093('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8093('0x1'));var BPromise=require(_0x8093('0x2'));var rp=require(_0x8093('0x3'));var attributes=require(_0x8093('0x4'));module[_0x8093('0x5')]=function(_0x2c397b,_0xc525a1){return _0x2c397b[_0x8093('0x6')](_0x8093('0x7'),attributes,{'tableName':_0x8093('0x8'),'paranoid':![],'indexes':[{'name':_0x8093('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x225c=['util','../../config/logger','api','moment','bluebird','request-promise','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x225c,0x185));var _0xc225=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x225c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc225('0x0'));var util=require(_0xc225('0x1'));var logger=require(_0xc225('0x2'))(_0xc225('0x3'));var moment=require(_0xc225('0x4'));var BPromise=require(_0xc225('0x5'));var rp=require(_0xc225('0x6'));var attributes=require(_0xc225('0x7'));module[_0xc225('0x8')]=function(_0x1254ab,_0x32d6fc){return _0x1254ab[_0xc225('0x9')](_0xc225('0xa'),attributes,{'tableName':_0xc225('0xb'),'paranoid':![],'indexes':[{'name':_0xc225('0xc'),'fields':[_0xc225('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 470891a..8b8de95 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 _0xd2f8=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','VoiceRecording','update','body','raw','options','where','limit','UpdateVoiceRecording','debug','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2f8,0x1df));var _0x8d2f=function(_0x4906c7,_0x5e2ae3){_0x4906c7=_0x4906c7-0x0;var _0x44f12d=_0xd2f8[_0x4906c7];return _0x44f12d;};'use strict';var _=require(_0x8d2f('0x0'));var util=require(_0x8d2f('0x1'));var moment=require(_0x8d2f('0x2'));var BPromise=require(_0x8d2f('0x3'));var rs=require(_0x8d2f('0x4'));var fs=require('fs');var Redis=require(_0x8d2f('0x5'));var db=require(_0x8d2f('0x6'))['db'];var utils=require(_0x8d2f('0x7'));var logger=require('../../config/logger')(_0x8d2f('0x8'));var config=require(_0x8d2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8d2f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x268394,_0x4c76ca,_0x2d38db){return new BPromise(function(_0x20d137,_0x14c6f9){return client[_0x8d2f('0xb')](_0x268394,_0x2d38db)[_0x8d2f('0xc')](function(_0x2d7b8e){logger[_0x8d2f('0xd')](_0x8d2f('0xe'),_0x4c76ca,_0x8d2f('0xf'));logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x4c76ca,_0x8d2f('0xf'),JSON[_0x8d2f('0x10')](_0x2d7b8e));if(_0x2d7b8e[_0x8d2f('0x11')]){if(_0x2d7b8e[_0x8d2f('0x11')]['code']===0x1f4){logger[_0x8d2f('0x11')](_0x8d2f('0xe'),_0x4c76ca,_0x2d7b8e[_0x8d2f('0x11')]['message']);return _0x14c6f9(_0x2d7b8e[_0x8d2f('0x11')][_0x8d2f('0x12')]);}logger[_0x8d2f('0x11')](_0x8d2f('0xe'),_0x4c76ca,_0x2d7b8e[_0x8d2f('0x11')]['message']);return _0x20d137(_0x2d7b8e['error'][_0x8d2f('0x12')]);}else{logger['info'](_0x8d2f('0xe'),_0x4c76ca,'request\x20sent');_0x20d137(_0x2d7b8e[_0x8d2f('0x13')][_0x8d2f('0x12')]);}})['catch'](function(_0x49146e){logger[_0x8d2f('0x11')](_0x8d2f('0xe'),_0x4c76ca,_0x49146e);_0x14c6f9(_0x49146e);});});}exports['UpdateVoiceRecording']=function(_0x57b476){var _0x5df9d9=this;return new Promise(function(_0x1a0dc1,_0x242fae){return db[_0x8d2f('0x14')][_0x8d2f('0x15')](_0x57b476[_0x8d2f('0x16')],{'raw':_0x57b476['options']?_0x57b476['options'][_0x8d2f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57b476[_0x8d2f('0x18')]?_0x57b476[_0x8d2f('0x18')][_0x8d2f('0x19')]||null:null,'attributes':_0x57b476[_0x8d2f('0x18')]?_0x57b476[_0x8d2f('0x18')]['attributes']||null:null,'limit':_0x57b476[_0x8d2f('0x18')]?_0x57b476['options'][_0x8d2f('0x1a')]||null:null})[_0x8d2f('0xc')](function(_0x2505c9){logger['info'](_0x8d2f('0x1b'),_0x57b476);logger[_0x8d2f('0x1c')]('UpdateVoiceRecording',_0x57b476,JSON['stringify'](_0x2505c9));_0x1a0dc1(_0x2505c9);})[_0x8d2f('0x1d')](function(_0x2752b0){logger[_0x8d2f('0x11')](_0x8d2f('0x1b'),_0x2752b0[_0x8d2f('0x12')],_0x57b476);_0x242fae(_0x5df9d9[_0x8d2f('0x11')](0x1f4,_0x2752b0['message']));});});};exports[_0x8d2f('0x1e')]=function(_0x5bf0c8){var _0x31c2fc=this;return new Promise(function(_0x99d511,_0x251aa0){var _0x3b3ae7=require(_0x8d2f('0x1f'));var _0x30ee72;return db[_0x8d2f('0x20')][_0x8d2f('0x21')]({'attributes':['id',_0x8d2f('0x22')],'where':{'id':0x1},'raw':!![]})[_0x8d2f('0xc')](function(_0x5e99e5){_0x30ee72=_0x5e99e5;return db[_0x8d2f('0x14')][_0x8d2f('0x23')](_0x5bf0c8[_0x8d2f('0x16')]);})[_0x8d2f('0xc')](function(_0x5b7e8b){if(_0x30ee72[_0x8d2f('0x22')]&&fs[_0x8d2f('0x24')](_0x5b7e8b['value'])){var _0xbf0cca=util['format'](_0x8d2f('0x25'),_0x5b7e8b[_0x8d2f('0x26')]);return _0x3b3ae7[_0x8d2f('0x27')](_0x5b7e8b['value'],_0xbf0cca,config[_0x8d2f('0x28')][_0x8d2f('0x29')])['then'](function(){fs[_0x8d2f('0x2a')](_0x5b7e8b['value']);logger['info'](_0x8d2f('0x2b'));return _0x5b7e8b;});}return _0x5b7e8b;})[_0x8d2f('0xc')](function(_0x49e06e){logger[_0x8d2f('0xd')]('CreateVoiceRecording',_0x5bf0c8);logger[_0x8d2f('0x1c')](_0x8d2f('0x1e'),_0x5bf0c8,JSON['stringify'](_0x49e06e));_0x99d511(_0x49e06e);})[_0x8d2f('0x1d')](function(_0x16d75d){logger[_0x8d2f('0x11')](_0x8d2f('0x1e'),_0x16d75d[_0x8d2f('0x12')],_0x5bf0c8);_0x251aa0(_0x31c2fc['error'](0x1f4,_0x16d75d[_0x8d2f('0x12')]));});});}; \ No newline at end of file +var _0xf18f=['create','then','callRecordingEncryption','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','debug','stringify','../../components/encryptor','Setting'];(function(_0x3f0743,_0x19c784){var _0x291c35=function(_0x4da170){while(--_0x4da170){_0x3f0743['push'](_0x3f0743['shift']());}};_0x291c35(++_0x19c784);}(_0xf18f,0x164));var _0xff18=function(_0x37d8bc,_0x200622){_0x37d8bc=_0x37d8bc-0x0;var _0x4622b7=_0xf18f[_0x37d8bc];return _0x4622b7;};'use strict';var _=require(_0xff18('0x0'));var util=require(_0xff18('0x1'));var moment=require(_0xff18('0x2'));var BPromise=require(_0xff18('0x3'));var rs=require(_0xff18('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff18('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff18('0x6'))(_0xff18('0x7'));var config=require('../../config/environment');var jayson=require(_0xff18('0x8'));var client=jayson[_0xff18('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1990,_0x2d7078,_0x1a2acf){return new BPromise(function(_0x5e1033,_0x124ca8){return client[_0xff18('0xa')](_0x1f1990,_0x1a2acf)['then'](function(_0x2a0636){logger[_0xff18('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x2d7078,_0xff18('0xc'));logger['debug'](_0xff18('0xd'),_0x2d7078,_0xff18('0xc'),JSON['stringify'](_0x2a0636));if(_0x2a0636[_0xff18('0xe')]){if(_0x2a0636[_0xff18('0xe')][_0xff18('0xf')]===0x1f4){logger['error'](_0xff18('0x10'),_0x2d7078,_0x2a0636[_0xff18('0xe')][_0xff18('0x11')]);return _0x124ca8(_0x2a0636[_0xff18('0xe')][_0xff18('0x11')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2d7078,_0x2a0636[_0xff18('0xe')][_0xff18('0x11')]);return _0x5e1033(_0x2a0636[_0xff18('0xe')]['message']);}else{logger[_0xff18('0xb')](_0xff18('0x10'),_0x2d7078,'request\x20sent');_0x5e1033(_0x2a0636['result'][_0xff18('0x11')]);}})[_0xff18('0x12')](function(_0x4fed62){logger[_0xff18('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x2d7078,_0x4fed62);_0x124ca8(_0x4fed62);});});}exports[_0xff18('0x13')]=function(_0x5d18d8){var _0x2e0fc3=this;return new Promise(function(_0x296399,_0x3d0954){return db[_0xff18('0x14')]['update'](_0x5d18d8[_0xff18('0x15')],{'raw':_0x5d18d8[_0xff18('0x16')]?_0x5d18d8[_0xff18('0x16')][_0xff18('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d18d8['options']?_0x5d18d8['options'][_0xff18('0x18')]||null:null,'attributes':_0x5d18d8[_0xff18('0x16')]?_0x5d18d8[_0xff18('0x16')][_0xff18('0x19')]||null:null,'limit':_0x5d18d8['options']?_0x5d18d8[_0xff18('0x16')][_0xff18('0x1a')]||null:null})['then'](function(_0x438485){logger[_0xff18('0xb')](_0xff18('0x13'),_0x5d18d8);logger[_0xff18('0x1b')](_0xff18('0x13'),_0x5d18d8,JSON[_0xff18('0x1c')](_0x438485));_0x296399(_0x438485);})[_0xff18('0x12')](function(_0x12db79){logger[_0xff18('0xe')](_0xff18('0x13'),_0x12db79['message'],_0x5d18d8);_0x3d0954(_0x2e0fc3['error'](0x1f4,_0x12db79[_0xff18('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x74034f){var _0x1f23df=this;return new Promise(function(_0x17539d,_0x26d75e){var _0x1225e2=require(_0xff18('0x1d'));var _0x1deb1b;return db[_0xff18('0x1e')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x2e961b){_0x1deb1b=_0x2e961b;return db[_0xff18('0x14')][_0xff18('0x1f')](_0x74034f['body']);})[_0xff18('0x20')](function(_0x35d9b3){if(_0x1deb1b[_0xff18('0x21')]&&fs[_0xff18('0x22')](_0x35d9b3[_0xff18('0x23')])){var _0x203d7f=util[_0xff18('0x24')](_0xff18('0x25'),_0x35d9b3[_0xff18('0x23')]);return _0x1225e2[_0xff18('0x26')](_0x35d9b3['value'],_0x203d7f,config[_0xff18('0x27')][_0xff18('0x28')])[_0xff18('0x20')](function(){fs[_0xff18('0x29')](_0x35d9b3['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x35d9b3;});}return _0x35d9b3;})[_0xff18('0x20')](function(_0x58e1ba){logger[_0xff18('0xb')](_0xff18('0x2a'),_0x74034f);logger[_0xff18('0x1b')](_0xff18('0x2a'),_0x74034f,JSON[_0xff18('0x1c')](_0x58e1ba));_0x17539d(_0x58e1ba);})['catch'](function(_0x3c8f3c){logger[_0xff18('0xe')]('CreateVoiceRecording',_0x3c8f3c[_0xff18('0x11')],_0x74034f);_0x26d75e(_0x1f23df['error'](0x1f4,_0x3c8f3c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 512433c..2c4eb93 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 _0x934e=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x5c679c,_0x509eac){var _0x513d47=function(_0x1dbd21){while(--_0x1dbd21){_0x5c679c['push'](_0x5c679c['shift']());}};_0x513d47(++_0x509eac);}(_0x934e,0x1a4));var _0xe934=function(_0x3917ce,_0x3e7959){_0x3917ce=_0x3917ce-0x0;var _0x10dfaf=_0x934e[_0x3917ce];return _0x10dfaf;};'use strict';var multer=require(_0xe934('0x0'));var util=require('util');var path=require(_0xe934('0x1'));var timeout=require(_0xe934('0x2'));var express=require(_0xe934('0x3'));var router=express[_0xe934('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe934('0x5'));var config=require(_0xe934('0x6'));var controller=require(_0xe934('0x7'));router[_0xe934('0x8')]('/',auth[_0xe934('0x9')](),controller[_0xe934('0xa')]);router[_0xe934('0x8')](_0xe934('0xb'),auth['isAuthenticated'](),controller[_0xe934('0xc')]);router[_0xe934('0xd')]('/',auth[_0xe934('0x9')](),controller[_0xe934('0xe')]);router['put'](_0xe934('0xb'),auth[_0xe934('0x9')](),controller[_0xe934('0xf')]);router[_0xe934('0x10')](_0xe934('0xb'),auth[_0xe934('0x9')](),controller[_0xe934('0x11')]);module[_0xe934('0x12')]=router; \ No newline at end of file +var _0x6e26=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x4527d8,_0x59e349){var _0x1ec91d=function(_0x1ec598){while(--_0x1ec598){_0x4527d8['push'](_0x4527d8['shift']());}};_0x1ec91d(++_0x59e349);}(_0x6e26,0xee));var _0x66e2=function(_0x12b10a,_0x2592a0){_0x12b10a=_0x12b10a-0x0;var _0x5ed0e1=_0x6e26[_0x12b10a];return _0x5ed0e1;};'use strict';var multer=require(_0x66e2('0x0'));var util=require('util');var path=require(_0x66e2('0x1'));var timeout=require('connect-timeout');var express=require(_0x66e2('0x2'));var router=express[_0x66e2('0x3')]();var auth=require(_0x66e2('0x4'));var interaction=require(_0x66e2('0x5'));var config=require(_0x66e2('0x6'));var controller=require(_0x66e2('0x7'));router[_0x66e2('0x8')]('/',auth[_0x66e2('0x9')](),controller[_0x66e2('0xa')]);router[_0x66e2('0x8')](_0x66e2('0xb'),auth[_0x66e2('0x9')](),controller[_0x66e2('0xc')]);router[_0x66e2('0xd')]('/',auth[_0x66e2('0x9')](),controller[_0x66e2('0xe')]);router[_0x66e2('0xf')](_0x66e2('0xb'),auth[_0x66e2('0x9')](),controller['update']);router[_0x66e2('0x10')]('/:id',auth[_0x66e2('0x9')](),controller[_0x66e2('0x11')]);module[_0x66e2('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 44fbadf..6aed65b 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 _0x3e2b=['blind','attended','STRING','Yes','sequelize','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3e2b,0x9a));var _0xb3e2=function(_0x471c91,_0x32996f){_0x471c91=_0x471c91-0x0;var _0x482951=_0x3e2b[_0x471c91];return _0x482951;};'use strict';var Sequelize=require(_0xb3e2('0x0'));var moment=require(_0xb3e2('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xb3e2('0x2'),_0xb3e2('0x3'))},'result':{'type':Sequelize[_0xb3e2('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xb3e2('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xb3e2('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xb3e2('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xb3e2('0x4')]},'transferercontext':{'type':Sequelize[_0xb3e2('0x4')]},'transfererexten':{'type':Sequelize[_0xb3e2('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xb3e2('0x4')]},'transfereechannel':{'type':Sequelize[_0xb3e2('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xb3e2('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xb3e2('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xb3e2('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0xb3e2('0x5'),'No')},'context':{'type':Sequelize[_0xb3e2('0x4')]},'extension':{'type':Sequelize[_0xb3e2('0x4')]}}; \ No newline at end of file +var _0x7160=['attended','STRING','ENUM','Yes','sequelize','moment','blind'];(function(_0x50fd93,_0x874e31){var _0x90f115=function(_0x23ee54){while(--_0x23ee54){_0x50fd93['push'](_0x50fd93['shift']());}};_0x90f115(++_0x874e31);}(_0x7160,0x107));var _0x0716=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7160[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x0716('0x0'));var moment=require(_0x0716('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x0716('0x2'),_0x0716('0x3'))},'result':{'type':Sequelize[_0x0716('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x0716('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x0716('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x0716('0x4')]},'transferercontext':{'type':Sequelize[_0x0716('0x4')]},'transfererexten':{'type':Sequelize[_0x0716('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x0716('0x4')]},'transfereechannel':{'type':Sequelize[_0x0716('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x0716('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x0716('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0716('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x0716('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x0716('0x4')]},'transfereecontext':{'type':Sequelize[_0x0716('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x0716('0x4')]},'isexternal':{'type':Sequelize[_0x0716('0x5')](_0x0716('0x6'),'No')},'context':{'type':Sequelize[_0x0716('0x4')]},'extension':{'type':Sequelize[_0x0716('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c78e914..071b9ff 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 _0x537a=['count','offset','limit','set','Content-Range','save','destroy','then','end','sendStatus','error','stack','name','index','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','VoiceTransferReport','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','status','json'];(function(_0x2bcd42,_0x946248){var _0x34d7fd=function(_0x5e3413){while(--_0x5e3413){_0x2bcd42['push'](_0x2bcd42['shift']());}};_0x34d7fd(++_0x946248);}(_0x537a,0xf7));var _0xa537=function(_0x4c660e,_0xf9298a){_0x4c660e=_0x4c660e-0x0;var _0x10a16d=_0x537a[_0x4c660e];return _0x10a16d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa537('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa537('0x1'));var jsonpatch=require(_0xa537('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa537('0x3'));var Mustache=require(_0xa537('0x4'));var util=require(_0xa537('0x5'));var path=require(_0xa537('0x6'));var sox=require(_0xa537('0x7'));var csv=require(_0xa537('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa537('0x9'));var squel=require(_0xa537('0xa'));var crypto=require(_0xa537('0xb'));var jsforce=require(_0xa537('0xc'));var deskjs=require(_0xa537('0xd'));var toCsv=require(_0xa537('0x8'));var querystring=require('querystring');var Papa=require(_0xa537('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xa537('0xf'));var logger=require('../../config/logger')(_0xa537('0x10'));var utils=require(_0xa537('0x11'));var config=require('../../config/environment');var db=require(_0xa537('0x12'))['db'];function respondWithStatusCode(_0x15932f,_0x2aae2a){_0x2aae2a=_0x2aae2a||0xcc;return function(_0x29491d){if(_0x29491d){return _0x15932f['sendStatus'](_0x2aae2a);}return _0x15932f[_0xa537('0x13')](_0x2aae2a)['end']();};}function respondWithResult(_0x3c585e,_0x13f26f){_0x13f26f=_0x13f26f||0xc8;return function(_0x2464cb){if(_0x2464cb){return _0x3c585e[_0xa537('0x13')](_0x13f26f)[_0xa537('0x14')](_0x2464cb);}};}function respondWithFilteredResult(_0x498b09,_0x91bd37){return function(_0x43b677){if(_0x43b677){var _0x3f6396=_0x43b677[_0xa537('0x15')],_0x321b8e=_0x91bd37[_0xa537('0x16')],_0x3c399c=_0x91bd37[_0xa537('0x16')]+_0x91bd37[_0xa537('0x17')],_0x1796bf;if(_0x3c399c>=_0x3f6396){_0x3c399c=_0x3f6396;_0x1796bf=0xc8;}else{_0x1796bf=0xce;}_0x498b09[_0xa537('0x13')](_0x1796bf);return _0x498b09[_0xa537('0x18')](_0xa537('0x19'),_0x321b8e+'-'+_0x3c399c+'/'+_0x3f6396)[_0xa537('0x14')](_0x43b677);}return null;};}function patchUpdates(_0x51e608){return function(_0x3a6c1c){try{jsonpatch['apply'](_0x3a6c1c,_0x51e608,!![]);}catch(_0x2a9b6a){return BPromise['reject'](_0x2a9b6a);}return _0x3a6c1c[_0xa537('0x1a')]();};}function saveUpdates(_0x70c23d,_0x1c7697){return function(_0x278d02){if(_0x278d02){return _0x278d02['update'](_0x70c23d)['then'](function(_0x33555e){return _0x33555e;});}return null;};}function removeEntity(_0x5dba28,_0x156c16){return function(_0x3d6970){if(_0x3d6970){return _0x3d6970[_0xa537('0x1b')]()[_0xa537('0x1c')](function(){_0x5dba28['status'](0xcc)[_0xa537('0x1d')]();});}};}function handleEntityNotFound(_0xb6debc,_0x425584){return function(_0x341549){if(!_0x341549){_0xb6debc[_0xa537('0x1e')](0x194);}return _0x341549;};}function handleError(_0x330dbe,_0x4d682e){_0x4d682e=_0x4d682e||0x1f4;return function(_0x65afaf){logger[_0xa537('0x1f')](_0x65afaf[_0xa537('0x20')]);if(_0x65afaf[_0xa537('0x21')]){delete _0x65afaf['name'];}_0x330dbe['status'](_0x4d682e)['send'](_0x65afaf);};}exports[_0xa537('0x22')]=function(_0xfd1f49,_0x373c0b){var _0x3d1ea8={},_0x5c6054={},_0x3692c7={'count':0x0,'rows':[]};var _0x8601a6=db['VoiceTransferReport'][_0xa537('0x23')];_0x5c6054[_0xa537('0x24')]=_['keys'](_0x8601a6);_0x5c6054[_0xa537('0x25')]=_['keys'](_0xfd1f49['query']);_0x5c6054[_0xa537('0x26')]=_[_0xa537('0x27')](_0x5c6054['model'],_0x5c6054[_0xa537('0x25')]);_0x3d1ea8[_0xa537('0x28')]=_['intersection'](_0x5c6054['model'],qs[_0xa537('0x29')](_0xfd1f49[_0xa537('0x25')][_0xa537('0x29')]));_0x3d1ea8[_0xa537('0x28')]=_0x3d1ea8[_0xa537('0x28')][_0xa537('0x2a')]?_0x3d1ea8[_0xa537('0x28')]:_0x5c6054['model'];if(!_0xfd1f49[_0xa537('0x25')][_0xa537('0x2b')]('nolimit')){_0x3d1ea8['limit']=qs['limit'](_0xfd1f49[_0xa537('0x25')][_0xa537('0x17')]);_0x3d1ea8[_0xa537('0x16')]=qs[_0xa537('0x16')](_0xfd1f49['query']['offset']);}_0x3d1ea8['order']=qs[_0xa537('0x2c')](_0xfd1f49[_0xa537('0x25')][_0xa537('0x2c')]);_0x3d1ea8[_0xa537('0x2d')]=qs['filters'](_[_0xa537('0x2e')](_0xfd1f49[_0xa537('0x25')],_0x5c6054[_0xa537('0x26')]));if(_0xfd1f49[_0xa537('0x25')][_0xa537('0x2f')]){_0x3d1ea8[_0xa537('0x2d')]=_[_0xa537('0x30')](_0x3d1ea8[_0xa537('0x2d')],{'$or':_[_0xa537('0x31')](_0x8601a6,function(_0x14cc4b){if(_0x14cc4b[_0xa537('0x32')][_0xa537('0x33')]!==_0xa537('0x34')){var _0x1cc237={};_0x1cc237[_0x14cc4b[_0xa537('0x35')]]={'$like':'%'+_0xfd1f49['query']['filter']+'%'};return _0x1cc237;}})});}_0x3d1ea8=_[_0xa537('0x30')]({},_0x3d1ea8,_0xfd1f49[_0xa537('0x36')]);var _0x1c41fb={'where':_0x3d1ea8[_0xa537('0x2d')]};return db[_0xa537('0x37')]['count'](_0x1c41fb)[_0xa537('0x1c')](function(_0x2c2783){_0x3692c7['count']=_0x2c2783;if(_0xfd1f49[_0xa537('0x25')][_0xa537('0x38')]){_0x3d1ea8[_0xa537('0x39')]=[{'all':!![]}];}return db[_0xa537('0x37')][_0xa537('0x3a')](_0x3d1ea8);})[_0xa537('0x1c')](function(_0xd87c29){_0x3692c7['rows']=_0xd87c29;return _0x3692c7;})[_0xa537('0x1c')](respondWithFilteredResult(_0x373c0b,_0x3d1ea8))[_0xa537('0x3b')](handleError(_0x373c0b,null));};exports[_0xa537('0x3c')]=function(_0x2aa29b,_0x1fee5d){var _0x28fc55={'raw':!![],'where':{'id':_0x2aa29b[_0xa537('0x3d')]['id']}},_0x58e917={};_0x58e917['model']=_[_0xa537('0x3e')](db[_0xa537('0x37')][_0xa537('0x23')]);_0x58e917[_0xa537('0x25')]=_[_0xa537('0x3e')](_0x2aa29b[_0xa537('0x25')]);_0x58e917[_0xa537('0x26')]=_[_0xa537('0x27')](_0x58e917[_0xa537('0x24')],_0x58e917[_0xa537('0x25')]);_0x28fc55[_0xa537('0x28')]=_[_0xa537('0x27')](_0x58e917['model'],qs['fields'](_0x2aa29b['query']['fields']));_0x28fc55[_0xa537('0x28')]=_0x28fc55[_0xa537('0x28')][_0xa537('0x2a')]?_0x28fc55[_0xa537('0x28')]:_0x58e917[_0xa537('0x24')];if(_0x2aa29b[_0xa537('0x25')][_0xa537('0x38')]){_0x28fc55[_0xa537('0x39')]=[{'all':!![]}];}_0x28fc55=_[_0xa537('0x30')]({},_0x28fc55,_0x2aa29b[_0xa537('0x36')]);return db[_0xa537('0x37')][_0xa537('0x3f')](_0x28fc55)['then'](handleEntityNotFound(_0x1fee5d,null))['then'](respondWithResult(_0x1fee5d,null))[_0xa537('0x3b')](handleError(_0x1fee5d,null));};exports[_0xa537('0x40')]=function(_0x24a6b1,_0x23a8d1){return db['VoiceTransferReport'][_0xa537('0x40')](_0x24a6b1[_0xa537('0x41')],{})[_0xa537('0x1c')](respondWithResult(_0x23a8d1,0xc9))['catch'](handleError(_0x23a8d1,null));};exports[_0xa537('0x42')]=function(_0x325dc3,_0x148b29){if(_0x325dc3[_0xa537('0x41')]['id']){delete _0x325dc3['body']['id'];}return db[_0xa537('0x37')][_0xa537('0x3f')]({'where':{'id':_0x325dc3[_0xa537('0x3d')]['id']}})[_0xa537('0x1c')](handleEntityNotFound(_0x148b29,null))[_0xa537('0x1c')](saveUpdates(_0x325dc3[_0xa537('0x41')],null))[_0xa537('0x1c')](respondWithResult(_0x148b29,null))[_0xa537('0x3b')](handleError(_0x148b29,null));};exports[_0xa537('0x1b')]=function(_0x17bcb9,_0x2bfc20){return db[_0xa537('0x37')][_0xa537('0x3f')]({'where':{'id':_0x17bcb9[_0xa537('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2bfc20,null))[_0xa537('0x1c')](removeEntity(_0x2bfc20,null))['catch'](handleError(_0x2bfc20,null));}; \ No newline at end of file +var _0x8a78=['send','VoiceTransferReport','model','keys','query','filters','attributes','fields','hasOwnProperty','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','params','rawAttributes','intersection','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name'];(function(_0x37ee67,_0x63443c){var _0x178b52=function(_0x30fd49){while(--_0x30fd49){_0x37ee67['push'](_0x37ee67['shift']());}};_0x178b52(++_0x63443c);}(_0x8a78,0x1e7));var _0x88a7=function(_0x434903,_0x2bae84){_0x434903=_0x434903-0x0;var _0x31021e=_0x8a78[_0x434903];return _0x31021e;};'use strict';var pdf=require(_0x88a7('0x0'));var emlformat=require(_0x88a7('0x1'));var rimraf=require(_0x88a7('0x2'));var zipdir=require(_0x88a7('0x3'));var jsonpatch=require(_0x88a7('0x4'));var rp=require('request-promise');var moment=require(_0x88a7('0x5'));var BPromise=require(_0x88a7('0x6'));var Mustache=require(_0x88a7('0x7'));var util=require('util');var path=require(_0x88a7('0x8'));var sox=require('sox');var csv=require(_0x88a7('0x9'));var ejs=require(_0x88a7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x88a7('0xb'));var crypto=require(_0x88a7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x88a7('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x88a7('0xd'));var hardwareService=require(_0x88a7('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x88a7('0xf'))(_0x88a7('0x10'));var utils=require(_0x88a7('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x388ab5,_0x4d37df){_0x4d37df=_0x4d37df||0xcc;return function(_0x3bd6e4){if(_0x3bd6e4){return _0x388ab5['sendStatus'](_0x4d37df);}return _0x388ab5['status'](_0x4d37df)[_0x88a7('0x12')]();};}function respondWithResult(_0x52758a,_0x13c284){_0x13c284=_0x13c284||0xc8;return function(_0x32cc7b){if(_0x32cc7b){return _0x52758a[_0x88a7('0x13')](_0x13c284)[_0x88a7('0x14')](_0x32cc7b);}};}function respondWithFilteredResult(_0x883efb,_0x5b0c07){return function(_0xc53210){if(_0xc53210){var _0x4d33c3=_0xc53210['count'],_0xd3ed2d=_0x5b0c07[_0x88a7('0x15')],_0xb51f71=_0x5b0c07[_0x88a7('0x15')]+_0x5b0c07[_0x88a7('0x16')],_0x30cb4e;if(_0xb51f71>=_0x4d33c3){_0xb51f71=_0x4d33c3;_0x30cb4e=0xc8;}else{_0x30cb4e=0xce;}_0x883efb['status'](_0x30cb4e);return _0x883efb[_0x88a7('0x17')](_0x88a7('0x18'),_0xd3ed2d+'-'+_0xb51f71+'/'+_0x4d33c3)['json'](_0xc53210);}return null;};}function patchUpdates(_0x1bb394){return function(_0x538703){try{jsonpatch['apply'](_0x538703,_0x1bb394,!![]);}catch(_0x4b1486){return BPromise[_0x88a7('0x19')](_0x4b1486);}return _0x538703['save']();};}function saveUpdates(_0x3ecc1b,_0x1cb9b8){return function(_0x301cc4){if(_0x301cc4){return _0x301cc4[_0x88a7('0x1a')](_0x3ecc1b)[_0x88a7('0x1b')](function(_0x338b8a){return _0x338b8a;});}return null;};}function removeEntity(_0xb35612,_0x43f48d){return function(_0x1e53ee){if(_0x1e53ee){return _0x1e53ee[_0x88a7('0x1c')]()[_0x88a7('0x1b')](function(){_0xb35612[_0x88a7('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x419b57,_0xafed72){return function(_0x380e3e){if(!_0x380e3e){_0x419b57[_0x88a7('0x1d')](0x194);}return _0x380e3e;};}function handleError(_0x440000,_0x33e305){_0x33e305=_0x33e305||0x1f4;return function(_0x3b3dc8){logger[_0x88a7('0x1e')](_0x3b3dc8[_0x88a7('0x1f')]);if(_0x3b3dc8[_0x88a7('0x20')]){delete _0x3b3dc8[_0x88a7('0x20')];}_0x440000['status'](_0x33e305)[_0x88a7('0x21')](_0x3b3dc8);};}exports['index']=function(_0x5900d6,_0x6ae46b){var _0x2096bd={},_0x2a801b={},_0x31765f={'count':0x0,'rows':[]};var _0x3c389e=db[_0x88a7('0x22')]['rawAttributes'];_0x2a801b[_0x88a7('0x23')]=_[_0x88a7('0x24')](_0x3c389e);_0x2a801b[_0x88a7('0x25')]=_[_0x88a7('0x24')](_0x5900d6[_0x88a7('0x25')]);_0x2a801b[_0x88a7('0x26')]=_['intersection'](_0x2a801b[_0x88a7('0x23')],_0x2a801b[_0x88a7('0x25')]);_0x2096bd[_0x88a7('0x27')]=_['intersection'](_0x2a801b['model'],qs[_0x88a7('0x28')](_0x5900d6[_0x88a7('0x25')][_0x88a7('0x28')]));_0x2096bd[_0x88a7('0x27')]=_0x2096bd[_0x88a7('0x27')]['length']?_0x2096bd[_0x88a7('0x27')]:_0x2a801b['model'];if(!_0x5900d6[_0x88a7('0x25')][_0x88a7('0x29')]('nolimit')){_0x2096bd[_0x88a7('0x16')]=qs[_0x88a7('0x16')](_0x5900d6[_0x88a7('0x25')][_0x88a7('0x16')]);_0x2096bd['offset']=qs[_0x88a7('0x15')](_0x5900d6[_0x88a7('0x25')][_0x88a7('0x15')]);}_0x2096bd['order']=qs[_0x88a7('0x2a')](_0x5900d6[_0x88a7('0x25')][_0x88a7('0x2a')]);_0x2096bd[_0x88a7('0x2b')]=qs[_0x88a7('0x26')](_[_0x88a7('0x2c')](_0x5900d6[_0x88a7('0x25')],_0x2a801b[_0x88a7('0x26')]));if(_0x5900d6[_0x88a7('0x25')]['filter']){_0x2096bd[_0x88a7('0x2b')]=_[_0x88a7('0x2d')](_0x2096bd[_0x88a7('0x2b')],{'$or':_[_0x88a7('0x2e')](_0x3c389e,function(_0x440b48){if(_0x440b48[_0x88a7('0x2f')][_0x88a7('0x30')]!==_0x88a7('0x31')){var _0x16d37b={};_0x16d37b[_0x440b48['field']]={'$like':'%'+_0x5900d6['query'][_0x88a7('0x32')]+'%'};return _0x16d37b;}})});}_0x2096bd=_[_0x88a7('0x2d')]({},_0x2096bd,_0x5900d6[_0x88a7('0x33')]);var _0x2f5597={'where':_0x2096bd[_0x88a7('0x2b')]};return db[_0x88a7('0x22')][_0x88a7('0x34')](_0x2f5597)[_0x88a7('0x1b')](function(_0x1a2856){_0x31765f['count']=_0x1a2856;if(_0x5900d6[_0x88a7('0x25')][_0x88a7('0x35')]){_0x2096bd[_0x88a7('0x36')]=[{'all':!![]}];}return db[_0x88a7('0x22')]['findAll'](_0x2096bd);})['then'](function(_0x502415){_0x31765f[_0x88a7('0x37')]=_0x502415;return _0x31765f;})[_0x88a7('0x1b')](respondWithFilteredResult(_0x6ae46b,_0x2096bd))[_0x88a7('0x38')](handleError(_0x6ae46b,null));};exports[_0x88a7('0x39')]=function(_0x52599d,_0x30ffcd){var _0x40fdca={'raw':!![],'where':{'id':_0x52599d[_0x88a7('0x3a')]['id']}},_0x3d1ba9={};_0x3d1ba9[_0x88a7('0x23')]=_[_0x88a7('0x24')](db[_0x88a7('0x22')][_0x88a7('0x3b')]);_0x3d1ba9['query']=_[_0x88a7('0x24')](_0x52599d[_0x88a7('0x25')]);_0x3d1ba9[_0x88a7('0x26')]=_[_0x88a7('0x3c')](_0x3d1ba9[_0x88a7('0x23')],_0x3d1ba9[_0x88a7('0x25')]);_0x40fdca[_0x88a7('0x27')]=_['intersection'](_0x3d1ba9[_0x88a7('0x23')],qs[_0x88a7('0x28')](_0x52599d[_0x88a7('0x25')][_0x88a7('0x28')]));_0x40fdca[_0x88a7('0x27')]=_0x40fdca[_0x88a7('0x27')][_0x88a7('0x3d')]?_0x40fdca[_0x88a7('0x27')]:_0x3d1ba9[_0x88a7('0x23')];if(_0x52599d['query'][_0x88a7('0x35')]){_0x40fdca[_0x88a7('0x36')]=[{'all':!![]}];}_0x40fdca=_[_0x88a7('0x2d')]({},_0x40fdca,_0x52599d[_0x88a7('0x33')]);return db[_0x88a7('0x22')][_0x88a7('0x3e')](_0x40fdca)[_0x88a7('0x1b')](handleEntityNotFound(_0x30ffcd,null))[_0x88a7('0x1b')](respondWithResult(_0x30ffcd,null))[_0x88a7('0x38')](handleError(_0x30ffcd,null));};exports[_0x88a7('0x3f')]=function(_0x3ceecc,_0x3d7788){return db['VoiceTransferReport'][_0x88a7('0x3f')](_0x3ceecc['body'],{})[_0x88a7('0x1b')](respondWithResult(_0x3d7788,0xc9))[_0x88a7('0x38')](handleError(_0x3d7788,null));};exports['update']=function(_0x164a60,_0x67b9a7){if(_0x164a60[_0x88a7('0x40')]['id']){delete _0x164a60[_0x88a7('0x40')]['id'];}return db['VoiceTransferReport'][_0x88a7('0x3e')]({'where':{'id':_0x164a60[_0x88a7('0x3a')]['id']}})[_0x88a7('0x1b')](handleEntityNotFound(_0x67b9a7,null))[_0x88a7('0x1b')](saveUpdates(_0x164a60[_0x88a7('0x40')],null))[_0x88a7('0x1b')](respondWithResult(_0x67b9a7,null))['catch'](handleError(_0x67b9a7,null));};exports[_0x88a7('0x1c')]=function(_0x2a00ba,_0x34e5c8){return db[_0x88a7('0x22')]['find']({'where':{'id':_0x2a00ba[_0x88a7('0x3a')]['id']}})[_0x88a7('0x1b')](handleEntityNotFound(_0x34e5c8,null))[_0x88a7('0x1b')](removeEntity(_0x34e5c8,null))[_0x88a7('0x38')](handleError(_0x34e5c8,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index ee83544..a6d23aa 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 _0x762c=['VoiceTransferReport','report_call_transfer','../../config/logger','api','moment','./voiceTransferReport.attributes','exports','define'];(function(_0xf887c0,_0x444be9){var _0x7ad487=function(_0x1be345){while(--_0x1be345){_0xf887c0['push'](_0xf887c0['shift']());}};_0x7ad487(++_0x444be9);}(_0x762c,0x1f2));var _0xc762=function(_0x303b63,_0x321deb){_0x303b63=_0x303b63-0x0;var _0x33fdb5=_0x762c[_0x303b63];return _0x33fdb5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc762('0x0'))(_0xc762('0x1'));var moment=require(_0xc762('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xc762('0x3'));module[_0xc762('0x4')]=function(_0x2affa4,_0x2ed72e){return _0x2affa4[_0xc762('0x5')](_0xc762('0x6'),attributes,{'tableName':_0xc762('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb985=['moment','request-promise','define','VoiceTransferReport','lodash','util','../../config/logger','api'];(function(_0x4fe5b5,_0x41efab){var _0x221fbe=function(_0x35fd94){while(--_0x35fd94){_0x4fe5b5['push'](_0x4fe5b5['shift']());}};_0x221fbe(++_0x41efab);}(_0xb985,0x1bc));var _0x5b98=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0xb985[_0x376db5];return _0x304c17;};'use strict';var _=require(_0x5b98('0x0'));var util=require(_0x5b98('0x1'));var logger=require(_0x5b98('0x2'))(_0x5b98('0x3'));var moment=require(_0x5b98('0x4'));var BPromise=require('bluebird');var rp=require(_0x5b98('0x5'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x445d65,_0x2ac5cd){return _0x445d65[_0x5b98('0x6')](_0x5b98('0x7'),attributes,{'tableName':'report_call_transfer','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 4218a38..31dd160 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 _0x54c8=['result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x56ecb5,_0x27b6ae){var _0x3b0e5b=function(_0x32670d){while(--_0x32670d){_0x56ecb5['push'](_0x56ecb5['shift']());}};_0x3b0e5b(++_0x27b6ae);}(_0x54c8,0xb6));var _0x854c=function(_0x17db98,_0x12613f){_0x17db98=_0x17db98-0x0;var _0x5af064=_0x54c8[_0x17db98];return _0x5af064;};'use strict';var _=require(_0x854c('0x0'));var util=require(_0x854c('0x1'));var moment=require('moment');var BPromise=require(_0x854c('0x2'));var rs=require(_0x854c('0x3'));var fs=require('fs');var Redis=require(_0x854c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x854c('0x5'));var logger=require(_0x854c('0x6'))(_0x854c('0x7'));var config=require(_0x854c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x854c('0x9')][_0x854c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9daa75,_0x292368,_0x177d33){return new BPromise(function(_0xdfbc57,_0x45eda7){return client[_0x854c('0xb')](_0x9daa75,_0x177d33)[_0x854c('0xc')](function(_0x21d7d8){logger[_0x854c('0xd')](_0x854c('0xe'),_0x292368,_0x854c('0xf'));logger[_0x854c('0x10')](_0x854c('0x11'),_0x292368,_0x854c('0xf'),JSON['stringify'](_0x21d7d8));if(_0x21d7d8[_0x854c('0x12')]){if(_0x21d7d8[_0x854c('0x12')][_0x854c('0x13')]===0x1f4){logger[_0x854c('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x292368,_0x21d7d8[_0x854c('0x12')]['message']);return _0x45eda7(_0x21d7d8[_0x854c('0x12')][_0x854c('0x14')]);}logger[_0x854c('0x12')](_0x854c('0xe'),_0x292368,_0x21d7d8[_0x854c('0x12')][_0x854c('0x14')]);return _0xdfbc57(_0x21d7d8[_0x854c('0x12')]['message']);}else{logger[_0x854c('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x292368,_0x854c('0xf'));_0xdfbc57(_0x21d7d8[_0x854c('0x15')][_0x854c('0x14')]);}})[_0x854c('0x16')](function(_0x34d203){logger['error'](_0x854c('0xe'),_0x292368,_0x34d203);_0x45eda7(_0x34d203);});});}exports[_0x854c('0x17')]=function(_0x182f58){var _0x2d4df0=this;return new Promise(function(_0x26ab87,_0x56d364){return db[_0x854c('0x18')][_0x854c('0x19')](_0x182f58[_0x854c('0x1a')],{'raw':_0x182f58[_0x854c('0x1b')]?_0x182f58[_0x854c('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x854c('0xc')](function(_0x102477){logger[_0x854c('0xd')](_0x854c('0x17'),_0x182f58);logger[_0x854c('0x10')](_0x854c('0x17'),_0x182f58,JSON[_0x854c('0x1c')](_0x102477));_0x26ab87(_0x102477);})[_0x854c('0x16')](function(_0x4de2b9){logger['error'](_0x854c('0x17'),_0x4de2b9['message'],_0x182f58);_0x56d364(_0x2d4df0[_0x854c('0x12')](0x1f4,_0x4de2b9[_0x854c('0x14')]));});});}; \ No newline at end of file +var _0x3c72=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','catch','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent'];(function(_0x2b8ef1,_0x28380f){var _0x262f55=function(_0xe1280){while(--_0xe1280){_0x2b8ef1['push'](_0x2b8ef1['shift']());}};_0x262f55(++_0x28380f);}(_0x3c72,0xe0));var _0x23c7=function(_0x384436,_0x5f406f){_0x384436=_0x384436-0x0;var _0x459894=_0x3c72[_0x384436];return _0x459894;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x23c7('0x0'));var fs=require('fs');var Redis=require(_0x23c7('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x23c7('0x2'))(_0x23c7('0x3'));var config=require(_0x23c7('0x4'));var jayson=require(_0x23c7('0x5'));var client=jayson['client'][_0x23c7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c7417,_0x519237,_0xf483b9){return new BPromise(function(_0x2d1be3,_0x3e6e2a){return client[_0x23c7('0x7')](_0x1c7417,_0xf483b9)['then'](function(_0x508858){logger[_0x23c7('0x8')]('VoiceTransferReport,\x20%s,\x20%s',_0x519237,_0x23c7('0x9'));logger[_0x23c7('0xa')](_0x23c7('0xb'),_0x519237,_0x23c7('0x9'),JSON[_0x23c7('0xc')](_0x508858));if(_0x508858[_0x23c7('0xd')]){if(_0x508858['error'][_0x23c7('0xe')]===0x1f4){logger['error'](_0x23c7('0xf'),_0x519237,_0x508858['error'][_0x23c7('0x10')]);return _0x3e6e2a(_0x508858[_0x23c7('0xd')]['message']);}logger[_0x23c7('0xd')](_0x23c7('0xf'),_0x519237,_0x508858[_0x23c7('0xd')][_0x23c7('0x10')]);return _0x2d1be3(_0x508858[_0x23c7('0xd')][_0x23c7('0x10')]);}else{logger['info'](_0x23c7('0xf'),_0x519237,_0x23c7('0x9'));_0x2d1be3(_0x508858[_0x23c7('0x11')][_0x23c7('0x10')]);}})['catch'](function(_0x43570d){logger[_0x23c7('0xd')](_0x23c7('0xf'),_0x519237,_0x43570d);_0x3e6e2a(_0x43570d);});});}exports[_0x23c7('0x12')]=function(_0x1a0c49){var _0x2d73cc=this;return new Promise(function(_0x35a74d,_0x5847de){return db[_0x23c7('0x13')][_0x23c7('0x14')](_0x1a0c49[_0x23c7('0x15')],{'raw':_0x1a0c49[_0x23c7('0x16')]?_0x1a0c49[_0x23c7('0x16')][_0x23c7('0x17')]===undefined?!![]:![]:!![]})[_0x23c7('0x18')](function(_0x13b776){logger[_0x23c7('0x8')]('CreateVoiceTransferReport',_0x1a0c49);logger[_0x23c7('0xa')]('CreateVoiceTransferReport',_0x1a0c49,JSON[_0x23c7('0xc')](_0x13b776));_0x35a74d(_0x13b776);})[_0x23c7('0x19')](function(_0xeef3cd){logger[_0x23c7('0xd')](_0x23c7('0x12'),_0xeef3cd['message'],_0x1a0c49);_0x5847de(_0x2d73cc[_0x23c7('0xd')](0x1f4,_0xeef3cd['message']));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 341d650..9a77977 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4ad=['./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/schedule/chat','sequelize','then','start','info','Online\x20apps:','filter','online','join','map','None','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x22e9af,_0x202f89){var _0x4daad8=function(_0x458864){while(--_0x458864){_0x22e9af['push'](_0x22e9af['shift']());}};_0x4daad8(++_0x202f89);}(_0xd4ad,0x158));var _0xdd4a=function(_0x273f27,_0x2b094e){_0x273f27=_0x273f27-0x0;var _0x1cd257=_0xd4ad[_0x273f27];return _0x1cd257;};'use strict';var _=require(_0xdd4a('0x0'));var mysqldb=require(_0xdd4a('0x1'));var rpc=require(_0xdd4a('0x2'));var config=require(_0xdd4a('0x3'));var logger=require('./config/logger')(_0xdd4a('0x4'));var pm2=require(_0xdd4a('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0xdd4a('0x6'));function main(){return mysqldb['db'][_0xdd4a('0x7')]['sync']()[_0xdd4a('0x8')](function(){return rpc['listen']();})[_0xdd4a('0x8')](function(_0xb14ae6){logger['info'](_0xb14ae6);return chat[_0xdd4a('0x9')]();})['then'](function(){return schedule[_0xdd4a('0x9')]();})[_0xdd4a('0x8')](function(_0x42fa33){logger[_0xdd4a('0xa')](_0x42fa33);return pm2[_0xdd4a('0x9')](pm2Config);})[_0xdd4a('0x8')](function(_0x4de3d5){logger['info'](_0xdd4a('0xb'),_['map'](_[_0xdd4a('0xc')](_0x4de3d5,{'status':_0xdd4a('0xd')}),'name')[_0xdd4a('0xe')]());logger[_0xdd4a('0xa')]('Offline\x20apps:',_[_0xdd4a('0xf')](_['filter'](_0x4de3d5,function(_0x2a24de){return _0x2a24de['status']!==_0xdd4a('0xd');}),'name')['join']()||_0xdd4a('0x10'));config['seedDB']&&require('./config/seedDB')['default']();require(_0xdd4a('0x11'))[_0xdd4a('0x12')]();})[_0xdd4a('0x13')](function(_0x2bdd14){logger[_0xdd4a('0x14')](_0xdd4a('0x15'),_0x2bdd14);process[_0xdd4a('0x16')](0x1);});}main(); \ No newline at end of file +var _0x424d=['./config/pm2/config','./config/schedule','./config/schedule/chat','sync','listen','then','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','./config/license','default','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x2e1e7c,_0x251608){var _0xfde3db=function(_0x2f3f6c){while(--_0x2f3f6c){_0x2e1e7c['push'](_0x2e1e7c['shift']());}};_0xfde3db(++_0x251608);}(_0x424d,0x19d));var _0xd424=function(_0x31ed12,_0x2a38f9){_0x31ed12=_0x31ed12-0x0;var _0x1afd40=_0x424d[_0x31ed12];return _0x1afd40;};'use strict';var _=require(_0xd424('0x0'));var mysqldb=require(_0xd424('0x1'));var rpc=require(_0xd424('0x2'));var config=require(_0xd424('0x3'));var logger=require(_0xd424('0x4'))(_0xd424('0x5'));var pm2=require(_0xd424('0x6'));var pm2Config=require(_0xd424('0x7'));var schedule=require(_0xd424('0x8'));var chat=require(_0xd424('0x9'));function main(){return mysqldb['db']['sequelize'][_0xd424('0xa')]()['then'](function(){return rpc[_0xd424('0xb')]();})[_0xd424('0xc')](function(_0x39fdbd){logger[_0xd424('0xd')](_0x39fdbd);return chat[_0xd424('0xe')]();})[_0xd424('0xc')](function(){return schedule[_0xd424('0xe')]();})[_0xd424('0xc')](function(_0x506817){logger[_0xd424('0xd')](_0x506817);return pm2[_0xd424('0xe')](pm2Config);})['then'](function(_0x324107){logger[_0xd424('0xd')](_0xd424('0xf'),_[_0xd424('0x10')](_[_0xd424('0x11')](_0x324107,{'status':_0xd424('0x12')}),_0xd424('0x13'))[_0xd424('0x14')]());logger[_0xd424('0xd')](_0xd424('0x15'),_['map'](_[_0xd424('0x11')](_0x324107,function(_0x382490){return _0x382490[_0xd424('0x16')]!=='online';}),_0xd424('0x13'))[_0xd424('0x14')]()||_0xd424('0x17'));config[_0xd424('0x18')]&&require(_0xd424('0x19'))['default']();require(_0xd424('0x1a'))[_0xd424('0x1b')]();})['catch'](function(_0x57aa14){logger[_0xd424('0x1c')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x57aa14);process[_0xd424('0x1d')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index f2f04a8..5af8441 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 _0xd8e3=['isAuthenticated','../../config/license/util','Forbidden','canUpdate','sign','signToken','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','setTokenCookie','cookie','motion.token','motion.user','stringify','/dashboards/general','retrieveApiKey','isNil','generateApiKey','apiKeyIat','now','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','toString','../../mysqldb','../../config/environment','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','ipaddr.js','secrets','session','role','fullname','email','userpic','permissions','chatPause','openchannelPause','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','then','closed','status','unmanaged','disposition','Unmanaged.','startsWith','headers','authorization','Basic','find','name','pass','Wrong\x20credentials.','user','catch','Bearer','json','query','verify','apikey','getUuid','User','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xd8e3,0x164));var _0x3d8e=function(_0x579029,_0x50f822){_0x579029=_0x579029-0x0;var _0x4c2395=_0xd8e3[_0x579029];return _0x4c2395;};'use strict';var db=require(_0x3d8e('0x0'))['db'];var config=require(_0x3d8e('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0x3d8e('0x2'));var expressJwt=require(_0x3d8e('0x3'));var compose=require(_0x3d8e('0x4'));var basicAuth=require(_0x3d8e('0x5'));var crypto=require(_0x3d8e('0x6'));var ipaddr=require(_0x3d8e('0x7'));var validateJwt=expressJwt({'secret':config[_0x3d8e('0x8')][_0x3d8e('0x9')]});var userAttributes=['id',_0x3d8e('0xa'),_0x3d8e('0xb'),'name','internal',_0x3d8e('0xc'),_0x3d8e('0xd'),_0x3d8e('0xe'),'voicePause',_0x3d8e('0xf'),'mailPause','faxPause','smsPause',_0x3d8e('0x10'),'pauseType','showWebBar',_0x3d8e('0x11'),_0x3d8e('0x12'),_0x3d8e('0x13'),_0x3d8e('0x14')];exports[_0x3d8e('0x15')]=function(){return isAuthenticated(!![])[_0x3d8e('0x16')](function(_0xab9cc5,_0x5882a6,_0xaad803){if(_0xab9cc5['user']){_0xaad803();}else{return db[_0x3d8e('0x17')][_0x3d8e('0x18')]({'where':{'id':_0xab9cc5[_0x3d8e('0x19')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x3d8e('0x1a')](function(_0x547dce){if(_0x547dce&&_0x547dce[_0x3d8e('0x1b')]){return _0x5882a6[_0x3d8e('0x1c')](_0x547dce['disposition']===_0x3d8e('0x1d')?0x195:0x193)['json']({'message':_0x547dce[_0x3d8e('0x1e')]===_0x3d8e('0x1d')?_0x3d8e('0x1f'):'Forbidden.'});}else{_0xaad803();}})['catch'](function(_0x2d6fb4){_0xaad803(_0x2d6fb4);});}});};function isAuthenticated(_0x1dcc76){return compose()[_0x3d8e('0x16')](function(_0x5e3956,_0x30aea7,_0x16d539){if(_0x5e3956['headers']['authorization']){if(_[_0x3d8e('0x20')](_0x5e3956[_0x3d8e('0x21')][_0x3d8e('0x22')],_0x3d8e('0x23'))){var _0x12e2de=basicAuth(_0x5e3956);db['User'][_0x3d8e('0x24')]({'where':{'name':_0x12e2de[_0x3d8e('0x25')]}})[_0x3d8e('0x1a')](function(_0x4ae513){if(!_0x4ae513||!_0x4ae513['authenticate'](_0x12e2de[_0x3d8e('0x26')])){return _0x30aea7[_0x3d8e('0x1c')](0x191)['json']({'message':_0x3d8e('0x27')});}_0x5e3956[_0x3d8e('0x28')]={'id':_0x4ae513['id']};_0x16d539();})[_0x3d8e('0x29')](function(_0x3bb489){_0x16d539(_0x3bb489);});}else if(_[_0x3d8e('0x20')](_0x5e3956['headers']['authorization'],_0x3d8e('0x2a'))){validateJwt(_0x5e3956,_0x30aea7,_0x16d539);}else{if(_0x1dcc76){_0x16d539();}else{return _0x30aea7[_0x3d8e('0x1c')](0x193)[_0x3d8e('0x2b')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5e3956[_0x3d8e('0x2c')]['apikey']){try{var _0x33422f=jwt[_0x3d8e('0x2d')](_0x5e3956[_0x3d8e('0x2c')][_0x3d8e('0x2e')],config['secrets'][_0x3d8e('0x9')],{'audience':hardwareConf[_0x3d8e('0x2f')](),'issuer':hardwareConf[_0x3d8e('0x2f')]()});db[_0x3d8e('0x30')][_0x3d8e('0x24')]({'where':{'id':_0x33422f[_0x3d8e('0x31')]}})['then'](function(_0x118271){if(!_0x118271||!_[_0x3d8e('0x32')](_0x118271[_0x3d8e('0x33')],_0x33422f[_0x3d8e('0x34')])){return _0x30aea7[_0x3d8e('0x1c')](0x193)['json']({'message':_0x3d8e('0x35')});}_0x5e3956['user']={'id':_0x118271['id']};_0x16d539();})[_0x3d8e('0x29')](function(_0x214228){_0x16d539(_0x214228);});}catch(_0x3487e2){console[_0x3d8e('0x36')](_0x3487e2);return _0x30aea7[_0x3d8e('0x1c')](0x193)[_0x3d8e('0x2b')]({'message':_0x3d8e('0x37')});}}else if(_0x1dcc76){_0x16d539();}else{return _0x30aea7[_0x3d8e('0x1c')](0x193)[_0x3d8e('0x2b')]({'message':_0x3d8e('0x38')});}})[_0x3d8e('0x16')](function(_0x57628e,_0x4ef7bb,_0x3a7a74){if(_0x57628e['user']){db[_0x3d8e('0x30')][_0x3d8e('0x24')]({'where':{'id':_0x57628e['user']['id']},'attributes':userAttributes})[_0x3d8e('0x1a')](function(_0xcfd5d9){if(!_0xcfd5d9){return _0x4ef7bb[_0x3d8e('0x1c')](0x194)[_0x3d8e('0x2b')]({'message':_0x3d8e('0x39')});}_0x57628e['user']=_0xcfd5d9;_0x3a7a74();})[_0x3d8e('0x29')](function(_0x15ab5a){_0x3a7a74(_0x15ab5a);});}else if(_0x1dcc76){_0x3a7a74();}else{return _0x4ef7bb['status'](0x194)[_0x3d8e('0x2b')]({'message':_0x3d8e('0x3a')});}});}exports[_0x3d8e('0x3b')]=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x1ed570,_0x1c73dd,_0xa285a4){return require(_0x3d8e('0x3c'))['getLicense']()[_0x3d8e('0x1a')](function(_0x3c59cd){if(_0x3c59cd['update']){_0xa285a4();}else{return _0x1c73dd[_0x3d8e('0x1c')](0x193)[_0x3d8e('0x2b')]({'message':_0x3d8e('0x3d')});}})[_0x3d8e('0x29')](function(_0x3e1fea){_0xa285a4(_0x3e1fea);});});}exports[_0x3d8e('0x3e')]=canUpdate;function signToken(_0x577667,_0x129f68){return jwt[_0x3d8e('0x3f')]({'id':_0x577667,'role':_0x129f68},config[_0x3d8e('0x8')][_0x3d8e('0x9')],{'expiresIn':0x15180});}exports[_0x3d8e('0x40')]=signToken;exports['hasRole']=function(_0x27426d){if(!_0x27426d){throw new Error(_0x3d8e('0x41'));}return compose()[_0x3d8e('0x16')](isAuthenticated())[_0x3d8e('0x16')](function meetsRequirements(_0x523eee,_0x3e9a44,_0x5a2fcf){if(config[_0x3d8e('0x42')][_0x3d8e('0x43')](_0x523eee['user'][_0x3d8e('0xa')])>=config['userRoles']['indexOf'](_0x27426d)){return _0x5a2fcf();}else{return _0x3e9a44['status'](0x193)[_0x3d8e('0x2b')]({'message':_0x3d8e('0x3d')});}});};exports[_0x3d8e('0x44')]=function(_0x43d3f5,_0x13f4ea){if(!_0x43d3f5[_0x3d8e('0x28')]){return _0x13f4ea['status'](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x161446=signToken(_0x43d3f5['user']['id'],_0x43d3f5[_0x3d8e('0x28')][_0x3d8e('0xa')]);_0x13f4ea[_0x3d8e('0x45')](_0x3d8e('0x46'),_0x161446);_0x13f4ea[_0x3d8e('0x45')](_0x3d8e('0x47'),JSON[_0x3d8e('0x48')](_['pick'](_0x43d3f5[_0x3d8e('0x28')],userAttributes)));_0x13f4ea['redirect'](_0x3d8e('0x49'));};exports[_0x3d8e('0x4a')]=function(_0x2e1737){if(_[_0x3d8e('0x4b')](_0x2e1737[_0x3d8e('0x33')])||_[_0x3d8e('0x4b')](_0x2e1737['apiKeyIat']))return null;else return createJwt(_0x2e1737);};exports[_0x3d8e('0x4c')]=function(_0x2550c3){_0x2550c3['apiKeyNonce']=crypto['randomBytes'](0x10)['toString']('hex');_0x2550c3[_0x3d8e('0x4d')]=Math['floor'](Date[_0x3d8e('0x4e')]()/0x3e8)['toString']();return createJwt(_0x2550c3);};exports[_0x3d8e('0x4f')]=function(_0xdd3802,_0x5f1f15){if(_0xdd3802['query'][_0x3d8e('0x2e')]){jwt[_0x3d8e('0x2d')](_0xdd3802[_0x3d8e('0x2c')]['apikey'],config['secrets'][_0x3d8e('0x9')],{'nonce':_0x5f1f15[_0x3d8e('0x33')],'iat':_0x5f1f15['apiKeyIat'],'audience':hardwareConf[_0x3d8e('0x2f')](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x5f1f15);}else{throw{'message':_0x3d8e('0x50')};}};function createJwt(_0x43a4c4){return jwt['sign']({'iat':_0x43a4c4[_0x3d8e('0x4d')],'nonce':_0x43a4c4['apiKeyNonce']},config[_0x3d8e('0x8')][_0x3d8e('0x9')],{'algorithm':_0x3d8e('0x51'),'subject':_0x43a4c4['id'][_0x3d8e('0x52')](),'issuer':hardwareConf[_0x3d8e('0x2f')](),'audience':hardwareConf[_0x3d8e('0x2f')]()});} \ No newline at end of file +var _0x92f5=['role','fullname','name','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','use','ChatInteraction','findOne','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','startsWith','headers','authorization','Basic','find','pass','catch','Bearer','Unknown\x20authorization\x20format','query','verify','secrets','getUuid','User','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','user','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','sign','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','pick','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','toString','floor','now','regenerateApiKey','apikey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','ipaddr.js','session'];(function(_0x1a3bca,_0x34047c){var _0x3db2e6=function(_0x349795){while(--_0x349795){_0x1a3bca['push'](_0x1a3bca['shift']());}};_0x3db2e6(++_0x34047c);}(_0x92f5,0xf6));var _0x592f=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0x92f5[_0x2d9535];return _0xb4e710;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x592f('0x0'));var hardwareConf=require(_0x592f('0x1'));var _=require('lodash');var jwt=require(_0x592f('0x2'));var expressJwt=require(_0x592f('0x3'));var compose=require(_0x592f('0x4'));var basicAuth=require(_0x592f('0x5'));var crypto=require(_0x592f('0x6'));var ipaddr=require(_0x592f('0x7'));var validateJwt=expressJwt({'secret':config['secrets'][_0x592f('0x8')]});var userAttributes=['id',_0x592f('0x9'),_0x592f('0xa'),_0x592f('0xb'),'internal',_0x592f('0xc'),_0x592f('0xd'),_0x592f('0xe'),_0x592f('0xf'),_0x592f('0x10'),_0x592f('0x11'),_0x592f('0x12'),_0x592f('0x13'),'openchannelPause',_0x592f('0x14'),'showWebBar',_0x592f('0x15'),_0x592f('0x16'),_0x592f('0x17'),_0x592f('0x18')];exports['isChatInteractionAuthorized']=function(){return isAuthenticated(!![])[_0x592f('0x19')](function(_0x3cff2e,_0x2fca6a,_0x422074){if(_0x3cff2e['user']){_0x422074();}else{return db[_0x592f('0x1a')][_0x592f('0x1b')]({'where':{'id':_0x3cff2e['params']['id']},'attributes':['id',_0x592f('0x1c'),_0x592f('0x1d')],'raw':!![]})[_0x592f('0x1e')](function(_0x57d67f){if(_0x57d67f&&_0x57d67f[_0x592f('0x1c')]){return _0x2fca6a[_0x592f('0x1f')](_0x57d67f['disposition']===_0x592f('0x20')?0x195:0x193)[_0x592f('0x21')]({'message':_0x57d67f[_0x592f('0x1d')]===_0x592f('0x20')?_0x592f('0x22'):_0x592f('0x23')});}else{_0x422074();}})['catch'](function(_0x20ecf9){_0x422074(_0x20ecf9);});}});};function isAuthenticated(_0x15e3e4){return compose()[_0x592f('0x19')](function(_0x131375,_0x1b04c7,_0x558a4b){if(_0x131375['headers']['authorization']){if(_[_0x592f('0x24')](_0x131375[_0x592f('0x25')][_0x592f('0x26')],_0x592f('0x27'))){var _0x40fee4=basicAuth(_0x131375);db['User'][_0x592f('0x28')]({'where':{'name':_0x40fee4[_0x592f('0xb')]}})['then'](function(_0x36f912){if(!_0x36f912||!_0x36f912['authenticate'](_0x40fee4[_0x592f('0x29')])){return _0x1b04c7[_0x592f('0x1f')](0x191)[_0x592f('0x21')]({'message':'Wrong\x20credentials.'});}_0x131375['user']={'id':_0x36f912['id']};_0x558a4b();})[_0x592f('0x2a')](function(_0x546d18){_0x558a4b(_0x546d18);});}else if(_[_0x592f('0x24')](_0x131375[_0x592f('0x25')][_0x592f('0x26')],_0x592f('0x2b'))){validateJwt(_0x131375,_0x1b04c7,_0x558a4b);}else{if(_0x15e3e4){_0x558a4b();}else{return _0x1b04c7[_0x592f('0x1f')](0x193)[_0x592f('0x21')]({'message':_0x592f('0x2c')});}}}else if(_0x131375[_0x592f('0x2d')]['apikey']){try{var _0xbdaec9=jwt[_0x592f('0x2e')](_0x131375['query']['apikey'],config[_0x592f('0x2f')][_0x592f('0x8')],{'audience':hardwareConf[_0x592f('0x30')](),'issuer':hardwareConf[_0x592f('0x30')]()});db[_0x592f('0x31')]['find']({'where':{'id':_0xbdaec9['sub']}})[_0x592f('0x1e')](function(_0xc8a927){if(!_0xc8a927||!_[_0x592f('0x32')](_0xc8a927[_0x592f('0x33')],_0xbdaec9[_0x592f('0x34')])){return _0x1b04c7[_0x592f('0x1f')](0x193)[_0x592f('0x21')]({'message':_0x592f('0x35')});}_0x131375[_0x592f('0x36')]={'id':_0xc8a927['id']};_0x558a4b();})[_0x592f('0x2a')](function(_0x1c9784){_0x558a4b(_0x1c9784);});}catch(_0x52833e){console['log'](_0x52833e);return _0x1b04c7[_0x592f('0x1f')](0x193)[_0x592f('0x21')]({'message':_0x592f('0x37')});}}else if(_0x15e3e4){_0x558a4b();}else{return _0x1b04c7[_0x592f('0x1f')](0x193)[_0x592f('0x21')]({'message':_0x592f('0x2c')});}})['use'](function(_0x214852,_0x72f678,_0x36254c){if(_0x214852[_0x592f('0x36')]){db['User'][_0x592f('0x28')]({'where':{'id':_0x214852['user']['id']},'attributes':userAttributes})['then'](function(_0x173c39){if(!_0x173c39){return _0x72f678[_0x592f('0x1f')](0x194)['json']({'message':_0x592f('0x38')});}_0x214852[_0x592f('0x36')]=_0x173c39;_0x36254c();})[_0x592f('0x2a')](function(_0x16b26a){_0x36254c(_0x16b26a);});}else if(_0x15e3e4){_0x36254c();}else{return _0x72f678[_0x592f('0x1f')](0x194)[_0x592f('0x21')]({'message':_0x592f('0x39')});}});}exports[_0x592f('0x3a')]=isAuthenticated;function canUpdate(){return compose()[_0x592f('0x19')](function(_0x2af6d4,_0x5e7560,_0x4da56c){return require(_0x592f('0x3b'))[_0x592f('0x3c')]()[_0x592f('0x1e')](function(_0x468132){if(_0x468132[_0x592f('0x3d')]){_0x4da56c();}else{return _0x5e7560[_0x592f('0x1f')](0x193)['json']({'message':_0x592f('0x3e')});}})[_0x592f('0x2a')](function(_0x4fe62a){_0x4da56c(_0x4fe62a);});});}exports['canUpdate']=canUpdate;function signToken(_0x511fa8,_0x411cc6){return jwt[_0x592f('0x3f')]({'id':_0x511fa8,'role':_0x411cc6},config['secrets'][_0x592f('0x8')],{'expiresIn':0x15180});}exports['signToken']=signToken;exports['hasRole']=function(_0x20fe79){if(!_0x20fe79){throw new Error(_0x592f('0x40'));}return compose()[_0x592f('0x19')](isAuthenticated())[_0x592f('0x19')](function meetsRequirements(_0x7f70d,_0x5838d2,_0x2325a1){if(config[_0x592f('0x41')][_0x592f('0x42')](_0x7f70d['user'][_0x592f('0x9')])>=config['userRoles'][_0x592f('0x42')](_0x20fe79)){return _0x2325a1();}else{return _0x5838d2[_0x592f('0x1f')](0x193)['json']({'message':'Forbidden'});}});};exports[_0x592f('0x43')]=function(_0x5e4756,_0x158c47){if(!_0x5e4756[_0x592f('0x36')]){return _0x158c47[_0x592f('0x1f')](0x194)[_0x592f('0x21')]({'message':_0x592f('0x44')});}var _0x5c479d=signToken(_0x5e4756[_0x592f('0x36')]['id'],_0x5e4756[_0x592f('0x36')]['role']);_0x158c47[_0x592f('0x45')](_0x592f('0x46'),_0x5c479d);_0x158c47[_0x592f('0x45')](_0x592f('0x47'),JSON['stringify'](_[_0x592f('0x48')](_0x5e4756['user'],userAttributes)));_0x158c47['redirect'](_0x592f('0x49'));};exports[_0x592f('0x4a')]=function(_0x35c12b){if(_['isNil'](_0x35c12b[_0x592f('0x33')])||_[_0x592f('0x4b')](_0x35c12b[_0x592f('0x4c')]))return null;else return createJwt(_0x35c12b);};exports[_0x592f('0x4d')]=function(_0x1c11d4){_0x1c11d4[_0x592f('0x33')]=crypto['randomBytes'](0x10)[_0x592f('0x4e')]('hex');_0x1c11d4['apiKeyIat']=Math[_0x592f('0x4f')](Date[_0x592f('0x50')]()/0x3e8)['toString']();return createJwt(_0x1c11d4);};exports[_0x592f('0x51')]=function(_0x2abfff,_0x3c3270){if(_0x2abfff[_0x592f('0x2d')][_0x592f('0x52')]){jwt['verify'](_0x2abfff[_0x592f('0x2d')][_0x592f('0x52')],config[_0x592f('0x2f')][_0x592f('0x8')],{'nonce':_0x3c3270[_0x592f('0x33')],'iat':_0x3c3270['apiKeyIat'],'audience':hardwareConf[_0x592f('0x30')](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x3c3270);}else{throw{'message':_0x592f('0x53')};}};function createJwt(_0x4f47ca){return jwt[_0x592f('0x3f')]({'iat':_0x4f47ca[_0x592f('0x4c')],'nonce':_0x4f47ca[_0x592f('0x33')]},config[_0x592f('0x2f')][_0x592f('0x8')],{'algorithm':_0x592f('0x54'),'subject':_0x4f47ca['id'][_0x592f('0x4e')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x592f('0x30')]()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 7bcf9e6..891dd82 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 _0x1443=['crypto','bluebird','aes192','createReadStream','createWriteStream','algorithm','data','update','binary','write','end','final','close','unlink','decryptFile'];(function(_0x196b4d,_0x1f408f){var _0x59bb06=function(_0x362467){while(--_0x362467){_0x196b4d['push'](_0x196b4d['shift']());}};_0x59bb06(++_0x1f408f);}(_0x1443,0x10e));var _0x3144=function(_0x3cbdd7,_0x50036a){_0x3cbdd7=_0x3cbdd7-0x0;var _0x50f8d8=_0x1443[_0x3cbdd7];return _0x50f8d8;};'use strict';var crypto=require(_0x3144('0x0'));var fs=require('fs');var BPromise=require(_0x3144('0x1'));var defaultOptions={'algorithm':_0x3144('0x2')};function combineOptions(_0x117193){var _0x252407={};for(var _0x3176 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x3176)){_0x252407[_0x3176]=defaultOptions[_0x3176];}}if(_0x117193){for(var _0x3c795d in _0x117193){if(_0x117193['hasOwnProperty'](_0x3c795d)){_0x252407[_0x3c795d]=_0x117193[_0x3c795d];}}}return _0x252407;}exports['encryptFile']=function(_0x3575c7,_0x14f915,_0x48d8da,_0x2d5184){return new BPromise(function(_0xc69b17,_0x51bde8){_0x2d5184=combineOptions(_0x2d5184);var _0x3c576c=new Buffer(_0x48d8da);var _0x2192bd=fs[_0x3144('0x3')](_0x3575c7);var _0x57b52f=fs[_0x3144('0x4')](_0x14f915);var _0xb0f45b=crypto['createCipher'](_0x2d5184[_0x3144('0x5')],_0x3c576c);_0x2192bd['on'](_0x3144('0x6'),function(_0x423af8){var _0x48a39e=new Buffer(_0xb0f45b[_0x3144('0x7')](_0x423af8),_0x3144('0x8'));_0x57b52f[_0x3144('0x9')](_0x48a39e);});_0x2192bd['on'](_0x3144('0xa'),function(){try{var _0x306500=new Buffer(_0xb0f45b[_0x3144('0xb')](_0x3144('0x8')),_0x3144('0x8'));_0x57b52f[_0x3144('0x9')](_0x306500);_0x57b52f[_0x3144('0xa')]();_0x57b52f['on'](_0x3144('0xc'),function(){return _0xc69b17(_0x14f915);});}catch(_0xba0df0){fs[_0x3144('0xd')](_0x14f915);return _0x51bde8(_0xba0df0);}});});};exports[_0x3144('0xe')]=function(_0x35bd78,_0x280a27,_0x1c6ea5,_0xa2c3db){return new BPromise(function(_0x363731,_0x5e1f90){_0xa2c3db=combineOptions(_0xa2c3db);var _0x486569=new Buffer(_0x1c6ea5);var _0x21f81f=fs[_0x3144('0x3')](_0x35bd78);var _0x74b59e=fs['createWriteStream'](_0x280a27);var _0x54e890=crypto['createDecipher'](_0xa2c3db[_0x3144('0x5')],_0x486569);_0x21f81f['on'](_0x3144('0x6'),function(_0x30f140){var _0x16b97d=new Buffer(_0x54e890[_0x3144('0x7')](_0x30f140),_0x3144('0x8'));_0x74b59e[_0x3144('0x9')](_0x16b97d);});_0x21f81f['on']('end',function(){try{var _0x2593ec=new Buffer(_0x54e890['final']('binary'),_0x3144('0x8'));_0x74b59e[_0x3144('0x9')](_0x2593ec);_0x74b59e[_0x3144('0xa')]();_0x74b59e['on'](_0x3144('0xc'),function(){return _0x363731(_0x280a27);});}catch(_0x3521a3){fs[_0x3144('0xd')](_0x280a27);return _0x5e1f90(_0x3521a3);}});});}; \ No newline at end of file +var _0x9cb7=['createReadStream','createWriteStream','createCipher','algorithm','binary','write','end','final','close','unlink','decryptFile','createDecipher','update','crypto','bluebird','aes192','hasOwnProperty','encryptFile'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x9cb7,0x11b));var _0x79cb=function(_0x49d7e9,_0xd21145){_0x49d7e9=_0x49d7e9-0x0;var _0x1fce9f=_0x9cb7[_0x49d7e9];return _0x1fce9f;};'use strict';var crypto=require(_0x79cb('0x0'));var fs=require('fs');var BPromise=require(_0x79cb('0x1'));var defaultOptions={'algorithm':_0x79cb('0x2')};function combineOptions(_0x5a1221){var _0x5042d1={};for(var _0x4f144e in defaultOptions){if(defaultOptions[_0x79cb('0x3')](_0x4f144e)){_0x5042d1[_0x4f144e]=defaultOptions[_0x4f144e];}}if(_0x5a1221){for(var _0x545485 in _0x5a1221){if(_0x5a1221[_0x79cb('0x3')](_0x545485)){_0x5042d1[_0x545485]=_0x5a1221[_0x545485];}}}return _0x5042d1;}exports[_0x79cb('0x4')]=function(_0x3182cf,_0x30d6b8,_0x1a807e,_0x354d48){return new BPromise(function(_0x23e8e0,_0x4f47f7){_0x354d48=combineOptions(_0x354d48);var _0x5d42ec=new Buffer(_0x1a807e);var _0x25d511=fs[_0x79cb('0x5')](_0x3182cf);var _0x2cf3e3=fs[_0x79cb('0x6')](_0x30d6b8);var _0x463002=crypto[_0x79cb('0x7')](_0x354d48[_0x79cb('0x8')],_0x5d42ec);_0x25d511['on']('data',function(_0x13ca5e){var _0x46458f=new Buffer(_0x463002['update'](_0x13ca5e),_0x79cb('0x9'));_0x2cf3e3[_0x79cb('0xa')](_0x46458f);});_0x25d511['on'](_0x79cb('0xb'),function(){try{var _0x5893d9=new Buffer(_0x463002[_0x79cb('0xc')](_0x79cb('0x9')),_0x79cb('0x9'));_0x2cf3e3['write'](_0x5893d9);_0x2cf3e3['end']();_0x2cf3e3['on'](_0x79cb('0xd'),function(){return _0x23e8e0(_0x30d6b8);});}catch(_0x306816){fs[_0x79cb('0xe')](_0x30d6b8);return _0x4f47f7(_0x306816);}});});};exports[_0x79cb('0xf')]=function(_0x5eed82,_0x1a4019,_0x2494f2,_0x2abb98){return new BPromise(function(_0x21c758,_0xe543cd){_0x2abb98=combineOptions(_0x2abb98);var _0x7aabe=new Buffer(_0x2494f2);var _0x4abb64=fs[_0x79cb('0x5')](_0x5eed82);var _0x19b638=fs[_0x79cb('0x6')](_0x1a4019);var _0x4bd8a2=crypto[_0x79cb('0x10')](_0x2abb98[_0x79cb('0x8')],_0x7aabe);_0x4abb64['on']('data',function(_0x5211ad){var _0x5cc8ec=new Buffer(_0x4bd8a2[_0x79cb('0x11')](_0x5211ad),'binary');_0x19b638['write'](_0x5cc8ec);});_0x4abb64['on']('end',function(){try{var _0x3ef5bb=new Buffer(_0x4bd8a2[_0x79cb('0xc')](_0x79cb('0x9')),_0x79cb('0x9'));_0x19b638['write'](_0x3ef5bb);_0x19b638[_0x79cb('0xb')]();_0x19b638['on'](_0x79cb('0xd'),function(){return _0x21c758(_0x1a4019);});}catch(_0x327a34){fs[_0x79cb('0xe')](_0x1a4019);return _0xe543cd(_0x327a34);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index e2176b3..f316ec4 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 _0x1f14=['AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeCsv','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s.%s','csv','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','inspect','Failed','util','path','lodash','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename'];(function(_0x546f9f,_0xcce640){var _0x3513dd=function(_0x2e5c79){while(--_0x2e5c79){_0x546f9f['push'](_0x546f9f['shift']());}};_0x3513dd(++_0xcce640);}(_0x1f14,0x18a));var _0x41f1=function(_0x149e0f,_0x5b59bb){_0x149e0f=_0x149e0f-0x0;var _0x3b54d8=_0x1f14[_0x149e0f];return _0x3b54d8;};'use strict';var util=require(_0x41f1('0x0'));var path=require(_0x41f1('0x1'));var _=require(_0x41f1('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x41f1('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x41f1('0x4'));var db=require(_0x41f1('0x5'))['db'];var dbH=require(_0x41f1('0x5'))[_0x41f1('0x6')];var logger=require(_0x41f1('0x7'))(_0x41f1('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x41f1('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x18de64,_0x52d899){var _0x3e904e={'status':_0x18de64};var _0x2fab74={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x52d899){_0x3e904e[_0x41f1('0xa')]=_0x52d899;}return db[_0x41f1('0xb')][_0x41f1('0xc')](_0x3e904e,_0x2fab74);}function main(){var _0x5017ab=0x1388;var _0x504acc;logger[_0x41f1('0xd')](util['format'](_0x41f1('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x41f1('0xf')][_0x41f1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x41f1('0x11'),'splitSizeCsv']})[_0x41f1('0x12')](function(_0x4bdbde){if(_0x4bdbde){_0x504acc=_0x4bdbde;_0x5017ab=_0x504acc[_0x41f1('0x13')]||0x1388;}})[_0x41f1('0x12')](function(){return dbH[_0x41f1('0x14')][_0x41f1('0x15')](util[_0x41f1('0x16')](_0x41f1('0x17'),QUERY),{'type':dbH[_0x41f1('0x14')][_0x41f1('0x18')][_0x41f1('0x19')]});})['then'](function(_0x438c90){if(!_0x438c90[0x0][_0x41f1('0x1a')]){return analyticExtractedReport(_0x41f1('0x1b'));}var _0x53d351=[];var _0x2ea778=0x0;var _0x5d845c=!![];if(_0x438c90&&_0x438c90[_0x41f1('0x1c')]){var _0x32efb8=_0x438c90[0x0]['num']%(_0x2ea778+_0x5017ab);if(_0x504acc[_0x41f1('0x11')]){for(;_0x5d845c;_0x2ea778+=_0x5017ab,_0x32efb8=_0x438c90[0x0]['num']%(_0x2ea778+_0x5017ab)){if(_0x32efb8==0x0||_0x32efb8==_0x438c90[0x0][_0x41f1('0x1a')]){_0x5d845c=![];}_0x53d351[_0x41f1('0x1d')](dbH['sequelize']['query'](util['format'](_0x41f1('0x1e'),QUERY,_0x5017ab,_0x2ea778),{'type':dbH[_0x41f1('0x14')][_0x41f1('0x18')][_0x41f1('0x19')]}));}}else{_0x53d351['push'](dbH[_0x41f1('0x14')][_0x41f1('0x15')](QUERY,{'type':dbH['sequelize'][_0x41f1('0x18')]['SELECT']}));}}var _0x252228=path[_0x41f1('0x1f')](PATH);var _0x4d7e5b=path[_0x41f1('0x20')](PATH,'.csv');var _0x24c35c=_0x504acc[_0x41f1('0x11')]&&_0x53d351[_0x41f1('0x1c')]>0x1;var _0x45fc28=[];if(!fs[_0x41f1('0x21')](path[_0x41f1('0x22')](_0x252228,_0x4d7e5b))&&_0x24c35c){fs[_0x41f1('0x23')](path[_0x41f1('0x22')](_0x252228,_0x4d7e5b));}return BPromise[_0x41f1('0x24')](_0x53d351,function(_0x359410){_0x45fc28[_0x41f1('0x1d')](_0x359410);})[_0x41f1('0x12')](function(){for(var _0x32e741=0x0;_0x32e741<_0x45fc28[_0x41f1('0x1c')];_0x32e741+=0x1){var _0x2e8f37;var _0x25ae81=_0x45fc28[_0x32e741];if(_0x24c35c){_0x2e8f37=path['join'](_0x252228,_0x4d7e5b,util[_0x41f1('0x16')]('%s%d.%s',_0x4d7e5b,_0x32e741,'csv'));}else{_0x2e8f37=path[_0x41f1('0x22')](_0x252228,util[_0x41f1('0x16')](_0x41f1('0x25'),_0x4d7e5b,_0x41f1('0x26')));}fs[_0x41f1('0x27')](_0x2e8f37,csv(_0x25ae81));}})['then'](function(){if(_0x24c35c){zipdir(path[_0x41f1('0x22')](_0x252228,_0x4d7e5b),{'saveTo':path['join'](_0x252228,util['format']('%s.%s',_0x4d7e5b,'zip'))},function(_0x2d811d,_0x199516){});rimraf(path['join'](_0x252228,_0x4d7e5b),function(){});}})[_0x41f1('0x12')](function(){logger[_0x41f1('0xd')](util[_0x41f1('0x16')](_0x41f1('0x28'),EXTRACTED_REPORT_ID,_0x41f1('0x29')));return analyticExtractedReport('Completed',_0x24c35c?util[_0x41f1('0x16')]('%s.%s',_0x4d7e5b,_0x24c35c?'zip':_0x41f1('0x26')):null);});})[_0x41f1('0x2a')](function(_0x466c8e){logger[_0x41f1('0xd')](util[_0x41f1('0x16')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x41f1('0x29')),util[_0x41f1('0x2b')](_0x466c8e,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x41f1('0x2c'));});}main(); \ No newline at end of file +var _0xb981=['splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','.csv','join','mkdirSync','each','length','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','find','split'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xb981,0x120));var _0x1b98=function(_0x5d8c1b,_0x38c5cb){_0x5d8c1b=_0x5d8c1b-0x0;var _0x5d0692=_0xb981[_0x5d8c1b];return _0x5d0692;};'use strict';var util=require(_0x1b98('0x0'));var path=require(_0x1b98('0x1'));var _=require(_0x1b98('0x2'));var csv=require(_0x1b98('0x3'));var fs=require('fs');var BPromise=require(_0x1b98('0x4'));var zipdir=require(_0x1b98('0x5'));var rimraf=require(_0x1b98('0x6'));var db=require(_0x1b98('0x7'))['db'];var dbH=require('../../mysqldb')[_0x1b98('0x8')];var logger=require(_0x1b98('0x9'))(_0x1b98('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1b98('0xb')][0x3];var PATH=process[_0x1b98('0xb')][0x4];function analyticExtractedReport(_0x100bd0,_0x174b86){var _0x40b0c1={'status':_0x100bd0};var _0x2c2d02={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x174b86){_0x40b0c1[_0x1b98('0xc')]=_0x174b86;}return db[_0x1b98('0xd')]['update'](_0x40b0c1,_0x2c2d02);}function main(){var _0x2d736c=0x1388;var _0x18255e;logger[_0x1b98('0xe')](util[_0x1b98('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1b98('0x10')));return db[_0x1b98('0x11')][_0x1b98('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1b98('0x13'),_0x1b98('0x14')]})['then'](function(_0xb4b0a5){if(_0xb4b0a5){_0x18255e=_0xb4b0a5;_0x2d736c=_0x18255e['splitSizeCsv']||0x1388;}})[_0x1b98('0x15')](function(){return dbH['sequelize'][_0x1b98('0x16')](util[_0x1b98('0xf')](_0x1b98('0x17'),QUERY),{'type':dbH[_0x1b98('0x18')]['QueryTypes'][_0x1b98('0x19')]});})[_0x1b98('0x15')](function(_0x559648){if(!_0x559648[0x0][_0x1b98('0x1a')]){return analyticExtractedReport(_0x1b98('0x1b'));}var _0xf76cd5=[];var _0x11241f=0x0;var _0x3e4dea=!![];if(_0x559648&&_0x559648['length']){var _0x4fe7b2=_0x559648[0x0][_0x1b98('0x1a')]%(_0x11241f+_0x2d736c);if(_0x18255e[_0x1b98('0x13')]){for(;_0x3e4dea;_0x11241f+=_0x2d736c,_0x4fe7b2=_0x559648[0x0][_0x1b98('0x1a')]%(_0x11241f+_0x2d736c)){if(_0x4fe7b2==0x0||_0x4fe7b2==_0x559648[0x0][_0x1b98('0x1a')]){_0x3e4dea=![];}_0xf76cd5[_0x1b98('0x1c')](dbH[_0x1b98('0x18')][_0x1b98('0x16')](util[_0x1b98('0xf')](_0x1b98('0x1d'),QUERY,_0x2d736c,_0x11241f),{'type':dbH[_0x1b98('0x18')][_0x1b98('0x1e')][_0x1b98('0x19')]}));}}else{_0xf76cd5[_0x1b98('0x1c')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x1b98('0x18')][_0x1b98('0x1e')][_0x1b98('0x19')]}));}}var _0x6f7b09=path['dirname'](PATH);var _0x1983ce=path['basename'](PATH,_0x1b98('0x1f'));var _0x4c0260=_0x18255e[_0x1b98('0x13')]&&_0xf76cd5['length']>0x1;var _0x6f0fb6=[];if(!fs['existsSync'](path[_0x1b98('0x20')](_0x6f7b09,_0x1983ce))&&_0x4c0260){fs[_0x1b98('0x21')](path['join'](_0x6f7b09,_0x1983ce));}return BPromise[_0x1b98('0x22')](_0xf76cd5,function(_0x13e741){_0x6f0fb6[_0x1b98('0x1c')](_0x13e741);})['then'](function(){for(var _0x354be5=0x0;_0x354be5<_0x6f0fb6[_0x1b98('0x23')];_0x354be5+=0x1){var _0x2ed134;var _0x1478f8=_0x6f0fb6[_0x354be5];if(_0x4c0260){_0x2ed134=path[_0x1b98('0x20')](_0x6f7b09,_0x1983ce,util[_0x1b98('0xf')](_0x1b98('0x24'),_0x1983ce,_0x354be5,_0x1b98('0x25')));}else{_0x2ed134=path[_0x1b98('0x20')](_0x6f7b09,util[_0x1b98('0xf')](_0x1b98('0x26'),_0x1983ce,_0x1b98('0x25')));}fs[_0x1b98('0x27')](_0x2ed134,csv(_0x1478f8));}})[_0x1b98('0x15')](function(){if(_0x4c0260){zipdir(path[_0x1b98('0x20')](_0x6f7b09,_0x1983ce),{'saveTo':path[_0x1b98('0x20')](_0x6f7b09,util[_0x1b98('0xf')](_0x1b98('0x26'),_0x1983ce,_0x1b98('0x28')))},function(_0x56eb7c,_0x2291d5){});rimraf(path[_0x1b98('0x20')](_0x6f7b09,_0x1983ce),function(){});}})['then'](function(){logger[_0x1b98('0xe')](util[_0x1b98('0xf')](_0x1b98('0x29'),EXTRACTED_REPORT_ID,_0x1b98('0x10')));return analyticExtractedReport(_0x1b98('0x2a'),_0x4c0260?util[_0x1b98('0xf')](_0x1b98('0x26'),_0x1983ce,_0x4c0260?_0x1b98('0x28'):_0x1b98('0x25')):null);});})[_0x1b98('0x2b')](function(_0x3e6eb7){logger[_0x1b98('0xe')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1b98('0x10')),util['inspect'](_0x3e6eb7,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index eb02c62..feb1f26 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 _0x1717=['PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','util','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','push','num','Empty','dirname','basename','.pdf','Setting','find','splitSizePdf','then','length','split','sequelize','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','header','body','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','createWriteStream','finish','error','end','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip'];(function(_0x59e7e0,_0x3ec148){var _0x26b058=function(_0x212ee2){while(--_0x212ee2){_0x59e7e0['push'](_0x59e7e0['shift']());}};_0x26b058(++_0x3ec148);}(_0x1717,0xcf));var _0x7171=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x1717[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x7171('0x0'));var fs=require('fs');var BPromise=require(_0x7171('0x1'));var util=require(_0x7171('0x2'));var path=require('path');var moment=require(_0x7171('0x3'));var PdfPrinter=require(_0x7171('0x4'));var zipdir=require(_0x7171('0x5'));var rimraf=require(_0x7171('0x6'));var db=require(_0x7171('0x7'))['db'];var dbH=require(_0x7171('0x7'))[_0x7171('0x8')];var logger=require(_0x7171('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7171('0xa')][0x2]);var QUERY=process[_0x7171('0xa')][0x3];var PATH=process[_0x7171('0xa')][0x4];var NAME=process[_0x7171('0xa')][0x5];var FORMAT=_0x7171('0xb');var _extractedReport;function analyticExtractedReport(_0x58c74e,_0x350723){var _0x1ab91c={'status':_0x58c74e};var _0x44e18a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x350723){_0x1ab91c[_0x7171('0xc')]=_0x350723;}return db[_0x7171('0xd')][_0x7171('0xe')](_0x1ab91c,_0x44e18a);}function getHeader(_0x461deb){var _0xbd10f6=[];for(var _0x3dcd75 in _0x461deb){if(_0x461deb[_0x7171('0xf')](_0x3dcd75)){_0xbd10f6[_0x7171('0x10')]({'text':_0x3dcd75,'style':'tableHeader'});}}return _0xbd10f6;}function extractReport(_0x215891){var _0x32765f=0x1388;var _0xda7d62;if(!_0x215891[0x0][_0x7171('0x11')]){return analyticExtractedReport(_0x7171('0x12'));}var _0x35052a=[];var _0x5067f5=0x0;var _0x24ad8b=!![];var _0x4f6b0f=path[_0x7171('0x13')](PATH);var _0x5466b7=path[_0x7171('0x14')](PATH,_0x7171('0x15'));var _0x522504=![];var _0x410274=[];return db[_0x7171('0x16')][_0x7171('0x17')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7171('0x18')]})[_0x7171('0x19')](function(_0x2cd9a7){if(_0x2cd9a7){_0xda7d62=_0x2cd9a7;_0x32765f=_0xda7d62[_0x7171('0x18')]||0x3e8;}})[_0x7171('0x19')](function(){if(_0x215891&&_0x215891[_0x7171('0x1a')]){var _0x29ac5c=_0x215891[0x0][_0x7171('0x11')]%(_0x5067f5+_0x32765f);if(_0xda7d62[_0x7171('0x1b')]){for(;_0x24ad8b;_0x5067f5+=_0x32765f,_0x29ac5c=_0x215891[0x0]['num']%(_0x5067f5+_0x32765f)){if(_0x29ac5c==0x0||_0x29ac5c==_0x215891[0x0][_0x7171('0x11')]){_0x24ad8b=![];}_0x35052a[_0x7171('0x10')](dbH[_0x7171('0x1c')]['query'](util[_0x7171('0x1d')](_0x7171('0x1e'),QUERY,_0x32765f,_0x5067f5),{'type':dbH[_0x7171('0x1c')][_0x7171('0x1f')]['SELECT']}));}}else{_0x35052a[_0x7171('0x10')](dbH[_0x7171('0x1c')]['query'](QUERY,{'type':dbH[_0x7171('0x1c')][_0x7171('0x1f')][_0x7171('0x20')]}));}}_0x522504=_0xda7d62['split']&&_0x35052a[_0x7171('0x1a')]>0x1;if(!fs[_0x7171('0x21')](path[_0x7171('0x22')](_0x4f6b0f,_0x5466b7))&&_0x522504){fs[_0x7171('0x23')](path[_0x7171('0x22')](_0x4f6b0f,_0x5466b7));}return BPromise[_0x7171('0x24')](_0x35052a,function(_0x44a313){_0x410274['push'](_0x44a313);});})['then'](function(){return BPromise['each'](_0x35052a,function(_0x80ae84,_0x43e272){var _0x1e3244;var _0x23f4b3=util[_0x7171('0x1d')](_0x7171('0x25'),NAME,_extractedReport[_0x7171('0x26')],moment(_extractedReport[_0x7171('0x27')])[_0x7171('0x1d')](FORMAT),moment(_extractedReport[_0x7171('0x28')])['format'](FORMAT));var _0x5ad6a0={'pageSize':'A4','pageOrientation':_0x7171('0x29'),'content':[{'text':_0x23f4b3,'style':_0x7171('0x2a')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x47e53c={'headerRows':0x1,'body':[]};_0x47e53c[_0x7171('0x2b')]['push'](getHeader(_0x80ae84[0x0]));var _0x158afd;for(var _0x38fa11=0x0;_0x38fa11<_0x80ae84[_0x7171('0x1a')];_0x38fa11+=0x1){_0x158afd=[];for(var _0x136a67 in _0x80ae84[_0x38fa11]){if(_0x80ae84[_0x38fa11][_0x7171('0xf')](_0x136a67)){_0x158afd[_0x7171('0x10')](_0x80ae84[_0x38fa11][_0x136a67]?_['toString'](_0x80ae84[_0x38fa11][_0x136a67]):'');}}_0x47e53c[_0x7171('0x2b')][_0x7171('0x10')](_0x158afd);}_0x5ad6a0[_0x7171('0x2c')][_0x7171('0x10')]({'table':_0x47e53c});return new BPromise(function(_0x14d651,_0x39f823){var _0x23c723=new PdfPrinter({'Roboto':{'normal':__dirname+_0x7171('0x2d'),'bold':__dirname+_0x7171('0x2e'),'italics':__dirname+_0x7171('0x2f'),'bolditalics':__dirname+_0x7171('0x30')}});var _0x12c5d5=_0x23c723[_0x7171('0x31')](_0x5ad6a0);if(_0x522504){_0x1e3244=path[_0x7171('0x22')](_0x4f6b0f,_0x5466b7,util[_0x7171('0x1d')](_0x7171('0x32'),_0x5466b7,_0x43e272,_0x7171('0x33')));}else{_0x1e3244=path[_0x7171('0x22')](_0x4f6b0f,util[_0x7171('0x1d')]('%s.%s',_0x5466b7,_0x7171('0x33')));}var _0x25f17c=_0x12c5d5[_0x7171('0x34')](fs[_0x7171('0x35')](_0x1e3244));_0x25f17c['on'](_0x7171('0x36'),function(){_0x14d651();});_0x25f17c['on'](_0x7171('0x37'),function(_0x224813){console['log']('err',_0x224813);_0x39f823(_0x224813);});_0x12c5d5[_0x7171('0x38')]();});});})[_0x7171('0x19')](function(){if(_0x522504){return new BPromise(function(_0x20d95f,_0x5015b3){zipdir(path[_0x7171('0x22')](_0x4f6b0f,_0x5466b7),{'saveTo':path[_0x7171('0x22')](_0x4f6b0f,util[_0x7171('0x1d')](_0x7171('0x39'),_0x5466b7,'zip'))},function(_0x4dbef5){if(_0x4dbef5){_0x5015b3(_0x4dbef5);}else{_0x20d95f();}});});}})[_0x7171('0x19')](function(){if(_0x522504){rimraf(path[_0x7171('0x22')](_0x4f6b0f,_0x5466b7),function(){});}})[_0x7171('0x19')](function(){logger[_0x7171('0x3a')](util[_0x7171('0x1d')](_0x7171('0x3b'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x522504?util[_0x7171('0x1d')](_0x7171('0x39'),_0x5466b7,_0x522504?_0x7171('0x3c'):_0x7171('0x33')):null);});}function main(){logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7171('0x3d')));return db[_0x7171('0xd')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x7171('0x19')](function(_0x193f76){_extractedReport=_0x193f76;return dbH[_0x7171('0x1c')]['query'](util['format'](_0x7171('0x3e'),QUERY),{'type':dbH[_0x7171('0x1c')][_0x7171('0x1f')][_0x7171('0x20')]});})[_0x7171('0x19')](extractReport)[_0x7171('0x3f')](function(_0x28bbee){logger[_0x7171('0x3a')](util[_0x7171('0x1d')](_0x7171('0x40'),EXTRACTED_REPORT_ID,_0x7171('0x3d')),util[_0x7171('0x41')](_0x28bbee,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x7171('0x42'));});}main(); \ No newline at end of file +var _0x99aa=['sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','query','QueryTypes','SELECT','existsSync','join','each','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','black','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','pipe','finish','error','log','end','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','zip','info','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','PDF','inspect','lodash','bluebird','moment','pdfmake/src/printer','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','hasOwnProperty','push','tableHeader','num','Empty','dirname','basename','.pdf','find','splitSizePdf','then','length','split'];(function(_0x3191f8,_0x17d2db){var _0x462a75=function(_0x3133de){while(--_0x3133de){_0x3191f8['push'](_0x3191f8['shift']());}};_0x462a75(++_0x17d2db);}(_0x99aa,0x1d7));var _0xa99a=function(_0x3c400a,_0x557c21){_0x3c400a=_0x3c400a-0x0;var _0x3fb931=_0x99aa[_0x3c400a];return _0x3fb931;};'use strict';var _=require(_0xa99a('0x0'));var fs=require('fs');var BPromise=require(_0xa99a('0x1'));var util=require('util');var path=require('path');var moment=require(_0xa99a('0x2'));var PdfPrinter=require(_0xa99a('0x3'));var zipdir=require(_0xa99a('0x4'));var rimraf=require('rimraf');var db=require(_0xa99a('0x5'))['db'];var dbH=require(_0xa99a('0x5'))[_0xa99a('0x6')];var logger=require(_0xa99a('0x7'))(_0xa99a('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xa99a('0x9')][0x2]);var QUERY=process[_0xa99a('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xa99a('0x9')][0x5];var FORMAT=_0xa99a('0xa');var _extractedReport;function analyticExtractedReport(_0x541ec7,_0x25836e){var _0x369214={'status':_0x541ec7};var _0x2134c4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x25836e){_0x369214[_0xa99a('0xb')]=_0x25836e;}return db['AnalyticExtractedReport']['update'](_0x369214,_0x2134c4);}function getHeader(_0x453ab1){var _0x1a6bd0=[];for(var _0x318f36 in _0x453ab1){if(_0x453ab1[_0xa99a('0xc')](_0x318f36)){_0x1a6bd0[_0xa99a('0xd')]({'text':_0x318f36,'style':_0xa99a('0xe')});}}return _0x1a6bd0;}function extractReport(_0x3ae8ea){var _0x55de3f=0x1388;var _0x81c8a9;if(!_0x3ae8ea[0x0][_0xa99a('0xf')]){return analyticExtractedReport(_0xa99a('0x10'));}var _0x10eeff=[];var _0x4b6317=0x0;var _0xa5919b=!![];var _0x15d662=path[_0xa99a('0x11')](PATH);var _0x54ac29=path[_0xa99a('0x12')](PATH,_0xa99a('0x13'));var _0x31888b=![];var _0x1c21f6=[];return db['Setting'][_0xa99a('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xa99a('0x15')]})[_0xa99a('0x16')](function(_0x5daa60){if(_0x5daa60){_0x81c8a9=_0x5daa60;_0x55de3f=_0x81c8a9[_0xa99a('0x15')]||0x3e8;}})[_0xa99a('0x16')](function(){if(_0x3ae8ea&&_0x3ae8ea[_0xa99a('0x17')]){var _0x3a07d2=_0x3ae8ea[0x0][_0xa99a('0xf')]%(_0x4b6317+_0x55de3f);if(_0x81c8a9[_0xa99a('0x18')]){for(;_0xa5919b;_0x4b6317+=_0x55de3f,_0x3a07d2=_0x3ae8ea[0x0][_0xa99a('0xf')]%(_0x4b6317+_0x55de3f)){if(_0x3a07d2==0x0||_0x3a07d2==_0x3ae8ea[0x0][_0xa99a('0xf')]){_0xa5919b=![];}_0x10eeff['push'](dbH[_0xa99a('0x19')]['query'](util['format'](_0xa99a('0x1a'),QUERY,_0x55de3f,_0x4b6317),{'type':dbH[_0xa99a('0x19')]['QueryTypes']['SELECT']}));}}else{_0x10eeff[_0xa99a('0xd')](dbH['sequelize'][_0xa99a('0x1b')](QUERY,{'type':dbH[_0xa99a('0x19')][_0xa99a('0x1c')][_0xa99a('0x1d')]}));}}_0x31888b=_0x81c8a9[_0xa99a('0x18')]&&_0x10eeff['length']>0x1;if(!fs[_0xa99a('0x1e')](path[_0xa99a('0x1f')](_0x15d662,_0x54ac29))&&_0x31888b){fs['mkdirSync'](path[_0xa99a('0x1f')](_0x15d662,_0x54ac29));}return BPromise['each'](_0x10eeff,function(_0x333ca0){_0x1c21f6[_0xa99a('0xd')](_0x333ca0);});})[_0xa99a('0x16')](function(){return BPromise[_0xa99a('0x20')](_0x10eeff,function(_0x1e748e,_0x5ec6ae){var _0x37cf22;var _0x36fe98=util[_0xa99a('0x21')](_0xa99a('0x22'),NAME,_extractedReport[_0xa99a('0x23')],moment(_extractedReport[_0xa99a('0x24')])[_0xa99a('0x21')](FORMAT),moment(_extractedReport[_0xa99a('0x25')])[_0xa99a('0x21')](FORMAT));var _0x1d0aaa={'pageSize':'A4','pageOrientation':_0xa99a('0x26'),'content':[{'text':_0x36fe98,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa99a('0x27')}}};var _0x41f5b1={'headerRows':0x1,'body':[]};_0x41f5b1[_0xa99a('0x28')][_0xa99a('0xd')](getHeader(_0x1e748e[0x0]));var _0x3172a1;for(var _0x142e76=0x0;_0x142e76<_0x1e748e[_0xa99a('0x17')];_0x142e76+=0x1){_0x3172a1=[];for(var _0x33fe82 in _0x1e748e[_0x142e76]){if(_0x1e748e[_0x142e76][_0xa99a('0xc')](_0x33fe82)){_0x3172a1[_0xa99a('0xd')](_0x1e748e[_0x142e76][_0x33fe82]?_[_0xa99a('0x29')](_0x1e748e[_0x142e76][_0x33fe82]):'');}}_0x41f5b1[_0xa99a('0x28')][_0xa99a('0xd')](_0x3172a1);}_0x1d0aaa[_0xa99a('0x2a')][_0xa99a('0xd')]({'table':_0x41f5b1});return new BPromise(function(_0x976a9e,_0x42807d){var _0x34fffb=new PdfPrinter({'Roboto':{'normal':__dirname+_0xa99a('0x2b'),'bold':__dirname+'/fonts/Roboto-Medium.ttf','italics':__dirname+'/fonts/Roboto-Italic.ttf','bolditalics':__dirname+_0xa99a('0x2c')}});var _0x19f8fa=_0x34fffb[_0xa99a('0x2d')](_0x1d0aaa);if(_0x31888b){_0x37cf22=path['join'](_0x15d662,_0x54ac29,util['format']('%s%d.%s',_0x54ac29,_0x5ec6ae,'pdf'));}else{_0x37cf22=path[_0xa99a('0x1f')](_0x15d662,util[_0xa99a('0x21')]('%s.%s',_0x54ac29,_0xa99a('0x2e')));}var _0x4c204b=_0x19f8fa[_0xa99a('0x2f')](fs['createWriteStream'](_0x37cf22));_0x4c204b['on'](_0xa99a('0x30'),function(){_0x976a9e();});_0x4c204b['on'](_0xa99a('0x31'),function(_0x255de2){console[_0xa99a('0x32')]('err',_0x255de2);_0x42807d(_0x255de2);});_0x19f8fa[_0xa99a('0x33')]();});});})['then'](function(){if(_0x31888b){return new BPromise(function(_0x367b27,_0x17860a){zipdir(path[_0xa99a('0x1f')](_0x15d662,_0x54ac29),{'saveTo':path[_0xa99a('0x1f')](_0x15d662,util[_0xa99a('0x21')](_0xa99a('0x34'),_0x54ac29,'zip'))},function(_0x1bdaf8){if(_0x1bdaf8){_0x17860a(_0x1bdaf8);}else{_0x367b27();}});});}})[_0xa99a('0x16')](function(){if(_0x31888b){rimraf(path[_0xa99a('0x1f')](_0x15d662,_0x54ac29),function(){});}})[_0xa99a('0x16')](function(){logger['info'](util[_0xa99a('0x21')](_0xa99a('0x35'),EXTRACTED_REPORT_ID,_0xa99a('0x36')));return analyticExtractedReport('Completed',_0x31888b?util['format'](_0xa99a('0x34'),_0x54ac29,_0x31888b?_0xa99a('0x37'):'pdf'):null);});}function main(){logger[_0xa99a('0x38')](util[_0xa99a('0x21')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0xa99a('0x39')][_0xa99a('0x3a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa99a('0x16')](function(_0x16faca){_extractedReport=_0x16faca;return dbH[_0xa99a('0x19')][_0xa99a('0x1b')](util[_0xa99a('0x21')](_0xa99a('0x3b'),QUERY),{'type':dbH[_0xa99a('0x19')]['QueryTypes'][_0xa99a('0x1d')]});})['then'](extractReport)['catch'](function(_0x2606d4){logger[_0xa99a('0x38')](util[_0xa99a('0x21')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa99a('0x3c')),util[_0xa99a('0x3d')](_0x2606d4,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index f1ce5cd..cdaca91 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 _0xc6fd=['splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','push','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','each','xlsx','%s.%s','binary','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split'];(function(_0x45a9d1,_0x55db72){var _0x1c2b05=function(_0x2c6b20){while(--_0x2c6b20){_0x45a9d1['push'](_0x45a9d1['shift']());}};_0x1c2b05(++_0x55db72);}(_0xc6fd,0x11d));var _0xdc6f=function(_0x317652,_0x323b13){_0x317652=_0x317652-0x0;var _0x26a1e2=_0xc6fd[_0x317652];return _0x26a1e2;};'use strict';var util=require(_0xdc6f('0x0'));var path=require(_0xdc6f('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xdc6f('0x2'));var BPromise=require(_0xdc6f('0x3'));var zipdir=require(_0xdc6f('0x4'));var rimraf=require('rimraf');var db=require(_0xdc6f('0x5'))['db'];var dbH=require(_0xdc6f('0x5'))[_0xdc6f('0x6')];var logger=require(_0xdc6f('0x7'))(_0xdc6f('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xdc6f('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xdc6f('0x9')][0x4];function analyticExtractedReport(_0x194353,_0x10092c){var _0xc4369c={'status':_0x194353};var _0x3a177d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x10092c){_0xc4369c[_0xdc6f('0xa')]=_0x10092c;}return db['AnalyticExtractedReport']['update'](_0xc4369c,_0x3a177d);}function main(){var _0x42c792=0x1388;var _0x2a8749;logger['info'](util[_0xdc6f('0xb')](_0xdc6f('0xc'),EXTRACTED_REPORT_ID,_0xdc6f('0xd')));return db[_0xdc6f('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdc6f('0xf'),_0xdc6f('0x10')]})[_0xdc6f('0x11')](function(_0x3e6cdd){if(_0x3e6cdd){_0x2a8749=_0x3e6cdd;_0x42c792=_0x2a8749[_0xdc6f('0x10')]||0x1388;}})[_0xdc6f('0x11')](function(){return dbH[_0xdc6f('0x12')][_0xdc6f('0x13')](util[_0xdc6f('0xb')](_0xdc6f('0x14'),QUERY),{'type':dbH[_0xdc6f('0x12')][_0xdc6f('0x15')][_0xdc6f('0x16')]});})['then'](function(_0x307033){if(!_0x307033[0x0][_0xdc6f('0x17')]){return analyticExtractedReport('Empty');}var _0x299f26=[];var _0x244eea=0x0;var _0x26872d=!![];if(_0x2a8749['split']){if(_0x307033&&_0x307033['length']){var _0x535dfa=_0x307033[0x0]['num']%(_0x244eea+_0x42c792);for(;_0x26872d;_0x244eea+=_0x42c792,_0x535dfa=_0x307033[0x0][_0xdc6f('0x17')]%(_0x244eea+_0x42c792)){if(_0x535dfa==0x0||_0x535dfa==_0x307033[0x0][_0xdc6f('0x17')]){_0x26872d=![];}_0x299f26[_0xdc6f('0x18')](dbH[_0xdc6f('0x12')][_0xdc6f('0x13')](util[_0xdc6f('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x42c792,_0x244eea),{'type':dbH[_0xdc6f('0x12')][_0xdc6f('0x15')]['SELECT']}));}}}else{_0x299f26[_0xdc6f('0x18')](dbH['sequelize'][_0xdc6f('0x13')](QUERY,{'type':dbH[_0xdc6f('0x12')]['QueryTypes'][_0xdc6f('0x16')]}));}var _0x5e88f0=path[_0xdc6f('0x19')](PATH);var _0x5bf860=path[_0xdc6f('0x1a')](PATH,_0xdc6f('0x1b'));var _0x3fbd4e=_0x2a8749['split']&&_0x299f26[_0xdc6f('0x1c')]>0x1;var _0x1c0539=[];if(!fs[_0xdc6f('0x1d')](path[_0xdc6f('0x1e')](_0x5e88f0,_0x5bf860))&&_0x3fbd4e){fs[_0xdc6f('0x1f')](path[_0xdc6f('0x1e')](_0x5e88f0,_0x5bf860));}return BPromise[_0xdc6f('0x20')](_0x299f26,function(_0x1e440f){_0x1c0539[_0xdc6f('0x18')](_0x1e440f);})[_0xdc6f('0x11')](function(){for(var _0x2e49bc=0x0;_0x2e49bc<_0x1c0539[_0xdc6f('0x1c')];_0x2e49bc+=0x1){var _0x18c7b3;var _0x4bc0e6=_0x1c0539[_0x2e49bc];if(_0x3fbd4e){_0x18c7b3=path['join'](_0x5e88f0,_0x5bf860,util[_0xdc6f('0xb')]('%s%d.%s',_0x5bf860,_0x2e49bc,_0xdc6f('0x21')));}else{_0x18c7b3=path[_0xdc6f('0x1e')](_0x5e88f0,util['format'](_0xdc6f('0x22'),_0x5bf860,_0xdc6f('0x21')));}fs['writeFileSync'](_0x18c7b3,json2xls(_0x4bc0e6),_0xdc6f('0x23'));}})[_0xdc6f('0x11')](function(){if(_0x3fbd4e){zipdir(path[_0xdc6f('0x1e')](_0x5e88f0,_0x5bf860),{'saveTo':path[_0xdc6f('0x1e')](_0x5e88f0,util['format'](_0xdc6f('0x22'),_0x5bf860,_0xdc6f('0x24')))},function(_0x307566,_0x219874){});rimraf(path[_0xdc6f('0x1e')](_0x5e88f0,_0x5bf860),function(){});}})['then'](function(){logger[_0xdc6f('0x25')](util[_0xdc6f('0xb')](_0xdc6f('0x26'),EXTRACTED_REPORT_ID,_0xdc6f('0xd')));return analyticExtractedReport(_0xdc6f('0x27'),_0x3fbd4e?util[_0xdc6f('0xb')]('%s.%s',_0x5bf860,_0x3fbd4e?_0xdc6f('0x24'):_0xdc6f('0x21')):null);});})[_0xdc6f('0x28')](function(_0x4135c1){logger[_0xdc6f('0x25')](util[_0xdc6f('0xb')](_0xdc6f('0x29'),EXTRACTED_REPORT_ID,_0xdc6f('0xd')),util[_0xdc6f('0x2a')](_0x4135c1,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x05ec=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeXlsx','sequelize','query','format','QueryTypes','SELECT','num','length','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info'];(function(_0x457443,_0x140091){var _0x329ed9=function(_0x52fdd7){while(--_0x52fdd7){_0x457443['push'](_0x457443['shift']());}};_0x329ed9(++_0x140091);}(_0x05ec,0x1c0));var _0xc05e=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0x05ec[_0x24679e];return _0x291f21;};'use strict';var util=require(_0xc05e('0x0'));var path=require(_0xc05e('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xc05e('0x2'));var rimraf=require(_0xc05e('0x3'));var db=require(_0xc05e('0x4'))['db'];var dbH=require(_0xc05e('0x4'))[_0xc05e('0x5')];var logger=require('../../config/logger')(_0xc05e('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xc05e('0x7')][0x2]);var QUERY=process[_0xc05e('0x7')][0x3];var PATH=process[_0xc05e('0x7')][0x4];function analyticExtractedReport(_0x1af4b5,_0x59b425){var _0x1266e8={'status':_0x1af4b5};var _0x1149d0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x59b425){_0x1266e8[_0xc05e('0x8')]=_0x59b425;}return db[_0xc05e('0x9')][_0xc05e('0xa')](_0x1266e8,_0x1149d0);}function main(){var _0x50e1dc=0x1388;var _0x2e8cc8;logger[_0xc05e('0xb')](util['format'](_0xc05e('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xc05e('0xd')][_0xc05e('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc05e('0xf'),'splitSizeXlsx']})[_0xc05e('0x10')](function(_0x3ea345){if(_0x3ea345){_0x2e8cc8=_0x3ea345;_0x50e1dc=_0x2e8cc8[_0xc05e('0x11')]||0x1388;}})[_0xc05e('0x10')](function(){return dbH[_0xc05e('0x12')][_0xc05e('0x13')](util[_0xc05e('0x14')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xc05e('0x12')][_0xc05e('0x15')][_0xc05e('0x16')]});})['then'](function(_0x4a403a){if(!_0x4a403a[0x0][_0xc05e('0x17')]){return analyticExtractedReport('Empty');}var _0x42c3ed=[];var _0x1d5fe5=0x0;var _0x11c924=!![];if(_0x2e8cc8[_0xc05e('0xf')]){if(_0x4a403a&&_0x4a403a[_0xc05e('0x18')]){var _0x39ca58=_0x4a403a[0x0][_0xc05e('0x17')]%(_0x1d5fe5+_0x50e1dc);for(;_0x11c924;_0x1d5fe5+=_0x50e1dc,_0x39ca58=_0x4a403a[0x0]['num']%(_0x1d5fe5+_0x50e1dc)){if(_0x39ca58==0x0||_0x39ca58==_0x4a403a[0x0]['num']){_0x11c924=![];}_0x42c3ed['push'](dbH[_0xc05e('0x12')]['query'](util['format'](_0xc05e('0x19'),QUERY,_0x50e1dc,_0x1d5fe5),{'type':dbH['sequelize'][_0xc05e('0x15')][_0xc05e('0x16')]}));}}}else{_0x42c3ed[_0xc05e('0x1a')](dbH[_0xc05e('0x12')][_0xc05e('0x13')](QUERY,{'type':dbH[_0xc05e('0x12')][_0xc05e('0x15')][_0xc05e('0x16')]}));}var _0x477c3e=path[_0xc05e('0x1b')](PATH);var _0x2d769f=path[_0xc05e('0x1c')](PATH,_0xc05e('0x1d'));var _0x43bbe=_0x2e8cc8[_0xc05e('0xf')]&&_0x42c3ed[_0xc05e('0x18')]>0x1;var _0x2d9f7e=[];if(!fs['existsSync'](path['join'](_0x477c3e,_0x2d769f))&&_0x43bbe){fs[_0xc05e('0x1e')](path[_0xc05e('0x1f')](_0x477c3e,_0x2d769f));}return BPromise[_0xc05e('0x20')](_0x42c3ed,function(_0x198508){_0x2d9f7e[_0xc05e('0x1a')](_0x198508);})[_0xc05e('0x10')](function(){for(var _0xdfd964=0x0;_0xdfd964<_0x2d9f7e[_0xc05e('0x18')];_0xdfd964+=0x1){var _0x2d49df;var _0x427051=_0x2d9f7e[_0xdfd964];if(_0x43bbe){_0x2d49df=path[_0xc05e('0x1f')](_0x477c3e,_0x2d769f,util[_0xc05e('0x14')](_0xc05e('0x21'),_0x2d769f,_0xdfd964,_0xc05e('0x22')));}else{_0x2d49df=path[_0xc05e('0x1f')](_0x477c3e,util[_0xc05e('0x14')](_0xc05e('0x23'),_0x2d769f,_0xc05e('0x22')));}fs[_0xc05e('0x24')](_0x2d49df,json2xls(_0x427051),_0xc05e('0x25'));}})[_0xc05e('0x10')](function(){if(_0x43bbe){zipdir(path[_0xc05e('0x1f')](_0x477c3e,_0x2d769f),{'saveTo':path[_0xc05e('0x1f')](_0x477c3e,util[_0xc05e('0x14')](_0xc05e('0x23'),_0x2d769f,_0xc05e('0x26')))},function(_0x39e3b4,_0x4cc522){});rimraf(path[_0xc05e('0x1f')](_0x477c3e,_0x2d769f),function(){});}})[_0xc05e('0x10')](function(){logger[_0xc05e('0xb')](util[_0xc05e('0x14')](_0xc05e('0x27'),EXTRACTED_REPORT_ID,_0xc05e('0x28')));return analyticExtractedReport(_0xc05e('0x29'),_0x43bbe?util['format'](_0xc05e('0x23'),_0x2d769f,_0x43bbe?'zip':_0xc05e('0x22')):null);});})[_0xc05e('0x2a')](function(_0x2ae8a2){logger['info'](util[_0xc05e('0x14')](_0xc05e('0x2b'),EXTRACTED_REPORT_ID,_0xc05e('0x28')),util[_0xc05e('0x2c')](_0x2ae8a2,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xc05e('0x2d'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 1644420..179f6c1 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 _0xac63=['exten','filter','groupBy','queue','playback','hasOwnProperty','find','extensions','Set','format','type','context','priority','outbound','push','extension','cutdigits','${EXTEN:','CDR(routeid)=','VoiceExtensionId','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','models','Interval','findAll','then','intervals','VoiceExtension','map'];(function(_0x5d41de,_0x10afb3){var _0x2345b1=function(_0xd9be55){while(--_0xd9be55){_0x5d41de['push'](_0x5d41de['shift']());}};_0x2345b1(++_0x10afb3);}(_0xac63,0x19d));var _0x3ac6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xac63[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x129180,_0x26d0c0){var _0x354ee9=this;return _0x129180[_0x3ac6('0x0')][_0x3ac6('0x1')][_0x3ac6('0x2')]({'raw':!![]})[_0x3ac6('0x3')](function(_0x3227b5){_0x354ee9[_0x3ac6('0x4')]=_0x3227b5;return _0x129180[_0x3ac6('0x0')][_0x3ac6('0x5')][_0x3ac6('0x2')]({'where':{'IntervalId':_0x26d0c0['IntervalId']},'raw':!![]});})[_0x3ac6('0x3')](function(_0x4e0933){return _0x129180[_0x3ac6('0x0')][_0x3ac6('0x5')][_0x3ac6('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0x3ac6('0x6')](_0x4e0933,_0x3ac6('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x3ac6('0x3')](function(_0x30cc53){var _0x5c0d3b=_[_0x3ac6('0x8')](_0x30cc53,{'priority':'1'});var _0x2858d7=_[_0x3ac6('0x8')](_0x30cc53,{'isApp':0x1});var _0x2ec73f=_[_0x3ac6('0x9')](_0x2858d7,_0x3ac6('0x7'));var _0x1f0783=[_0x3ac6('0xa'),_0x3ac6('0xb')];var _0x426e0b=[];var _0x140f64=[];for(var _0x1e0c32 in _0x2ec73f){if(_0x2ec73f[_0x3ac6('0xc')](_0x1e0c32)){_0x354ee9['priority']=0x2;_0x354ee9['extensions']=[];_0x354ee9['extension']=_[_0x3ac6('0xd')](_0x5c0d3b,{'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')]});_0x354ee9[_0x3ac6('0xe')]['push']({'type':_0x2ec73f[_0x1e0c32][0x0]['type'],'app':_0x3ac6('0xf'),'appdata':util[_0x3ac6('0x10')]('CDR(type)=%s',_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x11')]),'context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')],'priority':_0x354ee9[_0x3ac6('0x13')]++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0]['VoiceExtensionId']});if(_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x11')]===_0x3ac6('0x14')){if(_0x354ee9['extension']){_0x354ee9[_0x3ac6('0xe')][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0]['type'],'app':_0x3ac6('0xf'),'appdata':'CDR(destination)='+(_0x354ee9[_0x3ac6('0x16')][_0x3ac6('0x17')]?_0x3ac6('0x18')+_0x354ee9['extension']['cutdigits']+'}':'${EXTEN}'),'context':_0x2ec73f[_0x1e0c32][0x0]['context'],'exten':_0x2ec73f[_0x1e0c32][0x0]['exten'],'priority':_0x354ee9[_0x3ac6('0x13')]++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0]['VoiceExtensionId']});}_0x354ee9[_0x3ac6('0xe')]['push']({'type':_0x2ec73f[_0x1e0c32][0x0]['type'],'app':_0x3ac6('0xf'),'appdata':_0x3ac6('0x19')+_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')],'context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')],'priority':_0x354ee9['priority']++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0]['VoiceExtensionId']});var _0x328685=_0x354ee9[_0x3ac6('0x13')]++;_0x354ee9[_0x3ac6('0xe')][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x11')],'app':_0x3ac6('0x1b'),'appdata':_0x3ac6('0x1c')+(_0x328685+0x2)+_0x3ac6('0x1d')+(_0x328685+0x1)+')','context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')],'priority':_0x328685,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0]['VoiceExtensionId']});if(_0x354ee9['extension']){_0x354ee9[_0x3ac6('0xe')][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0]['type'],'app':_0x3ac6('0xf'),'appdata':_0x354ee9[_0x3ac6('0x16')][_0x3ac6('0x17')]?_0x3ac6('0x1e')+_0x354ee9[_0x3ac6('0x16')][_0x3ac6('0x17')]+'}':_0x3ac6('0x1f'),'context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0]['exten'],'priority':_0x354ee9['priority']++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')]});}_0x354ee9[_0x3ac6('0xe')][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0]['type'],'app':_0x3ac6('0xf'),'appdata':_0x3ac6('0x20')+_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')],'context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')],'priority':_0x354ee9[_0x3ac6('0x13')]++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0]['VoiceExtensionId']});if(_0x354ee9['extension']&&_0x354ee9['extension'][_0x3ac6('0xc')](_0x3ac6('0x21'))&&_0x354ee9[_0x3ac6('0x16')][_0x3ac6('0x21')]!=='none'){_0x354ee9[_0x3ac6('0xe')][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0]['type'],'app':_0x3ac6('0xf'),'appdata':_0x3ac6('0x22'),'context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0]['exten'],'priority':_0x354ee9[_0x3ac6('0x13')]++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')]});_0x354ee9[_0x3ac6('0xe')][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x11')],'app':_0x3ac6('0xf'),'appdata':_0x3ac6('0x23')+_0x354ee9[_0x3ac6('0x16')]['recordingFormat']||_0x3ac6('0x24'),'context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')],'priority':_0x354ee9[_0x3ac6('0x13')]++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')]});}}_0x354ee9[_0x3ac6('0xe')]['push']({'type':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x11')],'app':'Set','appdata':_0x3ac6('0x25'),'context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0]['exten'],'priority':_0x354ee9[_0x3ac6('0x13')]++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')]});_0x354ee9['extensions'][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x11')],'app':_0x3ac6('0xf'),'appdata':_0x3ac6('0x26'),'context':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x12')],'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')],'priority':_0x354ee9[_0x3ac6('0x13')]++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')]});_0x354ee9[_0x3ac6('0xe')][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x11')],'app':_0x3ac6('0xf'),'appdata':_0x3ac6('0x27'),'context':_0x2ec73f[_0x1e0c32][0x0]['context'],'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')],'priority':_0x354ee9['priority']++,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')]});for(var _0x18230d=0x0,_0xb2ea38=0x0;_0x18230d<_0x2ec73f[_0x1e0c32][_0x3ac6('0x28')];_0x18230d+=0x1,_0xb2ea38=0x0){var _0x1b6cca=_0x2ec73f[_0x1e0c32][_0x18230d];if(_0x1b6cca[_0x3ac6('0x11')]){_0x1b6cca['type']=_0x1b6cca[_0x3ac6('0x11')][_0x3ac6('0x29')]();}var _0x1ffd62=[];var _0x4202cf=[];delete _0x1b6cca['id'];delete _0x1b6cca[_0x3ac6('0x2a')];delete _0x1b6cca[_0x3ac6('0x2b')];var _0x3fd955=_0x1b6cca[_0x3ac6('0x2c')]!==_0x3ac6('0x2d')?[_0x1b6cca['interval']]:_0x1b6cca[_0x3ac6('0x2e')]?_['map'](_['filter'](_0x354ee9[_0x3ac6('0x4')],{'IntervalId':_0x1b6cca[_0x3ac6('0x2e')]}),'interval'):[];if(_0x1b6cca[_0x3ac6('0xc')](_0x3ac6('0x2f'))){if(_0x1b6cca[_0x3ac6('0x2f')]&&_0x1b6cca[_0x3ac6('0x2f')]!=='--'){_0x1ffd62['push']({'type':_0x1b6cca[_0x3ac6('0x11')],'app':_0x3ac6('0xf'),'appdata':_0x3ac6('0x30')+_0x1b6cca[_0x3ac6('0x2f')],'context':_0x1b6cca[_0x3ac6('0x12')],'exten':_0x1b6cca[_0x3ac6('0x7')],'priority':_0x3fd955[_0x3ac6('0x28')]+_0x354ee9['priority']+_0xb2ea38++,'VoiceExtensionId':_0x1b6cca[_0x3ac6('0x1a')]});}}if(_0x1b6cca[_0x3ac6('0x11')]==='outbound'&&_0x1b6cca[_0x3ac6('0xc')]('callerID')){if(_0x1b6cca[_0x3ac6('0x31')]){_0x1ffd62[_0x3ac6('0x15')]({'type':_0x1b6cca[_0x3ac6('0x11')],'app':_0x3ac6('0x1b'),'appdata':_0x3ac6('0x32')+_0x1b6cca['callerID']+')','context':_0x1b6cca['context'],'exten':_0x1b6cca[_0x3ac6('0x7')],'priority':_0x3fd955[_0x3ac6('0x28')]+_0x354ee9[_0x3ac6('0x13')]+_0xb2ea38++,'VoiceExtensionId':_0x1b6cca[_0x3ac6('0x1a')]});}else{_0x1ffd62['push']({'type':_0x1b6cca['type'],'app':'ExecIf','appdata':_0x3ac6('0x33'),'context':_0x1b6cca['context'],'exten':_0x1b6cca['exten'],'priority':_0x3fd955[_0x3ac6('0x28')]+_0x354ee9[_0x3ac6('0x13')]+_0xb2ea38++,'VoiceExtensionId':_0x1b6cca[_0x3ac6('0x1a')]});}}if(_0x1b6cca[_0x3ac6('0xc')](_0x3ac6('0x34'))){if(_0x1f0783['indexOf'](_0x1b6cca[_0x3ac6('0x35')][_0x3ac6('0x29')]())>=0x0&&_0x1b6cca['appType']!==_0x3ac6('0x36')){if(_0x1b6cca[_0x3ac6('0x34')]){_0x1ffd62[_0x3ac6('0x15')]({'type':_0x1b6cca[_0x3ac6('0x11')],'app':_0x3ac6('0x1b'),'appdata':_0x3ac6('0x37'),'context':_0x1b6cca[_0x3ac6('0x12')],'exten':_0x1b6cca[_0x3ac6('0x7')],'priority':_0x3fd955[_0x3ac6('0x28')]+_0x354ee9[_0x3ac6('0x13')]+_0xb2ea38++,'VoiceExtensionId':_0x1b6cca[_0x3ac6('0x1a')]});_0x1ffd62[_0x3ac6('0x15')]({'type':_0x1b6cca[_0x3ac6('0x11')],'app':_0x3ac6('0xf'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1b6cca[_0x3ac6('0x12')],'exten':_0x1b6cca[_0x3ac6('0x7')],'priority':_0x3fd955['length']+_0x354ee9[_0x3ac6('0x13')]+_0xb2ea38++,'VoiceExtensionId':_0x1b6cca['VoiceExtensionId']});}else{_0x1ffd62[_0x3ac6('0x15')]({'type':_0x1b6cca[_0x3ac6('0x11')],'app':_0x3ac6('0x1b'),'appdata':_0x3ac6('0x38'),'context':_0x1b6cca[_0x3ac6('0x12')],'exten':_0x1b6cca[_0x3ac6('0x7')],'priority':_0x3fd955[_0x3ac6('0x28')]+_0x354ee9[_0x3ac6('0x13')]+_0xb2ea38++,'VoiceExtensionId':_0x1b6cca[_0x3ac6('0x1a')]});_0x1ffd62['push']({'type':_0x1b6cca[_0x3ac6('0x11')],'app':_0x3ac6('0xf'),'appdata':_0x3ac6('0x39'),'context':_0x1b6cca['context'],'exten':_0x1b6cca[_0x3ac6('0x7')],'priority':_0x3fd955[_0x3ac6('0x28')]+_0x354ee9[_0x3ac6('0x13')]+_0xb2ea38++,'VoiceExtensionId':_0x1b6cca[_0x3ac6('0x1a')]});}}}for(var _0x5ad7c1=0x0;_0x5ad7c1<_0x3fd955['length'];_0x5ad7c1+=0x1){var _0x217d93=_0x354ee9[_0x3ac6('0x13')]+_0x3fd955[_0x3ac6('0x28')];var _0x31712d=_0x5ad7c1===_0x3fd955[_0x3ac6('0x28')]-0x1?_0x354ee9['priority']+_0x1ffd62[_0x3ac6('0x28')]+_0x4202cf['length']+0x2:_0x354ee9[_0x3ac6('0x13')]+_0x5ad7c1+0x1;_0x1ffd62[_0x3ac6('0x3a')](_0x5ad7c1,0x0,{'type':_0x1b6cca[_0x3ac6('0x11')],'app':_0x3ac6('0x3b'),'appdata':_0x3fd955[_0x5ad7c1]+'?'+_0x1b6cca['context']+_0x3ac6('0x3c')+_0x217d93+':'+_0x1b6cca[_0x3ac6('0x12')]+_0x3ac6('0x3c')+_0x31712d,'exten':_0x1b6cca[_0x3ac6('0x7')],'context':_0x1b6cca['context'],'priority':_0x354ee9[_0x3ac6('0x13')]+_0x5ad7c1,'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')]});}_0x1b6cca['priority']=_0x1ffd62[_0x3ac6('0x28')]?_[_0x3ac6('0x3d')](_0x1ffd62)['priority']+0x1:_0x354ee9[_0x3ac6('0x13')];_0x354ee9[_0x3ac6('0x13')]=(_0x4202cf[_0x3ac6('0x28')]?_[_0x3ac6('0x3d')](_0x4202cf)[_0x3ac6('0x13')]:_0x1b6cca[_0x3ac6('0x13')])+0x1;_0x354ee9[_0x3ac6('0xe')]=_[_0x3ac6('0x3e')](_0x354ee9[_0x3ac6('0xe')],_0x1ffd62,[_0x1b6cca],_0x4202cf);}_0x354ee9[_0x3ac6('0xe')][_0x3ac6('0x15')]({'type':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x11')],'app':_0x3ac6('0x3f'),'exten':_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x7')],'context':_0x2ec73f[_0x1e0c32][0x0]['context'],'priority':_0x354ee9['priority'],'VoiceExtensionId':_0x2ec73f[_0x1e0c32][0x0]['VoiceExtensionId']});_0x426e0b['push'](_0x2ec73f[_0x1e0c32][0x0][_0x3ac6('0x1a')]);_0x140f64=_[_0x3ac6('0x3e')](_0x140f64,_0x354ee9[_0x3ac6('0xe')]);}}return _0x129180[_0x3ac6('0x40')](function(_0x177918){return _0x129180[_0x3ac6('0x0')][_0x3ac6('0x5')][_0x3ac6('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x426e0b}},'transaction':_0x177918})[_0x3ac6('0x3')](function(_0x96b41a){return _0x129180[_0x3ac6('0x0')][_0x3ac6('0x5')][_0x3ac6('0x42')](_[_0x3ac6('0x43')](_0x140f64,'priority'),{'transaction':_0x177918});});});})[_0x3ac6('0x44')](function(_0xb246b5){console[_0x3ac6('0x45')](_0xb246b5);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x1a6c=['updatedAt','interval','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','Hangup','concat','transaction','destroy','then','bulkCreate','sortBy','catch','error','lodash','util','models','Interval','findAll','VoiceExtension','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','extensions','extension','push','Set','format','CDR(type)=%s','type','context','priority','VoiceExtensionId','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt'];(function(_0x4048f7,_0x115e81){var _0x386b9e=function(_0x3d31b0){while(--_0x3d31b0){_0x4048f7['push'](_0x4048f7['shift']());}};_0x386b9e(++_0x115e81);}(_0x1a6c,0xed));var _0xc1a6=function(_0x77e1d1,_0x4e21bb){_0x77e1d1=_0x77e1d1-0x0;var _0xe9f9bf=_0x1a6c[_0x77e1d1];return _0xe9f9bf;};'use strict';var _=require(_0xc1a6('0x0'));var util=require(_0xc1a6('0x1'));function rewrite(_0x1d2cf2,_0x5e2c7f){var _0x9e2a96=this;return _0x1d2cf2[_0xc1a6('0x2')][_0xc1a6('0x3')][_0xc1a6('0x4')]({'raw':!![]})['then'](function(_0x4c707a){_0x9e2a96['intervals']=_0x4c707a;return _0x1d2cf2[_0xc1a6('0x2')][_0xc1a6('0x5')][_0xc1a6('0x4')]({'where':{'IntervalId':_0x5e2c7f['IntervalId']},'raw':!![]});})['then'](function(_0x851425){return _0x1d2cf2[_0xc1a6('0x2')][_0xc1a6('0x5')][_0xc1a6('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0xc1a6('0x6')](_0x851425,'exten'))}},'order':[{'raw':_0xc1a6('0x7')}],'raw':!![]});})['then'](function(_0x912df1){var _0x41d307=_[_0xc1a6('0x8')](_0x912df1,{'priority':'1'});var _0x43ef60=_[_0xc1a6('0x8')](_0x912df1,{'isApp':0x1});var _0x1043e9=_[_0xc1a6('0x9')](_0x43ef60,_0xc1a6('0xa'));var _0x585d20=[_0xc1a6('0xb'),_0xc1a6('0xc')];var _0x2972bc=[];var _0x59c033=[];for(var _0x11e41c in _0x1043e9){if(_0x1043e9[_0xc1a6('0xd')](_0x11e41c)){_0x9e2a96['priority']=0x2;_0x9e2a96[_0xc1a6('0xe')]=[];_0x9e2a96[_0xc1a6('0xf')]=_['find'](_0x41d307,{'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')]});_0x9e2a96[_0xc1a6('0xe')][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0]['type'],'app':_0xc1a6('0x11'),'appdata':util[_0xc1a6('0x12')](_0xc1a6('0x13'),_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x14')]),'context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});if(_0x1043e9[_0x11e41c][0x0]['type']==='outbound'){if(_0x9e2a96[_0xc1a6('0xf')]){_0x9e2a96['extensions'][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x14')],'app':_0xc1a6('0x11'),'appdata':_0xc1a6('0x18')+(_0x9e2a96['extension']['cutdigits']?_0xc1a6('0x19')+_0x9e2a96[_0xc1a6('0xf')][_0xc1a6('0x1a')]+'}':_0xc1a6('0x1b')),'context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});}_0x9e2a96['extensions'][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0]['type'],'app':_0xc1a6('0x11'),'appdata':_0xc1a6('0x1c')+_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')],'context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0]['VoiceExtensionId']});var _0x5a6ed9=_0x9e2a96['priority']++;_0x9e2a96[_0xc1a6('0xe')][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x14')],'app':_0xc1a6('0x1d'),'appdata':_0xc1a6('0x1e')+(_0x5a6ed9+0x2)+_0xc1a6('0x1f')+(_0x5a6ed9+0x1)+')','context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0]['exten'],'priority':_0x5a6ed9,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0]['VoiceExtensionId']});if(_0x9e2a96[_0xc1a6('0xf')]){_0x9e2a96[_0xc1a6('0xe')]['push']({'type':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x14')],'app':_0xc1a6('0x11'),'appdata':_0x9e2a96[_0xc1a6('0xf')][_0xc1a6('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x9e2a96[_0xc1a6('0xf')][_0xc1a6('0x1a')]+'}':_0xc1a6('0x20'),'context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0]['exten'],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});}_0x9e2a96[_0xc1a6('0xe')][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0]['type'],'app':_0xc1a6('0x11'),'appdata':_0xc1a6('0x21')+_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')],'context':_0x1043e9[_0x11e41c][0x0]['context'],'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});if(_0x9e2a96[_0xc1a6('0xf')]&&_0x9e2a96[_0xc1a6('0xf')][_0xc1a6('0xd')](_0xc1a6('0x22'))&&_0x9e2a96[_0xc1a6('0xf')][_0xc1a6('0x22')]!=='none'){_0x9e2a96['extensions'][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x14')],'app':_0xc1a6('0x11'),'appdata':_0xc1a6('0x23'),'context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0]['exten'],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});_0x9e2a96[_0xc1a6('0xe')][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x14')],'app':_0xc1a6('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x9e2a96[_0xc1a6('0xf')][_0xc1a6('0x22')]||_0xc1a6('0x24'),'context':_0x1043e9[_0x11e41c][0x0]['context'],'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0]['VoiceExtensionId']});}}_0x9e2a96[_0xc1a6('0xe')][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0]['type'],'app':_0xc1a6('0x11'),'appdata':_0xc1a6('0x25'),'context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});_0x9e2a96[_0xc1a6('0xe')][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0]['type'],'app':'Set','appdata':_0xc1a6('0x26'),'context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});_0x9e2a96[_0xc1a6('0xe')][_0xc1a6('0x10')]({'type':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x14')],'app':'Set','appdata':_0xc1a6('0x27'),'context':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x15')],'exten':_0x1043e9[_0x11e41c][0x0]['exten'],'priority':_0x9e2a96[_0xc1a6('0x16')]++,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0]['VoiceExtensionId']});for(var _0x2ce74c=0x0,_0x50dcc5=0x0;_0x2ce74c<_0x1043e9[_0x11e41c][_0xc1a6('0x28')];_0x2ce74c+=0x1,_0x50dcc5=0x0){var _0x321bd7=_0x1043e9[_0x11e41c][_0x2ce74c];if(_0x321bd7[_0xc1a6('0x14')]){_0x321bd7[_0xc1a6('0x14')]=_0x321bd7[_0xc1a6('0x14')][_0xc1a6('0x29')]();}var _0x1d4c3b=[];var _0x18e348=[];delete _0x321bd7['id'];delete _0x321bd7[_0xc1a6('0x2a')];delete _0x321bd7[_0xc1a6('0x2b')];var _0x538f6e=_0x321bd7[_0xc1a6('0x2c')]!=='*,*,*,*'?[_0x321bd7[_0xc1a6('0x2c')]]:_0x321bd7[_0xc1a6('0x2d')]?_['map'](_[_0xc1a6('0x8')](_0x9e2a96['intervals'],{'IntervalId':_0x321bd7[_0xc1a6('0x2d')]}),_0xc1a6('0x2c')):[];if(_0x321bd7['hasOwnProperty'](_0xc1a6('0x2e'))){if(_0x321bd7['tag']&&_0x321bd7[_0xc1a6('0x2e')]!=='--'){_0x1d4c3b[_0xc1a6('0x10')]({'type':_0x321bd7[_0xc1a6('0x14')],'app':_0xc1a6('0x11'),'appdata':_0xc1a6('0x2f')+_0x321bd7['tag'],'context':_0x321bd7['context'],'exten':_0x321bd7[_0xc1a6('0xa')],'priority':_0x538f6e['length']+_0x9e2a96['priority']+_0x50dcc5++,'VoiceExtensionId':_0x321bd7[_0xc1a6('0x17')]});}}if(_0x321bd7[_0xc1a6('0x14')]==='outbound'&&_0x321bd7[_0xc1a6('0xd')]('callerID')){if(_0x321bd7[_0xc1a6('0x30')]){_0x1d4c3b[_0xc1a6('0x10')]({'type':_0x321bd7[_0xc1a6('0x14')],'app':_0xc1a6('0x1d'),'appdata':_0xc1a6('0x31')+_0x321bd7[_0xc1a6('0x30')]+')','context':_0x321bd7[_0xc1a6('0x15')],'exten':_0x321bd7[_0xc1a6('0xa')],'priority':_0x538f6e['length']+_0x9e2a96[_0xc1a6('0x16')]+_0x50dcc5++,'VoiceExtensionId':_0x321bd7[_0xc1a6('0x17')]});}else{_0x1d4c3b[_0xc1a6('0x10')]({'type':_0x321bd7[_0xc1a6('0x14')],'app':'ExecIf','appdata':_0xc1a6('0x32'),'context':_0x321bd7[_0xc1a6('0x15')],'exten':_0x321bd7[_0xc1a6('0xa')],'priority':_0x538f6e[_0xc1a6('0x28')]+_0x9e2a96[_0xc1a6('0x16')]+_0x50dcc5++,'VoiceExtensionId':_0x321bd7['VoiceExtensionId']});}}if(_0x321bd7[_0xc1a6('0xd')]('answer')){if(_0x585d20[_0xc1a6('0x33')](_0x321bd7[_0xc1a6('0x34')][_0xc1a6('0x29')]())>=0x0&&_0x321bd7[_0xc1a6('0x35')]!==_0xc1a6('0x36')){if(_0x321bd7[_0xc1a6('0x37')]){_0x1d4c3b[_0xc1a6('0x10')]({'type':_0x321bd7[_0xc1a6('0x14')],'app':_0xc1a6('0x1d'),'appdata':_0xc1a6('0x38'),'context':_0x321bd7[_0xc1a6('0x15')],'exten':_0x321bd7['exten'],'priority':_0x538f6e['length']+_0x9e2a96['priority']+_0x50dcc5++,'VoiceExtensionId':_0x321bd7[_0xc1a6('0x17')]});_0x1d4c3b['push']({'type':_0x321bd7[_0xc1a6('0x14')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x321bd7['context'],'exten':_0x321bd7['exten'],'priority':_0x538f6e[_0xc1a6('0x28')]+_0x9e2a96['priority']+_0x50dcc5++,'VoiceExtensionId':_0x321bd7['VoiceExtensionId']});}else{_0x1d4c3b['push']({'type':_0x321bd7[_0xc1a6('0x14')],'app':_0xc1a6('0x1d'),'appdata':_0xc1a6('0x39'),'context':_0x321bd7[_0xc1a6('0x15')],'exten':_0x321bd7['exten'],'priority':_0x538f6e[_0xc1a6('0x28')]+_0x9e2a96[_0xc1a6('0x16')]+_0x50dcc5++,'VoiceExtensionId':_0x321bd7['VoiceExtensionId']});_0x1d4c3b[_0xc1a6('0x10')]({'type':_0x321bd7[_0xc1a6('0x14')],'app':'Set','appdata':_0xc1a6('0x3a'),'context':_0x321bd7[_0xc1a6('0x15')],'exten':_0x321bd7['exten'],'priority':_0x538f6e[_0xc1a6('0x28')]+_0x9e2a96[_0xc1a6('0x16')]+_0x50dcc5++,'VoiceExtensionId':_0x321bd7[_0xc1a6('0x17')]});}}}for(var _0x27278a=0x0;_0x27278a<_0x538f6e[_0xc1a6('0x28')];_0x27278a+=0x1){var _0x15d528=_0x9e2a96[_0xc1a6('0x16')]+_0x538f6e[_0xc1a6('0x28')];var _0x5535a2=_0x27278a===_0x538f6e[_0xc1a6('0x28')]-0x1?_0x9e2a96['priority']+_0x1d4c3b[_0xc1a6('0x28')]+_0x18e348[_0xc1a6('0x28')]+0x2:_0x9e2a96[_0xc1a6('0x16')]+_0x27278a+0x1;_0x1d4c3b['splice'](_0x27278a,0x0,{'type':_0x321bd7[_0xc1a6('0x14')],'app':'GotoIfTime','appdata':_0x538f6e[_0x27278a]+'?'+_0x321bd7[_0xc1a6('0x15')]+_0xc1a6('0x3b')+_0x15d528+':'+_0x321bd7[_0xc1a6('0x15')]+_0xc1a6('0x3b')+_0x5535a2,'exten':_0x321bd7['exten'],'context':_0x321bd7[_0xc1a6('0x15')],'priority':_0x9e2a96[_0xc1a6('0x16')]+_0x27278a,'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});}_0x321bd7[_0xc1a6('0x16')]=_0x1d4c3b[_0xc1a6('0x28')]?_[_0xc1a6('0x3c')](_0x1d4c3b)['priority']+0x1:_0x9e2a96[_0xc1a6('0x16')];_0x9e2a96[_0xc1a6('0x16')]=(_0x18e348[_0xc1a6('0x28')]?_['last'](_0x18e348)[_0xc1a6('0x16')]:_0x321bd7[_0xc1a6('0x16')])+0x1;_0x9e2a96[_0xc1a6('0xe')]=_['concat'](_0x9e2a96['extensions'],_0x1d4c3b,[_0x321bd7],_0x18e348);}_0x9e2a96[_0xc1a6('0xe')]['push']({'type':_0x1043e9[_0x11e41c][0x0]['type'],'app':_0xc1a6('0x3d'),'exten':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0xa')],'context':_0x1043e9[_0x11e41c][0x0]['context'],'priority':_0x9e2a96['priority'],'VoiceExtensionId':_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]});_0x2972bc['push'](_0x1043e9[_0x11e41c][0x0][_0xc1a6('0x17')]);_0x59c033=_[_0xc1a6('0x3e')](_0x59c033,_0x9e2a96[_0xc1a6('0xe')]);}}return _0x1d2cf2[_0xc1a6('0x3f')](function(_0x5e2e3f){return _0x1d2cf2['models'][_0xc1a6('0x5')][_0xc1a6('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x2972bc}},'transaction':_0x5e2e3f})[_0xc1a6('0x41')](function(_0x145927){return _0x1d2cf2['models'][_0xc1a6('0x5')][_0xc1a6('0x42')](_[_0xc1a6('0x43')](_0x59c033,_0xc1a6('0x16')),{'transaction':_0x5e2e3f});});});})[_0xc1a6('0x44')](function(_0x1ccf5a){console[_0xc1a6('0x45')](_0x1ccf5a);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index a17ff75..b334ace 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 _0x03d2=['CmList','Lists','dialCheckDuplicateType','always','push','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','resolve','CmContact','parse','duplicate','pause','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','localhost','socket.io-emitter','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','Duplicate\x20Contact','create','then','pick','catch','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','select','field','toString','createdAt','NOW()','updatedAt','from','cm_contacts','where','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ContactId','ListId\x20=\x20?','calleridnum','cm_hopper_final','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','findAll','outbound'];(function(_0x3496f3,_0xd090ac){var _0x39178e=function(_0xe6535e){while(--_0xe6535e){_0x3496f3['push'](_0x3496f3['shift']());}};_0x39178e(++_0xd090ac);}(_0x03d2,0xf6));var _0x203d=function(_0x8bf8a6,_0x4e869d){_0x8bf8a6=_0x8bf8a6-0x0;var _0x59e910=_0x03d2[_0x8bf8a6];return _0x59e910;};'use strict';var BPromise=require(_0x203d('0x0'));var util=require(_0x203d('0x1'));var _=require(_0x203d('0x2'));var fs=require('fs');var squel=require(_0x203d('0x3'));var Papa=require(_0x203d('0x4'));var Redis=require(_0x203d('0x5'));var db=require(_0x203d('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x203d('0x7'))(_0x203d('0x8'));config[_0x203d('0x9')]=_['defaults'](config[_0x203d('0x9')],{'host':_0x203d('0xa'),'port':0x18eb});var socket=require(_0x203d('0xb'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x203d('0xc')][0x2]||process[_0x203d('0xc')][0x2]===_0x203d('0xd')||process['argv'][0x2]===_0x203d('0xe')){throw new Error(_0x203d('0xf'));}var FILEPATH=process[_0x203d('0xc')][0x2];if(!process[_0x203d('0xc')][0x3]||process[_0x203d('0xc')][0x3]===_0x203d('0xd')||process[_0x203d('0xc')][0x3]===_0x203d('0xe')||!process['argv'][0x4]||process[_0x203d('0xc')][0x4]===_0x203d('0xd')||process[_0x203d('0xc')][0x4]===_0x203d('0xe')){throw new Error(_0x203d('0x10'));}var FIELDS=_[_0x203d('0x11')](process[_0x203d('0xc')][0x3][_0x203d('0x12')](','),process[_0x203d('0xc')][0x4]['split'](','));if(!process[_0x203d('0xc')][0x5]||process['argv'][0x5]===_0x203d('0xd')||process[_0x203d('0xc')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x203d('0xc')][0x5];var COMPANYID=process[_0x203d('0xc')][0x6]&&process['argv'][0x6]!==_0x203d('0xd')&&process[_0x203d('0xc')][0x6]!==_0x203d('0xe')?process[_0x203d('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x203d('0xc')][0x7]!==_0x203d('0xd')&&process[_0x203d('0xc')][0x7]!=='null'?process[_0x203d('0xc')][0x7]:null;if(!process[_0x203d('0xc')][0x8]||process['argv'][0x8]===_0x203d('0xd')||process[_0x203d('0xc')][0x8]===_0x203d('0xe')){throw new Error(_0x203d('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x21bb08){logger[_0x203d('0x14')](_0x21bb08);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(_0x4e8b92,_0x1a5ecb,_0x17238f,_0x1cdbba){var _0x5797e9={'message':_0x1a5ecb};_0x5797e9[_0x4e8b92]=!![];if(_0x17238f){_0x5797e9[_0x203d('0x15')]=_0x17238f;}if(_0x1cdbba){_0x5797e9[_0x203d('0x16')]=_0x1cdbba;}return _0x5797e9;}function isEmail(_0x4a13c1){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))*$/[_0x203d('0x17')](_0x4a13c1);}function checkRow(_0x3f8c3d,_0x3e8b01,_0x96ab6e){return new BPromise(function(_0x46a3f8,_0xc0c886){if(_[_0x203d('0x18')](_0x3f8c3d)){return _0xc0c886(handleCheckRowError(_0x203d('0x14'),_0x203d('0x19'),null,_0x96ab6e));}if(_0x3f8c3d[_0x203d('0x1a')]&&_0x3f8c3d['errors'][_0x203d('0x1b')]){var _0xd21719=_[_0x203d('0x1c')](_0x3f8c3d[_0x203d('0x1a')],_0x203d('0x1d'))[_0x203d('0x1e')](';');return _0xc0c886(handleCheckRowError(_0x203d('0x14'),_0xd21719,null,_0x96ab6e));}var _0x518b2a={};for(var _0x366be3 in FIELDS){if(FIELDS[_0x203d('0x1f')](_0x366be3)&&FIELDS[_0x366be3]){_0x518b2a[_0x366be3]=_0x3f8c3d[_0x203d('0x20')][0x0][FIELDS[_0x366be3]]||_0x3f8c3d[_0x203d('0x20')][0x0]['\ufeff'+FIELDS[_0x366be3]];}}if(!_0x518b2a['firstName']){return _0xc0c886(handleCheckRowError(_0x203d('0x14'),_0x203d('0x21'),null,_0x96ab6e));}if(!_0x518b2a[_0x203d('0x22')]){return _0xc0c886(handleCheckRowError(_0x203d('0x14'),'phone\x20not\x20specified!',null,_0x96ab6e));}if(_0x518b2a[_0x203d('0x23')]){var _0x486b89=moment(_0x518b2a[_0x203d('0x23')],_0x203d('0x24'));if(!_0x486b89[_0x203d('0x25')]()){return _0xc0c886(handleCheckRowError(_0x203d('0x14'),_0x203d('0x26'),null,_0x96ab6e));}}if(_0x518b2a['email']){if(!isEmail(_0x518b2a[_0x203d('0x27')])){return _0xc0c886(handleCheckRowError(_0x203d('0x14'),'email\x20format\x20is\x20not\x20valid!',null,_0x96ab6e));}}_0x518b2a[_0x203d('0x28')]=LISTID;_0x518b2a[_0x203d('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x203d('0x1b')]&&_0x3e8b01){var _0x189674={};for(var _0x181681=0x0,_0x3bf31f=DUPLICATES['length'];_0x181681<_0x3bf31f;_0x181681+=0x1){_0x189674[DUPLICATES[_0x181681]]=_0x518b2a[DUPLICATES[_0x181681]];}var _0x22d79a=_[_0x203d('0x2a')](_0x3e8b01,_0x189674);if(_0x22d79a){return _0xc0c886(handleCheckRowError('duplicate',_0x203d('0x2b'),_0x22d79a,_0x96ab6e));}}return db['CmContact'][_0x203d('0x2c')](_0x518b2a,{'raw':!![],'hooks':![],'fields':_['keys'](_0x518b2a)})[_0x203d('0x2d')](function(_0xd37258){if(DUPLICATES&&DUPLICATES[_0x203d('0x1b')]&&_0x3e8b01){_0x3e8b01['push'](_[_0x203d('0x2e')](_0x518b2a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xd37258['id'];return _0x46a3f8();})[_0x203d('0x2f')](function(_0x471d34){return _0xc0c886(handleCheckRowError(_0x203d('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x471d34[_0x203d('0x1d')]||JSON[_0x203d('0x30')](_0x471d34)),null,_0x96ab6e));});});}function checkHopper(){function _0x19ff50(){return function(_0x45ea23){logger[_0x203d('0x14')](_0x203d('0x31'),'checkHopper',util[_0x203d('0x32')](_0x45ea23,{'showHidden':![],'depth':null}));};}var _0x2ffbf=function(_0x2dbaae,_0x4776a9){var _0xd91ab6=squel[_0x203d('0x33')]()[_0x203d('0x34')](_0x203d('0x35'))[_0x203d('0x36')](['phone',_0x203d('0x37'),'ContactId',_0x203d('0x28'),_0x4776a9,'createdAt','updatedAt'],squel[_0x203d('0x38')]()[_0x203d('0x39')](_0x203d('0x22'),_0x203d('0x22'))[_0x203d('0x39')]('NOW()',_0x203d('0x37'))[_0x203d('0x39')]('id','ContactId')[_0x203d('0x39')](LISTID[_0x203d('0x3a')](),_0x203d('0x28'))[_0x203d('0x39')](_0x2dbaae['id'][_0x203d('0x3a')](),_0x4776a9)[_0x203d('0x39')]('NOW()',_0x203d('0x3b'))[_0x203d('0x39')](_0x203d('0x3c'),_0x203d('0x3d'))[_0x203d('0x3e')](_0x203d('0x3f'))['where']('deletedAt\x20IS\x20NULL')[_0x203d('0x40')]('ListId\x20=\x20?',LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x203d('0x40')](_0x203d('0x41'),squel[_0x203d('0x38')]()['field'](_0x203d('0x22'))['from'](_0x203d('0x35'))[_0x203d('0x40')](_0x4776a9+_0x203d('0x42'),_0x2dbaae['id'][_0x203d('0x3a')]())))[_0x203d('0x3a')]();return _0xd91ab6;};var _0x5395ba=function(_0x1aa585,_0x38721f){var _0x260199=squel[_0x203d('0x33')]()['into']('cm_hopper')['fromQuery']([_0x203d('0x22'),_0x203d('0x37'),_0x203d('0x43'),'ListId',_0x38721f,'createdAt',_0x203d('0x3d')],squel['select']()['field'](_0x203d('0x22'),'phone')['field'](_0x203d('0x3c'),_0x203d('0x37'))[_0x203d('0x39')]('id',_0x203d('0x43'))[_0x203d('0x39')](LISTID['toString'](),_0x203d('0x28'))[_0x203d('0x39')](_0x1aa585['id'][_0x203d('0x3a')](),_0x38721f)[_0x203d('0x39')](_0x203d('0x3c'),'createdAt')[_0x203d('0x39')](_0x203d('0x3c'),'updatedAt')[_0x203d('0x3e')](_0x203d('0x3f'))['where']('deletedAt\x20IS\x20NULL')[_0x203d('0x40')](_0x203d('0x44'),LISTID[_0x203d('0x3a')]())[_0x203d('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x203d('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x203d('0x40')](_0x203d('0x41'),squel['select']()[_0x203d('0x39')](_0x203d('0x45'))[_0x203d('0x3e')](_0x203d('0x46'))['where'](_0x38721f+'\x20=\x20?',_0x1aa585['id'][_0x203d('0x3a')]()))['where'](_0x203d('0x41'),squel['select']()[_0x203d('0x39')](_0x203d('0x22'))[_0x203d('0x3e')](_0x203d('0x35'))[_0x203d('0x40')](_0x38721f+_0x203d('0x42'),_0x1aa585['id'][_0x203d('0x3a')]())))[_0x203d('0x3a')]();return _0x260199;};function _0x1446c5(_0x4f9906,_0x2985cb){var _0x3dc8a3=squel[_0x203d('0x33')]()[_0x203d('0x34')](_0x203d('0x35'))[_0x203d('0x36')]([_0x203d('0x22'),_0x203d('0x37'),_0x203d('0x43'),_0x203d('0x28'),_0x2985cb,_0x203d('0x3b'),_0x203d('0x3d')],squel[_0x203d('0x38')]()[_0x203d('0x39')]('phone',_0x203d('0x22'))[_0x203d('0x39')]('NOW()','scheduledAt')[_0x203d('0x39')]('id',_0x203d('0x43'))['field'](LISTID[_0x203d('0x3a')](),_0x203d('0x28'))['field'](_0x4f9906['id'][_0x203d('0x3a')](),_0x2985cb)[_0x203d('0x39')](_0x203d('0x3c'),'createdAt')[_0x203d('0x39')](_0x203d('0x3c'),_0x203d('0x3d'))[_0x203d('0x3e')](_0x203d('0x3f'))['where'](_0x203d('0x47'))[_0x203d('0x40')](_0x203d('0x44'),LISTID[_0x203d('0x3a')]())[_0x203d('0x40')](_0x203d('0x48'),squel[_0x203d('0x49')](hopperContacts))['where'](_0x203d('0x4a')))[_0x203d('0x3a')]();return _0x3dc8a3;}function _0x14d979(_0x2fb9e9,_0x6a3d3c){var _0x27bc4b=squel[_0x203d('0x33')]()[_0x203d('0x34')](_0x203d('0x4b'))[_0x203d('0x36')](['phone',_0x203d('0x43'),'ListId',_0x6a3d3c,_0x203d('0x3b'),_0x203d('0x3d')],squel[_0x203d('0x38')]()['field'](_0x203d('0x22'),'phone')[_0x203d('0x39')]('id',_0x203d('0x43'))[_0x203d('0x39')](LISTID[_0x203d('0x3a')](),_0x203d('0x28'))['field'](_0x2fb9e9['id'][_0x203d('0x3a')](),_0x6a3d3c)['field'](_0x203d('0x3c'),'createdAt')[_0x203d('0x39')](_0x203d('0x3c'),'updatedAt')[_0x203d('0x3e')](_0x203d('0x3f'))[_0x203d('0x40')](_0x203d('0x47'))[_0x203d('0x40')](_0x203d('0x44'),LISTID[_0x203d('0x3a')]())[_0x203d('0x40')](_0x203d('0x48'),squel['str'](hopperContacts))[_0x203d('0x40')](_0x203d('0x4a')))[_0x203d('0x3a')]();return _0x27bc4b;}return db['VoiceQueue'][_0x203d('0x4c')]({'where':{'type':_0x203d('0x4d')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x203d('0x4e')],'as':_0x203d('0x4f'),'where':{'id':LISTID}}]})[_0x203d('0x2d')](function(_0x556284){var _0x389443=[];if(_0x556284){var _0x368feb;for(var _0x5ebced=0x0,_0x502fc3;_0x5ebced<_0x556284['length'];_0x5ebced+=0x1){_0x502fc3=_0x556284[_0x5ebced]['get']({'plain':!![]});switch(_0x502fc3[_0x203d('0x50')]){case _0x203d('0x51'):_0x389443[_0x203d('0x52')](db[_0x203d('0x53')][_0x203d('0x54')](_0x5395ba(_0x502fc3,'VoiceQueueId'))[_0x203d('0x2d')](function(){})[_0x203d('0x2f')](_0x19ff50()));break;case'onlyIfOpen':_0x389443[_0x203d('0x52')](db[_0x203d('0x53')][_0x203d('0x54')](_0x2ffbf(_0x502fc3,'VoiceQueueId'))[_0x203d('0x2d')](function(){})['catch'](_0x19ff50()));break;default:_0x389443[_0x203d('0x52')](db[_0x203d('0x53')][_0x203d('0x54')](_0x1446c5(_0x502fc3,_0x203d('0x55')))['then'](function(){})['catch'](_0x19ff50()));}}}return _0x389443;})[_0x203d('0x56')]()[_0x203d('0x2d')](function(){return db[_0x203d('0x57')][_0x203d('0x4c')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x203d('0x4e')],'as':_0x203d('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x31351d){var _0x21cf4b=[];if(_0x31351d){var _0x4bd89d;for(var _0x6a6461=0x0,_0x47d5ed;_0x6a6461<_0x31351d[_0x203d('0x1b')];_0x6a6461+=0x1){_0x47d5ed=_0x31351d[_0x6a6461][_0x203d('0x59')]({'plain':!![]});_0x21cf4b[_0x203d('0x52')](db[_0x203d('0x53')][_0x203d('0x54')](_0x14d979(_0x47d5ed,_0x203d('0x55')))[_0x203d('0x2d')](function(){})[_0x203d('0x2f')](_0x19ff50()));}}return _0x21cf4b;})[_0x203d('0x56')]();})['then'](function(){return db[_0x203d('0x5a')]['findAll']({'attributes':['id',_0x203d('0x50')],'include':[{'model':db['CmList'],'as':_0x203d('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x4bd116){var _0x3e2216=[];if(_0x4bd116){for(var _0x47141a=0x0,_0x356b26;_0x47141a<_0x4bd116[_0x203d('0x1b')];_0x47141a+=0x1){_0x356b26=_0x4bd116[_0x47141a][_0x203d('0x59')]({'plain':!![]});switch(_0x356b26['dialCheckDuplicateType']){case _0x203d('0x51'):_0x3e2216['push'](db[_0x203d('0x53')][_0x203d('0x54')](_0x5395ba(_0x356b26,_0x203d('0x5b')))[_0x203d('0x2d')](function(){})[_0x203d('0x2f')](_0x19ff50()));break;case _0x203d('0x5c'):_0x3e2216[_0x203d('0x52')](db[_0x203d('0x53')]['query'](_0x2ffbf(_0x356b26,_0x203d('0x5b')))[_0x203d('0x2d')](function(){})['catch'](_0x19ff50()));break;default:_0x3e2216[_0x203d('0x52')](db[_0x203d('0x53')][_0x203d('0x54')](_0x1446c5(_0x356b26,'CampaignId'))[_0x203d('0x2d')](function(){})[_0x203d('0x2f')](_0x19ff50()));}}}return _0x3e2216;})[_0x203d('0x56')]();})[_0x203d('0x2d')](function(){return db[_0x203d('0x5a')][_0x203d('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x203d('0x4e')],'as':_0x203d('0x58'),'where':{'id':LISTID}}]})[_0x203d('0x2d')](function(_0x28b496){var _0x53efd4=[];if(_0x28b496){for(var _0x100240=0x0,_0x1ff05f;_0x100240<_0x28b496[_0x203d('0x1b')];_0x100240+=0x1){_0x1ff05f=_0x28b496[_0x100240]['get']({'plain':!![]});_0x53efd4[_0x203d('0x52')](db['sequelize'][_0x203d('0x54')](_0x14d979(_0x1ff05f,_0x203d('0x5b')))['then'](function(){})[_0x203d('0x2f')](_0x19ff50()));}}return _0x53efd4;})[_0x203d('0x56')]();})[_0x203d('0x2f')](function(_0x128371){logger['error'](_0x203d('0x5d'),_0x203d('0x5e'),_0x128371[_0x203d('0x1d')]);});}var processPromises=function(_0x155390){return BPromise[_0x203d('0x56')](promises)['then'](function(_0x24dbed){})[_0x203d('0x2f')](function(_0x18ab7a){logger[_0x203d('0x14')](_0x203d('0x5f'),JSON[_0x203d('0x30')](_0x18ab7a));})[_0x203d('0x60')](function(){socket['emit'](_0x203d('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x155390){return _0x155390[_0x203d('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x203d('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x203d('0x2d')](function(){socket[_0x203d('0x63')](_0x203d('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0xc20de7){logger[_0x203d('0x14')](_0x203d('0x64'),JSON[_0x203d('0x30')](_0xc20de7));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x203d('0x65')](_0x203d('0x66'));endCsv();});function main(){return BPromise[_0x203d('0x67')]()[_0x203d('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x203d('0x12')](',');return db[_0x203d('0x68')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x203d('0x2d')](function(_0x31caf0){var _0x860ee5=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x203d('0x69')](_0x860ee5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c7d39,_0x243d99){total+=0x1;var _0x2d7dcc=total;promises[_0x203d('0x52')](checkRow(_0x3c7d39,_0x31caf0,_0x2d7dcc)['then'](function(){success+=0x1;})['catch'](function(_0x5954d5){if(_0x5954d5[_0x203d('0x14')]){errors+=0x1;delete _0x5954d5[_0x203d('0x14')];}else if(_0x5954d5['duplicate']){duplicates+=0x1;delete _0x5954d5[_0x203d('0x6a')];}rows[_0x203d('0x52')](_0x5954d5);}));if(total%0xc8===0x0){_0x243d99[_0x203d('0x6b')]();return processPromises(_0x243d99);}},'complete':function(){return processPromises()['then'](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3085c8,_0x4306f3){logger[_0x203d('0x65')]('CSV\x20parse\x20error',JSON[_0x203d('0x30')](_0x3085c8));endCsv();}});})[_0x203d('0x2f')](function(_0x5944e7){logger[_0x203d('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x203d('0x30')](_0x5944e7));});}main(); \ No newline at end of file +var _0x4855=['BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','contact:csv_','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','stringify','exit','info','CSV\x20import\x20process\x20stopped!','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','../../../mysqldb','../../../config/logger','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','null','argv','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','message','cmContact','checkHopper','inspect','insert','into','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','cm_contacts','str','calleridnum','fromQuery','id\x20IN\x20?','cm_hopper_black','VoiceQueue','CmList','Lists','get','dialCheckDuplicateType','sequelize','query','VoiceQueueId','onlyIfOpen','all','outbound','findAll','always','CampaignId','Campaign'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x4855,0xe3));var _0x5485=function(_0x5213d3,_0x457833){_0x5213d3=_0x5213d3-0x0;var _0x3eb033=_0x4855[_0x5213d3];return _0x3eb033;};'use strict';var BPromise=require('bluebird');var util=require(_0x5485('0x0'));var _=require(_0x5485('0x1'));var fs=require('fs');var squel=require(_0x5485('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x5485('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x5485('0x4'))('api');config['redis']=_['defaults'](config[_0x5485('0x5')],{'host':_0x5485('0x6'),'port':0x18eb});var socket=require(_0x5485('0x7'))(new Redis(config[_0x5485('0x5')]));require(_0x5485('0x8'))[_0x5485('0x9')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x5485('0xa')||process['argv'][0x2]===_0x5485('0xb')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x5485('0xc')][0x2];if(!process[_0x5485('0xc')][0x3]||process[_0x5485('0xc')][0x3]===_0x5485('0xa')||process[_0x5485('0xc')][0x3]==='null'||!process['argv'][0x4]||process[_0x5485('0xc')][0x4]===_0x5485('0xa')||process[_0x5485('0xc')][0x4]===_0x5485('0xb')){throw new Error(_0x5485('0xd'));}var FIELDS=_[_0x5485('0xe')](process[_0x5485('0xc')][0x3][_0x5485('0xf')](','),process[_0x5485('0xc')][0x4][_0x5485('0xf')](','));if(!process['argv'][0x5]||process[_0x5485('0xc')][0x5]===_0x5485('0xa')||process['argv'][0x5]===_0x5485('0xb')){throw new Error(_0x5485('0x10'));}var LISTID=process[_0x5485('0xc')][0x5];var COMPANYID=process[_0x5485('0xc')][0x6]&&process[_0x5485('0xc')][0x6]!==_0x5485('0xa')&&process['argv'][0x6]!==_0x5485('0xb')?process[_0x5485('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x5485('0xc')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x5485('0xb')?process[_0x5485('0xc')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]==='undefined'||process[_0x5485('0xc')][0x8]==='null'){throw new Error(_0x5485('0x11'));}var SOCKET_TIMESTAMP=process[_0x5485('0xc')][0x8];}catch(_0x3646c1){logger[_0x5485('0x12')](_0x3646c1);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(_0x224e83,_0x822b9c,_0x2e225c,_0x38e8ca){var _0x310ddf={'message':_0x822b9c};_0x310ddf[_0x224e83]=!![];if(_0x2e225c){_0x310ddf['contact']=_0x2e225c;}if(_0x38e8ca){_0x310ddf['index']=_0x38e8ca;}return _0x310ddf;}function isEmail(_0x1e7b78){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))*$/[_0x5485('0x13')](_0x1e7b78);}function checkRow(_0x98f34d,_0x5c2ec0,_0x184254){return new BPromise(function(_0x144acb,_0xb63732){if(_['isNil'](_0x98f34d)){return _0xb63732(handleCheckRowError(_0x5485('0x12'),_0x5485('0x14'),null,_0x184254));}if(_0x98f34d[_0x5485('0x15')]&&_0x98f34d[_0x5485('0x15')][_0x5485('0x16')]){var _0xd90d6b=_[_0x5485('0x17')](_0x98f34d[_0x5485('0x15')],'message')[_0x5485('0x18')](';');return _0xb63732(handleCheckRowError('error',_0xd90d6b,null,_0x184254));}var _0x225e6c={};for(var _0x56c8da in FIELDS){if(FIELDS['hasOwnProperty'](_0x56c8da)&&FIELDS[_0x56c8da]){_0x225e6c[_0x56c8da]=_0x98f34d[_0x5485('0x19')][0x0][FIELDS[_0x56c8da]]||_0x98f34d['data'][0x0]['\ufeff'+FIELDS[_0x56c8da]];}}if(!_0x225e6c[_0x5485('0x1a')]){return _0xb63732(handleCheckRowError(_0x5485('0x12'),_0x5485('0x1b'),null,_0x184254));}if(!_0x225e6c[_0x5485('0x1c')]){return _0xb63732(handleCheckRowError(_0x5485('0x12'),_0x5485('0x1d'),null,_0x184254));}if(_0x225e6c['birthDate']){var _0x2f6d68=moment(_0x225e6c['birthDate'],_0x5485('0x1e'));if(!_0x2f6d68[_0x5485('0x1f')]()){return _0xb63732(handleCheckRowError(_0x5485('0x12'),_0x5485('0x20'),null,_0x184254));}}if(_0x225e6c[_0x5485('0x21')]){if(!isEmail(_0x225e6c[_0x5485('0x21')])){return _0xb63732(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x184254));}}_0x225e6c[_0x5485('0x22')]=LISTID;_0x225e6c[_0x5485('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x5c2ec0){var _0x24ee7d={};for(var _0x4306e5=0x0,_0x79e2cd=DUPLICATES[_0x5485('0x16')];_0x4306e5<_0x79e2cd;_0x4306e5+=0x1){_0x24ee7d[DUPLICATES[_0x4306e5]]=_0x225e6c[DUPLICATES[_0x4306e5]];}var _0x264876=_[_0x5485('0x24')](_0x5c2ec0,_0x24ee7d);if(_0x264876){return _0xb63732(handleCheckRowError(_0x5485('0x25'),'Duplicate\x20Contact',_0x264876,_0x184254));}}return db[_0x5485('0x26')][_0x5485('0x27')](_0x225e6c,{'raw':!![],'hooks':![],'fields':_[_0x5485('0x28')](_0x225e6c)})[_0x5485('0x29')](function(_0xcc26af){if(DUPLICATES&&DUPLICATES['length']&&_0x5c2ec0){_0x5c2ec0[_0x5485('0x2a')](_['pick'](_0x225e6c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xcc26af['id'];return _0x144acb();})[_0x5485('0x2b')](function(_0x3cea8b){return _0xb63732(handleCheckRowError(_0x5485('0x12'),_0x5485('0x2c')+(_0x3cea8b[_0x5485('0x2d')]||JSON['stringify'](_0x3cea8b)),null,_0x184254));});});}function checkHopper(){function _0x14e4bc(){return function(_0x501907){logger['error'](_0x5485('0x2e'),_0x5485('0x2f'),util[_0x5485('0x30')](_0x501907,{'showHidden':![],'depth':null}));};}var _0x1cb9f7=function(_0x1b8a04,_0x64063d){var _0x198cd5=squel[_0x5485('0x31')]()[_0x5485('0x32')]('cm_hopper')['fromQuery']([_0x5485('0x1c'),'scheduledAt',_0x5485('0x33'),'ListId',_0x64063d,_0x5485('0x34'),_0x5485('0x35')],squel[_0x5485('0x36')]()[_0x5485('0x37')](_0x5485('0x1c'),_0x5485('0x1c'))[_0x5485('0x37')](_0x5485('0x38'),_0x5485('0x39'))[_0x5485('0x37')]('id',_0x5485('0x33'))[_0x5485('0x37')](LISTID['toString'](),'ListId')[_0x5485('0x37')](_0x1b8a04['id'][_0x5485('0x3a')](),_0x64063d)[_0x5485('0x37')](_0x5485('0x38'),_0x5485('0x34'))[_0x5485('0x37')](_0x5485('0x38'),_0x5485('0x35'))[_0x5485('0x3b')]('cm_contacts')['where'](_0x5485('0x3c'))[_0x5485('0x3d')](_0x5485('0x3e'),LISTID[_0x5485('0x3a')]())['where'](_0x5485('0x3f'))[_0x5485('0x3d')](_0x5485('0x40'),squel[_0x5485('0x36')]()[_0x5485('0x37')](_0x5485('0x1c'))[_0x5485('0x3b')](_0x5485('0x41'))[_0x5485('0x3d')](_0x64063d+_0x5485('0x42'),_0x1b8a04['id'][_0x5485('0x3a')]())))[_0x5485('0x3a')]();return _0x198cd5;};var _0x27c125=function(_0x538e1f,_0x4bc7b4){var _0x15cc90=squel[_0x5485('0x31')]()[_0x5485('0x32')](_0x5485('0x41'))['fromQuery']([_0x5485('0x1c'),_0x5485('0x39'),_0x5485('0x33'),_0x5485('0x22'),_0x4bc7b4,_0x5485('0x34'),_0x5485('0x35')],squel[_0x5485('0x36')]()[_0x5485('0x37')]('phone',_0x5485('0x1c'))[_0x5485('0x37')]('NOW()',_0x5485('0x39'))['field']('id',_0x5485('0x33'))['field'](LISTID['toString'](),_0x5485('0x22'))[_0x5485('0x37')](_0x538e1f['id'][_0x5485('0x3a')](),_0x4bc7b4)[_0x5485('0x37')](_0x5485('0x38'),_0x5485('0x34'))[_0x5485('0x37')](_0x5485('0x38'),_0x5485('0x35'))['from'](_0x5485('0x43'))['where'](_0x5485('0x3c'))[_0x5485('0x3d')]('ListId\x20=\x20?',LISTID[_0x5485('0x3a')]())[_0x5485('0x3d')]('id\x20IN\x20?',squel[_0x5485('0x44')](hopperContacts))[_0x5485('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x5485('0x3d')](_0x5485('0x40'),squel[_0x5485('0x36')]()[_0x5485('0x37')](_0x5485('0x45'))['from']('cm_hopper_final')['where'](_0x4bc7b4+_0x5485('0x42'),_0x538e1f['id'][_0x5485('0x3a')]()))['where'](_0x5485('0x40'),squel['select']()[_0x5485('0x37')]('phone')[_0x5485('0x3b')]('cm_hopper')[_0x5485('0x3d')](_0x4bc7b4+'\x20=\x20?',_0x538e1f['id'][_0x5485('0x3a')]())))[_0x5485('0x3a')]();return _0x15cc90;};function _0x5009e1(_0x1f6d90,_0x2914ea){var _0x2c07ea=squel['insert']()[_0x5485('0x32')]('cm_hopper')[_0x5485('0x46')]([_0x5485('0x1c'),'scheduledAt',_0x5485('0x33'),_0x5485('0x22'),_0x2914ea,'createdAt',_0x5485('0x35')],squel[_0x5485('0x36')]()['field'](_0x5485('0x1c'),_0x5485('0x1c'))['field']('NOW()',_0x5485('0x39'))[_0x5485('0x37')]('id',_0x5485('0x33'))[_0x5485('0x37')](LISTID[_0x5485('0x3a')](),_0x5485('0x22'))[_0x5485('0x37')](_0x1f6d90['id'][_0x5485('0x3a')](),_0x2914ea)['field']('NOW()',_0x5485('0x34'))[_0x5485('0x37')](_0x5485('0x38'),_0x5485('0x35'))[_0x5485('0x3b')](_0x5485('0x43'))[_0x5485('0x3d')](_0x5485('0x3c'))[_0x5485('0x3d')](_0x5485('0x3e'),LISTID[_0x5485('0x3a')]())[_0x5485('0x3d')](_0x5485('0x47'),squel['str'](hopperContacts))[_0x5485('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x5485('0x3a')]();return _0x2c07ea;}function _0x5dc880(_0x33dac6,_0x5a7b41){var _0x4dd2b4=squel[_0x5485('0x31')]()[_0x5485('0x32')](_0x5485('0x48'))[_0x5485('0x46')](['phone',_0x5485('0x33'),'ListId',_0x5a7b41,_0x5485('0x34'),_0x5485('0x35')],squel['select']()[_0x5485('0x37')](_0x5485('0x1c'),_0x5485('0x1c'))[_0x5485('0x37')]('id','ContactId')[_0x5485('0x37')](LISTID['toString'](),_0x5485('0x22'))['field'](_0x33dac6['id'][_0x5485('0x3a')](),_0x5a7b41)[_0x5485('0x37')](_0x5485('0x38'),_0x5485('0x34'))[_0x5485('0x37')]('NOW()','updatedAt')[_0x5485('0x3b')](_0x5485('0x43'))['where'](_0x5485('0x3c'))[_0x5485('0x3d')](_0x5485('0x3e'),LISTID[_0x5485('0x3a')]())[_0x5485('0x3d')](_0x5485('0x47'),squel[_0x5485('0x44')](hopperContacts))[_0x5485('0x3d')](_0x5485('0x3f')))['toString']();return _0x4dd2b4;}return db[_0x5485('0x49')]['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5485('0x4a')],'as':_0x5485('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x16f060){var _0x31d504=[];if(_0x16f060){var _0xcbcbb7;for(var _0x349c28=0x0,_0x381435;_0x349c28<_0x16f060[_0x5485('0x16')];_0x349c28+=0x1){_0x381435=_0x16f060[_0x349c28][_0x5485('0x4c')]({'plain':!![]});switch(_0x381435[_0x5485('0x4d')]){case'always':_0x31d504['push'](db[_0x5485('0x4e')][_0x5485('0x4f')](_0x27c125(_0x381435,_0x5485('0x50')))['then'](function(){})[_0x5485('0x2b')](_0x14e4bc()));break;case _0x5485('0x51'):_0x31d504['push'](db['sequelize'][_0x5485('0x4f')](_0x1cb9f7(_0x381435,_0x5485('0x50')))[_0x5485('0x29')](function(){})[_0x5485('0x2b')](_0x14e4bc()));break;default:_0x31d504[_0x5485('0x2a')](db['sequelize']['query'](_0x5009e1(_0x381435,'VoiceQueueId'))['then'](function(){})['catch'](_0x14e4bc()));}}}return _0x31d504;})[_0x5485('0x52')]()['then'](function(){return db[_0x5485('0x49')]['findAll']({'where':{'type':_0x5485('0x53')},'attributes':['id'],'include':[{'model':db[_0x5485('0x4a')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x5485('0x29')](function(_0x4c4a64){var _0x198761=[];if(_0x4c4a64){var _0x265370;for(var _0x426375=0x0,_0x3f8f69;_0x426375<_0x4c4a64[_0x5485('0x16')];_0x426375+=0x1){_0x3f8f69=_0x4c4a64[_0x426375]['get']({'plain':!![]});_0x198761[_0x5485('0x2a')](db[_0x5485('0x4e')][_0x5485('0x4f')](_0x5dc880(_0x3f8f69,_0x5485('0x50')))[_0x5485('0x29')](function(){})[_0x5485('0x2b')](_0x14e4bc()));}}return _0x198761;})[_0x5485('0x52')]();})['then'](function(){return db['Campaign'][_0x5485('0x54')]({'attributes':['id',_0x5485('0x4d')],'include':[{'model':db[_0x5485('0x4a')],'as':_0x5485('0x4b'),'where':{'id':LISTID}}]})[_0x5485('0x29')](function(_0x473f30){var _0x5ca19b=[];if(_0x473f30){for(var _0x1bba4d=0x0,_0x644a5c;_0x1bba4d<_0x473f30[_0x5485('0x16')];_0x1bba4d+=0x1){_0x644a5c=_0x473f30[_0x1bba4d]['get']({'plain':!![]});switch(_0x644a5c[_0x5485('0x4d')]){case _0x5485('0x55'):_0x5ca19b[_0x5485('0x2a')](db[_0x5485('0x4e')][_0x5485('0x4f')](_0x27c125(_0x644a5c,_0x5485('0x56')))[_0x5485('0x29')](function(){})[_0x5485('0x2b')](_0x14e4bc()));break;case'onlyIfOpen':_0x5ca19b['push'](db[_0x5485('0x4e')][_0x5485('0x4f')](_0x1cb9f7(_0x644a5c,_0x5485('0x56')))[_0x5485('0x29')](function(){})[_0x5485('0x2b')](_0x14e4bc()));break;default:_0x5ca19b[_0x5485('0x2a')](db['sequelize'][_0x5485('0x4f')](_0x5009e1(_0x644a5c,'CampaignId'))[_0x5485('0x29')](function(){})[_0x5485('0x2b')](_0x14e4bc()));}}}return _0x5ca19b;})[_0x5485('0x52')]();})[_0x5485('0x29')](function(){return db[_0x5485('0x57')][_0x5485('0x54')]({'attributes':['id'],'include':[{'model':db[_0x5485('0x4a')],'as':_0x5485('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x37045e){var _0x33595c=[];if(_0x37045e){for(var _0x24f642=0x0,_0x2488e9;_0x24f642<_0x37045e[_0x5485('0x16')];_0x24f642+=0x1){_0x2488e9=_0x37045e[_0x24f642]['get']({'plain':!![]});_0x33595c['push'](db[_0x5485('0x4e')]['query'](_0x5dc880(_0x2488e9,_0x5485('0x56')))[_0x5485('0x29')](function(){})[_0x5485('0x2b')](_0x14e4bc()));}}return _0x33595c;})[_0x5485('0x52')]();})[_0x5485('0x2b')](function(_0x1f4198){logger[_0x5485('0x12')](_0x5485('0x59'),_0x5485('0x5a'),_0x1f4198[_0x5485('0x2d')]);});}var processPromises=function(_0x34b1b8){return BPromise[_0x5485('0x52')](promises)[_0x5485('0x29')](function(_0x2cf483){})['catch'](function(_0x306c32){logger[_0x5485('0x12')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x306c32));})[_0x5485('0x5b')](function(){socket['emit'](_0x5485('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x34b1b8){return _0x34b1b8['resume']();}});};var endCsv=function(){return BPromise[_0x5485('0x5d')]()[_0x5485('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x5485('0x29')](function(){socket[_0x5485('0x5e')](_0x5485('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5485('0x5f')](FILEPATH);}catch(_0x5268d9){logger[_0x5485('0x12')](_0x5485('0x60'),JSON[_0x5485('0x61')](_0x5268d9));}finally{process[_0x5485('0x62')](0x0);}});};process['on']('SIGINT',function(){logger[_0x5485('0x63')](_0x5485('0x64'));endCsv();});function main(){return BPromise[_0x5485('0x5d')]()[_0x5485('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5485('0xf')](',');return db['CmContact'][_0x5485('0x54')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x4e2ccf){var _0x412981=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x412981,{'header':!![],'skipEmptyLines':!![],'step':function(_0x467cd4,_0x1f4ebb){total+=0x1;var _0x2df389=total;promises[_0x5485('0x2a')](checkRow(_0x467cd4,_0x4e2ccf,_0x2df389)[_0x5485('0x29')](function(){success+=0x1;})[_0x5485('0x2b')](function(_0x1d63f4){if(_0x1d63f4[_0x5485('0x12')]){errors+=0x1;delete _0x1d63f4[_0x5485('0x12')];}else if(_0x1d63f4[_0x5485('0x25')]){duplicates+=0x1;delete _0x1d63f4[_0x5485('0x25')];}rows['push'](_0x1d63f4);}));if(total%0xc8===0x0){_0x1f4ebb[_0x5485('0x65')]();return processPromises(_0x1f4ebb);}},'complete':function(){return processPromises()[_0x5485('0x29')](function(){logger[_0x5485('0x63')](_0x5485('0x66'));endCsv();});},'error':function(_0x22a78d,_0x473d81){logger[_0x5485('0x63')](_0x5485('0x67'),JSON[_0x5485('0x61')](_0x22a78d));endCsv();}});})[_0x5485('0x2b')](function(_0x1c7930){logger[_0x5485('0x12')](_0x5485('0x68'),JSON[_0x5485('0x61')](_0x1c7930));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index e4b3ebe..88911e2 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 _0xef0d=['cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','updatedAt','fields','.CmListId','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','insert',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','code','query','spread','push','send','start','socket_timestamp','root','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','errors','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','firstName','SystemRow','emit','contact:import:','Abort\x20parser','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()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','unlink','catch','error','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','bluebird','moment','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','priority','UserId','from','cm_contacts','cm_contacts.ListId\x20=\x20'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xef0d,0x1e6));var _0xdef0=function(_0x53a57e,_0x80afd6){_0x53a57e=_0x53a57e-0x0;var _0x5ab05c=_0xef0d[_0x53a57e];return _0x5ab05c;};'use strict';var fs=require('fs');var path=require(_0xdef0('0x0'));var _=require('lodash');var Papa=require(_0xdef0('0x1'));var util=require('util');var BPromise=require(_0xdef0('0x2'));var moment=require(_0xdef0('0x3'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0xdef0('0x4'))['db'];var config=require(_0xdef0('0x5'));var logger=require(_0xdef0('0x6'))(_0xdef0('0x7'));config[_0xdef0('0x8')]=_['defaults'](config[_0xdef0('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xdef0('0x9'))(new Redis(config[_0xdef0('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xdef0('0xa')](_0xdef0('0xb'));function isEmail(_0x170fa4){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x170fa4);}function selectNotIn(_0x5874f3,_0x221e64,_0x5087af,_0x3affc5,_0x33471d){return squel[_0xdef0('0xc')]()[_0xdef0('0xd')](_0xdef0('0xe'))['from'](_0x3affc5)[_0xdef0('0xf')](_0x221e64,null,_0x221e64+_0xdef0('0x10')+_0x3affc5+'.'+_0x5087af)[_0xdef0('0x11')](_0x3affc5+'.'+_0x5087af+_0xdef0('0x12')+_0x5874f3+'.'+_0x5087af)[_0xdef0('0x11')](_0x221e64+_0xdef0('0x13')+_0x33471d[_0xdef0('0xf')]()+')');}function insertCmHopper(_0x1fb7ea,_0xa3a638,_0x385a92,_0x524283,_0x29e054){var _0x1b4c23=['cm_contacts.phone',_0xdef0('0x14'),_0xdef0('0x15'),'cm_contacts.ListId',_0xa3a638+'.'+_0x524283,_0xdef0('0x16'),'cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x29e054+'\x22'];return squel['insert']()[_0xdef0('0x17')](_0xdef0('0x18'))[_0xdef0('0x19')](['phone','scheduledat',_0xdef0('0x1a'),_0xdef0('0x1b'),_0x524283,_0xdef0('0x1c'),'updatedAt',_0xdef0('0x1d'),_0xdef0('0x1e'),'recallme'],squel['select']()['fields'](_0x1b4c23)[_0xdef0('0x1f')](_0xa3a638)[_0xdef0('0xf')](_0xdef0('0x20'),null,_0xdef0('0x21')+_0xa3a638+'.CmListId')[_0xdef0('0xf')](_0x385a92,null,_0x385a92+'.id\x20=\x20'+_0xa3a638+'.'+_0x524283)[_0xdef0('0x11')](_0xa3a638+'.CmListId\x20=\x20?',_0x1fb7ea)[_0xdef0('0x11')](_0xdef0('0x22'),NOW)[_0xdef0('0x11')](_0xdef0('0x23'),selectNotIn(_0xa3a638,_0x385a92,_0x524283,_0xdef0('0x18'),[_0xdef0('0x24'),_0xdef0('0x25')]))[_0xdef0('0x11')](_0xdef0('0x23'),selectNotIn(_0xa3a638,_0x385a92,_0x524283,_0xdef0('0x18'),['\x22always\x22'])))[_0xdef0('0x26')]();}function insertCmHopperBlack(_0x14206a,_0x5644f1,_0x3ca26f,_0x4e7a51){var _0x5c064e=[_0xdef0('0x27'),_0xdef0('0x15'),_0xdef0('0x28'),_0x5644f1+'.'+_0x4e7a51,_0xdef0('0x16'),_0xdef0('0x29')];return squel['insert']()[_0xdef0('0x17')](_0xdef0('0x2a'))['fromQuery']([_0xdef0('0xe'),_0xdef0('0x1a'),'ListId',_0x4e7a51,_0xdef0('0x1c'),_0xdef0('0x2b')],squel[_0xdef0('0xc')]()[_0xdef0('0x2c')](_0x5c064e)[_0xdef0('0x1f')](_0x5644f1)[_0xdef0('0xf')](_0xdef0('0x20'),null,_0xdef0('0x21')+_0x5644f1+_0xdef0('0x2d'))[_0xdef0('0xf')](_0x3ca26f,null,_0x3ca26f+_0xdef0('0x10')+_0x5644f1+'.'+_0x4e7a51)['where'](_0x5644f1+'.CmListId\x20=\x20?',_0x14206a)[_0xdef0('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdef0('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdef0('0xd')](_0xdef0('0xe'))[_0xdef0('0x1f')](_0xdef0('0x2a'))['where'](_0xdef0('0x2e'),_0x14206a)[_0xdef0('0x11')](_0x4e7a51+_0xdef0('0x2f'),_0x5644f1+'.'+_0x4e7a51)))[_0xdef0('0x26')]();}function insertCmContact(_0x28565f,_0x196705,_0x5f004e,_0x492eda){var _0x23b502=_[_0xdef0('0x30')](_[_0xdef0('0x31')](_0x492eda),[_0xdef0('0x1b'),_0xdef0('0x32'),_0xdef0('0x1c'),_0xdef0('0x2b')]);return squel[_0xdef0('0x33')]()['into']('cm_contacts')[_0xdef0('0x19')](_0x23b502,squel[_0xdef0('0xc')]()[_0xdef0('0x2c')](_0x23b502)[_0xdef0('0x1f')](_0x196705)[_0xdef0('0x11')]('('+_0x5f004e['join'](',')+_0xdef0('0x34'),squel[_0xdef0('0xc')]()['fields'](_0x5f004e)[_0xdef0('0x1f')]('cm_contacts')['where'](_0xdef0('0x2e'),_0x28565f))[_0xdef0('0x11')](_0xdef0('0x35'),squel[_0xdef0('0xc')]()['field'](_0xdef0('0x36'),_0xdef0('0x37'))[_0xdef0('0x1f')](_0x196705)[_0xdef0('0x38')](_0x5f004e[_0xdef0('0xf')](','))))[_0xdef0('0x26')]();}function handleStop(){logger[_0xdef0('0x39')](_0xdef0('0x3a'));stopped=!![];}function handleUncaughtException(_0x2c69fb){logger['error'](_0x2c69fb[_0xdef0('0x3b')]);process[_0xdef0('0x3c')](0x1);}function handleError(_0x42c6f9,_0x7cf87c){stats['errors']['push']({'name':_0x7cf87c[_0xdef0('0x3d')],'message':_0x7cf87c[_0xdef0('0x3b')],'row':_0x42c6f9});}function handleQuery(_0x1078c9){logger[_0xdef0('0x39')](_0x1078c9);return db['sequelize'][_0xdef0('0x3e')](_0x1078c9)[_0xdef0('0x3f')](function(_0x465924){results[_0xdef0('0x40')](_0x465924);})['catch'](function(_0x4d38a1){logger['error'](_0x4d38a1['message']);});}function main(_0x582306,_0x3f62a8,_0x3a99f3,_0x50f1ae){logger[_0xdef0('0x39')]('main',_0x582306,JSON['stringify'](_0x3f62a8));process[_0xdef0('0x41')](_0xdef0('0x42'));var _0x1f01f5=_0x3f62a8['binding'];var _0xfe7242=_0x3f62a8[_0xdef0('0x43')];var _0x3cbf13=path[_0xdef0('0xf')](config[_0xdef0('0x44')],'server/files/tmp',_0xfe7242+_0xdef0('0x45'));var _0x216ee4=_[_0xdef0('0x31')](_0x1f01f5)['join']();logger[_0xdef0('0x39')](_0xdef0('0x46'),_0x216ee4);fs[_0xdef0('0x47')](_0x3cbf13,_0x216ee4+'\x0a');Papa[_0xdef0('0x48')](fs[_0xdef0('0x49')](_0x582306),{'header':!![],'skipEmptyLines':!![],'step':function(_0x29e9fd,_0x36133e){try{for(var _0x1240ce=0x0,_0x55e1fa=[];_0x1240ce<_0x29e9fd[_0xdef0('0x4a')][_0xdef0('0x4b')];_0x1240ce++){stats[_0xdef0('0x4c')]+=0x1;if(_0x29e9fd[_0xdef0('0x4d')][_0x1240ce]){handleError(_0x29e9fd[_0xdef0('0x4a')][_0x1240ce],_0x29e9fd[_0xdef0('0x4d')][_0x1240ce]);}else{var _0x4a214b=[];for(var _0x17f92c in _0x1f01f5){if(_0x1f01f5['hasOwnProperty'](_0x17f92c)){if(_0x29e9fd['data'][_0x1240ce][_0x1f01f5[_0x17f92c]]){var _0x5a25db=_['trim'](_0x29e9fd['data'][_0x1240ce][_0x1f01f5[_0x17f92c]][_0xdef0('0x4e')](/"/g,'\x27'));switch(_0x17f92c){case _0xdef0('0x4f'):var _0x2ed124=moment(_0x5a25db,_0xdef0('0xb'),!![]);if(_0x2ed124[_0xdef0('0x50')]()){_0x55e1fa[_0xdef0('0x40')]('\x22'+_0x5a25db+'\x22');}else{_0x4a214b[_0xdef0('0x40')](_0xdef0('0x51'));}break;case _0xdef0('0x1d'):var _0x50a98f=parseInt(_0x5a25db);_0x5a25db=_[_0xdef0('0x52')](_0x50a98f)||_0x50a98f<0x0||_0x50a98f>0x4?_0x50f1ae?0x3:0x2:_0x50a98f;_0x55e1fa['push']('\x22'+_0x5a25db+'\x22');break;case'UserId':var _0x3130b9=parseInt(_0x5a25db);if(_[_0xdef0('0x53')](_0x3130b9)&&_[_0xdef0('0x54')](_0x3a99f3,_0x3130b9)){_0x55e1fa[_0xdef0('0x40')]('\x22'+_0x3130b9+'\x22');}else{_0x4a214b[_0xdef0('0x40')](_0xdef0('0x55'));}break;case _0xdef0('0x56'):if(isEmail(_0x5a25db)){_0x55e1fa['push']('\x22'+_0x5a25db+'\x22');}else{_0x4a214b[_0xdef0('0x40')]('email\x20wrong\x20format');}break;case _0xdef0('0x57'):var _0x5aed94=moment(_0x5a25db,_0xdef0('0x58'),!![]);if(_0x5aed94[_0xdef0('0x50')]()){_0x55e1fa[_0xdef0('0x40')]('\x22'+_0x5a25db+'\x22');}else{_0x4a214b[_0xdef0('0x40')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x55e1fa[_0xdef0('0x40')]('\x22'+_0x5a25db+'\x22');}}else{switch(_0x17f92c){case _0xdef0('0x59'):case'phone':_0x4a214b[_0xdef0('0x40')](_0x17f92c+'\x20not\x20specified');break;default:_0x55e1fa[_0xdef0('0x40')]('\x22\x22');}}}}if(_0x4a214b[_0xdef0('0x4b')]){handleError(_0x29e9fd['data'][_0x1240ce],{'code':_0xdef0('0x5a'),'message':_0x4a214b[_0xdef0('0xf')]()});}else{fs['appendFileSync'](_0x3cbf13,_0x55e1fa[_0xdef0('0xf')]()+'\x0a');}_0x55e1fa=[];}if(!(stats['rows']%0xc8)){socket[_0xdef0('0x5b')](_0xdef0('0x5c')+_0xfe7242,stats);stats['errors']=[];}}if(stopped){logger['info'](_0xdef0('0x5d'));_0x36133e[_0xdef0('0x5e')]();}}catch(_0x58dc1f){handleError(_0x29e9fd[_0xdef0('0x4a')][_0x1240ce],{'code':_0xdef0('0x5f'),'message':_0x58dc1f[_0xdef0('0x3b')]});logger['error'](_0xdef0('0x60'),_0x58dc1f['message']);}},'complete':function(){try{var _0x165492=[];var _0x4f7eec=_0xdef0('0x20');if(_0x3f62a8[_0xdef0('0x61')]&&_0x3f62a8[_0xdef0('0x61')][_0xdef0('0x4b')]){_0x4f7eec=_0xdef0('0x62')+_0xfe7242;_0x165492['push'](_0xdef0('0x63')+_0x4f7eec+_0xdef0('0x64'));}var _0x4d2ae5=util[_0xdef0('0xa')](_0xdef0('0x65'),_0x3cbf13,_0x4f7eec,_0x216ee4,_0x3f62a8[_0xdef0('0x1b')],_0x3f62a8[_0xdef0('0x32')]||null,NOW,NOW);if(_[_0xdef0('0x66')](_0x1f01f5['scheduledat'])){_0x4d2ae5+=_0xdef0('0x67');}_0x165492[_0xdef0('0x40')](_0x4d2ae5);if(_0x3f62a8[_0xdef0('0x61')]&&_0x3f62a8[_0xdef0('0x61')]['length']){_0x165492[_0xdef0('0x40')](insertCmContact(_0x3f62a8[_0xdef0('0x1b')],_0x4f7eec,_0x3f62a8[_0xdef0('0x61')],_0x1f01f5));_0x165492[_0xdef0('0x40')](_0xdef0('0x68')+_0x4f7eec+';');}_0x165492[_0xdef0('0x40')](insertCmHopper(_0x3f62a8[_0xdef0('0x1b')],_0xdef0('0x69'),_0xdef0('0x6a'),_0xdef0('0x6b'),_0x50f1ae));_0x165492['push'](insertCmHopperBlack(_0x3f62a8[_0xdef0('0x1b')],'voice_queues_has_cm_blacklists',_0xdef0('0x6a'),_0xdef0('0x6b')));_0x165492[_0xdef0('0x40')](insertCmHopper(_0x3f62a8[_0xdef0('0x1b')],'campaigns_has_cm_lists','campaigns',_0xdef0('0x6c'),_0x50f1ae));_0x165492[_0xdef0('0x40')](insertCmHopperBlack(_0x3f62a8[_0xdef0('0x1b')],_0xdef0('0x6d'),'campaigns','CampaignId'));BPromise['each'](_0x165492,handleQuery)[_0xdef0('0x6e')](function(_0x2bbd90){stats[_0xdef0('0x6f')]=!![];stats['affectedRows']=_0x3f62a8[_0xdef0('0x61')]&&_0x3f62a8[_0xdef0('0x61')]['length']?results[0x2]['affectedRows']:results[0x0][_0xdef0('0x70')];socket[_0xdef0('0x5b')]('contact:import:'+_0xfe7242,stats);fs[_0xdef0('0x71')](_0x582306);fs[_0xdef0('0x71')](_0x3cbf13);process[_0xdef0('0x3c')](0x0);})[_0xdef0('0x72')](function(_0x4827aa){logger['error'](_0x4827aa[_0xdef0('0x3b')]);process[_0xdef0('0x3c')](0x1);});}catch(_0x49c66a){logger[_0xdef0('0x73')]('complete',_0x49c66a['message']);process['exit'](0x1);}},'error':function(_0x1f3780,_0x215d6f,_0xf05457,_0x4efaa4){throw new Error(_0x4efaa4);}});}function validate(){if(process[_0xdef0('0x74')]&&process[_0xdef0('0x74')][_0xdef0('0x4b')]<0x4){throw new Error(_0xdef0('0x75'));}var _0x32c393=path[_0xdef0('0xf')](config['root'],'server/files/tmp',process[_0xdef0('0x74')][0x2]);if(!fs[_0xdef0('0x76')](_0x32c393)){throw new Error(_0xdef0('0x77'));}var _0x1d0c28={};try{_0x1d0c28=JSON[_0xdef0('0x48')](process[_0xdef0('0x74')][0x3]);if(!_0x1d0c28[_0xdef0('0x78')]){throw new Error(_0xdef0('0x79'));}if(!_0x1d0c28[_0xdef0('0x78')][_0xdef0('0xe')]){throw new Error(_0xdef0('0x7a'));}if(!_0x1d0c28[_0xdef0('0x78')][_0xdef0('0x59')]){throw new Error(_0xdef0('0x7b'));}var _0x24ae54=0x0;if(_0x1d0c28[_0xdef0('0x78')][_0xdef0('0x1e')]){_0x24ae54=0x1;}if(!_0x1d0c28['ListId']){throw new Error(_0xdef0('0x7c'));}}catch(_0x4ec4cc){throw new Error(_0xdef0('0x7d'));}var _0x368922=[];try{_0x368922=_[_0xdef0('0x7e')](JSON[_0xdef0('0x48')](process[_0xdef0('0x74')][0x4]),'id');}catch(_0x61bbeb){logger['info'](_0xdef0('0x7f'));}main(_0x32c393,_0x1d0c28,_0x368922,_0x24ae54);}validate();process['on'](_0xdef0('0x80'),handleStop);process['on'](_0xdef0('0x81'),handleUncaughtException); \ No newline at end of file +var _0x4ff9=['join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','toString','cm_contacts.id','ListId','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','error','exit','errors','code','message','info','sequelize','query','push','catch','main','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','data','hasOwnProperty','trim','replace','isValid','isNaN','UserId','includes','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','length','appendFileSync','rows','contact:import:','Abort\x20parser','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','CompanyId','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','affectedRows','emit','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','bluebird','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20('];(function(_0x13cb09,_0x2516f4){var _0x5a04af=function(_0x37e1f9){while(--_0x37e1f9){_0x13cb09['push'](_0x13cb09['shift']());}};_0x5a04af(++_0x2516f4);}(_0x4ff9,0x17a));var _0x94ff=function(_0x52c2af,_0x671786){_0x52c2af=_0x52c2af-0x0;var _0x1c3d94=_0x4ff9[_0x52c2af];return _0x1c3d94;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x94ff('0x0'));var Papa=require(_0x94ff('0x1'));var util=require('util');var BPromise=require(_0x94ff('0x2'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x94ff('0x3'));var db=require(_0x94ff('0x4'))['db'];var config=require(_0x94ff('0x5'));var logger=require(_0x94ff('0x6'))(_0x94ff('0x7'));config[_0x94ff('0x8')]=_['defaults'](config[_0x94ff('0x8')],{'host':_0x94ff('0x9'),'port':0x18eb});var socket=require(_0x94ff('0xa'))(new Redis(config[_0x94ff('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x94ff('0xb'));function isEmail(_0x24c0d8){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))*$/[_0x94ff('0xc')](_0x24c0d8);}function selectNotIn(_0x15bec9,_0x23261c,_0x5f39d1,_0x3b9e1f,_0x451f87){return squel[_0x94ff('0xd')]()[_0x94ff('0xe')](_0x94ff('0xf'))[_0x94ff('0x10')](_0x3b9e1f)['join'](_0x23261c,null,_0x23261c+_0x94ff('0x11')+_0x3b9e1f+'.'+_0x5f39d1)[_0x94ff('0x12')](_0x3b9e1f+'.'+_0x5f39d1+_0x94ff('0x13')+_0x15bec9+'.'+_0x5f39d1)['where'](_0x23261c+_0x94ff('0x14')+_0x451f87[_0x94ff('0x15')]()+')');}function insertCmHopper(_0x18d164,_0x31040d,_0x3dd851,_0x53134a,_0x46fd7c){var _0xdb4189=[_0x94ff('0x16'),_0x94ff('0x17'),'cm_contacts.id',_0x94ff('0x18'),_0x31040d+'.'+_0x53134a,_0x94ff('0x19'),_0x94ff('0x1a'),'cm_contacts.priority',_0x94ff('0x1b'),'\x22'+_0x46fd7c+'\x22'];return squel[_0x94ff('0x1c')]()[_0x94ff('0x1d')]('cm_hopper')[_0x94ff('0x1e')]([_0x94ff('0xf'),_0x94ff('0x1f'),_0x94ff('0x20'),'ListId',_0x53134a,_0x94ff('0x21'),_0x94ff('0x22'),_0x94ff('0x23'),'UserId',_0x94ff('0x24')],squel[_0x94ff('0xd')]()[_0x94ff('0x25')](_0xdb4189)[_0x94ff('0x10')](_0x31040d)[_0x94ff('0x15')](_0x94ff('0x26'),null,_0x94ff('0x27')+_0x31040d+'.CmListId')[_0x94ff('0x15')](_0x3dd851,null,_0x3dd851+_0x94ff('0x11')+_0x31040d+'.'+_0x53134a)[_0x94ff('0x12')](_0x31040d+_0x94ff('0x28'),_0x18d164)[_0x94ff('0x12')](_0x94ff('0x29'),NOW)[_0x94ff('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x31040d,_0x3dd851,_0x53134a,'cm_hopper',['\x22always\x22',_0x94ff('0x2a')]))[_0x94ff('0x12')](_0x94ff('0x2b'),selectNotIn(_0x31040d,_0x3dd851,_0x53134a,_0x94ff('0x2c'),['\x22always\x22'])))[_0x94ff('0x2d')]();}function insertCmHopperBlack(_0x5842e4,_0x5f5b01,_0x5f30a9,_0x3c713d){var _0x5efbfb=[_0x94ff('0x16'),_0x94ff('0x2e'),'cm_contacts.ListId',_0x5f5b01+'.'+_0x3c713d,_0x94ff('0x19'),_0x94ff('0x1a')];return squel[_0x94ff('0x1c')]()[_0x94ff('0x1d')]('cm_hopper_black')[_0x94ff('0x1e')]([_0x94ff('0xf'),_0x94ff('0x20'),_0x94ff('0x2f'),_0x3c713d,_0x94ff('0x21'),_0x94ff('0x22')],squel[_0x94ff('0xd')]()['fields'](_0x5efbfb)[_0x94ff('0x10')](_0x5f5b01)['join'](_0x94ff('0x26'),null,_0x94ff('0x27')+_0x5f5b01+'.CmListId')[_0x94ff('0x15')](_0x5f30a9,null,_0x5f30a9+'.id\x20=\x20'+_0x5f5b01+'.'+_0x3c713d)[_0x94ff('0x12')](_0x5f5b01+'.CmListId\x20=\x20?',_0x5842e4)[_0x94ff('0x12')](_0x94ff('0x29'),NOW)[_0x94ff('0x12')](_0x94ff('0x2b'),squel[_0x94ff('0xd')]()[_0x94ff('0xe')]('phone')[_0x94ff('0x10')](_0x94ff('0x30'))[_0x94ff('0x12')](_0x94ff('0x31'),_0x5842e4)['where'](_0x3c713d+_0x94ff('0x32'),_0x5f5b01+'.'+_0x3c713d)))[_0x94ff('0x2d')]();}function insertCmContact(_0x13ceef,_0xd46100,_0x2522a8,_0x927c98){var _0x2da2c8=_[_0x94ff('0x33')](_[_0x94ff('0x34')](_0x927c98),[_0x94ff('0x2f'),'CompanyId',_0x94ff('0x21'),_0x94ff('0x22')]);return squel[_0x94ff('0x1c')]()['into']('cm_contacts')[_0x94ff('0x1e')](_0x2da2c8,squel[_0x94ff('0xd')]()[_0x94ff('0x25')](_0x2da2c8)['from'](_0xd46100)[_0x94ff('0x12')]('('+_0x2522a8[_0x94ff('0x15')](',')+_0x94ff('0x35'),squel[_0x94ff('0xd')]()[_0x94ff('0x25')](_0x2522a8)[_0x94ff('0x10')](_0x94ff('0x26'))['where'](_0x94ff('0x31'),_0x13ceef))[_0x94ff('0x12')](_0x94ff('0x36'),squel[_0x94ff('0xd')]()[_0x94ff('0xe')](_0x94ff('0x37'),'min_id')['from'](_0xd46100)[_0x94ff('0x38')](_0x2522a8[_0x94ff('0x15')](','))))[_0x94ff('0x2d')]();}function handleStop(){logger['info'](_0x94ff('0x39'));stopped=!![];}function handleUncaughtException(_0x202f8d){logger[_0x94ff('0x3a')](_0x202f8d['message']);process[_0x94ff('0x3b')](0x1);}function handleError(_0x52734f,_0x36b9a6){stats[_0x94ff('0x3c')]['push']({'name':_0x36b9a6[_0x94ff('0x3d')],'message':_0x36b9a6[_0x94ff('0x3e')],'row':_0x52734f});}function handleQuery(_0x23f9bb){logger[_0x94ff('0x3f')](_0x23f9bb);return db[_0x94ff('0x40')][_0x94ff('0x41')](_0x23f9bb)['spread'](function(_0x28cdb5){results[_0x94ff('0x42')](_0x28cdb5);})[_0x94ff('0x43')](function(_0x4db124){logger['error'](_0x4db124[_0x94ff('0x3e')]);});}function main(_0x32482c,_0x7b94d2,_0x298c9c,_0x2d2b35){logger[_0x94ff('0x3f')](_0x94ff('0x44'),_0x32482c,JSON['stringify'](_0x7b94d2));process['send'](_0x94ff('0x45'));var _0x1c7bba=_0x7b94d2[_0x94ff('0x46')];var _0x512500=_0x7b94d2[_0x94ff('0x47')];var _0x208540=path[_0x94ff('0x15')](config[_0x94ff('0x48')],_0x94ff('0x49'),_0x512500+_0x94ff('0x4a'));var _0x202766=_[_0x94ff('0x34')](_0x1c7bba)[_0x94ff('0x15')]();logger[_0x94ff('0x3f')](_0x94ff('0x4b'),_0x202766);fs[_0x94ff('0x4c')](_0x208540,_0x202766+'\x0a');Papa[_0x94ff('0x4d')](fs['createReadStream'](_0x32482c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x847fc4,_0x10ec26){try{for(var _0x3dfc9e=0x0,_0x236e04=[];_0x3dfc9e<_0x847fc4[_0x94ff('0x4e')]['length'];_0x3dfc9e++){stats['rows']+=0x1;if(_0x847fc4[_0x94ff('0x3c')][_0x3dfc9e]){handleError(_0x847fc4[_0x94ff('0x4e')][_0x3dfc9e],_0x847fc4['errors'][_0x3dfc9e]);}else{var _0x352b5a=[];for(var _0x158ec9 in _0x1c7bba){if(_0x1c7bba[_0x94ff('0x4f')](_0x158ec9)){if(_0x847fc4[_0x94ff('0x4e')][_0x3dfc9e][_0x1c7bba[_0x158ec9]]){var _0x1fb550=_[_0x94ff('0x50')](_0x847fc4[_0x94ff('0x4e')][_0x3dfc9e][_0x1c7bba[_0x158ec9]][_0x94ff('0x51')](/"/g,'\x27'));switch(_0x158ec9){case'scheduledat':var _0x1d9d7a=moment(_0x1fb550,_0x94ff('0xb'),!![]);if(_0x1d9d7a[_0x94ff('0x52')]()){_0x236e04[_0x94ff('0x42')]('\x22'+_0x1fb550+'\x22');}else{_0x352b5a[_0x94ff('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x94ff('0x23'):var _0x539e77=parseInt(_0x1fb550);_0x1fb550=_[_0x94ff('0x53')](_0x539e77)||_0x539e77<0x0||_0x539e77>0x4?_0x2d2b35?0x3:0x2:_0x539e77;_0x236e04['push']('\x22'+_0x1fb550+'\x22');break;case _0x94ff('0x54'):var _0x249d01=parseInt(_0x1fb550);if(_['isNumber'](_0x249d01)&&_[_0x94ff('0x55')](_0x298c9c,_0x249d01)){_0x236e04[_0x94ff('0x42')]('\x22'+_0x249d01+'\x22');}else{_0x352b5a['push']('agent\x20not\x20exists');}break;case _0x94ff('0x56'):if(isEmail(_0x1fb550)){_0x236e04[_0x94ff('0x42')]('\x22'+_0x1fb550+'\x22');}else{_0x352b5a[_0x94ff('0x42')](_0x94ff('0x57'));}break;case _0x94ff('0x58'):var _0xea9672=moment(_0x1fb550,'YYYY-MM-DD',!![]);if(_0xea9672[_0x94ff('0x52')]()){_0x236e04[_0x94ff('0x42')]('\x22'+_0x1fb550+'\x22');}else{_0x352b5a[_0x94ff('0x42')](_0x94ff('0x59'));}break;default:_0x236e04[_0x94ff('0x42')]('\x22'+_0x1fb550+'\x22');}}else{switch(_0x158ec9){case'firstName':case _0x94ff('0xf'):_0x352b5a[_0x94ff('0x42')](_0x158ec9+_0x94ff('0x5a'));break;default:_0x236e04[_0x94ff('0x42')]('\x22\x22');}}}}if(_0x352b5a[_0x94ff('0x5b')]){handleError(_0x847fc4['data'][_0x3dfc9e],{'code':'SystemRow','message':_0x352b5a[_0x94ff('0x15')]()});}else{fs[_0x94ff('0x5c')](_0x208540,_0x236e04[_0x94ff('0x15')]()+'\x0a');}_0x236e04=[];}if(!(stats[_0x94ff('0x5d')]%0xc8)){socket['emit'](_0x94ff('0x5e')+_0x512500,stats);stats[_0x94ff('0x3c')]=[];}}if(stopped){logger[_0x94ff('0x3f')](_0x94ff('0x5f'));_0x10ec26[_0x94ff('0x60')]();}}catch(_0x493a04){handleError(_0x847fc4[_0x94ff('0x4e')][_0x3dfc9e],{'code':_0x94ff('0x61'),'message':_0x493a04[_0x94ff('0x3e')]});logger[_0x94ff('0x3a')](_0x94ff('0x62'),_0x493a04['message']);}},'complete':function(){try{var _0x463867=[];var _0xc851b9='cm_contacts';if(_0x7b94d2['duplicates']&&_0x7b94d2[_0x94ff('0x63')]['length']){_0xc851b9=_0x94ff('0x64')+_0x512500;_0x463867['push'](_0x94ff('0x65')+_0xc851b9+_0x94ff('0x66'));}var _0x5649e4=util['format'](_0x94ff('0x67'),_0x208540,_0xc851b9,_0x202766,_0x7b94d2[_0x94ff('0x2f')],_0x7b94d2[_0x94ff('0x68')]||null,NOW,NOW);if(_[_0x94ff('0x69')](_0x1c7bba[_0x94ff('0x1f')])){_0x5649e4+=_0x94ff('0x6a');}_0x463867['push'](_0x5649e4);if(_0x7b94d2[_0x94ff('0x63')]&&_0x7b94d2[_0x94ff('0x63')][_0x94ff('0x5b')]){_0x463867[_0x94ff('0x42')](insertCmContact(_0x7b94d2['ListId'],_0xc851b9,_0x7b94d2[_0x94ff('0x63')],_0x1c7bba));_0x463867['push'](_0x94ff('0x6b')+_0xc851b9+';');}_0x463867[_0x94ff('0x42')](insertCmHopper(_0x7b94d2['ListId'],_0x94ff('0x6c'),_0x94ff('0x6d'),'VoiceQueueId',_0x2d2b35));_0x463867[_0x94ff('0x42')](insertCmHopperBlack(_0x7b94d2[_0x94ff('0x2f')],_0x94ff('0x6e'),_0x94ff('0x6d'),_0x94ff('0x6f')));_0x463867[_0x94ff('0x42')](insertCmHopper(_0x7b94d2[_0x94ff('0x2f')],'campaigns_has_cm_lists',_0x94ff('0x70'),_0x94ff('0x71'),_0x2d2b35));_0x463867[_0x94ff('0x42')](insertCmHopperBlack(_0x7b94d2[_0x94ff('0x2f')],_0x94ff('0x72'),_0x94ff('0x70'),_0x94ff('0x71')));BPromise[_0x94ff('0x73')](_0x463867,handleQuery)[_0x94ff('0x74')](function(_0x3830d6){stats['finish']=!![];stats['affectedRows']=_0x7b94d2[_0x94ff('0x63')]&&_0x7b94d2['duplicates'][_0x94ff('0x5b')]?results[0x2][_0x94ff('0x75')]:results[0x0]['affectedRows'];socket[_0x94ff('0x76')](_0x94ff('0x5e')+_0x512500,stats);fs[_0x94ff('0x77')](_0x32482c);fs[_0x94ff('0x77')](_0x208540);process[_0x94ff('0x3b')](0x0);})[_0x94ff('0x43')](function(_0x2bcfe1){logger[_0x94ff('0x3a')](_0x2bcfe1[_0x94ff('0x3e')]);process['exit'](0x1);});}catch(_0x19ec2a){logger[_0x94ff('0x3a')](_0x94ff('0x78'),_0x19ec2a[_0x94ff('0x3e')]);process['exit'](0x1);}},'error':function(_0x1350a3,_0x45760f,_0x1db896,_0x5cf331){throw new Error(_0x5cf331);}});}function validate(){if(process[_0x94ff('0x79')]&&process[_0x94ff('0x79')][_0x94ff('0x5b')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x305d12=path[_0x94ff('0x15')](config['root'],'server/files/tmp',process[_0x94ff('0x79')][0x2]);if(!fs[_0x94ff('0x7a')](_0x305d12)){throw new Error(_0x94ff('0x7b'));}var _0x59094c={};try{_0x59094c=JSON[_0x94ff('0x4d')](process[_0x94ff('0x79')][0x3]);if(!_0x59094c[_0x94ff('0x46')]){throw new Error(_0x94ff('0x7c'));}if(!_0x59094c['binding']['phone']){throw new Error(_0x94ff('0x7d'));}if(!_0x59094c[_0x94ff('0x46')][_0x94ff('0x7e')]){throw new Error(_0x94ff('0x7f'));}var _0x2f8519=0x0;if(_0x59094c['binding']['UserId']){_0x2f8519=0x1;}if(!_0x59094c[_0x94ff('0x2f')]){throw new Error(_0x94ff('0x80'));}}catch(_0x4b17cb){throw new Error(_0x94ff('0x81'));}var _0x353046=[];try{_0x353046=_[_0x94ff('0x82')](JSON[_0x94ff('0x4d')](process['argv'][0x4]),'id');}catch(_0xfdeb81){logger[_0x94ff('0x3f')](_0x94ff('0x83'));}main(_0x305d12,_0x59094c,_0x353046,_0x2f8519);}validate();process['on'](_0x94ff('0x84'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 1b988bd..15be401 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(_0x3fbe8d,_0x5d5927){var _0x698fec=function(_0x31c38a){while(--_0x31c38a){_0x3fbe8d['push'](_0x3fbe8d['shift']());}};_0x698fec(++_0x5d5927);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'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 _0x2ef3=['destexten','queue','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','agentcalledAt','Agent\x20Connect','Agent\x20Complete','Hold\x20Time','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','membername','uniqueid','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Call\x20To'];(function(_0x5c839c,_0x28bfa2){var _0x7f5c4=function(_0x576b0c){while(--_0x576b0c){_0x5c839c['push'](_0x5c839c['shift']());}};_0x7f5c4(++_0x28bfa2);}(_0x2ef3,0xba));var _0x32ef=function(_0x44d8b8,_0x176816){_0x44d8b8=_0x44d8b8-0x0;var _0x591067=_0x2ef3[_0x44d8b8];return _0x591067;};'use strict';exports[_0x32ef('0x0')]=function(_0x11c049,_0x47513a){var _0x26e56e=[{'type':_0x32ef('0x1'),'content':_0x32ef('0x2'),'variableName':null}];switch(_0x11c049['toLowerCase']()){case _0x32ef('0x3'):switch(_0x47513a[_0x32ef('0x4')]()){case'inbound':_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x6'),'content':'','variableName':'queue'});_0x26e56e['push']({'type':_0x32ef('0x6'),'content':'','variableName':_0x32ef('0x7')});break;case _0x32ef('0x8'):_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x1'),'content':_0x32ef('0x9'),'variableName':null});_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x6'),'content':'','variableName':_0x32ef('0xa')});break;}}return _0x26e56e;};exports[_0x32ef('0xb')]=function(_0x56eb42,_0x5780e9){var _0x401d0b=[];switch(_0x56eb42[_0x32ef('0x4')]()){case _0x32ef('0x3'):switch(_0x5780e9[_0x32ef('0x4')]()){case'inbound':_0x401d0b=[{'type':_0x32ef('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x32ef('0x6'),'variableName':'calleridname'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0xd'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0xe')},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':_0x32ef('0xf')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x10'),'keyType':'variable','variableName':'uniqueid'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x11'),'keyType':_0x32ef('0x6'),'variableName':'agentcalledAt'},{'type':_0x32ef('0x1'),'content':_0x32ef('0x12'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x32ef('0x13'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x14')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x15'),'keyType':_0x32ef('0x6'),'variableName':'destcalleridnum'},{'type':_0x32ef('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x16'),'keyType':'variable','variableName':_0x32ef('0x17')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x18'),'keyType':'variable','variableName':'agentconnectAt'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x19'),'keyType':_0x32ef('0x6'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0x32ef('0x1a'),'keyType':'variable','variableName':'holdtime'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x1b'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x1c')}];break;case _0x32ef('0x8'):_0x401d0b=[{'type':_0x32ef('0x1'),'content':_0x32ef('0x1d'),'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x1e'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0xa')},{'type':_0x32ef('0xc'),'content':'','key':'Member\x20Name','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x1f')},{'type':'keyValue','content':'','key':_0x32ef('0x10'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x20')},{'type':_0x32ef('0xc'),'content':'','key':'Date','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x21')},{'type':_0x32ef('0x1'),'content':_0x32ef('0x22')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x23'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0x32ef('0xc'),'content':'','key':'Complete\x20Time','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x24')},{'type':'keyValue','content':'','key':_0x32ef('0x25'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x26')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x27'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x401d0b;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 15fcb76..abd26c2 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 _0x8e51=['html','phone','fax','mobile','lodash','../../mysqldb','openchannel-interactions','../../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','stringify','Interaction','findOne','then','update','info','catch','tracked','user','query','clone','body','omit'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0x8e51,0x1e4));var _0x18e5=function(_0x31b3f6,_0x501116){_0x31b3f6=_0x31b3f6-0x0;var _0x2dd8ae=_0x8e51[_0x31b3f6];return _0x2dd8ae;};'use strict';var _=require(_0x18e5('0x0'));var db=require(_0x18e5('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x18e5('0x2')),'mail':require(_0x18e5('0x3'))(_0x18e5('0x4')),'fax':require('../../config/logger')(_0x18e5('0x5')),'sms':require(_0x18e5('0x3'))(_0x18e5('0x6')),'chat':require(_0x18e5('0x3'))(_0x18e5('0x7'))};function getInteractionId(_0x303a9e,_0x13001a,_0x493f00){if(_0x303a9e&&_0x303a9e[_[_0x18e5('0x8')](_0x493f00)+_0x18e5('0x9')]){return _0x303a9e[_['upperFirst'](_0x493f00)+_0x18e5('0x9')];}else if(_0x303a9e&&_0x303a9e['id']){return _0x303a9e['id'];}else if(_0x13001a&&_0x13001a['id']){return _0x13001a['id'];}else{return _0x18e5('0xa');}}function log(_0x5d563e,_0x33b37b,_0x44e6e9,_0x2c162f,_0xb3608f,_0x557fac){loggers[_0xb3608f[_0x18e5('0xb')]()][_0x5d563e](_0x18e5('0xc'),_0x557fac['toUpperCase'](),_0x33b37b?_0x33b37b['id']:null,_0x33b37b?_0x33b37b[_0x18e5('0xd')]:null,_0x33b37b?_0x33b37b[_0x18e5('0xe')]:null,getInteractionId(_0x44e6e9,_0x2c162f,_0xb3608f),_0x44e6e9?JSON[_0x18e5('0xf')](_0x44e6e9):'null');}function updateUser(_0x202863,_0x303f63,_0x100dd2,_0x315b4b,_0x598ce6){db[_['upperFirst'](_0x315b4b)+_0x18e5('0x10')][_0x18e5('0x11')]({'where':{'id':getInteractionId(_0x303f63,_0x100dd2,_0x315b4b)}})[_0x18e5('0x12')](function(_0x251e0d){if(_0x251e0d){return _0x251e0d[_0x18e5('0x13')]({'UserId':_0x202863?_0x202863['id']:null});}})[_0x18e5('0x12')](function(_0x526eca){if(_0x526eca){log(_0x18e5('0x14'),_0x202863,_0x303f63,_0x100dd2,_0x315b4b,_0x598ce6);}})[_0x18e5('0x15')](function(){log('error',_0x202863,_0x303f63,_0x100dd2,_0x315b4b,_0x598ce6);});}exports[_0x18e5('0x16')]=function(_0x8a730c,_0x5475eb){return function(_0x34de2e,_0x1961ea,_0x12c082){var _0x549ff6=_0x34de2e[_0x18e5('0x17')];var _0x22d5c1={};var _0x574c52=_0x34de2e[_0x18e5('0x18')];if(_0x22d5c1){_0x22d5c1=_[_0x18e5('0x19')](_0x34de2e[_0x18e5('0x1a')]);_0x22d5c1=_[_0x18e5('0x1b')](_0x22d5c1,['body',_0x18e5('0x1c'),_0x18e5('0x1d'),_0x18e5('0x1e'),_0x18e5('0x1f')]);}updateUser(_0x549ff6,_0x22d5c1,_0x574c52,_0x8a730c,_0x5475eb);_0x12c082(null);};}; \ No newline at end of file +var _0x5bf2=['clone','omit','body','html','phone','fax','mobile','lodash','../../config/logger','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','Interaction','then','error','tracked','query'];(function(_0x16eef1,_0x156972){var _0x3f627d=function(_0x1cd878){while(--_0x1cd878){_0x16eef1['push'](_0x16eef1['shift']());}};_0x3f627d(++_0x156972);}(_0x5bf2,0x157));var _0x25bf=function(_0xfc6d0c,_0x1651f5){_0xfc6d0c=_0xfc6d0c-0x0;var _0x1df61a=_0x5bf2[_0xfc6d0c];return _0x1df61a;};'use strict';var _=require(_0x25bf('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x25bf('0x1'))('openchannel-interactions'),'mail':require(_0x25bf('0x1'))(_0x25bf('0x2')),'fax':require(_0x25bf('0x1'))(_0x25bf('0x3')),'sms':require(_0x25bf('0x1'))('sms-interactions'),'chat':require(_0x25bf('0x1'))(_0x25bf('0x4'))};function getInteractionId(_0x5e2916,_0x1bf99e,_0x28fed5){if(_0x5e2916&&_0x5e2916[_[_0x25bf('0x5')](_0x28fed5)+'InteractionId']){return _0x5e2916[_[_0x25bf('0x5')](_0x28fed5)+_0x25bf('0x6')];}else if(_0x5e2916&&_0x5e2916['id']){return _0x5e2916['id'];}else if(_0x1bf99e&&_0x1bf99e['id']){return _0x1bf99e['id'];}else{return _0x25bf('0x7');}}function log(_0x8dbe09,_0x314724,_0x2328e2,_0x4d4389,_0x153a0d,_0x3ff54d){loggers[_0x153a0d['toLowerCase']()][_0x8dbe09](_0x25bf('0x8'),_0x3ff54d['toUpperCase'](),_0x314724?_0x314724['id']:null,_0x314724?_0x314724['name']:null,_0x314724?_0x314724[_0x25bf('0x9')]:null,getInteractionId(_0x2328e2,_0x4d4389,_0x153a0d),_0x2328e2?JSON[_0x25bf('0xa')](_0x2328e2):_0x25bf('0xb'));}function updateUser(_0x436afc,_0x266bad,_0xcaec5d,_0x4d38e8,_0x335315){db[_[_0x25bf('0x5')](_0x4d38e8)+_0x25bf('0xc')]['findOne']({'where':{'id':getInteractionId(_0x266bad,_0xcaec5d,_0x4d38e8)}})[_0x25bf('0xd')](function(_0x51f0ce){if(_0x51f0ce){return _0x51f0ce['update']({'UserId':_0x436afc?_0x436afc['id']:null});}})[_0x25bf('0xd')](function(_0x339795){if(_0x339795){log('info',_0x436afc,_0x266bad,_0xcaec5d,_0x4d38e8,_0x335315);}})['catch'](function(){log(_0x25bf('0xe'),_0x436afc,_0x266bad,_0xcaec5d,_0x4d38e8,_0x335315);});}exports[_0x25bf('0xf')]=function(_0x194139,_0x2fe139){return function(_0x17b559,_0x5fede0,_0x5718b7){var _0x276282=_0x17b559['user'];var _0x3910a4={};var _0x56e062=_0x17b559[_0x25bf('0x10')];if(_0x3910a4){_0x3910a4=_[_0x25bf('0x11')](_0x17b559['body']);_0x3910a4=_[_0x25bf('0x12')](_0x3910a4,[_0x25bf('0x13'),_0x25bf('0x14'),_0x25bf('0x15'),_0x25bf('0x16'),_0x25bf('0x17')]);}updateUser(_0x276282,_0x3910a4,_0x56e062,_0x194139,_0x2fe139);_0x5718b7(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index eb1e993..f58866a 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 _0x2a2b=['format','%s:%s:%s','update','base64','utf8','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr'];(function(_0x30bef2,_0x3d4186){var _0x567d67=function(_0x1acf17){while(--_0x1acf17){_0x30bef2['push'](_0x30bef2['shift']());}};_0x567d67(++_0x3d4186);}(_0x2a2b,0x1de));var _0xb2a2=function(_0x40ba1a,_0x5be2a2){_0x40ba1a=_0x40ba1a-0x0;var _0x1aadee=_0x2a2b[_0x40ba1a];return _0x1aadee;};'use strict';var crypto=require(_0xb2a2('0x0'));var util=require(_0xb2a2('0x1'));var compose=require('composable-middleware');var db=require(_0xb2a2('0x2'))['db'];var config=require(_0xb2a2('0x3'));function getValueFromLicense(_0x17cf23,_0x5a64a6){if(_0x17cf23&&_0x5a64a6){if(_0x5a64a6['data1']&&_0x5a64a6['license']){var _0x3df588=_0x5a64a6[_0xb2a2('0x4')];var _0x1637be=_0x5a64a6[_0xb2a2('0x5')];var _0x3db166=_0x3df588[_0xb2a2('0x6')]('-')[0x4];var _0x2d0168=_0x3df588['split']('-')[0x0];var _0x10ca5e=crypto['createDecipher'](_0xb2a2('0x7'),util[_0xb2a2('0x8')](_0xb2a2('0x9'),_0x3db166,_0x3df588,_0x2d0168));var _0x140d44=_0x10ca5e[_0xb2a2('0xa')](_0x1637be,_0xb2a2('0xb'),_0xb2a2('0xc'));_0x140d44+=_0x10ca5e['final'](_0xb2a2('0xc'));var _0x3a500c=JSON[_0xb2a2('0xd')](_0x140d44);return _0x3a500c['hasOwnProperty'](_0x17cf23)?_0x3a500c[_0x17cf23]:null;}}return null;}function isLimit(_0x348841,_0x2c9170,_0x202159,_0x596cee){var _0x52164b=_0x2c9170;return compose()[_0xb2a2('0xe')](function(_0x205f9d,_0x95aab0,_0x2b79b7){return db[_0xb2a2('0xf')][_0xb2a2('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xb2a2('0x11')](function(_0x477ea5){var _0x49542a=getValueFromLicense(_0x348841,_0x477ea5);return _0x49542a?_0x49542a:_0x52164b;})[_0xb2a2('0x11')](function(_0x1785aa){_0x52164b=_0x1785aa;return _0x202159[_0xb2a2('0x12')](_0x596cee);})[_0xb2a2('0x11')](function(_0x32025b){if(_0x32025b>=_0x52164b){return _0x95aab0[_0xb2a2('0x13')](0x193)[_0xb2a2('0x14')]({'message':util[_0xb2a2('0x8')](_0xb2a2('0x15'),_0x348841)});}_0x2b79b7();})[_0xb2a2('0x16')](function(_0x17b76d){_0x2b79b7(_0x17b76d);});});}function isUserLimit(){return isLimit(_0xb2a2('0x17'),0x1,db[_0xb2a2('0x18')],{'where':{'$or':[{'role':_0xb2a2('0x19')},{'role':_0xb2a2('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x4fdd=['findOne','then','count','status','json','users','admin','user','isUserLimit','util','composable-middleware','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','License'];(function(_0x32ff12,_0x32d687){var _0x1f6acc=function(_0x5808e8){while(--_0x5808e8){_0x32ff12['push'](_0x32ff12['shift']());}};_0x1f6acc(++_0x32d687);}(_0x4fdd,0x17f));var _0xd4fd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4fdd[_0x502c7d];return _0x30b7ed;};'use strict';var crypto=require('crypto');var util=require(_0xd4fd('0x0'));var compose=require(_0xd4fd('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x15235c,_0x3e2775){if(_0x15235c&&_0x3e2775){if(_0x3e2775[_0xd4fd('0x2')]&&_0x3e2775[_0xd4fd('0x3')]){var _0x2f254d=_0x3e2775[_0xd4fd('0x2')];var _0x44f53=_0x3e2775[_0xd4fd('0x3')];var _0x1873d3=_0x2f254d[_0xd4fd('0x4')]('-')[0x4];var _0xb379ab=_0x2f254d[_0xd4fd('0x4')]('-')[0x0];var _0x52970e=crypto[_0xd4fd('0x5')](_0xd4fd('0x6'),util[_0xd4fd('0x7')](_0xd4fd('0x8'),_0x1873d3,_0x2f254d,_0xb379ab));var _0x4ee550=_0x52970e[_0xd4fd('0x9')](_0x44f53,'base64',_0xd4fd('0xa'));_0x4ee550+=_0x52970e[_0xd4fd('0xb')](_0xd4fd('0xa'));var _0x5c51c9=JSON['parse'](_0x4ee550);return _0x5c51c9['hasOwnProperty'](_0x15235c)?_0x5c51c9[_0x15235c]:null;}}return null;}function isLimit(_0x4dbd38,_0x503011,_0x38b338,_0x3d52f1){var _0x571e3a=_0x503011;return compose()['use'](function(_0x27bb74,_0x199a3b,_0x4e0fbb){return db[_0xd4fd('0xc')][_0xd4fd('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x33b200){var _0x27e001=getValueFromLicense(_0x4dbd38,_0x33b200);return _0x27e001?_0x27e001:_0x571e3a;})[_0xd4fd('0xe')](function(_0x1511f0){_0x571e3a=_0x1511f0;return _0x38b338[_0xd4fd('0xf')](_0x3d52f1);})[_0xd4fd('0xe')](function(_0x379bc0){if(_0x379bc0>=_0x571e3a){return _0x199a3b[_0xd4fd('0x10')](0x193)[_0xd4fd('0x11')]({'message':util[_0xd4fd('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4dbd38)});}_0x4e0fbb();})['catch'](function(_0x4010f8){_0x4e0fbb(_0x4010f8);});});}function isUserLimit(){return isLimit(_0xd4fd('0x12'),0x1,db['User'],{'where':{'$or':[{'role':_0xd4fd('0x13')},{'role':_0xd4fd('0x14')}]}});}exports[_0xd4fd('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 6f0f106..7abbb44 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 _0xd6d6=['col','ASC','omit','isObject','isString','length','unset','hasOwnProperty','lodash','sequelize','fields','split','filters','isEmpty','forOwn','isArray','parse','limit','offset','map','indexOf','priority','unsigned','substr','DESC','cast'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5ef4f7,_0x49208c){_0x5ef4f7=_0x5ef4f7-0x0;var _0x55b3b6=_0xd6d6[_0x5ef4f7];return _0x55b3b6;};'use strict';var _=require(_0x6d6d('0x0'));var sequelize=require(_0x6d6d('0x1'));var LIMIT_VALUE=0xfa;exports[_0x6d6d('0x2')]=function(_0x33226e){var _0x536523=null;if(_0x33226e){_0x536523=_0x33226e[_0x6d6d('0x3')](',');}return _0x536523;};exports[_0x6d6d('0x4')]=function(_0x1b8610){var _0x2a838a={};if(!_[_0x6d6d('0x5')](_0x1b8610)){_0x2a838a={};_[_0x6d6d('0x6')](_0x1b8610,function(_0x35a813,_0x5702dc){try{_0x2a838a[_0x5702dc]=_[_0x6d6d('0x7')](_0x35a813)?_0x35a813:JSON[_0x6d6d('0x8')](_0x35a813);}catch(_0x44f83d){_0x2a838a[_0x5702dc]=_0x35a813[_0x6d6d('0x3')](',');}});}return _0x2a838a;};exports[_0x6d6d('0x9')]=function(_0x408f88){_0x408f88=parseInt(_0x408f88,0xa);if(!_0x408f88||_0x408f88<0x0){_0x408f88=LIMIT_VALUE;}return _0x408f88;};exports[_0x6d6d('0xa')]=function(_0x51585f){_0x51585f=parseInt(_0x51585f,0xa);if(!_0x51585f||_0x51585f<0x0){_0x51585f=0x0;}return _0x51585f;};exports['sort']=function(_0x404c88){var _0x1fa46d,_0x23b18a=null;if(_0x404c88){_0x1fa46d=_0x404c88[_0x6d6d('0x3')](',');_0x23b18a=_[_0x6d6d('0xb')](_0x1fa46d,function(_0x576c88){if(_0x576c88[_0x6d6d('0xc')]('-')===0x0){return[_0x576c88===_0x6d6d('0xd')?sequelize['cast'](sequelize['col'](_0x6d6d('0xd')),_0x6d6d('0xe')):_0x576c88[_0x6d6d('0xf')](0x1),_0x6d6d('0x10')];}else{return[_0x576c88===_0x6d6d('0xd')?sequelize[_0x6d6d('0x11')](sequelize[_0x6d6d('0x12')](_0x6d6d('0xd')),'unsigned'):_0x576c88,_0x6d6d('0x13')];}});}return _0x23b18a;};exports[_0x6d6d('0x14')]=function(_0x1f2aac,_0xa3b05d){if(_[_0x6d6d('0x5')](_0x1f2aac)){return _0x1f2aac;}if(_['isArray'](_0x1f2aac)){for(var _0x2e6fdb=0x0;_0x2e6fdb<_0x1f2aac['length'];_0x2e6fdb+=0x1){_0x1f2aac[_0x2e6fdb]=this[_0x6d6d('0x14')](_0x1f2aac[_0x2e6fdb],_0xa3b05d);}return _0x1f2aac;}if(!_[_0x6d6d('0x15')](_0x1f2aac)){return _0x1f2aac;}if(_[_0x6d6d('0x16')](_0xa3b05d)){_0xa3b05d=[_0xa3b05d];}if(!_['isArray'](_0xa3b05d)){return _0x1f2aac;}for(var _0x499c2e=0x0;_0x499c2e<_0xa3b05d[_0x6d6d('0x17')];_0x499c2e+=0x1){_[_0x6d6d('0x18')](_0x1f2aac,_0xa3b05d[_0x499c2e]);}for(var _0x2b59d4 in _0x1f2aac){if(_0x1f2aac[_0x6d6d('0x19')](_0x2b59d4)){_0x1f2aac[_0x2b59d4]=this['omit'](_0x1f2aac[_0x2b59d4],_0xa3b05d);}}return _0x1f2aac;}; \ No newline at end of file +var _0xcb91=['ASC','omit','isEmpty','length','isObject','isString','hasOwnProperty','fields','split','forOwn','isArray','parse','limit','offset','map','indexOf','priority','cast','col'];(function(_0x110a71,_0x4a6bd2){var _0x4a08dc=function(_0x3bfa33){while(--_0x3bfa33){_0x110a71['push'](_0x110a71['shift']());}};_0x4a08dc(++_0x4a6bd2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xcb91[_0x67f95e];return _0x538f5a;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0x1cb9('0x0')]=function(_0xe4a5bf){var _0x17d4ec=null;if(_0xe4a5bf){_0x17d4ec=_0xe4a5bf[_0x1cb9('0x1')](',');}return _0x17d4ec;};exports['filters']=function(_0x8c392f){var _0x2c17b8={};if(!_['isEmpty'](_0x8c392f)){_0x2c17b8={};_[_0x1cb9('0x2')](_0x8c392f,function(_0x1b26cd,_0x53ffbd){try{_0x2c17b8[_0x53ffbd]=_[_0x1cb9('0x3')](_0x1b26cd)?_0x1b26cd:JSON[_0x1cb9('0x4')](_0x1b26cd);}catch(_0x4ffe20){_0x2c17b8[_0x53ffbd]=_0x1b26cd[_0x1cb9('0x1')](',');}});}return _0x2c17b8;};exports[_0x1cb9('0x5')]=function(_0x59d1be){_0x59d1be=parseInt(_0x59d1be,0xa);if(!_0x59d1be||_0x59d1be<0x0){_0x59d1be=LIMIT_VALUE;}return _0x59d1be;};exports[_0x1cb9('0x6')]=function(_0x5a0e99){_0x5a0e99=parseInt(_0x5a0e99,0xa);if(!_0x5a0e99||_0x5a0e99<0x0){_0x5a0e99=0x0;}return _0x5a0e99;};exports['sort']=function(_0x45a12f){var _0x2fa15c,_0x74ce19=null;if(_0x45a12f){_0x2fa15c=_0x45a12f[_0x1cb9('0x1')](',');_0x74ce19=_[_0x1cb9('0x7')](_0x2fa15c,function(_0x50ce71){if(_0x50ce71[_0x1cb9('0x8')]('-')===0x0){return[_0x50ce71===_0x1cb9('0x9')?sequelize[_0x1cb9('0xa')](sequelize[_0x1cb9('0xb')](_0x1cb9('0x9')),'unsigned'):_0x50ce71['substr'](0x1),'DESC'];}else{return[_0x50ce71===_0x1cb9('0x9')?sequelize[_0x1cb9('0xa')](sequelize[_0x1cb9('0xb')](_0x1cb9('0x9')),'unsigned'):_0x50ce71,_0x1cb9('0xc')];}});}return _0x74ce19;};exports[_0x1cb9('0xd')]=function(_0x1b3cd7,_0x8dfa55){if(_[_0x1cb9('0xe')](_0x1b3cd7)){return _0x1b3cd7;}if(_['isArray'](_0x1b3cd7)){for(var _0x5572cb=0x0;_0x5572cb<_0x1b3cd7[_0x1cb9('0xf')];_0x5572cb+=0x1){_0x1b3cd7[_0x5572cb]=this[_0x1cb9('0xd')](_0x1b3cd7[_0x5572cb],_0x8dfa55);}return _0x1b3cd7;}if(!_[_0x1cb9('0x10')](_0x1b3cd7)){return _0x1b3cd7;}if(_[_0x1cb9('0x11')](_0x8dfa55)){_0x8dfa55=[_0x8dfa55];}if(!_[_0x1cb9('0x3')](_0x8dfa55)){return _0x1b3cd7;}for(var _0xf22920=0x0;_0xf22920<_0x8dfa55[_0x1cb9('0xf')];_0xf22920+=0x1){_['unset'](_0x1b3cd7,_0x8dfa55[_0xf22920]);}for(var _0x479d43 in _0x1b3cd7){if(_0x1b3cd7[_0x1cb9('0x12')](_0x479d43)){_0x1b3cd7[_0x479d43]=this[_0x1cb9('0xd')](_0x1b3cd7[_0x479d43],_0x8dfa55);}}return _0x1b3cd7;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c9d05c2..255433e 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_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 +var _0xedd9=['errorhandler','path','passport','cors','./environment','../mysqldb','default','get','production','use','join','root','favicon.ico','appPath','public','development','client','set','json\x20replacer','toISOString','split','static','views','/server/views','html','renderFile','50mb','initialize','serve-favicon','body-parser','method-override','cookie-parser'];(function(_0x179362,_0xeaaf23){var _0x3fa9fc=function(_0xef0f57){while(--_0xef0f57){_0x179362['push'](_0x179362['shift']());}};_0x3fa9fc(++_0xeaaf23);}(_0xedd9,0xfc));var _0x9edd=function(_0x1312f9,_0x38b964){_0x1312f9=_0x1312f9-0x0;var _0x3e0d7a=_0xedd9[_0x1312f9];return _0x3e0d7a;};'use strict';var express=require('express');var favicon=require(_0x9edd('0x0'));var bodyParser=require(_0x9edd('0x1'));var methodOverride=require(_0x9edd('0x2'));var cookieParser=require(_0x9edd('0x3'));var errorHandler=require(_0x9edd('0x4'));var path=require(_0x9edd('0x5'));var passport=require(_0x9edd('0x6'));var cors=require(_0x9edd('0x7'));var moment=require('moment');var config=require(_0x9edd('0x8'));var db=require(_0x9edd('0x9'))['db'];exports[_0x9edd('0xa')]=function(_0x34c1a7){var _0x5319f7=_0x34c1a7[_0x9edd('0xb')]('env');if(_0x5319f7===_0x9edd('0xc')){_0x34c1a7[_0x9edd('0xd')](favicon(path[_0x9edd('0xe')](config[_0x9edd('0xf')],'public',_0x9edd('0x10'))));_0x34c1a7['set'](_0x9edd('0x11'),path[_0x9edd('0xe')](config['root'],_0x9edd('0x12')));}if(_0x5319f7===_0x9edd('0x13')||_0x5319f7==='test'){_0x34c1a7[_0x9edd('0xd')](favicon(path[_0x9edd('0xe')](config[_0x9edd('0xf')],_0x9edd('0x14'),_0x9edd('0x10'))));_0x34c1a7[_0x9edd('0x15')](_0x9edd('0x11'),path[_0x9edd('0xe')](config['root'],_0x9edd('0x14')));_0x34c1a7[_0x9edd('0xd')](errorHandler());}_0x34c1a7[_0x9edd('0x15')](_0x9edd('0x16'),function(_0x13b6b6,_0x338f3c){if(this[_0x13b6b6]instanceof Date){_0x338f3c=this[_0x13b6b6][_0x9edd('0x17')]()[_0x9edd('0x18')]('.')[0x0]+'Z';}return _0x338f3c;});_0x34c1a7['use'](express[_0x9edd('0x19')](_0x34c1a7[_0x9edd('0xb')](_0x9edd('0x11'))));_0x34c1a7['set'](_0x9edd('0x1a'),config[_0x9edd('0xf')]+_0x9edd('0x1b'));_0x34c1a7['engine'](_0x9edd('0x1c'),require('ejs')[_0x9edd('0x1d')]);_0x34c1a7[_0x9edd('0x15')]('view\x20engine','html');_0x34c1a7[_0x9edd('0xd')](bodyParser['urlencoded']({'limit':_0x9edd('0x1e'),'extended':!![]}));_0x34c1a7['use'](bodyParser['json']({'limit':_0x9edd('0x1e')}));_0x34c1a7[_0x9edd('0xd')](cors());_0x34c1a7['use'](methodOverride());_0x34c1a7['use'](cookieParser());_0x34c1a7[_0x9edd('0xd')](passport[_0x9edd('0x1f')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index d3fa2a4..24155d4 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 _0x94af=['getUuid','win32','utf8','hostname','macAddress','ipAddress','update','hex','substring','lodash','bimedia-machine-uuid','execSync','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','digest'];(function(_0x4dfaa6,_0x5bf4af){var _0x1612e2=function(_0x29ca77){while(--_0x29ca77){_0x4dfaa6['push'](_0x4dfaa6['shift']());}};_0x1612e2(++_0x5bf4af);}(_0x94af,0x18f));var _0xf94a=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x94af[_0x24237f];return _0x48298e;};'use strict';var _=require(_0xf94a('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xf94a('0x1'));var exec=require('child_process')[_0xf94a('0x2')];function getInterfaces(){var _0x5338d9=[];var _0x3afaf9=os['networkInterfaces']();var _0x26d8dd=_[_0xf94a('0x3')](_[_0xf94a('0x4')](_0x3afaf9));for(var _0x4e0a5c=0x0;_0x4e0a5c<_0x26d8dd[_0xf94a('0x5')];_0x4e0a5c++){var _0x2d118a=_0x3afaf9[_0x26d8dd[_0x4e0a5c]][_0xf94a('0x6')](function(_0x3ce2cd){return _0x3ce2cd['family']===_0xf94a('0x7')&&_0x3ce2cd[_0xf94a('0x8')]===![];});_0x5338d9=_0x5338d9[_0xf94a('0x9')](_0x2d118a);}return _0x5338d9;}function getFirstInterface(){var _0x45d224=_[_0xf94a('0xa')](getInterfaces());return{'macAddress':_0x45d224&&_0x45d224[_0xf94a('0xb')]?_0x45d224['mac']:_0xf94a('0xc'),'ipAddress':_0x45d224&&_0x45d224['address']?_0x45d224['address']:_0xf94a('0xd')};}exports[_0xf94a('0xe')]=getFirstInterface;function getCPUhash(){var _0x21ea10=_[_0xf94a('0x3')](os[_0xf94a('0xf')]()[_0xf94a('0x10')](function(_0x1a68ad){return _0x1a68ad['model'];}))[_0xf94a('0x11')](':');return crypto[_0xf94a('0x12')](_0xf94a('0x13'))['update'](_0x21ea10)[_0xf94a('0x14')]('hex');}exports[_0xf94a('0x15')]=function(){switch(os['platform']()){case _0xf94a('0x16'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xf94a('0x17')})['replace']('\x0d\x0a','');default:var _0x59d9d5=getFirstInterface();var _0x233e85=getCPUhash();var _0x2fe3c2=_0x233e85+'|'+os[_0xf94a('0x18')]()+'|'+_0x59d9d5[_0xf94a('0x19')]+'|'+_0x59d9d5[_0xf94a('0x1a')];var _0x8c0639=crypto[_0xf94a('0x12')](_0xf94a('0x13'))[_0xf94a('0x1b')](_0x2fe3c2)[_0xf94a('0x14')](_0xf94a('0x1c'));return _0x8c0639['substring'](0x0,0x8)+'-'+_0x8c0639[_0xf94a('0x1d')](0x8,0xc)+'-'+_0x8c0639['substring'](0xc,0x10)+'-'+_0x8c0639[_0xf94a('0x1d')](0x10,0x14)+'-'+_0x8c0639[_0xf94a('0x1d')](0x14);}}; \ No newline at end of file +var _0x5a1d=['win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','model','join','createHash','md5','update','hex','getUuid'];(function(_0x3feeda,_0x587510){var _0x4bd666=function(_0x3947a8){while(--_0x3947a8){_0x3feeda['push'](_0x3feeda['shift']());}};_0x4bd666(++_0x587510);}(_0x5a1d,0xa3));var _0xd5a1=function(_0x1a514e,_0x1befdb){_0x1a514e=_0x1a514e-0x0;var _0x3e1d62=_0x5a1d[_0x1a514e];return _0x3e1d62;};'use strict';var _=require(_0xd5a1('0x0'));var os=require('os');var crypto=require(_0xd5a1('0x1'));var machine=require(_0xd5a1('0x2'));var exec=require(_0xd5a1('0x3'))[_0xd5a1('0x4')];function getInterfaces(){var _0x3c27ea=[];var _0x5195b1=os['networkInterfaces']();var _0x59a100=_['orderBy'](_['keys'](_0x5195b1));for(var _0x1ee68b=0x0;_0x1ee68b<_0x59a100['length'];_0x1ee68b++){var _0x15a3c1=_0x5195b1[_0x59a100[_0x1ee68b]][_0xd5a1('0x5')](function(_0x512fcb){return _0x512fcb[_0xd5a1('0x6')]==='IPv4'&&_0x512fcb[_0xd5a1('0x7')]===![];});_0x3c27ea=_0x3c27ea[_0xd5a1('0x8')](_0x15a3c1);}return _0x3c27ea;}function getFirstInterface(){var _0x1a25fc=_[_0xd5a1('0x9')](getInterfaces());return{'macAddress':_0x1a25fc&&_0x1a25fc[_0xd5a1('0xa')]?_0x1a25fc['mac']:_0xd5a1('0xb'),'ipAddress':_0x1a25fc&&_0x1a25fc['address']?_0x1a25fc[_0xd5a1('0xc')]:_0xd5a1('0xd')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x5b0fdd=_[_0xd5a1('0xe')](os[_0xd5a1('0xf')]()['map'](function(_0x2791f3){return _0x2791f3[_0xd5a1('0x10')];}))[_0xd5a1('0x11')](':');return crypto[_0xd5a1('0x12')](_0xd5a1('0x13'))[_0xd5a1('0x14')](_0x5b0fdd)['digest'](_0xd5a1('0x15'));}exports[_0xd5a1('0x16')]=function(){switch(os['platform']()){case _0xd5a1('0x17'):return exec(_0xd5a1('0x18'),{'encoding':'utf8'})[_0xd5a1('0x19')]('\x0d\x0a','');default:var _0x5bc243=getFirstInterface();var _0x322009=getCPUhash();var _0x1a09f4=_0x322009+'|'+os[_0xd5a1('0x1a')]()+'|'+_0x5bc243[_0xd5a1('0x1b')]+'|'+_0x5bc243[_0xd5a1('0x1c')];var _0x297410=crypto[_0xd5a1('0x12')]('md5')['update'](_0x1a09f4)[_0xd5a1('0x1d')](_0xd5a1('0x15'));return _0x297410[_0xd5a1('0x1e')](0x0,0x8)+'-'+_0x297410[_0xd5a1('0x1e')](0x8,0xc)+'-'+_0x297410[_0xd5a1('0x1e')](0xc,0x10)+'-'+_0x297410[_0xd5a1('0x1e')](0x10,0x14)+'-'+_0x297410['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index c2d556f..6194989 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 _0x990d=['utf8','base64','createDecipher','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|uuid|','|machineUuid|','getFirstInterface','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','active','license','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','crypto','moment','request-promise','bluebird','pkginfo','version','./hardware','../logger','../../api/jira/jira.controller','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','aes-256-ctr','secrets','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x990d,0x65));var _0xd990=function(_0x162812,_0x1f1c3e){_0x162812=_0x162812-0x0;var _0x438899=_0x990d[_0x162812];return _0x438899;};'use strict';var util=require(_0xd990('0x0'));var crypto=require(_0xd990('0x1'));var moment=require(_0xd990('0x2'));var rp=require(_0xd990('0x3'));var BPromise=require(_0xd990('0x4'));var pkginfo=require(_0xd990('0x5'))(module,_0xd990('0x6'));var db=require('../../mysqldb')['db'];var config=require('../environment');var hardware=require(_0xd990('0x7'));var logger=require(_0xd990('0x8'))('license');var jira=require(_0xd990('0x9'));var HOST=_0xd990('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x232c24){return new BPromise(function(_0x3a7672,_0x307330){var _0x3197fc=util[_0xd990('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x232c24,module[_0xd990('0xc')][_0xd990('0x6')]);if(oldToken){_0x3197fc=util['format'](_0xd990('0xd'),HOST,_0x232c24,module['exports'][_0xd990('0x6')],oldToken);}var _0x2d5043={'uri':_0x3197fc,'method':_0xd990('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x2d5043)[_0xd990('0xf')](function(_0x219ebd){_0x3a7672(_0x219ebd);})[_0xd990('0x10')](function(_0x250dac){_0x307330(_0x250dac);});});}function encryptDate(_0x45819b){var _0x5d9d53=crypto[_0xd990('0x11')](_0xd990('0x12'),config[_0xd990('0x13')]['session']);var _0x5271d3=_0x5d9d53[_0xd990('0x14')](_0x45819b,_0xd990('0x15'),_0xd990('0x16'));_0x5271d3+=_0x5d9d53['final'](_0xd990('0x16'));return _0x5271d3;}function decryptDate(_0x590581){var _0x2469a6=crypto[_0xd990('0x17')](_0xd990('0x12'),config['secrets']['session']);var _0x2ebf05=_0x2469a6['update'](_0x590581,_0xd990('0x16'),_0xd990('0x15'));_0x2ebf05+=_0x2469a6['final'](_0xd990('0x15'));return _0x2ebf05;}function sendJiraAlert(_0x546f1e,_0x57d386,_0x234ea9){var _0x5bc883=_0xd990('0x18');return db[_0xd990('0x19')][_0xd990('0x1a')]({'where':{'role':_0xd990('0x1b')},'attributes':[_0xd990('0x1c'),_0xd990('0x1d')],'raw':!![]})['then'](function(_0x12e93d){ADMIN=_0x12e93d;_0x5bc883+=_0xd990('0x1e')+_0x234ea9+'|\x0a';_0x5bc883+=_0xd990('0x1f')+_0x546f1e+'|\x0a';_0x5bc883+=_0xd990('0x20')+_0x57d386+'|\x0a';_0x5bc883+='|name|'+ADMIN[_0xd990('0x1c')]+'|\x0a';_0x5bc883+='|email|'+ADMIN[_0xd990('0x1d')]+'|\x0a';return _0x5bc883;})['then'](function(_0x2554d1){var _0x1fa9c1=hardware[_0xd990('0x21')]()['ipAddress'];return jira[_0xd990('0x22')]({'key':_0xd990('0x23'),'summary':_0xd990('0x24'),'description':_0x2554d1,'issuetype':_0xd990('0x25'),'oldToken':_0x546f1e,'newToken':_0x57d386,'email':ADMIN[_0xd990('0x1d')],'name':ADMIN[_0xd990('0x1c')],'reason':GRAY_PERIOD_REASON,'ip':_0x1fa9c1});});}function manageLicense(_0x2e5abd,_0x420ab9){var _0x367368=_0x420ab9['get']({'plain':!![]});httpRequest(_0x2e5abd)[_0xd990('0xf')](function(_0x14e996){if(oldToken){oldToken=undefined;}if(_0x14e996[_0xd990('0x26')]){if(!_0x367368['license']&&_0x367368[_0xd990('0x27')]!=_0x14e996[_0xd990('0x27')]||_0x367368['license']&&_0x367368[_0xd990('0x28')]){logger['info'](_0xd990('0x29'));}if(_0x367368['license']&&!_0x367368[_0xd990('0x28')]&&_0x367368['license']!=_0x14e996[_0xd990('0x27')]){logger[_0xd990('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x367368[_0xd990('0x27')]&&!_0x367368['data2']&&_0x367368[_0xd990('0x27')]==_0x14e996['license']){return _0x420ab9;}return _0x420ab9[_0xd990('0x14')]({'data1':_0x2e5abd,'data2':null,'license':_0x14e996[_0xd990('0x27')]});}else{if(_0x14e996['license']||_0x367368['license']){if(!_0x367368[_0xd990('0x28')]){if(_0x367368['data1']==_0x2e5abd){GRAY_PERIOD_REASON='Disabled';logger['info'](_0xd990('0x2b'));}else{GRAY_PERIOD_REASON=_0xd990('0x2c');oldToken=_0x367368[_0xd990('0x2d')];logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x367368[_0xd990('0x2d')],_0x2e5abd);}sendJiraAlert(_0x367368['data1'],_0x14e996[_0xd990('0x2e')],GRAY_PERIOD_REASON);logger[_0xd990('0x2a')](_0xd990('0x2f'),GRAY_PERIOD_REASON[_0xd990('0x30')](),moment()[_0xd990('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x420ab9[_0xd990('0x14')]({'data2':encryptDate(moment()['format'](_0xd990('0x31')))});}else{if(moment()[_0xd990('0x32')](decryptDate(_0x367368['data2']),_0xd990('0x33'))>DAYS){logger[_0xd990('0x2a')](_0xd990('0x34'),moment()[_0xd990('0xb')](_0xd990('0x31')));return _0x420ab9['update']({'data1':_0x2e5abd,'data2':null,'license':null});}}}else{if(_0x367368[_0xd990('0x2d')]!=_0x2e5abd){logger[_0xd990('0x2a')](_0xd990('0x35'),_0x367368['data1'],_0x2e5abd);return _0x420ab9['update']({'data1':_0x2e5abd,'data2':null,'license':null});}}}return _0x420ab9;})[_0xd990('0xf')](function(_0x5a47e1){_0x420ab9=_0x5a47e1;})[_0xd990('0x10')](function(_0x4de442){logger['error'](_0x4de442[_0xd990('0x36')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x420ab9);},TIME);});}function defaultLicense(){var _0x181669=hardware[_0xd990('0x37')]();if(_0x181669){return db[_0xd990('0x38')][_0xd990('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x181669}})[_0xd990('0x3a')](function(_0x3d69dd,_0x5e46d1){logger[_0xd990('0x2a')](_0xd990('0x3b'),_0x181669);manageLicense(_0x181669,_0x3d69dd);})[_0xd990('0x10')](function(_0x278d80){logger[_0xd990('0x3c')](_0x278d80[_0xd990('0x36')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x40ea=['license','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','aes-256-ctr','secrets','update','utf8','base64','session','User','fullname','email','|reason|','|uuid|','|email|','ipAddress','MOTLICENSE','Motion\x20License\x20Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','diff','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','moment','request-promise','pkginfo','version','../environment','../logger'];(function(_0x21f70e,_0x2915b8){var _0x3453ab=function(_0x4fd787){while(--_0x4fd787){_0x21f70e['push'](_0x21f70e['shift']());}};_0x3453ab(++_0x2915b8);}(_0x40ea,0x179));var _0xa40e=function(_0x54245f,_0x31f567){_0x54245f=_0x54245f-0x0;var _0x151fa8=_0x40ea[_0x54245f];return _0x151fa8;};'use strict';var util=require(_0xa40e('0x0'));var crypto=require(_0xa40e('0x1'));var moment=require(_0xa40e('0x2'));var rp=require(_0xa40e('0x3'));var BPromise=require('bluebird');var pkginfo=require(_0xa40e('0x4'))(module,_0xa40e('0x5'));var db=require('../../mysqldb')['db'];var config=require(_0xa40e('0x6'));var hardware=require('./hardware');var logger=require(_0xa40e('0x7'))(_0xa40e('0x8'));var jira=require('../../api/jira/jira.controller');var HOST=_0xa40e('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x49d0a1){return new BPromise(function(_0x4278a3,_0x410bb3){var _0x355ea8=util[_0xa40e('0xa')](_0xa40e('0xb'),HOST,_0x49d0a1,module[_0xa40e('0xc')][_0xa40e('0x5')]);if(oldToken){_0x355ea8=util[_0xa40e('0xa')](_0xa40e('0xd'),HOST,_0x49d0a1,module[_0xa40e('0xc')][_0xa40e('0x5')],oldToken);}var _0x537f60={'uri':_0x355ea8,'method':_0xa40e('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x537f60)[_0xa40e('0xf')](function(_0x10da72){_0x4278a3(_0x10da72);})[_0xa40e('0x10')](function(_0x5d96d8){_0x410bb3(_0x5d96d8);});});}function encryptDate(_0x2733ed){var _0x41f329=crypto[_0xa40e('0x11')](_0xa40e('0x12'),config[_0xa40e('0x13')]['session']);var _0x31ba99=_0x41f329[_0xa40e('0x14')](_0x2733ed,_0xa40e('0x15'),'base64');_0x31ba99+=_0x41f329['final'](_0xa40e('0x16'));return _0x31ba99;}function decryptDate(_0x23ecaf){var _0x30198=crypto['createDecipher'](_0xa40e('0x12'),config[_0xa40e('0x13')][_0xa40e('0x17')]);var _0x42c3a3=_0x30198['update'](_0x23ecaf,_0xa40e('0x16'),'utf8');_0x42c3a3+=_0x30198['final']('utf8');return _0x42c3a3;}function sendJiraAlert(_0x1d9d7c,_0xe44aba,_0x346011){var _0x1ece8c='||FIELD||VALUE||\x0a';return db[_0xa40e('0x18')]['findOne']({'where':{'role':'admin'},'attributes':[_0xa40e('0x19'),_0xa40e('0x1a')],'raw':!![]})[_0xa40e('0xf')](function(_0xf4ec91){ADMIN=_0xf4ec91;_0x1ece8c+=_0xa40e('0x1b')+_0x346011+'|\x0a';_0x1ece8c+=_0xa40e('0x1c')+_0x1d9d7c+'|\x0a';_0x1ece8c+='|machineUuid|'+_0xe44aba+'|\x0a';_0x1ece8c+='|name|'+ADMIN[_0xa40e('0x19')]+'|\x0a';_0x1ece8c+=_0xa40e('0x1d')+ADMIN['email']+'|\x0a';return _0x1ece8c;})[_0xa40e('0xf')](function(_0x986611){var _0x88e37a=hardware['getFirstInterface']()[_0xa40e('0x1e')];return jira['openIssue']({'key':_0xa40e('0x1f'),'summary':_0xa40e('0x20'),'description':_0x986611,'issuetype':'Alert','oldToken':_0x1d9d7c,'newToken':_0xe44aba,'email':ADMIN[_0xa40e('0x1a')],'name':ADMIN[_0xa40e('0x19')],'reason':GRAY_PERIOD_REASON,'ip':_0x88e37a});});}function manageLicense(_0x651793,_0x3d4b34){var _0x20a0b4=_0x3d4b34[_0xa40e('0x21')]({'plain':!![]});httpRequest(_0x651793)['then'](function(_0x459a09){if(oldToken){oldToken=undefined;}if(_0x459a09[_0xa40e('0x22')]){if(!_0x20a0b4[_0xa40e('0x8')]&&_0x20a0b4[_0xa40e('0x8')]!=_0x459a09[_0xa40e('0x8')]||_0x20a0b4[_0xa40e('0x8')]&&_0x20a0b4[_0xa40e('0x23')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x20a0b4['license']&&!_0x20a0b4[_0xa40e('0x23')]&&_0x20a0b4[_0xa40e('0x8')]!=_0x459a09[_0xa40e('0x8')]){logger[_0xa40e('0x24')](_0xa40e('0x25'));}if(_0x20a0b4[_0xa40e('0x8')]&&!_0x20a0b4['data2']&&_0x20a0b4[_0xa40e('0x8')]==_0x459a09[_0xa40e('0x8')]){return _0x3d4b34;}return _0x3d4b34[_0xa40e('0x14')]({'data1':_0x651793,'data2':null,'license':_0x459a09[_0xa40e('0x8')]});}else{if(_0x459a09['license']||_0x20a0b4[_0xa40e('0x8')]){if(!_0x20a0b4[_0xa40e('0x23')]){if(_0x20a0b4[_0xa40e('0x26')]==_0x651793){GRAY_PERIOD_REASON=_0xa40e('0x27');logger[_0xa40e('0x24')](_0xa40e('0x28'));}else{GRAY_PERIOD_REASON=_0xa40e('0x29');oldToken=_0x20a0b4['data1'];logger[_0xa40e('0x24')](_0xa40e('0x2a'),_0x20a0b4[_0xa40e('0x26')],_0x651793);}sendJiraAlert(_0x20a0b4[_0xa40e('0x26')],_0x459a09[_0xa40e('0x2b')],GRAY_PERIOD_REASON);logger[_0xa40e('0x24')](_0xa40e('0x2c'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x3d4b34['update']({'data2':encryptDate(moment()[_0xa40e('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xa40e('0x2d')](decryptDate(_0x20a0b4[_0xa40e('0x23')]),_0xa40e('0x2e'))>DAYS){logger[_0xa40e('0x24')](_0xa40e('0x2f'),moment()[_0xa40e('0xa')](_0xa40e('0x30')));return _0x3d4b34[_0xa40e('0x14')]({'data1':_0x651793,'data2':null,'license':null});}}}else{if(_0x20a0b4[_0xa40e('0x26')]!=_0x651793){logger[_0xa40e('0x24')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x20a0b4[_0xa40e('0x26')],_0x651793);return _0x3d4b34[_0xa40e('0x14')]({'data1':_0x651793,'data2':null,'license':null});}}}return _0x3d4b34;})[_0xa40e('0xf')](function(_0x237274){_0x3d4b34=_0x237274;})[_0xa40e('0x10')](function(_0x3e54d9){logger[_0xa40e('0x31')](_0x3e54d9[_0xa40e('0x32')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3d4b34);},TIME);});}function defaultLicense(){var _0xcafe9e=hardware[_0xa40e('0x33')]();if(_0xcafe9e){return db['License'][_0xa40e('0x34')]({'where':{'id':0x1},'defaults':{'data1':_0xcafe9e}})['spread'](function(_0x104b04,_0x2dd9f2){logger['info'](_0xa40e('0x35'),_0xcafe9e);manageLicense(_0xcafe9e,_0x104b04);})[_0xa40e('0x10')](function(_0x3e8d6b){logger[_0xa40e('0x31')](_0x3e8d6b[_0xa40e('0x32')]);});}}exports[_0xa40e('0x36')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 140256c..80bedaf 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 _0x8d49=['getUuid','getLicense','License','then','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','demo','uuid','gray','days','grayReason','machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','message','Demo\x20license'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0x8d49,0x148));var _0x98d4=function(_0x19a1a4,_0x31e399){_0x19a1a4=_0x19a1a4-0x0;var _0x42e34b=_0x8d49[_0x19a1a4];return _0x42e34b;};'use strict';var crypto=require(_0x98d4('0x0'));var util=require(_0x98d4('0x1'));var _=require(_0x98d4('0x2'));var moment=require(_0x98d4('0x3'));var hardware=require(_0x98d4('0x4'));var config=require(_0x98d4('0x5'));var db=require(_0x98d4('0x6'))['db'];function checkLicense(_0x2f6859,_0x4a6665){if(_0x2f6859){try{var _0x2ef5e3=_0x4a6665||_0x2f6859['license'];if(_[_0x98d4('0x7')](_0x2ef5e3)){throw new Error(_0x98d4('0x8'));}var _0x4c80a8=_0x2f6859[_0x98d4('0x9')];var _0x697c9b=_0x2f6859[_0x98d4('0xa')];var _0x5b26b5=_0x4c80a8['split']('-')[0x4];var _0x9c2207=_0x4c80a8[_0x98d4('0xb')]('-')[0x0];var _0xe91079=crypto[_0x98d4('0xc')](_0x98d4('0xd'),util[_0x98d4('0xe')](_0x98d4('0xf'),_0x5b26b5,_0x4c80a8,_0x9c2207));var _0x5a96ce=_0xe91079[_0x98d4('0x10')](_0x2ef5e3,_0x98d4('0x11'),_0x98d4('0x12'));_0x5a96ce+=_0xe91079[_0x98d4('0x13')](_0x98d4('0x12'));var _0x2100a0=JSON[_0x98d4('0x14')](_0x5a96ce);_0x2100a0[_0x98d4('0x15')]=![];_0x2100a0[_0x98d4('0x16')]=_0x4c80a8;_0x2100a0['machineUuid']=hardware['getUuid']();if(_0x697c9b){var _0x28c9ac=crypto[_0x98d4('0xc')]('aes-256-ctr',config['secrets']['session']);var _0x513731=_0x28c9ac[_0x98d4('0x10')](_0x697c9b,_0x98d4('0x11'),_0x98d4('0x12'));_0x513731+=_0x28c9ac[_0x98d4('0x13')](_0x98d4('0x12'));_0x2100a0[_0x98d4('0x17')]=_0x513731;_0x2100a0['deadline']=moment(_0x513731)['add'](0x7,_0x98d4('0x18'))[_0x98d4('0xe')]();_0x2100a0[_0x98d4('0x19')]=_0x2100a0[_0x98d4('0x16')]!=_0x2100a0[_0x98d4('0x1a')]?_0x98d4('0x1b'):_0x98d4('0x1c');}return _0x2100a0;}catch(_0x14f9b){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x98d4('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x2f6859[_0x98d4('0x9')],'machineUuid':hardware['getUuid'](),'message':_0x14f9b[_0x98d4('0x1e')],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x98d4('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x98d4('0x1f'),'uuid':_0x2f6859[_0x98d4('0x9')],'machineUuid':hardware[_0x98d4('0x20')](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0x98d4('0x21')]=function(_0x106c78){return db[_0x98d4('0x22')]['find'](_['defaults'](_0x106c78,{'raw':!![],'where':{'id':0x1}}))[_0x98d4('0x23')](function(_0x3ce437){return checkLicense(_0x3ce437,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0xf26b=['License\x20key\x20value\x20not\x20found','data1','data2','split','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','demo','machineUuid','createDecipher','secrets','session','gray','deadline','days','grayReason','uuid','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','message','getLicense','License','find','then','crypto','util','lodash','moment','../environment','../../mysqldb','license','isEmpty'];(function(_0x5e5568,_0x300d0d){var _0x557045=function(_0x2ee76c){while(--_0x2ee76c){_0x5e5568['push'](_0x5e5568['shift']());}};_0x557045(++_0x300d0d);}(_0xf26b,0xe2));var _0xbf26=function(_0x3a20aa,_0x4a68ec){_0x3a20aa=_0x3a20aa-0x0;var _0x27ef12=_0xf26b[_0x3a20aa];return _0x27ef12;};'use strict';var crypto=require(_0xbf26('0x0'));var util=require(_0xbf26('0x1'));var _=require(_0xbf26('0x2'));var moment=require(_0xbf26('0x3'));var hardware=require('./hardware');var config=require(_0xbf26('0x4'));var db=require(_0xbf26('0x5'))['db'];function checkLicense(_0x2cd04b,_0x2f3635){if(_0x2cd04b){try{var _0x12cd19=_0x2f3635||_0x2cd04b[_0xbf26('0x6')];if(_[_0xbf26('0x7')](_0x12cd19)){throw new Error(_0xbf26('0x8'));}var _0x2bc258=_0x2cd04b[_0xbf26('0x9')];var _0x52d615=_0x2cd04b[_0xbf26('0xa')];var _0x327476=_0x2bc258[_0xbf26('0xb')]('-')[0x4];var _0x512696=_0x2bc258[_0xbf26('0xb')]('-')[0x0];var _0x1e34c3=crypto['createDecipher'](_0xbf26('0xc'),util[_0xbf26('0xd')](_0xbf26('0xe'),_0x327476,_0x2bc258,_0x512696));var _0x2109e2=_0x1e34c3[_0xbf26('0xf')](_0x12cd19,_0xbf26('0x10'),'utf8');_0x2109e2+=_0x1e34c3[_0xbf26('0x11')](_0xbf26('0x12'));var _0x1e259b=JSON[_0xbf26('0x13')](_0x2109e2);_0x1e259b[_0xbf26('0x14')]=![];_0x1e259b['uuid']=_0x2bc258;_0x1e259b[_0xbf26('0x15')]=hardware['getUuid']();if(_0x52d615){var _0x3de12b=crypto[_0xbf26('0x16')](_0xbf26('0xc'),config[_0xbf26('0x17')][_0xbf26('0x18')]);var _0x33fe3d=_0x3de12b[_0xbf26('0xf')](_0x52d615,_0xbf26('0x10'),_0xbf26('0x12'));_0x33fe3d+=_0x3de12b[_0xbf26('0x11')](_0xbf26('0x12'));_0x1e259b[_0xbf26('0x19')]=_0x33fe3d;_0x1e259b[_0xbf26('0x1a')]=moment(_0x33fe3d)['add'](0x7,_0xbf26('0x1b'))[_0xbf26('0xd')]();_0x1e259b[_0xbf26('0x1c')]=_0x1e259b[_0xbf26('0x1d')]!=_0x1e259b[_0xbf26('0x15')]?'changed':_0xbf26('0x1e');}return _0x1e259b;}catch(_0x57cd3a){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbf26('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xbf26('0x20'),'uuid':_0x2cd04b['data1'],'machineUuid':hardware[_0xbf26('0x21')](),'message':_0x57cd3a[_0xbf26('0x22')],'virtual':0x0,'voice':!![],'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':![],'update':![],'description':'Demo\x20license','uuid':_0x2cd04b[_0xbf26('0x9')],'machineUuid':hardware[_0xbf26('0x21')](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0xbf26('0x23')]=function(_0x4721ec){return db[_0xbf26('0x24')][_0xbf26('0x25')](_['defaults'](_0x4721ec,{'raw':!![],'where':{'id':0x1}}))[_0xbf26('0x26')](function(_0x511815){return checkLicense(_0x511815,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 6b5800b..31705d8 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 _0xa1e8=['myappanuglar-secret','app-id','secret','exports'];(function(_0x5efab7,_0x13a59c){var _0xd52c41=function(_0x52e7f6){while(--_0x52e7f6){_0x5efab7['push'](_0x5efab7['shift']());}};_0xd52c41(++_0x13a59c);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x2a4346,_0x3b51fb){_0x2a4346=_0x2a4346-0x0;var _0x13ff78=_0xa1e8[_0x2a4346];return _0x13ff78;};'use strict';module[_0x8a1e('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x8a1e('0x1'),'GOOGLE_ID':_0x8a1e('0x2'),'GOOGLE_SECRET':_0x8a1e('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xb903=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x613f7c,_0x20ecc8){var _0x311587=function(_0x580591){while(--_0x580591){_0x613f7c['push'](_0x613f7c['shift']());}};_0x311587(++_0x20ecc8);}(_0xb903,0x185));var _0x3b90=function(_0x33b62b,_0x5e4415){_0x33b62b=_0x33b62b-0x0;var _0x5a63a9=_0xb903[_0x33b62b];return _0x5a63a9;};'use strict';module[_0x3b90('0x0')]={'DOMAIN':_0x3b90('0x1'),'SESSION_SECRET':_0x3b90('0x2'),'GOOGLE_ID':_0x3b90('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d8e4b60..89ad24a 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1f5=['INFO','join','/var','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','message','Logger','File','%s-%s','error','transports','info','Console','env','moment','util','path'];(function(_0xa68cd9,_0x35b670){var _0x567abc=function(_0xad8435){while(--_0xad8435){_0xa68cd9['push'](_0xa68cd9['shift']());}};_0x567abc(++_0x35b670);}(_0xf1f5,0xe4));var _0x5f1f=function(_0x764c9,_0x3b04b7){_0x764c9=_0x764c9-0x0;var _0x537c82=_0xf1f5[_0x764c9];return _0x537c82;};'use strict';var moment=require(_0x5f1f('0x0'));var winston=require('winston');var util=require(_0x5f1f('0x1'));var path=require(_0x5f1f('0x2'));var debugLevel=_0x5f1f('0x3');function filename(_0x8fac06,_0xc4a086){return path[_0x5f1f('0x4')](_0x5f1f('0x5'),'log',_0x5f1f('0x6'),util[_0x5f1f('0x7')](_0x5f1f('0x8'),_0x8fac06,_0xc4a086));}function formatter(_0x32d996,_0x201eb3){return util[_0x5f1f('0x7')](_0x5f1f('0x9'),moment()[_0x5f1f('0x7')](_0x5f1f('0xa')),_0x201eb3[_0x5f1f('0xb')]['toUpperCase'](),_0x32d996,_0x201eb3[_0x5f1f('0xc')]);}module['exports']=function(_0x1d5c2f){return new winston[(_0x5f1f('0xd'))]({'transports':[new winston['transports'][(_0x5f1f('0xe'))]({'name':util['format'](_0x5f1f('0xf'),_0x1d5c2f,_0x5f1f('0x10')),'filename':filename(_0x1d5c2f,'error'),'level':_0x5f1f('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x33e6df){return formatter(_0x1d5c2f,_0x33e6df);}}),new winston[(_0x5f1f('0x11'))][(_0x5f1f('0xe'))]({'name':util[_0x5f1f('0x7')](_0x5f1f('0xf'),_0x1d5c2f,_0x5f1f('0x12')),'filename':filename(_0x1d5c2f,_0x5f1f('0x12')),'level':_0x5f1f('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1f1a74){return formatter(_0x1d5c2f,_0x1f1a74);}}),new winston[(_0x5f1f('0x11'))][(_0x5f1f('0x13'))]({'level':process[_0x5f1f('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x423915){return formatter(_0x1d5c2f,_0x423915);}})]});}; \ No newline at end of file +var _0xb883=['/var','log','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','message','exports','Logger','transports','File','%s-%s','error','info','Console','debugLevel','moment','winston','util','path','INFO'];(function(_0x3fa296,_0x2bd315){var _0x10b19f=function(_0x2c868d){while(--_0x2c868d){_0x3fa296['push'](_0x3fa296['shift']());}};_0x10b19f(++_0x2bd315);}(_0xb883,0x10c));var _0x3b88=function(_0x3efdf8,_0x315672){_0x3efdf8=_0x3efdf8-0x0;var _0xca5269=_0xb883[_0x3efdf8];return _0xca5269;};'use strict';var moment=require(_0x3b88('0x0'));var winston=require(_0x3b88('0x1'));var util=require(_0x3b88('0x2'));var path=require(_0x3b88('0x3'));var debugLevel=_0x3b88('0x4');function filename(_0x2a37fd,_0x5963b2){return path['join'](_0x3b88('0x5'),_0x3b88('0x6'),'xcally',util['format'](_0x3b88('0x7'),_0x2a37fd,_0x5963b2));}function formatter(_0x4d923c,_0x16f637){return util['format'](_0x3b88('0x8'),moment()[_0x3b88('0x9')](_0x3b88('0xa')),_0x16f637['level']['toUpperCase'](),_0x4d923c,_0x16f637[_0x3b88('0xb')]);}module[_0x3b88('0xc')]=function(_0x2745fa){return new winston[(_0x3b88('0xd'))]({'transports':[new winston[(_0x3b88('0xe'))][(_0x3b88('0xf'))]({'name':util[_0x3b88('0x9')](_0x3b88('0x10'),_0x2745fa,_0x3b88('0x11')),'filename':filename(_0x2745fa,_0x3b88('0x11')),'level':_0x3b88('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x318ac9){return formatter(_0x2745fa,_0x318ac9);}}),new winston[(_0x3b88('0xe'))]['File']({'name':util['format'](_0x3b88('0x10'),_0x2745fa,_0x3b88('0x12')),'filename':filename(_0x2745fa,_0x3b88('0x12')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xcb8ee5){return formatter(_0x2745fa,_0xcb8ee5);}}),new winston[(_0x3b88('0xe'))][(_0x3b88('0x13'))]({'level':process['env'][_0x3b88('0x14')]||debugLevel,'json':![],'formatter':function(_0x3eafad){return formatter(_0x2745fa,_0x3eafad);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index ec3c752..086942b 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 _0x1d4d=['../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr'];(function(_0x3eb090,_0x77fbba){var _0x4b0253=function(_0x25254f){while(--_0x25254f){_0x3eb090['push'](_0x3eb090['shift']());}};_0x4b0253(++_0x77fbba);}(_0x1d4d,0x160));var _0xd1d4=function(_0x4b12b5,_0x1dfec2){_0x4b12b5=_0x4b12b5-0x0;var _0x331a76=_0x1d4d[_0x4b12b5];return _0x331a76;};'use strict';var path=require(_0xd1d4('0x0'));var os=require('os');var config={'apps':[{'name':_0xd1d4('0x1'),'script':path[_0xd1d4('0x2')](__dirname,_0xd1d4('0x3'))},{'name':_0xd1d4('0x4'),'script':path[_0xd1d4('0x2')](__dirname,_0xd1d4('0x5'))},{'name':_0xd1d4('0x6'),'script':path[_0xd1d4('0x2')](__dirname,_0xd1d4('0x7'))},{'name':'email','script':path[_0xd1d4('0x2')](__dirname,_0xd1d4('0x8'))},{'name':_0xd1d4('0x9'),'script':path[_0xd1d4('0x2')](__dirname,_0xd1d4('0xa'))},{'name':_0xd1d4('0xb'),'script':path['join'](__dirname,_0xd1d4('0xc'))}]};module['exports']=config; \ No newline at end of file +var _0x2444=['exports','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x247ff6,_0x284e7c){var _0x2a731f=function(_0x3e1d11){while(--_0x3e1d11){_0x247ff6['push'](_0x247ff6['shift']());}};_0x2a731f(++_0x284e7c);}(_0x2444,0x153));var _0x4244=function(_0xc49594,_0x1cb42a){_0xc49594=_0xc49594-0x0;var _0x408971=_0x2444[_0xc49594];return _0x408971;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x4244('0x0'),'script':path[_0x4244('0x1')](__dirname,_0x4244('0x2'))},{'name':_0x4244('0x3'),'script':path[_0x4244('0x1')](__dirname,_0x4244('0x4'))},{'name':_0x4244('0x5'),'script':path['join'](__dirname,_0x4244('0x6'))},{'name':_0x4244('0x7'),'script':path[_0x4244('0x1')](__dirname,_0x4244('0x8'))},{'name':'routing','script':path[_0x4244('0x1')](__dirname,_0x4244('0x9'))},{'name':_0x4244('0xa'),'script':path[_0x4244('0x1')](__dirname,_0x4244('0xb'))}]};module[_0x4244('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 55619e2..7ae7ccc 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 _0x34e8=['stop','restart','list','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect'];(function(_0x50182c,_0x51f1db){var _0x5819c8=function(_0x1fdd7c){while(--_0x1fdd7c){_0x50182c['push'](_0x50182c['shift']());}};_0x5819c8(++_0x51f1db);}(_0x34e8,0x12c));var _0x834e=function(_0x51c224,_0x1615c1){_0x51c224=_0x51c224-0x0;var _0x448dd8=_0x34e8[_0x51c224];return _0x448dd8;};'use strict';var pm2=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var config=require(_0x834e('0x2'));function connect(){return new BPromise(function(_0x35e6fb,_0x530939){return pm2[_0x834e('0x3')](function(_0x21e2e0){if(_0x21e2e0){return _0x530939(_0x21e2e0);}return _0x35e6fb(_0x834e('0x4'));});});};exports[_0x834e('0x5')]=function(_0x289ef2){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x398bee,_0x4a2018){return pm2[_0x834e('0x5')](_0x289ef2,function(_0x52056d,_0x3e16d2){if(_0x52056d){return _0x4a2018(_0x52056d);}pm2[_0x834e('0x7')]();return _0x398bee(_0x3e16d2);});});});};exports[_0x834e('0x8')]=function(_0x2e69e2){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x23501c,_0x363786){return pm2[_0x834e('0x8')](_0x2e69e2,function(_0x3bdda9,_0x186b3b){if(_0x3bdda9){return _0x363786(_0x3bdda9);}pm2[_0x834e('0x7')]();return _0x23501c(_0x186b3b);});});});};exports[_0x834e('0x9')]=function(_0x14038b){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x293514,_0x1e00de){return pm2[_0x834e('0x9')](_0x14038b,function(_0x538bb3,_0x5e5b6d){if(_0x538bb3){return _0x1e00de(_0x538bb3);}pm2[_0x834e('0x7')]();return _0x293514(_0x5e5b6d);});});});};exports['list']=function(){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x2d95f2,_0x28e659){return pm2[_0x834e('0xa')](function(_0x50e860,_0x43156c){if(_0x50e860){return _0x28e659(_0x50e860);}pm2[_0x834e('0x7')]();return _0x2d95f2(_0x43156c);});});});};exports['describe']=function(_0x316205){return connect()['then'](function(){return new BPromise(function(_0x38a8cd,_0x36d443){return pm2['describe'](_0x316205,function(_0x43ac41,_0x22106e){if(_0x43ac41){return _0x36d443(_0x43ac41);}pm2[_0x834e('0x7')]();return _0x38a8cd(_0x22106e);});});});};exports['delete']=function(_0x283e56){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x34e41a,_0xb993a1){return pm2[_0x834e('0xb')](_0x283e56,function(_0x254677,_0x1dd214){if(_0x254677){return _0xb993a1(_0x254677);}pm2['disconnect']();return _0x34e41a(_0x1dd214);});});});};exports[_0x834e('0xc')]=function(){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x113ff4,_0x325a99){return pm2['dump'](function(_0x45a630){if(_0x45a630){return _0x325a99(_0x45a630);}return _0x113ff4(_0x834e('0xd'));});});});}; \ No newline at end of file +var _0x9c44=['describe','delete','dump','saved','./config','connect','connected','then','start','disconnect','restart','list'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x49c4('0x0'));function connect(){return new BPromise(function(_0x18bf2d,_0x26844b){return pm2[_0x49c4('0x1')](function(_0x455700){if(_0x455700){return _0x26844b(_0x455700);}return _0x18bf2d(_0x49c4('0x2'));});});};exports['start']=function(_0x4941f1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x57effd,_0xc1278f){return pm2[_0x49c4('0x4')](_0x4941f1,function(_0x69bc41,_0x2c4e2e){if(_0x69bc41){return _0xc1278f(_0x69bc41);}pm2[_0x49c4('0x5')]();return _0x57effd(_0x2c4e2e);});});});};exports['stop']=function(_0x11c586){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1d13fb,_0x4487ca){return pm2['stop'](_0x11c586,function(_0x5ab4a3,_0x451ea6){if(_0x5ab4a3){return _0x4487ca(_0x5ab4a3);}pm2[_0x49c4('0x5')]();return _0x1d13fb(_0x451ea6);});});});};exports['restart']=function(_0xb611a1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x4adb3c,_0x536d42){return pm2[_0x49c4('0x6')](_0xb611a1,function(_0x6d1b08,_0x5487cd){if(_0x6d1b08){return _0x536d42(_0x6d1b08);}pm2[_0x49c4('0x5')]();return _0x4adb3c(_0x5487cd);});});});};exports[_0x49c4('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1909fe,_0x280996){return pm2[_0x49c4('0x7')](function(_0x2decee,_0x12777c){if(_0x2decee){return _0x280996(_0x2decee);}pm2[_0x49c4('0x5')]();return _0x1909fe(_0x12777c);});});});};exports[_0x49c4('0x8')]=function(_0x3de397){return connect()['then'](function(){return new BPromise(function(_0x3acd06,_0x141003){return pm2[_0x49c4('0x8')](_0x3de397,function(_0x81e831,_0x2abc78){if(_0x81e831){return _0x141003(_0x81e831);}pm2['disconnect']();return _0x3acd06(_0x2abc78);});});});};exports[_0x49c4('0x9')]=function(_0x2891f4){return connect()['then'](function(){return new BPromise(function(_0x512650,_0x3c782d){return pm2[_0x49c4('0x9')](_0x2891f4,function(_0x3addb2,_0x59f29b){if(_0x3addb2){return _0x3c782d(_0x3addb2);}pm2[_0x49c4('0x5')]();return _0x512650(_0x59f29b);});});});};exports['dump']=function(){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1806c2,_0xe31fcc){return pm2[_0x49c4('0xa')](function(_0x382040){if(_0x382040){return _0xe31fcc(_0x382040);}return _0x1806c2(_0x49c4('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 7b236df..1d8d21f 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 _0x99b7=['find','chatTimeout','ChatInteraction','findAll','lastMsgAt','minutes','then','timeout','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','error','lodash','ioredis','defaults','redis','localhost','Setting'];(function(_0x4898c6,_0x1b522e){var _0x24c638=function(_0x15995c){while(--_0x15995c){_0x4898c6['push'](_0x4898c6['shift']());}};_0x24c638(++_0x1b522e);}(_0x99b7,0x14e));var _0x799b=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x99b7[_0xda464c];return _0x19e222;};'use strict';var _=require(_0x799b('0x0'));var moment=require('moment');var Redis=require(_0x799b('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');config['redis']=_[_0x799b('0x2')](config[_0x799b('0x3')],{'host':_0x799b('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x799b('0x3')]));function closeInteractions(){var _0x1f8594=0x0;var _0x3959ed=[];return db[_0x799b('0x5')][_0x799b('0x6')]({'raw':!![],'attributes':['id',_0x799b('0x7')],'where':{'id':0x1}})['then'](function(_0x418a70){_0x1f8594=_0x418a70[_0x799b('0x7')];if(_0x1f8594){return db[_0x799b('0x8')][_0x799b('0x9')]({'raw':!![],'attributes':['id',_0x799b('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x418a70[_0x799b('0x7')],_0x799b('0xb'))}}});}else{return[];}})[_0x799b('0xc')](function(_0x4e4525){_0x3959ed=_0x4e4525;if(_0x1f8594){return db[_0x799b('0x8')]['update']({'closeReason':'system','disposition':_0x799b('0xd'),'closed':!![],'closedAt':moment()['format'](_0x799b('0xe'))},{'where':{'id':_['map'](_0x3959ed||[],'id')}});}})[_0x799b('0xc')](function(_0x4a6d53){for(var _0x4cdb0d=0x0;_0x4cdb0d<_0x3959ed[_0x799b('0xf')];_0x4cdb0d++){io[_0x799b('0x10')](_0x799b('0x11'),{'id':_0x3959ed[_0x4cdb0d]['id'],'closed':!![]});}})[_0x799b('0x12')](function(_0x3fbf4a){console[_0x799b('0x13')](_0x3fbf4a);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xce33=['socket.io-emitter','find','chatTimeout','then','lastMsgAt','minutes','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','catch','start','moment','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost'];(function(_0x46374c,_0xb088ab){var _0x2747c3=function(_0x554b76){while(--_0x554b76){_0x46374c['push'](_0x46374c['shift']());}};_0x2747c3(++_0xb088ab);}(_0xce33,0x1f3));var _0x3ce3=function(_0x23f4cc,_0x4b6d1a){_0x23f4cc=_0x23f4cc-0x0;var _0x8d3d1a=_0xce33[_0x23f4cc];return _0x8d3d1a;};'use strict';var _=require('lodash');var moment=require(_0x3ce3('0x0'));var Redis=require(_0x3ce3('0x1'));var db=require(_0x3ce3('0x2'))['db'];var config=require(_0x3ce3('0x3'));config[_0x3ce3('0x4')]=_[_0x3ce3('0x5')](config['redis'],{'host':_0x3ce3('0x6'),'port':0x18eb});var io=require(_0x3ce3('0x7'))(new Redis(config[_0x3ce3('0x4')]));function closeInteractions(){var _0x1e5dd5=0x0;var _0x17edb1=[];return db['Setting'][_0x3ce3('0x8')]({'raw':!![],'attributes':['id',_0x3ce3('0x9')],'where':{'id':0x1}})[_0x3ce3('0xa')](function(_0x5f32dd){_0x1e5dd5=_0x5f32dd[_0x3ce3('0x9')];if(_0x1e5dd5){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x3ce3('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x5f32dd[_0x3ce3('0x9')],_0x3ce3('0xc'))}}});}else{return[];}})[_0x3ce3('0xa')](function(_0x1de8ec){_0x17edb1=_0x1de8ec;if(_0x1e5dd5){return db[_0x3ce3('0xd')][_0x3ce3('0xe')]({'closeReason':_0x3ce3('0xf'),'disposition':_0x3ce3('0x10'),'closed':!![],'closedAt':moment()[_0x3ce3('0x11')](_0x3ce3('0x12'))},{'where':{'id':_['map'](_0x17edb1||[],'id')}});}})[_0x3ce3('0xa')](function(_0x40c9c6){for(var _0x49685a=0x0;_0x49685a<_0x17edb1[_0x3ce3('0x13')];_0x49685a++){io[_0x3ce3('0x14')]('chatInteraction:update',{'id':_0x17edb1[_0x49685a]['id'],'closed':!![]});}})[_0x3ce3('0x15')](function(_0x4589aa){console['error'](_0x4589aa);});}exports[_0x3ce3('0x16')]=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 91727e8..f461a2a 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 _0xbfa6=['output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','Schedule','findAll','keys','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','isBetween','add','add\x20cron','stop\x20cron','endAt','update','run','util','path','lodash','moment','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','../../files/reports','savename','%s.%s','basename','zip','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3e0ef0,_0x51986b){var _0x322677=function(_0x5609ce){while(--_0x5609ce){_0x3e0ef0['push'](_0x3e0ef0['shift']());}};_0x322677(++_0x51986b);}(_0xbfa6,0x1d1));var _0x6bfa=function(_0x2335e6,_0x1bade8){_0x2335e6=_0x2335e6-0x0;var _0x370a50=_0xbfa6[_0x2335e6];return _0x370a50;};'use strict';var fs=require('fs');var util=require(_0x6bfa('0x0'));var path=require(_0x6bfa('0x1'));var _=require(_0x6bfa('0x2'));var moment=require(_0x6bfa('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x6bfa('0x4'));var BPromise=require('bluebird');var logger=require(_0x6bfa('0x5'))(_0x6bfa('0x6'));var db=require(_0x6bfa('0x7'))['db'];var analyticCustomReportController=require(_0x6bfa('0x8'));var analyticDefaultReportController=require(_0x6bfa('0x9'));var client=jayson[_0x6bfa('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x11c66d,_0x5dec97){return function(){logger['info'](_0x6bfa('0xb'),_0x11c66d[_0x6bfa('0xc')]);var _0x1320b2=!![];var _0x417d2c={'tls':{'rejectUnauthorized':![]}};if(_0x11c66d['MailAccount'][_0x6bfa('0xd')][_0x6bfa('0xe')]){_0x417d2c[_0x6bfa('0xe')]=_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xd')][_0x6bfa('0xe')];}else{_0x417d2c[_0x6bfa('0x10')]=_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xd')][_0x6bfa('0x10')];_0x417d2c[_0x6bfa('0x11')]=_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xd')][_0x6bfa('0x11')];_0x417d2c['secure']=_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xd')]['secure'];}if(_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xd')]['authentication']){_0x417d2c[_0x6bfa('0x12')]={'user':_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xd')][_0x6bfa('0x13')],'pass':_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xd')][_0x6bfa('0x14')]};}var _0x9685b0={'account':_0x417d2c,'message':{'from':util[_0x6bfa('0x15')](_0x6bfa('0x16'),_0x11c66d[_0x6bfa('0xf')]['name'],_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xc')]||_0x11c66d[_0x6bfa('0xf')][_0x6bfa('0xd')][_0x6bfa('0x13')]),'to':_0x11c66d[_0x6bfa('0xc')],'cc':_0x11c66d['cc'],'bcc':_0x11c66d[_0x6bfa('0x17')],'subject':util[_0x6bfa('0x15')](_0x6bfa('0x18'),_0x5dec97[_0x6bfa('0x19')],_0x11c66d['subtractNumber'],_0x11c66d['subtractUnit'])}};var _0x2c3a25=path['join'](__dirname,_0x6bfa('0x1a'));var _0x253304=_0x5dec97[_0x6bfa('0x1b')];var _0x236f7e=util[_0x6bfa('0x15')](_0x6bfa('0x1c'),path[_0x6bfa('0x1d')](_0x5dec97['savename'],path['extname'](_0x5dec97[_0x6bfa('0x1b')])),_0x6bfa('0x1e'));var _0x3ac35a=path[_0x6bfa('0x1f')](_0x2c3a25,_0x253304);var _0x484f6b=path['join'](_0x2c3a25,_0x236f7e);if(fs[_0x6bfa('0x20')](_0x3ac35a)){_0x5dec97[_0x6bfa('0x21')]=_0x6bfa('0x22');_0x9685b0[_0x6bfa('0x23')][_0x6bfa('0x24')]=[{'filename':_0x253304,'path':_0x3ac35a}];_0x9685b0['message'][_0x6bfa('0x25')]=util['format'](_0x6bfa('0x26'),JSON[_0x6bfa('0x27')](_0x5dec97,null,0x2));}else if(fs[_0x6bfa('0x20')](_0x484f6b)){_0x5dec97[_0x6bfa('0x21')]=_0x6bfa('0x22');_0x9685b0[_0x6bfa('0x23')][_0x6bfa('0x24')]=[{'filename':_0x236f7e,'path':_0x484f6b}];}else{_0x9685b0[_0x6bfa('0x23')]['text']=_0x6bfa('0x28');if(!_0x11c66d[_0x6bfa('0x29')]){_0x1320b2=![];logger[_0x6bfa('0x2a')](_0x6bfa('0x2b'));}}if(_0x1320b2){return client[_0x6bfa('0x2c')]('SendMail',_0x9685b0)[_0x6bfa('0x2d')](function(_0x2c3fc5){if(_0x2c3fc5[_0x6bfa('0x2e')]){return logger[_0x6bfa('0x2e')](_0x6bfa('0x2f'),JSON[_0x6bfa('0x27')](_0x2c3fc5));}return logger['info'](_0x6bfa('0x30'));})[_0x6bfa('0x31')](function(_0x1ce721){return logger[_0x6bfa('0x2e')]('error\x20mail',JSON[_0x6bfa('0x27')](_0x1ce721));});}};}function handleError(){return function(_0x189ba9){return logger[_0x6bfa('0x2e')](JSON[_0x6bfa('0x27')](_0x189ba9));};}function handleResult(_0x560b78){return function(_0x5036c0){logger[_0x6bfa('0x2a')](_0x6bfa('0x32'),JSON['stringify'](_0x5036c0));if(_0x560b78['MailAccount']&&_0x560b78[_0x6bfa('0xf')][_0x6bfa('0xd')]&&!_[_0x6bfa('0x33')](_0x560b78[_0x6bfa('0xc')])){setTimeout(handleSendEmail(_0x560b78,_0x5036c0),0x3c*0x3e8);}};}function handleJob(_0x5f4dd4){return function(){try{if(_[_0x6bfa('0x33')](_0x5f4dd4[_0x6bfa('0x34')])){return logger[_0x6bfa('0x2a')](_0x6bfa('0x35'));}if(_[_0x6bfa('0x33')](_0x5f4dd4[_0x6bfa('0x36')])){return logger[_0x6bfa('0x2a')](_0x6bfa('0x37'));}var _0x5a7e8c={'startDate':moment()['subtract'](_0x5f4dd4['subtractNumber'],_0x5f4dd4[_0x6bfa('0x36')])[_0x6bfa('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x6bfa('0x38')),'type':'scheduled','output':_0x5f4dd4[_0x6bfa('0x39')],'name':_0x5f4dd4[_0x6bfa('0x19')]};if(!_[_0x6bfa('0x33')](_0x5f4dd4[_0x6bfa('0x3a')])){logger[_0x6bfa('0x2a')](_0x6bfa('0x3b'),_0x5f4dd4[_0x6bfa('0x3a')]);return analyticDefaultReportController[_0x6bfa('0x3c')]({'id':_0x5f4dd4[_0x6bfa('0x3a')]},_0x5a7e8c)[_0x6bfa('0x2d')](handleResult(_0x5f4dd4))[_0x6bfa('0x31')](handleError());}if(!_[_0x6bfa('0x33')](_0x5f4dd4[_0x6bfa('0x3d')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x5f4dd4[_0x6bfa('0x3d')]);return analyticCustomReportController[_0x6bfa('0x3c')]({'id':_0x5f4dd4['CustomReportId']},_0x5a7e8c)[_0x6bfa('0x2d')](handleResult(_0x5f4dd4))['catch'](handleError());}}catch(_0x5515c4){logger[_0x6bfa('0x2e')](JSON['stringify'](_0x5515c4));}return logger[_0x6bfa('0x2a')]('no\x20report\x20id');};}function getJobs(_0x387c7e){var _0x4c0651={};if(_0x387c7e){_0x4c0651['id']=_0x387c7e;}return db[_0x6bfa('0x3e')][_0x6bfa('0x3f')]({'where':_0x4c0651,'include':[{'model':db[_0x6bfa('0xf')],'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0x6bfa('0xd')}]}]})[_0x6bfa('0x2d')](function(_0x25dadb){var _0x5e118d=_[_0x6bfa('0x40')](manager['jobs']);var _0x378ebd=_[_0x6bfa('0x41')](_0x25dadb,function(_0x36aa0d){return _0x36aa0d['id'][_0x6bfa('0x42')]();});var _0x23a0de=_[_0x6bfa('0x43')](_0x25dadb,function(_0x8a4b2f){return _0x8a4b2f['id'][_0x6bfa('0x42')]();});var _0x2b78f9=_0x387c7e?_0x378ebd:_[_0x6bfa('0x44')](_0x378ebd,_0x5e118d);var _0x5e0c2b=_[_0x6bfa('0x45')](_0x378ebd,_0x5e118d);var _0x53e52a=_[_0x6bfa('0x44')](_0x5e118d,_0x378ebd);var _0x249e65;var _0x83a821;for(_0x249e65=0x0;_0x249e65<_0x53e52a[_0x6bfa('0x46')]&&!_0x387c7e;_0x249e65+=0x1){_0x83a821=_0x53e52a[_0x249e65]['toString']();if(manager[_0x6bfa('0x47')](_0x83a821)){manager[_0x6bfa('0x48')](_0x83a821);manager[_0x6bfa('0x49')](_0x83a821);logger[_0x6bfa('0x2a')](_0x6bfa('0x4a'),_0x83a821);}}logger[_0x6bfa('0x2a')]('toRun',JSON['stringify'](_0x2b78f9));for(_0x249e65=0x0;_0x249e65<_0x2b78f9[_0x6bfa('0x46')];_0x249e65+=0x1){_0x83a821=_0x2b78f9[_0x249e65]['toString']();logger[_0x6bfa('0x2a')]('index',_0x83a821);if(_0x387c7e){logger[_0x6bfa('0x2a')](_0x6bfa('0x4b'),_0x387c7e);logger[_0x6bfa('0x2a')](JSON['stringify'](_0x23a0de[_0x83a821]));BPromise[_0x6bfa('0x4c')]()[_0x6bfa('0x2d')](handleJob(_0x23a0de[_0x83a821]));logger['info'](_0x6bfa('0x4d'),_0x23a0de[_0x83a821][_0x6bfa('0x19')],_0x23a0de[_0x83a821][_0x6bfa('0x4e')]);}else if(_0x23a0de[_0x83a821][_0x6bfa('0x4e')]&&_0x23a0de[_0x83a821][_0x6bfa('0x4f')]&&moment()[_0x6bfa('0x50')](_0x23a0de[_0x83a821]['startAt'],_0x23a0de[_0x83a821]['endAt'])){manager[_0x6bfa('0x51')](_0x83a821,_0x23a0de[_0x83a821][_0x6bfa('0x4e')],handleJob(_0x23a0de[_0x83a821]));manager['start'](_0x83a821);logger['info'](_0x6bfa('0x52'),_0x23a0de[_0x83a821]['name'],_0x23a0de[_0x83a821][_0x6bfa('0x4e')]);}else if(manager[_0x6bfa('0x47')](_0x83a821)){manager[_0x6bfa('0x48')](_0x83a821);manager['deleteJob'](_0x83a821);logger[_0x6bfa('0x2a')](_0x6bfa('0x53'),_0x23a0de[_0x83a821][_0x6bfa('0x19')],_0x23a0de[_0x83a821][_0x6bfa('0x4e')]);}}for(_0x249e65=0x0,_0x83a821;_0x249e65<_0x5e0c2b[_0x6bfa('0x46')]&&!_0x387c7e;_0x249e65+=0x1){_0x83a821=_0x5e0c2b[_0x249e65][_0x6bfa('0x42')]();if(manager['exists'](_0x83a821)){if(_0x23a0de[_0x83a821][_0x6bfa('0x4e')]&&_0x23a0de[_0x83a821]['active']&&moment()[_0x6bfa('0x50')](_0x23a0de[_0x83a821]['startAt'],_0x23a0de[_0x83a821][_0x6bfa('0x54')])){manager[_0x6bfa('0x55')](_0x83a821,_0x23a0de[_0x83a821][_0x6bfa('0x4e')],handleJob(_0x23a0de[_0x83a821]));logger[_0x6bfa('0x2a')]('update\x20cron',_0x23a0de[_0x83a821]['name'],_0x23a0de[_0x83a821]['cron']);}else{manager['stop'](_0x83a821);manager['deleteJob'](_0x83a821);logger[_0x6bfa('0x2a')](_0x6bfa('0x53'),_0x23a0de[_0x83a821][_0x6bfa('0x19')],_0x23a0de[_0x83a821][_0x6bfa('0x4e')]);}}}})[_0x6bfa('0x31')](function(_0x56b91f){logger[_0x6bfa('0x2e')](JSON[_0x6bfa('0x27')](_0x56b91f));});}exports[_0x6bfa('0x56')]=function(_0x3ecd56){return getJobs(_0x3ecd56);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb8e2=['status','Sent','message','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','existsSync','attachments','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','then','error\x20mail','catch','error','data','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','my\x20id','run\x20job','cron','startAt','add','start','exists','active','isBetween','endAt','update\x20cron','stop\x20cron','path','lodash','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','email','bcc','format','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip'];(function(_0x4aba55,_0x12217e){var _0x40e64b=function(_0x19c6a4){while(--_0x19c6a4){_0x4aba55['push'](_0x4aba55['shift']());}};_0x40e64b(++_0x12217e);}(_0xb8e2,0x141));var _0x2b8e=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xb8e2[_0x41582d];return _0x59c504;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x2b8e('0x0'));var _=require(_0x2b8e('0x1'));var moment=require('moment');var CronJobManager=require(_0x2b8e('0x2'));var jayson=require(_0x2b8e('0x3'));var BPromise=require(_0x2b8e('0x4'));var logger=require('../logger')('schedule');var db=require(_0x2b8e('0x5'))['db'];var analyticCustomReportController=require(_0x2b8e('0x6'));var analyticDefaultReportController=require(_0x2b8e('0x7'));var client=jayson[_0x2b8e('0x8')][_0x2b8e('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2996ca,_0x59f6f6){return function(){logger[_0x2b8e('0xa')](_0x2b8e('0xb'),_0x2996ca['email']);var _0x5bfde6=!![];var _0x35e962={'tls':{'rejectUnauthorized':![]}};if(_0x2996ca[_0x2b8e('0xc')][_0x2b8e('0xd')][_0x2b8e('0xe')]){_0x35e962[_0x2b8e('0xe')]=_0x2996ca[_0x2b8e('0xc')][_0x2b8e('0xd')]['service'];}else{_0x35e962[_0x2b8e('0xf')]=_0x2996ca[_0x2b8e('0xc')][_0x2b8e('0xd')][_0x2b8e('0xf')];_0x35e962[_0x2b8e('0x10')]=_0x2996ca[_0x2b8e('0xc')][_0x2b8e('0xd')][_0x2b8e('0x10')];_0x35e962['secure']=_0x2996ca['MailAccount'][_0x2b8e('0xd')][_0x2b8e('0x11')];}if(_0x2996ca['MailAccount'][_0x2b8e('0xd')][_0x2b8e('0x12')]){_0x35e962[_0x2b8e('0x13')]={'user':_0x2996ca['MailAccount'][_0x2b8e('0xd')][_0x2b8e('0x14')],'pass':_0x2996ca[_0x2b8e('0xc')]['Smtp'][_0x2b8e('0x15')]};}var _0x1b39ae={'account':_0x35e962,'message':{'from':util['format'](_0x2b8e('0x16'),_0x2996ca[_0x2b8e('0xc')][_0x2b8e('0x17')],_0x2996ca['MailAccount'][_0x2b8e('0x18')]||_0x2996ca[_0x2b8e('0xc')]['Smtp'][_0x2b8e('0x14')]),'to':_0x2996ca[_0x2b8e('0x18')],'cc':_0x2996ca['cc'],'bcc':_0x2996ca[_0x2b8e('0x19')],'subject':util[_0x2b8e('0x1a')]('Report\x20%s\x20last\x20%s\x20%s',_0x59f6f6[_0x2b8e('0x17')],_0x2996ca[_0x2b8e('0x1b')],_0x2996ca[_0x2b8e('0x1c')])}};var _0x2553d5=path[_0x2b8e('0x1d')](__dirname,_0x2b8e('0x1e'));var _0xce989c=_0x59f6f6[_0x2b8e('0x1f')];var _0x50a124=util[_0x2b8e('0x1a')](_0x2b8e('0x20'),path[_0x2b8e('0x21')](_0x59f6f6[_0x2b8e('0x1f')],path['extname'](_0x59f6f6[_0x2b8e('0x1f')])),_0x2b8e('0x22'));var _0x59d3fd=path[_0x2b8e('0x1d')](_0x2553d5,_0xce989c);var _0x124e5a=path['join'](_0x2553d5,_0x50a124);if(fs['existsSync'](_0x59d3fd)){_0x59f6f6[_0x2b8e('0x23')]=_0x2b8e('0x24');_0x1b39ae[_0x2b8e('0x25')]['attachments']=[{'filename':_0xce989c,'path':_0x59d3fd}];_0x1b39ae['message'][_0x2b8e('0x26')]=util[_0x2b8e('0x1a')](_0x2b8e('0x27'),JSON[_0x2b8e('0x28')](_0x59f6f6,null,0x2));}else if(fs[_0x2b8e('0x29')](_0x124e5a)){_0x59f6f6['status']=_0x2b8e('0x24');_0x1b39ae[_0x2b8e('0x25')][_0x2b8e('0x2a')]=[{'filename':_0x50a124,'path':_0x124e5a}];}else{_0x1b39ae['message'][_0x2b8e('0x26')]=_0x2b8e('0x2b');if(!_0x2996ca[_0x2b8e('0x2c')]){_0x5bfde6=![];logger[_0x2b8e('0xa')](_0x2b8e('0x2d'));}}if(_0x5bfde6){return client[_0x2b8e('0x2e')]('SendMail',_0x1b39ae)[_0x2b8e('0x2f')](function(_0x553621){if(_0x553621['error']){return logger['error'](_0x2b8e('0x30'),JSON[_0x2b8e('0x28')](_0x553621));}return logger[_0x2b8e('0xa')]('email\x20sent');})[_0x2b8e('0x31')](function(_0x2a4b78){return logger[_0x2b8e('0x32')](_0x2b8e('0x30'),JSON['stringify'](_0x2a4b78));});}};}function handleError(){return function(_0x1c33dc){return logger[_0x2b8e('0x32')](JSON[_0x2b8e('0x28')](_0x1c33dc));};}function handleResult(_0xe36b3b){return function(_0x5abf26){logger[_0x2b8e('0xa')](_0x2b8e('0x33'),JSON[_0x2b8e('0x28')](_0x5abf26));if(_0xe36b3b[_0x2b8e('0xc')]&&_0xe36b3b[_0x2b8e('0xc')]['Smtp']&&!_[_0x2b8e('0x34')](_0xe36b3b['email'])){setTimeout(handleSendEmail(_0xe36b3b,_0x5abf26),0x3c*0x3e8);}};}function handleJob(_0x276552){return function(){try{if(_[_0x2b8e('0x34')](_0x276552[_0x2b8e('0x1b')])){return logger[_0x2b8e('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x276552[_0x2b8e('0x1c')])){return logger[_0x2b8e('0xa')]('subtractUnit\x20null\x20or\x20undefined');}var _0x920b6b={'startDate':moment()[_0x2b8e('0x35')](_0x276552[_0x2b8e('0x1b')],_0x276552[_0x2b8e('0x1c')])['format'](_0x2b8e('0x36')),'endDate':moment()[_0x2b8e('0x1a')](_0x2b8e('0x36')),'type':_0x2b8e('0x37'),'output':_0x276552[_0x2b8e('0x38')],'name':_0x276552[_0x2b8e('0x17')]};if(!_[_0x2b8e('0x34')](_0x276552[_0x2b8e('0x39')])){logger[_0x2b8e('0xa')](_0x2b8e('0x3a'),_0x276552[_0x2b8e('0x39')]);return analyticDefaultReportController[_0x2b8e('0x3b')]({'id':_0x276552['DefaultReportId']},_0x920b6b)[_0x2b8e('0x2f')](handleResult(_0x276552))[_0x2b8e('0x31')](handleError());}if(!_[_0x2b8e('0x34')](_0x276552[_0x2b8e('0x3c')])){logger[_0x2b8e('0xa')](_0x2b8e('0x3d'),_0x276552['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x276552[_0x2b8e('0x3c')]},_0x920b6b)[_0x2b8e('0x2f')](handleResult(_0x276552))[_0x2b8e('0x31')](handleError());}}catch(_0x1281cb){logger['error'](JSON[_0x2b8e('0x28')](_0x1281cb));}return logger[_0x2b8e('0xa')](_0x2b8e('0x3e'));};}function getJobs(_0x5c50a7){var _0x4d5f7f={};if(_0x5c50a7){_0x4d5f7f['id']=_0x5c50a7;}return db[_0x2b8e('0x3f')][_0x2b8e('0x40')]({'where':_0x4d5f7f,'include':[{'model':db[_0x2b8e('0xc')],'attributes':['id',_0x2b8e('0x17'),_0x2b8e('0x18')],'include':[{'model':db['MailServerOut'],'as':_0x2b8e('0xd')}]}]})[_0x2b8e('0x2f')](function(_0x42ed22){var _0x1de35d=_[_0x2b8e('0x41')](manager[_0x2b8e('0x42')]);var _0x99ed99=_[_0x2b8e('0x43')](_0x42ed22,function(_0x3b2355){return _0x3b2355['id'][_0x2b8e('0x44')]();});var _0x16a3e2=_[_0x2b8e('0x45')](_0x42ed22,function(_0xc2a1ed){return _0xc2a1ed['id'][_0x2b8e('0x44')]();});var _0x597c55=_0x5c50a7?_0x99ed99:_[_0x2b8e('0x46')](_0x99ed99,_0x1de35d);var _0x2ca962=_[_0x2b8e('0x47')](_0x99ed99,_0x1de35d);var _0x3e23fc=_[_0x2b8e('0x46')](_0x1de35d,_0x99ed99);var _0x450747;var _0x1fea19;for(_0x450747=0x0;_0x450747<_0x3e23fc[_0x2b8e('0x48')]&&!_0x5c50a7;_0x450747+=0x1){_0x1fea19=_0x3e23fc[_0x450747][_0x2b8e('0x44')]();if(manager['exists'](_0x1fea19)){manager[_0x2b8e('0x49')](_0x1fea19);manager[_0x2b8e('0x4a')](_0x1fea19);logger[_0x2b8e('0xa')](_0x2b8e('0x4b'),_0x1fea19);}}logger['info'](_0x2b8e('0x4c'),JSON[_0x2b8e('0x28')](_0x597c55));for(_0x450747=0x0;_0x450747<_0x597c55[_0x2b8e('0x48')];_0x450747+=0x1){_0x1fea19=_0x597c55[_0x450747][_0x2b8e('0x44')]();logger[_0x2b8e('0xa')]('index',_0x1fea19);if(_0x5c50a7){logger[_0x2b8e('0xa')](_0x2b8e('0x4d'),_0x5c50a7);logger[_0x2b8e('0xa')](JSON['stringify'](_0x16a3e2[_0x1fea19]));BPromise['resolve']()[_0x2b8e('0x2f')](handleJob(_0x16a3e2[_0x1fea19]));logger['info'](_0x2b8e('0x4e'),_0x16a3e2[_0x1fea19][_0x2b8e('0x17')],_0x16a3e2[_0x1fea19][_0x2b8e('0x4f')]);}else if(_0x16a3e2[_0x1fea19][_0x2b8e('0x4f')]&&_0x16a3e2[_0x1fea19]['active']&&moment()['isBetween'](_0x16a3e2[_0x1fea19][_0x2b8e('0x50')],_0x16a3e2[_0x1fea19]['endAt'])){manager[_0x2b8e('0x51')](_0x1fea19,_0x16a3e2[_0x1fea19][_0x2b8e('0x4f')],handleJob(_0x16a3e2[_0x1fea19]));manager[_0x2b8e('0x52')](_0x1fea19);logger['info']('add\x20cron',_0x16a3e2[_0x1fea19][_0x2b8e('0x17')],_0x16a3e2[_0x1fea19][_0x2b8e('0x4f')]);}else if(manager[_0x2b8e('0x53')](_0x1fea19)){manager[_0x2b8e('0x49')](_0x1fea19);manager[_0x2b8e('0x4a')](_0x1fea19);logger[_0x2b8e('0xa')]('stop\x20cron',_0x16a3e2[_0x1fea19][_0x2b8e('0x17')],_0x16a3e2[_0x1fea19][_0x2b8e('0x4f')]);}}for(_0x450747=0x0,_0x1fea19;_0x450747<_0x2ca962[_0x2b8e('0x48')]&&!_0x5c50a7;_0x450747+=0x1){_0x1fea19=_0x2ca962[_0x450747]['toString']();if(manager[_0x2b8e('0x53')](_0x1fea19)){if(_0x16a3e2[_0x1fea19]['cron']&&_0x16a3e2[_0x1fea19][_0x2b8e('0x54')]&&moment()[_0x2b8e('0x55')](_0x16a3e2[_0x1fea19]['startAt'],_0x16a3e2[_0x1fea19][_0x2b8e('0x56')])){manager['update'](_0x1fea19,_0x16a3e2[_0x1fea19][_0x2b8e('0x4f')],handleJob(_0x16a3e2[_0x1fea19]));logger['info'](_0x2b8e('0x57'),_0x16a3e2[_0x1fea19][_0x2b8e('0x17')],_0x16a3e2[_0x1fea19][_0x2b8e('0x4f')]);}else{manager[_0x2b8e('0x49')](_0x1fea19);manager[_0x2b8e('0x4a')](_0x1fea19);logger[_0x2b8e('0xa')](_0x2b8e('0x58'),_0x16a3e2[_0x1fea19]['name'],_0x16a3e2[_0x1fea19]['cron']);}}}})[_0x2b8e('0x31')](function(_0x9c04cd){logger[_0x2b8e('0x32')](JSON[_0x2b8e('0x28')](_0x9c04cd));});}exports['run']=function(_0x50cf64){return getJobs(_0x50cf64);};exports[_0x2b8e('0x52')]=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 00d8407..79b1009 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8cc=['CmContact','then','bulkCreate','log','finished\x20populating','CmHopper','destroy','hopper1','contacts2','hopper2','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now'];(function(_0x3aac86,_0x51b2d2){var _0x1d3986=function(_0x3fa789){while(--_0x3fa789){_0x3aac86['push'](_0x3aac86['shift']());}};_0x1d3986(++_0x51b2d2);}(_0xa8cc,0xf8));var _0xca8c=function(_0x222185,_0x40228f){_0x222185=_0x222185-0x0;var _0x157f9f=_0xa8cc[_0x222185];return _0x157f9f;};'use strict';var util=require('util');var db=require(_0xca8c('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xca8c('0x1')]({'id':i,'firstName':_0xca8c('0x2')+i,'lastName':_0xca8c('0x3')+i,'phone':0xf879fb460+i,'email':_0xca8c('0x4')+i+_0xca8c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xca8c('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xca8c('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xca8c('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xca8c('0x4')+i+_0xca8c('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xca8c('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xca8c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xca8c('0x6')](),'updatedAt':Date[_0xca8c('0x6')]()});}db[_0xca8c('0x7')]['destroy']({'where':{}})[_0xca8c('0x8')](function(){return db[_0xca8c('0x7')][_0xca8c('0x9')](contacts);})['then'](function(){console[_0xca8c('0xa')](_0xca8c('0xb'),'contacts1');return db[_0xca8c('0xc')][_0xca8c('0xd')]({'where':{}});})[_0xca8c('0x8')](function(){return db[_0xca8c('0xc')]['bulkCreate'](hopper);})['then'](function(){console['log']('finished\x20populating',_0xca8c('0xe'));return db[_0xca8c('0x7')][_0xca8c('0x9')](contacts2);})[_0xca8c('0x8')](function(){console[_0xca8c('0xa')](_0xca8c('0xb'),_0xca8c('0xf'));return db[_0xca8c('0xc')]['bulkCreate'](hopper2);})[_0xca8c('0x8')](function(){console[_0xca8c('0xa')](_0xca8c('0xb'),_0xca8c('0x10'));})['catch'](function(_0x210f83){console['log'](_0x210f83);}); \ No newline at end of file +var _0xca7a=['then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','hopper1','contacts2','hopper2','catch','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xca7a,0x1a8));var _0xaca7=function(_0x9f9816,_0x579b0e){_0x9f9816=_0x9f9816-0x0;var _0x40a913=_0xca7a[_0x9f9816];return _0x40a913;};'use strict';var util=require('util');var db=require(_0xaca7('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xaca7('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xaca7('0x2')+i,'phone':0xf879fb460+i,'email':_0xaca7('0x3')+i+_0xaca7('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xaca7('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaca7('0x5')](),'updatedAt':Date[_0xaca7('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xaca7('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xaca7('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xaca7('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xaca7('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xaca7('0x5')]()});}db[_0xaca7('0x6')][_0xaca7('0x7')]({'where':{}})[_0xaca7('0x8')](function(){return db[_0xaca7('0x6')][_0xaca7('0x9')](contacts);})['then'](function(){console['log'](_0xaca7('0xa'),_0xaca7('0xb'));return db['CmHopper']['destroy']({'where':{}});})[_0xaca7('0x8')](function(){return db[_0xaca7('0xc')][_0xaca7('0x9')](hopper);})[_0xaca7('0x8')](function(){console[_0xaca7('0xd')](_0xaca7('0xa'),_0xaca7('0xe'));return db[_0xaca7('0x6')][_0xaca7('0x9')](contacts2);})['then'](function(){console[_0xaca7('0xd')](_0xaca7('0xa'),_0xaca7('0xf'));return db[_0xaca7('0xc')][_0xaca7('0x9')](hopper2);})[_0xaca7('0x8')](function(){console[_0xaca7('0xd')](_0xaca7('0xa'),_0xaca7('0x10'));})[_0xaca7('0x11')](function(_0x1b10e7){console[_0xaca7('0xd')](_0x1b10e7);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 87ff8cb..a56b24f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55cf=['\x22%s\x22\x20<%s>','User','bulkCreate','then','util','../mysqldb','push','format','%s%s','agent','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x4827ea,_0x1478b1){var _0x50229a=function(_0x4f5126){while(--_0x4f5126){_0x4827ea['push'](_0x4827ea['shift']());}};_0x50229a(++_0x1478b1);}(_0x55cf,0x19c));var _0xf55c=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x55cf[_0x4dcc2d];return _0x1bbd79;};'use strict';var util=require(_0xf55c('0x0'));var db=require(_0xf55c('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf55c('0x2')]({'name':util[_0xf55c('0x3')](_0xf55c('0x4'),_0xf55c('0x5'),i),'fullname':util['format']('%s%s',_0xf55c('0x5'),i),'email':util[_0xf55c('0x3')]('%s%s@xcally.com',_0xf55c('0x5'),i),'role':_0xf55c('0x5'),'password':_0xf55c('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0xf55c('0x7'),'ws',_0xf55c('0x8')],'disallow':[_0xf55c('0x9')],'allow':[_0xf55c('0xa')],'defaultuser':util[_0xf55c('0x3')](_0xf55c('0x4'),_0xf55c('0x5'),i),'encryption':_0xf55c('0xb'),'avpf':_0xf55c('0xb'),'force_avp':_0xf55c('0xb'),'icesupport':_0xf55c('0xb'),'dtlsenable':_0xf55c('0xb'),'dtlsverify':'no','dtlscertfile':_0xf55c('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0xf55c('0x3')](_0xf55c('0xd'),util[_0xf55c('0x3')]('%s%s',_0xf55c('0x5'),i),0xfa0+i)});}db[_0xf55c('0xe')][_0xf55c('0xf')](users)[_0xf55c('0x10')](function(){console['log']('add\x20user');})['catch'](function(_0x3e4207){console['log'](_0x3e4207);}); \ No newline at end of file +var _0xe6ad=['log','add\x20user','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xe6ad,0x12e));var _0xde6a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xe6ad[_0x2f5ac5];return _0x37c9a8;};'use strict';var util=require(_0xde6a('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xde6a('0x1')]({'name':util[_0xde6a('0x2')](_0xde6a('0x3'),_0xde6a('0x4'),i),'fullname':util[_0xde6a('0x2')]('%s%s','agent',i),'email':util[_0xde6a('0x2')](_0xde6a('0x5'),_0xde6a('0x4'),i),'role':_0xde6a('0x4'),'password':_0xde6a('0x6'),'internal':0xfa0+i,'type':_0xde6a('0x7'),'transport':['udp','ws',_0xde6a('0x8')],'disallow':[_0xde6a('0x9')],'allow':[_0xde6a('0xa')],'defaultuser':util[_0xde6a('0x2')](_0xde6a('0x3'),_0xde6a('0x4'),i),'encryption':_0xde6a('0xb'),'avpf':_0xde6a('0xb'),'force_avp':'yes','icesupport':_0xde6a('0xb'),'dtlsenable':_0xde6a('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xde6a('0xc'),'dtlssetup':_0xde6a('0xd'),'callerid':util[_0xde6a('0x2')](_0xde6a('0xe'),util[_0xde6a('0x2')](_0xde6a('0x3'),_0xde6a('0x4'),i),0xfa0+i)});}db[_0xde6a('0xf')][_0xde6a('0x10')](users)[_0xde6a('0x11')](function(){console[_0xde6a('0x12')](_0xde6a('0x13'));})['catch'](function(_0xb8231d){console['log'](_0xb8231d);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index dd3bb55..1984843 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4468=['VoiceQueue','ChatQueue','Trunk','getVoiceQueues','getFaxQueues','getMailQueues','all','chat','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','type','leave','ChatInteractions','MailInteractions','removeMailInteractions','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','user_has_openchannel_interactions:remove','log','join','connection','setMaxListeners','request','remotePort','connectedAt','address','CONNECTED','lodash','./environment','Agents','User','role','agent','name','telephone','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','FaxInteractions','OpenchannelInteraction','admin','voice:outbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x4468,0x1b6));var _0x8446=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4468[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x8446('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require(_0x8446('0x1'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x8446('0x2'),'model':db[_0x8446('0x3')],'attributes':['id','name',_0x8446('0x4')],'raw':!![],'where':{'role':_0x8446('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8446('0x6')],'where':{'role':_0x8446('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8446('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x8446('0x6')],'where':{'role':_0x8446('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8446('0x6'),'type'],'where':{'type':_0x8446('0x8')}};function getAssociatedResources(_0x492420,_0x2f5dc0,_0x2c0cbe){return db[_0x8446('0x9')]['findOne']({'where':{'name':_0x492420,'userProfileId':_0x2f5dc0},'raw':!![]})[_0x8446('0xa')](function(_0x585a8c){if(_0x585a8c){if(_0x585a8c[_0x8446('0xb')]){switch(_0x492420){case _0x8446('0xc'):case _0x8446('0xd'):case _0x8446('0xe'):case _0x8446('0xf'):case _0x8446('0x10'):case _0x8446('0x11'):return db[_0x2c0cbe][_0x8446('0x12')](queryQueues);case _0x8446('0x13'):return db[_0x2c0cbe][_0x8446('0x12')](queryTelephones);case _0x8446('0x14'):return db[_0x2c0cbe][_0x8446('0x12')](queryTrunks);case _0x8446('0x15'):return db[_0x2c0cbe]['findAll'](queryCampaigns);}}else{return db[_0x8446('0x16')][_0x8446('0x12')]({'attributes':[_0x8446('0x17')],'where':{'sectionId':_0x585a8c['id']},'raw':!![]})[_0x8446('0xa')](function(_0x47dfe5){if(_0x47dfe5){var _0xcbd2a2={'where':{'id':_[_0x8446('0x18')](_0x47dfe5,_0x8446('0x17'))},'raw':!![]};switch(_0x2c0cbe){case _0x8446('0x3'):_0xcbd2a2['where'][_0x8446('0x4')]='telephone';break;case _0x8446('0x19'):_0xcbd2a2[_0x8446('0x1a')]['type']='ivr';break;}return db[_0x2c0cbe][_0x8446('0x12')](_0xcbd2a2);}else{return[];}});}}else{return[];}})[_0x8446('0xa')](function(_0x405ba6){return _0x405ba6;});}function joinOrLeaveQueues(_0x2815d6,_0x19e124,_0x1f6d05,_0x1634cc){_0x2815d6[_0x19e124](util[_0x8446('0x1b')](_0x8446('0x1c'),_0x1f6d05,_0x1634cc[_0x8446('0x6')]));if(_0x1634cc[_0x8446('0x2')]){for(var _0x34bcf3=0x0;_0x34bcf3<_0x1634cc[_0x8446('0x2')][_0x8446('0x1d')];_0x34bcf3+=0x1){_0x2815d6[_0x19e124](util[_0x8446('0x1b')](_0x8446('0x1e'),_0x1634cc[_0x8446('0x2')][_0x34bcf3][_0x8446('0x6')]));}}}function joinOrLeave(_0x1506f0,_0x4a4bc4,_0xd86fd4){var _0xf429fa;if(_0x1506f0[_0x8446('0x1f')][_0x8446('0x20')]['id']){db[_0x8446('0x3')][_0x8446('0x21')]({'attributes':['id',_0x8446('0x6'),'role',_0x8446('0x22')],'where':{'id':_0x1506f0[_0x8446('0x1f')][_0x8446('0x20')]['id']},'include':[{'model':db[_0x8446('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8446('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x8446('0x25'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8446('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x27614b){if(_0x27614b){_0xf429fa=_0x27614b;_0x1506f0[_0x4a4bc4](util[_0x8446('0x1b')](_0x8446('0x1e'),_0x27614b[_0x8446('0x6')]));var _0x7b5078=[];switch(_0x27614b['role']){case _0x8446('0x27'):_0x1506f0[_0x4a4bc4]('voice:inbound');_0x1506f0[_0x4a4bc4](_0x8446('0x28'));if(queryQueues[_0x8446('0x29')](_0x8446('0x2a'))){delete queryQueues[_0x8446('0x2a')];}_0x7b5078['push'](db['VoiceQueue']['findAll'](queryQueues));_0x7b5078[_0x8446('0x2b')](db['ChatQueue']['findAll'](queryQueues));_0x7b5078[_0x8446('0x2b')](db[_0x8446('0x2c')][_0x8446('0x12')](queryQueues));_0x7b5078['push'](db[_0x8446('0x2d')][_0x8446('0x12')](queryQueues));_0x7b5078['push'](db[_0x8446('0x2e')][_0x8446('0x12')](queryQueues));_0x7b5078[_0x8446('0x2b')](db[_0x8446('0x2f')][_0x8446('0x12')](queryQueues));_0x7b5078[_0x8446('0x2b')](db['User'][_0x8446('0x12')](queryTelephones));_0x7b5078[_0x8446('0x2b')](db['Trunk'][_0x8446('0x12')](queryTrunks));_0x7b5078['push'](db[_0x8446('0x19')]['findAll'](queryCampaigns));_0x7b5078['push'](db[_0x8446('0x3')][_0x8446('0x12')](queryAgents));break;case'user':_0x1506f0[_0x4a4bc4]('voice:inbound');_0x1506f0[_0x4a4bc4](_0x8446('0x28'));_0x7b5078['push'](getAssociatedResources(_0x8446('0xc'),_0x27614b[_0x8446('0x22')],_0x8446('0x30')));_0x7b5078[_0x8446('0x2b')](getAssociatedResources(_0x8446('0xd'),_0x27614b['userProfileId'],_0x8446('0x31')));_0x7b5078[_0x8446('0x2b')](getAssociatedResources(_0x8446('0xe'),_0x27614b[_0x8446('0x22')],_0x8446('0x2c')));_0x7b5078[_0x8446('0x2b')](getAssociatedResources(_0x8446('0xf'),_0x27614b['userProfileId'],_0x8446('0x2d')));_0x7b5078[_0x8446('0x2b')](getAssociatedResources(_0x8446('0x10'),_0x27614b[_0x8446('0x22')],_0x8446('0x2e')));_0x7b5078['push'](getAssociatedResources(_0x8446('0x11'),_0x27614b['userProfileId'],_0x8446('0x2f')));_0x7b5078[_0x8446('0x2b')](getAssociatedResources(_0x8446('0x13'),_0x27614b[_0x8446('0x22')],'User'));_0x7b5078[_0x8446('0x2b')](getAssociatedResources(_0x8446('0x14'),_0x27614b['userProfileId'],_0x8446('0x32')));_0x7b5078['push'](getAssociatedResources(_0x8446('0x15'),_0x27614b['userProfileId'],_0x8446('0x19')));_0x7b5078['push'](db[_0x8446('0x3')][_0x8446('0x12')](queryAgents));break;case _0x8446('0x5'):_0x1506f0[_0x4a4bc4]('voice:inbound');_0x1506f0[_0x4a4bc4](_0x8446('0x28'));_0x7b5078['push'](_0x27614b[_0x8446('0x33')]({'attributes':['id','name']}));_0x7b5078[_0x8446('0x2b')](_0x27614b['getChatQueues']({'attributes':['id',_0x8446('0x6')]}));_0x7b5078['push'](_0x27614b[_0x8446('0x34')]({'attributes':['id',_0x8446('0x6')]}));_0x7b5078[_0x8446('0x2b')](_0x27614b['getSmsQueues']({'attributes':['id',_0x8446('0x6')]}));_0x7b5078['push'](_0x27614b[_0x8446('0x35')]({'attributes':['id','name']}));_0x7b5078['push'](_0x27614b['getOpenchannelQueues']({'attributes':['id','name']}));break;}return BPromise[_0x8446('0x36')](_0x7b5078);}})[_0x8446('0xa')](function(_0x343220){if(_0x343220&&_0x343220[_0x8446('0x1d')]){for(var _0x2f78cc=0x0;_0x2f78cc<_0x343220['length'];_0x2f78cc+=0x1){for(var _0x3f77f4=0x0;_0x3f77f4<_0x343220[_0x2f78cc][_0x8446('0x1d')];_0x3f77f4+=0x1){switch(_0x2f78cc){case 0x0:joinOrLeaveQueues(_0x1506f0,_0x4a4bc4,'voice',_0x343220[_0x2f78cc][_0x3f77f4]);break;case 0x1:joinOrLeaveQueues(_0x1506f0,_0x4a4bc4,_0x8446('0x37'),_0x343220[_0x2f78cc][_0x3f77f4]);break;case 0x2:joinOrLeaveQueues(_0x1506f0,_0x4a4bc4,'fax',_0x343220[_0x2f78cc][_0x3f77f4]);break;case 0x3:joinOrLeaveQueues(_0x1506f0,_0x4a4bc4,_0x8446('0x38'),_0x343220[_0x2f78cc][_0x3f77f4]);break;case 0x4:joinOrLeaveQueues(_0x1506f0,_0x4a4bc4,_0x8446('0x39'),_0x343220[_0x2f78cc][_0x3f77f4]);break;case 0x5:joinOrLeaveQueues(_0x1506f0,_0x4a4bc4,'openchannel',_0x343220[_0x2f78cc][_0x3f77f4]);break;case 0x6:_0x1506f0[_0x4a4bc4](util[_0x8446('0x1b')](_0x8446('0x3a'),_0x343220[_0x2f78cc][_0x3f77f4]['name']));break;case 0x7:_0x1506f0[_0x4a4bc4](util[_0x8446('0x1b')](_0x8446('0x3b'),_0x343220[_0x2f78cc][_0x3f77f4]['name']));break;case 0x8:_0x1506f0[_0x4a4bc4](util[_0x8446('0x1b')](_0x8446('0x3c'),_0x343220[_0x2f78cc][_0x3f77f4][_0x8446('0x3d')],_0x343220[_0x2f78cc][_0x3f77f4][_0x8446('0x6')]));break;case 0x9:_0x1506f0[_0x4a4bc4](util[_0x8446('0x1b')](_0x8446('0x1e'),_0x343220[_0x2f78cc][_0x3f77f4][_0x8446('0x6')]));break;}}}}})[_0x8446('0xa')](function(){if(_0x4a4bc4===_0x8446('0x3e')){var _0x226c8c=_[_0x8446('0x18')](_0xf429fa[_0x8446('0x3f')],'id');return _0xf429fa['removeChatInteractions'](_0x226c8c)[_0x8446('0xa')](function(){for(var _0x32f6d9=0x0;_0x32f6d9<_0x226c8c[_0x8446('0x1d')];_0x32f6d9+=0x1){_0xd86fd4['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x226c8c[_0x32f6d9]),'UserId':Number(_0xf429fa['id'])});}});}})[_0x8446('0xa')](function(){if(_0x4a4bc4===_0x8446('0x3e')){var _0x19d51d=_[_0x8446('0x18')](_0xf429fa[_0x8446('0x40')],'id');return _0xf429fa[_0x8446('0x41')](_0x19d51d)[_0x8446('0xa')](function(){for(var _0x4dbdd2=0x0;_0x4dbdd2<_0x19d51d[_0x8446('0x1d')];_0x4dbdd2+=0x1){_0xd86fd4['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x19d51d[_0x4dbdd2]),'UserId':Number(_0xf429fa['id'])});}});}})[_0x8446('0xa')](function(){if(_0x4a4bc4===_0x8446('0x3e')){var _0x2cbebe=_[_0x8446('0x18')](_0xf429fa[_0x8446('0x25')],'id');return _0xf429fa['removeFaxInteractions'](_0x2cbebe)['then'](function(){for(var _0x29b785=0x0;_0x29b785<_0x2cbebe['length'];_0x29b785+=0x1){_0xd86fd4[_0x8446('0x42')](_0x8446('0x43'),{'FaxInteractionId':Number(_0x2cbebe[_0x29b785]),'UserId':Number(_0xf429fa['id'])});}});}})[_0x8446('0xa')](function(){if(_0x4a4bc4===_0x8446('0x3e')){var _0x483a61=_[_0x8446('0x18')](_0xf429fa['SmsInteractions'],'id');return _0xf429fa[_0x8446('0x44')](_0x483a61)[_0x8446('0xa')](function(){for(var _0xbf01f8=0x0;_0xbf01f8<_0x483a61[_0x8446('0x1d')];_0xbf01f8+=0x1){_0xd86fd4[_0x8446('0x42')](_0x8446('0x45'),{'SmsInteractionId':Number(_0x483a61[_0xbf01f8]),'UserId':Number(_0xf429fa['id'])});}});}})[_0x8446('0xa')](function(){if(_0x4a4bc4==='leave'){var _0x2d3f2e=_[_0x8446('0x18')](_0xf429fa[_0x8446('0x46')],'id');return _0xf429fa['removeOpenchannelInteractions'](_0x2d3f2e)[_0x8446('0xa')](function(){for(var _0x214139=0x0;_0x214139<_0x2d3f2e['length'];_0x214139+=0x1){_0xd86fd4['emit'](_0x8446('0x47'),{'OpenchannelInteractionId':Number(_0x2d3f2e[_0x214139]),'UserId':Number(_0xf429fa['id'])});}});}})['catch'](function(_0x494e94){_0x1506f0[_0x8446('0x48')](_0x494e94);});}}function onDisconnect(_0x13f26a,_0x47944d){joinOrLeave(_0x13f26a,'leave',_0x47944d);}function onConnect(_0x5912e3){joinOrLeave(_0x5912e3,_0x8446('0x49'));}exports['default']=function(_0x14e58f){_0x14e58f['on'](_0x8446('0x4a'),function(_0x35c3b0){_0x35c3b0[_0x8446('0x4b')](0x0);_0x35c3b0['address']=_0x35c3b0[_0x8446('0x4c')][_0x8446('0x4a')]['remoteAddress']+':'+_0x35c3b0[_0x8446('0x4c')][_0x8446('0x4a')][_0x8446('0x4d')];_0x35c3b0[_0x8446('0x4e')]=new Date();_0x35c3b0[_0x8446('0x48')]=function(_0x27f9ea){console[_0x8446('0x48')]('SocketIO\x20'+_0x35c3b0['nsp'][_0x8446('0x6')]+'['+_0x35c3b0[_0x8446('0x4f')]+']',_0x27f9ea);};_0x35c3b0['on']('disconnect',function(){onDisconnect(_0x35c3b0,_0x14e58f);_0x35c3b0['log']('DISCONNECTED');});onConnect(_0x35c3b0);_0x35c3b0['log'](_0x8446('0x50'));});}; \ No newline at end of file +var _0xd4ae=['map','ChatInteractions','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','SmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','nsp','address','disconnect','CONNECTED','lodash','util','../mysqldb','./environment','name','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','UserProfileResource','resourceId','where','Agents','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','Trunk','user','OpenchannelQueue','Telephones','Campaign','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','trunk:%s','campaign:%s:%s','leave'];(function(_0xea9e1c,_0x577088){var _0x3bdb61=function(_0x35e3c1){while(--_0x35e3c1){_0xea9e1c['push'](_0xea9e1c['shift']());}};_0x3bdb61(++_0x577088);}(_0xd4ae,0x132));var _0xed4a=function(_0x4f8cba,_0x51d42b){_0x4f8cba=_0x4f8cba-0x0;var _0xe240a6=_0xd4ae[_0x4f8cba];return _0xe240a6;};'use strict';var _=require(_0xed4a('0x0'));var util=require(_0xed4a('0x1'));var BPromise=require('bluebird');var db=require(_0xed4a('0x2'))['db'];var config=require(_0xed4a('0x3'));var queryQueues={'attributes':['id',_0xed4a('0x4')],'include':[{'as':'Agents','model':db[_0xed4a('0x5')],'attributes':['id',_0xed4a('0x4'),_0xed4a('0x6')],'raw':!![],'where':{'role':_0xed4a('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xed4a('0x4')],'where':{'role':_0xed4a('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xed4a('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xed4a('0x4')],'where':{'role':_0xed4a('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xed4a('0x4'),_0xed4a('0x9')],'where':{'type':_0xed4a('0xa')}};function getAssociatedResources(_0x9ad089,_0x291f42,_0x115601){return db[_0xed4a('0xb')][_0xed4a('0xc')]({'where':{'name':_0x9ad089,'userProfileId':_0x291f42},'raw':!![]})[_0xed4a('0xd')](function(_0x2e52ea){if(_0x2e52ea){if(_0x2e52ea[_0xed4a('0xe')]){switch(_0x9ad089){case _0xed4a('0xf'):case _0xed4a('0x10'):case _0xed4a('0x11'):case _0xed4a('0x12'):case _0xed4a('0x13'):case _0xed4a('0x14'):return db[_0x115601][_0xed4a('0x15')](queryQueues);case'Telephones':return db[_0x115601][_0xed4a('0x15')](queryTelephones);case _0xed4a('0x16'):return db[_0x115601][_0xed4a('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x115601][_0xed4a('0x15')](queryCampaigns);}}else{return db[_0xed4a('0x17')][_0xed4a('0x15')]({'attributes':[_0xed4a('0x18')],'where':{'sectionId':_0x2e52ea['id']},'raw':!![]})[_0xed4a('0xd')](function(_0x28b483){if(_0x28b483){var _0x9d9a19={'where':{'id':_['map'](_0x28b483,_0xed4a('0x18'))},'raw':!![]};switch(_0x115601){case _0xed4a('0x5'):_0x9d9a19[_0xed4a('0x19')]['role']=_0xed4a('0x8');break;case'Campaign':_0x9d9a19[_0xed4a('0x19')][_0xed4a('0x9')]=_0xed4a('0xa');break;}return db[_0x115601]['findAll'](_0x9d9a19);}else{return[];}});}}else{return[];}})[_0xed4a('0xd')](function(_0x5700a5){return _0x5700a5;});}function joinOrLeaveQueues(_0x3cb40a,_0x4f92a1,_0x322355,_0x2a731a){_0x3cb40a[_0x4f92a1](util['format']('%s:queue:%s',_0x322355,_0x2a731a[_0xed4a('0x4')]));if(_0x2a731a[_0xed4a('0x1a')]){for(var _0xbfcc90=0x0;_0xbfcc90<_0x2a731a['Agents']['length'];_0xbfcc90+=0x1){_0x3cb40a[_0x4f92a1](util[_0xed4a('0x1b')](_0xed4a('0x1c'),_0x2a731a['Agents'][_0xbfcc90]['name']));}}}function joinOrLeave(_0x272548,_0x15a253,_0x1afa87){var _0x5af61a;if(_0x272548[_0xed4a('0x1d')][_0xed4a('0x1e')]['id']){db['User'][_0xed4a('0x1f')]({'attributes':['id',_0xed4a('0x4'),'role',_0xed4a('0x20')],'where':{'id':_0x272548[_0xed4a('0x1d')][_0xed4a('0x1e')]['id']},'include':[{'model':db[_0xed4a('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xed4a('0x22')],'as':_0xed4a('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xed4a('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xed4a('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xed4a('0x26')],'as':_0xed4a('0x27'),'attributes':['id'],'raw':!![]}]})[_0xed4a('0xd')](function(_0x10b750){if(_0x10b750){_0x5af61a=_0x10b750;_0x272548[_0x15a253](util[_0xed4a('0x1b')]('user:%s',_0x10b750['name']));var _0x269f17=[];switch(_0x10b750['role']){case'admin':_0x272548[_0x15a253](_0xed4a('0x28'));_0x272548[_0x15a253](_0xed4a('0x29'));if(queryQueues[_0xed4a('0x2a')](_0xed4a('0x2b'))){delete queryQueues['include'];}_0x269f17[_0xed4a('0x2c')](db[_0xed4a('0x2d')][_0xed4a('0x15')](queryQueues));_0x269f17['push'](db[_0xed4a('0x2e')][_0xed4a('0x15')](queryQueues));_0x269f17[_0xed4a('0x2c')](db[_0xed4a('0x2f')][_0xed4a('0x15')](queryQueues));_0x269f17['push'](db[_0xed4a('0x30')][_0xed4a('0x15')](queryQueues));_0x269f17[_0xed4a('0x2c')](db[_0xed4a('0x31')][_0xed4a('0x15')](queryQueues));_0x269f17['push'](db['OpenchannelQueue']['findAll'](queryQueues));_0x269f17[_0xed4a('0x2c')](db['User'][_0xed4a('0x15')](queryTelephones));_0x269f17[_0xed4a('0x2c')](db[_0xed4a('0x32')]['findAll'](queryTrunks));_0x269f17[_0xed4a('0x2c')](db['Campaign'][_0xed4a('0x15')](queryCampaigns));_0x269f17[_0xed4a('0x2c')](db['User'][_0xed4a('0x15')](queryAgents));break;case _0xed4a('0x33'):_0x272548[_0x15a253](_0xed4a('0x28'));_0x272548[_0x15a253]('voice:outbound');_0x269f17[_0xed4a('0x2c')](getAssociatedResources(_0xed4a('0xf'),_0x10b750[_0xed4a('0x20')],_0xed4a('0x2d')));_0x269f17['push'](getAssociatedResources(_0xed4a('0x10'),_0x10b750[_0xed4a('0x20')],_0xed4a('0x2e')));_0x269f17['push'](getAssociatedResources('FaxQueues',_0x10b750['userProfileId'],_0xed4a('0x2f')));_0x269f17[_0xed4a('0x2c')](getAssociatedResources('SmsQueues',_0x10b750['userProfileId'],'SmsQueue'));_0x269f17['push'](getAssociatedResources('MailQueues',_0x10b750[_0xed4a('0x20')],_0xed4a('0x31')));_0x269f17[_0xed4a('0x2c')](getAssociatedResources(_0xed4a('0x14'),_0x10b750[_0xed4a('0x20')],_0xed4a('0x34')));_0x269f17[_0xed4a('0x2c')](getAssociatedResources(_0xed4a('0x35'),_0x10b750[_0xed4a('0x20')],_0xed4a('0x5')));_0x269f17[_0xed4a('0x2c')](getAssociatedResources(_0xed4a('0x16'),_0x10b750[_0xed4a('0x20')],_0xed4a('0x32')));_0x269f17[_0xed4a('0x2c')](getAssociatedResources('IvrCampaigns',_0x10b750['userProfileId'],_0xed4a('0x36')));_0x269f17[_0xed4a('0x2c')](db[_0xed4a('0x5')]['findAll'](queryAgents));break;case _0xed4a('0x7'):_0x272548[_0x15a253](_0xed4a('0x28'));_0x272548[_0x15a253]('voice:outbound');_0x269f17['push'](_0x10b750[_0xed4a('0x37')]({'attributes':['id',_0xed4a('0x4')]}));_0x269f17[_0xed4a('0x2c')](_0x10b750[_0xed4a('0x38')]({'attributes':['id','name']}));_0x269f17[_0xed4a('0x2c')](_0x10b750[_0xed4a('0x39')]({'attributes':['id',_0xed4a('0x4')]}));_0x269f17[_0xed4a('0x2c')](_0x10b750[_0xed4a('0x3a')]({'attributes':['id',_0xed4a('0x4')]}));_0x269f17[_0xed4a('0x2c')](_0x10b750[_0xed4a('0x3b')]({'attributes':['id',_0xed4a('0x4')]}));_0x269f17[_0xed4a('0x2c')](_0x10b750[_0xed4a('0x3c')]({'attributes':['id',_0xed4a('0x4')]}));break;}return BPromise[_0xed4a('0x3d')](_0x269f17);}})[_0xed4a('0xd')](function(_0x3e4b25){if(_0x3e4b25&&_0x3e4b25[_0xed4a('0x3e')]){for(var _0x37f77f=0x0;_0x37f77f<_0x3e4b25[_0xed4a('0x3e')];_0x37f77f+=0x1){for(var _0x59d19d=0x0;_0x59d19d<_0x3e4b25[_0x37f77f][_0xed4a('0x3e')];_0x59d19d+=0x1){switch(_0x37f77f){case 0x0:joinOrLeaveQueues(_0x272548,_0x15a253,_0xed4a('0x3f'),_0x3e4b25[_0x37f77f][_0x59d19d]);break;case 0x1:joinOrLeaveQueues(_0x272548,_0x15a253,_0xed4a('0x40'),_0x3e4b25[_0x37f77f][_0x59d19d]);break;case 0x2:joinOrLeaveQueues(_0x272548,_0x15a253,_0xed4a('0x41'),_0x3e4b25[_0x37f77f][_0x59d19d]);break;case 0x3:joinOrLeaveQueues(_0x272548,_0x15a253,_0xed4a('0x42'),_0x3e4b25[_0x37f77f][_0x59d19d]);break;case 0x4:joinOrLeaveQueues(_0x272548,_0x15a253,'mail',_0x3e4b25[_0x37f77f][_0x59d19d]);break;case 0x5:joinOrLeaveQueues(_0x272548,_0x15a253,'openchannel',_0x3e4b25[_0x37f77f][_0x59d19d]);break;case 0x6:_0x272548[_0x15a253](util[_0xed4a('0x1b')]('telephone:%s',_0x3e4b25[_0x37f77f][_0x59d19d][_0xed4a('0x4')]));break;case 0x7:_0x272548[_0x15a253](util[_0xed4a('0x1b')](_0xed4a('0x43'),_0x3e4b25[_0x37f77f][_0x59d19d]['name']));break;case 0x8:_0x272548[_0x15a253](util[_0xed4a('0x1b')](_0xed4a('0x44'),_0x3e4b25[_0x37f77f][_0x59d19d][_0xed4a('0x9')],_0x3e4b25[_0x37f77f][_0x59d19d][_0xed4a('0x4')]));break;case 0x9:_0x272548[_0x15a253](util[_0xed4a('0x1b')](_0xed4a('0x1c'),_0x3e4b25[_0x37f77f][_0x59d19d][_0xed4a('0x4')]));break;}}}}})[_0xed4a('0xd')](function(){if(_0x15a253===_0xed4a('0x45')){var _0x366a3d=_[_0xed4a('0x46')](_0x5af61a[_0xed4a('0x47')],'id');return _0x5af61a[_0xed4a('0x48')](_0x366a3d)[_0xed4a('0xd')](function(){for(var _0x13a7c7=0x0;_0x13a7c7<_0x366a3d[_0xed4a('0x3e')];_0x13a7c7+=0x1){_0x1afa87[_0xed4a('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x366a3d[_0x13a7c7]),'UserId':Number(_0x5af61a['id'])});}});}})[_0xed4a('0xd')](function(){if(_0x15a253===_0xed4a('0x45')){var _0x4cfca4=_[_0xed4a('0x46')](_0x5af61a['MailInteractions'],'id');return _0x5af61a[_0xed4a('0x4a')](_0x4cfca4)[_0xed4a('0xd')](function(){for(var _0x501808=0x0;_0x501808<_0x4cfca4['length'];_0x501808+=0x1){_0x1afa87['emit'](_0xed4a('0x4b'),{'MailInteractionId':Number(_0x4cfca4[_0x501808]),'UserId':Number(_0x5af61a['id'])});}});}})['then'](function(){if(_0x15a253===_0xed4a('0x45')){var _0x24f328=_['map'](_0x5af61a[_0xed4a('0x24')],'id');return _0x5af61a['removeFaxInteractions'](_0x24f328)[_0xed4a('0xd')](function(){for(var _0x36f78e=0x0;_0x36f78e<_0x24f328['length'];_0x36f78e+=0x1){_0x1afa87[_0xed4a('0x49')](_0xed4a('0x4c'),{'FaxInteractionId':Number(_0x24f328[_0x36f78e]),'UserId':Number(_0x5af61a['id'])});}});}})['then'](function(){if(_0x15a253==='leave'){var _0x3deaa5=_['map'](_0x5af61a[_0xed4a('0x4d')],'id');return _0x5af61a['removeSmsInteractions'](_0x3deaa5)['then'](function(){for(var _0x1451d1=0x0;_0x1451d1<_0x3deaa5[_0xed4a('0x3e')];_0x1451d1+=0x1){_0x1afa87[_0xed4a('0x49')](_0xed4a('0x4e'),{'SmsInteractionId':Number(_0x3deaa5[_0x1451d1]),'UserId':Number(_0x5af61a['id'])});}});}})[_0xed4a('0xd')](function(){if(_0x15a253==='leave'){var _0x349109=_['map'](_0x5af61a[_0xed4a('0x27')],'id');return _0x5af61a[_0xed4a('0x4f')](_0x349109)['then'](function(){for(var _0x5c3b73=0x0;_0x5c3b73<_0x349109['length'];_0x5c3b73+=0x1){_0x1afa87[_0xed4a('0x49')](_0xed4a('0x50'),{'OpenchannelInteractionId':Number(_0x349109[_0x5c3b73]),'UserId':Number(_0x5af61a['id'])});}});}})['catch'](function(_0x156f63){_0x272548[_0xed4a('0x51')](_0x156f63);});}}function onDisconnect(_0x46ba9a,_0x266778){joinOrLeave(_0x46ba9a,_0xed4a('0x45'),_0x266778);}function onConnect(_0x17b2f8){joinOrLeave(_0x17b2f8,_0xed4a('0x52'));}exports[_0xed4a('0x53')]=function(_0x406856){_0x406856['on'](_0xed4a('0x54'),function(_0x142a9c){_0x142a9c[_0xed4a('0x55')](0x0);_0x142a9c['address']=_0x142a9c[_0xed4a('0x56')][_0xed4a('0x54')][_0xed4a('0x57')]+':'+_0x142a9c[_0xed4a('0x56')][_0xed4a('0x54')][_0xed4a('0x58')];_0x142a9c[_0xed4a('0x59')]=new Date();_0x142a9c[_0xed4a('0x51')]=function(_0x337bf4){console['log']('SocketIO\x20'+_0x142a9c[_0xed4a('0x5a')]['name']+'['+_0x142a9c[_0xed4a('0x5b')]+']',_0x337bf4);};_0x142a9c['on'](_0xed4a('0x5c'),function(){onDisconnect(_0x142a9c,_0x406856);_0x142a9c['log']('DISCONNECTED');});onConnect(_0x142a9c);_0x142a9c[_0xed4a('0x51')](_0xed4a('0x5d'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a8d8511..c9ce0da 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 _0x13cc=['SmsInteraction','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','event','UserId','User','find','then','interface','format','SIP/%s','name','incomingmessage','opened','changed','closed','default','model','hook','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13cc,0x15d));var _0xc13c=function(_0x59609b,_0x786626){_0x59609b=_0x59609b-0x0;var _0x564a63=_0x13cc[_0x59609b];return _0x564a63;};'use strict';var util=require(_0xc13c('0x0'));var db=require(_0xc13c('0x1'))['db'];var jayson=require(_0xc13c('0x2'));var logger=require(_0xc13c('0x3'))('triggers');var client=jayson[_0xc13c('0x4')][_0xc13c('0x5')]({'port':0x232a});var triggers=[{'channel':_0xc13c('0x6'),'model':_0xc13c('0x7'),'event':_0xc13c('0x8'),'condition':_0xc13c('0x9'),'callback':afterCreate},{'channel':_0xc13c('0x6'),'model':_0xc13c('0x7'),'event':_0xc13c('0xa'),'condition':_0xc13c('0xb'),'callback':afterUpdate},{'channel':_0xc13c('0x6'),'model':_0xc13c('0xc'),'event':_0xc13c('0x8'),'condition':_0xc13c('0xd'),'callback':afterCreateMessage},{'channel':_0xc13c('0xe'),'model':_0xc13c('0xf'),'event':'afterCreate','condition':_0xc13c('0x9'),'callback':afterCreate},{'channel':_0xc13c('0xe'),'model':_0xc13c('0xf'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc13c('0xe'),'model':_0xc13c('0x10'),'event':_0xc13c('0x8'),'condition':_0xc13c('0xd'),'callback':afterCreateMessage},{'channel':_0xc13c('0x11'),'model':_0xc13c('0x12'),'event':_0xc13c('0x8'),'condition':_0xc13c('0x9'),'callback':afterCreate},{'channel':_0xc13c('0x11'),'model':_0xc13c('0x12'),'event':_0xc13c('0xa'),'condition':_0xc13c('0xb'),'callback':afterUpdate},{'channel':_0xc13c('0x11'),'model':_0xc13c('0x13'),'event':_0xc13c('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':'afterCreate','condition':_0xc13c('0x9'),'callback':afterCreate},{'channel':_0xc13c('0x14'),'model':'MailInteraction','event':_0xc13c('0xa'),'condition':_0xc13c('0xb'),'callback':afterUpdate},{'channel':_0xc13c('0x14'),'model':_0xc13c('0x15'),'event':'afterCreate','condition':_0xc13c('0xd'),'callback':afterCreateMessage},{'channel':_0xc13c('0x16'),'model':_0xc13c('0x17'),'event':'afterCreate','condition':_0xc13c('0x9'),'callback':afterCreate},{'channel':_0xc13c('0x16'),'model':_0xc13c('0x17'),'event':_0xc13c('0xa'),'condition':_0xc13c('0xb'),'callback':afterUpdate},{'channel':_0xc13c('0x16'),'model':_0xc13c('0x18'),'event':_0xc13c('0x8'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x2936a6){return client[_0xc13c('0x19')](_0xc13c('0x1a'),_0x2936a6)['then'](function(_0x5e76f3){logger[_0xc13c('0x1b')](_0xc13c('0x1c'),'EventManager',_0x5e76f3);if(_0x5e76f3['error']){if(_0x5e76f3[_0xc13c('0x1d')][_0xc13c('0x1e')]===0x1f4){logger[_0xc13c('0x1d')](_0xc13c('0x1c'),_0xc13c('0x1a'),_0x5e76f3['error']);}}})[_0xc13c('0x1f')](function(_0x2dc6c0){logger[_0xc13c('0x1d')](_0xc13c('0x1c'),_0xc13c('0x1a'),_0x2dc6c0);});}function afterCreateMessage(_0xcda73b,_0x3993bb){return function(_0x161b99,_0x5f9bf2){_0x161b99=_0x161b99[_0xc13c('0x20')]({'plain':!![]});_0x161b99[_0xc13c('0x21')]=_0xcda73b;_0x161b99[_0xc13c('0x22')]=_0x161b99['direction'];if(_0x161b99[_0xc13c('0x23')]){return db[_0xc13c('0x24')][_0xc13c('0x25')]({'where':{'id':_0x161b99[_0xc13c('0x23')]},'attributes':['id','name'],'raw':!![]})[_0xc13c('0x26')](function(_0x3f1295){_0x161b99[_0xc13c('0x27')]=util[_0xc13c('0x28')](_0xc13c('0x29'),_0x3f1295[_0xc13c('0x2a')]);_0x161b99[_0xc13c('0x21')]=_0xcda73b;return request({'event':_0xc13c('0x2b'),'message':_0x161b99});})[_0xc13c('0x1f')](function(_0x5142f4){console['error'](_0x5142f4);});}else{return request({'event':'outgoingmessage','message':_0x161b99});}};}function afterCreate(_0x59c9c5,_0x595e68){return function(_0x534f8d,_0x5cb290){_0x534f8d=_0x534f8d[_0xc13c('0x20')]({'plain':!![]});_0x534f8d['channel']=_0x59c9c5;_0x534f8d[_0xc13c('0x22')]=_0xc13c('0x2c');return request({'event':_0x595e68,'message':_0x534f8d});};}function afterUpdate(_0x4ce816,_0x3879b9){return function(_0x4f4faa,_0x8af7a9){if(_0x4f4faa[_0xc13c('0x2d')](_0xc13c('0x2e'))&&_0x4f4faa[_0xc13c('0x2e')]){_0x4f4faa=_0x4f4faa[_0xc13c('0x20')]({'plain':!![]});_0x4f4faa[_0xc13c('0x21')]=_0x4ce816;_0x4f4faa[_0xc13c('0x22')]=_0xc13c('0x2e');if(_0x4f4faa[_0xc13c('0x23')]){return db['User']['find']({'where':{'id':_0x4f4faa[_0xc13c('0x23')]},'attributes':['id',_0xc13c('0x2a')],'raw':!![]})['then'](function(_0x243854){_0x4f4faa[_0xc13c('0x27')]=util[_0xc13c('0x28')](_0xc13c('0x29'),_0x243854['name']);return request({'event':_0x3879b9,'message':_0x4f4faa});})[_0xc13c('0x1f')](function(_0x2e5bc1){console[_0xc13c('0x1d')](_0x2e5bc1);});}else{return request({'event':_0x3879b9,'message':_0x4f4faa});}}};}exports[_0xc13c('0x2f')]=function(){for(var _0x351e59=0x0;_0x351e590x3){var _0xd33e81=/\((.+)\)/;var _0x576555=_0x1e0a6c['rx']['match'](_0xd33e81);if(_0x576555){_0x5250c1=_0x576555[0x1];}else{_0x5250c1=null;}}else{_0x5250c1=null;}_0x1e0a6c['cb'](null,{'code':_0x174465,'result':_0x241c93,'extra':_0x5250c1});}});_0x11cf86['on'](_0x0cd7('0x18'),function(_0x41f251){_0x416ad0[_0x0cd7('0x7')](_0x0cd7('0x18'),new AGIError(_0x0cd7('0x19'),_0x41f251[_0x0cd7('0x1a')]));});_0x11cf86['on']('close',function(){_0x416ad0[_0x0cd7('0x7')](_0x0cd7('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x11cf86['on'](_0x0cd7('0x1c'),function(){_0x416ad0['emit'](_0x0cd7('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x11cf86[_0x0cd7('0x1d')]();});_0x11cf86['pipe'](_0x4670d5);this[_0x0cd7('0x1e')]=function(_0x2a0462,_0x4dc864){var _0x2a0462=_0x2a0462||'',_0x4dc864=typeof _0x4dc864==_0x0cd7('0xe')?_0x4dc864:new Function();_0x1e0a6c={'tx':_0x2a0462,'rx':'','cb':_0x4dc864};_0x11cf86[_0x0cd7('0x1f')](_0x2a0462+'\x0a');},this['close']=function(){_0x11cf86[_0x0cd7('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x21')]=function(_0x53be19){return this[_0x0cd7('0x1e')]['sync'](this,_0x53be19);};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x22')]=function(){return this['sendRequest'](_0x0cd7('0x23'));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x24')]=function(_0x1478ae,_0x3b0d35,_0x14304c){_0x1478ae=_0x1478ae===undefined?'beep':_0x1478ae;_0x3b0d35=_0x3b0d35===undefined?'5':_0x3b0d35;_0x14304c=_0x14304c===undefined?'1':_0x14304c;return this[_0x0cd7('0x21')](util[_0x0cd7('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x1478ae,_0x3b0d35*0x3e8,_0x14304c));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x26')]=function(_0x248c25){_0x248c25=_0x248c25||'NO\x20MESSAGE';return this[_0x0cd7('0x21')](util['format']('VERBOSE\x20\x22%s\x22',_0x248c25));};AGIChannel[_0x0cd7('0x20')]['exec']=function(_0x5d2421,_0x101d89){if(_[_0x0cd7('0x27')](_0x101d89)){return this[_0x0cd7('0x21')](util[_0x0cd7('0x25')](_0x0cd7('0x28'),_0x5d2421,_0x101d89[_0x0cd7('0x29')](',')));}return this[_0x0cd7('0x21')](util[_0x0cd7('0x25')](_0x0cd7('0x28'),_0x5d2421,_0x101d89));};AGIChannel[_0x0cd7('0x20')]['setContext']=function(_0x50d4c7){return this['sendRequest'](util['format'](_0x0cd7('0x2a'),_0x50d4c7));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x2b')]=function(_0x41a37f){return this[_0x0cd7('0x21')](util['format']('SET\x20EXTENSION\x20%s',_0x41a37f));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x2c')]=function(_0x5368b8){return this['sendRequest'](util[_0x0cd7('0x25')](_0x0cd7('0x2d'),_0x5368b8));};AGIChannel['prototype'][_0x0cd7('0xa')]=function(){return this[_0x0cd7('0x21')](_0x0cd7('0x2e'));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x2f')]=function(_0x3ccdeb,_0x9664ef){return this[_0x0cd7('0x21')](util[_0x0cd7('0x25')](_0x0cd7('0x30'),_0x3ccdeb,_0x9664ef?_0x9664ef[_0x0cd7('0x31')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x32')]=function(_0x295cfc,_0x52dcd7){return this[_0x0cd7('0x21')](util[_0x0cd7('0x25')](_0x0cd7('0x33'),_0x295cfc,_0x52dcd7));};AGIChannel[_0x0cd7('0x20')]['sayDigits']=function(_0x5d4d5f,_0x59da42){return this['sendRequest'](util['format'](_0x0cd7('0x34'),_0x5d4d5f,_0x59da42));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x35')]=function(_0x31853f,_0x17e344){return this[_0x0cd7('0x21')](util['format'](_0x0cd7('0x36'),_0x31853f,_0x17e344));};AGIChannel[_0x0cd7('0x20')]['continueAt']=function(_0x5adda3,_0x36c5ac,_0x21409c){_0x36c5ac=_0x36c5ac||this[_0x0cd7('0x37')];_0x21409c=_0x21409c||0x1;this[_0x0cd7('0x38')](_0x5adda3);this[_0x0cd7('0x2b')](_0x36c5ac);this['setPriority'](_0x21409c);return this[_0x0cd7('0x26')](util['format'](_0x0cd7('0x39'),_0x5adda3,_0x36c5ac,_0x21409c));};AGIChannel['prototype']['getVariable']=function(_0xe33bce){return this[_0x0cd7('0x21')](util['format'](_0x0cd7('0x3a'),_0xe33bce));};AGIChannel['prototype'][_0x0cd7('0x3b')]=function(_0x168777,_0x40ccfb,_0x233233,_0x3e284a,_0x43243c,_0x3596ec){_0x40ccfb=_0x40ccfb||_0x0cd7('0x3c');_0x233233=_0x233233||'';_0x3e284a=_0x3e284a===undefined?-0x1:_0x3e284a==='-1'?-0x1:_0x3e284a*0x3e8;_0x43243c=_0x43243c===undefined?'':'s='+_0x43243c;_0x3596ec=_0x3596ec?_0x0cd7('0x3d'):'';return this[_0x0cd7('0x21')](util[_0x0cd7('0x25')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x168777,_0x40ccfb,_0x233233,_0x3e284a,_0x3596ec,_0x43243c));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x3e')]=function(_0x487996,_0x4d68e8){_0x4d68e8=_0x4d68e8||'';return this['sendRequest'](util[_0x0cd7('0x25')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x487996,_0x4d68e8));};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x3f')]=function(_0x2e7cd4){return this[_0x0cd7('0x40')](_0x0cd7('0x41'),_0x2e7cd4);};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x42')]=function(_0x49b478){return this['exec'](_0x0cd7('0x43'),_0x49b478);};AGIChannel[_0x0cd7('0x20')][_0x0cd7('0x18')]=function(_0x135eeb,_0x524b17){this[_0x0cd7('0x26')](util['format'](_0x0cd7('0x44'),_0x135eeb['id'],_0x135eeb[_0x0cd7('0x45')],_0x524b17));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0cd7('0x46')]=AGIChannel; \ No newline at end of file +var _0xdb51=['noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','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','AGI','wait','WAIT','label','exports','lodash','events','./reply','./error','call','utf8','setTimeout','setEncoding','ready','line','toLowerCase','hangup','emit','substring','search','function','no\x20code','replace','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','prototype','sync','answer','sendRequest','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0xdb51,0x1de));var _0x1db5=function(_0x1f31bc,_0x2ba000){_0x1f31bc=_0x1f31bc-0x0;var _0x2d19c8=_0xdb51[_0x1f31bc];return _0x2d19c8;};'use strict';var util=require('util');var _=require(_0x1db5('0x0'));var EventEmitter=require(_0x1db5('0x1'))['EventEmitter'];var AGIReply=require(_0x1db5('0x2'));var AGIError=require(_0x1db5('0x3'));function AGIChannel(_0x806404){var _0xcdfd67=this,_0x662495=new AGIReply(),_0xa91dc1=![],_0x45aab2={};EventEmitter[_0x1db5('0x4')](_0xcdfd67);_0x806404['setEncoding'](_0x1db5('0x5'));_0x806404[_0x1db5('0x6')](0x8*0x3c*0x3c*0x3e8);_0x662495[_0x1db5('0x7')](_0x1db5('0x5'));_0x662495['on']('headers',function(_0x591bfe){for(var _0x19706e in _0x591bfe){_0xcdfd67[_0x19706e]=_0x591bfe[_0x19706e];}_0xcdfd67['emit'](_0x1db5('0x8'));});_0x662495['on'](_0x1db5('0x9'),function(_0x514345){if(_0x514345[_0x1db5('0xa')]()==_0x1db5('0xb')){_0xcdfd67[_0x1db5('0xc')](_0x1db5('0xb'));return;}if(_0x514345[_0x1db5('0xd')](0x0,0xb)=='520-Invalid'){_0xa91dc1=!![];}if(_0xa91dc1){_0x45aab2['rx']+=_0x514345+'\x0a';if(_0x514345[_0x1db5('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0xa91dc1=![];}}else{_0x45aab2['rx']=_0x514345;}if(_0xa91dc1){return;}if(typeof _0x45aab2['cb']==_0x1db5('0xf')){var _0x142505=_0x45aab2['rx']['substring'](0x0,0x3),_0x1ce47a=null,_0x522ec7=null;_0x142505=parseInt(_0x142505);if(isNaN(_0x142505)){_0x45aab2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1db5('0x10')});return;}if(_0x142505!=0xc8){_0x45aab2['cb'](null,{'code':_0x142505,'result':-0x1,'extra':'KO'});return;}_0x1ce47a=_0x45aab2['rx']['substring'](0x4)[_0x1db5('0x11')]('result=','');if(_0x1ce47a['indexOf']('\x20')!=-0x1){_0x1ce47a=_0x1ce47a['substr'](0x0,_0x1ce47a[_0x1db5('0x12')]('\x20'));}if(_[_0x1db5('0x13')](_0x1ce47a,'-1')){_0x1ce47a=parseInt(_0x1ce47a);}_0x522ec7=_0x45aab2['rx'][_0x1db5('0x14')]('\x20');if(_0x522ec7[_0x1db5('0x15')]==0x3){_0x522ec7=_0x522ec7[0x2][_0x1db5('0xd')](0x1,_0x522ec7[0x2][_0x1db5('0x15')]-0x1);}else if(_0x522ec7[_0x1db5('0x15')]>0x3){var _0x295ab4=/\((.+)\)/;var _0x240eb1=_0x45aab2['rx'][_0x1db5('0x16')](_0x295ab4);if(_0x240eb1){_0x522ec7=_0x240eb1[0x1];}else{_0x522ec7=null;}}else{_0x522ec7=null;}_0x45aab2['cb'](null,{'code':_0x142505,'result':_0x1ce47a,'extra':_0x522ec7});}});_0x806404['on'](_0x1db5('0x17'),function(_0x1587d5){_0xcdfd67[_0x1db5('0xc')](_0x1db5('0x17'),new AGIError(_0x1db5('0x18'),_0x1587d5['code']));});_0x806404['on'](_0x1db5('0x19'),function(){_0xcdfd67['emit'](_0x1db5('0x19'),new AGIError(_0x1db5('0x1a')));});_0x806404['on'](_0x1db5('0x1b'),function(){_0xcdfd67['emit'](_0x1db5('0x1b'),new AGIError(_0x1db5('0x1c')));_0x806404['destroy']();});_0x806404[_0x1db5('0x1d')](_0x662495);this[_0x1db5('0x1e')]=function(_0x2cf377,_0x48ecb5){var _0x2cf377=_0x2cf377||'',_0x48ecb5=typeof _0x48ecb5==_0x1db5('0xf')?_0x48ecb5:new Function();_0x45aab2={'tx':_0x2cf377,'rx':'','cb':_0x48ecb5};_0x806404[_0x1db5('0x1f')](_0x2cf377+'\x0a');},this[_0x1db5('0x19')]=function(){_0x806404[_0x1db5('0x20')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1db5('0x21')]['sendRequest']=function(_0x47fbcc){return this[_0x1db5('0x1e')][_0x1db5('0x22')](this,_0x47fbcc);};AGIChannel[_0x1db5('0x21')][_0x1db5('0x23')]=function(){return this[_0x1db5('0x24')]('ANSWER');};AGIChannel['prototype'][_0x1db5('0x25')]=function(_0x24de91,_0x11ae8f,_0x135fbe){_0x24de91=_0x24de91===undefined?'beep':_0x24de91;_0x11ae8f=_0x11ae8f===undefined?'5':_0x11ae8f;_0x135fbe=_0x135fbe===undefined?'1':_0x135fbe;return this[_0x1db5('0x24')](util[_0x1db5('0x26')](_0x1db5('0x27'),_0x24de91,_0x11ae8f*0x3e8,_0x135fbe));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x28')]=function(_0x48b86d){_0x48b86d=_0x48b86d||_0x1db5('0x29');return this[_0x1db5('0x24')](util[_0x1db5('0x26')](_0x1db5('0x2a'),_0x48b86d));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x2b')]=function(_0x3bcde3,_0x377586){if(_['isArray'](_0x377586)){return this['sendRequest'](util[_0x1db5('0x26')](_0x1db5('0x2c'),_0x3bcde3,_0x377586[_0x1db5('0x2d')](',')));}return this['sendRequest'](util['format'](_0x1db5('0x2c'),_0x3bcde3,_0x377586));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x2e')]=function(_0x21c239){return this[_0x1db5('0x24')](util[_0x1db5('0x26')]('SET\x20CONTEXT\x20%s',_0x21c239));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x2f')]=function(_0x34b37b){return this[_0x1db5('0x24')](util[_0x1db5('0x26')](_0x1db5('0x30'),_0x34b37b));};AGIChannel[_0x1db5('0x21')]['setPriority']=function(_0x16c8bd){return this[_0x1db5('0x24')](util[_0x1db5('0x26')](_0x1db5('0x31'),_0x16c8bd));};AGIChannel['prototype'][_0x1db5('0xb')]=function(){return this[_0x1db5('0x24')](_0x1db5('0x32'));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x33')]=function(_0x5683f5,_0x5c9365){return this[_0x1db5('0x24')](util[_0x1db5('0x26')](_0x1db5('0x34'),_0x5683f5,_0x5c9365?_0x5c9365[_0x1db5('0x35')]()[_0x1db5('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x36')]=function(_0xca7cc8,_0x353be9){return this[_0x1db5('0x24')](util[_0x1db5('0x26')](_0x1db5('0x37'),_0xca7cc8,_0x353be9));};AGIChannel[_0x1db5('0x21')]['sayDigits']=function(_0xf263ca,_0x3ae418){return this['sendRequest'](util['format'](_0x1db5('0x38'),_0xf263ca,_0x3ae418));};AGIChannel[_0x1db5('0x21')]['sayPhonetic']=function(_0x59c5a8,_0x1dda44){return this['sendRequest'](util[_0x1db5('0x26')](_0x1db5('0x39'),_0x59c5a8,_0x1dda44));};AGIChannel[_0x1db5('0x21')]['continueAt']=function(_0x2cba24,_0xd71831,_0x2a819c){_0xd71831=_0xd71831||this[_0x1db5('0x3a')];_0x2a819c=_0x2a819c||0x1;this[_0x1db5('0x2e')](_0x2cba24);this[_0x1db5('0x2f')](_0xd71831);this[_0x1db5('0x3b')](_0x2a819c);return this['noop'](util[_0x1db5('0x26')](_0x1db5('0x3c'),_0x2cba24,_0xd71831,_0x2a819c));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x3d')]=function(_0x9ded17){return this[_0x1db5('0x24')](util[_0x1db5('0x26')](_0x1db5('0x3e'),_0x9ded17));};AGIChannel['prototype']['recordFile']=function(_0x4746e3,_0x5924a3,_0x202cca,_0x173a6e,_0x314ec2,_0x4100e2){_0x5924a3=_0x5924a3||_0x1db5('0x3f');_0x202cca=_0x202cca||'';_0x173a6e=_0x173a6e===undefined?-0x1:_0x173a6e==='-1'?-0x1:_0x173a6e*0x3e8;_0x314ec2=_0x314ec2===undefined?'':'s='+_0x314ec2;_0x4100e2=_0x4100e2?_0x1db5('0x40'):'';return this[_0x1db5('0x24')](util['format'](_0x1db5('0x41'),_0x4746e3,_0x5924a3,_0x202cca,_0x173a6e,_0x4100e2,_0x314ec2));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x42')]=function(_0xb84d5e,_0x2c928a){_0x2c928a=_0x2c928a||'';return this[_0x1db5('0x24')](util[_0x1db5('0x26')](_0x1db5('0x43'),_0xb84d5e,_0x2c928a));};AGIChannel[_0x1db5('0x21')][_0x1db5('0x44')]=function(_0x5b66a6){return this[_0x1db5('0x2b')](_0x1db5('0x45'),_0x5b66a6);};AGIChannel[_0x1db5('0x21')][_0x1db5('0x46')]=function(_0x472929){return this['exec'](_0x1db5('0x47'),_0x472929);};AGIChannel[_0x1db5('0x21')][_0x1db5('0x17')]=function(_0x685cae,_0x5839f2){this[_0x1db5('0x28')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x685cae['id'],_0x685cae[_0x1db5('0x48')],_0x5839f2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1db5('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 0957624..4150558 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 _0xa966=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','message','name','exports','util'];(function(_0x5b620e,_0x266273){var _0x6b7008=function(_0x337322){while(--_0x337322){_0x5b620e['push'](_0x5b620e['shift']());}};_0x6b7008(++_0x266273);}(_0xa966,0x12f));var _0x6a96=function(_0xac1238,_0x36e7f4){_0xac1238=_0xac1238-0x0;var _0x4f010b=_0xa966[_0xac1238];return _0x4f010b;};'use strict';var util=require(_0x6a96('0x0'));var error={'E_AGI_UNDEFINED':_0x6a96('0x1'),'E_AGI_ARGUMENT_PORT':_0x6a96('0x2'),'E_AGI_SERVER_ERROR':_0x6a96('0x3'),'E_AGI_SERVER_CLOSE':_0x6a96('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x6a96('0x5'),'E_AGI_SOCKET_ERROR':_0x6a96('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x6a96('0x7'),'E_AGI_COMMAND_EMPTY':_0x6a96('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6a96('0x9'),'E_AGI_IVR_ENTRY':_0x6a96('0xa')};function AGIError(_0x4a8660){var _0x4a8660=_0x4a8660||null,_0x494f23=_0x494f23||[],_0x52b9c6=0x1,_0x4c0030='';if(!error[_0x4a8660]){_0x4a8660='E_AGI_UNDEFINED';}_0x494f23[_0x6a96('0xb')](error[_0x4a8660]);while(arguments[_0x52b9c6]){_0x494f23[_0x6a96('0xb')](arguments[_0x52b9c6]);_0x52b9c6++;}_0x4c0030=util['format'][_0x6a96('0xc')](util,_0x494f23);this[_0x6a96('0xd')]=_0x4c0030;this[_0x6a96('0xe')]=_0x4a8660;}module[_0x6a96('0xf')]=AGIError; \ No newline at end of file +var _0xbdf5=['push','format','apply','message','exports','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x162b73,_0x128905){var _0x22e1b6=function(_0x3f35ad){while(--_0x3f35ad){_0x162b73['push'](_0x162b73['shift']());}};_0x22e1b6(++_0x128905);}(_0xbdf5,0x9b));var _0x5bdf=function(_0x568814,_0x342f23){_0x568814=_0x568814-0x0;var _0x362a40=_0xbdf5[_0x568814];return _0x362a40;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x5bdf('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x5bdf('0x1'),'E_AGI_SERVER_CLOSE':_0x5bdf('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x5bdf('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x5bdf('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x5bdf('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x5bdf('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5bdf('0x7'),'E_AGI_IVR_ENTRY':_0x5bdf('0x8')};function AGIError(_0x3cea51){var _0x3cea51=_0x3cea51||null,_0xa40ab7=_0xa40ab7||[],_0x1e3f3f=0x1,_0x28fea9='';if(!error[_0x3cea51]){_0x3cea51=_0x5bdf('0x9');}_0xa40ab7[_0x5bdf('0xa')](error[_0x3cea51]);while(arguments[_0x1e3f3f]){_0xa40ab7['push'](arguments[_0x1e3f3f]);_0x1e3f3f++;}_0x28fea9=util[_0x5bdf('0xb')][_0x5bdf('0xc')](util,_0xa40ab7);this[_0x5bdf('0xd')]=_0x28fea9;this['name']=_0x3cea51;}module[_0x5bdf('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 abbb8fb..b857314 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 _0x68a5=['lodash','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','vswitch','target','default','invalid','agicommand','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found'];(function(_0x29dcb5,_0x33a62e){var _0x439e32=function(_0xffc812){while(--_0xffc812){_0x29dcb5['push'](_0x29dcb5['shift']());}};_0x439e32(++_0x33a62e);}(_0x68a5,0xfc));var _0x568a=function(_0x355bb5,_0x2e3674){_0x355bb5=_0x355bb5-0x0;var _0x2a2790=_0x68a5[_0x355bb5];return _0x2a2790;};'use strict';var _=require(_0x568a('0x0'));var logger=require('../../../config/logger')(_0x568a('0x1'));var verticesWithRetry=[_0x568a('0x2'),'getdigits',_0x568a('0x3')];var Graph=function(){this[_0x568a('0x4')]={};this[_0x568a('0x5')]={};this[_0x568a('0x6')]=0x0;};Graph['prototype'][_0x568a('0x7')]=function(_0x55e328){this[_0x568a('0x4')][_0x55e328['id']]=_0x55e328;this[_0x568a('0x5')][_0x55e328['id']]=[];};Graph[_0x568a('0x8')][_0x568a('0x9')]=function(_0x4cda9a,_0x172efd,_0x56deb6){this[_0x568a('0x5')][_0x4cda9a][_0x568a('0xa')]({'target':_0x172efd,'condition':_0x56deb6});this[_0x568a('0x6')]+=0x1;};Graph[_0x568a('0x8')]['size']=function(){return _['size'](this[_0x568a('0x4')]);};Graph[_0x568a('0x8')]['relations']=function(){return this[_0x568a('0x6')];};Graph['prototype'][_0x568a('0xb')]=function(_0x214be5){return this[_0x568a('0x4')][_0x214be5];};Graph[_0x568a('0x8')][_0x568a('0xc')]=function(_0x26901e,_0x23e286){if(!this[_0x568a('0x4')][_0x26901e]){return logger[_0x568a('0xd')](_0x568a('0xe'));}var _0x3dd9af=_0x23e286(this[_0x568a('0x4')][_0x26901e]);if(!_0x3dd9af){return logger[_0x568a('0xd')](_0x568a('0xf'));}if(this[_0x568a('0x5')][_0x26901e][_0x568a('0x10')]===0x0){return logger[_0x568a('0xd')]('no\x20edge/s\x20available');}for(var _0x323bf3=0x0,_0x573b17=[],_0xa77de8=![];_0x323bf3\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','context','priority','result','response','toString','agicommand\x20not\x20found','finally','clear','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','extension','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','catch','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','defaults','127.0.0.1','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','name','format','[%s]\x20%s','message','error','[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','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','value','getSquareProject','then','agi_','substring','inspect','debug','stringify','close','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf2ca[_0x46e363];return _0x3fb059;};'use strict';var parser=require(_0xaf2c('0x0'));var _=require(_0xaf2c('0x1'));var syncho=require(_0xaf2c('0x2'));var util=require('util');var moment=require(_0xaf2c('0x3'));var config=require(_0xaf2c('0x4'));var logger=require(_0xaf2c('0x5'))(_0xaf2c('0x6'));var utilLicense=require(_0xaf2c('0x7'));var rpc=require(_0xaf2c('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0xaf2c('0x9'));var Vertices=require(_0xaf2c('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xaf2c('0x6')]=_[_0xaf2c('0xb')](config['agi'],{'ip':_0xaf2c('0xc'),'port':0x11dd});function connectionHandler(_0x3c0421){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3c0421);agiHandler(_0x3c0421);}catch(_0x2a011d){logger['error'](_0x2a011d[_0xaf2c('0xd')]);}});});}function listeningHandler(){console['log'](_0xaf2c('0xe'),config[_0xaf2c('0x6')][_0xaf2c('0xf')]);logger[_0xaf2c('0x10')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xaf2c('0x6')]['ip'],config[_0xaf2c('0x6')][_0xaf2c('0xf')]));}function errorHandler(_0xd56a5d){if(_0xd56a5d&&_0xd56a5d[_0xaf2c('0x11')]&&_0xd56a5d['message']){logger['error'](util[_0xaf2c('0x12')](_0xaf2c('0x13'),_0xd56a5d[_0xaf2c('0x11')],_0xd56a5d[_0xaf2c('0x14')]));}else{logger[_0xaf2c('0x15')](util[_0xaf2c('0x12')](_0xaf2c('0x16'),_0xd56a5d[_0xaf2c('0xd')]));}}function closeHandler(){logger[_0xaf2c('0x10')](util[_0xaf2c('0x12')](_0xaf2c('0x17'),this[_0xaf2c('0x18')],this[_0xaf2c('0x19')],this[_0xaf2c('0x1a')],this[_0xaf2c('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x3ca650){logger['error'](_0x3ca650[_0xaf2c('0xd')]);}}function timeoutHandler(){logger[_0xaf2c('0x10')](util[_0xaf2c('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xaf2c('0x18')],this[_0xaf2c('0x19')],this[_0xaf2c('0x1a')],this[_0xaf2c('0x1b')],this[_0xaf2c('0x1c')]));}function hangupHandler(){logger[_0xaf2c('0x10')](util['format'](_0xaf2c('0x1d'),this[_0xaf2c('0x18')],this[_0xaf2c('0x19')],this[_0xaf2c('0x1a')],this[_0xaf2c('0x1b')],this['uniqueid']));this[_0xaf2c('0x1e')]=!![];}function getRoot(_0xbf6f62){return parser[_0xaf2c('0x1f')](_0xbf6f62,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x29cbdf,_0x303546,_0x1cafad){_0x303546[_0xaf2c('0x20')]=_0x1cafad;if(_0x303546['hasOwnProperty'](_0xaf2c('0x21'))){_0x303546[_0xaf2c('0x22')]=parseInt(_0x303546[_0xaf2c('0x21')],0xa);}_0x29cbdf[_0xaf2c('0x23')](_[_0xaf2c('0x24')](_0x303546,_0xaf2c('0x25')));}function initGraph(_0xf0a56c,_0x4a8dd8){var _0x29f8b0=new Graph();for(var _0x2051be in _0xf0a56c){if(_0xf0a56c[_0xaf2c('0x26')](_0x2051be)){if(_[_0xaf2c('0x27')](_0xf0a56c[_0x2051be])){for(var _0x4b7cf2=0x0;_0x4b7cf2<_0xf0a56c[_0x2051be][_0xaf2c('0x28')];_0x4b7cf2+=0x1){addVertex(_0x29f8b0,_0xf0a56c[_0x2051be][_0x4b7cf2],_0x2051be);}}else{addVertex(_0x29f8b0,_0xf0a56c[_0x2051be],_0x2051be);}}}for(var _0x589d47=0x0;_0x589d47<_0x4a8dd8[_0xaf2c('0x28')];_0x589d47+=0x1){if(_0x4a8dd8[_0x589d47][_0xaf2c('0x29')]&&_0x4a8dd8[_0x589d47][_0xaf2c('0x2a')]){_0x29f8b0['addEdge'](_0x4a8dd8[_0x589d47][_0xaf2c('0x29')],_0x4a8dd8[_0x589d47][_0xaf2c('0x2a')],_0x4a8dd8[_0x589d47][_0xaf2c('0x2b')]);}}return _0x29f8b0;}function getSquareProject(_0x4a96d2,_0xe18ba7){rpc[_0xaf2c('0x2c')](_0x4a96d2)[_0xaf2c('0x2d')](function(_0x19364e){_0xe18ba7(null,_0x19364e);})['catch'](function(_0x3da072){_0xe18ba7(null,_0x3da072);});}function createSquareReport(_0x4072ff,_0x1be1ef){rpc['createSquareReport'](_0x4072ff)['then'](function(_0x359cab){if(_0x1be1ef){_0x1be1ef(null,_0x359cab);}})['catch'](function(_0x39c0ed){if(_0x1be1ef){_0x1be1ef(null,_0x39c0ed);}});}function setChannelVariables(_0x5e7247){for(var _0x337cea in _0x5e7247){if(_0x5e7247[_0xaf2c('0x26')](_0x337cea)){if(_0x337cea['indexOf'](_0xaf2c('0x2e'))===0x0){_0x5e7247[_0x337cea[_0xaf2c('0x2f')](0x4)]=_0x5e7247[_0x337cea];delete _0x5e7247[_0x337cea];}}}}function getLogFromObject(_0x54db57){return util[_0xaf2c('0x30')](_0x54db57,{'showHidden':![],'depth':null});}function agiHandler(_0xbec302){var _0x211a69,_0x53d58c,_0x2d6ed7,_0x30ae30,_0x5b1a7c;logger[_0xaf2c('0x31')]('variables',JSON[_0xaf2c('0x32')](_0xbec302,null,0x2));logger['info'](util[_0xaf2c('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xbec302[_0xaf2c('0x18')],_0xbec302['calleridname'],_0xbec302[_0xaf2c('0x1a')],_0xbec302['dnid'],_0xbec302[_0xaf2c('0x1c')]));_0xbec302['on'](_0xaf2c('0x15'),errorHandler);_0xbec302['on'](_0xaf2c('0x33'),closeHandler);_0xbec302['on'](_0xaf2c('0x34'),timeoutHandler);_0xbec302[_0xaf2c('0x1e')]=![];_0xbec302['on']('hangup',hangupHandler);var _0x4cba13=getSquareProject[_0xaf2c('0x35')](null,_0xbec302[_0xaf2c('0x18')]);if(_0x4cba13){if(_0x4cba13[_0xaf2c('0x36')]){_0x211a69=getRoot(_0x4cba13[_0xaf2c('0x36')]);if(_0x211a69&&_0x211a69[_0xaf2c('0x37')]){logger[_0xaf2c('0x31')]('root',JSON[_0xaf2c('0x32')](_0x211a69,null,0x2));_0xbec302[_0xaf2c('0x38')]=moment()['format'](_0xaf2c('0x39'));_0x53d58c=initGraph(_[_0xaf2c('0x24')](_0x211a69,_0xaf2c('0x25')),_0x211a69[_0xaf2c('0x25')]);_0x2d6ed7=new Vertices(_0xbec302,rpc,mailRpc);logger[_0xaf2c('0x10')](util[_0xaf2c('0x12')](_0xaf2c('0x3a'),_0xbec302[_0xaf2c('0x18')],_0xbec302[_0xaf2c('0x19')],_0xbec302[_0xaf2c('0x1a')],_0xbec302[_0xaf2c('0x1b')],_0xbec302[_0xaf2c('0x1c')]));_0x53d58c[_0xaf2c('0x3b')](_0x211a69['start']['id'],function(_0x54a953){try{_0x54a953=_0x2d6ed7['clear'](_0x54a953);logger[_0xaf2c('0x31')](_0xaf2c('0x3c'),JSON[_0xaf2c('0x32')](_0x54a953,null,0x2));if(_0x54a953[_0xaf2c('0x20')]===_0xaf2c('0x3d')){logger[_0xaf2c('0x10')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0xbec302[_0xaf2c('0x3e')]=_0x54a953[_0xaf2c('0x3e')]||_0xbec302[_0xaf2c('0x3e')];_0xbec302['extension']=_0x54a953['extension'];_0xbec302[_0xaf2c('0x3f')]=_0x54a953['priority']?_0x54a953[_0xaf2c('0x3f')]-0x1:0x1;return null;}else if(_0x54a953&&_0x2d6ed7[_0x54a953[_0xaf2c('0x20')]]){_0x5b1a7c=_0x2d6ed7[_0x54a953[_0xaf2c('0x20')]](_0x54a953);logger[_0xaf2c('0x10')]('response',JSON[_0xaf2c('0x32')](_0x5b1a7c,null,0x2));if(_0x5b1a7c&&_0x5b1a7c['code']===AGI_CODE_SUCCESS&&_0x5b1a7c[_0xaf2c('0x40')]!==AGI_RESULT_ERROR&&!_0xbec302[_0xaf2c('0x1e')]){logger['debug'](_0xaf2c('0x41'),getLogFromObject(_0x5b1a7c));return _['isUndefined'](_0x5b1a7c[_0xaf2c('0x40')])?null:_0x5b1a7c[_0xaf2c('0x40')][_0xaf2c('0x42')]();}else{logger[_0xaf2c('0x15')](_0xaf2c('0x41'),getLogFromObject(_0x5b1a7c));return null;}}else{logger[_0xaf2c('0x15')](_0xaf2c('0x43'));return null;}}catch(_0x16b469){logger[_0xaf2c('0x15')](_0x16b469['stack']);return null;}});if(_0x211a69['finally']){logger[_0xaf2c('0x10')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xbec302['arg_1'],_0xbec302[_0xaf2c('0x19')],_0xbec302[_0xaf2c('0x1a')],_0xbec302[_0xaf2c('0x1b')],_0xbec302[_0xaf2c('0x1c')]));_0x53d58c['traverseBFS'](_0x211a69[_0xaf2c('0x44')]['id'],function(_0x52e2c1){try{_0x52e2c1=_0x2d6ed7[_0xaf2c('0x45')](_0x52e2c1);logger['debug'](_0xaf2c('0x3c'),JSON[_0xaf2c('0x32')](_0x52e2c1,null,0x2));if(_0x52e2c1&&_0x2d6ed7[_0x52e2c1[_0xaf2c('0x20')]]){_0x5b1a7c=_0x2d6ed7[_0x52e2c1[_0xaf2c('0x20')]](_0x52e2c1);if(_0x5b1a7c){logger[_0xaf2c('0x31')]('response',getLogFromObject(_0x5b1a7c));return _[_0xaf2c('0x46')](_0x5b1a7c[_0xaf2c('0x40')])?null:_0x5b1a7c['result']['toString']();}else{logger[_0xaf2c('0x15')]('response',getLogFromObject(_0x5b1a7c));return null;}}else{logger[_0xaf2c('0x15')](_0xaf2c('0x43'));return null;}}catch(_0x17b9ec){logger[_0xaf2c('0x15')](_0x17b9ec[_0xaf2c('0xd')]);return null;}});}logger[_0xaf2c('0x10')](util[_0xaf2c('0x12')](_0xaf2c('0x47'),_0xbec302[_0xaf2c('0x18')],_0xbec302[_0xaf2c('0x19')],_0xbec302[_0xaf2c('0x1a')],_0xbec302['dnid'],_0xbec302[_0xaf2c('0x1c')]));logger[_0xaf2c('0x10')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0xbec302['context'],_0xbec302[_0xaf2c('0x48')],parseInt(_0xbec302[_0xaf2c('0x3f')],0xa)+0x1));_0xbec302['continueAt'](_0xbec302[_0xaf2c('0x3e')],_0xbec302[_0xaf2c('0x48')],parseInt(_0xbec302[_0xaf2c('0x3f')],0xa)+0x1);_0xbec302[_0xaf2c('0x33')]();}}else{logger[_0xaf2c('0x15')](util[_0xaf2c('0x12')](_0xaf2c('0x49'),_0xbec302['arg_1']));_0xbec302[_0xaf2c('0x4a')](_0xbec302[_0xaf2c('0x3e')],_0xbec302['extension'],parseInt(_0xbec302[_0xaf2c('0x3f')],0xa)+0x1);_0xbec302[_0xaf2c('0x33')]();}}else{logger[_0xaf2c('0x15')](util[_0xaf2c('0x12')](_0xaf2c('0x4b'),_0xbec302[_0xaf2c('0x18')]));_0xbec302[_0xaf2c('0x4a')](_0xbec302[_0xaf2c('0x3e')],_0xbec302[_0xaf2c('0x48')],parseInt(_0xbec302[_0xaf2c('0x3f')],0xa)+0x1);_0xbec302[_0xaf2c('0x33')]();}}function main(){var _0x10a270;return utilLicense[_0xaf2c('0x4c')]()[_0xaf2c('0x2d')](function(_0x297a22){if(_0x297a22){if(_0x297a22[_0xaf2c('0x4d')]){if(_0x297a22[_0xaf2c('0x4e')]&&_0x297a22[_0xaf2c('0x4e')]>0x0){logger[_0xaf2c('0x10')](util[_0xaf2c('0x12')]('[LICENSE]\x20CHANNELS:\x20%s',_0x297a22[_0xaf2c('0x4e')]));_0x10a270=_0x297a22[_0xaf2c('0x4e')];}else{logger[_0xaf2c('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xaf2c('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x10a270=-0x1;}}})[_0xaf2c('0x4f')](function(_0x2bce19){logger[_0xaf2c('0x15')](_0xaf2c('0x50'),_0x2bce19[_0xaf2c('0xd')]);})[_0xaf2c('0x44')](function(){var _0x118e03=require(_0xaf2c('0x51'))(config[_0xaf2c('0x6')]['port'],config[_0xaf2c('0x6')]['ip'],_0x10a270);_0x118e03['on'](_0xaf2c('0x15'),errorHandler);_0x118e03['on'](_0xaf2c('0x52'),listeningHandler);_0x118e03['on'](_0xaf2c('0x53'),connectionHandler);_0x118e03['on'](_0xaf2c('0x33'),closeHandler);});}main(); \ No newline at end of file +var _0x3248=['calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','production','start','debug','stringify','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','./rpc','./mailRpc','./vertices','agi','defaults','127.0.0.1','nextTick','error','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','stack','info','arg_1'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3248,0x1b0));var _0x8324=function(_0x1a3c3b,_0x3ee7b9){_0x1a3c3b=_0x1a3c3b-0x0;var _0x368a98=_0x3248[_0x1a3c3b];return _0x368a98;};'use strict';var parser=require(_0x8324('0x0'));var _=require(_0x8324('0x1'));var syncho=require(_0x8324('0x2'));var util=require(_0x8324('0x3'));var moment=require(_0x8324('0x4'));var config=require(_0x8324('0x5'));var logger=require(_0x8324('0x6'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x8324('0x7'));var mailRpc=require(_0x8324('0x8'));var Graph=require('./graph');var Vertices=require(_0x8324('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8324('0xa')]=_[_0x8324('0xb')](config[_0x8324('0xa')],{'ip':_0x8324('0xc'),'port':0x11dd});function connectionHandler(_0x5d5f01){process[_0x8324('0xd')](function(){syncho(function(){try{setChannelVariables(_0x5d5f01);agiHandler(_0x5d5f01);}catch(_0x2994f9){logger[_0x8324('0xe')](_0x2994f9['stack']);}});});}function listeningHandler(){console['log'](_0x8324('0xf'),config[_0x8324('0xa')][_0x8324('0x10')]);logger['info'](util[_0x8324('0x11')](_0x8324('0x12'),config[_0x8324('0xa')]['ip'],config[_0x8324('0xa')][_0x8324('0x10')]));}function errorHandler(_0x1f1c35){if(_0x1f1c35&&_0x1f1c35['name']&&_0x1f1c35['message']){logger['error'](util[_0x8324('0x11')]('[%s]\x20%s',_0x1f1c35['name'],_0x1f1c35[_0x8324('0x13')]));}else{logger[_0x8324('0xe')](util[_0x8324('0x11')]('[ERROR]\x20%s',_0x1f1c35[_0x8324('0x14')]));}}function closeHandler(){logger[_0x8324('0x15')](util[_0x8324('0x11')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x8324('0x16')],this[_0x8324('0x17')],this[_0x8324('0x18')],this[_0x8324('0x19')],this[_0x8324('0x1a')]));try{createSquareReport(this);}catch(_0x3f067c){logger['error'](_0x3f067c['stack']);}}function timeoutHandler(){logger[_0x8324('0x15')](util[_0x8324('0x11')](_0x8324('0x1b'),this['arg_1'],this[_0x8324('0x17')],this[_0x8324('0x18')],this[_0x8324('0x19')],this[_0x8324('0x1a')]));}function hangupHandler(){logger[_0x8324('0x15')](util['format'](_0x8324('0x1c'),this['arg_1'],this[_0x8324('0x17')],this['callerid'],this[_0x8324('0x19')],this['uniqueid']));this[_0x8324('0x1d')]=!![];}function getRoot(_0xb31584){return parser[_0x8324('0x1e')](_0xb31584,{'object':!![]})[_0x8324('0x1f')][_0x8324('0x20')];}function addVertex(_0x354842,_0x44042f,_0x10fc10){_0x44042f[_0x8324('0x21')]=_0x10fc10;if(_0x44042f[_0x8324('0x22')](_0x8324('0x23'))){_0x44042f[_0x8324('0x24')]=parseInt(_0x44042f[_0x8324('0x23')],0xa);}_0x354842[_0x8324('0x25')](_[_0x8324('0x26')](_0x44042f,_0x8324('0x27')));}function initGraph(_0xff7879,_0x32510a){var _0x3a94fe=new Graph();for(var _0x2b77e4 in _0xff7879){if(_0xff7879[_0x8324('0x22')](_0x2b77e4)){if(_[_0x8324('0x28')](_0xff7879[_0x2b77e4])){for(var _0x28de02=0x0;_0x28de02<_0xff7879[_0x2b77e4][_0x8324('0x29')];_0x28de02+=0x1){addVertex(_0x3a94fe,_0xff7879[_0x2b77e4][_0x28de02],_0x2b77e4);}}else{addVertex(_0x3a94fe,_0xff7879[_0x2b77e4],_0x2b77e4);}}}for(var _0x45fadf=0x0;_0x45fadf<_0x32510a['length'];_0x45fadf+=0x1){if(_0x32510a[_0x45fadf][_0x8324('0x2a')]&&_0x32510a[_0x45fadf][_0x8324('0x2b')]){_0x3a94fe[_0x8324('0x2c')](_0x32510a[_0x45fadf][_0x8324('0x2a')],_0x32510a[_0x45fadf]['target'],_0x32510a[_0x45fadf][_0x8324('0x2d')]);}}return _0x3a94fe;}function getSquareProject(_0x268345,_0x437b4e){rpc[_0x8324('0x2e')](_0x268345)[_0x8324('0x2f')](function(_0x7dc4c9){_0x437b4e(null,_0x7dc4c9);})[_0x8324('0x30')](function(_0x5a4379){_0x437b4e(null,_0x5a4379);});}function createSquareReport(_0x1875f4,_0x98ba49){rpc[_0x8324('0x31')](_0x1875f4)[_0x8324('0x2f')](function(_0x27b46d){if(_0x98ba49){_0x98ba49(null,_0x27b46d);}})[_0x8324('0x30')](function(_0x50a23c){if(_0x98ba49){_0x98ba49(null,_0x50a23c);}});}function setChannelVariables(_0x39f37){for(var _0x27c920 in _0x39f37){if(_0x39f37['hasOwnProperty'](_0x27c920)){if(_0x27c920[_0x8324('0x32')](_0x8324('0x33'))===0x0){_0x39f37[_0x27c920[_0x8324('0x34')](0x4)]=_0x39f37[_0x27c920];delete _0x39f37[_0x27c920];}}}}function getLogFromObject(_0x4fe793){return util[_0x8324('0x35')](_0x4fe793,{'showHidden':![],'depth':null});}function agiHandler(_0x262528){var _0x5f25bb,_0x4dfbce,_0x25761c,_0x884587,_0x378512;logger['debug']('variables',JSON['stringify'](_0x262528,null,0x2));logger[_0x8324('0x15')](util[_0x8324('0x11')](_0x8324('0x36'),_0x262528[_0x8324('0x16')],_0x262528['calleridname'],_0x262528[_0x8324('0x18')],_0x262528[_0x8324('0x19')],_0x262528[_0x8324('0x1a')]));_0x262528['on'](_0x8324('0xe'),errorHandler);_0x262528['on']('close',closeHandler);_0x262528['on'](_0x8324('0x37'),timeoutHandler);_0x262528[_0x8324('0x1d')]=![];_0x262528['on'](_0x8324('0x38'),hangupHandler);var _0x3484fc=getSquareProject['sync'](null,_0x262528[_0x8324('0x16')]);if(_0x3484fc){if(_0x3484fc[_0x8324('0x39')]){_0x5f25bb=getRoot(_0x3484fc[_0x8324('0x39')]);if(_0x5f25bb&&_0x5f25bb[_0x8324('0x3a')]){logger[_0x8324('0x3b')](_0x8324('0x20'),JSON[_0x8324('0x3c')](_0x5f25bb,null,0x2));_0x262528[_0x8324('0x3d')]=moment()[_0x8324('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4dfbce=initGraph(_['omit'](_0x5f25bb,'mxCell'),_0x5f25bb[_0x8324('0x27')]);_0x25761c=new Vertices(_0x262528,rpc,mailRpc);logger[_0x8324('0x15')](util[_0x8324('0x11')](_0x8324('0x3e'),_0x262528['arg_1'],_0x262528[_0x8324('0x17')],_0x262528['callerid'],_0x262528[_0x8324('0x19')],_0x262528[_0x8324('0x1a')]));_0x4dfbce['traverseBFS'](_0x5f25bb[_0x8324('0x3a')]['id'],function(_0x21113d){try{_0x21113d=_0x25761c[_0x8324('0x3f')](_0x21113d);logger[_0x8324('0x3b')](_0x8324('0x40'),JSON[_0x8324('0x3c')](_0x21113d,null,0x2));if(_0x21113d[_0x8324('0x21')]===_0x8324('0x41')){logger[_0x8324('0x15')](_0x8324('0x42'));_0x262528[_0x8324('0x43')]=_0x21113d[_0x8324('0x43')]||_0x262528[_0x8324('0x43')];_0x262528['extension']=_0x21113d[_0x8324('0x44')];_0x262528[_0x8324('0x45')]=_0x21113d['priority']?_0x21113d[_0x8324('0x45')]-0x1:0x1;return null;}else if(_0x21113d&&_0x25761c[_0x21113d['agicommand']]){_0x378512=_0x25761c[_0x21113d[_0x8324('0x21')]](_0x21113d);logger['info'](_0x8324('0x46'),JSON[_0x8324('0x3c')](_0x378512,null,0x2));if(_0x378512&&_0x378512[_0x8324('0x47')]===AGI_CODE_SUCCESS&&_0x378512[_0x8324('0x48')]!==AGI_RESULT_ERROR&&!_0x262528[_0x8324('0x1d')]){logger['debug']('response',getLogFromObject(_0x378512));return _[_0x8324('0x49')](_0x378512[_0x8324('0x48')])?null:_0x378512[_0x8324('0x48')][_0x8324('0x4a')]();}else{logger['error'](_0x8324('0x46'),getLogFromObject(_0x378512));return null;}}else{logger['error'](_0x8324('0x4b'));return null;}}catch(_0x1ec084){logger[_0x8324('0xe')](_0x1ec084[_0x8324('0x14')]);return null;}});if(_0x5f25bb['finally']){logger[_0x8324('0x15')](util['format'](_0x8324('0x4c'),_0x262528[_0x8324('0x16')],_0x262528[_0x8324('0x17')],_0x262528[_0x8324('0x18')],_0x262528['dnid'],_0x262528[_0x8324('0x1a')]));_0x4dfbce[_0x8324('0x4d')](_0x5f25bb[_0x8324('0x4e')]['id'],function(_0x573ac2){try{_0x573ac2=_0x25761c[_0x8324('0x3f')](_0x573ac2);logger['debug'](_0x8324('0x40'),JSON[_0x8324('0x3c')](_0x573ac2,null,0x2));if(_0x573ac2&&_0x25761c[_0x573ac2[_0x8324('0x21')]]){_0x378512=_0x25761c[_0x573ac2[_0x8324('0x21')]](_0x573ac2);if(_0x378512){logger['debug'](_0x8324('0x46'),getLogFromObject(_0x378512));return _[_0x8324('0x49')](_0x378512[_0x8324('0x48')])?null:_0x378512[_0x8324('0x48')][_0x8324('0x4a')]();}else{logger['error'](_0x8324('0x46'),getLogFromObject(_0x378512));return null;}}else{logger[_0x8324('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x4a5846){logger[_0x8324('0xe')](_0x4a5846['stack']);return null;}});}logger['info'](util[_0x8324('0x11')](_0x8324('0x4f'),_0x262528['arg_1'],_0x262528[_0x8324('0x17')],_0x262528['callerid'],_0x262528['dnid'],_0x262528[_0x8324('0x1a')]));logger['info'](util[_0x8324('0x11')](_0x8324('0x50'),_0x262528[_0x8324('0x43')],_0x262528[_0x8324('0x44')],parseInt(_0x262528['priority'],0xa)+0x1));_0x262528[_0x8324('0x51')](_0x262528[_0x8324('0x43')],_0x262528[_0x8324('0x44')],parseInt(_0x262528[_0x8324('0x45')],0xa)+0x1);_0x262528[_0x8324('0x52')]();}}else{logger[_0x8324('0xe')](util['format']('Project\x20%s\x20not\x20published',_0x262528[_0x8324('0x16')]));_0x262528[_0x8324('0x51')](_0x262528[_0x8324('0x43')],_0x262528[_0x8324('0x44')],parseInt(_0x262528[_0x8324('0x45')],0xa)+0x1);_0x262528[_0x8324('0x52')]();}}else{logger['error'](util[_0x8324('0x11')](_0x8324('0x53'),_0x262528[_0x8324('0x16')]));_0x262528[_0x8324('0x51')](_0x262528[_0x8324('0x43')],_0x262528[_0x8324('0x44')],parseInt(_0x262528[_0x8324('0x45')],0xa)+0x1);_0x262528['close']();}}function main(){var _0x40abc7;return utilLicense[_0x8324('0x54')]()[_0x8324('0x2f')](function(_0x5e1de4){if(_0x5e1de4){if(_0x5e1de4[_0x8324('0x55')]){if(_0x5e1de4['callysquare']&&_0x5e1de4[_0x8324('0x56')]>0x0){logger[_0x8324('0x15')](util[_0x8324('0x11')](_0x8324('0x57'),_0x5e1de4[_0x8324('0x56')]));_0x40abc7=_0x5e1de4['callysquare'];}else{logger[_0x8324('0x15')](_0x8324('0x58'));}}else{logger[_0x8324('0x15')](_0x8324('0x59'));_0x40abc7=-0x1;}}})[_0x8324('0x30')](function(_0x237ad2){logger['error'](_0x8324('0x5a'),_0x237ad2[_0x8324('0x14')]);})[_0x8324('0x4e')](function(){var _0x203f53=require('./server')(config['agi']['port'],config[_0x8324('0xa')]['ip'],_0x40abc7);_0x203f53['on'](_0x8324('0xe'),errorHandler);_0x203f53['on']('listening',listeningHandler);_0x203f53['on']('connection',connectionHandler);_0x203f53['on'](_0x8324('0x52'),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 173b76d..e0dfc1c 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(_0x477d81,_0x32ed61){var _0xa9bd15=function(_0x370b9f){while(--_0x370b9f){_0x477d81['push'](_0x477d81['shift']());}};_0xa9bd15(++_0x32ed61);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x3d1982,_0x52aacb){var _0x4e414e=function(_0x4b807d){while(--_0x4b807d){_0x3d1982['push'](_0x3d1982['shift']());}};_0x4e414e(++_0x52aacb);}(_0x814b,0x1a2));var _0xb814=function(_0x36c87d,_0x2ab247){_0x36c87d=_0x36c87d-0x0;var _0x54dc55=_0x814b[_0x36c87d];return _0x54dc55;};'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 diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index ab47372..1c737b8 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(_0xcf098d,_0x1b9e69){var _0x99daff=function(_0x3aedcc){while(--_0x3aedcc){_0xcf098d['push'](_0xcf098d['shift']());}};_0x99daff(++_0x1b9e69);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2272c3,_0x4e81bc){_0x2272c3=_0x2272c3-0x0;var _0x43645f=_0x5f2f[_0x2272c3];return _0x43645f;};'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(_0x571840,_0x43897e){var _0x1915d7=function(_0x2dafd1){while(--_0x2dafd1){_0x571840['push'](_0x571840['shift']());}};_0x1915d7(++_0x43897e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c9838,_0x355068){_0x2c9838=_0x2c9838-0x0;var _0x3fc1c0=_0x5f2f[_0x2c9838];return _0x3fc1c0;};'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 d16aaf2..282555f 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 _0xa9e7=['merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','moment','lodash','util','jayson/promise','client','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','dsn','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','createSquareReport'];(function(_0x210a54,_0x29be0a){var _0x425bb0=function(_0xa9ea41){while(--_0xa9ea41){_0x210a54['push'](_0x210a54['shift']());}};_0x425bb0(++_0x29be0a);}(_0xa9e7,0x79));var _0x7a9e=function(_0xb79c0b,_0x45f477){_0xb79c0b=_0xb79c0b-0x0;var _0xf40ed9=_0xa9e7[_0xb79c0b];return _0xf40ed9;};'use strict';var BPromise=require('bluebird');var moment=require(_0x7a9e('0x0'));var _=require(_0x7a9e('0x1'));var util=require(_0x7a9e('0x2'));var jayson=require(_0x7a9e('0x3'));var client=jayson[_0x7a9e('0x4')]['http']({'port':0x2329});function request(_0x3c5260,_0x29a132){return new BPromise(function(_0x1aea3a,_0x22dd2e){return client[_0x7a9e('0x5')](_0x3c5260,_0x29a132)[_0x7a9e('0x6')](function(_0x1f890a){if(_0x1f890a[_0x7a9e('0x7')]){return _0x22dd2e(_0x1f890a[_0x7a9e('0x7')][_0x7a9e('0x8')]);}else{return _0x1aea3a(_0x1f890a[_0x7a9e('0x9')]);}})[_0x7a9e('0xa')](function(_0x264650){return _0x22dd2e(_0x264650);});});}exports[_0x7a9e('0xb')]=function(_0x2dfd31){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2dfd31},'attributes':[_0x7a9e('0xc')]}});};exports[_0x7a9e('0xd')]=function(_0x2b2e1d){return request(_0x7a9e('0xe'),{'options':{'raw':![],'where':{'id':_0x2b2e1d},'include':[{'model':_0x7a9e('0xf'),'as':'Smtp'}],'attributes':['id',_0x7a9e('0x10'),_0x7a9e('0x11')]}});};exports['getSquareProjectById']=function(_0x46b68a){return request(_0x7a9e('0x12'),{'options':{'where':{'id':_0x46b68a},'attributes':['name']}});};exports[_0x7a9e('0x13')]=function(_0x35476c){return request(_0x7a9e('0x14'),{'options':{'where':{'id':_0x35476c},'attributes':['name']}});};exports[_0x7a9e('0x15')]=function(_0x4baaf1){return request(_0x7a9e('0x16'),{'options':{'where':{'id':_0x4baaf1},'attributes':[_0x7a9e('0x10')]}});};exports['getSquareOdbcById']=function(_0x50e250){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x50e250},'attributes':[_0x7a9e('0x17')]}});};exports['getUserById']=function(_0x3c17d7){return request('ShowUser',{'options':{'where':{'id':_0x3c17d7},'attributes':[_0x7a9e('0x10')]}});};exports[_0x7a9e('0x18')]=function(_0x51fbc0){return request(_0x7a9e('0x19'),{'options':{'where':{'id':_0x51fbc0},'attributes':[_0x7a9e('0x10')]}});};exports['getSoundById']=function(_0x25e31f){return request(_0x7a9e('0x1a'),{'options':{'where':{'id':_0x25e31f},'attributes':[_0x7a9e('0x1b')]}});};exports[_0x7a9e('0x1c')]=function(_0x5540a9){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x5540a9},'include':[{'model':_0x7a9e('0x1d'),'as':_0x7a9e('0x1e')}]}});};exports[_0x7a9e('0x1f')]=function(_0xaa6435){return request(_0x7a9e('0x20'),{'options':{'where':{'id':_0xaa6435},'attributes':['id',_0x7a9e('0x10')]}});};exports['createSmsMessage']=function(_0x388714){return request('CreateSmsMessage',{'body':_0x388714});};exports[_0x7a9e('0x21')]=function(_0xfd39a8){return request('CreateSquareDetailsReport',{'body':_0xfd39a8});};exports[_0x7a9e('0x22')]=function(_0x25e997){return request('CreateSquareReport',{'body':_[_0x7a9e('0x23')](_0x25e997,{'project_name':_0x25e997['arg_1'],'prev_project_name':_0x25e997[_0x7a9e('0x24')]||'','is_subproject':_0x25e997[_0x7a9e('0x24')]?!![]:![],'leaveAt':moment()[_0x7a9e('0x25')](_0x7a9e('0x26'))})});};exports[_0x7a9e('0x27')]=function(_0x1c3af1){return request(_0x7a9e('0x28'),{'body':_0x1c3af1});};exports['createSquareMessage']=function(_0x90bc7a){return request(_0x7a9e('0x29'),{'body':_0x90bc7a});};exports[_0x7a9e('0x2a')]=function(_0x39d898){return request(_0x7a9e('0x2b'),{'options':{'raw':![],'where':{'phone':_0x39d898[_0x7a9e('0x2c')],'ListId':_0x39d898['ListId']}}})[_0x7a9e('0x6')](function(_0x49bccf){if(_0x49bccf){return _0x49bccf;}return request(_0x7a9e('0x2d'),{'body':_0x39d898});});};exports['getPauseById']=function(_0x2e05f0){return request(_0x7a9e('0x2e'),{'options':{'where':{'id':_0x2e05f0},'attributes':['name']}});};exports[_0x7a9e('0x2f')]=function(_0x3826d8,_0x4dac40){return request(_0x7a9e('0x30'),{'body':{'interface':_0x4dac40},'options':{'where':_0x3826d8}});};exports[_0x7a9e('0x31')]=function(_0x4757f4,_0x15534a,_0x5e47db){return request(_0x7a9e('0x32'),{'body':{'type':_0x15534a,'uniqueid':_0x5e47db},'options':{'where':_0x4757f4}});};exports['agentUnpause']=function(_0x9a0ee){return request(_0x7a9e('0x33'),{'body':{},'options':{'where':_0x9a0ee}});};exports['agentLogout']=function(_0xee354c){return request('LogoutUser',{'body':{},'options':{'where':_0xee354c}});}; \ No newline at end of file +var _0xe749=['bluebird','moment','util','jayson/promise','http','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','getUserById','ShowUser','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','LogoutUser'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xe749,0x1ef));var _0x9e74=function(_0x5c0261,_0x34f252){_0x5c0261=_0x5c0261-0x0;var _0x4b135d=_0xe749[_0x5c0261];return _0x4b135d;};'use strict';var BPromise=require(_0x9e74('0x0'));var moment=require(_0x9e74('0x1'));var _=require('lodash');var util=require(_0x9e74('0x2'));var jayson=require(_0x9e74('0x3'));var client=jayson['client'][_0x9e74('0x4')]({'port':0x2329});function request(_0x25cdac,_0x6f6993){return new BPromise(function(_0x7290f6,_0x487994){return client[_0x9e74('0x5')](_0x25cdac,_0x6f6993)[_0x9e74('0x6')](function(_0x427388){if(_0x427388['error']){return _0x487994(_0x427388[_0x9e74('0x7')][_0x9e74('0x8')]);}else{return _0x7290f6(_0x427388[_0x9e74('0x9')]);}})[_0x9e74('0xa')](function(_0x857e26){return _0x487994(_0x857e26);});});}exports[_0x9e74('0xb')]=function(_0x4ba642){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4ba642},'attributes':[_0x9e74('0xc')]}});};exports[_0x9e74('0xd')]=function(_0x249a16){return request(_0x9e74('0xe'),{'options':{'raw':![],'where':{'id':_0x249a16},'include':[{'model':'MailServerOut','as':_0x9e74('0xf')}],'attributes':['id',_0x9e74('0x10'),_0x9e74('0x11')]}});};exports[_0x9e74('0x12')]=function(_0x3b665a){return request(_0x9e74('0x13'),{'options':{'where':{'id':_0x3b665a},'attributes':['name']}});};exports[_0x9e74('0x14')]=function(_0x39c70c){return request(_0x9e74('0x15'),{'options':{'where':{'id':_0x39c70c},'attributes':[_0x9e74('0x10')]}});};exports[_0x9e74('0x16')]=function(_0x1c3bfd){return request('ShowVariable',{'options':{'where':{'id':_0x1c3bfd},'attributes':[_0x9e74('0x10')]}});};exports['getSquareOdbcById']=function(_0x349038){return request(_0x9e74('0x17'),{'options':{'where':{'id':_0x349038},'attributes':['dsn']}});};exports[_0x9e74('0x18')]=function(_0x106458){return request(_0x9e74('0x19'),{'options':{'where':{'id':_0x106458},'attributes':['name']}});};exports['getTrunkById']=function(_0x3513e0){return request('ShowTrunk',{'options':{'where':{'id':_0x3513e0},'attributes':['name']}});};exports['getSoundById']=function(_0x3896be){return request(_0x9e74('0x1a'),{'options':{'where':{'id':_0x3896be},'attributes':['save_name']}});};exports[_0x9e74('0x1b')]=function(_0x34a81c){return request(_0x9e74('0x1c'),{'options':{'raw':![],'where':{'id':_0x34a81c},'include':[{'model':_0x9e74('0x1d'),'as':_0x9e74('0x1e')}]}});};exports[_0x9e74('0x1f')]=function(_0x377491){return request('ShowSmsAccount',{'options':{'where':{'id':_0x377491},'attributes':['id',_0x9e74('0x10')]}});};exports[_0x9e74('0x20')]=function(_0x373054){return request(_0x9e74('0x21'),{'body':_0x373054});};exports['createSquareDetailsReport']=function(_0x31677b){return request(_0x9e74('0x22'),{'body':_0x31677b});};exports[_0x9e74('0x23')]=function(_0x40f082){return request(_0x9e74('0x24'),{'body':_['merge'](_0x40f082,{'project_name':_0x40f082[_0x9e74('0x25')],'prev_project_name':_0x40f082[_0x9e74('0x26')]||'','is_subproject':_0x40f082[_0x9e74('0x26')]?!![]:![],'leaveAt':moment()[_0x9e74('0x27')](_0x9e74('0x28'))})});};exports[_0x9e74('0x29')]=function(_0x38f526){return request(_0x9e74('0x2a'),{'body':_0x38f526});};exports[_0x9e74('0x2b')]=function(_0x5b1a60){return request('CreateSquareMessage',{'body':_0x5b1a60});};exports['createCmContact']=function(_0x205d59){return request(_0x9e74('0x2c'),{'options':{'raw':![],'where':{'phone':_0x205d59[_0x9e74('0x2d')],'ListId':_0x205d59[_0x9e74('0x2e')]}}})['then'](function(_0x88e698){if(_0x88e698){return _0x88e698;}return request(_0x9e74('0x2f'),{'body':_0x205d59});});};exports[_0x9e74('0x30')]=function(_0x4b5871){return request('ShowPause',{'options':{'where':{'id':_0x4b5871},'attributes':[_0x9e74('0x10')]}});};exports[_0x9e74('0x31')]=function(_0x5a93b0,_0x4d577a){return request(_0x9e74('0x32'),{'body':{'interface':_0x4d577a},'options':{'where':_0x5a93b0}});};exports[_0x9e74('0x33')]=function(_0x1147a1,_0x55f853,_0x25c672){return request('PauseUser',{'body':{'type':_0x55f853,'uniqueid':_0x25c672},'options':{'where':_0x1147a1}});};exports[_0x9e74('0x34')]=function(_0x1eb7b2){return request(_0x9e74('0x35'),{'body':{},'options':{'where':_0x1eb7b2}});};exports['agentLogout']=function(_0x511100){return request(_0x9e74('0x36'),{'body':{},'options':{'where':_0x511100}});}; \ 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 67038d2..023cdf0 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 _0x4e5d=['exports','./polly','./lex'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x4e5d,0xd3));var _0xd4e5=function(_0x2de41e,_0x12a7dc){_0x2de41e=_0x2de41e-0x0;var _0x2e70d1=_0x4e5d[_0x2de41e];return _0x2e70d1;};var polly=require(_0xd4e5('0x0'));var lex=require(_0xd4e5('0x1'));module[_0xd4e5('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x4d86=['exports','./polly','./lex'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x4d86,0xfd));var _0x64d8=function(_0x44273a,_0x1dcfe6){_0x44273a=_0x44273a-0x0;var _0x406b3e=_0x4d86[_0x44273a];return _0x406b3e;};var polly=require(_0x64d8('0x0'));var lex=require(_0x64d8('0x1'));module[_0x64d8('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 01070b1..7ca3f8d 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 _0xc91b=['exports','./lib/api'];(function(_0x46d62a,_0x193b92){var _0x43c746=function(_0x22bfbf){while(--_0x22bfbf){_0x46d62a['push'](_0x46d62a['shift']());}};_0x43c746(++_0x193b92);}(_0xc91b,0x16f));var _0xbc91=function(_0x531a81,_0x32cfa1){_0x531a81=_0x531a81-0x0;var _0x4b0956=_0xc91b[_0x531a81];return _0x4b0956;};'use strict';var lex=require(_0xbc91('0x0'));module[_0xbc91('0x1')]=function(_0x33a03d,_0xaca0fa,_0x2a5f39,_0xb4810d,_0x1ac340,_0x16ae0f){return lex(_0x33a03d,_0xaca0fa,_0x2a5f39,_0xb4810d,_0x1ac340,_0x16ae0f);}; \ No newline at end of file +var _0x4a81=['exports','./lib/api'];(function(_0xacb619,_0x4492e3){var _0x23de38=function(_0xa6a3a9){while(--_0xa6a3a9){_0xacb619['push'](_0xacb619['shift']());}};_0x23de38(++_0x4492e3);}(_0x4a81,0x1b7));var _0x14a8=function(_0x593811,_0x1ace8d){_0x593811=_0x593811-0x0;var _0x3a4d5c=_0x4a81[_0x593811];return _0x3a4d5c;};'use strict';var lex=require(_0x14a8('0x0'));module[_0x14a8('0x1')]=function(_0x3a301f,_0x104041,_0x4a7f9e,_0x5845a3,_0x45869b,_0x53309b){return lex(_0x3a301f,_0x104041,_0x4a7f9e,_0x5845a3,_0x45869b,_0x53309b);}; \ 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 916b578..2d7b98f 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 _0xc682=['$LATEST','bluebird','postText','slots','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc682,0x9c));var _0x2c68=function(_0x1ad99e,_0x528ab4){_0x1ad99e=_0x1ad99e-0x0;var _0xfe2930=_0xc682[_0x1ad99e];return _0xfe2930;};'use strict';var BPromise=require(_0x2c68('0x0'));var AWS=require('aws-sdk');function lexResult(_0x4f3d00,_0x3877b0){return new BPromise(function(_0x573bc1,_0x26ba4a){_0x4f3d00[_0x2c68('0x1')](_0x3877b0,function(_0x1c3de2,_0x37844a){if(_0x1c3de2){_0x26ba4a(_0x1c3de2);}if(_0x37844a['slots']){for(const _0x300be4 in _0x37844a['slots']){if(_0x37844a['slots']['hasOwnProperty'](_0x300be4)){var _0x53e12c=_0x37844a[_0x2c68('0x2')][_0x300be4];_0x37844a['slot_'+_0x300be4]=_0x53e12c;}}}_0x573bc1(_0x37844a);});});}module[_0x2c68('0x3')]=function(_0x4abcee,_0xde5f9e,_0x1ff42c,_0x360b5f,_0x321593,_0x25731f){var _0x336ace=new AWS['LexRuntime']({'accessKeyId':_0xde5f9e,'secretAccessKey':_0x1ff42c,'region':_0x360b5f});var _0x27a33b={'botAlias':_0x2c68('0x4'),'botName':_0x25731f,'inputText':_0x321593,'userId':_0x4abcee};return lexResult(_0x336ace,_0x27a33b);}; \ No newline at end of file +var _0xde1c=['LexRuntime','$LATEST','bluebird','postText','slots','exports'];(function(_0x22035e,_0x5da77b){var _0x4d0d50=function(_0x8d1a92){while(--_0x8d1a92){_0x22035e['push'](_0x22035e['shift']());}};_0x4d0d50(++_0x5da77b);}(_0xde1c,0x1d0));var _0xcde1=function(_0x3c8117,_0x4e0cf5){_0x3c8117=_0x3c8117-0x0;var _0xd2dc03=_0xde1c[_0x3c8117];return _0xd2dc03;};'use strict';var BPromise=require(_0xcde1('0x0'));var AWS=require('aws-sdk');function lexResult(_0x3a70a5,_0x223c1a){return new BPromise(function(_0x7b4d30,_0x52ade7){_0x3a70a5[_0xcde1('0x1')](_0x223c1a,function(_0x595ff3,_0x168379){if(_0x595ff3){_0x52ade7(_0x595ff3);}if(_0x168379[_0xcde1('0x2')]){for(const _0x590992 in _0x168379['slots']){if(_0x168379[_0xcde1('0x2')]['hasOwnProperty'](_0x590992)){var _0x3f23cc=_0x168379[_0xcde1('0x2')][_0x590992];_0x168379['slot_'+_0x590992]=_0x3f23cc;}}}_0x7b4d30(_0x168379);});});}module[_0xcde1('0x3')]=function(_0x45792e,_0x3c6924,_0x3d435f,_0x454592,_0x47f1a0,_0x1aa7eb){var _0x3e6b17=new AWS[(_0xcde1('0x4'))]({'accessKeyId':_0x3c6924,'secretAccessKey':_0x3d435f,'region':_0x454592});var _0x46619c={'botAlias':_0xcde1('0x5'),'botName':_0x1aa7eb,'inputText':_0x47f1a0,'userId':_0x45792e};return lexResult(_0x3e6b17,_0x46619c);}; \ 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 11f8368..4b1c983 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 _0xa2d6=['exports','./lib/api'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xa2d6,0x65));var _0x6a2d=function(_0x422a6a,_0x34cc4){_0x422a6a=_0x422a6a-0x0;var _0x137714=_0xa2d6[_0x422a6a];return _0x137714;};'use strict';var polly=require(_0x6a2d('0x0'));module[_0x6a2d('0x1')]=function(_0x461122,_0x29320d,_0x16f3a5,_0x1ca37d,_0x2b5962,_0xb2d414,_0x5c75ff){return polly(_0x461122,_0x29320d,_0x16f3a5,_0x1ca37d,_0x2b5962,_0xb2d414,_0x5c75ff);}; \ No newline at end of file +var _0x2dbe=['./lib/api'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x2dbe,0x171));var _0xe2db=function(_0x47fbc0,_0x498cbe){_0x47fbc0=_0x47fbc0-0x0;var _0x59d2a0=_0x2dbe[_0x47fbc0];return _0x59d2a0;};'use strict';var polly=require(_0xe2db('0x0'));module['exports']=function(_0x2192f5,_0x5a3c47,_0x1ee815,_0x2a6139,_0x2f91f2,_0x3551ad,_0x3d3b2c){return polly(_0x2192f5,_0x5a3c47,_0x1ee815,_0x2a6139,_0x2f91f2,_0x3551ad,_0x3d3b2c);}; \ 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 a1ff5f6..0c8cc34 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 _0x3942=['aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring'];(function(_0x38f6bc,_0x5bdccd){var _0x2930b8=function(_0x43b250){while(--_0x43b250){_0x38f6bc['push'](_0x38f6bc['shift']());}};_0x2930b8(++_0x5bdccd);}(_0x3942,0x12a));var _0x2394=function(_0x343fb6,_0x4b19fc){_0x343fb6=_0x343fb6-0x0;var _0x598f35=_0x3942[_0x343fb6];return _0x598f35;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x2394('0x0'));var rs=require(_0x2394('0x1'));var AWS=require(_0x2394('0x2'));function pollyResult(_0x1fe55d,_0x28ec5d,_0x455141){return new BPromise(function(_0x5ad480,_0x57dd37){_0x1fe55d[_0x2394('0x3')](_0x28ec5d,function(_0x23e823,_0x1b6a10){if(_0x23e823){_0x57dd37(_0x23e823);}else if(_0x1b6a10){if(_0x1b6a10[_0x2394('0x4')]instanceof Buffer){fs[_0x2394('0x5')](_0x455141,_0x1b6a10[_0x2394('0x4')],function(_0x2206ec){if(_0x2206ec){_0x57dd37(_0x2206ec);}else{_0x5ad480();}});}else{_0x57dd37(new Error(_0x2394('0x6')));}}else{_0x57dd37(new Error(_0x2394('0x7')));}});});}module[_0x2394('0x8')]=function(_0x5dd462,_0x36a626,_0x23aac9,_0x18c06c,_0x2b7e8f,_0x17a4d2,_0x1b0d5f){var _0x1f22d7=new AWS[(_0x2394('0x9'))]({'accessKeyId':_0x5dd462,'secretAccessKey':_0x36a626,'region':_0x23aac9});var _0x4cdbda={'Text':_0x2b7e8f,'TextType':_0x17a4d2||_0x2394('0xa'),'OutputFormat':_0x2394('0xb'),'VoiceId':_0x18c06c};return pollyResult(_0x1f22d7,_0x4cdbda,_0x1b0d5f);}; \ No newline at end of file +var _0x6ae3=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3a5cc4,_0x5dff5f){var _0x474f87=function(_0x32dcf9){while(--_0x32dcf9){_0x3a5cc4['push'](_0x3a5cc4['shift']());}};_0x474f87(++_0x5dff5f);}(_0x6ae3,0x138));var _0x36ae=function(_0x45370e,_0x46960b){_0x45370e=_0x45370e-0x0;var _0x2172f1=_0x6ae3[_0x45370e];return _0x2172f1;};'use strict';var fs=require('fs');var path=require(_0x36ae('0x0'));var BPromise=require('bluebird');var rs=require(_0x36ae('0x1'));var AWS=require(_0x36ae('0x2'));function pollyResult(_0x423e0e,_0x4c0f83,_0x10af11){return new BPromise(function(_0x3c7e92,_0x5dec00){_0x423e0e[_0x36ae('0x3')](_0x4c0f83,function(_0x49ac67,_0x5bf599){if(_0x49ac67){_0x5dec00(_0x49ac67);}else if(_0x5bf599){if(_0x5bf599[_0x36ae('0x4')]instanceof Buffer){fs[_0x36ae('0x5')](_0x10af11,_0x5bf599[_0x36ae('0x4')],function(_0x18d9c0){if(_0x18d9c0){_0x5dec00(_0x18d9c0);}else{_0x3c7e92();}});}else{_0x5dec00(new Error(_0x36ae('0x6')));}}else{_0x5dec00(new Error(_0x36ae('0x7')));}});});}module[_0x36ae('0x8')]=function(_0x26b669,_0x3e00c4,_0x2c6d01,_0x4b5b3d,_0x561ef3,_0x51a92c,_0x20c1c6){var _0x56dfb1=new AWS[(_0x36ae('0x9'))]({'accessKeyId':_0x26b669,'secretAccessKey':_0x3e00c4,'region':_0x2c6d01});var _0x259a9f={'Text':_0x561ef3,'TextType':_0x51a92c||_0x36ae('0xa'),'OutputFormat':'mp3','VoiceId':_0x4b5b3d};return pollyResult(_0x56dfb1,_0x259a9f,_0x20c1c6);}; \ 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 c1036b8..a063d47 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 _0x457b=['./lib/api','exports'];(function(_0xcc0387,_0x20b5f8){var _0x2cdc78=function(_0x5984fa){while(--_0x5984fa){_0xcc0387['push'](_0xcc0387['shift']());}};_0x2cdc78(++_0x20b5f8);}(_0x457b,0xca));var _0xb457=function(_0x5484cf,_0x153f52){_0x5484cf=_0x5484cf-0x0;var _0x5b7de7=_0x457b[_0x5484cf];return _0x5b7de7;};'use strict';var asr=require(_0xb457('0x0'));module[_0xb457('0x1')]=function(_0x4b9799,_0x376ea4,_0xf8abd6,_0x4120a4){return asr(_0x4b9799,_0x376ea4,_0xf8abd6);}; \ No newline at end of file +var _0xb57d=['exports','./lib/api'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xb57d,0x18d));var _0xdb57=function(_0x7b39b5,_0x24375c){_0x7b39b5=_0x7b39b5-0x0;var _0x1e54fd=_0xb57d[_0x7b39b5];return _0x1e54fd;};'use strict';var asr=require(_0xdb57('0x0'));module[_0xdb57('0x1')]=function(_0x267364,_0x13cfd6,_0xec6730,_0x526990){return asr(_0x267364,_0x13cfd6,_0xec6730);}; \ 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 00df6c5..41d33ee 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 _0x23f0=['LINEAR16','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key='];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x23f0,0xaa));var _0x023f=function(_0x125721,_0x2fde0c){_0x125721=_0x125721-0x0;var _0x165cba=_0x23f0[_0x125721];return _0x165cba;};'use strict';var url=require('url');var BPromise=require(_0x023f('0x0'));var fs=require('fs');var host=_0x023f('0x1');module['exports']=function(_0x1d4aa8,_0x47098f,_0x2d7d51){return new BPromise(function(_0x2572f4,_0x3131fd){var _0x4117eb;if(typeof _0x1d4aa8!==_0x023f('0x2')||_0x1d4aa8[_0x023f('0x3')]===0x0){return _0x3131fd(_0x023f('0x4'));}if(typeof _0x47098f!==_0x023f('0x2')||_0x47098f[_0x023f('0x3')]===0x0){return _0x3131fd('key\x20should\x20be\x20a\x20string');}if(typeof _0x2d7d51!==_0x023f('0x5')&&(typeof _0x2d7d51!=='string'||_0x2d7d51['length']===0x0)){return _0x3131fd(_0x023f('0x6'));}try{_0x4117eb=fs[_0x023f('0x7')](_0x1d4aa8)[_0x023f('0x8')](_0x023f('0x9'));}catch(_0x58a92a){return _0x3131fd(_0x58a92a);}return _0x2572f4({'method':_0x023f('0xa'),'uri':host+_0x023f('0xb')+_0x47098f,'body':{'config':{'encoding':_0x023f('0xc'),'sampleRateHertz':'8000','languageCode':_0x2d7d51},'audio':{'content':_0x4117eb}},'json':!![]});});}; \ No newline at end of file +var _0x27eb=['url','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0x4db547,_0x19eef3){var _0x1654f8=function(_0x3fac47){while(--_0x3fac47){_0x4db547['push'](_0x4db547['shift']());}};_0x1654f8(++_0x19eef3);}(_0x27eb,0x1ee));var _0xb27e=function(_0xb0b610,_0x262078){_0xb0b610=_0xb0b610-0x0;var _0x4866e4=_0x27eb[_0xb0b610];return _0x4866e4;};'use strict';var url=require(_0xb27e('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xb27e('0x1');module['exports']=function(_0x4cb149,_0x275dc2,_0x4a9ac2){return new BPromise(function(_0x583708,_0x28c80b){var _0x2c7d9e;if(typeof _0x4cb149!==_0xb27e('0x2')||_0x4cb149['length']===0x0){return _0x28c80b('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x275dc2!==_0xb27e('0x2')||_0x275dc2[_0xb27e('0x3')]===0x0){return _0x28c80b(_0xb27e('0x4'));}if(typeof _0x4a9ac2!==_0xb27e('0x5')&&(typeof _0x4a9ac2!==_0xb27e('0x2')||_0x4a9ac2[_0xb27e('0x3')]===0x0)){return _0x28c80b('lang\x20should\x20be\x20a\x20string');}try{_0x2c7d9e=fs[_0xb27e('0x6')](_0x4cb149)[_0xb27e('0x7')](_0xb27e('0x8'));}catch(_0x34508a){return _0x28c80b(_0x34508a);}return _0x583708({'method':_0xb27e('0x9'),'uri':host+_0xb27e('0xa')+_0x275dc2,'body':{'config':{'encoding':_0xb27e('0xb'),'sampleRateHertz':_0xb27e('0xc'),'languageCode':_0x4a9ac2},'audio':{'content':_0x2c7d9e}},'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 10cb4be..1d33f18 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0xedd9=['exports'];(function(_0x33dda2,_0x8267e){var _0x1a778a=function(_0x5ddabb){while(--_0x5ddabb){_0x33dda2['push'](_0x33dda2['shift']());}};_0x1a778a(++_0x8267e);}(_0xedd9,0xfc));var _0x9edd=function(_0x20d31a,_0x520bc3){_0x20d31a=_0x20d31a-0x0;var _0x3e3f16=_0xedd9[_0x20d31a];return _0x3e3f16;};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 39f51a6..efed79f 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 _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0xb10b,0x12a));var _0xbb10=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0xb10b[_0x71e493];return _0x3d40ab;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=function(){return __dirname;}; \ No newline at end of file +var _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x29db14,_0x4fcd9f){_0x29db14=_0x29db14-0x0;var _0x5cfc55=_0xb10b[_0x29db14];return _0x5cfc55;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=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 a01b9c9..69ad63f 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 _0x040d=['exports','./nda'];(function(_0x20a1b0,_0x18fe84){var _0x321e14=function(_0x69fdf6){while(--_0x69fdf6){_0x20a1b0['push'](_0x20a1b0['shift']());}};_0x321e14(++_0x18fe84);}(_0x040d,0x1af));var _0xd040=function(_0x44ff3a,_0x46f40d){_0x44ff3a=_0x44ff3a-0x0;var _0x333bc1=_0x040d[_0x44ff3a];return _0x333bc1;};var nda=require(_0xd040('0x0'));module[_0xd040('0x1')]={'nda':nda}; \ No newline at end of file +var _0xa6d9=['./nda','exports'];(function(_0x438513,_0x472928){var _0x14943a=function(_0x48492e){while(--_0x48492e){_0x438513['push'](_0x438513['shift']());}};_0x14943a(++_0x472928);}(_0xa6d9,0xce));var _0x9a6d=function(_0x50a3e9,_0x816ae7){_0x50a3e9=_0x50a3e9-0x0;var _0xeee15c=_0xa6d9[_0x50a3e9];return _0xeee15c;};var nda=require(_0x9a6d('0x0'));module[_0x9a6d('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 a9b090a..f0bf5ce 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 _0x6b90=['url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','CustomAction','custom_action_data','request-promise'];(function(_0xab9569,_0xf435d1){var _0x4e7ed5=function(_0x3d67b1){while(--_0x3d67b1){_0xab9569['push'](_0xab9569['shift']());}};_0x4e7ed5(++_0xf435d1);}(_0x6b90,0x135));var _0x06b9=function(_0x35cc24,_0x299db6){_0x35cc24=_0x35cc24-0x0;var _0x137359=_0x6b90[_0x35cc24];return _0x137359;};'use strict';var rp=require(_0x06b9('0x0'));var url=require(_0x06b9('0x1'));var logger=require(_0x06b9('0x2'))(_0x06b9('0x3'));module[_0x06b9('0x4')]=function(_0x2f5f46,_0xba1102){var _0x107e24={'method':_0x06b9('0x5'),'uri':url[_0x06b9('0x6')](_0xba1102[_0x06b9('0x7')],_0x06b9('0x8')),'form':{'grant_type':_0x06b9('0x9'),'username':_0xba1102['username'],'password':_0xba1102[_0x06b9('0x9')]},'json':!![]};return rp(_0x107e24)[_0x06b9('0xa')](function(_0x11b4e2){var _0x3eaba2={'method':'POST','uri':url[_0x06b9('0x6')](_0xba1102['ndassistant_url'],_0x06b9('0xb')),'body':{'type':_0xba1102[_0x06b9('0xc')]||_0x06b9('0xd'),'channelId':_0x06b9('0xe'),'conversation':{'id':_0x2f5f46[_0x06b9('0xf')]},'from':{'id':_0x2f5f46[_0x06b9('0x10')],'name':_0x2f5f46[_0x06b9('0x11')]},'recipient':{'id':_0x2f5f46[_0x06b9('0x12')],'name':_0x2f5f46[_0x06b9('0x13')]},'text':_0xba1102[_0x06b9('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x11b4e2[_0x06b9('0x15')]},'json':!![]};if(_0xba1102[_0x06b9('0x16')]){_0x3eaba2[_0x06b9('0x17')]['channelData'][_0x06b9('0x18')]=_0xba1102[_0x06b9('0x16')];}if(_0xba1102[_0x06b9('0x19')]=='1'){_0x3eaba2['body'][_0x06b9('0x1a')][_0x06b9('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x06b9('0x1c')};}if(_0xba1102['custom_action']){_0x3eaba2[_0x06b9('0x17')][_0x06b9('0x1a')][_0x06b9('0x1d')]=_0xba1102['custom_action'];if(_0xba1102[_0x06b9('0x1e')]){_0x3eaba2[_0x06b9('0x17')]['channelData']['CustomActionData']=_0xba1102['custom_action_data'];}}logger['info'](JSON['stringify'](_0x3eaba2));return rp(_0x3eaba2);});}; \ No newline at end of file +var _0x354f=['body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','resolve','ndauth_url','/token','password','username','then','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','access_token','project'];(function(_0x59f776,_0x546b31){var _0x3a6fe7=function(_0x4b0e8f){while(--_0x4b0e8f){_0x59f776['push'](_0x59f776['shift']());}};_0x3a6fe7(++_0x546b31);}(_0x354f,0x1ec));var _0xf354=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x354f[_0x4dc7b9];return _0x3ab114;};'use strict';var rp=require(_0xf354('0x0'));var url=require('url');var logger=require(_0xf354('0x1'))('agi');module['exports']=function(_0xd5c5f1,_0x5b9960){var _0x1a4b08={'method':'POST','uri':url[_0xf354('0x2')](_0x5b9960[_0xf354('0x3')],_0xf354('0x4')),'form':{'grant_type':_0xf354('0x5'),'username':_0x5b9960[_0xf354('0x6')],'password':_0x5b9960[_0xf354('0x5')]},'json':!![]};return rp(_0x1a4b08)[_0xf354('0x7')](function(_0x89b102){var _0x1e543e={'method':'POST','uri':url[_0xf354('0x2')](_0x5b9960[_0xf354('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5b9960[_0xf354('0x9')]||_0xf354('0xa'),'channelId':_0xf354('0xb'),'conversation':{'id':_0xd5c5f1[_0xf354('0xc')]},'from':{'id':_0xd5c5f1[_0xf354('0xd')],'name':_0xd5c5f1[_0xf354('0xe')]},'recipient':{'id':_0xd5c5f1[_0xf354('0xf')],'name':_0xd5c5f1['extension']},'text':_0x5b9960[_0xf354('0x10')],'channelData':{}},'headers':{'Authorization':_0xf354('0x11')+_0x89b102[_0xf354('0x12')]},'json':!![]};if(_0x5b9960[_0xf354('0x13')]){_0x1e543e[_0xf354('0x14')][_0xf354('0x15')][_0xf354('0x16')]=_0x5b9960['project'];}if(_0x5b9960[_0xf354('0x17')]=='1'){_0x1e543e['body'][_0xf354('0x15')][_0xf354('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf354('0x19')};}if(_0x5b9960[_0xf354('0x1a')]){_0x1e543e[_0xf354('0x14')][_0xf354('0x15')][_0xf354('0x1b')]=_0x5b9960[_0xf354('0x1a')];if(_0x5b9960['custom_action_data']){_0x1e543e[_0xf354('0x14')][_0xf354('0x15')][_0xf354('0x1c')]=_0x5b9960[_0xf354('0x1d')];}}logger[_0xf354('0x1e')](JSON[_0xf354('0x1f')](_0x1e543e));return rp(_0x1e543e);});}; \ 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 8758aee..f41480c 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 _0x72e6=['exports'];(function(_0x3e5a8d,_0x14921a){var _0x1b0082=function(_0x55b848){while(--_0x55b848){_0x3e5a8d['push'](_0x3e5a8d['shift']());}};_0x1b0082(++_0x14921a);}(_0x72e6,0x66));var _0x672e=function(_0xec2175,_0x56516c){_0xec2175=_0xec2175-0x0;var _0x29314d=_0x72e6[_0xec2175];return _0x29314d;};'use strict';var asr=require('./lib/api');module[_0x672e('0x0')]=function(_0x4cdc76,_0x127c01,_0x5da380,_0x177943){return asr(_0x4cdc76,_0x127c01,_0x5da380,_0x177943);}; \ No newline at end of file +var _0xeb5f=['./lib/api'];(function(_0xbc5c0c,_0x330004){var _0x244f6e=function(_0x1ad32d){while(--_0x1ad32d){_0xbc5c0c['push'](_0xbc5c0c['shift']());}};_0x244f6e(++_0x330004);}(_0xeb5f,0x1b5));var _0xfeb5=function(_0x186110,_0x46bc50){_0x186110=_0x186110-0x0;var _0x503a9e=_0xeb5f[_0x186110];return _0x503a9e;};'use strict';var asr=require(_0xfeb5('0x0'));module['exports']=function(_0x533c98,_0x35f30d,_0x853ea6,_0x54daa7){return asr(_0x533c98,_0x35f30d,_0x853ea6,_0x54daa7);}; \ 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 7d73c15..c820f74 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 _0xbd09=['unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket'];(function(_0x27074a,_0x40411b){var _0x57f316=function(_0x346df6){while(--_0x346df6){_0x27074a['push'](_0x27074a['shift']());}};_0x57f316(++_0x40411b);}(_0xbd09,0x1eb));var _0x9bd0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbd09[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0x9bd0('0x0'));var _=require(_0x9bd0('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9bd0('0x2'));var crypto=require(_0x9bd0('0x3'));var logger=require(_0x9bd0('0x4'))(_0x9bd0('0x5'));module[_0x9bd0('0x6')]=function(_0x364d3f,_0x12b336,_0x338631,_0x2ba7c5){return new BPromise(function(_0x28254d,_0x4a7a0a){logger[_0x9bd0('0x7')](_0x9bd0('0x8'),_0x2ba7c5||_0x9bd0('0x9'));var _0x53ede6=new WebSocket(_0x2ba7c5||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x3aa334='';var _0x39f33e='0';var _0x1e87a9='1';var _0x119bdf=_0x9bd0('0xa');function _0x323c1b(_0x289627){var _0x3c5bc1=crypto[_0x9bd0('0xb')](_0x9bd0('0xc'));_0x3c5bc1['update'](_0x289627);return _0x3c5bc1[_0x9bd0('0xd')](_0x9bd0('0xe'));}function _0x1dda1e(){try{logger['info'](_0x9bd0('0xf'));var _0x290113=moment()[_0x9bd0('0x10')]();var _0x4e2101=_0x323c1b(_0x290113+_0x12b336+_0x338631);_0x53ede6[_0x9bd0('0x11')](JSON[_0x9bd0('0x12')]({'appID':_0x12b336,'timestamp':_0x290113,'appKey':_0x4e2101}));var _0x22b05b=fs[_0x9bd0('0x13')](_0x364d3f);_0x22b05b['on'](_0x9bd0('0x14'),function(_0x39ab44){_0x53ede6[_0x9bd0('0x11')](_0x39ab44);});_0x22b05b['on']('close',function(){_0x53ede6[_0x9bd0('0x11')](_0x9bd0('0x15'));});}catch(_0x3b08dd){logger[_0x9bd0('0x16')](_0x9bd0('0x17'),JSON[_0x9bd0('0x12')](_0x3b08dd));_0x53ede6[_0x9bd0('0x18')]();}}function _0x2dae5f(_0x347914){try{if(_0x347914){var _0x2ee024=JSON[_0x9bd0('0x19')](_0x347914);switch(_0x2ee024[_0x9bd0('0x1a')]){case 0x0:if(_0x2ee024[_0x9bd0('0x1b')]){if(_0x2ee024[_0x9bd0('0x1b')][_0x9bd0('0x1c')]){logger[_0x9bd0('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0x9bd0('0x12')](_0x2ee024[_0x9bd0('0x1b')][_0x9bd0('0x1d')]));_0x3aa334=_0x2ee024[_0x9bd0('0x1b')][_0x9bd0('0x1d')][0x0][_0x9bd0('0x1e')];_0x39f33e=_0x2ee024[_0x9bd0('0x1b')][_0x9bd0('0x1d')][0x0]['likelihood'];_0x1e87a9='0';_0x119bdf=_0x9bd0('0x1f');_0x53ede6['terminate']();}}break;case 0x1:logger['info'](_0x9bd0('0xa'));_0x1e87a9='1';_0x119bdf=_0x9bd0('0xa');break;case 0x2:logger[_0x9bd0('0x7')](_0x9bd0('0x20'));_0x1e87a9='2';_0x119bdf=_0x9bd0('0x20');break;case 0x9:logger[_0x9bd0('0x7')](_0x9bd0('0x21'));_0x1e87a9='9';_0x119bdf=_0x9bd0('0x21');break;case 0xa:logger['info']('Authentication\x20failed.');_0x1e87a9='10';_0x119bdf='Authentication\x20failed.';break;case 0xb:logger[_0x9bd0('0x7')](_0x9bd0('0x22'));_0x1e87a9='11';_0x119bdf=_0x9bd0('0x22');}}}catch(_0x193149){logger['error'](_0x9bd0('0x23'),JSON['stringify'](_0x193149));_0x53ede6[_0x9bd0('0x18')]();}}function _0x4c3e6b(){logger[_0x9bd0('0x7')](_0x9bd0('0x24'));_0x28254d({'transcript':_0x3aa334,'confidence':_0x39f33e,'status':_0x1e87a9,'status_message':_0x119bdf});}function _0x4dcf37(_0x2670ec){logger[_0x9bd0('0x16')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x9bd0('0x25')](_0x2670ec)){logger[_0x9bd0('0x16')](_['isObject'](_0x2670ec)?JSON[_0x9bd0('0x12')](_0x2670ec):_0x2670ec);}}_0x53ede6['on'](_0x9bd0('0x26'),_0x1dda1e);_0x53ede6['on']('message',_0x2dae5f);_0x53ede6['on']('close',_0x4c3e6b);_0x53ede6['on']('error',_0x4dcf37);});}; \ No newline at end of file +var _0xf7f2=['Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','stringify','transcript','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','isNil','open','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','createReadStream','EOS'];(function(_0x2ed782,_0x3f8b62){var _0x1125c6=function(_0x2089b5){while(--_0x2089b5){_0x2ed782['push'](_0x2ed782['shift']());}};_0x1125c6(++_0x3f8b62);}(_0xf7f2,0xf2));var _0x2f7f=function(_0x291b77,_0x36b1c2){_0x291b77=_0x291b77-0x0;var _0x138495=_0xf7f2[_0x291b77];return _0x138495;};'use strict';var BPromise=require(_0x2f7f('0x0'));var _=require(_0x2f7f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2f7f('0x2'));var crypto=require(_0x2f7f('0x3'));var logger=require(_0x2f7f('0x4'))('agi');module[_0x2f7f('0x5')]=function(_0x599ee1,_0x253e51,_0x2b88e8,_0x528620){return new BPromise(function(_0x32c881,_0x43f811){logger[_0x2f7f('0x6')]('Tilde\x20URI',_0x528620||_0x2f7f('0x7'));var _0xa7dc65=new WebSocket(_0x528620||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x5915a6='';var _0x3d53fc='0';var _0x501928='1';var _0x2e2760=_0x2f7f('0x8');function _0x4aca39(_0x3ddfea){var _0x20718f=crypto[_0x2f7f('0x9')](_0x2f7f('0xa'));_0x20718f[_0x2f7f('0xb')](_0x3ddfea);return _0x20718f[_0x2f7f('0xc')](_0x2f7f('0xd'));}function _0x56d029(){try{logger[_0x2f7f('0x6')](_0x2f7f('0xe'));var _0x15b23f=moment()['unix']();var _0x485b58=_0x4aca39(_0x15b23f+_0x253e51+_0x2b88e8);_0xa7dc65['send'](JSON['stringify']({'appID':_0x253e51,'timestamp':_0x15b23f,'appKey':_0x485b58}));var _0x28a201=fs[_0x2f7f('0xf')](_0x599ee1);_0x28a201['on']('data',function(_0x50476e){_0xa7dc65['send'](_0x50476e);});_0x28a201['on']('close',function(){_0xa7dc65['send'](_0x2f7f('0x10'));});}catch(_0x4cb906){logger['error'](_0x2f7f('0x11'),JSON['stringify'](_0x4cb906));_0xa7dc65[_0x2f7f('0x12')]();}}function _0x1792ac(_0x382e9a){try{if(_0x382e9a){var _0x1fbe26=JSON[_0x2f7f('0x13')](_0x382e9a);switch(_0x1fbe26['status']){case 0x0:if(_0x1fbe26[_0x2f7f('0x14')]){if(_0x1fbe26['result'][_0x2f7f('0x15')]){logger[_0x2f7f('0x6')](_0x2f7f('0x16'),JSON[_0x2f7f('0x17')](_0x1fbe26[_0x2f7f('0x14')]['hypotheses']));_0x5915a6=_0x1fbe26['result']['hypotheses'][0x0][_0x2f7f('0x18')];_0x3d53fc=_0x1fbe26[_0x2f7f('0x14')][_0x2f7f('0x19')][0x0][_0x2f7f('0x1a')];_0x501928='0';_0x2e2760=_0x2f7f('0x1b');_0xa7dc65[_0x2f7f('0x12')]();}}break;case 0x1:logger[_0x2f7f('0x6')](_0x2f7f('0x8'));_0x501928='1';_0x2e2760=_0x2f7f('0x8');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x501928='2';_0x2e2760=_0x2f7f('0x1c');break;case 0x9:logger[_0x2f7f('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x501928='9';_0x2e2760=_0x2f7f('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0x501928='10';_0x2e2760='Authentication\x20failed.';break;case 0xb:logger[_0x2f7f('0x6')](_0x2f7f('0x1e'));_0x501928='11';_0x2e2760=_0x2f7f('0x1e');}}}catch(_0x5001d6){logger[_0x2f7f('0x1f')](_0x2f7f('0x20'),JSON[_0x2f7f('0x17')](_0x5001d6));_0xa7dc65['terminate']();}}function _0x49af24(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x32c881({'transcript':_0x5915a6,'confidence':_0x3d53fc,'status':_0x501928,'status_message':_0x2e2760});}function _0x349aee(_0x1d2bc5){logger[_0x2f7f('0x1f')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x2f7f('0x21')](_0x1d2bc5)){logger[_0x2f7f('0x1f')](_['isObject'](_0x1d2bc5)?JSON[_0x2f7f('0x17')](_0x1d2bc5):_0x1d2bc5);}}_0xa7dc65['on'](_0x2f7f('0x22'),_0x56d029);_0xa7dc65['on'](_0x2f7f('0x23'),_0x1792ac);_0xa7dc65['on'](_0x2f7f('0x24'),_0x49af24);_0xa7dc65['on'](_0x2f7f('0x1f'),_0x349aee);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 10cb4be..1d5434e 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x70e0=['exports','./asr'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x70e0,0x17b));var _0x070e=function(_0x111f8d,_0xff22ca){_0x111f8d=_0x111f8d-0x0;var _0x2d9544=_0x70e0[_0x111f8d];return _0x2d9544;};var asr=require(_0x070e('0x0'));module[_0x070e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 54e9e35..d6c43ee 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 _0xbe5e=['E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections'];(function(_0x432813,_0xab9e9a){var _0x353280=function(_0x51a3f3){while(--_0x51a3f3){_0x432813['push'](_0x432813['shift']());}};_0x353280(++_0xab9e9a);}(_0xbe5e,0x81));var _0xebe5=function(_0x48a010,_0x526602){_0x48a010=_0x48a010-0x0;var _0x423b5b=_0xbe5e[_0x48a010];return _0x423b5b;};'use strict';var util=require(_0xebe5('0x0'));var net=require(_0xebe5('0x1'));var EventEmitter=require('events')[_0xebe5('0x2')];var AGIError=require(_0xebe5('0x3'));var AGIChannel=require(_0xebe5('0x4'));var AGIServer=function(_0x2a1302,_0x4389c3,_0x43d7f7){var _0x1e3335=this,_0x2a1302=_0x2a1302||0x11dd,_0x4389c3=_0x4389c3||_0xebe5('0x5'),_0x5aa5e5=null,_0x35cf69=0x0;EventEmitter[_0xebe5('0x6')](_0x1e3335);function _0x73d4df(){if(!_0x2a1302){_0x1e3335[_0xebe5('0x7')](_0xebe5('0x8'),new AGIError(_0xebe5('0x9')));return![];}_0x5aa5e5=net[_0xebe5('0xa')]();_0x5aa5e5[_0xebe5('0xb')](_0x2a1302,_0x4389c3);_0x5aa5e5['on']('listening',function(){_0x1e3335['emit'](_0xebe5('0xc'));});_0x5aa5e5['on'](_0xebe5('0xd'),function(_0x5882ff){_0x5aa5e5[_0xebe5('0xe')](function(_0x1e8eec,_0x5d8bde){if(_0x1e8eec){_0x1e3335[_0xebe5('0x7')](_0xebe5('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x1e8eec));}else if(_0x43d7f7&&_0x43d7f7<0x0){_0x1e3335['emit']('error',new AGIError(_0xebe5('0xf')));_0x5882ff[_0xebe5('0x10')]();}else if(_0x43d7f7&&_0x43d7f7>0x0&&_0x43d7f7<_0x5d8bde){_0x35cf69+=0x1;_0x1e3335['emit'](_0xebe5('0x8'),new AGIError(_0xebe5('0x11'),_0x35cf69));_0x5882ff[_0xebe5('0x10')]();}else{var _0x493670=new AGIChannel(_0x5882ff);_0x493670['on'](_0xebe5('0x12'),function(){_0x1e3335[_0xebe5('0x7')](_0xebe5('0xd'),_0x493670);});}});});_0x5aa5e5['on']('error',function(_0x505224){_0x1e3335['emit'](_0xebe5('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x505224['code']));});_0x5aa5e5['on'](_0xebe5('0x13'),function(){_0x1e3335[_0xebe5('0x7')](_0xebe5('0x13'),new AGIError(_0xebe5('0x14')));});}process[_0xebe5('0x15')](function(){_0x73d4df();});};util[_0xebe5('0x16')](AGIServer,EventEmitter);module[_0xebe5('0x17')]=function(_0x521ac8,_0x3be153,_0x5eae64){return new AGIServer(_0x521ac8,_0x3be153,_0x5eae64);}; \ No newline at end of file +var _0x1e00=['emit','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','error','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','events','./error','./channel','127.0.0.1','call'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x1e00,0x1df));var _0x01e0=function(_0x281667,_0x2c2630){_0x281667=_0x281667-0x0;var _0x372ff7=_0x1e00[_0x281667];return _0x372ff7;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x01e0('0x0'))['EventEmitter'];var AGIError=require(_0x01e0('0x1'));var AGIChannel=require(_0x01e0('0x2'));var AGIServer=function(_0x540689,_0x502ab9,_0x3f5b5e){var _0x4234b8=this,_0x540689=_0x540689||0x11dd,_0x502ab9=_0x502ab9||_0x01e0('0x3'),_0x3e58b0=null,_0x47e61a=0x0;EventEmitter[_0x01e0('0x4')](_0x4234b8);function _0x31b1d6(){if(!_0x540689){_0x4234b8[_0x01e0('0x5')]('error',new AGIError(_0x01e0('0x6')));return![];}_0x3e58b0=net['createServer']();_0x3e58b0[_0x01e0('0x7')](_0x540689,_0x502ab9);_0x3e58b0['on'](_0x01e0('0x8'),function(){_0x4234b8[_0x01e0('0x5')](_0x01e0('0x8'));});_0x3e58b0['on'](_0x01e0('0x9'),function(_0x597665){_0x3e58b0[_0x01e0('0xa')](function(_0xfe2668,_0x23e3fa){if(_0xfe2668){_0x4234b8['emit']('error',new AGIError(_0x01e0('0xb'),_0xfe2668));}else if(_0x3f5b5e&&_0x3f5b5e<0x0){_0x4234b8[_0x01e0('0x5')]('error',new AGIError(_0x01e0('0xc')));_0x597665[_0x01e0('0xd')]();}else if(_0x3f5b5e&&_0x3f5b5e>0x0&&_0x3f5b5e<_0x23e3fa){_0x47e61a+=0x1;_0x4234b8[_0x01e0('0x5')](_0x01e0('0xe'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x47e61a));_0x597665[_0x01e0('0xd')]();}else{var _0x4fbb51=new AGIChannel(_0x597665);_0x4fbb51['on'](_0x01e0('0xf'),function(){_0x4234b8[_0x01e0('0x5')](_0x01e0('0x9'),_0x4fbb51);});}});});_0x3e58b0['on'](_0x01e0('0xe'),function(_0x2bf3de){_0x4234b8[_0x01e0('0x5')](_0x01e0('0xe'),new AGIError('E_AGI_SERVER_ERROR',_0x2bf3de[_0x01e0('0x10')]));});_0x3e58b0['on'](_0x01e0('0x11'),function(){_0x4234b8[_0x01e0('0x5')](_0x01e0('0x11'),new AGIError(_0x01e0('0x12')));});}process[_0x01e0('0x13')](function(){_0x31b1d6();});};util[_0x01e0('0x14')](AGIServer,EventEmitter);module[_0x01e0('0x15')]=function(_0x3b5fae,_0x8e42a0,_0x31fc68){return new AGIServer(_0x3b5fae,_0x8e42a0,_0x31fc68);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e906110..fc6da12 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 _0x675b=['Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','unlink','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','forEach','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','saydigits','sayDigits','saynumber','sayNumber','number','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','Smtp','bcc','subject','service','host','port','secure','authentication','auth','user','pass','template_id','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','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','replaceAll','exports','path','util','lodash','shelljs','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','getVoiceQueue','getVoiceQueueById','then','getSquareProject','catch','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','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','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleTTS','text','google_tts_language','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','timeout','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','result','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','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','sestekNDA','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','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\x20found','getData','response','maxdigit','test','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr'];(function(_0x40ea13,_0x47a965){var _0x4f60b0=function(_0xec54ee){while(--_0xec54ee){_0x40ea13['push'](_0x40ea13['shift']());}};_0x4f60b0(++_0x47a965);}(_0x675b,0x72));var _0xb675=function(_0x3de148,_0x21f2e3){_0x3de148=_0x3de148-0x0;var _0x5b304b=_0x675b[_0x3de148];return _0x5b304b;};'use strict';var fs=require('fs');var path=require(_0xb675('0x0'));var util=require(_0xb675('0x1'));var _=require(_0xb675('0x2'));var sh=require(_0xb675('0x3'));var odbc=require(_0xb675('0x4'))();var rs=require(_0xb675('0x5'));var moment=require('moment');var Mustache=require(_0xb675('0x6'));var logger=require(_0xb675('0x7'))(_0xb675('0x8'));var config=require(_0xb675('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0xb675('0xa'),_0xb675('0xb'),_0xb675('0xc')];var AGIVertices=function(_0x197331,_0x12ef7d,_0x1b5e6b){this[_0xb675('0xd')]=_0x197331;this[_0xb675('0xe')]=_0x12ef7d;this[_0xb675('0xf')]=_0x1b5e6b;};AGIVertices[_0xb675('0x10')][_0xb675('0x11')]=function(_0x3200c9,_0x4be3b3){this['rpc'][_0xb675('0x12')](_0x3200c9)['then'](function(_0x546dd4){_0x4be3b3(null,_0x546dd4?_0x546dd4[_0xb675('0x13')]:![]);})['catch'](function(_0x52ccfa){_0x4be3b3(_0x52ccfa);});};AGIVertices[_0xb675('0x10')][_0xb675('0x14')]=function(_0x4155d2,_0x58be46){this[_0xb675('0xe')][_0xb675('0x15')](_0x4155d2)[_0xb675('0x16')](function(_0x3d7526){_0x58be46(null,_0x3d7526?_0x3d7526[_0xb675('0x13')]:![]);})['catch'](function(_0x2c2030){_0x58be46(_0x2c2030);});};AGIVertices[_0xb675('0x10')][_0xb675('0x17')]=function(_0x20c0e4,_0xca68f9){this[_0xb675('0xe')]['getSquareProjectById'](_0x20c0e4)['then'](function(_0x345477){_0xca68f9(null,_0x345477?_0x345477[_0xb675('0x13')]:![]);})[_0xb675('0x18')](function(_0x25c2cf){_0xca68f9(_0x25c2cf);});};AGIVertices[_0xb675('0x10')][_0xb675('0x19')]=function(_0x51abf8,_0x1d98b5){this[_0xb675('0xe')][_0xb675('0x1a')](_0x51abf8)[_0xb675('0x16')](function(_0x3f46f1){_0x1d98b5(null,_0x3f46f1?_0x3f46f1[_0xb675('0x1b')]:![]);})['catch'](function(_0x32eecb){_0x1d98b5(_0x32eecb);});};AGIVertices[_0xb675('0x10')][_0xb675('0x1c')]=function(_0x3f82cb,_0x140422){this[_0xb675('0xe')][_0xb675('0x1d')](_0x3f82cb)[_0xb675('0x16')](function(_0x2fb02e){_0x140422(null,_0x2fb02e?_0x2fb02e['name']:![]);})[_0xb675('0x18')](function(_0x131824){_0x140422(_0x131824);});};AGIVertices[_0xb675('0x10')]['getTrunk']=function(_0x57e99b,_0xdc021e){this[_0xb675('0xe')][_0xb675('0x1e')](_0x57e99b)[_0xb675('0x16')](function(_0x2986f0){_0xdc021e(null,_0x2986f0?_0x2986f0[_0xb675('0x13')]:![]);})[_0xb675('0x18')](function(_0x1c4ed3){_0xdc021e(_0x1c4ed3);});};AGIVertices[_0xb675('0x10')][_0xb675('0x1f')]=function(_0x5da207,_0x2076d3){var _0xc439dc=this;this[_0xb675('0xe')][_0xb675('0x20')](_0x5da207)[_0xb675('0x16')](function(_0xcd20b4){_0x2076d3(null,_0xcd20b4?_0xc439dc[_0xb675('0x21')](_0xcd20b4[_0xb675('0x22')]):![]);})['catch'](function(_0x2f828c){_0x2076d3(_0x2f828c);});};AGIVertices['prototype'][_0xb675('0x23')]=function(_0x186ddc,_0x715e4b){this[_0xb675('0xe')]['getMailAccountById'](_0x186ddc)['then'](function(_0x3ed8c5){_0x715e4b(null,_0x3ed8c5?_0x3ed8c5:![]);})[_0xb675('0x18')](function(_0x24135e){_0x715e4b(_0x24135e);});};AGIVertices[_0xb675('0x10')]['sendMailMessage']=function(_0x4656a6,_0x4207df,_0x296ac1){this['mailRpc'][_0xb675('0x24')](_0x4656a6,_0x4207df)[_0xb675('0x16')](function(){_0x296ac1(null);})['catch'](function(_0x45b848){_0x296ac1(_0x45b848);});};AGIVertices['prototype']['getIntervals']=function(_0x2bb02b,_0x54e813){this['rpc'][_0xb675('0x25')](_0x2bb02b)[_0xb675('0x16')](function(_0x2d74b8){if(_0x2d74b8){if(_0x2d74b8[_0xb675('0x26')]){_0x54e813(null,[_0x2d74b8[_0xb675('0x27')]]);}else{_0x54e813(null,_[_0xb675('0x28')](_0x2d74b8[_0xb675('0x29')],_0xb675('0x27')));}}else{_0x54e813(null,![]);}})[_0xb675('0x18')](function(_0x3d0af3){_0x54e813(_0x3d0af3);});};AGIVertices['prototype'][_0xb675('0x21')]=function(_0xfd89e1){return util[_0xb675('0x2a')](_0xb675('0x2b'),FILES_PATH,_0xfd89e1);};AGIVertices[_0xb675('0x10')][_0xb675('0x2c')]=function(_0x312569,_0xc08cf6,_0x387e6c){odbc[_0xb675('0x2d')](_0x312569,function(_0x58b3d6){if(_0x58b3d6){logger[_0xb675('0x2e')](_0xb675('0x2f'),_0x58b3d6);_0x387e6c(_0x58b3d6);}else{logger[_0xb675('0x30')](_0xb675('0x31'));odbc[_0xb675('0x32')](_0xc08cf6,function(_0xf1cc3,_0x56e425){if(_0xf1cc3){logger[_0xb675('0x30')](_0xb675('0x33'),_0xc08cf6);_0x387e6c(_0xf1cc3);}else{logger[_0xb675('0x30')](_0xb675('0x34'),_0xc08cf6);odbc[_0xb675('0x35')](function(_0x54a663){if(_0x54a663){logger['error'](_0xb675('0x36'),_0x54a663);}_0x387e6c(null,_0x56e425);});}});}});};AGIVertices[_0xb675('0x10')][_0xb675('0x37')]=function(_0x293040,_0x1ca910){this[_0xb675('0xe')][_0xb675('0x38')](_0x293040)[_0xb675('0x16')](function(_0x132cbd){_0x1ca910(null,_0x132cbd?_0x132cbd:![]);})[_0xb675('0x18')](function(_0x5d6683){_0x1ca910(_0x5d6683);});};AGIVertices['prototype'][_0xb675('0x39')]=function(_0x21beac,_0x17c648){this[_0xb675('0xe')]['createSmsMessage'](_0x21beac)[_0xb675('0x16')](function(_0xe90c83){_0x17c648(null,_0xe90c83);})[_0xb675('0x18')](function(_0x473235){_0x17c648(_0x473235);});};AGIVertices[_0xb675('0x10')][_0xb675('0x3a')]=function(_0x22c9e5,_0x19a713,_0x1dda61){this[_0xb675('0xe')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0xb675('0x3b')],'node':_0x22c9e5[_0xb675('0x3c')],'application':_0x22c9e5[_0xb675('0x3d')],'data':_0x19a713||null,'project_name':this[_0xb675('0xd')][_0xb675('0x3e')],'callerid':this['channel']['callerid']})['then'](function(_0x434190){if(_0x1dda61){_0x1dda61(null,_0x434190);}})[_0xb675('0x18')](function(_0x599066){if(_0x1dda61){_0x1dda61(_0x599066);}});};AGIVertices[_0xb675('0x10')][_0xb675('0x3f')]=function(_0x9a2837,_0x45e8bf,_0x39d077,_0x408b1f){this[_0xb675('0xe')][_0xb675('0x3f')]({'uniqueid':this[_0xb675('0xd')][_0xb675('0x3b')],'callerid':this[_0xb675('0xd')][_0xb675('0x40')],'calleridname':this[_0xb675('0xd')][_0xb675('0x41')],'context':this[_0xb675('0xd')][_0xb675('0x42')],'extension':this['channel']['extension'],'priority':this['channel'][_0xb675('0x43')],'accountcode':this[_0xb675('0xd')][_0xb675('0x44')],'dnid':this[_0xb675('0xd')][_0xb675('0x45')],'projectName':this['channel'][_0xb675('0x3e')],'saveName':_0x45e8bf,'filename':_0x9a2837[_0xb675('0x46')]||_0x45e8bf,'savePath':_0x39d077})[_0xb675('0x16')](function(_0x2528c5){_0x408b1f(null,_0x2528c5);})[_0xb675('0x18')](function(_0x2f9dfb){_0x408b1f(_0x2f9dfb);});};AGIVertices[_0xb675('0x10')][_0xb675('0x47')]=function(_0x31d45d,_0x1394d8,_0x68fb27){this[_0xb675('0xe')][_0xb675('0x47')]({'uniqueid':this[_0xb675('0xd')][_0xb675('0x3b')],'body':_0x31d45d,'direction':_0x1394d8})[_0xb675('0x16')](function(_0x28d1b7){if(_0x68fb27){_0x68fb27(null,_0x28d1b7);}})[_0xb675('0x18')](function(_0x2ebc8d){if(_0x68fb27){_0x68fb27(_0x2ebc8d);}});};AGIVertices[_0xb675('0x10')][_0xb675('0x48')]=function(_0x1d156c,_0x5693dd){this[_0xb675('0xe')]['createCmContact']({'firstName':_[_0xb675('0x49')](_0x1d156c[_0xb675('0x13')])||_[_0xb675('0x4a')](_0x1d156c[_0xb675('0x13')])?_0xb675('0x4b')+Math[_0xb675('0x4c')]():_0x1d156c[_0xb675('0x13')],'lastName':_[_0xb675('0x49')](_0x1d156c[_0xb675('0x4d')])||_[_0xb675('0x4a')](_0x1d156c[_0xb675('0x4d')])?null:_0x1d156c[_0xb675('0x4d')],'phone':_0x1d156c['phone'],'ListId':_0x1d156c[_0xb675('0x4e')],'scheduledAt':_0x1d156c[_0xb675('0x4f')],'callbackUniqueid':this[_0xb675('0xd')][_0xb675('0x3b')],'tags':_0xb675('0x50'),'description':_0xb675('0x51')+_0x1d156c['scheduledAt'][_0xb675('0x52')](),'priority':_0x1d156c[_0xb675('0x53')]})['then'](function(_0x1b7f80){_0x5693dd(null,_0x1b7f80);})['catch'](function(_0x3fe425){_0x5693dd(_0x3fe425);});};AGIVertices[_0xb675('0x10')][_0xb675('0x54')]=function(_0x347cfa,_0x1289c3){this[_0xb675('0xe')][_0xb675('0x55')](_0x347cfa)['then'](function(_0x3e3190){_0x1289c3(null,_0x3e3190?_0x3e3190[_0xb675('0x13')]:![]);})['catch'](function(_0x19e030){_0x1289c3(_0x19e030);});};AGIVertices[_0xb675('0x10')][_0xb675('0x56')]=function(_0x3d3c07,_0x21d571,_0x481de0){var _0x38a8e2={'role':'agent'};_0x38a8e2[_0x3d3c07]=this['channel']['callerid'];this['rpc']['agentPause'](_0x38a8e2,_0x21d571,this['channel']['uniqueid'])[_0xb675('0x16')](function(_0x10066d){_0x481de0(null,_['isNil'](_0x10066d)?![]:!![]);})[_0xb675('0x18')](function(_0x37381f){logger[_0xb675('0x2e')](_0x37381f);_0x481de0(null,![]);});};AGIVertices[_0xb675('0x10')]['agentUnpause']=function(_0x1468ce,_0xfbefd1){var _0x3ff50a={'role':_0xb675('0x57')};_0x3ff50a[_0x1468ce]=this['channel']['callerid'];this[_0xb675('0xe')][_0xb675('0x58')](_0x3ff50a)[_0xb675('0x16')](function(_0x3f31d7){_0xfbefd1(null,_[_0xb675('0x4a')](_0x3f31d7)?![]:!![]);})[_0xb675('0x18')](function(_0x2f00b6){logger['error'](_0x2f00b6);_0xfbefd1(null,![]);});};AGIVertices[_0xb675('0x10')][_0xb675('0x59')]=function(_0x211eef,_0x19c5e0){var _0xacd83d={'role':_0xb675('0x57')};_0xacd83d[_0x211eef]=this[_0xb675('0xd')][_0xb675('0x40')];this[_0xb675('0xe')][_0xb675('0x59')](_0xacd83d)[_0xb675('0x16')](function(_0x32b4ca){_0x19c5e0(null,_['isNil'](_0x32b4ca)?![]:!![]);})['catch'](function(_0x31c117){logger[_0xb675('0x2e')](_0x31c117);_0x19c5e0(null,![]);});};AGIVertices[_0xb675('0x10')][_0xb675('0x5a')]=function(_0x29af65,_0x1e5ffb){var _0x5cc277={'role':_0xb675('0x57')};_0x5cc277[_0x29af65]=this[_0xb675('0xd')][_0xb675('0x40')];var _0x34c73a=_0x29af65!=_0xb675('0x5b')?util['format'](_0xb675('0x5c'),_0xb675('0x5d'),this[_0xb675('0xd')][_0xb675('0x40')]):undefined;this['rpc'][_0xb675('0x5a')](_0x5cc277,_0x34c73a)[_0xb675('0x16')](function(_0x1035a1){_0x1e5ffb(null,_[_0xb675('0x4a')](_0x1035a1)?![]:!![]);})[_0xb675('0x18')](function(_0x2ed107){logger[_0xb675('0x2e')](_0x2ed107);_0x1e5ffb(null,![]);});};AGIVertices['prototype'][_0xb675('0x5e')]=function(_0x34e592,_0x389c68){sh[_0xb675('0x5f')](_[_0xb675('0x60')](_0x34e592),function(_0x52d089,_0x150aad){var _0x2dfb1c=_0x150aad['replace'](/(\r\n|\n|\r)/gm,'');_0x389c68(null,_0x2dfb1c);});};AGIVertices[_0xb675('0x10')][_0xb675('0x61')]=function(_0x35fd66,_0x2e0f61){scripts[_0xb675('0x61')](_0x35fd66[_0xb675('0x62')],_0x35fd66[_0xb675('0x63')]||'en',0x1)[_0xb675('0x16')](function(_0x3c6f96){_0x2e0f61(null,_0x3c6f96);})[_0xb675('0x18')](function(_0x1ee39d){_0x2e0f61(_0x1ee39d);});};AGIVertices['prototype']['googleDialogflow']=function(_0x3d26e0,_0x29f244){scripts['googleDialogflow'](this[_0xb675('0xd')]['uniqueid'],_0x3d26e0['key'],_0x3d26e0[_0xb675('0x62')],_0x3d26e0['dialogflow_language']||'en')[_0xb675('0x16')](function(_0x4f11dc){_0x29f244(null,_0x4f11dc);})[_0xb675('0x18')](function(_0x5b0d39){_0x29f244(_0x5b0d39);});};AGIVertices['prototype']['sestekNDA']=function(_0x815adc,_0x5cff0a){scripts['sestekNDA'](this[_0xb675('0xd')],_0x815adc)[_0xb675('0x16')](function(_0x2648f6){_0x5cff0a(null,_0x2648f6);})[_0xb675('0x18')](function(_0x1d6488){_0x5cff0a(_0x1d6488);});};AGIVertices['prototype'][_0xb675('0x64')]=function(_0x4d9b95,_0x20b370){scripts[_0xb675('0x64')](_0x4d9b95[_0xb675('0x65')],_0x4d9b95[_0xb675('0x62')],_0x4d9b95[_0xb675('0x66')]||'en-US',_0x4d9b95[_0xb675('0x67')])['then'](function(_0x401b4a){_0x20b370(null,_0x401b4a);})[_0xb675('0x18')](function(_0x3d279c){_0x20b370(_0x3d279c);});};AGIVertices[_0xb675('0x10')][_0xb675('0x68')]=function(_0x46845d,_0x1e3e8a,_0x340e6){scripts[_0xb675('0x68')](_0x1e3e8a,_0x46845d[_0xb675('0x65')],_0x46845d['ispeech_asr_language']||_0xb675('0x69'),this[_0xb675('0x6a')](_0x46845d[_0xb675('0x6b')])?_0x46845d[_0xb675('0x6b')]:undefined)['then'](function(_0xd85c7c){_0x340e6(null,_0xd85c7c);})[_0xb675('0x18')](function(_0x1f6aa7){_0x340e6(_0x1f6aa7);});};AGIVertices[_0xb675('0x10')][_0xb675('0x6c')]=function(_0x398123,_0x328551){scripts['awsPolly'](_0x398123[_0xb675('0x6d')],_0x398123[_0xb675('0x6e')],_0x398123[_0xb675('0x6f')],_0x398123[_0xb675('0x70')]||_0xb675('0x71'),_0x398123['text'],_0x398123[_0xb675('0x72')]||_0xb675('0x62'))[_0xb675('0x16')](function(_0x4d362c){_0x328551(null,_0x4d362c);})[_0xb675('0x18')](function(_0x6256fa){_0x328551(_0x6256fa);});};AGIVertices[_0xb675('0x10')]['awsLex']=function(_0x1c0709,_0x1913b4){scripts[_0xb675('0x73')](this[_0xb675('0xd')][_0xb675('0x3b')],_0x1c0709['aws_access_key_id'],_0x1c0709[_0xb675('0x6e')],_0x1c0709[_0xb675('0x74')],_0x1c0709[_0xb675('0x62')],_0x1c0709[_0xb675('0x75')])[_0xb675('0x16')](function(_0x232e7f){_0x1913b4(null,_0x232e7f);})['catch'](function(_0x14b706){_0x1913b4(_0x14b706);});};AGIVertices[_0xb675('0x10')][_0xb675('0x76')]=function(_0x4277ae,_0x452f16,_0x72ceb5){scripts[_0xb675('0x76')](_0x452f16,_0x4277ae[_0xb675('0x65')],_0x4277ae[_0xb675('0x77')]||_0xb675('0x69'))[_0xb675('0x16')](function(_0x57142f){_0x72ceb5(null,_0x57142f);})['catch'](function(_0x4515e2){_0x72ceb5(_0x4515e2);});};AGIVertices['prototype']['tildeASR']=function(_0x7f4974,_0x35421c,_0x3d0cf6){scripts[_0xb675('0x78')](_0x35421c,_0x7f4974[_0xb675('0x79')],_0x7f4974[_0xb675('0x7a')],_0x7f4974['uri'])[_0xb675('0x16')](function(_0x1658b2){_0x3d0cf6(null,_0x1658b2);})['catch'](function(_0x6b9597){_0x3d0cf6(_0x6b9597);});};AGIVertices['prototype'][_0xb675('0x7b')]=function(_0x8dd21b){var _0x4fb2f6=_[_0xb675('0x7c')](verticesWithRetry,_0x8dd21b['agicommand'])?_0x8dd21b:_[_0xb675('0x7d')](_0x8dd21b);for(var _0x3afcc6 in _0x4fb2f6){if(_0x4fb2f6[_0xb675('0x7e')](_0x3afcc6)){if(_0x4fb2f6[_0x3afcc6]&&_[_0xb675('0x7f')](_0x4fb2f6[_0x3afcc6])){_0x4fb2f6[_0x3afcc6]=this[_0xb675('0x80')](_0x4fb2f6[_0x3afcc6]);}}}return _0x4fb2f6;};AGIVertices['prototype'][_0xb675('0x80')]=function(_0x21cd11){var _0x40fac7=_0x21cd11[_0xb675('0x81')]('{');for(var _0x2eb2d2=0x1;_0x2eb2d2<_0x40fac7['length'];_0x2eb2d2+=0x1){var _0x429f17=_0x40fac7[_0x2eb2d2][_0xb675('0x81')]('}');if(_0x429f17[_0xb675('0x82')]>0x1){_0x21cd11=_0x21cd11['replaceAll']('{'+_0x429f17[0x0]+'}',this[_0xb675('0xd')][_0xb675('0x11')](_0x429f17[0x0])[_0xb675('0x83')]||_0x429f17[0x0]);}}if(_0x40fac7[_0xb675('0x82')]===0x1){return _0x21cd11[_0xb675('0x52')]();}return this[_0xb675('0x80')](_0x21cd11);};AGIVertices['prototype'][_0xb675('0x84')]=function(_0x4be55f,_0x53be20){var _0x48d8a8=this[_0xb675('0xd')][_0xb675('0x11')](_0x4be55f);if(_0x48d8a8['result']===-0x1){return _0x48d8a8;}logger[_0xb675('0x30')](util['format'](_0xb675('0x85'),_0x53be20,_0x48d8a8[_0xb675('0x83')]));return this[_0xb675('0xd')][_0xb675('0x86')](_0x53be20,_0x48d8a8[_0xb675('0x83')]);};AGIVertices['prototype']['isConfigured']=function(_0x38eca0){return _0x38eca0&&_0x38eca0!=='0'&&_0x38eca0!=='-1'&&_0x38eca0!=='';};AGIVertices[_0xb675('0x10')][_0xb675('0x87')]=function(_0x2b96d2){this[_0xb675('0x3a')][_0xb675('0x88')](this,_0x2b96d2,'-');_0x2b96d2[_0xb675('0x89')]=_0x2b96d2[_0xb675('0x87')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb675('0x10')][_0xb675('0x8')]=function(_0x1850a8){logger[_0xb675('0x30')](util[_0xb675('0x2a')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1850a8[_0xb675('0x3c')]));return this[_0xb675('0xd')][_0xb675('0x8')]([_0x1850a8[_0xb675('0x8a')],_0x1850a8[_0xb675('0x8b')]]);};AGIVertices[_0xb675('0x10')][_0xb675('0x8c')]=function(_0x1e2818){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x8d'),_0x1e2818[_0xb675('0x3c')]));if(this[_0xb675('0x6a')](_0x1e2818['timeout'])){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x8e'),_0x1e2818[_0xb675('0x8f')]));var _0xd43dd9=this[_0xb675('0xd')][_0xb675('0x90')](_0x1e2818['timeout']);if(_0xd43dd9['result']===-0x1){return _0xd43dd9;}}return this['channel'][_0xb675('0x8c')]();};AGIVertices[_0xb675('0x10')][_0xb675('0x50')]=function(_0x540514){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x91'),_0x540514[_0xb675('0x3c')]));if(!this['isConfigured'](_0x540514[_0xb675('0x4e')])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x540514,'no\x20list\x20selected');}_0x540514[_0xb675('0x4f')]=moment();if(this[_0xb675('0x6a')](_0x540514[_0xb675('0x92')])){_0x540514[_0xb675('0x4f')]=moment()[_0xb675('0x93')](_0x540514['delay'],_0xb675('0x94'));}if(!this[_0xb675('0x6a')](_0x540514[_0xb675('0x53')])){_0x540514['callback_priority']=0x2;}this[_0xb675('0x48')][_0xb675('0x88')](this,_0x540514);return this[_0xb675('0xd')][_0xb675('0x95')](util['format'](_0xb675('0x96'),_0x540514['phone'],_0x540514['list_id'],_0x540514['scheduledAt']));};AGIVertices[_0xb675('0x10')]['custom_app']=function(_0x4b163a){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x97'),_0x4b163a['label']));var _0x4da1e4=this[_0xb675('0xd')]['exec'](_0x4b163a[_0xb675('0x98')],_0x4b163a[_0xb675('0x99')]);if(_0x4da1e4[_0xb675('0x9a')]===-0x1){return _0x4da1e4;}return this[_0xb675('0xd')][_0xb675('0x95')](util['format'](_0xb675('0x9b'),_0x4b163a['application'],_0x4b163a[_0xb675('0x99')]));};AGIVertices['prototype'][_0xb675('0x9c')]=function(_0x17157b){logger[_0xb675('0x30')](util['format'](_0xb675('0x9d'),_0x17157b[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x17157b['text'])){return this[_0xb675('0xd')][_0xb675('0x95')]('no\x20text\x20configured');}var _0x2831e7='\x22'+_0x17157b[_0xb675('0x62')]+'\x22';if(this[_0xb675('0x6a')](_0x17157b['options'])){_0x2831e7+=','+_0x17157b[_0xb675('0x99')];}var _0x2efa09=this[_0xb675('0xd')][_0xb675('0x5f')](_0xb675('0x9e'),_0x2831e7);if(_0x2efa09[_0xb675('0x9a')]===-0x1){return _0x2efa09;}return this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2831e7));};AGIVertices[_0xb675('0x10')][_0xb675('0x9f')]=function(_0x58b93d){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0xa0'),_0x58b93d[_0xb675('0x3c')]));if(!this['isConfigured'](_0x58b93d[_0xb675('0x62')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xa1'));}var _0x17d85e='\x22'+_0x58b93d[_0xb675('0x62')]+'\x22';if(this[_0xb675('0x6a')](_0x58b93d[_0xb675('0x99')])){_0x17d85e+=','+_0x58b93d['options'];}var _0x3a4e53=this['channel']['exec'](_0xb675('0x9e'),_0x17d85e);if(_0x3a4e53[_0xb675('0x9a')]===-0x1){return _0x3a4e53;}return this[_0xb675('0xd')]['noop'](util[_0xb675('0x2a')](_0xb675('0xa2'),_0x17d85e));};AGIVertices[_0xb675('0x10')][_0xb675('0xa3')]=function(_0x365a43){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x365a43[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x365a43[_0xb675('0xa4')])){return this[_0xb675('0xd')]['noop'](_0xb675('0xa5'));}var _0x346535=_0x365a43[_0xb675('0xa4')];if(this[_0xb675('0x6a')](_0x365a43['options'])){_0x346535+=','+_0x365a43[_0xb675('0x99')];}var _0x142006=this['channel'][_0xb675('0x5f')](_0xb675('0xa6'),_0x346535);if(_0x142006[_0xb675('0x9a')]===-0x1){return _0x142006;}var _0x22c180=this[_0xb675('0x84')](_0xb675('0xa7'),'LUMENVOX_ASR_CONFIDENCE');if(_0x22c180[_0xb675('0x9a')]===-0x1){return _0x22c180;}var _0x143188=this[_0xb675('0x84')](_0xb675('0xa8'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x143188[_0xb675('0x9a')]===-0x1){return _0x143188;}var _0x1157db=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x1157db[_0xb675('0x9a')]===-0x1){return _0x1157db;}return this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0xa9'),_0x346535));};AGIVertices[_0xb675('0x10')][_0xb675('0xaa')]=function(_0x529443){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0xab'),_0x529443[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x529443['grammar'])){return this[_0xb675('0xd')]['noop'](_0xb675('0xa5'));}var _0x114224=_0x529443[_0xb675('0xa4')];if(this[_0xb675('0x6a')](_0x529443['options'])){_0x114224+=','+_0x529443['options'];}var _0x4fea4f=this[_0xb675('0xd')][_0xb675('0x5f')](_0xb675('0xa6'),_0x114224);if(_0x4fea4f[_0xb675('0x9a')]===-0x1){return _0x4fea4f;}var _0x137521=this[_0xb675('0x84')](_0xb675('0xa7'),'SESTEK_ASR_CONFIDENCE');if(_0x137521[_0xb675('0x9a')]===-0x1){return _0x137521;}var _0x243f67=this[_0xb675('0x84')](_0xb675('0xa8'),_0xb675('0xac'));if(_0x243f67['result']===-0x1){return _0x243f67;}var _0x2cbf76=this[_0xb675('0x84')](_0xb675('0xad'),'SESTEK_ASR_INSTANCE');if(_0x2cbf76[_0xb675('0x9a')]===-0x1){return _0x2cbf76;}return this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0xa9'),_0x114224));};AGIVertices['prototype'][_0xb675('0xae')]=function(_0x2843b4){logger['info'](util[_0xb675('0x2a')](_0xb675('0xaf'),_0x2843b4[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x2843b4[_0xb675('0xb0')])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x2843b4,_0xb675('0xb1'));}var _0x42d492=this[_0xb675('0x19')][_0xb675('0x88')](this,_0x2843b4[_0xb675('0xb0')]);if(!_0x42d492){return this[_0xb675('0xd')]['error'](_0x2843b4,'no\x20odbc\x20database\x20found');}if(!this[_0xb675('0x6a')](_0x2843b4[_0xb675('0x32')])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x2843b4,_0xb675('0xb2'));}var _0x41d03d=_0x2843b4[_0xb675('0x32')][_0xb675('0xb3')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb675('0xd')][_0xb675('0x95')](util['format'](_0xb675('0xb4'),_0x41d03d));var _0x55349c=this[_0xb675('0x2c')][_0xb675('0x88')](this,_0x42d492,_0x41d03d);this[_0xb675('0x3a')][_0xb675('0x88')](this,_0x2843b4,_0x41d03d);if(!this[_0xb675('0x6a')](_0x2843b4[_0xb675('0xb5')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xb6'));}var _0x4534fb=this[_0xb675('0x11')]['sync'](this,_0x2843b4['variable_id']);if(!_0x4534fb){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x2843b4,_0xb675('0xb7'));}var _0x272f6c=this;_0x55349c['forEach'](function(_0x5748f9,_0x46fc54){Object[_0xb675('0xb8')](_0x5748f9)['forEach'](function(_0x5cd7a4){_0x272f6c[_0xb675('0xd')][_0xb675('0x86')](util[_0xb675('0x2a')](_0xb675('0xb9'),_0x4534fb,_0x46fc54,_0x5cd7a4),_0x5748f9[_0x5cd7a4]);});});this[_0xb675('0xd')]['setVariable'](util[_0xb675('0x2a')](_0xb675('0xba'),_0x4534fb),_0x55349c[_0xb675('0x82')]);return this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')]('variable\x20%s\x20set',_0x4534fb));};AGIVertices[_0xb675('0x10')][_0xb675('0xbb')]=function(_0x48c789){logger[_0xb675('0xbc')](util[_0xb675('0x2a')](_0xb675('0xbd'),_0x48c789['label']));if(!this[_0xb675('0x6a')](_0x48c789[_0xb675('0xbe')])){return this[_0xb675('0xd')]['error'](_0x48c789,_0xb675('0xbf'));}var _0x31d134=this[_0xb675('0x1c')][_0xb675('0x88')](this,_0x48c789[_0xb675('0xbe')]);if(!_0x31d134){return this[_0xb675('0xd')]['error'](_0x48c789,_0xb675('0xc0'));}var _0x4a7609=this[_0xb675('0xd')][_0xb675('0x5f')](_0xb675('0xc1'),[util[_0xb675('0x2a')](_0xb675('0xc2'),_0x31d134),_0x48c789[_0xb675('0x8f')],_0x48c789[_0xb675('0xc3')],_0x48c789[_0xb675('0xc4')]]);if(_0x4a7609[_0xb675('0x9a')]===-0x1){return _0x4a7609;}return this[_0xb675('0xd')][_0xb675('0x95')](util['format']('Executed\x20command\x20%s',_0xb675('0xc1')));};AGIVertices['prototype'][_0xb675('0xc5')]=function(_0x516c87){logger['info'](util['format'](_0xb675('0xc6'),_0x516c87[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x516c87[_0xb675('0x65')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xc7'));}if(!this[_0xb675('0x6a')](_0x516c87[_0xb675('0x62')])){return this[_0xb675('0xd')]['noop'](_0xb675('0xa1'));}this['channel'][_0xb675('0xc8')]=!![];this[_0xb675('0x3a')](_0x516c87);this[_0xb675('0x47')](_0x516c87['text'],'in');this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0xc9'),_0x516c87['text']));var _0x2242f6=this[_0xb675('0xca')][_0xb675('0x88')](this,_0x516c87);if(_0x2242f6){for(var _0x4ea69f in _0x2242f6){if(_0x2242f6[_0xb675('0x7e')](_0x4ea69f)){this['channel'][_0xb675('0x86')](util[_0xb675('0x2a')](_0xb675('0xcb'),_0x4ea69f[_0xb675('0xcc')]()),_0x2242f6[_0x4ea69f]);}}this[_0xb675('0x47')](_0x2242f6[_0xb675('0xcd')],_0xb675('0xce'));return this['channel']['noop'](util['format'](_0xb675('0xcf'),_0x2242f6[_0xb675('0xcd')]));}return this['channel'][_0xb675('0x2e')](_0x516c87,_0xb675('0xd0'));};AGIVertices[_0xb675('0x10')][_0xb675('0xd1')]=function(_0x26a320){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0xd2'),_0x26a320[_0xb675('0x3c')]));if(!this['isConfigured'](_0x26a320[_0xb675('0xd3')])){return this[_0xb675('0xd')][_0xb675('0x95')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xb675('0x6a')](_0x26a320[_0xb675('0xd4')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xd5'));}if(!this[_0xb675('0x6a')](_0x26a320['password'])){return this['channel']['noop'](_0xb675('0xd6'));}if(!this[_0xb675('0x6a')](_0x26a320['ndassistant_url'])){return this['channel'][_0xb675('0x95')](_0xb675('0xa1'));}this[_0xb675('0xd')][_0xb675('0xc8')]=!![];this['createSquareDetailsReport'](_0x26a320);this[_0xb675('0x47')](_0x26a320[_0xb675('0x62')],'in');this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')]('Trying\x20SestekNDA:\x20%s',_0x26a320['text']));var _0x3df6be=this[_0xb675('0xd7')][_0xb675('0x88')](this,_0x26a320);if(_0x3df6be){for(var _0x150c8b in _0x3df6be){if(_0x3df6be[_0xb675('0x7e')](_0x150c8b)){this['channel'][_0xb675('0x86')](util['format'](_0xb675('0xd8'),_0x150c8b[_0xb675('0xcc')]()),_0x3df6be[_0x150c8b]);}}this[_0xb675('0x47')](_0x3df6be[_0xb675('0xcd')],_0xb675('0xce'));if(_0x3df6be[_0xb675('0xd9')]){this[_0xb675('0xd')]['noop'](util[_0xb675('0x2a')](_0xb675('0xda'),_0x3df6be[_0xb675('0xd9')]));var _0x4b9254=this['channel'][_0xb675('0xdb')](_0x3df6be[_0xb675('0xd9')]);try{fs['unlink'](_0x3df6be[_0xb675('0xd9')]+_0xb675('0xdc'));}catch(_0x3d5a1c){logger[_0xb675('0x2e')](_0x3d5a1c);}return _0x4b9254;}else{return this[_0xb675('0xd')]['noop'](util[_0xb675('0x2a')](_0xb675('0xdd'),_0x3df6be[_0xb675('0xcd')]));}}return this['channel'][_0xb675('0x2e')](_0x26a320,_0xb675('0xde'));};AGIVertices[_0xb675('0x10')]['end']=function(_0x1942be){logger[_0xb675('0x30')](util['format'](_0xb675('0xdf'),_0x1942be[_0xb675('0x3c')]));return this['channel']['noop'](_0xb675('0xe0'));};AGIVertices['prototype']['ext_dial']=function(_0x481271){logger['info'](util[_0xb675('0x2a')](_0xb675('0xe1'),_0x481271[_0xb675('0x3c')]));var _0x154e68='';if(_0x481271['trunk_id']){if(!this['isConfigured'](_0x481271[_0xb675('0xe2')])){return this['channel']['error'](_0x481271,'no\x20trunk\x20selected');}else{var _0x45d89e=parseInt(_0x481271[_0xb675('0xe2')],0xa);if(isNaN(_0x45d89e)){_0x154e68=_0x481271[_0xb675('0xe2')];}else{_0x154e68=this[_0xb675('0xe3')]['sync'](this,_0x481271[_0xb675('0xe2')]);if(!_0x154e68){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x481271,'no\x20trunk\x20found');}}}}else if(_0x481271[_0xb675('0xe4')]){_0x154e68=_0x481271['trunk_name'];}else{return this[_0xb675('0xd')][_0xb675('0x2e')](_0x481271,'no\x20trunk\x20selected');}var _0xeeabda=this[_0xb675('0xd')][_0xb675('0x5f')](_0xb675('0xc1'),[util[_0xb675('0x2a')](_0xb675('0xe5'),_0x154e68,_0x481271['phone']),_0x481271['timeout'],_0x481271[_0xb675('0xc3')],_0x481271[_0xb675('0xc4')]]);if(_0xeeabda[_0xb675('0x9a')]===-0x1){return _0xeeabda;}return this['channel'][_0xb675('0x95')](util['format'](_0xb675('0xe6'),'DIAL'));};AGIVertices[_0xb675('0x10')]['finally']=function(_0x366eb2){logger['info'](util['format'](_0xb675('0xe7'),_0x366eb2[_0xb675('0x3c')]));return this[_0xb675('0xd')][_0xb675('0x95')]('finally');};AGIVertices['prototype']['getdigits']=function(_0x48d402){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0xe8'),_0x48d402[_0xb675('0x3c')]));if(_0x48d402[_0xb675('0x89')]===0x0){return this['maxRetry'](_0x48d402);}_0x48d402[_0xb675('0x89')]-=0x1;if(!this[_0xb675('0x6a')](_0x48d402[_0xb675('0xe9')])){return this['channel']['error'](_0x48d402,'no\x20file\x20audio\x20selected');}var _0x5c6139=this['getSound'][_0xb675('0x88')](this,_0x48d402[_0xb675('0xe9')]);if(!_0x5c6139){return this['channel'][_0xb675('0x2e')](_0x48d402,_0xb675('0xea'));}if(!this['isConfigured'](_0x48d402[_0xb675('0xb5')])){return this[_0xb675('0xd')][_0xb675('0x2e')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4f8403=this[_0xb675('0xd')][_0xb675('0xeb')](_0x5c6139,_0x48d402[_0xb675('0xec')],_0x48d402[_0xb675('0xed')]);var _0x51ff4e=_0x4f8403[_0xb675('0x9a')]?_0x4f8403[_0xb675('0x9a')][_0xb675('0x52')]():'';logger['info'](_0xb675('0xee'),JSON[_0xb675('0xef')](_0x4f8403));if(_0x4f8403[_0xb675('0x9a')]===-0x1){this[_0xb675('0x3a')][_0xb675('0x88')](this,_0x48d402,_0x51ff4e);return _0x4f8403;}else if(_0x4f8403['extra']===_0xb675('0x8f')){_0x4f8403[_0xb675('0x9a')]=_0x51ff4e[_0xb675('0x82')]>=parseInt(_0x48d402[_0xb675('0xf0')])?'x':'i';}else{_0x4f8403[_0xb675('0x9a')]=_0x51ff4e[_0xb675('0x82')]>=parseInt(_0x48d402[_0xb675('0xf0')])&&_0x51ff4e['length']<=parseInt(_0x48d402[_0xb675('0xed')])?'x':'i';}var _0xeffa0f=this['getVariable']['sync'](this,_0x48d402[_0xb675('0xb5')]);if(!_0xeffa0f){return this[_0xb675('0xd')]['error'](_0x48d402,_0xb675('0xb7'));}this[_0xb675('0xd')][_0xb675('0x86')](_0xeffa0f,_0x51ff4e);if(this[_0xb675('0x6a')](_0x48d402[_0xb675('0xf1')])){var _0x43b6de=parseInt(_0x48d402['hiddendigitsnum'],0xa);var _0x2b9fc2=rs[_0xb675('0xf2')]({'charset':'*','length':_0x43b6de});var _0x1a5fdb=_0x51ff4e[_0xb675('0x82')];if(_0x1a5fdb>0x0){if(_0x1a5fdb>_0x43b6de){this[_0xb675('0x3a')]['sync'](this,_0x48d402,_0x48d402[_0xb675('0xf3')]===_0xb675('0xf4')?_0x2b9fc2+_0x51ff4e[_0xb675('0xf5')](_0x43b6de):_0x51ff4e[_0xb675('0xf5')](0x0,_0x1a5fdb-_0x43b6de)+_0x2b9fc2);}else{this[_0xb675('0x3a')][_0xb675('0x88')](this,_0x48d402,rs[_0xb675('0xf2')]({'charset':'*','length':_0x1a5fdb}));}}else{this['createSquareDetailsReport'][_0xb675('0x88')](this,_0x48d402,'');}}else{this[_0xb675('0x3a')]['sync'](this,_0x48d402,_0x51ff4e);}return _0x4f8403;};AGIVertices['prototype'][_0xb675('0xc')]=function(_0x2bfafd){logger[_0xb675('0x30')](util['format'](_0xb675('0xf6'),_0x2bfafd[_0xb675('0x3c')]));return this['getdigits'](_0x2bfafd);};AGIVertices[_0xb675('0x10')][_0xb675('0xf7')]=function(_0x261129){logger[_0xb675('0x30')](util['format'](_0xb675('0xf8'),_0x261129[_0xb675('0x3c')]));this[_0xb675('0x3a')][_0xb675('0x88')](this,_0x261129,_0x261129[_0xb675('0xf9')]);return this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')]('GOAL\x20%s',_0x261129[_0xb675('0xf9')]));};AGIVertices['prototype'][_0xb675('0xfa')]=function(_0x457046){logger[_0xb675('0x30')](util[_0xb675('0x2a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x457046[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x457046['aws_access_key_id'])||!this['isConfigured'](_0x457046['aws_secret_access_key'])){return this[_0xb675('0xd')][_0xb675('0x95')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xb675('0x6a')](_0x457046[_0xb675('0x62')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xa1'));}this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0xfb'),_0x457046[_0xb675('0x62')]));var _0x5713c4=this[_0xb675('0x6c')][_0xb675('0x88')](this,_0x457046);if(_0x5713c4){this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0xfc'),_0x5713c4));var _0x5908a0=this[_0xb675('0xd')][_0xb675('0xdb')](_0x5713c4);try{fs['unlink'](_0x5713c4+'.wav');}catch(_0xaa1a2f){logger['error'](_0xaa1a2f);}return _0x5908a0;}return this['channel']['error'](_0x457046,_0xb675('0xfd'));};AGIVertices['prototype'][_0xb675('0xfe')]=function(_0x3f2e96){logger[_0xb675('0x30')](util['format'](_0xb675('0xff'),_0x3f2e96['label']));if(!this[_0xb675('0x6a')](_0x3f2e96[_0xb675('0x6d')])||!this[_0xb675('0x6a')](_0x3f2e96[_0xb675('0x6e')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0x100'));}if(!this[_0xb675('0x6a')](_0x3f2e96[_0xb675('0x75')])){return this[_0xb675('0xd')]['noop'](_0xb675('0x101'));}if(!this[_0xb675('0x6a')](_0x3f2e96[_0xb675('0x62')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xa1'));}this[_0xb675('0xd')][_0xb675('0xc8')]=!![];this[_0xb675('0x3a')](_0x3f2e96);this[_0xb675('0x47')](_0x3f2e96['text'],'in');this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x102'),_0x3f2e96[_0xb675('0x62')]));var _0x5a5ee=this[_0xb675('0x73')][_0xb675('0x88')](this,_0x3f2e96);if(_0x5a5ee){for(var _0x50b14c in _0x5a5ee){if(_0x5a5ee[_0xb675('0x7e')](_0x50b14c)&&_[_0xb675('0x7f')](_0x5a5ee[_0x50b14c])){this[_0xb675('0xd')][_0xb675('0x86')](util['format']('AWS_LEX_%s',_0x50b14c[_0xb675('0xcc')]()),_0x5a5ee[_0x50b14c]);}}if(_['isNil'](_0x5a5ee['message'])){return this[_0xb675('0xd')]['noop'](_0xb675('0x103'));}else{this[_0xb675('0x47')](_0x5a5ee[_0xb675('0x104')],_0xb675('0xce'));return this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x105'),_0x5a5ee[_0xb675('0x104')]));}}return this[_0xb675('0xd')][_0xb675('0x2e')](_0x3f2e96,_0xb675('0x106'));};AGIVertices[_0xb675('0x10')][_0xb675('0x107')]=function(_0x4c25dd){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x108'),_0x4c25dd[_0xb675('0x3c')],_0x4c25dd[_0xb675('0x8f')]));if(!this[_0xb675('0x6a')](_0x4c25dd[_0xb675('0x65')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xc7'));}var _0x407813=_0xb675('0x109');var _0x472244=util[_0xb675('0x2a')](_0xb675('0x10a'),FILES_PATH,rs[_0xb675('0xf2')](0x4));var _0x14413f=util['format'](_0xb675('0x10b'),_0x472244,_0x407813);var _0x451854=!![];if(_0x4c25dd[_0xb675('0x10c')]==='NOBEEP'){_0x451854=![];}var _0x32cb98=this[_0xb675('0xd')][_0xb675('0x10d')](_0x472244,_0x407813,_0x4c25dd[_0xb675('0x10e')],_0x4c25dd['timeout'],undefined,_0x451854);if(_0x32cb98[_0xb675('0x9a')]!==-0x1){this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x10f'),_0x14413f));var _0x260818=this['googleASR'][_0xb675('0x88')](this,_0x4c25dd,_0x14413f);if(_0x260818){for(var _0x1277e1 in _0x260818){if(_0x260818[_0xb675('0x7e')](_0x1277e1)){this[_0xb675('0xd')][_0xb675('0x86')](util[_0xb675('0x2a')](_0xb675('0x110'),_0x1277e1['toUpperCase']()),_0x260818[_0x1277e1]);}}return this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x260818)));}}return _0x32cb98;};AGIVertices[_0xb675('0x10')][_0xb675('0x111')]=function(_0x59915c){logger[_0xb675('0x30')](util['format'](_0xb675('0x112'),_0x59915c[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x59915c['appid'])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0x113'));}if(!this[_0xb675('0x6a')](_0x59915c[_0xb675('0x7a')])){return this['channel'][_0xb675('0x95')](_0xb675('0x114'));}var _0x3932cc='wav';var _0x17bcc1=util[_0xb675('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xb675('0xf2')](0x4));var _0x1568b5=util['format'](_0xb675('0x10b'),_0x17bcc1,_0x3932cc);var _0x16fdd9=!![];if(_0x59915c['beep']===_0xb675('0x115')){_0x16fdd9=![];}var _0x37b265=this[_0xb675('0xd')][_0xb675('0x10d')](_0x17bcc1,_0x3932cc,_0x59915c[_0xb675('0x10e')],_0x59915c[_0xb675('0x8f')],undefined,_0x16fdd9);if(_0x37b265[_0xb675('0x9a')]!==-0x1){this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x116'),_0x1568b5));var _0x4e1a14=this[_0xb675('0x78')][_0xb675('0x88')](this,_0x59915c,_0x1568b5);if(_0x4e1a14){for(var _0x198935 in _0x4e1a14){if(_0x4e1a14[_0xb675('0x7e')](_0x198935)){this[_0xb675('0xd')][_0xb675('0x86')](util[_0xb675('0x2a')]('TILDE_ASR_%s',_0x198935[_0xb675('0xcc')]()),_0x4e1a14[_0x198935]);}}return this[_0xb675('0xd')]['noop'](util[_0xb675('0x2a')]('TildeASR\x20Result\x20%s',JSON[_0xb675('0xef')](_0x4e1a14)));}}return _0x37b265;};AGIVertices[_0xb675('0x10')]['gotoc']=function(_0x137cfd){logger['info'](util['format'](_0xb675('0x117'),_0x137cfd[_0xb675('0x3c')]));return this[_0xb675('0xd')][_0xb675('0x118')](_0x137cfd['context'],_0x137cfd[_0xb675('0x119')],_0x137cfd['priority']);};AGIVertices['prototype'][_0xb675('0x11a')]=function(_0x4bc2b4){logger[_0xb675('0x30')](util['format'](_0xb675('0x11b'),_0x4bc2b4[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x4bc2b4[_0xb675('0x11c')])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x4bc2b4,_0xb675('0x11d'));}try{var _0x2f31d8=eval(_0x4bc2b4[_0xb675('0x11c')])?_0xb675('0x11e'):_0xb675('0x11f');this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x120'),_0x4bc2b4[_0xb675('0x11c')],_0x2f31d8));return{'code':0xc8,'result':_0x2f31d8};}catch(_0x223532){return{'code':0xc8,'result':_0xb675('0x11f')};}};AGIVertices['prototype']['gotoiftime']=function(_0xb12197){logger['info'](util[_0xb675('0x2a')](_0xb675('0x121'),_0xb12197[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0xb12197[_0xb675('0x122')])){return this['channel'][_0xb675('0x2e')](_0xb12197,_0xb675('0x123'));}var _0x3418df=this[_0xb675('0x124')][_0xb675('0x88')](this,_0xb12197[_0xb675('0x122')]);if(!_0x3418df){return this[_0xb675('0xd')][_0xb675('0x2e')](_0xb12197,'no\x20intervals\x20found');}for(var _0x23dfc8=0x0;_0x23dfc8<_0x3418df['length'];_0x23dfc8+=0x1){var _0x646759=this[_0xb675('0xd')][_0xb675('0x11')](util[_0xb675('0x2a')](_0xb675('0x125'),_0x3418df[_0x23dfc8]));if(_0x646759[_0xb675('0x9a')]===-0x1){return _0x646759;}logger['info'](util['format'](_0xb675('0x126'),_0x3418df[_0x23dfc8],_0x646759['extra']));if(_0x646759[_0xb675('0x83')]==='true'){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x126'),_0x3418df[_0x23dfc8],_0xb675('0x11e')));this[_0xb675('0xd')][_0xb675('0x95')](util['format'](_0xb675('0x126'),_0x3418df[_0x23dfc8],_0xb675('0x11e')));return{'code':0xc8,'result':_0xb675('0x11e')};}else{logger['info'](util['format'](_0xb675('0x126'),_0x3418df[_0x23dfc8],_0xb675('0x11f')));this['channel'][_0xb675('0x95')](util['format']('IFTIME\x20%s\x20%s',_0x3418df[_0x23dfc8],_0xb675('0x11f')));}}return{'code':0xc8,'result':_0xb675('0x11f')};};AGIVertices[_0xb675('0x10')][_0xb675('0x127')]=function(_0x297c52){logger[_0xb675('0x30')](util['format'](_0xb675('0x128'),_0x297c52['label']));return this['channel'][_0xb675('0x127')]();};AGIVertices[_0xb675('0x10')][_0xb675('0x129')]=function(_0x55a0b6){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x12a'),_0x55a0b6[_0xb675('0x3c')]));if(!this['isConfigured'](_0x55a0b6[_0xb675('0x65')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xc7'));}var _0x15beaf=_0xb675('0x109');var _0x2fda14=util[_0xb675('0x2a')](_0xb675('0x10a'),FILES_PATH,rs[_0xb675('0xf2')](0x4));var _0x3747a3=util[_0xb675('0x2a')](_0xb675('0x10b'),_0x2fda14,_0x15beaf);var _0x147514=!![];if(_0x55a0b6[_0xb675('0x10c')]===_0xb675('0x115')){_0x147514=![];}var _0xbfee37=this[_0xb675('0xd')][_0xb675('0x10d')](_0x2fda14,_0x15beaf,_0x55a0b6[_0xb675('0x10e')],_0x55a0b6['timeout'],undefined,_0x147514);if(_0xbfee37[_0xb675('0x9a')]!==-0x1){this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x12b'),_0x3747a3));var _0x43e08b=this['ispeechASR'][_0xb675('0x88')](this,_0x55a0b6,_0x3747a3);if(_0x43e08b){for(var _0x5f1604 in _0x43e08b){if(_0x43e08b[_0xb675('0x7e')](_0x5f1604)){this[_0xb675('0xd')][_0xb675('0x86')](util[_0xb675('0x2a')](_0xb675('0x12c'),_0x5f1604[_0xb675('0xcc')]()),_0x43e08b[_0x5f1604]);}}return this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x12d'),JSON[_0xb675('0xef')](_0x43e08b)));}}return _0xbfee37;};AGIVertices[_0xb675('0x10')][_0xb675('0x12e')]=function(_0xfab4cb){logger['info'](util['format'](_0xb675('0x12f'),_0xfab4cb[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0xfab4cb[_0xb675('0x65')])){return this['channel'][_0xb675('0x95')](_0xb675('0xc7'));}if(!this[_0xb675('0x6a')](_0xfab4cb[_0xb675('0x62')])){return this['channel']['noop'](_0xb675('0xa1'));}this[_0xb675('0xd')]['noop'](util[_0xb675('0x2a')]('Trying\x20ispeech\x20TTS\x20%s',_0xfab4cb['text']));var _0x4e8a93=this[_0xb675('0x64')][_0xb675('0x88')](this,_0xfab4cb);if(_0x4e8a93){this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x12b'),_0x4e8a93));var _0x13b675=this['channel']['streamFile'](_0x4e8a93,_0xfab4cb[_0xb675('0x10e')]);try{fs[_0xb675('0x130')](_0x4e8a93+'.wav');}catch(_0x107593){logger[_0xb675('0x2e')](_0x107593);}return _0x13b675;}return this[_0xb675('0xd')][_0xb675('0x2e')](_0xfab4cb,_0xb675('0x131'));};AGIVertices[_0xb675('0x10')][_0xb675('0x132')]=function(_0x53e317){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x133'),_0x53e317[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x53e317[_0xb675('0x134')])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x53e317,_0xb675('0x135'));}logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x136'),this['channel'][_0xb675('0x40')],_0x53e317[_0xb675('0x134')]));var _0xcb67e6=this[_0xb675('0x5a')]['sync'](this,_0x53e317['findBy']);if(_0xcb67e6){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x137'),this[_0xb675('0xd')][_0xb675('0x40')],_0x53e317[_0xb675('0x134')]));this[_0xb675('0xd')][_0xb675('0x95')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb675('0x40')],_0x53e317[_0xb675('0x134')]));return{'code':0xc8,'result':_0xb675('0x138')};}else{logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x139'),this[_0xb675('0xd')]['callerid'],_0x53e317['findBy']));this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x139'),this[_0xb675('0xd')][_0xb675('0x40')],_0x53e317[_0xb675('0x134')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xb675('0x10')][_0xb675('0x13a')]=function(_0x4023a8){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x13b'),_0x4023a8[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x4023a8['findBy'])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x4023a8,_0xb675('0x135'));}logger[_0xb675('0x30')](util[_0xb675('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xb675('0x40')],_0x4023a8[_0xb675('0x134')]));var _0x7f9f9b=this[_0xb675('0x59')][_0xb675('0x88')](this,_0x4023a8[_0xb675('0x134')]);if(_0x7f9f9b){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x137'),this[_0xb675('0xd')][_0xb675('0x40')],_0x4023a8[_0xb675('0x134')]));this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb675('0xd')]['callerid'],_0x4023a8[_0xb675('0x134')]));return{'code':0xc8,'result':_0xb675('0x138')};}else{logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x139'),this[_0xb675('0xd')][_0xb675('0x40')],_0x4023a8[_0xb675('0x134')]));this[_0xb675('0xd')]['noop'](util[_0xb675('0x2a')](_0xb675('0x139'),this[_0xb675('0xd')][_0xb675('0x40')],_0x4023a8[_0xb675('0x134')]));return{'code':0xc8,'result':_0xb675('0x13c')};}};AGIVertices['prototype'][_0xb675('0x13d')]=function(_0x4b0f70){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x13e'),_0x4b0f70['label']));if(!this[_0xb675('0x6a')](_0x4b0f70['operation'])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x4b0f70,_0xb675('0x13f'));}this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x140'),_0x4b0f70[_0xb675('0x141')]));var _0xedcbbd=eval(_0x4b0f70[_0xb675('0x141')]);if(!this[_0xb675('0x6a')](_0x4b0f70[_0xb675('0xb5')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xb6'));}var _0x3adeb8=this['getVariable']['sync'](this,_0x4b0f70[_0xb675('0xb5')]);if(!_0x3adeb8){return this['channel'][_0xb675('0x2e')](_0x4b0f70,'no\x20variable\x20found');}if(_['isArray'](_0xedcbbd)){var _0x3e9f0c=this;_0xedcbbd[_0xb675('0x142')](function(_0x17e3d8,_0x24adc0){_0x3e9f0c[_0xb675('0xd')][_0xb675('0x86')](util['format']('%s[%s]',_0x3adeb8,_0x24adc0),_0x17e3d8);});return this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x143'),_0x3adeb8));}else{return this[_0xb675('0xd')][_0xb675('0x86')](_0x3adeb8,_0xedcbbd);}};AGIVertices['prototype'][_0xb675('0xa')]=function(_0x3afab6){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x144'),_0x3afab6[_0xb675('0x3c')]));if(_0x3afab6[_0xb675('0x89')]===0x0){return this['maxRetry'](_0x3afab6);}_0x3afab6['retry']-=0x1;if(!this[_0xb675('0x6a')](_0x3afab6['file_id'])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x3afab6,_0xb675('0x145'));}var _0x1289d6=this[_0xb675('0x1f')][_0xb675('0x88')](this,_0x3afab6[_0xb675('0xe9')]);if(!_0x1289d6){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x3afab6,_0xb675('0xea'));}var _0x1a5a79=this[_0xb675('0xd')][_0xb675('0xeb')](_0x1289d6,_0x3afab6[_0xb675('0xec')],_0x3afab6[_0xb675('0x146')]);var _0x1d78b4=_0x1a5a79[_0xb675('0x9a')];if(_0x1a5a79[_0xb675('0x9a')]===-0x1){this[_0xb675('0x3a')][_0xb675('0x88')](this,_0x3afab6,'-1');return _0x1a5a79;}else if(_0x1a5a79['extra']===_0xb675('0x8f')){_0x1a5a79[_0xb675('0x9a')]=_0x1a5a79[_0xb675('0x9a')][_0xb675('0x82')]>0x0?_0x1a5a79[_0xb675('0x9a')]:'t';}else if(_[_0xb675('0x49')](_0x1a5a79[_0xb675('0x9a')])){_0x1a5a79[_0xb675('0x9a')]='#';_0x1d78b4='#';}if(!this[_0xb675('0x6a')](_0x3afab6[_0xb675('0xb5')])){this['channel'][_0xb675('0x95')](_0xb675('0xb6'));}else{var _0x57773a=this[_0xb675('0x11')]['sync'](this,_0x3afab6[_0xb675('0xb5')]);if(!_0x57773a){return this['channel']['error'](_0x3afab6,_0xb675('0xb7'));}this['channel']['setVariable'](_0x57773a,_0x1d78b4);}this[_0xb675('0x3a')][_0xb675('0x88')](this,_0x3afab6,_0x1d78b4);return _0x1a5a79;};AGIVertices[_0xb675('0x10')][_0xb675('0x95')]=function(_0x5e1924){logger[_0xb675('0x30')](util[_0xb675('0x2a')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5e1924[_0xb675('0x3c')]));return this[_0xb675('0xd')][_0xb675('0x95')](_0x5e1924[_0xb675('0x147')]||_0x5e1924['label']);};AGIVertices['prototype']['pause']=function(_0xa9c2bf){logger[_0xb675('0x30')](util['format'](_0xb675('0x148'),_0xa9c2bf[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0xa9c2bf[_0xb675('0x134')])){return this['channel'][_0xb675('0x2e')](_0xa9c2bf,'no\x20find\x20by\x20configured');}logger[_0xb675('0x30')](util[_0xb675('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb675('0xd')][_0xb675('0x40')],_0xa9c2bf[_0xb675('0x134')]));var _0xfc2899=this[_0xb675('0x54')]['sync'](this,_0xa9c2bf['pause_id']);var _0x4b6cd7=this['agentPause'][_0xb675('0x88')](this,_0xa9c2bf['findBy'],_0xfc2899);if(_0x4b6cd7){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x137'),this[_0xb675('0xd')][_0xb675('0x40')],_0xa9c2bf['findBy']));this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x137'),this[_0xb675('0xd')]['callerid'],_0xa9c2bf[_0xb675('0x134')]));return{'code':0xc8,'result':_0xb675('0x138')};}else{logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x139'),this[_0xb675('0xd')][_0xb675('0x40')],_0xa9c2bf[_0xb675('0x134')]));this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x137'),this[_0xb675('0xd')][_0xb675('0x40')],_0xa9c2bf[_0xb675('0x134')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xb675('0x10')]['playback']=function(_0x18ef1a){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x149'),_0x18ef1a[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x18ef1a[_0xb675('0xe9')])){return this['channel'][_0xb675('0x2e')](_0x18ef1a,_0xb675('0x145'));}var _0x75277e=this[_0xb675('0x1f')][_0xb675('0x88')](this,_0x18ef1a['file_id']);if(!_0x75277e){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x18ef1a,_0xb675('0xea'));}var _0xb13619=this[_0xb675('0xd')][_0xb675('0x5f')]('PLAYBACK',[_0x75277e,_0x18ef1a[_0xb675('0xc3')]]);if(_0xb13619['result']===-0x1){return _0xb13619;}return this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x9b'),_0xb675('0x14a'),_0x75277e));};AGIVertices['prototype'][_0xb675('0x14b')]=function(_0x359695){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x14c'),_0x359695[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x359695[_0xb675('0x14d')])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x359695,'no\x20queue\x20selected');}var _0x388468='';var _0x4bdb0d=parseInt(_0x359695[_0xb675('0x14d')],0xa);if(isNaN(_0x4bdb0d)){_0x388468=_0x359695[_0xb675('0x14d')];}else{_0x388468=this[_0xb675('0x14')][_0xb675('0x88')](this,_0x359695[_0xb675('0x14d')]);if(!_0x388468){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x359695,_0xb675('0x14e'));}}var _0x12ae4e='';if(this[_0xb675('0x6a')](_0x359695[_0xb675('0xe9')])){var _0x3608c4=this[_0xb675('0x1f')]['sync'](this,_0x359695[_0xb675('0xe9')]);if(_0x3608c4){_0x12ae4e=_0x3608c4;}}this[_0xb675('0x3a')]['sync'](this,_0x359695,_0x388468);if(_0x359695[_0xb675('0xc3')][_0xb675('0x14f')]('x')<0x0){_0x359695[_0xb675('0xc3')]+='x';}if(_0x359695[_0xb675('0xc3')]['indexOf']('X')<0x0){_0x359695[_0xb675('0xc3')]+='X';}this['channel'][_0xb675('0x86')](_0xb675('0x150'),_0x388468?_0x388468[_0xb675('0x151')]():'');var _0x53f8ce=this['channel']['exec'](_0xb675('0x152'),[_0x388468,_0x359695[_0xb675('0xc3')],_0x359695[_0xb675('0xc4')],_0x12ae4e,_0x359695[_0xb675('0x8f')],_0x359695[_0xb675('0x8')],_0x359695[_0xb675('0x153')],_0x359695[_0xb675('0x154')],'',_0x359695[_0xb675('0x155')]]);if(_0x53f8ce[_0xb675('0x9a')]===-0x1){return _0x53f8ce;}return this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x9b'),_0xb675('0x152'),_0x388468));};AGIVertices[_0xb675('0x10')]['record']=function(_0x580263){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x156'),_0x580263[_0xb675('0x3c')]));var _0x27a15d=_0x580263[_0xb675('0x157')]||_0xb675('0x109');var _0x11fb96=util[_0xb675('0x2a')](_0xb675('0x158'),this[_0xb675('0xd')][_0xb675('0x3b')],rs[_0xb675('0xf2')](0x5));var _0x4bb985=util[_0xb675('0x2a')](_0xb675('0x159'),FILES_PATH,_0x11fb96,_0x27a15d);var _0x83ca20=util[_0xb675('0x2a')](_0xb675('0x10a'),FILES_PATH,_0x11fb96);this[_0xb675('0x3f')][_0xb675('0x88')](this,_0x580263,_0x11fb96,_0x4bb985);this[_0xb675('0xd')][_0xb675('0x86')](_0xb675('0x15a'),_0x11fb96);logger[_0xb675('0x30')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x83ca20,_0x27a15d,_0x580263[_0xb675('0x15b')],_0x580263[_0xb675('0x8f')]);return this[_0xb675('0xd')][_0xb675('0x10d')](_0x83ca20,_0x27a15d,_0x580263[_0xb675('0x15b')],_0x580263[_0xb675('0x8f')],undefined,!![]);};AGIVertices['prototype'][_0xb675('0x15c')]=function(_0x51344f){logger[_0xb675('0x30')](util[_0xb675('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x51344f[_0xb675('0x3c')]));return this['channel'][_0xb675('0x15d')](_0x51344f['digits'][_0xb675('0xb3')](/\s+/g,''),_0x51344f[_0xb675('0x15b')]);};AGIVertices[_0xb675('0x10')][_0xb675('0x15e')]=function(_0x5e918b){logger[_0xb675('0x30')](util[_0xb675('0x2a')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x5e918b[_0xb675('0x3c')]));return this['channel'][_0xb675('0x15f')](_0x5e918b[_0xb675('0x160')]['replace'](/\s+/g,''),_0x5e918b[_0xb675('0x15b')]);};AGIVertices['prototype'][_0xb675('0x161')]=function(_0x1104ca){logger[_0xb675('0x30')](util[_0xb675('0x2a')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x1104ca[_0xb675('0x3c')]));return this[_0xb675('0xd')][_0xb675('0x162')](_0x1104ca[_0xb675('0x62')],_0x1104ca[_0xb675('0x15b')]);};AGIVertices[_0xb675('0x10')]['sendMail']=function(_0x4e623b){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x163'),_0x4e623b[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x4e623b[_0xb675('0x164')])){return this['channel'][_0xb675('0x95')](_0xb675('0x165'));}var _0x3f51e3=this[_0xb675('0x23')]['sync'](this,_0x4e623b[_0xb675('0x164')]);if(!_0x3f51e3||!_0x3f51e3['Smtp']){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x4e623b,'no\x20mail\x20account\x20found');}var _0x288e8f={'from':util[_0xb675('0x2a')](_0xb675('0x166'),_0x3f51e3[_0xb675('0x13')],_0x3f51e3[_0xb675('0x167')]||_0x3f51e3[_0xb675('0x168')]['user']),'to':_0x4e623b['to']||'','cc':_0x4e623b['cc']||'','bcc':_0x4e623b[_0xb675('0x169')]||'','subject':_0x4e623b[_0xb675('0x16a')],'html':_0x4e623b[_0xb675('0x62')],'text':_0x4e623b[_0xb675('0x62')]};var _0x18ca42={'tls':{'rejectUnauthorized':![]}};if(_0x3f51e3['Smtp'][_0xb675('0x16b')]){_0x18ca42['service']=_0x3f51e3[_0xb675('0x168')][_0xb675('0x16b')];}else{_0x18ca42[_0xb675('0x16c')]=_0x3f51e3[_0xb675('0x168')][_0xb675('0x16c')];_0x18ca42[_0xb675('0x16d')]=_0x3f51e3[_0xb675('0x168')]['port'];_0x18ca42[_0xb675('0x16e')]=_0x3f51e3['Smtp'][_0xb675('0x16e')];}if(_0x3f51e3[_0xb675('0x168')][_0xb675('0x16f')]){_0x18ca42[_0xb675('0x170')]={'user':_0x3f51e3[_0xb675('0x168')][_0xb675('0x171')],'pass':_0x3f51e3['Smtp'][_0xb675('0x172')]};}if(this[_0xb675('0x6a')](_0x4e623b[_0xb675('0x173')])){}logger['debug']('sendMail\x20message',JSON['stringify'](_0x288e8f));this['createSquareDetailsReport'][_0xb675('0x88')](this,_0x4e623b,_0x4e623b[_0xb675('0x164')]);this[_0xb675('0xd')][_0xb675('0x95')](util['format'](_0xb675('0x174'),_0x3f51e3[_0xb675('0x13')]));this[_0xb675('0x24')][_0xb675('0x88')](this,_0x18ca42,_0x288e8f);return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0x175'));};AGIVertices['prototype'][_0xb675('0x176')]=function(_0x488471){logger['info'](util['format'](_0xb675('0x177'),_0x488471[_0xb675('0x3c')]));return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0x178'));};AGIVertices[_0xb675('0x10')][_0xb675('0x179')]=function(_0x665977){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x17a'),_0x665977[_0xb675('0x3c')]));if(!this['isConfigured'](_0x665977[_0xb675('0x17b')])){return this[_0xb675('0xd')]['noop'](_0xb675('0x17c'));}var _0x3fae71=this[_0xb675('0x37')][_0xb675('0x88')](this,_0x665977['sms_account_id']);if(!_0x3fae71){return this['channel'][_0xb675('0x2e')](_0x665977,_0xb675('0x17d'));}var _0x26dc7e={'body':_0x665977['sms_text'],'phone':_0x665977['to']||'','SmsAccountId':_0x3fae71['id']};logger[_0xb675('0xbc')](_0xb675('0x17e'),JSON[_0xb675('0xef')](_0x26dc7e));this[_0xb675('0x3a')]['sync'](this,_0x665977,_0x665977[_0xb675('0x17b')]);this['channel'][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x17f'),_0x3fae71[_0xb675('0x13')]));this[_0xb675('0x39')][_0xb675('0x88')](this,_0x26dc7e);return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0x180'));};AGIVertices[_0xb675('0x10')][_0xb675('0x181')]=function(_0x2f01f0){logger[_0xb675('0x30')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x2f01f0[_0xb675('0x3c')]));if(!this[_0xb675('0x6a')](_0x2f01f0[_0xb675('0xb5')])){return this[_0xb675('0xd')]['error'](_0x2f01f0,'no\x20variable\x20selected');}var _0x5b8cb9=this[_0xb675('0x11')][_0xb675('0x88')](this,_0x2f01f0[_0xb675('0xb5')]);if(!_0x5b8cb9){return this['channel'][_0xb675('0x2e')](_0x2f01f0,_0xb675('0xb7'));}return this[_0xb675('0xd')][_0xb675('0x86')](_0x5b8cb9,_0x2f01f0[_0xb675('0x182')]);};AGIVertices[_0xb675('0x10')]['start']=function(_0x59d129){logger['info'](util[_0xb675('0x2a')](_0xb675('0x183'),_0x59d129[_0xb675('0x3c')]));this[_0xb675('0xd')][_0xb675('0x95')]('START\x20CALLY\x20SQUARE');if(_0x59d129[_0xb675('0x8c')]===_0xb675('0x184')){this[_0xb675('0xd')][_0xb675('0x95')]('Answer');return this[_0xb675('0xd')][_0xb675('0x8c')]();}return this['channel'][_0xb675('0x95')](_0xb675('0x185'));};AGIVertices[_0xb675('0x10')][_0xb675('0x186')]=function(_0x1b3f8e){logger[_0xb675('0x30')](util[_0xb675('0x2a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1b3f8e[_0xb675('0x3c')]));if(!this['isConfigured'](_0x1b3f8e[_0xb675('0x187')])){return this['channel'][_0xb675('0x2e')](_0x1b3f8e,'no\x20subproject\x20selected');}var _0x44f5c6=this[_0xb675('0x17')][_0xb675('0x88')](this,_0x1b3f8e[_0xb675('0x187')]);if(!this[_0xb675('0x6a')](_0x44f5c6)){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x1b3f8e,util[_0xb675('0x2a')](_0xb675('0x188'),_0x1b3f8e[_0xb675('0x187')]));}if(_0x44f5c6===this[_0xb675('0xd')][_0xb675('0x3e')]){return this['channel']['error'](_0x1b3f8e,_0xb675('0x189'));}this['createSquareDetailsReport'][_0xb675('0x88')](this,_0x1b3f8e,_0x44f5c6);var _0x4fd85d=this['channel'][_0xb675('0x5f')]('AGI',util[_0xb675('0x2a')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0xb675('0x16c')]||_0xb675('0x18a'),_0x44f5c6,this[_0xb675('0xd')][_0xb675('0x3e')]));if(_0x4fd85d[_0xb675('0x9a')]===-0x1){return _0x4fd85d;}return this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x9b'),_0xb675('0x18b'),_0x44f5c6));};AGIVertices[_0xb675('0x10')][_0xb675('0x18c')]=function(_0x4c002b){logger[_0xb675('0x30')](util['format'](_0xb675('0x18d'),_0x4c002b['label']));var _0x1bfc13=this[_0xb675('0x5e')][_0xb675('0x88')](this,_0x4c002b['command']);this[_0xb675('0x3a')][_0xb675('0x88')](this,_0x4c002b,_0x4c002b['command']);if(this[_0xb675('0x6a')](_0x4c002b[_0xb675('0xb5')])){var _0x12315a=this[_0xb675('0x11')]['sync'](this,_0x4c002b[_0xb675('0xb5')]);if(_0x12315a){this[_0xb675('0xd')][_0xb675('0x86')](_0x12315a,_0x1bfc13);return this[_0xb675('0xd')][_0xb675('0x95')](util['format'](_0xb675('0x18e'),_0x4c002b[_0xb675('0x8a')],_0x12315a));}}return this[_0xb675('0xd')]['noop'](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4c002b[_0xb675('0x8a')]));};AGIVertices[_0xb675('0x10')][_0xb675('0x18f')]=function(_0x2557ac){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x190'),_0x2557ac['label']));if(!this[_0xb675('0x6a')](_0x2557ac[_0xb675('0x62')])){return this[_0xb675('0xd')][_0xb675('0x95')](_0xb675('0xa1'));}this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')]('Trying\x20Google\x20TTS\x20%s',_0x2557ac[_0xb675('0x62')]));var _0x2e1323=this[_0xb675('0x61')][_0xb675('0x88')](this,_0x2557ac);if(_0x2e1323){this[_0xb675('0xd')][_0xb675('0x95')](util['format'](_0xb675('0x191'),_0x2e1323));var _0x4944c2=this[_0xb675('0xd')][_0xb675('0xdb')](_0x2e1323);try{fs[_0xb675('0x130')](_0x2e1323+_0xb675('0xdc'));}catch(_0x2fc21a){logger[_0xb675('0x2e')](_0x2fc21a);}return _0x4944c2;}return this[_0xb675('0xd')][_0xb675('0x2e')](_0x2557ac,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xb675('0x10')][_0xb675('0x192')]=function(_0x1a482b){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x193'),_0x1a482b['label']));if(!this['isConfigured'](_0x1a482b['findBy'])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x1a482b,'no\x20find\x20by\x20configured');}logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x136'),this[_0xb675('0xd')]['callerid'],_0x1a482b[_0xb675('0x134')]));var _0x934697=this['agentUnpause'][_0xb675('0x88')](this,_0x1a482b[_0xb675('0x134')]);if(_0x934697){logger['info'](util['format'](_0xb675('0x137'),this[_0xb675('0xd')]['callerid'],_0x1a482b[_0xb675('0x134')]));this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x137'),this[_0xb675('0xd')]['callerid'],_0x1a482b[_0xb675('0x134')]));return{'code':0xc8,'result':_0xb675('0x138')};}else{logger['info'](util['format'](_0xb675('0x139'),this[_0xb675('0xd')]['callerid'],_0x1a482b[_0xb675('0x134')]));this[_0xb675('0xd')][_0xb675('0x95')](util[_0xb675('0x2a')](_0xb675('0x139'),this['channel']['callerid'],_0x1a482b[_0xb675('0x134')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xb675('0x10')][_0xb675('0x194')]=function(_0x1d96cc){logger[_0xb675('0x30')](util[_0xb675('0x2a')](_0xb675('0x195'),_0x1d96cc[_0xb675('0x3c')]));var _0x178361=this[_0xb675('0xd')][_0xb675('0x5f')](_0xb675('0x196'),[_0x1d96cc['mailbox'],_0x1d96cc[_0xb675('0x99')]]);if(_0x178361['result']===-0x1){return _0x178361;}return this['channel']['noop'](util[_0xb675('0x2a')](_0xb675('0x9b'),_0xb675('0x196'),_0x1d96cc[_0xb675('0x197')]));};AGIVertices[_0xb675('0x10')][_0xb675('0x198')]=function(_0x40c1fc){logger[_0xb675('0x30')](util[_0xb675('0x2a')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x40c1fc[_0xb675('0x3c')]));if(!this['isConfigured'](_0x40c1fc['variable_id'])){return this[_0xb675('0xd')][_0xb675('0x2e')](_0x40c1fc,_0xb675('0x199'));}var _0x3f535=this['getVariable'][_0xb675('0x88')](this,_0x40c1fc[_0xb675('0xb5')]);if(!_0x3f535){return this['channel']['error'](_0x40c1fc,_0xb675('0xb7'));}var _0x2bd8d2=this[_0xb675('0xd')][_0xb675('0x11')](_0x3f535);return{'code':0xc8,'result':_0x2bd8d2[_0xb675('0x83')]?_0x2bd8d2[_0xb675('0x83')]:'-'};};String[_0xb675('0x10')][_0xb675('0x19a')]=function(_0x54696e,_0x4eae52){return this[_0xb675('0x81')](_0x54696e)['join'](_0x4eae52);};module[_0xb675('0x19b')]=AGIVertices; \ No newline at end of file +var _0x6ea2=['Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','googleTTS','text','google_tts_language','googleDialogflow','dialogflow_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','clear','includes','clone','hasOwnProperty','isString','length','split','replaceAll','extra','replaceAllVariables','getAndSetVariable','result','setVariable','sync','retry','maxRetry','format','Enter\x20in\x20AGI\x20(%s)\x20block','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','timeout','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','scheduledAt','add','minutes','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','createSquareDetailsReport','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','toUpperCase','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','DIAL','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','response','maxdigit','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','TildeASR\x20Result\x20%s','stringify','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','authentication','auth','sendMail\x20message','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query'];(function(_0xc4f70e,_0x368b9a){var _0x2d5c55=function(_0x3b7e32){while(--_0x3b7e32){_0xc4f70e['push'](_0xc4f70e['shift']());}};_0x2d5c55(++_0x368b9a);}(_0x6ea2,0x160));var _0x26ea=function(_0x93b3ec,_0x3c2221){_0x93b3ec=_0x93b3ec-0x0;var _0x5bfda7=_0x6ea2[_0x93b3ec];return _0x5bfda7;};'use strict';var fs=require('fs');var path=require(_0x26ea('0x0'));var util=require(_0x26ea('0x1'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x26ea('0x2'))();var rs=require(_0x26ea('0x3'));var moment=require(_0x26ea('0x4'));var Mustache=require(_0x26ea('0x5'));var logger=require(_0x26ea('0x6'))(_0x26ea('0x7'));var config=require(_0x26ea('0x8'));var scripts=require(_0x26ea('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=['menu',_0x26ea('0xa'),_0x26ea('0xb')];var AGIVertices=function(_0x26bd0d,_0x50f228,_0x3c1297){this[_0x26ea('0xc')]=_0x26bd0d;this[_0x26ea('0xd')]=_0x50f228;this[_0x26ea('0xe')]=_0x3c1297;};AGIVertices[_0x26ea('0xf')][_0x26ea('0x10')]=function(_0x56d5c0,_0x541a89){this[_0x26ea('0xd')][_0x26ea('0x11')](_0x56d5c0)[_0x26ea('0x12')](function(_0x5cd079){_0x541a89(null,_0x5cd079?_0x5cd079[_0x26ea('0x13')]:![]);})[_0x26ea('0x14')](function(_0x11180c){_0x541a89(_0x11180c);});};AGIVertices[_0x26ea('0xf')]['getVoiceQueue']=function(_0x389ffe,_0x9ed9e4){this['rpc'][_0x26ea('0x15')](_0x389ffe)[_0x26ea('0x12')](function(_0x5a95a1){_0x9ed9e4(null,_0x5a95a1?_0x5a95a1[_0x26ea('0x13')]:![]);})[_0x26ea('0x14')](function(_0x494a88){_0x9ed9e4(_0x494a88);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x16')]=function(_0x493ea3,_0x5cfc16){this[_0x26ea('0xd')][_0x26ea('0x17')](_0x493ea3)['then'](function(_0x34bc4f){_0x5cfc16(null,_0x34bc4f?_0x34bc4f[_0x26ea('0x13')]:![]);})[_0x26ea('0x14')](function(_0x5f6008){_0x5cfc16(_0x5f6008);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x18')]=function(_0x5d1691,_0x44854e){this['rpc'][_0x26ea('0x19')](_0x5d1691)['then'](function(_0x258eff){_0x44854e(null,_0x258eff?_0x258eff[_0x26ea('0x1a')]:![]);})[_0x26ea('0x14')](function(_0x26f3b4){_0x44854e(_0x26f3b4);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x1b')]=function(_0x4b7687,_0x4c5fe3){this[_0x26ea('0xd')][_0x26ea('0x1c')](_0x4b7687)['then'](function(_0x52551b){_0x4c5fe3(null,_0x52551b?_0x52551b[_0x26ea('0x13')]:![]);})['catch'](function(_0x3cbcb3){_0x4c5fe3(_0x3cbcb3);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x1d')]=function(_0x1cb658,_0x9569d8){this['rpc']['getTrunkById'](_0x1cb658)[_0x26ea('0x12')](function(_0x3f381e){_0x9569d8(null,_0x3f381e?_0x3f381e[_0x26ea('0x13')]:![]);})[_0x26ea('0x14')](function(_0x1da7c8){_0x9569d8(_0x1da7c8);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x1e')]=function(_0x816dbb,_0x1a15f2){var _0x9c68af=this;this['rpc']['getSoundById'](_0x816dbb)['then'](function(_0x49b7bf){_0x1a15f2(null,_0x49b7bf?_0x9c68af[_0x26ea('0x1f')](_0x49b7bf[_0x26ea('0x20')]):![]);})[_0x26ea('0x14')](function(_0x158179){_0x1a15f2(_0x158179);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x21')]=function(_0x3a7ca6,_0x212ee7){this['rpc'][_0x26ea('0x22')](_0x3a7ca6)[_0x26ea('0x12')](function(_0x24d995){_0x212ee7(null,_0x24d995?_0x24d995:![]);})[_0x26ea('0x14')](function(_0x5dbb26){_0x212ee7(_0x5dbb26);});};AGIVertices[_0x26ea('0xf')]['sendMailMessage']=function(_0x4c4eb1,_0x54933e,_0x5d2adc){this[_0x26ea('0xe')][_0x26ea('0x23')](_0x4c4eb1,_0x54933e)[_0x26ea('0x12')](function(){_0x5d2adc(null);})[_0x26ea('0x14')](function(_0x3b7cb1){_0x5d2adc(_0x3b7cb1);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x24')]=function(_0x303c59,_0x433f65){this['rpc'][_0x26ea('0x25')](_0x303c59)[_0x26ea('0x12')](function(_0x476ef2){if(_0x476ef2){if(_0x476ef2[_0x26ea('0x26')]){_0x433f65(null,[_0x476ef2[_0x26ea('0x27')]]);}else{_0x433f65(null,_[_0x26ea('0x28')](_0x476ef2[_0x26ea('0x29')],_0x26ea('0x27')));}}else{_0x433f65(null,![]);}})[_0x26ea('0x14')](function(_0x22302c){_0x433f65(_0x22302c);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x1f')]=function(_0x25223d){return util['format'](_0x26ea('0x2a'),FILES_PATH,_0x25223d);};AGIVertices[_0x26ea('0xf')][_0x26ea('0x2b')]=function(_0x32fc80,_0x3c0b9a,_0x5daa68){odbc[_0x26ea('0x2c')](_0x32fc80,function(_0x5d1da2){if(_0x5d1da2){logger[_0x26ea('0x2d')](_0x26ea('0x2e'),_0x5d1da2);_0x5daa68(_0x5d1da2);}else{logger[_0x26ea('0x2f')](_0x26ea('0x30'));odbc[_0x26ea('0x31')](_0x3c0b9a,function(_0x1fb4cd,_0x1cd15d){if(_0x1fb4cd){logger[_0x26ea('0x2f')](_0x26ea('0x32'),_0x3c0b9a);_0x5daa68(_0x1fb4cd);}else{logger[_0x26ea('0x2f')](_0x26ea('0x33'),_0x3c0b9a);odbc['close'](function(_0x23d599){if(_0x23d599){logger[_0x26ea('0x2d')](_0x26ea('0x34'),_0x23d599);}_0x5daa68(null,_0x1cd15d);});}});}});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x35')]=function(_0x1a27ea,_0x5d8cdc){this[_0x26ea('0xd')]['getSmsAccountById'](_0x1a27ea)[_0x26ea('0x12')](function(_0x40489a){_0x5d8cdc(null,_0x40489a?_0x40489a:![]);})[_0x26ea('0x14')](function(_0x3172fd){_0x5d8cdc(_0x3172fd);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x36')]=function(_0x35be49,_0xdd64b3){this[_0x26ea('0xd')][_0x26ea('0x36')](_0x35be49)[_0x26ea('0x12')](function(_0x1d1ce0){_0xdd64b3(null,_0x1d1ce0);})['catch'](function(_0x3c0bc9){_0xdd64b3(_0x3c0bc9);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x3a6ce4,_0x556fcd,_0x50f59d){this['rpc']['createSquareDetailsReport']({'uniqueid':this['channel']['uniqueid'],'node':_0x3a6ce4[_0x26ea('0x37')],'application':_0x3a6ce4[_0x26ea('0x38')],'data':_0x556fcd||null,'project_name':this[_0x26ea('0xc')][_0x26ea('0x39')],'callerid':this[_0x26ea('0xc')]['callerid']})[_0x26ea('0x12')](function(_0x1865ac){if(_0x50f59d){_0x50f59d(null,_0x1865ac);}})[_0x26ea('0x14')](function(_0x518b48){if(_0x50f59d){_0x50f59d(_0x518b48);}});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x3a')]=function(_0x1847c5,_0x44f535,_0x37e6f3,_0x2cfd3c){this['rpc'][_0x26ea('0x3a')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x26ea('0xc')][_0x26ea('0x3b')],'calleridname':this[_0x26ea('0xc')][_0x26ea('0x3c')],'context':this[_0x26ea('0xc')][_0x26ea('0x3d')],'extension':this[_0x26ea('0xc')][_0x26ea('0x3e')],'priority':this['channel'][_0x26ea('0x3f')],'accountcode':this[_0x26ea('0xc')]['accountcode'],'dnid':this[_0x26ea('0xc')][_0x26ea('0x40')],'projectName':this[_0x26ea('0xc')][_0x26ea('0x39')],'saveName':_0x44f535,'filename':_0x1847c5[_0x26ea('0x41')]||_0x44f535,'savePath':_0x37e6f3})[_0x26ea('0x12')](function(_0x38aa83){_0x2cfd3c(null,_0x38aa83);})[_0x26ea('0x14')](function(_0x26c23a){_0x2cfd3c(_0x26c23a);});};AGIVertices['prototype'][_0x26ea('0x42')]=function(_0x586d97,_0x43fbae,_0x4670d4){this[_0x26ea('0xd')]['createSquareMessage']({'uniqueid':this[_0x26ea('0xc')][_0x26ea('0x43')],'body':_0x586d97,'direction':_0x43fbae})['then'](function(_0x41e40d){if(_0x4670d4){_0x4670d4(null,_0x41e40d);}})['catch'](function(_0x146587){if(_0x4670d4){_0x4670d4(_0x146587);}});};AGIVertices['prototype'][_0x26ea('0x44')]=function(_0x1f56c3,_0x39cc90){this['rpc'][_0x26ea('0x44')]({'firstName':_[_0x26ea('0x45')](_0x1f56c3[_0x26ea('0x13')])||_['isNil'](_0x1f56c3['name'])?'callback_'+Math['random']():_0x1f56c3[_0x26ea('0x13')],'lastName':_[_0x26ea('0x45')](_0x1f56c3[_0x26ea('0x46')])||_[_0x26ea('0x47')](_0x1f56c3[_0x26ea('0x46')])?null:_0x1f56c3[_0x26ea('0x46')],'phone':_0x1f56c3[_0x26ea('0x48')],'ListId':_0x1f56c3[_0x26ea('0x49')],'scheduledAt':_0x1f56c3['scheduledAt'],'callbackUniqueid':this['channel'][_0x26ea('0x43')],'tags':_0x26ea('0x4a'),'description':_0x26ea('0x4b')+_0x1f56c3['scheduledAt'][_0x26ea('0x4c')](),'priority':_0x1f56c3['callback_priority']})[_0x26ea('0x12')](function(_0x46a1b9){_0x39cc90(null,_0x46a1b9);})['catch'](function(_0x1b3841){_0x39cc90(_0x1b3841);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x4d')]=function(_0x37765a,_0x8daf68){this[_0x26ea('0xd')][_0x26ea('0x4e')](_0x37765a)[_0x26ea('0x12')](function(_0x12ae5e){_0x8daf68(null,_0x12ae5e?_0x12ae5e['name']:![]);})[_0x26ea('0x14')](function(_0x5e256d){_0x8daf68(_0x5e256d);});};AGIVertices[_0x26ea('0xf')]['agentPause']=function(_0x42810a,_0x11fad2,_0x9ffe4b){var _0x23bdf1={'role':_0x26ea('0x4f')};_0x23bdf1[_0x42810a]=this['channel'][_0x26ea('0x3b')];this[_0x26ea('0xd')]['agentPause'](_0x23bdf1,_0x11fad2,this['channel'][_0x26ea('0x43')])[_0x26ea('0x12')](function(_0x296703){_0x9ffe4b(null,_[_0x26ea('0x47')](_0x296703)?![]:!![]);})[_0x26ea('0x14')](function(_0x480372){logger[_0x26ea('0x2d')](_0x480372);_0x9ffe4b(null,![]);});};AGIVertices['prototype'][_0x26ea('0x50')]=function(_0x8bb68e,_0x17ad1e){var _0x3f8a9f={'role':_0x26ea('0x4f')};_0x3f8a9f[_0x8bb68e]=this[_0x26ea('0xc')][_0x26ea('0x3b')];this[_0x26ea('0xd')][_0x26ea('0x50')](_0x3f8a9f)[_0x26ea('0x12')](function(_0xc83a48){_0x17ad1e(null,_[_0x26ea('0x47')](_0xc83a48)?![]:!![]);})[_0x26ea('0x14')](function(_0x6563df){logger['error'](_0x6563df);_0x17ad1e(null,![]);});};AGIVertices[_0x26ea('0xf')]['agentLogout']=function(_0x15139c,_0x2b1f59){var _0x53f439={'role':_0x26ea('0x4f')};_0x53f439[_0x15139c]=this[_0x26ea('0xc')][_0x26ea('0x3b')];this['rpc'][_0x26ea('0x51')](_0x53f439)[_0x26ea('0x12')](function(_0x329c24){_0x2b1f59(null,_[_0x26ea('0x47')](_0x329c24)?![]:!![]);})[_0x26ea('0x14')](function(_0x34532c){logger[_0x26ea('0x2d')](_0x34532c);_0x2b1f59(null,![]);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x52')]=function(_0x344229,_0x1ef4bf){var _0x74ea27={'role':_0x26ea('0x4f')};_0x74ea27[_0x344229]=this['channel']['callerid'];var _0x1fc7b9=_0x344229!=_0x26ea('0x53')?util['format'](_0x26ea('0x54'),'LOCAL',this[_0x26ea('0xc')]['callerid']):undefined;this[_0x26ea('0xd')][_0x26ea('0x52')](_0x74ea27,_0x1fc7b9)[_0x26ea('0x12')](function(_0x376b36){_0x1ef4bf(null,_[_0x26ea('0x47')](_0x376b36)?![]:!![]);})[_0x26ea('0x14')](function(_0x53632d){logger[_0x26ea('0x2d')](_0x53632d);_0x1ef4bf(null,![]);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x55')]=function(_0x444604,_0x2b33fe){sh[_0x26ea('0x56')](_[_0x26ea('0x57')](_0x444604),function(_0x4fa0fc,_0x31abcc){var _0x49e280=_0x31abcc['replace'](/(\r\n|\n|\r)/gm,'');_0x2b33fe(null,_0x49e280);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x58')]=function(_0x19702a,_0x3d19b1){scripts[_0x26ea('0x58')](_0x19702a[_0x26ea('0x59')],_0x19702a[_0x26ea('0x5a')]||'en',0x1)[_0x26ea('0x12')](function(_0x17412e){_0x3d19b1(null,_0x17412e);})[_0x26ea('0x14')](function(_0x38a273){_0x3d19b1(_0x38a273);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x5b')]=function(_0xa5096d,_0x2ef5ef){scripts[_0x26ea('0x5b')](this[_0x26ea('0xc')][_0x26ea('0x43')],_0xa5096d['key'],_0xa5096d[_0x26ea('0x59')],_0xa5096d[_0x26ea('0x5c')]||'en')[_0x26ea('0x12')](function(_0x338dfd){_0x2ef5ef(null,_0x338dfd);})[_0x26ea('0x14')](function(_0x1d1a1a){_0x2ef5ef(_0x1d1a1a);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x5d')]=function(_0x2b945d,_0x24d18e){scripts[_0x26ea('0x5d')](this[_0x26ea('0xc')],_0x2b945d)[_0x26ea('0x12')](function(_0x305bb0){_0x24d18e(null,_0x305bb0);})['catch'](function(_0x586df4){_0x24d18e(_0x586df4);});};AGIVertices[_0x26ea('0xf')]['ispeechTTS']=function(_0x412fa3,_0x4d142e){scripts[_0x26ea('0x5e')](_0x412fa3[_0x26ea('0x5f')],_0x412fa3[_0x26ea('0x59')],_0x412fa3[_0x26ea('0x60')]||_0x26ea('0x61'),_0x412fa3[_0x26ea('0x62')])[_0x26ea('0x12')](function(_0x51ca2c){_0x4d142e(null,_0x51ca2c);})['catch'](function(_0x3cec5c){_0x4d142e(_0x3cec5c);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x63')]=function(_0xe8277e,_0x339002,_0xd34c24){scripts[_0x26ea('0x63')](_0x339002,_0xe8277e['key'],_0xe8277e[_0x26ea('0x64')]||_0x26ea('0x61'),this[_0x26ea('0x65')](_0xe8277e[_0x26ea('0x66')])?_0xe8277e[_0x26ea('0x66')]:undefined)[_0x26ea('0x12')](function(_0x411cbb){_0xd34c24(null,_0x411cbb);})[_0x26ea('0x14')](function(_0x20ed5c){_0xd34c24(_0x20ed5c);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x67')]=function(_0x39ba30,_0x5c343c){scripts['awsPolly'](_0x39ba30[_0x26ea('0x68')],_0x39ba30[_0x26ea('0x69')],_0x39ba30[_0x26ea('0x6a')],_0x39ba30['aws_polly_voice']||_0x26ea('0x6b'),_0x39ba30[_0x26ea('0x59')],_0x39ba30[_0x26ea('0x6c')]||_0x26ea('0x59'))[_0x26ea('0x12')](function(_0x2a09fb){_0x5c343c(null,_0x2a09fb);})[_0x26ea('0x14')](function(_0x28ce38){_0x5c343c(_0x28ce38);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x6d')]=function(_0x55ff8b,_0x3794c1){scripts[_0x26ea('0x6d')](this[_0x26ea('0xc')][_0x26ea('0x43')],_0x55ff8b[_0x26ea('0x68')],_0x55ff8b[_0x26ea('0x69')],_0x55ff8b[_0x26ea('0x6e')],_0x55ff8b[_0x26ea('0x59')],_0x55ff8b['aws_bot_name'])[_0x26ea('0x12')](function(_0x58bcaf){_0x3794c1(null,_0x58bcaf);})[_0x26ea('0x14')](function(_0xfa5a96){_0x3794c1(_0xfa5a96);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x6f')]=function(_0x58b24b,_0x59ad73,_0x2e811c){scripts[_0x26ea('0x6f')](_0x59ad73,_0x58b24b[_0x26ea('0x5f')],_0x58b24b[_0x26ea('0x70')]||'en-US')[_0x26ea('0x12')](function(_0x55e33e){_0x2e811c(null,_0x55e33e);})['catch'](function(_0x42d96f){_0x2e811c(_0x42d96f);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x71')]=function(_0x5e36ea,_0x237201,_0x432ba2){scripts[_0x26ea('0x71')](_0x237201,_0x5e36ea['appid'],_0x5e36ea['appsecret'],_0x5e36ea['uri'])[_0x26ea('0x12')](function(_0x2e075f){_0x432ba2(null,_0x2e075f);})[_0x26ea('0x14')](function(_0x3eef47){_0x432ba2(_0x3eef47);});};AGIVertices[_0x26ea('0xf')][_0x26ea('0x72')]=function(_0x44d078){var _0x31f88f=_[_0x26ea('0x73')](verticesWithRetry,_0x44d078[_0x26ea('0x38')])?_0x44d078:_[_0x26ea('0x74')](_0x44d078);for(var _0x4444f4 in _0x31f88f){if(_0x31f88f[_0x26ea('0x75')](_0x4444f4)){if(_0x31f88f[_0x4444f4]&&_[_0x26ea('0x76')](_0x31f88f[_0x4444f4])){_0x31f88f[_0x4444f4]=this['replaceAllVariables'](_0x31f88f[_0x4444f4]);}}}return _0x31f88f;};AGIVertices[_0x26ea('0xf')]['replaceAllVariables']=function(_0x3d28dc){var _0x2b1128=_0x3d28dc['split']('{');for(var _0x4bc44b=0x1;_0x4bc44b<_0x2b1128[_0x26ea('0x77')];_0x4bc44b+=0x1){var _0x380b53=_0x2b1128[_0x4bc44b][_0x26ea('0x78')]('}');if(_0x380b53['length']>0x1){_0x3d28dc=_0x3d28dc[_0x26ea('0x79')]('{'+_0x380b53[0x0]+'}',this[_0x26ea('0xc')][_0x26ea('0x10')](_0x380b53[0x0])[_0x26ea('0x7a')]||_0x380b53[0x0]);}}if(_0x2b1128['length']===0x1){return _0x3d28dc[_0x26ea('0x4c')]();}return this[_0x26ea('0x7b')](_0x3d28dc);};AGIVertices[_0x26ea('0xf')][_0x26ea('0x7c')]=function(_0x3a3660,_0x37f02b){var _0x40b125=this[_0x26ea('0xc')][_0x26ea('0x10')](_0x3a3660);if(_0x40b125[_0x26ea('0x7d')]===-0x1){return _0x40b125;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x37f02b,_0x40b125[_0x26ea('0x7a')]));return this[_0x26ea('0xc')][_0x26ea('0x7e')](_0x37f02b,_0x40b125[_0x26ea('0x7a')]);};AGIVertices[_0x26ea('0xf')][_0x26ea('0x65')]=function(_0x41d49d){return _0x41d49d&&_0x41d49d!=='0'&&_0x41d49d!=='-1'&&_0x41d49d!=='';};AGIVertices[_0x26ea('0xf')]['maxRetry']=function(_0x38a9fe){this['createSquareDetailsReport'][_0x26ea('0x7f')](this,_0x38a9fe,'-');_0x38a9fe[_0x26ea('0x80')]=_0x38a9fe[_0x26ea('0x81')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x26ea('0xf')][_0x26ea('0x7')]=function(_0x53ff83){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x83'),_0x53ff83['label']));return this[_0x26ea('0xc')][_0x26ea('0x7')]([_0x53ff83[_0x26ea('0x84')],_0x53ff83['args']]);};AGIVertices[_0x26ea('0xf')]['answer']=function(_0x1c7b48){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x85'),_0x1c7b48['label']));if(this['isConfigured'](_0x1c7b48['timeout'])){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x86'),_0x1c7b48[_0x26ea('0x87')]));var _0x4d2792=this['channel'][_0x26ea('0x88')](_0x1c7b48[_0x26ea('0x87')]);if(_0x4d2792['result']===-0x1){return _0x4d2792;}}return this[_0x26ea('0xc')][_0x26ea('0x89')]();};AGIVertices[_0x26ea('0xf')][_0x26ea('0x4a')]=function(_0x2ca0f7){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x8a'),_0x2ca0f7['label']));if(!this['isConfigured'](_0x2ca0f7[_0x26ea('0x49')])){return this[_0x26ea('0xc')]['error'](_0x2ca0f7,'no\x20list\x20selected');}_0x2ca0f7['scheduledAt']=moment();if(this[_0x26ea('0x65')](_0x2ca0f7[_0x26ea('0x8b')])){_0x2ca0f7[_0x26ea('0x8c')]=moment()[_0x26ea('0x8d')](_0x2ca0f7['delay'],_0x26ea('0x8e'));}if(!this[_0x26ea('0x65')](_0x2ca0f7['callback_priority'])){_0x2ca0f7[_0x26ea('0x8f')]=0x2;}this[_0x26ea('0x44')][_0x26ea('0x7f')](this,_0x2ca0f7);return this['channel'][_0x26ea('0x90')](util['format'](_0x26ea('0x91'),_0x2ca0f7[_0x26ea('0x48')],_0x2ca0f7[_0x26ea('0x49')],_0x2ca0f7[_0x26ea('0x8c')]));};AGIVertices[_0x26ea('0xf')][_0x26ea('0x92')]=function(_0x23eee3){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x93'),_0x23eee3[_0x26ea('0x37')]));var _0x171fe3=this['channel'][_0x26ea('0x56')](_0x23eee3[_0x26ea('0x94')],_0x23eee3[_0x26ea('0x95')]);if(_0x171fe3[_0x26ea('0x7d')]===-0x1){return _0x171fe3;}return this['channel']['noop'](util[_0x26ea('0x82')](_0x26ea('0x96'),_0x23eee3[_0x26ea('0x94')],_0x23eee3[_0x26ea('0x95')]));};AGIVertices[_0x26ea('0xf')][_0x26ea('0x97')]=function(_0x44a120){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x98'),_0x44a120[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x44a120[_0x26ea('0x59')])){return this[_0x26ea('0xc')]['noop'](_0x26ea('0x99'));}var _0x3fc2d5='\x22'+_0x44a120[_0x26ea('0x59')]+'\x22';if(this[_0x26ea('0x65')](_0x44a120['options'])){_0x3fc2d5+=','+_0x44a120[_0x26ea('0x95')];}var _0x4aa0f2=this[_0x26ea('0xc')]['exec'](_0x26ea('0x9a'),_0x3fc2d5);if(_0x4aa0f2[_0x26ea('0x7d')]===-0x1){return _0x4aa0f2;}return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x9b'),_0x3fc2d5));};AGIVertices[_0x26ea('0xf')][_0x26ea('0x9c')]=function(_0x13ef91){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x13ef91[_0x26ea('0x37')]));if(!this['isConfigured'](_0x13ef91[_0x26ea('0x59')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x535e76='\x22'+_0x13ef91['text']+'\x22';if(this[_0x26ea('0x65')](_0x13ef91['options'])){_0x535e76+=','+_0x13ef91[_0x26ea('0x95')];}var _0x3a353c=this[_0x26ea('0xc')][_0x26ea('0x56')](_0x26ea('0x9a'),_0x535e76);if(_0x3a353c[_0x26ea('0x7d')]===-0x1){return _0x3a353c;}return this['channel'][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x9b'),_0x535e76));};AGIVertices[_0x26ea('0xf')][_0x26ea('0x9d')]=function(_0xcf14b7){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x9e'),_0xcf14b7[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0xcf14b7[_0x26ea('0x9f')])){return this['channel'][_0x26ea('0x90')](_0x26ea('0xa0'));}var _0x164054=_0xcf14b7[_0x26ea('0x9f')];if(this['isConfigured'](_0xcf14b7[_0x26ea('0x95')])){_0x164054+=','+_0xcf14b7['options'];}var _0x185619=this['channel'][_0x26ea('0x56')]('MRCPRecog',_0x164054);if(_0x185619[_0x26ea('0x7d')]===-0x1){return _0x185619;}var _0x23661c=this['getAndSetVariable'](_0x26ea('0xa1'),_0x26ea('0xa2'));if(_0x23661c['result']===-0x1){return _0x23661c;}var _0x454995=this[_0x26ea('0x7c')]('RECOG_INPUT()',_0x26ea('0xa3'));if(_0x454995[_0x26ea('0x7d')]===-0x1){return _0x454995;}var _0x4358ea=this[_0x26ea('0x7c')](_0x26ea('0xa4'),_0x26ea('0xa5'));if(_0x4358ea[_0x26ea('0x7d')]===-0x1){return _0x4358ea;}return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0xa6'),_0x164054));};AGIVertices[_0x26ea('0xf')][_0x26ea('0xa7')]=function(_0x4227c7){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0xa8'),_0x4227c7[_0x26ea('0x37')]));if(!this['isConfigured'](_0x4227c7[_0x26ea('0x9f')])){return this['channel'][_0x26ea('0x90')](_0x26ea('0xa0'));}var _0x4355e9=_0x4227c7[_0x26ea('0x9f')];if(this[_0x26ea('0x65')](_0x4227c7[_0x26ea('0x95')])){_0x4355e9+=','+_0x4227c7['options'];}var _0x23f4ab=this[_0x26ea('0xc')]['exec'](_0x26ea('0xa9'),_0x4355e9);if(_0x23f4ab[_0x26ea('0x7d')]===-0x1){return _0x23f4ab;}var _0x2e95af=this[_0x26ea('0x7c')](_0x26ea('0xa1'),_0x26ea('0xaa'));if(_0x2e95af[_0x26ea('0x7d')]===-0x1){return _0x2e95af;}var _0x1b65ef=this[_0x26ea('0x7c')](_0x26ea('0xab'),'SESTEK_ASR_TRANSCRIPT');if(_0x1b65ef[_0x26ea('0x7d')]===-0x1){return _0x1b65ef;}var _0x359226=this['getAndSetVariable'](_0x26ea('0xa4'),_0x26ea('0xac'));if(_0x359226[_0x26ea('0x7d')]===-0x1){return _0x359226;}return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4355e9));};AGIVertices[_0x26ea('0xf')][_0x26ea('0xad')]=function(_0x2e9975){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2e9975['label']));if(!this[_0x26ea('0x65')](_0x2e9975[_0x26ea('0xae')])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x2e9975,_0x26ea('0xaf'));}var _0x55cc05=this[_0x26ea('0x18')][_0x26ea('0x7f')](this,_0x2e9975[_0x26ea('0xae')]);if(!_0x55cc05){return this['channel'][_0x26ea('0x2d')](_0x2e9975,_0x26ea('0xb0'));}if(!this['isConfigured'](_0x2e9975[_0x26ea('0x31')])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x2e9975,_0x26ea('0xb1'));}var _0x3a31f9=_0x2e9975['query'][_0x26ea('0xb2')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x26ea('0x90')](util['format'](_0x26ea('0xb3'),_0x3a31f9));var _0x243cd4=this[_0x26ea('0x2b')][_0x26ea('0x7f')](this,_0x55cc05,_0x3a31f9);this[_0x26ea('0xb4')][_0x26ea('0x7f')](this,_0x2e9975,_0x3a31f9);if(!this['isConfigured'](_0x2e9975[_0x26ea('0xb5')])){return this['channel'][_0x26ea('0x90')](_0x26ea('0xb6'));}var _0x44722a=this[_0x26ea('0x10')]['sync'](this,_0x2e9975[_0x26ea('0xb5')]);if(!_0x44722a){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x2e9975,_0x26ea('0xb7'));}var _0x4fee94=this;_0x243cd4[_0x26ea('0xb8')](function(_0x3a4715,_0x494a35){Object[_0x26ea('0xb9')](_0x3a4715)[_0x26ea('0xb8')](function(_0x3a5e8d){_0x4fee94[_0x26ea('0xc')][_0x26ea('0x7e')](util[_0x26ea('0x82')]('%s[%s][%s]',_0x44722a,_0x494a35,_0x3a5e8d),_0x3a4715[_0x3a5e8d]);});});this[_0x26ea('0xc')][_0x26ea('0x7e')](util[_0x26ea('0x82')]('%s_ROWS_COUNT',_0x44722a),_0x243cd4[_0x26ea('0x77')]);return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0xba'),_0x44722a));};AGIVertices[_0x26ea('0xf')][_0x26ea('0xbb')]=function(_0x200182){logger[_0x26ea('0xbc')](util[_0x26ea('0x82')](_0x26ea('0xbd'),_0x200182['label']));if(!this[_0x26ea('0x65')](_0x200182[_0x26ea('0xbe')])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x200182,_0x26ea('0xbf'));}var _0x4f9772=this[_0x26ea('0x1b')][_0x26ea('0x7f')](this,_0x200182[_0x26ea('0xbe')]);if(!_0x4f9772){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x200182,_0x26ea('0xc0'));}var _0x1dedac=this[_0x26ea('0xc')][_0x26ea('0x56')]('DIAL',[util['format'](_0x26ea('0xc1'),_0x4f9772),_0x200182['timeout'],_0x200182[_0x26ea('0xc2')],_0x200182[_0x26ea('0xc3')]]);if(_0x1dedac[_0x26ea('0x7d')]===-0x1){return _0x1dedac;}return this[_0x26ea('0xc')]['noop'](util['format'](_0x26ea('0xc4'),'DIAL'));};AGIVertices['prototype'][_0x26ea('0xc5')]=function(_0xf479b){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0xc6'),_0xf479b['label']));if(!this[_0x26ea('0x65')](_0xf479b['key'])){return this[_0x26ea('0xc')][_0x26ea('0x90')](_0x26ea('0xc7'));}if(!this[_0x26ea('0x65')](_0xf479b[_0x26ea('0x59')])){return this[_0x26ea('0xc')]['noop'](_0x26ea('0x99'));}this[_0x26ea('0xc')]['bot']=!![];this[_0x26ea('0xb4')](_0xf479b);this[_0x26ea('0x42')](_0xf479b[_0x26ea('0x59')],'in');this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0xc8'),_0xf479b['text']));var _0x24b0d8=this['googleDialogflow'][_0x26ea('0x7f')](this,_0xf479b);if(_0x24b0d8){for(var _0xd4d133 in _0x24b0d8){if(_0x24b0d8['hasOwnProperty'](_0xd4d133)){this[_0x26ea('0xc')][_0x26ea('0x7e')](util[_0x26ea('0x82')]('DIALOGFLOW_%s',_0xd4d133['toUpperCase']()),_0x24b0d8[_0xd4d133]);}}this[_0x26ea('0x42')](_0x24b0d8[_0x26ea('0xc9')],_0x26ea('0xca'));return this['channel'][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0xcb'),_0x24b0d8['speech']));}return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0xf479b,_0x26ea('0xcc'));};AGIVertices[_0x26ea('0xf')][_0x26ea('0xcd')]=function(_0x2f41d8){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0xce'),_0x2f41d8['label']));if(!this[_0x26ea('0x65')](_0x2f41d8[_0x26ea('0xcf')])){return this[_0x26ea('0xc')][_0x26ea('0x90')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x26ea('0x65')](_0x2f41d8[_0x26ea('0xd0')])){return this[_0x26ea('0xc')][_0x26ea('0x90')](_0x26ea('0xd1'));}if(!this['isConfigured'](_0x2f41d8[_0x26ea('0xd2')])){return this[_0x26ea('0xc')][_0x26ea('0x90')](_0x26ea('0xd3'));}if(!this[_0x26ea('0x65')](_0x2f41d8[_0x26ea('0xd4')])){return this[_0x26ea('0xc')][_0x26ea('0x90')](_0x26ea('0x99'));}this[_0x26ea('0xc')][_0x26ea('0xd5')]=!![];this['createSquareDetailsReport'](_0x2f41d8);this[_0x26ea('0x42')](_0x2f41d8[_0x26ea('0x59')],'in');this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0xd6'),_0x2f41d8['text']));var _0x1c6454=this[_0x26ea('0x5d')][_0x26ea('0x7f')](this,_0x2f41d8);if(_0x1c6454){for(var _0x1967de in _0x1c6454){if(_0x1c6454[_0x26ea('0x75')](_0x1967de)){this['channel'][_0x26ea('0x7e')](util[_0x26ea('0x82')](_0x26ea('0xd7'),_0x1967de[_0x26ea('0xd8')]()),_0x1c6454[_0x1967de]);}}this[_0x26ea('0x42')](_0x1c6454['speech'],_0x26ea('0xca'));if(_0x1c6454[_0x26ea('0xd9')]){this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1c6454[_0x26ea('0xd9')]));var _0xa7f419=this[_0x26ea('0xc')][_0x26ea('0xda')](_0x1c6454[_0x26ea('0xd9')]);try{fs[_0x26ea('0xdb')](_0x1c6454[_0x26ea('0xd9')]+'.wav');}catch(_0x3e0c09){logger[_0x26ea('0x2d')](_0x3e0c09);}return _0xa7f419;}else{return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0xdc'),_0x1c6454['speech']));}}return this[_0x26ea('0xc')]['error'](_0x2f41d8,_0x26ea('0xdd'));};AGIVertices[_0x26ea('0xf')][_0x26ea('0xde')]=function(_0x3451eb){logger['info'](util[_0x26ea('0x82')](_0x26ea('0xdf'),_0x3451eb['label']));return this['channel'][_0x26ea('0x90')](_0x26ea('0xde'));};AGIVertices[_0x26ea('0xf')]['ext_dial']=function(_0x3330e6){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3330e6[_0x26ea('0x37')]));var _0x3e9803='';if(_0x3330e6[_0x26ea('0xe0')]){if(!this['isConfigured'](_0x3330e6[_0x26ea('0xe0')])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x3330e6,_0x26ea('0xe1'));}else{var _0x44ce9f=parseInt(_0x3330e6[_0x26ea('0xe0')],0xa);if(isNaN(_0x44ce9f)){_0x3e9803=_0x3330e6[_0x26ea('0xe0')];}else{_0x3e9803=this['getTrunk'][_0x26ea('0x7f')](this,_0x3330e6[_0x26ea('0xe0')]);if(!_0x3e9803){return this[_0x26ea('0xc')]['error'](_0x3330e6,_0x26ea('0xe2'));}}}}else if(_0x3330e6[_0x26ea('0xe3')]){_0x3e9803=_0x3330e6[_0x26ea('0xe3')];}else{return this['channel']['error'](_0x3330e6,_0x26ea('0xe1'));}var _0x4960e9=this['channel'][_0x26ea('0x56')](_0x26ea('0xe4'),[util[_0x26ea('0x82')](_0x26ea('0xe5'),_0x3e9803,_0x3330e6[_0x26ea('0x48')]),_0x3330e6[_0x26ea('0x87')],_0x3330e6[_0x26ea('0xc2')],_0x3330e6[_0x26ea('0xc3')]]);if(_0x4960e9['result']===-0x1){return _0x4960e9;}return this['channel'][_0x26ea('0x90')](util['format'](_0x26ea('0xc4'),_0x26ea('0xe4')));};AGIVertices['prototype']['finally']=function(_0x32bb23){logger[_0x26ea('0x2f')](util['format'](_0x26ea('0xe6'),_0x32bb23[_0x26ea('0x37')]));return this['channel'][_0x26ea('0x90')](_0x26ea('0xe7'));};AGIVertices[_0x26ea('0xf')][_0x26ea('0xa')]=function(_0x3af665){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0xe8'),_0x3af665[_0x26ea('0x37')]));if(_0x3af665[_0x26ea('0x80')]===0x0){return this[_0x26ea('0x81')](_0x3af665);}_0x3af665['retry']-=0x1;if(!this[_0x26ea('0x65')](_0x3af665[_0x26ea('0xe9')])){return this['channel'][_0x26ea('0x2d')](_0x3af665,'no\x20file\x20audio\x20selected');}var _0xeb1ec=this[_0x26ea('0x1e')]['sync'](this,_0x3af665[_0x26ea('0xe9')]);if(!_0xeb1ec){return this['channel'][_0x26ea('0x2d')](_0x3af665,'no\x20file\x20audio\x20found');}if(!this[_0x26ea('0x65')](_0x3af665[_0x26ea('0xb5')])){return this[_0x26ea('0xc')]['error'](_0x26ea('0xb6'));}var _0x3ee19b=this[_0x26ea('0xc')]['getData'](_0xeb1ec,_0x3af665[_0x26ea('0xea')],_0x3af665[_0x26ea('0xeb')]);var _0xd8dac9=_0x3ee19b[_0x26ea('0x7d')]?_0x3ee19b['result'][_0x26ea('0x4c')]():'';logger['info']('test',JSON['stringify'](_0x3ee19b));if(_0x3ee19b[_0x26ea('0x7d')]===-0x1){this['createSquareDetailsReport'][_0x26ea('0x7f')](this,_0x3af665,_0xd8dac9);return _0x3ee19b;}else if(_0x3ee19b['extra']===_0x26ea('0x87')){_0x3ee19b[_0x26ea('0x7d')]=_0xd8dac9[_0x26ea('0x77')]>=parseInt(_0x3af665[_0x26ea('0xec')])?'x':'i';}else{_0x3ee19b['result']=_0xd8dac9[_0x26ea('0x77')]>=parseInt(_0x3af665[_0x26ea('0xec')])&&_0xd8dac9['length']<=parseInt(_0x3af665['maxdigit'])?'x':'i';}var _0x477b91=this[_0x26ea('0x10')][_0x26ea('0x7f')](this,_0x3af665[_0x26ea('0xb5')]);if(!_0x477b91){return this[_0x26ea('0xc')]['error'](_0x3af665,_0x26ea('0xb7'));}this['channel'][_0x26ea('0x7e')](_0x477b91,_0xd8dac9);if(this['isConfigured'](_0x3af665['hiddendigitsnum'])){var _0x74e70b=parseInt(_0x3af665[_0x26ea('0xed')],0xa);var _0x419e63=rs[_0x26ea('0xee')]({'charset':'*','length':_0x74e70b});var _0x42702c=_0xd8dac9[_0x26ea('0x77')];if(_0x42702c>0x0){if(_0x42702c>_0x74e70b){this[_0x26ea('0xb4')][_0x26ea('0x7f')](this,_0x3af665,_0x3af665['hiddendigitspos']===_0x26ea('0xef')?_0x419e63+_0xd8dac9[_0x26ea('0xf0')](_0x74e70b):_0xd8dac9[_0x26ea('0xf0')](0x0,_0x42702c-_0x74e70b)+_0x419e63);}else{this[_0x26ea('0xb4')]['sync'](this,_0x3af665,rs[_0x26ea('0xee')]({'charset':'*','length':_0x42702c}));}}else{this[_0x26ea('0xb4')]['sync'](this,_0x3af665,'');}}else{this[_0x26ea('0xb4')][_0x26ea('0x7f')](this,_0x3af665,_0xd8dac9);}return _0x3ee19b;};AGIVertices[_0x26ea('0xf')][_0x26ea('0xb')]=function(_0x5d16f4){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0xf1'),_0x5d16f4[_0x26ea('0x37')]));return this['getdigits'](_0x5d16f4);};AGIVertices[_0x26ea('0xf')]['goal']=function(_0x3db95b){logger['info'](util[_0x26ea('0x82')](_0x26ea('0xf2'),_0x3db95b[_0x26ea('0x37')]));this[_0x26ea('0xb4')]['sync'](this,_0x3db95b,_0x3db95b[_0x26ea('0xf3')]);return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0xf4'),_0x3db95b[_0x26ea('0xf3')]));};AGIVertices[_0x26ea('0xf')][_0x26ea('0xf5')]=function(_0x56f5be){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0xf6'),_0x56f5be[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x56f5be['aws_access_key_id'])||!this[_0x26ea('0x65')](_0x56f5be[_0x26ea('0x69')])){return this[_0x26ea('0xc')][_0x26ea('0x90')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x26ea('0x65')](_0x56f5be[_0x26ea('0x59')])){return this[_0x26ea('0xc')]['noop'](_0x26ea('0x99'));}this['channel']['noop'](util[_0x26ea('0x82')]('Trying\x20aws\x20Polly\x20%s',_0x56f5be[_0x26ea('0x59')]));var _0x116226=this['awsPolly'][_0x26ea('0x7f')](this,_0x56f5be);if(_0x116226){this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('aws\x20Polly\x20%s\x20file\x20created',_0x116226));var _0x3c0454=this['channel'][_0x26ea('0xda')](_0x116226);try{fs[_0x26ea('0xdb')](_0x116226+_0x26ea('0xf7'));}catch(_0x329455){logger[_0x26ea('0x2d')](_0x329455);}return _0x3c0454;}return this['channel'][_0x26ea('0x2d')](_0x56f5be,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x26ea('0xf8')]=function(_0x3b8cb9){logger[_0x26ea('0x2f')](util['format'](_0x26ea('0xf9'),_0x3b8cb9['label']));if(!this[_0x26ea('0x65')](_0x3b8cb9['aws_access_key_id'])||!this[_0x26ea('0x65')](_0x3b8cb9[_0x26ea('0x69')])){return this['channel'][_0x26ea('0x90')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x26ea('0x65')](_0x3b8cb9[_0x26ea('0xfa')])){return this[_0x26ea('0xc')][_0x26ea('0x90')]('no\x20bot\x20name\x20configured');}if(!this[_0x26ea('0x65')](_0x3b8cb9[_0x26ea('0x59')])){return this[_0x26ea('0xc')][_0x26ea('0x90')]('no\x20text\x20configured');}this[_0x26ea('0xc')][_0x26ea('0xd5')]=!![];this[_0x26ea('0xb4')](_0x3b8cb9);this[_0x26ea('0x42')](_0x3b8cb9[_0x26ea('0x59')],'in');this[_0x26ea('0xc')][_0x26ea('0x90')](util['format'](_0x26ea('0xfb'),_0x3b8cb9['text']));var _0x198806=this[_0x26ea('0x6d')]['sync'](this,_0x3b8cb9);if(_0x198806){for(var _0x40a5ae in _0x198806){if(_0x198806[_0x26ea('0x75')](_0x40a5ae)&&_['isString'](_0x198806[_0x40a5ae])){this[_0x26ea('0xc')][_0x26ea('0x7e')](util['format'](_0x26ea('0xfc'),_0x40a5ae[_0x26ea('0xd8')]()),_0x198806[_0x40a5ae]);}}if(_['isNil'](_0x198806['message'])){return this[_0x26ea('0xc')][_0x26ea('0x90')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x26ea('0x42')](_0x198806[_0x26ea('0xfd')],_0x26ea('0xca'));return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0xfe'),_0x198806['message']));}}return this[_0x26ea('0xc')]['error'](_0x3b8cb9,_0x26ea('0xff'));};AGIVertices[_0x26ea('0xf')][_0x26ea('0x100')]=function(_0x529320){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x101'),_0x529320[_0x26ea('0x37')],_0x529320[_0x26ea('0x87')]));if(!this['isConfigured'](_0x529320[_0x26ea('0x5f')])){return this[_0x26ea('0xc')]['noop'](_0x26ea('0xc7'));}var _0x3cc586=_0x26ea('0x102');var _0x3cbb97=util[_0x26ea('0x82')](_0x26ea('0x103'),FILES_PATH,rs[_0x26ea('0xee')](0x4));var _0x284489=util[_0x26ea('0x82')](_0x26ea('0x104'),_0x3cbb97,_0x3cc586);var _0x3aea5f=!![];if(_0x529320['beep']===_0x26ea('0x105')){_0x3aea5f=![];}var _0x49df98=this[_0x26ea('0xc')][_0x26ea('0x106')](_0x3cbb97,_0x3cc586,_0x529320[_0x26ea('0x107')],_0x529320[_0x26ea('0x87')],undefined,_0x3aea5f);if(_0x49df98['result']!==-0x1){this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x108'),_0x284489));var _0x61ada7=this[_0x26ea('0x6f')][_0x26ea('0x7f')](this,_0x529320,_0x284489);if(_0x61ada7){for(var _0x5017a9 in _0x61ada7){if(_0x61ada7['hasOwnProperty'](_0x5017a9)){this[_0x26ea('0xc')]['setVariable'](util[_0x26ea('0x82')](_0x26ea('0x109'),_0x5017a9[_0x26ea('0xd8')]()),_0x61ada7[_0x5017a9]);}}return this[_0x26ea('0xc')][_0x26ea('0x90')](util['format'](_0x26ea('0x10a'),JSON['stringify'](_0x61ada7)));}}return _0x49df98;};AGIVertices[_0x26ea('0xf')][_0x26ea('0x10b')]=function(_0x465009){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x10c'),_0x465009['label']));if(!this[_0x26ea('0x65')](_0x465009['appid'])){return this[_0x26ea('0xc')]['noop'](_0x26ea('0x10d'));}if(!this[_0x26ea('0x65')](_0x465009['appsecret'])){return this['channel'][_0x26ea('0x90')](_0x26ea('0x10e'));}var _0x1b4d30=_0x26ea('0x102');var _0x5cc494=util[_0x26ea('0x82')](_0x26ea('0x103'),FILES_PATH,rs['generate'](0x4));var _0x7685bb=util[_0x26ea('0x82')]('%s.%s',_0x5cc494,_0x1b4d30);var _0x3a7086=!![];if(_0x465009[_0x26ea('0x10f')]===_0x26ea('0x105')){_0x3a7086=![];}var _0x3647aa=this[_0x26ea('0xc')][_0x26ea('0x106')](_0x5cc494,_0x1b4d30,_0x465009[_0x26ea('0x107')],_0x465009[_0x26ea('0x87')],undefined,_0x3a7086);if(_0x3647aa[_0x26ea('0x7d')]!==-0x1){this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('tilde\x20%s\x20file\x20created',_0x7685bb));var _0x28cf58=this[_0x26ea('0x71')]['sync'](this,_0x465009,_0x7685bb);if(_0x28cf58){for(var _0x3a4e4c in _0x28cf58){if(_0x28cf58[_0x26ea('0x75')](_0x3a4e4c)){this[_0x26ea('0xc')][_0x26ea('0x7e')](util[_0x26ea('0x82')]('TILDE_ASR_%s',_0x3a4e4c[_0x26ea('0xd8')]()),_0x28cf58[_0x3a4e4c]);}}return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x110'),JSON[_0x26ea('0x111')](_0x28cf58)));}}return _0x3647aa;};AGIVertices[_0x26ea('0xf')]['gotoc']=function(_0x2dc260){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2dc260[_0x26ea('0x37')]));return this[_0x26ea('0xc')][_0x26ea('0x112')](_0x2dc260[_0x26ea('0x3d')],_0x2dc260[_0x26ea('0x3e')],_0x2dc260[_0x26ea('0x3f')]);};AGIVertices[_0x26ea('0xf')][_0x26ea('0x113')]=function(_0x4764b6){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4764b6[_0x26ea('0x37')]));if(!this['isConfigured'](_0x4764b6[_0x26ea('0x114')])){return this[_0x26ea('0xc')]['error'](_0x4764b6,_0x26ea('0x115'));}try{var _0x1b1e55=eval(_0x4764b6['condition'])?_0x26ea('0x116'):_0x26ea('0x117');this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x118'),_0x4764b6['condition'],_0x1b1e55));return{'code':0xc8,'result':_0x1b1e55};}catch(_0x5a5927){return{'code':0xc8,'result':_0x26ea('0x117')};}};AGIVertices[_0x26ea('0xf')]['gotoiftime']=function(_0x18d476){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x119'),_0x18d476[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x18d476[_0x26ea('0x11a')])){return this['channel'][_0x26ea('0x2d')](_0x18d476,_0x26ea('0x11b'));}var _0x17b705=this[_0x26ea('0x24')][_0x26ea('0x7f')](this,_0x18d476[_0x26ea('0x11a')]);if(!_0x17b705){return this[_0x26ea('0xc')]['error'](_0x18d476,_0x26ea('0x11c'));}for(var _0x34682f=0x0;_0x34682f<_0x17b705[_0x26ea('0x77')];_0x34682f+=0x1){var _0x40f2ca=this['channel'][_0x26ea('0x10')](util[_0x26ea('0x82')]('IFTIME(%s?true:false)',_0x17b705[_0x34682f]));if(_0x40f2ca[_0x26ea('0x7d')]===-0x1){return _0x40f2ca;}logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x17b705[_0x34682f],_0x40f2ca[_0x26ea('0x7a')]));if(_0x40f2ca['extra']==='true'){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x11d'),_0x17b705[_0x34682f],_0x26ea('0x116')));this['channel']['noop'](util[_0x26ea('0x82')](_0x26ea('0x11d'),_0x17b705[_0x34682f],_0x26ea('0x116')));return{'code':0xc8,'result':'true'};}else{logger['info'](util['format'](_0x26ea('0x11d'),_0x17b705[_0x34682f],'false'));this[_0x26ea('0xc')][_0x26ea('0x90')](util['format'](_0x26ea('0x11d'),_0x17b705[_0x34682f],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x26ea('0xf')][_0x26ea('0x11e')]=function(_0x2a185d){logger[_0x26ea('0x2f')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x2a185d['label']));return this[_0x26ea('0xc')]['hangup']();};AGIVertices[_0x26ea('0xf')][_0x26ea('0x11f')]=function(_0xc6ce21){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x120'),_0xc6ce21[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0xc6ce21[_0x26ea('0x5f')])){return this['channel'][_0x26ea('0x90')](_0x26ea('0xc7'));}var _0x1603ea=_0x26ea('0x102');var _0x3e0571=util[_0x26ea('0x82')](_0x26ea('0x103'),FILES_PATH,rs[_0x26ea('0xee')](0x4));var _0xf28a6d=util[_0x26ea('0x82')](_0x26ea('0x104'),_0x3e0571,_0x1603ea);var _0x13f553=!![];if(_0xc6ce21[_0x26ea('0x10f')]===_0x26ea('0x105')){_0x13f553=![];}var _0x1036c7=this['channel']['recordFile'](_0x3e0571,_0x1603ea,_0xc6ce21[_0x26ea('0x107')],_0xc6ce21[_0x26ea('0x87')],undefined,_0x13f553);if(_0x1036c7[_0x26ea('0x7d')]!==-0x1){this['channel'][_0x26ea('0x90')](util['format'](_0x26ea('0x121'),_0xf28a6d));var _0x4ae629=this[_0x26ea('0x63')][_0x26ea('0x7f')](this,_0xc6ce21,_0xf28a6d);if(_0x4ae629){for(var _0x5deb58 in _0x4ae629){if(_0x4ae629[_0x26ea('0x75')](_0x5deb58)){this[_0x26ea('0xc')]['setVariable'](util[_0x26ea('0x82')](_0x26ea('0x122'),_0x5deb58[_0x26ea('0xd8')]()),_0x4ae629[_0x5deb58]);}}return this['channel'][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x123'),JSON[_0x26ea('0x111')](_0x4ae629)));}}return _0x1036c7;};AGIVertices[_0x26ea('0xf')][_0x26ea('0x124')]=function(_0x416f23){logger['info'](util['format'](_0x26ea('0x125'),_0x416f23[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x416f23[_0x26ea('0x5f')])){return this[_0x26ea('0xc')]['noop'](_0x26ea('0xc7'));}if(!this[_0x26ea('0x65')](_0x416f23[_0x26ea('0x59')])){return this['channel'][_0x26ea('0x90')](_0x26ea('0x99'));}this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x126'),_0x416f23[_0x26ea('0x59')]));var _0x5a44f7=this[_0x26ea('0x5e')][_0x26ea('0x7f')](this,_0x416f23);if(_0x5a44f7){this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x121'),_0x5a44f7));var _0x5ccbf8=this[_0x26ea('0xc')][_0x26ea('0xda')](_0x5a44f7,_0x416f23[_0x26ea('0x107')]);try{fs[_0x26ea('0xdb')](_0x5a44f7+_0x26ea('0xf7'));}catch(_0x3a64dd){logger['error'](_0x3a64dd);}return _0x5ccbf8;}return this['channel'][_0x26ea('0x2d')](_0x416f23,_0x26ea('0x127'));};AGIVertices[_0x26ea('0xf')][_0x26ea('0x128')]=function(_0x318dfd){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x129'),_0x318dfd['label']));if(!this[_0x26ea('0x65')](_0x318dfd[_0x26ea('0x12a')])){return this['channel'][_0x26ea('0x2d')](_0x318dfd,_0x26ea('0x12b'));}logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x12c'),this['channel'][_0x26ea('0x3b')],_0x318dfd['findBy']));var _0xac65d1=this[_0x26ea('0x52')][_0x26ea('0x7f')](this,_0x318dfd['findBy']);if(_0xac65d1){logger['info'](util[_0x26ea('0x82')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x26ea('0xc')]['callerid'],_0x318dfd[_0x26ea('0x12a')]));this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x318dfd[_0x26ea('0x12a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x26ea('0x2f')](util['format'](_0x26ea('0x12d'),this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x318dfd[_0x26ea('0x12a')]));this['channel'][_0x26ea('0x90')](util['format'](_0x26ea('0x12d'),this[_0x26ea('0xc')]['callerid'],_0x318dfd[_0x26ea('0x12a')]));return{'code':0xc8,'result':_0x26ea('0x12e')};}};AGIVertices['prototype'][_0x26ea('0x12f')]=function(_0x2216bc){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x130'),_0x2216bc['label']));if(!this[_0x26ea('0x65')](_0x2216bc[_0x26ea('0x12a')])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x2216bc,_0x26ea('0x12b'));}logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x12c'),this[_0x26ea('0xc')]['callerid'],_0x2216bc['findBy']));var _0x37bd4d=this['agentLogout'][_0x26ea('0x7f')](this,_0x2216bc['findBy']);if(_0x37bd4d){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x26ea('0xc')]['callerid'],_0x2216bc[_0x26ea('0x12a')]));this['channel']['noop'](util[_0x26ea('0x82')](_0x26ea('0x131'),this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x2216bc['findBy']));return{'code':0xc8,'result':_0x26ea('0x132')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x26ea('0xc')]['callerid'],_0x2216bc[_0x26ea('0x12a')]));this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x2216bc['findBy']));return{'code':0xc8,'result':_0x26ea('0x12e')};}};AGIVertices[_0x26ea('0xf')][_0x26ea('0x133')]=function(_0x3a4250){logger[_0x26ea('0x2f')](util['format'](_0x26ea('0x134'),_0x3a4250[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x3a4250['operation'])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x3a4250,'no\x20operation\x20configured');}this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('math\x20%s',_0x3a4250['operation']));var _0x2404bb=eval(_0x3a4250['operation']);if(!this[_0x26ea('0x65')](_0x3a4250[_0x26ea('0xb5')])){return this[_0x26ea('0xc')][_0x26ea('0x90')](_0x26ea('0xb6'));}var _0x228365=this[_0x26ea('0x10')]['sync'](this,_0x3a4250['variable_id']);if(!_0x228365){return this[_0x26ea('0xc')]['error'](_0x3a4250,_0x26ea('0xb7'));}if(_[_0x26ea('0x135')](_0x2404bb)){var _0x199192=this;_0x2404bb['forEach'](function(_0x2e8792,_0x2f6110){_0x199192[_0x26ea('0xc')]['setVariable'](util[_0x26ea('0x82')](_0x26ea('0x136'),_0x228365,_0x2f6110),_0x2e8792);});return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x137'),_0x228365));}else{return this[_0x26ea('0xc')]['setVariable'](_0x228365,_0x2404bb);}};AGIVertices[_0x26ea('0xf')]['menu']=function(_0x3d4542){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x138'),_0x3d4542[_0x26ea('0x37')]));if(_0x3d4542[_0x26ea('0x80')]===0x0){return this[_0x26ea('0x81')](_0x3d4542);}_0x3d4542['retry']-=0x1;if(!this[_0x26ea('0x65')](_0x3d4542[_0x26ea('0xe9')])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x3d4542,_0x26ea('0x139'));}var _0x48639e=this[_0x26ea('0x1e')][_0x26ea('0x7f')](this,_0x3d4542[_0x26ea('0xe9')]);if(!_0x48639e){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x3d4542,_0x26ea('0x13a'));}var _0x205869=this[_0x26ea('0xc')][_0x26ea('0x13b')](_0x48639e,_0x3d4542['response'],_0x3d4542[_0x26ea('0x13c')]);var _0x982e1d=_0x205869[_0x26ea('0x7d')];if(_0x205869[_0x26ea('0x7d')]===-0x1){this[_0x26ea('0xb4')][_0x26ea('0x7f')](this,_0x3d4542,'-1');return _0x205869;}else if(_0x205869[_0x26ea('0x7a')]==='timeout'){_0x205869['result']=_0x205869[_0x26ea('0x7d')][_0x26ea('0x77')]>0x0?_0x205869[_0x26ea('0x7d')]:'t';}else if(_[_0x26ea('0x45')](_0x205869[_0x26ea('0x7d')])){_0x205869[_0x26ea('0x7d')]='#';_0x982e1d='#';}if(!this[_0x26ea('0x65')](_0x3d4542['variable_id'])){this['channel']['noop'](_0x26ea('0xb6'));}else{var _0x41dd1d=this['getVariable'][_0x26ea('0x7f')](this,_0x3d4542[_0x26ea('0xb5')]);if(!_0x41dd1d){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x3d4542,_0x26ea('0xb7'));}this['channel'][_0x26ea('0x7e')](_0x41dd1d,_0x982e1d);}this[_0x26ea('0xb4')]['sync'](this,_0x3d4542,_0x982e1d);return _0x205869;};AGIVertices[_0x26ea('0xf')][_0x26ea('0x90')]=function(_0x44a425){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x13d'),_0x44a425[_0x26ea('0x37')]));return this['channel'][_0x26ea('0x90')](_0x44a425[_0x26ea('0x13e')]||_0x44a425[_0x26ea('0x37')]);};AGIVertices[_0x26ea('0xf')]['pause']=function(_0x37c535){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x13f'),_0x37c535[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x37c535[_0x26ea('0x12a')])){return this['channel']['error'](_0x37c535,_0x26ea('0x12b'));}logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x37c535['findBy']));var _0x5f3455=this[_0x26ea('0x4d')][_0x26ea('0x7f')](this,_0x37c535['pause_id']);var _0x2cdf7b=this['agentPause'][_0x26ea('0x7f')](this,_0x37c535['findBy'],_0x5f3455);if(_0x2cdf7b){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x131'),this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x37c535[_0x26ea('0x12a')]));this['channel']['noop'](util[_0x26ea('0x82')](_0x26ea('0x131'),this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x37c535[_0x26ea('0x12a')]));return{'code':0xc8,'result':_0x26ea('0x132')};}else{logger['info'](util[_0x26ea('0x82')](_0x26ea('0x12d'),this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x37c535[_0x26ea('0x12a')]));this[_0x26ea('0xc')][_0x26ea('0x90')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x37c535[_0x26ea('0x12a')]));return{'code':0xc8,'result':_0x26ea('0x12e')};}};AGIVertices[_0x26ea('0xf')][_0x26ea('0x140')]=function(_0x52337f){logger[_0x26ea('0x2f')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x52337f[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x52337f[_0x26ea('0xe9')])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x52337f,_0x26ea('0x139'));}var _0x52f1de=this[_0x26ea('0x1e')][_0x26ea('0x7f')](this,_0x52337f[_0x26ea('0xe9')]);if(!_0x52f1de){return this['channel'][_0x26ea('0x2d')](_0x52337f,_0x26ea('0x13a'));}var _0x2af86e=this[_0x26ea('0xc')][_0x26ea('0x56')](_0x26ea('0x141'),[_0x52f1de,_0x52337f[_0x26ea('0xc2')]]);if(_0x2af86e[_0x26ea('0x7d')]===-0x1){return _0x2af86e;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x26ea('0x141'),_0x52f1de));};AGIVertices['prototype'][_0x26ea('0x142')]=function(_0x118c5d){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x143'),_0x118c5d[_0x26ea('0x37')]));if(!this['isConfigured'](_0x118c5d[_0x26ea('0x144')])){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x118c5d,_0x26ea('0x145'));}var _0x487f95='';var _0x5003ca=parseInt(_0x118c5d[_0x26ea('0x144')],0xa);if(isNaN(_0x5003ca)){_0x487f95=_0x118c5d['queue_id'];}else{_0x487f95=this[_0x26ea('0x146')][_0x26ea('0x7f')](this,_0x118c5d[_0x26ea('0x144')]);if(!_0x487f95){return this['channel']['error'](_0x118c5d,_0x26ea('0x147'));}}var _0x545cd2='';if(this['isConfigured'](_0x118c5d['file_id'])){var _0x1fa518=this['getSound'][_0x26ea('0x7f')](this,_0x118c5d[_0x26ea('0xe9')]);if(_0x1fa518){_0x545cd2=_0x1fa518;}}this[_0x26ea('0xb4')]['sync'](this,_0x118c5d,_0x487f95);if(_0x118c5d[_0x26ea('0xc2')]['indexOf']('x')<0x0){_0x118c5d[_0x26ea('0xc2')]+='x';}if(_0x118c5d[_0x26ea('0xc2')]['indexOf']('X')<0x0){_0x118c5d[_0x26ea('0xc2')]+='X';}this['channel'][_0x26ea('0x7e')](_0x26ea('0x148'),_0x487f95?_0x487f95[_0x26ea('0x149')]():'');var _0x3d4b7e=this[_0x26ea('0xc')][_0x26ea('0x56')](_0x26ea('0x14a'),[_0x487f95,_0x118c5d['opts'],_0x118c5d[_0x26ea('0xc3')],_0x545cd2,_0x118c5d[_0x26ea('0x87')],_0x118c5d[_0x26ea('0x7')],_0x118c5d[_0x26ea('0x14b')],_0x118c5d[_0x26ea('0x14c')],'',_0x118c5d[_0x26ea('0x14d')]]);if(_0x3d4b7e['result']===-0x1){return _0x3d4b7e;}return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('Executed\x20command\x20%s\x20%s',_0x26ea('0x14a'),_0x487f95));};AGIVertices[_0x26ea('0xf')][_0x26ea('0x14e')]=function(_0x4832b9){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4832b9[_0x26ea('0x37')]));var _0x2cef2b=_0x4832b9[_0x26ea('0x14f')]||_0x26ea('0x102');var _0x4d7565=util[_0x26ea('0x82')](_0x26ea('0x150'),this[_0x26ea('0xc')]['uniqueid'],rs[_0x26ea('0xee')](0x5));var _0x249cf6=util[_0x26ea('0x82')]('%s/recordings/%s.%s',FILES_PATH,_0x4d7565,_0x2cef2b);var _0x3f06da=util[_0x26ea('0x82')](_0x26ea('0x103'),FILES_PATH,_0x4d7565);this['createSquareRecording'][_0x26ea('0x7f')](this,_0x4832b9,_0x4d7565,_0x249cf6);this[_0x26ea('0xc')]['setVariable'](_0x26ea('0x151'),_0x4d7565);logger[_0x26ea('0x2f')](_0x26ea('0x152'),_0x3f06da,_0x2cef2b,_0x4832b9['escape_digits'],_0x4832b9[_0x26ea('0x87')]);return this[_0x26ea('0xc')][_0x26ea('0x106')](_0x3f06da,_0x2cef2b,_0x4832b9[_0x26ea('0x153')],_0x4832b9['timeout'],undefined,!![]);};AGIVertices[_0x26ea('0xf')][_0x26ea('0x154')]=function(_0x3bdfdb){logger[_0x26ea('0x2f')](util['format'](_0x26ea('0x155'),_0x3bdfdb['label']));return this[_0x26ea('0xc')][_0x26ea('0x156')](_0x3bdfdb[_0x26ea('0x157')][_0x26ea('0xb2')](/\s+/g,''),_0x3bdfdb[_0x26ea('0x153')]);};AGIVertices[_0x26ea('0xf')][_0x26ea('0x158')]=function(_0x4dd117){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x159'),_0x4dd117[_0x26ea('0x37')]));return this[_0x26ea('0xc')][_0x26ea('0x15a')](_0x4dd117['number'][_0x26ea('0xb2')](/\s+/g,''),_0x4dd117[_0x26ea('0x153')]);};AGIVertices[_0x26ea('0xf')][_0x26ea('0x15b')]=function(_0x48cb55){logger[_0x26ea('0x2f')](util['format'](_0x26ea('0x15c'),_0x48cb55['label']));return this[_0x26ea('0xc')]['sayPhonetic'](_0x48cb55[_0x26ea('0x59')],_0x48cb55[_0x26ea('0x153')]);};AGIVertices[_0x26ea('0xf')]['sendMail']=function(_0x2aa7d2){logger[_0x26ea('0x2f')](util['format'](_0x26ea('0x15d'),_0x2aa7d2[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x2aa7d2[_0x26ea('0x15e')])){return this[_0x26ea('0xc')][_0x26ea('0x90')]('no\x20mail\x20account\x20configured');}var _0x379d0b=this[_0x26ea('0x21')][_0x26ea('0x7f')](this,_0x2aa7d2[_0x26ea('0x15e')]);if(!_0x379d0b||!_0x379d0b[_0x26ea('0x15f')]){return this['channel'][_0x26ea('0x2d')](_0x2aa7d2,_0x26ea('0x160'));}var _0xbd4d1f={'from':util[_0x26ea('0x82')]('\x22%s\x22\x20<%s>',_0x379d0b[_0x26ea('0x13')],_0x379d0b[_0x26ea('0x161')]||_0x379d0b[_0x26ea('0x15f')][_0x26ea('0x162')]),'to':_0x2aa7d2['to']||'','cc':_0x2aa7d2['cc']||'','bcc':_0x2aa7d2[_0x26ea('0x163')]||'','subject':_0x2aa7d2[_0x26ea('0x164')],'html':_0x2aa7d2[_0x26ea('0x59')],'text':_0x2aa7d2[_0x26ea('0x59')]};var _0x266ce8={'tls':{'rejectUnauthorized':![]}};if(_0x379d0b[_0x26ea('0x15f')][_0x26ea('0x165')]){_0x266ce8[_0x26ea('0x165')]=_0x379d0b[_0x26ea('0x15f')][_0x26ea('0x165')];}else{_0x266ce8['host']=_0x379d0b['Smtp'][_0x26ea('0x166')];_0x266ce8[_0x26ea('0x167')]=_0x379d0b[_0x26ea('0x15f')][_0x26ea('0x167')];_0x266ce8[_0x26ea('0x168')]=_0x379d0b[_0x26ea('0x15f')][_0x26ea('0x168')];}if(_0x379d0b[_0x26ea('0x15f')][_0x26ea('0x169')]){_0x266ce8[_0x26ea('0x16a')]={'user':_0x379d0b[_0x26ea('0x15f')]['user'],'pass':_0x379d0b[_0x26ea('0x15f')]['pass']};}if(this[_0x26ea('0x65')](_0x2aa7d2['template_id'])){}logger['debug'](_0x26ea('0x16b'),JSON[_0x26ea('0x111')](_0xbd4d1f));this[_0x26ea('0xb4')][_0x26ea('0x7f')](this,_0x2aa7d2,_0x2aa7d2['account_id']);this['channel']['noop'](util[_0x26ea('0x82')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x379d0b[_0x26ea('0x13')]));this[_0x26ea('0x23')][_0x26ea('0x7f')](this,_0x266ce8,_0xbd4d1f);return this[_0x26ea('0xc')][_0x26ea('0x90')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x26ea('0x16c')]=function(_0x4e25e2){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x16d'),_0x4e25e2[_0x26ea('0x37')]));return this[_0x26ea('0xc')][_0x26ea('0x90')](_0x26ea('0x16e'));};AGIVertices[_0x26ea('0xf')]['sendSMS']=function(_0xeff9d6){logger['info'](util['format'](_0x26ea('0x16f'),_0xeff9d6[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0xeff9d6[_0x26ea('0x170')])){return this['channel'][_0x26ea('0x90')](_0x26ea('0x171'));}var _0x57f13c=this[_0x26ea('0x35')][_0x26ea('0x7f')](this,_0xeff9d6[_0x26ea('0x170')]);if(!_0x57f13c){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0xeff9d6,'no\x20sms\x20account\x20found');}var _0x11ee1a={'body':_0xeff9d6[_0x26ea('0x172')],'phone':_0xeff9d6['to']||'','SmsAccountId':_0x57f13c['id']};logger[_0x26ea('0xbc')](_0x26ea('0x173'),JSON[_0x26ea('0x111')](_0x11ee1a));this['createSquareDetailsReport'][_0x26ea('0x7f')](this,_0xeff9d6,_0xeff9d6[_0x26ea('0x170')]);this[_0x26ea('0xc')][_0x26ea('0x90')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x57f13c[_0x26ea('0x13')]));this['createSmsMessage'][_0x26ea('0x7f')](this,_0x11ee1a);return this['channel'][_0x26ea('0x90')](_0x26ea('0x174'));};AGIVertices['prototype'][_0x26ea('0x175')]=function(_0x3aa146){logger['info'](util[_0x26ea('0x82')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3aa146[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x3aa146['variable_id'])){return this[_0x26ea('0xc')]['error'](_0x3aa146,'no\x20variable\x20selected');}var _0x2d95be=this[_0x26ea('0x10')][_0x26ea('0x7f')](this,_0x3aa146[_0x26ea('0xb5')]);if(!_0x2d95be){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x3aa146,_0x26ea('0xb7'));}return this['channel'][_0x26ea('0x7e')](_0x2d95be,_0x3aa146[_0x26ea('0x176')]);};AGIVertices[_0x26ea('0xf')][_0x26ea('0x177')]=function(_0x4c2b27){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x178'),_0x4c2b27[_0x26ea('0x37')]));this[_0x26ea('0xc')][_0x26ea('0x90')](_0x26ea('0x179'));if(_0x4c2b27[_0x26ea('0x89')]===_0x26ea('0x17a')){this[_0x26ea('0xc')]['noop']('Answer');return this[_0x26ea('0xc')][_0x26ea('0x89')]();}return this['channel'][_0x26ea('0x90')]('Skipped\x20Answer');};AGIVertices[_0x26ea('0xf')]['subproject']=function(_0x1c7ad2){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x17b'),_0x1c7ad2[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x1c7ad2[_0x26ea('0x17c')])){return this[_0x26ea('0xc')]['error'](_0x1c7ad2,_0x26ea('0x17d'));}var _0x3e4f9e=this[_0x26ea('0x16')][_0x26ea('0x7f')](this,_0x1c7ad2[_0x26ea('0x17c')]);if(!this[_0x26ea('0x65')](_0x3e4f9e)){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x1c7ad2,util[_0x26ea('0x82')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x1c7ad2[_0x26ea('0x17c')]));}if(_0x3e4f9e===this[_0x26ea('0xc')][_0x26ea('0x39')]){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x1c7ad2,_0x26ea('0x17e'));}this[_0x26ea('0xb4')]['sync'](this,_0x1c7ad2,_0x3e4f9e);var _0xa04288=this[_0x26ea('0xc')][_0x26ea('0x56')](_0x26ea('0x17f'),util[_0x26ea('0x82')](_0x26ea('0x180'),config[_0x26ea('0x7')]['host']||_0x26ea('0x181'),_0x3e4f9e,this[_0x26ea('0xc')][_0x26ea('0x39')]));if(_0xa04288[_0x26ea('0x7d')]===-0x1){return _0xa04288;}return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x96'),_0x26ea('0x17f'),_0x3e4f9e));};AGIVertices['prototype'][_0x26ea('0x182')]=function(_0xb7a0dd){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0xb7a0dd[_0x26ea('0x37')]));var _0x4b420e=this[_0x26ea('0x55')][_0x26ea('0x7f')](this,_0xb7a0dd[_0x26ea('0x84')]);this[_0x26ea('0xb4')][_0x26ea('0x7f')](this,_0xb7a0dd,_0xb7a0dd[_0x26ea('0x84')]);if(this[_0x26ea('0x65')](_0xb7a0dd[_0x26ea('0xb5')])){var _0x54c144=this[_0x26ea('0x10')][_0x26ea('0x7f')](this,_0xb7a0dd['variable_id']);if(_0x54c144){this[_0x26ea('0xc')][_0x26ea('0x7e')](_0x54c144,_0x4b420e);return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x183'),_0xb7a0dd['command'],_0x54c144));}}return this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x184'),_0xb7a0dd['command']));};AGIVertices[_0x26ea('0xf')]['tts']=function(_0x1a160f){logger['info'](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1a160f[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x1a160f[_0x26ea('0x59')])){return this[_0x26ea('0xc')][_0x26ea('0x90')](_0x26ea('0x99'));}this['channel'][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x185'),_0x1a160f['text']));var _0xadedb5=this['googleTTS']['sync'](this,_0x1a160f);if(_0xadedb5){this[_0x26ea('0xc')]['noop'](util['format'](_0x26ea('0x186'),_0xadedb5));var _0x54cbce=this['channel'][_0x26ea('0xda')](_0xadedb5);try{fs['unlink'](_0xadedb5+_0x26ea('0xf7'));}catch(_0x48bc39){logger[_0x26ea('0x2d')](_0x48bc39);}return _0x54cbce;}return this[_0x26ea('0xc')]['error'](_0x1a160f,_0x26ea('0x187'));};AGIVertices[_0x26ea('0xf')][_0x26ea('0x188')]=function(_0x1de462){logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x189'),_0x1de462[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x1de462[_0x26ea('0x12a')])){return this['channel'][_0x26ea('0x2d')](_0x1de462,_0x26ea('0x12b'));}logger['info'](util[_0x26ea('0x82')](_0x26ea('0x12c'),this['channel'][_0x26ea('0x3b')],_0x1de462[_0x26ea('0x12a')]));var _0x36f32c=this['agentUnpause'][_0x26ea('0x7f')](this,_0x1de462[_0x26ea('0x12a')]);if(_0x36f32c){logger[_0x26ea('0x2f')](util['format'](_0x26ea('0x131'),this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x1de462[_0x26ea('0x12a')]));this[_0x26ea('0xc')][_0x26ea('0x90')](util[_0x26ea('0x82')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x26ea('0xc')][_0x26ea('0x3b')],_0x1de462['findBy']));return{'code':0xc8,'result':_0x26ea('0x132')};}else{logger[_0x26ea('0x2f')](util[_0x26ea('0x82')](_0x26ea('0x12d'),this[_0x26ea('0xc')]['callerid'],_0x1de462[_0x26ea('0x12a')]));this['channel'][_0x26ea('0x90')](util[_0x26ea('0x82')](_0x26ea('0x12d'),this[_0x26ea('0xc')]['callerid'],_0x1de462[_0x26ea('0x12a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x26ea('0x18a')]=function(_0x44a460){logger[_0x26ea('0x2f')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x44a460[_0x26ea('0x37')]));var _0x2fc3ea=this['channel'][_0x26ea('0x56')]('VOICEMAIL',[_0x44a460[_0x26ea('0x18b')],_0x44a460[_0x26ea('0x95')]]);if(_0x2fc3ea[_0x26ea('0x7d')]===-0x1){return _0x2fc3ea;}return this[_0x26ea('0xc')]['noop'](util[_0x26ea('0x82')](_0x26ea('0x96'),_0x26ea('0x18c'),_0x44a460[_0x26ea('0x18b')]));};AGIVertices['prototype'][_0x26ea('0x18d')]=function(_0x5529e5){logger['info'](util[_0x26ea('0x82')](_0x26ea('0x18e'),_0x5529e5[_0x26ea('0x37')]));if(!this[_0x26ea('0x65')](_0x5529e5[_0x26ea('0xb5')])){return this[_0x26ea('0xc')]['error'](_0x5529e5,_0x26ea('0x18f'));}var _0x33925d=this[_0x26ea('0x10')][_0x26ea('0x7f')](this,_0x5529e5[_0x26ea('0xb5')]);if(!_0x33925d){return this[_0x26ea('0xc')][_0x26ea('0x2d')](_0x5529e5,'no\x20variable\x20found');}var _0x38461f=this[_0x26ea('0xc')][_0x26ea('0x10')](_0x33925d);return{'code':0xc8,'result':_0x38461f[_0x26ea('0x7a')]?_0x38461f['extra']:'-'};};String[_0x26ea('0xf')][_0x26ea('0x79')]=function(_0x1be2f2,_0x228850){return this[_0x26ea('0x78')](_0x1be2f2)[_0x26ea('0x190')](_0x228850);};module[_0x26ea('0x191')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index da4f88a..ffbfcda 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 _0x7da7=['[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','prototype','channels','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','[TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid'];(function(_0x58dd9e,_0x283816){var _0xbcc1d1=function(_0x2d2ff4){while(--_0x2d2ff4){_0x58dd9e['push'](_0x58dd9e['shift']());}};_0xbcc1d1(++_0x283816);}(_0x7da7,0x10d));var _0x77da=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x7da7[_0x1627ae];return _0x34b38f;};'use strict';var util=require(_0x77da('0x0'));var _=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x77da('0x3'));var RpcUser=require(_0x77da('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3a9fa6){this[_0x77da('0x5')]=_0x3a9fa6['voiceQueues'];this[_0x77da('0x6')]=_0x3a9fa6[_0x77da('0x6')];this['timers']=_0x3a9fa6[_0x77da('0x7')];this['channels']={};ami['on'](_0x77da('0x8'),this[_0x77da('0x9')][_0x77da('0xa')](this));ami['on'](_0x77da('0xb'),this[_0x77da('0xc')]['bind'](this));ami['on'](_0x77da('0xd'),this[_0x77da('0xe')][_0x77da('0xa')](this));ami['on']('agentringnoanswer',this[_0x77da('0xf')][_0x77da('0xa')](this));ami['on'](_0x77da('0x10'),this[_0x77da('0x11')]['bind'](this));ami['on'](_0x77da('0x12'),this[_0x77da('0x13')][_0x77da('0xa')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x77da('0xa')](this));}function getDiff(_0x4263d9){var _0x589aa1=moment()[_0x77da('0x14')](0x0);var _0x369df0=moment(_0x4263d9)[_0x77da('0x14')](0x0);return _0x589aa1[_0x77da('0x15')](_0x369df0,'seconds');}Acw[_0x77da('0x16')]['startAcw']=function(_0x29cd7b){try{var _0x366443=this;var _0x1b0e17=this[_0x77da('0x17')][_0x29cd7b]['interface'];var _0x5c07da=this['channels'][_0x29cd7b]['queue'];var _0x103e46=this[_0x77da('0x5')][_0x5c07da];var _0x289887=![];var _0x335dcb=_0x77da('0x18');if(_0x103e46[_0x77da('0x19')]){if(_0x103e46[_0x77da('0x1a')][_0x77da('0x1b')]){_0x289887=!![];_0x335dcb=_0x103e46['mandatoryDispositionPause']['name'];}}ami[_0x77da('0x1c')]({'action':_0x77da('0x1d'),'interface':_0x1b0e17,'paused':!![],'reason':_0x335dcb})['then'](function(_0x45a122){if(_0x366443[_0x77da('0x6')][_0x1b0e17]){return RpcUser[_0x77da('0x1e')](_0x366443['agents'][_0x1b0e17]['id'])['then'](function(_0x3e6cfe){if(_0x3e6cfe&&!_0x3e6cfe['voicePause']){logger[_0x77da('0x1f')](_0x77da('0x20'),_0x29cd7b,_0x1b0e17,_0x5c07da);var _0xc52f0e=_0x366443[_0x77da('0x17')][_0x29cd7b][_0x77da('0x21')]&&_0x366443[_0x77da('0x17')][_0x29cd7b][_0x77da('0x22')]?_0x366443['channels'][_0x29cd7b]['destlinkedid']:_0x29cd7b;return RpcUser[_0x77da('0x23')](_0x366443[_0x77da('0x6')][_0x1b0e17],_0x335dcb,_0xc52f0e)[_0x77da('0x24')](function(_0xbd06b7){if(!_0x289887){_0x366443['timers'][_0x1b0e17]={};logger[_0x77da('0x1f')](_0x77da('0x25'),_0x29cd7b,_0x366443[_0x77da('0x5')][_0x5c07da][_0x77da('0x26')],_0x1b0e17,_0x5c07da);_0x366443[_0x77da('0x7')][_0x1b0e17]['timer']=setTimeout(_0x366443[_0x77da('0x27')][_0x77da('0xa')](_0x366443,_0x1b0e17),_0x366443[_0x77da('0x5')][_0x5c07da][_0x77da('0x26')]*0x3e8);_0x366443['timers'][_0x1b0e17]['lastPauseAt']=moment()['format'](_0x77da('0x28'));_0x366443[_0x77da('0x7')][_0x1b0e17][_0x77da('0x29')]=_0x29cd7b;_0x366443[_0x77da('0x7')][_0x1b0e17][_0x77da('0x2a')]=_0x5c07da;_0x366443['timers'][_0x1b0e17][_0x77da('0x2b')]=function(){var _0x26f5a0=getDiff(_0x366443[_0x77da('0x7')][_0x1b0e17][_0x77da('0x2c')]);clearTimeout(_0x366443[_0x77da('0x7')][_0x1b0e17][_0x77da('0x2d')]);_0x366443['timers'][_0x1b0e17][_0x77da('0x2d')]=![];RpcVoiceAgentReport[_0x77da('0x2e')]({'acwtime':_0x26f5a0},_0x366443[_0x77da('0x7')][_0x1b0e17][_0x77da('0x29')],_0x1b0e17)[_0x77da('0x24')](function(_0x12ea16){logger[_0x77da('0x1f')](_0x77da('0x2f'),_0x29cd7b,_0x26f5a0,_0x12ea16);})['catch'](function(_0x5e8d1e){logger[_0x77da('0x30')](_0x77da('0x31'),_0x29cd7b,_0x5e8d1e);});delete _0x366443['timers'][_0x1b0e17];};}});}else{logger[_0x77da('0x1f')](_0x77da('0x32'),_0x29cd7b,_0x1b0e17,_0x5c07da);}});}})[_0x77da('0x33')](function(_0x10540a){logger[_0x77da('0x30')](_0x77da('0x25'),_0x29cd7b,_0x366443[_0x77da('0x5')][_0x5c07da]['acwTimeout'],_0x1b0e17,_0x5c07da);})[_0x77da('0x34')](function(){delete _0x366443['channels'][_0x29cd7b];});}catch(_0x54b7f2){logger['error'](_0x77da('0x35'),_0x54b7f2['message']);}};Acw[_0x77da('0x16')][_0x77da('0x27')]=function(_0xce9df2){try{var _0x3cc78b=this;if(_0x3cc78b[_0x77da('0x7')][_0xce9df2]){_0x3cc78b[_0x77da('0x7')][_0xce9df2][_0x77da('0x2d')]=![];var _0x501306=_0x3cc78b[_0x77da('0x7')][_0xce9df2][_0x77da('0x29')];var _0x1ca53a=_0x3cc78b[_0x77da('0x7')][_0xce9df2][_0x77da('0x2a')];var _0x188284=_0x3cc78b['voiceQueues'][_0x1ca53a][_0x77da('0x26')];logger[_0x77da('0x1f')](_0x77da('0x36'),_0xce9df2);RpcUser['saveUnpause'](this[_0x77da('0x6')][_0xce9df2]);RpcVoiceAgentReport['update']({'acwtime':_0x188284,'agentacw':!![]},_0x501306,_0xce9df2)['then'](function(_0x599e21){logger['info'](_0x77da('0x2f'),_0x501306,_0x188284,_0x599e21);})[_0x77da('0x33')](function(_0xebdea1){logger['error'](_0x77da('0x31'),_0x501306,_0xebdea1);});}else{logger['error'](_0x77da('0x37'),_0xce9df2);if(_0x3cc78b['timers']){logger[_0x77da('0x1f')](_0x77da('0x38'),JSON[_0x77da('0x39')](_0x3cc78b[_0x77da('0x7')]));}}}catch(_0x240bee){logger['error'](_0x77da('0x3a'),_0x240bee[_0x77da('0x3b')]);}};Acw[_0x77da('0x16')][_0x77da('0x9')]=function(_0x32a9c4){try{if(this[_0x77da('0x5')][_0x32a9c4['queue']]&&(this[_0x77da('0x5')][_0x32a9c4[_0x77da('0x2a')]][_0x77da('0x3')]||this[_0x77da('0x5')][_0x32a9c4[_0x77da('0x2a')]][_0x77da('0x19')])){if(this['agents'][_0x32a9c4[_0x77da('0x3c')]]){this['channels'][_0x32a9c4[_0x77da('0x29')]]={'queue':_0x32a9c4[_0x77da('0x2a')],'interface':_0x32a9c4[_0x77da('0x3c')],'destlinkedid':_0x32a9c4['destlinkedid']};}}}catch(_0x1c83c2){logger[_0x77da('0x30')](_0x77da('0x3d'),_0x1c83c2[_0x77da('0x3b')]);}};Acw[_0x77da('0x16')][_0x77da('0x3e')]=function(_0x203caa){try{if(this[_0x77da('0x5')][_0x203caa[_0x77da('0x2a')]]&&(this['voiceQueues'][_0x203caa[_0x77da('0x2a')]][_0x77da('0x3')]||this[_0x77da('0x5')][_0x203caa[_0x77da('0x2a')]][_0x77da('0x19')])){if(this[_0x77da('0x6')][_0x203caa['interface']]){this['channels'][_0x203caa[_0x77da('0x29')]]={'queue':_0x203caa[_0x77da('0x2a')],'interface':_0x203caa[_0x77da('0x3c')]};}}}catch(_0x326054){logger[_0x77da('0x30')](_0x77da('0x3f'),_0x326054['message']);}};Acw[_0x77da('0x16')][_0x77da('0xc')]=function(_0x332f80){try{if(this[_0x77da('0x17')][_0x332f80['uniqueid']]&&_[_0x77da('0x40')](this['channels'][_0x332f80['uniqueid']][_0x77da('0x21')])){logger[_0x77da('0x1f')](_0x77da('0x41'),_0x332f80[_0x77da('0x29')]);this['startAcw'](_0x332f80[_0x77da('0x29')]);}else if(this[_0x77da('0x17')][_0x332f80['linkedid']]&&_[_0x77da('0x40')](this[_0x77da('0x17')][_0x332f80['linkedid']][_0x77da('0x21')])){logger[_0x77da('0x1f')](_0x77da('0x42'),_0x332f80[_0x77da('0x43')]);this[_0x77da('0x44')](_0x332f80[_0x77da('0x43')]);}}catch(_0x2b96c1){logger[_0x77da('0x30')](_0x77da('0x45'),_0x2b96c1[_0x77da('0x3b')]);}};Acw['prototype'][_0x77da('0xe')]=function(_0x513017){try{if(this[_0x77da('0x17')][_0x513017[_0x77da('0x29')]]&&this[_0x77da('0x17')][_0x513017[_0x77da('0x29')]][_0x77da('0x21')]){logger[_0x77da('0x1f')](_0x77da('0x46'),_0x513017['uniqueid']);this[_0x77da('0x44')](_0x513017[_0x77da('0x29')]);}else if(this[_0x77da('0x17')][_0x513017[_0x77da('0x43')]]&&this['channels'][_0x513017[_0x77da('0x43')]][_0x77da('0x21')]){logger[_0x77da('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x513017['linkedid']);this[_0x77da('0x44')](_0x513017[_0x77da('0x43')]);}}catch(_0x42ea9e){logger[_0x77da('0x30')](_0x77da('0x47'),_0x42ea9e['message']);}};Acw['prototype'][_0x77da('0x11')]=function(_0x36f161){try{if(!_['isNil'](this[_0x77da('0x17')][_0x36f161[_0x77da('0x48')]])){this[_0x77da('0x44')](_0x36f161['transfereeuniqueid']);if(this[_0x77da('0x17')][_0x36f161[_0x77da('0x49')]]){this['channels'][_0x36f161[_0x77da('0x49')]][_0x77da('0x21')]=!![];this[_0x77da('0x17')][_0x36f161[_0x77da('0x4a')]]=this[_0x77da('0x17')][_0x36f161[_0x77da('0x49')]];delete this[_0x77da('0x17')][_0x36f161[_0x77da('0x49')]];}}else if(!_[_0x77da('0x4b')](this['channels'][_0x36f161[_0x77da('0x4a')]])){this[_0x77da('0x44')](_0x36f161[_0x77da('0x4a')]);if(this[_0x77da('0x17')][_0x36f161[_0x77da('0x4c')]]){this[_0x77da('0x17')][_0x36f161['origtransfereruniqueid']][_0x77da('0x21')]=!![];this[_0x77da('0x17')][_0x36f161[_0x77da('0x48')]]=this['channels'][_0x36f161[_0x77da('0x4c')]];delete this[_0x77da('0x17')][_0x36f161[_0x77da('0x4c')]];}}}catch(_0x8592c7){logger[_0x77da('0x30')](_0x77da('0x4d'),_0x8592c7[_0x77da('0x3b')]);}};Acw['prototype'][_0x77da('0x13')]=function(_0x52c8f0){try{if(this[_0x77da('0x17')][_0x52c8f0[_0x77da('0x4e')]]){logger[_0x77da('0x1f')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x77da('0x39')](_0x52c8f0[_0x77da('0x4e')]));this[_0x77da('0x44')](_0x52c8f0[_0x77da('0x4e')]);}else if(this['channels'][_0x52c8f0['transfererlinkedid']]){logger['info'](_0x77da('0x4f'),JSON[_0x77da('0x39')](_0x52c8f0[_0x77da('0x50')]));this[_0x77da('0x44')](_0x52c8f0[_0x77da('0x50')]);}}catch(_0x454f35){logger[_0x77da('0x30')](_0x77da('0x51'),_0x454f35[_0x77da('0x3b')]);}};Acw[_0x77da('0x16')]['syncAgentRingNoAnswer']=function(_0x3028ca){try{if(this[_0x77da('0x5')][_0x3028ca['queue']]&&this['voiceQueues'][_0x3028ca[_0x77da('0x2a')]]['autopause']===_0x77da('0x52')){if(this[_0x77da('0x6')][_0x3028ca[_0x77da('0x3c')]]){logger['info'](_0x77da('0x53'),_0x3028ca[_0x77da('0x29')],_0x3028ca[_0x77da('0x3c')],_0x3028ca[_0x77da('0x2a')]);return RpcUser[_0x77da('0x23')](this['agents'][_0x3028ca[_0x77da('0x3c')]],_0x77da('0x54'),_0x3028ca['uniqueid']);}}}catch(_0x3fdde1){logger[_0x77da('0x30')](_0x77da('0x55'),_0x3fdde1[_0x77da('0x3b')]);}};module[_0x77da('0x56')]=Acw; \ No newline at end of file +var _0x2d17=['catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','queue','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','util','lodash','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','info','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid'];(function(_0x5f7316,_0x32ab1a){var _0x42a464=function(_0x3f6e14){while(--_0x3f6e14){_0x5f7316['push'](_0x5f7316['shift']());}};_0x42a464(++_0x32ab1a);}(_0x2d17,0x17e));var _0x72d1=function(_0x34c4f2,_0x52858a){_0x34c4f2=_0x34c4f2-0x0;var _0x48ec1d=_0x2d17[_0x34c4f2];return _0x48ec1d;};'use strict';var util=require(_0x72d1('0x0'));var _=require(_0x72d1('0x1'));var moment=require('moment');var ami=require(_0x72d1('0x2'));var logger=require(_0x72d1('0x3'))('acw');var RpcUser=require(_0x72d1('0x4'));var RpcVoiceAgentReport=require(_0x72d1('0x5'));function Acw(_0x55b722){this[_0x72d1('0x6')]=_0x55b722['voiceQueues'];this[_0x72d1('0x7')]=_0x55b722['agents'];this[_0x72d1('0x8')]=_0x55b722[_0x72d1('0x8')];this['channels']={};ami['on'](_0x72d1('0x9'),this[_0x72d1('0xa')][_0x72d1('0xb')](this));ami['on']('hanguprequest',this[_0x72d1('0xc')][_0x72d1('0xb')](this));ami['on'](_0x72d1('0xd'),this['syncHangup'][_0x72d1('0xb')](this));ami['on'](_0x72d1('0xe'),this[_0x72d1('0xf')][_0x72d1('0xb')](this));ami['on'](_0x72d1('0x10'),this[_0x72d1('0x11')][_0x72d1('0xb')](this));ami['on'](_0x72d1('0x12'),this[_0x72d1('0x13')][_0x72d1('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0x72d1('0x14')][_0x72d1('0xb')](this));}function getDiff(_0x4c1038){var _0x115cd7=moment()[_0x72d1('0x15')](0x0);var _0x685a27=moment(_0x4c1038)[_0x72d1('0x15')](0x0);return _0x115cd7[_0x72d1('0x16')](_0x685a27,_0x72d1('0x17'));}Acw[_0x72d1('0x18')][_0x72d1('0x19')]=function(_0x23a238){try{var _0x8d458=this;var _0x491af4=this[_0x72d1('0x1a')][_0x23a238]['interface'];var _0x3885b2=this[_0x72d1('0x1a')][_0x23a238]['queue'];var _0x1061b7=this[_0x72d1('0x6')][_0x3885b2];var _0x1ca18d=![];var _0x49caf4='ACW';if(_0x1061b7[_0x72d1('0x1b')]){if(_0x1061b7[_0x72d1('0x1c')][_0x72d1('0x1d')]){_0x1ca18d=!![];_0x49caf4=_0x1061b7[_0x72d1('0x1c')][_0x72d1('0x1d')];}}ami[_0x72d1('0x1e')]({'action':_0x72d1('0x1f'),'interface':_0x491af4,'paused':!![],'reason':_0x49caf4})['then'](function(_0x1c695c){if(_0x8d458['agents'][_0x491af4]){return RpcUser['getAgent'](_0x8d458['agents'][_0x491af4]['id'])['then'](function(_0x445985){if(_0x445985&&!_0x445985[_0x72d1('0x20')]){logger['info'](_0x72d1('0x21'),_0x23a238,_0x491af4,_0x3885b2);var _0x256dc1=_0x8d458[_0x72d1('0x1a')][_0x23a238][_0x72d1('0x22')]&&_0x8d458[_0x72d1('0x1a')][_0x23a238]['destlinkedid']?_0x8d458['channels'][_0x23a238][_0x72d1('0x23')]:_0x23a238;return RpcUser[_0x72d1('0x24')](_0x8d458[_0x72d1('0x7')][_0x491af4],_0x49caf4,_0x256dc1)[_0x72d1('0x25')](function(_0xdf6a69){if(!_0x1ca18d){_0x8d458[_0x72d1('0x8')][_0x491af4]={};logger[_0x72d1('0x26')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x23a238,_0x8d458['voiceQueues'][_0x3885b2][_0x72d1('0x27')],_0x491af4,_0x3885b2);_0x8d458['timers'][_0x491af4][_0x72d1('0x28')]=setTimeout(_0x8d458[_0x72d1('0x29')][_0x72d1('0xb')](_0x8d458,_0x491af4),_0x8d458['voiceQueues'][_0x3885b2][_0x72d1('0x27')]*0x3e8);_0x8d458['timers'][_0x491af4][_0x72d1('0x2a')]=moment()[_0x72d1('0x2b')](_0x72d1('0x2c'));_0x8d458[_0x72d1('0x8')][_0x491af4]['uniqueid']=_0x23a238;_0x8d458[_0x72d1('0x8')][_0x491af4]['queue']=_0x3885b2;_0x8d458[_0x72d1('0x8')][_0x491af4][_0x72d1('0x2d')]=function(){var _0x5cec3f=getDiff(_0x8d458[_0x72d1('0x8')][_0x491af4][_0x72d1('0x2a')]);clearTimeout(_0x8d458[_0x72d1('0x8')][_0x491af4][_0x72d1('0x28')]);_0x8d458[_0x72d1('0x8')][_0x491af4]['timer']=![];RpcVoiceAgentReport[_0x72d1('0x2e')]({'acwtime':_0x5cec3f},_0x8d458[_0x72d1('0x8')][_0x491af4][_0x72d1('0x2f')],_0x491af4)['then'](function(_0x244f4a){logger[_0x72d1('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x23a238,_0x5cec3f,_0x244f4a);})[_0x72d1('0x30')](function(_0x750de6){logger[_0x72d1('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x23a238,_0x750de6);});delete _0x8d458[_0x72d1('0x8')][_0x491af4];};}});}else{logger['info'](_0x72d1('0x32'),_0x23a238,_0x491af4,_0x3885b2);}});}})[_0x72d1('0x30')](function(_0x23418d){logger[_0x72d1('0x31')](_0x72d1('0x33'),_0x23a238,_0x8d458[_0x72d1('0x6')][_0x3885b2][_0x72d1('0x27')],_0x491af4,_0x3885b2);})[_0x72d1('0x34')](function(){delete _0x8d458[_0x72d1('0x1a')][_0x23a238];});}catch(_0x24be04){logger[_0x72d1('0x31')]('[ACW][START]\x20%s',_0x24be04[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')][_0x72d1('0x29')]=function(_0x325209){try{var _0x49e074=this;if(_0x49e074[_0x72d1('0x8')][_0x325209]){_0x49e074[_0x72d1('0x8')][_0x325209][_0x72d1('0x28')]=![];var _0x4fb07b=_0x49e074[_0x72d1('0x8')][_0x325209][_0x72d1('0x2f')];var _0x163538=_0x49e074['timers'][_0x325209][_0x72d1('0x36')];var _0x117440=_0x49e074[_0x72d1('0x6')][_0x163538]['acwTimeout'];logger[_0x72d1('0x26')](_0x72d1('0x37'),_0x325209);RpcUser[_0x72d1('0x38')](this[_0x72d1('0x7')][_0x325209]);RpcVoiceAgentReport[_0x72d1('0x2e')]({'acwtime':_0x117440,'agentacw':!![]},_0x4fb07b,_0x325209)[_0x72d1('0x25')](function(_0xd7ec0f){logger['info'](_0x72d1('0x39'),_0x4fb07b,_0x117440,_0xd7ec0f);})[_0x72d1('0x30')](function(_0x440ac5){logger[_0x72d1('0x31')](_0x72d1('0x3a'),_0x4fb07b,_0x440ac5);});}else{logger[_0x72d1('0x31')](_0x72d1('0x3b'),_0x325209);if(_0x49e074[_0x72d1('0x8')]){logger['info'](_0x72d1('0x3c'),JSON[_0x72d1('0x3d')](_0x49e074[_0x72d1('0x8')]));}}}catch(_0x1d6704){logger[_0x72d1('0x31')](_0x72d1('0x3e'),_0x1d6704[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')]['syncAgentConnect']=function(_0x563c5a){try{if(this[_0x72d1('0x6')][_0x563c5a[_0x72d1('0x36')]]&&(this[_0x72d1('0x6')][_0x563c5a[_0x72d1('0x36')]]['acw']||this[_0x72d1('0x6')][_0x563c5a[_0x72d1('0x36')]]['mandatoryDisposition'])){if(this[_0x72d1('0x7')][_0x563c5a['interface']]){this[_0x72d1('0x1a')][_0x563c5a[_0x72d1('0x2f')]]={'queue':_0x563c5a['queue'],'interface':_0x563c5a[_0x72d1('0x3f')],'destlinkedid':_0x563c5a['destlinkedid']};}}}catch(_0x527223){logger['error'](_0x72d1('0x40'),_0x527223['message']);}};Acw[_0x72d1('0x18')][_0x72d1('0x14')]=function(_0x28332b){try{if(this['voiceQueues'][_0x28332b['queue']]&&(this[_0x72d1('0x6')][_0x28332b['queue']]['acw']||this[_0x72d1('0x6')][_0x28332b[_0x72d1('0x36')]][_0x72d1('0x1b')])){if(this['agents'][_0x28332b['interface']]){this['channels'][_0x28332b['uniqueid']]={'queue':_0x28332b[_0x72d1('0x36')],'interface':_0x28332b[_0x72d1('0x3f')]};}}}catch(_0x197483){logger[_0x72d1('0x31')](_0x72d1('0x41'),_0x197483[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')][_0x72d1('0xc')]=function(_0x1e2c11){try{if(this['channels'][_0x1e2c11[_0x72d1('0x2f')]]&&_[_0x72d1('0x42')](this[_0x72d1('0x1a')][_0x1e2c11['uniqueid']][_0x72d1('0x22')])){logger[_0x72d1('0x26')](_0x72d1('0x43'),_0x1e2c11['uniqueid']);this[_0x72d1('0x19')](_0x1e2c11[_0x72d1('0x2f')]);}else if(this[_0x72d1('0x1a')][_0x1e2c11[_0x72d1('0x44')]]&&_['isUndefined'](this['channels'][_0x1e2c11[_0x72d1('0x44')]][_0x72d1('0x22')])){logger[_0x72d1('0x26')]('[%s][HANGUP:LINKEDID]',_0x1e2c11[_0x72d1('0x44')]);this[_0x72d1('0x19')](_0x1e2c11[_0x72d1('0x44')]);}}catch(_0x463670){logger[_0x72d1('0x31')](_0x72d1('0x45'),_0x463670[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')][_0x72d1('0x46')]=function(_0x18f986){try{if(this[_0x72d1('0x1a')][_0x18f986['uniqueid']]&&this[_0x72d1('0x1a')][_0x18f986['uniqueid']]['attended']){logger[_0x72d1('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x18f986[_0x72d1('0x2f')]);this[_0x72d1('0x19')](_0x18f986[_0x72d1('0x2f')]);}else if(this[_0x72d1('0x1a')][_0x18f986[_0x72d1('0x44')]]&&this[_0x72d1('0x1a')][_0x18f986[_0x72d1('0x44')]][_0x72d1('0x22')]){logger[_0x72d1('0x26')](_0x72d1('0x47'),_0x18f986[_0x72d1('0x44')]);this['startAcw'](_0x18f986[_0x72d1('0x44')]);}}catch(_0x3da39a){logger[_0x72d1('0x31')]('[ACW][syncHangup]\x20%s',_0x3da39a['message']);}};Acw[_0x72d1('0x18')][_0x72d1('0x11')]=function(_0x16e9e7){try{if(!_[_0x72d1('0x48')](this[_0x72d1('0x1a')][_0x16e9e7['transfereeuniqueid']])){this[_0x72d1('0x19')](_0x16e9e7['transfereeuniqueid']);if(this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x49')]]){this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x49')]][_0x72d1('0x22')]=!![];this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4a')]]=this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x49')]];delete this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x49')]];}}else if(!_[_0x72d1('0x48')](this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4a')]])){this[_0x72d1('0x19')](_0x16e9e7[_0x72d1('0x4a')]);if(this[_0x72d1('0x1a')][_0x16e9e7['origtransfereruniqueid']]){this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4b')]][_0x72d1('0x22')]=!![];this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4c')]]=this[_0x72d1('0x1a')][_0x16e9e7['origtransfereruniqueid']];delete this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4b')]];}}}catch(_0xb05cd9){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0xb05cd9[_0x72d1('0x35')]);}};Acw['prototype'][_0x72d1('0x13')]=function(_0x359176){try{if(this[_0x72d1('0x1a')][_0x359176[_0x72d1('0x4d')]]){logger[_0x72d1('0x26')](_0x72d1('0x4e'),JSON[_0x72d1('0x3d')](_0x359176[_0x72d1('0x4d')]));this[_0x72d1('0x19')](_0x359176['transfereruniqueid']);}else if(this['channels'][_0x359176[_0x72d1('0x4f')]]){logger[_0x72d1('0x26')](_0x72d1('0x50'),JSON['stringify'](_0x359176[_0x72d1('0x4f')]));this[_0x72d1('0x19')](_0x359176['transfererlinkedid']);}}catch(_0x39d7f9){logger[_0x72d1('0x31')](_0x72d1('0x51'),_0x39d7f9[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')][_0x72d1('0xf')]=function(_0x102574){try{if(this[_0x72d1('0x6')][_0x102574[_0x72d1('0x36')]]&&this[_0x72d1('0x6')][_0x102574[_0x72d1('0x36')]][_0x72d1('0x52')]==='all'){if(this['agents'][_0x102574[_0x72d1('0x3f')]]){logger[_0x72d1('0x26')](_0x72d1('0x53'),_0x102574[_0x72d1('0x2f')],_0x102574[_0x72d1('0x3f')],_0x102574[_0x72d1('0x36')]);return RpcUser[_0x72d1('0x24')](this[_0x72d1('0x7')][_0x102574['interface']],_0x72d1('0x54'),_0x102574['uniqueid']);}}}catch(_0x475016){logger[_0x72d1('0x31')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x475016['message']);}};module[_0x72d1('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index bb17f57..ec8017e 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 _0x799e=['catch','log','bluebird','moment','util','lodash','../../config/logger','ami','port','asterisk','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0x799e,0x74));var _0xe799=function(_0x1cd14a,_0x2ee01b){_0x1cd14a=_0x1cd14a-0x0;var _0x434a4c=_0x799e[_0x1cd14a];return _0x434a4c;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xe799('0x0'));var moment=require(_0xe799('0x1'));var util=require(_0xe799('0x2'));var _=require(_0xe799('0x3'));var logger=require(_0xe799('0x4'))(_0xe799('0x5'));var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0xe799('0x6')],config[_0xe799('0x7')]['ip'],config[_0xe799('0x7')]['username'],config[_0xe799('0x7')][_0xe799('0x8')],!![]);ami[_0xe799('0x9')]();ami['Action']=BPromise[_0xe799('0xa')](ami[_0xe799('0xb')]);function error(_0x181a64){logger[_0xe799('0xc')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xe799('0x7')]['username'],config[_0xe799('0x7')]['ip'],config['asterisk'][_0xe799('0x6')],util['inspect'](_0x181a64,![],null)));}function close(){logger[_0xe799('0xc')](util[_0xe799('0xd')](_0xe799('0xe'),config['asterisk'][_0xe799('0xf')],config[_0xe799('0x7')]['ip'],config[_0xe799('0x7')][_0xe799('0x6')]));}ami[_0xe799('0x10')]=function(){return function(){return ami[_0xe799('0x11')]({'action':_0xe799('0x12')});};};ami[_0xe799('0x13')]=function(){return function(){return ami[_0xe799('0x11')]({'action':_0xe799('0x14')});};};ami[_0xe799('0x15')]=function(){return function(){return ami[_0xe799('0x11')]({'action':'sippeerstatus'});};};ami[_0xe799('0x16')]=function(){return function(){return ami[_0xe799('0x11')]({'action':_0xe799('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xe799('0x11')]({'action':_0xe799('0x18')});};};function connect(_0x173666){logger[_0xe799('0x19')](util[_0xe799('0xd')](_0xe799('0x1a'),config[_0xe799('0x7')]['username'],config[_0xe799('0x7')]['ip'],config[_0xe799('0x7')][_0xe799('0x6')]));ami[_0xe799('0x1b')](_0xe799('0xc'),error);ami[_0xe799('0x1b')](_0xe799('0x1c'),close);}ami['on'](_0xe799('0x1d'),connect);ami['on'](_0xe799('0x1e'),function(_0x42792d){logger[_0xe799('0x19')](util[_0xe799('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xe799('0xf')],config[_0xe799('0x7')]['ip'],config[_0xe799('0x7')][_0xe799('0x6')],util['inspect'](_0x42792d,![],null)));});ami['on'](_0xe799('0x1f'),function(_0x463a8f){logger['info'](util[_0xe799('0xd')](_0xe799('0x20'),config[_0xe799('0x7')]['username'],config[_0xe799('0x7')]['ip'],config[_0xe799('0x7')][_0xe799('0x6')]));return BPromise[_0xe799('0x21')]()[_0xe799('0x22')](ami['actionSipShowRegistry']())['then'](ami[_0xe799('0x13')]())[_0xe799('0x22')](ami['actionSipPeerStatus']())[_0xe799('0x22')](ami[_0xe799('0x16')]())[_0xe799('0x22')](ami[_0xe799('0x23')]())[_0xe799('0x24')](function(_0x32460b){console[_0xe799('0x25')](_0x32460b);});});ami[_0xe799('0x1b')]('error',error);ami[_0xe799('0x1b')](_0xe799('0x1c'),close);module['exports']=ami; \ No newline at end of file +var _0x4530=['action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','format','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify'];(function(_0x4da196,_0x357dc9){var _0x375df3=function(_0x366603){while(--_0x366603){_0x4da196['push'](_0x4da196['shift']());}};_0x375df3(++_0x357dc9);}(_0x4530,0x19f));var _0x0453=function(_0x3e2230,_0x3c9704){_0x3e2230=_0x3e2230-0x0;var _0x53fcf5=_0x4530[_0x3e2230];return _0x53fcf5;};'use strict';var Manager=require(_0x0453('0x0'));var BPromise=require(_0x0453('0x1'));var moment=require(_0x0453('0x2'));var util=require(_0x0453('0x3'));var _=require(_0x0453('0x4'));var logger=require(_0x0453('0x5'))(_0x0453('0x6'));var config=require(_0x0453('0x7'));var ami=new Manager(config[_0x0453('0x8')][_0x0453('0x9')],config[_0x0453('0x8')]['ip'],config[_0x0453('0x8')][_0x0453('0xa')],config[_0x0453('0x8')][_0x0453('0xb')],!![]);ami['keepConnected']();ami[_0x0453('0xc')]=BPromise[_0x0453('0xd')](ami[_0x0453('0xe')]);function error(_0xb225ea){logger['error'](util['format'](_0x0453('0xf'),config[_0x0453('0x8')][_0x0453('0xa')],config['asterisk']['ip'],config['asterisk'][_0x0453('0x9')],util['inspect'](_0xb225ea,![],null)));}function close(){logger[_0x0453('0x10')](util['format'](_0x0453('0x11'),config[_0x0453('0x8')][_0x0453('0xa')],config[_0x0453('0x8')]['ip'],config[_0x0453('0x8')][_0x0453('0x9')]));}ami[_0x0453('0x12')]=function(){return function(){return ami[_0x0453('0xc')]({'action':'sipshowregistry'});};};ami[_0x0453('0x13')]=function(){return function(){return ami[_0x0453('0xc')]({'action':'devicestatelist'});};};ami[_0x0453('0x14')]=function(){return function(){return ami[_0x0453('0xc')]({'action':'sippeerstatus'});};};ami[_0x0453('0x15')]=function(){return function(){return ami[_0x0453('0xc')]({'action':_0x0453('0x16')});};};ami[_0x0453('0x17')]=function(){return function(){return ami[_0x0453('0xc')]({'action':_0x0453('0x18')});};};function connect(_0x119471){logger['info'](util['format'](_0x0453('0x19'),config['asterisk'][_0x0453('0xa')],config['asterisk']['ip'],config[_0x0453('0x8')][_0x0453('0x9')]));ami[_0x0453('0x1a')](_0x0453('0x10'),error);ami[_0x0453('0x1a')](_0x0453('0x1b'),close);}ami['on'](_0x0453('0x1c'),connect);ami['on'](_0x0453('0x1d'),function(_0x207125){logger[_0x0453('0x1e')](util[_0x0453('0x1f')](_0x0453('0x20'),config['asterisk']['username'],config[_0x0453('0x8')]['ip'],config[_0x0453('0x8')][_0x0453('0x9')],util[_0x0453('0x21')](_0x207125,![],null)));});ami['on'](_0x0453('0x22'),function(_0x203fda){logger['info'](util['format'](_0x0453('0x23'),config[_0x0453('0x8')][_0x0453('0xa')],config[_0x0453('0x8')]['ip'],config[_0x0453('0x8')]['port']));return BPromise['resolve']()[_0x0453('0x24')](ami['actionSipShowRegistry']())[_0x0453('0x24')](ami['actionDeviceStateList']())[_0x0453('0x24')](ami[_0x0453('0x14')]())[_0x0453('0x24')](ami['actionQueueSummary']())[_0x0453('0x24')](ami[_0x0453('0x17')]())[_0x0453('0x25')](function(_0x597702){console['log'](_0x597702);});});ami['once'](_0x0453('0x10'),error);ami[_0x0453('0x1a')](_0x0453('0x1b'),close);module[_0x0453('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 58277b2..984ebc8 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 _0xbc9c=['Request','request','then','debug','memberReport','error','rpc','message','bluebird','../../config/logger','ami','client','http'];(function(_0x9d29f5,_0x306876){var _0x4b950d=function(_0x2cc71d){while(--_0x2cc71d){_0x9d29f5['push'](_0x9d29f5['shift']());}};_0x4b950d(++_0x306876);}(_0xbc9c,0xf2));var _0xcbc9=function(_0x516997,_0x563e77){_0x516997=_0x516997-0x0;var _0x1d0185=_0xbc9c[_0x516997];return _0x1d0185;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xcbc9('0x0'));var logger=require(_0xcbc9('0x1'))(_0xcbc9('0x2'));var client=jayson[_0xcbc9('0x3')][_0xcbc9('0x4')]({'port':0x2329});client[_0xcbc9('0x5')]=function(_0x2fd3d3,_0x4bc233){return new BPromise(function(_0x12279b,_0x20297e){return client[_0xcbc9('0x6')](_0x2fd3d3,_0x4bc233)[_0xcbc9('0x7')](function(_0x1e4c51){logger[_0xcbc9('0x8')]('rpc',_0xcbc9('0x9'),_0x2fd3d3,_0x4bc233,_0x1e4c51);if(_0x1e4c51[_0xcbc9('0xa')]){logger['error'](_0xcbc9('0xb'),_0xcbc9('0x9'),_0x2fd3d3,_0x1e4c51[_0xcbc9('0xa')]['message'],_0x4bc233);return _0x20297e(_0x1e4c51[_0xcbc9('0xa')][_0xcbc9('0xc')]);}else{return _0x12279b(_0x1e4c51['result']);}})['catch'](function(_0xd28ae9){logger[_0xcbc9('0xa')](_0xcbc9('0xb'),_0xcbc9('0x9'),_0x2fd3d3,_0xd28ae9,_0x4bc233);return _0x20297e(_0xd28ae9);});});};module['exports']=client; \ No newline at end of file +var _0x99c6=['jayson/promise','bluebird','../../config/logger','ami','client','Request','debug','memberReport','error','rpc','message','result','catch','exports'];(function(_0x309575,_0x1bc464){var _0x340ef9=function(_0x3121fc){while(--_0x3121fc){_0x309575['push'](_0x309575['shift']());}};_0x340ef9(++_0x1bc464);}(_0x99c6,0x134));var _0x699c=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x99c6[_0x2db12b];return _0x20990b;};'use strict';var jayson=require(_0x699c('0x0'));var BPromise=require(_0x699c('0x1'));var logger=require(_0x699c('0x2'))(_0x699c('0x3'));var client=jayson[_0x699c('0x4')]['http']({'port':0x2329});client[_0x699c('0x5')]=function(_0x3c7bb5,_0x5a2325){return new BPromise(function(_0x3e9436,_0x2b85bf){return client['request'](_0x3c7bb5,_0x5a2325)['then'](function(_0xb1557b){logger[_0x699c('0x6')]('rpc',_0x699c('0x7'),_0x3c7bb5,_0x5a2325,_0xb1557b);if(_0xb1557b[_0x699c('0x8')]){logger['error'](_0x699c('0x9'),_0x699c('0x7'),_0x3c7bb5,_0xb1557b[_0x699c('0x8')][_0x699c('0xa')],_0x5a2325);return _0x2b85bf(_0xb1557b['error'][_0x699c('0xa')]);}else{return _0x3e9436(_0xb1557b[_0x699c('0xb')]);}})[_0x699c('0xc')](function(_0x25fade){logger[_0x699c('0x8')](_0x699c('0x9'),_0x699c('0x7'),_0x3c7bb5,_0x25fade,_0x5a2325);return _0x2b85bf(_0x25fade);});});};module[_0x699c('0xd')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 5f70dd6..2dc3394 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 _0x2722=['dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','voiceQueue','dialCutDigit','getQueue','queue','exports','util','lodash','moment','isNil','string','uniqueid','name','phone','Contact','firstName','lastName','number','active','type'];(function(_0x10f145,_0x369821){var _0x8893af=function(_0x16ba07){while(--_0x16ba07){_0x10f145['push'](_0x10f145['shift']());}};_0x8893af(++_0x369821);}(_0x2722,0x164));var _0x2272=function(_0x2eb85f,_0x26c164){_0x2eb85f=_0x2eb85f-0x0;var _0x5ad856=_0x2722[_0x2eb85f];return _0x5ad856;};'use strict';var util=require(_0x2272('0x0'));var _=require(_0x2272('0x1'));var moment=require(_0x2272('0x2'));function checkNameSurname(_0x392835,_0x178b6a,_0x526416){var _0x5532c9='';if(!_[_0x2272('0x3')](_0x178b6a)&&_0x2272('0x4')===typeof _0x178b6a){_0x5532c9+=_0x178b6a;}if(!_[_0x2272('0x3')](_0x526416)&&_0x2272('0x4')===typeof _0x526416){_0x5532c9+='\x20'+_0x526416;}if(_0x5532c9!==''){return _0x5532c9;}return _0x392835;}function Action(_0x358f45,_0x52270a,_0xbf7d38){this['voiceQueue']=_0x358f45;this[_0x2272('0x5')]=_0xbf7d38||undefined;this[_0x2272('0x6')]=checkNameSurname(_0x52270a['Contact'][_0x2272('0x7')],_0x52270a[_0x2272('0x8')][_0x2272('0x9')],_0x52270a[_0x2272('0x8')][_0x2272('0xa')]);this[_0x2272('0xb')]=_0x52270a['Contact'][_0x2272('0x7')];this['queue']=_0x358f45[_0x2272('0x6')];this[_0x2272('0xc')]=_0x52270a['active']||![];this['type']=_0x358f45[_0x2272('0xd')];this[_0x2272('0xe')]=_0x358f45['dialQueueTimeout']||0x3;this['scheduledat']=_0x52270a['scheduledat'];this[_0x2272('0xf')]=_0x52270a[_0x2272('0xf')];this[_0x2272('0x10')]=_0x52270a['countcongestionretry'];this[_0x2272('0x11')]=_0x52270a[_0x2272('0x11')];this[_0x2272('0x12')]=_0x52270a[_0x2272('0x12')];this[_0x2272('0x13')]=_0x52270a['ListId'];this[_0x2272('0x14')]=_0x52270a[_0x2272('0x14')];this['VoiceQueueId']=_0x52270a['VoiceQueueId'];this[_0x2272('0x15')]=_0x52270a[_0x2272('0x15')];this['idHopper']=_0x52270a['id'];this[_0x2272('0x16')]=_0x52270a[_0x2272('0x8')][_0x2272('0x9')]||'';this[_0x2272('0x17')]=moment()[_0x2272('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2272('0x19')]=_0x52270a[_0x2272('0x19')];this['callbackuniqueid']=_0x52270a[_0x2272('0x1a')];this['callbackat']=_0x52270a[_0x2272('0x1b')];this[_0x2272('0x1c')]=_0x52270a[_0x2272('0x1c')];this[_0x2272('0x1d')]='';this[_0x2272('0x1e')]='';}Action[_0x2272('0x1f')]['getCaller']=function(){return util[_0x2272('0x18')]('\x22%s\x22\x20<%s>',this[_0x2272('0x6')],this[_0x2272('0x20')][_0x2272('0x21')]>0x0?this[_0x2272('0xb')]['substring'](this[_0x2272('0x20')]['dialCutDigit']):this['number']);};Action[_0x2272('0x1f')][_0x2272('0x22')]=function(){return this[_0x2272('0x23')];};module[_0x2272('0x24')]=Action; \ No newline at end of file +var _0x4112=['prototype','getQueue','exports','util','lodash','moment','string','voiceQueue','name','Contact','phone','firstName','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','number'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4112,0x12b));var _0x2411=function(_0x2a3764,_0x3a7af4){_0x2a3764=_0x2a3764-0x0;var _0x1d191c=_0x4112[_0x2a3764];return _0x1d191c;};'use strict';var util=require(_0x2411('0x0'));var _=require(_0x2411('0x1'));var moment=require(_0x2411('0x2'));function checkNameSurname(_0x3dff95,_0x3058ef,_0x2b8a00){var _0x357017='';if(!_['isNil'](_0x3058ef)&&_0x2411('0x3')===typeof _0x3058ef){_0x357017+=_0x3058ef;}if(!_['isNil'](_0x2b8a00)&&_0x2411('0x3')===typeof _0x2b8a00){_0x357017+='\x20'+_0x2b8a00;}if(_0x357017!==''){return _0x357017;}return _0x3dff95;}function Action(_0x7f9b3b,_0x418ac7,_0x40d44a){this[_0x2411('0x4')]=_0x7f9b3b;this['uniqueid']=_0x40d44a||undefined;this[_0x2411('0x5')]=checkNameSurname(_0x418ac7[_0x2411('0x6')][_0x2411('0x7')],_0x418ac7[_0x2411('0x6')][_0x2411('0x8')],_0x418ac7[_0x2411('0x6')]['lastName']);this['number']=_0x418ac7[_0x2411('0x6')][_0x2411('0x7')];this[_0x2411('0x9')]=_0x7f9b3b[_0x2411('0x5')];this[_0x2411('0xa')]=_0x418ac7['active']||![];this['type']=_0x7f9b3b[_0x2411('0xb')];this['dialQueueTimeout']=_0x7f9b3b[_0x2411('0xc')]||0x3;this['scheduledat']=_0x418ac7['scheduledat'];this[_0x2411('0xd')]=_0x418ac7['countbusyretry'];this[_0x2411('0xe')]=_0x418ac7[_0x2411('0xe')];this[_0x2411('0xf')]=_0x418ac7[_0x2411('0xf')];this[_0x2411('0x10')]=_0x418ac7[_0x2411('0x10')];this[_0x2411('0x11')]=_0x418ac7[_0x2411('0x11')];this[_0x2411('0x12')]=_0x418ac7[_0x2411('0x12')];this[_0x2411('0x13')]=_0x418ac7[_0x2411('0x13')];this[_0x2411('0x14')]=_0x418ac7[_0x2411('0x14')];this[_0x2411('0x15')]=_0x418ac7['id'];this[_0x2411('0x16')]=_0x418ac7[_0x2411('0x6')]['firstName']||'';this[_0x2411('0x17')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x418ac7[_0x2411('0x18')];this[_0x2411('0x19')]=_0x418ac7[_0x2411('0x19')];this['callbackat']=_0x418ac7[_0x2411('0x1a')];this[_0x2411('0x1b')]=_0x418ac7[_0x2411('0x1b')];this[_0x2411('0x1c')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x2411('0x1d')](_0x2411('0x1e'),this[_0x2411('0x5')],this[_0x2411('0x4')][_0x2411('0x1f')]>0x0?this['number'][_0x2411('0x20')](this[_0x2411('0x4')]['dialCutDigit']):this[_0x2411('0x21')]);};Action[_0x2411('0x22')][_0x2411('0x23')]=function(){return this[_0x2411('0x9')];};module[_0x2411('0x24')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 9b5ba34..b2018c5 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 _0x036b=['starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','uniqueid','calleridname','name','calleridnum'];(function(_0x5805ee,_0x44dea5){var _0x506af5=function(_0x1d01c8){while(--_0x1d01c8){_0x5805ee['push'](_0x5805ee['shift']());}};_0x506af5(++_0x44dea5);}(_0x036b,0xe7));var _0xb036=function(_0x2a740c,_0x138a3f){_0x2a740c=_0x2a740c-0x0;var _0x1d663f=_0x036b[_0x2a740c];return _0x1d663f;};'use strict';var util=require(_0xb036('0x0'));var _=require(_0xb036('0x1'));var moment=require(_0xb036('0x2'));function getSeconds(_0x565988,_0x5198eb){var _0x3d0088=moment(_0x565988)[_0xb036('0x3')](0x0);var _0x266b47=moment(_0x5198eb)[_0xb036('0x3')](0x0);return _0x3d0088[_0xb036('0x4')](_0x266b47,_0xb036('0x5'));}function AgentComplete(_0x5ce982,_0x12e5bb){this[_0xb036('0x6')]=0x4;this['statedesc']=_0xb036('0x7');this[_0xb036('0x8')]=_0x5ce982[_0xb036('0x8')];this[_0xb036('0x9')]=_0x5ce982['type'];this[_0xb036('0xa')]=_0x5ce982[_0xb036('0x9')]===_0xb036('0xb')?_0xb036('0xc'):_0x5ce982['type'];this[_0xb036('0xd')]=_0x5ce982[_0xb036('0xd')];this[_0xb036('0xe')]=_0x5ce982[_0xb036('0xe')];this['countnoanswerretry']=_0x5ce982['countnoanswerretry'];this[_0xb036('0xf')]=_0x5ce982[_0xb036('0xd')]+_0x5ce982['countcongestionretry']+_0x5ce982[_0xb036('0x10')];this[_0xb036('0x11')]=_0x12e5bb[_0xb036('0x11')];this[_0xb036('0x12')]=_0x5ce982[_0xb036('0x13')];this[_0xb036('0x14')]=_0x5ce982['number'];this[_0xb036('0x15')]=_0x5ce982[_0xb036('0x15')];this['responsetime']=_0x5ce982[_0xb036('0x16')];this[_0xb036('0x17')]=_0x5ce982[_0xb036('0x17')];this[_0xb036('0x18')]=moment()[_0xb036('0x19')](_0xb036('0x1a'));this['ringtime']=getSeconds(_0x5ce982[_0xb036('0x16')],_0x5ce982[_0xb036('0x15')]);this[_0xb036('0x1b')]=getSeconds(_0x5ce982[_0xb036('0x17')],_0x5ce982[_0xb036('0x16')]);this[_0xb036('0x1c')]=getSeconds(this[_0xb036('0x18')],_0x5ce982['answertime']);this[_0xb036('0xc')]=_0x12e5bb[_0xb036('0xc')];this[_0xb036('0x1d')]=_0x12e5bb[_0xb036('0x1d')];this[_0xb036('0x1e')]=_0x12e5bb[_0xb036('0x1e')];this[_0xb036('0x1f')]=_0x5ce982[_0xb036('0x1f')];this[_0xb036('0x20')]=_0x5ce982[_0xb036('0x20')];this[_0xb036('0x21')]=_0x5ce982['callbackat'];this[_0xb036('0x22')]=_0x5ce982[_0xb036('0x22')];this[_0xb036('0x23')]=_0x5ce982[_0xb036('0x23')];this[_0xb036('0x24')]=_0x5ce982['ListId'];this[_0xb036('0x25')]=_0x5ce982['UserId'];this[_0xb036('0x26')]=_0x5ce982[_0xb036('0x26')];this[_0xb036('0x27')]=_0x5ce982[_0xb036('0x27')];this[_0xb036('0x28')]=_0x5ce982[_0xb036('0x28')]||'';this[_0xb036('0x29')]=_0x5ce982[_0xb036('0x29')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x782f=['seconds','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x782f,0x15c));var _0xf782=function(_0x567f08,_0x15b3c7){_0x567f08=_0x567f08-0x0;var _0x1bc601=_0x782f[_0x567f08];return _0x1bc601;};'use strict';var util=require(_0xf782('0x0'));var _=require('lodash');var moment=require(_0xf782('0x1'));function getSeconds(_0x341e77,_0x542919){var _0x3de491=moment(_0x341e77)[_0xf782('0x2')](0x0);var _0x267585=moment(_0x542919)[_0xf782('0x2')](0x0);return _0x3de491['diff'](_0x267585,_0xf782('0x3'));}function AgentComplete(_0x414cb5,_0x2683be){this['state']=0x4;this[_0xf782('0x4')]=_0xf782('0x5');this['scheduledat']=_0x414cb5[_0xf782('0x6')];this['type']=_0x414cb5[_0xf782('0x7')];this[_0xf782('0x8')]=_0x414cb5[_0xf782('0x7')]==='outbound'?_0xf782('0x9'):_0x414cb5['type'];this['countbusyretry']=_0x414cb5[_0xf782('0xa')];this[_0xf782('0xb')]=_0x414cb5[_0xf782('0xb')];this[_0xf782('0xc')]=_0x414cb5['countnoanswerretry'];this[_0xf782('0xd')]=_0x414cb5[_0xf782('0xa')]+_0x414cb5[_0xf782('0xb')]+_0x414cb5[_0xf782('0xc')];this[_0xf782('0xe')]=_0x2683be[_0xf782('0xe')];this[_0xf782('0xf')]=_0x414cb5[_0xf782('0x10')];this[_0xf782('0x11')]=_0x414cb5[_0xf782('0x12')];this[_0xf782('0x13')]=_0x414cb5[_0xf782('0x13')];this[_0xf782('0x14')]=_0x414cb5[_0xf782('0x14')];this[_0xf782('0x15')]=_0x414cb5[_0xf782('0x15')];this[_0xf782('0x16')]=moment()[_0xf782('0x17')](_0xf782('0x18'));this['ringtime']=getSeconds(_0x414cb5['responsetime'],_0x414cb5['starttime']);this[_0xf782('0x19')]=getSeconds(_0x414cb5[_0xf782('0x15')],_0x414cb5['responsetime']);this[_0xf782('0x1a')]=getSeconds(this['endtime'],_0x414cb5[_0xf782('0x15')]);this['queue']=_0x2683be[_0xf782('0x9')];this[_0xf782('0x1b')]=_0x2683be[_0xf782('0x1b')];this[_0xf782('0x1c')]=_0x2683be['reason'];this[_0xf782('0x1d')]=_0x414cb5[_0xf782('0x1d')];this['callbackuniqueid']=_0x414cb5['callbackuniqueid'];this['callbackat']=_0x414cb5['callbackat'];this[_0xf782('0x1e')]=_0x414cb5[_0xf782('0x1e')];this[_0xf782('0x1f')]=_0x414cb5[_0xf782('0x1f')];this[_0xf782('0x20')]=_0x414cb5[_0xf782('0x20')];this[_0xf782('0x21')]=_0x414cb5['UserId'];this['VoiceQueueId']=_0x414cb5[_0xf782('0x22')];this[_0xf782('0x23')]=_0x414cb5['CampaignId'];this[_0xf782('0x24')]=_0x414cb5[_0xf782('0x24')]||'';this[_0xf782('0x25')]=_0x414cb5['originatecalleridname']||'';}module[_0xf782('0x26')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index b0a80a7..a9881bb 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 _0x9536=['type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','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'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x9536,0x179));var _0x6953=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x9536[_0x10004e];return _0x5af990;};'use strict';var util=require(_0x6953('0x0'));var _=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));function getSeconds(_0x40b3c3,_0x4d218f){var _0xc3e4dd=moment(_0x40b3c3)['milliseconds'](0x0);var _0x42fb54=moment(_0x4d218f)[_0x6953('0x3')](0x0);return _0xc3e4dd[_0x6953('0x4')](_0x42fb54,_0x6953('0x5'));}function Final(_0x2f3cc3){this['uniqueid']=_0x2f3cc3[_0x6953('0x6')];this[_0x6953('0x7')]=_0x2f3cc3[_0x6953('0x7')];this[_0x6953('0x8')]=_0x2f3cc3[_0x6953('0x8')];this['campaigntype']=_0x2f3cc3[_0x6953('0x8')]===_0x6953('0x9')?_0x6953('0xa'):_0x2f3cc3['type'];this[_0x6953('0xb')]=_0x2f3cc3[_0x6953('0xb')];this[_0x6953('0xc')]=_0x2f3cc3[_0x6953('0xc')];this[_0x6953('0xd')]=_0x2f3cc3[_0x6953('0xd')];this[_0x6953('0xe')]=_0x2f3cc3[_0x6953('0xb')]+_0x2f3cc3[_0x6953('0xc')]+_0x2f3cc3['countnoanswerretry'];this[_0x6953('0xa')]=_0x2f3cc3['queue'];this[_0x6953('0xf')]=_0x2f3cc3[_0x6953('0xf')];this[_0x6953('0x10')]=_0x2f3cc3[_0x6953('0x10')];this[_0x6953('0x11')]=_0x2f3cc3[_0x6953('0x11')];this[_0x6953('0x12')]=_0x2f3cc3[_0x6953('0x12')];this[_0x6953('0x13')]=_0x2f3cc3[_0x6953('0x12')];this[_0x6953('0x14')]=_0x2f3cc3['ringtime']||0x0;this['holdtime']=_0x2f3cc3[_0x6953('0x15')]||0x0;this[_0x6953('0x16')]=_0x2f3cc3[_0x6953('0x16')]||0x0;this[_0x6953('0x17')]=_0x2f3cc3['callback'];this[_0x6953('0x18')]=_0x2f3cc3[_0x6953('0x18')];this['callbackat']=_0x2f3cc3[_0x6953('0x19')];this[_0x6953('0x1a')]=_0x2f3cc3[_0x6953('0x1a')];this[_0x6953('0x1b')]=_0x2f3cc3[_0x6953('0x1b')];this['ListId']=_0x2f3cc3[_0x6953('0x1c')];this[_0x6953('0x1d')]=_0x2f3cc3[_0x6953('0x1d')];this[_0x6953('0x1e')]=_0x2f3cc3[_0x6953('0x1e')];this['CampaignId']=_0x2f3cc3[_0x6953('0x1f')];this[_0x6953('0x20')]=_0x2f3cc3['originatecalleridnum']||'';this[_0x6953('0x21')]=_0x2f3cc3[_0x6953('0x21')]||'';}module[_0x6953('0x22')]=Final; \ No newline at end of file +var _0xdcd5=['util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports'];(function(_0x1bbe2f,_0x69592c){var _0xeed326=function(_0x378ac3){while(--_0x378ac3){_0x1bbe2f['push'](_0x1bbe2f['shift']());}};_0xeed326(++_0x69592c);}(_0xdcd5,0x110));var _0x5dcd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdcd5[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x5dcd('0x0'));var _=require(_0x5dcd('0x1'));var moment=require(_0x5dcd('0x2'));function getSeconds(_0x93a863,_0x21234e){var _0x30a610=moment(_0x93a863)[_0x5dcd('0x3')](0x0);var _0x5447ba=moment(_0x21234e)[_0x5dcd('0x3')](0x0);return _0x30a610[_0x5dcd('0x4')](_0x5447ba,_0x5dcd('0x5'));}function Final(_0x37fa3c){this[_0x5dcd('0x6')]=_0x37fa3c[_0x5dcd('0x6')];this[_0x5dcd('0x7')]=_0x37fa3c[_0x5dcd('0x7')];this['type']=_0x37fa3c['type'];this[_0x5dcd('0x8')]=_0x37fa3c[_0x5dcd('0x9')]===_0x5dcd('0xa')?'queue':_0x37fa3c[_0x5dcd('0x9')];this[_0x5dcd('0xb')]=_0x37fa3c[_0x5dcd('0xb')];this[_0x5dcd('0xc')]=_0x37fa3c[_0x5dcd('0xc')];this[_0x5dcd('0xd')]=_0x37fa3c[_0x5dcd('0xd')];this['countglobal']=_0x37fa3c['countbusyretry']+_0x37fa3c[_0x5dcd('0xc')]+_0x37fa3c[_0x5dcd('0xd')];this['queue']=_0x37fa3c[_0x5dcd('0xe')];this[_0x5dcd('0xf')]=_0x37fa3c[_0x5dcd('0xf')];this[_0x5dcd('0x10')]=_0x37fa3c[_0x5dcd('0x10')];this[_0x5dcd('0x11')]=_0x37fa3c[_0x5dcd('0x11')];this[_0x5dcd('0x12')]=_0x37fa3c['responsetime'];this[_0x5dcd('0x13')]=_0x37fa3c[_0x5dcd('0x12')];this['ringtime']=_0x37fa3c[_0x5dcd('0x14')]||0x0;this['holdtime']=_0x37fa3c[_0x5dcd('0x15')]||0x0;this[_0x5dcd('0x16')]=_0x37fa3c[_0x5dcd('0x16')]||0x0;this['callback']=_0x37fa3c[_0x5dcd('0x17')];this[_0x5dcd('0x18')]=_0x37fa3c[_0x5dcd('0x18')];this['callbackat']=_0x37fa3c[_0x5dcd('0x19')];this[_0x5dcd('0x1a')]=_0x37fa3c[_0x5dcd('0x1a')];this['ContactId']=_0x37fa3c[_0x5dcd('0x1b')];this[_0x5dcd('0x1c')]=_0x37fa3c[_0x5dcd('0x1c')];this[_0x5dcd('0x1d')]=_0x37fa3c['UserId'];this[_0x5dcd('0x1e')]=_0x37fa3c[_0x5dcd('0x1e')];this['CampaignId']=_0x37fa3c['CampaignId'];this[_0x5dcd('0x1f')]=_0x37fa3c[_0x5dcd('0x1f')]||'';this[_0x5dcd('0x20')]=_0x37fa3c[_0x5dcd('0x20')]||'';}module[_0x5dcd('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 09cf0e5..6712ca1 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(_0x3185ad,_0x5e5ca2){var _0x4f77fb=function(_0x435aca){while(--_0x435aca){_0x3185ad['push'](_0x3185ad['shift']());}};_0x4f77fb(++_0x5e5ca2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 _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(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 7dd2d4d..1e7ad51 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 _0xb6b7=['originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0xb6b7,0xe1));var _0x7b6b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb6b7[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x7b6b('0x0'));var _=require(_0x7b6b('0x1'));var moment=require(_0x7b6b('0x2'));function getSeconds(_0x442cd8,_0x22858f){var _0x2474fd=moment(_0x442cd8)[_0x7b6b('0x3')](0x0);var _0x5cfc5c=moment(_0x22858f)[_0x7b6b('0x3')](0x0);return _0x2474fd[_0x7b6b('0x4')](_0x5cfc5c,_0x7b6b('0x5'));}function History(_0x581411){this['uniqueid']=_0x581411[_0x7b6b('0x6')];this[_0x7b6b('0x7')]=_0x581411[_0x7b6b('0x7')]||undefined;this[_0x7b6b('0x8')]=_0x581411[_0x7b6b('0x8')];this[_0x7b6b('0x9')]=_0x581411['type']===_0x7b6b('0xa')?_0x7b6b('0xb'):_0x581411[_0x7b6b('0x8')];this['countbusyretry']=_0x581411[_0x7b6b('0xc')];this[_0x7b6b('0xd')]=_0x581411['countcongestionretry'];this['countnoanswerretry']=_0x581411[_0x7b6b('0xe')];this[_0x7b6b('0xf')]=_0x581411['countbusyretry']+_0x581411[_0x7b6b('0xd')]+_0x581411[_0x7b6b('0xe')];this[_0x7b6b('0xb')]=_0x581411[_0x7b6b('0xb')];this[_0x7b6b('0x10')]=_0x581411[_0x7b6b('0x11')];this[_0x7b6b('0x12')]=_0x581411[_0x7b6b('0x13')];this[_0x7b6b('0x14')]=_0x581411[_0x7b6b('0x14')];this[_0x7b6b('0x15')]=_0x581411[_0x7b6b('0x15')];this[_0x7b6b('0x16')]=_0x581411['responsetime'];this[_0x7b6b('0x17')]=getSeconds(_0x581411[_0x7b6b('0x15')],_0x581411[_0x7b6b('0x14')]);this['holdtime']=0x0;this[_0x7b6b('0x18')]=0x0;this[_0x7b6b('0x19')]=_0x581411['callback'];this[_0x7b6b('0x1a')]=_0x581411[_0x7b6b('0x1a')];this[_0x7b6b('0x1b')]=_0x581411[_0x7b6b('0x1b')];this[_0x7b6b('0x1c')]=_0x581411[_0x7b6b('0x1c')];this[_0x7b6b('0x1d')]=_0x581411[_0x7b6b('0x1d')];this[_0x7b6b('0x1e')]=_0x581411[_0x7b6b('0x1e')];this[_0x7b6b('0x1f')]=_0x581411[_0x7b6b('0x1f')];this[_0x7b6b('0x20')]=_0x581411[_0x7b6b('0x20')];this[_0x7b6b('0x21')]=_0x581411[_0x7b6b('0x21')];this['originatecalleridnum']=_0x581411[_0x7b6b('0x22')]||'';this[_0x7b6b('0x23')]=_0x581411[_0x7b6b('0x23')]||'';}module[_0x7b6b('0x24')]=History; \ No newline at end of file +var _0x8415=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','calleridnum','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','campaigntype'];(function(_0x1fd395,_0x3d732c){var _0x1450d7=function(_0x36cb2c){while(--_0x36cb2c){_0x1fd395['push'](_0x1fd395['shift']());}};_0x1450d7(++_0x3d732c);}(_0x8415,0x65));var _0x5841=function(_0x7f19cc,_0x58f11c){_0x7f19cc=_0x7f19cc-0x0;var _0x3bda15=_0x8415[_0x7f19cc];return _0x3bda15;};'use strict';var util=require(_0x5841('0x0'));var _=require(_0x5841('0x1'));var moment=require(_0x5841('0x2'));function getSeconds(_0x548c09,_0x38c2b9){var _0x352794=moment(_0x548c09)[_0x5841('0x3')](0x0);var _0x22cebb=moment(_0x38c2b9)[_0x5841('0x3')](0x0);return _0x352794[_0x5841('0x4')](_0x22cebb,_0x5841('0x5'));}function History(_0x276812){this[_0x5841('0x6')]=_0x276812['uniqueid'];this[_0x5841('0x7')]=_0x276812[_0x5841('0x7')]||undefined;this[_0x5841('0x8')]=_0x276812[_0x5841('0x8')];this[_0x5841('0x9')]=_0x276812['type']==='outbound'?_0x5841('0xa'):_0x276812[_0x5841('0x8')];this[_0x5841('0xb')]=_0x276812[_0x5841('0xb')];this[_0x5841('0xc')]=_0x276812['countcongestionretry'];this[_0x5841('0xd')]=_0x276812[_0x5841('0xd')];this[_0x5841('0xe')]=_0x276812[_0x5841('0xb')]+_0x276812[_0x5841('0xc')]+_0x276812[_0x5841('0xd')];this[_0x5841('0xa')]=_0x276812[_0x5841('0xa')];this[_0x5841('0xf')]=_0x276812[_0x5841('0x10')];this[_0x5841('0x11')]=_0x276812[_0x5841('0x12')];this[_0x5841('0x13')]=_0x276812[_0x5841('0x13')];this[_0x5841('0x14')]=_0x276812[_0x5841('0x14')];this[_0x5841('0x15')]=_0x276812['responsetime'];this[_0x5841('0x16')]=getSeconds(_0x276812[_0x5841('0x14')],_0x276812[_0x5841('0x13')]);this[_0x5841('0x17')]=0x0;this[_0x5841('0x18')]=0x0;this[_0x5841('0x19')]=_0x276812[_0x5841('0x19')];this[_0x5841('0x1a')]=_0x276812[_0x5841('0x1a')];this[_0x5841('0x1b')]=_0x276812[_0x5841('0x1b')];this[_0x5841('0x1c')]=_0x276812[_0x5841('0x1c')];this[_0x5841('0x1d')]=_0x276812['ContactId'];this[_0x5841('0x1e')]=_0x276812[_0x5841('0x1e')];this[_0x5841('0x1f')]=_0x276812[_0x5841('0x1f')];this[_0x5841('0x20')]=_0x276812[_0x5841('0x20')];this[_0x5841('0x21')]=_0x276812[_0x5841('0x21')];this[_0x5841('0x22')]=_0x276812[_0x5841('0x22')]||'';this[_0x5841('0x23')]=_0x276812[_0x5841('0x23')]||'';}module[_0x5841('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9205d78..ae77591 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 _0xb03e=['m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','busyFactor','\x20p\x20=\x20','\x20Umin\x20=\x20','Amax\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','message','NOT_ACTIVE','name','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','type','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalLowerLimit','originated','Trunk','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','predictiveIntervalTotalCalls','isUndefined','info','[checkGetDataPredictive][avgTalktime]','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][obj]','[ErlangB]','merge','diff','seconds','[freeVariablesPredictive]','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','hasOwnProperty','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','pick','ListId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','active','SIP/%s','reachable','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','membername','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','amd','saveInDb','[syncMachine][createHistory]','[syncMachine]','AMD','[syncHangupInAMDIvr]','Machine','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','Abandoned','CALLEREXIT','actions','actionid','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','ContactId','CampaignId','[unlock][syncQueueStatusComplete]','rrmemory','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','content','indexOf','true','command','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','dialPowerLevel','method\x20not\x20recognized','handleIvr','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','xcally-motion-dialer','from-sip','OriginateError','starttime','[originate][error]','originate\x20action\x20Error','response','[callProgressDetecting]\x20','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','minutes','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','checkRetriveMax','dialGlobalMaxRetry','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','stateGlobal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','predictive','dialPredictiveOptimizationPercentage','predictiveIntervalPauses','floor','erlangAbandonmentRate','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Date]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free','agent\x20max\x20free\x20','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','[startMethodPredictive][StartPredictive][First]','getDataPredictive','[averageHandleTime][ErlangB]\x20','[startMethodPredictive][StartPredictive][Repeat]','averageHandleTime','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','predictiveIntervalAnsweredCalls','check\x20failure','startMethodPredictive','erlangCallToSecond','[startMethodPredictive]','[startMethodPredictive][milliseconds]\x20','Failure\x20','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','[getContactCampaign2][Empty]','ivrTotalCallsDays','dialLimitQueue','not_inuse','getContactDialer','dialOrderByScheduledAt','RUNNING','Contact.phone','checkContactBlack','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[abandonmentRate]','\x20m\x20=\x20','\x20interval\x20=\x20','\x20Ts\x20=\x20','\x20Amax\x20=\x20'];(function(_0x415d59,_0x5549fc){var _0x3d0aaf=function(_0x520783){while(--_0x520783){_0x415d59['push'](_0x415d59['shift']());}};_0x3d0aaf(++_0x5549fc);}(_0xb03e,0x1eb));var _0xeb03=function(_0x3d6662,_0x486b0f){_0x3d6662=_0x3d6662-0x0;var _0x35cebf=_0xb03e[_0x3d6662];return _0x35cebf;};'use strict';var util=require('util');var _=require(_0xeb03('0x0'));var BPromise=require(_0xeb03('0x1'));var uuid=require(_0xeb03('0x2'));var moment=require(_0xeb03('0x3'));var rr=require('rr');var md5=require(_0xeb03('0x4'));var Redis=require(_0xeb03('0x5'));var config=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var loggerBooked=require(_0xeb03('0x7'))(_0xeb03('0x9'));var loggerPredictive=require(_0xeb03('0x7'))('predictive');var loggerPredictiveCalls=require(_0xeb03('0x7'))(_0xeb03('0xa'));var loggerSyncQueueSummary=require(_0xeb03('0x7'))(_0xeb03('0xb'));var ami=require(_0xeb03('0xc'));config[_0xeb03('0xd')]=_['defaults'](config[_0xeb03('0xd')],{'host':_0xeb03('0xe'),'port':0x18eb});var io=require(_0xeb03('0xf'))(new Redis(config['redis']));var cmHopper=require(_0xeb03('0x10'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xeb03('0x11'));var cmHopperBlack=require(_0xeb03('0x12'));var voiceQueueRt=require(_0xeb03('0x13'));var Action=require(_0xeb03('0x14'));var History=require(_0xeb03('0x15'));var Final=require(_0xeb03('0x16'));var AgentComplete=require(_0xeb03('0x17'));var QueueCallerAbandon=require(_0xeb03('0x18'));var Hangup=require(_0xeb03('0x19'));var ipAgi=process[_0xeb03('0x1a')][_0xeb03('0x1b')]||_0xeb03('0x1c');var strategy={'rrmemory':'rrmemory','roundrobin':_0xeb03('0x1d')};var Sequence=function(){};Sequence[_0xeb03('0x1e')][_0xeb03('0x1f')]=function(_0x33f9ba){this['tail']=this[_0xeb03('0x20')]?this[_0xeb03('0x20')][_0xeb03('0x21')](_0x33f9ba):_0x33f9ba();};function Dialer(_0x478989,_0x7ce874){this[_0xeb03('0x22')]=new Sequence();this[_0xeb03('0x23')]=_0x7ce874;this[_0xeb03('0x24')]=_0x478989[_0xeb03('0x24')];this[_0xeb03('0x25')]=_0x478989[_0xeb03('0x25')];this[_0xeb03('0x26')]=_0x478989[_0xeb03('0x26')];this[_0xeb03('0x27')]=_0x478989[_0xeb03('0x27')];this[_0xeb03('0x28')]=config[_0xeb03('0x28')]||0x2;this[_0xeb03('0x29')]={};this['actions']={};this[_0xeb03('0x2a')]={};this[_0xeb03('0x2b')]={};this[_0xeb03('0x2c')]={};this[_0xeb03('0x2d')]={};this[_0xeb03('0x2e')]={};this[_0xeb03('0x2f')]={};this[_0xeb03('0x30')]={};this[_0xeb03('0x31')]={};ami['on'](_0xeb03('0x32'),this['syncAgentConnect'][_0xeb03('0x33')](this));ami['on'](_0xeb03('0x34'),this[_0xeb03('0x35')][_0xeb03('0x33')](this));ami['on'](_0xeb03('0x36'),this['syncOriginateResponse'][_0xeb03('0x33')](this));ami['on'](_0xeb03('0x37'),this[_0xeb03('0x38')][_0xeb03('0x33')](this));ami['on'](_0xeb03('0x39'),this[_0xeb03('0xb')][_0xeb03('0x33')](this));ami['on'](_0xeb03('0x3a'),this[_0xeb03('0x3b')]['bind'](this));ami['on'](_0xeb03('0x3c'),this[_0xeb03('0x3d')][_0xeb03('0x33')](this));ami['on'](_0xeb03('0x3e'),this['syncVarSet']['bind'](this));ami['on'](_0xeb03('0x3f'),this['syncQueueMember'][_0xeb03('0x33')](this));ami['on'](_0xeb03('0x40'),this[_0xeb03('0x41')]['bind'](this));this[_0xeb03('0x42')]();this['loopClearZombieChannels']();}function isNotNull(_0x5cb729){return _0x5cb729!==null&&!_['isUndefined'](_0x5cb729);}function checkIsLoggedIn(_0x538d19,_0x421a27){return function(){if(_0x421a27<=0x0){_0x538d19[_0xeb03('0x43')]='AGENTS_NOT_LOGGED';throw _0x538d19['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x47f7d8){return _0x47f7d8;}function checkIsActive(_0x1e8009,_0x3655c3){return function(){if(!isActive(_0x3655c3)){_0x1e8009[_0xeb03('0x43')]=_0xeb03('0x44');throw _0x1e8009[_0xeb03('0x45')]+'\x20NOT\x20Active';}};}function checkInterval(_0x13efc6){return function(){if(!isNotNull(_0x13efc6['Interval'])){_0x13efc6[_0xeb03('0x43')]=_0xeb03('0x46');throw _0x13efc6[_0xeb03('0x45')]+_0xeb03('0x47');}if(!isNotNull(_0x13efc6[_0xeb03('0x48')][_0xeb03('0x49')])){_0x13efc6[_0xeb03('0x43')]=_0xeb03('0x46');throw _0x13efc6['name']+_0xeb03('0x47');}if(!isNotNull(_['isEmpty'](_0x13efc6[_0xeb03('0x48')][_0xeb03('0x49')]))){_0x13efc6[_0xeb03('0x43')]=_0xeb03('0x46');throw _0x13efc6[_0xeb03('0x45')]+_0xeb03('0x47');}};}function msgResponse(_0x5a3915,_0x155b53,_0x4bfd68){return{'action':_0x5a3915,'response':_0x155b53,'message':_0x4bfd68};}function myreject(_0x585cb5){return function(_0x4c61e4){return _0x585cb5(msgResponse(_0xeb03('0x4a'),_0xeb03('0x4b'),JSON[_0xeb03('0x4c')](_0x4c61e4)));};}function getSeconds(_0x72f8bf,_0x2a9e6b){var _0x575ef1=moment(_0x72f8bf)[_0xeb03('0x4d')](0x0);var _0x166562=moment(_0x2a9e6b)[_0xeb03('0x4d')](0x0);return _0x575ef1['diff'](_0x166562,'seconds');}function emit(_0xac05c4,_0x27e61f,_0x47118d){io['to'](_0xac05c4)['emit'](_0x27e61f,_0x47118d);}function emitVoiceQueueSummary(_0x328f72){if(_0x328f72[_0xeb03('0x4e')]==='outbound'){var _0x49edb3={'id':_0x328f72['id'],'name':_0x328f72[_0xeb03('0x45')],'strategy':_0x328f72[_0xeb03('0x4f')],'answered':_0x328f72['answered'],'available':_0x328f72[_0xeb03('0x50')],'loggedIn':_0x328f72[_0xeb03('0x51')],'pTalking':_0x328f72[_0xeb03('0x52')],'sumBillable':_0x328f72[_0xeb03('0x53')],'sumDuration':_0x328f72[_0xeb03('0x54')],'sumHoldTime':_0x328f72[_0xeb03('0x55')]||0x0,'talking':_0x328f72[_0xeb03('0x56')],'total':_0x328f72[_0xeb03('0x57')],'type':_0x328f72[_0xeb03('0x4e')],'unmanaged':_0x328f72[_0xeb03('0x58')],'abandoned':_0x328f72[_0xeb03('0x59')],'waiting':_0x328f72[_0xeb03('0x5a')],'loggedInDb':_0x328f72[_0xeb03('0x5b')],'dialActive':_0x328f72[_0xeb03('0x5c')],'dialMethod':_0x328f72[_0xeb03('0x5d')],'dialOriginateCallerIdName':_0x328f72[_0xeb03('0x5e')],'dialOriginateCallerIdNumber':_0x328f72[_0xeb03('0x5f')],'dialOriginateTimeout':_0x328f72[_0xeb03('0x60')],'dialPrefix':_0x328f72[_0xeb03('0x61')],'outboundAnswerAgiCallsDay':_0x328f72[_0xeb03('0x62')],'outboundAnswerCallsDay':_0x328f72[_0xeb03('0x63')],'outboundBlacklistCallsDay':_0x328f72[_0xeb03('0x64')],'outboundBusyCallsDay':_0x328f72[_0xeb03('0x65')],'outboundCongestionCallsDay':_0x328f72['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x328f72['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x328f72[_0xeb03('0x66')],'outboundDropCallsDayTimeout':_0x328f72[_0xeb03('0x67')],'outboundNoAnswerCallsDay':_0x328f72[_0xeb03('0x68')],'outboundNoSuchCallsDay':_0x328f72[_0xeb03('0x69')],'outboundOriginateFailureCallsDay':_0x328f72[_0xeb03('0x6a')],'outboundReCallsDay':_0x328f72[_0xeb03('0x6b')],'outboundRejectCallsDay':_0x328f72[_0xeb03('0x6c')],'outboundUnknownCallsDay':_0x328f72[_0xeb03('0x6d')],'predictiveIntervalAnsweredCalls':_0x328f72['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x328f72[_0xeb03('0x6e')],'predictiveIntervalAvgTalktime':_0x328f72[_0xeb03('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0x328f72[_0xeb03('0x70')],'predictiveIntervalDroppedCallsTimeout':_0x328f72[_0xeb03('0x71')],'predictiveIntervalErlangCalls':_0x328f72[_0xeb03('0x72')],'predictiveIntervalErlangCallsDroppedCalls':_0x328f72['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x328f72['predictiveIntervalHitRate'],'predictiveIntervalLowerLimit':_0x328f72[_0xeb03('0x73')],'predictiveIntervalMultiplicativeFactor':_0x328f72['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x328f72['predictiveIntervalPauses'],'predictiveIntervalTotalCalls':_0x328f72['predictiveIntervalTotalCalls'],'message':_0x328f72[_0xeb03('0x43')],'originated':_0x328f72[_0xeb03('0x74')]};if(_0x328f72[_0xeb03('0x75')]){_0x49edb3[_0xeb03('0x75')]={'id':_0x328f72[_0xeb03('0x75')]['id'],'name':_0x328f72[_0xeb03('0x75')]['name'],'active':_0x328f72[_0xeb03('0x75')]['active'],'callerid':_0x328f72['Trunk'][_0xeb03('0x76')]};}if(_0x328f72[_0xeb03('0x48')]){_0x49edb3[_0xeb03('0x48')]={'id':_0x328f72['Interval']['id'],'name':_0x328f72[_0xeb03('0x48')][_0xeb03('0x45')]};}var _0x351055=md5(JSON[_0xeb03('0x4c')](_0x49edb3));if(_0x328f72[_0xeb03('0x4')]!==_0x351055){_0x328f72['md5']=_0x351055;emit(util[_0xeb03('0x77')]('voice:queue:%s',_0x49edb3[_0xeb03('0x45')]),_0xeb03('0x78'),_0x49edb3);}}}function emitCampaignSummary(_0x14f1d0){if(_0x14f1d0[_0xeb03('0x4e')]===_0xeb03('0x79')){emit(util[_0xeb03('0x77')](_0xeb03('0x7a'),_0x14f1d0[_0xeb03('0x45')]),_0xeb03('0x7b'),_0x14f1d0);}}function checkGetDataPredictive(_0x2fe435){if(isNotNull(_0x2fe435)){if(!_[_0xeb03('0x7c')](_0x2fe435)){if(_0x2fe435[_0xeb03('0x7d')]>0x0){if(!_[_0xeb03('0x7e')](_0x2fe435[_0xeb03('0x6f')])&&_0x2fe435[_0xeb03('0x6f')]>0x0){return!![];}else{loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x80'),JSON[_0xeb03('0x4c')](_0x2fe435));}if(!_[_0xeb03('0x7e')](_0x2fe435[_0xeb03('0x6e')])&&_0x2fe435[_0xeb03('0x6e')]>0x0){return!![];}else{loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x81'),JSON[_0xeb03('0x4c')](_0x2fe435));}}else{loggerPredictive['info'](_0xeb03('0x82'),JSON[_0xeb03('0x4c')](_0x2fe435));}}else{loggerPredictive[_0xeb03('0x7f')]('[checkGetDataPredictive][objIsEmpty]',JSON[_0xeb03('0x4c')](_0x2fe435));}}else{loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x83'),JSON[_0xeb03('0x4c')](_0x2fe435));}return![];}function mergeDataErlangB(_0x103da5){return function(_0x68d263){loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x84'),JSON[_0xeb03('0x4c')](_0x68d263));_[_0xeb03('0x85')](_0x103da5,_0x68d263);};}function getDiff(_0x46f52e){var _0x25de1f=moment()[_0xeb03('0x4d')](0x0);var _0xd4ecb3=moment(_0x46f52e)['milliseconds'](0x0);return _0x25de1f[_0xeb03('0x86')](_0xd4ecb3,_0xeb03('0x87'));}function ifInterval(_0x379cd0,_0x259db7){if(_[_0xeb03('0x7e')](_0x259db7)){return![];}if(getDiff(_0x259db7)<_0x379cd0*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x39e2c7){if(isNotNull(_0x39e2c7)){if(!_[_0xeb03('0x7e')](_0x39e2c7[_0xeb03('0x2e')])){_0x39e2c7[_0xeb03('0x2e')]=undefined;loggerPredictive[_0xeb03('0x7f')]('[freeVariablesPredictive]',_0xeb03('0x2e'),_0x39e2c7[_0xeb03('0x45')]);}if(!_[_0xeb03('0x7e')](_0x39e2c7[_0xeb03('0x2d')])){_0x39e2c7['startPredictive']=undefined;loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x88'),_0xeb03('0x2d'),_0x39e2c7[_0xeb03('0x45')]);}if(!_[_0xeb03('0x7e')](_0x39e2c7['handlePredictive'])){clearInterval(_0x39e2c7[_0xeb03('0x89')]);_0x39e2c7[_0xeb03('0x89')]=undefined;loggerPredictive[_0xeb03('0x7f')]('[freeVariablesPredictive]',_0xeb03('0x89'),_0x39e2c7[_0xeb03('0x45')]);}}}function erlangb(_0x4d9cfc,_0x1f6117){if(_0x1f6117===0x0){return 0x0;}var _0x3102e3=0x1;for(var _0x3750f1=0x1;_0x3750f1<=_0x1f6117;_0x3750f1+=0x1){_0x3102e3=0x1+_0x3102e3*_0x3750f1/_0x4d9cfc;}return 0x1/_0x3102e3;}function isVoiceQueueOutbound(_0x5693cf){return _0x5693cf===_0xeb03('0x8a');}function isNotPreview(_0x440f04){return _0x440f04!=='preview';}function isCampaignIvr(_0x3eb482){return _0x3eb482===_0xeb03('0x79');}function getCallerId(_0x1972fb,_0x3ac2de,_0x3963a7){if(!_[_0xeb03('0x7e')](_0x3963a7)&&_0xeb03('0x8b')===typeof _0x3963a7&&!_[_0xeb03('0x7c')](_0x3963a7)){if(!_['isUndefined'](_0x3ac2de)&&_0xeb03('0x8b')===typeof _0x3ac2de&&!_['isEmpty'](_0x3ac2de)){return util[_0xeb03('0x77')](_0xeb03('0x8c'),_0x3ac2de,_0x3963a7);}return util[_0xeb03('0x77')]('\x22%s\x22\x20<%s>',_0x3963a7,_0x3963a7);}if(!_[_0xeb03('0x7e')](_0x1972fb)&&_0xeb03('0x8b')===typeof _0x1972fb&&!_[_0xeb03('0x7c')](_0x1972fb)){return _0x1972fb;}return _0xeb03('0x8d');}function loggerCatchQueueSummary(_0x47c389,_0x3fe855){return function(_0x1cdf8e){freeVariablesPredictive(_0x3fe855);emitVoiceQueueSummary(_0x3fe855);emitCampaignSummary(_0x3fe855);loggerSyncQueueSummary['error'](_0x47c389,util['inspect'](_0x1cdf8e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x583518,_0x24ece0){return function(_0x1ad3b7){loggerPredictive[_0xeb03('0x8e')](_0x583518,JSON[_0xeb03('0x4c')](_0x1ad3b7));freeVariablesPredictive(_0x24ece0);};}function loggerCatch(_0x3da5f4){return function(_0x461777){logger[_0xeb03('0x8e')](_0x3da5f4,util[_0xeb03('0x8f')](_0x461777,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2c78dd){return _0x2c78dd&&!_['isUndefined'](_0x2c78dd)&&_0x2c78dd['length']>0x0;}function decremetOriginate(_0x43bc8f){if(!_[_0xeb03('0x7e')](_0x43bc8f)&&_0x43bc8f!==null){if(_0x43bc8f['hasOwnProperty'](_0xeb03('0x74'))){if(_0x43bc8f[_0xeb03('0x74')]>0x0){_0x43bc8f[_0xeb03('0x74')]-=0x1;}else{logger[_0xeb03('0x8e')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0xeb03('0x90'));}}function checkContactLowerLimitOriginate(_0x3c404d,_0x17f135,_0x50c482){if(_0x17f135>_0x50c482){for(var _0x34dd41=0x0;_0x34dd41<_0x17f135-_0x50c482;_0x34dd41+=0x1){decremetOriginate(_0x3c404d);}}}function loggerGetContactDialer(_0x3fe121,_0x1a8057,_0x2ee5c1){return function(_0x2e67a4){checkContactLowerLimitOriginate(_0x1a8057,_0x2ee5c1,0x0);logger[_0xeb03('0x8e')](_0x3fe121,util[_0xeb03('0x8f')](_0x2e67a4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x53b7ac){return function(_0x5113fd){if(isNotNull(_0x5113fd)&&isNotNull(_0x5113fd[0x0])){if(_0x5113fd[0x0][_0xeb03('0x91')]>0x0){_0x53b7ac['message']=_0xeb03('0x92');logger['info'](_0xeb03('0x93')+_0x53b7ac['name'],_0x5113fd[0x0][_0xeb03('0x91')],_0xeb03('0x94'));}else{_0x53b7ac['message']=_0xeb03('0x95');logger['info'](_0xeb03('0x96')+_0x53b7ac['name']);}}};}function notSendMessagesQueue(_0x375d5c){if(_0x375d5c['sendMessageOneNotActive']){freeVariablesPredictive(_0x375d5c);if(_0x375d5c['originated']===0x0&&_0x375d5c[_0xeb03('0x56')]===0x0&&_0x375d5c[_0xeb03('0x5a')]===0x0&&(_0x375d5c[_0xeb03('0x52')]||0x0)===0x0){_0x375d5c[_0xeb03('0x97')]=![];_0x375d5c[_0xeb03('0x50')]=0x0;_0x375d5c[_0xeb03('0x43')]=_0xeb03('0x44');loggerSyncQueueSummary['error'](_0xeb03('0x98'),_0x375d5c[_0xeb03('0x45')],_0xeb03('0x99'));}else{_0x375d5c[_0xeb03('0x43')]=_0xeb03('0x9a');loggerSyncQueueSummary[_0xeb03('0x8e')](_0xeb03('0x98'),_0x375d5c['name'],_0xeb03('0x9b'));}emitVoiceQueueSummary(_0x375d5c);}}function notSendMessagesCampaign(_0x24ddeb){if(_0x24ddeb[_0xeb03('0x97')]){if(_0x24ddeb[_0xeb03('0x74')]===0x0){_0x24ddeb[_0xeb03('0x97')]=![];_0x24ddeb[_0xeb03('0x43')]=_0xeb03('0x44');loggerSyncQueueSummary[_0xeb03('0x8e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x24ddeb[_0xeb03('0x45')],_0xeb03('0x99'));}else{_0x24ddeb[_0xeb03('0x43')]=_0xeb03('0x9a');loggerSyncQueueSummary[_0xeb03('0x8e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x24ddeb[_0xeb03('0x45')],_0xeb03('0x9b'));}emitCampaignSummary(_0x24ddeb);}}function createObjHistory(_0x25226e,_0x2d4767,_0x14a886,_0xdf980d,_0x39ec6e){_0x25226e['message']=_0x14a886;var _0x52b2c=new Action(_0x25226e,_0x2d4767);var _0x2db86b=new History(_0x52b2c);_0x2db86b[_0xeb03('0x9c')]=_0xdf980d;_0x2db86b[_0xeb03('0x9d')]=_0x39ec6e;_0x2db86b[_0xeb03('0x9e')]=_0x52b2c['starttime'];return _0x2db86b;}Dialer[_0xeb03('0x1e')][_0xeb03('0x9f')]=function(){var _0xfc8ac5=this;setInterval(function(){_0xfc8ac5[_0xeb03('0xa0')](_0xfc8ac5[_0xeb03('0x2b')],_0xeb03('0xa1'));_0xfc8ac5[_0xeb03('0xa0')](_0xfc8ac5['actions'],_0xeb03('0xa2'));},0x32c8);};Dialer[_0xeb03('0x1e')][_0xeb03('0xa0')]=function(_0x433780,_0x33b5f7){var _0x388fbd=this;for(var _0x5e3318 in _0x433780){if(_0x433780[_0xeb03('0xa3')](_0x5e3318)){this[_0xeb03('0x22')][_0xeb03('0x1f')](function(){if(!_['isNil'](_0x433780[_0x5e3318])){return ami[_0xeb03('0xa4')]({'action':_0xeb03('0xa5'),'channel':_0x433780[_0x5e3318][_0xeb03('0xa6')]})[_0xeb03('0xa7')](function(_0x291c43){if(_0x291c43[_0xeb03('0x43')]===_0xeb03('0xa8')){setTimeout(function(){if(_0x433780[_0x5e3318]&&_0x433780[_0x5e3318]['type']!=='ivr'){_0x388fbd[_0xeb03('0xa9')](_0x388fbd[_0xeb03('0x24')][_0x433780[_0x5e3318][_0xeb03('0xaa')]]);logger[_0xeb03('0x8e')]('[Dialer][checkChannel]',_0x33b5f7,_0x5e3318,_0x433780[_0x5e3318][_0xeb03('0xaa')]);delete _0x433780[_0x5e3318];}if(_0x433780[_0x5e3318]&&_0x433780[_0x5e3318][_0xeb03('0x4e')]==='ivr'){_0x388fbd[_0xeb03('0xa9')](_0x388fbd[_0xeb03('0x25')][_0x433780[_0x5e3318][_0xeb03('0xaa')]]);logger[_0xeb03('0x8e')](_0xeb03('0xab'),_0x33b5f7,_0x5e3318,_0x433780[_0x5e3318][_0xeb03('0xaa')]);delete _0x433780[_0x5e3318];}},0x2328);}});}});}}};Dialer['prototype'][_0xeb03('0xac')]=function(_0x1dd965){return BPromise[_0xeb03('0xad')]()[_0xeb03('0xae')](cmHopper[_0xeb03('0xac')](_0x1dd965))[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xaf')));};Dialer[_0xeb03('0x1e')][_0xeb03('0xb0')]=function(_0x3fd8c9){return BPromise['resolve']()[_0xeb03('0xae')](cmHopperBlack[_0xeb03('0xb0')](_0x3fd8c9))['catch'](loggerCatch(_0xeb03('0xb1')));};Dialer[_0xeb03('0x1e')]['checkIsBlackListIvr']=function(_0x2c60bd){return BPromise[_0xeb03('0xad')]()[_0xeb03('0xae')](cmHopperBlack[_0xeb03('0xb2')](_0x2c60bd))[_0xeb03('0xa7')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype']['averageHandleTime']=function(_0x3cead5){return BPromise['resolve']()[_0xeb03('0xae')](cmHopperHistory[_0xeb03('0xb3')](_0x3cead5))[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xb4')));};Dialer[_0xeb03('0x1e')][_0xeb03('0xb5')]=function(_0x1d46e7){return BPromise[_0xeb03('0xad')]()[_0xeb03('0xae')](cmHopper[_0xeb03('0xb5')](_0x1d46e7))[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xb6')));};Dialer['prototype']['getContactDialer']=function(_0x6b47e9,_0x5ea58f,_0x5d5962,_0x432577){return BPromise[_0xeb03('0xad')]()['then'](cmHopper['getContactDialer'](_0x6b47e9,_0x5ea58f,_0x5d5962,_0x432577))[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xb7')));};Dialer['prototype'][_0xeb03('0xb8')]=function(_0x30416a,_0x2efed6,_0x1d4e93){return BPromise[_0xeb03('0xad')]()['then'](cmHopper[_0xeb03('0xb8')](_0x30416a,_0x2efed6,_0x1d4e93))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xeb03('0x1e')][_0xeb03('0xb9')]=function(_0x521fea){return BPromise[_0xeb03('0xad')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x521fea))[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xba')));};Dialer[_0xeb03('0x1e')][_0xeb03('0xbb')]=function(_0x388642){return BPromise[_0xeb03('0xad')]()[_0xeb03('0xae')](cmHopper[_0xeb03('0xbb')](_0x388642))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xeb03('0x1e')]['createHistory']=function(_0x54c48b){return BPromise['resolve']()[_0xeb03('0xae')](cmHopperHistory[_0xeb03('0xbc')](_0x54c48b))[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xbd')));};Dialer[_0xeb03('0x1e')][_0xeb03('0xa9')]=function(_0x3c7766){if(!_[_0xeb03('0x7e')](_0x3c7766)&&_0x3c7766!==null){if(_0x3c7766['hasOwnProperty']('originated')){if(_0x3c7766[_0xeb03('0x74')]>0x0){_0x3c7766[_0xeb03('0x74')]-=0x1;}else{logger[_0xeb03('0x8e')](_0xeb03('0xbe'));}}}else{logger[_0xeb03('0x8e')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xeb03('0x1e')][_0xeb03('0xbf')]=function(_0x5a6f75,_0x1bba4a){var _0x3015b1=this;return function(_0x43105){_0x3015b1[_0xeb03('0xa9')](_0x1bba4a);logger[_0xeb03('0x8e')](_0x5a6f75,util[_0xeb03('0x8f')](_0x43105,{'showHidden':![],'depth':null}));};};Dialer[_0xeb03('0x1e')][_0xeb03('0xc0')]=function(_0x31dd49,_0x2ec6bb,_0x42ec33){var _0x2d8d4e={'state':0x19,'statedesc':_0xeb03('0xc1')};this[_0xeb03('0xa9')](_0x2ec6bb);this['saveInDb'](_[_0xeb03('0x85')](_0x2d8d4e,_[_0xeb03('0xc2')](_0x42ec33,['ContactId',_0xeb03('0xc3'),'UserId',_0xeb03('0xc4'),'CampaignId'])),_0xeb03('0xc5'),_0xeb03('0xc6'));logger[_0xeb03('0x8e')](_0x31dd49);};Dialer[_0xeb03('0x1e')][_0xeb03('0xc7')]=function(_0x2b126f){return _0x2b126f===_0xeb03('0xc8');};Dialer[_0xeb03('0x1e')]['isTrunkReachable']=function(_0x1b428e){return!_[_0xeb03('0x7e')](_0x1b428e)&&_0x1b428e&&!_[_0xeb03('0x7e')](_0x1b428e[_0xeb03('0x45')])&&!_['isUndefined'](_0x1b428e[_0xeb03('0xc9')])&&_0x1b428e['active']&&(this[_0xeb03('0x27')][util[_0xeb03('0x77')](_0xeb03('0xca'),_0x1b428e[_0xeb03('0x45')])]['status']===_0xeb03('0xcb')||this[_0xeb03('0x27')][util[_0xeb03('0x77')](_0xeb03('0xca'),_0x1b428e['name'])][_0xeb03('0xa5')]==='unmonitored');};Dialer[_0xeb03('0x1e')]['saveInDb']=function(_0x31a12d,_0x5c47e9,_0x2161cf){this[_0xeb03('0xbc')](_0x31a12d)[_0xeb03('0xa7')](loggerCatch(_0x5c47e9));this['moveContactManagedDialer'](_0x31a12d)['catch'](loggerCatch(_0x2161cf));};Dialer['prototype']['syncVarSet']=function(_0x5c7f6e){var _0x2cd43f=this[_0xeb03('0x2b')][_0x5c7f6e[_0xeb03('0xcc')]];var _0x3f58d3;if(!_[_0xeb03('0xcd')](_0x5c7f6e)&&!_[_0xeb03('0xcd')](_0x5c7f6e['variable'])&&!_[_0xeb03('0xcd')](_0x5c7f6e[_0xeb03('0xce')][_0xeb03('0xcf')])&&_0x5c7f6e[_0xeb03('0xd0')]==='xcally-motion-dialer'&&_0x2cd43f){if(_0x2cd43f['type']!==_0xeb03('0x79')&&this[_0xeb03('0x24')][_0x2cd43f['queue']][_0xeb03('0xd1')]&&_0x5c7f6e[_0xeb03('0xd2')]===_0xeb03('0xd3')){delete this[_0xeb03('0x2b')][_0x5c7f6e[_0xeb03('0xcc')]];this[_0xeb03('0xa9')](this[_0xeb03('0x24')][_0x2cd43f['queue']]);this[_0xeb03('0x24')][_0x2cd43f[_0xeb03('0xaa')]][_0xeb03('0x63')]+=0x1;this[_0xeb03('0x24')][_0x2cd43f[_0xeb03('0xaa')]][_0xeb03('0x62')]+=0x1;_0x3f58d3=new Hangup(_0x2cd43f,_0x5c7f6e);_0x3f58d3[_0xeb03('0x9c')]=0x12;_0x3f58d3[_0xeb03('0x9d')]='HangupInAMD';_0x3f58d3[_0xeb03('0xd4')]='AMD';this['saveInDb'](_0x3f58d3,_0xeb03('0xd5'),_0xeb03('0xd6'));}if(_0x2cd43f['type']!==_0xeb03('0x79')&&this['voiceQueues'][_0x2cd43f[_0xeb03('0xaa')]]['dialAMDActive']&&_0x5c7f6e[_0xeb03('0xd2')]===_0xeb03('0xd7')){delete this[_0xeb03('0x2b')][_0x5c7f6e[_0xeb03('0xcc')]];this[_0xeb03('0xa9')](this['voiceQueues'][_0x2cd43f[_0xeb03('0xaa')]]);this[_0xeb03('0x24')][_0x2cd43f[_0xeb03('0xaa')]][_0xeb03('0x63')]+=0x1;this[_0xeb03('0x24')][_0x2cd43f[_0xeb03('0xaa')]][_0xeb03('0x62')]+=0x1;_0x3f58d3=new Hangup(_0x2cd43f,_0x5c7f6e);_0x3f58d3[_0xeb03('0x9c')]=0x13;_0x3f58d3[_0xeb03('0x9d')]='Machine';_0x3f58d3['membername']='AMD';_0x3f58d3[_0xeb03('0xd8')]=!![];this[_0xeb03('0xd9')](_0x3f58d3,_0xeb03('0xda'),_0xeb03('0xdb'));}if(_0x2cd43f['type']==='ivr'&&this['campaigns'][_0x2cd43f[_0xeb03('0xaa')]][_0xeb03('0xd1')]&&_0x5c7f6e[_0xeb03('0xd2')]===_0xeb03('0xd3')){delete this[_0xeb03('0x2b')][_0x5c7f6e['uniqueid']];this[_0xeb03('0xa9')](this[_0xeb03('0x25')][_0x2cd43f['queue']]);_0x3f58d3=new Hangup(_0x2cd43f,_0x5c7f6e);_0x3f58d3[_0xeb03('0x9c')]=0x12;_0x3f58d3['statedesc']='HangupInAMD';_0x3f58d3[_0xeb03('0xd4')]=_0xeb03('0xdc');this[_0xeb03('0xd9')](_0x3f58d3,'[syncHangupInAMDIvr][createHistory]',_0xeb03('0xdd'));}if(_0x2cd43f[_0xeb03('0x4e')]==='ivr'&&this[_0xeb03('0x25')][_0x2cd43f['queue']]['dialAMDActive']&&_0x5c7f6e[_0xeb03('0xd2')]===_0xeb03('0xd7')){delete this[_0xeb03('0x2b')][_0x5c7f6e[_0xeb03('0xcc')]];this[_0xeb03('0xa9')](this[_0xeb03('0x25')][_0x2cd43f['queue']]);_0x3f58d3=new Hangup(_0x2cd43f,_0x5c7f6e);_0x3f58d3[_0xeb03('0x9c')]=0x13;_0x3f58d3[_0xeb03('0x9d')]=_0xeb03('0xde');_0x3f58d3[_0xeb03('0xd4')]=_0xeb03('0xdc');_0x3f58d3[_0xeb03('0xd8')]=!![];this[_0xeb03('0xd9')](_0x3f58d3,_0xeb03('0xdf'),_0xeb03('0xe0'));}}};Dialer[_0xeb03('0x1e')][_0xeb03('0x3b')]=function(_0x33e92d){var _0x132359=this[_0xeb03('0x2b')][_0x33e92d[_0xeb03('0xcc')]];var _0x1a0bb5=this;var _0x24e088;if(_0x132359&&_0x132359[_0xeb03('0x4e')]===_0xeb03('0x79')){delete this[_0xeb03('0x2b')][_0x33e92d[_0xeb03('0xcc')]];this[_0xeb03('0xa9')](this['campaigns'][_0x132359[_0xeb03('0xaa')]]);this['campaigns'][_0x132359[_0xeb03('0xaa')]][_0xeb03('0xe1')]+=0x1;_0x24e088=new Hangup(_0x132359,_0x33e92d);this[_0xeb03('0xbc')](_0x24e088)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xe2')));this[_0xeb03('0xbb')](_0x24e088)['catch'](loggerCatch(_0xeb03('0xe3')));}if(_0x132359&&_0x132359[_0xeb03('0x4e')]!=='ivr'&&isNotNull(this[_0xeb03('0x24')][_0x132359['queue']][_0xeb03('0xe4')])){delete this[_0xeb03('0x2b')][_0x33e92d[_0xeb03('0xcc')]];this[_0xeb03('0xa9')](this[_0xeb03('0x24')][_0x132359[_0xeb03('0xaa')]]);this[_0xeb03('0x24')][_0x132359['queue']][_0xeb03('0x63')]+=0x1;this[_0xeb03('0x24')][_0x132359[_0xeb03('0xaa')]][_0xeb03('0x62')]+=0x1;_0x24e088=new Hangup(_0x132359,_0x33e92d);_0x24e088[_0xeb03('0x9c')]=0x10;_0x24e088[_0xeb03('0x9d')]=_0xeb03('0xe5');_0x24e088[_0xeb03('0xd4')]=_0xeb03('0xe6');this[_0xeb03('0xbc')](_0x24e088)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xe2')));this[_0xeb03('0xbb')](_0x24e088)[_0xeb03('0xa7')](loggerCatch('[syncHangupIvr]'));}if(_0x132359&&_0x132359['type']!==_0xeb03('0x79')&&!isNotNull(this[_0xeb03('0x24')][_0x132359[_0xeb03('0xaa')]][_0xeb03('0xe4')])){delete this[_0xeb03('0x2b')][_0x33e92d['uniqueid']];this[_0xeb03('0xa9')](this['voiceQueues'][_0x132359[_0xeb03('0xaa')]]);this[_0xeb03('0x24')][_0x132359[_0xeb03('0xaa')]][_0xeb03('0x6d')]+=0x1;_0x24e088=new Hangup(_0x132359,_0x33e92d);_0x24e088[_0xeb03('0x9c')]=0xc;_0x24e088[_0xeb03('0x9d')]=_0x33e92d['cause-txt'];_0x24e088[_0xeb03('0xd4')]=_0xeb03('0xe7');this[_0xeb03('0xbc')](_0x24e088)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xe2')));this[_0xeb03('0xbb')](_0x24e088)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xe3')));}};Dialer['prototype'][_0xeb03('0x38')]=function(_0x17f775){var _0x4938af=this[_0xeb03('0x2b')][_0x17f775['uniqueid']];var _0x20ae80=this;if(this[_0xeb03('0x24')][_0x17f775[_0xeb03('0xaa')]]){if(_0x4938af&&_0x4938af[_0xeb03('0x4e')]!==_0xeb03('0x79')){delete this[_0xeb03('0x2b')][_0x17f775[_0xeb03('0xcc')]];this[_0xeb03('0x24')][_0x17f775[_0xeb03('0xaa')]][_0xeb03('0x63')]+=0x1;var _0x44bf70=new AgentComplete(_0x4938af,_0x17f775);if(_0x17f775['reason']==='agent'){_0x44bf70[_0xeb03('0xe8')]=this['voiceQueues'][_0x17f775['queue']][_0xeb03('0xe9')]&&this[_0xeb03('0x24')][_0x17f775[_0xeb03('0xaa')]][_0xeb03('0xea')]?moment()[_0xeb03('0x77')](_0xeb03('0xeb')):undefined;}this[_0xeb03('0xbc')](_0x44bf70)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xec')));this['moveContactManagedDialer'](_0x44bf70)[_0xeb03('0xa7')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xeb03('0x1e')]['syncAgentConnect']=function(_0xce8064){if(this[_0xeb03('0x24')][_0xce8064[_0xeb03('0xaa')]]){if(this[_0xeb03('0x2b')][_0xce8064[_0xeb03('0xcc')]]&&this['uniqueId'][_0xce8064[_0xeb03('0xcc')]][_0xeb03('0x4e')]!==_0xeb03('0x79')){this[_0xeb03('0xa9')](this[_0xeb03('0x24')][_0xce8064[_0xeb03('0xaa')]]);this[_0xeb03('0x2b')][_0xce8064['uniqueid']][_0xeb03('0xed')]=moment()[_0xeb03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xeb03('0xee')]=function(_0x1e86b7){this['createHistory'](_0x1e86b7)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xec')));this[_0xeb03('0xbb')](_0x1e86b7)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0xef')));};Dialer[_0xeb03('0x1e')]['syncQueueCallerAbandon']=function(_0x4e3695){var _0x477be5=this[_0xeb03('0x2b')][_0x4e3695[_0xeb03('0xcc')]];var _0x823e01=this;if(this[_0xeb03('0x24')][_0x4e3695['queue']]){if(_0x477be5&&_0x477be5[_0xeb03('0x4e')]!==_0xeb03('0x79')){delete this[_0xeb03('0x2b')][_0x4e3695[_0xeb03('0xcc')]];this[_0xeb03('0xa9')](this[_0xeb03('0x24')][_0x4e3695[_0xeb03('0xaa')]]);_0x477be5[_0xeb03('0xf0')]=moment()[_0xeb03('0x77')](_0xeb03('0xeb'));var _0x349bc1=new QueueCallerAbandon(_0x477be5,_0x4e3695);if(getSeconds(_0x477be5[_0xeb03('0xf0')],_0x477be5[_0xeb03('0xf1')])>=_0x477be5[_0xeb03('0xf2')]){this[_0xeb03('0x24')][_0x4e3695[_0xeb03('0xaa')]][_0xeb03('0x71')]+=0x1;this['voiceQueues'][_0x4e3695[_0xeb03('0xaa')]][_0xeb03('0x67')]+=0x1;this[_0xeb03('0x24')][_0x4e3695['queue']][_0xeb03('0xf3')]+=0x1;_0x349bc1[_0xeb03('0x9c')]=0xa;_0x349bc1['statedesc']=_0xeb03('0xf4');_0x349bc1[_0xeb03('0xf5')]=_0xeb03('0xf6');_0x349bc1['agiafterat']=this[_0xeb03('0x24')][_0x4e3695['queue']][_0xeb03('0xe9')]?moment()[_0xeb03('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0xeb03('0xee')](_0x349bc1);}else{this['voiceQueues'][_0x4e3695['queue']][_0xeb03('0x70')]+=0x1;this[_0xeb03('0x24')][_0x4e3695[_0xeb03('0xaa')]][_0xeb03('0x66')]+=0x1;_0x349bc1[_0xeb03('0x9c')]=0xb;_0x349bc1[_0xeb03('0x9d')]=_0xeb03('0xf7');_0x349bc1[_0xeb03('0xf5')]=_0xeb03('0xf8');this['queueCallerAbandonCreateState'](_0x349bc1);}}}};Dialer[_0xeb03('0x1e')][_0xeb03('0x3d')]=function(_0x80582d){if(this[_0xeb03('0xf9')][_0x80582d[_0xeb03('0xcc')]]){this['actions'][_0x80582d['uniqueid']][_0xeb03('0xa6')]=_0x80582d[_0xeb03('0xa6')];}if(this[_0xeb03('0x2b')][_0x80582d[_0xeb03('0xcc')]]){this[_0xeb03('0x2b')][_0x80582d['uniqueid']][_0xeb03('0xa6')]=_0x80582d[_0xeb03('0xa6')];}};Dialer[_0xeb03('0x1e')]['syncQueueMember']=function(_0x199ff9){if(strategy[this['voiceQueues'][this[_0xeb03('0xf9')][_0x199ff9[_0xeb03('0xfa')]][_0xeb03('0xaa')]][_0xeb03('0x4f')]]===_0xeb03('0x1d')){if(this[_0xeb03('0xf9')][_0x199ff9[_0xeb03('0xfa')]]&&_['isNil'](this[_0xeb03('0xf9')][_0x199ff9[_0xeb03('0xfa')]][_0xeb03('0xfb')])&&_0x199ff9[_0xeb03('0xa5')]==='1'&&_0x199ff9[_0xeb03('0xfc')]==='0'){if(this[_0xeb03('0x26')][_0x199ff9[_0xeb03('0xfd')]]){if(!this['agents'][_0x199ff9['stateinterface']][_0xeb03('0xfb')]){this[_0xeb03('0x26')][_0x199ff9['stateinterface']][_0xeb03('0xfb')]=!![];this[_0xeb03('0xf9')][_0x199ff9[_0xeb03('0xfa')]][_0xeb03('0xfb')]=!![];this[_0xeb03('0xf9')][_0x199ff9[_0xeb03('0xfa')]][_0xeb03('0xfd')]=_0x199ff9['stateinterface'];}}}}else if((strategy[this[_0xeb03('0x24')][this['actions'][_0x199ff9[_0xeb03('0xfa')]][_0xeb03('0xaa')]][_0xeb03('0x4f')]]||'rrmemory')==='rrmemory'){if(this['actions'][_0x199ff9[_0xeb03('0xfa')]]){if(this[_0xeb03('0x26')][_0x199ff9[_0xeb03('0xfd')]]){this['actions'][_0x199ff9[_0xeb03('0xfa')]][_0xeb03('0xfd')]=_0x199ff9[_0xeb03('0xfd')];if(_['isNil'](this[_0xeb03('0x30')][this[_0xeb03('0xf9')][_0x199ff9[_0xeb03('0xfa')]][_0xeb03('0xaa')]])){this['queueBooked'][this['actions'][_0x199ff9['actionid']][_0xeb03('0xaa')]]=[];}this['queueBooked'][this[_0xeb03('0xf9')][_0x199ff9[_0xeb03('0xfa')]][_0xeb03('0xaa')]][_0xeb03('0xfe')](_['merge'](_[_0xeb03('0xc2')](this[_0xeb03('0xf9')][_0x199ff9['actionid']],['idHopper','stateinterface']),{'status':_0x199ff9['status'],'paused':_0x199ff9['paused']}));}}}};function unlockQueueStatus(_0xabe8cb,_0x5d28bd){setTimeout(function(){if(_[_0xeb03('0x7e')](_0xabe8cb[_0xeb03('0xff')])){loggerBooked[_0xeb03('0x8e')](_0xeb03('0x100'),_0x5d28bd);}_0xabe8cb['queueStatusComplete']=!![];loggerBooked[_0xeb03('0x7f')]('[booked][unlockQueueStatus]',_0x5d28bd,JSON[_0xeb03('0x4c')](_[_0xeb03('0xc2')](_0xabe8cb,[_0xeb03('0x45'),_0xeb03('0xff')])));},0x1f3);}Dialer[_0xeb03('0x1e')]['syncQueueStatusComplete']=function(_0x3ef33a){var _0x5975c7=this;var _0x3c3e9d=_0x5975c7[_0xeb03('0x24')][_0x5975c7[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]];if(strategy[this['voiceQueues'][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]][_0xeb03('0x4f')]]===_0xeb03('0x1d')){if(this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]]&&this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xfd')]){this[_0xeb03('0x23')][_0xeb03('0x101')](this[_0xeb03('0xf9')][_0x3ef33a['actionid']][_0xeb03('0x102')],this['actions'][_0x3ef33a[_0xeb03('0xfa')]]['stateinterface'])[_0xeb03('0xa7')](function(_0x2543e1){logger['error'](_0xeb03('0x103'),util[_0xeb03('0x8f')](_0x2543e1,{'showHidden':![],'depth':null}));})[_0xeb03('0x21')](function(){_0x5975c7['updateOriginated'](_0x5975c7[_0xeb03('0x24')][_0x5975c7[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]]);_0x5975c7[_0xeb03('0x26')][_0x5975c7[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xfd')]][_0xeb03('0xfb')]=![];delete _0x5975c7[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]];unlockQueueStatus(_0x3c3e9d);});}else{this[_0xeb03('0xa9')](this[_0xeb03('0x24')][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]]);this[_0xeb03('0xb5')]({'active':![],'ContactId':this[_0xeb03('0xf9')][_0x3ef33a['actionid']][_0xeb03('0x104')],'ListId':this[_0xeb03('0xf9')][_0x3ef33a['actionid']][_0xeb03('0xc3')],'VoiceQueueId':this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xc4')]||undefined,'CampaignId':this[_0xeb03('0xf9')][_0x3ef33a['actionid']][_0xeb03('0x105')]||undefined})[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x106')));delete this['actions'][_0x3ef33a[_0xeb03('0xfa')]];unlockQueueStatus(_0x3c3e9d);}}else if((strategy[this['voiceQueues'][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]]['strategy']]||_0xeb03('0x107'))==='rrmemory'){var _0x13a6dc;if(this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]]&&!_[_0xeb03('0x7c')](this[_0xeb03('0x30')][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]])){if(this['queueBookedRR'][_0x5975c7['actions'][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]]){this[_0xeb03('0x31')][_0x5975c7[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]]=this[_0xeb03('0x31')][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]]['queue']]?this[_0xeb03('0x31')][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]]:this[_0xeb03('0x30')][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]]['queue']]?this[_0xeb03('0x30')][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]][_0xeb03('0x108')]||0x0:0x0;}this[_0xeb03('0x30')][this['actions'][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]][_0xeb03('0x108')]=this[_0xeb03('0x31')][this[_0xeb03('0xf9')][_0x3ef33a[_0xeb03('0xfa')]][_0xeb03('0xaa')]];for(var _0x2afc74=0x0;_0x2afc74=0x0?!![]:![];})[_0xeb03('0xa7')](myreject(_0x57a278)));}}else{_0x160323[_0xeb03('0xfe')](ami[_0xeb03('0xa4')]({'action':_0xeb03('0x122'),'command':util['format'](_0xeb03('0x11d'),_0x4ed80f,!_['isUndefined'](config['timezones'][_0xb83949])?_0xb83949:'')})['then'](function(_0x730e4e){return _0x730e4e[_0xeb03('0x11f')][_0xeb03('0x120')](_0xeb03('0x121'))>=0x0?!![]:![];})[_0xeb03('0xa7')](myreject(_0x57a278)));}BPromise[_0xeb03('0x123')](_0x160323)[_0xeb03('0xae')](function(_0x598125){var _0x4d2e3b=_[_0xeb03('0x124')](_0x598125);if(_0x4d2e3b){return _0x1f7125(_0x4d2e3b);}else{_0x2d45b6[_0xeb03('0x43')]=_0xd7724d?'GLOBAL_INTERVAL_IS_OVERTIME':_0xeb03('0x125');return _0x57a278(msgResponse(_0xeb03('0x126'),_0xeb03('0x116'),'Global:\x20'+_0xd7724d+'\x20'+_0x2e63b4+_0xeb03('0x127')+util[_0xeb03('0x8f')](_0x4ed80f,{'showHidden':![],'depth':null})+_0xeb03('0x128')+_0xb83949));}})[_0xeb03('0xa7')](function(_0x46f2b9){return _0x57a278(msgResponse(_0xeb03('0x115'),_0xeb03('0x116'),JSON[_0xeb03('0x4c')](_0x46f2b9)));});});};Dialer[_0xeb03('0x1e')][_0xeb03('0x129')]=function(_0x206a91){var _0x9f515f=this;return function(){switch(_0x206a91['dialMethod']){case'progressive':freeVariablesPredictive(_0x206a91);_0x9f515f[_0xeb03('0x12a')](_0x206a91,0x1);break;case'power':freeVariablesPredictive(_0x206a91);_0x9f515f[_0xeb03('0x12a')](_0x206a91,_0x206a91[_0xeb03('0x12b')]);break;case'predictive':_0x9f515f['predictive'](_0x206a91);break;case _0xeb03('0x9'):freeVariablesPredictive(_0x206a91);_0x9f515f[_0xeb03('0x12a')](_0x206a91,0x1);break;default:freeVariablesPredictive(_0x206a91);logger[_0xeb03('0x8e')]('Queue',_0x206a91[_0xeb03('0x45')],_0xeb03('0x12c'));}};};Dialer[_0xeb03('0x1e')]['launchHandleIvr']=function(_0xdf48b7){var _0x174f2e=this;return function(){_0x174f2e[_0xeb03('0x12d')](_0xdf48b7);};};Dialer[_0xeb03('0x1e')]['syncQueueSummary']=function(_0x1cda01){var _0x574a0c=this;if(isNotPreview(_0x1cda01['dialMethod'])){if(isVoiceQueueOutbound(_0x1cda01[_0xeb03('0x4e')])&&isActive(_0x1cda01['dialActive'])){_0x1cda01[_0xeb03('0x97')]=!![];BPromise[_0xeb03('0xad')]()[_0xeb03('0xae')](checkIsLoggedIn(_0x1cda01,_0x1cda01['loggedIn']))['then'](checkIsActive(_0x1cda01,_0x1cda01[_0xeb03('0x5c')]))[_0xeb03('0xae')](checkInterval(_0x1cda01))[_0xeb03('0xae')](_0x574a0c[_0xeb03('0x112')](_0x1cda01))['then'](_0x574a0c[_0xeb03('0x12e')](_0x1cda01[_0xeb03('0x12f')],_0x1cda01[_0xeb03('0x130')],_0x1cda01[_0xeb03('0x45')],_0x1cda01))[_0xeb03('0xae')](_0x574a0c[_0xeb03('0x131')](_0x1cda01['Interval'],_0x1cda01['dialTimezone'],_0x1cda01[_0xeb03('0x45')],_0x1cda01))[_0xeb03('0xae')](_0x574a0c[_0xeb03('0x129')](_0x1cda01))['catch'](loggerCatchQueueSummary(_0xeb03('0x132'),_0x1cda01));}else{notSendMessagesQueue(_0x1cda01);}}else{freeVariablesPredictive(_0x1cda01);}};Dialer[_0xeb03('0x1e')]['syncCampaigns']=function(){var _0x296b22=this;var _0xa0554;for(var _0x2da63e in this['campaigns']){if(this[_0xeb03('0x25')][_0xeb03('0xa3')](_0x2da63e)){_0xa0554=this[_0xeb03('0x25')][_0x2da63e];if(isCampaignIvr(_0xa0554[_0xeb03('0x4e')])&&isActive(_0xa0554[_0xeb03('0xc9')])){_0xa0554[_0xeb03('0x97')]=!![];BPromise[_0xeb03('0xad')]()[_0xeb03('0xae')](checkIsActive(_0xa0554,_0xa0554[_0xeb03('0xc9')]))[_0xeb03('0xae')](checkInterval(_0xa0554))[_0xeb03('0xae')](_0x296b22[_0xeb03('0x112')](_0xa0554))[_0xeb03('0xae')](_0x296b22[_0xeb03('0x12e')](_0xa0554[_0xeb03('0x12f')],_0xa0554['dialTimezone'],_0xa0554[_0xeb03('0x45')],_0xa0554))[_0xeb03('0xae')](_0x296b22[_0xeb03('0x131')](_0xa0554[_0xeb03('0x48')],_0xa0554[_0xeb03('0x130')],_0xa0554[_0xeb03('0x45')],_0xa0554))['then'](_0x296b22[_0xeb03('0x133')](_0xa0554))[_0xeb03('0xa7')](loggerCatchQueueSummary(_0xeb03('0x134'),_0xa0554));}else{notSendMessagesCampaign(_0xa0554);}}}};function getCallerIdRandom(_0x21f1a5,_0x184e0f){var _0x5dce4b,_0x128188,_0x2cd1b5;if(_0x184e0f<=0x0){_0x184e0f=0x1;}_0x5dce4b=new RegExp('\x5cw{0,'+_0x184e0f+'}$');_0x128188=Math[_0xeb03('0x135')](0xa,_0x184e0f-0x1);_0x2cd1b5=Math[_0xeb03('0x135')](0xa,_0x184e0f)-0x1;return util[_0xeb03('0x77')]('%s',_[_0xeb03('0x136')](_0x21f1a5,_0x5dce4b,_[_0xeb03('0x137')](_0x128188,_0x2cd1b5)));}function extractCalleridName(_0x361630){var _0x2e7d16=_0x361630[_0xeb03('0x138')](/"(.*?)"/);return _0x2e7d16?_0x2e7d16[0x1]:_0x361630;}function extractCalleridNumber(_0xea3597){var _0x6a2544=_0xea3597[_0xeb03('0x138')](/<(.*?)>/);return _0x6a2544?_0x6a2544[0x1]:_0xea3597;}Dialer[_0xeb03('0x1e')][_0xeb03('0x139')]=function(_0x4f9581,_0x307dc8){var _0x59ccc3=this;var _0x535299=uuid['v4']();this[_0xeb03('0xf9')][_0x535299]=new Action(_0x4f9581,_0x307dc8,_0x535299);return new BPromise(function(_0x3a6406,_0x8a50a7){if(_['isUndefined'](_0x4f9581)&&_0xeb03('0x13a')!==typeof _0x4f9581){return _0x8a50a7(msgResponse(_0xeb03('0x13b'),_0xeb03('0x116'),_0xeb03('0x13c')));}if(_[_0xeb03('0x7e')](_0x307dc8[_0xeb03('0x13d')][_0xeb03('0x13e')])||_0x307dc8[_0xeb03('0x13d')][_0xeb03('0x13e')]===null){return _0x8a50a7(msgResponse(_0xeb03('0x13b'),_0xeb03('0x116'),_0xeb03('0x13f')));}var _0x477350={'XMD-CALLERID':_0x59ccc3[_0xeb03('0xf9')][_0x535299]['getCaller'](),'XMD-AGI':_0x4f9581['dialQueueProject']?util[_0xeb03('0x77')](_0xeb03('0x140'),ipAgi,_0x4f9581['dialQueueProject']):_0xeb03('0x141'),'XMD-AGIAFTER':_0x4f9581[_0xeb03('0xe9')]?util[_0xeb03('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4f9581[_0xeb03('0xe9')]):_0xeb03('0x141'),'XMD-QUEUE':_0x4f9581[_0xeb03('0x4e')]==='outbound'?util[_0xeb03('0x77')](_0xeb03('0x142'),_0x4f9581[_0xeb03('0x45')],_0x4f9581[_0xeb03('0x143')]||'',_0x4f9581['dialAgiAfterHangupAgent']?'c':'',_0x4f9581[_0xeb03('0xf2')]||0x3):_0xeb03('0x141'),'XMD-CONTACTID':_0x307dc8['ContactId'],'XMD-CDRTYPE':_0xeb03('0x8'),'CALLERID(all)':_0x59ccc3['actions'][_0x535299][_0xeb03('0x144')](),'XMD-AMD':_0x4f9581[_0xeb03('0xd1')]?_0xeb03('0x145'):_0xeb03('0x141'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4f9581[_0xeb03('0xd1')]){_0x477350[_0xeb03('0x146')]=_0x4f9581[_0xeb03('0x147')]||0x9c4;_0x477350[_0xeb03('0x148')]=_0x4f9581[_0xeb03('0x149')]||0x5dc;_0x477350[_0xeb03('0x14a')]=_0x4f9581[_0xeb03('0x14b')]||0x320;_0x477350[_0xeb03('0x14c')]=_0x4f9581[_0xeb03('0x14d')]||0x1388;_0x477350[_0xeb03('0x14e')]=_0x4f9581[_0xeb03('0x14f')]||0x64;_0x477350[_0xeb03('0x150')]=_0x4f9581[_0xeb03('0x151')]||0x32;_0x477350['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x4f9581['dialAMDMaximumNumberOfWords']||0x3;_0x477350['XMD-AMDSILENCETHRESHOLD']=_0x4f9581['dialAMDSilenceThreshold']||0x100;_0x477350[_0xeb03('0x152')]=_0x4f9581[_0xeb03('0x153')]||0x1388;}if(_0x4f9581[_0xeb03('0x4e')]===_0xeb03('0x8a')){_0x477350['XMD-VOICEQUEUEID']=_0x307dc8[_0xeb03('0xc4')];}else{_0x477350[_0xeb03('0x154')]=_0x307dc8['CampaignId'];}for(var _0x349e81 in _0x307dc8[_0xeb03('0x13d')]){if(_0x307dc8[_0xeb03('0x13d')][_0xeb03('0xa3')](_0x349e81)){if(isNotNull(_0x307dc8[_0xeb03('0x13d')][_0x349e81])&&_0x349e81!=='id'&&_0x349e81!==_0xeb03('0x155')&&_0x349e81!==_0xeb03('0x156')&&_0x349e81!=='updatedAt'){_0x477350[util[_0xeb03('0x77')]('%s%s',_0xeb03('0x157'),_[_0xeb03('0x158')](_0x349e81))]=_0x307dc8[_0xeb03('0x13d')][_0x349e81];}}}var _0x4c9fd4=_0x59ccc3[_0xeb03('0x113')](_0x4f9581[_0xeb03('0x75')])?getCallerId(_0x4f9581['Trunk']['callerid'],_0x4f9581[_0xeb03('0x5e')],_0x4f9581['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4f9581[_0xeb03('0x5f')],_0x4f9581[_0xeb03('0x159')]):_0x4f9581['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x4f9581[_0xeb03('0x114')])?_0x4f9581[_0xeb03('0x75')][_0xeb03('0x76')]:_0x4f9581[_0xeb03('0x114')][_0xeb03('0x76')],_0x4f9581[_0xeb03('0x5e')],_0x4f9581['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4f9581[_0xeb03('0x5f')],_0x4f9581[_0xeb03('0x159')]):_0x4f9581[_0xeb03('0x5f')]);if(_0x4c9fd4){_0x477350[_0xeb03('0x15a')]=_0x59ccc3[_0xeb03('0xf9')][_0x535299]['originatecalleridname']=extractCalleridName(_0x4c9fd4);_0x477350[_0xeb03('0x15b')]=_0x59ccc3[_0xeb03('0xf9')][_0x535299]['originatecalleridnum']=extractCalleridNumber(_0x4c9fd4);}return ami[_0xeb03('0xa4')]({'actionid':_0x535299,'action':_0xeb03('0x13b'),'channel':_0x59ccc3['isTrunkReachable'](_0x4f9581[_0xeb03('0x75')])?util['format'](_0xeb03('0x15c'),_0x4f9581['Trunk']['name'],isNotNull(_0x4f9581['dialPrefix'])?_0x4f9581[_0xeb03('0x61')][_0xeb03('0x15d')]()||'':'',_0x4f9581[_0xeb03('0x15e')]>0x0?_0x307dc8[_0xeb03('0x13d')][_0xeb03('0x13e')][_0xeb03('0x15f')](_0x4f9581[_0xeb03('0x15e')]):_0x307dc8[_0xeb03('0x13d')][_0xeb03('0x13e')]):util['format']('SIP/%s/%s%s',_[_0xeb03('0xcd')](_0x4f9581[_0xeb03('0x114')])?_0x4f9581[_0xeb03('0x75')]['name']:_0x4f9581[_0xeb03('0x114')][_0xeb03('0x45')],isNotNull(_0x4f9581['dialPrefix'])?_0x4f9581['dialPrefix'][_0xeb03('0x15d')]()||'':'',_0x4f9581[_0xeb03('0x15e')]>0x0?_0x307dc8[_0xeb03('0x13d')]['phone'][_0xeb03('0x15f')](_0x4f9581[_0xeb03('0x15e')]):_0x307dc8[_0xeb03('0x13d')]['phone']),'callerid':_0x4c9fd4,'Exten':_0xeb03('0x160'),'Context':_0xeb03('0x161'),'Priority':'1','variable':_0x477350,'timeout':(_0x4f9581[_0xeb03('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x535299})[_0xeb03('0xae')](function(_0xcf4bf5){return _0x3a6406(_0xcf4bf5);})[_0xeb03('0xa7')](function(_0x2ef45c){_0x4f9581['outboundOriginateFailureCallsDay']+=0x1;var _0x5ded55=new History(_0x59ccc3[_0xeb03('0xf9')][_0x535299]);logger['error'](util[_0xeb03('0x77')]('[originateError]:\x20%s',JSON[_0xeb03('0x4c')](_0x2ef45c)));_0x5ded55[_0xeb03('0x9c')]=0xe;_0x5ded55[_0xeb03('0x9d')]=_0xeb03('0x162');_0x5ded55[_0xeb03('0x163')]=moment()[_0xeb03('0x77')](_0xeb03('0xeb'));_0x5ded55[_0xeb03('0x9e')]=_0x5ded55[_0xeb03('0x163')];_0x59ccc3[_0xeb03('0xbc')](_0x5ded55)['catch'](loggerCatch(_0xeb03('0x164')));_0x59ccc3[_0xeb03('0xbb')](_0x5ded55)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x164')))[_0xeb03('0x21')](function(){delete _0x59ccc3['actions'][_0x535299];return _0x8a50a7(msgResponse(_0xeb03('0x13b'),_0xeb03('0x4b'),_0xeb03('0x165')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x35fbe6){var _0x4cbea2=this[_0xeb03('0xf9')][_0x35fbe6[_0xeb03('0xfa')]];var _0x50839c=this;if(_0x4cbea2){delete this[_0xeb03('0xf9')][_0x35fbe6['actionid']];_0x4cbea2[_0xeb03('0xf1')]=moment()[_0xeb03('0x77')](_0xeb03('0xeb'));var _0x3245f3=_0x4cbea2['type']===_0xeb03('0x79')?this[_0xeb03('0x25')][_0x4cbea2[_0xeb03('0xaa')]]:this['voiceQueues'][_0x4cbea2['getQueue']()];if(!this[_0xeb03('0xc7')](_0x35fbe6[_0xeb03('0x166')])){this[_0xeb03('0xa9')](_0x3245f3);return this['callProgressDetecting'](_0x4cbea2,_0x3245f3,_0x35fbe6)['then'](function(_0x1b72d4){})['catch'](loggerCatch(_0xeb03('0x167')));}else{this[_0xeb03('0x2b')][_0x35fbe6['uniqueid']]=_0x4cbea2;}}};Dialer['prototype']['checkRetriveMax']=function(_0x48a84d,_0x5f18f5,_0x3cbdac){var _0x3f5b66=new History(_0x5f18f5);if(_0x3f5b66[_0xeb03('0x168')]+_0x3f5b66[_0xeb03('0x169')]+_0x3f5b66[_0xeb03('0x16a')]>=_0x3cbdac['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x48a84d){case 0x3:if(_0x3f5b66[_0xeb03('0x16a')]>=_0x3cbdac[_0xeb03('0x16b')]-0x1){return!![];}else{this[_0xeb03('0xb5')]({'active':![],'countnoanswerretry':_0x3f5b66[_0xeb03('0x16a')]+=0x1,'scheduledat':moment()[_0xeb03('0x16c')](_0x3cbdac[_0xeb03('0x16d')],'minutes')['format'](_0xeb03('0xeb')),'ContactId':_0x3f5b66[_0xeb03('0x104')],'ListId':_0x3f5b66['ListId'],'VoiceQueueId':_0x3f5b66[_0xeb03('0xc4')]||undefined,'CampaignId':_0x3f5b66[_0xeb03('0x105')]||undefined})[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x16e')));}break;case 0x5:if(_0x3f5b66[_0xeb03('0x168')]>=_0x3cbdac[_0xeb03('0x16f')]-0x1){return!![];}else{this[_0xeb03('0xb5')]({'active':![],'countbusyretry':_0x3f5b66['countbusyretry']+=0x1,'scheduledat':moment()[_0xeb03('0x16c')](_0x3cbdac[_0xeb03('0x170')],_0xeb03('0x171'))[_0xeb03('0x77')](_0xeb03('0xeb')),'ContactId':_0x3f5b66[_0xeb03('0x104')],'ListId':_0x3f5b66['ListId'],'VoiceQueueId':_0x3f5b66[_0xeb03('0xc4')]||undefined,'CampaignId':_0x3f5b66[_0xeb03('0x105')]||undefined})[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x172')));}break;case 0x8:if(_0x3f5b66[_0xeb03('0x169')]>=_0x3cbdac[_0xeb03('0x173')]-0x1){return!![];}else{this[_0xeb03('0xb5')]({'active':![],'countcongestionretry':_0x3f5b66[_0xeb03('0x169')]+=0x1,'scheduledat':moment()[_0xeb03('0x16c')](_0x3cbdac[_0xeb03('0x174')],'minutes')[_0xeb03('0x77')](_0xeb03('0xeb')),'ContactId':_0x3f5b66[_0xeb03('0x104')],'ListId':_0x3f5b66[_0xeb03('0xc3')],'VoiceQueueId':_0x3f5b66[_0xeb03('0xc4')]||undefined,'CampaignId':_0x3f5b66['CampaignId']||undefined})[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x175')));}break;default:return!![];}};Dialer[_0xeb03('0x1e')][_0xeb03('0x176')]=function(_0x355b3e,_0x20da33,_0x1c17d3){var _0x2de047=this;var _0x2ea3c2=new History(_0x355b3e);return new BPromise(function(_0x3bfce4,_0x4d1a25){if(_['isUndefined'](_0x20da33)&&'object'!==typeof _0x20da33){return _0x4d1a25(msgResponse(_0xeb03('0x177'),_0xeb03('0x116'),'entity\x20is\x20undefine'));}if(_[_0xeb03('0x7e')](_0x1c17d3)&&'object'!==typeof _0x1c17d3){return _0x4d1a25(msgResponse('[callProgressDetecting]',_0xeb03('0x116'),_0xeb03('0x178')));}switch(_0x1c17d3[_0xeb03('0x179')]){case'0':_0x20da33[_0xeb03('0x69')]+=0x1;_0x2ea3c2[_0xeb03('0x9c')]=0x0;_0x2ea3c2[_0xeb03('0x9d')]=_0xeb03('0x17a');_0x2de047['createHistory'](_0x2ea3c2)[_0xeb03('0xa7')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2de047[_0xeb03('0x17b')](0x0,_0x355b3e,_0x20da33)){if(_0x2ea3c2[_0xeb03('0x168')]+_0x2ea3c2[_0xeb03('0x169')]+_0x2ea3c2['countnoanswerretry']>=_0x20da33[_0xeb03('0x17c')]){_0x2de047['stateGlobal'](_0x2ea3c2,_0x3bfce4,_0x4d1a25,_0xeb03('0x17d'));}else{_0x2de047[_0xeb03('0x17e')](_0x2ea3c2,_0x3bfce4,_0x4d1a25,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x20da33['outboundNoAnswerCallsDay']+=0x1;_0x2ea3c2[_0xeb03('0x9c')]=0x3;_0x2ea3c2[_0xeb03('0x9d')]=_0xeb03('0x17f');_0x2ea3c2[_0xeb03('0x16a')]+=0x1;_0x2ea3c2[_0xeb03('0x180')]+=0x1;_0x2de047['createHistory'](_0x2ea3c2)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x181')));if(_0x2de047['checkRetriveMax'](0x3,_0x355b3e,_0x20da33)){if(_0x2ea3c2[_0xeb03('0x16a')]>=_0x20da33[_0xeb03('0x16b')]){_0x2de047['createStateFinal'](_0x2ea3c2,_0x3bfce4,_0x4d1a25,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2de047[_0xeb03('0x182')](_0x2ea3c2,_0x3bfce4,_0x4d1a25,_0xeb03('0x183'));}}break;case'5':_0x20da33[_0xeb03('0x65')]+=0x1;_0x2ea3c2[_0xeb03('0x9c')]=0x5;_0x2ea3c2[_0xeb03('0x9d')]=_0xeb03('0x184');_0x2ea3c2[_0xeb03('0x168')]+=0x1;_0x2ea3c2[_0xeb03('0x180')]+=0x1;_0x2de047['createHistory'](_0x2ea3c2)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x185')));if(_0x2de047[_0xeb03('0x17b')](0x5,_0x355b3e,_0x20da33)){if(_0x2ea3c2[_0xeb03('0x168')]>=_0x20da33[_0xeb03('0x16f')]){_0x2de047[_0xeb03('0x17e')](_0x2ea3c2,_0x3bfce4,_0x4d1a25,'reason\x205\x20busy');}else{_0x2de047[_0xeb03('0x182')](_0x2ea3c2,_0x3bfce4,_0x4d1a25,'reason\x205\x20busy');}}break;case'8':_0x20da33[_0xeb03('0x186')]+=0x1;_0x2ea3c2[_0xeb03('0x9c')]=0x8;_0x2ea3c2[_0xeb03('0x9d')]=_0xeb03('0x187');_0x2ea3c2[_0xeb03('0x169')]+=0x1;_0x2ea3c2[_0xeb03('0x180')]+=0x1;_0x2de047['createHistory'](_0x2ea3c2)[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x188')));if(_0x2de047[_0xeb03('0x17b')](0x8,_0x355b3e,_0x20da33)){if(_0x2ea3c2[_0xeb03('0x169')]>=_0x20da33[_0xeb03('0x173')]){_0x2de047[_0xeb03('0x17e')](_0x2ea3c2,_0x3bfce4,_0x4d1a25,'reason\x208\x20congestion');}else{_0x2de047['stateGlobal'](_0x2ea3c2,_0x3bfce4,_0x4d1a25,_0xeb03('0x189'));}}break;default:_0x20da33[_0xeb03('0x6d')]+=0x1;_0x2ea3c2[_0xeb03('0x9c')]=0xc;_0x2ea3c2[_0xeb03('0x9d')]=_0x1c17d3[_0xeb03('0x179')];_0x2de047[_0xeb03('0xbc')](_0x2ea3c2)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2de047[_0xeb03('0x17b')](_0x1c17d3[_0xeb03('0x179')],_0x355b3e,_0x20da33)){if(_0x2ea3c2[_0xeb03('0x168')]+_0x2ea3c2[_0xeb03('0x169')]+_0x2ea3c2[_0xeb03('0x16a')]>=_0x20da33[_0xeb03('0x17c')]){_0x2de047['stateGlobal'](_0x2ea3c2,_0x3bfce4,_0x4d1a25,_0x1c17d3[_0xeb03('0x179')]);}else{_0x2de047[_0xeb03('0x17e')](_0x2ea3c2,_0x3bfce4,_0x4d1a25,_0x1c17d3[_0xeb03('0x179')]);}}}});};Dialer[_0xeb03('0x1e')][_0xeb03('0x182')]=function(_0x5a4ab5,_0x42205e,_0x22c795,_0x3af922){var _0x2ebfb7=new Final(_0x5a4ab5);_0x2ebfb7[_0xeb03('0x9c')]=0xf;_0x2ebfb7[_0xeb03('0x9d')]='Global';this['createStateFinal'](_0x2ebfb7,_0x42205e,_0x22c795,_0x3af922);};Dialer[_0xeb03('0x1e')][_0xeb03('0x17e')]=function(_0x5d8866,_0x572d6f,_0x4bd421,_0x360425){this[_0xeb03('0xbb')](_0x5d8866)[_0xeb03('0xae')](function(_0x576263){return _0x572d6f(msgResponse('[callProgressDetecting]','Success',_0x360425));})[_0xeb03('0xa7')](function(_0x2eb676){return _0x4bd421(msgResponse('[moveContactManagedDialer][0]',_0xeb03('0x116'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0xeb03('0x18a')]=function(_0x3219c1){var _0x6d54d6=this;var _0x98de79=_0x3219c1[_0xeb03('0x18b')]/0x64;var _0x298092=_0x3219c1[_0xeb03('0x67')]/(_0x3219c1[_0xeb03('0x67')]+_0x3219c1['outboundAnswerCallsDay']);var _0x1a114c=_0x3219c1[_0xeb03('0x51')]-_0x3219c1[_0xeb03('0x18c')]-_0x3219c1[_0xeb03('0x5a')]-_0x3219c1[_0xeb03('0x74')]-_0x3219c1['talking'];var _0x46d357=(_0x3219c1[_0xeb03('0x51')]-_0x3219c1[_0xeb03('0x18c')])*_0x3219c1[_0xeb03('0x73')];var _0x1f3ea2=Math[_0xeb03('0x18d')](_0x3219c1['erlangCalls']*_0x3219c1[_0xeb03('0x18e')]*_0x3219c1[_0xeb03('0x18f')]*_0x3219c1[_0xeb03('0x190')]);if(_[_0xeb03('0x7e')](_0x3219c1['startProgressive'])){loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x191'));if(!_['isUndefined'](_0x3219c1[_0xeb03('0x2d')])){_0x3219c1[_0xeb03('0x2d')]=undefined;loggerPredictive[_0xeb03('0x8e')](_0xeb03('0x192'),_0xeb03('0x193'));}if(!_['isUndefined'](_0x3219c1['handlePredictive'])){loggerPredictive[_0xeb03('0x8e')](_0xeb03('0x192'),_0xeb03('0x194'));clearInterval(_0x3219c1['handlePredictive']);_0x3219c1[_0xeb03('0x89')]=undefined;}_0x3219c1[_0xeb03('0x2e')]=moment()[_0xeb03('0x77')](_0xeb03('0xeb'));loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x195'),_0x3219c1[_0xeb03('0x2e')],_0x3219c1[_0xeb03('0x45')]);this[_0xeb03('0x12a')](_0x3219c1,0x1);}else if(ifInterval(_0x3219c1[_0xeb03('0x196')],_0x3219c1[_0xeb03('0x2e')])){this[_0xeb03('0x12a')](_0x3219c1,0x1);loggerPredictiveCalls[_0xeb03('0x7f')](_0xeb03('0x197'),_0x3219c1[_0xeb03('0x2e')],_0x3219c1['name']);_0x3219c1[_0xeb03('0x198')]=0x0;_0x3219c1[_0xeb03('0xf3')]=0x0;}else if(_0x98de79<_0x298092&&_0x3219c1[_0xeb03('0x199')]===_0xeb03('0x19a')){freeVariablesPredictive(_0x3219c1);loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x19b'),'Dropped\x20calls\x20day',_0x298092,_0xeb03('0x2e'),_0x3219c1[_0xeb03('0x45')]);}else if(_0x1a114c>_0x46d357){freeVariablesPredictive(_0x3219c1);loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x19c'),_0xeb03('0x19d'),_0x1a114c,_0xeb03('0x19e'),_0x46d357);}else if(_0x1f3ea2<_0x3219c1[_0xeb03('0xf3')]&&_0x3219c1['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x3219c1);loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x19f'),_0xeb03('0x1a0'),_0x1f3ea2,'Drop\x20in\x20this\x20interval',_0x3219c1[_0xeb03('0xf3')],_0xeb03('0x2e'),_0x3219c1[_0xeb03('0x45')]);}else if(!ifInterval(_0x3219c1[_0xeb03('0x196')],_0x3219c1[_0xeb03('0x2e')])&&_[_0xeb03('0x7e')](_0x3219c1[_0xeb03('0x2d')])&&!_['isUndefined'](_0x3219c1[_0xeb03('0x2e')])){_0x3219c1[_0xeb03('0x2d')]=moment()[_0xeb03('0x77')](_0xeb03('0xeb'));loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x1a1'),_0x3219c1[_0xeb03('0x2d')],_0x3219c1['name']);this['averageHandleTime'](_0x3219c1[_0xeb03('0x196')])[_0xeb03('0xae')](this[_0xeb03('0x1a2')](_0x3219c1))[_0xeb03('0xae')](mergeDataErlangB(_0x3219c1))[_0xeb03('0xae')](this['startMethodPredictive'](_0x3219c1))['catch'](loggerCatchPredictive(_0xeb03('0x1a3'),_0x3219c1));}else if(!ifInterval(_0x3219c1[_0xeb03('0x196')],_0x3219c1[_0xeb03('0x2d')])){_0x3219c1[_0xeb03('0xf3')]=0x0;_0x3219c1[_0xeb03('0x2d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x1a4'),_0x3219c1['startPredictive'],_0x3219c1['name']);clearInterval(_0x3219c1[_0xeb03('0x89')]);_0x3219c1[_0xeb03('0x89')]=undefined;this[_0xeb03('0x1a5')](_0x3219c1[_0xeb03('0x196')])[_0xeb03('0xae')](this[_0xeb03('0x1a2')](_0x3219c1))['then'](mergeDataErlangB(_0x3219c1))[_0xeb03('0xae')](this['startMethodPredictive'](_0x3219c1))['catch'](loggerCatchPredictive('[averageHandleTime][ErlangB]\x20',_0x3219c1));}};Dialer['prototype'][_0xeb03('0x1a2')]=function(_0x1e1aaf){var _0x23210f=this;return function(_0x3a23f1){return new BPromise(function(_0x424ea4,_0x2cdbc0){_['merge'](_0x1e1aaf,_0x3a23f1[0x0]);if(checkGetDataPredictive(_0x3a23f1[0x0])){loggerPredictive[_0xeb03('0x7f')](JSON[_0xeb03('0x4c')](_0x3a23f1[0x0]));if(_0x1e1aaf[_0xeb03('0x199')]===_0xeb03('0x19a')){return _0x23210f['getVoiceQueueRtPauses'](_0x1e1aaf['id'])['then'](function(_0x58a03b){var _0x3592d4=_0x1e1aaf['loggedIn']-_0x58a03b[0x0][_0xeb03('0x1a6')];var _0x48e50b=_0x1e1aaf[_0xeb03('0x196')]*0x3c;var _0x258827=_0x3a23f1[0x0][_0xeb03('0x6f')]+_0x3a23f1[0x0][_0xeb03('0x6e')];var _0x2d9abd=(_0x3a23f1[0x0]['predictiveIntervalAnsweredCalls']+_0x3a23f1[0x0][_0xeb03('0x71')]+_0x3a23f1[0x0][_0xeb03('0x70')])/_0x3a23f1[0x0][_0xeb03('0x7d')];var _0x4ccdbb=_0x1e1aaf[_0xeb03('0x18b')]/0x64;_0x1e1aaf[_0xeb03('0x18c')]=_0x58a03b[0x0][_0xeb03('0x1a6')]||0x0;_0x1e1aaf[_0xeb03('0x18f')]=_0x2d9abd>0x0?_0x2d9abd:0x1;return _0x23210f[_0xeb03('0x1a7')](_0x3592d4,_0x48e50b,_0x258827,_0x2d9abd,_0x4ccdbb);})['then'](function(_0x320045){return _0x424ea4(_0x320045);})['catch'](function(_0x18a52d){return _0x2cdbc0(msgResponse(_0xeb03('0x1a8'),_0xeb03('0x116'),JSON[_0xeb03('0x4c')](_0x18a52d)));});}if(_0x1e1aaf[_0xeb03('0x199')]===_0xeb03('0x1a9')){return _0x23210f[_0xeb03('0xb9')](_0x1e1aaf['id'])[_0xeb03('0xae')](function(_0x393709){var _0x2f7003=_0x1e1aaf[_0xeb03('0x51')]-_0x393709[0x0][_0xeb03('0x1a6')];var _0x5e1d4a=_0x1e1aaf[_0xeb03('0x196')]*0x3c;var _0x47e0bb=_0x3a23f1[0x0]['predictiveIntervalAvgTalktime']+_0x3a23f1[0x0]['predictiveIntervalAvgHoldtime'];var _0x22bbe2=(_0x3a23f1[0x0][_0xeb03('0x1aa')]+_0x3a23f1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3a23f1[0x0][_0xeb03('0x70')])/_0x3a23f1[0x0][_0xeb03('0x7d')];var _0x132de6=_0x1e1aaf['dialPredictiveOptimizationPercentage']/0x64;_0x1e1aaf[_0xeb03('0x18c')]=_0x393709[0x0]['outboundQueuePauses']||0x0;_0x1e1aaf[_0xeb03('0x18f')]=_0x22bbe2>0x0?_0x22bbe2:0x1;return _0x23210f['busyFactor'](_0x2f7003,_0x5e1d4a,_0x47e0bb,_0x22bbe2,_0x132de6);})['then'](function(_0x1f6bde){return _0x424ea4(_0x1f6bde);})[_0xeb03('0xa7')](function(_0x32b772){return _0x2cdbc0(msgResponse(_0xeb03('0x1a8'),'Failure',JSON['stringify'](_0x32b772)));});}}else{return _0x2cdbc0(msgResponse('[getDataPredictive]',_0xeb03('0x116'),_0xeb03('0x1ab')));}});};};Dialer['prototype'][_0xeb03('0x1ac')]=function(_0x2c6362){var _0x17aecc=this;return function(){var _0x3373d1=0x0;var _0x51f6ec=Math['floor'](_0x2c6362[_0xeb03('0x1ad')]*0x3e8);if(_0x51f6ec>0x0){_0x51f6ec=_0x51f6ec<0x64?0x64:_0x51f6ec;loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x1ae'),_0x51f6ec);_0x2c6362[_0xeb03('0x89')]=setInterval(function(){_0x17aecc['handlePredictive'](_0x2c6362);loggerPredictiveCalls['info']('[handlePredictive]',_0x3373d1+=0x1);},_0x51f6ec);}else{loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x1af'),_0xeb03('0x1b0'),_0x51f6ec);}};};Dialer['prototype']['checkContactBlack']=function(_0x2a1552,_0x1fbf57){var _0x48e489=this;return function(_0x2a3262){if(_['isEmpty'](_0x2a3262)){if(_[_0xeb03('0xcd')](_0x1fbf57[_0xeb03('0x1b1')])||!_0x1fbf57[_0xeb03('0x1b2')]){if(_0x2a1552[_0xeb03('0x5d')]===_0xeb03('0x9')){_0x2a1552[_0xeb03('0xff')]=_[_0xeb03('0x7e')](_0x2a1552[_0xeb03('0xff')])?!![]:_0x2a1552[_0xeb03('0xff')];var _0x1b12c1=uuid['v4']();_0x48e489[_0xeb03('0xf9')][_0x1b12c1]=new Action(_0x2a1552,_0x1fbf57,_0x1b12c1);loggerBooked[_0xeb03('0x7f')](_0xeb03('0x1b3'),_0x1b12c1,_0xeb03('0x1b4'),JSON[_0xeb03('0x4c')](_0x2a1552['queueStatusComplete']),_0xeb03('0x1b5'),_0x2a1552['name']);if(_0x2a1552['queueStatusComplete']){_0x2a1552['queueStatusComplete']=![];_0x48e489['queueBooked'][_0x48e489['actions'][_0x1b12c1][_0xeb03('0xaa')]]=[];ami[_0xeb03('0xa4')]({'actionid':_0x1b12c1,'action':_0xeb03('0x1b6'),'queue':_0x2a1552[_0xeb03('0x45')]})['catch'](function(_0x2acdb6){_0x48e489[_0xeb03('0xa9')](_0x2a1552);_0x48e489[_0xeb03('0xb5')]({'active':![],'ContactId':_0x48e489[_0xeb03('0xf9')][_0x1b12c1]['ContactId'],'ListId':_0x48e489[_0xeb03('0xf9')][_0x1b12c1]['ListId'],'VoiceQueueId':_0x48e489['actions'][_0x1b12c1]['VoiceQueueId']||undefined,'CampaignId':_0x48e489['actions'][_0x1b12c1][_0xeb03('0x105')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x48e489[_0xeb03('0xf9')][_0x1b12c1];});}else{loggerBooked[_0xeb03('0x7f')](_0xeb03('0x1b7'),JSON[_0xeb03('0x4c')](_0x2a1552[_0xeb03('0xff')]),_0xeb03('0x1b5'),_0x2a1552['name']);_0x48e489[_0xeb03('0xa9')](_0x2a1552);_0x48e489['rescheduleContact']({'active':![],'ContactId':_0x48e489[_0xeb03('0xf9')][_0x1b12c1][_0xeb03('0x104')],'ListId':_0x48e489[_0xeb03('0xf9')][_0x1b12c1][_0xeb03('0xc3')],'VoiceQueueId':_0x48e489[_0xeb03('0xf9')][_0x1b12c1][_0xeb03('0xc4')]||undefined,'CampaignId':_0x48e489[_0xeb03('0xf9')][_0x1b12c1]['CampaignId']||undefined})[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x1b8')));delete _0x48e489[_0xeb03('0xf9')][_0x1b12c1];}}else{return _0x48e489[_0xeb03('0x139')](_0x2a1552,_0x1fbf57);}}else{if(getDiff(_0x1fbf57[_0xeb03('0x1b9')])<_0x2a1552[_0xeb03('0x1ba')]*0x3c){_0x48e489[_0xeb03('0x23')][_0xeb03('0x101')](_0x1fbf57['id'])[_0xeb03('0x21')](function(){_0x48e489[_0xeb03('0xa9')](_0x2a1552);});}else{_0x2a1552[_0xeb03('0x6b')]+=0x1;_0x48e489[_0xeb03('0xa9')](_0x2a1552);if(_0x2a1552['dialRecallInQueue']){_0x48e489[_0xeb03('0xb5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1fbf57['ContactId'],'ListId':_0x1fbf57[_0xeb03('0xc3')],'VoiceQueueId':_0x1fbf57['VoiceQueueId']||undefined,'CampaignId':_0x1fbf57[_0xeb03('0x105')]||undefined})[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x1bb')));_0x48e489[_0xeb03('0xbc')](createObjHistory(_0x2a1552,_0x1fbf57,_0xeb03('0x1bc'),0x17,'RecallInQueue'))[_0xeb03('0xa7')](loggerCatch(_0xeb03('0x1bd')));}else{_0x48e489[_0xeb03('0xd9')](createObjHistory(_0x2a1552,_0x1fbf57,_0xeb03('0x1be'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0xeb03('0x1bf'));}}}}else{_0x2a1552[_0xeb03('0x64')]+=0x1;_0x48e489[_0xeb03('0xd9')](createObjHistory(_0x2a1552,_0x1fbf57,_0xeb03('0x1c0'),0xd,_0xeb03('0x1c1')),_0xeb03('0x1c2'),_0xeb03('0x1c3'));throw'inBlackList';}};};Dialer[_0xeb03('0x1e')][_0xeb03('0x12d')]=function(_0xe8d526){var _0x133bfc=this;var _0x324204=[];var _0x4c0703=_0xe8d526[_0xeb03('0x1c4')]-_0xe8d526[_0xeb03('0x74')]-_0xe8d526[_0xeb03('0x1c5')];emitCampaignSummary(_0xe8d526);if(_0x4c0703>0x0){if(_0x4c0703>this['maxNumberOriginate']){_0x4c0703=this[_0xeb03('0x28')];}_0xe8d526[_0xeb03('0x1c5')]+=_0x4c0703;this[_0xeb03('0xb8')](_0xe8d526['id'],_0x4c0703,_0xe8d526['dialOrderByScheduledAt'])[_0xeb03('0xae')](function(_0x2a3f01){_0xe8d526[_0xeb03('0x1c5')]-=_0x4c0703;_0xe8d526['temp']=_0xe8d526[_0xeb03('0x1c5')]>0x0?_0xe8d526[_0xeb03('0x1c5')]:0x0;if(!checkContactEmpty(_0x2a3f01)){_0xe8d526[_0xeb03('0x43')]=_0xeb03('0x95');logger['info'](_0xeb03('0x1c6')+_0xe8d526[_0xeb03('0x45')]);}else{_0xe8d526[_0xeb03('0x74')]+=_0x2a3f01[_0xeb03('0x109')];_0xe8d526[_0xeb03('0x43')]='RUNNING';for(var _0x54ce8a=0x0;_0x54ce8a<_0x2a3f01[_0xeb03('0x109')];_0x54ce8a+=0x1){_0xe8d526[_0xeb03('0x1c7')]+=0x1;if(_['isNil'](_0x2a3f01[_0x54ce8a])||_[_0xeb03('0xcd')](_0x2a3f01[_0x54ce8a][_0xeb03('0x13d')])||_[_0xeb03('0xcd')](_0x2a3f01[_0x54ce8a][_0xeb03('0x13d')][_0xeb03('0x13e')])){_0x133bfc['emptyContact']('[actionOriginate]\x20',_0xe8d526,_0x2a3f01[_0x54ce8a]);}else{_0x133bfc['checkIsBlackListIvr'](_[_0xeb03('0xc2')](_0x2a3f01[_0x54ce8a],[_0xeb03('0x105'),'Contact.phone']))[_0xeb03('0xae')](_0x133bfc['checkContactBlack'](_0xe8d526,_0x2a3f01[_0x54ce8a]))['catch'](_0x133bfc[_0xeb03('0xbf')]('[actionOriginateIvr]\x20',_0xe8d526));}}}})[_0xeb03('0xa7')](loggerGetContactDialer('[getContactCampaign2]',_0xe8d526,_0x4c0703));}};Dialer['prototype']['handlePower']=function(_0x210c20,_0x524720){var _0x10f852=this;var _0x3e55ed=[];var _0x52a4ac=_0x524720>=0x1?_0x524720:0x1;var _0x52775d=[];if(_0x210c20[_0xeb03('0x5d')]===_0xeb03('0x9')){_0x52a4ac=0x1;}var _0x57949c=Math[_0xeb03('0x18d')](_0x210c20['available']*_0x52a4ac)-_0x210c20[_0xeb03('0x74')]-_0x210c20[_0xeb03('0x1c5')];emitVoiceQueueSummary(_0x210c20);if(_0x210c20[_0xeb03('0x1c8')]>0x0){var _0x51c44e=_0x210c20[_0xeb03('0x1c8')]-_0x210c20[_0xeb03('0x74')]-_0x210c20[_0xeb03('0x56')]-_0x210c20[_0xeb03('0x1c5')]-_0x210c20[_0xeb03('0x52')];if(_0x57949c>_0x51c44e){_0x57949c=_0x51c44e;}}if(_0x57949c>0x0){if(_0x210c20[_0xeb03('0x5d')]==='booked'){_0x57949c=0x1;}if(_0x57949c>this['maxNumberOriginate']){_0x57949c=this[_0xeb03('0x28')];}_0x210c20['temp']+=_0x57949c;for(var _0xa29a6 in this[_0xeb03('0x26')]){if(this['agents'][_0xeb03('0xa3')](_0xa29a6)){if(this['agents'][_0xa29a6][_0xeb03('0x9c')]===_0xeb03('0x1c9')&&this['agents'][_0xa29a6][_0xeb03('0xa5')]===_0xeb03('0xcb')){_0x3e55ed[_0xeb03('0xfe')](this['agents'][_0xa29a6]['id']);}}}this[_0xeb03('0x1ca')](_0x210c20['id'],_0x3e55ed,_0x57949c,_0x210c20[_0xeb03('0x1cb')])['then'](function(_0x1a0f59){_0x210c20[_0xeb03('0x1c5')]-=_0x57949c;_0x210c20['temp']=_0x210c20['temp']>0x0?_0x210c20[_0xeb03('0x1c5')]:0x0;if(!checkContactEmpty(_0x1a0f59)){_0x10f852[_0xeb03('0xac')](_0x210c20)[_0xeb03('0xae')](sendMessageReschedule(_0x210c20))[_0xeb03('0xa7')](loggerCatch('[countReScheduled]\x20'));}else{_0x210c20[_0xeb03('0x74')]+=_0x1a0f59[_0xeb03('0x109')];_0x210c20['message']=_0x210c20[_0xeb03('0x5d')]===_0xeb03('0x9')?_0xeb03('0x145'):_0xeb03('0x1cc');for(var _0xcd0bc8=0x0;_0xcd0bc8<_0x1a0f59[_0xeb03('0x109')];_0xcd0bc8+=0x1){if(_[_0xeb03('0xcd')](_0x1a0f59[_0xcd0bc8])||_[_0xeb03('0xcd')](_0x1a0f59[_0xcd0bc8]['Contact'])||_[_0xeb03('0xcd')](_0x1a0f59[_0xcd0bc8]['Contact']['phone'])){_0x10f852[_0xeb03('0xc0')]('[actionOriginate]\x20',_0x210c20,_0x1a0f59[_0xcd0bc8]);}else{_0x10f852[_0xeb03('0xb0')](_[_0xeb03('0xc2')](_0x1a0f59[_0xcd0bc8],[_0xeb03('0xc4'),_0xeb03('0x1cd')]))[_0xeb03('0xae')](_0x10f852[_0xeb03('0x1ce')](_0x210c20,_0x1a0f59[_0xcd0bc8]))[_0xeb03('0xa7')](_0x10f852['loggerHandler'](_0xeb03('0x1cf'),_0x210c20));}}}})[_0xeb03('0xa7')](loggerGetContactDialer(_0xeb03('0x1d0'),_0x210c20,_0x57949c));}};Dialer[_0xeb03('0x1e')][_0xeb03('0x89')]=function(_0xe8c8ba){var _0x3c7cf3=this;if(_0xe8c8ba['dialLimitQueue']>0x0){var _0x4da558=_0xe8c8ba[_0xeb03('0x1c8')]-_0xe8c8ba['originated']-_0xe8c8ba[_0xeb03('0x56')];if(_0x4da558>0x0){this[_0xeb03('0x1d1')](_0xe8c8ba);}else{loggerPredictiveCalls[_0xeb03('0x7f')](_0xeb03('0x1d2'));}}else{this[_0xeb03('0x1d1')](_0xe8c8ba);}};Dialer[_0xeb03('0x1e')][_0xeb03('0x1d1')]=function(_0x28ec21){var _0x2fa402=this;var _0x2d718e=[];_0x28ec21[_0xeb03('0x74')]+=0x1;for(var _0x198072 in this[_0xeb03('0x26')]){if(this[_0xeb03('0x26')][_0xeb03('0xa3')](_0x198072)){if(this[_0xeb03('0x26')][_0x198072][_0xeb03('0x9c')]===_0xeb03('0x1c9')&&this[_0xeb03('0x26')][_0x198072]['status']===_0xeb03('0xcb')){_0x2d718e[_0xeb03('0xfe')](this[_0xeb03('0x26')][_0x198072]['id']);}}}this[_0xeb03('0x1ca')](_0x28ec21['id'],_0x2d718e,0x1,_0x28ec21[_0xeb03('0x1cb')])[_0xeb03('0xae')](function(_0x3ab5ec){if(!checkContactEmpty(_0x3ab5ec)){checkContactLowerLimitOriginate(_0x28ec21,0x1,0x0);_0x2fa402['countReScheduled'](_0x28ec21)[_0xeb03('0xae')](sendMessageReschedule(_0x28ec21))['catch'](loggerCatch(_0xeb03('0xaf')));}else{_0x28ec21[_0xeb03('0x43')]=_0xeb03('0x1cc');if(_[_0xeb03('0xcd')](_0x3ab5ec[0x0])||_[_0xeb03('0xcd')](_0x3ab5ec[0x0][_0xeb03('0x13d')])||_[_0xeb03('0xcd')](_0x3ab5ec[0x0][_0xeb03('0x13d')]['phone'])){_0x2fa402[_0xeb03('0xc0')]('[actionOriginate]\x20',_0x28ec21,_0x3ab5ec[0x0]);}else{_0x2fa402[_0xeb03('0xb0')](_[_0xeb03('0xc2')](_0x3ab5ec[0x0],[_0xeb03('0xc4'),_0xeb03('0x1cd')]))['then'](_0x2fa402[_0xeb03('0x1ce')](_0x28ec21,_0x3ab5ec[0x0]))[_0xeb03('0xa7')](_0x2fa402[_0xeb03('0xbf')](_0xeb03('0x1d3'),_0x28ec21));}}})[_0xeb03('0xa7')](loggerGetContactDialer('[getContactDialerPredictive]',_0x28ec21,0x1));emitVoiceQueueSummary(_0x28ec21);};Dialer[_0xeb03('0x1e')][_0xeb03('0x1a7')]=function(_0x2aecdb,_0x136e18,_0x4fa151,_0x1cc3d3,_0x5d2a1c,_0x5584d9){loggerPredictive[_0xeb03('0x7f')](_0xeb03('0x1d4'),_0xeb03('0x1d5'),_0x2aecdb,_0xeb03('0x1d6'),_0x136e18,_0xeb03('0x1d7'),_0x4fa151,'\x20p\x20=\x20',_0x1cc3d3,_0xeb03('0x1d8'),_0x5d2a1c);return new BPromise(function(_0x59ac3e,_0xa00619){if(_0x2aecdb<=0x0||isNaN(_0x2aecdb)){return _0xa00619(msgResponse(_0xeb03('0x1d4'),_0xeb03('0x4b'),_0xeb03('0x1d9')+_0x2aecdb));}if(_0x4fa151<=0x0||isNaN(_0x4fa151)){return _0xa00619(msgResponse('[abandonmentRate]',_0xeb03('0x4b'),_0xeb03('0x1da')+_0x4fa151));}if(_0x1cc3d3<=0x0||isNaN(_0x1cc3d3)){return _0xa00619(msgResponse(_0xeb03('0x1d4'),_0xeb03('0x4b'),_0xeb03('0x1db')+_0x1cc3d3));}if(_0x136e18<=0x0||isNaN(_0x136e18)){return _0xa00619(msgResponse(_0xeb03('0x1d4'),'Error',_0xeb03('0x1dc')+_0x136e18));}if(_0x5d2a1c<=0x0||isNaN(_0x5d2a1c)){return _0xa00619(msgResponse('[abandonmentRate]',_0xeb03('0x4b'),'Amax\x20=\x20'+_0x5d2a1c));}_0x5584d9=_0x5584d9||0x0;var _0x4c3f91=0x1/_0x4fa151;var _0x466eab=0x0;var _0x14fd16=0x0;var _0x2ec693=0x0;var _0x1b45a4=0x0;for(var _0xc9bff4=0x0;_0x2ec693<_0x5d2a1c;_0xc9bff4+=0x1){_0x14fd16=_0xc9bff4/_0x136e18;_0x466eab=(_0x1cc3d3*_0x14fd16+_0x5584d9)/_0x4c3f91;_0x2ec693=erlangb(_0x466eab,_0x2aecdb);_0x1b45a4=_0x466eab/_0x2aecdb*(0x1-erlangb(_0x466eab,_0x2aecdb));}return _0x59ac3e({'erlangCalls':_0xc9bff4,'erlangCallToSecond':_0x136e18/_0xc9bff4,'erlangAbandonmentRate':_0x2ec693,'erlangBusyFactor':_0x1b45a4});});};Dialer['prototype'][_0xeb03('0x1dd')]=function(_0x4ee5e5,_0x4621d6,_0x19dbf3,_0xd1f2d5,_0x3ed23d,_0x29a4ff){loggerPredictive['info']('[busyFactor]',_0xeb03('0x1d5'),_0x4ee5e5,_0xeb03('0x1d6'),_0x4621d6,'\x20Ts\x20=\x20',_0x19dbf3,_0xeb03('0x1de'),_0xd1f2d5,_0xeb03('0x1df'),_0x3ed23d);return new BPromise(function(_0x6f543d,_0xcf9916){if(_0x4ee5e5<=0x0||isNaN(_0x4ee5e5)){return _0xcf9916(msgResponse(_0xeb03('0x1d4'),_0xeb03('0x4b'),'m\x20=\x20'+_0x4ee5e5));}if(_0x19dbf3<=0x0||isNaN(_0x19dbf3)){return _0xcf9916(msgResponse(_0xeb03('0x1d4'),_0xeb03('0x4b'),_0xeb03('0x1da')+_0x19dbf3));}if(_0xd1f2d5<=0x0||isNaN(_0xd1f2d5)){return _0xcf9916(msgResponse(_0xeb03('0x1d4'),_0xeb03('0x4b'),_0xeb03('0x1db')+_0xd1f2d5));}if(_0x4621d6<=0x0||isNaN(_0x4621d6)){return _0xcf9916(msgResponse(_0xeb03('0x1d4'),'Error',_0xeb03('0x1dc')+_0x4621d6));}if(_0x3ed23d<=0x0||isNaN(_0x3ed23d)){return _0xcf9916(msgResponse(_0xeb03('0x1d4'),'Error',_0xeb03('0x1e0')+_0x3ed23d));}_0x29a4ff=_0x29a4ff||0x0;var _0x547b9f=0x1/_0x19dbf3;var _0x4e0b47=0x0;var _0x5ab20c=0x0;var _0x16b7de=0x0;var _0x5e6c7e=0x0;for(var _0x5667cf=0x0;_0x5e6c7e<_0x3ed23d;_0x5667cf+=0x1){_0x5ab20c=_0x5667cf/_0x4621d6;_0x4e0b47=(_0xd1f2d5*_0x5ab20c+_0x29a4ff)/_0x547b9f;_0x16b7de=erlangb(_0x4e0b47,_0x4ee5e5);_0x5e6c7e=_0x4e0b47/_0x4ee5e5*(0x1-erlangb(_0x4e0b47,_0x4ee5e5));}return _0x6f543d({'erlangCalls':_0x5667cf,'erlangCallToSecond':_0x4621d6/_0x5667cf,'erlangAbandonmentRate':_0x16b7de,'erlangBusyFactor':_0x5e6c7e});});};module[_0xeb03('0x1e1')]=Dialer; \ No newline at end of file +var _0xd7d1=['maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','predictiveIntervalAvgTalktime','info','[checkGetDataPredictive][avgTalktime]','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][objIsEmpty]','merge','seconds','[freeVariablesPredictive]','handlePredictive','string','format','\x22\x22\x20<>','error','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','talking','waiting','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','loopClearZombieChannels','clearZombieChannels','uniqueId','[actions]','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','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','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerCallsDay','Machine','membername','amd','[syncMachine][createHistory]','uniqueid','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','TIMEOUT','Abandoned','dropreason','CALLEREXIT','actionid','paused','stateinterface','locked','push','pick','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[unlock][syncQueueStatusComplete]','rrmemory','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','CampaignId','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','content','true','indexOf','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','predictive','Queue','method\x20not\x20recognized','handleIvr','dialActive','loggedIn','checkIfTime','dialGlobalInterval','[syncQueueSummary]','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','NONE','\x22agi://%s/square,%s\x22','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countcongestionretry','dialGlobalMaxRetry','countnoanswerretry','dialNoAnswerMaxRetry','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','add','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','reason\x205\x20busy','Congestion','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','floor','erlangCalls','erlangAbandonmentRate','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','[startMethodPredictive][StartPredictive][First]','averageHandleTime','startMethodPredictive','[averageHandleTime][ErlangB]\x20','[startMethodPredictive][StartPredictive][Repeat]','getDataPredictive','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','busyFactor','[getDataPredictive]','[startMethodPredictive]','[handlePredictive]','Failure\x20','recallme','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','\x20interval\x20=\x20','\x20Ts\x20=\x20','\x20p\x20=\x20','\x20Amax\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','\x20m\x20=\x20','Amax\x20=\x20','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','env','XCALLY_IP_AGI','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks'];(function(_0x3a754c,_0x2cd221){var _0x64d23b=function(_0x1b6b6f){while(--_0x1b6b6f){_0x3a754c['push'](_0x3a754c['shift']());}};_0x64d23b(++_0x2cd221);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x5a500a,_0x46889a){_0x5a500a=_0x5a500a-0x0;var _0x73909d=_0xd7d1[_0x5a500a];return _0x73909d;};'use strict';var util=require(_0x1d7d('0x0'));var _=require(_0x1d7d('0x1'));var BPromise=require(_0x1d7d('0x2'));var uuid=require(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var rr=require('rr');var md5=require(_0x1d7d('0x5'));var Redis=require(_0x1d7d('0x6'));var config=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var loggerBooked=require(_0x1d7d('0x8'))(_0x1d7d('0xa'));var loggerPredictive=require(_0x1d7d('0x8'))('predictive');var loggerPredictiveCalls=require(_0x1d7d('0x8'))(_0x1d7d('0xb'));var loggerSyncQueueSummary=require(_0x1d7d('0x8'))(_0x1d7d('0xc'));var ami=require(_0x1d7d('0xd'));config[_0x1d7d('0xe')]=_[_0x1d7d('0xf')](config[_0x1d7d('0xe')],{'host':_0x1d7d('0x10'),'port':0x18eb});var io=require(_0x1d7d('0x11'))(new Redis(config[_0x1d7d('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x1d7d('0x12'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1d7d('0x13'));var voiceQueueRt=require(_0x1d7d('0x14'));var Action=require(_0x1d7d('0x15'));var History=require(_0x1d7d('0x16'));var Final=require('./final');var AgentComplete=require(_0x1d7d('0x17'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x1d7d('0x18')][_0x1d7d('0x19')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x1d7d('0x1a')};var Sequence=function(){};Sequence[_0x1d7d('0x1b')][_0x1d7d('0x1c')]=function(_0x183fc6){this[_0x1d7d('0x1d')]=this['tail']?this[_0x1d7d('0x1d')][_0x1d7d('0x1e')](_0x183fc6):_0x183fc6();};function Dialer(_0x51cbca,_0xb90a8c){this[_0x1d7d('0x1f')]=new Sequence();this[_0x1d7d('0x20')]=_0xb90a8c;this[_0x1d7d('0x21')]=_0x51cbca[_0x1d7d('0x21')];this['campaigns']=_0x51cbca[_0x1d7d('0x22')];this[_0x1d7d('0x23')]=_0x51cbca['agents'];this['trunks']=_0x51cbca[_0x1d7d('0x24')];this[_0x1d7d('0x25')]=config[_0x1d7d('0x25')]||0x2;this[_0x1d7d('0x26')]={};this[_0x1d7d('0x27')]={};this[_0x1d7d('0x28')]={};this['uniqueId']={};this[_0x1d7d('0x29')]={};this[_0x1d7d('0x2a')]={};this[_0x1d7d('0x2b')]={};this['ivrOriginated']={};this[_0x1d7d('0x2c')]={};this[_0x1d7d('0x2d')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x2f'),this[_0x1d7d('0x30')]['bind'](this));ami['on'](_0x1d7d('0x31'),this[_0x1d7d('0x32')][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x33'),this['syncAgentComplete'][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x34'),this['syncQueueSummary']['bind'](this));ami['on'](_0x1d7d('0x35'),this['syncHangup'][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x36'),this[_0x1d7d('0x37')][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x38'),this['syncVarSet'][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x39'),this[_0x1d7d('0x3a')]['bind'](this));ami['on'](_0x1d7d('0x3b'),this[_0x1d7d('0x3c')][_0x1d7d('0x2e')](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x53e25c){return _0x53e25c!==null&&!_[_0x1d7d('0x3d')](_0x53e25c);}function checkIsLoggedIn(_0x329f56,_0x559f19){return function(){if(_0x559f19<=0x0){_0x329f56[_0x1d7d('0x3e')]=_0x1d7d('0x3f');throw _0x329f56[_0x1d7d('0x40')]+_0x1d7d('0x41');}};}function isActive(_0x342f4e){return _0x342f4e;}function checkIsActive(_0x22fec9,_0x452293){return function(){if(!isActive(_0x452293)){_0x22fec9[_0x1d7d('0x3e')]=_0x1d7d('0x42');throw _0x22fec9[_0x1d7d('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x57c22e){return function(){if(!isNotNull(_0x57c22e[_0x1d7d('0x43')])){_0x57c22e[_0x1d7d('0x3e')]=_0x1d7d('0x44');throw _0x57c22e[_0x1d7d('0x40')]+_0x1d7d('0x45');}if(!isNotNull(_0x57c22e[_0x1d7d('0x43')][_0x1d7d('0x46')])){_0x57c22e[_0x1d7d('0x3e')]=_0x1d7d('0x44');throw _0x57c22e['name']+_0x1d7d('0x45');}if(!isNotNull(_[_0x1d7d('0x47')](_0x57c22e[_0x1d7d('0x43')][_0x1d7d('0x46')]))){_0x57c22e['message']='INTERVAL_IS_NULL';throw _0x57c22e[_0x1d7d('0x40')]+_0x1d7d('0x45');}};}function msgResponse(_0x520b56,_0x103c77,_0x3fea2e){return{'action':_0x520b56,'response':_0x103c77,'message':_0x3fea2e};}function myreject(_0x568092){return function(_0x4cd758){return _0x568092(msgResponse(_0x1d7d('0x48'),_0x1d7d('0x49'),JSON[_0x1d7d('0x4a')](_0x4cd758)));};}function getSeconds(_0x3f686d,_0x1867da){var _0x3427eb=moment(_0x3f686d)[_0x1d7d('0x4b')](0x0);var _0x37d003=moment(_0x1867da)[_0x1d7d('0x4b')](0x0);return _0x3427eb[_0x1d7d('0x4c')](_0x37d003,'seconds');}function emit(_0x5ed8a6,_0x57db7a,_0x5cab41){io['to'](_0x5ed8a6)[_0x1d7d('0x4d')](_0x57db7a,_0x5cab41);}function emitVoiceQueueSummary(_0x5e7e8b){if(_0x5e7e8b[_0x1d7d('0x4e')]===_0x1d7d('0x4f')){var _0x3d7c65={'id':_0x5e7e8b['id'],'name':_0x5e7e8b['name'],'strategy':_0x5e7e8b[_0x1d7d('0x50')],'answered':_0x5e7e8b[_0x1d7d('0x51')],'available':_0x5e7e8b[_0x1d7d('0x52')],'loggedIn':_0x5e7e8b['loggedIn'],'pTalking':_0x5e7e8b[_0x1d7d('0x53')],'sumBillable':_0x5e7e8b[_0x1d7d('0x54')],'sumDuration':_0x5e7e8b[_0x1d7d('0x55')],'sumHoldTime':_0x5e7e8b[_0x1d7d('0x56')]||0x0,'talking':_0x5e7e8b['talking'],'total':_0x5e7e8b[_0x1d7d('0x57')],'type':_0x5e7e8b[_0x1d7d('0x4e')],'unmanaged':_0x5e7e8b[_0x1d7d('0x58')],'abandoned':_0x5e7e8b[_0x1d7d('0x59')],'waiting':_0x5e7e8b['waiting'],'loggedInDb':_0x5e7e8b[_0x1d7d('0x5a')],'dialActive':_0x5e7e8b['dialActive'],'dialMethod':_0x5e7e8b[_0x1d7d('0x5b')],'dialOriginateCallerIdName':_0x5e7e8b[_0x1d7d('0x5c')],'dialOriginateCallerIdNumber':_0x5e7e8b[_0x1d7d('0x5d')],'dialOriginateTimeout':_0x5e7e8b[_0x1d7d('0x5e')],'dialPrefix':_0x5e7e8b[_0x1d7d('0x5f')],'outboundAnswerAgiCallsDay':_0x5e7e8b['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5e7e8b['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x5e7e8b[_0x1d7d('0x60')],'outboundBusyCallsDay':_0x5e7e8b[_0x1d7d('0x61')],'outboundCongestionCallsDay':_0x5e7e8b[_0x1d7d('0x62')],'outboundDropCallsDayACS':_0x5e7e8b['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x5e7e8b['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5e7e8b[_0x1d7d('0x63')],'outboundNoAnswerCallsDay':_0x5e7e8b['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x5e7e8b[_0x1d7d('0x64')],'outboundOriginateFailureCallsDay':_0x5e7e8b[_0x1d7d('0x65')],'outboundReCallsDay':_0x5e7e8b[_0x1d7d('0x66')],'outboundRejectCallsDay':_0x5e7e8b[_0x1d7d('0x67')],'outboundUnknownCallsDay':_0x5e7e8b[_0x1d7d('0x68')],'predictiveIntervalAnsweredCalls':_0x5e7e8b[_0x1d7d('0x69')],'predictiveIntervalAvgHoldtime':_0x5e7e8b[_0x1d7d('0x6a')],'predictiveIntervalAvgTalktime':_0x5e7e8b['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5e7e8b[_0x1d7d('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x5e7e8b[_0x1d7d('0x6c')],'predictiveIntervalErlangCalls':_0x5e7e8b['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5e7e8b[_0x1d7d('0x6d')],'predictiveIntervalHitRate':_0x5e7e8b[_0x1d7d('0x6e')],'predictiveIntervalLowerLimit':_0x5e7e8b[_0x1d7d('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x5e7e8b[_0x1d7d('0x70')],'predictiveIntervalPauses':_0x5e7e8b[_0x1d7d('0x71')],'predictiveIntervalTotalCalls':_0x5e7e8b[_0x1d7d('0x72')],'message':_0x5e7e8b[_0x1d7d('0x3e')],'originated':_0x5e7e8b[_0x1d7d('0x73')]};if(_0x5e7e8b[_0x1d7d('0x74')]){_0x3d7c65[_0x1d7d('0x74')]={'id':_0x5e7e8b[_0x1d7d('0x74')]['id'],'name':_0x5e7e8b[_0x1d7d('0x74')]['name'],'active':_0x5e7e8b[_0x1d7d('0x74')]['active'],'callerid':_0x5e7e8b[_0x1d7d('0x74')]['callerid']};}if(_0x5e7e8b[_0x1d7d('0x43')]){_0x3d7c65[_0x1d7d('0x43')]={'id':_0x5e7e8b[_0x1d7d('0x43')]['id'],'name':_0x5e7e8b[_0x1d7d('0x43')]['name']};}var _0x2dbb61=md5(JSON['stringify'](_0x3d7c65));if(_0x5e7e8b['md5']!==_0x2dbb61){_0x5e7e8b[_0x1d7d('0x5')]=_0x2dbb61;emit(util['format']('voice:queue:%s',_0x3d7c65[_0x1d7d('0x40')]),_0x1d7d('0x75'),_0x3d7c65);}}}function emitCampaignSummary(_0x506564){if(_0x506564[_0x1d7d('0x4e')]===_0x1d7d('0x76')){emit(util['format'](_0x1d7d('0x77'),_0x506564[_0x1d7d('0x40')]),_0x1d7d('0x78'),_0x506564);}}function checkGetDataPredictive(_0x32b6c0){if(isNotNull(_0x32b6c0)){if(!_['isEmpty'](_0x32b6c0)){if(_0x32b6c0['predictiveIntervalTotalCalls']>0x0){if(!_[_0x1d7d('0x3d')](_0x32b6c0[_0x1d7d('0x79')])&&_0x32b6c0[_0x1d7d('0x79')]>0x0){return!![];}else{loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x7b'),JSON['stringify'](_0x32b6c0));}if(!_[_0x1d7d('0x3d')](_0x32b6c0[_0x1d7d('0x6a')])&&_0x32b6c0[_0x1d7d('0x6a')]>0x0){return!![];}else{loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x7c'),JSON[_0x1d7d('0x4a')](_0x32b6c0));}}else{loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x7d'),JSON[_0x1d7d('0x4a')](_0x32b6c0));}}else{loggerPredictive['info'](_0x1d7d('0x7e'),JSON[_0x1d7d('0x4a')](_0x32b6c0));}}else{loggerPredictive[_0x1d7d('0x7a')]('[checkGetDataPredictive][obj]',JSON['stringify'](_0x32b6c0));}return![];}function mergeDataErlangB(_0x1d3f54){return function(_0x2d4cc3){loggerPredictive[_0x1d7d('0x7a')]('[ErlangB]',JSON[_0x1d7d('0x4a')](_0x2d4cc3));_[_0x1d7d('0x7f')](_0x1d3f54,_0x2d4cc3);};}function getDiff(_0x5eff64){var _0x12547a=moment()[_0x1d7d('0x4b')](0x0);var _0x3fc216=moment(_0x5eff64)[_0x1d7d('0x4b')](0x0);return _0x12547a['diff'](_0x3fc216,_0x1d7d('0x80'));}function ifInterval(_0x202af4,_0x4ba6ec){if(_['isUndefined'](_0x4ba6ec)){return![];}if(getDiff(_0x4ba6ec)<_0x202af4*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x115cb2){if(isNotNull(_0x115cb2)){if(!_[_0x1d7d('0x3d')](_0x115cb2['startProgressive'])){_0x115cb2['startProgressive']=undefined;loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x81'),_0x1d7d('0x2b'),_0x115cb2[_0x1d7d('0x40')]);}if(!_['isUndefined'](_0x115cb2[_0x1d7d('0x2a')])){_0x115cb2['startPredictive']=undefined;loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x81'),_0x1d7d('0x2a'),_0x115cb2[_0x1d7d('0x40')]);}if(!_['isUndefined'](_0x115cb2[_0x1d7d('0x82')])){clearInterval(_0x115cb2[_0x1d7d('0x82')]);_0x115cb2[_0x1d7d('0x82')]=undefined;loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x81'),_0x1d7d('0x82'),_0x115cb2[_0x1d7d('0x40')]);}}}function erlangb(_0x2bd2a0,_0x27cebf){if(_0x27cebf===0x0){return 0x0;}var _0x17c967=0x1;for(var _0x44a187=0x1;_0x44a187<=_0x27cebf;_0x44a187+=0x1){_0x17c967=0x1+_0x17c967*_0x44a187/_0x2bd2a0;}return 0x1/_0x17c967;}function isVoiceQueueOutbound(_0x23974e){return _0x23974e===_0x1d7d('0x4f');}function isNotPreview(_0x31810f){return _0x31810f!==_0x1d7d('0x20');}function isCampaignIvr(_0x520d3c){return _0x520d3c===_0x1d7d('0x76');}function getCallerId(_0x566d27,_0x1c9fe7,_0x1e3853){if(!_[_0x1d7d('0x3d')](_0x1e3853)&&_0x1d7d('0x83')===typeof _0x1e3853&&!_[_0x1d7d('0x47')](_0x1e3853)){if(!_[_0x1d7d('0x3d')](_0x1c9fe7)&&'string'===typeof _0x1c9fe7&&!_[_0x1d7d('0x47')](_0x1c9fe7)){return util[_0x1d7d('0x84')]('\x22%s\x22\x20<%s>',_0x1c9fe7,_0x1e3853);}return util[_0x1d7d('0x84')]('\x22%s\x22\x20<%s>',_0x1e3853,_0x1e3853);}if(!_[_0x1d7d('0x3d')](_0x566d27)&&_0x1d7d('0x83')===typeof _0x566d27&&!_[_0x1d7d('0x47')](_0x566d27)){return _0x566d27;}return _0x1d7d('0x85');}function loggerCatchQueueSummary(_0x95ae40,_0x1fd6ec){return function(_0x516aa0){freeVariablesPredictive(_0x1fd6ec);emitVoiceQueueSummary(_0x1fd6ec);emitCampaignSummary(_0x1fd6ec);loggerSyncQueueSummary[_0x1d7d('0x86')](_0x95ae40,util[_0x1d7d('0x87')](_0x516aa0,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4d69cc,_0x3289c2){return function(_0x3da337){loggerPredictive[_0x1d7d('0x86')](_0x4d69cc,JSON['stringify'](_0x3da337));freeVariablesPredictive(_0x3289c2);};}function loggerCatch(_0x3b3975){return function(_0xe5c3ba){logger[_0x1d7d('0x86')](_0x3b3975,util[_0x1d7d('0x87')](_0xe5c3ba,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5f15b7){return _0x5f15b7&&!_[_0x1d7d('0x3d')](_0x5f15b7)&&_0x5f15b7[_0x1d7d('0x88')]>0x0;}function decremetOriginate(_0x1e25db){if(!_[_0x1d7d('0x3d')](_0x1e25db)&&_0x1e25db!==null){if(_0x1e25db[_0x1d7d('0x89')]('originated')){if(_0x1e25db[_0x1d7d('0x73')]>0x0){_0x1e25db[_0x1d7d('0x73')]-=0x1;}else{logger['error'](_0x1d7d('0x8a'));}}}else{logger[_0x1d7d('0x86')](_0x1d7d('0x8b'));}}function checkContactLowerLimitOriginate(_0x20c900,_0x47d27e,_0x24c0a7){if(_0x47d27e>_0x24c0a7){for(var _0x4a3159=0x0;_0x4a3159<_0x47d27e-_0x24c0a7;_0x4a3159+=0x1){decremetOriginate(_0x20c900);}}}function loggerGetContactDialer(_0x3b93aa,_0x138fc2,_0x30dc64){return function(_0x5e1172){checkContactLowerLimitOriginate(_0x138fc2,_0x30dc64,0x0);logger[_0x1d7d('0x86')](_0x3b93aa,util[_0x1d7d('0x87')](_0x5e1172,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x42befe){return function(_0x55ded9){if(isNotNull(_0x55ded9)&&isNotNull(_0x55ded9[0x0])){if(_0x55ded9[0x0][_0x1d7d('0x8c')]>0x0){_0x42befe['message']=_0x1d7d('0x8d');logger[_0x1d7d('0x7a')](_0x1d7d('0x8e')+_0x42befe[_0x1d7d('0x40')],_0x55ded9[0x0][_0x1d7d('0x8c')],_0x1d7d('0x8f'));}else{_0x42befe[_0x1d7d('0x3e')]=_0x1d7d('0x90');logger[_0x1d7d('0x7a')](_0x1d7d('0x91')+_0x42befe[_0x1d7d('0x40')]);}}};}function notSendMessagesQueue(_0x5494ae){if(_0x5494ae['sendMessageOneNotActive']){freeVariablesPredictive(_0x5494ae);if(_0x5494ae[_0x1d7d('0x73')]===0x0&&_0x5494ae[_0x1d7d('0x92')]===0x0&&_0x5494ae[_0x1d7d('0x93')]===0x0&&(_0x5494ae['pTalking']||0x0)===0x0){_0x5494ae[_0x1d7d('0x94')]=![];_0x5494ae['available']=0x0;_0x5494ae[_0x1d7d('0x3e')]=_0x1d7d('0x42');loggerSyncQueueSummary['error'](_0x1d7d('0x95'),_0x5494ae[_0x1d7d('0x40')],'is\x20not\x20active');}else{_0x5494ae[_0x1d7d('0x3e')]=_0x1d7d('0x96');loggerSyncQueueSummary[_0x1d7d('0x86')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5494ae['name'],_0x1d7d('0x97'));}emitVoiceQueueSummary(_0x5494ae);}}function notSendMessagesCampaign(_0x87e6aa){if(_0x87e6aa['sendMessageOneNotActive']){if(_0x87e6aa[_0x1d7d('0x73')]===0x0){_0x87e6aa[_0x1d7d('0x94')]=![];_0x87e6aa[_0x1d7d('0x3e')]=_0x1d7d('0x42');loggerSyncQueueSummary['error'](_0x1d7d('0x98'),_0x87e6aa[_0x1d7d('0x40')],_0x1d7d('0x99'));}else{_0x87e6aa[_0x1d7d('0x3e')]=_0x1d7d('0x96');loggerSyncQueueSummary[_0x1d7d('0x86')](_0x1d7d('0x98'),_0x87e6aa[_0x1d7d('0x40')],_0x1d7d('0x97'));}emitCampaignSummary(_0x87e6aa);}}function createObjHistory(_0x1ae438,_0xe904e5,_0x2c1699,_0x332171,_0x5c2a92){_0x1ae438[_0x1d7d('0x3e')]=_0x2c1699;var _0x29d9e6=new Action(_0x1ae438,_0xe904e5);var _0x4dd390=new History(_0x29d9e6);_0x4dd390[_0x1d7d('0x9a')]=_0x332171;_0x4dd390[_0x1d7d('0x9b')]=_0x5c2a92;_0x4dd390['endtime']=_0x29d9e6['starttime'];return _0x4dd390;}Dialer['prototype'][_0x1d7d('0x9c')]=function(){var _0x60e32c=this;setInterval(function(){_0x60e32c[_0x1d7d('0x9d')](_0x60e32c[_0x1d7d('0x9e')],'[uniqueid]');_0x60e32c[_0x1d7d('0x9d')](_0x60e32c[_0x1d7d('0x27')],_0x1d7d('0x9f'));},0x32c8);};Dialer[_0x1d7d('0x1b')]['clearZombieChannels']=function(_0x162115,_0xcb5dde){var _0x135910=this;for(var _0x43d3b0 in _0x162115){if(_0x162115[_0x1d7d('0x89')](_0x43d3b0)){this[_0x1d7d('0x1f')]['enqueue'](function(){if(!_[_0x1d7d('0xa0')](_0x162115[_0x43d3b0])){return ami[_0x1d7d('0xa1')]({'action':'status','channel':_0x162115[_0x43d3b0][_0x1d7d('0xa2')]})[_0x1d7d('0xa3')](function(_0x7d394b){if(_0x7d394b['message']===_0x1d7d('0xa4')){setTimeout(function(){if(_0x162115[_0x43d3b0]&&_0x162115[_0x43d3b0]['type']!==_0x1d7d('0x76')){_0x135910[_0x1d7d('0xa5')](_0x135910['voiceQueues'][_0x162115[_0x43d3b0][_0x1d7d('0xa6')]]);logger[_0x1d7d('0x86')](_0x1d7d('0xa7'),_0xcb5dde,_0x43d3b0,_0x162115[_0x43d3b0][_0x1d7d('0xa6')]);delete _0x162115[_0x43d3b0];}if(_0x162115[_0x43d3b0]&&_0x162115[_0x43d3b0][_0x1d7d('0x4e')]===_0x1d7d('0x76')){_0x135910[_0x1d7d('0xa5')](_0x135910[_0x1d7d('0x22')][_0x162115[_0x43d3b0][_0x1d7d('0xa6')]]);logger[_0x1d7d('0x86')](_0x1d7d('0xa8'),_0xcb5dde,_0x43d3b0,_0x162115[_0x43d3b0][_0x1d7d('0xa6')]);delete _0x162115[_0x43d3b0];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0xb061a5){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopper[_0x1d7d('0xab')](_0xb061a5))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xac')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xad')]=function(_0x345c54){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopperBlack[_0x1d7d('0xad')](_0x345c54))['catch'](loggerCatch(_0x1d7d('0xae')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xaf')]=function(_0x1258e0){return BPromise['resolve']()[_0x1d7d('0xaa')](cmHopperBlack[_0x1d7d('0xaf')](_0x1258e0))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb0')));};Dialer['prototype']['averageHandleTime']=function(_0x5e4340){return BPromise['resolve']()[_0x1d7d('0xaa')](cmHopperHistory[_0x1d7d('0xb1')](_0x5e4340))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb2')]=function(_0xfe31ad){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopper[_0x1d7d('0xb2')](_0xfe31ad))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb3')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb4')]=function(_0x4c8724,_0x3fefcb,_0x4e1a96,_0x7390f3){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopper['getContactDialer'](_0x4c8724,_0x3fefcb,_0x4e1a96,_0x7390f3))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb5')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb6')]=function(_0x38f5b2,_0x78944f,_0x316fde){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopper[_0x1d7d('0xb6')](_0x38f5b2,_0x78944f,_0x316fde))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb5')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb7')]=function(_0x1c3363){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](voiceQueueRt[_0x1d7d('0xb7')](_0x1c3363))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb8')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb9')]=function(_0xecfc39){return BPromise['resolve']()[_0x1d7d('0xaa')](cmHopper[_0x1d7d('0xb9')](_0xecfc39))[_0x1d7d('0xa3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x1d7d('0x1b')]['createHistory']=function(_0x5cac4e){return BPromise['resolve']()['then'](cmHopperHistory[_0x1d7d('0xba')](_0x5cac4e))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xbb')));};Dialer['prototype'][_0x1d7d('0xa5')]=function(_0x5df21d){if(!_[_0x1d7d('0x3d')](_0x5df21d)&&_0x5df21d!==null){if(_0x5df21d[_0x1d7d('0x89')](_0x1d7d('0x73'))){if(_0x5df21d[_0x1d7d('0x73')]>0x0){_0x5df21d[_0x1d7d('0x73')]-=0x1;}else{logger[_0x1d7d('0x86')](_0x1d7d('0xbc'));}}}else{logger[_0x1d7d('0x86')](_0x1d7d('0xbd'));}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xbe')]=function(_0x49ca58,_0x15a949){var _0x113ded=this;return function(_0x2ebc42){_0x113ded['updateOriginated'](_0x15a949);logger[_0x1d7d('0x86')](_0x49ca58,util[_0x1d7d('0x87')](_0x2ebc42,{'showHidden':![],'depth':null}));};};Dialer[_0x1d7d('0x1b')]['emptyContact']=function(_0x516bc4,_0x1c7702,_0x5e8022){var _0x109277={'state':0x19,'statedesc':_0x1d7d('0xbf')};this['updateOriginated'](_0x1c7702);this[_0x1d7d('0xc0')](_[_0x1d7d('0x7f')](_0x109277,_['pick'](_0x5e8022,[_0x1d7d('0xc1'),_0x1d7d('0xc2'),_0x1d7d('0xc3'),_0x1d7d('0xc4'),'CampaignId'])),'[emptyContact][createHistory]',_0x1d7d('0xc5'));logger[_0x1d7d('0x86')](_0x516bc4);};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xc6')]=function(_0x16337c){return _0x16337c===_0x1d7d('0xc7');};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xc8')]=function(_0x1189a3){return!_[_0x1d7d('0x3d')](_0x1189a3)&&_0x1189a3&&!_[_0x1d7d('0x3d')](_0x1189a3[_0x1d7d('0x40')])&&!_[_0x1d7d('0x3d')](_0x1189a3[_0x1d7d('0xc9')])&&_0x1189a3[_0x1d7d('0xc9')]&&(this[_0x1d7d('0x24')][util[_0x1d7d('0x84')](_0x1d7d('0xca'),_0x1189a3['name'])][_0x1d7d('0xcb')]===_0x1d7d('0xcc')||this[_0x1d7d('0x24')][util[_0x1d7d('0x84')]('SIP/%s',_0x1189a3[_0x1d7d('0x40')])][_0x1d7d('0xcb')]===_0x1d7d('0xcd'));};Dialer[_0x1d7d('0x1b')]['saveInDb']=function(_0x1d772a,_0x48662a,_0x3eb3da){this[_0x1d7d('0xba')](_0x1d772a)[_0x1d7d('0xa3')](loggerCatch(_0x48662a));this['moveContactManagedDialer'](_0x1d772a)[_0x1d7d('0xa3')](loggerCatch(_0x3eb3da));};Dialer['prototype'][_0x1d7d('0xce')]=function(_0x1c1077){var _0x340e9d=this[_0x1d7d('0x9e')][_0x1c1077['uniqueid']];var _0x1ab80c;if(!_['isNil'](_0x1c1077)&&!_[_0x1d7d('0xa0')](_0x1c1077[_0x1d7d('0xcf')])&&!_['isNil'](_0x1c1077[_0x1d7d('0xcf')][_0x1d7d('0xd0')])&&_0x1c1077[_0x1d7d('0xd1')]===_0x1d7d('0xd2')&&_0x340e9d){if(_0x340e9d['type']!=='ivr'&&this['voiceQueues'][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd3')]&&_0x1c1077[_0x1d7d('0xd4')]===_0x1d7d('0xd5')){delete this[_0x1d7d('0x9e')][_0x1c1077['uniqueid']];this[_0x1d7d('0xa5')](this[_0x1d7d('0x21')][_0x340e9d[_0x1d7d('0xa6')]]);this[_0x1d7d('0x21')][_0x340e9d['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x1d7d('0x21')][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd6')]+=0x1;_0x1ab80c=new Hangup(_0x340e9d,_0x1c1077);_0x1ab80c[_0x1d7d('0x9a')]=0x12;_0x1ab80c[_0x1d7d('0x9b')]=_0x1d7d('0xd7');_0x1ab80c['membername']=_0x1d7d('0xd8');this['saveInDb'](_0x1ab80c,_0x1d7d('0xd9'),_0x1d7d('0xda'));}if(_0x340e9d['type']!==_0x1d7d('0x76')&&this['voiceQueues'][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd3')]&&_0x1c1077[_0x1d7d('0xd4')]===_0x1d7d('0xdb')){delete this[_0x1d7d('0x9e')][_0x1c1077['uniqueid']];this[_0x1d7d('0xa5')](this['voiceQueues'][_0x340e9d[_0x1d7d('0xa6')]]);this['voiceQueues'][_0x340e9d['queue']][_0x1d7d('0xdc')]+=0x1;this[_0x1d7d('0x21')][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd6')]+=0x1;_0x1ab80c=new Hangup(_0x340e9d,_0x1c1077);_0x1ab80c[_0x1d7d('0x9a')]=0x13;_0x1ab80c[_0x1d7d('0x9b')]=_0x1d7d('0xdd');_0x1ab80c[_0x1d7d('0xde')]=_0x1d7d('0xd8');_0x1ab80c[_0x1d7d('0xdf')]=!![];this[_0x1d7d('0xc0')](_0x1ab80c,_0x1d7d('0xe0'),'[syncMachine]');}if(_0x340e9d['type']===_0x1d7d('0x76')&&this['campaigns'][_0x340e9d[_0x1d7d('0xa6')]]['dialAMDActive']&&_0x1c1077['value']===_0x1d7d('0xd5')){delete this[_0x1d7d('0x9e')][_0x1c1077[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this[_0x1d7d('0x22')][_0x340e9d[_0x1d7d('0xa6')]]);_0x1ab80c=new Hangup(_0x340e9d,_0x1c1077);_0x1ab80c[_0x1d7d('0x9a')]=0x12;_0x1ab80c[_0x1d7d('0x9b')]=_0x1d7d('0xd7');_0x1ab80c['membername']='AMD';this[_0x1d7d('0xc0')](_0x1ab80c,'[syncHangupInAMDIvr][createHistory]',_0x1d7d('0xe2'));}if(_0x340e9d[_0x1d7d('0x4e')]===_0x1d7d('0x76')&&this[_0x1d7d('0x22')][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd3')]&&_0x1c1077[_0x1d7d('0xd4')]===_0x1d7d('0xdb')){delete this[_0x1d7d('0x9e')][_0x1c1077[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this[_0x1d7d('0x22')][_0x340e9d['queue']]);_0x1ab80c=new Hangup(_0x340e9d,_0x1c1077);_0x1ab80c['state']=0x13;_0x1ab80c[_0x1d7d('0x9b')]=_0x1d7d('0xdd');_0x1ab80c[_0x1d7d('0xde')]='AMD';_0x1ab80c['amd']=!![];this[_0x1d7d('0xc0')](_0x1ab80c,_0x1d7d('0xe3'),'[syncMachineIvr]');}}};Dialer[_0x1d7d('0x1b')]['syncHangup']=function(_0x30e5c4){var _0x50ec9f=this[_0x1d7d('0x9e')][_0x30e5c4[_0x1d7d('0xe1')]];var _0x44f307=this;var _0x13da70;if(_0x50ec9f&&_0x50ec9f[_0x1d7d('0x4e')]===_0x1d7d('0x76')){delete this[_0x1d7d('0x9e')][_0x30e5c4[_0x1d7d('0xe1')]];this['updateOriginated'](this[_0x1d7d('0x22')][_0x50ec9f[_0x1d7d('0xa6')]]);this[_0x1d7d('0x22')][_0x50ec9f[_0x1d7d('0xa6')]][_0x1d7d('0xe4')]+=0x1;_0x13da70=new Hangup(_0x50ec9f,_0x30e5c4);this[_0x1d7d('0xba')](_0x13da70)['catch'](loggerCatch(_0x1d7d('0xe5')));this['moveContactManagedDialer'](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe6')));}if(_0x50ec9f&&_0x50ec9f['type']!==_0x1d7d('0x76')&&isNotNull(this[_0x1d7d('0x21')][_0x50ec9f[_0x1d7d('0xa6')]][_0x1d7d('0xe7')])){delete this['uniqueId'][_0x30e5c4[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this['voiceQueues'][_0x50ec9f['queue']]);this[_0x1d7d('0x21')][_0x50ec9f['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x50ec9f[_0x1d7d('0xa6')]]['outboundAnswerAgiCallsDay']+=0x1;_0x13da70=new Hangup(_0x50ec9f,_0x30e5c4);_0x13da70[_0x1d7d('0x9a')]=0x10;_0x13da70[_0x1d7d('0x9b')]='AnswerAGI';_0x13da70['membername']='AGI';this[_0x1d7d('0xba')](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe5')));this['moveContactManagedDialer'](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe6')));}if(_0x50ec9f&&_0x50ec9f['type']!=='ivr'&&!isNotNull(this[_0x1d7d('0x21')][_0x50ec9f['queue']]['dialQueueProject'])){delete this[_0x1d7d('0x9e')][_0x30e5c4[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this[_0x1d7d('0x21')][_0x50ec9f[_0x1d7d('0xa6')]]);this[_0x1d7d('0x21')][_0x50ec9f[_0x1d7d('0xa6')]][_0x1d7d('0x68')]+=0x1;_0x13da70=new Hangup(_0x50ec9f,_0x30e5c4);_0x13da70['state']=0xc;_0x13da70['statedesc']=_0x30e5c4[_0x1d7d('0xe8')];_0x13da70[_0x1d7d('0xde')]=_0x1d7d('0xe9');this['createHistory'](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe5')));this['moveContactManagedDialer'](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe6')));}};Dialer[_0x1d7d('0x1b')]['syncAgentComplete']=function(_0x5a0f87){var _0x854f68=this[_0x1d7d('0x9e')][_0x5a0f87[_0x1d7d('0xe1')]];var _0x124078=this;if(this[_0x1d7d('0x21')][_0x5a0f87[_0x1d7d('0xa6')]]){if(_0x854f68&&_0x854f68['type']!==_0x1d7d('0x76')){delete this[_0x1d7d('0x9e')][_0x5a0f87['uniqueid']];this[_0x1d7d('0x21')][_0x5a0f87[_0x1d7d('0xa6')]]['outboundAnswerCallsDay']+=0x1;var _0x5c8d2b=new AgentComplete(_0x854f68,_0x5a0f87);if(_0x5a0f87['reason']===_0x1d7d('0xea')){_0x5c8d2b[_0x1d7d('0xeb')]=this[_0x1d7d('0x21')][_0x5a0f87[_0x1d7d('0xa6')]][_0x1d7d('0xec')]&&this[_0x1d7d('0x21')][_0x5a0f87[_0x1d7d('0xa6')]][_0x1d7d('0xed')]?moment()[_0x1d7d('0x84')](_0x1d7d('0xee')):undefined;}this[_0x1d7d('0xba')](_0x5c8d2b)[_0x1d7d('0xa3')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x5c8d2b)['catch'](loggerCatch(_0x1d7d('0xef')));}}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xf0')]=function(_0x385140){if(this[_0x1d7d('0x21')][_0x385140[_0x1d7d('0xa6')]]){if(this[_0x1d7d('0x9e')][_0x385140[_0x1d7d('0xe1')]]&&this['uniqueId'][_0x385140['uniqueid']]['type']!==_0x1d7d('0x76')){this[_0x1d7d('0xa5')](this[_0x1d7d('0x21')][_0x385140[_0x1d7d('0xa6')]]);this['uniqueId'][_0x385140[_0x1d7d('0xe1')]][_0x1d7d('0xf1')]=moment()[_0x1d7d('0x84')](_0x1d7d('0xee'));}}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xf2')]=function(_0x4c48de){this[_0x1d7d('0xba')](_0x4c48de)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xf3')));this['moveContactManagedDialer'](_0x4c48de)['catch'](loggerCatch(_0x1d7d('0xf4')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x30')]=function(_0x532210){var _0x1634be=this['uniqueId'][_0x532210[_0x1d7d('0xe1')]];var _0x4565a0=this;if(this[_0x1d7d('0x21')][_0x532210['queue']]){if(_0x1634be&&_0x1634be['type']!==_0x1d7d('0x76')){delete this[_0x1d7d('0x9e')][_0x532210[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this[_0x1d7d('0x21')][_0x532210[_0x1d7d('0xa6')]]);_0x1634be[_0x1d7d('0xf5')]=moment()[_0x1d7d('0x84')](_0x1d7d('0xee'));var _0x32aaf1=new QueueCallerAbandon(_0x1634be,_0x532210);if(getSeconds(_0x1634be[_0x1d7d('0xf5')],_0x1634be['responsetime'])>=_0x1634be[_0x1d7d('0xf6')]){this[_0x1d7d('0x21')][_0x532210[_0x1d7d('0xa6')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x532210[_0x1d7d('0xa6')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x1d7d('0x21')][_0x532210[_0x1d7d('0xa6')]][_0x1d7d('0x6d')]+=0x1;_0x32aaf1['state']=0xa;_0x32aaf1[_0x1d7d('0x9b')]='Drop';_0x32aaf1['dropreason']=_0x1d7d('0xf7');_0x32aaf1[_0x1d7d('0xeb')]=this['voiceQueues'][_0x532210[_0x1d7d('0xa6')]][_0x1d7d('0xec')]?moment()[_0x1d7d('0x84')](_0x1d7d('0xee')):undefined;this[_0x1d7d('0xf2')](_0x32aaf1);}else{this['voiceQueues'][_0x532210[_0x1d7d('0xa6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x1d7d('0x21')][_0x532210[_0x1d7d('0xa6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x32aaf1[_0x1d7d('0x9a')]=0xb;_0x32aaf1[_0x1d7d('0x9b')]=_0x1d7d('0xf8');_0x32aaf1[_0x1d7d('0xf9')]=_0x1d7d('0xfa');this[_0x1d7d('0xf2')](_0x32aaf1);}}}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x37')]=function(_0xc04751){if(this[_0x1d7d('0x27')][_0xc04751[_0x1d7d('0xe1')]]){this[_0x1d7d('0x27')][_0xc04751[_0x1d7d('0xe1')]]['channel']=_0xc04751['channel'];}if(this[_0x1d7d('0x9e')][_0xc04751['uniqueid']]){this['uniqueId'][_0xc04751[_0x1d7d('0xe1')]]['channel']=_0xc04751[_0x1d7d('0xa2')];}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x3a')]=function(_0x53f017){if(strategy[this[_0x1d7d('0x21')][this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]][_0x1d7d('0x50')]]===_0x1d7d('0x1a')){if(this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]]&&_[_0x1d7d('0xa0')](this['actions'][_0x53f017[_0x1d7d('0xfb')]]['locked'])&&_0x53f017['status']==='1'&&_0x53f017[_0x1d7d('0xfc')]==='0'){if(this['agents'][_0x53f017[_0x1d7d('0xfd')]]){if(!this[_0x1d7d('0x23')][_0x53f017[_0x1d7d('0xfd')]]['locked']){this['agents'][_0x53f017[_0x1d7d('0xfd')]][_0x1d7d('0xfe')]=!![];this['actions'][_0x53f017[_0x1d7d('0xfb')]][_0x1d7d('0xfe')]=!![];this[_0x1d7d('0x27')][_0x53f017['actionid']]['stateinterface']=_0x53f017[_0x1d7d('0xfd')];}}}}else if((strategy[this[_0x1d7d('0x21')][this[_0x1d7d('0x27')][_0x53f017['actionid']][_0x1d7d('0xa6')]][_0x1d7d('0x50')]]||'rrmemory')==='rrmemory'){if(this['actions'][_0x53f017[_0x1d7d('0xfb')]]){if(this[_0x1d7d('0x23')][_0x53f017[_0x1d7d('0xfd')]]){this['actions'][_0x53f017['actionid']][_0x1d7d('0xfd')]=_0x53f017[_0x1d7d('0xfd')];if(_['isNil'](this['queueBooked'][this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]]['queue']])){this[_0x1d7d('0x2c')][this['actions'][_0x53f017[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]=[];}this[_0x1d7d('0x2c')][this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]][_0x1d7d('0xff')](_[_0x1d7d('0x7f')](_[_0x1d7d('0x100')](this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]],['idHopper',_0x1d7d('0xfd')]),{'status':_0x53f017[_0x1d7d('0xcb')],'paused':_0x53f017[_0x1d7d('0xfc')]}));}}}};function unlockQueueStatus(_0x53b2b8,_0x4c5fcd){setTimeout(function(){if(_[_0x1d7d('0x3d')](_0x53b2b8[_0x1d7d('0x101')])){loggerBooked['error'](_0x1d7d('0x102'),_0x4c5fcd);}_0x53b2b8[_0x1d7d('0x101')]=!![];loggerBooked[_0x1d7d('0x7a')](_0x1d7d('0x103'),_0x4c5fcd,JSON[_0x1d7d('0x4a')](_[_0x1d7d('0x100')](_0x53b2b8,['name',_0x1d7d('0x101')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x5c5d50){var _0x60e91a=this;var _0x4933a3=_0x60e91a[_0x1d7d('0x21')][_0x60e91a[_0x1d7d('0x27')][_0x5c5d50['actionid']][_0x1d7d('0xa6')]];if(strategy[this[_0x1d7d('0x21')][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]['queue']]['strategy']]===_0x1d7d('0x1a')){if(this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]&&this['actions'][_0x5c5d50['actionid']][_0x1d7d('0xfd')]){this['preview'][_0x1d7d('0x104')](this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0x105')],this['actions'][_0x5c5d50[_0x1d7d('0xfb')]]['stateinterface'])[_0x1d7d('0xa3')](function(_0xa41bc4){logger[_0x1d7d('0x86')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x1d7d('0x87')](_0xa41bc4,{'showHidden':![],'depth':null}));})[_0x1d7d('0x1e')](function(){_0x60e91a['updateOriginated'](_0x60e91a[_0x1d7d('0x21')][_0x60e91a[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]);_0x60e91a['agents'][_0x60e91a[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xfd')]]['locked']=![];delete _0x60e91a['actions'][_0x5c5d50[_0x1d7d('0xfb')]];unlockQueueStatus(_0x4933a3);});}else{this['updateOriginated'](this[_0x1d7d('0x21')][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]['queue']]);this[_0x1d7d('0xb2')]({'active':![],'ContactId':this['actions'][_0x5c5d50[_0x1d7d('0xfb')]]['ContactId'],'ListId':this[_0x1d7d('0x27')][_0x5c5d50['actionid']]['ListId'],'VoiceQueueId':this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xc4')]||undefined,'CampaignId':this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]['CampaignId']||undefined})[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x106')));delete this[_0x1d7d('0x27')][_0x5c5d50['actionid']];unlockQueueStatus(_0x4933a3);}}else if((strategy[this[_0x1d7d('0x21')][this['actions'][_0x5c5d50['actionid']][_0x1d7d('0xa6')]][_0x1d7d('0x50')]]||'rrmemory')===_0x1d7d('0x107')){var _0x34ef9d;if(this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]&&!_[_0x1d7d('0x47')](this['queueBooked'][this[_0x1d7d('0x27')][_0x5c5d50['actionid']][_0x1d7d('0xa6')]])){if(this[_0x1d7d('0x2d')][_0x60e91a[_0x1d7d('0x27')][_0x5c5d50['actionid']]['queue']]){this['queueBookedRR'][_0x60e91a['actions'][_0x5c5d50['actionid']][_0x1d7d('0xa6')]]=this[_0x1d7d('0x2d')][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]?this['queueBookedRR'][this['actions'][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]:this['queueBooked'][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]?this['queueBooked'][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]][_0x1d7d('0x108')]||0x0:0x0;}this[_0x1d7d('0x2c')][this['actions'][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]][_0x1d7d('0x108')]=this[_0x1d7d('0x2d')][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]['queue']];for(var _0x339603=0x0;_0x339603=0x0?!![]:![];})[_0x1d7d('0xa3')](myreject(_0x2c6533)));}}else{_0x42a2ed[_0x1d7d('0xff')](ami[_0x1d7d('0xa1')]({'action':'command','command':util['format'](_0x1d7d('0x121'),_0x281cd9,!_[_0x1d7d('0x3d')](config[_0x1d7d('0x11d')][_0x16ff17])?_0x16ff17:'')})[_0x1d7d('0xaa')](function(_0x42b2fd){return _0x42b2fd['content'][_0x1d7d('0x124')](_0x1d7d('0x123'))>=0x0?!![]:![];})[_0x1d7d('0xa3')](myreject(_0x2c6533)));}BPromise['all'](_0x42a2ed)[_0x1d7d('0xaa')](function(_0x38e57d){var _0x18b758=_[_0x1d7d('0x125')](_0x38e57d);if(_0x18b758){return _0x1809aa(_0x18b758);}else{_0x5bfad9['message']=_0x1849a7?_0x1d7d('0x126'):_0x1d7d('0x127');return _0x2c6533(msgResponse(_0x1d7d('0x128'),'Failure',_0x1d7d('0x129')+_0x1849a7+'\x20'+_0x512202+_0x1d7d('0x12a')+util[_0x1d7d('0x87')](_0x281cd9,{'showHidden':![],'depth':null})+_0x1d7d('0x12b')+_0x16ff17));}})['catch'](function(_0x565e18){return _0x2c6533(msgResponse(_0x1d7d('0x119'),_0x1d7d('0x11a'),JSON[_0x1d7d('0x4a')](_0x565e18)));});});};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x12c')]=function(_0x58bc80){var _0x6fe16d=this;return function(){switch(_0x58bc80['dialMethod']){case _0x1d7d('0x12d'):freeVariablesPredictive(_0x58bc80);_0x6fe16d[_0x1d7d('0x12e')](_0x58bc80,0x1);break;case'power':freeVariablesPredictive(_0x58bc80);_0x6fe16d[_0x1d7d('0x12e')](_0x58bc80,_0x58bc80['dialPowerLevel']);break;case _0x1d7d('0x12f'):_0x6fe16d[_0x1d7d('0x12f')](_0x58bc80);break;case'booked':freeVariablesPredictive(_0x58bc80);_0x6fe16d[_0x1d7d('0x12e')](_0x58bc80,0x1);break;default:freeVariablesPredictive(_0x58bc80);logger['error'](_0x1d7d('0x130'),_0x58bc80[_0x1d7d('0x40')],_0x1d7d('0x131'));}};};Dialer[_0x1d7d('0x1b')]['launchHandleIvr']=function(_0x59f5c0){var _0x3e5e37=this;return function(){_0x3e5e37[_0x1d7d('0x132')](_0x59f5c0);};};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xc')]=function(_0x2d0226){var _0x1e4bde=this;if(isNotPreview(_0x2d0226[_0x1d7d('0x5b')])){if(isVoiceQueueOutbound(_0x2d0226[_0x1d7d('0x4e')])&&isActive(_0x2d0226[_0x1d7d('0x133')])){_0x2d0226[_0x1d7d('0x94')]=!![];BPromise[_0x1d7d('0xa9')]()['then'](checkIsLoggedIn(_0x2d0226,_0x2d0226[_0x1d7d('0x134')]))[_0x1d7d('0xaa')](checkIsActive(_0x2d0226,_0x2d0226[_0x1d7d('0x133')]))[_0x1d7d('0xaa')](checkInterval(_0x2d0226))[_0x1d7d('0xaa')](_0x1e4bde['checkIsTrunkReachable'](_0x2d0226))['then'](_0x1e4bde[_0x1d7d('0x135')](_0x2d0226[_0x1d7d('0x136')],_0x2d0226['dialTimezone'],_0x2d0226[_0x1d7d('0x40')],_0x2d0226))[_0x1d7d('0xaa')](_0x1e4bde['checkIfTimeIntervals'](_0x2d0226[_0x1d7d('0x43')],_0x2d0226['dialTimezone'],_0x2d0226[_0x1d7d('0x40')],_0x2d0226))[_0x1d7d('0xaa')](_0x1e4bde[_0x1d7d('0x12c')](_0x2d0226))['catch'](loggerCatchQueueSummary(_0x1d7d('0x137'),_0x2d0226));}else{notSendMessagesQueue(_0x2d0226);}}else{freeVariablesPredictive(_0x2d0226);}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x114')]=function(){var _0x330db2=this;var _0x354573;for(var _0x10ebe1 in this[_0x1d7d('0x22')]){if(this[_0x1d7d('0x22')][_0x1d7d('0x89')](_0x10ebe1)){_0x354573=this[_0x1d7d('0x22')][_0x10ebe1];if(isCampaignIvr(_0x354573[_0x1d7d('0x4e')])&&isActive(_0x354573[_0x1d7d('0xc9')])){_0x354573[_0x1d7d('0x94')]=!![];BPromise['resolve']()[_0x1d7d('0xaa')](checkIsActive(_0x354573,_0x354573[_0x1d7d('0xc9')]))[_0x1d7d('0xaa')](checkInterval(_0x354573))[_0x1d7d('0xaa')](_0x330db2[_0x1d7d('0x115')](_0x354573))[_0x1d7d('0xaa')](_0x330db2[_0x1d7d('0x135')](_0x354573[_0x1d7d('0x136')],_0x354573[_0x1d7d('0x138')],_0x354573['name'],_0x354573))[_0x1d7d('0xaa')](_0x330db2[_0x1d7d('0x139')](_0x354573['Interval'],_0x354573['dialTimezone'],_0x354573[_0x1d7d('0x40')],_0x354573))['then'](_0x330db2[_0x1d7d('0x13a')](_0x354573))[_0x1d7d('0xa3')](loggerCatchQueueSummary(_0x1d7d('0x13b'),_0x354573));}else{notSendMessagesCampaign(_0x354573);}}}};function getCallerIdRandom(_0x443daf,_0x8084b3){var _0x6cb7ea,_0x34479d,_0x1d58ae;if(_0x8084b3<=0x0){_0x8084b3=0x1;}_0x6cb7ea=new RegExp(_0x1d7d('0x13c')+_0x8084b3+'}$');_0x34479d=Math[_0x1d7d('0x13d')](0xa,_0x8084b3-0x1);_0x1d58ae=Math[_0x1d7d('0x13d')](0xa,_0x8084b3)-0x1;return util[_0x1d7d('0x84')]('%s',_[_0x1d7d('0x13e')](_0x443daf,_0x6cb7ea,_[_0x1d7d('0x13f')](_0x34479d,_0x1d58ae)));}function extractCalleridName(_0x2d3060){var _0x1925fc=_0x2d3060[_0x1d7d('0x140')](/"(.*?)"/);return _0x1925fc?_0x1925fc[0x1]:_0x2d3060;}function extractCalleridNumber(_0x1e32f3){var _0x39499c=_0x1e32f3[_0x1d7d('0x140')](/<(.*?)>/);return _0x39499c?_0x39499c[0x1]:_0x1e32f3;}Dialer['prototype']['actionOriginate']=function(_0x366121,_0x59915c){var _0x5dc582=this;var _0x4d8064=uuid['v4']();this[_0x1d7d('0x27')][_0x4d8064]=new Action(_0x366121,_0x59915c,_0x4d8064);return new BPromise(function(_0x2369e9,_0x41832e){if(_[_0x1d7d('0x3d')](_0x366121)&&'object'!==typeof _0x366121){return _0x41832e(msgResponse(_0x1d7d('0x141'),'Failure',_0x1d7d('0x142')));}if(_['isUndefined'](_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x144')])||_0x59915c['Contact'][_0x1d7d('0x144')]===null){return _0x41832e(msgResponse('originate',_0x1d7d('0x11a'),_0x1d7d('0x145')));}var _0x4e0622={'XMD-CALLERID':_0x5dc582[_0x1d7d('0x27')][_0x4d8064]['getCaller'](),'XMD-AGI':_0x366121[_0x1d7d('0xe7')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x366121[_0x1d7d('0xe7')]):_0x1d7d('0x146'),'XMD-AGIAFTER':_0x366121[_0x1d7d('0xec')]?util[_0x1d7d('0x84')](_0x1d7d('0x147'),ipAgi,_0x366121[_0x1d7d('0xec')]):'NONE','XMD-QUEUE':_0x366121[_0x1d7d('0x4e')]==='outbound'?util['format']('\x22%s,%s%s,,,%s\x22',_0x366121[_0x1d7d('0x40')],_0x366121['dialQueueOptions']||'',_0x366121['dialAgiAfterHangupAgent']?'c':'',_0x366121['dialQueueTimeout']||0x3):_0x1d7d('0x146'),'XMD-CONTACTID':_0x59915c['ContactId'],'XMD-CDRTYPE':_0x1d7d('0x9'),'CALLERID(all)':_0x5dc582[_0x1d7d('0x27')][_0x4d8064][_0x1d7d('0x148')](),'XMD-AMD':_0x366121[_0x1d7d('0xd3')]?_0x1d7d('0x149'):_0x1d7d('0x146'),'XMD-DESTINATION':_0x1d7d('0xd2')};if(_0x366121['dialAMDActive']){_0x4e0622[_0x1d7d('0x14a')]=_0x366121['dialAMDInitialSilence']||0x9c4;_0x4e0622[_0x1d7d('0x14b')]=_0x366121[_0x1d7d('0x14c')]||0x5dc;_0x4e0622['XMD-AMDAFTERGREETINGSILENCE']=_0x366121['dialAMDAfterGreetingSilence']||0x320;_0x4e0622[_0x1d7d('0x14d')]=_0x366121['dialAMDTotalAnalysisTime']||0x1388;_0x4e0622['XMD-AMDMINWORDLENGTH']=_0x366121[_0x1d7d('0x14e')]||0x64;_0x4e0622[_0x1d7d('0x14f')]=_0x366121[_0x1d7d('0x150')]||0x32;_0x4e0622[_0x1d7d('0x151')]=_0x366121[_0x1d7d('0x152')]||0x3;_0x4e0622[_0x1d7d('0x153')]=_0x366121['dialAMDSilenceThreshold']||0x100;_0x4e0622[_0x1d7d('0x154')]=_0x366121['dialAMDMaximumWordLength']||0x1388;}if(_0x366121['type']===_0x1d7d('0x4f')){_0x4e0622[_0x1d7d('0x155')]=_0x59915c[_0x1d7d('0xc4')];}else{_0x4e0622[_0x1d7d('0x156')]=_0x59915c['CampaignId'];}for(var _0x36ede0 in _0x59915c[_0x1d7d('0x143')]){if(_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x89')](_0x36ede0)){if(isNotNull(_0x59915c['Contact'][_0x36ede0])&&_0x36ede0!=='id'&&_0x36ede0!==_0x1d7d('0x157')&&_0x36ede0!==_0x1d7d('0x158')&&_0x36ede0!==_0x1d7d('0x159')){_0x4e0622[util[_0x1d7d('0x84')]('%s%s',_0x1d7d('0x15a'),_['toUpper'](_0x36ede0))]=_0x59915c[_0x1d7d('0x143')][_0x36ede0];}}}var _0x3f3f5a=_0x5dc582[_0x1d7d('0xc8')](_0x366121['Trunk'])?getCallerId(_0x366121[_0x1d7d('0x74')][_0x1d7d('0x15b')],_0x366121[_0x1d7d('0x5c')],_0x366121[_0x1d7d('0x15c')]>0x0?getCallerIdRandom(_0x366121[_0x1d7d('0x5d')],_0x366121[_0x1d7d('0x15c')]):_0x366121[_0x1d7d('0x5d')]):getCallerId(_[_0x1d7d('0xa0')](_0x366121[_0x1d7d('0x116')])?_0x366121[_0x1d7d('0x74')][_0x1d7d('0x15b')]:_0x366121[_0x1d7d('0x116')][_0x1d7d('0x15b')],_0x366121[_0x1d7d('0x5c')],_0x366121[_0x1d7d('0x15c')]>0x0?getCallerIdRandom(_0x366121[_0x1d7d('0x5d')],_0x366121[_0x1d7d('0x15c')]):_0x366121[_0x1d7d('0x5d')]);if(_0x3f3f5a){_0x4e0622[_0x1d7d('0x15d')]=_0x5dc582[_0x1d7d('0x27')][_0x4d8064]['originatecalleridname']=extractCalleridName(_0x3f3f5a);_0x4e0622[_0x1d7d('0x15e')]=_0x5dc582[_0x1d7d('0x27')][_0x4d8064]['originatecalleridnum']=extractCalleridNumber(_0x3f3f5a);}return ami[_0x1d7d('0xa1')]({'actionid':_0x4d8064,'action':_0x1d7d('0x141'),'channel':_0x5dc582[_0x1d7d('0xc8')](_0x366121[_0x1d7d('0x74')])?util['format']('SIP/%s/%s%s',_0x366121[_0x1d7d('0x74')][_0x1d7d('0x40')],isNotNull(_0x366121[_0x1d7d('0x5f')])?_0x366121['dialPrefix'][_0x1d7d('0x15f')]()||'':'',_0x366121[_0x1d7d('0x160')]>0x0?_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x144')][_0x1d7d('0x161')](_0x366121[_0x1d7d('0x160')]):_0x59915c[_0x1d7d('0x143')]['phone']):util[_0x1d7d('0x84')](_0x1d7d('0x162'),_['isNil'](_0x366121[_0x1d7d('0x116')])?_0x366121[_0x1d7d('0x74')][_0x1d7d('0x40')]:_0x366121[_0x1d7d('0x116')]['name'],isNotNull(_0x366121[_0x1d7d('0x5f')])?_0x366121[_0x1d7d('0x5f')][_0x1d7d('0x15f')]()||'':'',_0x366121['dialCutDigit']>0x0?_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x144')]['substring'](_0x366121[_0x1d7d('0x160')]):_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x144')]),'callerid':_0x3f3f5a,'Exten':'xcally-motion-dialer','Context':_0x1d7d('0x163'),'Priority':'1','variable':_0x4e0622,'timeout':(_0x366121[_0x1d7d('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d8064})[_0x1d7d('0xaa')](function(_0x1d7d8a){return _0x2369e9(_0x1d7d8a);})[_0x1d7d('0xa3')](function(_0x49ec3d){_0x366121[_0x1d7d('0x65')]+=0x1;var _0x65e69f=new History(_0x5dc582[_0x1d7d('0x27')][_0x4d8064]);logger[_0x1d7d('0x86')](util[_0x1d7d('0x84')](_0x1d7d('0x164'),JSON[_0x1d7d('0x4a')](_0x49ec3d)));_0x65e69f['state']=0xe;_0x65e69f['statedesc']=_0x1d7d('0x165');_0x65e69f[_0x1d7d('0x166')]=moment()[_0x1d7d('0x84')]('YYYY-MM-DD\x20HH:mm:ss');_0x65e69f['endtime']=_0x65e69f[_0x1d7d('0x166')];_0x5dc582[_0x1d7d('0xba')](_0x65e69f)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x167')));_0x5dc582['moveContactManagedDialer'](_0x65e69f)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x167')))[_0x1d7d('0x1e')](function(){delete _0x5dc582[_0x1d7d('0x27')][_0x4d8064];return _0x41832e(msgResponse(_0x1d7d('0x141'),_0x1d7d('0x49'),_0x1d7d('0x168')));});});});};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x32')]=function(_0xa7de2){var _0xa65657=this[_0x1d7d('0x27')][_0xa7de2['actionid']];var _0x3dce57=this;if(_0xa65657){delete this['actions'][_0xa7de2['actionid']];_0xa65657[_0x1d7d('0x169')]=moment()[_0x1d7d('0x84')]('YYYY-MM-DD\x20HH:mm:ss');var _0x10b69f=_0xa65657[_0x1d7d('0x4e')]===_0x1d7d('0x76')?this[_0x1d7d('0x22')][_0xa65657[_0x1d7d('0xa6')]]:this[_0x1d7d('0x21')][_0xa65657[_0x1d7d('0x16a')]()];if(!this['isSuccess'](_0xa7de2['response'])){this[_0x1d7d('0xa5')](_0x10b69f);return this[_0x1d7d('0x16b')](_0xa65657,_0x10b69f,_0xa7de2)['then'](function(_0x3f250a){})[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x16c')));}else{this[_0x1d7d('0x9e')][_0xa7de2[_0x1d7d('0xe1')]]=_0xa65657;}}};Dialer['prototype']['checkRetriveMax']=function(_0x1418cd,_0x4fd72f,_0x1aad46){var _0x2c2753=new History(_0x4fd72f);if(_0x2c2753[_0x1d7d('0x16d')]+_0x2c2753[_0x1d7d('0x16e')]+_0x2c2753['countnoanswerretry']>=_0x1aad46[_0x1d7d('0x16f')]-0x1){return!![];}switch(_0x1418cd){case 0x3:if(_0x2c2753[_0x1d7d('0x170')]>=_0x1aad46[_0x1d7d('0x171')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x2c2753['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x1aad46['dialNoAnswerRetryFrequency'],_0x1d7d('0x172'))[_0x1d7d('0x84')](_0x1d7d('0xee')),'ContactId':_0x2c2753[_0x1d7d('0xc1')],'ListId':_0x2c2753[_0x1d7d('0xc2')],'VoiceQueueId':_0x2c2753[_0x1d7d('0xc4')]||undefined,'CampaignId':_0x2c2753[_0x1d7d('0x10f')]||undefined})['catch'](loggerCatch(_0x1d7d('0x173')));}break;case 0x5:if(_0x2c2753[_0x1d7d('0x16d')]>=_0x1aad46[_0x1d7d('0x174')]-0x1){return!![];}else{this[_0x1d7d('0xb2')]({'active':![],'countbusyretry':_0x2c2753['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x1aad46[_0x1d7d('0x175')],_0x1d7d('0x172'))['format'](_0x1d7d('0xee')),'ContactId':_0x2c2753[_0x1d7d('0xc1')],'ListId':_0x2c2753[_0x1d7d('0xc2')],'VoiceQueueId':_0x2c2753[_0x1d7d('0xc4')]||undefined,'CampaignId':_0x2c2753[_0x1d7d('0x10f')]||undefined})['catch'](loggerCatch(_0x1d7d('0x176')));}break;case 0x8:if(_0x2c2753['countcongestionretry']>=_0x1aad46['dialCongestionMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x2c2753[_0x1d7d('0x16e')]+=0x1,'scheduledat':moment()[_0x1d7d('0x177')](_0x1aad46['dialCongestionRetryFrequency'],'minutes')[_0x1d7d('0x84')](_0x1d7d('0xee')),'ContactId':_0x2c2753[_0x1d7d('0xc1')],'ListId':_0x2c2753[_0x1d7d('0xc2')],'VoiceQueueId':_0x2c2753[_0x1d7d('0xc4')]||undefined,'CampaignId':_0x2c2753[_0x1d7d('0x10f')]||undefined})[_0x1d7d('0xa3')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x16b')]=function(_0xee3f88,_0x33e533,_0x48c075){var _0x805334=this;var _0x460bda=new History(_0xee3f88);return new BPromise(function(_0x368729,_0x406fca){if(_['isUndefined'](_0x33e533)&&_0x1d7d('0x178')!==typeof _0x33e533){return _0x406fca(msgResponse(_0x1d7d('0x179'),'Failure',_0x1d7d('0x17a')));}if(_[_0x1d7d('0x3d')](_0x48c075)&&_0x1d7d('0x178')!==typeof _0x48c075){return _0x406fca(msgResponse(_0x1d7d('0x179'),_0x1d7d('0x11a'),_0x1d7d('0x17b')));}switch(_0x48c075[_0x1d7d('0x17c')]){case'0':_0x33e533[_0x1d7d('0x64')]+=0x1;_0x460bda[_0x1d7d('0x9a')]=0x0;_0x460bda['statedesc']=_0x1d7d('0x17d');_0x805334[_0x1d7d('0xba')](_0x460bda)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x17e')));if(_0x805334[_0x1d7d('0x17f')](0x0,_0xee3f88,_0x33e533)){if(_0x460bda['countbusyretry']+_0x460bda['countcongestionretry']+_0x460bda['countnoanswerretry']>=_0x33e533[_0x1d7d('0x16f')]){_0x805334[_0x1d7d('0x180')](_0x460bda,_0x368729,_0x406fca,_0x1d7d('0x181'));}else{_0x805334[_0x1d7d('0x182')](_0x460bda,_0x368729,_0x406fca,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x33e533[_0x1d7d('0x183')]+=0x1;_0x460bda['state']=0x3;_0x460bda[_0x1d7d('0x9b')]=_0x1d7d('0x184');_0x460bda[_0x1d7d('0x170')]+=0x1;_0x460bda[_0x1d7d('0x185')]+=0x1;_0x805334['createHistory'](_0x460bda)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x186')));if(_0x805334[_0x1d7d('0x17f')](0x3,_0xee3f88,_0x33e533)){if(_0x460bda[_0x1d7d('0x170')]>=_0x33e533['dialNoAnswerMaxRetry']){_0x805334['createStateFinal'](_0x460bda,_0x368729,_0x406fca,'reason\x203\x20ringing\x20no\x20answer');}else{_0x805334[_0x1d7d('0x180')](_0x460bda,_0x368729,_0x406fca,_0x1d7d('0x187'));}}break;case'5':_0x33e533[_0x1d7d('0x61')]+=0x1;_0x460bda[_0x1d7d('0x9a')]=0x5;_0x460bda[_0x1d7d('0x9b')]=_0x1d7d('0x188');_0x460bda[_0x1d7d('0x16d')]+=0x1;_0x460bda['countglobal']+=0x1;_0x805334[_0x1d7d('0xba')](_0x460bda)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x805334['checkRetriveMax'](0x5,_0xee3f88,_0x33e533)){if(_0x460bda[_0x1d7d('0x16d')]>=_0x33e533[_0x1d7d('0x174')]){_0x805334[_0x1d7d('0x182')](_0x460bda,_0x368729,_0x406fca,_0x1d7d('0x189'));}else{_0x805334[_0x1d7d('0x180')](_0x460bda,_0x368729,_0x406fca,'reason\x205\x20busy');}}break;case'8':_0x33e533[_0x1d7d('0x62')]+=0x1;_0x460bda[_0x1d7d('0x9a')]=0x8;_0x460bda[_0x1d7d('0x9b')]=_0x1d7d('0x18a');_0x460bda[_0x1d7d('0x16e')]+=0x1;_0x460bda[_0x1d7d('0x185')]+=0x1;_0x805334[_0x1d7d('0xba')](_0x460bda)[_0x1d7d('0xa3')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x805334['checkRetriveMax'](0x8,_0xee3f88,_0x33e533)){if(_0x460bda['countcongestionretry']>=_0x33e533[_0x1d7d('0x18b')]){_0x805334[_0x1d7d('0x182')](_0x460bda,_0x368729,_0x406fca,_0x1d7d('0x18c'));}else{_0x805334[_0x1d7d('0x180')](_0x460bda,_0x368729,_0x406fca,'reason\x208\x20congestion');}}break;default:_0x33e533[_0x1d7d('0x68')]+=0x1;_0x460bda['state']=0xc;_0x460bda[_0x1d7d('0x9b')]=_0x48c075[_0x1d7d('0x17c')];_0x805334['createHistory'](_0x460bda)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x18d')));if(_0x805334[_0x1d7d('0x17f')](_0x48c075[_0x1d7d('0x17c')],_0xee3f88,_0x33e533)){if(_0x460bda[_0x1d7d('0x16d')]+_0x460bda[_0x1d7d('0x16e')]+_0x460bda['countnoanswerretry']>=_0x33e533['dialGlobalMaxRetry']){_0x805334['stateGlobal'](_0x460bda,_0x368729,_0x406fca,_0x48c075[_0x1d7d('0x17c')]);}else{_0x805334[_0x1d7d('0x182')](_0x460bda,_0x368729,_0x406fca,_0x48c075[_0x1d7d('0x17c')]);}}}});};Dialer[_0x1d7d('0x1b')]['stateGlobal']=function(_0xe3c986,_0x418952,_0x8da0fb,_0x3b3b62){var _0x55e592=new Final(_0xe3c986);_0x55e592[_0x1d7d('0x9a')]=0xf;_0x55e592[_0x1d7d('0x9b')]=_0x1d7d('0x18e');this['createStateFinal'](_0x55e592,_0x418952,_0x8da0fb,_0x3b3b62);};Dialer['prototype'][_0x1d7d('0x182')]=function(_0x1c7021,_0x2cb9d1,_0x2c5fd6,_0x3f0a1a){this[_0x1d7d('0xb9')](_0x1c7021)[_0x1d7d('0xaa')](function(_0x17f68c){return _0x2cb9d1(msgResponse('[callProgressDetecting]',_0x1d7d('0xc7'),_0x3f0a1a));})[_0x1d7d('0xa3')](function(_0xe306ed){return _0x2c5fd6(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x12f')]=function(_0x46e349){var _0x4c2a5b=this;var _0xb5e224=_0x46e349[_0x1d7d('0x18f')]/0x64;var _0x4a2e1e=_0x46e349[_0x1d7d('0x63')]/(_0x46e349[_0x1d7d('0x63')]+_0x46e349['outboundAnswerCallsDay']);var _0x57cb2a=_0x46e349[_0x1d7d('0x134')]-_0x46e349[_0x1d7d('0x71')]-_0x46e349[_0x1d7d('0x93')]-_0x46e349[_0x1d7d('0x73')]-_0x46e349['talking'];var _0x409660=(_0x46e349[_0x1d7d('0x134')]-_0x46e349[_0x1d7d('0x71')])*_0x46e349['predictiveIntervalLowerLimit'];var _0x4976e1=Math[_0x1d7d('0x190')](_0x46e349[_0x1d7d('0x191')]*_0x46e349[_0x1d7d('0x192')]*_0x46e349['predictiveIntervalHitRate']*_0x46e349[_0x1d7d('0x70')]);if(_[_0x1d7d('0x3d')](_0x46e349['startProgressive'])){loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x193'));if(!_[_0x1d7d('0x3d')](_0x46e349[_0x1d7d('0x2a')])){_0x46e349[_0x1d7d('0x2a')]=undefined;loggerPredictive[_0x1d7d('0x86')](_0x1d7d('0x194'),_0x1d7d('0x195'));}if(!_['isUndefined'](_0x46e349[_0x1d7d('0x82')])){loggerPredictive[_0x1d7d('0x86')](_0x1d7d('0x194'),_0x1d7d('0x196'));clearInterval(_0x46e349[_0x1d7d('0x82')]);_0x46e349[_0x1d7d('0x82')]=undefined;}_0x46e349['startProgressive']=moment()['format'](_0x1d7d('0xee'));loggerPredictive[_0x1d7d('0x7a')]('[startMethodPredictive][StartProgressive][Date]',_0x46e349[_0x1d7d('0x2b')],_0x46e349[_0x1d7d('0x40')]);this[_0x1d7d('0x12e')](_0x46e349,0x1);}else if(ifInterval(_0x46e349[_0x1d7d('0x197')],_0x46e349[_0x1d7d('0x2b')])){this['handlePower'](_0x46e349,0x1);loggerPredictiveCalls[_0x1d7d('0x7a')]('[startMethodPredictive][StartProgressive][Loop]',_0x46e349[_0x1d7d('0x2b')],_0x46e349[_0x1d7d('0x40')]);_0x46e349['erlangCalls']=0x0;_0x46e349[_0x1d7d('0x6d')]=0x0;}else if(_0xb5e224<_0x4a2e1e&&_0x46e349[_0x1d7d('0x198')]===_0x1d7d('0x199')){freeVariablesPredictive(_0x46e349);loggerPredictive[_0x1d7d('0x7a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x1d7d('0x19a'),_0x4a2e1e,_0x1d7d('0x2b'),_0x46e349[_0x1d7d('0x40')]);}else if(_0x57cb2a>_0x409660){freeVariablesPredictive(_0x46e349);loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x19b'),_0x1d7d('0x19c'),_0x57cb2a,'agent\x20max\x20free\x20',_0x409660);}else if(_0x4976e1<_0x46e349[_0x1d7d('0x6d')]&&_0x46e349[_0x1d7d('0x198')]===_0x1d7d('0x199')){freeVariablesPredictive(_0x46e349);loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x19d'),_0x1d7d('0x19e'),_0x4976e1,_0x1d7d('0x19f'),_0x46e349[_0x1d7d('0x6d')],'startProgressive',_0x46e349[_0x1d7d('0x40')]);}else if(!ifInterval(_0x46e349['dialPredictiveInterval'],_0x46e349[_0x1d7d('0x2b')])&&_[_0x1d7d('0x3d')](_0x46e349[_0x1d7d('0x2a')])&&!_[_0x1d7d('0x3d')](_0x46e349[_0x1d7d('0x2b')])){_0x46e349['startPredictive']=moment()[_0x1d7d('0x84')](_0x1d7d('0xee'));loggerPredictive['info'](_0x1d7d('0x1a0'),_0x46e349[_0x1d7d('0x2a')],_0x46e349['name']);this[_0x1d7d('0x1a1')](_0x46e349[_0x1d7d('0x197')])[_0x1d7d('0xaa')](this['getDataPredictive'](_0x46e349))[_0x1d7d('0xaa')](mergeDataErlangB(_0x46e349))[_0x1d7d('0xaa')](this[_0x1d7d('0x1a2')](_0x46e349))[_0x1d7d('0xa3')](loggerCatchPredictive(_0x1d7d('0x1a3'),_0x46e349));}else if(!ifInterval(_0x46e349[_0x1d7d('0x197')],_0x46e349[_0x1d7d('0x2a')])){_0x46e349[_0x1d7d('0x6d')]=0x0;_0x46e349['startPredictive']=moment()[_0x1d7d('0x84')](_0x1d7d('0xee'));loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x1a4'),_0x46e349[_0x1d7d('0x2a')],_0x46e349[_0x1d7d('0x40')]);clearInterval(_0x46e349[_0x1d7d('0x82')]);_0x46e349[_0x1d7d('0x82')]=undefined;this[_0x1d7d('0x1a1')](_0x46e349[_0x1d7d('0x197')])[_0x1d7d('0xaa')](this[_0x1d7d('0x1a5')](_0x46e349))['then'](mergeDataErlangB(_0x46e349))[_0x1d7d('0xaa')](this[_0x1d7d('0x1a2')](_0x46e349))[_0x1d7d('0xa3')](loggerCatchPredictive(_0x1d7d('0x1a3'),_0x46e349));}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x1a5')]=function(_0x1c929c){var _0x4136ed=this;return function(_0x53d0db){return new BPromise(function(_0x5baf23,_0x2101e4){_[_0x1d7d('0x7f')](_0x1c929c,_0x53d0db[0x0]);if(checkGetDataPredictive(_0x53d0db[0x0])){loggerPredictive[_0x1d7d('0x7a')](JSON[_0x1d7d('0x4a')](_0x53d0db[0x0]));if(_0x1c929c[_0x1d7d('0x198')]===_0x1d7d('0x199')){return _0x4136ed[_0x1d7d('0xb7')](_0x1c929c['id'])[_0x1d7d('0xaa')](function(_0x9fdc91){var _0x290996=_0x1c929c[_0x1d7d('0x134')]-_0x9fdc91[0x0][_0x1d7d('0x1a6')];var _0x22da89=_0x1c929c[_0x1d7d('0x197')]*0x3c;var _0x5d087c=_0x53d0db[0x0][_0x1d7d('0x79')]+_0x53d0db[0x0][_0x1d7d('0x6a')];var _0x31180c=(_0x53d0db[0x0][_0x1d7d('0x69')]+_0x53d0db[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x53d0db[0x0][_0x1d7d('0x6b')])/_0x53d0db[0x0][_0x1d7d('0x72')];var _0x14748e=_0x1c929c['dialPredictiveOptimizationPercentage']/0x64;_0x1c929c[_0x1d7d('0x71')]=_0x9fdc91[0x0]['outboundQueuePauses']||0x0;_0x1c929c[_0x1d7d('0x6e')]=_0x31180c>0x0?_0x31180c:0x1;return _0x4136ed[_0x1d7d('0x1a7')](_0x290996,_0x22da89,_0x5d087c,_0x31180c,_0x14748e);})[_0x1d7d('0xaa')](function(_0x2f657f){return _0x5baf23(_0x2f657f);})['catch'](function(_0x5b373e){return _0x2101e4(msgResponse(_0x1d7d('0x1a8'),_0x1d7d('0x11a'),JSON[_0x1d7d('0x4a')](_0x5b373e)));});}if(_0x1c929c[_0x1d7d('0x198')]===_0x1d7d('0x1a9')){return _0x4136ed[_0x1d7d('0xb7')](_0x1c929c['id'])[_0x1d7d('0xaa')](function(_0x4d8172){var _0x597cf7=_0x1c929c[_0x1d7d('0x134')]-_0x4d8172[0x0][_0x1d7d('0x1a6')];var _0x36b7cc=_0x1c929c[_0x1d7d('0x197')]*0x3c;var _0x12b1a9=_0x53d0db[0x0][_0x1d7d('0x79')]+_0x53d0db[0x0]['predictiveIntervalAvgHoldtime'];var _0x31e71f=(_0x53d0db[0x0][_0x1d7d('0x69')]+_0x53d0db[0x0][_0x1d7d('0x6c')]+_0x53d0db[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x53d0db[0x0]['predictiveIntervalTotalCalls'];var _0x5e504c=_0x1c929c[_0x1d7d('0x18f')]/0x64;_0x1c929c['predictiveIntervalPauses']=_0x4d8172[0x0][_0x1d7d('0x1a6')]||0x0;_0x1c929c[_0x1d7d('0x6e')]=_0x31e71f>0x0?_0x31e71f:0x1;return _0x4136ed[_0x1d7d('0x1aa')](_0x597cf7,_0x36b7cc,_0x12b1a9,_0x31e71f,_0x5e504c);})[_0x1d7d('0xaa')](function(_0x3aa903){return _0x5baf23(_0x3aa903);})[_0x1d7d('0xa3')](function(_0x33992a){return _0x2101e4(msgResponse(_0x1d7d('0x1a8'),_0x1d7d('0x11a'),JSON[_0x1d7d('0x4a')](_0x33992a)));});}}else{return _0x2101e4(msgResponse(_0x1d7d('0x1ab'),_0x1d7d('0x11a'),'check\x20failure'));}});};};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x1a2')]=function(_0x3e91f1){var _0xfab80d=this;return function(){var _0x4563c0=0x0;var _0xcff882=Math[_0x1d7d('0x190')](_0x3e91f1['erlangCallToSecond']*0x3e8);if(_0xcff882>0x0){_0xcff882=_0xcff882<0x64?0x64:_0xcff882;loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x1ac'),_0xcff882);_0x3e91f1[_0x1d7d('0x82')]=setInterval(function(){_0xfab80d[_0x1d7d('0x82')](_0x3e91f1);loggerPredictiveCalls['info'](_0x1d7d('0x1ad'),_0x4563c0+=0x1);},_0xcff882);}else{loggerPredictive['info']('[startMethodPredictive][milliseconds]\x20',_0x1d7d('0x1ae'),_0xcff882);}};};Dialer[_0x1d7d('0x1b')]['checkContactBlack']=function(_0x298128,_0x530dda){var _0x5f5531=this;return function(_0x84457b){if(_[_0x1d7d('0x47')](_0x84457b)){if(_[_0x1d7d('0xa0')](_0x530dda[_0x1d7d('0xc3')])||!_0x530dda[_0x1d7d('0x1af')]){if(_0x298128['dialMethod']===_0x1d7d('0xa')){_0x298128[_0x1d7d('0x101')]=_[_0x1d7d('0x3d')](_0x298128['queueStatusComplete'])?!![]:_0x298128[_0x1d7d('0x101')];var _0x1e23b9=uuid['v4']();_0x5f5531[_0x1d7d('0x27')][_0x1e23b9]=new Action(_0x298128,_0x530dda,_0x1e23b9);loggerBooked[_0x1d7d('0x7a')]('[booked][checkContactBlack]',_0x1e23b9,'queueStatusComplete:\x20',JSON[_0x1d7d('0x4a')](_0x298128[_0x1d7d('0x101')]),_0x1d7d('0x1b0'),_0x298128[_0x1d7d('0x40')]);if(_0x298128[_0x1d7d('0x101')]){_0x298128['queueStatusComplete']=![];_0x5f5531[_0x1d7d('0x2c')][_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0xa6')]]=[];ami[_0x1d7d('0xa1')]({'actionid':_0x1e23b9,'action':'queuestatus','queue':_0x298128[_0x1d7d('0x40')]})[_0x1d7d('0xa3')](function(_0x3b472b){_0x5f5531[_0x1d7d('0xa5')](_0x298128);_0x5f5531[_0x1d7d('0xb2')]({'active':![],'ContactId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9]['ContactId'],'ListId':_0x5f5531['actions'][_0x1e23b9][_0x1d7d('0xc2')],'VoiceQueueId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0xc4')]||undefined,'CampaignId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0x10f')]||undefined})[_0x1d7d('0xa3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5f5531[_0x1d7d('0x27')][_0x1e23b9];});}else{loggerBooked['info'](_0x1d7d('0x1b1'),JSON[_0x1d7d('0x4a')](_0x298128['queueStatusComplete']),_0x1d7d('0x1b0'),_0x298128[_0x1d7d('0x40')]);_0x5f5531[_0x1d7d('0xa5')](_0x298128);_0x5f5531[_0x1d7d('0xb2')]({'active':![],'ContactId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9]['ContactId'],'ListId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9]['ListId'],'VoiceQueueId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0xc4')]||undefined,'CampaignId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0x10f')]||undefined})[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x1b2')));delete _0x5f5531['actions'][_0x1e23b9];}}else{return _0x5f5531[_0x1d7d('0x1b3')](_0x298128,_0x530dda);}}else{if(getDiff(_0x530dda[_0x1d7d('0x1b4')])<_0x298128[_0x1d7d('0x1b5')]*0x3c){_0x5f5531['preview'][_0x1d7d('0x104')](_0x530dda['id'])[_0x1d7d('0x1e')](function(){_0x5f5531[_0x1d7d('0xa5')](_0x298128);});}else{_0x298128[_0x1d7d('0x66')]+=0x1;_0x5f5531['updateOriginated'](_0x298128);if(_0x298128[_0x1d7d('0x1b6')]){_0x5f5531['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x530dda[_0x1d7d('0xc1')],'ListId':_0x530dda[_0x1d7d('0xc2')],'VoiceQueueId':_0x530dda[_0x1d7d('0xc4')]||undefined,'CampaignId':_0x530dda['CampaignId']||undefined})[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x1b7')));_0x5f5531[_0x1d7d('0xba')](createObjHistory(_0x298128,_0x530dda,'RECALLINQUEUE',0x17,_0x1d7d('0x1b8')))['catch'](loggerCatch(_0x1d7d('0x1b9')));}else{_0x5f5531[_0x1d7d('0xc0')](createObjHistory(_0x298128,_0x530dda,_0x1d7d('0x1ba'),0x16,'RecallFailedTimeout'),_0x1d7d('0x1bb'),'[Originate][HistoryRecallClose]');}}}}else{_0x298128['outboundBlacklistCallsDay']+=0x1;_0x5f5531[_0x1d7d('0xc0')](createObjHistory(_0x298128,_0x530dda,'BLACKLIST',0xd,'Blacklist'),_0x1d7d('0x1bc'),_0x1d7d('0x1bd'));throw'inBlackList';}};};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x132')]=function(_0x4e0026){var _0x768888=this;var _0x308d0e=[];var _0x242ba5=_0x4e0026['limitCalls']-_0x4e0026[_0x1d7d('0x73')]-_0x4e0026[_0x1d7d('0x1be')];emitCampaignSummary(_0x4e0026);if(_0x242ba5>0x0){if(_0x242ba5>this[_0x1d7d('0x25')]){_0x242ba5=this[_0x1d7d('0x25')];}_0x4e0026[_0x1d7d('0x1be')]+=_0x242ba5;this[_0x1d7d('0xb6')](_0x4e0026['id'],_0x242ba5,_0x4e0026[_0x1d7d('0x1bf')])['then'](function(_0x502632){_0x4e0026['temp']-=_0x242ba5;_0x4e0026[_0x1d7d('0x1be')]=_0x4e0026['temp']>0x0?_0x4e0026[_0x1d7d('0x1be')]:0x0;if(!checkContactEmpty(_0x502632)){_0x4e0026[_0x1d7d('0x3e')]=_0x1d7d('0x90');logger['info']('[getContactCampaign2][Empty]'+_0x4e0026[_0x1d7d('0x40')]);}else{_0x4e0026['originated']+=_0x502632['length'];_0x4e0026['message']=_0x1d7d('0x1c0');for(var _0x4bae63=0x0;_0x4bae63<_0x502632[_0x1d7d('0x88')];_0x4bae63+=0x1){_0x4e0026[_0x1d7d('0x1c1')]+=0x1;if(_[_0x1d7d('0xa0')](_0x502632[_0x4bae63])||_[_0x1d7d('0xa0')](_0x502632[_0x4bae63][_0x1d7d('0x143')])||_[_0x1d7d('0xa0')](_0x502632[_0x4bae63][_0x1d7d('0x143')][_0x1d7d('0x144')])){_0x768888[_0x1d7d('0x1c2')](_0x1d7d('0x1c3'),_0x4e0026,_0x502632[_0x4bae63]);}else{_0x768888['checkIsBlackListIvr'](_['pick'](_0x502632[_0x4bae63],['CampaignId',_0x1d7d('0x1c4')]))['then'](_0x768888[_0x1d7d('0x1c5')](_0x4e0026,_0x502632[_0x4bae63]))[_0x1d7d('0xa3')](_0x768888['loggerHandler'](_0x1d7d('0x1c6'),_0x4e0026));}}}})['catch'](loggerGetContactDialer(_0x1d7d('0x1c7'),_0x4e0026,_0x242ba5));}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x12e')]=function(_0x4750e3,_0x5d2ae5){var _0x346067=this;var _0x4bcccf=[];var _0x258b83=_0x5d2ae5>=0x1?_0x5d2ae5:0x1;var _0xef5c6f=[];if(_0x4750e3[_0x1d7d('0x5b')]===_0x1d7d('0xa')){_0x258b83=0x1;}var _0x1e9726=Math[_0x1d7d('0x190')](_0x4750e3[_0x1d7d('0x52')]*_0x258b83)-_0x4750e3[_0x1d7d('0x73')]-_0x4750e3[_0x1d7d('0x1be')];emitVoiceQueueSummary(_0x4750e3);if(_0x4750e3[_0x1d7d('0x1c8')]>0x0){var _0xf1054=_0x4750e3['dialLimitQueue']-_0x4750e3[_0x1d7d('0x73')]-_0x4750e3[_0x1d7d('0x92')]-_0x4750e3['temp']-_0x4750e3[_0x1d7d('0x53')];if(_0x1e9726>_0xf1054){_0x1e9726=_0xf1054;}}if(_0x1e9726>0x0){if(_0x4750e3[_0x1d7d('0x5b')]===_0x1d7d('0xa')){_0x1e9726=0x1;}if(_0x1e9726>this['maxNumberOriginate']){_0x1e9726=this[_0x1d7d('0x25')];}_0x4750e3[_0x1d7d('0x1be')]+=_0x1e9726;for(var _0x5df0d8 in this['agents']){if(this[_0x1d7d('0x23')][_0x1d7d('0x89')](_0x5df0d8)){if(this['agents'][_0x5df0d8][_0x1d7d('0x9a')]==='not_inuse'&&this[_0x1d7d('0x23')][_0x5df0d8]['status']===_0x1d7d('0xcc')){_0x4bcccf['push'](this['agents'][_0x5df0d8]['id']);}}}this[_0x1d7d('0xb4')](_0x4750e3['id'],_0x4bcccf,_0x1e9726,_0x4750e3[_0x1d7d('0x1bf')])[_0x1d7d('0xaa')](function(_0x510b66){_0x4750e3[_0x1d7d('0x1be')]-=_0x1e9726;_0x4750e3['temp']=_0x4750e3[_0x1d7d('0x1be')]>0x0?_0x4750e3[_0x1d7d('0x1be')]:0x0;if(!checkContactEmpty(_0x510b66)){_0x346067['countReScheduled'](_0x4750e3)[_0x1d7d('0xaa')](sendMessageReschedule(_0x4750e3))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xac')));}else{_0x4750e3[_0x1d7d('0x73')]+=_0x510b66[_0x1d7d('0x88')];_0x4750e3[_0x1d7d('0x3e')]=_0x4750e3[_0x1d7d('0x5b')]===_0x1d7d('0xa')?_0x1d7d('0x149'):'RUNNING';for(var _0x25efae=0x0;_0x25efae<_0x510b66[_0x1d7d('0x88')];_0x25efae+=0x1){if(_['isNil'](_0x510b66[_0x25efae])||_['isNil'](_0x510b66[_0x25efae][_0x1d7d('0x143')])||_[_0x1d7d('0xa0')](_0x510b66[_0x25efae][_0x1d7d('0x143')]['phone'])){_0x346067[_0x1d7d('0x1c2')]('[actionOriginate]\x20',_0x4750e3,_0x510b66[_0x25efae]);}else{_0x346067[_0x1d7d('0xad')](_['pick'](_0x510b66[_0x25efae],[_0x1d7d('0xc4'),_0x1d7d('0x1c4')]))[_0x1d7d('0xaa')](_0x346067[_0x1d7d('0x1c5')](_0x4750e3,_0x510b66[_0x25efae]))[_0x1d7d('0xa3')](_0x346067['loggerHandler'](_0x1d7d('0x1c3'),_0x4750e3));}}}})[_0x1d7d('0xa3')](loggerGetContactDialer(_0x1d7d('0x1c9'),_0x4750e3,_0x1e9726));}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x82')]=function(_0xb678e4){var _0x464391=this;if(_0xb678e4[_0x1d7d('0x1c8')]>0x0){var _0x5e81ae=_0xb678e4[_0x1d7d('0x1c8')]-_0xb678e4[_0x1d7d('0x73')]-_0xb678e4['talking'];if(_0x5e81ae>0x0){this['tryOriginatePredictive'](_0xb678e4);}else{loggerPredictiveCalls[_0x1d7d('0x7a')](_0x1d7d('0x1ca'));}}else{this[_0x1d7d('0x1cb')](_0xb678e4);}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x1cb')]=function(_0x187301){var _0x421f4b=this;var _0x1a97ef=[];_0x187301['originated']+=0x1;for(var _0x40b789 in this[_0x1d7d('0x23')]){if(this['agents'][_0x1d7d('0x89')](_0x40b789)){if(this[_0x1d7d('0x23')][_0x40b789][_0x1d7d('0x9a')]===_0x1d7d('0x1cc')&&this['agents'][_0x40b789]['status']===_0x1d7d('0xcc')){_0x1a97ef[_0x1d7d('0xff')](this[_0x1d7d('0x23')][_0x40b789]['id']);}}}this['getContactDialer'](_0x187301['id'],_0x1a97ef,0x1,_0x187301[_0x1d7d('0x1bf')])['then'](function(_0x176519){if(!checkContactEmpty(_0x176519)){checkContactLowerLimitOriginate(_0x187301,0x1,0x0);_0x421f4b[_0x1d7d('0xab')](_0x187301)[_0x1d7d('0xaa')](sendMessageReschedule(_0x187301))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xac')));}else{_0x187301[_0x1d7d('0x3e')]=_0x1d7d('0x1c0');if(_[_0x1d7d('0xa0')](_0x176519[0x0])||_[_0x1d7d('0xa0')](_0x176519[0x0][_0x1d7d('0x143')])||_[_0x1d7d('0xa0')](_0x176519[0x0]['Contact']['phone'])){_0x421f4b[_0x1d7d('0x1c2')](_0x1d7d('0x1c3'),_0x187301,_0x176519[0x0]);}else{_0x421f4b[_0x1d7d('0xad')](_[_0x1d7d('0x100')](_0x176519[0x0],[_0x1d7d('0xc4'),_0x1d7d('0x1c4')]))['then'](_0x421f4b[_0x1d7d('0x1c5')](_0x187301,_0x176519[0x0]))['catch'](_0x421f4b[_0x1d7d('0xbe')](_0x1d7d('0x1cd'),_0x187301));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x187301,0x1));emitVoiceQueueSummary(_0x187301);};Dialer[_0x1d7d('0x1b')]['abandonmentRate']=function(_0x2462b7,_0x35943c,_0x42dc35,_0x1a32d2,_0x5cb335,_0x128334){loggerPredictive['info']('[abandonmentRate]','\x20m\x20=\x20',_0x2462b7,_0x1d7d('0x1ce'),_0x35943c,_0x1d7d('0x1cf'),_0x42dc35,_0x1d7d('0x1d0'),_0x1a32d2,_0x1d7d('0x1d1'),_0x5cb335);return new BPromise(function(_0x5e3264,_0x2512c8){if(_0x2462b7<=0x0||isNaN(_0x2462b7)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),'m\x20=\x20'+_0x2462b7));}if(_0x42dc35<=0x0||isNaN(_0x42dc35)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),_0x1d7d('0x1d3')+_0x42dc35));}if(_0x1a32d2<=0x0||isNaN(_0x1a32d2)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),_0x1d7d('0x1d4')+_0x1a32d2));}if(_0x35943c<=0x0||isNaN(_0x35943c)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),'Error',_0x1d7d('0x1d5')+_0x35943c));}if(_0x5cb335<=0x0||isNaN(_0x5cb335)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),'Amax\x20=\x20'+_0x5cb335));}_0x128334=_0x128334||0x0;var _0x11ddd5=0x1/_0x42dc35;var _0xbdc523=0x0;var _0x5442ad=0x0;var _0x460e88=0x0;var _0x43e1c8=0x0;for(var _0x5b3da4=0x0;_0x460e88<_0x5cb335;_0x5b3da4+=0x1){_0x5442ad=_0x5b3da4/_0x35943c;_0xbdc523=(_0x1a32d2*_0x5442ad+_0x128334)/_0x11ddd5;_0x460e88=erlangb(_0xbdc523,_0x2462b7);_0x43e1c8=_0xbdc523/_0x2462b7*(0x1-erlangb(_0xbdc523,_0x2462b7));}return _0x5e3264({'erlangCalls':_0x5b3da4,'erlangCallToSecond':_0x35943c/_0x5b3da4,'erlangAbandonmentRate':_0x460e88,'erlangBusyFactor':_0x43e1c8});});};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x1aa')]=function(_0x44cccb,_0x3cbff2,_0x38da01,_0x405167,_0x4fb276,_0x40c6c6){loggerPredictive[_0x1d7d('0x7a')]('[busyFactor]',_0x1d7d('0x1d6'),_0x44cccb,'\x20interval\x20=\x20',_0x3cbff2,_0x1d7d('0x1cf'),_0x38da01,_0x1d7d('0x1d0'),_0x405167,'\x20Umin\x20=\x20',_0x4fb276);return new BPromise(function(_0x492800,_0x430f29){if(_0x44cccb<=0x0||isNaN(_0x44cccb)){return _0x430f29(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),'m\x20=\x20'+_0x44cccb));}if(_0x38da01<=0x0||isNaN(_0x38da01)){return _0x430f29(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),'Ts\x20=\x20'+_0x38da01));}if(_0x405167<=0x0||isNaN(_0x405167)){return _0x430f29(msgResponse(_0x1d7d('0x1d2'),'Error','p\x20=\x20'+_0x405167));}if(_0x3cbff2<=0x0||isNaN(_0x3cbff2)){return _0x430f29(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),_0x1d7d('0x1d5')+_0x3cbff2));}if(_0x4fb276<=0x0||isNaN(_0x4fb276)){return _0x430f29(msgResponse('[abandonmentRate]',_0x1d7d('0x49'),_0x1d7d('0x1d7')+_0x4fb276));}_0x40c6c6=_0x40c6c6||0x0;var _0x5eb393=0x1/_0x38da01;var _0x9500cd=0x0;var _0x420655=0x0;var _0x39d38b=0x0;var _0x1d8ad0=0x0;for(var _0x3d3cfc=0x0;_0x1d8ad0<_0x4fb276;_0x3d3cfc+=0x1){_0x420655=_0x3d3cfc/_0x3cbff2;_0x9500cd=(_0x405167*_0x420655+_0x40c6c6)/_0x5eb393;_0x39d38b=erlangb(_0x9500cd,_0x44cccb);_0x1d8ad0=_0x9500cd/_0x44cccb*(0x1-erlangb(_0x9500cd,_0x44cccb));}return _0x492800({'erlangCalls':_0x3d3cfc,'erlangCallToSecond':_0x3cbff2/_0x3d3cfc,'erlangAbandonmentRate':_0x39d38b,'erlangBusyFactor':_0x1d8ad0});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5916d9f..df3a315 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 _0x2b24=['starttime','responsetime','droptime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number'];(function(_0x119846,_0x1308cc){var _0x550507=function(_0x18a39f){while(--_0x18a39f){_0x119846['push'](_0x119846['shift']());}};_0x550507(++_0x1308cc);}(_0x2b24,0x118));var _0x42b2=function(_0x2cfbe2,_0x3da4c7){_0x2cfbe2=_0x2cfbe2-0x0;var _0xdd4ff5=_0x2b24[_0x2cfbe2];return _0xdd4ff5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x42b2('0x0'));function getSeconds(_0x2bb926,_0x3b3ad5){var _0x386764=moment(_0x2bb926)[_0x42b2('0x1')](0x0);var _0x5117e2=moment(_0x3b3ad5)[_0x42b2('0x1')](0x0);return _0x386764['diff'](_0x5117e2,_0x42b2('0x2'));}function QueueCallerAbandon(_0x30af08,_0x4c782d){this['scheduledat']=_0x30af08[_0x42b2('0x3')];this[_0x42b2('0x4')]=_0x30af08[_0x42b2('0x4')];this[_0x42b2('0x5')]=_0x30af08['type']===_0x42b2('0x6')?'queue':_0x30af08['type'];this['countbusyretry']=_0x30af08[_0x42b2('0x7')];this[_0x42b2('0x8')]=_0x30af08[_0x42b2('0x8')];this[_0x42b2('0x9')]=_0x30af08[_0x42b2('0x9')];this[_0x42b2('0xa')]=_0x30af08[_0x42b2('0x7')]+_0x30af08[_0x42b2('0x8')]+_0x30af08[_0x42b2('0x9')];this['uniqueid']=_0x4c782d[_0x42b2('0xb')];this[_0x42b2('0xc')]=_0x30af08[_0x42b2('0xd')];this[_0x42b2('0xe')]=_0x30af08[_0x42b2('0xf')];this[_0x42b2('0x10')]=_0x30af08[_0x42b2('0x10')];this[_0x42b2('0x11')]=_0x30af08[_0x42b2('0x11')];this[_0x42b2('0x12')]=_0x30af08['droptime'];this['endtime']=this['droptime'];this[_0x42b2('0x13')]=getSeconds(_0x30af08[_0x42b2('0x11')],_0x30af08[_0x42b2('0x10')]);this[_0x42b2('0x14')]=getSeconds(this[_0x42b2('0x12')],_0x30af08[_0x42b2('0x11')]);this[_0x42b2('0x15')]=0x0;this[_0x42b2('0x16')]=_0x4c782d[_0x42b2('0x16')];this[_0x42b2('0x17')]=_0x4c782d[_0x42b2('0x18')];this[_0x42b2('0x19')]=_0x4c782d[_0x42b2('0x19')];this['callback']=_0x30af08[_0x42b2('0x1a')];this[_0x42b2('0x1b')]=_0x30af08[_0x42b2('0x1b')];this[_0x42b2('0x1c')]=_0x30af08[_0x42b2('0x1c')];this[_0x42b2('0x1d')]=_0x30af08[_0x42b2('0x1d')];this[_0x42b2('0x1e')]=_0x30af08[_0x42b2('0x1e')];this['ListId']=_0x30af08[_0x42b2('0x1f')];this['UserId']=_0x30af08[_0x42b2('0x20')];this['VoiceQueueId']=_0x30af08[_0x42b2('0x21')];this[_0x42b2('0x22')]=_0x30af08[_0x42b2('0x22')];this[_0x42b2('0x23')]=_0x30af08['originatecalleridnum']||'';this[_0x42b2('0x24')]=_0x30af08[_0x42b2('0x24')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x3a15=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','connectedlinename'];(function(_0x34541e,_0x3955a0){var _0x599b9b=function(_0x3ab70e){while(--_0x3ab70e){_0x34541e['push'](_0x34541e['shift']());}};_0x599b9b(++_0x3955a0);}(_0x3a15,0xde));var _0x53a1=function(_0x582f4b,_0x23695c){_0x582f4b=_0x582f4b-0x0;var _0x37fdc7=_0x3a15[_0x582f4b];return _0x37fdc7;};'use strict';var util=require(_0x53a1('0x0'));var _=require('lodash');var moment=require(_0x53a1('0x1'));function getSeconds(_0x4df618,_0x2e2b95){var _0x413eaa=moment(_0x4df618)[_0x53a1('0x2')](0x0);var _0x58c79d=moment(_0x2e2b95)['milliseconds'](0x0);return _0x413eaa[_0x53a1('0x3')](_0x58c79d,'seconds');}function QueueCallerAbandon(_0x48309b,_0x5acff4){this[_0x53a1('0x4')]=_0x48309b['scheduledat'];this[_0x53a1('0x5')]=_0x48309b[_0x53a1('0x5')];this[_0x53a1('0x6')]=_0x48309b['type']===_0x53a1('0x7')?_0x53a1('0x8'):_0x48309b['type'];this['countbusyretry']=_0x48309b['countbusyretry'];this[_0x53a1('0x9')]=_0x48309b[_0x53a1('0x9')];this[_0x53a1('0xa')]=_0x48309b[_0x53a1('0xa')];this['countglobal']=_0x48309b['countbusyretry']+_0x48309b['countcongestionretry']+_0x48309b[_0x53a1('0xa')];this[_0x53a1('0xb')]=_0x5acff4['uniqueid'];this[_0x53a1('0xc')]=_0x48309b[_0x53a1('0xd')];this[_0x53a1('0xe')]=_0x48309b['number'];this[_0x53a1('0xf')]=_0x48309b[_0x53a1('0xf')];this[_0x53a1('0x10')]=_0x48309b[_0x53a1('0x10')];this[_0x53a1('0x11')]=_0x48309b[_0x53a1('0x11')];this[_0x53a1('0x12')]=this[_0x53a1('0x11')];this[_0x53a1('0x13')]=getSeconds(_0x48309b['responsetime'],_0x48309b[_0x53a1('0xf')]);this[_0x53a1('0x14')]=getSeconds(this[_0x53a1('0x11')],_0x48309b[_0x53a1('0x10')]);this[_0x53a1('0x15')]=0x0;this[_0x53a1('0x8')]=_0x5acff4[_0x53a1('0x8')];this['membername']=_0x5acff4[_0x53a1('0x16')];this['reason']=_0x5acff4[_0x53a1('0x17')];this[_0x53a1('0x18')]=_0x48309b[_0x53a1('0x18')];this[_0x53a1('0x19')]=_0x48309b[_0x53a1('0x19')];this[_0x53a1('0x1a')]=_0x48309b['callbackat'];this[_0x53a1('0x1b')]=_0x48309b[_0x53a1('0x1b')];this['ContactId']=_0x48309b[_0x53a1('0x1c')];this[_0x53a1('0x1d')]=_0x48309b['ListId'];this[_0x53a1('0x1e')]=_0x48309b[_0x53a1('0x1e')];this['VoiceQueueId']=_0x48309b[_0x53a1('0x1f')];this[_0x53a1('0x20')]=_0x48309b['CampaignId'];this[_0x53a1('0x21')]=_0x48309b[_0x53a1('0x21')]||'';this[_0x53a1('0x22')]=_0x48309b[_0x53a1('0x22')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 74d19c8..90777f2 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 _0xd4b6=['AttachmentId','exports','util','uniqueid','channel','format','%s/%s/%s','tech','Trunk','name','fax','path'];(function(_0x4f01ad,_0x5334cd){var _0x189341=function(_0x4db7d7){while(--_0x4db7d7){_0x4f01ad['push'](_0x4f01ad['shift']());}};_0x189341(++_0x5334cd);}(_0xd4b6,0x1d6));var _0x6d4b=function(_0x5dbc37,_0xdf1c57){_0x5dbc37=_0x5dbc37-0x0;var _0x1296f8=_0xd4b6[_0x5dbc37];return _0x1296f8;};'use strict';var util=require(_0x6d4b('0x0'));var _=require('lodash');var moment=require('moment');function Action(_0x228db6,_0x1e7343,_0x7b6b74){this[_0x6d4b('0x1')]=_0x228db6||undefined;this[_0x6d4b('0x2')]=util[_0x6d4b('0x3')](_0x6d4b('0x4'),_0x1e7343[_0x6d4b('0x5')],_0x1e7343[_0x6d4b('0x6')][_0x6d4b('0x7')],_0x7b6b74[_0x6d4b('0x8')]);this['localstationid']=_0x1e7343['localstationid'];this['headerinfo']=_0x1e7343['headerinfo'];this[_0x6d4b('0x9')]=_0x7b6b74[_0x6d4b('0x9')];this[_0x6d4b('0xa')]=_0x7b6b74[_0x6d4b('0xa')];}module[_0x6d4b('0xb')]=Action; \ No newline at end of file +var _0x34e7=['localstationid','headerinfo','path','AttachmentId','exports','util','lodash','moment','channel','Trunk','name','fax'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0x34e7,0x155));var _0x734e=function(_0x5e98c3,_0x328bed){_0x5e98c3=_0x5e98c3-0x0;var _0x1683ed=_0x34e7[_0x5e98c3];return _0x1683ed;};'use strict';var util=require(_0x734e('0x0'));var _=require(_0x734e('0x1'));var moment=require(_0x734e('0x2'));function Action(_0x2896de,_0x2051f3,_0x24908b){this['uniqueid']=_0x2896de||undefined;this[_0x734e('0x3')]=util['format']('%s/%s/%s',_0x2051f3['tech'],_0x2051f3[_0x734e('0x4')][_0x734e('0x5')],_0x24908b[_0x734e('0x6')]);this[_0x734e('0x7')]=_0x2051f3[_0x734e('0x7')];this[_0x734e('0x8')]=_0x2051f3[_0x734e('0x8')];this[_0x734e('0x9')]=_0x24908b[_0x734e('0x9')];this[_0x734e('0xa')]=_0x24908b[_0x734e('0xa')];}module[_0x734e('0xb')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 49490b6..961601d 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 _0x54d8=['Fax\x20failed','checkAfterSend','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','value','channelstate','channelstatedesc','variable','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]'];(function(_0x33ea2f,_0x405a7e){var _0x139800=function(_0x3dcd53){while(--_0x3dcd53){_0x33ea2f['push'](_0x33ea2f['shift']());}};_0x139800(++_0x405a7e);}(_0x54d8,0x1ec));var _0x854d=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x54d8[_0x178e48];return _0x440d7e;};'use strict';var util=require(_0x854d('0x0'));var _=require(_0x854d('0x1'));var BPromise=require(_0x854d('0x2'));var uuid=require(_0x854d('0x3'));var moment=require(_0x854d('0x4'));var path=require(_0x854d('0x5'));var tiff2pdf=require(_0x854d('0x6'));var gs=require('./util/gs');var logger=require(_0x854d('0x7'))(_0x854d('0x8'));var ami=require('../ami');var rpcDb=require(_0x854d('0x9'));var Channel=require(_0x854d('0xa'));var ut=require('./util/util');var Action=require(_0x854d('0xb'));var faxAccount=require(_0x854d('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x597144){this[_0x854d('0xd')]={};this[_0x854d('0xe')]=_0x597144['faxAccounts'];this[_0x854d('0xf')]=_0x597144['trunks'];this[_0x854d('0x10')]={};ami['on'](_0x854d('0x11'),this[_0x854d('0x12')]['bind'](this));ami['on']('varset',this[_0x854d('0x13')][_0x854d('0x14')](this));ami['on'](_0x854d('0x15'),this[_0x854d('0x16')][_0x854d('0x14')](this));ami['on'](_0x854d('0x17'),this[_0x854d('0x18')]['bind'](this));ami['on'](_0x854d('0x19'),this[_0x854d('0x1a')]['bind'](this));ami['on'](_0x854d('0x1b'),this[_0x854d('0x1c')][_0x854d('0x14')](this));ami['on'](_0x854d('0x1d'),this[_0x854d('0x1e')]['bind'](this));ami['on'](_0x854d('0x1f'),this[_0x854d('0x20')][_0x854d('0x14')](this));}Fax['prototype'][_0x854d('0x12')]=function(_0x2a40ca){if(_0x2a40ca['context']===_0x854d('0x21')){for(var _0x5878dc in this[_0x854d('0xe')]){if(this['faxAccounts'][_0x854d('0x22')](_0x5878dc)){if(_0x2a40ca['exten']===this[_0x854d('0xe')][_0x5878dc][_0x854d('0x23')]){this[_0x854d('0xd')][_0x2a40ca[_0x854d('0x24')]]={};this[_0x854d('0xd')][_0x2a40ca['uniqueid']]['channel']=_0x2a40ca[_0x854d('0x25')];this[_0x854d('0xd')][_0x2a40ca[_0x854d('0x24')]]['id']=this['faxAccounts'][_0x5878dc]['id'];this[_0x854d('0xd')][_0x2a40ca[_0x854d('0x24')]][_0x854d('0x26')]=this[_0x854d('0xe')][_0x5878dc]['name'];logger[_0x854d('0x27')](_0x2a40ca[_0x854d('0x24')],'\x20syncNewchannel\x20');}}}}if(this[_0x854d('0x10')][_0x2a40ca[_0x854d('0x24')]]){this[_0x854d('0xd')][_0x2a40ca[_0x854d('0x24')]]={};this[_0x854d('0xd')][_0x2a40ca['uniqueid']]['channel']=_0x2a40ca['channel'];logger[_0x854d('0x27')](_0x2a40ca['uniqueid'],_0x854d('0x28'));}};Fax[_0x854d('0x29')][_0x854d('0x13')]=function(_0x335c71){if(this[_0x854d('0xd')][_0x335c71[_0x854d('0x24')]]){for(var _0x3a5aa7 in _0x335c71['variable']){if(_0x335c71['variable']['hasOwnProperty'](_0x3a5aa7)){this['channels'][_0x335c71[_0x854d('0x24')]][_0x3a5aa7]=_0x335c71[_0x854d('0x2a')];}}}};Fax[_0x854d('0x29')][_0x854d('0x16')]=function(_0x4ec220){if(this[_0x854d('0xd')][_0x4ec220[_0x854d('0x24')]]){this['channels'][_0x4ec220['uniqueid']]['channelstate']=_0x4ec220[_0x854d('0x2b')];this[_0x854d('0xd')][_0x4ec220['uniqueid']]['channelstatedesc']=_0x4ec220[_0x854d('0x2c')];}};Fax[_0x854d('0x29')][_0x854d('0x18')]=function(_0x3b1229){if(this[_0x854d('0xd')][_0x3b1229[_0x854d('0x24')]]){for(var _0x4de937 in _0x3b1229[_0x854d('0x2d')]){if(_0x3b1229[_0x854d('0x2d')][_0x854d('0x22')](_0x4de937)){this[_0x854d('0xd')][_0x3b1229[_0x854d('0x24')]][_0x4de937]=_0x3b1229[_0x854d('0x2a')];}}}};Fax[_0x854d('0x29')][_0x854d('0x1a')]=function(_0x2f7432){if(this[_0x854d('0xd')][_0x2f7432[_0x854d('0x24')]]){this['channels'][_0x2f7432[_0x854d('0x24')]]['operation']=_0x2f7432[_0x854d('0x2e')];this[_0x854d('0xd')][_0x2f7432[_0x854d('0x24')]][_0x854d('0x2f')]=_0x2f7432[_0x854d('0x2f')];this[_0x854d('0xd')][_0x2f7432['uniqueid']][_0x854d('0x23')]=_0x2f7432['localstationid'];this[_0x854d('0xd')][_0x2f7432[_0x854d('0x24')]][_0x854d('0x30')]=_0x2f7432[_0x854d('0x30')];logger[_0x854d('0x27')](_0x2f7432[_0x854d('0x24')],_0x854d('0x31'));}};Fax[_0x854d('0x29')][_0x854d('0x1c')]=function(_0x501f35){var _0x292f43=this;if(this['channels'][_0x501f35[_0x854d('0x24')]]){var _0x181155=this[_0x854d('0xd')][_0x501f35['uniqueid']]['id'];this['channels'][_0x501f35[_0x854d('0x24')]][_0x854d('0x32')]=_0x501f35[_0x854d('0x32')];this[_0x854d('0xd')][_0x501f35['uniqueid']]['pagestransferred']=_0x501f35[_0x854d('0x33')];this[_0x854d('0xd')][_0x501f35[_0x854d('0x24')]][_0x854d('0x23')]=_0x501f35[_0x854d('0x23')];this[_0x854d('0xd')][_0x501f35[_0x854d('0x24')]][_0x854d('0x34')]=_0x501f35[_0x854d('0x34')];this[_0x854d('0xd')][_0x501f35['uniqueid']][_0x854d('0x35')]=_0x501f35[_0x854d('0x35')];this['channels'][_0x501f35[_0x854d('0x24')]][_0x854d('0x30')]=_0x501f35[_0x854d('0x30')];this[_0x854d('0xd')][_0x501f35[_0x854d('0x24')]][_0x854d('0x36')]=_0x501f35[_0x854d('0x36')];if(this[_0x854d('0xd')][_0x501f35[_0x854d('0x24')]][_0x854d('0x33')]>0x0){tiff2pdf(_0x501f35[_0x854d('0x30')],_0x854d('0x37'),function(_0x4f93cd){logger[_0x854d('0x27')](_0x501f35[_0x854d('0x24')],'\x20result\x20conversion\x20file\x20',_0x4f93cd[_0x854d('0x38')]);attachment['create']({'name':path[_0x854d('0x39')](_0x501f35[_0x854d('0x30')])[_0x854d('0x26')],'basename':path[_0x854d('0x39')](_0x501f35[_0x854d('0x30')])['name']+_0x854d('0x3a'),'type':_0x854d('0x3b')})[_0x854d('0x3c')](function(_0x2917dc){faxAccount[_0x854d('0x3d')](_0x181155,{'from':_0x501f35['calleridnum'],'mapKey':_0x854d('0x8'),'body':path[_0x854d('0x39')](_0x501f35[_0x854d('0x30')])[_0x854d('0x26')]+_0x854d('0x3a'),'AttachmentId':_0x2917dc['id']})[_0x854d('0x3e')](function(_0x2ca482){logger[_0x854d('0x3f')](_0x501f35['uniqueid'],_0x854d('0x40'),JSON[_0x854d('0x41')](_0x2ca482));});})[_0x854d('0x3e')](function(_0x223c82){logger[_0x854d('0x3f')](_0x501f35[_0x854d('0x24')],_0x854d('0x42'),JSON[_0x854d('0x41')](_0x223c82));});});}logger['info'](_0x501f35[_0x854d('0x24')],_0x854d('0x42'));}};Fax[_0x854d('0x29')][_0x854d('0x20')]=function(_0x3839a0){if(this[_0x854d('0x10')][_0x3839a0[_0x854d('0x24')]]){_[_0x854d('0x43')](this[_0x854d('0xd')][_0x3839a0[_0x854d('0x24')]],_[_0x854d('0x44')](_0x3839a0,[_0x854d('0x45'),_0x854d('0x46')]));}};function updateStatus(_0x3c56bd){if(_0x3c56bd[_0x854d('0x47')]){faxMessage[_0x854d('0x48')](_0x3c56bd[_0x854d('0x47')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x854d('0x3c')](function(_0xfe2c06){ut[_0x854d('0x49')](_0x854d('0x4a'),_0xfe2c06);})[_0x854d('0x3e')](function(_0x3791d2){ut[_0x854d('0x49')](_0x854d('0x4b'),_0x3791d2);});}else{ut[_0x854d('0x49')](_0x854d('0x4c'));}}Fax[_0x854d('0x29')]['updateStatus']=function(_0x33efdd,_0x262c34,_0x31602b){var _0x18b7a0=this;var _0x5b4bce={};if(_0x262c34){_0x5b4bce={'read':_0x262c34};}else{_0x5b4bce={'failMessage':_0x31602b};}if(this[_0x854d('0x10')][_0x33efdd][_0x854d('0x47')]){faxMessage[_0x854d('0x48')](this[_0x854d('0x10')][_0x33efdd][_0x854d('0x47')],_0x5b4bce)[_0x854d('0x3c')](function(_0x859193){ut[_0x854d('0x49')]('[Fax][Message][Updated]',_0x859193);})[_0x854d('0x3e')](function(_0xaa8268){ut[_0x854d('0x49')](_0x854d('0x4d'),_0xaa8268);})[_0x854d('0x4e')](function(){delete _0x18b7a0['channels'][_0x33efdd];delete _0x18b7a0[_0x854d('0x10')][_0x33efdd];});}else{ut[_0x854d('0x49')](_0x854d('0x4f'));delete this[_0x854d('0xd')][_0x33efdd];delete this[_0x854d('0x10')][_0x33efdd];}};Fax['prototype']['syncHangup']=function(_0x580995){var _0x5f2547=this;if(this['channels'][_0x580995[_0x854d('0x24')]]){if(this[_0x854d('0x10')][_0x580995[_0x854d('0x24')]]){this[_0x854d('0xd')][_0x580995[_0x854d('0x24')]]['id']=this[_0x854d('0x10')][_0x580995[_0x854d('0x24')]]['id'];this['channels'][_0x580995[_0x854d('0x24')]][_0x854d('0x26')]=this[_0x854d('0x10')][_0x580995['uniqueid']][_0x854d('0x26')];}logger[_0x854d('0x27')](_0x580995[_0x854d('0x24')],this['actions'][_0x580995[_0x854d('0x24')]]?_0x854d('0x50'):_0x854d('0x51'),JSON['stringify'](this[_0x854d('0xd')][_0x580995[_0x854d('0x24')]]));if(this[_0x854d('0x10')][_0x580995[_0x854d('0x24')]]){if(this['channels'][_0x580995[_0x854d('0x24')]][_0x854d('0x52')]>0x0&&this[_0x854d('0xd')][_0x580995['uniqueid']][_0x854d('0x19')]==='SUCCESS'){this[_0x854d('0x53')](_0x580995[_0x854d('0x24')],!![]);}else{this[_0x854d('0x53')](_0x580995[_0x854d('0x24')],![],this[_0x854d('0xd')][_0x580995[_0x854d('0x24')]]['faxstatusstring']?_0x854d('0x54')+this[_0x854d('0xd')][_0x580995[_0x854d('0x24')]][_0x854d('0x55')]:_0x854d('0x56'));}}}};Fax['prototype'][_0x854d('0x57')]=function(_0xe4983d){var _0x59d1d9=this;return new BPromise(function(_0x4619ce,_0x3f93d7){_0x59d1d9[_0x854d('0x58')](_0xe4983d,_0x59d1d9['faxAccounts'][_0xe4983d[_0x854d('0x59')]])['then'](function(_0x231466){ut[_0x854d('0x49')](_0x854d('0x5a'),_0x231466);_0x4619ce(ut[_0x854d('0x38')](_0x854d('0x5b')));})[_0x854d('0x3e')](function(_0x1c8c3b){ut[_0x854d('0x49')](_0x854d('0x5c'),_0x1c8c3b);updateStatus(_0xe4983d);_0x3f93d7(ut[_0x854d('0x38')](_0x854d('0x5d')));});});};Fax['prototype'][_0x854d('0x5e')]=function(_0x2185cb){var _0xde1071=this;return new BPromise(function(_0x10bbd4,_0x17f843){var _0x5f10c5=_0xde1071['checkTrunk'](_0xde1071[_0x854d('0xe')][_0x2185cb['FaxAccountId']][_0x854d('0x5f')],_0x2185cb);if(_0x5f10c5[_0x854d('0x60')]){_0x10bbd4(ut[_0x854d('0x38')]('Trunk\x20Reachable'));}else{_0x17f843(ut[_0x854d('0x38')](_0x5f10c5[_0x854d('0x38')]));}});};function originate(_0x49e0c6,_0x152c37,_0x4c7efa){return new BPromise(function(_0x1d2ed3,_0x241603){if(_0x4c7efa){var _0x2af8eb=util[_0x854d('0x61')](_0x854d('0x62'),path[_0x854d('0x39')](_0x49e0c6[_0x854d('0x5')])[_0x854d('0x26')],_0x49e0c6['path']);gs[_0x854d('0x63')](_0x2af8eb)[_0x854d('0x3c')](function(){_0x49e0c6['path']=util[_0x854d('0x61')]('%s/%s.tif',path[_0x854d('0x39')](_0x49e0c6[_0x854d('0x5')])[_0x854d('0x64')],path[_0x854d('0x39')](_0x49e0c6[_0x854d('0x5')])[_0x854d('0x26')]);_0x152c37[_0x854d('0x65')]=_0x49e0c6['path'];ut[_0x854d('0x49')](_0x854d('0x66'),'');ami[_0x854d('0x67')](ut[_0x854d('0x68')](_0x49e0c6,_0x152c37))[_0x854d('0x3c')](function(_0x1bb70b){_0x1d2ed3(_0x1bb70b);})['catch'](function(_0x122699){_0x241603(_0x122699);});})[_0x854d('0x3e')](function(_0x2db75c){_0x241603(_0x2db75c);});}else{ami[_0x854d('0x67')](ut[_0x854d('0x68')](_0x49e0c6,_0x152c37))['then'](function(_0x5b1667){_0x1d2ed3(_0x5b1667);})[_0x854d('0x3e')](function(_0x1f31de){_0x241603(_0x1f31de);});}});}Fax[_0x854d('0x29')][_0x854d('0x58')]=function(_0x2d3cc4,_0x451369){var _0x5142b5=this;return new BPromise(function(_0x2d42b5,_0x48327f){var _0x2b792d=uuid['v4']();var _0xf70f85=ut[_0x854d('0x69')](_0x2d3cc4,_0x451369);_0x5142b5['actions'][_0x2b792d]=new Action(_0x2b792d,_0x451369,_0x2d3cc4);var _0x4e126d=_0x5142b5[_0x854d('0x10')][_0x2b792d];if(path[_0x854d('0x39')](_0x2d3cc4[_0x854d('0x5')])['ext']===_0x854d('0x3a')){originate(_0x4e126d,_0xf70f85,!![])[_0x854d('0x3c')](function(_0x27384b){_0x2d42b5(_0x27384b);})[_0x854d('0x3e')](function(_0x4e6cd0){_0x48327f(_0x4e6cd0);});}else{originate(_0x4e126d,_0xf70f85,![])['then'](function(_0x4256ad){_0x2d42b5(_0x4256ad);})[_0x854d('0x3e')](function(_0x285e12){_0x48327f(_0x285e12);});}});};Fax['prototype'][_0x854d('0x6a')]=function(_0x704c4){return!_[_0x854d('0x6b')](_0x704c4)&&!_[_0x854d('0x6b')](_0x704c4['name'])&&!_[_0x854d('0x6b')](_0x704c4[_0x854d('0x6c')])&&_0x704c4[_0x854d('0x6c')]&&!_[_0x854d('0x6b')](this[_0x854d('0xf')][util['format'](_0x854d('0x6d'),_0x704c4[_0x854d('0x26')])])&&!_[_0x854d('0x6b')](this[_0x854d('0xf')][util[_0x854d('0x61')]('SIP/%s',_0x704c4[_0x854d('0x26')])][_0x854d('0x2f')])&&(this[_0x854d('0xf')][util['format'](_0x854d('0x6d'),_0x704c4[_0x854d('0x26')])][_0x854d('0x2f')]==='reachable'||this[_0x854d('0xf')][util[_0x854d('0x61')](_0x854d('0x6d'),_0x704c4[_0x854d('0x26')])][_0x854d('0x2f')]==='unmonitored');};Fax[_0x854d('0x29')][_0x854d('0x6e')]=function(_0x48e607,_0x429c42){if(!this[_0x854d('0x6a')](_0x48e607)){ut[_0x854d('0x49')](_0x854d('0x6f'),_[_0x854d('0x6b')](_0x48e607)?'':_0x48e607[_0x854d('0x26')]+_0x854d('0x70'));return{'isValid':![],'message':_0x854d('0x71')};}if(_[_0x854d('0x6b')](_0x429c42['fax'])){ut[_0x854d('0x49')](_0x854d('0x72'),JSON[_0x854d('0x41')](_0x429c42));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x854d('0x6b')](_0x429c42[_0x854d('0x5')])){ut[_0x854d('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x854d('0x41')](_0x429c42));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x854d('0x73')};};module[_0x854d('0x74')]=Fax; \ No newline at end of file +var _0x5dfb=['SUCCESS','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','format','SIP/%s','checkTrunk','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','path','./util/gs','../../../config/logger','fax','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','prototype','context','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus'];(function(_0xdb62e7,_0x121c24){var _0x681067=function(_0x34252b){while(--_0x34252b){_0xdb62e7['push'](_0xdb62e7['shift']());}};_0x681067(++_0x121c24);}(_0x5dfb,0x9b));var _0xb5df=function(_0x14ad92,_0x3b4315){_0x14ad92=_0x14ad92-0x0;var _0x41ceae=_0x5dfb[_0x14ad92];return _0x41ceae;};'use strict';var util=require('util');var _=require(_0xb5df('0x0'));var BPromise=require(_0xb5df('0x1'));var uuid=require(_0xb5df('0x2'));var moment=require('moment');var path=require(_0xb5df('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xb5df('0x4'));var logger=require(_0xb5df('0x5'))(_0xb5df('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xb5df('0x7'));var ut=require(_0xb5df('0x8'));var Action=require(_0xb5df('0x9'));var faxAccount=require(_0xb5df('0xa'));var attachment=require(_0xb5df('0xb'));var faxMessage=require(_0xb5df('0xc'));function Fax(_0x52cc2a){this[_0xb5df('0xd')]={};this['faxAccounts']=_0x52cc2a['faxAccounts'];this[_0xb5df('0xe')]=_0x52cc2a[_0xb5df('0xe')];this[_0xb5df('0xf')]={};ami['on'](_0xb5df('0x10'),this[_0xb5df('0x11')][_0xb5df('0x12')](this));ami['on'](_0xb5df('0x13'),this[_0xb5df('0x14')][_0xb5df('0x12')](this));ami['on']('newstate',this[_0xb5df('0x15')][_0xb5df('0x12')](this));ami['on'](_0xb5df('0x16'),this[_0xb5df('0x17')][_0xb5df('0x12')](this));ami['on']('faxstatus',this[_0xb5df('0x18')][_0xb5df('0x12')](this));ami['on'](_0xb5df('0x19'),this[_0xb5df('0x1a')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0xb5df('0x12')](this));ami['on'](_0xb5df('0x1b'),this['syncOriginateResponse'][_0xb5df('0x12')](this));}Fax[_0xb5df('0x1c')][_0xb5df('0x11')]=function(_0x3fdb3a){if(_0x3fdb3a[_0xb5df('0x1d')]===_0xb5df('0x1e')){for(var _0x2490ab in this[_0xb5df('0x1f')]){if(this[_0xb5df('0x1f')][_0xb5df('0x20')](_0x2490ab)){if(_0x3fdb3a[_0xb5df('0x21')]===this['faxAccounts'][_0x2490ab][_0xb5df('0x22')]){this[_0xb5df('0xd')][_0x3fdb3a[_0xb5df('0x23')]]={};this[_0xb5df('0xd')][_0x3fdb3a[_0xb5df('0x23')]][_0xb5df('0x24')]=_0x3fdb3a[_0xb5df('0x24')];this['channels'][_0x3fdb3a[_0xb5df('0x23')]]['id']=this[_0xb5df('0x1f')][_0x2490ab]['id'];this[_0xb5df('0xd')][_0x3fdb3a[_0xb5df('0x23')]][_0xb5df('0x25')]=this[_0xb5df('0x1f')][_0x2490ab][_0xb5df('0x25')];logger[_0xb5df('0x26')](_0x3fdb3a[_0xb5df('0x23')],_0xb5df('0x27'));}}}}if(this[_0xb5df('0xf')][_0x3fdb3a[_0xb5df('0x23')]]){this[_0xb5df('0xd')][_0x3fdb3a[_0xb5df('0x23')]]={};this[_0xb5df('0xd')][_0x3fdb3a['uniqueid']][_0xb5df('0x24')]=_0x3fdb3a['channel'];logger[_0xb5df('0x26')](_0x3fdb3a['uniqueid'],_0xb5df('0x27'));}};Fax[_0xb5df('0x1c')][_0xb5df('0x14')]=function(_0x5c5451){if(this['channels'][_0x5c5451[_0xb5df('0x23')]]){for(var _0x576628 in _0x5c5451[_0xb5df('0x28')]){if(_0x5c5451[_0xb5df('0x28')][_0xb5df('0x20')](_0x576628)){this[_0xb5df('0xd')][_0x5c5451[_0xb5df('0x23')]][_0x576628]=_0x5c5451[_0xb5df('0x29')];}}}};Fax[_0xb5df('0x1c')]['syncNewState']=function(_0x5e9c61){if(this['channels'][_0x5e9c61['uniqueid']]){this[_0xb5df('0xd')][_0x5e9c61[_0xb5df('0x23')]][_0xb5df('0x2a')]=_0x5e9c61[_0xb5df('0x2a')];this[_0xb5df('0xd')][_0x5e9c61[_0xb5df('0x23')]][_0xb5df('0x2b')]=_0x5e9c61['channelstatedesc'];}};Fax[_0xb5df('0x1c')][_0xb5df('0x17')]=function(_0x1d0c64){if(this['channels'][_0x1d0c64[_0xb5df('0x23')]]){for(var _0x459ad3 in _0x1d0c64['variable']){if(_0x1d0c64['variable'][_0xb5df('0x20')](_0x459ad3)){this[_0xb5df('0xd')][_0x1d0c64[_0xb5df('0x23')]][_0x459ad3]=_0x1d0c64['value'];}}}};Fax[_0xb5df('0x1c')][_0xb5df('0x18')]=function(_0x4c1850){if(this['channels'][_0x4c1850[_0xb5df('0x23')]]){this[_0xb5df('0xd')][_0x4c1850[_0xb5df('0x23')]][_0xb5df('0x2c')]=_0x4c1850[_0xb5df('0x2c')];this[_0xb5df('0xd')][_0x4c1850[_0xb5df('0x23')]][_0xb5df('0x2d')]=_0x4c1850[_0xb5df('0x2d')];this[_0xb5df('0xd')][_0x4c1850['uniqueid']][_0xb5df('0x22')]=_0x4c1850[_0xb5df('0x22')];this[_0xb5df('0xd')][_0x4c1850[_0xb5df('0x23')]][_0xb5df('0x2e')]=_0x4c1850[_0xb5df('0x2e')];logger[_0xb5df('0x26')](_0x4c1850[_0xb5df('0x23')],_0xb5df('0x2f'));}};Fax[_0xb5df('0x1c')][_0xb5df('0x1a')]=function(_0x54d3d5){var _0x1a793e=this;if(this[_0xb5df('0xd')][_0x54d3d5[_0xb5df('0x23')]]){var _0x327329=this[_0xb5df('0xd')][_0x54d3d5[_0xb5df('0x23')]]['id'];this['channels'][_0x54d3d5['uniqueid']][_0xb5df('0x30')]=_0x54d3d5['remotestationid'];this[_0xb5df('0xd')][_0x54d3d5['uniqueid']][_0xb5df('0x31')]=_0x54d3d5[_0xb5df('0x31')];this[_0xb5df('0xd')][_0x54d3d5['uniqueid']][_0xb5df('0x22')]=_0x54d3d5[_0xb5df('0x22')];this[_0xb5df('0xd')][_0x54d3d5[_0xb5df('0x23')]][_0xb5df('0x32')]=_0x54d3d5[_0xb5df('0x32')];this[_0xb5df('0xd')][_0x54d3d5[_0xb5df('0x23')]]['transferrate']=_0x54d3d5[_0xb5df('0x33')];this[_0xb5df('0xd')][_0x54d3d5[_0xb5df('0x23')]]['filename']=_0x54d3d5[_0xb5df('0x2e')];this[_0xb5df('0xd')][_0x54d3d5['uniqueid']][_0xb5df('0x34')]=_0x54d3d5[_0xb5df('0x34')];if(this[_0xb5df('0xd')][_0x54d3d5[_0xb5df('0x23')]][_0xb5df('0x31')]>0x0){tiff2pdf(_0x54d3d5[_0xb5df('0x2e')],_0xb5df('0x35'),function(_0x376287){logger[_0xb5df('0x26')](_0x54d3d5[_0xb5df('0x23')],_0xb5df('0x36'),_0x376287[_0xb5df('0x37')]);attachment[_0xb5df('0x38')]({'name':path[_0xb5df('0x39')](_0x54d3d5[_0xb5df('0x2e')])[_0xb5df('0x25')],'basename':path[_0xb5df('0x39')](_0x54d3d5[_0xb5df('0x2e')])['name']+'.pdf','type':_0xb5df('0x3a')})[_0xb5df('0x3b')](function(_0x58a89e){faxAccount[_0xb5df('0x3c')](_0x327329,{'from':_0x54d3d5['calleridnum'],'mapKey':_0xb5df('0x6'),'body':path[_0xb5df('0x39')](_0x54d3d5[_0xb5df('0x2e')])['name']+_0xb5df('0x3d'),'AttachmentId':_0x58a89e['id']})[_0xb5df('0x3e')](function(_0x316a8b){logger[_0xb5df('0x3f')](_0x54d3d5[_0xb5df('0x23')],_0xb5df('0x40'),JSON[_0xb5df('0x41')](_0x316a8b));});})[_0xb5df('0x3e')](function(_0x1de319){logger[_0xb5df('0x3f')](_0x54d3d5[_0xb5df('0x23')],'\x20receiveFax\x20',JSON['stringify'](_0x1de319));});});}logger[_0xb5df('0x26')](_0x54d3d5[_0xb5df('0x23')],_0xb5df('0x42'));}};Fax[_0xb5df('0x1c')]['syncOriginateResponse']=function(_0x5ff37a){if(this[_0xb5df('0xf')][_0x5ff37a[_0xb5df('0x23')]]){_[_0xb5df('0x43')](this[_0xb5df('0xd')][_0x5ff37a[_0xb5df('0x23')]],_[_0xb5df('0x44')](_0x5ff37a,[_0xb5df('0x45'),'reason']));}};function updateStatus(_0xc4c183){if(_0xc4c183[_0xb5df('0x46')]){faxMessage[_0xb5df('0x47')](_0xc4c183['AttachmentId'],{'failMessage':_0xb5df('0x48')})[_0xb5df('0x3b')](function(_0x459950){ut[_0xb5df('0x49')](_0xb5df('0x4a'),_0x459950);})['catch'](function(_0x1a64aa){ut[_0xb5df('0x49')](_0xb5df('0x4b'),_0x1a64aa);});}else{ut[_0xb5df('0x49')](_0xb5df('0x4c'));}}Fax[_0xb5df('0x1c')][_0xb5df('0x4d')]=function(_0x599eb3,_0x1c5c9b,_0x143233){var _0xc8fa46=this;var _0x597d0a={};if(_0x1c5c9b){_0x597d0a={'read':_0x1c5c9b};}else{_0x597d0a={'failMessage':_0x143233};}if(this[_0xb5df('0xf')][_0x599eb3][_0xb5df('0x46')]){faxMessage[_0xb5df('0x47')](this[_0xb5df('0xf')][_0x599eb3][_0xb5df('0x46')],_0x597d0a)[_0xb5df('0x3b')](function(_0x4392af){ut[_0xb5df('0x49')](_0xb5df('0x4e'),_0x4392af);})['catch'](function(_0x314916){ut[_0xb5df('0x49')](_0xb5df('0x4f'),_0x314916);})[_0xb5df('0x50')](function(){delete _0xc8fa46[_0xb5df('0xd')][_0x599eb3];delete _0xc8fa46[_0xb5df('0xf')][_0x599eb3];});}else{ut[_0xb5df('0x49')](_0xb5df('0x51'));delete this[_0xb5df('0xd')][_0x599eb3];delete this[_0xb5df('0xf')][_0x599eb3];}};Fax['prototype'][_0xb5df('0x52')]=function(_0x2a01e1){var _0x5e0174=this;if(this[_0xb5df('0xd')][_0x2a01e1[_0xb5df('0x23')]]){if(this[_0xb5df('0xf')][_0x2a01e1[_0xb5df('0x23')]]){this['channels'][_0x2a01e1[_0xb5df('0x23')]]['id']=this[_0xb5df('0xf')][_0x2a01e1['uniqueid']]['id'];this[_0xb5df('0xd')][_0x2a01e1[_0xb5df('0x23')]][_0xb5df('0x25')]=this[_0xb5df('0xf')][_0x2a01e1[_0xb5df('0x23')]][_0xb5df('0x25')];}logger[_0xb5df('0x26')](_0x2a01e1[_0xb5df('0x23')],this[_0xb5df('0xf')][_0x2a01e1[_0xb5df('0x23')]]?_0xb5df('0x53'):_0xb5df('0x54'),JSON[_0xb5df('0x41')](this[_0xb5df('0xd')][_0x2a01e1['uniqueid']]));if(this['actions'][_0x2a01e1[_0xb5df('0x23')]]){if(this['channels'][_0x2a01e1[_0xb5df('0x23')]][_0xb5df('0x55')]>0x0&&this[_0xb5df('0xd')][_0x2a01e1[_0xb5df('0x23')]][_0xb5df('0x56')]===_0xb5df('0x57')){this[_0xb5df('0x4d')](_0x2a01e1['uniqueid'],!![]);}else{this[_0xb5df('0x4d')](_0x2a01e1[_0xb5df('0x23')],![],this['channels'][_0x2a01e1['uniqueid']]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0xb5df('0xd')][_0x2a01e1[_0xb5df('0x23')]][_0xb5df('0x58')]:_0xb5df('0x59'));}}}};Fax[_0xb5df('0x1c')]['send']=function(_0x5d17ec){var _0x4c7aa4=this;return new BPromise(function(_0x47e37a,_0x2debd1){_0x4c7aa4[_0xb5df('0x5a')](_0x5d17ec,_0x4c7aa4[_0xb5df('0x1f')][_0x5d17ec[_0xb5df('0x5b')]])[_0xb5df('0x3b')](function(_0x45c374){ut[_0xb5df('0x49')](_0xb5df('0x5c'),_0x45c374);_0x47e37a(ut[_0xb5df('0x37')](_0xb5df('0x5d')));})['catch'](function(_0x1895d1){ut[_0xb5df('0x49')](_0xb5df('0x5e'),_0x1895d1);updateStatus(_0x5d17ec);_0x2debd1(ut[_0xb5df('0x37')](_0xb5df('0x5f')));});});};Fax['prototype'][_0xb5df('0x60')]=function(_0xe28cff){var _0x1598a7=this;return new BPromise(function(_0x445d0d,_0x826f17){var _0x1d85bd=_0x1598a7['checkTrunk'](_0x1598a7['faxAccounts'][_0xe28cff[_0xb5df('0x5b')]][_0xb5df('0x61')],_0xe28cff);if(_0x1d85bd[_0xb5df('0x62')]){_0x445d0d(ut[_0xb5df('0x37')](_0xb5df('0x63')));}else{_0x826f17(ut[_0xb5df('0x37')](_0x1d85bd[_0xb5df('0x37')]));}});};function originate(_0x2734d3,_0x38baf6,_0x21217a){return new BPromise(function(_0x57a794,_0x5204cc){if(_0x21217a){var _0x3fbe58=util['format'](_0xb5df('0x64'),path[_0xb5df('0x39')](_0x2734d3[_0xb5df('0x3')])[_0xb5df('0x25')],_0x2734d3[_0xb5df('0x3')]);gs[_0xb5df('0x65')](_0x3fbe58)[_0xb5df('0x3b')](function(){_0x2734d3[_0xb5df('0x3')]=util['format']('%s/%s.tif',path[_0xb5df('0x39')](_0x2734d3[_0xb5df('0x3')])[_0xb5df('0x66')],path['parse'](_0x2734d3['path'])[_0xb5df('0x25')]);_0x38baf6['XMF-PATH']=_0x2734d3[_0xb5df('0x3')];ut[_0xb5df('0x49')](_0xb5df('0x67'),'');ami['Action'](ut[_0xb5df('0x68')](_0x2734d3,_0x38baf6))[_0xb5df('0x3b')](function(_0x2bcb38){_0x57a794(_0x2bcb38);})[_0xb5df('0x3e')](function(_0x5cd9a5){_0x5204cc(_0x5cd9a5);});})[_0xb5df('0x3e')](function(_0x3e630c){_0x5204cc(_0x3e630c);});}else{ami[_0xb5df('0x69')](ut['variablesAction'](_0x2734d3,_0x38baf6))[_0xb5df('0x3b')](function(_0x103d5e){_0x57a794(_0x103d5e);})['catch'](function(_0x4e8276){_0x5204cc(_0x4e8276);});}});}Fax['prototype'][_0xb5df('0x5a')]=function(_0x439d2e,_0x4d6b08){var _0x168cb5=this;return new BPromise(function(_0x1abc91,_0x57c3f2){var _0x3c2215=uuid['v4']();var _0x13fc31=ut[_0xb5df('0x6a')](_0x439d2e,_0x4d6b08);_0x168cb5['actions'][_0x3c2215]=new Action(_0x3c2215,_0x4d6b08,_0x439d2e);var _0x1ab2a1=_0x168cb5['actions'][_0x3c2215];if(path[_0xb5df('0x39')](_0x439d2e['path'])['ext']===_0xb5df('0x3d')){originate(_0x1ab2a1,_0x13fc31,!![])[_0xb5df('0x3b')](function(_0x4eaf56){_0x1abc91(_0x4eaf56);})[_0xb5df('0x3e')](function(_0x3605d0){_0x57c3f2(_0x3605d0);});}else{originate(_0x1ab2a1,_0x13fc31,![])[_0xb5df('0x3b')](function(_0x1d7e50){_0x1abc91(_0x1d7e50);})[_0xb5df('0x3e')](function(_0x4e2889){_0x57c3f2(_0x4e2889);});}});};Fax['prototype'][_0xb5df('0x6b')]=function(_0xd3e9ec){return!_['isNil'](_0xd3e9ec)&&!_[_0xb5df('0x6c')](_0xd3e9ec[_0xb5df('0x25')])&&!_[_0xb5df('0x6c')](_0xd3e9ec[_0xb5df('0x6d')])&&_0xd3e9ec[_0xb5df('0x6d')]&&!_['isNil'](this['trunks'][util[_0xb5df('0x6e')](_0xb5df('0x6f'),_0xd3e9ec['name'])])&&!_[_0xb5df('0x6c')](this[_0xb5df('0xe')][util[_0xb5df('0x6e')](_0xb5df('0x6f'),_0xd3e9ec['name'])]['status'])&&(this[_0xb5df('0xe')][util['format'](_0xb5df('0x6f'),_0xd3e9ec[_0xb5df('0x25')])][_0xb5df('0x2d')]==='reachable'||this['trunks'][util['format'](_0xb5df('0x6f'),_0xd3e9ec['name'])]['status']==='unmonitored');};Fax[_0xb5df('0x1c')][_0xb5df('0x70')]=function(_0x1999ef,_0xa1ef20){if(!this[_0xb5df('0x6b')](_0x1999ef)){ut[_0xb5df('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xb5df('0x6c')](_0x1999ef)?'':_0x1999ef[_0xb5df('0x25')]+_0xb5df('0x71'));return{'isValid':![],'message':_0xb5df('0x72')};}if(_[_0xb5df('0x6c')](_0xa1ef20[_0xb5df('0x6')])){ut[_0xb5df('0x49')](_0xb5df('0x73'),JSON[_0xb5df('0x41')](_0xa1ef20));return{'isValid':![],'message':_0xb5df('0x74')};}if(_[_0xb5df('0x6c')](_0xa1ef20[_0xb5df('0x3')])){ut[_0xb5df('0x49')](_0xb5df('0x75'),JSON[_0xb5df('0x41')](_0xa1ef20));return{'isValid':![],'message':_0xb5df('0x76')};}return{'isValid':!![],'message':_0xb5df('0x77')};};module[_0xb5df('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 49f46f6..e82c694 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 _0x12e5=['then','catch','[Notify]\x20','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x12e5,0x92));var _0x512e=function(_0x4e4c7d,_0x34bfff){_0x4e4c7d=_0x4e4c7d-0x0;var _0x2f3a7c=_0x12e5[_0x4e4c7d];return _0x2f3a7c;};'use strict';var util=require('util');var BPromise=require(_0x512e('0x0'));var logger=require('../../../config/logger')(_0x512e('0x1'));var _=require(_0x512e('0x2'));var faxAccount=require(_0x512e('0x3'));function loggerCatch(_0x4efcfa){return function(_0x4cf551){logger[_0x512e('0x4')](_0x4efcfa,util[_0x512e('0x5')](_0x4cf551,{'showHidden':![],'depth':null}));};}exports[_0x512e('0x6')]=function(_0x266838,_0x511701){return BPromise[_0x512e('0x7')]()[_0x512e('0x8')](faxAccount['notify'](_0x266838,_0x511701))[_0x512e('0x9')](loggerCatch(_0x512e('0xa')));}; \ No newline at end of file +var _0x0369=['util','bluebird','../../../config/logger','preview','error','inspect','notify','resolve','then','catch','[Notify]\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0369,0x113));var _0x9036=function(_0x32b9bb,_0x345a9b){_0x32b9bb=_0x32b9bb-0x0;var _0x4c9e24=_0x0369[_0x32b9bb];return _0x4c9e24;};'use strict';var util=require(_0x9036('0x0'));var BPromise=require(_0x9036('0x1'));var logger=require(_0x9036('0x2'))(_0x9036('0x3'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x42dea2){return function(_0x460fe6){logger[_0x9036('0x4')](_0x42dea2,util[_0x9036('0x5')](_0x460fe6,{'showHidden':![],'depth':null}));};}exports[_0x9036('0x6')]=function(_0x3e0417,_0x41210a){return BPromise[_0x9036('0x7')]()[_0x9036('0x8')](faxAccount[_0x9036('0x6')](_0x3e0417,_0x41210a))[_0x9036('0x9')](loggerCatch(_0x9036('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 ab0e6ff..2448f9f 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 _0x85a9=['execute','info','Exec\x20gs','\x20Error\x20:','util','fax','bluebird','exec'];(function(_0x4e23c0,_0x108adb){var _0x2731d8=function(_0x307fcf){while(--_0x307fcf){_0x4e23c0['push'](_0x4e23c0['shift']());}};_0x2731d8(++_0x108adb);}(_0x85a9,0xec));var _0x985a=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0x85a9[_0x118afa];return _0x167d76;};'use strict';var util=require(_0x985a('0x0'));var logger=require('../../../../config/logger')(_0x985a('0x1'));var BPromise=require(_0x985a('0x2'));var exec=require('child_process')[_0x985a('0x3')];exports[_0x985a('0x4')]=function(_0x9da326){return new BPromise(function(_0x345b3a,_0x296109){exec(_0x9da326,function(_0x1836f1,_0x4af267,_0x33d7f7){logger[_0x985a('0x5')](_0x985a('0x6'),_0x4af267);if(_0x1836f1){logger[_0x985a('0x5')](_0x985a('0x6'),_0x985a('0x7'),util['inspect'](_0x1836f1,{'showHidden':![],'depth':null}),_0x4af267,_0x33d7f7);_0x296109(_0x1836f1);}_0x345b3a(_0x4af267);});});}; \ No newline at end of file +var _0x5b1f=['../../../../config/logger','fax','child_process','exec','execute','Exec\x20gs','info','inspect','util'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5b1f,0xe9));var _0xf5b1=function(_0x1884e1,_0x147133){_0x1884e1=_0x1884e1-0x0;var _0x24d340=_0x5b1f[_0x1884e1];return _0x24d340;};'use strict';var util=require(_0xf5b1('0x0'));var logger=require(_0xf5b1('0x1'))(_0xf5b1('0x2'));var BPromise=require('bluebird');var exec=require(_0xf5b1('0x3'))[_0xf5b1('0x4')];exports[_0xf5b1('0x5')]=function(_0x153225){return new BPromise(function(_0x28071c,_0x9a2f4d){exec(_0x153225,function(_0x4ecb2e,_0x1fc29a,_0x54a875){logger['info'](_0xf5b1('0x6'),_0x1fc29a);if(_0x4ecb2e){logger[_0xf5b1('0x7')]('Exec\x20gs','\x20Error\x20:',util[_0xf5b1('0x8')](_0x4ecb2e,{'showHidden':![],'depth':null}),_0x1fc29a,_0x54a875);_0x9a2f4d(_0x4ecb2e);}_0x28071c(_0x1fc29a);});});}; \ 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 12079f4..a263b1b 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 _0x0004=['moment','../../../../config/logger','fax','message','logger','ecm','maxrate','\x22%s\x22','gateway','t38timeout','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','headerinfo','localstationid','util','lodash'];(function(_0x15fdb5,_0x377c9){var _0xc01291=function(_0x5f4bb7){while(--_0x5f4bb7){_0x15fdb5['push'](_0x15fdb5['shift']());}};_0xc01291(++_0x377c9);}(_0x0004,0x166));var _0x4000=function(_0x5ab340,_0x3bf3e4){_0x5ab340=_0x5ab340-0x0;var _0x2ed5b7=_0x0004[_0x5ab340];return _0x2ed5b7;};'use strict';var util=require(_0x4000('0x0'));var _=require(_0x4000('0x1'));var moment=require(_0x4000('0x2'));var logger=require(_0x4000('0x3'))(_0x4000('0x4'));exports[_0x4000('0x5')]=function(_0x1bc45b){return{'message':_0x1bc45b};};exports[_0x4000('0x6')]=function(_0x2db122,_0x5413ab){logger['info'](_0x2db122,util['inspect'](_0x5413ab,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3cb4a1,_0x4c887f){var _0x4c58ae={'XMF-ECM':_0x4c887f[_0x4000('0x7')],'XMF-HEADERINFO':_0x4c887f['headerinfo'],'XMF-MINRATE':_0x4c887f['minrate'],'XMF-MAXRATE':_0x4c887f[_0x4000('0x8')],'XMF-MODEM':util['format'](_0x4000('0x9'),_0x4c887f['modem']),'XMF-GATEWAY':_0x4c887f[_0x4000('0xa')],'XMF-FAXDETECT':_0x4c887f['faxdetect'],'XMF-T38TIMEOUT':_0x4c887f[_0x4000('0xb')],'XMF-LOCALSTATIONID':_0x4c887f['localstationid'],'XMF-PATH':_0x3cb4a1[_0x4000('0xc')]};return _0x4c58ae;};exports['variablesAction']=function(_0x1f58c8,_0x3a5988){return{'actionid':_0x1f58c8[_0x4000('0xd')],'action':_0x4000('0xe'),'channel':_0x1f58c8[_0x4000('0xf')],'Exten':_0x4000('0x10'),'Context':_0x4000('0x11'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x1f58c8[_0x4000('0x12')]?_0x1f58c8[_0x4000('0x12')]:'',_0x1f58c8[_0x4000('0x13')]),'variable':_0x3a5988,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1f58c8['uniqueid']};}; \ No newline at end of file +var _0x174b=['t38timeout','localstationid','path','variablesAction','uniqueid','xcally-motion-fax','from-sip','util','lodash','moment','../../../../config/logger','fax','message','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect'];(function(_0x44b446,_0x388b3d){var _0x1822d9=function(_0x3d19fc){while(--_0x3d19fc){_0x44b446['push'](_0x44b446['shift']());}};_0x1822d9(++_0x388b3d);}(_0x174b,0x149));var _0xb174=function(_0x576634,_0x5cc837){_0x576634=_0x576634-0x0;var _0x3b4b91=_0x174b[_0x576634];return _0x3b4b91;};'use strict';var util=require(_0xb174('0x0'));var _=require(_0xb174('0x1'));var moment=require(_0xb174('0x2'));var logger=require(_0xb174('0x3'))(_0xb174('0x4'));exports[_0xb174('0x5')]=function(_0x4e343d){return{'message':_0x4e343d};};exports['logger']=function(_0x5a43f2,_0x41ecb5){logger['info'](_0x5a43f2,util[_0xb174('0x6')](_0x41ecb5,{'showHidden':![],'depth':null}));};exports[_0xb174('0x7')]=function(_0x1584c7,_0x1709b8){var _0x37272b={'XMF-ECM':_0x1709b8['ecm'],'XMF-HEADERINFO':_0x1709b8[_0xb174('0x8')],'XMF-MINRATE':_0x1709b8[_0xb174('0x9')],'XMF-MAXRATE':_0x1709b8[_0xb174('0xa')],'XMF-MODEM':util[_0xb174('0xb')](_0xb174('0xc'),_0x1709b8[_0xb174('0xd')]),'XMF-GATEWAY':_0x1709b8[_0xb174('0xe')],'XMF-FAXDETECT':_0x1709b8[_0xb174('0xf')],'XMF-T38TIMEOUT':_0x1709b8[_0xb174('0x10')],'XMF-LOCALSTATIONID':_0x1709b8[_0xb174('0x11')],'XMF-PATH':_0x1584c7[_0xb174('0x12')]};return _0x37272b;};exports[_0xb174('0x13')]=function(_0x5ca191,_0x322ea4){return{'actionid':_0x5ca191[_0xb174('0x14')],'action':'originate','channel':_0x5ca191['channel'],'Exten':_0xb174('0x15'),'Context':_0xb174('0x16'),'Priority':'1','callerid':util[_0xb174('0xb')]('\x22%s\x22\x20<%s>',_0x5ca191['headerinfo']?_0x5ca191[_0xb174('0x8')]:'',_0x5ca191['localstationid']),'variable':_0x322ea4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5ca191['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 90560c4..4abb58f 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 _0x6fe3=['initVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','log','sync','catch','bluebird','util','moment','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6fe3,0x8f));var _0x36fe=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0x6fe3[_0x289e64];return _0x30246c;};'use strict';var BPromise=require(_0x36fe('0x0'));var util=require(_0x36fe('0x1'));var moment=require(_0x36fe('0x2'));var server=require('./server');var Realtime=require(_0x36fe('0x3'));var Report=require(_0x36fe('0x4'));var Acw=require('./acw');var Trigger=require(_0x36fe('0x5'));var Dialer=require(_0x36fe('0x6'));var Preview=require(_0x36fe('0x7'));var Fax=require(_0x36fe('0x8'));var user=require(_0x36fe('0x9'));var voiceQueue=require(_0x36fe('0xa'));var voiceQueueReport=require(_0x36fe('0xb'));var voiceCallReport=require(_0x36fe('0xc'));var trunk=require('./rpc/trunk');var trigger=require(_0x36fe('0xd'));var template=require(_0x36fe('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x36fe('0xf'));var voiceExtension=require(_0x36fe('0x10'));var faxAccount=require(_0x36fe('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x36fe('0x12'));var freshdesk=require(_0x36fe('0x13'));var desk=require(_0x36fe('0x14'));var zoho=require(_0x36fe('0x15'));var vtiger=require(_0x36fe('0x16'));var servicenow=require(_0x36fe('0x17'));var dynamics365=require(_0x36fe('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x36fe('0x19')](_0x36fe('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x36fe('0x19')](_0x36fe('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x36fe('0x1b')]()[_0x36fe('0x1c')](user[_0x36fe('0x1d')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x1e')]())[_0x36fe('0x1c')](user['getTelephones']())[_0x36fe('0x1c')](realtime[_0x36fe('0x1f')]())['then'](trunk[_0x36fe('0x20')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x21')]())[_0x36fe('0x1c')](voiceQueue['getVoiceQueues']())[_0x36fe('0x1c')](realtime['initVoiceQueues']())[_0x36fe('0x1c')](trigger[_0x36fe('0x22')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x23')]())['then'](template[_0x36fe('0x24')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x25')]())[_0x36fe('0x1c')](zendesk[_0x36fe('0x26')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x27')]())[_0x36fe('0x1c')](salesforce['getSalesforceAccounts']())[_0x36fe('0x1c')](realtime['initSalesforceAccounts']())[_0x36fe('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0x36fe('0x1c')](realtime[_0x36fe('0x28')]())['then'](freshdesk[_0x36fe('0x29')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x2a')]())[_0x36fe('0x1c')](desk[_0x36fe('0x2b')]())[_0x36fe('0x1c')](realtime['initDeskAccounts']())[_0x36fe('0x1c')](zoho[_0x36fe('0x2c')]())['then'](realtime['initZohoAccounts']())[_0x36fe('0x1c')](vtiger[_0x36fe('0x2d')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x2e')]())['then'](servicenow[_0x36fe('0x2f')]())[_0x36fe('0x1c')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x36fe('0x30')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x31')]())['then'](campaign['getCampaigns']())['then'](realtime[_0x36fe('0x32')]())['then'](voiceExtension[_0x36fe('0x33')]())[_0x36fe('0x1c')](realtime['initVoiceExtensions']())[_0x36fe('0x1c')](faxAccount[_0x36fe('0x34')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x35')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x36fe('0x1b')]()[_0x36fe('0x1c')](voiceQueueReport[_0x36fe('0x36')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x37')]())['then'](cmHopperHistory[_0x36fe('0x38')]())[_0x36fe('0x1c')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x36fe('0x39')]())[_0x36fe('0x1c')](realtime[_0x36fe('0x3a')]())[_0x36fe('0x1c')](voiceCallReport[_0x36fe('0x3b')]())[_0x36fe('0x1c')](realtime['initVoiceCallReports']())[_0x36fe('0x1c')](function(_0x590670){})['catch'](function(_0x58e924){console[_0x36fe('0x3c')](_0x58e924);});}function main(){return server['listen'](realtime,preview,fax)[_0x36fe('0x1c')](function(_0x269063){return initRealtime();})[_0x36fe('0x1c')](function(){return initParams();})[_0x36fe('0x1c')](function(){report[_0x36fe('0x3d')]();setInterval(initRealtime,0x1388);})[_0x36fe('0x3e')](function(_0x27cadf){console[_0x36fe('0x3c')](_0x27cadf);});}main(); \ No newline at end of file +var _0x008e=['./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/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','initAgents','getTelephones','getTrunks','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/trunk'];(function(_0x399697,_0x402d13){var _0x5b616c=function(_0x5cbbd7){while(--_0x5cbbd7){_0x399697['push'](_0x399697['shift']());}};_0x5b616c(++_0x402d13);}(_0x008e,0x1a7));var _0xe008=function(_0x3e2217,_0x394595){_0x3e2217=_0x3e2217-0x0;var _0x3a2dfc=_0x008e[_0x3e2217];return _0x3a2dfc;};'use strict';var BPromise=require(_0xe008('0x0'));var util=require(_0xe008('0x1'));var moment=require(_0xe008('0x2'));var server=require('./server');var Realtime=require(_0xe008('0x3'));var Report=require(_0xe008('0x4'));var Acw=require(_0xe008('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xe008('0x6'));var Preview=require(_0xe008('0x7'));var Fax=require(_0xe008('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xe008('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xe008('0xa'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xe008('0xb'));var voiceExtension=require(_0xe008('0xc'));var faxAccount=require(_0xe008('0xd'));var zendesk=require(_0xe008('0xe'));var salesforce=require(_0xe008('0xf'));var sugarcrm=require(_0xe008('0x10'));var freshdesk=require(_0xe008('0x11'));var desk=require(_0xe008('0x12'));var zoho=require(_0xe008('0x13'));var vtiger=require('./rpc/integrations/vtiger');var servicenow=require(_0xe008('0x14'));var dynamics365=require(_0xe008('0x15'));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()[_0xe008('0x16')](_0xe008('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe008('0x16')](_0xe008('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xe008('0x18')]()[_0xe008('0x19')](user['getAgents']())[_0xe008('0x19')](realtime[_0xe008('0x1a')]())[_0xe008('0x19')](user[_0xe008('0x1b')]())[_0xe008('0x19')](realtime['initTelephones']())['then'](trunk[_0xe008('0x1c')]())[_0xe008('0x19')](realtime['initTrunks']())[_0xe008('0x19')](voiceQueue['getVoiceQueues']())['then'](realtime['initVoiceQueues']())[_0xe008('0x19')](trigger[_0xe008('0x1d')]())[_0xe008('0x19')](realtime[_0xe008('0x1e')]())['then'](template[_0xe008('0x1f')]())['then'](realtime[_0xe008('0x20')]())[_0xe008('0x19')](zendesk[_0xe008('0x21')]())[_0xe008('0x19')](realtime[_0xe008('0x22')]())[_0xe008('0x19')](salesforce[_0xe008('0x23')]())[_0xe008('0x19')](realtime[_0xe008('0x24')]())[_0xe008('0x19')](sugarcrm[_0xe008('0x25')]())[_0xe008('0x19')](realtime[_0xe008('0x26')]())[_0xe008('0x19')](freshdesk[_0xe008('0x27')]())[_0xe008('0x19')](realtime[_0xe008('0x28')]())[_0xe008('0x19')](desk[_0xe008('0x29')]())[_0xe008('0x19')](realtime[_0xe008('0x2a')]())['then'](zoho[_0xe008('0x2b')]())[_0xe008('0x19')](realtime[_0xe008('0x2c')]())[_0xe008('0x19')](vtiger[_0xe008('0x2d')]())[_0xe008('0x19')](realtime['initVtigerAccounts']())['then'](servicenow['getServicenowAccounts']())[_0xe008('0x19')](realtime[_0xe008('0x2e')]())[_0xe008('0x19')](dynamics365[_0xe008('0x2f')]())['then'](realtime[_0xe008('0x30')]())[_0xe008('0x19')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0xe008('0x19')](voiceExtension['getVoiceExtensions']())[_0xe008('0x19')](realtime[_0xe008('0x31')]())[_0xe008('0x19')](faxAccount[_0xe008('0x32')]())[_0xe008('0x19')](realtime[_0xe008('0x33')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xe008('0x18')]()[_0xe008('0x19')](voiceQueueReport[_0xe008('0x34')]())[_0xe008('0x19')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xe008('0x35')]())[_0xe008('0x19')](realtime[_0xe008('0x36')]())[_0xe008('0x19')](cmHopperHistory[_0xe008('0x37')]())[_0xe008('0x19')](realtime[_0xe008('0x38')]())[_0xe008('0x19')](voiceCallReport[_0xe008('0x39')]())[_0xe008('0x19')](realtime['initVoiceCallReports']())[_0xe008('0x19')](function(_0x221d83){})[_0xe008('0x3a')](function(_0x54baf1){console[_0xe008('0x3b')](_0x54baf1);});}function main(){return server[_0xe008('0x3c')](realtime,preview,fax)[_0xe008('0x19')](function(_0x42beff){return initRealtime();})[_0xe008('0x19')](function(){return initParams();})[_0xe008('0x19')](function(){report[_0xe008('0x3d')]();setInterval(initRealtime,0x1388);})[_0xe008('0x3a')](function(_0x1e89c8){console['log'](_0x1e89c8);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 7a26778..a3a5c6a 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 _0xe49d=['toLowerCase','not_inuse','idle','inuse','talking','voiceStatus','statePause','voiceStatusTime','toNumber','format','interface','user:%s','emit','user:save','exports','util','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','online','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype'];(function(_0x38a368,_0xcda100){var _0x98eb45=function(_0x4315f8){while(--_0x4315f8){_0x38a368['push'](_0x38a368['shift']());}};_0x98eb45(++_0xcda100);}(_0xe49d,0xd2));var _0xde49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe49d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xde49('0x0'));var moment=require('moment');var md5=require(_0xde49('0x1'));var Redis=require(_0xde49('0x2'));var config=require(_0xde49('0x3'));config[_0xde49('0x4')]=_[_0xde49('0x5')](config[_0xde49('0x4')],{'host':_0xde49('0x6'),'port':0x18eb});var io=require(_0xde49('0x7'))(new Redis(config[_0xde49('0x4')]));function Agent(_0x56e0ed){this['id']=_0x56e0ed['id']||0x0;this[_0xde49('0x8')]=_0x56e0ed[_0xde49('0x8')]||'';this[_0xde49('0x9')]=_0x56e0ed[_0xde49('0x9')]||'';this[_0xde49('0xa')]=_0x56e0ed['accountcode']||'';this[_0xde49('0xb')]=_0x56e0ed[_0xde49('0xb')]||'';this[_0xde49('0xc')]=_0xde49('0xd');this[_0xde49('0xe')]=0x0;this[_0xde49('0xf')]=_0xde49('0xd');this[_0xde49('0x10')]='';this[_0xde49('0x11')]='';this[_0xde49('0x12')]='';this['interface']='';this[_0xde49('0x13')]=_0x56e0ed[_0xde49('0x13')]||![];this['voiceStatus']=_0xde49('0xd');this['voiceStatusTime']=0x0;this[_0xde49('0x14')]='';this[_0xde49('0x15')]='';this[_0xde49('0x16')]=![];this['local']=![];this[_0xde49('0x1')]='';}Agent[_0xde49('0x17')]['updateStatusRealtime']=function(_0xf796a0){var _0x2c64a6;if(_0xf796a0&&_0xf796a0[_0xde49('0xc')]){_0x2c64a6=_0xf796a0[_0xde49('0xc')][_0xde49('0x18')]();switch(_0x2c64a6){case _0xde49('0x19'):_0x2c64a6=_0xde49('0x1a');break;case _0xde49('0x1b'):_0x2c64a6=_0xde49('0x1c');break;}}if(_0x2c64a6&&this[_0xde49('0x1d')]!==_0x2c64a6||_0xf796a0[_0xde49('0x1e')]){this[_0xde49('0x1f')]=_[_0xde49('0x20')](moment()[_0xde49('0x21')]('x'));}if(_0x2c64a6){this[_0xde49('0x1d')]=_0x2c64a6;}var _0x54f30c={'id':this['id'],'name':this[_0xde49('0x8')],'email':this[_0xde49('0x9')],'accountcode':this['accountcode'],'fullname':this[_0xde49('0xb')],'state':this[_0xde49('0xc')],'stateTime':this[_0xde49('0xe')],'status':this['status'],'address':this['address'],'online':this[_0xde49('0x13')],'voiceStatus':this[_0xde49('0x1d')],'voiceStatusTime':this[_0xde49('0x1f')],'voiceStatusCallerIdNumber':this[_0xde49('0x14')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xde49('0x22')],'onhold':this[_0xde49('0x16')]};var _0x482e34=md5(JSON['stringify'](_0x54f30c));if(this[_0xde49('0x1')]!==_0x482e34){this[_0xde49('0x1')]=_0x482e34;io['to'](util[_0xde49('0x21')](_0xde49('0x23'),_0x54f30c[_0xde49('0x8')]))[_0xde49('0x24')](_0xde49('0x25'),_0x54f30c);}};module[_0xde49('0x26')]=Agent; \ No newline at end of file +var _0x94cb=['voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','interface','user:%s','emit','exports','lodash','util','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94cb,0xab));var _0xb94c=function(_0x5e5d33,_0x3f76f5){_0x5e5d33=_0x5e5d33-0x0;var _0x8d2331=_0x94cb[_0x5e5d33];return _0x8d2331;};'use strict';var _=require(_0xb94c('0x0'));var util=require(_0xb94c('0x1'));var moment=require('moment');var md5=require(_0xb94c('0x2'));var Redis=require(_0xb94c('0x3'));var config=require('../../../config/environment');config[_0xb94c('0x4')]=_[_0xb94c('0x5')](config['redis'],{'host':_0xb94c('0x6'),'port':0x18eb});var io=require(_0xb94c('0x7'))(new Redis(config[_0xb94c('0x4')]));function Agent(_0x403cd0){this['id']=_0x403cd0['id']||0x0;this[_0xb94c('0x8')]=_0x403cd0[_0xb94c('0x8')]||'';this['email']=_0x403cd0[_0xb94c('0x9')]||'';this[_0xb94c('0xa')]=_0x403cd0[_0xb94c('0xa')]||'';this[_0xb94c('0xb')]=_0x403cd0[_0xb94c('0xb')]||'';this[_0xb94c('0xc')]=_0xb94c('0xd');this[_0xb94c('0xe')]=0x0;this[_0xb94c('0xf')]='unknown';this[_0xb94c('0x10')]='';this['phone']='';this[_0xb94c('0x11')]='';this['interface']='';this['online']=_0x403cd0[_0xb94c('0x12')]||![];this[_0xb94c('0x13')]=_0xb94c('0xd');this[_0xb94c('0x14')]=0x0;this[_0xb94c('0x15')]='';this[_0xb94c('0x16')]='';this[_0xb94c('0x17')]=![];this[_0xb94c('0x18')]=![];this['md5']='';}Agent[_0xb94c('0x19')][_0xb94c('0x1a')]=function(_0x59e3a8){var _0x43ee88;if(_0x59e3a8&&_0x59e3a8[_0xb94c('0xc')]){_0x43ee88=_0x59e3a8[_0xb94c('0xc')][_0xb94c('0x1b')]();switch(_0x43ee88){case _0xb94c('0x1c'):_0x43ee88=_0xb94c('0x1d');break;case _0xb94c('0x1e'):_0x43ee88=_0xb94c('0x1f');break;}}if(_0x43ee88&&this[_0xb94c('0x13')]!==_0x43ee88||_0x59e3a8[_0xb94c('0x20')]){this[_0xb94c('0x14')]=_['toNumber'](moment()[_0xb94c('0x21')]('x'));}if(_0x43ee88){this[_0xb94c('0x13')]=_0x43ee88;}var _0x419e41={'id':this['id'],'name':this[_0xb94c('0x8')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0xb94c('0xb')],'state':this[_0xb94c('0xc')],'stateTime':this[_0xb94c('0xe')],'status':this[_0xb94c('0xf')],'address':this[_0xb94c('0x10')],'online':this['online'],'voiceStatus':this[_0xb94c('0x13')],'voiceStatusTime':this[_0xb94c('0x14')],'voiceStatusCallerIdNumber':this[_0xb94c('0x15')],'voiceStatusQueue':this[_0xb94c('0x16')],'interface':this[_0xb94c('0x22')],'onhold':this[_0xb94c('0x17')]};var _0x4eaff6=md5(JSON['stringify'](_0x419e41));if(this['md5']!==_0x4eaff6){this[_0xb94c('0x2')]=_0x4eaff6;io['to'](util['format'](_0xb94c('0x23'),_0x419e41[_0xb94c('0x8')]))[_0xb94c('0x24')]('user:save',_0x419e41);}};module[_0xb94c('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 62b56c8..6801342 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 _0xe205=['Interval','SquareProject','dialQueueProject','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk'];(function(_0x108b03,_0x3c487d){var _0xd65f5c=function(_0x18f54f){while(--_0x18f54f){_0x108b03['push'](_0x108b03['shift']());}};_0xd65f5c(++_0x3c487d);}(_0xe205,0xa7));var _0x5e20=function(_0x4d6d5d,_0x2d00c8){_0x4d6d5d=_0x4d6d5d-0x0;var _0x5ee7c0=_0xe205[_0x4d6d5d];return _0x5ee7c0;};'use strict';function Campaign(_0x289a5c){this['id']=_0x289a5c['id']||0x0;this[_0x5e20('0x0')]=_0x289a5c[_0x5e20('0x0')]||'';this[_0x5e20('0x1')]=_0x289a5c[_0x5e20('0x1')]||_0x5e20('0x2');this[_0x5e20('0x3')]=0x0;this[_0x5e20('0x4')]=0x0;this[_0x5e20('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x5e20('0x6')]='';this[_0x5e20('0x7')]=!![];this[_0x5e20('0x8')]=_0x289a5c[_0x5e20('0x8')];this['limitCalls']=_0x289a5c['limitCalls'];this[_0x5e20('0x9')]=_0x289a5c['dialTimezone']||null;this['dialGlobalInterval']=_0x289a5c[_0x5e20('0xa')]?_0x289a5c[_0x5e20('0xa')]:null;this['dialOriginateCallerIdName']=_0x289a5c[_0x5e20('0xb')];this[_0x5e20('0xc')]=_0x289a5c[_0x5e20('0xc')];this[_0x5e20('0xd')]=_0x289a5c['dialOriginateTimeout']||0x1e;this[_0x5e20('0xe')]=_0x289a5c[_0x5e20('0xe')];this[_0x5e20('0xf')]=_0x289a5c[_0x5e20('0xf')];this[_0x5e20('0x10')]=_0x289a5c[_0x5e20('0x10')];this['dialBusyRetryFrequency']=_0x289a5c[_0x5e20('0x11')];this[_0x5e20('0x12')]=_0x289a5c[_0x5e20('0x12')];this['dialNoAnswerRetryFrequency']=_0x289a5c[_0x5e20('0x13')];this['dialGlobalMaxRetry']=_0x289a5c[_0x5e20('0x14')];this['dialOrderByScheduledAt']=_0x289a5c[_0x5e20('0x15')]||_0x5e20('0x16');this[_0x5e20('0x17')]=_0x289a5c[_0x5e20('0x17')]||undefined;this[_0x5e20('0x18')]=_0x289a5c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5e20('0x19')]=_0x289a5c[_0x5e20('0x19')]||undefined;this[_0x5e20('0x1a')]=_0x289a5c[_0x5e20('0x1a')]?_0x289a5c[_0x5e20('0x1a')]:undefined;this[_0x5e20('0x1b')]=_0x289a5c[_0x5e20('0x1b')]?_0x289a5c[_0x5e20('0x1b')]:undefined;this['Interval']=_0x289a5c[_0x5e20('0x1c')]?_0x289a5c[_0x5e20('0x1c')]:undefined;this['SquareProject']=_0x289a5c[_0x5e20('0x1d')]?_0x289a5c[_0x5e20('0x1d')]:undefined;this[_0x5e20('0x1e')]=_0x289a5c[_0x5e20('0x1d')]?_0x289a5c['SquareProject'][_0x5e20('0x0')]:undefined;this['dialAMDActive']=_0x289a5c['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x289a5c['dialAMDInitialSilence'];this[_0x5e20('0x1f')]=_0x289a5c['dialAMDGreeting'];this[_0x5e20('0x20')]=_0x289a5c[_0x5e20('0x20')];this[_0x5e20('0x21')]=_0x289a5c[_0x5e20('0x21')];this[_0x5e20('0x22')]=_0x289a5c[_0x5e20('0x22')];this['dialAMDBetweenWordsSilence']=_0x289a5c[_0x5e20('0x23')];this['dialAMDMaximumNumberOfWords']=_0x289a5c['dialAMDMaximumNumberOfWords'];this[_0x5e20('0x24')]=_0x289a5c[_0x5e20('0x24')];this[_0x5e20('0x25')]=_0x289a5c[_0x5e20('0x25')];}module[_0x5e20('0x26')]=Campaign; \ No newline at end of file +var _0x0e9f=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','temp','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x57d0dc,_0x387f3e){var _0x177765=function(_0x1bbc9e){while(--_0x1bbc9e){_0x57d0dc['push'](_0x57d0dc['shift']());}};_0x177765(++_0x387f3e);}(_0x0e9f,0x116));var _0xf0e9=function(_0x51df86,_0x19d01b){_0x51df86=_0x51df86-0x0;var _0x148158=_0x0e9f[_0x51df86];return _0x148158;};'use strict';function Campaign(_0x4db10a){this['id']=_0x4db10a['id']||0x0;this[_0xf0e9('0x0')]=_0x4db10a['name']||'';this['type']=_0x4db10a[_0xf0e9('0x1')]||'campaign';this['originated']=0x0;this[_0xf0e9('0x2')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0xf0e9('0x3')]='';this[_0xf0e9('0x4')]=!![];this['active']=_0x4db10a[_0xf0e9('0x5')];this['limitCalls']=_0x4db10a[_0xf0e9('0x6')];this[_0xf0e9('0x7')]=_0x4db10a[_0xf0e9('0x7')]||null;this['dialGlobalInterval']=_0x4db10a['dialGlobalInterval']?_0x4db10a[_0xf0e9('0x8')]:null;this[_0xf0e9('0x9')]=_0x4db10a[_0xf0e9('0x9')];this['dialOriginateCallerIdNumber']=_0x4db10a[_0xf0e9('0xa')];this[_0xf0e9('0xb')]=_0x4db10a[_0xf0e9('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x4db10a[_0xf0e9('0xc')];this[_0xf0e9('0xd')]=_0x4db10a[_0xf0e9('0xd')];this[_0xf0e9('0xe')]=_0x4db10a['dialBusyMaxRetry'];this[_0xf0e9('0xf')]=_0x4db10a['dialBusyRetryFrequency'];this[_0xf0e9('0x10')]=_0x4db10a[_0xf0e9('0x10')];this['dialNoAnswerRetryFrequency']=_0x4db10a[_0xf0e9('0x11')];this[_0xf0e9('0x12')]=_0x4db10a[_0xf0e9('0x12')];this[_0xf0e9('0x13')]=_0x4db10a[_0xf0e9('0x13')]||_0xf0e9('0x14');this['dialPrefix']=_0x4db10a[_0xf0e9('0x15')]||undefined;this[_0xf0e9('0x16')]=_0x4db10a['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xf0e9('0x17')]=_0x4db10a[_0xf0e9('0x17')]||undefined;this[_0xf0e9('0x18')]=_0x4db10a[_0xf0e9('0x18')]?_0x4db10a['TrunkBackup']:undefined;this[_0xf0e9('0x19')]=_0x4db10a[_0xf0e9('0x19')]?_0x4db10a[_0xf0e9('0x19')]:undefined;this[_0xf0e9('0x1a')]=_0x4db10a['Interval']?_0x4db10a['Interval']:undefined;this[_0xf0e9('0x1b')]=_0x4db10a[_0xf0e9('0x1b')]?_0x4db10a[_0xf0e9('0x1b')]:undefined;this['dialQueueProject']=_0x4db10a['SquareProject']?_0x4db10a[_0xf0e9('0x1b')][_0xf0e9('0x0')]:undefined;this['dialAMDActive']=_0x4db10a[_0xf0e9('0x1c')]||![];this['dialAMDInitialSilence']=_0x4db10a[_0xf0e9('0x1d')];this[_0xf0e9('0x1e')]=_0x4db10a['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x4db10a[_0xf0e9('0x1f')];this[_0xf0e9('0x20')]=_0x4db10a['dialAMDTotalAnalysisTime'];this[_0xf0e9('0x21')]=_0x4db10a[_0xf0e9('0x21')];this['dialAMDBetweenWordsSilence']=_0x4db10a[_0xf0e9('0x22')];this[_0xf0e9('0x23')]=_0x4db10a['dialAMDMaximumNumberOfWords'];this[_0xf0e9('0x24')]=_0x4db10a[_0xf0e9('0x24')];this[_0xf0e9('0x25')]=_0x4db10a[_0xf0e9('0x25')];}module[_0xf0e9('0x26')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index df90235..d936c6d 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 _0xd052=['destinationchannel','calleridname','accountcode','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','monitorFilename','queue','monitors','transfercalleridnum','mohtime'];(function(_0x16468f,_0x53b313){var _0x432d5d=function(_0x4bdee0){while(--_0x4bdee0){_0x16468f['push'](_0x16468f['shift']());}};_0x432d5d(++_0x53b313);}(_0xd052,0x69));var _0x2d05=function(_0x1a15f9,_0x124b61){_0x1a15f9=_0x1a15f9-0x0;var _0x59b4d1=_0xd052[_0x1a15f9];return _0x59b4d1;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x2d05('0x0')]='';this['calleridnum']=0x0;this[_0x2d05('0x1')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x2d05('0x2')]=0x0;this['context']='';this[_0x2d05('0x3')]=0x0;this[_0x2d05('0x4')]=0x0;this['exten']=0x0;this[_0x2d05('0x5')]=![];this[_0x2d05('0x6')]=null;this[_0x2d05('0x7')]=null;this[_0x2d05('0x8')]=![];this[_0x2d05('0x9')]=![];this[_0x2d05('0xa')]='';this[_0x2d05('0xb')]='';this[_0x2d05('0xc')]=0x0;this[_0x2d05('0xd')]=0x0;this[_0x2d05('0xe')]=0x0;this[_0x2d05('0xf')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0x2d05('0x10')]=null;this[_0x2d05('0x11')]=null;this[_0x2d05('0x12')]=[];this[_0x2d05('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x2d05('0x14')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x8daf=['transfercalleridnum','mohtime','exports','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','duration','type','tag','disposition','monitor','monitorFilename','queue','monitors'];(function(_0x22d05d,_0x123ccc){var _0x556861=function(_0x8c765e){while(--_0x8c765e){_0x22d05d['push'](_0x22d05d['shift']());}};_0x556861(++_0x123ccc);}(_0x8daf,0x15c));var _0xf8da=function(_0x4b93fe,_0x1ce6e2){_0x4b93fe=_0x4b93fe-0x0;var _0x4af931=_0x8daf[_0x4b93fe];return _0x4af931;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0xf8da('0x0')]='';this[_0xf8da('0x1')]=undefined;this['connectedlinename']=undefined;this[_0xf8da('0x2')]=0x0;this[_0xf8da('0x3')]='';this[_0xf8da('0x4')]=0x0;this[_0xf8da('0x5')]=0x0;this[_0xf8da('0x6')]=0x0;this[_0xf8da('0x7')]=![];this[_0xf8da('0x8')]=null;this[_0xf8da('0x9')]=null;this[_0xf8da('0xa')]=![];this['abandoned']=![];this[_0xf8da('0xb')]='';this['lastdata']='';this[_0xf8da('0xc')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xf8da('0xd')]=null;this[_0xf8da('0xe')]=null;this[_0xf8da('0xf')]=null;this[_0xf8da('0x10')]=![];this[_0xf8da('0x11')]=null;this[_0xf8da('0x12')]=null;this[_0xf8da('0x13')]=[];this[_0xf8da('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xf8da('0x15')]=0x0;}module[_0xf8da('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 10c81c0..9e411d8 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 _0x46b0=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x3af7b7,_0x208014){var _0x8408b5=function(_0x22161d){while(--_0x22161d){_0x3af7b7['push'](_0x3af7b7['shift']());}};_0x8408b5(++_0x208014);}(_0x46b0,0x76));var _0x046b=function(_0x4ff86c,_0x3ae599){_0x4ff86c=_0x4ff86c-0x0;var _0x189586=_0x46b0[_0x4ff86c];return _0x189586;};'use strict';function DeskAccount(_0x4cf479){this['id']=_0x4cf479['id']||0x0;this[_0x046b('0x0')]=_0x4cf479[_0x046b('0x0')]||'';this[_0x046b('0x1')]=_0x4cf479[_0x046b('0x1')]||'';this[_0x046b('0x2')]=_0x4cf479[_0x046b('0x2')]||'';this[_0x046b('0x3')]=_0x4cf479['authType']||'';this[_0x046b('0x4')]=_0x4cf479[_0x046b('0x4')]||'';this['consumerKey']=_0x4cf479[_0x046b('0x5')]||'';this[_0x046b('0x6')]=_0x4cf479[_0x046b('0x6')]||'';this['token']=_0x4cf479[_0x046b('0x7')]||'';this[_0x046b('0x8')]=_0x4cf479[_0x046b('0x8')]||'';this[_0x046b('0x9')]=_0x4cf479['type']||'';this[_0x046b('0xa')]=_0x4cf479['serverUrl']||'';this[_0x046b('0xb')]=_0x4cf479[_0x046b('0xb')]||{};}module[_0x046b('0xc')]=DeskAccount; \ No newline at end of file +var _0x2d66=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x194618,_0x2b8535){var _0x3a6638=function(_0x3853f6){while(--_0x3853f6){_0x194618['push'](_0x194618['shift']());}};_0x3a6638(++_0x2b8535);}(_0x2d66,0x18c));var _0x62d6=function(_0x94306f,_0x2b3a79){_0x94306f=_0x94306f-0x0;var _0x4ce98d=_0x2d66[_0x94306f];return _0x4ce98d;};'use strict';function DeskAccount(_0x385824){this['id']=_0x385824['id']||0x0;this[_0x62d6('0x0')]=_0x385824[_0x62d6('0x0')]||'';this[_0x62d6('0x1')]=_0x385824['username']||'';this[_0x62d6('0x2')]=_0x385824[_0x62d6('0x2')]||'';this['authType']=_0x385824[_0x62d6('0x3')]||'';this[_0x62d6('0x4')]=_0x385824[_0x62d6('0x4')]||'';this[_0x62d6('0x5')]=_0x385824['consumerKey']||'';this[_0x62d6('0x6')]=_0x385824['consumerSecret']||'';this[_0x62d6('0x7')]=_0x385824[_0x62d6('0x7')]||'';this[_0x62d6('0x8')]=_0x385824[_0x62d6('0x8')]||'';this['type']=_0x385824[_0x62d6('0x9')]||'';this[_0x62d6('0xa')]=_0x385824[_0x62d6('0xa')]||'';this[_0x62d6('0xb')]=_0x385824[_0x62d6('0xb')]||{};}module[_0x62d6('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 941c12d..77d471a 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 _0x03d1=['username','password','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x3474fc,_0x4ad4c1){var _0x509e51=function(_0x1fca90){while(--_0x1fca90){_0x3474fc['push'](_0x3474fc['shift']());}};_0x509e51(++_0x4ad4c1);}(_0x03d1,0x1c1));var _0x103d=function(_0x14c0f8,_0x564869){_0x14c0f8=_0x14c0f8-0x0;var _0x4d9346=_0x03d1[_0x14c0f8];return _0x4d9346;};'use strict';function Dynamics365Account(_0x1f2976){this['id']=_0x1f2976['id']||0x0;this[_0x103d('0x0')]=_0x1f2976[_0x103d('0x0')]||'';this[_0x103d('0x1')]=_0x1f2976[_0x103d('0x1')]||'';this[_0x103d('0x2')]=_0x1f2976['password']||'';this['remoteUri']=_0x1f2976['remoteUri']||'';this[_0x103d('0x3')]=_0x1f2976[_0x103d('0x3')]||'';this[_0x103d('0x4')]=_0x1f2976[_0x103d('0x4')]||'';this[_0x103d('0x5')]=_0x1f2976[_0x103d('0x5')]||{};this[_0x103d('0x6')]=_0x1f2976[_0x103d('0x6')]||'';this['Configurations']=_0x1f2976[_0x103d('0x7')]||{};}module[_0x103d('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x450c=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name','username'];(function(_0x1778f6,_0x133d36){var _0x3b66bf=function(_0x2e96cb){while(--_0x2e96cb){_0x1778f6['push'](_0x1778f6['shift']());}};_0x3b66bf(++_0x133d36);}(_0x450c,0x1d2));var _0xc450=function(_0x89a45b,_0x1c9765){_0x89a45b=_0x89a45b-0x0;var _0x339017=_0x450c[_0x89a45b];return _0x339017;};'use strict';function Dynamics365Account(_0x174db9){this['id']=_0x174db9['id']||0x0;this[_0xc450('0x0')]=_0x174db9[_0xc450('0x0')]||'';this[_0xc450('0x1')]=_0x174db9[_0xc450('0x1')]||'';this['password']=_0x174db9[_0xc450('0x2')]||'';this[_0xc450('0x3')]=_0x174db9[_0xc450('0x3')]||'';this['tenantId']=_0x174db9[_0xc450('0x4')]||'';this[_0xc450('0x5')]=_0x174db9['clientId']||'';this[_0xc450('0x6')]=_0x174db9[_0xc450('0x6')]||{};this[_0xc450('0x7')]=_0x174db9[_0xc450('0x7')]||'';this[_0xc450('0x8')]=_0x174db9['Configurations']||{};}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 a633a45..be341e8 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 _0xb7e7=['key','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0xf6bf87,_0x10c5ab){var _0x58381f=function(_0x47b560){while(--_0x47b560){_0xf6bf87['push'](_0xf6bf87['shift']());}};_0x58381f(++_0x10c5ab);}(_0xb7e7,0x121));var _0x7b7e=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb7e7[_0x465028];return _0xb783d4;};'use strict';function FaxAccount(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['description']=_0x2e5e07[_0x7b7e('0x1')];this['ecm']=_0x2e5e07[_0x7b7e('0x2')];this['headerinfo']=_0x2e5e07[_0x7b7e('0x3')];this[_0x7b7e('0x4')]=_0x2e5e07[_0x7b7e('0x4')];this['minrate']=_0x2e5e07['minrate']||0x960;this[_0x7b7e('0x5')]=_0x2e5e07[_0x7b7e('0x5')]||0x3840;this[_0x7b7e('0x6')]=_0x2e5e07['modem']||_0x7b7e('0x7');this[_0x7b7e('0x8')]=_0x2e5e07[_0x7b7e('0x8')]||'no';this[_0x7b7e('0x9')]=_0x2e5e07[_0x7b7e('0x9')]||'no';this[_0x7b7e('0xa')]=_0x2e5e07[_0x7b7e('0xa')]||0x1388;this['tech']=_0x2e5e07[_0x7b7e('0xb')]||_0x7b7e('0xc');this[_0x7b7e('0xd')]=_0x2e5e07[_0x7b7e('0xd')]?_0x2e5e07[_0x7b7e('0xd')]:undefined;this[_0x7b7e('0xe')]=_0x2e5e07[_0x7b7e('0xe')];this[_0x7b7e('0xf')]=_0x2e5e07[_0x7b7e('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x702d=['SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x702d,0x147));var _0xd702=function(_0x1bdfc3,_0x361193){_0x1bdfc3=_0x1bdfc3-0x0;var _0x515e37=_0x702d[_0x1bdfc3];return _0x515e37;};'use strict';function FaxAccount(_0x14de3f){this['id']=_0x14de3f['id']||0x0;this[_0xd702('0x0')]=_0x14de3f[_0xd702('0x0')]||'';this[_0xd702('0x1')]=_0x14de3f[_0xd702('0x1')];this['ecm']=_0x14de3f[_0xd702('0x2')];this[_0xd702('0x3')]=_0x14de3f[_0xd702('0x3')];this[_0xd702('0x4')]=_0x14de3f['localstationid'];this[_0xd702('0x5')]=_0x14de3f['minrate']||0x960;this[_0xd702('0x6')]=_0x14de3f[_0xd702('0x6')]||0x3840;this[_0xd702('0x7')]=_0x14de3f['modem']||_0xd702('0x8');this['gateway']=_0x14de3f[_0xd702('0x9')]||'no';this[_0xd702('0xa')]=_0x14de3f[_0xd702('0xa')]||'no';this[_0xd702('0xb')]=_0x14de3f[_0xd702('0xb')]||0x1388;this[_0xd702('0xc')]=_0x14de3f[_0xd702('0xc')]||_0xd702('0xd');this[_0xd702('0xe')]=_0x14de3f[_0xd702('0xe')]?_0x14de3f['Trunk']:undefined;this['ListId']=_0x14de3f[_0xd702('0xf')];this[_0xd702('0x10')]=_0x14de3f[_0xd702('0x10')];}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 6226dc8..ab203ad 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 _0xb5a8=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb5a8,0x177));var _0x8b5a=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xb5a8[_0x411add];return _0x238242;};'use strict';function FreshdeskAccount(_0x41ac99){this['id']=_0x41ac99['id']||0x0;this[_0x8b5a('0x0')]=_0x41ac99[_0x8b5a('0x0')]||'';this[_0x8b5a('0x1')]=_0x41ac99[_0x8b5a('0x1')]||'';this[_0x8b5a('0x2')]=_0x41ac99[_0x8b5a('0x3')]||'';this[_0x8b5a('0x4')]=_0x41ac99['remoteUri']||'';this[_0x8b5a('0x5')]=_0x41ac99[_0x8b5a('0x5')]||'';this[_0x8b5a('0x6')]=_0x41ac99['Configurations']||{};}module[_0x8b5a('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x5ca0=['token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x531d22,_0x49cd59){var _0x2ed186=function(_0x22ebe0){while(--_0x22ebe0){_0x531d22['push'](_0x531d22['shift']());}};_0x2ed186(++_0x49cd59);}(_0x5ca0,0xac));var _0x05ca=function(_0x291e36,_0x20c03e){_0x291e36=_0x291e36-0x0;var _0x29def8=_0x5ca0[_0x291e36];return _0x29def8;};'use strict';function FreshdeskAccount(_0x6a8fb7){this['id']=_0x6a8fb7['id']||0x0;this[_0x05ca('0x0')]=_0x6a8fb7['name']||'';this['username']=_0x6a8fb7[_0x05ca('0x1')]||'';this['apiKey']=_0x6a8fb7[_0x05ca('0x2')]||'';this[_0x05ca('0x3')]=_0x6a8fb7[_0x05ca('0x3')]||'';this[_0x05ca('0x4')]=_0x6a8fb7[_0x05ca('0x4')]||'';this[_0x05ca('0x5')]=_0x6a8fb7[_0x05ca('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index de844a0..37c5123 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 _0x0220=['type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','mohtime','exports'];(function(_0x333798,_0x9f6561){var _0x389f4e=function(_0x193b28){while(--_0x193b28){_0x333798['push'](_0x333798['shift']());}};_0x389f4e(++_0x9f6561);}(_0x0220,0x18f));var _0x0022=function(_0x900a8d,_0x1f009a){_0x900a8d=_0x900a8d-0x0;var _0x5b80fc=_0x0220[_0x900a8d];return _0x5b80fc;};'use strict';function QueueReport(){this[_0x0022('0x0')]=_0x0022('0x1');this[_0x0022('0x2')]='';this['calleridnum']='';this[_0x0022('0x3')]='';this[_0x0022('0x4')]='';this[_0x0022('0x5')]=null;this[_0x0022('0x6')]=null;this['position']=0x1;this['count']=0x1;this[_0x0022('0x7')]=![];this[_0x0022('0x8')]=null;this[_0x0022('0x9')]=![];this[_0x0022('0xa')]=null;this[_0x0022('0xb')]=![];this[_0x0022('0xc')]=null;this['originalposition']=0x1;this['channel']='';this[_0x0022('0xd')]='';this[_0x0022('0xe')]='';this[_0x0022('0xf')]='';this[_0x0022('0x10')]='';this[_0x0022('0x11')]='';this['priority']='';this[_0x0022('0x12')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x0022('0x13')]=0x0;this['variables']={};}module[_0x0022('0x14')]=QueueReport; \ No newline at end of file +var _0xd94e=['variables','exports','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','assigned','lastAssignedTo','mohtime'];(function(_0x18647b,_0x4a5288){var _0x37e7f4=function(_0x3b4bcd){while(--_0x3b4bcd){_0x18647b['push'](_0x18647b['shift']());}};_0x37e7f4(++_0x4a5288);}(_0xd94e,0x16e));var _0xed94=function(_0x52fe08,_0x529536){_0x52fe08=_0x52fe08-0x0;var _0x506424=_0xd94e[_0x52fe08];return _0x506424;};'use strict';function QueueReport(){this['type']=_0xed94('0x0');this['uniqueid']='';this['calleridnum']='';this[_0xed94('0x1')]='';this[_0xed94('0x2')]='';this[_0xed94('0x3')]=null;this[_0xed94('0x4')]=null;this[_0xed94('0x5')]=0x1;this[_0xed94('0x6')]=0x1;this[_0xed94('0x7')]=![];this[_0xed94('0x8')]=null;this[_0xed94('0x9')]=![];this[_0xed94('0xa')]=null;this[_0xed94('0xb')]=![];this[_0xed94('0xc')]=null;this[_0xed94('0xd')]=0x1;this[_0xed94('0xe')]='';this[_0xed94('0xf')]='';this[_0xed94('0x10')]='';this[_0xed94('0x11')]='';this[_0xed94('0x12')]='';this['exten']='';this[_0xed94('0x13')]='';this[_0xed94('0x14')]=0x0;this[_0xed94('0x15')]=![];this[_0xed94('0x16')]='';this[_0xed94('0x17')]=0x0;this[_0xed94('0x18')]={};}module[_0xed94('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 03fcfa3..89df71f 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 _0x3369=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x503103,_0x54af60){var _0x4ef8f3=function(_0x213e3d){while(--_0x213e3d){_0x503103['push'](_0x503103['shift']());}};_0x4ef8f3(++_0x54af60);}(_0x3369,0x1a5));var _0x9336=function(_0x3cfd5d,_0x5a35d3){_0x3cfd5d=_0x3cfd5d-0x0;var _0x1ffc55=_0x3369[_0x3cfd5d];return _0x1ffc55;};'use strict';function SalesforceAccount(_0x467a1e){this['id']=_0x467a1e['id']||0x0;this[_0x9336('0x0')]=_0x467a1e['name']||'';this[_0x9336('0x1')]=_0x467a1e['username']||'';this['remoteUri']=_0x467a1e[_0x9336('0x2')]||'';this[_0x9336('0x3')]=_0x467a1e[_0x9336('0x3')]||'';this[_0x9336('0x4')]=_0x467a1e['clientId']||'';this[_0x9336('0x5')]=_0x467a1e[_0x9336('0x5')]||'';this[_0x9336('0x6')]=_0x467a1e['securityToken']||'';this[_0x9336('0x7')]=_0x467a1e[_0x9336('0x7')]||_0x9336('0x8');this[_0x9336('0x9')]=_0x467a1e[_0x9336('0x9')]||'';this[_0x9336('0xa')]=_0x467a1e['Configurations']||{};}module[_0x9336('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xe0c3=['Configurations','exports','name','username','remoteUri','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x4c66d1,_0x41e142){var _0x502ad6=function(_0x575f41){while(--_0x575f41){_0x4c66d1['push'](_0x4c66d1['shift']());}};_0x502ad6(++_0x41e142);}(_0xe0c3,0x1c4));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x466848){this['id']=_0x466848['id']||0x0;this[_0x3e0c('0x0')]=_0x466848[_0x3e0c('0x0')]||'';this[_0x3e0c('0x1')]=_0x466848[_0x3e0c('0x1')]||'';this[_0x3e0c('0x2')]=_0x466848['remoteUri']||'';this['password']=_0x466848['password']||'';this['clientId']=_0x466848[_0x3e0c('0x3')]||'';this[_0x3e0c('0x4')]=_0x466848[_0x3e0c('0x4')]||'';this[_0x3e0c('0x5')]=_0x466848[_0x3e0c('0x5')]||'';this[_0x3e0c('0x6')]=_0x466848[_0x3e0c('0x6')]||'integrationTab';this[_0x3e0c('0x7')]=_0x466848['serverUrl']||'';this[_0x3e0c('0x8')]=_0x466848[_0x3e0c('0x8')]||{};}module[_0x3e0c('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 4acc65a..dc50509 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 _0xb05f=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x34cbbf,_0x540ce2){var _0x3ec76e=function(_0x4e77e1){while(--_0x4e77e1){_0x34cbbf['push'](_0x34cbbf['shift']());}};_0x3ec76e(++_0x540ce2);}(_0xb05f,0xf8));var _0xfb05=function(_0x564fd7,_0x3da350){_0x564fd7=_0x564fd7-0x0;var _0x33e4bc=_0xb05f[_0x564fd7];return _0x33e4bc;};'use strict';function ServicenowAccount(_0x3dd730){this['id']=_0x3dd730['id']||0x0;this['name']=_0x3dd730[_0xfb05('0x0')]||'';this[_0xfb05('0x1')]=_0x3dd730[_0xfb05('0x1')]||'';this[_0xfb05('0x2')]=_0x3dd730[_0xfb05('0x2')]||'';this[_0xfb05('0x3')]=_0x3dd730[_0xfb05('0x3')]||'';this[_0xfb05('0x4')]=_0x3dd730[_0xfb05('0x4')]||'';this[_0xfb05('0x5')]=_0x3dd730['Configurations']||{};}module[_0xfb05('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xafcb=['name','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x199279,_0x457b40){var _0x740eb7=function(_0xdd2ccf){while(--_0xdd2ccf){_0x199279['push'](_0x199279['shift']());}};_0x740eb7(++_0x457b40);}(_0xafcb,0x108));var _0xbafc=function(_0x5c4ff4,_0x415005){_0x5c4ff4=_0x5c4ff4-0x0;var _0x46ab54=_0xafcb[_0x5c4ff4];return _0x46ab54;};'use strict';function ServicenowAccount(_0xc905f){this['id']=_0xc905f['id']||0x0;this[_0xbafc('0x0')]=_0xc905f[_0xbafc('0x0')]||'';this['username']=_0xc905f['username']||'';this[_0xbafc('0x1')]=_0xc905f['password']||'';this['remoteUri']=_0xc905f[_0xbafc('0x2')]||'';this[_0xbafc('0x3')]=_0xc905f[_0xbafc('0x3')]||'';this[_0xbafc('0x4')]=_0xc905f[_0xbafc('0x4')]||{};}module[_0xbafc('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 b4324c1..e49ee45 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 _0xe1a1=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x29958d,_0x284264){var _0x3b8f7e=function(_0x1e3131){while(--_0x1e3131){_0x29958d['push'](_0x29958d['shift']());}};_0x3b8f7e(++_0x284264);}(_0xe1a1,0x1b8));var _0x1e1a=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xe1a1[_0x5f0089];return _0x193892;};'use strict';function SugarcrmAccount(_0x4f6731){this['id']=_0x4f6731['id']||0x0;this[_0x1e1a('0x0')]=_0x4f6731['name']||'';this[_0x1e1a('0x1')]=_0x4f6731['username']||'';this['password']=_0x4f6731[_0x1e1a('0x2')]||'';this[_0x1e1a('0x3')]=_0x4f6731[_0x1e1a('0x3')]||'';this[_0x1e1a('0x4')]=_0x4f6731[_0x1e1a('0x4')]||'';this[_0x1e1a('0x5')]=_0x4f6731[_0x1e1a('0x5')]||{};}module[_0x1e1a('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x75ff=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x75ff,0x178));var _0xf75f=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x75ff[_0xb6e2ea];return _0x2a57bb;};'use strict';function SugarcrmAccount(_0x2c0e5e){this['id']=_0x2c0e5e['id']||0x0;this['name']=_0x2c0e5e[_0xf75f('0x0')]||'';this[_0xf75f('0x1')]=_0x2c0e5e[_0xf75f('0x1')]||'';this['password']=_0x2c0e5e[_0xf75f('0x2')]||'';this[_0xf75f('0x3')]=_0x2c0e5e[_0xf75f('0x3')]||'';this[_0xf75f('0x4')]=_0x2c0e5e[_0xf75f('0x4')]||'';this[_0xf75f('0x5')]=_0x2c0e5e['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 836ec92..335eebd 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 _0xf197=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x4987bc,_0x64bea0){var _0x45558f=function(_0x1e2458){while(--_0x1e2458){_0x4987bc['push'](_0x4987bc['shift']());}};_0x45558f(++_0x64bea0);}(_0xf197,0x1a8));var _0x7f19=function(_0x5669d8,_0x366fdf){_0x5669d8=_0x5669d8-0x0;var _0x1e0464=_0xf197[_0x5669d8];return _0x1e0464;};'use strict';function Telephone(_0x43f998){this['id']=_0x43f998['id']||0x0;this[_0x7f19('0x0')]=_0x43f998['name']||'';this[_0x7f19('0x1')]=_0x43f998[_0x7f19('0x1')]||'';this[_0x7f19('0x2')]=_0x7f19('0x3');this[_0x7f19('0x4')]=0x0;this[_0x7f19('0x5')]=_0x7f19('0x3');this[_0x7f19('0x6')]='';}module[_0x7f19('0x7')]=Telephone; \ No newline at end of file +var _0x716f=['unknown','address','exports','name','accountcode','stateTime','status'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x716f,0xb9));var _0xf716=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x716f[_0x3070dc];return _0x431489;};'use strict';function Telephone(_0xa917a7){this['id']=_0xa917a7['id']||0x0;this[_0xf716('0x0')]=_0xa917a7[_0xf716('0x0')]||'';this['accountcode']=_0xa917a7[_0xf716('0x1')]||'';this['state']='unknown';this[_0xf716('0x2')]=0x0;this[_0xf716('0x3')]=_0xf716('0x4');this[_0xf716('0x5')]='';}module[_0xf716('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 85c9e5f..9a2345d 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 _0x41bb=['html','exports','name'];(function(_0x232da4,_0x13adeb){var _0xcd3772=function(_0x52f826){while(--_0x52f826){_0x232da4['push'](_0x232da4['shift']());}};_0xcd3772(++_0x13adeb);}(_0x41bb,0xc5));var _0xb41b=function(_0x474cc5,_0x57be85){_0x474cc5=_0x474cc5-0x0;var _0x51e42e=_0x41bb[_0x474cc5];return _0x51e42e;};'use strict';function template(_0x4337f5){this['id']=_0x4337f5['id']||0x0;this[_0xb41b('0x0')]=_0x4337f5['name']||'';this[_0xb41b('0x1')]=_0x4337f5['html']||'';}module[_0xb41b('0x2')]=template; \ No newline at end of file +var _0x39cb=['exports','name','html'];(function(_0x43592a,_0x464b95){var _0x484622=function(_0x2f4c5b){while(--_0x2f4c5b){_0x43592a['push'](_0x43592a['shift']());}};_0x484622(++_0x464b95);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};'use strict';function template(_0x53ebb9){this['id']=_0x53ebb9['id']||0x0;this[_0xb39c('0x0')]=_0x53ebb9[_0xb39c('0x0')]||'';this['html']=_0x53ebb9[_0xb39c('0x1')]||'';}module[_0xb39c('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index e9b1d57..5bb4928 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 _0x7590=['exports','name','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x555569,_0x15669b){var _0x2541ff=function(_0x5aef2b){while(--_0x5aef2b){_0x555569['push'](_0x555569['shift']());}};_0x2541ff(++_0x15669b);}(_0x7590,0x120));var _0x0759=function(_0x5edbc8,_0x3cba86){_0x5edbc8=_0x5edbc8-0x0;var _0x1381ac=_0x7590[_0x5edbc8];return _0x1381ac;};'use strict';function Trigger(_0x344ced){this['id']=_0x344ced['id']||0x0;this[_0x0759('0x0')]=_0x344ced[_0x0759('0x0')]||'';this['channel']=_0x344ced['channel']||_0x0759('0x1');this[_0x0759('0x2')]=_0x344ced[_0x0759('0x2')]||![];this[_0x0759('0x3')]=_0x344ced['AllConditions']||[];this[_0x0759('0x4')]=_0x344ced['AnyConditions']||[];this[_0x0759('0x5')]=_0x344ced[_0x0759('0x5')]||[];}module[_0x0759('0x6')]=Trigger; \ No newline at end of file +var _0xfac5=['AnyConditions','Actions','exports','name','channel','voice','status','AllConditions'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xfac5,0x1d3));var _0x5fac=function(_0x477ffc,_0x58d9db){_0x477ffc=_0x477ffc-0x0;var _0x1fe1c3=_0xfac5[_0x477ffc];return _0x1fe1c3;};'use strict';function Trigger(_0x3320a6){this['id']=_0x3320a6['id']||0x0;this['name']=_0x3320a6[_0x5fac('0x0')]||'';this[_0x5fac('0x1')]=_0x3320a6[_0x5fac('0x1')]||_0x5fac('0x2');this[_0x5fac('0x3')]=_0x3320a6[_0x5fac('0x3')]||![];this[_0x5fac('0x4')]=_0x3320a6['AllConditions']||[];this[_0x5fac('0x5')]=_0x3320a6['AnyConditions']||[];this[_0x5fac('0x6')]=_0x3320a6['Actions']||[];}module[_0x5fac('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index a8cbfe1..788807e 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 _0xc9cd=['exports','active','name','stateTime','status','unknown','registry','split','host','domain','domainport','refresh','registrationtime'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0xc9cd,0x1c8));var _0xdc9c=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0xc9cd[_0x403c8d];return _0x4ca60d;};'use strict';function Trunk(_0x1ee75f){this['id']=_0x1ee75f['id']||0x0;this[_0xdc9c('0x0')]=_0x1ee75f[_0xdc9c('0x0')]||![];this[_0xdc9c('0x1')]=_0x1ee75f['name']||'';this['state']='unknown';this[_0xdc9c('0x2')]=0x0;this[_0xdc9c('0x3')]=_0xdc9c('0x4');this[_0xdc9c('0x5')]=_0x1ee75f[_0xdc9c('0x5')]&&_0x1ee75f['registry']['indexOf'](':')?_0x1ee75f[_0xdc9c('0x5')][_0xdc9c('0x6')](':')[0x0]:'';this[_0xdc9c('0x7')]='';this['port']='';this[_0xdc9c('0x8')]='';this[_0xdc9c('0x9')]='';this[_0xdc9c('0xa')]='';this['stateRegistry']=_0xdc9c('0x4');this[_0xdc9c('0xb')]='';this['address']='';}module[_0xdc9c('0xc')]=Trunk; \ No newline at end of file +var _0xdf41=['domain','refresh','address','exports','active','name','state','unknown','registry','indexOf','split','host','port'];(function(_0x2c9e6f,_0x9ec545){var _0x443251=function(_0x4b3e42){while(--_0x4b3e42){_0x2c9e6f['push'](_0x2c9e6f['shift']());}};_0x443251(++_0x9ec545);}(_0xdf41,0x18a));var _0x1df4=function(_0x39d636,_0x305a5a){_0x39d636=_0x39d636-0x0;var _0x5f1f06=_0xdf41[_0x39d636];return _0x5f1f06;};'use strict';function Trunk(_0x4b49cc){this['id']=_0x4b49cc['id']||0x0;this[_0x1df4('0x0')]=_0x4b49cc[_0x1df4('0x0')]||![];this[_0x1df4('0x1')]=_0x4b49cc[_0x1df4('0x1')]||'';this[_0x1df4('0x2')]=_0x1df4('0x3');this['stateTime']=0x0;this['status']=_0x1df4('0x3');this['registry']=_0x4b49cc['registry']&&_0x4b49cc[_0x1df4('0x4')][_0x1df4('0x5')](':')?_0x4b49cc['registry'][_0x1df4('0x6')](':')[0x0]:'';this[_0x1df4('0x7')]='';this[_0x1df4('0x8')]='';this[_0x1df4('0x9')]='';this['domainport']='';this[_0x1df4('0xa')]='';this['stateRegistry']=_0x1df4('0x3');this['registrationtime']='';this[_0x1df4('0xb')]='';}module[_0x1df4('0xc')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index a4d8c77..8ddd10e 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 _0x505d=['recordingFormat','none','exports','exten'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0x505d,0xd3));var _0xd505=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x505d[_0x55ff3e];return _0x2709eb;};'use strict';function voiceExtension(_0x2bbcdc){this['id']=_0x2bbcdc['id']||0x0;this[_0xd505('0x0')]=_0x2bbcdc[_0xd505('0x0')]||'';this['recordingFormat']=_0x2bbcdc[_0xd505('0x1')]||_0xd505('0x2');this['mandatoryDisposition']=_0x2bbcdc['mandatoryDisposition']||![];}module[_0xd505('0x3')]=voiceExtension; \ No newline at end of file +var _0x6af5=['recordingFormat','exports','exten'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6af5,0xaa));var _0x56af=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x6af5[_0x3305de];return _0x3b5a84;};'use strict';function voiceExtension(_0x1c93e8){this['id']=_0x1c93e8['id']||0x0;this[_0x56af('0x0')]=_0x1c93e8[_0x56af('0x0')]||'';this[_0x56af('0x1')]=_0x1c93e8['recordingFormat']||'none';this['mandatoryDisposition']=_0x1c93e8['mandatoryDisposition']||![];}module[_0x56af('0x2')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 5ca589a..b995f66 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 _0x0882=['outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalLowerLimit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','talking','total','answered','sumHoldTime','abandoned','loggedIn','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x0882,0x89));var _0x2088=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0x0882[_0x538c70];return _0x42ae01;};'use strict';var statusDesc=[_0x2088('0x0'),_0x2088('0x1'),_0x2088('0x2'),_0x2088('0x3'),_0x2088('0x4'),'unavailable',_0x2088('0x5'),_0x2088('0x6'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0x2088('0x7'),'gsm':_0x2088('0x8')};var strategy={'rrmemory':_0x2088('0x9'),'roundrobin':_0x2088('0xa')};function VoiceQueue(_0x2ade12){this['id']=_0x2ade12['id']||0x0;this[_0x2088('0xb')]=_0x2ade12[_0x2088('0xb')]||'';this['monitor_format']=_0x2ade12[_0x2088('0xc')]||'';this['type']=_0x2ade12[_0x2088('0xd')]||'inbound';this['waiting']=0x0;this[_0x2088('0xe')]=0x0;this[_0x2088('0xf')]=0x0;this[_0x2088('0x10')]=0x0;this['sumDuration']=0x0;this[_0x2088('0x11')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x2088('0x12')]=0x0;this[_0x2088('0x13')]=0x0;this['available']=0x0;this[_0x2088('0x14')]=_0x2ade12[_0x2088('0x14')]||![];this[_0x2088('0x15')]=_0x2ade12['acwTimeout']||0xa;this['autopause']=_0x2ade12[_0x2088('0x16')]||'no';this['sendMessageOneNotActive']=!![];this[_0x2088('0x17')]='';this[_0x2088('0x18')]=0x0;this[_0x2088('0x19')]=0x0;this[_0x2088('0x1a')]=_0x2ade12[_0x2088('0x1a')]||null;this['dialGlobalInterval']=_0x2ade12['dialGlobalInterval']?_0x2ade12[_0x2088('0x1b')]:null;this['dialActive']=_0x2ade12[_0x2088('0x1c')];this['dialMethod']=_0x2ade12['dialMethod']||_0x2088('0x1d');this['dialLimitChannel']=_0x2ade12[_0x2088('0x1e')]||0x0;this[_0x2088('0x1f')]=_0x2ade12[_0x2088('0x1f')]||0x0;this[_0x2088('0x20')]=_0x2ade12[_0x2088('0x20')]||0x1;this['dialPredictiveOptimization']=_0x2ade12[_0x2088('0x21')]||_0x2088('0x22');this[_0x2088('0x23')]=_0x2ade12['dialPredictiveOptimizationPercentage']||0.03;this[_0x2088('0x24')]=_0x2ade12[_0x2088('0x24')]||0x258;this[_0x2088('0x25')]=_0x2ade12[_0x2088('0x25')]||_0x2088('0x26');this[_0x2088('0x27')]=_0x2ade12[_0x2088('0x27')]||_0x2088('0x26');this[_0x2088('0x28')]=_0x2ade12[_0x2088('0x28')]||0x1e;this[_0x2088('0x29')]=_0x2ade12['dialQueueOptions']||_0x2088('0x2a');this[_0x2088('0x2b')]=_0x2ade12[_0x2088('0x2b')]||0x3;this['dialQueueProject']=_0x2ade12[_0x2088('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x2ade12[_0x2088('0x2d')]||0x3;this[_0x2088('0x2e')]=_0x2ade12['dialCongestionRetryFrequency']||0x96;this[_0x2088('0x2f')]=_0x2ade12['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x2ade12['dialBusyRetryFrequency']||0x96;this[_0x2088('0x30')]=_0x2ade12[_0x2088('0x30')]||0x3;this[_0x2088('0x31')]=_0x2ade12['dialNoAnswerRetryFrequency']||0x96;this[_0x2088('0x32')]=_0x2ade12[_0x2088('0x32')]||0x4;this[_0x2088('0x33')]=_0x2ade12[_0x2088('0x33')]?_0x2ade12[_0x2088('0x33')]:undefined;this[_0x2088('0x34')]=_0x2ade12['TrunkBackup']?_0x2ade12[_0x2088('0x34')]:undefined;this[_0x2088('0x35')]=_0x2ade12[_0x2088('0x35')]||undefined;this[_0x2088('0x36')]=_0x2ade12[_0x2088('0x36')]?_0x2ade12[_0x2088('0x36')]:undefined;this[_0x2088('0x37')]=_0x2ade12['dialOrderByScheduledAt']||_0x2088('0x38');this[_0x2088('0x39')]=_0x2ade12['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2088('0x3a')]=_0x2ade12[_0x2088('0x3a')]||undefined;this['strategy']=strategy[_0x2ade12['strategy']]||_0x2088('0x9');this[_0x2088('0x3b')]=!![];this['dialAMDActive']=_0x2ade12[_0x2088('0x3c')]||![];this[_0x2088('0x3d')]=_0x2ade12['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x2ade12['dialAMDGreeting'];this[_0x2088('0x3e')]=_0x2ade12[_0x2088('0x3e')];this[_0x2088('0x3f')]=_0x2ade12['dialAMDTotalAnalysisTime'];this[_0x2088('0x40')]=_0x2ade12['dialAMDMinWordLength'];this[_0x2088('0x41')]=_0x2ade12[_0x2088('0x41')];this[_0x2088('0x42')]=_0x2ade12[_0x2088('0x42')];this[_0x2088('0x43')]=_0x2ade12[_0x2088('0x43')];this[_0x2088('0x44')]=_0x2ade12[_0x2088('0x44')];this[_0x2088('0x45')]=0x0;this['pTalking']=0x0;this['timeout']=_0x2ade12['timeout'];this[_0x2088('0x46')]=0x0;this[_0x2088('0x47')]=0x0;this[_0x2088('0x48')]=0x0;this[_0x2088('0x49')]=0x0;this[_0x2088('0x4a')]=0x0;this[_0x2088('0x4b')]=0x0;this[_0x2088('0x4c')]=0x0;this[_0x2088('0x4d')]=0x0;this[_0x2088('0x4e')]=0x0;this[_0x2088('0x4f')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x2088('0x50')]=0x0;this['outboundReCallsDay']=0x0;this[_0x2088('0x51')]=undefined;this[_0x2088('0x52')]=undefined;this[_0x2088('0x53')]=undefined;this[_0x2088('0x54')]=1.05;this[_0x2088('0x55')]=0x0;this[_0x2088('0x56')]=0x0;this[_0x2088('0x57')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x2088('0x58')]=0x0;this[_0x2088('0x59')]=0x0;this[_0x2088('0x5a')]=0x0;this[_0x2088('0x5b')]=0.4;this[_0x2088('0x5c')]=0x0;this[_0x2088('0x5d')]=0x0;this[_0x2088('0x5e')]=0x1;this[_0x2088('0x5f')]=0x0;this[_0x2088('0x60')]=0x0;this[_0x2088('0x61')]=0x0;this[_0x2088('0x62')]=0x0;this['dialRecallMeTimeout']=_0x2ade12[_0x2088('0x63')]||0x1e;this[_0x2088('0x64')]=_0x2ade12[_0x2088('0x64')]||![];this[_0x2088('0x65')]=_0x2ade12[_0x2088('0x65')]||undefined;this[_0x2088('0x66')]=_0x2ade12[_0x2088('0x66')]||![];this[_0x2088('0x67')]=_0x2ade12[_0x2088('0x67')]||![];this[_0x2088('0xc')]=monitorFormat[_0x2ade12['monitor_format']]?monitorFormat[_0x2ade12['monitor_format']]:undefined;this['mandatoryDisposition']=_0x2ade12['mandatoryDisposition']||![];this[_0x2088('0x68')]=_0x2ade12[_0x2088('0x68')]?_0x2ade12['mandatoryDispositionPause']:undefined;}module[_0x2088('0x69')]=VoiceQueue; \ No newline at end of file +var _0x0a14=['predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalLowerLimit','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor'];(function(_0x176033,_0x250e77){var _0x2f36d3=function(_0x2dc6c5){while(--_0x2dc6c5){_0x176033['push'](_0x176033['shift']());}};_0x2f36d3(++_0x250e77);}(_0x0a14,0x14e));var _0x40a1=function(_0x3cdd2f,_0x1c829e){_0x3cdd2f=_0x3cdd2f-0x0;var _0x59892b=_0x0a14[_0x3cdd2f];return _0x59892b;};'use strict';var statusDesc=[_0x40a1('0x0'),_0x40a1('0x1'),_0x40a1('0x2'),'busy',_0x40a1('0x3'),_0x40a1('0x4'),'ringing',_0x40a1('0x5'),'onhold'];var monitorFormat={'wav':_0x40a1('0x6'),'wav49':_0x40a1('0x7'),'gsm':_0x40a1('0x8')};var strategy={'rrmemory':_0x40a1('0x9'),'roundrobin':_0x40a1('0xa')};function VoiceQueue(_0x1cb92a){this['id']=_0x1cb92a['id']||0x0;this[_0x40a1('0xb')]=_0x1cb92a[_0x40a1('0xb')]||'';this[_0x40a1('0xc')]=_0x1cb92a['monitor_format']||'';this['type']=_0x1cb92a[_0x40a1('0xd')]||_0x40a1('0xe');this['waiting']=0x0;this[_0x40a1('0xf')]=0x0;this[_0x40a1('0x10')]=0x0;this[_0x40a1('0x11')]=0x0;this[_0x40a1('0x12')]=0x0;this[_0x40a1('0x13')]=0x0;this[_0x40a1('0x14')]=0x0;this[_0x40a1('0x15')]=0x0;this[_0x40a1('0x16')]=0x0;this['loggedIn']=0x0;this[_0x40a1('0x17')]=0x0;this[_0x40a1('0x18')]=_0x1cb92a[_0x40a1('0x18')]||![];this['acwTimeout']=_0x1cb92a[_0x40a1('0x19')]||0xa;this[_0x40a1('0x1a')]=_0x1cb92a[_0x40a1('0x1a')]||'no';this[_0x40a1('0x1b')]=!![];this[_0x40a1('0x1c')]='';this[_0x40a1('0x1d')]=0x0;this[_0x40a1('0x1e')]=0x0;this['dialTimezone']=_0x1cb92a[_0x40a1('0x1f')]||null;this[_0x40a1('0x20')]=_0x1cb92a[_0x40a1('0x20')]?_0x1cb92a[_0x40a1('0x20')]:null;this['dialActive']=_0x1cb92a[_0x40a1('0x21')];this[_0x40a1('0x22')]=_0x1cb92a[_0x40a1('0x22')]||_0x40a1('0x23');this[_0x40a1('0x24')]=_0x1cb92a[_0x40a1('0x24')]||0x0;this['dialLimitQueue']=_0x1cb92a['dialLimitQueue']||0x0;this[_0x40a1('0x25')]=_0x1cb92a['dialPowerLevel']||0x1;this[_0x40a1('0x26')]=_0x1cb92a['dialPredictiveOptimization']||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x1cb92a['dialPredictiveOptimizationPercentage']||0.03;this[_0x40a1('0x27')]=_0x1cb92a[_0x40a1('0x27')]||0x258;this[_0x40a1('0x28')]=_0x1cb92a['dialOriginateCallerIdName']||'anonymous';this[_0x40a1('0x29')]=_0x1cb92a[_0x40a1('0x29')]||_0x40a1('0x2a');this[_0x40a1('0x2b')]=_0x1cb92a[_0x40a1('0x2b')]||0x1e;this['dialQueueOptions']=_0x1cb92a['dialQueueOptions']||_0x40a1('0x2c');this[_0x40a1('0x2d')]=_0x1cb92a[_0x40a1('0x2d')]||0x3;this[_0x40a1('0x2e')]=_0x1cb92a[_0x40a1('0x2e')]||undefined;this[_0x40a1('0x2f')]=_0x1cb92a['dialCongestionMaxRetry']||0x3;this[_0x40a1('0x30')]=_0x1cb92a[_0x40a1('0x30')]||0x96;this['dialBusyMaxRetry']=_0x1cb92a[_0x40a1('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x1cb92a[_0x40a1('0x32')]||0x96;this['dialNoAnswerMaxRetry']=_0x1cb92a[_0x40a1('0x33')]||0x3;this[_0x40a1('0x34')]=_0x1cb92a[_0x40a1('0x34')]||0x96;this['dialGlobalMaxRetry']=_0x1cb92a[_0x40a1('0x35')]||0x4;this['Trunk']=_0x1cb92a[_0x40a1('0x36')]?_0x1cb92a['Trunk']:undefined;this[_0x40a1('0x37')]=_0x1cb92a[_0x40a1('0x37')]?_0x1cb92a['TrunkBackup']:undefined;this[_0x40a1('0x38')]=_0x1cb92a[_0x40a1('0x38')]||undefined;this[_0x40a1('0x39')]=_0x1cb92a[_0x40a1('0x39')]?_0x1cb92a[_0x40a1('0x39')]:undefined;this[_0x40a1('0x3a')]=_0x1cb92a[_0x40a1('0x3a')]||_0x40a1('0x3b');this[_0x40a1('0x3c')]=_0x1cb92a[_0x40a1('0x3c')]||undefined;this[_0x40a1('0x3d')]=_0x1cb92a[_0x40a1('0x3d')]||undefined;this[_0x40a1('0x3e')]=strategy[_0x1cb92a[_0x40a1('0x3e')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0x40a1('0x3f')]=_0x1cb92a[_0x40a1('0x3f')]||![];this[_0x40a1('0x40')]=_0x1cb92a[_0x40a1('0x40')];this[_0x40a1('0x41')]=_0x1cb92a[_0x40a1('0x41')];this[_0x40a1('0x42')]=_0x1cb92a[_0x40a1('0x42')];this['dialAMDTotalAnalysisTime']=_0x1cb92a[_0x40a1('0x43')];this['dialAMDMinWordLength']=_0x1cb92a[_0x40a1('0x44')];this[_0x40a1('0x45')]=_0x1cb92a[_0x40a1('0x45')];this[_0x40a1('0x46')]=_0x1cb92a[_0x40a1('0x46')];this['dialAMDSilenceThreshold']=_0x1cb92a[_0x40a1('0x47')];this[_0x40a1('0x48')]=_0x1cb92a[_0x40a1('0x48')];this[_0x40a1('0x49')]=0x0;this['pTalking']=0x0;this['timeout']=_0x1cb92a['timeout'];this[_0x40a1('0x4a')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x40a1('0x4b')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x40a1('0x4c')]=0x0;this[_0x40a1('0x4d')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x40a1('0x4e')]=0x0;this[_0x40a1('0x4f')]=0x0;this[_0x40a1('0x50')]=0x0;this[_0x40a1('0x51')]=0x0;this[_0x40a1('0x52')]=undefined;this[_0x40a1('0x53')]=undefined;this[_0x40a1('0x54')]=undefined;this[_0x40a1('0x55')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x40a1('0x56')]=0x0;this[_0x40a1('0x57')]=0x0;this[_0x40a1('0x58')]=0x0;this[_0x40a1('0x59')]=0x0;this[_0x40a1('0x5a')]=0x0;this[_0x40a1('0x5b')]=0x0;this[_0x40a1('0x5c')]=0.4;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x40a1('0x5d')]=0x1;this[_0x40a1('0x5e')]=0x0;this[_0x40a1('0x5f')]=0x0;this[_0x40a1('0x60')]=0x0;this['erlangBusyFactor']=0x0;this[_0x40a1('0x61')]=_0x1cb92a[_0x40a1('0x61')]||0x1e;this[_0x40a1('0x62')]=_0x1cb92a[_0x40a1('0x62')]||![];this[_0x40a1('0x63')]=_0x1cb92a[_0x40a1('0x63')]||undefined;this[_0x40a1('0x64')]=_0x1cb92a[_0x40a1('0x64')]||![];this[_0x40a1('0x65')]=_0x1cb92a[_0x40a1('0x65')]||![];this[_0x40a1('0xc')]=monitorFormat[_0x1cb92a[_0x40a1('0xc')]]?monitorFormat[_0x1cb92a[_0x40a1('0xc')]]:undefined;this[_0x40a1('0x66')]=_0x1cb92a['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x1cb92a[_0x40a1('0x67')]?_0x1cb92a[_0x40a1('0x67')]:undefined;}module[_0x40a1('0x68')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 6978590..939d13d 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 _0x1ba3=['remoteUri','serverUrl','Configurations','exports','accessKey'];(function(_0x5dfab2,_0x1de692){var _0x56150b=function(_0x227de4){while(--_0x227de4){_0x5dfab2['push'](_0x5dfab2['shift']());}};_0x56150b(++_0x1de692);}(_0x1ba3,0x153));var _0x31ba=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0x1ba3[_0x289e64];return _0x30246c;};'use strict';function VtigerAccount(_0x2b015b){this['id']=_0x2b015b['id']||0x0;this['name']=_0x2b015b['name']||'';this['username']=_0x2b015b['username']||'';this[_0x31ba('0x0')]=_0x2b015b[_0x31ba('0x0')]||'';this[_0x31ba('0x1')]=_0x2b015b[_0x31ba('0x1')]||'';this[_0x31ba('0x2')]=_0x2b015b[_0x31ba('0x2')]||'';this['Configurations']=_0x2b015b[_0x31ba('0x3')]||{};}module[_0x31ba('0x4')]=VtigerAccount; \ No newline at end of file +var _0xd6f0=['username','accessKey','remoteUri','serverUrl','name'];(function(_0x4a7b6a,_0x46af7b){var _0x1e0d8e=function(_0x37378a){while(--_0x37378a){_0x4a7b6a['push'](_0x4a7b6a['shift']());}};_0x1e0d8e(++_0x46af7b);}(_0xd6f0,0x6d));var _0x0d6f=function(_0x2b271b,_0x47ab63){_0x2b271b=_0x2b271b-0x0;var _0x464860=_0xd6f0[_0x2b271b];return _0x464860;};'use strict';function VtigerAccount(_0x48ea57){this['id']=_0x48ea57['id']||0x0;this[_0x0d6f('0x0')]=_0x48ea57[_0x0d6f('0x0')]||'';this[_0x0d6f('0x1')]=_0x48ea57[_0x0d6f('0x1')]||'';this[_0x0d6f('0x2')]=_0x48ea57[_0x0d6f('0x2')]||'';this[_0x0d6f('0x3')]=_0x48ea57[_0x0d6f('0x3')]||'';this[_0x0d6f('0x4')]=_0x48ea57[_0x0d6f('0x4')]||'';this['Configurations']=_0x48ea57['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 0a0ba8f..5479bf0 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 _0x5ce9=['authType','type','integrationTab','serverUrl','exports','name','username','password','token','remoteUri'];(function(_0x1242e7,_0x452932){var _0x3b16ce=function(_0x3f6152){while(--_0x3f6152){_0x1242e7['push'](_0x1242e7['shift']());}};_0x3b16ce(++_0x452932);}(_0x5ce9,0x177));var _0x95ce=function(_0xa8858,_0xfdf8de){_0xa8858=_0xa8858-0x0;var _0x5de30d=_0x5ce9[_0xa8858];return _0x5de30d;};'use strict';function ZendeskAccount(_0x4f0b4e){this['id']=_0x4f0b4e['id']||0x0;this[_0x95ce('0x0')]=_0x4f0b4e['name']||'';this['username']=_0x4f0b4e[_0x95ce('0x1')]||'';this[_0x95ce('0x2')]=_0x4f0b4e['password']||'';this[_0x95ce('0x3')]=_0x4f0b4e[_0x95ce('0x3')]||'';this[_0x95ce('0x4')]=_0x4f0b4e[_0x95ce('0x4')]||'';this[_0x95ce('0x5')]=_0x4f0b4e[_0x95ce('0x5')]||'';this[_0x95ce('0x6')]=_0x4f0b4e[_0x95ce('0x6')]||_0x95ce('0x7');this[_0x95ce('0x8')]=_0x4f0b4e[_0x95ce('0x8')]||'';this['Configurations']=_0x4f0b4e['Configurations']||{};}module[_0x95ce('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xdf73=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name'];(function(_0x176404,_0x1c7a2a){var _0x557200=function(_0x41ee7d){while(--_0x41ee7d){_0x176404['push'](_0x176404['shift']());}};_0x557200(++_0x1c7a2a);}(_0xdf73,0x9f));var _0x3df7=function(_0x566c95,_0x2163c5){_0x566c95=_0x566c95-0x0;var _0x4aaa54=_0xdf73[_0x566c95];return _0x4aaa54;};'use strict';function ZendeskAccount(_0x17aa71){this['id']=_0x17aa71['id']||0x0;this[_0x3df7('0x0')]=_0x17aa71[_0x3df7('0x0')]||'';this[_0x3df7('0x1')]=_0x17aa71[_0x3df7('0x1')]||'';this[_0x3df7('0x2')]=_0x17aa71[_0x3df7('0x2')]||'';this['token']=_0x17aa71[_0x3df7('0x3')]||'';this[_0x3df7('0x4')]=_0x17aa71['remoteUri']||'';this[_0x3df7('0x5')]=_0x17aa71['authType']||'';this[_0x3df7('0x6')]=_0x17aa71[_0x3df7('0x6')]||_0x3df7('0x7');this[_0x3df7('0x8')]=_0x17aa71[_0x3df7('0x8')]||'';this[_0x3df7('0x9')]=_0x17aa71[_0x3df7('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index bdd68fa..6aac5a6 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 _0x4975=['serverUrl','exports','name','authToken','host','Configurations'];(function(_0x5a3085,_0x1f04ef){var _0x538282=function(_0x2d09b5){while(--_0x2d09b5){_0x5a3085['push'](_0x5a3085['shift']());}};_0x538282(++_0x1f04ef);}(_0x4975,0x86));var _0x5497=function(_0x1683c8,_0x6e591b){_0x1683c8=_0x1683c8-0x0;var _0x45f1b8=_0x4975[_0x1683c8];return _0x45f1b8;};'use strict';function ZohoAccount(_0x14a4b5){this['id']=_0x14a4b5['id']||0x0;this['name']=_0x14a4b5[_0x5497('0x0')]||'';this[_0x5497('0x1')]=_0x14a4b5[_0x5497('0x1')]||'';this[_0x5497('0x2')]=_0x14a4b5[_0x5497('0x2')]||'';this[_0x5497('0x3')]=_0x14a4b5[_0x5497('0x3')]||{};this[_0x5497('0x4')]=_0x14a4b5[_0x5497('0x4')]||'';}module[_0x5497('0x5')]=ZohoAccount; \ No newline at end of file +var _0xc1c6=['Configurations','exports','name','authToken','host'];(function(_0x43ed0e,_0x31e58a){var _0x205b34=function(_0x651172){while(--_0x651172){_0x43ed0e['push'](_0x43ed0e['shift']());}};_0x205b34(++_0x31e58a);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4dedbf,_0x577c92){_0x4dedbf=_0x4dedbf-0x0;var _0x5bed30=_0xc1c6[_0x4dedbf];return _0x5bed30;};'use strict';function ZohoAccount(_0xfb8a07){this['id']=_0xfb8a07['id']||0x0;this[_0x6c1c('0x0')]=_0xfb8a07[_0x6c1c('0x0')]||'';this['authToken']=_0xfb8a07[_0x6c1c('0x1')]||'';this['host']=_0xfb8a07[_0x6c1c('0x2')]||'';this[_0x6c1c('0x3')]=_0xfb8a07[_0x6c1c('0x3')]||{};this['serverUrl']=_0xfb8a07['serverUrl']||'';}module[_0x6c1c('0x4')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 6a34ae5..8a8c07b 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 _0x0c58=['recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','queue','dialAnswer','Agent','channelAgent','format','SIP/%s','membername','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat'];(function(_0x5b3e28,_0x2ad693){var _0x21a6f4=function(_0xea4216){while(--_0xea4216){_0x5b3e28['push'](_0x5b3e28['shift']());}};_0x21a6f4(++_0x2ad693);}(_0x0c58,0x152));var _0x80c5=function(_0x111f6c,_0xe54486){_0x111f6c=_0x111f6c-0x0;var _0x4c51af=_0x0c58[_0x111f6c];return _0x4c51af;};'use strict';var util=require(_0x80c5('0x0'));var _=require(_0x80c5('0x1'));var moment=require(_0x80c5('0x2'));function checkNameSurname(_0x196d2c,_0x50595a,_0x400b95){var _0x1d2703='';if(!_[_0x80c5('0x3')](_0x50595a)&&_0x80c5('0x4')===typeof _0x50595a){_0x1d2703+=_0x50595a;}if(!_[_0x80c5('0x3')](_0x400b95)&&_0x80c5('0x4')===typeof _0x400b95){_0x1d2703+='\x20'+_0x400b95;}if(_0x1d2703!==''){return _0x1d2703;}return _0x196d2c;}function Action(_0x5b5da9,_0x5d5919,_0x17dd09,_0x1685e3,_0x313fbd){this[_0x80c5('0x5')]=_0x17dd09||undefined;this[_0x80c5('0x6')]=_0x5b5da9['id'];this['queue']=_0x5d5919[_0x80c5('0x7')];this[_0x80c5('0x8')]=_0x5d5919[_0x80c5('0x8')];this['campaigntype']=_0x80c5('0x9');this[_0x80c5('0xa')]=![];this['membername']=_['isNil'](_0x5b5da9[_0x80c5('0xb')])?undefined:_0x5b5da9['Agent'][_0x80c5('0x7')];this[_0x80c5('0xc')]=this['membername']?util[_0x80c5('0xd')](_0x80c5('0xe'),this[_0x80c5('0xf')]):_0x1685e3||undefined;this[_0x80c5('0x10')]=checkNameSurname(_0x5b5da9[_0x80c5('0x11')]['phone'],_0x5b5da9[_0x80c5('0x11')][_0x80c5('0x12')],_0x5b5da9[_0x80c5('0x11')][_0x80c5('0x13')]);this[_0x80c5('0x14')]=_0x5b5da9['active']||![];this[_0x80c5('0x15')]=_0x5b5da9[_0x80c5('0x11')][_0x80c5('0x16')];this[_0x80c5('0x17')]=_0x5b5da9['scheduledat'];this[_0x80c5('0x18')]=_0x5b5da9[_0x80c5('0x18')]||0x0;this[_0x80c5('0x19')]=_0x5b5da9['countcongestionretry']||0x0;this[_0x80c5('0x1a')]=_0x5b5da9['countnoanswerretry']||0x0;this[_0x80c5('0x1b')]=(_0x5b5da9[_0x80c5('0x18')]||0x0)+(_0x5b5da9['countcongestionretry']||0x0)+(_0x5b5da9[_0x80c5('0x1a')]||0x0);this[_0x80c5('0x1c')]=_0x5b5da9[_0x80c5('0x1c')];this[_0x80c5('0x1d')]=_0x5b5da9[_0x80c5('0x1d')];this[_0x80c5('0x1e')]=_0x5b5da9[_0x80c5('0x1e')];this[_0x80c5('0x1f')]=_0x5b5da9[_0x80c5('0x1f')];this['ContactId']=_0x5b5da9[_0x80c5('0x20')];this[_0x80c5('0x21')]=_0x5b5da9[_0x80c5('0x21')];this['UserId']=_[_0x80c5('0x3')](_0x5b5da9[_0x80c5('0xb')])?_0x5b5da9[_0x80c5('0x22')]:_0x5b5da9['Agent']['id'];this[_0x80c5('0x23')]=_0x5b5da9[_0x80c5('0x23')];this[_0x80c5('0x24')]='';this[_0x80c5('0x25')]='';}Action['prototype'][_0x80c5('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x80c5('0x27')]);};module[_0x80c5('0x28')]=Action; \ No newline at end of file +var _0xffa6=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','isNil','string','uniqueid','queue','name','type','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum'];(function(_0x5c7155,_0x4ad7d4){var _0x3e8fcd=function(_0x51c5ee){while(--_0x51c5ee){_0x5c7155['push'](_0x5c7155['shift']());}};_0x3e8fcd(++_0x4ad7d4);}(_0xffa6,0x173));var _0x6ffa=function(_0x2322b7,_0x271d4a){_0x2322b7=_0x2322b7-0x0;var _0x9889e7=_0xffa6[_0x2322b7];return _0x9889e7;};'use strict';var util=require(_0x6ffa('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x48d9a1,_0x240c21,_0x11fd5c){var _0x2eb736='';if(!_[_0x6ffa('0x1')](_0x240c21)&&_0x6ffa('0x2')===typeof _0x240c21){_0x2eb736+=_0x240c21;}if(!_[_0x6ffa('0x1')](_0x11fd5c)&&'string'===typeof _0x11fd5c){_0x2eb736+='\x20'+_0x11fd5c;}if(_0x2eb736!==''){return _0x2eb736;}return _0x48d9a1;}function Action(_0x1bc164,_0x370543,_0x4d1e29,_0x1f69b4,_0xef0a1c){this[_0x6ffa('0x3')]=_0x4d1e29||undefined;this['idContact']=_0x1bc164['id'];this[_0x6ffa('0x4')]=_0x370543[_0x6ffa('0x5')];this[_0x6ffa('0x6')]=_0x370543['type'];this['campaigntype']=_0x6ffa('0x4');this[_0x6ffa('0x7')]=![];this['membername']=_['isNil'](_0x1bc164[_0x6ffa('0x8')])?undefined:_0x1bc164[_0x6ffa('0x8')][_0x6ffa('0x5')];this[_0x6ffa('0x9')]=this[_0x6ffa('0xa')]?util[_0x6ffa('0xb')](_0x6ffa('0xc'),this['membername']):_0x1f69b4||undefined;this['calleridname']=checkNameSurname(_0x1bc164[_0x6ffa('0xd')][_0x6ffa('0xe')],_0x1bc164[_0x6ffa('0xd')][_0x6ffa('0xf')],_0x1bc164['Contact'][_0x6ffa('0x10')]);this[_0x6ffa('0x11')]=_0x1bc164[_0x6ffa('0x11')]||![];this[_0x6ffa('0x12')]=_0x1bc164[_0x6ffa('0xd')][_0x6ffa('0xe')];this[_0x6ffa('0x13')]=_0x1bc164[_0x6ffa('0x13')];this[_0x6ffa('0x14')]=_0x1bc164['countbusyretry']||0x0;this['countcongestionretry']=_0x1bc164[_0x6ffa('0x15')]||0x0;this[_0x6ffa('0x16')]=_0x1bc164[_0x6ffa('0x16')]||0x0;this[_0x6ffa('0x17')]=(_0x1bc164[_0x6ffa('0x14')]||0x0)+(_0x1bc164[_0x6ffa('0x15')]||0x0)+(_0x1bc164['countnoanswerretry']||0x0);this[_0x6ffa('0x18')]=_0x1bc164[_0x6ffa('0x18')];this['callbackuniqueid']=_0x1bc164['callbackuniqueid'];this[_0x6ffa('0x19')]=_0x1bc164[_0x6ffa('0x19')];this[_0x6ffa('0x1a')]=_0x1bc164[_0x6ffa('0x1a')];this[_0x6ffa('0x1b')]=_0x1bc164['ContactId'];this[_0x6ffa('0x1c')]=_0x1bc164[_0x6ffa('0x1c')];this[_0x6ffa('0x1d')]=_[_0x6ffa('0x1')](_0x1bc164[_0x6ffa('0x8')])?_0x1bc164[_0x6ffa('0x1d')]:_0x1bc164[_0x6ffa('0x8')]['id'];this[_0x6ffa('0x1e')]=_0x1bc164['VoiceQueueId'];this[_0x6ffa('0x1f')]='';this[_0x6ffa('0x20')]='';}Action[_0x6ffa('0x21')][_0x6ffa('0x22')]=function(){return util[_0x6ffa('0xb')](_0x6ffa('0x23'),this[_0x6ffa('0x24')],this[_0x6ffa('0x25')]);};module[_0x6ffa('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 81fd229..10f6eef 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 _0xe917=['decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','getContactRecallMe','agentReadyId','length','getDiff','dialRecallMeTimeout','run','then','[RecallMe]','logger2','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','uniqueid','acw','custom:agentcomplete','buildObj','complete','Answer','[callProgressDetectingCustomer][logAnswer]','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','unlockAgent','NOANSWER','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','scheduledAt','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated','destlinkedid','object','createAgentHistory','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','isEmpty','execCall','emit','custom:agentcalled','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','unmonitored','execRun','unlock','disableContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','Action','variablesAction','[originated][increment]','\x20Queue','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','lookAgent','logLookAgent','clone','response','rejected','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','error','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','lodash','bluebird','uuid','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncBlindTransfer','loopCampaigns','type','name','strategy','answered','available','loggedIn','pTalking','sumHoldTime','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','Trunk','active','callerid','Interval','md5','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','outbound','setMessage','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','stringify','pick','contactId','UserId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe917,0x1e5));var _0x7e91=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xe917[_0xa6cc5c];return _0x44803d;};'use strict';var util=require('util');var _=require(_0x7e91('0x0'));var BPromise=require(_0x7e91('0x1'));var uuid=require(_0x7e91('0x2'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x7e91('0x3'));var config=require(_0x7e91('0x4'));var logger=require(_0x7e91('0x5'))(_0x7e91('0x6'));var loggerAction=require(_0x7e91('0x5'))(_0x7e91('0x7'));var ami=require(_0x7e91('0x8'));var rpcDb=require(_0x7e91('0x9'));var Action=require('./action');var ut=require(_0x7e91('0xa'));config[_0x7e91('0xb')]=_[_0x7e91('0xc')](config['redis'],{'host':_0x7e91('0xd'),'port':0x18eb});var io=require(_0x7e91('0xe'))(new Redis(config[_0x7e91('0xb')]));var Sequence=function(){};Sequence[_0x7e91('0xf')][_0x7e91('0x10')]=function(_0x1ef91b){this[_0x7e91('0x11')]=this['tail']?this[_0x7e91('0x11')][_0x7e91('0x12')](_0x1ef91b):_0x1ef91b();};function Preview(_0x58843e){this[_0x7e91('0x13')]=new Sequence();this[_0x7e91('0x14')]=_0x58843e['voiceQueues'];this[_0x7e91('0x15')]=_0x58843e[_0x7e91('0x15')];this[_0x7e91('0x16')]={};this[_0x7e91('0x17')]=_0x58843e['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x7e91('0x18'),this['syncOriginateResponse'][_0x7e91('0x19')](this));ami['on'](_0x7e91('0x1a'),this[_0x7e91('0x1b')]['bind'](this));ami['on'](_0x7e91('0x1c'),this[_0x7e91('0x1d')][_0x7e91('0x19')](this));ami['on'](_0x7e91('0x1e'),this[_0x7e91('0x1f')][_0x7e91('0x19')](this));ami['on'](_0x7e91('0x20'),this[_0x7e91('0x21')][_0x7e91('0x19')](this));ami['on'](_0x7e91('0x22'),this[_0x7e91('0x23')][_0x7e91('0x19')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7e91('0x19')](this));ami['on']('blindtransfer',this[_0x7e91('0x24')][_0x7e91('0x19')](this));this[_0x7e91('0x25')](this[_0x7e91('0x14')]);}function emit(_0x1f7dba,_0x469efc,_0xd625ac){io['to'](_0x1f7dba)['emit'](_0x469efc,_0xd625ac);}function emitCampaignPreview(_0x416a67){if(_0x416a67[_0x7e91('0x26')]==='outbound'){var _0xe446e9={'id':_0x416a67['id'],'name':_0x416a67[_0x7e91('0x27')],'strategy':_0x416a67[_0x7e91('0x28')],'answered':_0x416a67[_0x7e91('0x29')],'available':_0x416a67[_0x7e91('0x2a')],'loggedIn':_0x416a67[_0x7e91('0x2b')],'pTalking':_0x416a67[_0x7e91('0x2c')],'sumBillable':_0x416a67['sumBillable'],'sumDuration':_0x416a67['sumDuration'],'sumHoldTime':_0x416a67[_0x7e91('0x2d')]||0x0,'talking':_0x416a67['talking'],'total':_0x416a67[_0x7e91('0x2e')],'type':_0x416a67['type'],'unmanaged':_0x416a67[_0x7e91('0x2f')],'abandoned':_0x416a67['abandoned'],'waiting':_0x416a67[_0x7e91('0x30')],'loggedInDb':_0x416a67['loggedInDb'],'dialActive':_0x416a67[_0x7e91('0x31')],'dialMethod':_0x416a67[_0x7e91('0x32')],'dialOriginateCallerIdName':_0x416a67['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x416a67[_0x7e91('0x33')],'dialOriginateTimeout':_0x416a67[_0x7e91('0x34')],'dialPrefix':_0x416a67['dialPrefix'],'outboundAnswerAgiCallsDay':_0x416a67[_0x7e91('0x35')],'outboundAnswerCallsDay':_0x416a67[_0x7e91('0x36')],'outboundBlacklistCallsDay':_0x416a67[_0x7e91('0x37')],'outboundBusyCallsDay':_0x416a67['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x416a67[_0x7e91('0x38')],'outboundDropCallsDayACS':_0x416a67['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x416a67['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x416a67[_0x7e91('0x39')],'outboundNoAnswerCallsDay':_0x416a67[_0x7e91('0x3a')],'outboundNoSuchCallsDay':_0x416a67[_0x7e91('0x3b')],'outboundOriginateFailureCallsDay':_0x416a67[_0x7e91('0x3c')],'outboundReCallsDay':_0x416a67[_0x7e91('0x3d')],'outboundRejectCallsDay':_0x416a67['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x416a67[_0x7e91('0x3e')],'predictiveIntervalAnsweredCalls':_0x416a67[_0x7e91('0x3f')],'predictiveIntervalAvgHoldtime':_0x416a67['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x416a67[_0x7e91('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x416a67['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x416a67[_0x7e91('0x41')],'predictiveIntervalErlangCalls':_0x416a67['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x416a67[_0x7e91('0x42')],'predictiveIntervalHitRate':_0x416a67[_0x7e91('0x43')],'predictiveIntervalLowerLimit':_0x416a67[_0x7e91('0x44')],'predictiveIntervalMultiplicativeFactor':_0x416a67['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x416a67[_0x7e91('0x45')],'predictiveIntervalTotalCalls':_0x416a67[_0x7e91('0x46')],'message':_0x416a67[_0x7e91('0x47')],'originated':_0x416a67['originated']};if(_0x416a67[_0x7e91('0x48')]){_0xe446e9[_0x7e91('0x48')]={'id':_0x416a67[_0x7e91('0x48')]['id'],'name':_0x416a67[_0x7e91('0x48')][_0x7e91('0x27')],'active':_0x416a67[_0x7e91('0x48')][_0x7e91('0x49')],'callerid':_0x416a67['Trunk'][_0x7e91('0x4a')]};}if(_0x416a67[_0x7e91('0x4b')]){_0xe446e9['Interval']={'id':_0x416a67['Interval']['id'],'name':_0x416a67[_0x7e91('0x4b')][_0x7e91('0x27')]};}var _0x5de3aa=md5(JSON['stringify'](_0xe446e9));if(_0x416a67[_0x7e91('0x4c')]!==_0x5de3aa){_0x416a67[_0x7e91('0x4c')]=_0x5de3aa;emit(util[_0x7e91('0x4d')](_0x7e91('0x4e'),_0xe446e9[_0x7e91('0x27')]),_0x7e91('0x4f'),_0xe446e9);}}}function emitVoiceQueueChannelRemove(_0x342016){emit(util[_0x7e91('0x4d')](_0x7e91('0x4e'),_0x342016[_0x7e91('0x27')]),_0x7e91('0x50'),_0x342016);}function notSendMessagesQueue(_0x1912ec){if(_0x1912ec[_0x7e91('0x51')]){if(_0x1912ec['originated']===0x0&&_0x1912ec['pTalking']===0x0){_0x1912ec['sendMessageOneNotActive']=![];_0x1912ec[_0x7e91('0x2a')]=0x0;_0x1912ec[_0x7e91('0x52')]=0x0;_0x1912ec[_0x7e91('0x47')]=_0x7e91('0x53');ut[_0x7e91('0x54')](_0x7e91('0x55'),_0x1912ec['name']+_0x7e91('0x56'));}else{_0x1912ec[_0x7e91('0x47')]=_0x7e91('0x57');ut[_0x7e91('0x54')](_0x7e91('0x55'),_0x1912ec[_0x7e91('0x27')]+_0x7e91('0x58'));}emitCampaignPreview(_0x1912ec);}}Preview['prototype'][_0x7e91('0x25')]=function(){var _0x197af4=this;setInterval(function(){_0x197af4[_0x7e91('0x59')]();},0x7cf);};Preview['prototype'][_0x7e91('0x59')]=function(){var _0x4fc5af=this[_0x7e91('0x14')];this[_0x7e91('0x5a')]+=0x1;for(var _0x324f6f in _0x4fc5af){if(_0x4fc5af[_0x7e91('0x5b')](_0x324f6f)&&(_0x4fc5af[_0x324f6f][_0x7e91('0x32')]===_0x7e91('0x6')||_0x4fc5af[_0x324f6f][_0x7e91('0x32')]==='booked')&&_0x4fc5af[_0x324f6f][_0x7e91('0x26')]==='outbound'){if(this[_0x7e91('0x5a')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x4fc5af['hasOwnProperty'](_0x324f6f)&&_0x4fc5af[_0x324f6f][_0x7e91('0x32')]===_0x7e91('0x6')&&_0x4fc5af[_0x324f6f]['type']===_0x7e91('0x5c')){if(_0x4fc5af[_0x324f6f][_0x7e91('0x31')]){this[_0x7e91('0x5d')](_0x4fc5af[_0x324f6f]);this[_0x7e91('0x5e')](_0x4fc5af[_0x324f6f]);}else{notSendMessagesQueue(_0x4fc5af[_0x324f6f]);}}}};Preview[_0x7e91('0xf')][_0x7e91('0x5f')]=function(_0x2fc372){var _0x5b8a20=this;this['sequence'][_0x7e91('0x10')](function(){if(!_[_0x7e91('0x60')](_0x5b8a20[_0x7e91('0x16')][_0x2fc372])){loggerAction[_0x7e91('0x61')](_0x7e91('0x62'),_0x2fc372,'Queue',_0x5b8a20[_0x7e91('0x16')][_0x2fc372][_0x7e91('0x63')],_0x7e91('0x64'),JSON['stringify'](_0x5b8a20['campaignsPreview'][_0x5b8a20[_0x7e91('0x16')][_0x2fc372][_0x7e91('0x63')]]['originated']),_0x7e91('0x65'),JSON[_0x7e91('0x66')](_0x5b8a20[_0x7e91('0x14')][_0x5b8a20[_0x7e91('0x16')][_0x2fc372]['queue']][_0x7e91('0x2c')]),JSON[_0x7e91('0x66')](_0x5b8a20[_0x7e91('0x16')][_0x2fc372]['dialAnswer']),JSON[_0x7e91('0x66')](_[_0x7e91('0x67')](_0x5b8a20[_0x7e91('0x16')][_0x2fc372],[_0x7e91('0x68'),_0x7e91('0x69'),'VoiceQueueId',_0x7e91('0x6a')])));return ami['Action']({'action':'status','channel':_0x5b8a20[_0x7e91('0x16')][_0x2fc372][_0x7e91('0x6b')]})[_0x7e91('0x6c')](function(_0xb7df05){if(_0xb7df05[_0x7e91('0x47')]===_0x7e91('0x6d')){setTimeout(function(){if(_0x5b8a20[_0x7e91('0x16')][_0x2fc372]){ut[_0x7e91('0x6e')](_0x5b8a20['campaignsPreview'][_0x5b8a20[_0x7e91('0x16')][_0x2fc372][_0x7e91('0x63')]],_0x7e91('0x6f'));if(_0x5b8a20[_0x7e91('0x16')][_0x2fc372][_0x7e91('0x70')]===!![]){ut[_0x7e91('0x71')](_0x5b8a20['campaignsPreview'][_0x5b8a20[_0x7e91('0x16')][_0x2fc372][_0x7e91('0x63')]],_0x7e91('0x6f'));ut[_0x7e91('0x72')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2fc372,_0x5b8a20[_0x7e91('0x16')][_0x2fc372][_0x7e91('0x63')]);}ut[_0x7e91('0x72')](_0x7e91('0x73')+_0x2fc372,_0x5b8a20['actions'][_0x2fc372][_0x7e91('0x63')]);delete _0x5b8a20[_0x7e91('0x16')][_0x2fc372];}},0x2328);}});}});};Preview[_0x7e91('0xf')][_0x7e91('0x74')]=function(){var _0x5eee4b=this;loggerAction['info'](_0x7e91('0x75'),_['size'](this['actions']));for(var _0x15a84b in this[_0x7e91('0x16')]){if(_0x5eee4b['actions']['hasOwnProperty'](_0x15a84b)){_0x5eee4b['clearZombieChannel'](_0x15a84b);}}};Preview[_0x7e91('0xf')]['recallMe']=function(_0x39a270){var _0x593809=this;rpcDb[_0x7e91('0x76')](_0x39a270['id'],ut[_0x7e91('0x77')](this['agents']))['then'](function(_0x29b71c){if(!_['isNil'](_0x29b71c)){for(var _0x510c6c=0x0;_0x510c6c<_0x29b71c[_0x7e91('0x78')];_0x510c6c+=0x1){if(ut[_0x7e91('0x79')](_0x29b71c[_0x510c6c]['scheduledat'])<_0x39a270[_0x7e91('0x7a')]*0x3c){_0x593809[_0x7e91('0x7b')](_0x29b71c[_0x510c6c]['id'])[_0x7e91('0x7c')](ut['logger2'](_0x7e91('0x7d')))['catch'](ut[_0x7e91('0x7e')](_0x7e91('0x7d')));}else{var _0x51a21b=new Action(_0x29b71c[_0x510c6c],_0x39a270);_0x51a21b[_0x7e91('0x7f')]=moment()[_0x7e91('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x39a270[_0x7e91('0x3d')]+=0x1;ut[_0x7e91('0x80')](_0x51a21b,0x17,_0x7e91('0x81'));if(_0x39a270[_0x7e91('0x82')]){rpcDb[_0x7e91('0x83')](ut[_0x7e91('0x84')](_0x29b71c[_0x510c6c]));rpcDb[_0x7e91('0x85')](_0x51a21b,_0x7e91('0x86'));}else{ut[_0x7e91('0x80')](_0x51a21b,0x16,_0x7e91('0x87'));rpcDb[_0x7e91('0x85')](_0x51a21b,_0x7e91('0x88'));rpcDb[_0x7e91('0x89')](_0x51a21b,'[HistoryRecallClose]');}}}}})[_0x7e91('0x6c')](ut[_0x7e91('0x7e')](_0x7e91('0x8a')));};Preview[_0x7e91('0xf')]['setMessage']=function(_0x4d376c){_0x4d376c[_0x7e91('0x51')]=!![];if(ut[_0x7e91('0x8b')](_0x4d376c[_0x7e91('0x2b')])){_0x4d376c['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x7e91('0x8c')](_0x4d376c['dialActive'])){_0x4d376c['message']='NOT_ACTIVE';}else if(!this[_0x7e91('0x8d')](_0x4d376c[_0x7e91('0x48')])){if(!this[_0x7e91('0x8d')](_0x4d376c[_0x7e91('0x8e')])){_0x4d376c[_0x7e91('0x47')]=_0x7e91('0x8f');}else{_0x4d376c['message']=_0x7e91('0x90');}}else{_0x4d376c[_0x7e91('0x47')]=_0x7e91('0x90');}emitCampaignPreview(_0x4d376c);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x28272a,_0x9c92b4,_0x4a7e5b){var _0x26f220=this;var _0x47e91f=this[_0x7e91('0x16')][_0x9c92b4];var _0xb93914=this[_0x7e91('0x14')][_0x47e91f[_0x7e91('0x63')]];var _0x6e6a21;if(_0xb93914){switch(_0x4a7e5b){case'1':_0xb93914[_0x7e91('0x3b')]+=0x1;_0x47e91f[_0x7e91('0x91')]=ut[_0x7e91('0x92')](_0x47e91f);ut[_0x7e91('0x80')](_0x47e91f,0x0,_0x7e91('0x93'));rpcDb[_0x7e91('0x85')](_0x47e91f,_0x7e91('0x94'));if(ut['totalGlobal'](_0x47e91f)>=_0xb93914['dialGlobalMaxRetry']){_0x6e6a21=ut[_0x7e91('0x95')](_0x47e91f,0xf,_0x7e91('0x96'));rpcDb[_0x7e91('0x89')](_0x6e6a21,_0x7e91('0x97'));}else{rpcDb['createCustomerFinal'](_0x47e91f,_0x7e91('0x97'));}delete this[_0x7e91('0x16')][_0x28272a[_0x7e91('0x98')]];break;case _0x7e91('0x99'):var _0x35f7f8=moment()[_0x7e91('0x4d')](_0x7e91('0x9a'));_0x47e91f[_0x7e91('0x9b')]=_0x35f7f8;_0x47e91f[_0x7e91('0x9c')]=_0x35f7f8;_0x47e91f[_0x7e91('0x70')]=!![];_0xb93914['pTalking']+=0x1;logger[_0x7e91('0x61')]('[syncHangup][talking][increment]',_0x47e91f[_0x7e91('0x9d')],'\x20Queue',_0xb93914[_0x7e91('0x27')],'pTalking:\x20',_0xb93914[_0x7e91('0x2c')]);ami['emit']('custom:agentconnect',ut['buildObj'](_0x47e91f,'connect'));if(_0xb93914[_0x7e91('0x9e')]){ami['emit']('custom:agentConnectPreview',ut['buildAcw'](_0x47e91f));}break;case'16':ami['emit'](_0x7e91('0x9f'),ut[_0x7e91('0xa0')](_0x47e91f,_0x7e91('0xa1')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x47e91f,_0x7e91('0xa1')));_0xb93914[_0x7e91('0x36')]+=0x1;_0xb93914['total']+=0x1;_0xb93914[_0x7e91('0x29')]+=0x1;ut['decrementTalkink'](_0xb93914,'[16]');_0x47e91f[_0x7e91('0x91')]=ut[_0x7e91('0x92')](_0x47e91f);ut['logCustomer'](_0x47e91f,0x4,_0x7e91('0xa2'));rpcDb[_0x7e91('0x85')](_0x47e91f,_0x7e91('0xa3'));rpcDb['createCustomerFinal'](_0x47e91f,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x47e91f);_0xb93914[_0x7e91('0xa4')]+=_0x47e91f['talktime'];_0xb93914[_0x7e91('0xa5')]+=_0x47e91f[_0x7e91('0xa6')];logger[_0x7e91('0x61')](_0x7e91('0xa7'),_0x47e91f[_0x7e91('0x9d')],'\x20Queue',_0xb93914[_0x7e91('0x27')],'pTalking:\x20',_0xb93914[_0x7e91('0x2c')]);delete this[_0x7e91('0x16')][_0x28272a[_0x7e91('0x98')]];break;case _0x7e91('0xa8'):_0xb93914[_0x7e91('0xa9')]+=0x1;_0x47e91f[_0x7e91('0xaa')]+=0x1;_0x47e91f[_0x7e91('0x91')]=ut[_0x7e91('0x92')](_0x47e91f);ut[_0x7e91('0x80')](_0x47e91f,0x5,_0x7e91('0xab'));rpcDb[_0x7e91('0x85')](_0x47e91f,_0x7e91('0xac'));if(ut[_0x7e91('0x92')](_0x47e91f)>=_0xb93914[_0x7e91('0xad')]){_0x6e6a21=ut[_0x7e91('0x95')](_0x47e91f,0xf,_0x7e91('0x96'));rpcDb[_0x7e91('0x89')](_0x6e6a21,_0x7e91('0xae'));}else{if(_0x47e91f['countbusyretry']>=_0xb93914[_0x7e91('0xaf')]){rpcDb[_0x7e91('0x89')](_0x47e91f,_0x7e91('0xac'));}else{rpcDb[_0x7e91('0xb0')](ut['scheduledAt'](_0x47e91f,'countbusyretry',_0xb93914[_0x7e91('0xb1')]),_0x47e91f[_0x7e91('0xb2')],_0x47e91f['activeContact']);}}break;case _0x7e91('0xb3'):_0xb93914[_0x7e91('0x3a')]+=0x1;_0x47e91f['countnoanswerretry']+=0x1;_0x47e91f[_0x7e91('0x91')]=ut[_0x7e91('0x92')](_0x47e91f);ut['logCustomer'](_0x47e91f,0x3,_0x7e91('0xb4'));rpcDb['createCustomerHistory'](_0x47e91f,_0x7e91('0xb5'));if(ut['totalGlobal'](_0x47e91f)>=_0xb93914['dialGlobalMaxRetry']){_0x6e6a21=ut[_0x7e91('0x95')](_0x47e91f,0xf,'Global');rpcDb[_0x7e91('0x89')](_0x6e6a21,_0x7e91('0xb6'));}else{if(_0x47e91f[_0x7e91('0xb7')]>=_0xb93914[_0x7e91('0xb8')]){rpcDb[_0x7e91('0x89')](_0x47e91f,_0x7e91('0xb5'));}else{rpcDb[_0x7e91('0xb0')](ut['scheduledAt'](_0x47e91f,_0x7e91('0xb7'),_0xb93914[_0x7e91('0xb9')]),_0x47e91f['unlockAgent'],_0x47e91f[_0x7e91('0xba')]);}}break;case _0x7e91('0xbb'):_0xb93914[_0x7e91('0x38')]+=0x1;_0x47e91f[_0x7e91('0xbc')]+=0x1;_0x47e91f[_0x7e91('0x91')]=ut['totalGlobal'](_0x47e91f);ut[_0x7e91('0x80')](_0x47e91f,0x8,_0x7e91('0xbd'));rpcDb['createCustomerHistory'](_0x47e91f,_0x7e91('0xbe'));if(ut[_0x7e91('0x92')](_0x47e91f)>=_0xb93914[_0x7e91('0xad')]){_0x6e6a21=ut[_0x7e91('0x95')](_0x47e91f,0xf,_0x7e91('0x96'));rpcDb[_0x7e91('0x89')](_0x6e6a21,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x47e91f[_0x7e91('0xbc')]>=_0xb93914[_0x7e91('0xbf')]){rpcDb[_0x7e91('0x89')](_0x47e91f,_0x7e91('0xbe'));}else{rpcDb[_0x7e91('0xb0')](ut[_0x7e91('0xc0')](_0x47e91f,'countcongestionretry',_0xb93914[_0x7e91('0xb1')]),_0x47e91f[_0x7e91('0xb2')],_0x47e91f['activeContact']);}}break;case _0x7e91('0xc1'):_0xb93914['outboundRejectCallsDay']+=0x1;_0x47e91f[_0x7e91('0x91')]=ut['totalGlobal'](_0x47e91f);ut[_0x7e91('0x80')](_0x47e91f,0x14,_0x7e91('0xc2'));rpcDb['createCustomerHistory'](_0x47e91f,_0x7e91('0xc3'));if(_0x47e91f[_0x7e91('0xb2')]){rpcDb[_0x7e91('0xc4')](_0x47e91f[_0x7e91('0xc5')]);}if(_0x47e91f['activeContact']){rpcDb['disableContact'](_0x47e91f[_0x7e91('0xc5')]);}break;default:if(_0x47e91f[_0x7e91('0x70')]){ut[_0x7e91('0x71')](_0xb93914,'[default]');ut[_0x7e91('0x72')](_0x7e91('0xc6')+_0xb93914['name'],_0x28272a);}_0xb93914['outboundUnknownCallsDay']+=0x1;_0x47e91f[_0x7e91('0x91')]=ut[_0x7e91('0x92')](_0x47e91f);ut[_0x7e91('0x80')](_0x47e91f,0xc,_0x28272a[_0x7e91('0xc7')]||_0x28272a[_0x7e91('0xc8')]);rpcDb[_0x7e91('0x85')](_0x47e91f,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x7e91('0x92')](_0x47e91f)>=_0xb93914[_0x7e91('0xad')]){_0x6e6a21=ut[_0x7e91('0x95')](_0x47e91f,0xf,'Global');rpcDb['createCustomerFinal'](_0x6e6a21,_0x7e91('0xc9'));}else{rpcDb['createCustomerFinal'](_0x47e91f,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x28272a[_0x7e91('0x98')]];}if(!(_0x47e91f[_0x7e91('0x70')]&&_0x4a7e5b==='16')){ut[_0x7e91('0x6e')](_0xb93914,'[callProgressDetectingCustomer]');logger[_0x7e91('0x61')](_0x7e91('0xca'),_0x47e91f[_0x7e91('0x9d')],'\x20Queue',_0xb93914['name'],_0x7e91('0x64'),_0xb93914[_0x7e91('0xcb')]);}if(_0x4a7e5b!=='ANSWER'){delete this[_0x7e91('0x16')][_0x28272a[_0x7e91('0x98')]];delete this['actions'][_0x28272a[_0x7e91('0xcc')]];}}};Preview[_0x7e91('0xf')]['callProgressDetectingAgent']=function(_0x25354c,_0x3e9692,_0x304394){if(_['isUndefined'](_0x3e9692)&&_0x7e91('0xcd')!==typeof _0x3e9692){return;}if(_['isUndefined'](_0x304394)&&_0x7e91('0xcd')!==typeof _0x304394){return;}switch(_0x304394['reason']){case'0':ut['logAgent'](_0x25354c,0x0,_0x7e91('0x93'));rpcDb[_0x7e91('0xce')](_0x25354c,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x7e91('0xcf')](_0x25354c,0x3,_0x7e91('0xb4'));rpcDb['createAgentHistory'](_0x25354c,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x7e91('0xcf')](_0x25354c,0x5,_0x7e91('0xab'));rpcDb['createAgentHistory'](_0x25354c,_0x7e91('0xd0'));break;case'8':ut[_0x7e91('0xcf')](_0x25354c,0x8,_0x7e91('0xbd'));rpcDb[_0x7e91('0xce')](_0x25354c,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x7e91('0xcf')](_0x25354c,0x16,'AnswerAGI');rpcDb[_0x7e91('0xce')](_0x25354c,_0x7e91('0xd1'));break;default:ut[_0x7e91('0xcf')](_0x25354c,0xc,_0x304394[_0x7e91('0xd2')]);rpcDb['createAgentHistory'](_0x25354c,'[callProgressDetectingAgent][logCongestion]');}ut[_0x7e91('0x6e')](_0x3e9692,_0x7e91('0xd3'));logger['info'](_0x7e91('0xd4'),_0x25354c['uniqueid'],'\x20Queue',_0x3e9692['name'],_0x7e91('0x64'),_0x3e9692['originated']);delete this[_0x7e91('0x16')][_0x25354c[_0x7e91('0x9d')]];};Preview[_0x7e91('0xf')][_0x7e91('0xd5')]=function(_0x55bacb,_0x1c63b2,_0x47369a,_0x18af23,_0x39b440){var _0x43dcd3=this;return new BPromise(function(_0x56b141,_0x45a852){if(_[_0x7e91('0x60')](_0x1c63b2)||_['isNil'](_0x1c63b2[_0x7e91('0xd6')])||_[_0x7e91('0x60')](_0x1c63b2[_0x7e91('0xd6')][_0x7e91('0xd7')])||_['isNil'](_0x1c63b2[_0x7e91('0xd8')])){_0x45a852(ut[_0x7e91('0x47')](_0x7e91('0xd9'),_0x18af23,_0x39b440));return;}var _0x174c76=uuid['v4']();var _0x1b7742=_0x43dcd3['campaignsPreview'][_0x1c63b2[_0x7e91('0xda')]['name']];var _0x1d41aa=_0x47369a?_0x43dcd3[_0x7e91('0x17')][_0x47369a]['id']:undefined;_0x43dcd3[_0x7e91('0x16')][_0x174c76]=new Action(_0x1c63b2,_0x1b7742,_0x174c76,_0x47369a,_0x1d41aa);var _0x535f00=_0x43dcd3[_0x7e91('0x16')][_0x174c76];_0x535f00[_0x7e91('0xb2')]=_0x18af23;_0x535f00[_0x7e91('0xba')]=_0x39b440;_0x535f00['lookAgent']=_0x47369a;if(_[_0x7e91('0xdb')](_0x55bacb)){_0x43dcd3[_0x7e91('0xdc')](_0x535f00,_0x1b7742,_0x1c63b2,_0x47369a)[_0x7e91('0x7c')](function(_0x5c5a89){logger[_0x7e91('0x61')]('[Preview][execCall][success]','Queue:\x20'+_0x535f00[_0x7e91('0x63')]+'\x20IdHopper:\x20'+_0x535f00['idContact'],JSON[_0x7e91('0x66')](_0x5c5a89));ami[_0x7e91('0xdd')](_0x7e91('0xde'),ut[_0x7e91('0xa0')](_0x535f00,_0x7e91('0xdf')));_0x56b141(ut['message'](_0x7e91('0xe0')));})[_0x7e91('0x6c')](function(_0x2d873d){ut[_0x7e91('0x54')]('[Preview][execCall][failure]',_0x2d873d);_0x45a852(ut[_0x7e91('0x47')](_0x7e91('0xe1'),_0x18af23,_0x39b440));});}else{_0x1b7742[_0x7e91('0x37')]+=0x1;ut[_0x7e91('0xe2')](_0x535f00);rpcDb[_0x7e91('0xe3')](_0x535f00,_0x7e91('0xe4'));delete _0x43dcd3[_0x7e91('0x16')][_0x174c76];_0x45a852(ut['message'](_0x7e91('0xe5'),_0x18af23,_0x39b440));}});};Preview['prototype']['isTrunkReachable']=function(_0x14640a){return!_[_0x7e91('0x60')](_0x14640a)&&!_[_0x7e91('0x60')](_0x14640a[_0x7e91('0x27')])&&!_['isNil'](_0x14640a[_0x7e91('0x49')])&&_0x14640a[_0x7e91('0x49')]&&!_['isNil'](this[_0x7e91('0x15')][util[_0x7e91('0x4d')](_0x7e91('0xe6'),_0x14640a[_0x7e91('0x27')])])&&!_['isNil'](this['trunks'][util[_0x7e91('0x4d')](_0x7e91('0xe6'),_0x14640a[_0x7e91('0x27')])][_0x7e91('0xe7')])&&(this[_0x7e91('0x15')][util[_0x7e91('0x4d')]('SIP/%s',_0x14640a[_0x7e91('0x27')])][_0x7e91('0xe7')]==='reachable'||this[_0x7e91('0x15')][util[_0x7e91('0x4d')](_0x7e91('0xe6'),_0x14640a['name'])][_0x7e91('0xe7')]===_0x7e91('0xe8'));};Preview[_0x7e91('0xf')][_0x7e91('0x7b')]=function(_0x293d16,_0x2b17fb){var _0x15316b=this;return new BPromise(function(_0x55b08a,_0x22a1b8){_0x15316b[_0x7e91('0xe9')](_0x293d16,_0x2b17fb)['then'](function(_0xb25fcc){_0x55b08a(_['pick'](_0xb25fcc,[_0x7e91('0x47')]));})[_0x7e91('0x6c')](function(_0x5a85b7){if(_0x5a85b7[_0x7e91('0xea')]){rpcDb[_0x7e91('0xc4')](_0x293d16);}if(_0x5a85b7[_0x7e91('0x49')]){rpcDb[_0x7e91('0xeb')](_0x293d16);}_0x22a1b8(_[_0x7e91('0x67')](_0x5a85b7,['message']));});});};Preview[_0x7e91('0xf')][_0x7e91('0xe9')]=function(_0x363039,_0x1e0927){var _0x374613=this;return new BPromise(function(_0x4dbb00,_0x28f139){var _0x1e114d,_0x479b0f;rpcDb[_0x7e91('0xec')](_0x363039)[_0x7e91('0x7c')](function(_0x1d6a49){if(!_[_0x7e91('0x60')](_0x1d6a49[0x0])){_0x479b0f=_0x1d6a49[0x0][_0x7e91('0xed')]?![]:!![];_0x1e114d=_0x1d6a49[0x0][_0x7e91('0xed')]?!![]:![];_0x1e114d=_0x1e0927?!![]:_0x1e114d;}var _0x4f5a2c=_0x374613[_0x7e91('0xee')](_0x1d6a49);if(_0x4f5a2c['isValid']){rpcDb[_0x7e91('0xef')](_[_0x7e91('0x67')](_0x1d6a49[0x0],[_0x7e91('0xd8'),_0x7e91('0xf0')]))[_0x7e91('0x7c')](function(_0x21d7fc){_0x374613[_0x7e91('0xd5')](_0x21d7fc,_0x1d6a49[0x0],_0x1e0927,_0x479b0f,_0x1e114d)[_0x7e91('0x7c')](function(_0x66aebf){_0x4dbb00(_0x66aebf);})[_0x7e91('0x6c')](function(_0x576879){_0x28f139(_0x576879);});})[_0x7e91('0x6c')](function(_0x328dca){ut[_0x7e91('0x54')](_0x7e91('0xf1'),_0x328dca);_0x28f139(ut[_0x7e91('0x47')](_0x7e91('0xf2'),_0x479b0f,_0x1e114d));});}else{_0x28f139(ut['message'](_0x4f5a2c[_0x7e91('0x47')],_0x479b0f,_0x1e114d));}})[_0x7e91('0x6c')](function(_0x562150){ut[_0x7e91('0x54')]('[Preview][getContactPreview]',_0x562150);_0x28f139(ut[_0x7e91('0x47')](_0x7e91('0xf2'),![],!![]));});});};Preview[_0x7e91('0xf')][_0x7e91('0xee')]=function(_0x7aa4d0){if(_[_0x7e91('0x60')](_0x7aa4d0)||_[_0x7e91('0xdb')](_0x7aa4d0)||!_['isNil'](_0x7aa4d0[0x0][_0x7e91('0xf3')])&&_[_0x7e91('0x60')](_0x7aa4d0[0x0]['Agent']['name'])){ut[_0x7e91('0x54')](_0x7e91('0xf4'),_0x7aa4d0);return{'isValid':![],'message':'Empty\x20Contact'};}var _0xa8a919=this[_0x7e91('0x14')][_0x7aa4d0[0x0][_0x7e91('0xda')][_0x7e91('0x27')]];_0xa8a919[_0x7e91('0x47')]=_0x7e91('0x90');if(_[_0x7e91('0x60')](_0xa8a919)){ut[_0x7e91('0x54')](_0x7e91('0xf5'),_0xa8a919);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x7e91('0x8d')](_0xa8a919['Trunk'])){ut[_0x7e91('0x54')](_0x7e91('0xf6'),_0x7e91('0xf7')+_0xa8a919[_0x7e91('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x7e91('0x8d')](_0xa8a919['TrunkBackup'])){ut[_0x7e91('0x54')](_0x7e91('0xf6'),_0xa8a919[_0x7e91('0x27')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x7e91('0xf8')};}}if(!ut[_0x7e91('0x8c')](_0xa8a919[_0x7e91('0x31')])){ut[_0x7e91('0x54')](_0x7e91('0xf9'),_0xa8a919[_0x7e91('0x27')]+_0x7e91('0xfa'));return{'isValid':![],'message':_0x7e91('0xf7')+_0xa8a919[_0x7e91('0x27')]+_0x7e91('0xfa')};}return{'isValid':!![],'message':_0x7e91('0xfb')};};Preview['prototype']['execCall']=function(_0xe52fcc,_0xf865f8,_0x117c6e,_0x306be9){var _0x35ff68=this;return new BPromise(function(_0x578cb2,_0x3a16b9){var _0x5cdd5c=_0xe52fcc[_0x7e91('0x9d')];var _0xb0e341=_0x35ff68[_0x7e91('0x8d')](_0xf865f8[_0x7e91('0x48')])?util[_0x7e91('0x4d')]('SIP/%s/%s%s',_0xf865f8[_0x7e91('0x48')][_0x7e91('0x27')],_[_0x7e91('0x60')](_0xf865f8[_0x7e91('0xfc')])?'':_0xf865f8['dialPrefix'][_0x7e91('0xfd')]()||'',_0xf865f8['dialCutDigit']>0x0?_0x117c6e['Contact'][_0x7e91('0xd7')]['substring'](_0xf865f8[_0x7e91('0xfe')]):_0x117c6e[_0x7e91('0xd6')][_0x7e91('0xd7')]):util[_0x7e91('0x4d')](_0x7e91('0xff'),_[_0x7e91('0x60')](_0xf865f8[_0x7e91('0x8e')])?_0xf865f8[_0x7e91('0x48')][_0x7e91('0x27')]:_0xf865f8[_0x7e91('0x8e')][_0x7e91('0x27')],_[_0x7e91('0x60')](_0xf865f8['dialPrefix'])?'':_0xf865f8['dialPrefix']['trim']()||'',_0xf865f8[_0x7e91('0xfe')]>0x0?_0x117c6e[_0x7e91('0xd6')][_0x7e91('0xd7')][_0x7e91('0x100')](_0xf865f8[_0x7e91('0xfe')]):_0x117c6e['Contact'][_0x7e91('0xd7')]);var _0x1e56f1=_0x35ff68[_0x7e91('0x8d')](_0xf865f8[_0x7e91('0x48')])?ut[_0x7e91('0x101')](_0xf865f8['Trunk'][_0x7e91('0x4a')],_0xf865f8[_0x7e91('0x102')],_0xf865f8['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0xf865f8[_0x7e91('0x33')],_0xf865f8[_0x7e91('0x103')]):_0xf865f8[_0x7e91('0x33')]):ut[_0x7e91('0x101')](_[_0x7e91('0x60')](_0xf865f8[_0x7e91('0x8e')])?_0xf865f8['Trunk'][_0x7e91('0x4a')]:_0xf865f8[_0x7e91('0x8e')]['callerid'],_0xf865f8[_0x7e91('0x102')],_0xf865f8[_0x7e91('0x103')]>0x0?ut[_0x7e91('0x104')](_0xf865f8['dialOriginateCallerIdNumber'],_0xf865f8[_0x7e91('0x103')]):_0xf865f8[_0x7e91('0x33')]);if(_0x1e56f1){_0xe52fcc[_0x7e91('0x105')]=ut[_0x7e91('0x106')](_0x1e56f1);_0xe52fcc[_0x7e91('0x107')]=ut[_0x7e91('0x108')](_0x1e56f1);}var _0xa6febe=ut[_0x7e91('0x109')](_0xf865f8,_0x117c6e,_0xb0e341,_0x1e56f1,_0x5cdd5c,_0xe52fcc);_[_0x7e91('0x10a')](_0xe52fcc,ut[_0x7e91('0x10b')](_0xa6febe));_0xe52fcc[_0x7e91('0x7f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0x7e91('0x10c')](ut[_0x7e91('0x10d')](_0xe52fcc,_0xf865f8,_0xa6febe,_0xe52fcc[_0x7e91('0xba')],_0x306be9))[_0x7e91('0x7c')](function(_0x59437e){_0xf865f8[_0x7e91('0xcb')]+=0x1;logger[_0x7e91('0x61')](_0x7e91('0x10e'),_0x5cdd5c,_0x7e91('0x10f'),_0xf865f8[_0x7e91('0x27')],_0x7e91('0x64'),_0xf865f8[_0x7e91('0xcb')]);_0x578cb2(_0x59437e);})[_0x7e91('0x6c')](function(_0x41f12c){ut[_0x7e91('0xcf')](_0xe52fcc,0xe,'OriginateError');rpcDb['createAgentHistory'](_0xe52fcc,_0x7e91('0x110'));_0x3a16b9(_0x41f12c);});});};Preview[_0x7e91('0xf')][_0x7e91('0x21')]=function(_0x361de4){if(this[_0x7e91('0x16')][_0x361de4[_0x7e91('0x98')]]){this[_0x7e91('0x16')][_0x361de4[_0x7e91('0x98')]]['channel']=_0x361de4[_0x7e91('0x6b')];}};Preview[_0x7e91('0xf')][_0x7e91('0x111')]=function(_0x5ceeeb){var _0x419255=this;var _0x237a78=this['actions'][_0x5ceeeb[_0x7e91('0x112')]];if(_0x237a78){if(_0x237a78[_0x7e91('0x113')]&&this['agents'][_0x237a78[_0x7e91('0x113')]]){ut[_0x7e91('0x114')](_0x237a78,this[_0x7e91('0x17')][_0x237a78['lookAgent']][_0x7e91('0x27')],this[_0x7e91('0x17')][_0x237a78[_0x7e91('0x113')]]['id']);}var _0x1f7189=_[_0x7e91('0x115')](_0x237a78);_0x1f7189['responsetime']=moment()['format'](_0x7e91('0x9a'));var _0x38cf19=_0x419255[_0x7e91('0x14')][_0x237a78['queue']];if(ut['isFailure'](_0x5ceeeb[_0x7e91('0x116')])){if(_0x237a78[_0x7e91('0xb2')]){rpcDb[_0x7e91('0xc4')](_0x237a78[_0x7e91('0xc5')]);}if(_0x237a78['activeContact']){rpcDb[_0x7e91('0xeb')](_0x237a78['idContact']);}ami[_0x7e91('0xdd')]('custom:agentringnoanswer',ut[_0x7e91('0xa0')](_0x237a78,_0x7e91('0x117')));this['callProgressDetectingAgent'](_0x1f7189,_0x38cf19,_0x5ceeeb);}else{_0x237a78[_0x7e91('0x7f')]=moment()[_0x7e91('0x4d')](_0x7e91('0x9a'));ut[_0x7e91('0xcf')](_0x1f7189,0x4,_0x7e91('0xa2'));rpcDb[_0x7e91('0xce')](_0x1f7189,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x7e91('0xf')][_0x7e91('0x1b')]=function(_0x13eb00){var _0x1fdf14=this;var _0x2e06b5=this['actions'][_0x13eb00[_0x7e91('0x98')]];var _0x26f30b;if(_0x2e06b5){_0x26f30b=this[_0x7e91('0x14')][_0x2e06b5[_0x7e91('0x63')]];logger['info'](_0x7e91('0x118'),_0x13eb00[_0x7e91('0x98')],_0x7e91('0x10f'),_0x26f30b[_0x7e91('0x27')],'pTalking:\x20',_0x26f30b['pTalking']);}if(this[_0x7e91('0x16')][_0x13eb00[_0x7e91('0x98')]]&&_0x13eb00[_0x7e91('0x98')]!==_0x13eb00['uniqueid']){if(_0x13eb00[_0x7e91('0x119')]==='16'&&this[_0x7e91('0x16')][_0x13eb00[_0x7e91('0x98')]][_0x7e91('0x70')]){this[_0x7e91('0x11a')](_0x13eb00,_0x13eb00[_0x7e91('0x98')],_0x13eb00['cause']);}else if(this['actions'][_0x13eb00[_0x7e91('0x98')]][_0x7e91('0x70')]){logger['info'](_0x7e91('0x11b'),_0x13eb00['linkedid'],_0x13eb00[_0x7e91('0x119')],_0x7e91('0x10f'),_0x26f30b[_0x7e91('0x27')],'pTalking:\x20',_0x26f30b[_0x7e91('0x2c')]);this[_0x7e91('0x11a')](_0x13eb00,_0x13eb00[_0x7e91('0x98')],_0x13eb00['cause']);}}else if(_0x2e06b5&&_[_0x7e91('0x60')](_0x2e06b5['statedesc'])&&_0x26f30b[_0x7e91('0x11c')]&&_0x13eb00[_0x7e91('0x98')]===_0x13eb00[_0x7e91('0x9d')]&&_['isNil'](_0x13eb00[_0x7e91('0xd2')])&&_0x13eb00[_0x7e91('0x119')]==='16'&&_0x13eb00[_0x7e91('0x11d')]==='6'&&_['isUndefined'](_0x2e06b5[_0x7e91('0x11e')])){if(_0x2e06b5['unlockAgent']){rpcDb[_0x7e91('0xc4')](_0x2e06b5[_0x7e91('0xc5')]);}if(_0x2e06b5[_0x7e91('0xba')]){rpcDb[_0x7e91('0xeb')](_0x2e06b5[_0x7e91('0xc5')]);}_0x13eb00[_0x7e91('0xd2')]='22';this[_0x7e91('0x11f')](_0x2e06b5,_0x26f30b,_0x13eb00);}else if(_0x2e06b5&&_0x2e06b5[_0x7e91('0x11e')]){if(_0x13eb00['cause']==='16'&&this[_0x7e91('0x16')][_0x13eb00[_0x7e91('0x98')]]['dialAnswer']){logger[_0x7e91('0x61')](_0x7e91('0x120'),_0x13eb00[_0x7e91('0x98')],_0x13eb00[_0x7e91('0x119')],_0x7e91('0x10f'),_0x26f30b[_0x7e91('0x27')],_0x7e91('0x65'),_0x26f30b[_0x7e91('0x2c')]);this[_0x7e91('0x11a')](_0x13eb00,_0x13eb00['linkedid'],_0x13eb00['cause']);}else if(this[_0x7e91('0x16')][_0x13eb00[_0x7e91('0x98')]]['dialAnswer']){logger[_0x7e91('0x61')](_0x7e91('0x11b'),_0x13eb00[_0x7e91('0x98')],_0x13eb00['cause'],_0x7e91('0x10f'),_0x26f30b[_0x7e91('0x27')],'pTalking:\x20',_0x26f30b[_0x7e91('0x2c')]);this[_0x7e91('0x11a')](_0x13eb00,_0x13eb00['linkedid'],_0x13eb00[_0x7e91('0x119')]);}}};Preview[_0x7e91('0xf')][_0x7e91('0x1f')]=function(_0x37fef8){if(this['actions'][_0x37fef8['destlinkedid']]&&_0x37fef8[_0x7e91('0xcc')]!==_0x37fef8[_0x7e91('0x121')]){this['callProgressDetectingCustomer'](_0x37fef8,_0x37fef8[_0x7e91('0xcc')],_0x37fef8['dialstatus']);}};Preview[_0x7e91('0xf')][_0x7e91('0x1d')]=function(_0x525338){if(this['actions'][_0x525338[_0x7e91('0x98')]]&&_0x525338[_0x7e91('0x98')]!==_0x525338[_0x7e91('0x9d')]&&!this['actions'][_0x525338['linkedid']][_0x7e91('0x70')]){if(_0x525338[_0x7e91('0x119')]==='1'){this[_0x7e91('0x11a')](_0x525338,_0x525338[_0x7e91('0x98')],_0x525338[_0x7e91('0x119')]);}}};Preview[_0x7e91('0xf')][_0x7e91('0x122')]=function(_0xafa100,_0x1ff8be,_0x25767c){if(this['actions'][_0xafa100]){if(_[_0x7e91('0x60')](this[_0x7e91('0x16')][_0xafa100]['variables'])){this[_0x7e91('0x16')][_0xafa100][_0x7e91('0x123')]={};}this['actions'][_0xafa100][_0x7e91('0x123')][_0x1ff8be]=_0x25767c;}};Preview[_0x7e91('0xf')][_0x7e91('0x23')]=function(_0x354c8b){try{if(!_[_0x7e91('0x60')](_0x354c8b)){if(ut[_0x7e91('0x124')](_['keys'](_0x354c8b['variable'])[0x0])){this['addVariable'](_0x354c8b[_0x7e91('0x9d')],_['keys'](_0x354c8b[_0x7e91('0x125')])[0x0],_0x354c8b['value']);}}}catch(_0x721112){logger[_0x7e91('0x126')]('[syncVarSet][Preview]',util[_0x7e91('0x127')](_0x721112,{'showHidden':![],'depth':null}));}};Preview[_0x7e91('0xf')][_0x7e91('0x128')]=function(_0x5e275c){if(_0x5e275c){if(this[_0x7e91('0x16')][_0x5e275c[_0x7e91('0x129')]]){this[_0x7e91('0x16')][_0x5e275c['transfertargetlinkedid']][_0x7e91('0x11e')]=!![];}}};Preview[_0x7e91('0xf')][_0x7e91('0x24')]=function(_0xd87c70){if(_0xd87c70){if(this[_0x7e91('0x16')][_0xd87c70[_0x7e91('0x12a')]]){this[_0x7e91('0x16')][_0xd87c70[_0x7e91('0x12a')]][_0x7e91('0x11e')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x9e5e=['unlockContact','disableContact','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','\x20IdHopper:\x20','called','Call\x20failed','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','run','unlock','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[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','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','[syncHangup][talking][cause]','cause','dialQueueProject','channelstate','transfer','destuniqueid','syncHangupRequest','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','dialend','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','originated','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','sendMessageOneNotActive','paused','message','NOT_ACTIVE','\x20is\x20not\x20active','IS_DISACTIVED','logger','syncCampaigns','hasOwnProperty','booked','clockClearZombieChannels','clearZombieChannels','setMessage','recallMe','isNil','info','[clearZombieChannels][talking]','Queue','actions','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','logCustomer','NoSuchNumber','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','buildObj','complete','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]'];(function(_0x4f067e,_0x406536){var _0x3930d1=function(_0x326249){while(--_0x326249){_0x4f067e['push'](_0x4f067e['shift']());}};_0x3930d1(++_0x406536);}(_0x9e5e,0x193));var _0xe9e5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9e5e[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0xe9e5('0x0'));var _=require(_0xe9e5('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var md5=require(_0xe9e5('0x2'));var Redis=require(_0xe9e5('0x3'));var config=require(_0xe9e5('0x4'));var logger=require(_0xe9e5('0x5'))(_0xe9e5('0x6'));var loggerAction=require(_0xe9e5('0x5'))(_0xe9e5('0x7'));var ami=require(_0xe9e5('0x8'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xe9e5('0x9'));config[_0xe9e5('0xa')]=_[_0xe9e5('0xb')](config[_0xe9e5('0xa')],{'host':_0xe9e5('0xc'),'port':0x18eb});var io=require(_0xe9e5('0xd'))(new Redis(config[_0xe9e5('0xa')]));var Sequence=function(){};Sequence[_0xe9e5('0xe')][_0xe9e5('0xf')]=function(_0x575a06){this['tail']=this[_0xe9e5('0x10')]?this[_0xe9e5('0x10')][_0xe9e5('0x11')](_0x575a06):_0x575a06();};function Preview(_0x4697a7){this[_0xe9e5('0x12')]=new Sequence();this[_0xe9e5('0x13')]=_0x4697a7[_0xe9e5('0x14')];this[_0xe9e5('0x15')]=_0x4697a7['trunks'];this['actions']={};this['agents']=_0x4697a7[_0xe9e5('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0xe9e5('0x17'),this[_0xe9e5('0x18')]['bind'](this));ami['on'](_0xe9e5('0x19'),this[_0xe9e5('0x1a')][_0xe9e5('0x1b')](this));ami['on'](_0xe9e5('0x1c'),this['syncHangupRequest'][_0xe9e5('0x1b')](this));ami['on'](_0xe9e5('0x1d'),this['syncDialEnd'][_0xe9e5('0x1b')](this));ami['on'](_0xe9e5('0x1e'),this[_0xe9e5('0x1f')][_0xe9e5('0x1b')](this));ami['on'](_0xe9e5('0x20'),this['syncVarSet'][_0xe9e5('0x1b')](this));ami['on'](_0xe9e5('0x21'),this[_0xe9e5('0x22')][_0xe9e5('0x1b')](this));ami['on'](_0xe9e5('0x23'),this[_0xe9e5('0x24')][_0xe9e5('0x1b')](this));this[_0xe9e5('0x25')](this['campaignsPreview']);}function emit(_0x31c04c,_0x49d5d1,_0x4fd9d9){io['to'](_0x31c04c)[_0xe9e5('0x26')](_0x49d5d1,_0x4fd9d9);}function emitCampaignPreview(_0xfdef14){if(_0xfdef14[_0xe9e5('0x27')]===_0xe9e5('0x28')){var _0x4a5298={'id':_0xfdef14['id'],'name':_0xfdef14[_0xe9e5('0x29')],'strategy':_0xfdef14[_0xe9e5('0x2a')],'answered':_0xfdef14['answered'],'available':_0xfdef14[_0xe9e5('0x2b')],'loggedIn':_0xfdef14['loggedIn'],'pTalking':_0xfdef14[_0xe9e5('0x2c')],'sumBillable':_0xfdef14[_0xe9e5('0x2d')],'sumDuration':_0xfdef14[_0xe9e5('0x2e')],'sumHoldTime':_0xfdef14[_0xe9e5('0x2f')]||0x0,'talking':_0xfdef14['talking'],'total':_0xfdef14[_0xe9e5('0x30')],'type':_0xfdef14[_0xe9e5('0x27')],'unmanaged':_0xfdef14[_0xe9e5('0x31')],'abandoned':_0xfdef14['abandoned'],'waiting':_0xfdef14[_0xe9e5('0x32')],'loggedInDb':_0xfdef14[_0xe9e5('0x33')],'dialActive':_0xfdef14[_0xe9e5('0x34')],'dialMethod':_0xfdef14[_0xe9e5('0x35')],'dialOriginateCallerIdName':_0xfdef14[_0xe9e5('0x36')],'dialOriginateCallerIdNumber':_0xfdef14['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xfdef14[_0xe9e5('0x37')],'dialPrefix':_0xfdef14[_0xe9e5('0x38')],'outboundAnswerAgiCallsDay':_0xfdef14[_0xe9e5('0x39')],'outboundAnswerCallsDay':_0xfdef14[_0xe9e5('0x3a')],'outboundBlacklistCallsDay':_0xfdef14[_0xe9e5('0x3b')],'outboundBusyCallsDay':_0xfdef14['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xfdef14['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0xfdef14[_0xe9e5('0x3c')],'outboundDropCallsDayCallersExit':_0xfdef14['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0xfdef14['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xfdef14['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xfdef14[_0xe9e5('0x3d')],'outboundOriginateFailureCallsDay':_0xfdef14[_0xe9e5('0x3e')],'outboundReCallsDay':_0xfdef14[_0xe9e5('0x3f')],'outboundRejectCallsDay':_0xfdef14[_0xe9e5('0x40')],'outboundUnknownCallsDay':_0xfdef14['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0xfdef14['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xfdef14[_0xe9e5('0x41')],'predictiveIntervalAvgTalktime':_0xfdef14[_0xe9e5('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0xfdef14[_0xe9e5('0x43')],'predictiveIntervalDroppedCallsTimeout':_0xfdef14[_0xe9e5('0x44')],'predictiveIntervalErlangCalls':_0xfdef14[_0xe9e5('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0xfdef14[_0xe9e5('0x46')],'predictiveIntervalHitRate':_0xfdef14[_0xe9e5('0x47')],'predictiveIntervalLowerLimit':_0xfdef14[_0xe9e5('0x48')],'predictiveIntervalMultiplicativeFactor':_0xfdef14['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xfdef14['predictiveIntervalPauses'],'predictiveIntervalTotalCalls':_0xfdef14['predictiveIntervalTotalCalls'],'message':_0xfdef14['message'],'originated':_0xfdef14[_0xe9e5('0x49')]};if(_0xfdef14['Trunk']){_0x4a5298[_0xe9e5('0x4a')]={'id':_0xfdef14[_0xe9e5('0x4a')]['id'],'name':_0xfdef14[_0xe9e5('0x4a')][_0xe9e5('0x29')],'active':_0xfdef14[_0xe9e5('0x4a')][_0xe9e5('0x4b')],'callerid':_0xfdef14['Trunk'][_0xe9e5('0x4c')]};}if(_0xfdef14['Interval']){_0x4a5298[_0xe9e5('0x4d')]={'id':_0xfdef14[_0xe9e5('0x4d')]['id'],'name':_0xfdef14['Interval']['name']};}var _0x445738=md5(JSON[_0xe9e5('0x4e')](_0x4a5298));if(_0xfdef14[_0xe9e5('0x2')]!==_0x445738){_0xfdef14['md5']=_0x445738;emit(util[_0xe9e5('0x4f')](_0xe9e5('0x50'),_0x4a5298['name']),_0xe9e5('0x51'),_0x4a5298);}}}function emitVoiceQueueChannelRemove(_0x527f6f){emit(util[_0xe9e5('0x4f')](_0xe9e5('0x50'),_0x527f6f['name']),'voice_queue_channel:remove',_0x527f6f);}function notSendMessagesQueue(_0x3244d1){if(_0x3244d1['sendMessageOneNotActive']){if(_0x3244d1[_0xe9e5('0x49')]===0x0&&_0x3244d1[_0xe9e5('0x2c')]===0x0){_0x3244d1[_0xe9e5('0x52')]=![];_0x3244d1[_0xe9e5('0x2b')]=0x0;_0x3244d1[_0xe9e5('0x53')]=0x0;_0x3244d1[_0xe9e5('0x54')]=_0xe9e5('0x55');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3244d1['name']+_0xe9e5('0x56'));}else{_0x3244d1[_0xe9e5('0x54')]=_0xe9e5('0x57');ut[_0xe9e5('0x58')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3244d1[_0xe9e5('0x29')]+'\x20is\x20disactive');}emitCampaignPreview(_0x3244d1);}}Preview[_0xe9e5('0xe')][_0xe9e5('0x25')]=function(){var _0x2c0a64=this;setInterval(function(){_0x2c0a64['syncCampaigns']();},0x7cf);};Preview['prototype'][_0xe9e5('0x59')]=function(){var _0x38c18b=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0xed2ad9 in _0x38c18b){if(_0x38c18b[_0xe9e5('0x5a')](_0xed2ad9)&&(_0x38c18b[_0xed2ad9]['dialMethod']==='preview'||_0x38c18b[_0xed2ad9][_0xe9e5('0x35')]===_0xe9e5('0x5b'))&&_0x38c18b[_0xed2ad9][_0xe9e5('0x27')]===_0xe9e5('0x28')){if(this[_0xe9e5('0x5c')]>0x7){this[_0xe9e5('0x5c')]=0x0;this[_0xe9e5('0x5d')]();}}if(_0x38c18b[_0xe9e5('0x5a')](_0xed2ad9)&&_0x38c18b[_0xed2ad9][_0xe9e5('0x35')]==='preview'&&_0x38c18b[_0xed2ad9]['type']==='outbound'){if(_0x38c18b[_0xed2ad9]['dialActive']){this[_0xe9e5('0x5e')](_0x38c18b[_0xed2ad9]);this[_0xe9e5('0x5f')](_0x38c18b[_0xed2ad9]);}else{notSendMessagesQueue(_0x38c18b[_0xed2ad9]);}}}};Preview[_0xe9e5('0xe')]['clearZombieChannel']=function(_0x35c1e8){var _0x2d3de5=this;this['sequence'][_0xe9e5('0xf')](function(){if(!_[_0xe9e5('0x60')](_0x2d3de5['actions'][_0x35c1e8])){loggerAction[_0xe9e5('0x61')](_0xe9e5('0x62'),_0x35c1e8,_0xe9e5('0x63'),_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8][_0xe9e5('0x65')],_0xe9e5('0x66'),JSON['stringify'](_0x2d3de5[_0xe9e5('0x13')][_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8][_0xe9e5('0x65')]]['originated']),_0xe9e5('0x67'),JSON[_0xe9e5('0x4e')](_0x2d3de5[_0xe9e5('0x13')][_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8][_0xe9e5('0x65')]][_0xe9e5('0x2c')]),JSON['stringify'](_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8][_0xe9e5('0x68')]),JSON[_0xe9e5('0x4e')](_[_0xe9e5('0x69')](_0x2d3de5['actions'][_0x35c1e8],['contactId',_0xe9e5('0x6a'),'VoiceQueueId','ListId'])));return ami[_0xe9e5('0x6b')]({'action':_0xe9e5('0x6c'),'channel':_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8][_0xe9e5('0x6d')]})[_0xe9e5('0x6e')](function(_0x25ea4e){if(_0x25ea4e[_0xe9e5('0x54')]===_0xe9e5('0x6f')){setTimeout(function(){if(_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8]){ut[_0xe9e5('0x70')](_0x2d3de5[_0xe9e5('0x13')][_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8][_0xe9e5('0x65')]],_0xe9e5('0x71'));if(_0x2d3de5['actions'][_0x35c1e8]['dialAnswer']===!![]){ut[_0xe9e5('0x72')](_0x2d3de5[_0xe9e5('0x13')][_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8][_0xe9e5('0x65')]],'[clearZombieChannel]');ut[_0xe9e5('0x73')](_0xe9e5('0x74')+_0x35c1e8,_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8]['queue']);}ut['loggerError'](_0xe9e5('0x75')+_0x35c1e8,_0x2d3de5[_0xe9e5('0x64')][_0x35c1e8][_0xe9e5('0x65')]);delete _0x2d3de5[_0xe9e5('0x64')][_0x35c1e8];}},0x2328);}});}});};Preview[_0xe9e5('0xe')]['clearZombieChannels']=function(){var _0x4515=this;loggerAction['info'](_0xe9e5('0x76'),_[_0xe9e5('0x77')](this[_0xe9e5('0x64')]));for(var _0x323982 in this[_0xe9e5('0x64')]){if(_0x4515[_0xe9e5('0x64')][_0xe9e5('0x5a')](_0x323982)){_0x4515['clearZombieChannel'](_0x323982);}}};Preview[_0xe9e5('0xe')][_0xe9e5('0x5f')]=function(_0x53ffc5){var _0x5cf1d3=this;rpcDb[_0xe9e5('0x78')](_0x53ffc5['id'],ut[_0xe9e5('0x79')](this[_0xe9e5('0x16')]))[_0xe9e5('0x7a')](function(_0x3542c6){if(!_['isNil'](_0x3542c6)){for(var _0x10ca8f=0x0;_0x10ca8f<_0x3542c6[_0xe9e5('0x7b')];_0x10ca8f+=0x1){if(ut['getDiff'](_0x3542c6[_0x10ca8f]['scheduledat'])<_0x53ffc5['dialRecallMeTimeout']*0x3c){_0x5cf1d3['run'](_0x3542c6[_0x10ca8f]['id'])[_0xe9e5('0x7a')](ut[_0xe9e5('0x7c')](_0xe9e5('0x7d')))['catch'](ut[_0xe9e5('0x7c')](_0xe9e5('0x7d')));}else{var _0x594b2f=new Action(_0x3542c6[_0x10ca8f],_0x53ffc5);_0x594b2f[_0xe9e5('0x7e')]=moment()[_0xe9e5('0x4f')](_0xe9e5('0x7f'));_0x53ffc5[_0xe9e5('0x3f')]+=0x1;ut['logCustomer'](_0x594b2f,0x17,_0xe9e5('0x80'));if(_0x53ffc5[_0xe9e5('0x81')]){rpcDb['rescheduleContactInQueue'](ut[_0xe9e5('0x82')](_0x3542c6[_0x10ca8f]));rpcDb[_0xe9e5('0x83')](_0x594b2f,_0xe9e5('0x84'));}else{ut['logCustomer'](_0x594b2f,0x16,_0xe9e5('0x85'));rpcDb[_0xe9e5('0x83')](_0x594b2f,_0xe9e5('0x86'));rpcDb['createCustomerFinal'](_0x594b2f,_0xe9e5('0x86'));}}}}})[_0xe9e5('0x6e')](ut[_0xe9e5('0x7c')](_0xe9e5('0x87')));};Preview[_0xe9e5('0xe')][_0xe9e5('0x5e')]=function(_0x2aa1c2){_0x2aa1c2[_0xe9e5('0x52')]=!![];if(ut[_0xe9e5('0x88')](_0x2aa1c2[_0xe9e5('0x89')])){_0x2aa1c2[_0xe9e5('0x54')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xe9e5('0x8a')](_0x2aa1c2[_0xe9e5('0x34')])){_0x2aa1c2['message']=_0xe9e5('0x55');}else if(!this[_0xe9e5('0x8b')](_0x2aa1c2[_0xe9e5('0x4a')])){if(!this['isTrunkReachable'](_0x2aa1c2[_0xe9e5('0x8c')])){_0x2aa1c2[_0xe9e5('0x54')]=_0xe9e5('0x8d');}else{_0x2aa1c2[_0xe9e5('0x54')]='ACTIVE';}}else{_0x2aa1c2[_0xe9e5('0x54')]=_0xe9e5('0x8e');}emitCampaignPreview(_0x2aa1c2);};Preview[_0xe9e5('0xe')][_0xe9e5('0x8f')]=function(_0x269db1,_0x49e7be,_0x2b2a30){var _0x33b1d=this;var _0x337d9c=this['actions'][_0x49e7be];var _0x2bceb1=this[_0xe9e5('0x13')][_0x337d9c[_0xe9e5('0x65')]];var _0x38826e;if(_0x2bceb1){switch(_0x2b2a30){case'1':_0x2bceb1[_0xe9e5('0x3d')]+=0x1;_0x337d9c[_0xe9e5('0x90')]=ut[_0xe9e5('0x91')](_0x337d9c);ut[_0xe9e5('0x92')](_0x337d9c,0x0,_0xe9e5('0x93'));rpcDb[_0xe9e5('0x83')](_0x337d9c,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x337d9c)>=_0x2bceb1['dialGlobalMaxRetry']){_0x38826e=ut['cloneAction'](_0x337d9c,0xf,_0xe9e5('0x94'));rpcDb[_0xe9e5('0x95')](_0x38826e,_0xe9e5('0x96'));}else{rpcDb[_0xe9e5('0x95')](_0x337d9c,_0xe9e5('0x96'));}delete this['actions'][_0x269db1[_0xe9e5('0x97')]];break;case _0xe9e5('0x98'):var _0x3dbcba=moment()[_0xe9e5('0x4f')](_0xe9e5('0x7f'));_0x337d9c[_0xe9e5('0x99')]=_0x3dbcba;_0x337d9c[_0xe9e5('0x9a')]=_0x3dbcba;_0x337d9c[_0xe9e5('0x68')]=!![];_0x2bceb1[_0xe9e5('0x2c')]+=0x1;logger['info'](_0xe9e5('0x9b'),_0x337d9c['uniqueid'],_0xe9e5('0x9c'),_0x2bceb1[_0xe9e5('0x29')],'pTalking:\x20',_0x2bceb1['pTalking']);ami[_0xe9e5('0x26')](_0xe9e5('0x9d'),ut['buildObj'](_0x337d9c,_0xe9e5('0x9e')));if(_0x2bceb1[_0xe9e5('0x9f')]){ami[_0xe9e5('0x26')]('custom:agentConnectPreview',ut[_0xe9e5('0xa0')](_0x337d9c));}break;case'16':ami[_0xe9e5('0x26')](_0xe9e5('0xa1'),ut[_0xe9e5('0xa2')](_0x337d9c,_0xe9e5('0xa3')));emitVoiceQueueChannelRemove(ut[_0xe9e5('0xa2')](_0x337d9c,_0xe9e5('0xa3')));_0x2bceb1['outboundAnswerCallsDay']+=0x1;_0x2bceb1[_0xe9e5('0x30')]+=0x1;_0x2bceb1[_0xe9e5('0xa4')]+=0x1;ut[_0xe9e5('0x72')](_0x2bceb1,'[16]');_0x337d9c[_0xe9e5('0x90')]=ut['totalGlobal'](_0x337d9c);ut[_0xe9e5('0x92')](_0x337d9c,0x4,'Answer');rpcDb['createCustomerHistory'](_0x337d9c,_0xe9e5('0xa5'));rpcDb['createCustomerFinal'](_0x337d9c,_0xe9e5('0xa6'));rpcDb['crateCustomerReportQueue'](_0x337d9c);_0x2bceb1[_0xe9e5('0x2e')]+=_0x337d9c[_0xe9e5('0xa7')];_0x2bceb1['sumBillable']+=_0x337d9c['talktime'];logger['info'](_0xe9e5('0xa8'),_0x337d9c[_0xe9e5('0xa9')],_0xe9e5('0x9c'),_0x2bceb1[_0xe9e5('0x29')],_0xe9e5('0x67'),_0x2bceb1['pTalking']);delete this[_0xe9e5('0x64')][_0x269db1[_0xe9e5('0x97')]];break;case _0xe9e5('0xaa'):_0x2bceb1[_0xe9e5('0xab')]+=0x1;_0x337d9c[_0xe9e5('0xac')]+=0x1;_0x337d9c['countglobal']=ut[_0xe9e5('0x91')](_0x337d9c);ut[_0xe9e5('0x92')](_0x337d9c,0x5,_0xe9e5('0xad'));rpcDb[_0xe9e5('0x83')](_0x337d9c,_0xe9e5('0xae'));if(ut[_0xe9e5('0x91')](_0x337d9c)>=_0x2bceb1[_0xe9e5('0xaf')]){_0x38826e=ut['cloneAction'](_0x337d9c,0xf,_0xe9e5('0x94'));rpcDb[_0xe9e5('0x95')](_0x38826e,_0xe9e5('0xb0'));}else{if(_0x337d9c[_0xe9e5('0xac')]>=_0x2bceb1['dialBusyMaxRetry']){rpcDb[_0xe9e5('0x95')](_0x337d9c,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xe9e5('0xb1')](ut[_0xe9e5('0xb2')](_0x337d9c,_0xe9e5('0xac'),_0x2bceb1[_0xe9e5('0xb3')]),_0x337d9c[_0xe9e5('0xb4')],_0x337d9c['activeContact']);}}break;case'NOANSWER':_0x2bceb1[_0xe9e5('0xb5')]+=0x1;_0x337d9c[_0xe9e5('0xb6')]+=0x1;_0x337d9c['countglobal']=ut[_0xe9e5('0x91')](_0x337d9c);ut[_0xe9e5('0x92')](_0x337d9c,0x3,_0xe9e5('0xb7'));rpcDb['createCustomerHistory'](_0x337d9c,_0xe9e5('0xb8'));if(ut[_0xe9e5('0x91')](_0x337d9c)>=_0x2bceb1[_0xe9e5('0xaf')]){_0x38826e=ut[_0xe9e5('0xb9')](_0x337d9c,0xf,_0xe9e5('0x94'));rpcDb[_0xe9e5('0x95')](_0x38826e,_0xe9e5('0xba'));}else{if(_0x337d9c[_0xe9e5('0xb6')]>=_0x2bceb1['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x337d9c,_0xe9e5('0xb8'));}else{rpcDb[_0xe9e5('0xb1')](ut[_0xe9e5('0xb2')](_0x337d9c,_0xe9e5('0xb6'),_0x2bceb1[_0xe9e5('0xbb')]),_0x337d9c[_0xe9e5('0xb4')],_0x337d9c[_0xe9e5('0xbc')]);}}break;case _0xe9e5('0xbd'):_0x2bceb1[_0xe9e5('0xbe')]+=0x1;_0x337d9c[_0xe9e5('0xbf')]+=0x1;_0x337d9c[_0xe9e5('0x90')]=ut[_0xe9e5('0x91')](_0x337d9c);ut['logCustomer'](_0x337d9c,0x8,_0xe9e5('0xc0'));rpcDb[_0xe9e5('0x83')](_0x337d9c,_0xe9e5('0xc1'));if(ut[_0xe9e5('0x91')](_0x337d9c)>=_0x2bceb1[_0xe9e5('0xaf')]){_0x38826e=ut[_0xe9e5('0xb9')](_0x337d9c,0xf,_0xe9e5('0x94'));rpcDb[_0xe9e5('0x95')](_0x38826e,_0xe9e5('0xc2'));}else{if(_0x337d9c[_0xe9e5('0xbf')]>=_0x2bceb1[_0xe9e5('0xc3')]){rpcDb['createCustomerFinal'](_0x337d9c,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x337d9c,_0xe9e5('0xbf'),_0x2bceb1[_0xe9e5('0xb3')]),_0x337d9c[_0xe9e5('0xb4')],_0x337d9c[_0xe9e5('0xbc')]);}}break;case _0xe9e5('0xc4'):_0x2bceb1['outboundRejectCallsDay']+=0x1;_0x337d9c[_0xe9e5('0x90')]=ut[_0xe9e5('0x91')](_0x337d9c);ut[_0xe9e5('0x92')](_0x337d9c,0x14,_0xe9e5('0xc5'));rpcDb[_0xe9e5('0x83')](_0x337d9c,_0xe9e5('0xc6'));if(_0x337d9c[_0xe9e5('0xb4')]){rpcDb[_0xe9e5('0xc7')](_0x337d9c['idContact']);}if(_0x337d9c['activeContact']){rpcDb[_0xe9e5('0xc8')](_0x337d9c[_0xe9e5('0xc9')]);}break;default:if(_0x337d9c[_0xe9e5('0x68')]){ut['decrementTalkink'](_0x2bceb1,_0xe9e5('0xca'));ut[_0xe9e5('0x73')](_0xe9e5('0xcb')+_0x2bceb1[_0xe9e5('0x29')],_0x269db1);}_0x2bceb1[_0xe9e5('0xcc')]+=0x1;_0x337d9c[_0xe9e5('0x90')]=ut[_0xe9e5('0x91')](_0x337d9c);ut[_0xe9e5('0x92')](_0x337d9c,0xc,_0x269db1['cause-txt']||_0x269db1[_0xe9e5('0xcd')]);rpcDb[_0xe9e5('0x83')](_0x337d9c,_0xe9e5('0xce'));if(ut['totalGlobal'](_0x337d9c)>=_0x2bceb1[_0xe9e5('0xaf')]){_0x38826e=ut[_0xe9e5('0xb9')](_0x337d9c,0xf,_0xe9e5('0x94'));rpcDb['createCustomerFinal'](_0x38826e,_0xe9e5('0xcf'));}else{rpcDb[_0xe9e5('0x95')](_0x337d9c,_0xe9e5('0xcf'));}delete this[_0xe9e5('0x64')][_0x269db1[_0xe9e5('0x97')]];}if(!(_0x337d9c[_0xe9e5('0x68')]&&_0x2b2a30==='16')){ut['updateOriginated'](_0x2bceb1,'[callProgressDetectingCustomer]');logger[_0xe9e5('0x61')](_0xe9e5('0xd0'),_0x337d9c[_0xe9e5('0xa9')],_0xe9e5('0x9c'),_0x2bceb1[_0xe9e5('0x29')],'originated:\x20',_0x2bceb1[_0xe9e5('0x49')]);}if(_0x2b2a30!==_0xe9e5('0x98')){delete this[_0xe9e5('0x64')][_0x269db1['linkedid']];delete this[_0xe9e5('0x64')][_0x269db1[_0xe9e5('0xd1')]];}}};Preview[_0xe9e5('0xe')]['callProgressDetectingAgent']=function(_0x403df6,_0x1851b2,_0x4580f3){if(_[_0xe9e5('0xd2')](_0x1851b2)&&_0xe9e5('0xd3')!==typeof _0x1851b2){return;}if(_[_0xe9e5('0xd2')](_0x4580f3)&&_0xe9e5('0xd3')!==typeof _0x4580f3){return;}switch(_0x4580f3[_0xe9e5('0xd4')]){case'0':ut[_0xe9e5('0xd5')](_0x403df6,0x0,_0xe9e5('0x93'));rpcDb[_0xe9e5('0xd6')](_0x403df6,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x403df6,0x3,'NoAnswer');rpcDb[_0xe9e5('0xd6')](_0x403df6,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xe9e5('0xd5')](_0x403df6,0x5,_0xe9e5('0xad'));rpcDb[_0xe9e5('0xd6')](_0x403df6,_0xe9e5('0xd7'));break;case'8':ut[_0xe9e5('0xd5')](_0x403df6,0x8,_0xe9e5('0xc0'));rpcDb[_0xe9e5('0xd6')](_0x403df6,_0xe9e5('0xd8'));break;case'22':ut[_0xe9e5('0xd5')](_0x403df6,0x16,'AnswerAGI');rpcDb[_0xe9e5('0xd6')](_0x403df6,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x403df6,0xc,_0x4580f3[_0xe9e5('0xd4')]);rpcDb[_0xe9e5('0xd6')](_0x403df6,'[callProgressDetectingAgent][logCongestion]');}ut[_0xe9e5('0x70')](_0x1851b2,_0xe9e5('0xd9'));logger[_0xe9e5('0x61')](_0xe9e5('0xda'),_0x403df6[_0xe9e5('0xa9')],_0xe9e5('0x9c'),_0x1851b2[_0xe9e5('0x29')],_0xe9e5('0x66'),_0x1851b2[_0xe9e5('0x49')]);delete this[_0xe9e5('0x64')][_0x403df6['uniqueid']];};Preview[_0xe9e5('0xe')][_0xe9e5('0xdb')]=function(_0x1b57d3,_0x37ae38,_0x4ff6e7,_0x3ffdb0,_0x431b48){var _0x5e94db=this;return new BPromise(function(_0x4df848,_0x324dd3){if(_[_0xe9e5('0x60')](_0x37ae38)||_[_0xe9e5('0x60')](_0x37ae38[_0xe9e5('0xdc')])||_[_0xe9e5('0x60')](_0x37ae38[_0xe9e5('0xdc')][_0xe9e5('0xdd')])||_[_0xe9e5('0x60')](_0x37ae38['VoiceQueueId'])){_0x324dd3(ut[_0xe9e5('0x54')](_0xe9e5('0xde'),_0x3ffdb0,_0x431b48));return;}var _0x4a1d28=uuid['v4']();var _0x313623=_0x5e94db['campaignsPreview'][_0x37ae38[_0xe9e5('0x63')][_0xe9e5('0x29')]];var _0x3978ae=_0x4ff6e7?_0x5e94db[_0xe9e5('0x16')][_0x4ff6e7]['id']:undefined;_0x5e94db[_0xe9e5('0x64')][_0x4a1d28]=new Action(_0x37ae38,_0x313623,_0x4a1d28,_0x4ff6e7,_0x3978ae);var _0x109eae=_0x5e94db[_0xe9e5('0x64')][_0x4a1d28];_0x109eae[_0xe9e5('0xb4')]=_0x3ffdb0;_0x109eae[_0xe9e5('0xbc')]=_0x431b48;_0x109eae[_0xe9e5('0xdf')]=_0x4ff6e7;if(_[_0xe9e5('0xe0')](_0x1b57d3)){_0x5e94db[_0xe9e5('0xe1')](_0x109eae,_0x313623,_0x37ae38,_0x4ff6e7)[_0xe9e5('0x7a')](function(_0x2152e6){logger[_0xe9e5('0x61')]('[Preview][execCall][success]','Queue:\x20'+_0x109eae[_0xe9e5('0x65')]+_0xe9e5('0xe2')+_0x109eae['idContact'],JSON[_0xe9e5('0x4e')](_0x2152e6));ami['emit']('custom:agentcalled',ut['buildObj'](_0x109eae,_0xe9e5('0xe3')));_0x4df848(ut[_0xe9e5('0x54')]('Calling'));})[_0xe9e5('0x6e')](function(_0x255fa3){ut[_0xe9e5('0x58')]('[Preview][execCall][failure]',_0x255fa3);_0x324dd3(ut['message'](_0xe9e5('0xe4'),_0x3ffdb0,_0x431b48));});}else{_0x313623['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x109eae);rpcDb[_0xe9e5('0xe5')](_0x109eae,'[Blacklist][error]');delete _0x5e94db[_0xe9e5('0x64')][_0x4a1d28];_0x324dd3(ut[_0xe9e5('0x54')](_0xe9e5('0xe6'),_0x3ffdb0,_0x431b48));}});};Preview[_0xe9e5('0xe')][_0xe9e5('0x8b')]=function(_0x363ed9){return!_[_0xe9e5('0x60')](_0x363ed9)&&!_[_0xe9e5('0x60')](_0x363ed9[_0xe9e5('0x29')])&&!_[_0xe9e5('0x60')](_0x363ed9[_0xe9e5('0x4b')])&&_0x363ed9[_0xe9e5('0x4b')]&&!_[_0xe9e5('0x60')](this['trunks'][util[_0xe9e5('0x4f')](_0xe9e5('0xe7'),_0x363ed9[_0xe9e5('0x29')])])&&!_[_0xe9e5('0x60')](this[_0xe9e5('0x15')][util[_0xe9e5('0x4f')](_0xe9e5('0xe7'),_0x363ed9['name'])][_0xe9e5('0x6c')])&&(this['trunks'][util[_0xe9e5('0x4f')](_0xe9e5('0xe7'),_0x363ed9[_0xe9e5('0x29')])]['status']===_0xe9e5('0xe8')||this[_0xe9e5('0x15')][util[_0xe9e5('0x4f')](_0xe9e5('0xe7'),_0x363ed9[_0xe9e5('0x29')])][_0xe9e5('0x6c')]==='unmonitored');};Preview[_0xe9e5('0xe')][_0xe9e5('0xe9')]=function(_0x39bc2f,_0x4c816d){var _0x5a8127=this;return new BPromise(function(_0x57bf95,_0x4ef5ec){_0x5a8127['execRun'](_0x39bc2f,_0x4c816d)[_0xe9e5('0x7a')](function(_0x36bca7){_0x57bf95(_['pick'](_0x36bca7,[_0xe9e5('0x54')]));})[_0xe9e5('0x6e')](function(_0x4ce567){if(_0x4ce567[_0xe9e5('0xea')]){rpcDb['unlockContact'](_0x39bc2f);}if(_0x4ce567['active']){rpcDb['disableContact'](_0x39bc2f);}_0x4ef5ec(_['pick'](_0x4ce567,[_0xe9e5('0x54')]));});});};Preview['prototype'][_0xe9e5('0xeb')]=function(_0x14428e,_0x2ef835){var _0x3d9954=this;return new BPromise(function(_0x3191e1,_0x1f2187){var _0x16d4b4,_0x9358f8;rpcDb[_0xe9e5('0xec')](_0x14428e)[_0xe9e5('0x7a')](function(_0x5c237b){if(!_[_0xe9e5('0x60')](_0x5c237b[0x0])){_0x9358f8=_0x5c237b[0x0][_0xe9e5('0xed')]?![]:!![];_0x16d4b4=_0x5c237b[0x0][_0xe9e5('0xed')]?!![]:![];_0x16d4b4=_0x2ef835?!![]:_0x16d4b4;}var _0x39ceb9=_0x3d9954[_0xe9e5('0xee')](_0x5c237b);if(_0x39ceb9[_0xe9e5('0xef')]){rpcDb[_0xe9e5('0xf0')](_[_0xe9e5('0x69')](_0x5c237b[0x0],['VoiceQueueId','Contact.phone']))[_0xe9e5('0x7a')](function(_0x3d251a){_0x3d9954[_0xe9e5('0xdb')](_0x3d251a,_0x5c237b[0x0],_0x2ef835,_0x9358f8,_0x16d4b4)[_0xe9e5('0x7a')](function(_0x5afff6){_0x3191e1(_0x5afff6);})[_0xe9e5('0x6e')](function(_0x4eb97d){_0x1f2187(_0x4eb97d);});})[_0xe9e5('0x6e')](function(_0x226faa){ut[_0xe9e5('0x58')](_0xe9e5('0xf1'),_0x226faa);_0x1f2187(ut[_0xe9e5('0x54')](_0xe9e5('0xf2'),_0x9358f8,_0x16d4b4));});}else{_0x1f2187(ut['message'](_0x39ceb9[_0xe9e5('0x54')],_0x9358f8,_0x16d4b4));}})['catch'](function(_0x4f71f5){ut[_0xe9e5('0x58')](_0xe9e5('0xf3'),_0x4f71f5);_0x1f2187(ut[_0xe9e5('0x54')](_0xe9e5('0xf2'),![],!![]));});});};Preview[_0xe9e5('0xe')][_0xe9e5('0xee')]=function(_0x2cfa5a){if(_[_0xe9e5('0x60')](_0x2cfa5a)||_['isEmpty'](_0x2cfa5a)||!_['isNil'](_0x2cfa5a[0x0][_0xe9e5('0xf4')])&&_[_0xe9e5('0x60')](_0x2cfa5a[0x0]['Agent'][_0xe9e5('0x29')])){ut['logger'](_0xe9e5('0xf5'),_0x2cfa5a);return{'isValid':![],'message':_0xe9e5('0xf6')};}var _0x166cdd=this[_0xe9e5('0x13')][_0x2cfa5a[0x0][_0xe9e5('0x63')][_0xe9e5('0x29')]];_0x166cdd['message']=_0xe9e5('0x8e');if(_[_0xe9e5('0x60')](_0x166cdd)){ut[_0xe9e5('0x58')](_0xe9e5('0xf7'),_0x166cdd);return{'isValid':![],'message':_0xe9e5('0xf8')};}if(!this[_0xe9e5('0x8b')](_0x166cdd[_0xe9e5('0x4a')])){ut[_0xe9e5('0x58')](_0xe9e5('0xf9'),_0xe9e5('0xfa')+_0x166cdd[_0xe9e5('0x29')]+_0xe9e5('0xfb'));if(!this[_0xe9e5('0x8b')](_0x166cdd['TrunkBackup'])){ut[_0xe9e5('0x58')](_0xe9e5('0xf9'),_0x166cdd[_0xe9e5('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xe9e5('0xfc')};}}if(!ut[_0xe9e5('0x8a')](_0x166cdd['dialActive'])){ut[_0xe9e5('0x58')](_0xe9e5('0xfd'),_0x166cdd[_0xe9e5('0x29')]+_0xe9e5('0xfe'));return{'isValid':![],'message':_0xe9e5('0xfa')+_0x166cdd[_0xe9e5('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xe9e5('0xff')};};Preview[_0xe9e5('0xe')][_0xe9e5('0xe1')]=function(_0x1fa3e8,_0x5b29a0,_0xcc8054,_0x5849ef){var _0x535b7b=this;return new BPromise(function(_0x32e0c4,_0x3897db){var _0xde7ec4=_0x1fa3e8['uniqueid'];var _0x114867=_0x535b7b[_0xe9e5('0x8b')](_0x5b29a0[_0xe9e5('0x4a')])?util[_0xe9e5('0x4f')](_0xe9e5('0x100'),_0x5b29a0[_0xe9e5('0x4a')]['name'],_[_0xe9e5('0x60')](_0x5b29a0[_0xe9e5('0x38')])?'':_0x5b29a0['dialPrefix'][_0xe9e5('0x101')]()||'',_0x5b29a0['dialCutDigit']>0x0?_0xcc8054[_0xe9e5('0xdc')][_0xe9e5('0xdd')][_0xe9e5('0x102')](_0x5b29a0[_0xe9e5('0x103')]):_0xcc8054[_0xe9e5('0xdc')]['phone']):util[_0xe9e5('0x4f')](_0xe9e5('0x100'),_[_0xe9e5('0x60')](_0x5b29a0[_0xe9e5('0x8c')])?_0x5b29a0[_0xe9e5('0x4a')][_0xe9e5('0x29')]:_0x5b29a0['TrunkBackup']['name'],_['isNil'](_0x5b29a0[_0xe9e5('0x38')])?'':_0x5b29a0[_0xe9e5('0x38')][_0xe9e5('0x101')]()||'',_0x5b29a0[_0xe9e5('0x103')]>0x0?_0xcc8054[_0xe9e5('0xdc')][_0xe9e5('0xdd')]['substring'](_0x5b29a0['dialCutDigit']):_0xcc8054['Contact'][_0xe9e5('0xdd')]);var _0x2a3787=_0x535b7b[_0xe9e5('0x8b')](_0x5b29a0[_0xe9e5('0x4a')])?ut[_0xe9e5('0x104')](_0x5b29a0[_0xe9e5('0x4a')]['callerid'],_0x5b29a0[_0xe9e5('0x36')],_0x5b29a0[_0xe9e5('0x105')]>0x0?ut[_0xe9e5('0x106')](_0x5b29a0[_0xe9e5('0x107')],_0x5b29a0[_0xe9e5('0x105')]):_0x5b29a0['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0xe9e5('0x60')](_0x5b29a0[_0xe9e5('0x8c')])?_0x5b29a0[_0xe9e5('0x4a')][_0xe9e5('0x4c')]:_0x5b29a0[_0xe9e5('0x8c')]['callerid'],_0x5b29a0[_0xe9e5('0x36')],_0x5b29a0[_0xe9e5('0x105')]>0x0?ut['getCallerIdRandom'](_0x5b29a0['dialOriginateCallerIdNumber'],_0x5b29a0['dialRandomLastDigitCallerIdNumber']):_0x5b29a0[_0xe9e5('0x107')]);if(_0x2a3787){_0x1fa3e8[_0xe9e5('0x108')]=ut[_0xe9e5('0x109')](_0x2a3787);_0x1fa3e8[_0xe9e5('0x10a')]=ut[_0xe9e5('0x10b')](_0x2a3787);}var _0x43903d=ut[_0xe9e5('0x10c')](_0x5b29a0,_0xcc8054,_0x114867,_0x2a3787,_0xde7ec4,_0x1fa3e8);_['merge'](_0x1fa3e8,ut[_0xe9e5('0x10d')](_0x43903d));_0x1fa3e8[_0xe9e5('0x7e')]=moment()['format'](_0xe9e5('0x7f'));ami['Action'](ut['variablesAction'](_0x1fa3e8,_0x5b29a0,_0x43903d,_0x1fa3e8[_0xe9e5('0xbc')],_0x5849ef))['then'](function(_0x27424c){_0x5b29a0[_0xe9e5('0x49')]+=0x1;logger[_0xe9e5('0x61')]('[originated][increment]',_0xde7ec4,'\x20Queue',_0x5b29a0[_0xe9e5('0x29')],_0xe9e5('0x66'),_0x5b29a0[_0xe9e5('0x49')]);_0x32e0c4(_0x27424c);})['catch'](function(_0x1c5e1b){ut[_0xe9e5('0xd5')](_0x1fa3e8,0xe,'OriginateError');rpcDb[_0xe9e5('0xd6')](_0x1fa3e8,_0xe9e5('0x10e'));_0x3897db(_0x1c5e1b);});});};Preview[_0xe9e5('0xe')]['syncNewExten']=function(_0x155988){if(this[_0xe9e5('0x64')][_0x155988[_0xe9e5('0x97')]]){this['actions'][_0x155988[_0xe9e5('0x97')]][_0xe9e5('0x6d')]=_0x155988[_0xe9e5('0x6d')];}};Preview[_0xe9e5('0xe')][_0xe9e5('0x18')]=function(_0x48fbd1){var _0x201b14=this;var _0x1456b1=this[_0xe9e5('0x64')][_0x48fbd1[_0xe9e5('0x10f')]];if(_0x1456b1){if(_0x1456b1[_0xe9e5('0xdf')]&&this[_0xe9e5('0x16')][_0x1456b1[_0xe9e5('0xdf')]]){ut[_0xe9e5('0x110')](_0x1456b1,this[_0xe9e5('0x16')][_0x1456b1[_0xe9e5('0xdf')]][_0xe9e5('0x29')],this[_0xe9e5('0x16')][_0x1456b1['lookAgent']]['id']);}var _0x1bd335=_[_0xe9e5('0x111')](_0x1456b1);_0x1bd335[_0xe9e5('0x99')]=moment()[_0xe9e5('0x4f')](_0xe9e5('0x7f'));var _0x410997=_0x201b14[_0xe9e5('0x13')][_0x1456b1[_0xe9e5('0x65')]];if(ut[_0xe9e5('0x112')](_0x48fbd1[_0xe9e5('0x113')])){if(_0x1456b1[_0xe9e5('0xb4')]){rpcDb[_0xe9e5('0xc7')](_0x1456b1[_0xe9e5('0xc9')]);}if(_0x1456b1[_0xe9e5('0xbc')]){rpcDb[_0xe9e5('0xc8')](_0x1456b1['idContact']);}ami['emit']('custom:agentringnoanswer',ut[_0xe9e5('0xa2')](_0x1456b1,_0xe9e5('0x114')));this[_0xe9e5('0x115')](_0x1bd335,_0x410997,_0x48fbd1);}else{_0x1456b1[_0xe9e5('0x7e')]=moment()[_0xe9e5('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xe9e5('0xd5')](_0x1bd335,0x4,_0xe9e5('0x116'));rpcDb[_0xe9e5('0xd6')](_0x1bd335,_0xe9e5('0x117'));}}};Preview[_0xe9e5('0xe')][_0xe9e5('0x1a')]=function(_0x173180){var _0x298366=this;var _0x34e9dc=this[_0xe9e5('0x64')][_0x173180[_0xe9e5('0x97')]];var _0x59db8d;if(_0x34e9dc){_0x59db8d=this['campaignsPreview'][_0x34e9dc[_0xe9e5('0x65')]];logger[_0xe9e5('0x61')](_0xe9e5('0x118'),_0x173180['linkedid'],_0xe9e5('0x9c'),_0x59db8d[_0xe9e5('0x29')],_0xe9e5('0x67'),_0x59db8d['pTalking']);}if(this['actions'][_0x173180['linkedid']]&&_0x173180[_0xe9e5('0x97')]!==_0x173180[_0xe9e5('0xa9')]){if(_0x173180['cause']==='16'&&this[_0xe9e5('0x64')][_0x173180['linkedid']][_0xe9e5('0x68')]){this[_0xe9e5('0x8f')](_0x173180,_0x173180[_0xe9e5('0x97')],_0x173180['cause']);}else if(this[_0xe9e5('0x64')][_0x173180[_0xe9e5('0x97')]][_0xe9e5('0x68')]){logger[_0xe9e5('0x61')](_0xe9e5('0x119'),_0x173180[_0xe9e5('0x97')],_0x173180[_0xe9e5('0x11a')],_0xe9e5('0x9c'),_0x59db8d[_0xe9e5('0x29')],_0xe9e5('0x67'),_0x59db8d['pTalking']);this[_0xe9e5('0x8f')](_0x173180,_0x173180['linkedid'],_0x173180[_0xe9e5('0x11a')]);}}else if(_0x34e9dc&&_[_0xe9e5('0x60')](_0x34e9dc['statedesc'])&&_0x59db8d[_0xe9e5('0x11b')]&&_0x173180[_0xe9e5('0x97')]===_0x173180[_0xe9e5('0xa9')]&&_[_0xe9e5('0x60')](_0x173180[_0xe9e5('0xd4')])&&_0x173180[_0xe9e5('0x11a')]==='16'&&_0x173180[_0xe9e5('0x11c')]==='6'&&_[_0xe9e5('0xd2')](_0x34e9dc[_0xe9e5('0x11d')])){if(_0x34e9dc['unlockAgent']){rpcDb[_0xe9e5('0xc7')](_0x34e9dc[_0xe9e5('0xc9')]);}if(_0x34e9dc[_0xe9e5('0xbc')]){rpcDb[_0xe9e5('0xc8')](_0x34e9dc[_0xe9e5('0xc9')]);}_0x173180[_0xe9e5('0xd4')]='22';this[_0xe9e5('0x115')](_0x34e9dc,_0x59db8d,_0x173180);}else if(_0x34e9dc&&_0x34e9dc[_0xe9e5('0x11d')]){if(_0x173180[_0xe9e5('0x11a')]==='16'&&this['actions'][_0x173180[_0xe9e5('0x97')]][_0xe9e5('0x68')]){logger[_0xe9e5('0x61')]('[syncHangup][talking][transfer]',_0x173180[_0xe9e5('0x97')],_0x173180['cause'],'\x20Queue',_0x59db8d['name'],_0xe9e5('0x67'),_0x59db8d[_0xe9e5('0x2c')]);this[_0xe9e5('0x8f')](_0x173180,_0x173180[_0xe9e5('0x97')],_0x173180[_0xe9e5('0x11a')]);}else if(this['actions'][_0x173180[_0xe9e5('0x97')]][_0xe9e5('0x68')]){logger[_0xe9e5('0x61')]('[syncHangup][talking][cause]',_0x173180['linkedid'],_0x173180[_0xe9e5('0x11a')],_0xe9e5('0x9c'),_0x59db8d['name'],_0xe9e5('0x67'),_0x59db8d['pTalking']);this['callProgressDetectingCustomer'](_0x173180,_0x173180[_0xe9e5('0x97')],_0x173180[_0xe9e5('0x11a')]);}}};Preview[_0xe9e5('0xe')]['syncDialEnd']=function(_0x106ad5){if(this[_0xe9e5('0x64')][_0x106ad5[_0xe9e5('0xd1')]]&&_0x106ad5[_0xe9e5('0xd1')]!==_0x106ad5[_0xe9e5('0x11e')]){this['callProgressDetectingCustomer'](_0x106ad5,_0x106ad5[_0xe9e5('0xd1')],_0x106ad5[_0xe9e5('0xcd')]);}};Preview['prototype'][_0xe9e5('0x11f')]=function(_0x482924){if(this[_0xe9e5('0x64')][_0x482924[_0xe9e5('0x97')]]&&_0x482924['linkedid']!==_0x482924[_0xe9e5('0xa9')]&&!this['actions'][_0x482924[_0xe9e5('0x97')]][_0xe9e5('0x68')]){if(_0x482924[_0xe9e5('0x11a')]==='1'){this[_0xe9e5('0x8f')](_0x482924,_0x482924[_0xe9e5('0x97')],_0x482924[_0xe9e5('0x11a')]);}}};Preview['prototype'][_0xe9e5('0x120')]=function(_0x1d9afa,_0x38f4d0,_0x5039f3){if(this[_0xe9e5('0x64')][_0x1d9afa]){if(_['isNil'](this[_0xe9e5('0x64')][_0x1d9afa][_0xe9e5('0x121')])){this[_0xe9e5('0x64')][_0x1d9afa][_0xe9e5('0x121')]={};}this[_0xe9e5('0x64')][_0x1d9afa][_0xe9e5('0x121')][_0x38f4d0]=_0x5039f3;}};Preview[_0xe9e5('0xe')][_0xe9e5('0x122')]=function(_0x54f4aa){try{if(!_['isNil'](_0x54f4aa)){if(ut[_0xe9e5('0x123')](_[_0xe9e5('0x124')](_0x54f4aa[_0xe9e5('0x125')])[0x0])){this[_0xe9e5('0x120')](_0x54f4aa['uniqueid'],_['keys'](_0x54f4aa[_0xe9e5('0x125')])[0x0],_0x54f4aa[_0xe9e5('0x126')]);}}}catch(_0x480002){logger[_0xe9e5('0x127')](_0xe9e5('0x128'),util[_0xe9e5('0x129')](_0x480002,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xe9e5('0x22')]=function(_0x5e7c3e){if(_0x5e7c3e){if(this[_0xe9e5('0x64')][_0x5e7c3e['transfertargetlinkedid']]){this[_0xe9e5('0x64')][_0x5e7c3e[_0xe9e5('0x12a')]][_0xe9e5('0x11d')]=!![];}}};Preview[_0xe9e5('0xe')][_0xe9e5('0x24')]=function(_0x3178a8){if(_0x3178a8){if(this['actions'][_0x3178a8[_0xe9e5('0x12b')]]){this['actions'][_0x3178a8[_0xe9e5('0x12b')]]['transfer']=!![];}}};module[_0xe9e5('0x12c')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 1f3d67d..fdfcd08 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 _0xf814=['rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20'];(function(_0x4c86ab,_0x1f1a25){var _0x5bdd92=function(_0x249ddb){while(--_0x249ddb){_0x4c86ab['push'](_0x4c86ab['shift']());}};_0x5bdd92(++_0x1f1a25);}(_0xf814,0x110));var _0x4f81=function(_0x3b3933,_0x4a5bd2){_0x3b3933=_0x3b3933-0x0;var _0x41d2c4=_0xf814[_0x3b3933];return _0x41d2c4;};'use strict';var util=require(_0x4f81('0x0'));var BPromise=require(_0x4f81('0x1'));var logger=require(_0x4f81('0x2'))(_0x4f81('0x3'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x4f81('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x4f81('0x5'));var voiceQueueRt=require(_0x4f81('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x4f81('0x7'));function loggerCatch(_0x12f362){return function(_0x314ade){logger[_0x4f81('0x8')](_0x12f362,util[_0x4f81('0x9')](_0x314ade,{'showHidden':![],'depth':null}));};}function create(_0x159d14){return BPromise[_0x4f81('0xa')]()[_0x4f81('0xb')](cmHopperHistory[_0x4f81('0xc')](_0x159d14))[_0x4f81('0xd')](loggerCatch(_0x4f81('0xe')));}function createAgent(_0x13994f){return BPromise['resolve']()['then'](agentReportPreview[_0x4f81('0xc')](_0x13994f))['catch'](loggerCatch(_0x4f81('0xe')));}function moveContact(_0x556f8a){return BPromise[_0x4f81('0xa')]()[_0x4f81('0xb')](cmHopper[_0x4f81('0xf')](_0x556f8a,!![]))[_0x4f81('0xd')](loggerCatch(_0x4f81('0x10')));}exports['checkIsBlackList']=function(_0x2d47f0){return BPromise['resolve']()[_0x4f81('0xb')](cmHopperBlack[_0x4f81('0x11')](_0x2d47f0))[_0x4f81('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x4f81('0x12')]=function(_0x227229){return BPromise['resolve']()[_0x4f81('0xb')](cmHopper[_0x4f81('0x12')](_0x227229))['catch'](loggerCatch(_0x4f81('0x13')));};exports[_0x4f81('0xc')]=function(_0x5d21de,_0x1609fa){create(_0x5d21de)[_0x4f81('0xd')](loggerCatch(_0x1609fa));moveContact(_0x5d21de)[_0x4f81('0xd')](loggerCatch(_0x1609fa));};exports[_0x4f81('0x14')]=function(_0x5a6cbe,_0x4620ae){createAgent(_0x5a6cbe)['catch'](loggerCatch(_0x4620ae));};exports[_0x4f81('0x15')]=function(_0x25a57b,_0x51510a){create(_0x25a57b)['catch'](loggerCatch(_0x51510a));};exports['createCustomerFinal']=function(_0x2ad23e,_0x1e8cdb){moveContact(_0x2ad23e)[_0x4f81('0xd')](loggerCatch(_0x1e8cdb));};exports[_0x4f81('0x16')]=function(_0x24af39,_0x555514,_0x434dce){if(_0x555514){_0x24af39[_0x4f81('0x17')]=null;}if(_0x434dce){_0x24af39['active']=![];}return BPromise[_0x4f81('0xa')]()[_0x4f81('0xb')](cmHopper['rescheduleContact'](_0x24af39))[_0x4f81('0xd')](loggerCatch(_0x4f81('0x18')));};exports[_0x4f81('0x19')]=function(_0x56b59d){return BPromise['resolve']()[_0x4f81('0xb')](cmHopper['countReScheduled'](_0x56b59d))['catch'](loggerCatch(_0x4f81('0x1a')));};exports['unlockContact']=function(_0x5b4965){return BPromise[_0x4f81('0xa')]()[_0x4f81('0xb')](cmHopper[_0x4f81('0x1b')]({'UserId':null},_0x5b4965,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x4f81('0x1c')]=function(_0x58733b){return BPromise[_0x4f81('0xa')]()['then'](cmHopper[_0x4f81('0x1b')]({'active':![]},_0x58733b,0x1))[_0x4f81('0xd')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x4b4156){var _0x4a8f80={};_0x4a8f80['type']=_0x4b4156[_0x4f81('0x1d')];_0x4a8f80[_0x4f81('0x1e')]=_0x4b4156[_0x4f81('0x1e')];_0x4a8f80[_0x4f81('0x1f')]=_0x4b4156[_0x4f81('0x1f')];_0x4a8f80[_0x4f81('0x20')]=_0x4b4156['calleridname'];_0x4a8f80[_0x4f81('0x21')]=_0x4b4156[_0x4f81('0x21')];_0x4a8f80[_0x4f81('0x22')]=_0x4b4156[_0x4f81('0x23')];_0x4a8f80[_0x4f81('0x24')]=_0x4b4156['answertime'];_0x4a8f80[_0x4f81('0x25')]=0x1;_0x4a8f80[_0x4f81('0x26')]=_0x4b4156[_0x4f81('0x27')];_0x4a8f80[_0x4f81('0x28')]=_0x4b4156[_0x4f81('0x29')];_0x4a8f80['context']=_0x4f81('0x2a');_0x4a8f80[_0x4f81('0x2b')]=_0x4f81('0x2c');_0x4a8f80[_0x4f81('0x2d')]=0x0;_0x4a8f80['assigned']=0x1;_0x4a8f80[_0x4f81('0x2e')]=_0x4b4156[_0x4f81('0x29')];_0x4a8f80[_0x4f81('0x2f')]=_0x4f81('0x30');return BPromise['resolve']()[_0x4f81('0xb')](voiceQueueReport[_0x4f81('0x31')](_0x4a8f80))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x4f81('0x32')]=function(_0x5b26c0,_0x11a1d3){return BPromise[_0x4f81('0xa')]()[_0x4f81('0xb')](cmHopper['getContactRecallMe'](_0x5b26c0,_0x11a1d3))[_0x4f81('0xd')](loggerCatch(_0x4f81('0x33')));};exports[_0x4f81('0x34')]=function(_0xe8bcb7){return BPromise[_0x4f81('0xa')]()['then'](cmHopper['rescheduleContact'](_0xe8bcb7,!![],!![]))[_0x4f81('0xd')](loggerCatch(_0x4f81('0x35')));}; \ No newline at end of file +var _0xba11=['queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','xcally-motion-preview','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt'];(function(_0x7d9b02,_0x239b7b){var _0x229a55=function(_0x4d4e1f){while(--_0x4d4e1f){_0x7d9b02['push'](_0x7d9b02['shift']());}};_0x229a55(++_0x239b7b);}(_0xba11,0x1a7));var _0x1ba1=function(_0x16fc2c,_0x4cdc16){_0x16fc2c=_0x16fc2c-0x0;var _0x32e346=_0xba11[_0x16fc2c];return _0x32e346;};'use strict';var util=require(_0x1ba1('0x0'));var BPromise=require('bluebird');var logger=require(_0x1ba1('0x1'))(_0x1ba1('0x2'));var _=require(_0x1ba1('0x3'));var cmHopper=require(_0x1ba1('0x4'));var cmHopperFinal=require(_0x1ba1('0x5'));var cmHopperHistory=require(_0x1ba1('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x1ba1('0x7'));function loggerCatch(_0x5c571d){return function(_0xd23550){logger[_0x1ba1('0x8')](_0x5c571d,util[_0x1ba1('0x9')](_0xd23550,{'showHidden':![],'depth':null}));};}function create(_0x53f000){return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](cmHopperHistory[_0x1ba1('0xc')](_0x53f000))[_0x1ba1('0xd')](loggerCatch(_0x1ba1('0xe')));}function createAgent(_0x267edd){return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](agentReportPreview[_0x1ba1('0xc')](_0x267edd))[_0x1ba1('0xd')](loggerCatch(_0x1ba1('0xe')));}function moveContact(_0x45d87d){return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](cmHopper['moveContactManagedDialer'](_0x45d87d,!![]))[_0x1ba1('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x1ba1('0xf')]=function(_0x5d37d8){return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](cmHopperBlack[_0x1ba1('0xf')](_0x5d37d8))['catch'](loggerCatch(_0x1ba1('0x10')));};exports[_0x1ba1('0x11')]=function(_0x167b3b){return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](cmHopper[_0x1ba1('0x11')](_0x167b3b))[_0x1ba1('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x1ba1('0xc')]=function(_0x41bdf6,_0x4915dc){create(_0x41bdf6)[_0x1ba1('0xd')](loggerCatch(_0x4915dc));moveContact(_0x41bdf6)[_0x1ba1('0xd')](loggerCatch(_0x4915dc));};exports[_0x1ba1('0x12')]=function(_0x2a5f8c,_0x30921c){createAgent(_0x2a5f8c)[_0x1ba1('0xd')](loggerCatch(_0x30921c));};exports[_0x1ba1('0x13')]=function(_0x46a63b,_0x2c2d36){create(_0x46a63b)[_0x1ba1('0xd')](loggerCatch(_0x2c2d36));};exports[_0x1ba1('0x14')]=function(_0x13072c,_0x1896f4){moveContact(_0x13072c)[_0x1ba1('0xd')](loggerCatch(_0x1896f4));};exports[_0x1ba1('0x15')]=function(_0x25470a,_0xab9410,_0x395a8c){if(_0xab9410){_0x25470a['UserId']=null;}if(_0x395a8c){_0x25470a[_0x1ba1('0x16')]=![];}return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](cmHopper[_0x1ba1('0x15')](_0x25470a))[_0x1ba1('0xd')](loggerCatch(_0x1ba1('0x17')));};exports[_0x1ba1('0x18')]=function(_0x38a734){return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](cmHopper['countReScheduled'](_0x38a734))[_0x1ba1('0xd')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x986935){return BPromise['resolve']()[_0x1ba1('0xb')](cmHopper[_0x1ba1('0x19')]({'UserId':null},_0x986935,0x1))[_0x1ba1('0xd')](loggerCatch(_0x1ba1('0x1a')));};exports[_0x1ba1('0x1b')]=function(_0x54a520){return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](cmHopper[_0x1ba1('0x19')]({'active':![]},_0x54a520,0x1))[_0x1ba1('0xd')](loggerCatch(_0x1ba1('0x1c')));};exports['crateCustomerReportQueue']=function(_0x32fb82){var _0x484b34={};_0x484b34[_0x1ba1('0x1d')]=_0x32fb82['type'];_0x484b34[_0x1ba1('0x1e')]=_0x32fb82['uniqueid'];_0x484b34['calleridnum']=_0x32fb82['calleridnum'];_0x484b34[_0x1ba1('0x1f')]=_0x32fb82[_0x1ba1('0x1f')];_0x484b34[_0x1ba1('0x20')]=_0x32fb82['queue'];_0x484b34[_0x1ba1('0x21')]=_0x32fb82[_0x1ba1('0x22')];_0x484b34[_0x1ba1('0x23')]=_0x32fb82[_0x1ba1('0x22')];_0x484b34[_0x1ba1('0x24')]=0x1;_0x484b34[_0x1ba1('0x25')]=_0x32fb82[_0x1ba1('0x26')];_0x484b34['connectedlinename']=_0x32fb82[_0x1ba1('0x27')];_0x484b34[_0x1ba1('0x28')]=_0x1ba1('0x29');_0x484b34['exten']=_0x1ba1('0x2a');_0x484b34['holdtime']=0x0;_0x484b34['assigned']=0x1;_0x484b34[_0x1ba1('0x2b')]=_0x32fb82['membername'];_0x484b34['queuecallerexitreason']=_0x1ba1('0x2c');return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](voiceQueueReport[_0x1ba1('0x2d')](_0x484b34))['catch'](loggerCatch(_0x1ba1('0x2e')));};exports[_0x1ba1('0x2f')]=function(_0x55b113,_0x3313b0){return BPromise[_0x1ba1('0xa')]()[_0x1ba1('0xb')](cmHopper[_0x1ba1('0x2f')](_0x55b113,_0x3313b0))['catch'](loggerCatch(_0x1ba1('0x30')));};exports[_0x1ba1('0x31')]=function(_0x30ba0b){return BPromise['resolve']()[_0x1ba1('0xb')](cmHopper['rescheduleContact'](_0x30ba0b,!![],!![]))[_0x1ba1('0xd')](loggerCatch(_0x1ba1('0x32')));}; \ 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 dda7a5c..1ef6042 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 _0x5142=['replace','random','extractCalleridName','match','util','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','loggerCatch','error','info','inspect','logger2','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','updatedAt','%s%s','XMD-','toUpper','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','statedesc','talktime','answertime','variablesAction','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','clone','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','CampaignId','filterKey','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow'];(function(_0x22dab9,_0x157be6){var _0x21fd4a=function(_0x467083){while(--_0x467083){_0x22dab9['push'](_0x22dab9['shift']());}};_0x21fd4a(++_0x157be6);}(_0x5142,0x108));var _0x2514=function(_0x270ebd,_0x83d024){_0x270ebd=_0x270ebd-0x0;var _0x85b9f0=_0x5142[_0x270ebd];return _0x85b9f0;};'use strict';var util=require(_0x2514('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x2514('0x1'))(_0x2514('0x2'));var ipAgi=process[_0x2514('0x3')][_0x2514('0x4')]||'127.0.0.1';function getSeconds(_0x504cc2,_0x468131){var _0x401069=moment(_0x504cc2)[_0x2514('0x5')](0x0);var _0x7463e2=moment(_0x468131)[_0x2514('0x5')](0x0);return _0x401069[_0x2514('0x6')](_0x7463e2,'seconds');}exports[_0x2514('0x7')]=function(_0x56f99b){return function(_0x6690c1){logger[_0x2514('0x8')](_0x56f99b,util['inspect'](_0x6690c1,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5ed845,_0x38cadf){logger[_0x2514('0x9')](_0x5ed845,util[_0x2514('0xa')](_0x38cadf,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1f2890,_0x3b65f4){logger[_0x2514('0x8')](_0x1f2890,util['inspect'](_0x3b65f4,{'showHidden':![],'depth':null}));};exports[_0x2514('0xb')]=function(_0x4e0f60){return function(_0x1fe902){logger[_0x2514('0x9')](_0x4e0f60,util[_0x2514('0xa')](_0x1fe902,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4000f7,_0x1718ca,_0x13ad95){return{'message':_0x4000f7,'unlock':_0x1718ca,'active':_0x13ad95};};exports[_0x2514('0xc')]=function(_0x10c4d3,_0x1d5425,_0x421084){if(!_[_0x2514('0xd')](_0x421084)&&'string'===typeof _0x421084&&!_[_0x2514('0xe')](_0x421084)){if(!_[_0x2514('0xd')](_0x1d5425)&&_0x2514('0xf')===typeof _0x1d5425&&!_[_0x2514('0xe')](_0x1d5425)){return util[_0x2514('0x10')](_0x2514('0x11'),_0x1d5425,_0x421084);}return util['format'](_0x2514('0x11'),_0x421084,_0x421084);}if(!_['isUndefined'](_0x10c4d3)&&_0x2514('0xf')===typeof _0x10c4d3&&!_[_0x2514('0xe')](_0x10c4d3)){return _0x10c4d3;}return _0x2514('0x12');};exports['isActive']=function(_0x1d3e91){if(_[_0x2514('0x13')](_0x1d3e91)){return![];}return _0x1d3e91;};exports[_0x2514('0x14')]=function(_0x14ecdf,_0x2b7a12,_0x270298,_0x590a4c,_0xa68b5f,_0x322af6){var _0x15e7b9={'XMD-QUEUE':_0x2b7a12[_0x2514('0x15')]?_0x2b7a12['Queue'][_0x2514('0x16')]:'','XMD-CALLERID':_0x590a4c,'XMD-CALLERID-PREVIEW':_0x322af6?util[_0x2514('0x10')]('\x22%s\x22\x20<%s>',_0x322af6[_0x2514('0x17')],_0x322af6[_0x2514('0x18')]):_0x590a4c,'XMD-DIALID':_0xa68b5f,'XMD-CONTACTID':_0x2b7a12[_0x2514('0x19')],'XMD-CDRTYPE':_0x2514('0x1a'),'CALLERID(all)':_0x590a4c,'XMD-VOICEQUEUEID':_0x2b7a12[_0x2514('0x1b')],'XMD-DIALCHANNEL':_0x270298,'XMD-DIALTIMEOUT':_0x14ecdf[_0x2514('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x2514('0x10')]('\x22rtTxX%s%s\x22',_0x14ecdf[_0x2514('0x1d')]?'g':'',_[_0x2514('0xe')](_0x14ecdf['monitor_format'])?'':_0x2514('0x1e')),'XMD-DIALURL':_0x14ecdf['dialPreviewUrl']||'','XMD-AGI':_0x14ecdf[_0x2514('0x1f')]?util[_0x2514('0x10')](_0x2514('0x20'),ipAgi,_0x14ecdf[_0x2514('0x1f')]):_0x2514('0x21'),'XMD-AGIAFTER':_0x14ecdf[_0x2514('0x1d')]?util['format'](_0x2514('0x20'),ipAgi,_0x14ecdf[_0x2514('0x1d')]):_0x2514('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x322af6?_0x322af6[_0x2514('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x322af6?_0x322af6[_0x2514('0x23')]:'','XMD-DESTINATION':_0x2514('0x24')};if(!_[_0x2514('0xe')](_0x14ecdf[_0x2514('0x25')])){_0x15e7b9[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x14ecdf[_0x2514('0x25')];_0x15e7b9[util['format']('%s',_0x2514('0x26'))]=_0xa68b5f;}if(_0x2b7a12&&_0x2b7a12['Contact']){for(var _0x1d7124 in _0x2b7a12[_0x2514('0x27')]){if(_0x2b7a12[_0x2514('0x27')]['hasOwnProperty'](_0x1d7124)){if(!_[_0x2514('0x13')](_0x2b7a12[_0x2514('0x27')][_0x1d7124])&&_0x1d7124!=='id'&&_0x1d7124!=='tags'&&_0x1d7124!=='createdAt'&&_0x1d7124!==_0x2514('0x28')){_0x15e7b9[util[_0x2514('0x10')](_0x2514('0x29'),_0x2514('0x2a'),_[_0x2514('0x2b')](_0x1d7124))]=_0x2b7a12[_0x2514('0x27')][_0x1d7124];}}}}return _0x15e7b9;};exports['toLowerVariables']=function(_0x28cb8a){var _0x58978f={};for(var _0xbafb3b in _0x28cb8a){if(_0x28cb8a[_0x2514('0x2c')](_0xbafb3b)){_0x58978f[util['format']('%s',_[_0x2514('0x2d')](_0xbafb3b))]=_0x28cb8a[_0xbafb3b];}}return{'variables':_0x58978f};};exports[_0x2514('0x2e')]=function(_0x54a521,_0x230434){if(!_[_0x2514('0x13')](_0x54a521)){if(_0x54a521[_0x2514('0x2c')](_0x2514('0x2f'))){if(_0x54a521['originated']>0x0){_0x54a521[_0x2514('0x2f')]-=0x1;}else{logger[_0x2514('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x230434);}}}else{logger['error'](_0x2514('0x30'),_0x230434);}};exports[_0x2514('0x31')]=function(_0xb269f7){var _0x5c92cc=moment()['format'](_0x2514('0x32'));_0xb269f7[_0x2514('0x33')]=0xd;_0xb269f7['statedesc']=_0x2514('0x34');_0xb269f7[_0x2514('0x35')]=_0x5c92cc;_0xb269f7[_0x2514('0x36')]=_0x5c92cc;_0xb269f7[_0x2514('0x37')]=_0x5c92cc;};exports[_0x2514('0x38')]=function(_0x1c0937,_0x34c40b,_0x1164c0){var _0x581a05=moment()[_0x2514('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c0937[_0x2514('0x33')]=_0x34c40b;_0x1c0937['statedesc']=_0x1164c0;_0x1c0937[_0x2514('0x36')]=_0x581a05;_0x1c0937[_0x2514('0x39')]=getSeconds(_0x1c0937[_0x2514('0x36')],_0x1c0937[_0x2514('0x35')]);};exports[_0x2514('0x3a')]=function(_0x1e24f6,_0x35eb5f,_0x247a05){_0x1e24f6[_0x2514('0x3b')]=_0x35eb5f;_0x1e24f6[_0x2514('0x3c')]=_0x247a05;};exports[_0x2514('0x3d')]=function(_0x4b930b,_0x4595b5,_0x3e58d4){var _0xe9225e=moment()['format'](_0x2514('0x32'));_0x4b930b['state']=_0x4595b5;_0x4b930b[_0x2514('0x3e')]=_0x3e58d4;_0x4b930b['responsetime']=_0x4b930b['responsetime']?_0x4b930b[_0x2514('0x36')]:_0xe9225e;_0x4b930b[_0x2514('0x37')]=_0x4b930b[_0x2514('0x37')]?_0x4b930b[_0x2514('0x37')]:_0xe9225e;_0x4b930b[_0x2514('0x39')]=getSeconds(_0x4b930b[_0x2514('0x36')]||0x0,_0x4b930b[_0x2514('0x35')]||0x0);_0x4b930b[_0x2514('0x3f')]=_0x4b930b['answertime']?getSeconds(_0x4b930b[_0x2514('0x37')],_0x4b930b[_0x2514('0x40')]):0x0;};exports['isFailure']=function(_0x12036a){return _0x12036a==='Failure';};exports[_0x2514('0x41')]=function(_0x5f458c,_0xe66e50,_0x90e8e5,_0x1a92ab,_0x109c23){var _0x15afa6=_0x1a92ab?'RECALL':_0x5f458c[_0x2514('0x17')];_0x15afa6=_0x109c23?_0x2514('0x42'):_0x15afa6;return{'actionid':_0x5f458c[_0x2514('0x43')],'action':_0x2514('0x44'),'channel':_0x5f458c[_0x2514('0x45')],'callerid':util['format'](_0x2514('0x11'),_0x15afa6,_0x5f458c['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x90e8e5,'timeout':(_0xe66e50[_0x2514('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5f458c[_0x2514('0x43')]};};exports[_0x2514('0x47')]=function(_0x398a9a){return _0x398a9a[_0x2514('0x48')]+_0x398a9a[_0x2514('0x49')]+_0x398a9a[_0x2514('0x4a')];};exports['cloneAction']=function(_0x595045){var _0x4173fb=_[_0x2514('0x4b')](_0x595045);_0x4173fb[_0x2514('0x33')]=0xf;_0x4173fb[_0x2514('0x3e')]='Global';return _0x4173fb;};exports[_0x2514('0x4c')]=function(_0x114bf1,_0xe68265,_0x187c4a){var _0x1fa35b={};_0x1fa35b[_0xe68265]=_0x114bf1[_0xe68265];_0x1fa35b[_0x2514('0x4d')]=![];_0x1fa35b[_0x2514('0x4e')]=moment()['add'](_0x187c4a,_0x2514('0x4f'))[_0x2514('0x10')](_0x2514('0x32'));_0x1fa35b[_0x2514('0x19')]=_0x114bf1['ContactId'];_0x1fa35b[_0x2514('0x50')]=_0x114bf1[_0x2514('0x50')];_0x1fa35b[_0x2514('0x1b')]=_0x114bf1[_0x2514('0x1b')]||undefined;return _0x1fa35b;};exports[_0x2514('0x51')]=function(_0x576e1c,_0x20d909){if(!_[_0x2514('0x13')](_0x576e1c)){if(_0x576e1c[_0x2514('0x52')]>0x0){_0x576e1c[_0x2514('0x52')]-=0x1;}else{logger['error'](_0x20d909,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x20d909,_0x2514('0x53'));}};exports[_0x2514('0x54')]=function(_0x5a2898){if(_0x5a2898<=0x0){return!![];}return![];};exports['buildObj']=function(_0xde159c,_0x1a08f2){_0xde159c[_0x2514('0x55')]=_0x1a08f2;_0xde159c['name']=_0xde159c[_0x2514('0x56')];_0xde159c[_0x2514('0x57')]=_0xde159c[_0x2514('0x45')];return _0xde159c;};exports['buildAcw']=function(_0x485f48){var _0x22a289={};_0x22a289[_0x2514('0x56')]=_0x485f48['queue'];_0x22a289[_0x2514('0x57')]=_0x485f48['channelAgent'];_0x22a289[_0x2514('0x43')]=_0x485f48[_0x2514('0x43')];return _0x22a289;};exports[_0x2514('0x58')]=function(_0x3c1498){var _0x58686b=[];for(var _0x479dcd in _0x3c1498){if(_0x3c1498[_0x2514('0x2c')](_0x479dcd)){if(!_['isNil'](_0x3c1498[_0x479dcd])&&_0x3c1498[_0x479dcd][_0x2514('0x33')]===_0x2514('0x59')&&_0x3c1498[_0x479dcd][_0x2514('0x5a')]===_0x2514('0x5b')){_0x58686b[_0x2514('0x5c')](_0x3c1498[_0x479dcd]['id']);}}}return _0x58686b;};exports[_0x2514('0x5d')]=function(_0x1d89be){var _0x405822=moment()['milliseconds'](0x0);var _0x324e81=moment(_0x1d89be)['milliseconds'](0x0);return _0x405822[_0x2514('0x6')](_0x324e81,_0x2514('0x5e'));};exports['createBody']=function(_0x3a82f2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3a82f2[_0x2514('0x19')],'ListId':_0x3a82f2[_0x2514('0x50')],'VoiceQueueId':_0x3a82f2['VoiceQueueId']||undefined,'CampaignId':_0x3a82f2[_0x2514('0x5f')]||undefined};};exports[_0x2514('0x60')]=function(_0x37a203){if(_0x37a203===_0x2514('0x43')||_0x37a203==='idContact'||_0x37a203===_0x2514('0x56')||_0x37a203===_0x2514('0x61')||_0x37a203===_0x2514('0x62')||_0x37a203===_0x2514('0x63')||_0x37a203===_0x2514('0x3b')||_0x37a203===_0x2514('0x45')||_0x37a203===_0x2514('0x17')||_0x37a203==='active'||_0x37a203==='calleridnum'||_0x37a203===_0x2514('0x4e')||_0x37a203===_0x2514('0x48')||_0x37a203==='countcongestionretry'||_0x37a203==='countnoanswerretry'||_0x37a203===_0x2514('0x64')||_0x37a203===_0x2514('0x65')||_0x37a203===_0x2514('0x66')||_0x37a203===_0x2514('0x67')||_0x37a203===_0x2514('0x68')||_0x37a203===_0x2514('0x19')||_0x37a203===_0x2514('0x50')||_0x37a203==='UserId'||_0x37a203===_0x2514('0x1b')||_0x37a203===_0x2514('0x69')||_0x37a203==='xmd-voicequeueid'||_0x37a203==='xmd-queue'||_0x37a203===_0x2514('0x6a')||_0x37a203==='xmd-listid'||_0x37a203===_0x2514('0x6b')||_0x37a203==='xmd-dialtimeout'||_0x37a203===_0x2514('0x6c')||_0x37a203==='xmd-dialid'||_0x37a203===_0x2514('0x6d')||_0x37a203==='xmd-contactid'||_0x37a203===_0x2514('0x6e')||_0x37a203===_0x2514('0x6f')||_0x37a203===_0x2514('0x70')||_0x37a203===_0x2514('0x71')||_0x37a203===_0x2514('0x72')||_0x37a203==='rtpaudioqosbridged'||_0x37a203===_0x2514('0x73')||_0x37a203===_0x2514('0x74')||_0x37a203===_0x2514('0x75')||_0x37a203===_0x2514('0x76')||_0x37a203===_0x2514('0x77')||_0x37a203==='rtpaudioqosrttbridged'||_0x37a203===_0x2514('0x72')||_0x37a203===_0x2514('0x78')||_0x37a203===_0x2514('0x73')||_0x37a203==='rtpaudioqosjitterbridged'||_0x37a203===_0x2514('0x75')||_0x37a203===_0x2514('0x76')||_0x37a203===_0x2514('0x77')||_0x37a203===_0x2514('0x79')||_0x37a203===_0x2514('0x7a')||_0x37a203===_0x2514('0x7b')||_0x37a203===_0x2514('0x33')||_0x37a203==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x197ebb,_0x2f3688){var _0x219afe,_0x55711b,_0x1673b3;if(_0x2f3688<=0x0){_0x2f3688=0x1;}_0x219afe=new RegExp(_0x2514('0x7c')+_0x2f3688+'}$');_0x55711b=Math[_0x2514('0x7d')](0xa,_0x2f3688-0x1);_0x1673b3=Math[_0x2514('0x7d')](0xa,_0x2f3688)-0x1;return util[_0x2514('0x10')]('%s',_[_0x2514('0x7e')](_0x197ebb,_0x219afe,_[_0x2514('0x7f')](_0x55711b,_0x1673b3)));};exports[_0x2514('0x80')]=function(_0x9bac00){var _0x1f644a=_0x9bac00['match'](/"(.*?)"/);return _0x1f644a?_0x1f644a[0x1]:_0x9bac00;};exports['extractCalleridNumber']=function(_0x5bece7){var _0x3386c5=_0x5bece7[_0x2514('0x81')](/<(.*?)>/);return _0x3386c5?_0x3386c5[0x1]:_0x5bece7;}; \ No newline at end of file +var _0x2b2d=['originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','responsetime','logAgent','ringtime','membername','logCustomer','endtime','answertime','isFailure','Failure','RECALL','calleridname','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','Global','active','scheduledat','add','ListId','VoiceQueueId','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','buildAcw','agentReadyId','state','not_inuse','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','type','campaigntype','countnoanswerretry','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepeer','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','logger','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','calleridnum','ContactId','\x22rtTxX%s%s\x22','monitor_format','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum'];(function(_0x2475fb,_0x238ba5){var _0x5a879a=function(_0x997461){while(--_0x997461){_0x2475fb['push'](_0x2475fb['shift']());}};_0x5a879a(++_0x238ba5);}(_0x2b2d,0x165));var _0xd2b2=function(_0xcfed91,_0x29b51b){_0xcfed91=_0xcfed91-0x0;var _0x42e245=_0x2b2d[_0xcfed91];return _0x42e245;};'use strict';var util=require(_0xd2b2('0x0'));var _=require(_0xd2b2('0x1'));var moment=require(_0xd2b2('0x2'));var logger=require(_0xd2b2('0x3'))(_0xd2b2('0x4'));var ipAgi=process[_0xd2b2('0x5')]['XCALLY_IP_AGI']||_0xd2b2('0x6');function getSeconds(_0x18dacc,_0x362d05){var _0x43020c=moment(_0x18dacc)[_0xd2b2('0x7')](0x0);var _0x146fa5=moment(_0x362d05)[_0xd2b2('0x7')](0x0);return _0x43020c[_0xd2b2('0x8')](_0x146fa5,'seconds');}exports[_0xd2b2('0x9')]=function(_0x25fc22){return function(_0x4ac8c6){logger[_0xd2b2('0xa')](_0x25fc22,util[_0xd2b2('0xb')](_0x4ac8c6,{'showHidden':![],'depth':null}));};};exports[_0xd2b2('0xc')]=function(_0x5d336d,_0x19bc6f){logger['info'](_0x5d336d,util[_0xd2b2('0xb')](_0x19bc6f,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3c0fcb,_0x1496ec){logger[_0xd2b2('0xa')](_0x3c0fcb,util[_0xd2b2('0xb')](_0x1496ec,{'showHidden':![],'depth':null}));};exports[_0xd2b2('0xd')]=function(_0x4e5783){return function(_0x5b18c0){logger[_0xd2b2('0xe')](_0x4e5783,util['inspect'](_0x5b18c0,{'showHidden':![],'depth':null}));};};exports[_0xd2b2('0xf')]=function(_0x1e9b33,_0x8218c4,_0x4a523f){return{'message':_0x1e9b33,'unlock':_0x8218c4,'active':_0x4a523f};};exports[_0xd2b2('0x10')]=function(_0x42f77a,_0x49bb8e,_0x1a2c23){if(!_[_0xd2b2('0x11')](_0x1a2c23)&&_0xd2b2('0x12')===typeof _0x1a2c23&&!_[_0xd2b2('0x13')](_0x1a2c23)){if(!_['isUndefined'](_0x49bb8e)&&_0xd2b2('0x12')===typeof _0x49bb8e&&!_[_0xd2b2('0x13')](_0x49bb8e)){return util[_0xd2b2('0x14')](_0xd2b2('0x15'),_0x49bb8e,_0x1a2c23);}return util[_0xd2b2('0x14')]('\x22%s\x22\x20<%s>',_0x1a2c23,_0x1a2c23);}if(!_[_0xd2b2('0x11')](_0x42f77a)&&_0xd2b2('0x12')===typeof _0x42f77a&&!_[_0xd2b2('0x13')](_0x42f77a)){return _0x42f77a;}return _0xd2b2('0x16');};exports[_0xd2b2('0x17')]=function(_0x3cb1c1){if(_[_0xd2b2('0x18')](_0x3cb1c1)){return![];}return _0x3cb1c1;};exports['addVariables']=function(_0x2163e2,_0x23a245,_0x50c57a,_0x3c78cc,_0x5c0573,_0x5139d5){var _0x3d6533={'XMD-QUEUE':_0x23a245[_0xd2b2('0x19')]?_0x23a245['Queue']['name']:'','XMD-CALLERID':_0x3c78cc,'XMD-CALLERID-PREVIEW':_0x5139d5?util['format'](_0xd2b2('0x15'),_0x5139d5['calleridname'],_0x5139d5[_0xd2b2('0x1a')]):_0x3c78cc,'XMD-DIALID':_0x5c0573,'XMD-CONTACTID':_0x23a245[_0xd2b2('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3c78cc,'XMD-VOICEQUEUEID':_0x23a245['VoiceQueueId'],'XMD-DIALCHANNEL':_0x50c57a,'XMD-DIALTIMEOUT':_0x2163e2['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xd2b2('0x14')](_0xd2b2('0x1c'),_0x2163e2['dialQueueProject2']?'g':'',_[_0xd2b2('0x13')](_0x2163e2[_0xd2b2('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2163e2[_0xd2b2('0x1e')]||'','XMD-AGI':_0x2163e2[_0xd2b2('0x1f')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x2163e2[_0xd2b2('0x1f')]):_0xd2b2('0x20'),'XMD-AGIAFTER':_0x2163e2[_0xd2b2('0x21')]?util[_0xd2b2('0x14')](_0xd2b2('0x22'),ipAgi,_0x2163e2[_0xd2b2('0x21')]):_0xd2b2('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x5139d5?_0x5139d5[_0xd2b2('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x5139d5?_0x5139d5[_0xd2b2('0x24')]:'','XMD-DESTINATION':_0xd2b2('0x25')};if(!_[_0xd2b2('0x13')](_0x2163e2['monitor_format'])){_0x3d6533[util['format']('%s',_0xd2b2('0x26'))]=_0x2163e2['monitor_format'];_0x3d6533[util[_0xd2b2('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5c0573;}if(_0x23a245&&_0x23a245[_0xd2b2('0x27')]){for(var _0x46c96d in _0x23a245[_0xd2b2('0x27')]){if(_0x23a245[_0xd2b2('0x27')][_0xd2b2('0x28')](_0x46c96d)){if(!_[_0xd2b2('0x18')](_0x23a245[_0xd2b2('0x27')][_0x46c96d])&&_0x46c96d!=='id'&&_0x46c96d!=='tags'&&_0x46c96d!=='createdAt'&&_0x46c96d!=='updatedAt'){_0x3d6533[util[_0xd2b2('0x14')](_0xd2b2('0x29'),_0xd2b2('0x2a'),_[_0xd2b2('0x2b')](_0x46c96d))]=_0x23a245[_0xd2b2('0x27')][_0x46c96d];}}}}return _0x3d6533;};exports[_0xd2b2('0x2c')]=function(_0x22b406){var _0xb7df3e={};for(var _0x25d32b in _0x22b406){if(_0x22b406['hasOwnProperty'](_0x25d32b)){_0xb7df3e[util[_0xd2b2('0x14')]('%s',_['toLower'](_0x25d32b))]=_0x22b406[_0x25d32b];}}return{'variables':_0xb7df3e};};exports[_0xd2b2('0x2d')]=function(_0x1ed7e7,_0x4f7220){if(!_[_0xd2b2('0x18')](_0x1ed7e7)){if(_0x1ed7e7[_0xd2b2('0x28')](_0xd2b2('0x2e'))){if(_0x1ed7e7[_0xd2b2('0x2e')]>0x0){_0x1ed7e7[_0xd2b2('0x2e')]-=0x1;}else{logger['error'](_0xd2b2('0x2f'),_0x4f7220);}}}else{logger[_0xd2b2('0xa')](_0xd2b2('0x30'),_0x4f7220);}};exports['logBlacklist']=function(_0x288cf7){var _0xf65016=moment()['format'](_0xd2b2('0x31'));_0x288cf7['state']=0xd;_0x288cf7[_0xd2b2('0x32')]='Blacklist';_0x288cf7[_0xd2b2('0x33')]=_0xf65016;_0x288cf7[_0xd2b2('0x34')]=_0xf65016;_0x288cf7['endtime']=_0xf65016;};exports[_0xd2b2('0x35')]=function(_0x23f4fb,_0x35a5f2,_0x11a50a){var _0x370dc7=moment()[_0xd2b2('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x23f4fb['state']=_0x35a5f2;_0x23f4fb[_0xd2b2('0x32')]=_0x11a50a;_0x23f4fb[_0xd2b2('0x34')]=_0x370dc7;_0x23f4fb[_0xd2b2('0x36')]=getSeconds(_0x23f4fb[_0xd2b2('0x34')],_0x23f4fb['starttime']);};exports['logLookAgent']=function(_0x1b4720,_0x437693,_0x530f68){_0x1b4720[_0xd2b2('0x37')]=_0x437693;_0x1b4720['UserId']=_0x530f68;};exports[_0xd2b2('0x38')]=function(_0x5471c9,_0x27d242,_0x2778a1){var _0x414236=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5471c9['state']=_0x27d242;_0x5471c9[_0xd2b2('0x32')]=_0x2778a1;_0x5471c9[_0xd2b2('0x34')]=_0x5471c9[_0xd2b2('0x34')]?_0x5471c9[_0xd2b2('0x34')]:_0x414236;_0x5471c9[_0xd2b2('0x39')]=_0x5471c9[_0xd2b2('0x39')]?_0x5471c9[_0xd2b2('0x39')]:_0x414236;_0x5471c9[_0xd2b2('0x36')]=getSeconds(_0x5471c9['responsetime']||0x0,_0x5471c9[_0xd2b2('0x33')]||0x0);_0x5471c9['talktime']=_0x5471c9[_0xd2b2('0x3a')]?getSeconds(_0x5471c9[_0xd2b2('0x39')],_0x5471c9[_0xd2b2('0x3a')]):0x0;};exports[_0xd2b2('0x3b')]=function(_0x199629){return _0x199629===_0xd2b2('0x3c');};exports['variablesAction']=function(_0x17c4e0,_0x149dda,_0x2ccbfc,_0x5ef5c3,_0x53a506){var _0x3c4622=_0x5ef5c3?_0xd2b2('0x3d'):_0x17c4e0[_0xd2b2('0x3e')];_0x3c4622=_0x53a506?'BOOKED':_0x3c4622;return{'actionid':_0x17c4e0[_0xd2b2('0x3f')],'action':_0xd2b2('0x40'),'channel':_0x17c4e0[_0xd2b2('0x41')],'callerid':util[_0xd2b2('0x14')](_0xd2b2('0x15'),_0x3c4622,_0x17c4e0['calleridnum']),'Exten':_0xd2b2('0x25'),'Context':'from-sip','Priority':'1','variable':_0x2ccbfc,'timeout':(_0x149dda[_0xd2b2('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x17c4e0['uniqueid']};};exports[_0xd2b2('0x43')]=function(_0x584d8c){return _0x584d8c[_0xd2b2('0x44')]+_0x584d8c[_0xd2b2('0x45')]+_0x584d8c['countnoanswerretry'];};exports[_0xd2b2('0x46')]=function(_0x324a51){var _0x5cc69f=_['clone'](_0x324a51);_0x5cc69f['state']=0xf;_0x5cc69f[_0xd2b2('0x32')]=_0xd2b2('0x47');return _0x5cc69f;};exports['scheduledAt']=function(_0x3f8458,_0x221054,_0x1a7611){var _0x19513b={};_0x19513b[_0x221054]=_0x3f8458[_0x221054];_0x19513b[_0xd2b2('0x48')]=![];_0x19513b[_0xd2b2('0x49')]=moment()[_0xd2b2('0x4a')](_0x1a7611,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x19513b[_0xd2b2('0x1b')]=_0x3f8458[_0xd2b2('0x1b')];_0x19513b[_0xd2b2('0x4b')]=_0x3f8458[_0xd2b2('0x4b')];_0x19513b[_0xd2b2('0x4c')]=_0x3f8458['VoiceQueueId']||undefined;return _0x19513b;};exports['decrementTalkink']=function(_0x3d5e9e,_0x13e6e){if(!_[_0xd2b2('0x18')](_0x3d5e9e)){if(_0x3d5e9e['pTalking']>0x0){_0x3d5e9e['pTalking']-=0x1;}else{logger[_0xd2b2('0xa')](_0x13e6e,_0xd2b2('0x4d'));}}else{logger['error'](_0x13e6e,_0xd2b2('0x4e'));}};exports[_0xd2b2('0x4f')]=function(_0xd9b090){if(_0xd9b090<=0x0){return!![];}return![];};exports['buildObj']=function(_0x2f0c5a,_0x312cb7){_0x2f0c5a[_0xd2b2('0x50')]=_0x312cb7;_0x2f0c5a['name']=_0x2f0c5a[_0xd2b2('0x51')];_0x2f0c5a[_0xd2b2('0x52')]=_0x2f0c5a[_0xd2b2('0x41')];return _0x2f0c5a;};exports[_0xd2b2('0x53')]=function(_0x3cbf5f){var _0x5452dc={};_0x5452dc[_0xd2b2('0x51')]=_0x3cbf5f['queue'];_0x5452dc[_0xd2b2('0x52')]=_0x3cbf5f[_0xd2b2('0x41')];_0x5452dc[_0xd2b2('0x3f')]=_0x3cbf5f[_0xd2b2('0x3f')];return _0x5452dc;};exports[_0xd2b2('0x54')]=function(_0x5e4b88){var _0x2f1a37=[];for(var _0x2446f6 in _0x5e4b88){if(_0x5e4b88['hasOwnProperty'](_0x2446f6)){if(!_[_0xd2b2('0x18')](_0x5e4b88[_0x2446f6])&&_0x5e4b88[_0x2446f6][_0xd2b2('0x55')]===_0xd2b2('0x56')&&_0x5e4b88[_0x2446f6]['status']===_0xd2b2('0x57')){_0x2f1a37[_0xd2b2('0x58')](_0x5e4b88[_0x2446f6]['id']);}}}return _0x2f1a37;};exports[_0xd2b2('0x59')]=function(_0x127fea){var _0x250b56=moment()[_0xd2b2('0x7')](0x0);var _0x36666a=moment(_0x127fea)[_0xd2b2('0x7')](0x0);return _0x250b56[_0xd2b2('0x8')](_0x36666a,_0xd2b2('0x5a'));};exports[_0xd2b2('0x5b')]=function(_0x321d02){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x321d02[_0xd2b2('0x1b')],'ListId':_0x321d02[_0xd2b2('0x4b')],'VoiceQueueId':_0x321d02[_0xd2b2('0x4c')]||undefined,'CampaignId':_0x321d02[_0xd2b2('0x5c')]||undefined};};exports[_0xd2b2('0x5d')]=function(_0xd97463){if(_0xd97463===_0xd2b2('0x3f')||_0xd97463==='idContact'||_0xd97463==='queue'||_0xd97463===_0xd2b2('0x5e')||_0xd97463===_0xd2b2('0x5f')||_0xd97463==='dialAnswer'||_0xd97463===_0xd2b2('0x37')||_0xd97463==='channelAgent'||_0xd97463===_0xd2b2('0x3e')||_0xd97463===_0xd2b2('0x48')||_0xd97463===_0xd2b2('0x1a')||_0xd97463==='scheduledat'||_0xd97463==='countbusyretry'||_0xd97463===_0xd2b2('0x45')||_0xd97463===_0xd2b2('0x60')||_0xd97463==='countglobal'||_0xd97463===_0xd2b2('0x61')||_0xd97463==='callbackuniqueid'||_0xd97463===_0xd2b2('0x62')||_0xd97463===_0xd2b2('0x63')||_0xd97463===_0xd2b2('0x1b')||_0xd97463===_0xd2b2('0x4b')||_0xd97463===_0xd2b2('0x64')||_0xd97463===_0xd2b2('0x4c')||_0xd97463===_0xd2b2('0x65')||_0xd97463===_0xd2b2('0x66')||_0xd97463===_0xd2b2('0x67')||_0xd97463===_0xd2b2('0x68')||_0xd97463===_0xd2b2('0x69')||_0xd97463===_0xd2b2('0x6a')||_0xd97463===_0xd2b2('0x6b')||_0xd97463===_0xd2b2('0x6c')||_0xd97463===_0xd2b2('0x6d')||_0xd97463===_0xd2b2('0x6e')||_0xd97463===_0xd2b2('0x6f')||_0xd97463===_0xd2b2('0x70')||_0xd97463===_0xd2b2('0x71')||_0xd97463===_0xd2b2('0x72')||_0xd97463==='xmd-agi'||_0xd97463==='rtpaudioqos'||_0xd97463===_0xd2b2('0x73')||_0xd97463===_0xd2b2('0x74')||_0xd97463==='rtpaudioqosjitterbridged'||_0xd97463===_0xd2b2('0x75')||_0xd97463===_0xd2b2('0x76')||_0xd97463===_0xd2b2('0x77')||_0xd97463===_0xd2b2('0x78')||_0xd97463===_0xd2b2('0x79')||_0xd97463==='rtpaudioqosbridged'||_0xd97463===_0xd2b2('0x74')||_0xd97463===_0xd2b2('0x7a')||_0xd97463===_0xd2b2('0x75')||_0xd97463===_0xd2b2('0x76')||_0xd97463===_0xd2b2('0x77')||_0xd97463===_0xd2b2('0x78')||_0xd97463===_0xd2b2('0x7b')||_0xd97463==='bridgepvtcallid'||_0xd97463==='state'||_0xd97463===_0xd2b2('0x32')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x56d455,_0x501ca2){var _0x51515d,_0x12c48a,_0x2ead94;if(_0x501ca2<=0x0){_0x501ca2=0x1;}_0x51515d=new RegExp(_0xd2b2('0x7c')+_0x501ca2+'}$');_0x12c48a=Math[_0xd2b2('0x7d')](0xa,_0x501ca2-0x1);_0x2ead94=Math['pow'](0xa,_0x501ca2)-0x1;return util[_0xd2b2('0x14')]('%s',_[_0xd2b2('0x7e')](_0x56d455,_0x51515d,_[_0xd2b2('0x7f')](_0x12c48a,_0x2ead94)));};exports[_0xd2b2('0x80')]=function(_0x3a286d){var _0x42ea40=_0x3a286d[_0xd2b2('0x81')](/"(.*?)"/);return _0x42ea40?_0x42ea40[0x1]:_0x3a286d;};exports[_0xd2b2('0x82')]=function(_0x240501){var _0x4f9434=_0x240501['match'](/<(.*?)>/);return _0x4f9434?_0x4f9434[0x1]:_0x240501;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 31efbfd..c9aa30d 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 _0x0c02=['number','boolean','queueremove','queuepause','reload','voicequeuechannelhangup','string'];(function(_0x2b3d55,_0x2e668f){var _0x2b759b=function(_0x36aa23){while(--_0x36aa23){_0x2b3d55['push'](_0x2b3d55['shift']());}};_0x2b759b(++_0x2e668f);}(_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 +var _0x4491=['voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x4491,0x1bb));var _0x1449=function(_0x3e63a2,_0x5c8fe5){_0x3e63a2=_0x3e63a2-0x0;var _0x3cd244=_0x4491[_0x3e63a2];return _0x3cd244;};'use strict';exports[_0x1449('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x1449('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x1449('0x2'),'required':![]},'paused':{'type':_0x1449('0x3'),'required':![]}};exports[_0x1449('0x4')]={'queue':{'type':_0x1449('0x1'),'required':!![]},'interface':{'type':_0x1449('0x1'),'required':!![]}};exports[_0x1449('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x1449('0x3')},'reason':{'type':'string','required':![]}};exports[_0x1449('0x6')]={'module':{'type':_0x1449('0x1'),'required':![]}};exports[_0x1449('0x7')]={'uniqueid':{'type':_0x1449('0x1'),'required':!![]}};exports[_0x1449('0x8')]={'uniqueid':{'type':_0x1449('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x1449('0x1')},'mixmonitorid':{'type':_0x1449('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x1449('0x1'),'required':!![]}};exports[_0x1449('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x1449('0x1'),'required':!![]},'context':{'type':_0x1449('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 4eeb326..b7df166 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 _0x355e=['name','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumHoldTime','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','agents','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','total','queuecallercomplete','answered','queuecallercompleteAt','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','telephones','trunks','triggers','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','interface'];(function(_0xe37f31,_0x5cbeae){var _0x4890ec=function(_0xd94b81){while(--_0xd94b81){_0xe37f31['push'](_0xe37f31['shift']());}};_0x4890ec(++_0x5cbeae);}(_0x355e,0xa7));var _0xe355=function(_0x59f3c8,_0x269e43){_0x59f3c8=_0x59f3c8-0x0;var _0x320c2f=_0x355e[_0x59f3c8];return _0x320c2f;};'use strict';var BPromise=require(_0xe355('0x0'));var util=require(_0xe355('0x1'));var _=require('lodash');var moment=require(_0xe355('0x2'));var Agent=require(_0xe355('0x3'));var Telephone=require(_0xe355('0x4'));var Trunk=require(_0xe355('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0xe355('0x6'));var Campaign=require(_0xe355('0x7'));var VoiceExtension=require(_0xe355('0x8'));var ZendeskAccount=require(_0xe355('0x9'));var SalesforceAccount=require(_0xe355('0xa'));var FreshdeskAccount=require(_0xe355('0xb'));var SugarcrmAccount=require(_0xe355('0xc'));var ZohoAccount=require(_0xe355('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe355('0xe'));var ServicenowAccount=require(_0xe355('0xf'));var Dynamics365Account=require(_0xe355('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0xe355('0x11')]={};this[_0xe355('0x12')]={};this['voiceQueues']={};this[_0xe355('0x13')]={};this[_0xe355('0x14')]={};this[_0xe355('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe355('0x16')]={};this[_0xe355('0x17')]={};this[_0xe355('0x18')]={};this[_0xe355('0x19')]={};this[_0xe355('0x1a')]={};this[_0xe355('0x1b')]={};this[_0xe355('0x1c')]={};this[_0xe355('0x1d')]={};this[_0xe355('0x1e')]={};this['zohoAccounts']={};this[_0xe355('0x1f')]={};this[_0xe355('0x20')]={};this['servicenowAccounts']={};this[_0xe355('0x21')]={};this[_0xe355('0x22')]={};};function freeIsNotKey(_0x338099,_0x26abf6,_0x1a604){var _0x445d4d=_[_0xe355('0x23')](_0x338099,function(_0x548c1c,_0x2e2230){return _0x548c1c[_0x1a604];});for(var _0x1b602e in _0x26abf6){if(_0x26abf6['hasOwnProperty'](_0x1b602e)){if(!_0x445d4d[_0x1b602e]){delete _0x26abf6[_0x1b602e];}}}}function freeIsNotKeySip(_0x1266d5,_0x1d71b0){var _0x3d5fc5=_['mapKeys'](_0x1266d5,function(_0x2465ad,_0x7248dd){return util[_0xe355('0x24')](_0xe355('0x25'),_0x2465ad['name']);});for(var _0x38aaed in _0x1d71b0){if(_0x1d71b0[_0xe355('0x26')](_0x38aaed)){if(!_0x3d5fc5[_0x38aaed]){delete _0x1d71b0[_0x38aaed];}}}}function freeIsNotKeyAgent(_0x2f4c55,_0x4d100a){var _0x7c0106=_[_0xe355('0x23')](_0x2f4c55,function(_0x39a7c0,_0x43bcad){var _0x20f237=_[_0xe355('0x27')](_0x39a7c0[_0xe355('0x28')])?util[_0xe355('0x24')]('SIP/%s',_0x39a7c0[_0xe355('0x29')]):_0x39a7c0[_0xe355('0x28')];return _0x20f237;});for(var _0x5aae40 in _0x4d100a){if(_0x4d100a[_0xe355('0x26')](_0x5aae40)){if(!_0x7c0106[_0x5aae40]){delete _0x4d100a[_0x5aae40];}}}}function clearVoiceCallReports(_0x283a4f){_0x283a4f['total']=0x0;_0x283a4f['answered']=0x0;_0x283a4f['sumHoldTime']=0x0;_0x283a4f['sumDuration']=0x0;_0x283a4f[_0xe355('0x2a')]=0x0;}function clearCampaigns(_0x20858d){if(!_[_0xe355('0x2b')](_0x20858d)){for(var _0x5bad20 in _0x20858d){if(_0x20858d[_0xe355('0x26')](_0x5bad20)){_0x20858d[_0x5bad20][_0xe355('0x2c')]=0x0;_0x20858d[_0x5bad20][_0xe355('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x45d644){if(!_[_0xe355('0x2b')](_0x45d644)){for(var _0x482966 in _0x45d644){if(_0x45d644['hasOwnProperty'](_0x482966)){_0x45d644[_0x482966]['total']=0x0;_0x45d644[_0x482966]['answered']=0x0;_0x45d644[_0x482966][_0xe355('0x2e')]=0x0;_0x45d644[_0x482966]['abandoned']=0x0;_0x45d644[_0x482966][_0xe355('0x2f')]=0x0;_0x45d644[_0x482966][_0xe355('0x30')]=0x0;_0x45d644[_0x482966][_0xe355('0x2a')]=0x0;_0x45d644[_0x482966][_0xe355('0x31')]=0x0;_0x45d644[_0x482966][_0xe355('0x32')]=0x0;_0x45d644[_0x482966][_0xe355('0x33')]=0x0;_0x45d644[_0x482966][_0xe355('0x34')]=0x0;_0x45d644[_0x482966]['outboundNoSuchCallsDay']=0x0;_0x45d644[_0x482966]['outboundUnknownCallsDay']=0x0;_0x45d644[_0x482966][_0xe355('0x35')]=0x0;_0x45d644[_0x482966][_0xe355('0x36')]=0x0;_0x45d644[_0x482966]['outboundBlacklistCallsDay']=0x0;_0x45d644[_0x482966]['outboundOriginateFailureCallsDay']=0x0;_0x45d644[_0x482966]['outboundRejectCallsDay']=0x0;_0x45d644[_0x482966]['outboundReCallsDay']=0x0;_0x45d644[_0x482966]['outboundAnswerAgiCallsDay']=0x0;_0x45d644[_0x482966][_0xe355('0x37')]=0x0;_0x45d644[_0x482966][_0xe355('0x38')]=!![];}}}}Realtime['prototype'][_0xe355('0x39')]=function(_0x3d4712,_0x299541){for(var _0x2f2d15 in _0x299541){if(_0x3d4712[_0xe355('0x26')](_0x2f2d15)){_0x3d4712[_0x2f2d15]=_0x299541[_0x2f2d15];}}};Realtime[_0xe355('0x3a')][_0xe355('0x3b')]=function(){var _0x5ec887=this;return function(_0xc2301){if(_0xc2301){freeIsNotKeyAgent(_0xc2301,_0x5ec887['agents']);for(var _0x1379f0=0x0,_0x32769d={},_0x2b11f5={};_0x1379f0<_0xc2301[_0xe355('0x3c')];_0x1379f0+=0x1){_0x32769d=_0xc2301[_0x1379f0];var _0x229072=_[_0xe355('0x27')](_0x32769d[_0xe355('0x28')])?util['format']('SIP/%s',_0x32769d[_0xe355('0x29')]):_0x32769d[_0xe355('0x28')];if(_[_0xe355('0x3d')](_0x5ec887[_0xe355('0x3e')][_0x229072])){_0x5ec887[_0xe355('0x3e')][_0x229072]=new Agent(_0x32769d);}else{_0x5ec887[_0xe355('0x39')](_0x5ec887[_0xe355('0x3e')][_0x229072],_0x32769d);}}}return _0x5ec887[_0xe355('0x3e')];};};Realtime[_0xe355('0x3a')]['initTelephones']=function(){var _0x3743ca=this;return function(_0x55827e){if(_0x55827e){freeIsNotKeySip(_0x55827e,_0x3743ca[_0xe355('0x11')]);for(var _0x1f71d4=0x0,_0x46317c={},_0x3b7b47={};_0x1f71d4<_0x55827e[_0xe355('0x3c')];_0x1f71d4+=0x1){_0x46317c=_0x55827e[_0x1f71d4];if(_[_0xe355('0x3d')](_0x3743ca[_0xe355('0x11')][util['format'](_0xe355('0x25'),_0x46317c['name'])])){_0x3743ca['telephones'][util[_0xe355('0x24')](_0xe355('0x25'),_0x46317c[_0xe355('0x29')])]=new Telephone(_0x46317c);}else{_0x3743ca['mergeFromDatabase'](_0x3743ca[_0xe355('0x11')][util['format'](_0xe355('0x25'),_0x46317c[_0xe355('0x29')])],_0x46317c);}}}return _0x3743ca[_0xe355('0x11')];};};Realtime['prototype'][_0xe355('0x3f')]=function(){var _0x1dc102=this;return function(_0x2a701b){if(_0x2a701b){freeIsNotKeySip(_0x2a701b,_0x1dc102[_0xe355('0x12')]);for(var _0x3e63bd=0x0,_0x3ae0db={},_0x5d85f5={};_0x3e63bd<_0x2a701b[_0xe355('0x3c')];_0x3e63bd+=0x1){_0x3ae0db=_0x2a701b[_0x3e63bd];if(_['isUndefined'](_0x1dc102[_0xe355('0x12')][util['format'](_0xe355('0x25'),_0x3ae0db[_0xe355('0x29')])])){_0x1dc102['trunks'][util[_0xe355('0x24')]('SIP/%s',_0x3ae0db[_0xe355('0x29')])]=new Trunk(_0x3ae0db);}else{_0x1dc102[_0xe355('0x39')](_0x1dc102[_0xe355('0x12')][util[_0xe355('0x24')]('SIP/%s',_0x3ae0db[_0xe355('0x29')])],_0x3ae0db);}}}return _0x1dc102[_0xe355('0x12')];};};Realtime[_0xe355('0x3a')][_0xe355('0x40')]=function(){var _0x3db4e7=this;return function(_0x13bd37){if(_0x13bd37){freeIsNotKey(_0x13bd37,_0x3db4e7[_0xe355('0x41')],_0xe355('0x29'));for(var _0xf52d4c=0x0,_0x1186f4={},_0x4edbdb={};_0xf52d4c<_0x13bd37[_0xe355('0x3c')];_0xf52d4c+=0x1){_0x1186f4=_0x13bd37[_0xf52d4c];if(_[_0xe355('0x3d')](_0x3db4e7[_0xe355('0x41')][_0x1186f4['name']])){_0x3db4e7[_0xe355('0x41')][_0x1186f4[_0xe355('0x29')]]=new VoiceQueue(_0x1186f4);}else{_0x3db4e7[_0xe355('0x39')](_0x3db4e7[_0xe355('0x41')][_0x1186f4[_0xe355('0x29')]],_0x1186f4);}}}return _0x3db4e7[_0xe355('0x41')];};};Realtime[_0xe355('0x3a')][_0xe355('0x42')]=function(){var _0x576d72=this;return function(_0x41644c){if(_0x41644c){freeIsNotKey(_0x41644c,_0x576d72[_0xe355('0x13')],'id');for(var _0x539109=0x0,_0x5591cd={},_0x5a3d57={};_0x539109<_0x41644c[_0xe355('0x3c')];_0x539109+=0x1){_0x5591cd=_0x41644c[_0x539109];if(_[_0xe355('0x3d')](_0x576d72[_0xe355('0x13')][_0x5591cd['id']])){_0x576d72[_0xe355('0x13')][_0x5591cd['id']]=new Trigger(_0x5591cd);}else{_0x576d72[_0xe355('0x39')](_0x576d72[_0xe355('0x13')][_0x5591cd['id']],_0x5591cd);}}}return _0x576d72[_0xe355('0x13')];};};Realtime[_0xe355('0x3a')][_0xe355('0x43')]=function(){var _0x3c3545=this;return function(_0x33830b){if(_0x33830b){freeIsNotKey(_0x33830b,_0x3c3545[_0xe355('0x15')],'id');for(var _0x4c6bf2=0x0,_0x74f8b9={},_0x477cca={};_0x4c6bf2<_0x33830b['length'];_0x4c6bf2+=0x1){_0x74f8b9=_0x33830b[_0x4c6bf2];if(_['isUndefined'](_0x3c3545['templates'][_0x74f8b9['id']])){_0x3c3545['templates'][_0x74f8b9['id']]=new Template(_0x74f8b9);}else{_0x3c3545[_0xe355('0x39')](_0x3c3545[_0xe355('0x15')][_0x74f8b9['id']],_0x74f8b9);}}}return _0x3c3545[_0xe355('0x15')];};};Realtime['prototype'][_0xe355('0x44')]=function(){var _0x124bc9=this;return function(_0x3bbc8f){if(_0x3bbc8f){freeIsNotKey(_0x3bbc8f,_0x124bc9[_0xe355('0x1b')],'id');for(var _0x514e9e=0x0,_0x59a644={},_0x224ca9={};_0x514e9e<_0x3bbc8f[_0xe355('0x3c')];_0x514e9e+=0x1){_0x59a644=_0x3bbc8f[_0x514e9e];if(_[_0xe355('0x3d')](_0x124bc9[_0xe355('0x1b')][_0x59a644['id']])){_0x124bc9['zendeskAccounts'][_0x59a644['id']]=new ZendeskAccount(_0x59a644);}else{_0x124bc9[_0xe355('0x39')](_0x124bc9[_0xe355('0x1b')][_0x59a644['id']],_0x59a644);}}}return _0x124bc9[_0xe355('0x1b')];};};Realtime['prototype'][_0xe355('0x45')]=function(){var _0xab15df=this;return function(_0x8606a4){if(_0x8606a4){freeIsNotKey(_0x8606a4,_0xab15df[_0xe355('0x1c')],'id');for(var _0x7a21be=0x0,_0x241dcb={},_0x22d8a1={};_0x7a21be<_0x8606a4[_0xe355('0x3c')];_0x7a21be+=0x1){_0x241dcb=_0x8606a4[_0x7a21be];if(_[_0xe355('0x3d')](_0xab15df[_0xe355('0x1c')][_0x241dcb['id']])){_0xab15df[_0xe355('0x1c')][_0x241dcb['id']]=new SalesforceAccount(_0x241dcb);}else{_0xab15df[_0xe355('0x39')](_0xab15df[_0xe355('0x1c')][_0x241dcb['id']],_0x241dcb);}}}return _0xab15df['salesforceAccounts'];};};Realtime[_0xe355('0x3a')][_0xe355('0x46')]=function(){var _0x2da66d=this;return function(_0x3e8438){if(_0x3e8438){freeIsNotKey(_0x3e8438,_0x2da66d[_0xe355('0x1e')],'id');for(var _0x2e39b0=0x0,_0x266970={},_0x31fe2d={};_0x2e39b0<_0x3e8438[_0xe355('0x3c')];_0x2e39b0+=0x1){_0x266970=_0x3e8438[_0x2e39b0];if(_[_0xe355('0x3d')](_0x2da66d[_0xe355('0x1e')][_0x266970['id']])){_0x2da66d[_0xe355('0x1e')][_0x266970['id']]=new FreshdeskAccount(_0x266970);}else{_0x2da66d[_0xe355('0x39')](_0x2da66d[_0xe355('0x1e')][_0x266970['id']],_0x266970);}}}return _0x2da66d[_0xe355('0x1e')];};};Realtime[_0xe355('0x3a')][_0xe355('0x47')]=function(){var _0x5dcc8d=this;return function(_0x300767){if(_0x300767){freeIsNotKey(_0x300767,_0x5dcc8d[_0xe355('0x48')],'id');for(var _0x2241ea=0x0,_0x1c1092={},_0x533873={};_0x2241ea<_0x300767['length'];_0x2241ea+=0x1){_0x1c1092=_0x300767[_0x2241ea];if(_[_0xe355('0x3d')](_0x5dcc8d[_0xe355('0x48')][_0x1c1092['id']])){_0x5dcc8d[_0xe355('0x48')][_0x1c1092['id']]=new ZohoAccount(_0x1c1092);}else{_0x5dcc8d[_0xe355('0x39')](_0x5dcc8d[_0xe355('0x48')][_0x1c1092['id']],_0x1c1092);}}}return _0x5dcc8d[_0xe355('0x48')];};};Realtime[_0xe355('0x3a')][_0xe355('0x49')]=function(){var _0x235865=this;return function(_0x2c5ec3){if(_0x2c5ec3){freeIsNotKey(_0x2c5ec3,_0x235865[_0xe355('0x1f')],'id');for(var _0x954a5b=0x0,_0x1870f4={},_0x5ba438={};_0x954a5b<_0x2c5ec3[_0xe355('0x3c')];_0x954a5b+=0x1){_0x1870f4=_0x2c5ec3[_0x954a5b];if(_[_0xe355('0x3d')](_0x235865[_0xe355('0x1f')][_0x1870f4['id']])){_0x235865['deskAccounts'][_0x1870f4['id']]=new DeskAccount(_0x1870f4);}else{_0x235865['mergeFromDatabase'](_0x235865[_0xe355('0x1f')][_0x1870f4['id']],_0x1870f4);}}}return _0x235865[_0xe355('0x1f')];};};Realtime[_0xe355('0x3a')][_0xe355('0x4a')]=function(){var _0x26c288=this;return function(_0x2f3652){if(_0x2f3652){freeIsNotKey(_0x2f3652,_0x26c288[_0xe355('0x1d')],'id');for(var _0x43986e=0x0,_0x4fa75b={},_0x5e2dc5={};_0x43986e<_0x2f3652[_0xe355('0x3c')];_0x43986e+=0x1){_0x4fa75b=_0x2f3652[_0x43986e];if(_['isUndefined'](_0x26c288[_0xe355('0x1d')][_0x4fa75b['id']])){_0x26c288[_0xe355('0x1d')][_0x4fa75b['id']]=new SugarcrmAccount(_0x4fa75b);}else{_0x26c288[_0xe355('0x39')](_0x26c288[_0xe355('0x1d')][_0x4fa75b['id']],_0x4fa75b);}}}return _0x26c288[_0xe355('0x1d')];};};Realtime['prototype'][_0xe355('0x4b')]=function(){var _0x29dec5=this;return function(_0xf36af){if(_0xf36af){freeIsNotKey(_0xf36af,_0x29dec5[_0xe355('0x20')],'id');for(var _0xf1ded8=0x0,_0x5de9de={},_0x1585a0={};_0xf1ded8<_0xf36af[_0xe355('0x3c')];_0xf1ded8+=0x1){_0x5de9de=_0xf36af[_0xf1ded8];if(_['isUndefined'](_0x29dec5[_0xe355('0x20')][_0x5de9de['id']])){_0x29dec5[_0xe355('0x20')][_0x5de9de['id']]=new VtigerAccount(_0x5de9de);}else{_0x29dec5[_0xe355('0x39')](_0x29dec5['vtigerAccounts'][_0x5de9de['id']],_0x5de9de);}}}return _0x29dec5[_0xe355('0x20')];};};Realtime[_0xe355('0x3a')][_0xe355('0x4c')]=function(){var _0x5751e0=this;return function(_0x580398){if(_0x580398){freeIsNotKey(_0x580398,_0x5751e0[_0xe355('0x4d')],'id');for(var _0x5f4768=0x0,_0x41f05f={},_0x2208b7={};_0x5f4768<_0x580398[_0xe355('0x3c')];_0x5f4768+=0x1){_0x41f05f=_0x580398[_0x5f4768];if(_[_0xe355('0x3d')](_0x5751e0[_0xe355('0x4d')][_0x41f05f['id']])){_0x5751e0[_0xe355('0x4d')][_0x41f05f['id']]=new ServicenowAccount(_0x41f05f);}else{_0x5751e0[_0xe355('0x39')](_0x5751e0['servicenowAccounts'][_0x41f05f['id']],_0x41f05f);}}}return _0x5751e0[_0xe355('0x4d')];};};Realtime[_0xe355('0x3a')]['initDynamics365Accounts']=function(){var _0x1e5884=this;return function(_0x3aa857){if(_0x3aa857){freeIsNotKey(_0x3aa857,_0x1e5884[_0xe355('0x21')],'id');for(var _0x265a91=0x0,_0x1bf8c9={},_0xbf6eeb={};_0x265a91<_0x3aa857[_0xe355('0x3c')];_0x265a91+=0x1){_0x1bf8c9=_0x3aa857[_0x265a91];if(_['isUndefined'](_0x1e5884[_0xe355('0x21')][_0x1bf8c9['id']])){_0x1e5884[_0xe355('0x21')][_0x1bf8c9['id']]=new Dynamics365Account(_0x1bf8c9);}else{_0x1e5884[_0xe355('0x39')](_0x1e5884[_0xe355('0x21')][_0x1bf8c9['id']],_0x1bf8c9);}}}return _0x1e5884[_0xe355('0x21')];};};Realtime['prototype'][_0xe355('0x4e')]=function(){var _0x12c738=this;return function(_0x3170be){for(var _0x3825f6=0x0;_0x3825f6<_0x3170be[_0xe355('0x3c')];_0x3825f6+=0x1){_[_0xe355('0x4f')](_0x12c738[_0xe355('0x41')][_0x3170be[_0x3825f6][_0xe355('0x29')]],_0x3170be[_0x3825f6]);}return _0x12c738[_0xe355('0x41')];};};Realtime[_0xe355('0x3a')][_0xe355('0x50')]=function(){var _0x4eefc9=this;return function(_0x5861f5){clearVoiceQueues(_0x4eefc9[_0xe355('0x41')]);if(_0x5861f5){_0x5861f5=_[_0xe355('0x51')](_0x5861f5,_0xe355('0x52'));for(var _0x1818aa in _0x5861f5){if(_0x5861f5['hasOwnProperty'](_0x1818aa)){var _0x1a4278={};for(var _0x411695=0x0;_0x411695<_0x5861f5[_0x1818aa][_0xe355('0x3c')];_0x411695+=0x1){var _0x402550=_0x5861f5[_0x1818aa][_0x411695]['queue'];if(_0x4eefc9[_0xe355('0x41')][_0x402550]){if(_0x5861f5[_0x1818aa][_0x411695][_0xe355('0x53')]){_0x4eefc9[_0xe355('0x41')][_0x402550]['unmanaged']+=0x1;}if(_0x5861f5[_0x1818aa][_0x411695][_0xe355('0x54')]){_0x4eefc9['voiceQueues'][_0x402550][_0xe355('0x55')]+=0x1;}_0x4eefc9[_0xe355('0x41')][_0x402550]['sumHoldTime']+=moment(_0x5861f5[_0x1818aa][_0x411695][_0xe355('0x56')])[_0xe355('0x57')](moment(_0x5861f5[_0x1818aa][_0x411695][_0xe355('0x58')]),_0xe355('0x59'))||0x0;if(_0x411695===_0x5861f5[_0x1818aa][_0xe355('0x3c')]-0x1){_0x4eefc9['voiceQueues'][_0x402550][_0xe355('0x30')]+=moment(_0x5861f5[_0x1818aa][_0x411695]['queuecallercompleteAt']||_0x5861f5[_0x1818aa][_0x411695][_0xe355('0x5a')]||_0x5861f5[_0x1818aa][_0x411695]['queuecallerexitAt'])['diff'](moment(_0x5861f5[_0x1818aa][_0x411695]['queuecallerjoinAt']),_0xe355('0x59'))||0x0;_0x4eefc9[_0xe355('0x41')][_0x402550][_0xe355('0x5b')]+=0x1;if(_0x5861f5[_0x1818aa][_0x411695][_0xe355('0x5c')]){_0x4eefc9[_0xe355('0x41')][_0x402550][_0xe355('0x5d')]+=0x1;_0x4eefc9[_0xe355('0x41')][_0x402550][_0xe355('0x2a')]+=moment(_0x5861f5[_0x1818aa][_0x411695][_0xe355('0x5e')])[_0xe355('0x57')](moment(_0x5861f5[_0x1818aa][_0x411695][_0xe355('0x56')]),_0xe355('0x59'))||0x0;}}else{_0x4eefc9[_0xe355('0x41')][_0x402550]['sumDuration']+=_0x4eefc9['voiceQueues'][_0x402550][_0xe355('0x2f')]||0x0;}}}}}}return _0x4eefc9[_0xe355('0x41')];};};Realtime[_0xe355('0x3a')]['initVoiceCallReports']=function(){var _0x43e86f=this;return function(_0x5cd182){clearVoiceCallReports(_0x43e86f[_0xe355('0x5f')]);if(_0x5cd182){for(var _0x1e583c=0x0;_0x1e583c<_0x5cd182[_0xe355('0x3c')];_0x1e583c+=0x1){_0x43e86f[_0xe355('0x5f')][_0xe355('0x5b')]+=0x1;_0x43e86f['outbound']['sumDuration']+=_0x5cd182[_0x1e583c]['duration'];if(_0x5cd182[_0x1e583c][_0xe355('0x60')]===_0xe355('0x61')){_0x43e86f[_0xe355('0x5f')]['answered']+=0x1;_0x43e86f[_0xe355('0x5f')][_0xe355('0x2f')]+=_0x5cd182[_0x1e583c][_0xe355('0x62')]-_0x5cd182[_0x1e583c][_0xe355('0x63')]||0x0;_0x43e86f[_0xe355('0x5f')]['sumBillable']+=_0x5cd182[_0x1e583c]['billableseconds'];}}}return _0x43e86f[_0xe355('0x5f')];};};Realtime[_0xe355('0x3a')][_0xe355('0x64')]=function(){var _0x55f633=this;return function(_0x1766c7){if(_0x1766c7){freeIsNotKey(_0x1766c7,_0x55f633[_0xe355('0x14')],'name');for(var _0x40acc7=0x0,_0x338594={};_0x40acc7<_0x1766c7[_0xe355('0x3c')];_0x40acc7+=0x1){_0x338594=_0x1766c7[_0x40acc7];if(_[_0xe355('0x3d')](_0x55f633[_0xe355('0x14')][_0x338594[_0xe355('0x29')]])){_0x55f633[_0xe355('0x14')][_0x338594['name']]=new Campaign(_0x338594);}else{_0x55f633[_0xe355('0x39')](_0x55f633[_0xe355('0x14')][_0x338594[_0xe355('0x29')]],_0x338594);}}}return _0x55f633[_0xe355('0x14')];};};Realtime[_0xe355('0x3a')][_0xe355('0x65')]=function(){var _0x2dee7b=this;return function(_0x33f2ae){if(_0x33f2ae){freeIsNotKey(_0x33f2ae,_0x2dee7b[_0xe355('0x16')],'id');for(var _0x3ad617=0x0,_0x593002={};_0x3ad617<_0x33f2ae[_0xe355('0x3c')];_0x3ad617+=0x1){_0x593002=_0x33f2ae[_0x3ad617];if(_[_0xe355('0x3d')](_0x2dee7b[_0xe355('0x16')][_0x593002['id']])){_0x2dee7b['voiceExtensions'][_0x593002['id']]=new VoiceExtension(_0x593002);}else{_0x2dee7b[_0xe355('0x39')](_0x2dee7b['voiceExtensions'][_0x593002['id']],_0x593002);}}}return _0x2dee7b[_0xe355('0x16')];};};Realtime[_0xe355('0x3a')][_0xe355('0x66')]=function(){var _0x433a73=this;return function(_0x5b0671){clearCampaigns(_0x433a73[_0xe355('0x14')]);for(var _0x5ab0be=0x0;_0x5ab0be<_0x5b0671['length'];_0x5ab0be+=0x1){_['merge'](_0x433a73['campaigns'][_0x5b0671[_0x5ab0be][_0xe355('0x29')]],_0x5b0671[_0x5ab0be]);}return _0x433a73[_0xe355('0x14')];};};Realtime[_0xe355('0x3a')]['initFaxAccounts']=function(){var _0x39d121=this;return function(_0x43a190){if(_0x43a190){freeIsNotKey(_0x43a190,_0x39d121[_0xe355('0x22')],'id');for(var _0x47c672=0x0,_0x56618d={},_0x3c494f={};_0x47c672<_0x43a190['length'];_0x47c672+=0x1){_0x56618d=_0x43a190[_0x47c672];if(_[_0xe355('0x3d')](_0x39d121[_0xe355('0x22')][_0x56618d['id']])){_0x39d121[_0xe355('0x22')][_0x56618d['id']]=new FaxAccount(_0x56618d);}else{_0x39d121['mergeFromDatabase'](_0x39d121[_0xe355('0x22')][_0x56618d['id']],_0x56618d);}}}return _0x39d121[_0xe355('0x22')];};};module[_0xe355('0x67')]=Realtime; \ No newline at end of file +var _0xd7f0=['initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','billableseconds','initVoiceExtensions','voiceExtensions','merge','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','templates','outbound','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','format','initTelephones','isUndefined','initTrunks','trunks','initVoiceQueues','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','dynamics365Accounts'];(function(_0x34e26a,_0x2e681c){var _0x97913f=function(_0x3de941){while(--_0x3de941){_0x34e26a['push'](_0x34e26a['shift']());}};_0x97913f(++_0x2e681c);}(_0xd7f0,0x145));var _0x0d7f=function(_0x1a00d5,_0x133747){_0x1a00d5=_0x1a00d5-0x0;var _0xe73af8=_0xd7f0[_0x1a00d5];return _0xe73af8;};'use strict';var BPromise=require(_0x0d7f('0x0'));var util=require(_0x0d7f('0x1'));var _=require(_0x0d7f('0x2'));var moment=require('moment');var Agent=require(_0x0d7f('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x0d7f('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x0d7f('0x5'));var Template=require(_0x0d7f('0x6'));var Campaign=require(_0x0d7f('0x7'));var VoiceExtension=require(_0x0d7f('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x0d7f('0x9'));var ZohoAccount=require(_0x0d7f('0xa'));var DeskAccount=require(_0x0d7f('0xb'));var VtigerAccount=require(_0x0d7f('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x0d7f('0xd'));var FaxAccount=require(_0x0d7f('0xe'));var Realtime=function(){this[_0x0d7f('0xf')]={};this[_0x0d7f('0x10')]={};this['trunks']={};this[_0x0d7f('0x11')]={};this[_0x0d7f('0x12')]={};this[_0x0d7f('0x13')]={};this[_0x0d7f('0x14')]={};this[_0x0d7f('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0x0d7f('0x16')]={};this[_0x0d7f('0x17')]={};this[_0x0d7f('0x18')]={};this['zendeskAccounts']={};this[_0x0d7f('0x19')]={};this[_0x0d7f('0x1a')]={};this['freshdeskAccounts']={};this[_0x0d7f('0x1b')]={};this[_0x0d7f('0x1c')]={};this[_0x0d7f('0x1d')]={};this[_0x0d7f('0x1e')]={};this['dynamics365Accounts']={};this[_0x0d7f('0x1f')]={};};function freeIsNotKey(_0x548c8c,_0x24935a,_0x1c3be2){var _0x448fc4=_[_0x0d7f('0x20')](_0x548c8c,function(_0x1941c4,_0x51aed2){return _0x1941c4[_0x1c3be2];});for(var _0x23dde9 in _0x24935a){if(_0x24935a[_0x0d7f('0x21')](_0x23dde9)){if(!_0x448fc4[_0x23dde9]){delete _0x24935a[_0x23dde9];}}}}function freeIsNotKeySip(_0x50b413,_0x1bb755){var _0xed5061=_[_0x0d7f('0x20')](_0x50b413,function(_0x4e54a8,_0x1abae4){return util['format'](_0x0d7f('0x22'),_0x4e54a8[_0x0d7f('0x23')]);});for(var _0x5f0158 in _0x1bb755){if(_0x1bb755['hasOwnProperty'](_0x5f0158)){if(!_0xed5061[_0x5f0158]){delete _0x1bb755[_0x5f0158];}}}}function freeIsNotKeyAgent(_0x3ed1a7,_0x567dda){var _0x126f55=_[_0x0d7f('0x20')](_0x3ed1a7,function(_0x3dec6f,_0x15d63f){var _0x553fda=_[_0x0d7f('0x24')](_0x3dec6f[_0x0d7f('0x25')])?util['format'](_0x0d7f('0x22'),_0x3dec6f[_0x0d7f('0x23')]):_0x3dec6f[_0x0d7f('0x25')];return _0x553fda;});for(var _0xef56ea in _0x567dda){if(_0x567dda[_0x0d7f('0x21')](_0xef56ea)){if(!_0x126f55[_0xef56ea]){delete _0x567dda[_0xef56ea];}}}}function clearVoiceCallReports(_0xbab295){_0xbab295[_0x0d7f('0x26')]=0x0;_0xbab295[_0x0d7f('0x27')]=0x0;_0xbab295[_0x0d7f('0x28')]=0x0;_0xbab295[_0x0d7f('0x29')]=0x0;_0xbab295[_0x0d7f('0x2a')]=0x0;}function clearCampaigns(_0x3113f2){if(!_['isEmpty'](_0x3113f2)){for(var _0x3bf89f in _0x3113f2){if(_0x3113f2[_0x0d7f('0x21')](_0x3bf89f)){_0x3113f2[_0x3bf89f][_0x0d7f('0x2b')]=0x0;_0x3113f2[_0x3bf89f][_0x0d7f('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x567159){if(!_[_0x0d7f('0x2d')](_0x567159)){for(var _0x37fbfc in _0x567159){if(_0x567159[_0x0d7f('0x21')](_0x37fbfc)){_0x567159[_0x37fbfc]['total']=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x27')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x2e')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x2f')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x28')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x29')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x2a')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x30')]=0x0;_0x567159[_0x37fbfc]['outboundNoAnswerCallsDay']=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x31')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x32')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x33')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x34')]=0x0;_0x567159[_0x37fbfc]['outboundDropCallsDayTimeout']=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x35')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x36')]=0x0;_0x567159[_0x37fbfc]['outboundOriginateFailureCallsDay']=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x37')]=0x0;_0x567159[_0x37fbfc]['outboundReCallsDay']=0x0;_0x567159[_0x37fbfc]['outboundAnswerAgiCallsDay']=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x38')]=0x0;_0x567159[_0x37fbfc][_0x0d7f('0x39')]=!![];}}}}Realtime['prototype'][_0x0d7f('0x3a')]=function(_0x5f0693,_0x57f756){for(var _0x56f168 in _0x57f756){if(_0x5f0693['hasOwnProperty'](_0x56f168)){_0x5f0693[_0x56f168]=_0x57f756[_0x56f168];}}};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x3c')]=function(){var _0x4e5172=this;return function(_0x56ff51){if(_0x56ff51){freeIsNotKeyAgent(_0x56ff51,_0x4e5172[_0x0d7f('0xf')]);for(var _0x245900=0x0,_0x219cc8={},_0x1e3b29={};_0x245900<_0x56ff51[_0x0d7f('0x3d')];_0x245900+=0x1){_0x219cc8=_0x56ff51[_0x245900];var _0x200dd3=_[_0x0d7f('0x24')](_0x219cc8['interface'])?util[_0x0d7f('0x3e')]('SIP/%s',_0x219cc8[_0x0d7f('0x23')]):_0x219cc8[_0x0d7f('0x25')];if(_['isUndefined'](_0x4e5172[_0x0d7f('0xf')][_0x200dd3])){_0x4e5172[_0x0d7f('0xf')][_0x200dd3]=new Agent(_0x219cc8);}else{_0x4e5172[_0x0d7f('0x3a')](_0x4e5172[_0x0d7f('0xf')][_0x200dd3],_0x219cc8);}}}return _0x4e5172[_0x0d7f('0xf')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x3f')]=function(){var _0x30c225=this;return function(_0x442a84){if(_0x442a84){freeIsNotKeySip(_0x442a84,_0x30c225[_0x0d7f('0x10')]);for(var _0x303cae=0x0,_0x550fb0={},_0x890d92={};_0x303cae<_0x442a84[_0x0d7f('0x3d')];_0x303cae+=0x1){_0x550fb0=_0x442a84[_0x303cae];if(_[_0x0d7f('0x40')](_0x30c225[_0x0d7f('0x10')][util[_0x0d7f('0x3e')](_0x0d7f('0x22'),_0x550fb0[_0x0d7f('0x23')])])){_0x30c225[_0x0d7f('0x10')][util[_0x0d7f('0x3e')]('SIP/%s',_0x550fb0['name'])]=new Telephone(_0x550fb0);}else{_0x30c225['mergeFromDatabase'](_0x30c225['telephones'][util[_0x0d7f('0x3e')](_0x0d7f('0x22'),_0x550fb0[_0x0d7f('0x23')])],_0x550fb0);}}}return _0x30c225['telephones'];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x41')]=function(){var _0x20f238=this;return function(_0x2585a3){if(_0x2585a3){freeIsNotKeySip(_0x2585a3,_0x20f238[_0x0d7f('0x42')]);for(var _0xb8371a=0x0,_0x174bb9={},_0x366f85={};_0xb8371a<_0x2585a3[_0x0d7f('0x3d')];_0xb8371a+=0x1){_0x174bb9=_0x2585a3[_0xb8371a];if(_[_0x0d7f('0x40')](_0x20f238[_0x0d7f('0x42')][util['format'](_0x0d7f('0x22'),_0x174bb9[_0x0d7f('0x23')])])){_0x20f238[_0x0d7f('0x42')][util[_0x0d7f('0x3e')](_0x0d7f('0x22'),_0x174bb9[_0x0d7f('0x23')])]=new Trunk(_0x174bb9);}else{_0x20f238[_0x0d7f('0x3a')](_0x20f238[_0x0d7f('0x42')][util[_0x0d7f('0x3e')]('SIP/%s',_0x174bb9[_0x0d7f('0x23')])],_0x174bb9);}}}return _0x20f238[_0x0d7f('0x42')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x43')]=function(){var _0x180d99=this;return function(_0x3561eb){if(_0x3561eb){freeIsNotKey(_0x3561eb,_0x180d99[_0x0d7f('0x11')],_0x0d7f('0x23'));for(var _0xf72277=0x0,_0x57f7b2={},_0x357896={};_0xf72277<_0x3561eb[_0x0d7f('0x3d')];_0xf72277+=0x1){_0x57f7b2=_0x3561eb[_0xf72277];if(_[_0x0d7f('0x40')](_0x180d99['voiceQueues'][_0x57f7b2[_0x0d7f('0x23')]])){_0x180d99[_0x0d7f('0x11')][_0x57f7b2['name']]=new VoiceQueue(_0x57f7b2);}else{_0x180d99[_0x0d7f('0x3a')](_0x180d99[_0x0d7f('0x11')][_0x57f7b2[_0x0d7f('0x23')]],_0x57f7b2);}}}return _0x180d99[_0x0d7f('0x11')];};};Realtime[_0x0d7f('0x3b')]['initTriggers']=function(){var _0x1ff161=this;return function(_0x38b067){if(_0x38b067){freeIsNotKey(_0x38b067,_0x1ff161['triggers'],'id');for(var _0x4729b6=0x0,_0x51ce32={},_0x18db85={};_0x4729b6<_0x38b067['length'];_0x4729b6+=0x1){_0x51ce32=_0x38b067[_0x4729b6];if(_[_0x0d7f('0x40')](_0x1ff161[_0x0d7f('0x12')][_0x51ce32['id']])){_0x1ff161[_0x0d7f('0x12')][_0x51ce32['id']]=new Trigger(_0x51ce32);}else{_0x1ff161['mergeFromDatabase'](_0x1ff161[_0x0d7f('0x12')][_0x51ce32['id']],_0x51ce32);}}}return _0x1ff161['triggers'];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x44')]=function(){var _0x6bafbb=this;return function(_0x123e6f){if(_0x123e6f){freeIsNotKey(_0x123e6f,_0x6bafbb[_0x0d7f('0x14')],'id');for(var _0x1509c1=0x0,_0x4770a0={},_0xc7c97e={};_0x1509c1<_0x123e6f[_0x0d7f('0x3d')];_0x1509c1+=0x1){_0x4770a0=_0x123e6f[_0x1509c1];if(_[_0x0d7f('0x40')](_0x6bafbb[_0x0d7f('0x14')][_0x4770a0['id']])){_0x6bafbb[_0x0d7f('0x14')][_0x4770a0['id']]=new Template(_0x4770a0);}else{_0x6bafbb[_0x0d7f('0x3a')](_0x6bafbb[_0x0d7f('0x14')][_0x4770a0['id']],_0x4770a0);}}}return _0x6bafbb[_0x0d7f('0x14')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x45')]=function(){var _0x316577=this;return function(_0x5b68e2){if(_0x5b68e2){freeIsNotKey(_0x5b68e2,_0x316577[_0x0d7f('0x46')],'id');for(var _0x5ea638=0x0,_0x667fe={},_0x4350bb={};_0x5ea638<_0x5b68e2[_0x0d7f('0x3d')];_0x5ea638+=0x1){_0x667fe=_0x5b68e2[_0x5ea638];if(_[_0x0d7f('0x40')](_0x316577[_0x0d7f('0x46')][_0x667fe['id']])){_0x316577['zendeskAccounts'][_0x667fe['id']]=new ZendeskAccount(_0x667fe);}else{_0x316577[_0x0d7f('0x3a')](_0x316577[_0x0d7f('0x46')][_0x667fe['id']],_0x667fe);}}}return _0x316577['zendeskAccounts'];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x47')]=function(){var _0x1de668=this;return function(_0x2cef0f){if(_0x2cef0f){freeIsNotKey(_0x2cef0f,_0x1de668[_0x0d7f('0x19')],'id');for(var _0x17f776=0x0,_0xb03df3={},_0x27acf5={};_0x17f776<_0x2cef0f['length'];_0x17f776+=0x1){_0xb03df3=_0x2cef0f[_0x17f776];if(_['isUndefined'](_0x1de668[_0x0d7f('0x19')][_0xb03df3['id']])){_0x1de668[_0x0d7f('0x19')][_0xb03df3['id']]=new SalesforceAccount(_0xb03df3);}else{_0x1de668[_0x0d7f('0x3a')](_0x1de668[_0x0d7f('0x19')][_0xb03df3['id']],_0xb03df3);}}}return _0x1de668[_0x0d7f('0x19')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x48')]=function(){var _0x435bf3=this;return function(_0x28591d){if(_0x28591d){freeIsNotKey(_0x28591d,_0x435bf3['freshdeskAccounts'],'id');for(var _0x1c4e97=0x0,_0x4f4727={},_0x34eb60={};_0x1c4e97<_0x28591d['length'];_0x1c4e97+=0x1){_0x4f4727=_0x28591d[_0x1c4e97];if(_[_0x0d7f('0x40')](_0x435bf3[_0x0d7f('0x49')][_0x4f4727['id']])){_0x435bf3[_0x0d7f('0x49')][_0x4f4727['id']]=new FreshdeskAccount(_0x4f4727);}else{_0x435bf3[_0x0d7f('0x3a')](_0x435bf3['freshdeskAccounts'][_0x4f4727['id']],_0x4f4727);}}}return _0x435bf3[_0x0d7f('0x49')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x4a')]=function(){var _0x2a1582=this;return function(_0x1e45a2){if(_0x1e45a2){freeIsNotKey(_0x1e45a2,_0x2a1582[_0x0d7f('0x1b')],'id');for(var _0x41d177=0x0,_0x34aecb={},_0x533587={};_0x41d177<_0x1e45a2['length'];_0x41d177+=0x1){_0x34aecb=_0x1e45a2[_0x41d177];if(_[_0x0d7f('0x40')](_0x2a1582['zohoAccounts'][_0x34aecb['id']])){_0x2a1582['zohoAccounts'][_0x34aecb['id']]=new ZohoAccount(_0x34aecb);}else{_0x2a1582[_0x0d7f('0x3a')](_0x2a1582[_0x0d7f('0x1b')][_0x34aecb['id']],_0x34aecb);}}}return _0x2a1582[_0x0d7f('0x1b')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x4b')]=function(){var _0x2983f2=this;return function(_0x45273a){if(_0x45273a){freeIsNotKey(_0x45273a,_0x2983f2[_0x0d7f('0x1c')],'id');for(var _0x23b98f=0x0,_0x3deb9d={},_0x31022f={};_0x23b98f<_0x45273a[_0x0d7f('0x3d')];_0x23b98f+=0x1){_0x3deb9d=_0x45273a[_0x23b98f];if(_['isUndefined'](_0x2983f2[_0x0d7f('0x1c')][_0x3deb9d['id']])){_0x2983f2[_0x0d7f('0x1c')][_0x3deb9d['id']]=new DeskAccount(_0x3deb9d);}else{_0x2983f2[_0x0d7f('0x3a')](_0x2983f2[_0x0d7f('0x1c')][_0x3deb9d['id']],_0x3deb9d);}}}return _0x2983f2[_0x0d7f('0x1c')];};};Realtime['prototype'][_0x0d7f('0x4c')]=function(){var _0x26b128=this;return function(_0x5d54c8){if(_0x5d54c8){freeIsNotKey(_0x5d54c8,_0x26b128[_0x0d7f('0x1a')],'id');for(var _0x3ade13=0x0,_0x1a4488={},_0x3171dc={};_0x3ade13<_0x5d54c8[_0x0d7f('0x3d')];_0x3ade13+=0x1){_0x1a4488=_0x5d54c8[_0x3ade13];if(_[_0x0d7f('0x40')](_0x26b128[_0x0d7f('0x1a')][_0x1a4488['id']])){_0x26b128[_0x0d7f('0x1a')][_0x1a4488['id']]=new SugarcrmAccount(_0x1a4488);}else{_0x26b128['mergeFromDatabase'](_0x26b128[_0x0d7f('0x1a')][_0x1a4488['id']],_0x1a4488);}}}return _0x26b128[_0x0d7f('0x1a')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0xa4d72b=this;return function(_0x1f2ada){if(_0x1f2ada){freeIsNotKey(_0x1f2ada,_0xa4d72b[_0x0d7f('0x1d')],'id');for(var _0x4a17e0=0x0,_0x68074d={},_0x24a002={};_0x4a17e0<_0x1f2ada[_0x0d7f('0x3d')];_0x4a17e0+=0x1){_0x68074d=_0x1f2ada[_0x4a17e0];if(_[_0x0d7f('0x40')](_0xa4d72b[_0x0d7f('0x1d')][_0x68074d['id']])){_0xa4d72b[_0x0d7f('0x1d')][_0x68074d['id']]=new VtigerAccount(_0x68074d);}else{_0xa4d72b[_0x0d7f('0x3a')](_0xa4d72b['vtigerAccounts'][_0x68074d['id']],_0x68074d);}}}return _0xa4d72b[_0x0d7f('0x1d')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x4d')]=function(){var _0x8027e4=this;return function(_0x268605){if(_0x268605){freeIsNotKey(_0x268605,_0x8027e4[_0x0d7f('0x1e')],'id');for(var _0x26587f=0x0,_0x473cf8={},_0x371bb1={};_0x26587f<_0x268605[_0x0d7f('0x3d')];_0x26587f+=0x1){_0x473cf8=_0x268605[_0x26587f];if(_['isUndefined'](_0x8027e4[_0x0d7f('0x1e')][_0x473cf8['id']])){_0x8027e4['servicenowAccounts'][_0x473cf8['id']]=new ServicenowAccount(_0x473cf8);}else{_0x8027e4[_0x0d7f('0x3a')](_0x8027e4['servicenowAccounts'][_0x473cf8['id']],_0x473cf8);}}}return _0x8027e4[_0x0d7f('0x1e')];};};Realtime[_0x0d7f('0x3b')]['initDynamics365Accounts']=function(){var _0x2f84c3=this;return function(_0x726844){if(_0x726844){freeIsNotKey(_0x726844,_0x2f84c3['dynamics365Accounts'],'id');for(var _0x4cec94=0x0,_0x55c5e1={},_0x2b700e={};_0x4cec94<_0x726844['length'];_0x4cec94+=0x1){_0x55c5e1=_0x726844[_0x4cec94];if(_[_0x0d7f('0x40')](_0x2f84c3['dynamics365Accounts'][_0x55c5e1['id']])){_0x2f84c3[_0x0d7f('0x4e')][_0x55c5e1['id']]=new Dynamics365Account(_0x55c5e1);}else{_0x2f84c3[_0x0d7f('0x3a')](_0x2f84c3['dynamics365Accounts'][_0x55c5e1['id']],_0x55c5e1);}}}return _0x2f84c3[_0x0d7f('0x4e')];};};Realtime[_0x0d7f('0x3b')]['initVoiceQueueHopperHistory']=function(){var _0xa49127=this;return function(_0x44a13a){for(var _0x488a4c=0x0;_0x488a4c<_0x44a13a['length'];_0x488a4c+=0x1){_['merge'](_0xa49127[_0x0d7f('0x11')][_0x44a13a[_0x488a4c][_0x0d7f('0x23')]],_0x44a13a[_0x488a4c]);}return _0xa49127[_0x0d7f('0x11')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x4f')]=function(){var _0x1fdc29=this;return function(_0xb0e39c){clearVoiceQueues(_0x1fdc29[_0x0d7f('0x11')]);if(_0xb0e39c){_0xb0e39c=_[_0x0d7f('0x50')](_0xb0e39c,_0x0d7f('0x51'));for(var _0x42550c in _0xb0e39c){if(_0xb0e39c[_0x0d7f('0x21')](_0x42550c)){var _0x1165f9={};for(var _0x552b5b=0x0;_0x552b5b<_0xb0e39c[_0x42550c]['length'];_0x552b5b+=0x1){var _0x592b6d=_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x52')];if(_0x1fdc29[_0x0d7f('0x11')][_0x592b6d]){if(_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x53')]){_0x1fdc29[_0x0d7f('0x11')][_0x592b6d]['unmanaged']+=0x1;}if(_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x54')]){_0x1fdc29[_0x0d7f('0x11')][_0x592b6d]['abandoned']+=0x1;}_0x1fdc29[_0x0d7f('0x11')][_0x592b6d][_0x0d7f('0x28')]+=moment(_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x55')])[_0x0d7f('0x56')](moment(_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x57')]),_0x0d7f('0x58'))||0x0;if(_0x552b5b===_0xb0e39c[_0x42550c]['length']-0x1){_0x1fdc29[_0x0d7f('0x11')][_0x592b6d][_0x0d7f('0x29')]+=moment(_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x59')]||_0xb0e39c[_0x42550c][_0x552b5b]['queuecallerabandonAt']||_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x5a')])[_0x0d7f('0x56')](moment(_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x57')]),_0x0d7f('0x58'))||0x0;_0x1fdc29[_0x0d7f('0x11')][_0x592b6d]['total']+=0x1;if(_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x5b')]){_0x1fdc29['voiceQueues'][_0x592b6d]['answered']+=0x1;_0x1fdc29[_0x0d7f('0x11')][_0x592b6d][_0x0d7f('0x2a')]+=moment(_0xb0e39c[_0x42550c][_0x552b5b]['queuecallercompleteAt'])['diff'](moment(_0xb0e39c[_0x42550c][_0x552b5b][_0x0d7f('0x55')]),_0x0d7f('0x58'))||0x0;}}else{_0x1fdc29[_0x0d7f('0x11')][_0x592b6d][_0x0d7f('0x29')]+=_0x1fdc29[_0x0d7f('0x11')][_0x592b6d]['sumHoldTime']||0x0;}}}}}}return _0x1fdc29[_0x0d7f('0x11')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x5c')]=function(){var _0x486db9=this;return function(_0xe98322){clearVoiceCallReports(_0x486db9[_0x0d7f('0x15')]);if(_0xe98322){for(var _0x56112d=0x0;_0x56112d<_0xe98322['length'];_0x56112d+=0x1){_0x486db9[_0x0d7f('0x15')][_0x0d7f('0x26')]+=0x1;_0x486db9[_0x0d7f('0x15')]['sumDuration']+=_0xe98322[_0x56112d][_0x0d7f('0x5d')];if(_0xe98322[_0x56112d][_0x0d7f('0x5e')]==='ANSWERED'){_0x486db9[_0x0d7f('0x15')][_0x0d7f('0x27')]+=0x1;_0x486db9[_0x0d7f('0x15')]['sumHoldTime']+=_0xe98322[_0x56112d][_0x0d7f('0x5d')]-_0xe98322[_0x56112d][_0x0d7f('0x5f')]||0x0;_0x486db9[_0x0d7f('0x15')][_0x0d7f('0x2a')]+=_0xe98322[_0x56112d][_0x0d7f('0x5f')];}}}return _0x486db9[_0x0d7f('0x15')];};};Realtime[_0x0d7f('0x3b')]['initCampaigns']=function(){var _0x2cc02f=this;return function(_0x336dac){if(_0x336dac){freeIsNotKey(_0x336dac,_0x2cc02f[_0x0d7f('0x13')],_0x0d7f('0x23'));for(var _0x1c8288=0x0,_0x31e429={};_0x1c8288<_0x336dac['length'];_0x1c8288+=0x1){_0x31e429=_0x336dac[_0x1c8288];if(_[_0x0d7f('0x40')](_0x2cc02f[_0x0d7f('0x13')][_0x31e429['name']])){_0x2cc02f['campaigns'][_0x31e429['name']]=new Campaign(_0x31e429);}else{_0x2cc02f[_0x0d7f('0x3a')](_0x2cc02f[_0x0d7f('0x13')][_0x31e429[_0x0d7f('0x23')]],_0x31e429);}}}return _0x2cc02f['campaigns'];};};Realtime['prototype'][_0x0d7f('0x60')]=function(){var _0x2a4677=this;return function(_0x593221){if(_0x593221){freeIsNotKey(_0x593221,_0x2a4677[_0x0d7f('0x61')],'id');for(var _0x72c0cf=0x0,_0x3a453e={};_0x72c0cf<_0x593221[_0x0d7f('0x3d')];_0x72c0cf+=0x1){_0x3a453e=_0x593221[_0x72c0cf];if(_[_0x0d7f('0x40')](_0x2a4677[_0x0d7f('0x61')][_0x3a453e['id']])){_0x2a4677[_0x0d7f('0x61')][_0x3a453e['id']]=new VoiceExtension(_0x3a453e);}else{_0x2a4677[_0x0d7f('0x3a')](_0x2a4677['voiceExtensions'][_0x3a453e['id']],_0x3a453e);}}}return _0x2a4677[_0x0d7f('0x61')];};};Realtime[_0x0d7f('0x3b')]['initCampaignHopperHistory']=function(){var _0x8951c4=this;return function(_0x51669d){clearCampaigns(_0x8951c4[_0x0d7f('0x13')]);for(var _0x34d7c5=0x0;_0x34d7c5<_0x51669d['length'];_0x34d7c5+=0x1){_[_0x0d7f('0x62')](_0x8951c4[_0x0d7f('0x13')][_0x51669d[_0x34d7c5][_0x0d7f('0x23')]],_0x51669d[_0x34d7c5]);}return _0x8951c4[_0x0d7f('0x13')];};};Realtime[_0x0d7f('0x3b')][_0x0d7f('0x63')]=function(){var _0x571069=this;return function(_0x315b54){if(_0x315b54){freeIsNotKey(_0x315b54,_0x571069['faxAccounts'],'id');for(var _0x5e5309=0x0,_0x4ce613={},_0x1398ef={};_0x5e5309<_0x315b54[_0x0d7f('0x3d')];_0x5e5309+=0x1){_0x4ce613=_0x315b54[_0x5e5309];if(_[_0x0d7f('0x40')](_0x571069[_0x0d7f('0x1f')][_0x4ce613['id']])){_0x571069[_0x0d7f('0x1f')][_0x4ce613['id']]=new FaxAccount(_0x4ce613);}else{_0x571069[_0x0d7f('0x3a')](_0x571069[_0x0d7f('0x1f')][_0x4ce613['id']],_0x4ce613);}}}return _0x571069['faxAccounts'];};};module[_0x0d7f('0x64')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index e13b252..be6553b 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 _0xd536=['./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','findAgent','find','accountcode','name','isNil','interface','format','length','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','voiceQueueReport','create','match','voiceCallReport','destination','exten','dialer','lastdata','queue','callerid','context','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','voiceDialReport','startsWith','Local','substring','indexOf','mobile','lastIndexOf','attendedTransfer','exports','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport'];(function(_0x1477b2,_0x212c6a){var _0x137981=function(_0x2381fc){while(--_0x2381fc){_0x1477b2['push'](_0x1477b2['shift']());}};_0x137981(++_0x212c6a);}(_0xd536,0x1b1));var _0x6d53=function(_0x3c9334,_0x42693c){_0x3c9334=_0x3c9334-0x0;var _0x378b15=_0xd536[_0x3c9334];return _0x378b15;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0x6d53('0x0'));var util=require(_0x6d53('0x1'));var logger=require(_0x6d53('0x2'))(_0x6d53('0x3'));var ami=require(_0x6d53('0x4'));var RpcVoiceAgentReport=require(_0x6d53('0x5'));var RpcVoiceCallReport=require(_0x6d53('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x6d53('0x7'));var RpcVoiceQueueReport=require(_0x6d53('0x8'));var RpcVoiceRecording=require(_0x6d53('0x9'));var RpcVoiceTransferReport=require(_0x6d53('0xa'));var VoiceQueueReport=require(_0x6d53('0xb'));var VoiceCallReport=require(_0x6d53('0xc'));var VoiceAgentReport=require(_0x6d53('0xd'));var VoiceDialReport=require(_0x6d53('0xe'));var UserReport=require(_0x6d53('0xf'));function Report(_0x3b0f97){this[_0x6d53('0x10')]=_0x3b0f97;this['agents']=_0x3b0f97[_0x6d53('0x11')];this['telephones']=_0x3b0f97[_0x6d53('0x12')];}Report[_0x6d53('0x13')][_0x6d53('0x14')]=function(_0x216549){var _0x4f6fd0=new VoiceQueueReport(this[_0x6d53('0x10')]);var _0x462681=new VoiceAgentReport(this['realtime']);var _0x100771=new VoiceDialReport(this[_0x6d53('0x10')]);var _0x5916ab=new VoiceCallReport(this[_0x6d53('0x10')]);var _0x336df0=new UserReport(this[_0x6d53('0x10')]);};Report[_0x6d53('0x13')][_0x6d53('0x15')]=function(_0x35b686){var _0x3efc7f=undefined;_0x3efc7f=_[_0x6d53('0x16')](this[_0x6d53('0x11')],function(_0x4992a5){return _0x4992a5[_0x6d53('0x17')]==_0x35b686||_0x4992a5[_0x6d53('0x18')]==_0x35b686;});if(_[_0x6d53('0x19')](_0x3efc7f)){var _0x49f851=_[_0x6d53('0x16')](this['telephones'],function(_0xcff01c){return _0xcff01c[_0x6d53('0x17')]==_0x35b686||_0xcff01c[_0x6d53('0x18')]==_0x35b686;});if(_0x49f851){_0x3efc7f=_['find'](this[_0x6d53('0x11')],function(_0x217724){return _0x217724[_0x6d53('0x1a')]==util[_0x6d53('0x1b')]('SIP/%s',_0x49f851['name']);});}}return _0x3efc7f;};Report[_0x6d53('0x13')]['voiceQueueReport']=function(_0xcf36c4){for(var _0x4582fd=0x0;_0x4582fd<_0xcf36c4[_0x6d53('0x1c')];_0x4582fd+=0x1){var _0xac51f9=this[_0x6d53('0x15')](_0xcf36c4[_0x4582fd]['connectedlinenum']);if(_0xac51f9){_0xcf36c4[_0x4582fd][_0x6d53('0x17')]=_0xac51f9[_0x6d53('0x17')];_0xcf36c4[_0x4582fd][_0x6d53('0x1d')]=!![];_0xcf36c4[_0x4582fd][_0x6d53('0x1e')]=_0xac51f9[_0x6d53('0x18')];_0xcf36c4[_0x4582fd]['interface']=_[_0x6d53('0x19')](_0xac51f9[_0x6d53('0x1a')])?util[_0x6d53('0x1b')](_0x6d53('0x1f'),_0xac51f9[_0x6d53('0x18')]):_0xac51f9[_0x6d53('0x1a')];if(_0xcf36c4[_0x4582fd][_0x6d53('0x20')]){_0xcf36c4[_0x4582fd]['queuecallercompleteAt']=moment()[_0x6d53('0x1b')](_0x6d53('0x21'));}if(_0xcf36c4[_0x4582fd][_0x6d53('0x22')]){_0xcf36c4[_0x4582fd][_0x6d53('0x23')]=moment()[_0x6d53('0x1b')](_0x6d53('0x21'));}RpcMemberReport[_0x6d53('0x24')](_0xcf36c4[_0x4582fd]);}RpcVoiceQueueReport[_0x6d53('0x25')](_0xcf36c4[_0x4582fd]);}};function extractCalleridNumber(_0x262447){var _0x512d7b=_0x262447[_0x6d53('0x26')](/<(.*?)>/);return _0x512d7b?_0x512d7b[0x1]:_0x262447;}Report[_0x6d53('0x13')][_0x6d53('0x27')]=function(_0x3c94b2){_0x3c94b2[_0x6d53('0x28')]=_0x3c94b2[_0x6d53('0x28')]||_0x3c94b2[_0x6d53('0x29')];if(_0x3c94b2['type']==_0x6d53('0x2a')){_0x3c94b2['lastapplication']='queue';_0x3c94b2[_0x6d53('0x2b')]=_0x3c94b2[_0x6d53('0x2c')];if(_0x3c94b2['context']=='from-voip-provider'){_0x3c94b2[_0x6d53('0x17')]='';_0x3c94b2['destination']=extractCalleridNumber(_0x3c94b2[_0x6d53('0x2d')]);}else if(_0x3c94b2[_0x6d53('0x2e')]==_0x6d53('0x2f')){if(_0x3c94b2['destination']==_0x6d53('0x30')){_0x3c94b2[_0x6d53('0x28')]=extractCalleridNumber(_0x3c94b2['calleridpreview']);_0x3c94b2[_0x6d53('0x31')]=_0x3c94b2[_0x6d53('0x32')];_0x3c94b2['destinationchannel']=[_0x3c94b2['channel'],_0x3c94b2[_0x6d53('0x33')]=_0x3c94b2[_0x6d53('0x34')]][0x0];_0x3c94b2[_0x6d53('0x2d')]=_0x3c94b2['calleridpreview'];}else{_0x3c94b2[_0x6d53('0x28')]=_0x3c94b2[_0x6d53('0x31')];_0x3c94b2[_0x6d53('0x31')]=_0x3c94b2[_0x6d53('0x32')];if(_0x3c94b2[_0x6d53('0x35')]==_0x6d53('0x36')){_0x3c94b2['accountcode']=_0x3c94b2[_0x6d53('0x37')];}else{_0x3c94b2[_0x6d53('0x17')]='';}}}}else{_0x3c94b2[_0x6d53('0x2d')]=util['format'](_0x6d53('0x38'),_0x3c94b2[_0x6d53('0x39')],_0x3c94b2['calleridnum']);}RpcVoiceCallReport[_0x6d53('0x25')](_0x3c94b2);if(_0x3c94b2['monitor']){for(var _0x3dcad0=0x0;_0x3dcad0<_0x3c94b2[_0x6d53('0x3a')][_0x6d53('0x1c')];_0x3dcad0+=0x1){_0x3c94b2[_0x6d53('0x3b')]=_0x3c94b2[_0x6d53('0x3a')][_0x3dcad0][_0x6d53('0x3c')];_0x3c94b2['createdAt']=_0x3c94b2[_0x6d53('0x3a')][_0x3dcad0][_0x6d53('0x3d')];if(_0x3c94b2[_0x6d53('0x29')]==_0x6d53('0x30')){_0x3c94b2[_0x6d53('0x31')]=_0x3c94b2[_0x6d53('0x37')];_0x3c94b2[_0x6d53('0x39')]=_0x3c94b2[_0x6d53('0x3e')];_0x3c94b2[_0x6d53('0x37')]=_0x3c94b2[_0x6d53('0x17')];_0x3c94b2['connectedlinename']=_0x3c94b2[_0x6d53('0x3f')];_0x3c94b2[_0x6d53('0x29')]=_0x3c94b2[_0x6d53('0x32')];}else if(_0x3c94b2[_0x6d53('0x29')]==_0x6d53('0x40')){_0x3c94b2[_0x6d53('0x31')]=_0x3c94b2[_0x6d53('0x28')];_0x3c94b2['exten']=_0x3c94b2['originatecalleridnum'];}RpcVoiceRecording['create'](_0x3c94b2);}}};Report[_0x6d53('0x13')]['voiceAgentReport']=function(_0x3d7f7a){RpcVoiceAgentReport['create'](_0x3d7f7a);};Report['prototype'][_0x6d53('0x41')]=function(_0x52bdbe){RpcVoiceDialReport[_0x6d53('0x25')](_0x52bdbe);var _0x1b8eff=undefined;var _0x5e70f2=_0x52bdbe[_0x6d53('0x33')];if(_[_0x6d53('0x42')](_0x5e70f2,_0x6d53('0x43'))){var _0x549c97=_0x5e70f2[_0x6d53('0x44')](_0x5e70f2[_0x6d53('0x45')]('/')+0x1,_0x5e70f2[_0x6d53('0x45')]('@'));_0x1b8eff=_['find'](this[_0x6d53('0x11')],function(_0x4b134d){return _0x4b134d[_0x6d53('0x46')]==_0x549c97||_0x4b134d['phone']==_0x549c97||_0x4b134d[_0x6d53('0x17')]==_0x549c97;});}else{var _0x549c97=_0x5e70f2[_0x6d53('0x44')](_0x5e70f2[_0x6d53('0x45')]('/')+0x1,_0x5e70f2[_0x6d53('0x47')]('-'));_0x1b8eff=this[_0x6d53('0x15')](_0x549c97);}if(_0x1b8eff){_0x52bdbe[_0x6d53('0x1a')]=_[_0x6d53('0x19')](_0x1b8eff[_0x6d53('0x1a')])?util[_0x6d53('0x1b')](_0x6d53('0x1f'),_0x1b8eff[_0x6d53('0x18')]):_0x1b8eff['interface'];_0x52bdbe['membername']=_0x1b8eff[_0x6d53('0x18')];_0x52bdbe[_0x6d53('0x17')]=_0x1b8eff['accountcode'];RpcMemberReport[_0x6d53('0x41')](_0x52bdbe);}};Report['prototype']['blindTransfer']=function(_0x18323d){RpcVoiceTransferReport['blindTransfer'](_0x18323d);};Report[_0x6d53('0x13')][_0x6d53('0x48')]=function(_0x5822d6){RpcVoiceTransferReport['attendedTransfer'](_0x5822d6);};module[_0x6d53('0x49')]=Report; \ No newline at end of file +var _0x515a=['../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceTransferReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','findAgent','find','name','interface','format','voiceQueueReport','length','accountcode','queuecallercomplete','queuecallercompleteAt','queuecallerexit','YYYY-MM-DD\x20HH:mm:ss','create','match','voiceCallReport','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','channel','callerid','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','calleridnum','monitor','monitors','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','voiceDialReport','startsWith','Local','substring','mobile','phone','indexOf','SIP/%s','membername','blindTransfer','attendedTransfer','util','../../../config/logger','../ami'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x515a,0x147));var _0xa515=function(_0x2743af,_0x2a220a){_0x2743af=_0x2743af-0x0;var _0x51c1c3=_0x515a[_0x2743af];return _0x51c1c3;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require('moment');var util=require(_0xa515('0x0'));var logger=require(_0xa515('0x1'))('ami');var ami=require(_0xa515('0x2'));var RpcVoiceAgentReport=require(_0xa515('0x3'));var RpcVoiceCallReport=require(_0xa515('0x4'));var RpcVoiceDialReport=require(_0xa515('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xa515('0x6'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xa515('0x7'));var VoiceDialReport=require(_0xa515('0x8'));var UserReport=require(_0xa515('0x9'));function Report(_0x2300c0){this[_0xa515('0xa')]=_0x2300c0;this[_0xa515('0xb')]=_0x2300c0[_0xa515('0xb')];this[_0xa515('0xc')]=_0x2300c0[_0xa515('0xc')];}Report[_0xa515('0xd')][_0xa515('0xe')]=function(_0x11c245){var _0x4d7790=new VoiceQueueReport(this[_0xa515('0xa')]);var _0x53501c=new VoiceAgentReport(this[_0xa515('0xa')]);var _0x33e6ea=new VoiceDialReport(this[_0xa515('0xa')]);var _0x190ce3=new VoiceCallReport(this[_0xa515('0xa')]);var _0x5cb544=new UserReport(this[_0xa515('0xa')]);};Report[_0xa515('0xd')][_0xa515('0xf')]=function(_0x239bd7){var _0x44142a=undefined;_0x44142a=_[_0xa515('0x10')](this['agents'],function(_0x1186b6){return _0x1186b6['accountcode']==_0x239bd7||_0x1186b6[_0xa515('0x11')]==_0x239bd7;});if(_['isNil'](_0x44142a)){var _0x2b8e33=_[_0xa515('0x10')](this[_0xa515('0xc')],function(_0xed432c){return _0xed432c['accountcode']==_0x239bd7||_0xed432c['name']==_0x239bd7;});if(_0x2b8e33){_0x44142a=_[_0xa515('0x10')](this['agents'],function(_0x28dd4f){return _0x28dd4f[_0xa515('0x12')]==util[_0xa515('0x13')]('SIP/%s',_0x2b8e33['name']);});}}return _0x44142a;};Report['prototype'][_0xa515('0x14')]=function(_0x5298b5){for(var _0x3109f5=0x0;_0x3109f5<_0x5298b5[_0xa515('0x15')];_0x3109f5+=0x1){var _0x1468f3=this['findAgent'](_0x5298b5[_0x3109f5]['connectedlinenum']);if(_0x1468f3){_0x5298b5[_0x3109f5]['accountcode']=_0x1468f3[_0xa515('0x16')];_0x5298b5[_0x3109f5]['assigned']=!![];_0x5298b5[_0x3109f5]['lastAssignedTo']=_0x1468f3[_0xa515('0x11')];_0x5298b5[_0x3109f5][_0xa515('0x12')]=_['isNil'](_0x1468f3['interface'])?util[_0xa515('0x13')]('SIP/%s',_0x1468f3[_0xa515('0x11')]):_0x1468f3['interface'];if(_0x5298b5[_0x3109f5][_0xa515('0x17')]){_0x5298b5[_0x3109f5][_0xa515('0x18')]=moment()[_0xa515('0x13')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5298b5[_0x3109f5][_0xa515('0x19')]){_0x5298b5[_0x3109f5]['queuecallerexitAt']=moment()[_0xa515('0x13')](_0xa515('0x1a'));}RpcMemberReport['voiceQueueReport'](_0x5298b5[_0x3109f5]);}RpcVoiceQueueReport[_0xa515('0x1b')](_0x5298b5[_0x3109f5]);}};function extractCalleridNumber(_0x52a3bf){var _0x37bfae=_0x52a3bf[_0xa515('0x1c')](/<(.*?)>/);return _0x37bfae?_0x37bfae[0x1]:_0x52a3bf;}Report['prototype'][_0xa515('0x1d')]=function(_0x15c56b){_0x15c56b[_0xa515('0x1e')]=_0x15c56b[_0xa515('0x1e')]||_0x15c56b['exten'];if(_0x15c56b[_0xa515('0x1f')]==_0xa515('0x20')){_0x15c56b[_0xa515('0x21')]=_0xa515('0x22');_0x15c56b[_0xa515('0x23')]=_0x15c56b[_0xa515('0x22')];if(_0x15c56b[_0xa515('0x24')]==_0xa515('0x25')){_0x15c56b[_0xa515('0x16')]='';_0x15c56b[_0xa515('0x1e')]=extractCalleridNumber(_0x15c56b['callerid']);}else if(_0x15c56b['context']==_0xa515('0x26')){if(_0x15c56b['destination']==_0xa515('0x27')){_0x15c56b[_0xa515('0x1e')]=extractCalleridNumber(_0x15c56b[_0xa515('0x28')]);_0x15c56b['calleridnum']=_0x15c56b[_0xa515('0x29')];_0x15c56b['destinationchannel']=[_0x15c56b[_0xa515('0x2a')],_0x15c56b['channel']=_0x15c56b['destinationchannel']][0x0];_0x15c56b[_0xa515('0x2b')]=_0x15c56b[_0xa515('0x28')];}else{_0x15c56b[_0xa515('0x1e')]=_0x15c56b['calleridnum'];_0x15c56b['calleridnum']=_0x15c56b[_0xa515('0x29')];if(_0x15c56b['disposition']=='ANSWERED'){_0x15c56b['accountcode']=_0x15c56b[_0xa515('0x2c')];}else{_0x15c56b[_0xa515('0x16')]='';}}}}else{_0x15c56b[_0xa515('0x2b')]=util[_0xa515('0x13')](_0xa515('0x2d'),_0x15c56b[_0xa515('0x2e')],_0x15c56b[_0xa515('0x2f')]);}RpcVoiceCallReport[_0xa515('0x1b')](_0x15c56b);if(_0x15c56b[_0xa515('0x30')]){for(var _0xa10a6f=0x0;_0xa10a6f<_0x15c56b[_0xa515('0x31')][_0xa515('0x15')];_0xa10a6f+=0x1){_0x15c56b['monitorFilename']=_0x15c56b[_0xa515('0x31')][_0xa10a6f][_0xa515('0x32')];_0x15c56b[_0xa515('0x33')]=_0x15c56b['monitors'][_0xa10a6f][_0xa515('0x33')];if(_0x15c56b[_0xa515('0x34')]=='xcally-motion-preview'){_0x15c56b[_0xa515('0x2f')]=_0x15c56b[_0xa515('0x2c')];_0x15c56b[_0xa515('0x2e')]=_0x15c56b['connectedlinename'];_0x15c56b[_0xa515('0x2c')]=_0x15c56b[_0xa515('0x16')];_0x15c56b[_0xa515('0x35')]=_0x15c56b['membername'];_0x15c56b[_0xa515('0x34')]=_0x15c56b[_0xa515('0x29')];}else if(_0x15c56b[_0xa515('0x34')]==_0xa515('0x36')){_0x15c56b[_0xa515('0x2f')]=_0x15c56b[_0xa515('0x1e')];_0x15c56b[_0xa515('0x34')]=_0x15c56b['originatecalleridnum'];}RpcVoiceRecording[_0xa515('0x1b')](_0x15c56b);}}};Report[_0xa515('0xd')]['voiceAgentReport']=function(_0x6b650d){RpcVoiceAgentReport['create'](_0x6b650d);};Report['prototype'][_0xa515('0x37')]=function(_0x13c67e){RpcVoiceDialReport[_0xa515('0x1b')](_0x13c67e);var _0x152e37=undefined;var _0x45c939=_0x13c67e[_0xa515('0x2a')];if(_[_0xa515('0x38')](_0x45c939,_0xa515('0x39'))){var _0x86cb34=_0x45c939[_0xa515('0x3a')](_0x45c939['indexOf']('/')+0x1,_0x45c939['indexOf']('@'));_0x152e37=_['find'](this[_0xa515('0xb')],function(_0x34a6da){return _0x34a6da[_0xa515('0x3b')]==_0x86cb34||_0x34a6da[_0xa515('0x3c')]==_0x86cb34||_0x34a6da['accountcode']==_0x86cb34;});}else{var _0x86cb34=_0x45c939[_0xa515('0x3a')](_0x45c939[_0xa515('0x3d')]('/')+0x1,_0x45c939['lastIndexOf']('-'));_0x152e37=this[_0xa515('0xf')](_0x86cb34);}if(_0x152e37){_0x13c67e[_0xa515('0x12')]=_['isNil'](_0x152e37[_0xa515('0x12')])?util['format'](_0xa515('0x3e'),_0x152e37[_0xa515('0x11')]):_0x152e37[_0xa515('0x12')];_0x13c67e[_0xa515('0x3f')]=_0x152e37[_0xa515('0x11')];_0x13c67e[_0xa515('0x16')]=_0x152e37['accountcode'];RpcMemberReport[_0xa515('0x37')](_0x13c67e);}};Report[_0xa515('0xd')]['blindTransfer']=function(_0x40441a){RpcVoiceTransferReport[_0xa515('0x40')](_0x40441a);};Report['prototype'][_0xa515('0x41')]=function(_0x572df1){RpcVoiceTransferReport[_0xa515('0x41')](_0x572df1);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 5ef3a85..2795650 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 _0x5811=['loopSyncRealTimeShow','catch','isNotNull','isUndefined','emit','find','username','stateRegistry','merge','omit','actionid','state','format','trunk:%s','name','[syncRegistry][UserReport]','device','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','trunk:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','accountcode','peer','registered','status','address','telephone:%s','telephone:save','exports','lodash','moment','bluebird','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','[loopSyncRealTimeShow]','error','inspect','prototype'];(function(_0x13c006,_0x2284ab){var _0x13c8bd=function(_0x245b5d){while(--_0x245b5d){_0x13c006['push'](_0x13c006['shift']());}};_0x13c8bd(++_0x2284ab);}(_0x5811,0x68));var _0x1581=function(_0x1b85c3,_0x5b4794){_0x1b85c3=_0x1b85c3-0x0;var _0x41a2b8=_0x5811[_0x1b85c3];return _0x41a2b8;};'use strict';var _=require(_0x1581('0x0'));var moment=require(_0x1581('0x1'));var BPromise=require(_0x1581('0x2'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x1581('0x3'))(_0x1581('0x4'));var ami=require(_0x1581('0x5'));config[_0x1581('0x6')]=_['defaults'](config[_0x1581('0x6')],{'host':_0x1581('0x7'),'port':0x18eb});var io=require(_0x1581('0x8'))(new Redis(config['redis']));function UserReport(_0x2904d2){this[_0x1581('0x9')]=_0x2904d2[_0x1581('0x9')];this[_0x1581('0xa')]=_0x2904d2[_0x1581('0xa')];this[_0x1581('0xb')]=_0x2904d2[_0x1581('0xb')];ami['on']('registryentry',this[_0x1581('0xc')][_0x1581('0xd')](this));ami['on'](_0x1581('0xe'),this[_0x1581('0xc')][_0x1581('0xd')](this));ami['on'](_0x1581('0xf'),this[_0x1581('0x10')]['bind'](this));ami['on'](_0x1581('0x11'),this[_0x1581('0x12')][_0x1581('0xd')](this));this['loopSyncRealTimeShow']();return BPromise[_0x1581('0x13')]()[_0x1581('0x14')](ami[_0x1581('0x15')]())[_0x1581('0x14')](ami[_0x1581('0x16')]())[_0x1581('0x14')](ami[_0x1581('0x17')]())['catch'](loggerCatch(_0x1581('0x18')));}function loggerCatch(_0x48edf5){return function(_0x3ac459){logger[_0x1581('0x19')](_0x48edf5,util[_0x1581('0x1a')](_0x3ac459,{'showHidden':![],'depth':null}));};}UserReport[_0x1581('0x1b')][_0x1581('0x1c')]=function(){setInterval(function(){BPromise[_0x1581('0x13')]()[_0x1581('0x14')](ami[_0x1581('0x15')]())[_0x1581('0x14')](ami[_0x1581('0x16')]())['then'](ami[_0x1581('0x17')]())[_0x1581('0x1d')](loggerCatch(_0x1581('0x18')));},0x32c8);};UserReport[_0x1581('0x1b')][_0x1581('0x1e')]=function(_0x5cbb7d){return _0x5cbb7d!==null&&!_[_0x1581('0x1f')](_0x5cbb7d);};UserReport[_0x1581('0x1b')][_0x1581('0x20')]=function(_0x5cb567,_0x50c4f0,_0x35dadb){io['to'](_0x5cb567)[_0x1581('0x20')](_0x50c4f0,_0x35dadb);};UserReport['prototype'][_0x1581('0xc')]=function(_0x196da4){try{if(this[_0x1581('0x1e')](_0x196da4)){var _0x3f0beb=_[_0x1581('0x21')](this[_0x1581('0x9')],{'registry':_0x196da4[_0x1581('0x22')]});if(_0x3f0beb){_0x196da4[_0x1581('0x23')]=_0x196da4['state'];_[_0x1581('0x24')](_0x3f0beb,_[_0x1581('0x25')](_0x196da4,['event',_0x1581('0x26'),_0x1581('0x22'),_0x1581('0x27')]));this[_0x1581('0x20')](util[_0x1581('0x28')](_0x1581('0x29'),_0x3f0beb[_0x1581('0x2a')]),'trunk:save',_0x3f0beb);}}}catch(_0x283dbb){logger['error'](_0x1581('0x2b'),util[_0x1581('0x1a')](_0x283dbb,{'showHidden':![],'depth':null}));}};UserReport[_0x1581('0x1b')][_0x1581('0x10')]=function(_0xef45ce){try{if(this[_0x1581('0x1e')](_0xef45ce)){if(this['agents'][_0xef45ce[_0x1581('0x2c')]]){if(!this[_0x1581('0xa')][_0xef45ce[_0x1581('0x2c')]][_0x1581('0x2d')]||_0xef45ce[_0x1581('0x27')][_0x1581('0x2e')]()=='inuse'){this[_0x1581('0xa')][_0xef45ce['device']][_0x1581('0x2d')]=![];if(this[_0x1581('0xa')][_0xef45ce[_0x1581('0x2c')]][_0x1581('0x27')]!==_0xef45ce[_0x1581('0x27')][_0x1581('0x2e')]()){this[_0x1581('0xa')][_0xef45ce[_0x1581('0x2c')]][_0x1581('0x2f')]=_[_0x1581('0x30')](moment()[_0x1581('0x28')]('x'));}this[_0x1581('0xa')][_0xef45ce[_0x1581('0x2c')]][_0x1581('0x27')]=_0xef45ce['state']['toLowerCase']();this[_0x1581('0xa')][_0xef45ce['device']][_0x1581('0x31')](_0xef45ce);}}else if(this[_0x1581('0xb')][_0xef45ce[_0x1581('0x2c')]]){if(this[_0x1581('0xb')][_0xef45ce['device']][_0x1581('0x27')]!==_0xef45ce[_0x1581('0x27')][_0x1581('0x2e')]()){this[_0x1581('0xb')][_0xef45ce[_0x1581('0x2c')]]['stateTime']=_[_0x1581('0x30')](moment()['format']('x'));}this['telephones'][_0xef45ce['device']][_0x1581('0x27')]=_0xef45ce[_0x1581('0x27')][_0x1581('0x2e')]();this[_0x1581('0x20')](util[_0x1581('0x28')]('telephone:%s',this[_0x1581('0xb')][_0xef45ce['device']]['name']),'telephone:save',this[_0x1581('0xb')][_0xef45ce['device']]);}else if(this[_0x1581('0x9')][_0xef45ce[_0x1581('0x2c')]]){if(this['trunks'][_0xef45ce[_0x1581('0x2c')]][_0x1581('0x27')]!==_0xef45ce[_0x1581('0x27')][_0x1581('0x2e')]()){this[_0x1581('0x9')][_0xef45ce[_0x1581('0x2c')]][_0x1581('0x2f')]=_[_0x1581('0x30')](moment()['format']('x'));}this[_0x1581('0x9')][_0xef45ce[_0x1581('0x2c')]]['state']=_0xef45ce[_0x1581('0x27')][_0x1581('0x2e')]();this[_0x1581('0x20')](util[_0x1581('0x28')]('trunk:%s',this[_0x1581('0x9')][_0xef45ce[_0x1581('0x2c')]][_0x1581('0x2a')]),_0x1581('0x32'),this[_0x1581('0x9')][_0xef45ce['device']]);}else if(_[_0x1581('0x33')](_0xef45ce[_0x1581('0x2c')],_0x1581('0x34'))){}else if(_['startsWith'](_0xef45ce[_0x1581('0x2c')],_0x1581('0x35'))){var _0x5480f9=_0xef45ce[_0x1581('0x2c')];var _0x5a53a6=_0x5480f9[_0x1581('0x36')](_0x5480f9[_0x1581('0x37')]('/')+0x1,_0x5480f9['indexOf']('@'));var _0x379869=_[_0x1581('0x21')](this['agents'],function(_0x594db1){return _0x594db1[_0x1581('0x38')]==_0x5a53a6||_0x594db1[_0x1581('0x39')]==_0x5a53a6||_0x594db1[_0x1581('0x3a')]==_0x5a53a6;});if(_0x379869){if(_0x379869[_0x1581('0x27')]!==_0xef45ce[_0x1581('0x27')][_0x1581('0x2e')]()){_0x379869[_0x1581('0x2f')]=_[_0x1581('0x30')](moment()['format']('x'));}_0x379869[_0x1581('0x27')]=_0xef45ce[_0x1581('0x27')][_0x1581('0x2e')]();_0x379869['local']=!![];_0x379869[_0x1581('0x31')](_0xef45ce);}}else{}}}catch(_0x19b055){logger['error']('[syncDeviceState][UserReport]',util['inspect'](_0x19b055,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x1581('0x12')]=function(_0x3d0382){try{if(this[_0x1581('0x1e')](_0x3d0382)&&this[_0x1581('0x1e')](_0x3d0382[_0x1581('0x11')])){if(this[_0x1581('0xa')][_0x3d0382[_0x1581('0x3b')]]){if(!this[_0x1581('0xa')][_0x3d0382[_0x1581('0x3b')]][_0x1581('0x2d')]||_0x3d0382[_0x1581('0x11')]['toLowerCase']()==_0x1581('0x3c')){this[_0x1581('0xa')][_0x3d0382['peer']][_0x1581('0x2d')]=![];this[_0x1581('0xa')][_0x3d0382[_0x1581('0x3b')]][_0x1581('0x3d')]=_0x3d0382[_0x1581('0x11')][_0x1581('0x2e')]();this[_0x1581('0xa')][_0x3d0382[_0x1581('0x3b')]]['address']=_0x3d0382[_0x1581('0x3e')];this[_0x1581('0xa')][_0x3d0382[_0x1581('0x3b')]][_0x1581('0x31')](_0x3d0382);}}else if(this['telephones'][_0x3d0382[_0x1581('0x3b')]]){this['telephones'][_0x3d0382[_0x1581('0x3b')]]['status']=_0x3d0382[_0x1581('0x11')][_0x1581('0x2e')]();this[_0x1581('0xb')][_0x3d0382['peer']]['address']=_0x3d0382[_0x1581('0x3e')];this[_0x1581('0x20')](util[_0x1581('0x28')](_0x1581('0x3f'),this[_0x1581('0xb')][_0x3d0382[_0x1581('0x3b')]][_0x1581('0x2a')]),_0x1581('0x40'),this[_0x1581('0xb')][_0x3d0382[_0x1581('0x3b')]]);}else if(this[_0x1581('0x9')][_0x3d0382['peer']]){this[_0x1581('0x9')][_0x3d0382[_0x1581('0x3b')]]['status']=_0x3d0382[_0x1581('0x11')][_0x1581('0x2e')]();this['trunks'][_0x3d0382[_0x1581('0x3b')]]['address']=_0x3d0382['address'];this[_0x1581('0x20')](util[_0x1581('0x28')](_0x1581('0x29'),this[_0x1581('0x9')][_0x3d0382[_0x1581('0x3b')]][_0x1581('0x2a')]),_0x1581('0x32'),this[_0x1581('0x9')][_0x3d0382['peer']]);}else{}}}catch(_0x376454){logger[_0x1581('0x19')]('[syncPeerStatus][UserReport]',util['inspect'](_0x376454,{'showHidden':![],'depth':null}));}};module[_0x1581('0x41')]=UserReport; \ No newline at end of file +var _0xb516=['../ami','defaults','localhost','socket.io-emitter','redis','trunks','agents','telephones','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[loopSyncRealTimeShow]','prototype','isNotNull','isUndefined','emit','find','state','merge','omit','event','actionid','username','format','trunk:%s','name','error','[syncRegistry][UserReport]','inspect','device','local','toLowerCase','inuse','stateTime','toNumber','telephone:%s','telephone:save','trunk:save','startsWith','Queue','Local','substring','indexOf','phone','accountcode','updateStatusRealtime','syncPeerStatus','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ami'];(function(_0x481a32,_0x42072f){var _0xff6fa6=function(_0x5961cb){while(--_0x5961cb){_0x481a32['push'](_0x481a32['shift']());}};_0xff6fa6(++_0x42072f);}(_0xb516,0x103));var _0x6b51=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0xb516[_0x9b2bb0];return _0x2cdb3b;};'use strict';var _=require(_0x6b51('0x0'));var moment=require(_0x6b51('0x1'));var BPromise=require(_0x6b51('0x2'));var util=require(_0x6b51('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x6b51('0x4'));var ami=require(_0x6b51('0x5'));config['redis']=_[_0x6b51('0x6')](config['redis'],{'host':_0x6b51('0x7'),'port':0x18eb});var io=require(_0x6b51('0x8'))(new Redis(config[_0x6b51('0x9')]));function UserReport(_0xff879b){this[_0x6b51('0xa')]=_0xff879b[_0x6b51('0xa')];this[_0x6b51('0xb')]=_0xff879b[_0x6b51('0xb')];this['telephones']=_0xff879b[_0x6b51('0xc')];ami['on']('registryentry',this[_0x6b51('0xd')][_0x6b51('0xe')](this));ami['on']('registry',this[_0x6b51('0xd')][_0x6b51('0xe')](this));ami['on'](_0x6b51('0xf'),this[_0x6b51('0x10')][_0x6b51('0xe')](this));ami['on'](_0x6b51('0x11'),this['syncPeerStatus']['bind'](this));this[_0x6b51('0x12')]();return BPromise[_0x6b51('0x13')]()[_0x6b51('0x14')](ami[_0x6b51('0x15')]())[_0x6b51('0x14')](ami[_0x6b51('0x16')]())[_0x6b51('0x14')](ami['actionSipPeerStatus']())[_0x6b51('0x17')](loggerCatch(_0x6b51('0x18')));}function loggerCatch(_0x43d6ef){return function(_0x2cbe84){logger['error'](_0x43d6ef,util['inspect'](_0x2cbe84,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0x6b51('0x12')]=function(){setInterval(function(){BPromise[_0x6b51('0x13')]()[_0x6b51('0x14')](ami['actionSipShowRegistry']())[_0x6b51('0x14')](ami[_0x6b51('0x16')]())[_0x6b51('0x14')](ami['actionSipPeerStatus']())['catch'](loggerCatch(_0x6b51('0x18')));},0x32c8);};UserReport[_0x6b51('0x19')][_0x6b51('0x1a')]=function(_0x2bf58a){return _0x2bf58a!==null&&!_[_0x6b51('0x1b')](_0x2bf58a);};UserReport[_0x6b51('0x19')][_0x6b51('0x1c')]=function(_0x5ad842,_0x30a986,_0x4267a5){io['to'](_0x5ad842)[_0x6b51('0x1c')](_0x30a986,_0x4267a5);};UserReport['prototype'][_0x6b51('0xd')]=function(_0x4abcd5){try{if(this[_0x6b51('0x1a')](_0x4abcd5)){var _0x195565=_[_0x6b51('0x1d')](this[_0x6b51('0xa')],{'registry':_0x4abcd5['username']});if(_0x195565){_0x4abcd5['stateRegistry']=_0x4abcd5[_0x6b51('0x1e')];_[_0x6b51('0x1f')](_0x195565,_[_0x6b51('0x20')](_0x4abcd5,[_0x6b51('0x21'),_0x6b51('0x22'),_0x6b51('0x23'),_0x6b51('0x1e')]));this[_0x6b51('0x1c')](util[_0x6b51('0x24')](_0x6b51('0x25'),_0x195565[_0x6b51('0x26')]),'trunk:save',_0x195565);}}}catch(_0x5dff9d){logger[_0x6b51('0x27')](_0x6b51('0x28'),util[_0x6b51('0x29')](_0x5dff9d,{'showHidden':![],'depth':null}));}};UserReport[_0x6b51('0x19')][_0x6b51('0x10')]=function(_0x2b921b){try{if(this[_0x6b51('0x1a')](_0x2b921b)){if(this['agents'][_0x2b921b[_0x6b51('0x2a')]]){if(!this[_0x6b51('0xb')][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x2b')]||_0x2b921b[_0x6b51('0x1e')][_0x6b51('0x2c')]()==_0x6b51('0x2d')){this[_0x6b51('0xb')][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x2b')]=![];if(this[_0x6b51('0xb')][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x1e')]!==_0x2b921b[_0x6b51('0x1e')][_0x6b51('0x2c')]()){this[_0x6b51('0xb')][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x2e')]=_[_0x6b51('0x2f')](moment()[_0x6b51('0x24')]('x'));}this['agents'][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x1e')]=_0x2b921b['state'][_0x6b51('0x2c')]();this[_0x6b51('0xb')][_0x2b921b[_0x6b51('0x2a')]]['updateStatusRealtime'](_0x2b921b);}}else if(this[_0x6b51('0xc')][_0x2b921b[_0x6b51('0x2a')]]){if(this[_0x6b51('0xc')][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x1e')]!==_0x2b921b[_0x6b51('0x1e')][_0x6b51('0x2c')]()){this['telephones'][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x2e')]=_[_0x6b51('0x2f')](moment()[_0x6b51('0x24')]('x'));}this['telephones'][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x1e')]=_0x2b921b[_0x6b51('0x1e')]['toLowerCase']();this[_0x6b51('0x1c')](util[_0x6b51('0x24')](_0x6b51('0x30'),this[_0x6b51('0xc')][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x26')]),_0x6b51('0x31'),this[_0x6b51('0xc')][_0x2b921b['device']]);}else if(this[_0x6b51('0xa')][_0x2b921b['device']]){if(this[_0x6b51('0xa')][_0x2b921b['device']][_0x6b51('0x1e')]!==_0x2b921b[_0x6b51('0x1e')][_0x6b51('0x2c')]()){this[_0x6b51('0xa')][_0x2b921b['device']][_0x6b51('0x2e')]=_['toNumber'](moment()[_0x6b51('0x24')]('x'));}this[_0x6b51('0xa')][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x1e')]=_0x2b921b['state'][_0x6b51('0x2c')]();this[_0x6b51('0x1c')](util[_0x6b51('0x24')]('trunk:%s',this[_0x6b51('0xa')][_0x2b921b[_0x6b51('0x2a')]][_0x6b51('0x26')]),_0x6b51('0x32'),this['trunks'][_0x2b921b[_0x6b51('0x2a')]]);}else if(_[_0x6b51('0x33')](_0x2b921b[_0x6b51('0x2a')],_0x6b51('0x34'))){}else if(_[_0x6b51('0x33')](_0x2b921b[_0x6b51('0x2a')],_0x6b51('0x35'))){var _0xaf4cdb=_0x2b921b[_0x6b51('0x2a')];var _0x4a1106=_0xaf4cdb[_0x6b51('0x36')](_0xaf4cdb[_0x6b51('0x37')]('/')+0x1,_0xaf4cdb[_0x6b51('0x37')]('@'));var _0x55e58e=_[_0x6b51('0x1d')](this[_0x6b51('0xb')],function(_0x191894){return _0x191894['mobile']==_0x4a1106||_0x191894[_0x6b51('0x38')]==_0x4a1106||_0x191894[_0x6b51('0x39')]==_0x4a1106;});if(_0x55e58e){if(_0x55e58e[_0x6b51('0x1e')]!==_0x2b921b[_0x6b51('0x1e')][_0x6b51('0x2c')]()){_0x55e58e[_0x6b51('0x2e')]=_['toNumber'](moment()['format']('x'));}_0x55e58e[_0x6b51('0x1e')]=_0x2b921b['state'][_0x6b51('0x2c')]();_0x55e58e[_0x6b51('0x2b')]=!![];_0x55e58e[_0x6b51('0x3a')](_0x2b921b);}}else{}}}catch(_0x2b0f60){logger['error']('[syncDeviceState][UserReport]',util[_0x6b51('0x29')](_0x2b0f60,{'showHidden':![],'depth':null}));}};UserReport[_0x6b51('0x19')][_0x6b51('0x3b')]=function(_0x5b0af5){try{if(this[_0x6b51('0x1a')](_0x5b0af5)&&this[_0x6b51('0x1a')](_0x5b0af5[_0x6b51('0x11')])){if(this[_0x6b51('0xb')][_0x5b0af5[_0x6b51('0x3c')]]){if(!this[_0x6b51('0xb')][_0x5b0af5[_0x6b51('0x3c')]][_0x6b51('0x2b')]||_0x5b0af5[_0x6b51('0x11')]['toLowerCase']()==_0x6b51('0x3d')){this[_0x6b51('0xb')][_0x5b0af5[_0x6b51('0x3c')]][_0x6b51('0x2b')]=![];this[_0x6b51('0xb')][_0x5b0af5['peer']][_0x6b51('0x3e')]=_0x5b0af5[_0x6b51('0x11')][_0x6b51('0x2c')]();this['agents'][_0x5b0af5['peer']][_0x6b51('0x3f')]=_0x5b0af5[_0x6b51('0x3f')];this['agents'][_0x5b0af5['peer']][_0x6b51('0x3a')](_0x5b0af5);}}else if(this[_0x6b51('0xc')][_0x5b0af5[_0x6b51('0x3c')]]){this['telephones'][_0x5b0af5[_0x6b51('0x3c')]]['status']=_0x5b0af5['peerstatus'][_0x6b51('0x2c')]();this['telephones'][_0x5b0af5['peer']][_0x6b51('0x3f')]=_0x5b0af5[_0x6b51('0x3f')];this[_0x6b51('0x1c')](util['format']('telephone:%s',this[_0x6b51('0xc')][_0x5b0af5[_0x6b51('0x3c')]][_0x6b51('0x26')]),_0x6b51('0x31'),this['telephones'][_0x5b0af5[_0x6b51('0x3c')]]);}else if(this[_0x6b51('0xa')][_0x5b0af5[_0x6b51('0x3c')]]){this[_0x6b51('0xa')][_0x5b0af5[_0x6b51('0x3c')]]['status']=_0x5b0af5[_0x6b51('0x11')]['toLowerCase']();this[_0x6b51('0xa')][_0x5b0af5[_0x6b51('0x3c')]][_0x6b51('0x3f')]=_0x5b0af5[_0x6b51('0x3f')];this[_0x6b51('0x1c')](util[_0x6b51('0x24')](_0x6b51('0x25'),this[_0x6b51('0xa')][_0x5b0af5[_0x6b51('0x3c')]][_0x6b51('0x26')]),_0x6b51('0x32'),this[_0x6b51('0xa')][_0x5b0af5[_0x6b51('0x3c')]]);}else{}}}catch(_0x89e6fe){logger[_0x6b51('0x27')](_0x6b51('0x40'),util[_0x6b51('0x29')](_0x89e6fe,{'showHidden':![],'depth':null}));}};module[_0x6b51('0x41')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 7b1a4dd..78937df 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 _0x01d3=['clear','cause','answered_elsewhere','custom:agentansweredelsewhere','custom:agentcomplete','user:%s','user:agentcomplete','custom:voiceAgentReport','syncHangup','cause-txt','recalculate','ATTENDED','secondtransfereruniqueid','secondtransfererexten','secondtransferercontext','transfertargetchannel','syncBlindTransfer','transfererchannel','BLIND','transfereeuniqueid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberrealtime','keys','value','exports','lodash','moment','util','ioredis','../../../config/logger','ami','redis','defaults','localhost','voiceQueues','agents','channels','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','syncAgentRingNoAnswer','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','attendedtransfer','syncAttendedTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','prototype','format','%s|%s','membername','exten','calleridnum','join','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','interface','isNil','queue','emit','user:save','calleridname','destcalleridname','destchannel','destuniqueid','destcalleridnum','destexten','context','priority','type','mandatoryDisposition','agent','called','custom:agentcalled','user:called','CALLED','error','stack','ringtime','connect','agentconnectAt','agentcalledAt','log','CONNECT','find','channel','onhold','updateStatusRealtime','assign','rejected','agentringnoanswerAt','RINGNOANSWER','syncQueueCallerAbandon','holdtime','position','originalposition','abandoned','custom:agentqueuecallerabandon','talktime','reason','transfer','complete','acw','acwTimeout','agentcompleteAt','COMPLETE'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x01d3,0xa2));var _0x301d=function(_0xfc4648,_0x7e8703){_0xfc4648=_0xfc4648-0x0;var _0x2fc96c=_0x01d3[_0xfc4648];return _0x2fc96c;};'use strict';var _=require(_0x301d('0x0'));var moment=require(_0x301d('0x1'));var util=require(_0x301d('0x2'));var Redis=require(_0x301d('0x3'));var config=require('../../../config/environment');var logger=require(_0x301d('0x4'))(_0x301d('0x5'));var ami=require('../ami');config[_0x301d('0x6')]=_[_0x301d('0x7')](config[_0x301d('0x6')],{'host':_0x301d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x301d('0x6')]));function VoiceAgentReport(_0x2d8fc2){this[_0x301d('0x9')]=_0x2d8fc2[_0x301d('0x9')];this[_0x301d('0xa')]=_0x2d8fc2[_0x301d('0xa')];this[_0x301d('0xb')]={};this[_0x301d('0xc')]={};ami['on'](_0x301d('0xd'),this[_0x301d('0xe')]['bind'](this));ami['on'](_0x301d('0xf'),this[_0x301d('0x10')][_0x301d('0x11')](this));ami['on']('agentringnoanswer',this[_0x301d('0x12')][_0x301d('0x11')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x301d('0x13'),this[_0x301d('0x14')][_0x301d('0x11')](this));ami['on'](_0x301d('0x15'),this[_0x301d('0x16')][_0x301d('0x11')](this));ami['on'](_0x301d('0x17'),this['syncHangup']['bind'](this));ami['on'](_0x301d('0x18'),this[_0x301d('0x19')][_0x301d('0x11')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on']('musiconholdstart',this[_0x301d('0x1a')][_0x301d('0x11')](this));ami['on'](_0x301d('0x1b'),this[_0x301d('0x1c')][_0x301d('0x11')](this));}VoiceAgentReport[_0x301d('0x1d')]['log']=function(_0x40a9ed,_0x4ed038){logger['info'](util[_0x301d('0x1e')](_0x301d('0x1f'),_0x40a9ed,[_0x4ed038['uniqueid'],_0x4ed038[_0x301d('0x20')],_0x4ed038['queue'],_0x4ed038[_0x301d('0x21')],_0x4ed038[_0x301d('0x22')]][_0x301d('0x23')]('|')));};VoiceAgentReport['prototype'][_0x301d('0x24')]=function(_0x53ed76,_0x3f9294){return moment(_0x53ed76)[_0x301d('0x25')](_0x3f9294,_0x301d('0x26'))['format'](_0x301d('0x27'));};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x28')]=function(_0x3b1f29,_0x21f186){return moment(_0x3b1f29)[_0x301d('0x29')](moment(_0x21f186),_0x301d('0x26'));};VoiceAgentReport['prototype'][_0x301d('0xe')]=function(_0x3ec2b6){try{var _0x45e7e3=this['agents'][_0x3ec2b6[_0x301d('0x2a')]];if(!_[_0x301d('0x2b')](_0x45e7e3)){_0x45e7e3=_['assign'](_0x45e7e3,{'queue':_0x3ec2b6[_0x301d('0x2c')],'destconnectedlinenum':_0x3ec2b6['calleridnum']});io[_0x301d('0x2d')](_0x301d('0x2e'),_0x45e7e3);}var _0x49f1ac=this[_0x301d('0xb')][_0x3ec2b6['destchannel']]={'agentcalledAt':moment()['format'](_0x301d('0x27')),'calleridnum':_0x3ec2b6[_0x301d('0x22')],'calleridname':_0x3ec2b6[_0x301d('0x2f')],'connectedlinenum':_0x3ec2b6['destcalleridnum'],'connectedlinename':_0x3ec2b6[_0x301d('0x30')],'accountcode':_0x3ec2b6['accountcode'],'destaccountcode':_0x3ec2b6['destaccountcode'],'channel':_0x3ec2b6['channel'],'destchannel':_0x3ec2b6[_0x301d('0x31')],'uniqueid':_0x3ec2b6['uniqueid'],'destuniqueid':_0x3ec2b6[_0x301d('0x32')],'destcalleridnum':_0x3ec2b6[_0x301d('0x33')],'destcalleridname':_0x3ec2b6[_0x301d('0x30')],'destexten':_0x3ec2b6[_0x301d('0x34')],'context':_0x3ec2b6[_0x301d('0x35')],'exten':_0x3ec2b6[_0x301d('0x21')],'priority':_0x3ec2b6[_0x301d('0x36')],'queue':_0x3ec2b6[_0x301d('0x2c')],'type':this['voiceQueues'][_0x3ec2b6[_0x301d('0x2c')]]?this['voiceQueues'][_0x3ec2b6[_0x301d('0x2c')]][_0x301d('0x37')]||'inbound':'inbound','interface':_0x3ec2b6[_0x301d('0x2a')],'mandatoryDisposition':this['voiceQueues'][_0x3ec2b6[_0x301d('0x2c')]][_0x301d('0x38')]||0x0,'membername':_0x3ec2b6[_0x301d('0x20')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':_0x301d('0x39'),'transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this[_0x301d('0xa')][_0x3ec2b6[_0x301d('0x2a')]]?this[_0x301d('0xa')][_0x3ec2b6[_0x301d('0x2a')]]['id']:null,'lastevent':_0x301d('0x3a'),'agentacw':![],'acwtime':0x0,'variables':this[_0x301d('0xc')][_0x3ec2b6['channel']]?this['variables'][_0x3ec2b6['channel']]:{}};ami[_0x301d('0x2d')](_0x301d('0x3b'),_0x49f1ac);io['to'](util[_0x301d('0x1e')]('user:%s',_0x49f1ac[_0x301d('0x20')]))[_0x301d('0x2d')](_0x301d('0x3c'),_0x49f1ac);this['log'](_0x301d('0x3d'),this[_0x301d('0xb')][_0x3ec2b6[_0x301d('0x31')]]);}catch(_0x4c2692){logger[_0x301d('0x3e')](_0x4c2692[_0x301d('0x3f')]);}};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x10')]=function(_0x7160b2){try{var _0x16b5dc=this[_0x301d('0xb')][_0x7160b2[_0x301d('0x31')]];if(!_[_0x301d('0x2b')](_0x16b5dc)){_0x16b5dc=_['assign'](_0x16b5dc,{'holdtime':parseInt(_0x7160b2['holdtime'],0xa),'ringtime':parseInt(_0x7160b2[_0x301d('0x40')],0xa),'agentconnect':!![],'lastevent':_0x301d('0x41')});_0x16b5dc[_0x301d('0x42')]=this[_0x301d('0x24')](_0x16b5dc[_0x301d('0x43')],_0x16b5dc[_0x301d('0x40')]);ami[_0x301d('0x2d')]('custom:agentconnect',_0x16b5dc);io['to'](util[_0x301d('0x1e')]('user:%s',_0x16b5dc['membername']))[_0x301d('0x2d')]('user:agentconnect',_0x16b5dc);this[_0x301d('0x44')](_0x301d('0x45'),_0x16b5dc);}}catch(_0x46a968){logger['error'](_0x46a968['stack']);}};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x1a')]=function(_0x5759cb){try{var _0x5f4ce0=_[_0x301d('0x46')](this['channels'],{'channel':_0x5759cb['channel'],'agentconnect':!![]});if(!_[_0x301d('0x2b')](_0x5f4ce0)){if(!_[_0x301d('0x2b')](this[_0x301d('0xa')][_0x5f4ce0[_0x301d('0x2a')]])){this[_0x301d('0xa')][_0x5f4ce0[_0x301d('0x2a')]]['onhold']=!![];this['agents'][_0x5f4ce0['interface']]['updateStatusRealtime']();}}}catch(_0x882108){logger[_0x301d('0x3e')](_0x882108[_0x301d('0x3f')]);}};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x1c')]=function(_0x9549a1){try{var _0x57c90f=_[_0x301d('0x46')](this[_0x301d('0xb')],{'channel':_0x9549a1[_0x301d('0x47')],'agentconnect':!![]});if(!_[_0x301d('0x2b')](_0x57c90f)){if(!_[_0x301d('0x2b')](this[_0x301d('0xa')][_0x57c90f[_0x301d('0x2a')]])){this['agents'][_0x57c90f[_0x301d('0x2a')]][_0x301d('0x48')]=![];this[_0x301d('0xa')][_0x57c90f['interface']][_0x301d('0x49')]();}}}catch(_0x12d390){logger[_0x301d('0x3e')](_0x12d390[_0x301d('0x3f')]);}};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x12')]=function(_0x474650){try{var _0x415d54=this['channels'][_0x474650[_0x301d('0x31')]];if(!_[_0x301d('0x2b')](_0x415d54)){_0x415d54=_[_0x301d('0x4a')](_0x415d54,{'ringtime':parseInt(_0x474650['ringtime'],0xa)/0x3e8,'agentringnoanswer':!![],'reason':_0x301d('0x4b'),'lastevent':'rejected'});_0x415d54[_0x301d('0x4c')]=this[_0x301d('0x24')](_0x415d54['agentcalledAt'],_0x415d54['ringtime']);ami[_0x301d('0x2d')]('custom:agentringnoanswer',_0x415d54);this[_0x301d('0x44')](_0x301d('0x4d'),_0x415d54);}}catch(_0x525118){logger[_0x301d('0x3e')](_0x525118[_0x301d('0x3f')]);}};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x4e')]=function(_0x2bfe3e){try{for(var _0x26abf5 in this[_0x301d('0xb')]){var _0x254aac=this[_0x301d('0xb')][_0x26abf5];if(!_[_0x301d('0x2b')](_0x254aac)&&_0x254aac[_0x301d('0x47')]==_0x2bfe3e[_0x301d('0x47')]){_0x254aac=_['assign'](_0x254aac,{'holdtime':parseInt(_0x2bfe3e[_0x301d('0x4f')],0xa),'position':parseInt(_0x2bfe3e[_0x301d('0x50')],0xa),'originalposition':parseInt(_0x2bfe3e[_0x301d('0x51')],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x301d('0x52'),'lastevent':_0x301d('0x52')});ami[_0x301d('0x2d')](_0x301d('0x53'),_0x254aac);this[_0x301d('0x44')]('CALLERABANDON',_0x254aac);}}}catch(_0x8f0202){logger[_0x301d('0x3e')](_0x8f0202[_0x301d('0x3f')]);}};VoiceAgentReport[_0x301d('0x1d')]['syncAgentComplete']=function(_0x314075){try{var _0x1db4c6=this['channels'][_0x314075[_0x301d('0x31')]];if(!_[_0x301d('0x2b')](_0x1db4c6)){_0x1db4c6=_[_0x301d('0x4a')](_0x1db4c6,{'talktime':parseInt(_0x314075[_0x301d('0x54')],0xa),'reason':_0x314075[_0x301d('0x55')]==_0x301d('0x56')?_0x301d('0x39'):_0x314075['reason'],'agentcomplete':!![],'lastevent':_0x301d('0x57'),'agentacw':this[_0x301d('0x9')][_0x1db4c6[_0x301d('0x2c')]]&&this[_0x301d('0x9')][_0x1db4c6['queue']][_0x301d('0x58')]?!![]:![],'acwtime':this['voiceQueues'][_0x1db4c6['queue']]&&this[_0x301d('0x9')][_0x1db4c6['queue']][_0x301d('0x58')]?this['voiceQueues'][_0x1db4c6[_0x301d('0x2c')]][_0x301d('0x59')]:0x0});_0x1db4c6[_0x301d('0x5a')]=this[_0x301d('0x24')](_0x1db4c6[_0x301d('0x42')],_0x1db4c6[_0x301d('0x54')]);this[_0x301d('0x44')](_0x301d('0x5b'),_0x1db4c6);}}catch(_0x51c347){logger[_0x301d('0x3e')](_0x51c347[_0x301d('0x3f')]);}};VoiceAgentReport['prototype'][_0x301d('0x5c')]=function(_0x5bffb4){try{switch(_0x5bffb4[_0x301d('0x5d')]){case 0x1a:_0x5bffb4=_[_0x301d('0x4a')](_0x5bffb4,{'agentringnoanswer':!![],'reason':'answered_elsewhere','lastevent':_0x301d('0x5e')});var _0x2015ca=_[_0x301d('0x46')](this[_0x301d('0xb')],{'channel':_0x5bffb4['channel'],'agentconnect':!![]});if(!_['isNil'](_0x2015ca)){_0x5bffb4=_['assign'](_0x5bffb4,{'agentringnoanswerAt':_0x2015ca[_0x301d('0x42')],'answeredelsewheremembername':_0x2015ca[_0x301d('0x20')],'answeredelsewheredestinationuniqueid':_0x2015ca[_0x301d('0x32')]});}ami[_0x301d('0x2d')](_0x301d('0x5f'),_0x5bffb4);break;}if(_0x5bffb4[_0x301d('0x13')]){ami[_0x301d('0x2d')](_0x301d('0x60'),_0x5bffb4);io['to'](util[_0x301d('0x1e')](_0x301d('0x61'),_0x5bffb4[_0x301d('0x20')]))['emit'](_0x301d('0x62'),_0x5bffb4);}this[_0x301d('0x44')]('HANGUP',_0x5bffb4);ami[_0x301d('0x2d')](_0x301d('0x63'),_0x5bffb4);if(this[_0x301d('0xb')][_0x5bffb4['destchannel']]){delete this[_0x301d('0xb')][_0x5bffb4[_0x301d('0x31')]];}}catch(_0x1be719){logger[_0x301d('0x3e')](_0x1be719);}};VoiceAgentReport['prototype'][_0x301d('0x64')]=function(_0x3b89bc){try{var _0x27b651=this[_0x301d('0xb')][_0x3b89bc[_0x301d('0x47')]];if(!_[_0x301d('0x2b')](_0x27b651)){_0x27b651=_['assign'](_0x27b651,{'cause':parseInt(_0x3b89bc[_0x301d('0x5d')],0xa),'cause-txt':_0x3b89bc[_0x301d('0x65')]});if(_0x27b651[_0x301d('0x66')]){_0x27b651=_['assign'](_0x27b651,{'agentcomplete':!![],'agentcompleteAt':moment()[_0x301d('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'complete','agentacw':this[_0x301d('0x9')][_0x27b651[_0x301d('0x2c')]]&&this[_0x301d('0x9')][_0x27b651['queue']][_0x301d('0x58')]?!![]:![],'acwtime':this[_0x301d('0x9')][_0x27b651[_0x301d('0x2c')]]&&this[_0x301d('0x9')][_0x27b651[_0x301d('0x2c')]][_0x301d('0x58')]?this[_0x301d('0x9')][_0x27b651[_0x301d('0x2c')]]['acwTimeout']:0x0});_0x27b651[_0x301d('0x54')]=this['diffTime'](_0x27b651[_0x301d('0x5a')],_0x27b651[_0x301d('0x42')]);}var _0x4e51f6=this[_0x301d('0xa')][_0x27b651[_0x301d('0x2a')]];if(!_[_0x301d('0x2b')](_0x4e51f6)){_0x4e51f6=_[_0x301d('0x4a')](_0x4e51f6,{'queue':null,'destconnectedlinenum':null});io['emit']('user:save',_0x4e51f6);}setTimeout(this[_0x301d('0x5c')][_0x301d('0x11')](this,_0x27b651),0x3e8);}if(this[_0x301d('0xc')][_0x3b89bc[_0x301d('0x47')]]){delete this[_0x301d('0xc')][_0x3b89bc[_0x301d('0x47')]];}}catch(_0x1a50ef){logger['error'](_0x1a50ef[_0x301d('0x3f')]);}};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x19')]=function(_0x5ca281){try{var _0x3d69ee=this['channels'][_0x5ca281['origtransfererchannel']];if(!_['isNil'](_0x3d69ee)){_0x3d69ee=_[_0x301d('0x4a')](_0x3d69ee,{'transfer':!![],'transferAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'transfertype':_0x301d('0x67'),'agentcomplete':!![],'agentcompleteAt':moment()[_0x301d('0x1e')](_0x301d('0x27')),'transferuniqueid':_0x5ca281[_0x301d('0x68')],'transfercontext':_0x5ca281[_0x301d('0x69')],'transferextension':_0x5ca281[_0x301d('0x6a')],'reason':_0x301d('0x56'),'lastevent':_0x301d('0x57'),'agentacw':this[_0x301d('0x9')][_0x3d69ee[_0x301d('0x2c')]]&&this[_0x301d('0x9')][_0x3d69ee['queue']][_0x301d('0x58')]?!![]:![],'acwtime':this[_0x301d('0x9')][_0x3d69ee[_0x301d('0x2c')]]&&this[_0x301d('0x9')][_0x3d69ee[_0x301d('0x2c')]]['acw']?this['voiceQueues'][_0x3d69ee[_0x301d('0x2c')]][_0x301d('0x59')]:0x0});_0x3d69ee[_0x301d('0x54')]=this[_0x301d('0x28')](_0x3d69ee[_0x301d('0x5a')],_0x3d69ee[_0x301d('0x42')]);this[_0x301d('0x44')](_0x301d('0x67'),_0x3d69ee);}if(!_[_0x301d('0x2b')](this[_0x301d('0xb')][_0x5ca281['transfertargetchannel']])){this[_0x301d('0xb')][_0x5ca281[_0x301d('0x6b')]]['recalculate']=!![];}}catch(_0xaf8c31){logger[_0x301d('0x3e')](_0xaf8c31[_0x301d('0x3f')]);}};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x6c')]=function(_0x29f286){try{var _0x37a32c=this[_0x301d('0xb')][_0x29f286[_0x301d('0x6d')]];if(!_[_0x301d('0x2b')](_0x37a32c)){_0x37a32c=_['assign'](_0x37a32c,{'transfer':!![],'transferAt':moment()[_0x301d('0x1e')](_0x301d('0x27')),'transfertype':_0x301d('0x6e'),'transferuniqueid':_0x29f286[_0x301d('0x6f')],'transfercontext':_0x29f286[_0x301d('0x35')],'transferextension':_0x29f286['extension'],'agentcomplete':!![],'agentcompleteAt':moment()[_0x301d('0x1e')](_0x301d('0x27')),'reason':'transfer','lastevent':'complete','agentacw':this[_0x301d('0x9')][_0x37a32c[_0x301d('0x2c')]]&&this[_0x301d('0x9')][_0x37a32c[_0x301d('0x2c')]]['acw']?!![]:![],'acwtime':this[_0x301d('0x9')][_0x37a32c['queue']]&&this['voiceQueues'][_0x37a32c[_0x301d('0x2c')]][_0x301d('0x58')]?this[_0x301d('0x9')][_0x37a32c[_0x301d('0x2c')]][_0x301d('0x59')]:0x0});_0x37a32c[_0x301d('0x66')]=!![];this[_0x301d('0x44')](_0x301d('0x6e'),_0x37a32c);}}catch(_0x5c07d6){logger[_0x301d('0x3e')](_0x5c07d6[_0x301d('0x3f')]);}};VoiceAgentReport[_0x301d('0x1d')][_0x301d('0x16')]=function(_0x4d6d97){var _0x113b20=['rtpaudioqos',_0x301d('0x70'),_0x301d('0x71'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x301d('0x72'),'rtpaudioqosrtt',_0x301d('0x73'),_0x301d('0x74'),_0x301d('0x75'),_0x301d('0x76'),_0x301d('0x77'),_0x301d('0x78'),_0x301d('0x79'),_0x301d('0x7a'),'memberlastcall',_0x301d('0x20'),'memberpenalty',_0x301d('0x7b')];try{var _0x53f759=_[_0x301d('0x7c')](_0x4d6d97['variable'])[0x0];if(!_[_0x301d('0x2b')](_0x53f759)&&!_['includes'](_0x113b20,_0x53f759)){if(!this[_0x301d('0xc')][_0x4d6d97[_0x301d('0x47')]]){this[_0x301d('0xc')][_0x4d6d97[_0x301d('0x47')]]={};}this[_0x301d('0xc')][_0x4d6d97[_0x301d('0x47')]][_0x53f759]=_0x4d6d97[_0x301d('0x7d')];}}catch(_0x4b1e72){logger[_0x301d('0x3e')](_0x4b1e72[_0x301d('0x3f')]);}};module[_0x301d('0x7e')]=VoiceAgentReport; \ No newline at end of file +var _0x4b17=['secondtransferercontext','transfer','transfertargetchannel','transfererchannel','extension','BLIND','syncVarSet','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','keys','variable','includes','exports','lodash','util','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','voiceQueues','agents','channels','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','bind','queuecallerabandon','varset','syncHangup','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','prototype','log','info','format','uniqueid','membername','queue','exten','calleridnum','join','addTime','YYYY-MM-DD\x20HH:mm:ss','diffTime','seconds','interface','isNil','assign','emit','user:save','destchannel','calleridname','destcalleridnum','destcalleridname','accountcode','channel','destuniqueid','context','type','inbound','called','user:%s','user:called','CALLED','error','stack','holdtime','ringtime','connect','agentconnectAt','custom:agentconnect','user:agentconnect','CONNECT','updateStatusRealtime','find','onhold','rejected','agentringnoanswerAt','agentcalledAt','custom:agentringnoanswer','position','abandoned','custom:agentqueuecallerabandon','CALLERABANDON','talktime','reason','agent','complete','acw','acwTimeout','COMPLETE','clear','cause','answered_elsewhere','custom:agentansweredelsewhere','custom:agentcomplete','user:agentcomplete','HANGUP','custom:voiceAgentReport','recalculate','agentcompleteAt','origtransfererchannel','ATTENDED','secondtransfereruniqueid'];(function(_0x5add68,_0x42e766){var _0xc93b43=function(_0x373c98){while(--_0x373c98){_0x5add68['push'](_0x5add68['shift']());}};_0xc93b43(++_0x42e766);}(_0x4b17,0x10f));var _0x74b1=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x4b17[_0xc14df7];return _0x34a445;};'use strict';var _=require(_0x74b1('0x0'));var moment=require('moment');var util=require(_0x74b1('0x1'));var Redis=require('ioredis');var config=require(_0x74b1('0x2'));var logger=require(_0x74b1('0x3'))('ami');var ami=require(_0x74b1('0x4'));config['redis']=_['defaults'](config[_0x74b1('0x5')],{'host':_0x74b1('0x6'),'port':0x18eb});var io=require(_0x74b1('0x7'))(new Redis(config[_0x74b1('0x5')]));function VoiceAgentReport(_0x371c3b){this[_0x74b1('0x8')]=_0x371c3b[_0x74b1('0x8')];this['agents']=_0x371c3b[_0x74b1('0x9')];this[_0x74b1('0xa')]={};this[_0x74b1('0xb')]={};ami['on'](_0x74b1('0xc'),this[_0x74b1('0xd')]['bind'](this));ami['on'](_0x74b1('0xe'),this[_0x74b1('0xf')]['bind'](this));ami['on'](_0x74b1('0x10'),this[_0x74b1('0x11')][_0x74b1('0x12')](this));ami['on'](_0x74b1('0x13'),this['syncQueueCallerAbandon'][_0x74b1('0x12')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x74b1('0x12')](this));ami['on'](_0x74b1('0x14'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0x74b1('0x15')]['bind'](this));ami['on']('attendedtransfer',this[_0x74b1('0x16')][_0x74b1('0x12')](this));ami['on'](_0x74b1('0x17'),this[_0x74b1('0x18')][_0x74b1('0x12')](this));ami['on'](_0x74b1('0x19'),this['syncMusicOnHoldStart'][_0x74b1('0x12')](this));ami['on'](_0x74b1('0x1a'),this[_0x74b1('0x1b')][_0x74b1('0x12')](this));}VoiceAgentReport[_0x74b1('0x1c')][_0x74b1('0x1d')]=function(_0x1ab838,_0x4bb3d2){logger[_0x74b1('0x1e')](util[_0x74b1('0x1f')]('%s|%s',_0x1ab838,[_0x4bb3d2[_0x74b1('0x20')],_0x4bb3d2[_0x74b1('0x21')],_0x4bb3d2[_0x74b1('0x22')],_0x4bb3d2[_0x74b1('0x23')],_0x4bb3d2[_0x74b1('0x24')]][_0x74b1('0x25')]('|')));};VoiceAgentReport[_0x74b1('0x1c')][_0x74b1('0x26')]=function(_0x5a106e,_0x2cd024){return moment(_0x5a106e)['add'](_0x2cd024,'seconds')['format'](_0x74b1('0x27'));};VoiceAgentReport[_0x74b1('0x1c')][_0x74b1('0x28')]=function(_0x44bf7e,_0x563781){return moment(_0x44bf7e)['diff'](moment(_0x563781),_0x74b1('0x29'));};VoiceAgentReport['prototype'][_0x74b1('0xd')]=function(_0x4376c7){try{var _0xb5af0=this[_0x74b1('0x9')][_0x4376c7[_0x74b1('0x2a')]];if(!_[_0x74b1('0x2b')](_0xb5af0)){_0xb5af0=_[_0x74b1('0x2c')](_0xb5af0,{'queue':_0x4376c7[_0x74b1('0x22')],'destconnectedlinenum':_0x4376c7['calleridnum']});io[_0x74b1('0x2d')](_0x74b1('0x2e'),_0xb5af0);}var _0x4099af=this['channels'][_0x4376c7[_0x74b1('0x2f')]]={'agentcalledAt':moment()[_0x74b1('0x1f')](_0x74b1('0x27')),'calleridnum':_0x4376c7[_0x74b1('0x24')],'calleridname':_0x4376c7[_0x74b1('0x30')],'connectedlinenum':_0x4376c7[_0x74b1('0x31')],'connectedlinename':_0x4376c7[_0x74b1('0x32')],'accountcode':_0x4376c7[_0x74b1('0x33')],'destaccountcode':_0x4376c7['destaccountcode'],'channel':_0x4376c7[_0x74b1('0x34')],'destchannel':_0x4376c7[_0x74b1('0x2f')],'uniqueid':_0x4376c7['uniqueid'],'destuniqueid':_0x4376c7[_0x74b1('0x35')],'destcalleridnum':_0x4376c7[_0x74b1('0x31')],'destcalleridname':_0x4376c7[_0x74b1('0x32')],'destexten':_0x4376c7['destexten'],'context':_0x4376c7[_0x74b1('0x36')],'exten':_0x4376c7[_0x74b1('0x23')],'priority':_0x4376c7['priority'],'queue':_0x4376c7[_0x74b1('0x22')],'type':this[_0x74b1('0x8')][_0x4376c7[_0x74b1('0x22')]]?this[_0x74b1('0x8')][_0x4376c7[_0x74b1('0x22')]][_0x74b1('0x37')]||_0x74b1('0x38'):_0x74b1('0x38'),'interface':_0x4376c7['interface'],'mandatoryDisposition':this[_0x74b1('0x8')][_0x4376c7['queue']]['mandatoryDisposition']||0x0,'membername':_0x4376c7[_0x74b1('0x21')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':'agent','transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this['agents'][_0x4376c7[_0x74b1('0x2a')]]?this[_0x74b1('0x9')][_0x4376c7[_0x74b1('0x2a')]]['id']:null,'lastevent':_0x74b1('0x39'),'agentacw':![],'acwtime':0x0,'variables':this[_0x74b1('0xb')][_0x4376c7[_0x74b1('0x34')]]?this[_0x74b1('0xb')][_0x4376c7[_0x74b1('0x34')]]:{}};ami['emit']('custom:agentcalled',_0x4099af);io['to'](util['format'](_0x74b1('0x3a'),_0x4099af['membername']))['emit'](_0x74b1('0x3b'),_0x4099af);this[_0x74b1('0x1d')](_0x74b1('0x3c'),this['channels'][_0x4376c7[_0x74b1('0x2f')]]);}catch(_0x5a4c2e){logger[_0x74b1('0x3d')](_0x5a4c2e[_0x74b1('0x3e')]);}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x1be766){try{var _0x1f2790=this['channels'][_0x1be766['destchannel']];if(!_[_0x74b1('0x2b')](_0x1f2790)){_0x1f2790=_['assign'](_0x1f2790,{'holdtime':parseInt(_0x1be766[_0x74b1('0x3f')],0xa),'ringtime':parseInt(_0x1be766[_0x74b1('0x40')],0xa),'agentconnect':!![],'lastevent':_0x74b1('0x41')});_0x1f2790[_0x74b1('0x42')]=this[_0x74b1('0x26')](_0x1f2790['agentcalledAt'],_0x1f2790[_0x74b1('0x40')]);ami['emit'](_0x74b1('0x43'),_0x1f2790);io['to'](util['format'](_0x74b1('0x3a'),_0x1f2790['membername']))['emit'](_0x74b1('0x44'),_0x1f2790);this[_0x74b1('0x1d')](_0x74b1('0x45'),_0x1f2790);}}catch(_0x49f7da){logger[_0x74b1('0x3d')](_0x49f7da[_0x74b1('0x3e')]);}};VoiceAgentReport[_0x74b1('0x1c')]['syncMusicOnHoldStart']=function(_0xfecdc){try{var _0x2298b9=_['find'](this['channels'],{'channel':_0xfecdc[_0x74b1('0x34')],'agentconnect':!![]});if(!_[_0x74b1('0x2b')](_0x2298b9)){if(!_[_0x74b1('0x2b')](this[_0x74b1('0x9')][_0x2298b9[_0x74b1('0x2a')]])){this[_0x74b1('0x9')][_0x2298b9[_0x74b1('0x2a')]]['onhold']=!![];this[_0x74b1('0x9')][_0x2298b9[_0x74b1('0x2a')]][_0x74b1('0x46')]();}}}catch(_0x452fa0){logger[_0x74b1('0x3d')](_0x452fa0['stack']);}};VoiceAgentReport[_0x74b1('0x1c')][_0x74b1('0x1b')]=function(_0x5b06f1){try{var _0x50d9de=_[_0x74b1('0x47')](this[_0x74b1('0xa')],{'channel':_0x5b06f1['channel'],'agentconnect':!![]});if(!_[_0x74b1('0x2b')](_0x50d9de)){if(!_[_0x74b1('0x2b')](this[_0x74b1('0x9')][_0x50d9de[_0x74b1('0x2a')]])){this[_0x74b1('0x9')][_0x50d9de[_0x74b1('0x2a')]][_0x74b1('0x48')]=![];this['agents'][_0x50d9de['interface']]['updateStatusRealtime']();}}}catch(_0x20e1c1){logger[_0x74b1('0x3d')](_0x20e1c1[_0x74b1('0x3e')]);}};VoiceAgentReport[_0x74b1('0x1c')][_0x74b1('0x11')]=function(_0x48b423){try{var _0x45606f=this[_0x74b1('0xa')][_0x48b423[_0x74b1('0x2f')]];if(!_[_0x74b1('0x2b')](_0x45606f)){_0x45606f=_[_0x74b1('0x2c')](_0x45606f,{'ringtime':parseInt(_0x48b423[_0x74b1('0x40')],0xa)/0x3e8,'agentringnoanswer':!![],'reason':_0x74b1('0x49'),'lastevent':_0x74b1('0x49')});_0x45606f[_0x74b1('0x4a')]=this[_0x74b1('0x26')](_0x45606f[_0x74b1('0x4b')],_0x45606f[_0x74b1('0x40')]);ami['emit'](_0x74b1('0x4c'),_0x45606f);this[_0x74b1('0x1d')]('RINGNOANSWER',_0x45606f);}}catch(_0xf3735e){logger['error'](_0xf3735e[_0x74b1('0x3e')]);}};VoiceAgentReport[_0x74b1('0x1c')]['syncQueueCallerAbandon']=function(_0x107014){try{for(var _0x95e8bf in this[_0x74b1('0xa')]){var _0x549f03=this[_0x74b1('0xa')][_0x95e8bf];if(!_[_0x74b1('0x2b')](_0x549f03)&&_0x549f03[_0x74b1('0x34')]==_0x107014[_0x74b1('0x34')]){_0x549f03=_[_0x74b1('0x2c')](_0x549f03,{'holdtime':parseInt(_0x107014['holdtime'],0xa),'position':parseInt(_0x107014[_0x74b1('0x4d')],0xa),'originalposition':parseInt(_0x107014['originalposition'],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()[_0x74b1('0x1f')](_0x74b1('0x27')),'reason':'abandoned','lastevent':_0x74b1('0x4e')});ami[_0x74b1('0x2d')](_0x74b1('0x4f'),_0x549f03);this['log'](_0x74b1('0x50'),_0x549f03);}}}catch(_0x37b907){logger['error'](_0x37b907[_0x74b1('0x3e')]);}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x18cd64){try{var _0xe56ebd=this[_0x74b1('0xa')][_0x18cd64[_0x74b1('0x2f')]];if(!_[_0x74b1('0x2b')](_0xe56ebd)){_0xe56ebd=_['assign'](_0xe56ebd,{'talktime':parseInt(_0x18cd64[_0x74b1('0x51')],0xa),'reason':_0x18cd64[_0x74b1('0x52')]=='transfer'?_0x74b1('0x53'):_0x18cd64[_0x74b1('0x52')],'agentcomplete':!![],'lastevent':_0x74b1('0x54'),'agentacw':this['voiceQueues'][_0xe56ebd[_0x74b1('0x22')]]&&this[_0x74b1('0x8')][_0xe56ebd[_0x74b1('0x22')]]['acw']?!![]:![],'acwtime':this[_0x74b1('0x8')][_0xe56ebd[_0x74b1('0x22')]]&&this[_0x74b1('0x8')][_0xe56ebd[_0x74b1('0x22')]][_0x74b1('0x55')]?this[_0x74b1('0x8')][_0xe56ebd['queue']][_0x74b1('0x56')]:0x0});_0xe56ebd['agentcompleteAt']=this['addTime'](_0xe56ebd[_0x74b1('0x42')],_0xe56ebd['talktime']);this['log'](_0x74b1('0x57'),_0xe56ebd);}}catch(_0x29ab63){logger[_0x74b1('0x3d')](_0x29ab63['stack']);}};VoiceAgentReport[_0x74b1('0x1c')][_0x74b1('0x58')]=function(_0x37637a){try{switch(_0x37637a[_0x74b1('0x59')]){case 0x1a:_0x37637a=_[_0x74b1('0x2c')](_0x37637a,{'agentringnoanswer':!![],'reason':_0x74b1('0x5a'),'lastevent':_0x74b1('0x5a')});var _0x38b985=_[_0x74b1('0x47')](this[_0x74b1('0xa')],{'channel':_0x37637a[_0x74b1('0x34')],'agentconnect':!![]});if(!_[_0x74b1('0x2b')](_0x38b985)){_0x37637a=_['assign'](_0x37637a,{'agentringnoanswerAt':_0x38b985['agentconnectAt'],'answeredelsewheremembername':_0x38b985[_0x74b1('0x21')],'answeredelsewheredestinationuniqueid':_0x38b985['destuniqueid']});}ami[_0x74b1('0x2d')](_0x74b1('0x5b'),_0x37637a);break;}if(_0x37637a['agentcomplete']){ami['emit'](_0x74b1('0x5c'),_0x37637a);io['to'](util[_0x74b1('0x1f')](_0x74b1('0x3a'),_0x37637a[_0x74b1('0x21')]))[_0x74b1('0x2d')](_0x74b1('0x5d'),_0x37637a);}this[_0x74b1('0x1d')](_0x74b1('0x5e'),_0x37637a);ami[_0x74b1('0x2d')](_0x74b1('0x5f'),_0x37637a);if(this[_0x74b1('0xa')][_0x37637a[_0x74b1('0x2f')]]){delete this['channels'][_0x37637a[_0x74b1('0x2f')]];}}catch(_0x1de918){logger[_0x74b1('0x3d')](_0x1de918);}};VoiceAgentReport[_0x74b1('0x1c')]['syncHangup']=function(_0x308b98){try{var _0x1709d9=this['channels'][_0x308b98[_0x74b1('0x34')]];if(!_['isNil'](_0x1709d9)){_0x1709d9=_[_0x74b1('0x2c')](_0x1709d9,{'cause':parseInt(_0x308b98[_0x74b1('0x59')],0xa),'cause-txt':_0x308b98['cause-txt']});if(_0x1709d9[_0x74b1('0x60')]){_0x1709d9=_[_0x74b1('0x2c')](_0x1709d9,{'agentcomplete':!![],'agentcompleteAt':moment()[_0x74b1('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x74b1('0x54'),'agentacw':this['voiceQueues'][_0x1709d9[_0x74b1('0x22')]]&&this[_0x74b1('0x8')][_0x1709d9[_0x74b1('0x22')]][_0x74b1('0x55')]?!![]:![],'acwtime':this[_0x74b1('0x8')][_0x1709d9[_0x74b1('0x22')]]&&this[_0x74b1('0x8')][_0x1709d9[_0x74b1('0x22')]][_0x74b1('0x55')]?this[_0x74b1('0x8')][_0x1709d9[_0x74b1('0x22')]][_0x74b1('0x56')]:0x0});_0x1709d9[_0x74b1('0x51')]=this['diffTime'](_0x1709d9[_0x74b1('0x61')],_0x1709d9[_0x74b1('0x42')]);}var _0x39aabf=this[_0x74b1('0x9')][_0x1709d9[_0x74b1('0x2a')]];if(!_[_0x74b1('0x2b')](_0x39aabf)){_0x39aabf=_[_0x74b1('0x2c')](_0x39aabf,{'queue':null,'destconnectedlinenum':null});io[_0x74b1('0x2d')](_0x74b1('0x2e'),_0x39aabf);}setTimeout(this['clear'][_0x74b1('0x12')](this,_0x1709d9),0x3e8);}if(this['variables'][_0x308b98[_0x74b1('0x34')]]){delete this['variables'][_0x308b98['channel']];}}catch(_0x427385){logger[_0x74b1('0x3d')](_0x427385[_0x74b1('0x3e')]);}};VoiceAgentReport['prototype'][_0x74b1('0x16')]=function(_0x1a3cbe){try{var _0x4943b3=this[_0x74b1('0xa')][_0x1a3cbe[_0x74b1('0x62')]];if(!_[_0x74b1('0x2b')](_0x4943b3)){_0x4943b3=_[_0x74b1('0x2c')](_0x4943b3,{'transfer':!![],'transferAt':moment()[_0x74b1('0x1f')](_0x74b1('0x27')),'transfertype':_0x74b1('0x63'),'agentcomplete':!![],'agentcompleteAt':moment()[_0x74b1('0x1f')](_0x74b1('0x27')),'transferuniqueid':_0x1a3cbe[_0x74b1('0x64')],'transfercontext':_0x1a3cbe['secondtransfererexten'],'transferextension':_0x1a3cbe[_0x74b1('0x65')],'reason':_0x74b1('0x66'),'lastevent':_0x74b1('0x54'),'agentacw':this['voiceQueues'][_0x4943b3[_0x74b1('0x22')]]&&this[_0x74b1('0x8')][_0x4943b3[_0x74b1('0x22')]][_0x74b1('0x55')]?!![]:![],'acwtime':this[_0x74b1('0x8')][_0x4943b3['queue']]&&this[_0x74b1('0x8')][_0x4943b3[_0x74b1('0x22')]][_0x74b1('0x55')]?this[_0x74b1('0x8')][_0x4943b3[_0x74b1('0x22')]][_0x74b1('0x56')]:0x0});_0x4943b3[_0x74b1('0x51')]=this[_0x74b1('0x28')](_0x4943b3['agentcompleteAt'],_0x4943b3[_0x74b1('0x42')]);this[_0x74b1('0x1d')](_0x74b1('0x63'),_0x4943b3);}if(!_['isNil'](this['channels'][_0x1a3cbe[_0x74b1('0x67')]])){this[_0x74b1('0xa')][_0x1a3cbe[_0x74b1('0x67')]][_0x74b1('0x60')]=!![];}}catch(_0x2de935){logger['error'](_0x2de935[_0x74b1('0x3e')]);}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x1a66c6){try{var _0x57e5e0=this[_0x74b1('0xa')][_0x1a66c6[_0x74b1('0x68')]];if(!_[_0x74b1('0x2b')](_0x57e5e0)){_0x57e5e0=_[_0x74b1('0x2c')](_0x57e5e0,{'transfer':!![],'transferAt':moment()[_0x74b1('0x1f')](_0x74b1('0x27')),'transfertype':'BLIND','transferuniqueid':_0x1a66c6['transfereeuniqueid'],'transfercontext':_0x1a66c6['context'],'transferextension':_0x1a66c6[_0x74b1('0x69')],'agentcomplete':!![],'agentcompleteAt':moment()[_0x74b1('0x1f')](_0x74b1('0x27')),'reason':_0x74b1('0x66'),'lastevent':_0x74b1('0x54'),'agentacw':this[_0x74b1('0x8')][_0x57e5e0[_0x74b1('0x22')]]&&this[_0x74b1('0x8')][_0x57e5e0[_0x74b1('0x22')]][_0x74b1('0x55')]?!![]:![],'acwtime':this[_0x74b1('0x8')][_0x57e5e0[_0x74b1('0x22')]]&&this['voiceQueues'][_0x57e5e0[_0x74b1('0x22')]][_0x74b1('0x55')]?this[_0x74b1('0x8')][_0x57e5e0[_0x74b1('0x22')]][_0x74b1('0x56')]:0x0});_0x57e5e0[_0x74b1('0x60')]=!![];this['log'](_0x74b1('0x6a'),_0x57e5e0);}}catch(_0x32eb2d){logger[_0x74b1('0x3d')](_0x32eb2d['stack']);}};VoiceAgentReport[_0x74b1('0x1c')][_0x74b1('0x6b')]=function(_0x316c09){var _0x1136db=['rtpaudioqos',_0x74b1('0x6c'),_0x74b1('0x6d'),_0x74b1('0x6e'),_0x74b1('0x6f'),_0x74b1('0x70'),'rtpaudioqosrtt',_0x74b1('0x71'),_0x74b1('0x72'),'sipuri',_0x74b1('0x73'),_0x74b1('0x74'),'membercalls',_0x74b1('0x75'),_0x74b1('0x76'),_0x74b1('0x77'),_0x74b1('0x21'),'memberpenalty','memberrealtime'];try{var _0x203569=_[_0x74b1('0x78')](_0x316c09[_0x74b1('0x79')])[0x0];if(!_['isNil'](_0x203569)&&!_[_0x74b1('0x7a')](_0x1136db,_0x203569)){if(!this[_0x74b1('0xb')][_0x316c09['channel']]){this['variables'][_0x316c09[_0x74b1('0x34')]]={};}this[_0x74b1('0xb')][_0x316c09[_0x74b1('0x34')]][_0x203569]=_0x316c09['value'];}}catch(_0x43cc78){logger[_0x74b1('0x3d')](_0x43cc78[_0x74b1('0x3e')]);}};module[_0x74b1('0x7b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 9114363..2376001 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 _0xe90f=['xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','sipcalluniqueid','parse','[syncVarSet][VoiceCallReport]','diff','billableseconds','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetuniqueid','transfercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','context','from-sip','split','exten','user:%s','accountcode','[syncNewChannel][VoiceCallReport]','linkedid','application','toLowerCase','applicationdata','appdata','starttime','duration','subtract','seconds','disposition','lastapplication','lastdata','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','channelstate','answered','answertime','holdtime','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','calleridname','destinationchannel','UserId','membername','name','[syncNewState][VoiceCallReport]','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','syncMixMonitorFilename','value','xmd-phone'];(function(_0x20bc93,_0xab41ce){var _0x1f0213=function(_0x40f825){while(--_0x40f825){_0x20bc93['push'](_0x20bc93['shift']());}};_0x1f0213(++_0xab41ce);}(_0xe90f,0xb8));var _0xfe90=function(_0x5b7f48,_0x4d8a1d){_0x5b7f48=_0x5b7f48-0x0;var _0x2424b0=_0xe90f[_0x5b7f48];return _0x2424b0;};'use strict';var BPromise=require(_0xfe90('0x0'));var _=require(_0xfe90('0x1'));var moment=require(_0xfe90('0x2'));var util=require(_0xfe90('0x3'));var path=require('path');var Redis=require('ioredis');var config=require(_0xfe90('0x4'));var logger=require(_0xfe90('0x5'))('ami');var ami=require(_0xfe90('0x6'));var Channel=require(_0xfe90('0x7'));var statusDesc=[_0xfe90('0x8'),_0xfe90('0x9'),_0xfe90('0xa'),_0xfe90('0xb'),_0xfe90('0xc'),_0xfe90('0xd'),_0xfe90('0xe'),_0xfe90('0xf'),_0xfe90('0x10')];var applications=[_0xfe90('0x11'),_0xfe90('0x12'),_0xfe90('0x13'),_0xfe90('0x14'),'playback','voicemail'];var dispositions=[_0xfe90('0x15'),_0xfe90('0x16'),_0xfe90('0x16'),'NO\x20ANSWER','NO\x20ANSWER',_0xfe90('0x15'),_0xfe90('0x17'),'BUSY','FAILED',_0xfe90('0x16'),'FAILED'];var actions={};config[_0xfe90('0x18')]=_[_0xfe90('0x19')](config[_0xfe90('0x18')],{'host':'localhost','port':0x18eb});var io=require(_0xfe90('0x1a'))(new Redis(config[_0xfe90('0x18')]));function VoiceCallReport(_0x2f2915){this[_0xfe90('0x1b')]=_0x2f2915['channels'];this[_0xfe90('0x1c')]=_0x2f2915[_0xfe90('0x1c')];ami['on'](_0xfe90('0x1d'),this[_0xfe90('0x1e')][_0xfe90('0x1f')](this));ami['on']('newexten',this[_0xfe90('0x1e')]['bind'](this));ami['on']('newchannel',this['syncNewChannel'][_0xfe90('0x1f')](this));ami['on'](_0xfe90('0x20'),this[_0xfe90('0x21')][_0xfe90('0x1f')](this));ami['on'](_0xfe90('0x22'),this[_0xfe90('0x23')][_0xfe90('0x1f')](this));ami['on'](_0xfe90('0x24'),this[_0xfe90('0x25')][_0xfe90('0x1f')](this));ami['on'](_0xfe90('0x26'),this[_0xfe90('0x27')][_0xfe90('0x1f')](this));ami['on'](_0xfe90('0x28'),this[_0xfe90('0x29')][_0xfe90('0x1f')](this));ami['on']('blindtransfer',this[_0xfe90('0x2a')][_0xfe90('0x1f')](this));ami['on'](_0xfe90('0x2b'),this[_0xfe90('0x2c')]['bind'](this));ami['on'](_0xfe90('0x2d'),this[_0xfe90('0x2e')][_0xfe90('0x1f')](this));return BPromise['resolve']()[_0xfe90('0x2f')](ami[_0xfe90('0x30')]())[_0xfe90('0x31')](function(_0xd8ffe8){console[_0xfe90('0x32')](_0xd8ffe8);});}VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x34')]=function(_0x2ff0d1){return _0x2ff0d1!==null&&!_[_0xfe90('0x35')](_0x2ff0d1);};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x36')]=function(_0x184f58,_0x29b1cb,_0x590d0a){io['to'](_0x184f58)[_0xfe90('0x36')](_0x29b1cb,_0x590d0a);};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x27')]=function(_0x1392ec){try{if(this['isNotNull'](_0x1392ec)){if(_0x1392ec[_0xfe90('0x37')]===_0x1392ec['linkedid']){if(!_['isUndefined'](this[_0xfe90('0x1b')][_0x1392ec['uniqueid']])){_[_0xfe90('0x38')](this[_0xfe90('0x1b')][_0x1392ec[_0xfe90('0x37')]],_[_0xfe90('0x39')](_0x1392ec,_[_0xfe90('0x3a')](this[_0xfe90('0x1b')][_0x1392ec[_0xfe90('0x37')]])));}}}}catch(_0x2d9bf9){logger[_0xfe90('0x3b')](_0xfe90('0x3c'),util[_0xfe90('0x3d')](_0x2d9bf9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x3e')]=function(_0x23dd59){try{if(this['isNotNull'](_0x23dd59)){if(_0x23dd59[_0xfe90('0x37')]===_0x23dd59['linkedid']&&_0x23dd59[_0xfe90('0x3f')]!=_0xfe90('0x40')){if(_['isUndefined'](this['channels'][_0x23dd59[_0xfe90('0x37')]])){this[_0xfe90('0x1b')][_0x23dd59['uniqueid']]=new Channel();this[_0xfe90('0x1b')][_0x23dd59[_0xfe90('0x37')]]['starttime']=moment()[_0xfe90('0x41')](_0xfe90('0x42'));this[_0xfe90('0x1b')][_0x23dd59[_0xfe90('0x37')]]['disposition']=dispositions[_[_0xfe90('0x43')](_0x23dd59['channelstate'])];_[_0xfe90('0x38')](this[_0xfe90('0x1b')][_0x23dd59[_0xfe90('0x37')]],_[_0xfe90('0x39')](_0x23dd59,_[_0xfe90('0x3a')](this[_0xfe90('0x1b')][_0x23dd59[_0xfe90('0x37')]])));if(_0x23dd59[_0xfe90('0x44')]===_0xfe90('0x45')){if(this[_0xfe90('0x1c')][_0x23dd59[_0xfe90('0x3f')][_0xfe90('0x46')]('-')[0x0]]){this[_0xfe90('0x1c')][_0x23dd59[_0xfe90('0x3f')][_0xfe90('0x46')]('-')[0x0]]['destconnectedlinenum']=_0x23dd59[_0xfe90('0x47')];this['emit'](util[_0xfe90('0x41')](_0xfe90('0x48'),this[_0xfe90('0x1c')][_0x23dd59[_0xfe90('0x3f')][_0xfe90('0x46')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0xfe90('0x1c')][_0x23dd59[_0xfe90('0x3f')][_0xfe90('0x46')]('-')[0x0]][_0xfe90('0x49')],'destconnectedlinenum':_0x23dd59[_0xfe90('0x47')]});}}}}}}catch(_0x36f49f){logger[_0xfe90('0x3b')](_0xfe90('0x4a'),util[_0xfe90('0x3d')](_0x36f49f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x1e')]=function(_0x46cdf1){try{if(this[_0xfe90('0x34')](_0x46cdf1)){if(_0x46cdf1[_0xfe90('0x37')]===_0x46cdf1[_0xfe90('0x4b')]&&_0x46cdf1[_0xfe90('0x47')]!='h'&&_0x46cdf1[_0xfe90('0x3f')]!='OutgoingSpoolFailed'){_0x46cdf1[_0xfe90('0x4c')]=_0x46cdf1[_0xfe90('0x4c')][_0xfe90('0x4d')]();_0x46cdf1[_0xfe90('0x4e')]=(_0x46cdf1[_0xfe90('0x4f')]||_0x46cdf1['applicationdata'])[_0xfe90('0x4d')]();if(_[_0xfe90('0x35')](this[_0xfe90('0x1b')][_0x46cdf1[_0xfe90('0x37')]])){this[_0xfe90('0x1b')][_0x46cdf1['uniqueid']]=new Channel();this[_0xfe90('0x1b')][_0x46cdf1[_0xfe90('0x37')]][_0xfe90('0x50')]=_0x46cdf1[_0xfe90('0x51')]?moment()[_0xfe90('0x52')](moment['duration'](_0x46cdf1[_0xfe90('0x51')])['seconds'](),_0xfe90('0x53'))[_0xfe90('0x41')](_0xfe90('0x42')):moment()[_0xfe90('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfe90('0x1b')][_0x46cdf1[_0xfe90('0x37')]][_0xfe90('0x54')]=_0xfe90('0x15');}_[_0xfe90('0x38')](this[_0xfe90('0x1b')][_0x46cdf1[_0xfe90('0x37')]],_[_0xfe90('0x39')](_0x46cdf1,_['keys'](this['channels'][_0x46cdf1[_0xfe90('0x37')]])));if(_['includes'](applications,_0x46cdf1['application'])){this[_0xfe90('0x1b')][_0x46cdf1[_0xfe90('0x37')]][_0xfe90('0x55')]=_0x46cdf1['application'];this[_0xfe90('0x1b')][_0x46cdf1[_0xfe90('0x37')]][_0xfe90('0x56')]=_0x46cdf1['applicationdata'];if(_0x46cdf1[_0xfe90('0x4c')]==='set'&&_[_0xfe90('0x57')](_0x46cdf1[_0xfe90('0x4e')],_0xfe90('0x58'))){var _0x149cfa=_0x46cdf1[_0xfe90('0x4e')]['split']('=');var _0x51e0b0=_0x149cfa[0x0][_0xfe90('0x59')](/cdr\((.*)\)/);if(_0x51e0b0){this[_0xfe90('0x1b')][_0x46cdf1[_0xfe90('0x37')]][_0x51e0b0[0x1]]=_0x149cfa[0x1];}}else if(_0x46cdf1['application']===_0xfe90('0x12')){this[_0xfe90('0x1b')][_0x46cdf1[_0xfe90('0x37')]][_0xfe90('0x12')]=_0x46cdf1[_0xfe90('0x4e')]['split'](',')[0x0];}}}}}catch(_0x55a7ab){logger['error'](_0xfe90('0x5a'),util[_0xfe90('0x3d')](_0x55a7ab,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x21')]=function(_0x170457){try{if(this['isNotNull'](_0x170457)){if(_0x170457[_0xfe90('0x37')]!==_0x170457['linkedid']){if(this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x4b')]]){if(_0x170457[_0xfe90('0x5b')]==='6'){if(!this['channels'][_0x170457[_0xfe90('0x4b')]][_0xfe90('0x5c')]){var _0x277387=moment();this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x4b')]]['answered']=!![];this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x4b')]][_0xfe90('0x5d')]=_0x277387[_0xfe90('0x41')](_0xfe90('0x42'));if(this['channels'][_0x170457[_0xfe90('0x4b')]][_0xfe90('0x50')]){this[_0xfe90('0x1b')][_0x170457['linkedid']][_0xfe90('0x5e')]=_0x277387['diff'](this[_0xfe90('0x1b')][_0x170457['linkedid']][_0xfe90('0x50')],_0xfe90('0x53'));}}this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x4b')]][_0xfe90('0x4b')]=_0x170457[_0xfe90('0x37')];if(_0x170457['calleridnum']!==_0xfe90('0x5f')){this['channels'][_0x170457[_0xfe90('0x4b')]][_0xfe90('0x60')]=_0x170457[_0xfe90('0x61')];}this[_0xfe90('0x1b')][_0x170457['linkedid']][_0xfe90('0x62')]=_0x170457[_0xfe90('0x63')];this['channels'][_0x170457['linkedid']][_0xfe90('0x64')]=_0x170457[_0xfe90('0x3f')];this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x4b')]]['disposition']=dispositions[_[_0xfe90('0x43')](_0x170457['channelstate'])];if(this[_0xfe90('0x1c')][_0x170457['channel'][_0xfe90('0x46')]('-')[0x0]]){this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x4b')]][_0xfe90('0x65')]=this[_0xfe90('0x1c')][_0x170457[_0xfe90('0x3f')]['split']('-')[0x0]]['id'];this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x4b')]][_0xfe90('0x66')]=this['agents'][_0x170457[_0xfe90('0x3f')][_0xfe90('0x46')]('-')[0x0]][_0xfe90('0x67')];}}}}else{if(this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x37')]]){if(_0x170457['channelstate']==='6'){if(this[_0xfe90('0x1c')][_0x170457[_0xfe90('0x3f')][_0xfe90('0x46')]('-')[0x0]]){this[_0xfe90('0x1b')][_0x170457[_0xfe90('0x37')]][_0xfe90('0x65')]=this[_0xfe90('0x1c')][_0x170457[_0xfe90('0x3f')][_0xfe90('0x46')]('-')[0x0]]['id'];this[_0xfe90('0x1b')][_0x170457['uniqueid']]['membername']=this[_0xfe90('0x1c')][_0x170457['channel']['split']('-')[0x0]][_0xfe90('0x67')];}}}}}}catch(_0xfc6ae8){logger['error'](_0xfe90('0x68'),util[_0xfe90('0x3d')](_0xfc6ae8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')]['syncMixMonitorFilename']=function(_0x3186f5,_0x5dc424){if(this[_0xfe90('0x1b')][_0x3186f5]){this[_0xfe90('0x1b')][_0x3186f5][_0xfe90('0x69')]=!![];if(_['endsWith'](_0x5dc424,_0xfe90('0x6a'))){_0x5dc424=_0x5dc424[_0xfe90('0x6b')]('.wav49',_0xfe90('0x6c'));}this[_0xfe90('0x1b')][_0x3186f5][_0xfe90('0x6d')]=_0x5dc424;var _0x464bde=_[_0xfe90('0x6e')](this[_0xfe90('0x1b')][_0x3186f5][_0xfe90('0x6f')],{'filename':_0x5dc424});if(_[_0xfe90('0x70')](_0x464bde)){this['channels'][_0x3186f5][_0xfe90('0x6f')][_0xfe90('0x71')]({'filename':_0x5dc424,'createdAt':moment()['format'](_0xfe90('0x42')),'mixmonitorid':'','status':_0xfe90('0x72')});}}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x23')]=function(_0x338535){try{if(this[_0xfe90('0x34')](_0x338535)){if(this['channels'][_0x338535[_0xfe90('0x37')]]&&_0x338535[_0xfe90('0x3f')]!=_0xfe90('0x40')){if(this['isNotNull'](_0x338535[_0xfe90('0x73')])){if(this[_0xfe90('0x34')](_0x338535[_0xfe90('0x73')][_0xfe90('0x74')])){this[_0xfe90('0x75')](_0x338535[_0xfe90('0x37')],_0x338535[_0xfe90('0x76')]);}else if(this[_0xfe90('0x34')](_0x338535['variable'][_0xfe90('0x77')])){this[_0xfe90('0x1b')][_0x338535[_0xfe90('0x37')]][_0xfe90('0x61')]=_0x338535[_0xfe90('0x76')];}else if(this['isNotNull'](_0x338535['variable'][_0xfe90('0x78')])){this[_0xfe90('0x1b')][_0x338535[_0xfe90('0x37')]][_0xfe90('0x79')]=_0x338535[_0xfe90('0x76')];}else if(this['isNotNull'](_0x338535[_0xfe90('0x73')][_0xfe90('0x7a')])){this['channels'][_0x338535[_0xfe90('0x37')]][_0xfe90('0x7b')]=_0x338535[_0xfe90('0x76')];}else if(this[_0xfe90('0x34')](_0x338535[_0xfe90('0x73')][_0xfe90('0x7c')])){this[_0xfe90('0x1b')][_0x338535[_0xfe90('0x37')]]['queue']=_0x338535[_0xfe90('0x76')][_0xfe90('0x46')](',')[0x0];}else if(this['isNotNull'](_0x338535[_0xfe90('0x73')][_0xfe90('0x7d')])){this[_0xfe90('0x1b')][_0x338535['uniqueid']][_0xfe90('0x7e')]=_0x338535[_0xfe90('0x76')];}else if(this['isNotNull'](_0x338535[_0xfe90('0x73')][_0xfe90('0x7f')])){this['channels'][_0x338535['uniqueid']]['destination']=_0x338535['value'];}else if(this[_0xfe90('0x34')](_0x338535[_0xfe90('0x73')][_0xfe90('0x80')])){this[_0xfe90('0x1b')][_0x338535[_0xfe90('0x37')]][_0xfe90('0x81')]=_0x338535[_0xfe90('0x76')];}else if(this[_0xfe90('0x34')](_0x338535['variable']['xmcs-queue'])){this[_0xfe90('0x1b')][_0x338535['uniqueid']][_0xfe90('0x12')]=_0x338535[_0xfe90('0x76')];}else if(this[_0xfe90('0x34')](_0x338535[_0xfe90('0x73')]['sipcallid'])){this[_0xfe90('0x1b')][_0x338535[_0xfe90('0x37')]][_0xfe90('0x82')]=_0x338535[_0xfe90('0x76')];}}}else if(this['isNotNull'](_0x338535[_0xfe90('0x73')][_0xfe90('0x74')])){if(_0x338535[_0xfe90('0x76')]){var _0x5ad13b=path[_0xfe90('0x83')](_0x338535[_0xfe90('0x76')])['name'];this['syncMixMonitorFilename'](_0x5ad13b,_0x338535['value']);}}else if(this[_0xfe90('0x1b')][_0x338535[_0xfe90('0x4b')]]){if(this[_0xfe90('0x34')](_0x338535[_0xfe90('0x73')])){if(this[_0xfe90('0x34')](_0x338535[_0xfe90('0x73')]['sipcallid'])){this[_0xfe90('0x1b')][_0x338535[_0xfe90('0x4b')]]['sipcalllinkedid']=_0x338535['value'];}}}}}catch(_0x54718b){logger['error'](_0xfe90('0x84'),util[_0xfe90('0x3d')](_0x54718b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x25')]=function(_0x416d45){try{if(this[_0xfe90('0x34')](_0x416d45)){if(this[_0xfe90('0x1b')][_0x416d45[_0xfe90('0x37')]]){var _0x3130dc=moment();this['channels'][_0x416d45['uniqueid']]['endtime']=_0x3130dc[_0xfe90('0x41')](_0xfe90('0x42'));this['channels'][_0x416d45[_0xfe90('0x37')]][_0xfe90('0x51')]=_0x3130dc[_0xfe90('0x85')](this['channels'][_0x416d45[_0xfe90('0x37')]][_0xfe90('0x50')],'seconds');if(this[_0xfe90('0x1b')][_0x416d45['uniqueid']][_0xfe90('0x5c')]){this['channels'][_0x416d45[_0xfe90('0x37')]][_0xfe90('0x86')]=_0x3130dc[_0xfe90('0x85')](this[_0xfe90('0x1b')][_0x416d45['uniqueid']][_0xfe90('0x5d')],_0xfe90('0x53'));this['channels'][_0x416d45[_0xfe90('0x37')]][_0xfe90('0x5e')]=this[_0xfe90('0x1b')][_0x416d45[_0xfe90('0x37')]][_0xfe90('0x51')]-this[_0xfe90('0x1b')][_0x416d45[_0xfe90('0x37')]][_0xfe90('0x86')];}if(_0x416d45[_0xfe90('0x44')]===_0xfe90('0x45')){if(this[_0xfe90('0x1c')][_0x416d45[_0xfe90('0x3f')]['split']('-')[0x0]]){this[_0xfe90('0x1c')][_0x416d45['channel'][_0xfe90('0x46')]('-')[0x0]]=_['omit'](this['agents'][_0x416d45['channel'][_0xfe90('0x46')]('-')[0x0]],['destconnectedlinenum']);this['emit'](util[_0xfe90('0x41')](_0xfe90('0x48'),this['agents'][_0x416d45[_0xfe90('0x3f')]['split']('-')[0x0]][_0xfe90('0x67')]),_0xfe90('0x87'),{'destaccountcode':this[_0xfe90('0x1c')][_0x416d45[_0xfe90('0x3f')][_0xfe90('0x46')]('-')[0x0]][_0xfe90('0x49')]});}}ami[_0xfe90('0x36')](_0xfe90('0x88'),this[_0xfe90('0x1b')][_0x416d45['uniqueid']]);delete this[_0xfe90('0x1b')][_0x416d45['uniqueid']];}}}catch(_0x3a63b7){logger['error'](_0xfe90('0x89'),util[_0xfe90('0x3d')](_0x3a63b7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x29')]=function(_0xc9189c){try{if(this[_0xfe90('0x34')](_0xc9189c)){if(this[_0xfe90('0x1b')][_0xc9189c[_0xfe90('0x8a')]]){this[_0xfe90('0x1b')][_0xc9189c[_0xfe90('0x8a')]]['transfercalleridnum']=_0xc9189c[_0xfe90('0x8b')];this[_0xfe90('0x1b')][_0xc9189c['transfereeuniqueid']][_0xfe90('0x8c')]=_0xc9189c['transfertargetcalleridnum'];if(this[_0xfe90('0x1b')][_0xc9189c['secondtransfereruniqueid']]){var _0x1e6211=this[_0xfe90('0x1b')][_0xc9189c['secondtransfereruniqueid']];this[_0xfe90('0x1b')][_0xc9189c['secondtransfereruniqueid']]=this['channels'][_0xc9189c['transfereeuniqueid']];this[_0xfe90('0x1b')][_0xc9189c['transfereeuniqueid']]=_0x1e6211;}}else if(this['channels'][_0xc9189c['transfertargetuniqueid']]){this[_0xfe90('0x1b')][_0xc9189c[_0xfe90('0x8d')]][_0xfe90('0x8e')]=_0xc9189c['origtransferercalleridnum'];this['channels'][_0xc9189c[_0xfe90('0x8d')]][_0xfe90('0x8c')]=_0xc9189c[_0xfe90('0x8f')];if(this[_0xfe90('0x1b')][_0xc9189c[_0xfe90('0x90')]]){var _0x1e6211=this[_0xfe90('0x1b')][_0xc9189c[_0xfe90('0x90')]];this[_0xfe90('0x1b')][_0xc9189c[_0xfe90('0x90')]]=this['channels'][_0xc9189c[_0xfe90('0x8d')]];this['channels'][_0xc9189c[_0xfe90('0x8d')]]=_0x1e6211;}}}}catch(_0x3221ed){logger[_0xfe90('0x3b')](_0xfe90('0x91'),util['inspect'](_0x3221ed,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x2a')]=function(_0x2812d0){try{if(this['isNotNull'](_0x2812d0)){if(this[_0xfe90('0x1b')][_0x2812d0[_0xfe90('0x8a')]]){this[_0xfe90('0x1b')][_0x2812d0[_0xfe90('0x8a')]]['transfercalleridnum']=_0x2812d0[_0xfe90('0x92')];this['channels'][_0x2812d0[_0xfe90('0x8a')]][_0xfe90('0x8c')]=_0x2812d0['extension'];this[_0xfe90('0x25')]({'event':'BlindTransfer','uniqueid':_0x2812d0[_0xfe90('0x8a')],'context':_0x2812d0[_0xfe90('0x44')],'channel':_0x2812d0[_0xfe90('0x93')]});}}}catch(_0x3a8a8e){logger['error'](_0xfe90('0x94'),util[_0xfe90('0x3d')](_0x3a8a8e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x2c')]=function(_0x37135c){try{if(this[_0xfe90('0x34')](_0x37135c)){if(this['channels'][_0x37135c[_0xfe90('0x37')]]){if(!_[_0xfe90('0x70')](this[_0xfe90('0x1b')][_0x37135c[_0xfe90('0x37')]]['answertime'])){this[_0xfe90('0x1b')][_0x37135c[_0xfe90('0x37')]][_0xfe90('0x95')]=moment()[_0xfe90('0x41')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x14caf7){logger[_0xfe90('0x3b')]('[syncMusicOnHoldStart][VoiceCallReport]',util['inspect'](_0x14caf7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfe90('0x33')][_0xfe90('0x2e')]=function(_0x71ccd4){try{if(this[_0xfe90('0x34')](_0x71ccd4)){if(this[_0xfe90('0x1b')][_0x71ccd4['uniqueid']]){if(!_[_0xfe90('0x70')](this[_0xfe90('0x1b')][_0x71ccd4[_0xfe90('0x37')]]['mohstarttime'])){this[_0xfe90('0x1b')][_0x71ccd4[_0xfe90('0x37')]]['mohtime']+=moment()[_0xfe90('0x96')](0x0)[_0xfe90('0x85')](this[_0xfe90('0x1b')][_0x71ccd4[_0xfe90('0x37')]]['mohstarttime'],_0xfe90('0x53'));delete this[_0xfe90('0x1b')][_0x71ccd4['uniqueid']][_0xfe90('0x95')];}}}}catch(_0x429147){logger[_0xfe90('0x3b')](_0xfe90('0x97'),util[_0xfe90('0x3d')](_0x429147,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xc6a9=['custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','isNil','mohstarttime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','ioredis','../../../config/environment','ami','../ami','../model/channel','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','syncNewState','varset','syncVarSet','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','log','isNotNull','isUndefined','prototype','emit','uniqueid','merge','pick','keys','error','linkedid','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','user:%s','name','accountcode','[syncNewChannel][VoiceCallReport]','inspect','OutgoingSpoolFailed','application','toLowerCase','applicationdata','duration','subtract','seconds','includes','lastapplication','lastdata','set','startsWith','match','answered','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','UserId','membername','syncMixMonitorFilename','monitor','.wav49','replace','monitorFilename','find','monitors','rec','variable','mixmonitor_filename','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','billableseconds','diff','answertime','holdtime','omit','user:agentcomplete'];(function(_0x45e21c,_0x5419da){var _0x5d5371=function(_0x535397){while(--_0x535397){_0x45e21c['push'](_0x45e21c['shift']());}};_0x5d5371(++_0x5419da);}(_0xc6a9,0x140));var _0x9c6a=function(_0x4aea3a,_0x3839f9){_0x4aea3a=_0x4aea3a-0x0;var _0x5a349e=_0xc6a9[_0x4aea3a];return _0x5a349e;};'use strict';var BPromise=require('bluebird');var _=require(_0x9c6a('0x0'));var moment=require('moment');var util=require('util');var path=require('path');var Redis=require(_0x9c6a('0x1'));var config=require(_0x9c6a('0x2'));var logger=require('../../../config/logger')(_0x9c6a('0x3'));var ami=require(_0x9c6a('0x4'));var Channel=require(_0x9c6a('0x5'));var statusDesc=[_0x9c6a('0x6'),_0x9c6a('0x7'),'inuse',_0x9c6a('0x8'),_0x9c6a('0x9'),_0x9c6a('0xa'),_0x9c6a('0xb'),_0x9c6a('0xc'),'onhold'];var applications=['set',_0x9c6a('0xd'),'agi',_0x9c6a('0xe'),_0x9c6a('0xf'),_0x9c6a('0x10')];var dispositions=[_0x9c6a('0x11'),_0x9c6a('0x12'),_0x9c6a('0x12'),'NO\x20ANSWER','NO\x20ANSWER',_0x9c6a('0x11'),'ANSWERED',_0x9c6a('0x13'),_0x9c6a('0x12'),_0x9c6a('0x12'),_0x9c6a('0x12')];var actions={};config[_0x9c6a('0x14')]=_[_0x9c6a('0x15')](config[_0x9c6a('0x14')],{'host':'localhost','port':0x18eb});var io=require(_0x9c6a('0x16'))(new Redis(config['redis']));function VoiceCallReport(_0x3a4ff4){this[_0x9c6a('0x17')]=_0x3a4ff4[_0x9c6a('0x17')];this[_0x9c6a('0x18')]=_0x3a4ff4[_0x9c6a('0x18')];ami['on'](_0x9c6a('0x19'),this[_0x9c6a('0x1a')][_0x9c6a('0x1b')](this));ami['on'](_0x9c6a('0x1c'),this[_0x9c6a('0x1a')][_0x9c6a('0x1b')](this));ami['on']('newchannel',this[_0x9c6a('0x1d')][_0x9c6a('0x1b')](this));ami['on']('newstate',this[_0x9c6a('0x1e')][_0x9c6a('0x1b')](this));ami['on'](_0x9c6a('0x1f'),this[_0x9c6a('0x20')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x9c6a('0x1b')](this));ami['on'](_0x9c6a('0x21'),this[_0x9c6a('0x22')]['bind'](this));ami['on'](_0x9c6a('0x23'),this['syncAttendedTransfer'][_0x9c6a('0x1b')](this));ami['on'](_0x9c6a('0x24'),this[_0x9c6a('0x25')][_0x9c6a('0x1b')](this));ami['on'](_0x9c6a('0x26'),this[_0x9c6a('0x27')][_0x9c6a('0x1b')](this));ami['on']('musiconholdstop',this[_0x9c6a('0x28')][_0x9c6a('0x1b')](this));return BPromise[_0x9c6a('0x29')]()[_0x9c6a('0x2a')](ami[_0x9c6a('0x2b')]())['catch'](function(_0x56ae43){console[_0x9c6a('0x2c')](_0x56ae43);});}VoiceCallReport['prototype'][_0x9c6a('0x2d')]=function(_0x41fce0){return _0x41fce0!==null&&!_[_0x9c6a('0x2e')](_0x41fce0);};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x30')]=function(_0x2e5222,_0x47742e,_0x9f14e8){io['to'](_0x2e5222)[_0x9c6a('0x30')](_0x47742e,_0x9f14e8);};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x22')]=function(_0x100c8c){try{if(this[_0x9c6a('0x2d')](_0x100c8c)){if(_0x100c8c[_0x9c6a('0x31')]===_0x100c8c['linkedid']){if(!_[_0x9c6a('0x2e')](this[_0x9c6a('0x17')][_0x100c8c[_0x9c6a('0x31')]])){_[_0x9c6a('0x32')](this[_0x9c6a('0x17')][_0x100c8c[_0x9c6a('0x31')]],_[_0x9c6a('0x33')](_0x100c8c,_[_0x9c6a('0x34')](this[_0x9c6a('0x17')][_0x100c8c['uniqueid']])));}}}}catch(_0xb7e8fb){logger[_0x9c6a('0x35')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0xb7e8fb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x1d')]=function(_0x2fdee0){try{if(this[_0x9c6a('0x2d')](_0x2fdee0)){if(_0x2fdee0[_0x9c6a('0x31')]===_0x2fdee0[_0x9c6a('0x36')]&&_0x2fdee0[_0x9c6a('0x37')]!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0x9c6a('0x17')][_0x2fdee0[_0x9c6a('0x31')]])){this['channels'][_0x2fdee0[_0x9c6a('0x31')]]=new Channel();this['channels'][_0x2fdee0[_0x9c6a('0x31')]][_0x9c6a('0x38')]=moment()[_0x9c6a('0x39')](_0x9c6a('0x3a'));this['channels'][_0x2fdee0[_0x9c6a('0x31')]][_0x9c6a('0x3b')]=dispositions[_[_0x9c6a('0x3c')](_0x2fdee0[_0x9c6a('0x3d')])];_[_0x9c6a('0x32')](this[_0x9c6a('0x17')][_0x2fdee0[_0x9c6a('0x31')]],_['pick'](_0x2fdee0,_[_0x9c6a('0x34')](this[_0x9c6a('0x17')][_0x2fdee0[_0x9c6a('0x31')]])));if(_0x2fdee0[_0x9c6a('0x3e')]===_0x9c6a('0x3f')){if(this[_0x9c6a('0x18')][_0x2fdee0[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]]){this[_0x9c6a('0x18')][_0x2fdee0[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]][_0x9c6a('0x41')]=_0x2fdee0[_0x9c6a('0x42')];this[_0x9c6a('0x30')](util[_0x9c6a('0x39')](_0x9c6a('0x43'),this[_0x9c6a('0x18')][_0x2fdee0[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]][_0x9c6a('0x44')]),'user:agentconnect',{'destaccountcode':this[_0x9c6a('0x18')][_0x2fdee0[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]][_0x9c6a('0x45')],'destconnectedlinenum':_0x2fdee0[_0x9c6a('0x42')]});}}}}}}catch(_0x1b463c){logger['error'](_0x9c6a('0x46'),util[_0x9c6a('0x47')](_0x1b463c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x1a')]=function(_0x57f772){try{if(this[_0x9c6a('0x2d')](_0x57f772)){if(_0x57f772[_0x9c6a('0x31')]===_0x57f772[_0x9c6a('0x36')]&&_0x57f772[_0x9c6a('0x42')]!='h'&&_0x57f772['channel']!=_0x9c6a('0x48')){_0x57f772[_0x9c6a('0x49')]=_0x57f772['application'][_0x9c6a('0x4a')]();_0x57f772[_0x9c6a('0x4b')]=(_0x57f772['appdata']||_0x57f772[_0x9c6a('0x4b')])[_0x9c6a('0x4a')]();if(_[_0x9c6a('0x2e')](this[_0x9c6a('0x17')][_0x57f772['uniqueid']])){this['channels'][_0x57f772['uniqueid']]=new Channel();this[_0x9c6a('0x17')][_0x57f772[_0x9c6a('0x31')]]['starttime']=_0x57f772[_0x9c6a('0x4c')]?moment()[_0x9c6a('0x4d')](moment[_0x9c6a('0x4c')](_0x57f772[_0x9c6a('0x4c')])[_0x9c6a('0x4e')](),'seconds')[_0x9c6a('0x39')](_0x9c6a('0x3a')):moment()[_0x9c6a('0x39')](_0x9c6a('0x3a'));this[_0x9c6a('0x17')][_0x57f772['uniqueid']][_0x9c6a('0x3b')]=_0x9c6a('0x11');}_[_0x9c6a('0x32')](this[_0x9c6a('0x17')][_0x57f772[_0x9c6a('0x31')]],_[_0x9c6a('0x33')](_0x57f772,_[_0x9c6a('0x34')](this[_0x9c6a('0x17')][_0x57f772[_0x9c6a('0x31')]])));if(_[_0x9c6a('0x4f')](applications,_0x57f772['application'])){this[_0x9c6a('0x17')][_0x57f772[_0x9c6a('0x31')]][_0x9c6a('0x50')]=_0x57f772[_0x9c6a('0x49')];this[_0x9c6a('0x17')][_0x57f772[_0x9c6a('0x31')]][_0x9c6a('0x51')]=_0x57f772[_0x9c6a('0x4b')];if(_0x57f772[_0x9c6a('0x49')]===_0x9c6a('0x52')&&_[_0x9c6a('0x53')](_0x57f772[_0x9c6a('0x4b')],'cdr(')){var _0x222331=_0x57f772[_0x9c6a('0x4b')][_0x9c6a('0x40')]('=');var _0x581285=_0x222331[0x0][_0x9c6a('0x54')](/cdr\((.*)\)/);if(_0x581285){this[_0x9c6a('0x17')][_0x57f772[_0x9c6a('0x31')]][_0x581285[0x1]]=_0x222331[0x1];}}else if(_0x57f772[_0x9c6a('0x49')]===_0x9c6a('0xd')){this['channels'][_0x57f772['uniqueid']]['queue']=_0x57f772['applicationdata']['split'](',')[0x0];}}}}}catch(_0x550b94){logger[_0x9c6a('0x35')]('[syncNewExten][VoiceCallReport]',util[_0x9c6a('0x47')](_0x550b94,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x1e')]=function(_0x45891e){try{if(this[_0x9c6a('0x2d')](_0x45891e)){if(_0x45891e[_0x9c6a('0x31')]!==_0x45891e[_0x9c6a('0x36')]){if(this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x36')]]){if(_0x45891e[_0x9c6a('0x3d')]==='6'){if(!this['channels'][_0x45891e[_0x9c6a('0x36')]][_0x9c6a('0x55')]){var _0x4270d6=moment();this['channels'][_0x45891e['linkedid']][_0x9c6a('0x55')]=!![];this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x36')]]['answertime']=_0x4270d6[_0x9c6a('0x39')](_0x9c6a('0x3a'));if(this['channels'][_0x45891e['linkedid']]['starttime']){this[_0x9c6a('0x17')][_0x45891e['linkedid']]['holdtime']=_0x4270d6['diff'](this[_0x9c6a('0x17')][_0x45891e['linkedid']][_0x9c6a('0x38')],_0x9c6a('0x4e'));}}this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x36')]][_0x9c6a('0x36')]=_0x45891e[_0x9c6a('0x31')];if(_0x45891e[_0x9c6a('0x56')]!==_0x9c6a('0x57')){this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x36')]][_0x9c6a('0x58')]=_0x45891e[_0x9c6a('0x56')];}this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x36')]][_0x9c6a('0x59')]=_0x45891e['calleridname'];this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x36')]][_0x9c6a('0x5a')]=_0x45891e['channel'];this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x36')]]['disposition']=dispositions[_[_0x9c6a('0x3c')](_0x45891e[_0x9c6a('0x3d')])];if(this['agents'][_0x45891e[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]]){this[_0x9c6a('0x17')][_0x45891e['linkedid']][_0x9c6a('0x5b')]=this[_0x9c6a('0x18')][_0x45891e[_0x9c6a('0x37')]['split']('-')[0x0]]['id'];this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x36')]]['membername']=this[_0x9c6a('0x18')][_0x45891e[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]]['name'];}}}}else{if(this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x31')]]){if(_0x45891e['channelstate']==='6'){if(this[_0x9c6a('0x18')][_0x45891e[_0x9c6a('0x37')]['split']('-')[0x0]]){this[_0x9c6a('0x17')][_0x45891e['uniqueid']][_0x9c6a('0x5b')]=this[_0x9c6a('0x18')][_0x45891e[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]]['id'];this[_0x9c6a('0x17')][_0x45891e[_0x9c6a('0x31')]][_0x9c6a('0x5c')]=this[_0x9c6a('0x18')][_0x45891e[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]]['name'];}}}}}}catch(_0xd3902b){logger[_0x9c6a('0x35')]('[syncNewState][VoiceCallReport]',util[_0x9c6a('0x47')](_0xd3902b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9c6a('0x5d')]=function(_0x2e72ff,_0x558426){if(this[_0x9c6a('0x17')][_0x2e72ff]){this[_0x9c6a('0x17')][_0x2e72ff][_0x9c6a('0x5e')]=!![];if(_['endsWith'](_0x558426,_0x9c6a('0x5f'))){_0x558426=_0x558426[_0x9c6a('0x60')](_0x9c6a('0x5f'),'.WAV');}this['channels'][_0x2e72ff][_0x9c6a('0x61')]=_0x558426;var _0x15bb8e=_[_0x9c6a('0x62')](this[_0x9c6a('0x17')][_0x2e72ff][_0x9c6a('0x63')],{'filename':_0x558426});if(_['isNil'](_0x15bb8e)){this[_0x9c6a('0x17')][_0x2e72ff][_0x9c6a('0x63')]['push']({'filename':_0x558426,'createdAt':moment()[_0x9c6a('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x9c6a('0x64')});}}};VoiceCallReport[_0x9c6a('0x2f')]['syncVarSet']=function(_0x5649ae){try{if(this[_0x9c6a('0x2d')](_0x5649ae)){if(this['channels'][_0x5649ae['uniqueid']]&&_0x5649ae[_0x9c6a('0x37')]!=_0x9c6a('0x48')){if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')])){if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')][_0x9c6a('0x66')])){this[_0x9c6a('0x5d')](_0x5649ae[_0x9c6a('0x31')],_0x5649ae[_0x9c6a('0x67')]);}else if(this[_0x9c6a('0x2d')](_0x5649ae['variable']['xmd-phone'])){this[_0x9c6a('0x17')][_0x5649ae[_0x9c6a('0x31')]][_0x9c6a('0x56')]=_0x5649ae[_0x9c6a('0x67')];}else if(this[_0x9c6a('0x2d')](_0x5649ae['variable'][_0x9c6a('0x68')])){this[_0x9c6a('0x17')][_0x5649ae['uniqueid']][_0x9c6a('0x69')]=_0x5649ae[_0x9c6a('0x67')];}else if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')][_0x9c6a('0x6a')])){this[_0x9c6a('0x17')][_0x5649ae[_0x9c6a('0x31')]][_0x9c6a('0x6b')]=_0x5649ae[_0x9c6a('0x67')];}else if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')][_0x9c6a('0x6c')])){this[_0x9c6a('0x17')][_0x5649ae[_0x9c6a('0x31')]][_0x9c6a('0xd')]=_0x5649ae[_0x9c6a('0x67')][_0x9c6a('0x40')](',')[0x0];}else if(this['isNotNull'](_0x5649ae[_0x9c6a('0x65')][_0x9c6a('0x6d')])){this[_0x9c6a('0x17')][_0x5649ae[_0x9c6a('0x31')]][_0x9c6a('0x6e')]=_0x5649ae[_0x9c6a('0x67')];}else if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')][_0x9c6a('0x6f')])){this[_0x9c6a('0x17')][_0x5649ae['uniqueid']][_0x9c6a('0x70')]=_0x5649ae[_0x9c6a('0x67')];}else if(this['isNotNull'](_0x5649ae[_0x9c6a('0x65')][_0x9c6a('0x71')])){this[_0x9c6a('0x17')][_0x5649ae[_0x9c6a('0x31')]][_0x9c6a('0x72')]=_0x5649ae['value'];}else if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')]['xmcs-queue'])){this[_0x9c6a('0x17')][_0x5649ae[_0x9c6a('0x31')]][_0x9c6a('0xd')]=_0x5649ae[_0x9c6a('0x67')];}else if(this[_0x9c6a('0x2d')](_0x5649ae['variable'][_0x9c6a('0x73')])){this['channels'][_0x5649ae['uniqueid']][_0x9c6a('0x74')]=_0x5649ae[_0x9c6a('0x67')];}}}else if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')][_0x9c6a('0x66')])){if(_0x5649ae[_0x9c6a('0x67')]){var _0x54bd1d=path[_0x9c6a('0x75')](_0x5649ae['value'])[_0x9c6a('0x44')];this[_0x9c6a('0x5d')](_0x54bd1d,_0x5649ae[_0x9c6a('0x67')]);}}else if(this['channels'][_0x5649ae[_0x9c6a('0x36')]]){if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')])){if(this[_0x9c6a('0x2d')](_0x5649ae[_0x9c6a('0x65')][_0x9c6a('0x73')])){this[_0x9c6a('0x17')][_0x5649ae[_0x9c6a('0x36')]][_0x9c6a('0x76')]=_0x5649ae[_0x9c6a('0x67')];}}}}}catch(_0xa397c4){logger[_0x9c6a('0x35')](_0x9c6a('0x77'),util[_0x9c6a('0x47')](_0xa397c4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x78')]=function(_0x336ff2){try{if(this[_0x9c6a('0x2d')](_0x336ff2)){if(this[_0x9c6a('0x17')][_0x336ff2['uniqueid']]){var _0x448e6d=moment();this[_0x9c6a('0x17')][_0x336ff2[_0x9c6a('0x31')]]['endtime']=_0x448e6d[_0x9c6a('0x39')](_0x9c6a('0x3a'));this['channels'][_0x336ff2['uniqueid']]['duration']=_0x448e6d['diff'](this[_0x9c6a('0x17')][_0x336ff2[_0x9c6a('0x31')]][_0x9c6a('0x38')],_0x9c6a('0x4e'));if(this[_0x9c6a('0x17')][_0x336ff2[_0x9c6a('0x31')]]['answered']){this[_0x9c6a('0x17')][_0x336ff2['uniqueid']][_0x9c6a('0x79')]=_0x448e6d[_0x9c6a('0x7a')](this[_0x9c6a('0x17')][_0x336ff2[_0x9c6a('0x31')]][_0x9c6a('0x7b')],_0x9c6a('0x4e'));this[_0x9c6a('0x17')][_0x336ff2[_0x9c6a('0x31')]][_0x9c6a('0x7c')]=this[_0x9c6a('0x17')][_0x336ff2[_0x9c6a('0x31')]]['duration']-this[_0x9c6a('0x17')][_0x336ff2['uniqueid']][_0x9c6a('0x79')];}if(_0x336ff2['context']===_0x9c6a('0x3f')){if(this[_0x9c6a('0x18')][_0x336ff2[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]]){this['agents'][_0x336ff2['channel'][_0x9c6a('0x40')]('-')[0x0]]=_[_0x9c6a('0x7d')](this['agents'][_0x336ff2['channel']['split']('-')[0x0]],[_0x9c6a('0x41')]);this[_0x9c6a('0x30')](util[_0x9c6a('0x39')](_0x9c6a('0x43'),this[_0x9c6a('0x18')][_0x336ff2['channel'][_0x9c6a('0x40')]('-')[0x0]]['name']),_0x9c6a('0x7e'),{'destaccountcode':this[_0x9c6a('0x18')][_0x336ff2[_0x9c6a('0x37')][_0x9c6a('0x40')]('-')[0x0]][_0x9c6a('0x45')]});}}ami['emit'](_0x9c6a('0x7f'),this['channels'][_0x336ff2[_0x9c6a('0x31')]]);delete this['channels'][_0x336ff2[_0x9c6a('0x31')]];}}}catch(_0x390831){logger['error'](_0x9c6a('0x80'),util[_0x9c6a('0x47')](_0x390831,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c6a('0x2f')]['syncAttendedTransfer']=function(_0x3385aa){try{if(this[_0x9c6a('0x2d')](_0x3385aa)){if(this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x81')]]){this[_0x9c6a('0x17')][_0x3385aa['transfereeuniqueid']][_0x9c6a('0x82')]=_0x3385aa[_0x9c6a('0x83')];this['channels'][_0x3385aa[_0x9c6a('0x81')]][_0x9c6a('0x84')]=_0x3385aa[_0x9c6a('0x85')];if(this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x86')]]){var _0xc4381=this['channels'][_0x3385aa[_0x9c6a('0x86')]];this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x86')]]=this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x81')]];this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x81')]]=_0xc4381;}}else if(this[_0x9c6a('0x17')][_0x3385aa['transfertargetuniqueid']]){this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x87')]][_0x9c6a('0x82')]=_0x3385aa[_0x9c6a('0x83')];this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x87')]][_0x9c6a('0x84')]=_0x3385aa[_0x9c6a('0x85')];if(this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x88')]]){var _0xc4381=this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x88')]];this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x88')]]=this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x87')]];this[_0x9c6a('0x17')][_0x3385aa[_0x9c6a('0x87')]]=_0xc4381;}}}}catch(_0x4fdf82){logger['error'](_0x9c6a('0x89'),util[_0x9c6a('0x47')](_0x4fdf82,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x25')]=function(_0x3c72a2){try{if(this[_0x9c6a('0x2d')](_0x3c72a2)){if(this[_0x9c6a('0x17')][_0x3c72a2[_0x9c6a('0x81')]]){this[_0x9c6a('0x17')][_0x3c72a2[_0x9c6a('0x81')]]['transfercalleridnum']=_0x3c72a2[_0x9c6a('0x8a')];this[_0x9c6a('0x17')][_0x3c72a2[_0x9c6a('0x81')]]['transferconnectedlinenum']=_0x3c72a2[_0x9c6a('0x8b')];this['syncHangup']({'event':_0x9c6a('0x8c'),'uniqueid':_0x3c72a2[_0x9c6a('0x81')],'context':_0x3c72a2[_0x9c6a('0x3e')],'channel':_0x3c72a2[_0x9c6a('0x8d')]});}}}catch(_0x54a819){logger[_0x9c6a('0x35')](_0x9c6a('0x8e'),util[_0x9c6a('0x47')](_0x54a819,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x27')]=function(_0x2d5c99){try{if(this[_0x9c6a('0x2d')](_0x2d5c99)){if(this[_0x9c6a('0x17')][_0x2d5c99[_0x9c6a('0x31')]]){if(!_['isNil'](this['channels'][_0x2d5c99['uniqueid']]['answertime'])){this[_0x9c6a('0x17')][_0x2d5c99['uniqueid']]['mohstarttime']=moment()[_0x9c6a('0x39')](_0x9c6a('0x3a'));}}}}catch(_0x910c4b){logger[_0x9c6a('0x35')](_0x9c6a('0x8f'),util[_0x9c6a('0x47')](_0x910c4b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c6a('0x2f')][_0x9c6a('0x28')]=function(_0x46bd2d){try{if(this[_0x9c6a('0x2d')](_0x46bd2d)){if(this[_0x9c6a('0x17')][_0x46bd2d[_0x9c6a('0x31')]]){if(!_[_0x9c6a('0x90')](this['channels'][_0x46bd2d['uniqueid']][_0x9c6a('0x91')])){this[_0x9c6a('0x17')][_0x46bd2d[_0x9c6a('0x31')]]['mohtime']+=moment()[_0x9c6a('0x92')](0x0)['diff'](this[_0x9c6a('0x17')][_0x46bd2d['uniqueid']][_0x9c6a('0x91')],_0x9c6a('0x4e'));delete this['channels'][_0x46bd2d[_0x9c6a('0x31')]][_0x9c6a('0x91')];}}}}catch(_0x42ac03){logger[_0x9c6a('0x35')](_0x9c6a('0x93'),util[_0x9c6a('0x47')](_0x42ac03,{'showHidden':![],'depth':null}));}};module[_0x9c6a('0x94')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index b6a081a..dfd3a52 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 _0xef98=['memberrealtime','isNil','includes','syncHangup','endtime','duration','starttime','complete','diff','seconds','sumHoldTime','holdtime','sumBillable','billableseconds','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','[syncHangup][VoiceDialReport]','exports','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','outbound','variables','syncDialBegin','dialend','bind','varset','syncVarSet','prototype','isNotNull','isUndefined','emit','uniqueid','channels','format','called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','syncDialEnd','dialstatus','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','memberdynamic','memberinterface','membername','memberpenalty'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0xef98,0x110));var _0x8ef9=function(_0x417acc,_0x23a23f){_0x417acc=_0x417acc-0x0;var _0x4bfbfc=_0xef98[_0x417acc];return _0x4bfbfc;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x8ef9('0x0'));var Redis=require(_0x8ef9('0x1'));var config=require(_0x8ef9('0x2'));var logger=require(_0x8ef9('0x3'))(_0x8ef9('0x4'));var ami=require(_0x8ef9('0x5'));config[_0x8ef9('0x6')]=_['defaults'](config[_0x8ef9('0x6')],{'host':_0x8ef9('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8ef9('0x6')]));function VoiceDialReport(_0x1011d1){this['channels']=_0x1011d1['outboundChannels'];this[_0x8ef9('0x8')]=_0x1011d1['outbound'];this[_0x8ef9('0x9')]={};ami['on']('dialbegin',this[_0x8ef9('0xa')]['bind'](this));ami['on'](_0x8ef9('0xb'),this['syncDialEnd'][_0x8ef9('0xc')](this));ami['on'](_0x8ef9('0xd'),this[_0x8ef9('0xe')][_0x8ef9('0xc')](this));ami['on']('hangup',this['syncHangup'][_0x8ef9('0xc')](this));}VoiceDialReport[_0x8ef9('0xf')][_0x8ef9('0x10')]=function(_0x1e8fa3){return _0x1e8fa3!==null&&!_[_0x8ef9('0x11')](_0x1e8fa3);};VoiceDialReport['prototype'][_0x8ef9('0x12')]=function(_0xfa528,_0x1d13e6,_0x2a2744){io['to'](_0xfa528)[_0x8ef9('0x12')](_0x1d13e6,_0x2a2744);};VoiceDialReport[_0x8ef9('0xf')]['syncDialBegin']=function(_0x3ff701){try{if(this[_0x8ef9('0x10')](_0x3ff701)){if(this['channels'][_0x3ff701[_0x8ef9('0x13')]]){_['merge'](this[_0x8ef9('0x14')][_0x3ff701[_0x8ef9('0x13')]],{'starttime':moment()[_0x8ef9('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x8ef9('0x16'),'interface':_0x3ff701[_0x8ef9('0x17')][_0x8ef9('0x18')](0x0,_0x3ff701['channel'][_0x8ef9('0x19')]('-')),'membername':_0x3ff701['channel'][_0x8ef9('0x18')](_0x3ff701[_0x8ef9('0x17')][_0x8ef9('0x19')]('/')+0x1,_0x3ff701[_0x8ef9('0x17')][_0x8ef9('0x19')]('-'))},_[_0x8ef9('0x1a')](_0x3ff701,[_0x8ef9('0x1b'),_0x8ef9('0x1c')]));this[_0x8ef9('0x12')](_0x8ef9('0x1d'),_0x8ef9('0x1e'),this[_0x8ef9('0x14')][_0x3ff701[_0x8ef9('0x13')]]);ami[_0x8ef9('0x12')](_0x8ef9('0x1f'),this[_0x8ef9('0x14')][_0x3ff701['uniqueid']]);}}}catch(_0x16a9b3){logger[_0x8ef9('0x20')](_0x8ef9('0x21'),util[_0x8ef9('0x22')](_0x16a9b3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8ef9('0xf')][_0x8ef9('0x23')]=function(_0x5f4303){try{if(this['isNotNull'](_0x5f4303)){if(this[_0x8ef9('0x14')][_0x5f4303[_0x8ef9('0x13')]]){this[_0x8ef9('0x14')][_0x5f4303[_0x8ef9('0x13')]][_0x8ef9('0x24')]=_0x5f4303[_0x8ef9('0x24')];if(_0x5f4303[_0x8ef9('0x24')]==='ANSWER'){this[_0x8ef9('0x14')][_0x5f4303[_0x8ef9('0x13')]][_0x8ef9('0x25')]=_0x5f4303[_0x8ef9('0x25')];this['channels'][_0x5f4303[_0x8ef9('0x13')]][_0x8ef9('0x26')]=_0x5f4303['connectedlinename'];this['channels'][_0x5f4303['uniqueid']][_0x8ef9('0x27')]=moment()[_0x8ef9('0x15')](_0x8ef9('0x28'));this[_0x8ef9('0x14')][_0x5f4303['uniqueid']][_0x8ef9('0x29')]=_0x8ef9('0x2a');ami[_0x8ef9('0x12')](_0x8ef9('0x2b'),this[_0x8ef9('0x14')][_0x5f4303['uniqueid']]);}this[_0x8ef9('0x12')]('voice:outbound',_0x8ef9('0x1e'),this['channels'][_0x5f4303[_0x8ef9('0x13')]]);}}}catch(_0x27f7bb){logger[_0x8ef9('0x20')](_0x8ef9('0x2c'),util[_0x8ef9('0x22')](_0x27f7bb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8ef9('0xf')]['syncVarSet']=function(_0x492f83){try{if(this['isNotNull'](_0x492f83)){this[_0x8ef9('0x2d')](_0x492f83[_0x8ef9('0x13')],_[_0x8ef9('0x2e')](_0x492f83[_0x8ef9('0x2f')])[0x0],_0x492f83[_0x8ef9('0x30')]);if(this['isNotNull'](_0x492f83['variable'])&&this[_0x8ef9('0x10')](_0x492f83[_0x8ef9('0x2f')][_0x8ef9('0x31')])){if(_['isUndefined'](this['channels'][_0x492f83[_0x8ef9('0x13')]])){this[_0x8ef9('0x14')][_0x492f83[_0x8ef9('0x13')]]={'routeId':_0x492f83[_0x8ef9('0x30')],'variables':this[_0x8ef9('0x9')][_0x492f83[_0x8ef9('0x13')]]};this[_0x8ef9('0x12')](_0x8ef9('0x1d'),_0x8ef9('0x1e'),this[_0x8ef9('0x14')][_0x492f83[_0x8ef9('0x13')]]);}}}}catch(_0x15f9b1){logger[_0x8ef9('0x20')](_0x8ef9('0x32'),util[_0x8ef9('0x22')](_0x15f9b1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8ef9('0xf')][_0x8ef9('0x2d')]=function(_0x42dd03,_0x58aa59,_0x43ea3a){var _0x11e913=[_0x8ef9('0x33'),_0x8ef9('0x34'),'rtpaudioqosjitter',_0x8ef9('0x35'),_0x8ef9('0x36'),_0x8ef9('0x37'),_0x8ef9('0x38'),_0x8ef9('0x39'),'sipcallid',_0x8ef9('0x3a'),_0x8ef9('0x3b'),'bridgepvtcallid','membercalls',_0x8ef9('0x3c'),_0x8ef9('0x3d'),'memberlastcall',_0x8ef9('0x3e'),_0x8ef9('0x3f'),_0x8ef9('0x40')];if(!_[_0x8ef9('0x41')](_0x58aa59)&&!_[_0x8ef9('0x42')](_0x11e913,_0x58aa59)){if(_[_0x8ef9('0x11')](this[_0x8ef9('0x9')][_0x42dd03])){this['variables'][_0x42dd03]={};}this[_0x8ef9('0x9')][_0x42dd03][_0x58aa59]=_0x43ea3a;}};VoiceDialReport[_0x8ef9('0xf')][_0x8ef9('0x43')]=function(_0x48d79d){try{if(this[_0x8ef9('0x10')](_0x48d79d)){if(this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]]){this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x44')]=moment()[_0x8ef9('0x15')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8ef9('0x14')][_0x48d79d['uniqueid']][_0x8ef9('0x45')]=moment(this['channels'][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x44')])['diff'](this['channels'][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x46')],'seconds');this[_0x8ef9('0x14')][_0x48d79d['uniqueid']][_0x8ef9('0x29')]=_0x8ef9('0x47');this[_0x8ef9('0x8')]['total']+=0x1;if(this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x27')]){this[_0x8ef9('0x8')]['answered']+=0x1;this[_0x8ef9('0x14')][_0x48d79d['uniqueid']]['holdtime']=moment(this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x27')])[_0x8ef9('0x48')](this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]]['starttime'],_0x8ef9('0x49'));this['channels'][_0x48d79d['uniqueid']]['billableseconds']=moment(this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x44')])['diff'](this['channels'][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x27')],'seconds');this['outbound'][_0x8ef9('0x4a')]+=this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x4b')]||0x0;this['outbound'][_0x8ef9('0x4c')]+=this['channels'][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x4d')];}this[_0x8ef9('0x8')][_0x8ef9('0x4e')]+=this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]][_0x8ef9('0x45')];ami[_0x8ef9('0x12')](_0x8ef9('0x4f'),this['channels'][_0x48d79d[_0x8ef9('0x13')]]);ami[_0x8ef9('0x12')](_0x8ef9('0x50'),this[_0x8ef9('0x14')][_0x48d79d['uniqueid']]);this[_0x8ef9('0x12')](_0x8ef9('0x1d'),_0x8ef9('0x51'),this[_0x8ef9('0x8')]);this[_0x8ef9('0x12')](_0x8ef9('0x1d'),'voice_outbound_channel:remove',this[_0x8ef9('0x14')][_0x48d79d['uniqueid']]);delete this[_0x8ef9('0x14')][_0x48d79d[_0x8ef9('0x13')]];}if(this[_0x8ef9('0x9')][_0x48d79d[_0x8ef9('0x13')]]){delete this[_0x8ef9('0x9')][_0x48d79d['uniqueid']];}}}catch(_0x54666b){logger['error'](_0x8ef9('0x52'),util['inspect'](_0x54666b,{'showHidden':![],'depth':null}));}};module[_0x8ef9('0x53')]=VoiceDialReport; \ No newline at end of file +var _0x3a9f=['isNotNull','emit','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','variable','isUndefined','value','voice_outbound_channel:save','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','starttime','seconds','complete','answered','holdtime','diff','billableseconds','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','moment','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype'];(function(_0x810d6b,_0x1bd2a9){var _0x3ddeef=function(_0x46faa2){while(--_0x46faa2){_0x810d6b['push'](_0x810d6b['shift']());}};_0x3ddeef(++_0x1bd2a9);}(_0x3a9f,0x1e8));var _0xf3a9=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x3a9f[_0x4191af];return _0x27bebf;};'use strict';var _=require('lodash');var moment=require(_0xf3a9('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xf3a9('0x1'));var logger=require(_0xf3a9('0x2'))(_0xf3a9('0x3'));var ami=require('../ami');config[_0xf3a9('0x4')]=_[_0xf3a9('0x5')](config[_0xf3a9('0x4')],{'host':_0xf3a9('0x6'),'port':0x18eb});var io=require(_0xf3a9('0x7'))(new Redis(config[_0xf3a9('0x4')]));function VoiceDialReport(_0x314a6f){this[_0xf3a9('0x8')]=_0x314a6f[_0xf3a9('0x9')];this['outbound']=_0x314a6f[_0xf3a9('0xa')];this[_0xf3a9('0xb')]={};ami['on'](_0xf3a9('0xc'),this[_0xf3a9('0xd')][_0xf3a9('0xe')](this));ami['on'](_0xf3a9('0xf'),this[_0xf3a9('0x10')][_0xf3a9('0xe')](this));ami['on'](_0xf3a9('0x11'),this[_0xf3a9('0x12')][_0xf3a9('0xe')](this));ami['on'](_0xf3a9('0x13'),this[_0xf3a9('0x14')][_0xf3a9('0xe')](this));}VoiceDialReport[_0xf3a9('0x15')][_0xf3a9('0x16')]=function(_0x4c7de3){return _0x4c7de3!==null&&!_['isUndefined'](_0x4c7de3);};VoiceDialReport['prototype'][_0xf3a9('0x17')]=function(_0x299b4b,_0x2c9afd,_0x4de698){io['to'](_0x299b4b)[_0xf3a9('0x17')](_0x2c9afd,_0x4de698);};VoiceDialReport['prototype'][_0xf3a9('0xd')]=function(_0x549962){try{if(this[_0xf3a9('0x16')](_0x549962)){if(this['channels'][_0x549962[_0xf3a9('0x18')]]){_[_0xf3a9('0x19')](this[_0xf3a9('0x8')][_0x549962['uniqueid']],{'starttime':moment()[_0xf3a9('0x1a')](_0xf3a9('0x1b')),'lastevent':'called','interface':_0x549962[_0xf3a9('0x1c')][_0xf3a9('0x1d')](0x0,_0x549962[_0xf3a9('0x1c')][_0xf3a9('0x1e')]('-')),'membername':_0x549962[_0xf3a9('0x1c')][_0xf3a9('0x1d')](_0x549962[_0xf3a9('0x1c')]['lastIndexOf']('/')+0x1,_0x549962[_0xf3a9('0x1c')][_0xf3a9('0x1e')]('-'))},_[_0xf3a9('0x1f')](_0x549962,[_0xf3a9('0x20'),_0xf3a9('0x21')]));this[_0xf3a9('0x17')](_0xf3a9('0x22'),'voice_outbound_channel:save',this[_0xf3a9('0x8')][_0x549962[_0xf3a9('0x18')]]);ami[_0xf3a9('0x17')](_0xf3a9('0x23'),this['channels'][_0x549962[_0xf3a9('0x18')]]);}}}catch(_0x4fa245){logger[_0xf3a9('0x24')](_0xf3a9('0x25'),util[_0xf3a9('0x26')](_0x4fa245,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xf3a9('0x10')]=function(_0xf4c014){try{if(this['isNotNull'](_0xf4c014)){if(this[_0xf3a9('0x8')][_0xf4c014['uniqueid']]){this['channels'][_0xf4c014[_0xf3a9('0x18')]][_0xf3a9('0x27')]=_0xf4c014[_0xf3a9('0x27')];if(_0xf4c014[_0xf3a9('0x27')]===_0xf3a9('0x28')){this[_0xf3a9('0x8')][_0xf4c014[_0xf3a9('0x18')]][_0xf3a9('0x29')]=_0xf4c014['connectedlinenum'];this['channels'][_0xf4c014[_0xf3a9('0x18')]][_0xf3a9('0x2a')]=_0xf4c014[_0xf3a9('0x2a')];this[_0xf3a9('0x8')][_0xf4c014[_0xf3a9('0x18')]][_0xf3a9('0x2b')]=moment()[_0xf3a9('0x1a')](_0xf3a9('0x1b'));this['channels'][_0xf4c014['uniqueid']][_0xf3a9('0x2c')]=_0xf3a9('0x2d');ami['emit'](_0xf3a9('0x2e'),this[_0xf3a9('0x8')][_0xf4c014[_0xf3a9('0x18')]]);}this[_0xf3a9('0x17')](_0xf3a9('0x22'),'voice_outbound_channel:save',this[_0xf3a9('0x8')][_0xf4c014[_0xf3a9('0x18')]]);}}}catch(_0xc70568){logger['error'](_0xf3a9('0x2f'),util[_0xf3a9('0x26')](_0xc70568,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xf3a9('0x12')]=function(_0x9d3e68){try{if(this[_0xf3a9('0x16')](_0x9d3e68)){this['addVariable'](_0x9d3e68['uniqueid'],_['keys'](_0x9d3e68[_0xf3a9('0x30')])[0x0],_0x9d3e68['value']);if(this[_0xf3a9('0x16')](_0x9d3e68[_0xf3a9('0x30')])&&this[_0xf3a9('0x16')](_0x9d3e68[_0xf3a9('0x30')]['outboundrouteid'])){if(_[_0xf3a9('0x31')](this[_0xf3a9('0x8')][_0x9d3e68['uniqueid']])){this[_0xf3a9('0x8')][_0x9d3e68[_0xf3a9('0x18')]]={'routeId':_0x9d3e68[_0xf3a9('0x32')],'variables':this[_0xf3a9('0xb')][_0x9d3e68['uniqueid']]};this[_0xf3a9('0x17')](_0xf3a9('0x22'),_0xf3a9('0x33'),this[_0xf3a9('0x8')][_0x9d3e68['uniqueid']]);}}}}catch(_0x59ccf3){logger[_0xf3a9('0x24')]('[syncVarSet][VoiceDialReport]',util[_0xf3a9('0x26')](_0x59ccf3,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x8a95fb,_0xeb18df,_0x5a8460){var _0xa1a018=['rtpaudioqos',_0xf3a9('0x34'),_0xf3a9('0x35'),_0xf3a9('0x36'),_0xf3a9('0x37'),_0xf3a9('0x38'),'rtpaudioqosrtt',_0xf3a9('0x39'),_0xf3a9('0x3a'),_0xf3a9('0x3b'),_0xf3a9('0x3c'),_0xf3a9('0x3d'),_0xf3a9('0x3e'),_0xf3a9('0x3f'),'memberinterface','memberlastcall',_0xf3a9('0x40'),_0xf3a9('0x41'),_0xf3a9('0x42')];if(!_[_0xf3a9('0x43')](_0xeb18df)&&!_[_0xf3a9('0x44')](_0xa1a018,_0xeb18df)){if(_[_0xf3a9('0x31')](this[_0xf3a9('0xb')][_0x8a95fb])){this['variables'][_0x8a95fb]={};}this[_0xf3a9('0xb')][_0x8a95fb][_0xeb18df]=_0x5a8460;}};VoiceDialReport[_0xf3a9('0x15')][_0xf3a9('0x14')]=function(_0x27c444){try{if(this[_0xf3a9('0x16')](_0x27c444)){if(this[_0xf3a9('0x8')][_0x27c444['uniqueid']]){this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]][_0xf3a9('0x45')]=moment()[_0xf3a9('0x1a')](_0xf3a9('0x1b'));this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]][_0xf3a9('0x46')]=moment(this[_0xf3a9('0x8')][_0x27c444['uniqueid']]['endtime'])['diff'](this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]][_0xf3a9('0x47')],_0xf3a9('0x48'));this[_0xf3a9('0x8')][_0x27c444['uniqueid']][_0xf3a9('0x2c')]=_0xf3a9('0x49');this[_0xf3a9('0xa')]['total']+=0x1;if(this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]]['answertime']){this['outbound'][_0xf3a9('0x4a')]+=0x1;this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]][_0xf3a9('0x4b')]=moment(this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]][_0xf3a9('0x2b')])[_0xf3a9('0x4c')](this[_0xf3a9('0x8')][_0x27c444['uniqueid']][_0xf3a9('0x47')],_0xf3a9('0x48'));this[_0xf3a9('0x8')][_0x27c444['uniqueid']][_0xf3a9('0x4d')]=moment(this[_0xf3a9('0x8')][_0x27c444['uniqueid']][_0xf3a9('0x45')])[_0xf3a9('0x4c')](this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]]['answertime'],_0xf3a9('0x48'));this[_0xf3a9('0xa')]['sumHoldTime']+=this['channels'][_0x27c444[_0xf3a9('0x18')]][_0xf3a9('0x4b')]||0x0;this['outbound'][_0xf3a9('0x4e')]+=this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]][_0xf3a9('0x4d')];}this[_0xf3a9('0xa')][_0xf3a9('0x4f')]+=this[_0xf3a9('0x8')][_0x27c444['uniqueid']][_0xf3a9('0x46')];ami['emit'](_0xf3a9('0x50'),this[_0xf3a9('0x8')][_0x27c444['uniqueid']]);ami[_0xf3a9('0x17')](_0xf3a9('0x51'),this[_0xf3a9('0x8')][_0x27c444['uniqueid']]);this['emit'](_0xf3a9('0x22'),_0xf3a9('0x52'),this[_0xf3a9('0xa')]);this[_0xf3a9('0x17')](_0xf3a9('0x22'),_0xf3a9('0x53'),this[_0xf3a9('0x8')][_0x27c444[_0xf3a9('0x18')]]);delete this['channels'][_0x27c444[_0xf3a9('0x18')]];}if(this[_0xf3a9('0xb')][_0x27c444[_0xf3a9('0x18')]]){delete this['variables'][_0x27c444['uniqueid']];}}}catch(_0x5d3af0){logger[_0xf3a9('0x24')](_0xf3a9('0x54'),util['inspect'](_0x5d3af0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index e5d42c6..45eca0c 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 _0xd151=['pick','keys','[syncQueueCallerJoin][VoiceQueueReport]','syncQueueCallerAbandon','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','[syncAgentConnect][VoiceQueueReport]','assigned','queuecallercomplete','queuecallerexitAt','reason','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','seconds','transfertype','FORWARD','transferexten','transferuniqueid','COMPLETEDBY','addVariable','variable','CONTINUE','queuecallerexit','value','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','includes','length','diff','milliseconds','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','BLINDTRANSFER','BLIND','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','lodash','moment','bluebird','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','enqueue','tail','finally','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','talking','pTalking','queueStatusComplete','unlockRR','prototype','clearZombieChannels','switch','sequence','Action','status','channel','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:remove','emitVoiceQueueSummary','type','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','Trunk','callerid','Interval','stringify','md5','isNotNull','queues','catch','[queues]','flagQueueSummary','[queuesummary]','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','inbound','queuecallerjoinAt','position','count'];(function(_0x4d399b,_0x3bd4a4){var _0x4435e5=function(_0x587f0a){while(--_0x587f0a){_0x4d399b['push'](_0x4d399b['shift']());}};_0x4435e5(++_0x3bd4a4);}(_0xd151,0x1e0));var _0x1d15=function(_0x3f1861,_0x7b4285){_0x3f1861=_0x3f1861-0x0;var _0x7ca70a=_0xd151[_0x3f1861];return _0x7ca70a;};'use strict';var _=require(_0x1d15('0x0'));var moment=require(_0x1d15('0x1'));var BPromise=require(_0x1d15('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x1d15('0x3'));var config=require('../../../config/environment');var logger=require(_0x1d15('0x4'))(_0x1d15('0x5'));var ami=require(_0x1d15('0x6'));var QueueReport=require(_0x1d15('0x7'));config['redis']=_['defaults'](config[_0x1d15('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1d15('0x8')]));var Sequence=function(){};Sequence['prototype'][_0x1d15('0x9')]=function(_0xa692f6){this[_0x1d15('0xa')]=this['tail']?this['tail'][_0x1d15('0xb')](_0xa692f6):_0xa692f6();};function VoiceQueueReport(_0x447277){this['sequence']=new Sequence();this[_0x1d15('0xc')]={};this['agents']=_0x447277[_0x1d15('0xd')];this[_0x1d15('0xe')]=_0x447277[_0x1d15('0xf')];this[_0x1d15('0x10')]=_0x447277['voiceQueues'];this['flagQueueSummary']=!![];this[_0x1d15('0x11')]=_0x447277[_0x1d15('0x11')];this[_0x1d15('0x12')]={};ami['on'](_0x1d15('0x13'),this[_0x1d15('0x14')][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x16'),this[_0x1d15('0x17')][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x18'),this[_0x1d15('0x19')][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x1a'),this['syncQueueCallerAbandon'][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x1b'),this['syncQueueCallerLeave'][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x1c'),this['syncAgentComplete']['bind'](this));ami['on'](_0x1d15('0x1d'),this[_0x1d15('0x1e')][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x1f'),this[_0x1d15('0x20')][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x21'),this[_0x1d15('0x22')]['bind'](this));ami['on']('fullybooted',this['syncFullyBooted'][_0x1d15('0x15')](this));ami['on']('musiconholdstart',this[_0x1d15('0x23')][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x24'),this[_0x1d15('0x25')][_0x1d15('0x15')](this));ami['on'](_0x1d15('0x26'),this[_0x1d15('0x27')][_0x1d15('0x15')](this));ami['on']('blindtransfer',this[_0x1d15('0x28')][_0x1d15('0x15')](this));this[_0x1d15('0x29')]();this[_0x1d15('0x2a')]();}function isNotNull(_0x478fa3){return _0x478fa3!==null&&!_[_0x1d15('0x2b')](_0x478fa3);}function clearChannels(_0x4de876){if(!_['isEmpty'](_0x4de876)){for(var _0x703dc6 in _0x4de876){if(_0x4de876['hasOwnProperty'](_0x703dc6)){delete _0x4de876[_0x703dc6];}}}}function clearCampaigns(_0x5099ee){if(!_[_0x1d15('0x2c')](_0x5099ee)){for(var _0x5d570f in _0x5099ee){if(_0x5099ee[_0x1d15('0x2d')](_0x5d570f)){_0x5099ee[_0x5d570f]['originated']=0x0;}}}}function clearVoiceQueues(_0xa21381){if(!_[_0x1d15('0x2c')](_0xa21381)){for(var _0x4dac46 in _0xa21381){if(_0xa21381[_0x1d15('0x2d')](_0x4dac46)){_0xa21381[_0x4dac46]['originated']=0x0;_0xa21381[_0x4dac46][_0x1d15('0x2e')]=0x0;_0xa21381[_0x4dac46][_0x1d15('0x2f')]=0x0;_0xa21381[_0x4dac46]['waiting']=0x0;_0xa21381[_0x4dac46][_0x1d15('0x30')]=!![];}}}}function clearAgentBooked(_0x3f159d){if(!_[_0x1d15('0x2c')](_0x3f159d)){for(var _0x5380ec in _0x3f159d){if(_0x3f159d[_0x1d15('0x2d')](_0x5380ec)){_0x3f159d[_0x5380ec][_0x1d15('0x31')]=!![];}}}}VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x33')]=function(){var _0x1ab308=this;for(var _0x2d8ed2 in this[_0x1d15('0xe')]){if(this['channels']['hasOwnProperty'](_0x2d8ed2)&&!this[_0x1d15('0xe')][_0x2d8ed2][_0x1d15('0x34')]){this[_0x1d15('0x35')]['enqueue'](function(){if(!_['isNil'](_0x1ab308[_0x1d15('0xe')][_0x2d8ed2])){return ami[_0x1d15('0x36')]({'action':_0x1d15('0x37'),'channel':_0x1ab308[_0x1d15('0xe')][_0x2d8ed2][_0x1d15('0x38')]})['catch'](function(_0x1504ea){if(_0x1504ea[_0x1d15('0x39')]===_0x1d15('0x3a')){setTimeout(function(){if(_0x1ab308[_0x1d15('0xe')][_0x2d8ed2]){delete _0x1ab308[_0x1d15('0xe')][_0x2d8ed2];logger[_0x1d15('0x3b')](_0x1d15('0x3c'),_0x2d8ed2);}if(_0x1ab308[_0x1d15('0xc')][_0x2d8ed2]){delete _0x1ab308['queueReports'][_0x2d8ed2];logger[_0x1d15('0x3b')](_0x1d15('0x3d'),_0x2d8ed2);}if(_0x1ab308[_0x1d15('0x12')][_0x2d8ed2]){delete _0x1ab308[_0x1d15('0x12')][_0x2d8ed2];logger[_0x1d15('0x3b')](_0x1d15('0x3e'),_0x2d8ed2);}},0x1f40);}});}});}}};VoiceQueueReport[_0x1d15('0x32')]['syncFullyBooted']=function(){logger[_0x1d15('0x3b')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this['channels']);this[_0x1d15('0x3f')](this[_0x1d15('0xc')]);clearAgentBooked(this[_0x1d15('0xd')]);clearVoiceQueues(this[_0x1d15('0x10')]);clearCampaigns(this[_0x1d15('0x11')]);};VoiceQueueReport[_0x1d15('0x32')]['clearQueueReport']=function(_0x132903){var _0x887d68=this;if(!_['isEmpty'](_0x132903)){for(var _0x553c12 in _0x132903){if(_0x132903[_0x1d15('0x2d')](_0x553c12)){_0x887d68[_0x1d15('0x40')](_0x132903[_0x553c12]);delete _0x132903[_0x553c12];}}}};function loggerCatch(_0x8b390e){return function(_0x24fe99){logger[_0x1d15('0x3b')](_0x8b390e,util[_0x1d15('0x41')](_0x24fe99,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x42')]=function(_0x553c6e,_0x3ba858,_0x358c17){io['to'](_0x553c6e)[_0x1d15('0x42')](_0x3ba858,_0x358c17);};VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x43')]=function(_0x1402eb){this['emit'](util[_0x1d15('0x44')](_0x1d15('0x45'),_0x1402eb[_0x1d15('0x46')]),'voice_queue_channel:save',_0x1402eb);};VoiceQueueReport['prototype'][_0x1d15('0x40')]=function(_0x78122e){this['emit'](util[_0x1d15('0x44')](_0x1d15('0x45'),_0x78122e[_0x1d15('0x46')]),_0x1d15('0x47'),_0x78122e);};VoiceQueueReport['prototype'][_0x1d15('0x48')]=function(_0x1ef57a){if(_0x1ef57a[_0x1d15('0x49')]==='inbound'){var _0x29841e={'id':_0x1ef57a['id'],'name':_0x1ef57a[_0x1d15('0x46')],'strategy':_0x1ef57a['strategy'],'answered':_0x1ef57a[_0x1d15('0x4a')],'available':_0x1ef57a[_0x1d15('0x4b')],'loggedIn':_0x1ef57a[_0x1d15('0x4c')],'pTalking':_0x1ef57a[_0x1d15('0x2f')],'sumBillable':_0x1ef57a[_0x1d15('0x4d')],'sumDuration':_0x1ef57a[_0x1d15('0x4e')],'sumHoldTime':_0x1ef57a[_0x1d15('0x4f')]||0x0,'talking':_0x1ef57a[_0x1d15('0x2e')],'total':_0x1ef57a[_0x1d15('0x50')],'type':_0x1ef57a['type'],'unmanaged':_0x1ef57a[_0x1d15('0x51')],'abandoned':_0x1ef57a[_0x1d15('0x52')],'waiting':_0x1ef57a[_0x1d15('0x53')]};if(_0x1ef57a[_0x1d15('0x54')]){_0x29841e[_0x1d15('0x54')]={'id':_0x1ef57a[_0x1d15('0x54')]['id'],'name':_0x1ef57a[_0x1d15('0x54')]['name'],'active':_0x1ef57a[_0x1d15('0x54')]['active'],'callerid':_0x1ef57a[_0x1d15('0x54')][_0x1d15('0x55')]};}if(_0x1ef57a[_0x1d15('0x56')]){_0x29841e[_0x1d15('0x56')]={'id':_0x1ef57a[_0x1d15('0x56')]['id'],'name':_0x1ef57a[_0x1d15('0x56')][_0x1d15('0x46')]};}var _0x19b851=md5(JSON[_0x1d15('0x57')](_0x29841e));if(_0x1ef57a[_0x1d15('0x58')]!==_0x19b851){_0x1ef57a[_0x1d15('0x58')]=_0x19b851;this[_0x1d15('0x42')](util[_0x1d15('0x44')](_0x1d15('0x45'),_0x29841e[_0x1d15('0x46')]),'voice_queue:save',_0x29841e);}}};VoiceQueueReport['prototype'][_0x1d15('0x59')]=function(_0x38ccf4){return _0x38ccf4!==null&&!_['isUndefined'](_0x38ccf4);};VoiceQueueReport[_0x1d15('0x32')]['loopQueueShow']=function(){var _0x2c777c=this;setInterval(function(){_0x2c777c[_0x1d15('0x33')]();ami['Action']({'action':_0x1d15('0x5a')})[_0x1d15('0x5b')](loggerCatch(_0x1d15('0x5c')));},0x2710);};VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x29')]=function(){var _0x220deb=this;setInterval(function(){if(_0x220deb[_0x1d15('0x5d')]){return ami[_0x1d15('0x36')]({'action':_0x1d15('0x13')})['then'](function(_0x2c6a23){_0x220deb[_0x1d15('0x5d')]=![];})[_0x1d15('0x5b')](loggerCatch(_0x1d15('0x5e')));}},0x3e8);};VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x14')]=function(_0x29d30a){try{if(this['isNotNull'](_0x29d30a)&&this[_0x1d15('0x59')](_0x29d30a['queue'])){if(this[_0x1d15('0x10')][_0x29d30a[_0x1d15('0x5f')]]){var _0x13c8df=_[_0x1d15('0x60')](this[_0x1d15('0xe')],'queue')[_0x29d30a[_0x1d15('0x5f')]]||0x0;var _0x307341=_0x13c8df-_0x29d30a[_0x1d15('0x61')];if(this[_0x1d15('0x10')][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x53')]!==_[_0x1d15('0x62')](_0x29d30a[_0x1d15('0x61')])||this[_0x1d15('0x10')][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x4c')]!==_[_0x1d15('0x62')](_0x29d30a[_0x1d15('0x63')])||this['voiceQueues'][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x4b')]!==_['toNumber'](_0x29d30a[_0x1d15('0x4b')])||this['voiceQueues'][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x2e')]!==_0x307341){this[_0x1d15('0x10')][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x53')]=_[_0x1d15('0x62')](_0x29d30a[_0x1d15('0x61')]);this[_0x1d15('0x10')][_0x29d30a['queue']][_0x1d15('0x4c')]=_[_0x1d15('0x62')](_0x29d30a[_0x1d15('0x63')]);this[_0x1d15('0x10')][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x4b')]=_['toNumber'](_0x29d30a[_0x1d15('0x4b')]);this['voiceQueues'][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x2e')]=_0x307341>0x0?_0x307341:0x0;this['voiceQueues'][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x2e')]=this[_0x1d15('0x10')][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x2e')]>_[_0x1d15('0x62')](_0x29d30a['loggedin'])?_[_0x1d15('0x62')](_0x29d30a['loggedin']):this[_0x1d15('0x10')][_0x29d30a[_0x1d15('0x5f')]][_0x1d15('0x2e')];this[_0x1d15('0x48')](this[_0x1d15('0x10')][_0x29d30a['queue']]);}ami[_0x1d15('0x42')](_0x1d15('0x64'),this[_0x1d15('0x10')][_0x29d30a[_0x1d15('0x5f')]]);}}}catch(_0x2b270f){logger[_0x1d15('0x3b')](_0x1d15('0x65'),util[_0x1d15('0x41')](_0x2b270f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1d15('0x17')]=function(_0x5dd39a){this[_0x1d15('0x5d')]=!![];};VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x66')]=function(_0xd29444){};VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x19')]=function(_0x406978){try{if(this[_0x1d15('0x59')](_0x406978)){if(_[_0x1d15('0x2b')](this[_0x1d15('0xc')][_0x406978['uniqueid']])){this['queueReports'][_0x406978[_0x1d15('0x67')]]=[];this[_0x1d15('0xe')][_0x406978[_0x1d15('0x67')]]={};}var _0x454577=new QueueReport();_0x454577[_0x1d15('0x46')]=_0x406978[_0x1d15('0x5f')];_0x454577['type']=this['voiceQueues'][_0x454577[_0x1d15('0x46')]]&&this['voiceQueues'][_0x454577[_0x1d15('0x46')]][_0x1d15('0x49')]?this[_0x1d15('0x10')][_0x454577[_0x1d15('0x46')]][_0x1d15('0x49')]||_0x1d15('0x68'):_0x1d15('0x68');_0x454577[_0x1d15('0x5f')]=_0x406978[_0x1d15('0x5f')];_0x454577[_0x1d15('0x69')]=moment()[_0x1d15('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x454577[_0x1d15('0x6a')]=_0x406978[_0x1d15('0x6a')];_0x454577[_0x1d15('0x6b')]=_0x406978[_0x1d15('0x6b')];_['merge'](_0x454577,_[_0x1d15('0x6c')](_0x406978,_[_0x1d15('0x6d')](_0x454577)));this[_0x1d15('0xc')][_0x406978[_0x1d15('0x67')]]['push'](_0x454577);this['channels'][_0x406978[_0x1d15('0x67')]]=_0x454577;this[_0x1d15('0x43')](_0x454577);}}catch(_0x123ff8){logger[_0x1d15('0x3b')](_0x1d15('0x6e'),util[_0x1d15('0x41')](_0x123ff8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1d15('0x6f')]=function(_0x2fbc15){try{if(this[_0x1d15('0x59')](_0x2fbc15)){if(this[_0x1d15('0xc')][_0x2fbc15[_0x1d15('0x67')]]){var _0x689007=_[_0x1d15('0x70')](this[_0x1d15('0xc')][_0x2fbc15[_0x1d15('0x67')]]);_0x689007['queuecallercomplete']=![];_0x689007[_0x1d15('0x71')]=null;_0x689007[_0x1d15('0x72')]=_0x2fbc15[_0x1d15('0x72')];_0x689007[_0x1d15('0x73')]=_0x2fbc15['originalposition'];_0x689007[_0x1d15('0x1a')]=!![];_0x689007[_0x1d15('0x74')]=moment()['format'](_0x1d15('0x75'));_0x689007[_0x1d15('0x76')]=_0x1d15('0x77');_0x689007[_0x1d15('0x78')]=null;this[_0x1d15('0xe')][_0x2fbc15[_0x1d15('0x67')]]=_0x689007;this[_0x1d15('0x40')](_0x689007);}}}catch(_0x2af8be){logger['error'](_0x1d15('0x79'),util[_0x1d15('0x41')](_0x2af8be,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x7a')]=function(_0x29feb7){try{if(this[_0x1d15('0x59')](_0x29feb7)){if(this[_0x1d15('0xc')][_0x29feb7['uniqueid']]){var _0xeb83a=_[_0x1d15('0x70')](this['queueReports'][_0x29feb7['uniqueid']]);_0xeb83a[_0x1d15('0x7b')]=moment()[_0x1d15('0x44')](_0x1d15('0x75'));_0xeb83a[_0x1d15('0x7c')]=_0x29feb7[_0x1d15('0x7c')];_0xeb83a[_0x1d15('0x7d')]=_0x29feb7[_0x1d15('0x7d')];this[_0x1d15('0xe')][_0x29feb7[_0x1d15('0x67')]]=_0xeb83a;this[_0x1d15('0x43')](_0xeb83a);}}}catch(_0x40b07b){logger['error'](_0x1d15('0x7e'),util[_0x1d15('0x41')](_0x40b07b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d15('0x32')][_0x1d15('0x1e')]=function(_0x4626c2){try{if(this['isNotNull'](_0x4626c2)){if(this[_0x1d15('0xc')][_0x4626c2[_0x1d15('0x67')]]){var _0x3f468b=_[_0x1d15('0x70')](this[_0x1d15('0xc')][_0x4626c2[_0x1d15('0x67')]]);_0x3f468b['queuecallercomplete']=!![];_0x3f468b['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x588214){logger['error'](_0x1d15('0x7f'),util[_0x1d15('0x41')](_0x588214,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d15('0x32')]['syncAgentComplete']=function(_0x4afa8c){try{if(this[_0x1d15('0x59')](_0x4afa8c)){if(this['queueReports'][_0x4afa8c[_0x1d15('0x67')]]){var _0x4cedfc=_[_0x1d15('0x70')](this[_0x1d15('0xc')][_0x4afa8c['uniqueid']]);_0x4cedfc[_0x1d15('0x1a')]=![];_0x4cedfc[_0x1d15('0x74')]=null;_0x4cedfc[_0x1d15('0x80')]=!![];_0x4cedfc[_0x1d15('0x78')]=_0x4afa8c['membername'];_0x4cedfc[_0x1d15('0x72')]=_0x4afa8c[_0x1d15('0x72')];_0x4cedfc[_0x1d15('0x81')]=!![];_0x4cedfc['queuecallerexit']=![];_0x4cedfc[_0x1d15('0x82')]=null;if(!_0x4cedfc['transfer']){if(_0x4afa8c[_0x1d15('0x83')]==_0x1d15('0x84')){_0x4cedfc[_0x1d15('0x76')]=_0x1d15('0x85');}else{if(_[_0x1d15('0x86')](_0x4afa8c[_0x1d15('0x38')][_0x1d15('0x87')](),_0x1d15('0x88'))){if(this[_0x1d15('0xc')][_0x4afa8c['linkedid']]){var _0x20bbe7=_[_0x1d15('0x70')](this[_0x1d15('0xc')][_0x4afa8c[_0x1d15('0x89')]]);_0x20bbe7['queuecallercomplete']=![];_0x20bbe7['queuecallerexit']=!![];_0x20bbe7[_0x1d15('0x82')]=moment(_0x4cedfc['queuecallerjoinAt'])['add'](_0x4afa8c[_0x1d15('0x72')],_0x1d15('0x8a'))[_0x1d15('0x44')](_0x1d15('0x75'));_0x20bbe7[_0x1d15('0x76')]='FORWARDTRANSFER';_0x20bbe7[_0x1d15('0x84')]=!![];_0x20bbe7[_0x1d15('0x8b')]=_0x1d15('0x8c');_0x20bbe7[_0x1d15('0x8d')]=_0x4afa8c['destexten'];_0x20bbe7[_0x1d15('0x8e')]=_0x4afa8c['uniqueid'];var _0x489819=this[_0x1d15('0xc')][_0x4afa8c[_0x1d15('0x89')]];this[_0x1d15('0xc')][_0x4afa8c[_0x1d15('0x89')]]=this[_0x1d15('0xc')][_0x4afa8c[_0x1d15('0x67')]];this[_0x1d15('0xc')][_0x4afa8c[_0x1d15('0x67')]]=_0x489819;}}else{_0x4cedfc[_0x1d15('0x76')]=_0x1d15('0x8f')+_0x4afa8c[_0x1d15('0x83')]['toUpperCase']();}}}this[_0x1d15('0xe')][_0x4afa8c['uniqueid']]=_0x4cedfc;this['emitVoiceQueueChannelRemove'](_0x4cedfc);}}}catch(_0x52b21c){logger['error']('[syncAgentComplete][VoiceQueueReport]',util[_0x1d15('0x41')](_0x52b21c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d15('0x32')]['syncVarSet']=function(_0x27b227){try{if(this[_0x1d15('0x59')](_0x27b227)){this[_0x1d15('0x90')](_0x27b227['uniqueid'],_[_0x1d15('0x6d')](_0x27b227['variable'])[0x0],_0x27b227['value']);if(this[_0x1d15('0xc')][_0x27b227['uniqueid']]){var _0xbffa87=_['last'](this['queueReports'][_0x27b227['uniqueid']]);if(_0xbffa87){if(this[_0x1d15('0x59')](_0x27b227[_0x1d15('0x91')])&&this[_0x1d15('0x59')](_0x27b227['variable']['queuestatus'])){switch(_0x27b227['value']){case _0x1d15('0x92'):_0xbffa87[_0x1d15('0x93')]=![];_0xbffa87[_0x1d15('0x82')]=null;break;default:_0xbffa87[_0x1d15('0x93')]=!![];_0xbffa87[_0x1d15('0x82')]=moment()['format'](_0x1d15('0x75'));_0xbffa87['queuecallerleaveAt']=moment()['format'](_0x1d15('0x75'));}_0xbffa87['queuecallerabandon']=![];_0xbffa87[_0x1d15('0x74')]=null;_0xbffa87[_0x1d15('0x76')]=_0x27b227[_0x1d15('0x94')];this['channels'][_0x27b227['uniqueid']]=_0xbffa87;this[_0x1d15('0x40')](_0xbffa87);}else if(this[_0x1d15('0x59')](_0x27b227[_0x1d15('0x91')])&&this[_0x1d15('0x59')](_0x27b227[_0x1d15('0x91')][_0x1d15('0x95')])){if(!_0xbffa87[_0x1d15('0x1a')]){_0xbffa87[_0x1d15('0x93')]=!![];_0xbffa87[_0x1d15('0x82')]=moment()[_0x1d15('0x44')](_0x1d15('0x75'));_0xbffa87[_0x1d15('0x76')]=_0x1d15('0x96');_0xbffa87[_0x1d15('0x7b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1d15('0xe')][_0x27b227[_0x1d15('0x67')]]=_0xbffa87;}}_0xbffa87[_0x1d15('0x12')]=this['variables'][_0x27b227[_0x1d15('0x67')]];}}}}catch(_0x26dc6c){logger[_0x1d15('0x3b')](_0x1d15('0x97'),util[_0x1d15('0x41')](_0x26dc6c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d15('0x32')]['addVariable']=function(_0x595f3d,_0x4f4ebe,_0x1fe827){var _0x403418=[_0x1d15('0x98'),_0x1d15('0x99'),_0x1d15('0x9a'),'rtpaudioqosjitterbridged',_0x1d15('0x9b'),_0x1d15('0x9c'),_0x1d15('0x9d'),_0x1d15('0x9e'),_0x1d15('0x9f'),_0x1d15('0xa0'),_0x1d15('0xa1'),_0x1d15('0xa2'),_0x1d15('0xa3'),_0x1d15('0xa4'),_0x1d15('0xa5'),_0x1d15('0xa6'),_0x1d15('0xa7'),_0x1d15('0xa8'),_0x1d15('0xa9')];if(!_['isNil'](_0x4f4ebe)&&!_[_0x1d15('0xaa')](_0x403418,_0x4f4ebe)){if(_[_0x1d15('0x2b')](this[_0x1d15('0x12')][_0x595f3d])){this[_0x1d15('0x12')][_0x595f3d]={};}this['variables'][_0x595f3d][_0x4f4ebe]=_0x1fe827;}};VoiceQueueReport[_0x1d15('0x32')]['syncHangup']=function(_0x343161){try{if(this[_0x1d15('0x59')](_0x343161)){if(this[_0x1d15('0xc')][_0x343161[_0x1d15('0x67')]]){for(var _0x3d077a=0x0,_0x93b793={};_0x3d077a0x0?_0x893606:0x0;this[_0x5d25('0xf')][_0x5da08f[_0x5d25('0x5c')]][_0x5d25('0x2b')]=this[_0x5d25('0xf')][_0x5da08f[_0x5d25('0x5c')]][_0x5d25('0x2b')]>_[_0x5d25('0x5d')](_0x5da08f[_0x5d25('0x60')])?_['toNumber'](_0x5da08f['loggedin']):this[_0x5d25('0xf')][_0x5da08f['queue']][_0x5d25('0x2b')];this[_0x5d25('0x46')](this['voiceQueues'][_0x5da08f[_0x5d25('0x5c')]]);}ami['emit'](_0x5d25('0x61'),this[_0x5d25('0xf')][_0x5da08f[_0x5d25('0x5c')]]);}}}catch(_0xc546f2){logger['error'](_0x5d25('0x62'),util['inspect'](_0xc546f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5d25('0x2f')][_0x5d25('0x16')]=function(_0x21b498){this[_0x5d25('0x10')]=!![];};VoiceQueueReport[_0x5d25('0x2f')][_0x5d25('0x63')]=function(_0x1e2b12){};VoiceQueueReport[_0x5d25('0x2f')][_0x5d25('0x18')]=function(_0x419160){try{if(this['isNotNull'](_0x419160)){if(_[_0x5d25('0x27')](this[_0x5d25('0xc')][_0x419160['uniqueid']])){this['queueReports'][_0x419160[_0x5d25('0x64')]]=[];this[_0x5d25('0xd')][_0x419160[_0x5d25('0x64')]]={};}var _0x23c293=new QueueReport();_0x23c293['name']=_0x419160[_0x5d25('0x5c')];_0x23c293[_0x5d25('0x50')]=this[_0x5d25('0xf')][_0x23c293[_0x5d25('0x43')]]&&this['voiceQueues'][_0x23c293[_0x5d25('0x43')]][_0x5d25('0x50')]?this[_0x5d25('0xf')][_0x23c293[_0x5d25('0x43')]][_0x5d25('0x50')]||_0x5d25('0x47'):_0x5d25('0x47');_0x23c293[_0x5d25('0x5c')]=_0x419160[_0x5d25('0x5c')];_0x23c293[_0x5d25('0x65')]=moment()[_0x5d25('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x23c293[_0x5d25('0x66')]=_0x419160[_0x5d25('0x66')];_0x23c293[_0x5d25('0x67')]=_0x419160[_0x5d25('0x67')];_[_0x5d25('0x68')](_0x23c293,_[_0x5d25('0x69')](_0x419160,_['keys'](_0x23c293)));this[_0x5d25('0xc')][_0x419160[_0x5d25('0x64')]][_0x5d25('0x6a')](_0x23c293);this[_0x5d25('0xd')][_0x419160['uniqueid']]=_0x23c293;this[_0x5d25('0x6b')](_0x23c293);}}catch(_0x25e97f){logger[_0x5d25('0x37')](_0x5d25('0x6c'),util[_0x5d25('0x3f')](_0x25e97f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x522732){try{if(this[_0x5d25('0x5b')](_0x522732)){if(this[_0x5d25('0xc')][_0x522732[_0x5d25('0x64')]]){var _0x5bed5e=_[_0x5d25('0x6d')](this[_0x5d25('0xc')][_0x522732[_0x5d25('0x64')]]);_0x5bed5e['queuecallercomplete']=![];_0x5bed5e[_0x5d25('0x6e')]=null;_0x5bed5e['holdtime']=_0x522732['holdtime'];_0x5bed5e[_0x5d25('0x6f')]=_0x522732['originalposition'];_0x5bed5e[_0x5d25('0x19')]=!![];_0x5bed5e[_0x5d25('0x70')]=moment()[_0x5d25('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x5bed5e['queuecallerexitreason']='ABANDONED';_0x5bed5e['lastAssignedTo']=null;this[_0x5d25('0xd')][_0x522732[_0x5d25('0x64')]]=_0x5bed5e;this[_0x5d25('0x3e')](_0x5bed5e);}}}catch(_0x25c978){logger[_0x5d25('0x37')](_0x5d25('0x71'),util[_0x5d25('0x3f')](_0x25c978,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5d25('0x2f')][_0x5d25('0x1b')]=function(_0x20f90c){try{if(this[_0x5d25('0x5b')](_0x20f90c)){if(this[_0x5d25('0xc')][_0x20f90c[_0x5d25('0x64')]]){var _0x510ea8=_['last'](this[_0x5d25('0xc')][_0x20f90c[_0x5d25('0x64')]]);_0x510ea8['queuecallerleaveAt']=moment()[_0x5d25('0x41')](_0x5d25('0x72'));_0x510ea8[_0x5d25('0x73')]=_0x20f90c[_0x5d25('0x73')];_0x510ea8[_0x5d25('0x74')]=_0x20f90c[_0x5d25('0x74')];this[_0x5d25('0xd')][_0x20f90c[_0x5d25('0x64')]]=_0x510ea8;this[_0x5d25('0x6b')](_0x510ea8);}}}catch(_0x3bc71d){logger[_0x5d25('0x37')](_0x5d25('0x75'),util[_0x5d25('0x3f')](_0x3bc71d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5d25('0x2f')][_0x5d25('0x1e')]=function(_0x40e2f0){try{if(this[_0x5d25('0x5b')](_0x40e2f0)){if(this[_0x5d25('0xc')][_0x40e2f0[_0x5d25('0x64')]]){var _0x3d7c75=_[_0x5d25('0x6d')](this[_0x5d25('0xc')][_0x40e2f0[_0x5d25('0x64')]]);_0x3d7c75[_0x5d25('0x76')]=!![];_0x3d7c75['queuecallerexitreason']=_0x5d25('0x77');}}}catch(_0x5303aa){logger['error']('[syncAgentConnect][VoiceQueueReport]',util['inspect'](_0x5303aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5d25('0x2f')][_0x5d25('0x1d')]=function(_0xb6d3d1){try{if(this[_0x5d25('0x5b')](_0xb6d3d1)){if(this[_0x5d25('0xc')][_0xb6d3d1['uniqueid']]){var _0x32ed3d=_[_0x5d25('0x6d')](this[_0x5d25('0xc')][_0xb6d3d1[_0x5d25('0x64')]]);_0x32ed3d[_0x5d25('0x19')]=![];_0x32ed3d[_0x5d25('0x70')]=null;_0x32ed3d[_0x5d25('0x78')]=!![];_0x32ed3d[_0x5d25('0x79')]=_0xb6d3d1[_0x5d25('0x7a')];_0x32ed3d['holdtime']=_0xb6d3d1[_0x5d25('0x7b')];_0x32ed3d[_0x5d25('0x76')]=!![];_0x32ed3d['queuecallerexit']=![];_0x32ed3d['queuecallerexitAt']=null;if(!_0x32ed3d[_0x5d25('0x7c')]){if(_0xb6d3d1[_0x5d25('0x7d')]==_0x5d25('0x7c')){_0x32ed3d[_0x5d25('0x7e')]=_0x5d25('0x7f');}else{if(_[_0x5d25('0x80')](_0xb6d3d1[_0x5d25('0x35')]['toLowerCase'](),_0x5d25('0x81'))){if(this[_0x5d25('0xc')][_0xb6d3d1['linkedid']]){var _0xa7d843=_['last'](this[_0x5d25('0xc')][_0xb6d3d1['linkedid']]);_0xa7d843[_0x5d25('0x76')]=![];_0xa7d843[_0x5d25('0x82')]=!![];_0xa7d843[_0x5d25('0x83')]=moment(_0x32ed3d[_0x5d25('0x65')])[_0x5d25('0x84')](_0xb6d3d1['holdtime'],_0x5d25('0x85'))[_0x5d25('0x41')](_0x5d25('0x72'));_0xa7d843[_0x5d25('0x7e')]='FORWARDTRANSFER';_0xa7d843['transfer']=!![];_0xa7d843[_0x5d25('0x86')]=_0x5d25('0x87');_0xa7d843[_0x5d25('0x88')]=_0xb6d3d1[_0x5d25('0x89')];_0xa7d843[_0x5d25('0x8a')]=_0xb6d3d1[_0x5d25('0x64')];var _0x25b88e=this[_0x5d25('0xc')][_0xb6d3d1[_0x5d25('0x8b')]];this[_0x5d25('0xc')][_0xb6d3d1['linkedid']]=this[_0x5d25('0xc')][_0xb6d3d1['uniqueid']];this['queueReports'][_0xb6d3d1[_0x5d25('0x64')]]=_0x25b88e;}}else{_0x32ed3d['queuecallerexitreason']=_0x5d25('0x8c')+_0xb6d3d1[_0x5d25('0x7d')][_0x5d25('0x8d')]();}}}this[_0x5d25('0xd')][_0xb6d3d1[_0x5d25('0x64')]]=_0x32ed3d;this['emitVoiceQueueChannelRemove'](_0x32ed3d);}}}catch(_0x4104bc){logger[_0x5d25('0x37')](_0x5d25('0x8e'),util[_0x5d25('0x3f')](_0x4104bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5d25('0x2f')][_0x5d25('0x8f')]=function(_0x4e3f00){try{if(this['isNotNull'](_0x4e3f00)){this[_0x5d25('0x90')](_0x4e3f00[_0x5d25('0x64')],_[_0x5d25('0x91')](_0x4e3f00[_0x5d25('0x92')])[0x0],_0x4e3f00[_0x5d25('0x93')]);if(this['queueReports'][_0x4e3f00[_0x5d25('0x64')]]){var _0x4215eb=_[_0x5d25('0x6d')](this[_0x5d25('0xc')][_0x4e3f00['uniqueid']]);if(_0x4215eb){if(this['isNotNull'](_0x4e3f00[_0x5d25('0x92')])&&this[_0x5d25('0x5b')](_0x4e3f00['variable'][_0x5d25('0x94')])){switch(_0x4e3f00[_0x5d25('0x93')]){case _0x5d25('0x95'):_0x4215eb['queuecallerexit']=![];_0x4215eb['queuecallerexitAt']=null;break;default:_0x4215eb['queuecallerexit']=!![];_0x4215eb[_0x5d25('0x83')]=moment()[_0x5d25('0x41')](_0x5d25('0x72'));_0x4215eb[_0x5d25('0x96')]=moment()['format'](_0x5d25('0x72'));}_0x4215eb[_0x5d25('0x19')]=![];_0x4215eb[_0x5d25('0x70')]=null;_0x4215eb[_0x5d25('0x7e')]=_0x4e3f00['value'];this['channels'][_0x4e3f00[_0x5d25('0x64')]]=_0x4215eb;this['emitVoiceQueueChannelRemove'](_0x4215eb);}else if(this[_0x5d25('0x5b')](_0x4e3f00[_0x5d25('0x92')])&&this[_0x5d25('0x5b')](_0x4e3f00[_0x5d25('0x92')]['queueposition'])){if(!_0x4215eb[_0x5d25('0x19')]){_0x4215eb[_0x5d25('0x82')]=!![];_0x4215eb['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4215eb[_0x5d25('0x7e')]=_0x5d25('0x97');_0x4215eb[_0x5d25('0x96')]=moment()[_0x5d25('0x41')](_0x5d25('0x72'));this[_0x5d25('0xd')][_0x4e3f00[_0x5d25('0x64')]]=_0x4215eb;}}_0x4215eb[_0x5d25('0x98')]=this[_0x5d25('0x98')][_0x4e3f00[_0x5d25('0x64')]];}}}}catch(_0xac3e61){logger[_0x5d25('0x37')](_0x5d25('0x99'),util[_0x5d25('0x3f')](_0xac3e61,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5d25('0x90')]=function(_0x221cee,_0x434557,_0x36afcd){var _0x1b4b44=[_0x5d25('0x9a'),_0x5d25('0x9b'),'rtpaudioqosjitter',_0x5d25('0x9c'),_0x5d25('0x9d'),'rtpaudioqoslossbridged',_0x5d25('0x9e'),_0x5d25('0x9f'),_0x5d25('0xa0'),_0x5d25('0xa1'),_0x5d25('0xa2'),'bridgepvtcallid',_0x5d25('0xa3'),_0x5d25('0xa4'),_0x5d25('0xa5'),_0x5d25('0xa6'),_0x5d25('0x7a'),_0x5d25('0xa7'),_0x5d25('0xa8')];if(!_[_0x5d25('0xa9')](_0x434557)&&!_[_0x5d25('0xaa')](_0x1b4b44,_0x434557)){if(_[_0x5d25('0x27')](this[_0x5d25('0x98')][_0x221cee])){this[_0x5d25('0x98')][_0x221cee]={};}this[_0x5d25('0x98')][_0x221cee][_0x434557]=_0x36afcd;}};VoiceQueueReport[_0x5d25('0x2f')][_0x5d25('0x20')]=function(_0x1bbbeb){try{if(this[_0x5d25('0x5b')](_0x1bbbeb)){if(this[_0x5d25('0xc')][_0x1bbbeb[_0x5d25('0x64')]]){for(var _0x232430=0x0,_0x257775={};_0x232430=0x0?moment(_0x1c4515['endtime'])[_0x7d77('0xb')](_0x1c4515[_0x7d77('0x16')],_0x7d77('0xc')):null,'data1':_0x7d77('0x17'),'data2':_0x1c4515[_0x7d77('0x18')],'data3':_0x1c4515[_0x7d77('0xf')],'data4':_0x1c4515[_0x7d77('0x19')]||null,'role':_0x7d77('0x11'),'internal':_0x1c4515[_0x7d77('0x18')]?_[_0x7d77('0x12')](_0x1c4515[_0x7d77('0x18')]):undefined,'uniqueid':_0x1c4515[_0x7d77('0x13')]},'log':_0x7d77('0x4')});}; \ No newline at end of file +var _0x1558=['starttime','endtime','seconds','outbound','util','../client','voiceQueueReport','queuecallerexitAt','CreateMemberReport','lastAssignedTo','isNil','format','SIP/%s','interface','diff','queuecallerleaveAt','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','voiceDialReport','Request','voice'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1558,0x170));var _0x8155=function(_0x592df4,_0x4e719b){_0x592df4=_0x592df4-0x0;var _0x3b4fe4=_0x1558[_0x592df4];return _0x3b4fe4;};'use strict';var moment=require('moment');var _=require('lodash');var util=require(_0x8155('0x0'));var client=require(_0x8155('0x1'));exports[_0x8155('0x2')]=function(_0x223359){var _0x5d5944=_0x223359['queuecallercompleteAt']||_0x223359[_0x8155('0x3')];return client['Request'](_0x8155('0x4'),{'body':{'channel':'voice','membername':_0x223359[_0x8155('0x5')],'interface':_[_0x8155('0x6')](_0x223359['interface'])?util[_0x8155('0x7')](_0x8155('0x8'),_0x223359[_0x8155('0x5')]):_0x223359[_0x8155('0x9')],'type':'TALKING','enterAt':_0x223359['queuecallerleaveAt'],'exitAt':_0x5d5944,'duration':moment(_0x5d5944)[_0x8155('0xa')](_0x223359[_0x8155('0xb')],'seconds'),'data1':_0x8155('0xc'),'data2':_0x223359[_0x8155('0xd')],'data3':_0x223359[_0x8155('0xe')],'data4':null,'data5':_0x223359[_0x8155('0xf')],'role':_0x8155('0x10'),'internal':_0x223359[_0x8155('0x11')]?_['toNumber'](_0x223359[_0x8155('0x11')]):undefined,'uniqueid':_0x223359[_0x8155('0x12')]},'log':_0x8155('0x4')});};exports[_0x8155('0x13')]=function(_0x109f73){return client[_0x8155('0x14')]('CreateMemberReport',{'body':{'channel':_0x8155('0x15'),'membername':_0x109f73['membername'],'interface':_0x109f73[_0x8155('0x9')],'type':'TALKING','enterAt':_0x109f73[_0x8155('0x16')],'exitAt':_0x109f73[_0x8155('0x17')],'duration':moment(_0x109f73[_0x8155('0x17')])[_0x8155('0xa')](_0x109f73[_0x8155('0x16')],'seconds')>=0x0?moment(_0x109f73['endtime'])[_0x8155('0xa')](_0x109f73[_0x8155('0x16')],_0x8155('0x18')):null,'data1':_0x8155('0x19'),'data2':_0x109f73['accountcode'],'data3':_0x109f73[_0x8155('0xe')],'data4':_0x109f73['dialstring']||null,'role':_0x8155('0x10'),'internal':_0x109f73[_0x8155('0x11')]?_['toNumber'](_0x109f73[_0x8155('0x11')]):undefined,'uniqueid':_0x109f73[_0x8155('0x12')]},'log':_0x8155('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ee43c14..cfe579c 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 _0x6722=['html','getTemplates','Request','GetTemplate','name'];(function(_0x1a24b8,_0x20079b){var _0x55ed64=function(_0x29734a){while(--_0x29734a){_0x1a24b8['push'](_0x1a24b8['shift']());}};_0x55ed64(++_0x20079b);}(_0x6722,0x132));var _0x2672=function(_0x401805,_0x2905fc){_0x401805=_0x401805-0x0;var _0x5b3a3d=_0x6722[_0x401805];return _0x5b3a3d;};'use strict';var client=require('../client');exports[_0x2672('0x0')]=function(_0x364d1d){return function(_0x1a14d9){return client[_0x2672('0x1')](_0x2672('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2672('0x3'),_0x2672('0x4')]},'log':_0x2672('0x2')});};}; \ No newline at end of file +var _0xd422=['Request','GetTemplate','name','html','getTemplates'];(function(_0x22cc3a,_0x3a807e){var _0x160261=function(_0x1017d0){while(--_0x1017d0){_0x22cc3a['push'](_0x22cc3a['shift']());}};_0x160261(++_0x3a807e);}(_0xd422,0x9f));var _0x2d42=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xd422[_0x38537f];return _0x141e23;};'use strict';var client=require('../client');exports[_0x2d42('0x0')]=function(_0x264134){return function(_0x79292c){return client[_0x2d42('0x1')](_0x2d42('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2d42('0x3'),_0x2d42('0x4')]},'log':_0x2d42('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 821ec45..301208f 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(_0x34dd20,_0xe7b817){var _0x4c2a01=function(_0x5980d5){while(--_0x5980d5){_0x34dd20['push'](_0x34dd20['shift']());}};_0x4c2a01(++_0xe7b817);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x23cef7,_0x47d9ba){var _0x5caa48=function(_0x56a547){while(--_0x56a547){_0x23cef7['push'](_0x23cef7['shift']());}};_0x5caa48(++_0x47d9ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_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 2ad6bd1..a8982e6 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 _0x206e=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0x206e,0x89));var _0xe206=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0x206e[_0x296e0e];return _0x101c03;};'use strict';var client=require(_0xe206('0x0'));exports[_0xe206('0x1')]=function(_0x3d8ad5){return function(_0x376d3e){return client[_0xe206('0x2')](_0xe206('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe206('0x4'),_0xe206('0x5')]},'log':_0xe206('0x3')});};}; \ No newline at end of file +var _0xdb5f=['registry','../client','getTrunks','Request','GetTrunk','name'];(function(_0x52fa77,_0x2b381b){var _0x477535=function(_0x5323b5){while(--_0x5323b5){_0x52fa77['push'](_0x52fa77['shift']());}};_0x477535(++_0x2b381b);}(_0xdb5f,0x1e7));var _0xfdb5=function(_0x1473ab,_0x5e68b8){_0x1473ab=_0x1473ab-0x0;var _0x5bdc0d=_0xdb5f[_0x1473ab];return _0x5bdc0d;};'use strict';var client=require(_0xfdb5('0x0'));exports[_0xfdb5('0x1')]=function(_0x179f6f){return function(_0x56c65b){return client[_0xfdb5('0x2')](_0xfdb5('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xfdb5('0x4'),_0xfdb5('0x5')]},'log':_0xfdb5('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 03d6718..9d1a2ff 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 _0x4af4=['GetUser','agent','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','Request','telephone','internal','getTelephones','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','email','lastPauseAt','interface','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4af4,0x14f));var _0x44af=function(_0x6e5de,_0x6dd40b){_0x6e5de=_0x6e5de-0x0;var _0x140ab0=_0x4af4[_0x6e5de];return _0x140ab0;};'use strict';var client=require('../client');exports[_0x44af('0x0')]=function(){return function(){return client['Request'](_0x44af('0x1'),{'options':{'raw':![],'where':{'role':_0x44af('0x2')},'attributes':['id',_0x44af('0x3'),'email',_0x44af('0x4'),_0x44af('0x5'),_0x44af('0x6'),_0x44af('0x7'),_0x44af('0x8'),'lastPauseAt',_0x44af('0x9'),_0x44af('0xa'),'mobile','interface']},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client[_0x44af('0xb')](_0x44af('0x1'),{'options':{'raw':!![],'where':{'role':_0x44af('0xc')},'attributes':['id',_0x44af('0x3'),_0x44af('0x4'),_0x44af('0xd')]},'log':_0x44af('0xe')});};};exports[_0x44af('0xf')]=function(_0x8be808,_0xb63cf9,_0x206768){return client[_0x44af('0xb')](_0x44af('0x10'),{'body':{'type':_0xb63cf9,'uniqueid':_0x206768},'options':{'where':{'id':_0x8be808['id']}},'log':_0x44af('0xf')});};exports[_0x44af('0x11')]=function(_0xe28b1f){return client['Request'](_0x44af('0x12'),{'body':{},'options':{'where':{'id':_0xe28b1f['id']}},'log':'savePause'});};exports[_0x44af('0x13')]=function(_0x419a73){return client[_0x44af('0xb')](_0x44af('0x14'),{'options':{'raw':![],'where':{'role':_0x44af('0x2'),'id':_0x419a73},'attributes':['id','name',_0x44af('0x15'),'accountcode',_0x44af('0x5'),'online',_0x44af('0x7'),_0x44af('0x8'),_0x44af('0x16'),'voicePause',_0x44af('0x17')]},'log':_0x44af('0x13')});}; \ No newline at end of file +var _0x7376=['getAgent','getAgents','GetUser','agent','accountcode','fullname','pauseType','lastPauseAt','voicePause','mobile','interface','getTelephones','Request','internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','name','online'];(function(_0x2b20c7,_0x278d49){var _0x3a6e02=function(_0x485469){while(--_0x485469){_0x2b20c7['push'](_0x2b20c7['shift']());}};_0x3a6e02(++_0x278d49);}(_0x7376,0x17b));var _0x6737=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7376[_0x8c43de];return _0xa6591b;};'use strict';var client=require('../client');exports[_0x6737('0x0')]=function(){return function(){return client['Request'](_0x6737('0x1'),{'options':{'raw':![],'where':{'role':_0x6737('0x2')},'attributes':['id','name','email',_0x6737('0x3'),_0x6737('0x4'),'online','lastLoginAt',_0x6737('0x5'),_0x6737('0x6'),_0x6737('0x7'),'phone',_0x6737('0x8'),_0x6737('0x9')]},'log':_0x6737('0x0')});};};exports[_0x6737('0xa')]=function(){return function(){return client[_0x6737('0xb')](_0x6737('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name',_0x6737('0x3'),_0x6737('0xc')]},'log':_0x6737('0xa')});};};exports[_0x6737('0xd')]=function(_0x3c8a93,_0x574d2b,_0x3a3123){return client['Request'](_0x6737('0xe'),{'body':{'type':_0x574d2b,'uniqueid':_0x3a3123},'options':{'where':{'id':_0x3c8a93['id']}},'log':_0x6737('0xd')});};exports[_0x6737('0xf')]=function(_0x999ab0){return client[_0x6737('0xb')](_0x6737('0x10'),{'body':{},'options':{'where':{'id':_0x999ab0['id']}},'log':_0x6737('0xd')});};exports['getAgent']=function(_0x278f37){return client['Request'](_0x6737('0x11'),{'options':{'raw':![],'where':{'role':_0x6737('0x2'),'id':_0x278f37},'attributes':['id',_0x6737('0x12'),'email',_0x6737('0x3'),_0x6737('0x4'),_0x6737('0x13'),'lastLoginAt',_0x6737('0x5'),_0x6737('0x6'),_0x6737('0x7'),_0x6737('0x9')]},'log':_0x6737('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index e5edffa..d0e73b7 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 _0xeb3d=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x1ad81d,_0x47201f){var _0x1749ef=function(_0x544e78){while(--_0x544e78){_0x1ad81d['push'](_0x1ad81d['shift']());}};_0x1749ef(++_0x47201f);}(_0xeb3d,0x1b0));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xdeb3('0x0'));exports['create']=function(_0x8fbd61){return client[_0xdeb3('0x1')](_0xdeb3('0x2'),{'body':_0x8fbd61,'log':'CreateVoiceAgentReport'});};exports[_0xdeb3('0x3')]=function(_0x5b31eb,_0x311a70,_0x40a2ac){return client[_0xdeb3('0x1')](_0xdeb3('0x4'),{'body':_0x5b31eb,'options':{'where':{'uniqueid':_0x311a70,'interface':_0x40a2ac}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xbebd=['../client','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x40e13e,_0x376d13){var _0x5db39e=function(_0x2dc3f6){while(--_0x2dc3f6){_0x40e13e['push'](_0x40e13e['shift']());}};_0x5db39e(++_0x376d13);}(_0xbebd,0x1aa));var _0xdbeb=function(_0x5a6431,_0x32d368){_0x5a6431=_0x5a6431-0x0;var _0x65ddf1=_0xbebd[_0x5a6431];return _0x65ddf1;};'use strict';var client=require(_0xdbeb('0x0'));exports['create']=function(_0x65191b){return client['Request'](_0xdbeb('0x1'),{'body':_0x65191b,'log':_0xdbeb('0x1')});};exports['update']=function(_0x1a42b2,_0x3b9211,_0x202f9c){return client['Request'](_0xdbeb('0x2'),{'body':_0x1a42b2,'options':{'where':{'uniqueid':_0x3b9211,'interface':_0x202f9c}},'log':_0xdbeb('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 4c04b19..cbe27cf 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 _0x3add=['duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','merge','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3add,0x13e));var _0xd3ad=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x3add[_0x381589];return _0x2a075d;};'use strict';var moment=require(_0xd3ad('0x0'));var util=require(_0xd3ad('0x1'));var _=require(_0xd3ad('0x2'));var client=require('../client');exports[_0xd3ad('0x3')]=function(_0x3f7cd5){return client[_0xd3ad('0x4')](_0xd3ad('0x5'),{'body':_[_0xd3ad('0x6')](_0x3f7cd5,{'source':_0x3f7cd5['calleridnum'],'destinationcontext':_0x3f7cd5['context'],'callerid':_0x3f7cd5[_0xd3ad('0x7')],'amaflags':_0xd3ad('0x8')}),'log':_0xd3ad('0x5')});};exports[_0xd3ad('0x9')]=function(){return function(){return client[_0xd3ad('0x4')](_0xd3ad('0xa'),{'options':{'where':{'type':[_0xd3ad('0xb')],'createdAt':{'$between':[moment()[_0xd3ad('0xc')](_0xd3ad('0xd'))[_0xd3ad('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xd3ad('0xd'))[_0xd3ad('0xe')](_0xd3ad('0xf'))]}},'attributes':[_0xd3ad('0x10'),_0xd3ad('0x11'),_0xd3ad('0x12'),_0xd3ad('0x13')]},'log':_0xd3ad('0x14')});};}; \ No newline at end of file +var _0xc4d5=['duration','billableseconds','GetVoiceCallReports','moment','util','../client','Request','CreateVoiceCallReport','calleridnum','callerid','DOCUMENTATION','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition'];(function(_0x5c879e,_0xe58074){var _0x30942b=function(_0x535b57){while(--_0x535b57){_0x5c879e['push'](_0x5c879e['shift']());}};_0x30942b(++_0xe58074);}(_0xc4d5,0x192));var _0x5c4d=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0xc4d5[_0x5179a5];return _0x15c8ce;};'use strict';var moment=require(_0x5c4d('0x0'));var util=require(_0x5c4d('0x1'));var _=require('lodash');var client=require(_0x5c4d('0x2'));exports['create']=function(_0xfda578){return client[_0x5c4d('0x3')](_0x5c4d('0x4'),{'body':_['merge'](_0xfda578,{'source':_0xfda578[_0x5c4d('0x5')],'destinationcontext':_0xfda578['context'],'callerid':_0xfda578[_0x5c4d('0x6')],'amaflags':_0x5c4d('0x7')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x5c4d('0x8')],'createdAt':{'$between':[moment()[_0x5c4d('0x9')](_0x5c4d('0xa'))[_0x5c4d('0xb')](_0x5c4d('0xc')),moment()[_0x5c4d('0xd')](_0x5c4d('0xa'))[_0x5c4d('0xb')](_0x5c4d('0xc'))]}},'attributes':[_0x5c4d('0xe'),_0x5c4d('0xf'),_0x5c4d('0x10'),_0x5c4d('0x11')]},'log':_0x5c4d('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 12d7351..8c563b4 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 _0x2993=['../client','Request','CreateVoiceDialReport'];(function(_0x49b44d,_0xb8e24f){var _0x399a27=function(_0x47dc8b){while(--_0x47dc8b){_0x49b44d['push'](_0x49b44d['shift']());}};_0x399a27(++_0xb8e24f);}(_0x2993,0x1a7));var _0x3299=function(_0x38be5e,_0x5f227a){_0x38be5e=_0x38be5e-0x0;var _0x53604f=_0x2993[_0x38be5e];return _0x53604f;};'use strict';var client=require(_0x3299('0x0'));exports['create']=function(_0x5380fd){return client[_0x3299('0x1')](_0x3299('0x2'),{'body':_0x5380fd,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x72e2=['Request','CreateVoiceDialReport','../client'];(function(_0xd9e788,_0x479b3e){var _0x23071e=function(_0x59bfcc){while(--_0x59bfcc){_0xd9e788['push'](_0xd9e788['shift']());}};_0x23071e(++_0x479b3e);}(_0x72e2,0x11c));var _0x272e=function(_0x53011f,_0x11e2a9){_0x53011f=_0x53011f-0x0;var _0x351ffd=_0x72e2[_0x53011f];return _0x351ffd;};'use strict';var client=require(_0x272e('0x0'));exports['create']=function(_0x5bfbc2){return client[_0x272e('0x1')](_0x272e('0x2'),{'body':_0x5bfbc2,'log':_0x272e('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index e323baa..7b7ee97 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 _0xc6f4=['../client','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc6f4,0x78));var _0x4c6f=function(_0x5e2476,_0x30deec){_0x5e2476=_0x5e2476-0x0;var _0x1c44d5=_0xc6f4[_0x5e2476];return _0x1c44d5;};'use strict';var client=require(_0x4c6f('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x4c6f('0x1')](_0x4c6f('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4c6f('0x3'),_0x4c6f('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x38bf=['../client','recordingFormat'];(function(_0x46f67b,_0x86259){var _0xe2933d=function(_0x47429b){while(--_0x47429b){_0x46f67b['push'](_0x46f67b['shift']());}};_0xe2933d(++_0x86259);}(_0x38bf,0xce));var _0xf38b=function(_0x55f584,_0x47602a){_0x55f584=_0x55f584-0x0;var _0x46e02a=_0x38bf[_0x55f584];return _0x46e02a;};'use strict';var client=require(_0xf38b('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0xf38b('0x1')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 077e781..e228bde 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 _0xa4db=['dialAMDMaximumNumberOfWords','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialCutDigit','Trunk','mandatoryDispositionPause','active','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x57ead4,_0x904b24){var _0x4f300e=function(_0x1e1804){while(--_0x1e1804){_0x57ead4['push'](_0x57ead4['shift']());}};_0x4f300e(++_0x904b24);}(_0xa4db,0x139));var _0xba4d=function(_0x51a02a,_0x4de650){_0x51a02a=_0x51a02a-0x0;var _0x19896f=_0xa4db[_0x51a02a];return _0x19896f;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client['Request'](_0xba4d('0x0'),{'options':{'raw':![],'attributes':['id',_0xba4d('0x1'),_0xba4d('0x2'),_0xba4d('0x3'),_0xba4d('0x4'),_0xba4d('0x5'),'type',_0xba4d('0x6'),'dialMethod',_0xba4d('0x7'),_0xba4d('0x8'),_0xba4d('0x9'),_0xba4d('0xa'),_0xba4d('0xb'),_0xba4d('0xc'),_0xba4d('0xd'),_0xba4d('0xe'),_0xba4d('0xf'),'dialQueueOptions',_0xba4d('0x10'),_0xba4d('0x11'),_0xba4d('0x12'),_0xba4d('0x13'),_0xba4d('0x14'),_0xba4d('0x15'),_0xba4d('0x16'),_0xba4d('0x17'),_0xba4d('0x18'),_0xba4d('0x19'),_0xba4d('0x1a'),_0xba4d('0x1b'),'dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence',_0xba4d('0x1c'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xba4d('0x1d'),_0xba4d('0x1e'),_0xba4d('0x1f'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout',_0xba4d('0x20'),_0xba4d('0x21'),_0xba4d('0x22'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber',_0xba4d('0x23'),'mandatoryDisposition'],'include':[{'model':_0xba4d('0x24'),'as':'Trunk','attributes':['id','name','callerid','active']},{'model':'Pause','as':_0xba4d('0x25'),'attributes':['id',_0xba4d('0x1')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0xba4d('0x1'),'callerid',_0xba4d('0x26')]},{'model':_0xba4d('0x27'),'as':_0xba4d('0x27'),'attributes':['id',_0xba4d('0x1')],'include':[{'model':_0xba4d('0x27'),'as':_0xba4d('0x28'),'attributes':['id',_0xba4d('0x1'),_0xba4d('0x29')]}]}]},'log':_0xba4d('0x2a')});};}; \ No newline at end of file +var _0xe1e3=['dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','Trunk','active','Pause','mandatoryDispositionPause','name','callerid','Interval','interval','../client','getVoiceQueues','GetVoiceQueue','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x178844,_0x41ea33){var _0x2ed85f=function(_0x50e486){while(--_0x50e486){_0x178844['push'](_0x178844['shift']());}};_0x2ed85f(++_0x41ea33);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x59702c,_0x2e969c){_0x59702c=_0x59702c-0x0;var _0x5eca34=_0xe1e3[_0x59702c];return _0x5eca34;};'use strict';var client=require(_0x3e1e('0x0'));exports[_0x3e1e('0x1')]=function(){return function(){return client['Request'](_0x3e1e('0x2'),{'options':{'raw':![],'attributes':['id','name','acw',_0x3e1e('0x3'),'autopause',_0x3e1e('0x4'),_0x3e1e('0x5'),_0x3e1e('0x6'),_0x3e1e('0x7'),_0x3e1e('0x8'),_0x3e1e('0x9'),'dialPowerLevel',_0x3e1e('0xa'),_0x3e1e('0xb'),_0x3e1e('0xc'),_0x3e1e('0xd'),_0x3e1e('0xe'),_0x3e1e('0xf'),'dialQueueOptions','dialQueueTimeout','dialQueueProject',_0x3e1e('0x10'),'dialCongestionRetryFrequency',_0x3e1e('0x11'),_0x3e1e('0x12'),_0x3e1e('0x13'),'dialNoAnswerRetryFrequency',_0x3e1e('0x14'),'dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive',_0x3e1e('0x15'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x3e1e('0x16'),_0x3e1e('0x17'),_0x3e1e('0x18'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x3e1e('0x19'),_0x3e1e('0x1a'),'dialRecallMeTimeout',_0x3e1e('0x1b'),_0x3e1e('0x1c'),'dialAgiAfterHangupAgent',_0x3e1e('0x1d'),'dialQueueProject2',_0x3e1e('0x4'),_0x3e1e('0x1e'),_0x3e1e('0x1f'),_0x3e1e('0x20'),_0x3e1e('0x21')],'include':[{'model':_0x3e1e('0x22'),'as':'Trunk','attributes':['id','name','callerid',_0x3e1e('0x23')]},{'model':_0x3e1e('0x24'),'as':_0x3e1e('0x25'),'attributes':['id','name']},{'model':_0x3e1e('0x22'),'as':'TrunkBackup','attributes':['id',_0x3e1e('0x26'),_0x3e1e('0x27'),_0x3e1e('0x23')]},{'model':'Interval','as':_0x3e1e('0x28'),'attributes':['id',_0x3e1e('0x26')],'include':[{'model':_0x3e1e('0x28'),'as':'Intervals','attributes':['id','name',_0x3e1e('0x29')]}]}]},'log':_0x3e1e('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 71724d6..7515357 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 _0x2fe0=['GetVoiceQueueReports','lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerexit','queuecallerabandon'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2fe0,0x157));var _0x02fe=function(_0x146f35,_0x162e07){_0x146f35=_0x146f35-0x0;var _0x44db42=_0x2fe0[_0x146f35];return _0x44db42;};'use strict';var moment=require('moment');var _=require(_0x02fe('0x0'));var client=require(_0x02fe('0x1'));exports[_0x02fe('0x2')]=function(_0x450e34){return client[_0x02fe('0x3')]('CreateVoiceQueueReport',{'body':_0x450e34,'log':_0x02fe('0x4')});};exports[_0x02fe('0x5')]=function(){return function(){return client[_0x02fe('0x3')](_0x02fe('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x02fe('0x7')](_0x02fe('0x8'))[_0x02fe('0x9')](_0x02fe('0xa')),moment()[_0x02fe('0xb')](_0x02fe('0x8'))['format'](_0x02fe('0xa'))]}},'attributes':['uniqueid',_0x02fe('0xc'),_0x02fe('0xd'),_0x02fe('0xe'),'queuecallercomplete','queuecallercompleteAt',_0x02fe('0xf'),'queuecallerexitAt',_0x02fe('0x10'),'queuecallerabandonAt']},'log':_0x02fe('0x11')});};}; \ No newline at end of file +var _0x70c0=['queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0xb1496a,_0x190543){var _0x301916=function(_0x4e17ab){while(--_0x4e17ab){_0xb1496a['push'](_0xb1496a['shift']());}};_0x301916(++_0x190543);}(_0x70c0,0x1e8));var _0x070c=function(_0x1dc0da,_0x354a4a){_0x1dc0da=_0x1dc0da-0x0;var _0x29b667=_0x70c0[_0x1dc0da];return _0x29b667;};'use strict';var moment=require(_0x070c('0x0'));var _=require(_0x070c('0x1'));var client=require(_0x070c('0x2'));exports[_0x070c('0x3')]=function(_0x53943f){return client[_0x070c('0x4')](_0x070c('0x5'),{'body':_0x53943f,'log':_0x070c('0x5')});};exports[_0x070c('0x6')]=function(){return function(){return client['Request'](_0x070c('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x070c('0x8')](_0x070c('0x9'))[_0x070c('0xa')](_0x070c('0xb')),moment()['endOf'](_0x070c('0x9'))[_0x070c('0xa')](_0x070c('0xb'))]}},'attributes':['uniqueid',_0x070c('0xc'),'queuecallerjoinAt',_0x070c('0xd'),_0x070c('0xe'),_0x070c('0xf'),_0x070c('0x10'),_0x070c('0x11'),_0x070c('0x12'),_0x070c('0x13')]},'log':_0x070c('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 3466da8..98cb694 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 _0xa5fd=['GetVoiceQueueRtPauses','Request'];(function(_0x2d9e45,_0x46f3ce){var _0x4d1035=function(_0x2c7b5a){while(--_0x2c7b5a){_0x2d9e45['push'](_0x2d9e45['shift']());}};_0x4d1035(++_0x46f3ce);}(_0xa5fd,0x173));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x3f4974){return function(){return client[_0xda5f('0x0')](_0xda5f('0x1'),{'options':{'where':{'VoiceQueueId':_0x3f4974,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xa96e=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x4c656b,_0x265b19){var _0x215a81=function(_0x17302a){while(--_0x17302a){_0x4c656b['push'](_0x4c656b['shift']());}};_0x215a81(++_0x265b19);}(_0xa96e,0x127));var _0xea96=function(_0x29fa7d,_0x40900e){_0x29fa7d=_0x29fa7d-0x0;var _0x1edbf0=_0xa96e[_0x29fa7d];return _0x1edbf0;};'use strict';var client=require(_0xea96('0x0'));exports['getVoiceQueueRtPauses']=function(_0x1e35db){return function(){return client[_0xea96('0x1')](_0xea96('0x2'),{'options':{'where':{'VoiceQueueId':_0x1e35db,'paused':!![]},'raw':!![]},'log':_0xea96('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d71963a..871125f 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 _0xdd45=['create','Request','CreateVoiceRecording','merge','monitorFilename','lodash'];(function(_0x140915,_0x5ca840){var _0x5c98c3=function(_0x1c49d3){while(--_0x1c49d3){_0x140915['push'](_0x140915['shift']());}};_0x5c98c3(++_0x5ca840);}(_0xdd45,0x1b5));var _0x5dd4=function(_0x8dbc24,_0xc6f7d1){_0x8dbc24=_0x8dbc24-0x0;var _0xaffa6e=_0xdd45[_0x8dbc24];return _0xaffa6e;};'use strict';var _=require(_0x5dd4('0x0'));var client=require('../client');exports[_0x5dd4('0x1')]=function(_0x199385){return client[_0x5dd4('0x2')](_0x5dd4('0x3'),{'body':_[_0x5dd4('0x4')](_0x199385,{'value':_0x199385[_0x5dd4('0x5')]}),'log':_0x5dd4('0x3')});}; \ No newline at end of file +var _0xf852=['Request','CreateVoiceRecording','merge','monitorFilename','../client','create'];(function(_0x2deacb,_0x9dacae){var _0x207ee3=function(_0x2d9477){while(--_0x2d9477){_0x2deacb['push'](_0x2deacb['shift']());}};_0x207ee3(++_0x9dacae);}(_0xf852,0x82));var _0x2f85=function(_0x3596b7,_0x10b8b6){_0x3596b7=_0x3596b7-0x0;var _0x46994a=_0xf852[_0x3596b7];return _0x46994a;};'use strict';var _=require('lodash');var client=require(_0x2f85('0x0'));exports[_0x2f85('0x1')]=function(_0x38fd78){return client[_0x2f85('0x2')](_0x2f85('0x3'),{'body':_[_0x2f85('0x4')](_0x38fd78,{'value':_0x38fd78[_0x2f85('0x5')]}),'log':_0x2f85('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index dfa710d..1db50d4 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 _0x2cad=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel'];(function(_0x435a8e,_0x192d91){var _0xc54da1=function(_0xba7025){while(--_0xba7025){_0x435a8e['push'](_0x435a8e['shift']());}};_0xc54da1(++_0x192d91);}(_0x2cad,0x100));var _0xd2ca=function(_0x147bef,_0x5aa474){_0x147bef=_0x147bef-0x0;var _0x29d10c=_0x2cad[_0x147bef];return _0x29d10c;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0x2f885b){return client[_0xd2ca('0x0')](_0xd2ca('0x1'),{'body':{'result':_0x2f885b[_0xd2ca('0x2')],'transfererchannel':_0x2f885b[_0xd2ca('0x3')],'transferercalleridnum':_0x2f885b[_0xd2ca('0x4')],'transferercalleridname':_0x2f885b[_0xd2ca('0x5')],'transfererconnectedlinenum':_0x2f885b['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2f885b[_0xd2ca('0x6')],'transfereraccountcode':_0x2f885b['transfereraccountcode'],'transferercontext':_0x2f885b[_0xd2ca('0x7')],'transfererexten':_0x2f885b[_0xd2ca('0x8')],'transfererlinkedid':_0x2f885b[_0xd2ca('0x9')],'transfereechannel':_0x2f885b[_0xd2ca('0xa')],'transfereecalleridnum':_0x2f885b['transfereecalleridnum'],'transfereecalleridname':_0x2f885b[_0xd2ca('0xb')],'transfereeconnectedlinenum':_0x2f885b[_0xd2ca('0xc')],'transfereeconnectedlinename':_0x2f885b[_0xd2ca('0xd')],'transfereeaccountcode':_0x2f885b[_0xd2ca('0xe')],'transfereecontext':_0x2f885b[_0xd2ca('0xf')],'transfereeexten':_0x2f885b[_0xd2ca('0x10')],'transfereelinkedid':_0x2f885b[_0xd2ca('0x11')],'isexternal':_0x2f885b[_0xd2ca('0x12')],'context':_0x2f885b[_0xd2ca('0x13')],'extension':_0x2f885b[_0xd2ca('0x14')],'type':_0xd2ca('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0xd2ca('0x16')]=function(_0x3cfd57){return client[_0xd2ca('0x0')](_0xd2ca('0x1'),{'body':{'result':_0x3cfd57[_0xd2ca('0x2')],'transfererchannel':_0x3cfd57[_0xd2ca('0x17')],'transferercalleridnum':_0x3cfd57[_0xd2ca('0x18')],'transferercalleridname':_0x3cfd57[_0xd2ca('0x19')],'transfererconnectedlinenum':_0x3cfd57['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3cfd57[_0xd2ca('0x1a')],'transfereraccountcode':_0x3cfd57[_0xd2ca('0x1b')],'transferercontext':_0x3cfd57['secondtransferercontext'],'transfererexten':_0x3cfd57[_0xd2ca('0x1c')],'transfererlinkedid':_0x3cfd57[_0xd2ca('0x1d')],'transfereechannel':_0x3cfd57[_0xd2ca('0x1e')],'transfereecalleridnum':_0x3cfd57[_0xd2ca('0x1f')],'transfereecalleridname':_0x3cfd57[_0xd2ca('0x20')],'transfereeconnectedlinenum':_0x3cfd57[_0xd2ca('0x21')],'transfereeconnectedlinename':_0x3cfd57[_0xd2ca('0x22')],'transfereeaccountcode':_0x3cfd57[_0xd2ca('0x23')],'transfereecontext':_0x3cfd57[_0xd2ca('0x24')],'transfereeexten':_0x3cfd57[_0xd2ca('0x25')],'transfereelinkedid':_0x3cfd57['transfertargetlinkedid'],'isexternal':_0x3cfd57[_0xd2ca('0x12')],'context':_0x3cfd57[_0xd2ca('0x26')],'extension':_0x3cfd57[_0xd2ca('0x27')],'type':'attended'},'log':_0xd2ca('0x1')});}; \ No newline at end of file +var _0x1b0c=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereecontext','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1b0c,0xfd));var _0xc1b0=function(_0x3e06dd,_0x55694f){_0x3e06dd=_0x3e06dd-0x0;var _0x4bbb8b=_0x1b0c[_0x3e06dd];return _0x4bbb8b;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0x2cea19){return client[_0xc1b0('0x0')](_0xc1b0('0x1'),{'body':{'result':_0x2cea19[_0xc1b0('0x2')],'transfererchannel':_0x2cea19[_0xc1b0('0x3')],'transferercalleridnum':_0x2cea19[_0xc1b0('0x4')],'transferercalleridname':_0x2cea19[_0xc1b0('0x5')],'transfererconnectedlinenum':_0x2cea19['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2cea19[_0xc1b0('0x6')],'transfereraccountcode':_0x2cea19[_0xc1b0('0x7')],'transferercontext':_0x2cea19[_0xc1b0('0x8')],'transfererexten':_0x2cea19['transfererexten'],'transfererlinkedid':_0x2cea19[_0xc1b0('0x9')],'transfereechannel':_0x2cea19[_0xc1b0('0xa')],'transfereecalleridnum':_0x2cea19['transfereecalleridnum'],'transfereecalleridname':_0x2cea19['transfereecalleridname'],'transfereeconnectedlinenum':_0x2cea19[_0xc1b0('0xb')],'transfereeconnectedlinename':_0x2cea19['transfereeconnectedlinename'],'transfereeaccountcode':_0x2cea19['transfereeaccountcode'],'transfereecontext':_0x2cea19[_0xc1b0('0xc')],'transfereeexten':_0x2cea19['transfereeexten'],'transfereelinkedid':_0x2cea19[_0xc1b0('0xd')],'isexternal':_0x2cea19[_0xc1b0('0xe')],'context':_0x2cea19[_0xc1b0('0xf')],'extension':_0x2cea19[_0xc1b0('0x10')],'type':'blind'},'log':_0xc1b0('0x1')});};exports[_0xc1b0('0x11')]=function(_0x5af715){return client['Request'](_0xc1b0('0x1'),{'body':{'result':_0x5af715[_0xc1b0('0x2')],'transfererchannel':_0x5af715[_0xc1b0('0x12')],'transferercalleridnum':_0x5af715['origtransferercalleridnum'],'transferercalleridname':_0x5af715['origtransferercalleridname'],'transfererconnectedlinenum':_0x5af715[_0xc1b0('0x13')],'transfererconnectedlinename':_0x5af715[_0xc1b0('0x14')],'transfereraccountcode':_0x5af715[_0xc1b0('0x15')],'transferercontext':_0x5af715[_0xc1b0('0x16')],'transfererexten':_0x5af715[_0xc1b0('0x17')],'transfererlinkedid':_0x5af715[_0xc1b0('0x18')],'transfereechannel':_0x5af715[_0xc1b0('0x19')],'transfereecalleridnum':_0x5af715[_0xc1b0('0x1a')],'transfereecalleridname':_0x5af715[_0xc1b0('0x1b')],'transfereeconnectedlinenum':_0x5af715[_0xc1b0('0x1c')],'transfereeconnectedlinename':_0x5af715[_0xc1b0('0x1d')],'transfereeaccountcode':_0x5af715['transfertargetaccountcode'],'transfereecontext':_0x5af715['transfertargetcontext'],'transfereeexten':_0x5af715[_0xc1b0('0x1e')],'transfereelinkedid':_0x5af715[_0xc1b0('0x1f')],'isexternal':_0x5af715[_0xc1b0('0xe')],'context':_0x5af715[_0xc1b0('0x20')],'extension':_0x5af715[_0xc1b0('0x21')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index da84897..f0d825f 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 _0x993f=['outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','callerid','Interval','push','channels','length','map','uniqueid','wav','MixMonitor','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','ami\x20disconnected','find','channel','StopMixMonitor','destinationchannel','status','stop','%s.%s','filename','StopMixMonitor\x20Success','values','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../properties','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','join','module','action','Reload','Action','then','message','username','pick','command','Command','content','catch','voiceQueues','hasOwnProperty','name','strategy','answered','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit'];(function(_0x5ea69f,_0x1c0076){var _0x3e692d=function(_0x1b8e3c){while(--_0x1b8e3c){_0x5ea69f['push'](_0x5ea69f['shift']());}};_0x3e692d(++_0x1c0076);}(_0x993f,0x144));var _0xf993=function(_0x23e1e4,_0x41b7ef){_0x23e1e4=_0x23e1e4-0x0;var _0x445a06=_0x993f[_0x23e1e4];return _0x445a06;};'use strict';var _=require(_0xf993('0x0'));var util=require(_0xf993('0x1'));var jayson=require('jayson/promise');var schema=require(_0xf993('0x2'));var BPromise=require(_0xf993('0x3'));var moment=require(_0xf993('0x4'));var config=require('../../../config/environment');var properties=require(_0xf993('0x5'));var ami=require('../ami');exports[_0xf993('0x6')]=function(_0x4ba3c0,_0xf471a,_0x4f3bd8){return new BPromise(function(_0x593c21,_0x23614c){var _0x57baea={'QueuePause':function(_0x311edc){return new Promise(function(_0x39e067,_0x281c47){var _0x48270a=util[_0xf993('0x7')](_0xf993('0x8'),_0xf993('0x9'),_0x311edc['name']);if(_0x4ba3c0[_0xf993('0xa')]&&_0x4ba3c0[_0xf993('0xa')][_0x48270a]&&_0x4ba3c0['timers'][_0x48270a][_0xf993('0xb')]){_0x4ba3c0[_0xf993('0xa')][_0x48270a][_0xf993('0xc')]();}if(_0x4ba3c0[_0xf993('0xd')][_0x48270a]){_0x4ba3c0[_0xf993('0xd')][_0x48270a][_0xf993('0xe')]({'statePause':_0x311edc[_0xf993('0xf')]?!![]:![]});}_0x39e067({'code':0xc8,'message':_0xf993('0x10')});});},'Reload':function(_0x496e5d){var _0x3cd81b=this;return new Promise(function(_0x1f841d,_0x2a4de1){if(ami[_0xf993('0x11')]()==![]){return _0x2a4de1(_0x3cd81b[_0xf993('0x12')](0x1f4,[config[_0xf993('0x13')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0xf993('0x14')]('\x20')));}_0x496e5d=_['pick'](_0x496e5d,_['keys'](properties[_0xf993('0x15')]));_0x496e5d[_0xf993('0x16')]=_0xf993('0x17');return ami[_0xf993('0x18')](_0x496e5d)[_0xf993('0x19')](function(_0x150c63){_0x1f841d({'code':0xc8,'message':_0x150c63[_0xf993('0x1a')]});})['catch'](function(_0x134459){_0x2a4de1(_0x3cd81b[_0xf993('0x12')](0x1f5,_0x134459[_0xf993('0x1a')]));});});},'Command':function(_0xfe18a4){var _0x33b7b4=this;return new Promise(function(_0x44dad7,_0x2cd684){if(ami[_0xf993('0x11')]()==![]){return _0x2cd684(_0x33b7b4[_0xf993('0x12')](0x1f4,[config[_0xf993('0x13')]['ip'],config[_0xf993('0x13')][_0xf993('0x1b')],'ami\x20disconnected']['join']('\x20')));}_0xfe18a4=_[_0xf993('0x1c')](_0xfe18a4,_0xf993('0x1d'));_0xfe18a4[_0xf993('0x16')]=_0xf993('0x1e');return ami['Action'](_0xfe18a4)[_0xf993('0x19')](function(_0x1b400e){_0x44dad7({'code':0xc8,'message':_0x1b400e[_0xf993('0x1f')]});})[_0xf993('0x20')](function(_0xd3ae7c){_0x2cd684(_0x33b7b4[_0xf993('0x12')](0x1f5,_0xd3ae7c[_0xf993('0x1a')]));});});},'VoiceQueues':function(_0xef6c67){return new Promise(function(_0x4fafc4,_0x144d32){var _0x382d05=[];for(var _0x89282b in _0x4ba3c0[_0xf993('0x21')]){if(_0x4ba3c0['voiceQueues'][_0xf993('0x22')](_0x89282b)){var _0x531fe3=_0x4ba3c0[_0xf993('0x21')][_0x89282b];var _0x120bda={'id':_0x531fe3['id'],'name':_0x531fe3[_0xf993('0x23')],'strategy':_0x531fe3[_0xf993('0x24')],'answered':_0x531fe3[_0xf993('0x25')],'available':_0x531fe3['available'],'loggedIn':_0x531fe3['loggedIn'],'pTalking':_0x531fe3[_0xf993('0x26')],'sumBillable':_0x531fe3[_0xf993('0x27')],'sumDuration':_0x531fe3[_0xf993('0x28')],'sumHoldTime':_0x531fe3['sumHoldTime']||0x0,'talking':_0x531fe3[_0xf993('0x29')],'total':_0x531fe3['total'],'type':_0x531fe3['type'],'unmanaged':_0x531fe3[_0xf993('0x2a')],'abandoned':_0x531fe3[_0xf993('0x2b')],'waiting':_0x531fe3['waiting'],'loggedInDb':_0x531fe3[_0xf993('0x2c')]};if(_0x531fe3[_0xf993('0x2d')]===_0xf993('0x2e')){_0x120bda[_0xf993('0x2f')]=_0x531fe3[_0xf993('0x2f')];_0x120bda[_0xf993('0x30')]=_0x531fe3[_0xf993('0x30')];_0x120bda[_0xf993('0x31')]=_0x531fe3[_0xf993('0x31')];_0x120bda['dialOriginateCallerIdNumber']=_0x531fe3[_0xf993('0x32')];_0x120bda[_0xf993('0x33')]=_0x531fe3[_0xf993('0x33')];_0x120bda[_0xf993('0x34')]=_0x531fe3[_0xf993('0x34')];_0x120bda[_0xf993('0x35')]=_0x531fe3[_0xf993('0x35')];_0x120bda['outboundAnswerCallsDay']=_0x531fe3[_0xf993('0x36')];_0x120bda[_0xf993('0x37')]=_0x531fe3[_0xf993('0x37')];_0x120bda['outboundBusyCallsDay']=_0x531fe3[_0xf993('0x38')];_0x120bda[_0xf993('0x39')]=_0x531fe3[_0xf993('0x39')];_0x120bda[_0xf993('0x3a')]=_0x531fe3['outboundDropCallsDayACS'];_0x120bda[_0xf993('0x3b')]=_0x531fe3[_0xf993('0x3b')];_0x120bda[_0xf993('0x3c')]=_0x531fe3['outboundDropCallsDayTimeout'];_0x120bda[_0xf993('0x3d')]=_0x531fe3[_0xf993('0x3d')];_0x120bda[_0xf993('0x3e')]=_0x531fe3[_0xf993('0x3e')];_0x120bda[_0xf993('0x3f')]=_0x531fe3[_0xf993('0x3f')];_0x120bda['outboundReCallsDay']=_0x531fe3['outboundReCallsDay'];_0x120bda['outboundRejectCallsDay']=_0x531fe3[_0xf993('0x40')];_0x120bda[_0xf993('0x41')]=_0x531fe3['outboundUnknownCallsDay'];_0x120bda[_0xf993('0x42')]=_0x531fe3[_0xf993('0x42')];_0x120bda[_0xf993('0x43')]=_0x531fe3[_0xf993('0x43')];_0x120bda[_0xf993('0x44')]=_0x531fe3[_0xf993('0x44')];_0x120bda[_0xf993('0x45')]=_0x531fe3['predictiveIntervalDroppedCallsCallersExit'];_0x120bda[_0xf993('0x46')]=_0x531fe3[_0xf993('0x46')];_0x120bda[_0xf993('0x47')]=_0x531fe3[_0xf993('0x47')];_0x120bda[_0xf993('0x48')]=_0x531fe3[_0xf993('0x48')];_0x120bda[_0xf993('0x49')]=_0x531fe3[_0xf993('0x49')];_0x120bda['predictiveIntervalLowerLimit']=_0x531fe3[_0xf993('0x4a')];_0x120bda[_0xf993('0x4b')]=_0x531fe3[_0xf993('0x4b')];_0x120bda[_0xf993('0x4c')]=_0x531fe3[_0xf993('0x4c')];_0x120bda['predictiveIntervalTotalCalls']=_0x531fe3[_0xf993('0x4d')];_0x120bda[_0xf993('0x1a')]=_0x531fe3['message'];_0x120bda[_0xf993('0x4e')]=_0x531fe3[_0xf993('0x4e')];}if(_0x531fe3[_0xf993('0x4f')]){_0x120bda[_0xf993('0x4f')]={'id':_0x531fe3['Trunk']['id'],'name':_0x531fe3[_0xf993('0x4f')][_0xf993('0x23')],'active':_0x531fe3[_0xf993('0x4f')]['active'],'callerid':_0x531fe3[_0xf993('0x4f')][_0xf993('0x50')]};}if(_0x531fe3[_0xf993('0x51')]){_0x120bda['Interval']={'id':_0x531fe3[_0xf993('0x51')]['id'],'name':_0x531fe3[_0xf993('0x51')][_0xf993('0x23')]};}_0x382d05[_0xf993('0x52')](_0x120bda);}}_0x4fafc4({'count':_0x382d05['length'],'rows':_0x382d05});});},'VoiceChannels':function(_0x25ceb8){return new Promise(function(_0x2c3aea,_0xd1f413){var _0x42eef9=_['values'](_0x4ba3c0[_0xf993('0x53')]);_0x2c3aea({'count':_0x42eef9[_0xf993('0x54')],'rows':_0x42eef9});});},'VoiceChannelMixMonitor':function(_0x254248){var _0xbee473=this;return new Promise(function(_0x4dba2e,_0x217ef2){if(ami[_0xf993('0x11')]()==![]){return _0x217ef2(_0xbee473[_0xf993('0x12')](0x1f4,[config[_0xf993('0x13')]['ip'],config[_0xf993('0x13')][_0xf993('0x1b')],'ami\x20disconnected'][_0xf993('0x14')]('\x20')));}var _0x693bd7=schema(properties['voicechannel'])[_0xf993('0x2')](_0x254248);if(_0x693bd7['length']>0x0){return _0x217ef2(_0xbee473['error'](0x1f4,_[_0xf993('0x55')](_0x693bd7,'message')[_0xf993('0x14')](',\x20')));}var _0x5574de=_['find'](_0x4ba3c0['channels'],{'uniqueid':_0x254248['uniqueid']});if(_0x5574de&&_0x5574de['channel']){var _0x19dd7c=util[_0xf993('0x7')]('%s.%s',_0x254248['filename']||_0x254248[_0xf993('0x56')],_0x254248[_0xf993('0x7')]||_0xf993('0x57'));return ami[_0xf993('0x18')]({'action':_0xf993('0x58'),'channel':_0x5574de['channel'],'file':_0x19dd7c,'options':'ai(mixmonitorid)'})[_0xf993('0x19')](function(_0x1657c4){var _0x482985=_['find'](_0x5574de['monitors'],{'filename':_0xf993('0x59')+_0x19dd7c[_0xf993('0x5a')]()});if(_[_0xf993('0x5b')](_0x482985)){_0x5574de[_0xf993('0x5c')][_0xf993('0x52')]({'filename':_0xf993('0x59')+_0x19dd7c[_0xf993('0x5a')](),'createdAt':moment()[_0xf993('0x7')](_0xf993('0x5d')),'mixmonitorid':_0x1657c4[_0xf993('0x5e')],'status':'rec'});}else{_0x482985[_0xf993('0x5e')]=_0x1657c4['mixmonitorid'];_0x482985['status']='rec';}_0x4dba2e({'code':0xc8,'message':[_0x254248[_0xf993('0x56')],_0xf993('0x5f'),_0x1657c4[_0xf993('0x5e')]][_0xf993('0x14')]('\x20'),'mixmonitorid':_0x1657c4['mixmonitorid']});})[_0xf993('0x20')](function(_0x3c0c58){_0x217ef2(_0xbee473['error'](0x1f5,[_0x254248[_0xf993('0x56')],_0x3c0c58[_0xf993('0x1a')][_0xf993('0x5a')]()]['join']('\x20')));});}else{return _0x217ef2(_0xbee473['error'](0x1f5,_0xf993('0x60')));}});},'VoiceChannelStopMixMonitor':function(_0x193113){var _0x4da74e=this;return new Promise(function(_0x297e5e,_0x2d360e){if(ami[_0xf993('0x11')]()==![]){return _0x2d360e(_0x4da74e[_0xf993('0x12')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xf993('0x1b')],_0xf993('0x61')][_0xf993('0x14')]('\x20')));}var _0x67261e=schema(properties['voicechannel'])[_0xf993('0x2')](_0x193113);if(_0x67261e['length']>0x0){return _0x2d360e(_0x4da74e['error'](0x1f4,_[_0xf993('0x55')](_0x67261e,_0xf993('0x1a'))[_0xf993('0x14')](',\x20')));}var _0x20daef=_[_0xf993('0x62')](_0x4ba3c0[_0xf993('0x53')],{'uniqueid':_0x193113[_0xf993('0x56')]});if(_0x20daef){return BPromise['resolve']()[_0xf993('0x19')](function(){if(_0x20daef[_0xf993('0x63')]){return ami[_0xf993('0x18')]({'action':_0xf993('0x64'),'channel':_0x20daef[_0xf993('0x63')],'mixmonitorid':_0x193113['mixmonitorid']})[_0xf993('0x20')](function(_0x3bcb83){});}})['then'](function(){if(_0x20daef[_0xf993('0x65')]){return ami[_0xf993('0x18')]({'action':_0xf993('0x64'),'channel':_0x20daef[_0xf993('0x65')],'mixmonitorid':_0x193113[_0xf993('0x5e')]})[_0xf993('0x20')](function(_0x4ad0af){});}})[_0xf993('0x19')](function(_0x4bbe00){var _0x4c557d=_[_0xf993('0x62')](_0x20daef[_0xf993('0x5c')],{'mixmonitorid':_0x193113[_0xf993('0x5e')]});if(_0x4c557d){_0x4c557d[_0xf993('0x66')]=_0xf993('0x67');}})[_0xf993('0x19')](function(){var _0x3e53c9=util['format'](_0xf993('0x68'),_0x193113[_0xf993('0x69')]||_0x193113['uniqueid'],_0x193113[_0xf993('0x7')]||_0xf993('0x57'));var _0x2232e2=_['find'](_0x20daef[_0xf993('0x5c')],{'filename':_0xf993('0x59')+_0x3e53c9['toLowerCase']()});if(_0x2232e2){_0x2232e2[_0xf993('0x66')]=_0xf993('0x67');}})['then'](function(){_0x297e5e({'code':0xc8,'message':[_0x193113[_0xf993('0x56')],_0xf993('0x6a')][_0xf993('0x14')]('\x20')});})[_0xf993('0x20')](function(_0x2516e2){_0x2d360e(_0x4da74e[_0xf993('0x12')](0x1f5,[_0x193113[_0xf993('0x56')],_0x2516e2[_0xf993('0x1a')][_0xf993('0x5a')]()]['join']('\x20')));});}else{return _0x2d360e(_0x4da74e['error'](0x1f5,_0xf993('0x60')));}});},'VoiceQueuesChannels':function(_0x2b91df){return new Promise(function(_0x159e20,_0x4d7682){var _0x328c78=_[_0xf993('0x6b')](_0x4ba3c0['queueChannels']);_0x159e20({'count':_0x328c78[_0xf993('0x54')],'rows':_0x328c78});});},'VoiceQueuesChannel':function(_0x13be32){var _0x20fe64=this;return new Promise(function(_0x903553,_0x3012ca){var _0x1b9ae5=schema(properties['voicequeuechannel'])['validate'](_0x13be32);if(_0x1b9ae5[_0xf993('0x54')]>0x0){return _0x3012ca(_0x20fe64[_0xf993('0x12')](0x1f4,_[_0xf993('0x55')](_0x1b9ae5,'message')[_0xf993('0x14')](',\x20')));}var _0x2f2dd2=_[_0xf993('0x62')](_0x4ba3c0[_0xf993('0x6c')],{'uniqueid':_0x13be32[_0xf993('0x56')]});if(_0x2f2dd2){_0x903553(_0x2f2dd2);}else{return _0x3012ca(_0x20fe64[_0xf993('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x9e0a8){var _0x3d8bcf=this;return new Promise(function(_0x47eba7,_0x549277){if(ami[_0xf993('0x11')]()==![]){return _0x549277(_0x3d8bcf['error'](0x1f4,[config[_0xf993('0x13')]['ip'],config[_0xf993('0x13')][_0xf993('0x1b')],_0xf993('0x61')][_0xf993('0x14')]('\x20')));}var _0x15f019=schema(properties['voicequeuechannelhangup'])[_0xf993('0x2')](_0x9e0a8);if(_0x15f019[_0xf993('0x54')]>0x0){return _0x549277(_0x3d8bcf['error'](0x1f4,_[_0xf993('0x55')](_0x15f019,'message')[_0xf993('0x14')](',\x20')));}var _0x3d4a02=_[_0xf993('0x62')](_0x4ba3c0[_0xf993('0x6c')],{'uniqueid':_0x9e0a8[_0xf993('0x56')]});if(_0x3d4a02&&_0x3d4a02['channel']){return ami[_0xf993('0x18')]({'action':_0xf993('0x6d'),'channel':_0x3d4a02['channel']})[_0xf993('0x19')](function(_0x2c25c1){_0x47eba7({'code':0xc8,'message':[_0x9e0a8['uniqueid'],_0x2c25c1[_0xf993('0x1a')][_0xf993('0x5a')]()][_0xf993('0x14')]('\x20')});})[_0xf993('0x20')](function(_0x2c0523){_0x549277(_0x3d8bcf[_0xf993('0x12')](0x1f5,[_0x9e0a8[_0xf993('0x56')],_0x2c0523[_0xf993('0x1a')][_0xf993('0x5a')]()][_0xf993('0x14')]('\x20')));});}else{return _0x549277(_0x3d8bcf[_0xf993('0x12')](0x1f5,_0xf993('0x60')));}});},'VoiceQueuesChannelRedirect':function(_0x51ee78){var _0x443f0a=this;return new Promise(function(_0x249b66,_0x59a25a){if(ami['isConnected']()==![]){return _0x59a25a(_0x443f0a['error'](0x1f4,[config[_0xf993('0x13')]['ip'],config[_0xf993('0x13')][_0xf993('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x37969d=schema(properties[_0xf993('0x6e')])[_0xf993('0x2')](_0x51ee78);if(_0x37969d[_0xf993('0x54')]>0x0){return _0x59a25a(_0x443f0a['error'](0x1f4,_[_0xf993('0x55')](_0x37969d,_0xf993('0x1a'))[_0xf993('0x14')](',\x20')));}var _0x3f6f8f=_['find'](_0x4ba3c0[_0xf993('0x6c')],{'uniqueid':_0x51ee78['uniqueid']});if(_0x3f6f8f&&_0x3f6f8f['channel']){return ami['Action']({'action':_0xf993('0x6f'),'channel':_0x3f6f8f[_0xf993('0x63')],'exten':_0x51ee78[_0xf993('0x70')],'context':_0x51ee78[_0xf993('0x71')]||_0x3f6f8f[_0xf993('0x71')],'priority':0x1})[_0xf993('0x19')](function(_0x5f32f2){_0x249b66({'code':0xc8,'message':[_0x51ee78[_0xf993('0x56')],_0x5f32f2[_0xf993('0x1a')]['toLowerCase']()]['join']('\x20')});})[_0xf993('0x20')](function(_0x580cd4){_0x59a25a(_0x443f0a[_0xf993('0x12')](0x1f5,[_0x51ee78[_0xf993('0x56')],_0x580cd4[_0xf993('0x1a')][_0xf993('0x5a')]()][_0xf993('0x14')]('\x20')));});}else{return _0x59a25a(_0x443f0a[_0xf993('0x12')](0x1f5,_0xf993('0x60')));}});},'Agents':function(_0x17fec9){return new Promise(function(_0x1209a1,_0x1d790e){var _0x5b2b74=_[_0xf993('0x6b')](_0x4ba3c0['agents']);_0x1209a1({'count':_0x5b2b74[_0xf993('0x54')],'rows':_0x5b2b74});});},'Telephones':function(_0xd38a4f){return new Promise(function(_0x2de832,_0x1e5718){var _0x3ddb23=_[_0xf993('0x6b')](_0x4ba3c0[_0xf993('0x72')]);_0x2de832({'count':_0x3ddb23['length'],'rows':_0x3ddb23});});},'Trunks':function(_0x3d6627){return new Promise(function(_0x2f78cc,_0x3cfc62){var _0x21378f=_[_0xf993('0x6b')](_0x4ba3c0[_0xf993('0x73')]);_0x2f78cc({'count':_0x21378f[_0xf993('0x54')],'rows':_0x21378f});});},'OutboundChannels':function(_0x3c8031){return new Promise(function(_0x435fba,_0x214160){var _0x1d6adc=_[_0xf993('0x6b')](_0x4ba3c0[_0xf993('0x74')]);_0x435fba({'count':_0x1d6adc[_0xf993('0x54')],'rows':_0x1d6adc});});},'Outbound':function(_0x3ad948){return new Promise(function(_0x183aba,_0x5708f3){_0x183aba(_0x4ba3c0[_0xf993('0x2e')]);});},'Campaigns':function(_0x4fe51b){return new Promise(function(_0x24b2e6,_0x463a9f){var _0x2ffe81=_[_0xf993('0x6b')](_0x4ba3c0['campaigns']);_0x24b2e6({'count':_0x2ffe81['length'],'rows':_0x2ffe81});});},'VoiceQueuesPreview':function(_0x171f3d){var _0x19ae6d=this;return new Promise(function(_0x4a45ee,_0x4b8127){_0xf471a[_0xf993('0x75')](_0x171f3d['id'])[_0xf993('0x19')](function(_0x5debe7){_0x4a45ee({'code':0xc8,'message':_0x5debe7[_0xf993('0x1a')]});})[_0xf993('0x20')](function(_0x3ced6d){_0x4b8127(_0x19ae6d[_0xf993('0x12')](0x1f4,_0x3ced6d['message']));});});},'EventManager':function(_0x2d01c9){var _0x398890=this;return new Promise(function(_0x5c4af2,_0x553625){if(!_0x2d01c9[_0xf993('0x76')]){return _0x553625(_0x398890[_0xf993('0x12')](0x1f4,_0xf993('0x77')));}ami[_0xf993('0x78')]('custom:'+_0x2d01c9[_0xf993('0x76')],_0x2d01c9[_0xf993('0x1a')]);_0x5c4af2({'code':0xc8,'message':_0x2d01c9});});},'FaxAccounts':function(_0x4dad64){return new Promise(function(_0x4f242f,_0x2c686e){var _0x15a03e=_[_0xf993('0x6b')](_0x4ba3c0[_0xf993('0x79')]);_0x4f242f({'count':_0x15a03e[_0xf993('0x54')],'rows':_0x15a03e});});},'SendFax':function(_0x248616){var _0x3298b2=this;return new Promise(function(_0x242257,_0x32691f){_0x4f3bd8['send'](_0x248616)['then'](function(_0x17422f){_0x242257({'code':0xc8,'message':_0x17422f[_0xf993('0x1a')]});})[_0xf993('0x20')](function(_0x4edaf7){_0x32691f(_0x3298b2['error'](0x1f4,_0x4edaf7[_0xf993('0x1a')]));});});},'CheckAfterSend':function(_0x5c645d){var _0x5f1b30=this;return new Promise(function(_0x5478f0,_0x53386e){_0x4f3bd8[_0xf993('0x7a')](_0x5c645d)[_0xf993('0x19')](function(_0x578885){_0x5478f0({'code':0xc8,'message':_0x578885[_0xf993('0x1a')]});})['catch'](function(_0x5241c0){_0x53386e(_0x5f1b30[_0xf993('0x12')](0x1f4,_0x5241c0['message']));});});}};var _0x466a20=jayson['server'](_0x57baea)[_0xf993('0x7b')]();_0x466a20['on'](_0xf993('0x12'),function(_0x32ddcf){return _0x23614c(_0x32ddcf);});_0x466a20['listen'](0x232a,_0xf993('0x7c'),function(){console[_0xf993('0x7d')](_0xf993('0x7e'),0x232a);return _0x593c21(_0xf993('0x7f')+0x232a);});});}; \ No newline at end of file +var _0x35ea=['name','timers','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','ami\x20disconnected','join','module','action','Reload','Action','then','message','catch','username','pick','Command','hasOwnProperty','voiceQueues','strategy','answered','available','loggedIn','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','Interval','push','length','values','map','find','channels','uniqueid','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','telephones','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP'];(function(_0x1157b9,_0x2bf481){var _0x562358=function(_0x2d3a2c){while(--_0x2d3a2c){_0x1157b9['push'](_0x1157b9['shift']());}};_0x562358(++_0x2bf481);}(_0x35ea,0x73));var _0xa35e=function(_0xa3a76e,_0x55edec){_0xa3a76e=_0xa3a76e-0x0;var _0x125fce=_0x35ea[_0xa3a76e];return _0x125fce;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0xa35e('0x0'));var schema=require(_0xa35e('0x1'));var BPromise=require('bluebird');var moment=require(_0xa35e('0x2'));var config=require(_0xa35e('0x3'));var properties=require(_0xa35e('0x4'));var ami=require(_0xa35e('0x5'));exports[_0xa35e('0x6')]=function(_0x486c61,_0x313cf9,_0x2e2ae3){return new BPromise(function(_0x5d5f3d,_0x2c08aa){var _0x4a71dc={'QueuePause':function(_0x46d8ab){return new Promise(function(_0x20d18e,_0x574e1a){var _0x3d5466=util[_0xa35e('0x7')](_0xa35e('0x8'),_0xa35e('0x9'),_0x46d8ab[_0xa35e('0xa')]);if(_0x486c61[_0xa35e('0xb')]&&_0x486c61[_0xa35e('0xb')][_0x3d5466]&&_0x486c61['timers'][_0x3d5466]['timer']){_0x486c61['timers'][_0x3d5466][_0xa35e('0xc')]();}if(_0x486c61[_0xa35e('0xd')][_0x3d5466]){_0x486c61[_0xa35e('0xd')][_0x3d5466][_0xa35e('0xe')]({'statePause':_0x46d8ab[_0xa35e('0xf')]?!![]:![]});}_0x20d18e({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0xacf73d){var _0xa1f30e=this;return new Promise(function(_0x2fffdc,_0x47cd41){if(ami[_0xa35e('0x10')]()==![]){return _0x47cd41(_0xa1f30e[_0xa35e('0x11')](0x1f4,[config[_0xa35e('0x12')]['ip'],config[_0xa35e('0x12')]['username'],_0xa35e('0x13')][_0xa35e('0x14')]('\x20')));}_0xacf73d=_['pick'](_0xacf73d,_['keys'](properties[_0xa35e('0x15')]));_0xacf73d[_0xa35e('0x16')]=_0xa35e('0x17');return ami[_0xa35e('0x18')](_0xacf73d)[_0xa35e('0x19')](function(_0x188f4d){_0x2fffdc({'code':0xc8,'message':_0x188f4d[_0xa35e('0x1a')]});})[_0xa35e('0x1b')](function(_0x29deef){_0x47cd41(_0xa1f30e[_0xa35e('0x11')](0x1f5,_0x29deef[_0xa35e('0x1a')]));});});},'Command':function(_0x521b9e){var _0x4a7f9e=this;return new Promise(function(_0x1e46ca,_0x45f978){if(ami[_0xa35e('0x10')]()==![]){return _0x45f978(_0x4a7f9e[_0xa35e('0x11')](0x1f4,[config[_0xa35e('0x12')]['ip'],config[_0xa35e('0x12')][_0xa35e('0x1c')],_0xa35e('0x13')][_0xa35e('0x14')]('\x20')));}_0x521b9e=_[_0xa35e('0x1d')](_0x521b9e,'command');_0x521b9e['action']=_0xa35e('0x1e');return ami['Action'](_0x521b9e)['then'](function(_0x3047c8){_0x1e46ca({'code':0xc8,'message':_0x3047c8['content']});})[_0xa35e('0x1b')](function(_0x1830e9){_0x45f978(_0x4a7f9e[_0xa35e('0x11')](0x1f5,_0x1830e9[_0xa35e('0x1a')]));});});},'VoiceQueues':function(_0x10a244){return new Promise(function(_0x2ce59e,_0x3fb7b9){var _0x277efe=[];for(var _0x551205 in _0x486c61['voiceQueues']){if(_0x486c61['voiceQueues'][_0xa35e('0x1f')](_0x551205)){var _0x3b5c7=_0x486c61[_0xa35e('0x20')][_0x551205];var _0x1b13ad={'id':_0x3b5c7['id'],'name':_0x3b5c7[_0xa35e('0xa')],'strategy':_0x3b5c7[_0xa35e('0x21')],'answered':_0x3b5c7[_0xa35e('0x22')],'available':_0x3b5c7[_0xa35e('0x23')],'loggedIn':_0x3b5c7[_0xa35e('0x24')],'pTalking':_0x3b5c7['pTalking'],'sumBillable':_0x3b5c7['sumBillable'],'sumDuration':_0x3b5c7[_0xa35e('0x25')],'sumHoldTime':_0x3b5c7['sumHoldTime']||0x0,'talking':_0x3b5c7[_0xa35e('0x26')],'total':_0x3b5c7[_0xa35e('0x27')],'type':_0x3b5c7[_0xa35e('0x28')],'unmanaged':_0x3b5c7['unmanaged'],'abandoned':_0x3b5c7[_0xa35e('0x29')],'waiting':_0x3b5c7[_0xa35e('0x2a')],'loggedInDb':_0x3b5c7[_0xa35e('0x2b')]};if(_0x3b5c7[_0xa35e('0x28')]===_0xa35e('0x2c')){_0x1b13ad[_0xa35e('0x2d')]=_0x3b5c7[_0xa35e('0x2d')];_0x1b13ad[_0xa35e('0x2e')]=_0x3b5c7[_0xa35e('0x2e')];_0x1b13ad['dialOriginateCallerIdName']=_0x3b5c7[_0xa35e('0x2f')];_0x1b13ad['dialOriginateCallerIdNumber']=_0x3b5c7[_0xa35e('0x30')];_0x1b13ad[_0xa35e('0x31')]=_0x3b5c7['dialOriginateTimeout'];_0x1b13ad['dialPrefix']=_0x3b5c7[_0xa35e('0x32')];_0x1b13ad[_0xa35e('0x33')]=_0x3b5c7['outboundAnswerAgiCallsDay'];_0x1b13ad[_0xa35e('0x34')]=_0x3b5c7['outboundAnswerCallsDay'];_0x1b13ad[_0xa35e('0x35')]=_0x3b5c7[_0xa35e('0x35')];_0x1b13ad[_0xa35e('0x36')]=_0x3b5c7[_0xa35e('0x36')];_0x1b13ad[_0xa35e('0x37')]=_0x3b5c7[_0xa35e('0x37')];_0x1b13ad[_0xa35e('0x38')]=_0x3b5c7[_0xa35e('0x38')];_0x1b13ad[_0xa35e('0x39')]=_0x3b5c7[_0xa35e('0x39')];_0x1b13ad[_0xa35e('0x3a')]=_0x3b5c7[_0xa35e('0x3a')];_0x1b13ad[_0xa35e('0x3b')]=_0x3b5c7[_0xa35e('0x3b')];_0x1b13ad['outboundNoSuchCallsDay']=_0x3b5c7['outboundNoSuchCallsDay'];_0x1b13ad[_0xa35e('0x3c')]=_0x3b5c7[_0xa35e('0x3c')];_0x1b13ad[_0xa35e('0x3d')]=_0x3b5c7[_0xa35e('0x3d')];_0x1b13ad['outboundRejectCallsDay']=_0x3b5c7['outboundRejectCallsDay'];_0x1b13ad[_0xa35e('0x3e')]=_0x3b5c7['outboundUnknownCallsDay'];_0x1b13ad[_0xa35e('0x3f')]=_0x3b5c7['predictiveIntervalAnsweredCalls'];_0x1b13ad[_0xa35e('0x40')]=_0x3b5c7[_0xa35e('0x40')];_0x1b13ad['predictiveIntervalAvgTalktime']=_0x3b5c7[_0xa35e('0x41')];_0x1b13ad[_0xa35e('0x42')]=_0x3b5c7[_0xa35e('0x42')];_0x1b13ad[_0xa35e('0x43')]=_0x3b5c7[_0xa35e('0x43')];_0x1b13ad[_0xa35e('0x44')]=_0x3b5c7[_0xa35e('0x44')];_0x1b13ad['predictiveIntervalErlangCallsDroppedCalls']=_0x3b5c7['predictiveIntervalErlangCallsDroppedCalls'];_0x1b13ad['predictiveIntervalHitRate']=_0x3b5c7['predictiveIntervalHitRate'];_0x1b13ad[_0xa35e('0x45')]=_0x3b5c7['predictiveIntervalLowerLimit'];_0x1b13ad['predictiveIntervalMultiplicativeFactor']=_0x3b5c7[_0xa35e('0x46')];_0x1b13ad['predictiveIntervalPauses']=_0x3b5c7['predictiveIntervalPauses'];_0x1b13ad[_0xa35e('0x47')]=_0x3b5c7[_0xa35e('0x47')];_0x1b13ad['message']=_0x3b5c7[_0xa35e('0x1a')];_0x1b13ad[_0xa35e('0x48')]=_0x3b5c7['originated'];}if(_0x3b5c7[_0xa35e('0x49')]){_0x1b13ad[_0xa35e('0x49')]={'id':_0x3b5c7[_0xa35e('0x49')]['id'],'name':_0x3b5c7[_0xa35e('0x49')]['name'],'active':_0x3b5c7[_0xa35e('0x49')][_0xa35e('0x4a')],'callerid':_0x3b5c7[_0xa35e('0x49')][_0xa35e('0x4b')]};}if(_0x3b5c7['Interval']){_0x1b13ad[_0xa35e('0x4c')]={'id':_0x3b5c7[_0xa35e('0x4c')]['id'],'name':_0x3b5c7[_0xa35e('0x4c')][_0xa35e('0xa')]};}_0x277efe[_0xa35e('0x4d')](_0x1b13ad);}}_0x2ce59e({'count':_0x277efe[_0xa35e('0x4e')],'rows':_0x277efe});});},'VoiceChannels':function(_0x5b429c){return new Promise(function(_0x42c35b,_0x540db7){var _0x4bb86e=_[_0xa35e('0x4f')](_0x486c61['channels']);_0x42c35b({'count':_0x4bb86e['length'],'rows':_0x4bb86e});});},'VoiceChannelMixMonitor':function(_0x5169d6){var _0x56809d=this;return new Promise(function(_0x14e69a,_0x151d8d){if(ami[_0xa35e('0x10')]()==![]){return _0x151d8d(_0x56809d['error'](0x1f4,[config[_0xa35e('0x12')]['ip'],config[_0xa35e('0x12')][_0xa35e('0x1c')],_0xa35e('0x13')]['join']('\x20')));}var _0x360cf1=schema(properties['voicechannel'])[_0xa35e('0x1')](_0x5169d6);if(_0x360cf1[_0xa35e('0x4e')]>0x0){return _0x151d8d(_0x56809d[_0xa35e('0x11')](0x1f4,_[_0xa35e('0x50')](_0x360cf1,_0xa35e('0x1a'))[_0xa35e('0x14')](',\x20')));}var _0x256926=_[_0xa35e('0x51')](_0x486c61[_0xa35e('0x52')],{'uniqueid':_0x5169d6[_0xa35e('0x53')]});if(_0x256926&&_0x256926[_0xa35e('0x54')]){var _0x7142cf=util['format'](_0xa35e('0x55'),_0x5169d6['filename']||_0x5169d6[_0xa35e('0x53')],_0x5169d6['format']||_0xa35e('0x56'));return ami['Action']({'action':_0xa35e('0x57'),'channel':_0x256926[_0xa35e('0x54')],'file':_0x7142cf,'options':_0xa35e('0x58')})[_0xa35e('0x19')](function(_0x3439ef){var _0x52bde2=_[_0xa35e('0x51')](_0x256926[_0xa35e('0x59')],{'filename':_0xa35e('0x5a')+_0x7142cf[_0xa35e('0x5b')]()});if(_[_0xa35e('0x5c')](_0x52bde2)){_0x256926[_0xa35e('0x59')][_0xa35e('0x4d')]({'filename':_0xa35e('0x5a')+_0x7142cf[_0xa35e('0x5b')](),'createdAt':moment()[_0xa35e('0x7')](_0xa35e('0x5d')),'mixmonitorid':_0x3439ef[_0xa35e('0x5e')],'status':'rec'});}else{_0x52bde2[_0xa35e('0x5e')]=_0x3439ef[_0xa35e('0x5e')];_0x52bde2[_0xa35e('0x5f')]=_0xa35e('0x60');}_0x14e69a({'code':0xc8,'message':[_0x5169d6[_0xa35e('0x53')],_0xa35e('0x61'),_0x3439ef[_0xa35e('0x5e')]][_0xa35e('0x14')]('\x20'),'mixmonitorid':_0x3439ef[_0xa35e('0x5e')]});})[_0xa35e('0x1b')](function(_0x338f32){_0x151d8d(_0x56809d[_0xa35e('0x11')](0x1f5,[_0x5169d6[_0xa35e('0x53')],_0x338f32[_0xa35e('0x1a')]['toLowerCase']()][_0xa35e('0x14')]('\x20')));});}else{return _0x151d8d(_0x56809d[_0xa35e('0x11')](0x1f5,_0xa35e('0x62')));}});},'VoiceChannelStopMixMonitor':function(_0x5c22de){var _0x5b1519=this;return new Promise(function(_0x53bc11,_0x14c696){if(ami[_0xa35e('0x10')]()==![]){return _0x14c696(_0x5b1519['error'](0x1f4,[config[_0xa35e('0x12')]['ip'],config[_0xa35e('0x12')][_0xa35e('0x1c')],_0xa35e('0x13')]['join']('\x20')));}var _0x35b912=schema(properties[_0xa35e('0x63')])[_0xa35e('0x1')](_0x5c22de);if(_0x35b912[_0xa35e('0x4e')]>0x0){return _0x14c696(_0x5b1519[_0xa35e('0x11')](0x1f4,_[_0xa35e('0x50')](_0x35b912,_0xa35e('0x1a'))[_0xa35e('0x14')](',\x20')));}var _0x43a044=_['find'](_0x486c61[_0xa35e('0x52')],{'uniqueid':_0x5c22de['uniqueid']});if(_0x43a044){return BPromise[_0xa35e('0x64')]()['then'](function(){if(_0x43a044[_0xa35e('0x54')]){return ami['Action']({'action':_0xa35e('0x65'),'channel':_0x43a044[_0xa35e('0x54')],'mixmonitorid':_0x5c22de['mixmonitorid']})[_0xa35e('0x1b')](function(_0x53d667){});}})[_0xa35e('0x19')](function(){if(_0x43a044[_0xa35e('0x66')]){return ami[_0xa35e('0x18')]({'action':_0xa35e('0x65'),'channel':_0x43a044[_0xa35e('0x66')],'mixmonitorid':_0x5c22de[_0xa35e('0x5e')]})[_0xa35e('0x1b')](function(_0x3be872){});}})['then'](function(_0x529ccb){var _0xb72771=_['find'](_0x43a044[_0xa35e('0x59')],{'mixmonitorid':_0x5c22de[_0xa35e('0x5e')]});if(_0xb72771){_0xb72771[_0xa35e('0x5f')]=_0xa35e('0x67');}})[_0xa35e('0x19')](function(){var _0x8c5d93=util[_0xa35e('0x7')]('%s.%s',_0x5c22de[_0xa35e('0x68')]||_0x5c22de[_0xa35e('0x53')],_0x5c22de[_0xa35e('0x7')]||_0xa35e('0x56'));var _0x3fd351=_['find'](_0x43a044[_0xa35e('0x59')],{'filename':_0xa35e('0x5a')+_0x8c5d93[_0xa35e('0x5b')]()});if(_0x3fd351){_0x3fd351[_0xa35e('0x5f')]='stop';}})[_0xa35e('0x19')](function(){_0x53bc11({'code':0xc8,'message':[_0x5c22de[_0xa35e('0x53')],_0xa35e('0x69')][_0xa35e('0x14')]('\x20')});})[_0xa35e('0x1b')](function(_0x398ba6){_0x14c696(_0x5b1519[_0xa35e('0x11')](0x1f5,[_0x5c22de[_0xa35e('0x53')],_0x398ba6['message']['toLowerCase']()][_0xa35e('0x14')]('\x20')));});}else{return _0x14c696(_0x5b1519['error'](0x1f5,_0xa35e('0x62')));}});},'VoiceQueuesChannels':function(_0x1f90b8){return new Promise(function(_0x5dd0ea,_0x5c2021){var _0x526d55=_[_0xa35e('0x4f')](_0x486c61[_0xa35e('0x6a')]);_0x5dd0ea({'count':_0x526d55[_0xa35e('0x4e')],'rows':_0x526d55});});},'VoiceQueuesChannel':function(_0x5192b1){var _0x4993b5=this;return new Promise(function(_0x5ea5c0,_0x41f4d4){var _0x10811d=schema(properties[_0xa35e('0x6b')])[_0xa35e('0x1')](_0x5192b1);if(_0x10811d[_0xa35e('0x4e')]>0x0){return _0x41f4d4(_0x4993b5['error'](0x1f4,_[_0xa35e('0x50')](_0x10811d,'message')[_0xa35e('0x14')](',\x20')));}var _0x469c63=_[_0xa35e('0x51')](_0x486c61['queueChannels'],{'uniqueid':_0x5192b1[_0xa35e('0x53')]});if(_0x469c63){_0x5ea5c0(_0x469c63);}else{return _0x41f4d4(_0x4993b5['error'](0x1f5,_0xa35e('0x62')));}});},'VoiceQueuesChannelHangup':function(_0x57aa4a){var _0xe3b624=this;return new Promise(function(_0x542827,_0x15e571){if(ami['isConnected']()==![]){return _0x15e571(_0xe3b624['error'](0x1f4,[config[_0xa35e('0x12')]['ip'],config[_0xa35e('0x12')][_0xa35e('0x1c')],_0xa35e('0x13')]['join']('\x20')));}var _0x261169=schema(properties[_0xa35e('0x6c')])['validate'](_0x57aa4a);if(_0x261169['length']>0x0){return _0x15e571(_0xe3b624['error'](0x1f4,_[_0xa35e('0x50')](_0x261169,_0xa35e('0x1a'))['join'](',\x20')));}var _0x3e9b14=_[_0xa35e('0x51')](_0x486c61[_0xa35e('0x6a')],{'uniqueid':_0x57aa4a[_0xa35e('0x53')]});if(_0x3e9b14&&_0x3e9b14[_0xa35e('0x54')]){return ami[_0xa35e('0x18')]({'action':_0xa35e('0x6d'),'channel':_0x3e9b14[_0xa35e('0x54')]})[_0xa35e('0x19')](function(_0xa3b80){_0x542827({'code':0xc8,'message':[_0x57aa4a[_0xa35e('0x53')],_0xa3b80[_0xa35e('0x1a')][_0xa35e('0x5b')]()][_0xa35e('0x14')]('\x20')});})[_0xa35e('0x1b')](function(_0x2a45c9){_0x15e571(_0xe3b624[_0xa35e('0x11')](0x1f5,[_0x57aa4a[_0xa35e('0x53')],_0x2a45c9[_0xa35e('0x1a')]['toLowerCase']()][_0xa35e('0x14')]('\x20')));});}else{return _0x15e571(_0xe3b624[_0xa35e('0x11')](0x1f5,_0xa35e('0x62')));}});},'VoiceQueuesChannelRedirect':function(_0x197bee){var _0x4ca258=this;return new Promise(function(_0x29ea83,_0x33aa32){if(ami[_0xa35e('0x10')]()==![]){return _0x33aa32(_0x4ca258[_0xa35e('0x11')](0x1f4,[config[_0xa35e('0x12')]['ip'],config[_0xa35e('0x12')]['username'],_0xa35e('0x13')][_0xa35e('0x14')]('\x20')));}var _0x57f54b=schema(properties[_0xa35e('0x6e')])[_0xa35e('0x1')](_0x197bee);if(_0x57f54b[_0xa35e('0x4e')]>0x0){return _0x33aa32(_0x4ca258['error'](0x1f4,_[_0xa35e('0x50')](_0x57f54b,_0xa35e('0x1a'))[_0xa35e('0x14')](',\x20')));}var _0x5812a4=_['find'](_0x486c61[_0xa35e('0x6a')],{'uniqueid':_0x197bee[_0xa35e('0x53')]});if(_0x5812a4&&_0x5812a4[_0xa35e('0x54')]){return ami[_0xa35e('0x18')]({'action':'Redirect','channel':_0x5812a4[_0xa35e('0x54')],'exten':_0x197bee[_0xa35e('0x6f')],'context':_0x197bee['context']||_0x5812a4['context'],'priority':0x1})[_0xa35e('0x19')](function(_0x420c9c){_0x29ea83({'code':0xc8,'message':[_0x197bee[_0xa35e('0x53')],_0x420c9c[_0xa35e('0x1a')][_0xa35e('0x5b')]()][_0xa35e('0x14')]('\x20')});})[_0xa35e('0x1b')](function(_0x58cefb){_0x33aa32(_0x4ca258[_0xa35e('0x11')](0x1f5,[_0x197bee[_0xa35e('0x53')],_0x58cefb[_0xa35e('0x1a')][_0xa35e('0x5b')]()]['join']('\x20')));});}else{return _0x33aa32(_0x4ca258[_0xa35e('0x11')](0x1f5,_0xa35e('0x62')));}});},'Agents':function(_0x5d7d69){return new Promise(function(_0x8c6a49,_0x1e5f80){var _0x54a97d=_[_0xa35e('0x4f')](_0x486c61[_0xa35e('0xd')]);_0x8c6a49({'count':_0x54a97d[_0xa35e('0x4e')],'rows':_0x54a97d});});},'Telephones':function(_0x274265){return new Promise(function(_0x5235b5,_0x24dcb6){var _0x5df968=_[_0xa35e('0x4f')](_0x486c61[_0xa35e('0x70')]);_0x5235b5({'count':_0x5df968[_0xa35e('0x4e')],'rows':_0x5df968});});},'Trunks':function(_0x1e05b0){return new Promise(function(_0x55f04c,_0x407328){var _0x271fa2=_['values'](_0x486c61['trunks']);_0x55f04c({'count':_0x271fa2[_0xa35e('0x4e')],'rows':_0x271fa2});});},'OutboundChannels':function(_0x1c4932){return new Promise(function(_0x18d45f,_0x36fb58){var _0x1cee9d=_[_0xa35e('0x4f')](_0x486c61['outboundChannels']);_0x18d45f({'count':_0x1cee9d[_0xa35e('0x4e')],'rows':_0x1cee9d});});},'Outbound':function(_0x17a725){return new Promise(function(_0x563d55,_0x247fb4){_0x563d55(_0x486c61[_0xa35e('0x2c')]);});},'Campaigns':function(_0x3e160c){return new Promise(function(_0xcf23d3,_0xb6fe6f){var _0xf97da2=_[_0xa35e('0x4f')](_0x486c61[_0xa35e('0x71')]);_0xcf23d3({'count':_0xf97da2[_0xa35e('0x4e')],'rows':_0xf97da2});});},'VoiceQueuesPreview':function(_0x5ef148){var _0x432b63=this;return new Promise(function(_0x296999,_0x410f91){_0x313cf9[_0xa35e('0x72')](_0x5ef148['id'])['then'](function(_0x19af09){_0x296999({'code':0xc8,'message':_0x19af09[_0xa35e('0x1a')]});})['catch'](function(_0x3611c6){_0x410f91(_0x432b63[_0xa35e('0x11')](0x1f4,_0x3611c6['message']));});});},'EventManager':function(_0x2b87b1){var _0x5b531f=this;return new Promise(function(_0x300f09,_0x36123f){if(!_0x2b87b1[_0xa35e('0x73')]){return _0x36123f(_0x5b531f[_0xa35e('0x11')](0x1f4,_0xa35e('0x74')));}ami[_0xa35e('0x75')](_0xa35e('0x76')+_0x2b87b1[_0xa35e('0x73')],_0x2b87b1[_0xa35e('0x1a')]);_0x300f09({'code':0xc8,'message':_0x2b87b1});});},'FaxAccounts':function(_0x5c9abc){return new Promise(function(_0x5e26e2,_0x5de14c){var _0x318620=_[_0xa35e('0x4f')](_0x486c61[_0xa35e('0x77')]);_0x5e26e2({'count':_0x318620[_0xa35e('0x4e')],'rows':_0x318620});});},'SendFax':function(_0x4f416b){var _0x48e153=this;return new Promise(function(_0x3d79b3,_0x4f63cd){_0x2e2ae3['send'](_0x4f416b)[_0xa35e('0x19')](function(_0x2d4a90){_0x3d79b3({'code':0xc8,'message':_0x2d4a90[_0xa35e('0x1a')]});})['catch'](function(_0x42176a){_0x4f63cd(_0x48e153['error'](0x1f4,_0x42176a[_0xa35e('0x1a')]));});});},'CheckAfterSend':function(_0x2ea2c0){var _0x48b4ab=this;return new Promise(function(_0x114c2c,_0x536c58){_0x2e2ae3['checkAfterSend'](_0x2ea2c0)[_0xa35e('0x19')](function(_0x3fcf75){_0x114c2c({'code':0xc8,'message':_0x3fcf75[_0xa35e('0x1a')]});})[_0xa35e('0x1b')](function(_0x20db05){_0x536c58(_0x48b4ab['error'](0x1f4,_0x20db05[_0xa35e('0x1a')]));});});}};var _0x247654=jayson[_0xa35e('0x78')](_0x4a71dc)[_0xa35e('0x79')]();_0x247654['on'](_0xa35e('0x11'),function(_0x5ba36a){return _0x2c08aa(_0x5ba36a);});_0x247654[_0xa35e('0x6')](0x232a,_0xa35e('0x7a'),function(){console[_0xa35e('0x7b')](_0xa35e('0x7c'),0x232a);return _0x5d5f3d('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 62539e5..645d3a1 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 _0x7bf5=['emit','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','destcalleridname','destcalleridnum','uniqueid','then','showContact','omit','xmd-contactid2','format','user:%s','trigger:%s','action','toLowerCase','merge','name','catch','error','Error\x20creating\x20contact','bluebird','lodash','ioredis','../../../../config/logger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7bf5,0x11e));var _0x57bf=function(_0x3a7972,_0x47dff9){_0x3a7972=_0x3a7972-0x0;var _0x4633be=_0x7bf5[_0x3a7972];return _0x4633be;};'use strict';var BPromise=require(_0x57bf('0x0'));var util=require('util');var _=require(_0x57bf('0x1'));var Redis=require(_0x57bf('0x2'));var config=require('../../../../config/environment');var logger=require(_0x57bf('0x3'))('trigger');var cmContactRpc=require(_0x57bf('0x4'));config[_0x57bf('0x5')]=_['defaults'](config[_0x57bf('0x5')],{'host':_0x57bf('0x6'),'port':0x18eb});var io=require(_0x57bf('0x7'))(new Redis(config[_0x57bf('0x5')]));function emit(_0x256481,_0x54d124,_0x53f294){logger[_0x57bf('0x8')](_0x256481,_0x54d124,JSON[_0x57bf('0x9')](_0x53f294));io['to'](_0x256481)[_0x57bf('0xa')](_0x54d124,_0x53f294);}exports['exec']=function(_0x45c039,_0xedbac3,_0x2e9ce5){_0x2e9ce5[_0x57bf('0xb')]=0x0;if(_0xedbac3[_0x57bf('0xc')]&&parseInt(_0xedbac3[_0x57bf('0xc')],0xa)){var _0x1dfe3c={'ListId':parseInt(_0xedbac3[_0x57bf('0xd')],0xa),'phone':_0x2e9ce5[_0x57bf('0xe')]};if(_[_0x57bf('0xf')](_0x2e9ce5[_0x57bf('0x10')])){_0x1dfe3c[_0x57bf('0x11')]=_0x2e9ce5[_0x57bf('0x12')]&&_0x2e9ce5['calleridname']!==_0x57bf('0x13')?_0x2e9ce5['calleridname']:_0x2e9ce5['calleridnum']||_0x2e9ce5['uniqueid'];}else{_0x1dfe3c['firstName']=_0x2e9ce5[_0x57bf('0x14')]&&_0x2e9ce5[_0x57bf('0x14')]!==''?_0x2e9ce5['destcalleridname']:_0x2e9ce5[_0x57bf('0x15')]||_0x2e9ce5[_0x57bf('0x16')];_0x1dfe3c['phone']=_0x2e9ce5[_0x57bf('0x14')]&&_0x2e9ce5[_0x57bf('0x14')]!==_0x57bf('0x13')?_0x2e9ce5[_0x57bf('0x14')]:_0x2e9ce5[_0x57bf('0x15')]||_0x2e9ce5['uniqueid'];}BPromise['resolve']()[_0x57bf('0x17')](cmContactRpc[_0x57bf('0x18')]({'where':_[_0x57bf('0x19')](_0x1dfe3c,[_0x57bf('0x11')])}))[_0x57bf('0x17')](function(_0x26a181){if(_0x26a181){_0x2e9ce5[_0x57bf('0x1a')]=_0x26a181['id'];emit(util[_0x57bf('0x1b')](_0x57bf('0x1c'),_0x45c039['name']),util[_0x57bf('0x1b')](_0x57bf('0x1d'),_0xedbac3[_0x57bf('0x1e')][_0x57bf('0x1f')]()),_[_0x57bf('0x20')](_0x2e9ce5,{'ListId':parseInt(_0xedbac3['data1'],0xa)}));return;}else{return BPromise['resolve']()[_0x57bf('0x17')](cmContactRpc['createContact'](_0x1dfe3c));}})[_0x57bf('0x17')](function(_0x3f5fd4){if(_0x3f5fd4){_0x2e9ce5[_0x57bf('0x1a')]=_0x3f5fd4['id'];emit(util[_0x57bf('0x1b')](_0x57bf('0x1c'),_0x45c039[_0x57bf('0x21')]),util[_0x57bf('0x1b')]('trigger:%s',_0xedbac3[_0x57bf('0x1e')][_0x57bf('0x1f')]()),_[_0x57bf('0x20')](_0x2e9ce5,{'ListId':parseInt(_0xedbac3['data1'],0xa)}));}})[_0x57bf('0x22')](function(_0x559186){logger[_0x57bf('0x23')](_0x57bf('0x24'),JSON['stringify'](_0x559186));});}else{if(_0x45c039){emit(util[_0x57bf('0x1b')](_0x57bf('0x1c'),_0x45c039[_0x57bf('0x21')]),util[_0x57bf('0x1b')]('trigger:%s',_0xedbac3[_0x57bf('0x1e')]['toLowerCase']()),_[_0x57bf('0x20')]({'ListId':parseInt(_0xedbac3[_0x57bf('0xd')],0xa)},_0x2e9ce5));}}}; \ No newline at end of file +var _0x8bae=['','destcalleridname','destcalleridnum','uniqueid','phone','then','showContact','omit','xmd-contactid2','format','user:%s','name','action','toLowerCase','resolve','createContact','trigger:%s','merge','catch','error','stringify','bluebird','util','lodash','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','emit','exec','data2','data1','calleridnum','isNil','routeId','firstName','calleridname'];(function(_0x555e89,_0x13f902){var _0x392854=function(_0x27383b){while(--_0x27383b){_0x555e89['push'](_0x555e89['shift']());}};_0x392854(++_0x13f902);}(_0x8bae,0x165));var _0xe8ba=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x8bae[_0x1928c9];return _0x51b5fb;};'use strict';var BPromise=require(_0xe8ba('0x0'));var util=require(_0xe8ba('0x1'));var _=require(_0xe8ba('0x2'));var Redis=require('ioredis');var config=require(_0xe8ba('0x3'));var logger=require(_0xe8ba('0x4'))(_0xe8ba('0x5'));var cmContactRpc=require(_0xe8ba('0x6'));config[_0xe8ba('0x7')]=_[_0xe8ba('0x8')](config[_0xe8ba('0x7')],{'host':_0xe8ba('0x9'),'port':0x18eb});var io=require(_0xe8ba('0xa'))(new Redis(config[_0xe8ba('0x7')]));function emit(_0x4227e8,_0x1e7e5e,_0x45322f){logger[_0xe8ba('0xb')](_0x4227e8,_0x1e7e5e,JSON['stringify'](_0x45322f));io['to'](_0x4227e8)[_0xe8ba('0xc')](_0x1e7e5e,_0x45322f);}exports[_0xe8ba('0xd')]=function(_0x44d385,_0x4c886e,_0x16f2cc){_0x16f2cc['autoCreate']=0x0;if(_0x4c886e[_0xe8ba('0xe')]&&parseInt(_0x4c886e[_0xe8ba('0xe')],0xa)){var _0x3f1040={'ListId':parseInt(_0x4c886e[_0xe8ba('0xf')],0xa),'phone':_0x16f2cc[_0xe8ba('0x10')]};if(_[_0xe8ba('0x11')](_0x16f2cc[_0xe8ba('0x12')])){_0x3f1040[_0xe8ba('0x13')]=_0x16f2cc[_0xe8ba('0x14')]&&_0x16f2cc[_0xe8ba('0x14')]!==_0xe8ba('0x15')?_0x16f2cc[_0xe8ba('0x14')]:_0x16f2cc['calleridnum']||_0x16f2cc['uniqueid'];}else{_0x3f1040[_0xe8ba('0x13')]=_0x16f2cc[_0xe8ba('0x16')]&&_0x16f2cc[_0xe8ba('0x16')]!==''?_0x16f2cc[_0xe8ba('0x16')]:_0x16f2cc[_0xe8ba('0x17')]||_0x16f2cc[_0xe8ba('0x18')];_0x3f1040[_0xe8ba('0x19')]=_0x16f2cc[_0xe8ba('0x16')]&&_0x16f2cc[_0xe8ba('0x16')]!==_0xe8ba('0x15')?_0x16f2cc['destcalleridname']:_0x16f2cc['destcalleridnum']||_0x16f2cc[_0xe8ba('0x18')];}BPromise['resolve']()[_0xe8ba('0x1a')](cmContactRpc[_0xe8ba('0x1b')]({'where':_[_0xe8ba('0x1c')](_0x3f1040,[_0xe8ba('0x13')])}))[_0xe8ba('0x1a')](function(_0x411aa4){if(_0x411aa4){_0x16f2cc[_0xe8ba('0x1d')]=_0x411aa4['id'];emit(util[_0xe8ba('0x1e')](_0xe8ba('0x1f'),_0x44d385[_0xe8ba('0x20')]),util['format']('trigger:%s',_0x4c886e[_0xe8ba('0x21')][_0xe8ba('0x22')]()),_['merge'](_0x16f2cc,{'ListId':parseInt(_0x4c886e['data1'],0xa)}));return;}else{return BPromise[_0xe8ba('0x23')]()[_0xe8ba('0x1a')](cmContactRpc[_0xe8ba('0x24')](_0x3f1040));}})[_0xe8ba('0x1a')](function(_0x1875dd){if(_0x1875dd){_0x16f2cc[_0xe8ba('0x1d')]=_0x1875dd['id'];emit(util[_0xe8ba('0x1e')]('user:%s',_0x44d385[_0xe8ba('0x20')]),util[_0xe8ba('0x1e')](_0xe8ba('0x25'),_0x4c886e[_0xe8ba('0x21')][_0xe8ba('0x22')]()),_[_0xe8ba('0x26')](_0x16f2cc,{'ListId':parseInt(_0x4c886e['data1'],0xa)}));}})[_0xe8ba('0x27')](function(_0x58e38c){logger[_0xe8ba('0x28')]('Error\x20creating\x20contact',JSON[_0xe8ba('0x29')](_0x58e38c));});}else{if(_0x44d385){emit(util[_0xe8ba('0x1e')](_0xe8ba('0x1f'),_0x44d385['name']),util[_0xe8ba('0x1e')]('trigger:%s',_0x4c886e['action']['toLowerCase']()),_[_0xe8ba('0x26')]({'ListId':parseInt(_0x4c886e['data1'],0xa)},_0x16f2cc));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 942fbec..fe65d9f 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 _0x8d05=['name','format','trigger:%s:%s','data1','merge','trigger:%s','exec','integration','queue','routeId','parse','query','AllConditions','every','checkConditions','channel','length','AnyConditions','account','chat','operator','value','upperFirst','AccountId','message','event','lastevent','exports','util','lodash','url','mustache','ioredis','./cmContact','../rpc/cmContact','../../../config/environment','../../../config/logger','../ami','redis','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:queuecallerabandon','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','prototype','clone','checkTriggers','hasOwnProperty','status','checkTrigger','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','render','data2','uri','buildUri','isNil','data3','location','data4','windowWidth','data5','800','data6','600','winapp','winArguments','user:%s','interface'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d05,0xe8));var _0x58d0=function(_0x5a80ef,_0x57d7fa){_0x5a80ef=_0x5a80ef-0x0;var _0x40ea9c=_0x8d05[_0x5a80ef];return _0x40ea9c;};'use strict';var util=require(_0x58d0('0x0'));var _=require(_0x58d0('0x1'));var url=require(_0x58d0('0x2'));var Mustache=require(_0x58d0('0x3'));var Redis=require(_0x58d0('0x4'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0x58d0('0x5'));var cmContactRpc=require(_0x58d0('0x6'));var config=require(_0x58d0('0x7'));var logger=require(_0x58d0('0x8'))('trigger');var ami=require(_0x58d0('0x9'));config[_0x58d0('0xa')]=_['defaults'](config[_0x58d0('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x58d0('0xb'))(new Redis(config[_0x58d0('0xa')]));var operators={'equals':function(_0x38c1d9,_0xce5a28){return _0x38c1d9==_0xce5a28;},'not_equals':function(_0x1d070a,_0x492edf){return _0x1d070a!=_0x492edf;}};var barAndWebActions=[_0x58d0('0xc'),_0x58d0('0x2'),'winapp'];function Trigger(_0x1ce0e7){this[_0x58d0('0xd')]=_0x1ce0e7['triggers'];this['agents']=_0x1ce0e7[_0x58d0('0xe')];this[_0x58d0('0xf')]=_0x1ce0e7[_0x58d0('0xf')];this[_0x58d0('0x10')]=_0x1ce0e7[_0x58d0('0x10')];this[_0x58d0('0x11')]=_0x1ce0e7[_0x58d0('0x11')];this[_0x58d0('0x12')]=_0x1ce0e7[_0x58d0('0x12')];this[_0x58d0('0x13')]=_0x1ce0e7[_0x58d0('0x13')];this[_0x58d0('0x14')]=_0x1ce0e7[_0x58d0('0x14')];this[_0x58d0('0x15')]=_0x1ce0e7[_0x58d0('0x15')];this[_0x58d0('0x16')]=_0x1ce0e7[_0x58d0('0x16')];this[_0x58d0('0x17')]=_0x1ce0e7[_0x58d0('0x17')];this['vtigerAccounts']=_0x1ce0e7[_0x58d0('0x18')];this[_0x58d0('0x19')]=_0x1ce0e7[_0x58d0('0x19')];this[_0x58d0('0x1a')]=_0x1ce0e7[_0x58d0('0x1a')];this[_0x58d0('0x1b')]={'zendesk':this[_0x58d0('0x12')],'salesforce':this[_0x58d0('0x14')],'freshdesk':this[_0x58d0('0x13')],'sugarcrm':this[_0x58d0('0x15')],'zoho':this[_0x58d0('0x16')],'desk':this[_0x58d0('0x17')],'vtiger':this[_0x58d0('0x18')],'servicenow':this[_0x58d0('0x19')],'dynamics365':this['dynamics365Accounts']};ami['on'](_0x58d0('0x1c'),this[_0x58d0('0x1d')][_0x58d0('0x1e')](this));ami['on']('custom:agentconnect',this[_0x58d0('0x1d')][_0x58d0('0x1e')](this));ami['on'](_0x58d0('0x1f'),this['syncCustomEvent'][_0x58d0('0x1e')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0x58d0('0x1e')](this));ami['on'](_0x58d0('0x20'),this[_0x58d0('0x1d')][_0x58d0('0x1e')](this));ami['on']('custom:dialbegin',this[_0x58d0('0x1d')][_0x58d0('0x1e')](this));ami['on'](_0x58d0('0x21'),this['syncCustomEvent'][_0x58d0('0x1e')](this));ami['on'](_0x58d0('0x22'),this['syncCustomEvent'][_0x58d0('0x1e')](this));ami['on'](_0x58d0('0x23'),this[_0x58d0('0x1d')][_0x58d0('0x1e')](this));ami['on'](_0x58d0('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0x58d0('0x25'),this[_0x58d0('0x1d')][_0x58d0('0x1e')](this));ami['on'](_0x58d0('0x26'),this[_0x58d0('0x1d')]['bind'](this));ami['on'](_0x58d0('0x27'),this['syncCustomEvent'][_0x58d0('0x1e')](this));ami['on'](_0x58d0('0x28'),this[_0x58d0('0x1d')][_0x58d0('0x1e')](this));}Trigger['prototype'][_0x58d0('0x29')]=function(_0x83f281,_0xa8f2f3,_0x4f7db5){logger[_0x58d0('0x2a')](_0x83f281,_0xa8f2f3,JSON[_0x58d0('0x2b')](_0x4f7db5));io['to'](_0x83f281)[_0x58d0('0x29')](_0xa8f2f3,_0x4f7db5);};Trigger[_0x58d0('0x2c')]['syncCustomEvent']=function(_0x329567){var _0x21c717=_[_0x58d0('0x2d')](_0x329567);this[_0x58d0('0x2e')](_0x21c717);};Trigger[_0x58d0('0x2c')]['checkTriggers']=function(_0x29f421){var _0x107e69;for(var _0x3ba866 in this[_0x58d0('0xd')]){if(this[_0x58d0('0xd')][_0x58d0('0x2f')](_0x3ba866)){if(this[_0x58d0('0xd')][_0x3ba866][_0x58d0('0x30')]){_0x107e69=this[_0x58d0('0x31')](this[_0x58d0('0xd')][_0x3ba866],_0x29f421);if(_0x107e69){_['merge'](_0x29f421,_0x29f421[_0x58d0('0x32')]);for(var _0xb683ba=0x0,_0x2d8a4f,_0xc738f7,_0x429b90;_0xb683ba0x0){_0x55b851=_['map'](_0x57e19d,_0x55fdd8);}return _0x55b851;}function getCustomFields(_0x42f720,_0x49d358){var _0x2d08af=[];var _0x4ea367={'custom_fields':{}};if(_0x42f720[_0x8cfd('0x27')]>0x0){_[_0x8cfd('0x28')](_0x42f720,function(_0x1ed254){if(_0x1ed254['type']===_0x8cfd('0x29')&&_0x1ed254[_0x8cfd('0x2a')]&&!_0x1ed254[_0x8cfd('0x2b')]){_0x4ea367[_0x1ed254['nameField'][_0x8cfd('0x2c')]()]=_0x1ed254[_0x8cfd('0x2d')]['toString']();}else if(_0x1ed254[_0x8cfd('0x2e')]===_0x8cfd('0x29')&&_0x1ed254[_0x8cfd('0x2f')]&&_0x1ed254[_0x8cfd('0x2b')]){_0x4ea367[_0x8cfd('0x30')][_0x1ed254['idField']]=_0x1ed254[_0x8cfd('0x2d')][_0x8cfd('0x1f')]();}else if(_0x1ed254[_0x8cfd('0x2e')]===_0x8cfd('0x31')&&_0x1ed254[_0x8cfd('0x32')]&&_0x1ed254[_0x8cfd('0x2f')]&&_0x1ed254[_0x8cfd('0x2b')]){_0x49d358[_0x1ed254[_0x8cfd('0x32')]]&&(_0x4ea367[_0x8cfd('0x30')][_0x1ed254[_0x8cfd('0x2f')]]=_0x49d358[_0x1ed254[_0x8cfd('0x32')]][_0x8cfd('0x1f')]());}else if(_0x1ed254[_0x8cfd('0x2e')]===_0x8cfd('0x33')&&_0x1ed254[_0x8cfd('0x34')]&&_0x1ed254[_0x8cfd('0x34')][_0x8cfd('0x35')]&&_0x1ed254[_0x8cfd('0x2f')]&&_0x1ed254[_0x8cfd('0x2b')]){_0x49d358[_0x1ed254[_0x8cfd('0x34')][_0x8cfd('0x35')]['toLowerCase']()]&&(_0x4ea367[_0x8cfd('0x30')][_0x1ed254['idField']]=_0x49d358[_0x1ed254[_0x8cfd('0x34')][_0x8cfd('0x35')][_0x8cfd('0x2c')]()]['toString']());}});}if(_0x4ea367[_0x8cfd('0x36')]){_0x4ea367['priority']=Number(_0x4ea367[_0x8cfd('0x36')]);}return _0x4ea367;}function getTicket(_0x365f31,_0x575bc4,_0x695ba9,_0x5e368a,_0x2c88d7){logger[_0x8cfd('0xd')](_0x8cfd('0x37'));var _0xb779a4=_[_0x8cfd('0x38')]({'subject':intUtil['getString'](_0x5e368a[_0x8cfd('0x39')],_0x2c88d7,'\x20'),'type':_0x8cfd('0x3a'),'status':_0x8cfd('0x3b'),'labels':[_0x8cfd('0x3c'),_0x8cfd('0x3d'),_0x8cfd('0x3e')][_0x8cfd('0x3f')](getTags(_0x5e368a[_0x8cfd('0x40')],_0x8cfd('0x35'))),'description':intUtil[_0x8cfd('0x41')](_0x5e368a[_0x8cfd('0x42')],_0x2c88d7,'\x0a'),'_links':{'assigned_user':{'href':util[_0x8cfd('0xe')](_0x8cfd('0x43'),_0x575bc4['id']),'class':_0x8cfd('0x44')}},'message':{'direction':'in','body':intUtil[_0x8cfd('0x41')](_0x5e368a[_0x8cfd('0x42')],_0x2c88d7,'\x0a')}},getCustomFields(_0x5e368a[_0x8cfd('0x45')],_0x2c88d7));return request({'uri':util['format'](_0x8cfd('0x46'),_0x365f31[_0x8cfd('0x10')],_0x695ba9['id']),'method':'POST','body':_0xb779a4});}exports[_0x8cfd('0x47')]=function(_0x5257d3,_0x2d2bbe,_0x4fbed9,_0x1f46d0,_0x3c79e8,_0x27f38d){var _0x121351,_0x3dd022;_0x27f38d['remoteUri']=intUtil['stripTrailingSlash'](_0x27f38d['remoteUri']);_0x27f38d[_0x8cfd('0x48')]=intUtil['stripTrailingSlash'](_0x27f38d[_0x8cfd('0x48')]);if(_0x3c79e8&&_0x3c79e8[_0x8cfd('0x49')]){logger[_0x8cfd('0xd')]('[QUEUE]',_0x8cfd('0x4a'));_0x2d2bbe[_0x8cfd('0x4b')]=util[_0x8cfd('0xe')](_0x8cfd('0x4c'),_0x27f38d[_0x8cfd('0x48')],_0x2d2bbe[_0x8cfd('0x4d')],md5(_0x2d2bbe[_0x8cfd('0x4d')]));}else{_0x2d2bbe[_0x8cfd('0x4b')]='';}headers[_0x8cfd('0x4e')]=getAuth(_0x27f38d);return getUser(_0x27f38d,_0x1f46d0[_0x8cfd('0x4f')])[_0x8cfd('0x11')](function(_0x89ef15){_0x121351=_0x89ef15;logger[_0x8cfd('0xd')](_0x8cfd('0x50'),_0x121351['id']);return getEndUser(_0x27f38d,_0x2d2bbe[_0x8cfd('0x51')],_0x2d2bbe['calleridnum']);})[_0x8cfd('0x11')](function(_0x262341){_0x3dd022=_0x262341;logger[_0x8cfd('0xd')](_0x8cfd('0x52'),_0x3dd022['id']);return getTicket(_0x27f38d,_0x121351,_0x3dd022,_0x4fbed9,_0x2d2bbe);})['then'](function(_0x20d8f8){if(_0x20d8f8){logger[_0x8cfd('0xd')](_0x8cfd('0x53'));logger[_0x8cfd('0xd')]('The\x20Ticket\x20ID\x20is:',_0x20d8f8['id']);switch(_0x27f38d['type']){case _0x8cfd('0x54'):logger['info'](_0x8cfd('0x55'),_0x8cfd('0x56'));emit(util['format'](_0x8cfd('0x57'),_0x1f46d0['name']),'trigger:desk:display',{'recordId':_0x20d8f8['id']});break;case _0x8cfd('0x58'):logger[_0x8cfd('0xd')](_0x8cfd('0x55'),_0x8cfd('0x59'));emit(util['format'](_0x8cfd('0x57'),_0x1f46d0['name']),_0x8cfd('0x5a'),{'uri':util[_0x8cfd('0xe')](_0x8cfd('0x5b'),_0x20d8f8['id'])});break;default:logger['error'](_0x8cfd('0x55'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x8cfd('0x5c')](function(_0x5effec){console[_0x8cfd('0x5d')](_0x5effec);logger[_0x8cfd('0x5d')](_0x8cfd('0x55'),JSON['stringify'](_0x5effec));});};exports['outbound']=function(_0x22a4ec,_0x4b5364,_0x5f1c8c,_0x4ab3b3,_0x3bd82b,_0x53f49d,_0x1167f3){var _0x27b061,_0x51139a;_0x53f49d[_0x8cfd('0x10')]=intUtil[_0x8cfd('0x5e')](_0x53f49d[_0x8cfd('0x10')]);_0x53f49d[_0x8cfd('0x48')]=intUtil[_0x8cfd('0x5e')](_0x53f49d[_0x8cfd('0x48')]);if(_0x1167f3&&_0x1167f3[_0x8cfd('0x5f')]&&_0x1167f3[_0x8cfd('0x5f')]!==_0x8cfd('0x60')){logger['info']('[OUTBOUND]',_0x8cfd('0x4a'));_0x4b5364[_0x8cfd('0x4b')]=util[_0x8cfd('0xe')](_0x8cfd('0x4c'),_0x53f49d[_0x8cfd('0x48')],_0x4b5364[_0x8cfd('0x4d')],md5(_0x4b5364[_0x8cfd('0x4d')]));}headers['Authorization']=getAuth(_0x53f49d);return getUser(_0x53f49d,_0x4ab3b3[_0x8cfd('0x4f')])[_0x8cfd('0x11')](function(_0x36333d){_0x27b061=_0x36333d;logger[_0x8cfd('0xd')](_0x8cfd('0x50'),_0x27b061['id']);return getEndUser(_0x53f49d,_0x4b5364[_0x8cfd('0x61')],_0x4b5364[_0x8cfd('0x62')]);})['then'](function(_0x29b297){_0x51139a=_0x29b297;logger[_0x8cfd('0xd')]('The\x20Enduser\x20ID\x20is:',_0x51139a['id']);return getTicket(_0x53f49d,_0x27b061,_0x51139a,_0x5f1c8c,_0x4b5364);})['then'](function(_0x2275a2){if(_0x2275a2){logger[_0x8cfd('0xd')](_0x8cfd('0x53'));logger[_0x8cfd('0xd')](_0x8cfd('0x63'),_0x2275a2['id']);switch(_0x53f49d['type']){case _0x8cfd('0x54'):logger[_0x8cfd('0xd')](_0x8cfd('0x55'),_0x8cfd('0x56'));emit(util[_0x8cfd('0xe')](_0x8cfd('0x57'),_0x4ab3b3[_0x8cfd('0x35')]),_0x8cfd('0x64'),{'recordId':_0x2275a2['id']});break;case _0x8cfd('0x58'):logger['info'](_0x8cfd('0x55'),_0x8cfd('0x59'));emit(util['format'](_0x8cfd('0x57'),_0x4ab3b3[_0x8cfd('0x35')]),_0x8cfd('0x5a'),{'uri':util['format'](_0x8cfd('0x65'),_0x53f49d[_0x8cfd('0x10')],_0x2275a2['id'])});break;default:logger['error'](_0x8cfd('0x66'),_0x8cfd('0x67'));}}})[_0x8cfd('0x5c')](function(_0x17d71d){logger[_0x8cfd('0x5d')]('[OUTBOUND]',JSON[_0x8cfd('0x19')](_0x17d71d));});};exports['abandoned']=function(_0x595de2,_0x10d41a,_0x4acfe8,_0x545173,_0x496b92,_0x15d4a4){var _0xf7639a,_0x46dfcf;_0x15d4a4[_0x8cfd('0x10')]=intUtil['stripTrailingSlash'](_0x15d4a4[_0x8cfd('0x10')]);_0x15d4a4[_0x8cfd('0x48')]=intUtil['stripTrailingSlash'](_0x15d4a4[_0x8cfd('0x48')]);if(_0x496b92&&_0x496b92['monitor_format']){logger['info'](_0x8cfd('0x68'),_0x8cfd('0x4a'));_0x10d41a[_0x8cfd('0x4b')]=util[_0x8cfd('0xe')](_0x8cfd('0x4c'),_0x15d4a4[_0x8cfd('0x48')],_0x10d41a['uniqueid'],md5(_0x10d41a[_0x8cfd('0x4d')]));}else{_0x10d41a['recordingURL']='';}headers[_0x8cfd('0x4e')]=getAuth(_0x15d4a4);return getUser(_0x15d4a4)[_0x8cfd('0x11')](function(_0x98dd1c){_0xf7639a=_0x98dd1c;logger[_0x8cfd('0xd')]('The\x20User\x20ID\x20is:',_0xf7639a['id']);return getEndUser(_0x15d4a4,_0x10d41a[_0x8cfd('0x51')],_0x10d41a[_0x8cfd('0x69')]);})['then'](function(_0x2a4cd2){_0x46dfcf=_0x2a4cd2;logger['info'](_0x8cfd('0x52'),_0x46dfcf['id']);return getTicket(_0x15d4a4,_0xf7639a,_0x46dfcf,_0x4acfe8,_0x10d41a);})[_0x8cfd('0x11')](function(_0x33d182){if(_0x33d182){logger[_0x8cfd('0xd')]('Ticket\x20created!');logger[_0x8cfd('0xd')](_0x8cfd('0x63'),_0x33d182['id']);}})[_0x8cfd('0x5c')](function(_0x25ae76){logger['error'](_0x8cfd('0x68'),JSON[_0x8cfd('0x19')](_0x25ae76));});}; \ No newline at end of file +var _0x446f=['abandoned','[ABANDONED]','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','format','%s/users','find','entries','then','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','[HTTP]','stringify','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','forEach','type','string','nameField','toLowerCase','customField','idField','content','variable','variableName','customVariable','Variable','name','custom_fields','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','/api/v2/users/%d','user','Descriptions','Fields','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','https://xcally.desk.com/web/agent/case/%d','Desk\x20account\x20type\x20not\x20recognized','catch','error','outbound','recordingFormat','[OUTBOUND]','Authorization','destcalleridnum','The\x20Ticket\x20ID\x20is:','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s'];(function(_0x9a7ea6,_0x1807a2){var _0x1c2040=function(_0x55b7ec){while(--_0x55b7ec){_0x9a7ea6['push'](_0x9a7ea6['shift']());}};_0x1c2040(++_0x1807a2);}(_0x446f,0x137));var _0xf446=function(_0x5542ef,_0x127cad){_0x5542ef=_0x5542ef-0x0;var _0x1bb46f=_0x446f[_0x5542ef];return _0x1bb46f;};'use strict';var _=require(_0xf446('0x0'));var rp=require(_0xf446('0x1'));var md5=require(_0xf446('0x2'));var util=require('util');var Redis=require(_0xf446('0x3'));var intUtil=require(_0xf446('0x4'));var config=require(_0xf446('0x5'));var logger=require(_0xf446('0x6'))(_0xf446('0x7'));config[_0xf446('0x8')]=_[_0xf446('0x9')](config[_0xf446('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf446('0xa'))(new Redis(config[_0xf446('0x8')]));function emit(_0x52ba8d,_0x4dfcf4,_0x2d7291){io['to'](_0x52ba8d)[_0xf446('0xb')](_0x4dfcf4,_0x2d7291);}var headers={'Content-Type':'application/json','Accept':_0xf446('0xc')};function getUser(_0x3a4fb2,_0x18ef55){if(intUtil['validateEmail'](_0x18ef55)===!![]){logger[_0xf446('0xd')](_0xf446('0xe'),_0x18ef55);return request({'uri':util[_0xf446('0xf')](_0xf446('0x10'),_0x3a4fb2['remoteUri'])})['then'](function(_0x3cc124){if(_0x3cc124['total_entries']){return _[_0xf446('0x11')](_0x3cc124['_embedded'][_0xf446('0x12')],{'email':_0x18ef55});}})[_0xf446('0x13')](function(_0x2ff804){if(_0x2ff804){logger[_0xf446('0xd')]('Agent\x20found!');return _0x2ff804;}else{logger[_0xf446('0xd')](_0xf446('0x14'));return request({'uri':util[_0xf446('0xf')](_0xf446('0x15'),_0x3a4fb2[_0xf446('0x16')])});}});}else{logger[_0xf446('0xd')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me',_0x3a4fb2[_0xf446('0x16')])});}}function request(_0x5228d1){logger['debug'](_0xf446('0x17'),JSON[_0xf446('0x18')](_0x5228d1));return rp(_[_0xf446('0x9')](_0x5228d1,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x193e0c){var _0xaf6717;if(_0x193e0c[_0xf446('0x19')]===_0xf446('0x1a')){_0xaf6717=util['format'](_0xf446('0x1b'),_0x193e0c[_0xf446('0x1c')],_0x193e0c[_0xf446('0x1d')]);}else if(_0x193e0c['authType']==='token'){_0xaf6717=util[_0xf446('0xf')]('%s/token:%s',_0x193e0c['username'],_0x193e0c[_0xf446('0x1e')]);}return util[_0xf446('0xf')](_0xf446('0x1f'),new Buffer(_0xaf6717)[_0xf446('0x20')](_0xf446('0x21')));}function getEndUser(_0x38a0d6,_0x2d31a8,_0x438212){logger[_0xf446('0xd')](_0xf446('0x22'),_0x438212);return request({'uri':util['format'](_0xf446('0x23'),_0x38a0d6['remoteUri']),'qs':{'phone':_0x438212}})[_0xf446('0x13')](function(_0x84516b){if(_0x84516b['total_entries']){logger[_0xf446('0xd')](_0xf446('0x24'));return _0x84516b[_0xf446('0x25')][_0xf446('0x12')][0x0];}else{logger[_0xf446('0xd')](_0xf446('0x26'));return request({'uri':util['format'](_0xf446('0x27'),_0x38a0d6[_0xf446('0x16')]),'method':_0xf446('0x28'),'body':{'first_name':_0x2d31a8,'title':_0x2d31a8,'phone_numbers':[{'type':_0xf446('0x29'),'value':_0x438212}]}});}});}function getTags(_0x1fae12,_0x22e9c5){var _0x28523b=[];if(_0x1fae12&&_0x1fae12[_0xf446('0x2a')]>0x0){_0x28523b=_[_0xf446('0x2b')](_0x1fae12,_0x22e9c5);}return _0x28523b;}function getCustomFields(_0x3a1ed5,_0x2d88d7){var _0x539d48=[];var _0x8c661a={'custom_fields':{}};if(_0x3a1ed5[_0xf446('0x2a')]>0x0){_[_0xf446('0x2c')](_0x3a1ed5,function(_0xa95e91){if(_0xa95e91[_0xf446('0x2d')]===_0xf446('0x2e')&&_0xa95e91[_0xf446('0x2f')]&&!_0xa95e91['customField']){_0x8c661a[_0xa95e91[_0xf446('0x2f')][_0xf446('0x30')]()]=_0xa95e91['content'][_0xf446('0x20')]();}else if(_0xa95e91[_0xf446('0x2d')]===_0xf446('0x2e')&&_0xa95e91['idField']&&_0xa95e91[_0xf446('0x31')]){_0x8c661a['custom_fields'][_0xa95e91[_0xf446('0x32')]]=_0xa95e91[_0xf446('0x33')][_0xf446('0x20')]();}else if(_0xa95e91[_0xf446('0x2d')]===_0xf446('0x34')&&_0xa95e91[_0xf446('0x35')]&&_0xa95e91[_0xf446('0x32')]&&_0xa95e91['customField']){_0x2d88d7[_0xa95e91[_0xf446('0x35')]]&&(_0x8c661a['custom_fields'][_0xa95e91['idField']]=_0x2d88d7[_0xa95e91[_0xf446('0x35')]][_0xf446('0x20')]());}else if(_0xa95e91[_0xf446('0x2d')]===_0xf446('0x36')&&_0xa95e91[_0xf446('0x37')]&&_0xa95e91[_0xf446('0x37')][_0xf446('0x38')]&&_0xa95e91['idField']&&_0xa95e91[_0xf446('0x31')]){_0x2d88d7[_0xa95e91[_0xf446('0x37')][_0xf446('0x38')][_0xf446('0x30')]()]&&(_0x8c661a[_0xf446('0x39')][_0xa95e91['idField']]=_0x2d88d7[_0xa95e91[_0xf446('0x37')][_0xf446('0x38')][_0xf446('0x30')]()]['toString']());}});}if(_0x8c661a['priority']){_0x8c661a[_0xf446('0x3a')]=Number(_0x8c661a[_0xf446('0x3a')]);}return _0x8c661a;}function getTicket(_0xbb12b0,_0x4c4f61,_0xed1525,_0x4ce186,_0x36a570){logger[_0xf446('0xd')]('Creating\x20new\x20ticket...');var _0x2d5582=_[_0xf446('0x3b')]({'subject':intUtil[_0xf446('0x3c')](_0x4ce186[_0xf446('0x3d')],_0x36a570,'\x20'),'type':'phone','status':'new','labels':[_0xf446('0x3e'),'Motion',_0xf446('0x3f')][_0xf446('0x40')](getTags(_0x4ce186[_0xf446('0x41')],'name')),'description':intUtil[_0xf446('0x3c')](_0x4ce186['Descriptions'],_0x36a570,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf446('0xf')](_0xf446('0x42'),_0x4c4f61['id']),'class':_0xf446('0x43')}},'message':{'direction':'in','body':intUtil[_0xf446('0x3c')](_0x4ce186[_0xf446('0x44')],_0x36a570,'\x0a')}},getCustomFields(_0x4ce186[_0xf446('0x45')],_0x36a570));return request({'uri':util[_0xf446('0xf')](_0xf446('0x46'),_0xbb12b0[_0xf446('0x16')],_0xed1525['id']),'method':_0xf446('0x28'),'body':_0x2d5582});}exports['queue']=function(_0x29dd8e,_0x394180,_0xf560eb,_0x34a7e4,_0x403d4b,_0x8d0ca){var _0x1276f8,_0x22b059;_0x8d0ca['remoteUri']=intUtil['stripTrailingSlash'](_0x8d0ca[_0xf446('0x16')]);_0x8d0ca[_0xf446('0x47')]=intUtil[_0xf446('0x48')](_0x8d0ca[_0xf446('0x47')]);if(_0x403d4b&&_0x403d4b[_0xf446('0x49')]){logger[_0xf446('0xd')](_0xf446('0x4a'),_0xf446('0x4b'));_0x394180['recordingURL']=util[_0xf446('0xf')](_0xf446('0x4c'),_0x8d0ca[_0xf446('0x47')],_0x394180[_0xf446('0x4d')],md5(_0x394180[_0xf446('0x4d')]));}else{_0x394180[_0xf446('0x4e')]='';}headers['Authorization']=getAuth(_0x8d0ca);return getUser(_0x8d0ca,_0x34a7e4[_0xf446('0x4f')])[_0xf446('0x13')](function(_0x32bc18){_0x1276f8=_0x32bc18;logger[_0xf446('0xd')](_0xf446('0x50'),_0x1276f8['id']);return getEndUser(_0x8d0ca,_0x394180[_0xf446('0x51')],_0x394180[_0xf446('0x52')]);})[_0xf446('0x13')](function(_0x1809fe){_0x22b059=_0x1809fe;logger[_0xf446('0xd')](_0xf446('0x53'),_0x22b059['id']);return getTicket(_0x8d0ca,_0x1276f8,_0x22b059,_0xf560eb,_0x394180);})[_0xf446('0x13')](function(_0x35e77f){if(_0x35e77f){logger[_0xf446('0xd')](_0xf446('0x54'));logger[_0xf446('0xd')]('The\x20Ticket\x20ID\x20is:',_0x35e77f['id']);switch(_0x8d0ca[_0xf446('0x2d')]){case _0xf446('0x55'):logger['info'](_0xf446('0x4a'),_0xf446('0x56'));emit(util[_0xf446('0xf')](_0xf446('0x57'),_0x34a7e4[_0xf446('0x38')]),'trigger:desk:display',{'recordId':_0x35e77f['id']});break;case'newTab':logger[_0xf446('0xd')](_0xf446('0x4a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf446('0xf')]('user:%s',_0x34a7e4['name']),'trigger:browser:url',{'uri':util['format'](_0xf446('0x58'),_0x35e77f['id'])});break;default:logger['error']('[QUEUE]',_0xf446('0x59'));}}})[_0xf446('0x5a')](function(_0x8df75){console[_0xf446('0x5b')](_0x8df75);logger['error'](_0xf446('0x4a'),JSON['stringify'](_0x8df75));});};exports[_0xf446('0x5c')]=function(_0x440ffd,_0x7111f4,_0x69f2b4,_0x2d5de7,_0x5d9e82,_0x420d21,_0x55038c){var _0x5480bd,_0x2a6597;_0x420d21[_0xf446('0x16')]=intUtil[_0xf446('0x48')](_0x420d21[_0xf446('0x16')]);_0x420d21['serverUrl']=intUtil[_0xf446('0x48')](_0x420d21[_0xf446('0x47')]);if(_0x55038c&&_0x55038c[_0xf446('0x5d')]&&_0x55038c[_0xf446('0x5d')]!=='none'){logger[_0xf446('0xd')](_0xf446('0x5e'),_0xf446('0x4b'));_0x7111f4['recordingURL']=util[_0xf446('0xf')](_0xf446('0x4c'),_0x420d21[_0xf446('0x47')],_0x7111f4[_0xf446('0x4d')],md5(_0x7111f4[_0xf446('0x4d')]));}headers[_0xf446('0x5f')]=getAuth(_0x420d21);return getUser(_0x420d21,_0x2d5de7[_0xf446('0x4f')])['then'](function(_0x5847e5){_0x5480bd=_0x5847e5;logger['info']('The\x20User\x20ID\x20is:',_0x5480bd['id']);return getEndUser(_0x420d21,_0x7111f4['destcalleridname'],_0x7111f4[_0xf446('0x60')]);})['then'](function(_0x126a6c){_0x2a6597=_0x126a6c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2a6597['id']);return getTicket(_0x420d21,_0x5480bd,_0x2a6597,_0x69f2b4,_0x7111f4);})['then'](function(_0x475cc3){if(_0x475cc3){logger[_0xf446('0xd')](_0xf446('0x54'));logger[_0xf446('0xd')](_0xf446('0x61'),_0x475cc3['id']);switch(_0x420d21[_0xf446('0x2d')]){case _0xf446('0x55'):logger[_0xf446('0xd')](_0xf446('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf446('0xf')](_0xf446('0x57'),_0x2d5de7['name']),_0xf446('0x62'),{'recordId':_0x475cc3['id']});break;case'newTab':logger[_0xf446('0xd')](_0xf446('0x4a'),_0xf446('0x63'));emit(util[_0xf446('0xf')]('user:%s',_0x2d5de7[_0xf446('0x38')]),'trigger:browser:url',{'uri':util[_0xf446('0xf')](_0xf446('0x64'),_0x420d21[_0xf446('0x16')],_0x475cc3['id'])});break;default:logger[_0xf446('0x5b')]('[OUTBOUND]',_0xf446('0x59'));}}})[_0xf446('0x5a')](function(_0x12c5bb){logger['error'](_0xf446('0x5e'),JSON[_0xf446('0x18')](_0x12c5bb));});};exports[_0xf446('0x65')]=function(_0x17f41a,_0x13caf2,_0x1efa0b,_0x3e9df,_0x3d2464,_0xf2ff2){var _0x6d1c01,_0x10c265;_0xf2ff2['remoteUri']=intUtil[_0xf446('0x48')](_0xf2ff2['remoteUri']);_0xf2ff2[_0xf446('0x47')]=intUtil[_0xf446('0x48')](_0xf2ff2['serverUrl']);if(_0x3d2464&&_0x3d2464['monitor_format']){logger[_0xf446('0xd')](_0xf446('0x66'),'Recording\x20is\x20enabled!');_0x13caf2[_0xf446('0x4e')]=util['format'](_0xf446('0x4c'),_0xf2ff2[_0xf446('0x47')],_0x13caf2['uniqueid'],md5(_0x13caf2[_0xf446('0x4d')]));}else{_0x13caf2[_0xf446('0x4e')]='';}headers[_0xf446('0x5f')]=getAuth(_0xf2ff2);return getUser(_0xf2ff2)[_0xf446('0x13')](function(_0x139619){_0x6d1c01=_0x139619;logger[_0xf446('0xd')](_0xf446('0x50'),_0x6d1c01['id']);return getEndUser(_0xf2ff2,_0x13caf2[_0xf446('0x51')],_0x13caf2[_0xf446('0x52')]);})[_0xf446('0x13')](function(_0x5b5552){_0x10c265=_0x5b5552;logger['info']('The\x20Enduser\x20ID\x20is:',_0x10c265['id']);return getTicket(_0xf2ff2,_0x6d1c01,_0x10c265,_0x1efa0b,_0x13caf2);})[_0xf446('0x13')](function(_0x35b247){if(_0x35b247){logger[_0xf446('0xd')](_0xf446('0x54'));logger[_0xf446('0xd')]('The\x20Ticket\x20ID\x20is:',_0x35b247['id']);}})[_0xf446('0x5a')](function(_0x478ac1){logger['error'](_0xf446('0x66'),JSON[_0xf446('0x18')](_0x478ac1));});}; \ 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 c23677c..5f980c0 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 _0x611b=['recordingFormat','none','[OUTBOUND]','recordingURL',']\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','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','socket.io-emitter','POST','clientId','remoteUri','password','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','calleridnum','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1','outbound','contactid',']\x20Enduser\x20created!','type','string','nameField','customField','toLowerCase','indexOf','ticketType','incident','assign','getString','Subjects','/contacts(','Fields','phonecall','phonecalls','Descriptions','callDirection','queue','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x611b,0xca));var _0xb611=function(_0x47da3c,_0x1ab06d){_0x47da3c=_0x47da3c-0x0;var _0x1d0942=_0x611b[_0x47da3c];return _0x1d0942;};'use strict';var _=require('lodash');var BPromise=require(_0xb611('0x0'));var rp=require(_0xb611('0x1'));var util=require(_0xb611('0x2'));var intUtil=require('./util');var md5=require(_0xb611('0x3'));var Redis=require(_0xb611('0x4'));var logger=require(_0xb611('0x5'))('dynamics365');var config=require(_0xb611('0x6'));config[_0xb611('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb611('0x8'))(new Redis(config[_0xb611('0x7')]));function getAuthToken(_0x4768fa,_0x4c39a8,_0xd66748){var _0x192c84={'method':_0xb611('0x9'),'uri':_0x4c39a8,'form':{'client_id':_0x4768fa[_0xb611('0xa')],'resource':_0x4768fa[_0xb611('0xb')],'username':_0x4768fa['username'],'password':_0x4768fa[_0xb611('0xc')],'grant_type':_0xb611('0xc'),'client_secret':_0x4768fa['clientSecret']},'json':!![]};return rp(_0x192c84)[_0xb611('0xd')](function(_0x56d8b8){return _0x56d8b8['access_token'];})[_0xb611('0xe')](function(_0x1a7c13){logger[_0xb611('0xf')]('['+[_0xd66748[_0xb611('0x10')]()]+_0xb611('0x11'));return _0x1a7c13[_0xb611('0x12')];});}function getUser(_0x43ed4a,_0x3508ed,_0x3d4be9,_0x5a8eae,_0xab418,_0x34bea6){return new BPromise(function(_0x50fb82,_0x1c0a94){return getAuthToken(_0x3508ed,_0x5a8eae,_0x34bea6)[_0xb611('0xd')](function(_0x47e87c){var _0x1f4a36={'method':'GET','uri':_0xab418+_0xb611('0x13'),'headers':{'Authorization':_0xb611('0x14')+_0x47e87c,'OData-Version':_0xb611('0x15')},'json':!![]};return rp(_0x1f4a36);})[_0xb611('0xd')](function(_0x3023b8){var _0xa0e499=_0x3023b8[_0xb611('0x16')];var _0x20b0ec=![];var _0x36395c=null;if(!_['isNil'](_0x3d4be9)){if(intUtil[_0xb611('0x17')](_0x3d4be9[_0xb611('0x18')])){_0x43ed4a[_0xb611('0x19')]=_0x3d4be9[_0xb611('0x18')];for(_0x36395c=0x0;_0x36395c<_0xa0e499[_0xb611('0x1a')];_0x36395c++){if(_0xa0e499[_0x36395c][_0xb611('0x1b')]===_0x3d4be9[_0xb611('0x18')]&&!_0xa0e499[_0x36395c][_0xb611('0x1c')]){_0x20b0ec=!![];logger[_0xb611('0x1d')]('['+[_0x34bea6[_0xb611('0x10')]()]+_0xb611('0x1e')+_0xa0e499[_0x36395c][_0xb611('0x1f')]+'!');_0x43ed4a[_0xb611('0x20')]=_0xa0e499[_0x36395c][_0xb611('0x1f')];}}}}if(!_0x20b0ec){logger['info']('['+[_0x34bea6['toUpperCase']()]+_0xb611('0x21'));_0x43ed4a[_0xb611('0x19')]=_0x3508ed['username'];for(_0x36395c=0x0;_0x36395c<_0xa0e499[_0xb611('0x1a')];_0x36395c++){if(_0xa0e499[_0x36395c][_0xb611('0x1b')]===_0x3508ed['username']){_0x43ed4a[_0xb611('0x20')]=_0xa0e499[_0x36395c][_0xb611('0x1f')];}}}_0x50fb82(_0x43ed4a);})[_0xb611('0xe')](function(_0x3359d7){_0x1c0a94(_0x3359d7['message']);});});}function createEndUser(_0x5a9188,_0x5ced8b,_0x2bf3d6,_0x383cd6,_0x6d7035,_0x5aba07){return new BPromise(function(_0xbcc804,_0x1822d9){return getAuthToken(_0x5ced8b,_0x2bf3d6,_0x5aba07)['then'](function(_0x115f45){var _0x5c95df=_0x5aba07['toLowerCase']()==='outbound'?_0x6d7035['destcalleridnum']:_0x6d7035[_0xb611('0x22')];var _0x47abcf={'method':_0xb611('0x9'),'uri':_0x383cd6+_0xb611('0x23'),'body':{'telephone1':_0x5c95df,'fullname':_0x5c95df,'firstname':_0x5c95df,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb611('0x24')+_0x5a9188[_0xb611('0x20')]+')'},'headers':{'Authorization':_0xb611('0x14')+_0x115f45,'OData-Version':_0xb611('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x47abcf);})['then'](function(_0x193c3f){var _0x450c34=_0x193c3f['headers'][_0xb611('0x25')];var _0x15071f=_0x450c34[_0xb611('0x26')](_0x450c34['lastIndexOf']('(')+0x1,_0x450c34[_0xb611('0x27')](')'));_0x5a9188[_0xb611('0x28')]=_0x15071f;_0xbcc804(_0x5a9188);})[_0xb611('0xe')](function(_0x42a435){_0x1822d9(_0x42a435['message']);});});}function getEndUser(_0x32f61d,_0x10ce0f,_0x26bf17,_0x367465,_0x43c306,_0x46304e){return new BPromise(function(_0x2b3f2c,_0x17b736){return getAuthToken(_0x10ce0f,_0x26bf17,_0x46304e)[_0xb611('0xd')](function(_0x300c8b){var _0x13ff9d={'method':_0xb611('0x29'),'uri':_0x367465+_0xb611('0x2a'),'headers':{'Authorization':_0xb611('0x14')+_0x300c8b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x13ff9d);})[_0xb611('0xd')](function(_0xf317d){var _0x46b9f2=null;if(_0xf317d){var _0x1b4e27=_0xf317d[_0xb611('0x16')];var _0x2eac27=![];for(_0x46b9f2=0x0;_0x46b9f2<_0x1b4e27[_0xb611('0x1a')];_0x46b9f2++){var _0x277375=_0x46304e['toLowerCase']()===_0xb611('0x2b')?_0x43c306['destcalleridnum']:_0x43c306['calleridnum'];if(_0x1b4e27[_0x46b9f2]['telephone1']===_0x277375){_0x2eac27=!![];_0x32f61d['enduserId']=_0x1b4e27[_0x46b9f2][_0xb611('0x2c')];}}if(_0x2eac27){_0x2b3f2c(_0x32f61d);}else{return createEndUser(_0x32f61d,_0x10ce0f,_0x26bf17,_0x367465,_0x43c306,_0x46304e)[_0xb611('0xd')](function(_0x598d88){logger[_0xb611('0x1d')]('['+[_0x46304e[_0xb611('0x10')]()]+_0xb611('0x2d'),_0x598d88[_0xb611('0x28')]);_0x2b3f2c(_0x598d88);});}}else{return createEndUser(_0x32f61d,_0x10ce0f,_0x26bf17,_0x367465,_0x43c306,_0x46304e)[_0xb611('0xd')](function(_0x12c4ff){logger[_0xb611('0x1d')]('['+[_0x46304e[_0xb611('0x10')]()]+']\x20Enduser\x20Created!',_0x12c4ff[_0xb611('0x28')]);_0x2b3f2c(_0x12c4ff);});}});});}function getCustomFields(_0x3f4cb9,_0x1a9a67,_0x370130){var _0xcea08={};if(_0x3f4cb9['length']>0x0){_['forEach'](_0x3f4cb9,function(_0x295b45){if(_0x295b45[_0xb611('0x2e')]===_0xb611('0x2f')&&_0x295b45[_0xb611('0x30')]&&!_0x295b45[_0xb611('0x31')]){var _0x51335b=_0x295b45['idField'][_0xb611('0x32')]();var _0x3208bd=_0x51335b[_0xb611('0x26')](0x0,_0x51335b[_0xb611('0x33')]('_'));var _0x2cd508=_0x51335b[_0xb611('0x26')](_0x51335b[_0xb611('0x33')]('_')+0x1);if(_0x3208bd===_0x370130){_0xcea08[_0x2cd508]=_0x295b45['content'];}}});}return _0xcea08;}function getTicket(_0x7df16d,_0x5c18c6,_0x85a52b,_0x318823,_0x1de0c7,_0x30f813,_0x3c5cf0){return new BPromise(function(_0x3b0300,_0x52be88){var _0x11a125;return getAuthToken(_0x5c18c6,_0x85a52b,_0x3c5cf0)[_0xb611('0xd')](function(_0x5634be){if(_0x30f813[_0xb611('0x34')]===_0xb611('0x35')){_0x11a125={'method':'POST','uri':_0x318823+'incidents','body':Object[_0xb611('0x36')]({},{'title':intUtil[_0xb611('0x37')](_0x30f813[_0xb611('0x38')],_0x1de0c7,'\x20'),'description':intUtil[_0xb611('0x37')](_0x30f813['Descriptions'],_0x1de0c7,'\x0a'),'customerid_contact@odata.bind':_0xb611('0x39')+_0x7df16d['enduserId']+')','ownerid@odata.bind':_0xb611('0x24')+_0x7df16d['userId']+')','caseorigincode':'1'},getCustomFields(_0x30f813[_0xb611('0x3a')],_0x1de0c7,_0x30f813[_0xb611('0x34')])),'headers':{'Authorization':_0xb611('0x14')+_0x5634be,'OData-Version':_0xb611('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x30f813[_0xb611('0x34')]===_0xb611('0x3b')){_0x11a125={'method':_0xb611('0x9'),'uri':_0x318823+_0xb611('0x3c'),'body':Object[_0xb611('0x36')]({},{'subject':intUtil['getString'](_0x30f813['Subjects'],_0x1de0c7,'\x20'),'phonenumber':String(_0x1de0c7[_0xb611('0x22')]),'description':intUtil[_0xb611('0x37')](_0x30f813[_0xb611('0x3d')],_0x1de0c7,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb611('0x39')+_0x7df16d[_0xb611('0x28')]+')','ownerid@odata.bind':_0xb611('0x24')+_0x7df16d['userId']+')','directioncode':_0x7df16d[_0xb611('0x3e')]===_0xb611('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xb611('0x24')+_0x7df16d[_0xb611('0x20')]+')','participationtypemask':_0x7df16d[_0xb611('0x3e')]===_0xb611('0x3f')?0x2:0x1},{'partyid_contact@odata.bind':_0xb611('0x39')+_0x7df16d[_0xb611('0x28')]+')','participationtypemask':_0x7df16d['callDirection']===_0xb611('0x3f')?0x1:0x2}]},getCustomFields(_0x30f813[_0xb611('0x3a')],_0x1de0c7,_0x30f813[_0xb611('0x34')])),'headers':{'Authorization':_0xb611('0x14')+_0x5634be,'OData-Version':_0xb611('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x11a125);})[_0xb611('0xd')](function(_0x441eda){var _0x34a18d=_0x441eda[_0xb611('0x40')][_0xb611('0x25')];var _0xef7719=_0x34a18d['substring'](_0x34a18d[_0xb611('0x27')]('(')+0x1,_0x34a18d[_0xb611('0x27')](')'));_0x7df16d[_0xb611('0x41')]=_0xef7719;_0x3b0300(_0x7df16d);})[_0xb611('0xe')](function(_0x52709e){_0x52be88(_0x52709e[_0xb611('0x12')]);});});}function emit(_0x342303,_0xe69ad9,_0x27a6e9,_0x373f17){var _0x2995b4={'uri':util['format'](_0xb611('0x42'),_0x342303,_0x27a6e9,_0x373f17)};io['to'](util[_0xb611('0x43')](_0xb611('0x44'),_0xe69ad9))['emit'](_0xb611('0x45'),_0x2995b4);}exports['cs']=function(_0x2a1250,_0x391641,_0x3bcb9b,_0x42ef46,_0x2bc531,_0x3b1e1d,_0x18c070,_0x2b432f){var _0x16913b={};_0x3b1e1d['remoteUri']=intUtil[_0xb611('0x46')](_0x3b1e1d[_0xb611('0xb')]);_0x3b1e1d[_0xb611('0x47')]=intUtil[_0xb611('0x46')](_0x3b1e1d[_0xb611('0x47')]);_0x16913b['callDirection']=_0x2b432f==='queue'||_0x2b432f===_0xb611('0x48')?_0xb611('0x3f'):_0xb611('0x2b');var _0x15b14a=util[_0xb611('0x43')](_0xb611('0x49'),_0x3b1e1d[_0xb611('0xb')]);var _0x438be7=util[_0xb611('0x43')](_0xb611('0x4a'),_0x3b1e1d[_0xb611('0x4b')]);var _0x13419e=util[_0xb611('0x43')](_0xb611('0x4c'),_0x3b1e1d[_0xb611('0x47')],_0x391641['uniqueid'],md5(_0x391641[_0xb611('0x4d')]));if(_0x2bc531&&_0x2bc531[_0xb611('0x4e')]){logger[_0xb611('0x1d')]('[QUEUE]',_0xb611('0x4f'));_0x391641['recordingURL']=_0x13419e;}else if(_0x18c070&&_0x18c070[_0xb611('0x50')]&&_0x18c070[_0xb611('0x50')]!==_0xb611('0x51')){logger['info'](_0xb611('0x52'),_0xb611('0x4f'));_0x391641[_0xb611('0x53')]=_0x13419e;}else{_0x391641[_0xb611('0x53')]='';}return getUser(_0x16913b,_0x3b1e1d,_0x42ef46,_0x438be7,_0x15b14a,_0x2b432f)[_0xb611('0xd')](function(_0xae000){logger[_0xb611('0x1d')]('['+_0x2b432f[_0xb611('0x10')]()+_0xb611('0x54'),_0xae000[_0xb611('0x20')]);logger[_0xb611('0x1d')]('['+_0x2b432f['toUpperCase']()+_0xb611('0x55'),_0xae000[_0xb611('0x19')]);return getEndUser(_0xae000,_0x3b1e1d,_0x438be7,_0x15b14a,_0x391641,_0x2b432f);})[_0xb611('0xd')](function(_0x130ece){logger[_0xb611('0x1d')]('['+_0x2b432f[_0xb611('0x10')]()+_0xb611('0x56'),_0x130ece['enduserId']);logger[_0xb611('0x1d')]('['+_0x2b432f[_0xb611('0x10')]()+_0xb611('0x57'),_0x391641['calleridnum']);return getTicket(_0x130ece,_0x3b1e1d,_0x438be7,_0x15b14a,_0x391641,_0x3bcb9b,_0x2b432f);})[_0xb611('0xd')](function(_0x130955){logger[_0xb611('0x1d')](util['format']('['+_0x2b432f[_0xb611('0x10')]()+_0xb611('0x58'),_0x3bcb9b[_0xb611('0x34')],_0x130955[_0xb611('0x41')]));logger['info'](util[_0xb611('0x43')]('['+_0x2b432f[_0xb611('0x10')]()+_0xb611('0x59'),_0x2b432f));if(_0x2b432f!=='abandoned'){logger[_0xb611('0x1d')]('['+_0x2b432f[_0xb611('0x10')]()+']',_0xb611('0x5a'));emit(_0x3b1e1d['remoteUri'],_0x42ef46[_0xb611('0x5b')],_0x3bcb9b[_0xb611('0x34')],_0x130955[_0xb611('0x41')]);}})[_0xb611('0xe')](function(_0x4885c7){logger['error']('['+_0x2b432f[_0xb611('0x10')]()+_0xb611('0x5c'),util[_0xb611('0x5d')](_0x4885c7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1771=[']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','redis','defaults','localhost','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','validateEmail','email','userEmail','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','length','outbound','destcalleridnum','calleridnum','/systemusers(','userId','headers','substring','lastIndexOf','enduserId','toLowerCase','info',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','customField','idField','indexOf','content','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','assign','queue','callDirection','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId'];(function(_0x49d023,_0x19fca0){var _0x3e1d78=function(_0xfc36f2){while(--_0xfc36f2){_0x49d023['push'](_0x49d023['shift']());}};_0x3e1d78(++_0x19fca0);}(_0x1771,0x166));var _0x1177=function(_0x3bf767,_0xe193cb){_0x3bf767=_0x3bf767-0x0;var _0x57b138=_0x1771[_0x3bf767];return _0x57b138;};'use strict';var _=require(_0x1177('0x0'));var BPromise=require(_0x1177('0x1'));var rp=require(_0x1177('0x2'));var util=require(_0x1177('0x3'));var intUtil=require('./util');var md5=require(_0x1177('0x4'));var Redis=require(_0x1177('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require('../../../../config/environment');config[_0x1177('0x6')]=_[_0x1177('0x7')](config['redis'],{'host':_0x1177('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1177('0x6')]));function getAuthToken(_0x3b350c,_0x5a5e7f,_0x215df7){var _0x1acb03={'method':_0x1177('0x9'),'uri':_0x5a5e7f,'form':{'client_id':_0x3b350c[_0x1177('0xa')],'resource':_0x3b350c[_0x1177('0xb')],'username':_0x3b350c[_0x1177('0xc')],'password':_0x3b350c[_0x1177('0xd')],'grant_type':_0x1177('0xd'),'client_secret':_0x3b350c[_0x1177('0xe')]},'json':!![]};return rp(_0x1acb03)[_0x1177('0xf')](function(_0x39df29){return _0x39df29[_0x1177('0x10')];})[_0x1177('0x11')](function(_0x407371){logger[_0x1177('0x12')]('['+[_0x215df7[_0x1177('0x13')]()]+_0x1177('0x14'));return _0x407371[_0x1177('0x15')];});}function getUser(_0x74c0ba,_0x30555f,_0x56aeca,_0x569481,_0x3486d5,_0x3f73e0){return new BPromise(function(_0x30bedf,_0x7f2a0b){return getAuthToken(_0x30555f,_0x569481,_0x3f73e0)[_0x1177('0xf')](function(_0x2fa362){var _0x876364={'method':_0x1177('0x16'),'uri':_0x3486d5+_0x1177('0x17'),'headers':{'Authorization':_0x1177('0x18')+_0x2fa362,'OData-Version':_0x1177('0x19')},'json':!![]};return rp(_0x876364);})[_0x1177('0xf')](function(_0x3d0270){var _0x37d2e2=_0x3d0270[_0x1177('0x1a')];var _0x55a868=![];var _0x2dd4e5=null;if(!_['isNil'](_0x56aeca)){if(intUtil[_0x1177('0x1b')](_0x56aeca[_0x1177('0x1c')])){_0x74c0ba[_0x1177('0x1d')]=_0x56aeca[_0x1177('0x1c')];for(_0x2dd4e5=0x0;_0x2dd4e5<_0x37d2e2['length'];_0x2dd4e5++){if(_0x37d2e2[_0x2dd4e5][_0x1177('0x1e')]===_0x56aeca[_0x1177('0x1c')]&&!_0x37d2e2[_0x2dd4e5][_0x1177('0x1f')]){_0x55a868=!![];logger['info']('['+[_0x3f73e0[_0x1177('0x13')]()]+_0x1177('0x20')+_0x37d2e2[_0x2dd4e5]['systemuserid']+'!');_0x74c0ba['userId']=_0x37d2e2[_0x2dd4e5][_0x1177('0x21')];}}}}if(!_0x55a868){logger['info']('['+[_0x3f73e0['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x74c0ba[_0x1177('0x1d')]=_0x30555f[_0x1177('0xc')];for(_0x2dd4e5=0x0;_0x2dd4e5<_0x37d2e2[_0x1177('0x22')];_0x2dd4e5++){if(_0x37d2e2[_0x2dd4e5][_0x1177('0x1e')]===_0x30555f['username']){_0x74c0ba['userId']=_0x37d2e2[_0x2dd4e5][_0x1177('0x21')];}}}_0x30bedf(_0x74c0ba);})[_0x1177('0x11')](function(_0x5a548a){_0x7f2a0b(_0x5a548a[_0x1177('0x15')]);});});}function createEndUser(_0x4bfb18,_0xe7b4f8,_0x2cd560,_0x14d7e7,_0x507adb,_0x173df){return new BPromise(function(_0x31e367,_0x2b192a){return getAuthToken(_0xe7b4f8,_0x2cd560,_0x173df)[_0x1177('0xf')](function(_0x96e7bd){var _0x28c555=_0x173df['toLowerCase']()===_0x1177('0x23')?_0x507adb[_0x1177('0x24')]:_0x507adb[_0x1177('0x25')];var _0x579328={'method':'POST','uri':_0x14d7e7+'contacts','body':{'telephone1':_0x28c555,'fullname':_0x28c555,'firstname':_0x28c555,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1177('0x26')+_0x4bfb18[_0x1177('0x27')]+')'},'headers':{'Authorization':_0x1177('0x18')+_0x96e7bd,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x579328);})[_0x1177('0xf')](function(_0x96c2e1){var _0x26e2dd=_0x96c2e1[_0x1177('0x28')]['odata-entityid'];var _0x262041=_0x26e2dd[_0x1177('0x29')](_0x26e2dd[_0x1177('0x2a')]('(')+0x1,_0x26e2dd[_0x1177('0x2a')](')'));_0x4bfb18[_0x1177('0x2b')]=_0x262041;_0x31e367(_0x4bfb18);})[_0x1177('0x11')](function(_0x51f3b4){_0x2b192a(_0x51f3b4[_0x1177('0x15')]);});});}function getEndUser(_0x25d339,_0x3a2c60,_0x4a6b20,_0x54f661,_0xe554a8,_0x2323c5){return new BPromise(function(_0x46911e,_0x143fe5){return getAuthToken(_0x3a2c60,_0x4a6b20,_0x2323c5)[_0x1177('0xf')](function(_0x30efc4){var _0x37cadc={'method':_0x1177('0x16'),'uri':_0x54f661+'contacts?$select=telephone1','headers':{'Authorization':_0x1177('0x18')+_0x30efc4,'If-None-Match':null,'OData-Version':_0x1177('0x19')},'json':!![]};return rp(_0x37cadc);})[_0x1177('0xf')](function(_0x5c65d4){var _0x35916f=null;if(_0x5c65d4){var _0x3ff852=_0x5c65d4[_0x1177('0x1a')];var _0x575695=![];for(_0x35916f=0x0;_0x35916f<_0x3ff852[_0x1177('0x22')];_0x35916f++){var _0x15cf80=_0x2323c5[_0x1177('0x2c')]()===_0x1177('0x23')?_0xe554a8[_0x1177('0x24')]:_0xe554a8[_0x1177('0x25')];if(_0x3ff852[_0x35916f]['telephone1']===_0x15cf80){_0x575695=!![];_0x25d339[_0x1177('0x2b')]=_0x3ff852[_0x35916f]['contactid'];}}if(_0x575695){_0x46911e(_0x25d339);}else{return createEndUser(_0x25d339,_0x3a2c60,_0x4a6b20,_0x54f661,_0xe554a8,_0x2323c5)['then'](function(_0x4af24b){logger[_0x1177('0x2d')]('['+[_0x2323c5[_0x1177('0x13')]()]+_0x1177('0x2e'),_0x4af24b['enduserId']);_0x46911e(_0x4af24b);});}}else{return createEndUser(_0x25d339,_0x3a2c60,_0x4a6b20,_0x54f661,_0xe554a8,_0x2323c5)[_0x1177('0xf')](function(_0x2468ef){logger[_0x1177('0x2d')]('['+[_0x2323c5[_0x1177('0x13')]()]+_0x1177('0x2f'),_0x2468ef['enduserId']);_0x46911e(_0x2468ef);});}});});}function getCustomFields(_0x9c309b,_0x5f826c,_0x4267ce){var _0x41db67={};if(_0x9c309b['length']>0x0){_[_0x1177('0x30')](_0x9c309b,function(_0x52c90d){if(_0x52c90d['type']===_0x1177('0x31')&&_0x52c90d['nameField']&&!_0x52c90d[_0x1177('0x32')]){var _0x4d3d65=_0x52c90d[_0x1177('0x33')][_0x1177('0x2c')]();var _0x1e04c7=_0x4d3d65['substring'](0x0,_0x4d3d65[_0x1177('0x34')]('_'));var _0x5caa46=_0x4d3d65[_0x1177('0x29')](_0x4d3d65[_0x1177('0x34')]('_')+0x1);if(_0x1e04c7===_0x4267ce){_0x41db67[_0x5caa46]=_0x52c90d[_0x1177('0x35')];}}});}return _0x41db67;}function getTicket(_0x5cefc5,_0x5c9a55,_0x29383d,_0x4359e0,_0x57ef76,_0x146dd3,_0x127353){return new BPromise(function(_0x5d0ef9,_0x44244b){var _0x4d07c7;return getAuthToken(_0x5c9a55,_0x29383d,_0x127353)[_0x1177('0xf')](function(_0x24bbc6){if(_0x146dd3['ticketType']==='incident'){_0x4d07c7={'method':_0x1177('0x9'),'uri':_0x4359e0+'incidents','body':Object['assign']({},{'title':intUtil[_0x1177('0x36')](_0x146dd3['Subjects'],_0x57ef76,'\x20'),'description':intUtil[_0x1177('0x36')](_0x146dd3[_0x1177('0x37')],_0x57ef76,'\x0a'),'customerid_contact@odata.bind':_0x1177('0x38')+_0x5cefc5[_0x1177('0x2b')]+')','ownerid@odata.bind':'/systemusers('+_0x5cefc5[_0x1177('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x146dd3[_0x1177('0x39')],_0x57ef76,_0x146dd3['ticketType'])),'headers':{'Authorization':_0x1177('0x18')+_0x24bbc6,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x146dd3[_0x1177('0x3a')]===_0x1177('0x3b')){_0x4d07c7={'method':'POST','uri':_0x4359e0+_0x1177('0x3c'),'body':Object[_0x1177('0x3d')]({},{'subject':intUtil[_0x1177('0x36')](_0x146dd3['Subjects'],_0x57ef76,'\x20'),'phonenumber':String(_0x57ef76[_0x1177('0x25')]),'description':intUtil['getString'](_0x146dd3[_0x1177('0x37')],_0x57ef76,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1177('0x38')+_0x5cefc5[_0x1177('0x2b')]+')','ownerid@odata.bind':_0x1177('0x26')+_0x5cefc5[_0x1177('0x27')]+')','directioncode':_0x5cefc5['callDirection']===_0x1177('0x3e')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x1177('0x26')+_0x5cefc5['userId']+')','participationtypemask':_0x5cefc5[_0x1177('0x3f')]===_0x1177('0x3e')?0x2:0x1},{'partyid_contact@odata.bind':_0x1177('0x38')+_0x5cefc5[_0x1177('0x2b')]+')','participationtypemask':_0x5cefc5[_0x1177('0x3f')]===_0x1177('0x3e')?0x1:0x2}]},getCustomFields(_0x146dd3[_0x1177('0x39')],_0x57ef76,_0x146dd3['ticketType'])),'headers':{'Authorization':_0x1177('0x18')+_0x24bbc6,'OData-Version':_0x1177('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4d07c7);})[_0x1177('0xf')](function(_0x16edfb){var _0x4d78d5=_0x16edfb['headers'][_0x1177('0x40')];var _0x917e21=_0x4d78d5[_0x1177('0x29')](_0x4d78d5[_0x1177('0x2a')]('(')+0x1,_0x4d78d5[_0x1177('0x2a')](')'));_0x5cefc5['ticketId']=_0x917e21;_0x5d0ef9(_0x5cefc5);})[_0x1177('0x11')](function(_0x257166){_0x44244b(_0x257166[_0x1177('0x15')]);});});}function emit(_0x1335cb,_0xbbc307,_0x2be85a,_0x11974e){var _0x5cd064={'uri':util[_0x1177('0x41')](_0x1177('0x42'),_0x1335cb,_0x2be85a,_0x11974e)};io['to'](util[_0x1177('0x41')](_0x1177('0x43'),_0xbbc307))[_0x1177('0x44')]('trigger:browser:url',_0x5cd064);}exports['cs']=function(_0x364d31,_0xd2bc10,_0x49ea80,_0x493254,_0x6cc95b,_0x1c919e,_0x3fde63,_0x20738c){var _0x3bd12d={};_0x1c919e[_0x1177('0xb')]=intUtil[_0x1177('0x45')](_0x1c919e[_0x1177('0xb')]);_0x1c919e[_0x1177('0x46')]=intUtil['stripTrailingSlash'](_0x1c919e[_0x1177('0x46')]);_0x3bd12d[_0x1177('0x3f')]=_0x20738c===_0x1177('0x3e')||_0x20738c===_0x1177('0x47')?_0x1177('0x3e'):_0x1177('0x23');var _0x139421=util[_0x1177('0x41')](_0x1177('0x48'),_0x1c919e['remoteUri']);var _0x1408d0=util[_0x1177('0x41')]('https://login.microsoftonline.com/%s/oauth2/token',_0x1c919e[_0x1177('0x49')]);var _0x3e68a1=util['format'](_0x1177('0x4a'),_0x1c919e[_0x1177('0x46')],_0xd2bc10[_0x1177('0x4b')],md5(_0xd2bc10['uniqueid']));if(_0x6cc95b&&_0x6cc95b[_0x1177('0x4c')]){logger[_0x1177('0x2d')]('[QUEUE]',_0x1177('0x4d'));_0xd2bc10[_0x1177('0x4e')]=_0x3e68a1;}else if(_0x3fde63&&_0x3fde63[_0x1177('0x4f')]&&_0x3fde63[_0x1177('0x4f')]!==_0x1177('0x50')){logger['info'](_0x1177('0x51'),_0x1177('0x4d'));_0xd2bc10[_0x1177('0x4e')]=_0x3e68a1;}else{_0xd2bc10[_0x1177('0x4e')]='';}return getUser(_0x3bd12d,_0x1c919e,_0x493254,_0x1408d0,_0x139421,_0x20738c)[_0x1177('0xf')](function(_0x361361){logger[_0x1177('0x2d')]('['+_0x20738c['toUpperCase']()+_0x1177('0x52'),_0x361361[_0x1177('0x27')]);logger[_0x1177('0x2d')]('['+_0x20738c[_0x1177('0x13')]()+']\x20The\x20User\x20email\x20is:',_0x361361[_0x1177('0x1d')]);return getEndUser(_0x361361,_0x1c919e,_0x1408d0,_0x139421,_0xd2bc10,_0x20738c);})[_0x1177('0xf')](function(_0x44c2d7){logger[_0x1177('0x2d')]('['+_0x20738c[_0x1177('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x44c2d7['enduserId']);logger[_0x1177('0x2d')]('['+_0x20738c[_0x1177('0x13')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xd2bc10[_0x1177('0x25')]);return getTicket(_0x44c2d7,_0x1c919e,_0x1408d0,_0x139421,_0xd2bc10,_0x49ea80,_0x20738c);})['then'](function(_0x2ffaac){logger[_0x1177('0x2d')](util[_0x1177('0x41')]('['+_0x20738c[_0x1177('0x13')]()+_0x1177('0x53'),_0x49ea80[_0x1177('0x3a')],_0x2ffaac['ticketId']));logger[_0x1177('0x2d')](util[_0x1177('0x41')]('['+_0x20738c['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x20738c));if(_0x20738c!==_0x1177('0x47')){logger[_0x1177('0x2d')]('['+_0x20738c[_0x1177('0x13')]()+']',_0x1177('0x54'));emit(_0x1c919e['remoteUri'],_0x493254[_0x1177('0x55')],_0x49ea80['ticketType'],_0x2ffaac[_0x1177('0x56')]);}})[_0x1177('0x11')](function(_0x226cbe){logger[_0x1177('0x12')]('['+_0x20738c[_0x1177('0x13')]()+_0x1177('0x57'),util[_0x1177('0x58')](_0x226cbe,{'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 775bf4c..db40fe5 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 _0x27fd=['push','content','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','The\x20Ticket\x20ID\x20is:','trigger:browser:url','[ABANDONED]','catch','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','mapValues','custom_fields','value','format','%s/api/v2/tickets','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','remoteUri','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','stringify','GET','length','map','type','string','customField','nameField','toLowerCase','idField'];(function(_0x9f6be9,_0x4f59a9){var _0x54b04d=function(_0x143a94){while(--_0x143a94){_0x9f6be9['push'](_0x9f6be9['shift']());}};_0x54b04d(++_0x4f59a9);}(_0x27fd,0x74));var _0xd27f=function(_0x2ce6c4,_0x1493e0){_0x2ce6c4=_0x2ce6c4-0x0;var _0x3fa5ef=_0x27fd[_0x2ce6c4];return _0x3fa5ef;};'use strict';var _=require(_0xd27f('0x0'));var rp=require(_0xd27f('0x1'));var md5=require('md5');var util=require(_0xd27f('0x2'));var Redis=require('ioredis');var intUtil=require(_0xd27f('0x3'));var config=require(_0xd27f('0x4'));var logger=require(_0xd27f('0x5'))(_0xd27f('0x6'));config[_0xd27f('0x7')]=_[_0xd27f('0x8')](config[_0xd27f('0x7')],{'host':_0xd27f('0x9'),'port':0x18eb});var io=require(_0xd27f('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0xd27f('0xb'),'Accept':_0xd27f('0xb')};function emit(_0x1b2389,_0x3467e2,_0x1b0e81){io['to'](_0x1b2389)[_0xd27f('0xc')](_0x3467e2,_0x1b0e81);}function getTicket(_0x464a48,_0x53f76e,_0xa9b67e,_0x5104d5,_0x38ec4d){logger['info'](_0xd27f('0xd'));var _0x2c9f8f=_['merge']({'responder_id':_0x53f76e['id'],'requester_id':_0xa9b67e['id'],'name':util['format']('Caller\x20-\x20%s',_0x38ec4d[_0xd27f('0xe')]),'phone':_0x38ec4d[_0xd27f('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd27f('0x10')](_0x5104d5[_0xd27f('0x11')],_0x38ec4d,'\x20'),'description':intUtil[_0xd27f('0x10')](_0x5104d5[_0xd27f('0x12')],_0x38ec4d,_0xd27f('0x13')),'tags':getTags(_0x5104d5[_0xd27f('0x14')],'name')},getCustomFields(_0x5104d5[_0xd27f('0x15')],_0x38ec4d));_0x2c9f8f['custom_fields']=_[_0xd27f('0x16')](_['keyBy'](_0x2c9f8f[_0xd27f('0x17')],'id'),_0xd27f('0x18'));return request({'uri':util[_0xd27f('0x19')](_0xd27f('0x1a'),_0x464a48['remoteUri']),'method':_0xd27f('0x1b'),'body':_0x2c9f8f})[_0xd27f('0x1c')](function(_0x190fdf){logger[_0xd27f('0x1d')](_0xd27f('0x1e'));return _0x190fdf;});}function getUser(_0x26999a,_0x3c794c){if(intUtil[_0xd27f('0x1f')](_0x3c794c)){return request({'uri':util[_0xd27f('0x19')](_0xd27f('0x20'),_0x26999a['remoteUri']),'qs':{'email':_0x3c794c}})['then'](function(_0x3c48d0){if(_0x3c48d0['length']){logger[_0xd27f('0x1d')](_0xd27f('0x21'));return _[_0xd27f('0x22')](_0x3c48d0,function(_0x1ea447){return _0x1ea447['contact'][_0xd27f('0x23')]===_0x3c794c;});}else{logger[_0xd27f('0x1d')](_0xd27f('0x24'));return request({'uri':util[_0xd27f('0x19')](_0xd27f('0x25'),_0x26999a['remoteUri'])})[_0xd27f('0x1c')](function(_0x21e1d9){logger[_0xd27f('0x1d')]('Admin\x20account\x20selected.');return _0x21e1d9;});}});}else{logger[_0xd27f('0x1d')](_0xd27f('0x26'));return request({'uri':util[_0xd27f('0x19')](_0xd27f('0x25'),_0x26999a[_0xd27f('0x27')])})[_0xd27f('0x1c')](function(_0x1f3684){logger[_0xd27f('0x1d')]('Admin\x20account\x20selected.');return _0x1f3684;});}}function getEndUser(_0x2f1d6e,_0x1721d9,_0x1eb780){logger[_0xd27f('0x1d')]('Searching\x20enduser\x20with\x20phone',_0x1eb780);return request({'uri':util[_0xd27f('0x19')](_0xd27f('0x28'),_0x2f1d6e[_0xd27f('0x27')]),'qs':{'phone':_0x1eb780}})[_0xd27f('0x1c')](function(_0x59dcba){if(_0x59dcba['length']){logger[_0xd27f('0x1d')](_0xd27f('0x29'));return _[_0xd27f('0x22')](_0x59dcba,{'phone':_0x1eb780});}else{logger[_0xd27f('0x1d')](_0xd27f('0x2a'));return request({'uri':util[_0xd27f('0x19')](_0xd27f('0x28'),_0x2f1d6e[_0xd27f('0x27')]),'method':_0xd27f('0x1b'),'body':{'name':_0x1721d9,'phone':_0x1eb780}})['then'](function(_0x4b8ba7){logger['info'](_0xd27f('0x2b'));return _0x4b8ba7;});}});}function getAuth(_0x1c856d){return util[_0xd27f('0x19')](_0xd27f('0x2c'),new Buffer(_0x1c856d[_0xd27f('0x2d')]+':X')[_0xd27f('0x2e')]('base64'));}function request(_0x190812){logger[_0xd27f('0x2f')]('[HTTP]',JSON[_0xd27f('0x30')](_0x190812));return rp(_[_0xd27f('0x8')](_0x190812,{'method':_0xd27f('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x1b5746,_0x23ddf2){var _0x57d8eb=[];if(_0x1b5746&&_0x1b5746[_0xd27f('0x32')]>0x0){_0x57d8eb=_[_0xd27f('0x33')](_0x1b5746,_0x23ddf2);}return _0x57d8eb;}function getCustomFields(_0x444f1b,_0x4be393){var _0x4983e4=[];var _0x1f5c30={'custom_fields':[]};if(_0x444f1b[_0xd27f('0x32')]>0x0){_['forEach'](_0x444f1b,function(_0x4b30e7){if(_0x4b30e7[_0xd27f('0x34')]===_0xd27f('0x35')&&_0x4b30e7['nameField']&&!_0x4b30e7[_0xd27f('0x36')]){_0x1f5c30[_0x4b30e7[_0xd27f('0x37')][_0xd27f('0x38')]()]=_0x4b30e7['content'][_0xd27f('0x2e')]();}else if(_0x4b30e7[_0xd27f('0x34')]===_0xd27f('0x35')&&_0x4b30e7[_0xd27f('0x39')]&&_0x4b30e7[_0xd27f('0x36')]){_0x1f5c30[_0xd27f('0x17')][_0xd27f('0x3a')]({'id':_0x4b30e7[_0xd27f('0x39')],'value':_0x4b30e7[_0xd27f('0x3b')][_0xd27f('0x2e')]()});}else if(_0x4b30e7[_0xd27f('0x34')]===_0xd27f('0x3c')&&_0x4b30e7['variableName']&&_0x4b30e7[_0xd27f('0x39')]&&_0x4b30e7[_0xd27f('0x36')]){_0x4be393[_0x4b30e7[_0xd27f('0x3d')]]&&_0x1f5c30[_0xd27f('0x17')][_0xd27f('0x3a')]({'id':_0x4b30e7['idField'],'value':_0x4be393[_0x4b30e7[_0xd27f('0x3d')]]['toString']()});}else if(_0x4b30e7['type']===_0xd27f('0x3e')&&_0x4b30e7['Variable']&&_0x4b30e7[_0xd27f('0x3f')][_0xd27f('0x40')]&&_0x4b30e7[_0xd27f('0x39')]&&_0x4b30e7['customField']){_0x4be393[_0x4b30e7[_0xd27f('0x3f')][_0xd27f('0x40')][_0xd27f('0x38')]()]&&_0x1f5c30['custom_fields'][_0xd27f('0x3a')]({'id':_0x4b30e7['idField'],'value':_0x4be393[_0x4b30e7['Variable'][_0xd27f('0x40')][_0xd27f('0x38')]()][_0xd27f('0x2e')]()});}});}return _0x1f5c30;}exports[_0xd27f('0x41')]=function(_0x50afe3,_0x5540b9,_0x2dc7c0,_0x50186a,_0x93b679,_0x349070){var _0x2449ff,_0x809b81;_0x349070[_0xd27f('0x27')]=intUtil[_0xd27f('0x42')](_0x349070['remoteUri']);_0x349070[_0xd27f('0x43')]=intUtil[_0xd27f('0x42')](_0x349070[_0xd27f('0x43')]);if(_0x93b679&&_0x93b679[_0xd27f('0x44')]){logger[_0xd27f('0x1d')]('[QUEUE]',_0xd27f('0x45'));_0x5540b9[_0xd27f('0x46')]=util[_0xd27f('0x19')](_0xd27f('0x47'),_0x349070['serverUrl'],_0x5540b9[_0xd27f('0x48')],md5(_0x5540b9[_0xd27f('0x48')]));}else{_0x5540b9[_0xd27f('0x46')]='';}headers[_0xd27f('0x49')]=getAuth(_0x349070);return getUser(_0x349070,_0x50186a['email'])[_0xd27f('0x1c')](function(_0x4fbdf6){_0x2449ff=_0x4fbdf6;logger[_0xd27f('0x1d')]('The\x20User\x20ID\x20is:',_0x2449ff['id']);return getEndUser(_0x349070,_0x5540b9['calleridname'],_0x5540b9[_0xd27f('0xf')]);})[_0xd27f('0x1c')](function(_0x463a73){_0x809b81=_0x463a73;logger[_0xd27f('0x1d')](_0xd27f('0x4a'),_0x809b81['id']);return getTicket(_0x349070,_0x2449ff,_0x809b81,_0x2dc7c0,_0x5540b9);})[_0xd27f('0x1c')](function(_0x1a2147){if(_0x1a2147&&_0x1a2147['id']){logger[_0xd27f('0x1d')](_0xd27f('0x1e'));logger[_0xd27f('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x1a2147['id']);logger[_0xd27f('0x1d')](_0xd27f('0x4b'),_0xd27f('0x4c'));emit(util['format'](_0xd27f('0x4d'),_0x50186a[_0xd27f('0x40')]),'trigger:browser:url',{'uri':util[_0xd27f('0x19')]('%s/helpdesk/tickets/%d',_0x349070[_0xd27f('0x27')],_0x1a2147['id'])});}})['catch'](function(_0x1e21e3){logger[_0xd27f('0x4e')](_0xd27f('0x4b'),JSON[_0xd27f('0x30')](_0x1e21e3));});};exports['outbound']=function(_0x320ffe,_0x34f981,_0x12e252,_0x1fc76a,_0x5d06d8,_0x59941e,_0x4e4335){var _0x46ee6c,_0x1a8220;_0x59941e[_0xd27f('0x27')]=intUtil['stripTrailingSlash'](_0x59941e[_0xd27f('0x27')]);_0x59941e[_0xd27f('0x43')]=intUtil[_0xd27f('0x42')](_0x59941e[_0xd27f('0x43')]);if(_0x4e4335&&_0x4e4335['recordingFormat']&&_0x4e4335['recordingFormat']!==_0xd27f('0x4f')){logger[_0xd27f('0x1d')](_0xd27f('0x50'),_0xd27f('0x45'));_0x34f981['recordingURL']=util[_0xd27f('0x19')](_0xd27f('0x47'),_0x59941e['serverUrl'],_0x34f981[_0xd27f('0x48')],md5(_0x34f981[_0xd27f('0x48')]));}headers[_0xd27f('0x49')]=getAuth(_0x59941e);return getUser(_0x59941e,_0x1fc76a['email'])[_0xd27f('0x1c')](function(_0x4aea23){_0x46ee6c=_0x4aea23;logger[_0xd27f('0x1d')](_0xd27f('0x51'),_0x46ee6c['id']);return getEndUser(_0x59941e,_0x34f981[_0xd27f('0x52')],_0x34f981['destcalleridnum']);})[_0xd27f('0x1c')](function(_0x4b311d){_0x1a8220=_0x4b311d;logger['info'](_0xd27f('0x4a'),_0x1a8220['id']);return getTicket(_0x59941e,_0x46ee6c,_0x1a8220,_0x12e252,_0x34f981);})['then'](function(_0x94ec1a){if(_0x94ec1a&&_0x94ec1a['id']){logger[_0xd27f('0x1d')](_0xd27f('0x1e'));logger[_0xd27f('0x1d')](_0xd27f('0x53'),_0x94ec1a['id']);logger[_0xd27f('0x1d')](_0xd27f('0x50'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x1fc76a[_0xd27f('0x40')]),_0xd27f('0x54'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x59941e[_0xd27f('0x27')],_0x94ec1a['id'])});}})['catch'](function(_0x1f6e99){logger[_0xd27f('0x4e')]('[OUTBOUND]',JSON[_0xd27f('0x30')](_0x1f6e99));});};exports['abandoned']=function(_0x4c9630,_0x50d776,_0x27e814,_0x53df07,_0x217094,_0x256121){var _0x13e636,_0x595615;_0x256121['remoteUri']=intUtil[_0xd27f('0x42')](_0x256121[_0xd27f('0x27')]);_0x256121[_0xd27f('0x43')]=intUtil[_0xd27f('0x42')](_0x256121['serverUrl']);if(_0x217094&&_0x217094[_0xd27f('0x44')]){logger['info'](_0xd27f('0x55'),_0xd27f('0x45'));_0x50d776[_0xd27f('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x256121['serverUrl'],_0x50d776[_0xd27f('0x48')],md5(_0x50d776[_0xd27f('0x48')]));}else{_0x50d776['recordingURL']='';}headers[_0xd27f('0x49')]=getAuth(_0x256121);return getUser(_0x256121,'')[_0xd27f('0x1c')](function(_0x150470){_0x13e636=_0x150470;logger[_0xd27f('0x1d')]('The\x20User\x20ID\x20is:',_0x13e636['id']);return getEndUser(_0x256121,_0x50d776[_0xd27f('0xe')],_0x50d776[_0xd27f('0xf')]);})[_0xd27f('0x1c')](function(_0x362b9f){_0x595615=_0x362b9f;logger[_0xd27f('0x1d')](_0xd27f('0x4a'),_0x595615['id']);return getTicket(_0x256121,_0x13e636,_0x595615,_0x27e814,_0x50d776);})[_0xd27f('0x1c')](function(_0x1e997b){if(_0x1e997b){logger['info'](_0xd27f('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1e997b['id']);}})[_0xd27f('0x56')](function(_0x5bf04d){logger['error'](_0xd27f('0x55'),JSON[_0xd27f('0x30')](_0x5bf04d));});}; \ No newline at end of file +var _0x985e=['socket.io-emitter','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','Tags','name','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','push','idField','content','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost'];(function(_0x4eee15,_0x5a2e56){var _0x356a1d=function(_0xe8cb70){while(--_0xe8cb70){_0x4eee15['push'](_0x4eee15['shift']());}};_0x356a1d(++_0x5a2e56);}(_0x985e,0xa6));var _0xe985=function(_0x2bf2ef,_0x3f3df2){_0x2bf2ef=_0x2bf2ef-0x0;var _0x157fdc=_0x985e[_0x2bf2ef];return _0x157fdc;};'use strict';var _=require(_0xe985('0x0'));var rp=require(_0xe985('0x1'));var md5=require(_0xe985('0x2'));var util=require(_0xe985('0x3'));var Redis=require(_0xe985('0x4'));var intUtil=require(_0xe985('0x5'));var config=require(_0xe985('0x6'));var logger=require(_0xe985('0x7'))(_0xe985('0x8'));config[_0xe985('0x9')]=_[_0xe985('0xa')](config[_0xe985('0x9')],{'host':_0xe985('0xb'),'port':0x18eb});var io=require(_0xe985('0xc'))(new Redis(config[_0xe985('0x9')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x4a2972,_0x18c2c6,_0x5ce450){io['to'](_0x4a2972)[_0xe985('0xd')](_0x18c2c6,_0x5ce450);}function getTicket(_0x1c577a,_0x503e61,_0x1b4c9a,_0x2939e8,_0x2f7476){logger[_0xe985('0xe')](_0xe985('0xf'));var _0x4eedb2=_[_0xe985('0x10')]({'responder_id':_0x503e61['id'],'requester_id':_0x1b4c9a['id'],'name':util[_0xe985('0x11')](_0xe985('0x12'),_0x2f7476['calleridname']),'phone':_0x2f7476[_0xe985('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe985('0x14')](_0x2939e8[_0xe985('0x15')],_0x2f7476,'\x20'),'description':intUtil[_0xe985('0x14')](_0x2939e8[_0xe985('0x16')],_0x2f7476,'
'),'tags':getTags(_0x2939e8[_0xe985('0x17')],_0xe985('0x18'))},getCustomFields(_0x2939e8['Fields'],_0x2f7476));_0x4eedb2[_0xe985('0x19')]=_[_0xe985('0x1a')](_[_0xe985('0x1b')](_0x4eedb2[_0xe985('0x19')],'id'),'value');return request({'uri':util[_0xe985('0x11')](_0xe985('0x1c'),_0x1c577a[_0xe985('0x1d')]),'method':_0xe985('0x1e'),'body':_0x4eedb2})[_0xe985('0x1f')](function(_0x1c7a3d){logger[_0xe985('0xe')](_0xe985('0x20'));return _0x1c7a3d;});}function getUser(_0x156ae8,_0x1f2921){if(intUtil[_0xe985('0x21')](_0x1f2921)){return request({'uri':util[_0xe985('0x11')](_0xe985('0x22'),_0x156ae8['remoteUri']),'qs':{'email':_0x1f2921}})[_0xe985('0x1f')](function(_0x410695){if(_0x410695[_0xe985('0x23')]){logger[_0xe985('0xe')](_0xe985('0x24'));return _['find'](_0x410695,function(_0x3a8340){return _0x3a8340['contact']['email']===_0x1f2921;});}else{logger[_0xe985('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xe985('0x11')]('%s/api/v2/agents/me',_0x156ae8[_0xe985('0x1d')])})['then'](function(_0x23fffb){logger[_0xe985('0xe')]('Admin\x20account\x20selected.');return _0x23fffb;});}});}else{logger[_0xe985('0xe')](_0xe985('0x25'));return request({'uri':util['format'](_0xe985('0x26'),_0x156ae8[_0xe985('0x1d')])})['then'](function(_0x116176){logger[_0xe985('0xe')]('Admin\x20account\x20selected.');return _0x116176;});}}function getEndUser(_0x222ed9,_0x205f58,_0xfe134){logger[_0xe985('0xe')]('Searching\x20enduser\x20with\x20phone',_0xfe134);return request({'uri':util[_0xe985('0x11')](_0xe985('0x27'),_0x222ed9[_0xe985('0x1d')]),'qs':{'phone':_0xfe134}})[_0xe985('0x1f')](function(_0x33a859){if(_0x33a859[_0xe985('0x23')]){logger['info'](_0xe985('0x28'));return _[_0xe985('0x29')](_0x33a859,{'phone':_0xfe134});}else{logger[_0xe985('0xe')](_0xe985('0x2a'));return request({'uri':util[_0xe985('0x11')]('%s/api/v2/contacts',_0x222ed9[_0xe985('0x1d')]),'method':_0xe985('0x1e'),'body':{'name':_0x205f58,'phone':_0xfe134}})[_0xe985('0x1f')](function(_0x4283b6){logger[_0xe985('0xe')](_0xe985('0x2b'));return _0x4283b6;});}});}function getAuth(_0xea5c47){return util[_0xe985('0x11')](_0xe985('0x2c'),new Buffer(_0xea5c47[_0xe985('0x2d')]+':X')[_0xe985('0x2e')]('base64'));}function request(_0x3d6e6f){logger['debug'](_0xe985('0x2f'),JSON[_0xe985('0x30')](_0x3d6e6f));return rp(_[_0xe985('0xa')](_0x3d6e6f,{'method':_0xe985('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x11c641,_0x5b4d72){var _0x6bffe=[];if(_0x11c641&&_0x11c641[_0xe985('0x23')]>0x0){_0x6bffe=_[_0xe985('0x32')](_0x11c641,_0x5b4d72);}return _0x6bffe;}function getCustomFields(_0x40ad0b,_0x2b3a06){var _0x1fa5a9=[];var _0x5eb47b={'custom_fields':[]};if(_0x40ad0b['length']>0x0){_[_0xe985('0x33')](_0x40ad0b,function(_0x5ee43b){if(_0x5ee43b[_0xe985('0x34')]===_0xe985('0x35')&&_0x5ee43b[_0xe985('0x36')]&&!_0x5ee43b[_0xe985('0x37')]){_0x5eb47b[_0x5ee43b[_0xe985('0x36')][_0xe985('0x38')]()]=_0x5ee43b['content'][_0xe985('0x2e')]();}else if(_0x5ee43b[_0xe985('0x34')]===_0xe985('0x35')&&_0x5ee43b['idField']&&_0x5ee43b['customField']){_0x5eb47b[_0xe985('0x19')][_0xe985('0x39')]({'id':_0x5ee43b[_0xe985('0x3a')],'value':_0x5ee43b[_0xe985('0x3b')][_0xe985('0x2e')]()});}else if(_0x5ee43b['type']===_0xe985('0x3c')&&_0x5ee43b[_0xe985('0x3d')]&&_0x5ee43b['idField']&&_0x5ee43b['customField']){_0x2b3a06[_0x5ee43b[_0xe985('0x3d')]]&&_0x5eb47b[_0xe985('0x19')][_0xe985('0x39')]({'id':_0x5ee43b[_0xe985('0x3a')],'value':_0x2b3a06[_0x5ee43b['variableName']][_0xe985('0x2e')]()});}else if(_0x5ee43b[_0xe985('0x34')]===_0xe985('0x3e')&&_0x5ee43b['Variable']&&_0x5ee43b['Variable']['name']&&_0x5ee43b[_0xe985('0x3a')]&&_0x5ee43b[_0xe985('0x37')]){_0x2b3a06[_0x5ee43b['Variable']['name'][_0xe985('0x38')]()]&&_0x5eb47b[_0xe985('0x19')][_0xe985('0x39')]({'id':_0x5ee43b[_0xe985('0x3a')],'value':_0x2b3a06[_0x5ee43b[_0xe985('0x3f')]['name'][_0xe985('0x38')]()][_0xe985('0x2e')]()});}});}return _0x5eb47b;}exports['queue']=function(_0x30b42f,_0x4a27d7,_0x2749cc,_0x47c582,_0x4bb682,_0x4dbda1){var _0x5e2be5,_0x15cf44;_0x4dbda1[_0xe985('0x1d')]=intUtil[_0xe985('0x40')](_0x4dbda1[_0xe985('0x1d')]);_0x4dbda1[_0xe985('0x41')]=intUtil[_0xe985('0x40')](_0x4dbda1[_0xe985('0x41')]);if(_0x4bb682&&_0x4bb682[_0xe985('0x42')]){logger['info'](_0xe985('0x43'),_0xe985('0x44'));_0x4a27d7[_0xe985('0x45')]=util[_0xe985('0x11')](_0xe985('0x46'),_0x4dbda1['serverUrl'],_0x4a27d7[_0xe985('0x47')],md5(_0x4a27d7[_0xe985('0x47')]));}else{_0x4a27d7['recordingURL']='';}headers[_0xe985('0x48')]=getAuth(_0x4dbda1);return getUser(_0x4dbda1,_0x47c582['email'])['then'](function(_0x53f512){_0x5e2be5=_0x53f512;logger[_0xe985('0xe')](_0xe985('0x49'),_0x5e2be5['id']);return getEndUser(_0x4dbda1,_0x4a27d7[_0xe985('0x4a')],_0x4a27d7['calleridnum']);})[_0xe985('0x1f')](function(_0x401f95){_0x15cf44=_0x401f95;logger[_0xe985('0xe')](_0xe985('0x4b'),_0x15cf44['id']);return getTicket(_0x4dbda1,_0x5e2be5,_0x15cf44,_0x2749cc,_0x4a27d7);})[_0xe985('0x1f')](function(_0x46b1d6){if(_0x46b1d6&&_0x46b1d6['id']){logger['info'](_0xe985('0x20'));logger[_0xe985('0xe')](_0xe985('0x4c'),_0x46b1d6['id']);logger['info'](_0xe985('0x43'),_0xe985('0x4d'));emit(util[_0xe985('0x11')](_0xe985('0x4e'),_0x47c582[_0xe985('0x18')]),'trigger:browser:url',{'uri':util[_0xe985('0x11')](_0xe985('0x4f'),_0x4dbda1[_0xe985('0x1d')],_0x46b1d6['id'])});}})[_0xe985('0x50')](function(_0x13482d){logger[_0xe985('0x51')]('[QUEUE]',JSON[_0xe985('0x30')](_0x13482d));});};exports['outbound']=function(_0x49c946,_0x56de5d,_0xc201db,_0x17c7a5,_0xefec66,_0x3b3bbc,_0x2c298d){var _0xf720ef,_0x2f944b;_0x3b3bbc[_0xe985('0x1d')]=intUtil[_0xe985('0x40')](_0x3b3bbc[_0xe985('0x1d')]);_0x3b3bbc['serverUrl']=intUtil['stripTrailingSlash'](_0x3b3bbc[_0xe985('0x41')]);if(_0x2c298d&&_0x2c298d['recordingFormat']&&_0x2c298d[_0xe985('0x52')]!==_0xe985('0x53')){logger[_0xe985('0xe')](_0xe985('0x54'),_0xe985('0x44'));_0x56de5d[_0xe985('0x45')]=util[_0xe985('0x11')](_0xe985('0x46'),_0x3b3bbc['serverUrl'],_0x56de5d[_0xe985('0x47')],md5(_0x56de5d[_0xe985('0x47')]));}headers[_0xe985('0x48')]=getAuth(_0x3b3bbc);return getUser(_0x3b3bbc,_0x17c7a5['email'])[_0xe985('0x1f')](function(_0x47eba7){_0xf720ef=_0x47eba7;logger[_0xe985('0xe')]('The\x20User\x20ID\x20is:',_0xf720ef['id']);return getEndUser(_0x3b3bbc,_0x56de5d[_0xe985('0x55')],_0x56de5d[_0xe985('0x56')]);})['then'](function(_0x5f59f1){_0x2f944b=_0x5f59f1;logger[_0xe985('0xe')](_0xe985('0x4b'),_0x2f944b['id']);return getTicket(_0x3b3bbc,_0xf720ef,_0x2f944b,_0xc201db,_0x56de5d);})[_0xe985('0x1f')](function(_0x1f01e3){if(_0x1f01e3&&_0x1f01e3['id']){logger[_0xe985('0xe')](_0xe985('0x20'));logger['info'](_0xe985('0x4c'),_0x1f01e3['id']);logger[_0xe985('0xe')]('[OUTBOUND]',_0xe985('0x4d'));emit(util[_0xe985('0x11')](_0xe985('0x4e'),_0x17c7a5[_0xe985('0x18')]),_0xe985('0x57'),{'uri':util[_0xe985('0x11')](_0xe985('0x4f'),_0x3b3bbc[_0xe985('0x1d')],_0x1f01e3['id'])});}})['catch'](function(_0x20ad81){logger['error']('[OUTBOUND]',JSON[_0xe985('0x30')](_0x20ad81));});};exports['abandoned']=function(_0x35a5c8,_0x25de13,_0x504e59,_0x3bf49b,_0x44b502,_0x7f3aa4){var _0x1b5223,_0x4265f2;_0x7f3aa4[_0xe985('0x1d')]=intUtil['stripTrailingSlash'](_0x7f3aa4[_0xe985('0x1d')]);_0x7f3aa4['serverUrl']=intUtil[_0xe985('0x40')](_0x7f3aa4[_0xe985('0x41')]);if(_0x44b502&&_0x44b502[_0xe985('0x42')]){logger['info'](_0xe985('0x58'),_0xe985('0x44'));_0x25de13['recordingURL']=util[_0xe985('0x11')](_0xe985('0x46'),_0x7f3aa4[_0xe985('0x41')],_0x25de13['uniqueid'],md5(_0x25de13['uniqueid']));}else{_0x25de13[_0xe985('0x45')]='';}headers['Authorization']=getAuth(_0x7f3aa4);return getUser(_0x7f3aa4,'')[_0xe985('0x1f')](function(_0x151f26){_0x1b5223=_0x151f26;logger[_0xe985('0xe')](_0xe985('0x49'),_0x1b5223['id']);return getEndUser(_0x7f3aa4,_0x25de13[_0xe985('0x4a')],_0x25de13[_0xe985('0x13')]);})['then'](function(_0x582551){_0x4265f2=_0x582551;logger['info'](_0xe985('0x4b'),_0x4265f2['id']);return getTicket(_0x7f3aa4,_0x1b5223,_0x4265f2,_0x504e59,_0x25de13);})[_0xe985('0x1f')](function(_0x870976){if(_0x870976){logger[_0xe985('0xe')](_0xe985('0x20'));logger[_0xe985('0xe')]('The\x20Ticket\x20ID\x20is:',_0x870976['id']);}})[_0xe985('0x50')](function(_0x4cff8a){logger[_0xe985('0x51')]('[ABANDONED]',JSON[_0xe985('0x30')](_0x4cff8a));});}; \ 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 12355ae..105ed24 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 _0x6a3a=['includes','data1','toLowerCase','find','queue','outbound','EVENT\x20UNKNOWN','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a3a,0x1f1));var _0xa6a3=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x6a3a[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0xa6a3('0x0'));var util=require(_0xa6a3('0x1'));var zendesk=require(_0xa6a3('0x2'));var salesforce=require(_0xa6a3('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0xa6a3('0x4'));var desk=require('./desk');var vtiger=require(_0xa6a3('0x5'));var servicenow=require(_0xa6a3('0x6'));var dynamics365=require(_0xa6a3('0x7'));var integrations=[_0xa6a3('0x8'),'salesforce',_0xa6a3('0x9'),_0xa6a3('0xa'),_0xa6a3('0xb'),_0xa6a3('0xc'),_0xa6a3('0xd'),_0xa6a3('0xe'),'dynamics365'];exports['exec']=function(_0x49c001,_0xf2d739,_0xc3e6bb,_0x16bc1a,_0x24e7b7,_0x5687a2){if(_0xc3e6bb){if(_[_0xa6a3('0xf')](integrations,_0x49c001[_0xa6a3('0x10')]['toLowerCase']())){try{var _0x15d268=null;var _0x21d5fe='';var _0x53bb88=_0xc3e6bb[_0x49c001[_0xa6a3('0x10')][_0xa6a3('0x11')]()];if(_0x53bb88){var _0x9a220c=_0x53bb88[_0x49c001['data2']];if(_0x9a220c){var _0x309885=_[_0xa6a3('0x12')](_0x9a220c['Configurations'],{'id':parseInt(_0x49c001['data3'],0xa)});if(_0x309885){if(_0x16bc1a){if(_0x24e7b7&&_0xf2d739[_0xa6a3('0x13')]){_0x21d5fe=_0xa6a3('0x13');}else if(_0xf2d739['routeId']){_0x21d5fe=_0xa6a3('0x14');}else{console['log'](_0xa6a3('0x15'),_0xf2d739);}}else{_0x21d5fe='abandoned';}switch(_0x49c001[_0xa6a3('0x10')][_0xa6a3('0x11')]()){case _0xa6a3('0x8'):zendesk[_0x21d5fe](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2);break;case'salesforce':salesforce[_0x21d5fe](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2);break;case _0xa6a3('0x9'):sugarcrm[_0x21d5fe](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2);break;case _0xa6a3('0xa'):freshdesk[_0x21d5fe](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2);break;case _0xa6a3('0xb'):zoho[_0x21d5fe](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2);break;case _0xa6a3('0xc'):desk[_0x21d5fe](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2);break;case _0xa6a3('0xd'):vtiger[_0x21d5fe](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2);break;case _0xa6a3('0xe'):servicenow['cs'](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2,_0x21d5fe);break;case'dynamics365':dynamics365['cs'](_0x49c001,_0xf2d739,_0x309885,_0x16bc1a,_0x24e7b7,_0x9a220c,_0x5687a2,_0x21d5fe);break;default:console[_0xa6a3('0x16')](_0xa6a3('0x17'));}}else{_0x15d268=require(_0xa6a3('0x18'))(_0x49c001[_0xa6a3('0x10')]['toLowerCase']());_0x15d268[_0xa6a3('0x19')](_0xa6a3('0x1a'),util[_0xa6a3('0x1b')](_0xa6a3('0x1c'),_0x49c001[_0xa6a3('0x10')][_0xa6a3('0x11')](),_0x49c001[_0xa6a3('0x1d')]));}}else{_0x15d268=require(_0xa6a3('0x18'))(_0x49c001[_0xa6a3('0x10')][_0xa6a3('0x11')]());_0x15d268['error'](_0xa6a3('0x1a'),util[_0xa6a3('0x1b')](_0xa6a3('0x1e'),_0x49c001[_0xa6a3('0x10')]['toLowerCase'](),_0x49c001[_0xa6a3('0x1f')]));}}else{}}catch(_0x596f26){console['error'](_0x596f26);}}}}; \ No newline at end of file +var _0x2664=['exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','abandoned','zendesk','freshdesk','zoho','unknown\x20integration','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./sugarcrm','./freshdesk','./zoho','./vtiger','./dynamics365','salesforce','sugarcrm','desk','vtiger','servicenow','dynamics365'];(function(_0x37492c,_0x347305){var _0x389090=function(_0x470365){while(--_0x470365){_0x37492c['push'](_0x37492c['shift']());}};_0x389090(++_0x347305);}(_0x2664,0x1ba));var _0x4266=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2664[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4266('0x0'));var util=require(_0x4266('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x4266('0x2'));var freshdesk=require(_0x4266('0x3'));var zoho=require(_0x4266('0x4'));var desk=require('./desk');var vtiger=require(_0x4266('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x4266('0x6'));var integrations=['zendesk',_0x4266('0x7'),_0x4266('0x8'),'freshdesk','zoho',_0x4266('0x9'),_0x4266('0xa'),_0x4266('0xb'),_0x4266('0xc')];exports[_0x4266('0xd')]=function(_0x2fdd00,_0x3002fb,_0x259d44,_0x4418e4,_0x11d8a,_0x371dda){if(_0x259d44){if(_[_0x4266('0xe')](integrations,_0x2fdd00[_0x4266('0xf')][_0x4266('0x10')]())){try{var _0x3bef9f=null;var _0x4e9574='';var _0x1f2973=_0x259d44[_0x2fdd00[_0x4266('0xf')][_0x4266('0x10')]()];if(_0x1f2973){var _0x4a1884=_0x1f2973[_0x2fdd00[_0x4266('0x11')]];if(_0x4a1884){var _0x44b46d=_[_0x4266('0x12')](_0x4a1884[_0x4266('0x13')],{'id':parseInt(_0x2fdd00[_0x4266('0x14')],0xa)});if(_0x44b46d){if(_0x4418e4){if(_0x11d8a&&_0x3002fb[_0x4266('0x15')]){_0x4e9574=_0x4266('0x15');}else if(_0x3002fb[_0x4266('0x16')]){_0x4e9574=_0x4266('0x17');}else{console['log'](_0x4266('0x18'),_0x3002fb);}}else{_0x4e9574=_0x4266('0x19');}switch(_0x2fdd00[_0x4266('0xf')]['toLowerCase']()){case _0x4266('0x1a'):zendesk[_0x4e9574](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda);break;case _0x4266('0x7'):salesforce[_0x4e9574](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda);break;case'sugarcrm':sugarcrm[_0x4e9574](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda);break;case _0x4266('0x1b'):freshdesk[_0x4e9574](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda);break;case _0x4266('0x1c'):zoho[_0x4e9574](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda);break;case'desk':desk[_0x4e9574](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda);break;case'vtiger':vtiger[_0x4e9574](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda);break;case _0x4266('0xb'):servicenow['cs'](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda,_0x4e9574);break;case _0x4266('0xc'):dynamics365['cs'](_0x2fdd00,_0x3002fb,_0x44b46d,_0x4418e4,_0x11d8a,_0x4a1884,_0x371dda,_0x4e9574);break;default:console['log'](_0x4266('0x1d'));}}else{_0x3bef9f=require('../../../../config/logger')(_0x2fdd00[_0x4266('0xf')]['toLowerCase']());_0x3bef9f['error'](_0x4266('0x1e'),util[_0x4266('0x1f')](_0x4266('0x20'),_0x2fdd00['data1'][_0x4266('0x10')](),_0x2fdd00['data3']));}}else{_0x3bef9f=require('../../../../config/logger')(_0x2fdd00[_0x4266('0xf')][_0x4266('0x10')]());_0x3bef9f[_0x4266('0x21')]('[EXEC]',util['format'](_0x4266('0x22'),_0x2fdd00[_0x4266('0xf')][_0x4266('0x10')](),_0x2fdd00[_0x4266('0x11')]));}}else{}}catch(_0x487903){console[_0x4266('0x21')](_0x487903);}}}}; \ 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 0051bd0..e486bd9 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(_0x266b00,_0x1a60c1){var _0x5e5565=function(_0xeb15bf){while(--_0xeb15bf){_0x266b00['push'](_0x266b00['shift']());}};_0x5e5565(++_0x1a60c1);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'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 _0xe706=['variable','variableName','customVariable','Variable','name','toLowerCase','toString','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','format','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','[OUTBOUND]','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','Subjects','Case','ContactId','create','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','info','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','sobject','Contact','contact','Lead','Phone','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.','lead','Company','upperFirst','type','string','idField','content'];(function(_0x1e1858,_0x2bc0ec){var _0x4d8d7a=function(_0x2145eb){while(--_0x2145eb){_0x1e1858['push'](_0x1e1858['shift']());}};_0x4d8d7a(++_0x2bc0ec);}(_0xe706,0xa3));var _0x6e70=function(_0x458ed6,_0x504646){_0x458ed6=_0x458ed6-0x0;var _0xa5dfd9=_0xe706[_0x458ed6];return _0xa5dfd9;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var md5=require(_0x6e70('0x3'));var jsforce=require(_0x6e70('0x4'));var util=require(_0x6e70('0x5'));var Redis=require(_0x6e70('0x6'));var intUtil=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var logger=require(_0x6e70('0x9'))(_0x6e70('0xa'));config[_0x6e70('0xb')]=_[_0x6e70('0xc')](config[_0x6e70('0xb')],{'host':_0x6e70('0xd'),'port':0x18eb});var io=require(_0x6e70('0xe'))(new Redis(config[_0x6e70('0xb')]));function emit(_0x3c4843,_0x449b48,_0x954545){io['to'](_0x3c4843)[_0x6e70('0xf')](_0x449b48,_0x954545);}function getTicket(_0x100eb7,_0x463853,_0x743eb5,_0x3f474a,_0x37b3e0,_0x4600f9,_0x5b3d07,_0x47f6b2){var _0x3594c1={};if(_0x3f474a[_0x6e70('0x10')]===_0x6e70('0x11')){_0x3594c1=Object[_0x6e70('0x12')]({},{'OwnerId':_0x463853['id'],'ActivityDate':moment[_0x6e70('0x13')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x6e70('0x14')](_0x3f474a[_0x6e70('0x15')],_0x37b3e0,'\x20'),'Description':intUtil[_0x6e70('0x14')](_0x3f474a['Descriptions'],_0x37b3e0,'\x0a')},getCustomFields(_0x4600f9,_0x37b3e0));if(_0x743eb5){_0x3594c1['WhoId']=_0x743eb5['id'];}}else if(_0x3f474a['ticketType']===_0x6e70('0x16')){_0x3594c1=Object['assign']({},{'OwnerId':_0x463853['id'],'Subject':intUtil['getString'](_0x3f474a[_0x6e70('0x15')],_0x37b3e0,'\x20'),'Description':intUtil[_0x6e70('0x14')](_0x3f474a['Descriptions'],_0x37b3e0,'\x0a')},getCustomFields(_0x4600f9,_0x37b3e0));if(_0x743eb5){_0x3594c1[_0x6e70('0x17')]=_0x743eb5['id'];}}return _0x5b3d07['sobject'](_0x3f474a[_0x6e70('0x10')])[_0x6e70('0x18')](_0x3594c1);}function getUser(_0x4ca554,_0x49029f,_0x3bd572){if(!_['isNil'](_0x49029f)&&intUtil[_0x6e70('0x19')](_0x49029f)){var _0x173afe={'Email':_0x49029f};var _0x53acdc={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3bd572['sobject'](_0x6e70('0x1a'))[_0x6e70('0x1b')](_0x173afe,_0x53acdc)[_0x6e70('0x1c')]()[_0x6e70('0x1d')](function(_0x3af484){if(_0x3af484[_0x6e70('0x1e')]){var _0x1b2453=_[_0x6e70('0x1b')](_0x3af484,function(_0x29326f){return _0x29326f[_0x6e70('0x1f')]===_0x49029f;});if(_0x1b2453){logger['info'](_0x6e70('0x20'),_0x49029f);return BPromise[_0x6e70('0x21')]({'id':_0x1b2453['Id'],'name':_0x1b2453[_0x6e70('0x22')]});}}else{logger['info'](_0x6e70('0x23'),_0x49029f);return _0x3bd572[_0x6e70('0x24')]()[_0x6e70('0x1d')](function(_0x50da2c){return BPromise[_0x6e70('0x21')]({'id':_0x50da2c['user_id'],'name':_0x50da2c['display_name']});});}});}else{logger['info'](_0x6e70('0x23'),_0x49029f);return _0x3bd572[_0x6e70('0x24')]()['then'](function(_0x3ecdf1){return BPromise[_0x6e70('0x21')]({'id':_0x3ecdf1['user_id'],'name':_0x3ecdf1[_0x6e70('0x25')]});});}}function getEndUser(_0x67fb43,_0x2bb231,_0x4a67ac,_0x54a5fe,_0x2c4d37){var _0x3af17f={'Phone':_0x54a5fe};var _0x83c836={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6e70('0x21')]()[_0x6e70('0x1d')](function(){if(_0x2bb231['ticketType']===_0x6e70('0x11')){logger[_0x6e70('0x26')](_0x6e70('0x27'),_0x54a5fe,_0x2bb231[_0x6e70('0x28')]);switch(_0x2bb231[_0x6e70('0x28')]){case _0x6e70('0x29'):return _0x2c4d37[_0x6e70('0x2a')](_0x6e70('0x2b'))[_0x6e70('0x1b')](_0x3af17f,_0x83c836)[_0x6e70('0x1c')]()['then'](function(_0x1b27d8){if(_0x1b27d8&&_0x1b27d8['length']){return _0x1b27d8;}else{return _0x2c4d37[_0x6e70('0x2a')]('Lead')[_0x6e70('0x1b')](_0x3af17f,_0x83c836);}});case _0x6e70('0x2c'):return _0x2c4d37[_0x6e70('0x2a')]('Contact')[_0x6e70('0x1b')](_0x3af17f,_0x83c836)[_0x6e70('0x1c')]();case'lead':return _0x2c4d37[_0x6e70('0x2a')](_0x6e70('0x2d'))['find'](_0x3af17f,_0x83c836);default:return null;}}else if(_0x2bb231[_0x6e70('0x10')]===_0x6e70('0x16')){logger[_0x6e70('0x26')](_0x6e70('0x27'),_0x54a5fe,_0x6e70('0x2c'));return _0x2c4d37[_0x6e70('0x2a')](_0x6e70('0x2b'))[_0x6e70('0x1b')](_0x3af17f,_0x83c836)[_0x6e70('0x1c')]();}})[_0x6e70('0x1d')](function(_0x4d32d8){if(_0x4d32d8&&_0x4d32d8[_0x6e70('0x1e')]){var _0x4795a0=_[_0x6e70('0x1b')](_0x4d32d8,function(_0x3222a2){return _0x3222a2[_0x6e70('0x2e')]===_0x54a5fe;});if(_0x4795a0){return BPromise[_0x6e70('0x21')]({'id':_0x4795a0['Id'],'name':_0x4795a0[_0x6e70('0x22')],'phone':_0x4795a0[_0x6e70('0x2e')]});}}})[_0x6e70('0x1d')](function(_0xdd0bee){if(_0xdd0bee){logger[_0x6e70('0x26')](_0x6e70('0x2f'),_0x54a5fe);return BPromise[_0x6e70('0x21')](_0xdd0bee);}else{logger[_0x6e70('0x26')](_0x6e70('0x30'),_0x54a5fe);var _0x501b53={'LastName':_0x4a67ac!==''?_0x4a67ac:util['format'](_0x6e70('0x31'),_0x54a5fe),'Phone':_0x54a5fe};if(_0x2bb231[_0x6e70('0x32')]){if(_0x2bb231[_0x6e70('0x32')]===_0x6e70('0x2c')){logger[_0x6e70('0x26')](_0x6e70('0x33'),_0x54a5fe,_0x2bb231['moduleCreate']);}else if(_0x2bb231[_0x6e70('0x32')]===_0x6e70('0x34')&&_0x2bb231[_0x6e70('0x10')]===_0x6e70('0x11')){logger[_0x6e70('0x26')](_0x6e70('0x33'),_0x54a5fe,_0x2bb231[_0x6e70('0x32')]);_0x501b53[_0x6e70('0x35')]='No\x20Company';}else{return null;}}return _0x2c4d37[_0x6e70('0x2a')](_[_0x6e70('0x36')](_0x2bb231[_0x6e70('0x32')]))[_0x6e70('0x18')](_0x501b53);}});}function getCustomFields(_0x201da9,_0x1de947){var _0x21b0e7={};if(_0x201da9['length']>0x0){_['forEach'](_0x201da9,function(_0x5ae898){if(_0x5ae898[_0x6e70('0x37')]===_0x6e70('0x38')&&_0x5ae898[_0x6e70('0x39')]){_0x21b0e7[_0x5ae898[_0x6e70('0x39')]]=_0x5ae898[_0x6e70('0x3a')]['toString']();}else if(_0x5ae898[_0x6e70('0x37')]===_0x6e70('0x3b')&&_0x5ae898[_0x6e70('0x3c')]&&_0x5ae898['idField']){_0x1de947[_0x5ae898['variableName']]&&(_0x21b0e7[_0x5ae898['idField']]=_0x1de947[_0x5ae898[_0x6e70('0x3c')]]['toString']());}else if(_0x5ae898[_0x6e70('0x37')]===_0x6e70('0x3d')&&_0x5ae898[_0x6e70('0x3e')]&&_0x5ae898[_0x6e70('0x3e')]['name']&&_0x5ae898[_0x6e70('0x39')]){_0x1de947[_0x5ae898['Variable'][_0x6e70('0x3f')][_0x6e70('0x40')]()]&&(_0x21b0e7[_0x5ae898[_0x6e70('0x39')]]=_0x1de947[_0x5ae898[_0x6e70('0x3e')]['name'][_0x6e70('0x40')]()][_0x6e70('0x41')]());}});}return _0x21b0e7;}function getConnection(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x42')][_0x6e70('0x43')](_0x3d39c3[_0x6e70('0x44')]);var _0x552e7e=new jsforce[(_0x6e70('0x45'))]({'oauth2':{'loginUrl':_0x3d39c3[_0x6e70('0x46')]||_0x6e70('0x47'),'clientId':_0x3d39c3[_0x6e70('0x48')],'clientSecret':_0x3d39c3[_0x6e70('0x49')]}});return _0x552e7e[_0x6e70('0x4a')](_0x3d39c3[_0x6e70('0x4b')],_0xac87d6)['then'](function(){logger[_0x6e70('0x26')]('Connection\x20established.');return _0x552e7e;});}exports[_0x6e70('0x4c')]=function(_0x3836e4,_0x4b351e,_0x53efc3,_0x333abd,_0x25a208,_0x18fa40){var _0x587f04,_0x4af9b1,_0x238ebb,_0x11ac3d;_0x18fa40[_0x6e70('0x4d')]=intUtil[_0x6e70('0x4e')](_0x18fa40[_0x6e70('0x4d')]);_0x18fa40[_0x6e70('0x46')]=intUtil['stripTrailingSlash'](_0x18fa40[_0x6e70('0x46')]);if(_0x25a208&&_0x25a208[_0x6e70('0x4f')]){logger[_0x6e70('0x26')](_0x6e70('0x50'),_0x6e70('0x51'));_0x4b351e['recordingURL']=util['format'](_0x6e70('0x52'),_0x18fa40[_0x6e70('0x4d')],_0x4b351e[_0x6e70('0x53')],md5(_0x4b351e[_0x6e70('0x53')]));}else{_0x4b351e[_0x6e70('0x54')]='';}return getConnection(_0x18fa40)['then'](function(_0x41bd0b){_0x11ac3d=_0x41bd0b;return getUser(_0x18fa40,_0x333abd[_0x6e70('0x55')],_0x11ac3d);})[_0x6e70('0x1d')](function(_0x23ebfb){_0x587f04=_0x23ebfb;return getEndUser(_0x18fa40,_0x53efc3,_0x4b351e[_0x6e70('0x56')],_0x4b351e['calleridnum'],_0x11ac3d);})[_0x6e70('0x1d')](function(_0x1dd242){_0x4af9b1=_0x1dd242;return getTicket(_0x18fa40,_0x587f04,_0x4af9b1,_0x53efc3,_0x4b351e,_0x53efc3[_0x6e70('0x57')],_0x11ac3d,_0x6e70('0x4c'));})[_0x6e70('0x1d')](function(_0x3fd03d){_0x238ebb=_0x3fd03d;logger['info'](_0x6e70('0x58'),_0x238ebb['id']);logger[_0x6e70('0x26')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x238ebb['id'],_0x333abd[_0x6e70('0x3f')],_0x18fa40[_0x6e70('0x37')]);switch(_0x18fa40['type']){case _0x6e70('0x59'):emit(util[_0x6e70('0x5a')](_0x6e70('0x5b'),_0x333abd[_0x6e70('0x3f')]),_0x6e70('0x5c'),{'recordId':_0x238ebb['id']});break;case'newTab':emit(util[_0x6e70('0x5a')](_0x6e70('0x5b'),_0x333abd[_0x6e70('0x3f')]),_0x6e70('0x5d'),{'uri':util[_0x6e70('0x5a')](_0x6e70('0x5e'),_0x11ac3d[_0x6e70('0x5f')],_0x238ebb['id'])});break;default:logger[_0x6e70('0x60')](_0x6e70('0x61'));}})[_0x6e70('0x62')](function(_0x13dd17){logger[_0x6e70('0x60')](_0x6e70('0x50'),JSON[_0x6e70('0x63')](_0x13dd17));});};exports[_0x6e70('0x64')]=function(_0x2240a1,_0x324fa6,_0x4329a6,_0x2a8627,_0x1c7dca,_0x4c6aab,_0x28898a){var _0x4434dd,_0x180a13,_0xeeab6e,_0x36757e;_0x4c6aab[_0x6e70('0x4d')]=intUtil['stripTrailingSlash'](_0x4c6aab[_0x6e70('0x4d')]);_0x4c6aab[_0x6e70('0x46')]=intUtil['stripTrailingSlash'](_0x4c6aab[_0x6e70('0x46')]);if(_0x28898a&&_0x28898a[_0x6e70('0x65')]&&_0x28898a[_0x6e70('0x65')]!=='none'){logger['info'](_0x6e70('0x66'),_0x6e70('0x51'));_0x324fa6[_0x6e70('0x54')]=util[_0x6e70('0x5a')](_0x6e70('0x52'),_0x4c6aab[_0x6e70('0x4d')],_0x324fa6[_0x6e70('0x53')],md5(_0x324fa6['uniqueid']));}return getConnection(_0x4c6aab)['then'](function(_0x2c8dc6){_0x36757e=_0x2c8dc6;return getUser(_0x4c6aab,_0x2a8627[_0x6e70('0x55')],_0x36757e);})[_0x6e70('0x1d')](function(_0x2ad395){_0x4434dd=_0x2ad395;return getEndUser(_0x4c6aab,_0x4329a6,_0x324fa6['destcalleridname'],_0x324fa6['destcalleridnum'],_0x36757e);})[_0x6e70('0x1d')](function(_0x4e5545){_0x180a13=_0x4e5545;return getTicket(_0x4c6aab,_0x4434dd,_0x180a13,_0x4329a6,_0x324fa6,_0x4329a6['Fields'],_0x36757e,'outbound');})[_0x6e70('0x1d')](function(_0x47fbed){_0xeeab6e=_0x47fbed;logger[_0x6e70('0x26')](_0x6e70('0x67'),_0xeeab6e['id']);logger[_0x6e70('0x26')](_0x6e70('0x68'),_0xeeab6e['id'],_0x2a8627[_0x6e70('0x3f')],_0x4c6aab[_0x6e70('0x37')]);switch(_0x4c6aab[_0x6e70('0x37')]){case _0x6e70('0x59'):emit(util['format'](_0x6e70('0x5b'),_0x2a8627[_0x6e70('0x3f')]),_0x6e70('0x5c'),{'recordId':_0xeeab6e['id']});break;case _0x6e70('0x69'):emit(util[_0x6e70('0x5a')]('user:%s',_0x2a8627['name']),'trigger:browser:url',{'uri':util[_0x6e70('0x5a')](_0x6e70('0x5e'),_0x36757e[_0x6e70('0x5f')],_0xeeab6e['id'])});break;default:logger['error']('[OUTBOUND]',_0x6e70('0x6a'));}})[_0x6e70('0x62')](function(_0x3c2830){logger[_0x6e70('0x60')](_0x6e70('0x66'),JSON[_0x6e70('0x63')](_0x3c2830));});};exports['abandoned']=function(_0x2d2855,_0x3f5896,_0x30d11b,_0x82a9a,_0x515c0c,_0xce964b){var _0x531097,_0x5b4046,_0x30487b,_0x3249a5;_0xce964b[_0x6e70('0x4d')]=intUtil[_0x6e70('0x4e')](_0xce964b[_0x6e70('0x4d')]);_0xce964b[_0x6e70('0x46')]=intUtil['stripTrailingSlash'](_0xce964b[_0x6e70('0x46')]);if(_0x515c0c&&_0x515c0c[_0x6e70('0x4f')]){logger[_0x6e70('0x26')](_0x6e70('0x6b'),_0x6e70('0x51'));_0x3f5896[_0x6e70('0x54')]=util[_0x6e70('0x5a')](_0x6e70('0x52'),_0xce964b[_0x6e70('0x4d')],_0x3f5896[_0x6e70('0x53')],md5(_0x3f5896['uniqueid']));}else{_0x3f5896[_0x6e70('0x54')]='';}return getConnection(_0xce964b)[_0x6e70('0x1d')](function(_0x577c3b){_0x3249a5=_0x577c3b;if(!_['isNil'](_0x82a9a)){return getUser(_0xce964b,_0x82a9a['name'],_0x3249a5);}else{return getUser(_0xce964b,null,_0x3249a5);}})[_0x6e70('0x1d')](function(_0x18ecf0){_0x531097=_0x18ecf0;return getEndUser(_0xce964b,_0x30d11b,_0x3f5896[_0x6e70('0x56')],_0x3f5896[_0x6e70('0x6c')],_0x3249a5);})[_0x6e70('0x1d')](function(_0x4ec29a){_0x5b4046=_0x4ec29a;return getTicket(_0xce964b,_0x531097,_0x5b4046,_0x30d11b,_0x3f5896,_0x30d11b['Fields'],_0x3249a5);})[_0x6e70('0x1d')](function(_0x241a21){_0x30487b=_0x241a21;logger['info'](_0x6e70('0x6d'),_0x30487b['id']);logger[_0x6e70('0x26')](_0x6e70('0x6e'),_0xce964b[_0x6e70('0x37')]);})[_0x6e70('0x62')](function(_0x44bf96){logger[_0x6e70('0x60')](_0x6e70('0x6b'),JSON[_0x6e70('0x63')](_0x44bf96));});}; \ 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 bac4565..b63b48c 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 _0x95f4=['/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','email','destcalleridnum','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','ioredis','./util','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','nameField','customField','toLowerCase','content','toString','type','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','true','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','all','push','Tags','map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber'];(function(_0x5cd23e,_0x20777b){var _0x216550=function(_0x2935bb){while(--_0x2935bb){_0x5cd23e['push'](_0x5cd23e['shift']());}};_0x216550(++_0x20777b);}(_0x95f4,0xf1));var _0x495f=function(_0x483573,_0x3d2e82){_0x483573=_0x483573-0x0;var _0x2bddf5=_0x95f4[_0x483573];return _0x2bddf5;};'use strict';var _=require(_0x495f('0x0'));var Promise=require(_0x495f('0x1'));var rp=require(_0x495f('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x495f('0x3'));var intUtil=require(_0x495f('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x495f('0x5'));config[_0x495f('0x6')]=_[_0x495f('0x7')](config['redis'],{'host':_0x495f('0x8'),'port':0x18eb});var io=require(_0x495f('0x9'))(new Redis(config[_0x495f('0x6')]));function getAdminUser(_0x4c17af,_0x2103a4,_0x4610a7,_0x380828,_0x568020,_0x55dc23){return new Promise(function(_0x3f5880,_0x48c225){var _0x415017={'method':'GET','uri':_0x380828+_0x495f('0xa')+'&'+_0x568020+'&'+_0x55dc23,'auth':_0x2103a4,'json':!![]};return rp(_0x415017)[_0x495f('0xb')](function(_0x192ee0){if(_0x192ee0[_0x495f('0xc')]['length']>0x0){_0x4610a7[_0x495f('0xd')]=_0x192ee0[_0x495f('0xc')][0x0][_0x495f('0xe')];}logger[_0x495f('0xf')]('['+[_0x4c17af[_0x495f('0x10')]()]+'],\x20getAdminUser\x20crm',_0x4610a7);_0x3f5880(_0x4610a7);})[_0x495f('0x11')](function(_0xd4afd1){logger[_0x495f('0x12')]('['+[_0x4c17af[_0x495f('0x10')]()]+']',_0xd4afd1[_0x495f('0x13')]);_0x48c225(_0xd4afd1[_0x495f('0x13')]);});});}function getUser(_0x101c57,_0x5ad821,_0x1fffeb,_0x18ecbd,_0x15ea87){return function(_0x135ebd){logger['info']('['+[_0x101c57[_0x495f('0x10')]()]+_0x495f('0x14'),_0x135ebd);return new Promise(function(_0x4a0f0f,_0x2ebb97){if(intUtil[_0x495f('0x15')](_0x135ebd[_0x495f('0x16')])){var _0x58bcc9={'method':_0x495f('0x17'),'uri':_0x1fffeb+_0x495f('0x18')+_0x135ebd[_0x495f('0x16')]+'&'+_0x18ecbd+'&'+_0x15ea87,'auth':_0x5ad821,'json':!![]};logger[_0x495f('0xf')]('['+[_0x101c57['toUpperCase']()]+_0x495f('0x19'),_0x58bcc9);return rp(_0x58bcc9)[_0x495f('0xb')](function(_0x5f2530){logger[_0x495f('0xf')]('['+[_0x101c57['toUpperCase']()]+_0x495f('0x1a'),_0x5f2530);if(_0x5f2530[_0x495f('0xc')][_0x495f('0x1b')]>0x0&&String(_0x5f2530[_0x495f('0xc')][0x0]['active'])==='true'){_0x135ebd[_0x495f('0x1c')]=_0x5f2530['result'][0x0][_0x495f('0xe')];}else{_0x135ebd[_0x495f('0x1c')]=_0x135ebd['adminId'];_0x135ebd[_0x495f('0x16')]=_0x135ebd[_0x495f('0x1d')];}logger[_0x495f('0xf')]('['+[_0x101c57[_0x495f('0x10')]()]+_0x495f('0x1e'),_0x135ebd);_0x4a0f0f(_0x135ebd);})[_0x495f('0x11')](function(_0x4afbad){logger['error']('['+[_0x101c57[_0x495f('0x10')]()]+']',_0x4afbad[_0x495f('0x13')]);_0x2ebb97(_0x4afbad[_0x495f('0x13')]);});}else{logger[_0x495f('0xf')]('['+[_0x101c57[_0x495f('0x10')]()]+_0x495f('0x1f'));_0x135ebd['userId']=_0x135ebd[_0x495f('0xd')];_0x135ebd[_0x495f('0x16')]=_0x135ebd[_0x495f('0x1d')];_0x4a0f0f(_0x135ebd);}});};}function createEndUser(_0x3b3461,_0xab919a,_0x34322c,_0x161b4a,_0x4e9737){logger[_0x495f('0xf')]('['+[_0x3b3461[_0x495f('0x10')]()]+_0x495f('0x20'),_0x34322c);return new Promise(function(_0x445b0b,_0x3efa51){var _0x3b8f0f={'method':_0x495f('0x21'),'uri':_0x161b4a+_0x495f('0x22')+_0x4e9737,'body':{'user_name':_0x34322c[_0x495f('0x23')],'roles':_0x495f('0x24'),'first_name':_0x34322c[_0x495f('0x23')],'active':'true','date_format':_0x495f('0x25'),'phone':_0x34322c[_0x495f('0x23')]},'auth':_0xab919a,'json':!![]};return rp(_0x3b8f0f)[_0x495f('0xb')](function(_0x2e9e8c){logger[_0x495f('0xf')]('['+[_0x3b3461['toUpperCase']()]+_0x495f('0x26'),_0x2e9e8c[_0x495f('0xc')]);_0x34322c[_0x495f('0x27')]=_0x2e9e8c[_0x495f('0xc')]['sys_id'];_0x445b0b(_0x34322c);})[_0x495f('0x11')](function(_0x2c26eb){logger[_0x495f('0x12')]('['+[_0x3b3461[_0x495f('0x10')]()]+']',_0x2c26eb['message']);_0x3efa51(_0x2c26eb[_0x495f('0x13')]);});});}function getEndUser(_0x230e88,_0x1f338b,_0x441a08,_0x46a028,_0x4503ad){return function(_0x459470){logger[_0x495f('0xf')]('['+[_0x230e88['toUpperCase']()]+_0x495f('0x28'),_0x459470);return new Promise(function(_0x577f71,_0x55d775){var _0x412189={'method':_0x495f('0x17'),'uri':_0x441a08+_0x495f('0x29')+_0x459470[_0x495f('0x23')]+'&'+_0x46a028+'&'+_0x4503ad,'auth':_0x1f338b,'json':!![]};return rp(_0x412189)[_0x495f('0xb')](function(_0x1287cb){if(_0x1287cb[_0x495f('0xc')][_0x495f('0x1b')]>0x0){_0x459470[_0x495f('0x27')]=_0x1287cb['result'][0x0][_0x495f('0xe')];logger[_0x495f('0xf')]('['+[_0x230e88['toUpperCase']()]+_0x495f('0x2a'),_0x459470);_0x577f71(_0x459470);}else{return createEndUser(_0x230e88,_0x1f338b,_0x459470,_0x441a08,_0x46a028)[_0x495f('0xb')](function(_0x1197d9){logger['info']('['+[_0x230e88[_0x495f('0x10')]()]+_0x495f('0x2b'),_0x1197d9);_0x577f71(_0x1197d9);});}})[_0x495f('0x11')](function(_0x4bce35){logger['error']('['+[_0x230e88[_0x495f('0x10')]()]+']',_0x4bce35[_0x495f('0x13')]);_0x55d775(_0x4bce35[_0x495f('0x13')]);});});};}function getCustomFields(_0x1e83db,_0x9bf232){var _0x46c494={};if(_0x1e83db[_0x495f('0x1b')]>0x0){_['forEach'](_0x1e83db,function(_0x551195){if(_0x551195['type']===_0x495f('0x2c')&&_0x551195[_0x495f('0x2d')]&&!_0x551195[_0x495f('0x2e')]){_0x46c494[_0x551195['idField'][_0x495f('0x2f')]()]=_0x551195[_0x495f('0x30')][_0x495f('0x31')]();}else if(_0x551195[_0x495f('0x32')]===_0x495f('0x2c')&&_0x551195[_0x495f('0x33')]&&_0x551195[_0x495f('0x2e')]){_0x46c494[_0x551195['idField']['toLowerCase']()]=_0x551195['content'][_0x495f('0x31')]();}else if(_0x551195[_0x495f('0x32')]===_0x495f('0x34')&&_0x551195[_0x495f('0x35')]&&_0x551195[_0x495f('0x33')]&&_0x551195[_0x495f('0x2e')]){_0x46c494[_0x551195[_0x495f('0x33')][_0x495f('0x2f')]()]=_0x9bf232[_0x551195[_0x495f('0x35')]][_0x495f('0x31')]();}else if(_0x551195['type']===_0x495f('0x36')&&_0x551195[_0x495f('0x37')]&&_0x551195[_0x495f('0x37')][_0x495f('0x38')]&&_0x551195['idField']&&_0x551195[_0x495f('0x2e')]){_0x46c494[_0x551195['idField'][_0x495f('0x2f')]()]=_0x9bf232[_0x551195['Variable']['name'][_0x495f('0x2f')]()][_0x495f('0x31')]();}});}return _0x46c494;}function getTicket(_0x42bd90,_0x5db7a9,_0x29e106,_0x5ba6f9,_0x25f71e,_0x54793c){return function(_0x197d93){logger[_0x495f('0xf')]('['+[_0x42bd90['toUpperCase']()]+_0x495f('0x39'),_0x197d93);return new Promise(function(_0x1daec5,_0x35d5c0){var _0x1fb6ae=_0x42bd90['toLowerCase']()===_0x495f('0x3a')?_0x197d93[_0x495f('0x1c')]:_0x197d93[_0x495f('0x27')];var _0x5e2d6d={'method':'POST','uri':_0x29e106+_0x495f('0x3b')+'?'+_0x54793c,'body':Object[_0x495f('0x3c')]({},{'active':_0x495f('0x3d'),'caller_id':_0x1fb6ae,'assigned_to':_0x197d93[_0x495f('0x1c')],'short_description':intUtil[_0x495f('0x3e')](_0x5ba6f9[_0x495f('0x3f')],_0x25f71e,'\x20'),'description':intUtil[_0x495f('0x3e')](_0x5ba6f9['Descriptions'],_0x25f71e,'\x0a')},getCustomFields(_0x5ba6f9[_0x495f('0x40')],_0x25f71e)),'auth':_0x5db7a9,'json':!![]};return rp(_0x5e2d6d)[_0x495f('0xb')](function(_0x3aa0e8){logger[_0x495f('0xf')]('['+[_0x42bd90[_0x495f('0x10')]()]+_0x495f('0x41'),_0x3aa0e8[_0x495f('0xc')]);_0x197d93[_0x495f('0x42')]=_0x3aa0e8[_0x495f('0xc')][_0x495f('0xe')];_0x197d93[_0x495f('0x43')]=_0x3aa0e8[_0x495f('0xc')][_0x495f('0x44')];logger[_0x495f('0xf')]('['+[_0x42bd90[_0x495f('0x10')]()]+_0x495f('0x45'),_0x197d93);_0x1daec5(_0x197d93);})[_0x495f('0x11')](function(_0x281149){logger[_0x495f('0x12')]('['+[_0x42bd90[_0x495f('0x10')]()]+']',_0x281149[_0x495f('0x13')]);_0x35d5c0(_0x281149[_0x495f('0x13')]);});});};}function createRemoteTag(_0x655447,_0x26085a,_0x5a5ef7,_0x521f22){return new Promise(function(_0x47b81b,_0x11c53a){var _0x2f8830={'method':_0x495f('0x21'),'uri':_0x5a5ef7+_0x495f('0x46')+'?'+_0x521f22,'body':{'short_description':_0x655447,'global':!![],'active':!![],'name':_0x655447},'auth':_0x26085a,'json':!![]};return rp(_0x2f8830)['then'](function(_0x1cd7c9){var _0x775d0d=_0x1cd7c9[_0x495f('0xc')]['sys_id'];_0x47b81b(_0x775d0d);});});}function getRemoteTag(_0x2889ef,_0x4a5fa4,_0x2ecf4e,_0x515bd3,_0x388858){return new Promise(function(_0x42c868,_0x4b9cb7){var _0xc4c18c={'method':_0x495f('0x17'),'uri':_0x2ecf4e+_0x495f('0x46')+'?sysparm_query=name%3D'+_0x2889ef+'&'+_0x515bd3,'auth':_0x4a5fa4,'json':!![]};return rp(_0xc4c18c)['then'](function(_0x47c218){if(_0x47c218[_0x495f('0xc')][_0x495f('0x1b')]>0x0){var _0x5dc289=_0x47c218[_0x495f('0xc')][0x0]['sys_id'];_0x42c868(_0x5dc289);}else{return createRemoteTag(_0x2889ef,_0x4a5fa4,_0x2ecf4e,_0x515bd3)[_0x495f('0xb')](function(_0x2dbf6e){_0x42c868(_0x2dbf6e);});}});});}function assignTagToIncident(_0x108c16,_0x3ccf73,_0x129b95,_0x37fde1,_0x3a5c33){return new Promise(function(_0x4550e7,_0x4910bd){var _0x44acbb={'method':_0x495f('0x21'),'uri':_0x129b95+_0x495f('0x47')+'?'+_0x3a5c33,'body':{'label':_0x108c16,'table':_0x495f('0x3b'),'id_type':_0x495f('0x48'),'table_key':_0x37fde1[_0x495f('0x42')],'title':_0x495f('0x49')+_0x37fde1[_0x495f('0x43')],'id_display':_0x37fde1[_0x495f('0x43')]},'auth':_0x3ccf73,'json':!![]};return rp(_0x44acbb)[_0x495f('0xb')](function(_0x200203){_0x4550e7();})[_0x495f('0x11')](function(){_0x4550e7();});});}function manageTags(_0x1febf7,_0x33f97d,_0xfd099b,_0x403df7,_0x92e35b,_0x5583be,_0x436ecd){return new Promise(function(_0x52a951,_0x149488){var _0x2eedea=[];_0x33f97d['forEach'](function(_0x496892){_0x2eedea['push'](getRemoteTag(_0x496892,_0xfd099b,_0x403df7,_0x5583be,_0x436ecd));});return Promise[_0x495f('0x4a')](_0x2eedea)[_0x495f('0xb')](function(_0x20b106){if(_0x20b106[_0x495f('0x1b')]){logger[_0x495f('0xf')]('['+[_0x1febf7[_0x495f('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x20b106);var _0x1eed02=[];_0x20b106['forEach'](function(_0x5edf8d){_0x1eed02[_0x495f('0x4b')](assignTagToIncident(_0x5edf8d,_0xfd099b,_0x403df7,_0x92e35b,_0x5583be));});return Promise['all'](_0x1eed02)[_0x495f('0xb')](function(){_0x52a951();})['catch'](function(){_0x52a951();});}else{_0x52a951();}});});}function getTags(_0x3054e0,_0x17092a,_0x4bf467,_0x4647c5,_0x51bcc,_0x3ee37e){return function(_0x22592e){return new Promise(function(_0x22ed4a,_0x4e8e90){var _0x33b000=[];var _0x362025=_0x4647c5[_0x495f('0x4c')];if(_0x362025&&_0x362025[_0x495f('0x1b')]>0x0){_0x33b000=_[_0x495f('0x4d')](_0x362025,_0x495f('0x38'));}if(_0x33b000['length']>0x0){return manageTags(_0x3054e0,_0x33b000,_0x17092a,_0x4bf467,_0x22592e,_0x51bcc,_0x3ee37e)[_0x495f('0xb')](function(){_0x22ed4a(_0x22592e);});}else{_0x22ed4a(_0x22592e);}});};}function emit(_0x177e50,_0x55d76d,_0x49a35e){var _0x4355f9=_0x495f('0x4e')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x495f('0x4f');var _0x280f73={'uri':_0x177e50+_0x495f('0x50')+_0x49a35e+_0x4355f9};io['to'](util[_0x495f('0x51')]('user:%s',_0x55d76d))['emit'](_0x495f('0x52'),_0x280f73);}exports['cs']=function(_0x2aa9d9,_0x39bd49,_0x5cf7f5,_0x34da11,_0xc9e7de,_0x4df702,_0xcfa977,_0x2366e3){var _0x230a5e={};var _0x4c4faa={'user':_0x4df702[_0x495f('0x53')],'pass':_0x4df702[_0x495f('0x54')]};var _0x151b1a=_0x495f('0x55');var _0x40c863=_0x495f('0x56');_0x4df702[_0x495f('0x57')]=intUtil[_0x495f('0x58')](_0x4df702[_0x495f('0x57')]);_0x4df702[_0x495f('0x59')]=intUtil[_0x495f('0x58')](_0x4df702[_0x495f('0x59')]);var _0xe15775=util[_0x495f('0x51')]('%s/api/now/table/',_0x4df702[_0x495f('0x57')]);_0x230a5e[_0x495f('0x16')]=!_['isNil'](_0x34da11)?_0x34da11[_0x495f('0x5a')]:null;_0x230a5e[_0x495f('0x1d')]=_0x4df702[_0x495f('0x5a')];_0x230a5e[_0x495f('0x23')]=_0x2366e3[_0x495f('0x2f')]()==='outbound'?_0x39bd49[_0x495f('0x5b')]:_0x39bd49[_0x495f('0x5c')];_0x230a5e[_0x495f('0x5d')]=_0x2366e3===_0x495f('0x5e')||_0x2366e3===_0x495f('0x5f')?'queue':_0x495f('0x3a');var _0x152786=util[_0x495f('0x51')](_0x495f('0x60'),_0x4df702[_0x495f('0x59')],_0x39bd49[_0x495f('0x61')],md5(_0x39bd49[_0x495f('0x61')]));if(_0xc9e7de&&_0xc9e7de[_0x495f('0x62')]){logger[_0x495f('0xf')](_0x495f('0x63'),_0x495f('0x64'));_0x39bd49['recordingURL']=_0x152786;}else if(_0xcfa977&&_0xcfa977[_0x495f('0x65')]&&_0xcfa977[_0x495f('0x65')]!=='none'){logger[_0x495f('0xf')]('[OUTBOUND]',_0x495f('0x64'));_0x39bd49['recordingURL']=_0x152786;}else{_0x39bd49[_0x495f('0x66')]='';}return getAdminUser(_0x2366e3,_0x4c4faa,_0x230a5e,_0xe15775,_0x40c863,_0x151b1a)[_0x495f('0xb')](getUser(_0x2366e3,_0x4c4faa,_0xe15775,_0x40c863,_0x151b1a))[_0x495f('0xb')](getEndUser(_0x2366e3,_0x4c4faa,_0xe15775,_0x40c863,_0x151b1a))[_0x495f('0xb')](getTicket(_0x2366e3,_0x4c4faa,_0xe15775,_0x5cf7f5,_0x39bd49,_0x40c863))['then'](function(_0x3261c3){logger[_0x495f('0xf')](util[_0x495f('0x51')](_0x495f('0x67'),_0x3261c3[_0x495f('0x42')]));logger[_0x495f('0xf')](util[_0x495f('0x51')]('call\x20direction:\x20%s',_0x2366e3));if(_0x2366e3!==_0x495f('0x5f')){logger[_0x495f('0xf')]('['+[_0x2366e3[_0x495f('0x10')]()]+']',_0x495f('0x68'));emit(_0x4df702['remoteUri'],_0x34da11[_0x495f('0x38')],_0x3261c3[_0x495f('0x42')]);}})[_0x495f('0x11')](function(_0x51d481){logger['error']('['+[_0x2366e3[_0x495f('0x10')]()]+_0x495f('0x69'),util[_0x495f('0x6a')](_0x51d481,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x257e=['sys_user?sysparm_query=phone%3D','endUserNumber','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','number','label','?sysparm_query=name%3D','label_entry','ticketId','Incident\x20-\x20','ticketNumber','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','username','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','format','%s/api/now/table/','isNil','email','outbound','calleridnum','callDirection','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','info','toUpperCase','catch','message','userEmail','sys_user?sysparm_query=email%3D','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','sys_user?','user','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm'];(function(_0x466273,_0x209a90){var _0x1742e9=function(_0x2812f6){while(--_0x2812f6){_0x466273['push'](_0x466273['shift']());}};_0x1742e9(++_0x209a90);}(_0x257e,0x1dc));var _0xe257=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0x257e[_0x46cf00];return _0x3974dc;};'use strict';var _=require('lodash');var Promise=require(_0xe257('0x0'));var rp=require(_0xe257('0x1'));var util=require('util');var md5=require(_0xe257('0x2'));var Redis=require('ioredis');var intUtil=require(_0xe257('0x3'));var config=require(_0xe257('0x4'));var logger=require(_0xe257('0x5'))(_0xe257('0x6'));config['redis']=_[_0xe257('0x7')](config[_0xe257('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe257('0x9'))(new Redis(config[_0xe257('0x8')]));function getAdminUser(_0x28b35c,_0x558a9e,_0x1e839a,_0x34ed0b,_0x21a51a,_0x3fe0e1){return new Promise(function(_0x3fe048,_0x500c5e){var _0x4cb090={'method':_0xe257('0xa'),'uri':_0x34ed0b+_0xe257('0xb')+'&'+_0x21a51a+'&'+_0x3fe0e1,'auth':_0x558a9e,'json':!![]};return rp(_0x4cb090)['then'](function(_0x2735a0){if(_0x2735a0[_0xe257('0xc')]['length']>0x0){_0x1e839a[_0xe257('0xd')]=_0x2735a0[_0xe257('0xc')][0x0][_0xe257('0xe')];}logger[_0xe257('0xf')]('['+[_0x28b35c[_0xe257('0x10')]()]+'],\x20getAdminUser\x20crm',_0x1e839a);_0x3fe048(_0x1e839a);})[_0xe257('0x11')](function(_0x268874){logger['error']('['+[_0x28b35c[_0xe257('0x10')]()]+']',_0x268874[_0xe257('0x12')]);_0x500c5e(_0x268874[_0xe257('0x12')]);});});}function getUser(_0x14d3bc,_0x1e34db,_0x44f6d8,_0x44a016,_0x396be4){return function(_0x54a00c){logger['info']('['+[_0x14d3bc[_0xe257('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x54a00c);return new Promise(function(_0x2a1a10,_0x5c22e8){if(intUtil['validateEmail'](_0x54a00c[_0xe257('0x13')])){var _0x56f1dc={'method':'GET','uri':_0x44f6d8+_0xe257('0x14')+_0x54a00c['userEmail']+'&'+_0x44a016+'&'+_0x396be4,'auth':_0x1e34db,'json':!![]};logger[_0xe257('0xf')]('['+[_0x14d3bc[_0xe257('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x56f1dc);return rp(_0x56f1dc)['then'](function(_0x5c9aef){logger[_0xe257('0xf')]('['+[_0x14d3bc['toUpperCase']()]+'],\x20getUser\x20entity',_0x5c9aef);if(_0x5c9aef['result']['length']>0x0&&String(_0x5c9aef[_0xe257('0xc')][0x0]['active'])===_0xe257('0x15')){_0x54a00c[_0xe257('0x16')]=_0x5c9aef[_0xe257('0xc')][0x0][_0xe257('0xe')];}else{_0x54a00c['userId']=_0x54a00c['adminId'];_0x54a00c[_0xe257('0x13')]=_0x54a00c[_0xe257('0x17')];}logger['info']('['+[_0x14d3bc['toUpperCase']()]+_0xe257('0x18'),_0x54a00c);_0x2a1a10(_0x54a00c);})[_0xe257('0x11')](function(_0x301fd4){logger[_0xe257('0x19')]('['+[_0x14d3bc['toUpperCase']()]+']',_0x301fd4[_0xe257('0x12')]);_0x5c22e8(_0x301fd4[_0xe257('0x12')]);});}else{logger[_0xe257('0xf')]('['+[_0x14d3bc[_0xe257('0x10')]()]+_0xe257('0x1a'));_0x54a00c['userId']=_0x54a00c[_0xe257('0xd')];_0x54a00c[_0xe257('0x13')]=_0x54a00c['adminEmail'];_0x2a1a10(_0x54a00c);}});};}function createEndUser(_0x31a468,_0x5097cc,_0x39a0f2,_0x59ff61,_0xac6714){logger[_0xe257('0xf')]('['+[_0x31a468[_0xe257('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x39a0f2);return new Promise(function(_0x5be955,_0x2d7095){var _0x595c7a={'method':'POST','uri':_0x59ff61+_0xe257('0x1b')+_0xac6714,'body':{'user_name':_0x39a0f2['endUserNumber'],'roles':_0xe257('0x1c'),'first_name':_0x39a0f2['endUserNumber'],'active':_0xe257('0x15'),'date_format':_0xe257('0x1d'),'phone':_0x39a0f2['endUserNumber']},'auth':_0x5097cc,'json':!![]};return rp(_0x595c7a)[_0xe257('0x1e')](function(_0x576a57){logger[_0xe257('0xf')]('['+[_0x31a468[_0xe257('0x10')]()]+_0xe257('0x1f'),_0x576a57[_0xe257('0xc')]);_0x39a0f2[_0xe257('0x20')]=_0x576a57['result']['sys_id'];_0x5be955(_0x39a0f2);})['catch'](function(_0x1fec4b){logger[_0xe257('0x19')]('['+[_0x31a468['toUpperCase']()]+']',_0x1fec4b[_0xe257('0x12')]);_0x2d7095(_0x1fec4b[_0xe257('0x12')]);});});}function getEndUser(_0x19ae5a,_0x441120,_0x32d444,_0x3452de,_0x3a5ff0){return function(_0x451bd3){logger[_0xe257('0xf')]('['+[_0x19ae5a[_0xe257('0x10')]()]+_0xe257('0x21'),_0x451bd3);return new Promise(function(_0x12a9a4,_0x124698){var _0x5632b4={'method':'GET','uri':_0x32d444+_0xe257('0x22')+_0x451bd3[_0xe257('0x23')]+'&'+_0x3452de+'&'+_0x3a5ff0,'auth':_0x441120,'json':!![]};return rp(_0x5632b4)['then'](function(_0x496a5b){if(_0x496a5b[_0xe257('0xc')][_0xe257('0x24')]>0x0){_0x451bd3[_0xe257('0x20')]=_0x496a5b[_0xe257('0xc')][0x0][_0xe257('0xe')];logger[_0xe257('0xf')]('['+[_0x19ae5a[_0xe257('0x10')]()]+_0xe257('0x25'),_0x451bd3);_0x12a9a4(_0x451bd3);}else{return createEndUser(_0x19ae5a,_0x441120,_0x451bd3,_0x32d444,_0x3452de)[_0xe257('0x1e')](function(_0x5c104){logger[_0xe257('0xf')]('['+[_0x19ae5a['toUpperCase']()]+_0xe257('0x26'),_0x5c104);_0x12a9a4(_0x5c104);});}})[_0xe257('0x11')](function(_0x550908){logger[_0xe257('0x19')]('['+[_0x19ae5a[_0xe257('0x10')]()]+']',_0x550908['message']);_0x124698(_0x550908[_0xe257('0x12')]);});});};}function getCustomFields(_0x389c4e,_0xab5b00){var _0x1b575c={};if(_0x389c4e[_0xe257('0x24')]>0x0){_[_0xe257('0x27')](_0x389c4e,function(_0x1f9460){if(_0x1f9460[_0xe257('0x28')]===_0xe257('0x29')&&_0x1f9460[_0xe257('0x2a')]&&!_0x1f9460[_0xe257('0x2b')]){_0x1b575c[_0x1f9460[_0xe257('0x2c')][_0xe257('0x2d')]()]=_0x1f9460[_0xe257('0x2e')][_0xe257('0x2f')]();}else if(_0x1f9460['type']===_0xe257('0x29')&&_0x1f9460[_0xe257('0x2c')]&&_0x1f9460[_0xe257('0x2b')]){_0x1b575c[_0x1f9460[_0xe257('0x2c')][_0xe257('0x2d')]()]=_0x1f9460[_0xe257('0x2e')]['toString']();}else if(_0x1f9460['type']===_0xe257('0x30')&&_0x1f9460[_0xe257('0x31')]&&_0x1f9460['idField']&&_0x1f9460['customField']){_0x1b575c[_0x1f9460['idField'][_0xe257('0x2d')]()]=_0xab5b00[_0x1f9460['variableName']]['toString']();}else if(_0x1f9460[_0xe257('0x28')]===_0xe257('0x32')&&_0x1f9460[_0xe257('0x33')]&&_0x1f9460['Variable']['name']&&_0x1f9460[_0xe257('0x2c')]&&_0x1f9460['customField']){_0x1b575c[_0x1f9460[_0xe257('0x2c')]['toLowerCase']()]=_0xab5b00[_0x1f9460[_0xe257('0x33')][_0xe257('0x34')][_0xe257('0x2d')]()][_0xe257('0x2f')]();}});}return _0x1b575c;}function getTicket(_0x5f4526,_0x59e62a,_0x1471ba,_0x408c8d,_0x1c7746,_0x4221d9){return function(_0x5aee3b){logger[_0xe257('0xf')]('['+[_0x5f4526[_0xe257('0x10')]()]+_0xe257('0x35'),_0x5aee3b);return new Promise(function(_0x4a14d8,_0x3c5dd8){var _0x198235=_0x5f4526['toLowerCase']()==='outbound'?_0x5aee3b[_0xe257('0x16')]:_0x5aee3b[_0xe257('0x20')];var _0xd082e6={'method':_0xe257('0x36'),'uri':_0x1471ba+_0xe257('0x37')+'?'+_0x4221d9,'body':Object[_0xe257('0x38')]({},{'active':_0xe257('0x15'),'caller_id':_0x198235,'assigned_to':_0x5aee3b[_0xe257('0x16')],'short_description':intUtil[_0xe257('0x39')](_0x408c8d[_0xe257('0x3a')],_0x1c7746,'\x20'),'description':intUtil[_0xe257('0x39')](_0x408c8d['Descriptions'],_0x1c7746,'\x0a')},getCustomFields(_0x408c8d[_0xe257('0x3b')],_0x1c7746)),'auth':_0x59e62a,'json':!![]};return rp(_0xd082e6)['then'](function(_0x2ba9e8){logger[_0xe257('0xf')]('['+[_0x5f4526[_0xe257('0x10')]()]+_0xe257('0x3c'),_0x2ba9e8[_0xe257('0xc')]);_0x5aee3b['ticketId']=_0x2ba9e8['result'][_0xe257('0xe')];_0x5aee3b['ticketNumber']=_0x2ba9e8['result'][_0xe257('0x3d')];logger['info']('['+[_0x5f4526[_0xe257('0x10')]()]+']\x20getTicket\x20crm',_0x5aee3b);_0x4a14d8(_0x5aee3b);})['catch'](function(_0x4ccf46){logger['error']('['+[_0x5f4526['toUpperCase']()]+']',_0x4ccf46[_0xe257('0x12')]);_0x3c5dd8(_0x4ccf46[_0xe257('0x12')]);});});};}function createRemoteTag(_0x4a17f7,_0x115293,_0x2fdb81,_0x521add){return new Promise(function(_0x3c0485,_0x2c30dd){var _0x54028d={'method':_0xe257('0x36'),'uri':_0x2fdb81+'label'+'?'+_0x521add,'body':{'short_description':_0x4a17f7,'global':!![],'active':!![],'name':_0x4a17f7},'auth':_0x115293,'json':!![]};return rp(_0x54028d)[_0xe257('0x1e')](function(_0x5b8bb2){var _0x543b7f=_0x5b8bb2[_0xe257('0xc')][_0xe257('0xe')];_0x3c0485(_0x543b7f);});});}function getRemoteTag(_0x4fe184,_0x553a6c,_0x175682,_0x8db909,_0x51292f){return new Promise(function(_0x1a6a63,_0x20695a){var _0x1ce428={'method':'GET','uri':_0x175682+_0xe257('0x3e')+_0xe257('0x3f')+_0x4fe184+'&'+_0x8db909,'auth':_0x553a6c,'json':!![]};return rp(_0x1ce428)['then'](function(_0x356e27){if(_0x356e27[_0xe257('0xc')][_0xe257('0x24')]>0x0){var _0x54d45d=_0x356e27[_0xe257('0xc')][0x0]['sys_id'];_0x1a6a63(_0x54d45d);}else{return createRemoteTag(_0x4fe184,_0x553a6c,_0x175682,_0x8db909)[_0xe257('0x1e')](function(_0x483a8c){_0x1a6a63(_0x483a8c);});}});});}function assignTagToIncident(_0x2f645a,_0x146d1c,_0x2eb7d7,_0x2ef651,_0x5bec7d){return new Promise(function(_0x4080d8,_0x327031){var _0x533700={'method':_0xe257('0x36'),'uri':_0x2eb7d7+_0xe257('0x40')+'?'+_0x5bec7d,'body':{'label':_0x2f645a,'table':'incident','id_type':'Incident','table_key':_0x2ef651[_0xe257('0x41')],'title':_0xe257('0x42')+_0x2ef651[_0xe257('0x43')],'id_display':_0x2ef651[_0xe257('0x43')]},'auth':_0x146d1c,'json':!![]};return rp(_0x533700)[_0xe257('0x1e')](function(_0x5500ac){_0x4080d8();})[_0xe257('0x11')](function(){_0x4080d8();});});}function manageTags(_0x156e4b,_0x7de8b6,_0x120c5b,_0xfbbd21,_0x875d26,_0x38cf07,_0x572681){return new Promise(function(_0x167260,_0x38d8cf){var _0x373e71=[];_0x7de8b6['forEach'](function(_0x1556ab){_0x373e71[_0xe257('0x44')](getRemoteTag(_0x1556ab,_0x120c5b,_0xfbbd21,_0x38cf07,_0x572681));});return Promise[_0xe257('0x45')](_0x373e71)[_0xe257('0x1e')](function(_0x68d421){if(_0x68d421[_0xe257('0x24')]){logger[_0xe257('0xf')]('['+[_0x156e4b[_0xe257('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x68d421);var _0x45e299=[];_0x68d421[_0xe257('0x27')](function(_0x5a0eb8){_0x45e299[_0xe257('0x44')](assignTagToIncident(_0x5a0eb8,_0x120c5b,_0xfbbd21,_0x875d26,_0x38cf07));});return Promise[_0xe257('0x45')](_0x45e299)[_0xe257('0x1e')](function(){_0x167260();})[_0xe257('0x11')](function(){_0x167260();});}else{_0x167260();}});});}function getTags(_0x5c79bb,_0x26177f,_0x11a3f6,_0x53937a,_0x149747,_0x4128e6){return function(_0x575bc5){return new Promise(function(_0x50bd7d,_0x3d7477){var _0xac35fb=[];var _0x435c73=_0x53937a[_0xe257('0x46')];if(_0x435c73&&_0x435c73['length']>0x0){_0xac35fb=_['map'](_0x435c73,_0xe257('0x34'));}if(_0xac35fb[_0xe257('0x24')]>0x0){return manageTags(_0x5c79bb,_0xac35fb,_0x26177f,_0x11a3f6,_0x575bc5,_0x149747,_0x4128e6)[_0xe257('0x1e')](function(){_0x50bd7d(_0x575bc5);});}else{_0x50bd7d(_0x575bc5);}});};}function emit(_0x1b6919,_0x18ccbc,_0x3281bb){var _0x102b51=_0xe257('0x47')+_0xe257('0x48')+_0xe257('0x49')+_0xe257('0x4a');var _0x122feb={'uri':_0x1b6919+_0xe257('0x4b')+_0x3281bb+_0x102b51};io['to'](util['format'](_0xe257('0x4c'),_0x18ccbc))['emit']('trigger:browser:url',_0x122feb);}exports['cs']=function(_0x702bdb,_0x5e707f,_0xf966f9,_0x206091,_0x5a5f61,_0x8be676,_0x5c07e4,_0x1ed2b4){var _0xbed16d={};var _0x5b5b6b={'user':_0x8be676[_0xe257('0x4d')],'pass':_0x8be676['password']};var _0x1cd610=_0xe257('0x4e');var _0x38ff7c='sysparm_display_value=true';_0x8be676['remoteUri']=intUtil[_0xe257('0x4f')](_0x8be676[_0xe257('0x50')]);_0x8be676[_0xe257('0x51')]=intUtil[_0xe257('0x4f')](_0x8be676[_0xe257('0x51')]);var _0x57335d=util[_0xe257('0x52')](_0xe257('0x53'),_0x8be676[_0xe257('0x50')]);_0xbed16d[_0xe257('0x13')]=!_[_0xe257('0x54')](_0x206091)?_0x206091[_0xe257('0x55')]:null;_0xbed16d[_0xe257('0x17')]=_0x8be676[_0xe257('0x55')];_0xbed16d[_0xe257('0x23')]=_0x1ed2b4[_0xe257('0x2d')]()===_0xe257('0x56')?_0x5e707f['destcalleridnum']:_0x5e707f[_0xe257('0x57')];_0xbed16d[_0xe257('0x58')]=_0x1ed2b4==='queue'||_0x1ed2b4===_0xe257('0x59')?'queue':_0xe257('0x56');var _0x595791=util[_0xe257('0x52')](_0xe257('0x5a'),_0x8be676[_0xe257('0x51')],_0x5e707f[_0xe257('0x5b')],md5(_0x5e707f[_0xe257('0x5b')]));if(_0x5a5f61&&_0x5a5f61[_0xe257('0x5c')]){logger[_0xe257('0xf')](_0xe257('0x5d'),'Recording\x20is\x20enabled!');_0x5e707f['recordingURL']=_0x595791;}else if(_0x5c07e4&&_0x5c07e4[_0xe257('0x5e')]&&_0x5c07e4[_0xe257('0x5e')]!=='none'){logger[_0xe257('0xf')](_0xe257('0x5f'),_0xe257('0x60'));_0x5e707f['recordingURL']=_0x595791;}else{_0x5e707f[_0xe257('0x61')]='';}return getAdminUser(_0x1ed2b4,_0x5b5b6b,_0xbed16d,_0x57335d,_0x38ff7c,_0x1cd610)[_0xe257('0x1e')](getUser(_0x1ed2b4,_0x5b5b6b,_0x57335d,_0x38ff7c,_0x1cd610))[_0xe257('0x1e')](getEndUser(_0x1ed2b4,_0x5b5b6b,_0x57335d,_0x38ff7c,_0x1cd610))[_0xe257('0x1e')](getTicket(_0x1ed2b4,_0x5b5b6b,_0x57335d,_0xf966f9,_0x5e707f,_0x38ff7c))[_0xe257('0x1e')](function(_0x1d8726){logger['info'](util[_0xe257('0x52')](_0xe257('0x62'),_0x1d8726[_0xe257('0x41')]));logger[_0xe257('0xf')](util[_0xe257('0x52')](_0xe257('0x63'),_0x1ed2b4));if(_0x1ed2b4!=='abandoned'){logger[_0xe257('0xf')]('['+[_0x1ed2b4['toUpperCase']()]+']',_0xe257('0x64'));emit(_0x8be676[_0xe257('0x50')],_0x206091['name'],_0x1d8726[_0xe257('0x41')]);}})['catch'](function(_0x37a36d){logger[_0xe257('0x19')]('['+[_0x1ed2b4['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xe257('0x65')](_0x37a36d,{'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 79317c1..61dd1a5 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 _0x6b1c=['value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','toLowerCase','content','toString','type','idField','customField','custom_fields','variable','Variable','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','users','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','error','[ABANDONED]','Recording\x20is\x20enabled!','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','POST','info','getString','assigned_user_id','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','Contacts','direction','forEach','variableName','push','set_entry','JSON','Calls','format','apiKey','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','stringify','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','entry_list','length','find'];(function(_0x504a77,_0x5d6ae5){var _0x3a225d=function(_0x213b8a){while(--_0x213b8a){_0x504a77['push'](_0x504a77['shift']());}};_0x3a225d(++_0x5d6ae5);}(_0x6b1c,0xb5));var _0xc6b1=function(_0x2fe329,_0x59a823){_0x2fe329=_0x2fe329-0x0;var _0x27e985=_0x6b1c[_0x2fe329];return _0x27e985;};'use strict';var _=require('lodash');var rp=require(_0xc6b1('0x0'));var BPromise=require('bluebird');var md5=require(_0xc6b1('0x1'));var util=require(_0xc6b1('0x2'));var Redis=require(_0xc6b1('0x3'));var intUtil=require(_0xc6b1('0x4'));var config=require(_0xc6b1('0x5'));var logger=require(_0xc6b1('0x6'))(_0xc6b1('0x7'));config[_0xc6b1('0x8')]=_[_0xc6b1('0x9')](config[_0xc6b1('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc6b1('0x8')]));var def={'method':_0xc6b1('0xa'),'json':!![]};function emit(_0x3d437f,_0x15afeb,_0x3c565f){io['to'](_0x3d437f)['emit'](_0x15afeb,_0x3c565f);}function getTicket(_0x584c7e,_0x2423b6,_0xd0783a,_0x4d39c6,_0x1dc42f,_0x11e3f1,_0x3b802f,_0x4e0219){logger[_0xc6b1('0xb')]('Creating\x20new\x20ticket...');var _0x18dff1=new Date();var _0x139335=[{'name':'name','value':intUtil[_0xc6b1('0xc')](_0x4d39c6['Subjects'],_0x1dc42f,'\x20')},{'name':_0xc6b1('0xd'),'value':_0x2423b6['id']},{'name':'created_by','value':_0x2423b6['id']},{'name':'description','value':intUtil[_0xc6b1('0xc')](_0x4d39c6[_0xc6b1('0xe')],_0x1dc42f,'\x0a')},{'name':_0xc6b1('0xf'),'value':_0x18dff1[_0xc6b1('0x10')]()[_0xc6b1('0x11')](0x0,0x13)[_0xc6b1('0x12')]('T','\x20')},{'name':_0xc6b1('0x13'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xc6b1('0x14'),'value':_0xd0783a['id']},{'name':'parent_type','value':_0xc6b1('0x15')},{'name':'parent_name','value':_0xd0783a['name']},{'name':_0xc6b1('0x16'),'value':_0x4e0219}];if(_0x11e3f1['length']){_[_0xc6b1('0x17')](_0x11e3f1,function(_0x34f44d){if(_0x1dc42f[_0x34f44d[_0xc6b1('0x18')]]){_0x139335[_0xc6b1('0x19')]({'name':_0x34f44d['idField'],'value':_0x1dc42f[_0x34f44d[_0xc6b1('0x18')]]});}});}return request({'form':{'method':_0xc6b1('0x1a'),'input_type':_0xc6b1('0x1b'),'response_type':_0xc6b1('0x1b'),'rest_data':JSON['stringify']({'session':_0x3b802f['id'],'module_name':_0xc6b1('0x1c'),'name_value_list':_0x139335})}});}function getAuth(_0x483290){return util[_0xc6b1('0x1d')]('Basic\x20%s',new Buffer(_0x483290[_0xc6b1('0x1e')]+':X')['toString']('base64'));}function getServerInfo(_0x198669){return request({'form':{'method':_0xc6b1('0x1f'),'input_type':_0xc6b1('0x1b'),'response_type':_0xc6b1('0x1b'),'rest_data':JSON['stringify']({'session':_0x198669['id']})}});}function getUser(_0x19c86b,_0x298798,_0x14adfd){if(!_[_0xc6b1('0x20')](_0x298798)){logger[_0xc6b1('0xb')](_0xc6b1('0x21'),_0x298798);return request({'form':{'method':_0xc6b1('0x22'),'input_type':'JSON','response_type':_0xc6b1('0x1b'),'rest_data':JSON[_0xc6b1('0x23')]({'session':_0x14adfd['id'],'module_name':'Employees','query':util[_0xc6b1('0x1d')](_0xc6b1('0x24'),_0x298798),'order_by':'','offset':'0','select_fields':['id',_0xc6b1('0x25'),_0xc6b1('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc6b1('0x27')](function(_0x158840){if(_0x158840[_0xc6b1('0x28')][_0xc6b1('0x29')]){var _0x859a6d=_[_0xc6b1('0x2a')](_0x158840['entry_list'],function(_0x3bf834){return _0x3bf834['name_value_list']['user_name'][_0xc6b1('0x2b')]===_0x298798;});if(_0x859a6d){logger[_0xc6b1('0xb')](_0xc6b1('0x2c'));return BPromise[_0xc6b1('0x2d')]({'id':_0x859a6d[_0xc6b1('0x2e')]['id'][_0xc6b1('0x2b')],'name':_0x859a6d[_0xc6b1('0x2e')]['name'][_0xc6b1('0x2b')]});}}logger[_0xc6b1('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc6b1('0x2d')]({'id':_0x14adfd[_0xc6b1('0x2e')]['user_id'][_0xc6b1('0x2b')],'name':_0x14adfd[_0xc6b1('0x2e')][_0xc6b1('0x26')][_0xc6b1('0x2b')]});});}else{logger['info'](_0xc6b1('0x2f'));return BPromise['resolve']({'id':_0x14adfd[_0xc6b1('0x2e')]['user_id']['value'],'name':_0x14adfd[_0xc6b1('0x2e')]['user_name'][_0xc6b1('0x2b')]});}}function getEndUser(_0x387895,_0xce1846,_0x4012da,_0xcf0209){logger[_0xc6b1('0xb')](_0xc6b1('0x30'),_0x4012da);return request({'form':{'method':_0xc6b1('0x22'),'input_type':_0xc6b1('0x1b'),'response_type':'JSON','rest_data':JSON[_0xc6b1('0x23')]({'session':_0xcf0209['id'],'module_name':_0xc6b1('0x15'),'query':util[_0xc6b1('0x1d')](_0xc6b1('0x31'),_0x4012da),'order_by':'','offset':'0','select_fields':['id',_0xc6b1('0x25'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc6b1('0x27')](function(_0x3878ad){if(_0x3878ad[_0xc6b1('0x28')][_0xc6b1('0x29')]){var _0x47e27a=_[_0xc6b1('0x2a')](_0x3878ad[_0xc6b1('0x28')],function(_0x416e4d){return _0x416e4d[_0xc6b1('0x2e')][_0xc6b1('0x32')][_0xc6b1('0x2b')]===_0x4012da;});if(_0x47e27a){logger[_0xc6b1('0xb')]('Enduser\x20found!');return BPromise[_0xc6b1('0x2d')]({'id':_0x47e27a[_0xc6b1('0x2e')]['id'][_0xc6b1('0x2b')],'name':_0x47e27a[_0xc6b1('0x2e')][_0xc6b1('0x25')][_0xc6b1('0x2b')],'phone':_0x47e27a['name_value_list'][_0xc6b1('0x32')][_0xc6b1('0x2b')]});}}else{logger[_0xc6b1('0xb')](_0xc6b1('0x33'));return request({'form':{'method':'set_entry','input_type':_0xc6b1('0x1b'),'response_type':_0xc6b1('0x1b'),'rest_data':JSON['stringify']({'session':_0xcf0209['id'],'module_name':_0xc6b1('0x15'),'name_value_list':[{'name':_0xc6b1('0x34'),'value':_0xce1846!==''?_0xce1846:util['format'](_0xc6b1('0x35'),_0x4012da)},{'name':_0xc6b1('0x32'),'value':_0x4012da}]})}})[_0xc6b1('0x27')](function(_0x2729be){logger[_0xc6b1('0xb')](_0xc6b1('0x36'));return BPromise[_0xc6b1('0x2d')]({'id':_0x2729be['id'],'name':_0x2729be[_0xc6b1('0x28')][_0xc6b1('0x34')][_0xc6b1('0x2b')],'phone':_0x2729be[_0xc6b1('0x28')]['phone_home'][_0xc6b1('0x2b')]});});}});}function request(_0x26e416){logger[_0xc6b1('0x37')](_0xc6b1('0x38'),JSON['stringify'](_0x26e416));return rp(_[_0xc6b1('0x39')](def,_0x26e416));}function getTags(_0x1c2e42,_0x1301c6){var _0x380ed0=[];if(_0x1c2e42&&_0x1c2e42[_0xc6b1('0x29')]>0x0){_0x380ed0=_[_0xc6b1('0x3a')](_0x1c2e42,_0x1301c6);}return _0x380ed0;}function getCustomFields(_0x50211a,_0x5d09c7){var _0x5ef930=[];var _0x106ab6={'custom_fields':[]};if(_0x50211a[_0xc6b1('0x29')]>0x0){_[_0xc6b1('0x17')](_0x50211a,function(_0x13cc31){if(_0x13cc31['type']==='string'&&_0x13cc31['nameField']&&!_0x13cc31['customField']){_0x106ab6[_0x13cc31['nameField'][_0xc6b1('0x3b')]()]=_0x13cc31[_0xc6b1('0x3c')][_0xc6b1('0x3d')]();}else if(_0x13cc31[_0xc6b1('0x3e')]==='string'&&_0x13cc31[_0xc6b1('0x3f')]&&_0x13cc31[_0xc6b1('0x40')]){_0x106ab6[_0xc6b1('0x41')]['push']({'id':_0x13cc31[_0xc6b1('0x3f')],'value':_0x13cc31[_0xc6b1('0x3c')][_0xc6b1('0x3d')]()});}else if(_0x13cc31['type']===_0xc6b1('0x42')&&_0x13cc31[_0xc6b1('0x18')]&&_0x13cc31['idField']&&_0x13cc31[_0xc6b1('0x40')]){_0x5d09c7[_0x13cc31[_0xc6b1('0x18')]]&&_0x106ab6[_0xc6b1('0x41')][_0xc6b1('0x19')]({'id':_0x13cc31[_0xc6b1('0x3f')],'value':_0x5d09c7[_0x13cc31[_0xc6b1('0x18')]][_0xc6b1('0x3d')]()});}else if(_0x13cc31[_0xc6b1('0x3e')]==='customVariable'&&_0x13cc31['Variable']&&_0x13cc31[_0xc6b1('0x43')][_0xc6b1('0x25')]&&_0x13cc31[_0xc6b1('0x3f')]&&_0x13cc31['customField']){_0x5d09c7[_0x13cc31[_0xc6b1('0x43')][_0xc6b1('0x25')][_0xc6b1('0x3b')]()]&&_0x106ab6['custom_fields']['push']({'id':_0x13cc31[_0xc6b1('0x3f')],'value':_0x5d09c7[_0x13cc31[_0xc6b1('0x43')]['name']['toLowerCase']()][_0xc6b1('0x3d')]()});}});}return _0x106ab6;}function getConnection(_0x31b73c){return request({'method':_0xc6b1('0xa'),'form':{'method':_0xc6b1('0x44'),'input_type':_0xc6b1('0x1b'),'response_type':_0xc6b1('0x1b'),'rest_data':JSON[_0xc6b1('0x23')]({'user_auth':{'user_name':_0x31b73c[_0xc6b1('0x45')],'password':_0x31b73c[_0xc6b1('0x46')],'encryption':_0xc6b1('0x47')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xc6b1('0x27')](function(_0x37a68f){var _0x4f6921=_0x37a68f;if(_0x4f6921['id']){def[_0xc6b1('0x48')]=_0x4f6921['id'];return BPromise[_0xc6b1('0x2d')](_0x4f6921);}else{throw new Error(util['format'](_0xc6b1('0x49'),_0x31b73c['id']));}});}function setRelationship(_0x73c968,_0x1400de,_0x4ab159,_0x1b7dc7){return request({'form':{'method':'set_relationship','input_type':_0xc6b1('0x1b'),'response_type':_0xc6b1('0x1b'),'rest_data':JSON[_0xc6b1('0x23')]({'session':_0x73c968['id'],'module_name':_0xc6b1('0x1c'),'module_id':_0x4ab159['id'],'link_field_name':_0x1b7dc7,'related_ids':[_0x1400de['id']]})}});}exports[_0xc6b1('0x4a')]=function(_0x466932,_0x563661,_0x227e3e,_0x483abf,_0x102413,_0x2dee31){var _0x2c508b,_0x3817e2,_0x2529b0,_0x39f5b4;_0x2dee31[_0xc6b1('0x4b')]=intUtil['stripTrailingSlash'](_0x2dee31[_0xc6b1('0x4b')]);_0x2dee31[_0xc6b1('0x4c')]=intUtil[_0xc6b1('0x4d')](_0x2dee31[_0xc6b1('0x4c')]);def[_0xc6b1('0x4e')]=util['format'](_0xc6b1('0x4f'),_0x2dee31[_0xc6b1('0x4b')]);if(_0x102413&&_0x102413[_0xc6b1('0x50')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x563661[_0xc6b1('0x51')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dee31['serverUrl'],_0x563661[_0xc6b1('0x52')],md5(_0x563661[_0xc6b1('0x52')]));}else{_0x563661[_0xc6b1('0x51')]='';}return getConnection(_0x2dee31)[_0xc6b1('0x27')](function(_0x344515){_0x39f5b4=_0x344515;return getUser(_0x2dee31,_0x483abf[_0xc6b1('0x25')],_0x39f5b4);})[_0xc6b1('0x27')](function(_0x1645f2){_0x2c508b=_0x1645f2;logger[_0xc6b1('0xb')]('The\x20User\x20ID\x20is:',_0x2c508b['id']);return getEndUser(_0x2dee31,_0x563661[_0xc6b1('0x53')],_0x563661[_0xc6b1('0x54')],_0x39f5b4);})[_0xc6b1('0x27')](function(_0x2188b0){_0x3817e2=_0x2188b0;logger[_0xc6b1('0xb')](_0xc6b1('0x55'),_0x3817e2['id']);return getTicket(_0x2dee31,_0x2c508b,_0x3817e2,_0x227e3e,_0x563661,_0x227e3e[_0xc6b1('0x56')],_0x39f5b4,_0xc6b1('0x57'));})[_0xc6b1('0x27')](function(_0x466220){_0x2529b0=_0x466220;logger[_0xc6b1('0xb')](_0xc6b1('0x58'));logger['info'](_0xc6b1('0x59'),_0x2529b0['id']);return setRelationship(_0x39f5b4,_0x2c508b,_0x2529b0,'users');})['then'](function(){return setRelationship(_0x39f5b4,_0x3817e2,_0x2529b0,_0xc6b1('0x5a'));})[_0xc6b1('0x27')](function(){return getServerInfo(_0x39f5b4);})[_0xc6b1('0x27')](function(_0x6b5215){var _0x5738d1=parseInt(_0x6b5215[_0xc6b1('0x5b')][_0xc6b1('0x5c')](0x0));var _0xdb9655=util[_0xc6b1('0x1d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2dee31[_0xc6b1('0x4b')],_0x2529b0['id']);if(_0x5738d1>0x6){_0xdb9655=util[_0xc6b1('0x1d')](_0xc6b1('0x5d'),_0x2dee31[_0xc6b1('0x4b')],_0x2529b0['id']);}logger['info']('[QUEUE]',_0xc6b1('0x5e'));emit(util['format'](_0xc6b1('0x5f'),_0x483abf[_0xc6b1('0x25')]),_0xc6b1('0x60'),{'uri':_0xdb9655});})[_0xc6b1('0x61')](function(_0x772ca6){logger['error']('[QUEUE]',JSON[_0xc6b1('0x23')](_0x772ca6));});};exports[_0xc6b1('0x62')]=function(_0x4d4687,_0x5887a3,_0x3864cd,_0x19d370,_0x6f977a,_0x2e48f7,_0x1a49b9){var _0xaff67,_0x18ecce,_0xf2de74,_0x393c14;_0x2e48f7[_0xc6b1('0x4b')]=intUtil[_0xc6b1('0x4d')](_0x2e48f7['remoteUri']);_0x2e48f7[_0xc6b1('0x4c')]=intUtil[_0xc6b1('0x4d')](_0x2e48f7[_0xc6b1('0x4c')]);def[_0xc6b1('0x4e')]=util[_0xc6b1('0x1d')](_0xc6b1('0x4f'),_0x2e48f7[_0xc6b1('0x4b')]);if(_0x1a49b9&&_0x1a49b9[_0xc6b1('0x63')]&&_0x1a49b9[_0xc6b1('0x63')]!==_0xc6b1('0x64')){logger['info'](_0xc6b1('0x65'),'Recording\x20is\x20enabled!');_0x5887a3[_0xc6b1('0x51')]=util[_0xc6b1('0x1d')](_0xc6b1('0x66'),_0x2e48f7[_0xc6b1('0x4c')],_0x5887a3[_0xc6b1('0x52')],md5(_0x5887a3[_0xc6b1('0x52')]));}return getConnection(_0x2e48f7)[_0xc6b1('0x27')](function(_0x2c48d7){_0x393c14=_0x2c48d7;return getUser(_0x2e48f7,_0x19d370[_0xc6b1('0x25')],_0x393c14);})[_0xc6b1('0x27')](function(_0x22dcab){_0xaff67=_0x22dcab;logger['info'](_0xc6b1('0x67'),_0xaff67['id']);return getEndUser(_0x2e48f7,_0x5887a3[_0xc6b1('0x68')],_0x5887a3[_0xc6b1('0x69')],_0x393c14);})['then'](function(_0x181c44){_0x18ecce=_0x181c44;logger[_0xc6b1('0xb')](_0xc6b1('0x55'),_0x18ecce['id']);return getTicket(_0x2e48f7,_0xaff67,_0x18ecce,_0x3864cd,_0x5887a3,_0x3864cd[_0xc6b1('0x56')],_0x393c14,_0xc6b1('0x6a'));})[_0xc6b1('0x27')](function(_0x347310){_0xf2de74=_0x347310;logger[_0xc6b1('0xb')](_0xc6b1('0x58'));logger[_0xc6b1('0xb')]('The\x20Ticket\x20ID\x20is:',_0xf2de74['id']);return setRelationship(_0x393c14,_0xaff67,_0xf2de74,_0xc6b1('0x6b'));})[_0xc6b1('0x27')](function(){return setRelationship(_0x393c14,_0x18ecce,_0xf2de74,'contacts');})['then'](function(){return getServerInfo(_0x393c14);})[_0xc6b1('0x27')](function(_0x9165ff){var _0x1199ca=parseInt(_0x9165ff[_0xc6b1('0x5b')]['charAt'](0x0));var _0x427152=util[_0xc6b1('0x1d')](_0xc6b1('0x6c'),_0x2e48f7['remoteUri'],_0xf2de74['id']);if(_0x1199ca>0x6){_0x427152=util[_0xc6b1('0x1d')](_0xc6b1('0x5d'),_0x2e48f7[_0xc6b1('0x4b')],_0xf2de74['id']);}logger[_0xc6b1('0xb')](_0xc6b1('0x65'),_0xc6b1('0x5e'));emit(util[_0xc6b1('0x1d')]('user:%s',_0x19d370[_0xc6b1('0x25')]),_0xc6b1('0x60'),{'uri':_0x427152});})[_0xc6b1('0x61')](function(_0x142459){logger[_0xc6b1('0x6d')](_0xc6b1('0x65'),JSON[_0xc6b1('0x23')](_0x142459));});};exports['abandoned']=function(_0x3fd4b4,_0x4d6404,_0x4d64ff,_0x210d2b,_0x540d15,_0x3a122f){var _0x24e852,_0x19183e,_0x1dbcd3,_0x546a80;_0x3a122f['remoteUri']=intUtil['stripTrailingSlash'](_0x3a122f[_0xc6b1('0x4b')]);_0x3a122f[_0xc6b1('0x4c')]=intUtil[_0xc6b1('0x4d')](_0x3a122f[_0xc6b1('0x4c')]);def[_0xc6b1('0x4e')]=util[_0xc6b1('0x1d')](_0xc6b1('0x4f'),_0x3a122f['remoteUri']);if(_0x540d15&&_0x540d15[_0xc6b1('0x50')]){logger[_0xc6b1('0xb')](_0xc6b1('0x6e'),_0xc6b1('0x6f'));_0x4d6404[_0xc6b1('0x51')]=util['format'](_0xc6b1('0x66'),_0x3a122f[_0xc6b1('0x4c')],_0x4d6404[_0xc6b1('0x52')],md5(_0x4d6404[_0xc6b1('0x52')]));}else{_0x4d6404[_0xc6b1('0x51')]='';}return getConnection(_0x3a122f)['then'](function(_0x104d83){_0x546a80=_0x104d83;if(!_[_0xc6b1('0x20')](_0x210d2b)){return getUser(_0x3a122f,_0x210d2b[_0xc6b1('0x25')],_0x546a80);}else{return getUser(_0x3a122f,null,_0x546a80);}})[_0xc6b1('0x27')](function(_0x181494){_0x24e852=_0x181494;logger[_0xc6b1('0xb')](_0xc6b1('0x67'),_0x24e852['id']);return getEndUser(_0x3a122f,_0x4d6404['calleridname'],_0x4d6404[_0xc6b1('0x54')],_0x546a80);})['then'](function(_0x393065){_0x19183e=_0x393065;logger[_0xc6b1('0xb')](_0xc6b1('0x55'),_0x19183e['id']);return getTicket(_0x3a122f,_0x24e852,_0x19183e,_0x4d64ff,_0x4d6404,_0x4d64ff[_0xc6b1('0x56')],_0x546a80,_0xc6b1('0x57'));})[_0xc6b1('0x27')](function(_0x139faa){_0x1dbcd3=_0x139faa;logger['info'](_0xc6b1('0x58'));logger['info'](_0xc6b1('0x59'),_0x1dbcd3['id']);return setRelationship(_0x546a80,_0x24e852,_0x1dbcd3,_0xc6b1('0x6b'));})[_0xc6b1('0x27')](function(){return setRelationship(_0x546a80,_0x19183e,_0x1dbcd3,_0xc6b1('0x5a'));})['then'](function(){return getServerInfo(_0x546a80);})[_0xc6b1('0x61')](function(_0x5f33c7){logger['error'](_0xc6b1('0x6e'),JSON[_0xc6b1('0x23')](_0x5f33c7));});}; \ No newline at end of file +var _0x6086=['description','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','find','Agent\x20found!','resolve','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','entry_list','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','string','nameField','customField','type','custom_fields','content','variable','Variable','toLowerCase','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','[QUEUE]','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','version','abandoned','[ABANDONED]','isNil','calleridnum','users','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','getString','assigned_user_id','created_by'];(function(_0x1bc445,_0x2d6fe0){var _0x589e6b=function(_0xcdd664){while(--_0xcdd664){_0x1bc445['push'](_0x1bc445['shift']());}};_0x589e6b(++_0x2d6fe0);}(_0x6086,0x6c));var _0x6608=function(_0x562f04,_0x39ee84){_0x562f04=_0x562f04-0x0;var _0x308729=_0x6086[_0x562f04];return _0x308729;};'use strict';var _=require(_0x6608('0x0'));var rp=require(_0x6608('0x1'));var BPromise=require(_0x6608('0x2'));var md5=require(_0x6608('0x3'));var util=require(_0x6608('0x4'));var Redis=require(_0x6608('0x5'));var intUtil=require(_0x6608('0x6'));var config=require(_0x6608('0x7'));var logger=require(_0x6608('0x8'))('sugarcrm');config[_0x6608('0x9')]=_['defaults'](config[_0x6608('0x9')],{'host':_0x6608('0xa'),'port':0x18eb});var io=require(_0x6608('0xb'))(new Redis(config['redis']));var def={'method':_0x6608('0xc'),'json':!![]};function emit(_0x9dca94,_0x1e6cb8,_0x39005b){io['to'](_0x9dca94)[_0x6608('0xd')](_0x1e6cb8,_0x39005b);}function getTicket(_0x2c68dc,_0x28aff2,_0x3d99c8,_0x28d1e7,_0x79961f,_0x2a4899,_0x563aeb,_0x246cf1){logger['info'](_0x6608('0xe'));var _0x413a29=new Date();var _0x5f5ade=[{'name':'name','value':intUtil[_0x6608('0xf')](_0x28d1e7['Subjects'],_0x79961f,'\x20')},{'name':_0x6608('0x10'),'value':_0x28aff2['id']},{'name':_0x6608('0x11'),'value':_0x28aff2['id']},{'name':_0x6608('0x12'),'value':intUtil[_0x6608('0xf')](_0x28d1e7[_0x6608('0x13')],_0x79961f,'\x0a')},{'name':'date_start','value':_0x413a29[_0x6608('0x14')]()[_0x6608('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':_0x6608('0x16'),'value':'0'},{'name':_0x6608('0x17'),'value':'15'},{'name':_0x6608('0x18'),'value':_0x3d99c8['id']},{'name':_0x6608('0x19'),'value':_0x6608('0x1a')},{'name':_0x6608('0x1b'),'value':_0x3d99c8['name']},{'name':_0x6608('0x1c'),'value':_0x246cf1}];if(_0x2a4899[_0x6608('0x1d')]){_[_0x6608('0x1e')](_0x2a4899,function(_0x140c1d){if(_0x79961f[_0x140c1d[_0x6608('0x1f')]]){_0x5f5ade[_0x6608('0x20')]({'name':_0x140c1d[_0x6608('0x21')],'value':_0x79961f[_0x140c1d['variableName']]});}});}return request({'form':{'method':_0x6608('0x22'),'input_type':_0x6608('0x23'),'response_type':_0x6608('0x23'),'rest_data':JSON['stringify']({'session':_0x563aeb['id'],'module_name':'Calls','name_value_list':_0x5f5ade})}});}function getAuth(_0x487064){return util[_0x6608('0x24')](_0x6608('0x25'),new Buffer(_0x487064[_0x6608('0x26')]+':X')[_0x6608('0x27')](_0x6608('0x28')));}function getServerInfo(_0x4f2e3a){return request({'form':{'method':_0x6608('0x29'),'input_type':_0x6608('0x23'),'response_type':'JSON','rest_data':JSON[_0x6608('0x2a')]({'session':_0x4f2e3a['id']})}});}function getUser(_0x30ba0b,_0xfef8db,_0x4480a0){if(!_['isNil'](_0xfef8db)){logger[_0x6608('0x2b')](_0x6608('0x2c'),_0xfef8db);return request({'form':{'method':_0x6608('0x2d'),'input_type':_0x6608('0x23'),'response_type':_0x6608('0x23'),'rest_data':JSON[_0x6608('0x2a')]({'session':_0x4480a0['id'],'module_name':_0x6608('0x2e'),'query':util[_0x6608('0x24')](_0x6608('0x2f'),_0xfef8db),'order_by':'','offset':'0','select_fields':['id',_0x6608('0x30'),_0x6608('0x31')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6608('0x32')](function(_0x2f6982){if(_0x2f6982['entry_list'][_0x6608('0x1d')]){var _0x2409b5=_[_0x6608('0x33')](_0x2f6982['entry_list'],function(_0x184951){return _0x184951['name_value_list'][_0x6608('0x31')]['value']===_0xfef8db;});if(_0x2409b5){logger[_0x6608('0x2b')](_0x6608('0x34'));return BPromise[_0x6608('0x35')]({'id':_0x2409b5['name_value_list']['id']['value'],'name':_0x2409b5[_0x6608('0x36')][_0x6608('0x30')][_0x6608('0x37')]});}}logger[_0x6608('0x2b')](_0x6608('0x38'));return BPromise[_0x6608('0x35')]({'id':_0x4480a0[_0x6608('0x36')]['user_id'][_0x6608('0x37')],'name':_0x4480a0['name_value_list'][_0x6608('0x31')][_0x6608('0x37')]});});}else{logger[_0x6608('0x2b')](_0x6608('0x39'));return BPromise['resolve']({'id':_0x4480a0[_0x6608('0x36')][_0x6608('0x3a')][_0x6608('0x37')],'name':_0x4480a0[_0x6608('0x36')][_0x6608('0x31')][_0x6608('0x37')]});}}function getEndUser(_0x459bcf,_0x482d3a,_0x4e49dd,_0xff46f){logger[_0x6608('0x2b')]('Searching\x20enduser\x20with\x20phone',_0x4e49dd);return request({'form':{'method':_0x6608('0x2d'),'input_type':_0x6608('0x23'),'response_type':_0x6608('0x23'),'rest_data':JSON[_0x6608('0x2a')]({'session':_0xff46f['id'],'module_name':_0x6608('0x1a'),'query':util[_0x6608('0x24')](_0x6608('0x3b'),_0x4e49dd),'order_by':'','offset':'0','select_fields':['id',_0x6608('0x30'),_0x6608('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6608('0x32')](function(_0x2ea884){if(_0x2ea884[_0x6608('0x3d')]['length']){var _0x1d8545=_[_0x6608('0x33')](_0x2ea884['entry_list'],function(_0x4f9b63){return _0x4f9b63[_0x6608('0x36')][_0x6608('0x3c')][_0x6608('0x37')]===_0x4e49dd;});if(_0x1d8545){logger[_0x6608('0x2b')](_0x6608('0x3e'));return BPromise[_0x6608('0x35')]({'id':_0x1d8545[_0x6608('0x36')]['id']['value'],'name':_0x1d8545['name_value_list'][_0x6608('0x30')][_0x6608('0x37')],'phone':_0x1d8545[_0x6608('0x36')][_0x6608('0x3c')][_0x6608('0x37')]});}}else{logger['info'](_0x6608('0x3f'));return request({'form':{'method':_0x6608('0x22'),'input_type':_0x6608('0x23'),'response_type':_0x6608('0x23'),'rest_data':JSON['stringify']({'session':_0xff46f['id'],'module_name':_0x6608('0x1a'),'name_value_list':[{'name':_0x6608('0x40'),'value':_0x482d3a!==_0x6608('0x41')?_0x482d3a:util[_0x6608('0x24')]('Caller\x20-\x20%s',_0x4e49dd)},{'name':'phone_home','value':_0x4e49dd}]})}})[_0x6608('0x32')](function(_0x1ba935){logger[_0x6608('0x2b')](_0x6608('0x42'));return BPromise[_0x6608('0x35')]({'id':_0x1ba935['id'],'name':_0x1ba935[_0x6608('0x3d')][_0x6608('0x40')][_0x6608('0x37')],'phone':_0x1ba935[_0x6608('0x3d')][_0x6608('0x3c')][_0x6608('0x37')]});});}});}function request(_0x2127fa){logger[_0x6608('0x43')](_0x6608('0x44'),JSON[_0x6608('0x2a')](_0x2127fa));return rp(_[_0x6608('0x45')](def,_0x2127fa));}function getTags(_0x5be681,_0x36f7d0){var _0x316f20=[];if(_0x5be681&&_0x5be681[_0x6608('0x1d')]>0x0){_0x316f20=_['map'](_0x5be681,_0x36f7d0);}return _0x316f20;}function getCustomFields(_0x47501f,_0x19d8ac){var _0xc05832=[];var _0x32a958={'custom_fields':[]};if(_0x47501f['length']>0x0){_[_0x6608('0x1e')](_0x47501f,function(_0x133e19){if(_0x133e19['type']===_0x6608('0x46')&&_0x133e19[_0x6608('0x47')]&&!_0x133e19[_0x6608('0x48')]){_0x32a958[_0x133e19[_0x6608('0x47')]['toLowerCase']()]=_0x133e19['content'][_0x6608('0x27')]();}else if(_0x133e19[_0x6608('0x49')]===_0x6608('0x46')&&_0x133e19[_0x6608('0x21')]&&_0x133e19[_0x6608('0x48')]){_0x32a958[_0x6608('0x4a')][_0x6608('0x20')]({'id':_0x133e19[_0x6608('0x21')],'value':_0x133e19[_0x6608('0x4b')]['toString']()});}else if(_0x133e19['type']===_0x6608('0x4c')&&_0x133e19[_0x6608('0x1f')]&&_0x133e19['idField']&&_0x133e19[_0x6608('0x48')]){_0x19d8ac[_0x133e19[_0x6608('0x1f')]]&&_0x32a958['custom_fields'][_0x6608('0x20')]({'id':_0x133e19[_0x6608('0x21')],'value':_0x19d8ac[_0x133e19[_0x6608('0x1f')]][_0x6608('0x27')]()});}else if(_0x133e19[_0x6608('0x49')]==='customVariable'&&_0x133e19['Variable']&&_0x133e19[_0x6608('0x4d')]['name']&&_0x133e19[_0x6608('0x21')]&&_0x133e19[_0x6608('0x48')]){_0x19d8ac[_0x133e19[_0x6608('0x4d')][_0x6608('0x30')][_0x6608('0x4e')]()]&&_0x32a958[_0x6608('0x4a')][_0x6608('0x20')]({'id':_0x133e19[_0x6608('0x21')],'value':_0x19d8ac[_0x133e19[_0x6608('0x4d')][_0x6608('0x30')]['toLowerCase']()][_0x6608('0x27')]()});}});}return _0x32a958;}function getConnection(_0x17cb41){return request({'method':_0x6608('0xc'),'form':{'method':_0x6608('0x4f'),'input_type':'JSON','response_type':_0x6608('0x23'),'rest_data':JSON[_0x6608('0x2a')]({'user_auth':{'user_name':_0x17cb41['username'],'password':_0x17cb41[_0x6608('0x50')],'encryption':_0x6608('0x51')},'application':_0x6608('0x52')})}})[_0x6608('0x32')](function(_0x1b258a){var _0x59ed55=_0x1b258a;if(_0x59ed55['id']){def[_0x6608('0x53')]=_0x59ed55['id'];return BPromise[_0x6608('0x35')](_0x59ed55);}else{throw new Error(util[_0x6608('0x24')](_0x6608('0x54'),_0x17cb41['id']));}});}function setRelationship(_0x7441fd,_0x532324,_0x1f88f2,_0x2025a0){return request({'form':{'method':_0x6608('0x55'),'input_type':_0x6608('0x23'),'response_type':_0x6608('0x23'),'rest_data':JSON[_0x6608('0x2a')]({'session':_0x7441fd['id'],'module_name':_0x6608('0x56'),'module_id':_0x1f88f2['id'],'link_field_name':_0x2025a0,'related_ids':[_0x532324['id']]})}});}exports['queue']=function(_0x2658d8,_0x376c39,_0x278d03,_0x8946ce,_0x3f464c,_0x5ebb23){var _0x25c028,_0x2363e4,_0x3f4c4a,_0x12f5c5;_0x5ebb23[_0x6608('0x57')]=intUtil[_0x6608('0x58')](_0x5ebb23[_0x6608('0x57')]);_0x5ebb23[_0x6608('0x59')]=intUtil[_0x6608('0x58')](_0x5ebb23[_0x6608('0x59')]);def['uri']=util[_0x6608('0x24')](_0x6608('0x5a'),_0x5ebb23[_0x6608('0x57')]);if(_0x3f464c&&_0x3f464c[_0x6608('0x5b')]){logger[_0x6608('0x2b')]('[QUEUE]',_0x6608('0x5c'));_0x376c39[_0x6608('0x5d')]=util[_0x6608('0x24')](_0x6608('0x5e'),_0x5ebb23[_0x6608('0x59')],_0x376c39[_0x6608('0x5f')],md5(_0x376c39[_0x6608('0x5f')]));}else{_0x376c39[_0x6608('0x5d')]='';}return getConnection(_0x5ebb23)[_0x6608('0x32')](function(_0x417ee1){_0x12f5c5=_0x417ee1;return getUser(_0x5ebb23,_0x8946ce[_0x6608('0x30')],_0x12f5c5);})['then'](function(_0x2f1c45){_0x25c028=_0x2f1c45;logger[_0x6608('0x2b')](_0x6608('0x60'),_0x25c028['id']);return getEndUser(_0x5ebb23,_0x376c39[_0x6608('0x61')],_0x376c39['calleridnum'],_0x12f5c5);})['then'](function(_0x47adc8){_0x2363e4=_0x47adc8;logger['info'](_0x6608('0x62'),_0x2363e4['id']);return getTicket(_0x5ebb23,_0x25c028,_0x2363e4,_0x278d03,_0x376c39,_0x278d03[_0x6608('0x63')],_0x12f5c5,_0x6608('0x64'));})[_0x6608('0x32')](function(_0x32bb39){_0x3f4c4a=_0x32bb39;logger['info'](_0x6608('0x65'));logger[_0x6608('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x3f4c4a['id']);return setRelationship(_0x12f5c5,_0x25c028,_0x3f4c4a,'users');})[_0x6608('0x32')](function(){return setRelationship(_0x12f5c5,_0x2363e4,_0x3f4c4a,_0x6608('0x66'));})[_0x6608('0x32')](function(){return getServerInfo(_0x12f5c5);})[_0x6608('0x32')](function(_0x52aec9){var _0x3115b2=parseInt(_0x52aec9['version'][_0x6608('0x67')](0x0));var _0x4e0433=util[_0x6608('0x24')](_0x6608('0x68'),_0x5ebb23[_0x6608('0x57')],_0x3f4c4a['id']);if(_0x3115b2>0x6){_0x4e0433=util[_0x6608('0x24')](_0x6608('0x69'),_0x5ebb23['remoteUri'],_0x3f4c4a['id']);}logger['info']('[QUEUE]',_0x6608('0x6a'));emit(util[_0x6608('0x24')](_0x6608('0x6b'),_0x8946ce[_0x6608('0x30')]),_0x6608('0x6c'),{'uri':_0x4e0433});})[_0x6608('0x6d')](function(_0x24f0b8){logger[_0x6608('0x6e')](_0x6608('0x6f'),JSON[_0x6608('0x2a')](_0x24f0b8));});};exports[_0x6608('0x70')]=function(_0x52d8be,_0x5d3ec4,_0x2667cd,_0x150edf,_0x55f334,_0x2883d3,_0x22fd6f){var _0x38b6e7,_0x5748ec,_0x365df9,_0x347595;_0x2883d3[_0x6608('0x57')]=intUtil['stripTrailingSlash'](_0x2883d3[_0x6608('0x57')]);_0x2883d3[_0x6608('0x59')]=intUtil[_0x6608('0x58')](_0x2883d3[_0x6608('0x59')]);def[_0x6608('0x71')]=util[_0x6608('0x24')]('%s/service/v4_1/rest.php',_0x2883d3[_0x6608('0x57')]);if(_0x22fd6f&&_0x22fd6f['recordingFormat']&&_0x22fd6f[_0x6608('0x72')]!==_0x6608('0x73')){logger[_0x6608('0x2b')](_0x6608('0x74'),_0x6608('0x5c'));_0x5d3ec4[_0x6608('0x5d')]=util[_0x6608('0x24')](_0x6608('0x5e'),_0x2883d3[_0x6608('0x59')],_0x5d3ec4[_0x6608('0x5f')],md5(_0x5d3ec4[_0x6608('0x5f')]));}return getConnection(_0x2883d3)[_0x6608('0x32')](function(_0x502d02){_0x347595=_0x502d02;return getUser(_0x2883d3,_0x150edf[_0x6608('0x30')],_0x347595);})[_0x6608('0x32')](function(_0x4b75fe){_0x38b6e7=_0x4b75fe;logger[_0x6608('0x2b')](_0x6608('0x60'),_0x38b6e7['id']);return getEndUser(_0x2883d3,_0x5d3ec4[_0x6608('0x75')],_0x5d3ec4[_0x6608('0x76')],_0x347595);})[_0x6608('0x32')](function(_0x17d362){_0x5748ec=_0x17d362;logger[_0x6608('0x2b')]('The\x20Enduser\x20ID\x20is:',_0x5748ec['id']);return getTicket(_0x2883d3,_0x38b6e7,_0x5748ec,_0x2667cd,_0x5d3ec4,_0x2667cd[_0x6608('0x63')],_0x347595,_0x6608('0x77'));})[_0x6608('0x32')](function(_0x51172a){_0x365df9=_0x51172a;logger[_0x6608('0x2b')]('Ticket\x20created!');logger[_0x6608('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x365df9['id']);return setRelationship(_0x347595,_0x38b6e7,_0x365df9,'users');})[_0x6608('0x32')](function(){return setRelationship(_0x347595,_0x5748ec,_0x365df9,_0x6608('0x66'));})[_0x6608('0x32')](function(){return getServerInfo(_0x347595);})['then'](function(_0x2f2a2b){var _0x11342a=parseInt(_0x2f2a2b[_0x6608('0x78')]['charAt'](0x0));var _0x411efb=util[_0x6608('0x24')](_0x6608('0x68'),_0x2883d3[_0x6608('0x57')],_0x365df9['id']);if(_0x11342a>0x6){_0x411efb=util[_0x6608('0x24')](_0x6608('0x69'),_0x2883d3[_0x6608('0x57')],_0x365df9['id']);}logger[_0x6608('0x2b')](_0x6608('0x74'),_0x6608('0x6a'));emit(util['format']('user:%s',_0x150edf['name']),'trigger:browser:url',{'uri':_0x411efb});})['catch'](function(_0x125edd){logger['error']('[OUTBOUND]',JSON[_0x6608('0x2a')](_0x125edd));});};exports[_0x6608('0x79')]=function(_0x3eb870,_0x279fca,_0x12de7a,_0x3c9107,_0x318fe6,_0x57872f){var _0x2b624f,_0x5c368b,_0x1d0179,_0x36bfc9;_0x57872f['remoteUri']=intUtil[_0x6608('0x58')](_0x57872f[_0x6608('0x57')]);_0x57872f['serverUrl']=intUtil['stripTrailingSlash'](_0x57872f['serverUrl']);def[_0x6608('0x71')]=util[_0x6608('0x24')](_0x6608('0x5a'),_0x57872f[_0x6608('0x57')]);if(_0x318fe6&&_0x318fe6[_0x6608('0x5b')]){logger[_0x6608('0x2b')](_0x6608('0x7a'),_0x6608('0x5c'));_0x279fca[_0x6608('0x5d')]=util[_0x6608('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x57872f[_0x6608('0x59')],_0x279fca[_0x6608('0x5f')],md5(_0x279fca[_0x6608('0x5f')]));}else{_0x279fca[_0x6608('0x5d')]='';}return getConnection(_0x57872f)[_0x6608('0x32')](function(_0x1e7e4c){_0x36bfc9=_0x1e7e4c;if(!_[_0x6608('0x7b')](_0x3c9107)){return getUser(_0x57872f,_0x3c9107[_0x6608('0x30')],_0x36bfc9);}else{return getUser(_0x57872f,null,_0x36bfc9);}})[_0x6608('0x32')](function(_0x18bc14){_0x2b624f=_0x18bc14;logger[_0x6608('0x2b')](_0x6608('0x60'),_0x2b624f['id']);return getEndUser(_0x57872f,_0x279fca['calleridname'],_0x279fca[_0x6608('0x7c')],_0x36bfc9);})['then'](function(_0x4a96c4){_0x5c368b=_0x4a96c4;logger[_0x6608('0x2b')](_0x6608('0x62'),_0x5c368b['id']);return getTicket(_0x57872f,_0x2b624f,_0x5c368b,_0x12de7a,_0x279fca,_0x12de7a[_0x6608('0x63')],_0x36bfc9,'Inbound');})[_0x6608('0x32')](function(_0x4bc822){_0x1d0179=_0x4bc822;logger[_0x6608('0x2b')](_0x6608('0x65'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1d0179['id']);return setRelationship(_0x36bfc9,_0x2b624f,_0x1d0179,_0x6608('0x7d'));})['then'](function(){return setRelationship(_0x36bfc9,_0x5c368b,_0x1d0179,_0x6608('0x66'));})[_0x6608('0x32')](function(){return getServerInfo(_0x36bfc9);})[_0x6608('0x6d')](function(_0x2c7bc){logger[_0x6608('0x6e')]('[ABANDONED]',JSON[_0x6608('0x2a')](_0x2c7bc));});}; \ 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 1deb39a..a0c80ee 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 _0x3954=['substring','lastIndexOf','validateEmail','test','lodash','util','getString','sortBy','string','push','content','type','variable','variableName','toString','customVariable','name','Variable','toLowerCase','keyType','format','%s:\x20%s','key','keyContent','join','stripTrailingSlash','slice'];(function(_0x4286f4,_0x408670){var _0x425680=function(_0x463c1e){while(--_0x463c1e){_0x4286f4['push'](_0x4286f4['shift']());}};_0x425680(++_0x408670);}(_0x3954,0xa6));var _0x4395=function(_0x90cb12,_0x41f4f1){_0x90cb12=_0x90cb12-0x0;var _0x128301=_0x3954[_0x90cb12];return _0x128301;};'use strict';var _=require(_0x4395('0x0'));var util=require(_0x4395('0x1'));exports[_0x4395('0x2')]=function(_0x72afb7,_0x189600,_0x498b26){var _0x17a35=[];if(_0x72afb7['length']>0x0){var _0x39a7d5=_[_0x4395('0x3')](_0x72afb7,['id']);for(var _0x15a4a4=0x0;_0x15a4a4<_0x39a7d5['length'];_0x15a4a4++){var _0x394906=_0x39a7d5[_0x15a4a4];if(_0x394906['type']===_0x4395('0x4')){_0x17a35[_0x4395('0x5')](_0x394906[_0x4395('0x6')]);}else if(_0x394906[_0x4395('0x7')]===_0x4395('0x8')&&_0x394906[_0x4395('0x9')]){_0x189600[_0x394906[_0x4395('0x9')]]&&_0x17a35[_0x4395('0x5')](_0x189600[_0x394906[_0x4395('0x9')]][_0x4395('0xa')]());}else if(_0x394906[_0x4395('0x7')]===_0x4395('0xb')&&_0x394906['Variable']&&_0x394906['Variable'][_0x4395('0xc')]){_0x189600[_0x394906['Variable'][_0x4395('0xc')]['toLowerCase']()]&&_0x17a35[_0x4395('0x5')](_0x189600[_0x394906[_0x4395('0xd')][_0x4395('0xc')][_0x4395('0xe')]()][_0x4395('0xa')]());}else if(_0x394906[_0x4395('0x7')]==='keyValue'){if(_0x394906[_0x4395('0xf')]===_0x4395('0x4')&&_0x394906['key']){_0x17a35[_0x4395('0x5')](util[_0x4395('0x10')](_0x4395('0x11'),_0x394906[_0x4395('0x12')],_0x394906[_0x4395('0x13')]));}else if(_0x394906[_0x4395('0xf')]===_0x4395('0x8')&&_0x394906[_0x4395('0x9')]&&_0x394906['key']){_0x189600[_0x394906[_0x4395('0x9')]]&&_0x17a35[_0x4395('0x5')](util[_0x4395('0x10')](_0x4395('0x11'),_0x394906[_0x4395('0x12')],_0x189600[_0x394906['variableName']]));}else if(_0x394906[_0x4395('0xf')]==='customVariable'&&_0x394906[_0x4395('0xd')]&&_0x394906[_0x4395('0xd')]['name']&&_0x394906[_0x4395('0x12')]){_0x189600[_0x394906['Variable']['name'][_0x4395('0xe')]()]&&_0x17a35[_0x4395('0x5')](util[_0x4395('0x10')](_0x4395('0x11'),_0x394906[_0x4395('0x12')],_0x189600[_0x394906['Variable'][_0x4395('0xc')][_0x4395('0xe')]()]));}}}}return _0x17a35[_0x4395('0x14')](_0x498b26);};exports[_0x4395('0x15')]=function(_0x430d41){var _0x447f5d=_0x430d41[_0x4395('0x16')](-0x1);if(_0x447f5d==='/'){_0x430d41=_0x430d41[_0x4395('0x17')](0x0,_0x430d41[_0x4395('0x18')](_0x447f5d));}return _0x430d41;};exports[_0x4395('0x19')]=function(_0x2a22de){if(!_['isNil'](_0x2a22de)&&_0x2a22de!==''){var _0x47ba24=/^(([^<>()\[\]\\.,;:\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 _0x47ba24[_0x4395('0x1a')](String(_0x2a22de)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x4c0f=['getString','length','type','string','variableName','Variable','name','toLowerCase','push','keyValue','keyType','key','format','%s:\x20%s','customVariable','stripTrailingSlash','slice','substring','validateEmail','isNil','test','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c0f,0x1e3));var _0xf4c0=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4c0f[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xf4c0('0x0'));exports[_0xf4c0('0x1')]=function(_0x2fb7b9,_0x157b01,_0x2fe6c8){var _0xc65d18=[];if(_0x2fb7b9[_0xf4c0('0x2')]>0x0){var _0x27f899=_['sortBy'](_0x2fb7b9,['id']);for(var _0x1cede5=0x0;_0x1cede5<_0x27f899[_0xf4c0('0x2')];_0x1cede5++){var _0xd77269=_0x27f899[_0x1cede5];if(_0xd77269[_0xf4c0('0x3')]===_0xf4c0('0x4')){_0xc65d18['push'](_0xd77269['content']);}else if(_0xd77269[_0xf4c0('0x3')]==='variable'&&_0xd77269[_0xf4c0('0x5')]){_0x157b01[_0xd77269['variableName']]&&_0xc65d18['push'](_0x157b01[_0xd77269[_0xf4c0('0x5')]]['toString']());}else if(_0xd77269[_0xf4c0('0x3')]==='customVariable'&&_0xd77269[_0xf4c0('0x6')]&&_0xd77269[_0xf4c0('0x6')]['name']){_0x157b01[_0xd77269[_0xf4c0('0x6')][_0xf4c0('0x7')][_0xf4c0('0x8')]()]&&_0xc65d18[_0xf4c0('0x9')](_0x157b01[_0xd77269[_0xf4c0('0x6')][_0xf4c0('0x7')][_0xf4c0('0x8')]()]['toString']());}else if(_0xd77269[_0xf4c0('0x3')]===_0xf4c0('0xa')){if(_0xd77269[_0xf4c0('0xb')]===_0xf4c0('0x4')&&_0xd77269[_0xf4c0('0xc')]){_0xc65d18[_0xf4c0('0x9')](util[_0xf4c0('0xd')](_0xf4c0('0xe'),_0xd77269['key'],_0xd77269['keyContent']));}else if(_0xd77269[_0xf4c0('0xb')]==='variable'&&_0xd77269[_0xf4c0('0x5')]&&_0xd77269[_0xf4c0('0xc')]){_0x157b01[_0xd77269[_0xf4c0('0x5')]]&&_0xc65d18[_0xf4c0('0x9')](util['format'](_0xf4c0('0xe'),_0xd77269[_0xf4c0('0xc')],_0x157b01[_0xd77269[_0xf4c0('0x5')]]));}else if(_0xd77269[_0xf4c0('0xb')]===_0xf4c0('0xf')&&_0xd77269[_0xf4c0('0x6')]&&_0xd77269['Variable'][_0xf4c0('0x7')]&&_0xd77269['key']){_0x157b01[_0xd77269[_0xf4c0('0x6')]['name'][_0xf4c0('0x8')]()]&&_0xc65d18[_0xf4c0('0x9')](util[_0xf4c0('0xd')]('%s:\x20%s',_0xd77269[_0xf4c0('0xc')],_0x157b01[_0xd77269[_0xf4c0('0x6')][_0xf4c0('0x7')][_0xf4c0('0x8')]()]));}}}}return _0xc65d18['join'](_0x2fe6c8);};exports[_0xf4c0('0x10')]=function(_0x5ed7ed){var _0x2b0953=_0x5ed7ed[_0xf4c0('0x11')](-0x1);if(_0x2b0953==='/'){_0x5ed7ed=_0x5ed7ed[_0xf4c0('0x12')](0x0,_0x5ed7ed['lastIndexOf'](_0x2b0953));}return _0x5ed7ed;};exports[_0xf4c0('0x13')]=function(_0x54292f){if(!_[_0xf4c0('0x14')](_0x54292f)&&_0x54292f!==''){var _0x2b55d1=/^(([^<>()\[\]\\.,;:\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 _0x2b55d1[_0xf4c0('0x15')](String(_0x54292f)[_0xf4c0('0x8')]());}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 73ea0e3..b7da29a 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 _0x235a=['lastname','Contacts','phone','getEndUser','getchallenge','login','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','user:%s','Recording\x20is\x20enabled!','recordingURL','[ABANDONED]','lodash','request-promise','bluebird','util','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','length','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','getString','Subjects','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','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','query','Agent\x20found!','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','catch','getUser','Searching\x20end\x20user\x20with\x20phone','GET','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'];(function(_0x317c38,_0x9d154d){var _0x304c05=function(_0x27a100){while(--_0x27a100){_0x317c38['push'](_0x317c38['shift']());}};_0x304c05(++_0x9d154d);}(_0x235a,0x1ef));var _0xa235=function(_0x514705,_0x9abce){_0x514705=_0x514705-0x0;var _0x515369=_0x235a[_0x514705];return _0x515369;};'use strict';var _=require(_0xa235('0x0'));var rp=require(_0xa235('0x1'));var BPromise=require(_0xa235('0x2'));var md5=require('md5');var util=require(_0xa235('0x3'));var Redis=require('ioredis');var intUtil=require(_0xa235('0x4'));var config=require(_0xa235('0x5'));var logger=require(_0xa235('0x6'))(_0xa235('0x7'));config[_0xa235('0x8')]=_[_0xa235('0x9')](config[_0xa235('0x8')],{'host':_0xa235('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa235('0x8')]));function emit(_0x2dc1ba,_0x450e27,_0x2f3403){io['to'](_0x2dc1ba)['emit'](_0x450e27,_0x2f3403);}function getCustomFields(_0x2f73d3,_0x561602){var _0x560eb1={};if(_0x2f73d3[_0xa235('0xb')]>0x0){_['forEach'](_0x2f73d3,function(_0xbde1c7){if(_0xbde1c7['type']==='string'&&_0xbde1c7['idField']){_0x560eb1[_0xbde1c7[_0xa235('0xc')]]=_0xbde1c7[_0xa235('0xd')][_0xa235('0xe')]();}else if(_0xbde1c7[_0xa235('0xf')]==='variable'&&_0xbde1c7['variableName']&&_0xbde1c7['idField']&&_0x561602[_0xbde1c7[_0xa235('0x10')]]){_0x560eb1[_0xbde1c7[_0xa235('0xc')]]=_0x561602[_0xbde1c7[_0xa235('0x10')]][_0xa235('0xe')]();}else if(_0xbde1c7[_0xa235('0xf')]===_0xa235('0x11')&&_0xbde1c7[_0xa235('0x12')]&&_0xbde1c7[_0xa235('0x12')][_0xa235('0x13')]&&_0xbde1c7['idField']&&_0x561602[_0xbde1c7[_0xa235('0x12')][_0xa235('0x13')][_0xa235('0x14')]()]){_0x560eb1[_0xbde1c7[_0xa235('0xc')]]=_0x561602[_0xbde1c7[_0xa235('0x12')][_0xa235('0x13')]['toLowerCase']()]['toString']();}});}return _0x560eb1;}function createTicket(_0x446ea2,_0x24f9e1,_0x2b3769,_0x4af12b,_0x40b4a9,_0x219e41,_0x3ca514){logger[_0xa235('0x15')](_0xa235('0x16'));var _0x465b55=_[_0xa235('0x17')]({'parent_id':'','assigned_user_id':_0x24f9e1['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0xa235('0x18')](_0x4af12b[_0xa235('0x19')],_0x40b4a9,'\x20'),'description':intUtil[_0xa235('0x18')](_0x4af12b[_0xa235('0x1a')],_0x40b4a9,'\x0a'),'contact_id':_0x2b3769['id']},getCustomFields(_0x219e41,_0x40b4a9));var _0x2e38e={'method':_0xa235('0x1b'),'uri':util[_0xa235('0x1c')](_0xa235('0x1d'),_0x446ea2[_0xa235('0x1e')]),'form':{'operation':_0xa235('0x1f'),'username':_0xa235('0x20'),'sessionName':_0x3ca514[_0xa235('0x21')],'elementType':_0xa235('0x22'),'element':JSON[_0xa235('0x23')](_0x465b55)},'json':!![]};return request(_0x2e38e)[_0xa235('0x24')](function(_0x3364ee){if(_0x3364ee[_0xa235('0x25')]){return BPromise[_0xa235('0x26')]({'id':_0x3364ee[_0xa235('0x27')]['id']});}else{throw new Error(util[_0xa235('0x1c')](_0xa235('0x28'),JSON['stringify'](_0x3364ee[_0xa235('0x29')])));}})['catch'](function(_0x19a673){var _0x53ec70=_0x19a673[_0xa235('0x2a')]||0x1f4;logger[_0xa235('0x29')](_0xa235('0x2b'),_0xa235('0x2c'),_0x53ec70,JSON[_0xa235('0x23')](_0x19a673));});}function getUser(_0x5d811a,_0x2585c7,_0x612f2){if(intUtil['validateEmail'](_0x2585c7)){logger['info']('Getting\x20agent\x20with\x20email',_0x2585c7);return request({'method':'GET','uri':util[_0xa235('0x1c')](_0xa235('0x1d'),_0x5d811a[_0xa235('0x1e')]),'qs':{'operation':_0xa235('0x2d'),'username':_0xa235('0x20'),'sessionName':_0x612f2[_0xa235('0x21')],'query':util[_0xa235('0x1c')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x2585c7)},'json':!![]})['then'](function(_0x2832be){if(_0x2832be[_0xa235('0x25')]&&_0x2832be['result'][_0xa235('0xb')]){logger[_0xa235('0x15')](_0xa235('0x2e'));return BPromise[_0xa235('0x26')]({'id':_0x2832be[_0xa235('0x27')][0x0]['id'],'email':_0x2832be[_0xa235('0x27')][0x0][_0xa235('0x2f')],'name':_0x2832be[_0xa235('0x27')][0x0]['first_name']+'\x20'+_0x2832be[_0xa235('0x27')]['last_name']});}else{logger[_0xa235('0x15')](_0xa235('0x30'));return BPromise[_0xa235('0x26')]({'id':_0x612f2[_0xa235('0x31')],'email':_0x5d811a[_0xa235('0x32')],'name':_0xa235('0x20')});}})[_0xa235('0x33')](function(_0x12a564){var _0xa1b9d2=_0x12a564[_0xa235('0x2a')]||0x1f4;logger[_0xa235('0x29')](_0xa235('0x2b'),_0xa235('0x34'),_0xa1b9d2,JSON['stringify'](_0x12a564));});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa235('0x26')]({'id':_0x612f2['userId'],'email':_0x5d811a[_0xa235('0x32')],'name':_0xa235('0x20')})[_0xa235('0x33')](function(_0x21a835){var _0x473af7=_0x21a835[_0xa235('0x2a')]||0x1f4;logger[_0xa235('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa235('0x34'),_0x473af7,JSON[_0xa235('0x23')](_0x21a835));});}}function getEndUser(_0x594511,_0x380665,_0x3fa927,_0x1a2bcb){logger[_0xa235('0x15')](_0xa235('0x35'),_0x3fa927);return request({'method':_0xa235('0x36'),'uri':util[_0xa235('0x1c')](_0xa235('0x1d'),_0x594511[_0xa235('0x1e')]),'qs':{'operation':'query','username':_0xa235('0x20'),'sessionName':_0x1a2bcb[_0xa235('0x21')],'query':util[_0xa235('0x1c')](_0xa235('0x37'),_0x3fa927,_0x3fa927,_0x3fa927,_0x3fa927,_0x3fa927)},'json':!![]})[_0xa235('0x24')](function(_0x542755){if(_0x542755[_0xa235('0x25')]&&_0x542755[_0xa235('0x27')][_0xa235('0xb')]){logger[_0xa235('0x15')]('Enduser\x20found!');return BPromise[_0xa235('0x26')]({'id':_0x542755[_0xa235('0x27')][0x0]['id'],'name':_0x542755[_0xa235('0x27')][0x0][_0xa235('0x38')]+'\x20'+_0x542755[_0xa235('0x27')][0x0][_0xa235('0x39')],'phone':_0x3fa927});}else{logger[_0xa235('0x15')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0xa235('0x1b'),'uri':util[_0xa235('0x1c')](_0xa235('0x1d'),_0x594511[_0xa235('0x1e')]),'form':{'operation':_0xa235('0x1f'),'sessionName':_0x1a2bcb['sessionName'],'elementType':_0xa235('0x3a'),'element':JSON[_0xa235('0x23')]({'lastname':_0x380665,'phone':_0x3fa927,'assigned_user_id':'\x20'})},'json':!![]})[_0xa235('0x24')](function(_0x55619c){logger[_0xa235('0x15')]('Enduser\x20created.');return BPromise[_0xa235('0x26')]({'id':_0x55619c[_0xa235('0x27')]['id'],'name':_0x55619c[_0xa235('0x27')][_0xa235('0x39')],'phone':_0x55619c[_0xa235('0x27')][_0xa235('0x3b')]});})[_0xa235('0x33')](function(_0x34ccfd){var _0x4fd2bf=_0x34ccfd[_0xa235('0x2a')]||0x1f4;logger[_0xa235('0x29')](_0xa235('0x2b'),_0xa235('0x3c'),_0x4fd2bf,JSON[_0xa235('0x23')](_0x34ccfd));});}});}function getConnection(_0x461fa3){var _0x248692=_0x461fa3[_0xa235('0x32')];var _0xec860f=_0x461fa3['accessKey'];return request({'method':_0xa235('0x36'),'uri':util[_0xa235('0x1c')](_0xa235('0x1d'),_0x461fa3[_0xa235('0x1e')]),'qs':{'operation':_0xa235('0x3d'),'username':_0x248692},'json':!![]})['then'](function(_0x22f11c){if(_0x22f11c[_0xa235('0x25')]){return request({'method':'POST','uri':util[_0xa235('0x1c')](_0xa235('0x1d'),_0x461fa3[_0xa235('0x1e')]),'form':{'operation':_0xa235('0x3e'),'username':'admin','accessKey':md5(_0x22f11c[_0xa235('0x27')]['token']+_0xec860f)},'json':!![]});}})[_0xa235('0x24')](function(_0x454948){if(_0x454948['success']){return BPromise[_0xa235('0x26')](_0x454948[_0xa235('0x27')]);}else{throw new Error(util[_0xa235('0x1c')](_0xa235('0x3f'),_0x461fa3['id']));}})[_0xa235('0x33')](function(_0x3a24bf){var _0x16105c=_0x3a24bf[_0xa235('0x2a')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getConnection',_0x16105c,JSON[_0xa235('0x23')](_0x3a24bf));});}function request(_0x1711a8){logger[_0xa235('0x15')](_0xa235('0x40'),JSON['stringify'](_0x1711a8));return rp(_0x1711a8);}exports[_0xa235('0x41')]=function(_0x5e4a80,_0x1d9ce8,_0x419092,_0x4571fb,_0x1c9f2b,_0x54edb0){var _0x5041f5,_0x51144e,_0x3048ec,_0xb4eabc;_0x54edb0['remoteUri']=intUtil[_0xa235('0x42')](_0x54edb0[_0xa235('0x1e')]);if(_0x1c9f2b&&_0x1c9f2b[_0xa235('0x43')]){logger[_0xa235('0x15')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1d9ce8['recordingURL']=util[_0xa235('0x1c')](_0xa235('0x44'),_0x54edb0['serverUrl'],_0x1d9ce8['uniqueid'],md5(_0x1d9ce8[_0xa235('0x45')]));}else{_0x1d9ce8['recordingURL']='';}return getConnection(_0x54edb0)['then'](function(_0x43fe92){_0xb4eabc=_0x43fe92;return getUser(_0x54edb0,_0x4571fb[_0xa235('0x46')],_0xb4eabc);})[_0xa235('0x24')](function(_0x2b7e0e){_0x5041f5=_0x2b7e0e;logger['info'](_0xa235('0x47'),_0x5041f5['id']);return getEndUser(_0x54edb0,_0x1d9ce8[_0xa235('0x48')],_0x1d9ce8[_0xa235('0x49')],_0xb4eabc);})[_0xa235('0x24')](function(_0x411ce6){_0x51144e=_0x411ce6;logger[_0xa235('0x15')](_0xa235('0x4a'),_0x51144e['id']);return createTicket(_0x54edb0,_0x5041f5,_0x51144e,_0x419092,_0x1d9ce8,_0x419092[_0xa235('0x4b')],_0xb4eabc);})[_0xa235('0x24')](function(_0x7917a5){_0x3048ec=_0x7917a5;logger['info'](_0xa235('0x4c'));logger[_0xa235('0x15')](_0xa235('0x4d'),_0x3048ec['id']);var _0x175431=util[_0xa235('0x1c')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x54edb0[_0xa235('0x1e')],_[_0xa235('0x4e')](_0x3048ec['id'],'x')[0x1]);logger['info'](_0xa235('0x4f'),_0xa235('0x50'));emit(util['format']('user:%s',_0x4571fb['name']),_0xa235('0x51'),{'uri':_0x175431});})[_0xa235('0x33')](function(_0x55392a){logger[_0xa235('0x29')]('[QUEUE]',JSON['stringify'](_0x55392a));});};exports[_0xa235('0x52')]=function(_0x557a31,_0x36b410,_0x412b21,_0x40ea0e,_0x234cd9,_0x1e42c5,_0x4453ea){var _0x2fb64c,_0x2eccb4,_0x38fe49,_0xa7749a;_0x1e42c5[_0xa235('0x1e')]=intUtil[_0xa235('0x42')](_0x1e42c5[_0xa235('0x1e')]);_0x1e42c5[_0xa235('0x53')]=intUtil[_0xa235('0x42')](_0x1e42c5[_0xa235('0x53')]);if(_0x4453ea&&_0x4453ea[_0xa235('0x54')]&&_0x4453ea['recordingFormat']!==_0xa235('0x55')){logger[_0xa235('0x15')](_0xa235('0x56'),'Recording\x20is\x20enabled!');_0x36b410['recordingURL']=util[_0xa235('0x1c')](_0xa235('0x44'),_0x1e42c5[_0xa235('0x53')],_0x36b410['uniqueid'],md5(_0x36b410[_0xa235('0x45')]));}return getConnection(_0x1e42c5)['then'](function(_0x3d45ee){_0xa7749a=_0x3d45ee;return getUser(_0x1e42c5,_0x40ea0e['email'],_0xa7749a);})['then'](function(_0x413436){_0x2fb64c=_0x413436;logger['info']('The\x20User\x20ID\x20is:',_0x2fb64c['id']);return getEndUser(_0x1e42c5,_0x36b410['destcalleridname'],_0x36b410['destcalleridnum'],_0xa7749a);})['then'](function(_0x30003c){_0x2eccb4=_0x30003c;logger[_0xa235('0x15')](_0xa235('0x4a'),_0x2eccb4['id']);return createTicket(_0x1e42c5,_0x2fb64c,_0x2eccb4,_0x412b21,_0x36b410,_0x412b21['Fields'],_0xa7749a);})[_0xa235('0x24')](function(_0x2a426b){_0x38fe49=_0x2a426b;logger[_0xa235('0x15')](_0xa235('0x4c'));logger[_0xa235('0x15')]('The\x20Ticket\x20ID\x20is:',_0x38fe49['id']);var _0x287694=util[_0xa235('0x1c')](_0xa235('0x57'),_0x1e42c5[_0xa235('0x1e')],_[_0xa235('0x4e')](_0x38fe49['id'],'x')[0x1]);logger[_0xa235('0x15')](_0xa235('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xa235('0x58'),_0x40ea0e[_0xa235('0x13')]),_0xa235('0x51'),{'uri':_0x287694});})['catch'](function(_0x3af05a){logger['error'](_0xa235('0x56'),JSON[_0xa235('0x23')](_0x3af05a));});};exports['abandoned']=function(_0x21cfac,_0x450ade,_0x411ec0,_0xf57a53,_0x2043ae,_0x3bf214){var _0x4f1576,_0x154f45,_0x35b07b,_0x2f9889;_0x3bf214[_0xa235('0x1e')]=intUtil[_0xa235('0x42')](_0x3bf214['remoteUri']);_0x3bf214[_0xa235('0x53')]=intUtil[_0xa235('0x42')](_0x3bf214[_0xa235('0x53')]);if(_0x2043ae&&_0x2043ae[_0xa235('0x43')]){logger[_0xa235('0x15')]('[ABANDONED]',_0xa235('0x59'));_0x450ade[_0xa235('0x5a')]=util[_0xa235('0x1c')](_0xa235('0x44'),_0x3bf214[_0xa235('0x53')],_0x450ade[_0xa235('0x45')],md5(_0x450ade['uniqueid']));}else{_0x450ade[_0xa235('0x5a')]='';}return getConnection(_0x3bf214)[_0xa235('0x24')](function(_0x4b7b04){_0x2f9889=_0x4b7b04;return getUser(_0x3bf214,'',_0x2f9889);})[_0xa235('0x24')](function(_0x4f3b5b){_0x4f1576=_0x4f3b5b;logger[_0xa235('0x15')](_0xa235('0x47'),_0x4f1576['id']);return getEndUser(_0x3bf214,_0x450ade['calleridname'],_0x450ade[_0xa235('0x49')],_0x2f9889);})['then'](function(_0x4a7248){_0x154f45=_0x4a7248;logger[_0xa235('0x15')](_0xa235('0x4a'),_0x154f45['id']);return createTicket(_0x3bf214,_0x4f1576,_0x154f45,_0x411ec0,_0x450ade,_0x411ec0[_0xa235('0x4b')],_0x2f9889);})[_0xa235('0x24')](function(_0x14046f){_0x35b07b=_0x14046f;logger[_0xa235('0x15')](_0xa235('0x4c'));logger[_0xa235('0x15')](_0xa235('0x4d'),_0x35b07b['id']);})['catch'](function(_0x2845a0){logger['error'](_0xa235('0x5b'),JSON[_0xa235('0x23')](_0x2845a0));});}; \ No newline at end of file +var _0x823c=['[HTTP]','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','stripTrailingSlash','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','[OUTBOUND]','abandoned','[ABANDONED]','The\x20Enduser\x20ID\x20is:','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','vTiger','redis','defaults','localhost','emit','length','type','string','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','merge','Normal','getString','Subjects','Descriptions','POST','%s/webservice.php','admin','sessionName','stringify','then','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','remoteUri','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','catch','statusCode','getUser','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token'];(function(_0x379a34,_0xb654bc){var _0x1b6f11=function(_0x5570a7){while(--_0x5570a7){_0x379a34['push'](_0x379a34['shift']());}};_0x1b6f11(++_0xb654bc);}(_0x823c,0x143));var _0xc823=function(_0x187909,_0x55db17){_0x187909=_0x187909-0x0;var _0x3650ad=_0x823c[_0x187909];return _0x3650ad;};'use strict';var _=require(_0xc823('0x0'));var rp=require('request-promise');var BPromise=require(_0xc823('0x1'));var md5=require(_0xc823('0x2'));var util=require(_0xc823('0x3'));var Redis=require(_0xc823('0x4'));var intUtil=require(_0xc823('0x5'));var config=require(_0xc823('0x6'));var logger=require('../../../../config/logger')(_0xc823('0x7'));config[_0xc823('0x8')]=_[_0xc823('0x9')](config[_0xc823('0x8')],{'host':_0xc823('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc823('0x8')]));function emit(_0x472007,_0x5daab9,_0x52bb76){io['to'](_0x472007)[_0xc823('0xb')](_0x5daab9,_0x52bb76);}function getCustomFields(_0x39cc25,_0x53d48d){var _0x43bbd8={};if(_0x39cc25[_0xc823('0xc')]>0x0){_['forEach'](_0x39cc25,function(_0x4dbd5b){if(_0x4dbd5b[_0xc823('0xd')]===_0xc823('0xe')&&_0x4dbd5b[_0xc823('0xf')]){_0x43bbd8[_0x4dbd5b[_0xc823('0xf')]]=_0x4dbd5b[_0xc823('0x10')]['toString']();}else if(_0x4dbd5b[_0xc823('0xd')]===_0xc823('0x11')&&_0x4dbd5b[_0xc823('0x12')]&&_0x4dbd5b[_0xc823('0xf')]&&_0x53d48d[_0x4dbd5b[_0xc823('0x12')]]){_0x43bbd8[_0x4dbd5b[_0xc823('0xf')]]=_0x53d48d[_0x4dbd5b['variableName']][_0xc823('0x13')]();}else if(_0x4dbd5b[_0xc823('0xd')]===_0xc823('0x14')&&_0x4dbd5b[_0xc823('0x15')]&&_0x4dbd5b['Variable']['name']&&_0x4dbd5b['idField']&&_0x53d48d[_0x4dbd5b['Variable'][_0xc823('0x16')]['toLowerCase']()]){_0x43bbd8[_0x4dbd5b[_0xc823('0xf')]]=_0x53d48d[_0x4dbd5b[_0xc823('0x15')][_0xc823('0x16')][_0xc823('0x17')]()][_0xc823('0x13')]();}});}return _0x43bbd8;}function createTicket(_0x1aca6d,_0xfedc1d,_0x58b7c7,_0x42843e,_0x4a713a,_0xf52707,_0x3aa68f){logger[_0xc823('0x18')]('Creating\x20new\x20ticket...');var _0xf2fc30=_[_0xc823('0x19')]({'parent_id':'','assigned_user_id':_0xfedc1d['id'],'ticketpriorities':_0xc823('0x1a'),'ticketstatus':'Open','ticket_title':intUtil[_0xc823('0x1b')](_0x42843e[_0xc823('0x1c')],_0x4a713a,'\x20'),'description':intUtil[_0xc823('0x1b')](_0x42843e[_0xc823('0x1d')],_0x4a713a,'\x0a'),'contact_id':_0x58b7c7['id']},getCustomFields(_0xf52707,_0x4a713a));var _0x574c76={'method':_0xc823('0x1e'),'uri':util['format'](_0xc823('0x1f'),_0x1aca6d['remoteUri']),'form':{'operation':'create','username':_0xc823('0x20'),'sessionName':_0x3aa68f[_0xc823('0x21')],'elementType':'HelpDesk','element':JSON[_0xc823('0x22')](_0xf2fc30)},'json':!![]};return request(_0x574c76)[_0xc823('0x23')](function(_0x451f7a){if(_0x451f7a[_0xc823('0x24')]){return BPromise[_0xc823('0x25')]({'id':_0x451f7a[_0xc823('0x26')]['id']});}else{throw new Error(util[_0xc823('0x27')](_0xc823('0x28'),JSON[_0xc823('0x22')](_0x451f7a[_0xc823('0x29')])));}})['catch'](function(_0x3f175d){var _0x533560=_0x3f175d['statusCode']||0x1f4;logger[_0xc823('0x29')](_0xc823('0x2a'),_0xc823('0x2b'),_0x533560,JSON[_0xc823('0x22')](_0x3f175d));});}function getUser(_0x20d2b1,_0x182fcf,_0x1d20c6){if(intUtil[_0xc823('0x2c')](_0x182fcf)){logger[_0xc823('0x18')](_0xc823('0x2d'),_0x182fcf);return request({'method':_0xc823('0x2e'),'uri':util[_0xc823('0x27')](_0xc823('0x1f'),_0x20d2b1[_0xc823('0x2f')]),'qs':{'operation':_0xc823('0x30'),'username':'admin','sessionName':_0x1d20c6[_0xc823('0x21')],'query':util[_0xc823('0x27')](_0xc823('0x31'),_0x182fcf)},'json':!![]})[_0xc823('0x23')](function(_0x14db83){if(_0x14db83['success']&&_0x14db83['result']['length']){logger[_0xc823('0x18')](_0xc823('0x32'));return BPromise[_0xc823('0x25')]({'id':_0x14db83[_0xc823('0x26')][0x0]['id'],'email':_0x14db83['result'][0x0][_0xc823('0x33')],'name':_0x14db83[_0xc823('0x26')][0x0][_0xc823('0x34')]+'\x20'+_0x14db83[_0xc823('0x26')][_0xc823('0x35')]});}else{logger[_0xc823('0x18')](_0xc823('0x36'));return BPromise[_0xc823('0x25')]({'id':_0x1d20c6[_0xc823('0x37')],'email':_0x20d2b1[_0xc823('0x38')],'name':_0xc823('0x20')});}})[_0xc823('0x39')](function(_0x130869){var _0x51f745=_0x130869[_0xc823('0x3a')]||0x1f4;logger[_0xc823('0x29')](_0xc823('0x2a'),_0xc823('0x3b'),_0x51f745,JSON[_0xc823('0x22')](_0x130869));});}else{logger[_0xc823('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc823('0x25')]({'id':_0x1d20c6[_0xc823('0x37')],'email':_0x20d2b1['username'],'name':_0xc823('0x20')})['catch'](function(_0x114045){var _0x970ceb=_0x114045['statusCode']||0x1f4;logger[_0xc823('0x29')](_0xc823('0x2a'),_0xc823('0x3b'),_0x970ceb,JSON[_0xc823('0x22')](_0x114045));});}}function getEndUser(_0x3a2977,_0x2c68fb,_0x1fb5a4,_0x51b2b3){logger['info']('Searching\x20end\x20user\x20with\x20phone',_0x1fb5a4);return request({'method':_0xc823('0x2e'),'uri':util[_0xc823('0x27')](_0xc823('0x1f'),_0x3a2977[_0xc823('0x2f')]),'qs':{'operation':_0xc823('0x30'),'username':'admin','sessionName':_0x51b2b3[_0xc823('0x21')],'query':util[_0xc823('0x27')](_0xc823('0x3c'),_0x1fb5a4,_0x1fb5a4,_0x1fb5a4,_0x1fb5a4,_0x1fb5a4)},'json':!![]})[_0xc823('0x23')](function(_0x5d6e9b){if(_0x5d6e9b['success']&&_0x5d6e9b['result'][_0xc823('0xc')]){logger[_0xc823('0x18')](_0xc823('0x3d'));return BPromise['resolve']({'id':_0x5d6e9b[_0xc823('0x26')][0x0]['id'],'name':_0x5d6e9b['result'][0x0][_0xc823('0x3e')]+'\x20'+_0x5d6e9b[_0xc823('0x26')][0x0][_0xc823('0x3f')],'phone':_0x1fb5a4});}else{logger[_0xc823('0x18')](_0xc823('0x40'));return request({'method':_0xc823('0x1e'),'uri':util[_0xc823('0x27')]('%s/webservice.php',_0x3a2977[_0xc823('0x2f')]),'form':{'operation':'create','sessionName':_0x51b2b3[_0xc823('0x21')],'elementType':_0xc823('0x41'),'element':JSON[_0xc823('0x22')]({'lastname':_0x2c68fb,'phone':_0x1fb5a4,'assigned_user_id':'\x20'})},'json':!![]})[_0xc823('0x23')](function(_0xa54cc1){logger[_0xc823('0x18')](_0xc823('0x42'));return BPromise[_0xc823('0x25')]({'id':_0xa54cc1['result']['id'],'name':_0xa54cc1[_0xc823('0x26')][_0xc823('0x3f')],'phone':_0xa54cc1['result'][_0xc823('0x43')]});})[_0xc823('0x39')](function(_0x2747c3){var _0x455cd0=_0x2747c3[_0xc823('0x3a')]||0x1f4;logger[_0xc823('0x29')](_0xc823('0x2a'),_0xc823('0x44'),_0x455cd0,JSON[_0xc823('0x22')](_0x2747c3));});}});}function getConnection(_0x51a0d3){var _0x153ca1=_0x51a0d3[_0xc823('0x38')];var _0x50515d=_0x51a0d3[_0xc823('0x45')];return request({'method':_0xc823('0x2e'),'uri':util['format'](_0xc823('0x1f'),_0x51a0d3['remoteUri']),'qs':{'operation':_0xc823('0x46'),'username':_0x153ca1},'json':!![]})[_0xc823('0x23')](function(_0x57f4c0){if(_0x57f4c0['success']){return request({'method':_0xc823('0x1e'),'uri':util[_0xc823('0x27')](_0xc823('0x1f'),_0x51a0d3[_0xc823('0x2f')]),'form':{'operation':_0xc823('0x47'),'username':_0xc823('0x20'),'accessKey':md5(_0x57f4c0[_0xc823('0x26')][_0xc823('0x48')]+_0x50515d)},'json':!![]});}})['then'](function(_0x2051e7){if(_0x2051e7[_0xc823('0x24')]){return BPromise['resolve'](_0x2051e7['result']);}else{throw new Error(util[_0xc823('0x27')]('Account\x20%d\x20is\x20not\x20valid',_0x51a0d3['id']));}})['catch'](function(_0x5c3217){var _0x4e1046=_0x5c3217['statusCode']||0x1f4;logger['error'](_0xc823('0x2a'),'getConnection',_0x4e1046,JSON['stringify'](_0x5c3217));});}function request(_0x3683bd){logger['info'](_0xc823('0x49'),JSON[_0xc823('0x22')](_0x3683bd));return rp(_0x3683bd);}exports['queue']=function(_0x43ae9f,_0x1d960c,_0xb29171,_0x5d8b9e,_0x564ef5,_0x304e71){var _0x11dfe8,_0x5bbf90,_0x23a1aa,_0x2c9a53;_0x304e71[_0xc823('0x2f')]=intUtil['stripTrailingSlash'](_0x304e71[_0xc823('0x2f')]);if(_0x564ef5&&_0x564ef5[_0xc823('0x4a')]){logger[_0xc823('0x18')](_0xc823('0x4b'),_0xc823('0x4c'));_0x1d960c[_0xc823('0x4d')]=util[_0xc823('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x304e71[_0xc823('0x4e')],_0x1d960c[_0xc823('0x4f')],md5(_0x1d960c[_0xc823('0x4f')]));}else{_0x1d960c[_0xc823('0x4d')]='';}return getConnection(_0x304e71)[_0xc823('0x23')](function(_0x31ba31){_0x2c9a53=_0x31ba31;return getUser(_0x304e71,_0x5d8b9e[_0xc823('0x50')],_0x2c9a53);})['then'](function(_0x219c6d){_0x11dfe8=_0x219c6d;logger[_0xc823('0x18')](_0xc823('0x51'),_0x11dfe8['id']);return getEndUser(_0x304e71,_0x1d960c[_0xc823('0x52')],_0x1d960c[_0xc823('0x53')],_0x2c9a53);})[_0xc823('0x23')](function(_0x52adbb){_0x5bbf90=_0x52adbb;logger[_0xc823('0x18')]('The\x20Enduser\x20ID\x20is:',_0x5bbf90['id']);return createTicket(_0x304e71,_0x11dfe8,_0x5bbf90,_0xb29171,_0x1d960c,_0xb29171['Fields'],_0x2c9a53);})['then'](function(_0x421c36){_0x23a1aa=_0x421c36;logger['info'](_0xc823('0x54'));logger['info'](_0xc823('0x55'),_0x23a1aa['id']);var _0x100447=util['format'](_0xc823('0x56'),_0x304e71['remoteUri'],_['split'](_0x23a1aa['id'],'x')[0x1]);logger[_0xc823('0x18')]('[QUEUE]',_0xc823('0x57'));emit(util['format'](_0xc823('0x58'),_0x5d8b9e[_0xc823('0x16')]),'trigger:browser:url',{'uri':_0x100447});})[_0xc823('0x39')](function(_0x1d9689){logger[_0xc823('0x29')](_0xc823('0x4b'),JSON['stringify'](_0x1d9689));});};exports['outbound']=function(_0x54d0b5,_0x4cb43e,_0x2240de,_0x2befd0,_0x1823f2,_0x204c69,_0xbcdd30){var _0x5cf8c7,_0x38ea06,_0x4e4191,_0x164e2a;_0x204c69[_0xc823('0x2f')]=intUtil['stripTrailingSlash'](_0x204c69[_0xc823('0x2f')]);_0x204c69['serverUrl']=intUtil[_0xc823('0x59')](_0x204c69[_0xc823('0x4e')]);if(_0xbcdd30&&_0xbcdd30[_0xc823('0x5a')]&&_0xbcdd30[_0xc823('0x5a')]!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4cb43e['recordingURL']=util[_0xc823('0x27')](_0xc823('0x5b'),_0x204c69['serverUrl'],_0x4cb43e['uniqueid'],md5(_0x4cb43e[_0xc823('0x4f')]));}return getConnection(_0x204c69)[_0xc823('0x23')](function(_0x4333fa){_0x164e2a=_0x4333fa;return getUser(_0x204c69,_0x2befd0[_0xc823('0x50')],_0x164e2a);})[_0xc823('0x23')](function(_0x3f0385){_0x5cf8c7=_0x3f0385;logger[_0xc823('0x18')]('The\x20User\x20ID\x20is:',_0x5cf8c7['id']);return getEndUser(_0x204c69,_0x4cb43e[_0xc823('0x5c')],_0x4cb43e[_0xc823('0x5d')],_0x164e2a);})[_0xc823('0x23')](function(_0x4ac00f){_0x38ea06=_0x4ac00f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x38ea06['id']);return createTicket(_0x204c69,_0x5cf8c7,_0x38ea06,_0x2240de,_0x4cb43e,_0x2240de[_0xc823('0x5e')],_0x164e2a);})[_0xc823('0x23')](function(_0x47ad0c){_0x4e4191=_0x47ad0c;logger[_0xc823('0x18')](_0xc823('0x54'));logger[_0xc823('0x18')](_0xc823('0x55'),_0x4e4191['id']);var _0x478cd1=util[_0xc823('0x27')](_0xc823('0x56'),_0x204c69[_0xc823('0x2f')],_['split'](_0x4e4191['id'],'x')[0x1]);logger[_0xc823('0x18')](_0xc823('0x5f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc823('0x27')](_0xc823('0x58'),_0x2befd0['name']),'trigger:browser:url',{'uri':_0x478cd1});})['catch'](function(_0x415f10){logger[_0xc823('0x29')]('[OUTBOUND]',JSON[_0xc823('0x22')](_0x415f10));});};exports[_0xc823('0x60')]=function(_0x318f96,_0x3b9346,_0x140834,_0x29e02d,_0x5e1e27,_0xe838f0){var _0x483908,_0x53bf28,_0x2d9efb,_0x48c43f;_0xe838f0[_0xc823('0x2f')]=intUtil[_0xc823('0x59')](_0xe838f0[_0xc823('0x2f')]);_0xe838f0[_0xc823('0x4e')]=intUtil[_0xc823('0x59')](_0xe838f0[_0xc823('0x4e')]);if(_0x5e1e27&&_0x5e1e27[_0xc823('0x4a')]){logger['info'](_0xc823('0x61'),_0xc823('0x4c'));_0x3b9346[_0xc823('0x4d')]=util[_0xc823('0x27')](_0xc823('0x5b'),_0xe838f0['serverUrl'],_0x3b9346[_0xc823('0x4f')],md5(_0x3b9346[_0xc823('0x4f')]));}else{_0x3b9346[_0xc823('0x4d')]='';}return getConnection(_0xe838f0)[_0xc823('0x23')](function(_0x42406b){_0x48c43f=_0x42406b;return getUser(_0xe838f0,'',_0x48c43f);})['then'](function(_0x310f3e){_0x483908=_0x310f3e;logger[_0xc823('0x18')](_0xc823('0x51'),_0x483908['id']);return getEndUser(_0xe838f0,_0x3b9346[_0xc823('0x52')],_0x3b9346['calleridnum'],_0x48c43f);})[_0xc823('0x23')](function(_0x3f534f){_0x53bf28=_0x3f534f;logger[_0xc823('0x18')](_0xc823('0x62'),_0x53bf28['id']);return createTicket(_0xe838f0,_0x483908,_0x53bf28,_0x140834,_0x3b9346,_0x140834[_0xc823('0x5e')],_0x48c43f);})[_0xc823('0x23')](function(_0x58f745){_0x2d9efb=_0x58f745;logger[_0xc823('0x18')]('Ticket\x20created!');logger[_0xc823('0x18')](_0xc823('0x55'),_0x2d9efb['id']);})[_0xc823('0x39')](function(_0x4a227b){logger[_0xc823('0x29')](_0xc823('0x61'),JSON[_0xc823('0x22')](_0x4a227b));});}; \ 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 0b2cc88..1ff5ee2 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 _0xaf7a=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','user:%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','name','Subjects','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','variableName','customVariable','Variable','push'];(function(_0x2747b2,_0x10dce8){var _0x540db0=function(_0xc33bcd){while(--_0xc33bcd){_0x2747b2['push'](_0x2747b2['shift']());}};_0x540db0(++_0x10dce8);}(_0xaf7a,0x8e));var _0xaaf7=function(_0x5ab468,_0x23f21e){_0x5ab468=_0x5ab468-0x0;var _0x2e98f5=_0xaf7a[_0x5ab468];return _0x2e98f5;};'use strict';var _=require(_0xaaf7('0x0'));var rp=require(_0xaaf7('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xaaf7('0x2'));var intUtil=require(_0xaaf7('0x3'));var config=require(_0xaaf7('0x4'));var logger=require(_0xaaf7('0x5'))(_0xaaf7('0x6'));config[_0xaaf7('0x7')]=_[_0xaaf7('0x8')](config[_0xaaf7('0x7')],{'host':_0xaaf7('0x9'),'port':0x18eb});var io=require(_0xaaf7('0xa'))(new Redis(config[_0xaaf7('0x7')]));function emit(_0x5ca350,_0x45e07c,_0x3154df){io['to'](_0x5ca350)[_0xaaf7('0xb')](_0x45e07c,_0x3154df);}var headers={'Content-Type':'application/json','Accept':_0xaaf7('0xc')};function getTicket(_0x4ba802,_0x10d155,_0x5a7c1c,_0x3590c9,_0x126023){logger[_0xaaf7('0xd')](_0xaaf7('0xe'));return request({'uri':util[_0xaaf7('0xf')](_0xaaf7('0x10'),_0x4ba802[_0xaaf7('0x11')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x5a7c1c['id'],'submitter_id':_0x10d155?_0x10d155['id']:undefined,'assignee_id':_0x10d155?_0x10d155['id']:undefined,'tags':getTags(_0x3590c9[_0xaaf7('0x12')],_0xaaf7('0x13')),'subject':intUtil['getString'](_0x3590c9[_0xaaf7('0x14')],_0x126023,'\x20'),'description':intUtil[_0xaaf7('0x15')](_0x3590c9[_0xaaf7('0x16')],_0x126023,'\x0a'),'comment':{'public':![],'body':intUtil[_0xaaf7('0x15')](_0x3590c9['Descriptions'],_0x126023,'\x0a')}},getCustomFields(_0x3590c9['Fields'],_0x126023))}})[_0xaaf7('0x17')](function(_0x3e9898){logger[_0xaaf7('0xd')](_0xaaf7('0x18'));return _0x3e9898[_0xaaf7('0x19')];});}function getUser(_0x100b1a,_0x4886b8){if(intUtil[_0xaaf7('0x1a')](_0x4886b8)){logger[_0xaaf7('0xd')]('Getting\x20agent\x20with\x20email',_0x4886b8);return request({'uri':util[_0xaaf7('0xf')](_0xaaf7('0x1b'),_0x100b1a['remoteUri']),'qs':{'query':util[_0xaaf7('0xf')](_0xaaf7('0x1c'),_0x4886b8)}})[_0xaaf7('0x17')](function(_0x332f4c){if(_0x332f4c['count']){logger[_0xaaf7('0xd')]('Agent\x20found!');return _[_0xaaf7('0x1d')](_0x332f4c[_0xaaf7('0x1e')],{'email':_0x4886b8,'role':_0xaaf7('0x1f')});}else{logger['info'](_0xaaf7('0x20'));return request({'uri':util[_0xaaf7('0xf')](_0xaaf7('0x21'),_0x100b1a[_0xaaf7('0x11')])})['then'](function(_0x199b41){logger[_0xaaf7('0xd')](_0xaaf7('0x22'));return _0x199b41[_0xaaf7('0x23')];});}});}else{logger[_0xaaf7('0xd')](_0xaaf7('0x20'));return request({'uri':util[_0xaaf7('0xf')](_0xaaf7('0x21'),_0x100b1a[_0xaaf7('0x11')])})['then'](function(_0x11526f){logger[_0xaaf7('0xd')](_0xaaf7('0x22'));return _0x11526f['user'];});}}function getEndUser(_0x53d04d,_0x2f9fb2,_0x56835b){logger[_0xaaf7('0xd')](_0xaaf7('0x24'),_0x56835b);return request({'uri':util[_0xaaf7('0xf')](_0xaaf7('0x1b'),_0x53d04d['remoteUri']),'qs':{'query':util[_0xaaf7('0xf')]('type:user\x20role:end-user\x20phone:%s',_0x56835b)}})[_0xaaf7('0x17')](function(_0x57b45e){var _0x20cae2;if(_0x57b45e[_0xaaf7('0x1e')][_0xaaf7('0x25')]){_0x57b45e[_0xaaf7('0x1e')]=_[_0xaaf7('0x26')](_0x57b45e['results'],{'suspended':![],'role':_0xaaf7('0x27')});if(_0x57b45e[_0xaaf7('0x1e')][_0xaaf7('0x25')]){_0x20cae2=_[_0xaaf7('0x28')](_0x57b45e['results']);}}if(_0x20cae2){logger['info'](_0xaaf7('0x29'));return _0x20cae2;}else{logger[_0xaaf7('0xd')](_0xaaf7('0x2a'));return request({'uri':util['format'](_0xaaf7('0x2b'),_0x53d04d[_0xaaf7('0x11')]),'method':_0xaaf7('0x2c'),'body':{'user':{'role':_0xaaf7('0x27'),'name':util['format'](_0xaaf7('0x2d'),_0x2f9fb2||_0x56835b),'phone':_0x56835b}}})[_0xaaf7('0x17')](function(_0x27b3e1){logger['info'](_0xaaf7('0x2e'));return _0x27b3e1[_0xaaf7('0x23')];});}});}function getAuth(_0x505664){var _0x18dfc1;if(_0x505664['authType']===_0xaaf7('0x2f')){_0x18dfc1=util[_0xaaf7('0xf')](_0xaaf7('0x30'),_0x505664[_0xaaf7('0x31')],_0x505664[_0xaaf7('0x2f')]);}else if(_0x505664[_0xaaf7('0x32')]===_0xaaf7('0x33')){_0x18dfc1=util['format'](_0xaaf7('0x34'),_0x505664['username'],_0x505664[_0xaaf7('0x33')]);}return util[_0xaaf7('0xf')](_0xaaf7('0x35'),new Buffer(_0x18dfc1)[_0xaaf7('0x36')](_0xaaf7('0x37')));}function request(_0x4a25f1){logger[_0xaaf7('0x38')](_0xaaf7('0x39'),JSON[_0xaaf7('0x3a')](_0x4a25f1));return rp(_[_0xaaf7('0x8')](_0x4a25f1,{'method':_0xaaf7('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x44e98c,_0x16983b){var _0x14756d=[];if(_0x44e98c&&_0x44e98c[_0xaaf7('0x25')]>0x0){_0x14756d=_[_0xaaf7('0x3c')](_0x44e98c,_0x16983b);}return _0x14756d;}function getCustomFields(_0x458b4a,_0x424efd){var _0x378ba3=[];var _0x3a84fb={'custom_fields':[]};if(_0x458b4a[_0xaaf7('0x25')]>0x0){_[_0xaaf7('0x3d')](_0x458b4a,function(_0x38c56f){if(_0x38c56f[_0xaaf7('0x3e')]===_0xaaf7('0x3f')&&_0x38c56f[_0xaaf7('0x40')]&&!_0x38c56f[_0xaaf7('0x41')]){_0x3a84fb[_0x38c56f[_0xaaf7('0x40')][_0xaaf7('0x42')]()]=_0x38c56f[_0xaaf7('0x43')][_0xaaf7('0x36')]();}else if(_0x38c56f[_0xaaf7('0x3e')]===_0xaaf7('0x3f')&&_0x38c56f[_0xaaf7('0x44')]&&_0x38c56f[_0xaaf7('0x41')]){_0x3a84fb[_0xaaf7('0x45')]['push']({'id':_0x38c56f['idField'],'value':_0x38c56f[_0xaaf7('0x43')][_0xaaf7('0x36')]()});}else if(_0x38c56f[_0xaaf7('0x3e')]==='variable'&&_0x38c56f[_0xaaf7('0x46')]&&_0x38c56f[_0xaaf7('0x44')]&&_0x38c56f[_0xaaf7('0x41')]){_0x424efd[_0x38c56f['variableName']]&&_0x3a84fb[_0xaaf7('0x45')]['push']({'id':_0x38c56f[_0xaaf7('0x44')],'value':_0x424efd[_0x38c56f[_0xaaf7('0x46')]][_0xaaf7('0x36')]()});}else if(_0x38c56f[_0xaaf7('0x3e')]===_0xaaf7('0x47')&&_0x38c56f[_0xaaf7('0x48')]&&_0x38c56f['Variable'][_0xaaf7('0x13')]&&_0x38c56f['idField']&&_0x38c56f[_0xaaf7('0x41')]){_0x424efd[_0x38c56f[_0xaaf7('0x48')][_0xaaf7('0x13')][_0xaaf7('0x42')]()]&&_0x3a84fb[_0xaaf7('0x45')][_0xaaf7('0x49')]({'id':_0x38c56f[_0xaaf7('0x44')],'value':_0x424efd[_0x38c56f['Variable'][_0xaaf7('0x13')][_0xaaf7('0x42')]()][_0xaaf7('0x36')]()});}});}return _0x3a84fb;}exports['queue']=function(_0x7c33ad,_0xff4815,_0x3806ea,_0x2a7f88,_0x101af7,_0x5e2836){var _0x116c74,_0x39eb70;_0x5e2836[_0xaaf7('0x11')]=intUtil[_0xaaf7('0x4a')](_0x5e2836['remoteUri']);_0x5e2836[_0xaaf7('0x4b')]=intUtil[_0xaaf7('0x4a')](_0x5e2836[_0xaaf7('0x4b')]);if(_0x101af7&&_0x101af7[_0xaaf7('0x4c')]){logger[_0xaaf7('0xd')](_0xaaf7('0x4d'),_0xaaf7('0x4e'));_0xff4815[_0xaaf7('0x4f')]=util[_0xaaf7('0xf')](_0xaaf7('0x50'),_0x5e2836[_0xaaf7('0x4b')],_0xff4815[_0xaaf7('0x51')],md5(_0xff4815[_0xaaf7('0x51')]));}else{_0xff4815[_0xaaf7('0x4f')]='';}headers[_0xaaf7('0x52')]=getAuth(_0x5e2836);return getUser(_0x5e2836,_0x2a7f88['email'])[_0xaaf7('0x17')](function(_0x379a48){_0x116c74=_0x379a48;logger['info'](_0xaaf7('0x53'),_0x116c74['id']);return getEndUser(_0x5e2836,_0xff4815[_0xaaf7('0x54')],_0xff4815[_0xaaf7('0x55')]);})[_0xaaf7('0x17')](function(_0x7d4b6d){_0x39eb70=_0x7d4b6d;logger[_0xaaf7('0xd')](_0xaaf7('0x56'),_0x39eb70['id']);return getTicket(_0x5e2836,_0x116c74,_0x39eb70,_0x3806ea,_0xff4815);})[_0xaaf7('0x17')](function(_0x501941){if(_0x501941){logger[_0xaaf7('0xd')](_0xaaf7('0x57'),_0x501941['id']);switch(_0x5e2836[_0xaaf7('0x3e')]){case _0xaaf7('0x58'):logger['info'](_0xaaf7('0x4d'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xaaf7('0x59'),_0x5e2836[_0xaaf7('0x11')],_0x116c74['id'],_0x501941['id']),'method':_0xaaf7('0x2c')});case _0xaaf7('0x5a'):logger['info'](_0xaaf7('0x4d'),_0xaaf7('0x5b'));emit(util[_0xaaf7('0xf')]('user:%s',_0x2a7f88[_0xaaf7('0x13')]),_0xaaf7('0x5c'),{'uri':util[_0xaaf7('0xf')](_0xaaf7('0x5d'),_0x5e2836[_0xaaf7('0x11')],_0x501941['id'])});break;default:logger['error'](_0xaaf7('0x4d'),_0xaaf7('0x5e'));}}})['catch'](function(_0x21a97c){logger[_0xaaf7('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xaaf7('0x60')](_0x21a97c,{'showHidden':!![],'depth':null}));});};exports[_0xaaf7('0x61')]=function(_0x549801,_0x3d491e,_0x23cf19,_0x2de6f6,_0xb3789d,_0x1f5c5b,_0xd30790){var _0x48a1f9,_0x1af4c3;_0x1f5c5b[_0xaaf7('0x11')]=intUtil[_0xaaf7('0x4a')](_0x1f5c5b[_0xaaf7('0x11')]);_0x1f5c5b['serverUrl']=intUtil[_0xaaf7('0x4a')](_0x1f5c5b[_0xaaf7('0x4b')]);if(_0xd30790&&_0xd30790[_0xaaf7('0x62')]&&_0xd30790[_0xaaf7('0x62')]!==_0xaaf7('0x63')){logger[_0xaaf7('0xd')](_0xaaf7('0x64'),_0xaaf7('0x4e'));_0x3d491e[_0xaaf7('0x4f')]=util[_0xaaf7('0xf')](_0xaaf7('0x50'),_0x1f5c5b[_0xaaf7('0x4b')],_0x3d491e['uniqueid'],md5(_0x3d491e[_0xaaf7('0x51')]));}headers[_0xaaf7('0x52')]=getAuth(_0x1f5c5b);return getUser(_0x1f5c5b,_0x2de6f6[_0xaaf7('0x65')])[_0xaaf7('0x17')](function(_0x3b73f3){_0x48a1f9=_0x3b73f3;logger[_0xaaf7('0xd')]('The\x20User\x20ID\x20is:',_0x48a1f9['id']);return getEndUser(_0x1f5c5b,_0x3d491e[_0xaaf7('0x66')],_0x3d491e['destcalleridnum']);})[_0xaaf7('0x17')](function(_0x50865b){_0x1af4c3=_0x50865b;logger[_0xaaf7('0xd')](_0xaaf7('0x56'),_0x1af4c3['id']);return getTicket(_0x1f5c5b,_0x48a1f9,_0x1af4c3,_0x23cf19,_0x3d491e);})[_0xaaf7('0x17')](function(_0x1cb47b){if(_0x1cb47b){logger[_0xaaf7('0xd')](_0xaaf7('0x57'),_0x1cb47b['id']);switch(_0x1f5c5b['type']){case'integrationTab':logger[_0xaaf7('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xaaf7('0xf')](_0xaaf7('0x59'),_0x1f5c5b[_0xaaf7('0x11')],_0x48a1f9['id'],_0x1cb47b['id']),'method':_0xaaf7('0x2c')});case _0xaaf7('0x5a'):logger['info'](_0xaaf7('0x64'),_0xaaf7('0x5b'));emit(util['format'](_0xaaf7('0x67'),_0x2de6f6['name']),'trigger:browser:url',{'uri':util[_0xaaf7('0xf')](_0xaaf7('0x5d'),_0x1f5c5b[_0xaaf7('0x11')],_0x1cb47b['id'])});break;default:logger[_0xaaf7('0x5f')](_0xaaf7('0x64'),_0xaaf7('0x5e'));}}})[_0xaaf7('0x68')](function(_0x1039a7){logger[_0xaaf7('0x5f')](_0xaaf7('0x69'),util[_0xaaf7('0x60')](_0x1039a7,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x5a1c02,_0x530e84,_0x55bbd6,_0x4dbc1e,_0x3ef7c9,_0x2d0a6f){var _0x15abda,_0x3c160d;_0x2d0a6f[_0xaaf7('0x11')]=intUtil[_0xaaf7('0x4a')](_0x2d0a6f[_0xaaf7('0x11')]);_0x2d0a6f[_0xaaf7('0x4b')]=intUtil[_0xaaf7('0x4a')](_0x2d0a6f[_0xaaf7('0x4b')]);if(_0x3ef7c9&&_0x3ef7c9[_0xaaf7('0x4c')]){logger['info'](_0xaaf7('0x6a'),'Recording\x20is\x20enabled!');_0x530e84[_0xaaf7('0x4f')]=util[_0xaaf7('0xf')](_0xaaf7('0x50'),_0x2d0a6f[_0xaaf7('0x4b')],_0x530e84[_0xaaf7('0x51')],md5(_0x530e84[_0xaaf7('0x51')]));}else{_0x530e84[_0xaaf7('0x4f')]='';}headers['Authorization']=getAuth(_0x2d0a6f);return getUser(_0x2d0a6f)['then'](function(_0x5ee6e1){_0x15abda=_0x5ee6e1;logger['info'](_0xaaf7('0x53'),_0x15abda['id']);return getEndUser(_0x2d0a6f,_0x530e84[_0xaaf7('0x54')],_0x530e84[_0xaaf7('0x55')]);})[_0xaaf7('0x17')](function(_0x2fa2d0){_0x3c160d=_0x2fa2d0;logger[_0xaaf7('0xd')](_0xaaf7('0x56'),_0x3c160d['id']);return getTicket(_0x2d0a6f,_0x15abda,_0x3c160d,_0x55bbd6,_0x530e84);})[_0xaaf7('0x17')](function(_0x24d039){if(_0x24d039){logger[_0xaaf7('0xd')]('The\x20Ticket\x20ID\x20is:',_0x24d039['id']);}})[_0xaaf7('0x68')](function(_0x311366){logger[_0xaaf7('0x5f')](_0xaaf7('0x6b'),util[_0xaaf7('0x60')](_0x311366,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc136=['../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','format','remoteUri','POST','merge','Tags','Subjects','getString','Descriptions','Fields','then','info','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','GET','map','forEach','type','customField','nameField','string','idField','custom_fields','push','variable','variableName','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\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...','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','abandoned','[ABANDONED]','lodash','request-promise','md5','ioredis','./util'];(function(_0x35b7c5,_0x4d997e){var _0x35102f=function(_0x5c0eef){while(--_0x5c0eef){_0x35b7c5['push'](_0x35b7c5['shift']());}};_0x35102f(++_0x4d997e);}(_0xc136,0x1af));var _0x6c13=function(_0x466534,_0x1e2a27){_0x466534=_0x466534-0x0;var _0xc13f57=_0xc136[_0x466534];return _0xc13f57;};'use strict';var _=require(_0x6c13('0x0'));var rp=require(_0x6c13('0x1'));var md5=require(_0x6c13('0x2'));var util=require('util');var Redis=require(_0x6c13('0x3'));var intUtil=require(_0x6c13('0x4'));var config=require(_0x6c13('0x5'));var logger=require(_0x6c13('0x6'))(_0x6c13('0x7'));config[_0x6c13('0x8')]=_[_0x6c13('0x9')](config[_0x6c13('0x8')],{'host':_0x6c13('0xa'),'port':0x18eb});var io=require(_0x6c13('0xb'))(new Redis(config['redis']));function emit(_0x1747f2,_0x25acd6,_0x321a90){io['to'](_0x1747f2)[_0x6c13('0xc')](_0x25acd6,_0x321a90);}var headers={'Content-Type':_0x6c13('0xd'),'Accept':_0x6c13('0xd')};function getTicket(_0x2d0738,_0x14f9bf,_0x348f54,_0x4d9ca7,_0xc0cd8d){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x6c13('0xe')]('%s/tickets.json',_0x2d0738[_0x6c13('0xf')]),'method':_0x6c13('0x10'),'body':{'ticket':_[_0x6c13('0x11')]({'requester_id':_0x348f54['id'],'submitter_id':_0x14f9bf?_0x14f9bf['id']:undefined,'assignee_id':_0x14f9bf?_0x14f9bf['id']:undefined,'tags':getTags(_0x4d9ca7[_0x6c13('0x12')],'name'),'subject':intUtil['getString'](_0x4d9ca7[_0x6c13('0x13')],_0xc0cd8d,'\x20'),'description':intUtil[_0x6c13('0x14')](_0x4d9ca7[_0x6c13('0x15')],_0xc0cd8d,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x4d9ca7[_0x6c13('0x15')],_0xc0cd8d,'\x0a')}},getCustomFields(_0x4d9ca7[_0x6c13('0x16')],_0xc0cd8d))}})[_0x6c13('0x17')](function(_0x48ef0d){logger[_0x6c13('0x18')]('Ticket\x20created!');return _0x48ef0d[_0x6c13('0x19')];});}function getUser(_0x3f96f1,_0x8ddaf4){if(intUtil[_0x6c13('0x1a')](_0x8ddaf4)){logger[_0x6c13('0x18')](_0x6c13('0x1b'),_0x8ddaf4);return request({'uri':util[_0x6c13('0xe')]('%s/search.json',_0x3f96f1[_0x6c13('0xf')]),'qs':{'query':util[_0x6c13('0xe')](_0x6c13('0x1c'),_0x8ddaf4)}})[_0x6c13('0x17')](function(_0x3ed393){if(_0x3ed393[_0x6c13('0x1d')]){logger['info'](_0x6c13('0x1e'));return _[_0x6c13('0x1f')](_0x3ed393[_0x6c13('0x20')],{'email':_0x8ddaf4,'role':_0x6c13('0x21')});}else{logger[_0x6c13('0x18')](_0x6c13('0x22'));return request({'uri':util['format'](_0x6c13('0x23'),_0x3f96f1[_0x6c13('0xf')])})[_0x6c13('0x17')](function(_0x3d7f3d){logger['info'](_0x6c13('0x24'));return _0x3d7f3d[_0x6c13('0x25')];});}});}else{logger[_0x6c13('0x18')](_0x6c13('0x22'));return request({'uri':util['format']('%s/users/me.json',_0x3f96f1['remoteUri'])})[_0x6c13('0x17')](function(_0x4980d7){logger[_0x6c13('0x18')]('Admin\x20account\x20selected.');return _0x4980d7[_0x6c13('0x25')];});}}function getEndUser(_0x3a26d6,_0x438b38,_0x299ab4){logger[_0x6c13('0x18')](_0x6c13('0x26'),_0x299ab4);return request({'uri':util[_0x6c13('0xe')](_0x6c13('0x27'),_0x3a26d6[_0x6c13('0xf')]),'qs':{'query':util['format'](_0x6c13('0x28'),_0x299ab4)}})[_0x6c13('0x17')](function(_0xe27cd9){var _0x424c34;if(_0xe27cd9[_0x6c13('0x20')][_0x6c13('0x29')]){_0xe27cd9[_0x6c13('0x20')]=_['filter'](_0xe27cd9['results'],{'suspended':![],'role':'end-user'});if(_0xe27cd9[_0x6c13('0x20')][_0x6c13('0x29')]){_0x424c34=_[_0x6c13('0x2a')](_0xe27cd9[_0x6c13('0x20')]);}}if(_0x424c34){logger[_0x6c13('0x18')]('Enduser\x20found!');return _0x424c34;}else{logger[_0x6c13('0x18')](_0x6c13('0x2b'));return request({'uri':util[_0x6c13('0xe')](_0x6c13('0x2c'),_0x3a26d6['remoteUri']),'method':_0x6c13('0x10'),'body':{'user':{'role':_0x6c13('0x2d'),'name':util[_0x6c13('0xe')](_0x6c13('0x2e'),_0x438b38||_0x299ab4),'phone':_0x299ab4}}})[_0x6c13('0x17')](function(_0x412a0d){logger[_0x6c13('0x18')]('Enduser\x20created.');return _0x412a0d[_0x6c13('0x25')];});}});}function getAuth(_0x5bd96b){var _0x3c971c;if(_0x5bd96b[_0x6c13('0x2f')]==='password'){_0x3c971c=util['format'](_0x6c13('0x30'),_0x5bd96b[_0x6c13('0x31')],_0x5bd96b[_0x6c13('0x32')]);}else if(_0x5bd96b[_0x6c13('0x2f')]===_0x6c13('0x33')){_0x3c971c=util[_0x6c13('0xe')](_0x6c13('0x34'),_0x5bd96b['username'],_0x5bd96b[_0x6c13('0x33')]);}return util[_0x6c13('0xe')](_0x6c13('0x35'),new Buffer(_0x3c971c)[_0x6c13('0x36')](_0x6c13('0x37')));}function request(_0x5335ca){logger[_0x6c13('0x38')](_0x6c13('0x39'),JSON['stringify'](_0x5335ca));return rp(_['defaults'](_0x5335ca,{'method':_0x6c13('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x10dda5,_0x4a2f1a){var _0x3f7cdd=[];if(_0x10dda5&&_0x10dda5[_0x6c13('0x29')]>0x0){_0x3f7cdd=_[_0x6c13('0x3b')](_0x10dda5,_0x4a2f1a);}return _0x3f7cdd;}function getCustomFields(_0x40dce0,_0x3249b8){var _0x58faff=[];var _0x5273c4={'custom_fields':[]};if(_0x40dce0['length']>0x0){_[_0x6c13('0x3c')](_0x40dce0,function(_0x1e924d){if(_0x1e924d[_0x6c13('0x3d')]==='string'&&_0x1e924d['nameField']&&!_0x1e924d[_0x6c13('0x3e')]){_0x5273c4[_0x1e924d[_0x6c13('0x3f')]['toLowerCase']()]=_0x1e924d['content'][_0x6c13('0x36')]();}else if(_0x1e924d[_0x6c13('0x3d')]===_0x6c13('0x40')&&_0x1e924d[_0x6c13('0x41')]&&_0x1e924d['customField']){_0x5273c4[_0x6c13('0x42')][_0x6c13('0x43')]({'id':_0x1e924d[_0x6c13('0x41')],'value':_0x1e924d['content'][_0x6c13('0x36')]()});}else if(_0x1e924d[_0x6c13('0x3d')]===_0x6c13('0x44')&&_0x1e924d[_0x6c13('0x45')]&&_0x1e924d[_0x6c13('0x41')]&&_0x1e924d['customField']){_0x3249b8[_0x1e924d[_0x6c13('0x45')]]&&_0x5273c4[_0x6c13('0x42')][_0x6c13('0x43')]({'id':_0x1e924d[_0x6c13('0x41')],'value':_0x3249b8[_0x1e924d['variableName']][_0x6c13('0x36')]()});}else if(_0x1e924d['type']==='customVariable'&&_0x1e924d[_0x6c13('0x46')]&&_0x1e924d[_0x6c13('0x46')][_0x6c13('0x47')]&&_0x1e924d['idField']&&_0x1e924d['customField']){_0x3249b8[_0x1e924d[_0x6c13('0x46')]['name'][_0x6c13('0x48')]()]&&_0x5273c4[_0x6c13('0x42')]['push']({'id':_0x1e924d['idField'],'value':_0x3249b8[_0x1e924d[_0x6c13('0x46')][_0x6c13('0x47')][_0x6c13('0x48')]()][_0x6c13('0x36')]()});}});}return _0x5273c4;}exports[_0x6c13('0x49')]=function(_0x6ccc48,_0x1dec7c,_0x59a8c7,_0x680de1,_0x14790a,_0x9bd7ea){var _0x4db09f,_0x59a171;_0x9bd7ea[_0x6c13('0xf')]=intUtil[_0x6c13('0x4a')](_0x9bd7ea[_0x6c13('0xf')]);_0x9bd7ea['serverUrl']=intUtil[_0x6c13('0x4a')](_0x9bd7ea[_0x6c13('0x4b')]);if(_0x14790a&&_0x14790a[_0x6c13('0x4c')]){logger[_0x6c13('0x18')](_0x6c13('0x4d'),_0x6c13('0x4e'));_0x1dec7c[_0x6c13('0x4f')]=util['format'](_0x6c13('0x50'),_0x9bd7ea[_0x6c13('0x4b')],_0x1dec7c[_0x6c13('0x51')],md5(_0x1dec7c[_0x6c13('0x51')]));}else{_0x1dec7c['recordingURL']='';}headers[_0x6c13('0x52')]=getAuth(_0x9bd7ea);return getUser(_0x9bd7ea,_0x680de1[_0x6c13('0x53')])[_0x6c13('0x17')](function(_0x30f4b6){_0x4db09f=_0x30f4b6;logger[_0x6c13('0x18')](_0x6c13('0x54'),_0x4db09f['id']);return getEndUser(_0x9bd7ea,_0x1dec7c[_0x6c13('0x55')],_0x1dec7c[_0x6c13('0x56')]);})[_0x6c13('0x17')](function(_0x9603ee){_0x59a171=_0x9603ee;logger['info'](_0x6c13('0x57'),_0x59a171['id']);return getTicket(_0x9bd7ea,_0x4db09f,_0x59a171,_0x59a8c7,_0x1dec7c);})[_0x6c13('0x17')](function(_0x3692b6){if(_0x3692b6){logger[_0x6c13('0x18')]('The\x20Ticket\x20ID\x20is:',_0x3692b6['id']);switch(_0x9bd7ea[_0x6c13('0x3d')]){case _0x6c13('0x58'):logger[_0x6c13('0x18')](_0x6c13('0x4d'),_0x6c13('0x59'));return request({'uri':util[_0x6c13('0xe')](_0x6c13('0x5a'),_0x9bd7ea['remoteUri'],_0x4db09f['id'],_0x3692b6['id']),'method':'POST'});case _0x6c13('0x5b'):logger[_0x6c13('0x18')](_0x6c13('0x4d'),_0x6c13('0x5c'));emit(util[_0x6c13('0xe')]('user:%s',_0x680de1[_0x6c13('0x47')]),_0x6c13('0x5d'),{'uri':util[_0x6c13('0xe')](_0x6c13('0x5e'),_0x9bd7ea['remoteUri'],_0x3692b6['id'])});break;default:logger[_0x6c13('0x5f')](_0x6c13('0x4d'),_0x6c13('0x60'));}}})[_0x6c13('0x61')](function(_0x20c787){logger[_0x6c13('0x5f')](_0x6c13('0x62'),util[_0x6c13('0x63')](_0x20c787,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x17886d,_0x2a2ea5,_0x3906fb,_0xef4fe5,_0x2ebe78,_0x5efa7a,_0x15f434){var _0x3d1ebd,_0x306880;_0x5efa7a[_0x6c13('0xf')]=intUtil['stripTrailingSlash'](_0x5efa7a[_0x6c13('0xf')]);_0x5efa7a[_0x6c13('0x4b')]=intUtil[_0x6c13('0x4a')](_0x5efa7a[_0x6c13('0x4b')]);if(_0x15f434&&_0x15f434[_0x6c13('0x64')]&&_0x15f434['recordingFormat']!==_0x6c13('0x65')){logger['info'](_0x6c13('0x66'),'Recording\x20is\x20enabled!');_0x2a2ea5[_0x6c13('0x4f')]=util[_0x6c13('0xe')](_0x6c13('0x50'),_0x5efa7a[_0x6c13('0x4b')],_0x2a2ea5[_0x6c13('0x51')],md5(_0x2a2ea5[_0x6c13('0x51')]));}headers[_0x6c13('0x52')]=getAuth(_0x5efa7a);return getUser(_0x5efa7a,_0xef4fe5[_0x6c13('0x53')])[_0x6c13('0x17')](function(_0x40135b){_0x3d1ebd=_0x40135b;logger[_0x6c13('0x18')](_0x6c13('0x54'),_0x3d1ebd['id']);return getEndUser(_0x5efa7a,_0x2a2ea5[_0x6c13('0x67')],_0x2a2ea5[_0x6c13('0x68')]);})['then'](function(_0x4e8d98){_0x306880=_0x4e8d98;logger[_0x6c13('0x18')](_0x6c13('0x57'),_0x306880['id']);return getTicket(_0x5efa7a,_0x3d1ebd,_0x306880,_0x3906fb,_0x2a2ea5);})[_0x6c13('0x17')](function(_0x36383a){if(_0x36383a){logger[_0x6c13('0x18')](_0x6c13('0x69'),_0x36383a['id']);switch(_0x5efa7a[_0x6c13('0x3d')]){case _0x6c13('0x58'):logger['info'](_0x6c13('0x66'),_0x6c13('0x59'));return request({'uri':util['format'](_0x6c13('0x5a'),_0x5efa7a[_0x6c13('0xf')],_0x3d1ebd['id'],_0x36383a['id']),'method':'POST'});case'newTab':logger[_0x6c13('0x18')](_0x6c13('0x66'),_0x6c13('0x5c'));emit(util[_0x6c13('0xe')](_0x6c13('0x6a'),_0xef4fe5[_0x6c13('0x47')]),_0x6c13('0x5d'),{'uri':util[_0x6c13('0xe')](_0x6c13('0x5e'),_0x5efa7a['remoteUri'],_0x36383a['id'])});break;default:logger['error'](_0x6c13('0x66'),_0x6c13('0x60'));}}})[_0x6c13('0x61')](function(_0x2eb68d){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x2eb68d,{'showHidden':!![],'depth':null}));});};exports[_0x6c13('0x6b')]=function(_0x2e99d7,_0x46af1a,_0x50d43e,_0xc98191,_0x23c677,_0x3a3380){var _0x56ae98,_0x428be2;_0x3a3380[_0x6c13('0xf')]=intUtil['stripTrailingSlash'](_0x3a3380[_0x6c13('0xf')]);_0x3a3380[_0x6c13('0x4b')]=intUtil[_0x6c13('0x4a')](_0x3a3380['serverUrl']);if(_0x23c677&&_0x23c677['monitor_format']){logger[_0x6c13('0x18')](_0x6c13('0x6c'),'Recording\x20is\x20enabled!');_0x46af1a[_0x6c13('0x4f')]=util[_0x6c13('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a3380[_0x6c13('0x4b')],_0x46af1a[_0x6c13('0x51')],md5(_0x46af1a[_0x6c13('0x51')]));}else{_0x46af1a['recordingURL']='';}headers['Authorization']=getAuth(_0x3a3380);return getUser(_0x3a3380)['then'](function(_0x3bcf18){_0x56ae98=_0x3bcf18;logger['info'](_0x6c13('0x54'),_0x56ae98['id']);return getEndUser(_0x3a3380,_0x46af1a[_0x6c13('0x55')],_0x46af1a[_0x6c13('0x56')]);})[_0x6c13('0x17')](function(_0x58d899){_0x428be2=_0x58d899;logger[_0x6c13('0x18')](_0x6c13('0x57'),_0x428be2['id']);return getTicket(_0x3a3380,_0x56ae98,_0x428be2,_0x50d43e,_0x46af1a);})[_0x6c13('0x17')](function(_0x146b25){if(_0x146b25){logger['info'](_0x6c13('0x69'),_0x146b25['id']);}})[_0x6c13('0x61')](function(_0x384989){logger[_0x6c13('0x5f')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0x6c13('0x63')](_0x384989,{'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 3083546..5bb4f8a 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 _0x3598=['Standard','Agent\x20found!','Using\x20the\x20admin\x20account!','zoho\x20user','profile','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','GET','((Phone:%s))','Contacts','row','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','host','Enduser\x20found\x20in\x20Leads!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','toJson','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','recorddetail','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','length','type','string','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','recordingFormat','[OUTBOUND]','destcalleridname','trigger:browser:url','[ABANDONED]','lodash','request-promise','md5','util','./util','xml2json','entities','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','socket.io-emitter','emit','info','Creating\x20new\x20call...','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','lastevent','called','Call\x20Result','connect','Answered','rejected','Rejected','abandoned','Abandoned','talktime','utc','answertime','endtime','Call\x20Duration','mm:ss','CONTACTID','Leads','SEID','LEADID','','hasOwnProperty','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','authToken','crmapi','then','parse','response','result','stringify','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','users','zoho\x20data\x20users','user','isArrayLikeObject','log','isNil'];(function(_0x23cc76,_0x9c756b){var _0x2f5c13=function(_0x57c44b){while(--_0x57c44b){_0x23cc76['push'](_0x23cc76['shift']());}};_0x2f5c13(++_0x9c756b);}(_0x3598,0x149));var _0x8359=function(_0x17f2c4,_0x409af0){_0x17f2c4=_0x17f2c4-0x0;var _0x4c8d4b=_0x3598[_0x17f2c4];return _0x4c8d4b;};'use strict';var _=require(_0x8359('0x0'));var rp=require(_0x8359('0x1'));var md5=require(_0x8359('0x2'));var util=require(_0x8359('0x3'));var intUtil=require(_0x8359('0x4'));var parser=require(_0x8359('0x5'));var entities=require(_0x8359('0x6'));var moment=require('moment');var Redis=require(_0x8359('0x7'));var config=require(_0x8359('0x8'));var logger=require(_0x8359('0x9'))(_0x8359('0xa'));config['redis']=_[_0x8359('0xb')](config[_0x8359('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x8359('0xd'))(new Redis(config[_0x8359('0xc')]));function emit(_0x381633,_0x2d7e08,_0x1d333d){io['to'](_0x381633)[_0x8359('0xe')](_0x2d7e08,_0x1d333d);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getCall(_0x4a7afb,_0x44ad9c,_0x11c38f,_0x56be14,_0x3cd229,_0x52430d){logger[_0x8359('0xf')](_0x8359('0x10'));var _0x396a14=_['merge']({'SMOWNERID':_0x44ad9c['id'],'Call Type':_0x52430d||_0x8359('0x11'),'Call Start Time':(_0x52430d===_0x8359('0x12')?_0x3cd229[_0x8359('0x13')]:_0x3cd229[_0x8359('0x14')])||moment()[_0x8359('0x15')](_0x8359('0x16')),'Subject':intUtil[_0x8359('0x17')](_0x56be14[_0x8359('0x18')],_0x3cd229,'\x20'),'Description':intUtil['getString'](_0x56be14[_0x8359('0x19')],_0x3cd229,'\x0a')},getCustomFields(_0x56be14[_0x8359('0x1a')],_0x3cd229));switch(_0x3cd229[_0x8359('0x1b')]){case _0x8359('0x1c'):_0x396a14[_0x8359('0x1d')]='Called';break;case'complete':case _0x8359('0x1e'):_0x396a14[_0x8359('0x1d')]=_0x8359('0x1f');break;case _0x8359('0x20'):_0x396a14[_0x8359('0x1d')]=_0x8359('0x21');break;case _0x8359('0x22'):_0x396a14[_0x8359('0x1d')]=_0x8359('0x23');break;default:}if(_0x3cd229[_0x8359('0x24')]){_0x396a14['Call\x20Duration']=moment[_0x8359('0x25')](parseInt(_0x3cd229[_0x8359('0x24')])*0x3e8)[_0x8359('0x15')]('mm:ss');}else if(_0x3cd229[_0x8359('0x26')]&&_0x3cd229[_0x8359('0x27')]){_0x396a14[_0x8359('0x28')]=moment[_0x8359('0x25')](moment(_0x3cd229[_0x8359('0x27')],_0x8359('0x16'))['diff'](moment(_0x3cd229[_0x8359('0x13')],_0x8359('0x16'))))[_0x8359('0x15')](_0x8359('0x29'));}if(_0x11c38f[_0x8359('0x2a')]){_0x396a14[_0x8359('0x2a')]=_0x11c38f[_0x8359('0x2a')];}else if(_0x11c38f['LEADID']){_0x396a14['SEMODULE']=_0x8359('0x2b');_0x396a14[_0x8359('0x2c')]=_0x11c38f[_0x8359('0x2d')];}var _0xd17465=_0x8359('0x2e');for(var _0x1281b0 in _0x396a14){if(_0x396a14[_0x8359('0x2f')](_0x1281b0)){_0xd17465+=util[_0x8359('0x15')]('%s',entities[_0x8359('0x30')](_0x1281b0),entities[_0x8359('0x30')](_0x396a14[_0x1281b0]));}}_0xd17465+=_0x8359('0x31');return request({'method':_0x8359('0x32'),'uri':util[_0x8359('0x15')](_0x8359('0x33'),_0x4a7afb['host']),'qs':{'authtoken':_0x4a7afb[_0x8359('0x34')],'scope':_0x8359('0x35'),'xmlData':_0xd17465},'json':!![]})[_0x8359('0x36')](function(_0x196a8d){_0x196a8d=JSON[_0x8359('0x37')](parser['toJson'](_0x196a8d));if(_0x196a8d[_0x8359('0x38')]){if(_0x196a8d[_0x8359('0x38')][_0x8359('0x39')]&&_0x196a8d[_0x8359('0x38')][_0x8359('0x39')]['recorddetail']){logger[_0x8359('0xf')]('Call\x20created!');return{'id':_0x196a8d[_0x8359('0x38')][_0x8359('0x39')]['recorddetail']['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON[_0x8359('0x3a')](_0x196a8d));});}function getUser(_0x11c965,_0xffe02a){return request({'method':'GET','uri':util['format'](_0x8359('0x3b'),_0x11c965['host']),'qs':{'type':_0x8359('0x3c'),'authtoken':_0x11c965[_0x8359('0x34')],'scope':_0x8359('0x35')},'json':!![]})[_0x8359('0x36')](function(_0x4dcbc5){if(_0x4dcbc5[_0x8359('0x3d')]&&_0x4dcbc5[_0x8359('0x3d')]['user']){var _0x2c8826;console['log'](_0x8359('0x3e'),_0x4dcbc5['users'][_0x8359('0x3f')]);if(_[_0x8359('0x40')](_0x4dcbc5[_0x8359('0x3d')][_0x8359('0x3f')])){console[_0x8359('0x41')](_0x8359('0x3e'),_0x4dcbc5[_0x8359('0x3d')][_0x8359('0x3f')]);if(!_[_0x8359('0x42')](_0xffe02a)){_0x2c8826=_['find'](_0x4dcbc5[_0x8359('0x3d')][_0x8359('0x3f')],{'email':_0xffe02a,'profile':_0x8359('0x43'),'status':'active'});}if(!_['isNil'](_0x2c8826)){logger['info'](_0x8359('0x44'));}else{logger[_0x8359('0xf')](_0x8359('0x45'));_0x2c8826=_['find'](_0x4dcbc5[_0x8359('0x3d')][_0x8359('0x3f')],{'profile':'Administrator'});}console[_0x8359('0x41')](_0x8359('0x46'),_0x2c8826);return _0x2c8826;}else{if(_0x4dcbc5[_0x8359('0x3d')][_0x8359('0x3f')][_0x8359('0x47')]===_0x8359('0x48')){logger[_0x8359('0xf')](_0x8359('0x45'));_0x2c8826=_0x4dcbc5['users']['user'];return _0x2c8826;}else{logger[_0x8359('0x49')]('The\x20failing\x20result\x20is',JSON[_0x8359('0x3a')](_0x4dcbc5));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x8359('0x3a')](_0x4dcbc5));}}}else{logger['error'](_0x8359('0x4a'),JSON[_0x8359('0x3a')](_0x4dcbc5));throw new Error(_0x8359('0x4b')+JSON[_0x8359('0x3a')](_0x4dcbc5));}});}function getEndUser(_0x53eb48,_0x1edbf,_0x15b411){logger[_0x8359('0xf')](_0x8359('0x4c'),_0x15b411);return request({'method':_0x8359('0x4d'),'uri':util['format']('https://crm.%s/crm/private/json/Contacts/searchRecords',_0x53eb48['host']),'qs':{'authtoken':_0x53eb48[_0x8359('0x34')],'scope':_0x8359('0x35'),'criteria':util['format'](_0x8359('0x4e'),_0x15b411)},'json':!![]})[_0x8359('0x36')](function(_0x185c45){if(_0x185c45[_0x8359('0x38')]&&_0x185c45[_0x8359('0x38')]['result']){logger[_0x8359('0xf')]('Enduser\x20found\x20in\x20Contacts!');var _0x38a139={};var _0x301cca=_0x185c45[_0x8359('0x38')][_0x8359('0x39')][_0x8359('0x4f')]['row']['no']?_0x185c45['response'][_0x8359('0x39')][_0x8359('0x4f')][_0x8359('0x50')]['FL']:_0x185c45['response'][_0x8359('0x39')][_0x8359('0x4f')][_0x8359('0x50')][0x0]['FL'];for(var _0x53322c=0x0,_0x5c1e00=_0x301cca['length'];_0x53322c<_0x5c1e00;_0x53322c++){_0x38a139[_0x301cca[_0x53322c][_0x8359('0x51')]]=_0x301cca[_0x53322c][_0x8359('0x52')];}return _0x38a139;}else{return request({'method':_0x8359('0x4d'),'uri':util[_0x8359('0x15')](_0x8359('0x53'),_0x53eb48[_0x8359('0x54')]),'qs':{'authtoken':_0x53eb48['authToken'],'scope':'crmapi','criteria':util[_0x8359('0x15')](_0x8359('0x4e'),_0x15b411)},'json':!![]})[_0x8359('0x36')](function(_0xcb4803){if(_0xcb4803['response']&&_0xcb4803['response'][_0x8359('0x39')]){logger[_0x8359('0xf')](_0x8359('0x55'));var _0x3a74fa={};var _0xc64023=_0xcb4803[_0x8359('0x38')][_0x8359('0x39')][_0x8359('0x2b')][_0x8359('0x50')]['no']?_0xcb4803[_0x8359('0x38')][_0x8359('0x39')][_0x8359('0x2b')][_0x8359('0x50')]['FL']:_0xcb4803[_0x8359('0x38')][_0x8359('0x39')][_0x8359('0x2b')]['row'][0x0]['FL'];for(var _0x58dd03=0x0,_0x4dbbc5=_0xc64023['length'];_0x58dd03<_0x4dbbc5;_0x58dd03++){_0x3a74fa[_0xc64023[_0x58dd03][_0x8359('0x51')]]=_0xc64023[_0x58dd03][_0x8359('0x52')];}return _0x3a74fa;}else{logger[_0x8359('0xf')](_0x8359('0x56'));_0x1edbf=getName(_0x1edbf);return request({'method':'POST','uri':util[_0x8359('0x15')](_0x8359('0x57'),_0x53eb48[_0x8359('0x54')]),'qs':{'authtoken':_0x53eb48[_0x8359('0x34')],'scope':_0x8359('0x35'),'xmlData':util[_0x8359('0x15')](_0x8359('0x58'),entities[_0x8359('0x30')](_0x1edbf[0x0]),entities['encodeXML'](_0x1edbf[0x1]),_0x15b411)},'json':!![]})[_0x8359('0x36')](function(_0x27b881){_0x27b881=JSON[_0x8359('0x37')](parser[_0x8359('0x59')](_0x27b881));if(_0x27b881['response']){if(_0x27b881['response'][_0x8359('0x39')]&&_0x27b881[_0x8359('0x38')]['result']['recorddetail']){logger[_0x8359('0xf')](_0x8359('0x5a'));return request({'method':_0x8359('0x4d'),'uri':util[_0x8359('0x15')](_0x8359('0x5b'),_0x53eb48['host']),'qs':{'authtoken':_0x53eb48[_0x8359('0x34')],'scope':_0x8359('0x35'),'id':_0x27b881[_0x8359('0x38')]['result'][_0x8359('0x5c')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x8359('0x5d')+JSON[_0x8359('0x3a')](_0x27b881));})[_0x8359('0x36')](function(_0xbaeadb){if(_0xbaeadb[_0x8359('0x38')]){if(_0xbaeadb['response'][_0x8359('0x39')]){var _0x43657c={};for(var _0x11a441=0x0,_0x4a50fc=_0xbaeadb[_0x8359('0x38')]['result'][_0x8359('0x2b')]['row']['FL']['length'];_0x11a441<_0x4a50fc;_0x11a441++){_0x43657c[_0xbaeadb['response']['result'][_0x8359('0x2b')][_0x8359('0x50')]['FL'][_0x11a441]['val']]=_0xbaeadb[_0x8359('0x38')][_0x8359('0x39')]['Leads'][_0x8359('0x50')]['FL'][_0x11a441][_0x8359('0x52')];}return _0x43657c;}}throw new Error(_0x8359('0x5e')+JSON[_0x8359('0x3a')](_0xbaeadb));});}});}});}function request(_0x5d885f){logger[_0x8359('0x5f')]('[HTTP]',JSON[_0x8359('0x3a')](_0x5d885f));return rp(_0x5d885f);}function getCustomFields(_0x5923a2,_0x5122cd){var _0x280436={};if(_0x5923a2[_0x8359('0x60')]>0x0){_['forEach'](_0x5923a2,function(_0x2ec5e6){if(_0x2ec5e6[_0x8359('0x61')]===_0x8359('0x62')&&_0x2ec5e6[_0x8359('0x63')]){_0x280436[_0x2ec5e6[_0x8359('0x63')]]=_0x2ec5e6[_0x8359('0x52')][_0x8359('0x64')]();}else if(_0x2ec5e6['type']===_0x8359('0x65')&&_0x2ec5e6[_0x8359('0x66')]&&_0x2ec5e6[_0x8359('0x63')]&&_0x5122cd[_0x2ec5e6[_0x8359('0x66')]]){_0x280436[_0x2ec5e6[_0x8359('0x63')]]=_0x5122cd[_0x2ec5e6[_0x8359('0x66')]][_0x8359('0x64')]();}else if(_0x2ec5e6['type']==='customVariable'&&_0x2ec5e6[_0x8359('0x67')]&&_0x2ec5e6[_0x8359('0x67')][_0x8359('0x68')]&&_0x2ec5e6['idField']&&_0x5122cd[_0x2ec5e6[_0x8359('0x67')][_0x8359('0x68')][_0x8359('0x69')]()]){_0x280436[_0x2ec5e6['idField']]=_0x5122cd[_0x2ec5e6[_0x8359('0x67')]['name'][_0x8359('0x69')]()][_0x8359('0x64')]();}});}return _0x280436;}function getName(_0xd72cf7){if(_0xd72cf7[_0x8359('0x6a')]('\x20')>0x0){var _0x4f091a=_0xd72cf7[_0x8359('0x6b')](/ (.+)/);if(_0x4f091a[0x1]){return _0x4f091a;}}return[_0xd72cf7,_0xd72cf7];}exports['queue']=function(_0x10bdb6,_0x53970a,_0x3d461b,_0x302350,_0x15dc91,_0x38ef7b){var _0x4cb666,_0x1464ca;_0x38ef7b[_0x8359('0x54')]=intUtil[_0x8359('0x6c')](_0x38ef7b[_0x8359('0x54')]);_0x38ef7b[_0x8359('0x6d')]=intUtil['stripTrailingSlash'](_0x38ef7b[_0x8359('0x6d')]);if(_0x15dc91&&_0x15dc91[_0x8359('0x6e')]){logger['info'](_0x8359('0x6f'),_0x8359('0x70'));_0x53970a[_0x8359('0x71')]=util[_0x8359('0x15')](_0x8359('0x72'),_0x38ef7b[_0x8359('0x6d')],_0x53970a[_0x8359('0x73')],md5(_0x53970a[_0x8359('0x73')]));}else{_0x53970a[_0x8359('0x71')]='';}return getUser(_0x38ef7b,_0x302350[_0x8359('0x74')])[_0x8359('0x36')](function(_0x445639){_0x4cb666=_0x445639;logger[_0x8359('0xf')](_0x8359('0x75'),_0x4cb666['id']);return getEndUser(_0x38ef7b,_0x53970a[_0x8359('0x76')],_0x53970a[_0x8359('0x77')]);})[_0x8359('0x36')](function(_0x4c1d4d){_0x1464ca=_0x4c1d4d;logger['info'](_0x8359('0x78'),_0x1464ca[_0x8359('0x2a')]||_0x1464ca[_0x8359('0x2d')]);return getCall(_0x38ef7b,_0x4cb666,_0x1464ca,_0x3d461b,_0x53970a,_0x8359('0x79'));})[_0x8359('0x36')](function(_0x509079){if(_0x509079){logger['info'](_0x8359('0x7a'),_0x509079['id']);logger[_0x8359('0xf')](_0x8359('0x6f'),_0x8359('0x7b'));emit(util['format'](_0x8359('0x7c'),_0x302350[_0x8359('0x68')]),'trigger:browser:url',{'uri':util['format'](_0x8359('0x7d'),_0x38ef7b[_0x8359('0x54')],_0x509079['id'])});}})[_0x8359('0x7e')](function(_0x2e3a68){logger['error'](_0x8359('0x6f'),JSON['stringify'](_0x2e3a68));});};exports[_0x8359('0x12')]=function(_0x4ef210,_0x5f54da,_0x31993a,_0x26e45d,_0x43bdd1,_0x35adfc,_0x183af1){var _0x5db87f,_0x172fb5;_0x35adfc[_0x8359('0x54')]=intUtil['stripTrailingSlash'](_0x35adfc['host']);_0x35adfc[_0x8359('0x6d')]=intUtil['stripTrailingSlash'](_0x35adfc[_0x8359('0x6d')]);if(_0x183af1&&_0x183af1[_0x8359('0x7f')]&&_0x183af1['recordingFormat']!=='none'){logger['info'](_0x8359('0x80'),_0x8359('0x70'));_0x5f54da[_0x8359('0x71')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35adfc[_0x8359('0x6d')],_0x5f54da[_0x8359('0x73')],md5(_0x5f54da[_0x8359('0x73')]));}return getUser(_0x35adfc,_0x26e45d[_0x8359('0x74')])[_0x8359('0x36')](function(_0x5eddb6){_0x5db87f=_0x5eddb6;logger['info'](_0x8359('0x75'),_0x5db87f['id']);return getEndUser(_0x35adfc,_0x5f54da[_0x8359('0x81')],_0x5f54da['destcalleridnum']);})[_0x8359('0x36')](function(_0x487919){_0x172fb5=_0x487919;logger[_0x8359('0xf')](_0x8359('0x78'),_0x172fb5[_0x8359('0x2a')]||_0x172fb5[_0x8359('0x2d')]);return getCall(_0x35adfc,_0x5db87f,_0x172fb5,_0x31993a,_0x5f54da,'Outbound');})[_0x8359('0x36')](function(_0x56daf3){if(_0x56daf3){logger['info'](_0x8359('0x7a'),_0x56daf3['id']);logger[_0x8359('0xf')]('[OUTBOUND]',_0x8359('0x7b'));emit(util[_0x8359('0x15')](_0x8359('0x7c'),_0x26e45d[_0x8359('0x68')]),_0x8359('0x82'),{'uri':util[_0x8359('0x15')](_0x8359('0x7d'),_0x35adfc[_0x8359('0x54')],_0x56daf3['id'])});}})[_0x8359('0x7e')](function(_0x50d2b9){logger['error'](_0x8359('0x80'),JSON[_0x8359('0x3a')](_0x50d2b9));});};exports[_0x8359('0x22')]=function(_0x5d02a2,_0x5bfdde,_0x3e644a,_0x50e08f,_0x3f21f4,_0x614d8c){var _0x3a5273,_0x56bb0d;_0x614d8c[_0x8359('0x54')]=intUtil[_0x8359('0x6c')](_0x614d8c[_0x8359('0x54')]);_0x614d8c[_0x8359('0x6d')]=intUtil[_0x8359('0x6c')](_0x614d8c['serverUrl']);if(_0x3f21f4&&_0x3f21f4['monitor_format']){logger[_0x8359('0xf')](_0x8359('0x83'),_0x8359('0x70'));_0x5bfdde[_0x8359('0x71')]=util[_0x8359('0x15')](_0x8359('0x72'),_0x614d8c[_0x8359('0x6d')],_0x5bfdde[_0x8359('0x73')],md5(_0x5bfdde[_0x8359('0x73')]));}else{_0x5bfdde['recordingURL']='';}return getUser(_0x614d8c)[_0x8359('0x36')](function(_0x283a77){_0x3a5273=_0x283a77;logger['info'](_0x8359('0x75'),_0x3a5273['id']);return getEndUser(_0x614d8c,_0x5bfdde['calleridname'],_0x5bfdde['calleridnum']);})[_0x8359('0x36')](function(_0xce867c){_0x56bb0d=_0xce867c;logger[_0x8359('0xf')](_0x8359('0x78'),_0x56bb0d[_0x8359('0x2a')]||_0x56bb0d[_0x8359('0x2d')]);return getCall(_0x614d8c,_0x3a5273,_0x56bb0d,_0x3e644a,_0x5bfdde,_0x8359('0x79'));})[_0x8359('0x36')](function(_0x43448c){if(_0x43448c){logger[_0x8359('0xf')](_0x8359('0x7a'),_0x43448c['id']);}})[_0x8359('0x7e')](function(_0x132c17){logger[_0x8359('0x49')](_0x8359('0x83'),JSON[_0x8359('0x3a')](_0x132c17));});}; \ No newline at end of file +var _0x0fc0=['utc','answertime','endtime','Call\x20Duration','diff','mm:ss','CONTACTID','LEADID','SEMODULE','SEID','','hasOwnProperty','%s','','POST','authToken','crmapi','then','parse','toJson','response','result','GET','users','log','user','isArrayLikeObject','zoho\x20data\x20users','isNil','find','Standard','active','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','host','((Phone:%s))','Contacts','row','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s%s%s','encodeXML','recorddetail','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','error','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','user:%s','[ABANDONED]','Inbound','lodash','md5','util','./util','moment','zoho','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20call...','merge','inbound','outbound','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','called','Call\x20Result','Called','connect','Answered','rejected','abandoned','Abandoned','talktime'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0fc0,0x65));var _0x00fc=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x0fc0[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x00fc('0x0'));var rp=require('request-promise');var md5=require(_0x00fc('0x1'));var util=require(_0x00fc('0x2'));var intUtil=require(_0x00fc('0x3'));var parser=require('xml2json');var entities=require('entities');var moment=require(_0x00fc('0x4'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x00fc('0x5'));config[_0x00fc('0x6')]=_['defaults'](config[_0x00fc('0x6')],{'host':_0x00fc('0x7'),'port':0x18eb});var io=require(_0x00fc('0x8'))(new Redis(config[_0x00fc('0x6')]));function emit(_0x2f1865,_0x854f5d,_0x3d1a8e){io['to'](_0x2f1865)[_0x00fc('0x9')](_0x854f5d,_0x3d1a8e);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getCall(_0x3789f6,_0x3ff228,_0x40589d,_0x22e704,_0x2c34b4,_0x1856a1){logger[_0x00fc('0xa')](_0x00fc('0xb'));var _0x540f29=_[_0x00fc('0xc')]({'SMOWNERID':_0x3ff228['id'],'Call Type':_0x1856a1||_0x00fc('0xd'),'Call Start Time':(_0x1856a1===_0x00fc('0xe')?_0x2c34b4['starttime']:_0x2c34b4[_0x00fc('0xf')])||moment()[_0x00fc('0x10')](_0x00fc('0x11')),'Subject':intUtil[_0x00fc('0x12')](_0x22e704[_0x00fc('0x13')],_0x2c34b4,'\x20'),'Description':intUtil[_0x00fc('0x12')](_0x22e704[_0x00fc('0x14')],_0x2c34b4,'\x0a')},getCustomFields(_0x22e704[_0x00fc('0x15')],_0x2c34b4));switch(_0x2c34b4['lastevent']){case _0x00fc('0x16'):_0x540f29[_0x00fc('0x17')]=_0x00fc('0x18');break;case'complete':case _0x00fc('0x19'):_0x540f29[_0x00fc('0x17')]=_0x00fc('0x1a');break;case _0x00fc('0x1b'):_0x540f29[_0x00fc('0x17')]='Rejected';break;case _0x00fc('0x1c'):_0x540f29[_0x00fc('0x17')]=_0x00fc('0x1d');break;default:}if(_0x2c34b4[_0x00fc('0x1e')]){_0x540f29['Call\x20Duration']=moment[_0x00fc('0x1f')](parseInt(_0x2c34b4[_0x00fc('0x1e')])*0x3e8)['format']('mm:ss');}else if(_0x2c34b4[_0x00fc('0x20')]&&_0x2c34b4[_0x00fc('0x21')]){_0x540f29[_0x00fc('0x22')]=moment[_0x00fc('0x1f')](moment(_0x2c34b4['endtime'],_0x00fc('0x11'))[_0x00fc('0x23')](moment(_0x2c34b4['starttime'],_0x00fc('0x11'))))[_0x00fc('0x10')](_0x00fc('0x24'));}if(_0x40589d[_0x00fc('0x25')]){_0x540f29[_0x00fc('0x25')]=_0x40589d[_0x00fc('0x25')];}else if(_0x40589d[_0x00fc('0x26')]){_0x540f29[_0x00fc('0x27')]='Leads';_0x540f29[_0x00fc('0x28')]=_0x40589d[_0x00fc('0x26')];}var _0x4c0ab3=_0x00fc('0x29');for(var _0x3c577d in _0x540f29){if(_0x540f29[_0x00fc('0x2a')](_0x3c577d)){_0x4c0ab3+=util[_0x00fc('0x10')](_0x00fc('0x2b'),entities['encodeXML'](_0x3c577d),entities['encodeXML'](_0x540f29[_0x3c577d]));}}_0x4c0ab3+=_0x00fc('0x2c');return request({'method':_0x00fc('0x2d'),'uri':util['format']('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x3789f6['host']),'qs':{'authtoken':_0x3789f6[_0x00fc('0x2e')],'scope':_0x00fc('0x2f'),'xmlData':_0x4c0ab3},'json':!![]})[_0x00fc('0x30')](function(_0x1844e7){_0x1844e7=JSON[_0x00fc('0x31')](parser[_0x00fc('0x32')](_0x1844e7));if(_0x1844e7['response']){if(_0x1844e7[_0x00fc('0x33')][_0x00fc('0x34')]&&_0x1844e7[_0x00fc('0x33')][_0x00fc('0x34')]['recorddetail']){logger[_0x00fc('0xa')]('Call\x20created!');return{'id':_0x1844e7[_0x00fc('0x33')][_0x00fc('0x34')]['recorddetail']['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON['stringify'](_0x1844e7));});}function getUser(_0x15dacf,_0x4bfb5c){return request({'method':_0x00fc('0x35'),'uri':util[_0x00fc('0x10')]('https://crm.%s/crm/private/json/Users/getUsers',_0x15dacf['host']),'qs':{'type':'AllUsers','authtoken':_0x15dacf['authToken'],'scope':'crmapi'},'json':!![]})[_0x00fc('0x30')](function(_0x169b42){if(_0x169b42[_0x00fc('0x36')]&&_0x169b42[_0x00fc('0x36')]['user']){var _0x552001;console[_0x00fc('0x37')]('zoho\x20data\x20users',_0x169b42[_0x00fc('0x36')][_0x00fc('0x38')]);if(_[_0x00fc('0x39')](_0x169b42[_0x00fc('0x36')][_0x00fc('0x38')])){console['log'](_0x00fc('0x3a'),_0x169b42[_0x00fc('0x36')][_0x00fc('0x38')]);if(!_[_0x00fc('0x3b')](_0x4bfb5c)){_0x552001=_[_0x00fc('0x3c')](_0x169b42[_0x00fc('0x36')][_0x00fc('0x38')],{'email':_0x4bfb5c,'profile':_0x00fc('0x3d'),'status':_0x00fc('0x3e')});}if(!_['isNil'](_0x552001)){logger[_0x00fc('0xa')](_0x00fc('0x3f'));}else{logger[_0x00fc('0xa')](_0x00fc('0x40'));_0x552001=_[_0x00fc('0x3c')](_0x169b42[_0x00fc('0x36')][_0x00fc('0x38')],{'profile':_0x00fc('0x41')});}console[_0x00fc('0x37')]('zoho\x20user',_0x552001);return _0x552001;}else{if(_0x169b42['users'][_0x00fc('0x38')]['profile']===_0x00fc('0x41')){logger['info'](_0x00fc('0x40'));_0x552001=_0x169b42[_0x00fc('0x36')]['user'];return _0x552001;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x00fc('0x42')](_0x169b42));throw new Error(_0x00fc('0x43')+JSON[_0x00fc('0x42')](_0x169b42));}}}else{logger['error'](_0x00fc('0x44'),JSON[_0x00fc('0x42')](_0x169b42));throw new Error(_0x00fc('0x43')+JSON['stringify'](_0x169b42));}});}function getEndUser(_0x2af891,_0x499d93,_0x1b8696){logger[_0x00fc('0xa')](_0x00fc('0x45'),_0x1b8696);return request({'method':_0x00fc('0x35'),'uri':util[_0x00fc('0x10')](_0x00fc('0x46'),_0x2af891[_0x00fc('0x47')]),'qs':{'authtoken':_0x2af891[_0x00fc('0x2e')],'scope':_0x00fc('0x2f'),'criteria':util[_0x00fc('0x10')](_0x00fc('0x48'),_0x1b8696)},'json':!![]})[_0x00fc('0x30')](function(_0x2a65d4){if(_0x2a65d4[_0x00fc('0x33')]&&_0x2a65d4['response']['result']){logger[_0x00fc('0xa')]('Enduser\x20found\x20in\x20Contacts!');var _0x20d518={};var _0x889e4a=_0x2a65d4[_0x00fc('0x33')]['result'][_0x00fc('0x49')][_0x00fc('0x4a')]['no']?_0x2a65d4[_0x00fc('0x33')][_0x00fc('0x34')][_0x00fc('0x49')][_0x00fc('0x4a')]['FL']:_0x2a65d4[_0x00fc('0x33')][_0x00fc('0x34')]['Contacts'][_0x00fc('0x4a')][0x0]['FL'];for(var _0x2a230d=0x0,_0x43aedf=_0x889e4a[_0x00fc('0x4b')];_0x2a230d<_0x43aedf;_0x2a230d++){_0x20d518[_0x889e4a[_0x2a230d][_0x00fc('0x4c')]]=_0x889e4a[_0x2a230d][_0x00fc('0x4d')];}return _0x20d518;}else{return request({'method':_0x00fc('0x35'),'uri':util[_0x00fc('0x10')](_0x00fc('0x4e'),_0x2af891['host']),'qs':{'authtoken':_0x2af891[_0x00fc('0x2e')],'scope':_0x00fc('0x2f'),'criteria':util[_0x00fc('0x10')](_0x00fc('0x48'),_0x1b8696)},'json':!![]})[_0x00fc('0x30')](function(_0x5925f6){if(_0x5925f6['response']&&_0x5925f6[_0x00fc('0x33')][_0x00fc('0x34')]){logger[_0x00fc('0xa')](_0x00fc('0x4f'));var _0x214777={};var _0x472330=_0x5925f6[_0x00fc('0x33')]['result'][_0x00fc('0x50')][_0x00fc('0x4a')]['no']?_0x5925f6[_0x00fc('0x33')]['result'][_0x00fc('0x50')][_0x00fc('0x4a')]['FL']:_0x5925f6[_0x00fc('0x33')][_0x00fc('0x34')][_0x00fc('0x50')][_0x00fc('0x4a')][0x0]['FL'];for(var _0x1f806a=0x0,_0xe11dba=_0x472330['length'];_0x1f806a<_0xe11dba;_0x1f806a++){_0x214777[_0x472330[_0x1f806a]['val']]=_0x472330[_0x1f806a][_0x00fc('0x4d')];}return _0x214777;}else{logger[_0x00fc('0xa')](_0x00fc('0x51'));_0x499d93=getName(_0x499d93);return request({'method':_0x00fc('0x2d'),'uri':util[_0x00fc('0x10')]('https://crm.%s/crm/private/xml/Leads/insertRecords',_0x2af891[_0x00fc('0x47')]),'qs':{'authtoken':_0x2af891[_0x00fc('0x2e')],'scope':_0x00fc('0x2f'),'xmlData':util[_0x00fc('0x10')](_0x00fc('0x52'),entities['encodeXML'](_0x499d93[0x0]),entities[_0x00fc('0x53')](_0x499d93[0x1]),_0x1b8696)},'json':!![]})[_0x00fc('0x30')](function(_0x1d10d3){_0x1d10d3=JSON[_0x00fc('0x31')](parser[_0x00fc('0x32')](_0x1d10d3));if(_0x1d10d3['response']){if(_0x1d10d3['response']['result']&&_0x1d10d3[_0x00fc('0x33')]['result'][_0x00fc('0x54')]){logger[_0x00fc('0xa')](_0x00fc('0x55'));return request({'method':_0x00fc('0x35'),'uri':util[_0x00fc('0x10')](_0x00fc('0x56'),_0x2af891['host']),'qs':{'authtoken':_0x2af891[_0x00fc('0x2e')],'scope':_0x00fc('0x2f'),'id':_0x1d10d3[_0x00fc('0x33')][_0x00fc('0x34')][_0x00fc('0x54')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x00fc('0x57')+JSON[_0x00fc('0x42')](_0x1d10d3));})['then'](function(_0x5bca15){if(_0x5bca15[_0x00fc('0x33')]){if(_0x5bca15['response']['result']){var _0x538df9={};for(var _0x200237=0x0,_0xeaa3d1=_0x5bca15['response']['result'][_0x00fc('0x50')][_0x00fc('0x4a')]['FL'][_0x00fc('0x4b')];_0x200237<_0xeaa3d1;_0x200237++){_0x538df9[_0x5bca15[_0x00fc('0x33')][_0x00fc('0x34')][_0x00fc('0x50')]['row']['FL'][_0x200237][_0x00fc('0x4c')]]=_0x5bca15[_0x00fc('0x33')][_0x00fc('0x34')][_0x00fc('0x50')][_0x00fc('0x4a')]['FL'][_0x200237][_0x00fc('0x4d')];}return _0x538df9;}}throw new Error(_0x00fc('0x58')+JSON[_0x00fc('0x42')](_0x5bca15));});}});}});}function request(_0x1c6495){logger[_0x00fc('0x59')](_0x00fc('0x5a'),JSON[_0x00fc('0x42')](_0x1c6495));return rp(_0x1c6495);}function getCustomFields(_0x33fbbb,_0xe8ae30){var _0x137f19={};if(_0x33fbbb[_0x00fc('0x4b')]>0x0){_['forEach'](_0x33fbbb,function(_0x105f52){if(_0x105f52[_0x00fc('0x5b')]===_0x00fc('0x5c')&&_0x105f52[_0x00fc('0x5d')]){_0x137f19[_0x105f52[_0x00fc('0x5d')]]=_0x105f52[_0x00fc('0x4d')][_0x00fc('0x5e')]();}else if(_0x105f52[_0x00fc('0x5b')]===_0x00fc('0x5f')&&_0x105f52[_0x00fc('0x60')]&&_0x105f52['idField']&&_0xe8ae30[_0x105f52[_0x00fc('0x60')]]){_0x137f19[_0x105f52[_0x00fc('0x5d')]]=_0xe8ae30[_0x105f52[_0x00fc('0x60')]]['toString']();}else if(_0x105f52[_0x00fc('0x5b')]===_0x00fc('0x61')&&_0x105f52[_0x00fc('0x62')]&&_0x105f52['Variable']['name']&&_0x105f52['idField']&&_0xe8ae30[_0x105f52[_0x00fc('0x62')][_0x00fc('0x63')]['toLowerCase']()]){_0x137f19[_0x105f52[_0x00fc('0x5d')]]=_0xe8ae30[_0x105f52[_0x00fc('0x62')]['name'][_0x00fc('0x64')]()][_0x00fc('0x5e')]();}});}return _0x137f19;}function getName(_0x3311c2){if(_0x3311c2[_0x00fc('0x65')]('\x20')>0x0){var _0x6bd118=_0x3311c2[_0x00fc('0x66')](/ (.+)/);if(_0x6bd118[0x1]){return _0x6bd118;}}return[_0x3311c2,_0x3311c2];}exports[_0x00fc('0x67')]=function(_0xe68c3e,_0xcb122a,_0x305f45,_0x2be2d7,_0x5ed142,_0x25f55f){var _0xed762f,_0x1e562b;_0x25f55f['host']=intUtil['stripTrailingSlash'](_0x25f55f[_0x00fc('0x47')]);_0x25f55f[_0x00fc('0x68')]=intUtil[_0x00fc('0x69')](_0x25f55f[_0x00fc('0x68')]);if(_0x5ed142&&_0x5ed142[_0x00fc('0x6a')]){logger[_0x00fc('0xa')](_0x00fc('0x6b'),'Recording\x20is\x20enabled!');_0xcb122a[_0x00fc('0x6c')]=util[_0x00fc('0x10')](_0x00fc('0x6d'),_0x25f55f[_0x00fc('0x68')],_0xcb122a[_0x00fc('0x6e')],md5(_0xcb122a[_0x00fc('0x6e')]));}else{_0xcb122a['recordingURL']='';}return getUser(_0x25f55f,_0x2be2d7[_0x00fc('0x6f')])['then'](function(_0x29c900){_0xed762f=_0x29c900;logger[_0x00fc('0xa')](_0x00fc('0x70'),_0xed762f['id']);return getEndUser(_0x25f55f,_0xcb122a[_0x00fc('0x71')],_0xcb122a[_0x00fc('0x72')]);})['then'](function(_0x4e37ec){_0x1e562b=_0x4e37ec;logger[_0x00fc('0xa')](_0x00fc('0x73'),_0x1e562b[_0x00fc('0x25')]||_0x1e562b['LEADID']);return getCall(_0x25f55f,_0xed762f,_0x1e562b,_0x305f45,_0xcb122a,'Inbound');})['then'](function(_0x467811){if(_0x467811){logger[_0x00fc('0xa')]('The\x20Call\x20ID\x20is:',_0x467811['id']);logger[_0x00fc('0xa')](_0x00fc('0x6b'),_0x00fc('0x74'));emit(util['format']('user:%s',_0x2be2d7['name']),_0x00fc('0x75'),{'uri':util[_0x00fc('0x10')](_0x00fc('0x76'),_0x25f55f[_0x00fc('0x47')],_0x467811['id'])});}})[_0x00fc('0x77')](function(_0x54f58c){logger[_0x00fc('0x78')](_0x00fc('0x6b'),JSON[_0x00fc('0x42')](_0x54f58c));});};exports[_0x00fc('0xe')]=function(_0x1aad1b,_0x34d8fb,_0x39b0d7,_0x1bd669,_0x419eaa,_0x5ece6e,_0x376673){var _0x19f06c,_0x388b15;_0x5ece6e['host']=intUtil[_0x00fc('0x69')](_0x5ece6e['host']);_0x5ece6e[_0x00fc('0x68')]=intUtil[_0x00fc('0x69')](_0x5ece6e[_0x00fc('0x68')]);if(_0x376673&&_0x376673[_0x00fc('0x79')]&&_0x376673['recordingFormat']!==_0x00fc('0x7a')){logger[_0x00fc('0xa')]('[OUTBOUND]',_0x00fc('0x7b'));_0x34d8fb[_0x00fc('0x6c')]=util[_0x00fc('0x10')](_0x00fc('0x6d'),_0x5ece6e['serverUrl'],_0x34d8fb[_0x00fc('0x6e')],md5(_0x34d8fb[_0x00fc('0x6e')]));}return getUser(_0x5ece6e,_0x1bd669[_0x00fc('0x6f')])[_0x00fc('0x30')](function(_0x88a98a){_0x19f06c=_0x88a98a;logger['info'](_0x00fc('0x70'),_0x19f06c['id']);return getEndUser(_0x5ece6e,_0x34d8fb[_0x00fc('0x7c')],_0x34d8fb[_0x00fc('0x7d')]);})[_0x00fc('0x30')](function(_0x40ece4){_0x388b15=_0x40ece4;logger[_0x00fc('0xa')](_0x00fc('0x73'),_0x388b15[_0x00fc('0x25')]||_0x388b15[_0x00fc('0x26')]);return getCall(_0x5ece6e,_0x19f06c,_0x388b15,_0x39b0d7,_0x34d8fb,_0x00fc('0x7e'));})[_0x00fc('0x30')](function(_0x395731){if(_0x395731){logger['info'](_0x00fc('0x7f'),_0x395731['id']);logger[_0x00fc('0xa')](_0x00fc('0x80'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x00fc('0x81'),_0x1bd669[_0x00fc('0x63')]),'trigger:browser:url',{'uri':util[_0x00fc('0x10')](_0x00fc('0x76'),_0x5ece6e[_0x00fc('0x47')],_0x395731['id'])});}})[_0x00fc('0x77')](function(_0x36b8e7){logger[_0x00fc('0x78')]('[OUTBOUND]',JSON['stringify'](_0x36b8e7));});};exports[_0x00fc('0x1c')]=function(_0x15ad5b,_0x3793a1,_0x938ee6,_0x39ae80,_0x280827,_0x11111f){var _0x341ffc,_0x462d25;_0x11111f[_0x00fc('0x47')]=intUtil[_0x00fc('0x69')](_0x11111f[_0x00fc('0x47')]);_0x11111f[_0x00fc('0x68')]=intUtil[_0x00fc('0x69')](_0x11111f[_0x00fc('0x68')]);if(_0x280827&&_0x280827['monitor_format']){logger[_0x00fc('0xa')](_0x00fc('0x82'),_0x00fc('0x7b'));_0x3793a1[_0x00fc('0x6c')]=util[_0x00fc('0x10')](_0x00fc('0x6d'),_0x11111f[_0x00fc('0x68')],_0x3793a1['uniqueid'],md5(_0x3793a1[_0x00fc('0x6e')]));}else{_0x3793a1[_0x00fc('0x6c')]='';}return getUser(_0x11111f)[_0x00fc('0x30')](function(_0x4d17ab){_0x341ffc=_0x4d17ab;logger[_0x00fc('0xa')](_0x00fc('0x70'),_0x341ffc['id']);return getEndUser(_0x11111f,_0x3793a1['calleridname'],_0x3793a1[_0x00fc('0x72')]);})[_0x00fc('0x30')](function(_0x68c428){_0x462d25=_0x68c428;logger[_0x00fc('0xa')](_0x00fc('0x73'),_0x462d25[_0x00fc('0x25')]||_0x462d25[_0x00fc('0x26')]);return getCall(_0x11111f,_0x341ffc,_0x462d25,_0x938ee6,_0x3793a1,_0x00fc('0x83'));})[_0x00fc('0x30')](function(_0x914777){if(_0x914777){logger['info'](_0x00fc('0x7f'),_0x914777['id']);}})[_0x00fc('0x77')](function(_0x264149){logger['error'](_0x00fc('0x82'),JSON['stringify'](_0x264149));});}; \ 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 95ae0a0..fbcf391 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 _0x86a7=['request-promise','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','GET','data7','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','statusCode','body','catch','error','format','%s\x20%s\x20%s\x20[%s]:%s','message'];(function(_0x3518b6,_0x1d6005){var _0x55a221=function(_0x25ebfa){while(--_0x25ebfa){_0x3518b6['push'](_0x3518b6['shift']());}};_0x55a221(++_0x1d6005);}(_0x86a7,0x12c));var _0x786a=function(_0x39c12e,_0x585534){_0x39c12e=_0x39c12e-0x0;var _0x58dbf4=_0x86a7[_0x39c12e];return _0x58dbf4;};'use strict';var rp=require(_0x786a('0x0'));var util=require('util');var Mustache=require(_0x786a('0x1'));var logger=require(_0x786a('0x2'))(_0x786a('0x3'));exports[_0x786a('0x4')]=function(_0x5a2c7b,_0x56eec){var _0x5f5d6c={'method':_0x5a2c7b[_0x786a('0x5')][_0x786a('0x6')](),'uri':encodeURI(Mustache[_0x786a('0x7')](_0x5a2c7b[_0x786a('0x8')],_0x56eec)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5a2c7b[_0x786a('0x5')]['toUpperCase']()){case _0x786a('0x9'):_0x5f5d6c['qs']=_0x56eec;break;case'POST':_0x5f5d6c['body']=_0x5a2c7b[_0x786a('0xa')]?Mustache[_0x786a('0x7')](_0x5a2c7b[_0x786a('0xa')],_0x56eec):_0x56eec;break;}rp(_0x5f5d6c)['then'](function(_0x4cf933){logger[_0x786a('0xb')](util['format'](_0x786a('0xc'),_0x5a2c7b['data1'],_0x5a2c7b['data2'],_0x4cf933[_0x786a('0xd')],_0x4cf933[_0x786a('0xe')]));})[_0x786a('0xf')](function(_0x5a7056){logger[_0x786a('0x10')](util[_0x786a('0x11')](_0x786a('0x12'),_0x5a2c7b[_0x786a('0x5')],_0x5a2c7b[_0x786a('0x8')],_0x5a7056[_0x786a('0xd')],_0x5a7056['name'],_0x5a7056[_0x786a('0x13')]));});}; \ No newline at end of file +var _0xf5f1=['format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','error','%s\x20%s\x20%s\x20[%s]:%s','statusCode','name','message','request-promise','util','mustache','trigger','data1','toUpperCase','render','data2','POST','body','data7','info'];(function(_0x5afc7b,_0x4a4511){var _0x417c0c=function(_0x3750ec){while(--_0x3750ec){_0x5afc7b['push'](_0x5afc7b['shift']());}};_0x417c0c(++_0x4a4511);}(_0xf5f1,0x1e2));var _0x1f5f=function(_0x1e8484,_0x8d4f8e){_0x1e8484=_0x1e8484-0x0;var _0x1ac9fd=_0xf5f1[_0x1e8484];return _0x1ac9fd;};'use strict';var rp=require(_0x1f5f('0x0'));var util=require(_0x1f5f('0x1'));var Mustache=require(_0x1f5f('0x2'));var logger=require('../../../../config/logger')(_0x1f5f('0x3'));exports['exec']=function(_0x43c2be,_0xb27fae){var _0x6d404f={'method':_0x43c2be[_0x1f5f('0x4')][_0x1f5f('0x5')](),'uri':encodeURI(Mustache[_0x1f5f('0x6')](_0x43c2be[_0x1f5f('0x7')],_0xb27fae)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x43c2be['data1'][_0x1f5f('0x5')]()){case'GET':_0x6d404f['qs']=_0xb27fae;break;case _0x1f5f('0x8'):_0x6d404f[_0x1f5f('0x9')]=_0x43c2be[_0x1f5f('0xa')]?Mustache[_0x1f5f('0x6')](_0x43c2be[_0x1f5f('0xa')],_0xb27fae):_0xb27fae;break;}rp(_0x6d404f)['then'](function(_0x3edf9e){logger[_0x1f5f('0xb')](util[_0x1f5f('0xc')](_0x1f5f('0xd'),_0x43c2be[_0x1f5f('0x4')],_0x43c2be['data2'],_0x3edf9e['statusCode'],_0x3edf9e[_0x1f5f('0x9')]));})['catch'](function(_0xf177a3){logger[_0x1f5f('0xe')](util[_0x1f5f('0xc')](_0x1f5f('0xf'),_0x43c2be[_0x1f5f('0x4')],_0x43c2be[_0x1f5f('0x7')],_0xf177a3[_0x1f5f('0x10')],_0xf177a3[_0x1f5f('0x11')],_0xf177a3[_0x1f5f('0x12')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 5ae460d..6d52ab1 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 _0xd8ee=['debug','rpc','error','message','result','exports','jayson/promise','../../config/logger','routing','client','Request','request'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x1c6d8a,_0x4069eb){_0x1c6d8a=_0x1c6d8a-0x0;var _0x4396aa=_0xd8ee[_0x1c6d8a];return _0x4396aa;};'use strict';var jayson=require(_0xed8e('0x0'));var BPromise=require('bluebird');var logger=require(_0xed8e('0x1'))(_0xed8e('0x2'));var client=jayson[_0xed8e('0x3')]['http']({'port':0x2329});client[_0xed8e('0x4')]=function(_0x3db0fb,_0x3402ae){return new BPromise(function(_0x35aed7,_0x474f12){return client[_0xed8e('0x5')](_0x3db0fb,_0x3402ae)['then'](function(_0x3a030a){logger[_0xed8e('0x6')](_0xed8e('0x7'),_0xed8e('0x2'),_0x3db0fb,_0x3402ae,_0x3a030a);if(_0x3a030a[_0xed8e('0x8')]){logger[_0xed8e('0x8')](_0xed8e('0x7'),'routing',_0x3db0fb,_0x3a030a['error'][_0xed8e('0x9')],_0x3402ae);return _0x474f12(_0x3a030a['error']['message']);}else{return _0x35aed7(_0x3a030a[_0xed8e('0xa')]);}})['catch'](function(_0x7357ad){logger[_0xed8e('0x8')]('rpc',_0xed8e('0x2'),_0x3db0fb,_0x7357ad,_0x3402ae);return _0x474f12(_0x7357ad);});});};module[_0xed8e('0xb')]=client; \ No newline at end of file +var _0x50b9=['then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','../../config/logger','client','http','Request','request'];(function(_0x58836f,_0x5351e2){var _0x28f9b1=function(_0x30a6cc){while(--_0x30a6cc){_0x58836f['push'](_0x58836f['shift']());}};_0x28f9b1(++_0x5351e2);}(_0x50b9,0x171));var _0x950b=function(_0x3c95a3,_0x1159f1){_0x3c95a3=_0x3c95a3-0x0;var _0x57b25b=_0x50b9[_0x3c95a3];return _0x57b25b;};'use strict';var jayson=require(_0x950b('0x0'));var BPromise=require('bluebird');var logger=require(_0x950b('0x1'))('routing');var client=jayson[_0x950b('0x2')][_0x950b('0x3')]({'port':0x2329});client[_0x950b('0x4')]=function(_0x3f68be,_0x237b83){return new BPromise(function(_0x986b16,_0x23b70f){return client[_0x950b('0x5')](_0x3f68be,_0x237b83)[_0x950b('0x6')](function(_0x56ce3f){logger[_0x950b('0x7')](_0x950b('0x8'),_0x950b('0x9'),_0x3f68be,_0x237b83,_0x56ce3f);if(_0x56ce3f['error']){logger['error']('rpc',_0x950b('0x9'),_0x3f68be,_0x56ce3f[_0x950b('0xa')][_0x950b('0xb')],_0x237b83);return _0x23b70f(_0x56ce3f[_0x950b('0xa')][_0x950b('0xb')]);}else{return _0x986b16(_0x56ce3f[_0x950b('0xc')]);}})[_0x950b('0xd')](function(_0x585c89){logger[_0x950b('0xa')](_0x950b('0x8'),'routing',_0x3f68be,_0x585c89,_0x237b83);return _0x23b70f(_0x585c89);});});};module[_0x950b('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d44461d..820242a 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 _0xbe24=['listen','catch','log','./realtime','./lib/email','./rpc/mailAccount','resolve','then','initMailAccounts','refresh','mailAccounts'];(function(_0x3a7d3f,_0x8bc381){var _0x424e0c=function(_0x2e7b60){while(--_0x2e7b60){_0x3a7d3f['push'](_0x3a7d3f['shift']());}};_0x424e0c(++_0x8bc381);}(_0xbe24,0xd4));var _0x4be2=function(_0x4830e7,_0x33bdca){_0x4830e7=_0x4830e7-0x0;var _0x2ea197=_0xbe24[_0x4830e7];return _0x2ea197;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x4be2('0x0'));var EmailChannel=require(_0x4be2('0x1'));var mailAccount=require(_0x4be2('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x4be2('0x3')]()[_0x4be2('0x4')](mailAccount['getMailAccounts']())[_0x4be2('0x4')](realtime[_0x4be2('0x5')]())[_0x4be2('0x4')](function(){email[_0x4be2('0x6')](realtime[_0x4be2('0x7')]);return realtime;});}function main(){return server[_0x4be2('0x8')](realtime,email)[_0x4be2('0x4')](function(_0xc37f69){return initRealtime();})[_0x4be2('0x4')](function(_0x2f5f38){return setInterval(initRealtime,0x2710);})[_0x4be2('0x9')](function(_0x127e15){console[_0x4be2('0xa')](_0x127e15);});}main(); \ No newline at end of file +var _0x9489=['initMailAccounts','mailAccounts','listen','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','resolve','getMailAccounts','then'];(function(_0x42888d,_0x339d5a){var _0x4ed1d6=function(_0x22a35e){while(--_0x22a35e){_0x42888d['push'](_0x42888d['shift']());}};_0x4ed1d6(++_0x339d5a);}(_0x9489,0xdd));var _0x9948=function(_0x17c9b7,_0x2f6e5c){_0x17c9b7=_0x17c9b7-0x0;var _0x3b6b4a=_0x9489[_0x17c9b7];return _0x3b6b4a;};'use strict';var BPromise=require(_0x9948('0x0'));var server=require(_0x9948('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x9948('0x2'));var mailAccount=require(_0x9948('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x9948('0x4')]()['then'](mailAccount[_0x9948('0x5')]())[_0x9948('0x6')](realtime[_0x9948('0x7')]())[_0x9948('0x6')](function(){email['refresh'](realtime[_0x9948('0x8')]);return realtime;});}function main(){return server[_0x9948('0x9')](realtime,email)[_0x9948('0x6')](function(_0x210f53){return initRealtime();})[_0x9948('0x6')](function(_0x38583c){return setInterval(initRealtime,0x2710);})[_0x9948('0xa')](function(_0x31cdfe){console[_0x9948('0xb')](_0x31cdfe);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 5e4799f..7676fc8 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 _0x53ec=['email','defaults','redis','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','total','isNil','stringify','mailAccount:update','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','messageStatus','connected','messages','firstName','from','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment'];(function(_0xbd9e5d,_0x26c392){var _0x4f580c=function(_0x108136){while(--_0x108136){_0xbd9e5d['push'](_0xbd9e5d['shift']());}};_0x4f580c(++_0x26c392);}(_0x53ec,0x192));var _0xc53e=function(_0x113dd1,_0x15aaa1){_0x113dd1=_0x113dd1-0x0;var _0x1605e0=_0x53ec[_0x113dd1];return _0x1605e0;};'use strict';var _=require(_0xc53e('0x0'));var moment=require(_0xc53e('0x1'));var BPromise=require(_0xc53e('0x2'));var md5=require(_0xc53e('0x3'));var Redis=require(_0xc53e('0x4'));var config=require(_0xc53e('0x5'));var logger=require('../../../config/logger')(_0xc53e('0x6'));config['redis']=_[_0xc53e('0x7')](config[_0xc53e('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xc53e('0x9'))(new Redis(config['redis']));var EmailImap=require(_0xc53e('0xa'));var EmailSmtp=require(_0xc53e('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1616ac){logger[_0xc53e('0xc')](_0xc53e('0xd'));this[_0xc53e('0xe')]=_0x1616ac[_0xc53e('0xe')];this[_0xc53e('0xf')]={};this[_0xc53e('0x10')]=new EmailSmtp();}EmailChannel[_0xc53e('0x11')][_0xc53e('0x12')]=function(_0x4b7cfa){var _0x57e818=this[_0xc53e('0xe')][_0x4b7cfa];var _0x5a2da7={'id':_0x57e818['id'],'name':_0x57e818['name'],'key':_0x57e818[_0xc53e('0x13')],'active':_0x57e818[_0xc53e('0x14')],'Imap':{'status':_0x57e818[_0xc53e('0x15')][_0xc53e('0x16')],'messageStatus':_0x57e818['Imap']['messageStatus'],'total':_0x57e818[_0xc53e('0x15')][_0xc53e('0x17')]}};if(_[_0xc53e('0x18')](md5Accounts[_0x4b7cfa])){md5Accounts[_0x4b7cfa]={};}var _0x3d2e17=md5(JSON[_0xc53e('0x19')](_0x5a2da7));if(md5Accounts[_0x4b7cfa][_0xc53e('0x3')]!==_0x3d2e17){md5Accounts[_0x4b7cfa][_0xc53e('0x3')]=_0x3d2e17;io[_0xc53e('0x12')](_0xc53e('0x1a'),_0x5a2da7);}};EmailChannel[_0xc53e('0x11')]['refresh']=function(_0x8a522e){for(var _0x191567 in _0x8a522e){if(_0x8a522e[_0xc53e('0x1b')](_0x191567)){if(_0x8a522e[_0x191567][_0xc53e('0x15')]&&_0x8a522e[_0x191567][_0xc53e('0x14')]){var _0x270c78=_0x8a522e[_0x191567][_0xc53e('0x15')];if(!this[_0xc53e('0xf')][_0xc53e('0x1b')](_0x270c78['id'])){this['imapAccounts'][_0x270c78['id']]=new EmailImap(_0x270c78,_0x8a522e[_0x191567]['email']);this[_0xc53e('0xf')][_0x270c78['id']]['on'](_0xc53e('0x1c'),this[_0xc53e('0x1d')][_0xc53e('0x1e')](this,_0x191567));this[_0xc53e('0xf')][_0x270c78['id']]['on'](_0xc53e('0x6'),this[_0xc53e('0x1f')][_0xc53e('0x1e')](this,_0x191567));this[_0xc53e('0xf')][_0x270c78['id']]['on'](_0xc53e('0x20'),this[_0xc53e('0x21')][_0xc53e('0x1e')](this,_0x191567));this[_0xc53e('0xf')][_0x270c78['id']]['on']('error',this['handleImapError']['bind'](this,_0x191567));}}else{if(_[_0xc53e('0x18')](this[_0xc53e('0xe')][_0x191567][_0xc53e('0x15')])){this[_0xc53e('0xe')][_0x191567][_0xc53e('0x15')]={};}this['mailAccounts'][_0x191567]['Imap'][_0xc53e('0x16')]='disabled';this[_0xc53e('0xe')][_0x191567][_0xc53e('0x15')][_0xc53e('0x22')]='';this[_0xc53e('0x12')](_0x191567);}}}};EmailChannel[_0xc53e('0x11')]['handleImapBox']=function(_0x398e7a,_0x4b9f6a){if(this['mailAccounts'][_0x398e7a]){this['mailAccounts'][_0x398e7a][_0xc53e('0x15')]['status']=_0xc53e('0x23');this['mailAccounts'][_0x398e7a][_0xc53e('0x15')]['messageStatus']=_0x4b9f6a['name'];if(_0x4b9f6a[_0xc53e('0x24')]){this[_0xc53e('0xe')][_0x398e7a][_0xc53e('0x15')][_0xc53e('0x17')]=_0x4b9f6a[_0xc53e('0x24')][_0xc53e('0x17')];}return this[_0xc53e('0x12')](_0x398e7a);}};EmailChannel[_0xc53e('0x11')]['handleImapEmail']=function(_0x437893,_0x311835){logger[_0xc53e('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x311835[_0xc53e('0x25')],_0x311835['lastName'],_0x311835[_0xc53e('0x26')],_0x437893);if(this[_0xc53e('0xe')][_0x437893]){return mailAccount['notify'](_0x437893,_0x311835)['then'](function(_0x3cd8a1){if(_0x3cd8a1){logger[_0xc53e('0xc')](_0xc53e('0x27'));}})[_0xc53e('0x28')](function(_0x1b95c2){logger[_0xc53e('0x29')](_0xc53e('0x2a'),JSON[_0xc53e('0x19')](_0x1b95c2));});}};EmailChannel['prototype'][_0xc53e('0x21')]=function(_0x3bae8a){if(this[_0xc53e('0xe')][_0x3bae8a]&&this[_0xc53e('0xe')][_0x3bae8a][_0xc53e('0x15')]){if(this[_0xc53e('0xf')][this[_0xc53e('0xe')][_0x3bae8a][_0xc53e('0x15')]['id']]){delete this[_0xc53e('0xf')][this['mailAccounts'][_0x3bae8a][_0xc53e('0x15')]['id']];}this['mailAccounts'][_0x3bae8a][_0xc53e('0x15')][_0xc53e('0x2b')]=moment();this['emit'](_0x3bae8a);}};EmailChannel[_0xc53e('0x11')][_0xc53e('0x2c')]=function(_0x3254e9,_0x5ed90b){if(this[_0xc53e('0xe')][_0x3254e9]){this[_0xc53e('0xe')][_0x3254e9][_0xc53e('0x15')][_0xc53e('0x16')]=_0xc53e('0x29');this[_0xc53e('0xe')][_0x3254e9][_0xc53e('0x15')]['messageStatus']=_0x5ed90b;return this[_0xc53e('0x12')](_0x3254e9);}};EmailChannel[_0xc53e('0x11')][_0xc53e('0x2d')]=function(_0x5d35b0,_0x70b6c3){return this['smtp'][_0xc53e('0x2e')](_0x5d35b0,_0x70b6c3);};EmailChannel[_0xc53e('0x11')][_0xc53e('0x2f')]=function(_0xad1232){var _0x3036e7=this;if(this['mailAccounts'][_0xad1232['id']]){if(_[_0xc53e('0x18')](this[_0xc53e('0xe')][_0xad1232['id']]['Smtp'])){this['mailAccounts'][_0xad1232['id']]['Smtp']={};}this['mailAccounts'][_0xad1232['id']][_0xc53e('0x30')][_0xc53e('0x2b')]=moment();return new BPromise(function(_0x49bd2c,_0x460ee6){return _0x3036e7['smtp']['verify'](_0xad1232)['then'](function(_0x255794){_0x3036e7['mailAccounts'][_0xad1232['id']]['Smtp'][_0xc53e('0x16')]='verified';_0x3036e7[_0xc53e('0xe')][_0xad1232['id']][_0xc53e('0x30')]['messageStatus']='';_0x3036e7[_0xc53e('0x12')](_0xad1232['id']);_0x49bd2c(_0x255794);})[_0xc53e('0x28')](function(_0x509a04){_0x3036e7[_0xc53e('0xe')][_0xad1232['id']]['Smtp']['status']='error';_0x3036e7['mailAccounts'][_0xad1232['id']][_0xc53e('0x30')][_0xc53e('0x22')]=_0x509a04;_0x3036e7[_0xc53e('0x12')](_0xad1232['id']);_0x460ee6(_0x509a04);});});}return this['smtp'][_0xc53e('0x31')](_0xad1232);};module[_0xc53e('0x32')]=EmailChannel; \ No newline at end of file +var _0xd481=['isNil','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','Mail\x20accepted\x20from\x20routing','error','lastSync','sendMail','send','verifySmtp','Smtp','verified','verify','exports','lodash','bluebird','md5','../../../config/environment','../../../config/logger','email','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','handleImapError'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0xd481,0x1e4));var _0x1d48=function(_0x4196e0,_0x5a8027){_0x4196e0=_0x4196e0-0x0;var _0x255294=_0xd481[_0x4196e0];return _0x255294;};'use strict';var _=require(_0x1d48('0x0'));var moment=require('moment');var BPromise=require(_0x1d48('0x1'));var md5=require(_0x1d48('0x2'));var Redis=require('ioredis');var config=require(_0x1d48('0x3'));var logger=require(_0x1d48('0x4'))(_0x1d48('0x5'));config['redis']=_[_0x1d48('0x6')](config['redis'],{'host':_0x1d48('0x7'),'port':0x18eb});var io=require(_0x1d48('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x1d48('0x9'));var EmailSmtp=require(_0x1d48('0xa'));var mailAccount=require(_0x1d48('0xb'));var md5Accounts={};function EmailChannel(_0x27c383){logger[_0x1d48('0xc')](_0x1d48('0xd'));this[_0x1d48('0xe')]=_0x27c383[_0x1d48('0xe')];this[_0x1d48('0xf')]={};this[_0x1d48('0x10')]=new EmailSmtp();}EmailChannel[_0x1d48('0x11')][_0x1d48('0x12')]=function(_0x4dd9d3){var _0x32a47d=this[_0x1d48('0xe')][_0x4dd9d3];var _0xf54674={'id':_0x32a47d['id'],'name':_0x32a47d[_0x1d48('0x13')],'key':_0x32a47d[_0x1d48('0x14')],'active':_0x32a47d[_0x1d48('0x15')],'Imap':{'status':_0x32a47d[_0x1d48('0x16')][_0x1d48('0x17')],'messageStatus':_0x32a47d[_0x1d48('0x16')][_0x1d48('0x18')],'total':_0x32a47d['Imap'][_0x1d48('0x19')]}};if(_['isNil'](md5Accounts[_0x4dd9d3])){md5Accounts[_0x4dd9d3]={};}var _0x1c7f51=md5(JSON[_0x1d48('0x1a')](_0xf54674));if(md5Accounts[_0x4dd9d3][_0x1d48('0x2')]!==_0x1c7f51){md5Accounts[_0x4dd9d3][_0x1d48('0x2')]=_0x1c7f51;io['emit'](_0x1d48('0x1b'),_0xf54674);}};EmailChannel[_0x1d48('0x11')][_0x1d48('0x1c')]=function(_0x4d6bd0){for(var _0x1789af in _0x4d6bd0){if(_0x4d6bd0[_0x1d48('0x1d')](_0x1789af)){if(_0x4d6bd0[_0x1789af][_0x1d48('0x16')]&&_0x4d6bd0[_0x1789af][_0x1d48('0x15')]){var _0x9b12b=_0x4d6bd0[_0x1789af][_0x1d48('0x16')];if(!this[_0x1d48('0xf')][_0x1d48('0x1d')](_0x9b12b['id'])){this[_0x1d48('0xf')][_0x9b12b['id']]=new EmailImap(_0x9b12b,_0x4d6bd0[_0x1789af]['email']);this['imapAccounts'][_0x9b12b['id']]['on'](_0x1d48('0x1e'),this[_0x1d48('0x1f')][_0x1d48('0x20')](this,_0x1789af));this[_0x1d48('0xf')][_0x9b12b['id']]['on'](_0x1d48('0x5'),this[_0x1d48('0x21')][_0x1d48('0x20')](this,_0x1789af));this[_0x1d48('0xf')][_0x9b12b['id']]['on']('end',this[_0x1d48('0x22')][_0x1d48('0x20')](this,_0x1789af));this['imapAccounts'][_0x9b12b['id']]['on']('error',this[_0x1d48('0x23')][_0x1d48('0x20')](this,_0x1789af));}}else{if(_[_0x1d48('0x24')](this[_0x1d48('0xe')][_0x1789af][_0x1d48('0x16')])){this[_0x1d48('0xe')][_0x1789af][_0x1d48('0x16')]={};}this[_0x1d48('0xe')][_0x1789af][_0x1d48('0x16')][_0x1d48('0x17')]='disabled';this['mailAccounts'][_0x1789af][_0x1d48('0x16')][_0x1d48('0x18')]='';this[_0x1d48('0x12')](_0x1789af);}}}};EmailChannel[_0x1d48('0x11')][_0x1d48('0x1f')]=function(_0x7631b4,_0x54dc83){if(this['mailAccounts'][_0x7631b4]){this[_0x1d48('0xe')][_0x7631b4][_0x1d48('0x16')]['status']=_0x1d48('0x25');this[_0x1d48('0xe')][_0x7631b4][_0x1d48('0x16')][_0x1d48('0x18')]=_0x54dc83['name'];if(_0x54dc83[_0x1d48('0x26')]){this[_0x1d48('0xe')][_0x7631b4][_0x1d48('0x16')][_0x1d48('0x19')]=_0x54dc83[_0x1d48('0x26')]['total'];}return this[_0x1d48('0x12')](_0x7631b4);}};EmailChannel[_0x1d48('0x11')][_0x1d48('0x21')]=function(_0x25408e,_0x3cae45){logger['info'](_0x1d48('0x27'),_0x3cae45[_0x1d48('0x28')],_0x3cae45[_0x1d48('0x29')],_0x3cae45['from'],_0x25408e);if(this[_0x1d48('0xe')][_0x25408e]){return mailAccount['notify'](_0x25408e,_0x3cae45)['then'](function(_0x3abd42){if(_0x3abd42){logger[_0x1d48('0xc')](_0x1d48('0x2a'));}})['catch'](function(_0xdaa915){logger[_0x1d48('0x2b')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x1d48('0x1a')](_0xdaa915));});}};EmailChannel[_0x1d48('0x11')][_0x1d48('0x22')]=function(_0x4e5286){if(this[_0x1d48('0xe')][_0x4e5286]&&this['mailAccounts'][_0x4e5286][_0x1d48('0x16')]){if(this[_0x1d48('0xf')][this[_0x1d48('0xe')][_0x4e5286]['Imap']['id']]){delete this['imapAccounts'][this[_0x1d48('0xe')][_0x4e5286][_0x1d48('0x16')]['id']];}this[_0x1d48('0xe')][_0x4e5286][_0x1d48('0x16')][_0x1d48('0x2c')]=moment();this[_0x1d48('0x12')](_0x4e5286);}};EmailChannel[_0x1d48('0x11')][_0x1d48('0x23')]=function(_0x216438,_0x884d8){if(this[_0x1d48('0xe')][_0x216438]){this[_0x1d48('0xe')][_0x216438][_0x1d48('0x16')][_0x1d48('0x17')]=_0x1d48('0x2b');this[_0x1d48('0xe')][_0x216438][_0x1d48('0x16')][_0x1d48('0x18')]=_0x884d8;return this[_0x1d48('0x12')](_0x216438);}};EmailChannel[_0x1d48('0x11')][_0x1d48('0x2d')]=function(_0x3ad19b,_0x33010f){return this[_0x1d48('0x10')][_0x1d48('0x2e')](_0x3ad19b,_0x33010f);};EmailChannel[_0x1d48('0x11')][_0x1d48('0x2f')]=function(_0x23f638){var _0x5574ff=this;if(this[_0x1d48('0xe')][_0x23f638['id']]){if(_['isNil'](this[_0x1d48('0xe')][_0x23f638['id']][_0x1d48('0x30')])){this['mailAccounts'][_0x23f638['id']][_0x1d48('0x30')]={};}this[_0x1d48('0xe')][_0x23f638['id']][_0x1d48('0x30')][_0x1d48('0x2c')]=moment();return new BPromise(function(_0x11824b,_0x40b0ca){return _0x5574ff['smtp']['verify'](_0x23f638)['then'](function(_0x33021e){_0x5574ff[_0x1d48('0xe')][_0x23f638['id']]['Smtp'][_0x1d48('0x17')]=_0x1d48('0x31');_0x5574ff['mailAccounts'][_0x23f638['id']][_0x1d48('0x30')][_0x1d48('0x18')]='';_0x5574ff[_0x1d48('0x12')](_0x23f638['id']);_0x11824b(_0x33021e);})['catch'](function(_0x575e98){_0x5574ff[_0x1d48('0xe')][_0x23f638['id']][_0x1d48('0x30')][_0x1d48('0x17')]='error';_0x5574ff[_0x1d48('0xe')][_0x23f638['id']]['Smtp'][_0x1d48('0x18')]=_0x575e98;_0x5574ff[_0x1d48('0x12')](_0x23f638['id']);_0x40b0ca(_0x575e98);});});}return this[_0x1d48('0x10')][_0x1d48('0x32')](_0x23f638);};module[_0x1d48('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index f96d288..a279d46 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 _0xe844=['events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','end','handleEnd','bind','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','host','port','tls','required','password','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','textCode','upperFirst','exports','path','util','imap','mailparser','iconv','Iconv'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0xe844,0xba));var _0x4e84=function(_0x5e462e,_0x5b9aa7){_0x5e462e=_0x5e462e-0x0;var _0x4ce663=_0xe844[_0x5e462e];return _0x4ce663;};'use strict';var fs=require('fs');var path=require(_0x4e84('0x0'));var util=require(_0x4e84('0x1'));var Imap=require(_0x4e84('0x2'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x4e84('0x3'))['simpleParser'];var Iconv=require(_0x4e84('0x4'))[_0x4e84('0x5')];var EventEmitter=require(_0x4e84('0x6'))[_0x4e84('0x7')];var utils=require('./utils');var logger=require(_0x4e84('0x8'))(_0x4e84('0x9'));function EmailImap(_0x19a679,_0x41d6b0){this[_0x4e84('0xa')]=_0x4e84('0xb');this[_0x4e84('0xc')]=this[_0x4e84('0xd')](_0x19a679,_0x41d6b0);this[_0x4e84('0x2')]=new Imap(this['account']);this[_0x4e84('0x2')][_0x4e84('0xe')](_0x4e84('0xf'),this[_0x4e84('0x10')]['bind'](this));this[_0x4e84('0x2')][_0x4e84('0xe')](_0x4e84('0x11'),this[_0x4e84('0x12')][_0x4e84('0x13')](this));this[_0x4e84('0x2')]['on']('error',this[_0x4e84('0x14')][_0x4e84('0x13')](this));this[_0x4e84('0x2')][_0x4e84('0x15')]();}util[_0x4e84('0x16')](EmailImap,EventEmitter);EmailImap[_0x4e84('0x17')][_0x4e84('0xd')]=function(_0x354062,_0x96befa){var _0x4b5081={'connTimeout':_0x354062[_0x4e84('0x18')]?_0x354062['connTimeout']*0x3e8:0x2710,'authTimeout':_0x354062[_0x4e84('0x19')]?_0x354062[_0x4e84('0x19')]*0x3e8:0x1388};if(_[_0x4e84('0x1a')](_0x354062[_0x4e84('0x1b')])){if(_0x354062[_0x4e84('0x1c')]){_0x4b5081['user']=_0x354062[_0x4e84('0x1d')];_0x4b5081['password']=_0x354062['password'];}_0x4b5081[_0x4e84('0x1e')]=_0x354062[_0x4e84('0x1e')];_0x4b5081[_0x4e84('0x1f')]=_0x354062[_0x4e84('0x1f')]||0x3e1;if(_0x354062[_0x4e84('0x20')]){_0x4b5081[_0x4e84('0x20')]=!![];}else{_0x4b5081[_0x4e84('0x20')]=![];_0x4b5081['autotls']=_0x4e84('0x21');}}else{_0x4b5081[_0x4e84('0x1d')]=_0x354062[_0x4e84('0x1d')];_0x4b5081[_0x4e84('0x22')]=_0x354062[_0x4e84('0x22')];_0x4b5081[_0x4e84('0x1e')]=utils[_0x4e84('0x23')](_0x354062[_0x4e84('0x1b')]);_0x4b5081['port']=0x3e1;_0x4b5081['tls']=!![];}_0x4b5081[_0x4e84('0x9')]=_0x96befa||_0x354062[_0x4e84('0x1d')]||_0x4e84('0x24');return _0x4b5081;};EmailImap[_0x4e84('0x17')][_0x4e84('0x10')]=function(){this[_0x4e84('0x2')][_0x4e84('0x25')](this['mailbox'],![],this[_0x4e84('0x26')][_0x4e84('0x13')](this));};EmailImap[_0x4e84('0x17')][_0x4e84('0x26')]=function(_0x3bbc7d,_0x5fb1f5){if(_0x3bbc7d){this['handleError'](_0x3bbc7d,!![]);}else{this[_0x4e84('0x27')](_0x4e84('0x28'),_0x5fb1f5);this[_0x4e84('0x29')]();}};EmailImap['prototype'][_0x4e84('0x2a')]=function(_0x49dcd4){if(_0x49dcd4){this[_0x4e84('0x14')](_0x49dcd4,!![]);}else{this[_0x4e84('0x2')][_0x4e84('0x11')]();}};EmailImap[_0x4e84('0x17')][_0x4e84('0x29')]=function(){this[_0x4e84('0x2')][_0x4e84('0x2b')]([_0x4e84('0x2c')],this[_0x4e84('0x2d')][_0x4e84('0x13')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x152e00,_0x45a84c){if(_0x152e00){this[_0x4e84('0x14')](_0x152e00,!![]);}else{if(_0x45a84c[_0x4e84('0x2e')]){try{var _0x12a484=this[_0x4e84('0x2')][_0x4e84('0x2f')](_0x45a84c,{'bodies':'','markSeen':!![]});_0x12a484['on'](_0x4e84('0x30'),this[_0x4e84('0x31')][_0x4e84('0x13')](this));_0x12a484[_0x4e84('0xe')](_0x4e84('0x32'),this[_0x4e84('0x33')]['bind'](this));_0x12a484[_0x4e84('0xe')]('end',this[_0x4e84('0x34')][_0x4e84('0x13')](this));}catch(_0xf7e904){logger['error'](_0xf7e904);}}else{this[_0x4e84('0x2')][_0x4e84('0x35')](!![],this[_0x4e84('0x2a')][_0x4e84('0x13')](this));}}};EmailImap[_0x4e84('0x17')][_0x4e84('0x31')]=function(_0x553537,_0x4f453b){_0x553537['on'](_0x4e84('0x36'),this[_0x4e84('0x37')]['bind'](this));_0x553537[_0x4e84('0xe')](_0x4e84('0x38'),this[_0x4e84('0x39')]['bind'](this));_0x553537['once'](_0x4e84('0x11'),this[_0x4e84('0x3a')]['bind'](this));};EmailImap['prototype'][_0x4e84('0x37')]=function(_0x317f52,_0x5e1264){simpleParser(_0x317f52,{'Iconv':Iconv},this[_0x4e84('0x3b')][_0x4e84('0x13')](this));};EmailImap['prototype'][_0x4e84('0x39')]=function(_0x314311){};EmailImap[_0x4e84('0x17')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0x4e84('0x3b')]=function(_0xd4511e,_0x1ee73e){if(_0xd4511e){logger['error'](_0xd4511e);}else{var _0x1d0acc=this;utils[_0x4e84('0x3c')](this[_0x4e84('0xc')],_0x1ee73e,function(_0x1f6f71){_0x1d0acc[_0x4e84('0x27')]('email',_0x1f6f71);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x4e84('0x2')]['closeBox'](!![],this['handleCloseBox'][_0x4e84('0x13')](this));};EmailImap['prototype']['handleFetchError']=function(_0x1bd61){this[_0x4e84('0x14')](_0x1bd61);this['imap'][_0x4e84('0x35')](!![],this[_0x4e84('0x2a')][_0x4e84('0x13')](this));};EmailImap[_0x4e84('0x17')][_0x4e84('0x12')]=function(){this[_0x4e84('0x27')](_0x4e84('0x11'));};EmailImap['prototype']['handleError']=function(_0x3b5ae2,_0x46ac50){logger[_0x4e84('0x32')](_0x4e84('0x14'),this[_0x4e84('0xc')][_0x4e84('0x9')],JSON['stringify'](_0x3b5ae2));var _0x44df6c='';if(_0x3b5ae2){if(_0x3b5ae2[_0x4e84('0x3d')]){_0x44df6c=_0x3b5ae2[_0x4e84('0x3d')];}else{for(var _0x12994f in _0x3b5ae2){if(_0x3b5ae2['hasOwnProperty'](_0x12994f)){_0x44df6c+=_[_0x4e84('0x3e')](_0x12994f)+':\x20'+_0x3b5ae2[_0x12994f]+'\x0a';}}}}if(_0x46ac50){this['imap'][_0x4e84('0x11')]();}else{this[_0x4e84('0x27')](_0x4e84('0x32'),_0x44df6c);this[_0x4e84('0x27')](_0x4e84('0x11'));}};module[_0x4e84('0x3f')]=EmailImap; \ No newline at end of file +var _0x1094=['handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','closeBox','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleFetchEnd','stringify','hasOwnProperty','exports','path','util','lodash','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','handleReady','once','end','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','password','host','port','tls','required','user','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN'];(function(_0x1071ef,_0x2176b8){var _0x42bb55=function(_0x2e5dbf){while(--_0x2e5dbf){_0x1071ef['push'](_0x1071ef['shift']());}};_0x42bb55(++_0x2176b8);}(_0x1094,0x143));var _0x4109=function(_0x38eb22,_0x458a8c){_0x38eb22=_0x38eb22-0x0;var _0x49553e=_0x1094[_0x38eb22];return _0x49553e;};'use strict';var fs=require('fs');var path=require(_0x4109('0x0'));var util=require(_0x4109('0x1'));var Imap=require('imap');var _=require(_0x4109('0x2'));var rs=require('randomstring');var simpleParser=require(_0x4109('0x3'))[_0x4109('0x4')];var Iconv=require(_0x4109('0x5'))[_0x4109('0x6')];var EventEmitter=require(_0x4109('0x7'))['EventEmitter'];var utils=require(_0x4109('0x8'));var logger=require(_0x4109('0x9'))(_0x4109('0xa'));function EmailImap(_0x36c3e9,_0xd2df16){this[_0x4109('0xb')]='INBOX';this[_0x4109('0xc')]=this[_0x4109('0xd')](_0x36c3e9,_0xd2df16);this[_0x4109('0xe')]=new Imap(this[_0x4109('0xc')]);this[_0x4109('0xe')]['once']('ready',this[_0x4109('0xf')]['bind'](this));this[_0x4109('0xe')][_0x4109('0x10')](_0x4109('0x11'),this['handleEnd'][_0x4109('0x12')](this));this[_0x4109('0xe')]['on'](_0x4109('0x13'),this[_0x4109('0x14')][_0x4109('0x12')](this));this['imap'][_0x4109('0x15')]();}util[_0x4109('0x16')](EmailImap,EventEmitter);EmailImap[_0x4109('0x17')][_0x4109('0xd')]=function(_0x4a13fc,_0x5c2436){var _0x10f245={'connTimeout':_0x4a13fc[_0x4109('0x18')]?_0x4a13fc[_0x4109('0x18')]*0x3e8:0x2710,'authTimeout':_0x4a13fc[_0x4109('0x19')]?_0x4a13fc[_0x4109('0x19')]*0x3e8:0x1388};if(_[_0x4109('0x1a')](_0x4a13fc[_0x4109('0x1b')])){if(_0x4a13fc[_0x4109('0x1c')]){_0x10f245['user']=_0x4a13fc['user'];_0x10f245[_0x4109('0x1d')]=_0x4a13fc[_0x4109('0x1d')];}_0x10f245[_0x4109('0x1e')]=_0x4a13fc[_0x4109('0x1e')];_0x10f245[_0x4109('0x1f')]=_0x4a13fc[_0x4109('0x1f')]||0x3e1;if(_0x4a13fc[_0x4109('0x20')]){_0x10f245[_0x4109('0x20')]=!![];}else{_0x10f245[_0x4109('0x20')]=![];_0x10f245['autotls']=_0x4109('0x21');}}else{_0x10f245[_0x4109('0x22')]=_0x4a13fc['user'];_0x10f245[_0x4109('0x1d')]=_0x4a13fc[_0x4109('0x1d')];_0x10f245['host']=utils['getHost'](_0x4a13fc[_0x4109('0x1b')]);_0x10f245['port']=0x3e1;_0x10f245[_0x4109('0x20')]=!![];}_0x10f245[_0x4109('0xa')]=_0x5c2436||_0x4a13fc[_0x4109('0x22')]||_0x4109('0x23');return _0x10f245;};EmailImap['prototype'][_0x4109('0xf')]=function(){this[_0x4109('0xe')][_0x4109('0x24')](this['mailbox'],![],this[_0x4109('0x25')][_0x4109('0x12')](this));};EmailImap[_0x4109('0x17')]['handleOpenBox']=function(_0x5e397f,_0x54d82d){if(_0x5e397f){this[_0x4109('0x14')](_0x5e397f,!![]);}else{this[_0x4109('0x26')](_0x4109('0x27'),_0x54d82d);this[_0x4109('0x28')]();}};EmailImap[_0x4109('0x17')]['handleCloseBox']=function(_0x2910cd){if(_0x2910cd){this[_0x4109('0x14')](_0x2910cd,!![]);}else{this['imap'][_0x4109('0x11')]();}};EmailImap['prototype'][_0x4109('0x28')]=function(){this[_0x4109('0xe')][_0x4109('0x29')]([_0x4109('0x2a')],this[_0x4109('0x2b')]['bind'](this));};EmailImap[_0x4109('0x17')]['handleReadUnseen']=function(_0x1f48fa,_0x2a26bb){if(_0x1f48fa){this[_0x4109('0x14')](_0x1f48fa,!![]);}else{if(_0x2a26bb[_0x4109('0x2c')]){try{var _0x358a20=this[_0x4109('0xe')][_0x4109('0x2d')](_0x2a26bb,{'bodies':'','markSeen':!![]});_0x358a20['on'](_0x4109('0x2e'),this[_0x4109('0x2f')][_0x4109('0x12')](this));_0x358a20[_0x4109('0x10')](_0x4109('0x13'),this[_0x4109('0x30')][_0x4109('0x12')](this));_0x358a20[_0x4109('0x10')](_0x4109('0x11'),this['handleFetchEnd'][_0x4109('0x12')](this));}catch(_0x263c4e){logger[_0x4109('0x13')](_0x263c4e);}}else{this[_0x4109('0xe')][_0x4109('0x31')](!![],this[_0x4109('0x32')]['bind'](this));}}};EmailImap['prototype'][_0x4109('0x2f')]=function(_0x38fc75,_0x63b760){_0x38fc75['on'](_0x4109('0x33'),this['handleMessageBody'][_0x4109('0x12')](this));_0x38fc75[_0x4109('0x10')](_0x4109('0x34'),this[_0x4109('0x35')][_0x4109('0x12')](this));_0x38fc75[_0x4109('0x10')]('end',this[_0x4109('0x36')]['bind'](this));};EmailImap[_0x4109('0x17')][_0x4109('0x37')]=function(_0x5dd20c,_0x301867){simpleParser(_0x5dd20c,{'Iconv':Iconv},this[_0x4109('0x38')]['bind'](this));};EmailImap['prototype'][_0x4109('0x35')]=function(_0x4d21d7){};EmailImap[_0x4109('0x17')]['handleMessageEnd']=function(){};EmailImap[_0x4109('0x17')][_0x4109('0x38')]=function(_0x182cc7,_0x4134b6){if(_0x182cc7){logger['error'](_0x182cc7);}else{var _0x57c08c=this;utils['parser'](this[_0x4109('0xc')],_0x4134b6,function(_0xbb64ba){_0x57c08c[_0x4109('0x26')](_0x4109('0xa'),_0xbb64ba);});}};EmailImap[_0x4109('0x17')][_0x4109('0x39')]=function(){this[_0x4109('0xe')][_0x4109('0x31')](!![],this[_0x4109('0x32')][_0x4109('0x12')](this));};EmailImap[_0x4109('0x17')][_0x4109('0x30')]=function(_0xbd914e){this[_0x4109('0x14')](_0xbd914e);this[_0x4109('0xe')][_0x4109('0x31')](!![],this[_0x4109('0x32')][_0x4109('0x12')](this));};EmailImap[_0x4109('0x17')]['handleEnd']=function(){this[_0x4109('0x26')](_0x4109('0x11'));};EmailImap['prototype']['handleError']=function(_0x4d8a10,_0x17e854){logger[_0x4109('0x13')](_0x4109('0x14'),this[_0x4109('0xc')][_0x4109('0xa')],JSON[_0x4109('0x3a')](_0x4d8a10));var _0x88be51='';if(_0x4d8a10){if(_0x4d8a10['textCode']){_0x88be51=_0x4d8a10['textCode'];}else{for(var _0x532556 in _0x4d8a10){if(_0x4d8a10[_0x4109('0x3b')](_0x532556)){_0x88be51+=_['upperFirst'](_0x532556)+':\x20'+_0x4d8a10[_0x532556]+'\x0a';}}}}if(_0x17e854){this[_0x4109('0xe')]['end']();}else{this[_0x4109('0x26')](_0x4109('0x13'),_0x88be51);this[_0x4109('0x26')](_0x4109('0x11'));}};module[_0x4109('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 47f44ff..02b82fe 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 _0xb8a3=['verify','exports','bluebird','nodemailer-plugin-inline-base64','send','use','compile','sendMail','toString','prototype','createTransport'];(function(_0x1f92ad,_0x288ed1){var _0x196d1f=function(_0xa90eb4){while(--_0xa90eb4){_0x1f92ad['push'](_0x1f92ad['shift']());}};_0x196d1f(++_0x288ed1);}(_0xb8a3,0x1f1));var _0x3b8a=function(_0x222481,_0x2f3df6){_0x222481=_0x222481-0x0;var _0x227fb4=_0xb8a3[_0x222481];return _0x227fb4;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x3b8a('0x0'));var inlineBase64=require(_0x3b8a('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x3b8a('0x2')]=function(_0x44028c,_0x410734){return new BPromise(function(_0x401e5c,_0x24a877){var _0x4ad566=nodemailer['createTransport'](_0x44028c);_0x4ad566[_0x3b8a('0x3')](_0x3b8a('0x4'),inlineBase64());_0x4ad566[_0x3b8a('0x5')](_0x410734,function(_0x2aa519,_0x49b682){if(_0x2aa519){_0x24a877(_0x2aa519[_0x3b8a('0x6')]());}else{_0x401e5c(_0x49b682);}});});};EmailSmtp[_0x3b8a('0x7')]['verify']=function(_0x530457){return new BPromise(function(_0x18768d,_0x2f023e){var _0x3daf90=nodemailer[_0x3b8a('0x8')](_0x530457);_0x3daf90[_0x3b8a('0x9')](function(_0x34592c,_0x333eeb){if(_0x34592c){_0x2f023e(_0x34592c[_0x3b8a('0x6')]());}else{if(_0x333eeb){_0x18768d(_0x333eeb);}else{_0x2f023e('Not\x20verifired');}}});});};module[_0x3b8a('0xa')]=EmailSmtp; \ No newline at end of file +var _0xa931=['use','compile','verify','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x3d5f4b,_0x448d65){var _0x3a4a08=function(_0x4c7b4f){while(--_0x4c7b4f){_0x3d5f4b['push'](_0x3d5f4b['shift']());}};_0x3a4a08(++_0x448d65);}(_0xa931,0x1d0));var _0x1a93=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa931[_0x2c91e9];return _0x13f0ff;};'use strict';var nodemailer=require(_0x1a93('0x0'));var BPromise=require(_0x1a93('0x1'));var inlineBase64=require(_0x1a93('0x2'));function EmailSmtp(){}EmailSmtp[_0x1a93('0x3')][_0x1a93('0x4')]=function(_0x587274,_0x37651c){return new BPromise(function(_0x4d0d74,_0x359ac5){var _0xae30b7=nodemailer[_0x1a93('0x5')](_0x587274);_0xae30b7[_0x1a93('0x6')](_0x1a93('0x7'),inlineBase64());_0xae30b7['sendMail'](_0x37651c,function(_0xe1f493,_0x5c9273){if(_0xe1f493){_0x359ac5(_0xe1f493['toString']());}else{_0x4d0d74(_0x5c9273);}});});};EmailSmtp[_0x1a93('0x3')]['verify']=function(_0x3fb1de){return new BPromise(function(_0x1fe056,_0xbf370c){var _0x1a0a9e=nodemailer[_0x1a93('0x5')](_0x3fb1de);_0x1a0a9e[_0x1a93('0x8')](function(_0x388c9b,_0x164cef){if(_0x388c9b){_0xbf370c(_0x388c9b['toString']());}else{if(_0x164cef){_0x1fe056(_0x164cef);}else{_0xbf370c(_0x1a93('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index c60a40a..6026d9b 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 _0x3396=['util','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','length','join','split','pop','isEmpty','html','test','body','textAsHtml','replace','message','originCc','includes','originTo','bcc','attachments','attachment','filename','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','push','contentType','parser','from','subject','messageId','inReplyTo','date','filter','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x3396,0x17d));var _0x6339=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3396[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x6339('0x0'));var moment=require(_0x6339('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x6339('0x2'));var util=require(_0x6339('0x3'));var tnef=require('node-tnef');var logger=require(_0x6339('0x4'))(_0x6339('0x5'));var config=require(_0x6339('0x6'));function getAddress(_0x26d847){var _0x26ff49=_[_0x6339('0x7')](_0x26d847[_0x6339('0x8')]);return _0x26ff49&&_0x26ff49[_0x6339('0x9')]?_0x26ff49[_0x6339('0x9')]:'anonymous'+random[_0x6339('0xa')](0x6)+_0x6339('0xb');}function getFirstName(_0x1b009c){var _0xda783=_[_0x6339('0x7')](_0x1b009c['value']);if(_0xda783&&_0xda783['name']){var _0x88de32=_0xda783[_0x6339('0xc')]['split'](/\s+/);return _0x88de32[_0x6339('0xd')]?_0x88de32['slice'](0x0,-0x1)[_0x6339('0xe')]('\x20'):_0xda783[_0x6339('0xc')];}return'Anonymous';}function getLastName(_0xb7aedb){var _0x46b9ab=_['head'](_0xb7aedb[_0x6339('0x8')]);if(_0x46b9ab&&_0x46b9ab[_0x6339('0xc')]){var _0x2a68c3=_0x46b9ab[_0x6339('0xc')][_0x6339('0xf')](/\s+/);return _0x2a68c3[_0x6339('0xd')]>0x1?_0x2a68c3[_0x6339('0x10')]():'';}return'';}function getMails(_0x532b67,_0x1c54e7){var _0x48de3e='';for(var _0x2d0c85=0x0;_0x2d0c85<_0x1c54e7[_0x6339('0x8')]['length'];_0x2d0c85+=0x1){if(_0x1c54e7['value'][_0x2d0c85][_0x6339('0x9')]!==_0x532b67){if(!_[_0x6339('0x11')](_0x48de3e)){_0x48de3e+=',';}_0x48de3e+=_0x1c54e7[_0x6339('0x8')][_0x2d0c85][_0x6339('0xc')]||_0x1c54e7[_0x6339('0x8')][_0x2d0c85]['address']||'';_0x48de3e+='\x20<';_0x48de3e+=_0x1c54e7[_0x6339('0x8')][_0x2d0c85][_0x6339('0x9')]?_0x1c54e7[_0x6339('0x8')][_0x2d0c85]['address']:'anonymous'+random['generate'](0x6)+_0x6339('0xb');_0x48de3e+='>';}}return _0x48de3e;}function parseEmail(_0xd74f90,_0x1fc7bb,_0x510d67){if(_0x1fc7bb[_0x6339('0x12')]){var _0x3e88c0=/)<[^<]*)*<\/script>/gi;while(_0x3e88c0[_0x6339('0x13')](_0x1fc7bb[_0x6339('0x12')])){_0x1fc7bb[_0x6339('0x12')]=_0x1fc7bb[_0x6339('0x12')]['replace'](_0x3e88c0,'');}_0x510d67[_0x6339('0x14')]=_0x1fc7bb['html'];}else{_0x510d67[_0x6339('0x14')]=_0x1fc7bb[_0x6339('0x15')];}if(_0x510d67[_0x6339('0x14')]){_0x510d67[_0x6339('0x14')]=_0x510d67[_0x6339('0x14')][_0x6339('0x16')](/0x1?_0x5a56b9['pop']():'';}return'';}function getMails(_0x5dea33,_0x1421f1){var _0x43a760='';for(var _0x305b14=0x0;_0x305b14<_0x1421f1[_0xd6cf('0x6')][_0xd6cf('0xf')];_0x305b14+=0x1){if(_0x1421f1[_0xd6cf('0x6')][_0x305b14][_0xd6cf('0x7')]!==_0x5dea33){if(!_[_0xd6cf('0x10')](_0x43a760)){_0x43a760+=',';}_0x43a760+=_0x1421f1[_0xd6cf('0x6')][_0x305b14]['name']||_0x1421f1['value'][_0x305b14][_0xd6cf('0x7')]||'';_0x43a760+='\x20<';_0x43a760+=_0x1421f1[_0xd6cf('0x6')][_0x305b14]['address']?_0x1421f1[_0xd6cf('0x6')][_0x305b14]['address']:_0xd6cf('0x8')+random[_0xd6cf('0x11')](0x6)+_0xd6cf('0x9');_0x43a760+='>';}}return _0x43a760;}function parseEmail(_0x3d06c6,_0x4be8fc,_0xf5675b){if(_0x4be8fc['html']){var _0x309d36=/)<[^<]*)*<\/script>/gi;while(_0x309d36[_0xd6cf('0x12')](_0x4be8fc['html'])){_0x4be8fc[_0xd6cf('0x13')]=_0x4be8fc[_0xd6cf('0x13')]['replace'](_0x309d36,'');}_0xf5675b['body']=_0x4be8fc[_0xd6cf('0x13')];}else{_0xf5675b[_0xd6cf('0x14')]=_0x4be8fc[_0xd6cf('0x15')];}if(_0xf5675b[_0xd6cf('0x14')]){_0xf5675b[_0xd6cf('0x14')]=_0xf5675b['body'][_0xd6cf('0x16')](/Empty\x20message

';if(_0x37468f[_0xd6cf('0x36')]){for(var _0x10b60c=0x0;_0x10b60c<_0x37468f['Attachments'][_0xd6cf('0xf')];_0x10b60c++){var _0x192058=_0x37468f[_0xd6cf('0x36')][_0x10b60c];_0x17b7aa[_0xd6cf('0x18')]['attachments']['push']({'filename':_0x192058[_0xd6cf('0x37')],'content':new Buffer(_0x192058[_0xd6cf('0x38')])});}}}_0x19c65f(parseEmail(_0x5b5973,_0x53a2ee,_0x17b7aa));});}else{_0x53a2ee['html']='

Empty\x20message

';_0x19c65f(parseEmail(_0x5b5973,_0x53a2ee,_0x17b7aa));}}else{_0x19c65f(parseEmail(_0x5b5973,_0x53a2ee,_0x17b7aa));}};exports[_0xd6cf('0x39')]=function(_0x2aa7fa){switch(_0x2aa7fa){case _0xd6cf('0x3a'):return'imap.gmail.com';case'yahoo':return _0xd6cf('0x3b');case _0xd6cf('0x3c'):return _0xd6cf('0x3d');case _0xd6cf('0x3e'):return _0xd6cf('0x3f');}return _0xd6cf('0x40');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index dbc4d03..51649bc 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 _0x0370=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x4ba9ba,_0x26cfb7){var _0x55a9ad=function(_0x2f257e){while(--_0x2f257e){_0x4ba9ba['push'](_0x4ba9ba['shift']());}};_0x55a9ad(++_0x26cfb7);}(_0x0370,0xad));var _0x0037=function(_0x231dde,_0x5aad1b){_0x231dde=_0x231dde-0x0;var _0x145bdc=_0x0370[_0x231dde];return _0x145bdc;};'use strict';var _=require(_0x0037('0x0'));function MailAccount(_0x59f126){this['id']=_0x59f126['id']||0x0;this[_0x0037('0x1')]=_0x59f126[_0x0037('0x1')]||_0x0037('0x2');this[_0x0037('0x3')]=_0x59f126[_0x0037('0x3')]||_0x0037('0x4');this[_0x0037('0x5')]=_0x59f126[_0x0037('0x5')]||![];this[_0x0037('0x6')]=_0x59f126[_0x0037('0x6')]||[];this['Smtp']=_0x59f126[_0x0037('0x7')]||[];}module[_0x0037('0x8')]=MailAccount; \ No newline at end of file +var _0x9f56=['Service','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x2e48bf,_0x4bde87){var _0x2b6b2d=function(_0x183d59){while(--_0x183d59){_0x2e48bf['push'](_0x2e48bf['shift']());}};_0x2b6b2d(++_0x4bde87);}(_0x9f56,0x15e));var _0x69f5=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x9f56[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require(_0x69f5('0x0'));function MailAccount(_0x152e14){this['id']=_0x152e14['id']||0x0;this[_0x69f5('0x1')]=_0x152e14[_0x69f5('0x1')]||_0x69f5('0x2');this['key']=_0x152e14['key']||_0x69f5('0x3');this[_0x69f5('0x4')]=_0x152e14['active']||![];this[_0x69f5('0x5')]=_0x152e14[_0x69f5('0x5')]||[];this[_0x69f5('0x6')]=_0x152e14[_0x69f5('0x6')]||[];}module[_0x69f5('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index b03bbf6..eda8995 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 _0x8f4c=['prototype','initMailAccounts','length','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x182a0a,_0x536d9e){var _0x2a1fd6=function(_0xcfe41){while(--_0xcfe41){_0x182a0a['push'](_0x182a0a['shift']());}};_0x2a1fd6(++_0x536d9e);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1005d4,_0x5199ab){_0x1005d4=_0x1005d4-0x0;var _0x421977=_0x8f4c[_0x1005d4];return _0x421977;};'use strict';var _=require(_0xc8f4('0x0'));var MailAccount=require(_0xc8f4('0x1'));var Realtime=function(){this[_0xc8f4('0x2')]={};};function freeIsNotKey(_0x43926b,_0x19893b,_0x134d73){var _0x580083=_[_0xc8f4('0x3')](_0x43926b,function(_0x47350d,_0x133764){return _0x47350d[_0x134d73];});for(var _0x56c9b1 in _0x19893b){if(_0x19893b[_0xc8f4('0x4')](_0x56c9b1)){if(!_0x580083[_0x56c9b1]){delete _0x19893b[_0x56c9b1];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x520063,_0x373506){for(var _0x48c39d in _0x373506){if(_0x520063[_0xc8f4('0x4')](_0x48c39d)){_0x520063[_0x48c39d]=_0x373506[_0x48c39d];}}};Realtime[_0xc8f4('0x5')][_0xc8f4('0x6')]=function(){var _0x39ed63=this;return function(_0x34f05f){if(_0x34f05f){freeIsNotKey(_0x34f05f,_0x39ed63['mailAccounts'],'id');for(var _0x38c41b=0x0,_0x191b92={},_0x2fba62={};_0x38c41b<_0x34f05f[_0xc8f4('0x7')];_0x38c41b+=0x1){_0x191b92=_0x34f05f[_0x38c41b];if(_['isUndefined'](_0x39ed63[_0xc8f4('0x2')][_0x191b92['id']])){_0x39ed63['mailAccounts'][_0x191b92['id']]=new MailAccount(_0x191b92);}else{_[_0xc8f4('0x8')](_0x39ed63[_0xc8f4('0x2')][_0x191b92['id']],_0x191b92);}}}return _0x39ed63[_0xc8f4('0x2')];};};module[_0xc8f4('0x9')]=Realtime; \ No newline at end of file +var _0x955f=['prototype','mergeFromDatabase','initMailAccounts','length','merge','lodash','../model/mailAccount','mailAccounts','hasOwnProperty'];(function(_0x1b159a,_0x57fe3f){var _0x241b17=function(_0x3107d1){while(--_0x3107d1){_0x1b159a['push'](_0x1b159a['shift']());}};_0x241b17(++_0x57fe3f);}(_0x955f,0x1eb));var _0xf955=function(_0x25cfaa,_0x4cadef){_0x25cfaa=_0x25cfaa-0x0;var _0x1e895f=_0x955f[_0x25cfaa];return _0x1e895f;};'use strict';var _=require(_0xf955('0x0'));var MailAccount=require(_0xf955('0x1'));var Realtime=function(){this[_0xf955('0x2')]={};};function freeIsNotKey(_0x382225,_0x2834f7,_0x585f6e){var _0xd75c8f=_['mapKeys'](_0x382225,function(_0x5d0c95,_0x1db0dd){return _0x5d0c95[_0x585f6e];});for(var _0x5a20bc in _0x2834f7){if(_0x2834f7[_0xf955('0x3')](_0x5a20bc)){if(!_0xd75c8f[_0x5a20bc]){delete _0x2834f7[_0x5a20bc];}}}}Realtime[_0xf955('0x4')][_0xf955('0x5')]=function(_0x59d5b3,_0x18432f){for(var _0x20c096 in _0x18432f){if(_0x59d5b3['hasOwnProperty'](_0x20c096)){_0x59d5b3[_0x20c096]=_0x18432f[_0x20c096];}}};Realtime[_0xf955('0x4')][_0xf955('0x6')]=function(){var _0x168ffb=this;return function(_0x38b190){if(_0x38b190){freeIsNotKey(_0x38b190,_0x168ffb[_0xf955('0x2')],'id');for(var _0x421e4a=0x0,_0x186719={},_0x4d213a={};_0x421e4a<_0x38b190[_0xf955('0x7')];_0x421e4a+=0x1){_0x186719=_0x38b190[_0x421e4a];if(_['isUndefined'](_0x168ffb[_0xf955('0x2')][_0x186719['id']])){_0x168ffb[_0xf955('0x2')][_0x186719['id']]=new MailAccount(_0x186719);}else{_[_0xf955('0x8')](_0x168ffb['mailAccounts'][_0x186719['id']],_0x186719);}}}return _0x168ffb[_0xf955('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index e762198..39e5ef7 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 _0x2cf6=['Request','GetMailAccount','service','email','active','key','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts'];(function(_0x2e4422,_0x5e190f){var _0x33cb58=function(_0x353bfd){while(--_0x353bfd){_0x2e4422['push'](_0x2e4422['shift']());}};_0x33cb58(++_0x5e190f);}(_0x2cf6,0x177));var _0x62cf=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x2cf6[_0x9df060];return _0x338dfe;};'use strict';var client=require(_0x62cf('0x0'));exports[_0x62cf('0x1')]=function(){return function(){return client[_0x62cf('0x2')](_0x62cf('0x3'),{'options':{'attributes':['id','name',_0x62cf('0x4'),_0x62cf('0x5'),_0x62cf('0x6'),_0x62cf('0x7'),'ListId','TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap'},{'model':_0x62cf('0x8'),'as':_0x62cf('0x9')}]},'log':_0x62cf('0xa')});};};exports[_0x62cf('0xb')]=function(_0x4f486b,_0x2de0dd){return client[_0x62cf('0x2')](_0x62cf('0xc'),{'account':{'id':_0x4f486b},'body':_0x2de0dd,'log':_0x62cf('0xc')});}; \ No newline at end of file +var _0xa1cc=['ListId','TemplateId','MailServerIn','Imap','../client','getMailAccounts','Request','GetMailAccount','email','active','key'];(function(_0x2fa00a,_0x2fc408){var _0x3a3e51=function(_0x409c4c){while(--_0x409c4c){_0x2fa00a['push'](_0x2fa00a['shift']());}};_0x3a3e51(++_0x2fc408);}(_0xa1cc,0x93));var _0xca1c=function(_0x497740,_0x263dab){_0x497740=_0x497740-0x0;var _0x179b41=_0xa1cc[_0x497740];return _0x179b41;};'use strict';var client=require(_0xca1c('0x0'));exports[_0xca1c('0x1')]=function(){return function(){return client[_0xca1c('0x2')](_0xca1c('0x3'),{'options':{'attributes':['id','name','service',_0xca1c('0x4'),_0xca1c('0x5'),_0xca1c('0x6'),_0xca1c('0x7'),_0xca1c('0x8')],'raw':![],'include':[{'model':_0xca1c('0x9'),'as':_0xca1c('0xa')},{'model':'MailServerOut','as':'Smtp'}]},'log':'getMailAccount'});};};exports['notify']=function(_0x35073c,_0x4d7d11){return client[_0xca1c('0x2')]('NotifyMailAccount',{'account':{'id':_0x35073c},'body':_0x4d7d11,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 9ee2099..3f281a2 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 _0x5454=['catch','error','verifySmtp','Verified','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','listen','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','../../../config/logger','sendMail','account','message','then'];(function(_0x19b3ac,_0x4a04ae){var _0x3756fa=function(_0x489881){while(--_0x489881){_0x19b3ac['push'](_0x19b3ac['shift']());}};_0x3756fa(++_0x4a04ae);}(_0x5454,0x15b));var _0x4545=function(_0x2148a1,_0xf72485){_0x2148a1=_0x2148a1-0x0;var _0x5e4464=_0x5454[_0x2148a1];return _0x5e4464;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require('lodash');var logger=require(_0x4545('0x0'))('email');exports['listen']=function(_0x4f09f7,_0x1635b9){return new BPromise(function(_0x32f284,_0x1740a8){var _0x37ede9={'SendMail':function(_0x5f06c7){var _0x41ffd0=this;return new Promise(function(_0xececc1,_0x6fd3bb){_0x1635b9[_0x4545('0x1')](_0x5f06c7[_0x4545('0x2')],_0x5f06c7[_0x4545('0x3')])[_0x4545('0x4')](function(_0x1e5cac){_0xececc1({'code':0xc8,'message':_0x1e5cac});})[_0x4545('0x5')](function(_0x3e2526){_0x6fd3bb(_0x41ffd0[_0x4545('0x6')](0x1f4,_0x3e2526));});});},'VerifySmtp':function(_0x40cd1c){var _0xafaeb7=this;return new Promise(function(_0x491b7b,_0x869994){_0x1635b9[_0x4545('0x7')](_0x40cd1c[_0x4545('0x2')])[_0x4545('0x4')](function(_0x1daecf){_0x491b7b({'code':0xc8,'message':_0x4545('0x8')});})['catch'](function(_0x3844a3){_0x869994(_0xafaeb7[_0x4545('0x6')](0x1f4,_0x3844a3));});});},'MailAccounts':function(_0x353e42){return new Promise(function(_0x1820cd,_0x389f13){var _0xb9120a=_[_0x4545('0x9')](_0x4f09f7[_0x4545('0xa')]);for(var _0x36bb8e=0x0;_0x36bb8e<_0xb9120a[_0x4545('0xb')];_0x36bb8e+=0x1){if(_0xb9120a[_0x36bb8e][_0x4545('0xc')]&&_0xb9120a[_0x36bb8e]['Imap'][_0x4545('0xd')]){delete _0xb9120a[_0x36bb8e][_0x4545('0xc')][_0x4545('0xd')];}if(_0xb9120a[_0x36bb8e][_0x4545('0xe')]&&_0xb9120a[_0x36bb8e]['Smtp']['pass']){delete _0xb9120a[_0x36bb8e][_0x4545('0xe')][_0x4545('0xf')];}}_0x1820cd({'count':_0xb9120a[_0x4545('0xb')],'rows':_0xb9120a});});}};var _0x2e13e0=jayson[_0x4545('0x10')](_0x37ede9)[_0x4545('0x11')]();_0x2e13e0['on'](_0x4545('0x6'),function(_0x4672ed){logger['error'](JSON['stringify'](_0x4672ed));return _0x1740a8(_0x4672ed);});_0x2e13e0[_0x4545('0x12')](0x232b,'127.0.0.1',function(){console[_0x4545('0x13')](_0x4545('0x14'),0x232b);return _0x32f284(_0x4545('0x15')+0x232b);});});}; \ No newline at end of file +var _0xc893=['server','stringify','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','bluebird','lodash','listen','sendMail','account','then','verifySmtp','Verified','catch','error','values','length','Imap','password','Smtp','pass'];(function(_0x2ef0e3,_0x38c3b4){var _0x3432a0=function(_0x59d1f3){while(--_0x59d1f3){_0x2ef0e3['push'](_0x2ef0e3['shift']());}};_0x3432a0(++_0x38c3b4);}(_0xc893,0x194));var _0x3c89=function(_0x515f7,_0x11b150){_0x515f7=_0x515f7-0x0;var _0x20ea08=_0xc893[_0x515f7];return _0x20ea08;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x3c89('0x0'));var _=require(_0x3c89('0x1'));var logger=require('../../../config/logger')('email');exports[_0x3c89('0x2')]=function(_0x305308,_0x1417db){return new BPromise(function(_0xedc679,_0x144af5){var _0x120117={'SendMail':function(_0x1629c8){var _0x5f2803=this;return new Promise(function(_0x2e156d,_0x1a0ec4){_0x1417db[_0x3c89('0x3')](_0x1629c8[_0x3c89('0x4')],_0x1629c8['message'])[_0x3c89('0x5')](function(_0x5d09d7){_0x2e156d({'code':0xc8,'message':_0x5d09d7});})['catch'](function(_0x3cfe79){_0x1a0ec4(_0x5f2803['error'](0x1f4,_0x3cfe79));});});},'VerifySmtp':function(_0x2c026e){var _0x161ed1=this;return new Promise(function(_0x53ed5c,_0x182415){_0x1417db[_0x3c89('0x6')](_0x2c026e[_0x3c89('0x4')])[_0x3c89('0x5')](function(_0xd06b18){_0x53ed5c({'code':0xc8,'message':_0x3c89('0x7')});})[_0x3c89('0x8')](function(_0x3bfe2b){_0x182415(_0x161ed1[_0x3c89('0x9')](0x1f4,_0x3bfe2b));});});},'MailAccounts':function(_0x13d423){return new Promise(function(_0x1a9c0b,_0x1e486d){var _0xfeea0d=_[_0x3c89('0xa')](_0x305308['mailAccounts']);for(var _0x21c296=0x0;_0x21c296<_0xfeea0d[_0x3c89('0xb')];_0x21c296+=0x1){if(_0xfeea0d[_0x21c296][_0x3c89('0xc')]&&_0xfeea0d[_0x21c296][_0x3c89('0xc')][_0x3c89('0xd')]){delete _0xfeea0d[_0x21c296][_0x3c89('0xc')][_0x3c89('0xd')];}if(_0xfeea0d[_0x21c296][_0x3c89('0xe')]&&_0xfeea0d[_0x21c296][_0x3c89('0xe')][_0x3c89('0xf')]){delete _0xfeea0d[_0x21c296][_0x3c89('0xe')]['pass'];}}_0x1a9c0b({'count':_0xfeea0d['length'],'rows':_0xfeea0d});});}};var _0x2dcd6d=jayson[_0x3c89('0x10')](_0x120117)['http']();_0x2dcd6d['on']('error',function(_0x425d5c){logger[_0x3c89('0x9')](JSON[_0x3c89('0x11')](_0x425d5c));return _0x144af5(_0x425d5c);});_0x2dcd6d[_0x3c89('0x2')](0x232b,'127.0.0.1',function(){console[_0x3c89('0x12')](_0x3c89('0x13'),0x232b);return _0xedc679(_0x3c89('0x14')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 8b2c065..b609457 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 _0x0e85=['localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http','sticky-session','ioredis','listen','socket.io','websocket','polling','redis'];(function(_0x36a1ea,_0x1a7a85){var _0x25442c=function(_0x23deb0){while(--_0x23deb0){_0x36a1ea['push'](_0x36a1ea['shift']());}};_0x25442c(++_0x1a7a85);}(_0x0e85,0x7c));var _0x50e8=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x0e85[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x50e8('0x0'));var http=require(_0x50e8('0x1'));var express=require('express');var sticky=require(_0x50e8('0x2'));var Redis=require(_0x50e8('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0x50e8('0x4')](server,config['port'])){var socketio=require(_0x50e8('0x5'))(server,{'transports':[_0x50e8('0x6'),_0x50e8('0x7')]});config[_0x50e8('0x8')]=_['defaults'](config[_0x50e8('0x8')],{'host':_0x50e8('0x9'),'port':0x18eb});socketio[_0x50e8('0xa')](require(_0x50e8('0xb'))({'pubClient':new Redis(config[_0x50e8('0x8')]),'subClient':new Redis(config[_0x50e8('0x8')])}));require('../../config/triggers')[_0x50e8('0xc')]();require(_0x50e8('0xd'))[_0x50e8('0xc')](socketio);require(_0x50e8('0xe'))[_0x50e8('0xc')](app);require(_0x50e8('0xf'))[_0x50e8('0xc')](app);}else{server[_0x50e8('0x10')]('listening',function(){console['log'](_0x50e8('0x11'),config[_0x50e8('0x12')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xbb53=['default','../../routes','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','polling','redis','defaults','localhost','../../config/triggers'];(function(_0x4f096e,_0x30d3c3){var _0x4a33ce=function(_0x107ba6){while(--_0x107ba6){_0x4f096e['push'](_0x4f096e['shift']());}};_0x4a33ce(++_0x30d3c3);}(_0xbb53,0x121));var _0x3bb5=function(_0x173f86,_0x4ccc73){_0x173f86=_0x173f86-0x0;var _0x816ac=_0xbb53[_0x173f86];return _0x816ac;};'use strict';var _=require(_0x3bb5('0x0'));var http=require(_0x3bb5('0x1'));var express=require(_0x3bb5('0x2'));var sticky=require(_0x3bb5('0x3'));var Redis=require(_0x3bb5('0x4'));var config=require(_0x3bb5('0x5'));var app=express();var server=http[_0x3bb5('0x6')](app);server[_0x3bb5('0x7')]=0xdbba0;if(sticky[_0x3bb5('0x8')](server,config[_0x3bb5('0x9')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0x3bb5('0xa')]});config[_0x3bb5('0xb')]=_[_0x3bb5('0xc')](config[_0x3bb5('0xb')],{'host':_0x3bb5('0xd'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x3bb5('0xb')])}));require(_0x3bb5('0xe'))[_0x3bb5('0xf')]();require('../../config/socketio')[_0x3bb5('0xf')](socketio);require('../../config/express')['default'](app);require(_0x3bb5('0x10'))[_0x3bb5('0xf')](app);}else{server['once'](_0x3bb5('0x11'),function(){console['log'](_0x3bb5('0x12'),config['port']);});}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 1ddf93b..bb9ad65 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 _0x99c9=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','catch'];(function(_0x581a17,_0x337fe1){var _0x49e312=function(_0x2f7edc){while(--_0x2f7edc){_0x581a17['push'](_0x581a17['shift']());}};_0x49e312(++_0x337fe1);}(_0x99c9,0x13c));var _0x999c=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x99c9[_0x36ed48];return _0x51c63a;};'use strict';var jayson=require(_0x999c('0x0'));var BPromise=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var client=jayson[_0x999c('0x4')][_0x999c('0x5')]({'port':0x2329});client[_0x999c('0x6')]=function(_0x52dc75,_0x2a4e06){return new BPromise(function(_0x140cd5,_0x2d4f2d){return client[_0x999c('0x7')](_0x52dc75,_0x2a4e06)[_0x999c('0x8')](function(_0x14df32){logger[_0x999c('0x9')](_0x999c('0xa'),_0x999c('0x3'),_0x52dc75,_0x2a4e06,_0x14df32);if(_0x14df32[_0x999c('0xb')]){logger[_0x999c('0xb')](_0x999c('0xa'),_0x999c('0x3'),_0x52dc75,_0x14df32[_0x999c('0xb')]['message'],_0x2a4e06);return _0x2d4f2d(_0x14df32[_0x999c('0xb')][_0x999c('0xc')]);}else{return _0x140cd5(_0x14df32['result']);}})[_0x999c('0xd')](function(_0x140c4b){logger[_0x999c('0xb')](_0x999c('0xa'),_0x999c('0x3'),_0x52dc75,_0x140c4b,_0x2a4e06);return _0x2d4f2d(_0x140c4b);});});};module[_0x999c('0xe')]=client; \ No newline at end of file +var _0xfc76=['../../config/logger','routing','client','http','then','debug','error','rpc','message','result','catch','exports','bluebird'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xfc76,0xb5));var _0x6fc7=function(_0xf8f5c3,_0x4b3972){_0xf8f5c3=_0xf8f5c3-0x0;var _0x3336d8=_0xfc76[_0xf8f5c3];return _0x3336d8;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6fc7('0x0'));var logger=require(_0x6fc7('0x1'))(_0x6fc7('0x2'));var client=jayson[_0x6fc7('0x3')][_0x6fc7('0x4')]({'port':0x2329});client['Request']=function(_0x316cc4,_0x40d212){return new BPromise(function(_0x51280c,_0x13f682){return client['request'](_0x316cc4,_0x40d212)[_0x6fc7('0x5')](function(_0x82a35a){logger[_0x6fc7('0x6')]('rpc',_0x6fc7('0x2'),_0x316cc4,_0x40d212,_0x82a35a);if(_0x82a35a[_0x6fc7('0x7')]){logger[_0x6fc7('0x7')](_0x6fc7('0x8'),_0x6fc7('0x2'),_0x316cc4,_0x82a35a[_0x6fc7('0x7')]['message'],_0x40d212);return _0x13f682(_0x82a35a[_0x6fc7('0x7')][_0x6fc7('0x9')]);}else{return _0x51280c(_0x82a35a[_0x6fc7('0xa')]);}})[_0x6fc7('0xb')](function(_0x9dc6cb){logger[_0x6fc7('0x7')]('rpc',_0x6fc7('0x2'),_0x316cc4,_0x9dc6cb,_0x40d212);return _0x13f682(_0x9dc6cb);});});};module[_0x6fc7('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 413d2be..533f246 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 _0xd664=['./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval'];(function(_0x2ef1bc,_0x354fab){var _0x1aa2f7=function(_0x334c18){while(--_0x334c18){_0x2ef1bc['push'](_0x2ef1bc['shift']());}};_0x1aa2f7(++_0x354fab);}(_0xd664,0x91));var _0x4d66=function(_0x2b0aa5,_0x356a70){_0x2b0aa5=_0x2b0aa5-0x0;var _0x95b137=_0xd664[_0x2b0aa5];return _0x95b137;};'use strict';var BPromise=require(_0x4d66('0x0'));var server=require(_0x4d66('0x1'));var Realtime=require(_0x4d66('0x2'));var user=require(_0x4d66('0x3'));var interval=require(_0x4d66('0x4'));var openchannelQueue=require(_0x4d66('0x5'));var chatQueue=require(_0x4d66('0x6'));var smsQueue=require(_0x4d66('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x4d66('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x4d66('0x9')]()[_0x4d66('0xa')](user[_0x4d66('0xb')]())[_0x4d66('0xa')](realtime[_0x4d66('0xc')]())['then'](interval[_0x4d66('0xd')]())[_0x4d66('0xa')](realtime[_0x4d66('0xe')]())['then'](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0x4d66('0xf')]())[_0x4d66('0xa')](chatQueue[_0x4d66('0x10')]())[_0x4d66('0xa')](realtime[_0x4d66('0x11')]())[_0x4d66('0xa')](smsQueue[_0x4d66('0x12')]())[_0x4d66('0xa')](realtime[_0x4d66('0x13')]())[_0x4d66('0xa')](mailQueue['getMailQueues']())['then'](realtime['initMailQueues']())['then'](faxQueue[_0x4d66('0x14')]())[_0x4d66('0xa')](realtime[_0x4d66('0x15')]())[_0x4d66('0xa')](function(){return realtime;});}function main(){return server[_0x4d66('0x16')](realtime)['then'](function(_0x5cef17){return initRealtime();})[_0x4d66('0xa')](function(_0x188214){return setInterval(initRealtime,0x1388);})[_0x4d66('0x17')](function(_0x2890a5){console[_0x4d66('0x18')](_0x2890a5);});}main(); \ No newline at end of file +var _0xc5da=['./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','listen','catch','log','bluebird','./server','./realtime'];(function(_0x14c314,_0x4beeae){var _0x2403a1=function(_0xb2050e){while(--_0xb2050e){_0x14c314['push'](_0x14c314['shift']());}};_0x2403a1(++_0x4beeae);}(_0xc5da,0xc5));var _0xac5d=function(_0x1def01,_0x3ded45){_0x1def01=_0x1def01-0x0;var _0x4ec575=_0xc5da[_0x1def01];return _0x4ec575;};'use strict';var BPromise=require(_0xac5d('0x0'));var server=require(_0xac5d('0x1'));var Realtime=require(_0xac5d('0x2'));var user=require('./rpc/user');var interval=require(_0xac5d('0x3'));var openchannelQueue=require(_0xac5d('0x4'));var chatQueue=require(_0xac5d('0x5'));var smsQueue=require(_0xac5d('0x6'));var mailQueue=require(_0xac5d('0x7'));var faxQueue=require(_0xac5d('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xac5d('0x9')]()[_0xac5d('0xa')](user['getAgents']())[_0xac5d('0xa')](realtime[_0xac5d('0xb')]())['then'](interval[_0xac5d('0xc')]())['then'](realtime[_0xac5d('0xd')]())[_0xac5d('0xa')](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0xac5d('0xe')]())['then'](chatQueue[_0xac5d('0xf')]())[_0xac5d('0xa')](realtime[_0xac5d('0x10')]())[_0xac5d('0xa')](smsQueue[_0xac5d('0x11')]())[_0xac5d('0xa')](realtime[_0xac5d('0x12')]())[_0xac5d('0xa')](mailQueue[_0xac5d('0x13')]())[_0xac5d('0xa')](realtime[_0xac5d('0x14')]())[_0xac5d('0xa')](faxQueue['getFaxQueues']())['then'](realtime[_0xac5d('0x15')]())['then'](function(){return realtime;});}function main(){return server[_0xac5d('0x16')](realtime)['then'](function(_0x19bc0e){return initRealtime();})[_0xac5d('0xa')](function(_0x2c7b10){return setInterval(initRealtime,0x1388);})[_0xac5d('0x17')](function(_0x2f8f4c){console[_0xac5d('0x18')](_0x2f8f4c);});}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 6fa388f..948a627 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 _0x818e=['length','noop','prototype','findRules','matches','turn','prioritize','priority','toJSON','map','condition','toString','fromJSON','parse','util','events','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','rules','activeRules','isArray','isObject','push','sync','orderBy','asc','execute','clone','consequence','index_','nextTick','ruleRef','call','next','isEqual'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x818e,0x83));var _0xe818=function(_0x61a328,_0x4a3869){_0x61a328=_0x61a328-0x0;var _0x473959=_0x818e[_0x61a328];return _0x473959;};'use strict';var _=require('lodash');var util=require(_0xe818('0x0'));var EventEmitter=require(_0xe818('0x1'))[_0xe818('0x2')];function RuleEngine(_0x4f075d,_0x37b011){this[_0xe818('0x3')]();if(!_[_0xe818('0x4')](_0x4f075d)){this[_0xe818('0x5')](_0x4f075d);}if(_0x37b011){this['ignoreFactChanges']=_0x37b011[_0xe818('0x6')];}return this;}util[_0xe818('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0xe818('0x3')]=function(_0x5c6d9a){this[_0xe818('0x8')]=[];this[_0xe818('0x9')]=[];};RuleEngine['prototype'][_0xe818('0x5')]=function(_0x5a0f13){if(Array[_0xe818('0xa')](_0x5a0f13)){this[_0xe818('0x8')]=this[_0xe818('0x8')]['concat'](_0x5a0f13);}else if(_0x5a0f13!==null&&_[_0xe818('0xb')](_0x5a0f13)){this['rules'][_0xe818('0xc')](_0x5a0f13);}this[_0xe818('0xd')]();};RuleEngine['prototype'][_0xe818('0xd')]=function(){this[_0xe818('0x9')]=this[_0xe818('0x8')]['filter'](function(_0x3b12a7){if(_[_0xe818('0x4')](_0x3b12a7['on'])){_0x3b12a7['on']=!![];}if(_0x3b12a7['on']===!![]){return _0x3b12a7;}});this[_0xe818('0x9')]=_[_0xe818('0xe')](this[_0xe818('0x9')],['p'],[_0xe818('0xf')]);};RuleEngine['prototype'][_0xe818('0x10')]=function(_0x1a7ea0,_0x4d6067){var _0x251b59=![];_0x1a7ea0['result']=!![];var _0xf2be32=_['clone'](_0x1a7ea0);var _0xcfba07=_[_0xe818('0x11')](_0x1a7ea0);var _0x549e5f=this['activeRules'];var _0x5bd09d=[];var _0x4801fd=this[_0xe818('0x6')];(function FnRuleLoop(_0x5593c2){var _0x4c5475={'rules':function(){return _0x549e5f;},'rule':function(){return _0x549e5f[_0x5593c2];},'when':function(_0x17f28f){if(_0x17f28f){var _0x332a57=_0x549e5f[_0x5593c2][_0xe818('0x12')];_0x332a57['ruleRef']=_0x549e5f[_0x5593c2]['id']||_0x549e5f[_0x5593c2]['name']||_0xe818('0x13')+_0x5593c2;process[_0xe818('0x14')](function(){_0x5bd09d['push'](_0x332a57[_0xe818('0x15')]);_0x332a57[_0xe818('0x16')](_0xf2be32,_0x4c5475);});}else{process['nextTick'](function(){_0x4c5475[_0xe818('0x17')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x251b59=!![];return FnRuleLoop(0x0);},'next':function(_0x45116b){if(!_0x4801fd&&!_[_0xe818('0x18')](_0xcfba07,_0xf2be32)){_0xcfba07=_[_0xe818('0x11')](_0xf2be32);process['nextTick'](function(){_0x4c5475['restart']();});}else{process[_0xe818('0x14')](function(){if(_['isNil'](_0x45116b)){return FnRuleLoop(_0x5593c2+0x1);}else{return FnRuleLoop(_0x45116b);}});}}};if(_0x5593c2<_0x549e5f[_0xe818('0x19')]&&_0x251b59===![]){var _0x45c9a2=_0x549e5f[_0x5593c2]['condition'];_0x45c9a2[_0xe818('0x16')](_0xf2be32,_0x4c5475);}else{process[_0xe818('0x14')](function(){_0xf2be32['matchPath']=_0x5bd09d;return _0x4d6067?_0x4d6067(_0xf2be32):_[_0xe818('0x1a')]();});}}(0x0));};RuleEngine[_0xe818('0x1b')][_0xe818('0x1c')]=function(_0x312c23){if(_['isNil'](_0x312c23)){return this[_0xe818('0x8')];}else{var _0x2a4646=_[_0xe818('0x1d')](_0x312c23);return _['filter'](this[_0xe818('0x8')],_0x2a4646);}};RuleEngine['prototype'][_0xe818('0x1e')]=function(_0x16c07a,_0x257a0f){var _0x16c07a=_0x16c07a==='on'||_0x16c07a==='ON'?!![]:![];var _0x38116b=this[_0xe818('0x1c')](_0x257a0f);for(var _0x4e5b20=0x0,_0x4c2ffd=_0x38116b[_0xe818('0x19')];_0x4e5b20<_0x4c2ffd;_0x4e5b20+=0x1){_0x38116b[_0x4e5b20]['on']=_0x16c07a;}this['sync']();};RuleEngine[_0xe818('0x1b')][_0xe818('0x1f')]=function(_0x34cccd,_0x5e8d90){_0x34cccd=parseInt(_0x34cccd,0xa);var _0x30c09f=this[_0xe818('0x1c')](_0x5e8d90);for(var _0x22c3fb=0x0,_0x3054df=_0x30c09f[_0xe818('0x19')];_0x22c3fb<_0x3054df;_0x22c3fb+=0x1){_0x30c09f[_0x22c3fb][_0xe818('0x20')]=_0x34cccd;}this[_0xe818('0xd')]();};RuleEngine[_0xe818('0x1b')][_0xe818('0x21')]=function(){var _0x713a6a=this[_0xe818('0x8')];if(_0x713a6a instanceof Array){_0x713a6a=_0x713a6a[_0xe818('0x22')](function(_0x4fbb60){_0x4fbb60[_0xe818('0x23')]=_0x4fbb60[_0xe818('0x23')][_0xe818('0x24')]();_0x4fbb60[_0xe818('0x12')]=_0x4fbb60[_0xe818('0x12')][_0xe818('0x24')]();return _0x4fbb60;});}else if(!_[_0xe818('0x4')](_0x713a6a)){_0x713a6a[_0xe818('0x23')]=_0x713a6a[_0xe818('0x23')][_0xe818('0x24')]();_0x713a6a['consequence']=_0x713a6a[_0xe818('0x12')]['toString']();}return _0x713a6a;};RuleEngine[_0xe818('0x1b')][_0xe818('0x25')]=function(_0x27cbf8){this[_0xe818('0x3')]();if(_['isString'](_0x27cbf8)){_0x27cbf8=JSON[_0xe818('0x26')](_0x27cbf8);}if(_0x27cbf8 instanceof Array){_0x27cbf8=_0x27cbf8[_0xe818('0x22')](function(_0x34e318){_0x34e318['condition']=eval('('+_0x34e318[_0xe818('0x23')]+')');_0x34e318[_0xe818('0x12')]=eval('('+_0x34e318['consequence']+')');return _0x34e318;});}else if(_0x27cbf8!==null&&typeof _0x27cbf8=='object'){_0x27cbf8['condition']=eval('('+_0x27cbf8['condition']+')');_0x27cbf8['consequence']=eval('('+_0x27cbf8['consequence']+')');}this['register'](_0x27cbf8);};module['exports']=RuleEngine; \ No newline at end of file +var _0x7c28=['findRules','matches','turn','prioritize','toJSON','map','toString','consequence','fromJSON','isString','object','exports','lodash','util','events','EventEmitter','init','register','ignoreFactChanges','inherits','prototype','rules','activeRules','isArray','concat','isObject','push','sync','isNil','orderBy','asc','execute','result','clone','ruleRef','name','index_','nextTick','call','isEqual','length','condition','matchPath','noop'];(function(_0x2a9de7,_0x470eee){var _0x59fe7e=function(_0x49fd94){while(--_0x49fd94){_0x2a9de7['push'](_0x2a9de7['shift']());}};_0x59fe7e(++_0x470eee);}(_0x7c28,0x16c));var _0x87c2=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x7c28[_0xd09668];return _0x68726;};'use strict';var _=require(_0x87c2('0x0'));var util=require(_0x87c2('0x1'));var EventEmitter=require(_0x87c2('0x2'))[_0x87c2('0x3')];function RuleEngine(_0x2c4079,_0x3df1ad){this[_0x87c2('0x4')]();if(!_['isNil'](_0x2c4079)){this[_0x87c2('0x5')](_0x2c4079);}if(_0x3df1ad){this[_0x87c2('0x6')]=_0x3df1ad[_0x87c2('0x6')];}return this;}util[_0x87c2('0x7')](RuleEngine,EventEmitter);RuleEngine[_0x87c2('0x8')][_0x87c2('0x4')]=function(_0x5ba4b8){this[_0x87c2('0x9')]=[];this[_0x87c2('0xa')]=[];};RuleEngine[_0x87c2('0x8')][_0x87c2('0x5')]=function(_0x5c6178){if(Array[_0x87c2('0xb')](_0x5c6178)){this[_0x87c2('0x9')]=this[_0x87c2('0x9')][_0x87c2('0xc')](_0x5c6178);}else if(_0x5c6178!==null&&_[_0x87c2('0xd')](_0x5c6178)){this[_0x87c2('0x9')][_0x87c2('0xe')](_0x5c6178);}this[_0x87c2('0xf')]();};RuleEngine[_0x87c2('0x8')][_0x87c2('0xf')]=function(){this[_0x87c2('0xa')]=this[_0x87c2('0x9')]['filter'](function(_0x583148){if(_[_0x87c2('0x10')](_0x583148['on'])){_0x583148['on']=!![];}if(_0x583148['on']===!![]){return _0x583148;}});this[_0x87c2('0xa')]=_[_0x87c2('0x11')](this[_0x87c2('0xa')],['p'],[_0x87c2('0x12')]);};RuleEngine[_0x87c2('0x8')][_0x87c2('0x13')]=function(_0x563af7,_0x4fdd96){var _0x57cebc=![];_0x563af7[_0x87c2('0x14')]=!![];var _0xfb5062=_[_0x87c2('0x15')](_0x563af7);var _0x1c2008=_['clone'](_0x563af7);var _0x28f60d=this[_0x87c2('0xa')];var _0x9a0ccb=[];var _0x316a1d=this['ignoreFactChanges'];(function FnRuleLoop(_0x586187){var _0x502301={'rules':function(){return _0x28f60d;},'rule':function(){return _0x28f60d[_0x586187];},'when':function(_0x48da8b){if(_0x48da8b){var _0x34dc4b=_0x28f60d[_0x586187]['consequence'];_0x34dc4b[_0x87c2('0x16')]=_0x28f60d[_0x586187]['id']||_0x28f60d[_0x586187][_0x87c2('0x17')]||_0x87c2('0x18')+_0x586187;process[_0x87c2('0x19')](function(){_0x9a0ccb[_0x87c2('0xe')](_0x34dc4b[_0x87c2('0x16')]);_0x34dc4b[_0x87c2('0x1a')](_0xfb5062,_0x502301);});}else{process[_0x87c2('0x19')](function(){_0x502301['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x57cebc=!![];return FnRuleLoop(0x0);},'next':function(_0x1adf4b){if(!_0x316a1d&&!_[_0x87c2('0x1b')](_0x1c2008,_0xfb5062)){_0x1c2008=_[_0x87c2('0x15')](_0xfb5062);process['nextTick'](function(){_0x502301['restart']();});}else{process['nextTick'](function(){if(_['isNil'](_0x1adf4b)){return FnRuleLoop(_0x586187+0x1);}else{return FnRuleLoop(_0x1adf4b);}});}}};if(_0x586187<_0x28f60d[_0x87c2('0x1c')]&&_0x57cebc===![]){var _0x584c6b=_0x28f60d[_0x586187][_0x87c2('0x1d')];_0x584c6b[_0x87c2('0x1a')](_0xfb5062,_0x502301);}else{process[_0x87c2('0x19')](function(){_0xfb5062[_0x87c2('0x1e')]=_0x9a0ccb;return _0x4fdd96?_0x4fdd96(_0xfb5062):_[_0x87c2('0x1f')]();});}}(0x0));};RuleEngine[_0x87c2('0x8')][_0x87c2('0x20')]=function(_0x139472){if(_[_0x87c2('0x10')](_0x139472)){return this['rules'];}else{var _0xc3fcb0=_[_0x87c2('0x21')](_0x139472);return _['filter'](this[_0x87c2('0x9')],_0xc3fcb0);}};RuleEngine[_0x87c2('0x8')][_0x87c2('0x22')]=function(_0x1eeb2b,_0xbebcbf){var _0x1eeb2b=_0x1eeb2b==='on'||_0x1eeb2b==='ON'?!![]:![];var _0x1fac1e=this[_0x87c2('0x20')](_0xbebcbf);for(var _0x3ab170=0x0,_0x3cd17b=_0x1fac1e['length'];_0x3ab170<_0x3cd17b;_0x3ab170+=0x1){_0x1fac1e[_0x3ab170]['on']=_0x1eeb2b;}this[_0x87c2('0xf')]();};RuleEngine[_0x87c2('0x8')][_0x87c2('0x23')]=function(_0x13c4b0,_0x1ff134){_0x13c4b0=parseInt(_0x13c4b0,0xa);var _0x2976ec=this[_0x87c2('0x20')](_0x1ff134);for(var _0x437d37=0x0,_0x2722bb=_0x2976ec['length'];_0x437d37<_0x2722bb;_0x437d37+=0x1){_0x2976ec[_0x437d37]['priority']=_0x13c4b0;}this[_0x87c2('0xf')]();};RuleEngine[_0x87c2('0x8')][_0x87c2('0x24')]=function(){var _0x2eece1=this[_0x87c2('0x9')];if(_0x2eece1 instanceof Array){_0x2eece1=_0x2eece1[_0x87c2('0x25')](function(_0x34d2c1){_0x34d2c1[_0x87c2('0x1d')]=_0x34d2c1[_0x87c2('0x1d')][_0x87c2('0x26')]();_0x34d2c1[_0x87c2('0x27')]=_0x34d2c1['consequence']['toString']();return _0x34d2c1;});}else if(!_[_0x87c2('0x10')](_0x2eece1)){_0x2eece1[_0x87c2('0x1d')]=_0x2eece1[_0x87c2('0x1d')][_0x87c2('0x26')]();_0x2eece1[_0x87c2('0x27')]=_0x2eece1[_0x87c2('0x27')]['toString']();}return _0x2eece1;};RuleEngine[_0x87c2('0x8')][_0x87c2('0x28')]=function(_0x383da3){this[_0x87c2('0x4')]();if(_[_0x87c2('0x29')](_0x383da3)){_0x383da3=JSON['parse'](_0x383da3);}if(_0x383da3 instanceof Array){_0x383da3=_0x383da3[_0x87c2('0x25')](function(_0x337d24){_0x337d24[_0x87c2('0x1d')]=eval('('+_0x337d24[_0x87c2('0x1d')]+')');_0x337d24[_0x87c2('0x27')]=eval('('+_0x337d24[_0x87c2('0x27')]+')');return _0x337d24;});}else if(_0x383da3!==null&&typeof _0x383da3==_0x87c2('0x2a')){_0x383da3[_0x87c2('0x1d')]=eval('('+_0x383da3[_0x87c2('0x1d')]+')');_0x383da3[_0x87c2('0x27')]=eval('('+_0x383da3['consequence']+')');}this[_0x87c2('0x5')](_0x383da3);};module[_0x87c2('0x2b')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 62f848b..9ef1d9a 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 _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x25db85,_0x2ae8fe){var _0x3e9651=function(_0x155ede){while(--_0x155ede){_0x25db85['push'](_0x25db85['shift']());}};_0x3e9651(++_0x2ae8fe);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x307591,_0x38a143){var _0x1a8b9f=function(_0x2aad40){while(--_0x2aad40){_0x307591['push'](_0x307591['shift']());}};_0x1a8b9f(++_0x38a143);}(_0x814b,0x1a2));var _0xb814=function(_0x13d5bc,_0x3fce3c){_0x13d5bc=_0x13d5bc-0x0;var _0x4b8a40=_0x814b[_0x13d5bc];return _0x4b8a40;};'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 diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index bda10c3..9b51a03 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 _0xb21e=['mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','prototype','Capacity','working','idle','updateRealtime','mail','openchannel','fax','length','getChannelStatus','StatusTime','toNumber','format','voicePause','chatCurrentCapacity','faxStatusTime','openchannelCurrentCapacity','stringify','emit','lodash','md5','ioredis','../../../config/environment','redis','defaults','name','online','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity'];(function(_0x1f146e,_0x4ae2ad){var _0x35069f=function(_0xf8f9b1){while(--_0xf8f9b1){_0x1f146e['push'](_0x1f146e['shift']());}};_0x35069f(++_0x4ae2ad);}(_0xb21e,0x122));var _0xeb21=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb21e[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xeb21('0x0'));var moment=require('moment');var md5=require(_0xeb21('0x1'));var Redis=require(_0xeb21('0x2'));var config=require(_0xeb21('0x3'));config[_0xeb21('0x4')]=_[_0xeb21('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x578c0c){this['id']=_0x578c0c['id']||0x0;this['name']=_0x578c0c[_0xeb21('0x6')]||'';this[_0xeb21('0x7')]=_0x578c0c[_0xeb21('0x7')]||!![];this['voicePause']=_0x578c0c['voicePause']||![];this[_0xeb21('0x8')]=_0x578c0c[_0xeb21('0x8')]||![];this[_0xeb21('0x9')]=_0x578c0c[_0xeb21('0x9')]||![];this[_0xeb21('0xa')]=_0x578c0c[_0xeb21('0xa')]||![];this['smsPause']=_0x578c0c['smsPause']||![];this[_0xeb21('0xb')]=_0x578c0c['openchannelPause']||![];this[_0xeb21('0xc')]=_0xeb21('0xd');this[_0xeb21('0xe')]=0x0;this['chatCapacity']=_0x578c0c[_0xeb21('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xeb21('0x10')]='unknown';this[_0xeb21('0x11')]=0x0;this[_0xeb21('0x12')]=_0x578c0c[_0xeb21('0x12')]||0x0;this[_0xeb21('0x13')]=0x0;this[_0xeb21('0x14')]='unknown';this['faxStatusTime']=0x0;this[_0xeb21('0x15')]=_0x578c0c['faxCapacity']||0x0;this[_0xeb21('0x16')]=0x0;this[_0xeb21('0x17')]=_0xeb21('0xd');this[_0xeb21('0x18')]=0x0;this['smsCapacity']=_0x578c0c[_0xeb21('0x19')]||0x0;this[_0xeb21('0x1a')]=0x0;this[_0xeb21('0x1b')]='unknown';this[_0xeb21('0x1c')]=0x0;this[_0xeb21('0x1d')]=_0x578c0c['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xeb21('0x1e')]=![];this[_0xeb21('0x1f')]=undefined;this[_0xeb21('0x1')]='';this['updateRealtime']();}Agent[_0xeb21('0x20')]['getChannelStatus']=function(_0x551035){if(this[_0x551035+'CurrentCapacity']>0x0){if(this[_0x551035+'Capacity']>0x0&&this[_0x551035+'CurrentCapacity']>=this[_0x551035+_0xeb21('0x21')]){return'maxcapacity';}else{return _0xeb21('0x22');}}else{return _0xeb21('0x23');}};Agent[_0xeb21('0x20')][_0xeb21('0x24')]=function(){var _0x490159=[_0xeb21('0x25'),'chat',_0xeb21('0x26'),_0xeb21('0x27'),'sms'];for(var _0x2500fb=0x0;_0x2500fb<_0x490159[_0xeb21('0x28')];_0x2500fb+=0x1){var _0x3433ea=this[_0xeb21('0x29')](_0x490159[_0x2500fb]);if(this[_0x490159[_0x2500fb]+'Status']!==_0x3433ea){this[_0x490159[_0x2500fb]+_0xeb21('0x2a')]=_[_0xeb21('0x2b')](moment()[_0xeb21('0x2c')]('x'));}this[_0x490159[_0x2500fb]+'Status']=_0x3433ea;}var _0x258b63={'id':this['id'],'name':this[_0xeb21('0x6')],'online':this[_0xeb21('0x7')],'voicePause':this[_0xeb21('0x2d')],'chatPause':this[_0xeb21('0x8')],'mailPause':this[_0xeb21('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0xeb21('0xa')],'openchannelPause':this[_0xeb21('0xb')],'chatStatus':this[_0xeb21('0xc')],'chatStatusTime':this[_0xeb21('0xe')],'chatCapacity':this[_0xeb21('0xf')],'chatCurrentCapacity':this[_0xeb21('0x2e')],'mailStatus':this[_0xeb21('0x10')],'mailStatusTime':this[_0xeb21('0x11')],'mailCapacity':this[_0xeb21('0x12')],'mailCurrentCapacity':this[_0xeb21('0x13')],'faxStatus':this[_0xeb21('0x14')],'faxStatusTime':this[_0xeb21('0x2f')],'faxCapacity':this[_0xeb21('0x15')],'faxCurrentCapacity':this[_0xeb21('0x16')],'smsStatus':this[_0xeb21('0x17')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xeb21('0x19')],'smsCurrentCapacity':this[_0xeb21('0x1a')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xeb21('0x1c')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xeb21('0x30')],'busy':this[_0xeb21('0x1e')],'busyQueue':this[_0xeb21('0x1f')]};var _0x142280=md5(JSON[_0xeb21('0x31')](_0x258b63));if(this['md5']!==_0x142280){this[_0xeb21('0x1')]=_0x142280;io[_0xeb21('0x32')]('user:save',_0x258b63);}};module['exports']=Agent; \ No newline at end of file +var _0x1c38=['smsStatus','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail','chat','fax','Status','StatusTime','toNumber','format','chatCurrentCapacity','smsStatusTime','stringify','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity'];(function(_0xa244a4,_0xe34a00){var _0x18bce9=function(_0x2e26f5){while(--_0x2e26f5){_0xa244a4['push'](_0xa244a4['shift']());}};_0x18bce9(++_0xe34a00);}(_0x1c38,0xfc));var _0x81c3=function(_0x1a5361,_0x1cef2d){_0x1a5361=_0x1a5361-0x0;var _0x220abe=_0x1c38[_0x1a5361];return _0x220abe;};'use strict';var _=require(_0x81c3('0x0'));var moment=require(_0x81c3('0x1'));var md5=require(_0x81c3('0x2'));var Redis=require(_0x81c3('0x3'));var config=require(_0x81c3('0x4'));config['redis']=_[_0x81c3('0x5')](config[_0x81c3('0x6')],{'host':_0x81c3('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x81c3('0x6')]));function Agent(_0x33da92){this['id']=_0x33da92['id']||0x0;this[_0x81c3('0x8')]=_0x33da92[_0x81c3('0x8')]||'';this['online']=_0x33da92[_0x81c3('0x9')]||!![];this[_0x81c3('0xa')]=_0x33da92['voicePause']||![];this[_0x81c3('0xb')]=_0x33da92[_0x81c3('0xb')]||![];this[_0x81c3('0xc')]=_0x33da92[_0x81c3('0xc')]||![];this[_0x81c3('0xd')]=_0x33da92['faxPause']||![];this[_0x81c3('0xe')]=_0x33da92[_0x81c3('0xe')]||![];this[_0x81c3('0xf')]=_0x33da92[_0x81c3('0xf')]||![];this[_0x81c3('0x10')]='unknown';this[_0x81c3('0x11')]=0x0;this[_0x81c3('0x12')]=_0x33da92[_0x81c3('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x81c3('0x13')]=_0x81c3('0x14');this[_0x81c3('0x15')]=0x0;this[_0x81c3('0x16')]=_0x33da92[_0x81c3('0x16')]||0x0;this[_0x81c3('0x17')]=0x0;this[_0x81c3('0x18')]='unknown';this[_0x81c3('0x19')]=0x0;this[_0x81c3('0x1a')]=_0x33da92[_0x81c3('0x1a')]||0x0;this[_0x81c3('0x1b')]=0x0;this[_0x81c3('0x1c')]=_0x81c3('0x14');this['smsStatusTime']=0x0;this['smsCapacity']=_0x33da92[_0x81c3('0x1d')]||0x0;this[_0x81c3('0x1e')]=0x0;this[_0x81c3('0x1f')]=_0x81c3('0x14');this[_0x81c3('0x20')]=0x0;this[_0x81c3('0x21')]=_0x33da92[_0x81c3('0x21')]||0x0;this[_0x81c3('0x22')]=0x0;this['busy']=![];this[_0x81c3('0x23')]=undefined;this[_0x81c3('0x2')]='';this['updateRealtime']();}Agent[_0x81c3('0x24')][_0x81c3('0x25')]=function(_0x17f363){if(this[_0x17f363+'CurrentCapacity']>0x0){if(this[_0x17f363+'Capacity']>0x0&&this[_0x17f363+_0x81c3('0x26')]>=this[_0x17f363+_0x81c3('0x27')]){return _0x81c3('0x28');}else{return _0x81c3('0x29');}}else{return _0x81c3('0x2a');}};Agent['prototype'][_0x81c3('0x2b')]=function(){var _0x1e4bc1=[_0x81c3('0x2c'),_0x81c3('0x2d'),'openchannel',_0x81c3('0x2e'),'sms'];for(var _0x491d9b=0x0;_0x491d9b<_0x1e4bc1['length'];_0x491d9b+=0x1){var _0x2761e3=this[_0x81c3('0x25')](_0x1e4bc1[_0x491d9b]);if(this[_0x1e4bc1[_0x491d9b]+_0x81c3('0x2f')]!==_0x2761e3){this[_0x1e4bc1[_0x491d9b]+_0x81c3('0x30')]=_[_0x81c3('0x31')](moment()[_0x81c3('0x32')]('x'));}this[_0x1e4bc1[_0x491d9b]+_0x81c3('0x2f')]=_0x2761e3;}var _0x11bae7={'id':this['id'],'name':this[_0x81c3('0x8')],'online':this[_0x81c3('0x9')],'voicePause':this[_0x81c3('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0x81c3('0xc')],'smsPause':this[_0x81c3('0xe')],'faxPause':this[_0x81c3('0xd')],'openchannelPause':this[_0x81c3('0xf')],'chatStatus':this[_0x81c3('0x10')],'chatStatusTime':this[_0x81c3('0x11')],'chatCapacity':this[_0x81c3('0x12')],'chatCurrentCapacity':this[_0x81c3('0x33')],'mailStatus':this[_0x81c3('0x13')],'mailStatusTime':this[_0x81c3('0x15')],'mailCapacity':this[_0x81c3('0x16')],'mailCurrentCapacity':this[_0x81c3('0x17')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x81c3('0x34')],'smsCapacity':this[_0x81c3('0x1d')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0x81c3('0x1f')],'openchannelStatusTime':this[_0x81c3('0x20')],'openchannelCapacity':this[_0x81c3('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x4bf846=md5(JSON[_0x81c3('0x35')](_0x11bae7));if(this[_0x81c3('0x2')]!==_0x4bf846){this['md5']=_0x4bf846;io['emit'](_0x81c3('0x36'),_0x11bae7);}};module[_0x81c3('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 8c33f63..e07ac0d 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 _0x7ec8=['lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','paused','available','stringify','format','chat:queue:%s','emit'];(function(_0x246eb8,_0x24c0bc){var _0x15c956=function(_0x1fce5c){while(--_0x1fce5c){_0x246eb8['push'](_0x246eb8['shift']());}};_0x15c956(++_0x24c0bc);}(_0x7ec8,0x1ed));var _0x87ec=function(_0x22f4dc,_0x26599c){_0x22f4dc=_0x22f4dc-0x0;var _0x233907=_0x7ec8[_0x22f4dc];return _0x233907;};'use strict';var _=require(_0x87ec('0x0'));var md5=require(_0x87ec('0x1'));var util=require(_0x87ec('0x2'));var Redis=require(_0x87ec('0x3'));var config=require(_0x87ec('0x4'));config[_0x87ec('0x5')]=_[_0x87ec('0x6')](config[_0x87ec('0x5')],{'host':_0x87ec('0x7'),'port':0x18eb});var io=require(_0x87ec('0x8'))(new Redis(config['redis']));function ChatQueue(_0x325aaf){this['id']=_0x325aaf['id']||0x0;this[_0x87ec('0x9')]=_0x325aaf['name']||'';this[_0x87ec('0xa')]=_0x325aaf[_0x87ec('0xa')]||0xa;this['strategy']=_0x325aaf[_0x87ec('0xb')]||'beepall';this[_0x87ec('0xc')]=_0x325aaf[_0x87ec('0xc')];this['mapAgentsId']={};this[_0x87ec('0xd')]=0x0;this[_0x87ec('0x1')]='';this[_0x87ec('0xe')]();this[_0x87ec('0xf')]();}ChatQueue[_0x87ec('0x10')]['updateRouting']=function(){var _0x3a5213=this[_0x87ec('0x11')][_0x87ec('0x12')];this[_0x87ec('0x11')]=_[_0x87ec('0x13')](this[_0x87ec('0xc')],'id');this[_0x87ec('0x11')][_0x87ec('0x12')]=_0x3a5213;};ChatQueue[_0x87ec('0x10')][_0x87ec('0xf')]=function(){this[_0x87ec('0x14')]=0x0;this['paused']=0x0;for(var _0x257345=0x0;_0x257345=0x0?this[_0x87ec('0x18')]:0x0;var _0x13b81f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x87ec('0x14')],'name':this[_0x87ec('0x9')],'paused':this[_0x87ec('0x17')],'waiting':this[_0x87ec('0xd')]};var _0x2e5df0=md5(JSON[_0x87ec('0x19')](_0x13b81f));if(this[_0x87ec('0x1')]!==_0x2e5df0){this[_0x87ec('0x1')]=_0x2e5df0;io['to'](util[_0x87ec('0x1a')](_0x87ec('0x1b'),_0x13b81f[_0x87ec('0x9')]))[_0x87ec('0x1c')]('chat_queue:save',_0x13b81f);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x7d5c=['chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','online','chatPause','paused','available','stringify','format'];(function(_0x4d964a,_0x13d2dc){var _0x230a36=function(_0x4687ca){while(--_0x4687ca){_0x4d964a['push'](_0x4d964a['shift']());}};_0x230a36(++_0x13d2dc);}(_0x7d5c,0x9f));var _0xc7d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc7d5('0x0'));var md5=require(_0xc7d5('0x1'));var util=require(_0xc7d5('0x2'));var Redis=require(_0xc7d5('0x3'));var config=require(_0xc7d5('0x4'));config[_0xc7d5('0x5')]=_['defaults'](config[_0xc7d5('0x5')],{'host':_0xc7d5('0x6'),'port':0x18eb});var io=require(_0xc7d5('0x7'))(new Redis(config[_0xc7d5('0x5')]));function ChatQueue(_0x256e5d){this['id']=_0x256e5d['id']||0x0;this[_0xc7d5('0x8')]=_0x256e5d['name']||'';this[_0xc7d5('0x9')]=_0x256e5d[_0xc7d5('0x9')]||0xa;this[_0xc7d5('0xa')]=_0x256e5d['strategy']||_0xc7d5('0xb');this[_0xc7d5('0xc')]=_0x256e5d[_0xc7d5('0xc')];this[_0xc7d5('0xd')]={};this[_0xc7d5('0xe')]=0x0;this[_0xc7d5('0x1')]='';this[_0xc7d5('0xf')]();this[_0xc7d5('0x10')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x4f7f02=this[_0xc7d5('0xd')][_0xc7d5('0x11')];this['mapAgentsId']=_[_0xc7d5('0x12')](this[_0xc7d5('0xc')],'id');this[_0xc7d5('0xd')][_0xc7d5('0x11')]=_0x4f7f02;};ChatQueue[_0xc7d5('0x13')][_0xc7d5('0x10')]=function(){this[_0xc7d5('0x14')]=0x0;this['paused']=0x0;for(var _0x4e03aa=0x0;_0x4e03aa=0x0?this[_0xc7d5('0x18')]:0x0;var _0x3cd6e6={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xc7d5('0x8')],'paused':this[_0xc7d5('0x17')],'waiting':this[_0xc7d5('0xe')]};var _0xcd1f14=md5(JSON[_0xc7d5('0x19')](_0x3cd6e6));if(this[_0xc7d5('0x1')]!==_0xcd1f14){this[_0xc7d5('0x1')]=_0xcd1f14;io['to'](util[_0xc7d5('0x1a')](_0xc7d5('0x1b'),_0x3cd6e6['name']))[_0xc7d5('0x1c')](_0xc7d5('0x1d'),_0x3cd6e6);}};module[_0xc7d5('0x1e')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index c847a9a..79a75b1 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 _0x2503=['md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','faxPause','available','format','emit','fax_queue:save'];(function(_0x3e0bea,_0xa74dbe){var _0x520030=function(_0x39d003){while(--_0x39d003){_0x3e0bea['push'](_0x3e0bea['shift']());}};_0x520030(++_0xa74dbe);}(_0x2503,0xfa));var _0x3250=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2503[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require(_0x3250('0x0'));var util=require('util');var Redis=require(_0x3250('0x1'));var config=require(_0x3250('0x2'));config[_0x3250('0x3')]=_[_0x3250('0x4')](config[_0x3250('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x3250('0x5'))(new Redis(config[_0x3250('0x3')]));function FaxQueue(_0x5a4f9e){this['id']=_0x5a4f9e['id']||0x0;this[_0x3250('0x6')]=_0x5a4f9e[_0x3250('0x6')]||'';this[_0x3250('0x7')]=_0x5a4f9e[_0x3250('0x7')]||0xa;this[_0x3250('0x8')]=_0x5a4f9e[_0x3250('0x8')]||_0x3250('0x9');this[_0x3250('0xa')]=_0x5a4f9e[_0x3250('0xa')];this[_0x3250('0xb')]={};this[_0x3250('0xc')]=0x0;this[_0x3250('0x0')]='';this[_0x3250('0xd')]();this[_0x3250('0xe')]();}FaxQueue[_0x3250('0xf')]['updateRouting']=function(){var _0x9d8d8e=this[_0x3250('0xb')][_0x3250('0x10')];this[_0x3250('0xb')]=_[_0x3250('0x11')](this[_0x3250('0xa')],'id');this[_0x3250('0xb')][_0x3250('0x10')]=_0x9d8d8e;};FaxQueue['prototype'][_0x3250('0xe')]=function(){this[_0x3250('0x12')]=0x0;this[_0x3250('0x13')]=0x0;for(var _0x55f13d=0x0;_0x55f13d=0x0?this[_0x3250('0x15')]:0x0;var _0x4eda32={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x3250('0xc')]};var _0x24a728=md5(JSON['stringify'](_0x4eda32));if(this[_0x3250('0x0')]!==_0x24a728){this[_0x3250('0x0')]=_0x24a728;io['to'](util[_0x3250('0x16')]('fax:queue:%s',_0x4eda32[_0x3250('0x6')]))[_0x3250('0x17')](_0x3250('0x18'),_0x4eda32);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x1259=['updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5'];(function(_0x3c0cbb,_0x3c42d8){var _0x42b5bc=function(_0x2a4639){while(--_0x2a4639){_0x3c0cbb['push'](_0x3c0cbb['shift']());}};_0x42b5bc(++_0x3c42d8);}(_0x1259,0x1c3));var _0x9125=function(_0x33d534,_0x13aa85){_0x33d534=_0x33d534-0x0;var _0xb07093=_0x1259[_0x33d534];return _0xb07093;};'use strict';var _=require(_0x9125('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x9125('0x1'));var config=require(_0x9125('0x2'));config[_0x9125('0x3')]=_[_0x9125('0x4')](config[_0x9125('0x3')],{'host':_0x9125('0x5'),'port':0x18eb});var io=require(_0x9125('0x6'))(new Redis(config[_0x9125('0x3')]));function FaxQueue(_0x5a69bd){this['id']=_0x5a69bd['id']||0x0;this['name']=_0x5a69bd[_0x9125('0x7')]||'';this['timeout']=_0x5a69bd[_0x9125('0x8')]||0xa;this[_0x9125('0x9')]=_0x5a69bd[_0x9125('0x9')]||'beepall';this[_0x9125('0xa')]=_0x5a69bd[_0x9125('0xa')];this[_0x9125('0xb')]={};this[_0x9125('0xc')]=0x0;this[_0x9125('0xd')]='';this[_0x9125('0xe')]();this[_0x9125('0xf')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x585dec=this[_0x9125('0xb')][_0x9125('0x10')];this['mapAgentsId']=_[_0x9125('0x11')](this[_0x9125('0xa')],'id');this[_0x9125('0xb')][_0x9125('0x10')]=_0x585dec;};FaxQueue[_0x9125('0x12')][_0x9125('0xf')]=function(){this[_0x9125('0x13')]=0x0;this[_0x9125('0x14')]=0x0;for(var _0x1f0b26=0x0;_0x1f0b26=0x0?this[_0x9125('0x18')]:0x0;var _0x54864b={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9125('0x13')],'name':this[_0x9125('0x7')],'paused':this[_0x9125('0x14')],'waiting':this['waiting']};var _0x2a8615=md5(JSON[_0x9125('0x19')](_0x54864b));if(this['md5']!==_0x2a8615){this['md5']=_0x2a8615;io['to'](util[_0x9125('0x1a')](_0x9125('0x1b'),_0x54864b[_0x9125('0x7')]))[_0x9125('0x1c')](_0x9125('0x1d'),_0x54864b);}};module[_0x9125('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index b5834ad..f766c6f 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 _0x49eb=['Intervals','exports','name'];(function(_0x2c9ccd,_0x4f3f3f){var _0x3c5182=function(_0x566ead){while(--_0x566ead){_0x2c9ccd['push'](_0x2c9ccd['shift']());}};_0x3c5182(++_0x4f3f3f);}(_0x49eb,0x110));var _0xb49e=function(_0x1bc01b,_0x1378a2){_0x1bc01b=_0x1bc01b-0x0;var _0x2ffbcc=_0x49eb[_0x1bc01b];return _0x2ffbcc;};'use strict';function Interval(_0xef8edb){this['id']=_0xef8edb['id']||0x0;this[_0xb49e('0x0')]=_0xef8edb['name']||'';this[_0xb49e('0x1')]=_0xef8edb[_0xb49e('0x1')]||{};}module[_0xb49e('0x2')]=Interval; \ No newline at end of file +var _0x9635=['exports','name','Intervals'];(function(_0xcb6339,_0x3e7c05){var _0xa3211e=function(_0x47ec7d){while(--_0x47ec7d){_0xcb6339['push'](_0xcb6339['shift']());}};_0xa3211e(++_0x3e7c05);}(_0x9635,0x151));var _0x5963=function(_0x106f9f,_0x25dce5){_0x106f9f=_0x106f9f-0x0;var _0x58fb9d=_0x9635[_0x106f9f];return _0x58fb9d;};'use strict';function Interval(_0x3dae3b){this['id']=_0x3dae3b['id']||0x0;this[_0x5963('0x0')]=_0x3dae3b[_0x5963('0x0')]||'';this[_0x5963('0x1')]=_0x3dae3b[_0x5963('0x1')]||{};}module[_0x5963('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 0c2f6f1..e2da5f0 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 _0x8277=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','mail_queue:save','exports','md5','util','../../../config/environment','redis','localhost','name','timeout','strategy','beepall'];(function(_0x1a4e06,_0x2cb7c5){var _0x4b4cbf=function(_0x851014){while(--_0x851014){_0x1a4e06['push'](_0x1a4e06['shift']());}};_0x4b4cbf(++_0x2cb7c5);}(_0x8277,0xcf));var _0x7827=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x8277[_0x261b8a];return _0x3455e8;};'use strict';var _=require('lodash');var md5=require(_0x7827('0x0'));var util=require(_0x7827('0x1'));var Redis=require('ioredis');var config=require(_0x7827('0x2'));config[_0x7827('0x3')]=_['defaults'](config[_0x7827('0x3')],{'host':_0x7827('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7827('0x3')]));function MailQueue(_0x14fc9b){this['id']=_0x14fc9b['id']||0x0;this[_0x7827('0x5')]=_0x14fc9b['name']||'';this[_0x7827('0x6')]=_0x14fc9b[_0x7827('0x6')]||0xa;this[_0x7827('0x7')]=_0x14fc9b[_0x7827('0x7')]||_0x7827('0x8');this[_0x7827('0x9')]=_0x14fc9b[_0x7827('0x9')];this[_0x7827('0xa')]={};this[_0x7827('0xb')]=0x0;this[_0x7827('0x0')]='';this[_0x7827('0xc')]();this[_0x7827('0xd')]();}MailQueue[_0x7827('0xe')][_0x7827('0xc')]=function(){var _0x51bc18=this[_0x7827('0xa')][_0x7827('0xf')];this[_0x7827('0xa')]=_[_0x7827('0x10')](this['Agents'],'id');this[_0x7827('0xa')][_0x7827('0xf')]=_0x51bc18;};MailQueue[_0x7827('0xe')][_0x7827('0xd')]=function(){this[_0x7827('0x11')]=0x0;this[_0x7827('0x12')]=0x0;for(var _0x35c668=0x0;_0x35c668=0x0?this[_0x7827('0x16')]:0x0;var _0x2e001d={'id':this['id'],'available':this[_0x7827('0x16')],'loggedIn':this[_0x7827('0x11')],'name':this['name'],'paused':this[_0x7827('0x12')],'waiting':this[_0x7827('0xb')]};var _0x30f90f=md5(JSON[_0x7827('0x17')](_0x2e001d));if(this[_0x7827('0x0')]!==_0x30f90f){this[_0x7827('0x0')]=_0x30f90f;io['to'](util[_0x7827('0x18')]('mail:queue:%s',_0x2e001d[_0x7827('0x5')]))['emit'](_0x7827('0x19'),_0x2e001d);}};module[_0x7827('0x1a')]=MailQueue; \ No newline at end of file +var _0x53ec=['paused','length','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','loggedIn'];(function(_0x156b2a,_0x157d97){var _0x953e01=function(_0x5af204){while(--_0x5af204){_0x156b2a['push'](_0x156b2a['shift']());}};_0x953e01(++_0x157d97);}(_0x53ec,0x192));var _0xc53e=function(_0x16438a,_0x3544be){_0x16438a=_0x16438a-0x0;var _0x9d2e74=_0x53ec[_0x16438a];return _0x9d2e74;};'use strict';var _=require(_0xc53e('0x0'));var md5=require(_0xc53e('0x1'));var util=require(_0xc53e('0x2'));var Redis=require(_0xc53e('0x3'));var config=require(_0xc53e('0x4'));config[_0xc53e('0x5')]=_['defaults'](config[_0xc53e('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc53e('0x6'))(new Redis(config[_0xc53e('0x5')]));function MailQueue(_0x4a9c59){this['id']=_0x4a9c59['id']||0x0;this[_0xc53e('0x7')]=_0x4a9c59['name']||'';this[_0xc53e('0x8')]=_0x4a9c59[_0xc53e('0x8')]||0xa;this['strategy']=_0x4a9c59[_0xc53e('0x9')]||_0xc53e('0xa');this[_0xc53e('0xb')]=_0x4a9c59[_0xc53e('0xb')];this[_0xc53e('0xc')]={};this[_0xc53e('0xd')]=0x0;this[_0xc53e('0x1')]='';this[_0xc53e('0xe')]();this[_0xc53e('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0x35128a=this['mapAgentsId']['_rr'];this[_0xc53e('0xc')]=_[_0xc53e('0x10')](this[_0xc53e('0xb')],'id');this[_0xc53e('0xc')]['_rr']=_0x35128a;};MailQueue['prototype'][_0xc53e('0xf')]=function(){this[_0xc53e('0x11')]=0x0;this[_0xc53e('0x12')]=0x0;for(var _0x3d2e17=0x0;_0x3d2e17=0x0?this[_0xc53e('0x15')]:0x0;var _0x2d4ebb={'id':this['id'],'available':this[_0xc53e('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xc53e('0x12')],'waiting':this[_0xc53e('0xd')]};var _0x421641=md5(JSON[_0xc53e('0x16')](_0x2d4ebb));if(this[_0xc53e('0x1')]!==_0x421641){this[_0xc53e('0x1')]=_0x421641;io['to'](util[_0xc53e('0x17')](_0xc53e('0x18'),_0x2d4ebb[_0xc53e('0x7')]))[_0xc53e('0x19')](_0xc53e('0x1a'),_0x2d4ebb);}};module[_0xc53e('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 9d36690..4f4f734 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 _0xa3d1=['waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','stringify','format','openchannel:queue:%s','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x446d45,_0x39de0b){var _0x352b36=function(_0x18b265){while(--_0x18b265){_0x446d45['push'](_0x446d45['shift']());}};_0x352b36(++_0x39de0b);}(_0xa3d1,0x197));var _0x1a3d=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xa3d1[_0x4c06a3];return _0x7ff53c;};'use strict';var _=require(_0x1a3d('0x0'));var md5=require(_0x1a3d('0x1'));var util=require(_0x1a3d('0x2'));var Redis=require(_0x1a3d('0x3'));var config=require(_0x1a3d('0x4'));config[_0x1a3d('0x5')]=_[_0x1a3d('0x6')](config['redis'],{'host':_0x1a3d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1a3d('0x5')]));function OpenchannelQueue(_0x2a01eb){this['id']=_0x2a01eb['id']||0x0;this[_0x1a3d('0x8')]=_0x2a01eb[_0x1a3d('0x8')]||'';this[_0x1a3d('0x9')]=_0x2a01eb[_0x1a3d('0x9')]||0xa;this[_0x1a3d('0xa')]=_0x2a01eb[_0x1a3d('0xa')]||'beepall';this[_0x1a3d('0xb')]=_0x2a01eb[_0x1a3d('0xb')];this[_0x1a3d('0xc')]={};this[_0x1a3d('0xd')]=0x0;this['md5']='';this[_0x1a3d('0xe')]();this[_0x1a3d('0xf')]();}OpenchannelQueue[_0x1a3d('0x10')][_0x1a3d('0xe')]=function(){var _0x30bf99=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x1a3d('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x1a3d('0x12')]=_0x30bf99;};OpenchannelQueue['prototype'][_0x1a3d('0xf')]=function(){this[_0x1a3d('0x13')]=0x0;this[_0x1a3d('0x14')]=0x0;for(var _0x322aa9=0x0;_0x322aa9=0x0?this[_0x1a3d('0x18')]:0x0;var _0xbeb5fc={'id':this['id'],'available':this[_0x1a3d('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x1a3d('0x8')],'paused':this[_0x1a3d('0x14')],'waiting':this[_0x1a3d('0xd')]};var _0x7b50af=md5(JSON[_0x1a3d('0x19')](_0xbeb5fc));if(this['md5']!==_0x7b50af){this[_0x1a3d('0x1')]=_0x7b50af;io['to'](util[_0x1a3d('0x1a')](_0x1a3d('0x1b'),_0xbeb5fc[_0x1a3d('0x8')]))['emit'](_0x1a3d('0x1c'),_0xbeb5fc);}};module[_0x1a3d('0x1d')]=OpenchannelQueue; \ No newline at end of file +var _0xa74b=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','md5','defaults','localhost'];(function(_0xe9c8e4,_0x3aa2f6){var _0x2037fa=function(_0xcb43b1){while(--_0xcb43b1){_0xe9c8e4['push'](_0xe9c8e4['shift']());}};_0x2037fa(++_0x3aa2f6);}(_0xa74b,0x140));var _0xba74=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa74b[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xba74('0x0'));var md5=require(_0xba74('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xba74('0x2')](config['redis'],{'host':_0xba74('0x3'),'port':0x18eb});var io=require(_0xba74('0x4'))(new Redis(config['redis']));function OpenchannelQueue(_0x36bc3e){this['id']=_0x36bc3e['id']||0x0;this[_0xba74('0x5')]=_0x36bc3e[_0xba74('0x5')]||'';this[_0xba74('0x6')]=_0x36bc3e[_0xba74('0x6')]||0xa;this[_0xba74('0x7')]=_0x36bc3e[_0xba74('0x7')]||_0xba74('0x8');this[_0xba74('0x9')]=_0x36bc3e[_0xba74('0x9')];this[_0xba74('0xa')]={};this[_0xba74('0xb')]=0x0;this[_0xba74('0x1')]='';this[_0xba74('0xc')]();this[_0xba74('0xd')]();}OpenchannelQueue[_0xba74('0xe')][_0xba74('0xc')]=function(){var _0x5c56a3=this['mapAgentsId'][_0xba74('0xf')];this['mapAgentsId']=_[_0xba74('0x10')](this[_0xba74('0x9')],'id');this['mapAgentsId'][_0xba74('0xf')]=_0x5c56a3;};OpenchannelQueue[_0xba74('0xe')][_0xba74('0xd')]=function(){this[_0xba74('0x11')]=0x0;this[_0xba74('0x12')]=0x0;for(var _0x5a4c4f=0x0;_0x5a4c4f=0x0?this['available']:0x0;var _0x244899={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xba74('0x5')],'paused':this[_0xba74('0x12')],'waiting':this['waiting']};var _0x2447af=md5(JSON[_0xba74('0x16')](_0x244899));if(this[_0xba74('0x1')]!==_0x2447af){this[_0xba74('0x1')]=_0x2447af;io['to'](util['format'](_0xba74('0x17'),_0x244899[_0xba74('0x5')]))[_0xba74('0x18')](_0xba74('0x19'),_0x244899);}};module[_0xba74('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 45f2bdf..62467f0 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 _0xa344=['name','timeout','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','paused','length','online','available','loggedIn','waiting','md5','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','redis','defaults','socket.io-emitter'];(function(_0x4212ad,_0xd0e96){var _0x2b2f34=function(_0xfd854c){while(--_0xfd854c){_0x4212ad['push'](_0x4212ad['shift']());}};_0x2b2f34(++_0xd0e96);}(_0xa344,0xaa));var _0x4a34=function(_0x43f0fb,_0x26bbda){_0x43f0fb=_0x43f0fb-0x0;var _0x4f5715=_0xa344[_0x43f0fb];return _0x4f5715;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x4a34('0x0'));var Redis=require(_0x4a34('0x1'));var config=require('../../../config/environment');config[_0x4a34('0x2')]=_[_0x4a34('0x3')](config[_0x4a34('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x4a34('0x4'))(new Redis(config['redis']));function SmsQueue(_0x462bcd){this['id']=_0x462bcd['id']||0x0;this[_0x4a34('0x5')]=_0x462bcd[_0x4a34('0x5')]||'';this['timeout']=_0x462bcd[_0x4a34('0x6')]||0xa;this['strategy']=_0x462bcd['strategy']||_0x4a34('0x7');this[_0x4a34('0x8')]=_0x462bcd['Agents'];this[_0x4a34('0x9')]={};this['waiting']=0x0;this['md5']='';this[_0x4a34('0xa')]();this['updateRealtime']();}SmsQueue[_0x4a34('0xb')][_0x4a34('0xa')]=function(){var _0x516107=this[_0x4a34('0x9')][_0x4a34('0xc')];this[_0x4a34('0x9')]=_[_0x4a34('0xd')](this[_0x4a34('0x8')],'id');this[_0x4a34('0x9')][_0x4a34('0xc')]=_0x516107;};SmsQueue[_0x4a34('0xb')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x4a34('0xe')]=0x0;for(var _0x1fc528=0x0;_0x1fc528=0x0?this['available']:0x0;var _0x165c7b={'id':this['id'],'available':this[_0x4a34('0x11')],'loggedIn':this[_0x4a34('0x12')],'name':this[_0x4a34('0x5')],'paused':this[_0x4a34('0xe')],'waiting':this[_0x4a34('0x13')]};var _0x4ccbe7=md5(JSON['stringify'](_0x165c7b));if(this[_0x4a34('0x14')]!==_0x4ccbe7){this[_0x4a34('0x14')]=_0x4ccbe7;io['to'](util['format'](_0x4a34('0x15'),_0x165c7b[_0x4a34('0x5')]))[_0x4a34('0x16')](_0x4a34('0x17'),_0x165c7b);}};module[_0x4a34('0x18')]=SmsQueue; \ No newline at end of file +var _0xe0cc=['updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','paused','available','stringify','format','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x4d1c98,_0x19dcc2){var _0x297a34=function(_0x2dfb4f){while(--_0x2dfb4f){_0x4d1c98['push'](_0x4d1c98['shift']());}};_0x297a34(++_0x19dcc2);}(_0xe0cc,0x1cd));var _0xce0c=function(_0x2e97d7,_0x416510){_0x2e97d7=_0x2e97d7-0x0;var _0x22b235=_0xe0cc[_0x2e97d7];return _0x22b235;};'use strict';var _=require(_0xce0c('0x0'));var md5=require(_0xce0c('0x1'));var util=require(_0xce0c('0x2'));var Redis=require('ioredis');var config=require(_0xce0c('0x3'));config[_0xce0c('0x4')]=_[_0xce0c('0x5')](config[_0xce0c('0x4')],{'host':_0xce0c('0x6'),'port':0x18eb});var io=require(_0xce0c('0x7'))(new Redis(config[_0xce0c('0x4')]));function SmsQueue(_0x4015ff){this['id']=_0x4015ff['id']||0x0;this[_0xce0c('0x8')]=_0x4015ff[_0xce0c('0x8')]||'';this[_0xce0c('0x9')]=_0x4015ff[_0xce0c('0x9')]||0xa;this['strategy']=_0x4015ff[_0xce0c('0xa')]||_0xce0c('0xb');this[_0xce0c('0xc')]=_0x4015ff[_0xce0c('0xc')];this[_0xce0c('0xd')]={};this[_0xce0c('0xe')]=0x0;this['md5']='';this[_0xce0c('0xf')]();this['updateRealtime']();}SmsQueue[_0xce0c('0x10')]['updateRouting']=function(){var _0x2ff797=this[_0xce0c('0xd')][_0xce0c('0x11')];this['mapAgentsId']=_[_0xce0c('0x12')](this['Agents'],'id');this[_0xce0c('0xd')][_0xce0c('0x11')]=_0x2ff797;};SmsQueue[_0xce0c('0x10')][_0xce0c('0x13')]=function(){this[_0xce0c('0x14')]=0x0;this['paused']=0x0;for(var _0x5d6416=0x0;_0x5d6416=0x0?this['available']:0x0;var _0x532735={'id':this['id'],'available':this[_0xce0c('0x18')],'loggedIn':this[_0xce0c('0x14')],'name':this['name'],'paused':this[_0xce0c('0x17')],'waiting':this[_0xce0c('0xe')]};var _0x2ac251=md5(JSON[_0xce0c('0x19')](_0x532735));if(this[_0xce0c('0x1')]!==_0x2ac251){this[_0xce0c('0x1')]=_0x2ac251;io['to'](util[_0xce0c('0x1a')]('sms:queue:%s',_0x532735[_0xce0c('0x8')]))['emit']('sms_queue:save',_0x532735);}};module[_0xce0c('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 389adfe..734b286 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 _0xe29c=['../model/faxQueue','agents','chatQueues','smsQueues','mailQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','mergeFromDatabase','initAgents','length','isUndefined','prototype','intervals','initOpenchannelQueues','openchannelQueues','updateRealtime','initChatQueues','updateRouting','initSmsQueues','initMailQueues','initFaxQueues','bluebird','util','lodash','moment','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe29c,0x1c6));var _0xce29=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe29c[_0x3ab51d];return _0x29a04e;};'use strict';var BPromise=require(_0xce29('0x0'));var util=require(_0xce29('0x1'));var _=require(_0xce29('0x2'));var moment=require(_0xce29('0x3'));var Agent=require('../model/agent');var Interval=require(_0xce29('0x4'));var OpenchannelQueue=require(_0xce29('0x5'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0xce29('0x6'));var MailQueue=require(_0xce29('0x7'));var FaxQueue=require(_0xce29('0x8'));var Realtime=function(){this[_0xce29('0x9')]={};this['intervals']={};this['openchannelQueues']={};this[_0xce29('0xa')]={};this[_0xce29('0xb')]={};this[_0xce29('0xc')]={};this[_0xce29('0xd')]={};this['chatQueuesWaitingInteractions']={};this[_0xce29('0xe')]={};this[_0xce29('0xf')]={};this['smsQueuesWaitingInteractions']={};this[_0xce29('0x10')]={};};function freeIsNotKey(_0xf6ae3e,_0x241c1d,_0x41e20b){var _0x240ba5=_[_0xce29('0x11')](_0xf6ae3e,function(_0x3a5c90,_0x236a7b){return _0x3a5c90[_0x41e20b];});for(var _0xd26b in _0x241c1d){if(_0x241c1d[_0xce29('0x12')](_0xd26b)){if(!_0x240ba5[_0xd26b]){delete _0x241c1d[_0xd26b];}}}}Realtime['prototype'][_0xce29('0x13')]=function(_0x6c721,_0x248566){for(var _0x3d90af in _0x248566){if(_0x6c721[_0xce29('0x12')](_0x3d90af)){_0x6c721[_0x3d90af]=_0x248566[_0x3d90af];}}};Realtime['prototype'][_0xce29('0x14')]=function(){var _0x3c3af1=this;return function(_0x264f3a){if(_0x264f3a){freeIsNotKey(_0x264f3a,_0x3c3af1[_0xce29('0x9')],'id');for(var _0x3580b8=0x0,_0x8267fd={},_0x2f06fd={};_0x3580b8<_0x264f3a[_0xce29('0x15')];_0x3580b8+=0x1){_0x8267fd=_0x264f3a[_0x3580b8];if(_[_0xce29('0x16')](_0x3c3af1['agents'][_0x8267fd['id']])){_0x3c3af1[_0xce29('0x9')][_0x8267fd['id']]=new Agent(_0x8267fd);}else{_0x3c3af1[_0xce29('0x13')](_0x3c3af1['agents'][_0x8267fd['id']],_0x8267fd);}}}return _0x3c3af1[_0xce29('0x9')];};};Realtime[_0xce29('0x17')]['initIntervals']=function(){var _0x2d67bf=this;return function(_0x16bc39){if(_0x16bc39){freeIsNotKey(_0x16bc39,_0x2d67bf[_0xce29('0x18')],'id');for(var _0x37a721=0x0,_0x20d0ca={},_0x1bf5d5={};_0x37a721<_0x16bc39[_0xce29('0x15')];_0x37a721+=0x1){_0x20d0ca=_0x16bc39[_0x37a721];if(_[_0xce29('0x16')](_0x2d67bf[_0xce29('0x18')][_0x20d0ca['id']])){_0x2d67bf[_0xce29('0x18')][_0x20d0ca['id']]=new Interval(_0x20d0ca);}else{_0x2d67bf[_0xce29('0x13')](_0x2d67bf[_0xce29('0x18')][_0x20d0ca['id']],_0x20d0ca);}}}return _0x2d67bf[_0xce29('0x18')];};};Realtime[_0xce29('0x17')][_0xce29('0x19')]=function(){var _0x30f85e=this;return function(_0x329bf3){if(_0x329bf3){freeIsNotKey(_0x329bf3,_0x30f85e[_0xce29('0x1a')],'id');for(var _0x4327e0=0x0,_0x5bf845={},_0x48ae9d={};_0x4327e0<_0x329bf3[_0xce29('0x15')];_0x4327e0+=0x1){_0x5bf845=_0x329bf3[_0x4327e0];if(_[_0xce29('0x16')](_0x30f85e[_0xce29('0x1a')][_0x5bf845['id']])){_0x30f85e[_0xce29('0x1a')][_0x5bf845['id']]=new OpenchannelQueue(_0x5bf845);}else{_0x30f85e[_0xce29('0x13')](_0x30f85e[_0xce29('0x1a')][_0x5bf845['id']],_0x5bf845);}_0x30f85e['openchannelQueues'][_0x5bf845['id']]['updateRouting']();_0x30f85e[_0xce29('0x1a')][_0x5bf845['id']][_0xce29('0x1b')]();}}return _0x30f85e[_0xce29('0x1a')];};};Realtime['prototype'][_0xce29('0x1c')]=function(){var _0x4a0d97=this;return function(_0x6b6c70){if(_0x6b6c70){freeIsNotKey(_0x6b6c70,_0x4a0d97[_0xce29('0xa')],'id');for(var _0x945eb6=0x0,_0x219776={},_0x4f9335={};_0x945eb6<_0x6b6c70[_0xce29('0x15')];_0x945eb6+=0x1){_0x219776=_0x6b6c70[_0x945eb6];if(_[_0xce29('0x16')](_0x4a0d97[_0xce29('0xa')][_0x219776['id']])){_0x4a0d97[_0xce29('0xa')][_0x219776['id']]=new ChatQueue(_0x219776);}else{_0x4a0d97[_0xce29('0x13')](_0x4a0d97[_0xce29('0xa')][_0x219776['id']],_0x219776);}_0x4a0d97[_0xce29('0xa')][_0x219776['id']][_0xce29('0x1d')]();_0x4a0d97[_0xce29('0xa')][_0x219776['id']]['updateRealtime']();}}return _0x4a0d97[_0xce29('0xa')];};};Realtime['prototype'][_0xce29('0x1e')]=function(){var _0x148c72=this;return function(_0x221513){if(_0x221513){freeIsNotKey(_0x221513,_0x148c72[_0xce29('0xb')],'id');for(var _0x42ced6=0x0,_0xff5da2={},_0x1ed63c={};_0x42ced6<_0x221513['length'];_0x42ced6+=0x1){_0xff5da2=_0x221513[_0x42ced6];if(_[_0xce29('0x16')](_0x148c72['smsQueues'][_0xff5da2['id']])){_0x148c72[_0xce29('0xb')][_0xff5da2['id']]=new SmsQueue(_0xff5da2);}else{_0x148c72[_0xce29('0x13')](_0x148c72['smsQueues'][_0xff5da2['id']],_0xff5da2);}_0x148c72[_0xce29('0xb')][_0xff5da2['id']][_0xce29('0x1d')]();_0x148c72['smsQueues'][_0xff5da2['id']][_0xce29('0x1b')]();}}return _0x148c72['smsQueues'];};};Realtime['prototype'][_0xce29('0x1f')]=function(){var _0x6b99ab=this;return function(_0x433125){if(_0x433125){freeIsNotKey(_0x433125,_0x6b99ab[_0xce29('0xc')],'id');for(var _0x2e1262=0x0,_0x5637c5={},_0x23d694={};_0x2e1262<_0x433125[_0xce29('0x15')];_0x2e1262+=0x1){_0x5637c5=_0x433125[_0x2e1262];if(_[_0xce29('0x16')](_0x6b99ab[_0xce29('0xc')][_0x5637c5['id']])){_0x6b99ab[_0xce29('0xc')][_0x5637c5['id']]=new MailQueue(_0x5637c5);}else{_0x6b99ab[_0xce29('0x13')](_0x6b99ab[_0xce29('0xc')][_0x5637c5['id']],_0x5637c5);}_0x6b99ab['mailQueues'][_0x5637c5['id']][_0xce29('0x1d')]();_0x6b99ab[_0xce29('0xc')][_0x5637c5['id']][_0xce29('0x1b')]();}}return _0x6b99ab[_0xce29('0xc')];};};Realtime['prototype'][_0xce29('0x20')]=function(){var _0x40d90d=this;return function(_0x2e14c0){if(_0x2e14c0){freeIsNotKey(_0x2e14c0,_0x40d90d[_0xce29('0xd')],'id');for(var _0x10e3e1=0x0,_0x44d394={},_0x47f55f={};_0x10e3e1<_0x2e14c0[_0xce29('0x15')];_0x10e3e1+=0x1){_0x44d394=_0x2e14c0[_0x10e3e1];if(_[_0xce29('0x16')](_0x40d90d[_0xce29('0xd')][_0x44d394['id']])){_0x40d90d['faxQueues'][_0x44d394['id']]=new FaxQueue(_0x44d394);}else{_0x40d90d[_0xce29('0x13')](_0x40d90d['faxQueues'][_0x44d394['id']],_0x44d394);}_0x40d90d[_0xce29('0xd')][_0x44d394['id']][_0xce29('0x1d')]();_0x40d90d[_0xce29('0xd')][_0x44d394['id']][_0xce29('0x1b')]();}}return _0x40d90d['faxQueues'];};};module['exports']=Realtime; \ No newline at end of file +var _0x1a46=['initFaxQueues','faxQueues','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/faxQueue','agents','chatQueues','smsQueues','mailQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','intervals','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','initMailQueues'];(function(_0x4b7fcb,_0x3e608d){var _0x32d7f0=function(_0x1ed67b){while(--_0x1ed67b){_0x4b7fcb['push'](_0x4b7fcb['shift']());}};_0x32d7f0(++_0x3e608d);}(_0x1a46,0x119));var _0x61a4=function(_0x40e73d,_0x1de888){_0x40e73d=_0x40e73d-0x0;var _0x394adf=_0x1a46[_0x40e73d];return _0x394adf;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var moment=require(_0x61a4('0x0'));var Agent=require(_0x61a4('0x1'));var Interval=require(_0x61a4('0x2'));var OpenchannelQueue=require(_0x61a4('0x3'));var ChatQueue=require(_0x61a4('0x4'));var SmsQueue=require('../model/smsQueue');var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0x61a4('0x5'));var Realtime=function(){this[_0x61a4('0x6')]={};this['intervals']={};this['openchannelQueues']={};this[_0x61a4('0x7')]={};this[_0x61a4('0x8')]={};this[_0x61a4('0x9')]={};this['faxQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x61a4('0xa')]={};this[_0x61a4('0xb')]={};this['smsQueuesWaitingInteractions']={};this[_0x61a4('0xc')]={};};function freeIsNotKey(_0x2864c9,_0x4e928e,_0x48cae1){var _0x1fd8e6=_[_0x61a4('0xd')](_0x2864c9,function(_0x10eb61,_0x1d7fc2){return _0x10eb61[_0x48cae1];});for(var _0x209318 in _0x4e928e){if(_0x4e928e[_0x61a4('0xe')](_0x209318)){if(!_0x1fd8e6[_0x209318]){delete _0x4e928e[_0x209318];}}}}Realtime[_0x61a4('0xf')][_0x61a4('0x10')]=function(_0x2f0807,_0x30cde6){for(var _0x5ba04b in _0x30cde6){if(_0x2f0807['hasOwnProperty'](_0x5ba04b)){_0x2f0807[_0x5ba04b]=_0x30cde6[_0x5ba04b];}}};Realtime[_0x61a4('0xf')][_0x61a4('0x11')]=function(){var _0x2fbf71=this;return function(_0x55040b){if(_0x55040b){freeIsNotKey(_0x55040b,_0x2fbf71[_0x61a4('0x6')],'id');for(var _0x56873f=0x0,_0x4e8904={},_0x42cbba={};_0x56873f<_0x55040b[_0x61a4('0x12')];_0x56873f+=0x1){_0x4e8904=_0x55040b[_0x56873f];if(_[_0x61a4('0x13')](_0x2fbf71[_0x61a4('0x6')][_0x4e8904['id']])){_0x2fbf71['agents'][_0x4e8904['id']]=new Agent(_0x4e8904);}else{_0x2fbf71[_0x61a4('0x10')](_0x2fbf71['agents'][_0x4e8904['id']],_0x4e8904);}}}return _0x2fbf71['agents'];};};Realtime[_0x61a4('0xf')][_0x61a4('0x14')]=function(){var _0xa91b9e=this;return function(_0x53a865){if(_0x53a865){freeIsNotKey(_0x53a865,_0xa91b9e['intervals'],'id');for(var _0x3f2757=0x0,_0xad3e70={},_0x2fe153={};_0x3f2757<_0x53a865[_0x61a4('0x12')];_0x3f2757+=0x1){_0xad3e70=_0x53a865[_0x3f2757];if(_[_0x61a4('0x13')](_0xa91b9e[_0x61a4('0x15')][_0xad3e70['id']])){_0xa91b9e['intervals'][_0xad3e70['id']]=new Interval(_0xad3e70);}else{_0xa91b9e['mergeFromDatabase'](_0xa91b9e[_0x61a4('0x15')][_0xad3e70['id']],_0xad3e70);}}}return _0xa91b9e[_0x61a4('0x15')];};};Realtime[_0x61a4('0xf')][_0x61a4('0x16')]=function(){var _0x310b08=this;return function(_0x39ecec){if(_0x39ecec){freeIsNotKey(_0x39ecec,_0x310b08[_0x61a4('0x17')],'id');for(var _0x4ce612=0x0,_0x16b5d0={},_0x4a43d4={};_0x4ce612<_0x39ecec[_0x61a4('0x12')];_0x4ce612+=0x1){_0x16b5d0=_0x39ecec[_0x4ce612];if(_[_0x61a4('0x13')](_0x310b08[_0x61a4('0x17')][_0x16b5d0['id']])){_0x310b08[_0x61a4('0x17')][_0x16b5d0['id']]=new OpenchannelQueue(_0x16b5d0);}else{_0x310b08['mergeFromDatabase'](_0x310b08[_0x61a4('0x17')][_0x16b5d0['id']],_0x16b5d0);}_0x310b08[_0x61a4('0x17')][_0x16b5d0['id']][_0x61a4('0x18')]();_0x310b08[_0x61a4('0x17')][_0x16b5d0['id']][_0x61a4('0x19')]();}}return _0x310b08[_0x61a4('0x17')];};};Realtime[_0x61a4('0xf')][_0x61a4('0x1a')]=function(){var _0x48b16d=this;return function(_0x2a2cee){if(_0x2a2cee){freeIsNotKey(_0x2a2cee,_0x48b16d[_0x61a4('0x7')],'id');for(var _0x123194=0x0,_0xc63d13={},_0x272748={};_0x123194<_0x2a2cee[_0x61a4('0x12')];_0x123194+=0x1){_0xc63d13=_0x2a2cee[_0x123194];if(_['isUndefined'](_0x48b16d[_0x61a4('0x7')][_0xc63d13['id']])){_0x48b16d[_0x61a4('0x7')][_0xc63d13['id']]=new ChatQueue(_0xc63d13);}else{_0x48b16d[_0x61a4('0x10')](_0x48b16d[_0x61a4('0x7')][_0xc63d13['id']],_0xc63d13);}_0x48b16d[_0x61a4('0x7')][_0xc63d13['id']][_0x61a4('0x18')]();_0x48b16d[_0x61a4('0x7')][_0xc63d13['id']][_0x61a4('0x19')]();}}return _0x48b16d[_0x61a4('0x7')];};};Realtime[_0x61a4('0xf')][_0x61a4('0x1b')]=function(){var _0x1bf31e=this;return function(_0x53a9e1){if(_0x53a9e1){freeIsNotKey(_0x53a9e1,_0x1bf31e[_0x61a4('0x8')],'id');for(var _0x3ee653=0x0,_0x17d697={},_0x43c439={};_0x3ee653<_0x53a9e1[_0x61a4('0x12')];_0x3ee653+=0x1){_0x17d697=_0x53a9e1[_0x3ee653];if(_['isUndefined'](_0x1bf31e[_0x61a4('0x8')][_0x17d697['id']])){_0x1bf31e[_0x61a4('0x8')][_0x17d697['id']]=new SmsQueue(_0x17d697);}else{_0x1bf31e[_0x61a4('0x10')](_0x1bf31e[_0x61a4('0x8')][_0x17d697['id']],_0x17d697);}_0x1bf31e['smsQueues'][_0x17d697['id']][_0x61a4('0x18')]();_0x1bf31e['smsQueues'][_0x17d697['id']][_0x61a4('0x19')]();}}return _0x1bf31e[_0x61a4('0x8')];};};Realtime[_0x61a4('0xf')][_0x61a4('0x1c')]=function(){var _0x5c9975=this;return function(_0x8f3ec){if(_0x8f3ec){freeIsNotKey(_0x8f3ec,_0x5c9975[_0x61a4('0x9')],'id');for(var _0x57cf3b=0x0,_0x4aa77b={},_0x1f2531={};_0x57cf3b<_0x8f3ec[_0x61a4('0x12')];_0x57cf3b+=0x1){_0x4aa77b=_0x8f3ec[_0x57cf3b];if(_[_0x61a4('0x13')](_0x5c9975['mailQueues'][_0x4aa77b['id']])){_0x5c9975[_0x61a4('0x9')][_0x4aa77b['id']]=new MailQueue(_0x4aa77b);}else{_0x5c9975['mergeFromDatabase'](_0x5c9975[_0x61a4('0x9')][_0x4aa77b['id']],_0x4aa77b);}_0x5c9975[_0x61a4('0x9')][_0x4aa77b['id']]['updateRouting']();_0x5c9975['mailQueues'][_0x4aa77b['id']][_0x61a4('0x19')]();}}return _0x5c9975[_0x61a4('0x9')];};};Realtime[_0x61a4('0xf')][_0x61a4('0x1d')]=function(){var _0xe7e32f=this;return function(_0x1fb768){if(_0x1fb768){freeIsNotKey(_0x1fb768,_0xe7e32f['faxQueues'],'id');for(var _0x504611=0x0,_0x4ddbd8={},_0x1f1eee={};_0x504611<_0x1fb768[_0x61a4('0x12')];_0x504611+=0x1){_0x4ddbd8=_0x1fb768[_0x504611];if(_['isUndefined'](_0xe7e32f[_0x61a4('0x1e')][_0x4ddbd8['id']])){_0xe7e32f[_0x61a4('0x1e')][_0x4ddbd8['id']]=new FaxQueue(_0x4ddbd8);}else{_0xe7e32f[_0x61a4('0x10')](_0xe7e32f[_0x61a4('0x1e')][_0x4ddbd8['id']],_0x4ddbd8);}_0xe7e32f[_0x61a4('0x1e')][_0x4ddbd8['id']][_0x61a4('0x18')]();_0xe7e32f[_0x61a4('0x1e')][_0x4ddbd8['id']][_0x61a4('0x19')]();}}return _0xe7e32f['faxQueues'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index dcb826d..4fada4f 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 _0x94d3=['Request','updateChatInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x2f7079,_0x3858c3){var _0x481aa8=function(_0x4da44d){while(--_0x4da44d){_0x2f7079['push'](_0x2f7079['shift']());}};_0x481aa8(++_0x3858c3);}(_0x94d3,0x94));var _0x394d=function(_0x210a9e,_0x5c1a84){_0x210a9e=_0x210a9e-0x0;var _0x330ada=_0x94d3[_0x210a9e];return _0x330ada;};'use strict';var client=require(_0x394d('0x0'));exports[_0x394d('0x1')]=function(_0x371cb6,_0x6a74ca){return client[_0x394d('0x2')]('UpdateChatInteraction',{'body':_0x6a74ca,'options':{'where':{'id':_0x371cb6}},'log':_0x394d('0x3')});};exports[_0x394d('0x4')]=function(_0x2de43f,_0xdcd9e9){return client[_0x394d('0x2')]('AddTagsToChatInteraction',{'body':_0xdcd9e9,'options':{'where':{'id':_0x2de43f}},'log':_0x394d('0x5')});}; \ No newline at end of file +var _0x8cb7=['addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction','Request','AddTagsToChatInteraction'];(function(_0x5878aa,_0x32bf6a){var _0x1243fd=function(_0x403042){while(--_0x403042){_0x5878aa['push'](_0x5878aa['shift']());}};_0x1243fd(++_0x32bf6a);}(_0x8cb7,0x1c1));var _0x78cb=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0x8cb7[_0x26a906];return _0x495575;};'use strict';var client=require(_0x78cb('0x0'));exports[_0x78cb('0x1')]=function(_0x274a5b,_0x169373){return client['Request'](_0x78cb('0x2'),{'body':_0x169373,'options':{'where':{'id':_0x274a5b}},'log':_0x78cb('0x3')});};exports['addTags']=function(_0xb72b45,_0x506b0c){return client[_0x78cb('0x4')](_0x78cb('0x5'),{'body':_0x506b0c,'options':{'where':{'id':_0xb72b45}},'log':_0x78cb('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 866fb8e..42a3864 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 _0xb5d2=['../client','create','CreateChatMessage','createChatMessage'];(function(_0xbb51f3,_0x50f4aa){var _0x4261ef=function(_0x3eec19){while(--_0x3eec19){_0xbb51f3['push'](_0xbb51f3['shift']());}};_0x4261ef(++_0x50f4aa);}(_0xb5d2,0x1b4));var _0x2b5d=function(_0x453aa0,_0x1fd5d4){_0x453aa0=_0x453aa0-0x0;var _0x4f2810=_0xb5d2[_0x453aa0];return _0x4f2810;};'use strict';var client=require(_0x2b5d('0x0'));exports[_0x2b5d('0x1')]=function(_0x11fbb0){return client['Request'](_0x2b5d('0x2'),{'body':_0x11fbb0,'log':_0x2b5d('0x3')});}; \ No newline at end of file +var _0x12d7=['Request','createChatMessage'];(function(_0x1295e7,_0x3b051a){var _0x5c0b38=function(_0xc12052){while(--_0xc12052){_0x1295e7['push'](_0x1295e7['shift']());}};_0x5c0b38(++_0x3b051a);}(_0x12d7,0x14a));var _0x712d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12d7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['create']=function(_0x1e5c73){return client[_0x712d('0x0')]('CreateChatMessage',{'body':_0x1e5c73,'log':_0x712d('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 5654f3c..b0b5d67 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 _0xcb7a=['GetChatQueue','strategy','Agents','chatPause','getChatQueues','Request'];(function(_0xccb2d4,_0x55cf05){var _0x3e7bf7=function(_0x3ad37b){while(--_0x3ad37b){_0xccb2d4['push'](_0xccb2d4['shift']());}};_0x3e7bf7(++_0x55cf05);}(_0xcb7a,0x190));var _0xacb7=function(_0xd8de,_0x33ce05){_0xd8de=_0xd8de-0x0;var _0x59d32a=_0xcb7a[_0xd8de];return _0x59d32a;};'use strict';var client=require('../client');exports[_0xacb7('0x0')]=function(){return function(){return client[_0xacb7('0x1')](_0xacb7('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xacb7('0x3')],'include':[{'model':'User','as':_0xacb7('0x4'),'attributes':['id','name','online',_0xacb7('0x5')]}]},'log':_0xacb7('0x0')});};}; \ No newline at end of file +var _0xd272=['Agents','chatPause','../client','Request','GetChatQueue','name','timeout','User'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd272,0x1e2));var _0x2d27=function(_0x4bcc6e,_0x3afc3b){_0x4bcc6e=_0x4bcc6e-0x0;var _0x2c2d1b=_0xd272[_0x4bcc6e];return _0x2c2d1b;};'use strict';var client=require(_0x2d27('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x2d27('0x1')](_0x2d27('0x2'),{'options':{'raw':![],'attributes':['id',_0x2d27('0x3'),_0x2d27('0x4'),'strategy'],'include':[{'model':_0x2d27('0x5'),'as':_0x2d27('0x6'),'attributes':['id',_0x2d27('0x3'),'online',_0x2d27('0x7')]}]},'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 4ad3a11..91707c1 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 _0x83d3=['update','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x4c7f79,_0x17b695){var _0x8d0051=function(_0x137146){while(--_0x137146){_0x4c7f79['push'](_0x4c7f79['shift']());}};_0x8d0051(++_0x17b695);}(_0x83d3,0x17c));var _0x383d=function(_0x16e1d5,_0x26b53b){_0x16e1d5=_0x16e1d5-0x0;var _0x534f2c=_0x83d3[_0x16e1d5];return _0x534f2c;};'use strict';var client=require(_0x383d('0x0'));exports[_0x383d('0x1')]=function(_0x249fdb){return client[_0x383d('0x2')](_0x383d('0x3'),{'body':_0x249fdb,'log':'CreateChatQueueReport'});};exports[_0x383d('0x4')]=function(_0x1184a6,_0x31cbfc){return client[_0x383d('0x2')]('UpdateChatQueueReport',{'body':_0x31cbfc,'options':{'where':{'uniqueid':_0x1184a6},'order':[['id',_0x383d('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x84e1=['UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x46d72f,_0x30bd56){var _0x3dadb8=function(_0x560b76){while(--_0x560b76){_0x46d72f['push'](_0x46d72f['shift']());}};_0x3dadb8(++_0x30bd56);}(_0x84e1,0x1dc));var _0x184e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x84e1[_0x422905];return _0x33dc6c;};'use strict';var client=require(_0x184e('0x0'));exports[_0x184e('0x1')]=function(_0x1cb42b){return client[_0x184e('0x2')](_0x184e('0x3'),{'body':_0x1cb42b,'log':_0x184e('0x3')});};exports['update']=function(_0x6947f1,_0x5fe43b){return client[_0x184e('0x2')](_0x184e('0x4'),{'body':_0x5fe43b,'options':{'where':{'uniqueid':_0x6947f1},'order':[['id',_0x184e('0x5')]],'limit':0x1},'log':_0x184e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 05364d0..3ebcf41 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 _0x7c13=['update','Request','addTagsToFaxInteraction','../client'];(function(_0x3e08e2,_0x20c249){var _0x32b418=function(_0x272ef7){while(--_0x272ef7){_0x3e08e2['push'](_0x3e08e2['shift']());}};_0x32b418(++_0x20c249);}(_0x7c13,0xbf));var _0x37c1=function(_0x4a3acd,_0x4bf641){_0x4a3acd=_0x4a3acd-0x0;var _0x3efdaa=_0x7c13[_0x4a3acd];return _0x3efdaa;};'use strict';var client=require(_0x37c1('0x0'));exports[_0x37c1('0x1')]=function(_0x4c8516,_0x94b13d){return client[_0x37c1('0x2')]('UpdateFaxInteraction',{'body':_0x94b13d,'options':{'where':{'id':_0x4c8516}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x55dc14,_0x42b2a6){return client['Request']('AddTagsToFaxInteraction',{'body':_0x42b2a6,'options':{'where':{'id':_0x55dc14}},'log':_0x37c1('0x3')});}; \ No newline at end of file +var _0x2549=['updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','Request'];(function(_0x1b4bd4,_0x2beca7){var _0x5bbc84=function(_0x9361a9){while(--_0x9361a9){_0x1b4bd4['push'](_0x1b4bd4['shift']());}};_0x5bbc84(++_0x2beca7);}(_0x2549,0x193));var _0x9254=function(_0x5c1bf2,_0x1b6c93){_0x5c1bf2=_0x5c1bf2-0x0;var _0x55085f=_0x2549[_0x5c1bf2];return _0x55085f;};'use strict';var client=require(_0x9254('0x0'));exports[_0x9254('0x1')]=function(_0x42897b,_0x45e96d){return client[_0x9254('0x2')]('UpdateFaxInteraction',{'body':_0x45e96d,'options':{'where':{'id':_0x42897b}},'log':_0x9254('0x3')});};exports[_0x9254('0x4')]=function(_0x10c078,_0x99f5a6){return client[_0x9254('0x2')](_0x9254('0x5'),{'body':_0x99f5a6,'options':{'where':{'id':_0x10c078}},'log':_0x9254('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index c4716ff..de79f84 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 _0xfa92=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x5f4597,_0x2ba49c){var _0x3b2717=function(_0x360bd1){while(--_0x360bd1){_0x5f4597['push'](_0x5f4597['shift']());}};_0x3b2717(++_0x2ba49c);}(_0xfa92,0x74));var _0x2fa9=function(_0x31ebfb,_0x271c1f){_0x31ebfb=_0x31ebfb-0x0;var _0x453642=_0xfa92[_0x31ebfb];return _0x453642;};'use strict';var client=require(_0x2fa9('0x0'));exports[_0x2fa9('0x1')]=function(_0x33d4d4){return client[_0x2fa9('0x2')](_0x2fa9('0x3'),{'body':_0x33d4d4,'log':_0x2fa9('0x4')});}; \ No newline at end of file +var _0xa75f=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x449e56,_0x58fa0a){var _0x1aeece=function(_0x46673f){while(--_0x46673f){_0x449e56['push'](_0x449e56['shift']());}};_0x1aeece(++_0x58fa0a);}(_0xa75f,0x136));var _0xfa75=function(_0x4a2793,_0x484a22){_0x4a2793=_0x4a2793-0x0;var _0x2b52ee=_0xa75f[_0x4a2793];return _0x2b52ee;};'use strict';var client=require(_0xfa75('0x0'));exports[_0xfa75('0x1')]=function(_0x575a10){return client['Request'](_0xfa75('0x2'),{'body':_0x575a10,'log':_0xfa75('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 5027403..31d0bb1 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 _0x5b21=['online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x2e767e,_0x591c30){var _0x539d6c=function(_0x1122fc){while(--_0x1122fc){_0x2e767e['push'](_0x2e767e['shift']());}};_0x539d6c(++_0x591c30);}(_0x5b21,0x102));var _0x15b2=function(_0x3bbf52,_0x1e9197){_0x3bbf52=_0x3bbf52-0x0;var _0x4cb247=_0x5b21[_0x3bbf52];return _0x4cb247;};'use strict';var client=require(_0x15b2('0x0'));exports[_0x15b2('0x1')]=function(){return function(){return client[_0x15b2('0x2')](_0x15b2('0x3'),{'options':{'raw':![],'attributes':['id',_0x15b2('0x4'),_0x15b2('0x5'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x15b2('0x4'),_0x15b2('0x6'),_0x15b2('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xac44=['Agents','name','online','faxPause','../client','getFaxQueues','GetFaxQueue','strategy','User'];(function(_0x1728d1,_0x1994e3){var _0x3ca811=function(_0x5dd015){while(--_0x5dd015){_0x1728d1['push'](_0x1728d1['shift']());}};_0x3ca811(++_0x1994e3);}(_0xac44,0xe5));var _0x4ac4=function(_0x2f80ff,_0x272e19){_0x2f80ff=_0x2f80ff-0x0;var _0xc8574d=_0xac44[_0x2f80ff];return _0xc8574d;};'use strict';var client=require(_0x4ac4('0x0'));exports[_0x4ac4('0x1')]=function(){return function(){return client['Request'](_0x4ac4('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x4ac4('0x3')],'include':[{'model':_0x4ac4('0x4'),'as':_0x4ac4('0x5'),'attributes':['id',_0x4ac4('0x6'),_0x4ac4('0x7'),_0x4ac4('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 726ba90..22293c5 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 _0x5704=['update','UpdateFaxQueueReport','DESC','Request','CreateFaxQueueReport'];(function(_0x387199,_0x3a16d5){var _0xc3d255=function(_0x5857ac){while(--_0x5857ac){_0x387199['push'](_0x387199['shift']());}};_0xc3d255(++_0x3a16d5);}(_0x5704,0x1e3));var _0x4570=function(_0x38cb4a,_0x14fe3d){_0x38cb4a=_0x38cb4a-0x0;var _0x7ef55b=_0x5704[_0x38cb4a];return _0x7ef55b;};'use strict';var client=require('../client');exports['create']=function(_0x168f9c){return client[_0x4570('0x0')](_0x4570('0x1'),{'body':_0x168f9c,'log':_0x4570('0x1')});};exports[_0x4570('0x2')]=function(_0x39e484,_0x3d3ef8){return client[_0x4570('0x0')](_0x4570('0x3'),{'body':_0x3d3ef8,'options':{'where':{'uniqueid':_0x39e484},'order':[['id',_0x4570('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x4d85=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client','Request'];(function(_0x5bc85b,_0x3891e4){var _0x3b5704=function(_0x24d3d8){while(--_0x24d3d8){_0x5bc85b['push'](_0x5bc85b['shift']());}};_0x3b5704(++_0x3891e4);}(_0x4d85,0x99));var _0x54d8=function(_0x2e2910,_0x3b06e0){_0x2e2910=_0x2e2910-0x0;var _0x22e05c=_0x4d85[_0x2e2910];return _0x22e05c;};'use strict';var client=require(_0x54d8('0x0'));exports['create']=function(_0x2d6738){return client[_0x54d8('0x1')](_0x54d8('0x2'),{'body':_0x2d6738,'log':_0x54d8('0x2')});};exports['update']=function(_0x497b6d,_0x2887e4){return client[_0x54d8('0x1')](_0x54d8('0x3'),{'body':_0x2887e4,'options':{'where':{'uniqueid':_0x497b6d},'order':[['id',_0x54d8('0x4')]],'limit':0x1},'log':_0x54d8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a3f3b67..0a7b484 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 _0x68a5=['../client','Request','GetInterval','Interval','Intervals','name','interval'];(function(_0x2c38da,_0x5d9497){var _0x18e668=function(_0x5a1765){while(--_0x5a1765){_0x2c38da['push'](_0x2c38da['shift']());}};_0x18e668(++_0x5d9497);}(_0x68a5,0xfc));var _0x568a=function(_0x13543b,_0x48c224){_0x13543b=_0x13543b-0x0;var _0x50edb7=_0x68a5[_0x13543b];return _0x50edb7;};'use strict';var client=require(_0x568a('0x0'));exports['getIntervals']=function(){return function(){return client[_0x568a('0x1')](_0x568a('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x568a('0x3'),'as':_0x568a('0x4'),'attributes':['id',_0x568a('0x5'),_0x568a('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xe3d4=['getIntervals','Request','GetInterval','Interval','Intervals','interval'];(function(_0x165cd1,_0x4a6a88){var _0x761f32=function(_0x32a8aa){while(--_0x32a8aa){_0x165cd1['push'](_0x165cd1['shift']());}};_0x761f32(++_0x4a6a88);}(_0xe3d4,0xc6));var _0x4e3d=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0xe3d4[_0xe7281f];return _0x90dc99;};'use strict';var client=require('../client');exports[_0x4e3d('0x0')]=function(){return function(){return client[_0x4e3d('0x1')](_0x4e3d('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x4e3d('0x3'),'as':_0x4e3d('0x4'),'attributes':['id','name',_0x4e3d('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 37be80e..69186f1 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 _0xdde5=['addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdde5,0x127));var _0x5dde=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0xdde5[_0x5f0501];return _0x3c2c45;};'use strict';var client=require('../client');exports[_0x5dde('0x0')]=function(_0x5a55ac,_0x3c55b8){return client[_0x5dde('0x1')](_0x5dde('0x2'),{'body':_0x3c55b8,'options':{'where':{'id':_0x5a55ac}},'log':_0x5dde('0x3')});};exports[_0x5dde('0x4')]=function(_0x61cef2,_0x43b1fc){return client[_0x5dde('0x1')](_0x5dde('0x5'),{'body':_0x43b1fc,'options':{'where':{'id':_0x61cef2}},'log':_0x5dde('0x6')});}; \ No newline at end of file +var _0x8f4f=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','Request'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x8f4f,0xbf));var _0xf8f4=function(_0x423c7e,_0x2af892){_0x423c7e=_0x423c7e-0x0;var _0x1ee152=_0x8f4f[_0x423c7e];return _0x1ee152;};'use strict';var client=require('../client');exports['update']=function(_0x1204dc,_0x5dc061){return client[_0xf8f4('0x0')](_0xf8f4('0x1'),{'body':_0x5dc061,'options':{'where':{'id':_0x1204dc}},'log':_0xf8f4('0x2')});};exports[_0xf8f4('0x3')]=function(_0x4245da,_0x29a9b0){return client[_0xf8f4('0x0')](_0xf8f4('0x4'),{'body':_0x29a9b0,'options':{'where':{'id':_0x4245da}},'log':_0xf8f4('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index f4478bf..bc7d988 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 _0x7ee5=['createMailMessage','../client','Request','CreateMailMessage'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x7ee5,0xf1));var _0x57ee=function(_0x301148,_0x25b884){_0x301148=_0x301148-0x0;var _0x42ce24=_0x7ee5[_0x301148];return _0x42ce24;};'use strict';var client=require(_0x57ee('0x0'));exports['create']=function(_0x258193){return client[_0x57ee('0x1')](_0x57ee('0x2'),{'body':_0x258193,'log':_0x57ee('0x3')});}; \ No newline at end of file +var _0x42db=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0xba382f,_0x103ad2){var _0x139b7b=function(_0x537a1b){while(--_0x537a1b){_0xba382f['push'](_0xba382f['shift']());}};_0x139b7b(++_0x103ad2);}(_0x42db,0x1de));var _0xb42d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x42db[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xb42d('0x0'));exports[_0xb42d('0x1')]=function(_0x296658){return client[_0xb42d('0x2')](_0xb42d('0x3'),{'body':_0x296658,'log':_0xb42d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 15f127b..41607f3 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 _0x1389=['name','online','mailPause','getMailQueues','../client','Request','GetMailQueue','strategy','User','Agents'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0x1389,0xf4));var _0x9138=function(_0x21b18e,_0x369e36){_0x21b18e=_0x21b18e-0x0;var _0x55f679=_0x1389[_0x21b18e];return _0x55f679;};'use strict';var client=require(_0x9138('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x9138('0x1')](_0x9138('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x9138('0x3')],'include':[{'model':_0x9138('0x4'),'as':_0x9138('0x5'),'attributes':['id',_0x9138('0x6'),_0x9138('0x7'),_0x9138('0x8')]}]},'log':_0x9138('0x9')});};}; \ No newline at end of file +var _0x0eb5=['mailPause','getMailQueues','Request','GetMailQueue','timeout','strategy','Agents','name','online'];(function(_0x5cbaee,_0x337ef6){var _0x218582=function(_0x34758d){while(--_0x34758d){_0x5cbaee['push'](_0x5cbaee['shift']());}};_0x218582(++_0x337ef6);}(_0x0eb5,0x196));var _0x50eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0eb5[_0x122ef9];return _0x42fba0;};'use strict';var client=require('../client');exports[_0x50eb('0x0')]=function(){return function(){return client[_0x50eb('0x1')](_0x50eb('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x50eb('0x3'),_0x50eb('0x4')],'include':[{'model':'User','as':_0x50eb('0x5'),'attributes':['id',_0x50eb('0x6'),_0x50eb('0x7'),_0x50eb('0x8')]}]},'log':_0x50eb('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 8bff851..3f3525f 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 _0xc4ba=['UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport','update'];(function(_0x5220b7,_0x1d70a3){var _0x2fd78d=function(_0x53c154){while(--_0x53c154){_0x5220b7['push'](_0x5220b7['shift']());}};_0x2fd78d(++_0x1d70a3);}(_0xc4ba,0x1b2));var _0xac4b=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0xc4ba[_0x100e36];return _0x1df0c9;};'use strict';var client=require('../client');exports[_0xac4b('0x0')]=function(_0x50b3fc){return client[_0xac4b('0x1')](_0xac4b('0x2'),{'body':_0x50b3fc,'log':_0xac4b('0x2')});};exports[_0xac4b('0x3')]=function(_0x41e964,_0x180fbb){return client[_0xac4b('0x1')](_0xac4b('0x4'),{'body':_0x180fbb,'options':{'where':{'uniqueid':_0x41e964},'order':[['id',_0xac4b('0x5')]],'limit':0x1},'log':_0xac4b('0x4')});}; \ No newline at end of file +var _0xc26f=['CreateMailQueueReport','update','Request','UpdateMailQueueReport','../client','create'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0xc26f,0x12a));var _0xfc26=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xc26f[_0x178e48];return _0x440d7e;};'use strict';var client=require(_0xfc26('0x0'));exports[_0xfc26('0x1')]=function(_0x242313){return client['Request'](_0xfc26('0x2'),{'body':_0x242313,'log':'CreateMailQueueReport'});};exports[_0xfc26('0x3')]=function(_0x5456fc,_0xec120e){return client[_0xfc26('0x4')](_0xfc26('0x5'),{'body':_0xec120e,'options':{'where':{'uniqueid':_0x5456fc},'order':[['id','DESC']],'limit':0x1},'log':_0xfc26('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 2fe2d6c..22a11d8 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 _0x336c=['UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x336c,0x1a7));var _0xc336=function(_0x5ccefd,_0x2410f2){_0x5ccefd=_0x5ccefd-0x0;var _0x262bc8=_0x336c[_0x5ccefd];return _0x262bc8;};'use strict';var client=require(_0xc336('0x0'));exports[_0xc336('0x1')]=function(_0x5eb8c1,_0x475faa){return client['Request'](_0xc336('0x2'),{'body':_0x475faa,'options':{'where':{'id':_0x5eb8c1}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x4ae000,_0x51ec08){return client['Request'](_0xc336('0x3'),{'body':_0x51ec08,'options':{'where':{'id':_0x4ae000}},'log':_0xc336('0x4')});}; \ No newline at end of file +var _0x2bab=['../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x4c882e,_0x199d1a){var _0x3ff393=function(_0x2b38aa){while(--_0x2b38aa){_0x4c882e['push'](_0x4c882e['shift']());}};_0x3ff393(++_0x199d1a);}(_0x2bab,0xe0));var _0xb2ba=function(_0x243781,_0x33888b){_0x243781=_0x243781-0x0;var _0x197c7f=_0x2bab[_0x243781];return _0x197c7f;};'use strict';var client=require(_0xb2ba('0x0'));exports['update']=function(_0x1066c5,_0x414029){return client[_0xb2ba('0x1')](_0xb2ba('0x2'),{'body':_0x414029,'options':{'where':{'id':_0x1066c5}},'log':_0xb2ba('0x3')});};exports[_0xb2ba('0x4')]=function(_0x3df244,_0x39307a){return client[_0xb2ba('0x1')](_0xb2ba('0x5'),{'body':_0x39307a,'options':{'where':{'id':_0x3df244}},'log':_0xb2ba('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index ae7400d..204868a 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 _0x91a7=['create','Request','createOpenchannelMessage'];(function(_0x3f7d78,_0x169976){var _0x260c60=function(_0x46f03e){while(--_0x46f03e){_0x3f7d78['push'](_0x3f7d78['shift']());}};_0x260c60(++_0x169976);}(_0x91a7,0xe7));var _0x791a=function(_0x5ab6b3,_0x44e68c){_0x5ab6b3=_0x5ab6b3-0x0;var _0x4d4253=_0x91a7[_0x5ab6b3];return _0x4d4253;};'use strict';var client=require('../client');exports[_0x791a('0x0')]=function(_0x3d6eab){return client[_0x791a('0x1')]('CreateOpenchannelMessage',{'body':_0x3d6eab,'log':_0x791a('0x2')});}; \ No newline at end of file +var _0x91a7=['create','Request','createOpenchannelMessage'];(function(_0x282d1c,_0x5ba187){var _0x3e6e3e=function(_0x2834d4){while(--_0x2834d4){_0x282d1c['push'](_0x282d1c['shift']());}};_0x3e6e3e(++_0x5ba187);}(_0x91a7,0xe7));var _0x791a=function(_0x1b9965,_0xa5c7c6){_0x1b9965=_0x1b9965-0x0;var _0x283c46=_0x91a7[_0x1b9965];return _0x283c46;};'use strict';var client=require('../client');exports[_0x791a('0x0')]=function(_0x3d6eab){return client[_0x791a('0x1')]('CreateOpenchannelMessage',{'body':_0x3d6eab,'log':_0x791a('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 2074630..8f277da 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 _0x0f7a=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','Agents','online','../client'];(function(_0x1da46b,_0x109ac4){var _0x3a94ef=function(_0x31a2b4){while(--_0x31a2b4){_0x1da46b['push'](_0x1da46b['shift']());}};_0x3a94ef(++_0x109ac4);}(_0x0f7a,0x1dc));var _0xa0f7=function(_0x3b9576,_0x3fcdbc){_0x3b9576=_0x3b9576-0x0;var _0x167d93=_0x0f7a[_0x3b9576];return _0x167d93;};'use strict';var client=require(_0xa0f7('0x0'));exports[_0xa0f7('0x1')]=function(){return function(){return client[_0xa0f7('0x2')](_0xa0f7('0x3'),{'options':{'raw':![],'attributes':['id',_0xa0f7('0x4'),_0xa0f7('0x5'),'strategy'],'include':[{'model':_0xa0f7('0x6'),'as':_0xa0f7('0x7'),'attributes':['id',_0xa0f7('0x4'),_0xa0f7('0x8'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x3d54=['online','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','timeout','User','Agents','name'];(function(_0x1674a4,_0x12fdd5){var _0x591747=function(_0x257558){while(--_0x257558){_0x1674a4['push'](_0x1674a4['shift']());}};_0x591747(++_0x12fdd5);}(_0x3d54,0xe3));var _0x43d5=function(_0x5ef9fb,_0x285821){_0x5ef9fb=_0x5ef9fb-0x0;var _0x53aa8e=_0x3d54[_0x5ef9fb];return _0x53aa8e;};'use strict';var client=require(_0x43d5('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x43d5('0x1')](_0x43d5('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x43d5('0x3'),'strategy'],'include':[{'model':_0x43d5('0x4'),'as':_0x43d5('0x5'),'attributes':['id',_0x43d5('0x6'),_0x43d5('0x7'),'openchannelPause']}]},'log':_0x43d5('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index a73b1dd..9098ce1 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 _0x4671=['UpdateOpenchannelQueueReport','../client','Request','CreateOpenchannelQueueReport','update','DESC'];(function(_0x37379a,_0x3cefcf){var _0x4956d9=function(_0x281859){while(--_0x281859){_0x37379a['push'](_0x37379a['shift']());}};_0x4956d9(++_0x3cefcf);}(_0x4671,0x157));var _0x1467=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4671[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x1467('0x0'));exports['create']=function(_0xa43212){return client[_0x1467('0x1')](_0x1467('0x2'),{'body':_0xa43212,'log':_0x1467('0x2')});};exports[_0x1467('0x3')]=function(_0x4d70f1,_0xa68334){return client[_0x1467('0x1')]('UpdateOpenchannelQueueReport',{'body':_0xa68334,'options':{'where':{'uniqueid':_0x4d70f1},'order':[['id',_0x1467('0x4')]],'limit':0x1},'log':_0x1467('0x5')});}; \ No newline at end of file +var _0x9815=['../client','create','Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport'];(function(_0x2313f3,_0x2549de){var _0x4bb913=function(_0x1b5dd1){while(--_0x1b5dd1){_0x2313f3['push'](_0x2313f3['shift']());}};_0x4bb913(++_0x2549de);}(_0x9815,0x126));var _0x5981=function(_0x4627ee,_0x520179){_0x4627ee=_0x4627ee-0x0;var _0x21ae45=_0x9815[_0x4627ee];return _0x21ae45;};'use strict';var client=require(_0x5981('0x0'));exports[_0x5981('0x1')]=function(_0x5d3973){return client[_0x5981('0x2')](_0x5981('0x3'),{'body':_0x5d3973,'log':_0x5981('0x3')});};exports[_0x5981('0x4')]=function(_0x480d0a,_0x37af14){return client[_0x5981('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x37af14,'options':{'where':{'uniqueid':_0x480d0a},'order':[['id',_0x5981('0x5')]],'limit':0x1},'log':_0x5981('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index a6fadf7..dbf8242 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 _0x6598=['AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x1fc4b8,_0x56613e){var _0x160ab5=function(_0x54f071){while(--_0x54f071){_0x1fc4b8['push'](_0x1fc4b8['shift']());}};_0x160ab5(++_0x56613e);}(_0x6598,0xe2));var _0x8659=function(_0x13a2de,_0x35b4e2){_0x13a2de=_0x13a2de-0x0;var _0x35e65d=_0x6598[_0x13a2de];return _0x35e65d;};'use strict';var client=require('../client');exports[_0x8659('0x0')]=function(_0x3579e7,_0x491abb){return client[_0x8659('0x1')](_0x8659('0x2'),{'body':_0x491abb,'options':{'where':{'id':_0x3579e7}},'log':_0x8659('0x3')});};exports[_0x8659('0x4')]=function(_0x2ec1b6,_0xf54f57){return client[_0x8659('0x1')](_0x8659('0x5'),{'body':_0xf54f57,'options':{'where':{'id':_0x2ec1b6}},'log':_0x8659('0x6')});}; \ No newline at end of file +var _0x27fa=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x53a73e,_0x469f27){var _0x458a28=function(_0x2bff6b){while(--_0x2bff6b){_0x53a73e['push'](_0x53a73e['shift']());}};_0x458a28(++_0x469f27);}(_0x27fa,0x1c3));var _0xa27f=function(_0x3fdeb2,_0x405801){_0x3fdeb2=_0x3fdeb2-0x0;var _0x7fc05a=_0x27fa[_0x3fdeb2];return _0x7fc05a;};'use strict';var client=require(_0xa27f('0x0'));exports[_0xa27f('0x1')]=function(_0x4341e8,_0x1666eb){return client[_0xa27f('0x2')](_0xa27f('0x3'),{'body':_0x1666eb,'options':{'where':{'id':_0x4341e8}},'log':_0xa27f('0x4')});};exports['addTags']=function(_0x23a534,_0x2e7969){return client[_0xa27f('0x2')](_0xa27f('0x5'),{'body':_0x2e7969,'options':{'where':{'id':_0x23a534}},'log':_0xa27f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 0214e18..2539930 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 _0xf81b=['../client','Request'];(function(_0x538f2c,_0x1e3a0c){var _0x422997=function(_0x18f0e5){while(--_0x18f0e5){_0x538f2c['push'](_0x538f2c['shift']());}};_0x422997(++_0x1e3a0c);}(_0xf81b,0xdc));var _0xbf81=function(_0x3b4aaf,_0x568654){_0x3b4aaf=_0x3b4aaf-0x0;var _0xda9266=_0xf81b[_0x3b4aaf];return _0xda9266;};'use strict';var client=require(_0xbf81('0x0'));exports['create']=function(_0x2429bf){return client[_0xbf81('0x1')]('CreateSmsMessage',{'body':_0x2429bf,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x1b78=['create','../client'];(function(_0x105d34,_0x78e0f8){var _0x2671a1=function(_0x269b06){while(--_0x269b06){_0x105d34['push'](_0x105d34['shift']());}};_0x2671a1(++_0x78e0f8);}(_0x1b78,0x105));var _0x81b7=function(_0x11816b,_0x28d7aa){_0x11816b=_0x11816b-0x0;var _0x31e925=_0x1b78[_0x11816b];return _0x31e925;};'use strict';var client=require(_0x81b7('0x0'));exports[_0x81b7('0x1')]=function(_0x4c1934){return client['Request']('CreateSmsMessage',{'body':_0x4c1934,'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 53438af..cb15a17 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 _0xd101=['Agents','smsPause','getSmsQueues','../client','Request','GetSmsQueue','name','timeout','strategy','User'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xd101,0xc1));var _0x1d10=function(_0xfd9fb0,_0x48bbcd){_0xfd9fb0=_0xfd9fb0-0x0;var _0x54c091=_0xd101[_0xfd9fb0];return _0x54c091;};'use strict';var client=require(_0x1d10('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x1d10('0x1')](_0x1d10('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d10('0x3'),_0x1d10('0x4'),_0x1d10('0x5')],'include':[{'model':_0x1d10('0x6'),'as':_0x1d10('0x7'),'attributes':['id',_0x1d10('0x3'),'online',_0x1d10('0x8')]}]},'log':_0x1d10('0x9')});};}; \ No newline at end of file +var _0x8ef0=['User','Agents','name','online','smsPause','../client','getSmsQueues','Request','GetSmsQueue','strategy'];(function(_0x442c83,_0x2cfd03){var _0x3db9b0=function(_0x30d9af){while(--_0x30d9af){_0x442c83['push'](_0x442c83['shift']());}};_0x3db9b0(++_0x2cfd03);}(_0x8ef0,0xa5));var _0x08ef=function(_0x19b594,_0x329f60){_0x19b594=_0x19b594-0x0;var _0xe5c36a=_0x8ef0[_0x19b594];return _0xe5c36a;};'use strict';var client=require(_0x08ef('0x0'));exports[_0x08ef('0x1')]=function(){return function(){return client[_0x08ef('0x2')](_0x08ef('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x08ef('0x4')],'include':[{'model':_0x08ef('0x5'),'as':_0x08ef('0x6'),'attributes':['id',_0x08ef('0x7'),_0x08ef('0x8'),_0x08ef('0x9')]}]},'log':_0x08ef('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 21c6e70..efd8c49 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 _0x67c4=['UpdateSmsQueueReport','../client','update','DESC'];(function(_0xc1f0cc,_0x2ba33b){var _0x406776=function(_0x4dd327){while(--_0x4dd327){_0xc1f0cc['push'](_0xc1f0cc['shift']());}};_0x406776(++_0x2ba33b);}(_0x67c4,0x121));var _0x467c=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x67c4[_0xfa634c];return _0x73e478;};'use strict';var client=require(_0x467c('0x0'));exports['create']=function(_0x2c3659){return client['Request']('CreateSmsQueueReport',{'body':_0x2c3659,'log':'CreateSmsQueueReport'});};exports[_0x467c('0x1')]=function(_0x128568,_0x3cb2ee){return client['Request']('UpdateSmsQueueReport',{'body':_0x3cb2ee,'options':{'where':{'uniqueid':_0x128568},'order':[['id',_0x467c('0x2')]],'limit':0x1},'log':_0x467c('0x3')});}; \ No newline at end of file +var _0x62b7=['CreateSmsQueueReport','UpdateSmsQueueReport','../client','create','Request'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x62b7,0x179));var _0x762b=function(_0x2ae9bc,_0x48573c){_0x2ae9bc=_0x2ae9bc-0x0;var _0x5142ac=_0x62b7[_0x2ae9bc];return _0x5142ac;};'use strict';var client=require(_0x762b('0x0'));exports[_0x762b('0x1')]=function(_0xf532e9){return client[_0x762b('0x2')](_0x762b('0x3'),{'body':_0xf532e9,'log':_0x762b('0x3')});};exports['update']=function(_0x25ea19,_0x587d18){return client[_0x762b('0x2')](_0x762b('0x4'),{'body':_0x587d18,'options':{'where':{'uniqueid':_0x25ea19},'order':[['id','DESC']],'limit':0x1},'log':_0x762b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4c51436..91c05b9 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 _0xcf98=['getAgents','Request','GetUser','agent','name','online','pauseType','voicePause','chatPause','mailPause','faxPause','openchannelPause','mailCapacity','smsCapacity','openchannelCapacity','../client'];(function(_0x14f6af,_0x579b70){var _0x21f19f=function(_0x2df1c2){while(--_0x2df1c2){_0x14f6af['push'](_0x14f6af['shift']());}};_0x21f19f(++_0x579b70);}(_0xcf98,0xcf));var _0x8cf9=function(_0x152d48,_0x361fec){_0x152d48=_0x152d48-0x0;var _0x26e21d=_0xcf98[_0x152d48];return _0x26e21d;};'use strict';var client=require(_0x8cf9('0x0'));exports[_0x8cf9('0x1')]=function(){return function(){return client[_0x8cf9('0x2')](_0x8cf9('0x3'),{'options':{'raw':!![],'where':{'role':_0x8cf9('0x4')},'attributes':['id',_0x8cf9('0x5'),_0x8cf9('0x6'),_0x8cf9('0x7'),'lastPauseAt',_0x8cf9('0x8'),_0x8cf9('0x9'),_0x8cf9('0xa'),_0x8cf9('0xb'),'smsPause',_0x8cf9('0xc'),'chatCapacity',_0x8cf9('0xd'),'faxCapacity',_0x8cf9('0xe'),_0x8cf9('0xf')]},'log':'getAgents'});};}; \ No newline at end of file +var _0x8837=['agent','name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','faxPause','smsPause','chatCapacity','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x8837,0xfc));var _0x7883=function(_0xb2b776,_0x568eec){_0xb2b776=_0xb2b776-0x0;var _0x6c9190=_0x8837[_0xb2b776];return _0x6c9190;};'use strict';var client=require(_0x7883('0x0'));exports[_0x7883('0x1')]=function(){return function(){return client[_0x7883('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x7883('0x3')},'attributes':['id',_0x7883('0x4'),'online',_0x7883('0x5'),_0x7883('0x6'),_0x7883('0x7'),_0x7883('0x8'),_0x7883('0x9'),_0x7883('0xa'),_0x7883('0xb'),'openchannelPause',_0x7883('0xc'),'mailCapacity',_0x7883('0xd'),'smsCapacity',_0x7883('0xe')]},'log':'getAgents'});};}; \ 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 4a2bd93..6674707 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 _0x376e=['map','message','stop','timeout','createQueue','channel','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash','util','seq-queue','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','length','error','[%s][AGENT]\x20%s'];(function(_0x25b109,_0x1b71c7){var _0x43fb25=function(_0x780e99){while(--_0x780e99){_0x25b109['push'](_0x25b109['shift']());}};_0x43fb25(++_0x1b71c7);}(_0x376e,0x1cf));var _0xe376=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x376e[_0x20a558];return _0x53d3f7;};'use strict';var schema=require('validate');var _=require(_0xe376('0x0'));var util=require(_0xe376('0x1'));var seqqueue=require(_0xe376('0x2'));var logger=require('../../../../config/logger')(_0xe376('0x3'));var strategy=require(_0xe376('0x4'));var queue=schema({'name':{'type':_0xe376('0x5'),'required':!![],'message':_0xe376('0x6')},'timeout':{'type':_0xe376('0x7'),'message':_0xe376('0x8')}});function writeLog(_0x318879,_0xfbb2e3,_0x57aa7f){return logger[_0xe376('0x9')](util[_0xe376('0xa')](_0xe376('0xb'),_0x318879,_0xfbb2e3['name'],_0x57aa7f));}function handleFindAgent(_0x36b7e1){return function(_0x47b8e5){return _0x47b8e5[_0xe376('0xc')][_0xe376('0xd')]()===_0x36b7e1['toLowerCase']();};}exports['consequence']=function(_0x371869,_0x1d55de,_0x4a7f76,_0x17f8f8){return function(_0xb7f65c){try{var _0x55d1ba={'name':_0x1d55de[0x0],'timeout':_0x1d55de[0x1]};var _0x171337=queue['validate'](_0x55d1ba,{'typecast':!![]});if(_0x171337[_0xe376('0xe')]){logger[_0xe376('0xf')](_0xe376('0x10'),_0x371869,_[_0xe376('0x11')](_0x171337,_0xe376('0x12'))['join'](',\x20'));_0xb7f65c[_0xe376('0x13')]();}else{var _0x230bc4=_['find'](_0x4a7f76['agents'],handleFindAgent(_0x55d1ba[_0xe376('0xc')]));if(_0x230bc4){var _0x200e0c=(_0x55d1ba[_0xe376('0x14')]||0xa)*0x3e8;var _0x8950bf,_0x5112af;var _0xe4a989=seqqueue[_0xe376('0x15')](_0x200e0c);_0xe4a989['id']=_0x371869;_0xe4a989['atimeout']=_0x200e0c;_0xe4a989[_0xe376('0x16')]=_0x17f8f8[_0xe376('0x16')];writeLog(_0x371869,_0x230bc4,util['format'](_0xe376('0x17'),_0x200e0c));_0x4a7f76[_0xe376('0x18')][_0x371869]['on'](_0xe376('0x19'),function(){_0xe4a989[_0xe376('0x1a')]();clearTimeout(_0x5112af);_0x5112af=undefined;if(_0x4a7f76[_0xe376('0x18')][_0x371869]){delete _0x4a7f76[_0xe376('0x18')][_0x371869];}logger[_0xe376('0x9')](_0xe376('0x1b'),_0x371869);_0xb7f65c['stop']();});_0x5112af=setTimeout(function(){clearTimeout(_0x5112af);_0xe4a989[_0xe376('0x1a')]();logger[_0xe376('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x371869);_0xb7f65c[_0xe376('0x1c')]();},_0x200e0c);strategy['agent'](_0xe4a989,_0x230bc4,_0x4a7f76,_0x17f8f8);}else{logger['error'](_0xe376('0x1d'),_0x371869,_0x55d1ba[_0xe376('0xc')]);_0xb7f65c['stop']();}}}catch(_0x496317){console[_0xe376('0x1e')](_0x496317);logger[_0xe376('0xf')](_0xe376('0x1f'),_0x371869,_0x496317['stack']);_0xb7f65c[_0xe376('0x13')]();}};}; \ No newline at end of file +var _0x5548=['join','stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','info','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message'];(function(_0x202ae3,_0xb38336){var _0x394b4b=function(_0x16ee57){while(--_0x16ee57){_0x202ae3['push'](_0x202ae3['shift']());}};_0x394b4b(++_0xb38336);}(_0x5548,0xf1));var _0x8554=function(_0x13c5f6,_0x150bf4){_0x13c5f6=_0x13c5f6-0x0;var _0x5dd3bf=_0x5548[_0x13c5f6];return _0x5dd3bf;};'use strict';var schema=require(_0x8554('0x0'));var _=require(_0x8554('0x1'));var util=require(_0x8554('0x2'));var seqqueue=require(_0x8554('0x3'));var logger=require('../../../../config/logger')(_0x8554('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x8554('0x5'),'required':!![],'message':_0x8554('0x6')},'timeout':{'type':_0x8554('0x7'),'message':_0x8554('0x8')}});function writeLog(_0x1b5b2a,_0x10ead8,_0x3e9b30){return logger['info'](util[_0x8554('0x9')](_0x8554('0xa'),_0x1b5b2a,_0x10ead8[_0x8554('0xb')],_0x3e9b30));}function handleFindAgent(_0x128999){return function(_0x264913){return _0x264913[_0x8554('0xb')][_0x8554('0xc')]()===_0x128999[_0x8554('0xc')]();};}exports[_0x8554('0xd')]=function(_0x335b91,_0x2036fe,_0x558eb3,_0x3146a2){return function(_0x188037){try{var _0x43df8f={'name':_0x2036fe[0x0],'timeout':_0x2036fe[0x1]};var _0x4b52d7=queue[_0x8554('0x0')](_0x43df8f,{'typecast':!![]});if(_0x4b52d7['length']){logger[_0x8554('0xe')](_0x8554('0xf'),_0x335b91,_[_0x8554('0x10')](_0x4b52d7,_0x8554('0x11'))[_0x8554('0x12')](',\x20'));_0x188037[_0x8554('0x13')]();}else{var _0x46284a=_['find'](_0x558eb3[_0x8554('0x14')],handleFindAgent(_0x43df8f[_0x8554('0xb')]));if(_0x46284a){var _0x39d2a6=(_0x43df8f[_0x8554('0x15')]||0xa)*0x3e8;var _0x326b4f,_0x13c193;var _0x555e83=seqqueue[_0x8554('0x16')](_0x39d2a6);_0x555e83['id']=_0x335b91;_0x555e83[_0x8554('0x17')]=_0x39d2a6;_0x555e83[_0x8554('0x18')]=_0x3146a2['channel'];writeLog(_0x335b91,_0x46284a,util[_0x8554('0x9')](_0x8554('0x19'),_0x39d2a6));_0x558eb3[_0x8554('0x1a')][_0x335b91]['on'](_0x8554('0x1b'),function(){_0x555e83[_0x8554('0x1c')]();clearTimeout(_0x13c193);_0x13c193=undefined;if(_0x558eb3[_0x8554('0x1a')][_0x335b91]){delete _0x558eb3[_0x8554('0x1a')][_0x335b91];}logger[_0x8554('0x1d')](_0x8554('0x1e'),_0x335b91);_0x188037[_0x8554('0x13')]();});_0x13c193=setTimeout(function(){clearTimeout(_0x13c193);_0x555e83[_0x8554('0x1c')]();logger[_0x8554('0x1d')](_0x8554('0x1f'),_0x335b91);_0x188037[_0x8554('0x20')]();},_0x39d2a6);strategy[_0x8554('0x21')](_0x555e83,_0x46284a,_0x558eb3,_0x3146a2);}else{logger['error'](_0x8554('0x22'),_0x335b91,_0x43df8f[_0x8554('0xb')]);_0x188037[_0x8554('0x13')]();}}}catch(_0x58e3aa){console['log'](_0x58e3aa);logger[_0x8554('0xe')](_0x8554('0x23'),_0x335b91,_0x58e3aa[_0x8554('0x24')]);_0x188037[_0x8554('0x13')]();}};}; \ 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 c4a5a0f..83d8de7 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 _0xbf64=['consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','then','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','dialogState','Failed','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x1755a9,_0x1b0e63){var _0x307035=function(_0x487e09){while(--_0x487e09){_0x1755a9['push'](_0x1755a9['shift']());}};_0x307035(++_0x1b0e63);}(_0xbf64,0x1d0));var _0x4bf6=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0xbf64[_0x2e04ef];return _0x5722b0;};'use strict';var _=require(_0x4bf6('0x0'));var moment=require('moment');var AWS=require(_0x4bf6('0x1'));var utils=require(_0x4bf6('0x2'));var logger=require(_0x4bf6('0x3'))(_0x4bf6('0x4'));var rpc={'chatMessage':require(_0x4bf6('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x4bf6('0x6')),'smsMessage':require(_0x4bf6('0x7')),'faxMessage':require(_0x4bf6('0x8'))};exports[_0x4bf6('0x9')]=function(_0x5e48a3,_0x38c025){return function(_0x1c7dbb){try{if(!_[_0x4bf6('0xa')](this[_0x4bf6('0xb')][_0x4bf6('0xc')])){logger[_0x4bf6('0xd')](_0x4bf6('0xe'),_0x5e48a3,_0x4bf6('0xf'));return _0x1c7dbb[_0x4bf6('0x10')]();}var _0x596a74={'ContactId':this[_0x4bf6('0x11')]['id'],'sentAt':moment()[_0x4bf6('0x12')](_0x4bf6('0x13')),'direction':_0x4bf6('0x14')};var _0x26b84c=this[_0x4bf6('0x15')];if(_0x26b84c===_0x4bf6('0x16')){_0x596a74[_0x4bf6('0x17')]=this[_0x4bf6('0x18')]['id'];}else{_0x596a74[_[_0x4bf6('0x19')](_0x26b84c)+'AccountId']=this[_0x4bf6('0x18')]['id'];}_0x596a74[_[_0x4bf6('0x19')](_0x26b84c)+_0x4bf6('0x1a')]=this['interaction']['id'];if(this[_0x4bf6('0xb')][_0x4bf6('0x1b')]){var _0x2d027d=_0x38c025[0x4];if(!_['isEmpty'](_0x2d027d)){_0x596a74[_0x4bf6('0x1c')]=utils[_0x4bf6('0x1d')](_0x2d027d,this);return rpc[_0x26b84c+_0x4bf6('0x1e')][_0x4bf6('0x1f')](_0x596a74)[_0x4bf6('0x20')](function(_0x4e1d47){logger[_0x4bf6('0xd')]('[%s][AMAZONLEX]\x20%s',_0x5e48a3,_0x596a74['body']);})['catch'](function(_0x1eaed6){logger[_0x4bf6('0x21')](_0x4bf6('0xe'),_0x5e48a3,JSON[_0x4bf6('0x22')](_0x1eaed6));})['finally'](function(){logger['info'](_0x4bf6('0x23'),_0x5e48a3);_0x1c7dbb[_0x4bf6('0x24')]();});}else{logger['info'](_0x4bf6('0x25'),_0x5e48a3);_0x1c7dbb[_0x4bf6('0x24')]();}}else{var _0x424348=this;var _0x2e6df2=new AWS['LexRuntime']({'accessKeyId':_0x38c025[0x0],'secretAccessKey':_0x38c025[0x1],'region':_0x38c025[0x2]});var _0x3388a7={'botAlias':_0x4bf6('0x26'),'botName':_0x38c025[0x3],'inputText':this[_0x4bf6('0x27')]['body'],'userId':this[_0x4bf6('0xb')]['id'][_0x4bf6('0x28')]()};_0x2e6df2['postText'](_0x3388a7,function(_0x32af20,_0x82903){if(_0x32af20){logger[_0x4bf6('0x21')]('[%s][AMAZONLEX]\x20%s',_0x5e48a3,_0x32af20['message']);_0x1c7dbb['next']();}else if(_0x82903&&_0x82903[_0x4bf6('0x27')]){_0x424348[_0x4bf6('0x1c')]['amazonlex']=_0x82903;_0x596a74[_0x4bf6('0x1c')]=_0x82903[_0x4bf6('0x27')];return rpc[_0x26b84c+_0x4bf6('0x1e')]['create'](_0x596a74)[_0x4bf6('0x20')](function(_0x2f5366){logger['info']('[%s][AMAZONLEX]\x20%s',_0x5e48a3,_0x596a74[_0x4bf6('0x1c')]);if(_0x82903[_0x4bf6('0x29')]==_0x4bf6('0x2a')){_0x1c7dbb[_0x4bf6('0x10')]();}else{_0x1c7dbb[_0x4bf6('0x24')]();}})['catch'](function(_0xeca4ab){logger['error'](_0x4bf6('0xe'),_0x5e48a3,JSON[_0x4bf6('0x22')](_0xeca4ab));_0x1c7dbb[_0x4bf6('0x10')]();});}else{_0x1c7dbb[_0x4bf6('0x10')]();}});}}catch(_0x3aa934){logger[_0x4bf6('0x21')](_0x4bf6('0xe'),_0x5e48a3,JSON[_0x4bf6('0x22')](_0x3aa934));_0x1c7dbb['stop']();}};}; \ No newline at end of file +var _0xfeef=['out','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','isEmpty','then','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','Message','dialogState','Failed','catch','next','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4ab27b,_0x563ee2){var _0x1276c6=function(_0x275ec7){while(--_0x275ec7){_0x4ab27b['push'](_0x4ab27b['shift']());}};_0x1276c6(++_0x563ee2);}(_0xfeef,0xc2));var _0xffee=function(_0x741427,_0x21fe4c){_0x741427=_0x741427-0x0;var _0x5e0a59=_0xfeef[_0x741427];return _0x5e0a59;};'use strict';var _=require('lodash');var moment=require(_0xffee('0x0'));var AWS=require(_0xffee('0x1'));var utils=require(_0xffee('0x2'));var logger=require(_0xffee('0x3'))('routing');var rpc={'chatMessage':require(_0xffee('0x4')),'openchannelMessage':require(_0xffee('0x5')),'mailMessage':require(_0xffee('0x6')),'smsMessage':require(_0xffee('0x7')),'faxMessage':require(_0xffee('0x8'))};exports[_0xffee('0x9')]=function(_0x4e6a5b,_0xa6bce0){return function(_0x35ce09){try{if(!_[_0xffee('0xa')](this[_0xffee('0xb')][_0xffee('0xc')])){logger[_0xffee('0xd')](_0xffee('0xe'),_0x4e6a5b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x35ce09['next']();}var _0x5138be={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xffee('0xf')),'direction':_0xffee('0x10')};var _0x30ae24=this[_0xffee('0x11')];if(_0x30ae24===_0xffee('0x12')){_0x5138be[_0xffee('0x13')]=this['account']['id'];}else{_0x5138be[_[_0xffee('0x14')](_0x30ae24)+_0xffee('0x15')]=this[_0xffee('0x16')]['id'];}_0x5138be[_[_0xffee('0x14')](_0x30ae24)+'InteractionId']=this[_0xffee('0xb')]['id'];if(this[_0xffee('0xb')]['created']){var _0x357582=_0xa6bce0[0x4];if(!_[_0xffee('0x17')](_0x357582)){_0x5138be['body']=utils['getMustacheRender'](_0x357582,this);return rpc[_0x30ae24+'Message']['create'](_0x5138be)[_0xffee('0x18')](function(_0x4708bd){logger[_0xffee('0xd')](_0xffee('0xe'),_0x4e6a5b,_0x5138be[_0xffee('0x19')]);})['catch'](function(_0xf64762){logger[_0xffee('0x1a')](_0xffee('0xe'),_0x4e6a5b,JSON[_0xffee('0x1b')](_0xf64762));})[_0xffee('0x1c')](function(){logger[_0xffee('0xd')](_0xffee('0x1d'),_0x4e6a5b);_0x35ce09[_0xffee('0x1e')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4e6a5b);_0x35ce09[_0xffee('0x1e')]();}}else{var _0x111740=this;var _0x2a0425=new AWS[(_0xffee('0x1f'))]({'accessKeyId':_0xa6bce0[0x0],'secretAccessKey':_0xa6bce0[0x1],'region':_0xa6bce0[0x2]});var _0x2b4925={'botAlias':_0xffee('0x20'),'botName':_0xa6bce0[0x3],'inputText':this[_0xffee('0x21')][_0xffee('0x19')],'userId':this[_0xffee('0xb')]['id'][_0xffee('0x22')]()};_0x2a0425[_0xffee('0x23')](_0x2b4925,function(_0x1a9066,_0xf0c1b4){if(_0x1a9066){logger['error']('[%s][AMAZONLEX]\x20%s',_0x4e6a5b,_0x1a9066[_0xffee('0x21')]);_0x35ce09['next']();}else if(_0xf0c1b4&&_0xf0c1b4['message']){_0x111740[_0xffee('0x19')][_0xffee('0x24')]=_0xf0c1b4;_0x5138be[_0xffee('0x19')]=_0xf0c1b4['message'];return rpc[_0x30ae24+_0xffee('0x25')]['create'](_0x5138be)[_0xffee('0x18')](function(_0x93639f){logger['info'](_0xffee('0xe'),_0x4e6a5b,_0x5138be[_0xffee('0x19')]);if(_0xf0c1b4[_0xffee('0x26')]==_0xffee('0x27')){_0x35ce09['next']();}else{_0x35ce09[_0xffee('0x1e')]();}})[_0xffee('0x28')](function(_0x1f9209){logger['error']('[%s][AMAZONLEX]\x20%s',_0x4e6a5b,JSON[_0xffee('0x1b')](_0x1f9209));_0x35ce09[_0xffee('0x29')]();});}else{_0x35ce09[_0xffee('0x29')]();}});}}catch(_0xd89441){logger[_0xffee('0x1a')]('[%s][AMAZONLEX]\x20%s',_0x4e6a5b,JSON['stringify'](_0xd89441));_0x35ce09[_0xffee('0x1e')]();}};}; \ 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 1ffbc9c..1a7ccb2 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 _0x70e0=['from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','html','','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','error','finally','next','create','body','catch','stringify','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message'];(function(_0x17888f,_0x3a8b7f){var _0x22b64a=function(_0x5b81e6){while(--_0x5b81e6){_0x17888f['push'](_0x17888f['shift']());}};_0x22b64a(++_0x3a8b7f);}(_0x70e0,0x17b));var _0x070e=function(_0xf969de,_0x1ab03b){_0xf969de=_0xf969de-0x0;var _0x403453=_0x70e0[_0xf969de];return _0x403453;};'use strict';var _=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var utils=require(_0x070e('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x070e('0x3')),'openchannelMessage':require(_0x070e('0x4')),'mailMessage':require(_0x070e('0x5')),'smsMessage':require(_0x070e('0x6')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x070e('0x7'));exports['consequence']=function(_0x46fe68,_0x4b041d){return function(_0x56e420){try{if(_0x4b041d[0x0]==='1'&&(_['isNil'](this[_0x070e('0x8')][_0x070e('0x9')])||!this[_0x070e('0x8')][_0x070e('0x9')])){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x070e('0xc'));return _0x56e420['next']();}var _0x49b2fb=this[_0x070e('0xd')];var _0x2e3e5e={'body':utils[_0x070e('0xe')](_0x4b041d[0x1],this),'ContactId':this[_0x070e('0xf')]['id'],'sentAt':moment()[_0x070e('0x10')](_0x070e('0x11')),'direction':_0x070e('0x12')};if(this[_0x070e('0x13')]){_0x2e3e5e['to']=this[_0x070e('0x13')][_0x070e('0x14')]||'';_0x2e3e5e['cc']=this[_0x070e('0x13')]['cc']||'';_0x2e3e5e['from']=this['message']['to']||'';_0x2e3e5e[_0x070e('0x15')]=this['message']['phone']||'';_0x2e3e5e['read']=!![];if(this[_0x070e('0x13')][_0x070e('0x16')]){_0x2e3e5e['subject']='';_0x2e3e5e['subject']+=_[_0x070e('0x17')](this[_0x070e('0x13')][_0x070e('0x16')],_0x070e('0x18'))?'':'Re:\x20';_0x2e3e5e['subject']+=this[_0x070e('0x13')][_0x070e('0x16')];}}if(this[_0x070e('0xd')]===_0x070e('0x19')){_0x2e3e5e[_0x070e('0x1a')]=this['account']['id'];}else{_0x2e3e5e[_[_0x070e('0x1b')](this[_0x070e('0xd')])+_0x070e('0x1c')]=this[_0x070e('0x1d')]['id'];}_0x2e3e5e[_[_0x070e('0x1b')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x070e('0xd')]+_0x070e('0x1e')]){if(this[_0x070e('0xd')]==='mail'){var _0x5b184={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x070e('0x1f')][_0x070e('0x20')]){_0x5b184[_0x070e('0x20')]=this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x20')];}else{_0x5b184[_0x070e('0x21')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x21')];_0x5b184[_0x070e('0x22')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x22')];_0x5b184['secure']=this['account'][_0x070e('0x1f')][_0x070e('0x23')];}if(this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x24')]){_0x5b184['auth']={'user':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x25')],'pass':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x26')]};}_0x2e3e5e[_0x070e('0x27')]=this[_0x070e('0x13')]['messageId'];_0x2e3e5e[_0x070e('0x28')]=_0x070e('0x29')+_[_0x070e('0x2a')](_0x2e3e5e['body'],']+(>|$)/g,''),'priorityTrue':_0x49649a[0x1],'priorityFalse':_0x49649a[0x2]};var _0x2783b5=gotoif[_0x7cdb('0x7')](_0x537687,{'typecast':!![]});if(_0x2783b5[_0x7cdb('0x8')]){logger['error'](_0x7cdb('0x9'),_0xd19ec7,_[_0x7cdb('0xa')](_0x2783b5,'message')[_0x7cdb('0xb')](',\x20'));_0x41863e[_0x7cdb('0xc')]();}else{try{var _0x579a67=eval('('+_0x537687[_0x7cdb('0xd')]+')');var _0x1db57e=_0x579a67?_0x537687['priorityTrue']:_0x537687[_0x7cdb('0xe')];logger['info'](_0x7cdb('0xf'),_0xd19ec7,_0x537687[_0x7cdb('0xd')],_0x579a67,_0x1db57e||_0x7cdb('0x10'));if(_0x1db57e){var _0x571779=_['findIndex'](_0x41863e[_0x7cdb('0x11')](),{'p':_0x1db57e});if(_0x571779>=0x0){logger['info'](_0x7cdb('0x12'),_0xd19ec7,_0x1db57e||_0x7cdb('0x10'),_0x571779);_0x41863e[_0x7cdb('0x10')](_0x571779);}else{logger[_0x7cdb('0x13')](_0x7cdb('0x14'),_0xd19ec7,_0x1db57e||_0x7cdb('0x10'));_0x41863e[_0x7cdb('0xc')]();}}else{_0x41863e['next']();}}catch(_0x1d8076){logger[_0x7cdb('0x15')](_0x7cdb('0x16'),_0xd19ec7,_0x1d8076[_0x7cdb('0x17')]);_0x41863e[_0x7cdb('0xc')]();}}}catch(_0x560527){logger[_0x7cdb('0x15')](_0x7cdb('0x9'),_0xd19ec7,JSON[_0x7cdb('0x18')](_0x560527));_0x41863e['stop']();}};}; \ No newline at end of file +var _0x0280=['stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0280,0x167));var _0x0028=function(_0x274da9,_0xbd41f5){_0x274da9=_0x274da9-0x0;var _0x517886=_0x0280[_0x274da9];return _0x517886;};'use strict';var schema=require(_0x0028('0x0'));var _=require(_0x0028('0x1'));var htmlToText=require(_0x0028('0x2'));var utils=require(_0x0028('0x3'));var logger=require(_0x0028('0x4'))('routing');var gotoif=schema({'condition':{'type':_0x0028('0x5'),'required':!![],'message':_0x0028('0x6')},'priorityTrue':{'type':_0x0028('0x7'),'message':_0x0028('0x8')},'priorityFalse':{'type':_0x0028('0x7'),'message':_0x0028('0x9')}});exports[_0x0028('0xa')]=function(_0x3825b8,_0xd8b40e){return function(_0x7509b6){try{var _0x10f81e={'condition':htmlToText[_0x0028('0xb')](utils['getMustacheRender'](_0xd8b40e[0x0],this),{'wordwrap':![]})[_0x0028('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xd8b40e[0x1],'priorityFalse':_0xd8b40e[0x2]};var _0x57f54f=gotoif[_0x0028('0x0')](_0x10f81e,{'typecast':!![]});if(_0x57f54f[_0x0028('0xd')]){logger[_0x0028('0xe')](_0x0028('0xf'),_0x3825b8,_[_0x0028('0x10')](_0x57f54f,_0x0028('0x11'))['join'](',\x20'));_0x7509b6[_0x0028('0x12')]();}else{try{var _0x3f3e40=eval('('+_0x10f81e['condition']+')');var _0x44faa0=_0x3f3e40?_0x10f81e[_0x0028('0x13')]:_0x10f81e[_0x0028('0x14')];logger[_0x0028('0x15')](_0x0028('0x16'),_0x3825b8,_0x10f81e['condition'],_0x3f3e40,_0x44faa0||_0x0028('0x17'));if(_0x44faa0){var _0x331981=_[_0x0028('0x18')](_0x7509b6['rules'](),{'p':_0x44faa0});if(_0x331981>=0x0){logger[_0x0028('0x15')](_0x0028('0x19'),_0x3825b8,_0x44faa0||_0x0028('0x17'),_0x331981);_0x7509b6[_0x0028('0x17')](_0x331981);}else{logger[_0x0028('0x15')](_0x0028('0x1a'),_0x3825b8,_0x44faa0||'next');_0x7509b6[_0x0028('0x12')]();}}else{_0x7509b6[_0x0028('0x17')]();}}catch(_0x496c31){logger['error'](_0x0028('0x1b'),_0x3825b8,_0x496c31[_0x0028('0x11')]);_0x7509b6[_0x0028('0x12')]();}}}catch(_0x29e62c){logger[_0x0028('0xe')]('[%s][GOTOIF]\x20%s',_0x3825b8,JSON[_0x0028('0x1c')](_0x29e62c));_0x7509b6[_0x0028('0x12')]();}};}; \ 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 ddb30e7..fe70996 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 _0xbb75=['error','[%s][GOTOP]\x20%s','validate','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','map','message','join','stop','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x5e3fb7,_0x4f0c05){var _0x3c9228=function(_0x8636ae){while(--_0x8636ae){_0x5e3fb7['push'](_0x5e3fb7['shift']());}};_0x3c9228(++_0x4f0c05);}(_0xbb75,0xdf));var _0x5bb7=function(_0xf14a09,_0x29aa5a){_0xf14a09=_0xf14a09-0x0;var _0x1e253c=_0xbb75[_0xf14a09];return _0x1e253c;};'use strict';var schema=require(_0x5bb7('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x5bb7('0x1')}});exports['consequence']=function(_0x49d454,_0x2e4d23){return function(_0x5e495f){try{var _0x485eef={'priority':_0x2e4d23[0x0]};var _0x2c79e5=gotop['validate'](_0x485eef,{'typecast':!![]});if(_0x2c79e5['length']){logger['error']('[%s][GOTOP]\x20%s',_0x49d454,_[_0x5bb7('0x2')](_0x2c79e5,_0x5bb7('0x3'))[_0x5bb7('0x4')](',\x20'));_0x5e495f[_0x5bb7('0x5')]();}else{logger[_0x5bb7('0x6')]('[%s][GOTOP]\x20priority\x20%s',_0x49d454,_0x485eef['priority']);if(_0x485eef[_0x5bb7('0x7')]){var _0x17a7e0=_[_0x5bb7('0x8')](_0x5e495f['rules'](),{'p':_0x485eef[_0x5bb7('0x7')]});if(_0x17a7e0>=0x0){logger[_0x5bb7('0x6')](_0x5bb7('0x9'),_0x49d454,_0x485eef[_0x5bb7('0x7')]||_0x5bb7('0xa'),_0x17a7e0);_0x5e495f[_0x5bb7('0xa')](_0x17a7e0);}else{logger[_0x5bb7('0x6')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x49d454,_0x485eef[_0x5bb7('0x7')]||_0x5bb7('0xa'));_0x5e495f[_0x5bb7('0x5')]();}}else{_0x5e495f[_0x5bb7('0xa')]();}}}catch(_0x4c406){logger[_0x5bb7('0xb')](_0x5bb7('0xc'),_0x49d454,JSON['stringify'](_0x4c406));_0x5e495f['stop']();}};}; \ No newline at end of file +var _0x08b2=['[%s][GOTOP]\x20%s','map','message','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','next','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','length','error'];(function(_0x5c6289,_0x4a6832){var _0x33fa33=function(_0x247d05){while(--_0x247d05){_0x5c6289['push'](_0x5c6289['shift']());}};_0x33fa33(++_0x4a6832);}(_0x08b2,0x14e));var _0x208b=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x08b2[_0x55abd9];return _0x3e5669;};'use strict';var schema=require(_0x208b('0x0'));var _=require(_0x208b('0x1'));var logger=require(_0x208b('0x2'))(_0x208b('0x3'));var gotop=schema({'priority':{'type':_0x208b('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x208b('0x5')]=function(_0x34b04b,_0x2c458c){return function(_0x4f7df6){try{var _0x1cd7f5={'priority':_0x2c458c[0x0]};var _0x13b48a=gotop[_0x208b('0x0')](_0x1cd7f5,{'typecast':!![]});if(_0x13b48a[_0x208b('0x6')]){logger[_0x208b('0x7')](_0x208b('0x8'),_0x34b04b,_[_0x208b('0x9')](_0x13b48a,_0x208b('0xa'))['join'](',\x20'));_0x4f7df6[_0x208b('0xb')]();}else{logger['info'](_0x208b('0xc'),_0x34b04b,_0x1cd7f5[_0x208b('0xd')]);if(_0x1cd7f5[_0x208b('0xd')]){var _0x46e050=_[_0x208b('0xe')](_0x4f7df6[_0x208b('0xf')](),{'p':_0x1cd7f5[_0x208b('0xd')]});if(_0x46e050>=0x0){logger[_0x208b('0x10')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x34b04b,_0x1cd7f5[_0x208b('0xd')]||_0x208b('0x11'),_0x46e050);_0x4f7df6[_0x208b('0x11')](_0x46e050);}else{logger[_0x208b('0x10')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x34b04b,_0x1cd7f5[_0x208b('0xd')]||'next');_0x4f7df6[_0x208b('0xb')]();}}else{_0x4f7df6[_0x208b('0x11')]();}}}catch(_0x36ebc8){logger[_0x208b('0x7')](_0x208b('0x8'),_0x34b04b,JSON[_0x208b('0x12')](_0x36ebc8));_0x4f7df6['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index e9b3ebd..d7b1d6d 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 _0x4cd2=['upperFirst','AccountId','Message','then','info','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account'];(function(_0xe6d3a,_0x4bb8df){var _0x22a951=function(_0x38cbe0){while(--_0x38cbe0){_0xe6d3a['push'](_0xe6d3a['shift']());}};_0x22a951(++_0x4bb8df);}(_0x4cd2,0xc2));var _0x24cd=function(_0xa0a817,_0x22b987){_0xa0a817=_0xa0a817-0x0;var _0x19f1ff=_0x4cd2[_0xa0a817];return _0x19f1ff;};'use strict';var _=require(_0x24cd('0x0'));var utils=require(_0x24cd('0x1'));var logger=require(_0x24cd('0x2'))(_0x24cd('0x3'));var rpc={'chatMessage':require(_0x24cd('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x24cd('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x24cd('0x6'))};exports[_0x24cd('0x7')]=function(_0x39a03c,_0x3ec540){return function(_0x46a90c){try{var _0x56634f={'body':utils[_0x24cd('0x8')](_0x3ec540[0x0],this),'ContactId':this[_0x24cd('0x9')]['id']};if(this[_0x24cd('0xa')]==='chat'){_0x56634f[_0x24cd('0xb')]=this[_0x24cd('0xc')]['id'];}else{_0x56634f[_[_0x24cd('0xd')](this[_0x24cd('0xa')])+_0x24cd('0xe')]=this[_0x24cd('0xc')]['id'];}_0x56634f[_['upperFirst'](this[_0x24cd('0xa')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x24cd('0xa')]+'Message']){return rpc[this['channel']+_0x24cd('0xf')]['create'](_0x56634f)[_0x24cd('0x10')](function(_0x105cbd){logger[_0x24cd('0x11')]('[%s][MESSAGE]\x20%s',_0x39a03c,_0x56634f[_0x24cd('0x12')]);_0x46a90c['next']();})[_0x24cd('0x13')](function(_0xfac153){logger[_0x24cd('0x14')]('[%s][MESSAGE]\x20%s',_0x39a03c,JSON[_0x24cd('0x15')](_0xfac153));_0x46a90c[_0x24cd('0x16')]();});}}catch(_0x4d028f){logger['error']('[%s][MESSAGE]\x20%s',_0x39a03c,JSON['stringify'](_0x4d028f));_0x46a90c['stop']();}};}; \ No newline at end of file +var _0x4265=['./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','getMustacheRender','ChatWebsiteId','upperFirst','channel','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','lodash'];(function(_0x1f702e,_0x324b45){var _0x31dbe8=function(_0x3ca65f){while(--_0x3ca65f){_0x1f702e['push'](_0x1f702e['shift']());}};_0x31dbe8(++_0x324b45);}(_0x4265,0x14f));var _0x5426=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x4265[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x5426('0x0'));var utils=require(_0x5426('0x1'));var logger=require('../../../../config/logger')(_0x5426('0x2'));var rpc={'chatMessage':require(_0x5426('0x3')),'openchannelMessage':require(_0x5426('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5426('0x5')),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x559666,_0x3dbfc8){return function(_0x5b2430){try{var _0x1d8400={'body':utils[_0x5426('0x6')](_0x3dbfc8[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x1d8400[_0x5426('0x7')]=this['account']['id'];}else{_0x1d8400[_[_0x5426('0x8')](this[_0x5426('0x9')])+'AccountId']=this['account']['id'];}_0x1d8400[_['upperFirst'](this[_0x5426('0x9')])+_0x5426('0xa')]=this['interaction']['id'];if(rpc[this['channel']+_0x5426('0xb')]){return rpc[this[_0x5426('0x9')]+_0x5426('0xb')][_0x5426('0xc')](_0x1d8400)[_0x5426('0xd')](function(_0x41a376){logger[_0x5426('0xe')](_0x5426('0xf'),_0x559666,_0x1d8400[_0x5426('0x10')]);_0x5b2430[_0x5426('0x11')]();})[_0x5426('0x12')](function(_0x157014){logger[_0x5426('0x13')](_0x5426('0xf'),_0x559666,JSON['stringify'](_0x157014));_0x5b2430[_0x5426('0x14')]();});}}catch(_0xdfe2b3){logger[_0x5426('0x13')](_0x5426('0xf'),_0x559666,JSON['stringify'](_0xdfe2b3));_0x5b2430[_0x5426('0x14')]();}};}; \ 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 e718a27..df490a0 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 _0x13e2=['error','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','next'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x13e2,0x86));var _0x213e=function(_0x110d0d,_0x4cbd98){_0x110d0d=_0x110d0d-0x0;var _0x586e10=_0x13e2[_0x110d0d];return _0x586e10;};'use strict';var utils=require(_0x213e('0x0'));var logger=require(_0x213e('0x1'))(_0x213e('0x2'));exports[_0x213e('0x3')]=function(_0x252b92,_0x456dd4){return function(_0x57ca6e){try{logger[_0x213e('0x4')]('[%s][NOOP]\x20%s',_0x252b92,utils['getMustacheRender'](_0x456dd4[0x0],this));_0x57ca6e[_0x213e('0x5')]();}catch(_0x4ff4eb){logger[_0x213e('0x6')](_0x213e('0x7'),_0x252b92,JSON[_0x213e('0x8')](_0x4ff4eb));_0x57ca6e[_0x213e('0x9')]();}};}; \ No newline at end of file +var _0xb182=['getMustacheRender','next','error','[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x4f68ee,_0x3cd128){var _0x461a40=function(_0xbf006e){while(--_0xbf006e){_0x4f68ee['push'](_0x4f68ee['shift']());}};_0x461a40(++_0x3cd128);}(_0xb182,0xd7));var _0x2b18=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xb182[_0x2a9f4];return _0x3c39e0;};'use strict';var utils=require(_0x2b18('0x0'));var logger=require(_0x2b18('0x1'))(_0x2b18('0x2'));exports[_0x2b18('0x3')]=function(_0x478fe9,_0x3f4e99){return function(_0x2ed5f0){try{logger[_0x2b18('0x4')]('[%s][NOOP]\x20%s',_0x478fe9,utils[_0x2b18('0x5')](_0x3f4e99[0x0],this));_0x2ed5f0[_0x2b18('0x6')]();}catch(_0x332293){logger[_0x2b18('0x7')](_0x2b18('0x8'),_0x478fe9,JSON['stringify'](_0x332293));_0x2ed5f0[_0x2b18('0x9')]();}};}; \ 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 027e001..85b467e 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 _0xd8cc=['rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','account','queue','from','queue_id','pick','format','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','stop','Queues','createQueue','atimeout','qtimeout','rules','end','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','strategy'];(function(_0x12a1d8,_0x1eb9dc){var _0x575284=function(_0x49b6e0){while(--_0x49b6e0){_0x12a1d8['push'](_0x12a1d8['shift']());}};_0x575284(++_0x1eb9dc);}(_0xd8cc,0x1d2));var _0xcd8c=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0xd8cc[_0x2ab365];return _0x49fef3;};'use strict';var schema=require(_0xcd8c('0x0'));var _=require(_0xcd8c('0x1'));var util=require(_0xcd8c('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xcd8c('0x3'));var Redis=require(_0xcd8c('0x4'));var config=require(_0xcd8c('0x5'));var logger=require(_0xcd8c('0x6'))(_0xcd8c('0x7'));var strategy=require('./strategy');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id','queue_id',_0xcd8c('0x8'),_0xcd8c('0x9'),_0xcd8c('0xa'),'joinAt'];function emit(_0x2647c5,_0x17c7ce,_0x418810){io['to'](_0x2647c5)['emit'](_0x17c7ce,_0x418810);}function emitChannelQueueInteraction(_0x37243e,_0x36abf1,_0x430547,_0x2de2a5,_0x56e7c9,_0x1de9ab,_0x4096ca,_0x5805fa){_0x430547[_0xcd8c('0xb')]=_0x5805fa;_0x430547['queue']=_0x36abf1;_0x430547[_0xcd8c('0x8')]=_0x2de2a5;_0x430547['id']=_0x56e7c9;if(_0x1de9ab){_0x4096ca[util['format']('%sQueuesWaitingInteractions',_0x37243e)][_0x56e7c9]=_[_0xcd8c('0xc')](_0x430547,attributes);}else{delete _0x4096ca[util[_0xcd8c('0xd')]('%sQueuesWaitingInteractions',_0x37243e)][_0x56e7c9];}emit(util[_0xcd8c('0xd')]('%s:queue:%s',_0x37243e,_0x36abf1),util['format'](_0xcd8c('0xe'),_0x37243e,_0x1de9ab?'save':_0xcd8c('0xf')),_[_0xcd8c('0xc')](_0x430547,attributes));}var rpc={'openchannelQueueReport':require(_0xcd8c('0x10')),'mailQueueReport':require(_0xcd8c('0x11')),'chatQueueReport':require(_0xcd8c('0x12')),'smsQueueReport':require(_0xcd8c('0x13')),'faxQueueReport':require(_0xcd8c('0x14'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xcd8c('0x15')},'timeout':{'type':_0xcd8c('0x16'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x13f964,_0x4bc2c8,_0x3238fd,_0x513621){if(_0x13f964&&_0x4bc2c8&&_0x3238fd){_0x4bc2c8['waiting']+=0x1;var _0x5dcd09={'uniqueid':_0x13f964,'from':_0x3238fd[_0xcd8c('0x17')]?_0x3238fd['body'][_0xcd8c('0xa')]:'','joinAt':moment()[_0xcd8c('0xd')](_0xcd8c('0x18')),'ContactId':_0x3238fd['contact']?_0x3238fd[_0xcd8c('0x19')]['id']:null,'ListId':_0x3238fd[_0xcd8c('0x1a')]?_0x3238fd[_0xcd8c('0x1a')]['id']:null};_0x5dcd09[_[_0xcd8c('0x1b')](_0x3238fd[_0xcd8c('0x1c')])+_0xcd8c('0x1d')]=_0x4bc2c8['id']||null;_0x5dcd09[_[_0xcd8c('0x1b')](_0x3238fd[_0xcd8c('0x1c')])+_0xcd8c('0x1e')]=_0x3238fd[_0xcd8c('0x1f')]?_0x3238fd[_0xcd8c('0x1f')]['id']:null;_0x5dcd09[_[_0xcd8c('0x1b')](_0x3238fd[_0xcd8c('0x1c')])+'MessageId']=_0x3238fd[_0xcd8c('0x20')]?_0x3238fd['message']['id']:null;_0x5dcd09[_[_0xcd8c('0x1b')](_0x3238fd['channel'])+(_0x3238fd[_0xcd8c('0x1c')]!=='chat'?'AccountId':'WebsiteId')]=_0x3238fd['account']?_0x3238fd[_0xcd8c('0x8')]['id']:null;logger[_0xcd8c('0x21')](util[_0xcd8c('0xd')](_0xcd8c('0x22'),_0x13f964,_0x4bc2c8[_0xcd8c('0x23')]));emitChannelQueueInteraction(_0x3238fd['channel'],_0x4bc2c8[_0xcd8c('0x23')],_0x5dcd09,_0x3238fd['account'][_0xcd8c('0x23')],_0x3238fd[_0xcd8c('0x20')]['id'],!![],_0x513621,_0x4bc2c8['id']);if(rpc[_0x3238fd[_0xcd8c('0x1c')]+_0xcd8c('0x24')]){return rpc[_0x3238fd[_0xcd8c('0x1c')]+_0xcd8c('0x24')]['create'](_0x5dcd09)[_0xcd8c('0x25')](function(_0x1e0f10){logger[_0xcd8c('0x26')](_0xcd8c('0x27'));});}}}function stopRouting(_0x1a1287,_0x37f5aa,_0x232450,_0x578c12){if(_0x1a1287&&_0x37f5aa){_0x37f5aa[_0xcd8c('0x28')]-=0x1;var _0x442474={'leaveAt':moment()[_0xcd8c('0xd')](_0xcd8c('0x18')),'acceptAt':moment()[_0xcd8c('0xd')](_0xcd8c('0x18')),'reason':_0xcd8c('0x29')};logger[_0xcd8c('0x21')](util[_0xcd8c('0xd')](_0xcd8c('0x2a'),_0x1a1287,_0x37f5aa['name']));emitChannelQueueInteraction(_0x232450[_0xcd8c('0x1c')],_0x37f5aa['name'],_0x232450[_0xcd8c('0x17')],_0x232450['account'][_0xcd8c('0x23')],_0x232450[_0xcd8c('0x20')]['id'],![],_0x578c12,_0x37f5aa['id']);if(rpc[_0x232450[_0xcd8c('0x1c')]+_0xcd8c('0x24')]){return rpc[_0x232450[_0xcd8c('0x1c')]+'QueueReport'][_0xcd8c('0x2b')](_0x1a1287,_0x442474)['catch'](function(_0x89766f){logger[_0xcd8c('0x26')]('update\x20queue\x20report');});}}}function endRouting(_0xed33d,_0x57e537,_0x423464,_0x8f4357){if(_0xed33d&&_0x57e537){_0x57e537[_0xcd8c('0x28')]-=0x1;var _0x4e63f6={'leaveAt':moment()[_0xcd8c('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xcd8c('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xcd8c('0x2c')};logger[_0xcd8c('0x21')](util[_0xcd8c('0xd')](_0xcd8c('0x2d'),_0xed33d,_0x57e537[_0xcd8c('0x23')]));emitChannelQueueInteraction(_0x423464[_0xcd8c('0x1c')],_0x57e537[_0xcd8c('0x23')],_0x423464[_0xcd8c('0x17')],_0x423464[_0xcd8c('0x8')]['name'],_0x423464['message']['id'],![],_0x8f4357);if(rpc[_0x423464[_0xcd8c('0x1c')]+_0xcd8c('0x24')]){return rpc[_0x423464[_0xcd8c('0x1c')]+_0xcd8c('0x24')][_0xcd8c('0x2b')](_0xed33d,_0x4e63f6)['catch'](function(_0x3ef4b4){logger[_0xcd8c('0x26')](_0xcd8c('0x2e'));});}}}function handleFindQueue(_0x4f9ecb){return function(_0x53b30d){return _0x53b30d['name'][_0xcd8c('0x2f')]()===_0x4f9ecb[_0xcd8c('0x2f')]();};}exports[_0xcd8c('0x30')]=function(_0x4c5221,_0x5c3000,_0x1f046f,_0x3103ff){return function(_0x37009f){try{var _0x55bc33={'name':_0x5c3000[0x0],'timeout':_0x5c3000[0x1]};var _0x3e85bd=queue[_0xcd8c('0x0')](_0x55bc33,{'typecast':!![]});if(_0x3e85bd[_0xcd8c('0x31')]){logger['error'](_0xcd8c('0x32'),_0x4c5221,_['map'](_0x3e85bd,_0xcd8c('0x20'))['join'](',\x20'));_0x37009f[_0xcd8c('0x33')]();}else{var _0x22cbef=_['find'](_0x1f046f[_0x3103ff['channel']+_0xcd8c('0x34')],handleFindQueue(_0x55bc33[_0xcd8c('0x23')]));if(_0x22cbef){startRouting(_0x4c5221,_0x22cbef,_0x3103ff,_0x1f046f);var _0x101a99=(_0x22cbef[_0xcd8c('0x2c')]||0xa)*0x3e8;var _0x59f3b4=(_0x55bc33['timeout']||0x14)*0x3e8;var _0x53b4fb,_0x33b608;if(_0x101a99>_0x59f3b4){_0x59f3b4=_0x101a99;}var _0xc9ab66=seqqueue[_0xcd8c('0x35')](_0x101a99);_0xc9ab66['id']=_0x4c5221;_0xc9ab66[_0xcd8c('0x36')]=_0x101a99;_0xc9ab66[_0xcd8c('0x37')]=_0x59f3b4;_0xc9ab66[_0xcd8c('0x1c')]=_0x3103ff[_0xcd8c('0x1c')];_0x1f046f[_0xcd8c('0x38')][_0x4c5221]['on'](_0xcd8c('0x39'),function(){stopRouting(_0x4c5221,_0x22cbef,_0x3103ff,_0x1f046f);_0xc9ab66[_0xcd8c('0x3a')](!![]);clearTimeout(_0x53b4fb);_0x53b4fb=undefined;if(_0x1f046f['rules'][_0x4c5221]){delete _0x1f046f[_0xcd8c('0x38')][_0x4c5221];}logger[_0xcd8c('0x21')](_0xcd8c('0x3b'),_0x4c5221);_0x37009f[_0xcd8c('0x33')]();});_0x53b4fb=setTimeout(function(){endRouting(_0x4c5221,_0x22cbef,_0x3103ff,_0x1f046f);clearTimeout(_0x53b4fb);_0xc9ab66[_0xcd8c('0x3a')](!![]);logger['info'](_0xcd8c('0x3c'),_0x4c5221);_0x37009f['next']();},_0x59f3b4);switch(_0x22cbef[_0xcd8c('0x3d')]){case'rrmemory':strategy[_0xcd8c('0x3e')](_0xc9ab66,_0x22cbef,_0x1f046f,_0x3103ff);break;default:strategy[_0xcd8c('0x3f')](_0xc9ab66,_0x22cbef,_0x1f046f,_0x3103ff);}}else{logger['error'](_0xcd8c('0x40'),_0x4c5221,_0x55bc33[_0xcd8c('0x23')]);_0x37009f[_0xcd8c('0x33')]();}}}catch(_0x4cf844){console['log'](_0x4cf844);logger[_0xcd8c('0x26')](_0xcd8c('0x32'),_0x4c5221,_0x4cf844[_0xcd8c('0x41')]);_0x37009f[_0xcd8c('0x33')]();}};}; \ No newline at end of file +var _0xa98f=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','info','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','end','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove'];(function(_0x4542b7,_0x45b947){var _0x226db6=function(_0x55e4c8){while(--_0x55e4c8){_0x4542b7['push'](_0x4542b7['shift']());}};_0x226db6(++_0x45b947);}(_0xa98f,0x83));var _0xfa98=function(_0x6656b1,_0x3421ee){_0x6656b1=_0x6656b1-0x0;var _0x45ae3a=_0xa98f[_0x6656b1];return _0x45ae3a;};'use strict';var schema=require('validate');var _=require(_0xfa98('0x0'));var util=require(_0xfa98('0x1'));var seqqueue=require(_0xfa98('0x2'));var moment=require(_0xfa98('0x3'));var Redis=require(_0xfa98('0x4'));var config=require('../../../../config/environment');var logger=require(_0xfa98('0x5'))(_0xfa98('0x6'));var strategy=require('./strategy');config[_0xfa98('0x7')]=_[_0xfa98('0x8')](config[_0xfa98('0x7')],{'host':_0xfa98('0x9'),'port':0x18eb});var io=require(_0xfa98('0xa'))(new Redis(config['redis']));var attributes=['id',_0xfa98('0xb'),_0xfa98('0xc'),_0xfa98('0xd'),'from',_0xfa98('0xe')];function emit(_0x5620c3,_0x43e60d,_0x127fba){io['to'](_0x5620c3)[_0xfa98('0xf')](_0x43e60d,_0x127fba);}function emitChannelQueueInteraction(_0x50011c,_0x4968be,_0x3068e3,_0x5c7ae4,_0x29c0de,_0x1fdd8b,_0x1cd651,_0x404331){_0x3068e3[_0xfa98('0xb')]=_0x404331;_0x3068e3[_0xfa98('0xd')]=_0x4968be;_0x3068e3[_0xfa98('0xc')]=_0x5c7ae4;_0x3068e3['id']=_0x29c0de;if(_0x1fdd8b){_0x1cd651[util[_0xfa98('0x10')](_0xfa98('0x11'),_0x50011c)][_0x29c0de]=_['pick'](_0x3068e3,attributes);}else{delete _0x1cd651[util['format'](_0xfa98('0x11'),_0x50011c)][_0x29c0de];}emit(util[_0xfa98('0x10')](_0xfa98('0x12'),_0x50011c,_0x4968be),util['format'](_0xfa98('0x13'),_0x50011c,_0x1fdd8b?'save':_0xfa98('0x14')),_['pick'](_0x3068e3,attributes));}var rpc={'openchannelQueueReport':require(_0xfa98('0x15')),'mailQueueReport':require(_0xfa98('0x16')),'chatQueueReport':require(_0xfa98('0x17')),'smsQueueReport':require(_0xfa98('0x18')),'faxQueueReport':require(_0xfa98('0x19'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xfa98('0x1a')},'timeout':{'type':_0xfa98('0x1b'),'message':_0xfa98('0x1c')}});function startRouting(_0x5cd8e5,_0x3af939,_0x4b80ab,_0x4a0239){if(_0x5cd8e5&&_0x3af939&&_0x4b80ab){_0x3af939[_0xfa98('0x1d')]+=0x1;var _0x113522={'uniqueid':_0x5cd8e5,'from':_0x4b80ab[_0xfa98('0x1e')]?_0x4b80ab[_0xfa98('0x1e')][_0xfa98('0x1f')]:'','joinAt':moment()[_0xfa98('0x10')](_0xfa98('0x20')),'ContactId':_0x4b80ab[_0xfa98('0x21')]?_0x4b80ab[_0xfa98('0x21')]['id']:null,'ListId':_0x4b80ab[_0xfa98('0x22')]?_0x4b80ab[_0xfa98('0x22')]['id']:null};_0x113522[_[_0xfa98('0x23')](_0x4b80ab[_0xfa98('0x24')])+'QueueId']=_0x3af939['id']||null;_0x113522[_['upperFirst'](_0x4b80ab[_0xfa98('0x24')])+_0xfa98('0x25')]=_0x4b80ab[_0xfa98('0x26')]?_0x4b80ab[_0xfa98('0x26')]['id']:null;_0x113522[_[_0xfa98('0x23')](_0x4b80ab[_0xfa98('0x24')])+_0xfa98('0x27')]=_0x4b80ab[_0xfa98('0x28')]?_0x4b80ab[_0xfa98('0x28')]['id']:null;_0x113522[_[_0xfa98('0x23')](_0x4b80ab[_0xfa98('0x24')])+(_0x4b80ab[_0xfa98('0x24')]!=='chat'?_0xfa98('0x29'):_0xfa98('0x2a'))]=_0x4b80ab[_0xfa98('0xc')]?_0x4b80ab[_0xfa98('0xc')]['id']:null;logger['info'](util['format'](_0xfa98('0x2b'),_0x5cd8e5,_0x3af939[_0xfa98('0x2c')]));emitChannelQueueInteraction(_0x4b80ab['channel'],_0x3af939[_0xfa98('0x2c')],_0x113522,_0x4b80ab[_0xfa98('0xc')][_0xfa98('0x2c')],_0x4b80ab[_0xfa98('0x28')]['id'],!![],_0x4a0239,_0x3af939['id']);if(rpc[_0x4b80ab['channel']+_0xfa98('0x2d')]){return rpc[_0x4b80ab['channel']+_0xfa98('0x2d')][_0xfa98('0x2e')](_0x113522)[_0xfa98('0x2f')](function(_0x291d53){logger[_0xfa98('0x30')]('create\x20queue\x20report');});}}}function stopRouting(_0x2127f2,_0x4f19b6,_0x36dcaf,_0x24f567){if(_0x2127f2&&_0x4f19b6){_0x4f19b6[_0xfa98('0x1d')]-=0x1;var _0x53887a={'leaveAt':moment()[_0xfa98('0x10')](_0xfa98('0x20')),'acceptAt':moment()[_0xfa98('0x10')](_0xfa98('0x20')),'reason':'accepted'};logger[_0xfa98('0x31')](util[_0xfa98('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x2127f2,_0x4f19b6[_0xfa98('0x2c')]));emitChannelQueueInteraction(_0x36dcaf[_0xfa98('0x24')],_0x4f19b6[_0xfa98('0x2c')],_0x36dcaf[_0xfa98('0x1e')],_0x36dcaf['account']['name'],_0x36dcaf[_0xfa98('0x28')]['id'],![],_0x24f567,_0x4f19b6['id']);if(rpc[_0x36dcaf[_0xfa98('0x24')]+_0xfa98('0x2d')]){return rpc[_0x36dcaf['channel']+_0xfa98('0x2d')][_0xfa98('0x32')](_0x2127f2,_0x53887a)[_0xfa98('0x2f')](function(_0x5f44b4){logger[_0xfa98('0x30')](_0xfa98('0x33'));});}}}function endRouting(_0x4cac6b,_0x284e48,_0x2c1e0d,_0x60c195){if(_0x4cac6b&&_0x284e48){_0x284e48[_0xfa98('0x1d')]-=0x1;var _0x4ddd8c={'leaveAt':moment()[_0xfa98('0x10')](_0xfa98('0x20')),'exitAt':moment()[_0xfa98('0x10')](_0xfa98('0x20')),'reason':_0xfa98('0x34')};logger[_0xfa98('0x31')](util[_0xfa98('0x10')](_0xfa98('0x35'),_0x4cac6b,_0x284e48[_0xfa98('0x2c')]));emitChannelQueueInteraction(_0x2c1e0d[_0xfa98('0x24')],_0x284e48[_0xfa98('0x2c')],_0x2c1e0d[_0xfa98('0x1e')],_0x2c1e0d[_0xfa98('0xc')][_0xfa98('0x2c')],_0x2c1e0d[_0xfa98('0x28')]['id'],![],_0x60c195);if(rpc[_0x2c1e0d['channel']+'QueueReport']){return rpc[_0x2c1e0d[_0xfa98('0x24')]+_0xfa98('0x2d')][_0xfa98('0x32')](_0x4cac6b,_0x4ddd8c)[_0xfa98('0x2f')](function(_0x5d77b4){logger[_0xfa98('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x3cd133){return function(_0x4096b7){return _0x4096b7[_0xfa98('0x2c')][_0xfa98('0x36')]()===_0x3cd133[_0xfa98('0x36')]();};}exports[_0xfa98('0x37')]=function(_0x169579,_0x417e2f,_0x5f3cd9,_0x3571a5){return function(_0x212521){try{var _0x1cb778={'name':_0x417e2f[0x0],'timeout':_0x417e2f[0x1]};var _0xc5413e=queue['validate'](_0x1cb778,{'typecast':!![]});if(_0xc5413e[_0xfa98('0x38')]){logger[_0xfa98('0x30')]('[%s][QUEUE]\x20%s',_0x169579,_[_0xfa98('0x39')](_0xc5413e,_0xfa98('0x28'))[_0xfa98('0x3a')](',\x20'));_0x212521[_0xfa98('0x3b')]();}else{var _0x36ee58=_[_0xfa98('0x3c')](_0x5f3cd9[_0x3571a5[_0xfa98('0x24')]+_0xfa98('0x3d')],handleFindQueue(_0x1cb778[_0xfa98('0x2c')]));if(_0x36ee58){startRouting(_0x169579,_0x36ee58,_0x3571a5,_0x5f3cd9);var _0x2ba55a=(_0x36ee58[_0xfa98('0x34')]||0xa)*0x3e8;var _0x1de3aa=(_0x1cb778[_0xfa98('0x34')]||0x14)*0x3e8;var _0xfbc166,_0x1e9009;if(_0x2ba55a>_0x1de3aa){_0x1de3aa=_0x2ba55a;}var _0x22358c=seqqueue[_0xfa98('0x3e')](_0x2ba55a);_0x22358c['id']=_0x169579;_0x22358c[_0xfa98('0x3f')]=_0x2ba55a;_0x22358c[_0xfa98('0x40')]=_0x1de3aa;_0x22358c[_0xfa98('0x24')]=_0x3571a5[_0xfa98('0x24')];_0x5f3cd9['rules'][_0x169579]['on'](_0xfa98('0x41'),function(){stopRouting(_0x169579,_0x36ee58,_0x3571a5,_0x5f3cd9);_0x22358c[_0xfa98('0x42')](!![]);clearTimeout(_0xfbc166);_0xfbc166=undefined;if(_0x5f3cd9[_0xfa98('0x43')][_0x169579]){delete _0x5f3cd9['rules'][_0x169579];}logger[_0xfa98('0x31')](_0xfa98('0x44'),_0x169579);_0x212521['stop']();});_0xfbc166=setTimeout(function(){endRouting(_0x169579,_0x36ee58,_0x3571a5,_0x5f3cd9);clearTimeout(_0xfbc166);_0x22358c['close'](!![]);logger[_0xfa98('0x31')](_0xfa98('0x45'),_0x169579);_0x212521[_0xfa98('0x46')]();},_0x1de3aa);switch(_0x36ee58['strategy']){case _0xfa98('0x47'):strategy[_0xfa98('0x47')](_0x22358c,_0x36ee58,_0x5f3cd9,_0x3571a5);break;default:strategy[_0xfa98('0x48')](_0x22358c,_0x36ee58,_0x5f3cd9,_0x3571a5);}}else{logger[_0xfa98('0x30')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x169579,_0x1cb778[_0xfa98('0x2c')]);_0x212521[_0xfa98('0x3b')]();}}}catch(_0x495e58){console[_0xfa98('0x49')](_0x495e58);logger[_0xfa98('0x30')](_0xfa98('0x4a'),_0x169579,_0x495e58[_0xfa98('0x4b')]);_0x212521[_0xfa98('0x3b')]();}};}; \ 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 a0e8022..1d56eb9 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 _0x1f4b=['drained','handleDrained','handleTimeout','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','notificationId','realtime','routing','push','handleRun','bind','squeue'];(function(_0x30c6e3,_0x6f1fb0){var _0x1baf11=function(_0x2a6473){while(--_0x2a6473){_0x30c6e3['push'](_0x30c6e3['shift']());}};_0x1baf11(++_0x6f1fb0);}(_0x1f4b,0x1a4));var _0xb1f4=function(_0x5e73de,_0x48194d){_0x5e73de=_0x5e73de-0x0;var _0x1b1f6b=_0x1f4b[_0x5e73de];return _0x1b1f6b;};'use strict';var _=require(_0xb1f4('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0xb1f4('0x1'))('routing');var Agent=function(_0x5d95ab,_0x8e678f,_0x43d438,_0x361f4b){this[_0xb1f4('0x2')]=uuid['v4']();this['squeue']=_0x5d95ab;this['agent']=_0x8e678f;this[_0xb1f4('0x3')]=_0x43d438;this[_0xb1f4('0x4')]=_0x361f4b;this['squeue'][_0xb1f4('0x5')](this[_0xb1f4('0x6')]['bind'](this),this['handleTimeout'][_0xb1f4('0x7')](this));this['squeue']['on']('timeout',this['handleTimeout'][_0xb1f4('0x7')](this));this[_0xb1f4('0x8')]['on'](_0xb1f4('0x9'),this[_0xb1f4('0xa')][_0xb1f4('0x7')](this));};Agent['prototype'][_0xb1f4('0x5')]=function(){this[_0xb1f4('0x8')][_0xb1f4('0x5')](this[_0xb1f4('0x6')]['bind'](this),this[_0xb1f4('0xb')][_0xb1f4('0x7')](this));};Agent[_0xb1f4('0xc')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent[_0xb1f4('0xc')]['handleRun']=function(_0x3a71f7){logger[_0xb1f4('0xd')](_0xb1f4('0xe'),this['squeue']['id'],this['agent']['id']);if(_[_0xb1f4('0xf')](this[_0xb1f4('0x3')][_0xb1f4('0x10')][this[_0xb1f4('0x11')]['id']])){logger['info'](_0xb1f4('0x12'),this['squeue']['id'],this[_0xb1f4('0x11')]['id']);setTimeout(this[_0xb1f4('0x5')][_0xb1f4('0x7')](this),0x3e8);}else{if(this[_0xb1f4('0x4')][_0xb1f4('0x13')]||util[_0xb1f4('0x14')](this[_0xb1f4('0x8')]['id'],this['realtime'][_0xb1f4('0x10')][this[_0xb1f4('0x11')]['id']],this['squeue'][_0xb1f4('0x15')],![])){this[_0xb1f4('0x3')][_0xb1f4('0x10')][this[_0xb1f4('0x11')]['id']][_0xb1f4('0x16')]=!![];this[_0xb1f4('0x3')][_0xb1f4('0x10')][this[_0xb1f4('0x11')]['id']][_0xb1f4('0x17')]=undefined;util[_0xb1f4('0x18')](this[_0xb1f4('0x2')],this[_0xb1f4('0x8')]['id'],this[_0xb1f4('0x3')][_0xb1f4('0x10')][this['agent']['id']],null,this[_0xb1f4('0x4')]);util[_0xb1f4('0x19')](this[_0xb1f4('0x8')]['id'],this[_0xb1f4('0x3')][_0xb1f4('0x10')][this[_0xb1f4('0x11')]['id']],_0xb1f4('0x1a')+(this[_0xb1f4('0x4')][_0xb1f4('0x13')]?_0xb1f4('0x1b'):''));}else{logger[_0xb1f4('0xd')](_0xb1f4('0x1c'),this[_0xb1f4('0x8')]['id'],this['agent']['id']);setTimeout(this['push'][_0xb1f4('0x7')](this),0x3e8);}}};Agent[_0xb1f4('0xc')][_0xb1f4('0xb')]=function(_0x383ac1){if(_[_0xb1f4('0xf')](this[_0xb1f4('0x3')][_0xb1f4('0x10')][this[_0xb1f4('0x11')]['id']])){return logger[_0xb1f4('0xd')](_0xb1f4('0x12'),this[_0xb1f4('0x8')]['id'],this[_0xb1f4('0x11')]['id']);}else{logger[_0xb1f4('0xd')](_0xb1f4('0x1d'),this[_0xb1f4('0x8')]['id'],this[_0xb1f4('0x11')]['id']);util['hideNotification'](this[_0xb1f4('0x2')],this[_0xb1f4('0x8')]['id'],this['realtime'][_0xb1f4('0x10')][this[_0xb1f4('0x11')]['id']],null,this['routing']);this[_0xb1f4('0x3')][_0xb1f4('0x10')][this['agent']['id']][_0xb1f4('0x16')]=![];this['realtime']['agents'][this['agent']['id']]['busyQueue']=undefined;util[_0xb1f4('0x19')](this['squeue']['id'],this[_0xb1f4('0x3')][_0xb1f4('0x10')][this[_0xb1f4('0x11')]['id']],_0x383ac1?_0xb1f4('0x1e'):_0xb1f4('0x1f'));}if(!_0x383ac1){setTimeout(this[_0xb1f4('0x5')][_0xb1f4('0x7')](this),0x3e8);}};function agent(_0x19a030,_0x42f610,_0x119660,_0x2bcddc){return new Agent(_0x19a030,_0x42f610,_0x119660,_0x2bcddc);}module[_0xb1f4('0x20')]=agent; \ No newline at end of file +var _0x45c9=['exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push','handleRun','bind','timeout','handleDrained','prototype','handleTimeout','info','[%s][AGENT]\x20try\x20with\x20%s','agents','forcedOwnership','isAgentAvailable','channel','busyQueue','showNotification','writeLog',':FORCED','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT'];(function(_0x52f242,_0x109fb0){var _0x2a4e35=function(_0x25844b){while(--_0x25844b){_0x52f242['push'](_0x52f242['shift']());}};_0x2a4e35(++_0x109fb0);}(_0x45c9,0xc1));var _0x945c=function(_0x2f512a,_0x3e37e3){_0x2f512a=_0x2f512a-0x0;var _0x45a310=_0x45c9[_0x2f512a];return _0x45a310;};'use strict';var _=require(_0x945c('0x0'));var uuid=require(_0x945c('0x1'));var util=require(_0x945c('0x2'));var logger=require(_0x945c('0x3'))(_0x945c('0x4'));var Agent=function(_0x524d04,_0x2e63d3,_0x148cee,_0xa7f757){this[_0x945c('0x5')]=uuid['v4']();this['squeue']=_0x524d04;this[_0x945c('0x6')]=_0x2e63d3;this[_0x945c('0x7')]=_0x148cee;this[_0x945c('0x4')]=_0xa7f757;this[_0x945c('0x8')][_0x945c('0x9')](this[_0x945c('0xa')][_0x945c('0xb')](this),this['handleTimeout'][_0x945c('0xb')](this));this[_0x945c('0x8')]['on'](_0x945c('0xc'),this['handleTimeout'][_0x945c('0xb')](this));this[_0x945c('0x8')]['on']('drained',this[_0x945c('0xd')]['bind'](this));};Agent[_0x945c('0xe')][_0x945c('0x9')]=function(){this[_0x945c('0x8')][_0x945c('0x9')](this[_0x945c('0xa')][_0x945c('0xb')](this),this['handleTimeout'][_0x945c('0xb')](this));};Agent[_0x945c('0xe')][_0x945c('0xd')]=function(){this[_0x945c('0xf')](!![]);};Agent[_0x945c('0xe')][_0x945c('0xa')]=function(_0x9ffb2c){logger[_0x945c('0x10')](_0x945c('0x11'),this[_0x945c('0x8')]['id'],this[_0x945c('0x6')]['id']);if(_['isNil'](this[_0x945c('0x7')][_0x945c('0x12')][this[_0x945c('0x6')]['id']])){logger[_0x945c('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x945c('0x8')]['id'],this['agent']['id']);setTimeout(this['push'][_0x945c('0xb')](this),0x3e8);}else{if(this[_0x945c('0x4')][_0x945c('0x13')]||util[_0x945c('0x14')](this[_0x945c('0x8')]['id'],this['realtime']['agents'][this[_0x945c('0x6')]['id']],this[_0x945c('0x8')][_0x945c('0x15')],![])){this[_0x945c('0x7')][_0x945c('0x12')][this[_0x945c('0x6')]['id']]['busy']=!![];this[_0x945c('0x7')][_0x945c('0x12')][this[_0x945c('0x6')]['id']][_0x945c('0x16')]=undefined;util[_0x945c('0x17')](this['notificationId'],this[_0x945c('0x8')]['id'],this[_0x945c('0x7')][_0x945c('0x12')][this[_0x945c('0x6')]['id']],null,this[_0x945c('0x4')]);util[_0x945c('0x18')](this['squeue']['id'],this[_0x945c('0x7')][_0x945c('0x12')][this[_0x945c('0x6')]['id']],'RINGING'+(this['routing'][_0x945c('0x13')]?_0x945c('0x19'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0x945c('0xb')](this),0x3e8);}}};Agent['prototype'][_0x945c('0xf')]=function(_0x17b68a){if(_[_0x945c('0x1a')](this[_0x945c('0x7')][_0x945c('0x12')][this[_0x945c('0x6')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x945c('0x8')]['id'],this['agent']['id']);}else{logger[_0x945c('0x10')](_0x945c('0x1b'),this[_0x945c('0x8')]['id'],this['agent']['id']);util[_0x945c('0x1c')](this[_0x945c('0x5')],this[_0x945c('0x8')]['id'],this['realtime'][_0x945c('0x12')][this[_0x945c('0x6')]['id']],null,this[_0x945c('0x4')]);this[_0x945c('0x7')][_0x945c('0x12')][this['agent']['id']]['busy']=![];this['realtime'][_0x945c('0x12')][this['agent']['id']][_0x945c('0x16')]=undefined;util[_0x945c('0x18')](this[_0x945c('0x8')]['id'],this[_0x945c('0x7')]['agents'][this[_0x945c('0x6')]['id']],_0x17b68a?_0x945c('0x1d'):_0x945c('0x1e'));}if(!_0x17b68a){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x467644,_0x19069f,_0xf64b93,_0x574103){return new Agent(_0x467644,_0x19069f,_0xf64b93,_0x574103);}module[_0x945c('0x1f')]=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 a22a57f..3b9db3d 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 _0x85e3=['channel','writeLog','RINGING','busy','name','showNotification','push','[%s][QUEUE]\x20EMPTY','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','busyQueue','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','agents','info','isAgentAvailable'];(function(_0x3496bb,_0x53ab1b){var _0x41aa58=function(_0x30c83c){while(--_0x30c83c){_0x3496bb['push'](_0x3496bb['shift']());}};_0x41aa58(++_0x53ab1b);}(_0x85e3,0x162));var _0x385e=function(_0x4521b3,_0x33bef4){_0x4521b3=_0x4521b3-0x0;var _0x11fbb0=_0x85e3[_0x4521b3];return _0x11fbb0;};'use strict';var _=require(_0x385e('0x0'));var uuid=require(_0x385e('0x1'));var util=require('./util');var logger=require(_0x385e('0x2'))(_0x385e('0x3'));var Beepall=function(_0x2683cd,_0x3e2773,_0x1fc511,_0x2e26e0){this[_0x385e('0x4')]=uuid['v4']();this[_0x385e('0x5')]=_0x2683cd;this[_0x385e('0x6')]=_0x3e2773;this[_0x385e('0x7')]=_0x1fc511;this['routing']=_0x2e26e0;this['squeue']['push'](this[_0x385e('0x8')][_0x385e('0x9')](this),this[_0x385e('0xa')][_0x385e('0x9')](this));this['squeue']['on'](_0x385e('0xb'),this[_0x385e('0xa')]['bind'](this));this['squeue']['on'](_0x385e('0xc'),this[_0x385e('0xd')]['bind'](this));};Beepall['prototype']['push']=function(){this[_0x385e('0x5')]['push'](this[_0x385e('0x8')][_0x385e('0x9')](this),this[_0x385e('0xa')][_0x385e('0x9')](this));};Beepall[_0x385e('0xe')]['handleDrained']=function(_0x381b8a){this[_0x385e('0xa')](!![]);};Beepall['prototype'][_0x385e('0x8')]=function(_0x530521){var _0x5b045e=!![];if(!_[_0x385e('0xf')](this['queue'])&&!_[_0x385e('0xf')](this['queue']['Agents'])&&this[_0x385e('0x6')][_0x385e('0x10')]['length']>0x0){for(var _0x455080=0x0,_0x25c1a9;_0x4550800x0){for(var _0x34dbe0=0x0,_0x4e922c;_0x34dbe00x0&&_0x36ea6f[_0x197c93+'CurrentCapacity']>=_0x36ea6f[_0x197c93+_0x3995('0x23')]){writeLog(_0x1d38a6,_0x36ea6f,_0x197c93[_0x3995('0x26')]()+_0x3995('0x27'));return![];}}return!![];};exports[_0x3995('0x28')]=function(_0xbf90f0,_0x1bbfd7,_0x2a6461,_0x2f6e82,_0x210731){return sendNotification(!![],_0xbf90f0,_0x1bbfd7,_0x2a6461,_0x2f6e82,_0x210731);};exports[_0x3995('0x29')]=function(_0x436825,_0x5270ed,_0x578054,_0x2eb1fa,_0x1439a8){return sendNotification(![],_0x436825,_0x5270ed,_0x578054,_0x2eb1fa,_0x1439a8);};exports[_0x3995('0x2a')]=writeLog; \ No newline at end of file +var _0x6f3e=['Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','isAgentAvailable','busy','Pause'];(function(_0x411289,_0x36dbc8){var _0x5e72ec=function(_0x4d415b){while(--_0x4d415b){_0x411289['push'](_0x411289['shift']());}};_0x5e72ec(++_0x36dbc8);}(_0x6f3e,0xf7));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe6f3('0x0'));var util=require(_0xe6f3('0x1'));var utils=require('../utils');var Mustache=require(_0xe6f3('0x2'));var Redis=require(_0xe6f3('0x3'));var config=require(_0xe6f3('0x4'));var logger=require(_0xe6f3('0x5'))(_0xe6f3('0x6'));config['redis']=_[_0xe6f3('0x7')](config[_0xe6f3('0x8')],{'host':_0xe6f3('0x9'),'port':0x18eb});var io=require(_0xe6f3('0xa'))(new Redis(config[_0xe6f3('0x8')]));function emit(_0x222150,_0x140381,_0x5e90e3){io['to'](_0x222150)[_0xe6f3('0xb')](_0x140381,_0x5e90e3);}function sendNotification(_0x5cf5ca,_0x55fcfb,_0x19217f,_0x494aae,_0x38d68a,_0x49df6e){io['to'](util[_0xe6f3('0xc')](_0xe6f3('0xd'),_0x494aae[_0xe6f3('0xe')]))[_0xe6f3('0xb')](_0xe6f3('0xf'),_0x494aae);var _0x18be19=_0x49df6e||{};var _0x3b7baa=_0x19217f[_0xe6f3('0x10')]('.');var _0x546566={'uniqueid':_0x55fcfb,'channel':_0x3b7baa[0x0],'id':_0x3b7baa[0x1],'title':_0x3b7baa[0x0]+_0xe6f3('0x11'),'interactionId':_0x3b7baa[0x2],'queue':_0x38d68a?_0x38d68a[_0xe6f3('0xe')]:null,'sound':_0x18be19[_0xe6f3('0x12')]['notificationSound'],'shake':_0x18be19[_0xe6f3('0x12')][_0xe6f3('0x13')]};try{if(!_0x18be19['body']){_0x18be19[_0xe6f3('0x14')]={};}if(_0x38d68a){_0x18be19[_0xe6f3('0x14')][_0xe6f3('0x15')]=_0x38d68a;}else if(_0x18be19[_0xe6f3('0x14')][_0xe6f3('0x15')]){delete _0x18be19['body'][_0xe6f3('0x15')];}_0x546566[_0xe6f3('0x16')]=utils[_0xe6f3('0x17')](_0x18be19[_0xe6f3('0x12')]['notificationTemplate'],_0x18be19);}catch(_0x5f3847){_0x546566[_0xe6f3('0x16')]=_0xe6f3('0x18');logger[_0xe6f3('0x19')](util[_0xe6f3('0xc')](_0xe6f3('0x1a'),_0x55fcfb,_0x5f3847[_0xe6f3('0x1b')]));}io['to'](util[_0xe6f3('0xc')]('user:%s',_0x494aae['name']))[_0xe6f3('0xb')](util[_0xe6f3('0xc')](_0xe6f3('0x1c'),_0x5cf5ca?_0xe6f3('0x1d'):'remove'),_0x546566);}function writeLog(_0x37fb3f,_0x3e4637,_0x3f814d){return logger['info'](util[_0xe6f3('0xc')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x37fb3f,_0x3e4637['name'],_0x3f814d));}exports[_0xe6f3('0x1e')]=function(_0x22fe08,_0xfe741,_0x287063,_0x29c7c2){if(_0xfe741[_0xe6f3('0x1f')]){writeLog(_0x22fe08,_0xfe741,'BUSY');return![];}if(!_0xfe741['online']){writeLog(_0x22fe08,_0xfe741,'OFFLINE');return![];}if(_0xfe741[_0x287063+_0xe6f3('0x20')]){writeLog(_0x22fe08,_0xfe741,'PAUSE');return![];}if(_0x29c7c2&&_0xfe741['hasOwnProperty'](_0x287063+_0xe6f3('0x21'))&&_0xfe741[_0xe6f3('0x22')](_0x287063+'CurrentCapacity')){if(_0xfe741[_0x287063+_0xe6f3('0x21')]>0x0&&_0xfe741[_0x287063+_0xe6f3('0x23')]>=_0xfe741[_0x287063+_0xe6f3('0x21')]){writeLog(_0x22fe08,_0xfe741,_0x287063[_0xe6f3('0x24')]()+_0xe6f3('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x42fe1f,_0x11732b,_0x4560ee,_0x54b7ec,_0x1b0c86){return sendNotification(!![],_0x42fe1f,_0x11732b,_0x4560ee,_0x54b7ec,_0x1b0c86);};exports[_0xe6f3('0x26')]=function(_0x2bb253,_0x33bbff,_0xe64cd9,_0x50dbac,_0x48afbc){return sendNotification(![],_0x2bb253,_0x33bbff,_0xe64cd9,_0x50dbac,_0x48afbc);};exports[_0xe6f3('0x27')]=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 9fef975..b1c2bc2 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 _0xfb68=['stringify','validate','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject'];(function(_0x2949f4,_0x130f2e){var _0x322b7f=function(_0x1664a0){while(--_0x1664a0){_0x2949f4['push'](_0x2949f4['shift']());}};_0x322b7f(++_0x130f2e);}(_0xfb68,0x1e1));var _0x8fb6=function(_0x1eade0,_0x332df3){_0x1eade0=_0x1eade0-0x0;var _0x4121d6=_0xfb68[_0x1eade0];return _0x4121d6;};'use strict';var schema=require(_0x8fb6('0x0'));var sh=require('shelljs');var _=require(_0x8fb6('0x1'));var utils=require('./utils');var logger=require(_0x8fb6('0x2'))(_0x8fb6('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x8fb6('0x4')}});exports[_0x8fb6('0x5')]=function(_0xba32c2,_0x33b1b2){return function(_0x3988c5){try{var _0x355cdf={'command':_0x33b1b2[0x0]};var _0x4ba462=system[_0x8fb6('0x0')](_0x355cdf,{'typecast':!![]});if(_0x4ba462[_0x8fb6('0x6')]){logger[_0x8fb6('0x7')]('[%s][SYSTEM]\x20%s',_0xba32c2,_[_0x8fb6('0x8')](_0x4ba462,'message')[_0x8fb6('0x9')](',\x20'));logger[_0x8fb6('0xa')](_0x8fb6('0xb'),_0xba32c2);_0x3988c5[_0x8fb6('0xc')]();}else{var _0x22ca17=this;var _0x2c977b=utils['getMustacheRender'](_0x33b1b2[0x0],this);logger[_0x8fb6('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0xba32c2,_0x2c977b);sh[_0x8fb6('0xd')](_[_0x8fb6('0xe')](_0x2c977b),function(_0x2bfd2e,_0x4f9f06){logger[_0x8fb6('0xa')](_0x8fb6('0xf'),_0xba32c2,_0x2bfd2e);if(_0x2bfd2e==0x0){var _0x17b7ca=_0x4f9f06[_0x8fb6('0x10')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x33b1b2[0x1])||_[_0x8fb6('0x11')](_0x33b1b2[0x1])){logger['info'](_0x8fb6('0x12'),_0xba32c2);_0x22ca17[_0x8fb6('0x13')][_0x33b1b2[0x1]]=_0x17b7ca;}else{logger[_0x8fb6('0xa')](_0x8fb6('0x14'),_0xba32c2,_0x33b1b2[0x1],_0x17b7ca);_0x22ca17[_0x8fb6('0x13')][_0x33b1b2[0x1]]=_0x17b7ca;}}_0x3988c5[_0x8fb6('0xc')]();});}}catch(_0xc121c9){logger['error'](_0x8fb6('0x15'),_0xba32c2,_[_0x8fb6('0x16')](_0xc121c9)?JSON[_0x8fb6('0x17')](_0xc121c9):_0xc121c9);logger[_0x8fb6('0xa')](_0x8fb6('0xb'),_0xba32c2);_0x3988c5[_0x8fb6('0xc')]();}};}; \ No newline at end of file +var _0xe0d7=['shelljs','lodash','./utils','../../../../config/logger','string','consequence','validate','length','error','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify'];(function(_0xc39044,_0x337bc9){var _0x57e6bc=function(_0x3862b8){while(--_0x3862b8){_0xc39044['push'](_0xc39044['shift']());}};_0x57e6bc(++_0x337bc9);}(_0xe0d7,0x160));var _0x7e0d=function(_0x4eb884,_0x43db0a){_0x4eb884=_0x4eb884-0x0;var _0x326048=_0xe0d7[_0x4eb884];return _0x326048;};'use strict';var schema=require('validate');var sh=require(_0x7e0d('0x0'));var _=require(_0x7e0d('0x1'));var utils=require(_0x7e0d('0x2'));var logger=require(_0x7e0d('0x3'))('routing');var system=schema({'command':{'type':_0x7e0d('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x7e0d('0x5')]=function(_0x44ada5,_0x54c02b){return function(_0x39d7d0){try{var _0x178763={'command':_0x54c02b[0x0]};var _0x116710=system[_0x7e0d('0x6')](_0x178763,{'typecast':!![]});if(_0x116710[_0x7e0d('0x7')]){logger[_0x7e0d('0x8')]('[%s][SYSTEM]\x20%s',_0x44ada5,_[_0x7e0d('0x9')](_0x116710,'message')[_0x7e0d('0xa')](',\x20'));logger[_0x7e0d('0xb')](_0x7e0d('0xc'),_0x44ada5);_0x39d7d0[_0x7e0d('0xd')]();}else{var _0x20f3c9=this;var _0x180f05=utils[_0x7e0d('0xe')](_0x54c02b[0x0],this);logger['info'](_0x7e0d('0xf'),_0x44ada5,_0x180f05);sh['exec'](_[_0x7e0d('0x10')](_0x180f05),function(_0x5adee0,_0x70c970){logger[_0x7e0d('0xb')](_0x7e0d('0x11'),_0x44ada5,_0x5adee0);if(_0x5adee0==0x0){var _0x413006=_0x70c970['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x54c02b[0x1])||_['isEmpty'](_0x54c02b[0x1])){logger[_0x7e0d('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x44ada5);_0x20f3c9[_0x7e0d('0x12')][_0x54c02b[0x1]]=_0x413006;}else{logger[_0x7e0d('0xb')](_0x7e0d('0x13'),_0x44ada5,_0x54c02b[0x1],_0x413006);_0x20f3c9[_0x7e0d('0x12')][_0x54c02b[0x1]]=_0x413006;}}_0x39d7d0[_0x7e0d('0xd')]();});}}catch(_0x75664b){logger[_0x7e0d('0x8')]('[%s][SYSTEM]\x20%s',_0x44ada5,_[_0x7e0d('0x14')](_0x75664b)?JSON[_0x7e0d('0x15')](_0x75664b):_0x75664b);logger['info'](_0x7e0d('0xc'),_0x44ada5);_0x39d7d0[_0x7e0d('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 2c98365..e0d6ecf 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(_0x267b78,_0x5966ad){var _0x145f94=function(_0x450e33){while(--_0x450e33){_0x267b78['push'](_0x267b78['shift']());}};_0x145f94(++_0x5966ad);}(_0x7a54,0x106));var _0x47a5=function(_0x4be8e1,_0x551a98){_0x4be8e1=_0x4be8e1-0x0;var _0x2fafe6=_0x7a54[_0x4be8e1];return _0x2fafe6;};'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 _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(_0x5a812e,_0x164a01){var _0x3f2d39=function(_0x1ad5ea){while(--_0x1ad5ea){_0x5a812e['push'](_0x5a812e['shift']());}};_0x3f2d39(++_0x164a01);}(_0x7a54,0x106));var _0x47a5=function(_0x53f480,_0x17cfb4){_0x53f480=_0x53f480-0x0;var _0x27ee52=_0x7a54[_0x53f480];return _0x27ee52;};'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 diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index ed0fe84..ceb5c87 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 _0xa75b=['render','merge','body','contact','message','account','interaction','list','mustache'];(function(_0xbb9f33,_0x5c2052){var _0x53b937=function(_0x3bb891){while(--_0x3bb891){_0xbb9f33['push'](_0xbb9f33['shift']());}};_0x53b937(++_0x5c2052);}(_0xa75b,0x170));var _0xba75=function(_0x5a6f82,_0x1cbf86){_0x5a6f82=_0x5a6f82-0x0;var _0x2b8caf=_0xa75b[_0x5a6f82];return _0x2b8caf;};'use strict';var Mustache=require(_0xba75('0x0'));var _=require('lodash');module['exports']={'getMustacheRender':function(_0x10c0dd,_0x39dc19){return Mustache[_0xba75('0x1')](_0x10c0dd,_[_0xba75('0x2')](_0x39dc19[_0xba75('0x3')],{'contact':_0x39dc19[_0xba75('0x4')],'message':_0x39dc19[_0xba75('0x5')],'account':_0x39dc19[_0xba75('0x6')],'interaction':_0x39dc19[_0xba75('0x7')],'list':_0x39dc19[_0xba75('0x8')]}))||'';}}; \ No newline at end of file +var _0x09dd=['render','merge','body','contact','message','account','interaction','list','mustache','lodash','exports'];(function(_0x122b4f,_0x4ae43b){var _0x262234=function(_0x3c7b7f){while(--_0x3c7b7f){_0x122b4f['push'](_0x122b4f['shift']());}};_0x262234(++_0x4ae43b);}(_0x09dd,0x81));var _0xd09d=function(_0x46460e,_0x4a6c5e){_0x46460e=_0x46460e-0x0;var _0x4c36a3=_0x09dd[_0x46460e];return _0x4c36a3;};'use strict';var Mustache=require(_0xd09d('0x0'));var _=require(_0xd09d('0x1'));module[_0xd09d('0x2')]={'getMustacheRender':function(_0x5ec680,_0x45dad5){return Mustache[_0xd09d('0x3')](_0x5ec680,_[_0xd09d('0x4')](_0x45dad5[_0xd09d('0x5')],{'contact':_0x45dad5[_0xd09d('0x6')],'message':_0x45dad5[_0xd09d('0x7')],'account':_0x45dad5[_0xd09d('0x8')],'interaction':_0x45dad5[_0xd09d('0x9')],'list':_0x45dad5[_0xd09d('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 6ce487e..ead89cc 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 _0x6d6d=['execute','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','waiting','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','channel','message','interaction','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','push','slice','amazonlex','split','tag','TagId','%s:%s:%s','condition','intervals','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules'];(function(_0x4eb5f8,_0x578fe0){var _0x3e23d8=function(_0x469c77){while(--_0x469c77){_0x4eb5f8['push'](_0x4eb5f8['shift']());}};_0x3e23d8(++_0x578fe0);}(_0x6d6d,0x132));var _0xd6d6=function(_0x2fb192,_0x3e291e){_0x2fb192=_0x2fb192-0x0;var _0x248b70=_0x6d6d[_0x2fb192];return _0x248b70;};'use strict';var _=require('lodash');var util=require(_0xd6d6('0x0'));var path=require(_0xd6d6('0x1'));var fs=require('fs');var jayson=require(_0xd6d6('0x2'));var BPromise=require(_0xd6d6('0x3'));var uuid=require(_0xd6d6('0x4'));var config=require(_0xd6d6('0x5'));var logger=require('../../../config/logger')(_0xd6d6('0x6'));var rpc={'openchannelQueueReport':require(_0xd6d6('0x7'))};var rpc={'openchannelQueueReport':require(_0xd6d6('0x7')),'mailQueueReport':require(_0xd6d6('0x8')),'chatQueueReport':require(_0xd6d6('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xd6d6('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x7c798f,_0xb851c7,_0x3870cc){return util[_0xd6d6('0xb')](_0xd6d6('0xc'),_0x7c798f,_0xb851c7||0x0,_0x3870cc||0x0);}function getIntervals(_0x53d983,_0x328823){var _0x302131=[];if(!_[_0xd6d6('0xd')](_0x328823[_0xd6d6('0xe')])&&!_[_0xd6d6('0xd')](_0x53d983[_0x328823[_0xd6d6('0xe')]])&&!_[_0xd6d6('0xd')](_0x53d983[_0x328823[_0xd6d6('0xe')]]['Intervals'])){_0x302131=_[_0xd6d6('0xf')](_0x53d983[_0x328823[_0xd6d6('0xe')]][_0xd6d6('0x10')],'interval');}else if(!_[_0xd6d6('0xd')](_0x328823[_0xd6d6('0x11')])){_0x302131=[_0x328823[_0xd6d6('0x11')]];}return _0x302131;}exports['listen']=function(_0xd472e7){_0xd472e7['rules']={};return new BPromise(function(_0x510c66,_0x5e2416){var _0x856719={'Start':function(_0x4ee48f){var _0x53e20c=this;return new Promise(function(_0x9a41f3,_0x4e4149){if(_0x4ee48f){try{var _0x108e31=[];var _0x27100b=getId(_0x4ee48f[_0xd6d6('0x12')],_0x4ee48f[_0xd6d6('0x13')]?_0x4ee48f['message']['id']:0x0,_0x4ee48f[_0xd6d6('0x14')]?_0x4ee48f[_0xd6d6('0x14')]['id']:0x0);if(_0x4ee48f['applications']&&_['isArray'](_0x4ee48f['applications'])&&_0x4ee48f[_0xd6d6('0x15')]['length']){for(var _0x53bb2a=0x0;_0x53bb2a<_0x4ee48f[_0xd6d6('0x15')][_0xd6d6('0x16')];_0x53bb2a+=0x1){var _0x50000b=_0x4ee48f['applications'][_0x53bb2a];if(fs[_0xd6d6('0x17')](path[_0xd6d6('0x18')](__dirname,'applications',_0x50000b['app']+_0xd6d6('0x19')))){var _0x2b7f04=[];switch(_0x50000b[_0xd6d6('0x1a')][_0xd6d6('0x1b')]()){case _0xd6d6('0x1c'):var _0x505e86=_0x50000b[_0xd6d6('0x1d')]['split'](',');_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[0x0]);_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[_0xd6d6('0x1f')](0x1,_0x505e86[_0xd6d6('0x16')])[_0xd6d6('0x18')](','));break;case'dialogflow':var _0x505e86=_0x50000b[_0xd6d6('0x1d')]['split'](',');_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[0x0]);_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[0x1]);_0x2b7f04[_0xd6d6('0x1e')](_0x505e86['slice'](0x2,_0x505e86['length'])[_0xd6d6('0x18')](','));break;case _0xd6d6('0x20'):var _0x505e86=_0x50000b[_0xd6d6('0x1d')][_0xd6d6('0x21')](',');_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[0x0]);_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[0x1]);_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[0x2]);_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[0x3]);_0x2b7f04[_0xd6d6('0x1e')](_0x505e86[_0xd6d6('0x1f')](0x4,_0x505e86[_0xd6d6('0x16')])[_0xd6d6('0x18')](','));break;case'message':_0x2b7f04[_0xd6d6('0x1e')](_0x50000b[_0xd6d6('0x1d')]);break;case _0xd6d6('0x22'):_0x2b7f04['push'](_0x50000b[_0xd6d6('0x23')]);_0x2b7f04[_0xd6d6('0x1e')](_0x50000b[_0xd6d6('0x1d')]);break;default:_0x2b7f04=_['isNil'](_0x50000b['appdata'])?[]:_0x50000b[_0xd6d6('0x1d')]['split'](',');}var _0x3aa829={'id':util[_0xd6d6('0xb')](_0xd6d6('0x24'),_0x27100b,_0x50000b['id'],_0x50000b['app']),'condition':require('./interval')[_0xd6d6('0x25')](_0x27100b,getIntervals(_0xd472e7[_0xd6d6('0x26')],_0x50000b),_0xd472e7),'consequence':require('./applications/'+_0x50000b[_0xd6d6('0x1a')])['consequence'](_0x27100b,_0x2b7f04,_0xd472e7,_0x4ee48f),'p':_0x50000b[_0xd6d6('0x27')]||0x0};logger[_0xd6d6('0x28')](_0xd6d6('0x29'),_0x3aa829['id'],'on\x20interval',getIntervals(_0xd472e7[_0xd6d6('0x26')],_0x50000b)[_0xd6d6('0x18')](_0xd6d6('0x2a')));_0x108e31[_0xd6d6('0x1e')](_0x3aa829);}else{logger[_0xd6d6('0x2b')](_0xd6d6('0x2c'),path[_0xd6d6('0x18')](__dirname,'applications',_0x50000b['app']+'.js'));}}_0xd472e7[_0xd6d6('0x2d')][_0x27100b]=new RuleEngine(_0x108e31);_0xd472e7['rules'][_0x27100b][_0xd6d6('0x2e')](_0x4ee48f,function(_0x7579d){logger[_0xd6d6('0x28')]('Applications\x20executed',JSON[_0xd6d6('0x2f')](_0x7579d[_0xd6d6('0x30')]));if(_0xd472e7['rules'][_0x27100b]){_0xd472e7[_0xd6d6('0x2d')][_0x27100b][_0xd6d6('0x31')](_0xd6d6('0x32'));}});return _0x9a41f3({'code':0xc8,'message':_0x4ee48f});}else{logger['info'](_0xd6d6('0x33'));return _0x9a41f3({'code':0xc8,'message':_0x4ee48f});}}catch(_0xf43857){logger['error'](_0xf43857[_0xd6d6('0x34')]);return _0x4e4149(_0x53e20c[_0xd6d6('0x2b')](0x1f4,_0xf43857));}}return _0x4e4149(_0xd6d6('0x35'));});},'AcceptMessage':function(_0x456f64){var _0xa0df85=this;return new Promise(function(_0x30c5cd,_0x3a73dd){if(_0x456f64[_0xd6d6('0x13')]&&_0x456f64[_0xd6d6('0x13')]['id']){try{var _0x53bc00=getId(_0x456f64[_0xd6d6('0x12')],_0x456f64[_0xd6d6('0x13')]?_0x456f64[_0xd6d6('0x13')]['id']:0x0,_0x456f64['interaction']?_0x456f64[_0xd6d6('0x14')]['id']:0x0);if(_0xd472e7['rules'][_0x53bc00]){_0xd472e7[_0xd6d6('0x2d')][_0x53bc00]['emit'](_0xd6d6('0x32'));if(rpc[_0x456f64[_0xd6d6('0x12')]+_0xd6d6('0x36')]){rpc[_0x456f64[_0xd6d6('0x12')]+'QueueReport'][_0xd6d6('0x37')](_0x53bc00,{'UserId':_0x456f64['message'][_0xd6d6('0x38')]})[_0xd6d6('0x39')](function(_0x24702d){logger[_0xd6d6('0x2b')](_0xd6d6('0x3a'));});}}return _0x30c5cd({'code':0xc8,'message':_0x456f64});}catch(_0x178f99){logger['error'](_0x178f99[_0xd6d6('0x34')]);return _0x3a73dd(_0xa0df85[_0xd6d6('0x2b')](0x1f4,_0x178f99));}}logger[_0xd6d6('0x2b')](_0xd6d6('0x3b'));return _0x3a73dd(_0xa0df85['error'](0x1f4,_0xd6d6('0x3b')));});},'RejectMessage':function(_0x1daae8){var _0xd3b0=this;return new Promise(function(_0x4a40ca,_0x582646){if(_0x1daae8[_0xd6d6('0x3c')]&&_0x1daae8[_0xd6d6('0x3c')]['id']){try{if(_0xd472e7['agents'][_0x1daae8[_0xd6d6('0x3c')]['id']]){_0xd472e7['agents'][_0x1daae8[_0xd6d6('0x3c')]['id']]['busy']=![];_0xd472e7[_0xd6d6('0x3d')][_0x1daae8[_0xd6d6('0x3c')]['id']]['busyQueue']=undefined;}return _0x4a40ca({'code':0xc8,'message':_0x1daae8});}catch(_0x5d0645){logger[_0xd6d6('0x2b')](_0x5d0645['stack']);return _0x582646(_0xd3b0[_0xd6d6('0x2b')](0x1f4,_0x5d0645));}}logger[_0xd6d6('0x2b')](_0xd6d6('0x3b'));return _0x582646(_0xd3b0['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2631b9){var _0x50d420=this;return new Promise(function(_0x19b64f,_0xee07cb){if(_0x2631b9[_0xd6d6('0x12')]&&_0x2631b9[_0xd6d6('0x14')]&&_0x2631b9[_0xd6d6('0x14')]['id']){try{var _0x3d40b5=getId(_0x2631b9['channel'],_0x2631b9[_0xd6d6('0x13')]?_0x2631b9[_0xd6d6('0x13')]['id']:0x0,_0x2631b9[_0xd6d6('0x14')]?_0x2631b9['interaction']['id']:0x0);if(_0xd472e7[_0xd6d6('0x2d')][_0x3d40b5]){_0xd472e7[_0xd6d6('0x2d')][_0x3d40b5][_0xd6d6('0x31')](_0xd6d6('0x32'));}return _0x19b64f({'code':0xc8,'message':_0x2631b9});}catch(_0x473a57){logger['error'](_0x473a57['stack']);return _0xee07cb(_0x50d420[_0xd6d6('0x2b')](0x1f4,_0x473a57));}}logger[_0xd6d6('0x2b')]('message\x20is\x20empty');return _0xee07cb(_0x50d420[_0xd6d6('0x2b')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1096a9){var _0xedae33=this;return new Promise(function(_0x7b4c98,_0x50e17d){if(_0xd472e7[_0xd6d6('0x3d')][_0xd6d6('0x3e')](_0x1096a9['id'])){for(var _0x37abed in _0x1096a9[_0xd6d6('0x3f')]){if(_0x1096a9[_0xd6d6('0x3f')][_0xd6d6('0x3e')](_0x37abed)){if(_0xd472e7[_0xd6d6('0x3d')][_0x1096a9['id']][_0xd6d6('0x3e')](_0x37abed+_0xd6d6('0x40'))){_0xd472e7['agents'][_0x1096a9['id']][_0x37abed+_0xd6d6('0x40')]=parseInt(_0x1096a9['capacity'][_0x37abed],0xa);}}}_0xd472e7[_0xd6d6('0x3d')][_0x1096a9['id']][_0xd6d6('0x41')]();return _0x7b4c98({'code':0xc8,'message':_0xd472e7[_0xd6d6('0x3d')][_0x1096a9['id']]});}else{return _0x50e17d(_0xedae33[_0xd6d6('0x2b')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2ef6c7){return new Promise(function(_0x5a3dcb,_0x3d0f16){var _0xe9d1d7=_[_0xd6d6('0x42')](_0xd472e7[_0xd6d6('0x3d')]);_0x5a3dcb({'count':_0xe9d1d7[_0xd6d6('0x16')],'rows':_0xe9d1d7});});},'ChatQueues':function(_0x21146a){return new Promise(function(_0xcff305,_0x24fa12){var _0x6ec67c=[];for(var _0x5832ef in _0xd472e7[_0xd6d6('0x43')]){if(_0xd472e7['chatQueues']['hasOwnProperty'](_0x5832ef)){var _0x1ec219=_0xd472e7[_0xd6d6('0x43')][_0x5832ef];var _0x261808={'id':_0x1ec219['id'],'available':_0x1ec219[_0xd6d6('0x44')],'loggedIn':_0x1ec219[_0xd6d6('0x45')],'name':_0x1ec219[_0xd6d6('0x46')],'paused':_0x1ec219[_0xd6d6('0x47')],'waiting':_0x1ec219['waiting']};_0x6ec67c[_0xd6d6('0x1e')](_0x261808);}}_0xcff305({'count':_0x6ec67c[_0xd6d6('0x16')],'rows':_0x6ec67c});});},'MailQueues':function(_0x47707e){return new Promise(function(_0x49c2f5,_0x561037){var _0x27be06=[];for(var _0x32a44b in _0xd472e7[_0xd6d6('0x48')]){if(_0xd472e7[_0xd6d6('0x48')][_0xd6d6('0x3e')](_0x32a44b)){var _0x1ec599=_0xd472e7[_0xd6d6('0x48')][_0x32a44b];var _0x1ebbdb={'id':_0x1ec599['id'],'available':_0x1ec599[_0xd6d6('0x44')],'loggedIn':_0x1ec599[_0xd6d6('0x45')],'name':_0x1ec599['name'],'paused':_0x1ec599[_0xd6d6('0x47')],'waiting':_0x1ec599['waiting']};_0x27be06['push'](_0x1ebbdb);}}_0x49c2f5({'count':_0x27be06[_0xd6d6('0x16')],'rows':_0x27be06});});},'OpenchannelQueues':function(_0x20af9a){return new Promise(function(_0x494f82,_0x28fd4b){var _0x363fa9=[];for(var _0x3ff679 in _0xd472e7[_0xd6d6('0x49')]){if(_0xd472e7[_0xd6d6('0x49')]['hasOwnProperty'](_0x3ff679)){var _0x374efe=_0xd472e7[_0xd6d6('0x49')][_0x3ff679];var _0x49c788={'id':_0x374efe['id'],'available':_0x374efe[_0xd6d6('0x44')],'loggedIn':_0x374efe['loggedIn'],'name':_0x374efe['name'],'paused':_0x374efe['paused'],'waiting':_0x374efe[_0xd6d6('0x4a')]};_0x363fa9['push'](_0x49c788);}}_0x494f82({'count':_0x363fa9[_0xd6d6('0x16')],'rows':_0x363fa9});});},'SmsQueues':function(_0x50c55e){return new Promise(function(_0x21a5df,_0x469927){var _0x30a3d2=[];for(var _0x5a0e3b in _0xd472e7[_0xd6d6('0x4b')]){if(_0xd472e7[_0xd6d6('0x4b')][_0xd6d6('0x3e')](_0x5a0e3b)){var _0x53cd39=_0xd472e7[_0xd6d6('0x4b')][_0x5a0e3b];var _0x26c622={'id':_0x53cd39['id'],'available':_0x53cd39['available'],'loggedIn':_0x53cd39[_0xd6d6('0x45')],'name':_0x53cd39[_0xd6d6('0x46')],'paused':_0x53cd39['paused'],'waiting':_0x53cd39[_0xd6d6('0x4a')]};_0x30a3d2[_0xd6d6('0x1e')](_0x26c622);}}_0x21a5df({'count':_0x30a3d2[_0xd6d6('0x16')],'rows':_0x30a3d2});});},'FaxQueues':function(_0x42f10a){return new Promise(function(_0x3c79a4,_0x563a9c){var _0x104102=[];for(var _0x44917a in _0xd472e7[_0xd6d6('0x4c')]){if(_0xd472e7['faxQueues'][_0xd6d6('0x3e')](_0x44917a)){var _0x8391c=_0xd472e7[_0xd6d6('0x4c')][_0x44917a];var _0x4588d3={'id':_0x8391c['id'],'available':_0x8391c['available'],'loggedIn':_0x8391c[_0xd6d6('0x45')],'name':_0x8391c[_0xd6d6('0x46')],'paused':_0x8391c['paused'],'waiting':_0x8391c[_0xd6d6('0x4a')]};_0x104102[_0xd6d6('0x1e')](_0x4588d3);}}_0x3c79a4({'count':_0x104102['length'],'rows':_0x104102});});},'ChatQueuesWaitingInteractions':function(_0x7507fa){return new Promise(function(_0x15a717,_0x1e2569){var _0x5b7322=_[_0xd6d6('0x42')](_0xd472e7[_0xd6d6('0x4d')]);_0x15a717({'count':_0x5b7322[_0xd6d6('0x16')],'rows':_0x5b7322});});},'MailQueuesWaitingInteractions':function(_0x4603a3){return new Promise(function(_0x13a774,_0x4293f5){var _0x2c63f2=_[_0xd6d6('0x42')](_0xd472e7[_0xd6d6('0x4e')]);_0x13a774({'count':_0x2c63f2[_0xd6d6('0x16')],'rows':_0x2c63f2});});},'OpenchannelQueuesWaitingInteractions':function(_0x3b38fe){return new Promise(function(_0x293a85,_0xde5d9f){var _0x113779=_[_0xd6d6('0x42')](_0xd472e7[_0xd6d6('0x4f')]);_0x293a85({'count':_0x113779['length'],'rows':_0x113779});});},'SmsQueuesWaitingInteractions':function(_0x1e50ca){return new Promise(function(_0x5421c2,_0x5bc314){var _0x80e7ee=_['values'](_0xd472e7[_0xd6d6('0x50')]);_0x5421c2({'count':_0x80e7ee['length'],'rows':_0x80e7ee});});},'FaxQueuesWaitingInteractions':function(_0x1505cd){return new Promise(function(_0x4ef267,_0x72da6){var _0x287f9b=_[_0xd6d6('0x42')](_0xd472e7[_0xd6d6('0x51')]);_0x4ef267({'count':_0x287f9b[_0xd6d6('0x16')],'rows':_0x287f9b});});}};var _0x2521f3=jayson[_0xd6d6('0x52')](_0x856719)[_0xd6d6('0x53')]();_0x2521f3['on']('error',function(_0x37edc3){logger[_0xd6d6('0x2b')](JSON[_0xd6d6('0x2f')](_0x37edc3));return _0x5e2416(_0x37edc3);});_0x2521f3[_0xd6d6('0x54')](0x232c,'127.0.0.1',function(){console[_0xd6d6('0x55')](_0xd6d6('0x56'),0x232c);return _0x510c66(_0xd6d6('0x57')+0x232c);});});}; \ No newline at end of file +var _0xefbf=['\x20|\x20','error','rules','Applications\x20executed','stringify','matchPath','end','stack','emit','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','server','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','app','.js','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefbf,0x1d4));var _0xfefb=function(_0x480a07,_0x2147f2){_0x480a07=_0x480a07-0x0;var _0xed5d11=_0xefbf[_0x480a07];return _0xed5d11;};'use strict';var _=require(_0xfefb('0x0'));var util=require(_0xfefb('0x1'));var path=require(_0xfefb('0x2'));var fs=require('fs');var jayson=require(_0xfefb('0x3'));var BPromise=require(_0xfefb('0x4'));var uuid=require(_0xfefb('0x5'));var config=require('../../../config/environment');var logger=require(_0xfefb('0x6'))(_0xfefb('0x7'));var rpc={'openchannelQueueReport':require(_0xfefb('0x8'))};var rpc={'openchannelQueueReport':require(_0xfefb('0x8')),'mailQueueReport':require(_0xfefb('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xfefb('0xa')),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0xfefb('0xb'));function getId(_0x4144e4,_0x146f3b,_0x25adef){return util[_0xfefb('0xc')](_0xfefb('0xd'),_0x4144e4,_0x146f3b||0x0,_0x25adef||0x0);}function getIntervals(_0x4dce6c,_0x589f74){var _0x57ed00=[];if(!_[_0xfefb('0xe')](_0x589f74[_0xfefb('0xf')])&&!_['isNil'](_0x4dce6c[_0x589f74[_0xfefb('0xf')]])&&!_[_0xfefb('0xe')](_0x4dce6c[_0x589f74[_0xfefb('0xf')]][_0xfefb('0x10')])){_0x57ed00=_[_0xfefb('0x11')](_0x4dce6c[_0x589f74[_0xfefb('0xf')]][_0xfefb('0x10')],_0xfefb('0x12'));}else if(!_[_0xfefb('0xe')](_0x589f74[_0xfefb('0x12')])){_0x57ed00=[_0x589f74[_0xfefb('0x12')]];}return _0x57ed00;}exports[_0xfefb('0x13')]=function(_0x3d839b){_0x3d839b['rules']={};return new BPromise(function(_0x14d710,_0x149e7b){var _0x18f866={'Start':function(_0x52d5a6){var _0x3e1b32=this;return new Promise(function(_0xe55736,_0x33c8b7){if(_0x52d5a6){try{var _0x466dd0=[];var _0x114d0d=getId(_0x52d5a6[_0xfefb('0x14')],_0x52d5a6[_0xfefb('0x15')]?_0x52d5a6['message']['id']:0x0,_0x52d5a6[_0xfefb('0x16')]?_0x52d5a6[_0xfefb('0x16')]['id']:0x0);if(_0x52d5a6[_0xfefb('0x17')]&&_[_0xfefb('0x18')](_0x52d5a6[_0xfefb('0x17')])&&_0x52d5a6[_0xfefb('0x17')][_0xfefb('0x19')]){for(var _0x134b6f=0x0;_0x134b6f<_0x52d5a6['applications'][_0xfefb('0x19')];_0x134b6f+=0x1){var _0x5b7d81=_0x52d5a6[_0xfefb('0x17')][_0x134b6f];if(fs['existsSync'](path['join'](__dirname,'applications',_0x5b7d81[_0xfefb('0x1a')]+_0xfefb('0x1b')))){var _0x48e567=[];switch(_0x5b7d81[_0xfefb('0x1a')][_0xfefb('0x1c')]()){case _0xfefb('0x1d'):var _0x1f5a6d=_0x5b7d81[_0xfefb('0x1e')][_0xfefb('0x1f')](',');_0x48e567[_0xfefb('0x20')](_0x1f5a6d[0x0]);_0x48e567[_0xfefb('0x20')](_0x1f5a6d[_0xfefb('0x21')](0x1,_0x1f5a6d[_0xfefb('0x19')])[_0xfefb('0x22')](','));break;case _0xfefb('0x23'):var _0x1f5a6d=_0x5b7d81['appdata'][_0xfefb('0x1f')](',');_0x48e567['push'](_0x1f5a6d[0x0]);_0x48e567[_0xfefb('0x20')](_0x1f5a6d[0x1]);_0x48e567[_0xfefb('0x20')](_0x1f5a6d['slice'](0x2,_0x1f5a6d[_0xfefb('0x19')])[_0xfefb('0x22')](','));break;case _0xfefb('0x24'):var _0x1f5a6d=_0x5b7d81['appdata']['split'](',');_0x48e567['push'](_0x1f5a6d[0x0]);_0x48e567[_0xfefb('0x20')](_0x1f5a6d[0x1]);_0x48e567[_0xfefb('0x20')](_0x1f5a6d[0x2]);_0x48e567[_0xfefb('0x20')](_0x1f5a6d[0x3]);_0x48e567[_0xfefb('0x20')](_0x1f5a6d['slice'](0x4,_0x1f5a6d[_0xfefb('0x19')])[_0xfefb('0x22')](','));break;case _0xfefb('0x15'):_0x48e567[_0xfefb('0x20')](_0x5b7d81[_0xfefb('0x1e')]);break;case _0xfefb('0x25'):_0x48e567['push'](_0x5b7d81[_0xfefb('0x26')]);_0x48e567[_0xfefb('0x20')](_0x5b7d81[_0xfefb('0x1e')]);break;default:_0x48e567=_[_0xfefb('0xe')](_0x5b7d81[_0xfefb('0x1e')])?[]:_0x5b7d81[_0xfefb('0x1e')][_0xfefb('0x1f')](',');}var _0x4c7bef={'id':util[_0xfefb('0xc')](_0xfefb('0x27'),_0x114d0d,_0x5b7d81['id'],_0x5b7d81['app']),'condition':require(_0xfefb('0x28'))[_0xfefb('0x29')](_0x114d0d,getIntervals(_0x3d839b[_0xfefb('0x2a')],_0x5b7d81),_0x3d839b),'consequence':require(_0xfefb('0x2b')+_0x5b7d81[_0xfefb('0x1a')])['consequence'](_0x114d0d,_0x48e567,_0x3d839b,_0x52d5a6),'p':_0x5b7d81[_0xfefb('0x2c')]||0x0};logger[_0xfefb('0x2d')](_0xfefb('0x2e'),_0x4c7bef['id'],_0xfefb('0x2f'),getIntervals(_0x3d839b[_0xfefb('0x2a')],_0x5b7d81)[_0xfefb('0x22')](_0xfefb('0x30')));_0x466dd0[_0xfefb('0x20')](_0x4c7bef);}else{logger[_0xfefb('0x31')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xfefb('0x22')](__dirname,_0xfefb('0x17'),_0x5b7d81[_0xfefb('0x1a')]+_0xfefb('0x1b')));}}_0x3d839b['rules'][_0x114d0d]=new RuleEngine(_0x466dd0);_0x3d839b[_0xfefb('0x32')][_0x114d0d]['execute'](_0x52d5a6,function(_0x419d40){logger[_0xfefb('0x2d')](_0xfefb('0x33'),JSON[_0xfefb('0x34')](_0x419d40[_0xfefb('0x35')]));if(_0x3d839b[_0xfefb('0x32')][_0x114d0d]){_0x3d839b[_0xfefb('0x32')][_0x114d0d]['emit'](_0xfefb('0x36'));}});return _0xe55736({'code':0xc8,'message':_0x52d5a6});}else{logger['info']('No\x20applications\x20to\x20execute');return _0xe55736({'code':0xc8,'message':_0x52d5a6});}}catch(_0x32873b){logger[_0xfefb('0x31')](_0x32873b[_0xfefb('0x37')]);return _0x33c8b7(_0x3e1b32[_0xfefb('0x31')](0x1f4,_0x32873b));}}return _0x33c8b7('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3cc501){var _0x32d1b9=this;return new Promise(function(_0x30d173,_0x23c38c){if(_0x3cc501[_0xfefb('0x15')]&&_0x3cc501[_0xfefb('0x15')]['id']){try{var _0x2bf470=getId(_0x3cc501[_0xfefb('0x14')],_0x3cc501[_0xfefb('0x15')]?_0x3cc501[_0xfefb('0x15')]['id']:0x0,_0x3cc501[_0xfefb('0x16')]?_0x3cc501[_0xfefb('0x16')]['id']:0x0);if(_0x3d839b[_0xfefb('0x32')][_0x2bf470]){_0x3d839b[_0xfefb('0x32')][_0x2bf470][_0xfefb('0x38')](_0xfefb('0x36'));if(rpc[_0x3cc501[_0xfefb('0x14')]+'QueueReport']){rpc[_0x3cc501[_0xfefb('0x14')]+'QueueReport']['update'](_0x2bf470,{'UserId':_0x3cc501[_0xfefb('0x15')]['UserId']})[_0xfefb('0x39')](function(_0x42d9fb){logger[_0xfefb('0x31')](_0xfefb('0x3a'));});}}return _0x30d173({'code':0xc8,'message':_0x3cc501});}catch(_0x2d25e8){logger[_0xfefb('0x31')](_0x2d25e8[_0xfefb('0x37')]);return _0x23c38c(_0x32d1b9[_0xfefb('0x31')](0x1f4,_0x2d25e8));}}logger[_0xfefb('0x31')]('message\x20is\x20empty');return _0x23c38c(_0x32d1b9['error'](0x1f4,_0xfefb('0x3b')));});},'RejectMessage':function(_0x33d17f){var _0x4e7146=this;return new Promise(function(_0x56f9e3,_0x2d49af){if(_0x33d17f[_0xfefb('0x3c')]&&_0x33d17f[_0xfefb('0x3c')]['id']){try{if(_0x3d839b['agents'][_0x33d17f[_0xfefb('0x3c')]['id']]){_0x3d839b[_0xfefb('0x3d')][_0x33d17f[_0xfefb('0x3c')]['id']][_0xfefb('0x3e')]=![];_0x3d839b['agents'][_0x33d17f[_0xfefb('0x3c')]['id']][_0xfefb('0x3f')]=undefined;}return _0x56f9e3({'code':0xc8,'message':_0x33d17f});}catch(_0x1b534e){logger[_0xfefb('0x31')](_0x1b534e[_0xfefb('0x37')]);return _0x2d49af(_0x4e7146['error'](0x1f4,_0x1b534e));}}logger[_0xfefb('0x31')](_0xfefb('0x3b'));return _0x2d49af(_0x4e7146['error'](0x1f4,_0xfefb('0x3b')));});},'AbandonInteraction':function(_0x2be56b){var _0x2621eb=this;return new Promise(function(_0x301036,_0x257c96){if(_0x2be56b[_0xfefb('0x14')]&&_0x2be56b['interaction']&&_0x2be56b[_0xfefb('0x16')]['id']){try{var _0x32b7b1=getId(_0x2be56b[_0xfefb('0x14')],_0x2be56b[_0xfefb('0x15')]?_0x2be56b['message']['id']:0x0,_0x2be56b['interaction']?_0x2be56b['interaction']['id']:0x0);if(_0x3d839b[_0xfefb('0x32')][_0x32b7b1]){_0x3d839b[_0xfefb('0x32')][_0x32b7b1][_0xfefb('0x38')](_0xfefb('0x36'));}return _0x301036({'code':0xc8,'message':_0x2be56b});}catch(_0x4db097){logger[_0xfefb('0x31')](_0x4db097[_0xfefb('0x37')]);return _0x257c96(_0x2621eb[_0xfefb('0x31')](0x1f4,_0x4db097));}}logger[_0xfefb('0x31')](_0xfefb('0x3b'));return _0x257c96(_0x2621eb[_0xfefb('0x31')](0x1f4,_0xfefb('0x3b')));});},'AgentCapacity':function(_0x222be7){var _0x21e392=this;return new Promise(function(_0x51de13,_0x25d7f5){if(_0x3d839b[_0xfefb('0x3d')]['hasOwnProperty'](_0x222be7['id'])){for(var _0x51ee55 in _0x222be7[_0xfefb('0x40')]){if(_0x222be7[_0xfefb('0x40')][_0xfefb('0x41')](_0x51ee55)){if(_0x3d839b[_0xfefb('0x3d')][_0x222be7['id']]['hasOwnProperty'](_0x51ee55+_0xfefb('0x42'))){_0x3d839b[_0xfefb('0x3d')][_0x222be7['id']][_0x51ee55+_0xfefb('0x42')]=parseInt(_0x222be7['capacity'][_0x51ee55],0xa);}}}_0x3d839b['agents'][_0x222be7['id']]['updateRealtime']();return _0x51de13({'code':0xc8,'message':_0x3d839b[_0xfefb('0x3d')][_0x222be7['id']]});}else{return _0x25d7f5(_0x21e392[_0xfefb('0x31')](0x1f4,_0xfefb('0x43')));}});},'Agents':function(_0x253c1e){return new Promise(function(_0x49e729,_0x45d201){var _0x21e2fa=_[_0xfefb('0x44')](_0x3d839b[_0xfefb('0x3d')]);_0x49e729({'count':_0x21e2fa['length'],'rows':_0x21e2fa});});},'ChatQueues':function(_0x583c62){return new Promise(function(_0x2a5b14,_0xb070a8){var _0x29d3f4=[];for(var _0xf34f3c in _0x3d839b[_0xfefb('0x45')]){if(_0x3d839b[_0xfefb('0x45')][_0xfefb('0x41')](_0xf34f3c)){var _0x58f942=_0x3d839b[_0xfefb('0x45')][_0xf34f3c];var _0x3c0fc1={'id':_0x58f942['id'],'available':_0x58f942[_0xfefb('0x46')],'loggedIn':_0x58f942[_0xfefb('0x47')],'name':_0x58f942[_0xfefb('0x48')],'paused':_0x58f942[_0xfefb('0x49')],'waiting':_0x58f942[_0xfefb('0x4a')]};_0x29d3f4['push'](_0x3c0fc1);}}_0x2a5b14({'count':_0x29d3f4['length'],'rows':_0x29d3f4});});},'MailQueues':function(_0x56249f){return new Promise(function(_0x4f2a1c,_0x2b3796){var _0x3ef052=[];for(var _0x5629c7 in _0x3d839b[_0xfefb('0x4b')]){if(_0x3d839b[_0xfefb('0x4b')][_0xfefb('0x41')](_0x5629c7)){var _0x242af3=_0x3d839b[_0xfefb('0x4b')][_0x5629c7];var _0x52e8a6={'id':_0x242af3['id'],'available':_0x242af3[_0xfefb('0x46')],'loggedIn':_0x242af3[_0xfefb('0x47')],'name':_0x242af3['name'],'paused':_0x242af3[_0xfefb('0x49')],'waiting':_0x242af3[_0xfefb('0x4a')]};_0x3ef052[_0xfefb('0x20')](_0x52e8a6);}}_0x4f2a1c({'count':_0x3ef052[_0xfefb('0x19')],'rows':_0x3ef052});});},'OpenchannelQueues':function(_0x2e7dab){return new Promise(function(_0x115923,_0x100b1d){var _0x44023c=[];for(var _0x45341e in _0x3d839b[_0xfefb('0x4c')]){if(_0x3d839b[_0xfefb('0x4c')][_0xfefb('0x41')](_0x45341e)){var _0x4fb925=_0x3d839b[_0xfefb('0x4c')][_0x45341e];var _0x3c1bec={'id':_0x4fb925['id'],'available':_0x4fb925[_0xfefb('0x46')],'loggedIn':_0x4fb925[_0xfefb('0x47')],'name':_0x4fb925[_0xfefb('0x48')],'paused':_0x4fb925[_0xfefb('0x49')],'waiting':_0x4fb925[_0xfefb('0x4a')]};_0x44023c[_0xfefb('0x20')](_0x3c1bec);}}_0x115923({'count':_0x44023c['length'],'rows':_0x44023c});});},'SmsQueues':function(_0x323069){return new Promise(function(_0x5d948d,_0x53df1d){var _0x5eb673=[];for(var _0x25a451 in _0x3d839b['smsQueues']){if(_0x3d839b[_0xfefb('0x4d')][_0xfefb('0x41')](_0x25a451)){var _0x5b5a58=_0x3d839b[_0xfefb('0x4d')][_0x25a451];var _0x115ad8={'id':_0x5b5a58['id'],'available':_0x5b5a58[_0xfefb('0x46')],'loggedIn':_0x5b5a58[_0xfefb('0x47')],'name':_0x5b5a58[_0xfefb('0x48')],'paused':_0x5b5a58[_0xfefb('0x49')],'waiting':_0x5b5a58[_0xfefb('0x4a')]};_0x5eb673[_0xfefb('0x20')](_0x115ad8);}}_0x5d948d({'count':_0x5eb673['length'],'rows':_0x5eb673});});},'FaxQueues':function(_0x1a6e66){return new Promise(function(_0x4e55d3,_0x5a851e){var _0x196445=[];for(var _0x58fbce in _0x3d839b[_0xfefb('0x4e')]){if(_0x3d839b['faxQueues'][_0xfefb('0x41')](_0x58fbce)){var _0x263512=_0x3d839b[_0xfefb('0x4e')][_0x58fbce];var _0x32a985={'id':_0x263512['id'],'available':_0x263512['available'],'loggedIn':_0x263512[_0xfefb('0x47')],'name':_0x263512['name'],'paused':_0x263512[_0xfefb('0x49')],'waiting':_0x263512[_0xfefb('0x4a')]};_0x196445[_0xfefb('0x20')](_0x32a985);}}_0x4e55d3({'count':_0x196445['length'],'rows':_0x196445});});},'ChatQueuesWaitingInteractions':function(_0x51e08a){return new Promise(function(_0x14bed8,_0x21a12b){var _0x5da023=_[_0xfefb('0x44')](_0x3d839b[_0xfefb('0x4f')]);_0x14bed8({'count':_0x5da023[_0xfefb('0x19')],'rows':_0x5da023});});},'MailQueuesWaitingInteractions':function(_0x399e39){return new Promise(function(_0x4dbf9c,_0x56602d){var _0x1c91ff=_['values'](_0x3d839b[_0xfefb('0x50')]);_0x4dbf9c({'count':_0x1c91ff['length'],'rows':_0x1c91ff});});},'OpenchannelQueuesWaitingInteractions':function(_0x21d07e){return new Promise(function(_0x49f013,_0x441cf8){var _0x35d084=_[_0xfefb('0x44')](_0x3d839b[_0xfefb('0x51')]);_0x49f013({'count':_0x35d084['length'],'rows':_0x35d084});});},'SmsQueuesWaitingInteractions':function(_0x2dde63){return new Promise(function(_0x384e7c,_0x245c65){var _0x48ad69=_[_0xfefb('0x44')](_0x3d839b['smsQueuesWaitingInteractions']);_0x384e7c({'count':_0x48ad69[_0xfefb('0x19')],'rows':_0x48ad69});});},'FaxQueuesWaitingInteractions':function(_0x55ef96){return new Promise(function(_0x502e91,_0x56f7ed){var _0x498631=_[_0xfefb('0x44')](_0x3d839b['faxQueuesWaitingInteractions']);_0x502e91({'count':_0x498631['length'],'rows':_0x498631});});}};var _0xca694e=jayson[_0xfefb('0x52')](_0x18f866)['http']();_0xca694e['on']('error',function(_0x262e6e){logger[_0xfefb('0x31')](JSON['stringify'](_0x262e6e));return _0x149e7b(_0x262e6e);});_0xca694e['listen'](0x232c,'127.0.0.1',function(){console[_0xfefb('0x53')](_0xfefb('0x54'),0x232c);return _0x14d710(_0xfefb('0x55')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index d3e2804..b3156af 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 _0x7f21=['true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','error','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','then','message','indexOf'];(function(_0x122d83,_0x202c23){var _0x331d23=function(_0x4c73d6){while(--_0x4c73d6){_0x122d83['push'](_0x122d83['shift']());}};_0x331d23(++_0x202c23);}(_0x7f21,0x102));var _0x17f2=function(_0x1b8e4c,_0x11e22d){_0x1b8e4c=_0x1b8e4c-0x0;var _0x3ddac7=_0x7f21[_0x1b8e4c];return _0x3ddac7;};'use strict';var util=require(_0x17f2('0x0'));var BPromise=require('bluebird');var jayson=require(_0x17f2('0x1'));var _=require(_0x17f2('0x2'));var logger=require(_0x17f2('0x3'))(_0x17f2('0x4'));var client=jayson[_0x17f2('0x5')][_0x17f2('0x6')]({'port':0x232a});function request(_0x1aa6cd,_0x44f808){return new BPromise(function(_0x40433e,_0x24fc16){return client[_0x17f2('0x7')](_0x1aa6cd,_0x44f808)['then'](function(_0x121009){if(_0x121009[_0x17f2('0x8')]){return _0x24fc16(_0x121009[_0x17f2('0x8')]['message']);}else{return _0x40433e(_0x121009[_0x17f2('0x9')]);}})['catch'](function(_0x10a268){return _0x24fc16(_0x10a268);});});}exports[_0x17f2('0xa')]=function(_0x28b3a7,_0x2d1421,_0x351182){return function(_0x354470){if(_0x351182['rules']&&!_0x351182[_0x17f2('0xb')][_0x28b3a7]){logger[_0x17f2('0xc')](_0x17f2('0xd'),_0x28b3a7);return _0x354470[_0x17f2('0xe')]();}var _0x2e6bd7=[];for(var _0x3f9e20=0x0;_0x3f9e20<_0x2d1421['length'];_0x3f9e20+=0x1){_0x2e6bd7[_0x17f2('0xf')](request(_0x17f2('0x10'),{'command':util[_0x17f2('0x11')]('iftime\x20%s',_0x2d1421[_0x3f9e20])})[_0x17f2('0x12')](function(_0x2690f5){return _0x2690f5&&_0x2690f5[_0x17f2('0x13')]&&_0x2690f5[_0x17f2('0x13')][_0x17f2('0x14')](_0x17f2('0x15'))>=0x0?!![]:![];})[_0x17f2('0x16')](function(_0xc71251){logger[_0x17f2('0x8')](_0x17f2('0x17'),_0x28b3a7,_0x2d1421[_0x3f9e20]);}));}BPromise[_0x17f2('0x18')](_0x2e6bd7)['then'](function(_0x2665ce){var _0x56c680=_[_0x17f2('0x19')](_0x2665ce);logger[_0x17f2('0xc')](_0x17f2('0x1a'),_0x28b3a7,_0x2d1421[_0x17f2('0x1b')](_0x17f2('0x1c')),_0x56c680);_0x354470['when'](_0x56c680);})['catch'](function(_0x4ed0c4){console[_0x17f2('0x1d')](_0x4ed0c4);logger['error'](_0x17f2('0x1a'),_0x28b3a7,_0x2d1421[_0x17f2('0x1b')]('\x20|\x20'),_0x4ed0c4[_0x17f2('0x1e')]);_0x354470[_0x17f2('0xe')]();});};}; \ No newline at end of file +var _0x3f73=['then','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','routing','client','http','request'];(function(_0x12fcbd,_0x884804){var _0x28ec2a=function(_0xa5ff99){while(--_0xa5ff99){_0x12fcbd['push'](_0x12fcbd['shift']());}};_0x28ec2a(++_0x884804);}(_0x3f73,0x1d8));var _0x33f7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3f73[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x33f7('0x0'));var BPromise=require(_0x33f7('0x1'));var jayson=require(_0x33f7('0x2'));var _=require(_0x33f7('0x3'));var logger=require('../../../config/logger')(_0x33f7('0x4'));var client=jayson[_0x33f7('0x5')][_0x33f7('0x6')]({'port':0x232a});function request(_0x2cd646,_0x3fb728){return new BPromise(function(_0x442a13,_0x1962a1){return client[_0x33f7('0x7')](_0x2cd646,_0x3fb728)[_0x33f7('0x8')](function(_0x27f909){if(_0x27f909[_0x33f7('0x9')]){return _0x1962a1(_0x27f909[_0x33f7('0x9')][_0x33f7('0xa')]);}else{return _0x442a13(_0x27f909[_0x33f7('0xb')]);}})['catch'](function(_0x6538a6){return _0x1962a1(_0x6538a6);});});}exports[_0x33f7('0xc')]=function(_0x154310,_0xab3d61,_0x555643){return function(_0x4aaf97){if(_0x555643[_0x33f7('0xd')]&&!_0x555643[_0x33f7('0xd')][_0x154310]){logger[_0x33f7('0xe')](_0x33f7('0xf'),_0x154310);return _0x4aaf97[_0x33f7('0x10')]();}var _0x444416=[];for(var _0x44b052=0x0;_0x44b052<_0xab3d61[_0x33f7('0x11')];_0x44b052+=0x1){_0x444416['push'](request('Command',{'command':util[_0x33f7('0x12')](_0x33f7('0x13'),_0xab3d61[_0x44b052])})[_0x33f7('0x8')](function(_0x5866e5){return _0x5866e5&&_0x5866e5[_0x33f7('0xa')]&&_0x5866e5[_0x33f7('0xa')][_0x33f7('0x14')](_0x33f7('0x15'))>=0x0?!![]:![];})[_0x33f7('0x16')](function(_0x2ef051){logger['error'](_0x33f7('0x17'),_0x154310,_0xab3d61[_0x44b052]);}));}BPromise[_0x33f7('0x18')](_0x444416)[_0x33f7('0x8')](function(_0x49b2f2){var _0x149211=_[_0x33f7('0x19')](_0x49b2f2);logger[_0x33f7('0xe')](_0x33f7('0x1a'),_0x154310,_0xab3d61[_0x33f7('0x1b')]('\x20|\x20'),_0x149211);_0x4aaf97[_0x33f7('0x1c')](_0x149211);})[_0x33f7('0x16')](function(_0x27c80d){console[_0x33f7('0x1d')](_0x27c80d);logger[_0x33f7('0x9')](_0x33f7('0x1a'),_0x154310,_0xab3d61[_0x33f7('0x1b')](_0x33f7('0x1e')),_0x27c80d[_0x33f7('0x1f')]);_0x4aaf97['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 28c16f4..a8dc937 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 _0xb4ef=['blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','agent','lodash','util','./utils','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','destuniqueid','now','called','connectedlinenum','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','holdtime','ringtime','talktime','queuecallerabandon','forIn','reason','abandoned','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','membername','diffTime','agentcompleteAt','complete'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0xb4ef,0x175));var _0xfb4e=function(_0x305d1e,_0x219641){_0x305d1e=_0x305d1e-0x0;var _0x198115=_0xb4ef[_0x305d1e];return _0x198115;};'use strict';var _=require(_0xfb4e('0x0'));var util=require(_0xfb4e('0x1'));var utils=require(_0xfb4e('0x2'));var agents={};var transfers={};function writeDB(_0x5dc6fb,_0x32412d){utils['info'](util[_0xfb4e('0x3')](_0xfb4e('0x4'),_0x5dc6fb[_0xfb4e('0x5')],_0x5dc6fb['channel'],_0x5dc6fb[_0xfb4e('0x6')],_0x5dc6fb['membername'],_0x5dc6fb['interface'],_0x5dc6fb[_0xfb4e('0x7')],_0x5dc6fb['connectedlinenum'],_0x5dc6fb[_0xfb4e('0x8')]));if(_0x5dc6fb[_0xfb4e('0x6')]){utils[_0xfb4e('0x9')](_0x5dc6fb[_0xfb4e('0x6')])[_0xfb4e('0xa')](function(_0x2ee20){if(_0x2ee20){_0x5dc6fb[_0xfb4e('0xb')]=_0x2ee20[_0xfb4e('0xb')];_0x5dc6fb[_0xfb4e('0xc')]=_0x5dc6fb[_0xfb4e('0xd')]?_0x2ee20[_0xfb4e('0xe')]:![];_0x5dc6fb[_0xfb4e('0xf')]=_0x5dc6fb[_0xfb4e('0xc')]?_0x2ee20[_0xfb4e('0x10')]:0x0;}utils['request'](_0xfb4e('0x11'),_0x5dc6fb);});}else{utils[_0xfb4e('0x12')](_0xfb4e('0x11'),_0x5dc6fb);}if(_0x32412d){delete transfers[_0x5dc6fb[_0xfb4e('0x5')]];}else{delete agents[_0x5dc6fb['destuniqueid']];}}exports[_0xfb4e('0x13')]=function(_0x4caa8c){try{agents[_0x4caa8c[_0xfb4e('0x14')]]=_0x4caa8c;agents[_0x4caa8c[_0xfb4e('0x14')]]['agentcalledAt']=utils[_0xfb4e('0x15')]();agents[_0x4caa8c[_0xfb4e('0x14')]][_0xfb4e('0x8')]=_0xfb4e('0x16');agents[_0x4caa8c[_0xfb4e('0x14')]][_0xfb4e('0x17')]=null;agents[_0x4caa8c[_0xfb4e('0x14')]][_0xfb4e('0x18')]=null;}catch(_0x5d216b){utils[_0xfb4e('0x19')](_0x5d216b[_0xfb4e('0x1a')]);}};exports[_0xfb4e('0x1b')]=function(_0x24196d){try{if(!_[_0xfb4e('0x1c')](agents[_0x24196d['destuniqueid']])){agents[_0x24196d[_0xfb4e('0x14')]]['agentringnoanswer']=!![];agents[_0x24196d[_0xfb4e('0x14')]][_0xfb4e('0x1d')]=utils[_0xfb4e('0x15')]();agents[_0x24196d[_0xfb4e('0x14')]][_0xfb4e('0x8')]=_0xfb4e('0x1e');agents[_0x24196d[_0xfb4e('0x14')]]['reason']=_0xfb4e('0x1e');agents[_0x24196d[_0xfb4e('0x14')]][_0xfb4e('0x1f')]=_0x24196d[_0xfb4e('0x20')]?parseInt(_0x24196d['ringtime'])/0x3e8:0x0;agents[_0x24196d[_0xfb4e('0x14')]][_0xfb4e('0x21')]=0x0;writeDB(agents[_0x24196d[_0xfb4e('0x14')]]);}}catch(_0x5aa3b9){utils[_0xfb4e('0x19')](_0x5aa3b9['stack']);}};exports[_0xfb4e('0x22')]=function(_0x287015){try{_[_0xfb4e('0x23')](agents,function(_0x578eb5,_0x4071ef){if(_0x578eb5[_0xfb4e('0x5')]==_0x287015[_0xfb4e('0x5')]){_0x578eb5[_0xfb4e('0x1b')]=!![];_0x578eb5[_0xfb4e('0x1d')]=utils['now']();_0x578eb5[_0xfb4e('0x8')]='abandoned';_0x578eb5[_0xfb4e('0x24')]=_0xfb4e('0x25');_0x578eb5[_0xfb4e('0x1f')]=_0x287015[_0xfb4e('0x1f')];_0x578eb5[_0xfb4e('0x21')]=0x0;writeDB(_0x578eb5);}});}catch(_0x3c1ae3){utils['error'](_0x3c1ae3[_0xfb4e('0x1a')]);}};exports[_0xfb4e('0x26')]=function(_0x22e07b){try{if(agents[_0x22e07b[_0xfb4e('0x14')]]){agents[_0x22e07b[_0xfb4e('0x14')]][_0xfb4e('0x27')]=utils[_0xfb4e('0x15')]();agents[_0x22e07b[_0xfb4e('0x14')]][_0xfb4e('0x17')]=_0x22e07b[_0xfb4e('0x17')];agents[_0x22e07b[_0xfb4e('0x14')]]['connectedlinename']=_0x22e07b[_0xfb4e('0x18')];agents[_0x22e07b['destuniqueid']][_0xfb4e('0x1f')]=_0x22e07b[_0xfb4e('0x20')];agents[_0x22e07b[_0xfb4e('0x14')]][_0xfb4e('0x8')]=_0xfb4e('0x28');_['forIn'](agents,function(_0xc55a73,_0x2aaa77){if(_0xc55a73['destuniqueid']!=_0x22e07b['destuniqueid']&&_0xc55a73[_0xfb4e('0x5')]==_0x22e07b['uniqueid']){_0xc55a73['talktime']=0x0;_0xc55a73[_0xfb4e('0x1f')]=_0x22e07b[_0xfb4e('0x20')];_0xc55a73[_0xfb4e('0x1b')]=!![];_0xc55a73[_0xfb4e('0x1d')]=utils[_0xfb4e('0x15')]();_0xc55a73['lastevent']='answered_elsewhere';_0xc55a73['reason']=_0xfb4e('0x29');_0xc55a73[_0xfb4e('0x2a')]=_0x22e07b[_0xfb4e('0x14')];_0xc55a73['answeredelsewheremembername']=_0x22e07b[_0xfb4e('0x2b')];writeDB(_0xc55a73);}});}}catch(_0x773085){utils['error'](_0x773085[_0xfb4e('0x1a')]);}};exports[_0xfb4e('0xd')]=function(_0x45cc0){try{if(!_[_0xfb4e('0x1c')](agents[_0x45cc0[_0xfb4e('0x14')]])){agents[_0x45cc0[_0xfb4e('0x14')]][_0xfb4e('0xd')]=!![];agents[_0x45cc0[_0xfb4e('0x14')]]['agentcompleteAt']=utils[_0xfb4e('0x15')]();agents[_0x45cc0['destuniqueid']][_0xfb4e('0x21')]=utils[_0xfb4e('0x2c')](agents[_0x45cc0[_0xfb4e('0x14')]][_0xfb4e('0x2d')],agents[_0x45cc0[_0xfb4e('0x14')]]['agentconnectAt']);agents[_0x45cc0[_0xfb4e('0x14')]][_0xfb4e('0x24')]=_0x45cc0[_0xfb4e('0x24')];agents[_0x45cc0[_0xfb4e('0x14')]]['lastevent']=_0xfb4e('0x2e');writeDB(agents[_0x45cc0[_0xfb4e('0x14')]]);}}catch(_0x41921a){utils[_0xfb4e('0x19')](_0x41921a[_0xfb4e('0x1a')]);}};exports[_0xfb4e('0x2f')]=function(_0x1a9ce1){try{if(!_[_0xfb4e('0x1c')](agents[_0x1a9ce1[_0xfb4e('0x30')]])){agents[_0x1a9ce1[_0xfb4e('0x30')]][_0xfb4e('0x31')]=!![];agents[_0x1a9ce1[_0xfb4e('0x30')]][_0xfb4e('0x32')]=_0xfb4e('0x33');agents[_0x1a9ce1[_0xfb4e('0x30')]][_0xfb4e('0x34')]=_0x1a9ce1[_0xfb4e('0x35')];agents[_0x1a9ce1[_0xfb4e('0x30')]][_0xfb4e('0x36')]=agents[_0x1a9ce1[_0xfb4e('0x30')]][_0xfb4e('0x5')];}}catch(_0x1f55b1){utils[_0xfb4e('0x19')](_0x1f55b1['stack']);}};exports[_0xfb4e('0x37')]=function(_0x1ff7d8){try{if(_0x1ff7d8[_0xfb4e('0x38')]==_0x1ff7d8[_0xfb4e('0x39')]){if(!_[_0xfb4e('0x1c')](agents[_0x1ff7d8[_0xfb4e('0x3a')]])){agents[_0x1ff7d8[_0xfb4e('0x3a')]][_0xfb4e('0x31')]=!![];agents[_0x1ff7d8['secondtransfereruniqueid']][_0xfb4e('0x32')]=_0xfb4e('0x3b');agents[_0x1ff7d8[_0xfb4e('0x3a')]][_0xfb4e('0x34')]=_0x1ff7d8[_0xfb4e('0x3c')];agents[_0x1ff7d8[_0xfb4e('0x3a')]][_0xfb4e('0x36')]=_0x1ff7d8[_0xfb4e('0x38')];}if(_0x1ff7d8[_0xfb4e('0x3d')]&&agents[_0x1ff7d8[_0xfb4e('0x3d')]]){agents[_0x1ff7d8[_0xfb4e('0x3d')]]['agententerreason']=0x1;transfers[_0x1ff7d8[_0xfb4e('0x3d')]]=_[_0xfb4e('0x3e')](agents[_0x1ff7d8[_0xfb4e('0x3d')]]);transfers[_0x1ff7d8[_0xfb4e('0x3d')]][_0xfb4e('0x7')]=agents[_0x1ff7d8['secondtransfereruniqueid']]['calleridnum'];transfers[_0x1ff7d8['transfereeuniqueid']][_0xfb4e('0x3f')]=agents[_0x1ff7d8[_0xfb4e('0x3a')]][_0xfb4e('0x3f')];transfers[_0x1ff7d8[_0xfb4e('0x3d')]][_0xfb4e('0x40')]=utils[_0xfb4e('0x15')]();transfers[_0x1ff7d8[_0xfb4e('0x3d')]]['agentconnectAt']=utils[_0xfb4e('0x15')]();transfers[_0x1ff7d8[_0xfb4e('0x3d')]][_0xfb4e('0x1f')]=0x0;transfers[_0x1ff7d8[_0xfb4e('0x3d')]]['agententerreason']=0x2;}}else if(_0x1ff7d8[_0xfb4e('0x3a')]==_0x1ff7d8['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x1ff7d8[_0xfb4e('0x38')]])){agents[_0x1ff7d8[_0xfb4e('0x38')]][_0xfb4e('0x31')]=!![];agents[_0x1ff7d8[_0xfb4e('0x38')]][_0xfb4e('0x32')]=_0xfb4e('0x3b');agents[_0x1ff7d8[_0xfb4e('0x38')]]['transferexten']=_0x1ff7d8[_0xfb4e('0x41')];agents[_0x1ff7d8[_0xfb4e('0x38')]][_0xfb4e('0x36')]=_0x1ff7d8[_0xfb4e('0x3a')];}if(_0x1ff7d8[_0xfb4e('0x42')]&&agents[_0x1ff7d8[_0xfb4e('0x42')]]){agents[_0x1ff7d8['transfertargetuniqueid']][_0xfb4e('0x43')]=0x1;transfers[_0x1ff7d8[_0xfb4e('0x42')]]=_[_0xfb4e('0x3e')](agents[_0x1ff7d8[_0xfb4e('0x42')]]);transfers[_0x1ff7d8[_0xfb4e('0x42')]][_0xfb4e('0x7')]=agents[_0x1ff7d8[_0xfb4e('0x38')]][_0xfb4e('0x7')];transfers[_0x1ff7d8[_0xfb4e('0x42')]][_0xfb4e('0x3f')]=agents[_0x1ff7d8[_0xfb4e('0x38')]][_0xfb4e('0x3f')];transfers[_0x1ff7d8[_0xfb4e('0x42')]][_0xfb4e('0x40')]=utils[_0xfb4e('0x15')]();transfers[_0x1ff7d8['transfertargetuniqueid']][_0xfb4e('0x27')]=utils[_0xfb4e('0x15')]();transfers[_0x1ff7d8['transfertargetuniqueid']][_0xfb4e('0x1f')]=0x0;transfers[_0x1ff7d8['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0xf3154b){utils[_0xfb4e('0x19')](_0xf3154b[_0xfb4e('0x1a')]);}};exports[_0xfb4e('0x44')]=function(_0x25a9ba){try{if(transfers[_0x25a9ba[_0xfb4e('0x5')]]){transfers[_0x25a9ba[_0xfb4e('0x5')]]['agentcomplete']=!![];transfers[_0x25a9ba['uniqueid']][_0xfb4e('0x2d')]=utils['now']();transfers[_0x25a9ba[_0xfb4e('0x5')]]['talktime']=utils['diffTime'](transfers[_0x25a9ba[_0xfb4e('0x5')]][_0xfb4e('0x2d')],transfers[_0x25a9ba[_0xfb4e('0x5')]]['agentconnectAt']);transfers[_0x25a9ba['uniqueid']][_0xfb4e('0x24')]='agent';transfers[_0x25a9ba['uniqueid']][_0xfb4e('0x8')]=_0xfb4e('0x2e');writeDB(transfers[_0x25a9ba['uniqueid']],!![]);}if(agents[_0x25a9ba[_0xfb4e('0x5')]]&&agents[_0x25a9ba[_0xfb4e('0x5')]]['agentconnectAt']){agents[_0x25a9ba[_0xfb4e('0x5')]]['agentcomplete']=!![];agents[_0x25a9ba[_0xfb4e('0x5')]][_0xfb4e('0x2d')]=utils['now']();agents[_0x25a9ba['uniqueid']][_0xfb4e('0x21')]=utils['diffTime'](agents[_0x25a9ba[_0xfb4e('0x5')]][_0xfb4e('0x2d')],agents[_0x25a9ba['uniqueid']]['agentconnectAt']);agents[_0x25a9ba['uniqueid']][_0xfb4e('0x24')]=agents[_0x25a9ba['uniqueid']][_0xfb4e('0x31')]?'transfer':_0xfb4e('0x45');agents[_0x25a9ba['uniqueid']][_0xfb4e('0x8')]=_0xfb4e('0x2e');writeDB(agents[_0x25a9ba[_0xfb4e('0x5')]]);}}catch(_0x183c8b){utils[_0xfb4e('0x19')](_0x183c8b['stack']);}}; \ No newline at end of file +var _0x0946=['clone','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','agent','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','queue','interface','calleridnum','connectedlinenum','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','error','agentringnoanswer','agentringnoanswerAt','rejected','reason','holdtime','ringtime','talktime','stack','forIn','abandoned','agentconnect','agentconnectAt','answered_elsewhere','isNil','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','origtransfereruniqueid','transfereeuniqueid'];(function(_0x34233f,_0x18f1b1){var _0x2199a4=function(_0x2fa710){while(--_0x2fa710){_0x34233f['push'](_0x34233f['shift']());}};_0x2199a4(++_0x18f1b1);}(_0x0946,0x18c));var _0x6094=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0x0946[_0x11d95f];return _0x2b1a14;};'use strict';var _=require(_0x6094('0x0'));var util=require(_0x6094('0x1'));var utils=require(_0x6094('0x2'));var agents={};var transfers={};function writeDB(_0x5c7b86,_0xa3caee){utils[_0x6094('0x3')](util[_0x6094('0x4')](_0x6094('0x5'),_0x5c7b86['uniqueid'],_0x5c7b86['channel'],_0x5c7b86[_0x6094('0x6')],_0x5c7b86['membername'],_0x5c7b86[_0x6094('0x7')],_0x5c7b86[_0x6094('0x8')],_0x5c7b86[_0x6094('0x9')],_0x5c7b86['lastevent']));if(_0x5c7b86['queue']){utils[_0x6094('0xa')](_0x5c7b86[_0x6094('0x6')])['then'](function(_0x34ce04){if(_0x34ce04){_0x5c7b86[_0x6094('0xb')]=_0x34ce04[_0x6094('0xb')];_0x5c7b86[_0x6094('0xc')]=_0x5c7b86[_0x6094('0xd')]?_0x34ce04[_0x6094('0xe')]:![];_0x5c7b86[_0x6094('0xf')]=_0x5c7b86['agentacw']?_0x34ce04[_0x6094('0x10')]:0x0;}utils[_0x6094('0x11')]('CreateVoiceAgentReport',_0x5c7b86);});}else{utils[_0x6094('0x11')](_0x6094('0x12'),_0x5c7b86);}if(_0xa3caee){delete transfers[_0x5c7b86[_0x6094('0x13')]];}else{delete agents[_0x5c7b86[_0x6094('0x14')]];}}exports['agentcalled']=function(_0x355ad9){try{agents[_0x355ad9['destuniqueid']]=_0x355ad9;agents[_0x355ad9[_0x6094('0x14')]][_0x6094('0x15')]=utils[_0x6094('0x16')]();agents[_0x355ad9[_0x6094('0x14')]][_0x6094('0x17')]=_0x6094('0x18');agents[_0x355ad9[_0x6094('0x14')]]['connectedlinenum']=null;agents[_0x355ad9[_0x6094('0x14')]][_0x6094('0x19')]=null;}catch(_0x2b80a4){utils[_0x6094('0x1a')](_0x2b80a4['stack']);}};exports[_0x6094('0x1b')]=function(_0x519a4f){try{if(!_['isNil'](agents[_0x519a4f['destuniqueid']])){agents[_0x519a4f['destuniqueid']][_0x6094('0x1b')]=!![];agents[_0x519a4f[_0x6094('0x14')]][_0x6094('0x1c')]=utils['now']();agents[_0x519a4f[_0x6094('0x14')]][_0x6094('0x17')]=_0x6094('0x1d');agents[_0x519a4f[_0x6094('0x14')]][_0x6094('0x1e')]=_0x6094('0x1d');agents[_0x519a4f['destuniqueid']][_0x6094('0x1f')]=_0x519a4f[_0x6094('0x20')]?parseInt(_0x519a4f['ringtime'])/0x3e8:0x0;agents[_0x519a4f[_0x6094('0x14')]][_0x6094('0x21')]=0x0;writeDB(agents[_0x519a4f[_0x6094('0x14')]]);}}catch(_0x38c188){utils[_0x6094('0x1a')](_0x38c188[_0x6094('0x22')]);}};exports['queuecallerabandon']=function(_0x1636b0){try{_[_0x6094('0x23')](agents,function(_0x224173,_0x1a7c4c){if(_0x224173[_0x6094('0x13')]==_0x1636b0[_0x6094('0x13')]){_0x224173[_0x6094('0x1b')]=!![];_0x224173['agentringnoanswerAt']=utils[_0x6094('0x16')]();_0x224173['lastevent']=_0x6094('0x24');_0x224173[_0x6094('0x1e')]=_0x6094('0x24');_0x224173[_0x6094('0x1f')]=_0x1636b0[_0x6094('0x1f')];_0x224173[_0x6094('0x21')]=0x0;writeDB(_0x224173);}});}catch(_0x57a9c1){utils['error'](_0x57a9c1[_0x6094('0x22')]);}};exports[_0x6094('0x25')]=function(_0x10f0e2){try{if(agents[_0x10f0e2[_0x6094('0x14')]]){agents[_0x10f0e2[_0x6094('0x14')]][_0x6094('0x26')]=utils[_0x6094('0x16')]();agents[_0x10f0e2[_0x6094('0x14')]][_0x6094('0x9')]=_0x10f0e2[_0x6094('0x9')];agents[_0x10f0e2[_0x6094('0x14')]][_0x6094('0x19')]=_0x10f0e2[_0x6094('0x19')];agents[_0x10f0e2[_0x6094('0x14')]][_0x6094('0x1f')]=_0x10f0e2[_0x6094('0x20')];agents[_0x10f0e2['destuniqueid']]['lastevent']='connect';_[_0x6094('0x23')](agents,function(_0x4aff2f,_0x34319f){if(_0x4aff2f['destuniqueid']!=_0x10f0e2[_0x6094('0x14')]&&_0x4aff2f['uniqueid']==_0x10f0e2[_0x6094('0x13')]){_0x4aff2f[_0x6094('0x21')]=0x0;_0x4aff2f[_0x6094('0x1f')]=_0x10f0e2[_0x6094('0x20')];_0x4aff2f[_0x6094('0x1b')]=!![];_0x4aff2f[_0x6094('0x1c')]=utils['now']();_0x4aff2f[_0x6094('0x17')]='answered_elsewhere';_0x4aff2f[_0x6094('0x1e')]=_0x6094('0x27');_0x4aff2f['answeredelsewheredestinationuniqueid']=_0x10f0e2[_0x6094('0x14')];_0x4aff2f['answeredelsewheremembername']=_0x10f0e2['membername'];writeDB(_0x4aff2f);}});}}catch(_0x25c18a){utils[_0x6094('0x1a')](_0x25c18a[_0x6094('0x22')]);}};exports[_0x6094('0xd')]=function(_0x1a9178){try{if(!_[_0x6094('0x28')](agents[_0x1a9178[_0x6094('0x14')]])){agents[_0x1a9178[_0x6094('0x14')]][_0x6094('0xd')]=!![];agents[_0x1a9178[_0x6094('0x14')]][_0x6094('0x29')]=utils[_0x6094('0x16')]();agents[_0x1a9178[_0x6094('0x14')]][_0x6094('0x21')]=utils[_0x6094('0x2a')](agents[_0x1a9178['destuniqueid']][_0x6094('0x29')],agents[_0x1a9178[_0x6094('0x14')]][_0x6094('0x26')]);agents[_0x1a9178[_0x6094('0x14')]][_0x6094('0x1e')]=_0x1a9178['reason'];agents[_0x1a9178[_0x6094('0x14')]][_0x6094('0x17')]=_0x6094('0x2b');writeDB(agents[_0x1a9178['destuniqueid']]);}}catch(_0x24a378){utils[_0x6094('0x1a')](_0x24a378[_0x6094('0x22')]);}};exports[_0x6094('0x2c')]=function(_0x4586f3){try{if(!_[_0x6094('0x28')](agents[_0x4586f3[_0x6094('0x2d')]])){agents[_0x4586f3[_0x6094('0x2d')]][_0x6094('0x2e')]=!![];agents[_0x4586f3[_0x6094('0x2d')]][_0x6094('0x2f')]=_0x6094('0x30');agents[_0x4586f3[_0x6094('0x2d')]][_0x6094('0x31')]=_0x4586f3[_0x6094('0x32')];agents[_0x4586f3['transfereruniqueid']][_0x6094('0x33')]=agents[_0x4586f3[_0x6094('0x2d')]]['uniqueid'];}}catch(_0x53502f){utils['error'](_0x53502f['stack']);}};exports[_0x6094('0x34')]=function(_0x58e4b9){try{if(_0x58e4b9['origtransfereruniqueid']==_0x58e4b9[_0x6094('0x35')]){if(!_[_0x6094('0x28')](agents[_0x58e4b9[_0x6094('0x36')]])){agents[_0x58e4b9[_0x6094('0x36')]][_0x6094('0x2e')]=!![];agents[_0x58e4b9[_0x6094('0x36')]]['transfertype']=_0x6094('0x37');agents[_0x58e4b9[_0x6094('0x36')]][_0x6094('0x31')]=_0x58e4b9[_0x6094('0x38')];agents[_0x58e4b9[_0x6094('0x36')]][_0x6094('0x33')]=_0x58e4b9[_0x6094('0x39')];}if(_0x58e4b9[_0x6094('0x3a')]&&agents[_0x58e4b9[_0x6094('0x3a')]]){agents[_0x58e4b9[_0x6094('0x3a')]]['agententerreason']=0x1;transfers[_0x58e4b9[_0x6094('0x3a')]]=_[_0x6094('0x3b')](agents[_0x58e4b9[_0x6094('0x3a')]]);transfers[_0x58e4b9[_0x6094('0x3a')]][_0x6094('0x8')]=agents[_0x58e4b9[_0x6094('0x36')]][_0x6094('0x8')];transfers[_0x58e4b9[_0x6094('0x3a')]]['calleridname']=agents[_0x58e4b9[_0x6094('0x36')]][_0x6094('0x3c')];transfers[_0x58e4b9[_0x6094('0x3a')]][_0x6094('0x15')]=utils[_0x6094('0x16')]();transfers[_0x58e4b9[_0x6094('0x3a')]]['agentconnectAt']=utils[_0x6094('0x16')]();transfers[_0x58e4b9[_0x6094('0x3a')]]['holdtime']=0x0;transfers[_0x58e4b9[_0x6094('0x3a')]][_0x6094('0x3d')]=0x2;}}else if(_0x58e4b9[_0x6094('0x36')]==_0x58e4b9[_0x6094('0x3e')]){if(!_['isNil'](agents[_0x58e4b9[_0x6094('0x39')]])){agents[_0x58e4b9[_0x6094('0x39')]][_0x6094('0x2e')]=!![];agents[_0x58e4b9['origtransfereruniqueid']][_0x6094('0x2f')]=_0x6094('0x37');agents[_0x58e4b9['origtransfereruniqueid']]['transferexten']=_0x58e4b9['secondtransfererexten'];agents[_0x58e4b9[_0x6094('0x39')]]['transferuniqueid']=_0x58e4b9[_0x6094('0x36')];}if(_0x58e4b9['transfertargetuniqueid']&&agents[_0x58e4b9['transfertargetuniqueid']]){agents[_0x58e4b9[_0x6094('0x3f')]][_0x6094('0x3d')]=0x1;transfers[_0x58e4b9['transfertargetuniqueid']]=_[_0x6094('0x3b')](agents[_0x58e4b9[_0x6094('0x3f')]]);transfers[_0x58e4b9['transfertargetuniqueid']][_0x6094('0x8')]=agents[_0x58e4b9[_0x6094('0x39')]][_0x6094('0x8')];transfers[_0x58e4b9['transfertargetuniqueid']]['calleridname']=agents[_0x58e4b9[_0x6094('0x39')]][_0x6094('0x3c')];transfers[_0x58e4b9[_0x6094('0x3f')]][_0x6094('0x15')]=utils['now']();transfers[_0x58e4b9[_0x6094('0x3f')]]['agentconnectAt']=utils[_0x6094('0x16')]();transfers[_0x58e4b9['transfertargetuniqueid']][_0x6094('0x1f')]=0x0;transfers[_0x58e4b9[_0x6094('0x3f')]][_0x6094('0x3d')]=0x2;}}}catch(_0x5f1184){utils[_0x6094('0x1a')](_0x5f1184['stack']);}};exports['hangup']=function(_0x5cbae9){try{if(transfers[_0x5cbae9['uniqueid']]){transfers[_0x5cbae9[_0x6094('0x13')]][_0x6094('0xd')]=!![];transfers[_0x5cbae9[_0x6094('0x13')]][_0x6094('0x29')]=utils['now']();transfers[_0x5cbae9['uniqueid']]['talktime']=utils[_0x6094('0x2a')](transfers[_0x5cbae9[_0x6094('0x13')]][_0x6094('0x29')],transfers[_0x5cbae9[_0x6094('0x13')]][_0x6094('0x26')]);transfers[_0x5cbae9[_0x6094('0x13')]]['reason']=_0x6094('0x40');transfers[_0x5cbae9[_0x6094('0x13')]][_0x6094('0x17')]='complete';writeDB(transfers[_0x5cbae9[_0x6094('0x13')]],!![]);}if(agents[_0x5cbae9[_0x6094('0x13')]]&&agents[_0x5cbae9[_0x6094('0x13')]]['agentconnectAt']){agents[_0x5cbae9['uniqueid']][_0x6094('0xd')]=!![];agents[_0x5cbae9[_0x6094('0x13')]]['agentcompleteAt']=utils[_0x6094('0x16')]();agents[_0x5cbae9[_0x6094('0x13')]][_0x6094('0x21')]=utils[_0x6094('0x2a')](agents[_0x5cbae9['uniqueid']][_0x6094('0x29')],agents[_0x5cbae9[_0x6094('0x13')]][_0x6094('0x26')]);agents[_0x5cbae9[_0x6094('0x13')]]['reason']=agents[_0x5cbae9[_0x6094('0x13')]][_0x6094('0x2e')]?_0x6094('0x2e'):_0x6094('0x40');agents[_0x5cbae9['uniqueid']][_0x6094('0x17')]='complete';writeDB(agents[_0x5cbae9[_0x6094('0x13')]]);}}catch(_0x40f541){utils[_0x6094('0x1a')](_0x40f541[_0x6094('0x22')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 90b2865..3ca9109 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 _0xf0c7=['newstate','isNil','systemanswertime','linkedid','channelstate','transfer','destinationchannel','answertime','hangup','calleridname','endtime','diffTime','starttime','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstartAt','musiconholdstop','mohtime','variable','xmd-originatecalleridnum','xmd-phone','value','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','routeid','sipcallid','application','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','destination','callerid','disposition','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','calleridnum','context','now','DOCUMENTATION','error','stack'];(function(_0x6fef13,_0x936c3b){var _0x5f45d4=function(_0xd3f3e7){while(--_0xd3f3e7){_0x6fef13['push'](_0x6fef13['shift']());}};_0x5f45d4(++_0x936c3b);}(_0xf0c7,0xc9));var _0x7f0c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf0c7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x7f0c('0x0'));var util=require('util');var utils=require(_0x7f0c('0x1'));var dispositions=[_0x7f0c('0x2'),_0x7f0c('0x3'),_0x7f0c('0x3'),_0x7f0c('0x2'),_0x7f0c('0x2'),_0x7f0c('0x2'),_0x7f0c('0x4'),'BUSY',_0x7f0c('0x3'),'FAILED',_0x7f0c('0x3')];var channels={};function writeDB(_0x236529){utils['info'](util[_0x7f0c('0x5')](_0x7f0c('0x6'),_0x236529[_0x7f0c('0x7')],_0x236529[_0x7f0c('0x8')],_0x236529[_0x7f0c('0x9')],_0x236529[_0x7f0c('0xa')],_0x236529[_0x7f0c('0xb')],_0x236529[_0x7f0c('0xc')],_0x236529[_0x7f0c('0xd')],_0x236529[_0x7f0c('0xe')]));if(_0x236529['accountcode']){utils[_0x7f0c('0xf')](_0x236529[_0x7f0c('0xa')])[_0x7f0c('0x10')](function(_0x112920){if(_0x112920){_0x236529[_0x7f0c('0x11')]=_0x112920['id'];}utils['request'](_0x7f0c('0x12'),_0x236529);});}else{utils[_0x7f0c('0x13')](_0x7f0c('0x12'),_0x236529);}if(channels[_0x236529[_0x7f0c('0x7')]]){delete channels[_0x236529['uniqueid']];}}exports[_0x7f0c('0x14')]=function(_0x2f7c6b){try{if(_0x2f7c6b[_0x7f0c('0x7')]==_0x2f7c6b['linkedid']){channels[_0x2f7c6b[_0x7f0c('0x7')]]={'uniqueid':_0x2f7c6b[_0x7f0c('0x7')],'accountcode':_0x2f7c6b[_0x7f0c('0xa')],'source':_0x2f7c6b[_0x7f0c('0x15')],'destination':_0x2f7c6b['exten'],'destinationcontext':_0x2f7c6b[_0x7f0c('0x16')],'channel':_0x2f7c6b[_0x7f0c('0x8')],'starttime':utils[_0x7f0c('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7f0c('0x2'),'amaflags':_0x7f0c('0x18')};}}catch(_0x4583cd){utils[_0x7f0c('0x19')](_0x4583cd[_0x7f0c('0x1a')]);}};exports[_0x7f0c('0x1b')]=function(_0x55d0ab){try{if(!_['isNil'](channels[_0x55d0ab[_0x7f0c('0x7')]])&&_0x55d0ab['channelstate']==0x6){if(_[_0x7f0c('0x1c')](channels[_0x55d0ab[_0x7f0c('0x7')]][_0x7f0c('0x1d')])){channels[_0x55d0ab['uniqueid']][_0x7f0c('0x1d')]=utils[_0x7f0c('0x17')]();}}else if(!_[_0x7f0c('0x1c')](channels[_0x55d0ab[_0x7f0c('0x1e')]])&&_0x55d0ab[_0x7f0c('0x1f')]==0x6&&_0x55d0ab[_0x7f0c('0x16')]!=_0x7f0c('0x20')){channels[_0x55d0ab[_0x7f0c('0x1e')]][_0x7f0c('0xa')]=_0x55d0ab[_0x7f0c('0xa')];channels[_0x55d0ab['linkedid']][_0x7f0c('0x21')]=_0x55d0ab[_0x7f0c('0x8')];if(_[_0x7f0c('0x1c')](channels[_0x55d0ab[_0x7f0c('0x1e')]][_0x7f0c('0x22')])){channels[_0x55d0ab[_0x7f0c('0x1e')]][_0x7f0c('0x22')]=utils[_0x7f0c('0x17')]();}channels[_0x55d0ab[_0x7f0c('0x1e')]][_0x7f0c('0xe')]=dispositions[_['toNumber'](_0x55d0ab['channelstate'])]||_0x7f0c('0x4');}}catch(_0x3d3ef8){utils['error'](_0x3d3ef8[_0x7f0c('0x1a')]);}};exports[_0x7f0c('0x23')]=function(_0x58a000){try{if(!_[_0x7f0c('0x1c')](channels[_0x58a000[_0x7f0c('0x7')]])){channels[_0x58a000['uniqueid']]['callerid']='\x22'+_0x58a000[_0x7f0c('0x15')]+'\x22\x20<'+_0x58a000[_0x7f0c('0x24')]+'>';channels[_0x58a000[_0x7f0c('0x7')]][_0x7f0c('0x25')]=utils[_0x7f0c('0x17')]();channels[_0x58a000[_0x7f0c('0x7')]]['duration']=utils[_0x7f0c('0x26')](channels[_0x58a000['uniqueid']][_0x7f0c('0x25')],channels[_0x58a000[_0x7f0c('0x7')]][_0x7f0c('0x27')]);channels[_0x58a000[_0x7f0c('0x7')]]['billableseconds']=channels[_0x58a000[_0x7f0c('0x7')]][_0x7f0c('0x22')]?utils[_0x7f0c('0x26')](channels[_0x58a000[_0x7f0c('0x7')]]['endtime'],channels[_0x58a000['uniqueid']]['answertime']):0x0;writeDB(channels[_0x58a000[_0x7f0c('0x7')]]);}}catch(_0x1719df){utils[_0x7f0c('0x19')](_0x1719df['stack']);}};exports['attendedtransfer']=function(_0x3b5d02){try{if(!_['isNil'](channels[_0x3b5d02['localtwolinkedid']])){if(channels[_0x3b5d02[_0x7f0c('0x28')]]['channel']==_0x3b5d02['transfereechannel']){channels[_0x3b5d02[_0x7f0c('0x28')]][_0x7f0c('0x21')]=_0x3b5d02[_0x7f0c('0x29')];channels[_0x3b5d02['localtwolinkedid']][_0x7f0c('0x2a')]=_0x7f0c('0x2b');}else if(channels[_0x3b5d02[_0x7f0c('0x28')]][_0x7f0c('0x8')]=_0x3b5d02[_0x7f0c('0x2c')]){channels[_0x3b5d02[_0x7f0c('0x28')]]['destinationchannel']=_0x3b5d02[_0x7f0c('0x2d')];channels[_0x3b5d02[_0x7f0c('0x28')]][_0x7f0c('0x2a')]=_0x7f0c('0x2b');}}}catch(_0x5ea9b8){utils[_0x7f0c('0x19')](_0x5ea9b8[_0x7f0c('0x1a')]);}};exports['musiconholdstart']=function(_0x12fa8d){try{if(!_['isNil'](channels[_0x12fa8d[_0x7f0c('0x7')]])){channels[_0x12fa8d[_0x7f0c('0x7')]][_0x7f0c('0x2e')]=utils[_0x7f0c('0x17')]();}}catch(_0x163cdf){utils[_0x7f0c('0x19')](_0x163cdf['stack']);}};exports[_0x7f0c('0x2f')]=function(_0x57563b){try{if(!_['isNil'](channels[_0x57563b['uniqueid']])){if(!_[_0x7f0c('0x1c')](channels[_0x57563b[_0x7f0c('0x7')]][_0x7f0c('0x2e')])){channels[_0x57563b['uniqueid']][_0x7f0c('0x30')]+=utils['diffTime'](utils[_0x7f0c('0x17')](),channels[_0x57563b[_0x7f0c('0x7')]]['musiconholdstartAt']);delete channels[_0x57563b[_0x7f0c('0x7')]][_0x7f0c('0x2e')];}}}catch(_0x346861){utils[_0x7f0c('0x19')](_0x346861[_0x7f0c('0x1a')]);}};exports['varset']=function(_0x51605c){try{if(!_[_0x7f0c('0x1c')](channels[_0x51605c[_0x7f0c('0x7')]])){if(!_[_0x7f0c('0x1c')](_0x51605c[_0x7f0c('0x31')][_0x7f0c('0x32')])){channels[_0x51605c[_0x7f0c('0x7')]][_0x7f0c('0xb')]=_0x51605c['value'];}if(!_[_0x7f0c('0x1c')](_0x51605c[_0x7f0c('0x31')][_0x7f0c('0x33')])){channels[_0x51605c[_0x7f0c('0x7')]][_0x7f0c('0xc')]=_0x51605c[_0x7f0c('0x34')];}if(!_['isNil'](_0x51605c['variable'][_0x7f0c('0x35')])||!_[_0x7f0c('0x1c')](_0x51605c[_0x7f0c('0x31')][_0x7f0c('0x36')])){channels[_0x51605c['uniqueid']][_0x7f0c('0xd')]=_0x51605c[_0x7f0c('0x34')];}if(!_[_0x7f0c('0x1c')](_0x51605c[_0x7f0c('0x31')][_0x7f0c('0x37')])){channels[_0x51605c[_0x7f0c('0x7')]][_0x7f0c('0x38')]=_0x7f0c('0x39');channels[_0x51605c['uniqueid']][_0x7f0c('0x3a')]=_0x51605c[_0x7f0c('0x34')];channels[_0x51605c['uniqueid']][_0x7f0c('0x3b')]=!![];}if(!_['isNil'](_0x51605c['variable'][_0x7f0c('0x3c')])){channels[_0x51605c[_0x7f0c('0x7')]][_0x7f0c('0x3d')]=_0x51605c[_0x7f0c('0x34')];}if(!_[_0x7f0c('0x1c')](_0x51605c[_0x7f0c('0x31')]['outboundrouteid'])){channels[_0x51605c['uniqueid']][_0x7f0c('0x3e')]=_0x51605c[_0x7f0c('0x34')];}if(!_[_0x7f0c('0x1c')](_0x51605c[_0x7f0c('0x31')][_0x7f0c('0x3f')])){channels[_0x51605c[_0x7f0c('0x7')]][_0x7f0c('0x3f')]=_0x51605c[_0x7f0c('0x34')];}}}catch(_0x474d91){utils[_0x7f0c('0x19')](_0x474d91[_0x7f0c('0x1a')]);}};exports['newexten']=function(_0x4a6b56){try{if(!_['isNil'](channels[_0x4a6b56['uniqueid']])){if(_0x4a6b56[_0x7f0c('0x40')][_0x7f0c('0x41')]()==_0x7f0c('0x42')&&_['startsWith'](_0x4a6b56[_0x7f0c('0x43')][_0x7f0c('0x41')](),_0x7f0c('0x44'))){var _0x1dc9d4=_0x4a6b56[_0x7f0c('0x43')][_0x7f0c('0x45')]('=');var _0xaed84d=_0x1dc9d4[0x0][_0x7f0c('0x46')](_0x1dc9d4[0x0][_0x7f0c('0x47')]('(')+0x1,_0x1dc9d4[0x0]['lastIndexOf'](')'));var _0x4f26ac=_0x1dc9d4[0x1];channels[_0x4a6b56[_0x7f0c('0x7')]][_0xaed84d]=_0x4f26ac;}if(!_[_0x7f0c('0x48')](['hangup',_0x7f0c('0x49'),_0x7f0c('0x4a'),_0x7f0c('0x42'),_0x7f0c('0x4b')],_0x4a6b56['application'][_0x7f0c('0x41')]())){channels[_0x4a6b56[_0x7f0c('0x7')]][_0x7f0c('0x38')]=_0x4a6b56[_0x7f0c('0x40')];channels[_0x4a6b56[_0x7f0c('0x7')]]['lastdata']=_0x4a6b56['appdata'];}}}catch(_0x226196){utils[_0x7f0c('0x19')](_0x226196['stack']);}}; \ No newline at end of file +var _0x046f=['_attended','transfertargetchannel','origtransfererchannel','musiconholdstartAt','musiconholdstop','varset','value','xmd-phone','variable','xmd-callerid-preview','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','outboundrouteid','routeid','sipcallid','newexten','application','set','startsWith','appdata','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','type','accountcode','source','destination','disposition','getUserByInternal','then','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','calleridnum','context','channel','DOCUMENTATION','error','newstate','isNil','channelstate','systemanswertime','now','transfer','destinationchannel','answertime','stack','hangup','\x22\x20<','calleridname','duration','diffTime','endtime','billableseconds','attendedtransfer','localtwolinkedid','userfield'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x046f,0x1a2));var _0xf046=function(_0x2c3642,_0x5cd3a0){_0x2c3642=_0x2c3642-0x0;var _0x302dfc=_0x046f[_0x2c3642];return _0x302dfc;};'use strict';var _=require(_0xf046('0x0'));var util=require(_0xf046('0x1'));var utils=require('./utils');var dispositions=['NO\x20ANSWER',_0xf046('0x2'),_0xf046('0x2'),_0xf046('0x3'),_0xf046('0x3'),_0xf046('0x3'),_0xf046('0x4'),_0xf046('0x5'),_0xf046('0x2'),_0xf046('0x2'),'FAILED'];var channels={};function writeDB(_0x4b0016){utils[_0xf046('0x6')](util['format'](_0xf046('0x7'),_0x4b0016['uniqueid'],_0x4b0016['channel'],_0x4b0016[_0xf046('0x8')],_0x4b0016[_0xf046('0x9')],_0x4b0016[_0xf046('0xa')],_0x4b0016[_0xf046('0xb')],_0x4b0016['callerid'],_0x4b0016[_0xf046('0xc')]));if(_0x4b0016[_0xf046('0x9')]){utils[_0xf046('0xd')](_0x4b0016['accountcode'])[_0xf046('0xe')](function(_0x371243){if(_0x371243){_0x4b0016['UserId']=_0x371243['id'];}utils[_0xf046('0xf')](_0xf046('0x10'),_0x4b0016);});}else{utils[_0xf046('0xf')](_0xf046('0x10'),_0x4b0016);}if(channels[_0x4b0016[_0xf046('0x11')]]){delete channels[_0x4b0016[_0xf046('0x11')]];}}exports[_0xf046('0x12')]=function(_0x41f14d){try{if(_0x41f14d['uniqueid']==_0x41f14d[_0xf046('0x13')]){channels[_0x41f14d[_0xf046('0x11')]]={'uniqueid':_0x41f14d[_0xf046('0x11')],'accountcode':_0x41f14d[_0xf046('0x9')],'source':_0x41f14d[_0xf046('0x14')],'destination':_0x41f14d['exten'],'destinationcontext':_0x41f14d[_0xf046('0x15')],'channel':_0x41f14d[_0xf046('0x16')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf046('0x3'),'amaflags':_0xf046('0x17')};}}catch(_0x51d255){utils[_0xf046('0x18')](_0x51d255['stack']);}};exports[_0xf046('0x19')]=function(_0x4e8147){try{if(!_[_0xf046('0x1a')](channels[_0x4e8147['uniqueid']])&&_0x4e8147[_0xf046('0x1b')]==0x6){if(_[_0xf046('0x1a')](channels[_0x4e8147[_0xf046('0x11')]]['systemanswertime'])){channels[_0x4e8147['uniqueid']][_0xf046('0x1c')]=utils[_0xf046('0x1d')]();}}else if(!_[_0xf046('0x1a')](channels[_0x4e8147['linkedid']])&&_0x4e8147[_0xf046('0x1b')]==0x6&&_0x4e8147['context']!=_0xf046('0x1e')){channels[_0x4e8147[_0xf046('0x13')]][_0xf046('0x9')]=_0x4e8147[_0xf046('0x9')];channels[_0x4e8147[_0xf046('0x13')]][_0xf046('0x1f')]=_0x4e8147['channel'];if(_[_0xf046('0x1a')](channels[_0x4e8147[_0xf046('0x13')]][_0xf046('0x20')])){channels[_0x4e8147['linkedid']]['answertime']=utils[_0xf046('0x1d')]();}channels[_0x4e8147[_0xf046('0x13')]][_0xf046('0xc')]=dispositions[_['toNumber'](_0x4e8147[_0xf046('0x1b')])]||_0xf046('0x4');}}catch(_0x3c6f69){utils[_0xf046('0x18')](_0x3c6f69[_0xf046('0x21')]);}};exports[_0xf046('0x22')]=function(_0x327211){try{if(!_[_0xf046('0x1a')](channels[_0x327211[_0xf046('0x11')]])){channels[_0x327211[_0xf046('0x11')]]['callerid']='\x22'+_0x327211['calleridnum']+_0xf046('0x23')+_0x327211[_0xf046('0x24')]+'>';channels[_0x327211[_0xf046('0x11')]]['endtime']=utils[_0xf046('0x1d')]();channels[_0x327211[_0xf046('0x11')]][_0xf046('0x25')]=utils[_0xf046('0x26')](channels[_0x327211['uniqueid']][_0xf046('0x27')],channels[_0x327211[_0xf046('0x11')]]['starttime']);channels[_0x327211[_0xf046('0x11')]][_0xf046('0x28')]=channels[_0x327211[_0xf046('0x11')]][_0xf046('0x20')]?utils['diffTime'](channels[_0x327211[_0xf046('0x11')]][_0xf046('0x27')],channels[_0x327211[_0xf046('0x11')]][_0xf046('0x20')]):0x0;writeDB(channels[_0x327211[_0xf046('0x11')]]);}}catch(_0x49b972){utils[_0xf046('0x18')](_0x49b972[_0xf046('0x21')]);}};exports[_0xf046('0x29')]=function(_0xb7d18d){try{if(!_['isNil'](channels[_0xb7d18d[_0xf046('0x2a')]])){if(channels[_0xb7d18d['localtwolinkedid']][_0xf046('0x16')]==_0xb7d18d['transfereechannel']){channels[_0xb7d18d[_0xf046('0x2a')]]['destinationchannel']=_0xb7d18d['secondtransfererchannel'];channels[_0xb7d18d['localtwolinkedid']][_0xf046('0x2b')]=_0xf046('0x2c');}else if(channels[_0xb7d18d[_0xf046('0x2a')]][_0xf046('0x16')]=_0xb7d18d[_0xf046('0x2d')]){channels[_0xb7d18d[_0xf046('0x2a')]][_0xf046('0x1f')]=_0xb7d18d[_0xf046('0x2e')];channels[_0xb7d18d['localtwolinkedid']][_0xf046('0x2b')]='_attended';}}}catch(_0x55df02){utils['error'](_0x55df02[_0xf046('0x21')]);}};exports['musiconholdstart']=function(_0x4e293c){try{if(!_[_0xf046('0x1a')](channels[_0x4e293c[_0xf046('0x11')]])){channels[_0x4e293c[_0xf046('0x11')]][_0xf046('0x2f')]=utils['now']();}}catch(_0x3a9748){utils[_0xf046('0x18')](_0x3a9748[_0xf046('0x21')]);}};exports[_0xf046('0x30')]=function(_0xf7fd4a){try{if(!_[_0xf046('0x1a')](channels[_0xf7fd4a['uniqueid']])){if(!_[_0xf046('0x1a')](channels[_0xf7fd4a[_0xf046('0x11')]][_0xf046('0x2f')])){channels[_0xf7fd4a[_0xf046('0x11')]]['mohtime']+=utils[_0xf046('0x26')](utils[_0xf046('0x1d')](),channels[_0xf7fd4a[_0xf046('0x11')]][_0xf046('0x2f')]);delete channels[_0xf7fd4a[_0xf046('0x11')]]['musiconholdstartAt'];}}}catch(_0x525fe5){utils['error'](_0x525fe5['stack']);}};exports[_0xf046('0x31')]=function(_0x33a953){try{if(!_[_0xf046('0x1a')](channels[_0x33a953[_0xf046('0x11')]])){if(!_[_0xf046('0x1a')](_0x33a953['variable']['xmd-originatecalleridnum'])){channels[_0x33a953[_0xf046('0x11')]]['source']=_0x33a953[_0xf046('0x32')];}if(!_[_0xf046('0x1a')](_0x33a953['variable'][_0xf046('0x33')])){channels[_0x33a953['uniqueid']]['destination']=_0x33a953[_0xf046('0x32')];}if(!_[_0xf046('0x1a')](_0x33a953[_0xf046('0x34')][_0xf046('0x35')])||!_[_0xf046('0x1a')](_0x33a953[_0xf046('0x34')]['xmd-callerid'])){channels[_0x33a953['uniqueid']]['callerid']=_0x33a953[_0xf046('0x32')];}if(!_[_0xf046('0x1a')](_0x33a953[_0xf046('0x34')][_0xf046('0x36')])){channels[_0x33a953[_0xf046('0x11')]][_0xf046('0x37')]=_0xf046('0x38');channels[_0x33a953[_0xf046('0x11')]][_0xf046('0x39')]=_0x33a953[_0xf046('0x32')];channels[_0x33a953['uniqueid']][_0xf046('0x3a')]=!![];}if(!_[_0xf046('0x1a')](_0x33a953[_0xf046('0x34')][_0xf046('0x3b')])){channels[_0x33a953[_0xf046('0x11')]]['ContactId']=_0x33a953[_0xf046('0x32')];}if(!_[_0xf046('0x1a')](_0x33a953['variable'][_0xf046('0x3c')])){channels[_0x33a953[_0xf046('0x11')]][_0xf046('0x3d')]=_0x33a953[_0xf046('0x32')];}if(!_[_0xf046('0x1a')](_0x33a953['variable'][_0xf046('0x3e')])){channels[_0x33a953['uniqueid']]['sipcallid']=_0x33a953[_0xf046('0x32')];}}}catch(_0x6b28e){utils['error'](_0x6b28e['stack']);}};exports[_0xf046('0x3f')]=function(_0x1d7173){try{if(!_['isNil'](channels[_0x1d7173['uniqueid']])){if(_0x1d7173[_0xf046('0x40')]['toLowerCase']()==_0xf046('0x41')&&_[_0xf046('0x42')](_0x1d7173[_0xf046('0x43')][_0xf046('0x44')](),_0xf046('0x45'))){var _0x452620=_0x1d7173[_0xf046('0x43')][_0xf046('0x46')]('=');var _0x23d224=_0x452620[0x0][_0xf046('0x47')](_0x452620[0x0][_0xf046('0x48')]('(')+0x1,_0x452620[0x0][_0xf046('0x48')](')'));var _0x1c657d=_0x452620[0x1];channels[_0x1d7173[_0xf046('0x11')]][_0x23d224]=_0x1c657d;}if(!_[_0xf046('0x49')](['hangup',_0xf046('0x4a'),_0xf046('0x4b'),_0xf046('0x41'),_0xf046('0x4c')],_0x1d7173[_0xf046('0x40')]['toLowerCase']())){channels[_0x1d7173['uniqueid']][_0xf046('0x37')]=_0x1d7173[_0xf046('0x40')];channels[_0x1d7173[_0xf046('0x11')]][_0xf046('0x39')]=_0x1d7173[_0xf046('0x43')];}}}catch(_0x2da8f2){utils['error'](_0x2da8f2['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index ed1d40a..3b7f16e 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 _0x5a5a=['SHUTDOWN','fullybooted','error','CLOSE','managerevent','lodash','connect','info','CONNECTED','shutdown'];(function(_0xca95cd,_0x143af0){var _0x511417=function(_0x1a52c6){while(--_0x1a52c6){_0xca95cd['push'](_0xca95cd['shift']());}};_0x511417(++_0x143af0);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0xb02766,_0xa37d90){_0xb02766=_0xb02766-0x0;var _0x560e6c=_0x5a5a[_0xb02766];return _0x560e6c;};'use strict';var utils=require('./utils');var _=require(_0xa5a5('0x0'));exports[_0xa5a5('0x1')]=function(){utils[_0xa5a5('0x2')](_0xa5a5('0x3'));};exports[_0xa5a5('0x4')]=function(){utils['info'](_0xa5a5('0x5'));};exports[_0xa5a5('0x6')]=function(){utils[_0xa5a5('0x2')]('FULLYBOOTED');};exports['error']=function(_0x43943d){utils[_0xa5a5('0x7')](_0x43943d);};exports['close']=function(){utils[_0xa5a5('0x2')](_0xa5a5('0x8'));};exports[_0xa5a5('0x9')]=function(_0x3a23f4){}; \ No newline at end of file +var _0x9b67=['CONNECTED','SHUTDOWN','FULLYBOOTED','error','close','CLOSE','./utils','lodash','connect','info'];(function(_0x2eba60,_0x3c47b5){var _0x321797=function(_0x474202){while(--_0x474202){_0x2eba60['push'](_0x2eba60['shift']());}};_0x321797(++_0x3c47b5);}(_0x9b67,0xf6));var _0x79b6=function(_0x32b11b,_0x5a0ed5){_0x32b11b=_0x32b11b-0x0;var _0xb50870=_0x9b67[_0x32b11b];return _0xb50870;};'use strict';var utils=require(_0x79b6('0x0'));var _=require(_0x79b6('0x1'));exports[_0x79b6('0x2')]=function(){utils[_0x79b6('0x3')](_0x79b6('0x4'));};exports['shutdown']=function(){utils[_0x79b6('0x3')](_0x79b6('0x5'));};exports['fullybooted']=function(){utils['info'](_0x79b6('0x6'));};exports[_0x79b6('0x7')]=function(_0x258103){utils[_0x79b6('0x7')](_0x258103);};exports[_0x79b6('0x8')]=function(){utils[_0x79b6('0x3')](_0x79b6('0x9'));};exports['managerevent']=function(_0x1270a7){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index cac783b..33f0970 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 _0xace2=['newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','isNil','variable','outboundrouteid','value','stack','dialbegin','starttime','now','called','dialend','ANSWER','answertime','hangup','assign','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xace2,0xb9));var _0x2ace=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0xace2[_0x255c48];return _0xaebda3;};'use strict';var _=require(_0x2ace('0x0'));var util=require(_0x2ace('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x27ade5){utils['info'](util[_0x2ace('0x2')](_0x2ace('0x3'),_0x27ade5[_0x2ace('0x4')],_0x27ade5[_0x2ace('0x5')],_0x27ade5['dialstring'],_0x27ade5[_0x2ace('0x6')],_0x27ade5[_0x2ace('0x7')],_0x27ade5[_0x2ace('0x8')]));utils[_0x2ace('0x9')]('CreateVoiceDialReport',_0x27ade5);delete dials[_0x27ade5[_0x2ace('0x4')]];}exports[_0x2ace('0xa')]=function(_0x4a0a2c){try{if(_0x4a0a2c[_0x2ace('0xb')][_0x2ace('0xc')]()==_0x2ace('0xd')&&_[_0x2ace('0xe')](_0x4a0a2c[_0x2ace('0xf')][_0x2ace('0xc')](),_0x2ace('0x10'))){var _0x493b68=_0x4a0a2c[_0x2ace('0xf')][_0x2ace('0x11')]('=');dials[_0x4a0a2c[_0x2ace('0x4')]]={'routeId':_0x493b68[0x1]};}}catch(_0x167a71){utils[_0x2ace('0x12')](_0x167a71['stack']);}};exports['varset']=function(_0x542a5a){try{if(!_[_0x2ace('0x13')](_0x542a5a[_0x2ace('0x14')][_0x2ace('0x15')])){dials[_0x542a5a[_0x2ace('0x4')]]={'routeId':_0x542a5a[_0x2ace('0x16')]};}}catch(_0x4526bf){utils[_0x2ace('0x12')](_0x4526bf[_0x2ace('0x17')]);}};exports[_0x2ace('0x18')]=function(_0x2ea4b1){try{if(!_[_0x2ace('0x13')](dials[_0x2ea4b1[_0x2ace('0x4')]])){dials[_0x2ea4b1[_0x2ace('0x4')]]=_['assign'](dials[_0x2ea4b1[_0x2ace('0x4')]],_0x2ea4b1);dials[_0x2ea4b1[_0x2ace('0x4')]][_0x2ace('0x19')]=utils[_0x2ace('0x1a')]();dials[_0x2ea4b1[_0x2ace('0x4')]]['lastevent']=_0x2ace('0x1b');}}catch(_0x10e9f3){utils['error'](_0x10e9f3['stack']);}};exports[_0x2ace('0x1c')]=function(_0x1404ef){try{if(!_[_0x2ace('0x13')](dials[_0x1404ef[_0x2ace('0x4')]])){dials[_0x1404ef['uniqueid']][_0x2ace('0x8')]=_0x1404ef[_0x2ace('0x8')];if(_0x1404ef[_0x2ace('0x8')]==_0x2ace('0x1d')){dials[_0x1404ef[_0x2ace('0x4')]]=_['assign'](dials[_0x1404ef[_0x2ace('0x4')]],_0x1404ef);dials[_0x1404ef[_0x2ace('0x4')]][_0x2ace('0x1e')]=utils[_0x2ace('0x1a')]();dials[_0x1404ef[_0x2ace('0x4')]]['lastevent']='connect';}}}catch(_0x2119e2){utils[_0x2ace('0x12')](_0x2119e2[_0x2ace('0x17')]);}};exports[_0x2ace('0x1f')]=function(_0x56d7bf){try{if(!_[_0x2ace('0x13')](dials[_0x56d7bf[_0x2ace('0x4')]])){dials[_0x56d7bf[_0x2ace('0x4')]]=_[_0x2ace('0x20')](dials[_0x56d7bf[_0x2ace('0x4')]],{'endtime':utils[_0x2ace('0x1a')](),'lastevent':_0x2ace('0x21')});dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x22')]=utils[_0x2ace('0x23')](dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x24')],dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x19')]);dials[_0x56d7bf['uniqueid']][_0x2ace('0x25')]=utils[_0x2ace('0x23')](dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x1e')]||dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x24')],dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x19')]);dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x26')]=dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x1e')]?utils[_0x2ace('0x23')](dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x24')],dials[_0x56d7bf[_0x2ace('0x4')]][_0x2ace('0x1e')]):0x0;writeDB(dials[_0x56d7bf['uniqueid']]);}}catch(_0x42d5ed){utils['error'](_0x42d5ed[_0x2ace('0x17')]);}}; \ No newline at end of file +var _0x0016=['now','called','dialend','isNil','ANSWER','answertime','lastevent','hangup','complete','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','appdata','cdr(routeid)','split','error','stack','varset','value','dialbegin','assign','starttime'];(function(_0x418fa3,_0x464468){var _0x845083=function(_0x12b8ae){while(--_0x12b8ae){_0x418fa3['push'](_0x418fa3['shift']());}};_0x845083(++_0x464468);}(_0x0016,0xeb));var _0x6001=function(_0x75ce5b,_0x3b582f){_0x75ce5b=_0x75ce5b-0x0;var _0x22195e=_0x0016[_0x75ce5b];return _0x22195e;};'use strict';var _=require(_0x6001('0x0'));var util=require('util');var utils=require(_0x6001('0x1'));var dials={};function writeDB(_0x546d6e){utils[_0x6001('0x2')](util[_0x6001('0x3')](_0x6001('0x4'),_0x546d6e[_0x6001('0x5')],_0x546d6e[_0x6001('0x6')],_0x546d6e['dialstring'],_0x546d6e[_0x6001('0x7')],_0x546d6e['connectedlinenum'],_0x546d6e[_0x6001('0x8')]));utils[_0x6001('0x9')](_0x6001('0xa'),_0x546d6e);delete dials[_0x546d6e[_0x6001('0x5')]];}exports[_0x6001('0xb')]=function(_0x33b677){try{if(_0x33b677[_0x6001('0xc')][_0x6001('0xd')]()=='set'&&_['startsWith'](_0x33b677[_0x6001('0xe')]['toLowerCase'](),_0x6001('0xf'))){var _0x475502=_0x33b677[_0x6001('0xe')][_0x6001('0x10')]('=');dials[_0x33b677['uniqueid']]={'routeId':_0x475502[0x1]};}}catch(_0x3cb4e1){utils[_0x6001('0x11')](_0x3cb4e1[_0x6001('0x12')]);}};exports[_0x6001('0x13')]=function(_0x1ec145){try{if(!_['isNil'](_0x1ec145['variable']['outboundrouteid'])){dials[_0x1ec145[_0x6001('0x5')]]={'routeId':_0x1ec145[_0x6001('0x14')]};}}catch(_0x2f0de2){utils[_0x6001('0x11')](_0x2f0de2[_0x6001('0x12')]);}};exports[_0x6001('0x15')]=function(_0x160426){try{if(!_['isNil'](dials[_0x160426[_0x6001('0x5')]])){dials[_0x160426[_0x6001('0x5')]]=_[_0x6001('0x16')](dials[_0x160426[_0x6001('0x5')]],_0x160426);dials[_0x160426[_0x6001('0x5')]][_0x6001('0x17')]=utils[_0x6001('0x18')]();dials[_0x160426['uniqueid']]['lastevent']=_0x6001('0x19');}}catch(_0x48eadd){utils['error'](_0x48eadd[_0x6001('0x12')]);}};exports[_0x6001('0x1a')]=function(_0x3ae269){try{if(!_[_0x6001('0x1b')](dials[_0x3ae269[_0x6001('0x5')]])){dials[_0x3ae269['uniqueid']][_0x6001('0x8')]=_0x3ae269['dialstatus'];if(_0x3ae269['dialstatus']==_0x6001('0x1c')){dials[_0x3ae269[_0x6001('0x5')]]=_[_0x6001('0x16')](dials[_0x3ae269[_0x6001('0x5')]],_0x3ae269);dials[_0x3ae269[_0x6001('0x5')]][_0x6001('0x1d')]=utils[_0x6001('0x18')]();dials[_0x3ae269[_0x6001('0x5')]][_0x6001('0x1e')]='connect';}}}catch(_0x4925b3){utils[_0x6001('0x11')](_0x4925b3[_0x6001('0x12')]);}};exports[_0x6001('0x1f')]=function(_0x24fe95){try{if(!_['isNil'](dials[_0x24fe95['uniqueid']])){dials[_0x24fe95[_0x6001('0x5')]]=_[_0x6001('0x16')](dials[_0x24fe95[_0x6001('0x5')]],{'endtime':utils[_0x6001('0x18')](),'lastevent':_0x6001('0x20')});dials[_0x24fe95[_0x6001('0x5')]]['duration']=utils[_0x6001('0x21')](dials[_0x24fe95['uniqueid']][_0x6001('0x22')],dials[_0x24fe95[_0x6001('0x5')]][_0x6001('0x17')]);dials[_0x24fe95[_0x6001('0x5')]][_0x6001('0x23')]=utils[_0x6001('0x21')](dials[_0x24fe95['uniqueid']][_0x6001('0x1d')]||dials[_0x24fe95[_0x6001('0x5')]][_0x6001('0x22')],dials[_0x24fe95[_0x6001('0x5')]][_0x6001('0x17')]);dials[_0x24fe95[_0x6001('0x5')]][_0x6001('0x24')]=dials[_0x24fe95['uniqueid']]['answertime']?utils[_0x6001('0x21')](dials[_0x24fe95['uniqueid']][_0x6001('0x22')],dials[_0x24fe95[_0x6001('0x5')]][_0x6001('0x1d')]):0x0;writeDB(dials[_0x24fe95[_0x6001('0x5')]]);}}catch(_0x3d278f){utils[_0x6001('0x11')](_0x3d278f['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 58d35be..b123c2f 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 _0xd8b0=['newexten','newchannel','dialbegin','asterisk-manager','../../config/environment','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','port','asterisk','password','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};var AsteriskManager=require(_0x0d8b('0x0'));var config=require(_0x0d8b('0x1'));var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x0d8b('0x2'));var members=require(_0x0d8b('0x3'));var dials=require(_0x0d8b('0x4'));var transfers=require(_0x0d8b('0x5'));var core=require(_0x0d8b('0x6'));var utils=require('./utils');var ami=new AsteriskManager(config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x8')]['ip'],config[_0x0d8b('0x8')]['username'],config[_0x0d8b('0x8')][_0x0d8b('0x9')],!![]);ami['keepConnected']();ami['on'](_0x0d8b('0xa'),core[_0x0d8b('0xa')]);ami['on'](_0x0d8b('0xb'),core[_0x0d8b('0xb')]);ami['on'](_0x0d8b('0xc'),core[_0x0d8b('0xc')]);ami['on'](_0x0d8b('0xd'),core[_0x0d8b('0xd')]);ami['on']('close',core[_0x0d8b('0xe')]);ami['on']('managerevent',core[_0x0d8b('0xf')]);ami['on'](_0x0d8b('0x10'),function(_0x340cc4){try{members[_0x0d8b('0x10')](_0x340cc4);}catch(_0x35a07b){utils[_0x0d8b('0xd')](_0x35a07b);}});ami['on'](_0x0d8b('0x11'),function(_0x31a8cc){try{agents[_0x0d8b('0x11')](_0x31a8cc);}catch(_0x2ce75e){utils[_0x0d8b('0xd')](_0x2ce75e);}});ami['on'](_0x0d8b('0x12'),function(_0x1567ce){try{agents[_0x0d8b('0x12')](_0x1567ce);}catch(_0x4f6f21){utils[_0x0d8b('0xd')](_0x4f6f21);}});ami['on'](_0x0d8b('0x13'),function(_0x17f7df){try{agents[_0x0d8b('0x13')](_0x17f7df);queues[_0x0d8b('0x13')](_0x17f7df);}catch(_0x5cd485){utils[_0x0d8b('0xd')](_0x5cd485);}});ami['on'](_0x0d8b('0x14'),function(_0x2fd0fc){try{agents[_0x0d8b('0x14')](_0x2fd0fc);queues[_0x0d8b('0x14')](_0x2fd0fc);members[_0x0d8b('0x14')](_0x2fd0fc);}catch(_0x264b39){utils[_0x0d8b('0xd')](_0x264b39);}});ami['on']('queuecallerabandon',function(_0x27512e){try{agents[_0x0d8b('0x15')](_0x27512e);queues[_0x0d8b('0x15')](_0x27512e);}catch(_0x143372){utils[_0x0d8b('0xd')](_0x143372);}});ami['on'](_0x0d8b('0x16'),function(_0x393beb){try{queues[_0x0d8b('0x16')](_0x393beb);recordings['queuecallerjoin'](_0x393beb);}catch(_0x4f0a1a){utils[_0x0d8b('0xd')](_0x4f0a1a);}});ami['on']('queuecallerleave',function(_0x56c729){try{queues['queuecallerleave'](_0x56c729);}catch(_0x238728){utils[_0x0d8b('0xd')](_0x238728);}});ami['on'](_0x0d8b('0x17'),function(_0x38efc8){try{queues[_0x0d8b('0x17')](_0x38efc8);calls[_0x0d8b('0x17')](_0x38efc8);}catch(_0x30980c){utils[_0x0d8b('0xd')](_0x30980c);}});ami['on'](_0x0d8b('0x18'),function(_0x5e5bc3){try{queues[_0x0d8b('0x18')](_0x5e5bc3);calls[_0x0d8b('0x18')](_0x5e5bc3);}catch(_0x5363e3){utils[_0x0d8b('0xd')](_0x5363e3);}});ami['on']('newstate',function(_0x3dd149){try{calls[_0x0d8b('0x19')](_0x3dd149);recordings[_0x0d8b('0x19')](_0x3dd149);}catch(_0x4fe6f9){utils['error'](_0x4fe6f9);}});ami['on'](_0x0d8b('0x1a'),function(_0x3ef745){try{calls['hangup'](_0x3ef745);recordings[_0x0d8b('0x1a')](_0x3ef745);dials['hangup'](_0x3ef745);agents[_0x0d8b('0x1a')](_0x3ef745);queues['hangup'](_0x3ef745);}catch(_0x97050a){utils['error'](_0x97050a);}});ami['on'](_0x0d8b('0x1b'),function(_0x546bf6){try{members[_0x0d8b('0x1b')](_0x546bf6);}catch(_0x544735){utils[_0x0d8b('0xd')](_0x544735);}});ami['on'](_0x0d8b('0x1c'),function(_0x2c058d){try{queues['blindtransfer'](_0x2c058d);agents['blindtransfer'](_0x2c058d);transfers['blindtransfer'](_0x2c058d);}catch(_0x4e8992){utils['error'](_0x4e8992);}});ami['on'](_0x0d8b('0x1d'),function(_0x54f6f3){try{queues['attendedtransfer'](_0x54f6f3);transfers[_0x0d8b('0x1d')](_0x54f6f3);agents[_0x0d8b('0x1d')](_0x54f6f3);calls[_0x0d8b('0x1d')](_0x54f6f3);}catch(_0xdeee5d){utils[_0x0d8b('0xd')](_0xdeee5d);}});ami['on'](_0x0d8b('0x1e'),function(_0x4a99d3){try{queues[_0x0d8b('0x1e')](_0x4a99d3);recordings['varset'](_0x4a99d3);calls[_0x0d8b('0x1e')](_0x4a99d3);dials[_0x0d8b('0x1e')](_0x4a99d3);}catch(_0x4b3ea0){utils[_0x0d8b('0xd')](_0x4b3ea0);}});ami['on'](_0x0d8b('0x1f'),function(_0x18a905){try{calls['newexten'](_0x18a905);recordings[_0x0d8b('0x1f')](_0x18a905);dials[_0x0d8b('0x1f')](_0x18a905);}catch(_0x206157){utils[_0x0d8b('0xd')](_0x206157);}});ami['on'](_0x0d8b('0x20'),function(_0x55d742){try{calls[_0x0d8b('0x20')](_0x55d742);recordings[_0x0d8b('0x20')](_0x55d742);}catch(_0x5ad0fe){utils[_0x0d8b('0xd')](_0x5ad0fe);}});ami['on'](_0x0d8b('0x21'),function(_0x188af2){try{dials[_0x0d8b('0x21')](_0x188af2);}catch(_0x373544){utils['error'](_0x373544);}});ami['on']('dialend',function(_0x41b4f9){try{dials['dialend'](_0x41b4f9);}catch(_0x531c55){utils[_0x0d8b('0xd')](_0x531c55);}}); \ No newline at end of file +var _0x0b0e=['dialend','asterisk-manager','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','./utils','asterisk','port','password','keepConnected','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x0b0e[_0x22f8ab];return _0x2a70e5;};var AsteriskManager=require(_0xe0b0('0x0'));var config=require('../../config/environment');var agents=require(_0xe0b0('0x1'));var calls=require('./calls.controller');var queues=require(_0xe0b0('0x2'));var recordings=require(_0xe0b0('0x3'));var members=require(_0xe0b0('0x4'));var dials=require(_0xe0b0('0x5'));var transfers=require(_0xe0b0('0x6'));var core=require(_0xe0b0('0x7'));var utils=require(_0xe0b0('0x8'));var ami=new AsteriskManager(config[_0xe0b0('0x9')][_0xe0b0('0xa')],config[_0xe0b0('0x9')]['ip'],config[_0xe0b0('0x9')]['username'],config['asterisk'][_0xe0b0('0xb')],!![]);ami[_0xe0b0('0xc')]();ami['on'](_0xe0b0('0xd'),core[_0xe0b0('0xd')]);ami['on']('shutdown',core[_0xe0b0('0xe')]);ami['on'](_0xe0b0('0xf'),core['fullybooted']);ami['on'](_0xe0b0('0x10'),core[_0xe0b0('0x10')]);ami['on']('close',core[_0xe0b0('0x11')]);ami['on'](_0xe0b0('0x12'),core[_0xe0b0('0x12')]);ami['on']('devicestatechange',function(_0x3068c0){try{members[_0xe0b0('0x13')](_0x3068c0);}catch(_0x3cc19a){utils[_0xe0b0('0x10')](_0x3cc19a);}});ami['on'](_0xe0b0('0x14'),function(_0x4d2bf7){try{agents[_0xe0b0('0x14')](_0x4d2bf7);}catch(_0x154de6){utils[_0xe0b0('0x10')](_0x154de6);}});ami['on'](_0xe0b0('0x15'),function(_0x177c24){try{agents['agentringnoanswer'](_0x177c24);}catch(_0x41a7e2){utils['error'](_0x41a7e2);}});ami['on'](_0xe0b0('0x16'),function(_0xadee6e){try{agents['agentconnect'](_0xadee6e);queues[_0xe0b0('0x16')](_0xadee6e);}catch(_0x4a4cc0){utils[_0xe0b0('0x10')](_0x4a4cc0);}});ami['on'](_0xe0b0('0x17'),function(_0x56bcc7){try{agents['agentcomplete'](_0x56bcc7);queues[_0xe0b0('0x17')](_0x56bcc7);members['agentcomplete'](_0x56bcc7);}catch(_0x4df8da){utils['error'](_0x4df8da);}});ami['on'](_0xe0b0('0x18'),function(_0x50fa4a){try{agents['queuecallerabandon'](_0x50fa4a);queues[_0xe0b0('0x18')](_0x50fa4a);}catch(_0x59dff5){utils[_0xe0b0('0x10')](_0x59dff5);}});ami['on']('queuecallerjoin',function(_0x2c84cc){try{queues[_0xe0b0('0x19')](_0x2c84cc);recordings[_0xe0b0('0x19')](_0x2c84cc);}catch(_0x310a6d){utils[_0xe0b0('0x10')](_0x310a6d);}});ami['on']('queuecallerleave',function(_0x4cae54){try{queues[_0xe0b0('0x1a')](_0x4cae54);}catch(_0x5512bb){utils[_0xe0b0('0x10')](_0x5512bb);}});ami['on'](_0xe0b0('0x1b'),function(_0x513e63){try{queues[_0xe0b0('0x1b')](_0x513e63);calls['musiconholdstart'](_0x513e63);}catch(_0x2208d0){utils['error'](_0x2208d0);}});ami['on'](_0xe0b0('0x1c'),function(_0x576352){try{queues[_0xe0b0('0x1c')](_0x576352);calls['musiconholdstop'](_0x576352);}catch(_0x4700cc){utils['error'](_0x4700cc);}});ami['on'](_0xe0b0('0x1d'),function(_0x5c5317){try{calls[_0xe0b0('0x1d')](_0x5c5317);recordings[_0xe0b0('0x1d')](_0x5c5317);}catch(_0x1f1ebd){utils[_0xe0b0('0x10')](_0x1f1ebd);}});ami['on'](_0xe0b0('0x1e'),function(_0x10745d){try{calls['hangup'](_0x10745d);recordings[_0xe0b0('0x1e')](_0x10745d);dials[_0xe0b0('0x1e')](_0x10745d);agents['hangup'](_0x10745d);queues[_0xe0b0('0x1e')](_0x10745d);}catch(_0x419b1f){utils[_0xe0b0('0x10')](_0x419b1f);}});ami['on'](_0xe0b0('0x1f'),function(_0x3cdbd5){try{members[_0xe0b0('0x1f')](_0x3cdbd5);}catch(_0x136bd4){utils['error'](_0x136bd4);}});ami['on'](_0xe0b0('0x20'),function(_0x3c0109){try{queues['blindtransfer'](_0x3c0109);agents['blindtransfer'](_0x3c0109);transfers[_0xe0b0('0x20')](_0x3c0109);}catch(_0x33e672){utils[_0xe0b0('0x10')](_0x33e672);}});ami['on'](_0xe0b0('0x21'),function(_0x2ab1b1){try{queues['attendedtransfer'](_0x2ab1b1);transfers[_0xe0b0('0x21')](_0x2ab1b1);agents[_0xe0b0('0x21')](_0x2ab1b1);calls[_0xe0b0('0x21')](_0x2ab1b1);}catch(_0x29d725){utils[_0xe0b0('0x10')](_0x29d725);}});ami['on']('varset',function(_0x3ebf2a){try{queues[_0xe0b0('0x22')](_0x3ebf2a);recordings[_0xe0b0('0x22')](_0x3ebf2a);calls[_0xe0b0('0x22')](_0x3ebf2a);dials[_0xe0b0('0x22')](_0x3ebf2a);}catch(_0x12eeb8){utils[_0xe0b0('0x10')](_0x12eeb8);}});ami['on'](_0xe0b0('0x23'),function(_0x2125d5){try{calls[_0xe0b0('0x23')](_0x2125d5);recordings[_0xe0b0('0x23')](_0x2125d5);dials[_0xe0b0('0x23')](_0x2125d5);}catch(_0x1d35bc){utils[_0xe0b0('0x10')](_0x1d35bc);}});ami['on'](_0xe0b0('0x24'),function(_0x4cf80c){try{calls[_0xe0b0('0x24')](_0x4cf80c);recordings[_0xe0b0('0x24')](_0x4cf80c);}catch(_0xace58a){utils[_0xe0b0('0x10')](_0xace58a);}});ami['on'](_0xe0b0('0x25'),function(_0x2c6e60){try{dials[_0xe0b0('0x25')](_0x2c6e60);}catch(_0x533fc7){utils['error'](_0x533fc7);}});ami['on']('dialend',function(_0x5317df){try{dials[_0xe0b0('0x26')](_0x5317df);}catch(_0xc3d967){utils[_0xe0b0('0x10')](_0xc3d967);}}); \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 83862b6..e35be23 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 _0x7c0f=['agentcomplete','queue','cdr','assign','data1','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','channel','data2','type','interface','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','startsWith','devicestatechange','INUSE','BUSY','device','voice','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt'];(function(_0xc0038b,_0x368bff){var _0x4a0358=function(_0x19673e){while(--_0x19673e){_0xc0038b['push'](_0xc0038b['shift']());}};_0x4a0358(++_0x368bff);}(_0x7c0f,0x1a7));var _0xf7c0=function(_0x2501f0,_0x30a6df){_0x2501f0=_0x2501f0-0x0;var _0x53c30e=_0x7c0f[_0x2501f0];return _0x53c30e;};'use strict';var _=require(_0xf7c0('0x0'));var util=require(_0xf7c0('0x1'));var utils=require(_0xf7c0('0x2'));var members={};var exclude=[_0xf7c0('0x3'),_0xf7c0('0x4')];function writeDB(_0x38df8d){utils[_0xf7c0('0x5')](util[_0xf7c0('0x6')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x38df8d[_0xf7c0('0x7')],_0x38df8d['interface'],_0x38df8d[_0xf7c0('0x8')],_0x38df8d[_0xf7c0('0x9')],_0x38df8d['membername'],_0x38df8d[_0xf7c0('0xa')]));if(_0x38df8d[_0xf7c0('0xb')]){utils[_0xf7c0('0xc')](_0x38df8d[_0xf7c0('0xb')])[_0xf7c0('0xd')](function(_0x4e2813){if(_0x4e2813){_0x38df8d[_0xf7c0('0xe')]=_0x4e2813[_0xf7c0('0xf')];_0x38df8d[_0xf7c0('0x10')]=_0x4e2813[_0xf7c0('0x10')];utils[_0xf7c0('0x11')](_0xf7c0('0x12'),_0x38df8d);}else{utils[_0xf7c0('0x13')](_0x38df8d[_0xf7c0('0xb')][_0xf7c0('0x14')]('/')[0x1])[_0xf7c0('0xd')](function(_0xb071bd){if(_0xb071bd){_0x38df8d[_0xf7c0('0xe')]=_0xb071bd['name'];_0x38df8d[_0xf7c0('0x10')]=_0xb071bd['internal'];utils[_0xf7c0('0x11')](_0xf7c0('0x12'),_0x38df8d);}});}})[_0xf7c0('0x15')](function(_0x3dfe32){utils[_0xf7c0('0x16')](_0x3dfe32);});}delete members[_0x38df8d[_0xf7c0('0xb')]];}function startsWith(_0x951603,_0xc8c470){return _[_0xf7c0('0x17')](_0x951603,function(_0x1eb691){return _[_0xf7c0('0x18')](_0xc8c470,_0x1eb691);});}exports[_0xf7c0('0x19')]=function(_0x3d9bdb){switch(_0x3d9bdb['state']){case _0xf7c0('0x1a'):case _0xf7c0('0x1b'):if(!startsWith(exclude,_0x3d9bdb[_0xf7c0('0x1c')])){members[_0x3d9bdb[_0xf7c0('0x1c')]]={'channel':_0xf7c0('0x1d'),'interface':_0x3d9bdb[_0xf7c0('0x1c')],'type':'TALKING','enterAt':utils[_0xf7c0('0x1e')](),'role':'agent'};}break;case _0xf7c0('0x1f'):if(!_[_0xf7c0('0x20')](members[_0x3d9bdb[_0xf7c0('0x1c')]])){members[_0x3d9bdb[_0xf7c0('0x1c')]][_0xf7c0('0x21')]=utils['now']();members[_0x3d9bdb['device']][_0xf7c0('0x22')]=utils[_0xf7c0('0x23')](members[_0x3d9bdb[_0xf7c0('0x1c')]][_0xf7c0('0x21')],members[_0x3d9bdb[_0xf7c0('0x1c')]][_0xf7c0('0x24')]);if(members[_0x3d9bdb[_0xf7c0('0x1c')]][_0xf7c0('0x7')]){writeDB(members[_0x3d9bdb[_0xf7c0('0x1c')]]);}}default:break;}};exports[_0xf7c0('0x25')]=function(_0x2d804d){if(!_[_0xf7c0('0x20')](members[_0x2d804d['interface']])){members[_0x2d804d[_0xf7c0('0xb')]]=_['assign'](members[_0x2d804d[_0xf7c0('0xb')]],{'data4':_0x2d804d[_0xf7c0('0x26')],'uniqueid':_0x2d804d[_0xf7c0('0x7')]});}};exports[_0xf7c0('0x27')]=function(_0x35cf9c){if(_0x35cf9c[_0xf7c0('0x8')]){var _0x3fdbb0=_0x35cf9c[_0xf7c0('0x8')][_0xf7c0('0x14')]('-')[0x0];if(!_['isNil'](members[_0x3fdbb0])){members[_0x3fdbb0]=_[_0xf7c0('0x28')](members[_0x3fdbb0],{'data1':members[_0x3fdbb0][_0xf7c0('0x29')]||_0x35cf9c['type'],'data2':members[_0x3fdbb0]['data2']||_0x35cf9c[_0xf7c0('0x2a')],'data3':members[_0x3fdbb0][_0xf7c0('0x2b')]||_0x35cf9c[_0xf7c0('0x2c')],'uniqueid':members[_0x3fdbb0][_0xf7c0('0x7')]||_0x35cf9c[_0xf7c0('0x7')]});if(members[_0x3fdbb0]['exitAt']){writeDB(members[_0x3fdbb0]);}}}if(_0x35cf9c['destinationchannel']){var _0x3ac4d2=_0x35cf9c[_0xf7c0('0x2d')]['split']('-')[0x0];if(!_[_0xf7c0('0x20')](members[_0x3ac4d2])){members[_0x3ac4d2]=_[_0xf7c0('0x28')](members[_0x3ac4d2],{'data1':members[_0x3ac4d2]['data1']||_0x35cf9c[_0xf7c0('0xa')],'data2':members[_0x3ac4d2][_0xf7c0('0x9')]||_0x35cf9c['source'],'data3':members[_0x3ac4d2][_0xf7c0('0x2b')]||_0x35cf9c[_0xf7c0('0x2c')],'uniqueid':members[_0x3ac4d2][_0xf7c0('0x7')]||_0x35cf9c[_0xf7c0('0x7')]});if(members[_0x3ac4d2][_0xf7c0('0x21')]){writeDB(members[_0x3ac4d2]);}}}}; \ No newline at end of file +var _0xa789=['channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','some','startsWith','state','INUSE','device','voice','TALKING','now','agent','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','queue','cdr','assign','data1','source','data3','destination','destinationchannel','lodash','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xa789,0x1db));var _0x9a78=function(_0x75efe2,_0x3bb3e4){_0x75efe2=_0x75efe2-0x0;var _0x436c2d=_0xa789[_0x75efe2];return _0x436c2d;};'use strict';var _=require(_0x9a78('0x0'));var util=require('util');var utils=require(_0x9a78('0x1'));var members={};var exclude=[_0x9a78('0x2'),_0x9a78('0x3')];function writeDB(_0x3a5c75){utils[_0x9a78('0x4')](util[_0x9a78('0x5')](_0x9a78('0x6'),_0x3a5c75[_0x9a78('0x7')],_0x3a5c75[_0x9a78('0x8')],_0x3a5c75[_0x9a78('0x9')],_0x3a5c75[_0x9a78('0xa')],_0x3a5c75[_0x9a78('0xb')],_0x3a5c75[_0x9a78('0xc')]));if(_0x3a5c75['interface']){utils[_0x9a78('0xd')](_0x3a5c75[_0x9a78('0x8')])[_0x9a78('0xe')](function(_0x4eee85){if(_0x4eee85){_0x3a5c75['membername']=_0x4eee85[_0x9a78('0xf')];_0x3a5c75[_0x9a78('0x10')]=_0x4eee85[_0x9a78('0x10')];utils[_0x9a78('0x11')](_0x9a78('0x12'),_0x3a5c75);}else{utils[_0x9a78('0x13')](_0x3a5c75[_0x9a78('0x8')][_0x9a78('0x14')]('/')[0x1])[_0x9a78('0xe')](function(_0x4778c5){if(_0x4778c5){_0x3a5c75[_0x9a78('0xb')]=_0x4778c5[_0x9a78('0xf')];_0x3a5c75[_0x9a78('0x10')]=_0x4778c5['internal'];utils[_0x9a78('0x11')]('CreateMemberReport',_0x3a5c75);}});}})['catch'](function(_0x32789d){utils['error'](_0x32789d);});}delete members[_0x3a5c75[_0x9a78('0x8')]];}function startsWith(_0x2a7aa,_0x41ef8b){return _[_0x9a78('0x15')](_0x2a7aa,function(_0x2464d8){return _[_0x9a78('0x16')](_0x41ef8b,_0x2464d8);});}exports['devicestatechange']=function(_0x231b95){switch(_0x231b95[_0x9a78('0x17')]){case _0x9a78('0x18'):case'BUSY':if(!startsWith(exclude,_0x231b95[_0x9a78('0x19')])){members[_0x231b95[_0x9a78('0x19')]]={'channel':_0x9a78('0x1a'),'interface':_0x231b95[_0x9a78('0x19')],'type':_0x9a78('0x1b'),'enterAt':utils[_0x9a78('0x1c')](),'role':_0x9a78('0x1d')};}break;case'NOT_INUSE':if(!_[_0x9a78('0x1e')](members[_0x231b95[_0x9a78('0x19')]])){members[_0x231b95[_0x9a78('0x19')]]['exitAt']=utils['now']();members[_0x231b95[_0x9a78('0x19')]][_0x9a78('0x1f')]=utils[_0x9a78('0x20')](members[_0x231b95[_0x9a78('0x19')]][_0x9a78('0x21')],members[_0x231b95['device']][_0x9a78('0x22')]);if(members[_0x231b95[_0x9a78('0x19')]][_0x9a78('0x7')]){writeDB(members[_0x231b95[_0x9a78('0x19')]]);}}default:break;}};exports[_0x9a78('0x23')]=function(_0x10060d){if(!_[_0x9a78('0x1e')](members[_0x10060d[_0x9a78('0x8')]])){members[_0x10060d[_0x9a78('0x8')]]=_['assign'](members[_0x10060d[_0x9a78('0x8')]],{'data4':_0x10060d[_0x9a78('0x24')],'uniqueid':_0x10060d['uniqueid']});}};exports[_0x9a78('0x25')]=function(_0x2ff102){if(_0x2ff102['channel']){var _0x88b3e4=_0x2ff102[_0x9a78('0x9')][_0x9a78('0x14')]('-')[0x0];if(!_[_0x9a78('0x1e')](members[_0x88b3e4])){members[_0x88b3e4]=_[_0x9a78('0x26')](members[_0x88b3e4],{'data1':members[_0x88b3e4][_0x9a78('0x27')]||_0x2ff102[_0x9a78('0xc')],'data2':members[_0x88b3e4][_0x9a78('0xa')]||_0x2ff102[_0x9a78('0x28')],'data3':members[_0x88b3e4][_0x9a78('0x29')]||_0x2ff102[_0x9a78('0x2a')],'uniqueid':members[_0x88b3e4][_0x9a78('0x7')]||_0x2ff102[_0x9a78('0x7')]});if(members[_0x88b3e4][_0x9a78('0x21')]){writeDB(members[_0x88b3e4]);}}}if(_0x2ff102[_0x9a78('0x2b')]){var _0x1da1fc=_0x2ff102['destinationchannel'][_0x9a78('0x14')]('-')[0x0];if(!_[_0x9a78('0x1e')](members[_0x1da1fc])){members[_0x1da1fc]=_[_0x9a78('0x26')](members[_0x1da1fc],{'data1':members[_0x1da1fc][_0x9a78('0x27')]||_0x2ff102[_0x9a78('0xc')],'data2':members[_0x1da1fc][_0x9a78('0xa')]||_0x2ff102[_0x9a78('0x28')],'data3':members[_0x1da1fc]['data3']||_0x2ff102[_0x9a78('0x2a')],'uniqueid':members[_0x1da1fc]['uniqueid']||_0x2ff102[_0x9a78('0x7')]});if(members[_0x1da1fc]['exitAt']){writeDB(members[_0x1da1fc]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index a30aecc..61c460f 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 _0x3aa9=['then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','now','hangup','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','varset','isNil','variable','queuestatus','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','toUpperCase','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','agentcomplete','assigned','membername','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','secondtransfererlinkedid','ATTENDED','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','queuecallerjoinAt','error','musiconholdstart','musiconholdstop','musiconholdstartAt','lodash','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','getVoiceQueueByName'];(function(_0x531262,_0x461bac){var _0x53cb3e=function(_0x2a5e0a){while(--_0x2a5e0a){_0x531262['push'](_0x531262['shift']());}};_0x53cb3e(++_0x461bac);}(_0x3aa9,0x92));var _0x93aa=function(_0x2c8b4f,_0x2be2f9){_0x2c8b4f=_0x2c8b4f-0x0;var _0x3dbd8f=_0x3aa9[_0x2c8b4f];return _0x3dbd8f;};'use strict';var _=require(_0x93aa('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x23cb8d){utils[_0x93aa('0x1')](util[_0x93aa('0x2')](_0x93aa('0x3'),_0x23cb8d[_0x93aa('0x4')],_0x23cb8d[_0x93aa('0x5')],_0x23cb8d[_0x93aa('0x6')],_0x23cb8d[_0x93aa('0x7')],_0x23cb8d[_0x93aa('0x8')],_0x23cb8d['accountcode'],_0x23cb8d['queuecallerexitreason']));if(_0x23cb8d[_0x93aa('0x6')]){utils[_0x93aa('0x9')](_0x23cb8d['queue'])[_0x93aa('0xa')](function(_0x20165e){if(_0x20165e){_0x23cb8d[_0x93aa('0xb')]=_0x20165e[_0x93aa('0xb')];}utils[_0x93aa('0xc')]('CreateVoiceQueueReport',_0x23cb8d);});}else{utils[_0x93aa('0xc')](_0x93aa('0xd'),_0x23cb8d);}if(_0x23cb8d[_0x93aa('0xe')]){delete queues[_0x23cb8d['transfereduniqueid']];}else{delete queues[_0x23cb8d[_0x93aa('0x4')]];}}exports['queuecallerjoin']=function(_0x2a54b1){queues[_0x2a54b1['uniqueid']]=_[_0x93aa('0xf')](_0x2a54b1,{'originalposition':_0x2a54b1[_0x93aa('0x10')],'queuecallerjoinAt':utils[_0x93aa('0x11')](),'mohtime':0x0});};exports[_0x93aa('0x12')]=function(_0x23a46f){if(!_['isNil'](queues[_0x23a46f['uniqueid']])){if(queues[_0x23a46f['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x23a46f[_0x93aa('0x4')]][_0x93aa('0x13')]&&!queues[_0x23a46f['uniqueid']]['queuecallerexit']){queues[_0x23a46f['uniqueid']][_0x93aa('0x14')]=!![];queues[_0x23a46f[_0x93aa('0x4')]][_0x93aa('0x15')]=utils[_0x93aa('0x11')]();queues[_0x23a46f[_0x93aa('0x4')]][_0x93aa('0x16')]=_0x93aa('0x17');}writeDB(queues[_0x23a46f['uniqueid']]);}else{if(queues[_0x23a46f['uniqueid']][_0x93aa('0xe')]){queues[queues[_0x23a46f[_0x93aa('0x4')]]['transfereduniqueid']]=queues[_0x23a46f[_0x93aa('0x4')]];queues[queues[_0x23a46f[_0x93aa('0x4')]][_0x93aa('0xe')]][_0x93aa('0x18')]=0x2;delete queues[_0x23a46f['uniqueid']];}}}};exports[_0x93aa('0x19')]=function(_0x3bf15e){if(!_[_0x93aa('0x1a')](_0x3bf15e[_0x93aa('0x1b')][_0x93aa('0x1c')])){if(!_['isNil'](queues[_0x3bf15e[_0x93aa('0x4')]])){queues[_0x3bf15e[_0x93aa('0x4')]][_0x93aa('0x13')]=![];queues[_0x3bf15e['uniqueid']][_0x93aa('0x1d')]=null;queues[_0x3bf15e[_0x93aa('0x4')]][_0x93aa('0x1e')]=!![];queues[_0x3bf15e['uniqueid']][_0x93aa('0x1f')]=utils[_0x93aa('0x11')]();queues[_0x3bf15e['uniqueid']]['queuecallerexitreason']=_0x3bf15e['value'][_0x93aa('0x20')]();writeDB(queues[_0x3bf15e[_0x93aa('0x4')]]);}}else if(!_[_0x93aa('0x1a')](_0x3bf15e[_0x93aa('0x1b')][_0x93aa('0x21')])){if(!_[_0x93aa('0x1a')](queues[_0x3bf15e[_0x93aa('0x4')]])&&!queues[_0x3bf15e[_0x93aa('0x4')]][_0x93aa('0x13')]){queues[_0x3bf15e['uniqueid']]['queuecallerabandon']=![];queues[_0x3bf15e[_0x93aa('0x4')]][_0x93aa('0x1d')]=null;queues[_0x3bf15e[_0x93aa('0x4')]][_0x93aa('0x1e')]=!![];queues[_0x3bf15e['uniqueid']][_0x93aa('0x1f')]=utils[_0x93aa('0x11')]();queues[_0x3bf15e[_0x93aa('0x4')]]['queuecallerexitreason']=_0x93aa('0x22');}}};exports[_0x93aa('0x13')]=function(_0x122907){if(!_['isNil'](queues[_0x122907['uniqueid']])){queues[_0x122907[_0x93aa('0x4')]][_0x93aa('0x1e')]=![];queues[_0x122907[_0x93aa('0x4')]][_0x93aa('0x1f')]=null;queues[_0x122907[_0x93aa('0x4')]][_0x93aa('0x13')]=!![];queues[_0x122907[_0x93aa('0x4')]][_0x93aa('0x1d')]=utils[_0x93aa('0x11')]();queues[_0x122907[_0x93aa('0x4')]][_0x93aa('0x16')]=_0x93aa('0x23');}};exports[_0x93aa('0x24')]=function(_0x167797){if(!_[_0x93aa('0x1a')](queues[_0x167797[_0x93aa('0x4')]])){queues[_0x167797[_0x93aa('0x4')]][_0x93aa('0x24')]=!![];queues[_0x167797[_0x93aa('0x4')]][_0x93aa('0x25')]=utils[_0x93aa('0x11')]();queues[_0x167797[_0x93aa('0x4')]][_0x93aa('0x26')]=utils[_0x93aa('0x27')](queues[_0x167797['uniqueid']]['queuecallerleaveAt'],queues[_0x167797['uniqueid']]['queuecallerjoinAt']);queues[_0x167797[_0x93aa('0x4')]]['position']=_0x167797[_0x93aa('0x10')];queues[_0x167797[_0x93aa('0x4')]]['count']=_0x167797[_0x93aa('0x28')];queues[_0x167797[_0x93aa('0x4')]][_0x93aa('0x29')]=_0x167797['connectedlinenum'];queues[_0x167797[_0x93aa('0x4')]][_0x93aa('0x2a')]=_0x167797['connectedlinename'];}};exports[_0x93aa('0x2b')]=function(_0x3ee72b){if(!_[_0x93aa('0x1a')](queues[_0x3ee72b[_0x93aa('0x4')]])){queues[_0x3ee72b[_0x93aa('0x4')]][_0x93aa('0x13')]=![];queues[_0x3ee72b[_0x93aa('0x4')]]['queuecallerabandon']=![];queues[_0x3ee72b[_0x93aa('0x4')]][_0x93aa('0x1d')]=null;queues[_0x3ee72b['uniqueid']][_0x93aa('0x1e')]=![];queues[_0x3ee72b[_0x93aa('0x4')]][_0x93aa('0x1f')]=null;queues[_0x3ee72b[_0x93aa('0x4')]]['assigned']=!![];queues[_0x3ee72b[_0x93aa('0x4')]]['lastAssignedTo']=_0x3ee72b['membername'];}};exports[_0x93aa('0x2c')]=function(_0x470649){if(!_[_0x93aa('0x1a')](queues[_0x470649[_0x93aa('0x4')]])){if(queues[_0x470649['uniqueid']][_0x93aa('0x25')]){queues[_0x470649[_0x93aa('0x4')]][_0x93aa('0x13')]=![];queues[_0x470649['uniqueid']][_0x93aa('0x13')]=![];queues[_0x470649[_0x93aa('0x4')]]['queuecallerabandonAt']=null;queues[_0x470649['uniqueid']][_0x93aa('0x1e')]=![];queues[_0x470649[_0x93aa('0x4')]][_0x93aa('0x1f')]=null;queues[_0x470649[_0x93aa('0x4')]][_0x93aa('0x2d')]=!![];queues[_0x470649[_0x93aa('0x4')]][_0x93aa('0x7')]=_0x470649[_0x93aa('0x2e')];queues[_0x470649['uniqueid']]['queuecallercomplete']=!![];queues[_0x470649[_0x93aa('0x4')]][_0x93aa('0x15')]=utils[_0x93aa('0x11')]();if(_0x470649[_0x93aa('0x2f')]=='transfer'){if(!queues[_0x470649['uniqueid']][_0x93aa('0x30')]){queues[_0x470649[_0x93aa('0x4')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x470649['uniqueid']][_0x93aa('0x16')]=_0x93aa('0x31')+_0x470649[_0x93aa('0x2f')][_0x93aa('0x20')]();}writeDB(queues[_0x470649[_0x93aa('0x4')]]);}}};exports[_0x93aa('0x32')]=function(_0x19c7c4){if(!_['isNil'](queues[_0x19c7c4[_0x93aa('0x33')]])){queues[_0x19c7c4[_0x93aa('0x33')]]['transfer']=!![];queues[_0x19c7c4[_0x93aa('0x33')]][_0x93aa('0x34')]=_0x93aa('0x35');queues[_0x19c7c4[_0x93aa('0x33')]][_0x93aa('0x36')]=_0x19c7c4[_0x93aa('0x37')];queues[_0x19c7c4[_0x93aa('0x33')]][_0x93aa('0x38')]=_0x19c7c4['transfereeuniqueid'];queues[_0x19c7c4[_0x93aa('0x33')]]['queuecallerexitreason']=_0x93aa('0x39');}};exports[_0x93aa('0x3a')]=function(_0x13a00d){try{if(_0x13a00d['origtransfereruniqueid']==_0x13a00d['origtransfererlinkedid']){if(!_[_0x93aa('0x1a')](queues[_0x13a00d[_0x93aa('0x3b')]])){queues[_0x13a00d[_0x93aa('0x3b')]]['transfer']=!![];queues[_0x13a00d[_0x93aa('0x3b')]][_0x93aa('0x34')]=_0x93aa('0x3c');queues[_0x13a00d['secondtransfererlinkedid']]['transferexten']=_0x13a00d[_0x93aa('0x3d')];queues[_0x13a00d['secondtransfererlinkedid']][_0x93aa('0x38')]=_0x13a00d[_0x93aa('0x3e')];queues[_0x13a00d[_0x93aa('0x3b')]][_0x93aa('0x16')]=_0x93aa('0x3f');}if(!_[_0x93aa('0x1a')](queues[_0x13a00d[_0x93aa('0x40')]])){if(_0x13a00d[_0x93aa('0x41')]&&queues[_0x13a00d[_0x93aa('0x41')]]){queues[_0x13a00d[_0x93aa('0x41')]]['queuecallerenterreason']=0x1;queues[_0x13a00d[_0x93aa('0x33')]]=_[_0x93aa('0x42')](queues[_0x13a00d[_0x93aa('0x41')]]);queues[_0x13a00d[_0x93aa('0x33')]][_0x93aa('0xe')]=_0x13a00d[_0x93aa('0x43')];queues[_0x13a00d[_0x93aa('0x33')]][_0x93aa('0x18')]=0x2;queues[_0x13a00d[_0x93aa('0x33')]][_0x93aa('0x8')]=queues[_0x13a00d[_0x93aa('0x3b')]]['calleridnum'];queues[_0x13a00d[_0x93aa('0x33')]][_0x93aa('0x44')]=queues[_0x13a00d[_0x93aa('0x3b')]]['calleridname'];queues[_0x13a00d[_0x93aa('0x33')]]['queuecallerjoinAt']=utils[_0x93aa('0x11')]();queues[_0x13a00d['transfereeuniqueid']][_0x93aa('0x25')]=utils['now']();queues[_0x13a00d['transfereeuniqueid']][_0x93aa('0x26')]=0x0;queues[_0x13a00d[_0x93aa('0x33')]][_0x93aa('0x45')]=0x0;}else{queues[_0x13a00d[_0x93aa('0x40')]]['transfereduniqueid']=_0x13a00d[_0x93aa('0x3b')];}}}else if(_0x13a00d[_0x93aa('0x46')]==_0x13a00d[_0x93aa('0x3b')]){if(!_[_0x93aa('0x1a')](queues[_0x13a00d[_0x93aa('0x40')]])){queues[_0x13a00d[_0x93aa('0x40')]][_0x93aa('0x30')]=!![];queues[_0x13a00d['origtransfererlinkedid']][_0x93aa('0x34')]=_0x93aa('0x3c');queues[_0x13a00d[_0x93aa('0x40')]][_0x93aa('0x36')]=_0x13a00d[_0x93aa('0x47')];queues[_0x13a00d[_0x93aa('0x40')]][_0x93aa('0x38')]=_0x13a00d[_0x93aa('0x46')];queues[_0x13a00d[_0x93aa('0x40')]][_0x93aa('0x16')]=_0x93aa('0x3f');}if(!_[_0x93aa('0x1a')](queues[_0x13a00d[_0x93aa('0x3b')]])){if(_0x13a00d[_0x93aa('0x48')]&&queues[_0x13a00d[_0x93aa('0x48')]]){queues[_0x13a00d[_0x93aa('0x48')]][_0x93aa('0x18')]=0x1;queues[_0x13a00d[_0x93aa('0x43')]]=_[_0x93aa('0x42')](queues[_0x13a00d[_0x93aa('0x48')]]);queues[_0x13a00d[_0x93aa('0x43')]][_0x93aa('0xe')]=_0x13a00d['transfertargetuniqueid'];queues[_0x13a00d[_0x93aa('0x43')]][_0x93aa('0x18')]=0x2;queues[_0x13a00d[_0x93aa('0x43')]][_0x93aa('0x8')]=queues[_0x13a00d[_0x93aa('0x40')]][_0x93aa('0x8')];queues[_0x13a00d[_0x93aa('0x43')]][_0x93aa('0x44')]=queues[_0x13a00d[_0x93aa('0x40')]][_0x93aa('0x44')];queues[_0x13a00d['transfertargetuniqueid']][_0x93aa('0x49')]=utils[_0x93aa('0x11')]();queues[_0x13a00d['transfertargetuniqueid']][_0x93aa('0x25')]=utils['now']();queues[_0x13a00d[_0x93aa('0x43')]]['holdtime']=0x0;queues[_0x13a00d[_0x93aa('0x43')]]['mohtime']=0x0;}else{queues[_0x13a00d[_0x93aa('0x3b')]][_0x93aa('0xe')]=_0x13a00d[_0x93aa('0x40')];}}}}catch(_0x104732){utils[_0x93aa('0x4a')](_0x104732['stack']);}};exports[_0x93aa('0x4b')]=function(_0x2c0942){if(!_[_0x93aa('0x1a')](queues[_0x2c0942[_0x93aa('0x4')]])){queues[_0x2c0942['uniqueid']]['musiconholdstartAt']=utils['now']();}};exports[_0x93aa('0x4c')]=function(_0x2e5937){if(!_['isNil'](queues[_0x2e5937[_0x93aa('0x4')]])){if(!_[_0x93aa('0x1a')](queues[_0x2e5937[_0x93aa('0x4')]]['musiconholdstartAt'])){queues[_0x2e5937['uniqueid']][_0x93aa('0x45')]+=utils[_0x93aa('0x27')](utils[_0x93aa('0x11')](),queues[_0x2e5937[_0x93aa('0x4')]][_0x93aa('0x4d')]);delete queues[_0x2e5937[_0x93aa('0x4')]][_0x93aa('0x4d')];}}}; \ No newline at end of file +var _0x747d=['stack','musiconholdstartAt','musiconholdstop','lodash','util','./utils','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','hangup','isNil','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','varset','variable','queuestatus','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','toUpperCase','EXITWITHKEY','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','queuecallerenterreason','error'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x747d,0x189));var _0xd747=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x747d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd747('0x0'));var util=require(_0xd747('0x1'));var utils=require(_0xd747('0x2'));var queues={};function writeDB(_0x4bd55e){utils['info'](util[_0xd747('0x3')](_0xd747('0x4'),_0x4bd55e[_0xd747('0x5')],_0x4bd55e[_0xd747('0x6')],_0x4bd55e[_0xd747('0x7')],_0x4bd55e[_0xd747('0x8')],_0x4bd55e['calleridnum'],_0x4bd55e['accountcode'],_0x4bd55e[_0xd747('0x9')]));if(_0x4bd55e[_0xd747('0x7')]){utils[_0xd747('0xa')](_0x4bd55e['queue'])[_0xd747('0xb')](function(_0x1c59df){if(_0x1c59df){_0x4bd55e[_0xd747('0xc')]=_0x1c59df[_0xd747('0xc')];}utils[_0xd747('0xd')](_0xd747('0xe'),_0x4bd55e);});}else{utils['request'](_0xd747('0xe'),_0x4bd55e);}if(_0x4bd55e['transfereduniqueid']){delete queues[_0x4bd55e[_0xd747('0xf')]];}else{delete queues[_0x4bd55e[_0xd747('0x5')]];}}exports[_0xd747('0x10')]=function(_0x332440){queues[_0x332440['uniqueid']]=_[_0xd747('0x11')](_0x332440,{'originalposition':_0x332440[_0xd747('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0xd747('0x13')]=function(_0x3ad7c4){if(!_[_0xd747('0x14')](queues[_0x3ad7c4['uniqueid']])){if(queues[_0x3ad7c4['uniqueid']][_0xd747('0x15')]){if(!queues[_0x3ad7c4['uniqueid']]['queuecallerabandon']&&!queues[_0x3ad7c4[_0xd747('0x5')]]['queuecallerexit']){queues[_0x3ad7c4['uniqueid']][_0xd747('0x16')]=!![];queues[_0x3ad7c4['uniqueid']][_0xd747('0x17')]=utils[_0xd747('0x18')]();queues[_0x3ad7c4[_0xd747('0x5')]][_0xd747('0x9')]=_0xd747('0x19');}writeDB(queues[_0x3ad7c4[_0xd747('0x5')]]);}else{if(queues[_0x3ad7c4[_0xd747('0x5')]][_0xd747('0xf')]){queues[queues[_0x3ad7c4[_0xd747('0x5')]][_0xd747('0xf')]]=queues[_0x3ad7c4[_0xd747('0x5')]];queues[queues[_0x3ad7c4[_0xd747('0x5')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x3ad7c4[_0xd747('0x5')]];}}}};exports[_0xd747('0x1a')]=function(_0x2dcb89){if(!_[_0xd747('0x14')](_0x2dcb89[_0xd747('0x1b')][_0xd747('0x1c')])){if(!_['isNil'](queues[_0x2dcb89[_0xd747('0x5')]])){queues[_0x2dcb89[_0xd747('0x5')]][_0xd747('0x1d')]=![];queues[_0x2dcb89[_0xd747('0x5')]][_0xd747('0x1e')]=null;queues[_0x2dcb89[_0xd747('0x5')]][_0xd747('0x1f')]=!![];queues[_0x2dcb89['uniqueid']][_0xd747('0x20')]=utils['now']();queues[_0x2dcb89[_0xd747('0x5')]]['queuecallerexitreason']=_0x2dcb89[_0xd747('0x21')][_0xd747('0x22')]();writeDB(queues[_0x2dcb89[_0xd747('0x5')]]);}}else if(!_[_0xd747('0x14')](_0x2dcb89[_0xd747('0x1b')]['queueposition'])){if(!_[_0xd747('0x14')](queues[_0x2dcb89[_0xd747('0x5')]])&&!queues[_0x2dcb89[_0xd747('0x5')]][_0xd747('0x1d')]){queues[_0x2dcb89[_0xd747('0x5')]][_0xd747('0x1d')]=![];queues[_0x2dcb89[_0xd747('0x5')]][_0xd747('0x1e')]=null;queues[_0x2dcb89[_0xd747('0x5')]]['queuecallerexit']=!![];queues[_0x2dcb89[_0xd747('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x2dcb89[_0xd747('0x5')]][_0xd747('0x9')]=_0xd747('0x23');}}};exports['queuecallerabandon']=function(_0x598a23){if(!_[_0xd747('0x14')](queues[_0x598a23[_0xd747('0x5')]])){queues[_0x598a23['uniqueid']]['queuecallerexit']=![];queues[_0x598a23[_0xd747('0x5')]]['queuecallerexitAt']=null;queues[_0x598a23[_0xd747('0x5')]][_0xd747('0x1d')]=!![];queues[_0x598a23['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x598a23['uniqueid']][_0xd747('0x9')]='ABANDONED';}};exports[_0xd747('0x24')]=function(_0x5cfa01){if(!_[_0xd747('0x14')](queues[_0x5cfa01['uniqueid']])){queues[_0x5cfa01[_0xd747('0x5')]][_0xd747('0x24')]=!![];queues[_0x5cfa01[_0xd747('0x5')]][_0xd747('0x15')]=utils[_0xd747('0x18')]();queues[_0x5cfa01[_0xd747('0x5')]][_0xd747('0x25')]=utils[_0xd747('0x26')](queues[_0x5cfa01[_0xd747('0x5')]][_0xd747('0x15')],queues[_0x5cfa01[_0xd747('0x5')]][_0xd747('0x27')]);queues[_0x5cfa01[_0xd747('0x5')]]['position']=_0x5cfa01[_0xd747('0x12')];queues[_0x5cfa01[_0xd747('0x5')]][_0xd747('0x28')]=_0x5cfa01['count'];queues[_0x5cfa01['uniqueid']][_0xd747('0x29')]=_0x5cfa01[_0xd747('0x29')];queues[_0x5cfa01[_0xd747('0x5')]]['connectedlinename']=_0x5cfa01[_0xd747('0x2a')];}};exports[_0xd747('0x2b')]=function(_0x5b0afe){if(!_['isNil'](queues[_0x5b0afe['uniqueid']])){queues[_0x5b0afe[_0xd747('0x5')]][_0xd747('0x1d')]=![];queues[_0x5b0afe[_0xd747('0x5')]][_0xd747('0x1d')]=![];queues[_0x5b0afe[_0xd747('0x5')]][_0xd747('0x1e')]=null;queues[_0x5b0afe[_0xd747('0x5')]]['queuecallerexit']=![];queues[_0x5b0afe[_0xd747('0x5')]][_0xd747('0x20')]=null;queues[_0x5b0afe['uniqueid']][_0xd747('0x2c')]=!![];queues[_0x5b0afe[_0xd747('0x5')]]['lastAssignedTo']=_0x5b0afe[_0xd747('0x2d')];}};exports[_0xd747('0x2e')]=function(_0xb4e285){if(!_[_0xd747('0x14')](queues[_0xb4e285[_0xd747('0x5')]])){if(queues[_0xb4e285['uniqueid']][_0xd747('0x15')]){queues[_0xb4e285['uniqueid']]['queuecallerabandon']=![];queues[_0xb4e285[_0xd747('0x5')]][_0xd747('0x1d')]=![];queues[_0xb4e285[_0xd747('0x5')]][_0xd747('0x1e')]=null;queues[_0xb4e285[_0xd747('0x5')]][_0xd747('0x1f')]=![];queues[_0xb4e285[_0xd747('0x5')]]['queuecallerexitAt']=null;queues[_0xb4e285[_0xd747('0x5')]][_0xd747('0x2c')]=!![];queues[_0xb4e285[_0xd747('0x5')]][_0xd747('0x8')]=_0xb4e285[_0xd747('0x2d')];queues[_0xb4e285[_0xd747('0x5')]][_0xd747('0x16')]=!![];queues[_0xb4e285[_0xd747('0x5')]][_0xd747('0x17')]=utils[_0xd747('0x18')]();if(_0xb4e285[_0xd747('0x2f')]==_0xd747('0x30')){if(!queues[_0xb4e285['uniqueid']][_0xd747('0x30')]){queues[_0xb4e285['uniqueid']][_0xd747('0x9')]=_0xd747('0x31');}}else{queues[_0xb4e285[_0xd747('0x5')]][_0xd747('0x9')]=_0xd747('0x32')+_0xb4e285[_0xd747('0x2f')][_0xd747('0x22')]();}writeDB(queues[_0xb4e285[_0xd747('0x5')]]);}}};exports[_0xd747('0x33')]=function(_0xb1e6cd){if(!_[_0xd747('0x14')](queues[_0xb1e6cd[_0xd747('0x34')]])){queues[_0xb1e6cd[_0xd747('0x34')]][_0xd747('0x30')]=!![];queues[_0xb1e6cd[_0xd747('0x34')]][_0xd747('0x35')]='BLIND';queues[_0xb1e6cd[_0xd747('0x34')]]['transferexten']=_0xb1e6cd[_0xd747('0x36')];queues[_0xb1e6cd[_0xd747('0x34')]][_0xd747('0x37')]=_0xb1e6cd['transfereeuniqueid'];queues[_0xb1e6cd[_0xd747('0x34')]][_0xd747('0x9')]='BLINDTRANSFER';}};exports[_0xd747('0x38')]=function(_0x4412f6){try{if(_0x4412f6[_0xd747('0x39')]==_0x4412f6[_0xd747('0x3a')]){if(!_[_0xd747('0x14')](queues[_0x4412f6['secondtransfererlinkedid']])){queues[_0x4412f6[_0xd747('0x3b')]]['transfer']=!![];queues[_0x4412f6['secondtransfererlinkedid']]['transfertype']=_0xd747('0x3c');queues[_0x4412f6[_0xd747('0x3b')]][_0xd747('0x3d')]=_0x4412f6[_0xd747('0x3e')];queues[_0x4412f6['secondtransfererlinkedid']][_0xd747('0x37')]=_0x4412f6[_0xd747('0x39')];queues[_0x4412f6['secondtransfererlinkedid']][_0xd747('0x9')]=_0xd747('0x3f');}if(!_[_0xd747('0x14')](queues[_0x4412f6[_0xd747('0x3a')]])){if(_0x4412f6[_0xd747('0x40')]&&queues[_0x4412f6[_0xd747('0x40')]]){queues[_0x4412f6[_0xd747('0x40')]]['queuecallerenterreason']=0x1;queues[_0x4412f6[_0xd747('0x34')]]=_[_0xd747('0x41')](queues[_0x4412f6[_0xd747('0x40')]]);queues[_0x4412f6[_0xd747('0x34')]][_0xd747('0xf')]=_0x4412f6[_0xd747('0x42')];queues[_0x4412f6[_0xd747('0x34')]]['queuecallerenterreason']=0x2;queues[_0x4412f6[_0xd747('0x34')]][_0xd747('0x43')]=queues[_0x4412f6[_0xd747('0x3b')]][_0xd747('0x43')];queues[_0x4412f6[_0xd747('0x34')]]['calleridname']=queues[_0x4412f6[_0xd747('0x3b')]][_0xd747('0x44')];queues[_0x4412f6[_0xd747('0x34')]]['queuecallerjoinAt']=utils[_0xd747('0x18')]();queues[_0x4412f6[_0xd747('0x34')]][_0xd747('0x15')]=utils[_0xd747('0x18')]();queues[_0x4412f6['transfereeuniqueid']][_0xd747('0x25')]=0x0;queues[_0x4412f6[_0xd747('0x34')]][_0xd747('0x45')]=0x0;}else{queues[_0x4412f6[_0xd747('0x3a')]]['transfereduniqueid']=_0x4412f6[_0xd747('0x3b')];}}}else if(_0x4412f6[_0xd747('0x46')]==_0x4412f6[_0xd747('0x3b')]){if(!_[_0xd747('0x14')](queues[_0x4412f6[_0xd747('0x3a')]])){queues[_0x4412f6[_0xd747('0x3a')]][_0xd747('0x30')]=!![];queues[_0x4412f6[_0xd747('0x3a')]][_0xd747('0x35')]=_0xd747('0x3c');queues[_0x4412f6[_0xd747('0x3a')]][_0xd747('0x3d')]=_0x4412f6[_0xd747('0x47')];queues[_0x4412f6[_0xd747('0x3a')]]['transferuniqueid']=_0x4412f6['secondtransfereruniqueid'];queues[_0x4412f6['origtransfererlinkedid']]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xd747('0x14')](queues[_0x4412f6[_0xd747('0x3b')]])){if(_0x4412f6[_0xd747('0x48')]&&queues[_0x4412f6[_0xd747('0x48')]]){queues[_0x4412f6[_0xd747('0x48')]][_0xd747('0x49')]=0x1;queues[_0x4412f6[_0xd747('0x42')]]=_['clone'](queues[_0x4412f6[_0xd747('0x48')]]);queues[_0x4412f6[_0xd747('0x42')]]['transfereduniqueid']=_0x4412f6[_0xd747('0x42')];queues[_0x4412f6[_0xd747('0x42')]][_0xd747('0x49')]=0x2;queues[_0x4412f6[_0xd747('0x42')]]['calleridnum']=queues[_0x4412f6[_0xd747('0x3a')]][_0xd747('0x43')];queues[_0x4412f6[_0xd747('0x42')]][_0xd747('0x44')]=queues[_0x4412f6[_0xd747('0x3a')]]['calleridname'];queues[_0x4412f6[_0xd747('0x42')]][_0xd747('0x27')]=utils[_0xd747('0x18')]();queues[_0x4412f6[_0xd747('0x42')]][_0xd747('0x15')]=utils[_0xd747('0x18')]();queues[_0x4412f6[_0xd747('0x42')]][_0xd747('0x25')]=0x0;queues[_0x4412f6[_0xd747('0x42')]][_0xd747('0x45')]=0x0;}else{queues[_0x4412f6[_0xd747('0x3b')]][_0xd747('0xf')]=_0x4412f6[_0xd747('0x3a')];}}}}catch(_0x1dd70a){utils[_0xd747('0x4a')](_0x1dd70a[_0xd747('0x4b')]);}};exports['musiconholdstart']=function(_0x386267){if(!_[_0xd747('0x14')](queues[_0x386267['uniqueid']])){queues[_0x386267[_0xd747('0x5')]][_0xd747('0x4c')]=utils[_0xd747('0x18')]();}};exports[_0xd747('0x4d')]=function(_0x141bfc){if(!_['isNil'](queues[_0x141bfc[_0xd747('0x5')]])){if(!_['isNil'](queues[_0x141bfc[_0xd747('0x5')]][_0xd747('0x4c')])){queues[_0x141bfc[_0xd747('0x5')]][_0xd747('0x45')]+=utils[_0xd747('0x26')](utils[_0xd747('0x18')](),queues[_0x141bfc[_0xd747('0x5')]]['musiconholdstartAt']);delete queues[_0x141bfc[_0xd747('0x5')]][_0xd747('0x4c')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 6966252..dd9441e 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 _0x9c44=['getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','uniqueid','linkedid','context','channel','error','stack','isNil','transfer','variable','endsWith','value','replace','.wav49','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode'];(function(_0x5cbdf3,_0x1dbb5c){var _0x4cb15f=function(_0x5be353){while(--_0x5be353){_0x5cbdf3['push'](_0x5cbdf3['shift']());}};_0x4cb15f(++_0x1dbb5c);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x1ffbbf){utils[_0x49c4('0x0')](_0x1ffbbf);if(_0x1ffbbf[_0x49c4('0x1')]){utils[_0x49c4('0x2')](_0x1ffbbf[_0x49c4('0x1')])[_0x49c4('0x3')](function(_0x4e0313){if(_0x4e0313){_0x1ffbbf['membername']=_0x4e0313[_0x49c4('0x4')];_0x1ffbbf['UserId']=_0x4e0313['id'];}utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);});}else{utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);}}exports[_0x49c4('0x7')]=function(_0x511d53){try{if(_0x511d53[_0x49c4('0x8')]==_0x511d53[_0x49c4('0x9')]){recordings[_0x511d53[_0x49c4('0x8')]]={'uniqueid':_0x511d53[_0x49c4('0x8')],'accountcode':_0x511d53['accountcode'],'exten':_0x511d53['exten'],'context':_0x511d53[_0x49c4('0xa')],'channel':_0x511d53[_0x49c4('0xb')],'monitors':[]};}}catch(_0x58cad7){utils[_0x49c4('0xc')](_0x58cad7[_0x49c4('0xd')]);}};exports['newstate']=function(_0x536d42){try{if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x8')]])&&_0x536d42['channelstate']==0x6){}else if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x9')]])&&_0x536d42['channelstate']==0x6&&_0x536d42[_0x49c4('0xa')]!=_0x49c4('0xf')){recordings[_0x536d42[_0x49c4('0x9')]][_0x49c4('0x1')]=_0x536d42[_0x49c4('0x1')];}}catch(_0x18211c){utils[_0x49c4('0xc')](_0x18211c[_0x49c4('0xd')]);}};exports['varset']=function(_0x3acd06){try{if(!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')])&&!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')]['mixmonitor_filename'])){if(_[_0x49c4('0x11')](_0x3acd06[_0x49c4('0x12')],'.wav49')){_0x3acd06['value']=_0x3acd06[_0x49c4('0x12')][_0x49c4('0x13')](_0x49c4('0x14'),'.WAV');}if(recordings[_0x3acd06[_0x49c4('0x9')]]){var _0x50b151=_[_0x49c4('0x15')](recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')],{'value':_0x3acd06[_0x49c4('0x12')]});if(_[_0x49c4('0xe')](_0x50b151)){recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')][_0x49c4('0x17')]({'value':_0x3acd06[_0x49c4('0x12')]});}}}}catch(_0x578447){utils['error'](_0x578447['stack']);}};exports[_0x49c4('0x18')]=function(_0x4f0b62){try{if(!_['isNil'](recordings[_0x4f0b62[_0x49c4('0x8')]])){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x19')]=_0x4f0b62[_0x49c4('0x19')];recordings[_0x4f0b62['uniqueid']]['calleridname']=_0x4f0b62[_0x49c4('0x1a')];recordings[_0x4f0b62[_0x49c4('0x8')]]['connectedlinenum']=_0x4f0b62[_0x49c4('0x1b')];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]=_0x4f0b62[_0x49c4('0x1c')];if(recordings[_0x4f0b62['uniqueid']]['type']==_0x49c4('0x1d')&&recordings[_0x4f0b62['uniqueid']][_0x49c4('0x1')]){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1b')]=recordings[_0x4f0b62[_0x49c4('0x8')]]['accountcode'];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]='';}recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x16')][_0x49c4('0x1e')](_0x29f835=>{var _0x26ba17=_[_0x49c4('0x1f')](recordings[_0x4f0b62[_0x49c4('0x8')]]);_0x26ba17[_0x49c4('0x12')]=_0x29f835[_0x49c4('0x12')];writeDB(_0x26ba17);});delete recordings[_0x4f0b62['uniqueid']];}}catch(_0x4f4495){utils['error'](_0x4f4495[_0x49c4('0xd')]);}};exports[_0x49c4('0x20')]=function(_0x1eb035){try{if(!_[_0x49c4('0xe')](recordings[_0x1eb035[_0x49c4('0x8')]])){if(_0x1eb035['application'][_0x49c4('0x21')]()==_0x49c4('0x22')&&_[_0x49c4('0x23')](_0x1eb035[_0x49c4('0x24')]['toLowerCase'](),'cdr')){var _0xce57ef=_0x1eb035[_0x49c4('0x24')][_0x49c4('0x25')]('=');var _0x13b3b4=_0xce57ef[0x0][_0x49c4('0x26')](_0xce57ef[0x0]['lastIndexOf']('(')+0x1,_0xce57ef[0x0][_0x49c4('0x27')](')'));var _0x84c621=_0xce57ef[0x1];recordings[_0x1eb035[_0x49c4('0x8')]][_0x13b3b4]=_0x84c621;}}}catch(_0x512d02){utils['error'](_0x512d02[_0x49c4('0xd')]);}};exports[_0x49c4('0x28')]=function(_0x3bec0a){try{if(!_[_0x49c4('0xe')](recordings[_0x3bec0a[_0x49c4('0x8')]])){recordings[_0x3bec0a[_0x49c4('0x8')]][_0x49c4('0x29')]=_0x3bec0a[_0x49c4('0x29')];}}catch(_0x3209cd){utils['error'](_0x3209cd[_0x49c4('0xd')]);}}; \ No newline at end of file +var _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x1aaa81,_0x2dddba){var _0x25f331=function(_0x47083b){while(--_0x47083b){_0x1aaa81['push'](_0x1aaa81['shift']());}};_0x25f331(++_0x2dddba);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xcb91[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 81ff6c9..56891cc 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 _0x176d=['stack','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','./utils','info','type','CreateVoiceTransferReport','blind','error'];(function(_0xfe36de,_0x303b03){var _0x2072ce=function(_0x1cb93f){while(--_0x1cb93f){_0xfe36de['push'](_0xfe36de['shift']());}};_0x2072ce(++_0x303b03);}(_0x176d,0xb0));var _0xd176=function(_0x44ea0f,_0x4be8fb){_0x44ea0f=_0x44ea0f-0x0;var _0x305c58=_0x176d[_0x44ea0f];return _0x305c58;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xd176('0x0'));function writeDB(_0xeda2b){utils[_0xd176('0x1')](util['format']('TRANSFER|%s',_0xeda2b[_0xd176('0x2')]));utils['request'](_0xd176('0x3'),_0xeda2b);}exports['blindtransfer']=function(_0x323cf2){try{_0x323cf2[_0xd176('0x2')]=_0xd176('0x4');writeDB(_0x323cf2);}catch(_0x23823b){utils[_0xd176('0x5')](_0x23823b[_0xd176('0x6')]);}};exports['attendedtransfer']=function(_0x1b3d86){try{_0x1b3d86=_[_0xd176('0x7')](_0x1b3d86,{'transfererchannel':_0x1b3d86['origtransfererchannel'],'transferercalleridnum':_0x1b3d86[_0xd176('0x8')],'transferercalleridname':_0x1b3d86['origtransferercalleridname'],'transfererconnectedlinenum':_0x1b3d86[_0xd176('0x9')],'transfererconnectedlinename':_0x1b3d86[_0xd176('0xa')],'transfereraccountcode':_0x1b3d86[_0xd176('0xb')],'transferercontext':_0x1b3d86[_0xd176('0xc')],'transfererexten':_0x1b3d86[_0xd176('0xd')],'transfererlinkedid':_0x1b3d86[_0xd176('0xe')],'context':_0x1b3d86[_0xd176('0xf')],'extension':_0x1b3d86[_0xd176('0x10')],'type':_0xd176('0x11')});if(_[_0xd176('0x12')](_0x1b3d86[_0xd176('0x13')])){_0x1b3d86=_['assign'](_0x1b3d86,{'transfereechannel':_0x1b3d86['transfertargetchannel'],'transfereecalleridnum':_0x1b3d86[_0xd176('0x14')],'transfereecalleridname':_0x1b3d86[_0xd176('0x15')],'transfereeconnectedlinenum':_0x1b3d86[_0xd176('0x16')],'transfereeconnectedlinename':_0x1b3d86[_0xd176('0x17')],'transfereeaccountcode':_0x1b3d86[_0xd176('0x18')],'transfereecontext':_0x1b3d86['transfertargetcontext'],'transfereeexten':_0x1b3d86[_0xd176('0x19')],'transfereelinkedid':_0x1b3d86['transfertargetlinkedid']});}writeDB(_0x1b3d86);}catch(_0x46f29d){utils[_0xd176('0x5')](_0x46f29d[_0xd176('0x6')]);}}; \ No newline at end of file +var _0xd0d3=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','TRANSFER|%s','type','request','blind','error','stack','attendedtransfer','assign','origtransferercalleridnum'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xd0d3,0x179));var _0x3d0d=function(_0x4d790e,_0x5960ef){_0x4d790e=_0x4d790e-0x0;var _0x49a78c=_0xd0d3[_0x4d790e];return _0x49a78c;};'use strict';var _=require('lodash');var util=require(_0x3d0d('0x0'));var utils=require(_0x3d0d('0x1'));function writeDB(_0x109fc0){utils[_0x3d0d('0x2')](util[_0x3d0d('0x3')](_0x3d0d('0x4'),_0x109fc0[_0x3d0d('0x5')]));utils[_0x3d0d('0x6')]('CreateVoiceTransferReport',_0x109fc0);}exports['blindtransfer']=function(_0x51c0a7){try{_0x51c0a7[_0x3d0d('0x5')]=_0x3d0d('0x7');writeDB(_0x51c0a7);}catch(_0x20ba5b){utils[_0x3d0d('0x8')](_0x20ba5b[_0x3d0d('0x9')]);}};exports[_0x3d0d('0xa')]=function(_0x46b8b6){try{_0x46b8b6=_[_0x3d0d('0xb')](_0x46b8b6,{'transfererchannel':_0x46b8b6['origtransfererchannel'],'transferercalleridnum':_0x46b8b6[_0x3d0d('0xc')],'transferercalleridname':_0x46b8b6[_0x3d0d('0xd')],'transfererconnectedlinenum':_0x46b8b6[_0x3d0d('0xe')],'transfererconnectedlinename':_0x46b8b6[_0x3d0d('0xf')],'transfereraccountcode':_0x46b8b6[_0x3d0d('0x10')],'transferercontext':_0x46b8b6[_0x3d0d('0x11')],'transfererexten':_0x46b8b6['secondtransfererexten'],'transfererlinkedid':_0x46b8b6['origtransfererlinkedid'],'context':_0x46b8b6['origtransferercontext'],'extension':_0x46b8b6[_0x3d0d('0x12')],'type':'attended'});if(_[_0x3d0d('0x13')](_0x46b8b6[_0x3d0d('0x14')])){_0x46b8b6=_[_0x3d0d('0xb')](_0x46b8b6,{'transfereechannel':_0x46b8b6[_0x3d0d('0x15')],'transfereecalleridnum':_0x46b8b6[_0x3d0d('0x16')],'transfereecalleridname':_0x46b8b6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x46b8b6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x46b8b6['transfertargetconnectedlinename'],'transfereeaccountcode':_0x46b8b6[_0x3d0d('0x17')],'transfereecontext':_0x46b8b6['transfertargetcontext'],'transfereeexten':_0x46b8b6[_0x3d0d('0x18')],'transfereelinkedid':_0x46b8b6[_0x3d0d('0x19')]});}writeDB(_0x46b8b6);}catch(_0x9d79a1){utils[_0x3d0d('0x8')](_0x9d79a1[_0x3d0d('0x9')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 53de12d..242b044 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 _0x263e=['addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','isAfter','isBefore','jayson/promise','moment','bluebird','../../config/logger','info','stringify','error','stack','request','then','debug','catch','name','GETUSER|','NOTFOUND','length','result','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','FOUND'];(function(_0x496d3c,_0x3eab1e){var _0x3700b8=function(_0x4c271c){while(--_0x4c271c){_0x496d3c['push'](_0x496d3c['shift']());}};_0x3700b8(++_0x3eab1e);}(_0x263e,0x76));var _0xe263=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x263e[_0x307d86];return _0x361745;};'use strict';var jayson=require(_0xe263('0x0'));var moment=require(_0xe263('0x1'));var BPromise=require(_0xe263('0x2'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0xe263('0x3'))('xdr');exports[_0xe263('0x4')]=function(_0x3580e4){logger[_0xe263('0x4')](_0x3580e4);};exports['debug']=function(_0x4a12aa){logger['debug'](JSON[_0xe263('0x5')](_0x4a12aa));};exports[_0xe263('0x6')]=function(_0x532735){logger[_0xe263('0x6')](_0x532735[_0xe263('0x7')]);};exports[_0xe263('0x8')]=function(_0x500264,_0x9a3fa0){return client[_0xe263('0x8')](_0x500264,{'body':_0x9a3fa0})[_0xe263('0x9')](function(_0x3b0cca){logger[_0xe263('0xa')](JSON[_0xe263('0x5')](_0x3b0cca));})[_0xe263('0xb')](function(_0x4ece1){logger[_0xe263('0x6')](_0x4ece1[_0xe263('0x7')]);});};function getUser(_0x1ea2ac){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xe263('0xc'),'interface'],'where':_0x1ea2ac,'limit':0x1}})[_0xe263('0x9')](function(_0x1e3448){logger[_0xe263('0x4')](_0xe263('0xd')+JSON[_0xe263('0x5')](_0x1ea2ac)+'|'+(_0x1e3448['result']['length']?'FOUND':_0xe263('0xe')));return _0x1e3448['result'][_0xe263('0xf')]?_0x1e3448[_0xe263('0x10')][0x0]:null;});}exports[_0xe263('0x11')]=function(_0x2db0a1){return new BPromise(function(_0x391d91,_0x2d3139){if(_0x2db0a1){return getUser({'internal':_0x2db0a1})[_0xe263('0x9')](function(_0x52a23c){return _0x391d91(_0x52a23c);})['catch'](function(_0x588cf3){logger['error'](_0x588cf3['stack']);return _0x391d91(null);});}else{return _0x391d91(null);}});};exports[_0xe263('0x12')]=function(_0x4d2f5f){return new BPromise(function(_0x52dec6,_0x21530a){if(_0x4d2f5f){return getUser({'interface':_0x4d2f5f})[_0xe263('0x9')](function(_0x3b430b){return _0x52dec6(_0x3b430b);})[_0xe263('0xb')](function(_0x118595){logger['error'](_0x118595[_0xe263('0x7')]);return _0x52dec6(null);});}else{return _0x52dec6(null);}});};exports[_0xe263('0x13')]=function(_0x4ca68b){return new BPromise(function(_0x58291c,_0x5a0840){if(_0x4ca68b){return getUser({'name':_0x4ca68b})['then'](function(_0x172826){return _0x58291c(_0x172826);})[_0xe263('0xb')](function(_0x3df0c2){logger[_0xe263('0x6')](_0x3df0c2[_0xe263('0x7')]);return _0x58291c(null);});}else{return _0x58291c(null);}});};exports[_0xe263('0x14')]=function(_0x38bf6b){return new BPromise(function(_0x2623bc,_0x18e468){if(_0x38bf6b){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xe263('0xc'),_0xe263('0x15'),_0xe263('0x16'),_0xe263('0x17')],'where':{'name':_0x38bf6b},'limit':0x1}})['then'](function(_0x36855f){logger[_0xe263('0x4')](_0xe263('0x18')+_0x38bf6b+'|'+(_0x36855f[_0xe263('0x10')]['length']?_0xe263('0x19'):_0xe263('0xe')));return _0x2623bc(_0x36855f[_0xe263('0x10')]['length']?_0x36855f['result'][0x0]:null);})['catch'](function(_0x1623d7){logger[_0xe263('0x6')](_0x1623d7[_0xe263('0x7')]);return _0x2623bc(null);});}else{return _0x2623bc(null);}});};exports[_0xe263('0x1a')]=function(_0x7b58b1,_0x87802f){return moment(_0x7b58b1)[_0xe263('0x1b')](_0x87802f,_0xe263('0x1c'))[_0xe263('0x1d')](_0xe263('0x1e'));};exports['subtractTime']=function(_0x4b4781,_0x54a543){return moment(_0x4b4781)[_0xe263('0x1f')](_0x54a543,_0xe263('0x1c'))[_0xe263('0x1d')](_0xe263('0x1e'));};exports['diffTime']=function(_0x30682a,_0x2b28b4){return moment(_0x30682a)[_0xe263('0x20')](moment(_0x2b28b4),_0xe263('0x1c'));};exports[_0xe263('0x21')]=function(_0x349453,_0x558cec){return parseInt(_0x349453,0xa)+parseInt(_0x558cec,0xa);};exports['now']=function(){return moment()[_0xe263('0x1d')](_0xe263('0x1e'));};exports['isAfter']=function(_0xbfe92f,_0x1976ff){if(_0x1976ff){return moment(_0xbfe92f)[_0xe263('0x22')](_0x1976ff);}else{return!![];}};exports['isBefore']=function(_0x22c98f,_0x427aff){if(_0x427aff){return moment(_0x22c98f)[_0xe263('0x23')](_0x427aff);}else if(_0x22c98f){return!![];}else{return![];}}; \ No newline at end of file +var _0xf2be=['seconds','diffTime','diff','sumTime','isAfter','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','GetUser','interface','GETUSER|','result','length','FOUND','getUserByInternal','catch','getUserByInterface','getUserByName','GetVoiceQueue','name','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','NOTFOUND','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime'];(function(_0x26a706,_0x25cc80){var _0x1bcd7c=function(_0x4af445){while(--_0x4af445){_0x26a706['push'](_0x26a706['shift']());}};_0x1bcd7c(++_0x25cc80);}(_0xf2be,0xc8));var _0xef2b=function(_0x175a6c,_0xcdc20c){_0x175a6c=_0x175a6c-0x0;var _0x59d994=_0xf2be[_0x175a6c];return _0x59d994;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xef2b('0x0'));var BPromise=require(_0xef2b('0x1'));var client=jayson[_0xef2b('0x2')][_0xef2b('0x3')]({'port':0x2329});var logger=require(_0xef2b('0x4'))(_0xef2b('0x5'));exports[_0xef2b('0x6')]=function(_0x4bc44c){logger[_0xef2b('0x6')](_0x4bc44c);};exports['debug']=function(_0x240e9a){logger[_0xef2b('0x7')](JSON[_0xef2b('0x8')](_0x240e9a));};exports[_0xef2b('0x9')]=function(_0x400f07){logger[_0xef2b('0x9')](_0x400f07[_0xef2b('0xa')]);};exports[_0xef2b('0xb')]=function(_0x2d4daf,_0x1cbe29){return client[_0xef2b('0xb')](_0x2d4daf,{'body':_0x1cbe29})[_0xef2b('0xc')](function(_0x1c6096){logger[_0xef2b('0x7')](JSON[_0xef2b('0x8')](_0x1c6096));})['catch'](function(_0x2f3022){logger['error'](_0x2f3022[_0xef2b('0xa')]);});};function getUser(_0x17ee47){return client['request'](_0xef2b('0xd'),{'options':{'raw':!![],'attributes':['id','internal','name',_0xef2b('0xe')],'where':_0x17ee47,'limit':0x1}})[_0xef2b('0xc')](function(_0xd90270){logger[_0xef2b('0x6')](_0xef2b('0xf')+JSON[_0xef2b('0x8')](_0x17ee47)+'|'+(_0xd90270[_0xef2b('0x10')][_0xef2b('0x11')]?_0xef2b('0x12'):'NOTFOUND'));return _0xd90270[_0xef2b('0x10')][_0xef2b('0x11')]?_0xd90270[_0xef2b('0x10')][0x0]:null;});}exports[_0xef2b('0x13')]=function(_0x17a419){return new BPromise(function(_0x3e849c,_0x53a0fd){if(_0x17a419){return getUser({'internal':_0x17a419})['then'](function(_0x584a03){return _0x3e849c(_0x584a03);})[_0xef2b('0x14')](function(_0x4df5e6){logger[_0xef2b('0x9')](_0x4df5e6[_0xef2b('0xa')]);return _0x3e849c(null);});}else{return _0x3e849c(null);}});};exports[_0xef2b('0x15')]=function(_0x220531){return new BPromise(function(_0x39d7c9,_0x55ec7d){if(_0x220531){return getUser({'interface':_0x220531})[_0xef2b('0xc')](function(_0x3e1426){return _0x39d7c9(_0x3e1426);})[_0xef2b('0x14')](function(_0x8c7b93){logger['error'](_0x8c7b93['stack']);return _0x39d7c9(null);});}else{return _0x39d7c9(null);}});};exports[_0xef2b('0x16')]=function(_0x1544de){return new BPromise(function(_0x270d1d,_0x1c51b8){if(_0x1544de){return getUser({'name':_0x1544de})[_0xef2b('0xc')](function(_0x41f8c6){return _0x270d1d(_0x41f8c6);})[_0xef2b('0x14')](function(_0x27571b){logger['error'](_0x27571b['stack']);return _0x270d1d(null);});}else{return _0x270d1d(null);}});};exports['getVoiceQueueByName']=function(_0x26b98a){return new BPromise(function(_0x196b31,_0x4f3a5c){if(_0x26b98a){return client[_0xef2b('0xb')](_0xef2b('0x17'),{'options':{'raw':!![],'attributes':['id',_0xef2b('0x18'),_0xef2b('0x19'),_0xef2b('0x1a'),_0xef2b('0x1b')],'where':{'name':_0x26b98a},'limit':0x1}})['then'](function(_0x5b659d){logger[_0xef2b('0x6')](_0xef2b('0x1c')+_0x26b98a+'|'+(_0x5b659d[_0xef2b('0x10')][_0xef2b('0x11')]?_0xef2b('0x12'):_0xef2b('0x1d')));return _0x196b31(_0x5b659d[_0xef2b('0x10')][_0xef2b('0x11')]?_0x5b659d[_0xef2b('0x10')][0x0]:null);})[_0xef2b('0x14')](function(_0xd14abf){logger[_0xef2b('0x9')](_0xd14abf[_0xef2b('0xa')]);return _0x196b31(null);});}else{return _0x196b31(null);}});};exports['addTime']=function(_0x44b414,_0x444d14){return moment(_0x44b414)[_0xef2b('0x1e')](_0x444d14,'seconds')[_0xef2b('0x1f')](_0xef2b('0x20'));};exports[_0xef2b('0x21')]=function(_0x5ad9a5,_0x5189d0){return moment(_0x5ad9a5)['subtract'](_0x5189d0,_0xef2b('0x22'))[_0xef2b('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xef2b('0x23')]=function(_0x439672,_0x4c14fb){return moment(_0x439672)[_0xef2b('0x24')](moment(_0x4c14fb),_0xef2b('0x22'));};exports[_0xef2b('0x25')]=function(_0x10c4f3,_0x18e493){return parseInt(_0x10c4f3,0xa)+parseInt(_0x18e493,0xa);};exports['now']=function(){return moment()['format'](_0xef2b('0x20'));};exports['isAfter']=function(_0x1da270,_0x3f744b){if(_0x3f744b){return moment(_0x1da270)[_0xef2b('0x26')](_0x3f744b);}else{return!![];}};exports['isBefore']=function(_0x23cacf,_0x532ed7){if(_0x532ed7){return moment(_0x23cacf)['isBefore'](_0x532ed7);}else if(_0x23cacf){return!![];}else{return![];}}; \ No newline at end of file -- 1.7.1